esewa-react
Version:
A React library for integrating eSewa payment gateway into your React applications. This library handles hash signatures, base64 URL encoding, and provides a simple interface for initiating and verifying eSewa payments.
1,341 lines • 169 kB
JavaScript
import { useState as hr, useCallback as Bx, useEffect as hx } from "react";
var L = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function lx(S) {
return S && S.__esModule && Object.prototype.hasOwnProperty.call(S, "default") ? S.default : S;
}
function Cx(S) {
if (S.__esModule) return S;
var z = S.default;
if (typeof z == "function") {
var v = function t() {
return this instanceof t ? Reflect.construct(z, arguments, this.constructor) : z.apply(this, arguments);
};
v.prototype = z.prototype;
} else v = {};
return Object.defineProperty(v, "__esModule", { value: !0 }), Object.keys(S).forEach(function(t) {
var A = Object.getOwnPropertyDescriptor(S, t);
Object.defineProperty(v, t, A.get ? A : {
enumerable: !0,
get: function() {
return S[t];
}
});
}), v;
}
var Vr = { exports: {} };
function Ex(S) {
throw new Error('Could not dynamically require "' + S + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
}
var p0 = { exports: {} };
const Ax = {}, px = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
default: Ax
}, Symbol.toStringTag, { value: "Module" })), Fx = /* @__PURE__ */ Cx(px);
var lr;
function O() {
return lr || (lr = 1, function(S, z) {
(function(v, t) {
S.exports = t();
})(L, function() {
var v = v || function(t, A) {
var D;
if (typeof window < "u" && window.crypto && (D = window.crypto), typeof self < "u" && self.crypto && (D = self.crypto), typeof globalThis < "u" && globalThis.crypto && (D = globalThis.crypto), !D && typeof window < "u" && window.msCrypto && (D = window.msCrypto), !D && typeof L < "u" && L.crypto && (D = L.crypto), !D && typeof Ex == "function")
try {
D = Fx;
} catch {
}
var m = function() {
if (D) {
if (typeof D.getRandomValues == "function")
try {
return D.getRandomValues(new Uint32Array(1))[0];
} catch {
}
if (typeof D.randomBytes == "function")
try {
return D.randomBytes(4).readInt32LE();
} catch {
}
}
throw new Error("Native crypto module could not be used to get secure random number.");
}, u = Object.create || /* @__PURE__ */ function() {
function a() {
}
return function(n) {
var i;
return a.prototype = n, i = new a(), a.prototype = null, i;
};
}(), h = {}, r = h.lib = {}, x = r.Base = /* @__PURE__ */ function() {
return {
/**
* Creates a new object that inherits from this object.
*
* @param {Object} overrides Properties to copy into the new object.
*
* @return {Object} The new object.
*
* @static
*
* @example
*
* var MyType = CryptoJS.lib.Base.extend({
* field: 'value',
*
* method: function () {
* }
* });
*/
extend: function(a) {
var n = u(this);
return a && n.mixIn(a), (!n.hasOwnProperty("init") || this.init === n.init) && (n.init = function() {
n.$super.init.apply(this, arguments);
}), n.init.prototype = n, n.$super = this, n;
},
/**
* Extends this object and runs the init method.
* Arguments to create() will be passed to init().
*
* @return {Object} The new object.
*
* @static
*
* @example
*
* var instance = MyType.create();
*/
create: function() {
var a = this.extend();
return a.init.apply(a, arguments), a;
},
/**
* Initializes a newly created object.
* Override this method to add some logic when your objects are created.
*
* @example
*
* var MyType = CryptoJS.lib.Base.extend({
* init: function () {
* // ...
* }
* });
*/
init: function() {
},
/**
* Copies properties into this object.
*
* @param {Object} properties The properties to mix in.
*
* @example
*
* MyType.mixIn({
* field: 'value'
* });
*/
mixIn: function(a) {
for (var n in a)
a.hasOwnProperty(n) && (this[n] = a[n]);
a.hasOwnProperty("toString") && (this.toString = a.toString);
},
/**
* Creates a copy of this object.
*
* @return {Object} The clone.
*
* @example
*
* var clone = instance.clone();
*/
clone: function() {
return this.init.prototype.extend(this);
}
};
}(), B = r.WordArray = x.extend({
/**
* Initializes a newly created word array.
*
* @param {Array} words (Optional) An array of 32-bit words.
* @param {number} sigBytes (Optional) The number of significant bytes in the words.
*
* @example
*
* var wordArray = CryptoJS.lib.WordArray.create();
* var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]);
* var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6);
*/
init: function(a, n) {
a = this.words = a || [], n != A ? this.sigBytes = n : this.sigBytes = a.length * 4;
},
/**
* Converts this word array to a string.
*
* @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex
*
* @return {string} The stringified word array.
*
* @example
*
* var string = wordArray + '';
* var string = wordArray.toString();
* var string = wordArray.toString(CryptoJS.enc.Utf8);
*/
toString: function(a) {
return (a || s).stringify(this);
},
/**
* Concatenates a word array to this word array.
*
* @param {WordArray} wordArray The word array to append.
*
* @return {WordArray} This word array.
*
* @example
*
* wordArray1.concat(wordArray2);
*/
concat: function(a) {
var n = this.words, i = a.words, E = this.sigBytes, C = a.sigBytes;
if (this.clamp(), E % 4)
for (var p = 0; p < C; p++) {
var _ = i[p >>> 2] >>> 24 - p % 4 * 8 & 255;
n[E + p >>> 2] |= _ << 24 - (E + p) % 4 * 8;
}
else
for (var R = 0; R < C; R += 4)
n[E + R >>> 2] = i[R >>> 2];
return this.sigBytes += C, this;
},
/**
* Removes insignificant bits.
*
* @example
*
* wordArray.clamp();
*/
clamp: function() {
var a = this.words, n = this.sigBytes;
a[n >>> 2] &= 4294967295 << 32 - n % 4 * 8, a.length = t.ceil(n / 4);
},
/**
* Creates a copy of this word array.
*
* @return {WordArray} The clone.
*
* @example
*
* var clone = wordArray.clone();
*/
clone: function() {
var a = x.clone.call(this);
return a.words = this.words.slice(0), a;
},
/**
* Creates a word array filled with random bytes.
*
* @param {number} nBytes The number of random bytes to generate.
*
* @return {WordArray} The random word array.
*
* @static
*
* @example
*
* var wordArray = CryptoJS.lib.WordArray.random(16);
*/
random: function(a) {
for (var n = [], i = 0; i < a; i += 4)
n.push(m());
return new B.init(n, a);
}
}), e = h.enc = {}, s = e.Hex = {
/**
* Converts a word array to a hex string.
*
* @param {WordArray} wordArray The word array.
*
* @return {string} The hex string.
*
* @static
*
* @example
*
* var hexString = CryptoJS.enc.Hex.stringify(wordArray);
*/
stringify: function(a) {
for (var n = a.words, i = a.sigBytes, E = [], C = 0; C < i; C++) {
var p = n[C >>> 2] >>> 24 - C % 4 * 8 & 255;
E.push((p >>> 4).toString(16)), E.push((p & 15).toString(16));
}
return E.join("");
},
/**
* Converts a hex string to a word array.
*
* @param {string} hexStr The hex string.
*
* @return {WordArray} The word array.
*
* @static
*
* @example
*
* var wordArray = CryptoJS.enc.Hex.parse(hexString);
*/
parse: function(a) {
for (var n = a.length, i = [], E = 0; E < n; E += 2)
i[E >>> 3] |= parseInt(a.substr(E, 2), 16) << 24 - E % 8 * 4;
return new B.init(i, n / 2);
}
}, o = e.Latin1 = {
/**
* Converts a word array to a Latin1 string.
*
* @param {WordArray} wordArray The word array.
*
* @return {string} The Latin1 string.
*
* @static
*
* @example
*
* var latin1String = CryptoJS.enc.Latin1.stringify(wordArray);
*/
stringify: function(a) {
for (var n = a.words, i = a.sigBytes, E = [], C = 0; C < i; C++) {
var p = n[C >>> 2] >>> 24 - C % 4 * 8 & 255;
E.push(String.fromCharCode(p));
}
return E.join("");
},
/**
* Converts a Latin1 string to a word array.
*
* @param {string} latin1Str The Latin1 string.
*
* @return {WordArray} The word array.
*
* @static
*
* @example
*
* var wordArray = CryptoJS.enc.Latin1.parse(latin1String);
*/
parse: function(a) {
for (var n = a.length, i = [], E = 0; E < n; E++)
i[E >>> 2] |= (a.charCodeAt(E) & 255) << 24 - E % 4 * 8;
return new B.init(i, n);
}
}, c = e.Utf8 = {
/**
* Converts a word array to a UTF-8 string.
*
* @param {WordArray} wordArray The word array.
*
* @return {string} The UTF-8 string.
*
* @static
*
* @example
*
* var utf8String = CryptoJS.enc.Utf8.stringify(wordArray);
*/
stringify: function(a) {
try {
return decodeURIComponent(escape(o.stringify(a)));
} catch {
throw new Error("Malformed UTF-8 data");
}
},
/**
* Converts a UTF-8 string to a word array.
*
* @param {string} utf8Str The UTF-8 string.
*
* @return {WordArray} The word array.
*
* @static
*
* @example
*
* var wordArray = CryptoJS.enc.Utf8.parse(utf8String);
*/
parse: function(a) {
return o.parse(unescape(encodeURIComponent(a)));
}
}, f = r.BufferedBlockAlgorithm = x.extend({
/**
* Resets this block algorithm's data buffer to its initial state.
*
* @example
*
* bufferedBlockAlgorithm.reset();
*/
reset: function() {
this._data = new B.init(), this._nDataBytes = 0;
},
/**
* Adds new data to this block algorithm's buffer.
*
* @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8.
*
* @example
*
* bufferedBlockAlgorithm._append('data');
* bufferedBlockAlgorithm._append(wordArray);
*/
_append: function(a) {
typeof a == "string" && (a = c.parse(a)), this._data.concat(a), this._nDataBytes += a.sigBytes;
},
/**
* Processes available data blocks.
*
* This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype.
*
* @param {boolean} doFlush Whether all blocks and partial blocks should be processed.
*
* @return {WordArray} The processed data.
*
* @example
*
* var processedData = bufferedBlockAlgorithm._process();
* var processedData = bufferedBlockAlgorithm._process(!!'flush');
*/
_process: function(a) {
var n, i = this._data, E = i.words, C = i.sigBytes, p = this.blockSize, _ = p * 4, R = C / _;
a ? R = t.ceil(R) : R = t.max((R | 0) - this._minBufferSize, 0);
var d = R * p, F = t.min(d * 4, C);
if (d) {
for (var y = 0; y < d; y += p)
this._doProcessBlock(E, y);
n = E.splice(0, d), i.sigBytes -= F;
}
return new B.init(n, F);
},
/**
* Creates a copy of this object.
*
* @return {Object} The clone.
*
* @example
*
* var clone = bufferedBlockAlgorithm.clone();
*/
clone: function() {
var a = x.clone.call(this);
return a._data = this._data.clone(), a;
},
_minBufferSize: 0
});
r.Hasher = f.extend({
/**
* Configuration options.
*/
cfg: x.extend(),
/**
* Initializes a newly created hasher.
*
* @param {Object} cfg (Optional) The configuration options to use for this hash computation.
*
* @example
*
* var hasher = CryptoJS.algo.SHA256.create();
*/
init: function(a) {
this.cfg = this.cfg.extend(a), this.reset();
},
/**
* Resets this hasher to its initial state.
*
* @example
*
* hasher.reset();
*/
reset: function() {
f.reset.call(this), this._doReset();
},
/**
* Updates this hasher with a message.
*
* @param {WordArray|string} messageUpdate The message to append.
*
* @return {Hasher} This hasher.
*
* @example
*
* hasher.update('message');
* hasher.update(wordArray);
*/
update: function(a) {
return this._append(a), this._process(), this;
},
/**
* Finalizes the hash computation.
* Note that the finalize operation is effectively a destructive, read-once operation.
*
* @param {WordArray|string} messageUpdate (Optional) A final message update.
*
* @return {WordArray} The hash.
*
* @example
*
* var hash = hasher.finalize();
* var hash = hasher.finalize('message');
* var hash = hasher.finalize(wordArray);
*/
finalize: function(a) {
a && this._append(a);
var n = this._doFinalize();
return n;
},
blockSize: 16,
/**
* Creates a shortcut function to a hasher's object interface.
*
* @param {Hasher} hasher The hasher to create a helper for.
*
* @return {Function} The shortcut function.
*
* @static
*
* @example
*
* var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256);
*/
_createHelper: function(a) {
return function(n, i) {
return new a.init(i).finalize(n);
};
},
/**
* Creates a shortcut function to the HMAC's object interface.
*
* @param {Hasher} hasher The hasher to use in this HMAC helper.
*
* @return {Function} The shortcut function.
*
* @static
*
* @example
*
* var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256);
*/
_createHmacHelper: function(a) {
return function(n, i) {
return new l.HMAC.init(a, i).finalize(n);
};
}
});
var l = h.algo = {};
return h;
}(Math);
return v;
});
}(p0)), p0.exports;
}
var F0 = { exports: {} }, Cr;
function C0() {
return Cr || (Cr = 1, function(S, z) {
(function(v, t) {
S.exports = t(O());
})(L, function(v) {
return function(t) {
var A = v, D = A.lib, m = D.Base, u = D.WordArray, h = A.x64 = {};
h.Word = m.extend({
/**
* Initializes a newly created 64-bit word.
*
* @param {number} high The high 32 bits.
* @param {number} low The low 32 bits.
*
* @example
*
* var x64Word = CryptoJS.x64.Word.create(0x00010203, 0x04050607);
*/
init: function(r, x) {
this.high = r, this.low = x;
}
/**
* Bitwise NOTs this word.
*
* @return {X64Word} A new x64-Word object after negating.
*
* @example
*
* var negated = x64Word.not();
*/
// not: function () {
// var high = ~this.high;
// var low = ~this.low;
// return X64Word.create(high, low);
// },
/**
* Bitwise ANDs this word with the passed word.
*
* @param {X64Word} word The x64-Word to AND with this word.
*
* @return {X64Word} A new x64-Word object after ANDing.
*
* @example
*
* var anded = x64Word.and(anotherX64Word);
*/
// and: function (word) {
// var high = this.high & word.high;
// var low = this.low & word.low;
// return X64Word.create(high, low);
// },
/**
* Bitwise ORs this word with the passed word.
*
* @param {X64Word} word The x64-Word to OR with this word.
*
* @return {X64Word} A new x64-Word object after ORing.
*
* @example
*
* var ored = x64Word.or(anotherX64Word);
*/
// or: function (word) {
// var high = this.high | word.high;
// var low = this.low | word.low;
// return X64Word.create(high, low);
// },
/**
* Bitwise XORs this word with the passed word.
*
* @param {X64Word} word The x64-Word to XOR with this word.
*
* @return {X64Word} A new x64-Word object after XORing.
*
* @example
*
* var xored = x64Word.xor(anotherX64Word);
*/
// xor: function (word) {
// var high = this.high ^ word.high;
// var low = this.low ^ word.low;
// return X64Word.create(high, low);
// },
/**
* Shifts this word n bits to the left.
*
* @param {number} n The number of bits to shift.
*
* @return {X64Word} A new x64-Word object after shifting.
*
* @example
*
* var shifted = x64Word.shiftL(25);
*/
// shiftL: function (n) {
// if (n < 32) {
// var high = (this.high << n) | (this.low >>> (32 - n));
// var low = this.low << n;
// } else {
// var high = this.low << (n - 32);
// var low = 0;
// }
// return X64Word.create(high, low);
// },
/**
* Shifts this word n bits to the right.
*
* @param {number} n The number of bits to shift.
*
* @return {X64Word} A new x64-Word object after shifting.
*
* @example
*
* var shifted = x64Word.shiftR(7);
*/
// shiftR: function (n) {
// if (n < 32) {
// var low = (this.low >>> n) | (this.high << (32 - n));
// var high = this.high >>> n;
// } else {
// var low = this.high >>> (n - 32);
// var high = 0;
// }
// return X64Word.create(high, low);
// },
/**
* Rotates this word n bits to the left.
*
* @param {number} n The number of bits to rotate.
*
* @return {X64Word} A new x64-Word object after rotating.
*
* @example
*
* var rotated = x64Word.rotL(25);
*/
// rotL: function (n) {
// return this.shiftL(n).or(this.shiftR(64 - n));
// },
/**
* Rotates this word n bits to the right.
*
* @param {number} n The number of bits to rotate.
*
* @return {X64Word} A new x64-Word object after rotating.
*
* @example
*
* var rotated = x64Word.rotR(7);
*/
// rotR: function (n) {
// return this.shiftR(n).or(this.shiftL(64 - n));
// },
/**
* Adds this word with the passed word.
*
* @param {X64Word} word The x64-Word to add with this word.
*
* @return {X64Word} A new x64-Word object after adding.
*
* @example
*
* var added = x64Word.add(anotherX64Word);
*/
// add: function (word) {
// var low = (this.low + word.low) | 0;
// var carry = (low >>> 0) < (this.low >>> 0) ? 1 : 0;
// var high = (this.high + word.high + carry) | 0;
// return X64Word.create(high, low);
// }
}), h.WordArray = m.extend({
/**
* Initializes a newly created word array.
*
* @param {Array} words (Optional) An array of CryptoJS.x64.Word objects.
* @param {number} sigBytes (Optional) The number of significant bytes in the words.
*
* @example
*
* var wordArray = CryptoJS.x64.WordArray.create();
*
* var wordArray = CryptoJS.x64.WordArray.create([
* CryptoJS.x64.Word.create(0x00010203, 0x04050607),
* CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f)
* ]);
*
* var wordArray = CryptoJS.x64.WordArray.create([
* CryptoJS.x64.Word.create(0x00010203, 0x04050607),
* CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f)
* ], 10);
*/
init: function(r, x) {
r = this.words = r || [], x != t ? this.sigBytes = x : this.sigBytes = r.length * 8;
},
/**
* Converts this 64-bit word array to a 32-bit word array.
*
* @return {CryptoJS.lib.WordArray} This word array's data as a 32-bit word array.
*
* @example
*
* var x32WordArray = x64WordArray.toX32();
*/
toX32: function() {
for (var r = this.words, x = r.length, B = [], e = 0; e < x; e++) {
var s = r[e];
B.push(s.high), B.push(s.low);
}
return u.create(B, this.sigBytes);
},
/**
* Creates a copy of this word array.
*
* @return {X64WordArray} The clone.
*
* @example
*
* var clone = x64WordArray.clone();
*/
clone: function() {
for (var r = m.clone.call(this), x = r.words = this.words.slice(0), B = x.length, e = 0; e < B; e++)
x[e] = x[e].clone();
return r;
}
});
}(), v;
});
}(F0)), F0.exports;
}
var D0 = { exports: {} }, Er;
function Dx() {
return Er || (Er = 1, function(S, z) {
(function(v, t) {
S.exports = t(O());
})(L, function(v) {
return function() {
if (typeof ArrayBuffer == "function") {
var t = v, A = t.lib, D = A.WordArray, m = D.init, u = D.init = function(h) {
if (h instanceof ArrayBuffer && (h = new Uint8Array(h)), (h instanceof Int8Array || typeof Uint8ClampedArray < "u" && h instanceof Uint8ClampedArray || h instanceof Int16Array || h instanceof Uint16Array || h instanceof Int32Array || h instanceof Uint32Array || h instanceof Float32Array || h instanceof Float64Array) && (h = new Uint8Array(h.buffer, h.byteOffset, h.byteLength)), h instanceof Uint8Array) {
for (var r = h.byteLength, x = [], B = 0; B < r; B++)
x[B >>> 2] |= h[B] << 24 - B % 4 * 8;
m.call(this, x, r);
} else
m.apply(this, arguments);
};
u.prototype = D;
}
}(), v.lib.WordArray;
});
}(D0)), D0.exports;
}
var _0 = { exports: {} }, Ar;
function _x() {
return Ar || (Ar = 1, function(S, z) {
(function(v, t) {
S.exports = t(O());
})(L, function(v) {
return function() {
var t = v, A = t.lib, D = A.WordArray, m = t.enc;
m.Utf16 = m.Utf16BE = {
/**
* Converts a word array to a UTF-16 BE string.
*
* @param {WordArray} wordArray The word array.
*
* @return {string} The UTF-16 BE string.
*
* @static
*
* @example
*
* var utf16String = CryptoJS.enc.Utf16.stringify(wordArray);
*/
stringify: function(h) {
for (var r = h.words, x = h.sigBytes, B = [], e = 0; e < x; e += 2) {
var s = r[e >>> 2] >>> 16 - e % 4 * 8 & 65535;
B.push(String.fromCharCode(s));
}
return B.join("");
},
/**
* Converts a UTF-16 BE string to a word array.
*
* @param {string} utf16Str The UTF-16 BE string.
*
* @return {WordArray} The word array.
*
* @static
*
* @example
*
* var wordArray = CryptoJS.enc.Utf16.parse(utf16String);
*/
parse: function(h) {
for (var r = h.length, x = [], B = 0; B < r; B++)
x[B >>> 1] |= h.charCodeAt(B) << 16 - B % 2 * 16;
return D.create(x, r * 2);
}
}, m.Utf16LE = {
/**
* Converts a word array to a UTF-16 LE string.
*
* @param {WordArray} wordArray The word array.
*
* @return {string} The UTF-16 LE string.
*
* @static
*
* @example
*
* var utf16Str = CryptoJS.enc.Utf16LE.stringify(wordArray);
*/
stringify: function(h) {
for (var r = h.words, x = h.sigBytes, B = [], e = 0; e < x; e += 2) {
var s = u(r[e >>> 2] >>> 16 - e % 4 * 8 & 65535);
B.push(String.fromCharCode(s));
}
return B.join("");
},
/**
* Converts a UTF-16 LE string to a word array.
*
* @param {string} utf16Str The UTF-16 LE string.
*
* @return {WordArray} The word array.
*
* @static
*
* @example
*
* var wordArray = CryptoJS.enc.Utf16LE.parse(utf16Str);
*/
parse: function(h) {
for (var r = h.length, x = [], B = 0; B < r; B++)
x[B >>> 1] |= u(h.charCodeAt(B) << 16 - B % 2 * 16);
return D.create(x, r * 2);
}
};
function u(h) {
return h << 8 & 4278255360 | h >>> 8 & 16711935;
}
}(), v.enc.Utf16;
});
}(_0)), _0.exports;
}
var b0 = { exports: {} }, pr;
function e0() {
return pr || (pr = 1, function(S, z) {
(function(v, t) {
S.exports = t(O());
})(L, function(v) {
return function() {
var t = v, A = t.lib, D = A.WordArray, m = t.enc;
m.Base64 = {
/**
* Converts a word array to a Base64 string.
*
* @param {WordArray} wordArray The word array.
*
* @return {string} The Base64 string.
*
* @static
*
* @example
*
* var base64String = CryptoJS.enc.Base64.stringify(wordArray);
*/
stringify: function(h) {
var r = h.words, x = h.sigBytes, B = this._map;
h.clamp();
for (var e = [], s = 0; s < x; s += 3)
for (var o = r[s >>> 2] >>> 24 - s % 4 * 8 & 255, c = r[s + 1 >>> 2] >>> 24 - (s + 1) % 4 * 8 & 255, f = r[s + 2 >>> 2] >>> 24 - (s + 2) % 4 * 8 & 255, l = o << 16 | c << 8 | f, a = 0; a < 4 && s + a * 0.75 < x; a++)
e.push(B.charAt(l >>> 6 * (3 - a) & 63));
var n = B.charAt(64);
if (n)
for (; e.length % 4; )
e.push(n);
return e.join("");
},
/**
* Converts a Base64 string to a word array.
*
* @param {string} base64Str The Base64 string.
*
* @return {WordArray} The word array.
*
* @static
*
* @example
*
* var wordArray = CryptoJS.enc.Base64.parse(base64String);
*/
parse: function(h) {
var r = h.length, x = this._map, B = this._reverseMap;
if (!B) {
B = this._reverseMap = [];
for (var e = 0; e < x.length; e++)
B[x.charCodeAt(e)] = e;
}
var s = x.charAt(64);
if (s) {
var o = h.indexOf(s);
o !== -1 && (r = o);
}
return u(h, r, B);
},
_map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
};
function u(h, r, x) {
for (var B = [], e = 0, s = 0; s < r; s++)
if (s % 4) {
var o = x[h.charCodeAt(s - 1)] << s % 4 * 2, c = x[h.charCodeAt(s)] >>> 6 - s % 4 * 2, f = o | c;
B[e >>> 2] |= f << 24 - e % 4 * 8, e++;
}
return D.create(B, e);
}
}(), v.enc.Base64;
});
}(b0)), b0.exports;
}
var y0 = { exports: {} }, Fr;
function bx() {
return Fr || (Fr = 1, function(S, z) {
(function(v, t) {
S.exports = t(O());
})(L, function(v) {
return function() {
var t = v, A = t.lib, D = A.WordArray, m = t.enc;
m.Base64url = {
/**
* Converts a word array to a Base64url string.
*
* @param {WordArray} wordArray The word array.
*
* @param {boolean} urlSafe Whether to use url safe
*
* @return {string} The Base64url string.
*
* @static
*
* @example
*
* var base64String = CryptoJS.enc.Base64url.stringify(wordArray);
*/
stringify: function(h, r) {
r === void 0 && (r = !0);
var x = h.words, B = h.sigBytes, e = r ? this._safe_map : this._map;
h.clamp();
for (var s = [], o = 0; o < B; o += 3)
for (var c = x[o >>> 2] >>> 24 - o % 4 * 8 & 255, f = x[o + 1 >>> 2] >>> 24 - (o + 1) % 4 * 8 & 255, l = x[o + 2 >>> 2] >>> 24 - (o + 2) % 4 * 8 & 255, a = c << 16 | f << 8 | l, n = 0; n < 4 && o + n * 0.75 < B; n++)
s.push(e.charAt(a >>> 6 * (3 - n) & 63));
var i = e.charAt(64);
if (i)
for (; s.length % 4; )
s.push(i);
return s.join("");
},
/**
* Converts a Base64url string to a word array.
*
* @param {string} base64Str The Base64url string.
*
* @param {boolean} urlSafe Whether to use url safe
*
* @return {WordArray} The word array.
*
* @static
*
* @example
*
* var wordArray = CryptoJS.enc.Base64url.parse(base64String);
*/
parse: function(h, r) {
r === void 0 && (r = !0);
var x = h.length, B = r ? this._safe_map : this._map, e = this._reverseMap;
if (!e) {
e = this._reverseMap = [];
for (var s = 0; s < B.length; s++)
e[B.charCodeAt(s)] = s;
}
var o = B.charAt(64);
if (o) {
var c = h.indexOf(o);
c !== -1 && (x = c);
}
return u(h, x, e);
},
_map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
_safe_map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"
};
function u(h, r, x) {
for (var B = [], e = 0, s = 0; s < r; s++)
if (s % 4) {
var o = x[h.charCodeAt(s - 1)] << s % 4 * 2, c = x[h.charCodeAt(s)] >>> 6 - s % 4 * 2, f = o | c;
B[e >>> 2] |= f << 24 - e % 4 * 8, e++;
}
return D.create(B, e);
}
}(), v.enc.Base64url;
});
}(y0)), y0.exports;
}
var g0 = { exports: {} }, Dr;
function t0() {
return Dr || (Dr = 1, function(S, z) {
(function(v, t) {
S.exports = t(O());
})(L, function(v) {
return function(t) {
var A = v, D = A.lib, m = D.WordArray, u = D.Hasher, h = A.algo, r = [];
(function() {
for (var c = 0; c < 64; c++)
r[c] = t.abs(t.sin(c + 1)) * 4294967296 | 0;
})();
var x = h.MD5 = u.extend({
_doReset: function() {
this._hash = new m.init([
1732584193,
4023233417,
2562383102,
271733878
]);
},
_doProcessBlock: function(c, f) {
for (var l = 0; l < 16; l++) {
var a = f + l, n = c[a];
c[a] = (n << 8 | n >>> 24) & 16711935 | (n << 24 | n >>> 8) & 4278255360;
}
var i = this._hash.words, E = c[f + 0], C = c[f + 1], p = c[f + 2], _ = c[f + 3], R = c[f + 4], d = c[f + 5], F = c[f + 6], y = c[f + 7], g = c[f + 8], q = c[f + 9], P = c[f + 10], W = c[f + 11], X = c[f + 12], T = c[f + 13], N = c[f + 14], K = c[f + 15], b = i[0], w = i[1], H = i[2], k = i[3];
b = B(b, w, H, k, E, 7, r[0]), k = B(k, b, w, H, C, 12, r[1]), H = B(H, k, b, w, p, 17, r[2]), w = B(w, H, k, b, _, 22, r[3]), b = B(b, w, H, k, R, 7, r[4]), k = B(k, b, w, H, d, 12, r[5]), H = B(H, k, b, w, F, 17, r[6]), w = B(w, H, k, b, y, 22, r[7]), b = B(b, w, H, k, g, 7, r[8]), k = B(k, b, w, H, q, 12, r[9]), H = B(H, k, b, w, P, 17, r[10]), w = B(w, H, k, b, W, 22, r[11]), b = B(b, w, H, k, X, 7, r[12]), k = B(k, b, w, H, T, 12, r[13]), H = B(H, k, b, w, N, 17, r[14]), w = B(w, H, k, b, K, 22, r[15]), b = e(b, w, H, k, C, 5, r[16]), k = e(k, b, w, H, F, 9, r[17]), H = e(H, k, b, w, W, 14, r[18]), w = e(w, H, k, b, E, 20, r[19]), b = e(b, w, H, k, d, 5, r[20]), k = e(k, b, w, H, P, 9, r[21]), H = e(H, k, b, w, K, 14, r[22]), w = e(w, H, k, b, R, 20, r[23]), b = e(b, w, H, k, q, 5, r[24]), k = e(k, b, w, H, N, 9, r[25]), H = e(H, k, b, w, _, 14, r[26]), w = e(w, H, k, b, g, 20, r[27]), b = e(b, w, H, k, T, 5, r[28]), k = e(k, b, w, H, p, 9, r[29]), H = e(H, k, b, w, y, 14, r[30]), w = e(w, H, k, b, X, 20, r[31]), b = s(b, w, H, k, d, 4, r[32]), k = s(k, b, w, H, g, 11, r[33]), H = s(H, k, b, w, W, 16, r[34]), w = s(w, H, k, b, N, 23, r[35]), b = s(b, w, H, k, C, 4, r[36]), k = s(k, b, w, H, R, 11, r[37]), H = s(H, k, b, w, y, 16, r[38]), w = s(w, H, k, b, P, 23, r[39]), b = s(b, w, H, k, T, 4, r[40]), k = s(k, b, w, H, E, 11, r[41]), H = s(H, k, b, w, _, 16, r[42]), w = s(w, H, k, b, F, 23, r[43]), b = s(b, w, H, k, q, 4, r[44]), k = s(k, b, w, H, X, 11, r[45]), H = s(H, k, b, w, K, 16, r[46]), w = s(w, H, k, b, p, 23, r[47]), b = o(b, w, H, k, E, 6, r[48]), k = o(k, b, w, H, y, 10, r[49]), H = o(H, k, b, w, N, 15, r[50]), w = o(w, H, k, b, d, 21, r[51]), b = o(b, w, H, k, X, 6, r[52]), k = o(k, b, w, H, _, 10, r[53]), H = o(H, k, b, w, P, 15, r[54]), w = o(w, H, k, b, C, 21, r[55]), b = o(b, w, H, k, g, 6, r[56]), k = o(k, b, w, H, K, 10, r[57]), H = o(H, k, b, w, F, 15, r[58]), w = o(w, H, k, b, T, 21, r[59]), b = o(b, w, H, k, R, 6, r[60]), k = o(k, b, w, H, W, 10, r[61]), H = o(H, k, b, w, p, 15, r[62]), w = o(w, H, k, b, q, 21, r[63]), i[0] = i[0] + b | 0, i[1] = i[1] + w | 0, i[2] = i[2] + H | 0, i[3] = i[3] + k | 0;
},
_doFinalize: function() {
var c = this._data, f = c.words, l = this._nDataBytes * 8, a = c.sigBytes * 8;
f[a >>> 5] |= 128 << 24 - a % 32;
var n = t.floor(l / 4294967296), i = l;
f[(a + 64 >>> 9 << 4) + 15] = (n << 8 | n >>> 24) & 16711935 | (n << 24 | n >>> 8) & 4278255360, f[(a + 64 >>> 9 << 4) + 14] = (i << 8 | i >>> 24) & 16711935 | (i << 24 | i >>> 8) & 4278255360, c.sigBytes = (f.length + 1) * 4, this._process();
for (var E = this._hash, C = E.words, p = 0; p < 4; p++) {
var _ = C[p];
C[p] = (_ << 8 | _ >>> 24) & 16711935 | (_ << 24 | _ >>> 8) & 4278255360;
}
return E;
},
clone: function() {
var c = u.clone.call(this);
return c._hash = this._hash.clone(), c;
}
});
function B(c, f, l, a, n, i, E) {
var C = c + (f & l | ~f & a) + n + E;
return (C << i | C >>> 32 - i) + f;
}
function e(c, f, l, a, n, i, E) {
var C = c + (f & a | l & ~a) + n + E;
return (C << i | C >>> 32 - i) + f;
}
function s(c, f, l, a, n, i, E) {
var C = c + (f ^ l ^ a) + n + E;
return (C << i | C >>> 32 - i) + f;
}
function o(c, f, l, a, n, i, E) {
var C = c + (l ^ (f | ~a)) + n + E;
return (C << i | C >>> 32 - i) + f;
}
A.MD5 = u._createHelper(x), A.HmacMD5 = u._createHmacHelper(x);
}(Math), v.MD5;
});
}(g0)), g0.exports;
}
var m0 = { exports: {} }, _r;
function Jr() {
return _r || (_r = 1, function(S, z) {
(function(v, t) {
S.exports = t(O());
})(L, function(v) {
return function() {
var t = v, A = t.lib, D = A.WordArray, m = A.Hasher, u = t.algo, h = [], r = u.SHA1 = m.extend({
_doReset: function() {
this._hash = new D.init([
1732584193,
4023233417,
2562383102,
271733878,
3285377520
]);
},
_doProcessBlock: function(x, B) {
for (var e = this._hash.words, s = e[0], o = e[1], c = e[2], f = e[3], l = e[4], a = 0; a < 80; a++) {
if (a < 16)
h[a] = x[B + a] | 0;
else {
var n = h[a - 3] ^ h[a - 8] ^ h[a - 14] ^ h[a - 16];
h[a] = n << 1 | n >>> 31;
}
var i = (s << 5 | s >>> 27) + l + h[a];
a < 20 ? i += (o & c | ~o & f) + 1518500249 : a < 40 ? i += (o ^ c ^ f) + 1859775393 : a < 60 ? i += (o & c | o & f | c & f) - 1894007588 : i += (o ^ c ^ f) - 899497514, l = f, f = c, c = o << 30 | o >>> 2, o = s, s = i;
}
e[0] = e[0] + s | 0, e[1] = e[1] + o | 0, e[2] = e[2] + c | 0, e[3] = e[3] + f | 0, e[4] = e[4] + l | 0;
},
_doFinalize: function() {
var x = this._data, B = x.words, e = this._nDataBytes * 8, s = x.sigBytes * 8;
return B[s >>> 5] |= 128 << 24 - s % 32, B[(s + 64 >>> 9 << 4) + 14] = Math.floor(e / 4294967296), B[(s + 64 >>> 9 << 4) + 15] = e, x.sigBytes = B.length * 4, this._process(), this._hash;
},
clone: function() {
var x = m.clone.call(this);
return x._hash = this._hash.clone(), x;
}
});
t.SHA1 = m._createHelper(r), t.HmacSHA1 = m._createHmacHelper(r);
}(), v.SHA1;
});
}(m0)), m0.exports;
}
var k0 = { exports: {} }, br;
function xr() {
return br || (br = 1, function(S, z) {
(function(v, t) {
S.exports = t(O());
})(L, function(v) {
return function(t) {
var A = v, D = A.lib, m = D.WordArray, u = D.Hasher, h = A.algo, r = [], x = [];
(function() {
function s(l) {
for (var a = t.sqrt(l), n = 2; n <= a; n++)
if (!(l % n))
return !1;
return !0;
}
function o(l) {
return (l - (l | 0)) * 4294967296 | 0;
}
for (var c = 2, f = 0; f < 64; )
s(c) && (f < 8 && (r[f] = o(t.pow(c, 1 / 2))), x[f] = o(t.pow(c, 1 / 3)), f++), c++;
})();
var B = [], e = h.SHA256 = u.extend({
_doReset: function() {
this._hash = new m.init(r.slice(0));
},
_doProcessBlock: function(s, o) {
for (var c = this._hash.words, f = c[0], l = c[1], a = c[2], n = c[3], i = c[4], E = c[5], C = c[6], p = c[7], _ = 0; _ < 64; _++) {
if (_ < 16)
B[_] = s[o + _] | 0;
else {
var R = B[_ - 15], d = (R << 25 | R >>> 7) ^ (R << 14 | R >>> 18) ^ R >>> 3, F = B[_ - 2], y = (F << 15 | F >>> 17) ^ (F << 13 | F >>> 19) ^ F >>> 10;
B[_] = d + B[_ - 7] + y + B[_ - 16];
}
var g = i & E ^ ~i & C, q = f & l ^ f & a ^ l & a, P = (f << 30 | f >>> 2) ^ (f << 19 | f >>> 13) ^ (f << 10 | f >>> 22), W = (i << 26 | i >>> 6) ^ (i << 21 | i >>> 11) ^ (i << 7 | i >>> 25), X = p + W + g + x[_] + B[_], T = P + q;
p = C, C = E, E = i, i = n + X | 0, n = a, a = l, l = f, f = X + T | 0;
}
c[0] = c[0] + f | 0, c[1] = c[1] + l | 0, c[2] = c[2] + a | 0, c[3] = c[3] + n | 0, c[4] = c[4] + i | 0, c[5] = c[5] + E | 0, c[6] = c[6] + C | 0, c[7] = c[7] + p | 0;
},
_doFinalize: function() {
var s = this._data, o = s.words, c = this._nDataBytes * 8, f = s.sigBytes * 8;
return o[f >>> 5] |= 128 << 24 - f % 32, o[(f + 64 >>> 9 << 4) + 14] = t.floor(c / 4294967296), o[(f + 64 >>> 9 << 4) + 15] = c, s.sigBytes = o.length * 4, this._process(), this._hash;
},
clone: function() {
var s = u.clone.call(this);
return s._hash = this._hash.clone(), s;
}
});
A.SHA256 = u._createHelper(e), A.HmacSHA256 = u._createHmacHelper(e);
}(Math), v.SHA256;
});
}(k0)), k0.exports;
}
var w0 = { exports: {} }, yr;
function yx() {
return yr || (yr = 1, function(S, z) {
(function(v, t, A) {
S.exports = t(O(), xr());
})(L, function(v) {
return function() {
var t = v, A = t.lib, D = A.WordArray, m = t.algo, u = m.SHA256, h = m.SHA224 = u.extend({
_doReset: function() {
this._hash = new D.init([
3238371032,
914150663,
812702999,
4144912697,
4290775857,
1750603025,
1694076839,
3204075428
]);
},
_doFinalize: function() {
var r = u._doFinalize.call(this);
return r.sigBytes -= 4, r;
}
});
t.SHA224 = u._createHelper(h), t.HmacSHA224 = u._createHmacHelper(h);
}(), v.SHA224;
});
}(w0)), w0.exports;
}
var H0 = { exports: {} }, gr;
function rx() {
return gr || (gr = 1, function(S, z) {
(function(v, t, A) {
S.exports = t(O(), C0());
})(L, function(v) {
return function() {
var t = v, A = t.lib, D = A.Hasher, m = t.x64, u = m.Word, h = m.WordArray, r = t.algo;
function x() {
return u.create.apply(u, arguments);
}
var B = [
x(1116352408, 3609767458),
x(1899447441, 602891725),
x(3049323471, 3964484399),
x(3921009573, 2173295548),
x(961987163, 4081628472),
x(1508970993, 3053834265),
x(2453635748, 2937671579),
x(2870763221, 3664609560),
x(3624381080, 2734883394),
x(310598401, 1164996542),
x(607225278, 1323610764),
x(1426881987, 3590304994),
x(1925078388, 4068182383),
x(2162078206, 991336113),
x(2614888103, 633803317),
x(3248222580, 3479774868),
x(3835390401, 2666613458),
x(4022224774, 944711139),
x(264347078, 2341262773),
x(604807628, 2007800933),
x(770255983, 1495990901),
x(1249150122, 1856431235),
x(1555081692, 3175218132),
x(1996064986, 2198950837),
x(2554220882, 3999719339),
x(2821834349, 766784016),
x(2952996808, 2566594879),
x(3210313671, 3203337956),
x(3336571891, 1034457026),
x(3584528711, 2466948901),
x(113926993, 3758326383),
x(338241895, 168717936),
x(666307205, 1188179964),
x(773529912, 1546045734),
x(1294757372, 1522805485),
x(1396182291, 2643833823),
x(1695183700, 2343527390),
x(1986661051, 1014477480),
x(2177026350, 1206759142),
x(2456956037, 344077627),
x(2730485921, 1290863460),
x(2820302411, 3158454273),
x(3259730800, 3505952657),
x(3345764771, 106217008),
x(3516065817, 3606008344),
x(3600352804, 1432725776),
x(4094571909, 1467031594),
x(275423344, 851169720),
x(430227734, 3100823752),
x(506948616, 1363258195),
x(659060556, 3750685593),
x(883997877, 3785050280),
x(958139571, 3318307427),
x(1322822218, 3812723403),
x(1537002063, 2003034995),
x(1747873779, 3602036899),
x(1955562222, 1575990012),
x(2024104815, 1125592928),
x(2227730452, 2716904306),
x(2361852424, 442776044),
x(2428436474, 593698344),
x(2756734187, 3733110249),
x(3204031479, 2999351573),
x(3329325298, 3815920427),
x(3391569614, 3928383900),
x(3515267271, 566280711),
x(3940187606, 3454069534),
x(4118630271, 4000239992),
x(116418474, 1914138554),
x(174292421, 2731055270),
x(289380356, 3203993006),
x(460393269, 320620315),
x(685471733, 587496836),
x(852142971, 1086792851),
x(1017036298, 365543100),
x(1126000580, 2618297676),
x(1288033470, 3409855158),
x(1501505948, 4234509866),
x(1607167915, 987167468),
x(1816402316, 1246189591)
], e = [];
(function() {
for (var o = 0; o < 80; o++)
e[o] = x();
})();
var s = r.SHA512 = D.extend({
_doReset: function() {
this._hash = new h.init([
new u.init(1779033703, 4089235720),
new u.init(3144134277, 2227873595),
new u.init(1013904242, 4271175723),
new u.init(2773480762, 1595750129),
new u.init(1359893119, 2917565137),
new u.init(2600822924, 725511199),
new u.init(528734635, 4215389547),
new u.init(1541459225, 327033209)
]);
},
_doProcessBlock: function(o, c) {
for (var f = this._hash.words, l = f[0], a = f[1], n = f[2], i = f[3], E = f[4], C = f[5], p = f[6], _ = f[7], R = l.high, d = l.low, F = a.high, y = a.low, g = n.high, q = n.low, P = i.high, W = i.low, X = E.high, T = E.low, N = C.high, K = C.low, b = p.high, w = p.low, H = _.high, k = _.low, $ = R, U