@payfurl/client 4.6.16 → 4.6.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/sdk/{CxPayThreeDsProvider-fdb9495d.mjs → CxPayThreeDsProvider-02e1c15d.mjs} +3 -3
- package/dist/sdk/{DefaultThreeDsProvider-bc94590f.mjs → DefaultThreeDsProvider-5bbd9bcd.mjs} +1 -1
- package/dist/sdk/{EcentricThreeDsProvider-b4e83ddb.mjs → EcentricThreeDsProvider-bed332f9.mjs} +2 -2
- package/dist/sdk/{EpnaThreeDsProvider-ae87f6a8.mjs → EpnaThreeDsProvider-c1f5c9fa.mjs} +3 -3
- package/dist/sdk/{FlashBancThreeDsProvider-1605038d.mjs → FlashBancThreeDsProvider-9d5b3ff3.mjs} +3 -3
- package/dist/sdk/{GPaymentsThreeDsProvider-c32e2ce2.mjs → GPaymentsThreeDsProvider-16dc92e6.mjs} +2 -2
- package/dist/sdk/{MetricsGlobalThreeDsProvider-4a1a277b.mjs → MetricsGlobalThreeDsProvider-7d0227b3.mjs} +2 -2
- package/dist/sdk/{NmiThreeDsProvider-c7eee818.mjs → NmiThreeDsProvider-8ce84e51.mjs} +3 -3
- package/dist/sdk/{NuveiThreeDsProvider-92ec0af3.mjs → NuveiThreeDsProvider-82d61208.mjs} +2 -2
- package/dist/sdk/{PayGLocalThreeDsProvider-40375fae.mjs → PayGLocalThreeDsProvider-5aff4993.mjs} +2 -2
- package/dist/sdk/{PayWayAppleButton-8ec95dcc.mjs → PayWayAppleButton-1a850092.mjs} +1 -1
- package/dist/sdk/{PayabliThreeDsProvider-4c604ca6.mjs → PayabliThreeDsProvider-0cb53366.mjs} +3 -3
- package/dist/sdk/{SkyBankThreeDsProvider-83c74ce4.mjs → SkyBankThreeDsProvider-141ecfd6.mjs} +3 -3
- package/dist/sdk/cxpay-b3193036.mjs +10 -0
- package/dist/sdk/{default-ce52738b.mjs → default-e43840e4.mjs} +2 -2
- package/dist/sdk/{ecentric-6f32c4cc.mjs → ecentric-81bae7f7.mjs} +3 -3
- package/dist/sdk/epna-749c8efd.mjs +10 -0
- package/dist/sdk/flashbanc-402a9b0a.mjs +10 -0
- package/dist/sdk/{gpayments-7527af22.mjs → gpayments-349c834c.mjs} +3 -3
- package/dist/sdk/{main-0d5d595b.mjs → main-45dd3fda.mjs} +12 -12
- package/dist/sdk/{metrics_global-441d4b91.mjs → metrics_global-1f068b80.mjs} +3 -3
- package/dist/sdk/nmi-85bcc67a.mjs +10 -0
- package/dist/sdk/{nuvei-6c9de68e.mjs → nuvei-1657def9.mjs} +3 -3
- package/dist/sdk/payabli-abb7c149.mjs +10 -0
- package/dist/sdk/payfurl.es.js +1 -1
- package/dist/sdk/payfurl.umd.js +2 -2
- package/dist/sdk/{payglocal-10b095e8.mjs → payglocal-8a34ab60.mjs} +3 -3
- package/dist/sdk/payway_rest-ece82fc0.mjs +8 -0
- package/dist/sdk/skybank-60a82bbc.mjs +10 -0
- package/package.json +1 -1
- package/dist/sdk/cxpay-4cfbabd6.mjs +0 -10
- package/dist/sdk/epna-54185dfc.mjs +0 -10
- package/dist/sdk/flashbanc-8664c8b8.mjs +0 -10
- package/dist/sdk/nmi-21be5427.mjs +0 -10
- package/dist/sdk/payabli-2128874d.mjs +0 -10
- package/dist/sdk/payway_rest-3f40376d.mjs +0 -8
- package/dist/sdk/skybank-bbf556c6.mjs +0 -10
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { MetricsGlobalThreeDsProvider as r } from "./MetricsGlobalThreeDsProvider-
|
|
2
|
-
import "./DefaultThreeDsProvider-
|
|
3
|
-
import "./main-
|
|
1
|
+
import { MetricsGlobalThreeDsProvider as r } from "./MetricsGlobalThreeDsProvider-7d0227b3.mjs";
|
|
2
|
+
import "./DefaultThreeDsProvider-5bbd9bcd.mjs";
|
|
3
|
+
import "./main-45dd3fda.mjs";
|
|
4
4
|
class i extends r {
|
|
5
5
|
getType() {
|
|
6
6
|
return "CxPay";
|
package/dist/sdk/{DefaultThreeDsProvider-bc94590f.mjs → DefaultThreeDsProvider-5bbd9bcd.mjs}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var D = Object.defineProperty;
|
|
2
2
|
var u = (n, e, s) => e in n ? D(n, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : n[e] = s;
|
|
3
3
|
var o = (n, e, s) => (u(n, typeof e != "symbol" ? e + "" : e, s), s);
|
|
4
|
-
import { d as S, r as d, o as g, a as p, c as T, b as i, e as _, C as m, u as I, p as f, f as y, _ as A, i as v, T as C, h as E, F as R } from "./main-
|
|
4
|
+
import { d as S, r as d, o as g, a as p, c as T, b as i, e as _, C as m, u as I, p as f, f as y, _ as A, i as v, T as C, h as E, F as R } from "./main-45dd3fda.mjs";
|
|
5
5
|
const P = (n) => (f("data-v-ac351494"), n = n(), y(), n), U = { class: "mask" }, $ = { class: "wrapper" }, L = { class: "container" }, b = /* @__PURE__ */ P(() => /* @__PURE__ */ i("iframe", { name: "ThreeDsChallengeIFrame" }, null, -1)), M = ["action"], w = ["value"], N = /* @__PURE__ */ S({
|
|
6
6
|
__name: "ThreeDsChallenge",
|
|
7
7
|
props: {
|
package/dist/sdk/{EcentricThreeDsProvider-b4e83ddb.mjs → EcentricThreeDsProvider-bed332f9.mjs}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var c = Object.defineProperty;
|
|
2
2
|
var h = (t, s, e) => s in t ? c(t, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[s] = e;
|
|
3
3
|
var i = (t, s, e) => (h(t, typeof s != "symbol" ? s + "" : s, e), e);
|
|
4
|
-
import { DefaultThreeDsProvider as d } from "./DefaultThreeDsProvider-
|
|
5
|
-
import { d as p, r as u, o as _, a as D, c as m, b as r, e as g, C as S, u as y, p as f, f as T, _ as v, h as C } from "./main-
|
|
4
|
+
import { DefaultThreeDsProvider as d } from "./DefaultThreeDsProvider-5bbd9bcd.mjs";
|
|
5
|
+
import { d as p, r as u, o as _, a as D, c as m, b as r, e as g, C as S, u as y, p as f, f as T, _ as v, h as C } from "./main-45dd3fda.mjs";
|
|
6
6
|
const I = (t) => (f("data-v-82a75009"), t = t(), T(), t), P = { class: "mask" }, A = { class: "wrapper" }, V = { class: "container" }, E = /* @__PURE__ */ I(() => /* @__PURE__ */ r("iframe", { name: "ThreeDsChallengeIFrame" }, null, -1)), $ = ["action"], k = ["value"], x = /* @__PURE__ */ p({
|
|
7
7
|
__name: "ecentric",
|
|
8
8
|
props: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { MetricsGlobalThreeDsProvider as e } from "./MetricsGlobalThreeDsProvider-
|
|
2
|
-
import "./DefaultThreeDsProvider-
|
|
3
|
-
import "./main-
|
|
1
|
+
import { MetricsGlobalThreeDsProvider as e } from "./MetricsGlobalThreeDsProvider-7d0227b3.mjs";
|
|
2
|
+
import "./DefaultThreeDsProvider-5bbd9bcd.mjs";
|
|
3
|
+
import "./main-45dd3fda.mjs";
|
|
4
4
|
class i extends e {
|
|
5
5
|
getType() {
|
|
6
6
|
return "EPNA";
|
package/dist/sdk/{FlashBancThreeDsProvider-1605038d.mjs → FlashBancThreeDsProvider-9d5b3ff3.mjs}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { MetricsGlobalThreeDsProvider as r } from "./MetricsGlobalThreeDsProvider-
|
|
2
|
-
import "./DefaultThreeDsProvider-
|
|
3
|
-
import "./main-
|
|
1
|
+
import { MetricsGlobalThreeDsProvider as r } from "./MetricsGlobalThreeDsProvider-7d0227b3.mjs";
|
|
2
|
+
import "./DefaultThreeDsProvider-5bbd9bcd.mjs";
|
|
3
|
+
import "./main-45dd3fda.mjs";
|
|
4
4
|
class s extends r {
|
|
5
5
|
getType() {
|
|
6
6
|
return "FlashBanc";
|
package/dist/sdk/{GPaymentsThreeDsProvider-c32e2ce2.mjs → GPaymentsThreeDsProvider-16dc92e6.mjs}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var i = Object.defineProperty;
|
|
2
2
|
var l = (n, r, e) => r in n ? i(n, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[r] = e;
|
|
3
3
|
var o = (n, r, e) => (l(n, typeof r != "symbol" ? r + "" : r, e), e);
|
|
4
|
-
import { DefaultThreeDsProvider as c } from "./DefaultThreeDsProvider-
|
|
5
|
-
import { d as u, a as d, c as p, b as a, n as h, _, h as g } from "./main-
|
|
4
|
+
import { DefaultThreeDsProvider as c } from "./DefaultThreeDsProvider-5bbd9bcd.mjs";
|
|
5
|
+
import { d as u, a as d, c as p, b as a, n as h, _, h as g } from "./main-45dd3fda.mjs";
|
|
6
6
|
const m = { class: "mask" }, D = { class: "wrapper" }, S = ["src"], y = /* @__PURE__ */ u({
|
|
7
7
|
__name: "GPayments",
|
|
8
8
|
props: {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var S = Object.defineProperty;
|
|
2
2
|
var w = (o, n, t) => n in o ? S(o, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[n] = t;
|
|
3
3
|
var l = (o, n, t) => (w(o, typeof n != "symbol" ? n + "" : n, t), t);
|
|
4
|
-
import { DefaultThreeDsProvider as P } from "./DefaultThreeDsProvider-
|
|
5
|
-
import { d as f, r as v, o as E, j as A, w as b, v as T, a as I, c as x, b as p, e as G, C as L, p as N, f as M, _ as $, i as H, s as g, h as k } from "./main-
|
|
4
|
+
import { DefaultThreeDsProvider as P } from "./DefaultThreeDsProvider-5bbd9bcd.mjs";
|
|
5
|
+
import { d as f, r as v, o as E, j as A, w as b, v as T, a as I, c as x, b as p, e as G, C as L, p as N, f as M, _ as $, i as H, s as g, h as k } from "./main-45dd3fda.mjs";
|
|
6
6
|
const O = (o) => (N("data-v-8a0b6dcb"), o = o(), M(), o), j = { class: "mask" }, B = { class: "wrapper" }, F = { class: "container" }, U = /* @__PURE__ */ O(() => /* @__PURE__ */ p("div", { id: "ThreeDsChallengeIFrame" }, null, -1)), W = /* @__PURE__ */ f({
|
|
7
7
|
__name: "MetricsGlobalThreeDsChallenge",
|
|
8
8
|
emits: ["close", "submit"],
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { MetricsGlobalThreeDsProvider as e } from "./MetricsGlobalThreeDsProvider-
|
|
2
|
-
import "./DefaultThreeDsProvider-
|
|
3
|
-
import "./main-
|
|
1
|
+
import { MetricsGlobalThreeDsProvider as e } from "./MetricsGlobalThreeDsProvider-7d0227b3.mjs";
|
|
2
|
+
import "./DefaultThreeDsProvider-5bbd9bcd.mjs";
|
|
3
|
+
import "./main-45dd3fda.mjs";
|
|
4
4
|
class m extends e {
|
|
5
5
|
getType() {
|
|
6
6
|
return "NMI";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var d = Object.defineProperty;
|
|
2
2
|
var p = (n, r, t) => r in n ? d(n, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[r] = t;
|
|
3
3
|
var l = (n, r, t) => (p(n, typeof r != "symbol" ? r + "" : r, t), t);
|
|
4
|
-
import { d as m, i as u, o as g, a as D, c as S, p as _, f, b as h, _ as y, s as P, h as T } from "./main-
|
|
5
|
-
import { DefaultThreeDsProvider as I, THREE_DS_METHOD_INVOCATION_COMPLETE as N, THREE_DS_CHALLENGE_COMPLETE as C } from "./DefaultThreeDsProvider-
|
|
4
|
+
import { d as m, i as u, o as g, a as D, c as S, p as _, f, b as h, _ as y, s as P, h as T } from "./main-45dd3fda.mjs";
|
|
5
|
+
import { DefaultThreeDsProvider as I, THREE_DS_METHOD_INVOCATION_COMPLETE as N, THREE_DS_CHALLENGE_COMPLETE as C } from "./DefaultThreeDsProvider-5bbd9bcd.mjs";
|
|
6
6
|
const b = (n) => (_("data-v-3b52be97"), n = n(), f(), n), v = { class: "mask" }, E = /* @__PURE__ */ b(() => /* @__PURE__ */ h("div", { class: "wrapper" }, [
|
|
7
7
|
/* @__PURE__ */ h("div", { class: "container" })
|
|
8
8
|
], -1)), x = [
|
package/dist/sdk/{PayGLocalThreeDsProvider-40375fae.mjs → PayGLocalThreeDsProvider-5aff4993.mjs}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DefaultThreeDsProvider as y } from "./DefaultThreeDsProvider-
|
|
2
|
-
import { r as c, o as p, j as _, I as P, d as T, k as C, a as w, c as E, b as g, _ as L, s as l, h as I } from "./main-
|
|
1
|
+
import { DefaultThreeDsProvider as y } from "./DefaultThreeDsProvider-5bbd9bcd.mjs";
|
|
2
|
+
import { r as c, o as p, j as _, I as P, d as T, k as C, a as w, c as E, b as g, _ as L, s as l, h as I } from "./main-45dd3fda.mjs";
|
|
3
3
|
const h = c(!1);
|
|
4
4
|
function S(o, ...e) {
|
|
5
5
|
h.value && console.log(o, e);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var g = Object.defineProperty;
|
|
2
2
|
var A = (a, t, i) => t in a ? g(a, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : a[t] = i;
|
|
3
3
|
var s = (a, t, i) => (A(a, typeof t != "symbol" ? t + "" : t, i), i);
|
|
4
|
-
import { R as b, g as C, H as P } from "./main-
|
|
4
|
+
import { R as b, g as C, H as P } from "./main-45dd3fda.mjs";
|
|
5
5
|
const h = {
|
|
6
6
|
CHECKOUT: "CHECKOUT",
|
|
7
7
|
CHARGE: "CHARGE"
|
package/dist/sdk/{PayabliThreeDsProvider-4c604ca6.mjs → PayabliThreeDsProvider-0cb53366.mjs}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { MetricsGlobalThreeDsProvider as e } from "./MetricsGlobalThreeDsProvider-
|
|
2
|
-
import "./DefaultThreeDsProvider-
|
|
3
|
-
import "./main-
|
|
1
|
+
import { MetricsGlobalThreeDsProvider as e } from "./MetricsGlobalThreeDsProvider-7d0227b3.mjs";
|
|
2
|
+
import "./DefaultThreeDsProvider-5bbd9bcd.mjs";
|
|
3
|
+
import "./main-45dd3fda.mjs";
|
|
4
4
|
class i extends e {
|
|
5
5
|
getType() {
|
|
6
6
|
return "Payabli";
|
package/dist/sdk/{SkyBankThreeDsProvider-83c74ce4.mjs → SkyBankThreeDsProvider-141ecfd6.mjs}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { MetricsGlobalThreeDsProvider as e } from "./MetricsGlobalThreeDsProvider-
|
|
2
|
-
import "./DefaultThreeDsProvider-
|
|
3
|
-
import "./main-
|
|
1
|
+
import { MetricsGlobalThreeDsProvider as e } from "./MetricsGlobalThreeDsProvider-7d0227b3.mjs";
|
|
2
|
+
import "./DefaultThreeDsProvider-5bbd9bcd.mjs";
|
|
3
|
+
import "./main-45dd3fda.mjs";
|
|
4
4
|
class s extends e {
|
|
5
5
|
getType() {
|
|
6
6
|
return "SkyBank";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CxPayThreeDsProvider as e } from "./CxPayThreeDsProvider-02e1c15d.mjs";
|
|
2
|
+
import "./MetricsGlobalThreeDsProvider-7d0227b3.mjs";
|
|
3
|
+
import "./DefaultThreeDsProvider-5bbd9bcd.mjs";
|
|
4
|
+
import "./main-45dd3fda.mjs";
|
|
5
|
+
function n(r, o, t) {
|
|
6
|
+
return new e(r, o, t);
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
n as default
|
|
10
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DefaultThreeDsProvider as o } from "./DefaultThreeDsProvider-
|
|
2
|
-
import "./main-
|
|
1
|
+
import { DefaultThreeDsProvider as o } from "./DefaultThreeDsProvider-5bbd9bcd.mjs";
|
|
2
|
+
import "./main-45dd3fda.mjs";
|
|
3
3
|
function a(e, r, t) {
|
|
4
4
|
return new o(e, r, t);
|
|
5
5
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { EcentricThreeDsProvider as i } from "./EcentricThreeDsProvider-
|
|
2
|
-
import "./DefaultThreeDsProvider-
|
|
3
|
-
import "./main-
|
|
1
|
+
import { EcentricThreeDsProvider as i } from "./EcentricThreeDsProvider-bed332f9.mjs";
|
|
2
|
+
import "./DefaultThreeDsProvider-5bbd9bcd.mjs";
|
|
3
|
+
import "./main-45dd3fda.mjs";
|
|
4
4
|
function m(r, e, t) {
|
|
5
5
|
return new i(r, e, t);
|
|
6
6
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { EpnaThreeDsProvider as t } from "./EpnaThreeDsProvider-c1f5c9fa.mjs";
|
|
2
|
+
import "./MetricsGlobalThreeDsProvider-7d0227b3.mjs";
|
|
3
|
+
import "./DefaultThreeDsProvider-5bbd9bcd.mjs";
|
|
4
|
+
import "./main-45dd3fda.mjs";
|
|
5
|
+
function a(r, e, o) {
|
|
6
|
+
return new t(r, e, o);
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
a as default
|
|
10
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FlashBancThreeDsProvider as e } from "./FlashBancThreeDsProvider-9d5b3ff3.mjs";
|
|
2
|
+
import "./MetricsGlobalThreeDsProvider-7d0227b3.mjs";
|
|
3
|
+
import "./DefaultThreeDsProvider-5bbd9bcd.mjs";
|
|
4
|
+
import "./main-45dd3fda.mjs";
|
|
5
|
+
function p(r, o, t) {
|
|
6
|
+
return new e(r, o, t);
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
p as default
|
|
10
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { GPaymentsThreeDsProvider as o } from "./GPaymentsThreeDsProvider-
|
|
2
|
-
import "./DefaultThreeDsProvider-
|
|
3
|
-
import "./main-
|
|
1
|
+
import { GPaymentsThreeDsProvider as o } from "./GPaymentsThreeDsProvider-16dc92e6.mjs";
|
|
2
|
+
import "./DefaultThreeDsProvider-5bbd9bcd.mjs";
|
|
3
|
+
import "./main-45dd3fda.mjs";
|
|
4
4
|
function p(r, e, t) {
|
|
5
5
|
return new o(r, e, t);
|
|
6
6
|
}
|
|
@@ -39,23 +39,23 @@ const il = {
|
|
|
39
39
|
errorUrl: "https://y2it4xhgpx5junghaf3psg7a7q0splje.lambda-url.ap-southeast-2.on.aws"
|
|
40
40
|
}, nl = {
|
|
41
41
|
baseUrl: "https://assets.payfurl.com",
|
|
42
|
-
cssUrl: "https://assets.payfurl.com/v4.6.
|
|
43
|
-
url: "https://assets.payfurl.com/v4.6.
|
|
44
|
-
redirectUrl: "https://assets.payfurl.com/v4.6.
|
|
42
|
+
cssUrl: "https://assets.payfurl.com/v4.6.17/js/",
|
|
43
|
+
url: "https://assets.payfurl.com/v4.6.17/iframe/index.html",
|
|
44
|
+
redirectUrl: "https://assets.payfurl.com/v4.6.17/checkout/redirect.html",
|
|
45
45
|
apiUrl: "https://develop-api.payfurl.com",
|
|
46
46
|
errorUrl: "https://y2it4xhgpx5junghaf3psg7a7q0splje.lambda-url.ap-southeast-2.on.aws"
|
|
47
47
|
}, ol = {
|
|
48
48
|
baseUrl: "https://assets.payfurl.com",
|
|
49
|
-
cssUrl: "https://assets.payfurl.com/v4.6.
|
|
50
|
-
url: "https://assets.payfurl.com/v4.6.
|
|
51
|
-
redirectUrl: "https://assets.payfurl.com/v4.6.
|
|
49
|
+
cssUrl: "https://assets.payfurl.com/v4.6.17/js/",
|
|
50
|
+
url: "https://assets.payfurl.com/v4.6.17/iframe/index.html",
|
|
51
|
+
redirectUrl: "https://assets.payfurl.com/v4.6.17/checkout/redirect.html",
|
|
52
52
|
apiUrl: "https://sandbox-api.payfurl.com",
|
|
53
53
|
errorUrl: "https://gujl7xo5fhpkjaain4swyiymt40loyia.lambda-url.ap-southeast-2.on.aws"
|
|
54
54
|
}, al = {
|
|
55
55
|
baseUrl: "https://assets.payfurl.com",
|
|
56
|
-
cssUrl: "https://assets.payfurl.com/v4.6.
|
|
57
|
-
url: "https://assets.payfurl.com/v4.6.
|
|
58
|
-
redirectUrl: "https://assets.payfurl.com/v4.6.
|
|
56
|
+
cssUrl: "https://assets.payfurl.com/v4.6.17/js/",
|
|
57
|
+
url: "https://assets.payfurl.com/v4.6.17/iframe/index.html",
|
|
58
|
+
redirectUrl: "https://assets.payfurl.com/v4.6.17/checkout/redirect.html",
|
|
59
59
|
apiUrl: "https://api.payfurl.com",
|
|
60
60
|
errorUrl: "https://4rvkh6tupgcmqk3b2igkpdi2zi0mveyg.lambda-url.ap-southeast-2.on.aws"
|
|
61
61
|
};
|
|
@@ -7987,7 +7987,7 @@ I([
|
|
|
7987
7987
|
I([
|
|
7988
7988
|
A
|
|
7989
7989
|
], Ot.prototype, "getMessageHandler", null);
|
|
7990
|
-
const uf = "@payfurl/client", df = "4.6.
|
|
7990
|
+
const uf = "@payfurl/client", df = "4.6.17", hf = [
|
|
7991
7991
|
"dist/sdk"
|
|
7992
7992
|
], pf = "./dist/sdk/payfurl.umd.js", ff = "./dist/sdk/payfurl.es.js", gf = "./dist/sdk/payfurl.d.ts", mf = {
|
|
7993
7993
|
".": {
|
|
@@ -8678,7 +8678,7 @@ class ir {
|
|
|
8678
8678
|
})
|
|
8679
8679
|
}), this.billingAddress && ((u = this.applePayButton) == null || u.setBillingAddress(this.billingAddress)), this.customer && ((d = this.applePayButton) == null || d.setCustomerInfo(this.customer)), this.order && ((h = this.applePayButton) == null || h.setOrderInfo(this.order)), (p = this.applePayButton) == null || p.draw(), window.postMessage({ status: Pr }, "*");
|
|
8680
8680
|
});
|
|
8681
|
-
Fi(/* @__PURE__ */ Object.assign({ "./applepay/ApplePayButton.interface.ts": () => import("./ThreeDsProvider.interface-370c3a6b.mjs").then((l) => l.A), "./applepay/ApplePayButtonOptions.type.ts": () => import("./ThreeDsProvider.interface-370c3a6b.mjs").then((l) => l.a), "./applepay/PayWayAppleButton.ts": () => import("./PayWayAppleButton-
|
|
8681
|
+
Fi(/* @__PURE__ */ Object.assign({ "./applepay/ApplePayButton.interface.ts": () => import("./ThreeDsProvider.interface-370c3a6b.mjs").then((l) => l.A), "./applepay/ApplePayButtonOptions.type.ts": () => import("./ThreeDsProvider.interface-370c3a6b.mjs").then((l) => l.a), "./applepay/PayWayAppleButton.ts": () => import("./PayWayAppleButton-1a850092.mjs"), "./applepay/payway_rest.ts": () => import("./payway_rest-ece82fc0.mjs") }), `./applepay/${n.providerType.toLowerCase()}.ts`).then(N(this, "[localAddApplePay], then", (l) => {
|
|
8682
8682
|
this.log(`Loading ${n.providerType}...`, l), c(l);
|
|
8683
8683
|
})).catch(() => {
|
|
8684
8684
|
this.log(`Error loading ${n.providerType}`), a();
|
|
@@ -10714,7 +10714,7 @@ class q {
|
|
|
10714
10714
|
}));
|
|
10715
10715
|
}
|
|
10716
10716
|
add3DsProcessor(r, t, s, i, n, o, a) {
|
|
10717
|
-
this.log("[add3DsProcessor]", t, s), Fi(/* @__PURE__ */ Object.assign({ "./3ds/CxPayThreeDsProvider.ts": () => import("./CxPayThreeDsProvider-
|
|
10717
|
+
this.log("[add3DsProcessor]", t, s), Fi(/* @__PURE__ */ Object.assign({ "./3ds/CxPayThreeDsProvider.ts": () => import("./CxPayThreeDsProvider-02e1c15d.mjs"), "./3ds/DefaultThreeDsProvider.ts": () => import("./DefaultThreeDsProvider-5bbd9bcd.mjs"), "./3ds/EcentricThreeDsProvider.ts": () => import("./EcentricThreeDsProvider-bed332f9.mjs"), "./3ds/EpnaThreeDsProvider.ts": () => import("./EpnaThreeDsProvider-c1f5c9fa.mjs"), "./3ds/FlashBancThreeDsProvider.ts": () => import("./FlashBancThreeDsProvider-9d5b3ff3.mjs"), "./3ds/GPaymentsThreeDsProvider.ts": () => import("./GPaymentsThreeDsProvider-16dc92e6.mjs"), "./3ds/MetricsGlobalThreeDsProvider.ts": () => import("./MetricsGlobalThreeDsProvider-7d0227b3.mjs"), "./3ds/NmiThreeDsProvider.ts": () => import("./NmiThreeDsProvider-8ce84e51.mjs"), "./3ds/NuveiThreeDsProvider.ts": () => import("./NuveiThreeDsProvider-82d61208.mjs"), "./3ds/PayGLocalThreeDsProvider.ts": () => import("./PayGLocalThreeDsProvider-5aff4993.mjs"), "./3ds/PayabliThreeDsProvider.ts": () => import("./PayabliThreeDsProvider-0cb53366.mjs"), "./3ds/SkyBankThreeDsProvider.ts": () => import("./SkyBankThreeDsProvider-141ecfd6.mjs"), "./3ds/ThreeDsAuthResponse.type.ts": () => import("./ThreeDsProvider.interface-370c3a6b.mjs").then((c) => c.T), "./3ds/ThreeDsInitResponse.type.ts": () => import("./ThreeDsProvider.interface-370c3a6b.mjs").then((c) => c.c), "./3ds/ThreeDsPostAuthResponse.type.ts": () => import("./ThreeDsPostAuthResponse.type-3091950f.mjs"), "./3ds/ThreeDsProvider.interface.ts": () => import("./ThreeDsProvider.interface-370c3a6b.mjs").then((c) => c.d), "./3ds/cxpay.ts": () => import("./cxpay-b3193036.mjs"), "./3ds/default.ts": () => import("./default-e43840e4.mjs"), "./3ds/ecentric.ts": () => import("./ecentric-81bae7f7.mjs"), "./3ds/epna.ts": () => import("./epna-749c8efd.mjs"), "./3ds/flashbanc.ts": () => import("./flashbanc-402a9b0a.mjs"), "./3ds/gpayments.ts": () => import("./gpayments-349c834c.mjs"), "./3ds/metrics_global.ts": () => import("./metrics_global-1f068b80.mjs"), "./3ds/nmi.ts": () => import("./nmi-85bcc67a.mjs"), "./3ds/nuvei.ts": () => import("./nuvei-1657def9.mjs"), "./3ds/payabli.ts": () => import("./payabli-abb7c149.mjs"), "./3ds/payglocal.ts": () => import("./payglocal-8a34ab60.mjs"), "./3ds/skybank.ts": () => import("./skybank-60a82bbc.mjs") }), `./3ds/${s.toLowerCase()}.ts`).then(N(this, "[add3DsProcessor], onload", (c) => {
|
|
10718
10718
|
var u;
|
|
10719
10719
|
this.log(`Loading ${s}...`, c);
|
|
10720
10720
|
const l = c.default(this.log.bind(this), r, {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { MetricsGlobalThreeDsProvider as t } from "./MetricsGlobalThreeDsProvider-
|
|
2
|
-
import "./DefaultThreeDsProvider-
|
|
3
|
-
import "./main-
|
|
1
|
+
import { MetricsGlobalThreeDsProvider as t } from "./MetricsGlobalThreeDsProvider-7d0227b3.mjs";
|
|
2
|
+
import "./DefaultThreeDsProvider-5bbd9bcd.mjs";
|
|
3
|
+
import "./main-45dd3fda.mjs";
|
|
4
4
|
function a(r, e, o) {
|
|
5
5
|
return new t(r, e, o);
|
|
6
6
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { NmiThreeDsProvider as t } from "./NmiThreeDsProvider-8ce84e51.mjs";
|
|
2
|
+
import "./MetricsGlobalThreeDsProvider-7d0227b3.mjs";
|
|
3
|
+
import "./DefaultThreeDsProvider-5bbd9bcd.mjs";
|
|
4
|
+
import "./main-45dd3fda.mjs";
|
|
5
|
+
function f(r, i, o) {
|
|
6
|
+
return new t(r, i, o);
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
f as default
|
|
10
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { NuveiThreeDsProvider as o } from "./NuveiThreeDsProvider-
|
|
2
|
-
import "./main-
|
|
3
|
-
import "./DefaultThreeDsProvider-
|
|
1
|
+
import { NuveiThreeDsProvider as o } from "./NuveiThreeDsProvider-82d61208.mjs";
|
|
2
|
+
import "./main-45dd3fda.mjs";
|
|
3
|
+
import "./DefaultThreeDsProvider-5bbd9bcd.mjs";
|
|
4
4
|
function m(r, e, i) {
|
|
5
5
|
return new o(r, e, i);
|
|
6
6
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { PayabliThreeDsProvider as t } from "./PayabliThreeDsProvider-0cb53366.mjs";
|
|
2
|
+
import "./MetricsGlobalThreeDsProvider-7d0227b3.mjs";
|
|
3
|
+
import "./DefaultThreeDsProvider-5bbd9bcd.mjs";
|
|
4
|
+
import "./main-45dd3fda.mjs";
|
|
5
|
+
function n(r, i, o) {
|
|
6
|
+
return new t(r, i, o);
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
n as default
|
|
10
|
+
};
|
package/dist/sdk/payfurl.es.js
CHANGED
package/dist/sdk/payfurl.umd.js
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
12
12
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
13
13
|
PERFORMANCE OF THIS SOFTWARE.
|
|
14
|
-
***************************************************************************** */function I(e,r,t,s){var i=arguments.length,n=i<3?r:s===null?s=Object.getOwnPropertyDescriptor(r,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,r,t,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(n=(i<3?o(n):i>3?o(r,t,n):o(r,t))||n);return i>3&&n&&Object.defineProperty(r,t,n),n}const lr={baseUrl:"",cssUrl:"",redirectUrl:"",url:"",apiUrl:"",errorUrl:"https://y2it4xhgpx5junghaf3psg7a7q0splje.lambda-url.ap-southeast-2.on.aws"},Sl={baseUrl:"https://assets.payfurl.com",cssUrl:"https://assets.payfurl.com/v4.6.16/js/",url:"https://assets.payfurl.com/v4.6.16/iframe/index.html",redirectUrl:"https://assets.payfurl.com/v4.6.16/checkout/redirect.html",apiUrl:"https://develop-api.payfurl.com",errorUrl:"https://y2it4xhgpx5junghaf3psg7a7q0splje.lambda-url.ap-southeast-2.on.aws"},kl={baseUrl:"https://assets.payfurl.com",cssUrl:"https://assets.payfurl.com/v4.6.16/js/",url:"https://assets.payfurl.com/v4.6.16/iframe/index.html",redirectUrl:"https://assets.payfurl.com/v4.6.16/checkout/redirect.html",apiUrl:"https://sandbox-api.payfurl.com",errorUrl:"https://gujl7xo5fhpkjaain4swyiymt40loyia.lambda-url.ap-southeast-2.on.aws"},Ol={baseUrl:"https://assets.payfurl.com",cssUrl:"https://assets.payfurl.com/v4.6.16/js/",url:"https://assets.payfurl.com/v4.6.16/iframe/index.html",redirectUrl:"https://assets.payfurl.com/v4.6.16/checkout/redirect.html",apiUrl:"https://api.payfurl.com",errorUrl:"https://4rvkh6tupgcmqk3b2igkpdi2zi0mveyg.lambda-url.ap-southeast-2.on.aws"};var $e;(function(e){e.LOCAL="local",e.DEVELOPMENT="development",e.SANDBOX="sandbox",e.PRODUCTION="production"})($e||($e={}));const ji={[$e.LOCAL]:lr,[$e.DEVELOPMENT]:Sl,[$e.SANDBOX]:kl,[$e.PRODUCTION]:Ol};function Xn(e){return ji[e]}function Ll(e){let r=ji[e];return r||(r=ji[$e.PRODUCTION]),r.errorUrl}class ht{constructor(r,t,s){g(this,"publicKey","");g(this,"version","");g(this,"regionResolver",null);this.publicKey=r||"",this.version=t||"",this.regionResolver=s||null}invoke(r,t,s,i,n,o){const a=new XMLHttpRequest;a||n==null||n(0,""),a.onreadystatechange=function(){if(a.readyState===XMLHttpRequest.DONE){if(a.status===200||a.status===201){i==null||i(a.status,a.responseText);return}n==null||n(a.status,a.responseText)}};const c=new URL(r);if(this.regionResolver){const l=new URL(this.regionResolver.getRegionUrl());c.hostname=l.hostname}if(a.open(t,c.toString()),a.setRequestHeader("Content-Type","application/json"),this.publicKey&&a.setRequestHeader("x-publickey",this.publicKey),this.version&&a.setRequestHeader("sdk-version",this.version),o)for(const[l,u]of Object.entries(o))a.setRequestHeader(l,u);a.send(String(s))}}const Ut=class Ut{constructor(){g(this,"httpInvoker",null);if(Ut.instance)return Ut.instance;this.httpInvoker=new ht,Ut.instance=this}static init(r){return Ut.environment=r,new Ut}sendError(r,t,s){var n;const i=Ll(Ut.environment);(n=this.httpInvoker)==null||n.invoke(i,"POST",JSON.stringify({method:r,message:t,arguments:Object.values(s).map(o=>typeof o=="object"?JSON.stringify(o):String(o))}))}};g(Ut,"instance"),g(Ut,"environment");let qr=Ut;function C(e,r,t){const s=t.value;t.value=function(){try{return s.apply(this,arguments)}catch(i){throw new qr().sendError(r,i.message,Jn(Array.from(arguments))),console.warn("[ErrorHandled], exception",{error:i,target:e,propertyKey:r,arguments}),i}}}function D(e,r,t){return function(...s){try{return t.apply(e,s)}catch(i){throw new qr().sendError(r,i.message,Jn(s)),console.warn("[ErrorHandledFunction], exception",{error:i,funcName:r,args:s}),i}}}function Jn(e){return e.map(r=>xi(r))}function xi(e){if(typeof e!="object"||e===null)return typeof e=="string"&&e.replace(/\s/g,"").search(/^[0-9]{8,19}$/)!==-1?"**** **** **** "+e.replace(/\s/g,"").slice(-4):typeof e=="string"&&e.replace(/\s/g,"").search(/^[0-9]{3,4}$/)!==-1?"***":e;if(Array.isArray(e))return e.map(t=>xi(t));const r={};for(const t in e)e.hasOwnProperty&&e.hasOwnProperty(t)&&typeof e[t]!="function"&&!(e[t]instanceof Node)&&e.constructor!==Object&&(r[t]=xi(e[t]),t==="cardNumber"?r[t]="**** **** **** "+r[t].replace(" ","").slice(-4):t==="ccv"&&(r[t]="***"));return r}function jr(e,r){const t=Object.create(null),s=e.split(",");for(let i=0;i<s.length;i++)t[s[i]]=!0;return r?i=>!!t[i.toLowerCase()]:i=>!!t[i]}function lt(e){if(J(e)){const r={};for(let t=0;t<e.length;t++){const s=e[t],i=Ee(s)?Rl(s):lt(s);if(i)for(const n in i)r[n]=i[n]}return r}else{if(Ee(e))return e;if(Ie(e))return e}}const jl=/;(?![^(]*\))/g,xl=/:([^]+)/,Ul=/\/\*.*?\*\//gs;function Rl(e){const r={};return e.replace(Ul,"").split(jl).forEach(t=>{if(t){const s=t.split(xl);s.length>1&&(r[s[0].trim()]=s[1].trim())}}),r}function es(e){let r="";if(Ee(e))r=e;else if(J(e))for(let t=0;t<e.length;t++){const s=es(e[t]);s&&(r+=s+" ")}else if(Ie(e))for(const t in e)e[t]&&(r+=t+" ");return r.trim()}const zl=jr("itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly");function qn(e){return!!e||e===""}function Fl(e,r){if(e.length!==r.length)return!1;let t=!0;for(let s=0;t&&s<e.length;s++)t=Es(e[s],r[s]);return t}function Es(e,r){if(e===r)return!0;let t=ro(e),s=ro(r);if(t||s)return t&&s?e.getTime()===r.getTime():!1;if(t=rs(e),s=rs(r),t||s)return e===r;if(t=J(e),s=J(r),t||s)return t&&s?Fl(e,r):!1;if(t=Ie(e),s=Ie(r),t||s){if(!t||!s)return!1;const i=Object.keys(e).length,n=Object.keys(r).length;if(i!==n)return!1;for(const o in e){const a=e.hasOwnProperty(o),c=r.hasOwnProperty(o);if(a&&!c||!a&&c||!Es(e[o],r[o]))return!1}}return String(e)===String(r)}function Vl(e,r){return e.findIndex(t=>Es(t,r))}const He=e=>Ee(e)?e:e==null?"":J(e)||Ie(e)&&(e.toString===so||!ne(e.toString))?JSON.stringify(e,eo,2):String(e),eo=(e,r)=>r&&r.__v_isRef?eo(e,r.value):cr(r)?{[`Map(${r.size})`]:[...r.entries()].reduce((t,[s,i])=>(t[`${s} =>`]=i,t),{})}:ks(r)?{[`Set(${r.size})`]:[...r.values()]}:Ie(r)&&!J(r)&&!io(r)?String(r):r,Ce={}.NODE_ENV!=="production"?Object.freeze({}):{},xr={}.NODE_ENV!=="production"?Object.freeze([]):[],Ge=()=>{},to=()=>!1,$l=/^on[^a-z]/,ts=e=>$l.test(e),Ss=e=>e.startsWith("onUpdate:"),Oe=Object.assign,Ui=(e,r)=>{const t=e.indexOf(r);t>-1&&e.splice(t,1)},Hl=Object.prototype.hasOwnProperty,pe=(e,r)=>Hl.call(e,r),J=Array.isArray,cr=e=>ss(e)==="[object Map]",ks=e=>ss(e)==="[object Set]",ro=e=>ss(e)==="[object Date]",ne=e=>typeof e=="function",Ee=e=>typeof e=="string",rs=e=>typeof e=="symbol",Ie=e=>e!==null&&typeof e=="object",Ri=e=>Ie(e)&&ne(e.then)&&ne(e.catch),so=Object.prototype.toString,ss=e=>so.call(e),zi=e=>ss(e).slice(8,-1),io=e=>ss(e)==="[object Object]",Fi=e=>Ee(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Os=jr(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Gl=jr("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"),Ls=e=>{const r=Object.create(null);return t=>r[t]||(r[t]=e(t))},Yl=/-(\w)/g,bt=Ls(e=>e.replace(Yl,(r,t)=>t?t.toUpperCase():"")),Kl=/\B([A-Z])/g,Zt=Ls(e=>e.replace(Kl,"-$1").toLowerCase()),ur=Ls(e=>e.charAt(0).toUpperCase()+e.slice(1)),dr=Ls(e=>e?`on${ur(e)}`:""),is=(e,r)=>!Object.is(e,r),Ur=(e,r)=>{for(let t=0;t<e.length;t++)e[t](r)},js=(e,r,t)=>{Object.defineProperty(e,r,{configurable:!0,enumerable:!1,value:t})},xs=e=>{const r=parseFloat(e);return isNaN(r)?e:r};let no;const oo=()=>no||(no=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Vi(e,...r){console.warn(`[Vue warn] ${e}`,...r)}let yt;class Bl{constructor(r=!1){this.detached=r,this._active=!0,this.effects=[],this.cleanups=[],this.parent=yt,!r&&yt&&(this.index=(yt.scopes||(yt.scopes=[])).push(this)-1)}get active(){return this._active}run(r){if(this._active){const t=yt;try{return yt=this,r()}finally{yt=t}}else({}).NODE_ENV!=="production"&&Vi("cannot run an inactive effect scope.")}on(){yt=this}off(){yt=this.parent}stop(r){if(this._active){let t,s;for(t=0,s=this.effects.length;t<s;t++)this.effects[t].stop();for(t=0,s=this.cleanups.length;t<s;t++)this.cleanups[t]();if(this.scopes)for(t=0,s=this.scopes.length;t<s;t++)this.scopes[t].stop(!0);if(!this.detached&&this.parent&&!r){const i=this.parent.scopes.pop();i&&i!==this&&(this.parent.scopes[this.index]=i,i.index=this.index)}this.parent=void 0,this._active=!1}}}function Wl(e,r=yt){r&&r.active&&r.effects.push(e)}function Zl(){return yt}const ns=e=>{const r=new Set(e);return r.w=0,r.n=0,r},ao=e=>(e.w&Qt)>0,lo=e=>(e.n&Qt)>0,Ql=({deps:e})=>{if(e.length)for(let r=0;r<e.length;r++)e[r].w|=Qt},Xl=e=>{const{deps:r}=e;if(r.length){let t=0;for(let s=0;s<r.length;s++){const i=r[s];ao(i)&&!lo(i)?i.delete(e):r[t++]=i,i.w&=~Qt,i.n&=~Qt}r.length=t}},$i=new WeakMap;let os=0,Qt=1;const Hi=30;let Ze;const hr=Symbol({}.NODE_ENV!=="production"?"iterate":""),Gi=Symbol({}.NODE_ENV!=="production"?"Map key iterate":"");class Yi{constructor(r,t=null,s){this.fn=r,this.scheduler=t,this.active=!0,this.deps=[],this.parent=void 0,Wl(this,s)}run(){if(!this.active)return this.fn();let r=Ze,t=Xt;for(;r;){if(r===this)return;r=r.parent}try{return this.parent=Ze,Ze=this,Xt=!0,Qt=1<<++os,os<=Hi?Ql(this):co(this),this.fn()}finally{os<=Hi&&Xl(this),Qt=1<<--os,Ze=this.parent,Xt=t,this.parent=void 0,this.deferStop&&this.stop()}}stop(){Ze===this?this.deferStop=!0:this.active&&(co(this),this.onStop&&this.onStop(),this.active=!1)}}function co(e){const{deps:r}=e;if(r.length){for(let t=0;t<r.length;t++)r[t].delete(e);r.length=0}}let Xt=!0;const uo=[];function pr(){uo.push(Xt),Xt=!1}function gr(){const e=uo.pop();Xt=e===void 0?!0:e}function Qe(e,r,t){if(Xt&&Ze){let s=$i.get(e);s||$i.set(e,s=new Map);let i=s.get(t);i||s.set(t,i=ns());const n={}.NODE_ENV!=="production"?{effect:Ze,target:e,type:r,key:t}:void 0;Ki(i,n)}}function Ki(e,r){let t=!1;os<=Hi?lo(e)||(e.n|=Qt,t=!ao(e)):t=!e.has(Ze),t&&(e.add(Ze),Ze.deps.push(e),{}.NODE_ENV!=="production"&&Ze.onTrack&&Ze.onTrack(Object.assign({effect:Ze},r)))}function zt(e,r,t,s,i,n){const o=$i.get(e);if(!o)return;let a=[];if(r==="clear")a=[...o.values()];else if(t==="length"&&J(e)){const l=Number(s);o.forEach((u,d)=>{(d==="length"||d>=l)&&a.push(u)})}else switch(t!==void 0&&a.push(o.get(t)),r){case"add":J(e)?Fi(t)&&a.push(o.get("length")):(a.push(o.get(hr)),cr(e)&&a.push(o.get(Gi)));break;case"delete":J(e)||(a.push(o.get(hr)),cr(e)&&a.push(o.get(Gi)));break;case"set":cr(e)&&a.push(o.get(hr));break}const c={}.NODE_ENV!=="production"?{target:e,type:r,key:t,newValue:s,oldValue:i,oldTarget:n}:void 0;if(a.length===1)a[0]&&({}.NODE_ENV!=="production"?Rr(a[0],c):Rr(a[0]));else{const l=[];for(const u of a)u&&l.push(...u);({}).NODE_ENV!=="production"?Rr(ns(l),c):Rr(ns(l))}}function Rr(e,r){const t=J(e)?e:[...e];for(const s of t)s.computed&&ho(s,r);for(const s of t)s.computed||ho(s,r)}function ho(e,r){(e!==Ze||e.allowRecurse)&&({}.NODE_ENV!=="production"&&e.onTrigger&&e.onTrigger(Oe({effect:e},r)),e.scheduler?e.scheduler():e.run())}const Jl=jr("__proto__,__v_isRef,__isVue"),po=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(rs)),ql=Us(),ec=Us(!1,!0),tc=Us(!0),rc=Us(!0,!0),go=sc();function sc(){const e={};return["includes","indexOf","lastIndexOf"].forEach(r=>{e[r]=function(...t){const s=ue(this);for(let n=0,o=this.length;n<o;n++)Qe(s,"get",n+"");const i=s[r](...t);return i===-1||i===!1?s[r](...t.map(ue)):i}}),["push","pop","shift","unshift","splice"].forEach(r=>{e[r]=function(...t){pr();const s=ue(this)[r].apply(this,t);return gr(),s}}),e}function ic(e){const r=ue(this);return Qe(r,"has",e),r.hasOwnProperty(e)}function Us(e=!1,r=!1){return function(s,i,n){if(i==="__v_isReactive")return!e;if(i==="__v_isReadonly")return e;if(i==="__v_isShallow")return r;if(i==="__v_raw"&&n===(e?r?wo:Po:r?No:To).get(s))return s;const o=J(s);if(!e){if(o&&pe(go,i))return Reflect.get(go,i,n);if(i==="hasOwnProperty")return ic}const a=Reflect.get(s,i,n);return(rs(i)?po.has(i):Jl(i))||(e||Qe(s,"get",i),r)?a:xe(a)?o&&Fi(i)?a:a.value:Ie(a)?e?bo(a):Wi(a):a}}const nc=fo(),oc=fo(!0);function fo(e=!1){return function(t,s,i,n){let o=t[s];if(qt(o)&&xe(o)&&!xe(i))return!1;if(!e&&(!Ks(i)&&!qt(i)&&(o=ue(o),i=ue(i)),!J(t)&&xe(o)&&!xe(i)))return o.value=i,!0;const a=J(t)&&Fi(s)?Number(s)<t.length:pe(t,s),c=Reflect.set(t,s,i,n);return t===ue(n)&&(a?is(i,o)&&zt(t,"set",s,i,o):zt(t,"add",s,i)),c}}function ac(e,r){const t=pe(e,r),s=e[r],i=Reflect.deleteProperty(e,r);return i&&t&&zt(e,"delete",r,void 0,s),i}function lc(e,r){const t=Reflect.has(e,r);return(!rs(r)||!po.has(r))&&Qe(e,"has",r),t}function cc(e){return Qe(e,"iterate",J(e)?"length":hr),Reflect.ownKeys(e)}const mo={get:ql,set:nc,deleteProperty:ac,has:lc,ownKeys:cc},yo={get:tc,set(e,r){return{}.NODE_ENV!=="production"&&Vi(`Set operation on key "${String(r)}" failed: target is readonly.`,e),!0},deleteProperty(e,r){return{}.NODE_ENV!=="production"&&Vi(`Delete operation on key "${String(r)}" failed: target is readonly.`,e),!0}},uc=Oe({},mo,{get:ec,set:oc}),dc=Oe({},yo,{get:rc}),Bi=e=>e,Rs=e=>Reflect.getPrototypeOf(e);function zs(e,r,t=!1,s=!1){e=e.__v_raw;const i=ue(e),n=ue(r);t||(r!==n&&Qe(i,"get",r),Qe(i,"get",n));const{has:o}=Rs(i),a=s?Bi:t?Qi:as;if(o.call(i,r))return a(e.get(r));if(o.call(i,n))return a(e.get(n));e!==i&&e.get(r)}function Fs(e,r=!1){const t=this.__v_raw,s=ue(t),i=ue(e);return r||(e!==i&&Qe(s,"has",e),Qe(s,"has",i)),e===i?t.has(e):t.has(e)||t.has(i)}function Vs(e,r=!1){return e=e.__v_raw,!r&&Qe(ue(e),"iterate",hr),Reflect.get(e,"size",e)}function Io(e){e=ue(e);const r=ue(this);return Rs(r).has.call(r,e)||(r.add(e),zt(r,"add",e,e)),this}function Co(e,r){r=ue(r);const t=ue(this),{has:s,get:i}=Rs(t);let n=s.call(t,e);n?{}.NODE_ENV!=="production"&&Do(t,s,e):(e=ue(e),n=s.call(t,e));const o=i.call(t,e);return t.set(e,r),n?is(r,o)&&zt(t,"set",e,r,o):zt(t,"add",e,r),this}function Ao(e){const r=ue(this),{has:t,get:s}=Rs(r);let i=t.call(r,e);i?{}.NODE_ENV!=="production"&&Do(r,t,e):(e=ue(e),i=t.call(r,e));const n=s?s.call(r,e):void 0,o=r.delete(e);return i&&zt(r,"delete",e,void 0,n),o}function Mo(){const e=ue(this),r=e.size!==0,t={}.NODE_ENV!=="production"?cr(e)?new Map(e):new Set(e):void 0,s=e.clear();return r&&zt(e,"clear",void 0,void 0,t),s}function $s(e,r){return function(s,i){const n=this,o=n.__v_raw,a=ue(o),c=r?Bi:e?Qi:as;return!e&&Qe(a,"iterate",hr),o.forEach((l,u)=>s.call(i,c(l),c(u),n))}}function Hs(e,r,t){return function(...s){const i=this.__v_raw,n=ue(i),o=cr(n),a=e==="entries"||e===Symbol.iterator&&o,c=e==="keys"&&o,l=i[e](...s),u=t?Bi:r?Qi:as;return!r&&Qe(n,"iterate",c?Gi:hr),{next(){const{value:d,done:h}=l.next();return h?{value:d,done:h}:{value:a?[u(d[0]),u(d[1])]:u(d),done:h}},[Symbol.iterator](){return this}}}}function Jt(e){return function(...r){if({}.NODE_ENV!=="production"){const t=r[0]?`on key "${r[0]}" `:"";console.warn(`${ur(e)} operation ${t}failed: target is readonly.`,ue(this))}return e==="delete"?!1:this}}function hc(){const e={get(n){return zs(this,n)},get size(){return Vs(this)},has:Fs,add:Io,set:Co,delete:Ao,clear:Mo,forEach:$s(!1,!1)},r={get(n){return zs(this,n,!1,!0)},get size(){return Vs(this)},has:Fs,add:Io,set:Co,delete:Ao,clear:Mo,forEach:$s(!1,!0)},t={get(n){return zs(this,n,!0)},get size(){return Vs(this,!0)},has(n){return Fs.call(this,n,!0)},add:Jt("add"),set:Jt("set"),delete:Jt("delete"),clear:Jt("clear"),forEach:$s(!0,!1)},s={get(n){return zs(this,n,!0,!0)},get size(){return Vs(this,!0)},has(n){return Fs.call(this,n,!0)},add:Jt("add"),set:Jt("set"),delete:Jt("delete"),clear:Jt("clear"),forEach:$s(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(n=>{e[n]=Hs(n,!1,!1),t[n]=Hs(n,!0,!1),r[n]=Hs(n,!1,!0),s[n]=Hs(n,!0,!0)}),[e,t,r,s]}const[pc,gc,fc,mc]=hc();function Gs(e,r){const t=r?e?mc:fc:e?gc:pc;return(s,i,n)=>i==="__v_isReactive"?!e:i==="__v_isReadonly"?e:i==="__v_raw"?s:Reflect.get(pe(t,i)&&i in s?t:s,i,n)}const yc={get:Gs(!1,!1)},Ic={get:Gs(!1,!0)},Cc={get:Gs(!0,!1)},Ac={get:Gs(!0,!0)};function Do(e,r,t){const s=ue(t);if(s!==t&&r.call(e,s)){const i=zi(e);console.warn(`Reactive ${i} contains both the raw and reactive versions of the same object${i==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}const To=new WeakMap,No=new WeakMap,Po=new WeakMap,wo=new WeakMap;function Mc(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Dc(e){return e.__v_skip||!Object.isExtensible(e)?0:Mc(zi(e))}function Wi(e){return qt(e)?e:Ys(e,!1,mo,yc,To)}function Tc(e){return Ys(e,!1,uc,Ic,No)}function bo(e){return Ys(e,!0,yo,Cc,Po)}function zr(e){return Ys(e,!0,dc,Ac,wo)}function Ys(e,r,t,s,i){if(!Ie(e))return{}.NODE_ENV!=="production"&&console.warn(`value cannot be made reactive: ${String(e)}`),e;if(e.__v_raw&&!(r&&e.__v_isReactive))return e;const n=i.get(e);if(n)return n;const o=Dc(e);if(o===0)return e;const a=new Proxy(e,o===2?s:t);return i.set(e,a),a}function fr(e){return qt(e)?fr(e.__v_raw):!!(e&&e.__v_isReactive)}function qt(e){return!!(e&&e.__v_isReadonly)}function Ks(e){return!!(e&&e.__v_isShallow)}function Zi(e){return fr(e)||qt(e)}function ue(e){const r=e&&e.__v_raw;return r?ue(r):e}function vo(e){return js(e,"__v_skip",!0),e}const as=e=>Ie(e)?Wi(e):e,Qi=e=>Ie(e)?bo(e):e;function _o(e){Xt&&Ze&&(e=ue(e),{}.NODE_ENV!=="production"?Ki(e.dep||(e.dep=ns()),{target:e,type:"get",key:"value"}):Ki(e.dep||(e.dep=ns())))}function Eo(e,r){e=ue(e);const t=e.dep;t&&({}.NODE_ENV!=="production"?Rr(t,{target:e,type:"set",key:"value",newValue:r}):Rr(t))}function xe(e){return!!(e&&e.__v_isRef===!0)}function te(e){return Nc(e,!1)}function Nc(e,r){return xe(e)?e:new Pc(e,r)}class Pc{constructor(r,t){this.__v_isShallow=t,this.dep=void 0,this.__v_isRef=!0,this._rawValue=t?r:ue(r),this._value=t?r:as(r)}get value(){return _o(this),this._value}set value(r){const t=this.__v_isShallow||Ks(r)||qt(r);r=t?r:ue(r),is(r,this._rawValue)&&(this._rawValue=r,this._value=t?r:as(r),Eo(this,r))}}function me(e){return xe(e)?e.value:e}const wc={get:(e,r,t)=>me(Reflect.get(e,r,t)),set:(e,r,t,s)=>{const i=e[r];return xe(i)&&!xe(t)?(i.value=t,!0):Reflect.set(e,r,t,s)}};function So(e){return fr(e)?e:new Proxy(e,wc)}var ko;class bc{constructor(r,t,s,i){this._setter=t,this.dep=void 0,this.__v_isRef=!0,this[ko]=!1,this._dirty=!0,this.effect=new Yi(r,()=>{this._dirty||(this._dirty=!0,Eo(this))}),this.effect.computed=this,this.effect.active=this._cacheable=!i,this.__v_isReadonly=s}get value(){const r=ue(this);return _o(r),(r._dirty||!r._cacheable)&&(r._dirty=!1,r._value=r.effect.run()),r._value}set value(r){this._setter(r)}}ko="__v_isReadonly";function vc(e,r,t=!1){let s,i;const n=ne(e);n?(s=e,i={}.NODE_ENV!=="production"?()=>{console.warn("Write operation failed: computed value is readonly")}:Ge):(s=e.get,i=e.set);const o=new bc(s,i,n||!i,t);return{}.NODE_ENV!=="production"&&r&&!t&&(o.effect.onTrack=r.onTrack,o.effect.onTrigger=r.onTrigger),o}const mr=[];function Bs(e){mr.push(e)}function Ws(){mr.pop()}function x(e,...r){if({}.NODE_ENV==="production")return;pr();const t=mr.length?mr[mr.length-1].component:null,s=t&&t.appContext.config.warnHandler,i=_c();if(s)Ft(s,t,11,[e+r.join(""),t&&t.proxy,i.map(({vnode:n})=>`at <${hi(t,n.type)}>`).join(`
|
|
14
|
+
***************************************************************************** */function I(e,r,t,s){var i=arguments.length,n=i<3?r:s===null?s=Object.getOwnPropertyDescriptor(r,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,r,t,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(n=(i<3?o(n):i>3?o(r,t,n):o(r,t))||n);return i>3&&n&&Object.defineProperty(r,t,n),n}const lr={baseUrl:"",cssUrl:"",redirectUrl:"",url:"",apiUrl:"",errorUrl:"https://y2it4xhgpx5junghaf3psg7a7q0splje.lambda-url.ap-southeast-2.on.aws"},Sl={baseUrl:"https://assets.payfurl.com",cssUrl:"https://assets.payfurl.com/v4.6.17/js/",url:"https://assets.payfurl.com/v4.6.17/iframe/index.html",redirectUrl:"https://assets.payfurl.com/v4.6.17/checkout/redirect.html",apiUrl:"https://develop-api.payfurl.com",errorUrl:"https://y2it4xhgpx5junghaf3psg7a7q0splje.lambda-url.ap-southeast-2.on.aws"},kl={baseUrl:"https://assets.payfurl.com",cssUrl:"https://assets.payfurl.com/v4.6.17/js/",url:"https://assets.payfurl.com/v4.6.17/iframe/index.html",redirectUrl:"https://assets.payfurl.com/v4.6.17/checkout/redirect.html",apiUrl:"https://sandbox-api.payfurl.com",errorUrl:"https://gujl7xo5fhpkjaain4swyiymt40loyia.lambda-url.ap-southeast-2.on.aws"},Ol={baseUrl:"https://assets.payfurl.com",cssUrl:"https://assets.payfurl.com/v4.6.17/js/",url:"https://assets.payfurl.com/v4.6.17/iframe/index.html",redirectUrl:"https://assets.payfurl.com/v4.6.17/checkout/redirect.html",apiUrl:"https://api.payfurl.com",errorUrl:"https://4rvkh6tupgcmqk3b2igkpdi2zi0mveyg.lambda-url.ap-southeast-2.on.aws"};var $e;(function(e){e.LOCAL="local",e.DEVELOPMENT="development",e.SANDBOX="sandbox",e.PRODUCTION="production"})($e||($e={}));const ji={[$e.LOCAL]:lr,[$e.DEVELOPMENT]:Sl,[$e.SANDBOX]:kl,[$e.PRODUCTION]:Ol};function Xn(e){return ji[e]}function Ll(e){let r=ji[e];return r||(r=ji[$e.PRODUCTION]),r.errorUrl}class ht{constructor(r,t,s){g(this,"publicKey","");g(this,"version","");g(this,"regionResolver",null);this.publicKey=r||"",this.version=t||"",this.regionResolver=s||null}invoke(r,t,s,i,n,o){const a=new XMLHttpRequest;a||n==null||n(0,""),a.onreadystatechange=function(){if(a.readyState===XMLHttpRequest.DONE){if(a.status===200||a.status===201){i==null||i(a.status,a.responseText);return}n==null||n(a.status,a.responseText)}};const c=new URL(r);if(this.regionResolver){const l=new URL(this.regionResolver.getRegionUrl());c.hostname=l.hostname}if(a.open(t,c.toString()),a.setRequestHeader("Content-Type","application/json"),this.publicKey&&a.setRequestHeader("x-publickey",this.publicKey),this.version&&a.setRequestHeader("sdk-version",this.version),o)for(const[l,u]of Object.entries(o))a.setRequestHeader(l,u);a.send(String(s))}}const Ut=class Ut{constructor(){g(this,"httpInvoker",null);if(Ut.instance)return Ut.instance;this.httpInvoker=new ht,Ut.instance=this}static init(r){return Ut.environment=r,new Ut}sendError(r,t,s){var n;const i=Ll(Ut.environment);(n=this.httpInvoker)==null||n.invoke(i,"POST",JSON.stringify({method:r,message:t,arguments:Object.values(s).map(o=>typeof o=="object"?JSON.stringify(o):String(o))}))}};g(Ut,"instance"),g(Ut,"environment");let qr=Ut;function C(e,r,t){const s=t.value;t.value=function(){try{return s.apply(this,arguments)}catch(i){throw new qr().sendError(r,i.message,Jn(Array.from(arguments))),console.warn("[ErrorHandled], exception",{error:i,target:e,propertyKey:r,arguments}),i}}}function D(e,r,t){return function(...s){try{return t.apply(e,s)}catch(i){throw new qr().sendError(r,i.message,Jn(s)),console.warn("[ErrorHandledFunction], exception",{error:i,funcName:r,args:s}),i}}}function Jn(e){return e.map(r=>xi(r))}function xi(e){if(typeof e!="object"||e===null)return typeof e=="string"&&e.replace(/\s/g,"").search(/^[0-9]{8,19}$/)!==-1?"**** **** **** "+e.replace(/\s/g,"").slice(-4):typeof e=="string"&&e.replace(/\s/g,"").search(/^[0-9]{3,4}$/)!==-1?"***":e;if(Array.isArray(e))return e.map(t=>xi(t));const r={};for(const t in e)e.hasOwnProperty&&e.hasOwnProperty(t)&&typeof e[t]!="function"&&!(e[t]instanceof Node)&&e.constructor!==Object&&(r[t]=xi(e[t]),t==="cardNumber"?r[t]="**** **** **** "+r[t].replace(" ","").slice(-4):t==="ccv"&&(r[t]="***"));return r}function jr(e,r){const t=Object.create(null),s=e.split(",");for(let i=0;i<s.length;i++)t[s[i]]=!0;return r?i=>!!t[i.toLowerCase()]:i=>!!t[i]}function lt(e){if(J(e)){const r={};for(let t=0;t<e.length;t++){const s=e[t],i=Ee(s)?Rl(s):lt(s);if(i)for(const n in i)r[n]=i[n]}return r}else{if(Ee(e))return e;if(Ie(e))return e}}const jl=/;(?![^(]*\))/g,xl=/:([^]+)/,Ul=/\/\*.*?\*\//gs;function Rl(e){const r={};return e.replace(Ul,"").split(jl).forEach(t=>{if(t){const s=t.split(xl);s.length>1&&(r[s[0].trim()]=s[1].trim())}}),r}function es(e){let r="";if(Ee(e))r=e;else if(J(e))for(let t=0;t<e.length;t++){const s=es(e[t]);s&&(r+=s+" ")}else if(Ie(e))for(const t in e)e[t]&&(r+=t+" ");return r.trim()}const zl=jr("itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly");function qn(e){return!!e||e===""}function Fl(e,r){if(e.length!==r.length)return!1;let t=!0;for(let s=0;t&&s<e.length;s++)t=Es(e[s],r[s]);return t}function Es(e,r){if(e===r)return!0;let t=ro(e),s=ro(r);if(t||s)return t&&s?e.getTime()===r.getTime():!1;if(t=rs(e),s=rs(r),t||s)return e===r;if(t=J(e),s=J(r),t||s)return t&&s?Fl(e,r):!1;if(t=Ie(e),s=Ie(r),t||s){if(!t||!s)return!1;const i=Object.keys(e).length,n=Object.keys(r).length;if(i!==n)return!1;for(const o in e){const a=e.hasOwnProperty(o),c=r.hasOwnProperty(o);if(a&&!c||!a&&c||!Es(e[o],r[o]))return!1}}return String(e)===String(r)}function Vl(e,r){return e.findIndex(t=>Es(t,r))}const He=e=>Ee(e)?e:e==null?"":J(e)||Ie(e)&&(e.toString===so||!ne(e.toString))?JSON.stringify(e,eo,2):String(e),eo=(e,r)=>r&&r.__v_isRef?eo(e,r.value):cr(r)?{[`Map(${r.size})`]:[...r.entries()].reduce((t,[s,i])=>(t[`${s} =>`]=i,t),{})}:ks(r)?{[`Set(${r.size})`]:[...r.values()]}:Ie(r)&&!J(r)&&!io(r)?String(r):r,Ce={}.NODE_ENV!=="production"?Object.freeze({}):{},xr={}.NODE_ENV!=="production"?Object.freeze([]):[],Ge=()=>{},to=()=>!1,$l=/^on[^a-z]/,ts=e=>$l.test(e),Ss=e=>e.startsWith("onUpdate:"),Oe=Object.assign,Ui=(e,r)=>{const t=e.indexOf(r);t>-1&&e.splice(t,1)},Hl=Object.prototype.hasOwnProperty,pe=(e,r)=>Hl.call(e,r),J=Array.isArray,cr=e=>ss(e)==="[object Map]",ks=e=>ss(e)==="[object Set]",ro=e=>ss(e)==="[object Date]",ne=e=>typeof e=="function",Ee=e=>typeof e=="string",rs=e=>typeof e=="symbol",Ie=e=>e!==null&&typeof e=="object",Ri=e=>Ie(e)&&ne(e.then)&&ne(e.catch),so=Object.prototype.toString,ss=e=>so.call(e),zi=e=>ss(e).slice(8,-1),io=e=>ss(e)==="[object Object]",Fi=e=>Ee(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Os=jr(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Gl=jr("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"),Ls=e=>{const r=Object.create(null);return t=>r[t]||(r[t]=e(t))},Yl=/-(\w)/g,bt=Ls(e=>e.replace(Yl,(r,t)=>t?t.toUpperCase():"")),Kl=/\B([A-Z])/g,Zt=Ls(e=>e.replace(Kl,"-$1").toLowerCase()),ur=Ls(e=>e.charAt(0).toUpperCase()+e.slice(1)),dr=Ls(e=>e?`on${ur(e)}`:""),is=(e,r)=>!Object.is(e,r),Ur=(e,r)=>{for(let t=0;t<e.length;t++)e[t](r)},js=(e,r,t)=>{Object.defineProperty(e,r,{configurable:!0,enumerable:!1,value:t})},xs=e=>{const r=parseFloat(e);return isNaN(r)?e:r};let no;const oo=()=>no||(no=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Vi(e,...r){console.warn(`[Vue warn] ${e}`,...r)}let yt;class Bl{constructor(r=!1){this.detached=r,this._active=!0,this.effects=[],this.cleanups=[],this.parent=yt,!r&&yt&&(this.index=(yt.scopes||(yt.scopes=[])).push(this)-1)}get active(){return this._active}run(r){if(this._active){const t=yt;try{return yt=this,r()}finally{yt=t}}else({}).NODE_ENV!=="production"&&Vi("cannot run an inactive effect scope.")}on(){yt=this}off(){yt=this.parent}stop(r){if(this._active){let t,s;for(t=0,s=this.effects.length;t<s;t++)this.effects[t].stop();for(t=0,s=this.cleanups.length;t<s;t++)this.cleanups[t]();if(this.scopes)for(t=0,s=this.scopes.length;t<s;t++)this.scopes[t].stop(!0);if(!this.detached&&this.parent&&!r){const i=this.parent.scopes.pop();i&&i!==this&&(this.parent.scopes[this.index]=i,i.index=this.index)}this.parent=void 0,this._active=!1}}}function Wl(e,r=yt){r&&r.active&&r.effects.push(e)}function Zl(){return yt}const ns=e=>{const r=new Set(e);return r.w=0,r.n=0,r},ao=e=>(e.w&Qt)>0,lo=e=>(e.n&Qt)>0,Ql=({deps:e})=>{if(e.length)for(let r=0;r<e.length;r++)e[r].w|=Qt},Xl=e=>{const{deps:r}=e;if(r.length){let t=0;for(let s=0;s<r.length;s++){const i=r[s];ao(i)&&!lo(i)?i.delete(e):r[t++]=i,i.w&=~Qt,i.n&=~Qt}r.length=t}},$i=new WeakMap;let os=0,Qt=1;const Hi=30;let Ze;const hr=Symbol({}.NODE_ENV!=="production"?"iterate":""),Gi=Symbol({}.NODE_ENV!=="production"?"Map key iterate":"");class Yi{constructor(r,t=null,s){this.fn=r,this.scheduler=t,this.active=!0,this.deps=[],this.parent=void 0,Wl(this,s)}run(){if(!this.active)return this.fn();let r=Ze,t=Xt;for(;r;){if(r===this)return;r=r.parent}try{return this.parent=Ze,Ze=this,Xt=!0,Qt=1<<++os,os<=Hi?Ql(this):co(this),this.fn()}finally{os<=Hi&&Xl(this),Qt=1<<--os,Ze=this.parent,Xt=t,this.parent=void 0,this.deferStop&&this.stop()}}stop(){Ze===this?this.deferStop=!0:this.active&&(co(this),this.onStop&&this.onStop(),this.active=!1)}}function co(e){const{deps:r}=e;if(r.length){for(let t=0;t<r.length;t++)r[t].delete(e);r.length=0}}let Xt=!0;const uo=[];function pr(){uo.push(Xt),Xt=!1}function gr(){const e=uo.pop();Xt=e===void 0?!0:e}function Qe(e,r,t){if(Xt&&Ze){let s=$i.get(e);s||$i.set(e,s=new Map);let i=s.get(t);i||s.set(t,i=ns());const n={}.NODE_ENV!=="production"?{effect:Ze,target:e,type:r,key:t}:void 0;Ki(i,n)}}function Ki(e,r){let t=!1;os<=Hi?lo(e)||(e.n|=Qt,t=!ao(e)):t=!e.has(Ze),t&&(e.add(Ze),Ze.deps.push(e),{}.NODE_ENV!=="production"&&Ze.onTrack&&Ze.onTrack(Object.assign({effect:Ze},r)))}function zt(e,r,t,s,i,n){const o=$i.get(e);if(!o)return;let a=[];if(r==="clear")a=[...o.values()];else if(t==="length"&&J(e)){const l=Number(s);o.forEach((u,d)=>{(d==="length"||d>=l)&&a.push(u)})}else switch(t!==void 0&&a.push(o.get(t)),r){case"add":J(e)?Fi(t)&&a.push(o.get("length")):(a.push(o.get(hr)),cr(e)&&a.push(o.get(Gi)));break;case"delete":J(e)||(a.push(o.get(hr)),cr(e)&&a.push(o.get(Gi)));break;case"set":cr(e)&&a.push(o.get(hr));break}const c={}.NODE_ENV!=="production"?{target:e,type:r,key:t,newValue:s,oldValue:i,oldTarget:n}:void 0;if(a.length===1)a[0]&&({}.NODE_ENV!=="production"?Rr(a[0],c):Rr(a[0]));else{const l=[];for(const u of a)u&&l.push(...u);({}).NODE_ENV!=="production"?Rr(ns(l),c):Rr(ns(l))}}function Rr(e,r){const t=J(e)?e:[...e];for(const s of t)s.computed&&ho(s,r);for(const s of t)s.computed||ho(s,r)}function ho(e,r){(e!==Ze||e.allowRecurse)&&({}.NODE_ENV!=="production"&&e.onTrigger&&e.onTrigger(Oe({effect:e},r)),e.scheduler?e.scheduler():e.run())}const Jl=jr("__proto__,__v_isRef,__isVue"),po=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(rs)),ql=Us(),ec=Us(!1,!0),tc=Us(!0),rc=Us(!0,!0),go=sc();function sc(){const e={};return["includes","indexOf","lastIndexOf"].forEach(r=>{e[r]=function(...t){const s=ue(this);for(let n=0,o=this.length;n<o;n++)Qe(s,"get",n+"");const i=s[r](...t);return i===-1||i===!1?s[r](...t.map(ue)):i}}),["push","pop","shift","unshift","splice"].forEach(r=>{e[r]=function(...t){pr();const s=ue(this)[r].apply(this,t);return gr(),s}}),e}function ic(e){const r=ue(this);return Qe(r,"has",e),r.hasOwnProperty(e)}function Us(e=!1,r=!1){return function(s,i,n){if(i==="__v_isReactive")return!e;if(i==="__v_isReadonly")return e;if(i==="__v_isShallow")return r;if(i==="__v_raw"&&n===(e?r?wo:Po:r?No:To).get(s))return s;const o=J(s);if(!e){if(o&&pe(go,i))return Reflect.get(go,i,n);if(i==="hasOwnProperty")return ic}const a=Reflect.get(s,i,n);return(rs(i)?po.has(i):Jl(i))||(e||Qe(s,"get",i),r)?a:xe(a)?o&&Fi(i)?a:a.value:Ie(a)?e?bo(a):Wi(a):a}}const nc=fo(),oc=fo(!0);function fo(e=!1){return function(t,s,i,n){let o=t[s];if(qt(o)&&xe(o)&&!xe(i))return!1;if(!e&&(!Ks(i)&&!qt(i)&&(o=ue(o),i=ue(i)),!J(t)&&xe(o)&&!xe(i)))return o.value=i,!0;const a=J(t)&&Fi(s)?Number(s)<t.length:pe(t,s),c=Reflect.set(t,s,i,n);return t===ue(n)&&(a?is(i,o)&&zt(t,"set",s,i,o):zt(t,"add",s,i)),c}}function ac(e,r){const t=pe(e,r),s=e[r],i=Reflect.deleteProperty(e,r);return i&&t&&zt(e,"delete",r,void 0,s),i}function lc(e,r){const t=Reflect.has(e,r);return(!rs(r)||!po.has(r))&&Qe(e,"has",r),t}function cc(e){return Qe(e,"iterate",J(e)?"length":hr),Reflect.ownKeys(e)}const mo={get:ql,set:nc,deleteProperty:ac,has:lc,ownKeys:cc},yo={get:tc,set(e,r){return{}.NODE_ENV!=="production"&&Vi(`Set operation on key "${String(r)}" failed: target is readonly.`,e),!0},deleteProperty(e,r){return{}.NODE_ENV!=="production"&&Vi(`Delete operation on key "${String(r)}" failed: target is readonly.`,e),!0}},uc=Oe({},mo,{get:ec,set:oc}),dc=Oe({},yo,{get:rc}),Bi=e=>e,Rs=e=>Reflect.getPrototypeOf(e);function zs(e,r,t=!1,s=!1){e=e.__v_raw;const i=ue(e),n=ue(r);t||(r!==n&&Qe(i,"get",r),Qe(i,"get",n));const{has:o}=Rs(i),a=s?Bi:t?Qi:as;if(o.call(i,r))return a(e.get(r));if(o.call(i,n))return a(e.get(n));e!==i&&e.get(r)}function Fs(e,r=!1){const t=this.__v_raw,s=ue(t),i=ue(e);return r||(e!==i&&Qe(s,"has",e),Qe(s,"has",i)),e===i?t.has(e):t.has(e)||t.has(i)}function Vs(e,r=!1){return e=e.__v_raw,!r&&Qe(ue(e),"iterate",hr),Reflect.get(e,"size",e)}function Io(e){e=ue(e);const r=ue(this);return Rs(r).has.call(r,e)||(r.add(e),zt(r,"add",e,e)),this}function Co(e,r){r=ue(r);const t=ue(this),{has:s,get:i}=Rs(t);let n=s.call(t,e);n?{}.NODE_ENV!=="production"&&Do(t,s,e):(e=ue(e),n=s.call(t,e));const o=i.call(t,e);return t.set(e,r),n?is(r,o)&&zt(t,"set",e,r,o):zt(t,"add",e,r),this}function Ao(e){const r=ue(this),{has:t,get:s}=Rs(r);let i=t.call(r,e);i?{}.NODE_ENV!=="production"&&Do(r,t,e):(e=ue(e),i=t.call(r,e));const n=s?s.call(r,e):void 0,o=r.delete(e);return i&&zt(r,"delete",e,void 0,n),o}function Mo(){const e=ue(this),r=e.size!==0,t={}.NODE_ENV!=="production"?cr(e)?new Map(e):new Set(e):void 0,s=e.clear();return r&&zt(e,"clear",void 0,void 0,t),s}function $s(e,r){return function(s,i){const n=this,o=n.__v_raw,a=ue(o),c=r?Bi:e?Qi:as;return!e&&Qe(a,"iterate",hr),o.forEach((l,u)=>s.call(i,c(l),c(u),n))}}function Hs(e,r,t){return function(...s){const i=this.__v_raw,n=ue(i),o=cr(n),a=e==="entries"||e===Symbol.iterator&&o,c=e==="keys"&&o,l=i[e](...s),u=t?Bi:r?Qi:as;return!r&&Qe(n,"iterate",c?Gi:hr),{next(){const{value:d,done:h}=l.next();return h?{value:d,done:h}:{value:a?[u(d[0]),u(d[1])]:u(d),done:h}},[Symbol.iterator](){return this}}}}function Jt(e){return function(...r){if({}.NODE_ENV!=="production"){const t=r[0]?`on key "${r[0]}" `:"";console.warn(`${ur(e)} operation ${t}failed: target is readonly.`,ue(this))}return e==="delete"?!1:this}}function hc(){const e={get(n){return zs(this,n)},get size(){return Vs(this)},has:Fs,add:Io,set:Co,delete:Ao,clear:Mo,forEach:$s(!1,!1)},r={get(n){return zs(this,n,!1,!0)},get size(){return Vs(this)},has:Fs,add:Io,set:Co,delete:Ao,clear:Mo,forEach:$s(!1,!0)},t={get(n){return zs(this,n,!0)},get size(){return Vs(this,!0)},has(n){return Fs.call(this,n,!0)},add:Jt("add"),set:Jt("set"),delete:Jt("delete"),clear:Jt("clear"),forEach:$s(!0,!1)},s={get(n){return zs(this,n,!0,!0)},get size(){return Vs(this,!0)},has(n){return Fs.call(this,n,!0)},add:Jt("add"),set:Jt("set"),delete:Jt("delete"),clear:Jt("clear"),forEach:$s(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(n=>{e[n]=Hs(n,!1,!1),t[n]=Hs(n,!0,!1),r[n]=Hs(n,!1,!0),s[n]=Hs(n,!0,!0)}),[e,t,r,s]}const[pc,gc,fc,mc]=hc();function Gs(e,r){const t=r?e?mc:fc:e?gc:pc;return(s,i,n)=>i==="__v_isReactive"?!e:i==="__v_isReadonly"?e:i==="__v_raw"?s:Reflect.get(pe(t,i)&&i in s?t:s,i,n)}const yc={get:Gs(!1,!1)},Ic={get:Gs(!1,!0)},Cc={get:Gs(!0,!1)},Ac={get:Gs(!0,!0)};function Do(e,r,t){const s=ue(t);if(s!==t&&r.call(e,s)){const i=zi(e);console.warn(`Reactive ${i} contains both the raw and reactive versions of the same object${i==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}const To=new WeakMap,No=new WeakMap,Po=new WeakMap,wo=new WeakMap;function Mc(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Dc(e){return e.__v_skip||!Object.isExtensible(e)?0:Mc(zi(e))}function Wi(e){return qt(e)?e:Ys(e,!1,mo,yc,To)}function Tc(e){return Ys(e,!1,uc,Ic,No)}function bo(e){return Ys(e,!0,yo,Cc,Po)}function zr(e){return Ys(e,!0,dc,Ac,wo)}function Ys(e,r,t,s,i){if(!Ie(e))return{}.NODE_ENV!=="production"&&console.warn(`value cannot be made reactive: ${String(e)}`),e;if(e.__v_raw&&!(r&&e.__v_isReactive))return e;const n=i.get(e);if(n)return n;const o=Dc(e);if(o===0)return e;const a=new Proxy(e,o===2?s:t);return i.set(e,a),a}function fr(e){return qt(e)?fr(e.__v_raw):!!(e&&e.__v_isReactive)}function qt(e){return!!(e&&e.__v_isReadonly)}function Ks(e){return!!(e&&e.__v_isShallow)}function Zi(e){return fr(e)||qt(e)}function ue(e){const r=e&&e.__v_raw;return r?ue(r):e}function vo(e){return js(e,"__v_skip",!0),e}const as=e=>Ie(e)?Wi(e):e,Qi=e=>Ie(e)?bo(e):e;function _o(e){Xt&&Ze&&(e=ue(e),{}.NODE_ENV!=="production"?Ki(e.dep||(e.dep=ns()),{target:e,type:"get",key:"value"}):Ki(e.dep||(e.dep=ns())))}function Eo(e,r){e=ue(e);const t=e.dep;t&&({}.NODE_ENV!=="production"?Rr(t,{target:e,type:"set",key:"value",newValue:r}):Rr(t))}function xe(e){return!!(e&&e.__v_isRef===!0)}function te(e){return Nc(e,!1)}function Nc(e,r){return xe(e)?e:new Pc(e,r)}class Pc{constructor(r,t){this.__v_isShallow=t,this.dep=void 0,this.__v_isRef=!0,this._rawValue=t?r:ue(r),this._value=t?r:as(r)}get value(){return _o(this),this._value}set value(r){const t=this.__v_isShallow||Ks(r)||qt(r);r=t?r:ue(r),is(r,this._rawValue)&&(this._rawValue=r,this._value=t?r:as(r),Eo(this,r))}}function me(e){return xe(e)?e.value:e}const wc={get:(e,r,t)=>me(Reflect.get(e,r,t)),set:(e,r,t,s)=>{const i=e[r];return xe(i)&&!xe(t)?(i.value=t,!0):Reflect.set(e,r,t,s)}};function So(e){return fr(e)?e:new Proxy(e,wc)}var ko;class bc{constructor(r,t,s,i){this._setter=t,this.dep=void 0,this.__v_isRef=!0,this[ko]=!1,this._dirty=!0,this.effect=new Yi(r,()=>{this._dirty||(this._dirty=!0,Eo(this))}),this.effect.computed=this,this.effect.active=this._cacheable=!i,this.__v_isReadonly=s}get value(){const r=ue(this);return _o(r),(r._dirty||!r._cacheable)&&(r._dirty=!1,r._value=r.effect.run()),r._value}set value(r){this._setter(r)}}ko="__v_isReadonly";function vc(e,r,t=!1){let s,i;const n=ne(e);n?(s=e,i={}.NODE_ENV!=="production"?()=>{console.warn("Write operation failed: computed value is readonly")}:Ge):(s=e.get,i=e.set);const o=new bc(s,i,n||!i,t);return{}.NODE_ENV!=="production"&&r&&!t&&(o.effect.onTrack=r.onTrack,o.effect.onTrigger=r.onTrigger),o}const mr=[];function Bs(e){mr.push(e)}function Ws(){mr.pop()}function x(e,...r){if({}.NODE_ENV==="production")return;pr();const t=mr.length?mr[mr.length-1].component:null,s=t&&t.appContext.config.warnHandler,i=_c();if(s)Ft(s,t,11,[e+r.join(""),t&&t.proxy,i.map(({vnode:n})=>`at <${hi(t,n.type)}>`).join(`
|
|
15
15
|
`),i]);else{const n=[`[Vue warn]: ${e}`,...r];i.length&&n.push(`
|
|
16
16
|
`,...Ec(i)),console.warn(...n)}gr()}function _c(){let e=mr[mr.length-1];if(!e)return[];const r=[];for(;e;){const t=r[0];t&&t.vnode===e?t.recurseCount++:r.push({vnode:e,recurseCount:0});const s=e.component&&e.component.parent;e=s&&s.vnode}return r}function Ec(e){const r=[];return e.forEach((t,s)=>{r.push(...s===0?[]:[`
|
|
17
17
|
`],...Sc(t))}),r}function Sc({vnode:e,recurseCount:r}){const t=r>0?`... (${r} recursive calls)`:"",s=e.component?e.component.parent==null:!1,i=` at <${hi(e.component,e.type,s)}`,n=">"+t;return e.props?[i,...kc(e.props),n]:[i+n]}function kc(e){const r=[],t=Object.keys(e);return t.slice(0,3).forEach(s=>{r.push(...Oo(s,e[s]))}),t.length>3&&r.push(" ..."),r}function Oo(e,r,t){return Ee(r)?(r=JSON.stringify(r),t?r:[`${e}=${r}`]):typeof r=="number"||typeof r=="boolean"||r==null?t?r:[`${e}=${r}`]:xe(r)?(r=Oo(e,ue(r.value),!0),t?r:[`${e}=Ref<`,r,">"]):ne(r)?[`${e}=fn${r.name?`<${r.name}>`:""}`]:(r=ue(r),t?r:[`${e}=`,r])}const Xi={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush. This is likely a Vue internals bug. Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/core"};function Ft(e,r,t,s){let i;try{i=s?e(...s):e()}catch(n){Zs(n,r,t)}return i}function It(e,r,t,s){if(ne(e)){const n=Ft(e,r,t,s);return n&&Ri(n)&&n.catch(o=>{Zs(o,r,t)}),n}const i=[];for(let n=0;n<e.length;n++)i.push(It(e[n],r,t,s));return i}function Zs(e,r,t,s=!0){const i=r?r.vnode:null;if(r){let n=r.parent;const o=r.proxy,a={}.NODE_ENV!=="production"?Xi[t]:t;for(;n;){const l=n.ec;if(l){for(let u=0;u<l.length;u++)if(l[u](e,o,a)===!1)return}n=n.parent}const c=r.appContext.config.errorHandler;if(c){Ft(c,null,10,[e,o,a]);return}}Oc(e,t,i,s)}function Oc(e,r,t,s=!0){if({}.NODE_ENV!=="production"){const i=Xi[r];if(t&&Bs(t),x(`Unhandled error${i?` during execution of ${i}`:""}`),t&&Ws(),s)throw e;console.error(e)}else console.error(e)}let ls=!1,Ji=!1;const Ke=[];let vt=0;const Fr=[];let _t=null,er=0;const Lo=Promise.resolve();let qi=null;const Lc=100;function jc(e){const r=qi||Lo;return e?r.then(this?e.bind(this):e):r}function xc(e){let r=vt+1,t=Ke.length;for(;r<t;){const s=r+t>>>1;cs(Ke[s])<e?r=s+1:t=s}return r}function Qs(e){(!Ke.length||!Ke.includes(e,ls&&e.allowRecurse?vt+1:vt))&&(e.id==null?Ke.push(e):Ke.splice(xc(e.id),0,e),jo())}function jo(){!ls&&!Ji&&(Ji=!0,qi=Lo.then(zo))}function Uc(e){const r=Ke.indexOf(e);r>vt&&Ke.splice(r,1)}function xo(e){J(e)?Fr.push(...e):(!_t||!_t.includes(e,e.allowRecurse?er+1:er))&&Fr.push(e),jo()}function Uo(e,r=ls?vt+1:0){for({}.NODE_ENV!=="production"&&(e=e||new Map);r<Ke.length;r++){const t=Ke[r];if(t&&t.pre){if({}.NODE_ENV!=="production"&&en(e,t))continue;Ke.splice(r,1),r--,t()}}}function Ro(e){if(Fr.length){const r=[...new Set(Fr)];if(Fr.length=0,_t){_t.push(...r);return}for(_t=r,{}.NODE_ENV!=="production"&&(e=e||new Map),_t.sort((t,s)=>cs(t)-cs(s)),er=0;er<_t.length;er++)({}).NODE_ENV!=="production"&&en(e,_t[er])||_t[er]();_t=null,er=0}}const cs=e=>e.id==null?1/0:e.id,Rc=(e,r)=>{const t=cs(e)-cs(r);if(t===0){if(e.pre&&!r.pre)return-1;if(r.pre&&!e.pre)return 1}return t};function zo(e){Ji=!1,ls=!0,{}.NODE_ENV!=="production"&&(e=e||new Map),Ke.sort(Rc);const r={}.NODE_ENV!=="production"?t=>en(e,t):Ge;try{for(vt=0;vt<Ke.length;vt++){const t=Ke[vt];if(t&&t.active!==!1){if({}.NODE_ENV!=="production"&&r(t))continue;Ft(t,null,14)}}}finally{vt=0,Ke.length=0,Ro(e),ls=!1,qi=null,(Ke.length||Fr.length)&&zo(e)}}function en(e,r){if(!e.has(r))e.set(r,1);else{const t=e.get(r);if(t>Lc){const s=r.ownerInstance,i=s&&Tn(s.type);return x(`Maximum recursive updates exceeded${i?` in component <${i}>`:""}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`),!0}else e.set(r,t+1)}}let yr=!1;const Vr=new Set;({}).NODE_ENV!=="production"&&(oo().__VUE_HMR_RUNTIME__={createRecord:tn(Fo),rerender:tn(Vc),reload:tn($c)});const Ir=new Map;function zc(e){const r=e.type.__hmrId;let t=Ir.get(r);t||(Fo(r,e.type),t=Ir.get(r)),t.instances.add(e)}function Fc(e){Ir.get(e.type.__hmrId).instances.delete(e)}function Fo(e,r){return Ir.has(e)?!1:(Ir.set(e,{initialDef:us(r),instances:new Set}),!0)}function us(e){return va(e)?e.__vccOpts:e}function Vc(e,r){const t=Ir.get(e);t&&(t.initialDef.render=r,[...t.instances].forEach(s=>{r&&(s.render=r,us(s.type).render=r),s.renderCache=[],yr=!0,s.update(),yr=!1}))}function $c(e,r){const t=Ir.get(e);if(!t)return;r=us(r),Vo(t.initialDef,r);const s=[...t.instances];for(const i of s){const n=us(i.type);Vr.has(n)||(n!==t.initialDef&&Vo(n,r),Vr.add(n)),i.appContext.optionsCache.delete(i.type),i.ceReload?(Vr.add(n),i.ceReload(r.styles),Vr.delete(n)):i.parent?Qs(i.parent.update):i.appContext.reload?i.appContext.reload():typeof window<"u"?window.location.reload():console.warn("[HMR] Root or manually mounted instance modified. Full reload required.")}xo(()=>{for(const i of s)Vr.delete(us(i.type))})}function Vo(e,r){Oe(e,r);for(const t in e)t!=="__file"&&!(t in r)&&delete e[t]}function tn(e){return(r,t)=>{try{return e(r,t)}catch(s){console.error(s),console.warn("[HMR] Something went wrong during Vue component hot-reload. Full reload required.")}}}let Et,ds=[],rn=!1;function hs(e,...r){Et?Et.emit(e,...r):rn||ds.push({event:e,args:r})}function $o(e,r){var t,s;Et=e,Et?(Et.enabled=!0,ds.forEach(({event:i,args:n})=>Et.emit(i,...n)),ds=[]):typeof window<"u"&&window.HTMLElement&&!(!((s=(t=window.navigator)===null||t===void 0?void 0:t.userAgent)===null||s===void 0)&&s.includes("jsdom"))?((r.__VUE_DEVTOOLS_HOOK_REPLAY__=r.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(n=>{$o(n,r)}),setTimeout(()=>{Et||(r.__VUE_DEVTOOLS_HOOK_REPLAY__=null,rn=!0,ds=[])},3e3)):(rn=!0,ds=[])}function Hc(e,r){hs("app:init",e,r,{Fragment:Le,Text:fs,Comment:it,Static:ms})}function Gc(e){hs("app:unmount",e)}const Yc=sn("component:added"),Ho=sn("component:updated"),Kc=sn("component:removed"),Bc=e=>{Et&&typeof Et.cleanupBuffer=="function"&&!Et.cleanupBuffer(e)&&Kc(e)};function sn(e){return r=>{hs(e,r.appContext.app,r.uid,r.parent?r.parent.uid:void 0,r)}}const Wc=Go("perf:start"),Zc=Go("perf:end");function Go(e){return(r,t,s)=>{hs(e,r.appContext.app,r.uid,r,t,s)}}function Qc(e,r,t){hs("component:emit",e.appContext.app,e,r,t)}function Xc(e,r,...t){if(e.isUnmounted)return;const s=e.vnode.props||Ce;if({}.NODE_ENV!=="production"){const{emitsOptions:u,propsOptions:[d]}=e;if(u)if(!(r in u))(!d||!(dr(r)in d))&&x(`Component emitted event "${r}" but it is neither declared in the emits option nor as an "${dr(r)}" prop.`);else{const h=u[r];ne(h)&&(h(...t)||x(`Invalid event arguments: event validation failed for event "${r}".`))}}let i=t;const n=r.startsWith("update:"),o=n&&r.slice(7);if(o&&o in s){const u=`${o==="modelValue"?"model":o}Modifiers`,{number:d,trim:h}=s[u]||Ce;h&&(i=t.map(p=>Ee(p)?p.trim():p)),d&&(i=t.map(xs))}if({}.NODE_ENV!=="production"&&Qc(e,r,i),{}.NODE_ENV!=="production"){const u=r.toLowerCase();u!==r&&s[dr(u)]&&x(`Event "${u}" is emitted in component ${hi(e,e.type)} but the handler is registered for "${r}". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "${Zt(r)}" instead of "${r}".`)}let a,c=s[a=dr(r)]||s[a=dr(bt(r))];!c&&n&&(c=s[a=dr(Zt(r))]),c&&It(c,e,6,i);const l=s[a+"Once"];if(l){if(!e.emitted)e.emitted={};else if(e.emitted[a])return;e.emitted[a]=!0,It(l,e,6,i)}}function Yo(e,r,t=!1){const s=r.emitsCache,i=s.get(e);if(i!==void 0)return i;const n=e.emits;let o={},a=!1;if(!ne(e)){const c=l=>{const u=Yo(l,r,!0);u&&(a=!0,Oe(o,u))};!t&&r.mixins.length&&r.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}return!n&&!a?(Ie(e)&&s.set(e,null),null):(J(n)?n.forEach(c=>o[c]=null):Oe(o,n),Ie(e)&&s.set(e,o),o)}function Xs(e,r){return!e||!ts(r)?!1:(r=r.slice(2).replace(/Once$/,""),pe(e,r[0].toLowerCase()+r.slice(1))||pe(e,Zt(r))||pe(e,r))}let Ue=null,Js=null;function qs(e){const r=Ue;return Ue=e,Js=e&&e.type.__scopeId||null,r}function pt(e){Js=e}function gt(){Js=null}function $r(e,r=Ue,t){if(!r||e._n)return e;const s=(...i)=>{s._d&&Ia(-1);const n=qs(r);let o;try{o=e(...i)}finally{qs(n),s._d&&Ia(1)}return{}.NODE_ENV!=="production"&&Ho(r),o};return s._n=!0,s._c=!0,s._d=!0,s}let nn=!1;function ei(){nn=!0}function on(e){const{type:r,vnode:t,proxy:s,withProxy:i,props:n,propsOptions:[o],slots:a,attrs:c,emit:l,render:u,renderCache:d,data:h,setupState:p,ctx:m,inheritAttrs:A}=e;let E,v;const M=qs(e);({}).NODE_ENV!=="production"&&(nn=!1);try{if(t.shapeFlag&4){const F=i||s;E=Mt(u.call(F,F,d,n,p,h,m)),v=c}else{const F=r;({}).NODE_ENV!=="production"&&c===n&&ei(),E=Mt(F.length>1?F(n,{}.NODE_ENV!=="production"?{get attrs(){return ei(),c},slots:a,emit:l}:{attrs:c,slots:a,emit:l}):F(n,null)),v=r.props?c:qc(c)}}catch(F){ys.length=0,Zs(F,e,1),E=ve(it)}let N=E,S;if({}.NODE_ENV!=="production"&&E.patchFlag>0&&E.patchFlag&2048&&([N,S]=Jc(E)),v&&A!==!1){const F=Object.keys(v),{shapeFlag:O}=N;if(F.length){if(O&7)o&&F.some(Ss)&&(v=eu(v,o)),N=rr(N,v);else if({}.NODE_ENV!=="production"&&!nn&&N.type!==it){const oe=Object.keys(c),he=[],ae=[];for(let ie=0,be=oe.length;ie<be;ie++){const Ne=oe[ie];ts(Ne)?Ss(Ne)||he.push(Ne[2].toLowerCase()+Ne.slice(3)):ae.push(Ne)}ae.length&&x(`Extraneous non-props attributes (${ae.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes.`),he.length&&x(`Extraneous non-emits event listeners (${he.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. If the listener is intended to be a component custom event listener only, declare it using the "emits" option.`)}}}return t.dirs&&({}.NODE_ENV!=="production"&&!Bo(N)&&x("Runtime directive used on component with non-element root node. The directives will not function as intended."),N=rr(N),N.dirs=N.dirs?N.dirs.concat(t.dirs):t.dirs),t.transition&&({}.NODE_ENV!=="production"&&!Bo(N)&&x("Component inside <Transition> renders non-element root node that cannot be animated."),N.transition=t.transition),{}.NODE_ENV!=="production"&&S?S(N):E=N,qs(M),E}const Jc=e=>{const r=e.children,t=e.dynamicChildren,s=Ko(r);if(!s)return[e,void 0];const i=r.indexOf(s),n=t?t.indexOf(s):-1,o=a=>{r[i]=a,t&&(n>-1?t[n]=a:a.patchFlag>0&&(e.dynamicChildren=[...t,a]))};return[Mt(s),o]};function Ko(e){let r;for(let t=0;t<e.length;t++){const s=e[t];if(li(s)){if(s.type!==it||s.children==="v-if"){if(r)return;r=s}}else return}return r}const qc=e=>{let r;for(const t in e)(t==="class"||t==="style"||ts(t))&&((r||(r={}))[t]=e[t]);return r},eu=(e,r)=>{const t={};for(const s in e)(!Ss(s)||!(s.slice(9)in r))&&(t[s]=e[s]);return t},Bo=e=>e.shapeFlag&7||e.type===it;function tu(e,r,t){const{props:s,children:i,component:n}=e,{props:o,children:a,patchFlag:c}=r,l=n.emitsOptions;if({}.NODE_ENV!=="production"&&(i||a)&&yr||r.dirs||r.transition)return!0;if(t&&c>=0){if(c&1024)return!0;if(c&16)return s?Wo(s,o,l):!!o;if(c&8){const u=r.dynamicProps;for(let d=0;d<u.length;d++){const h=u[d];if(o[h]!==s[h]&&!Xs(l,h))return!0}}}else return(i||a)&&(!a||!a.$stable)?!0:s===o?!1:s?o?Wo(s,o,l):!0:!!o;return!1}function Wo(e,r,t){const s=Object.keys(r);if(s.length!==Object.keys(e).length)return!0;for(let i=0;i<s.length;i++){const n=s[i];if(r[n]!==e[n]&&!Xs(t,n))return!0}return!1}function ru({vnode:e,parent:r},t){for(;r&&r.subTree===e;)(e=r.vnode).el=t,r=r.parent}const su=e=>e.__isSuspense;function iu(e,r){r&&r.pendingBranch?J(e)?r.effects.push(...e):r.effects.push(e):xo(e)}function nu(e,r){if(!Se)({}).NODE_ENV!=="production"&&x("provide() can only be used inside setup().");else{let t=Se.provides;const s=Se.parent&&Se.parent.provides;s===t&&(t=Se.provides=Object.create(s)),t[e]=r}}function ti(e,r,t=!1){const s=Se||Ue;if(s){const i=s.parent==null?s.vnode.appContext&&s.vnode.appContext.provides:s.parent.provides;if(i&&e in i)return i[e];if(arguments.length>1)return t&&ne(r)?r.call(s.proxy):r;({}).NODE_ENV!=="production"&&x(`injection "${String(e)}" not found.`)}else({}).NODE_ENV!=="production"&&x("inject() can only be used inside setup() or functional components.")}const ri={};function Cr(e,r,t){return{}.NODE_ENV!=="production"&&!ne(r)&&x("`watch(fn, options?)` signature has been moved to a separate API. Use `watchEffect(fn, options?)` instead. `watch` now only supports `watch(source, cb, options?) signature."),Zo(e,r,t)}function Zo(e,r,{immediate:t,deep:s,flush:i,onTrack:n,onTrigger:o}=Ce){({}).NODE_ENV!=="production"&&!r&&(t!==void 0&&x('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),s!==void 0&&x('watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'));const a=S=>{x("Invalid watch source: ",S,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")},c=Zl()===(Se==null?void 0:Se.scope)?Se:null;let l,u=!1,d=!1;if(xe(e)?(l=()=>e.value,u=Ks(e)):fr(e)?(l=()=>e,s=!0):J(e)?(d=!0,u=e.some(S=>fr(S)||Ks(S)),l=()=>e.map(S=>{if(xe(S))return S.value;if(fr(S))return Ar(S);if(ne(S))return Ft(S,c,2);({}).NODE_ENV!=="production"&&a(S)})):ne(e)?r?l=()=>Ft(e,c,2):l=()=>{if(!(c&&c.isUnmounted))return h&&h(),It(e,c,3,[p])}:(l=Ge,{}.NODE_ENV!=="production"&&a(e)),r&&s){const S=l;l=()=>Ar(S())}let h,p=S=>{h=M.onStop=()=>{Ft(S,c,4)}},m;if(As)if(p=Ge,r?t&&It(r,c,3,[l(),d?[]:void 0,p]):l(),i==="sync"){const S=hd();m=S.__watcherHandles||(S.__watcherHandles=[])}else return Ge;let A=d?new Array(e.length).fill(ri):ri;const E=()=>{if(M.active)if(r){const S=M.run();(s||u||(d?S.some((F,O)=>is(F,A[O])):is(S,A)))&&(h&&h(),It(r,c,3,[S,A===ri?void 0:d&&A[0]===ri?[]:A,p]),A=S)}else M.run()};E.allowRecurse=!!r;let v;i==="sync"?v=E:i==="post"?v=()=>st(E,c&&c.suspense):(E.pre=!0,c&&(E.id=c.uid),v=()=>Qs(E));const M=new Yi(l,v);({}).NODE_ENV!=="production"&&(M.onTrack=n,M.onTrigger=o),r?t?E():A=M.run():i==="post"?st(M.run.bind(M),c&&c.suspense):M.run();const N=()=>{M.stop(),c&&c.scope&&Ui(c.scope.effects,M)};return m&&m.push(N),N}function ou(e,r,t){const s=this.proxy,i=Ee(e)?e.includes(".")?Qo(s,e):()=>s[e]:e.bind(s,s);let n;ne(r)?n=r:(n=r.handler,t=r);const o=Se;Hr(this);const a=Zo(i,n.bind(s),t);return o?Hr(o):wr(),a}function Qo(e,r){const t=r.split(".");return()=>{let s=e;for(let i=0;i<t.length&&s;i++)s=s[t[i]];return s}}function Ar(e,r){if(!Ie(e)||e.__v_skip||(r=r||new Set,r.has(e)))return e;if(r.add(e),xe(e))Ar(e.value,r);else if(J(e))for(let t=0;t<e.length;t++)Ar(e[t],r);else if(ks(e)||cr(e))e.forEach(t=>{Ar(t,r)});else if(io(e))for(const t in e)Ar(e[t],r);return e}function Te(e){return ne(e)?{setup:e,name:e.name}:e}const ps=e=>!!e.type.__asyncLoader,an=e=>e.type.__isKeepAlive;function au(e,r){Xo(e,"a",r)}function lu(e,r){Xo(e,"da",r)}function Xo(e,r,t=Se){const s=e.__wdc||(e.__wdc=()=>{let i=t;for(;i;){if(i.isDeactivated)return;i=i.parent}return e()});if(si(r,s,t),t){let i=t.parent;for(;i&&i.parent;)an(i.parent.vnode)&&cu(s,r,t,i),i=i.parent}}function cu(e,r,t,s){const i=si(r,e,s,!0);Ct(()=>{Ui(s[r],i)},t)}function si(e,r,t=Se,s=!1){if(t){const i=t[e]||(t[e]=[]),n=r.__weh||(r.__weh=(...o)=>{if(t.isUnmounted)return;pr(),Hr(t);const a=It(r,t,e,o);return wr(),gr(),a});return s?i.unshift(n):i.push(n),n}else if({}.NODE_ENV!=="production"){const i=dr(Xi[e].replace(/ hook$/,""));x(`${i} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup(). If you are using async setup(), make sure to register lifecycle hooks before the first await statement.`)}}const Vt=e=>(r,t=Se)=>(!As||e==="sp")&&si(e,(...s)=>r(...s),t),uu=Vt("bm"),Xe=Vt("m"),du=Vt("bu"),hu=Vt("u"),pu=Vt("bum"),Ct=Vt("um"),gu=Vt("sp"),fu=Vt("rtg"),mu=Vt("rtc");function yu(e,r=Se){si("ec",e,r)}function Jo(e){Gl(e)&&x("Do not use built-in directive ids as custom directive id: "+e)}function ft(e,r){const t=Ue;if(t===null)return{}.NODE_ENV!=="production"&&x("withDirectives can only be used inside render functions."),e;const s=di(t)||t.proxy,i=e.dirs||(e.dirs=[]);for(let n=0;n<r.length;n++){let[o,a,c,l=Ce]=r[n];o&&(ne(o)&&(o={mounted:o,updated:o}),o.deep&&Ar(a),i.push({dir:o,instance:s,value:a,oldValue:void 0,arg:c,modifiers:l}))}return e}function Mr(e,r,t,s){const i=e.dirs,n=r&&r.dirs;for(let o=0;o<i.length;o++){const a=i[o];n&&(a.oldValue=n[o].value);let c=a.dir[s];c&&(pr(),It(c,t,8,[e.el,a,e,r]),gr())}}const ln="components",qo=Symbol();function Iu(e){return Ee(e)?Cu(ln,e,!1)||e:e||qo}function Cu(e,r,t=!0,s=!1){const i=Ue||Se;if(i){const n=i.type;if(e===ln){const a=Tn(n,!1);if(a&&(a===r||a===bt(r)||a===ur(bt(r))))return n}const o=ea(i[e]||n[e],r)||ea(i.appContext[e],r);if(!o&&s)return n;if({}.NODE_ENV!=="production"&&t&&!o){const a=e===ln?`
|
|
@@ -146,7 +146,7 @@ Component that was made reactive: `,e)),P(e,r,t,s,i,o,n,!0)}function Qu(e){retur
|
|
|
146
146
|
width=${s},
|
|
147
147
|
height=${i},
|
|
148
148
|
top=${d},
|
|
149
|
-
left=${u}`)}modalHide(){this.modal&&(Dp(),this.modal.close())}updateToken(t){var i,n;if(this.log("[MastercardTokenAuthenticationProcessor][updateToken]",t),!((i=t.assuranceData)!=null&&i.verificationData.length))return;const s=t.assuranceData.verificationData[0];(n=this.httpInvoker)==null||n.invoke(ll(this.apiUrl,this.token)[xn.UPDATE].url,ll(this.apiUrl,this.token)[xn.UPDATE].method,JSON.stringify({VerificationType:s.verificationType,VerificationEntity:s.verificationEntity,VerificationMethod:s.verificationMethod,VerificationResults:s.verificationResults,VerificationTimestamp:s.verificationTimestamp,AdditionalData:s.additionalData,VerificationEvents:JSON.stringify(s.verificationEvents)}),D(this,"[MastercardTokenAuthenticationProcessor][updateToken]: successCallback",(o,a)=>{var c;this.log("[MastercardTokenAuthenticationProcessor][updateToken]: successCallback",o,a),this.modalHide(),(c=this.onSuccessCallback)==null||c.call(this,t)}),D(this,"[MastercardTokenAuthenticationProcessor][updateToken]: failureCallback",(o,a)=>{var c;this.log("[MastercardTokenAuthenticationProcessor][updateToken]: failureCallback",o,a),this.modalHide(),(c=this.onFailureCallback)==null||c.call(this,{error:"Unknown error"})}))}}I([C],Bt.prototype,"invoke",null),I([C],Bt.prototype,"messageHandler",null),I([C],Bt.prototype,"authenticate",null),I([C],Bt.prototype,"init",null),I([C],Bt.prototype,"initCss",null),I([C],Bt.prototype,"modalShow",null),I([C],Bt.prototype,"modalHide",null),I([C],Bt.prototype,"updateToken",null);const{hideSpinner:Ye,showSpinner:Gr}=Gt(),vi={TOKENISE_CARD:"TOKENISE_CARD",GET_PROVIDER_INFO:"GET_PROVIDER_INFO"},cl=(e,r,t)=>({[vi.TOKENISE_CARD]:{url:e+"/token/card",method:"POST"},[vi.GET_PROVIDER_INFO]:{url:e+"/info/providers/"+r,method:"GET"}});class nt extends Kt{constructor(t,s){super(t);g(this,"container",null);g(this,"iframe",null);g(this,"form",null);g(this,"debug",!1);g(this,"environment");g(this,"apiUrl","");g(this,"url","");g(this,"publicKey","");g(this,"customer",null);g(this,"billingAddress",null);g(this,"geolocation",null);g(this,"amount",0);g(this,"currency","");g(this,"createNetworkToken",!1);g(this,"vault",!1);g(this,"userSuccessMessage",On);g(this,"threeDSEnabled",!1);g(this,"threeDsProcessor",null);g(this,"fraudProcessor",null);g(this,"clickToPayProcessor",null);g(this,"tokenAuthenticationEnabled",!1);g(this,"networkTokenProviders",[]);g(this,"networkTokenOptions",{});g(this,"failureCallback",null);g(this,"successCallback",null);g(this,"validationStatusChangeCallback",null);g(this,"httpInvoker");g(this,"destroy",()=>{});this.debug=s.debug,this.environment=s.environment,this.url=s.url,this.apiUrl=s.apiUrl,this.publicKey=s.publicKey,this.failureCallback=s.onFailure||null,this.successCallback=s.onSuccess||null,this.validationStatusChangeCallback=s.onValidationStatusChangeCallback||null;const i=new Tt(s.environment,Nt(s.publicKey));this.httpInvoker=new ht(this.publicKey,s.version,i),window.addEventListener("message",this.messageHandler.bind(this))}addThreeDsProcessor(t){this.threeDsProcessor=t}addFraudProcessor(t){this.fraudProcessor=t}addClickToPayProcessor(t){this.clickToPayProcessor=t}setSuccessMessage(t){this.userSuccessMessage=t}getSuccessMessage(){return this.userSuccessMessage}cleanUp(t){var s,i;(t==null?void 0:t.id)===((s=this.container)==null?void 0:s.id)&&((i=this.destroy)==null||i.call(this),this.container=null,this.form=null,this.iframe=null,window.removeEventListener("message",this.messageHandler.bind(this)))}addCard(t,s,i,n,o,a){this.log("[addCard]",{providerId:i,amount:n,currency:o,options:a}),(a!=null&&a.createNetworkToken||a!=null&&a.tokenAuthenticationEnabled)&&(a.clickToPayEnabled=!1),a!=null&&a.clickToPayEnabled&&this.clickToPayProcessor&&(a.threeDSEnabled=!1);const c=(a==null?void 0:a.threeDSEmail)||"";this.amount=n,this.currency=o,this.vault=!!(a!=null&&a.vault),this.fraudProcessor&&(this.fraudProcessor.setAmount(n),this.fraudProcessor.setCurrency(o)),this.threeDsProcessor&&(this.threeDsProcessor.setEmail((a==null?void 0:a.threeDSEmail)||""),this.threeDsProcessor.setAmount(n),this.threeDsProcessor.setCurrency(o),this.threeDsProcessor.setClientParameters((a==null?void 0:a.clientParameters)||{})),a!=null&&a.threeDSEnabled&&(Ga(n,Be,"Missing or invalid amount",this.failureCallback),Ga(o,ct,"Missing or invalid currency",this.failureCallback),this.threeDSEnabled=!0),a!=null&&a.clickToPayEnabled&&this.clickToPayProcessor&&(this.clickToPayProcessor.setAmount(n),this.clickToPayProcessor.setCurrency(o),this.clickToPayProcessor.setCustomerInfo({...this.customer||{},email:(a==null?void 0:a.threeDSEmail)||""}),this.clickToPayProcessor.setContainer(t),this.clickToPayProcessor.init(),this.clickToPayProcessor.start()),!(a!=null&&a.clickToPayEnabled)&&this.clickToPayProcessor&&this.clickToPayProcessor.isInitialized()&&this.clickToPayProcessor.stopUsing(),this.createNetworkToken=!!(a!=null&&a.createNetworkToken),this.tokenAuthenticationEnabled=!!(a!=null&&a.tokenAuthenticationEnabled),this.networkTokenProviders=(a==null?void 0:a.networkTokenProviders)||[],this.networkTokenOptions=(a==null?void 0:a.networkTokenOptions)||{},this.container=t||null,this.form=s;const l=Fe({el:this.container,component:Ap,props:{log:this.log,iframeSrc:this.url,form:this.form,threeDSEnabled:this.threeDSEnabled},on:{load:D(this,"[addCard], onload",u=>{var d;this.iframe=u,(d=u==null?void 0:u.contentWindow)==null||d.postMessage({status:rl,environment:this.environment,debug:this.debug,publicKey:this.publicKey,providerId:i,apiUrl:this.apiUrl,amount:n,currency:o,vault:a==null?void 0:a.vault,showEmail:(a==null?void 0:a.threeDSEnabled)&&!Ds(c),visProviderId:a==null?void 0:a.visProviderId,requiredFields:a==null?void 0:a.requiredFields,clickToPayEnabled:a==null?void 0:a.clickToPayEnabled,clickToPayOptions:a==null?void 0:a.clickToPayOptions,style:(a==null?void 0:a.style)||"default"},"*")}),submit:D(this,"[addCard], onsubmit",()=>{this.log("[CardProcessor]: submit event"),Gr(),this.requestCardDetails()})}});return this.destroy=l.destroy,this}messageHandler(t){var s,i,n,o,a,c,l,u,d,h,p,m,A,E,v,M,N,S,F,O,oe,he,ae,ie,be,Ne,K,$,U,G,w,z,B,se,ce,fe,Q;if((s=t==null?void 0:t.data)!=null&&s.status){if(t.data.status===il){this.log(`[sdk][cardProcessor]: message "${t.data.status}" received`,t.data),Ye();return}if(t.data.status===sl){this.log(`[sdk][cardProcessor]: message "${t.data.status}" received`,t.data),Gr();return}if(t.data.status===up){this.log(`[sdk][cardProcessor]: message "${t.data.status}" received`,t.data),Ye(),(i=this.failureCallback)==null||i.call(this,{error:t.data.message});return}if(t.data.status===dp){this.log(`[sdk][cardProcessor]: message "${t.data.status}" received`,t.data),Ye(),(a=this.validationStatusChangeCallback)==null||a.call(this,(n=t.data.message)==null?void 0:n.status,(o=t.data.message)==null?void 0:o.message);return}if(t.data.status===nl){this.log(`[sdk][cardProcessor]: message "${t.data.status}" received`,t.data),Ye(),this.showMessage(t.data.message),(c=this.failureCallback)==null||c.call(this,{error:t.data.message});return}if(t.data.status===Xh){this.log(`[sdk][cardProcessor]: message "${t.data.status}" received`,t.data),t.stopPropagation(),this.iframe=null;const Me={token:t.data.tokenId};if((l=t.data.options)!=null&&l.cardDetails&&(Me.cardDetails=(u=t.data.options)==null?void 0:u.cardDetails),(d=t.data.options)!=null&&d.iinData&&(Me.iinData=(h=t.data.options)==null?void 0:h.iinData),(p=t.data.options)!=null&&p.clickToPay&&(Me.clickToPayData={billingAddress:(m=t.data.options)==null?void 0:m.clickToPay.billingAddress,panBin:((v=(E=(A=t.data.options)==null?void 0:A.clickToPay)==null?void 0:E.cardData)==null?void 0:v.panBin)||"",panLastFour:((S=(N=(M=t.data.options)==null?void 0:M.clickToPay)==null?void 0:N.cardData)==null?void 0:S.panLastFour)||"",scheme:((oe=(O=(F=t.data.options)==null?void 0:F.clickToPay)==null?void 0:O.cardData)==null?void 0:oe.scheme)||"",paymentCardType:((ie=(ae=(he=t.data.options)==null?void 0:he.clickToPay)==null?void 0:ae.cardData)==null?void 0:ie.paymentCardType)||""}),(be=t.data.options)!=null&&be.networkTokenAuthenticateUrl&&((Ne=t.data.options)!=null&&Ne.networkToken)){const ye=this.initTokenAuthenticationProcessor(t.data.tokenId,t.data.options.networkToken,(K=t.data.options)==null?void 0:K.networkTokenData,t.data.options.networkTokenAuthenticateUrl,($=t.data.options)==null?void 0:$.cardDetails,this.networkTokenOptions);if(ye){ye.invoke(this.amount,this.currency,(U=t.data.options)==null?void 0:U.cardDetails,D(this,"[sdk][cardProcessor], token authentication success",()=>{var ke;this.log("[sdk][cardProcessor], token authentication success"),Ye(),Ns(this.container,this.getSuccessMessage()),(ke=this.successCallback)==null||ke.call(this,Me)}),D(this,"[sdk][cardProcessor], token authentication error",ke=>{Ye(),this.log("[sdk][cardProcessor], token authentication error",ke)}));return}}Ye(),Ns(this.container,this.getSuccessMessage()),(G=this.successCallback)==null||G.call(this,Me);return}if(t.data.status==Zh){this.log(`[sdk][cardProcessor]: "${t.data.status}" message received`,t.data);const Me=!!((w=this.clickToPayProcessor)!=null&&w.isEnabled()&&((z=this.clickToPayProcessor)!=null&&z.getRememberMe()));if(Me&&!t.data.message.srcDigitalCardId&&t.data.message.cardNumber&&!((B=this.clickToPayProcessor)!=null&&B.isSchemeSupported(t.data.message.cardNumber))){this.log("[clickToPayProcessor]: checkoutWithNewCard - Scheme is not supported!"),Ye(),this.showMessage("Please use another card or use an alternative payment method");return}if(Me&&t.data.message.srcDigitalCardId){Ye(),(se=this.clickToPayProcessor)==null||se.checkoutWithCard(t.data.message,ye=>{this.log("[clickToPayProcessor]: checkoutWithCard",ye),ye.checkoutActionCode!=="CANCEL"&&ye.checkoutActionCode!=="CHANGE_CARD"&&(Gr(),this.tokenise({clickToPayInfo:{correlationId:ye.checkoutResponseData.srcCorrelationId,merchantTransactionId:ye.headers["merchant-transaction-id"],ccv:t.data.message.ccv}}))},ye=>{this.log("[clickToPayProcessor]: checkoutWithCard, error",ye),Ye()});return}if((ce=this.fraudProcessor)==null||ce.setPaymentInfo({cardNumber:t.data.message.cardNumber,expiryDate:t.data.message.expiryDate,cardholder:t.data.message.cardholder,ccv:t.data.message.ccv}),(fe=this.threeDsProcessor)==null||fe.setPaymentInfo({cardNumber:t.data.message.cardNumber,expiryDate:t.data.message.expiryDate,cardholder:t.data.message.cardholder,ccv:t.data.message.ccv}),t.data.message.email&&((Q=this.threeDsProcessor)==null||Q.setEmail(t.data.message.email)),this.fraudProcessor){Gr(),this.fraudProcessor.fraudCheck(D(this,"[fraudProcessor][fraudCheck], success",ye=>{var ke;if(ye.decision!="Approved"&&ye.stopPaymentOnFailure){Ye(),q(this.container,"Payment couldn't be processed"),(ke=this.failureCallback)==null||ke.call(this,{error:"Payment couldn't be processed"});return}this.onSubmit({cardNumber:t.data.message.cardNumber,expiryDate:t.data.message.expiryDate,cardholder:t.data.message.cardholder,ccv:t.data.message.ccv},ye)}),D(this,"[fraudProcessor][fraudCheck], error",ye=>{var ke;Ye(),q(this.container,ye.error),(ke=this.failureCallback)==null||ke.call(this,ye)}));return}this.onSubmit({cardNumber:t.data.message.cardNumber,expiryDate:t.data.message.expiryDate,cardholder:t.data.message.cardholder,ccv:t.data.message.ccv})}}}onSubmit(t,s){var n,o,a;if(this.log("[cardProcessor]: onSubmit",{fraudCheckResult:s}),!!((n=this.clickToPayProcessor)!=null&&n.isEnabled()&&((o=this.clickToPayProcessor)!=null&&o.getRememberMe()))){this.tokeniseWithClickToPay(t,void 0,s);return}if(this.threeDsProcessor){(a=this.threeDsProcessor)==null||a.threeDSInvoke(this.container,!1,c=>{Ye(),this.log("[threeDSInvoke], postAuthData",c),this.tokenise({threeDSServerTransID:c.threeDSServerTransID,fraudCheckResult:s,externalThreeDsData:c.externalThreeDsData})});return}this.tokenise({fraudCheckResult:s})}tokenise(t){var s,i,n;this.log("[cardProcessor]: tokenise",t),this.iframe&&(Gr(),(n=this.iframe.contentWindow)==null||n.postMessage({status:Bh,threeDSServerTransID:t.threeDSServerTransID,fraudCheckResult:t.fraudCheckResult,externalThreeDsData:t.externalThreeDsData,createNetworkToken:this.tokenAuthenticationEnabled||this.createNetworkToken,vault:this.vault,clickToPayInfo:t.clickToPayInfo,email:(s=this.customer)==null?void 0:s.email,phone:(i=this.customer)==null?void 0:i.phoneNumber,billingAddress:this.billingAddress,geolocation:this.geolocation},"*"))}tokeniseWithClickToPay(t,s,i){var n;Ye(),(n=this.clickToPayProcessor)==null||n.checkoutWithNewCard(t.cardNumber,t.expiryDate,t.ccv||"",!0,D(this,"[clickToPayProcessor]: checkoutWithNewCard",o=>{this.log("[clickToPayProcessor]: checkoutWithNewCard",o),o.checkoutActionCode!=="CANCEL"&&(Gr(),this.tokenise({threeDSServerTransID:s,fraudCheckResult:i,clickToPayInfo:{correlationId:o.checkoutResponseData.srcCorrelationId,merchantTransactionId:o.headers["merchant-transaction-id"],ccv:t.ccv||""}}))}),D(this,"[clickToPayProcessor]: checkoutWithNewCard, error",o=>{this.log("[clickToPayProcessor]: checkoutWithNewCard, error",o),Ye(),q(this.container,o.message)}))}setAmount(t){var s,i;this.amount=t,(s=this.clickToPayProcessor)==null||s.setAmount(t),this.iframe&&((i=this.iframe.contentWindow)==null||i.postMessage({status:Ps,amount:t},"*"))}setCurrency(t){var s,i;this.currency=t,(s=this.clickToPayProcessor)==null||s.setCurrency(t),this.iframe&&((i=this.iframe.contentWindow)==null||i.postMessage({status:ws,currency:t},"*"))}setCustomerInfo(t){var s;this.customer={...t},(s=this.clickToPayProcessor)==null||s.setCustomerInfo(t)}setBillingAddress(t){this.billingAddress={...t}}setGeolocation(t){this.geolocation={...t}}tokeniseCard(t,s,i,n,o,a,c,l){var h,p,m,A,E;if(!Be(t)){this.log("missing parameter: providerId"),(h=this.failureCallback)==null||h.call(this,{error:"missing parameter: providerId"});return}if(!Fd(s)){this.log("wrong parameter: cardNumber"),(p=this.failureCallback)==null||p.call(this,{error:"wrong parameter: cardNumber"});return}if(!$d(i)){this.log("wrong parameter: expiryDate"),(m=this.failureCallback)==null||m.call(this,{error:"wrong parameter: expiryDate"});return}if(!Gd(o)){this.log("wrong parameter: ccv"),(A=this.failureCallback)==null||A.call(this,{error:"wrong parameter: ccv"});return}const u=(v,M)=>{var N;this.log("tokeniseCardFailureCallback",v,M),Ye(),(N=this.failureCallback)==null||N.call(this,{error:"Unable to tokenise payment information"})},d=(v,M)=>{var F,O;this.log("[tokeniseCardSuccessCallback]",v,M),Ye();const N=JSON.parse(M);this.log("[tokeniseCardSuccessCallback], data",N);const S={token:N.tokenId};N.card&&(S.cardDetails={bin:N.card.cardIin,last4:String(N.card.cardNumber).slice(-4),expiryDate:N.card.expiryDate,cardholder:N.card.cardholder,scheme:(F=N.card.iinData)==null?void 0:F.scheme},S.iinData=N.card.iinData),this.fraudProcessor&&(S.fraudCheckResult=this.fraudProcessor.getCheckResult()||void 0),(O=this.successCallback)==null||O.call(this,S)};(E=this.httpInvoker)==null||E.invoke(cl(this.apiUrl,t)[vi.TOKENISE_CARD].url,cl(this.apiUrl,t)[vi.TOKENISE_CARD].method,JSON.stringify({paymentInformation:{cardNumber:s,expiryDate:i,ccv:o,cardholder:n,threeDSServerTransID:c||null},vaultCard:!0,vaultExpireSeconds:l!=null&&l.vault?null:4*3600,metadata:a,verify:l==null?void 0:l.verify,createNetworkToken:l==null?void 0:l.createNetworkToken,fraudCheck:this.fraudProcessor?this.fraudProcessor.getCheckResult():null,amount:this.amount,currency:this.currency}),d,u,{providerId:t})}initTokenAuthenticationProcessor(t,s,i,n,o,a){this.log("[initTokenAuthenticationProcessor]",{token:t,networkTokenAuthenticateUrl:n,networkTokenOptions:a});const c=((o==null?void 0:o.scheme)||"").toLowerCase(),l=this.networkTokenProviders.find(u=>u.providerType.toLowerCase()===c);switch(String(l==null?void 0:l.providerType).toLowerCase()){case"mastercard":return new Bt(this.log.bind(this),{container:this.container,token:t,networkToken:s,networkTokenData:i,redirectUrl:n,networkTokenProvider:l,environment:this.environment,publicKey:this.publicKey,apiUrl:this.apiUrl,networkTokenOptions:a});default:return this.log("Unsupported network token provider",c),null}}}I([C],nt.prototype,"cleanUp",null),I([C],nt.prototype,"addCard",null),I([C],nt.prototype,"messageHandler",null),I([C],nt.prototype,"onSubmit",null),I([C],nt.prototype,"tokenise",null),I([C],nt.prototype,"tokeniseWithClickToPay",null),I([C],nt.prototype,"setAmount",null),I([C],nt.prototype,"setCurrency",null),I([C],nt.prototype,"setCustomerInfo",null),I([C],nt.prototype,"setBillingAddress",null),I([C],nt.prototype,"setGeolocation",null),I([C],nt.prototype,"tokeniseCard",null),I([C],nt.prototype,"initTokenAuthenticationProcessor",null);const Un=te("");function Rn(){return{errorMessage:Un,showErrorMessage:t=>{Un.value=t},hideErrorMessage:()=>{Un.value=""}}}const Yr=e=>(pt("data-v-aa16d8ba"),e=e(),gt(),e),Tp={id:"payfurl-payto-form",class:"payfurl-form"},Np={key:0,class:"error text-normal"},Pp={class:"row"},wp=Yr(()=>P("label",null,"Payer Name",-1)),bp={class:"row"},vp=Yr(()=>P("label",null,"Payer Id Type",-1)),_p=[Yr(()=>P("option",{value:"PHONE"},"Phone",-1)),Yr(()=>P("option",{value:"EMAIL"},"Email",-1)),Yr(()=>P("option",{value:"ABN"},"Abn",-1))],Ep={class:"row"},Sp=Yr(()=>P("label",null," Pay Id ",-1)),kp=["placeholder"],Op={key:0,class:"small"},Lp={key:1,class:"error"},jp=Te({__name:"PayToForm",props:{log:null},emits:["submit"],setup(e,{emit:r}){const t=e,s=te({}),{isLoading:i}=et(),n=te(""),o=te("PHONE"),a=te(""),c=kt(()=>o.value==="PHONE"?"0405123456 or 0212341234":Fh(o.value.toLowerCase())),l=te(!0),{errorMessage:u}=Rn();function d(){return s.value.payId="",o.value==="PHONE"&&(mi(a.value)||(s.value.payId="Invalid phone number")),o.value==="EMAIL"&&(Ds(a.value)||(s.value.payId="Invalid email")),o.value==="ABN"&&(Yd(a.value.replace(/ /g,""))||(s.value.payId="Invalid ABN")),s.value.payId===""}function h(p){var m,A,E,v;if((m=p==null?void 0:p.data)!=null&&m.status){if(p.data.status===bi){if((A=t.log)==null||A.call(t,`[PayTo]: message "${p.data.status}" received`,p.data),!l.value||(p.stopPropagation(),t.log&&t.log("[PayTo]: form submit",{payerName:n.value,payIdType:o.value,payId:a.value}),!d()))return;r("submit",{payerName:n.value,payIdType:o.value,payId:o.value==="PHONE"?Hd(a.value):String(a.value).toLowerCase().replace(/ /g,"")})}p.data.status==="activate"&&p.data.component==="payto"&&((E=t.log)==null||E.call(t,`[PayTo]: message "${p.data.status}" received`,p.data),u.value="",l.value=!0),p.data.status==="deactivate"&&p.data.component==="payto"&&((v=t.log)==null||v.call(t,`[PayTo]: message "${p.data.status}" received`,p.data),l.value=!1)}}return Xe(()=>{window.addEventListener("message",h),window.addEventListener("keypress",function(p){p.altKey&&p.code==="KeyP"&&(p.preventDefault(),n.value="test",o.value="ABN",a.value="67384721620")}),window.postMessage({status:Er},"*")}),Ct(()=>{window.removeEventListener("message",h)}),(p,m)=>(Z(),re("div",Tp,[ft(ve(ir,null,null,512),[[_r,me(i)]]),P("div",{class:"container-form",style:lt(`visibility: ${me(i)?"hidden":"visible"}`)},[me(u)?(Z(),re("div",Np,He(me(u)),1)):Pe("",!0),P("div",Pp,[wp,P("div",null,[ft(P("input",{type:"text",maxlength:"100",placeholder:"Payer Name","onUpdate:modelValue":m[0]||(m[0]=A=>n.value=A)},null,512),[[gi,n.value]])])]),P("div",bp,[vp,P("div",null,[ft(P("select",{"onUpdate:modelValue":m[1]||(m[1]=A=>o.value=A)},_p,512),[[kd,o.value]])])]),P("div",Ep,[Sp,P("div",null,[ft(P("input",{type:"text",maxlength:"100",placeholder:me(c),"onUpdate:modelValue":m[2]||(m[2]=A=>a.value=A),onKeyup:d},null,40,kp),[[gi,a.value]]),o.value==="PHONE"?(Z(),re("div",Op,"(mobile or landline with area code)")):Pe("",!0),s.value.payId?(Z(),re("p",Lp,He(s.value.payId),1)):Pe("",!0)])])],4)]))}}),yy="",Iy="",xp=_e(jp,[["__scopeId","data-v-aa16d8ba"]]),Up=e=>(pt("data-v-f06289bf"),e=e(),gt(),e),Rp={id:"payfurl-payto-agreement",class:"payfurl-form"},zp=Up(()=>P("div",{class:"message"},"Approve the agreement in your banking app",-1)),Fp=Te({__name:"PayToAgreement",props:{debug:{type:Boolean}},setup(e){return(r,t)=>(Z(),re("div",Rp,[ve(ir),zp]))}}),Cy="",Ay="",Vp=_e(Fp,[["__scopeId","data-v-f06289bf"]]),Kr={TOKENISE:"TOKENISE",TOKEN_STATUS:"TOKEN_STATUS"},_i=(e,r)=>({[Kr.TOKENISE]:{url:e+"/token/payto",method:"POST"},[Kr.TOKEN_STATUS]:{url:e+"/token/"+r,method:"GET"}});class Br{constructor(r,t){g(this,"container",null);g(this,"debug",!1);g(this,"log");g(this,"apiUrl","");g(this,"getPaymentOptions");g(this,"options",null);g(this,"providerId","");g(this,"tokenId","");g(this,"checkAgreementHandler",null);g(this,"failureCallback",null);g(this,"successCallback",null);g(this,"httpInvoker",null);g(this,"destroy",()=>{});g(this,"successPayToHandler",D(this,"[PayTo][tokenise][successPayToHandler]",(r,t)=>{this.log("successPayToHandler",r,t);const s=JSON.parse(t);if(!s||!(s!=null&&s.tokenId))return this.failurePayToHandler(r,t);this.tokenId=s.tokenId,Fe({el:this.container,component:Vp,props:{el:this.container,log:this.log}}),this.checkAgreement()}));g(this,"failurePayToHandler",D(this,"[PayTo][tokenise][failurePayToHandler]",(r,t)=>{this.log("failurePayToHandler",r,t),et().stopLoading(),Rn().showErrorMessage("Invalid payment details")}));g(this,"failurePayToAgreementHandler",D(this,"[PayTo][tokenise][failurePayToAgreementHandler]",(r,t)=>{var s;et().stopLoading(),this.log("failurePayToAgreementHandler",r,t),q(this.container,"Agreement has been canceled"),(s=this.failureCallback)==null||s.call(this,{error:"Agreement has been canceled",body:t})}));this.log=r,this.debug=t.debug,this.apiUrl=t.apiUrl,this.getPaymentOptions=t.getPaymentOptions,this.failureCallback=t.onFailure||null,this.successCallback=t.onSuccess||null;const s=new Tt(t.environment,Nt(t.publicKey));this.httpInvoker=new ht(t.publicKey,t.version,s)}cleanUp(r){var t,s;((t=this.container)==null?void 0:t.id)===(r==null?void 0:r.id)&&((s=this.destroy)==null||s.call(this))}addPayTo(r,t,s,i){if(this.log("[addPayTo]",{amount:t,providerId:s,options:i}),this.container=r,this.providerId=s,this.options=i,!qe(t))throw q(r,"Invalid amount: "+t),new TypeError("invalid amount: "+t);if(!String(i.description).trim())throw q(r,"Invalid description"),new TypeError("invalid description");if(i.maximumAmount||(i.maximumAmount=1e3),i.maximumAmount<0||i.maximumAmount>9999)throw q(r,"Invalid maximum amount: "+i.maximumAmount),new TypeError("invalid maximumAmount: "+i.maximumAmount);const n=Fe({el:this.container,component:xp,props:{el:this.container,log:this.log},on:{submit:D(this,"[PayTo]: submit",o=>{this.log("[PayTo]: submit payto form",o),et().startLoading(),setTimeout(()=>{this.tokenise(o)},500)})}});this.destroy=n.destroy}tokenise(r){var s,i,n;const t={payerName:r.payerName,description:(s=this.options)==null?void 0:s.description,maximumAmount:(i=this.options)==null?void 0:i.maximumAmount,providerId:this.providerId,payerPayIdDetails:{payIdType:r.payIdType.toUpperCase(),payId:r.payId}};(n=this.httpInvoker)==null||n.invoke(_i(this.apiUrl)[Kr.TOKENISE].url,_i(this.apiUrl)[Kr.TOKENISE].method,JSON.stringify(t),this.successPayToHandler.bind(this),this.failurePayToHandler.bind(this))}successPayToAgreementHandler(){var r;et().stopLoading(),this.log("success agreement",this.tokenId),Ns(this.container,"PayTo Agreement Approved"),(r=this.successCallback)==null||r.call(this,{token:this.tokenId})}checkAgreement(){var r;this.checkAgreementHandler||(this.checkAgreementHandler=setInterval(this.checkAgreement.bind(this),5e3)),(r=this.httpInvoker)==null||r.invoke(_i(this.apiUrl,this.tokenId)[Kr.TOKEN_STATUS].url,_i(this.apiUrl,this.tokenId)[Kr.TOKEN_STATUS].method,{},D(this,"[checkAgreement], success",(t,s)=>{this.log("checkAgreement",t,s);const i=JSON.parse(s);if(!i)return clearInterval(this.checkAgreementHandler),this.failurePayToAgreementHandler(t,s);if(i.payToStatus!=="PENDING")return i.payToStatus==="ACTIVE"?(clearInterval(this.checkAgreementHandler),this.successPayToAgreementHandler()):(clearInterval(this.checkAgreementHandler),this.failurePayToAgreementHandler(t,""))}),D(this,"[checkAgreement], failure",(t,s)=>(this.log("checkAgreement",t,s),clearInterval(this.checkAgreementHandler),this.failurePayToAgreementHandler(t,s))))}}I([C],Br.prototype,"cleanUp",null),I([C],Br.prototype,"addPayTo",null),I([C],Br.prototype,"tokenise",null),I([C],Br.prototype,"successPayToAgreementHandler",null),I([C],Br.prototype,"checkAgreement",null);var H;(function(e){e.AZUPAY="azupay",e.SHIFT="shift",e.PAYGLOCAL="payglocal",e.PESAPAL="pesapal",e.ADDI="addi",e.AFFIRM="affirm",e.AFTERPAY="afterpay",e.ALMA="alma",e.APLAZAME="aplazame",e.APLAZO="aplazo",e.ATOME="atome",e.BILLEASE="billease",e.CASHEW="cashew",e.CASHPRESSO="cashpresso",e.CLEARPAY="clearpay",e.CLEO="cleo",e.DANA="dana",e.EASYPAISA="easypaisa",e.FINVERO="finvero",e.FUPAY="fupay",e.GCASG="gcasg",e.GRABPAY="grabpay",e.HUMM="humm",e.KAKAOPAY="kakaopay",e.KLARNA="klarna",e.KUESKIPAY="kueskipay",e.LARA="lara",e.LATITUDEPAY="latitudepay",e.LAYBUY="laybuy",e.LIMEPAY="limepay",e.PACE="pace",e.PAGALEVE="pagaleve",e.PARIBAS="paribas",e.PAYWITHFOUR="paywithfour",e.PAYJUSTNOW="payjustnow",e.PAYTM="paytm",e.PAYBRIGHT="paybright",e.PAYFLEX="payflex",e.PAYRIGHT="payright",e.POSTPAY="postpay",e.RATEPAY="ratepay",e.RIVERTY="riverty",e.SCALAPAY="scalapay",e.SEZZLE="sezzle",e.SHOPBACK="shopback",e.SMARTPAY="smartpay",e.SOFINCO="sofinco",e.SPLITIT="splitit",e.TABBY="tabby",e.TAMARA="tamara",e.TENDOPAY="tendopay",e.TOUCHNGO="touchngo",e.TRIPLEA="triplea",e.TRUEMONEY="truemoney",e.TWISTO="twisto",e.UPLIFT="uplift",e.VALU="valu",e.ZEST="zest",e.ZIP="zip",e.ZOODPAY="zoodpay",e.BKASH="bkash",e.ERATY="eraty",e.PAYBYACCOUNT="pay_by_account",e.UPI="upi"})(H||(H={}));const zn={[H.AZUPAY]:{name:"PayID",description:"",buttonTitle:"Pay with PayID",icon:"PayId"},[H.SHIFT]:{name:"Shift",description:"",buttonTitle:"Pay with Shift",icon:"Shift"},[H.PAYGLOCAL]:{name:"PayGLocal",description:"",buttonTitle:"Pay with PayGLocal",icon:"PayGLocal"},[H.PESAPAL]:{name:"PesaPal",description:"",buttonTitle:"Pay with PesaPal",icon:"Pesapal"},[H.PAYBYACCOUNT]:{name:"Pay By Account",description:"",buttonTitle:"Pay with Pay By Account",icon:"PayByAccount"},[H.UPI]:{name:"UPI",description:"",buttonTitle:"Pay with UPI",icon:"Upi"},[H.ADDI]:{name:"Addi",description:"",buttonTitle:"Pay with Addi",icon:"Addi"},[H.AFFIRM]:{name:"Affirm",description:"",buttonTitle:"Pay with Affirm",icon:"Affirm"},[H.AFTERPAY]:{name:"Afterpay",description:"",buttonTitle:"Pay with Afterpay",icon:"Afterpay"},[H.ALMA]:{name:"Alma",description:"",buttonTitle:"Pay with Alma",icon:"Alma"},[H.APLAZAME]:{name:"Aplazame",description:"",buttonTitle:"Pay with Aplazame",icon:"Aplazame"},[H.APLAZO]:{name:"Aplazo",description:"",buttonTitle:"Pay with Aplazo",icon:"Aplazo"},[H.ATOME]:{name:"Atome",description:"",buttonTitle:"Pay with Atome",icon:"Atome"},[H.BILLEASE]:{name:"Billease",description:"",buttonTitle:"Pay with Billease",icon:"Billease"},[H.CASHEW]:{name:"Cashew",description:"",buttonTitle:"Pay with Cashew",icon:"Cashew"},[H.CASHPRESSO]:{name:"Cashpresso",description:"",buttonTitle:"Pay with Cashpresso",icon:"Cashpresso"},[H.CLEARPAY]:{name:"Clearpay",description:"",buttonTitle:"Pay with Clearpay",icon:"Clearpay"},[H.CLEO]:{name:"Cleo",description:"",buttonTitle:"Pay with Cleo",icon:"Cleo"},[H.DANA]:{name:"Dana",description:"",buttonTitle:"Pay with Dana",icon:"Dana"},[H.EASYPAISA]:{name:"Easypaisa",description:"",buttonTitle:"Pay with Easypaisa",icon:"Easypaisa"},[H.FINVERO]:{name:"Finvero",description:"",buttonTitle:"Pay with Finvero",icon:"Finvero"},[H.FUPAY]:{name:"FuPay",description:"",buttonTitle:"Pay with FuPay",icon:"Fupay"},[H.GCASG]:{name:"GCasg",description:"",buttonTitle:"Pay with GCasg",icon:"Gcasg"},[H.GRABPAY]:{name:"GrabPay",description:"",buttonTitle:"Pay with GrabPay",icon:"Grabpay"},[H.HUMM]:{name:"Humm",description:"",buttonTitle:"Pay with Humm",icon:"Humm"},[H.KAKAOPAY]:{name:"KakaoPay",description:"",buttonTitle:"Pay with KakaoPay",icon:"Kakaopay"},[H.KLARNA]:{name:"Klarna",description:"",buttonTitle:"Pay with Klarna",icon:"Klarna"},[H.KUESKIPAY]:{name:"KueskiPay",description:"",buttonTitle:"Pay with KueskiPay",icon:"Kueskipay"},[H.LARA]:{name:"Lara",description:"",buttonTitle:"Pay with Lara",icon:"Lara"},[H.LATITUDEPAY]:{name:"LatitudePay",description:"",buttonTitle:"Pay with LatitudePay",icon:"Latitudepay"},[H.LAYBUY]:{name:"Laybuy",description:"",buttonTitle:"Pay with Laybuy",icon:"Laybuy"},[H.LIMEPAY]:{name:"Limepay",description:"",buttonTitle:"Pay with Limepay",icon:"Limepay"},[H.PACE]:{name:"Pace",description:"",buttonTitle:"Pay with Pace",icon:"Pace"},[H.PAGALEVE]:{name:"Pagaleve",description:"",buttonTitle:"Pay with Pagaleve",icon:"Pagaleve"},[H.PARIBAS]:{name:"BNP Paribas",description:"",buttonTitle:"Pay with BNP Paribas",icon:"Paribas"},[H.PAYWITHFOUR]:{name:"Pay With Four",description:"",buttonTitle:"Pay with Pay With Four",icon:"Paywithfour"},[H.PAYJUSTNOW]:{name:"PayJustNow",description:"",buttonTitle:"Pay with PayJustNow",icon:"Payjustnow"},[H.PAYTM]:{name:"PayTM",description:"",buttonTitle:"Pay with PayTM",icon:"Paytm"},[H.PAYBRIGHT]:{name:"Paybright",description:"",buttonTitle:"Pay with Paybright",icon:"Paybright"},[H.PAYFLEX]:{name:"Payflex",description:"",buttonTitle:"Pay with Payflex",icon:"Payflex"},[H.PAYRIGHT]:{name:"Payright",description:"",buttonTitle:"Pay with Payright",icon:"Payright"},[H.POSTPAY]:{name:"Postpay",description:"",buttonTitle:"Pay with Postpay",icon:"Postpay"},[H.RATEPAY]:{name:"Ratepay",description:"",buttonTitle:"Pay with Ratepay",icon:"Ratepay"},[H.RIVERTY]:{name:"Riverty",description:"",buttonTitle:"Pay with Riverty",icon:"Riverty"},[H.SCALAPAY]:{name:"Scalapay",description:"",buttonTitle:"Pay with Scalapay",icon:"Scalapay"},[H.SEZZLE]:{name:"Sezzle",description:"",buttonTitle:"Pay with Sezzle",icon:"Sezzle"},[H.SHOPBACK]:{name:"ShopBack",description:"",buttonTitle:"Pay with ShopBack",icon:"Shopback"},[H.SMARTPAY]:{name:"Smartpay",description:"",buttonTitle:"Pay with Smartpay",icon:"Smartpay"},[H.SOFINCO]:{name:"Sofinco",description:"",buttonTitle:"Pay with Sofinco",icon:"Sofinco"},[H.SPLITIT]:{name:"Splitit",description:"",buttonTitle:"Pay with Splitit",icon:"Splitit"},[H.TABBY]:{name:"Tabby",description:"",buttonTitle:"Pay with Tabby",icon:"Tabby"},[H.TAMARA]:{name:"Tamara",description:"",buttonTitle:"Pay with Tamara",icon:"Tamara"},[H.TENDOPAY]:{name:"Tendopay",description:"",buttonTitle:"Pay with Tendopay",icon:"Tendopay"},[H.TOUCHNGO]:{name:"Touch'n Go",description:"",buttonTitle:"Pay with Touch'n Go",icon:"Touchngo"},[H.TRIPLEA]:{name:"Triple-A",description:"",buttonTitle:"Pay with Triple-A",icon:"Triplea"},[H.TRUEMONEY]:{name:"TrueMoney",description:"",buttonTitle:"Pay with TrueMoney",icon:"Truemoney"},[H.TWISTO]:{name:"Twisto",description:"",buttonTitle:"Pay with Twisto",icon:"Twisto"},[H.UPLIFT]:{name:"Uplift",description:"",buttonTitle:"Pay with Uplift",icon:"Uplift"},[H.VALU]:{name:"ValU",description:"",buttonTitle:"Pay with ValU",icon:"Valu"},[H.ZEST]:{name:"Zest Money",description:"",buttonTitle:"Pay with Zest Money",icon:"Zest"},[H.ZIP]:{name:"Zip",description:"",buttonTitle:"Pay with Zip",icon:"Zip"},[H.ZOODPAY]:{name:"Zoodpay",description:"",buttonTitle:"Pay with Zoodpay",icon:"Zoodpay"},[H.BKASH]:{name:"bKash",description:"",buttonTitle:"Pay with bKash",icon:"Bkash"},[H.ERATY]:{name:"eRaty",description:"",buttonTitle:"Pay with eRaty",icon:"Eraty"}},My="",$p={},Hp=e=>(pt("data-v-d7e8386b"),e=e(),gt(),e),Gp={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48"},Yp=[Hp(()=>P("polygon",{points:"39 10.44 37.56 9 24 22.56 10.44 9 9 10.44 22.56 24 9 37.56 10.44 39 24 25.44 37.56 39 39 37.56 25.44 24 39 10.44"},null,-1))];function Kp(e,r){return Z(),re("svg",Gp,Yp)}const Ei=_e($p,[["render",Kp],["__scopeId","data-v-d7e8386b"]]),Bp=["onMousedown"],Wp={class:"modal-header"},Zp=["onClick"],Qp={class:"main-title"},Xp={class:"modal-body"},Jp={key:0,class:"modal-footer"},qp=Te({__name:"Modal",props:{width:null,height:null,mode:null,backdrop:null},emits:["close"],setup(e,{emit:r}){const t=e;function s(){r("close")}function i(){t.backdrop!=="static"&&s()}const n=cd(),o=kt(()=>!!n.footer),a=kt(()=>{const l=[];return t.width&&l.push(`width: ${t.width}`),t.height&&l.push(`height: ${t.height}`),l.join(";")}),c=kt(()=>t.mode=="confirm"?"small":"");return(l,u)=>(Z(),re("div",{class:"modal-mask",onMousedown:vn(i,["self"])},[P("div",{class:es(["modal-wrapper",me(c)]),role:"document",onClick:u[0]||(u[0]=vn(()=>{},["stop"]))},[P("div",{class:"modal-content",style:lt(me(a))},[P("div",Wp,[P("div",{class:"close-icon",onClick:vn(s,["stop"])},[ve(Ei,{size:15})],8,Zp),P("div",Qp,[ii(l.$slots,"title",{},void 0,!0)])]),P("div",Xp,[ii(l.$slots,"body",{},void 0,!0)]),me(o)?(Z(),re("div",Jp,[ii(l.$slots,"footer",{},void 0,!0)])):Pe("",!0),ii(l.$slots,"default",{},void 0,!0)],4)],2)],40,Bp))}}),Ty="",ul=_e(qp,[["__scopeId","data-v-2b2c8fc7"]]),eg=["src"],tg=Te({__name:"CheckoutPopup",props:{url:null,name:null},emits:["close"],setup(e,{emit:r}){const t=e,s=te(t.url);return te(null),Cr(()=>t.url,i=>{s.value=i}),Xe(()=>{}),(i,n)=>(Z(),Pr(ul,{width:"80vw",height:"80vh",backdrop:"static",onClose:n[0]||(n[0]=o=>r("close"))},{title:$r(()=>[Cn(He(e.name),1)]),body:$r(()=>[P("iframe",{src:s.value,sandbox:"allow-same-origin allow-scripts allow-popups allow-forms"},null,8,eg)]),_:1}))}}),Ny="",Py="",rg=_e(tg,[["__scopeId","data-v-5d26ad8f"]]),sg=["id"],ig={key:0,class:"error text-normal"},ng={class:"row"},og={key:1,class:"error"},ag=Te({__name:"CheckoutForm",props:{log:null,providerType:null,options:null},emits:["activate","popup","popupClose","close","newWindow","newWindowClose"],setup(e,{emit:r}){const t=e,s=te(null),{isLoading:i}=et(),n=te(!0),o=te(t.providerType),a=te(""),c=te(null),{errorMessage:l}=Rn(),u=kt(()=>{var M;return((M=zn[o.value])==null?void 0:M.buttonTitle)||`Pay with ${o.value}`}),d=kt(()=>{var S,F;const M=((F=(S=c.value)==null?void 0:S.gatewayTransactionData)==null?void 0:F.RedirectUrl)||"";if(!M)return"";if(o.value===H.PAYBYACCOUNT)return M;const N=M.includes("?")?"&":"?";return`${M}${N}embedded=true`}),h=te(!1),p=te(!1),m=kt(()=>d.value&&!h.value&&!p.value);function A(M){var N,S,F,O,oe,he,ae,ie,be,Ne;if((N=M==null?void 0:M.data)!=null&&N.status){if(M.data.status==="activate"&&M.data.component==="checkout"&&M.data.providerType===o.value&&((S=t.log)==null||S.call(t,`[Checkout]: message "${M.data.status}" received`,M.data),n.value=!0,r("activate",t.options)),M.data.status==="deactivate"&&M.data.component==="checkout"&&M.data.providerType===o.value&&((F=t.log)==null||F.call(t,`[Checkout]: message "${M.data.status}" received`,M.data),n.value=!1),M.data.status===wi&&M.data.component==="checkout"&&M.data.providerType===o.value&&((O=t.log)==null||O.call(t,`[Checkout]: message "${M.data.status}" received`,M.data),l.value="",c.value=M.data.checkoutData,(oe=t.log)==null||oe.call(t,"[BNPL]: checkout",c.value),window.postMessage({status:Er},"*")),M.data.status==="message"&&M.data.component==="checkout"&&M.data.providerType===o.value&&((he=t.log)==null||he.call(t,`[Checkout]: message "${M.data.status}" received`,M.data),a.value=M.data.message,p.value=!1,h.value=!1),M.data.status==="error"&&M.data.component==="checkout"&&M.data.providerType===o.value&&((ae=t.log)==null||ae.call(t,`[Checkout]: message "${M.data.status}" received`,M.data),a.value=M.data.error,M.data.originalError)){const K=JSON.parse(M.data.originalError);K!=null&&K.message&&(a.value=K.message)}M.data.status==="redirect"&&M.data.component==="checkout"&&((ie=t.log)==null||ie.call(t,`[Checkout]: message "${M.data.status}" received`,M.data),h.value=!1,M.data.result==="failed"&&(a.value="Payment has been canceled",v())),M.data.component==="checkout"&&M.data.providerType===H.PAYBYACCOUNT&&(M.data.status==="failure"?((be=t.log)==null||be.call(t,"[BNPL][PayByAccount]: message received",M.data),a.value=M.data.error,r("newWindowClose")):M.data.status==="success"&&((Ne=t.log)==null||Ne.call(t,"[BNPL][PayByAccount]: message received",M.data),l.value=""))}}function E(){var M,N,S;if(a.value="",o.value===H.PAYBYACCOUNT){(M=t.log)==null||M.call(t,"PayByAccount opens a new window");let F=400,O=645,oe=screen.width<F?0:(screen.width-F)/2,he=screen.height<O?0:(screen.height-O)/2;window.open(d.value,"_blank","popup=yes, width="+F+", height="+O+", left="+oe+", top="+he),r("newWindow",(N=c.value)==null?void 0:N.externalId)}else h.value=!0,p.value=!0,r("popup",(S=c.value)==null?void 0:S.externalId);return!1}function v(){h.value=!1,p.value=!1,r("popupClose")}return Xe(()=>{window.addEventListener("message",A),yi(s.value,Ts)||(n.value=!0,r("activate",t.options))}),Ct(()=>{window.removeEventListener("message",A)}),(M,N)=>(Z(),re(Le,null,[ft(ve(ir,{"use-local":""},null,512),[[_r,!me(d)]]),p.value&&!h.value?(Z(),Pr(ir,{key:0,message:"Finalise the payment"})):Pe("",!0),P("div",{id:`payfurl-${o.value}-form`,class:"payfurl-checkout-form",ref_key:"root",ref:s},[P("div",{class:"container-form",style:lt(`visibility: ${me(i)?"hidden":"visible"}`)},[me(l)?(Z(),re("div",ig,He(me(l)),1)):Pe("",!0),P("div",ng,[me(m)?(Z(),re("button",{key:0,onClick:E,type:"button"},He(me(u)),1)):Pe("",!0),a.value?(Z(),re("p",og,He(a.value),1)):Pe("",!0)])],4)],8,sg),h.value?(Z(),Pr(rg,{key:1,onClose:v,url:me(d),name:me(u)},null,8,["url","name"])):Pe("",!0)],64))}}),wy="",by="",lg=_e(ag,[["__scopeId","data-v-83de843a"]]),Wr={CHECKOUT:"CHECKOUT",CHECK_STATUS:"CHECK_STATUS"},Si=(e,r)=>({[Wr.CHECKOUT]:{url:e+"/payment_method/checkout",method:"POST"},[Wr.CHECK_STATUS]:{url:e+"/checkout/external/"+r,method:"GET"}});class xt{constructor(r,t){g(this,"container",null);g(this,"debug",!1);g(this,"log");g(this,"apiUrl","");g(this,"redirectUrl","");g(this,"checkStatusHandler",null);g(this,"failureCallback",null);g(this,"successCallback",null);g(this,"httpInvoker",null);g(this,"destroy",()=>{});this.log=r,this.debug=t.debug,this.apiUrl=t.apiUrl,this.redirectUrl=t.redirectUrl,this.failureCallback=t.onFailure||null,this.successCallback=t.onSuccess||null;const s=new Tt(t.environment,Nt(t.publicKey));this.httpInvoker=new ht(t.publicKey,t.version,s)}cleanUp(r){var t,s;((t=this.container)==null?void 0:t.id)===(r==null?void 0:r.id)&&((s=this.destroy)==null||s.call(this))}addCheckout(r,t,s,i,n,o,a){this.log(`[addCheckout][${i}]`,{amount:t,providerId:n,providerType:i,options:o,checkoutOptions:a}),this.container=r;let c=!1,l;const u=Fe({el:r,component:lg,props:{log:this.log,providerType:i,options:{providerId:n,amount:t,currency:s,checkoutOptions:a}},on:{activate:D(this,"[sdk][checkoutProcessor][${providerType}]: activate checkout form",d=>{if(c)return;c=!0,this.log(`[sdk][checkoutProcessor][${i}]: activate checkout form`,d);const h=()=>{c=!1};this.checkout(d,i,o,h),l=this.getMessageHandler(d,i,o,h).bind(this),window.addEventListener("message",l)}),popup:D(this,"[sdk][checkoutProcessor][${providerType}]: popup open",d=>{this.log(`[sdk][checkoutProcessor][${i}]: popup open`,d),this.checkStatus(r,d,i,l)}),popupClose:D(this,"[sdk][checkoutProcessor][${providerType}]: popup close",()=>{this.log(`[sdk][checkoutProcessor][${i}]: popup close`),this.stopCheckingStatus(null)}),newWindow:D(this,"[sdk][checkoutProcessor][${providerType}]: new window open",d=>{this.log(`[sdk][checkoutProcessor][${i}]: new window open`,d),this.checkStatus(r,d,i,l)}),newWindowClose:D(this,"[sdk][checkoutProcessor][${providerType}]: new window close",()=>{this.log(`[sdk][checkoutProcessor][${i}]: new window close`),this.stopCheckingStatus(null)})}});this.destroy=u.destroy}checkout(r,t,s,i){var n,o,a,c,l,u,d,h,p,m,A,E,v,M;(M=this.httpInvoker)==null||M.invoke(Si(this.apiUrl)[Wr.CHECKOUT].url,Si(this.apiUrl)[Wr.CHECKOUT].method,JSON.stringify({providerId:r.providerId,amount:r.amount,currency:r.currency,shippingAmount:s.shippingAmount,customer:{firstName:(n=s.customer)==null?void 0:n.firstName,lastName:(o=s.customer)==null?void 0:o.lastName,email:(a=s.customer)==null?void 0:a.email,phone:(c=s.customer)==null?void 0:c.phoneNumber,billingAddress:{name:((l=s.billingAddress)==null?void 0:l.firstName)+" "+((u=s.billingAddress)==null?void 0:u.lastName),addressLine1:(d=s.billingAddress)==null?void 0:d.streetAddress,addressLine2:(h=s.billingAddress)==null?void 0:h.streetAddress2,suburb:(p=s.billingAddress)==null?void 0:p.region,state:(m=s.billingAddress)==null?void 0:m.state,countryCode:(A=s.billingAddress)==null?void 0:A.country,postcode:(E=s.billingAddress)==null?void 0:E.postalCode}},items:(v=s.orderItems)==null?void 0:v.map(N=>({name:N.name,reference:N.sku,quantity:N.quantity,amount:N.totalAmount})),options:{...r.checkoutOptions,redirectUrl:this.redirectUrl}}),this.getSuccessCheckoutHandler(t).bind(this),D(this,"[sdk][checkoutProcessor][${providerType}]: failureCheckoutHandler",(N,S)=>{i==null||i(N,S),this.getFailureCheckoutHandler(t).bind(this)(N,S)}))}getSuccessCheckoutHandler(r){return D(this,"[sdk][checkoutProcessor][${providerType}]: successCheckoutHandler",(t,s)=>{this.log(`[sdk][checkoutProcessor][${r}]: successCheckoutHandler`,t,s);const i=JSON.parse(s),n=JSON.parse(window.atob(i.checkoutData));window.postMessage({status:wi,component:"checkout",providerType:r,checkoutData:n},"*")})}getFailureCheckoutHandler(r){return D(this,"[sdk][checkoutProcessor][${providerType}]: failureCheckoutHandler",(t,s)=>{this.log(`[sdk][checkoutProcessor][${r}]: failureCheckoutHandler`,t,s),et().stopLoading(),window.postMessage({status:"error",component:"checkout",providerType:r,error:"Invalid payment details",originalError:s},"*")})}stopCheckingStatus(r){this.checkStatusHandler&&(clearInterval(this.checkStatusHandler),this.checkStatusHandler=null),r&&window.removeEventListener("message",r)}checkStatus(r,t,s,i){var c;this.checkStatusHandler||(this.checkStatusHandler=setInterval(this.checkStatus.bind(this,r,t,s,i),5e3),this.log(`[sdk][checkoutProcessor][${s}]: Starting polling...`));const n=this,o=D(this,`[sdk][checkoutProcessor][${s}]: failureCheckStatusHandler`,(l,u)=>{et().stopLoading(),n.log(`[sdk][checkoutProcessor][${s}]: failureCheckStatusHandler`,l,u),window.postMessage({status:"message",component:"checkout",providerType:s,message:"Checkout has been cancelled"},"*")}),a=D(this,`[sdk][checkoutProcessor][${s}]: successCheckStatusHandler`,(l,u)=>{var h;et().stopLoading(),n.log(`[sdk][checkoutProcessor][${s}]: successCheckStatusHandler`,{transactionId:l,token:u}),Ns(r,"Transaction in progress. Please don't close the window or navigate away");const d={};l&&(d.transactionId=l),u&&(d.token=u),(h=n.successCallback)==null||h.call(n,d)});(c=this.httpInvoker)==null||c.invoke(Si(this.apiUrl,t)[Wr.CHECK_STATUS].url,Si(this.apiUrl,t)[Wr.CHECK_STATUS].method,{},D(this,`[sdk][checkoutProcessor][${s}]: checkStatus, success`,(l,u)=>{const d=JSON.parse(u);if(this.log("checkoutStatus",d),!d)return this.stopCheckingStatus(i),o(l,u);if(d.status=="SUCCESS"&&d.status==="SUCCESS")return this.stopCheckingStatus(i),a(d.transactionId,d.tokenId)}),D(this,`[sdk][checkoutProcessor][${s}]: checkStatus, failure`,(l,u)=>(this.log(`[sdk][checkoutProcessor][${s}]: checkStatus`,{status:l,body:u}),this.stopCheckingStatus(i),o(l,u))))}validateOptions(r,t,s,i){var n,o,a,c,l,u,d,h,p,m,A,E,v,M,N,S,F,O,oe;if(!ct(s))throw q(r,"Invalid currency: "+s),new TypeError("Invalid currency: "+s);if(!qe(t))throw q(r,"Invalid amount: "+t),new TypeError("Invalid amount: "+t);if(!Array.isArray(i.orderItems)||((n=i.orderItems)==null?void 0:n.length)===0)throw q(r,"Invalid order"),new TypeError("Invalid order");if(!((o=i.customer)!=null&&o.email)||!Ds((a=i.customer)==null?void 0:a.email))throw q(r,"Invalid customer email"),new TypeError("Invalid customer email");if(!((c=i.customer)!=null&&c.firstName)&&!((l=i.customer)!=null&&l.lastName))throw q(r,"Invalid customer name"),new TypeError("Invalid customer name");if(!((u=i.customer)!=null&&u.phoneNumber)||!mi((d=i.customer)==null?void 0:d.phoneNumber))throw q(r,"Invalid customer phone number"),new TypeError("Invalid customer phone number");if(!((h=i.billingAddress)!=null&&h.email)||!Ds((p=i.billingAddress)==null?void 0:p.email))throw q(r,"Invalid billing address email"),new TypeError("Invalid billing address email");if(!((m=i.billingAddress)!=null&&m.firstName)&&!((A=i.billingAddress)!=null&&A.lastName))throw q(r,"Invalid billing address name"),new TypeError("Invalid billing address name");if(!((E=i.billingAddress)!=null&&E.phoneNumber)||!mi((v=i.billingAddress)==null?void 0:v.phoneNumber))throw q(r,"Invalid billing address phone number"),new TypeError("Invalid billing address phone number");if(!((M=i.billingAddress)!=null&&M.streetAddress))throw q(r,"Invalid billing street address"),new TypeError("Invalid billing street address");if(!((N=i.billingAddress)!=null&&N.city))throw q(r,"Invalid billing city"),new TypeError("Invalid billing city");if(!((S=i.billingAddress)!=null&&S.country))throw q(r,"Invalid billing country"),new TypeError("Invalid billing country");if(!((F=i.billingAddress)!=null&&F.region))throw q(r,"Invalid billing region"),new TypeError("Invalid billing region");if(!((O=i.billingAddress)!=null&&O.state))throw q(r,"Invalid billing state"),new TypeError("Invalid billing state");if(!((oe=i.billingAddress)!=null&&oe.postalCode))throw q(r,"Invalid billing postal code"),new TypeError("Invalid billing postal code")}getMessageHandler(r,t,s,i){return D(this,`[sdk][checkoutProcessor][${t}]: message received`,n=>{var o;if((o=n==null?void 0:n.data)!=null&&o.status){if(n.data.status===Ps){if(Number(r.amount)==Number(n.data.amount))return;this.log(`[sdk][checkoutProcessor][${t}]: message received`,n.data),r.amount=Number(n.data.amount),this.checkout(r,t,s,i);return}if(n.data.status===ws){if(r.currency==n.data.currency)return;this.log(`[sdk][checkoutProcessor][${t}]: message received`,n.data),r.currency=n.data.currency,this.checkout(r,t,s,i);return}}})}}I([C],xt.prototype,"cleanUp",null),I([C],xt.prototype,"addCheckout",null),I([C],xt.prototype,"checkout",null),I([C],xt.prototype,"getSuccessCheckoutHandler",null),I([C],xt.prototype,"getFailureCheckoutHandler",null),I([C],xt.prototype,"stopCheckingStatus",null),I([C],xt.prototype,"checkStatus",null),I([C],xt.prototype,"validateOptions",null),I([C],xt.prototype,"getMessageHandler",null);const Wt={name:"@payfurl/client",private:!1,version:"4.6.16",files:["dist/sdk"],main:"./dist/sdk/payfurl.umd.js",module:"./dist/sdk/payfurl.es.js",types:"./dist/sdk/payfurl.d.ts",exports:{".":{import:"./dist/sdk/payfurl.es.js",require:"./dist/sdk/payfurl.umd.js"}},scripts:{dev:"vite -c vite.iframe.config.ts","build-iframe":"vite build -c vite.iframe.config.ts --emptyOutDir","build-sdk":"vite build -c vite.sdk.config.ts","build-all":"npm run build-iframe && npm run build-sdk",preview:"vite preview",server:"python3 -m http.server 3001",test:"jest"},dependencies:{dayjs:"^1.11.7",vue:"^3.2.47"},devDependencies:{"@babel/preset-env":"^7.24.8","@babel/types":"^7.21.2","@rollup/plugin-typescript":"^11.0.0","@types/applepayjs":"^14.0.0","@types/jest":"^29.5.12","@types/jest-when":"^3.5.5","@types/node":"^18.14.2","@vitejs/plugin-vue":"^4.0.0","@vue/eslint-config-prettier":"^7.1.0","@vue/eslint-config-typescript":"^11.0.2","@vue/vue3-jest":"^29.2.6",eslint:"^8.35.0","eslint-plugin-vue":"^9.9.0",jest:"^29.7.0","jest-environment-jsdom":"^29.7.0","jest-when":"^3.6.0","js-crypto-aes":"^1.0.6",prettier:"^2.8.4","rollup-plugin-visualizer":"^5.12.0","ts-jest":"^29.2.3","ts-node":"^10.9.2",typescript:"^4.9.5",vite:"^4.1.4","vue-tsc":"^1.2.0"}},Fn={CHECK_FRAUD:"CHECK_FRAUD"},dl=e=>({[Fn.CHECK_FRAUD]:{url:e+"/fraud_check",method:"POST"}});class hl{constructor(r,t){g(this,"providerId","");g(this,"stopPaymentOnFailure",!1);g(this,"debug",!1);g(this,"log");g(this,"apiUrl","");g(this,"getFraudCheckData");g(this,"metadata",{});g(this,"amount",0);g(this,"currency","AUD");g(this,"address",null);g(this,"customer",null);g(this,"order",null);g(this,"paymentInformation",null);g(this,"paypalInformation",null);g(this,"failureCallback",null);g(this,"successCallback",null);g(this,"checkResult",null);g(this,"httpInvoker",null);this.log=r,this.providerId=t.providerId,this.stopPaymentOnFailure=t.stopPaymentOnFailure,this.debug=t.debug,this.apiUrl=t.apiUrl,this.metadata=t.metadata,this.getFraudCheckData=t.getFraudCheckData,this.failureCallback=t.onFailure||null,this.successCallback=t.onSuccess||null;const s=new Tt(t.environment,Nt(t.publicKey));this.httpInvoker=new ht(t.publicKey,t.version,s)}fraudCheck(r,t){var s;if(!this.customer)return t({error:"Customer information is required"});if(!this.address)return t({error:"Address information is required"});if(!this.order)return t({error:"Order information is required"});if(!this.paymentInformation&&!this.paypalInformation)return t({error:"Payment information is required"});this.log("[fraudCheck]",{amount:this.amount,currency:this.currency,paymentInformation:this.paymentInformation,paypalInformation:this.paypalInformation,customer:this.customer,address:this.address,order:this.order,metadata:this.metadata}),(s=this.httpInvoker)==null||s.invoke(dl(this.apiUrl)[Fn.CHECK_FRAUD].url,dl(this.apiUrl)[Fn.CHECK_FRAUD].method,this.getFraudCheckData(this.providerId,this.amount,this.currency,this.paymentInformation,this.paypalInformation,this.customer,this.address,this.order,this.metadata),D(this,"[fraudCheck], success",(i,n)=>{if(this.log("[fraudCheck], success",i,n,this.stopPaymentOnFailure),this.checkResult=JSON.parse(n),this.checkResult===null)return t({error:"Fraud Check Failed",body:n});this.checkResult.providerId=this.providerId,this.checkResult.stopPaymentOnFailure=this.stopPaymentOnFailure,r(this.checkResult)}),D(this,"[fraudCheck], failure",(i,n)=>{this.log("[fraudCheck], failure",i,n),t({error:"Fraud Check Failed",body:n})}))}setAmount(r){this.amount=r}setCurrency(r){this.currency=r}setAddressInfo(r){this.address={...r}}setCustomerInfo(r){this.customer={...r}}setOrderInfo(r){this.order={...r}}setPaymentInfo(r){this.paymentInformation={...r}}setPaypalInfo(r){this.paypalInformation={...r}}getProviderId(){return this.providerId}getCheckResult(){return this.checkResult}}I([C],hl.prototype,"fraudCheck",null);const cg={style:{position:"relative"}},ug={key:0,class:"error text-normal"},dg=Te({__name:"GooglePayForm",props:{log:null,el:null,environment:null,amount:null,currency:null,options:null},emits:["complete","activate","close","error"],setup(e,{emit:r}){const t=e,s="payfurl-googlepay-script",i=te(null),n=te(t.amount),o=te(t.currency),a=te(!0),c=te("");let l=!1;const{isLoading:u}=et();function d(){if(l)return;if(l=!0,document.getElementById(s)){S();return}window.google=null;const O=document.createElement("script");O.src="https://pay.google.com/gp/p/js/pay.js",O.type="text/javascript",O.id=s,O.onload=S,document.body.appendChild(O)}let h=null;function p(){return h===null&&(h=new window.google.payments.api.PaymentsClient({environment:t.environment!=$e.PRODUCTION?"TEST":"PRODUCTION"})),h}const m={type:"CARD",parameters:{allowedAuthMethods:["PAN_ONLY","CRYPTOGRAM_3DS"],allowedCardNetworks:["AMEX","DISCOVER","INTERAC","JCB","MASTERCARD","VISA"]}};function A(){return{apiVersion:2,apiVersionMinor:0,allowedPaymentMethods:[m]}}function E(){const oe=p().createButton({onClick:M});t.el.appendChild(oe)}function v(){return t.environment!=$e.PRODUCTION?{merchantName:t.options.googlePayMerchantName??"Example Merchant"}:{merchantName:t.options.googlePayMerchantName??"Example Merchant",merchantId:t.options.googlePayMerchantId}}function M(){const O=N(),oe=p();t.log("[paymentData], request",O),oe.loadPaymentData(O).then(function(he){t.log("[paymentData], success",he);const ae=JSON.parse(he.paymentMethodData.tokenizationData.token);he.paymentMethodData.tokenizationData={...he.paymentMethodData.tokenizationData,...ae},r("complete",he)}).catch(function(he){t.log("[paymentData], error",he),r("error",he.message)})}function N(){return{apiVersion:2,apiVersionMinor:0,allowedPaymentMethods:[{...m,tokenizationSpecification:{type:"PAYMENT_GATEWAY",parameters:{gateway:t.options.gateway,gatewayMerchantId:t.options.googlePayGatewayMerchantId}}}],transactionInfo:{totalPriceStatus:"FINAL",countryCode:"AU",currencyCode:o.value,totalPrice:Number(n.value).toFixed(2)},merchantInfo:v()}}function S(){p().isReadyToPay(A()).then(function(oe){oe.result&&(E(),window.postMessage({status:Er},"*"))}).catch(function(oe){console.error("Load GooglePay error",oe)})}function F(O){var oe,he,ae,ie,be,Ne,K;(oe=O==null?void 0:O.data)!=null&&oe.status&&(O.data.status==="activate"&&O.data.component==="googlepay"&&((he=t.log)==null||he.call(t,`[GooglePay]: message "${O.data.status}" received`,O.data),a.value=!0,r("activate"),d()),O.data.status==="deactivate"&&O.data.component==="googlepay"&&((ae=t.log)==null||ae.call(t,`[GooglePay]: message "${O.data.status}" received`,O.data),a.value=!1),O.data.status==="message"&&O.data.component==="googlepay"&&((ie=t.log)==null||ie.call(t,`[GooglePay]: message "${O.data.status}" received`,O.data),c.value=O.data.message),O.data.status==="error"&&O.data.component==="googlepay"&&((be=t.log)==null||be.call(t,`[GooglePay]: message "${O.data.status}" received`,O.data),c.value=O.data.error),O.data.status===Ps&&((Ne=t.log)==null||Ne.call(t,`[GooglePay]: message "${O.data.status}" received`,O.data),n.value=Number(O.data.amount)),O.data.status===ws&&((K=t.log)==null||K.call(t,`[GooglePay]: message "${O.data.status}" received`,O.data),o.value=O.data.currency))}return Ct(()=>{window.removeEventListener("message",F)}),Xe(()=>{window.addEventListener("message",F),yi(i.value,Ts)||(a.value=!0,r("activate"),d())}),(O,oe)=>(Z(),re(Le,null,[P("div",cg,[ft(ve(ir,null,null,512),[[_r,me(u)]])]),P("div",{style:{position:"relative"},ref_key:"root",ref:i},[c.value?(Z(),re("div",ug,He(c.value),1)):Pe("",!0)],512)],64))}}),Vn={ADD_CHARGE_WITH_GOOGLE_PAY:"ADD_CHARGE_WITH_GOOGLE_PAY"},pl=e=>({[Vn.ADD_CHARGE_WITH_GOOGLE_PAY]:{url:e+"/charge/token/google",method:"POST"}});class kr{constructor(r,t){g(this,"container",null);g(this,"log");g(this,"apiUrl","");g(this,"environment","");g(this,"failureCallback",null);g(this,"successCallback",null);g(this,"httpInvoker",null);g(this,"destroy",()=>{});g(this,"providerId","");g(this,"amount",0);g(this,"currency","");g(this,"billingAddress",null);g(this,"customer",null);g(this,"order",null);this.log=r,this.environment=t.environment,this.apiUrl=t.apiUrl,this.failureCallback=t.onFailure||null,this.successCallback=t.onSuccess||null;const s=new Tt(t.environment,Nt(t.publicKey));this.httpInvoker=new ht(t.publicKey,t.version,s)}setAmount(r){this.amount=r}setCurrency(r){this.currency=r}setCustomerInfo(r){this.customer={...r}}setBillingAddress(r){this.billingAddress={...r}}setOrderInfo(r){this.order={...r}}cleanUp(r){var t;r===this.container&&((t=this.destroy)==null||t.call(this))}addGooglePay(r,t,s,i,n){this.log("[addGooglePay]",{providerId:t,amount:s,currency:i,options:n}),this.validateOptions(r,s,i,n),this.setAmount(s),this.setCurrency(i);let o=!1;this.container=r;const a=Fe({el:r,component:dg,props:{log:this.log,el:r,environment:this.environment,amount:this.amount,currency:this.currency,options:n},on:{activate:D(this,"[GooglePay]: activate",()=>{o||(o=!0,this.log("[GooglePay]: activate googlepay form"))}),complete:D(this,"[GooglePay]: complete",c=>{var u,d,h,p;this.log("[GooglePay]: complete",c);const l={amount:this.amount,currency:this.currency,paymentData:{paymentMethodData:{tokenizationData:{intermediateSigningKey:c.paymentMethodData.tokenizationData.intermediateSigningKey,protocolVersion:c.paymentMethodData.tokenizationData.protocolVersion,signature:c.paymentMethodData.tokenizationData.signature,signedMessage:c.paymentMethodData.tokenizationData.signedMessage}},paymentInfo:{cardDetails:c.paymentMethodData.info.cardDetails,cardNetwork:c.paymentMethodData.info.cardNetwork}},firstName:(u=this.customer)==null?void 0:u.firstName,lastName:(d=this.customer)==null?void 0:d.lastName,email:(h=this.customer)==null?void 0:h.email,phone:(p=this.customer)==null?void 0:p.phoneNumber,address:this.billingAddress&&{line1:this.billingAddress.streetAddress,line2:this.billingAddress.streetAddress2,city:this.billingAddress.city,country:this.billingAddress.country,postalCode:this.billingAddress.postalCode,state:this.billingAddress.state}||void 0,order:this.order&&{dutyAmount:this.order.taxAmount,freightAmount:this.order.shippingAmount,items:this.order.orderItems.map(m=>({description:m.name,productCode:m.sku,quantity:m.quantity,amount:m.totalAmount}))}||void 0};this.addChargeWithGooglePay(r,t,l)}),error:D(this,"[GooglePay]: error",c=>{var l;this.log("[GooglePay]: error",c),q(r,"Unable to pay with Google Pay"),(l=this.failureCallback)==null||l.call(this,{error:"Unable to pay with Google Pay",body:c})})}});this.destroy=a.destroy}addChargeWithGooglePay(r,t,s){var i;this.log("[addChargeWithGooglePay]",s),(i=this.httpInvoker)==null||i.invoke(pl(this.apiUrl)[Vn.ADD_CHARGE_WITH_GOOGLE_PAY].url,pl(this.apiUrl)[Vn.ADD_CHARGE_WITH_GOOGLE_PAY].method,JSON.stringify(s),this.getSuccessAddChargeHandler(r).bind(this),this.getFailureAddChargeHandler(r).bind(this),{providerId:t})}getFailureAddChargeHandler(r){return D(this,"[GooglePay], failure",(t,s)=>{var i;this.log("[GooglePay], failure",s),q(r,"Unable to pay with Google Pay"),(i=this.failureCallback)==null||i.call(this,{error:"Unable to pay with Google Pay",body:s})})}getSuccessAddChargeHandler(r){return D(this,"[GooglePay], success",(t,s)=>{var n;const i=JSON.parse(s);this.log("[GooglePay], success",i),(n=this.successCallback)==null||n.call(this,{transactionId:i.chargeId})})}validateOptions(r,t,s,i){if(!ct(s))throw q(r,"Invalid currency: "+s),new TypeError("invalid currency: "+s);if(!qe(t))throw q(r,"Invalid amount: "+t),new TypeError("invalid amount: "+t);if(!i.gateway)throw q(r,"Invalid gateway parameter"),new TypeError("Invalid gateway parameter");if(!i.googlePayGatewayMerchantId)throw q(r,"Invalid gateway merchant id parameter"),new TypeError("Invalid gateway merchant id parameter")}}I([C],kr.prototype,"cleanUp",null),I([C],kr.prototype,"addGooglePay",null),I([C],kr.prototype,"addChargeWithGooglePay",null),I([C],kr.prototype,"getFailureAddChargeHandler",null),I([C],kr.prototype,"getSuccessAddChargeHandler",null),I([C],kr.prototype,"validateOptions",null);const hg={style:{position:"relative"}},pg={key:0,class:"error text-normal"},gg=Te({__name:"ApplePayForm",props:{log:null,el:null,environment:null,amount:null,currency:null,options:null},emits:["submit","validate","activate","close","error","cancel"],setup(e,{emit:r}){const t=e,s="payfurl-applepay-script",i=te(null),n=te(t.amount),o=te(t.currency),a=te(!0),c=te("");let l=!1;const{isLoading:u}=et();function d(){if(t.log("[onApplePayButtonClicked]"),!ApplePaySession)return;const m={countryCode:"AU",currencyCode:o.value,merchantCapabilities:["supports3DS"],supportedNetworks:["visa","masterCard","amex","discover"],total:{label:t.options.lineItemLabel,type:"final",amount:Number(n.value).toFixed(2)}};t.log("[onApplePayButtonClicked], Create ApplePaySession",m);const A=new ApplePaySession(3,m);A.onvalidatemerchant=E=>{const v=E.validationURL;r("validate",{validationUrl:v,merchantIdentifier:t.options.merchantIdentifier,domainName:t.options.domainName,displayName:t.options.displayName},A)},A.onpaymentauthorized=E=>{t.log("[onpaymentauthorized]",E),r("submit",E.payment,A)},A.oncancel=E=>{t.log("[oncancel]",E),r("cancel")},A.begin()}function h(){if(document.getElementById(s)||l)return;l=!0,window.google=null;const m=document.createElement("script");m.src="https://applepay.cdn-apple.com/jsapi/v1/apple-pay-sdk.js",m.type="text/javascript",m.id=s,m.onload=()=>{var E;const A=document.createElement("apple-pay-button");A.buttonstyle="black",A.locale="en-US",A.type="buy",A.onclick=d,(E=i.value)==null||E.appendChild(A),window.postMessage({status:Er},"*")},document.body.appendChild(m)}function p(m){var A,E,v,M,N,S,F;(A=m==null?void 0:m.data)!=null&&A.status&&(m.data.status==="activate"&&m.data.component==="applepay"&&((E=t.log)==null||E.call(t,`[ApplePay]: message "${m.data.status}" received`,m.data),a.value=!0,r("activate"),h()),m.data.status==="deactivate"&&m.data.component==="applepay"&&((v=t.log)==null||v.call(t,`[ApplePay]: message "${m.data.status}" received`,m.data),a.value=!1),m.data.status==="message"&&m.data.component==="applepay"&&((M=t.log)==null||M.call(t,`[ApplePay]: message "${m.data.status}" received`,m.data),c.value=m.data.message),m.data.status==="error"&&m.data.component==="applepay"&&((N=t.log)==null||N.call(t,`[ApplePay]: message "${m.data.status}" received`,m.data),c.value=m.data.error),m.data.status===Ps&&((S=t.log)==null||S.call(t,`[ApplePay]: message "${m.data.status}" received`,m.data),n.value=Number(m.data.amount)),m.data.status===ws&&((F=t.log)==null||F.call(t,`[ApplePay]: message "${m.data.status}" received`,m.data),o.value=m.data.currency))}return Ct(()=>{window.removeEventListener("message",p)}),Xe(()=>{window.addEventListener("message",p),yi(i.value,Ts)||(a.value=!0,r("activate"),h())}),(m,A)=>(Z(),re(Le,null,[P("div",hg,[ft(ve(ir,null,null,512),[[_r,me(u)]])]),P("div",{style:{position:"relative"},ref_key:"root",ref:i},[c.value?(Z(),re("div",pg,He(c.value),1)):Pe("",!0)],512)],64))}}),Zr={VALIDATE_MERCHANT:"VALIDATE_MERCHANT",ADD_CHARGE_WITH_APPLE_PAY:"ADD_CHARGE_WITH_APPLE_PAY"},ki=e=>({[Zr.VALIDATE_MERCHANT]:{url:e+"/charge/token/apple/validate",method:"POST"},[Zr.ADD_CHARGE_WITH_APPLE_PAY]:{url:e+"/charge/token/apple",method:"POST"}});class nr{constructor(r,t){g(this,"container",null);g(this,"log");g(this,"apiUrl","");g(this,"environment","");g(this,"publicKey","");g(this,"version","");g(this,"applePayButton",null);g(this,"failureCallback",null);g(this,"successCallback",null);g(this,"httpInvoker",null);g(this,"destroy",()=>{});g(this,"providerId","");g(this,"amount",0);g(this,"currency","");g(this,"billingAddress",null);g(this,"customer",null);g(this,"order",null);this.log=r,this.environment=t.environment,this.apiUrl=t.apiUrl,this.publicKey=t.publicKey,this.version=t.version,this.failureCallback=t.onFailure||null,this.successCallback=t.onSuccess||null;const s=new Tt(t.environment,Nt(t.publicKey));this.httpInvoker=new ht(t.publicKey,t.version,s)}setAmount(r){var t;this.amount=r,(t=this.applePayButton)==null||t.setAmount(r)}setCurrency(r){var t;this.currency=r,(t=this.applePayButton)==null||t.setCurrency(r)}setCustomerInfo(r){var t;this.customer={...r},(t=this.applePayButton)==null||t.setCustomerInfo(r)}setBillingAddress(r){var t;this.billingAddress={...r},(t=this.applePayButton)==null||t.setBillingAddress(r)}setOrderInfo(r){var t;this.order={...r},(t=this.applePayButton)==null||t.setOrderInfo(r)}cleanUp(r){var t,s;(r==null?void 0:r.id)===((t=this.container)==null?void 0:t.id)&&((s=this.destroy)==null||s.call(this))}addApplePay(r,t,s,i,n){this.log("[addApplePay]",{providerId:t,amount:s,currency:i,options:n}),this.validateOptions(r,s,i,n),this.setAmount(s),this.setCurrency(i);let o=!1;this.container=r;const a=D(this,"[ApplePay][renderDefaultComponent]",()=>{this.log("[addApplePay], renderDefaultComponent",{providerId:t,amount:s,currency:i,options:n});const l=Fe({el:r,component:gg,props:{log:this.log,el:r,environment:this.environment,amount:this.amount,currency:this.currency,options:n},on:{activate:()=>{o||(o=!0,this.log("activate applepay form"))},validate:D(this,"[addApplePay], validate",(u,d)=>{this.log("[ApplePay]: validate",u),this.validateMerchant(r,t,u,d)}),submit:D(this,"[addApplePay], submit",(u,d)=>{var p,m,A,E;this.log("[ApplePay]: complete",u);const h={amount:this.amount,currency:this.currency,token:u.token,firstName:(p=this.customer)==null?void 0:p.firstName,lastName:(m=this.customer)==null?void 0:m.lastName,email:(A=this.customer)==null?void 0:A.email,phone:(E=this.customer)==null?void 0:E.phoneNumber,address:this.billingAddress&&{line1:this.billingAddress.streetAddress,line2:this.billingAddress.streetAddress2,city:this.billingAddress.city,country:this.billingAddress.country,postalCode:this.billingAddress.postalCode,state:this.billingAddress.state}||void 0,order:this.order&&{dutyAmount:this.order.taxAmount,freightAmount:this.order.shippingAmount,items:this.order.orderItems.map(v=>({description:v.name,productCode:v.sku,quantity:v.quantity,amount:v.totalAmount}))}||void 0};this.addChargeWithApplePay(r,t,h,d)}),error:D(this,"[addApplePay], error",(u,d)=>{var h;this.log("[ApplePay]: error",u),q(r,"Unable to pay with ApplePay"),d.completePayment({status:ApplePaySession.STATUS_FAILURE,errors:[{code:"unknown",message:u}]}),(h=this.failureCallback)==null||h.call(this,{error:"Unable to pay with ApplePay",body:u})}),cancel:D(this,"[addApplePay], calcel",()=>{var u;this.log("[ApplePay]: cancel"),q(r,"ApplePay canceled"),(u=this.failureCallback)==null||u.call(this,{error:"ApplePay canceled"})})}});this.destroy=l.destroy}),c=D(this,"[ApplePay][renderCustomComponent]",l=>{var u,d,h,p;this.log("[addApplePay], renderCustomComponent",{providerId:t,amount:s,currency:i,options:n}),this.applePayButton=l.default(this.log.bind(this),r,n.providerId,s,i,{environment:this.environment,publicKey:this.publicKey,apiUrl:this.apiUrl,version:this.version,options:n,clientParameters:n.clientParameters,onSuccess:D(this,"[addApplePay], success",m=>{var E,v;this.log("[addApplePay], success",m),(E=this.applePayButton)==null||E.hide();const A={token:m.token,transactionId:m.transactionId};m.clickToPayData&&(A.clickToPayData=m.clickToPayData),(v=this.successCallback)==null||v.call(this,A)}),onFailure:D(this,"[addApplePay], failure",m=>{var A,E;this.log("[addApplePay], failure",m),(A=this.applePayButton)==null||A.redraw(),(E=this.failureCallback)==null||E.call(this,{error:m.error})})}),this.billingAddress&&((u=this.applePayButton)==null||u.setBillingAddress(this.billingAddress)),this.customer&&((d=this.applePayButton)==null||d.setCustomerInfo(this.customer)),this.order&&((h=this.applePayButton)==null||h.setOrderInfo(this.order)),(p=this.applePayButton)==null||p.draw(),window.postMessage({status:Er},"*")});at(Object.assign({"./applepay/ApplePayButton.interface.ts":()=>Promise.resolve().then(()=>Bg),"./applepay/ApplePayButtonOptions.type.ts":()=>Promise.resolve().then(()=>Wg),"./applepay/PayWayAppleButton.ts":()=>Promise.resolve().then(()=>Zg),"./applepay/payway_rest.ts":()=>Promise.resolve().then(()=>Xg)}),`./applepay/${n.providerType.toLowerCase()}.ts`).then(D(this,"[localAddApplePay], then",l=>{this.log(`Loading ${n.providerType}...`,l),c(l)})).catch(()=>{this.log(`Error loading ${n.providerType}`),a()})}validateMerchant(r,t,s,i){var n;this.log("[validateMerchant]",s),(n=this.httpInvoker)==null||n.invoke(ki(this.apiUrl)[Zr.VALIDATE_MERCHANT].url,ki(this.apiUrl)[Zr.VALIDATE_MERCHANT].method,JSON.stringify(s),D(this,"[validateMerchant], success",(o,a)=>{try{const c=JSON.parse(a);this.log("[validateMerchant], success",c),i.completeMerchantValidation(c)}catch(c){this.log("error parsing validateMerchant response",c)}}),D(this,"[validateMerchant], failure",(o,a)=>{var c;this.log("[validateMerchant], failure",a),q(r,"Unable to pay with ApplePay"),(c=this.failureCallback)==null||c.call(this,{error:"Unable to pay with ApplePay",body:a})}),{providerId:t})}addChargeWithApplePay(r,t,s,i){var n;this.log("[addChargeWithApplePay]",s),(n=this.httpInvoker)==null||n.invoke(ki(this.apiUrl)[Zr.ADD_CHARGE_WITH_APPLE_PAY].url,ki(this.apiUrl)[Zr.ADD_CHARGE_WITH_APPLE_PAY].method,JSON.stringify(s),this.getSuccessAddChargeHandler(r,i).bind(this),this.getFailureAddChargeHandler(r,i).bind(this),{providerId:t})}getFailureAddChargeHandler(r,t){return D(this,"[getFailureAddChargeHandler]",(s,i)=>{var n;this.log("[ApplePay], failure",i),q(r,"Unable to pay with ApplePay"),t.completePayment({status:ApplePaySession.STATUS_FAILURE,errors:[{code:"unknown",message:i}]}),(n=this.failureCallback)==null||n.call(this,{error:"Unable to pay with ApplePay",body:i})})}getSuccessAddChargeHandler(r,t){return D(this,"[getSuccessAddChargeHandler]",(s,i)=>{var a;const n=JSON.parse(i);this.log("[ApplePay], success",n);const o={status:ApplePaySession.STATUS_SUCCESS,paymentToken:n};t.completePayment(o),(a=this.successCallback)==null||a.call(this,{transactionId:n.chargeId})})}validateOptions(r,t,s,i){if(!ct(s))throw q(r,"Invalid currency: "+s),new TypeError("invalid currency: "+s);if(!qe(t))throw q(r,"Invalid amount: "+t),new TypeError("invalid amount: "+t);if(!i.lineItemLabel)throw q(r,"Invalid lineItemLabel parameter"),new TypeError("Invalid lineItemLabel parameter");if(!i.domainName)throw q(r,"Invalid domainName parameter"),new TypeError("Invalid domainName parameter");if(!i.displayName)throw q(r,"Invalid displayName parameter"),new TypeError("Invalid displayName parameter");if(!i.merchantIdentifier)throw q(r,"Invalid merchantIdentifier parameter"),new TypeError("Invalid merchantIdentifier parameter")}}I([C],nr.prototype,"cleanUp",null),I([C],nr.prototype,"addApplePay",null),I([C],nr.prototype,"validateMerchant",null),I([C],nr.prototype,"addChargeWithApplePay",null),I([C],nr.prototype,"getFailureAddChargeHandler",null),I([C],nr.prototype,"getSuccessAddChargeHandler",null),I([C],nr.prototype,"validateOptions",null);const fg=[(e=>(pt("data-v-7d3fe743"),e=e(),gt(),e))(()=>P("path",{id:"XMLID_34_",d:`M93.6,27.1C87.6,34.2,78,39.8,68.4,39c-1.2-9.6,3.5-19.8,9-26.1c6-7.3,16.5-12.5,25-12.9
|
|
149
|
+
left=${u}`)}modalHide(){this.modal&&(Dp(),this.modal.close())}updateToken(t){var i,n;if(this.log("[MastercardTokenAuthenticationProcessor][updateToken]",t),!((i=t.assuranceData)!=null&&i.verificationData.length))return;const s=t.assuranceData.verificationData[0];(n=this.httpInvoker)==null||n.invoke(ll(this.apiUrl,this.token)[xn.UPDATE].url,ll(this.apiUrl,this.token)[xn.UPDATE].method,JSON.stringify({VerificationType:s.verificationType,VerificationEntity:s.verificationEntity,VerificationMethod:s.verificationMethod,VerificationResults:s.verificationResults,VerificationTimestamp:s.verificationTimestamp,AdditionalData:s.additionalData,VerificationEvents:JSON.stringify(s.verificationEvents)}),D(this,"[MastercardTokenAuthenticationProcessor][updateToken]: successCallback",(o,a)=>{var c;this.log("[MastercardTokenAuthenticationProcessor][updateToken]: successCallback",o,a),this.modalHide(),(c=this.onSuccessCallback)==null||c.call(this,t)}),D(this,"[MastercardTokenAuthenticationProcessor][updateToken]: failureCallback",(o,a)=>{var c;this.log("[MastercardTokenAuthenticationProcessor][updateToken]: failureCallback",o,a),this.modalHide(),(c=this.onFailureCallback)==null||c.call(this,{error:"Unknown error"})}))}}I([C],Bt.prototype,"invoke",null),I([C],Bt.prototype,"messageHandler",null),I([C],Bt.prototype,"authenticate",null),I([C],Bt.prototype,"init",null),I([C],Bt.prototype,"initCss",null),I([C],Bt.prototype,"modalShow",null),I([C],Bt.prototype,"modalHide",null),I([C],Bt.prototype,"updateToken",null);const{hideSpinner:Ye,showSpinner:Gr}=Gt(),vi={TOKENISE_CARD:"TOKENISE_CARD",GET_PROVIDER_INFO:"GET_PROVIDER_INFO"},cl=(e,r,t)=>({[vi.TOKENISE_CARD]:{url:e+"/token/card",method:"POST"},[vi.GET_PROVIDER_INFO]:{url:e+"/info/providers/"+r,method:"GET"}});class nt extends Kt{constructor(t,s){super(t);g(this,"container",null);g(this,"iframe",null);g(this,"form",null);g(this,"debug",!1);g(this,"environment");g(this,"apiUrl","");g(this,"url","");g(this,"publicKey","");g(this,"customer",null);g(this,"billingAddress",null);g(this,"geolocation",null);g(this,"amount",0);g(this,"currency","");g(this,"createNetworkToken",!1);g(this,"vault",!1);g(this,"userSuccessMessage",On);g(this,"threeDSEnabled",!1);g(this,"threeDsProcessor",null);g(this,"fraudProcessor",null);g(this,"clickToPayProcessor",null);g(this,"tokenAuthenticationEnabled",!1);g(this,"networkTokenProviders",[]);g(this,"networkTokenOptions",{});g(this,"failureCallback",null);g(this,"successCallback",null);g(this,"validationStatusChangeCallback",null);g(this,"httpInvoker");g(this,"destroy",()=>{});this.debug=s.debug,this.environment=s.environment,this.url=s.url,this.apiUrl=s.apiUrl,this.publicKey=s.publicKey,this.failureCallback=s.onFailure||null,this.successCallback=s.onSuccess||null,this.validationStatusChangeCallback=s.onValidationStatusChangeCallback||null;const i=new Tt(s.environment,Nt(s.publicKey));this.httpInvoker=new ht(this.publicKey,s.version,i),window.addEventListener("message",this.messageHandler.bind(this))}addThreeDsProcessor(t){this.threeDsProcessor=t}addFraudProcessor(t){this.fraudProcessor=t}addClickToPayProcessor(t){this.clickToPayProcessor=t}setSuccessMessage(t){this.userSuccessMessage=t}getSuccessMessage(){return this.userSuccessMessage}cleanUp(t){var s,i;(t==null?void 0:t.id)===((s=this.container)==null?void 0:s.id)&&((i=this.destroy)==null||i.call(this),this.container=null,this.form=null,this.iframe=null,window.removeEventListener("message",this.messageHandler.bind(this)))}addCard(t,s,i,n,o,a){this.log("[addCard]",{providerId:i,amount:n,currency:o,options:a}),(a!=null&&a.createNetworkToken||a!=null&&a.tokenAuthenticationEnabled)&&(a.clickToPayEnabled=!1),a!=null&&a.clickToPayEnabled&&this.clickToPayProcessor&&(a.threeDSEnabled=!1);const c=(a==null?void 0:a.threeDSEmail)||"";this.amount=n,this.currency=o,this.vault=!!(a!=null&&a.vault),this.fraudProcessor&&(this.fraudProcessor.setAmount(n),this.fraudProcessor.setCurrency(o)),this.threeDsProcessor&&(this.threeDsProcessor.setEmail((a==null?void 0:a.threeDSEmail)||""),this.threeDsProcessor.setAmount(n),this.threeDsProcessor.setCurrency(o),this.threeDsProcessor.setClientParameters((a==null?void 0:a.clientParameters)||{})),a!=null&&a.threeDSEnabled&&(Ga(n,Be,"Missing or invalid amount",this.failureCallback),Ga(o,ct,"Missing or invalid currency",this.failureCallback),this.threeDSEnabled=!0),a!=null&&a.clickToPayEnabled&&this.clickToPayProcessor&&(this.clickToPayProcessor.setAmount(n),this.clickToPayProcessor.setCurrency(o),this.clickToPayProcessor.setCustomerInfo({...this.customer||{},email:(a==null?void 0:a.threeDSEmail)||""}),this.clickToPayProcessor.setContainer(t),this.clickToPayProcessor.init(),this.clickToPayProcessor.start()),!(a!=null&&a.clickToPayEnabled)&&this.clickToPayProcessor&&this.clickToPayProcessor.isInitialized()&&this.clickToPayProcessor.stopUsing(),this.createNetworkToken=!!(a!=null&&a.createNetworkToken),this.tokenAuthenticationEnabled=!!(a!=null&&a.tokenAuthenticationEnabled),this.networkTokenProviders=(a==null?void 0:a.networkTokenProviders)||[],this.networkTokenOptions=(a==null?void 0:a.networkTokenOptions)||{},this.container=t||null,this.form=s;const l=Fe({el:this.container,component:Ap,props:{log:this.log,iframeSrc:this.url,form:this.form,threeDSEnabled:this.threeDSEnabled},on:{load:D(this,"[addCard], onload",u=>{var d;this.iframe=u,(d=u==null?void 0:u.contentWindow)==null||d.postMessage({status:rl,environment:this.environment,debug:this.debug,publicKey:this.publicKey,providerId:i,apiUrl:this.apiUrl,amount:n,currency:o,vault:a==null?void 0:a.vault,showEmail:(a==null?void 0:a.threeDSEnabled)&&!Ds(c),visProviderId:a==null?void 0:a.visProviderId,requiredFields:a==null?void 0:a.requiredFields,clickToPayEnabled:a==null?void 0:a.clickToPayEnabled,clickToPayOptions:a==null?void 0:a.clickToPayOptions,style:(a==null?void 0:a.style)||"default"},"*")}),submit:D(this,"[addCard], onsubmit",()=>{this.log("[CardProcessor]: submit event"),Gr(),this.requestCardDetails()})}});return this.destroy=l.destroy,this}messageHandler(t){var s,i,n,o,a,c,l,u,d,h,p,m,A,E,v,M,N,S,F,O,oe,he,ae,ie,be,Ne,K,$,U,G,w,z,B,se,ce,fe,Q;if((s=t==null?void 0:t.data)!=null&&s.status){if(t.data.status===il){this.log(`[sdk][cardProcessor]: message "${t.data.status}" received`,t.data),Ye();return}if(t.data.status===sl){this.log(`[sdk][cardProcessor]: message "${t.data.status}" received`,t.data),Gr();return}if(t.data.status===up){this.log(`[sdk][cardProcessor]: message "${t.data.status}" received`,t.data),Ye(),(i=this.failureCallback)==null||i.call(this,{error:t.data.message});return}if(t.data.status===dp){this.log(`[sdk][cardProcessor]: message "${t.data.status}" received`,t.data),Ye(),(a=this.validationStatusChangeCallback)==null||a.call(this,(n=t.data.message)==null?void 0:n.status,(o=t.data.message)==null?void 0:o.message);return}if(t.data.status===nl){this.log(`[sdk][cardProcessor]: message "${t.data.status}" received`,t.data),Ye(),this.showMessage(t.data.message),(c=this.failureCallback)==null||c.call(this,{error:t.data.message});return}if(t.data.status===Xh){this.log(`[sdk][cardProcessor]: message "${t.data.status}" received`,t.data),t.stopPropagation(),this.iframe=null;const Me={token:t.data.tokenId};if((l=t.data.options)!=null&&l.cardDetails&&(Me.cardDetails=(u=t.data.options)==null?void 0:u.cardDetails),(d=t.data.options)!=null&&d.iinData&&(Me.iinData=(h=t.data.options)==null?void 0:h.iinData),(p=t.data.options)!=null&&p.clickToPay&&(Me.clickToPayData={billingAddress:(m=t.data.options)==null?void 0:m.clickToPay.billingAddress,panBin:((v=(E=(A=t.data.options)==null?void 0:A.clickToPay)==null?void 0:E.cardData)==null?void 0:v.panBin)||"",panLastFour:((S=(N=(M=t.data.options)==null?void 0:M.clickToPay)==null?void 0:N.cardData)==null?void 0:S.panLastFour)||"",scheme:((oe=(O=(F=t.data.options)==null?void 0:F.clickToPay)==null?void 0:O.cardData)==null?void 0:oe.scheme)||"",paymentCardType:((ie=(ae=(he=t.data.options)==null?void 0:he.clickToPay)==null?void 0:ae.cardData)==null?void 0:ie.paymentCardType)||""}),(be=t.data.options)!=null&&be.networkTokenAuthenticateUrl&&((Ne=t.data.options)!=null&&Ne.networkToken)){const ye=this.initTokenAuthenticationProcessor(t.data.tokenId,t.data.options.networkToken,(K=t.data.options)==null?void 0:K.networkTokenData,t.data.options.networkTokenAuthenticateUrl,($=t.data.options)==null?void 0:$.cardDetails,this.networkTokenOptions);if(ye){ye.invoke(this.amount,this.currency,(U=t.data.options)==null?void 0:U.cardDetails,D(this,"[sdk][cardProcessor], token authentication success",()=>{var ke;this.log("[sdk][cardProcessor], token authentication success"),Ye(),Ns(this.container,this.getSuccessMessage()),(ke=this.successCallback)==null||ke.call(this,Me)}),D(this,"[sdk][cardProcessor], token authentication error",ke=>{Ye(),this.log("[sdk][cardProcessor], token authentication error",ke)}));return}}Ye(),Ns(this.container,this.getSuccessMessage()),(G=this.successCallback)==null||G.call(this,Me);return}if(t.data.status==Zh){this.log(`[sdk][cardProcessor]: "${t.data.status}" message received`,t.data);const Me=!!((w=this.clickToPayProcessor)!=null&&w.isEnabled()&&((z=this.clickToPayProcessor)!=null&&z.getRememberMe()));if(Me&&!t.data.message.srcDigitalCardId&&t.data.message.cardNumber&&!((B=this.clickToPayProcessor)!=null&&B.isSchemeSupported(t.data.message.cardNumber))){this.log("[clickToPayProcessor]: checkoutWithNewCard - Scheme is not supported!"),Ye(),this.showMessage("Please use another card or use an alternative payment method");return}if(Me&&t.data.message.srcDigitalCardId){Ye(),(se=this.clickToPayProcessor)==null||se.checkoutWithCard(t.data.message,ye=>{this.log("[clickToPayProcessor]: checkoutWithCard",ye),ye.checkoutActionCode!=="CANCEL"&&ye.checkoutActionCode!=="CHANGE_CARD"&&(Gr(),this.tokenise({clickToPayInfo:{correlationId:ye.checkoutResponseData.srcCorrelationId,merchantTransactionId:ye.headers["merchant-transaction-id"],ccv:t.data.message.ccv}}))},ye=>{this.log("[clickToPayProcessor]: checkoutWithCard, error",ye),Ye()});return}if((ce=this.fraudProcessor)==null||ce.setPaymentInfo({cardNumber:t.data.message.cardNumber,expiryDate:t.data.message.expiryDate,cardholder:t.data.message.cardholder,ccv:t.data.message.ccv}),(fe=this.threeDsProcessor)==null||fe.setPaymentInfo({cardNumber:t.data.message.cardNumber,expiryDate:t.data.message.expiryDate,cardholder:t.data.message.cardholder,ccv:t.data.message.ccv}),t.data.message.email&&((Q=this.threeDsProcessor)==null||Q.setEmail(t.data.message.email)),this.fraudProcessor){Gr(),this.fraudProcessor.fraudCheck(D(this,"[fraudProcessor][fraudCheck], success",ye=>{var ke;if(ye.decision!="Approved"&&ye.stopPaymentOnFailure){Ye(),q(this.container,"Payment couldn't be processed"),(ke=this.failureCallback)==null||ke.call(this,{error:"Payment couldn't be processed"});return}this.onSubmit({cardNumber:t.data.message.cardNumber,expiryDate:t.data.message.expiryDate,cardholder:t.data.message.cardholder,ccv:t.data.message.ccv},ye)}),D(this,"[fraudProcessor][fraudCheck], error",ye=>{var ke;Ye(),q(this.container,ye.error),(ke=this.failureCallback)==null||ke.call(this,ye)}));return}this.onSubmit({cardNumber:t.data.message.cardNumber,expiryDate:t.data.message.expiryDate,cardholder:t.data.message.cardholder,ccv:t.data.message.ccv})}}}onSubmit(t,s){var n,o,a;if(this.log("[cardProcessor]: onSubmit",{fraudCheckResult:s}),!!((n=this.clickToPayProcessor)!=null&&n.isEnabled()&&((o=this.clickToPayProcessor)!=null&&o.getRememberMe()))){this.tokeniseWithClickToPay(t,void 0,s);return}if(this.threeDsProcessor){(a=this.threeDsProcessor)==null||a.threeDSInvoke(this.container,!1,c=>{Ye(),this.log("[threeDSInvoke], postAuthData",c),this.tokenise({threeDSServerTransID:c.threeDSServerTransID,fraudCheckResult:s,externalThreeDsData:c.externalThreeDsData})});return}this.tokenise({fraudCheckResult:s})}tokenise(t){var s,i,n;this.log("[cardProcessor]: tokenise",t),this.iframe&&(Gr(),(n=this.iframe.contentWindow)==null||n.postMessage({status:Bh,threeDSServerTransID:t.threeDSServerTransID,fraudCheckResult:t.fraudCheckResult,externalThreeDsData:t.externalThreeDsData,createNetworkToken:this.tokenAuthenticationEnabled||this.createNetworkToken,vault:this.vault,clickToPayInfo:t.clickToPayInfo,email:(s=this.customer)==null?void 0:s.email,phone:(i=this.customer)==null?void 0:i.phoneNumber,billingAddress:this.billingAddress,geolocation:this.geolocation},"*"))}tokeniseWithClickToPay(t,s,i){var n;Ye(),(n=this.clickToPayProcessor)==null||n.checkoutWithNewCard(t.cardNumber,t.expiryDate,t.ccv||"",!0,D(this,"[clickToPayProcessor]: checkoutWithNewCard",o=>{this.log("[clickToPayProcessor]: checkoutWithNewCard",o),o.checkoutActionCode!=="CANCEL"&&(Gr(),this.tokenise({threeDSServerTransID:s,fraudCheckResult:i,clickToPayInfo:{correlationId:o.checkoutResponseData.srcCorrelationId,merchantTransactionId:o.headers["merchant-transaction-id"],ccv:t.ccv||""}}))}),D(this,"[clickToPayProcessor]: checkoutWithNewCard, error",o=>{this.log("[clickToPayProcessor]: checkoutWithNewCard, error",o),Ye(),q(this.container,o.message)}))}setAmount(t){var s,i;this.amount=t,(s=this.clickToPayProcessor)==null||s.setAmount(t),this.iframe&&((i=this.iframe.contentWindow)==null||i.postMessage({status:Ps,amount:t},"*"))}setCurrency(t){var s,i;this.currency=t,(s=this.clickToPayProcessor)==null||s.setCurrency(t),this.iframe&&((i=this.iframe.contentWindow)==null||i.postMessage({status:ws,currency:t},"*"))}setCustomerInfo(t){var s;this.customer={...t},(s=this.clickToPayProcessor)==null||s.setCustomerInfo(t)}setBillingAddress(t){this.billingAddress={...t}}setGeolocation(t){this.geolocation={...t}}tokeniseCard(t,s,i,n,o,a,c,l){var h,p,m,A,E;if(!Be(t)){this.log("missing parameter: providerId"),(h=this.failureCallback)==null||h.call(this,{error:"missing parameter: providerId"});return}if(!Fd(s)){this.log("wrong parameter: cardNumber"),(p=this.failureCallback)==null||p.call(this,{error:"wrong parameter: cardNumber"});return}if(!$d(i)){this.log("wrong parameter: expiryDate"),(m=this.failureCallback)==null||m.call(this,{error:"wrong parameter: expiryDate"});return}if(!Gd(o)){this.log("wrong parameter: ccv"),(A=this.failureCallback)==null||A.call(this,{error:"wrong parameter: ccv"});return}const u=(v,M)=>{var N;this.log("tokeniseCardFailureCallback",v,M),Ye(),(N=this.failureCallback)==null||N.call(this,{error:"Unable to tokenise payment information"})},d=(v,M)=>{var F,O;this.log("[tokeniseCardSuccessCallback]",v,M),Ye();const N=JSON.parse(M);this.log("[tokeniseCardSuccessCallback], data",N);const S={token:N.tokenId};N.card&&(S.cardDetails={bin:N.card.cardIin,last4:String(N.card.cardNumber).slice(-4),expiryDate:N.card.expiryDate,cardholder:N.card.cardholder,scheme:(F=N.card.iinData)==null?void 0:F.scheme},S.iinData=N.card.iinData),this.fraudProcessor&&(S.fraudCheckResult=this.fraudProcessor.getCheckResult()||void 0),(O=this.successCallback)==null||O.call(this,S)};(E=this.httpInvoker)==null||E.invoke(cl(this.apiUrl,t)[vi.TOKENISE_CARD].url,cl(this.apiUrl,t)[vi.TOKENISE_CARD].method,JSON.stringify({paymentInformation:{cardNumber:s,expiryDate:i,ccv:o,cardholder:n,threeDSServerTransID:c||null},vaultCard:!0,vaultExpireSeconds:l!=null&&l.vault?null:4*3600,metadata:a,verify:l==null?void 0:l.verify,createNetworkToken:l==null?void 0:l.createNetworkToken,fraudCheck:this.fraudProcessor?this.fraudProcessor.getCheckResult():null,amount:this.amount,currency:this.currency}),d,u,{providerId:t})}initTokenAuthenticationProcessor(t,s,i,n,o,a){this.log("[initTokenAuthenticationProcessor]",{token:t,networkTokenAuthenticateUrl:n,networkTokenOptions:a});const c=((o==null?void 0:o.scheme)||"").toLowerCase(),l=this.networkTokenProviders.find(u=>u.providerType.toLowerCase()===c);switch(String(l==null?void 0:l.providerType).toLowerCase()){case"mastercard":return new Bt(this.log.bind(this),{container:this.container,token:t,networkToken:s,networkTokenData:i,redirectUrl:n,networkTokenProvider:l,environment:this.environment,publicKey:this.publicKey,apiUrl:this.apiUrl,networkTokenOptions:a});default:return this.log("Unsupported network token provider",c),null}}}I([C],nt.prototype,"cleanUp",null),I([C],nt.prototype,"addCard",null),I([C],nt.prototype,"messageHandler",null),I([C],nt.prototype,"onSubmit",null),I([C],nt.prototype,"tokenise",null),I([C],nt.prototype,"tokeniseWithClickToPay",null),I([C],nt.prototype,"setAmount",null),I([C],nt.prototype,"setCurrency",null),I([C],nt.prototype,"setCustomerInfo",null),I([C],nt.prototype,"setBillingAddress",null),I([C],nt.prototype,"setGeolocation",null),I([C],nt.prototype,"tokeniseCard",null),I([C],nt.prototype,"initTokenAuthenticationProcessor",null);const Un=te("");function Rn(){return{errorMessage:Un,showErrorMessage:t=>{Un.value=t},hideErrorMessage:()=>{Un.value=""}}}const Yr=e=>(pt("data-v-aa16d8ba"),e=e(),gt(),e),Tp={id:"payfurl-payto-form",class:"payfurl-form"},Np={key:0,class:"error text-normal"},Pp={class:"row"},wp=Yr(()=>P("label",null,"Payer Name",-1)),bp={class:"row"},vp=Yr(()=>P("label",null,"Payer Id Type",-1)),_p=[Yr(()=>P("option",{value:"PHONE"},"Phone",-1)),Yr(()=>P("option",{value:"EMAIL"},"Email",-1)),Yr(()=>P("option",{value:"ABN"},"Abn",-1))],Ep={class:"row"},Sp=Yr(()=>P("label",null," Pay Id ",-1)),kp=["placeholder"],Op={key:0,class:"small"},Lp={key:1,class:"error"},jp=Te({__name:"PayToForm",props:{log:null},emits:["submit"],setup(e,{emit:r}){const t=e,s=te({}),{isLoading:i}=et(),n=te(""),o=te("PHONE"),a=te(""),c=kt(()=>o.value==="PHONE"?"0405123456 or 0212341234":Fh(o.value.toLowerCase())),l=te(!0),{errorMessage:u}=Rn();function d(){return s.value.payId="",o.value==="PHONE"&&(mi(a.value)||(s.value.payId="Invalid phone number")),o.value==="EMAIL"&&(Ds(a.value)||(s.value.payId="Invalid email")),o.value==="ABN"&&(Yd(a.value.replace(/ /g,""))||(s.value.payId="Invalid ABN")),s.value.payId===""}function h(p){var m,A,E,v;if((m=p==null?void 0:p.data)!=null&&m.status){if(p.data.status===bi){if((A=t.log)==null||A.call(t,`[PayTo]: message "${p.data.status}" received`,p.data),!l.value||(p.stopPropagation(),t.log&&t.log("[PayTo]: form submit",{payerName:n.value,payIdType:o.value,payId:a.value}),!d()))return;r("submit",{payerName:n.value,payIdType:o.value,payId:o.value==="PHONE"?Hd(a.value):String(a.value).toLowerCase().replace(/ /g,"")})}p.data.status==="activate"&&p.data.component==="payto"&&((E=t.log)==null||E.call(t,`[PayTo]: message "${p.data.status}" received`,p.data),u.value="",l.value=!0),p.data.status==="deactivate"&&p.data.component==="payto"&&((v=t.log)==null||v.call(t,`[PayTo]: message "${p.data.status}" received`,p.data),l.value=!1)}}return Xe(()=>{window.addEventListener("message",h),window.addEventListener("keypress",function(p){p.altKey&&p.code==="KeyP"&&(p.preventDefault(),n.value="test",o.value="ABN",a.value="67384721620")}),window.postMessage({status:Er},"*")}),Ct(()=>{window.removeEventListener("message",h)}),(p,m)=>(Z(),re("div",Tp,[ft(ve(ir,null,null,512),[[_r,me(i)]]),P("div",{class:"container-form",style:lt(`visibility: ${me(i)?"hidden":"visible"}`)},[me(u)?(Z(),re("div",Np,He(me(u)),1)):Pe("",!0),P("div",Pp,[wp,P("div",null,[ft(P("input",{type:"text",maxlength:"100",placeholder:"Payer Name","onUpdate:modelValue":m[0]||(m[0]=A=>n.value=A)},null,512),[[gi,n.value]])])]),P("div",bp,[vp,P("div",null,[ft(P("select",{"onUpdate:modelValue":m[1]||(m[1]=A=>o.value=A)},_p,512),[[kd,o.value]])])]),P("div",Ep,[Sp,P("div",null,[ft(P("input",{type:"text",maxlength:"100",placeholder:me(c),"onUpdate:modelValue":m[2]||(m[2]=A=>a.value=A),onKeyup:d},null,40,kp),[[gi,a.value]]),o.value==="PHONE"?(Z(),re("div",Op,"(mobile or landline with area code)")):Pe("",!0),s.value.payId?(Z(),re("p",Lp,He(s.value.payId),1)):Pe("",!0)])])],4)]))}}),yy="",Iy="",xp=_e(jp,[["__scopeId","data-v-aa16d8ba"]]),Up=e=>(pt("data-v-f06289bf"),e=e(),gt(),e),Rp={id:"payfurl-payto-agreement",class:"payfurl-form"},zp=Up(()=>P("div",{class:"message"},"Approve the agreement in your banking app",-1)),Fp=Te({__name:"PayToAgreement",props:{debug:{type:Boolean}},setup(e){return(r,t)=>(Z(),re("div",Rp,[ve(ir),zp]))}}),Cy="",Ay="",Vp=_e(Fp,[["__scopeId","data-v-f06289bf"]]),Kr={TOKENISE:"TOKENISE",TOKEN_STATUS:"TOKEN_STATUS"},_i=(e,r)=>({[Kr.TOKENISE]:{url:e+"/token/payto",method:"POST"},[Kr.TOKEN_STATUS]:{url:e+"/token/"+r,method:"GET"}});class Br{constructor(r,t){g(this,"container",null);g(this,"debug",!1);g(this,"log");g(this,"apiUrl","");g(this,"getPaymentOptions");g(this,"options",null);g(this,"providerId","");g(this,"tokenId","");g(this,"checkAgreementHandler",null);g(this,"failureCallback",null);g(this,"successCallback",null);g(this,"httpInvoker",null);g(this,"destroy",()=>{});g(this,"successPayToHandler",D(this,"[PayTo][tokenise][successPayToHandler]",(r,t)=>{this.log("successPayToHandler",r,t);const s=JSON.parse(t);if(!s||!(s!=null&&s.tokenId))return this.failurePayToHandler(r,t);this.tokenId=s.tokenId,Fe({el:this.container,component:Vp,props:{el:this.container,log:this.log}}),this.checkAgreement()}));g(this,"failurePayToHandler",D(this,"[PayTo][tokenise][failurePayToHandler]",(r,t)=>{this.log("failurePayToHandler",r,t),et().stopLoading(),Rn().showErrorMessage("Invalid payment details")}));g(this,"failurePayToAgreementHandler",D(this,"[PayTo][tokenise][failurePayToAgreementHandler]",(r,t)=>{var s;et().stopLoading(),this.log("failurePayToAgreementHandler",r,t),q(this.container,"Agreement has been canceled"),(s=this.failureCallback)==null||s.call(this,{error:"Agreement has been canceled",body:t})}));this.log=r,this.debug=t.debug,this.apiUrl=t.apiUrl,this.getPaymentOptions=t.getPaymentOptions,this.failureCallback=t.onFailure||null,this.successCallback=t.onSuccess||null;const s=new Tt(t.environment,Nt(t.publicKey));this.httpInvoker=new ht(t.publicKey,t.version,s)}cleanUp(r){var t,s;((t=this.container)==null?void 0:t.id)===(r==null?void 0:r.id)&&((s=this.destroy)==null||s.call(this))}addPayTo(r,t,s,i){if(this.log("[addPayTo]",{amount:t,providerId:s,options:i}),this.container=r,this.providerId=s,this.options=i,!qe(t))throw q(r,"Invalid amount: "+t),new TypeError("invalid amount: "+t);if(!String(i.description).trim())throw q(r,"Invalid description"),new TypeError("invalid description");if(i.maximumAmount||(i.maximumAmount=1e3),i.maximumAmount<0||i.maximumAmount>9999)throw q(r,"Invalid maximum amount: "+i.maximumAmount),new TypeError("invalid maximumAmount: "+i.maximumAmount);const n=Fe({el:this.container,component:xp,props:{el:this.container,log:this.log},on:{submit:D(this,"[PayTo]: submit",o=>{this.log("[PayTo]: submit payto form",o),et().startLoading(),setTimeout(()=>{this.tokenise(o)},500)})}});this.destroy=n.destroy}tokenise(r){var s,i,n;const t={payerName:r.payerName,description:(s=this.options)==null?void 0:s.description,maximumAmount:(i=this.options)==null?void 0:i.maximumAmount,providerId:this.providerId,payerPayIdDetails:{payIdType:r.payIdType.toUpperCase(),payId:r.payId}};(n=this.httpInvoker)==null||n.invoke(_i(this.apiUrl)[Kr.TOKENISE].url,_i(this.apiUrl)[Kr.TOKENISE].method,JSON.stringify(t),this.successPayToHandler.bind(this),this.failurePayToHandler.bind(this))}successPayToAgreementHandler(){var r;et().stopLoading(),this.log("success agreement",this.tokenId),Ns(this.container,"PayTo Agreement Approved"),(r=this.successCallback)==null||r.call(this,{token:this.tokenId})}checkAgreement(){var r;this.checkAgreementHandler||(this.checkAgreementHandler=setInterval(this.checkAgreement.bind(this),5e3)),(r=this.httpInvoker)==null||r.invoke(_i(this.apiUrl,this.tokenId)[Kr.TOKEN_STATUS].url,_i(this.apiUrl,this.tokenId)[Kr.TOKEN_STATUS].method,{},D(this,"[checkAgreement], success",(t,s)=>{this.log("checkAgreement",t,s);const i=JSON.parse(s);if(!i)return clearInterval(this.checkAgreementHandler),this.failurePayToAgreementHandler(t,s);if(i.payToStatus!=="PENDING")return i.payToStatus==="ACTIVE"?(clearInterval(this.checkAgreementHandler),this.successPayToAgreementHandler()):(clearInterval(this.checkAgreementHandler),this.failurePayToAgreementHandler(t,""))}),D(this,"[checkAgreement], failure",(t,s)=>(this.log("checkAgreement",t,s),clearInterval(this.checkAgreementHandler),this.failurePayToAgreementHandler(t,s))))}}I([C],Br.prototype,"cleanUp",null),I([C],Br.prototype,"addPayTo",null),I([C],Br.prototype,"tokenise",null),I([C],Br.prototype,"successPayToAgreementHandler",null),I([C],Br.prototype,"checkAgreement",null);var H;(function(e){e.AZUPAY="azupay",e.SHIFT="shift",e.PAYGLOCAL="payglocal",e.PESAPAL="pesapal",e.ADDI="addi",e.AFFIRM="affirm",e.AFTERPAY="afterpay",e.ALMA="alma",e.APLAZAME="aplazame",e.APLAZO="aplazo",e.ATOME="atome",e.BILLEASE="billease",e.CASHEW="cashew",e.CASHPRESSO="cashpresso",e.CLEARPAY="clearpay",e.CLEO="cleo",e.DANA="dana",e.EASYPAISA="easypaisa",e.FINVERO="finvero",e.FUPAY="fupay",e.GCASG="gcasg",e.GRABPAY="grabpay",e.HUMM="humm",e.KAKAOPAY="kakaopay",e.KLARNA="klarna",e.KUESKIPAY="kueskipay",e.LARA="lara",e.LATITUDEPAY="latitudepay",e.LAYBUY="laybuy",e.LIMEPAY="limepay",e.PACE="pace",e.PAGALEVE="pagaleve",e.PARIBAS="paribas",e.PAYWITHFOUR="paywithfour",e.PAYJUSTNOW="payjustnow",e.PAYTM="paytm",e.PAYBRIGHT="paybright",e.PAYFLEX="payflex",e.PAYRIGHT="payright",e.POSTPAY="postpay",e.RATEPAY="ratepay",e.RIVERTY="riverty",e.SCALAPAY="scalapay",e.SEZZLE="sezzle",e.SHOPBACK="shopback",e.SMARTPAY="smartpay",e.SOFINCO="sofinco",e.SPLITIT="splitit",e.TABBY="tabby",e.TAMARA="tamara",e.TENDOPAY="tendopay",e.TOUCHNGO="touchngo",e.TRIPLEA="triplea",e.TRUEMONEY="truemoney",e.TWISTO="twisto",e.UPLIFT="uplift",e.VALU="valu",e.ZEST="zest",e.ZIP="zip",e.ZOODPAY="zoodpay",e.BKASH="bkash",e.ERATY="eraty",e.PAYBYACCOUNT="pay_by_account",e.UPI="upi"})(H||(H={}));const zn={[H.AZUPAY]:{name:"PayID",description:"",buttonTitle:"Pay with PayID",icon:"PayId"},[H.SHIFT]:{name:"Shift",description:"",buttonTitle:"Pay with Shift",icon:"Shift"},[H.PAYGLOCAL]:{name:"PayGLocal",description:"",buttonTitle:"Pay with PayGLocal",icon:"PayGLocal"},[H.PESAPAL]:{name:"PesaPal",description:"",buttonTitle:"Pay with PesaPal",icon:"Pesapal"},[H.PAYBYACCOUNT]:{name:"Pay By Account",description:"",buttonTitle:"Pay with Pay By Account",icon:"PayByAccount"},[H.UPI]:{name:"UPI",description:"",buttonTitle:"Pay with UPI",icon:"Upi"},[H.ADDI]:{name:"Addi",description:"",buttonTitle:"Pay with Addi",icon:"Addi"},[H.AFFIRM]:{name:"Affirm",description:"",buttonTitle:"Pay with Affirm",icon:"Affirm"},[H.AFTERPAY]:{name:"Afterpay",description:"",buttonTitle:"Pay with Afterpay",icon:"Afterpay"},[H.ALMA]:{name:"Alma",description:"",buttonTitle:"Pay with Alma",icon:"Alma"},[H.APLAZAME]:{name:"Aplazame",description:"",buttonTitle:"Pay with Aplazame",icon:"Aplazame"},[H.APLAZO]:{name:"Aplazo",description:"",buttonTitle:"Pay with Aplazo",icon:"Aplazo"},[H.ATOME]:{name:"Atome",description:"",buttonTitle:"Pay with Atome",icon:"Atome"},[H.BILLEASE]:{name:"Billease",description:"",buttonTitle:"Pay with Billease",icon:"Billease"},[H.CASHEW]:{name:"Cashew",description:"",buttonTitle:"Pay with Cashew",icon:"Cashew"},[H.CASHPRESSO]:{name:"Cashpresso",description:"",buttonTitle:"Pay with Cashpresso",icon:"Cashpresso"},[H.CLEARPAY]:{name:"Clearpay",description:"",buttonTitle:"Pay with Clearpay",icon:"Clearpay"},[H.CLEO]:{name:"Cleo",description:"",buttonTitle:"Pay with Cleo",icon:"Cleo"},[H.DANA]:{name:"Dana",description:"",buttonTitle:"Pay with Dana",icon:"Dana"},[H.EASYPAISA]:{name:"Easypaisa",description:"",buttonTitle:"Pay with Easypaisa",icon:"Easypaisa"},[H.FINVERO]:{name:"Finvero",description:"",buttonTitle:"Pay with Finvero",icon:"Finvero"},[H.FUPAY]:{name:"FuPay",description:"",buttonTitle:"Pay with FuPay",icon:"Fupay"},[H.GCASG]:{name:"GCasg",description:"",buttonTitle:"Pay with GCasg",icon:"Gcasg"},[H.GRABPAY]:{name:"GrabPay",description:"",buttonTitle:"Pay with GrabPay",icon:"Grabpay"},[H.HUMM]:{name:"Humm",description:"",buttonTitle:"Pay with Humm",icon:"Humm"},[H.KAKAOPAY]:{name:"KakaoPay",description:"",buttonTitle:"Pay with KakaoPay",icon:"Kakaopay"},[H.KLARNA]:{name:"Klarna",description:"",buttonTitle:"Pay with Klarna",icon:"Klarna"},[H.KUESKIPAY]:{name:"KueskiPay",description:"",buttonTitle:"Pay with KueskiPay",icon:"Kueskipay"},[H.LARA]:{name:"Lara",description:"",buttonTitle:"Pay with Lara",icon:"Lara"},[H.LATITUDEPAY]:{name:"LatitudePay",description:"",buttonTitle:"Pay with LatitudePay",icon:"Latitudepay"},[H.LAYBUY]:{name:"Laybuy",description:"",buttonTitle:"Pay with Laybuy",icon:"Laybuy"},[H.LIMEPAY]:{name:"Limepay",description:"",buttonTitle:"Pay with Limepay",icon:"Limepay"},[H.PACE]:{name:"Pace",description:"",buttonTitle:"Pay with Pace",icon:"Pace"},[H.PAGALEVE]:{name:"Pagaleve",description:"",buttonTitle:"Pay with Pagaleve",icon:"Pagaleve"},[H.PARIBAS]:{name:"BNP Paribas",description:"",buttonTitle:"Pay with BNP Paribas",icon:"Paribas"},[H.PAYWITHFOUR]:{name:"Pay With Four",description:"",buttonTitle:"Pay with Pay With Four",icon:"Paywithfour"},[H.PAYJUSTNOW]:{name:"PayJustNow",description:"",buttonTitle:"Pay with PayJustNow",icon:"Payjustnow"},[H.PAYTM]:{name:"PayTM",description:"",buttonTitle:"Pay with PayTM",icon:"Paytm"},[H.PAYBRIGHT]:{name:"Paybright",description:"",buttonTitle:"Pay with Paybright",icon:"Paybright"},[H.PAYFLEX]:{name:"Payflex",description:"",buttonTitle:"Pay with Payflex",icon:"Payflex"},[H.PAYRIGHT]:{name:"Payright",description:"",buttonTitle:"Pay with Payright",icon:"Payright"},[H.POSTPAY]:{name:"Postpay",description:"",buttonTitle:"Pay with Postpay",icon:"Postpay"},[H.RATEPAY]:{name:"Ratepay",description:"",buttonTitle:"Pay with Ratepay",icon:"Ratepay"},[H.RIVERTY]:{name:"Riverty",description:"",buttonTitle:"Pay with Riverty",icon:"Riverty"},[H.SCALAPAY]:{name:"Scalapay",description:"",buttonTitle:"Pay with Scalapay",icon:"Scalapay"},[H.SEZZLE]:{name:"Sezzle",description:"",buttonTitle:"Pay with Sezzle",icon:"Sezzle"},[H.SHOPBACK]:{name:"ShopBack",description:"",buttonTitle:"Pay with ShopBack",icon:"Shopback"},[H.SMARTPAY]:{name:"Smartpay",description:"",buttonTitle:"Pay with Smartpay",icon:"Smartpay"},[H.SOFINCO]:{name:"Sofinco",description:"",buttonTitle:"Pay with Sofinco",icon:"Sofinco"},[H.SPLITIT]:{name:"Splitit",description:"",buttonTitle:"Pay with Splitit",icon:"Splitit"},[H.TABBY]:{name:"Tabby",description:"",buttonTitle:"Pay with Tabby",icon:"Tabby"},[H.TAMARA]:{name:"Tamara",description:"",buttonTitle:"Pay with Tamara",icon:"Tamara"},[H.TENDOPAY]:{name:"Tendopay",description:"",buttonTitle:"Pay with Tendopay",icon:"Tendopay"},[H.TOUCHNGO]:{name:"Touch'n Go",description:"",buttonTitle:"Pay with Touch'n Go",icon:"Touchngo"},[H.TRIPLEA]:{name:"Triple-A",description:"",buttonTitle:"Pay with Triple-A",icon:"Triplea"},[H.TRUEMONEY]:{name:"TrueMoney",description:"",buttonTitle:"Pay with TrueMoney",icon:"Truemoney"},[H.TWISTO]:{name:"Twisto",description:"",buttonTitle:"Pay with Twisto",icon:"Twisto"},[H.UPLIFT]:{name:"Uplift",description:"",buttonTitle:"Pay with Uplift",icon:"Uplift"},[H.VALU]:{name:"ValU",description:"",buttonTitle:"Pay with ValU",icon:"Valu"},[H.ZEST]:{name:"Zest Money",description:"",buttonTitle:"Pay with Zest Money",icon:"Zest"},[H.ZIP]:{name:"Zip",description:"",buttonTitle:"Pay with Zip",icon:"Zip"},[H.ZOODPAY]:{name:"Zoodpay",description:"",buttonTitle:"Pay with Zoodpay",icon:"Zoodpay"},[H.BKASH]:{name:"bKash",description:"",buttonTitle:"Pay with bKash",icon:"Bkash"},[H.ERATY]:{name:"eRaty",description:"",buttonTitle:"Pay with eRaty",icon:"Eraty"}},My="",$p={},Hp=e=>(pt("data-v-d7e8386b"),e=e(),gt(),e),Gp={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48"},Yp=[Hp(()=>P("polygon",{points:"39 10.44 37.56 9 24 22.56 10.44 9 9 10.44 22.56 24 9 37.56 10.44 39 24 25.44 37.56 39 39 37.56 25.44 24 39 10.44"},null,-1))];function Kp(e,r){return Z(),re("svg",Gp,Yp)}const Ei=_e($p,[["render",Kp],["__scopeId","data-v-d7e8386b"]]),Bp=["onMousedown"],Wp={class:"modal-header"},Zp=["onClick"],Qp={class:"main-title"},Xp={class:"modal-body"},Jp={key:0,class:"modal-footer"},qp=Te({__name:"Modal",props:{width:null,height:null,mode:null,backdrop:null},emits:["close"],setup(e,{emit:r}){const t=e;function s(){r("close")}function i(){t.backdrop!=="static"&&s()}const n=cd(),o=kt(()=>!!n.footer),a=kt(()=>{const l=[];return t.width&&l.push(`width: ${t.width}`),t.height&&l.push(`height: ${t.height}`),l.join(";")}),c=kt(()=>t.mode=="confirm"?"small":"");return(l,u)=>(Z(),re("div",{class:"modal-mask",onMousedown:vn(i,["self"])},[P("div",{class:es(["modal-wrapper",me(c)]),role:"document",onClick:u[0]||(u[0]=vn(()=>{},["stop"]))},[P("div",{class:"modal-content",style:lt(me(a))},[P("div",Wp,[P("div",{class:"close-icon",onClick:vn(s,["stop"])},[ve(Ei,{size:15})],8,Zp),P("div",Qp,[ii(l.$slots,"title",{},void 0,!0)])]),P("div",Xp,[ii(l.$slots,"body",{},void 0,!0)]),me(o)?(Z(),re("div",Jp,[ii(l.$slots,"footer",{},void 0,!0)])):Pe("",!0),ii(l.$slots,"default",{},void 0,!0)],4)],2)],40,Bp))}}),Ty="",ul=_e(qp,[["__scopeId","data-v-2b2c8fc7"]]),eg=["src"],tg=Te({__name:"CheckoutPopup",props:{url:null,name:null},emits:["close"],setup(e,{emit:r}){const t=e,s=te(t.url);return te(null),Cr(()=>t.url,i=>{s.value=i}),Xe(()=>{}),(i,n)=>(Z(),Pr(ul,{width:"80vw",height:"80vh",backdrop:"static",onClose:n[0]||(n[0]=o=>r("close"))},{title:$r(()=>[Cn(He(e.name),1)]),body:$r(()=>[P("iframe",{src:s.value,sandbox:"allow-same-origin allow-scripts allow-popups allow-forms"},null,8,eg)]),_:1}))}}),Ny="",Py="",rg=_e(tg,[["__scopeId","data-v-5d26ad8f"]]),sg=["id"],ig={key:0,class:"error text-normal"},ng={class:"row"},og={key:1,class:"error"},ag=Te({__name:"CheckoutForm",props:{log:null,providerType:null,options:null},emits:["activate","popup","popupClose","close","newWindow","newWindowClose"],setup(e,{emit:r}){const t=e,s=te(null),{isLoading:i}=et(),n=te(!0),o=te(t.providerType),a=te(""),c=te(null),{errorMessage:l}=Rn(),u=kt(()=>{var M;return((M=zn[o.value])==null?void 0:M.buttonTitle)||`Pay with ${o.value}`}),d=kt(()=>{var S,F;const M=((F=(S=c.value)==null?void 0:S.gatewayTransactionData)==null?void 0:F.RedirectUrl)||"";if(!M)return"";if(o.value===H.PAYBYACCOUNT)return M;const N=M.includes("?")?"&":"?";return`${M}${N}embedded=true`}),h=te(!1),p=te(!1),m=kt(()=>d.value&&!h.value&&!p.value);function A(M){var N,S,F,O,oe,he,ae,ie,be,Ne;if((N=M==null?void 0:M.data)!=null&&N.status){if(M.data.status==="activate"&&M.data.component==="checkout"&&M.data.providerType===o.value&&((S=t.log)==null||S.call(t,`[Checkout]: message "${M.data.status}" received`,M.data),n.value=!0,r("activate",t.options)),M.data.status==="deactivate"&&M.data.component==="checkout"&&M.data.providerType===o.value&&((F=t.log)==null||F.call(t,`[Checkout]: message "${M.data.status}" received`,M.data),n.value=!1),M.data.status===wi&&M.data.component==="checkout"&&M.data.providerType===o.value&&((O=t.log)==null||O.call(t,`[Checkout]: message "${M.data.status}" received`,M.data),l.value="",c.value=M.data.checkoutData,(oe=t.log)==null||oe.call(t,"[BNPL]: checkout",c.value),window.postMessage({status:Er},"*")),M.data.status==="message"&&M.data.component==="checkout"&&M.data.providerType===o.value&&((he=t.log)==null||he.call(t,`[Checkout]: message "${M.data.status}" received`,M.data),a.value=M.data.message,p.value=!1,h.value=!1),M.data.status==="error"&&M.data.component==="checkout"&&M.data.providerType===o.value&&((ae=t.log)==null||ae.call(t,`[Checkout]: message "${M.data.status}" received`,M.data),a.value=M.data.error,M.data.originalError)){const K=JSON.parse(M.data.originalError);K!=null&&K.message&&(a.value=K.message)}M.data.status==="redirect"&&M.data.component==="checkout"&&((ie=t.log)==null||ie.call(t,`[Checkout]: message "${M.data.status}" received`,M.data),h.value=!1,M.data.result==="failed"&&(a.value="Payment has been canceled",v())),M.data.component==="checkout"&&M.data.providerType===H.PAYBYACCOUNT&&(M.data.status==="failure"?((be=t.log)==null||be.call(t,"[BNPL][PayByAccount]: message received",M.data),a.value=M.data.error,r("newWindowClose")):M.data.status==="success"&&((Ne=t.log)==null||Ne.call(t,"[BNPL][PayByAccount]: message received",M.data),l.value=""))}}function E(){var M,N,S;if(a.value="",o.value===H.PAYBYACCOUNT){(M=t.log)==null||M.call(t,"PayByAccount opens a new window");let F=400,O=645,oe=screen.width<F?0:(screen.width-F)/2,he=screen.height<O?0:(screen.height-O)/2;window.open(d.value,"_blank","popup=yes, width="+F+", height="+O+", left="+oe+", top="+he),r("newWindow",(N=c.value)==null?void 0:N.externalId)}else h.value=!0,p.value=!0,r("popup",(S=c.value)==null?void 0:S.externalId);return!1}function v(){h.value=!1,p.value=!1,r("popupClose")}return Xe(()=>{window.addEventListener("message",A),yi(s.value,Ts)||(n.value=!0,r("activate",t.options))}),Ct(()=>{window.removeEventListener("message",A)}),(M,N)=>(Z(),re(Le,null,[ft(ve(ir,{"use-local":""},null,512),[[_r,!me(d)]]),p.value&&!h.value?(Z(),Pr(ir,{key:0,message:"Finalise the payment"})):Pe("",!0),P("div",{id:`payfurl-${o.value}-form`,class:"payfurl-checkout-form",ref_key:"root",ref:s},[P("div",{class:"container-form",style:lt(`visibility: ${me(i)?"hidden":"visible"}`)},[me(l)?(Z(),re("div",ig,He(me(l)),1)):Pe("",!0),P("div",ng,[me(m)?(Z(),re("button",{key:0,onClick:E,type:"button"},He(me(u)),1)):Pe("",!0),a.value?(Z(),re("p",og,He(a.value),1)):Pe("",!0)])],4)],8,sg),h.value?(Z(),Pr(rg,{key:1,onClose:v,url:me(d),name:me(u)},null,8,["url","name"])):Pe("",!0)],64))}}),wy="",by="",lg=_e(ag,[["__scopeId","data-v-83de843a"]]),Wr={CHECKOUT:"CHECKOUT",CHECK_STATUS:"CHECK_STATUS"},Si=(e,r)=>({[Wr.CHECKOUT]:{url:e+"/payment_method/checkout",method:"POST"},[Wr.CHECK_STATUS]:{url:e+"/checkout/external/"+r,method:"GET"}});class xt{constructor(r,t){g(this,"container",null);g(this,"debug",!1);g(this,"log");g(this,"apiUrl","");g(this,"redirectUrl","");g(this,"checkStatusHandler",null);g(this,"failureCallback",null);g(this,"successCallback",null);g(this,"httpInvoker",null);g(this,"destroy",()=>{});this.log=r,this.debug=t.debug,this.apiUrl=t.apiUrl,this.redirectUrl=t.redirectUrl,this.failureCallback=t.onFailure||null,this.successCallback=t.onSuccess||null;const s=new Tt(t.environment,Nt(t.publicKey));this.httpInvoker=new ht(t.publicKey,t.version,s)}cleanUp(r){var t,s;((t=this.container)==null?void 0:t.id)===(r==null?void 0:r.id)&&((s=this.destroy)==null||s.call(this))}addCheckout(r,t,s,i,n,o,a){this.log(`[addCheckout][${i}]`,{amount:t,providerId:n,providerType:i,options:o,checkoutOptions:a}),this.container=r;let c=!1,l;const u=Fe({el:r,component:lg,props:{log:this.log,providerType:i,options:{providerId:n,amount:t,currency:s,checkoutOptions:a}},on:{activate:D(this,"[sdk][checkoutProcessor][${providerType}]: activate checkout form",d=>{if(c)return;c=!0,this.log(`[sdk][checkoutProcessor][${i}]: activate checkout form`,d);const h=()=>{c=!1};this.checkout(d,i,o,h),l=this.getMessageHandler(d,i,o,h).bind(this),window.addEventListener("message",l)}),popup:D(this,"[sdk][checkoutProcessor][${providerType}]: popup open",d=>{this.log(`[sdk][checkoutProcessor][${i}]: popup open`,d),this.checkStatus(r,d,i,l)}),popupClose:D(this,"[sdk][checkoutProcessor][${providerType}]: popup close",()=>{this.log(`[sdk][checkoutProcessor][${i}]: popup close`),this.stopCheckingStatus(null)}),newWindow:D(this,"[sdk][checkoutProcessor][${providerType}]: new window open",d=>{this.log(`[sdk][checkoutProcessor][${i}]: new window open`,d),this.checkStatus(r,d,i,l)}),newWindowClose:D(this,"[sdk][checkoutProcessor][${providerType}]: new window close",()=>{this.log(`[sdk][checkoutProcessor][${i}]: new window close`),this.stopCheckingStatus(null)})}});this.destroy=u.destroy}checkout(r,t,s,i){var n,o,a,c,l,u,d,h,p,m,A,E,v,M;(M=this.httpInvoker)==null||M.invoke(Si(this.apiUrl)[Wr.CHECKOUT].url,Si(this.apiUrl)[Wr.CHECKOUT].method,JSON.stringify({providerId:r.providerId,amount:r.amount,currency:r.currency,shippingAmount:s.shippingAmount,customer:{firstName:(n=s.customer)==null?void 0:n.firstName,lastName:(o=s.customer)==null?void 0:o.lastName,email:(a=s.customer)==null?void 0:a.email,phone:(c=s.customer)==null?void 0:c.phoneNumber,billingAddress:{name:((l=s.billingAddress)==null?void 0:l.firstName)+" "+((u=s.billingAddress)==null?void 0:u.lastName),addressLine1:(d=s.billingAddress)==null?void 0:d.streetAddress,addressLine2:(h=s.billingAddress)==null?void 0:h.streetAddress2,suburb:(p=s.billingAddress)==null?void 0:p.region,state:(m=s.billingAddress)==null?void 0:m.state,countryCode:(A=s.billingAddress)==null?void 0:A.country,postcode:(E=s.billingAddress)==null?void 0:E.postalCode}},items:(v=s.orderItems)==null?void 0:v.map(N=>({name:N.name,reference:N.sku,quantity:N.quantity,amount:N.totalAmount})),options:{...r.checkoutOptions,redirectUrl:this.redirectUrl}}),this.getSuccessCheckoutHandler(t).bind(this),D(this,"[sdk][checkoutProcessor][${providerType}]: failureCheckoutHandler",(N,S)=>{i==null||i(N,S),this.getFailureCheckoutHandler(t).bind(this)(N,S)}))}getSuccessCheckoutHandler(r){return D(this,"[sdk][checkoutProcessor][${providerType}]: successCheckoutHandler",(t,s)=>{this.log(`[sdk][checkoutProcessor][${r}]: successCheckoutHandler`,t,s);const i=JSON.parse(s),n=JSON.parse(window.atob(i.checkoutData));window.postMessage({status:wi,component:"checkout",providerType:r,checkoutData:n},"*")})}getFailureCheckoutHandler(r){return D(this,"[sdk][checkoutProcessor][${providerType}]: failureCheckoutHandler",(t,s)=>{this.log(`[sdk][checkoutProcessor][${r}]: failureCheckoutHandler`,t,s),et().stopLoading(),window.postMessage({status:"error",component:"checkout",providerType:r,error:"Invalid payment details",originalError:s},"*")})}stopCheckingStatus(r){this.checkStatusHandler&&(clearInterval(this.checkStatusHandler),this.checkStatusHandler=null),r&&window.removeEventListener("message",r)}checkStatus(r,t,s,i){var c;this.checkStatusHandler||(this.checkStatusHandler=setInterval(this.checkStatus.bind(this,r,t,s,i),5e3),this.log(`[sdk][checkoutProcessor][${s}]: Starting polling...`));const n=this,o=D(this,`[sdk][checkoutProcessor][${s}]: failureCheckStatusHandler`,(l,u)=>{et().stopLoading(),n.log(`[sdk][checkoutProcessor][${s}]: failureCheckStatusHandler`,l,u),window.postMessage({status:"message",component:"checkout",providerType:s,message:"Checkout has been cancelled"},"*")}),a=D(this,`[sdk][checkoutProcessor][${s}]: successCheckStatusHandler`,(l,u)=>{var h;et().stopLoading(),n.log(`[sdk][checkoutProcessor][${s}]: successCheckStatusHandler`,{transactionId:l,token:u}),Ns(r,"Transaction in progress. Please don't close the window or navigate away");const d={};l&&(d.transactionId=l),u&&(d.token=u),(h=n.successCallback)==null||h.call(n,d)});(c=this.httpInvoker)==null||c.invoke(Si(this.apiUrl,t)[Wr.CHECK_STATUS].url,Si(this.apiUrl,t)[Wr.CHECK_STATUS].method,{},D(this,`[sdk][checkoutProcessor][${s}]: checkStatus, success`,(l,u)=>{const d=JSON.parse(u);if(this.log("checkoutStatus",d),!d)return this.stopCheckingStatus(i),o(l,u);if(d.status=="SUCCESS"&&d.status==="SUCCESS")return this.stopCheckingStatus(i),a(d.transactionId,d.tokenId)}),D(this,`[sdk][checkoutProcessor][${s}]: checkStatus, failure`,(l,u)=>(this.log(`[sdk][checkoutProcessor][${s}]: checkStatus`,{status:l,body:u}),this.stopCheckingStatus(i),o(l,u))))}validateOptions(r,t,s,i){var n,o,a,c,l,u,d,h,p,m,A,E,v,M,N,S,F,O,oe;if(!ct(s))throw q(r,"Invalid currency: "+s),new TypeError("Invalid currency: "+s);if(!qe(t))throw q(r,"Invalid amount: "+t),new TypeError("Invalid amount: "+t);if(!Array.isArray(i.orderItems)||((n=i.orderItems)==null?void 0:n.length)===0)throw q(r,"Invalid order"),new TypeError("Invalid order");if(!((o=i.customer)!=null&&o.email)||!Ds((a=i.customer)==null?void 0:a.email))throw q(r,"Invalid customer email"),new TypeError("Invalid customer email");if(!((c=i.customer)!=null&&c.firstName)&&!((l=i.customer)!=null&&l.lastName))throw q(r,"Invalid customer name"),new TypeError("Invalid customer name");if(!((u=i.customer)!=null&&u.phoneNumber)||!mi((d=i.customer)==null?void 0:d.phoneNumber))throw q(r,"Invalid customer phone number"),new TypeError("Invalid customer phone number");if(!((h=i.billingAddress)!=null&&h.email)||!Ds((p=i.billingAddress)==null?void 0:p.email))throw q(r,"Invalid billing address email"),new TypeError("Invalid billing address email");if(!((m=i.billingAddress)!=null&&m.firstName)&&!((A=i.billingAddress)!=null&&A.lastName))throw q(r,"Invalid billing address name"),new TypeError("Invalid billing address name");if(!((E=i.billingAddress)!=null&&E.phoneNumber)||!mi((v=i.billingAddress)==null?void 0:v.phoneNumber))throw q(r,"Invalid billing address phone number"),new TypeError("Invalid billing address phone number");if(!((M=i.billingAddress)!=null&&M.streetAddress))throw q(r,"Invalid billing street address"),new TypeError("Invalid billing street address");if(!((N=i.billingAddress)!=null&&N.city))throw q(r,"Invalid billing city"),new TypeError("Invalid billing city");if(!((S=i.billingAddress)!=null&&S.country))throw q(r,"Invalid billing country"),new TypeError("Invalid billing country");if(!((F=i.billingAddress)!=null&&F.region))throw q(r,"Invalid billing region"),new TypeError("Invalid billing region");if(!((O=i.billingAddress)!=null&&O.state))throw q(r,"Invalid billing state"),new TypeError("Invalid billing state");if(!((oe=i.billingAddress)!=null&&oe.postalCode))throw q(r,"Invalid billing postal code"),new TypeError("Invalid billing postal code")}getMessageHandler(r,t,s,i){return D(this,`[sdk][checkoutProcessor][${t}]: message received`,n=>{var o;if((o=n==null?void 0:n.data)!=null&&o.status){if(n.data.status===Ps){if(Number(r.amount)==Number(n.data.amount))return;this.log(`[sdk][checkoutProcessor][${t}]: message received`,n.data),r.amount=Number(n.data.amount),this.checkout(r,t,s,i);return}if(n.data.status===ws){if(r.currency==n.data.currency)return;this.log(`[sdk][checkoutProcessor][${t}]: message received`,n.data),r.currency=n.data.currency,this.checkout(r,t,s,i);return}}})}}I([C],xt.prototype,"cleanUp",null),I([C],xt.prototype,"addCheckout",null),I([C],xt.prototype,"checkout",null),I([C],xt.prototype,"getSuccessCheckoutHandler",null),I([C],xt.prototype,"getFailureCheckoutHandler",null),I([C],xt.prototype,"stopCheckingStatus",null),I([C],xt.prototype,"checkStatus",null),I([C],xt.prototype,"validateOptions",null),I([C],xt.prototype,"getMessageHandler",null);const Wt={name:"@payfurl/client",private:!1,version:"4.6.17",files:["dist/sdk"],main:"./dist/sdk/payfurl.umd.js",module:"./dist/sdk/payfurl.es.js",types:"./dist/sdk/payfurl.d.ts",exports:{".":{import:"./dist/sdk/payfurl.es.js",require:"./dist/sdk/payfurl.umd.js"}},scripts:{dev:"vite -c vite.iframe.config.ts","build-iframe":"vite build -c vite.iframe.config.ts --emptyOutDir","build-sdk":"vite build -c vite.sdk.config.ts","build-all":"npm run build-iframe && npm run build-sdk",preview:"vite preview",server:"python3 -m http.server 3001",test:"jest"},dependencies:{dayjs:"^1.11.7",vue:"^3.2.47"},devDependencies:{"@babel/preset-env":"^7.24.8","@babel/types":"^7.21.2","@rollup/plugin-typescript":"^11.0.0","@types/applepayjs":"^14.0.0","@types/jest":"^29.5.12","@types/jest-when":"^3.5.5","@types/node":"^18.14.2","@vitejs/plugin-vue":"^4.0.0","@vue/eslint-config-prettier":"^7.1.0","@vue/eslint-config-typescript":"^11.0.2","@vue/vue3-jest":"^29.2.6",eslint:"^8.35.0","eslint-plugin-vue":"^9.9.0",jest:"^29.7.0","jest-environment-jsdom":"^29.7.0","jest-when":"^3.6.0","js-crypto-aes":"^1.0.6",prettier:"^2.8.4","rollup-plugin-visualizer":"^5.12.0","ts-jest":"^29.2.3","ts-node":"^10.9.2",typescript:"^4.9.5",vite:"^4.1.4","vue-tsc":"^1.2.0"}},Fn={CHECK_FRAUD:"CHECK_FRAUD"},dl=e=>({[Fn.CHECK_FRAUD]:{url:e+"/fraud_check",method:"POST"}});class hl{constructor(r,t){g(this,"providerId","");g(this,"stopPaymentOnFailure",!1);g(this,"debug",!1);g(this,"log");g(this,"apiUrl","");g(this,"getFraudCheckData");g(this,"metadata",{});g(this,"amount",0);g(this,"currency","AUD");g(this,"address",null);g(this,"customer",null);g(this,"order",null);g(this,"paymentInformation",null);g(this,"paypalInformation",null);g(this,"failureCallback",null);g(this,"successCallback",null);g(this,"checkResult",null);g(this,"httpInvoker",null);this.log=r,this.providerId=t.providerId,this.stopPaymentOnFailure=t.stopPaymentOnFailure,this.debug=t.debug,this.apiUrl=t.apiUrl,this.metadata=t.metadata,this.getFraudCheckData=t.getFraudCheckData,this.failureCallback=t.onFailure||null,this.successCallback=t.onSuccess||null;const s=new Tt(t.environment,Nt(t.publicKey));this.httpInvoker=new ht(t.publicKey,t.version,s)}fraudCheck(r,t){var s;if(!this.customer)return t({error:"Customer information is required"});if(!this.address)return t({error:"Address information is required"});if(!this.order)return t({error:"Order information is required"});if(!this.paymentInformation&&!this.paypalInformation)return t({error:"Payment information is required"});this.log("[fraudCheck]",{amount:this.amount,currency:this.currency,paymentInformation:this.paymentInformation,paypalInformation:this.paypalInformation,customer:this.customer,address:this.address,order:this.order,metadata:this.metadata}),(s=this.httpInvoker)==null||s.invoke(dl(this.apiUrl)[Fn.CHECK_FRAUD].url,dl(this.apiUrl)[Fn.CHECK_FRAUD].method,this.getFraudCheckData(this.providerId,this.amount,this.currency,this.paymentInformation,this.paypalInformation,this.customer,this.address,this.order,this.metadata),D(this,"[fraudCheck], success",(i,n)=>{if(this.log("[fraudCheck], success",i,n,this.stopPaymentOnFailure),this.checkResult=JSON.parse(n),this.checkResult===null)return t({error:"Fraud Check Failed",body:n});this.checkResult.providerId=this.providerId,this.checkResult.stopPaymentOnFailure=this.stopPaymentOnFailure,r(this.checkResult)}),D(this,"[fraudCheck], failure",(i,n)=>{this.log("[fraudCheck], failure",i,n),t({error:"Fraud Check Failed",body:n})}))}setAmount(r){this.amount=r}setCurrency(r){this.currency=r}setAddressInfo(r){this.address={...r}}setCustomerInfo(r){this.customer={...r}}setOrderInfo(r){this.order={...r}}setPaymentInfo(r){this.paymentInformation={...r}}setPaypalInfo(r){this.paypalInformation={...r}}getProviderId(){return this.providerId}getCheckResult(){return this.checkResult}}I([C],hl.prototype,"fraudCheck",null);const cg={style:{position:"relative"}},ug={key:0,class:"error text-normal"},dg=Te({__name:"GooglePayForm",props:{log:null,el:null,environment:null,amount:null,currency:null,options:null},emits:["complete","activate","close","error"],setup(e,{emit:r}){const t=e,s="payfurl-googlepay-script",i=te(null),n=te(t.amount),o=te(t.currency),a=te(!0),c=te("");let l=!1;const{isLoading:u}=et();function d(){if(l)return;if(l=!0,document.getElementById(s)){S();return}window.google=null;const O=document.createElement("script");O.src="https://pay.google.com/gp/p/js/pay.js",O.type="text/javascript",O.id=s,O.onload=S,document.body.appendChild(O)}let h=null;function p(){return h===null&&(h=new window.google.payments.api.PaymentsClient({environment:t.environment!=$e.PRODUCTION?"TEST":"PRODUCTION"})),h}const m={type:"CARD",parameters:{allowedAuthMethods:["PAN_ONLY","CRYPTOGRAM_3DS"],allowedCardNetworks:["AMEX","DISCOVER","INTERAC","JCB","MASTERCARD","VISA"]}};function A(){return{apiVersion:2,apiVersionMinor:0,allowedPaymentMethods:[m]}}function E(){const oe=p().createButton({onClick:M});t.el.appendChild(oe)}function v(){return t.environment!=$e.PRODUCTION?{merchantName:t.options.googlePayMerchantName??"Example Merchant"}:{merchantName:t.options.googlePayMerchantName??"Example Merchant",merchantId:t.options.googlePayMerchantId}}function M(){const O=N(),oe=p();t.log("[paymentData], request",O),oe.loadPaymentData(O).then(function(he){t.log("[paymentData], success",he);const ae=JSON.parse(he.paymentMethodData.tokenizationData.token);he.paymentMethodData.tokenizationData={...he.paymentMethodData.tokenizationData,...ae},r("complete",he)}).catch(function(he){t.log("[paymentData], error",he),r("error",he.message)})}function N(){return{apiVersion:2,apiVersionMinor:0,allowedPaymentMethods:[{...m,tokenizationSpecification:{type:"PAYMENT_GATEWAY",parameters:{gateway:t.options.gateway,gatewayMerchantId:t.options.googlePayGatewayMerchantId}}}],transactionInfo:{totalPriceStatus:"FINAL",countryCode:"AU",currencyCode:o.value,totalPrice:Number(n.value).toFixed(2)},merchantInfo:v()}}function S(){p().isReadyToPay(A()).then(function(oe){oe.result&&(E(),window.postMessage({status:Er},"*"))}).catch(function(oe){console.error("Load GooglePay error",oe)})}function F(O){var oe,he,ae,ie,be,Ne,K;(oe=O==null?void 0:O.data)!=null&&oe.status&&(O.data.status==="activate"&&O.data.component==="googlepay"&&((he=t.log)==null||he.call(t,`[GooglePay]: message "${O.data.status}" received`,O.data),a.value=!0,r("activate"),d()),O.data.status==="deactivate"&&O.data.component==="googlepay"&&((ae=t.log)==null||ae.call(t,`[GooglePay]: message "${O.data.status}" received`,O.data),a.value=!1),O.data.status==="message"&&O.data.component==="googlepay"&&((ie=t.log)==null||ie.call(t,`[GooglePay]: message "${O.data.status}" received`,O.data),c.value=O.data.message),O.data.status==="error"&&O.data.component==="googlepay"&&((be=t.log)==null||be.call(t,`[GooglePay]: message "${O.data.status}" received`,O.data),c.value=O.data.error),O.data.status===Ps&&((Ne=t.log)==null||Ne.call(t,`[GooglePay]: message "${O.data.status}" received`,O.data),n.value=Number(O.data.amount)),O.data.status===ws&&((K=t.log)==null||K.call(t,`[GooglePay]: message "${O.data.status}" received`,O.data),o.value=O.data.currency))}return Ct(()=>{window.removeEventListener("message",F)}),Xe(()=>{window.addEventListener("message",F),yi(i.value,Ts)||(a.value=!0,r("activate"),d())}),(O,oe)=>(Z(),re(Le,null,[P("div",cg,[ft(ve(ir,null,null,512),[[_r,me(u)]])]),P("div",{style:{position:"relative"},ref_key:"root",ref:i},[c.value?(Z(),re("div",ug,He(c.value),1)):Pe("",!0)],512)],64))}}),Vn={ADD_CHARGE_WITH_GOOGLE_PAY:"ADD_CHARGE_WITH_GOOGLE_PAY"},pl=e=>({[Vn.ADD_CHARGE_WITH_GOOGLE_PAY]:{url:e+"/charge/token/google",method:"POST"}});class kr{constructor(r,t){g(this,"container",null);g(this,"log");g(this,"apiUrl","");g(this,"environment","");g(this,"failureCallback",null);g(this,"successCallback",null);g(this,"httpInvoker",null);g(this,"destroy",()=>{});g(this,"providerId","");g(this,"amount",0);g(this,"currency","");g(this,"billingAddress",null);g(this,"customer",null);g(this,"order",null);this.log=r,this.environment=t.environment,this.apiUrl=t.apiUrl,this.failureCallback=t.onFailure||null,this.successCallback=t.onSuccess||null;const s=new Tt(t.environment,Nt(t.publicKey));this.httpInvoker=new ht(t.publicKey,t.version,s)}setAmount(r){this.amount=r}setCurrency(r){this.currency=r}setCustomerInfo(r){this.customer={...r}}setBillingAddress(r){this.billingAddress={...r}}setOrderInfo(r){this.order={...r}}cleanUp(r){var t;r===this.container&&((t=this.destroy)==null||t.call(this))}addGooglePay(r,t,s,i,n){this.log("[addGooglePay]",{providerId:t,amount:s,currency:i,options:n}),this.validateOptions(r,s,i,n),this.setAmount(s),this.setCurrency(i);let o=!1;this.container=r;const a=Fe({el:r,component:dg,props:{log:this.log,el:r,environment:this.environment,amount:this.amount,currency:this.currency,options:n},on:{activate:D(this,"[GooglePay]: activate",()=>{o||(o=!0,this.log("[GooglePay]: activate googlepay form"))}),complete:D(this,"[GooglePay]: complete",c=>{var u,d,h,p;this.log("[GooglePay]: complete",c);const l={amount:this.amount,currency:this.currency,paymentData:{paymentMethodData:{tokenizationData:{intermediateSigningKey:c.paymentMethodData.tokenizationData.intermediateSigningKey,protocolVersion:c.paymentMethodData.tokenizationData.protocolVersion,signature:c.paymentMethodData.tokenizationData.signature,signedMessage:c.paymentMethodData.tokenizationData.signedMessage}},paymentInfo:{cardDetails:c.paymentMethodData.info.cardDetails,cardNetwork:c.paymentMethodData.info.cardNetwork}},firstName:(u=this.customer)==null?void 0:u.firstName,lastName:(d=this.customer)==null?void 0:d.lastName,email:(h=this.customer)==null?void 0:h.email,phone:(p=this.customer)==null?void 0:p.phoneNumber,address:this.billingAddress&&{line1:this.billingAddress.streetAddress,line2:this.billingAddress.streetAddress2,city:this.billingAddress.city,country:this.billingAddress.country,postalCode:this.billingAddress.postalCode,state:this.billingAddress.state}||void 0,order:this.order&&{dutyAmount:this.order.taxAmount,freightAmount:this.order.shippingAmount,items:this.order.orderItems.map(m=>({description:m.name,productCode:m.sku,quantity:m.quantity,amount:m.totalAmount}))}||void 0};this.addChargeWithGooglePay(r,t,l)}),error:D(this,"[GooglePay]: error",c=>{var l;this.log("[GooglePay]: error",c),q(r,"Unable to pay with Google Pay"),(l=this.failureCallback)==null||l.call(this,{error:"Unable to pay with Google Pay",body:c})})}});this.destroy=a.destroy}addChargeWithGooglePay(r,t,s){var i;this.log("[addChargeWithGooglePay]",s),(i=this.httpInvoker)==null||i.invoke(pl(this.apiUrl)[Vn.ADD_CHARGE_WITH_GOOGLE_PAY].url,pl(this.apiUrl)[Vn.ADD_CHARGE_WITH_GOOGLE_PAY].method,JSON.stringify(s),this.getSuccessAddChargeHandler(r).bind(this),this.getFailureAddChargeHandler(r).bind(this),{providerId:t})}getFailureAddChargeHandler(r){return D(this,"[GooglePay], failure",(t,s)=>{var i;this.log("[GooglePay], failure",s),q(r,"Unable to pay with Google Pay"),(i=this.failureCallback)==null||i.call(this,{error:"Unable to pay with Google Pay",body:s})})}getSuccessAddChargeHandler(r){return D(this,"[GooglePay], success",(t,s)=>{var n;const i=JSON.parse(s);this.log("[GooglePay], success",i),(n=this.successCallback)==null||n.call(this,{transactionId:i.chargeId})})}validateOptions(r,t,s,i){if(!ct(s))throw q(r,"Invalid currency: "+s),new TypeError("invalid currency: "+s);if(!qe(t))throw q(r,"Invalid amount: "+t),new TypeError("invalid amount: "+t);if(!i.gateway)throw q(r,"Invalid gateway parameter"),new TypeError("Invalid gateway parameter");if(!i.googlePayGatewayMerchantId)throw q(r,"Invalid gateway merchant id parameter"),new TypeError("Invalid gateway merchant id parameter")}}I([C],kr.prototype,"cleanUp",null),I([C],kr.prototype,"addGooglePay",null),I([C],kr.prototype,"addChargeWithGooglePay",null),I([C],kr.prototype,"getFailureAddChargeHandler",null),I([C],kr.prototype,"getSuccessAddChargeHandler",null),I([C],kr.prototype,"validateOptions",null);const hg={style:{position:"relative"}},pg={key:0,class:"error text-normal"},gg=Te({__name:"ApplePayForm",props:{log:null,el:null,environment:null,amount:null,currency:null,options:null},emits:["submit","validate","activate","close","error","cancel"],setup(e,{emit:r}){const t=e,s="payfurl-applepay-script",i=te(null),n=te(t.amount),o=te(t.currency),a=te(!0),c=te("");let l=!1;const{isLoading:u}=et();function d(){if(t.log("[onApplePayButtonClicked]"),!ApplePaySession)return;const m={countryCode:"AU",currencyCode:o.value,merchantCapabilities:["supports3DS"],supportedNetworks:["visa","masterCard","amex","discover"],total:{label:t.options.lineItemLabel,type:"final",amount:Number(n.value).toFixed(2)}};t.log("[onApplePayButtonClicked], Create ApplePaySession",m);const A=new ApplePaySession(3,m);A.onvalidatemerchant=E=>{const v=E.validationURL;r("validate",{validationUrl:v,merchantIdentifier:t.options.merchantIdentifier,domainName:t.options.domainName,displayName:t.options.displayName},A)},A.onpaymentauthorized=E=>{t.log("[onpaymentauthorized]",E),r("submit",E.payment,A)},A.oncancel=E=>{t.log("[oncancel]",E),r("cancel")},A.begin()}function h(){if(document.getElementById(s)||l)return;l=!0,window.google=null;const m=document.createElement("script");m.src="https://applepay.cdn-apple.com/jsapi/v1/apple-pay-sdk.js",m.type="text/javascript",m.id=s,m.onload=()=>{var E;const A=document.createElement("apple-pay-button");A.buttonstyle="black",A.locale="en-US",A.type="buy",A.onclick=d,(E=i.value)==null||E.appendChild(A),window.postMessage({status:Er},"*")},document.body.appendChild(m)}function p(m){var A,E,v,M,N,S,F;(A=m==null?void 0:m.data)!=null&&A.status&&(m.data.status==="activate"&&m.data.component==="applepay"&&((E=t.log)==null||E.call(t,`[ApplePay]: message "${m.data.status}" received`,m.data),a.value=!0,r("activate"),h()),m.data.status==="deactivate"&&m.data.component==="applepay"&&((v=t.log)==null||v.call(t,`[ApplePay]: message "${m.data.status}" received`,m.data),a.value=!1),m.data.status==="message"&&m.data.component==="applepay"&&((M=t.log)==null||M.call(t,`[ApplePay]: message "${m.data.status}" received`,m.data),c.value=m.data.message),m.data.status==="error"&&m.data.component==="applepay"&&((N=t.log)==null||N.call(t,`[ApplePay]: message "${m.data.status}" received`,m.data),c.value=m.data.error),m.data.status===Ps&&((S=t.log)==null||S.call(t,`[ApplePay]: message "${m.data.status}" received`,m.data),n.value=Number(m.data.amount)),m.data.status===ws&&((F=t.log)==null||F.call(t,`[ApplePay]: message "${m.data.status}" received`,m.data),o.value=m.data.currency))}return Ct(()=>{window.removeEventListener("message",p)}),Xe(()=>{window.addEventListener("message",p),yi(i.value,Ts)||(a.value=!0,r("activate"),h())}),(m,A)=>(Z(),re(Le,null,[P("div",hg,[ft(ve(ir,null,null,512),[[_r,me(u)]])]),P("div",{style:{position:"relative"},ref_key:"root",ref:i},[c.value?(Z(),re("div",pg,He(c.value),1)):Pe("",!0)],512)],64))}}),Zr={VALIDATE_MERCHANT:"VALIDATE_MERCHANT",ADD_CHARGE_WITH_APPLE_PAY:"ADD_CHARGE_WITH_APPLE_PAY"},ki=e=>({[Zr.VALIDATE_MERCHANT]:{url:e+"/charge/token/apple/validate",method:"POST"},[Zr.ADD_CHARGE_WITH_APPLE_PAY]:{url:e+"/charge/token/apple",method:"POST"}});class nr{constructor(r,t){g(this,"container",null);g(this,"log");g(this,"apiUrl","");g(this,"environment","");g(this,"publicKey","");g(this,"version","");g(this,"applePayButton",null);g(this,"failureCallback",null);g(this,"successCallback",null);g(this,"httpInvoker",null);g(this,"destroy",()=>{});g(this,"providerId","");g(this,"amount",0);g(this,"currency","");g(this,"billingAddress",null);g(this,"customer",null);g(this,"order",null);this.log=r,this.environment=t.environment,this.apiUrl=t.apiUrl,this.publicKey=t.publicKey,this.version=t.version,this.failureCallback=t.onFailure||null,this.successCallback=t.onSuccess||null;const s=new Tt(t.environment,Nt(t.publicKey));this.httpInvoker=new ht(t.publicKey,t.version,s)}setAmount(r){var t;this.amount=r,(t=this.applePayButton)==null||t.setAmount(r)}setCurrency(r){var t;this.currency=r,(t=this.applePayButton)==null||t.setCurrency(r)}setCustomerInfo(r){var t;this.customer={...r},(t=this.applePayButton)==null||t.setCustomerInfo(r)}setBillingAddress(r){var t;this.billingAddress={...r},(t=this.applePayButton)==null||t.setBillingAddress(r)}setOrderInfo(r){var t;this.order={...r},(t=this.applePayButton)==null||t.setOrderInfo(r)}cleanUp(r){var t,s;(r==null?void 0:r.id)===((t=this.container)==null?void 0:t.id)&&((s=this.destroy)==null||s.call(this))}addApplePay(r,t,s,i,n){this.log("[addApplePay]",{providerId:t,amount:s,currency:i,options:n}),this.validateOptions(r,s,i,n),this.setAmount(s),this.setCurrency(i);let o=!1;this.container=r;const a=D(this,"[ApplePay][renderDefaultComponent]",()=>{this.log("[addApplePay], renderDefaultComponent",{providerId:t,amount:s,currency:i,options:n});const l=Fe({el:r,component:gg,props:{log:this.log,el:r,environment:this.environment,amount:this.amount,currency:this.currency,options:n},on:{activate:()=>{o||(o=!0,this.log("activate applepay form"))},validate:D(this,"[addApplePay], validate",(u,d)=>{this.log("[ApplePay]: validate",u),this.validateMerchant(r,t,u,d)}),submit:D(this,"[addApplePay], submit",(u,d)=>{var p,m,A,E;this.log("[ApplePay]: complete",u);const h={amount:this.amount,currency:this.currency,token:u.token,firstName:(p=this.customer)==null?void 0:p.firstName,lastName:(m=this.customer)==null?void 0:m.lastName,email:(A=this.customer)==null?void 0:A.email,phone:(E=this.customer)==null?void 0:E.phoneNumber,address:this.billingAddress&&{line1:this.billingAddress.streetAddress,line2:this.billingAddress.streetAddress2,city:this.billingAddress.city,country:this.billingAddress.country,postalCode:this.billingAddress.postalCode,state:this.billingAddress.state}||void 0,order:this.order&&{dutyAmount:this.order.taxAmount,freightAmount:this.order.shippingAmount,items:this.order.orderItems.map(v=>({description:v.name,productCode:v.sku,quantity:v.quantity,amount:v.totalAmount}))}||void 0};this.addChargeWithApplePay(r,t,h,d)}),error:D(this,"[addApplePay], error",(u,d)=>{var h;this.log("[ApplePay]: error",u),q(r,"Unable to pay with ApplePay"),d.completePayment({status:ApplePaySession.STATUS_FAILURE,errors:[{code:"unknown",message:u}]}),(h=this.failureCallback)==null||h.call(this,{error:"Unable to pay with ApplePay",body:u})}),cancel:D(this,"[addApplePay], calcel",()=>{var u;this.log("[ApplePay]: cancel"),q(r,"ApplePay canceled"),(u=this.failureCallback)==null||u.call(this,{error:"ApplePay canceled"})})}});this.destroy=l.destroy}),c=D(this,"[ApplePay][renderCustomComponent]",l=>{var u,d,h,p;this.log("[addApplePay], renderCustomComponent",{providerId:t,amount:s,currency:i,options:n}),this.applePayButton=l.default(this.log.bind(this),r,n.providerId,s,i,{environment:this.environment,publicKey:this.publicKey,apiUrl:this.apiUrl,version:this.version,options:n,clientParameters:n.clientParameters,onSuccess:D(this,"[addApplePay], success",m=>{var E,v;this.log("[addApplePay], success",m),(E=this.applePayButton)==null||E.hide();const A={token:m.token,transactionId:m.transactionId};m.clickToPayData&&(A.clickToPayData=m.clickToPayData),(v=this.successCallback)==null||v.call(this,A)}),onFailure:D(this,"[addApplePay], failure",m=>{var A,E;this.log("[addApplePay], failure",m),(A=this.applePayButton)==null||A.redraw(),(E=this.failureCallback)==null||E.call(this,{error:m.error})})}),this.billingAddress&&((u=this.applePayButton)==null||u.setBillingAddress(this.billingAddress)),this.customer&&((d=this.applePayButton)==null||d.setCustomerInfo(this.customer)),this.order&&((h=this.applePayButton)==null||h.setOrderInfo(this.order)),(p=this.applePayButton)==null||p.draw(),window.postMessage({status:Er},"*")});at(Object.assign({"./applepay/ApplePayButton.interface.ts":()=>Promise.resolve().then(()=>Bg),"./applepay/ApplePayButtonOptions.type.ts":()=>Promise.resolve().then(()=>Wg),"./applepay/PayWayAppleButton.ts":()=>Promise.resolve().then(()=>Zg),"./applepay/payway_rest.ts":()=>Promise.resolve().then(()=>Xg)}),`./applepay/${n.providerType.toLowerCase()}.ts`).then(D(this,"[localAddApplePay], then",l=>{this.log(`Loading ${n.providerType}...`,l),c(l)})).catch(()=>{this.log(`Error loading ${n.providerType}`),a()})}validateMerchant(r,t,s,i){var n;this.log("[validateMerchant]",s),(n=this.httpInvoker)==null||n.invoke(ki(this.apiUrl)[Zr.VALIDATE_MERCHANT].url,ki(this.apiUrl)[Zr.VALIDATE_MERCHANT].method,JSON.stringify(s),D(this,"[validateMerchant], success",(o,a)=>{try{const c=JSON.parse(a);this.log("[validateMerchant], success",c),i.completeMerchantValidation(c)}catch(c){this.log("error parsing validateMerchant response",c)}}),D(this,"[validateMerchant], failure",(o,a)=>{var c;this.log("[validateMerchant], failure",a),q(r,"Unable to pay with ApplePay"),(c=this.failureCallback)==null||c.call(this,{error:"Unable to pay with ApplePay",body:a})}),{providerId:t})}addChargeWithApplePay(r,t,s,i){var n;this.log("[addChargeWithApplePay]",s),(n=this.httpInvoker)==null||n.invoke(ki(this.apiUrl)[Zr.ADD_CHARGE_WITH_APPLE_PAY].url,ki(this.apiUrl)[Zr.ADD_CHARGE_WITH_APPLE_PAY].method,JSON.stringify(s),this.getSuccessAddChargeHandler(r,i).bind(this),this.getFailureAddChargeHandler(r,i).bind(this),{providerId:t})}getFailureAddChargeHandler(r,t){return D(this,"[getFailureAddChargeHandler]",(s,i)=>{var n;this.log("[ApplePay], failure",i),q(r,"Unable to pay with ApplePay"),t.completePayment({status:ApplePaySession.STATUS_FAILURE,errors:[{code:"unknown",message:i}]}),(n=this.failureCallback)==null||n.call(this,{error:"Unable to pay with ApplePay",body:i})})}getSuccessAddChargeHandler(r,t){return D(this,"[getSuccessAddChargeHandler]",(s,i)=>{var a;const n=JSON.parse(i);this.log("[ApplePay], success",n);const o={status:ApplePaySession.STATUS_SUCCESS,paymentToken:n};t.completePayment(o),(a=this.successCallback)==null||a.call(this,{transactionId:n.chargeId})})}validateOptions(r,t,s,i){if(!ct(s))throw q(r,"Invalid currency: "+s),new TypeError("invalid currency: "+s);if(!qe(t))throw q(r,"Invalid amount: "+t),new TypeError("invalid amount: "+t);if(!i.lineItemLabel)throw q(r,"Invalid lineItemLabel parameter"),new TypeError("Invalid lineItemLabel parameter");if(!i.domainName)throw q(r,"Invalid domainName parameter"),new TypeError("Invalid domainName parameter");if(!i.displayName)throw q(r,"Invalid displayName parameter"),new TypeError("Invalid displayName parameter");if(!i.merchantIdentifier)throw q(r,"Invalid merchantIdentifier parameter"),new TypeError("Invalid merchantIdentifier parameter")}}I([C],nr.prototype,"cleanUp",null),I([C],nr.prototype,"addApplePay",null),I([C],nr.prototype,"validateMerchant",null),I([C],nr.prototype,"addChargeWithApplePay",null),I([C],nr.prototype,"getFailureAddChargeHandler",null),I([C],nr.prototype,"getSuccessAddChargeHandler",null),I([C],nr.prototype,"validateOptions",null);const fg=[(e=>(pt("data-v-7d3fe743"),e=e(),gt(),e))(()=>P("path",{id:"XMLID_34_",d:`M93.6,27.1C87.6,34.2,78,39.8,68.4,39c-1.2-9.6,3.5-19.8,9-26.1c6-7.3,16.5-12.5,25-12.9
|
|
150
150
|
C103.4,10,99.5,19.8,93.6,27.1 M102.3,40.9c-13.9-0.8-25.8,7.9-32.4,7.9c-6.7,0-16.8-7.5-27.8-7.3c-14.3,0.2-27.6,8.3-34.9,21.2
|
|
151
151
|
c-15,25.8-3.9,64,10.6,85c7.1,10.4,15.6,21.8,26.8,21.4c10.6-0.4,14.8-6.9,27.6-6.9c12.9,0,16.6,6.9,27.8,6.7
|
|
152
152
|
c11.6-0.2,18.9-10.4,26-20.8c8.1-11.8,11.4-23.3,11.6-23.9c-0.2-0.2-22.4-8.7-22.6-34.3c-0.2-21.4,17.5-31.6,18.3-32.2
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { PayGLocalThreeDsProvider as t } from "./PayGLocalThreeDsProvider-
|
|
2
|
-
import "./DefaultThreeDsProvider-
|
|
3
|
-
import "./main-
|
|
1
|
+
import { PayGLocalThreeDsProvider as t } from "./PayGLocalThreeDsProvider-5aff4993.mjs";
|
|
2
|
+
import "./DefaultThreeDsProvider-5bbd9bcd.mjs";
|
|
3
|
+
import "./main-45dd3fda.mjs";
|
|
4
4
|
function l(r, o, e) {
|
|
5
5
|
return new t(r, o, e);
|
|
6
6
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SkyBankThreeDsProvider as e } from "./SkyBankThreeDsProvider-141ecfd6.mjs";
|
|
2
|
+
import "./MetricsGlobalThreeDsProvider-7d0227b3.mjs";
|
|
3
|
+
import "./DefaultThreeDsProvider-5bbd9bcd.mjs";
|
|
4
|
+
import "./main-45dd3fda.mjs";
|
|
5
|
+
function a(r, o, t) {
|
|
6
|
+
return new e(r, o, t);
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
a as default
|
|
10
|
+
};
|
package/package.json
CHANGED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { CxPayThreeDsProvider as e } from "./CxPayThreeDsProvider-fdb9495d.mjs";
|
|
2
|
-
import "./MetricsGlobalThreeDsProvider-4a1a277b.mjs";
|
|
3
|
-
import "./DefaultThreeDsProvider-bc94590f.mjs";
|
|
4
|
-
import "./main-0d5d595b.mjs";
|
|
5
|
-
function n(r, o, t) {
|
|
6
|
-
return new e(r, o, t);
|
|
7
|
-
}
|
|
8
|
-
export {
|
|
9
|
-
n as default
|
|
10
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { EpnaThreeDsProvider as t } from "./EpnaThreeDsProvider-ae87f6a8.mjs";
|
|
2
|
-
import "./MetricsGlobalThreeDsProvider-4a1a277b.mjs";
|
|
3
|
-
import "./DefaultThreeDsProvider-bc94590f.mjs";
|
|
4
|
-
import "./main-0d5d595b.mjs";
|
|
5
|
-
function a(r, e, o) {
|
|
6
|
-
return new t(r, e, o);
|
|
7
|
-
}
|
|
8
|
-
export {
|
|
9
|
-
a as default
|
|
10
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { FlashBancThreeDsProvider as e } from "./FlashBancThreeDsProvider-1605038d.mjs";
|
|
2
|
-
import "./MetricsGlobalThreeDsProvider-4a1a277b.mjs";
|
|
3
|
-
import "./DefaultThreeDsProvider-bc94590f.mjs";
|
|
4
|
-
import "./main-0d5d595b.mjs";
|
|
5
|
-
function p(r, o, t) {
|
|
6
|
-
return new e(r, o, t);
|
|
7
|
-
}
|
|
8
|
-
export {
|
|
9
|
-
p as default
|
|
10
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { NmiThreeDsProvider as t } from "./NmiThreeDsProvider-c7eee818.mjs";
|
|
2
|
-
import "./MetricsGlobalThreeDsProvider-4a1a277b.mjs";
|
|
3
|
-
import "./DefaultThreeDsProvider-bc94590f.mjs";
|
|
4
|
-
import "./main-0d5d595b.mjs";
|
|
5
|
-
function f(r, i, o) {
|
|
6
|
-
return new t(r, i, o);
|
|
7
|
-
}
|
|
8
|
-
export {
|
|
9
|
-
f as default
|
|
10
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { PayabliThreeDsProvider as t } from "./PayabliThreeDsProvider-4c604ca6.mjs";
|
|
2
|
-
import "./MetricsGlobalThreeDsProvider-4a1a277b.mjs";
|
|
3
|
-
import "./DefaultThreeDsProvider-bc94590f.mjs";
|
|
4
|
-
import "./main-0d5d595b.mjs";
|
|
5
|
-
function n(r, i, o) {
|
|
6
|
-
return new t(r, i, o);
|
|
7
|
-
}
|
|
8
|
-
export {
|
|
9
|
-
n as default
|
|
10
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { SkyBankThreeDsProvider as e } from "./SkyBankThreeDsProvider-83c74ce4.mjs";
|
|
2
|
-
import "./MetricsGlobalThreeDsProvider-4a1a277b.mjs";
|
|
3
|
-
import "./DefaultThreeDsProvider-bc94590f.mjs";
|
|
4
|
-
import "./main-0d5d595b.mjs";
|
|
5
|
-
function a(r, o, t) {
|
|
6
|
-
return new e(r, o, t);
|
|
7
|
-
}
|
|
8
|
-
export {
|
|
9
|
-
a as default
|
|
10
|
-
};
|