Skip to content

Instantly share code, notes, and snippets.

@velgun
Created September 12, 2022 19:07
Show Gist options
  • Save velgun/025dc2ba46dfd3072f16ccb1a4a881b2 to your computer and use it in GitHub Desktop.
Save velgun/025dc2ba46dfd3072f16ccb1a4a881b2 to your computer and use it in GitHub Desktop.
cadmium-playercore-6.0036.628.911.js
This file has been truncated, but you can view the full file.
a000.W95 = function() {
return typeof a000.Q95.C95 === 'function' ? a000.Q95.C95.apply(a000.Q95, arguments) : a000.Q95.C95;
};
a000.v95 = function() {
return typeof a000.Q95.F95 === 'function' ? a000.Q95.F95.apply(a000.Q95, arguments) : a000.Q95.F95;
};
a000.Q95 = (function(o95) {
return {
C95: function() {
var b95,
U95 = arguments;
switch (o95) {
case 16:
b95 = (U95[0] / U95[2] | U95[1]) * U95[3];
break;
case 4:
b95 = U95[0] < U95[1];
break;
case 3:
b95 = U95[1] / U95[0] / U95[2];
break;
case 10:
b95 = U95[0] + U95[2] + U95[1];
break;
case 20:
b95 = U95[1] >= U95[0];
break;
case 1:
b95 = U95[0] - U95[1];
break;
case 8:
b95 = void U95[1] !== U95[0];
break;
case 13:
b95 = U95[1] * U95[0];
break;
case 19:
b95 = (U95[0] - U95[2]) * U95[1];
break;
case 15:
b95 = U95[1] / U95[2] | U95[0];
break;
case 5:
b95 = U95[2] * U95[1] - U95[0];
break;
case 11:
b95 = (U95[0] + U95[2]) / U95[1];
break;
case 7:
b95 = U95[0] + U95[1];
break;
case 22:
b95 = (U95[2] - U95[0]) / U95[1];
break;
case 17:
b95 = U95[2] - U95[0] + U95[1];
break;
case 21:
b95 = U95[1] === U95[0];
break;
case 0:
b95 = U95[1] * U95[0] / U95[2];
break;
case 6:
b95 = U95[0] * U95[1] / U95[3] * U95[2];
break;
case 12:
b95 = U95[0] * U95[3] - U95[2] + U95[1];
break;
case 9:
b95 = U95[4] + U95[2] + U95[1] + U95[0] + U95[3];
break;
case 18:
b95 = U95[2] * (U95[3] - U95[1]) - U95[4] + -U95[0];
break;
case 2:
b95 = U95[1] / U95[0];
break;
case 14:
b95 = U95[3] + U95[0] / U95[1] * U95[2];
break;
}
return b95;
},
F95: function(I95) {
o95 = I95;
}
};
})();
a000.d95 = function() {
return typeof a000.Q95.F95 === 'function' ? a000.Q95.F95.apply(a000.Q95, arguments) : a000.Q95.F95;
};
function a000() {}
a000.s95 = function() {
return typeof a000.Q95.C95 === 'function' ? a000.Q95.C95.apply(a000.Q95, arguments) : a000.Q95.C95;
};
(function() {
(function(mb, yb) {
var ic,
sc,
Mb,
cd,
Bb,
Fb,
Tb,
ce,
de,
Kb,
Jb,
Bc,
ee,
dd,
fe,
ge,
wd,
Ea,
zb,
Qc,
he,
xd,
db,
tb,
Ab,
jc,
cc,
Pb,
ub,
Ub,
Lb,
Sc,
Gb,
tc,
Ib,
Vb,
ed,
kc,
gc,
hc,
fd,
yd,
ie,
uc,
vc,
Dc,
zd,
Tc,
lc,
gd,
Ac,
Ad,
je,
Jc,
Bd,
Cd,
Dd,
Ed,
mc,
Fd,
Gd,
Hd,
Lc,
nc,
oc,
Mc,
hd,
id,
jd,
ec,
jf,
Nb,
Cc,
ke,
kd,
pc,
le,
kf,
qc,
me,
lf,
ld,
ne,
mf,
Pc,
oe,
hf,
nf,
Id,
md,
of,
pf,
$d,
qf,
ae,
pe,
dc,
Uc,
qe,
Vc,
re,
fc,
se,
te,
ue,
ve,
sf,
be,
we,
vd,
xe,
rf,
ye,
Jd,
ze,
Ae,
Be,
Kd,
zc,
De,
Ce,
tf,
Xc,
Ee,
Md,
Yc,
Fe,
Ld,
Ge,
He,
Nd,
Je,
Ke,
qd,
Ec,
Nc,
Fc,
Le,
Me,
Ne,
Oe,
Pe,
Qe,
rd,
uf,
Re,
Se,
Pd,
Te,
bc,
Wc,
Kc,
nd,
wc,
rc,
od,
xc,
Rc,
Ie,
Ue,
Zc,
Ve,
vf,
$c,
We,
wf,
xf,
Xe,
Od,
pd,
Ye,
zf,
yf,
Oc,
bd,
Af,
Zd,
Bf,
Cf;
function Wb(fb, eb) {
if (!eb || "utf-8" === eb)
return sd(fb);
throw Error("unsupported encoding");
}
function Xb(fb, eb) {
if (!eb || "utf-8" === eb)
return td(fb);
throw Error("unsupported encoding");
}
function sd(fb) {
for (var eb = 0, cb, Za = fb.length, ib = ""; eb < Za;) {
cb = fb[eb++];
if (cb & 128)
if (192 === (cb & 224))
cb = ((cb & 31) << 6) + (fb[eb++] & 63);
else if (224 === (cb & 240))
cb = ((cb & 15) << 12) + ((fb[eb++] & 63) << 6) + (fb[eb++] & 63);
else
throw Error("unsupported character");
ib += String.fromCharCode(cb);
}
return ib;
}
function td(fb) {
var eb,
cb,
Za,
ib,
rb;
eb = fb.length;
cb = 0;
ib = 0;
for (Za = eb; Za--;) {
rb = fb.charCodeAt(Za);
128 > rb ? cb++ : cb = 2048 > rb ? cb + 2 : cb + 3;
}
cb = new Uint8Array(cb);
for (Za = 0; Za < eb; Za++) {
rb = fb.charCodeAt(Za);
128 > rb ? cb[ib++] = rb : (2048 > rb ? cb[ib++] = 192 | rb >>> 6 : (cb[ib++] = 224 | rb >>> 12, cb[ib++] = 128 | rb >>> 6 & 63), cb[ib++] = 128 | rb & 63);
}
return cb;
}
function Zb(fb, eb) {
if (fb === eb)
return !0;
if (!fb || !eb || fb.length != eb.length)
return !1;
for (var cb = 0; cb < fb.length; ++cb) {
if (fb[cb] != eb[cb])
return !1;
}
return !0;
}
function $b(fb) {
var Za;
if (!(fb && fb.constructor == Uint8Array || Array.isArray(fb)))
throw new TypeError("Cannot compute the hash code of " + fb);
for (var eb = 1, cb = 0; cb < fb.length; ++cb) {
Za = fb[cb];
if ("number" !== typeof Za)
throw new TypeError("Cannot compute the hash code over non-numeric elements: " + Za);
eb = 31 * eb + Za & 4294967295;
}
return eb;
}
function Ud(fb, eb) {
var gb;
if (fb === eb)
return !0;
if (!fb || !eb)
return !1;
eb instanceof Array || (eb = [eb]);
for (var cb = 0; cb < eb.length; ++cb) {
for (var Za = eb[cb], ib = !1, rb = 0; rb < fb.length; ++rb) {
gb = fb[rb];
if (Za.equals && "function" === typeof Za.equals && Za.equals(gb) || Za == gb) {
ib = !0;
break;
}
}
if (!ib)
return !1;
}
return !0;
}
function Vd(fb, eb) {
return Ud(fb, eb) && (fb.length == eb.length || Ud(eb, fb));
}
function Ma(fb, eb, cb) {
var Za,
ib;
cb && (Za = cb);
if ("object" !== typeof fb || "function" !== typeof fb.result || "function" !== typeof fb.error)
throw new TypeError("callback must be an object with function properties 'result' and 'error'.");
try {
ib = eb.call(Za, fb);
ib !== yb && fb.result(ib);
} catch (rb) {
try {
fb.error(rb);
} catch (gb) {}
}
}
function ab(fb, eb, cb) {
if ("object" !== typeof fb || "function" !== typeof fb.timeout)
throw new TypeError("callback must be an object with function properties 'result', 'timeout', and 'error'.");
Ma(fb, eb, cb);
}
function V(fb, eb, cb) {
1E5 > fb && (fb = 1E5 + fb);
Object.defineProperties(this, {
internalCode: {
value: fb,
writable: !1,
configurable: !1
},
responseCode: {
value: eb,
writable: !1,
configurable: !1
},
message: {
value: cb,
writable: !1,
configurable: !1
}
});
}
function ud(fb) {
switch (fb) {
case Nb.PSK:
case Nb.MGK:
return !0;
default:
return !1;
}
}
function Wd(fb) {
switch (fb) {
case Nb.PSK:
case Nb.MGK:
case Nb.X509:
case Nb.RSA:
case Nb.NPTICKET:
case Nb.ECC:
return !0;
default:
return !1;
}
}
function df(fb) {
return fb.toJSON();
}
function Xd(fb, eb) {
bd ? eb.result(bd) : Promise.resolve().then(function() {
return Ib.getKeyByName(fb);
}).catch(function() {
return Ib.generateKey({
name: fb
}, !1, ["wrapKey", "unwrapKey"]);
}).then(function(cb) {
bd = cb;
eb.result(bd);
}).catch(function(cb) {
eb.error(new db(V.INTERNAL_EXCEPTION, "Unable to get system key"));
});
}
function Yd(fb, eb) {
var cb,
Za;
cb = eb.masterToken;
Za = eb.userIdToken;
eb = eb.serviceTokens;
return {
NccpMethod: fb.method,
UserId: fb.userId,
UT: Za && Za.serialNumber,
MT: cb && cb.serialNumber + ":" + cb.sequenceNumber,
STCount: eb && eb.length
};
}
function ef(fb) {
return fb.uniqueKey();
}
function ff(fb, eb, cb, Za, ib) {
var Na;
function rb(ta, ma) {
ta.errorCode === Ea.ENTITY_REAUTH || ta.errorCode === Ea.ENTITYDATA_REAUTH ? (Za.clearCryptoContexts(), Ja()) : ta.errorCode !== Ea.USER_REAUTH && ta.errorCode !== Ea.USERDATA_REAUTH || gb(ma);
}
function gb(ta) {
if (ta = Za.getUserIdToken(ta))
(Za.removeUserIdToken(ta),
Ja());
}
function Ba(ta, ma, fa) {
var ba;
ba = [];
(function Z() {
ta.read(-1, ma, {
result: function(ea) {
Ma(fa, function() {
var aa,
ia,
ua,
ra,
la;
if (ea)
(ba.push(ea),
Z());
else
switch (ba.length) {
case 0:
return new Uint8Array(0);
case 1:
return ba[0];
default:
(ua = ba.length,
ra = 0);
for (ia = aa = 0; ia < ua; ia++) {
aa += ba[ia].length;
}
aa = new Uint8Array(aa);
for (ia = 0; ia < ua; ia++) {
la = ba[ia];
aa.set(la, ra);
ra += la.length;
}
return aa;
}
});
},
timeout: function() {
fa.timeout();
},
error: function(ea) {
fa.error(ea);
}
});
})();
}
function Ja() {
Za.getStoreState({
result: function(ta) {
for (var ma = Na.slice(), fa = 0; fa < ma.length; fa++) {
ma[fa]({
storeState: ta
});
}
},
timeout: function() {
fb.error("Timeout getting store state", "" + e);
},
error: function(ta) {
fb.error("Error getting store state", "" + ta);
}
});
}
Na = [];
this.addEventHandler = function(ta, ma) {
switch (ta) {
case "shouldpersist":
Na.push(ma);
}
};
this.send = function(ta) {
return new Promise(function(ma, fa) {
var ba,
W,
Z;
ba = ta.timeout;
W = new Zd(fb, cb, ta, Za.getKeyRequestData());
Z = new $d(ta.url);
fb.trace("Sending MSL request");
eb.request(cb, W, Z, ba, {
result: function(ea) {
var aa;
fb.trace("Received MSL response", {
Method: ta.method
});
if (ea) {
ta.allowTokenRefresh && Ja();
aa = ea.getErrorHeader();
aa ? (rb(aa, ta.profileGuid || ta.userId), fa({
success: !1,
error: aa
})) : Ba(ea, ba, {
result: function(ia) {
ma({
success: !0,
body: Wb(ia)
});
},
timeout: function() {
fa({
success: !1,
subCode: ib.MSL_READ_TIMEOUT
});
},
error: function(ia) {
fa({
success: !1,
error: ia
});
}
});
} else
fa({
success: !1,
error: new db(V.INTERNAL_EXCEPTION, "Null response stream"),
description: "Null response stream"
});
},
timeout: function() {
fa({
success: !1,
subCode: ib.MSL_REQUEST_TIMEOUT
});
},
error: function(ea) {
fa({
success: !1,
error: ea
});
}
});
});
};
this.hasUserIdToken = function(ta) {
return !!Za.getUserIdToken(ta);
};
this.getUserIdTokenKeys = function() {
return Za.getUserIdTokenKeys();
};
this.removeUserIdToken = gb;
this.clearUserIdTokens = function() {
Za.clearUserIdTokens();
Ja();
};
this.isErrorReauth = function(ta) {
return ta && ta.errorCode == Ea.USERDATA_REAUTH;
};
this.isErrorHeader = function(ta) {
return ta instanceof zc;
};
this.getErrorCode = function(ta) {
return ta && ta.errorCode;
};
this.getStateForMdx = function(ta) {
var ma,
fa;
ma = Za.getMasterToken();
ta = Za.getUserIdToken(ta);
fa = Za.getCryptoContext(ma);
return {
masterToken: ma,
userIdToken: ta,
cryptoContext: fa
};
};
this.buildPlayDataRequest = function(ta, ma) {
var fa;
fa = new ae();
eb.request(cb, new Zd(fb, cb, ta), fa, ta.timeout, {
result: function() {
ma.result(fa.getRequest());
},
error: function() {
ma.result(fa.getRequest());
},
timeout: function() {
ma.timeout();
}
});
};
this.rekeyUserIdToken = function(ta, ma) {
Za.rekeyUserIdToken(ta, ma);
Ja();
};
this.getServiceTokens = function(ta) {
var ma;
ma = Za.getMasterToken();
(ta = Za.getUserIdToken(ta)) && !ta.isBoundTo(ma) && (ta = yb);
return Za.getServiceTokens(ma, ta);
};
this.removeServiceToken = function(ta) {
var ma;
ma = Za.getMasterToken();
Za.getServiceTokens(ma).find(function(fa) {
return fa.name === ta;
}) && (Za.removeServiceTokens(ta, ma), Ja());
};
}
function gf(fb, eb, cb) {
var rb;
function Za() {
return Promise.resolve().then(function() {
return Ib.generateKey(eb, !1, ["wrapKey", "unwrapKey"]);
}).then(function(gb) {
return ib(gb.publicKey, gb.privateKey);
});
}
function ib(gb, Ba) {
return Promise.all([new Promise(function(Ja, Na) {
Ac(gb, {
result: Ja,
error: function(ta) {
Na(new db(V.INTERNAL_EXCEPTION, "Unable to create keyx public key", ta));
}
});
}), new Promise(function(Ja, Na) {
Jc(Ba, {
result: Ja,
error: function(ta) {
Na(new db(V.INTERNAL_EXCEPTION, "Unable to create keyx private key", ta));
}
});
})]).then(function(Ja) {
Ja = new vd("rsaKeypairId", cb, Ja[0], Ja[1]);
rb && (Ja.storeData = {
keyxPublicKey: gb,
keyxPrivateKey: Ba
});
return Ja;
});
}
rb = !fb.systemKeyWrapFormat;
return Promise.resolve().then(function() {
var gb,
Ba;
gb = fb.storeState;
Ba = gb && gb.keyxPublicKey;
gb = gb && gb.keyxPrivateKey;
return rb && Ba && gb ? ib(Ba, gb) : Za();
}).then(function(gb) {
var Ba,
Ja,
Na;
Ba = {};
Ba[Nb.NONE] = new hf();
Ja = new Pc(fb.esn);
Na = [new be()];
return {
entityAuthFactories: Ba,
entityAuthData: Ja,
keyExchangeFactories: Na,
keyRequestData: gb,
createKeyRequestData: rb ? Za : yb
};
});
}
sc = mb.nfCrypto || mb.msCrypto || mb.webkitCrypto || mb.crypto;
Mb = sc && (sc.webkitSubtle || sc.subtle);
cd = mb.nfCryptokeys || mb.msCryptokeys || mb.webkitCryptokeys || mb.cryptokeys;
(function(fb) {
var eb,
cb;
eb = (function() {
function Za(ib, rb) {
ib instanceof eb ? (this.abv = ib.abv, this.position = ib.position) : (this.abv = ib, this.position = rb || 0);
}
Za.prototype = {
readByte: function() {
return this.abv[this.position++];
},
writeByte: function(ib) {
this.abv[this.position++] = ib;
},
peekByte: function(ib) {
return this.abv[ib];
},
copyBytes: function(ib, rb, gb) {
var Ba;
Ba = new Uint8Array(this.abv.buffer, this.position, gb);
ib = new Uint8Array(ib.buffer, rb, gb);
Ba.set(ib);
this.position += gb;
},
seek: function(ib) {
this.position = ib;
},
skip: function(ib) {
this.position += ib;
},
getPosition: function() {
return this.position;
},
setPosition: function(ib) {
this.position = ib;
},
getRemaining: function() {
return this.abv.length - this.position;
},
getLength: function() {
return this.abv.length;
},
isEndOfStream: function() {
return this.position >= this.abv.length;
},
show: function() {
return "AbvStream: pos " + (this.getPosition().toString() + " of " + this.getLength().toString());
}
};
return Za;
})();
cb = {};
(function() {
var ea,
aa,
ia,
ua,
ra,
la,
pa,
ya,
na;
function Za(da, ha) {
var ka;
ha.writeByte(da.tagClass << 6 | da.constructed << 5 | da.tag);
ka = da.payloadLen;
if (128 > ka)
ha.writeByte(ka);
else {
for (var wa = ka, Qa = 0; wa;) {
++Qa;
wa >>= 8;
}
ha.writeByte(128 | Qa);
for (wa = 0; wa < Qa; ++wa) {
ha.writeByte(ka >> 8 * (Qa - wa - 1) & 255);
}
}
if (da.child)
for ((da.tag == ea.BIT_STRING && ha.writeByte(0), da = da._child); da;) {
if (!Za(da, ha))
return !1;
da = da.next;
}
else
switch (da.tag) {
case ea.INTEGER:
da.backingStore[da.dataIdx] >> 7 && ha.writeByte(0);
ha.copyBytes(da.backingStore, da.dataIdx, da.dataLen);
break;
case ea.BIT_STRING:
ha.writeByte(0);
ha.copyBytes(da.backingStore, da.dataIdx, da.dataLen);
break;
case ea.OCTET_STRING:
ha.copyBytes(da.backingStore, da.dataIdx, da.dataLen);
break;
case ea.OBJECT_IDENTIFIER:
ha.copyBytes(da.backingStore, da.dataIdx, da.dataLen);
}
return !0;
}
function ib(da) {
var ha,
ka;
ha = da.readByte();
ka = ha & 127;
if (ka == ha)
return ka;
if (3 < ka || 0 === ka)
return -1;
for (var wa = ha = 0; wa < ka; ++wa) {
ha = ha << 8 | da.readByte();
}
return ha;
}
function rb(da, ha, ka) {
var wa,
Qa,
La,
Pa,
Ra,
oa,
xa;
wa = da.backingStore;
Qa = new eb(wa, ha);
ha += ka;
ka = da;
if (8 < ra++)
return yb;
for (; Qa.getPosition() < ha;) {
Qa.getPosition();
Pa = Qa.readByte();
if (31 == (Pa & 31)) {
for (La = 0; Pa & 128;) {
La <<= 8;
La |= Pa & 127;
}
Pa = La;
}
Ra = Pa;
La = Ra & 31;
if (0 > La || 30 < La)
return yb;
Pa = ib(Qa);
if (0 > Pa || Pa > Qa.getRemaining())
return yb;
ka.constructed = Ra & 32;
ka.tagClass = (Ra & 192) >> 6;
ka.tag = La;
ka.dataLen = Pa;
ka.dataIdx = Qa.getPosition();
La = Qa;
oa = Ra;
Ra = Pa;
if (oa & 32)
La = !0;
else if (oa < ea.BIT_STRING || oa > ea.OCTET_STRING)
La = !1;
else {
xa = new eb(La);
oa == ea.BIT_STRING && xa.skip(1);
xa.readByte() >> 6 & 1 ? La = !1 : (oa = ib(xa), La = xa.getPosition() - La.getPosition() + oa == Ra);
}
La && (La = Qa.getPosition(), Ra = Pa, ka.tag == ea.BIT_STRING && (ka.dataIdx++, ka.dataLen--, La++, Ra--), ka.child = new aa(wa, ka), rb(ka.child, La, Ra));
ka.tag == ea.INTEGER && (La = Qa.getPosition(), 0 == Qa.peekByte(La) && Qa.peekByte(La + 1) >> 7 && (ka.dataIdx++, ka.dataLen--));
Qa.skip(Pa);
Qa.getPosition() < ha && (ka.next = new aa(wa, ka.parent), ka = ka.next);
}
ra--;
return da;
}
function gb(da, ha, ka) {
if (9 != ka)
return !1;
for (ka = 0; 9 > ka; ++ka) {
if (da[ha++] != la[ka])
return !1;
}
return !0;
}
function Ba(da) {
var ha;
if (!(da && da.child && da.child.next && da.child.child && da.child.next.child))
return !1;
ha = da.child.child;
return gb(ha.backingStore, ha.dataIdx, ha.dataLen) && 2 == da.nChildren && 2 == da.child.nChildren && 2 == da.child.next.child.nChildren ? !0 : !1;
}
function Ja(da) {
var ha;
if (!(da && da.child && da.child.next && da.child.next.child && da.child.next.next && da.child.next.next.child))
return !1;
ha = da.child.next.child;
return gb(ha.backingStore, ha.dataIdx, ha.dataLen) && 3 == da.nChildren && 2 == da.child.next.nChildren && 9 == da.child.next.next.child.nChildren ? !0 : !1;
}
function Na(da) {
var ha,
ka;
ha = ia.createSequenceNode();
ka = new ua(ha);
ka.addChild(ia.createSequenceNode());
ka.addChild(ia.createOidNode(la));
ka.addSibling(ia.createNullNode());
ka.addToParent(ha, ia.createBitStringNode(null));
ka.addChild(ia.createSequenceNode());
ka.addChild(ia.createIntegerNode(da.n));
ka.addSibling(ia.createIntegerNode(da.e));
return ha;
}
function ta(da) {
var ha;
da = da.child.next.child.child;
ha = da.data;
da = da.next;
return new pa(ha, da.data, null, null);
}
function ma(da) {
var ha,
ka;
ha = ia.createSequenceNode();
ka = new ua(ha);
ka.addChild(ia.createIntegerNode(new Uint8Array([0])));
ka.addSibling(ia.createSequenceNode());
ka.addChild(ia.createOidNode(la));
ka.addSibling(ia.createNullNode());
ka.addToParent(ha, ia.createOctetStringNode(null));
ka.addChild(ia.createSequenceNode());
ka.addChild(ia.createIntegerNode(new Uint8Array([0])));
ka.addSibling(ia.createIntegerNode(da.n));
ka.addSibling(ia.createIntegerNode(da.e));
ka.addSibling(ia.createIntegerNode(da.d));
ka.addSibling(ia.createIntegerNode(da.p));
ka.addSibling(ia.createIntegerNode(da.q));
ka.addSibling(ia.createIntegerNode(da.dp));
ka.addSibling(ia.createIntegerNode(da.dq));
ka.addSibling(ia.createIntegerNode(da.qi));
return ha;
}
function fa(da) {
var ha;
ha = [];
da = da.child.next.next.child.child.next;
for (var ka = 0; 8 > ka; ka++) {
ha.push(da.data);
da = da.next;
}
return new ya(ha[0], ha[1], ha[2], ha[3], ha[4], ha[5], ha[6], ha[7]);
}
function ba(da, ha, ka, wa) {
if (!(da instanceof pa || da instanceof ya))
return yb;
if (ka)
for (var Qa = 0; Qa < ka.length; ++Qa) {
if (-1 == na.indexOf(ka[Qa]))
return yb;
}
ha = {
kty: "RSA",
alg: ha,
key_ops: ka || [],
ext: wa == yb ? !1 : wa,
n: Bb(da.n, !0),
e: Bb(da.e, !0)
};
da instanceof ya && (ha.d = Bb(da.d, !0), ha.p = Bb(da.p, !0), ha.q = Bb(da.q, !0), ha.dp = Bb(da.dp, !0), ha.dq = Bb(da.dq, !0), ha.qi = Bb(da.qi, !0));
return ha;
}
function W(da) {
var ha,
ka,
wa,
Qa,
La,
Pa,
Ra,
oa,
xa,
Da;
if (!da.kty || "RSA" != da.kty || !da.n || !da.e)
return yb;
ha = ("RSA1_5 RSA-OAEP RSA-OAEP-256 RSA-OAEP-384 RSA-OAEP-512 RS256 RS384 RS512").split(" ");
if (da.alg && -1 == ha.indexOf(da.alg))
return yb;
ha = [];
da.use ? "enc" == da.use ? ha = ["encrypt", "decrypt", "wrap", "unwrap"] : "sig" == da.use && (ha = ["sign", "verify"]) : ha = da.key_ops;
ka = da.ext;
wa = Fb(da.n, !0);
Qa = Fb(da.e, !0);
if (da.d) {
La = Fb(da.d, !0);
Pa = Fb(da.p, !0);
Ra = Fb(da.q, !0);
oa = Fb(da.dp, !0);
xa = Fb(da.dq, !0);
Da = Fb(da.qi, !0);
return new ya(wa, Qa, La, Pa, Ra, oa, xa, Da, da.alg, ha, ka);
}
return new pa(wa, Qa, ka, ha);
}
function Z(da, ha, ka, wa) {
this.der = da;
this.type = ha;
this.keyOps = ka;
this.extractable = wa;
}
ea = {
BER: 0,
BOOLEAN: 1,
INTEGER: 2,
BIT_STRING: 3,
OCTET_STRING: 4,
NULL: 5,
OBJECT_IDENTIFIER: 6,
OBJECT_DESCRIPTOR: 7,
INSTANCE_OF_EXTERNAL: 8,
REAL: 9,
ENUMERATED: 10,
EMBEDDED_PPV: 11,
UTF8_STRING: 12,
RELATIVE_OID: 13,
SEQUENCE: 16,
SET: 17,
NUMERIC_STRING: 18,
PRINTABLE_STRING: 19,
TELETEX_STRING: 20,
T61_STRING: 20,
VIDEOTEX_STRING: 21,
IA5_STRING: 22,
UTC_TIME: 23,
GENERALIZED_TIME: 24,
GRAPHIC_STRING: 25,
VISIBLE_STRING: 26,
ISO64_STRING: 26,
GENERAL_STRING: 27,
UNIVERSAL_STRING: 28,
CHARACTER_STRING: 29,
BMP_STRING: 30
};
aa = function(da, ha, ka, wa, Qa, La) {
this._data = da;
this._parent = ha || yb;
this._constructed = ka || !1;
this._tagClass = 0;
this._tag = wa || 0;
this._dataIdx = Qa || 0;
this._dataLen = La || 0;
};
aa.prototype = {
_child: yb,
_next: yb,
get data() {
return new Uint8Array(this._data.buffer.slice(this._dataIdx, this._dataIdx + this._dataLen));
},
get backingStore() {
return this._data;
},
get constructed() {
return this._constructed;
},
set constructed(da) {
this._constructed = 0 != da ? !0 : !1;
},
get tagClass() {
return this._tagClass;
},
set tagClass(da) {
this._tagClass = da;
},
get tag() {
return this._tag;
},
set tag(da) {
this._tag = da;
},
get dataIdx() {
return this._dataIdx;
},
set dataIdx(da) {
this._dataIdx = da;
},
get dataLen() {
return this._dataLen;
},
set dataLen(da) {
this._dataLen = da;
},
get child() {
return this._child;
},
set child(da) {
this._child = da;
this._child.parent = this;
},
get next() {
return this._next;
},
set next(da) {
this._next = da;
},
get parent() {
return this._parent;
},
set parent(da) {
this._parent = da;
},
get payloadLen() {
var da;
da = 0;
if (this._child) {
for (var ha = this._child; ha;) {
da += ha.length;
ha = ha.next;
}
this._tag == ea.BIT_STRING && da++;
} else
switch (this._tag) {
case ea.INTEGER:
da = this._dataLen;
this._data[this._dataIdx] >> 7 && da++;
break;
case ea.BIT_STRING:
da = this._dataLen + 1;
break;
case ea.OCTET_STRING:
da = this._dataLen;
break;
case ea.NULL:
da = 0;
break;
case ea.OBJECT_IDENTIFIER:
gb(this._data, this._dataIdx, this._dataLen) && (da = 9);
}
return da;
},
get length() {
var da,
ha;
da = this.payloadLen;
if (127 < da)
for (ha = da; ha;) {
ha >>= 8;
++da;
}
return da + 2;
},
get der() {
var da,
ha;
da = this.length;
if (!da)
return yb;
da = new Uint8Array(da);
ha = new eb(da);
return Za(this, ha) ? da : yb;
},
get nChildren() {
for (var da = 0, ha = this._child; ha;) {
da++;
ha = ha.next;
}
return da;
}
};
ia = {
createSequenceNode: function() {
return new aa(null, null, !0, ea.SEQUENCE, null, null);
},
createOidNode: function(da) {
return new aa(da, null, !1, ea.OBJECT_IDENTIFIER, 0, da ? da.length : 0);
},
createNullNode: function() {
return new aa(null, null, !1, ea.NULL, null, null);
},
createBitStringNode: function(da) {
return new aa(da, null, !1, ea.BIT_STRING, 0, da ? da.length : 0);
},
createIntegerNode: function(da) {
return new aa(da, null, !1, ea.INTEGER, 0, da ? da.length : 0);
},
createOctetStringNode: function(da) {
return new aa(da, null, !1, ea.OCTET_STRING, 0, da ? da.length : 0);
}
};
ua = function(da) {
this._currentNode = this._rootNode = da;
};
ua.prototype = {
addChild: function(da) {
this.addTo(this._currentNode, da);
},
addSibling: function(da) {
this.addTo(this._currentNode.parent, da);
},
addTo: function(da, ha) {
this._currentNode = ha;
this._currentNode.parent = da;
if (da.child) {
for (da = da.child; da.next;) {
da = da.next;
}
da.next = ha;
} else
da.child = ha;
},
addToParent: function(da, ha) {
this.findNode(da) && this.addTo(da, ha);
},
findNode: function(da) {
for (var ha = this._currentNode; ha;) {
if (da == ha)
return !0;
ha = ha.parent;
}
return !1;
}
};
ra = 0;
la = new Uint8Array([42, 134, 72, 134, 247, 13, 1, 1, 1]);
pa = function(da, ha, ka, wa) {
this.n = da;
this.e = ha;
this.ext = ka;
this.keyOps = wa;
};
ya = function(da, ha, ka, wa, Qa, La, Pa, Ra, oa, xa, Da) {
this.n = da;
this.e = ha;
this.d = ka;
this.p = wa;
this.q = Qa;
this.dp = La;
this.dq = Pa;
this.qi = Ra;
this.alg = oa;
this.keyOps = xa;
this.ext = Da;
};
na = ("sign verify encrypt decrypt wrapKey unwrapKey deriveKey deriveBits").split(" ");
Z.prototype.getDer = function() {
return this.der;
};
Z.prototype.getType = function() {
return this.type;
};
Z.prototype.getKeyOps = function() {
return this.keyOps;
};
Z.prototype.getExtractable = function() {
return this.extractable;
};
cb.parse = function(da) {
ra = 0;
return rb(new aa(da), 0, da.length);
};
cb.show = function(da, ha) {};
cb.isRsaSpki = Ba;
cb.isRsaPkcs8 = Ja;
cb.NodeFactory = ia;
cb.Builder = ua;
cb.tagVal = ea;
cb.RsaPublicKey = pa;
cb.RsaPrivateKey = ya;
cb.buildRsaSpki = Na;
cb.parseRsaSpki = function(da) {
da = cb.parse(da);
return Ba ? ta(da) : yb;
};
cb.buildRsaPkcs8 = ma;
cb.parseRsaPkcs8 = function(da) {
da = cb.parse(da);
return Ja(da) ? fa(da) : yb;
};
cb.buildRsaJwk = ba;
cb.parseRsaJwk = W;
cb.RsaDer = Z;
cb.rsaDerToJwk = function(da, ha, ka, wa) {
da = cb.parse(da);
if (!da)
return yb;
if (Ba(da))
da = ta(da);
else if (Ja(da))
da = fa(da);
else
return yb;
return ba(da, ha, ka, wa);
};
cb.jwkToRsaDer = function(da) {
var ha,
ka;
da = W(da);
if (!da)
return yb;
if (da instanceof pa) {
ha = "spki";
ka = Na(da).der;
} else if (da instanceof ya)
(ha = "pkcs8",
ka = ma(da).der);
else
return yb;
return new Z(ka, ha, da.keyOps, da.ext);
};
cb.webCryptoAlgorithmToJwkAlg = function(da) {
return "RSAES-PKCS1-v1_5" == da.name ? "RSA1_5" : "RSASSA-PKCS1-v1_5" == da.name ? "SHA-256" == da.hash.name ? "RS256" : "SHA-384" == da.hash.name ? "RS384" : "SHA-512" == da.hash.name ? "RS512" : yb : yb;
};
cb.webCryptoUsageToJwkKeyOps = function(da) {
return da.map(function(ha) {
return "wrapKey" == ha ? "wrap" : "unwrapKey" == ha ? "unwrap" : ha;
});
};
})();
fb.ASN1 = cb;
})(mb);
(function() {
for (var fb = {}, eb = {}, cb = {
"=": 0,
".": 0
}, Za = {
"=": 0,
".": 0
}, ib = /\s+/g, rb = /^[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/_-]*[=]{0,2}$/, gb = 64; gb--;) {
fb[("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")[gb]] = 262144 * gb;
eb[("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")[gb]] = 4096 * gb;
cb[("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")[gb]] = 64 * gb;
Za[("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")[gb]] = gb;
}
for (gb = 64; gb-- && ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")[gb] != ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_")[gb];) {
fb[("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_")[gb]] = 262144 * gb;
eb[("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_")[gb]] = 4096 * gb;
cb[("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_")[gb]] = 64 * gb;
Za[("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_")[gb]] = gb;
}
Bb = function(Ba, Ja) {
for (var Na = "", ta = 0, ma = Ba.length, fa = ma - 2, ba = Ja ? "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_" : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", W = Ja ? "" : "="; ta < fa;) {
Ja = 65536 * Ba[ta++] + 256 * Ba[ta++] + Ba[ta++];
Na += ba[Ja >>> 18] + ba[Ja >>> 12 & 63] + ba[Ja >>> 6 & 63] + ba[Ja & 63];
}
ta == fa ? (Ja = 65536 * Ba[ta++] + 256 * Ba[ta++], Na += ba[Ja >>> 18] + ba[Ja >>> 12 & 63] + ba[Ja >>> 6 & 63] + W) : ta == ma - 1 && (Ja = 65536 * Ba[ta++], Na += ba[Ja >>> 18] + ba[Ja >>> 12 & 63] + W + W);
return Na;
};
Fb = function(Ba, Ja) {
Ba = Ba.replace(ib, "");
if (Ja && (Ja = Ba.length % 4)) {
Ja = 4 - Ja;
for (var Na = 0; Na < Ja; ++Na) {
Ba += "=";
}
}
Ja = Ba.length;
if (0 != Ja % 4 || !rb.test(Ba))
throw Error("bad base64: " + Ba);
for (var ta = Ja / 4 * 3 - ("=" == Ba[Ja - 1] ? 1 : 0) - ("=" == Ba[Ja - 2] ? 1 : 0), ma = new Uint8Array(ta), fa = 0, ba = 0; fa < Ja;) {
Na = fb[Ba[fa++]] + eb[Ba[fa++]] + cb[Ba[fa++]] + Za[Ba[fa++]];
ma[ba++] = Na >>> 16;
ba < ta && (ma[ba++] = Na >>> 8 & 255, ba < ta && (ma[ba++] = Na & 255));
}
return ma;
};
})();
Tb = {};
(function() {
var rb,
gb,
Ba,
Na;
function fb(ta) {
if (!(this instanceof fb))
return new fb(ta);
for (var ma = 0, fa = gb.length; ma < fa; ma++) {
this[gb[ma]] = "";
}
this.bufferCheckPosition = Tb.MAX_BUFFER_LENGTH;
this.q = this.c = this.p = "";
this.opt = ta || ({});
this.closed = this.closedRoot = this.sawRoot = !1;
this.tag = this.error = null;
this.state = Ba.BEGIN;
this.stack = new rb();
this.index = this.position = this.column = 0;
this.line = 1;
this.slashed = !1;
this.unicodeI = 0;
this.unicodeS = null;
eb(this, "onready");
}
function eb(ta, ma, fa) {
if (ta[ma])
ta[ma](fa);
}
function cb(ta, ma) {
var fa,
ba;
fa = ta.opt;
ba = ta.textNode;
fa.trim && (ba = ba.trim());
fa.normalize && (ba = ba.replace(/\s+/g, " "));
ta.textNode = ba;
ta.textNode && eb(ta, ma ? ma : "onvalue", ta.textNode);
ta.textNode = "";
}
function Za(ta, ma) {
cb(ta);
ma += "\nLine: " + ta.line + "\nColumn: " + ta.column + "\nChar: " + ta.c;
ma = Error(ma);
ta.error = ma;
eb(ta, "onerror", ma);
return ta;
}
function ib(ta) {
ta.state !== Ba.VALUE && Za(ta, "Unexpected end");
cb(ta);
ta.c = "";
ta.closed = !0;
eb(ta, "onend");
fb.call(ta, ta.opt);
return ta;
}
rb = Array;
Tb.parser = function(ta) {
return new fb(ta);
};
Tb.CParser = fb;
Tb.MAX_BUFFER_LENGTH = 65536;
Tb.DEBUG = !1;
Tb.INFO = !1;
Tb.EVENTS = ("value string key openobject closeobject openarray closearray error end ready").split(" ");
gb = ["textNode", "numberNode"];
Tb.EVENTS.filter(function(ta) {
return "error" !== ta && "end" !== ta;
});
Ba = 0;
Tb.STATE = {
BEGIN: Ba++,
VALUE: Ba++,
OPEN_OBJECT: Ba++,
CLOSE_OBJECT: Ba++,
OPEN_ARRAY: Ba++,
CLOSE_ARRAY: Ba++,
TEXT_ESCAPE: Ba++,
STRING: Ba++,
BACKSLASH: Ba++,
END: Ba++,
OPEN_KEY: Ba++,
CLOSE_KEY: Ba++,
TRUE: Ba++,
TRUE2: Ba++,
TRUE3: Ba++,
FALSE: Ba++,
FALSE2: Ba++,
FALSE3: Ba++,
FALSE4: Ba++,
NULL: Ba++,
NULL2: Ba++,
NULL3: Ba++,
NUMBER_DECIMAL_POINT: Ba++,
NUMBER_DIGIT: Ba++
};
for (var Ja in Tb.STATE) {
Tb.STATE[Tb.STATE[Ja]] = Ja;
}
Ba = Tb.STATE;
Object.getPrototypeOf || (Object.getPrototypeOf = function(ta) {
return ta.__proto__;
});
Na = /[\\"\n]/g;
fb.prototype = {
end: function() {
ib(this);
},
write: function(ta) {
var ba,
W,
Z;
if (this.error)
throw this.error;
if (this.closed)
return Za(this, "Cannot write after close. Assign an onready handler.");
if (null === ta)
return ib(this);
for (var ma = ta[0], fa; ma;) {
fa = ma;
this.c = ma = ta.charAt(this.index++);
fa !== ma ? this.p = fa : fa = this.p;
if (!ma)
break;
this.position++;
"\n" === ma ? (this.line++, this.column = 0) : this.column++;
switch (this.state) {
case Ba.BEGIN:
"{" === ma ? this.state = Ba.OPEN_OBJECT : "[" === ma ? this.state = Ba.OPEN_ARRAY : "\r" !== ma && "\n" !== ma && " " !== ma && "\t" !== ma && Za(this, "Non-whitespace before {[.");
continue;
case Ba.OPEN_KEY:
case Ba.OPEN_OBJECT:
if ("\r" === ma || "\n" === ma || " " === ma || "\t" === ma)
continue;
if (this.state === Ba.OPEN_KEY)
this.stack.push(Ba.CLOSE_KEY);
else if ("}" === ma) {
eb(this, "onopenobject");
eb(this, "oncloseobject");
this.state = this.stack.pop() || Ba.VALUE;
continue;
} else
this.stack.push(Ba.CLOSE_OBJECT);
'"' === ma ? this.state = Ba.STRING : Za(this, 'Malformed object key should start with "');
continue;
case Ba.CLOSE_KEY:
case Ba.CLOSE_OBJECT:
if ("\r" === ma || "\n" === ma || " " === ma || "\t" === ma)
continue;
":" === ma ? (this.state === Ba.CLOSE_OBJECT ? (this.stack.push(Ba.CLOSE_OBJECT), cb(this, "onopenobject")) : cb(this, "onkey"), this.state = Ba.VALUE) : "}" === ma ? (cb(this), eb(this, "oncloseobject", void 0), this.state = this.stack.pop() || Ba.VALUE) : "," === ma ? (this.state === Ba.CLOSE_OBJECT && this.stack.push(Ba.CLOSE_OBJECT), cb(this), this.state = Ba.OPEN_KEY) : Za(this, "Bad object");
continue;
case Ba.OPEN_ARRAY:
case Ba.VALUE:
if ("\r" === ma || "\n" === ma || " " === ma || "\t" === ma)
continue;
if (this.state === Ba.OPEN_ARRAY)
if ((eb(this, "onopenarray"), this.state = Ba.VALUE, "]" === ma)) {
eb(this, "onclosearray");
this.state = this.stack.pop() || Ba.VALUE;
continue;
} else
this.stack.push(Ba.CLOSE_ARRAY);
'"' === ma ? this.state = Ba.STRING : "{" === ma ? this.state = Ba.OPEN_OBJECT : "[" === ma ? this.state = Ba.OPEN_ARRAY : "t" === ma ? this.state = Ba.TRUE : "f" === ma ? this.state = Ba.FALSE : "n" === ma ? this.state = Ba.NULL : "-" === ma ? this.numberNode += ma : "0" === ma ? (this.numberNode += ma, this.state = Ba.NUMBER_DIGIT) : -1 !== ("123456789").indexOf(ma) ? (this.numberNode += ma, this.state = Ba.NUMBER_DIGIT) : Za(this, "Bad value");
continue;
case Ba.CLOSE_ARRAY:
if ("," === ma)
(this.stack.push(Ba.CLOSE_ARRAY),
cb(this, "onvalue"),
this.state = Ba.VALUE);
else if ("]" === ma)
(cb(this),
eb(this, "onclosearray", void 0),
this.state = this.stack.pop() || Ba.VALUE);
else if ("\r" === ma || "\n" === ma || " " === ma || "\t" === ma)
continue;
else
Za(this, "Bad array");
continue;
case Ba.STRING:
fa = this.index - 1;
(ba = this.slashed,
W = this.unicodeI);
a:
for (;;) {
if (Tb.DEBUG)
for (; 0 < W;) {
if ((this.unicodeS += ma, ma = ta.charAt(this.index++), 4 === W ? (this.textNode += String.fromCharCode(parseInt(this.unicodeS, 16)), W = 0, fa = this.index - 1) : W++, !ma))
break a;
}
if ('"' === ma && !ba) {
this.state = this.stack.pop() || Ba.VALUE;
(this.textNode += ta.substring(fa, this.index - 1)) || eb(this, "onvalue", "");
break;
}
if ("\\" === ma && !ba && (ba = !0, this.textNode += ta.substring(fa, this.index - 1), ma = ta.charAt(this.index++), !ma))
break;
if (ba)
if ((ba = !1, "n" === ma ? this.textNode += "\n" : "r" === ma ? this.textNode += "\r" : "t" === ma ? this.textNode += "\t" : "f" === ma ? this.textNode += "\f" : "b" === ma ? this.textNode += "\b" : "u" === ma ? (W = 1, this.unicodeS = "") : this.textNode += ma, ma = ta.charAt(this.index++), fa = this.index - 1, ma))
continue;
else
break;
Na.lastIndex = this.index;
Z = Na.exec(ta);
if (null === Z) {
this.index = ta.length + 1;
this.textNode += ta.substring(fa, this.index - 1);
break;
}
this.index = Z.index + 1;
ma = ta.charAt(Z.index);
if (!ma) {
this.textNode += ta.substring(fa, this.index - 1);
break;
}
}
this.slashed = ba;
this.unicodeI = W;
continue;
case Ba.TRUE:
if ("" === ma)
continue;
"r" === ma ? this.state = Ba.TRUE2 : Za(this, "Invalid true started with t" + ma);
continue;
case Ba.TRUE2:
if ("" === ma)
continue;
"u" === ma ? this.state = Ba.TRUE3 : Za(this, "Invalid true started with tr" + ma);
continue;
case Ba.TRUE3:
if ("" === ma)
continue;
"e" === ma ? (eb(this, "onvalue", !0), this.state = this.stack.pop() || Ba.VALUE) : Za(this, "Invalid true started with tru" + ma);
continue;
case Ba.FALSE:
if ("" === ma)
continue;
"a" === ma ? this.state = Ba.FALSE2 : Za(this, "Invalid false started with f" + ma);
continue;
case Ba.FALSE2:
if ("" === ma)
continue;
"l" === ma ? this.state = Ba.FALSE3 : Za(this, "Invalid false started with fa" + ma);
continue;
case Ba.FALSE3:
if ("" === ma)
continue;
"s" === ma ? this.state = Ba.FALSE4 : Za(this, "Invalid false started with fal" + ma);
continue;
case Ba.FALSE4:
if ("" === ma)
continue;
"e" === ma ? (eb(this, "onvalue", !1), this.state = this.stack.pop() || Ba.VALUE) : Za(this, "Invalid false started with fals" + ma);
continue;
case Ba.NULL:
if ("" === ma)
continue;
"u" === ma ? this.state = Ba.NULL2 : Za(this, "Invalid null started with n" + ma);
continue;
case Ba.NULL2:
if ("" === ma)
continue;
"l" === ma ? this.state = Ba.NULL3 : Za(this, "Invalid null started with nu" + ma);
continue;
case Ba.NULL3:
if ("" === ma)
continue;
"l" === ma ? (eb(this, "onvalue", null), this.state = this.stack.pop() || Ba.VALUE) : Za(this, "Invalid null started with nul" + ma);
continue;
case Ba.NUMBER_DECIMAL_POINT:
"." === ma ? (this.numberNode += ma, this.state = Ba.NUMBER_DIGIT) : Za(this, "Leading zero not followed by .");
continue;
case Ba.NUMBER_DIGIT:
-1 !== ("0123456789").indexOf(ma) ? this.numberNode += ma : "." === ma ? (-1 !== this.numberNode.indexOf(".") && Za(this, "Invalid number has two dots"), this.numberNode += ma) : "e" === ma || "E" === ma ? (-1 === this.numberNode.indexOf("e") && -1 === this.numberNode.indexOf("E") || Za(this, "Invalid number has two exponential"), this.numberNode += ma) : "+" === ma || "-" === ma ? ("e" !== fa && "E" !== fa && Za(this, "Invalid symbol in number"), this.numberNode += ma) : (this.numberNode && eb(this, "onvalue", parseFloat(this.numberNode)), this.numberNode = "", this.index--, this.state = this.stack.pop() || Ba.VALUE);
continue;
default:
Za(this, "Unknown state: " + this.state);
}
}
if (this.position >= this.bufferCheckPosition) {
ta = Math.max(Tb.MAX_BUFFER_LENGTH, 10);
fa = ma = 0;
for (ba = gb.length; fa < ba; fa++) {
W = this[gb[fa]].length;
if (W > ta)
switch (gb[fa]) {
case "text":
break;
default:
Za(this, "Max buffer length exceeded: " + gb[fa]);
}
ma = Math.max(ma, W);
}
this.bufferCheckPosition = Tb.MAX_BUFFER_LENGTH - ma + this.position;
}
return this;
},
resume: function() {
this.error = null;
return this;
},
close: function() {
return this.write(null);
}
};
})();
(function() {
var Za,
ib,
rb;
function fb(gb, Ba) {
Ba || (Ba = gb.length);
return gb.reduce(function(Ja, Na, ta) {
return ta < Ba ? Ja + String.fromCharCode(Na) : Ja;
}, "");
}
for (var eb = {}, cb = 0; 256 > cb; ++cb) {
Za = fb([cb]);
eb[Za] = cb;
}
ib = Object.keys(eb).length;
rb = [];
for (cb = 0; 256 > cb; ++cb) {
rb[cb] = [cb];
}
ce = function(gb, Ba) {
var aa,
ia;
function Ja(ua, ra) {
var la;
for (; 0 < ra;) {
if (W >= ba.length)
return !1;
if (ra > Z) {
la = ua;
la >>>= ra - Z;
ba[W] |= la & 255;
ra -= Z;
Z = 8;
++W;
} else
ra <= Z && (la = ua, la <<= Z - ra, la &= 255, la >>>= 8 - Z, ba[W] |= la & 255, Z -= ra, ra = 0, 0 == Z && (Z = 8, ++W));
}
return !0;
}
for (var Na in eb) {
Ba[Na] = eb[Na];
}
for (var ta = ib, ma = [], fa = 8, ba = new Uint8Array(gb.length), W = 0, Z = 8, ea = 0; ea < gb.length; ++ea) {
aa = gb[ea];
ma.push(aa);
Na = fb(ma);
ia = Ba[Na];
if (!ia) {
ma = fb(ma, ma.length - 1);
if (!Ja(Ba[ma], fa))
return null;
0 != ta >> fa && ++fa;
Ba[Na] = ta++;
ma = [aa];
}
}
return 0 < ma.length && (Na = fb(ma), ia = Ba[Na], !Ja(ia, fa)) ? null : ba.subarray(0, 8 > Z ? W + 1 : W);
};
de = function(gb) {
var ea,
aa;
for (var Ba = rb.slice(), Ja = 0, Na = 0, ta = 8, ma = new Uint8Array(Math.ceil(1.5 * gb.length)), fa = 0, ba, W = []; Ja < gb.length && !(8 * (gb.length - Ja) - Na < ta);) {
for (var Z = ba = 0; Z < ta;) {
ea = Math.min(ta - Z, 8 - Na);
aa = gb[Ja];
aa <<= Na;
aa &= 255;
aa >>>= 8 - ea;
Z += ea;
Na += ea;
8 == Na && (Na = 0, ++Ja);
ba |= (aa & 255) << ta - Z;
}
Z = Ba[ba];
0 == W.length ? ++ta : (Z ? W.push(Z[0]) : W.push(W[0]), Ba[Ba.length] = W, W = [], Ba.length == 1 << ta && ++ta, Z || (Z = Ba[ba]));
ba = fa + Z.length;
ba >= ma.length && (ea = new Uint8Array(Math.ceil(1.5 * ba)), ea.set(ma), ma = ea);
ma.set(Z, fa);
fa = ba;
W = W.concat(Z);
}
return ma.subarray(0, fa);
};
})();
(function() {
var fb,
eb,
cb;
Kb = "utf-8";
Jb = 9007199254740992;
fb = Bc = {
GZIP: "GZIP",
LZW: "LZW"
};
Object.freeze(Bc);
ee = function(Za) {
for (var ib = [fb.GZIP, fb.LZW], rb = 0; rb < ib.length && 0 < Za.length; ++rb) {
for (var gb = ib[rb], Ba = 0; Ba < Za.length; ++Ba) {
if (Za[Ba] == gb)
return gb;
}
}
return null;
};
eb = dd = {
AES_CBC_PKCS5Padding: "AES/CBC/PKCS5Padding",
AESWrap: "AESWrap",
RSA_ECB_PKCS1Padding: "RSA/ECB/PKCS1Padding"
};
Object.freeze(dd);
fe = function(Za) {
return eb.AES_CBC_PKCS5Padding == Za ? eb.AES_CBC_PKCS5Padding : eb.RSA_ECB_PKCS1Padding == Za ? eb.RSA_ECB_PKCS1Padding : eb[Za];
};
cb = ge = {
HmacSHA256: "HmacSHA256",
SHA256withRSA: "SHA256withRSA"
};
Object.freeze(ge);
wd = function(Za) {
return cb[Za];
};
Ea = {
FAIL: 1,
TRANSIENT_FAILURE: 2,
ENTITY_REAUTH: 3,
USER_REAUTH: 4,
KEYX_REQUIRED: 5,
ENTITYDATA_REAUTH: 6,
USERDATA_REAUTH: 7,
EXPIRED: 8,
REPLAYED: 9,
SSOTOKEN_REJECTED: 10
};
Object.freeze(Ea);
})();
zb = {
isObjectLiteral: function(fb) {
return null !== fb && "object" === typeof fb && fb.constructor === Object;
},
extendDeep: function() {
var fb,
eb,
cb,
Za,
ib,
rb,
gb,
Ba;
fb = arguments[0];
eb = 1;
cb = arguments.length;
Za = !1;
"boolean" === typeof fb && (Za = fb, fb = arguments[1], eb = 2);
for (; eb < cb; eb++) {
if (null != (ib = arguments[eb]))
for (rb in ib) {
if (!(Za && (rb in fb))) {
gb = ib[rb];
if (fb !== gb && gb !== yb) {
Ba = fb[rb];
fb[rb] = null !== Ba && null !== gb && "object" === typeof Ba && "object" === typeof gb ? zb.extendDeep(Za, {}, Ba, gb) : gb;
}
}
}
}
return fb;
}
};
(function() {
var gb,
Ba;
function fb(Ja, Na) {
return function() {
var ta,
ma;
ta = Ja.base;
Ja.base = Na;
ma = Ja.apply(this, arguments);
Ja.base = ta;
return ma;
};
}
function eb(Ja, Na, ta) {
var ma,
fa,
ba,
W;
ta = ta || Ba;
fa = !!ta.extendAll;
for (ma in Na) {
ba = Na.__lookupGetter__(ma);
W = Na.__lookupSetter__(ma);
ba || W ? (ba && Ja.__defineGetter__(ma, ba), W && Ja.__defineSetter__(ma, W)) : (ba = Na[ma], W = Ja[ma], "function" === typeof ba && "function" === typeof W && ba !== W ? (ba.base !== Function.prototype.base && (ba = fb(ba, W)), ba.base = W) : (fa || ta[ma]) && zb.isObjectLiteral(ba) && zb.isObjectLiteral(W) && (ba = zb.extendDeep({}, W, ba)), Ja[ma] = ba);
}
}
function cb() {
var Ja,
Na;
Ja = Array.prototype.slice;
Na = Ja.call(arguments, 1);
return this.extend({
init: function ma() {
var fa;
fa = Ja.call(arguments, 0);
ma.base.apply(this, Na.concat(fa));
}
});
}
function Za(Ja, Na) {
var ta;
ta = new this(gb);
eb(ta, Ja, Na);
return rb(ta);
}
function ib(Ja, Na) {
eb(this.prototype, Ja, Na);
return this;
}
function rb(Ja) {
var Na;
Na = function() {
var ta;
ta = this.init;
ta && arguments[0] !== gb && ta.apply(this, arguments);
};
Ja && (Na.prototype = Ja);
Na.prototype.constructor = Na;
Na.extend = Za;
Na.bind = cb;
Na.mixin = ib;
return Na;
}
gb = {};
Ba = {
actions: !0
};
Function.prototype.base = function() {};
zb.Class = {
create: rb,
mixin: eb,
extend: function(Ja, Na) {
var ta;
ta = rb();
ta.prototype = new Ja();
return ta.extend(Na);
}
};
zb.mixin = function() {
zb.log && zb.log.warn("util.mixin is deprecated. Please change your code to use util.Class.mixin()");
eb.apply(null, arguments);
};
})();
(function() {
var gb,
Ba,
Ja;
function fb(Na, ta) {
return function() {
var ma,
fa;
ma = Na.base;
Na.base = ta;
fa = Na.apply(this, arguments);
Na.base = ma;
return fa;
};
}
function eb(Na, ta, ma) {
var fa,
ba,
W,
Z;
ma = ma || Ba;
ba = !!ma.extendAll;
for (fa in ta) {
W = ta.__lookupGetter__(fa);
Z = ta.__lookupSetter__(fa);
W || Z ? (W && Na.__defineGetter__(fa, W), Z && Na.__defineSetter__(fa, Z)) : (W = ta[fa], Z = Na[fa], "function" === typeof W && "function" === typeof Z && W !== Z ? (W.base !== Ja && (W = fb(W, Z)), W.base = Z) : (ba || ma[fa]) && zb.isObjectLiteral(W) && zb.isObjectLiteral(Z) && (W = zb.extendDeep({}, Z, W)), Na[fa] = W);
}
}
function cb() {
var Na,
ta;
Na = Array.prototype.slice;
ta = Na.call(arguments, 1);
return this.extend({
init: function fa() {
var ba;
ba = Na.call(arguments, 0);
fa.base.apply(this, ta.concat(ba));
}
});
}
function Za(Na, ta) {
var ma;
ma = new this(gb);
eb(ma, Na, ta);
return rb(ma);
}
function ib(Na, ta) {
eb(this.prototype, Na, ta);
return this;
}
function rb(Na) {
var ta;
ta = function() {
var ma;
ma = this.init;
ma && arguments[0] !== gb && ma.apply(this, arguments);
};
Na && (ta.prototype = Na);
ta.prototype.constructor = ta;
ta.extend = Za;
ta.bind = cb;
ta.mixin = ib;
return ta;
}
gb = {};
Ba = {
actions: !0
};
Ja = function() {};
Function.prototype.base = Ja;
zb.Class = {
create: rb,
mixin: eb,
extend: function(Na, ta) {
var ma;
ma = rb();
ma.prototype = new Na();
return ma.extend(ta);
}
};
zb.mixin = function() {
zb.log && zb.log.warn("util.mixin is deprecated. Please change your code to use util.Class.mixin()");
eb.apply(null, arguments);
};
})();
(function() {
function fb(cb) {
return cb == Jb ? 1 : cb + 1;
}
function eb(cb) {
if (0 === Object.keys(cb._waiters).length)
return 0;
for (var Za = fb(cb._nextWaiter); !cb._waiters[Za];) {
Za = fb(Za);
}
return Za;
}
Qc = zb.Class.create({
init: function() {
Object.defineProperties(this, {
_queue: {
value: [],
writable: !1,
enumerable: !1,
configurable: !1
},
_waiters: {
value: {},
writable: !1,
enumerable: !1,
configurable: !1
},
_nextWaiter: {
value: 0,
writable: !0,
enumerable: !1,
configurable: !1
},
_lastWaiter: {
value: 0,
writable: !0,
enumerable: !1,
configurable: !1
}
});
},
cancel: function(cb) {
var Za;
if (this._waiters[cb]) {
Za = this._waiters[cb];
delete this._waiters[cb];
cb == this._nextWaiter && (this._nextWaiter = eb(this));
Za.call(this, yb);
}
},
cancelAll: function() {
for (; 0 !== this._nextWaiter;) {
this.cancel(this._nextWaiter);
}
},
poll: function(cb, Za) {
var ib,
rb;
ib = this;
rb = fb(this._lastWaiter);
this._lastWaiter = rb;
ab(Za, function() {
var gb,
Ba;
if (0 < this._queue.length) {
gb = this._queue.shift();
setTimeout(function() {
Za.result(gb);
}, 0);
} else {
-1 != cb && (Ba = setTimeout(function() {
delete ib._waiters[rb];
rb == ib._nextWaiter && (ib._nextWaiter = eb(ib));
Za.timeout();
}, cb));
this._waiters[rb] = function(Ja) {
clearTimeout(Ba);
setTimeout(function() {
Za.result(Ja);
}, 0);
};
this._nextWaiter || (this._nextWaiter = rb);
}
}, ib);
return rb;
},
add: function(cb) {
var Za;
if (this._nextWaiter) {
Za = this._waiters[this._nextWaiter];
delete this._waiters[this._nextWaiter];
this._nextWaiter = eb(this);
Za.call(this, cb);
} else
this._queue.push(cb);
}
});
})();
(function() {
var fb;
fb = 0 - Jb;
he = zb.Class.create({
nextBoolean: function() {
var eb;
eb = new Uint8Array(1);
sc.getRandomValues(eb);
return eb[0] & 1 ? !0 : !1;
},
nextInt: function(eb) {
var cb;
if (null !== eb && eb !== yb) {
if ("number" !== typeof eb)
throw new TypeError("n must be of type number");
if (1 > eb)
throw new RangeError("n must be greater than zero");
--eb;
cb = new Uint8Array(4);
sc.getRandomValues(cb);
return Math.floor(((cb[3] & 127) << 24 | cb[2] << 16 | cb[1] << 8 | cb[0]) / 2147483648 * (eb - 0 + 1));
}
eb = new Uint8Array(4);
sc.getRandomValues(eb);
cb = (eb[3] & 127) << 24 | eb[2] << 16 | eb[1] << 8 | eb[0];
return eb[3] & 128 ? -cb : cb;
},
nextLong: function() {
var cb;
for (var eb = fb; eb == fb;) {
eb = new Uint8Array(7);
sc.getRandomValues(eb);
cb = 16777216 * ((eb[6] & 31) << 24 | eb[5] << 16 | eb[4] << 8 | eb[3]) + (eb[2] << 16 | eb[1] << 8 | eb[0]);
eb = eb[6] & 128 ? -cb - 1 : cb;
}
return eb;
},
nextBytes: function(eb) {
sc.getRandomValues(eb);
}
});
})();
(function() {
function fb(Za) {
return Za == Jb ? 1 : Za + 1;
}
function eb(Za) {
if (0 === Object.keys(Za._waitingReaders).length)
return 0;
for (var ib = fb(Za._nextReader); !Za._waitingReaders[ib];) {
ib = fb(ib);
}
return ib;
}
function cb(Za) {
if (0 === Object.keys(Za._waitingWriters).length)
return 0;
for (var ib = fb(Za._nextWriter); !Za._waitingWriters[ib];) {
ib = fb(ib);
}
return ib;
}
xd = zb.Class.create({
init: function() {
Object.defineProperties(this, {
_readers: {
value: {},
writable: !1,
enumerable: !1,
configurable: !1
},
_waitingReaders: {
value: {},
writable: !1,
enumerable: !1,
configurable: !1
},
_writer: {
value: null,
writable: !0,
enumerable: !1,
configurable: !1
},
_waitingWriters: {
value: {},
writable: !1,
enumerable: !1,
configurable: !1
},
_nextReader: {
value: 0,
writable: !0,
enumerable: !1,
configurable: !1
},
_nextWriter: {
value: 0,
writable: !0,
enumerable: !1,
configurable: !1
},
_lastNumber: {
value: 0,
writable: !0,
enumerable: !1,
configurable: !1
}
});
},
cancel: function(Za) {
var ib;
if (this._waitingReaders[Za]) {
ib = this._waitingReaders[Za];
delete this._waitingReaders[Za];
Za == this._nextReader && (this._nextReader = eb(this));
ib.call(this, !0);
}
this._waitingWriters[Za] && (ib = this._waitingWriters[Za], delete this._waitingWriters[Za], Za == this._nextWriter && (this._nextWriter = cb(this)), ib.call(this, !0));
},
cancelAll: function() {
for (; 0 !== this._nextWriter;) {
this.cancel(this._nextWriter);
}
for (; 0 !== this._nextReader;) {
this.cancel(this._nextReader);
}
},
readLock: function(Za, ib) {
var rb,
gb;
rb = this;
gb = fb(this._lastNumber);
this._lastNumber = gb;
ab(ib, function() {
var Ba;
if (!this._writer && 0 === Object.keys(this._waitingWriters).length)
return ( this._readers[gb] = !0, gb) ;
-1 != Za && (Ba = setTimeout(function() {
delete rb._waitingReaders[gb];
gb == rb._nextReader && (rb._nextReader = eb(rb));
ib.timeout();
}, Za));
this._waitingReaders[gb] = function(Ja) {
clearTimeout(Ba);
Ja ? setTimeout(function() {
ib.result(yb);
}, 0) : (rb._readers[gb] = !0, setTimeout(function() {
ib.result(gb);
}, 0));
};
this._nextReader || (this._nextReader = gb);
}, rb);
return gb;
},
writeLock: function(Za, ib) {
var rb,
gb;
rb = this;
gb = fb(this._lastNumber);
this._lastNumber = gb;
ab(ib, function() {
var Ba;
if (0 === Object.keys(this._readers).length && 0 === Object.keys(this._waitingReaders).length && !this._writer)
return this._writer = gb;
-1 != Za && (Ba = setTimeout(function() {
delete rb._waitingWriters[gb];
gb == rb._nextWriter && (rb._nextWriter = cb(rb));
ib.timeout();
}, Za));
this._waitingWriters[gb] = function(Ja) {
clearTimeout(Ba);
Ja ? setTimeout(function() {
ib.result(yb);
}, 0) : (rb._writer = gb, setTimeout(function() {
ib.result(gb);
}, 0));
};
this._nextWriter || (this._nextWriter = gb);
}, rb);
return gb;
},
unlock: function(Za) {
if (Za == this._writer)
this._writer = null;
else {
if (!this._readers[Za])
throw new ub("There is no reader or writer with ticket number " + Za + ".");
delete this._readers[Za];
}
if (this._nextWriter)
0 < Object.keys(this._readers).length || (Za = this._waitingWriters[this._nextWriter], delete this._waitingWriters[this._nextWriter], this._nextWriter = cb(this), Za.call(this, !1));
else {
for (var ib = this._nextReader; 0 < Object.keys(this._waitingReaders).length; ib = fb(ib)) {
this._waitingReaders[ib] && (Za = this._waitingReaders[ib], delete this._waitingReaders[ib], Za.call(this, !1));
}
this._nextReader = 0;
}
}
});
})();
zb.Class.mixin(V, {
JSON_PARSE_ERROR: new V(0, Ea.FAIL, "Error parsing JSON."),
JSON_ENCODE_ERROR: new V(1, Ea.FAIL, "Error encoding JSON."),
ENVELOPE_HASH_MISMATCH: new V(2, Ea.FAIL, "Computed hash does not match envelope hash."),
INVALID_PUBLIC_KEY: new V(3, Ea.FAIL, "Invalid public key provided."),
INVALID_PRIVATE_KEY: new V(4, Ea.FAIL, "Invalid private key provided."),
PLAINTEXT_ILLEGAL_BLOCK_SIZE: new V(5, Ea.FAIL, "Plaintext is not a multiple of the block size."),
PLAINTEXT_BAD_PADDING: new V(6, Ea.FAIL, "Plaintext contains incorrect padding."),
CIPHERTEXT_ILLEGAL_BLOCK_SIZE: new V(7, Ea.FAIL, "Ciphertext is not a multiple of the block size."),
CIPHERTEXT_BAD_PADDING: new V(8, Ea.FAIL, "Ciphertext contains incorrect padding."),
ENCRYPT_NOT_SUPPORTED: new V(9, Ea.FAIL, "Encryption not supported."),
DECRYPT_NOT_SUPPORTED: new V(10, Ea.FAIL, "Decryption not supported."),
ENVELOPE_KEY_ID_MISMATCH: new V(11, Ea.FAIL, "Encryption envelope key ID does not match crypto context key ID."),
CIPHERTEXT_ENVELOPE_PARSE_ERROR: new V(12, Ea.FAIL, "Error parsing ciphertext envelope."),
CIPHERTEXT_ENVELOPE_ENCODE_ERROR: new V(13, Ea.FAIL, "Error encoding ciphertext envelope."),
SIGN_NOT_SUPPORTED: new V(14, Ea.FAIL, "Sign not supported."),
VERIFY_NOT_SUPPORTED: new V(15, Ea.FAIL, "Verify not suppoprted."),
SIGNATURE_ERROR: new V(16, Ea.FAIL, "Signature not initialized or unable to process data/signature."),
HMAC_ERROR: new V(17, Ea.FAIL, "Error computing HMAC."),
ENCRYPT_ERROR: new V(18, Ea.FAIL, "Error encrypting plaintext."),
DECRYPT_ERROR: new V(19, Ea.FAIL, "Error decrypting ciphertext."),
INSUFFICIENT_CIPHERTEXT: new V(20, Ea.FAIL, "Insufficient ciphertext for decryption."),
SESSION_KEY_CREATION_FAILURE: new V(21, Ea.FAIL, "Error when creating session keys."),
ASN1_PARSE_ERROR: new V(22, Ea.FAIL, "Error parsing ASN.1."),
ASN1_ENCODE_ERROR: new V(23, Ea.FAIL, "Error encoding ASN.1."),
INVALID_SYMMETRIC_KEY: new V(24, Ea.FAIL, "Invalid symmetric key provided."),
INVALID_ENCRYPTION_KEY: new V(25, Ea.FAIL, "Invalid encryption key."),
INVALID_HMAC_KEY: new V(26, Ea.FAIL, "Invalid HMAC key."),
WRAP_NOT_SUPPORTED: new V(27, Ea.FAIL, "Wrap not supported."),
UNWRAP_NOT_SUPPORTED: new V(28, Ea.FAIL, "Unwrap not supported."),
UNIDENTIFIED_JWK_TYPE: new V(29, Ea.FAIL, "Unidentified JSON web key type."),
UNIDENTIFIED_JWK_USAGE: new V(30, Ea.FAIL, "Unidentified JSON web key usage."),
UNIDENTIFIED_JWK_ALGORITHM: new V(31, Ea.FAIL, "Unidentified JSON web key algorithm."),
WRAP_ERROR: new V(32, Ea.FAIL, "Error wrapping plaintext."),
UNWRAP_ERROR: new V(33, Ea.FAIL, "Error unwrapping ciphertext."),
INVALID_JWK: new V(34, Ea.FAIL, "Invalid JSON web key."),
INVALID_JWK_KEYDATA: new V(35, Ea.FAIL, "Invalid JSON web key keydata."),
UNSUPPORTED_JWK_ALGORITHM: new V(36, Ea.FAIL, "Unsupported JSON web key algorithm."),
WRAP_KEY_CREATION_FAILURE: new V(37, Ea.FAIL, "Error when creating wrapping key."),
INVALID_WRAP_CIPHERTEXT: new V(38, Ea.FAIL, "Invalid wrap ciphertext."),
UNSUPPORTED_JWE_ALGORITHM: new V(39, Ea.FAIL, "Unsupported JSON web encryption algorithm."),
JWE_ENCODE_ERROR: new V(40, Ea.FAIL, "Error encoding JSON web encryption header."),
JWE_PARSE_ERROR: new V(41, Ea.FAIL, "Error parsing JSON web encryption header."),
INVALID_ALGORITHM_PARAMS: new V(42, Ea.FAIL, "Invalid algorithm parameters."),
JWE_ALGORITHM_MISMATCH: new V(43, Ea.FAIL, "JSON web encryption header algorithms mismatch."),
KEY_IMPORT_ERROR: new V(44, Ea.FAIL, "Error importing key."),
KEY_EXPORT_ERROR: new V(45, Ea.FAIL, "Error exporting key."),
DIGEST_ERROR: new V(46, Ea.FAIL, "Error in digest."),
UNSUPPORTED_KEY: new V(47, Ea.FAIL, "Unsupported key type or algorithm."),
UNSUPPORTED_JWE_SERIALIZATION: new V(48, Ea.FAIL, "Unsupported JSON web encryption serialization."),
XML_PARSE_ERROR: new V(49, Ea.FAIL, "Error parsing XML."),
XML_ENCODE_ERROR: new V(50, Ea.FAIL, "Error encoding XML."),
INVALID_WRAPPING_KEY: new V(51, Ea.FAIL, "Invalid wrapping key."),
UNIDENTIFIED_CIPHERTEXT_ENVELOPE: new V(52, Ea.FAIL, "Unidentified ciphertext envelope version."),
UNIDENTIFIED_SIGNATURE_ENVELOPE: new V(53, Ea.FAIL, "Unidentified signature envelope version."),
UNSUPPORTED_CIPHERTEXT_ENVELOPE: new V(54, Ea.FAIL, "Unsupported ciphertext envelope version."),
UNSUPPORTED_SIGNATURE_ENVELOPE: new V(55, Ea.FAIL, "Unsupported signature envelope version."),
UNIDENTIFIED_CIPHERSPEC: new V(56, Ea.FAIL, "Unidentified cipher specification."),
UNIDENTIFIED_ALGORITHM: new V(57, Ea.FAIL, "Unidentified algorithm."),
SIGNATURE_ENVELOPE_PARSE_ERROR: new V(58, Ea.FAIL, "Error parsing signature envelope."),
SIGNATURE_ENVELOPE_ENCODE_ERROR: new V(59, Ea.FAIL, "Error encoding signature envelope."),
INVALID_SIGNATURE: new V(60, Ea.FAIL, "Invalid signature."),
WRAPKEY_FINGERPRINT_NOTSUPPORTED: new V(61, Ea.FAIL, "Wrap key fingerprint not supported"),
UNIDENTIFIED_JWK_KEYOP: new V(62, Ea.FAIL, "Unidentified JSON web key key operation."),
MASTERTOKEN_UNTRUSTED: new V(1E3, Ea.ENTITY_REAUTH, "Master token is not trusted."),
MASTERTOKEN_KEY_CREATION_ERROR: new V(1001, Ea.ENTITY_REAUTH, "Unable to construct symmetric keys from master token."),
MASTERTOKEN_EXPIRES_BEFORE_RENEWAL: new V(1002, Ea.ENTITY_REAUTH, "Master token expiration timestamp is before the renewal window opens."),
MASTERTOKEN_SESSIONDATA_MISSING: new V(1003, Ea.ENTITY_REAUTH, "No master token session data found."),
MASTERTOKEN_SEQUENCE_NUMBER_OUT_OF_RANGE: new V(1004, Ea.ENTITY_REAUTH, "Master token sequence number is out of range."),
MASTERTOKEN_SERIAL_NUMBER_OUT_OF_RANGE: new V(1005, Ea.ENTITY_REAUTH, "Master token serial number is out of range."),
MASTERTOKEN_TOKENDATA_INVALID: new V(1006, Ea.ENTITY_REAUTH, "Invalid master token data."),
MASTERTOKEN_SIGNATURE_INVALID: new V(1007, Ea.ENTITY_REAUTH, "Invalid master token signature."),
MASTERTOKEN_SESSIONDATA_INVALID: new V(1008, Ea.ENTITY_REAUTH, "Invalid master token session data."),
MASTERTOKEN_SEQUENCE_NUMBER_OUT_OF_SYNC: new V(1009, Ea.ENTITY_REAUTH, "Master token sequence number does not have the expected value."),
MASTERTOKEN_TOKENDATA_MISSING: new V(1010, Ea.ENTITY_REAUTH, "No master token data found."),
MASTERTOKEN_TOKENDATA_PARSE_ERROR: new V(1011, Ea.ENTITY_REAUTH, "Error parsing master token data."),
MASTERTOKEN_SESSIONDATA_PARSE_ERROR: new V(1012, Ea.ENTITY_REAUTH, "Error parsing master token session data."),
MASTERTOKEN_IDENTITY_REVOKED: new V(1013, Ea.ENTITY_REAUTH, "Master token entity identity is revoked."),
MASTERTOKEN_REJECTED_BY_APP: new V(1014, Ea.ENTITY_REAUTH, "Master token is rejected by the application."),
USERIDTOKEN_MASTERTOKEN_MISMATCH: new V(2E3, Ea.USER_REAUTH, "User ID token master token serial number does not match master token serial number."),
USERIDTOKEN_NOT_DECRYPTED: new V(2001, Ea.USER_REAUTH, "User ID token is not decrypted or verified."),
USERIDTOKEN_MASTERTOKEN_NULL: new V(2002, Ea.USER_REAUTH, "User ID token requires a master token."),
USERIDTOKEN_EXPIRES_BEFORE_RENEWAL: new V(2003, Ea.USER_REAUTH, "User ID token expiration timestamp is before the renewal window opens."),
USERIDTOKEN_USERDATA_MISSING: new V(2004, Ea.USER_REAUTH, "No user ID token user data found."),
USERIDTOKEN_MASTERTOKEN_NOT_FOUND: new V(2005, Ea.USER_REAUTH, "User ID token is bound to an unknown master token."),
USERIDTOKEN_MASTERTOKEN_SERIAL_NUMBER_OUT_OF_RANGE: new V(2006, Ea.USER_REAUTH, "User ID token master token serial number is out of range."),
USERIDTOKEN_SERIAL_NUMBER_OUT_OF_RANGE: new V(2007, Ea.USER_REAUTH, "User ID token serial number is out of range."),
USERIDTOKEN_TOKENDATA_INVALID: new V(2008, Ea.USER_REAUTH, "Invalid user ID token data."),
USERIDTOKEN_SIGNATURE_INVALID: new V(2009, Ea.USER_REAUTH, "Invalid user ID token signature."),
USERIDTOKEN_USERDATA_INVALID: new V(2010, Ea.USER_REAUTH, "Invalid user ID token user data."),
USERIDTOKEN_IDENTITY_INVALID: new V(2011, Ea.USER_REAUTH, "Invalid user ID token user identity."),
RESERVED_2012: new V(2012, Ea.USER_REAUTH, "The entity is not associated with the user."),
USERIDTOKEN_IDENTITY_NOT_FOUND: new V(2013, Ea.USER_REAUTH, "The user identity was not found."),
USERIDTOKEN_PASSWORD_VERSION_CHANGED: new V(2014, Ea.USER_REAUTH, "The user identity must be reauthenticated because the password version changed."),
USERIDTOKEN_USERAUTH_DATA_MISMATCH: new V(2015, Ea.USER_REAUTH, "The user ID token and user authentication data user identities do not match."),
USERIDTOKEN_TOKENDATA_MISSING: new V(2016, Ea.USER_REAUTH, "No user ID token data found."),
USERIDTOKEN_TOKENDATA_PARSE_ERROR: new V(2017, Ea.USER_REAUTH, "Error parsing user ID token data."),
USERIDTOKEN_USERDATA_PARSE_ERROR: new V(2018, Ea.USER_REAUTH, "Error parsing user ID token user data."),
USERIDTOKEN_REVOKED: new V(2019, Ea.USER_REAUTH, "User ID token is revoked."),
USERIDTOKEN_REJECTED_BY_APP: new V(2020, Ea.USER_REAUTH, "User ID token is rejected by the application."),
SERVICETOKEN_MASTERTOKEN_MISMATCH: new V(3E3, Ea.FAIL, "Service token master token serial number does not match master token serial number."),
SERVICETOKEN_USERIDTOKEN_MISMATCH: new V(3001, Ea.FAIL, "Service token user ID token serial number does not match user ID token serial number."),
SERVICETOKEN_SERVICEDATA_INVALID: new V(3002, Ea.FAIL, "Service token data invalid."),
SERVICETOKEN_MASTERTOKEN_NOT_FOUND: new V(3003, Ea.FAIL, "Service token is bound to an unknown master token."),
SERVICETOKEN_USERIDTOKEN_NOT_FOUND: new V(3004, Ea.FAIL, "Service token is bound to an unknown user ID token."),
SERVICETOKEN_MASTERTOKEN_SERIAL_NUMBER_OUT_OF_RANGE: new V(3005, Ea.FAIL, "Service token master token serial number is out of range."),
SERVICETOKEN_USERIDTOKEN_SERIAL_NUMBER_OUT_OF_RANGE: new V(3006, Ea.FAIL, "Service token user ID token serial number is out of range."),
SERVICETOKEN_TOKENDATA_INVALID: new V(3007, Ea.FAIL, "Invalid service token data."),
SERVICETOKEN_SIGNATURE_INVALID: new V(3008, Ea.FAIL, "Invalid service token signature."),
SERVICETOKEN_TOKENDATA_MISSING: new V(3009, Ea.FAIL, "No service token data found."),
UNIDENTIFIED_ENTITYAUTH_SCHEME: new V(4E3, Ea.FAIL, "Unable to identify entity authentication scheme."),
ENTITYAUTH_FACTORY_NOT_FOUND: new V(4001, Ea.FAIL, "No factory registered for entity authentication scheme."),
X509CERT_PARSE_ERROR: new V(4002, Ea.ENTITYDATA_REAUTH, "Error parsing X.509 certificate data."),
X509CERT_ENCODE_ERROR: new V(4003, Ea.ENTITYDATA_REAUTH, "Error encoding X.509 certificate data."),
X509CERT_VERIFICATION_FAILED: new V(4004, Ea.ENTITYDATA_REAUTH, "X.509 certificate verification failed."),
ENTITY_NOT_FOUND: new V(4005, Ea.FAIL, "Entity not recognized."),
INCORRECT_ENTITYAUTH_DATA: new V(4006, Ea.FAIL, "Entity used incorrect entity authentication data type."),
RSA_PUBLICKEY_NOT_FOUND: new V(4007, Ea.ENTITYDATA_REAUTH, "RSA public key not found."),
NPTICKET_GRACE_PERIOD_EXCEEDED: new V(4008, Ea.ENTITYDATA_REAUTH, "Fake NP-Tickets cannot be used after the grace period when the Playstation Network is up."),
NPTICKET_SERVICE_ID_MISSING: new V(4009, Ea.ENTITYDATA_REAUTH, "NP-Ticket service ID is missing."),
NPTICKET_SERVICE_ID_DISALLOWED: new V(4010, Ea.ENTITYDATA_REAUTH, "NP-Ticket service ID is not allowed."),
NPTICKET_NOT_YET_VALID: new V(4011, Ea.ENTITYDATA_REAUTH, "NP-Ticket issuance date is in the future."),
NPTICKET_EXPIRED: new V(4012, Ea.ENTITYDATA_REAUTH, "NP-Ticket has expired."),
NPTICKET_PRIVATE_KEY_NOT_FOUND: new V(4013, Ea.ENTITYDATA_REAUTH, "No private key found for NP-Ticket GUID."),
NPTICKET_COOKIE_VERIFICATION_FAILED: new V(4014, Ea.ENTITYDATA_REAUTH, "NP-Ticket cookie signature verification failed."),
NPTICKET_INCORRECT_COOKIE_VERSION: new V(4015, Ea.ENTITYDATA_REAUTH, "Incorrect NP-Ticket cookie version."),
NPTICKET_BROKEN: new V(4016, Ea.ENTITYDATA_REAUTH, "NP-Ticket broken."),
NPTICKET_VERIFICATION_FAILED: new V(4017, Ea.ENTITYDATA_REAUTH, "NP-Ticket signature verification failed."),
NPTICKET_ERROR: new V(4018, Ea.ENTITYDATA_REAUTH, "Unknown NP-Ticket TCM error."),
NPTICKET_CIPHER_INFO_NOT_FOUND: new V(4019, Ea.ENTITYDATA_REAUTH, "No cipher information found for NP-Ticket."),
NPTICKET_INVALID_CIPHER_INFO: new V(4020, Ea.ENTITYDATA_REAUTH, "Cipher information for NP-Ticket is invalid."),
NPTICKET_UNSUPPORTED_VERSION: new V(4021, Ea.ENTITYDATA_REAUTH, "Unsupported NP-Ticket version."),
NPTICKET_INCORRECT_KEY_LENGTH: new V(4022, Ea.ENTITYDATA_REAUTH, "Incorrect NP-Ticket public key length."),
UNSUPPORTED_ENTITYAUTH_DATA: new V(4023, Ea.FAIL, "Unsupported entity authentication data."),
CRYPTEX_RSA_KEY_SET_NOT_FOUND: new V(4024, Ea.FAIL, "Cryptex RSA key set not found."),
ENTITY_REVOKED: new V(4025, Ea.FAIL, "Entity is revoked."),
ENTITY_REJECTED_BY_APP: new V(4026, Ea.ENTITYDATA_REAUTH, "Entity is rejected by the application."),
FORCE_LOGIN: new V(5E3, Ea.USERDATA_REAUTH, "User must login again."),
NETFLIXID_COOKIES_EXPIRED: new V(5001, Ea.USERDATA_REAUTH, "Netflix ID cookie identity has expired."),
NETFLIXID_COOKIES_BLANK: new V(5002, Ea.USERDATA_REAUTH, "Netflix ID or Secure Netflix ID cookie is blank."),
UNIDENTIFIED_USERAUTH_SCHEME: new V(5003, Ea.FAIL, "Unable to identify user authentication scheme."),
USERAUTH_FACTORY_NOT_FOUND: new V(5004, Ea.FAIL, "No factory registered for user authentication scheme."),
EMAILPASSWORD_BLANK: new V(5005, Ea.USERDATA_REAUTH, "Email or password is blank."),
AUTHMGR_COMMS_FAILURE: new V(5006, Ea.TRANSIENT_FAILURE, "Error communicating with authentication manager."),
EMAILPASSWORD_INCORRECT: new V(5007, Ea.USERDATA_REAUTH, "Email or password is incorrect."),
UNSUPPORTED_USERAUTH_DATA: new V(5008, Ea.FAIL, "Unsupported user authentication data."),
SSOTOKEN_BLANK: new V(5009, Ea.SSOTOKEN_REJECTED, "SSO token is blank."),
SSOTOKEN_NOT_ASSOCIATED: new V(5010, Ea.USERDATA_REAUTH, "SSO token is not associated with a Netflix user."),
USERAUTH_USERIDTOKEN_INVALID: new V(5011, Ea.USERDATA_REAUTH, "User authentication data user ID token is invalid."),
PROFILEID_BLANK: new V(5012, Ea.USERDATA_REAUTH, "Profile ID is blank."),
UNIDENTIFIED_USERAUTH_MECHANISM: new V(5013, Ea.FAIL, "Unable to identify user authentication mechanism."),
UNSUPPORTED_USERAUTH_MECHANISM: new V(5014, Ea.FAIL, "Unsupported user authentication mechanism."),
SSOTOKEN_INVALID: new V(5015, Ea.SSOTOKEN_REJECTED, "SSO token invalid."),
USERAUTH_MASTERTOKEN_MISSING: new V(5016, Ea.USERDATA_REAUTH, "User authentication required master token is missing."),
ACCTMGR_COMMS_FAILURE: new V(5017, Ea.TRANSIENT_FAILURE, "Error communicating with the account manager."),
SSO_ASSOCIATION_FAILURE: new V(5018, Ea.TRANSIENT_FAILURE, "SSO user association failed."),
SSO_DISASSOCIATION_FAILURE: new V(5019, Ea.TRANSIENT_FAILURE, "SSO user disassociation failed."),
MDX_USERAUTH_VERIFICATION_FAILED: new V(5020, Ea.USERDATA_REAUTH, "MDX user authentication data verification failed."),
USERAUTH_USERIDTOKEN_NOT_DECRYPTED: new V(5021, Ea.USERDATA_REAUTH, "User authentication data user ID token is not decrypted or verified."),
MDX_USERAUTH_ACTION_INVALID: new V(5022, Ea.USERDATA_REAUTH, "MDX user authentication data action is invalid."),
CTICKET_DECRYPT_ERROR: new V(5023, Ea.USERDATA_REAUTH, "CTicket decryption failed."),
USERAUTH_MASTERTOKEN_INVALID: new V(5024, Ea.USERDATA_REAUTH, "User authentication data master token is invalid."),
USERAUTH_MASTERTOKEN_NOT_DECRYPTED: new V(5025, Ea.USERDATA_REAUTH, "User authentication data master token is not decrypted or verified."),
CTICKET_CRYPTOCONTEXT_ERROR: new V(5026, Ea.USERDATA_REAUTH, "Error creating CTicket crypto context."),
MDX_PIN_BLANK: new V(5027, Ea.USERDATA_REAUTH, "MDX controller or target PIN is blank."),
MDX_PIN_MISMATCH: new V(5028, Ea.USERDATA_REAUTH, "MDX controller and target PIN mismatch."),
MDX_USER_UNKNOWN: new V(5029, Ea.USERDATA_REAUTH, "MDX controller user ID token or CTicket is not decrypted or verified."),
USERAUTH_USERIDTOKEN_MISSING: new V(5030, Ea.USERDATA_REAUTH, "User authentication required user ID token is missing."),
MDX_CONTROLLERDATA_INVALID: new V(5031, Ea.USERDATA_REAUTH, "MDX controller authentication data is invalid."),
USERAUTH_ENTITY_MISMATCH: new V(5032, Ea.USERDATA_REAUTH, "User authentication data does not match entity identity."),
USERAUTH_INCORRECT_DATA: new V(5033, Ea.FAIL, "Entity used incorrect key request data type"),
SSO_ASSOCIATION_WITH_NONMEMBER: new V(5034, Ea.USERDATA_REAUTH, "SSO user association failed because the customer is not a member."),
SSO_ASSOCIATION_WITH_FORMERMEMBER: new V(5035, Ea.USERDATA_REAUTH, "SSO user association failed because the customer is a former member."),
SSO_ASSOCIATION_CONFLICT: new V(5036, Ea.USERDATA_REAUTH, "SSO user association failed because the token identifies a different member."),
USER_REJECTED_BY_APP: new V(5037, Ea.USERDATA_REAUTH, "User is rejected by the application."),
PROFILE_SWITCH_DISALLOWED: new V(5038, Ea.TRANSIENT_FAILURE, "Unable to switch user profile."),
MEMBERSHIPCLIENT_COMMS_FAILURE: new V(5039, Ea.TRANSIENT_FAILURE, "Error communicating with the membership manager."),
USERIDTOKEN_IDENTITY_NOT_ASSOCIATED_WITH_ENTITY: new V(5040, Ea.USER_REAUTH, "The entity is not associated with the user."),
UNSUPPORTED_COMPRESSION: new V(6E3, Ea.FAIL, "Unsupported compression algorithm."),
COMPRESSION_ERROR: new V(6001, Ea.FAIL, "Error compressing data."),
UNCOMPRESSION_ERROR: new V(6002, Ea.FAIL, "Error uncompressing data."),
MESSAGE_ENTITY_NOT_FOUND: new V(6003, Ea.FAIL, "Message header entity authentication data or master token not found."),
PAYLOAD_MESSAGE_ID_MISMATCH: new V(6004, Ea.FAIL, "Payload chunk message ID does not match header message ID ."),
PAYLOAD_SEQUENCE_NUMBER_MISMATCH: new V(6005, Ea.FAIL, "Payload chunk sequence number does not match expected sequence number."),
PAYLOAD_VERIFICATION_FAILED: new V(6006, Ea.FAIL, "Payload chunk payload signature verification failed."),
MESSAGE_DATA_MISSING: new V(6007, Ea.FAIL, "No message data found."),
MESSAGE_FORMAT_ERROR: new V(6008, Ea.FAIL, "Malformed message data."),
MESSAGE_VERIFICATION_FAILED: new V(6009, Ea.FAIL, "Message header/error data signature verification failed."),
HEADER_DATA_MISSING: new V(6010, Ea.FAIL, "No header data found."),
PAYLOAD_DATA_MISSING: new V(6011, Ea.FAIL, "No payload data found in non-EOM payload chunk."),
PAYLOAD_DATA_CORRUPT: new V(6012, Ea.FAIL, "Corrupt payload data found in non-EOM payload chunk."),
UNIDENTIFIED_COMPRESSION: new V(6013, Ea.FAIL, "Unidentified compression algorithm."),
MESSAGE_EXPIRED: new V(6014, Ea.EXPIRED, "Message expired and not renewable. Rejected."),
MESSAGE_ID_OUT_OF_RANGE: new V(6015, Ea.FAIL, "Message ID is out of range."),
INTERNAL_CODE_NEGATIVE: new V(6016, Ea.FAIL, "Error header internal code is negative."),
UNEXPECTED_RESPONSE_MESSAGE_ID: new V(6017, Ea.FAIL, "Unexpected response message ID. Possible replay."),
RESPONSE_REQUIRES_ENCRYPTION: new V(6018, Ea.KEYX_REQUIRED, "Message response requires encryption."),
PAYLOAD_SEQUENCE_NUMBER_OUT_OF_RANGE: new V(6019, Ea.FAIL, "Payload chunk sequence number is out of range."),
PAYLOAD_MESSAGE_ID_OUT_OF_RANGE: new V(6020, Ea.FAIL, "Payload chunk message ID is out of range."),
MESSAGE_REPLAYED: new V(6021, Ea.REPLAYED, "Non-replayable message replayed."),
INCOMPLETE_NONREPLAYABLE_MESSAGE: new V(6022, Ea.FAIL, "Non-replayable message sent non-renewable or without key request data or without a master token."),
HEADER_SIGNATURE_INVALID: new V(6023, Ea.FAIL, "Invalid Header signature."),
HEADER_DATA_INVALID: new V(6024, Ea.FAIL, "Invalid header data."),
PAYLOAD_INVALID: new V(6025, Ea.FAIL, "Invalid payload."),
PAYLOAD_SIGNATURE_INVALID: new V(6026, Ea.FAIL, "Invalid payload signature."),
RESPONSE_REQUIRES_MASTERTOKEN: new V(6027, Ea.KEYX_REQUIRED, "Message response requires a master token."),
RESPONSE_REQUIRES_USERIDTOKEN: new V(6028, Ea.USER_REAUTH, "Message response requires a user ID token."),
REQUEST_REQUIRES_USERAUTHDATA: new V(6029, Ea.FAIL, "User-associated message requires user authentication data."),
UNEXPECTED_MESSAGE_SENDER: new V(6030, Ea.FAIL, "Message sender is equal to the local entity or not the master token entity."),
NONREPLAYABLE_MESSAGE_REQUIRES_MASTERTOKEN: new V(6031, Ea.FAIL, "Non-replayable message requires a master token."),
NONREPLAYABLE_ID_OUT_OF_RANGE: new V(6032, Ea.FAIL, "Non-replayable message non-replayable ID is out of range."),
MESSAGE_SERVICETOKEN_MISMATCH: new V(6033, Ea.FAIL, "Service token master token or user ID token serial number does not match the message token serial numbers."),
MESSAGE_PEER_SERVICETOKEN_MISMATCH: new V(6034, Ea.FAIL, "Peer service token master token or user ID token serial number does not match the message peer token serial numbers."),
RESPONSE_REQUIRES_INTEGRITY_PROTECTION: new V(6035, Ea.KEYX_REQUIRED, "Message response requires integrity protection."),
HANDSHAKE_DATA_MISSING: new V(6036, Ea.FAIL, "Handshake message is not renewable or does not contain key request data."),
MESSAGE_RECIPIENT_MISMATCH: new V(6037, Ea.FAIL, "Message recipient does not match local identity."),
UNIDENTIFIED_KEYX_SCHEME: new V(7E3, Ea.FAIL, "Unable to identify key exchange scheme."),
KEYX_FACTORY_NOT_FOUND: new V(7001, Ea.FAIL, "No factory registered for key exchange scheme."),
KEYX_REQUEST_NOT_FOUND: new V(7002, Ea.FAIL, "No key request found matching header key response data."),
UNIDENTIFIED_KEYX_KEY_ID: new V(7003, Ea.FAIL, "Unable to identify key exchange key ID."),
UNSUPPORTED_KEYX_KEY_ID: new V(7004, Ea.FAIL, "Unsupported key exchange key ID."),
UNIDENTIFIED_KEYX_MECHANISM: new V(7005, Ea.FAIL, "Unable to identify key exchange mechanism."),
UNSUPPORTED_KEYX_MECHANISM: new V(7006, Ea.FAIL, "Unsupported key exchange mechanism."),
KEYX_RESPONSE_REQUEST_MISMATCH: new V(7007, Ea.FAIL, "Key exchange response does not match request."),
KEYX_PRIVATE_KEY_MISSING: new V(7008, Ea.FAIL, "Key exchange private key missing."),
UNKNOWN_KEYX_PARAMETERS_ID: new V(7009, Ea.FAIL, "Key exchange parameters ID unknown or invalid."),
KEYX_MASTER_TOKEN_MISSING: new V(7010, Ea.FAIL, "Master token required for key exchange is missing."),
KEYX_INVALID_PUBLIC_KEY: new V(7011, Ea.FAIL, "Key exchange public key is invalid."),
KEYX_PUBLIC_KEY_MISSING: new V(7012, Ea.FAIL, "Key exchange public key missing."),
KEYX_WRAPPING_KEY_MISSING: new V(7013, Ea.FAIL, "Key exchange wrapping key missing."),
KEYX_WRAPPING_KEY_ID_MISSING: new V(7014, Ea.FAIL, "Key exchange wrapping key ID missing."),
KEYX_INVALID_WRAPPING_KEY: new V(7015, Ea.FAIL, "Key exchange wrapping key is invalid."),
KEYX_INCORRECT_DATA: new V(7016, Ea.FAIL, "Entity used incorrect wrapping key data type"),
CRYPTEX_ENCRYPTION_ERROR: new V(8E3, Ea.FAIL, "Error encrypting data with cryptex."),
CRYPTEX_DECRYPTION_ERROR: new V(8001, Ea.FAIL, "Error decrypting data with cryptex."),
CRYPTEX_MAC_ERROR: new V(8002, Ea.FAIL, "Error computing MAC with cryptex."),
CRYPTEX_VERIFY_ERROR: new V(8003, Ea.FAIL, "Error verifying MAC with cryptex."),
CRYPTEX_CONTEXT_CREATION_FAILURE: new V(8004, Ea.FAIL, "Error creating cryptex cipher or MAC context."),
DATAMODEL_DEVICE_ACCESS_ERROR: new V(8005, Ea.TRANSIENT_FAILURE, "Error accessing data model device."),
DATAMODEL_DEVICETYPE_NOT_FOUND: new V(8006, Ea.FAIL, "Data model device type not found."),
CRYPTEX_KEYSET_UNSUPPORTED: new V(8007, Ea.FAIL, "Cryptex key set not supported."),
CRYPTEX_PRIVILEGE_EXCEPTION: new V(8008, Ea.FAIL, "Insufficient privileges for cryptex operation."),
CRYPTEX_WRAP_ERROR: new V(8009, Ea.FAIL, "Error wrapping data with cryptex."),
CRYPTEX_UNWRAP_ERROR: new V(8010, Ea.FAIL, "Error unwrapping data with cryptex."),
CRYPTEX_COMMS_FAILURE: new V(8011, Ea.TRANSIENT_FAILURE, "Error comunicating with cryptex."),
CRYPTEX_SIGN_ERROR: new V(8012, Ea.FAIL, "Error computing signature with cryptex."),
INTERNAL_EXCEPTION: new V(9E3, Ea.TRANSIENT_FAILURE, "Internal exception."),
MSL_COMMS_FAILURE: new V(9001, Ea.FAIL, "Error communicating with MSL entity."),
NONE: new V(9999, Ea.FAIL, "Special unit test error.")
});
Object.freeze(V);
(function() {
db = zb.Class.create(Error());
db.mixin({
init: function(fb, eb, cb) {
var ib,
rb,
gb;
function Za() {
return rb ? rb : this.cause && this.cause instanceof db ? this.cause.messageId : yb;
}
Error.captureStackTrace && Error.captureStackTrace(this, this.constructor);
ib = fb.message;
eb && (ib += " [" + eb + "]");
gb = this.stack;
Object.defineProperties(this, {
message: {
value: ib,
writable: !1,
configurable: !0
},
error: {
value: fb,
writable: !1,
configurable: !0
},
cause: {
value: cb,
writable: !1,
configurable: !0
},
name: {
value: "MslException",
writable: !1,
configurable: !0
},
masterToken: {
value: null,
writable: !0,
configurable: !1
},
entityAuthenticationData: {
value: null,
writable: !0,
configurable: !1
},
userIdToken: {
value: null,
writable: !0,
configurable: !1
},
userAuthenticationData: {
value: null,
writable: !0,
configurable: !1
},
messageId: {
get: Za,
set: function(Ba) {
if (0 > Ba || Ba > Jb)
throw new RangeError("Message ID " + Ba + " is outside the valid range.");
Za() || (rb = Ba);
},
configurable: !0
},
stack: {
get: function() {
var Ba;
Ba = this.toString();
gb && (Ba += "\n" + gb);
cb && cb.stack && (Ba += "\nCaused by " + cb.stack);
return Ba;
},
configurable: !0
}
});
},
setEntity: function(fb) {
!fb || this.masterToken || this.entityAuthenticationData || (fb instanceof bc ? this.masterToken = fb : fb instanceof Cc && (this.entityAuthenticationData = fb));
return this;
},
setUser: function(fb) {
!fb || this.userIdToken || this.userAuthenticationData || (fb instanceof Kc ? this.userIdToken = fb : fb instanceof Rc && (this.userAuthenticationData = fb));
return this;
},
setMessageId: function(fb) {
this.messageId = fb;
return this;
},
toString: function() {
return this.name + ": " + this.message;
}
});
})();
tb = db.extend({
init: function ib(eb, cb, Za) {
ib.base.call(this, eb, cb, Za);
Object.defineProperties(this, {
name: {
value: "MslCryptoException",
writable: !1,
configurable: !0
}
});
}
});
Ab = db.extend({
init: function rb(cb, Za, ib) {
rb.base.call(this, cb, Za, ib);
Object.defineProperties(this, {
name: {
value: "MslEncodingException",
writable: !1,
configurable: !0
}
});
}
});
jc = db.extend({
init: function gb(Za, ib, rb) {
gb.base.call(this, Za, ib, rb);
Object.defineProperties(this, {
name: {
value: "MslEntityAuthException",
writable: !1,
configurable: !0
}
});
}
});
(function() {
cc = zb.Class.create(Error());
cc.mixin({
init: function(Za, ib, rb) {
var gb;
Error.captureStackTrace && Error.captureStackTrace(this, this.constructor);
gb = this.stack;
Object.defineProperties(this, {
message: {
value: Za,
writable: !1,
configurable: !1
},
cause: {
value: ib,
writable: !1,
configurable: !1
},
requestCause: {
value: rb,
writable: !1,
configurable: !1
},
name: {
value: "MslErrorResponseException",
writable: !1,
configurable: !0
},
stack: {
get: function() {
var Ba;
Ba = this.toString();
gb && (Ba += "\n" + gb);
ib && ib.stack && (Ba += "\nCaused by " + ib.stack);
return Ba;
},
configurable: !0
}
});
},
toString: function() {
return this.name + ": " + this.message;
}
});
})();
(function() {
Pb = zb.Class.create(Error());
Pb.mixin({
init: function(Za, ib) {
var rb;
Error.captureStackTrace && Error.captureStackTrace(this, this.constructor);
rb = this.stack;
Object.defineProperties(this, {
message: {
value: Za,
writable: !1,
configurable: !1
},
cause: {
value: ib,
writable: !1,
configurable: !1
},
name: {
value: "MslIoException",
writable: !1,
configurable: !0
},
stack: {
get: function() {
var gb;
gb = this.toString();
rb && (gb += "\n" + rb);
ib && ib.stack && (gb += "\nCaused by " + ib.stack);
return gb;
},
configurable: !0
}
});
},
toString: function() {
return this.name + ": " + this.message;
}
});
})();
(function() {
ub = zb.Class.create(Error());
ub.mixin({
init: function(Za, ib) {
var rb;
Error.captureStackTrace && Error.captureStackTrace(this, this.constructor);
rb = this.stack;
Object.defineProperties(this, {
message: {
value: Za,
writable: !1,
configurable: !1
},
cause: {
value: ib,
writable: !1,
configurable: !1
},
name: {
value: "MslInternalException",
writable: !1,
configurable: !0
},
stack: {
get: function() {
var gb;
gb = this.toString();
rb && (gb += "\n" + rb);
ib && ib.stack && (gb += "\nCaused by " + ib.stack);
return gb;
},
configurable: !0
}
});
},
toString: function() {
return this.name + ": " + this.message;
}
});
})();
(function() {
Ub = zb.Class.create(Error());
Ub.mixin({
init: function(Za, ib) {
var rb;
Error.captureStackTrace && Error.captureStackTrace(this, this.constructor);
rb = this.stack;
Object.defineProperties(this, {
message: {
value: Za,
writable: !1,
configurable: !1
},
cause: {
value: ib,
writable: !1,
configurable: !1
},
name: {
value: "MslInterruptedException",
writable: !1,
configurable: !0
},
stack: {
get: function() {
var gb;
gb = this.toString();
rb && (gb += "\n" + rb);
ib && ib.stack && (gb += "\nCaused by " + ib.stack);
return gb;
},
configurable: !0
}
});
},
toString: function() {
return this.name + ": " + this.message;
}
});
})();
Lb = db.extend({
init: function Ba(ib, rb, gb) {
Ba.base.call(this, ib, rb, gb);
Object.defineProperties(this, {
name: {
value: "MslKeyExchangeException",
writable: !1,
configurable: !0
}
});
}
});
Sc = db.extend({
init: function Ba(rb, gb) {
Ba.base.call(this, rb);
Object.defineProperties(this, {
masterToken: {
value: gb,
writable: !1,
configurable: !1
},
name: {
value: "MslMasterTokenException",
writable: !1,
configurable: !0
}
});
}
});
Gb = db.extend({
init: function Na(gb, Ba, Ja) {
Na.base.call(this, gb, Ba, Ja);
Object.defineProperties(this, {
name: {
value: "MslMessageException",
writable: !1,
configurable: !0
}
});
}
});
tc = db.extend({
init: function ta(Ba, Ja, Na) {
ta.base.call(this, Ba, Ja, Na);
Object.defineProperties(this, {
name: {
value: "MslUserAuthException",
writable: !1,
configurable: !0
}
});
}
});
(function() {
var ma;
function Ba(fa) {
return "undefined" === typeof fa ? !1 : fa;
}
function Ja(fa) {
return fa && fa.length ? (Vb === ma.V2014_02 && (fa = fa.map(function(ba) {
return "wrap" == ba ? "wrapKey" : "unwrap" == ba ? "unwrapKey" : ba;
})), fa) : Vb === ma.V2014_02 ? ("encrypt decrypt sign verify deriveKey wrapKey unwrapKey").split(" ") : ("encrypt decrypt sign verify deriveKey wrap unwrap").split(" ");
}
function Na(fa, ba, W, Z, ea) {
return Promise.resolve().then(function() {
return Mb.importKey(fa, ba, W, Z, ea);
}).catch(function(aa) {
var ia;
if ("spki" !== fa && "pkcs8" !== fa)
throw aa;
aa = ASN1.webCryptoAlgorithmToJwkAlg(W);
ia = ASN1.webCryptoUsageToJwkKeyOps(ea);
aa = ASN1.rsaDerToJwk(ba, aa, ia, Z);
if (!aa)
throw Error("Could not make valid JWK from DER input");
aa = JSON.stringify(aa);
return Mb.importKey("jwk", td(aa), W, Z, ea);
});
}
function ta(fa, ba) {
return Promise.resolve().then(function() {
return Mb.exportKey(fa, ba);
}).catch(function(W) {
if ("spki" !== fa && "pkcs8" !== fa)
throw W;
return Mb.exportKey("jwk", ba).then(function(Z) {
Z = JSON.parse(sd(new Uint8Array(Z)));
Z = ASN1.jwkToRsaDer(Z);
if (!Z)
throw Error("Could not make valid DER from JWK input");
return Z.getDer().buffer;
});
});
}
ma = ed = {
LEGACY: 1,
V2014_01: 2,
V2014_02: 3,
LATEST: 3
};
Object.freeze(ed);
Vb = ma.LATEST;
Ib = {
encrypt: function(fa, ba, W) {
switch (Vb) {
case ma.LEGACY:
return new Promise(function(Z, ea) {
var aa;
aa = Mb.encrypt(fa, ba, W);
aa.oncomplete = function(ia) {
Z(ia.target.result);
};
aa.onerror = function(ia) {
ea(ia);
};
});
case ma.V2014_01:
case ma.V2014_02:
return Mb.encrypt(fa, ba, W).then(function(Z) {
return new Uint8Array(Z);
});
default:
throw Error("Unsupported Web Crypto version " + WEB_CRYPTO_VERSION + ".");
}
},
decrypt: function(fa, ba, W) {
switch (Vb) {
case ma.LEGACY:
return new Promise(function(Z, ea) {
var aa;
aa = Mb.decrypt(fa, ba, W);
aa.oncomplete = function(ia) {
Z(ia.target.result);
};
aa.onerror = function(ia) {
ea(ia);
};
});
case ma.V2014_01:
case ma.V2014_02:
return Mb.decrypt(fa, ba, W).then(function(Z) {
return new Uint8Array(Z);
});
default:
throw Error("Unsupported Web Crypto version " + WEB_CRYPTO_VERSION + ".");
}
},
sign: function(fa, ba, W) {
switch (Vb) {
case ma.LEGACY:
return new Promise(function(Z, ea) {
var aa;
aa = Mb.sign(fa, ba, W);
aa.oncomplete = function(ia) {
Z(ia.target.result);
};
aa.onerror = function(ia) {
ea(ia);
};
});
case ma.V2014_01:
case ma.V2014_02:
return Mb.sign(fa, ba, W).then(function(Z) {
return new Uint8Array(Z);
});
default:
throw Error("Unsupported Web Crypto version " + WEB_CRYPTO_VERSION + ".");
}
},
verify: function(fa, ba, W, Z) {
switch (Vb) {
case ma.LEGACY:
return new Promise(function(ea, aa) {
var ia;
ia = Mb.verify(fa, ba, W, Z);
ia.oncomplete = function(ua) {
ea(ua.target.result);
};
ia.onerror = function(ua) {
aa(ua);
};
});
case ma.V2014_01:
case ma.V2014_02:
return Mb.verify(fa, ba, W, Z);
default:
throw Error("Unsupported Web Crypto version " + WEB_CRYPTO_VERSION + ".");
}
},
digest: function(fa, ba) {
switch (Vb) {
case ma.LEGACY:
return new Promise(function(W, Z) {
var ea;
ea = Mb.digest(fa, ba);
ea.oncomplete = function(aa) {
W(aa.target.result);
};
ea.onerror = function(aa) {
Z(aa);
};
});
case ma.V2014_01:
case ma.V2014_02:
return Mb.digest(fa, ba).then(function(W) {
return new Uint8Array(W);
});
default:
throw Error("Unsupported Web Crypto version " + WEB_CRYPTO_VERSION + ".");
}
},
generateKey: function(fa, ba, W) {
var Z,
ea;
Z = Ba(ba);
ea = Ja(W);
switch (Vb) {
case ma.LEGACY:
return new Promise(function(aa, ia) {
var ua;
ua = Mb.generateKey(fa, Z, ea);
ua.oncomplete = function(ra) {
aa(ra.target.result);
};
ua.onerror = function(ra) {
ia(ra);
};
});
case ma.V2014_01:
case ma.V2014_02:
return Mb.generateKey(fa, Z, ea);
default:
throw Error("Unsupported Web Crypto version " + WEB_CRYPTO_VERSION + ".");
}
},
deriveKey: function(fa, ba, W, Z, ea) {
var aa,
ia;
aa = Ba(Z);
ia = Ja(ea);
switch (Vb) {
case ma.LEGACY:
return new Promise(function(ua, ra) {
var la;
la = Mb.deriveKey(fa, ba, W, aa, ia);
la.oncomplete = function(pa) {
ua(pa.target.result);
};
la.onerror = function(pa) {
ra(pa);
};
});
case ma.V2014_01:
case ma.V2014_02:
return Mb.deriveKey(fa, ba, W, aa, ia);
default:
throw Error("Unsupported Web Crypto version " + WEB_CRYPTO_VERSION + ".");
}
},
importKey: function(fa, ba, W, Z, ea) {
var aa,
ia;
aa = Ba(Z);
ia = Ja(ea);
switch (Vb) {
case ma.LEGACY:
return new Promise(function(ua, ra) {
var la;
la = Mb.importKey(fa, ba, W, aa, ia);
la.oncomplete = function(pa) {
ua(pa.target.result);
};
la.onerror = function(pa) {
ra(pa);
};
});
case ma.V2014_01:
case ma.V2014_02:
return Na(fa, ba, W, aa, ia);
default:
throw Error("Unsupported Web Crypto version " + WEB_CRYPTO_VERSION + ".");
}
},
exportKey: function(fa, ba) {
switch (Vb) {
case ma.LEGACY:
return new Promise(function(W, Z) {
var ea;
ea = Mb.exportKey(fa, ba);
ea.oncomplete = function(aa) {
W(aa.target.result);
};
ea.onerror = function(aa) {
Z(aa);
};
});
case ma.V2014_01:
case ma.V2014_02:
return ta(fa, ba).then(function(W) {
return new Uint8Array(W);
});
default:
throw Error("Unsupported Web Crypto version " + WEB_CRYPTO_VERSION + ".");
}
},
wrapKey: function(fa, ba, W, Z) {
switch (Vb) {
case ma.LEGACY:
return new Promise(function(ea, aa) {
var ia;
ia = Mb.wrapKey(ba, W, Z);
ia.oncomplete = function(ua) {
ea(ua.target.result);
};
ia.onerror = function(ua) {
aa(ua);
};
});
case ma.V2014_01:
case ma.V2014_02:
return Mb.wrapKey(fa, ba, W, Z).then(function(ea) {
return new Uint8Array(ea);
});
default:
throw Error("Unsupported Web Crypto version " + WEB_CRYPTO_VERSION + ".");
}
},
unwrapKey: function(fa, ba, W, Z, ea, aa, ia) {
switch (Vb) {
case ma.LEGACY:
return new Promise(function(ua, ra) {
var la;
la = Mb.unwrapKey(ba, ea, W);
la.oncomplete = function(pa) {
ua(pa.target.result);
};
la.onerror = function(pa) {
ra(pa);
};
});
case ma.V2014_01:
case ma.V2014_02:
return Mb.unwrapKey(fa, ba, W, Z, ea, Ba(aa), Ja(ia));
default:
throw Error("Unsupported Web Crypto version " + WEB_CRYPTO_VERSION + ".");
}
}
};
cd && cd.getKeyByName && (Ib.getKeyByName = function(fa) {
switch (Vb) {
case ma.LEGACY:
return new Promise(function(ba, W) {
var Z;
Z = cd.getKeyByName(fa);
Z.oncomplete = function(ea) {
ba(ea.target.result);
};
Z.onerror = function(ea) {
W(ea);
};
});
case ma.V2014_01:
case ma.V2014_02:
return cd.getKeyByName(fa);
default:
throw Error("Unsupported Web Crypto version " + WEB_CRYPTO_VERSION + ".");
}
});
mb.netflix = mb.netflix || ({});
mb.netflix.crypto = Ib;
})();
kc = {
name: "AES-KW"
};
gc = {
name: "AES-CBC"
};
hc = {
name: "HMAC",
hash: {
name: "SHA-256"
}
};
fd = {
name: "RSA-OAEP",
hash: {
name: "SHA-1"
}
};
yd = {
name: "RSAES-PKCS1-v1_5"
};
ie = {
name: "RSASSA-PKCS1-v1_5",
hash: {
name: "SHA-256"
}
};
uc = ["encrypt", "decrypt"];
vc = ["wrap", "unwrap"];
Dc = ["sign", "verify"];
(function() {
zd = zb.Class.create({
init: function(Ba, Ja, Na) {
var ma;
function ta(fa) {
Ma(Ja, function() {
var ba;
ba = fa ? Bb(fa) : yb;
Object.defineProperties(ma, {
rawKey: {
value: Ba,
writable: !1,
configurable: !1
},
keyData: {
value: fa,
writable: !1,
configurable: !1
},
keyDataB64: {
value: ba,
writable: !1,
configurable: !1
}
});
return this;
}, ma);
}
ma = this;
Ma(Ja, function() {
if (!Ba || "object" != typeof Ba)
throw new tb(V.INVALID_SYMMETRIC_KEY);
!Na && Ba.extractable ? Ib.exportKey("raw", Ba).then(function(fa) {
ta(new Uint8Array(fa));
}, function(fa) {
Ja.error(new tb(V.KEY_EXPORT_ERROR, "raw"));
}) : ta(Na);
}, ma);
},
size: function() {
return this.keyData.length;
},
toByteArray: function() {
return this.keyData;
},
toBase64: function() {
return this.keyDataB64;
}
});
Tc = function(Ba, Ja) {
new zd(Ba, Ja);
};
lc = function(Ba, Ja, Na, ta) {
Ma(ta, function() {
try {
Ba = "string" == typeof Ba ? Fb(Ba) : Ba;
} catch (ma) {
throw new tb(V.INVALID_SYMMETRIC_KEY, "keydata " + Ba, ma);
}
Ib.importKey("raw", Ba, Ja, !0, Na).then(function(ma) {
new zd(ma, ta, Ba);
}, function(ma) {
ta.error(new tb(V.INVALID_SYMMETRIC_KEY));
});
});
};
})();
(function() {
gd = zb.Class.create({
init: function(Ba, Ja, Na) {
var ma;
function ta(fa) {
Ma(Ja, function() {
Object.defineProperties(ma, {
rawKey: {
value: Ba,
writable: !1,
configurable: !1
},
encoded: {
value: fa,
writable: !1,
configurable: !1
}
});
return this;
}, ma);
}
ma = this;
Ma(Ja, function() {
if (!Ba || "object" != typeof Ba || "public" != Ba.type)
throw new TypeError("Only original public crypto keys are supported.");
!Na && Ba.extractable ? Ib.exportKey("spki", Ba).then(function(fa) {
ta(new Uint8Array(fa));
}, function(fa) {
Ja.error(new tb(V.KEY_EXPORT_ERROR, "spki"));
}) : ta(Na);
});
},
getEncoded: function() {
return this.encoded;
}
});
Ac = function(Ba, Ja) {
new gd(Ba, Ja);
};
Ad = function(Ba, Ja, Na, ta) {
Ma(ta, function() {
try {
Ba = "string" == typeof Ba ? Fb(Ba) : Ba;
} catch (ma) {
throw new tb(V.INVALID_PUBLIC_KEY, "spki " + Ba, ma);
}
Ib.importKey("spki", Ba, Ja, !0, Na).then(function(ma) {
new gd(ma, ta, Ba);
}, function(ma) {
ta.error(new tb(V.INVALID_PUBLIC_KEY));
});
});
};
})();
(function() {
je = zb.Class.create({
init: function(Ba, Ja, Na) {
var ma;
function ta(fa) {
Ma(Ja, function() {
Object.defineProperties(ma, {
rawKey: {
value: Ba,
writable: !1,
configurable: !1
},
encoded: {
value: fa,
writable: !1,
configurable: !1
}
});
return this;
}, ma);
}
ma = this;
Ma(Ja, function() {
if (!Ba || "object" != typeof Ba || "private" != Ba.type)
throw new TypeError("Only original private crypto keys are supported.");
!Na && Ba.extractable ? Ib.exportKey("pkcs8", Ba).then(function(fa) {
ta(new Uint8Array(fa));
}, function(fa) {
Ja.error(new tb(V.KEY_EXPORT_ERROR, "pkcs8"));
}) : ta(Na);
});
},
getEncoded: function() {
return this.encoded;
}
});
Jc = function(Ba, Ja) {
new je(Ba, Ja);
};
})();
(function() {
var Ba;
Ba = Ed = {
V1: 1,
V2: 2
};
Bd = zb.Class.create({
init: function(Ja, Na, ta, ma) {
Ma(ma, function() {
var fa,
ba,
W,
Z;
fa = Ba.V1;
ba = Ja;
W = null;
for (Z in dd) {
if (dd[Z] == Ja) {
fa = Ba.V2;
ba = null;
W = Ja;
break;
}
}
Object.defineProperties(this, {
version: {
value: fa,
writable: !1,
enumerable: !1,
configurable: !1
},
keyId: {
value: ba,
writable: !1,
configurable: !1
},
cipherSpec: {
value: W,
writable: !1,
configurable: !1
},
iv: {
value: Na,
writable: !1,
configurable: !1
},
ciphertext: {
value: ta,
writable: !1,
configurable: !1
}
});
return this;
}, this);
},
toJSON: function() {
var Ja;
Ja = {};
switch (this.version) {
case Ba.V1:
Ja.keyid = this.keyId;
this.iv && (Ja.iv = Bb(this.iv));
Ja.ciphertext = Bb(this.ciphertext);
Ja.sha256 = "AA==";
break;
case Ba.V2:
Ja.version = this.version;
Ja.cipherspec = this.cipherSpec;
this.iv && (Ja.iv = Bb(this.iv));
Ja.ciphertext = Bb(this.ciphertext);
break;
default:
throw new ub("Ciphertext envelope version " + this.version + " encoding unsupported.");
}
return Ja;
}
});
Cd = function(Ja, Na, ta, ma) {
new Bd(Ja, Na, ta, ma);
};
Dd = function(Ja, Na, ta) {
Ma(ta, function() {
var ma,
fa,
ba,
W,
Z,
ea,
aa;
ma = Ja.keyid;
fa = Ja.cipherspec;
ba = Ja.iv;
W = Ja.ciphertext;
Z = Ja.sha256;
if (!Na)
if ((Na = Ja.version) && "number" === typeof Na && Na === Na) {
ea = !1;
for (aa in Ba) {
if (Ba[aa] == Na) {
ea = !0;
break;
}
}
if (!ea)
throw new tb(V.UNIDENTIFIED_CIPHERTEXT_ENVELOPE, "ciphertext envelope " + JSON.stringify(Ja));
} else
Na = Ba.V1;
switch (Na) {
case Ba.V1:
if ("string" !== typeof ma || ba && "string" !== typeof ba || "string" !== typeof W || "string" !== typeof Z)
throw new Ab(V.JSON_PARSE_ERROR, "ciphertext envelope " + JSON.stringify(Ja));
break;
case Ba.V2:
aa = Ja.version;
if (aa != Ba.V2)
throw new tb(V.UNIDENTIFIED_CIPHERTEXT_ENVELOPE, "ciphertext envelope " + JSON.stringify(Ja));
if ("string" !== typeof fa || ba && "string" !== typeof ba || "string" !== typeof W)
throw new Ab(V.JSON_PARSE_ERROR, "ciphertext envelope " + JSON.stringify(Ja));
fa = fe(fa);
if (!fa)
throw new tb(V.UNIDENTIFIED_CIPHERSPEC, "ciphertext envelope " + JSON.stringify(Ja));
ma = fa;
break;
default:
throw new tb(V.UNSUPPORTED_CIPHERTEXT_ENVELOPE, "ciphertext envelope " + JSON.stringify(Ja));
}
try {
ba && (ba = Fb(ba));
W = Fb(W);
} catch (ia) {
throw new tb(V.CIPHERTEXT_ENVELOPE_PARSE_ERROR, "encryption envelope " + JSON.stringify(Ja), ia);
}
new Bd(ma, ba, W, ta);
});
};
})();
(function() {
var Ba;
Ba = Hd = {
V1: 1,
V2: 2
};
mc = zb.Class.create({
init: function(Ja, Na, ta) {
var ma;
switch (Ja) {
case Ba.V1:
ma = ta;
break;
case Ba.V2:
ma = {};
ma.version = Ja;
ma.algorithm = Na;
ma.signature = Bb(ta);
ma = Xb(JSON.stringify(ma), Kb);
break;
default:
throw new ub("Signature envelope version " + Ja + " encoding unsupported.");
}
Object.defineProperties(this, {
version: {
value: Ja,
writable: !1,
enumerable: !1,
configurable: !1
},
algorithm: {
value: Na,
writable: !1,
configurable: !1
},
signature: {
value: ta,
writable: !1,
configurable: !1
},
bytes: {
value: ma,
writable: !1,
configurable: !1
}
});
}
});
Fd = function() {
var Ja,
Na,
ta,
ma;
if (2 == arguments.length) {
Ja = Ba.V1;
Na = arguments[0];
ta = null;
ma = arguments[1];
} else
3 == arguments.length && (Ja = Ba.V2, ta = arguments[0], Na = arguments[1], ma = arguments[2]);
Ma(ma, function() {
return new mc(Ja, ta, Na);
});
};
Gd = function(Ja, Na, ta) {
Ma(ta, function() {
var ma,
fa,
ba,
W,
Z,
ea,
aa;
if (Na)
switch (Na) {
case Ba.V1:
return new mc(Ba.V1, null, Ja);
case Ba.V2:
try {
ma = Wb(Ja, Kb);
fa = JSON.parse(ma);
ba = parseInt(fa.version);
W = fa.algorithm;
Z = fa.signature;
if (!ba || "number" !== typeof ba || ba != ba || "string" !== typeof W || "string" !== typeof Z)
throw new Ab(V.JSON_PARSE_ERROR, "signature envelope " + Bb(Ja));
if (Ba.V2 != ba)
throw new tb(V.UNSUPPORTED_SIGNATURE_ENVELOPE, "signature envelope " + Bb(Ja));
ea = wd(W);
if (!ea)
throw new tb(V.UNIDENTIFIED_ALGORITHM, "signature envelope " + Bb(Ja));
aa = Fb(Z);
if (!aa)
throw new tb(V.INVALID_SIGNATURE, "signature envelope " + Base64Util.encode(Ja));
return new mc(Ba.V2, ea, aa);
} catch (ia) {
if (ia instanceof SyntaxError)
throw new Ab(V.JSON_PARSE_ERROR, "signature envelope " + Bb(Ja), ia);
throw ia;
}
default:
throw new tb(V.UNSUPPORTED_SIGNATURE_ENVELOPE, "signature envelope " + Bb(Ja));
}
try {
ma = Wb(Ja, Kb);
fa = JSON.parse(ma);
} catch (ia) {
fa = null;
}
if (fa && fa.version) {
if ((ma = fa.version, "number" !== typeof ma || ma !== ma))
ma = Ba.V1;
} else
ma = Ba.V1;
switch (ma) {
case Ba.V1:
return new mc(ma, null, Ja);
case Ba.V2:
ea = fa.algorithm;
Z = fa.signature;
if ("string" !== typeof ea || "string" !== typeof Z)
return new mc(Ba.V1, null, Ja);
ea = wd(ea);
if (!ea)
return new mc(Ba.V1, null, Ja);
try {
aa = Fb(Z);
} catch (ia) {
return new mc(Ba.V1, null, Ja);
}
return new mc(ma, ea, aa);
default:
throw new tb(V.UNSUPPORTED_SIGNATURE_ENVELOPE, "signature envelope " + Ja);
}
});
};
})();
Lc = zb.Class.create({
encrypt: function(Ba, Ja) {},
decrypt: function(Ba, Ja) {},
wrap: function(Ba, Ja) {},
unwrap: function(Ba, Ja, Na, ta) {},
sign: function(Ba, Ja) {},
verify: function(Ba, Ja, Na) {}
});
(function() {
var Ba;
Ba = oc = {
RSA_OAEP: fd.name,
A128KW: kc.name
};
ic = "A128GCM";
nc = zb.Class.create({
init: function(Ja, Na, ta, ma, fa) {
switch (Na) {
case Ba.RSA_OAEP:
fa = fa && (fa.rawKey || fa);
ma = ma && (ma.rawKey || ma);
break;
case Ba.A128KW:
fa = ma = ma && (ma.rawKey || ma);
break;
default:
throw new ub("Unsupported algorithm: " + Na);
}
Object.defineProperties(this, {
_ctx: {
value: Ja,
writable: !1,
enumerable: !1,
configurable: !1
},
_algo: {
value: Na,
writable: !1,
enumerable: !1,
configurable: !1
},
_enc: {
value: ta,
writable: !1,
enumerable: !1,
configurable: !1
},
_wrapKey: {
value: fa,
writable: !1,
enumerable: !1,
configurable: !1
},
_unwrapKey: {
value: ma,
writable: !1,
enumerable: !1,
configurable: !1
}
});
},
encrypt: function(Ja, Na) {
Na.error(new tb(V.ENCRYPT_NOT_SUPPORTED));
},
decrypt: function(Ja, Na) {
Na.error(new tb(V.DECRYPT_NOT_SUPPORTED));
},
wrap: function(Ja, Na) {
Ma(Na, function() {
Ib.wrapKey("jwe+jwk", Ja.rawKey, this._wrapKey, this._wrapKey.algorithm).then(function(ta) {
Na.result(ta);
}, function(ta) {
Na.error(new tb(V.WRAP_ERROR));
});
}, this);
},
unwrap: function(Ja, Na, ta, ma) {
function fa(ba) {
Ma(ma, function() {
switch (ba.type) {
case "secret":
Tc(ba, ma);
break;
case "public":
Ac(ba, ma);
break;
case "private":
Jc(ba, ma);
break;
default:
throw new tb(V.UNSUPPORTED_KEY, "type: " + ba.type);
}
});
}
Ma(ma, function() {
Ib.unwrapKey("jwe+jwk", Ja, this._unwrapKey, this._unwrapKey.algorithm, Na, !1, ta).then(function(ba) {
fa(ba);
}, function() {
ma.error(new tb(V.UNWRAP_ERROR));
});
}, this);
},
sign: function(Ja, Na) {
Na.error(new tb(V.SIGN_NOT_SUPPORTED));
},
verify: function(Ja, Na, ta) {
ta.error(new tb(V.VERIFY_NOT_SUPPORTED));
}
});
})();
Mc = Lc.extend({
encrypt: function(Ba, Ja) {
Ja.result(Ba);
},
decrypt: function(Ba, Ja) {
Ja.result(Ba);
},
wrap: function(Ba, Ja) {
Ja.result(Ba);
},
unwrap: function(Ba, Ja, Na, ta) {
ta.result(Ba);
},
sign: function(Ba, Ja) {
Ja.result(new Uint8Array(0));
},
verify: function(Ba, Ja, Na) {
Na.result(!0);
}
});
(function() {
var Ba;
Ba = id = {
ENCRYPT_DECRYPT_OAEP: 1,
ENCRYPT_DECRYPT_PKCS1: 2,
WRAP_UNWRAP_OAEP: 3,
WRAP_UNWRAP_PKCS1: 4,
SIGN_VERIFY: 5
};
hd = Lc.extend({
init: function W(Na, ta, ma, fa, ba) {
W.base.call(this);
ma && (ma = ma.rawKey);
fa && (fa = fa.rawKey);
Object.defineProperties(this, {
id: {
value: ta,
writable: !1,
enumerable: !1,
configurable: !1
},
privateKey: {
value: ma,
writable: !1,
enumerable: !1,
configurable: !1
},
publicKey: {
value: fa,
writable: !1,
enumerable: !1,
configurable: !1
},
transform: {
value: ba == Ba.ENCRYPT_DECRYPT_PKCS1 ? yd : ba == Ba.ENCRYPT_DECRYPT_OAEP ? fd : "nullOp",
writable: !1,
enumerable: !1,
configurable: !1
},
wrapTransform: {
value: ba == Ba.WRAP_UNWRAP_PKCS1 ? yd : ba == Ba.WRAP_UNWRAP_OAEP ? fd : "nullOp",
writable: !1,
enumerable: !1,
configurable: !1
},
algo: {
value: ba == Ba.SIGN_VERIFY ? ie : "nullOp",
writable: !1,
enumerable: !1,
configurable: !1
}
});
},
encrypt: function(Na, ta) {
var ma;
ma = this;
Ma(ta, function() {
if ("nullOp" == this.transform)
return Na;
if (!this.publicKey)
throw new tb(V.ENCRYPT_NOT_SUPPORTED, "no public key");
if (0 == Na.length)
return Na;
Ib.encrypt(ma.transform, ma.publicKey, Na).then(function(fa) {
Cd(ma.id, null, fa, {
result: function(ba) {
var W;
try {
W = JSON.stringify(ba);
ta.result(Xb(W, Kb));
} catch (Z) {
ta.error(new tb(V.ENCRYPT_ERROR, null, Z));
}
},
error: function(ba) {
ba instanceof db || (ba = new tb(V.ENCRYPT_ERROR, null, ba));
ta.error(ba);
}
});
}, function(fa) {
ta.error(new tb(V.ENCRYPT_ERROR));
});
}, this);
},
decrypt: function(Na, ta) {
var ma;
ma = this;
Ma(ta, function() {
var fa,
ba;
if ("nullOp" == this.transform)
return Na;
if (!this.privateKey)
throw new tb(V.DECRYPT_NOT_SUPPORTED, "no private key");
if (0 == Na.length)
return Na;
try {
fa = Wb(Na, Kb);
ba = JSON.parse(fa);
} catch (W) {
if (W instanceof SyntaxError)
throw new tb(V.CIPHERTEXT_ENVELOPE_PARSE_ERROR, null, W);
throw new tb(V.DECRYPT_ERROR, null, W);
}
Dd(ba, Ed.V1, {
result: function(W) {
var Z;
try {
if (W.keyId != ma.id)
throw new tb(V.ENVELOPE_KEY_ID_MISMATCH);
Z = ta.result;
Ib.decrypt(ma.transform, ma.privateKey, W.ciphertext).then(Z, function(ea) {
ta.error(new tb(V.DECRYPT_ERROR));
});
} catch (ea) {
ea instanceof db ? ta.error(ea) : ta.error(new tb(V.DECRYPT_ERROR, null, ea));
}
},
error: function(W) {
W instanceof Ab && (W = new tb(V.CIPHERTEXT_ENVELOPE_ENCODE_ERROR, null, W));
W instanceof db || (W = new tb(V.DECRYPT_ERROR, null, W));
ta.error(W);
}
});
}, this);
},
wrap: function(Na, ta) {
Ma(ta, function() {
var ma;
if ("nullOp" == this.wrapTransform || !this.publicKey)
throw new tb(V.WRAP_NOT_SUPPORTED, "no public key");
ma = ta.result;
Ib.wrapKey("jwk", Na.rawKey, this.publicKey, this.wrapTransform).then(ma, function(fa) {
ta.error(new tb(V.WRAP_ERROR));
});
}, this);
},
unwrap: function(Na, ta, ma, fa) {
function ba(W) {
Ma(fa, function() {
switch (W.type) {
case "secret":
Tc(W, fa);
break;
case "public":
Ac(W, fa);
break;
case "private":
Jc(W, fa);
break;
default:
throw new tb(V.UNSUPPORTED_KEY, "type: " + W.type);
}
});
}
Ma(fa, function() {
if ("nullOp" == this.wrapTransform || !this.privateKey)
throw new tb(V.UNWRAP_NOT_SUPPORTED, "no private key");
Ib.unwrapKey("jwk", Na, this.privateKey, {
name: this.privateKey.algorithm.name,
hash: {
name: "SHA-1"
}
}, ta, !1, ma).then(ba, function(W) {
fa.error(new tb(V.UNWRAP_ERROR));
});
}, this);
},
sign: function(Na, ta) {
Ma(ta, function() {
if ("nullOp" == this.algo)
return new Uint8Array(0);
if (!this.privateKey)
throw new tb(V.SIGN_NOT_SUPPORTED, "no private key");
Ib.sign(this.algo, this.privateKey, Na).then(function(ma) {
Fd(ma, {
result: function(fa) {
ta.result(fa.bytes);
},
error: ta.error
});
}, function(ma) {
ta.error(new tb(V.SIGNATURE_ERROR));
});
}, this);
},
verify: function(Na, ta, ma) {
var fa;
fa = this;
Ma(ma, function() {
if ("nullOp" == this.algo)
return !0;
if (!this.publicKey)
throw new tb(V.VERIFY_NOT_SUPPORTED, "no public key");
Gd(ta, Hd.V1, {
result: function(ba) {
Ma(ma, function() {
var W;
W = ma.result;
Ib.verify(this.algo, this.publicKey, ba.signature, Na).then(W, function(Z) {
ma.error(new tb(V.SIGNATURE_ERROR));
});
}, fa);
},
error: ma.error
});
}, this);
}
});
})();
(function() {
jd = Lc.extend({
init: function ba(Ja, Na, ta, ma, fa) {
ba.base.call(this);
ta = ta && ta.rawKey;
ma = ma && ma.rawKey;
fa = fa && fa.rawKey;
Object.defineProperties(this, {
ctx: {
value: Ja,
writable: !1,
enumerable: !1,
configurable: !1
},
id: {
value: Na,
writable: !1,
enumerable: !1,
configurable: !1
},
encryptionKey: {
value: ta,
writable: !1,
enumerable: !1,
configurable: !1
},
hmacKey: {
value: ma,
writable: !1,
enumerable: !1,
configurable: !1
},
wrapKey: {
value: fa,
writable: !1,
enumerable: !1,
configurable: !1
}
});
},
encrypt: function(Ja, Na) {
var ta;
ta = this;
Ma(Na, function() {
var ma;
if (!this.encryptionKey)
throw new tb(V.ENCRYPT_NOT_SUPPORTED, "no encryption/decryption key");
if (0 == Ja.length)
return Ja;
ma = new Uint8Array(16);
this.ctx.getRandom().nextBytes(ma);
Ib.encrypt({
name: gc.name,
iv: ma
}, ta.encryptionKey, Ja).then(function(fa) {
fa = new Uint8Array(fa);
Cd(ta.id, ma, fa, {
result: function(ba) {
var W;
try {
W = JSON.stringify(ba);
Na.result(Xb(W, Kb));
} catch (Z) {
Na.error(new tb(V.ENCRYPT_ERROR, null, Z));
}
},
error: function(ba) {
ba instanceof db || (ba = new tb(V.ENCRYPT_ERROR, null, ba));
Na.error(ba);
}
});
}, function(fa) {
Na.error(new tb(V.ENCRYPT_ERROR));
});
}, this);
},
decrypt: function(Ja, Na) {
var ta;
ta = this;
Ma(Na, function() {
var ma,
fa;
if (!this.encryptionKey)
throw new tb(V.DECRYPT_NOT_SUPPORTED, "no encryption/decryption key");
if (0 == Ja.length)
return Ja;
try {
ma = Wb(Ja, Kb);
fa = JSON.parse(ma);
} catch (ba) {
if (ba instanceof SyntaxError)
throw new tb(V.CIPHERTEXT_ENVELOPE_PARSE_ERROR, null, ba);
throw new tb(V.DECRYPT_ERROR, null, ba);
}
Dd(fa, Ed.V1, {
result: function(ba) {
try {
if (ba.keyId != ta.id)
throw new tb(V.ENVELOPE_KEY_ID_MISMATCH);
Ib.decrypt({
name: gc.name,
iv: ba.iv
}, ta.encryptionKey, ba.ciphertext).then(function(W) {
W = new Uint8Array(W);
Na.result(W);
}, function() {
Na.error(new tb(V.DECRYPT_ERROR));
});
} catch (W) {
W instanceof db ? Na.error(W) : Na.error(new tb(V.DECRYPT_ERROR, null, W));
}
},
error: function(ba) {
ba instanceof Ab && (ba = new tb(V.CIPHERTEXT_ENVELOPE_ENCODE_ERROR, null, ba));
ba instanceof db || (ba = new tb(V.DECRYPT_ERROR, null, ba));
Na.error(ba);
}
});
}, this);
},
wrap: function(Ja, Na) {
Ma(Na, function() {
if (!this.wrapKey)
throw new tb(V.WRAP_NOT_SUPPORTED, "no wrap/unwrap key");
Ib.wrapKey("raw", Ja.rawKey, this.wrapKey, this.wrapKey.algorithm).then(function(ta) {
Na.result(ta);
}, function(ta) {
Na.error(new tb(V.WRAP_ERROR));
});
}, this);
},
unwrap: function(Ja, Na, ta, ma) {
function fa(ba) {
Ma(ma, function() {
switch (ba.type) {
case "secret":
Tc(ba, ma);
break;
case "public":
Ac(ba, ma);
break;
case "private":
Jc(ba, ma);
break;
default:
throw new tb(V.UNSUPPORTED_KEY, "type: " + ba.type);
}
});
}
Ma(ma, function() {
if (!this.wrapKey)
throw new tb(V.UNWRAP_NOT_SUPPORTED, "no wrap/unwrap key");
Ib.unwrapKey("raw", Ja, this.wrapKey, this.wrapKey.algorithm, Na, !1, ta).then(function(ba) {
fa(ba);
}, function(ba) {
ma.error(new tb(V.UNWRAP_ERROR));
});
}, this);
},
sign: function(Ja, Na) {
var ta;
ta = this;
Ma(Na, function() {
if (!this.hmacKey)
throw new tb(V.SIGN_NOT_SUPPORTED, "no HMAC key.");
Ib.sign(hc, this.hmacKey, Ja).then(function(ma) {
Ma(Na, function() {
var fa;
fa = new Uint8Array(ma);
Fd(fa, {
result: function(ba) {
Na.result(ba.bytes);
},
error: Na.error
});
}, ta);
}, function() {
Na.error(new tb(V.HMAC_ERROR));
});
}, this);
},
verify: function(Ja, Na, ta) {
var ma;
ma = this;
Ma(ta, function() {
if (!this.hmacKey)
throw new tb(V.VERIFY_NOT_SUPPORTED, "no HMAC key.");
Gd(Na, Hd.V1, {
result: function(fa) {
Ma(ta, function() {
Ib.verify(hc, this.hmacKey, fa.signature, Ja).then(function(ba) {
ta.result(ba);
}, function(ba) {
ta.error(new tb(V.HMAC_ERROR));
});
}, ma);
},
error: ta.error
});
}, this);
}
});
})();
ec = jd.extend({
init: function ba(Ja, Na, ta, ma, fa) {
if (ta || ma || fa)
ba.base.call(this, Ja, ta + "_" + Na.sequenceNumber, ma, fa, null);
else {
if (!Na.isDecrypted())
throw new Sc(V.MASTERTOKEN_UNTRUSTED, Na);
ba.base.call(this, Ja, Na.identity + "_" + Na.sequenceNumber, Na.encryptionKey, Na.hmacKey, null);
}
}
});
jf = Lc.extend({
encrypt: function(Ja, Na) {
Na.result(Ja);
},
decrypt: function(Ja, Na) {
Na.result(Ja);
},
wrap: function(Ja, Na) {
Na.error(new ub("Wrap is unsupported by the MSL token crypto context."));
},
unwrap: function(Ja, Na, ta, ma) {
ma.error(new ub("Unwrap is unsupported by the MSL token crypto context."));
},
sign: function(Ja, Na) {
Na.result(new Uint8Array(0));
},
verify: function(Ja, Na, ta) {
ta.result(!1);
}
});
Nb = {
PSK: "PSK",
MGK: "MGK",
X509: "X509",
RSA: "RSA",
NPTICKET: "NPTICKET",
ECC: "ECC",
NONE: "NONE"
};
Object.freeze(Nb);
(function() {
Cc = zb.Class.create({
init: function(Ja) {
Object.defineProperties(this, {
scheme: {
value: Ja,
writable: !1,
configurable: !1
}
});
},
getIdentity: function() {},
getAuthData: function() {},
equals: function(Ja) {
return this === Ja ? !0 : Ja instanceof Cc ? this.scheme == Ja.scheme : !1;
},
toJSON: function() {
var Ja;
Ja = {};
Ja.scheme = this.scheme;
Ja.authdata = this.getAuthData();
return Ja;
}
});
ke = function(Ja, Na) {
var ta,
ma;
ta = Na.scheme;
ma = Na.authdata;
if (!ta || !ma)
throw new Ab(V.JSON_PARSE_ERROR, "entityauthdata " + JSON.stringify(Na));
if (!Nb[ta])
throw new jc(V.UNIDENTIFIED_ENTITYAUTH_SCHEME, ta);
Na = Ja.getEntityAuthenticationFactory(ta);
if (!Na)
throw new jc(V.ENTITYAUTH_FACTORY_NOT_FOUND, ta);
return Na.createData(Ja, ma);
};
})();
kd = zb.Class.create({
init: function(Ja) {
Object.defineProperties(this, {
scheme: {
value: Ja,
writable: !1,
configurable: !1
}
});
},
createData: function(Ja, Na) {},
getCryptoContext: function(Ja, Na) {}
});
(function() {
pc = Cc.extend({
init: function ta(Na) {
ta.base.call(this, Nb.MGK);
Object.defineProperties(this, {
identity: {
value: Na,
writable: !1,
configurable: !1
}
});
},
getIdentity: function() {
return this.identity;
},
getAuthData: function() {
var Na;
Na = {};
Na.identity = this.identity;
return Na;
},
equals: function ma(ta) {
return this === ta ? !0 : ta instanceof pc ? ma.base.call(this, this, ta) && this.identity == ta.identity : !1;
}
});
le = function(ta) {
var ma;
ma = ta.identity;
if (!ma)
throw new Ab(V.JSON_PARSE_ERROR, "mgk authdata" + JSON.stringify(ta));
return new pc(ma);
};
})();
kf = kd.extend({
init: function ta(Na) {
ta.base.call(this, Nb.MGK);
Object.defineProperties(this, {
localIdentity: {
value: Na,
writable: !1,
enumerable: !1,
configurable: !1
}
});
},
createData: function(Na, ta) {
return le(ta);
},
getCryptoContext: function(Na, ta) {
if (!(ta instanceof pc))
throw new ub("Incorrect authentication data type " + JSON.stringify(ta) + ".");
if (ta.identity != this.localIdentity)
throw new jc(V.ENTITY_NOT_FOUND, "mgk " + ta.identity).setEntity(ta);
return new Mc();
}
});
(function() {
qc = Cc.extend({
init: function ma(ta) {
ma.base.call(this, Nb.PSK);
Object.defineProperties(this, {
identity: {
value: ta,
writable: !1
}
});
},
getIdentity: function() {
return this.identity;
},
getAuthData: function() {
var ta;
ta = {};
ta.identity = this.identity;
return ta;
},
equals: function fa(ma) {
return this === ma ? !0 : ma instanceof qc ? fa.base.call(this, this, ma) && this.identity == ma.identity : !1;
}
});
me = function(ma) {
var fa;
fa = ma.identity;
if (!fa)
throw new Ab(V.JSON_PARSE_ERROR, "psk authdata" + JSON.stringify(ma));
return new qc(fa);
};
})();
lf = kd.extend({
init: function ma(ta) {
ma.base.call(this, Nb.PSK);
Object.defineProperties(this, {
localIdentity: {
value: ta,
writable: !1,
enumerable: !1,
configurable: !1
}
});
},
createData: function(ta, ma) {
return me(ma);
},
getCryptoContext: function(ta, ma) {
if (!(ma instanceof qc))
throw new ub("Incorrect authentication data type " + JSON.stringify(ma) + ".");
if (ma.getIdentity() != this.localIdentity)
throw new jc(V.ENTITY_NOT_FOUND, "psk " + ma.identity).setEntity(ma);
return new Mc();
}
});
(function() {
ld = Cc.extend({
init: function ba(ma, fa) {
ba.base.call(this, Nb.RSA);
Object.defineProperties(this, {
identity: {
value: ma,
writable: !1,
configurable: !1
},
publicKeyId: {
value: fa,
writable: !1,
configurable: !1
}
});
},
getIdentity: function() {
return this.identity;
},
getAuthData: function() {
var ma;
ma = {};
ma.identity = this.identity;
ma.pubkeyid = this.publicKeyId;
return ma;
},
equals: function ba(fa) {
return this === fa ? !0 : fa instanceof ld ? ba.base.call(this, this, fa) && this.identity == fa.identity && this.publicKeyId == fa.publicKeyId : !1;
}
});
ne = function(fa) {
var ba,
W;
ba = fa.identity;
W = fa.pubkeyid;
if (!ba || "string" !== typeof ba || !W || "string" !== typeof W)
throw new Ab(V.JSON_PARSE_ERROR, "RSA authdata" + JSON.stringify(fa));
return new ld(ba, W);
};
})();
mf = kd.extend({
init: function fa(ma) {
fa.base.call(this, Nb.RSA);
Object.defineProperties(this, {
store: {
value: ma,
writable: !1,
enumerable: !1,
configurable: !1
}
});
},
createData: function(ma, fa) {
return ne(fa);
},
getCryptoContext: function(ma, fa) {
var ba,
W,
Z;
if (!(fa instanceof ld))
throw new ub("Incorrect authentication data type " + fa + ".");
ba = fa.identity;
W = fa.publicKeyId;
Z = this.store.getPublicKey(W);
if (!Z)
throw new jc(V.RSA_PUBLICKEY_NOT_FOUND, W).setEntity(fa);
return new hd(ma, ba, null, Z, id.SIGN_VERIFY);
}
});
(function() {
Pc = Cc.extend({
init: function ba(fa) {
ba.base.call(this, Nb.NONE);
Object.defineProperties(this, {
identity: {
value: fa,
writable: !1
}
});
},
getIdentity: function() {
return this.identity;
},
getAuthData: function() {
var fa;
fa = {};
fa.identity = this.identity;
return fa;
},
equals: function W(ba) {
return this === ba ? !0 : ba instanceof Pc ? W.base.call(this, this, ba) && this.identity == ba.identity : !1;
}
});
oe = function(ba) {
var W;
W = ba.identity;
if (!W)
throw new Ab(V.JSON_PARSE_ERROR, "Unauthenticated authdata" + JSON.stringify(ba));
return new Pc(W);
};
})();
hf = kd.extend({
init: function fa() {
fa.base.call(this, Nb.NONE);
},
createData: function(fa, ba) {
return oe(ba);
},
getCryptoContext: function(fa, ba) {
if (!(ba instanceof Pc))
throw new ub("Incorrect authentication data type " + JSON.stringify(ba) + ".");
return new Mc();
}
});
nf = zb.Class.create({
init: function() {
Object.defineProperties(this, {
rsaKeys: {
value: {},
writable: !1,
enumerable: !1,
configurable: !1
}
});
},
addPublicKey: function(fa, ba) {
if (!(ba instanceof gd))
throw new ub("Incorrect key data type " + ba + ".");
this.rsaKeys[fa] = ba;
},
getIdentities: function() {
return Object.keys(this.rsaKeys);
},
removePublicKey: function(fa) {
delete this.rsaKeys[fa];
},
getPublicKey: function(fa) {
return this.rsaKeys[fa];
}
});
Id = zb.Class.create({
abort: function() {},
close: function() {},
mark: function() {},
reset: function() {},
markSupported: function() {},
read: function(fa, ba, W) {}
});
md = zb.Class.create({
abort: function() {},
close: function(fa, ba) {},
write: function(fa, ba, W, Z, ea) {},
flush: function(fa, ba) {}
});
of = zb.Class.create({
init: function(fa) {
Object.defineProperties(this, {
_data: {
value: fa,
writable: !1,
enumerable: !1,
configurable: !1
},
_closed: {
value: !1,
writable: !0,
enumerable: !1,
configurable: !1
},
_currentPosition: {
value: 0,
writable: !0,
enumerable: !1,
configurable: !1
},
_mark: {
value: -1,
writable: !0,
enumerable: !1,
configurable: !1
}
});
},
abort: function() {},
close: function() {
this._close = !0;
},
mark: function() {
this._mark = this._currentPosition;
},
reset: function() {
if (-1 == this._mark)
throw new Pb("Stream has not been marked.");
this._currentPosition = this._mark;
},
markSupported: function() {
return !0;
},
read: function(fa, ba, W) {
ab(W, function() {
var Z;
if (this._closed)
throw new Pb("Stream is already closed.");
if (this._currentPosition == this._data.length)
return null;
-1 == fa && (fa = this._data.length - this._currentPosition);
Z = this._data.subarray(this._currentPosition, this._currentPosition + fa);
this._currentPosition += Z.length;
return Z;
}, this);
}
});
pf = zb.Class.create({
init: function() {
var fa;
fa = {
_closed: {
value: !1,
writable: !0,
enumerable: !1,
configurable: !1
},
_result: {
value: new Uint8Array(0),
writable: !0,
enuemrable: !1,
configurable: !1
},
_buffered: {
value: [],
writable: !1,
enumerable: !1,
configurable: !1
}
};
Object.defineProperties(this, fa);
},
abort: function() {},
close: function(fa, ba) {
this._closed = !0;
ba.result(!0);
},
write: function(fa, ba, W, Z, ea) {
ab(ea, function() {
var aa;
if (this._closed)
throw new Pb("Stream is already closed.");
if (0 > ba)
throw new RangeError("Offset cannot be negative.");
if (0 > W)
throw new RangeError("Length cannot be negative.");
if (ba + W > fa.length)
throw new RangeError("Offset plus length cannot be greater than the array length.");
aa = fa.subarray(ba, W);
this._buffered.push(aa);
return aa.length;
}, this);
},
flush: function(fa, ba) {
var W;
for (; 0 < this._buffered.length;) {
if ((fa = this._buffered.shift(), this._result)) {
W = new Uint8Array(this._result.length + fa.length);
W.set(this._result);
W.set(fa, this._result.length);
this._result = W;
} else
this._result = new Uint8Array(fa);
}
ba.result(!0);
},
size: function() {
this.flush(1, {
result: function() {}
});
return this._result.length;
},
toByteArray: function() {
this.flush(1, {
result: function() {}
});
return this._result;
}
});
qf = zb.Class.create({
getResponse: function(fa, ba, W) {}
});
(function() {
var fa,
ba;
fa = md.extend({
init: function(W, Z) {
W = {
_httpLocation: {
value: W,
writable: !1,
enumerable: !1,
configurable: !1
},
_timeout: {
value: Z,
writable: !0,
enumerable: !1,
configurable: !1
},
_buffer: {
value: new pf(),
writable: !1,
enumerable: !1,
configurable: !1
},
_response: {
value: yb,
writable: !0,
enumerable: !1,
configurable: !1
},
_abortToken: {
value: yb,
writable: !0,
enumerable: !1,
configurable: !1
},
_responseQueue: {
value: new Qc(),
writable: !0,
enumerable: !1,
configurable: !1
}
};
Object.defineProperties(this, W);
},
setTimeout: function(W) {
this._timeout = W;
},
getResponse: function(W, Z) {
var ea;
ea = this;
this._responseQueue.poll(W, {
result: function(aa) {
ab(Z, function() {
aa && this._responseQueue.add(aa);
return aa;
}, ea);
},
timeout: function() {
ab(Z, function() {
this._response = {
isTimeout: !0
};
this._responseQueue.add(this._response);
this.abort();
Z.timeout();
}, ea);
},
error: function(aa) {
ab(Z, function() {
this._response = {
isError: !0
};
this._responseQueue.add(this._response);
throw aa;
}, ea);
}
});
},
abort: function() {
this._abortToken && this._abortToken.abort();
},
close: function(W, Z) {
var ea;
ea = this;
ab(Z, function() {
var aa;
if (this._response)
return !0;
aa = this._buffer.toByteArray();
0 < aa.length && (this._abortToken = this._httpLocation.getResponse({
body: aa
}, this._timeout, {
result: function(ia) {
ea._response = {
response: ia
};
ea._responseQueue.add(ea._response);
},
timeout: function() {
ea._response = {
isTimeout: !0
};
ea._responseQueue.add(ea._response);
},
error: function(ia) {
ea._response = {
isError: !0,
error: ia
};
ea._responseQueue.add(ea._response);
}
}));
return !0;
}, this);
},
write: function(W, Z, ea, aa, ia) {
ab(ia, function() {
if (this._response)
throw new Pb("HttpOutputStream already closed.");
this._buffer.write(W, Z, ea, aa, ia);
}, this);
},
flush: function(W, Z) {
ab(Z, function() {
if (this._response)
return !0;
this._buffer.flush(W, Z);
}, this);
}
});
ba = Id.extend({
init: function(W) {
Object.defineProperties(this, {
_out: {
value: W,
writable: !1,
enumerable: !1,
configurable: !1
},
_buffer: {
value: yb,
writable: !0,
enumerable: !1,
configurable: !1
},
_exception: {
value: yb,
writable: !0,
enumerable: !1,
configurable: !1
},
_timedout: {
value: !1,
writable: !0,
enumerable: !1,
configurable: !1
},
_aborted: {
value: !1,
writable: !0,
enumerable: !1,
configurable: !1
},
_json: {
value: yb,
writable: !0,
enumerable: !1,
configurable: !1
}
});
},
abort: function() {
this._out.abort();
},
close: function() {
this._buffer && this._buffer.close();
},
mark: function() {
this._buffer || this._buffer.mark();
},
reset: function() {
this._buffer && this._buffer.reset();
},
markSupported: function() {
if (this._buffer)
return this._buffer.markSupported();
},
read: function(W, Z, ea) {
var ia;
function aa(ua) {
ab(ea, function() {
if (!ua)
return new Uint8Array(0);
this._out.getResponse(Z, {
result: function(ra) {
ab(ea, function() {
var la;
if (ra.isTimeout)
(this._timedout = !0,
ea.timeout());
else {
if (ra.isError)
throw (this._exception = ra.error || new Pb("Unknown HTTP exception."), this._exception);
if (!ra.response)
throw (this._exception = new Pb("Missing HTTP response."), this._exception);
ra.response.json !== yb && (this._json = ra.response.json, this.getJSON = function() {
return ia._json;
});
la = ra.response.content || td("string" === typeof ra.response.body ? ra.response.body : JSON.stringify(this._json));
this._buffer = new of(la);
this._buffer.read(W, Z, ea);
}
}, ia);
},
timeout: function() {
ea.timeout();
},
error: function(ra) {
ea.error(ra);
}
});
}, ia);
}
ia = this;
ab(ea, function() {
if (this._exception)
throw this._exception;
if (this._timedout)
ea.timeout();
else {
if (this._aborted)
return new Uint8Array(0);
this._buffer ? this._buffer.read(W, Z, ea) : this._out.close(Z, {
result: function(ua) {
aa(ua);
},
timeout: function() {
ea.timeout();
},
error: function(ua) {
ea.error(ua);
}
});
}
}, ia);
}
});
$d = zb.Class.create({
init: function(W, Z) {
Object.defineProperties(this, {
_httpLocation: {
value: W,
writable: !1,
enumerable: !1,
configurable: !1
},
_timeout: {
value: Z,
writable: !0,
enumerable: !1,
configurable: !1
}
});
},
setTimeout: function(W) {
this._timeout = W;
},
openConnection: function() {
var W;
W = new fa(this._httpLocation, this._timeout);
return {
input: new ba(W),
output: W
};
}
});
})();
(function() {
var fa,
ba;
fa = md.extend({
init: function() {
var W;
W = {
_buffer: {
value: new Uint8Array(),
writable: !0,
enumerable: !1,
configurable: !1
}
};
Object.defineProperties(this, W);
},
setTimeout: function() {},
getResponse: function(W, Z) {
Z.result({
success: !1,
content: null,
errorHttpCode: yb,
errorSubCode: yb
});
},
abort: function() {},
close: function(W, Z) {
Z.result(!0);
},
write: function(W, Z, ea, aa, ia) {
var ua,
ra;
try {
if (0 > Z)
throw new RangeError("Offset cannot be negative.");
if (0 > ea)
throw new RangeError("Length cannot be negative.");
if (Z + ea > W.length)
throw new RangeError("Offset plus length cannot be greater than the array length.");
ua = W.subarray(Z, ea);
ra = new Uint8Array(this._buffer.length + ua.length);
ra.set(this._buffer);
ra.set(ua, this._buffer.length);
this._buffer = ra;
ia.result(ua.length);
} catch (la) {
ia.error(la);
}
},
flush: function(W, Z) {
Z.result(!0);
},
request: function() {
return this._buffer;
}
});
ba = Id.extend({
init: function() {},
abort: function() {},
close: function() {},
mark: function() {},
reset: function() {},
markSupported: function() {},
read: function(W, Z, ea) {
ea.result(new Uint8Array(16));
}
});
ae = zb.Class.create({
init: function() {
var W;
W = {
output: {
value: new fa(),
writable: !1,
enumerable: !1,
configurable: !1
},
input: {
value: new ba(),
writable: !0,
enumerable: !1,
configurable: !1
}
};
Object.defineProperties(this, W);
},
setTimeout: function() {},
openConnection: function() {
return {
input: this.input,
output: this.output
};
},
getRequest: function() {
return sd(this.output.request());
}
});
})();
pe = function(fa, ba, W) {
(function(Z, ea, aa) {
Z.read(-1, ea, {
result: function(ia) {
ia && ia.length ? aa(null, ia) : aa(null, null);
},
timeout: function() {
W.timeout();
},
error: function(ia) {
aa(ia, null);
}
});
})(fa, ba, function(Z, ea) {
var aa,
ia;
if (Z)
W.error(Z);
else if (ea) {
if (fa.getJSON !== yb && "function" === typeof fa.getJSON)
W.result(fa.getJSON());
else {
Z = W.result;
ea = new rf(Wb(ea, "utf-8"));
aa = [];
for (ia = ea.nextValue(); ia !== yb;) {
aa.push(ia);
ia = ea.nextValue();
}
Z.call(W, aa);
}
} else
W.result(null);
});
};
dc = {
SYMMETRIC_WRAPPED: "SYMMETRIC_WRAPPED",
ASYMMETRIC_WRAPPED: "ASYMMETRIC_WRAPPED",
DIFFIE_HELLMAN: "DIFFIE_HELLMAN",
JWE_LADDER: "JWE_LADDER",
JWK_LADDER: "JWK_LADDER",
AUTHENTICATED_DH: "AUTHENTICATED_DH"
};
Object.freeze(dc);
(function() {
Uc = zb.Class.create({
init: function(fa) {
Object.defineProperties(this, {
keyExchangeScheme: {
value: fa,
writable: !1,
configurable: !1
}
});
},
getKeydata: function() {},
toJSON: function() {
var fa;
fa = {};
fa.scheme = this.keyExchangeScheme;
fa.keydata = this.getKeydata();
return fa;
},
equals: function(fa) {
return this === fa ? !0 : fa instanceof Uc ? this.keyExchangeScheme == fa.keyExchangeScheme : !1;
},
uniqueKey: function() {
return this.keyExchangeScheme;
}
});
qe = function(fa, ba, W) {
Ma(W, function() {
var Z,
ea,
aa;
Z = ba.scheme;
ea = ba.keydata;
if (!Z || !ea || "object" !== typeof ea)
throw new Ab(V.JSON_PARSE_ERROR, "keyrequestdata " + JSON.stringify(ba));
if (!dc[Z])
throw new Lb(V.UNIDENTIFIED_KEYX_SCHEME, Z);
aa = fa.getKeyExchangeFactory(Z);
if (!aa)
throw new Lb(V.KEYX_FACTORY_NOT_FOUND, Z);
aa.createRequestData(fa, ea, W);
});
};
})();
(function() {
Vc = zb.Class.create({
init: function(fa, ba) {
Object.defineProperties(this, {
masterToken: {
value: fa,
writable: !1,
configurable: !1
},
keyExchangeScheme: {
value: ba,
wrtiable: !1,
configurable: !1
}
});
},
getKeydata: function() {},
toJSON: function() {
var fa;
fa = {};
fa.mastertoken = this.masterToken;
fa.scheme = this.keyExchangeScheme;
fa.keydata = this.getKeydata();
return fa;
},
equals: function(fa) {
return this === fa ? !0 : fa instanceof Vc ? this.masterToken.equals(fa.masterToken) && this.keyExchangeScheme == fa.keyExchangeScheme : !1;
},
uniqueKey: function() {
return this.masterToken.uniqueKey() + ":" + this.keyExchangeScheme;
}
});
re = function(fa, ba, W) {
Ma(W, function() {
var Z,
ea,
aa;
Z = ba.mastertoken;
ea = ba.scheme;
aa = ba.keydata;
if (!ea || !Z || "object" !== typeof Z || !aa || "object" !== typeof aa)
throw new Ab(V.JSON_PARSE_ERROR, "keyresponsedata " + JSON.stringify(ba));
if (!dc[ea])
throw new Lb(V.UNIDENTIFIED_KEYX_SCHEME, ea);
Wc(fa, Z, {
result: function(ia) {
Ma(W, function() {
var ua;
ua = fa.getKeyExchangeFactory(ea);
if (!ua)
throw new Lb(V.KEYX_FACTORY_NOT_FOUND, ea);
return ua.createResponseData(fa, ia, aa);
});
},
error: function(ia) {
W.error(ia);
}
});
});
};
})();
(function() {
var fa;
fa = zb.Class.create({
init: function(ba, W) {
Object.defineProperties(this, {
keyResponseData: {
value: ba,
writable: !1,
configurable: !1
},
cryptoContext: {
value: W,
writable: !1,
configurable: !1
}
});
}
});
fc = zb.Class.create({
init: function(ba) {
Object.defineProperties(this, {
scheme: {
value: ba,
writable: !1,
configurable: !1
}
});
},
createRequestData: function(ba, W, Z) {},
createResponseData: function(ba, W, Z) {},
generateResponse: function(ba, W, Z, ea) {},
getCryptoContext: function(ba, W, Z, ea, aa) {},
generateSessionKeys: function(ba, W) {
Ma(W, function() {
var Z,
ea;
Z = new Uint8Array(16);
ea = new Uint8Array(32);
ba.getRandom().nextBytes(Z);
ba.getRandom().nextBytes(ea);
lc(Z, gc, uc, {
result: function(aa) {
lc(ea, hc, Dc, {
result: function(ia) {
W.result({
encryptionKey: aa,
hmacKey: ia
});
},
error: function(ia) {
W.error(new tb(V.SESSION_KEY_CREATION_FAILURE, null, ia));
}
});
},
error: function(aa) {
W.error(new tb(V.SESSION_KEY_CREATION_FAILURE, null, aa));
}
});
});
},
importSessionKeys: function(ba, W, Z) {
lc(ba, gc, uc, {
result: function(ea) {
lc(W, hc, Dc, {
result: function(aa) {
Z.result({
encryptionKey: ea,
hmacKey: aa
});
},
error: function(aa) {
Z.error(aa);
}
});
},
error: function(ea) {
Z.error(ea);
}
});
}
});
fc.KeyExchangeData = fa;
})();
(function() {
var ba,
W,
Z;
function fa(ea, aa, ia, ua, ra) {
Ma(ra, function() {
var la,
pa;
switch (aa) {
case ba.PSK:
(la = new qc(ua),
pa = ea.getEntityAuthenticationFactory(Nb.PSK));
if (!pa)
throw new Lb(V.UNSUPPORTED_KEYX_MECHANISM, aa);
la = pa.getCryptoContext(ea, la);
return new nc(ea, oc.A128KW, ic, yb);
case ba.MGK:
la = new pc(ua);
pa = ea.getEntityAuthenticationFactory(Nb.MGK);
if (!pa)
throw new Lb(V.UNSUPPORTED_KEYX_MECHANISM, aa);
la = pa.getCryptoContext(ea, la);
return new nc(ea, oc.A128KW, ic, yb);
case ba.WRAP:
la = ea.getMslCryptoContext();
la.unwrap(ia, kc, vc, {
result: function(ya) {
Ma(ra, function() {
return new nc(ea, oc.A128KW, ic, ya);
});
},
error: ra.error
});
break;
default:
throw new Lb(V.UNSUPPORTED_KEYX_MECHANISM, aa);
}
});
}
ba = {
PSK: "PSK",
MGK: "MGK",
WRAP: "WRAP"
};
W = se = Uc.extend({
init: function ua(aa, ia) {
ua.base.call(this, dc.JWE_LADDER);
switch (aa) {
case ba.WRAP:
if (!ia)
throw new ub("Previous wrapping key based key exchange requires the previous wrapping key data and ID.");
break;
default:
ia = null;
}
Object.defineProperties(this, {
mechanism: {
value: aa,
writable: !1,
configurable: !1
},
wrapdata: {
value: ia,
writable: !1,
configurable: !1
}
});
},
getKeydata: function() {
var aa;
aa = {};
aa.mechanism = this.mechanism;
this.wrapdata && (aa.wrapdata = Bb(this.wrapdata));
return aa;
},
equals: function ua(ia) {
return ia === this ? !0 : ia instanceof se ? ua.base.call(this, ia) && this.mechanism == ia.mechanism && Zb(this.wrapdata, ia.wrapdata) : !1;
},
uniqueKey: function ua() {
var ra;
ra = ua.base.call(this) + ":" + this.mechanism;
this.wrapdata && (ra += ":" + $b(this.wrapdata));
return ra;
}
});
Z = te = Vc.extend({
init: function da(ra, la, pa, ya, na) {
da.base.call(this, ra, dc.JWE_LADDER);
Object.defineProperties(this, {
wrapKey: {
value: la,
writable: !1,
configurable: !1
},
wrapdata: {
value: pa,
writable: !1,
configurable: !1
},
encryptionKey: {
value: ya,
writable: !1,
configurable: !1
},
hmacKey: {
value: na,
writable: !1,
configurable: !1
}
});
},
getKeydata: function() {
var ra;
ra = {};
ra.wrapkey = Bb(this.wrapKey);
ra.wrapdata = Bb(this.wrapdata);
ra.encryptionkey = Bb(this.encryptionKey);
ra.hmackey = Bb(this.hmacKey);
return ra;
},
equals: function pa(la) {
return this === la ? !0 : la instanceof te ? pa.base.call(this, la) && Zb(this.wrapKey, la.wrapKey) && Zb(this.wrapdata, la.wrapdata) && Zb(this.encryptionKey, la.encryptionKey) && Zb(this.hmacKey, la.hmacKey) : !1;
},
uniqueKey: function pa() {
return pa.base.call(this) + ":" + $b(this.wrapKey) + ":" + $b(this.wrapdata) + ":" + $b(this.encryptionKey) + ":" + $b(this.hmacKey);
}
});
fc.extend({
init: function na(ya) {
na.base.call(this, dc.JWE_LADDER);
Object.defineProperties(this, {
repository: {
value: ya,
writable: !1,
enumerable: !1,
configurable: !1
}
});
},
createRequestData: function(ya, na, da) {
Ma(da, function() {
var ha,
ka,
wa;
ha = na.mechanism;
ka = na.wrapdata;
if (!ha || ha == ba.WRAP && (!ka || "string" !== typeof ka))
throw new Ab(V.JSON_PARSE_ERROR, "keydata " + JSON.stringify(na));
if (!ba[ha])
throw new Lb(V.UNIDENTIFIED_KEYX_MECHANISM, ha);
switch (ha) {
case ba.WRAP:
try {
wa = Fb(ka);
} catch (Qa) {
throw new Lb(V.KEYX_WRAPPING_KEY_MISSING, "keydata " + na.toString());
}
if (null == wa || 0 == wa.length)
throw new Lb(V.KEYX_WRAPPING_KEY_MISSING, "keydata " + na.toString());
break;
default:
wa = null;
}
return new W(ha, wa);
});
},
createResponseData: function(ya, na, da) {
var ha,
ka,
wa,
Qa,
La,
Pa,
Ra;
ya = da.wrapkey;
ha = da.wrapdata;
ka = da.encryptionkey;
wa = da.hmackey;
if (!(ya && "string" === typeof ya && ha && "string" === typeof ha && ka && "string" === typeof ka && wa) || "string" !== typeof wa)
throw new Ab(V.JSON_PARSE_ERROR, "keydata " + JSON.stringify(da));
try {
Qa = Fb(ya);
La = Fb(ha);
} catch (oa) {
throw new tb(V.INVALID_SYMMETRIC_KEY, "keydata " + JSON.stringify(da), oa);
}
try {
Pa = Fb(ka);
} catch (oa) {
throw new tb(V.INVALID_ENCRYPTION_KEY, "keydata " + JSON.stringify(da), oa);
}
try {
Ra = Fb(wa);
} catch (oa) {
throw new tb(V.INVALID_HMAC_KEY, "keydata " + JSON.stringify(da), oa);
}
return new Z(na, Qa, La, Pa, Ra);
},
generateResponse: function(ya, na, da, ha) {
var Pa,
Ra;
function ka(oa, xa, Da) {
Pa.generateSessionKeys(ya, {
result: function(Ha) {
Ma(ha, function() {
wa(oa, xa, Da, Ha.encryptionKey, Ha.hmacKey);
}, Pa);
},
error: function(Ha) {
Ma(ha, function() {
Ha instanceof db && Ha.setEntity(Ra);
throw Ha;
});
}
});
}
function wa(oa, xa, Da, Ha, Aa) {
Ma(ha, function() {
fa(ya, na.mechanism, na.wrapdata, oa, {
result: function(Sa) {
Sa.wrap(xa, {
result: function(Ga) {
Qa(xa, Da, Ha, Aa, Ga);
},
error: function(Ga) {
Ma(ha, function() {
Ga instanceof db && Ga.setEntity(Ra);
throw Ga;
});
}
});
},
error: function(Sa) {
Ma(ha, function() {
Sa instanceof db && Sa.setEntity(Ra);
throw Sa;
});
}
});
}, Pa);
}
function Qa(oa, xa, Da, Ha, Aa) {
Ma(ha, function() {
var Sa;
Sa = new nc(ya, oc.A128KW, ic, oa);
Sa.wrap(Da, {
result: function(Ga) {
Sa.wrap(Ha, {
result: function(Wa) {
La(xa, Aa, Da, Ga, Ha, Wa);
},
error: function(Wa) {
Ma(ha, function() {
Wa instanceof db && Wa.setEntity(Ra);
throw Wa;
});
}
});
},
error: function(Ga) {
Ma(ha, function() {
Ga instanceof db && Ga.setEntity(Ra);
throw Ga;
});
}
});
}, Pa);
}
function La(oa, xa, Da, Ha, Aa, Sa) {
Ma(ha, function() {
var Ga;
Ga = ya.getTokenFactory();
Ra ? Ga.renewMasterToken(ya, Ra, Da, Aa, {
result: function(Wa) {
Ma(ha, function() {
var $a,
Va;
$a = new ec(ya, Wa);
Va = new Z(Wa, xa, oa, Ha, Sa);
return new fc.KeyExchangeData(Va, $a, ha);
}, Pa);
},
error: function(Wa) {
Ma(ha, function() {
Wa instanceof db && Wa.setEntity(Ra);
throw Wa;
});
}
}) : Ga.createMasterToken(ya, da, Da, Aa, {
result: function(Wa) {
Ma(ha, function() {
var $a,
Va;
$a = new ec(ya, Wa);
Va = new Z(Wa, xa, oa, Ha, Sa);
return new fc.KeyExchangeData(Va, $a, ha);
}, Pa);
},
error: ha.error
});
}, Pa);
}
Pa = this;
Ma(ha, function() {
var oa,
xa;
if (!(na instanceof W))
throw new ub("Key request data " + JSON.stringify(na) + " was not created by this factory.");
oa = da;
if (da instanceof bc) {
if (!da.isVerified())
throw new Sc(V.MASTERTOKEN_UNTRUSTED, da);
Ra = da;
oa = da.identity;
}
xa = new Uint8Array(16);
ya.getRandom().nextBytes(xa);
lc(xa, kc, vc, {
result: function(Da) {
Ma(ha, function() {
ya.getMslCryptoContext().wrap(Da, {
result: function(Ha) {
ka(oa, Da, Ha);
},
error: function(Ha) {
Ma(ha, function() {
Ha instanceof db && Ha.setEntity(Ra);
throw Ha;
}, Pa);
}
});
}, Pa);
},
error: function(Da) {
Ma(ha, function() {
throw new tb(V.WRAP_KEY_CREATION_FAILURE, null, Da).setEntity(Ra);
}, Pa);
}
});
}, Pa);
},
getCryptoContext: function(ya, na, da, ha, ka) {
var Qa;
function wa(La, Pa, Ra, oa, xa) {
Ma(ka, function() {
var Da;
Da = new nc(ya, oc.A128KW, ic, xa);
Da.unwrap(Pa.encryptionKey, gc, uc, {
result: function(Ha) {
Da.unwrap(Pa.hmacKey, hc, Dc, {
result: function(Aa) {
Ma(ka, function() {
this.repository.addCryptoContext(Pa.wrapdata, Da);
this.repository.removeCryptoContext(Ra);
return new ec(ya, Pa.masterToken, oa, Ha, Aa);
}, Qa);
},
error: function(Aa) {
Ma(ka, function() {
Aa instanceof db && Aa.setEntity(La);
throw Aa;
});
}
});
},
error: function(Ha) {
Ma(ka, function() {
Ha instanceof db && Ha.setEntity(La);
throw Ha;
});
}
});
}, Qa);
}
Qa = this;
Ma(ka, function() {
var La,
Pa;
if (!(na instanceof W))
throw new ub("Key request data " + JSON.stringify(na) + " was not created by this factory.");
if (!(da instanceof Z))
throw new ub("Key response data " + JSON.stringify(da) + " was not created by this factory.");
La = na.mechanism;
Pa = na.wrapdata;
ya.getEntityAuthenticationData(null, {
result: function(Ra) {
Ma(ka, function() {
var oa,
xa,
Da;
oa = Ra.getIdentity();
switch (La) {
case ba.PSK:
xa = new qc(oa);
Da = ya.getEntityAuthenticationFactory(Nb.PSK);
if (!Da)
throw new Lb(V.UNSUPPORTED_KEYX_MECHANISM, La).setEntity(Ra);
xa = Da.getCryptoContext(ya, xa);
xa = new nc(ya, oc.A128KW, ic, yb);
break;
case ba.MGK:
xa = new pc(oa);
Da = ya.getEntityAuthenticationFactory(Nb.MGK);
if (!Da)
throw new Lb(V.UNSUPPORTED_KEYX_MECHANISM, La).setEntity(Ra);
xa = Da.getCryptoContext(ya, xa);
xa = new nc(ya, oc.A128KW, ic, xa.wrapKey);
break;
case ba.WRAP:
xa = this.repository.getCryptoContext(Pa);
if (!xa)
throw new Lb(V.KEYX_WRAPPING_KEY_MISSING, Bb(Pa)).setEntity(Ra);
break;
default:
throw new Lb(V.UNSUPPORTED_KEYX_MECHANISM, La).setEntity(Ra);
}
xa.unwrap(da.wrapKey, kc, vc, {
result: function(Ha) {
wa(Ra, da, Pa, oa, Ha);
},
error: function(Ha) {
Ma(ka, function() {
Ha instanceof db && Ha.setEntity(Ra);
throw Ha;
});
}
});
}, Qa);
},
error: ka.error
});
}, Qa);
}
});
})();
(function() {
var ba,
W,
Z,
ea;
function fa(aa, ia, ua, ra, la) {
Ma(la, function() {
var pa,
ya;
switch (ia) {
case ba.PSK:
(pa = new qc(ra),
ya = aa.getEntityAuthenticationFactory(Nb.PSK));
if (!ya)
throw new Lb(V.UNSUPPORTED_KEYX_MECHANISM, ia);
pa = ya.getCryptoContext(aa, pa);
return new ea(yb);
case ba.MGK:
pa = new pc(ra);
ya = aa.getEntityAuthenticationFactory(Nb.MGK);
if (!ya)
throw new Lb(V.UNSUPPORTED_KEYX_MECHANISM, ia);
pa = ya.getCryptoContext(aa, pa);
return new ea(yb);
case ba.WRAP:
pa = aa.getMslCryptoContext();
pa.unwrap(ua, kc, vc, {
result: function(na) {
Ma(la, function() {
return new ea(na);
});
},
error: la.error
});
break;
default:
throw new Lb(V.UNSUPPORTED_KEYX_MECHANISM, ia);
}
});
}
ba = {
PSK: "PSK",
MGK: "MGK",
WRAP: "WRAP"
};
W = ue = Uc.extend({
init: function ra(ia, ua) {
ra.base.call(this, dc.JWK_LADDER);
switch (ia) {
case ba.WRAP:
if (!ua)
throw new ub("Previous wrapping key based key exchange requires the previous wrapping key data and ID.");
break;
default:
ua = null;
}
Object.defineProperties(this, {
mechanism: {
value: ia,
writable: !1,
configurable: !1
},
wrapdata: {
value: ua,
writable: !1,
configurable: !1
}
});
},
getKeydata: function() {
var ia;
ia = {};
ia.mechanism = this.mechanism;
this.wrapdata && (ia.wrapdata = Bb(this.wrapdata));
return ia;
},
equals: function ra(ua) {
return ua === this ? !0 : ua instanceof ue ? ra.base.call(this, ua) && this.mechanism == ua.mechanism && Zb(this.wrapdata, ua.wrapdata) : !1;
},
uniqueKey: function ra() {
var la;
la = ra.base.call(this) + ":" + this.mechanism;
this.wrapdata && (la += ":" + $b(this.wrapdata));
return la;
}
});
Z = ve = Vc.extend({
init: function ha(la, pa, ya, na, da) {
ha.base.call(this, la, dc.JWK_LADDER);
Object.defineProperties(this, {
wrapKey: {
value: pa,
writable: !1,
configurable: !1
},
wrapdata: {
value: ya,
writable: !1,
configurable: !1
},
encryptionKey: {
value: na,
writable: !1,
configurable: !1
},
hmacKey: {
value: da,
writable: !1,
configurable: !1
}
});
},
getKeydata: function() {
var la;
la = {};
la.wrapkey = Bb(this.wrapKey);
la.wrapdata = Bb(this.wrapdata);
la.encryptionkey = Bb(this.encryptionKey);
la.hmackey = Bb(this.hmacKey);
return la;
},
equals: function ya(pa) {
return this === pa ? !0 : pa instanceof ve ? ya.base.call(this, pa) && Zb(this.wrapKey, pa.wrapKey) && Zb(this.wrapdata, pa.wrapdata) && Zb(this.encryptionKey, pa.encryptionKey) && Zb(this.hmacKey, pa.hmacKey) : !1;
},
uniqueKey: function ya() {
return ya.base.call(this) + ":" + $b(this.wrapKey) + ":" + $b(this.wrapdata) + ":" + $b(this.encryptionKey) + ":" + $b(this.hmacKey);
}
});
ea = Lc.extend({
init: function(ya) {
ya && ya.rawKey && (ya = ya.rawKey);
Object.defineProperties(this, {
_wrapKey: {
value: ya,
writable: !1,
enumerable: !1,
configurable: !1
}
});
},
encrypt: function(ya, na) {
na.error(new tb(V.ENCRYPT_NOT_SUPPORTED));
},
decrypt: function(ya, na) {
na.error(new tb(V.DECRYPT_NOT_SUPPORTED));
},
wrap: function(ya, na) {
Ma(na, function() {
Ib.wrapKey("jwk", ya.rawKey, this._wrapKey, kc).then(function(da) {
na.result(da);
}, function(da) {
na.error(new tb(V.WRAP_ERROR));
});
}, this);
},
unwrap: function(ya, na, da, ha) {
function ka(wa) {
Ma(ha, function() {
switch (wa.type) {
case "secret":
Tc(wa, ha);
break;
case "public":
Ac(wa, ha);
break;
case "private":
Jc(wa, ha);
break;
default:
throw new tb(V.UNSUPPORTED_KEY, "type: " + wa.type);
}
});
}
Ma(ha, function() {
Ib.unwrapKey("jwk", ya, this._wrapKey, kc, na, !1, da).then(function(wa) {
ka(wa);
}, function(wa) {
ha.error(new tb(V.UNWRAP_ERROR));
});
}, this);
},
sign: function(ya, na) {
na.error(new tb(V.SIGN_NOT_SUPPORTED));
},
verify: function(ya, na, da) {
da.error(new tb(V.VERIFY_NOT_SUPPORTED));
}
});
fc.extend({
init: function da(na) {
da.base.call(this, dc.JWK_LADDER);
Object.defineProperties(this, {
repository: {
value: na,
writable: !1,
enumerable: !1,
configurable: !1
}
});
},
createRequestData: function(na, da, ha) {
Ma(ha, function() {
var ka,
wa,
Qa;
ka = da.mechanism;
wa = da.wrapdata;
if (!ka || ka == ba.WRAP && (!wa || "string" !== typeof wa))
throw new Ab(V.JSON_PARSE_ERROR, "keydata " + JSON.stringify(da));
if (!ba[ka])
throw new Lb(V.UNIDENTIFIED_KEYX_MECHANISM, ka);
switch (ka) {
case ba.WRAP:
try {
Qa = Fb(wa);
} catch (La) {
throw new Lb(V.KEYX_WRAPPING_KEY_MISSING, "keydata " + da.toString());
}
if (null == Qa || 0 == Qa.length)
throw new Lb(V.KEYX_WRAPPING_KEY_MISSING, "keydata " + da.toString());
break;
default:
Qa = null;
}
return new W(ka, Qa);
});
},
createResponseData: function(na, da, ha) {
var ka,
wa,
Qa,
La,
Pa,
Ra,
oa;
na = ha.wrapkey;
ka = ha.wrapdata;
wa = ha.encryptionkey;
Qa = ha.hmackey;
if (!(na && "string" === typeof na && ka && "string" === typeof ka && wa && "string" === typeof wa && Qa) || "string" !== typeof Qa)
throw new Ab(V.JSON_PARSE_ERROR, "keydata " + JSON.stringify(ha));
try {
La = Fb(na);
Pa = Fb(ka);
} catch (xa) {
throw new tb(V.INVALID_SYMMETRIC_KEY, "keydata " + JSON.stringify(ha), xa);
}
try {
Ra = Fb(wa);
} catch (xa) {
throw new tb(V.INVALID_ENCRYPTION_KEY, "keydata " + JSON.stringify(ha), xa);
}
try {
oa = Fb(Qa);
} catch (xa) {
throw new tb(V.INVALID_HMAC_KEY, "keydata " + JSON.stringify(ha), xa);
}
return new Z(da, La, Pa, Ra, oa);
},
generateResponse: function(na, da, ha, ka) {
var Ra,
oa;
function wa(xa, Da, Ha) {
Ra.generateSessionKeys(na, {
result: function(Aa) {
Ma(ka, function() {
Qa(xa, Da, Ha, Aa.encryptionKey, Aa.hmacKey);
}, Ra);
},
error: function(Aa) {
Ma(ka, function() {
Aa instanceof db && Aa.setEntity(oa);
throw Aa;
});
}
});
}
function Qa(xa, Da, Ha, Aa, Sa) {
Ma(ka, function() {
fa(na, da.mechanism, da.wrapdata, xa, {
result: function(Ga) {
Ga.wrap(Da, {
result: function(Wa) {
La(Da, Ha, Aa, Sa, Wa);
},
error: function(Wa) {
Ma(ka, function() {
Wa instanceof db && Wa.setEntity(oa);
throw Wa;
});
}
});
},
error: function(Ga) {
Ma(ka, function() {
Ga instanceof db && Ga.setEntity(oa);
throw Ga;
});
}
});
}, Ra);
}
function La(xa, Da, Ha, Aa, Sa) {
Ma(ka, function() {
var Ga;
Ga = new ea(xa);
Ga.wrap(Ha, {
result: function(Wa) {
Ga.wrap(Aa, {
result: function($a) {
Pa(Da, Sa, Ha, Wa, Aa, $a);
},
error: function($a) {
Ma(ka, function() {
$a instanceof db && $a.setEntity(oa);
throw $a;
});
}
});
},
error: function(Wa) {
Ma(ka, function() {
Wa instanceof db && Wa.setEntity(oa);
throw Wa;
});
}
});
}, Ra);
}
function Pa(xa, Da, Ha, Aa, Sa, Ga) {
Ma(ka, function() {
var Wa;
Wa = na.getTokenFactory();
oa ? Wa.renewMasterToken(na, oa, Ha, Sa, {
result: function($a) {
Ma(ka, function() {
var Va,
hb;
Va = new ec(na, $a);
hb = new Z($a, Da, xa, Aa, Ga);
return new fc.KeyExchangeData(hb, Va, ka);
}, Ra);
},
error: function($a) {
Ma(ka, function() {
$a instanceof db && $a.setEntity(oa);
throw $a;
});
}
}) : Wa.createMasterToken(na, ha, Ha, Sa, {
result: function($a) {
Ma(ka, function() {
var Va,
hb;
Va = new ec(na, $a);
hb = new Z($a, Da, xa, Aa, Ga);
return new fc.KeyExchangeData(hb, Va, ka);
}, Ra);
},
error: ka.error
});
}, Ra);
}
Ra = this;
Ma(ka, function() {
var xa,
Da;
if (!(da instanceof W))
throw new ub("Key request data " + JSON.stringify(da) + " was not created by this factory.");
xa = ha;
if (ha instanceof bc) {
if (!ha.isVerified())
throw new Sc(V.MASTERTOKEN_UNTRUSTED, ha);
oa = ha;
xa = ha.identity;
}
Da = new Uint8Array(16);
na.getRandom().nextBytes(Da);
lc(Da, kc, vc, {
result: function(Ha) {
Ma(ka, function() {
na.getMslCryptoContext().wrap(Ha, {
result: function(Aa) {
wa(xa, Ha, Aa);
},
error: function(Aa) {
Ma(ka, function() {
Aa instanceof db && Aa.setEntity(oa);
throw Aa;
}, Ra);
}
});
}, Ra);
},
error: function(Ha) {
Ma(ka, function() {
throw new tb(V.WRAP_KEY_CREATION_FAILURE, null, Ha).setEntity(oa);
}, Ra);
}
});
}, Ra);
},
getCryptoContext: function(na, da, ha, ka, wa) {
var La;
function Qa(Pa, Ra, oa, xa, Da) {
Ma(wa, function() {
var Ha;
Ha = new ea(Da);
Ha.unwrap(Ra.encryptionKey, gc, uc, {
result: function(Aa) {
Ha.unwrap(Ra.hmacKey, hc, Dc, {
result: function(Sa) {
Ma(wa, function() {
this.repository.addCryptoContext(Ra.wrapdata, Ha);
this.repository.removeCryptoContext(oa);
return new ec(na, Ra.masterToken, xa, Aa, Sa);
}, La);
},
error: function(Sa) {
Ma(wa, function() {
Sa instanceof db && Sa.setEntity(Pa);
throw Sa;
});
}
});
},
error: function(Aa) {
Ma(wa, function() {
Aa instanceof db && Aa.setEntity(Pa);
throw Aa;
});
}
});
}, La);
}
La = this;
Ma(wa, function() {
var Pa,
Ra;
if (!(da instanceof W))
throw new ub("Key request data " + JSON.stringify(da) + " was not created by this factory.");
if (!(ha instanceof Z))
throw new ub("Key response data " + JSON.stringify(ha) + " was not created by this factory.");
Pa = da.mechanism;
Ra = da.wrapdata;
na.getEntityAuthenticationData(null, {
result: function(oa) {
Ma(wa, function() {
var xa,
Da,
Ha;
xa = oa.getIdentity();
switch (Pa) {
case ba.PSK:
Da = new qc(xa);
Ha = na.getEntityAuthenticationFactory(Nb.PSK);
if (!Ha)
throw new Lb(V.UNSUPPORTED_KEYX_MECHANISM, Pa).setEntity(oa);
Da = Ha.getCryptoContext(na, Da);
Da = new ea(Da.wrapKey);
break;
case ba.MGK:
Da = new pc(xa);
Ha = na.getEntityAuthenticationFactory(Nb.MGK);
if (!Ha)
throw new Lb(V.UNSUPPORTED_KEYX_MECHANISM, Pa).setEntity(oa);
Da = Ha.getCryptoContext(na, Da);
Da = new ea(Da.wrapKey);
break;
case ba.WRAP:
Da = this.repository.getCryptoContext(Ra);
if (!Da)
throw new Lb(V.KEYX_WRAPPING_KEY_MISSING, Bb(Ra)).setEntity(oa);
break;
default:
throw new Lb(V.UNSUPPORTED_KEYX_MECHANISM, Pa).setEntity(oa);
}
Da.unwrap(ha.wrapKey, kc, vc, {
result: function(Aa) {
Qa(oa, ha, Ra, xa, Aa);
},
error: function(Aa) {
Ma(wa, function() {
Aa instanceof db && Aa.setEntity(oa);
throw Aa;
});
}
});
}, La);
},
error: wa.error
});
}, La);
}
});
})();
sf = zb.Class.create({
addCryptoContext: function(fa, ba) {},
getCryptoContext: function(fa) {},
removeCryptoContext: function(fa) {}
});
(function() {
var ba,
W,
Z,
ea;
function fa(aa, ia, ua, ra, la) {
switch (ua) {
case ba.JWE_RSA:
case ba.JWEJS_RSA:
return new nc(aa, oc.RSA_OAEP, ic, ra, la);
case ba.JWK_RSA:
return new hd(aa, ia, ra, la, id.WRAP_UNWRAP_OAEP);
case ba.JWK_RSAES:
return new hd(aa, ia, ra, la, id.WRAP_UNWRAP_PKCS1);
default:
throw new tb(V.UNSUPPORTED_KEYX_MECHANISM, ua);
}
}
ba = we = {
RSA: "RSA",
ECC: "ECC",
JWE_RSA: "JWE_RSA",
JWEJS_RSA: "JWEJS_RSA",
JWK_RSA: "JWK_RSA",
JWK_RSAES: "JWK_RSAES"
};
W = vd = Uc.extend({
init: function pa(ia, ua, ra, la) {
pa.base.call(this, dc.ASYMMETRIC_WRAPPED);
Object.defineProperties(this, {
keyPairId: {
value: ia,
writable: !1,
configurable: !1
},
mechanism: {
value: ua,
writable: !1,
configurable: !1
},
publicKey: {
value: ra,
writable: !1,
configurable: !1
},
privateKey: {
value: la,
writable: !1,
configurable: !1
}
});
},
getKeydata: function() {
var ia;
ia = {};
ia.keypairid = this.keyPairId;
ia.mechanism = this.mechanism;
ia.publickey = Bb(this.publicKey.getEncoded());
return ia;
},
equals: function ra(ua) {
var la;
if (ua === this)
return !0;
if (!(ua instanceof vd))
return !1;
la = this.privateKey === ua.privateKey || this.privateKey && ua.privateKey && Zb(this.privateKey.getEncoded(), ua.privateKey.getEncoded());
return ra.base.call(this, ua) && this.keyPairId == ua.keyPairId && this.mechanism == ua.mechanism && Zb(this.publicKey.getEncoded(), ua.publicKey.getEncoded()) && la;
},
uniqueKey: function ra() {
var la,
pa;
la = this.publicKey.getEncoded();
pa = this.privateKey && this.privateKey.getEncoded();
la = ra.base.call(this) + ":" + this.keyPairId + ":" + this.mechanism + ":" + $b(la);
pa && (la += ":" + $b(pa));
return la;
}
});
Z = function(ra, la) {
Ma(la, function() {
var pa,
ya,
na,
da;
pa = ra.keypairid;
ya = ra.mechanism;
na = ra.publickey;
if (!pa || "string" !== typeof pa || !ya || !na || "string" !== typeof na)
throw new Ab(V.JSON_PARSE_ERROR, "keydata " + JSON.stringify(ra));
if (!ba[ya])
throw new Lb(V.UNIDENTIFIED_KEYX_MECHANISM, ya);
try {
da = Fb(na);
switch (ya) {
case ba.JWE_RSA:
case ba.JWEJS_RSA:
case ba.JWK_RSA:
Ad(da, fd, vc, {
result: function(ha) {
la.result(new W(pa, ya, ha, null));
},
error: function(ha) {
la.error(ha);
}
});
break;
case ba.JWK_RSAES:
Ad(da, yd, vc, {
result: function(ha) {
la.result(new W(pa, ya, ha, null));
},
error: function(ha) {
la.error(ha);
}
});
break;
default:
throw new tb(V.UNSUPPORTED_KEYX_MECHANISM, ya);
}
} catch (ha) {
if (!(ha instanceof db))
throw new tb(V.INVALID_PUBLIC_KEY, "keydata " + JSON.stringify(ra), ha);
throw ha;
}
});
};
ea = xe = Vc.extend({
init: function da(la, pa, ya, na) {
da.base.call(this, la, dc.ASYMMETRIC_WRAPPED);
Object.defineProperties(this, {
keyPairId: {
value: pa,
writable: !1,
configurable: !1
},
encryptionKey: {
value: ya,
writable: !1,
configurable: !1
},
hmacKey: {
value: na,
writable: !1,
configurable: !1
}
});
},
getKeydata: function() {
var la;
la = {};
la.keypairid = this.keyPairId;
la.encryptionkey = Bb(this.encryptionKey);
la.hmackey = Bb(this.hmacKey);
return la;
},
equals: function ya(pa) {
return this === pa ? !0 : pa instanceof xe ? ya.base.call(this, pa) && this.keyPairId == pa.keyPairId && Zb(this.encryptionKey, pa.encryptionKey) && Zb(this.hmacKey, pa.hmacKey) : !1;
},
uniqueKey: function ya() {
return ya.base.call(this) + ":" + this.keyPairId + ":" + $b(this.encryptionKey) + ":" + $b(this.hmacKey);
}
});
be = fc.extend({
init: function na() {
na.base.call(this, dc.ASYMMETRIC_WRAPPED);
},
createRequestData: function(na, da, ha) {
Z(da, ha);
},
createResponseData: function(na, da, ha) {
var ka,
wa,
Qa,
La;
na = ha.keypairid;
ka = ha.encryptionkey;
wa = ha.hmackey;
if (!na || "string" !== typeof na || !ka || "string" !== typeof ka || !wa || "string" !== typeof wa)
throw new Ab(V.JSON_PARSE_ERROR, "keydata " + JSON.stringify(ha));
try {
Qa = Fb(ka);
} catch (Pa) {
throw new tb(V.INVALID_ENCRYPTION_KEY, "keydata " + JSON.stringify(ha), Pa);
}
try {
La = Fb(wa);
} catch (Pa) {
throw new tb(V.INVALID_HMAC_KEY, "keydata " + JSON.stringify(ha), Pa);
}
return new ea(da, na, Qa, La);
},
generateResponse: function(na, da, ha, ka) {
var La;
function wa(Pa, Ra) {
Ma(ka, function() {
var oa;
oa = fa(na, da.keyPairId, da.mechanism, null, da.publicKey);
oa.wrap(Pa, {
result: function(xa) {
Ma(ka, function() {
oa.wrap(Ra, {
result: function(Da) {
Qa(Pa, xa, Ra, Da);
},
error: function(Da) {
Ma(ka, function() {
Da instanceof db && ha instanceof bc && Da.setEntity(ha);
throw Da;
}, La);
}
});
}, La);
},
error: function(xa) {
Ma(ka, function() {
xa instanceof db && ha instanceof bc && xa.setEntity(ha);
throw xa;
}, La);
}
});
}, La);
}
function Qa(Pa, Ra, oa, xa) {
Ma(ka, function() {
var Da;
Da = na.getTokenFactory();
ha instanceof bc ? Da.renewMasterToken(na, ha, Pa, oa, {
result: function(Ha) {
Ma(ka, function() {
var Aa,
Sa;
Aa = new ec(na, Ha);
Sa = new ea(Ha, da.keyPairId, Ra, xa);
return new fc.KeyExchangeData(Sa, Aa, ka);
}, La);
},
error: function(Ha) {
Ma(ka, function() {
Ha instanceof db && Ha.setEntity(ha);
throw Ha;
}, La);
}
}) : Da.createMasterToken(na, ha, Pa, oa, {
result: function(Ha) {
Ma(ka, function() {
var Aa,
Sa;
Aa = new ec(na, Ha);
Sa = new ea(Ha, da.keyPairId, Ra, xa);
return new fc.KeyExchangeData(Sa, Aa, ka);
}, La);
},
error: ka.error
});
}, La);
}
La = this;
Ma(ka, function() {
if (!(da instanceof W))
throw new ub("Key request data " + JSON.stringify(da) + " was not created by this factory.");
this.generateSessionKeys(na, {
result: function(Pa) {
wa(Pa.encryptionKey, Pa.hmacKey);
},
error: function(Pa) {
Ma(ka, function() {
Pa instanceof db && ha instanceof bc && Pa.setEntity(ha);
throw Pa;
}, La);
}
});
}, La);
},
getCryptoContext: function(na, da, ha, ka, wa) {
var Qa;
Qa = this;
Ma(wa, function() {
var La,
Pa,
Ra;
if (!(da instanceof W))
throw new ub("Key request data " + JSON.stringify(da) + " was not created by this factory.");
if (!(ha instanceof ea))
throw new ub("Key response data " + JSON.stringify(ha) + " was not created by this factory.");
La = da.keyPairId;
Pa = ha.keyPairId;
if (La != Pa)
throw new Lb(V.KEYX_RESPONSE_REQUEST_MISMATCH, "request " + La + "; response " + Pa).setEntity(ka);
Pa = da.privateKey;
if (!Pa)
throw new Lb(V.KEYX_PRIVATE_KEY_MISSING, "request Asymmetric private key").setEntity(ka);
Ra = fa(na, La, da.mechanism, Pa, null);
Ra.unwrap(ha.encryptionKey, gc, uc, {
result: function(oa) {
Ra.unwrap(ha.hmacKey, hc, Dc, {
result: function(xa) {
na.getEntityAuthenticationData(null, {
result: function(Da) {
Ma(wa, function() {
var Ha;
Ha = Da.getIdentity();
return new ec(na, ha.masterToken, Ha, oa, xa);
}, Qa);
},
error: function(Da) {
Ma(wa, function() {
Da instanceof db && Da.setEntity(ka);
throw Da;
}, Qa);
}
});
},
error: function(xa) {
Ma(wa, function() {
xa instanceof db && xa.setEntity(ka);
throw xa;
}, Qa);
}
});
},
error: function(oa) {
Ma(wa, function() {
oa instanceof db && oa.setEntity(ka);
throw oa;
}, Qa);
}
});
}, Qa);
}
});
})();
rf = zb.Class.create({
init: function(fa) {
var ba,
W,
Z,
ea,
aa,
ia,
ua,
ra;
ba = Tb.parser();
W = [];
Z = [];
ua = 0;
ra = !1;
ba.onerror = function(la) {
ra || (ra = !0, ba.end());
};
ba.onopenobject = function(la) {
var pa;
if (ea)
(ea[ia] = {},
Z.push(ea),
ea = ea[ia]);
else if (aa) {
pa = {};
Z.push(aa);
aa.push(pa);
ea = pa;
aa = yb;
} else
ea = {};
ia = la;
};
ba.oncloseobject = function() {
var la;
la = Z.pop();
la ? "object" === typeof la ? ea = la : (ea = yb, aa = la) : (W.push(ea), ua = ba.index, ea = yb);
};
ba.onopenarray = function() {
var la;
if (ea)
(ea[ia] = [],
Z.push(ea),
aa = ea[ia],
ea = yb);
else if (aa) {
la = [];
Z.push(aa);
aa.push(la);
aa = la;
} else
aa = [];
};
ba.onclosearray = function() {
var la;
la = Z.pop();
la ? "object" === typeof la ? (ea = la, aa = yb) : aa = la : (W.push(aa), ua = ba.index, aa = yb);
};
ba.onkey = function(la) {
ia = la;
};
ba.onvalue = function(la) {
ea ? ea[ia] = la : aa ? aa.push(la) : (W.push(la), ua = ba.index);
};
ba.write(fa).close();
Object.defineProperties(this, {
_values: {
value: W,
writable: !1,
enumerable: !1,
configurable: !1
},
_lastIndex: {
value: ua,
writable: !0,
enumerable: !1,
configurable: !1
}
});
},
more: function() {
return 0 < this._values.length;
},
nextValue: function() {
return 0 == this._values.length ? yb : this._values.shift();
},
lastIndex: function() {
return this._lastIndex;
}
});
(function() {
var fa,
ba,
W,
Z,
ea;
fa = Jd = "entityauthdata";
ba = ze = "mastertoken";
W = Ae = "headerdata";
Z = Be = "errordata";
ea = Kd = "signature";
ye = function(aa, ia, ua, ra) {
Ma(ra, function() {
var la,
pa,
ya,
na,
da,
ha;
la = ia[fa];
pa = ia[ba];
ya = ia[ea];
if (la && "object" !== typeof la || pa && "object" !== typeof pa || "string" !== typeof ya)
throw new Ab(V.JSON_PARSE_ERROR, "header/errormsg " + JSON.stringify(ia));
try {
na = Fb(ya);
} catch (ka) {
throw new Gb(V.HEADER_SIGNATURE_INVALID, "header/errormsg " + JSON.stringify(ia), ka);
}
da = null;
la && (da = ke(aa, la));
ha = ia[W];
if (ha != yb && null != ha) {
if ("string" !== typeof ha)
throw new Ab(V.JSON_PARSE_ERROR, "header/errormsg " + JSON.stringify(ia));
pa ? Wc(aa, pa, {
result: function(ka) {
Ld(aa, ha, da, ka, na, ua, ra);
},
error: function(ka) {
ra.error(ka);
}
}) : Ld(aa, ha, da, null, na, ua, ra);
} else if ((la = ia[Z], la != yb && null != la)) {
if ("string" !== typeof la)
throw new Ab(V.JSON_PARSE_ERROR, "header/errormsg " + JSON.stringify(ia));
Ce(aa, la, da, na, ra);
} else
throw new Ab(V.JSON_PARSE_ERROR, JSON.stringify(ia));
});
};
})();
(function() {
function fa(ba, W) {
this.errordata = ba;
this.signature = W;
}
zc = zb.Class.create({
init: function(ba, W, Z, ea, aa, ia, ua, ra, la, pa) {
var ya;
ya = this;
Ma(pa, function() {
var na,
da;
0 > ia && (ia = -1);
if (0 > ea || ea > Jb)
throw new ub("Message ID " + ea + " is out of range.");
if (!W)
throw new Gb(V.MESSAGE_ENTITY_NOT_FOUND);
if (la)
return ( Object.defineProperties(this, {
entityAuthenticationData: {
value: W,
writable: !1,
configurable: !1
},
recipient: {
value: Z,
writable: !1,
configurable: !1
},
messageId: {
value: ea,
writable: !1,
configurable: !1
},
errorCode: {
value: aa,
writable: !1,
configurable: !1
},
internalCode: {
value: ia,
writable: !1,
configurable: !1
},
errorMessage: {
value: ua,
writable: !1,
configurable: !1
},
userMessage: {
value: ra,
writable: !1,
configurable: !1
},
errordata: {
value: la.errordata,
writable: !1,
enumerable: !1,
configurable: !1
},
signature: {
value: la.signature,
writable: !1,
enumerable: !1,
configurable: !1
}
}), this) ;
na = {};
Z && (na.recipient = Z);
na.messageid = ea;
na.errorcode = aa;
0 < ia && (na.internalcode = ia);
ua && (na.errormsg = ua);
ra && (na.usermsg = ra);
try {
da = ba.getEntityAuthenticationFactory(W.scheme).getCryptoContext(ba, W);
} catch (ha) {
throw (ha instanceof db && (ha.setEntity(W), ha.setMessageId(ea)), ha);
}
na = Xb(JSON.stringify(na), Kb);
da.encrypt(na, {
result: function(ha) {
Ma(pa, function() {
da.sign(ha, {
result: function(ka) {
Ma(pa, function() {
Object.defineProperties(this, {
entityAuthenticationData: {
value: W,
writable: !1,
configurable: !1
},
recipient: {
value: Z,
writable: !1,
configurable: !1
},
messageId: {
value: ea,
writable: !1,
configurable: !1
},
errorCode: {
value: aa,
writable: !1,
configurable: !1
},
internalCode: {
value: ia,
writable: !1,
configurable: !1
},
errorMessage: {
value: ua,
writable: !1,
configurable: !1
},
userMessage: {
value: ra,
writable: !1,
configurable: !1
},
errordata: {
value: ha,
writable: !1,
enumerable: !1,
configurable: !1
},
signature: {
value: ka,
writable: !1,
enumerable: !1,
configurable: !1
}
});
return this;
}, ya);
},
error: function(ka) {
Ma(pa, function() {
ka instanceof db && (ka.setEntity(W), ka.setMessageId(ea));
throw ka;
}, ya);
}
});
}, ya);
},
error: function(ha) {
Ma(pa, function() {
ha instanceof db && (ha.setEntity(W), ha.setMessageId(ea));
throw ha;
}, ya);
}
});
}, ya);
},
toJSON: function() {
var ba;
ba = {};
ba[Jd] = this.entityAuthenticationData;
ba[Be] = Bb(this.errordata);
ba[Kd] = Bb(this.signature);
return ba;
}
});
De = function(ba, W, Z, ea, aa, ia, ua, ra, la) {
new zc(ba, W, Z, ea, aa, ia, ua, ra, null, la);
};
Ce = function(ba, W, Z, ea, aa) {
Ma(aa, function() {
var ia,
ua,
ra;
if (!Z)
throw new Gb(V.MESSAGE_ENTITY_NOT_FOUND);
try {
ia = Z.scheme;
ua = ba.getEntityAuthenticationFactory(ia);
if (!ua)
throw new jc(V.ENTITYAUTH_FACTORY_NOT_FOUND, ia);
ra = ua.getCryptoContext(ba, Z);
} catch (la) {
throw (la instanceof db && la.setEntity(Z), la);
}
try {
W = Fb(W);
} catch (la) {
throw new Gb(V.HEADER_DATA_INVALID, W, la).setEntity(Z);
}
if (!W || 0 == W.length)
throw new Gb(V.HEADER_DATA_MISSING, W).setEntity(Z);
ra.verify(W, ea, {
result: function(la) {
Ma(aa, function() {
if (!la)
throw new tb(V.MESSAGE_VERIFICATION_FAILED).setEntity(Z);
ra.decrypt(W, {
result: function(pa) {
Ma(aa, function() {
var ya,
na,
da,
ha,
ka,
wa,
Qa,
La;
ya = Wb(pa, Kb);
try {
na = JSON.parse(ya);
} catch (Ra) {
if (Ra instanceof SyntaxError)
throw new Ab(V.JSON_PARSE_ERROR, "errordata " + ya, Ra).setEntity(Z);
throw Ra;
}
da = na.recipient !== yb ? na.recipient : null;
ha = parseInt(na.messageid);
ka = parseInt(na.errorcode);
wa = parseInt(na.internalcode);
Qa = na.errormsg;
La = na.usermsg;
if (da && "string" !== typeof da || !ha || ha != ha || !ka || ka != ka || na.internalcode && wa != wa || Qa && "string" !== typeof Qa || La && "string" !== typeof La)
throw new Ab(V.JSON_PARSE_ERROR, "errordata " + ya).setEntity(Z);
if (0 > ha || ha > Jb)
throw new Gb(V.MESSAGE_ID_OUT_OF_RANGE, "errordata " + ya).setEntity(Z);
na = !1;
for (var Pa in Ea) {
if (Ea[Pa] == ka) {
na = !0;
break;
}
}
na || (ka = Ea.FAIL);
if (wa) {
if (0 > wa)
throw new Gb(V.INTERNAL_CODE_NEGATIVE, "errordata " + ya).setEntity(Z).setMessageId(ha);
} else
wa = -1;
ya = new fa(W, ea);
new zc(ba, Z, da, ha, ka, wa, Qa, La, ya, aa);
});
},
error: function(pa) {
Ma(aa, function() {
pa instanceof db && pa.setEntity(Z);
throw pa;
});
}
});
});
},
error: function(la) {
Ma(aa, function() {
la instanceof db && la.setEntity(Z);
throw la;
});
}
});
});
};
})();
tf = zb.Class.create({
getUserMessage: function(fa, ba) {}
});
(function() {
Md = function(fa, ba) {
var W;
if (!fa || !ba)
return null;
W = fa.compressionAlgorithms.filter(function(Z) {
for (var ea = 0; ea < ba.compressionAlgorithms.length; ++ea) {
if (Z == ba.compressionAlgorithms[ea])
return !0;
}
return !1;
});
fa = fa.languages.filter(function(Z) {
for (var ea = 0; ea < ba.languages.length; ++ea) {
if (Z == ba.languages[ea])
return !0;
}
return !1;
});
return new Xc(W, fa);
};
Xc = zb.Class.create({
init: function(fa, ba) {
fa || (fa = []);
ba || (ba = []);
fa.sort();
Object.defineProperties(this, {
compressionAlgorithms: {
value: fa,
writable: !1,
enumerable: !0,
configurable: !1
},
languages: {
value: ba,
writable: !1,
enumerable: !0,
configurable: !1
}
});
},
toJSON: function() {
var fa;
fa = {};
fa.compressionalgos = this.compressionAlgorithms;
fa.languages = this.languages;
return fa;
},
equals: function(fa) {
return this === fa ? !0 : fa instanceof Xc ? Vd(this.compressionAlgorithms, fa.compressionAlgorithms) && Vd(this.languages, fa.languages) : !1;
},
uniqueKey: function() {
return this.compressionAlgorithms.join(":") + "|" + this.languages.join(":");
}
});
Ee = function(fa) {
var ba,
W,
ea;
ba = fa.compressionalgos;
W = fa.languages;
if (ba && !(ba instanceof Array) || W && !(W instanceof Array))
throw new Ab(V.JSON_PARSE_ERROR, "capabilities " + JSON.stringify(fa));
fa = [];
for (var Z = 0; ba && Z < ba.length; ++Z) {
ea = ba[Z];
Bc[ea] && fa.push(ea);
}
return new Xc(fa, W);
};
})();
(function() {
var pa,
ya;
function fa(na, da, ha, ka, wa) {
this.customer = na;
this.sender = da;
this.messageCryptoContext = ha;
this.headerdata = ka;
this.signature = wa;
}
function ba(na, da, ha, ka, wa, Qa, La, Pa, Ra, oa, xa, Da, Ha, Aa, Sa, Ga, Wa, $a, Va, hb) {
return {
cryptoContext: {
value: da,
writable: !1,
configurable: !1
},
customer: {
value: ha,
writable: !1,
configurable: !1
},
entityAuthenticationData: {
value: ka,
writable: !1,
configurable: !1
},
masterToken: {
value: wa,
writable: !1,
configurable: !1
},
sender: {
value: Qa,
writable: !1,
configurable: !1
},
messageId: {
value: La,
writable: !1,
configurable: !1
},
nonReplayableId: {
value: Ga,
writable: !1,
configurable: !1
},
keyRequestData: {
value: Pa,
writable: !1,
configurable: !1
},
keyResponseData: {
value: Ra,
writable: !1,
configurable: !1
},
userAuthenticationData: {
value: oa,
writable: !1,
configurable: !1
},
userIdToken: {
value: xa,
writable: !1,
configurable: !1
},
serviceTokens: {
value: Da,
writable: !1,
configurable: !1
},
peerMasterToken: {
value: Ha,
writable: !1,
configurable: !1
},
peerUserIdToken: {
value: Aa,
writable: !1,
configurable: !1
},
peerServiceTokens: {
value: Sa,
writable: !1,
configurable: !1
},
messageCapabilities: {
value: $a,
writable: !1,
configurable: !1
},
renewable: {
value: Wa,
writable: !1,
enumerable: !1,
configurable: !1
},
headerdata: {
value: Va,
writable: !1,
enumerable: !1,
configurable: !1
},
signature: {
value: hb,
writable: !1,
enumerable: !1,
configurable: !1
}
};
}
function W(na, da, ha) {
var ka;
if (ha) {
if (da = na.getMslStore().getCryptoContext(ha))
return da;
if (!ha.isVerified() || !ha.isDecrypted())
throw new Sc(V.MASTERTOKEN_UNTRUSTED, ha);
return new ec(na, ha);
}
ha = da.scheme;
ka = na.getEntityAuthenticationFactory(ha);
if (!ka)
throw new jc(V.ENTITYAUTH_FACTORY_NOT_FOUND, ha);
return ka.getCryptoContext(na, da);
}
function Z(na, da, ha, ka, wa) {
Ma(wa, function() {
da.verify(ha, ka, {
result: function(Qa) {
Ma(wa, function() {
if (!Qa)
throw new tb(V.MESSAGE_VERIFICATION_FAILED);
da.decrypt(ha, {
result: function(La) {
Ma(wa, function() {
return Wb(La, Kb);
});
},
error: function(La) {
wa.error(La);
}
});
});
},
error: function(Qa) {
wa.error(Qa);
}
});
});
}
function ea(na, da, ha) {
Ma(ha, function() {
if (da)
re(na, da, ha);
else
return null;
});
}
function aa(na, da, ha, ka) {
Ma(ka, function() {
if (da)
nd(na, da, ha, ka);
else
return null;
});
}
function ia(na, da, ha, ka) {
Ma(ka, function() {
if (ha)
Ie(na, da, ha, ka);
else
return null;
});
}
function ua(na, da, ha, ka, wa, Qa, La) {
var Ra;
function Pa(oa, xa, Da) {
var Ha,
Aa;
if (xa >= oa.length) {
Ha = [];
for (Aa in Ra) {
Ha.push(Ra[Aa]);
}
Da.result(Ha);
} else {
Ha = oa[xa];
if ("object" !== typeof Ha)
throw new Ab(V.JSON_PARSE_ERROR, "headerdata " + Qa);
od(na, Ha, ha, ka, wa, {
result: function(Sa) {
Ma(Da, function() {
Ra[Sa.uniqueKey()] = Sa;
Pa(oa, xa + 1, Da);
});
},
error: function(Sa) {
Da.error(Sa);
}
});
}
}
Ra = {};
Ma(La, function() {
if (da) {
if (!(da instanceof Array))
throw new Ab(V.JSON_PARSE_ERROR, "headerdata " + Qa);
Pa(da, 0, La);
} else
return [];
});
}
function ra(na, da, ha, ka, wa, Qa) {
function La(Ra, oa, xa) {
Ma(xa, function() {
var Da;
Da = oa.peermastertoken;
if (Da && "object" !== typeof Da)
throw new Ab(V.JSON_PARSE_ERROR, "headerdata " + wa);
if (!Da)
return null;
Wc(Ra, Da, xa);
});
}
function Pa(Ra, oa, xa, Da) {
Ma(Da, function() {
var Ha;
Ha = oa.peeruseridtoken;
if (Ha && "object" !== typeof Ha)
throw new Ab(V.JSON_PARSE_ERROR, "headerdata " + wa);
if (!Ha)
return null;
nd(Ra, Ha, xa, Da);
});
}
Ma(Qa, function() {
if (!na.isPeerToPeer())
return {
peerMasterToken: null,
peerUserIdToken: null,
peerServiceTokens: []
};
La(na, da, {
result: function(Ra) {
Ma(Qa, function() {
var oa;
oa = ha ? ha.masterToken : Ra;
Pa(na, da, oa, {
result: function(xa) {
Ma(Qa, function() {
ua(na, da.peerservicetokens, oa, xa, ka, wa, {
result: function(Da) {
Ma(Qa, function() {
return {
peerMasterToken: Ra,
peerUserIdToken: xa,
peerServiceTokens: Da
};
});
},
error: function(Da) {
Ma(Qa, function() {
Da instanceof db && (Da.setEntity(oa), Da.setUser(xa));
throw Da;
});
}
});
});
},
error: function(xa) {
Ma(Qa, function() {
xa instanceof db && xa.setEntity(oa);
throw xa;
});
}
});
});
},
error: Qa.error
});
});
}
function la(na, da, ha, ka) {
var Qa;
function wa(La, Pa) {
Ma(ka, function() {
if (Pa >= La.length)
return Qa;
qe(na, La[Pa], {
result: function(Ra) {
Ma(ka, function() {
Qa.push(Ra);
wa(La, Pa + 1);
});
},
error: function(Ra) {
ka.error(Ra);
}
});
});
}
Qa = [];
Ma(ka, function() {
var La;
La = da.keyrequestdata;
if (!La)
return Qa;
if (!(La instanceof Array))
throw new Ab(V.JSON_PARSE_ERROR, "headerdata " + ha);
wa(La, 0);
});
}
pa = Ge = zb.Class.create({
init: function(na, da, ha, ka, wa, Qa, La, Pa, Ra) {
Object.defineProperties(this, {
messageId: {
value: na,
writable: !1,
configurable: !1
},
nonReplayableId: {
value: da,
writable: !1,
configurable: !1
},
renewable: {
value: ha,
writable: !1,
configurable: !1
},
capabilities: {
value: ka,
writable: !1,
configurable: !1
},
keyRequestData: {
value: wa,
writable: !1,
configurable: !1
},
keyResponseData: {
value: Qa,
writable: !1,
configurable: !1
},
userAuthData: {
value: La,
writable: !1,
configurable: !1
},
userIdToken: {
value: Pa,
writable: !1,
configurable: !1
},
serviceTokens: {
value: Ra,
writable: !1,
configurable: !1
}
});
}
});
ya = He = zb.Class.create({
init: function(na, da, ha) {
Object.defineProperties(this, {
peerMasterToken: {
value: na,
writable: !1,
configurable: !1
},
peerUserIdToken: {
value: da,
writable: !1,
configurable: !1
},
peerServiceTokens: {
value: ha,
writable: !1,
configurable: !1
}
});
}
});
Yc = zb.Class.create({
init: function(na, da, ha, ka, wa, Qa, La) {
var Ra;
function Pa(oa) {
Ma(La, function() {
var xa,
Da,
Ha,
Aa,
Sa,
Ga,
Wa,
$a,
Va,
hb,
kb,
nb,
pb,
qb,
xb,
wb,
r;
da = ha ? null : da;
xa = ka.nonReplayableId;
Da = ka.renewable;
Ha = ka.capabilities;
Aa = ka.messageId;
Sa = ka.keyRequestData ? ka.keyRequestData : [];
Ga = ka.keyResponseData;
Wa = ka.userAuthData;
$a = ka.userIdToken;
Va = ka.serviceTokens ? ka.serviceTokens : [];
if (na.isPeerToPeer()) {
hb = wa.peerMasterToken;
kb = wa.peerUserIdToken;
nb = wa.peerServiceTokens ? wa.peerServiceTokens : [];
} else
(kb = hb = null,
nb = []);
if (0 > Aa || Aa > Jb)
throw new ub("Message ID " + Aa + " is out of range.");
if (!da && !ha)
throw new ub("Message entity authentication data or master token must be provided.");
if (Ga) {
if (na.isPeerToPeer()) {
pb = ha;
qb = Ga.masterToken;
} else
(pb = Ga.masterToken,
qb = hb);
} else
(pb = ha,
qb = hb);
if ($a && (!pb || !$a.isBoundTo(pb)))
throw new ub("User ID token must be bound to a master token.");
if (kb && (!qb || !kb.isBoundTo(qb)))
throw new ub("Peer user ID token must be bound to a peer master token.");
Va.forEach(function(b) {
if (b.isMasterTokenBound() && (!pb || !b.isBoundTo(pb)))
throw new ub("Master token bound service tokens must be bound to the provided master token.");
if (b.isUserIdTokenBound() && (!$a || !b.isBoundTo($a)))
throw new ub("User ID token bound service tokens must be bound to the provided user ID token.");
}, this);
nb.forEach(function(b) {
if (b.isMasterTokenBound() && (!qb || !b.isBoundTo(qb)))
throw new ub("Master token bound peer service tokens must be bound to the provided peer master token.");
if (b.isUserIdTokenBound() && (!kb || !b.isBoundTo(kb)))
throw new ub("User ID token bound peer service tokens must be bound to the provided peer user ID token.");
}, this);
if (Qa) {
r = Qa.customer;
xb = Qa.messageCryptoContext;
wb = ba(na, xb, r, da, ha, oa, Aa, Sa, Ga, Wa, $a, Va, hb, kb, nb, xa, Da, Ha, Qa.headerdata, Qa.signature);
Object.defineProperties(this, wb);
return this;
}
r = $a ? $a.customer : null;
wb = {};
oa && (wb.sender = oa);
wb.messageid = Aa;
"number" === typeof xa && (wb.nonreplayableid = xa);
wb.renewable = Da;
Ha && (wb.capabilities = Ha);
0 < Sa.length && (wb.keyrequestdata = Sa);
Ga && (wb.keyresponsedata = Ga);
Wa && (wb.userauthdata = Wa);
$a && (wb.useridtoken = $a);
0 < Va.length && (wb.servicetokens = Va);
hb && (wb.peermastertoken = hb);
kb && (wb.peeruseridtoken = kb);
0 < nb.length && (wb.peerservicetokens = nb);
try {
xb = W(na, da, ha);
} catch (b) {
throw (b instanceof db && (b.setEntity(ha), b.setEntity(da), b.setUser($a), b.setUser(Wa), b.setMessageId(Aa)), b);
}
wb = Xb(JSON.stringify(wb), Kb);
xb.encrypt(wb, {
result: function(b) {
Ma(La, function() {
xb.sign(b, {
result: function(a) {
Ma(La, function() {
var c;
c = ba(na, xb, r, da, ha, oa, Aa, Sa, Ga, Wa, $a, Va, hb, kb, nb, xa, Da, Ha, b, a);
Object.defineProperties(this, c);
return this;
}, Ra);
},
error: function(a) {
Ma(La, function() {
a instanceof db && (a.setEntity(ha), a.setEntity(da), a.setUser($a), a.setUser(Wa), a.setMessageId(Aa));
throw a;
}, Ra);
}
});
}, Ra);
},
error: function(b) {
Ma(La, function() {
b instanceof db && (b.setEntity(ha), b.setEntity(da), b.setUser($a), b.setUser(Wa), b.setMessageId(Aa));
throw b;
}, Ra);
}
});
}, Ra);
}
Ra = this;
Ma(La, function() {
Qa ? Pa(Qa.sender) : ha ? na.getEntityAuthenticationData(null, {
result: function(oa) {
oa = oa.getIdentity();
Pa(oa);
},
error: La.error
}) : Pa(null);
}, Ra);
},
isEncrypting: function() {
return this.masterToken || ud(this.entityAuthenticationData.scheme);
},
isRenewable: function() {
return this.renewable;
},
toJSON: function() {
var na;
na = {};
this.masterToken ? na[ze] = this.masterToken : na[Jd] = this.entityAuthenticationData;
na[Ae] = Bb(this.headerdata);
na[Kd] = Bb(this.signature);
return na;
}
});
Fe = function(na, da, ha, ka, wa, Qa) {
new Yc(na, da, ha, ka, wa, null, Qa);
};
Ld = function(na, da, ha, ka, wa, Qa, La) {
Ma(La, function() {
var Pa,
Ra;
ha = ka ? null : ha;
if (!ha && !ka)
throw new Gb(V.MESSAGE_ENTITY_NOT_FOUND);
Pa = da;
try {
da = Fb(Pa);
} catch (oa) {
throw new Gb(V.HEADER_DATA_INVALID, Pa, oa);
}
if (!da || 0 == da.length)
throw new Gb(V.HEADER_DATA_MISSING, Pa);
try {
Ra = W(na, ha, ka);
} catch (oa) {
throw (oa instanceof db && (oa.setEntity(ka), oa.setEntity(ha)), oa);
}
Z(na, Ra, da, wa, {
result: function(oa) {
Ma(La, function() {
var xa,
Da,
Ha,
Aa,
Sa;
try {
xa = JSON.parse(oa);
} catch (Ga) {
if (Ga instanceof SyntaxError)
throw new Ab(V.JSON_PARSE_ERROR, "headerdata " + oa, Ga).setEntity(ka).setEntity(ha);
throw Ga;
}
Da = parseInt(xa.messageid);
if (!Da || Da != Da)
throw new Ab(V.JSON_PARSE_ERROR, "headerdata " + oa).setEntity(ka).setEntity(ha);
if (0 > Da || Da > Jb)
throw new Gb(V.MESSAGE_ID_OUT_OF_RANGE, "headerdata " + oa).setEntity(ka).setEntity(ha);
Ha = ka ? xa.sender : null;
if (ka && (!Ha || "string" !== typeof Ha))
throw new Ab(V.JSON_PARSE_ERROR, "headerdata " + oa).setEntity(ka).setEntity(ha).setMessageId(Da);
Aa = xa.keyresponsedata;
if (Aa && "object" !== typeof Aa)
throw new Ab(V.JSON_PARSE_ERROR, "headerdata " + oa).setEntity(ka).setEntity(ha).setMessageId(Da);
Sa = La;
La = {
result: function(Ga) {
Sa.result(Ga);
},
error: function(Ga) {
Ga instanceof db && (Ga.setEntity(ka), Ga.setEntity(ha), Ga.setMessageId(Da));
Sa.error(Ga);
}
};
ea(na, Aa, {
result: function(Ga) {
Ma(La, function() {
var Wa,
$a;
Wa = !na.isPeerToPeer() && Ga ? Ga.masterToken : ka;
$a = xa.useridtoken;
if ($a && "object" !== typeof $a)
throw new Ab(V.JSON_PARSE_ERROR, "headerdata " + oa);
aa(na, $a, Wa, {
result: function(Va) {
Ma(La, function() {
var hb;
hb = xa.userauthdata;
if (hb && "object" !== typeof hb)
throw new Ab(V.JSON_PARSE_ERROR, "headerdata " + oa);
ia(na, Wa, hb, {
result: function(kb) {
Ma(La, function() {
var nb,
pb,
qb;
if (kb) {
nb = kb.scheme;
pb = na.getUserAuthenticationFactory(nb);
if (!pb)
throw new tc(V.USERAUTH_FACTORY_NOT_FOUND, nb).setUser(Va).setUser(kb);
nb = ka ? ka.identity : ha.getIdentity();
qb = pb.authenticate(na, nb, kb, Va);
} else
qb = Va ? Va.customer : null;
ua(na, xa.servicetokens, Wa, Va, Qa, oa, {
result: function(xb) {
Ma(La, function() {
var wb,
r,
b,
a;
wb = xa.nonreplayableid !== yb ? parseInt(xa.nonreplayableid) : null;
r = xa.renewable;
if (wb != wb || "boolean" !== typeof r)
throw new Ab(V.JSON_PARSE_ERROR, "headerdata " + oa);
if (0 > wb || wb > Jb)
throw new Gb(V.NONREPLAYABLE_ID_OUT_OF_RANGE, "headerdata " + oa);
b = null;
a = xa.capabilities;
if (a) {
if ("object" !== typeof a)
throw new Ab(V.JSON_PARSE_ERROR, "headerdata " + oa);
b = Ee(a);
}
la(na, xa, oa, {
result: function(c) {
ra(na, xa, Ga, Qa, oa, {
result: function(m) {
Ma(La, function() {
var h,
k,
d,
f;
h = m.peerMasterToken;
k = m.peerUserIdToken;
d = m.peerServiceTokens;
f = new pa(Da, wb, r, b, c, Ga, kb, Va, xb);
h = new ya(h, k, d);
k = new fa(qb, Ha, Ra, da, wa);
new Yc(na, ha, ka, f, h, k, La);
});
},
error: La.error
});
},
error: function(c) {
Ma(La, function() {
c instanceof db && (c.setUser(Va), c.setUser(kb));
throw c;
});
}
});
});
},
error: function(xb) {
Ma(La, function() {
xb instanceof db && (xb.setEntity(Wa), xb.setUser(Va), xb.setUser(kb));
throw xb;
});
}
});
});
},
error: La.error
});
});
},
error: La.error
});
});
},
error: La.error
});
});
},
error: La.error
});
});
};
})();
(function() {
function fa(ba, W) {
this.payload = ba;
this.signature = W;
}
Nd = zb.Class.create({
init: function(ba, W, Z, ea, aa, ia, ua, ra) {
var la;
la = this;
Ma(ra, function() {
var pa,
ya;
if (0 > ba || ba > Jb)
throw new ub("Sequence number " + ba + " is outside the valid range.");
if (0 > W || W > Jb)
throw new ub("Message ID " + W + " is outside the valid range.");
if (ua)
return ( Object.defineProperties(this, {
sequenceNumber: {
value: ba,
writable: !1,
configurable: !1
},
messageId: {
value: W,
writable: !1,
configurable: !1
},
compressionAlgo: {
value: ea,
writable: !1,
configurable: !1
},
data: {
value: aa,
writable: !1,
configurable: !1
},
endofmsg: {
value: Z,
writable: !1,
enumerable: !1,
configurable: !1
},
payload: {
value: ua.payload,
writable: !1,
enumerable: !1,
configurable: !1
},
signature: {
value: ua.signature,
writable: !1,
enumerable: !1,
configurable: !1
}
}), this) ;
if (ea) {
pa = Od(ea, aa);
pa || (ea = null, pa = aa);
} else
(ea = null,
pa = aa);
ya = {};
ya.sequencenumber = ba;
ya.messageid = W;
Z && (ya.endofmsg = Z);
ea && (ya.compressionalgo = ea);
ya.data = Bb(pa);
pa = Xb(JSON.stringify(ya), Kb);
ia.encrypt(pa, {
result: function(na) {
Ma(ra, function() {
ia.sign(na, {
result: function(da) {
Ma(ra, function() {
Object.defineProperties(this, {
sequenceNumber: {
value: ba,
writable: !1,
configurable: !1
},
messageId: {
value: W,
writable: !1,
configurable: !1
},
compressionAlgo: {
value: ea,
writable: !1,
configurable: !1
},
data: {
value: aa,
writable: !1,
configurable: !1
},
endofmsg: {
value: Z,
writable: !1,
enumerable: !1,
configurable: !1
},
payload: {
value: na,
writable: !1,
enumerable: !1,
configurable: !1
},
signature: {
value: da,
writable: !1,
enumerable: !1,
configurable: !1
}
});
return this;
}, la);
},
error: function(da) {
ra.error(da);
}
});
}, la);
},
error: function(na) {
ra.error(na);
}
});
}, la);
},
isEndOfMessage: function() {
return this.endofmsg;
},
toJSON: function() {
var ba;
ba = {};
ba.payload = Bb(this.payload);
ba.signature = Bb(this.signature);
return ba;
}
});
Je = function(ba, W, Z, ea, aa, ia, ua) {
new Nd(ba, W, Z, ea, aa, ia, null, ua);
};
Ke = function(ba, W, Z) {
Ma(Z, function() {
var ea,
aa,
ia,
ua;
ea = ba.payload;
aa = ba.signature;
if (!ea || "string" !== typeof ea || "string" !== typeof aa)
throw new Ab(V.JSON_PARSE_ERROR, "payload chunk " + JSON.stringify(ba));
try {
ia = Fb(ea);
} catch (ra) {
throw new Gb(V.PAYLOAD_INVALID, "payload chunk " + JSON.stringify(ba), ra);
}
try {
ua = Fb(aa);
} catch (ra) {
throw new Gb(V.PAYLOAD_SIGNATURE_INVALID, "payload chunk " + JSON.stringify(ba), ra);
}
W.verify(ia, ua, {
result: function(ra) {
Ma(Z, function() {
if (!ra)
throw new tb(V.PAYLOAD_VERIFICATION_FAILED);
W.decrypt(ia, {
result: function(la) {
Ma(Z, function() {
var pa,
ya,
na,
da,
ha,
ka,
wa;
pa = Wb(la, Kb);
try {
ya = JSON.parse(pa);
} catch (Qa) {
if (Qa instanceof SyntaxError)
throw new Ab(V.JSON_PARSE_ERROR, "payload chunk payload " + pa, Qa);
throw Qa;
}
na = parseInt(ya.sequencenumber);
da = parseInt(ya.messageid);
ha = ya.endofmsg;
ka = ya.compressionalgo;
ya = ya.data;
if (!na || na != na || !da || da != da || ha && "boolean" !== typeof ha || ka && "string" !== typeof ka || "string" !== typeof ya)
throw new Ab(V.JSON_PARSE_ERROR, "payload chunk payload " + pa);
if (0 > na || na > Jb)
throw new db(V.PAYLOAD_SEQUENCE_NUMBER_OUT_OF_RANGE, "payload chunk payload " + pa);
if (0 > da || da > Jb)
throw new db(V.PAYLOAD_MESSAGE_ID_OUT_OF_RANGE, "payload chunk payload " + pa);
ha || (ha = !1);
if (ka && !Bc[ka])
throw new Gb(V.UNIDENTIFIED_COMPRESSION, ka);
try {
wa = Fb(ya);
} catch (Qa) {
throw new Gb(V.PAYLOAD_DATA_CORRUPT, ya, Qa);
}
if (wa && 0 != wa.length)
pa = ka ? pd(ka, wa) : wa;
else {
if (0 < ya.length)
throw new Gb(V.PAYLOAD_DATA_CORRUPT, ya);
if (ha)
pa = new Uint8Array(0);
else
throw new Gb(V.PAYLOAD_DATA_MISSING, ya);
}
wa = new fa(ia, ua);
new Nd(na, da, ha, ka, pa, W, wa, Z);
});
},
error: function(la) {
Z.error(la);
}
});
});
},
error: function(ra) {
Z.error(ra);
}
});
});
};
})();
(function() {
var Z,
ea;
function fa(aa, ia, ua, ra, la) {
var ya,
na,
da,
ha,
ka;
function pa() {
Ma(la, function() {
var wa,
Qa;
na >= ia.length && (na = 0, ++ya);
if (ya >= da.length) {
if (ha)
throw ha;
throw new Lb(V.KEYX_FACTORY_NOT_FOUND, JSON.stringify(ia));
}
wa = da[ya];
Qa = ia[na];
wa.scheme != Qa.keyExchangeScheme ? (++na, pa()) : wa.generateResponse(aa, Qa, ka, {
result: function(La) {
la.result(La);
},
error: function(La) {
Ma(la, function() {
if (!(La instanceof db))
throw La;
ha = La;
++na;
pa();
});
}
});
});
}
ya = 0;
na = 0;
da = aa.getKeyExchangeFactories();
ka = ua ? ua : ra;
pa();
}
function ba(aa, ia, ua, ra, la) {
Ma(la, function() {
var pa;
pa = ia.keyRequestData;
if (ia.isRenewable() && 0 < pa.length)
ra ? ra.isRenewable() || ra.isExpired() ? fa(aa, pa, ra, null, la) : aa.getTokenFactory().isNewestMasterToken(aa, ra, {
result: function(ya) {
Ma(la, function() {
if (ya)
return null;
fa(aa, pa, ra, null, la);
});
},
error: la.error
}) : fa(aa, pa, null, ua.getIdentity(), la);
else
return null;
});
}
function W(aa, ia, ua, ra) {
Ma(ra, function() {
var la,
pa,
ya,
na;
la = ia.userIdToken;
pa = ia.userAuthenticationData;
ya = ia.messageId;
if (la && la.isVerified()) {
if (la.isRenewable() && ia.isRenewable() || la.isExpired() || !la.isBoundTo(ua)) {
pa = aa.getTokenFactory();
pa.renewUserIdToken(aa, la, ua, ra);
return;
}
} else if (ia.isRenewable() && ua && pa) {
la = ia.customer;
if (!la) {
la = pa.scheme;
na = aa.getUserAuthenticationFactory(la);
if (!na)
throw new tc(V.USERAUTH_FACTORY_NOT_FOUND, la).setEntity(ua).setUser(pa).setMessageId(ya);
la = na.authenticate(aa, ua.identity, pa, null);
}
pa = aa.getTokenFactory();
pa.createUserIdToken(aa, la, ua, ra);
return;
}
return la;
});
}
Z = new Uint8Array(0);
ea = Ec = function(aa) {
if (0 > aa || aa > Jb)
throw new ub("Message ID " + aa + " is outside the valid range.");
return aa == Jb ? 0 : aa + 1;
};
Nc = function(aa) {
if (0 > aa || aa > Jb)
throw new ub("Message ID " + aa + " is outside the valid range.");
return 0 == aa ? Jb : aa - 1;
};
Fc = function(aa, ia, ua, ra, la) {
Ma(la, function() {
var pa;
if (ra == yb || null == ra) {
pa = aa.getRandom();
do {
ra = pa.nextLong();
} while (0 > ra || ra > Jb);
} else if (0 > ra || ra > Jb)
throw new ub("Message ID " + ra + " is outside the valid range.");
aa.getEntityAuthenticationData(null, {
result: function(ya) {
Ma(la, function() {
var na;
na = aa.getMessageCapabilities();
return new qd(aa, ra, na, ya, ia, ua, null, null, null, null, null);
});
},
error: function(ya) {
la.error(ya);
}
});
});
};
Le = function(aa, ia, ua) {
Ma(ua, function() {
var la,
pa,
ya,
na,
da,
ha;
function ra(ka) {
Ma(ua, function() {
ka instanceof db && (ka.setEntity(la), ka.setEntity(pa), ka.setUser(ya), ka.setUser(na), ka.setMessageId(da));
throw ka;
});
}
la = ia.masterToken;
pa = ia.entityAuthenticationData;
ya = ia.userIdToken;
na = ia.userAuthenticationData;
da = ia.messageId;
ha = ea(da);
ba(aa, ia, pa, la, {
result: function(ka) {
Ma(ua, function() {
var wa;
wa = ka ? ka.keyResponseData.masterToken : wa = la;
aa.getEntityAuthenticationData(null, {
result: function(Qa) {
Ma(ua, function() {
W(aa, ia, wa, {
result: function(La) {
Ma(ua, function() {
var Pa,
Ra,
oa;
ya = La;
Pa = Md(ia.messageCapabilities, aa.getMessageCapabilities());
Ra = ia.keyResponseData;
oa = ia.serviceTokens;
return aa.isPeerToPeer() ? new qd(aa, ha, Pa, Qa, Ra ? Ra.masterToken : ia.peerMasterToken, ia.peerUserIdToken, ia.peerServiceTokens, la, ya, oa, ka) : new qd(aa, ha, Pa, Qa, Ra ? Ra.masterToken : la, ya, oa, null, null, null, ka);
});
},
error: ra
});
});
},
error: ra
});
});
},
error: ra
});
});
};
Me = function(aa, ia, ua, ra, la) {
Ma(la, function() {
aa.getEntityAuthenticationData(null, {
result: function(pa) {
Ma(la, function() {
var ya,
na;
if (ia != yb && null != ia)
ya = ea(ia);
else {
na = aa.getRandom();
do {
ya = na.nextInt();
} while (0 > ya || ya > Jb);
}
De(aa, pa, ya, ua.responseCode, ua.internalCode, ua.message, ra, la);
});
},
error: function(pa) {
la.error(pa);
}
});
});
};
qd = zb.Class.create({
init: function(aa, ia, ua, ra, la, pa, ya, na, da, ha, ka) {
var wa,
Qa,
La,
Pa,
Ra;
if (!aa.isPeerToPeer() && (na || da))
throw new ub("Cannot set peer master token or peer user ID token when not in peer-to-peer mode.");
wa = ka && !aa.isPeerToPeer() ? ka.keyResponseData.masterToken : la;
Qa = [];
wa = aa.getMslStore().getServiceTokens(wa, pa);
Qa.push.apply(Qa, wa);
ya && ya.forEach(function(oa) {
Qa.push(oa);
}, this);
La = [];
if (aa.isPeerToPeer()) {
Pa = na;
Ra = da;
ya = ka ? ka.keyResponseData.masterToken : na;
da = aa.getMslStore().getServiceTokens(ya, da);
La.push.apply(La, da);
ha && ha.forEach(function(oa) {
La.push(oa);
}, this);
}
Object.defineProperties(this, {
_ctx: {
value: aa,
writable: !1,
enumerable: !1,
configurable: !1
},
_entityAuthData: {
value: ra,
writable: !1,
enumerable: !1,
configurable: !1
},
_masterToken: {
value: la,
writable: !0,
enumerable: !1,
configurable: !1
},
_messageId: {
value: ia,
writable: !1,
enumerable: !1,
configurable: !1
},
_capabilities: {
value: ua,
writable: !1,
enumerable: !1,
configurable: !1
},
_keyExchangeData: {
value: ka,
writable: !1,
enumerable: !1,
configurable: !1
},
_nonReplayable: {
value: !1,
writable: !0,
enumerable: !1,
configurable: !1
},
_renewable: {
value: !1,
writable: !0,
enumerable: !1,
configurable: !1
},
_keyRequestData: {
value: {},
writable: !1,
enumerable: !1,
configurable: !1
},
_userAuthData: {
value: null,
writable: !0,
enumerable: !1,
configurable: !1
},
_userIdToken: {
value: pa,
writable: !0,
enumerable: !1,
configurable: !1
},
_serviceTokens: {
value: Qa,
writable: !1,
enumerable: !1,
configurable: !1
},
_peerMasterToken: {
value: Pa,
writable: !0,
enumerable: !1,
configurable: !1
},
_peerUserIdToken: {
value: Ra,
writable: !0,
enumerable: !1,
configurable: !1
},
_peerServiceTokens: {
value: La,
writable: !1,
enumerable: !1,
configurable: !1
}
});
},
getMessageId: function() {
return this._messageId;
},
getMasterToken: function() {
return this._masterToken;
},
getUserIdToken: function() {
return this._userIdToken;
},
getKeyExchangeData: function() {
return this._keyExchangeData;
},
willEncryptHeader: function() {
return this._masterToken || ud(this._entityAuthData.scheme);
},
willEncryptPayloads: function() {
return this._masterToken || !this._ctx.isPeerToPeer() && this._keyExchangeData || ud(this._entityAuthData.scheme);
},
willIntegrityProtectHeader: function() {
return this._masterToken || Wd(this._entityAuthData.scheme);
},
willIntegrityProtectPayloads: function() {
return this._masterToken || !this._ctx.isPeerToPeer() && this._keyExchangeData || Wd(this._entityAuthData.scheme);
},
getHeader: function(aa) {
Ma(aa, function() {
var ia,
ua,
ra;
ia = this._keyExchangeData ? this._keyExchangeData.keyResponseData : null;
ua = [];
for (ra in this._keyRequestData) {
ua.push(this._keyRequestData[ra]);
}
if (this._nonReplayable) {
if (!this._masterToken)
throw new Gb(V.NONREPLAYABLE_MESSAGE_REQUIRES_MASTERTOKEN);
ra = this._ctx.getMslStore().getNonReplayableId(this._masterToken);
} else
ra = null;
ia = new Ge(this._messageId, ra, this._renewable, this._capabilities, ua, ia, this._userAuthData, this._userIdToken, this._serviceTokens);
ua = new He(this._peerMasterToken, this._peerUserIdToken, this._peerServiceTokens);
Fe(this._ctx, this._entityAuthData, this._masterToken, ia, ua, aa);
}, this);
},
isNonReplayable: function() {
return this._nonReplayable;
},
setNonReplayable: function(aa) {
this._nonReplayable = aa;
return this;
},
isRenewable: function() {
return this._renewable;
},
setRenewable: function(aa) {
this._renewable = aa;
return this;
},
setAuthTokens: function(aa, ia) {
var ua,
la;
if (ia && !ia.isBoundTo(aa))
throw new ub("User ID token must be bound to master token.");
if (this._keyExchangeData && !this._ctx.isPeerToPeer())
throw new ub("Attempt to set message builder master token when key exchange data exists as a trusted network server.");
try {
ua = this._ctx.getMslStore().getServiceTokens(aa, ia);
} catch (pa) {
if (pa instanceof db)
throw new ub("Invalid master token and user ID token combination despite checking above.", pa);
throw pa;
}
for (var ra = this._serviceTokens.length - 1; 0 <= ra; --ra) {
la = this._serviceTokens[ra];
(la.isUserIdTokenBound() && !la.isBoundTo(ia) || la.isMasterTokenBound() && !la.isBoundTo(aa)) && this._serviceTokens.splice(ra, 1);
}
ua.forEach(function(pa) {
this.excludeServiceToken(pa.name, pa.isMasterTokenBound(), pa.isUserIdTokenBound());
this._serviceTokens.push(pa);
}, this);
this._masterToken = aa;
this._userIdToken = ia;
},
setUserAuthenticationData: function(aa) {
this._userAuthData = aa;
return this;
},
setCustomer: function(aa, ia) {
var ua;
ua = this;
Ma(ia, function() {
var ra;
if (!this._ctx.isPeerToPeer() && null != this._userIdToken || this._ctx.isPeerToPeer() && null != this._peerUserIdToken)
throw new ub("User ID token or peer user ID token already exists for the remote user.");
ra = this._keyExchangeData ? this._keyExchangeData.keyResponseData.masterToken : this._ctx.isPeerToPeer() ? this._peerMasterToken : this._masterToken;
if (!ra)
throw new ub("User ID token or peer user ID token cannot be created because no corresponding master token exists.");
this._ctx.getTokenFactory().createUserIdToken(this._ctx, aa, ra, {
result: function(la) {
Ma(ia, function() {
this._ctx.isPeerToPeer() ? this._peerUserIdToken = la : (this._userIdToken = la, this._userAuthData = null);
return !0;
}, ua);
},
error: function(la) {
ia.error(la);
}
});
}, ua);
},
addKeyRequestData: function(aa) {
this._keyRequestData[aa.uniqueKey()] = aa;
return this;
},
removeKeyRequestData: function(aa) {
delete this._keyRequestData[aa.uniqueKey()];
return this;
},
addServiceToken: function(aa) {
var ia;
ia = this._keyExchangeData && !this._ctx.isPeerToPeer() ? this._keyExchangeData.keyResponseData.masterToken : this._masterToken;
if (aa.isMasterTokenBound() && !aa.isBoundTo(ia))
throw new Gb(V.SERVICETOKEN_MASTERTOKEN_MISMATCH, "st " + JSON.stringify(aa) + "; mt " + JSON.stringify(ia)).setEntity(ia);
if (aa.isUserIdTokenBound() && !aa.isBoundTo(this._userIdToken))
throw new Gb(V.SERVICETOKEN_USERIDTOKEN_MISMATCH, "st " + JSON.stringify(aa) + "; uit " + JSON.stringify(this._userIdToken)).setEntity(ia).setUser(this._userIdToken);
this.excludeServiceToken(aa.name, aa.isMasterTokenBound(), aa.isUserIdTokenBound());
this._serviceTokens.push(aa);
return this;
},
addServiceTokenIfAbsent: function(aa) {
var ua;
for (var ia = this._serviceTokens.length - 1; 0 <= ia; --ia) {
ua = this._serviceTokens[ia];
if (ua.name == aa.name && ua.isMasterTokenBound() == aa.isMasterTokenBound() && ua.isUserIdTokenBound() == aa.isUserIdTokenBound())
return this;
}
this.addServiceToken(aa);
return this;
},
excludeServiceToken: function() {
var aa,
ia,
ua,
la;
if (1 == arguments.length) {
aa = arguments[0];
ia = aa.name;
ua = aa.isMasterTokenBound();
aa = aa.isUserIdTokenBound();
} else
(arguments.length = 3,
ia = arguments[0],
ua = arguments[1],
aa = arguments[2]);
for (var ra = this._serviceTokens.length - 1; 0 <= ra; --ra) {
la = this._serviceTokens[ra];
la.name == ia && la.isMasterTokenBound() == ua && la.isUserIdTokenBound() == aa && this._serviceTokens.splice(ra, 1);
}
return this;
},
deleteServiceToken: function() {
var aa,
ia,
ua,
ra;
if (2 == arguments.length) {
aa = arguments[0];
ia = aa.name;
aa.isMasterTokenBound();
aa.isUserIdTokenBound();
ua = arguments[1];
} else
(arguments.length = 4,
ia = arguments[0],
ua = arguments[3]);
ra = this;
Ma(ua, function() {
var la,
pa;
la = originalToken.isMasterTokenBound() ? this._masterToken : null;
pa = originalToken.isUserIdTokenBound() ? this._userIdToken : null;
rc(this._ctx, ia, Z, la, pa, !1, null, new Mc(), {
result: function(ya) {
Ma(ua, function() {
return this.addServiceToken(ya);
}, ra);
},
error: function(ya) {
ya instanceof db && (ya = new ub("Failed to create and add empty service token to message.", ya));
ua.error(ya);
}
});
}, ra);
},
getServiceTokens: function() {
var aa;
aa = [];
aa.push.apply(aa, this._serviceTokens);
return aa;
},
getPeerMasterToken: function() {
return this._peerMasterToken;
},
getPeerUserIdToken: function() {
return this._peerUserIdToken;
},
setPeerAuthTokens: function(aa, ia) {
var ua,
la;
if (!this._ctx.isPeerToPeer())
throw new ub("Cannot set peer master token or peer user ID token when not in peer-to-peer mode.");
if (ia && !aa)
throw new ub("Peer master token cannot be null when setting peer user ID token.");
if (ia && !ia.isBoundTo(aa))
throw new Gb(V.USERIDTOKEN_MASTERTOKEN_MISMATCH, "uit " + ia + "; mt " + aa).setEntity(aa).setUser(ia);
try {
ua = this._ctx.getMslStore().getServiceTokens(aa, ia);
} catch (pa) {
if (pa instanceof db)
throw new ub("Invalid peer master token and user ID token combination despite proper check.", pa);
throw pa;
}
for (var ra = this._peerServiceTokens.length - 1; 0 <= ra; --ra) {
la = this._peerServiceTokens[ra];
(la.isUserIdTokenBound() && !la.isBoundTo(ia) || la.isMasterTokenBound() && !la.isBoundTo(aa)) && this._peerServiceTokens.slice(ra, 1);
}
ua.forEach(function(pa) {
this.excludePeerServiceToken(pa.name, pa.isMasterTokenBound(), pa.isUserIdTokenBound());
this._peerServiceTokens.push(pa);
}, this);
this._peerUserIdToken = ia;
this._peerMasterToken = aa;
return this;
},
addPeerServiceToken: function(aa) {
if (!this._ctx.isPeerToPeer())
throw new ub("Cannot set peer service tokens when not in peer-to-peer mode.");
if (aa.isMasterTokenBound() && !aa.isBoundTo(this._peerMasterToken))
throw new Gb(V.SERVICETOKEN_MASTERTOKEN_MISMATCH, "st " + JSON.stringify(aa) + "; mt " + JSON.stringify(this._peerMasterToken)).setEntity(this._peerMasterToken);
if (aa.isUserIdTokenBound() && !aa.isBoundTo(this._peerUserIdToken))
throw new Gb(V.SERVICETOKEN_USERIDTOKEN_MISMATCH, "st " + JSON.stringify(aa) + "; uit " + JSON.stringify(this._peerUserIdToken)).setEntity(this._peerMasterToken).setUser(this._peerUserIdToken);
this.excludePeerServiceToken(aa.name, aa.isMasterTokenBound(), aa.isUserIdTokenBound());
this._peerServiceTokens.push(aa);
return this;
},
addPeerServiceTokenIfAbsent: function(aa) {
var ua;
for (var ia = this._peerServiceTokens.length - 1; 0 <= ia; --ia) {
ua = this._peerServiceTokens[ia];
if (ua.name == aa.name && ua.isMasterTokenBound() == aa.isMasterTokenBound() && ua.isUserIdTokenBound() == aa.isUserIdTokenBound())
return this;
}
this.addPeerServiceToken(aa);
return this;
},
excludePeerServiceToken: function() {
var aa,
ia,
ua,
la;
if (1 == arguments.length) {
aa = arguments[0];
ia = aa.name;
ua = aa.isMasterTokenBound();
aa = aa.isUserIdTokenBound();
} else
(arguments.length = 3,
ia = arguments[0],
ua = arguments[1],
aa = arguments[2]);
for (var ra = this._peerServiceTokens.length - 1; 0 <= ra; --ra) {
la = this._peerServiceTokens[ra];
la.name == ia && la.isMasterTokenBound() == ua && la.isUserIdTokenBound() == aa && this._peerServiceTokens.splice(ra, 1);
}
return this;
},
deletePeerServiceToken: function() {
var aa,
ia,
ua,
ra,
la,
pa;
if (2 == arguments.length) {
aa = arguments[0];
ia = aa.name;
ua = aa.isMasterTokenBound();
ra = aa.isUserIdTokenBound();
la = arguments[1];
} else
(arguments.length = 4,
ia = arguments[0],
ua = arguments[1],
ra = arguments[2],
la = arguments[3]);
pa = this;
Ma(la, function() {
rc(this._ctx, ia, Z, ua ? this._peerMasterToken : null, ra ? this._peerUserIdToken : null, !1, null, new Mc(), {
result: function(ya) {
Ma(la, function() {
return this.addPeerServiceToken(ya);
}, pa);
},
error: function(ya) {
ya instanceof db && (ya = new ub("Failed to create and add empty peer service token to message.", ya));
la.error(ya);
}
});
}, pa);
},
getPeerServiceTokens: function() {
var aa;
aa = [];
aa.push.apply(aa, this._peerServiceTokens);
return aa;
}
});
})();
(function() {
function fa(W, Z) {
return Z[W] ? Z[W] : Z[""];
}
function ba(W) {
var Z;
Z = W.builder.getKeyExchangeData();
return Z && !W.ctx.isPeerToPeer() ? Z.keyResponseData.masterToken : W.builder.getMasterToken();
}
Ne = zb.Class.create({
init: function(W, Z, ea) {
W = {
ctx: {
value: W,
writable: !1,
enumerable: !1,
configurable: !1
},
cryptoContexts: {
value: Z.getCryptoContexts(),
writable: !1,
enumerable: !1,
configurable: !1
},
builder: {
value: ea,
writable: !1,
enumerable: !1,
configurable: !1
}
};
Object.defineProperties(this, W);
},
isPrimaryMasterTokenAvailable: function() {
return ba(this) ? !0 : !1;
},
isPrimaryUserIdTokenAvailable: function() {
return this.builder.getUserIdToken() ? !0 : !1;
},
isPeerMasterTokenAvailable: function() {
return this.builder.getPeerMasterToken() ? !0 : !1;
},
isPeerUserIdTokenAvailable: function() {
return this.builder.getPeerUserIdToken() ? !0 : !1;
},
getPrimaryServiceTokens: function() {
return this.builder.getServiceTokens();
},
getPeerServiceTokens: function() {
return this.builder.getPeerServiceTokens();
},
addPrimaryServiceToken: function(W) {
try {
return ( this.builder.addServiceToken(W), !0) ;
} catch (Z) {
if (Z instanceof Gb)
return !1;
throw Z;
}
},
addPeerServiceToken: function(W) {
try {
return ( this.builder.addPeerServiceToken(W), !0) ;
} catch (Z) {
if (Z instanceof Gb)
return !1;
throw Z;
}
},
addUnboundPrimaryServiceToken: function(W, Z, ea, aa, ia) {
var ua;
ua = this;
Ma(ia, function() {
var ra;
ra = fa(W, this.cryptoContexts);
if (!ra)
return !1;
rc(this.ctx, W, Z, null, null, ea, aa, ra, {
result: function(la) {
Ma(ia, function() {
try {
this.builder.addServiceToken(la);
} catch (pa) {
if (pa instanceof Gb)
throw new ub("Service token bound to incorrect authentication tokens despite being unbound.", pa);
throw pa;
}
return !0;
}, ua);
},
error: function(la) {
ia.error(la);
}
});
}, ua);
},
addUnboundPeerServiceToken: function(W, Z, ea, aa, ia) {
var ua;
ua = this;
Ma(ia, function() {
var ra;
ra = fa(W, this.cryptoContexts);
if (!ra)
return !1;
rc(this.ctx, W, Z, null, null, ea, aa, ra, {
result: function(la) {
Ma(ia, function() {
try {
this.builder.addPeerServiceToken(la);
} catch (pa) {
if (pa instanceof Gb)
throw new ub("Service token bound to incorrect authentication tokens despite being unbound.", pa);
throw pa;
}
return !0;
}, ua);
},
error: function(la) {
ia.error(la);
}
});
}, ua);
},
addMasterBoundPrimaryServiceToken: function(W, Z, ea, aa, ia) {
var ua;
ua = this;
Ma(ia, function() {
var ra,
la;
ra = ba(this);
if (!ra)
return !1;
la = fa(W, this.cryptoContexts);
if (!la)
return !1;
rc(this.ctx, W, Z, ra, null, ea, aa, la, {
result: function(pa) {
Ma(ia, function() {
try {
this.builder.addServiceToken(pa);
} catch (ya) {
if (ya instanceof Gb)
throw new ub("Service token bound to incorrect authentication tokens despite setting correct master token.", ya);
throw ya;
}
return !0;
}, ua);
},
error: function(pa) {
ia.error(pa);
}
});
}, ua);
},
addMasterBoundPeerServiceToken: function(W, Z, ea, aa, ia) {
var ua;
ua = this;
Ma(ia, function() {
var ra,
la;
ra = this.builder.getPeerMasterToken();
if (!ra)
return !1;
la = fa(W, this.cryptoContexts);
if (!la)
return !1;
rc(this.ctx, W, Z, ra, null, ea, aa, la, {
result: function(pa) {
Ma(ia, function() {
try {
this.builder.addPeerServiceToken(pa);
} catch (ya) {
if (ya instanceof Gb)
throw new ub("Service token bound to incorrect authentication tokens despite setting correct master token.", ya);
throw ya;
}
return !0;
}, ua);
},
error: function(pa) {
ia.error(pa);
}
});
}, ua);
},
addUserBoundPrimaryServiceToken: function(W, Z, ea, aa, ia) {
var ua;
ua = this;
Ma(ia, function() {
var ra,
la,
pa;
ra = ba(this);
if (!ra)
return !1;
la = this.builder.getUserIdToken();
if (!la)
return !1;
pa = fa(W, this.cryptoContexts);
if (!pa)
return !1;
rc(this.ctx, W, Z, ra, la, ea, aa, pa, {
result: function(ya) {
Ma(ia, function() {
try {
this.builder.addServiceToken(ya);
} catch (na) {
if (na instanceof Gb)
throw new ub("Service token bound to incorrect authentication tokens despite setting correct master token and user ID token.", na);
throw na;
}
return !0;
}, ua);
},
error: function(ya) {
ia.error(ya);
}
});
}, ua);
},
addUserBoundPeerServiceToken: function(W, Z, ea, aa, ia) {
var ua;
ua = this;
Ma(ia, function() {
var ra,
la,
pa;
ra = this.builder.getPeerMasterToken();
if (!ra)
return !1;
la = this.builder.getPeerUserIdToken();
if (!la)
return !1;
pa = fa(W, this.cryptoContexts);
if (!pa)
return !1;
rc(this.ctx, W, Z, ra, la, ea, aa, pa, {
result: function(ya) {
Ma(ia, function() {
try {
this.builder.addPeerServiceToken(ya);
} catch (na) {
if (na instanceof Gb)
throw new ub("Service token bound to incorrect authentication tokens despite setting correct master token and user ID token.", na);
throw na;
}
return !0;
}, ua);
},
error: function(ya) {
ia.error(ya);
}
});
}, ua);
},
excludePrimaryServiceToken: function() {
var W,
Z,
ea,
aa;
if (1 == arguments.length) {
W = arguments[0];
Z = W.name;
ea = W.isMasterTokenBound();
aa = W.isUserIdTokenBound();
} else
(arguments.length = 3,
Z = arguments[0],
ea = arguments[1],
aa = arguments[2]);
for (var ia = this.builder.getServiceTokens(), ua = 0; ua < ia.length; ++ua) {
if ((W = ia[ua], W.name == Z && W.isMasterTokenBound() == ea && W.isUserIdTokenBound() == aa))
return ( this.builder.excludeServiceToken(Z, ea, aa), !0) ;
}
return !1;
},
excludePeerServiceToken: function() {
var W,
Z,
ea,
aa;
if (1 == arguments.length) {
W = arguments[0];
Z = W.name;
ea = W.isMasterTokenBound();
aa = W.isUserIdTokenBound();
} else
(arguments.length = 3,
Z = arguments[0],
ea = arguments[1],
aa = arguments[2]);
for (var ia = this.builder.getPeerServiceTokens(), ua = 0; ua < ia.length; ++ua) {
if ((W = ia[ua], W.name == Z && W.isMasterTokenBound() == ea && W.isUserIdTokenBound() == aa))
return ( this.builder.excludePeerServiceToken(Z, ea, aa), !0) ;
}
return !1;
},
deletePrimaryServiceToken: function() {
var W,
Z,
ea,
aa,
ia;
if (2 == arguments.length) {
W = arguments[0];
Z = W.name;
ea = W.isMasterTokenBound();
aa = W.isUserIdTokenBound();
ia = arguments[1];
} else
4 == arguments.length && (Z = arguments[0], ea = arguments[1], aa = arguments[2], ia = arguments[3]);
Ma(ia, function() {
var la;
for (var ua = this.builder.getServiceTokens(), ra = 0; ra < ua.length; ++ra) {
la = ua[ra];
if (la.name == Z && la.isMasterTokenBound() == ea && la.isUserIdTokenBound() == aa) {
this.builder.deleteServiceToken(Z, ea, aa, {
result: function() {
ia.result(!0);
},
error: function(pa) {
ia.error(pa);
}
});
return;
}
}
return !1;
}, this);
},
deletePeerServiceToken: function() {
var W,
Z,
ea,
aa,
ia;
if (2 == arguments.length) {
W = arguments[0];
Z = W.name;
ea = W.isMasterTokenBound();
aa = W.isUserIdTokenBound();
ia = arguments[1];
} else
4 == arguments.length && (Z = arguments[0], ea = arguments[1], aa = arguments[2], ia = arguments[3]);
Ma(ia, function() {
var la;
for (var ua = this.builder.getPeerServiceTokens(), ra = 0; ra < ua.length; ++ra) {
la = ua[ra];
if (la.name == Z && la.isMasterTokenBound() == ea && la.isUserIdTokenBound() == aa) {
this.builder.deletePeerServiceToken(Z, ea, aa, {
result: function() {
ia.result(!0);
},
error: function(pa) {
ia.error(pa);
}
});
return;
}
}
return !1;
}, this);
}
});
})();
(function() {
function fa(ba, W, Z, ea) {
Ma(ea, function() {
var ia,
ua,
ra,
la,
pa,
ya;
function aa() {
Ma(ea, function() {
var na;
if (ya >= Z.length) {
if (pa)
throw pa;
throw new Lb(V.KEYX_RESPONSE_REQUEST_MISMATCH, JSON.stringify(Z));
}
na = Z[ya];
ra != na.keyExchangeScheme ? (++ya, aa()) : la.getCryptoContext(ba, na, ua, ia, {
result: ea.result,
error: function(da) {
Ma(ea, function() {
if (!(da instanceof db))
throw da;
pa = da;
++ya;
aa();
});
}
});
});
}
ia = W.masterToken;
ua = W.keyResponseData;
if (!ua)
return null;
ra = ua.keyExchangeScheme;
la = ba.getKeyExchangeFactory(ra);
if (!la)
throw new Lb(V.KEYX_FACTORY_NOT_FOUND, ra);
ya = 0;
aa();
});
}
Oe = Id.extend({
init: function(ba, W, Z, ea, aa, ia, ua) {
var ra;
ra = this;
ab(ua, function() {
var ha;
function la() {
ra._ready = !0;
ra._readyQueue.add(!0);
}
function pa(ka, wa) {
var Qa;
try {
Qa = wa.masterToken;
ka.getTokenFactory().isMasterTokenRevoked(ka, Qa, {
result: function(La) {
La ? (ra._errored = new Sc(La, Qa).setUser(wa.userIdToken).setUser(wa.userAuthenticationData).setMessageId(wa.messageId), la()) : ya(ka, wa);
},
error: function(La) {
La instanceof db && (La.setEntity(wa.masterToken), La.setUser(wa.userIdToken), La.setUser(wa.userAuthenticationData), La.setMessageId(wa.messageId));
ra._errored = La;
la();
}
});
} catch (La) {
La instanceof db && (La.setEntity(wa.masterToken), La.setUser(wa.userIdToken), La.setUser(wa.userAuthenticationData), La.setMessageId(wa.messageId));
ra._errored = La;
la();
}
}
function ya(ka, wa) {
var Qa,
La;
try {
Qa = wa.masterToken;
La = wa.userIdToken;
La ? ka.getTokenFactory().isUserIdTokenRevoked(ka, Qa, La, {
result: function(Pa) {
Pa ? (ra._errored = new MslUserIdTokenException(Pa, La).setEntity(Qa).setUser(La).setMessageId(wa.messageId), la()) : na(ka, wa);
},
error: function(Pa) {
Pa instanceof db && (Pa.setEntity(wa.masterToken), Pa.setUser(wa.userIdToken), Pa.setUser(wa.userAuthenticationData), Pa.setMessageId(wa.messageId));
ra._errored = Pa;
la();
}
}) : na(ka, wa);
} catch (Pa) {
Pa instanceof db && (Pa.setEntity(wa.masterToken), Pa.setUser(wa.userIdToken), Pa.setUser(wa.userAuthenticationData), Pa.setMessageId(wa.messageId));
ra._errored = Pa;
la();
}
}
function na(ka, wa) {
var Qa;
try {
Qa = wa.masterToken;
Qa.isExpired() ? wa.isRenewable() && 0 != wa.keyRequestData.length ? ka.getTokenFactory().isMasterTokenRenewable(ka, Qa, {
result: function(La) {
La ? (ra._errored = new Gb(La, "Master token is expired and not renewable.").setEntity(Qa).setUser(wa.userIdToken).setUser(wa.userAuthenticationData).setMessageId(wa.messageId), la()) : da(ka, wa);
},
error: function(La) {
La instanceof db && (La.setEntity(wa.masterToken), La.setUser(wa.userIdToken), La.setUser(wa.userAuthenticationData), La.setMessageId(wa.messageId));
ra._errored = La;
la();
}
}) : (ra._errored = new Gb(V.MESSAGE_EXPIRED, JSON.stringify(wa)).setEntity(Qa).setUser(wa.userIdToken).setUser(wa.userAuthenticationData).setMessageId(wa.messageId), la()) : da(ka, wa);
} catch (La) {
La instanceof db && (La.setEntity(wa.masterToken), La.setUser(wa.userIdToken), La.setUser(wa.userAuthenticationData), La.setMessageId(wa.messageId));
ra._errored = La;
la();
}
}
function da(ka, wa) {
var Qa,
La;
try {
Qa = wa.masterToken;
La = wa.nonReplayableId;
"number" === typeof La ? Qa ? ka.getTokenFactory().acceptNonReplayableId(ka, Qa, La, {
result: function(Pa) {
Pa || (ra._errored = new Gb(V.MESSAGE_REPLAYED, JSON.stringify(wa)).setEntity(Qa).setUser(wa.userIdToken).setUser(wa.userAuthenticationData).setMessageId(wa.messageId));
la();
},
error: function(Pa) {
Pa instanceof db && (Pa.setEntity(Qa), Pa.setUser(wa.userIdToken), Pa.setUser(wa.userAuthenticationData), Pa.setMessageId(wa.messageId));
ra._errored = Pa;
la();
}
}) : (ra._errored = new Gb(V.INCOMPLETE_NONREPLAYABLE_MESSAGE, JSON.stringify(wa)).setEntity(wa.entityAuthenticationData).setUser(wa.userIdToken).setUser(wa.userAuthenticationData).setMessageId(wa.messageId), la()) : la();
} catch (Pa) {
Pa instanceof db && (Pa.setEntity(wa.masterToken), Pa.setEntity(wa.entityAuthenticationData), Pa.setUser(wa.userIdToken), Pa.setUser(wa.userAuthenticationData), Pa.setMessageId(wa.messageId));
ra._errored = Pa;
la();
}
}
ha = {
_source: {
value: W,
writable: !1,
enumerable: !1,
configurable: !1
},
_parser: {
value: yb,
writable: !0,
enumerable: !1,
configurable: !1
},
_charset: {
value: Z,
writable: !1,
enumerable: !1,
configurable: !1
},
_remainingData: {
value: "",
writable: !0,
enumerable: !1,
configurable: !1
},
_timeout: {
value: ia,
writable: !1,
enumerable: !1,
configurable: !1
},
_header: {
value: yb,
writable: !0,
enumerable: !1,
configurable: !1
},
_cryptoContext: {
value: yb,
writable: !0,
enumerable: !1,
configurable: !1
},
_keyxCryptoContext: {
value: yb,
writable: !0,
enumerable: !1,
configurable: !1
},
_payloadSequenceNumber: {
value: 1,
writable: !0,
enuemrable: !1,
configurable: !1
},
_eom: {
value: !1,
writable: !0,
enumerable: !1,
configurable: !1
},
_closeSource: {
value: !1,
writable: !0,
enumerable: !1,
configurable: !1
},
_payloads: {
value: [],
writable: !0,
enumerable: !1,
configurable: !1
},
_payloadIndex: {
value: -1,
writable: !0,
enumerable: !1,
configurable: !1
},
_payloadOffset: {
value: 0,
writable: !0,
enuemrable: !1,
configurable: !1
},
_markOffset: {
value: 0,
writable: !0,
enumerable: !1,
configurable: !1
},
_currentPayload: {
value: null,
writable: !0,
enumerable: !1,
configurable: !1
},
_readException: {
value: null,
writable: !0,
enumerable: !1,
configurable: !1
},
_ready: {
value: !1,
writable: !0,
enumerable: !1,
configurable: !1
},
_readyQueue: {
value: new Qc(),
writable: !1,
enumerable: !1,
configurable: !1
},
_aborted: {
value: !1,
writable: !0,
enumerable: !1,
configurable: !1
},
_timedout: {
value: !1,
writable: !0,
enumerable: !1,
configurable: !1
},
_errored: {
value: null,
writable: !0,
enumerable: !1,
configurable: !1
}
};
Object.defineProperties(this, ha);
pe(ra._source, ia, {
result: function(ka) {
ra._json = ka;
ra._jsonIndex = 0;
null === ra._json ? (ra._errored = new Ab(V.MESSAGE_DATA_MISSING), la()) : ye(ba, ra._json[ra._jsonIndex++], aa, {
result: function(wa) {
var Qa;
ra._header = wa;
if (ra._header instanceof zc)
(ra._keyxCryptoContext = null,
ra._cryptoContext = null,
la());
else {
Qa = ra._header;
fa(ba, Qa, ea, {
result: function(La) {
var Pa;
try {
ra._keyxCryptoContext = La;
ba.isPeerToPeer() || !ra._keyxCryptoContext ? ra._cryptoContext = Qa.cryptoContext : ra._cryptoContext = ra._keyxCryptoContext;
try {
Pa = Qa.masterToken;
Pa && (ba.isPeerToPeer() || Pa.isVerified()) ? pa(ba, Qa) : da(ba, Qa);
} catch (Ra) {
Ra instanceof db && (Ra.setEntity(Qa.masterToken), Ra.setUser(Qa.userIdToken), Ra.setUser(Qa.userAuthenticationData), Ra.setMessageId(Qa.messageId));
ra._errored = Ra;
la();
}
} catch (Ra) {
Ra instanceof db && (Ra.setEntity(Qa.masterToken), Ra.setEntity(Qa.entityAuthenticationData), Ra.setUser(Qa.userIdToken), Ra.setUser(Qa.userAuthenticationData), Ra.setMessageId(Qa.messageId));
ra._errored = Ra;
la();
}
},
error: function(La) {
La instanceof db && (La.setEntity(Qa.masterToken), La.setEntity(Qa.entityAuthenticationData), La.setUser(Qa.userIdToken), La.setUser(Qa.userAuthenticationData), La.setMessageId(Qa.messageId));
ra._errored = La;
la();
}
});
}
},
error: function(wa) {
ra._errored = wa;
la();
}
});
},
timeout: function() {
ra._timedout = !0;
la();
},
error: function(ka) {
ra._errored = ka;
la();
}
});
return this;
}, ra);
},
nextData: function(ba, W) {
var Z;
Z = this;
ab(W, function() {
var aa;
function ea(ia) {
ab(ia, function() {
var ua;
if (this._jsonIndex < this._json.length)
return ua = this._json[this._jsonIndex++];
pe(this._source, this._timeout, {
result: function(ra) {
ra && ra.length && 0 < ra.length ? (ra.forEach(function(la) {
this._json.push(la);
}), ea(ia)) : (this._eom = !0, ia.result(null));
},
timeout: function() {
ia.timeout();
},
error: function(ra) {
ia.error(ra);
}
});
}, Z);
}
aa = this.getMessageHeader();
if (!aa)
throw new ub("Read attempted with error message.");
if (-1 != this._payloadIndex && this._payloadIndex < this._payloads.length)
return this._payloads[this._payloadIndex++];
if (this._eom)
return null;
ea({
result: function(ia) {
ab(W, function() {
if (!ia)
return null;
if ("object" !== typeof ia)
throw new Ab(V.MESSAGE_FORMAT_ERROR);
Ke(ia, this._cryptoContext, {
result: function(ua) {
ab(W, function() {
var ra,
la,
pa,
ya;
ra = aa.masterToken;
la = aa.entityAuthenticationData;
pa = aa.userIdToken;
ya = aa.getUserAuthenticationData;
if (ua.messageId != aa.messageId)
throw new Gb(V.PAYLOAD_MESSAGE_ID_MISMATCH, "payload mid " + ua.messageId + " header mid " + aa.messageId).setEntity(ra).setEntity(la).setUser(pa).setUser(ya);
if (ua.sequenceNumber != this._payloadSequenceNumber)
throw new Gb(V.PAYLOAD_SEQUENCE_NUMBER_MISMATCH, "payload seqno " + ua.sequenceNumber + " expected seqno " + this._payloadSequenceNumber).setEntity(ra).setEntity(la).setUser(pa).setUser(ya);
++this._payloadSequenceNumber;
ua.isEndOfMessage() && (this._eom = !0);
ra = ua.data;
this._payloads.push(ra);
this._payloadIndex = -1;
return ra;
}, Z);
},
error: function(ua) {
ua instanceof SyntaxError && (ua = new Ab(V.JSON_PARSE_ERROR, "payloadchunk", ua));
W.error(ua);
}
});
}, Z);
},
timeout: function() {
W.timeout();
},
error: function(ia) {
W.error(ia);
}
});
}, Z);
},
isReady: function(ba, W) {
var ea;
function Z() {
ab(W, function() {
if (this._aborted)
return !1;
if (this._timedout)
W.timeout();
else {
if (this._errored)
throw this._errored;
return !0;
}
}, ea);
}
ea = this;
ab(W, function() {
this._ready ? Z() : this._readyQueue.poll(ba, {
result: function(aa) {
ab(W, function() {
if (aa === yb)
return !1;
Z();
}, ea);
},
timeout: function() {
W.timeout();
},
error: function(aa) {
W.error(aa);
}
});
}, ea);
},
getMessageHeader: function() {
return this._header instanceof Yc ? this._header : null;
},
getErrorHeader: function() {
return this._header instanceof zc ? this._header : null;
},
getIdentity: function() {
var ba,
W;
ba = this.getMessageHeader();
if (ba) {
W = ba.masterToken;
return W ? W.identity : ba.entityAuthenticationData.getIdentity();
}
return this.getErrorHeader().entityAuthenticationData.getIdentity();
},
getCustomer: function() {
var ba;
ba = this.getMessageHeader();
return ba ? ba.customer : null;
},
getPayloadCryptoContext: function() {
return this._cryptoContext;
},
getKeyExchangeCryptoContext: function() {
return this._keyxCryptoContext;
},
closeSource: function(ba) {
this._closeSource = ba;
},
abort: function() {
this._aborted = !0;
this._source.abort();
this._readyQueue.cancelAll();
},
close: function() {
this._closeSource && this._source.close();
},
mark: function() {
if (this._currentPayload) {
for (; 0 < this._payloads.length && this._payloads[0] !== this._currentPayload;) {
this._payloads.shift();
}
this._payloadIndex = 0;
this._currentPayload = this._payloads[this._payloadIndex++];
this._markOffset = this._payloadOffset;
} else
(this._payloadIndex = -1,
this._payloads = []);
},
markSupported: function() {
return !0;
},
read: function(ba, W, Z) {
var aa;
function ea() {
ab(Z, function() {
var ua,
ra,
la,
pa;
function ia(ya) {
ab(ya, function() {
var na,
da,
ha;
if (ra && pa >= ra.length)
return ra.subarray(0, pa);
na = -1;
if (this._currentPayload) {
da = this._currentPayload.length - this._payloadOffset;
if (!ra) {
ha = da;
if (-1 != this._payloadIndex)
for (var ka = this._payloadIndex; ka < this._payloads.length; ++ka) {
ha += this._payloads[ka].length;
}
0 < ha && (ra = new Uint8Array(ha));
}
da = Math.min(da, ra ? ra.length - pa : 0);
0 < da && (na = this._currentPayload.subarray(this._payloadOffset, this._payloadOffset + da), ra.set(na, la), na = da, la += da, this._payloadOffset += da);
}
-1 != na ? (pa += na, ia(ya)) : this.nextData(W, {
result: function(wa) {
ab(ya, function() {
if (this._aborted)
return ra ? ra.subarray(0, pa) : new Uint8Array(0);
this._currentPayload = wa;
this._payloadOffset = 0;
if (this._currentPayload)
ia(ya);
else
return 0 == pa && 0 != ba ? null : ra ? ra.subarray(0, pa) : new Uint8Array(0);
}, aa);
},
timeout: function() {
ya.timeout(ra ? ra.subarray(0, pa) : new Uint8Array(0));
},
error: function(wa) {
ab(ya, function() {
wa instanceof db && (wa = new Pb("Error reading the payload chunk.", wa));
if (0 < pa)
return ( aa._readException = wa, ra.subarray(0, pa)) ;
throw wa;
}, aa);
}
});
}, aa);
}
if (this._aborted)
return new Uint8Array(0);
if (this._timedout)
Z.timeout(new Uint8Array(0));
else {
if (this._errored)
throw this._errored;
if (null != this._readException) {
ua = this._readException;
this._readException = null;
throw ua;
}
ra = -1 != ba ? new Uint8Array(ba) : yb;
la = 0;
pa = 0;
ia(Z);
}
}, aa);
}
aa = this;
ab(Z, function() {
if (-1 > ba)
throw new RangeError("read requested with illegal length " + ba);
this._ready ? ea() : this._readyQueue.poll(W, {
result: function(ia) {
ia === yb ? Z.result(!1) : ea();
},
timeout: function() {
Z.timeout(new Uint8Array(0));
},
error: function(ia) {
Z.error(ia);
}
});
}, aa);
},
reset: function() {
this._payloadIndex = 0;
0 < this._payloads.length ? (this._currentPayload = this._payloads[this._payloadIndex++], this._payloadOffset = this._markOffset) : this._currentPayload = null;
}
});
Pe = function(ba, W, Z, ea, aa, ia, ua) {
new Oe(ba, W, Z, ea, aa, ia, ua);
};
})();
(function() {
Qe = md.extend({
init: function(fa, ba, W, Z, ea, aa, ia) {
var ua;
ua = this;
ab(ia, function() {
var la,
pa,
ya;
function ra() {
ua._ready = !0;
ua._readyQueue.add(!0);
}
la = Md(fa.getMessageCapabilities(), Z.messageCapabilities);
pa = null;
la && (pa = ee(la.compressionAlgorithms));
la = {
_destination: {
value: ba,
writable: !1,
enumerable: !1,
configurable: !1
},
_charset: {
value: W,
writable: !1,
enumerable: !1,
configurable: !1
},
_capabilities: {
value: la,
writable: !1,
enumerable: !1,
configurable: !1
},
_header: {
value: Z,
writable: !1,
enumerable: !1,
configurable: !1
},
_compressionAlgo: {
value: pa,
writable: !0,
enumerable: !1,
configurable: !1
},
_cryptoContext: {
value: ea,
writable: !1,
enumerable: !1,
configurable: !1
},
_payloadSequenceNumber: {
value: 1,
writable: !0,
enumerable: !1,
configurable: !1
},
_currentPayload: {
value: [],
writable: !0,
enumerable: !1,
configurable: !1
},
_closed: {
value: !1,
writable: !0,
enumerable: !1,
configurable: !1
},
_payloads: {
value: [],
writable: !1,
enumerable: !1,
configurable: !1
},
_ready: {
value: !1,
writable: !0,
enumerable: !1,
configurable: !1
},
_readyQueue: {
value: new Qc(),
writable: !1,
enumerable: !1,
configurable: !1
},
_aborted: {
value: !1,
writable: !0,
enumerable: !1,
configurable: !1
},
_timedout: {
value: !1,
writable: !0,
enumerable: !1,
configurable: !1
},
_errored: {
value: null,
writable: !0,
enumerable: !1,
configurable: !1
}
};
Object.defineProperties(this, la);
ya = Xb(JSON.stringify(Z), W);
ba.write(ya, 0, ya.length, aa, {
result: function(na) {
try {
ua._aborted ? ra() : na < ya.length ? (ua._timedout = !0, ra()) : ba.flush(aa, {
result: function(da) {
ua._aborted || (ua._timedout = !da);
ra();
},
timeout: function() {
ua._timedout = !0;
ra();
},
error: function(da) {
ua._errored = da;
ra();
}
});
} catch (da) {
ua._errored = da;
ra();
}
},
timeout: function() {
ua._timedout = !0;
ra();
},
error: function(na) {
ua._errored = na;
ra();
}
});
return this;
}, ua);
},
setCompressionAlgorithm: function(fa, ba, W) {
var ea;
function Z() {
ea.flush(ba, {
result: function(aa) {
ab(W, function() {
if (!aa)
throw new Pb("flush() aborted");
this._compressionAlgo = fa;
return !0;
}, ea);
},
timeout: function() {
W.timeout();
},
error: function(aa) {
W.error(aa);
}
});
}
ea = this;
ab(W, function() {
if (!this.getMessageHeader())
throw new ub("Cannot write payload data for an error message.");
if (this._compressionAlgo == fa)
return !0;
if (fa) {
if (!this._capabilities)
return !1;
for (var aa = this._capabilities.compressionAlgorithms, ia = 0; ia < aa.length; ++ia) {
if (aa[ia] == fa) {
Z();
return;
}
}
return !1;
}
Z();
}, ea);
},
getMessageHeader: function() {
return this._header instanceof Yc ? this._header : null;
},
getErrorMessage: function() {
return this._header instanceof zc ? this._header : null;
},
getPayloads: function() {
return this._payloads;
},
abort: function() {
this._aborted = !0;
this._destination.abort();
this._readyQueue.cancelAll();
},
close: function(fa, ba) {
var W;
W = this;
ab(ba, function() {
if (this._aborted)
return !1;
if (this._timedout)
ba.timeout();
else {
if (this._errored)
throw this._errored;
if (this._closed)
return !0;
this._closed = !0;
this.flush(fa, {
result: function(Z) {
ab(ba, function() {
Z && (this._currentPayload = null);
return Z;
}, W);
},
timeout: function() {
ba.timeout();
},
error: function(Z) {
ba.error(Z);
}
});
}
}, W);
},
flush: function(fa, ba) {
var Z;
function W() {
ab(ba, function() {
var ea,
aa,
la;
if (this._aborted)
return !1;
if (this._timedout)
ba.timeout();
else {
if (this._errored)
throw this._errored;
if (!this._currentPayload || !this._closed && 0 == this._currentPayload.length)
return !0;
ea = this.getMessageHeader();
if (!ea)
return !0;
aa = 0;
this._currentPayload && this._currentPayload.forEach(function(pa) {
aa += pa.length;
});
for (var ia = new Uint8Array(aa), ua = 0, ra = 0; this._currentPayload && ra < this._currentPayload.length; ++ra) {
la = this._currentPayload[ra];
ia.set(la, ua);
ua += la.length;
}
Je(this._payloadSequenceNumber, ea.messageId, this._closed, this._compressionAlgo, ia, this._cryptoContext, {
result: function(pa) {
ab(ba, function() {
var ya;
this._payloads.push(pa);
ya = Xb(JSON.stringify(pa), this._charset);
this._destination.write(ya, 0, ya.length, fa, {
result: function(na) {
ab(ba, function() {
if (this._aborted)
return !1;
na < pa.length ? ba.timeout() : this._destination.flush(fa, {
result: function(da) {
ab(ba, function() {
if (this._aborted)
return !1;
if (da)
return ( ++this._payloadSequenceNumber, this._currentPayload = this._closed ? null : [], !0) ;
ba.timeout();
}, Z);
},
timeout: function() {
ba.timeout();
},
error: function(da) {
da instanceof db && (da = new Pb("Error encoding payload chunk [sequence number " + Z._payloadSequenceNumber + "].", da));
ba.error(da);
}
});
}, Z);
},
timeout: function(na) {
ba.timeout();
},
error: function(na) {
na instanceof db && (na = new Pb("Error encoding payload chunk [sequence number " + Z._payloadSequenceNumber + "].", na));
ba.error(na);
}
});
}, Z);
},
error: function(pa) {
pa instanceof db && (pa = new Pb("Error encoding payload chunk [sequence number " + Z._payloadSequenceNumber + "].", pa));
ba.error(pa);
}
});
}
}, Z);
}
Z = this;
ab(ba, function() {
this._ready ? W() : this._readyQueue.poll(fa, {
result: function(ea) {
ea === yb ? ba.result(!1) : W();
},
timeout: function() {
ba.timeout();
},
error: function(ea) {
ba.error(ea);
}
});
}, Z);
},
write: function(fa, ba, W, Z, ea) {
ab(ea, function() {
var aa;
if (this._aborted)
return !1;
if (this._timedout)
ea.timeout();
else {
if (this._errored)
throw this._errored;
if (this._closed)
throw new Pb("Message output stream already closed.");
if (0 > ba)
throw new RangeError("Offset cannot be negative.");
if (0 > W)
throw new RangeError("Length cannot be negative.");
if (ba + W > fa.length)
throw new RangeError("Offset plus length cannot be greater than the array length.");
if (!this.getMessageHeader())
throw new ub("Cannot write payload data for an error message.");
aa = fa.subarray(ba, ba + W);
this._currentPayload.push(aa);
return aa.length;
}
}, this);
}
});
rd = function(fa, ba, W, Z, ea, aa, ia) {
new Qe(fa, ba, W, Z, ea, aa, ia);
};
})();
uf = zb.Class.create({
sentHeader: function(fa) {},
receivedHeader: function(fa) {}
});
Object.freeze({
USERDATA_REAUTH: Ea.USERDATA_REAUTH,
SSOTOKEN_REJECTED: Ea.SSOTOKEN_REJECTED
});
Re = zb.Class.create({
getCryptoContexts: function() {},
getRecipient: function() {},
isEncrypted: function() {},
isIntegrityProtected: function() {},
isNonReplayable: function() {},
isRequestingTokens: function() {},
getUserId: function() {},
getUserAuthData: function(fa, ba, W, Z) {},
getCustomer: function() {},
getKeyRequestData: function(fa) {},
updateServiceTokens: function(fa, ba, W) {},
write: function(fa, ba, W) {},
getDebugContext: function() {}
});
zb.Class.create({
getInputStream: function(fa) {},
getOutputStream: function(fa) {}
});
(function() {
var ua,
ra,
la,
pa,
ya,
na,
da,
ha,
ka,
wa,
Qa,
La;
function fa(Pa) {
return function() {
Pa.abort();
};
}
function ba(Pa, Ra) {
Object.defineProperties(this, {
masterToken: {
value: Pa,
writable: !1,
configurable: !1
},
ticket: {
value: Ra,
writable: !1,
configurable: !1
}
});
}
function W(Pa, Ra) {
Object.defineProperties(this, {
builder: {
value: Pa,
writable: !1,
configurable: !1
},
msgCtx: {
value: Ra,
writable: !1,
configurable: !1
}
});
}
function Z(Pa, Ra, oa) {
Object.defineProperties(this, {
requestHeader: {
value: Pa,
writable: !1,
configurable: !1
},
payloads: {
value: Ra,
writable: !1,
configurable: !1
},
handshake: {
value: oa,
writable: !1,
configurable: !1
}
});
}
function ea(Pa, Ra) {
Object.defineProperties(this, {
requestHeader: {
value: Ra.requestHeader,
writable: !1,
configurable: !1
},
payloads: {
value: Ra.payloads,
writable: !1,
configurable: !1
},
handshake: {
value: Ra.handshake,
writable: !1,
configurable: !1
},
response: {
value: Pa,
writable: !1,
configurable: !1
}
});
}
function aa(Pa) {
for (; Pa;) {
if (Pa instanceof Ub)
return !0;
Pa = Pa instanceof db ? Pa.cause : yb;
}
return !1;
}
function ia(Pa, Ra, oa, xa, Da, Ha, Aa, Sa, Ga) {
Me(Ra, xa, Da, Ha, {
result: function(Wa) {
oa && oa.sentHeader(Wa);
rd(Ra, Aa, Kb, Wa, null, null, Sa, {
result: function($a) {
Pa.setAbort(function() {
$a.abort();
});
$a.close(Sa, {
result: function(Va) {
ab(Ga, function() {
if (!Va)
throw new Ub("sendError aborted.");
return Va;
});
},
timeout: function() {
Ga.timeout();
},
error: function(Va) {
Ga.error(Va);
}
});
},
timeout: function() {},
error: function($a) {
Ga.error($a);
}
});
},
error: function(Wa) {
Ga.error(Wa);
}
});
}
ua = md.extend({
close: function(Pa, Ra) {
Ra.result(!0);
},
write: function(Pa, Ra, oa, xa, Da) {
Ma(Da, function() {
return Math.min(Pa.length - Ra, oa);
});
},
flush: function(Pa, Ra) {
Ra.result(!0);
}
});
ra = tf.extend({
getUserMessage: function(Pa, Ra) {
return null;
}
});
la = Re.extend({
init: function(Pa) {
Object.defineProperties(this, {
_appCtx: {
value: Pa,
writable: !1,
enumerable: !1,
configurable: !1
}
});
},
getCryptoContexts: function() {
return this._appCtx.getCryptoContexts();
},
isEncrypted: function() {
return this._appCtx.isEncrypted();
},
isIntegrityProtected: function() {
return this._appCtx.isIntegrityProtected();
},
isNonReplayable: function() {
return this._appCtx.isNonReplayable();
},
isRequestingTokens: function() {
return this._appCtx.isRequestingTokens();
},
getUserId: function() {
return this._appCtx.getUserId();
},
getUserAuthData: function(Pa, Ra, oa, xa) {
this._appCtx.getUserAuthData(Pa, Ra, oa, xa);
},
getCustomer: function() {
return this._appCtx.getCustomer();
},
getKeyRequestData: function(Pa) {
this._appCtx.getKeyRequestData(Pa);
},
updateServiceTokens: function(Pa, Ra, oa) {
this._appCtx.updateServiceTokens(Pa, Ra, oa);
},
write: function(Pa, Ra, oa) {
this._appCtx.write(Pa, Ra, oa);
},
getDebugContext: function() {
return this._appCtx.getDebugContext();
}
});
pa = la.extend({
init: function xa(Ra, oa) {
xa.base.call(this, oa);
Object.defineProperties(this, {
_payloads: {
value: Ra,
writable: !1,
enumerable: !1,
configurable: !1
}
});
},
write: function(Ra, oa, xa) {
var Ha;
function Da(Aa, Sa) {
var Ga;
if (Aa == Ha._payloads.length)
xa.result(!0);
else {
Ga = Ha._payloads[Aa];
Ra.setCompressionAlgorithm(Ga.compressionAlgo, oa, {
result: function(Wa) {
Ra.write(Ga.data, 0, Ga.data.length, oa, {
result: function($a) {
ab(xa, function() {
Ga.isEndOfMessage() ? Da(Aa + 1, Sa) : Ra.flush(oa, {
result: function(Va) {
xa.result(Va);
},
timeout: function() {
xa.timeout();
},
error: function(Va) {
xa.error(Va);
}
});
}, Ha);
},
timeout: function($a) {
xa.timeout($a);
},
error: function($a) {
xa.error($a);
}
});
},
timeout: function() {},
error: function(Wa) {
xa.error(Wa);
}
});
}
}
Ha = this;
Da(0);
}
});
ya = la.extend({
init: function xa(oa) {
xa.base.call(this, oa);
},
isEncrypted: function() {
return !1;
},
isNonReplayable: function() {
return !1;
},
write: function(oa, xa, Da) {
Da.result(!0);
}
});
na = {};
da = zb.Class.create({
init: function(oa) {
oa || (oa = new ra());
Object.defineProperties(this, {
_filterFactory: {
value: null,
writable: !0,
enumerable: !1,
configurable: !1
},
_renewingContexts: {
value: [],
writable: !1,
enumerable: !1,
configurable: !1
},
_masterTokenLocks: {
value: {},
writable: !1,
enumerable: !1,
configurable: !1
},
_messageRegistry: {
value: oa,
writable: !1,
enumerable: !1,
configurable: !1
}
});
},
setFilterFactory: function(oa) {
this._filterFactory = oa;
},
getNewestMasterToken: function(oa, xa, Da, Ha) {
var Aa;
Aa = this;
ab(Ha, function() {
var Sa,
Ga,
Wa,
$a,
Va;
Sa = xa.getMslStore();
Ga = Sa.getMasterToken();
if (!Ga)
return null;
Wa = Ga.uniqueKey();
$a = this._masterTokenLocks[Wa];
$a || ($a = new xd(), this._masterTokenLocks[Wa] = $a);
Va = $a.readLock(Da, {
result: function(hb) {
ab(Ha, function() {
var kb;
if (hb === yb)
throw new Ub("getNewestMasterToken aborted.");
kb = Sa.getMasterToken();
if (Ga.equals(kb))
return new ba(Ga, hb);
$a.unlock(hb);
$a.writeLock(Da, {
result: function(nb) {
ab(Ha, function() {
if (nb === yb)
throw new Ub("getNewestMasterToken aborted.");
delete this._masterTokenLocks[Wa];
$a.unlock(nb);
return this.getNewestMasterToken(oa, xa, Da, Ha);
}, Aa);
},
timeout: function() {
Ha.timeout();
},
error: function(nb) {
Ha.error(nb);
}
});
}, Aa);
},
timeout: function() {
Ha.timeout();
},
error: function(hb) {
Ha.error(hb);
}
});
oa.setAbort(function() {
Va && ($a.cancel(Va), Va = yb);
});
}, Aa);
},
deleteMasterToken: function(oa, xa) {
var Da;
if (xa) {
Da = this;
setTimeout(function() {
var Ha,
Aa;
Ha = xa.uniqueKey();
Aa = Da._masterTokenLocks[Ha];
Aa || (Aa = new xd(), Da._masterTokenLocks[Ha] = Aa);
Aa.writeLock(-1, {
result: function(Sa) {
oa.getMslStore().removeCryptoContext(xa);
delete Da._masterTokenLocks[Ha];
Aa.unlock(Sa);
},
timeout: function() {
throw new ub("Unexpected timeout received.");
},
error: function(Sa) {
throw Sa;
}
});
}, 0);
}
},
releaseMasterToken: function(oa) {
var xa;
if (oa && oa.masterToken) {
xa = oa.masterToken.uniqueKey();
xa = this._masterTokenLocks[xa];
if (!xa)
throw new ub("Master token read/write lock does not exist when it should.");
xa.unlock(oa.ticket);
}
},
updateOutgoingCryptoContexts: function(oa, xa, Da) {
var Ha;
Ha = oa.getMslStore();
!oa.isPeerToPeer() && Da && (Ha.setCryptoContext(Da.keyResponseData.masterToken, Da.cryptoContext), this.deleteMasterToken(oa, xa.masterToken));
},
updateIncomingCryptoContexts: function(oa, xa, Da) {
var Ha,
Aa;
Ha = Da.getMessageHeader();
if (Ha) {
Aa = oa.getMslStore();
if (Ha = Ha.keyResponseData)
(Aa.setCryptoContext(Ha.masterToken, Da.getKeyExchangeCryptoContext()),
this.deleteMasterToken(oa, xa.masterToken));
}
},
storeServiceTokens: function(oa, xa, Da, Ha) {
var Ga,
Wa;
oa = oa.getMslStore();
for (var Aa = [], Sa = 0; Sa < Ha.length; ++Sa) {
Ga = Ha[Sa];
if (!Ga.isBoundTo(xa) || !xa.isVerified()) {
Wa = Ga.data;
Wa && 0 == Wa.length ? oa.removeServiceTokens(Ga.name, Ga.isMasterTokenBound() ? xa : null, Ga.isUserIdTokenBound() ? Da : null) : Aa.push(Ga);
}
}
0 < Aa.length && oa.addServiceTokens(Aa);
},
buildRequest: function(oa, xa, Da, Ha, Aa) {
var Sa;
Sa = this;
this.getNewestMasterToken(oa, xa, Ha, {
result: function(Ga) {
Ma(Aa, function() {
var Wa,
$a,
Va;
Wa = Ga && Ga.masterToken;
if (Wa) {
$a = Da.getUserId();
Va = xa.getMslStore();
$a = ($a = $a ? Va.getUserIdToken($a) : null) && $a.isBoundTo(Wa) ? $a : null;
} else
$a = null;
Fc(xa, Wa, $a, null, {
result: function(hb) {
Ma(Aa, function() {
hb.setNonReplayable(Da.isNonReplayable());
return {
builder: hb,
tokenTicket: Ga
};
});
},
error: function(hb) {
Ma(Aa, function() {
this.releaseMasterToken(Ga);
hb instanceof db && (hb = new ub("User ID token not bound to master token despite internal check.", hb));
throw hb;
}, Sa);
}
});
}, Sa);
},
timeout: function() {
Aa.timeout();
},
error: function(Ga) {
Aa.error(Ga);
}
});
},
buildResponse: function(oa, xa, Da, Ha, Aa, Sa) {
var Ga;
Ga = this;
Le(xa, Ha, {
result: function(Wa) {
ab(Sa, function() {
Wa.setNonReplayable(Da.isNonReplayable());
if (!xa.isPeerToPeer() && !Ha.keyResponseData)
return {
builder: Wa,
tokenTicket: null
};
this.getNewestMasterToken(oa, xa, Aa, {
result: function($a) {
ab(Sa, function() {
var Va,
hb,
kb;
Va = $a && $a.masterToken;
if (Va) {
hb = Da.getUserId();
kb = xa.getMslStore();
hb = (hb = hb ? kb.getUserIdToken(hb) : null) && hb.isBoundTo(Va) ? hb : null;
} else
hb = null;
Wa.setAuthTokens(Va, hb);
return {
builder: Wa,
tokenTicket: $a
};
}, Ga);
},
timeout: function() {
Sa.timeout();
},
error: function($a) {
Sa.error($a);
}
});
}, Ga);
},
error: function(Wa) {
Sa.error(Wa);
}
});
},
buildErrorResponse: function(oa, xa, Da, Ha, Aa, Sa, Ga) {
var Va;
function Wa(hb, kb) {
ab(Ga, function() {
var nb,
pb;
nb = Ec(Aa.messageId);
pb = new pa(kb, Da);
Fc(xa, null, null, nb, {
result: function(qb) {
ab(Ga, function() {
xa.isPeerToPeer() && qb.setPeerAuthTokens(hb.peerMasterToken, hb.peerUserIdToken);
qb.setNonReplayable(pb.isNonReplayable());
return {
errorResult: new W(qb, pb),
tokenTicket: null
};
}, Va);
},
error: function(qb) {
Ga.error(qb);
}
});
}, Va);
}
function $a(hb, kb) {
Va.getNewestMasterToken(oa, xa, Sa, {
result: function(nb) {
ab(Ga, function() {
var pb,
qb,
xb;
pb = nb && nb.masterToken;
qb = Ec(Aa.messageId);
xb = new pa(kb, Da);
Fc(xa, pb, null, qb, {
result: function(wb) {
ab(Ga, function() {
xa.isPeerToPeer() && wb.setPeerAuthTokens(hb.peerMasterToken, hb.peerUserIdToken);
wb.setNonReplayable(xb.isNonReplayable());
return {
errorResult: new W(wb, xb),
tokenTicket: nb
};
}, Va);
},
error: function(wb) {
Ga.error(wb);
}
});
}, Va);
},
timeout: function() {
Ga.timeout();
},
error: function(nb) {
Ga.error(nb);
}
});
}
Va = this;
ab(Ga, function() {
var hb,
kb,
nb,
pb;
hb = Ha.requestHeader;
kb = Ha.payloads;
nb = Aa.errorCode;
switch (nb) {
case Ea.ENTITYDATA_REAUTH:
case Ea.ENTITY_REAUTH:
xa.getEntityAuthenticationData(nb, {
result: function(qb) {
ab(Ga, function() {
if (!qb)
return null;
Wa(hb, kb);
}, Va);
},
error: function(qb) {
Ga.error(qb);
}
});
break;
case Ea.USERDATA_REAUTH:
case Ea.SSOTOKEN_REJECTED:
Da.getUserAuthData(nb, !1, !0, {
result: function(qb) {
ab(Ga, function() {
if (!qb)
return null;
$a(hb, kb);
}, Va);
},
error: function(qb) {
Ga.error(qb);
}
});
break;
case Ea.USER_REAUTH:
$a(hb, kb);
break;
case Ea.KEYX_REQUIRED:
nb = Ec(Aa.messageId);
pb = new pa(kb, Da);
Fc(xa, null, null, nb, {
result: function(qb) {
ab(Ga, function() {
xa.isPeerToPeer() && qb.setPeerAuthTokens(hb.peerMasterToken, hb.peerUserIdToken);
qb.setRenewable(!0);
qb.setNonReplayable(pb.isNonReplayable());
return {
errorResult: new W(qb, pb),
tokenTicket: null
};
}, Va);
},
error: function(qb) {
Ga.error(qb);
}
});
break;
case Ea.EXPIRED:
this.getNewestMasterToken(oa, xa, Sa, {
result: function(qb) {
ab(Ga, function() {
var xb,
wb,
r,
b;
xb = qb && qb.masterToken;
wb = hb.userIdToken;
r = Ec(Aa.messageId);
b = new pa(kb, Da);
Fc(xa, xb, wb, r, {
result: function(a) {
ab(Ga, function() {
xa.isPeerToPeer() && a.setPeerAuthTokens(hb.peerMasterToken, hb.peerUserIdToken);
hb.masterToken.equals(xb) && a.setRenewable(!0);
a.setNonReplayable(b.isNonReplayable());
return {
errorResult: new W(a, b),
tokenTicket: qb
};
}, Va);
},
error: function(a) {
Ga.error(a);
}
}, Va);
}, Va);
},
timeout: function() {
Ga.timeout();
},
error: function(qb) {
Ga.error(qb);
}
});
break;
case Ea.REPLAYED:
this.getNewestMasterToken(oa, xa, Sa, {
result: function(qb) {
ab(Ga, function() {
var xb,
wb,
r,
b;
xb = qb && qb.masterToken;
wb = hb.userIdToken;
r = Ec(Aa.messageId);
b = new pa(kb, Da);
Fc(xa, xb, wb, r, {
result: function(a) {
ab(Ga, function() {
xa.isPeerToPeer() && a.setPeerAuthTokens(hb.peerMasterToken, hb.peerUserIdToken);
hb.masterToken.equals(xb) ? (a.setRenewable(!0), a.setNonReplayable(!1)) : a.setNonReplayable(b.isNonReplayable());
return {
errorResult: new W(a, b),
tokenTicket: qb
};
}, Va);
},
error: function(a) {
Ga.error(a);
}
});
}, Va);
},
timeout: function() {
Ga.timeout();
},
error: function(qb) {
Ga.error(qb);
}
});
break;
default:
return null;
}
}, Va);
},
cleanupContext: function(oa, xa, Da) {
switch (Da.errorCode) {
case Ea.ENTITY_REAUTH:
this.deleteMasterToken(oa, xa.masterToken);
break;
case Ea.USER_REAUTH:
(Da = xa.userIdToken,
xa.masterToken && Da && oa.getMslStore().removeUserIdToken(Da));
}
},
send: function(oa, xa, Da, Ha, Aa, Sa, Ga) {
var nb;
function Wa(pb, qb, xb) {
ab(Ga, function() {
var wb;
wb = Aa.getPeerUserIdToken();
!xa.isPeerToPeer() && !qb || xa.isPeerToPeer() && !wb ? (wb = Da.getCustomer()) ? Aa.setCustomer(wb, {
result: function(r) {
ab(Ga, function() {
qb = Aa.getUserIdToken();
$a(pb, qb, xb);
}, nb);
},
error: function(r) {
Ga.error(r);
}
}) : $a(pb, qb, xb) : $a(pb, qb, xb);
}, nb);
}
function $a(pb, qb, xb) {
ab(Ga, function() {
var wb,
r;
wb = !xb && (!Da.isEncrypted() || Aa.willEncryptPayloads()) && (!Da.isIntegrityProtected() || Aa.willIntegrityProtectPayloads()) && (!Da.isNonReplayable() || Aa.isNonReplayable() && pb);
wb || Aa.setNonReplayable(!1);
r = [];
Aa.isRenewable() && (!pb || pb.isRenewable() || Da.isNonReplayable()) ? Da.getKeyRequestData({
result: function(b) {
ab(Ga, function() {
var c;
for (var a = 0; a < b.length; ++a) {
c = b[a];
r.push(c);
Aa.addKeyRequestData(c);
}
Va(pb, qb, wb, r);
}, nb);
},
error: function(b) {
Ga.error(b);
}
}) : Va(pb, qb, wb, r);
}, nb);
}
function Va(pb, qb, xb, wb) {
ab(Ga, function() {
var r;
r = new Ne(xa, Da, Aa);
Da.updateServiceTokens(r, !xb, {
result: function(b) {
Aa.getHeader({
result: function(a) {
ab(Ga, function() {
var c,
m;
c = Da.getDebugContext();
c && c.sentHeader(a);
c = Aa.getKeyExchangeData();
this.updateOutgoingCryptoContexts(xa, a, c);
this.storeServiceTokens(xa, pb, qb, a.serviceTokens);
c = !xa.isPeerToPeer() && c ? c.cryptoContext : a.cryptoContext;
if (oa.isAborted())
throw new Ub("send aborted.");
m = null != this._filterFactory ? this._filterFactory.getOutputStream(Ha) : Ha;
rd(xa, m, Kb, a, c, Sa, {
result: function(h) {
oa.setAbort(function() {
h.abort();
});
hb(h, a, xb);
},
timeout: function() {
Ga.timeout();
},
error: function(h) {
Ga.error(h);
}
});
}, nb);
},
timeout: function() {
Ga.timeout();
},
error: function(a) {
Ga.error(a);
}
});
},
error: function(b) {
Ga.error(b);
}
});
}, nb);
}
function hb(pb, qb, xb) {
var wb,
r;
if (xb)
Da.write(pb, Sa, {
result: function(b) {
ab(Ga, function() {
if (oa.isAborted())
throw new Ub("MessageOutputStream write aborted.");
kb(pb, qb, xb);
}, nb);
},
timeout: function() {
Ga.timeout();
},
error: function(b) {
Ga.error(b);
}
});
else {
wb = new ua();
r = new Mc();
rd(xa, wb, Kb, qb, r, Sa, {
result: function(b) {
Da.write(b, Sa, {
result: function(a) {
ab(Ga, function() {
if (oa.isAborted())
throw new Ub("MessageOutputStream proxy write aborted.");
b.close(Sa, {
result: function(c) {
ab(Ga, function() {
var m;
if (!c)
throw new Ub("MessageOutputStream proxy close aborted.");
m = b.getPayloads();
kb(pb, qb, xb, m);
}, nb);
},
timeout: function() {
Ga.timeout();
},
error: function(c) {
Ga.error(c);
}
});
}, nb);
},
timeout: function() {
Ga.timeout();
},
error: function(a) {
Ga.error(a);
}
});
},
timeout: function() {
Ga.timeout();
},
error: function(b) {
Ga.error(b);
}
});
}
}
function kb(pb, qb, xb, wb) {
pb.close(Sa, {
result: function(r) {
ab(Ga, function() {
if (!r)
throw new Ub("MessageOutputStream close aborted.");
wb || (wb = pb.getPayloads());
return new Z(qb, wb, !xb);
}, nb);
},
timeout: function() {
Ga.timeout();
},
error: function(r) {
Ga.error(r);
}
});
}
nb = this;
ab(Ga, function() {
var pb,
qb,
xb,
wb;
pb = Aa.getMasterToken();
qb = Aa.getUserIdToken();
xb = !1;
if (Da.getUserId()) {
wb = !qb;
Da.getUserAuthData(null, Aa.isRenewable(), wb, {
result: function(r) {
ab(Ga, function() {
r && (Aa.willEncryptHeader() && Aa.willIntegrityProtectHeader() ? Aa.setUserAuthenticationData(r) : xb = !0);
Wa(pb, qb, xb);
}, nb);
},
error: function(r) {
Ga.error(r);
}
});
} else
Wa(pb, qb, xb);
}, nb);
},
receive: function(oa, xa, Da, Ha, Aa, Sa, Ga) {
var Wa;
Wa = this;
ab(Ga, function() {
var $a,
Va,
hb;
if (oa.isAborted())
throw new Ub("receive aborted.");
$a = [];
Aa && ($a = Aa.keyRequestData.filter(function() {
return !0;
}));
Va = Da.getCryptoContexts();
hb = this._filterFactory ? this._filterFactory.getInputStream(Ha) : Ha;
Pe(xa, hb, Kb, $a, Va, Sa, {
result: function(kb) {
oa.setAbort(function() {
kb.abort();
});
kb.isReady(Sa, {
result: function(nb) {
ab(Ga, function() {
var pb,
qb,
xb,
wb;
if (!nb)
throw new Ub("MessageInputStream aborted.");
pb = kb.getMessageHeader();
qb = kb.getErrorHeader();
xb = Da.getDebugContext();
xb && xb.receivedHeader(pb ? pb : qb);
if (Aa && (xb = qb ? qb.errorCode : null, pb || xb != Ea.FAIL && xb != Ea.TRANSIENT_FAILURE && xb != Ea.ENTITY_REAUTH && xb != Ea.ENTITYDATA_REAUTH)) {
xb = pb ? pb.messageId : qb.messageId;
wb = Ec(Aa.messageId);
if (xb != wb)
throw new Gb(V.UNEXPECTED_RESPONSE_MESSAGE_ID, "expected " + wb + "; received " + xb);
}
xa.getEntityAuthenticationData(null, {
result: function(r) {
ab(Ga, function() {
var b,
a,
c,
m;
b = r.getIdentity();
if (pb) {
a = pb.entityAuthenticationData;
c = pb.masterToken;
a = c ? pb.sender : a.getIdentity();
if (c && c.isDecrypted() && c.identity != a || b == a)
throw new Gb(V.UNEXPECTED_MESSAGE_SENDER, a);
Aa && this.updateIncomingCryptoContexts(xa, Aa, kb);
b = pb.keyResponseData;
xa.isPeerToPeer() ? (b = b ? b.masterToken : pb.peerMasterToken, c = pb.peerUserIdToken, a = pb.peerServiceTokens) : (b = b ? b.masterToken : pb.masterToken, c = pb.userIdToken, a = pb.serviceTokens);
m = Da.getUserId();
m && c && !c.isVerified() && xa.getMslStore().addUserIdToken(m, c);
this.storeServiceTokens(xa, b, c, a);
} else if ((a = qb.entityAuthenticationData.getIdentity(), b == a))
throw new Gb(V.UNEXPECTED_MESSAGE_SENDER, a);
return kb;
}, Wa);
},
error: Ga.error
});
}, Wa);
},
timeout: function() {
Ga.timeout();
},
error: function(nb) {
Ga.error(nb);
}
});
},
timeout: function() {
Ga.timeout();
},
error: function(kb) {
Ga.error(kb);
}
});
}, Wa);
},
sendReceive: function(oa, xa, Da, Ha, Aa, Sa, Ga, Wa, $a) {
var hb;
function Va(kb, nb) {
ab($a, function() {
Sa.setRenewable(nb);
this.send(oa, xa, Da, Aa, Sa, Ga, {
result: function(pb) {
ab($a, function() {
var qb;
qb = pb.requestHeader.keyRequestData;
Wa || pb.handshake || !qb.isEmpty() ? this.receive(oa, xa, Da, Ha, pb.requestHeader, Ga, {
result: function(xb) {
ab($a, function() {
nb && this.releaseRenewalLock(xa, kb, xb);
return new ea(xb, pb);
}, hb);
},
timeout: function() {
ab($a, function() {
nb && this.releaseRenewalLock(xa, kb, null);
$a.timeout();
}, hb);
},
error: function(xb) {
ab($a, function() {
nb && this.releaseRenewalLock(xa, kb, null);
throw xb;
}, hb);
}
}) : ab($a, function() {
nb && this.releaseRenewalLock(xa, kb, null);
return new ea(null, pb);
}, hb);
}, hb);
},
timeout: function() {
ab($a, function() {
nb && this.releaseRenewalLock(xa, kb, null);
$a.timeout();
}, hb);
},
error: function(pb) {
ab($a, function() {
nb && this.releaseRenewalLock(xa, kb, null);
throw pb;
}, hb);
}
});
}, hb);
}
hb = this;
ab($a, function() {
var kb;
kb = new Qc();
this.acquireRenewalLock(oa, xa, Da, kb, Sa, Ga, {
result: function(nb) {
Va(kb, nb);
},
timeout: function() {
$a.timeout();
},
error: function(nb) {
nb instanceof Ub ? $a.result(null) : $a.error(nb);
}
});
}, hb);
},
acquireRenewalLock: function(oa, xa, Da, Ha, Aa, Sa, Ga) {
var Va;
function Wa(hb, kb, nb) {
ab(Ga, function() {
var xb,
wb;
if (oa.isAborted())
throw new Ub("acquireRenewalLock aborted.");
for (var pb = null, qb = 0; qb < this._renewingContexts.length; ++qb) {
xb = this._renewingContexts[qb];
if (xb.ctx === xa) {
pb = xb.queue;
break;
}
}
if (!pb)
return ( this._renewingContexts.push({
ctx: xa,
queue: Ha
}), !0) ;
wb = pb.poll(Sa, {
result: function(r) {
ab(Ga, function() {
var b;
if (r === yb)
throw new Ub("acquireRenewalLock aborted.");
pb.add(r);
if (r === na || r.isExpired())
Wa(r, kb, nb);
else {
if (nb && !kb || kb && !kb.isBoundTo(r)) {
b = xa.getMslStore().getUserIdToken(nb);
kb = b && b.isBoundTo(r) ? b : null;
}
Aa.setAuthTokens(r, kb);
Aa.isRenewable() && r.equals(hb) ? Wa(r, kb, nb) : Da.isRequestingTokens() && !kb ? Wa(r, kb, nb) : $a(r, kb);
}
}, Va);
},
timeout: function() {},
error: function(r) {}
});
oa.setAbort(function() {
wb && (pb.cancel(wb), wb = yb);
});
}, Va);
}
function $a(hb, kb) {
ab(Ga, function() {
var qb;
if (oa.isAborted())
throw new Ub("acquireRenewalLock aborted.");
if (!hb || hb.isRenewable() || !kb && Da.getUserId() || kb && kb.isRenewable()) {
for (var nb = null, pb = 0; pb < this._renewingContexts.length; ++pb) {
qb = this._renewingContexts[pb];
if (qb.ctx === xa) {
nb = qb.queue;
break;
}
}
if (!nb)
return ( this._renewingContexts.push({
ctx: xa,
queue: Ha
}), !0) ;
}
return !1;
}, Va);
}
Va = this;
ab(Ga, function() {
var hb,
kb,
nb;
hb = Aa.getMasterToken();
kb = Aa.getUserIdToken();
nb = Da.getUserId();
Da.isEncrypted() && !Aa.willEncryptPayloads() || Da.isIntegrityProtected() && !Aa.willIntegrityProtectPayloads() || Aa.isRenewable() || !hb && Da.isNonReplayable() || hb && hb.isExpired() || !(kb || !nb || Aa.willEncryptHeader() && Aa.willIntegrityProtectHeader()) || Da.isRequestingTokens() && (!hb || nb && !kb) ? Wa(hb, kb, nb) : $a(hb, kb);
}, Va);
},
releaseRenewalLock: function(oa, xa, Da) {
var Ga;
for (var Ha, Aa, Sa = 0; Sa < this._renewingContexts.length; ++Sa) {
Ga = this._renewingContexts[Sa];
if (Ga.ctx === oa) {
Ha = Sa;
Aa = Ga.queue;
break;
}
}
if (Aa !== xa)
throw new ub("Attempt to release renewal lock that is not owned by this queue.");
Da ? (Da = Da.messageHeader) ? (Aa = Da.keyResponseData) ? xa.add(Aa.masterToken) : (oa = oa.isPeerToPeer() ? Da.peerMasterToken : Da.masterToken) ? xa.add(oa) : xa.add(na) : xa.add(na) : xa.add(na);
this._renewingContexts.splice(Ha, 1);
}
});
Se = zb.Class.create({
init: function() {
var oa;
oa = {
_impl: {
value: new da(),
writable: !1,
enumerable: !1,
configurable: !1
},
_shutdown: {
value: !1,
writable: !1,
enumerable: !1,
configurable: !1
}
};
Object.defineProperties(this, oa);
},
setFilterFactory: function(oa) {
this._impl.setFilterFactory(oa);
},
shutdown: function() {
this._shutdown = !0;
},
receive: function(oa, xa, Da, Ha, Aa, Sa) {
var Ga;
if (this._shutdown)
throw new db("MslControl is shutdown.");
Ga = new ha(this._impl, oa, xa, Da, Ha, Aa);
setTimeout(function() {
Ga.call(Sa);
}, 0);
return fa(Ga);
},
respond: function(oa, xa, Da, Ha, Aa, Sa, Ga) {
var Wa;
if (this._shutdown)
throw new db("MslControl is shutdown.");
Wa = new ka(this._impl, oa, xa, Da, Ha, Aa, Sa);
setTimeout(function() {
Wa.call(Ga);
}, 0);
return fa(Wa);
},
error: function Da(oa, xa, Da, Ha, Aa, Sa, Ga) {
var Wa;
if (this._shutdown)
throw new db("MslControl is shutdown.");
Wa = new wa(this._impl, oa, xa, Da, Ha, Aa, Sa);
setTimeout(function() {
Wa.call(Ga);
}, 0);
return fa(Wa);
},
request: function(oa, xa) {
var Da,
Ha,
Aa,
Sa,
Ga,
Wa;
if (this._shutdown)
throw new db("MslControl is shutdown.");
if (5 == arguments.length) {
Ha = arguments[2];
Aa = Da = null;
Sa = arguments[3];
Ga = arguments[4];
if (oa.isPeerToPeer()) {
Ga.error(new ub("This method cannot be used in peer-to-peer mode."));
return;
}
} else if (6 == arguments.length && (Ha = null, Da = arguments[2], Aa = arguments[3], Sa = arguments[4], Ga = arguments[5], !oa.isPeerToPeer())) {
Ga.error(new ub("This method cannot be used in trusted network mode."));
return;
}
Wa = new La(this._impl, oa, xa, Ha, Da, Aa, null, 0, Sa);
setTimeout(function() {
Wa.call(Ga);
}, 0);
return fa(Wa);
}
});
ha = zb.Class.create({
init: function(oa, xa, Da, Ha, Aa, Sa) {
Object.defineProperties(this, {
_ctrl: {
value: oa,
writable: !1,
enumerable: !1,
configurable: !1
},
_ctx: {
value: xa,
writable: !1,
enumerable: !1,
configurable: !1
},
_msgCtx: {
value: Da,
writable: !1,
enumerable: !1,
configurable: !1
},
_input: {
value: Ha,
writable: !1,
enumerable: !1,
configurable: !1
},
_output: {
value: Aa,
writable: !1,
enumerable: !1,
configurable: !1
},
_timeout: {
value: Sa,
writable: !1,
enumerable: !1,
configurable: !1
},
_aborted: {
value: !1,
writable: !0,
enumerable: !1,
configurable: !1
},
_abortFunc: {
value: yb,
writable: !0,
enumerable: !1,
configurable: !1
}
});
},
isAborted: function() {
return this._aborted;
},
abort: function() {
this._aborted = !0;
this._abortFunc && this._abortFunc.call(this);
},
setAbort: function(oa) {
this._abortFunc = oa;
},
call: function(oa) {
var Aa;
function xa(Sa) {
ab(oa, function() {
var Ga;
Ga = Sa.messageHeader;
if (!Ga)
return Sa;
this.setAbort(function() {
Sa.abort();
});
Sa.mark(Number.MAX_VALUE);
Sa.read(1, Aa._timeout, {
result: function(Wa) {
ab(oa, function() {
if (Wa && 0 == Wa.length)
return null;
if (Wa)
return ( Sa.reset(), Sa) ;
Da(Sa);
}, Aa);
},
timeout: function() {
oa.timeout();
},
error: function(Wa) {
ab(oa, function() {
var $a,
Va,
hb;
if (aa(Wa))
return null;
$a = Ga ? Ga.messageId : null;
if (Wa instanceof Pb) {
Va = V.MSL_COMMS_FAILURE;
hb = Wa;
} else
(Va = V.INTERNAL_EXCEPTION,
hb = new ub("Error peeking into the message payloads."));
ia(this, this._ctx, this._msgCtx.getDebugContext(), $a, Va, null, this._output, this._timeout, {
result: function(kb) {
oa.error(hb);
},
timeout: function() {
oa.timeout();
},
error: function(kb) {
ab(oa, function() {
if (aa(kb))
return null;
throw new cc("Error peeking into the message payloads.", kb, Wa);
}, Aa);
}
});
}, Aa);
}
});
}, Aa);
}
function Da(Sa) {
ab(oa, function() {
Sa.close();
this._ctrl.buildResponse(this, this._ctx, this._msgCtx, Sa.messageHeader, this._timeout, {
result: function(Ga) {
ab(oa, function() {
var Wa,
$a,
Va,
hb,
kb;
Wa = Ga.builder;
$a = Ga.tokenTicket;
Va = Sa.messageHeader;
hb = new ya(this._msgCtx);
if (!this._ctx.isPeerToPeer() || Va.isEncrypting() || Va.keyResponseData)
Ha(Va, Wa, hb, $a);
else {
kb = new La(this._ctrl, this._ctx, hb, null, this._input, this._output, Ga, 1, this._timeout);
this.setAbort(function() {
kb.abort();
});
kb.call(oa);
}
}, Aa);
},
timeout: function() {
oa.timeout();
},
error: function(Ga) {
ab(oa, function() {
var Wa,
$a,
Va,
hb;
if (aa(Ga))
return null;
if (Ga instanceof db) {
Wa = Ga.messageId;
$a = Ga.error;
Va = Sa.messageHeader.messageCapabilities;
Va = this._ctrl.messageRegistry.getUserMessage($a, Va ? Va.languages : null);
hb = Ga;
} else
(Wa = requestHeader ? requestHeader.messageId : null,
$a = V.INTERNAL_EXCEPTION,
Va = null,
hb = new ub("Error creating an automatic handshake response.", Ga));
ia(this, this._ctx, this._msgCtx.getDebugContext(), Wa, $a, Va, this._output, this._timeout, {
result: function(kb) {
oa.error(hb);
},
timeout: function() {
oa.timeout();
},
error: function(kb) {
ab(oa, function() {
if (aa(kb))
return null;
throw new cc("Error creating an automatic handshake response.", kb, Ga);
}, Aa);
}
});
}, Aa);
}
});
}, Aa);
}
function Ha(Sa, Ga, Wa, $a) {
ab(oa, function() {
Ga.setRenewable(!1);
this._ctrl.send(this._ctx, Wa, this._output, Ga, this._timeout, {
result: function(Va) {
ab(oa, function() {
this._ctx.isPeerToPeer() && this._ctrl.releaseMasterToken($a);
return null;
}, Aa);
},
timeout: function() {
ab(oa, function() {
this._ctx.isPeerToPeer() && this._ctrl.releaseMasterToken($a);
oa.timeout();
}, Aa);
},
error: function(Va) {
ab(oa, function() {
var hb,
kb,
nb,
pb;
this._ctx.isPeerToPeer() && this._ctrl.releaseMasterToken($a);
if (aa(Va))
return null;
if (Va instanceof db) {
hb = Va.messageId;
kb = Va.error;
nb = Sa ? Sa.messageCapabilities : null;
nb = this._ctrl.messageRegistry.getUserMessage(kb, nb ? nb.languages : null);
pb = Va;
} else
Va instanceof Pb ? (hb = Sa ? Sa.messageId : null, kb = V.MSL_COMMS_FAILURE, nb = null, pb = Va) : (hb = Sa ? Sa.messageId : null, kb = V.INTERNAL_EXCEPTION, nb = null, pb = new ub("Error sending an automatic handshake response.", Va));
ia(this, this._ctx, this._msgCtx.getDebugContext(), hb, kb, nb, this._output, this._timeout, {
result: function(qb) {
oa.error(pb);
},
timeout: function() {
oa.timeout();
},
error: function(qb) {
ab(oa, function() {
if (aa(qb))
return null;
throw new cc("Error sending an automatic handshake response.", qb, Va);
}, Aa);
}
});
}, Aa);
}
});
}, Aa);
}
Aa = this;
ab(oa, function() {
this._ctrl.receive(this, this._ctx, this._msgCtx, this._input, null, this._timeout, {
result: function(Sa) {
xa(Sa);
},
timeout: function() {
oa.timeout();
},
error: function(Sa) {
ab(oa, function() {
var Ga,
Wa,
$a,
Va;
if (aa(Sa))
return null;
if (Sa instanceof db) {
Ga = Sa.messageId;
Wa = Sa.error;
$a = this._ctrl.messageRegistry.getUserMessage(Wa, null);
Va = Sa;
} else
(Ga = null,
Wa = V.INTERNAL_EXCEPTION,
$a = null,
Va = new ub("Error receiving the message header.", Sa));
ia(this, this._ctx, this._msgCtx.getDebugContext(), Ga, Wa, $a, this._output, this._timeout, {
result: function(hb) {
oa.error(Va);
},
timeout: function() {
oa.timeout();
},
error: function(hb) {
ab(oa, function() {
if (aa(hb))
return null;
throw new cc("Error receiving the message header.", hb, Sa);
}, Aa);
}
});
}, Aa);
}
});
}, Aa);
}
});
ka = zb.Class.create({
init: function(oa, xa, Da, Ha, Aa, Sa, Ga) {
Object.defineProperties(this, {
_ctrl: {
value: oa,
writable: !1,
enumerable: !1,
configurable: !1
},
_ctx: {
value: xa,
writable: !1,
enumerable: !1,
configurable: !1
},
_msgCtx: {
value: Da,
writable: !1,
enumerable: !1,
configurable: !1
},
_input: {
value: Ha,
writable: !1,
enumerable: !1,
configurable: !1
},
_output: {
value: Aa,
writable: !1,
enumerable: !1,
configurable: !1
},
_request: {
value: Sa,
writable: !1,
enumerable: !1,
configurable: !1
},
_timeout: {
value: Ga,
writable: !1,
enumerable: !1,
configurable: !1
},
_aborted: {
value: !1,
writable: !0,
enumerable: !1,
configurable: !1
},
_abortFunc: {
value: yb,
writable: !0,
enumerable: !1,
configurable: !1
}
});
},
isAborted: function() {
return this._aborted;
},
abort: function() {
this._aborted = !0;
this._abortFunc && this._abortFunc.call(this);
},
setAbort: function(oa) {
this._abortFunc = oa;
},
trustedNetworkExecute: function(oa, xa, Da) {
var Ha;
Ha = this;
ab(Da, function() {
var Aa,
Sa;
if (12 < xa + 1)
return !1;
if (Aa = this._msgCtx.isIntegrityProtected() && !oa.willIntegrityProtectHeader() ? V.RESPONSE_REQUIRES_INTEGRITY_PROTECTION : this._msgCtx.isEncrypted() && !oa.willEncryptPayloads() ? V.RESPONSE_REQUIRES_ENCRYPTION : null) {
Sa = Nc(oa.getMessageId());
ia(this, this._ctx, this._msgCtx.getDebugContext(), Sa, Aa, null, this._output, this._timeout, {
result: function(Ga) {
Da.result(!1);
},
timeout: function() {
Da.timeout();
},
error: function(Ga) {
ab(Da, function() {
if (aa(Ga))
return !1;
throw new cc("Response requires encryption or integrity protection but cannot be protected: " + Aa, Ga, null);
}, Ha);
}
});
} else
!this._msgCtx.getCustomer() || oa.getMasterToken() || oa.getKeyExchangeData() ? (oa.setRenewable(!1), this._ctrl.send(this._ctx, this._msgCtx, this._output, oa, this._timeout, {
result: function(Ga) {
Da.result(!0);
},
timeout: function() {
Da.timeout();
},
error: function(Ga) {
Da.error(Ga);
}
})) : (Sa = Nc(oa.getMessageId()), ia(this, this._ctx, this._msgCtx.getDebugContext(), Sa, V.RESPONSE_REQUIRES_MASTERTOKEN, null, this._output, this._timeout, {
result: function(Ga) {
Da.result(!1);
},
timeout: function() {
Da.timeout();
},
error: function(Ga) {
ab(Da, function() {
if (aa(Ga))
return !1;
throw new cc("Response wishes to attach a user ID token but there is no master token.", Ga, null);
}, Ha);
}
}));
}, Ha);
},
peerToPeerExecute: function(oa, xa, Da, Ha) {
var Sa;
function Aa(Ga) {
ab(Ha, function() {
var Wa;
Wa = Ga.response;
Wa.close();
Wa = Wa.getErrorHeader();
this._ctrl.cleanupContext(this._ctx, Ga.requestHeader, Wa);
this._ctrl.buildErrorResponse(this, this._ctx, oa, Ga, Wa, {
result: function($a) {
ab(Ha, function() {
var Va,
hb;
if (!$a)
return !1;
Va = $a.errorResult;
hb = $a.tokenTicket;
this.peerToPeerExecute(Va.msgCtx, Va.builder, Da, {
result: function(kb) {
ab(Ha, function() {
this._ctrl.releaseMasterToken(hb);
return kb;
}, Sa);
},
timeout: function() {
ab(Ha, function() {
this._ctrl.releaseMasterToken(hb);
Ha.timeout();
}, Sa);
},
error: function(kb) {
ab(Ha, function() {
this._ctrl.releaseMasterToken(hb);
throw kb;
}, Sa);
}
});
}, Sa);
}
});
}, Sa);
}
Sa = this;
ab(Ha, function() {
var Ga;
if (12 < Da + 2)
return !1;
if (null != oa.getCustomer() && null == xa.getPeerMasterToken() && null == xa.getKeyExchangeData()) {
Ga = Nc(xa.getMessageId());
ia(this, this._ctx, oa.getDebugContext(), Ga, V.RESPONSE_REQUIRES_MASTERTOKEN, null, this._output, this._timeout, {
result: function(Wa) {
Ha.result(!1);
},
timeout: function() {
Ha.timeout();
},
error: function(Wa) {
ab(Ha, function() {
if (aa(Wa))
return !1;
throw new cc("Response wishes to attach a user ID token but there is no master token.", Wa, null);
}, Sa);
}
});
} else
this._ctrl.sendReceive(this._ctx, oa, this._input, this._output, xa, this._timeout, !1, {
result: function(Wa) {
ab(Ha, function() {
var hb,
kb,
nb;
function $a() {
hb.read(32768, Sa._timeout, {
result: function(pb) {
ab(Ha, function() {
pb ? $a() : Va();
}, Sa);
},
timeout: function() {
Ha.timeout();
},
error: function(pb) {
Ha.error(pb);
}
});
}
function Va() {
ab(Ha, function() {
var pb;
pb = new pa(Wa.payloads, oa);
this._ctrl.buildResponse(this, this._ctx, pb, kb, this._timeout, {
result: function(qb) {
ab(Ha, function() {
var xb;
xb = qb.tokenTicket;
this.peerToPeerExecute(pb, qb.builder, Da, {
result: function(wb) {
ab(Ha, function() {
this._ctrl.releaseMasterToken(xb);
return wb;
}, Sa);
},
timeout: function() {
ab(Ha, function() {
this._ctrl.releaseMasterToken(xb);
Ha.timeout();
}, Sa);
},
error: function(wb) {
ab(Ha, function() {
this._ctrl.releaseMasterToken(xb);
throw wb;
}, Sa);
}
});
}, Sa);
},
timeout: function() {
Ha.timeout();
},
error: function(qb) {
Ha.error(qb);
}
});
}, Sa);
}
hb = Wa.response;
Da += 2;
if (!hb)
return !0;
kb = hb.getMessageHeader();
if (kb) {
nb = Wa.payloads;
nb = 0 < nb.length && 0 < nb[0].data.length;
if (Wa.handshake && nb)
$a();
else
return !0;
} else
Aa(Wa);
}, Sa);
},
timeout: function() {
Ha.timeout();
},
error: function(Wa) {
Ha.error(Wa);
}
});
}, Sa);
},
call: function(oa) {
var xa;
xa = this;
this._ctrl.buildResponse(this, this._ctx, this._msgCtx, this._request, this._timeout, {
result: function(Da) {
ab(oa, function() {
var Ha,
Aa;
Ha = Da.builder;
Aa = Da.tokenTicket;
this._ctx.isPeerToPeer() ? this.peerToPeerExecute(this._msgCtx, Ha, 3, {
result: function(Sa) {
ab(oa, function() {
this._ctx.isPeerToPeer() && this.releaseMasterToken(Aa);
return Sa;
}, xa);
},
timeout: function() {
ab(oa, function() {
this._ctx.isPeerToPeer() && this.releaseMasterToken(Aa);
oa.timeout();
}, xa);
},
error: function(Sa) {
ab(oa, function() {
var Ga,
Wa,
$a,
Va;
this._ctx.isPeerToPeer() && this.releaseMasterToken(Aa);
if (aa(Sa))
return !1;
Ga = Nc(Ha.getMessageId());
if (Sa instanceof db) {
Wa = Sa.error;
$a = this._request.messageCapabilities;
$a = this._ctrl.messageRegistry.getUserMessage(Wa, $a ? $a.languages : null);
Va = Sa;
} else
Sa instanceof Pb ? (Wa = V.MSL_COMMS_FAILURE, $a = null, Va = Sa) : (Wa = V.INTERNAL_EXCEPTION, $a = null, Va = new ub("Error sending the response.", Sa));
ia(this, this._ctx, this._msgCtx.getDebugContext(), Ga, Wa, $a, this._output, this._timeout, {
result: function(hb) {
oa.error(Va);
},
timeout: function() {
oa.timeout();
},
error: function(hb) {
ab(oa, function() {
if (aa(hb))
return !1;
throw new cc("Error sending the response.", hb, null);
}, xa);
}
});
}, xa);
}
}) : this.trustedNetworkExecute(Ha, 3, {
result: function(Sa) {
ab(oa, function() {
this._ctx.isPeerToPeer() && this.releaseMasterToken(Aa);
return Sa;
}, xa);
},
timeout: function() {
ab(oa, function() {
this._ctx.isPeerToPeer() && this.releaseMasterToken(Aa);
oa.timeout();
}, xa);
},
error: function(Sa) {
ab(oa, function() {
var Ga,
Wa,
$a,
Va;
this._ctx.isPeerToPeer() && this.releaseMasterToken(Aa);
if (aa(Sa))
return !1;
Ga = Nc(Ha.getMessageId());
if (Sa instanceof db) {
Wa = Sa.error;
$a = this._request.messageCapabilities;
$a = this._ctrl.messageRegistry.getUserMessage(Wa, $a ? $a.languages : null);
Va = Sa;
} else
Sa instanceof Pb ? (Wa = V.MSL_COMMS_FAILURE, $a = null, Va = Sa) : (Wa = V.INTERNAL_EXCEPTION, $a = null, Va = new ub("Error sending the response.", Sa));
ia(this, this._ctx, this._msgCtx.getDebugContext(), Ga, Wa, $a, this._output, this._timeout, {
result: function(hb) {
oa.error(Va);
},
timeout: function() {
oa.timeout();
},
error: function(hb) {
ab(oa, function() {
if (aa(hb))
return !1;
throw new cc("Error sending the response.", hb, null);
}, xa);
}
});
}, xa);
}
});
}, xa);
},
timeout: function() {
oa.timeout();
},
error: function(Da) {
ab(oa, function() {
var Ha,
Aa,
Sa,
Ga;
if (aa(Da))
return !1;
if (Da instanceof db) {
Ha = Da.messageId;
Aa = Da.error;
Sa = this._request.messageCapabilities;
Sa = this._ctrl.messageRegistry.getUserMessage(Aa, Sa ? Sa.languages : null);
Ga = Da;
} else
(Ha = null,
Aa = V.INTERNAL_EXCEPTION,
Sa = null,
Ga = new ub("Error building the response.", Da));
ia(this, this._ctx, this._msgCtx.getDebugContext(), Ha, Aa, Sa, this._output, this._timeout, {
result: function(Wa) {
oa.error(Ga);
},
timeout: function() {
oa.timeout();
},
error: function(Wa) {
ab(oa, function() {
if (aa(Wa))
return null;
throw new cc("Error building the response.", Wa, Da);
}, xa);
}
});
}, xa);
}
});
}
});
wa = zb.Class.create({
init: function(oa, xa, Da, Ha, Aa, Sa, Ga) {
Object.defineProperties(this, {
_ctrl: {
value: oa,
writable: !1,
enumerable: !1,
configurable: !1
},
_ctx: {
value: xa,
writable: !1,
enumerable: !1,
configurable: !1
},
_msgCtx: {
value: Da,
writable: !1,
enumerable: !1,
configurable: !1
},
_appError: {
value: Ha,
writable: !1,
enumerable: !1,
configurable: !1
},
_output: {
value: output,
writable: !1,
enumerable: !1,
configurable: !1
},
_request: {
value: Sa,
writable: !1,
enumerable: !1,
configurable: !1
},
_timeout: {
value: Ga,
writable: !1,
enumerable: !1,
configurable: !1
},
_aborted: {
value: !1,
writable: !0,
enumerable: !1,
configurable: !1
},
_abortFunc: {
value: yb,
writable: !0,
enumerable: !1,
configurable: !1
}
});
},
isAborted: function() {
return this._aborted;
},
abort: function() {
this._aborted = !0;
this._abortFunc && this._abortFunc.call(this);
},
setAbort: function(oa) {
this._abortFunc = oa;
},
call: function(oa) {
var xa;
xa = this;
ab(oa, function() {
var Da,
Ha;
if (this._appError == ENTITY_REJECTED)
Da = this._request.masterToken ? V.MASTERTOKEN_REJECTED_BY_APP : V.ENTITY_REJECTED_BY_APP;
else if (this._appError == USER_REJECTED)
Da = this._request.userIdToken ? V.USERIDTOKEN_REJECTED_BY_APP : V.USER_REJECTED_BY_APP;
else
throw new ub("Unhandled application error " + this._appError + ".");
Ha = this._request.messageCapabilities;
Ha = this._ctrl.messageRegistry.getUserMessage(Da, Ha ? Ha.languages : null);
ia(this, this._ctx, this._msgCtx.getDebugContext(), this._request.messageId, Da, Ha, this._output, this._timeout, {
result: function(Aa) {
oa.result(Aa);
},
timeout: oa.timeout,
error: function(Aa) {
ab(oa, function() {
if (aa(Aa))
return !1;
if (Aa instanceof db)
throw Aa;
throw new ub("Error building the error response.", Aa);
}, xa);
}
});
}, xa);
}
});
Qa = {
result: function() {},
timeout: function() {},
error: function() {}
};
La = zb.Class.create({
init: function(oa, xa, Da, Ha, Aa, Sa, Ga, Wa, $a) {
var Va;
if (Ga) {
Va = Ga.builder;
Ga = Ga.tokenTicket;
} else
Ga = Va = null;
Object.defineProperties(this, {
_ctrl: {
value: oa,
writable: !1,
enumerable: !1,
configurable: !1
},
_ctx: {
value: xa,
writable: !1,
enumerable: !1,
configurable: !1
},
_msgCtx: {
value: Da,
writable: !1,
enumerable: !1,
configurable: !1
},
_remoteEntity: {
value: Ha,
writable: !1,
enumerable: !1,
configurable: !1
},
_input: {
value: Aa,
writable: !0,
enumerable: !1,
configurable: !1
},
_output: {
value: Sa,
writable: !0,
enumerable: !1,
configurable: !1
},
_openedStreams: {
value: !1,
writable: !0,
enumerable: !1,
configurable: !1
},
_builder: {
value: Va,
writable: !0,
enumerable: !1,
configurable: !1
},
_tokenTicket: {
value: Ga,
writable: !0,
enumerable: !1,
configurable: !1
},
_timeout: {
value: $a,
writable: !1,
enumerable: !1,
configurable: !1
},
_msgCount: {
value: Wa,
writable: !1,
enumerable: !1,
configurable: !1
},
_aborted: {
value: !1,
writable: !0,
enumerable: !1,
configurable: !1
},
_abortFunc: {
value: yb,
writable: !0,
enumerable: !1,
configurable: !1
}
});
},
isAborted: function() {
return this._aborted;
},
abort: function() {
this._aborted = !0;
this._abortFunc && this._abortFunc.call(this);
},
setAbort: function(oa) {
this._abortFunc = oa;
},
execute: function(oa, xa, Da, Ha, Aa) {
var Wa;
function Sa($a) {
function Va(hb) {
ab(Aa, function() {
var kb;
kb = $a.response;
return hb ? hb : kb;
}, Wa);
}
ab(Aa, function() {
var hb,
kb;
hb = $a.response;
hb.close();
kb = hb.getErrorHeader();
this._ctrl.cleanupContext(this._ctx, $a.requestHeader, kb);
this._ctrl.buildErrorResponse(this, this._ctx, oa, $a, kb, Da, {
result: function(nb) {
ab(Aa, function() {
var pb,
qb,
xb,
wb;
if (!nb)
return hb;
pb = nb.errorResult;
qb = nb.tokenTicket;
xb = pb.builder;
pb = pb.msgCtx;
if (this._ctx.isPeerToPeer())
this.execute(pb, xb, this._timeout, Ha, {
result: function(r) {
ab(Aa, function() {
this._ctrl.releaseMasterToken(qb);
Va(r);
}, Wa);
},
timeout: function() {
ab(Aa, function() {
this._ctrl.releaseMasterToken(qb);
Aa.timeout();
}, Wa);
},
error: function(r) {
ab(Aa, function() {
this._ctrl.releaseMasterToken(qb);
Aa.error(r);
}, Wa);
}
});
else {
this._openedStreams && (this._input.close(), this._output.close(Da, Qa));
wb = new La(this._ctrl, this._ctx, pb, this._remoteEntity, null, null, {
builder: xb,
tokenTicket: qb
}, Ha, this._timeout);
this.setAbort(function() {
wb.abort();
});
wb.call({
result: function(r) {
Va(r);
},
timeout: function() {
Aa.timeout();
},
error: function(r) {
Aa.error(r);
}
});
}
}, Wa);
},
timeout: function() {
Aa.timeout();
},
error: function(nb) {
Aa.error(nb);
}
});
}, Wa);
}
function Ga($a) {
ab(Aa, function() {
var kb,
nb,
pb,
qb,
xb;
function Va() {
kb.read(32768, Wa._timeout, {
result: function(wb) {
wb ? Va() : hb();
},
timeout: function() {
Aa.timeout();
},
error: function(wb) {
Aa.error(wb);
}
});
}
function hb() {
ab(Aa, function() {
var wb;
wb = new pa($a.payloads, oa);
this._ctrl.buildResponse(this, this._ctx, oa, nb, Da, {
result: function(r) {
ab(Aa, function() {
var b;
b = r.tokenTicket;
this.execute(wb, r.builder, this._timeout, Ha, {
result: function(a) {
ab(Aa, function() {
this._ctrl.releaseMasterToken(b);
return a;
}, Wa);
},
timeout: function() {
ab(Aa, function() {
this._ctrl.releaseMasterToken(b);
Aa.timeout();
}, Wa);
},
error: function(a) {
ab(Aa, function() {
this._ctrl.releaseMasterToken(b);
throw a;
}, Wa);
}
});
}, Wa);
},
timeout: function() {
Aa.timeout();
},
error: function(r) {
Aa.error(r);
}
});
}, Wa);
}
kb = $a.response;
nb = kb.getMessageHeader();
pb = $a.payloads;
pb = 0 < pb.length && 0 < pb[0].data.length;
if (!this._ctx.isPeerToPeer()) {
if (!$a.handshake || !pb)
return kb;
this._openedStreams && (this._input.close(), this._output.close(Da, Qa));
qb = new pa($a.payloads, oa);
this._ctrl.buildResponse(this, this._ctx, oa, nb, Da, {
result: function(wb) {
ab(Aa, function() {
var r;
r = new La(this._ctrl, this._ctx, qb, this._remoteEntity, null, null, wb, Ha, this._timeout);
this.setAbort(function() {
r.abort();
});
r.call(Aa);
}, Wa);
},
timeout: function() {
Aa.timeout();
},
error: function(wb) {
Aa.error(wb);
}
});
} else if ($a.handshake && pb)
Va();
else if (0 < nb.keyRequestData.length) {
xb = new ya(oa);
this._ctrl.buildResponse(this, this._ctx, xb, nb, Da, {
result: function(wb) {
ab(Aa, function() {
var r,
b;
r = wb.builder;
b = wb.tokenTicket;
kb.mark();
kb.read(1, this._timeout, {
result: function(a) {
ab(Aa, function() {
function c() {
kb.read(32768, Wa._timeout, {
result: function(h) {
h ? c() : m();
},
timeout: function() {
Aa.timeout();
},
error: function(h) {
Aa.error(h);
}
});
}
function m() {
Wa.execute(xb, r, Wa._timeout, Ha, {
result: function(h) {
ab(Aa, function() {
this._ctrl.releaseMasterToken(b);
return h;
}, Wa);
},
timeout: function() {
ab(Aa, function() {
this._ctrl.releaseMasterToken(b);
Aa.timeout();
}, Wa);
},
error: function(h) {
ab(Aa, function() {
this._ctrl.releaseMasterToken(b);
throw h;
}, Wa);
}
});
}
if (a) {
if ((kb.reset(), 12 >= Ha + 1))
(r.setRenewable(!1),
this._ctrl.send(this, this._ctx, xb, this._output, r, this._timeout, {
result: function(h) {
ab(Aa, function() {
this.releaseMasterToken(b);
return kb;
}, Wa);
},
timeout: function() {
Aa.timeout();
},
error: function(h) {
Aa.error(h);
}
}));
else
return ( this.releaseMasterToken(b), kb) ;
} else
c();
}, Wa);
},
timeout: function() {
ab(Aa, function() {
this.releaseMasterToken(b);
Aa.timeout();
}, Wa);
},
error: function(a) {
ab(Aa, function() {
this.releaseMasterToken(b);
throw a;
}, Wa);
}
});
}, Wa);
},
timeout: function() {
Aa.timeout();
},
error: function(wb) {
Aa.error(wb);
}
});
}
}, Wa);
}
Wa = this;
ab(Aa, function() {
if (12 < Ha + 2)
return null;
this._ctrl.sendReceive(this, this._ctx, oa, this._input, this._output, xa, Da, !0, {
result: function($a) {
ab(Aa, function() {
var Va;
if (!$a)
return null;
Va = $a.response;
Ha += 2;
Va.getMessageHeader() ? Ga($a) : Sa($a);
}, Wa);
},
timeout: function() {
Aa.timeout();
},
error: function($a) {
Aa.error($a);
}
});
}, Wa);
},
call: function(oa) {
var Da;
function xa(Ha, Aa, Sa) {
ab(oa, function() {
this.execute(this._msgCtx, Ha, Sa, this._msgCount, {
result: function(Ga) {
ab(oa, function() {
this._ctrl.releaseMasterToken(Aa);
this._openedStreams && this._output.close(Sa, Qa);
Ga && Ga.closeSource(this._openedStreams);
return Ga;
}, Da);
},
timeout: function() {
ab(oa, function() {
this._ctrl.releaseMasterToken(Aa);
this._openedStreams && (this._output.close(Sa, Qa), this._input.close());
oa.timeout();
}, Da);
},
error: function(Ga) {
ab(oa, function() {
this._ctrl.releaseMasterToken(Aa);
this._openedStreams && (this._output.close(Sa, Qa), this._input.close());
if (aa(Ga))
return null;
throw Ga;
}, Da);
}
});
}, Da);
}
Da = this;
ab(oa, function() {
var Ha,
Aa,
Sa;
Ha = this._timeout;
if (!this._input || !this._output)
try {
this._remoteEntity.setTimeout(this._timeout);
Aa = Date.now();
Sa = this._remoteEntity.openConnection();
this._output = Sa.output;
this._input = Sa.input;
-1 != Ha && (Ha = this._timeout - (Date.now() - Aa));
this._openedStreams = !0;
} catch (Ga) {
this._builder && this._ctrl.releaseMasterToken(this._tokenTicket);
this._output && this._output.close(this._timeout, Qa);
this._input && this._input.close();
if (aa(Ga))
return null;
throw Ga;
}
this._builder ? xa(this._builder, this._tokenTicket, Ha) : this._ctrl.buildRequest(this, this._ctx, this._msgCtx, this._timeout, {
result: function(Ga) {
ab(oa, function() {
xa(Ga.builder, Ga.tokenTicket, Ha);
}, Da);
},
timeout: function() {
ab(oa, function() {
this._openedStreams && (this._output.close(this._timeout, Qa), this._input.close());
oa.timeout();
}, Da);
},
error: function(Ga) {
ab(oa, function() {
this._openedStreams && (this._output.close(this._timeout, Qa), this._input.close());
if (aa(Ga))
return null;
throw Ga;
}, Da);
}
});
}, Da);
}
});
})();
(function() {
Pd = zb.Class.create({
init: function(fa) {
Object.defineProperties(this, {
id: {
value: fa,
writable: !1,
configurable: !1
}
});
},
toJSON: function() {
var fa;
fa = {};
fa.id = this.id;
return fa;
},
equals: function(fa) {
return this === fa ? !0 : fa instanceof Pd ? this.id == fa.id : !1;
},
uniqueKey: function() {
return this.id;
}
});
Te = function(fa) {
var ba;
ba = fa.id;
if (!ba)
throw new Ab(V.JSON_PARSE_ERROR, JSON.stringify(fa));
return new Pd(ba);
};
})();
zb.Class.create({
isNewestMasterToken: function(fa, ba, W) {},
isMasterTokenRevoked: function(fa, ba) {},
acceptNonReplayableId: function(fa, ba, W, Z) {},
createMasterToken: function(fa, ba, W, Z, ea) {},
isMasterTokenRenewable: function(fa, ba, W) {},
renewMasterToken: function(fa, ba, W, Z, ea) {},
isUserIdTokenRevoked: function(fa, ba, W, Z) {},
createUserIdToken: function(fa, ba, W, Z) {},
renewUserIdToken: function(fa, ba, W, Z) {}
});
(function() {
function fa(ba, W, Z, ea) {
this.sessiondata = ba;
this.tokendata = W;
this.signature = Z;
this.verified = ea;
}
bc = zb.Class.create({
init: function(ba, W, Z, ea, aa, ia, ua, ra, la, pa, ya) {
var na;
na = this;
Ma(ya, function() {
var da,
ha,
ka,
wa,
Qa;
if (Z.getTime() < W.getTime())
throw new ub("Cannot construct a master token that expires before its renewal window opens.");
if (0 > ea || ea > Jb)
throw new ub("Sequence number " + ea + " is outside the valid range.");
if (0 > aa || aa > Jb)
throw new ub("Serial number " + aa + " is outside the valid range.");
da = Math.floor(W.getTime() / 1E3);
ha = Math.floor(Z.getTime() / 1E3);
if (pa)
ka = pa.sessiondata;
else {
wa = {};
ia && (wa.issuerdata = ia);
wa.identity = ua;
wa.encryptionkey = Bb(ra.toByteArray());
wa.hmackey = Bb(la.toByteArray());
ka = Xb(JSON.stringify(wa), Kb);
}
if (pa)
return ( Object.defineProperties(this, {
ctx: {
value: ba,
writable: !1,
enumerable: !1,
configurable: !1
},
renewalWindowSeconds: {
value: da,
writable: !1,
enumerable: !1,
configurable: !1
},
expirationSeconds: {
value: ha,
writable: !1,
enumerable: !1,
configurable: !1
},
sequenceNumber: {
value: ea,
writable: !1,
configurable: !1
},
serialNumber: {
value: aa,
writable: !1,
configurable: !1
},
issuerData: {
value: ia,
writable: !1,
configurable: !1
},
identity: {
value: ua,
writable: !1,
configurable: !1
},
encryptionKey: {
value: ra,
writable: !1,
configurable: !1
},
hmacKey: {
value: la,
writable: !1,
configurable: !1
},
sessiondata: {
value: ka,
writable: !1,
enumerable: !1,
configurable: !1
},
verified: {
value: pa.verified,
writable: !1,
enumerable: !1,
configurable: !1
},
tokendata: {
value: pa.tokendata,
writable: !1,
enumerable: !1,
configurable: !1
},
signature: {
value: pa.signature,
writable: !1,
enumerable: !1,
configurable: !1
}
}), this) ;
Qa = ba.getMslCryptoContext();
Qa.encrypt(ka, {
result: function(La) {
Ma(ya, function() {
var Pa,
Ra;
Pa = {};
Pa.renewalwindow = da;
Pa.expiration = ha;
Pa.sequencenumber = ea;
Pa.serialnumber = aa;
Pa.sessiondata = Bb(La);
Ra = Xb(JSON.stringify(Pa), Kb);
Qa.sign(Ra, {
result: function(oa) {
Ma(ya, function() {
Object.defineProperties(this, {
ctx: {
value: ba,
writable: !1,
enumerable: !1,
configurable: !1
},
renewalWindowSeconds: {
value: da,
writable: !1,
enumerable: !1,
configurable: !1
},
expirationSeconds: {
value: ha,
writable: !1,
enumerable: !1,
configurable: !1
},
sequenceNumber: {
value: ea,
writable: !1,
enumerable: !1,
configurable: !1
},
serialNumber: {
value: aa,
writable: !1,
enumerable: !1,
configurable: !1
},
issuerData: {
value: ia,
writable: !1,
configurable: !1
},
identity: {
value: ua,
writable: !1,
configurable: !1
},
encryptionKey: {
value: ra,
writable: !1,
configurable: !1
},
hmacKey: {
value: la,
writable: !1,
configurable: !1
},
sessiondata: {
value: ka,
writable: !1,
enumerable: !1,
configurable: !1
},
verified: {
value: !0,
writable: !1,
enumerable: !1,
configurable: !1
},
tokendata: {
value: Ra,
writable: !1,
enumerable: !1,
configurable: !1
},
signature: {
value: oa,
writable: !1,
enumerable: !1,
configurable: !1
}
});
return this;
}, na);
},
error: function(oa) {
ya.error(oa);
}
});
}, na);
},
error: function(La) {
ya.error(La);
}
});
}, this);
},
get renewalWindow() {
return new Date(1E3 * this.renewalWindowSeconds);
},
get expiration() {
return new Date(1E3 * this.expirationSeconds);
},
isDecrypted: function() {
return this.sessiondata ? !0 : !1;
},
isVerified: function() {
return this.verified;
},
isRenewable: function(ba) {
return this.isVerified() ? this.renewalWindow.getTime() <= this.ctx.getTime() : !0;
},
isExpired: function(ba) {
return this.isVerified() ? this.expiration.getTime() <= this.ctx.getTime() : !1;
},
isNewerThan: function(ba) {
var W;
if (this.sequenceNumber == ba.sequenceNumber)
return this.expiration > ba.expiration;
if (this.sequenceNumber > ba.sequenceNumber) {
W = this.sequenceNumber - Jb + 127;
return ba.sequenceNumber >= W;
}
W = ba.sequenceNumber - Jb + 127;
return this.sequenceNumber < W;
},
toJSON: function() {
var ba;
ba = {};
ba.tokendata = Bb(this.tokendata);
ba.signature = Bb(this.signature);
return ba;
},
equals: function(ba) {
return this === ba ? !0 : ba instanceof bc ? this.serialNumber == ba.serialNumber && this.sequenceNumber == ba.sequenceNumber && this.expiration.getTime() == ba.expiration.getTime() : !1;
},
uniqueKey: function() {
return this.serialNumber + ":" + this.sequenceNumber + this.expiration.getTime();
}
});
Wc = function(ba, W, Z) {
Ma(Z, function() {
var ea,
aa,
ia,
ua,
ra;
ea = ba.getMslCryptoContext();
aa = W.tokendata;
ia = W.signature;
if ("string" !== typeof aa || "string" !== typeof ia)
throw new Ab(V.JSON_PARSE_ERROR, "mastertoken " + JSON.stringify(W));
try {
ua = Fb(aa);
} catch (la) {
throw new db(V.MASTERTOKEN_TOKENDATA_INVALID, "mastertoken " + JSON.stringify(W), la);
}
if (!ua || 0 == ua.length)
throw new Ab(V.MASTERTOKEN_TOKENDATA_MISSING, "mastertoken " + JSON.stringify(W));
try {
ra = Fb(ia);
} catch (la) {
throw new db(V.MASTERTOKEN_SIGNATURE_INVALID, "mastertoken " + JSON.stringify(W), la);
}
ea.verify(ua, ra, {
result: function(la) {
Ma(Z, function() {
var pa,
ya,
na,
da,
ha,
ka,
wa,
Qa,
La,
Pa;
pa = Wb(ua, Kb);
try {
ya = JSON.parse(pa);
na = parseInt(ya.renewalwindow);
da = parseInt(ya.expiration);
ha = parseInt(ya.sequencenumber);
ka = parseInt(ya.serialnumber);
wa = ya.sessiondata;
} catch (Ra) {
if (Ra instanceof SyntaxError)
throw new Ab(V.MASTERTOKEN_TOKENDATA_PARSE_ERROR, "mastertokendata " + pa, Ra);
throw Ra;
}
if (!na || na != na || !da || da != da || "number" !== typeof ha || ha != ha || "number" !== typeof ka || ka != ka || "string" !== typeof wa)
throw new Ab(V.MASTERTOKEN_TOKENDATA_PARSE_ERROR, "mastertokendata " + pa);
if (da < na)
throw new db(V.MASTERTOKEN_EXPIRES_BEFORE_RENEWAL, "mastertokendata " + pa);
if (0 > ha || ha > Jb)
throw new db(V.MASTERTOKEN_SEQUENCE_NUMBER_OUT_OF_RANGE, "mastertokendata " + pa);
if (0 > ka || ka > Jb)
throw new db(V.MASTERTOKEN_SERIAL_NUMBER_OUT_OF_RANGE, "mastertokendata " + pa);
Qa = new Date(1E3 * na);
La = new Date(1E3 * da);
try {
Pa = Fb(wa);
} catch (Ra) {
throw new db(V.MASTERTOKEN_SESSIONDATA_INVALID, wa, Ra);
}
if (!Pa || 0 == Pa.length)
throw new db(V.MASTERTOKEN_SESSIONDATA_MISSING, wa);
la ? ea.decrypt(Pa, {
result: function(Ra) {
Ma(Z, function() {
var oa,
xa,
Da,
Ha,
Aa,
Sa;
oa = Wb(Ra, Kb);
try {
xa = JSON.parse(oa);
Da = xa.issuerdata;
Ha = xa.identity;
Aa = xa.encryptionkey;
Sa = xa.hmackey;
} catch (Ga) {
if (Ga instanceof SyntaxError)
throw new Ab(V.MASTERTOKEN_SESSIONDATA_PARSE_ERROR, "sessiondata " + oa, Ga);
throw Ga;
}
if (Da && "object" !== typeof Da || !Ha || "string" !== typeof Aa || "string" !== typeof Sa)
throw new Ab(V.MASTERTOKEN_SESSIONDATA_PARSE_ERROR, "sessiondata " + oa);
lc(Aa, gc, uc, {
result: function(Ga) {
lc(Sa, hc, Dc, {
result: function(Wa) {
Ma(Z, function() {
var $a;
$a = new fa(Ra, ua, ra, la);
new bc(ba, Qa, La, ha, ka, Da, Ha, Ga, Wa, $a, Z);
});
},
error: function(Wa) {
Z.error(new tb(V.MASTERTOKEN_KEY_CREATION_ERROR, Wa));
}
});
},
error: function(Ga) {
Z.error(new tb(V.MASTERTOKEN_KEY_CREATION_ERROR, Ga));
}
});
});
},
error: function(Ra) {
Z.error(Ra);
}
}) : (na = new fa(null, ua, ra, la), new bc(ba, Qa, La, ha, ka, null, null, null, null, na, Z));
});
},
error: function(la) {
Z.error(la);
}
});
});
};
})();
(function() {
function fa(ba, W, Z) {
this.tokendata = ba;
this.signature = W;
this.verified = Z;
}
Kc = zb.Class.create({
init: function(ba, W, Z, ea, aa, ia, ua, ra, la) {
var pa;
pa = this;
Ma(la, function() {
var ya,
na,
da,
ha,
ka,
wa,
Qa;
if (Z.getTime() < W.getTime())
throw new ub("Cannot construct a user ID token that expires before its renewal window opens.");
if (!ea)
throw new ub("Cannot construct a user ID token without a master token.");
if (0 > aa || aa > Jb)
throw new ub("Serial number " + aa + " is outside the valid range.");
ya = Math.floor(W.getTime() / 1E3);
na = Math.floor(Z.getTime() / 1E3);
da = ea.serialNumber;
if (ra) {
ha = ra.tokendata;
ka = ra.signature;
wa = ra.verified;
da = ea.serialNumber;
Object.defineProperties(this, {
ctx: {
value: ba,
writable: !1,
enumerable: !1,
configurable: !1
},
renewalWindowSeconds: {
value: ya,
writable: !1,
enumerable: !1,
configurable: !1
},
expirationSeconds: {
value: na,
writable: !1,
enumerable: !1,
configurable: !1
},
mtSerialNumber: {
value: da,
writable: !1,
configurable: !1
},
serialNumber: {
value: aa,
writable: !1,
configurable: !1
},
issuerData: {
value: ia,
writable: !1,
configurable: !1
},
customer: {
value: ua,
writable: !1,
configurable: !1
},
verified: {
value: wa,
writable: !1,
enumerable: !1,
configurable: !1
},
tokendata: {
value: ha,
writable: !1,
enumerable: !1,
configurable: !1
},
signature: {
value: ka,
writable: !1,
enumerable: !1,
configurable: !1
}
});
return this;
}
ha = {};
ia && (ha.issuerdata = ia);
ha.identity = ua;
ha = Xb(JSON.stringify(ha), Kb);
Qa = ba.getMslCryptoContext();
Qa.encrypt(ha, {
result: function(La) {
Ma(la, function() {
var Pa,
Ra;
Pa = {};
Pa.renewalwindow = ya;
Pa.expiration = na;
Pa.mtserialnumber = da;
Pa.serialnumber = aa;
Pa.userdata = Bb(La);
Ra = Xb(JSON.stringify(Pa), Kb);
Qa.sign(Ra, {
result: function(oa) {
Ma(la, function() {
Object.defineProperties(this, {
ctx: {
value: ba,
writable: !1,
enumerable: !1,
configurable: !1
},
renewalWindowSeconds: {
value: ya,
writable: !1,
enumerable: !1,
configurable: !1
},
expirationSeconds: {
value: na,
writable: !1,
enumerable: !1,
configurable: !1
},
mtSerialNumber: {
value: ea.serialNumber,
writable: !1,
configurable: !1
},
serialNumber: {
value: aa,
writable: !1,
configurable: !1
},
issuerData: {
value: ia,
writable: !1,
configurable: !1
},
customer: {
value: ua,
writable: !1,
configurable: !1
},
verified: {
value: !0,
writable: !1,
enumerable: !1,
configurable: !1
},
tokendata: {
value: Ra,
writable: !1,
enumerable: !1,
configurable: !1
},
signature: {
value: oa,
writable: !1,
enumerable: !1,
configurable: !1
}
});
return this;
}, pa);
},
error: function(oa) {
Ma(la, function() {
oa instanceof db && oa.setEntity(ea);
throw oa;
}, pa);
}
});
}, pa);
},
error: function(La) {
Ma(la, function() {
La instanceof db && La.setEntity(ea);
throw La;
}, pa);
}
});
}, this);
},
get renewalWindow() {
return new Date(1E3 * this.renewalWindowSeconds);
},
get expiration() {
return new Date(1E3 * this.expirationSeconds);
},
isVerified: function() {
return this.verified;
},
isDecrypted: function() {
return this.customer ? !0 : !1;
},
isRenewable: function() {
return this.renewalWindow.getTime() <= this.ctx.getTime();
},
isExpired: function() {
return this.expiration.getTime() <= this.ctx.getTime();
},
isBoundTo: function(ba) {
return ba && ba.serialNumber == this.mtSerialNumber;
},
toJSON: function() {
var ba;
ba = {};
ba.tokendata = Bb(this.tokendata);
ba.signature = Bb(this.signature);
return ba;
},
equals: function(ba) {
return this === ba ? !0 : ba instanceof Kc ? this.serialNumber == ba.serialNumber && this.mtSerialNumber == ba.mtSerialNumber : !1;
},
uniqueKey: function() {
return this.serialNumber + ":" + this.mtSerialNumber;
}
});
nd = function(ba, W, Z, ea) {
Ma(ea, function() {
var aa,
ia,
ua,
ra,
la;
aa = ba.getMslCryptoContext();
ia = W.tokendata;
ua = W.signature;
if ("string" !== typeof ia || "string" !== typeof ua)
throw new Ab(V.JSON_PARSE_ERROR, "useridtoken " + JSON.stringify(W)).setEntity(Z);
try {
ra = Fb(ia);
} catch (pa) {
throw new db(V.USERIDTOKEN_TOKENDATA_INVALID, "useridtoken " + JSON.stringify(W), pa).setEntity(Z);
}
if (!ra || 0 == ra.length)
throw new Ab(V.USERIDTOKEN_TOKENDATA_MISSING, "useridtoken " + JSON.stringify(W)).setEntity(Z);
try {
la = Fb(ua);
} catch (pa) {
throw new db(V.USERIDTOKEN_TOKENDATA_INVALID, "useridtoken " + JSON.stringify(W), pa).setEntity(Z);
}
aa.verify(ra, la, {
result: function(pa) {
Ma(ea, function() {
var ya,
na,
da,
ha,
ka,
wa,
Qa,
La,
Pa,
Ra;
ya = Wb(ra, Kb);
try {
na = JSON.parse(ya);
da = parseInt(na.renewalwindow);
ha = parseInt(na.expiration);
ka = parseInt(na.mtserialnumber);
wa = parseInt(na.serialnumber);
Qa = na.userdata;
} catch (oa) {
if (oa instanceof SyntaxError)
throw new Ab(V.USERIDTOKEN_TOKENDATA_PARSE_ERROR, "usertokendata " + ya, oa).setEntity(Z);
throw oa;
}
if (!da || da != da || !ha || ha != ha || "number" !== typeof ka || ka != ka || "number" !== typeof wa || wa != wa || "string" !== typeof Qa)
throw new Ab(V.USERIDTOKEN_TOKENDATA_PARSE_ERROR, "usertokendata " + ya).setEntity(Z);
if (ha < da)
throw new db(V.USERIDTOKEN_EXPIRES_BEFORE_RENEWAL, "mastertokendata " + ya).setEntity(Z);
if (0 > ka || ka > Jb)
throw new db(V.USERIDTOKEN_MASTERTOKEN_SERIAL_NUMBER_OUT_OF_RANGE, "usertokendata " + ya).setEntity(Z);
if (0 > wa || wa > Jb)
throw new db(V.USERIDTOKEN_SERIAL_NUMBER_OUT_OF_RANGE, "usertokendata " + ya).setEntity(Z);
La = new Date(1E3 * da);
Pa = new Date(1E3 * ha);
if (!Z || ka != Z.serialNumber)
throw new db(V.USERIDTOKEN_MASTERTOKEN_MISMATCH, "uit mtserialnumber " + ka + "; mt " + JSON.stringify(Z)).setEntity(Z);
try {
Ra = Fb(Qa);
} catch (oa) {
throw new db(V.USERIDTOKEN_USERDATA_INVALID, Qa, oa).setEntity(Z);
}
if (!Ra || 0 == Ra.length)
throw new db(V.USERIDTOKEN_USERDATA_MISSING, Qa).setEntity(Z);
pa ? aa.decrypt(Ra, {
result: function(oa) {
Ma(ea, function() {
var xa,
Da,
Ha,
Aa,
Sa;
xa = Wb(oa, Kb);
try {
Da = JSON.parse(xa);
Ha = Da.issuerdata;
Aa = Da.identity;
} catch (Ga) {
if (Ga instanceof SyntaxError)
throw new Ab(V.USERIDTOKEN_USERDATA_PARSE_ERROR, "userdata " + xa).setEntity(Z);
throw Ga;
}
if (Ha && "object" !== typeof Ha || "object" !== typeof Aa)
throw new Ab(V.USERIDTOKEN_USERDATA_PARSE_ERROR, "userdata " + xa).setEntity(Z);
try {
Sa = Te(Aa);
} catch (Ga) {
throw new db(V.USERIDTOKEN_IDENTITY_INVALID, "userdata " + xa, Ga).setEntity(Z);
}
Aa = new fa(ra, la, pa);
new Kc(ba, La, Pa, Z, wa, Ha, Sa, Aa, ea);
});
},
error: function(oa) {
Ma(ea, function() {
oa instanceof db && oa.setEntity(Z);
throw oa;
});
}
}) : (da = new fa(ra, la, pa), new Kc(ba, La, Pa, Z, wa, null, null, da, ea));
});
},
error: function(pa) {
Ma(ea, function() {
pa instanceof db && pa.setEntity(Z);
throw pa;
});
}
});
});
};
})();
(function() {
function fa(W, Z) {
var ea,
aa,
ia;
ea = W.tokendata;
if ("string" !== typeof ea)
throw new Ab(V.JSON_PARSE_ERROR, "servicetoken " + JSON.stringify(W));
try {
aa = Fb(ea);
} catch (ua) {
throw new db(V.SERVICETOKEN_TOKENDATA_INVALID, "servicetoken " + JSON.stringify(W), ua);
}
if (!aa || 0 == aa.length)
throw new Ab(V.SERVICETOKEN_TOKENDATA_MISSING, "servicetoken " + JSON.stringify(W));
try {
ia = JSON.parse(Wb(aa, Kb)).name;
} catch (ua) {
if (ua instanceof SyntaxError)
throw new Ab(V.JSON_PARSE_ERROR, "servicetoken " + JSON.stringify(W), ua);
throw ua;
}
if (!ia)
throw new Ab(V.JSON_PARSE_ERROR, "servicetoken " + JSON.stringify(W));
return Z[ia] ? Z[ia] : Z[""];
}
function ba(W, Z, ea) {
this.tokendata = W;
this.signature = Z;
this.verified = ea;
}
wc = zb.Class.create({
init: function(W, Z, ea, aa, ia, ua, ra, la, pa, ya) {
var na;
na = this;
Ma(ya, function() {
var da,
ha,
ka,
wa,
Qa;
if (aa && ia && !ia.isBoundTo(aa))
throw new ub("Cannot construct a service token bound to a master token and user ID token where the user ID token is not bound to the same master token.");
da = aa ? aa.serialNumber : -1;
ha = ia ? ia.serialNumber : -1;
if (pa)
return ( Qa = pa.tokendata, Object.defineProperties(this, {
ctx: {
value: W,
writable: !1,
enumerable: !1,
configurable: !1
},
name: {
value: Z,
writable: !1,
configurable: !1
},
mtSerialNumber: {
value: da,
writable: !1,
configurable: !1
},
uitSerialNumber: {
value: ha,
writable: !1,
configurable: !1
},
data: {
value: ea,
writable: !1,
configurable: !1
},
encrypted: {
value: ua,
writable: !1,
enumerable: !1,
configurable: !1
},
compressionAlgo: {
value: ra,
writable: !1,
configurable: !1
},
verified: {
value: pa.verified,
writable: !1,
enumerable: !1,
configurable: !1
},
tokendata: {
value: Qa,
writable: !1,
enumerable: !1,
configurable: !1
},
signature: {
value: pa.signature,
writable: !1,
enumerable: !1,
configurable: !1
}
}), this) ;
if (ra) {
ka = Od(ra, ea);
ka.length < ea.length || (ra = null, ka = ea);
} else
(ra = null,
ka = ea);
wa = {};
wa.name = Z;
-1 != da && (wa.mtserialnumber = da);
-1 != ha && (wa.uitserialnumber = ha);
wa.encrypted = ua;
ra && (wa.compressionalgo = ra);
if (ua && 0 < ka.length)
la.encrypt(ka, {
result: function(La) {
Ma(ya, function() {
var Pa;
wa.servicedata = Bb(La);
Pa = Xb(JSON.stringify(wa), Kb);
la.sign(Pa, {
result: function(Ra) {
Ma(ya, function() {
Object.defineProperties(this, {
ctx: {
value: W,
writable: !1,
enumerable: !1,
configurable: !1
},
name: {
value: Z,
writable: !1,
configurable: !1
},
mtSerialNumber: {
value: da,
writable: !1,
configurable: !1
},
uitSerialNumber: {
value: ha,
writable: !1,
configurable: !1
},
data: {
value: ea,
writable: !1,
configurable: !1
},
encrypted: {
value: ua,
writable: !1,
enumerable: !1,
configurable: !1
},
compressionAlgo: {
value: ra,
writable: !1,
configurable: !1
},
verified: {
value: !0,
writable: !1,
enumerable: !1,
configurable: !1
},
tokendata: {
value: Pa,
writable: !1,
enumerable: !1,
configurable: !1
},
signature: {
value: Ra,
writable: !1,
enumerable: !1,
configurable: !1
}
});
return this;
}, na);
},
error: function(Ra) {
Ma(ya, function() {
Ra instanceof db && (Ra.setEntity(aa), Ra.setUser(ia));
throw Ra;
});
}
});
}, na);
},
error: function(La) {
Ma(ya, function() {
La instanceof db && (La.setEntity(aa), La.setUser(ia));
throw La;
});
}
});
else {
wa.servicedata = Bb(ka);
Qa = Xb(JSON.stringify(wa), Kb);
la.sign(Qa, {
result: function(La) {
Ma(ya, function() {
Object.defineProperties(this, {
ctx: {
value: W,
writable: !1,
enumerable: !1,
configurable: !1
},
name: {
value: Z,
writable: !1,
configurable: !1
},
mtSerialNumber: {
value: da,
writable: !1,
configurable: !1
},
uitSerialNumber: {
value: ha,
writable: !1,
configurable: !1
},
data: {
value: ea,
writable: !1,
configurable: !1
},
encrypted: {
value: ua,
writable: !1,
enumerable: !1,
configurable: !1
},
compressionAlgo: {
value: ra,
writable: !1,
configurable: !1
},
verified: {
value: !0,
writable: !1,
enumerable: !1,
configurable: !1
},
tokendata: {
value: Qa,
writable: !1,
enumerable: !1,
configurable: !1
},
signature: {
value: La,
writable: !1,
enumerable: !1,
configurable: !1
}
});
return this;
}, na);
},
error: function(La) {
Ma(ya, function() {
La instanceof db && (La.setEntity(aa), La.setUser(ia));
throw La;
});
}
});
}
}, this);
},
isEncrypted: function() {
return this.encrypted;
},
isVerified: function() {
return this.verified;
},
isDecrypted: function() {
return this.data ? !0 : !1;
},
isDeleted: function() {
return this.data && 0 == this.data.length;
},
isMasterTokenBound: function() {
return -1 != this.mtSerialNumber;
},
isBoundTo: function(W) {
return W ? W instanceof bc ? W.serialNumber == this.mtSerialNumber : W instanceof Kc ? W.serialNumber == this.uitSerialNumber : !1 : !1;
},
isUserIdTokenBound: function() {
return -1 != this.uitSerialNumber;
},
isUnbound: function() {
return -1 == this.mtSerialNumber && -1 == this.uitSerialNumber;
},
toJSON: function() {
var W;
W = {};
W.tokendata = Bb(this.tokendata);
W.signature = Bb(this.signature);
return W;
},
equals: function(W) {
return this === W ? !0 : W instanceof wc ? this.name == W.name && this.mtSerialNumber == W.mtSerialNumber && this.uitSerialNumber == W.uitSerialNumber : !1;
},
uniqueKey: function() {
return this.name + ":" + this.mtSerialNumber + ":" + this.uitSerialNumber;
}
});
rc = function(W, Z, ea, aa, ia, ua, ra, la, pa) {
new wc(W, Z, ea, aa, ia, ua, ra, la, null, pa);
};
od = function(W, Z, ea, aa, ia, ua) {
Ma(ua, function() {
var ra,
la,
pa,
ya,
na,
da,
ha,
ka,
wa,
Qa,
La,
Pa,
Ra;
!ia || ia instanceof Lc || (ia = fa(Z, ia));
ra = Z.tokendata;
la = Z.signature;
if ("string" !== typeof ra || "string" !== typeof la)
throw new Ab(V.JSON_PARSE_ERROR, "servicetoken " + JSON.stringify(Z)).setEntity(ea).setEntity(aa);
try {
pa = Fb(ra);
} catch (oa) {
throw new db(V.SERVICETOKEN_TOKENDATA_INVALID, "servicetoken " + JSON.stringify(Z), oa).setEntity(ea).setEntity(aa);
}
if (!pa || 0 == pa.length)
throw new Ab(V.SERVICETOKEN_TOKENDATA_MISSING, "servicetoken " + JSON.stringify(Z)).setEntity(ea).setEntity(aa);
try {
ya = Fb(la);
} catch (oa) {
throw new db(V.SERVICETOKEN_SIGNATURE_INVALID, "servicetoken " + JSON.stringify(Z), oa).setEntity(ea).setEntity(aa);
}
na = Wb(pa, Kb);
try {
da = JSON.parse(na);
ha = da.name;
ka = da.mtserialnumber ? parseInt(da.mtserialnumber) : -1;
wa = da.uitserialnumber ? parseInt(da.uitserialnumber) : -1;
Qa = da.encrypted;
La = da.compressionalgo;
Pa = da.servicedata;
} catch (oa) {
if (oa instanceof SyntaxError)
throw new Ab(V.JSON_PARSE_ERROR, "servicetokendata " + na, oa).setEntity(ea).setEntity(aa);
throw oa;
}
if (!ha || "number" !== typeof ka || ka != ka || "number" !== typeof wa || wa != wa || "boolean" !== typeof Qa || La && "string" !== typeof La || "string" !== typeof Pa)
throw new Ab(V.JSON_PARSE_ERROR, "servicetokendata " + na).setEntity(ea).setEntity(aa);
if (da.mtserialnumber && 0 > ka || ka > Jb)
throw new db(V.SERVICETOKEN_MASTERTOKEN_SERIAL_NUMBER_OUT_OF_RANGE, "servicetokendata " + na).setEntity(ea).setEntity(aa);
if (da.uitserialnumber && 0 > wa || wa > Jb)
throw new db(V.SERVICETOKEN_USERIDTOKEN_SERIAL_NUMBER_OUT_OF_RANGE, "servicetokendata " + na).setEntity(ea).setEntity(aa);
if (-1 != ka && (!ea || ka != ea.serialNumber))
throw new db(V.SERVICETOKEN_MASTERTOKEN_MISMATCH, "st mtserialnumber " + ka + "; mt " + ea).setEntity(ea).setEntity(aa);
if (-1 != wa && (!aa || wa != aa.serialNumber))
throw new db(V.SERVICETOKEN_USERIDTOKEN_MISMATCH, "st uitserialnumber " + wa + "; uit " + aa).setEntity(ea).setEntity(aa);
Qa = !0 === Qa;
if (La) {
if (!Bc[La])
throw new db(V.UNIDENTIFIED_COMPRESSION, La);
Ra = La;
} else
Ra = null;
ia ? ia.verify(pa, ya, {
result: function(oa) {
Ma(ua, function() {
var xa,
Da;
if (oa) {
try {
xa = Fb(Pa);
} catch (Ha) {
throw new db(V.SERVICETOKEN_SERVICEDATA_INVALID, "servicetokendata " + na, Ha).setEntity(ea).setEntity(aa);
}
if (!xa || 0 != Pa.length && 0 == xa.length)
throw new db(V.SERVICETOKEN_SERVICEDATA_INVALID, "servicetokendata " + na).setEntity(ea).setEntity(aa);
if (Qa && 0 < xa.length)
ia.decrypt(xa, {
result: function(Ha) {
Ma(ua, function() {
var Aa,
Sa;
Aa = Ra ? pd(Ra, Ha) : Ha;
Sa = new ba(pa, ya, oa);
new wc(W, ha, Aa, -1 != ka ? ea : null, -1 != wa ? aa : null, Qa, Ra, ia, Sa, ua);
});
},
error: function(Ha) {
Ma(ua, function() {
Ha instanceof db && (Ha.setEntity(ea), Ha.setUser(aa));
throw Ha;
});
}
});
else {
xa = Ra ? pd(Ra, xa) : xa;
Da = new ba(pa, ya, oa);
new wc(W, ha, xa, -1 != ka ? ea : null, -1 != wa ? aa : null, Qa, Ra, ia, Da, ua);
}
} else
(xa = "" == Pa ? new Uint8Array(0) : null,
Da = new ba(pa, ya, oa),
new wc(W, ha, xa, -1 != ka ? ea : null, -1 != wa ? aa : null, Qa, Ra, ia, Da, ua));
});
},
error: function(oa) {
Ma(ua, function() {
oa instanceof db && (oa.setEntity(ea), oa.setUser(aa));
throw oa;
});
}
}) : (ra = "" == Pa ? new Uint8Array(0) : null, la = new ba(pa, ya, !1), new wc(W, ha, ra, -1 != ka ? ea : null, -1 != wa ? aa : null, Qa, Ra, ia, la, ua));
});
};
})();
xc = {
EMAIL_PASSWORD: "EMAIL_PASSWORD",
NETFLIXID: "NETFLIXID",
SSO: "SSO",
SWITCH_PROFILE: "SWITCH_PROFILE",
MDX: "MDX"
};
Object.freeze(xc);
(function() {
Rc = zb.Class.create({
init: function(fa) {
Object.defineProperties(this, {
scheme: {
value: fa,
writable: !1,
configurable: !1
}
});
},
getAuthData: function() {},
equals: function(fa) {
return this === fa ? !0 : fa instanceof Rc ? this.scheme == fa.scheme : !1;
},
toJSON: function() {
var fa;
fa = {};
fa.scheme = this.scheme;
fa.authdata = this.getAuthData();
return fa;
}
});
Ie = function(fa, ba, W, Z) {
Ma(Z, function() {
var ea,
aa,
ia;
ea = W.scheme;
aa = W.authdata;
if (!ea || !aa)
throw new Ab(V.JSON_PARSE_ERROR, "userauthdata " + JSON.stringify(W));
if (!xc[ea])
throw new tc(V.UNIDENTIFIED_USERAUTH_SCHEME, ea);
ia = fa.getUserAuthenticationFactory(ea);
if (!ia)
throw new tc(V.USERAUTH_FACTORY_NOT_FOUND, ea);
ia.createData(fa, ba, aa, Z);
});
};
})();
Ue = zb.Class.create({
init: function(fa) {
Object.defineProperties(this, {
scheme: {
value: fa,
writable: !1,
configurable: !1
}
});
},
createData: function(fa, ba, W, Z) {},
authenticate: function(fa, ba, W, Z) {}
});
(function() {
Zc = Rc.extend({
init: function Z(ba, W) {
Z.base.call(this, xc.NETFLIXID);
Object.defineProperties(this, {
netflixId: {
value: ba,
writable: !1,
configurable: !1
},
secureNetflixId: {
value: W,
writable: !1,
configurable: !1
}
});
},
getAuthData: function() {
var ba;
ba = {};
ba.netflixid = this.netflixId;
this.secureNetflixId && (ba.securenetflixid = this.secureNetflixId);
return ba;
},
equals: function Z(W) {
return this === W ? !0 : W instanceof Zc ? Z.base.call(this, W) && this.netflixId == W.netflixId && this.secureNetflixId == W.secureNetflixId : !1;
}
});
Ve = function(W) {
var Z,
ea;
Z = W.netflixid;
ea = W.securenetflixid;
if (!Z)
throw new Ab(V.JSON_PARSE_ERROR, "NetflixId authdata " + JSON.stringify(W));
return new Zc(Z, ea);
};
})();
vf = Ue.extend({
init: function ba() {
ba.base.call(this, xc.NETFLIXID);
},
createData: function(ba, W, Z, ea) {
Ma(ea, function() {
return Ve(Z);
});
},
authenticate: function(ba, W, Z, ea) {
if (!(Z instanceof Zc))
throw new ub("Incorrect authentication data type " + Z + ".");
ba = Z.secureNetflixId;
if (!Z.netflixId || !ba)
throw new tc(V.NETFLIXID_COOKIES_BLANK).setUser(Z);
throw new tc(V.UNSUPPORTED_USERAUTH_DATA, this.scheme).setUser(Z);
}
});
(function() {
$c = Rc.extend({
init: function ea(W, Z) {
ea.base.call(this, xc.EMAIL_PASSWORD);
Object.defineProperties(this, {
email: {
value: W,
writable: !1,
configurable: !1
},
password: {
value: Z,
writable: !1,
configurable: !1
}
});
},
getAuthData: function() {
var W;
W = {};
W.email = this.email;
W.password = this.password;
return W;
},
equals: function ea(Z) {
return this === Z ? !0 : Z instanceof $c ? ea.base.call(this, this, Z) && this.email == Z.email && this.password == Z.password : !1;
}
});
We = function(Z) {
var ea,
aa;
ea = Z.email;
aa = Z.password;
if (!ea || !aa)
throw new Ab(V.JSON_PARSE_ERROR, "email/password authdata " + JSON.stringify(Z));
return new $c(ea, aa);
};
})();
wf = Ue.extend({
init: function W() {
W.base.call(this, xc.EMAIL_PASSWORD);
},
createData: function(W, Z, ea, aa) {
Ma(aa, function() {
return We(ea);
});
},
authenticate: function(W, Z, ea, aa) {
if (!(ea instanceof $c))
throw new ub("Incorrect authentication data type " + ea + ".");
W = ea.password;
if (!ea.email || !W)
throw new tc(V.EMAILPASSWORD_BLANK).setUser(ea);
throw new tc(V.UNSUPPORTED_USERAUTH_DATA, this.scheme).setUser(ea);
}
});
Object.freeze({
ENTITY_REAUTH: Ea.ENTITY_REAUTH,
ENTITYDATA_REAUTH: Ea.ENTITYDATA_REAUTH
});
xf = zb.Class.create({
getTime: function() {},
getRandom: function() {},
isPeerToPeer: function() {},
getMessageCapabilities: function() {},
getEntityAuthenticationData: function(W, Z) {},
getMslCryptoContext: function() {},
getEntityAuthenticationFactory: function(W) {},
getUserAuthenticationFactory: function(W) {},
getTokenFactory: function() {},
getKeyExchangeFactory: function(W) {},
getKeyExchangeFactories: function() {},
getMslStore: function() {}
});
Xe = zb.Class.create({
setCryptoContext: function(W, Z) {},
getMasterToken: function() {},
getNonReplayableId: function(W) {},
getCryptoContext: function(W) {},
removeCryptoContext: function(W) {},
clearCryptoContexts: function() {},
addUserIdToken: function(W, Z) {},
getUserIdToken: function(W) {},
removeUserIdToken: function(W) {},
clearUserIdTokens: function() {},
addServiceTokens: function(W) {},
getServiceTokens: function(W, Z) {},
removeServiceTokens: function(W, Z, ea) {},
clearServiceTokens: function() {}
});
(function() {
var W;
W = Bc;
Od = function(Z, ea) {
var aa;
aa = {};
switch (Z) {
case W.LZW:
return ce(ea, aa);
case W.GZIP:
return gzip$compress(ea);
default:
throw new db(V.UNSUPPORTED_COMPRESSION, Z);
}
};
pd = function(Z, ea, aa) {
switch (Z) {
case W.LZW:
return de(ea);
case W.GZIP:
return gzip$uncompress(ea);
default:
throw new db(V.UNSUPPORTED_COMPRESSION, Z.name());
}
};
})();
Xe.extend({
setCryptoContext: function(W, Z) {},
getMasterToken: function() {
return null;
},
getNonReplayableId: function(W) {
return 1;
},
getCryptoContext: function(W) {
return null;
},
removeCryptoContext: function(W) {},
clearCryptoContexts: function() {},
addUserIdToken: function(W, Z) {},
getUserIdToken: function(W) {
return null;
},
removeUserIdToken: function(W) {},
clearUserIdTokens: function() {},
addServiceTokens: function(W) {},
getServiceTokens: function(W, Z) {
if (Z) {
if (!W)
throw new db(V.USERIDTOKEN_MASTERTOKEN_NULL);
if (!Z.isBoundTo(W))
throw new db(V.USERIDTOKEN_MASTERTOKEN_MISMATCH, "uit mtserialnumber " + Z.mtSerialNumber + "; mt " + W.serialNumber);
}
return [];
},
removeServiceTokens: function(W, Z, ea) {
if (ea && Z && !ea.isBoundTo(Z))
throw new db(V.USERIDTOKEN_MASTERTOKEN_MISMATCH, "uit mtserialnumber " + ea.masterTokenSerialNumber + "; mt " + Z.serialNumber);
},
clearServiceTokens: function() {}
});
(function() {
Ye = Xe.extend({
init: function Z() {
Z.base.call(this);
Object.defineProperties(this, {
masterTokens: {
value: {},
writable: !1,
enumerable: !1,
configurable: !1
},
cryptoContexts: {
value: {},
writable: !1,
enumerable: !1,
configurable: !1
},
userIdTokens: {
value: {},
writable: !1,
enumerable: !1,
configurable: !1
},
nonReplayableIds: {
value: {},
writable: !1,
enumerable: !1,
configurable: !1
},
unboundServiceTokens: {
value: {},
writable: !1,
enumerable: !1,
configurable: !1
},
mtServiceTokens: {
value: {},
writable: !1,
enumerable: !1,
configurable: !1
},
uitServiceTokens: {
value: {},
writable: !1,
enumerable: !1,
configurable: !1
}
});
},
setCryptoContext: function(Z, ea) {
var aa;
if (ea) {
aa = Z.uniqueKey();
this.masterTokens[aa] = Z;
this.cryptoContexts[aa] = ea;
} else
this.removeCryptoContext(Z);
},
getMasterToken: function() {
var Z,
ea,
aa;
Z = null;
for (ea in this.masterTokens) {
aa = this.masterTokens[ea];
if (!Z || aa.isNewerThan(Z))
Z = aa;
}
return Z;
},
getNonReplayableId: function(Z) {
var ea;
Z = Z.serialNumber;
ea = this.nonReplayableIds[Z] !== yb ? this.nonReplayableIds[Z] : 0;
if (0 > ea || ea > Jb)
throw new ub("Non-replayable ID " + ea + " is outside the valid range.");
ea = ea == Jb ? 0 : ea + 1;
return this.nonReplayableIds[Z] = ea;
},
getCryptoContext: function(Z) {
return this.cryptoContexts[Z.uniqueKey()];
},
removeCryptoContext: function(Z) {
var ea,
aa,
ia,
ua;
ea = Z.uniqueKey();
if (this.masterTokens[ea]) {
aa = Z.serialNumber;
for (ia in this.masterTokens) {
ua = this.masterTokens[ia];
if (!ua.equals(Z) && ua.serialNumber == aa) {
delete this.masterTokens[ea];
delete this.cryptoContexts[ea];
return;
}
}
Object.keys(this.userIdTokens).forEach(function(ra) {
ra = this.userIdTokens[ra];
ra.isBoundTo(Z) && this.removeUserIdToken(ra);
}, this);
try {
this.removeServiceTokens(null, Z, null);
} catch (ra) {
if (ra instanceof db)
throw new ub("Unexpected exception while removing master token bound service tokens.", ra);
throw ra;
}
delete this.nonReplayableIds[aa];
delete this.masterTokens[ea];
delete this.cryptoContexts[ea];
}
},
clearCryptoContexts: function() {
[this.masterTokens, this.cryptoContexts, this.nonReplayableIds, this.userIdTokens, this.uitServiceTokens, this.mtServiceTokens].forEach(function(Z) {
for (var ea in Z) {
delete Z[ea];
}
}, this);
},
addUserIdToken: function(Z, ea) {
var aa,
ia;
aa = !1;
for (ia in this.masterTokens) {
if (ea.isBoundTo(this.masterTokens[ia])) {
aa = !0;
break;
}
}
if (!aa)
throw new db(V.USERIDTOKEN_MASTERTOKEN_NOT_FOUND, "uit mtserialnumber " + ea.mtSerialNumber);
this.userIdTokens[Z] = ea;
},
getUserIdToken: function(Z) {
return this.userIdTokens[Z];
},
removeUserIdToken: function(Z) {
var ea,
aa,
ia;
ea = null;
for (aa in this.masterTokens) {
ia = this.masterTokens[aa];
if (Z.isBoundTo(ia)) {
ea = ia;
break;
}
}
Object.keys(this.userIdTokens).forEach(function(ua) {
if (this.userIdTokens[ua].equals(Z)) {
try {
this.removeServiceTokens(null, ea, Z);
} catch (ra) {
if (ra instanceof db)
throw new ub("Unexpected exception while removing user ID token bound service tokens.", ra);
throw ra;
}
delete this.userIdTokens[ua];
}
}, this);
},
clearUserIdTokens: function() {
for (var Z in this.userIdTokens) {
this.removeUserIdToken(this.userIdTokens[Z]);
}
},
addServiceTokens: function(Z) {
Z.forEach(function(ea) {
var aa,
ia;
if (ea.isMasterTokenBound()) {
aa = !1;
for (ia in this.masterTokens) {
if (ea.isBoundTo(this.masterTokens[ia])) {
aa = !0;
break;
}
}
if (!aa)
throw new db(V.SERVICETOKEN_MASTERTOKEN_NOT_FOUND, "st mtserialnumber " + ea.mtSerialNumber);
}
if (ea.isUserIdTokenBound()) {
aa = !1;
for (var ua in this.userIdTokens) {
if (ea.isBoundTo(this.userIdTokens[ua])) {
aa = !0;
break;
}
}
if (!aa)
throw new db(V.SERVICETOKEN_USERIDTOKEN_NOT_FOUND, "st uitserialnumber " + ea.uitSerialNumber);
}
}, this);
Z.forEach(function(ea) {
var aa;
if (ea.isUnbound())
this.unboundServiceTokens[ea.uniqueKey()] = ea;
else {
if (ea.isMasterTokenBound()) {
aa = this.mtServiceTokens[ea.mtSerialNumber];
aa || (aa = {});
aa[ea.uniqueKey()] = ea;
this.mtServiceTokens[ea.mtSerialNumber] = aa;
}
ea.isUserIdTokenBound() && ((aa = this.uitServiceTokens[ea.uitSerialNumber]) || (aa = {}), aa[ea.uniqueKey()] = ea, this.uitServiceTokens[ea.uitSerialNumber] = aa);
}
}, this);
},
getServiceTokens: function(Z, ea) {
var aa,
ia,
ua;
if (ea) {
if (!Z)
throw new db(V.USERIDTOKEN_MASTERTOKEN_NULL);
if (!ea.isBoundTo(Z))
throw new db(V.USERIDTOKEN_MASTERTOKEN_MISMATCH, "uit mtserialnumber " + ea.mtSerialNumber + "; mt " + Z.serialNumber);
}
aa = {};
for (ia in this.unboundServiceTokens) {
ua = this.unboundServiceTokens[ia];
aa[ua.uniqueKey()] = ua;
}
if (Z && (ia = this.mtServiceTokens[Z.serialNumber]))
for (var ra in ia) {
ua = ia[ra];
ua.isUserIdTokenBound() || (aa[ra] = ua);
}
if (ea && (ea = this.uitServiceTokens[ea.serialNumber]))
for (var la in ea) {
ra = ea[la];
ra.isBoundTo(Z) && (aa[la] = ra);
}
Z = [];
for (var pa in aa) {
Z.push(aa[pa]);
}
return Z;
},
removeServiceTokens: function(Z, ea, aa) {
var ia,
ua,
ra;
if (aa && ea && !aa.isBoundTo(ea))
throw new db(V.USERIDTOKEN_MASTERTOKEN_MISMATCH, "uit mtserialnumber " + aa.mtSerialNumber + "; mt " + ea.serialNumber);
!Z || ea || aa || Object.keys(this.unboundServiceTokens).forEach(function(la) {
this.unboundServiceTokens[la].name == Z && delete this.unboundServiceTokens[la];
}, this);
if (ea && !aa && (ia = this.mtServiceTokens[ea.serialNumber])) {
ra = Object.keys(ia);
ra.forEach(function(la) {
var pa;
pa = ia[la];
Z && pa.name != Z || delete ia[la];
}, this);
this.mtServiceTokens[ea.serialNumber] = ia;
}
aa && (ua = this.uitServiceTokens[aa.serialNumber]) && (ea = Object.keys(ua), ea.forEach(function(la) {
var pa;
pa = ua[la];
Z && pa.name != Z || delete ua[la];
}, this), this.uitServiceTokens[aa.serialNumber] = ua);
},
clearServiceTokens: function() {
[this.unboundServiceTokens, this.mtServiceTokens, this.uitServiceTokens].forEach(function(Z) {
for (var ea in Z) {
delete Z[ea];
}
}, this);
}
});
})();
sf.extend({
init: function Z() {
Z.base.call(this);
Object.defineProperties(this, {
_contextMap: {
value: {},
writable: !1,
enumerable: !1,
configurable: !1
}
});
},
addCryptoContext: function(Z, ea) {
ea && Z && Z.length && (Z = Bb(Z), this._contextMap[Z] = ea);
},
getCryptoContext: function(Z) {
return Z && Z.length ? (Z = Bb(Z), this._contextMap[Z] || null) : null;
},
removeCryptoContext: function(Z) {
Z && Z.length && (Z = Bb(Z), delete this._contextMap[Z]);
}
});
kf.extend({
init: function ra(ea, aa, ia, ua) {
ra.base.call(this, ea);
Object.defineProperties(this, {
_kde: {
value: aa,
writable: !1,
enumerable: !1,
configurable: !1
},
_kdh: {
value: ia,
writable: !1,
enumerable: !1,
configurable: !1
},
_kdw: {
value: ua,
writable: !1,
enumerable: !1,
configurable: !1
}
});
},
getCryptoContext: function(ea, aa) {
if (!(aa instanceof pc))
throw new ub("Incorrect authentication data type " + JSON.stringify(aa) + ".");
if (aa.identity != this.localIdentity)
throw new jc(V.ENTITY_NOT_FOUND, "mgk " + aa.identity);
return new jd(ea, this.localIdentity, this._kde, this._kdh, this._kdw);
}
});
lf.extend({
init: function la(aa, ia, ua, ra) {
la.base.call(this, aa);
Object.defineProperties(this, {
_kpe: {
value: ia,
writable: !1,
enumerable: !1,
configurable: !1
},
_kph: {
value: ua,
writable: !1,
enumerable: !1,
configurable: !1
},
_kpw: {
value: ra,
writable: !1,
enumerable: !1,
configurable: !1
}
});
},
getCryptoContext: function(aa, ia) {
if (!(ia instanceof qc))
throw new ub("Incorrect authentication data type " + JSON.stringify(ia) + ".");
if (ia.identity != this.localIdentity)
throw new jc(V.ENTITY_NOT_FOUND, "psk " + ia.identity);
return new jd(aa, this.localIdentity, this._kpe, this._kph, this._kpw);
}
});
zf = Ye.extend({
init: function na(ia, ua, ra, la, pa, ya) {
na.base.call(this);
this._log = ia;
this._esn = ua;
this._keyRequestData = ra;
this._createKeyRequestData = la;
this._systemKeyName = pa;
this._systemKeyWrapFormat = ya;
},
setCryptoContext: function pa(ua, ra, la) {
var ya;
ya = this;
ya._log.trace("Adding MasterToken", {
SequenceNumber: ua.sequenceNumber,
SerialNumber: ua.serialNumber,
Expiration: ua.expiration.getTime()
});
pa.base.call(this, ua, ra);
!la && (ua = ya._createKeyRequestData) && (ya._log.trace("Generating new keyx request data"), ua().then(function(na) {
ya._keyRequestData = na;
}, function(na) {
ya._log.error("Unable to generate new keyx request data", "" + na);
}));
},
addUserIdToken: function pa(ra, la) {
this._log.trace("Adding UserIdToken", {
UserId: ra,
SerialNumber: la.serialNumber,
MTSerialNumber: la.mtSerialNumber,
Expiration: la.expiration.getTime()
});
pa.base.call(this, ra, la);
},
addServiceTokens: function pa(la) {
pa.base.call(this, la.filter(function(ya) {
return !yf[ya.name];
}));
},
getUserIdTokenKeys: function() {
var la,
pa;
la = [];
for (pa in this.userIdTokens) {
la.push(pa);
}
return la;
},
rekeyUserIdToken: function(la, pa) {
this.userIdTokens[la] && (this.userIdTokens[pa] = this.userIdTokens[la], delete this.userIdTokens[la]);
},
getKeyRequestData: function() {
return this._keyRequestData;
},
getStoreState: function(la) {
var pa;
pa = this;
Ma(la, function() {
var ya;
ya = pa.getMasterToken();
ya ? pa.getKeysForStore(ya, {
result: function(na) {
Ma(la, function() {
var da,
ha,
ka;
da = pa.userIdTokens;
ha = Object.keys(da).map(function(wa) {
var Qa;
Qa = da[wa];
return {
userId: wa,
userIdTokenJSON: da[wa].toJSON(),
serviceTokenJSONList: pa.getServiceTokens(ya, Qa).map(df)
};
});
na.esn = pa._esn;
na.masterTokenJSON = ya.toJSON();
na.userList = ha;
ka = pa._keyRequestData.storeData;
ka && Object.keys(ka).forEach(function(wa) {
na[wa] = ka[wa];
});
return na;
});
},
timeout: la.timeout,
error: la.error
}) : la.result(null);
});
},
getKeysForStore: function(la, pa) {
var ya;
ya = this;
Ma(pa, function() {
var na;
na = ya.getCryptoContext(la);
na = {
encryptionKey: na.encryptionKey,
hmacKey: na.hmacKey
};
if (na.encryptionKey && na.hmacKey) {
if (ya._systemKeyWrapFormat)
ya.wrapKeysWithSystemKey(na, pa);
else
return na;
} else
throw new db(V.INTERNAL_EXCEPTION, "Unable to get CryptoContext keys");
});
},
wrapKeysWithSystemKey: function(la, pa) {
var ya;
ya = this;
Xd(this._systemKeyName, {
result: function(na) {
Ma(pa, function() {
var da,
ha,
ka,
wa;
da = la.encryptionKey;
ha = la.hmacKey;
ka = da[Oc];
wa = ha[Oc];
if (ka && wa)
return {
wrappedEncryptionKey: ka,
wrappedHmacKey: wa
};
Promise.resolve().then(function() {
return Promise.all([Ib.wrapKey(ya._systemKeyWrapFormat, da, na, na.algorithm), Ib.wrapKey(ya._systemKeyWrapFormat, ha, na, na.algorithm)]);
}).then(function(Qa) {
ka = Bb(Qa[0]);
da[Oc] = ka;
wa = Bb(Qa[1]);
ha[Oc] = wa;
pa.result({
wrappedEncryptionKey: ka,
wrappedHmacKey: wa
});
}).catch(function(Qa) {
pa.error(new db(V.INTERNAL_EXCEPTION, "Error wrapping key with SYSTEM key", Qa));
});
});
},
timeout: pa.timeout,
error: pa.error
});
},
unwrapKeysWithSystemKey: function(la, pa) {
var ya;
ya = this;
Xd(this._systemKeyName, {
result: function(na) {
Ma(pa, function() {
var da,
ha;
da = Fb(la.wrappedEncryptionKey);
ha = Fb(la.wrappedHmacKey);
Promise.resolve().then(function() {
return Promise.all([Ib.unwrapKey(ya._systemKeyWrapFormat, da, na, na.algorithm, gc, !1, uc), Ib.unwrapKey(ya._systemKeyWrapFormat, ha, na, na.algorithm, hc, !1, Dc)]);
}).then(function(ka) {
var wa;
wa = ka[0];
ka = ka[1];
wa[Oc] = la.wrappedEncryptionKey;
ka[Oc] = la.wrappedHmacKey;
pa.result({
encryptionKey: wa,
hmacKey: ka
});
}).catch(function(ka) {
pa.error(new db(V.INTERNAL_EXCEPTION, "Error unwrapping with SYSTEM key", ka));
});
});
},
timeout: pa.timeout,
error: pa.error
});
},
loadStoreState: function(la, pa, ya, na) {
var ka,
wa;
function da(Qa, La) {
var Pa;
try {
Pa = ya.userList.slice();
} catch (Ra) {}
Pa ? (function oa() {
var xa;
xa = Pa.shift();
xa ? nd(pa, xa.userIdTokenJSON, Qa, {
result: function(Da) {
try {
ka.addUserIdToken(xa.userId, Da);
ha(Qa, Da, xa.serviceTokenJSONList, {
result: oa,
timeout: oa,
error: oa
});
} catch (Ha) {
oa();
}
},
timeout: oa,
error: oa
}) : La.result();
})() : La.result();
}
function ha(Qa, La, Pa, Ra) {
var oa,
xa;
try {
oa = Pa.slice();
} catch (Da) {}
if (oa) {
xa = ka.getCryptoContext(Qa);
(function Ha() {
var Aa;
Aa = oa.shift();
Aa ? od(pa, Aa, Qa, La, xa, {
result: function(Sa) {
ka.addServiceTokens([Sa]);
Ha();
},
timeout: function() {
Ha();
},
error: function() {
Ha();
}
}) : Ra.result();
})();
} else
Ra.result();
}
ka = this;
wa = ka._log;
ya.esn != ka._esn ? (wa.error("Esn mismatch, starting fresh"), na.error()) : (function(Qa) {
var Ra,
oa,
xa,
Da;
function La() {
var Ha;
if (!Ra && oa && xa && Da) {
Ra = !0;
Ha = new ec(pa, oa, la.esn, {
rawKey: xa
}, {
rawKey: Da
});
ka.setCryptoContext(oa, Ha, !0);
Qa.result(oa);
}
}
function Pa(Ha, Aa) {
wa.error(Ha, Aa && "" + Aa);
Ra || (Ra = !0, Qa.error());
}
ya.masterTokenJSON ? (Wc(pa, ya.masterTokenJSON, {
result: function(Ha) {
oa = Ha;
La();
},
timeout: function() {
Pa("Timeout parsing MasterToken");
},
error: function(Ha) {
Pa("Error parsing MasterToken", Ha);
}
}), ka._systemKeyWrapFormat ? ka.unwrapKeysWithSystemKey(ya, {
result: function(Ha) {
xa = Ha.encryptionKey;
Da = Ha.hmacKey;
La();
},
timeout: function() {
Pa("Timeout unwrapping keys");
},
error: function(Ha) {
Pa("Error unwrapping keys", Ha);
}
}) : Promise.resolve().then(function() {
return Ib.encrypt({
name: gc.name,
iv: new Uint8Array(16)
}, ya.encryptionKey, new Uint8Array(1));
}).then(function(Ha) {
xa = ya.encryptionKey;
}).catch(function(Ha) {
Pa("Error loading encryptionKey");
}).then(function() {
return Ib.sign(hc, ya.hmacKey, new Uint8Array(1));
}).then(function(Ha) {
Da = ya.hmacKey;
La();
}).catch(function(Ha) {
Pa("Error loading hmacKey");
})) : Pa("Persisted store is corrupt");
})({
result: function(Qa) {
da(Qa, na);
},
timeout: na.timeout,
error: na.error
});
}
});
yf = {
"streaming.servicetokens.movie": !0,
"streaming.servicetokens.license": !0
};
Oc = "$netflix$msl$wrapsys";
Af = xf.extend({
init: function(la, pa, ya, na, da, ha) {
var ka,
wa;
ka = new Xc([Bc.LZW]);
wa = new nf();
wa.addPublicKey(pa, ya);
na[Nb.RSA] = new mf(wa);
pa = {};
pa[xc.EMAIL_PASSWORD] = new wf();
pa[xc.NETFLIXID] = new vf();
la = {
_mslCryptoContext: {
value: new jf(),
writable: !0,
enumerable: !1,
configurable: !1
},
_capabilities: {
value: ka,
writable: !1,
enumerable: !1,
configurable: !1
},
_entityAuthData: {
value: da,
writable: !0,
enumerable: !1,
configurable: !1
},
_entityAuthFactories: {
value: na,
writable: !1,
enumerable: !1,
configurable: !1
},
_userAuthFactories: {
value: pa,
writable: !1,
enumerable: !1,
configurable: !1
},
_keyExchangeFactories: {
value: ha,
writable: !1,
enumerable: !1,
configurable: !1
},
_store: {
value: la,
writable: !1,
enumerable: !1,
configurable: !1
}
};
Object.defineProperties(this, la);
},
getTime: function() {
return Date.now();
},
getRandom: function() {
return new he();
},
isPeerToPeer: function() {
return !1;
},
getMessageCapabilities: function() {
return this._capabilities;
},
getEntityAuthenticationData: function(la, pa) {
pa.result(this._entityAuthData);
},
getMslCryptoContext: function() {
return this._mslCryptoContext;
},
getEntityAuthenticationFactory: function(la) {
return this._entityAuthFactories[la];
},
getUserAuthenticationFactory: function(la) {
return this._userAuthFactories[la];
},
getTokenFactory: function() {
return null;
},
getKeyExchangeFactory: function(la) {
return this._keyExchangeFactories.filter(function(pa) {
return pa.scheme == la;
})[0];
},
getKeyExchangeFactories: function() {
return this._keyExchangeFactories;
},
getMslStore: function() {
return this._store;
}
});
Zd = Re.extend({
init: function(la, pa, ya, na) {
this._log = la;
this._mslContext = pa;
this._mslRequest = ya;
this._keyRequestData = na;
},
getCryptoContexts: function() {
return {};
},
isEncrypted: function() {
return !!this._mslRequest.encrypted;
},
isNonReplayable: function() {
return !!this._mslRequest.nonReplayable;
},
isRequestingTokens: function() {
return !0;
},
getUserId: function() {
return this._mslRequest.profileGuid || this._mslRequest.userId || null;
},
getUserAuthData: function(la, pa, ya, na) {
var da;
da = this._mslRequest;
Ma(na, function() {
return la || !da.shouldSendUserAuthData ? null : da.email ? new $c(da.email, da.password) : da.useNetflixUserAuthData || ya && da.sendUserAuthIfRequired ? new Zc() : null;
});
},
getCustomer: function() {
return null;
},
getKeyRequestData: function(la) {
la.result(this._mslRequest.allowTokenRefresh ? [this._keyRequestData] : []);
},
updateServiceTokens: function(la, pa, ya) {
var na,
da,
ha,
ka,
wa,
Qa;
na = this._log;
da = (this._mslRequest.serviceTokens || []).slice();
ha = this._mslContext;
pa = ha.getMslStore();
ka = la.builder.getMasterToken();
wa = this.getUserId();
Qa = pa.getUserIdToken(wa);
(function Pa() {
var Ra;
Ra = da.shift();
if (Ra)
try {
Ra instanceof wc ? (la.addPrimaryServiceToken(Ra), Pa()) : od(ha, Ra, ka, Qa, null, {
result: function(oa) {
try {
la.addPrimaryServiceToken(oa);
} catch (xa) {
na.warn("Exception adding service token", "" + xa);
}
Pa();
},
timeout: function() {
na.warn("Timeout parsing service token");
Pa();
},
error: function(oa) {
na.warn("Error parsing service token", "" + oa);
Pa();
}
});
} catch (oa) {
na.warn("Exception processing service token", "" + oa);
Pa();
}
else
ya.result(!0);
})();
},
write: function(la, pa, ya) {
var na;
na = Xb(this._mslRequest.body);
la.write(na, 0, na.length, pa, {
result: function(da) {
da != na.length ? ya.error(new Pb("Not all data was written to output.")) : la.flush(pa, {
result: function() {
ya.result(!0);
},
timeout: function() {
ya.timeout();
},
error: function(ha) {
ya.error(ha);
}
});
},
timeout: function() {
ya.timeout();
},
error: function(da) {
ya.error(da);
}
});
},
getDebugContext: function() {
this._dc || (this._dc = new Bf(this._log, this._mslRequest));
return this._dc;
}
});
Bf = uf.extend({
init: function(la, pa) {
this._log = la;
this._mslRequest = pa;
},
sentHeader: function(la) {
this._log.trace("Sent MSL header", Yd(this._mslRequest, la), la.serviceTokens && la.serviceTokens.map(ef).join("\n"));
},
receivedHeader: function(la) {
var pa,
ya;
pa = Yd(this._mslRequest, la);
ya = la.errorCode;
ya ? this._log.warn("Received MSL error header", pa, {
errorCode: ya,
errorMessage: la.errorMessage,
internalCode: la.internalCode
}) : this._log.trace("Received MSL header", pa);
}
});
Cf = {
JWK_RSA: function(la) {
return gf(la, {
name: "RSA-OAEP",
modulusLength: 2048,
publicExponent: new Uint8Array([1, 0, 1]),
hash: {
name: "SHA-1"
}
}, we.JWK_RSA);
}
};
mb.netflix = mb.netflix || ({});
mb.netflix.msl = {
createMslClient: function(la, pa) {
var ya,
na,
da,
ha,
ka;
ya = la.log;
ka = la.notifyMilestone || (function() {});
Promise.resolve().then(function() {
if (!(Mb && Mb.generateKey && Mb.importKey && Mb.unwrapKey))
throw new db(V.INTERNAL_EXCEPTION, "No WebCrypto");
Vb = Mb.generateKey({
name: "AES-CBC",
length: 128
}, !0, uc).then ? ed.V2014_02 : ed.LEGACY;
ka("mslisik");
return Ib.importKey("spki", la.serverIdentityKeyData, ie, !1, ["verify"]);
}).then(function(wa) {
return new Promise(function(Qa, La) {
Ac(wa, {
result: Qa,
error: function() {
La(new db(V.KEY_IMPORT_ERROR, "Unable to create server identity verification key"));
}
});
});
}).then(function(wa) {
na = wa;
if (wa = Cf.JWK_RSA)
return ( ka("mslcc"), wa(la)) ;
throw new db(V.INTERNAL_EXCEPTION, "Invalid authenticationType: JWK_RSA");
}).then(function(wa) {
var Qa;
da = new zf(ya, la.esn, wa.keyRequestData, wa.createKeyRequestData, la.authenticationKeyNames.s, la.systemKeyWrapFormat);
ha = new Af(da, la.serverIdentityId, na, wa.entityAuthFactories, wa.entityAuthData, wa.keyExchangeFactories);
Qa = la.storeState;
if (Qa)
return ( ka("mslss"), ya.info("Loading store state"), new Promise(function(La, Pa) {
da.loadStoreState(la, ha, Qa, {
result: La,
timeout: La,
error: La
});
})) ;
ya.info("No store state, starting fresh");
}).then(function() {
var wa;
wa = new Se();
ka("msldone");
pa.result(new ff(ya, wa, ha, da, la.ErrorSubCodes));
}).catch(function(wa) {
pa.error(wa);
});
},
IHttpLocation: qf,
MslIoException: Pb
};
(function() {
var $a,
Va,
hb,
kb,
nb,
pb,
qb,
xb,
wb;
function la(r) {
var b;
b = 0;
return function() {
return b < r.length ? {
done: !1,
value: r[b++]
} : {
done: !0
};
};
}
function pa(r, b) {
var a,
m;
if (b)
a:
{
a = Va;
r = r.split(".");
for (var c = 0; c < r.length - 1; c++) {
m = r[c];
if (!((m in a)))
break a;
a = a[m];
}
r = r[r.length - 1];
c = a[r];
b = b(c);
b != c && null != b && $a(a, r, {
configurable: !0,
writable: !0,
value: b
});
}
}
function ya(r) {
r = {
next: r
};
r[Symbol.iterator] = function() {
return this;
};
return r;
}
function na(r) {
var b;
b = "undefined" != typeof Symbol && Symbol.iterator && r[Symbol.iterator];
return b ? b.call(r) : {
next: la(r)
};
}
function da(r) {
for (var b, a = []; !(b = r.next()).done;) {
a.push(b.value);
}
return a;
}
function ha(r) {
return r instanceof Array ? r : da(na(r));
}
function ka(r, b) {
var c;
r.prototype = hb(b.prototype);
r.prototype.constructor = r;
if (xb)
xb(r, b);
else
for (var a in b) {
if ("prototype" != a)
if (Object.defineProperties) {
c = Object.getOwnPropertyDescriptor(b, a);
c && Object.defineProperty(r, a, c);
} else
r[a] = b[a];
}
r.omc = b.prototype;
}
function wa() {
this.HX = !1;
this.sF = null;
this.nea = void 0;
this.sE = 1;
this.v0a = this.yBb = 0;
this.iU = null;
}
function Qa(r) {
if (r.HX)
throw new TypeError("Generator is already running");
r.HX = !0;
}
function La(r, b) {
r.sE = 2;
return {
value: b
};
}
function Pa(r) {
this.Jf = new wa();
this.I1b = r;
}
function Ra(r, b) {
var a;
Qa(r.Jf);
a = r.Jf.sF;
if (a)
return oa(r, ("return" in a) ? a["return"] : function(c) {
return {
value: c,
done: !0
};
}, b, r.Jf.return);
r.Jf.return(b);
return xa(r);
}
function oa(r, b, a, c) {
var m,
h;
try {
m = b.call(r.Jf.sF, a);
if (!(m instanceof Object))
throw new TypeError("Iterator result " + m + " is not an object");
if (!m.done)
return ( r.Jf.HX = !1, m) ;
h = m.value;
} catch (k) {
return ( r.Jf.sF = null, r.Jf.Y_(k), xa(r)) ;
}
r.Jf.sF = null;
c.call(r.Jf, h);
return xa(r);
}
function xa(r) {
var b;
for (; r.Jf.sE;) {
try {
b = r.I1b(r.Jf);
if (b)
return ( r.Jf.HX = !1, {
value: b.value,
done: !1
}) ;
} catch (a) {
r.Jf.nea = void 0;
r.Jf.Y_(a);
}
}
r.Jf.HX = !1;
if (r.Jf.iU) {
b = r.Jf.iU;
r.Jf.iU = null;
if (b.KSb)
throw b.RN;
return {
value: b.return,
done: !0
};
}
return {
value: void 0,
done: !0
};
}
function Da(r) {
this.next = function(b) {
return r.HY(b);
};
this.throw = function(b) {
return r.Y_(b);
};
this.return = function(b) {
return Ra(r, b);
};
this[Symbol.iterator] = function() {
return this;
};
}
function Ha(r, b) {
b = new Da(new Pa(b));
xb && r.prototype && xb(b, r.prototype);
return b;
}
function Aa(r, b) {
return Object.prototype.hasOwnProperty.call(r, b);
}
function Sa(r, b) {
var a,
c,
m;
r instanceof String && (r += "");
a = 0;
c = !1;
m = {
next: function() {
var h;
if (!c && a < r.length) {
h = a++;
return {
value: b(h, r[h]),
done: !1
};
}
c = !0;
return {
done: !0,
value: void 0
};
}
};
m[Symbol.iterator] = function() {
return m;
};
return m;
}
function Ga(r, b, a) {
var h;
r instanceof String && (r = String(r));
for (var c = r.length, m = 0; m < c; m++) {
h = r[m];
if (b.call(a, h, m, r))
return {
Jsa: m,
mF: h
};
}
return {
Jsa: -1,
mF: void 0
};
}
function Wa(r, b, a) {
if (null == r)
throw new TypeError("The 'this' value for String.prototype." + a + " must not be null or undefined");
if (b instanceof RegExp)
throw new TypeError("First argument to String.prototype." + a + " must not be a regular expression");
return r + "";
}
$a = "function" == typeof Object.defineProperties ? Object.defineProperty : function(r, b, a) {
if (r == Array.prototype || r == Object.prototype)
return r;
r[b] = a.value;
return r;
};
Va = (function(r) {
var a;
r = ["object" == typeof globalThis && globalThis, r, "object" == typeof mb && mb, "object" == typeof self && self, "object" == typeof global && global];
for (var b = 0; b < r.length; ++b) {
a = r[b];
if (a && a.Math == Math)
return a;
}
throw Error("Cannot find global object");
})(this);
pa("Symbol", function(r) {
var c;
function b(m) {
if (this instanceof b)
throw new TypeError("Symbol is not a constructor");
return new a("jscomp_symbol_" + (m || "") + "_" + c++, m);
}
function a(m, h) {
this.bjb = m;
$a(this, "description", {
configurable: !0,
writable: !0,
value: h
});
}
if (r)
return r;
a.prototype.toString = function() {
return this.bjb;
};
c = 0;
return b;
});
pa("Symbol.iterator", function(r) {
var c;
if (r)
return r;
r = Symbol("Symbol.iterator");
for (var b = ("Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array").split(" "), a = 0; a < b.length; a++) {
c = Va[b[a]];
"function" === typeof c && "function" != typeof c.prototype[r] && $a(c.prototype, r, {
configurable: !0,
writable: !0,
value: function() {
return ya(la(this));
}
});
}
return r;
});
hb = "function" == typeof Object.create ? Object.create : function(r) {
function b() {}
b.prototype = r;
return new b();
};
kb = (function() {
var b;
function r() {
function a() {}
new a();
Reflect.construct(a, [], function() {});
return new a() instanceof a;
}
if ("undefined" != typeof Reflect && Reflect.construct) {
if (r())
return Reflect.construct;
b = Reflect.construct;
return function(a, c, m) {
a = b(a, c);
m && Reflect.setPrototypeOf(a, m.prototype);
return a;
};
}
return function(a, c, m) {
void 0 === m && (m = a);
m = hb(m.prototype || Object.prototype);
return Function.prototype.apply.call(a, m, c) || m;
};
})();
if ("function" == typeof Object.setPrototypeOf)
nb = Object.setPrototypeOf;
else {
a:
{
pb = {
a: !0
};
qb = {};
try {
qb.__proto__ = pb;
nb = qb.a;
break a;
} catch (r) {}
nb = !1;
}nb = nb ? function(r, b) {
r.__proto__ = b;
if (r.__proto__ !== b)
throw new TypeError(r + " is not extensible");
return r;
} : null;
}
xb = nb;
wa.prototype.HY = function(r) {
this.nea = r;
};
wa.prototype.Y_ = function(r) {
this.iU = {
RN: r,
KSb: !0
};
this.sE = this.yBb || this.v0a;
};
wa.prototype.return = function(r) {
this.iU = {
return: r
};
this.sE = this.v0a;
};
Pa.prototype.HY = function(r) {
Qa(this.Jf);
if (this.Jf.sF)
return oa(this, this.Jf.sF.next, r, this.Jf.HY);
this.Jf.HY(r);
return xa(this);
};
Pa.prototype.Y_ = function(r) {
Qa(this.Jf);
if (this.Jf.sF)
return oa(this, this.Jf.sF["throw"], r, this.Jf.HY);
this.Jf.Y_(r);
return xa(this);
};
pa("Reflect", function(r) {
return r ? r : {};
});
pa("Reflect.construct", function() {
return kb;
});
pa("Reflect.setPrototypeOf", function(r) {
return r ? r : xb ? function(b, a) {
try {
return ( xb(b, a), !0) ;
} catch (c) {
return !1;
}
} : null;
});
pa("Object.setPrototypeOf", function(r) {
return r || xb;
});
wb = "function" == typeof Object.assign ? Object.assign : function(r, b) {
var c;
for (var a = 1; a < arguments.length; a++) {
c = arguments[a];
if (c)
for (var m in c) {
Aa(c, m) && (r[m] = c[m]);
}
}
return r;
};
pa("Object.assign", function(r) {
return r || wb;
});
pa("Promise", function(r) {
var m,
h;
function b(k) {
var d;
this.FQ = 0;
this.e_ = void 0;
this.uP = [];
this.Y5a = !1;
d = this.doa();
try {
k(d.resolve, d.reject);
} catch (f) {
d.reject(f);
}
}
function a() {
this.$C = null;
}
function c(k) {
return k instanceof b ? k : new b(function(d) {
d(k);
});
}
if (r)
return r;
a.prototype.zVa = function(k) {
var d;
if (null == this.$C) {
this.$C = [];
d = this;
this.AVa(function() {
d.VJb();
});
}
this.$C.push(k);
};
m = Va.setTimeout;
a.prototype.AVa = function(k) {
m(k, 0);
};
a.prototype.VJb = function() {
var k,
f;
for (; this.$C && this.$C.length;) {
k = this.$C;
this.$C = [];
for (var d = 0; d < k.length; ++d) {
f = k[d];
k[d] = null;
try {
f();
} catch (l) {
this.ozb(l);
}
}
}
this.$C = null;
};
a.prototype.ozb = function(k) {
this.AVa(function() {
throw k;
});
};
b.prototype.doa = function() {
var d,
f;
function k(l) {
return function(g) {
f || (f = !0, l.call(d, g));
};
}
d = this;
f = !1;
return {
resolve: k(this.d4b),
reject: k(this.iya)
};
};
b.prototype.d4b = function(k) {
var d;
if (k === this)
this.iya(new TypeError("A Promise cannot resolve to itself"));
else if (k instanceof b)
this.i6b(k);
else {
a:
switch (typeof k) {
case "object":
d = null != k;
break a;
case "function":
d = !0;
break a;
default:
d = !1;
}
d ? this.c4b(k) : this.n1a(k);
}
};
b.prototype.c4b = function(k) {
var d;
d = void 0;
try {
d = k.then;
} catch (f) {
this.iya(f);
return;
}
"function" == typeof d ? this.j6b(d, k) : this.n1a(k);
};
b.prototype.iya = function(k) {
this.web(2, k);
};
b.prototype.n1a = function(k) {
this.web(1, k);
};
b.prototype.web = function(k, d) {
if (0 != this.FQ)
throw Error("Cannot settle(" + k + ", " + d + "): Promise already settled in state" + this.FQ);
this.FQ = k;
this.e_ = d;
2 === this.FQ && this.N4b();
this.WJb();
};
b.prototype.N4b = function() {
var k;
k = this;
m(function() {
var d;
if (k.mYb()) {
d = Va.console;
"undefined" !== typeof d && d.error(k.e_);
}
}, 1);
};
b.prototype.mYb = function() {
var k,
d,
f;
if (this.Y5a)
return !1;
k = Va.CustomEvent;
d = Va.Event;
f = Va.dispatchEvent;
if ("undefined" === typeof f)
return !0;
"function" === typeof k ? k = new k("unhandledrejection", {
cancelable: !0
}) : "function" === typeof d ? k = new d("unhandledrejection", {
cancelable: !0
}) : (k = Va.document.createEvent("CustomEvent"), k.initCustomEvent("unhandledrejection", !1, !0, k));
k.promise = this;
k.reason = this.e_;
return f(k);
};
b.prototype.WJb = function() {
if (null != this.uP) {
for (var k = 0; k < this.uP.length; ++k) {
h.zVa(this.uP[k]);
}
this.uP = null;
}
};
h = new a();
b.prototype.i6b = function(k) {
var d;
d = this.doa();
k.z6(d.resolve, d.reject);
};
b.prototype.j6b = function(k, d) {
var f;
f = this.doa();
try {
k.call(d, f.resolve, f.reject);
} catch (l) {
f.reject(l);
}
};
b.prototype.then = function(k, d) {
var l,
g,
n;
function f(p, q) {
return "function" == typeof p ? function(t) {
try {
l(p(t));
} catch (u) {
g(u);
}
} : q;
}
n = new b(function(p, q) {
l = p;
g = q;
});
this.z6(f(k, l), f(d, g));
return n;
};
b.prototype.catch = function(k) {
return this.then(void 0, k);
};
b.prototype.z6 = function(k, d) {
var l;
function f() {
switch (l.FQ) {
case 1:
k(l.e_);
break;
case 2:
d(l.e_);
break;
default:
throw Error("Unexpected state: " + l.FQ);
}
}
l = this;
null == this.uP ? h.zVa(f) : this.uP.push(f);
this.Y5a = !0;
};
b.resolve = c;
b.reject = function(k) {
return new b(function(d, f) {
f(k);
});
};
b.race = function(k) {
return new b(function(d, f) {
for (var l = na(k), g = l.next(); !g.done; g = l.next()) {
c(g.value).z6(d, f);
}
});
};
b.all = function(k) {
var d,
f;
d = na(k);
f = d.next();
return f.done ? c([]) : new b(function(l, g) {
var p,
q;
function n(t) {
return function(u) {
p[t] = u;
q--;
0 == q && l(p);
};
}
p = [];
q = 0;
do {
p.push(void 0);
q++;
c(f.value).z6(n(p.length - 1), g);
f = d.next();
} while (!f.done);
});
};
return b;
});
pa("Array.prototype.keys", function(r) {
return r ? r : function() {
return Sa(this, function(b) {
return b;
});
};
});
pa("Array.prototype.find", function(r) {
return r ? r : function(b, a) {
return Ga(this, b, a).mF;
};
});
pa("Object.is", function(r) {
return r ? r : function(b, a) {
return b === a ? 0 !== b || 1 / b === 1 / a : b !== b && a !== a;
};
});
pa("Array.prototype.includes", function(r) {
return r ? r : function(b, a) {
var c,
m,
h;
c = this;
c instanceof String && (c = String(c));
m = c.length;
a = a || 0;
for (0 > a && (a = Math.max(a + m, 0)); a < m; a++) {
h = c[a];
if (h === b || Object.is(h, b))
return !0;
}
return !1;
};
});
pa("String.prototype.includes", function(r) {
return r ? r : function(b, a) {
return -1 !== Wa(this, b, "includes").indexOf(b, a || 0);
};
});
pa("Math.tanh", function(r) {
return r ? r : function(b) {
var a;
b = Number(b);
if (0 === b)
return b;
a = Math.exp(-2 * Math.abs(b));
a = (1 - a) / (1 + a);
return 0 > b ? -a : a;
};
});
pa("Number.isNaN", function(r) {
return r ? r : function(b) {
return "number" === typeof b && isNaN(b);
};
});
pa("WeakMap", function(r) {
var k,
d;
function b(f) {
this.oX = (d += Math.random() + 1).toString();
if (f) {
f = na(f);
for (var l; !(l = f.next()).done;) {
l = l.value;
this.set(l[0], l[1]);
}
}
}
function a() {}
function c(f) {
var l;
l = typeof f;
return "object" === l && null !== f || "function" === l;
}
function m(f) {
var l;
if (!Aa(f, k)) {
l = new a();
$a(f, k, {
value: l
});
}
}
function h(f) {
var l;
l = Object[f];
l && (Object[f] = function(g) {
if (g instanceof a)
return g;
Object.isExtensible(g) && m(g);
return l(g);
});
}
if ((function() {
var f,
l,
g;
if (!r || !Object.seal)
return !1;
try {
f = Object.seal({});
l = Object.seal({});
g = new r([[f, 2], [l, 3]]);
if (2 != g.get(f) || 3 != g.get(l))
return !1;
g.delete(f);
g.set(l, 4);
return !g.has(f) && 4 == g.get(l);
} catch (n) {
return !1;
}
})())
return r;
k = "$jscomp_hidden_" + Math.random();
h("freeze");
h("preventExtensions");
h("seal");
d = 0;
b.prototype.set = function(f, l) {
if (!c(f))
throw Error("Invalid WeakMap key");
m(f);
if (!Aa(f, k))
throw Error("WeakMap key fail: " + f);
f[k][this.oX] = l;
return this;
};
b.prototype.get = function(f) {
return c(f) && Aa(f, k) ? f[k][this.oX] : void 0;
};
b.prototype.has = function(f) {
return c(f) && Aa(f, k) && Aa(f[k], this.oX);
};
b.prototype.delete = function(f) {
return c(f) && Aa(f, k) && Aa(f[k], this.oX) ? delete f[k][this.oX] : !1;
};
return b;
});
pa("Map", function(r) {
var h,
k;
function b() {
var d;
d = {};
return d.Vp = d.next = d.head = d;
}
function a(d, f) {
var l;
l = d.yA;
return ya(function() {
if (l) {
for (; l.head != d.yA;) {
l = l.Vp;
}
for (; l.next != l.head;) {
return ( l = l.next, {
done: !1,
value: f(l)
}) ;
}
l = null;
}
return {
done: !0,
value: void 0
};
});
}
function c(d, f) {
var l,
g,
n;
l = f && typeof f;
"object" == l || "function" == l ? h.has(f) ? l = h.get(f) : (l = "" + ++k, h.set(f, l)) : l = "p_" + f;
g = d.$z[l];
if (g && Aa(d.$z, l))
for (d = 0; d < g.length; d++) {
n = g[d];
if (f !== f && n.key !== n.key || f === n.key)
return {
id: l,
list: g,
index: d,
entry: n
};
}
return {
id: l,
list: g,
index: -1,
entry: void 0
};
}
function m(d) {
this.$z = {};
this.yA = b();
this.size = 0;
if (d) {
d = na(d);
for (var f; !(f = d.next()).done;) {
f = f.value;
this.set(f[0], f[1]);
}
}
}
if ((function() {
var d,
f,
l,
g;
if (!r || "function" != typeof r || !r.prototype.entries || "function" != typeof Object.seal)
return !1;
try {
d = Object.seal({
x: 4
});
f = new r(na([[d, "s"]]));
if ("s" != f.get(d) || 1 != f.size || f.get({
x: 4
}) || f.set({
x: 4
}, "t") != f || 2 != f.size)
return !1;
l = f.entries();
g = l.next();
if (g.done || g.value[0] != d || "s" != g.value[1])
return !1;
g = l.next();
return g.done || 4 != g.value[0].x || "t" != g.value[1] || !l.next().done ? !1 : !0;
} catch (n) {
return !1;
}
})())
return r;
h = new WeakMap();
m.prototype.set = function(d, f) {
var l;
d = 0 === d ? 0 : d;
l = c(this, d);
l.list || (l.list = this.$z[l.id] = []);
l.entry ? l.entry.value = f : (l.entry = {
next: this.yA,
Vp: this.yA.Vp,
head: this.yA,
key: d,
value: f
}, l.list.push(l.entry), this.yA.Vp.next = l.entry, this.yA.Vp = l.entry, this.size++);
return this;
};
m.prototype.delete = function(d) {
d = c(this, d);
return d.entry && d.list ? (d.list.splice(d.index, 1), d.list.length || delete this.$z[d.id], d.entry.Vp.next = d.entry.next, d.entry.next.Vp = d.entry.Vp, d.entry.head = null, this.size--, !0) : !1;
};
m.prototype.clear = function() {
this.$z = {};
this.yA = this.yA.Vp = b();
this.size = 0;
};
m.prototype.has = function(d) {
return !!c(this, d).entry;
};
m.prototype.get = function(d) {
return (d = c(this, d).entry) && d.value;
};
m.prototype.entries = function() {
return a(this, function(d) {
return [d.key, d.value];
});
};
m.prototype.keys = function() {
return a(this, function(d) {
return d.key;
});
};
m.prototype.values = function() {
return a(this, function(d) {
return d.value;
});
};
m.prototype.forEach = function(d, f) {
for (var l = this.entries(), g; !(g = l.next()).done;) {
g = g.value;
d.call(f, g[1], g[0], this);
}
};
m.prototype[Symbol.iterator] = m.prototype.entries;
k = 0;
return m;
});
pa("Set", function(r) {
function b(a) {
this.Fx = new Map();
if (a) {
a = na(a);
for (var c; !(c = a.next()).done;) {
this.add(c.value);
}
}
this.size = this.Fx.size;
}
if ((function() {
var a,
c,
m,
h;
if (!r || "function" != typeof r || !r.prototype.entries || "function" != typeof Object.seal)
return !1;
try {
a = Object.seal({
x: 4
});
c = new r(na([a]));
if (!c.has(a) || 1 != c.size || c.add(a) != c || 1 != c.size || c.add({
x: 4
}) != c || 2 != c.size)
return !1;
m = c.entries();
h = m.next();
if (h.done || h.value[0] != a || h.value[1] != a)
return !1;
h = m.next();
return h.done || h.value[0] == a || 4 != h.value[0].x || h.value[1] != h.value[0] ? !1 : m.next().done;
} catch (k) {
return !1;
}
})())
return r;
b.prototype.add = function(a) {
a = 0 === a ? 0 : a;
this.Fx.set(a, a);
this.size = this.Fx.size;
return this;
};
b.prototype.delete = function(a) {
a = this.Fx.delete(a);
this.size = this.Fx.size;
return a;
};
b.prototype.clear = function() {
this.Fx.clear();
this.size = 0;
};
b.prototype.has = function(a) {
return this.Fx.has(a);
};
b.prototype.entries = function() {
return this.Fx.entries();
};
b.prototype.values = function() {
return this.Fx.values();
};
b.prototype.keys = b.prototype.values;
b.prototype[Symbol.iterator] = b.prototype.values;
b.prototype.forEach = function(a, c) {
var m;
m = this;
this.Fx.forEach(function(h) {
return a.call(c, h, h, m);
});
};
return b;
});
pa("Array.prototype.entries", function(r) {
return r ? r : function() {
return Sa(this, function(b, a) {
return [b, a];
});
};
});
pa("Object.entries", function(r) {
return r ? r : function(b) {
var a,
c;
a = [];
for (c in b) {
Aa(b, c) && a.push([c, b[c]]);
}
return a;
};
});
pa("Object.getOwnPropertySymbols", function(r) {
return r ? r : function() {
return [];
};
});
pa("Reflect.apply", function(r) {
var b;
if (r)
return r;
b = Function.prototype.apply;
return function(a, c, m) {
return b.call(a, c, m);
};
});
pa("Number.isFinite", function(r) {
return r ? r : function(b) {
return "number" !== typeof b ? !1 : !isNaN(b) && Infinity !== b && -Infinity !== b;
};
});
pa("String.prototype.endsWith", function(r) {
return r ? r : function(b, a) {
var c;
c = Wa(this, b, "endsWith");
b += "";
void 0 === a && (a = c.length);
a = Math.max(0, Math.min(a | 0, c.length));
for (var m = b.length; 0 < m && 0 < a;) {
if (c[--a] != b[--m])
return !1;
}
return 0 >= m;
};
});
pa("String.prototype.repeat", function(r) {
return r ? r : function(b) {
var a;
a = Wa(this, null, "repeat");
if (0 > b || 1342177279 < b)
throw new RangeError("Invalid count value");
b |= 0;
for (var c = ""; b;) {
if ((b & 1 && (c += a), b >>>= 1))
a += a;
}
return c;
};
});
pa("Array.prototype.values", function(r) {
return r ? r : function() {
return Sa(this, function(b, a) {
return a;
});
};
});
pa("Number.MAX_SAFE_INTEGER", function() {
return 9007199254740991;
});
pa("Array.from", function(r) {
return r ? r : function(b, a, c) {
var m,
h;
a = null != a ? a : function(d) {
return d;
};
m = [];
h = "undefined" != typeof Symbol && Symbol.iterator && b[Symbol.iterator];
if ("function" == typeof h) {
b = h.call(b);
for (var k = 0; !(h = b.next()).done;) {
m.push(a.call(c, h.value, k++));
}
} else
for ((h = b.length, k = 0); k < h; k++) {
m.push(a.call(c, b[k], k));
}
return m;
};
});
pa("Object.values", function(r) {
return r ? r : function(b) {
var a,
c;
a = [];
for (c in b) {
Aa(b, c) && a.push(b[c]);
}
return a;
};
});
pa("String.prototype.startsWith", function(r) {
return r ? r : function(b, a) {
var c,
m,
h;
c = Wa(this, b, "startsWith");
b += "";
m = c.length;
h = b.length;
a = Math.max(0, Math.min(a | 0, c.length));
for (var k = 0; k < h && a < m;) {
if (c[a++] != b[k++])
return !1;
}
return k >= h;
};
});
pa("Promise.prototype.finally", function(r) {
return r ? r : function(b) {
return this.then(function(a) {
return Promise.resolve(b()).then(function() {
return a;
});
}, function(a) {
return Promise.resolve(b()).then(function() {
throw a;
});
});
};
});
pa("Array.prototype.findIndex", function(r) {
return r ? r : function(b, a) {
return Ga(this, b, a).Jsa;
};
});
pa("String.fromCodePoint", function(r) {
return r ? r : function(b) {
var m;
for (var a = "", c = 0; c < arguments.length; c++) {
m = Number(arguments[c]);
if (0 > m || 1114111 < m || m !== Math.floor(m))
throw new RangeError("invalid_code_point " + m);
65535 >= m ? a += String.fromCharCode(m) : (m -= 65536, a += String.fromCharCode(m >>> 10 & 1023 | 55296), a += String.fromCharCode(m & 1023 | 56320));
}
return a;
};
});
pa("Number.parseInt", function(r) {
return r || parseInt;
});
(function(r) {
var a;
function b(c) {
var m;
if (a[c])
return a[c].exports;
m = a[c] = {
Jsa: c,
TTb: !1,
exports: {}
};
r[c].call(m.exports, m, m.exports, b);
m.TTb = !0;
return m.exports;
}
a = {};
b.bkc = r;
b.c = a;
b.d = function(c, m, h) {
b.zYb(c, m) || Object.defineProperty(c, m, {
enumerable: !0,
get: h
});
};
b.r = function(c) {
"undefined" !== typeof Symbol && Symbol.toStringTag && Object.defineProperty(c, Symbol.toStringTag, {
value: "Module"
});
Object.defineProperty(c, "__esModule", {
value: !0
});
};
b.t = function(c, m) {
var h;
m & 1 && (c = b(c));
if (m & 8 || m & 4 && "object" === typeof c && c && c.__esModule)
return c;
h = Object.create(null);
b.r(h);
Object.defineProperty(h, "default", {
enumerable: !0,
value: c
});
if (m & 2 && "string" != typeof c)
for (var k in c) {
b.d(h, k, (function(d) {
return c[d];
}).bind(null, k));
}
return h;
};
b.n = function(c) {
var m;
m = c && c.__esModule ? function() {
return c["default"];
} : function() {
return c;
};
b.d(m, "a", m);
return m;
};
b.zYb = function(c, m) {
return Object.prototype.hasOwnProperty.call(c, m);
};
b.p = "";
return b(b.x4b = 582);
})([function(r, b, a) {
var I,
O;
function c() {
c = Object.assign || (function(K) {
for (var H, R = 1, N = arguments.length; R < N; R++) {
H = arguments[R];
for (var J in H) {
Object.prototype.hasOwnProperty.call(H, J) && (K[J] = H[J]);
}
}
return K;
});
return c.apply(this, arguments);
}
function m(K, H) {
m = Object.setPrototypeOf || ({
__proto__: []
}) instanceof Array && (function(R, N) {
R.__proto__ = N;
}) || (function(R, N) {
for (var J in N) {
Object.prototype.hasOwnProperty.call(N, J) && (R[J] = N[J]);
}
});
return m(K, H);
}
function h(K, H) {
function R() {
this.constructor = K;
}
if ("function" !== typeof H && null !== H)
throw new TypeError("Class extends value " + String(H) + " is not a constructor or null");
m(K, H);
K.prototype = null === H ? Object.create(H) : (R.prototype = H.prototype, new R());
}
function k(K, H) {
var R,
N,
J;
R = {};
for (N in K) {
Object.prototype.hasOwnProperty.call(K, N) && 0 > H.indexOf(N) && (R[N] = K[N]);
}
if (null != K && "function" === typeof Object.getOwnPropertySymbols) {
J = 0;
for (N = Object.getOwnPropertySymbols(K); J < N.length; J++) {
0 > H.indexOf(N[J]) && Object.prototype.propertyIsEnumerable.call(K, N[J]) && (R[N[J]] = K[N[J]]);
}
}
return R;
}
function d(K, H, R, N) {
var J,
L,
P;
J = arguments.length;
L = 3 > J ? H : null === N ? N = Object.getOwnPropertyDescriptor(H, R) : N;
if ("object" === typeof Reflect && "function" === typeof Reflect.xs)
L = Reflect.xs(K, H, R, N);
else
for (var S = K.length - 1; 0 <= S; S--) {
if (P = K[S])
L = (3 > J ? P(L) : 3 < J ? P(H, R, L) : P(H, R)) || L;
}
return ( 3 < J && L && Object.defineProperty(H, R, L), L) ;
}
function f(K, H) {
return function(R, N) {
H(R, N, K);
};
}
function l(K, H) {
if ("object" === typeof Reflect && "function" === typeof Reflect.Fc)
return Reflect.Fc(K, H);
}
function g(K, H, R, N) {
function J(L) {
return L instanceof R ? L : new R(function(P) {
P(L);
});
}
return new (R || (R = Promise))(function(L, P) {
function S(X) {
try {
T(N.next(X));
} catch (ja) {
P(ja);
}
}
function U(X) {
try {
T(N["throw"](X));
} catch (ja) {
P(ja);
}
}
function T(X) {
X.done ? L(X.value) : J(X.value).then(S, U);
}
T((N = N.apply(K, H || [])).next());
});
}
function n(K, H) {
var J,
L,
P,
S,
U;
function R(T) {
return function(X) {
return N([T, X]);
};
}
function N(T) {
if (L)
throw new TypeError("Generator is already executing.");
for (; J;) {
try {
if ((L = 1, P && (S = T[0] & 2 ? P["return"] : T[0] ? P["throw"] || ((S = P["return"]) && S.call(P), 0) : P.next) && !(S = S.call(P, T[1])).done))
return S;
if ((P = 0, S))
T = [T[0] & 2, S.value];
switch (T[0]) {
case 0:
case 1:
S = T;
break;
case 4:
return ( J.label++, {
value: T[1],
done: !1
}) ;
case 5:
J.label++;
P = T[1];
T = [0];
continue;
case 7:
T = J.Ao.pop();
J.Tj.pop();
continue;
default:
if (!(S = J.Tj, S = 0 < S.length && S[S.length - 1]) && (6 === T[0] || 2 === T[0])) {
J = 0;
continue;
}
if (3 === T[0] && (!S || T[1] > S[0] && T[1] < S[3]))
J.label = T[1];
else if (6 === T[0] && J.label < S[1])
(J.label = S[1],
S = T);
else if (S && J.label < S[2])
(J.label = S[2],
J.Ao.push(T));
else {
S[2] && J.Ao.pop();
J.Tj.pop();
continue;
}
}
T = H.call(K, J);
} catch (X) {
T = [6, X];
P = 0;
} finally {
L = S = 0;
}
}
if (T[0] & 5)
throw T[1];
return {
value: T[0] ? T[1] : void 0,
done: !0
};
}
J = {
label: 0,
Lb: function() {
if (S[0] & 1)
throw S[1];
return S[1];
},
Tj: [],
Ao: []
};
return ( U = {
next: R(0),
"throw": R(1),
"return": R(2)
}, "function" === typeof Symbol && (U[Symbol.iterator] = function() {
return this;
}), U) ;
}
function p(K, H) {
for (var R in K) {
"default" === R || Object.prototype.hasOwnProperty.call(H, R) || I(H, K, R);
}
}
function q(K) {
var H,
R,
N;
H = "function" === typeof Symbol && Symbol.iterator;
R = H && K[H];
N = 0;
if (R)
return R.call(K);
if (K && "number" === typeof K.length)
return {
next: function() {
K && N >= K.length && (K = void 0);
return {
value: K && K[N++],
done: !K
};
}
};
throw new TypeError(H ? "Object is not iterable." : "Symbol.iterator is not defined.");
}
function t(K, H) {
var R,
N,
J;
R = "function" === typeof Symbol && K[Symbol.iterator];
if (!R)
return K;
K = R.call(K);
J = [];
try {
for (; (void 0 === H || 0 < H--) && !(N = K.next()).done;) {
J.push(N.value);
}
} catch (P) {
var L;
L = {
error: P
};
} finally {
try {
N && !N.done && (R = K["return"]) && R.call(K);
} finally {
if (L)
throw L.error;
}
}
return J;
}
function u() {
for (var K = [], H = 0; H < arguments.length; H++) {
K = K.concat(t(arguments[H]));
}
return K;
}
function v() {
var N;
for (var K = 0, H = 0, R = arguments.length; H < R; H++) {
K += arguments[H].length;
}
K = Array(K);
N = 0;
for (H = 0; H < R; H++) {
for (var J = arguments[H], L = 0, P = J.length; L < P;(L++, N++)) {
K[N] = J[L];
}
}
return K;
}
function w(K, H, R) {
if (R || 2 === arguments.length)
for (var N = 0, J = H.length, L; N < J; N++) {
!L && (N in H) || (L || (L = Array.prototype.slice.call(H, 0, N)), L[N] = H[N]);
}
return K.concat(L || Array.prototype.slice.call(H));
}
function x(K) {
return this instanceof x ? (this.mF = K, this) : new x(K);
}
function y(K, H, R) {
var U,
T,
X;
function N(ja) {
U[ja] && (T[ja] = function(qa) {
return new Promise(function(va, Fa) {
1 < X.push([ja, qa, va, Fa]) || J(ja, qa);
});
});
}
function J(ja, qa) {
var va;
try {
va = U[ja](qa);
va.value instanceof x ? Promise.resolve(va.value.mF).then(L, P) : S(X[0][2], va);
} catch (Fa) {
S(X[0][3], Fa);
}
}
function L(ja) {
J("next", ja);
}
function P(ja) {
J("throw", ja);
}
function S(ja, qa) {
(ja(qa), X.shift(), X.length) && J(X[0][0], X[0][1]);
}
if (!Symbol.asyncIterator)
throw new TypeError("Symbol.asyncIterator is not defined.");
U = R.apply(K, H || []);
X = [];
return ( T = {}, N("next"), N("throw"), N("return"), T[Symbol.asyncIterator] = function() {
return this;
}, T) ;
}
function z(K) {
var R,
N;
function H(J, L) {
R[J] = K[J] ? function(P) {
return (N = !N) ? {
value: x(K[J](P)),
done: "return" === J
} : L ? L(P) : P;
} : L;
}
return ( R = {}, H("next"), H("throw", function(J) {
throw J;
}), H("return"), R[Symbol.iterator] = function() {
return this;
}, R) ;
}
function A(K) {
var N,
J;
function H(L) {
J[L] = K[L] && (function(P) {
return new Promise(function(S, U) {
P = K[L](P);
R(S, U, P.done, P.value);
});
});
}
function R(L, P, S, U) {
Promise.resolve(U).then(function(T) {
L({
value: T,
done: S
});
}, P);
}
if (!Symbol.asyncIterator)
throw new TypeError("Symbol.asyncIterator is not defined.");
N = K[Symbol.asyncIterator];
return N ? N.call(K) : (K = "function" === typeof q ? q(K) : K[Symbol.iterator](), J = {}, H("next"), H("throw"), H("return"), J[Symbol.asyncIterator] = function() {
return this;
}, J);
}
function B(K, H) {
Object.defineProperty ? Object.defineProperty(K, "raw", {
value: H
}) : K.raw = H;
return K;
}
function D(K) {
var H;
if (K && K.__esModule)
return K;
H = {};
if (null != K)
for (var R in K) {
"default" !== R && Object.prototype.hasOwnProperty.call(K, R) && I(H, K, R);
}
O(H, K);
return H;
}
function C(K) {
return K && K.__esModule ? K : {
default: K
};
}
function F(K, H, R, N) {
if ("a" === R && !N)
throw new TypeError("Private accessor was defined without a getter");
if ("function" === typeof H ? K !== H || !N : !H.has(K))
throw new TypeError("Cannot read private member from an object whose class did not declare it");
return "m" === R ? N : "a" === R ? N.call(K) : N ? N.value : H.get(K);
}
function G(K, H, R, N, J) {
if ("m" === N)
throw new TypeError("Private method is not writable");
if ("a" === N && !J)
throw new TypeError("Private accessor was defined without a setter");
if ("function" === typeof H ? K !== H || !J : !H.has(K))
throw new TypeError("Cannot write private member to an object whose class did not declare it");
return ( "a" === N ? J.call(K, R) : J ? J.value = R : H.set(K, R), R) ;
}
function E(K, H) {
if (null === H || "object" !== typeof H && "function" !== typeof H)
throw new TypeError("Cannot use 'in' operator on non-object");
return "function" === typeof K ? H === K : K.has(H);
}
a.r(b);
a.d(b, "__extends", function() {
return h;
});
a.d(b, "__assign", function() {
return c;
});
a.d(b, "__rest", function() {
return k;
});
a.d(b, "__decorate", function() {
return d;
});
a.d(b, "__param", function() {
return f;
});
a.d(b, "__metadata", function() {
return l;
});
a.d(b, "__awaiter", function() {
return g;
});
a.d(b, "__generator", function() {
return n;
});
a.d(b, "__createBinding", function() {
return I;
});
a.d(b, "__exportStar", function() {
return p;
});
a.d(b, "__values", function() {
return q;
});
a.d(b, "__read", function() {
return t;
});
a.d(b, "__spread", function() {
return u;
});
a.d(b, "__spreadArrays", function() {
return v;
});
a.d(b, "__spreadArray", function() {
return w;
});
a.d(b, "__await", function() {
return x;
});
a.d(b, "__asyncGenerator", function() {
return y;
});
a.d(b, "__asyncDelegator", function() {
return z;
});
a.d(b, "__asyncValues", function() {
return A;
});
a.d(b, "__makeTemplateObject", function() {
return B;
});
a.d(b, "__importStar", function() {
return D;
});
a.d(b, "__importDefault", function() {
return C;
});
a.d(b, "__classPrivateFieldGet", function() {
return F;
});
a.d(b, "__classPrivateFieldSet", function() {
return G;
});
a.d(b, "__classPrivateFieldIn", function() {
return E;
});
I = Object.create ? function(K, H, R, N) {
var J;
void 0 === N && (N = R);
J = Object.getOwnPropertyDescriptor(H, R);
if (!J || (("get" in J) ? !H.__esModule : J.writable || J.configurable))
J = {
enumerable: !0,
get: function() {
return H[R];
}
};
Object.defineProperty(K, N, J);
} : function(K, H, R, N) {
void 0 === N && (N = R);
K[N] = H[R];
};
O = Object.create ? function(K, H) {
Object.defineProperty(K, "default", {
enumerable: !0,
value: H
});
} : function(K, H) {
K["default"] = H;
};
}, function(r, b, a) {
Object.defineProperty(b, "__esModule", {
value: !0
});
r = a(41);
b.fec = r;
r = a(630);
b.m1 = r.m1;
r = a(77);
b.Pt = r.Pt;
b.Vj = r.Vj;
b.Yy = r.Yy;
r = a(646);
b.fDa = r.fDa;
b.qd = r.qd;
r = a(647);
b.W = r.W;
r = a(648);
b.Xfb = r.Xfb;
r = a(649);
b.r9a = r.r9a;
r = a(320);
b.l = r.l;
b.tga = r.tga;
r = a(650);
b.optional = r.optional;
r = a(651);
b.Lo = r.Lo;
r = a(652);
b.fJ = r.fJ;
r = a(653);
b.V_ = r.V_;
r = a(654);
b.Tab = r.Tab;
r = a(318);
b.Rga = r.Rga;
r = a(107);
b.id = r.id;
r = a(92);
b.xs = r.xs;
r = a(323);
b.Ugb = r.Ugb;
b.Yfb = r.Yfb;
b.s9a = r.s9a;
b.bhb = r.bhb;
r = a(135);
b.lO = r.lO;
a = a(655);
b.n9a = a.n9a;
}, function(r, b) {
var a,
c;
Object.defineProperty(b, "__esModule", {
value: !0
});
b.Jy = b.wGa = b.vGa = b.Kfa = b.uGa = b.Jfa = b.P2 = b.E2 = b.tGa = b.R = b.U = void 0;
(function(m) {
m[m.Kn = 7001] = "UNKNOWN";
m[m.lQa = 7002] = "UNHANDLED_EXCEPTION";
m[m.znb = 7003] = "INIT_COMPONENT_LOG_TO_REMOTE";
m[m.Xmb = 7004] = "HLS_NOT_SUPPORTED";
m[m.gga = 7010] = "INIT_ASYNCCOMPONENT";
m[m.Dnb = 7011] = "INIT_HTTP";
m[m.xnb = 7014] = "INIT_BADMOVIEID";
m[m.aIa = 7020] = "INIT_PLAYBACK_LOCK";
m[m.bIa = 7022] = "INIT_SESSION_LOCK";
m[m.Enb = 7029] = "INIT_POSTAUTHORIZE";
m[m.$Ha = 7031] = "INIT_HEADER_MEDIA";
m[m.Fnb = 7034] = "INIT_TIMEDTEXT_TRACK";
m[m.ljb = 7037] = "ASE_SESSION_ERROR";
m[m.kjb = 7038] = "ASE_SEEK_THREW";
m[m.mjb = 7039] = "ASE_SKIPPED_THREW";
m[m.Anb = 7041] = "INIT_CORE_OBJECTS1";
m[m.Bnb = 7042] = "INIT_CORE_OBJECTS2";
m[m.Cnb = 7043] = "INIT_CORE_OBJECTS3";
m[m.UHa = 7053] = "INIT_COMPONENT_STORAGE";
m[m.VHa = 7054] = "INIT_COMPONENT_STORAGELOCK";
m[m.RHa = 7058] = "INIT_COMPONENT_MAINTHREADMONITOR";
m[m.hga = 7059] = "INIT_COMPONENT_DEVICE";
m[m.SHa = 7063] = "INIT_COMPONENT_MSL";
m[m.QHa = 7066] = "INIT_COMPONENT_LOGBLOBBATCHER";
m[m.hC = 7067] = "INIT_COMPONENT_PERSISTEDPLAYDATA";
m[m.ZHa = 7083] = "INIT_COMPONENT_WEBCRYPTO";
m[m.PHa = 7086] = "INIT_COMPONENT_IDB_VIEWER_TOOL";
m[m.NHa = 7088] = "INIT_COMPONENT_BATTERY_MANAGER";
m[m.MHa = 7089] = "INIT_COMPONENT_ASE";
m[m.WK = 7091] = "INIT_COMPONENT_DRM_CACHE";
m[m.ynb = 7092] = "INIT_COMPONENT_DRM";
m[m.OHa = 7094] = "INIT_COMPONENT_FTL";
m[m.THa = 7095] = "INIT_COMPONENT_PREPARE_MODEL";
m[m.WHa = 7096] = "INIT_COMPONENT_VIDEO_SESSION_EDGE";
m[m.XHa = 7097] = "INIT_COMPONENT_VIDEO_SESSION_MDX";
m[m.YHa = 7098] = "INIT_COMPONENT_VIDEO_SESSION_TEST";
m[m.aL = 7111] = "MANIFEST";
m[m.qJa = 7117] = "MANIFEST_VERIFY";
m[m.Dqb = 7120] = "START";
m[m.YK = 7121] = "LICENSE";
m[m.Vha = 7122] = "RELEASE";
m[m.Eqb = 7123] = "STOP";
m[m.pga = 7125] = "KEEPALIVE";
m[m.wpb = 7131] = "PING";
m[m.Emb = 7134] = "ENGAGE";
m[m.aob = 7137] = "LOGBLOB";
m[m.ffc = 7138] = "PAUSE";
m[m.wfc = 7139] = "RESUME";
m[m.BOa = 7140] = "SPLICE";
m[m.Rjb = 7142] = "BIND";
m[m.Sjb = 7144] = "BIND_DEVICE";
m[m.Smb = 7145] = "GENERATE_SCREENSHOTS";
m[m.djb = 7146] = "AD_EVENT";
m[m.Apb = 7202] = "PLAY_INIT_EXCEPTION";
m[m.iha = 7332] = "PLAY_MSE_EME_KEY_STATUS_CHANGE_EXPIRED";
m[m.Gpb = 7333] = "PLAY_MSE_EME_KEY_STATUS_CHANGE_INTERNAL_ERROR";
m[m.tLa = 7334] = "PLAY_MSE_EME_KEY_STATUS_CHANGE_OUTPUT_NOT_ALLOWED";
m[m.Hpb = 7335] = "PLAY_MSE_EME_KEY_STATUS_EXCEPTION";
m[m.jha = 7336] = "PLAY_MSE_EME_KEY_STATUS_CHANGE_OUTPUT_RESTRICTED";
m[m.Fpb = 7338] = "PLAY_MSE_EME_KEY_MAPPING_EXCEPTION";
m[m.xLa = 7351] = "PLAY_MSE_NOTSUPPORTED";
m[m.sLa = 7353] = "PLAY_MSE_DECODER_TIMEOUT";
m[m.kha = 7355] = "PLAY_MSE_SOURCEADD";
m[m.rLa = 7356] = "PLAY_MSE_CREATE_MEDIAKEYS";
m[m.xS = 7357] = "PLAY_MSE_GENERATEKEYREQUEST";
m[m.wLa = 7361] = "PLAY_MSE_EVENT_ERROR";
m[m.jL = 7362] = "PLAY_MSE_SETMEDIAKEYS";
m[m.Rr = 7363] = "PLAY_MSE_EVENT_KEYERROR";
m[m.Jpb = 7364] = "PLAY_MSE_EME_SESSION_CLOSE";
m[m.Kpb = 7365] = "PLAY_MSE_GETCURRENTTIME";
m[m.Lpb = 7367] = "PLAY_MSE_SETCURRENTTIME";
m[m.Mpb = 7371] = "PLAY_MSE_SOURCEAPPEND";
m[m.Qpb = 7375] = "PLAY_MSE_UNEXPECTED_SEEKING";
m[m.Ppb = 7376] = "PLAY_MSE_UNEXPECTED_SEEKED";
m[m.Opb = 7377] = "PLAY_MSE_UNEXPECTED_REWIND";
m[m.Npb = 7381] = "PLAY_MSE_SOURCEBUFFER_ERROR";
m[m.yLa = 7382] = "PLAY_MSE_SOURCEBUFFER_CHANGETYPE";
m[m.Bpb = 7391] = "PLAY_MSE_CREATE_MEDIASOURCE";
m[m.Cpb = 7392] = "PLAY_MSE_CREATE_MEDIASOURCE_OBJECTURL";
m[m.Dpb = 7393] = "PLAY_MSE_CREATE_MEDIASOURCE_OPEN";
m[m.uLa = 7394] = "PLAY_MSE_EME_MISSING_DRMHEADER";
m[m.Ipb = 7395] = "PLAY_MSE_EME_MISSING_PSSH";
m[m.vLa = 7397] = "PLAY_MSE_EME_NO_PRK_SUPPORT";
m[m.Epb = 7398] = "PLAY_MSE_DURATIONCHANGE_ERROR";
m[m.c3 = 7399] = "PLAY_MSE_SET_LICENSE_ERROR";
m[m.fGa = 7400] = "EXTERNAL";
m[m.b3 = 7500] = "PAUSE_TIMEOUT";
m[m.F2 = 7502] = "INACTIVITY_TIMEOUT";
m[m.vjb = 7510] = "AUTHORIZATION_EXPIRED";
m[m.wmb = 7700] = "EME_INVALID_KEYSYSTEM";
m[m.RFa = 7701] = "EME_CREATE_MEDIAKEYS_SYSTEMACCESS_FAILED";
m[m.OR = 7702] = "EME_CREATE_MEDIAKEYS_FAILED";
m[m.G1 = 7703] = "EME_GENERATEREQUEST_FAILED";
m[m.YFa = 7704] = "EME_UPDATE_FAILED";
m[m.WFa = 7705] = "EME_KEYSESSION_ERROR";
m[m.VFa = 7706] = "EME_KEYMESSAGE_EMPTY";
m[m.Amb = 7707] = "EME_REMOVE_FAILED";
m[m.ymb = 7708] = "EME_LOAD_FAILED";
m[m.smb = 7709] = "EME_CREATE_SESSION_FAILED";
m[m.Ffa = 7710] = "EME_LDL_RENEWAL_ERROR";
m[m.TFa = 7711] = "EME_INVALID_INITDATA_DATA";
m[m.UFa = 7712] = "EME_INVALID_LICENSE_DATA";
m[m.xmb = 7713] = "EME_LDL_KEYSSION_ALREADY_CLOSED";
m[m.QFa = 7716] = "EME_CLOSE_FAILED";
m[m.Gfa = 7717] = "EME_SESSION_CLOSED_UNEXPECTEDLY";
m[m.Cmb = 7718] = "EME_SET_SERVER_CERTIFICATE";
m[m.xpb = 7800] = "PLAYDATA_STORE_FAILURE";
m[m.uR = 7900] = "BRANCH_PLAY_FAILURE";
m[m.vR = 7901] = "BRANCH_QUEUE_FAILURE";
m[m.pDa = 7902] = "BRANCH_UPDATE_NEXT_SEGMENT_WEIGHTS_FAILURE";
m[m.Zjb = 7903] = "BRANCH_CHOICE_MAP_MISSING";
m[m.jpb = 8100] = "PBO_EVENTLOOKUP_FAILURE";
})(a = b.U || (b.U = {}));
(function(m) {
m[m.Kn = 1001] = "UNKNOWN";
m[m.im = 1003] = "EXCEPTION";
m[m.Inb = 1004] = "INVALID_DI";
m[m.pjb = 1011] = "ASYNCLOAD_EXCEPTION";
m[m.qjb = 1013] = "ASYNCLOAD_TIMEOUT";
m[m.Hbc = 1015] = "ASYNCLOAD_BADCONFIG";
m[m.njb = 1016] = "ASYNCLOAD_COMPONENT_DUPLICATE";
m[m.ojb = 1017] = "ASYNCLOAD_COMPONENT_MISSING";
m[m.ZR = 1101] = "HTTP_UNKNOWN";
m[m.dga = 1102] = "HTTP_XHR";
m[m.WR = 1103] = "HTTP_PROTOCOL";
m[m.VR = 1104] = "HTTP_OFFLINE";
m[m.YR = 1105] = "HTTP_TIMEOUT";
m[m.HF = 1106] = "HTTP_READTIMEOUT";
m[m.gC = 1107] = "HTTP_ABORT";
m[m.mHa = 1108] = "HTTP_PARSE";
m[m.iHa = 1110] = "HTTP_BAD_URL";
m[m.XR = 1111] = "HTTP_PROXY";
m[m.Kga = 1203] = "MSE_AUDIO";
m[m.Lga = 1204] = "MSE_VIDEO";
m[m.oob = 1250] = "MSE_MEDIA_ERR_BASE";
m[m.hec = 1251] = "MSE_MEDIA_ERR_ABORTED";
m[m.kec = 1252] = "MSE_MEDIA_ERR_NETWORK";
m[m.iec = 1253] = "MSE_MEDIA_ERR_DECODE";
m[m.lec = 1254] = "MSE_MEDIA_ERR_SRC_NOT_SUPPORTED";
m[m.jec = 1255] = "MSE_MEDIA_ERR_ENCRYPTED";
m[m.Rt = 1260] = "EME_MEDIA_KEYERR_BASE";
m[m.edc = 1261] = "EME_MEDIA_KEYERR_UNKNOWN";
m[m.$cc = 1262] = "EME_MEDIA_KEYERR_CLIENT";
m[m.ddc = 1263] = "EME_MEDIA_KEYERR_SERVICE";
m[m.cdc = 1264] = "EME_MEDIA_KEYERR_OUTPUT";
m[m.bdc = 1265] = "EME_MEDIA_KEYERR_HARDWARECHANGE";
m[m.adc = 1266] = "EME_MEDIA_KEYERR_DOMAIN";
m[m.fdc = 1269] = "EME_MEDIA_UNAVAILABLE_CDM";
m[m.vmb = 1270] = "EME_INTERNAL_ERROR";
m[m.rmb = 1271] = "EME_CLOSED_BY_APPLICATION";
m[m.zmb = 1272] = "EME_RELEASE_ACKNOWLEDGED";
m[m.Efa = 1273] = "EME_HARDWARE_CONTEXT_RESET";
m[m.Bmb = 1274] = "EME_RESOURCE_EVICTED";
m[m.umb = 1280] = "EME_ERROR_NODRMSESSSION";
m[m.tmb = 1281] = "EME_ERROR_NODRMREQUESTS";
m[m.Xcc = 1282] = "EME_ERROR_INDIV_FAILED";
m[m.Ycc = 1283] = "EME_ERROR_UNSUPPORTED_MESSAGETYPE";
m[m.Dmb = 1284] = "EME_TIMEOUT_MESSAGE";
m[m.gdc = 1285] = "EME_TIMEOUT_KEYCHANGE";
m[m.XFa = 1286] = "EME_UNDEFINED_DATA";
m[m.RK = 1287] = "EME_INVALID_STATE";
m[m.Zcc = 1288] = "EME_LDL_DOES_NOT_SUPPORT_PRK";
m[m.SFa = 1289] = "EME_EMPTY_DATA";
m[m.PR = 1290] = "EME_TIMEOUT";
m[m.zec = 1303] = "NCCP_METHOD_NOT_SUPPORTED";
m[m.Cec = 1305] = "NCCP_PARSEXML";
m[m.Tpb = 1309] = "PROCESS_EXCEPTION";
m[m.Bec = 1311] = "NCCP_NETFLIXID_MISSING";
m[m.Dec = 1312] = "NCCP_SECURENETFLIXID_MISSING";
m[m.wec = 1313] = "NCCP_HMAC_MISSING";
m[m.vec = 1315] = "NCCP_HMAC_MISMATCH";
m[m.uec = 1317] = "NCCP_HMAC_FAILED";
m[m.tec = 1321] = "NCCP_CLIENTTIME_MISSING";
m[m.sec = 1323] = "NCCP_CLIENTTIME_MISMATCH";
m[m.QGa = 1331] = "GENERIC";
m[m.Gob = 1333] = "NCCP_PROTOCOL_INVALIDDEVICECREDENTIALS";
m[m.Hob = 1337] = "NCCP_PROTOCOL_REDIRECT_LOOP";
m[m.Eec = 1341] = "NCCP_TRANSACTION";
m[m.xec = 1343] = "NCCP_INVALID_DRMTYPE";
m[m.yec = 1344] = "NCCP_INVALID_LICENCE_RESPONSE";
m[m.Aec = 1345] = "NCCP_MISSING_PAYLOAD";
m[m.kfc = 1346] = "PROTOCOL_NOT_INITIALIZED";
m[m.jfc = 1347] = "PROTOCOL_MISSING_FIELD";
m[m.ifc = 1348] = "PROTOCOL_MISMATCHED_PROFILEGUID";
m[m.tC = 1402] = "STORAGE_NODATA";
m[m.Gfc = 1403] = "STORAGE_EXCEPTION";
m[m.Ofc = 1405] = "STORAGE_QUOTA_NOT_GRANTED";
m[m.Pfc = 1407] = "STORAGE_QUOTA_TO_SMALL";
m[m.EOa = 1411] = "STORAGE_LOAD_ERROR";
m[m.Gqb = 1412] = "STORAGE_LOAD_TIMEOUT";
m[m.FOa = 1414] = "STORAGE_SAVE_ERROR";
m[m.Jqb = 1415] = "STORAGE_SAVE_TIMEOUT";
m[m.dia = 1417] = "STORAGE_DELETE_ERROR";
m[m.DOa = 1418] = "STORAGE_DELETE_TIMEOUT";
m[m.Nfc = 1421] = "STORAGE_FS_REQUESTFILESYSTEM";
m[m.Kfc = 1423] = "STORAGE_FS_GETDIRECTORY";
m[m.Mfc = 1425] = "STORAGE_FS_READENTRIES";
m[m.Hfc = 1427] = "STORAGE_FS_FILEREAD";
m[m.Jfc = 1429] = "STORAGE_FS_FILEWRITE";
m[m.Ifc = 1431] = "STORAGE_FS_FILEREMOVE";
m[m.Lfc = 1432] = "STORAGE_FS_PARSEJSON";
m[m.Iqb = 1451] = "STORAGE_NO_LOCALSTORAGE";
m[m.Hqb = 1453] = "STORAGE_LOCALSTORAGE_ACCESS_EXCEPTION";
m[m.Nec = 1501] = "NTBA_UNKNOWN";
m[m.Mec = 1502] = "NTBA_EXCEPTION";
m[m.Iec = 1504] = "NTBA_CRYPTO_KEY";
m[m.Kec = 1506] = "NTBA_CRYPTO_OPERATION";
m[m.Jec = 1508] = "NTBA_CRYPTO_KEYEXCHANGE";
m[m.Lec = 1515] = "NTBA_DECRYPT_UNSUPPORTED";
m[m.REa = 1553] = "DEVICE_NO_ESN";
m[m.ylb = 1555] = "DEVICE_ERROR_GETTING_ESN";
m[m.Idc = 1701] = "FORMAT_UNKNOWN";
m[m.Lmb = 1713] = "FORMAT_XML";
m[m.Jdc = 1715] = "FORMAT_XML_CONTENT";
m[m.Gdc = 1721] = "FORMAT_BASE64";
m[m.Hdc = 1723] = "FORMAT_DFXP";
m[m.jnb = 1801] = "INDEXDB_OPEN_EXCEPTION";
m[m.KHa = 1802] = "INDEXDB_NOT_SUPPORTED";
m[m.inb = 1803] = "INDEXDB_OPEN_ERROR";
m[m.LHa = 1804] = "INDEXDB_OPEN_NULL";
m[m.hnb = 1805] = "INDEXDB_OPEN_BLOCKED";
m[m.knb = 1807] = "INDEXDB_OPEN_TIMEOUT";
m[m.gnb = 1808] = "INDEXDB_INVALID_STORE_STATE";
m[m.G2 = 1809] = "INDEXDB_ACCESS_EXCEPTION";
m[m.yob = 1901] = "MSL_UNKNOWN";
m[m.rob = 1911] = "MSL_INIT_NO_MSL";
m[m.zJa = 1913] = "MSL_INIT_ERROR";
m[m.sob = 1915] = "MSL_INIT_NO_WEBCRYPTO";
m[m.pob = 1931] = "MSL_ERROR";
m[m.xob = 1933] = "MSL_REQUEST_TIMEOUT";
m[m.wob = 1934] = "MSL_READ_TIMEOUT";
m[m.qob = 1935] = "MSL_ERROR_HEADER";
m[m.mec = 1936] = "MSL_ERROR_ENVELOPE";
m[m.nec = 1937] = "MSL_ERROR_MISSING_PAYLOAD";
m[m.yJa = 1957] = "MSL_ERROR_REAUTH";
m[m.Jia = 2103] = "WEBCRYPTO_MISSING";
m[m.tgc = 2105] = "WEBCRYPTOKEYS_MISSING";
m[m.jrb = 2107] = "WEBCRYPTO_IFRAME_LOAD_ERROR";
m[m.pcc = 2200] = "CACHEDDATA_PARSEJSON";
m[m.ODa = 2201] = "CACHEDDATA_UNSUPPORTED_VERSION";
m[m.qcc = 2202] = "CACHEDDATA_UPGRADE_FAILED";
m[m.cC = 2203] = "CACHEDDATA_INVALID_FORMAT";
m[m.Fbc = 3E3] = "ACCOUNT_CHANGE_INFLIGHT";
m[m.Gbc = 3001] = "ACCOUNT_INVALID";
m[m.Occ = 3100] = "DOWNLOADED_MANIFEST_UNAVAILABLE";
m[m.Ncc = 3101] = "DOWNLOADED_MANIFEST_PARSE_EXCEPTION";
m[m.Lcc = 3200] = "DOWNLOADED_LICENSE_UNAVAILABLE";
m[m.Mcc = 3201] = "DOWNLOADED_LICENSE_UNUSEABLE";
m[m.Kcc = 3202] = "DOWNLOADED_LICENSE_EXCEPTION";
m[m.Qfc = 3300] = "STORAGE_VA_LOAD_ERROR";
m[m.Rfc = 3301] = "STORAGE_VA_LOAD_TIMEOUT";
m[m.Ufc = 3302] = "STORAGE_VA_SAVE_ERROR";
m[m.Vfc = 3303] = "STORAGE_VA_SAVE_TIMEOUT";
m[m.Sfc = 3304] = "STORAGE_VA_REMOVE_ERROR";
m[m.Tfc = 3305] = "STORAGE_VA_REMOVE_TIMEOUT";
m[m.fha = 3077] = "PBO_DEVICE_EOL_WARNING";
m[m.jLa = 3078] = "PBO_DEVICE_EOL_FINAL";
m[m.mLa = 3100] = "PBO_DEVICE_RESET";
m[m.lLa = 3101] = "PBO_DEVICE_RELOAD";
m[m.kLa = 3102] = "PBO_DEVICE_EXIT";
m[m.upb = 5003] = "PBO_VIEWABLE_OUT_OF_AVAILABILITY_WINDOW";
m[m.epb = 5005] = "PBO_ACCOUNT_ON_HOLD";
m[m.ipb = 5006] = "PBO_CONCURRENT_STREAM_QUOTA_EXCEEDED";
m[m.nLa = 5007] = "PBO_INCORRECT_PIN";
m[m.rpb = 5008] = "PBO_MOBILE_ONLY";
m[m.vpb = 5009] = "PBO_VIEWABLE_RESTRICTED_BY_PROFILE";
m[m.npb = 5033] = "PBO_INSUFFICIENT_MATURITY_LEVEL";
m[m.gpb = 5059] = "PBO_BLACKLISTED_IP";
m[m.fpb = 5070] = "PBO_AGE_VERIFICATION_REQUIRED";
m[m.hpb = 5080] = "PBO_CHOICE_MAP_ERROR";
m[m.spb = 5090] = "PBO_RESTRICTED_TO_TESTERS";
m[m.ppb = 5091] = "PBO_MALFORMED_REQUEST";
m[m.opb = 5092] = "PBO_INVALID_SERVICE_VERSION";
m[m.qpb = 5093] = "PBO_MDX_INVALID_CTICKET";
m[m.mpb = 5094] = "PBO_FREE_PREVIEW_ENDED";
m[m.tpb = 5095] = "PBO_STREAMING_LOCATION_DISALLOWED";
m[m.lpb = 5096] = "PBO_EXTRA_MEMBER_STREAM_HOLD";
m[m.kpb = 5097] = "PBO_EXTRA_MEMBER_REMOVED_STREAM_HOLD";
m[m.glb = 5100] = "DECODER_TIMEOUT_BUFFERING";
m[m.ilb = 5101] = "DECODER_TIMEOUT_PRESENTING";
m[m.hlb = 5102] = "DECODER_TIMEOUT_PLAYING";
m[m.Zlb = 5200] = "DOWNLOADER_IO_ERROR";
m[m.oDa = 5300] = "BRANCHING_SEGMENT_NOTFOUND";
m[m.Vjb = 5301] = "BRANCHING_PRESENTER_UNINITIALIZED";
m[m.Ubc = 5302] = "BRANCHING_SEGMENT_STREAMING_NOT_STARTED";
m[m.Tea = 5303] = "BRANCHING_ASE_UNINITIALIZED";
m[m.Qbc = 5304] = "BRANCHING_ASE_FAILURE";
m[m.Rbc = 5305] = "BRANCHING_MOMENT_FAILURE";
m[m.Tjb = 5306] = "BRANCHING_CURRENT_SEGMENT_UNINITIALIZED";
m[m.Tbc = 5307] = "BRANCHING_SEGMENT_LASTPTS_UNINIITALIZED";
m[m.Wjb = 5308] = "BRANCHING_SEEK_THREW";
m[m.Sbc = 5309] = "BRANCHING_PLAY_NOTENOUGHNEXTSEGMENTS";
m[m.Ujb = 5310] = "BRANCHING_PLAY_TIMEDOUT";
m[m.Xjb = 5311] = "BRANCHING_SEGMENT_ALREADYQUEUED";
m[m.Yjb = 5312] = "BRANCHING_UPDATE_NEXT_SEGMENT_WEIGHTS_THREW";
m[m.Kqb = 5500] = "STUDIO_MUXED_MANIFEST";
m[m.Fga = 5600] = "MANIFEST_HYDRATION_FAILURE";
m[m.wjb = 5700] = "AUXILIARY_MANIFEST_ERROR_RETRIEVING_PARENT_MANIFEST";
m[m.xjb = 5701] = "AUXILIARY_MANIFEST_NO_MATCHING_HEACC_AUDIO_STREAM_FOUND";
})(c = b.R || (b.R = {}));
(function(m) {
m[m.ecc = 5003] = "BR_VIEWABLE_OUT_OF_AVAILABILITY_WINDOW";
m[m.Vbc = 5005] = "BR_ACCOUNT_ON_HOLD";
m[m.Zbc = 5006] = "BR_CONCURRENT_STREAM_QUOTA_EXCEEDED";
m[m.bcc = 5033] = "BR_INSUFFICIENT_MATURITY_LEVEL";
m[m.Ybc = 5059] = "BR_BLACKLISTED_IP";
m[m.Wbc = 5070] = "BR_AGE_VERIFICATION_REQUIRED";
m[m.ccc = 2204] = "BR_PLAYBACK_CONTEXT_CREATION";
m[m.$bc = 2205] = "BR_DRM_LICENSE_AQUISITION";
m[m.dcc = 2206] = "BR_PLAYBACK_SERVICE_ERROR";
m[m.acc = 2207] = "BR_ENDPOINT_ERROR";
m[m.Xbc = 2208] = "BR_AUTHORIZATION_ERROR";
})(b.tGa || (b.tGa = {}));
b.E2 = {
fkb: "400",
ogc: "401",
GLa: "413"
};
b.P2 = {
Edc: 1,
ggc: 2,
jdc: 3,
mgc: 4,
Zdc: 5,
idc: 6,
Cia: 7,
ldc: 8,
ufc: 9,
Dfc: 10
};
b.Jfa = function(m, h, k, d) {
return m == a.b3 || m == a.F2 || m == a.iha && 432E5 <= k || m == a.Gfa && h === c.Efa && 0 < Number(d);
};
b.uGa = function(m) {
return 1100 <= m && 1199 >= m;
};
b.Kfa = function(m, h) {
return 1 <= m && 9 >= m ? h + m : h;
};
b.vGa = function(m) {
return (0, b.Kfa)(m, c.oob);
};
b.wGa = function(m) {
return (0, b.Kfa)(m, c.Rt);
};
b.Jy = function(m) {
var h,
k,
d;
h = {};
k = m.errorExternalCode || m.xf;
d = m.errorDetails || m.Nb;
h.ErrorSubCode = m.errorSubCode || m.wa || c.Kn;
k && (h.ErrorExternalCode = k);
d && (h.ErrorDetails = d);
return h;
};
}, function(r, b, a) {
var c,
m,
h;
Object.defineProperties(b, {
__esModule: {
value: !0
}
});
b.assert = void 0;
c = a(0);
m = a(142);
h = (function(k) {
function d() {
return null !== k && k.apply(this, arguments) || this;
}
c.__extends(d, k);
return d;
})(Error);
b.assert = function(k, d) {
if (!k)
try {
throw new h(d || "Assertion failed");
} catch (f) {
throw (m.Dn.H.error("Assertion failed", {
value: k,
message: d,
stack: f.stack
}), f);
}
};
}, function(r, b) {
Object.defineProperties(b, {
__esModule: {
value: !0
}
});
b.default = {
rX: function(a) {
for (var c in a) {
a.hasOwnProperty(c) && (this[c] = a[c]);
}
},
reset: function() {}
};
}, function(r, b, a) {
var h;
function c() {
return h.OS.apply(this, arguments) || this;
}
function m(k) {
return new h.Vt(k, b.ma);
}
Object.defineProperty(b, "__esModule", {
value: !0
});
b.Va = b.yHa = b.Tga = b.Vo = b.ma = b.SF = b.timestamp = b.bRb = b.Caa = b.ii = b.Ac = b.Xab = b.MWb = b.Xqb = void 0;
h = a(324);
ka(c, h.OS);
b.Xqb = c;
b.MWb = function(k) {
return new h.Vt(k, b.SF);
};
b.Xab = function(k) {
return new h.Vt(k * b.Vo.Ag, b.SF);
};
b.Ac = m;
b.ii = function(k) {
return new h.Vt(k, b.Vo);
};
b.Caa = function(k) {
return new h.Vt(k, b.Tga);
};
b.bRb = function(k) {
return new h.Vt(k, b.yHa);
};
b.timestamp = function(k) {
return m(k);
};
b.SF = new c(1, "\u03bcs");
b.ma = new c(1E3, "ms", b.SF);
b.Vo = new c(1E3 * b.ma.Ag, "s", b.SF);
b.Tga = new c(60 * b.Vo.Ag, "min", b.SF);
b.yHa = new c(60 * b.Tga.Ag, "hr", b.SF);
b.Va = m(0);
}, function(r, b) {
Object.defineProperty(b, "__esModule", {
value: !0
});
b.NR = b.qb = b.zga = b.Wj = void 0;
r = b.Wj || (b.Wj = {});
r[r.Jmb = 0] = "FATAL";
r[r.Rf = 1] = "ERROR";
r[r.Iia = 2] = "WARN";
r[r.fga = 3] = "INFO";
r[r.FPa = 4] = "TRACE";
r[r.Z = 5] = "DEBUG";
b.zga = "LogFieldBuilderFactorySymbol";
b.qb = "LoggerFactorySymbol";
b.NR = {};
}, function(r, b, a) {
var c;
Object.defineProperties(b, {
__esModule: {
value: !0
}
});
b.AS = b.RGa = b.QQa = void 0;
r = a(0);
r.__exportStar(a(363), b);
r.__exportStar(a(98), b);
r.__exportStar(a(20), b);
r.__exportStar(a(824), b);
r.__exportStar(a(825), b);
r.__exportStar(a(826), b);
r.__exportStar(a(827), b);
r.__exportStar(a(828), b);
r.__exportStar(a(829), b);
r.__exportStar(a(830), b);
c = r.__importDefault(a(831));
b.QQa = c.default;
c = r.__importDefault(a(832));
b.RGa = c.default;
a = r.__importDefault(a(374));
b.AS = a.default;
}, function(r, b, a) {
var c,
m,
h,
k,
d,
f,
l,
g;
Object.defineProperty(b, "__esModule", {
value: !0
});
b.ya = b.iNa = b.wW = b.Fi = b.xj = b.log = b.gg = b.eO = b.VVa = b.ns = b.Iz = b.kc = b.$zb = b.qma = b.Yzb = b.Zzb = b.vj = b.$Q = b.u0 = b.Rh = b.Lc = b.za = void 0;
c = a(204);
r = a(6);
m = a(26);
h = a(72);
k = a(79);
d = a(33);
f = a(15);
l = a(140);
g = a(30);
a = a(49);
b.za = c.dc.get(g.th);
b.Lc = c.dc.get(a.Yj);
b.Rh = c.dc.get(h.$t);
b.u0 = b.Rh.encode.bind(b.Rh);
b.$Q = b.Rh.decode.bind(b.Rh);
b.vj = c.dc.get(k.zy);
b.Zzb = b.vj.encode.bind(b.vj);
b.Yzb = b.vj.decode.bind(b.vj);
b.qma = b.vj.gI.bind(b.vj);
b.$zb = b.vj.Dgb.bind(b.vj);
b.kc = c.dc.get(d.oi);
b.Iz = function(n) {
n = (0, f.dg)(n) ? (0, b.$Q)(n) : n;
return b.kc.encode(n);
};
b.ns = b.kc.decode.bind(b.kc);
b.VVa = function(n) {
return (0, b.u0)((0, b.ns)(n));
};
b.eO = function() {
return c.dc.get(m.Ey);
};
b.gg = c.dc.get(r.qb);
b.log = b.gg.jb("General");
b.xj = function(n, p) {
return b.gg.jb(n, void 0, p);
};
b.Fi = function(n, p, q) {
return b.gg.jb(p, n, q);
};
b.wW = function(n, p, q, t) {
return b.gg.jb(n, void 0, t, p, q);
};
b.iNa = function(n, p, q) {
return c.dc.get(l.BS)(n, p, q).f0();
};
b.ya = c.dc;
}, function(r) {
var b;
b = {
Ga: function(a) {
return "number" === typeof a;
},
Aj: function(a) {
return "object" === typeof a;
},
dg: function(a) {
return "string" === typeof a;
},
na: function(a) {
return "undefined" === typeof a;
},
Hjc: function(a) {
return "boolean" === typeof a;
},
$c: function(a) {
return "function" === typeof a;
},
mb: function(a) {
return null === a;
},
isArray: function(a) {
return "[object Array]" === Object.prototype.toString.call(a);
},
isFinite: function(a) {
return isFinite(a) && !isNaN(parseFloat(a));
},
has: function(a, c) {
return null !== a && "undefined" !== typeof a && Object.prototype.hasOwnProperty.call(a, c);
},
h_b: function(a) {
var c,
m;
m = [];
if (!b.Aj(a))
throw new TypeError("Object.pairs called on non-object");
for (c in a) {
a.hasOwnProperty(c) && m.push([c, a[c]]);
}
return m;
}
};
b.wf = b.forEach = function(a, c, m) {
if (null === a || "undefined" === typeof a)
return a;
if (a.length === +a.length)
for (var h = 0, k = a.length; h < k; h++) {
c.call(m, a[h], h, a);
}
else
for (h in a) {
b.has(a, h) && c.call(m, a[h], h, a);
}
return a;
};
r.exports = b;
}, function(r, b) {
Object.defineProperty(b, "__esModule", {
value: !0
});
b.En = {
Ahc: "casttv",
pna: "chrome",
Fhc: "chromecast",
Rq: "edge",
n_a: "edgeoss",
L0a: "firefox",
zjc: "ie",
opera: "opera",
kdb: "safari",
bgb: "tesla"
};
b.So = {
N5: "android",
s5a: "ios",
hXa: "chromeos",
Y6a: "linux",
A7a: "mac",
jea: "windows"
};
b.D2 = {
$Cb: "computer",
phone: "phone",
v8b: "tablet"
};
b.Jc = "ConfigSymbol";
}, function(r, b) {
Object.defineProperties(b, {
__esModule: {
value: !0
}
});
b.Z = !1;
}, function(r, b) {
Object.defineProperty(b, "__esModule", {
value: !0
});
b.sua = b.localStorage = b.RRb = b.indexedDB = b.GKa = b.Oq = b.nC = b.mC = b.URL = b.U2 = b.Kob = b.PJa = b.OJa = b.N2 = b.mS = b.Ny = b.Ut = b.Ro = b.Aob = b.cL = b.yPa = b.YEa = b.apb = b.pop = b.forEach = b.filter = b.reduce = b.every = b.slice = b.map = b.sort = b.Gz = b.Job = b.vh = b.pw = b.HKa = b.qw = b.T2 = b.VF = void 0;
r = mb;
b.De = r.navigator;
b.VF = null === b.De || void 0 === b.De ? void 0 : b.De.userAgent;
b.T2 = r.location;
b.qw = r.screen;
b.HKa = r.devicePixelRatio;
b.pw = r.performance;
b.vh = r.document;
b.Job = b.vh.documentElement;
b.Gz = Array.prototype;
b.sort = b.Gz.sort;
b.map = b.Gz.map;
b.slice = b.Gz.slice;
b.every = b.Gz.every;
b.reduce = b.Gz.reduce;
b.filter = b.Gz.filter;
b.forEach = b.Gz.forEach;
b.pop = b.Gz.pop;
b.apb = Object.create;
b.YEa = Date.now;
b.yPa = String.fromCharCode;
b.cL = Math.floor;
b.Aob = Math.ceil;
b.Ro = Math.round;
b.Ut = Math.max;
b.Ny = Math.min;
b.mS = Math.random;
b.N2 = Math.abs;
b.OJa = Math.pow;
b.PJa = Math.sqrt;
b.Kob = r.escape;
b.U2 = r.unescape;
b.URL = r.URL || r.webkitURL;
b.mC = r.MediaSource || r.WebKitMediaSource;
b.nC = r.webkitCrypto || r.msCrypto || r.crypto;
b.Oq = b.nC && (b.nC.webkitSubtle || b.nC.subtle);
b.GKa = r.webkitCryptokeys || r.msCryptokeys || r.cryptokeys;
try {
b.indexedDB = r.indexedDB;
} catch (a) {
b.RRb = a || "noex";
}
try {
b.localStorage = r.localStorage;
} catch (a) {
b.sua = a || "noex";
}
}, function(r, b, a) {
Object.defineProperties(b, {
__esModule: {
value: !0
}
});
a(0).__exportStar(a(359), b);
}, function(r, b, a) {
b = a(113);
b.XGb = 0;
r.exports = {
EventEmitter: b,
mg: a(820)
};
}, function(r, b, a) {
Object.defineProperty(b, "__esModule", {
value: !0
});
b.$c = b.x5a = b.LO = b.dg = b.Mta = b.OSb = b.BSb = b.Bta = b.bE = b.K5a = b.Ga = b.Kta = b.isArray = b.i6a = b.Aj = b.jd = b.is = void 0;
r = a(203);
b.is = r.KF;
b.jd = function(c) {
return b.is.Mg(c);
};
b.Aj = function(c) {
return b.is.uU(c);
};
b.i6a = function(c) {
return b.is.ela(c);
};
b.isArray = function(c) {
return b.is.WC(c);
};
b.Kta = function(c) {
return b.is.bVa(c);
};
b.Ga = function(c, m, h) {
return b.is.Un(c, m, h);
};
b.K5a = function(c, m, h) {
return b.is.Kla(c, m, h);
};
b.bE = function(c, m, h) {
return b.is.vU(c, m, h);
};
b.Bta = function(c) {
return b.is.gU(c);
};
b.BSb = function(c) {
return b.is.fxb(c);
};
b.OSb = function(c) {
return b.is.gxb(c);
};
b.Mta = function(c) {
return b.is.cVa(c);
};
b.dg = function(c) {
return b.is.lu(c);
};
b.LO = function(c) {
return b.is.Vn(c);
};
b.x5a = function(c) {
return b.is.v5(c);
};
b.$c = function(c) {
return b.is.x5(c);
};
}, function(r, b) {
Object.defineProperty(b, "__esModule", {
value: !0
});
b.lS = b.K2 = b.qkb = b.lkb = b.nkb = b.okb = b.BDa = b.kkb = b.mkb = b.ADa = b.pkb = b.wkb = b.ukb = b.vkb = b.tkb = b.mmb = b.lmb = b.kmb = b.gob = b.hob = b.M2 = b.vJa = b.wJa = b.L2 = b.JFa = b.nmb = b.Dfa = b.F1 = b.Xob = b.zqb = b.sJa = b.ekb = b.OEa = b.a3 = b.iL = b.Z2 = b.rJa = b.jw = b.dkb = b.nDa = b.Wnb = b.erb = b.fob = b.eob = b.sqb = b.rqb = b.Tt = b.Eg = b.bOa = b.rw = void 0;
b.lDa = b.Wha = void 0;
b.rw = function() {};
b.bOa = function() {
return !0;
};
b.Eg = {
ca: !0
};
b.Tt = 1E3;
b.rqb = 86400;
b.sqb = 604800;
b.eob = 1E4;
b.fob = 1E7;
b.erb = 1.5;
b.Wnb = .128;
b.nDa = 7.8125;
b.dkb = 128;
b.jw = 145152E5;
b.rJa = 1E5;
b.Z2 = "$netflix$player$order";
b.iL = -1;
b.a3 = 1;
b.OEa = ["en-US"];
b.ekb = 8;
b.sJa = 65535;
b.zqb = 65536;
b.Xob = Number.MAX_VALUE;
b.F1 = "playready";
b.Dfa = "widevine";
b.nmb = "fps";
b.JFa = "clearkey";
b.L2 = 'audio/mp4; codecs="mp4a.40.5"';
b.wJa = 'audio/mp4; codecs="mp4a.40.42"';
b.vJa = 'audio/mp4; codecs="mp4a.a6"';
b.M2 = 'video/mp4; codecs="avc1.640028"';
b.hob = 'video/mp4; codecs="hev1.2.6.L153.B0"';
b.gob = 'video/mp4; codecs="dvhe.01000000"';
b.kmb = "9A04F079-9840-4286-AB92-E65BE0885F95";
b.lmb = "29701FE4-3CC7-4A34-8C5B-AE90C7439A47";
b.mmb = "EDEF8BA9-79D6-4ACE-A3C8-27DCD51D21ED";
b.tkb = ["4E657466-6C69-7850-6966-665374726D21", "4E657466-6C69-7848-6165-6465722E7632"];
b.vkb = "A2394F52-5A9B-4F14-A244-6C427C648DF4";
b.ukb = "4E657466-6C69-7846-7261-6D6552617465";
b.wkb = "8974DBCE-7BE7-4C51-84F9-7148F9882554";
b.pkb = "mp4a";
b.ADa = "enca";
b.mkb = "ec-3";
b.kkb = "avc1";
b.BDa = "encv";
b.okb = "hvcC";
b.nkb = "hev1";
b.lkb = "dvhe";
b.qkb = "vp09";
b.K2 = 0;
b.lS = 1;
b.Wha = "position:relative;width:100%;height:100%;overflow:hidden";
b.lDa = "AAAAJGZ0eXBpc28yAAAAAGlzb21pc28yZGFzaGlzbzZwaWZmAAAAhHV1aWROZXRmbGl4UGlmZlN0cm0hAQAAAAAAAAAEnph8AAAAAACYloAAAAABBq7BRQAAAAAAADQaAAAAAASeVDAAAAAAAAAjXwAAELsAAAAAAAAIKwAACoQxmsddr5Pt+Lrq/zLsOAU/AAAAAAAAHRsAAAOSAAAAAAAAIK0AAAKyAAAAGGZyZWUAAAAAAAAAAAAAAAAAAAAAAAAATXV1aWTi6QKlfkPiQZDaISEYxWQyAAAAAAAAAADesO2iTmV0ZmxpeCBNZWRpYSBMaWJyYXJ5IFZlcnNpb24gODAuMTAuMTcuIAAAAAcebW9vdgAAAHhtdmhkAQAAAAAAAADesO2jAAAAAN6w7aMAmJaAAAAAAAAAAAAAAQAAAQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAr5wc3NoAAAAAJoE8HmYQEKGq5LmW+CIX5UAAAKengIAAAEAAQCUAjwAVwBSAE0ASABFAEEARABFAFIAIAB4AG0AbABuAHMAPQAiAGgAdAB0AHAAOgAvAC8AcwBjAGgAZQBtAGEAcwAuAG0AaQBjAHIAbwBzAG8AZgB0AC4AYwBvAG0ALwBEAFIATQAvADIAMAAwADcALwAwADMALwBQAGwAYQB5AFIAZQBhAGQAeQBIAGUAYQBkAGUAcgAiACAAdgBlAHIAcwBpAG8AbgA9ACIANAAuADAALgAwAC4AMAAiAD4APABEAEEAVABBAD4APABQAFIATwBUAEUAQwBUAEkATgBGAE8APgA8AEsARQBZAEwARQBOAD4AMQA2ADwALwBLAEUAWQBMAEUATgA+ADwAQQBMAEcASQBEAD4AQQBFAFMAQwBUAFIAPAAvAEEATABHAEkARAA+ADwALwBQAFIATwBUAEUAQwBUAEkATgBGAE8APgA8AEsASQBEAD4AQQBBAEEAQQBBAE8AYwBHAHkAeQA0AEEAQQBBAEEAQQBBAEEAQQBBAEEAQQA9AD0APAAvAEsASQBEAD4APABDAEgARQBDAEsAUwBVAE0APgBvAE8ARwBWAHcAUwB0AGYAcABvAHMAPQA8AC8AQwBIAEUAQwBLAFMAVQBNAD4APABDAFUAUwBUAE8ATQBBAFQAVABSAEkAQgBVAFQARQBTAD4APABMAGkAdAB0AGwAZQBFAG4AZABpAGEAbgBLAEkARAA+AHQAcgB1AGUAPAAvAEwAaQB0AHQAbABlAEUAbgBkAGkAYQBuAEsASQBEAD4APAAvAEMAVQBTAFQATwBNAEEAVABUAFIASQBCAFUAVABFAFMAPgA8AC8ARABBAFQAQQA+ADwALwBXAFIATQBIAEUAQQBEAEUAUgA+AAAAAExwc3NoAAAAAClwH+Q8x0o0jFuukMdDmkcAAAAsAAAABAAAAAAG5y7LEQCZXm+LFtZ8GJ3qeQbAI/HmYiUnLTrYNjnKW2j/oyoAAAA0cHNzaAAAAADt74upedZKzqPIJ9zVHSHtAAAAFAgBEhAAAAAABucuywAAAAAAAAAAAAADJHRyYWsAAABodGtoZAEAAAcAAAAA3rDtowAAAADesO2jAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAFAAAAAtAAAAAAACxlZHRzAAAAJGVsc3QBAAAAAAAAAQAAAAEGrsFFAAAAAAAGW5sAAQAAAAACiG1kaWEAAAAsbWRoZAEAAAAAAAAA3rDtowAAAADesO2jAJiWgAAAAAAAAAAAVcQAAAAAADRoZGxyAAAAAAAAAAB2aWRlAAAAAAAAAAAAAAAAVmlkZW8gTWVkaWEgSGFuZGxlcgAAAAIgbWluZgAAABR2bWhkAAAAAQAAAAAAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAAB4HN0YmwAAAAQc3R0cwAAAAAAAAAAAAAAEGN0dHMAAAAAAAAAAAAAAYRzdHNkAAAAAAAAAAEAAAF0ZW5jdgAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAUAAtAASAAAAEgAAAAAAAAAAQpBVkMgQ29kaW5nAAAAAAAAAAAAAAAAAAAAAAAAAAAAABj//wAAADxhdmNDAU1AH//hACVnTUAf6IAoAt2AiAAAAwAIAAADAYcBAAHH7gAAl/pSYYA8YMRIAQAEaOvssgAAABBwYXNwAAAAAQAAAAEAAAAidXVpZE5ldGZsaXhGcmFtZVJhdGUAAAAAAABdwAPoAAAAYHNpbmYAAAAMZnJtYWF2YzEAAAAUc2NobQAAAABwaWZmAAEAAQAAADhzY2hpAAAAMHV1aWSJdNvOe+dMUYT5cUj5iCVUAAAAAAAAAQgAAAAABucuywAAAAAAAAAAAAAAUHNpbmYAAAAMZnJtYWF2YzEAAAAUc2NobQAAAABjZW5jAAEAAAAAAChzY2hpAAAAIHRlbmMAAAAAAAABCAAAAAAG5y7LAAAAAAAAAAAAAAAQc3RzYwAAAAAAAAAAAAAAFHN0c3oAAAAAAAAAAAAAAAAAAAAQc3RjbwAAAAAAAAAAAAAAPG12ZXgAAAAUbWVoZAEAAAAAAAABBq7BRQAAACB0cmV4AAAAAAAAAAIAAAABAAAAAAAAAAABoQAA";
}, function(r, b) {
function a() {}
Object.defineProperty(b, "__esModule", {
value: !0
});
b.Ee = b.ib = b.Ef = b.Xb = b.ha = b.lga = b.bG = b.Ha = void 0;
(function(c) {
c.f7a = "loadedtracks";
c.e7a = "loadedmetadata";
c.loaded = "loaded";
c.error = "error";
c.closed = "closed";
c.Pq = "currenttimechanged";
c.mhb = "unthrottledcurrenttimechanged";
c.Cma = "bufferedtimechanged";
c.j_a = "durationchanged";
c.VBa = "videosizechanged";
c.fab = "pausedchanged";
c.lxa = "playingchanged";
c.Q_a = "endedchanged";
c.VM = "busychanged";
c.g6 = "audiotracklistchanged";
c.ym = "audiotrackchanged";
c.Vv = "timedtexttracklistchanged";
c.cm = "timedtexttrackchanged";
c.j0 = "trickplayframeschanged";
c.p9a = "mutedchanged";
c.Cib = "volumechanged";
c.Tza = "showsubtitle";
c.kya = "removesubtitle";
c.Oac = "watermark";
c.Gta = "isReadyToTransition";
c.wO = "inactivated";
c.p5a = "internalPlaybackError";
c.Y4b = "segmentmaploaded";
c.Z4b = "segmentpresenting";
c.MVa = "autoplaywasallowed";
c.i6 = "autoplaywasblocked";
c.yyb = "adsstatechanged";
})(b.Ha || (b.Ha = {}));
(b.bG || (b.bG = {})).l_ = "playgraphsegmenttransition";
b.lga = a;
a.Jdb = "serverTimeChanged";
(function(c) {
c.IM = "aseReport";
c.hma = "autoplayWasAllowed";
c.Bi = "autoplayWasBlocked";
c.Kz = "bufferUnderrun";
c.closed = "closed";
c.dh = "closing";
c.Pq = "currentTimeChanged";
c.xD = "downloadComplete";
c.wO = "inactivated";
c.S6a = "licenseAdded";
c.ZX = "licensed";
c.bY = "locationSelected";
c.Tua = "manifestClosing";
c.UI = "manifestPresenting";
c.haa = "mediaBufferChanged";
c.Paa = "nextBranchingSegmentChosen";
c.xv = "playbackStart";
c.gn = "playbackReady";
c.Ek = "repositioned";
c.IJ = "repositioning";
c.mdb = "safePlayRequested";
c.QJ = "segmentPresenting";
c.o_ = "serverSwitch";
c.Eeb = "shouldUpdateVideoDiagInfo";
c.JQ = "subtitleError";
c.TAa = "throttledMediaTimeChanged";
c.nhb = "unthrottledMediaTimeChanged";
c.OQ = "timedTextRebuffer";
c.Vv = "timedTextTrackListChanged";
c.j0 = "trickPlayFramesChanged";
c.yBa = "updateNextBranchingSegmentWeights";
c.bac = "userInitiatedPause";
c.iib = "userInitiatedResume";
c.Mgb = "tracksHydrated";
})(b.ha || (b.ha = {}));
(function(c) {
c[c.gL = 0] = "NOTLOADED";
c[c.LOADING = 1] = "LOADING";
c[c.we = 2] = "NORMAL";
c[c.CLOSING = 3] = "CLOSING";
c[c.CLOSED = 4] = "CLOSED";
})(b.Xb || (b.Xb = {}));
(function(c) {
c[c.we = 1] = "NORMAL";
c[c.md = 2] = "BUFFERING";
c[c.COa = 3] = "STALLED";
})(b.Ef || (b.Ef = {}));
(function(c) {
c[c.Tf = 1] = "WAITING";
c[c.Kc = 2] = "PLAYING";
c[c.wh = 3] = "PAUSED";
c[c.Kr = 4] = "ENDED";
})(b.ib || (b.ib = {}));
(function(c) {
c[c.hw = 0] = "INITIAL";
c[c.eG = 1] = "SEEK";
c[c.D3 = 2] = "TRACK_CHANGED";
c[c.qL = 3] = "SEGMENT_CHANGED";
c[c.J1 = 4] = "FORCE_REBUFFER";
})(b.Ee || (b.Ee = {}));
}, function(r, b) {
Object.defineProperty(b, "__esModule", {
value: !0
});
b.Wc = "ApplicationSymbol";
}, function(r, b, a) {
var h,
k,
d,
f,
l,
g,
n,
p,
q,
t,
u,
v,
w,
x,
y,
z,
A,
B,
D;
function c(C) {
return (C = b.config.Q9b[m(C)]) ? C : {};
}
function m(C) {
if (C)
return 0 <= C.indexOf("billboard") ? "billboard" : 0 <= C.toLowerCase().indexOf("preplay") ? "preplay" : 0 <= C.indexOf("embedded") ? "embedded" : 0 <= C.indexOf("content-sampling") ? "content-sampling" : 0 <= C.indexOf("video-merch-bob-horizontal") ? "video-merch-bob-horizontal" : 0 <= C.indexOf("mini-modal-horizontal") ? "mini-modal-horizontal" : 0 <= C.indexOf("standard") ? "standard" : 0 <= C.indexOf("branching") ? "branching" : 0 <= C.indexOf("live") ? "live" : C;
}
Object.defineProperty(b, "__esModule", {
value: !0
});
b.cDb = b.dDb = b.TXa = b.Qna = b.UXa = b.Pna = b.config = void 0;
h = a(16);
k = a(43);
d = a(8);
f = a(40);
l = a(23);
g = a(26);
n = a(42);
p = a(24);
a(6);
q = a(12);
t = a(15);
u = a(171);
v = a(50);
w = a(87);
x = a(108);
y = a(51);
z = a(5);
A = a(47);
B = a(18);
D = a(118);
b.UXa = function(C, F) {
var va,
Fa,
za,
M,
Q,
Y,
ca,
sa,
Ia;
function G(Ka, Ta) {
(0, p.Ng)(Ka, function(Oa, Xa) {
(0, t.$c)(Xa) ? Ta[Oa] = Xa.call(void 0, Ta[Oa]) : (0, t.Aj)(Xa) && (Ta[Oa] = Ta[Oa] || ({}), G(Xa, Ta[Oa]));
});
}
function E(Ka, Ta, Oa, Xa) {
for (var Ya = [], ob = 3; ob < arguments.length; ++ob) {
Ya[ob - 3] = arguments[ob];
}
return function(Ca) {
(0, t.jd)(Ca) && (Oa = Ca);
(0, l.nb)((0, t.$c)(Ka));
return Ka.apply(void 0, [Ta, Oa].concat(ha(Ya)));
};
}
function I(Ka) {
Ka = Ka.toLowerCase();
M.hasOwnProperty(Ka) && (za[Ka] = M[Ka], Q[Ka] = M[Ka]);
return Ka;
}
function O(Ka, Ta, Oa) {
var Xa;
Ka = Ka.toLowerCase();
if (za.hasOwnProperty(Ka)) {
Xa = za[Ka];
try {
Xa = Oa ? Oa(Xa) : Xa;
} catch (Ya) {
Xa = void 0;
}
if (void 0 !== Xa)
return Xa;
(0, l.nb)(!1);
d.log.error("Invalid configuration value. Name: " + Ka);
}
return Ta;
}
function K(Ka, Ta, Oa, Xa) {
return O(Ka, Ta, function(Ya) {
(0, t.dg)(Ya) && (Ya = (0, p.Kj)(Ya));
if ((0, t.K5a)(Ya, Oa, Xa))
return Ya;
});
}
function H(Ka, Ta, Oa, Xa) {
return O(Ka, Ta, function(Ya) {
(0, t.dg)(Ya) && (Ya = (0, p.Kj)(Ya));
if ((0, t.bE)(Ya, Oa, Xa))
return Ya;
});
}
function R(Ka, Ta, Oa, Xa) {
return O(Ka, Ta, function(Ya) {
(0, t.dg)(Ya) && (Ya = parseFloat(Ya));
if ((0, t.Ga)(Ya, Oa, Xa))
return Ya;
});
}
function N(Ka, Ta, Oa) {
return O(Ka, Ta, function(Xa) {
if (Oa ? Oa.test(Xa) : (0, t.dg)(Xa))
return Xa;
});
}
function J(Ka, Ta) {
return O(Ka, Ta, function(Oa) {
if ("true" == Oa || !0 === Oa)
return !0;
if ("false" == Oa || !1 === Oa)
return !1;
});
}
function L(Ka, Ta) {
return O(Ka, Ta, function(Oa) {
if ((0, t.dg)(Oa))
return JSON.parse((0, q.U2)(Oa));
if ((0, t.Aj)(Oa))
return Oa;
});
}
function P(Ka, Ta, Oa, Xa, Ya, ob) {
var Ca;
Ka = Ka.toLowerCase();
za.hasOwnProperty(Ka) && (Ca = za[Ka]);
if (!(0, t.jd)(Ca))
return Ta;
if ((0, t.dg)(Ca))
if (Ca[0] !== Oa)
Ca = Xa(Ca);
else
try {
Ca = JSON.parse((0, q.U2)(Ca));
} catch (Ua) {
Ca = void 0;
}
if (void 0 === Ca)
return Ta;
for (Ka = 0; Ka < Ya.length; Ka++) {
if (!Ya[Ka](Ca))
return Ta;
}
return ob ? ob(Ca) : Ca;
}
function S(Ka, Ta, Oa, Xa, Ya) {
return P(Ka, Ta, "[", function(ob) {
ob = ob.split("|");
for (var Ca = ob.length; Ca--;) {
ob[Ca] = (0, p.Kj)(ob[Ca]);
}
return ob;
}, [function(ob) {
return (0, t.isArray)(ob) && 0 < ob.length;
}, function(ob) {
for (var Ca = ob.length; Ca--;) {
if (!(0, t.bE)(ob[Ca], Oa, Xa))
return !1;
}
return !0;
}, function(ob) {
return void 0 === Ya || ob.length >= Ya;
}]);
}
function U(Ka, Ta) {
return P(Ka, Ta, "[", function(Oa) {
Oa = (0, t.isArray)(Oa) ? Oa : Oa.split("|");
for (var Xa = Oa.length; Xa--;) {
try {
Oa[Xa] = JSON.parse((0, q.U2)(Oa[Xa]));
} catch (Ya) {
Oa = void 0;
break;
}
}
return Oa;
}, [function(Oa) {
return (0, t.isArray)(Oa) && 0 < Oa.length;
}, function(Oa) {
for (var Xa = Oa.length; Xa--;) {
if (!(0, t.jd)(Oa[Xa]) || !(0, t.Aj)(Oa[Xa]))
return !1;
}
return !0;
}]);
}
function T(Ka, Ta) {
var Oa;
Oa = X(Ka, []);
return Oa && 0 < Oa.length ? (0, D.Do)(Oa) : U(Ka, Ta);
}
function X(Ka, Ta, Oa, Xa) {
return P(Ka, Ta, "[", function(Ya) {
return (0, t.isArray)(Ya) ? Ya : Ya.split("|");
}, [function(Ya) {
return (0, t.isArray)(Ya) && 0 < Ya.length;
}, function(Ya) {
for (var ob = Ya.length; ob--;) {
if (Oa ? !Oa.test(Ya[ob]) : !(0, t.LO)(Ya[ob]))
return !1;
}
return !0;
}, function(Ya) {
return void 0 === Xa || Ya.length >= Xa;
}]);
}
function ja(Ka, Ta, Oa) {
return P(Ka, Ta, "{", function(Xa) {
var Ya,
Ca,
Ua;
Ya = {};
Xa = Xa.split(";");
for (var ob = Xa.length; ob--;) {
Ca = Xa[ob];
Ua = Ca.indexOf(":");
if (0 >= Ua)
return;
Ya[Ca.substring(0, Ua)] = Ca.substring(Ua + 1);
}
return Ya;
}, [function(Xa) {
return (0, t.Aj)(Xa) && 0 < Object.keys(Xa).length;
}, function(Xa) {
if (Oa)
for (var Ya in Xa) {
if (!Oa.test(Xa[Ya]))
return !1;
}
return !0;
}], function(Xa) {
var Ya;
Ya = {};
(0, p.re)(Ya, Ta);
(0, p.re)(Ya, Xa);
return Ya;
});
}
function qa(Ka) {
var Ta;
Ta = [];
(0, p.Ng)(Ka, function(Oa, Xa) {
var Ya;
try {
Ya = "videoapp" === Oa.toLowerCase() ? "[object object]" : JSON.stringify(Xa);
} catch (ob) {
Ya = "cantparse";
}
Ta.push(Oa + "=" + Ya);
});
return Ta.join("\n");
}
va = /^[0-9]+[%]?$/;
Fa = /^[0-9]*$/;
Q = {};
Y = d.ya.get(f.Po);
ca = d.ya.get(x.ZF);
(function(Ka) {
function Ta(Oa) {
Oa.split(",").forEach(function(Xa) {
var Ya;
Ya = Xa.indexOf("=");
0 < Ya && (za[Xa.substring(0, Ya).toLowerCase()] = Xa.substring(Ya + 1));
});
}
za = {};
(0, p.re)(za, Ka);
C && C.length && q.forEach.call(C, function(Oa) {
(0, t.dg)(Oa) ? Ta(Oa) : (0, t.Aj)(Oa) && (0, p.re)(za, Oa, {
hY: !0
});
});
M = (0, p.re)({}, (0, k.X8)(), {
hY: !0
});
if (Ka = (0, k.Hbb)().cadmiumconfig)
(d.log.info("Config cookie loaded", Ka),
Ta(Ka));
if (d.ya.get(A.pq).J5 || za.istestaccount)
((0, p.re)(za, M),
Q = M);
})(F);
b.config = {};
sa = {
yJb: E(J, I("enableXHEAAC"), !1),
z_a: E(J, I("enableDDPlus20"), !0),
y_a: E(J, I("enableDDPlus"), !0),
GN: E(J, I("enableDDPlusAtmos"), !0),
fJb: E(J, I("enableLSSDH"), !0),
$Ib: E(J, I("enableHEVC"), !1),
O$a: E(J, I("overrideEnableHEVC"), !1),
epa: E(J, I("enableHDR"), !1),
N$a: E(J, I("overrideEnableHDR"), !1),
M$a: E(J, I("overrideEnableDV"), !1),
EN: E(J, I("enableAVCHigh"), ca.EN),
L$a: E(J, I("overrideEnableAVCHigh"), !1),
vJb: E(J, I("enableVP9"), !1),
P$a: E(J, I("overrideEnableVP9"), !1),
SIb: E(J, I("enableAV1"), !1),
K$a: E(J, I("overrideEnableAV1"), !1),
a_b: E(J, I("overrideEnableXHEAAC"), !1),
ZZb: E(J, "overrideEnableAllAudioProfiles", !1),
$Zb: E(J, "overrideEnableAllVideoProfiles", !1),
lJb: E(J, I("enablePRK"), !1),
XIb: E(J, I("enableDV"), !1),
C_a: E(J, I("enableHWDRM"), !1),
cJb: E(J, I("enableImageSubs"), !0),
lH: E(T, I("audioProfiles"), ca.lH),
ZIb: E(J, I("enableFullHdForWidevineL1"), !1),
tJb: E(J, I("enableUHD"), !0),
$da: E(H, "videoCapabilityDetectorType", g.om.Dy),
cma: E(H, "audioCapabilityDetectorType", g.aw.Dy),
Cn: E(T, I("videoProfiles"), ca.Cn),
QUa: E(T, I("additionalVideoProfiles"), []),
Jwb: E(X, I("timedTextProfiles"), ca.Uv),
Uv: function() {
return sa.Jwb().filter(function(Ka) {
return Ka === n.lm.mfa ? sa.fJb() : Ka === n.lm.fL ? sa.cJb() : !0;
});
},
endpoint: E(J, I("endpoint"), !1),
version: E(N, "version", "unknown"),
aJb: E(J, I("enableHdcp"), !1),
Ev: E(J, I("prepareCadmium"), !1),
kxb: E(J, I("acceptManifestOnPrepareItemParams"), !0),
H0b: E(L, "ppmconfig", {
maxNumberTitlesScheduled: 1
}),
YV: E(J, I("enableLdlPrefetch"), !1),
G_a: E(J, I("enableMediaPrefetch"), !1),
gJb: E(J, I("enableManifestCache"), !0),
oHb: E(J, I("deleteCachedManifestOnPlayback"), !1),
nHb: E(J, I("deleteCachedManifestOnCreate"), !1),
rHb: E(J, I("deleteOtherManifestCacheOnCreate"), !1),
qHb: E(J, I("deleteOtherLdlCacheOnCreate"), !1),
elc: E(H, I("periodicPrepareLogsIntervalMilliseconds"), 36E5),
c1b: E(H, I("prepareManifestCacheMaxCount"), 50),
a1b: E(H, I("prepareLdlCacheMaxCount"), 30),
abb: E(H, I("prepareManifestExpiryMilliseconds"), 12E5),
b1b: E(H, I("prepareLdlExpiryMilliseconds"), 78E4),
V0b: E(H, I("prefetcherMaxWishlistSize"), 10),
U0b: E(H, I("prefetcherBudgetInBytes"), Infinity),
W0b: E(J, I("prefetcherOverrideItemPriority"), !0),
$0b: E(N, I("prepareInsertStrategyPersistentTasks"), "append", /^(prepend|append|ignore)$/),
Xmc: E(L, "videoApp"),
$E: E(L, "storageRules"),
m8: E(J, "ftlEnabled", ca.m8),
Lsa: E(H, I("imageSubsResolution"), 0),
BRb: E(H, I("imageSubsMaxBuffer"), ca.ZVb.fa(y.cw), 0),
aV: E(J, I("captureBatteryStatus"), !1),
uMb: E(H, I("getBatteryApiTimeoutMilliseconds"), 5E3),
Ym: E(N, I("keySystemId"), ca.Ym),
B6a: E(X, I("keySystemList"), void 0, void 0),
PBa: E(J, I("validateKeySystemAccess"), !1),
QWb: E(H, I("hdcpGlobalTimeout1"), 1E4),
RWb: E(H, I("hdcpGlobalTimeout2"), 1E4),
xkc: E(H, I("hdcpQueryTimeout1"), 1E3),
ykc: E(H, I("hdcpQueryTimeout2"), 1E3),
M8a: E(H, I("hdcpQueryTimeout2"), 100),
SWb: E(J, I("microsoftHwdrmRequiresHevc"), !1),
L8a: E(J, I("microsoftClearLeadRequiresSwdrm"), !1),
NWb: E(J, I("microsoftEnableDeviceInfo"), !1),
OWb: E(J, I("microsoftEnableHardwareInfo"), !1),
PWb: E(J, I("microsoftEnableHardwareReset"), !1),
R$b: E(J, I("useHevcCodecForDolbyVision"), !1),
iJb: E(J, I("enableMediaCapabilities"), !1),
G0b: E(J, I("powerEfficientForVideo"), !1),
jJb: E(J, I("enableMediaCapabilitiesSourceBufferCheck"), !1),
bVb: E(J, "logMediaPipelineStatus", !1),
OZ: E(J, I("renderDomDiagnostics"), !0),
o7a: function() {
return -1;
},
RO: E(K, I("logDisplayMaxEntryCount"), ca.RO, -1),
hVb: E(K, I("logToConsoleLevel"), -1),
phc: E(K, I("bladerunnerCmdHistorySize"), 10),
hA: function() {
return Y.hA;
},
xua: E(J, "logErrorIfEsnNotProvided", !0),
lpa: E(J, "enforceSinglePlayback", ca.lpa),
C7: E(J, "enforceSingleSession", ca.C7),
Dna: E(J, "closeOtherPlaybacks", !0),
nzb: E(H, "asyncLoadTimeout", 15E3, 1),
qVb: E(H, "mainThreadMonitorPollRate", 0),
uI: function() {
return Y.uI;
},
$M: function() {
return Y.$M;
},
n0: function() {
return Y.n0;
},
oib: E(H, I("verbosePlaybackInfoDenominator"), 0),
lca: E(J, "renderTimedText", !0),
I0b: E(J, "preBufferTimedText", !0),
sKb: E(J, "fatalOnTimedTextLoadError", !0),
ugb: E(ja, "timedTextStyleDefaults", {}),
ZAa: E(ja, "timedTextStyleOverrides", {}),
YAa: E(ja, "timedTextFontFamilyMapping", ca.YAa || ({
"default": "font-family:Arial,Helvetica;font-weight:bolder"
})),
PQ: E(H, "timedTextSimpleFallbackThreshold", ca.PQ.fa(y.cw)),
vO: E(X, I("imscLanguageList"), ca.vO, []),
noa: E(N, I("customDfxpUrl")),
sJb: E(J, I("enableSubtitleTrackerLogging"), !1),
l5b: E(J, I("sendSubtitleQoeLogblobOnMidplay"), !1),
Zma: E(S, "cdnIdWhiteList", []),
Yma: E(S, "cdnIdBlackList", []),
kqa: E(N, I("forceAudioTrack")),
oqa: E(N, I("forceTimedTextTrack")),
hWb: E(H, I("maxRetriesTimedTextDownload"), 0),
V8b: E(H, I("timedTextRetryInterval"), 8E3),
A7b: E(N, "storageType", "idb", /^(none|fs|idb|ls)$/),
k7a: E(H, "lockExpiration", 1E4),
$Ub: E(H, "lockRefresh", 3E3),
xBb: E(J, "captureUnhandledExceptions", !0),
ARb: E(J, "ignoreUnhandledExceptionDuringPlayback", !0),
T9b: E(J, "unhandledExceptionsArePlaybackErrors", !1),
hhb: E(N, "unhandledExceptionSource", ""),
l1b: E(J, "preserveLastFrame", !1),
ZWb: E(H, "minBufferingTimeInMilliseconds", 4E3),
J1b: E(H, "progressBackwardsGraceTimeMilliseconds", 4E3),
K1b: E(H, "progressBackwardsMinPercent", 10),
kAb: E(N, I("bookmarkIgnoreBeginning"), "0", va),
lAb: E(N, I("bookmarkIgnoreEnd"), "5%", va),
mAb: E(N, I("bookmarkIgnoreEndForBranching"), "60000", va),
WO: E(H, "maxParallelConnections", 3),
vya: E(J, "reportThroughputInLogblobs", !0),
Lx: E(H, "minAudioMediaRequestDuration", 16E3),
XWb: E(H, "minAudioMediaRequestDurationBranching", 0),
WA: E(H, "minVideoMediaRequestDuration", 4E3),
gXb: E(H, "minVideoMediaRequestDurationVariableGOP", 0),
eXb: E(H, "minVideoMediaRequestDurationBranching", 0),
saa: E(H, "minAudioMediaRequestSizeBytes", 0),
Aaa: E(H, "minVideoMediaRequestSizeBytes", 0),
zIb: E(J, "droppedFrameRateFilterEnabled", !1),
AIb: E(H, "droppedFrameRateFilterMaxObservation", 60, 10, 1E3),
CIb: E(function(Ka, Ta, Oa, Xa, Ya, ob) {
return P(Ka, Ta, "[", function(Ca) {
Ca = Ca.split(";");
for (var Ua = Ca.length; Ua--;) {
Ca[Ua] = Ca[Ua].split("|");
for (var bb = Ca[Ua].length; bb--;) {
Ca[Ua][bb] = (0, p.Kj)(Ca[Ua][bb]);
}
}
return Ca;
}, [function(Ca) {
return (0, t.isArray)(Ca) && 0 < Ca.length;
}, function(Ca) {
for (var Ua = Ca.length; Ua-- && void 0 !== Ca;) {
if (!(0, t.isArray)(Ca[Ua]))
return !1;
for (var bb = Ca[Ua].length; bb--;) {
if (!(0, t.bE)(Ca[Ua][bb], Oa, Xa))
return !1;
}
}
return !0;
}, function(Ca) {
if (void 0 !== Ya)
for (var Ua = Ca.length; Ua--;) {
if (Ya !== Ca[Ua].length)
return !1;
}
return !0;
}, function(Ca) {
return void 0 === ob || Ca.length >= ob;
}]);
}, "droppedFrameRateFilterPolicy", [[3, 15], [6, 9], [9, 2], [15, 1]], void 0, void 0, 2, 0),
BIb: E(H, "droppedFrameRateFilterMinHeight", 384),
DIb: E(S, "droppedFramesPercentilesList", []),
TWb: E(J, "microsoftScreenSizeFilterEnabled", !1),
MTb: E(J, "keyStatusFilterEnabled", !1),
n4a: E(H, "hdcpEngagementWaitTime", 0),
P9b: E(J, "uiLabelFilterEnabled", !0),
O9b: E(L, "uiLabelFilter", {}),
bHb: E(H, I("defaultVolume"), 100, 0, 100),
hva: E(H, I("maxPlaybackRate"), 2, 0, 16),
m0a: E(J, "fastForwardAds", !1),
$gc: E(J, "allowSeekOverAds", !1),
LZa: E(J, "disableVideoRightClickMenu", !1),
waa: E(H, "minDecoderBufferMilliseconds", 1E3, 0, h.jw),
vE: E(H, "optimalDecoderBufferMilliseconds", 5E3, 0, h.jw),
ywa: E(H, "optimalDecoderBufferMillisecondsBranching", 3E3, 0, h.jw),
zwa: E(H, "optimalDecoderBufferMillisecondsLive", 2E3, 0, h.jw),
oE: E(H, "minimumTimeBeforeBranchDecision", 3E3, 0, h.jw),
c9a: E(H, "minimumTimeBeforeDelayedSeekToQueuedSegment", 500, 0, h.jw),
PA: E(H, "maxDecoderBufferMilliseconds", ca.PA.fa(z.ma), 0, h.jw),
jZa: E(H, "decoderTimeoutMilliseconds", 1E4, 1),
H9a: E(H, "noRenderTimeoutMilliseconds", 0),
A_b: E(H, "pauseTimeoutLimitMilliseconds", 18E5),
Nsa: E(H, "inactivityMonitorInterval", 3E4, 0),
jxb: E(S, "abrdelLogPointsSeconds", [15, 30, 60, 120], 0, void 0, 4),
JN: E(J, "enableTrickPlay", !1),
pyb: E(S, "additionalDownloadSimulationParams", [2E3, 2E3, 100], 0, void 0, 3),
z9b: E(H, "trickPlayHighResolutionBitrateThreshold", 1E3),
A9b: E(H, "trickPlayHighResolutionThresholdMilliseconds", 1E4),
D9b: E(R, "trickplayBufferFactor", .5),
y9b: E(H, "trickPlayDownloadRetryCount", 1),
Xua: E(N, "marginPredictor", "simple", /^(simple|scale|iqr|percentile|ci)$/),
ZJb: E(X, "experimentalFilter", ["throughput-wssl"]),
qna: E(N, "ciPredictorSource", "throughput-ci"),
bAa: E(N, "simulationDurationStrategy", "default"),
Mva: E(N, "networkMeasurementGranularity", "video_location", /^(location|video_location)$/),
wHa: E(L, "HistoricalTDigestConfig", {
maxc: 25,
rc: "ewma",
c: .5,
hl: 7200
}),
f8a: E(K, "maxIQRSamples", Infinity),
V8a: E(K, "minIQRSamples", 5),
cib: E(J, "useResourceTimingAPI", !1),
xRb: E(J, "ignoreFirstByte", !0),
ova: E(J, "mediaRequestAsyncLoadStart", ca.ova),
Z$b: E(J, "useXHROnLoadStart", !1),
Jpa: E(S, "failedDownloadRetryWaitsASE", [10, 200, 500, 1E3, 2E3, 4E3]),
I6: E(H, "connectTimeoutMilliseconds", 8E3, 500),
Rva: E(H, "noProgressTimeoutMilliseconds", 8E3, 500),
tgb: E(H, "timedTextDownloadRetryCountBeforeCdnSwitch", 3),
Lkc: E(H, "netflixRequestExpiryTimeout", 0),
Pac: E(J, "webkitDecodedFrameCountIncorrectlyReported", !1),
R4b: E(H, "seekBackOnAudioTrackChangeMilliseconds", 8E3),
oda: E(X, I("supportedAudioTrackTypes"), [], void 0, 1),
R9: E(H, "initialLogFlushTimeout", 5E3),
Dab: E(N, "playdataPersistKey", Y.hA ? "unsentplaydatatest" : "unsentplaydata"),
Wlc: E(J, "sendPersistedPlaydata", !0),
h0b: E(H, "playdataPersistIntervalMilliseconds", 4E3),
flc: E(H, "playdataSendDelayMilliseconds", 1E4),
Xlc: E(J, "sendPlaydataBackupOnInit", !0),
eVb: E(X, "logPerformanceTiming", ("navigationStart redirectStart fetchStart secureConnectionStart requestStart domLoading").split(" ")),
N8a: E(J, "midplayEnabled", !0),
qaa: E(H, "midplayIntervalMilliseconds", 3E5),
O8a: E(S, "midplayKeyPoints", [15E3, 3E4, 6E4, 12E4]),
u7: E(H, "downloadReportDenominator", 0),
nIb: E(H, "downloadReportInterval", 3E5),
n7a: E(H, "logConfigApplyDenominator", 0),
dWa: E(ja, I("bookmarkByMovieId"), {}),
rW: E(J, I("forceLimitedDurationLicense"), !1),
fE: E(H, I("licenseRenewalRequestDelay"), 0),
Uwa: E(H, I("persistedReleaseDelay"), 1E4),
Vjc: E(J, I("limitedDurationFlagOverride"), void 0),
ldb: E(H, "safariPlayPauseWorkaroundDelay", 100),
$ac: E(H, "workaroundValueForSeekIssue", 1200),
Uma: E(J, I("callEndOfStream"), ca.Uma),
M_b: E(J, "performRewindCheck", !0),
uKb: E(J, "fatalOnUnexpectedSeeking", !0),
tKb: E(J, "fatalOnUnexpectedSeeked", !0),
g6b: E(J, I("setVideoElementSize")),
ACb: E(J, I("clearVideoSrc"), !0),
yZa: E(H, I("delayPlayPause"), 0),
It: E(J, I("useTypescriptEme"), !1),
Thb: E(J, I("useEncryptedEvent"), !0),
QV: E(N, I("drmPersistKey"), "unsentDrmData"),
nbb: E(J, I("promiseBasedEme"), !1),
pYb: E(J, I("nudgeSourceBuffer"), !1),
fza: E(K, I("seekDelta"), 1),
pZ: E(J, I("preciseSeeking"), !1),
K0b: E(J, I("preciseSeekingOnTwoCoreDevice"), !1),
xZa: E(ja, I("delayErrorHandling")),
fl: E(N, "esn", ""),
q0a: E(N, "fesn", ""),
nJb: E(J, I("enablePerformanceLogging"), !1),
B_a: E(J, I("enableEmeVerboseLogging"), !1),
appId: E(N, "appId", "", Fa),
sessionId: E(N, "sessionId", "", Fa),
$ma: E(N, "cdnProxyUrl"),
W$b: E(J, "usePlayReadyHeaderObject", !1),
V0a: E(H, "forceXhrErrorResponseCode", void 0),
Rq: {
Hkc: E(N, "mslApiPath", "/msl/"),
qlc: E(N, "proxyPath", ""),
ny: E(N, "uiVersion"),
Lda: E(N, "uiPlatform"),
Bhc: function() {
return "0";
},
qxa: E(X, "preferredLanguages", h.OEa, /^[a-zA-Z-]{2,5}$/, 1),
tLb: E(N, I("forceDebugLogLevel"), void 0, /^(ERROR|WARN|INFO|TRACE)$/),
g8b: E(J, "supportPreviewContentPin", !0),
h8b: E(J, "supportWatermarking", !0),
J6b: E(J, "showAllSubDubTracks", !1),
Hic: E(J, I("failOnGuidMismatch"), !1)
},
Vba: {
enabled: E(J, "qcEnabled", !1),
Sp: E(N, "qcPackageId", "")
},
Ht: E(J, "useRangeHeader", !1),
ZV: E(J, "enableMilestoneEventList", !0),
Kzb: E(ja, "authenticationKeyNames", (0, p.re)({
e: "DKE",
h: "DKH",
w: "DKW",
s: "DKS"
})),
s8b: E(N, "systemKeyWrapFormat"),
D6b: E(J, "shouldSendUserAuthData", !0),
sza: E(J, "sendUserAuthIfRequired", ca.sza),
x6b: E(J, "shouldClearUserData", !1),
ZQ: E(J, "usesMsl", !0),
yXb: E(J, "mslDeleteStore", !1),
AXb: E(J, "mslPersistStore", !0),
zDb: E(J, "correctNetworkForShortTitles", !0),
F0b: E(J, "postplayHighInitBitrate", !1),
m8b: E(J, "supportsUnequalizedDownloadables", !0),
dZa: E(H, I("debugAseDenominator"), 100),
W5: E(H, "aseAudioBufferSizeBytes", ca.W5.fa(y.cw)),
Z5: E(H, "aseVideoBufferSizeBytes", ca.Z5.fa(y.cw)),
sv: E(H, "minInitVideoBitrate", 560),
zva: E(H, "minHCInitVideoBitrate", 560),
RA: E(H, "maxInitVideoBitrate", Infinity),
zY: E(H, "minInitAudioBitrate", 0),
xY: E(H, "minHCInitAudioBitrate", 0),
kY: E(H, "maxInitAudioBitrate", 65535),
raa: E(H, "minAcceptableVideoBitrate", 235),
nE: E(H, "minRequiredBuffer", 3E4),
cj: E(H, "minPrebufSize", 7800),
vaa: E(H, "minCheckBufferingCompleteInterval", 999999),
Zxa: E(R, "rebufferingFactor", 1),
jr: E(H, "maxBufferingTime", 2600),
KBa: E(J, "useMaxPrebufSize", !0),
TA: E(H, "maxPrebufSize", 45E3),
jva: E(H, "maxRebufSize", Infinity),
O9: E(U, "initialBitrateSelectionCurve", null),
Z4a: E(H, "initSelectionLowerBound", 560),
$4a: E(H, "initSelectionUpperBound", 1050),
X_: E(H, "throughputPercentForAudio", 15),
nma: E(H, "bandwidthMargin", 10),
oma: E(J, "bandwidthMarginContinuous", !1),
pma: E(U, "bandwidthMarginCurve", [{
m: 65,
b: 8E3
}, {
m: 65,
b: 3E4
}, {
m: 50,
b: 6E4
}, {
m: 45,
b: 9E4
}, {
m: 40,
b: 12E4
}, {
m: 20,
b: 18E4
}, {
m: 5,
b: 24E4
}]),
Sna: E(H, "conservBandwidthMargin", 20),
NAa: E(J, "switchConfigBasedOnInSessionTput", !1),
lV: E(H, "conservBandwidthMarginTputThreshold", 0),
Tna: E(U, "conservBandwidthMarginCurve", [{
m: 80,
b: 8E3
}, {
m: 80,
b: 3E4
}, {
m: 70,
b: 6E4
}, {
m: 60,
b: 9E4
}, {
m: 50,
b: 12E4
}, {
m: 30,
b: 18E4
}, {
m: 10,
b: 24E4
}]),
Ufb: E(J, "switchAlgoBasedOnHistIQR", !1),
bF: E(N, "switchConfigBasedOnThroughputHistory", "none", /^(none|iqr|avg)$/),
iva: E(K, "maxPlayerStateToSwitchConfig", -1),
Jua: E(N, "lowEndMarkingCriteria", "none", /^(none|iqr|avg)$/),
iga: E(R, "IQRThreshold", .5),
Asa: E(N, "histIQRCalcToUse", "simple"),
pv: E(H, "maxTotalBufferLevelPerSession", 0),
WV: E(J, "enableCombinedPlaygraphs", !0),
WH: E(J, "enableAdPlaygraphs", !0),
Apa: E(X, "excludedContentPlaygraphIds", []),
z7: E(J, "enableDiscontiguousBuffering", !1),
mqa: E(S, "forceImmediateTransitionTypeForTitles", []),
lqa: E(H, "forceImmediateTransitionExitZone", 0),
Sda: E(J, "useBufferSizeLimiter", !1),
JBa: E(J, "useLegacyFragmentRounding", !1),
v4a: E(H, "highWatermarkLevel", 3E4),
Cgb: E(H, "toStableThreshold", 3E4),
zda: E(H, "toUnstableThreshold", ca.zda.fa(z.ma)),
eAa: E(J, "skipBitrateInUpswitch", !1),
bCa: E(H, "watermarkLevelForSkipStart", 8E3),
z9: E(H, "highStreamRetentionWindow", 9E4),
R$: E(H, "lowStreamTransitionWindow", 51E4),
wsa: E(H, "highStreamRetentionWindowUp", 3E5),
Lua: E(H, "lowStreamTransitionWindowUp", 3E5),
usa: E(H, "highStreamRetentionWindowDown", 6E5),
Kua: E(H, "lowStreamTransitionWindowDown", 0),
tsa: E(R, "highStreamInfeasibleBitrateFactor", .5),
MA: E(H, "lowestBufForUpswitch", 15E3),
M$: E(H, "lockPeriodAfterDownswitch", 15E3),
Nua: E(H, "lowWatermarkLevel", 25E3),
Bx: E(H, "lowestWaterMarkLevel", 2E4),
Oua: E(J, "lowestWaterMarkLevelBufferRelaxed", !1),
laa: E(R, "mediaRate", 1),
XI: E(H, "maxTrailingBufferLen", 1E4),
BU: E(H, "audioBufferTargetAvailableSize", 262144),
y0: E(H, "videoBufferTargetAvailableSize", 1048576),
u8a: E(H, "maxVideoTrailingBufferSize", 8388608),
Y7a: E(H, "maxAudioTrailingBufferSize", 393216),
S7: E(R, "fastUpswitchFactor", 3),
Kpa: E(R, "fastDownswitchFactor", 1),
Op: E(H, "maxMediaBufferAllowed", 24E4),
$za: E(J, "simulatePartialBlocks", !0),
Jeb: E(J, "simulateBufferFull", !0),
Una: E(J, "considerConnectTime", !1),
Rna: E(R, "connectTimeMultiplier", 1),
u7a: E(H, "lowGradeModeEnterThreshold", 12E4),
v7a: E(H, "lowGradeModeExitThreshold", 9E4),
a8a: E(H, "maxDomainFailureWaitDuration", 3E4),
X7a: E(H, "maxAttemptsOnFailure", 18),
e0a: E(J, "exhaustAllLocationsForFailure", !0),
j8a: E(H, "maxNetworkErrorsDuringBuffering", 20),
W$: E(H, "maxBufferingTimeAllowedWithNetworkError", 12E4),
l0a: E(H, "fastDomainSelectionBwThreshold", 2E3),
ggb: E(H, "throughputProbingEnterThreshold", 4E4),
hgb: E(H, "throughputProbingExitThreshold", 34E3),
i7a: E(H, "locationProbingTimeout", 1E4),
t0a: E(H, "finalLocationSelectionBwThreshold", 1E4),
egb: E(R, "throughputHighConfidenceLevel", .75),
fgb: E(R, "throughputLowConfidenceLevel", .4),
I_a: E(J, "enablePerfBasedLocationSwitch", !1),
Gv: E(J, "probeServerWhenError", !0),
Bxa: E(H, "probeRequestTimeoutMilliseconds", 8E3),
Ez: E(J, "allowSwitchback", !0),
BJ: E(H, "probeDetailDenominator", 100),
X$: E(H, "maxDelayToReportFailure", 300),
uua: E(H, "locationStatisticsUpdateInterval", 6E4),
kYa: E(J, "countGapInBuffer", !1),
WUa: E(J, "allowCallToStreamSelector", !0),
oWa: E(H, "bufferThresholdForAbort", 1E4),
gWb: E(H, "maxResponsesInitialTput", 6),
D_a: E(J, "enableInitialTputLogging", !1),
Wwa: E(H, "pipelineScheduleTimeoutMs", 2),
SA: E(H, "maxPartialBuffersAtBufferingStart", 2),
kva: E(H, "maxStreamingSkew", 4E3),
gva: E(H, "maxPendingBufferPercentage", 10),
x9: E(H, "headerRequestSize", 4096),
spa: E(J, "estimateHeaderSize", !1),
vY: E(H, "minBufferLenForHeaderDownloading", 1E4),
a_: E(H, "reserveForSkipbackBufferMs", 1E4),
dwa: E(H, "numExtraFragmentsAllowed", 2),
nr: E(J, "pipelineEnabled", !1),
Seb: E(H, "socketReceiveBufferSize", 0),
e6: E(H, "audioSocketReceiveBufferSize", 32768),
dR: E(H, "videoSocketReceiveBufferSize", 65536),
rsa: E(H, "headersSocketReceiveBufferSize", 32768),
Qda: E(H, "updatePtsIntervalMs", 1E3),
zma: E(H, "bufferTraceDenominator", 100),
SM: E(H, "bufferLevelNotifyIntervalMs", 2E3),
JM: E(H, "aseReportDenominator", 0),
X5: E(H, "aseReportIntervalMs", 3E5),
TIb: E(J, "enableAbortTesting", !1),
hxb: E(H, "abortRequestFrequency", 8),
DAa: E(H, "streamingStatusIntervalMs", 2E3),
mB: E(H, "prebufferTimeLimit", 24E4),
uaa: E(H, "minBufferLevelForTrackSwitch", 2E3),
Pwa: E(H, "penaltyFactorForLongConnectTime", 2),
Hua: E(H, "longConnectTimeThreshold", 200),
Bla: E(H, "additionalBufferingLongConnectTime", 2E3),
Cla: E(H, "additionalBufferingPerFailure", 8E3),
IZ: E(H, "rebufferCheckDuration", 6E4),
F_a: E(J, "enableLookaheadHints", !1),
r7a: E(H, "lookaheadFragments", 2),
fA: E(J, "enableOCSideChannel", !0),
X2: E(L, "OCSCBufferQuantizationConfig", {
lv: 5,
mx: 240
}),
uhb: E(J, "updateDrmRequestOnNetworkFailure", !1),
wZa: E(J, "deferAseScheduling", !1),
$7a: E(H, "maxDiffAudioVideoEndPtsMs", 16E3),
d7: E(H, "defaultHeaderCacheSize", 4),
c7: E(H, "defaultHeaderCacheDataPrefetchMs", 8E3),
iJ: E(J, "neverWipeHeaderCache", !0),
Lva: E(H, "networkFailureResetWaitMs", 2E3),
Kva: E(H, "networkFailureAbandonMs", 6E4),
baa: E(H, "maxThrottledNetworkFailures", 3),
tda: E(H, "throttledNetworkFailureThresholdMs", 200),
Mua: E(K, "lowThroughputThreshold", 400),
zpa: E(J, "excludeSessionWithoutHistoryFromLowThroughputThreshold", !1),
j9a: E(J, "mp4ParsingInNative", !1),
Ueb: E(J, "sourceBufferInOrderAppend", !0),
LJ: E(J, "requireAudioStreamToEncompassVideo", !0),
VUa: E(J, "allowAudioToStreamPastVideo", !0),
Di: E(J, "enableManagerDebugTraces", !1),
H7a: E(H, "managerDebugMessageInterval", 1E3),
G7a: E(H, "managerDebugMessageCount", 20),
V9a: E(J, "notifyManifestCacheEom", !1),
yma: E(H, "bufferThresholdToSwitchToSingleConnMs", 18E4),
xma: E(H, "bufferThresholdToSwitchToParallelConnMs", 12E4),
wba: E(H, "periodicHistoryPersistMs", 3E5),
Cca: E(H, "saveVideoBitrateMs", 18E4),
jVa: E(J, "appendMediaRequestOnComplete", !0),
fea: E(J, "waitForDrmToAppendMedia", !1),
c8: E(J, I("forceAppendHeadersAfterDrm"), !1),
rLb: E(J, I("forceAppendEncryptedStreamHeaderFirst"), !0),
l2b: E(J, I("reappendRequestsOnSkip"), !1),
EXb: E(H, "netIntrStoreWindow", 36E3),
aXb: E(H, "minNetIntrDuration", 8E3),
pKb: E(H, "fastHistoricBandwidthExpirationTime", 10368E3),
Tzb: E(H, "bandwidthExpirationTime", 5184E3),
mKb: E(H, "failureExpirationTime", 86400),
XQb: E(H, "historyTimeOfDayGranularity", 4),
YJb: E(J, "expandDownloadTime", !1),
nXb: E(H, "minimumMeasurementTime", 500),
mXb: E(H, "minimumMeasurementBytes", 131072),
K8b: E(H, "throughputMeasurementTimeout", 2E3),
XRb: E(H, "initThroughputMeasureDataSize", 262144),
L8b: E(N, "throughputPredictor", "ewma"),
J8b: E(H, "throughputMeasureWindow", 5E3),
P8b: E(H, "throughputWarmupTime", 5E3),
I8b: E(H, "throughputIQRMeasureWindow", 5E3),
Unb: E(H, "IQRBucketizerWindow", 15E3),
fDb: E(H, "connectTimeHalflife", 10),
e4b: E(H, "responseTimeHalflife", 10),
WQb: E(H, "historicBandwidthUpdateInterval", 2E3),
lXb: E(H, "minimumBufferToStopProbing", 1E4),
eza: E(N, "secondThroughputEstimator", "none"),
wdb: E(K, "secondThroughputMeasureWindowInMs", Infinity),
YIb: E(X, "enableFilters", ("throughput-ewma throughput-sw throughput-iqr throughput-tdigest avtp entropy").split(" ")),
GKb: E(L, "filterDefinitionOverrides", {}),
VGb: E(N, "defaultFilter", "throughput-ewma"),
Q4b: E(N, "secondaryFilter", "none"),
WGb: E(L, "defaultFilterDefinitions", {
"throughput-ewma": {
type: "discontiguous-ewma",
mw: 5E3,
wt: 5E3
},
"throughput-sw": {
type: "slidingwindow",
mw: 5E3
},
"throughput-iqr": {
type: "iqr",
mx: Infinity,
mn: 5,
bw: 15E3,
iv: 1E3
},
"throughput-iqr-history": {
type: "iqr-history"
},
"throughput-location-history": {
type: "discrete-ewma",
hl: 14400,
"in": 3600
},
"respconn-location-history": {
type: "discrete-ewma",
hl: 100,
"in": 25
},
"throughput-tdigest": {
type: "tdigest",
maxc: 25,
c: .5,
b: 1E3,
w: 15E3,
mn: 6
},
"throughput-tdigest-history": {
type: "tdigest-history",
maxc: 25,
rc: "ewma",
c: .5,
hl: 7200
},
"respconn-ewma": {
type: "discrete-ewma",
hl: 10,
"in": 10
},
avtp: {
type: "avtp"
},
entropy: {
type: "entropy",
mw: 2E3,
sw: 6E4,
"in": "none",
mins: 1,
hdl: [150, 230, 352, 539, 825, 1264, 1936, 2966, 4543, 6958],
uhdl: [150, 230, 352, 539, 825, 1264, 1936, 2966, 4543, 6958, 10657, 16322, 25E3]
}
}),
FY: E(J, "needMinimumNetworkConfidence", !0),
sma: E(J, "biasTowardHistoricalThroughput", !0),
qla: E(J, "addHeaderDataToNetworkMonitor", !1),
lAa: E(J, "startMonitorOnLoadStart", !1),
uya: E(J, "reportFailedRequestsToNetworkMonitor", !1),
Y$: E(K, "maxFastPlayBufferInMs", Infinity),
dva: E(K, "maxFastPlayBitThreshold", Infinity),
Mla: E(J, "appendFirstHeaderOnComplete", !0),
bzb: E(N, "ase_stream_selector", "optimized"),
Zsa: E(N, "initBitrateSelectorAlgorithm", "default"),
Ema: E(N, "bufferingSelectorAlgorithm", "default"),
eZa: E(N, "ase_ls_failure_simulation", ""),
qoa: E(J, "ase_dump_fragments", !1),
roa: E(H, "ase_location_history", 0),
fZa: E(H, "ase_throughput", 0),
hZa: E(J, "ase_simulate_verbose", !1),
A0b: E(H, "pollingPeriod", 150),
TUb: E(H, "loadTimeMs", 18E4),
IVb: E(H, "marginTimeMs", 1E4),
Sqa: E(J, "getDeviceIdFromBindDevice", !1),
pla: E(J, "addFailedLogBlobsToQueue", !0),
Q9b: {
"content-sampling": {
jr: E(H, "contentSamplingMaxBufferingTime", 3E3),
kQ: E(N, "contentSamplingSelectStartingVMAFMethod", "fallback"),
kU: E(J, "contentSamplingActivateSelectStartingVMAF", !0),
tv: E(H, "contentSamplingMinStartingVideoVMAF", 80),
uY: E(H, "contentSamplingMinAcceptableVMAF", 70),
cJ: E(H, "contentSamplingMinAllowedVmaf", 60)
},
billboard: {
sv: E(H, "billboardMinInitVideoBitrate", 1050),
RA: E(H, "billboardMaxInitVideoBitrate", null),
cj: E(H, "billboardMinPrebufSize", null),
TA: E(H, "billboardMaxPrebufSize", null),
jr: E(H, "billboardMaxBufferingTime", null),
SA: E(H, "billboardMaxPartialBuffersAtBufferingStart", null),
Bx: E(H, "billboardLowestWaterMarkLevel", 6E3),
MA: E(H, "billboardLowestBufForUpswitch", 25E3),
bF: E(N, "billboardSwitchConfigBasedOnThroughputHistory", "none", /^(none|iqr|avg)$/)
},
preplay: {
sv: E(H, "preplayMinInitVideoBitrate", 1050),
RA: E(H, "preplayMaxInitVideoBitrate", null),
cj: E(H, "preplayMinPrebufSize", null),
TA: E(H, "preplayMaxPrebufSize", null),
jr: E(H, "preplayMaxBufferingTime", null),
SA: E(H, "preplayMaxPartialBuffersAtBufferingStart", null),
Bx: E(H, "preplayLowestWaterMarkLevel", 6E3),
MA: E(H, "preplayLowestBufForUpswitch", 25E3)
},
embedded: {
sv: E(H, "embeddedMinInitVideoBitrate", 1050),
RA: E(H, "embeddedMaxInitVideoBitrate", null),
cj: E(H, "embeddedMinPrebufSize", null),
TA: E(H, "embeddedMaxPrebufSize", null),
jr: E(H, "embeddedMaxBufferingTime", null),
SA: E(H, "embeddedMaxPartialBuffersAtBufferingStart", null),
Bx: E(H, "embeddedLowestWaterMarkLevel", 6E3),
MA: E(H, "embeddedLowestBufForUpswitch", 25E3)
},
"video-merch-bob-horizontal": {
sv: E(H, "videoMerchBobHorizontalMinInitVideoBitrate", null),
RA: E(H, "videoMerchBobHorizontalMaxInitVideoBitrate", null),
cj: E(H, "videoMerchBobHorizontalMinPrebufSize", null),
TA: E(H, "videoMerchBobHorizontalMaxPrebufSize", null),
jr: E(H, "videoMerchBobHorizontalMaxBufferingTime", null),
SA: E(H, "videoMerchBobHorizontalMaxPartialBuffersAtBufferingStart", null),
Bx: E(H, "videoMerchBobHorizontalLowestWaterMarkLevel", null),
MA: E(H, "videoMerchBobHorizontalLowestBufForUpswitch", null)
},
"mini-modal-horizontal": {
sv: E(H, "miniModalHorizontalMinInitVideoBitrate", null),
RA: E(H, "miniModalHorizontalMaxInitVideoBitrate", null),
cj: E(H, "miniModalHorizontalMinPrebufSize", null),
TA: E(H, "miniModalHorizontalMaxPrebufSize", null),
jr: E(H, "miniModalHorizontalMaxBufferingTime", 500),
SA: E(H, "miniModalHorizontalMaxPartialBuffersAtBufferingStart", null),
Bx: E(H, "miniModalHorizontalLowestWaterMarkLevel", null),
MA: E(H, "miniModalHorizontalLowestBufForUpswitch", null)
},
live: {
cj: E(H, "liveMinPrebufSize", 2E3),
TA: E(H, "liveMaxPrebufSize", 4E3),
jr: E(H, "liveMaxBufferingTime", 500)
}
},
wJb: E(J, "enableVerbosePlaydelayLogging", !1),
qJb: E(J, "enableSeamless", !1),
zsa: E(H, "hindsightDenominator", 0),
ysa: E(H, "hindsightDebugDenominator", 0),
B9: E(L, "hindsightParam", {
numB: Infinity,
bSizeMs: 1E3,
fillS: "last",
fillHl: 1E3
}),
$V: E(J, "enableSessionHistoryReport", !1),
Zoa: E(H, "earlyStageEstimatePeriod", 1E4),
P6a: E(H, "lateStageEstimatePeriod", 3E4),
$$: E(H, "maxNumSessionHistoryStored", 30),
zaa: E(H, "minSessionHistoryDuration", 3E4),
Gx: E(H, "maxActiveRequestsPerSession", 3),
U$: E(H, "maxActiveRequestsSABCell100", 2),
pua: E(J, "limitAudioDiscountByMaxAudioBitrate", !0),
ae: E(L, "browserInfo", {}),
IAb: E(H, I("busyGracePeriod"), 199),
m5b: E(J, I("sendTransitionLogblob"), !0),
JIb: E(J, I("editVideoFragments"), !0),
x7: E(J, I("earlyAppendSingleChildBranch"), !0),
JRb: E(J, I("includeSegmentInfoOnLogblobs"), !0),
dKb: E(J, "exposeTestData", !1),
cKb: E(J, I("exposeErrorData"), !1),
soa: E(J, "declareBufferingCompleteAtSegmentEnd", !0),
kH: E(J, I("applyProfileTimestampOffset"), !1),
Wn: E(J, I("applyProfileStreamingOffset"), !1),
rY: E(J, I("mediaSourceSupportsNegativePts"), !1),
Fyb: E(J, I("allowSmallSeekDelta"), !1),
Y6b: E(H, I("smallSeekDeltaThresholdMilliseconds"), u.v3),
WIb: E(J, "enableCDMAttestedDescriptors", !1),
oca: E(J, "requireDownloadDataAtBuffering", !1),
pca: E(J, "requireSetupConnectionDuringBuffering", !1),
aya: E(J, "recordFirstFragmentOnSubBranchCreate", !1),
sAb: E(J, "branchingAudioTrackFrameDropSmallSeekFix", !0),
Xhb: E(J, "useMobileVMAF", !1),
FZa: E(N, "desiredVMAFTypeMobile", "phone_plus_lts"),
GZa: E(N, "desiredVMAFTypeNonMobile", "plus_lts"),
kU: E(J, "activateSelectStartingVMAF", !1),
tv: E(H, "minStartingVideoVMAF", 1),
uY: E(H, "minAcceptableVMAF", 1),
cJ: E(H, "minAllowedVmaf", 1),
Iyb: E(J, "alwaysNotifyEOSForPlaygraph", !0),
IN: E(J, "enableNewAse", !0),
t0: E(J, "useNewApi", !0),
bJb: E(J, "enableHudsonFieldTest", !1),
mRb: E(X, "hudsonTitles", ["81127954", "70125931", "80158148"]),
eWb: E(H, "maxPartialBuffersAtHudson", 1),
wYb: E(H, "numberOfChunksPerSegment", 4),
y8b: E(H, "targetContentLatency", 1E4),
z8b: E(H, "targetLongContentLatency", 3E4),
oXb: E(H, "minimumTimeDelay", 1),
gpa: E(J, "enableWsslEstimate", !1),
V$: E(H, "maxAllowedOutstandingRequests", 4),
FM: E(J, "alwaysRunUnderflowTimer", !0),
Ava: E(H, "minStreamableConcurrencyWindow", 3E3),
AAa: E(R, "streamableConcurrencyFactor", .3),
WU: E(H, "bufferingConcurrencyWindow", 7800),
S6b: E(J, "singleStreamablePerBranch", !0),
B7: E(J, "enableResolutionVMAFStreamFilter", !1),
uca: E(L, "resolutionVMAFCappingRuleList", {}),
Swa: E(K, "percentCapTitlesForResolutionVMAFStreamFilter", 100),
THb: E(J, "disableSkipping", !1),
Uda: E(J, "useHLSPlayer", ca.Uda),
HBa: E(J, I("useExitZones"), !0),
N3b: E(J, "requestSegmentVmaf", !1),
BP: E(L, "perFragmentVMAFConfig", {
enabled: !1
}),
Dwa: E(H, "paddingDurationMs", 1E3),
Ewa: E(N, "paddingMediaType", "padding")
};
Ia = !0;
b.Pna = function(Ka) {
var Ta,
Oa,
Xa;
Ta = d.ya.get(B.Wc).id;
if (0 < b.config.n7a && 0 === Ta % b.config.n7a)
try {
Oa = d.ya.get(v.Fn);
Xa = d.ya.get(w.My).Cu("config", "info", {
params: Ka
});
Oa.Gc(Xa);
} catch (Ya) {
d.log.error("Failed to log config$apply", Ya);
}
mb._cad_global.config = b.config;
(0, l.nb)(Ka);
Ka && (za = (0, p.re)({}, Ka, {
hY: !0
}), (0, p.re)(za, Q, {
hY: !0
}), G(sa, b.config), za.istestaccount && d.log.trace("Config applied for", qa(Ia ? za : Ka)), Ia = !1);
};
(0, b.Pna)(za);
};
b.Qna = function(C) {
C = c(C);
return (0, p.re)({}, a(187)(C), {
jba: !0
});
};
b.TXa = function(C, F, G) {
G = !!G && (0 <= G.indexOf("h264hpl") || 0 <= G.indexOf("vp9") || 0 <= G.indexOf("av1"));
C = {
Lx: C ? b.config.XWb : b.config.Lx,
WA: C ? b.config.eXb : G ? b.config.gXb : b.config.WA,
x7: !F
};
return (0, p.re)({}, a(187)(C), {
jba: !0
});
};
b.dDb = c;
b.cDb = m;
}, function(r, b, a) {
var m;
function c(h, k) {
return h && k ? Math.abs(h * k / m.HD(h, k)) : 0;
}
Object.defineProperties(b, {
__esModule: {
value: !0
}
});
b.O = void 0;
m = a(364);
r = (function() {
function h(k, d) {
"object" === typeof k ? (this.pc = k.Za, this.kb = k.V) : (this.pc = k, this.kb = d);
isFinite(this.pc) || (this.kb = 1);
}
h.compare = function(k, d) {
return k.Jl(d);
};
h.abs = function(k) {
return new h(Math.abs(k.pc), k.kb);
};
h.Ja = function(k) {
return 0 === k ? h.Va : new h(k, 1E3);
};
h.yda = function(k, d) {
return Math.floor(1E3 * k / d);
};
h.l9a = function(k, d) {
return Math.floor(k * d / 1E3);
};
h.max = function() {
for (var k = [], d = 0; d < arguments.length; d++) {
k[d] = arguments[d];
}
return k.reduce(function(f, l) {
return f.greaterThan(l) ? f : l;
});
};
h.min = function() {
for (var k = [], d = 0; d < arguments.length; d++) {
k[d] = arguments[d];
}
return k.reduce(function(f, l) {
return f.lessThan(l) ? f : l;
});
};
h.HD = function(k, d) {
var f;
if (k.kb === d.kb)
return new h(m.HD(k.pc, d.pc), k.kb);
f = c(k.kb, d.kb);
return new h(m.HD(k.pc * f / k.kb, d.pc * f / d.kb), f);
};
Object.defineProperties(h.prototype, {
Za: {
get: function() {
return this.pc;
},
enumerable: !1,
configurable: !0
}
});
Object.defineProperties(h.prototype, {
V: {
get: function() {
return this.kb;
},
enumerable: !1,
configurable: !0
}
});
Object.defineProperties(h.prototype, {
T: {
get: function() {
return h.yda(this.pc, this.kb);
},
enumerable: !1,
configurable: !0
}
});
Object.defineProperties(h.prototype, {
wJ: {
get: function() {
return 1E3 * this.pc / this.kb;
},
enumerable: !1,
configurable: !0
}
});
Object.defineProperties(h.prototype, {
PJ: {
get: function() {
var k;
k = this.wJ;
return 0 > k ? Math.ceil(k) : Math.floor(k);
},
enumerable: !1,
configurable: !0
}
});
Object.defineProperties(h.prototype, {
ii: {
get: function() {
return this.pc / this.kb;
},
enumerable: !1,
configurable: !0
}
});
h.prototype.ig = function(k) {
k /= this.kb;
return new h(Math.floor(this.pc * k), Math.floor(this.kb * k));
};
h.prototype.add = function(k) {
var d;
if (this.kb === k.kb)
return new h(this.pc + k.pc, this.kb);
d = c(this.kb, k.kb);
return new h(this.pc * d / this.kb + k.pc * d / k.kb, d);
};
h.prototype.Ca = function(k) {
var d;
if (this.kb === k.kb)
return new h(this.pc - k.pc, this.kb);
d = c(this.kb, k.kb);
return new h(this.pc * d / this.kb - k.pc * d / k.kb, d);
};
h.prototype.ZA = function(k) {
return new h(this.pc * k, this.kb);
};
h.prototype.Ll = function(k) {
var d;
if ("number" === typeof k) {
if (Math.floor(k) === k) {
d = c(this.pc, k);
if (d !== this.pc)
return this.ig(d / this.pc * this.kb).Ll(k);
}
return new h(Math.floor(this.pc / k), this.kb);
}
if (this.kb === k.kb)
return this.pc / k.pc;
d = c(this.kb, k.kb);
return this.pc * d / this.kb / (k.pc * d / k.kb);
};
h.prototype.o7 = function(k) {
var d;
if (this.kb === k.kb)
return new h(Math.abs(this.pc - k.pc), this.kb);
d = c(this.kb, k.kb);
return new h(Math.abs(this.pc * d / this.kb - k.pc * d / k.kb), d);
};
h.prototype.bcb = function() {
return new h(this.kb, this.pc);
};
h.prototype.compare = function(k, d) {
var f;
if (this.kb === d.kb)
return k(this.pc, d.pc);
f = c(this.kb, d.kb);
return k(this.pc * f / this.kb, d.pc * f / d.kb);
};
h.prototype.Jl = function(k) {
var d;
if (this.kb === k.kb)
return this.Za === k.pc ? 0 : this.pc - k.pc;
d = c(this.kb, k.kb);
return this.pc * d / this.kb - k.pc * d / k.kb;
};
h.prototype.equal = function(k) {
return this.compare(function(d, f) {
return d === f;
}, k);
};
h.prototype.Wva = function(k) {
return this.compare(function(d, f) {
return d !== f;
}, k);
};
h.prototype.lessThan = function(k) {
return this.compare(function(d, f) {
return d < f;
}, k);
};
h.prototype.greaterThan = function(k) {
return this.compare(function(d, f) {
return d > f;
}, k);
};
h.prototype.UX = function(k) {
return this.compare(function(d, f) {
return d <= f;
}, k);
};
h.prototype.Fs = function(k) {
return this.compare(function(d, f) {
return d >= f;
}, k);
};
h.prototype.isFinite = function() {
return !!this.kb && isFinite(this.pc);
};
h.prototype.H3a = function(k) {
return c(this.V, k);
};
h.prototype.toJSON = function() {
return {
ticks: this.pc,
timescale: this.kb
};
};
h.prototype.toString = function() {
return this.pc + "/" + this.kb;
};
h.prototype.ec = function() {
return this.pc + "/" + this.kb + " (" + this.T + "ms)";
};
h.Va = new h(0, 1E3);
h.dB = new h(1, 1E3);
h.vx = new h(Infinity, 1);
return h;
})();
b.O = r;
}, function(r, b, a) {
function c() {
c = Object.assign || (function(E) {
for (var I, O = 1, K = arguments.length; O < K; O++) {
I = arguments[O];
for (var H in I) {
Object.prototype.hasOwnProperty.call(I, H) && (E[H] = I[H]);
}
}
return E;
});
return c.apply(this, arguments);
}
function m(E, I) {
m = Object.setPrototypeOf || ({
__proto__: []
}) instanceof Array && (function(O, K) {
O.__proto__ = K;
}) || (function(O, K) {
for (var H in K) {
K.hasOwnProperty(H) && (O[H] = K[H]);
}
});
return m(E, I);
}
function h(E, I) {
function O() {
this.constructor = E;
}
m(E, I);
E.prototype = null === I ? Object.create(I) : (O.prototype = I.prototype, new O());
}
function k(E, I) {
var O,
K,
H;
O = {};
for (K in E) {
Object.prototype.hasOwnProperty.call(E, K) && 0 > I.indexOf(K) && (O[K] = E[K]);
}
if (null != E && "function" === typeof Object.getOwnPropertySymbols) {
H = 0;
for (K = Object.getOwnPropertySymbols(E); H < K.length; H++) {
0 > I.indexOf(K[H]) && Object.prototype.propertyIsEnumerable.call(E, K[H]) && (O[K[H]] = E[K[H]]);
}
}
return O;
}
function d(E, I, O, K) {
var H,
R,
N;
H = arguments.length;
R = 3 > H ? I : null === K ? K = Object.getOwnPropertyDescriptor(I, O) : K;
if ("object" === typeof Reflect && "function" === typeof Reflect.xs)
R = Reflect.xs(E, I, O, K);
else
for (var J = E.length - 1; 0 <= J; J--) {
if (N = E[J])
R = (3 > H ? N(R) : 3 < H ? N(I, O, R) : N(I, O)) || R;
}
return ( 3 < H && R && Object.defineProperty(I, O, R), R) ;
}
function f(E, I) {
return function(O, K) {
I(O, K, E);
};
}
function l(E, I) {
if ("object" === typeof Reflect && "function" === typeof Reflect.Fc)
return Reflect.Fc(E, I);
}
function g(E, I, O, K) {
function H(R) {
return R instanceof O ? R : new O(function(N) {
N(R);
});
}
return new (O || (O = Promise))(function(R, N) {
function J(S) {
try {
P(K.next(S));
} catch (U) {
N(U);
}
}
function L(S) {
try {
P(K["throw"](S));
} catch (U) {
N(U);
}
}
function P(S) {
S.done ? R(S.value) : H(S.value).then(J, L);
}
P((K = K.apply(E, I || [])).next());
});
}
function n(E, I) {
var H,
R,
N,
J,
L;
function O(P) {
return function(S) {
return K([P, S]);
};
}
function K(P) {
if (R)
throw new TypeError("Generator is already executing.");
for (; H;) {
try {
if ((R = 1, N && (J = P[0] & 2 ? N["return"] : P[0] ? N["throw"] || ((J = N["return"]) && J.call(N), 0) : N.next) && !(J = J.call(N, P[1])).done))
return J;
if ((N = 0, J))
P = [P[0] & 2, J.value];
switch (P[0]) {
case 0:
case 1:
J = P;
break;
case 4:
return ( H.label++, {
value: P[1],
done: !1
}) ;
case 5:
H.label++;
N = P[1];
P = [0];
continue;
case 7:
P = H.Ao.pop();
H.Tj.pop();
continue;
default:
if (!(J = H.Tj, J = 0 < J.length && J[J.length - 1]) && (6 === P[0] || 2 === P[0])) {
H = 0;
continue;
}
if (3 === P[0] && (!J || P[1] > J[0] && P[1] < J[3]))
H.label = P[1];
else if (6 === P[0] && H.label < J[1])
(H.label = J[1],
J = P);
else if (J && H.label < J[2])
(H.label = J[2],
H.Ao.push(P));
else {
J[2] && H.Ao.pop();
H.Tj.pop();
continue;
}
}
P = I.call(E, H);
} catch (S) {
P = [6, S];
N = 0;
} finally {
R = J = 0;
}
}
if (P[0] & 5)
throw P[1];
return {
value: P[0] ? P[1] : void 0,
done: !0
};
}
H = {
label: 0,
Lb: function() {
if (J[0] & 1)
throw J[1];
return J[1];
},
Tj: [],
Ao: []
};
return ( L = {
next: O(0),
"throw": O(1),
"return": O(2)
}, "function" === typeof Symbol && (L[Symbol.iterator] = function() {
return this;
}), L) ;
}
function p(E, I, O, K) {
void 0 === K && (K = O);
E[K] = I[O];
}
function q(E, I) {
for (var O in E) {
"default" === O || I.hasOwnProperty(O) || (I[O] = E[O]);
}
}
function t(E) {
var I,
O,
K;
I = "function" === typeof Symbol && Symbol.iterator;
O = I && E[I];
K = 0;
if (O)
return O.call(E);
if (E && "number" === typeof E.length)
return {
next: function() {
E && K >= E.length && (E = void 0);
return {
value: E && E[K++],
done: !E
};
}
};
throw new TypeError(I ? "Object is not iterable." : "Symbol.iterator is not defined.");
}
function u(E, I) {
var O,
K,
H;
O = "function" === typeof Symbol && E[Symbol.iterator];
if (!O)
return E;
E = O.call(E);
H = [];
try {
for (; (void 0 === I || 0 < I--) && !(K = E.next()).done;) {
H.push(K.value);
}
} catch (N) {
var R;
R = {
error: N
};
} finally {
try {
K && !K.done && (O = E["return"]) && O.call(E);
} finally {
if (R)
throw R.error;
}
}
return H;
}
function v() {
for (var E = [], I = 0; I < arguments.length; I++) {
E = E.concat(u(arguments[I]));
}
return E;
}
function w() {
var K;
for (var E = 0, I = 0, O = arguments.length; I < O; I++) {
E += arguments[I].length;
}
E = Array(E);
K = 0;
for (I = 0; I < O; I++) {
for (var H = arguments[I], R = 0, N = H.length; R < N;(R++, K++)) {
E[K] = H[R];
}
}
return E;
}
function x(E) {
return this instanceof x ? (this.mF = E, this) : new x(E);
}
function y(E, I, O) {
var L,
P,
S;
function K(U) {
L[U] && (P[U] = function(T) {
return new Promise(function(X, ja) {
1 < S.push([U, T, X, ja]) || H(U, T);
});
});
}
function H(U, T) {
var X;
try {
X = L[U](T);
X.value instanceof x ? Promise.resolve(X.value.mF).then(R, N) : J(S[0][2], X);
} catch (ja) {
J(S[0][3], ja);
}
}
function R(U) {
H("next", U);
}
function N(U) {
H("throw", U);
}
function J(U, T) {
(U(T), S.shift(), S.length) && H(S[0][0], S[0][1]);
}
if (!Symbol.asyncIterator)
throw new TypeError("Symbol.asyncIterator is not defined.");
L = O.apply(E, I || []);
S = [];
return ( P = {}, K("next"), K("throw"), K("return"), P[Symbol.asyncIterator] = function() {
return this;
}, P) ;
}
function z(E) {
var O,
K;
function I(H, R) {
O[H] = E[H] ? function(N) {
return (K = !K) ? {
value: x(E[H](N)),
done: "return" === H
} : R ? R(N) : N;
} : R;
}
return ( O = {}, I("next"), I("throw", function(H) {
throw H;
}), I("return"), O[Symbol.iterator] = function() {
return this;
}, O) ;
}
function A(E) {
var K,
H;
function I(R) {
H[R] = E[R] && (function(N) {
return new Promise(function(J, L) {
N = E[R](N);
O(J, L, N.done, N.value);
});
});
}
function O(R, N, J, L) {
Promise.resolve(L).then(function(P) {
R({
value: P,
done: J
});
}, N);
}
if (!Symbol.asyncIterator)
throw new TypeError("Symbol.asyncIterator is not defined.");
K = E[Symbol.asyncIterator];
return K ? K.call(E) : (E = "function" === typeof t ? t(E) : E[Symbol.iterator](), H = {}, I("next"), I("throw"), I("return"), H[Symbol.asyncIterator] = function() {
return this;
}, H);
}
function B(E, I) {
Object.defineProperty ? Object.defineProperty(E, "raw", {
value: I
}) : E.raw = I;
return E;
}
function D(E) {
var I;
if (E && E.__esModule)
return E;
I = {};
if (null != E)
for (var O in E) {
Object.hasOwnProperty.call(E, O) && (I[O] = E[O]);
}
I.default = E;
return I;
}
function C(E) {
return E && E.__esModule ? E : {
default: E
};
}
function F(E, I) {
if (!I.has(E))
throw new TypeError("attempted to get private field on non-instance");
return I.get(E);
}
function G(E, I, O) {
if (!I.has(E))
throw new TypeError("attempted to set private field on non-instance");
I.set(E, O);
return O;
}
a.r(b);
a.d(b, "__extends", function() {
return h;
});
a.d(b, "__assign", function() {
return c;
});
a.d(b, "__rest", function() {
return k;
});
a.d(b, "__decorate", function() {
return d;
});
a.d(b, "__param", function() {
return f;
});
a.d(b, "__metadata", function() {
return l;
});
a.d(b, "__awaiter", function() {
return g;
});
a.d(b, "__generator", function() {
return n;
});
a.d(b, "__createBinding", function() {
return p;
});
a.d(b, "__exportStar", function() {
return q;
});
a.d(b, "__values", function() {
return t;
});
a.d(b, "__read", function() {
return u;
});
a.d(b, "__spread", function() {
return v;
});
a.d(b, "__spreadArrays", function() {
return w;
});
a.d(b, "__await", function() {
return x;
});
a.d(b, "__asyncGenerator", function() {
return y;
});
a.d(b, "__asyncDelegator", function() {
return z;
});
a.d(b, "__asyncValues", function() {
return A;
});
a.d(b, "__makeTemplateObject", function() {
return B;
});
a.d(b, "__importStar", function() {
return D;
});
a.d(b, "__importDefault", function() {
return C;
});
a.d(b, "__classPrivateFieldGet", function() {
return F;
});
a.d(b, "__classPrivateFieldSet", function() {
return G;
});
}, function(r, b, a) {
var m;
function c(h) {
return h.filter(function(k, d) {
return h.indexOf(k) === d;
});
}
Object.defineProperties(b, {
__esModule: {
value: !0
}
});
b.Uaa = b.XPb = b.ADb = b.flatten = b.S8a = b.QCb = b.V5 = b.ru = b.sVa = b.yU = b.U5 = b.Yn = b.Tla = b.zd = void 0;
m = a(0);
b.zd = function(h, k) {
for (var d = 0; d < h.length; d++) {
if (k(h[d], d, h))
return h[d];
}
};
b.Tla = function(h, k) {
for (var d = h.length - 1; 0 <= d; --d) {
@VCK02
Copy link

VCK02 commented Oct 25, 2023

Not working with 6.0042.618.911. Can you share updated file.
Screenshot 2023-10-25 at 9 44 22 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment