@fenil265/fundly-payment-sdk
Version:
Fundly Payment SDK for seamless integration with Fundly Pay systems.
1,283 lines (1,282 loc) • 1.19 MB
JavaScript
import { jsxs as D, Fragment as Dt, jsx as f } from "react/jsx-runtime";
import St, { useRef as ut, useEffect as ve, createContext as bg, useState as sA, useContext as Qg, useCallback as Od } from "react";
import { DotLottieReact as Fg } from "@lottiefiles/dotlottie-react";
const Pt = ({ open: e, onClose: A, children: i }) => {
const t = ut(null);
ve(() => {
const d = (B) => {
B.key === "Escape" && e && A();
};
return e && (document.addEventListener("keydown", d), document.body.style.overflow = "hidden"), () => {
document.removeEventListener("keydown", d), document.body.style.overflow = "unset";
};
}, [e, A]);
const n = (d) => {
d.target === d.currentTarget && A();
};
return e ? /* @__PURE__ */ D(Dt, { children: [
/* @__PURE__ */ f(
"div",
{
style: {
position: "fixed",
top: 0,
left: 0,
right: 0,
bottom: 0,
backgroundColor: "rgba(0, 0, 0, 0.5)",
zIndex: 1e3,
opacity: e ? 1 : 0,
transition: "opacity 0.3s ease-in-out"
},
onClick: n,
role: "presentation",
"aria-hidden": "true"
}
),
/* @__PURE__ */ f(
"div",
{
ref: t,
role: "dialog",
"aria-modal": "true",
style: {
position: "fixed",
bottom: 0,
left: 0,
right: 0,
backgroundColor: "white",
maxWidth: "430px",
margin: "0 auto",
borderTopLeftRadius: "16px",
borderTopRightRadius: "16px",
boxShadow: "0 -4px 20px rgba(0, 0, 0, 0.1)",
zIndex: 1001,
transform: e ? "translateY(0)" : "translateY(100%)",
transition: "transform 0.3s ease-in-out",
maxHeight: "90vh",
overflowY: "auto"
},
children: i
}
)
] }) : null;
}, ht = ({ open: e, onClose: A, title: i, children: t, actions: n }) => {
ve(() => {
const B = (x) => {
x.key === "Escape" && e && A();
};
return e && (document.addEventListener("keydown", B), document.body.style.overflow = "hidden"), () => {
document.removeEventListener("keydown", B), document.body.style.overflow = "unset";
};
}, [e, A]);
const d = (B) => {
B.target === B.currentTarget && A();
};
return e ? /* @__PURE__ */ D(Dt, { children: [
/* @__PURE__ */ f(
"div",
{
style: {
position: "fixed",
top: 0,
left: 0,
right: 0,
bottom: 0,
backgroundColor: "rgba(0, 0, 0, 0.5)",
zIndex: 2e3,
display: "flex",
alignItems: "center",
justifyContent: "center",
padding: "16px"
},
onClick: d,
role: "presentation",
"aria-hidden": "true",
children: /* @__PURE__ */ D(
"div",
{
role: "dialog",
"aria-modal": "true",
"aria-labelledby": i ? "dialog-title" : void 0,
style: {
backgroundColor: "white",
borderRadius: "16px",
maxWidth: "90%",
width: "380px",
boxShadow: "0 8px 32px rgba(0, 0, 0, 0.15)",
maxHeight: "90vh",
overflowY: "auto",
animation: "dialogFadeIn 0.2s ease-out"
},
onClick: (B) => B.stopPropagation(),
children: [
i && /* @__PURE__ */ f(vr, { children: i }),
t,
n && /* @__PURE__ */ f(Ot, { children: n })
]
}
)
}
),
/* @__PURE__ */ f("style", { children: `
@keyframes dialogFadeIn {
from {
opacity: 0;
transform: scale(0.95);
}
to {
opacity: 1;
transform: scale(1);
}
}
` })
] }) : null;
}, vr = ({ children: e, style: A, sx: i }) => {
const t = {
padding: "20px 24px 16px",
fontSize: "20px",
fontWeight: 600,
color: "#222222",
fontFamily: "Poppins, sans-serif",
...i,
...A
};
return /* @__PURE__ */ f("div", { id: "dialog-title", style: t, children: e });
}, gt = ({ children: e }) => /* @__PURE__ */ f(
"div",
{
style: {
padding: "16px 24px",
color: "#222222",
fontFamily: "Poppins, sans-serif"
},
children: e
}
), Ot = ({ children: e }) => /* @__PURE__ */ f(
"div",
{
style: {
padding: "16px 24px 20px",
display: "flex",
gap: "12px",
justifyContent: "flex-end"
},
children: e
}
);
let Hd = !1;
function Ug(e) {
Hd = e;
}
function Nd() {
return Hd;
}
var bc = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function Mg(e) {
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
}
function Lg(e) {
if (Object.prototype.hasOwnProperty.call(e, "__esModule")) return e;
var A = e.default;
if (typeof A == "function") {
var i = function t() {
var n = !1;
try {
n = this instanceof t;
} catch {
}
return n ? Reflect.construct(A, arguments, this.constructor) : A.apply(this, arguments);
};
i.prototype = A.prototype;
} else i = {};
return Object.defineProperty(i, "__esModule", { value: !0 }), Object.keys(e).forEach(function(t) {
var n = Object.getOwnPropertyDescriptor(e, t);
Object.defineProperty(i, t, n.get ? n : {
enumerable: !0,
get: function() {
return e[t];
}
});
}), i;
}
var lo = { exports: {} };
const Dg = {}, Sg = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
default: Dg
}, Symbol.toStringTag, { value: "Module" })), Og = /* @__PURE__ */ Lg(Sg);
var Hg = lo.exports, Qc;
function Ng() {
return Qc || (Qc = 1, (function(e, A) {
(function(i, t) {
e.exports = t();
})(Hg, (function() {
var i = 0;
function t(a) {
return "__private_" + i++ + "_" + a;
}
function n(a, r) {
if (!Object.prototype.hasOwnProperty.call(a, r))
throw new TypeError("attempted to use private field on non-instance");
return a;
}
const d = "clevertap-prod.com", B = "https:", x = "eu1";
var m = t("accountId"), b = t("region"), Q = t("targetDomain"), N = t("dcSdkversion"), T = t("token");
class G {
constructor() {
let {
id: r
} = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "", o = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : d, l = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : "";
Object.defineProperty(this, m, {
writable: !0,
value: void 0
}), Object.defineProperty(this, b, {
writable: !0,
value: ""
}), Object.defineProperty(this, Q, {
writable: !0,
value: d
}), Object.defineProperty(this, N, {
writable: !0,
value: ""
}), Object.defineProperty(this, T, {
writable: !0,
value: ""
}), this.id = r, s && (this.region = s), o && (this.targetDomain = o), l && (this.token = l);
}
get id() {
return n(this, m)[m];
}
set id(r) {
n(this, m)[m] = r;
}
get region() {
return n(this, b)[b];
}
set region(r) {
n(this, b)[b] = r;
}
get dcSDKVersion() {
return n(this, N)[N];
}
set dcSDKVersion(r) {
n(this, N)[N] = r;
}
get targetDomain() {
return n(this, Q)[Q];
}
set targetDomain(r) {
n(this, Q)[Q] = r;
}
get token() {
return n(this, T)[T];
}
set token(r) {
n(this, T)[T] = r;
}
get finalTargetDomain() {
return this.region ? "".concat(this.region, ".").concat(this.targetDomain) : this.targetDomain === d ? "".concat(x, ".").concat(this.targetDomain) : this.targetDomain;
}
get dataPostPEURL() {
return "".concat(B, "//").concat(this.finalTargetDomain, "/defineVars");
}
get dataPostURL() {
return "".concat(B, "//").concat(this.finalTargetDomain, "/a?t=96");
}
get recorderURL() {
return "".concat(B, "//").concat(this.finalTargetDomain, "/r?r=1");
}
get emailURL() {
return "".concat(B, "//").concat(this.finalTargetDomain, "/e?r=1");
}
}
const z = new RegExp(`^\\s+|\\.|:|\\$|'|"|\\\\|\\s+$`, "g"), V = new RegExp(`^\\s+|'|"|\\\\|\\s+$`, "g"), cA = new RegExp("'", "g"), X = "clear", Y = "Charged ID", BA = "WZRK_CHARGED_ID", AA = "WZRK_G", $ = "WZRK_K", W = "WZRK_CAMP", hA = "WZRK_CAMP_G", oA = "WZRK_S", aA = 1200, rA = "WZRK_EV", lA = "WZRK_META", fA = "WZRK_PR", gA = "WZRK_ACCOUNT_ID", xA = "WZRK_ARP", HA = "WZRK_L", FA = "global", uA = "display", wA = "WZRK_WPR", UA = "optOut", QA = "ct_optout", OA = ":OO", MA = "useIP", jA = "WZRK_X", VA = 100, WA = "isOUL", zA = "push", mA = "ping", kA = 86400 * 365, YA = 200, LA = 120 * 1e3, vA = 300 * 1e3, NA = "2", _A = "cUsY", ae = "wzrk_", Me = "wzrk_id", Ye = "Notification Viewed", qe = "Notification Clicked", IA = "WZRK_FPU", qA = "WZRK_PSD", te = "$incr", $e = "$decr", Le = "$set", ot = "$add", Pn = "$remove", Rn = "$delete", Nt = "WZRK_INBOX_CONFIG", Fi = "WZRK_INBOX", To = 15, Ui = "WZRK_PE", Mi = 1e3, Po = 1e3 * 60 * 10, Li = "wzrk_fetch", Di = "WZRK_PUSH_CONFIG", ei = "WZRK_APPLICATION_SERVER_KEY_RECIEVED", Si = "WZRK_WEB_PUSH_CONFIG_RECEIVED", ar = "WZRK_NOTIFICATION_PUSH_DEFERRED", Kt = "vapid_migration_prompt_shown", zn = "notif_last_time", Yu = 300, qu = "wzrk_wrapper", F0 = "pnWrapper", Ro = "WZRK_POPUP_LOADING", Zu = "ctCustomHtmlPreview", _u = "ctWebPopupPreview", Kn = "WZRK_QC", $u = "_w_", zo = "WZRK_BLOCK", U0 = "WZRK_ISOLATE_SD", he = {
KV_PAIR: 1,
BANNER: 2,
CAROUSEL: 3,
VISUAL_BUILDER: 4,
CUSTOM_HTML: 5,
JSON: 6
}, Jn = {
HTML: "html",
FORM: "form",
JSON: "json"
}, Er = {
BOX: 0,
INTERSTITIAL: 1,
BANNER: 2,
IMAGE_ONLY: 3,
ADVANCED_BUILDER: 4
}, ti = {
EXIT_INTENT: 1,
/* Deprecated */
WEB_NATIVE_DISPLAY: 2,
FOOTER_NOTIFICATION: 0,
/* Web Popup */
FOOTER_NOTIFICATION_2: null
/* Web Popup */
}, Af = ["Stayed", "UTM Visited", "App Launched", "Notification Sent", Ye, qe], M0 = [$, jA, fA], ri = {
OPEN_LINK: "url",
OPEN_LINK_AND_CLOSE: "urlCloseNotification",
CLOSE: "close",
OPEN_WEB_URL: "open-web-url",
SOFT_PROMPT: "soft-prompt",
RUN_JS: "js"
}, Oi = (a) => typeof a == "string" || a instanceof String, pt = (a) => Object.prototype.toString.call(a) === "[object Object]", Hi = (a) => typeof a == "object" && a instanceof Date, xt = (a) => {
for (const r in a)
if (a.hasOwnProperty(r))
return !1;
return !0;
}, L0 = (a) => !isNaN(parseFloat(a)) && isFinite(a), D0 = (a) => /^-?[\d.]+(?:e-?\d+)?$/.test(a) && typeof a == "number", me = (a) => !(a == null || a === "undefined"), S0 = (a, r) => {
if (typeof a == "object") {
for (const s in a)
if (a.hasOwnProperty(s)) {
const o = S0(a[s], r);
let l;
l = Ko(s, z), l.length > 1024 && (l = l.substring(0, 1024), r.reportError(520, l + "... length exceeded 1024 chars. Trimmed.")), delete a[s], a[l] = o;
}
} else {
let s;
return Oi(a) ? (s = Ko(a, V), s.length > 1024 && (s = s.substring(0, 1024), r.reportError(521, s + "... length exceeded 1024 chars. Trimmed."))) : s = a, s;
}
return a;
}, Ko = (a, r) => a.replace(r, ""), Jo = () => {
const a = /* @__PURE__ */ new Date();
return a.getFullYear() + "" + a.getMonth() + a.getDay();
}, br = () => Math.floor((/* @__PURE__ */ new Date()).getTime() / 1e3), Vn = (a) => "$D_" + Math.round(a.getTime() / 1e3), O0 = (a) => {
if (ef(a))
return "$D_" + a;
}, ef = (a) => {
const r = /^(\d{4})(\d{2})(\d{2})$/.exec(a);
if (r == null) return !1;
const s = r[3], o = r[2] - 1, l = r[1], c = new Date(l, o, s);
return c.getDate() == s && c.getMonth() == o && c.getFullYear() == l;
};
var Vo = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof bc < "u" ? bc : typeof self < "u" ? self : {}, Xn = { exports: {} };
function tf(a) {
throw new Error('Could not dynamically require "' + a + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
}
var Gn = { exports: {} }, rf = Gn.exports, H0;
function XA() {
return H0 || (H0 = 1, (function(a, r) {
(function(s, o) {
a.exports = o();
})(rf, function() {
var s = s || (function(o, l) {
var c;
if (typeof window < "u" && window.crypto && (c = window.crypto), typeof self < "u" && self.crypto && (c = self.crypto), typeof globalThis < "u" && globalThis.crypto && (c = globalThis.crypto), !c && typeof window < "u" && window.msCrypto && (c = window.msCrypto), !c && typeof Vo < "u" && Vo.crypto && (c = Vo.crypto), !c && typeof tf == "function")
try {
c = Og;
} catch {
}
var w = function() {
if (c) {
if (typeof c.getRandomValues == "function")
try {
return c.getRandomValues(new Uint32Array(1))[0];
} catch {
}
if (typeof c.randomBytes == "function")
try {
return c.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 F() {
}
return function(I) {
var v;
return F.prototype = I, v = new F(), F.prototype = null, v;
};
})(), C = {}, h = C.lib = {}, g = h.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(F) {
var I = u(this);
return F && I.mixIn(F), (!I.hasOwnProperty("init") || this.init === I.init) && (I.init = function() {
I.$super.init.apply(this, arguments);
}), I.init.prototype = I, I.$super = this, I;
},
/**
* 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 F = this.extend();
return F.init.apply(F, arguments), F;
},
/**
* 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(F) {
for (var I in F)
F.hasOwnProperty(I) && (this[I] = F[I]);
F.hasOwnProperty("toString") && (this.toString = F.toString);
},
/**
* Creates a copy of this object.
*
* @return {Object} The clone.
*
* @example
*
* var clone = instance.clone();
*/
clone: function() {
return this.init.prototype.extend(this);
}
};
})(), y = h.WordArray = g.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(F, I) {
F = this.words = F || [], I != l ? this.sigBytes = I : this.sigBytes = F.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(F) {
return (F || E).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(F) {
var I = this.words, v = F.words, L = this.sigBytes, S = F.sigBytes;
if (this.clamp(), L % 4)
for (var P = 0; P < S; P++) {
var K = v[P >>> 2] >>> 24 - P % 4 * 8 & 255;
I[L + P >>> 2] |= K << 24 - (L + P) % 4 * 8;
}
else
for (var eA = 0; eA < S; eA += 4)
I[L + eA >>> 2] = v[eA >>> 2];
return this.sigBytes += S, this;
},
/**
* Removes insignificant bits.
*
* @example
*
* wordArray.clamp();
*/
clamp: function() {
var F = this.words, I = this.sigBytes;
F[I >>> 2] &= 4294967295 << 32 - I % 4 * 8, F.length = o.ceil(I / 4);
},
/**
* Creates a copy of this word array.
*
* @return {WordArray} The clone.
*
* @example
*
* var clone = wordArray.clone();
*/
clone: function() {
var F = g.clone.call(this);
return F.words = this.words.slice(0), F;
},
/**
* 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(F) {
for (var I = [], v = 0; v < F; v += 4)
I.push(w());
return new y.init(I, F);
}
}), p = C.enc = {}, E = p.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(F) {
for (var I = F.words, v = F.sigBytes, L = [], S = 0; S < v; S++) {
var P = I[S >>> 2] >>> 24 - S % 4 * 8 & 255;
L.push((P >>> 4).toString(16)), L.push((P & 15).toString(16));
}
return L.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(F) {
for (var I = F.length, v = [], L = 0; L < I; L += 2)
v[L >>> 3] |= parseInt(F.substr(L, 2), 16) << 24 - L % 8 * 4;
return new y.init(v, I / 2);
}
}, U = p.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(F) {
for (var I = F.words, v = F.sigBytes, L = [], S = 0; S < v; S++) {
var P = I[S >>> 2] >>> 24 - S % 4 * 8 & 255;
L.push(String.fromCharCode(P));
}
return L.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(F) {
for (var I = F.length, v = [], L = 0; L < I; L++)
v[L >>> 2] |= (F.charCodeAt(L) & 255) << 24 - L % 4 * 8;
return new y.init(v, I);
}
}, O = p.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(F) {
try {
return decodeURIComponent(escape(U.stringify(F)));
} 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(F) {
return U.parse(unescape(encodeURIComponent(F)));
}
}, M = h.BufferedBlockAlgorithm = g.extend({
/**
* Resets this block algorithm's data buffer to its initial state.
*
* @example
*
* bufferedBlockAlgorithm.reset();
*/
reset: function() {
this._data = new y.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(F) {
typeof F == "string" && (F = O.parse(F)), this._data.concat(F), this._nDataBytes += F.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(F) {
var I, v = this._data, L = v.words, S = v.sigBytes, P = this.blockSize, K = P * 4, eA = S / K;
F ? eA = o.ceil(eA) : eA = o.max((eA | 0) - this._minBufferSize, 0);
var R = eA * P, J = o.min(R * 4, S);
if (R) {
for (var _ = 0; _ < R; _ += P)
this._doProcessBlock(L, _);
I = L.splice(0, R), v.sigBytes -= J;
}
return new y.init(I, J);
},
/**
* Creates a copy of this object.
*
* @return {Object} The clone.
*
* @example
*
* var clone = bufferedBlockAlgorithm.clone();
*/
clone: function() {
var F = g.clone.call(this);
return F._data = this._data.clone(), F;
},
_minBufferSize: 0
});
h.Hasher = M.extend({
/**
* Configuration options.
*/
cfg: g.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(F) {
this.cfg = this.cfg.extend(F), this.reset();
},
/**
* Resets this hasher to its initial state.
*
* @example
*
* hasher.reset();
*/
reset: function() {
M.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(F) {
return this._append(F), 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(F) {
F && this._append(F);
var I = this._doFinalize();
return I;
},
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(F) {
return function(I, v) {
return new F.init(v).finalize(I);
};
},
/**
* 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(F) {
return function(I, v) {
return new H.HMAC.init(F, v).finalize(I);
};
}
});
var H = C.algo = {};
return C;
})(Math);
return s;
});
})(Gn)), Gn.exports;
}
var Wn = { exports: {} }, nf = Wn.exports, N0;
function Yn() {
return N0 || (N0 = 1, (function(a, r) {
(function(s, o) {
a.exports = o(XA());
})(nf, function(s) {
return (function(o) {
var l = s, c = l.lib, w = c.Base, u = c.WordArray, C = l.x64 = {};
C.Word = w.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(h, g) {
this.high = h, this.low = g;
}
/**
* 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);
// }
}), C.WordArray = w.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(h, g) {
h = this.words = h || [], g != o ? this.sigBytes = g : this.sigBytes = h.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 h = this.words, g = h.length, y = [], p = 0; p < g; p++) {
var E = h[p];
y.push(E.high), y.push(E.low);
}
return u.create(y, this.sigBytes);
},
/**
* Creates a copy of this word array.
*
* @return {X64WordArray} The clone.
*
* @example
*
* var clone = x64WordArray.clone();
*/
clone: function() {
for (var h = w.clone.call(this), g = h.words = this.words.slice(0), y = g.length, p = 0; p < y; p++)
g[p] = g[p].clone();
return h;
}
});
})(), s;
});
})(Wn)), Wn.exports;
}
var qn = { exports: {} }, sf = qn.exports, j0;
function of() {
return j0 || (j0 = 1, (function(a, r) {
(function(s, o) {
a.exports = o(XA());
})(sf, function(s) {
return (function() {
if (typeof ArrayBuffer == "function") {
var o = s, l = o.lib, c = l.WordArray, w = c.init, u = c.init = function(C) {
if (C instanceof ArrayBuffer && (C = new Uint8Array(C)), (C instanceof Int8Array || typeof Uint8ClampedArray < "u" && C instanceof Uint8ClampedArray || C instanceof Int16Array || C instanceof Uint16Array || C instanceof Int32Array || C instanceof Uint32Array || C instanceof Float32Array || C instanceof Float64Array) && (C = new Uint8Array(C.buffer, C.byteOffset, C.byteLength)), C instanceof Uint8Array) {
for (var h = C.byteLength, g = [], y = 0; y < h; y++)
g[y >>> 2] |= C[y] << 24 - y % 4 * 8;
w.call(this, g, h);
} else
w.apply(this, arguments);
};
u.prototype = c;
}
})(), s.lib.WordArray;
});
})(qn)), qn.exports;
}
var Zn = { exports: {} }, af = Zn.exports, k0;
function lf() {
return k0 || (k0 = 1, (function(a, r) {
(function(s, o) {
a.exports = o(XA());
})(af, function(s) {
return (function() {
var o = s, l = o.lib, c = l.WordArray, w = o.enc;
w.Utf16 = w.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(C) {
for (var h = C.words, g = C.sigBytes, y = [], p = 0; p < g; p += 2) {
var E = h[p >>> 2] >>> 16 - p % 4 * 8 & 65535;
y.push(String.fromCharCode(E));
}
return y.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(C) {
for (var h = C.length, g = [], y = 0; y < h; y++)
g[y >>> 1] |= C.charCodeAt(y) << 16 - y % 2 * 16;
return c.create(g, h * 2);
}
}, w.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(C) {
for (var h = C.words, g = C.sigBytes, y = [], p = 0; p < g; p += 2) {
var E = u(h[p >>> 2] >>> 16 - p % 4 * 8 & 65535);
y.push(String.fromCharCode(E));
}
return y.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(C) {
for (var h = C.length, g = [], y = 0; y < h; y++)
g[y >>> 1] |= u(C.charCodeAt(y) << 16 - y % 2 * 16);
return c.create(g, h * 2);
}
};
function u(C) {
return C << 8 & 4278255360 | C >>> 8 & 16711935;
}
})(), s.enc.Utf16;
});
})(Zn)), Zn.exports;
}
var _n = { exports: {} }, cf = _n.exports, T0;
function Qr() {
return T0 || (T0 = 1, (function(a, r) {
(function(s, o) {
a.exports = o(XA());
})(cf, function(s) {
return (function() {
var o = s, l = o.lib, c = l.WordArray, w = o.enc;
w.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(C) {
var h = C.words, g = C.sigBytes, y = this._map;
C.clamp();
for (var p = [], E = 0; E < g; E += 3)
for (var U = h[E >>> 2] >>> 24 - E % 4 * 8 & 255, O = h[E + 1 >>> 2] >>> 24 - (E + 1) % 4 * 8 & 255, M = h[E + 2 >>> 2] >>> 24 - (E + 2) % 4 * 8 & 255, H = U << 16 | O << 8 | M, F = 0; F < 4 && E + F * 0.75 < g; F++)
p.push(y.charAt(H >>> 6 * (3 - F) & 63));
var I = y.charAt(64);
if (I)
for (; p.length % 4; )
p.push(I);
return p.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(C) {
var h = C.length, g = this._map, y = this._reverseMap;
if (!y) {
y = this._reverseMap = [];
for (var p = 0; p < g.length; p++)
y[g.charCodeAt(p)] = p;
}
var E = g.charAt(64);
if (E) {
var U = C.indexOf(E);
U !== -1 && (h = U);
}
return u(C, h, y);
},
_map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
};
function u(C, h, g) {
for (var y = [], p = 0, E = 0; E < h; E++)
if (E % 4) {
var U = g[C.charCodeAt(E - 1)] << E % 4 * 2, O = g[C.charCodeAt(E)] >>> 6 - E % 4 * 2, M = U | O;
y[p >>> 2] |= M << 24 - p % 4 * 8, p++;
}
return c.create(y, p);
}
})(), s.enc.Base64;
});
})(_n)), _n.exports;
}
var $n = { exports: {} }, df = $n.exports, P0;
function uf() {