moyasar-payment-form 2.0.3
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/LICENCE.md +7 -0
- package/README.md +695 -0
- package/dist/__vite-browser-external-DYxpcVy9.mjs +11 -0
- package/dist/moyasar.css +8 -0
- package/dist/moyasar.d.ts +6 -0
- package/dist/moyasar.mjs +3281 -0
- package/dist/moyasar.umd.js +10 -0
- package/package.json +61 -0
package/dist/moyasar.mjs
ADDED
|
@@ -0,0 +1,3281 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* name: moyasar-payment-form
|
|
3
|
+
* version: v2.0.2
|
|
4
|
+
* description: Moyasar payment form utilities
|
|
5
|
+
* author: Moyasar Development Team
|
|
6
|
+
* homepage: https://docs.moyasar.com/credit-card
|
|
7
|
+
*/
|
|
8
|
+
var vn = Object.defineProperty, gn = Object.defineProperties;
|
|
9
|
+
var bn = Object.getOwnPropertyDescriptors;
|
|
10
|
+
var ge = Object.getOwnPropertySymbols;
|
|
11
|
+
var ut = Object.prototype.hasOwnProperty, dt = Object.prototype.propertyIsEnumerable;
|
|
12
|
+
var pt = Math.pow, ct = (e, t, n) => t in e ? vn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, S = (e, t) => {
|
|
13
|
+
for (var n in t || (t = {}))
|
|
14
|
+
ut.call(t, n) && ct(e, n, t[n]);
|
|
15
|
+
if (ge)
|
|
16
|
+
for (var n of ge(t))
|
|
17
|
+
dt.call(t, n) && ct(e, n, t[n]);
|
|
18
|
+
return e;
|
|
19
|
+
}, O = (e, t) => gn(e, bn(t));
|
|
20
|
+
var be = (e, t) => {
|
|
21
|
+
var n = {};
|
|
22
|
+
for (var r in e)
|
|
23
|
+
ut.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
|
|
24
|
+
if (e != null && ge)
|
|
25
|
+
for (var r of ge(e))
|
|
26
|
+
t.indexOf(r) < 0 && dt.call(e, r) && (n[r] = e[r]);
|
|
27
|
+
return n;
|
|
28
|
+
};
|
|
29
|
+
var Y = (e, t, n) => new Promise((r, o) => {
|
|
30
|
+
var a = (u) => {
|
|
31
|
+
try {
|
|
32
|
+
s(n.next(u));
|
|
33
|
+
} catch (l) {
|
|
34
|
+
o(l);
|
|
35
|
+
}
|
|
36
|
+
}, i = (u) => {
|
|
37
|
+
try {
|
|
38
|
+
s(n.throw(u));
|
|
39
|
+
} catch (l) {
|
|
40
|
+
o(l);
|
|
41
|
+
}
|
|
42
|
+
}, s = (u) => u.done ? r(u.value) : Promise.resolve(u.value).then(a, i);
|
|
43
|
+
s((n = n.apply(e, t)).next());
|
|
44
|
+
});
|
|
45
|
+
var Re, E, Gt, ae, ft, Bt, je, rt, He, Ke, zt, me = {}, jt = [], wn = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, Ie = Array.isArray;
|
|
46
|
+
function ne(e, t) {
|
|
47
|
+
for (var n in t) e[n] = t[n];
|
|
48
|
+
return e;
|
|
49
|
+
}
|
|
50
|
+
function Ht(e) {
|
|
51
|
+
var t = e.parentNode;
|
|
52
|
+
t && t.removeChild(e);
|
|
53
|
+
}
|
|
54
|
+
function Ze(e, t, n) {
|
|
55
|
+
var r, o, a, i = {};
|
|
56
|
+
for (a in t) a == "key" ? r = t[a] : a == "ref" ? o = t[a] : i[a] = t[a];
|
|
57
|
+
if (arguments.length > 2 && (i.children = arguments.length > 3 ? Re.call(arguments, 2) : n), typeof e == "function" && e.defaultProps != null) for (a in e.defaultProps) i[a] === void 0 && (i[a] = e.defaultProps[a]);
|
|
58
|
+
return Ee(e, i, r, o, null);
|
|
59
|
+
}
|
|
60
|
+
function Ee(e, t, n, r, o) {
|
|
61
|
+
var a = { type: e, props: t, key: n, ref: r, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, constructor: void 0, __v: o == null ? ++Gt : o, __i: -1, __u: 0 };
|
|
62
|
+
return o == null && E.vnode != null && E.vnode(a), a;
|
|
63
|
+
}
|
|
64
|
+
function re(e) {
|
|
65
|
+
return e.children;
|
|
66
|
+
}
|
|
67
|
+
function X(e, t) {
|
|
68
|
+
this.props = e, this.context = t;
|
|
69
|
+
}
|
|
70
|
+
function se(e, t) {
|
|
71
|
+
if (t == null) return e.__ ? se(e.__, e.__i + 1) : null;
|
|
72
|
+
for (var n; t < e.__k.length; t++) if ((n = e.__k[t]) != null && n.__e != null) return n.__e;
|
|
73
|
+
return typeof e.type == "function" ? se(e) : null;
|
|
74
|
+
}
|
|
75
|
+
function Kt(e) {
|
|
76
|
+
var t, n;
|
|
77
|
+
if ((e = e.__) != null && e.__c != null) {
|
|
78
|
+
for (e.__e = e.__c.base = null, t = 0; t < e.__k.length; t++) if ((n = e.__k[t]) != null && n.__e != null) {
|
|
79
|
+
e.__e = e.__c.base = n.__e;
|
|
80
|
+
break;
|
|
81
|
+
}
|
|
82
|
+
return Kt(e);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
function qe(e) {
|
|
86
|
+
(!e.__d && (e.__d = !0) && ae.push(e) && !Ae.__r++ || ft !== E.debounceRendering) && ((ft = E.debounceRendering) || Bt)(Ae);
|
|
87
|
+
}
|
|
88
|
+
function Ae() {
|
|
89
|
+
var e, t, n, r, o, a, i, s;
|
|
90
|
+
for (ae.sort(je); e = ae.shift(); ) e.__d && (t = ae.length, r = void 0, a = (o = (n = e).__v).__e, i = [], s = [], n.__P && ((r = ne({}, o)).__v = o.__v + 1, E.vnode && E.vnode(r), ot(n.__P, r, o, n.__n, n.__P.namespaceURI, 32 & o.__u ? [a] : null, i, a == null ? se(o) : a, !!(32 & o.__u), s), r.__v = o.__v, r.__.__k[r.__i] = r, Yt(i, r, s), r.__e != a && Kt(r)), ae.length > t && ae.sort(je));
|
|
91
|
+
Ae.__r = 0;
|
|
92
|
+
}
|
|
93
|
+
function Zt(e, t, n, r, o, a, i, s, u, l, d) {
|
|
94
|
+
var c, _, p, y, g, m = r && r.__k || jt, h = t.length;
|
|
95
|
+
for (n.__d = u, kn(n, t, m), u = n.__d, c = 0; c < h; c++) (p = n.__k[c]) != null && typeof p != "boolean" && typeof p != "function" && (_ = p.__i === -1 ? me : m[p.__i] || me, p.__i = c, ot(e, p, _, o, a, i, s, u, l, d), y = p.__e, p.ref && _.ref != p.ref && (_.ref && at(_.ref, null, p), d.push(p.ref, p.__c || y, p)), g == null && y != null && (g = y), 65536 & p.__u || _.__k === p.__k ? (u && typeof p.type == "string" && !e.contains(u) && (u = se(_)), u = qt(p, u, e)) : typeof p.type == "function" && p.__d !== void 0 ? u = p.__d : y && (u = y.nextSibling), p.__d = void 0, p.__u &= -196609);
|
|
96
|
+
n.__d = u, n.__e = g;
|
|
97
|
+
}
|
|
98
|
+
function kn(e, t, n) {
|
|
99
|
+
var r, o, a, i, s, u = t.length, l = n.length, d = l, c = 0;
|
|
100
|
+
for (e.__k = [], r = 0; r < u; r++) i = r + c, (o = e.__k[r] = (o = t[r]) == null || typeof o == "boolean" || typeof o == "function" ? null : typeof o == "string" || typeof o == "number" || typeof o == "bigint" || o.constructor == String ? Ee(null, o, null, null, null) : Ie(o) ? Ee(re, { children: o }, null, null, null) : o.constructor === void 0 && o.__b > 0 ? Ee(o.type, o.props, o.key, o.ref ? o.ref : null, o.__v) : o) != null ? (o.__ = e, o.__b = e.__b + 1, s = xn(o, n, i, d), o.__i = s, a = null, s !== -1 && (d--, (a = n[s]) && (a.__u |= 131072)), a == null || a.__v === null ? (s == -1 && c--, typeof o.type != "function" && (o.__u |= 65536)) : s !== i && (s == i - 1 ? c = s - i : s == i + 1 ? c++ : s > i ? d > u - i ? c += s - i : c-- : s < i && c++, s !== r + c && (o.__u |= 65536))) : (a = n[i]) && a.key == null && a.__e && !(131072 & a.__u) && (a.__e == e.__d && (e.__d = se(a)), Ye(a, a, !1), n[i] = null, d--);
|
|
101
|
+
if (d) for (r = 0; r < l; r++) (a = n[r]) != null && !(131072 & a.__u) && (a.__e == e.__d && (e.__d = se(a)), Ye(a, a));
|
|
102
|
+
}
|
|
103
|
+
function qt(e, t, n) {
|
|
104
|
+
var r, o;
|
|
105
|
+
if (typeof e.type == "function") {
|
|
106
|
+
for (r = e.__k, o = 0; r && o < r.length; o++) r[o] && (r[o].__ = e, t = qt(r[o], t, n));
|
|
107
|
+
return t;
|
|
108
|
+
}
|
|
109
|
+
e.__e != t && (n.insertBefore(e.__e, t || null), t = e.__e);
|
|
110
|
+
do
|
|
111
|
+
t = t && t.nextSibling;
|
|
112
|
+
while (t != null && t.nodeType === 8);
|
|
113
|
+
return t;
|
|
114
|
+
}
|
|
115
|
+
function De(e, t) {
|
|
116
|
+
return t = t || [], e == null || typeof e == "boolean" || (Ie(e) ? e.some(function(n) {
|
|
117
|
+
De(n, t);
|
|
118
|
+
}) : t.push(e)), t;
|
|
119
|
+
}
|
|
120
|
+
function xn(e, t, n, r) {
|
|
121
|
+
var o = e.key, a = e.type, i = n - 1, s = n + 1, u = t[n];
|
|
122
|
+
if (u === null || u && o == u.key && a === u.type && !(131072 & u.__u)) return n;
|
|
123
|
+
if (r > (u != null && !(131072 & u.__u) ? 1 : 0)) for (; i >= 0 || s < t.length; ) {
|
|
124
|
+
if (i >= 0) {
|
|
125
|
+
if ((u = t[i]) && !(131072 & u.__u) && o == u.key && a === u.type) return i;
|
|
126
|
+
i--;
|
|
127
|
+
}
|
|
128
|
+
if (s < t.length) {
|
|
129
|
+
if ((u = t[s]) && !(131072 & u.__u) && o == u.key && a === u.type) return s;
|
|
130
|
+
s++;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
return -1;
|
|
134
|
+
}
|
|
135
|
+
function mt(e, t, n) {
|
|
136
|
+
t[0] === "-" ? e.setProperty(t, n == null ? "" : n) : e[t] = n == null ? "" : typeof n != "number" || wn.test(t) ? n : n + "px";
|
|
137
|
+
}
|
|
138
|
+
function we(e, t, n, r, o) {
|
|
139
|
+
var a;
|
|
140
|
+
e: if (t === "style") if (typeof n == "string") e.style.cssText = n;
|
|
141
|
+
else {
|
|
142
|
+
if (typeof r == "string" && (e.style.cssText = r = ""), r) for (t in r) n && t in n || mt(e.style, t, "");
|
|
143
|
+
if (n) for (t in n) r && n[t] === r[t] || mt(e.style, t, n[t]);
|
|
144
|
+
}
|
|
145
|
+
else if (t[0] === "o" && t[1] === "n") a = t !== (t = t.replace(/(PointerCapture)$|Capture$/i, "$1")), t = t.toLowerCase() in e || t === "onFocusOut" || t === "onFocusIn" ? t.toLowerCase().slice(2) : t.slice(2), e.l || (e.l = {}), e.l[t + a] = n, n ? r ? n.u = r.u : (n.u = rt, e.addEventListener(t, a ? Ke : He, a)) : e.removeEventListener(t, a ? Ke : He, a);
|
|
146
|
+
else {
|
|
147
|
+
if (o == "http://www.w3.org/2000/svg") t = t.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
|
|
148
|
+
else if (t != "width" && t != "height" && t != "href" && t != "list" && t != "form" && t != "tabIndex" && t != "download" && t != "rowSpan" && t != "colSpan" && t != "role" && t != "popover" && t in e) try {
|
|
149
|
+
e[t] = n == null ? "" : n;
|
|
150
|
+
break e;
|
|
151
|
+
} catch (i) {
|
|
152
|
+
}
|
|
153
|
+
typeof n == "function" || (n == null || n === !1 && t[4] !== "-" ? e.removeAttribute(t) : e.setAttribute(t, t == "popover" && n == 1 ? "" : n));
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
function ht(e) {
|
|
157
|
+
return function(t) {
|
|
158
|
+
if (this.l) {
|
|
159
|
+
var n = this.l[t.type + e];
|
|
160
|
+
if (t.t == null) t.t = rt++;
|
|
161
|
+
else if (t.t < n.u) return;
|
|
162
|
+
return n(E.event ? E.event(t) : t);
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
function ot(e, t, n, r, o, a, i, s, u, l) {
|
|
167
|
+
var d, c, _, p, y, g, m, h, v, k, w, b, x, A, D, L, C = t.type;
|
|
168
|
+
if (t.constructor !== void 0) return null;
|
|
169
|
+
128 & n.__u && (u = !!(32 & n.__u), a = [s = t.__e = n.__e]), (d = E.__b) && d(t);
|
|
170
|
+
e: if (typeof C == "function") try {
|
|
171
|
+
if (h = t.props, v = "prototype" in C && C.prototype.render, k = (d = C.contextType) && r[d.__c], w = d ? k ? k.props.value : d.__ : r, n.__c ? m = (c = t.__c = n.__c).__ = c.__E : (v ? t.__c = c = new C(h, w) : (t.__c = c = new X(h, w), c.constructor = C, c.render = En), k && k.sub(c), c.props = h, c.state || (c.state = {}), c.context = w, c.__n = r, _ = c.__d = !0, c.__h = [], c._sb = []), v && c.__s == null && (c.__s = c.state), v && C.getDerivedStateFromProps != null && (c.__s == c.state && (c.__s = ne({}, c.__s)), ne(c.__s, C.getDerivedStateFromProps(h, c.__s))), p = c.props, y = c.state, c.__v = t, _) v && C.getDerivedStateFromProps == null && c.componentWillMount != null && c.componentWillMount(), v && c.componentDidMount != null && c.__h.push(c.componentDidMount);
|
|
172
|
+
else {
|
|
173
|
+
if (v && C.getDerivedStateFromProps == null && h !== p && c.componentWillReceiveProps != null && c.componentWillReceiveProps(h, w), !c.__e && (c.shouldComponentUpdate != null && c.shouldComponentUpdate(h, c.__s, w) === !1 || t.__v === n.__v)) {
|
|
174
|
+
for (t.__v !== n.__v && (c.props = h, c.state = c.__s, c.__d = !1), t.__e = n.__e, t.__k = n.__k, t.__k.forEach(function(M) {
|
|
175
|
+
M && (M.__ = t);
|
|
176
|
+
}), b = 0; b < c._sb.length; b++) c.__h.push(c._sb[b]);
|
|
177
|
+
c._sb = [], c.__h.length && i.push(c);
|
|
178
|
+
break e;
|
|
179
|
+
}
|
|
180
|
+
c.componentWillUpdate != null && c.componentWillUpdate(h, c.__s, w), v && c.componentDidUpdate != null && c.__h.push(function() {
|
|
181
|
+
c.componentDidUpdate(p, y, g);
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
if (c.context = w, c.props = h, c.__P = e, c.__e = !1, x = E.__r, A = 0, v) {
|
|
185
|
+
for (c.state = c.__s, c.__d = !1, x && x(t), d = c.render(c.props, c.state, c.context), D = 0; D < c._sb.length; D++) c.__h.push(c._sb[D]);
|
|
186
|
+
c._sb = [];
|
|
187
|
+
} else do
|
|
188
|
+
c.__d = !1, x && x(t), d = c.render(c.props, c.state, c.context), c.state = c.__s;
|
|
189
|
+
while (c.__d && ++A < 25);
|
|
190
|
+
c.state = c.__s, c.getChildContext != null && (r = ne(ne({}, r), c.getChildContext())), v && !_ && c.getSnapshotBeforeUpdate != null && (g = c.getSnapshotBeforeUpdate(p, y)), Zt(e, Ie(L = d != null && d.type === re && d.key == null ? d.props.children : d) ? L : [L], t, n, r, o, a, i, s, u, l), c.base = t.__e, t.__u &= -161, c.__h.length && i.push(c), m && (c.__E = c.__ = null);
|
|
191
|
+
} catch (M) {
|
|
192
|
+
t.__v = null, u || a != null ? (t.__e = s, t.__u |= u ? 160 : 32, a[a.indexOf(s)] = null) : (t.__e = n.__e, t.__k = n.__k), E.__e(M, t, n);
|
|
193
|
+
}
|
|
194
|
+
else a == null && t.__v === n.__v ? (t.__k = n.__k, t.__e = n.__e) : t.__e = Pn(n.__e, t, n, r, o, a, i, u, l);
|
|
195
|
+
(d = E.diffed) && d(t);
|
|
196
|
+
}
|
|
197
|
+
function Yt(e, t, n) {
|
|
198
|
+
t.__d = void 0;
|
|
199
|
+
for (var r = 0; r < n.length; r++) at(n[r], n[++r], n[++r]);
|
|
200
|
+
E.__c && E.__c(t, e), e.some(function(o) {
|
|
201
|
+
try {
|
|
202
|
+
e = o.__h, o.__h = [], e.some(function(a) {
|
|
203
|
+
a.call(o);
|
|
204
|
+
});
|
|
205
|
+
} catch (a) {
|
|
206
|
+
E.__e(a, o.__v);
|
|
207
|
+
}
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
function Pn(e, t, n, r, o, a, i, s, u) {
|
|
211
|
+
var l, d, c, _, p, y, g, m = n.props, h = t.props, v = t.type;
|
|
212
|
+
if (v === "svg" ? o = "http://www.w3.org/2000/svg" : v === "math" ? o = "http://www.w3.org/1998/Math/MathML" : o || (o = "http://www.w3.org/1999/xhtml"), a != null) {
|
|
213
|
+
for (l = 0; l < a.length; l++) if ((p = a[l]) && "setAttribute" in p == !!v && (v ? p.localName === v : p.nodeType === 3)) {
|
|
214
|
+
e = p, a[l] = null;
|
|
215
|
+
break;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
if (e == null) {
|
|
219
|
+
if (v === null) return document.createTextNode(h);
|
|
220
|
+
e = document.createElementNS(o, v, h.is && h), a = null, s = !1;
|
|
221
|
+
}
|
|
222
|
+
if (v === null) m === h || s && e.data === h || (e.data = h);
|
|
223
|
+
else {
|
|
224
|
+
if (a = a && Re.call(e.childNodes), m = n.props || me, !s && a != null) for (m = {}, l = 0; l < e.attributes.length; l++) m[(p = e.attributes[l]).name] = p.value;
|
|
225
|
+
for (l in m) if (p = m[l], l != "children") {
|
|
226
|
+
if (l == "dangerouslySetInnerHTML") c = p;
|
|
227
|
+
else if (l !== "key" && !(l in h)) {
|
|
228
|
+
if (l == "value" && "defaultValue" in h || l == "checked" && "defaultChecked" in h) continue;
|
|
229
|
+
we(e, l, null, p, o);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
for (l in h) p = h[l], l == "children" ? _ = p : l == "dangerouslySetInnerHTML" ? d = p : l == "value" ? y = p : l == "checked" ? g = p : l === "key" || s && typeof p != "function" || m[l] === p || we(e, l, p, m[l], o);
|
|
233
|
+
if (d) s || c && (d.__html === c.__html || d.__html === e.innerHTML) || (e.innerHTML = d.__html), t.__k = [];
|
|
234
|
+
else if (c && (e.innerHTML = ""), Zt(e, Ie(_) ? _ : [_], t, n, r, v === "foreignObject" ? "http://www.w3.org/1999/xhtml" : o, a, i, a ? a[0] : n.__k && se(n, 0), s, u), a != null) for (l = a.length; l--; ) a[l] != null && Ht(a[l]);
|
|
235
|
+
s || (l = "value", y !== void 0 && (y !== e[l] || v === "progress" && !y || v === "option" && y !== m[l]) && we(e, l, y, m[l], o), l = "checked", g !== void 0 && g !== e[l] && we(e, l, g, m[l], o));
|
|
236
|
+
}
|
|
237
|
+
return e;
|
|
238
|
+
}
|
|
239
|
+
function at(e, t, n) {
|
|
240
|
+
try {
|
|
241
|
+
typeof e == "function" ? e(t) : e.current = t;
|
|
242
|
+
} catch (r) {
|
|
243
|
+
E.__e(r, n);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
function Ye(e, t, n) {
|
|
247
|
+
var r, o;
|
|
248
|
+
if (E.unmount && E.unmount(e), (r = e.ref) && (r.current && r.current !== e.__e || at(r, null, t)), (r = e.__c) != null) {
|
|
249
|
+
if (r.componentWillUnmount) try {
|
|
250
|
+
r.componentWillUnmount();
|
|
251
|
+
} catch (a) {
|
|
252
|
+
E.__e(a, t);
|
|
253
|
+
}
|
|
254
|
+
r.base = r.__P = null;
|
|
255
|
+
}
|
|
256
|
+
if (r = e.__k) for (o = 0; o < r.length; o++) r[o] && Ye(r[o], t, n || typeof e.type != "function");
|
|
257
|
+
n || e.__e == null || Ht(e.__e), e.__c = e.__ = e.__e = e.__d = void 0;
|
|
258
|
+
}
|
|
259
|
+
function En(e, t, n) {
|
|
260
|
+
return this.constructor(e, n);
|
|
261
|
+
}
|
|
262
|
+
function _t(e, t, n) {
|
|
263
|
+
var r, o, a, i;
|
|
264
|
+
E.__ && E.__(e, t), o = (r = typeof n == "function") ? null : t.__k, a = [], i = [], ot(t, e = (!r && n || t).__k = Ze(re, null, [e]), o || me, me, t.namespaceURI, !r && n ? [n] : o ? null : t.firstChild ? Re.call(t.childNodes) : null, a, !r && n ? n : o ? o.__e : t.firstChild, r, i), Yt(a, e, i);
|
|
265
|
+
}
|
|
266
|
+
function it(e, t) {
|
|
267
|
+
var n = { __c: t = "__cC" + zt++, __: e, Consumer: function(r, o) {
|
|
268
|
+
return r.children(o);
|
|
269
|
+
}, Provider: function(r) {
|
|
270
|
+
var o, a;
|
|
271
|
+
return this.getChildContext || (o = [], (a = {})[t] = this, this.getChildContext = function() {
|
|
272
|
+
return a;
|
|
273
|
+
}, this.componentWillUnmount = function() {
|
|
274
|
+
o = null;
|
|
275
|
+
}, this.shouldComponentUpdate = function(i) {
|
|
276
|
+
this.props.value !== i.value && o.some(function(s) {
|
|
277
|
+
s.__e = !0, qe(s);
|
|
278
|
+
});
|
|
279
|
+
}, this.sub = function(i) {
|
|
280
|
+
o.push(i);
|
|
281
|
+
var s = i.componentWillUnmount;
|
|
282
|
+
i.componentWillUnmount = function() {
|
|
283
|
+
o && o.splice(o.indexOf(i), 1), s && s.call(i);
|
|
284
|
+
};
|
|
285
|
+
}), r.children;
|
|
286
|
+
} };
|
|
287
|
+
return n.Provider.__ = n.Consumer.contextType = n;
|
|
288
|
+
}
|
|
289
|
+
Re = jt.slice, E = { __e: function(e, t, n, r) {
|
|
290
|
+
for (var o, a, i; t = t.__; ) if ((o = t.__c) && !o.__) try {
|
|
291
|
+
if ((a = o.constructor) && a.getDerivedStateFromError != null && (o.setState(a.getDerivedStateFromError(e)), i = o.__d), o.componentDidCatch != null && (o.componentDidCatch(e, r || {}), i = o.__d), i) return o.__E = o;
|
|
292
|
+
} catch (s) {
|
|
293
|
+
e = s;
|
|
294
|
+
}
|
|
295
|
+
throw e;
|
|
296
|
+
} }, Gt = 0, X.prototype.setState = function(e, t) {
|
|
297
|
+
var n;
|
|
298
|
+
n = this.__s != null && this.__s !== this.state ? this.__s : this.__s = ne({}, this.state), typeof e == "function" && (e = e(ne({}, n), this.props)), e && ne(n, e), e != null && this.__v && (t && this._sb.push(t), qe(this));
|
|
299
|
+
}, X.prototype.forceUpdate = function(e) {
|
|
300
|
+
this.__v && (this.__e = !0, e && this.__h.push(e), qe(this));
|
|
301
|
+
}, X.prototype.render = re, ae = [], Bt = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, je = function(e, t) {
|
|
302
|
+
return e.__v.__b - t.__v.__b;
|
|
303
|
+
}, Ae.__r = 0, rt = 0, He = ht(!1), Ke = ht(!0), zt = 0;
|
|
304
|
+
var Sn = 0;
|
|
305
|
+
function f(e, t, n, r, o, a) {
|
|
306
|
+
t || (t = {});
|
|
307
|
+
var i, s, u = t;
|
|
308
|
+
if ("ref" in u) for (s in u = {}, t) s == "ref" ? i = t[s] : u[s] = t[s];
|
|
309
|
+
var l = { type: e, props: u, key: n, ref: i, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, constructor: void 0, __v: --Sn, __i: -1, __u: 0, __source: o, __self: a };
|
|
310
|
+
if (typeof e == "function" && (i = e.defaultProps)) for (s in i) u[s] === void 0 && (u[s] = i[s]);
|
|
311
|
+
return E.vnode && E.vnode(l), l;
|
|
312
|
+
}
|
|
313
|
+
const Jt = "2.0.2", z = it({});
|
|
314
|
+
var ue, R, Ge, yt, he = 0, Wt = [], N = E, vt = N.__b, gt = N.__r, bt = N.diffed, wt = N.__c, kt = N.unmount, xt = N.__;
|
|
315
|
+
function Ne(e, t) {
|
|
316
|
+
N.__h && N.__h(R, e, he || t), he = 0;
|
|
317
|
+
var n = R.__H || (R.__H = { __: [], __h: [] });
|
|
318
|
+
return e >= n.__.length && n.__.push({}), n.__[e];
|
|
319
|
+
}
|
|
320
|
+
function I(e) {
|
|
321
|
+
return he = 1, Cn($t, e);
|
|
322
|
+
}
|
|
323
|
+
function Cn(e, t, n) {
|
|
324
|
+
var r = Ne(ue++, 2);
|
|
325
|
+
if (r.t = e, !r.__c && (r.__ = [n ? n(t) : $t(void 0, t), function(s) {
|
|
326
|
+
var u = r.__N ? r.__N[0] : r.__[0], l = r.t(u, s);
|
|
327
|
+
u !== l && (r.__N = [l, r.__[1]], r.__c.setState({}));
|
|
328
|
+
}], r.__c = R, !R.u)) {
|
|
329
|
+
var o = function(s, u, l) {
|
|
330
|
+
if (!r.__c.__H) return !0;
|
|
331
|
+
var d = r.__c.__H.__.filter(function(_) {
|
|
332
|
+
return !!_.__c;
|
|
333
|
+
});
|
|
334
|
+
if (d.every(function(_) {
|
|
335
|
+
return !_.__N;
|
|
336
|
+
})) return !a || a.call(this, s, u, l);
|
|
337
|
+
var c = !1;
|
|
338
|
+
return d.forEach(function(_) {
|
|
339
|
+
if (_.__N) {
|
|
340
|
+
var p = _.__[0];
|
|
341
|
+
_.__ = _.__N, _.__N = void 0, p !== _.__[0] && (c = !0);
|
|
342
|
+
}
|
|
343
|
+
}), !(!c && r.__c.props === s) && (!a || a.call(this, s, u, l));
|
|
344
|
+
};
|
|
345
|
+
R.u = !0;
|
|
346
|
+
var a = R.shouldComponentUpdate, i = R.componentWillUpdate;
|
|
347
|
+
R.componentWillUpdate = function(s, u, l) {
|
|
348
|
+
if (this.__e) {
|
|
349
|
+
var d = a;
|
|
350
|
+
a = void 0, o(s, u, l), a = d;
|
|
351
|
+
}
|
|
352
|
+
i && i.call(this, s, u, l);
|
|
353
|
+
}, R.shouldComponentUpdate = o;
|
|
354
|
+
}
|
|
355
|
+
return r.__N || r.__;
|
|
356
|
+
}
|
|
357
|
+
function H(e, t) {
|
|
358
|
+
var n = Ne(ue++, 3);
|
|
359
|
+
!N.__s && Qt(n.__H, t) && (n.__ = e, n.i = t, R.__H.__h.push(n));
|
|
360
|
+
}
|
|
361
|
+
function J(e) {
|
|
362
|
+
return he = 5, le(function() {
|
|
363
|
+
return { current: e };
|
|
364
|
+
}, []);
|
|
365
|
+
}
|
|
366
|
+
function le(e, t) {
|
|
367
|
+
var n = Ne(ue++, 7);
|
|
368
|
+
return Qt(n.__H, t) && (n.__ = e(), n.__H = t, n.__h = e), n.__;
|
|
369
|
+
}
|
|
370
|
+
function Xt(e, t) {
|
|
371
|
+
return he = 8, le(function() {
|
|
372
|
+
return e;
|
|
373
|
+
}, t);
|
|
374
|
+
}
|
|
375
|
+
function F(e) {
|
|
376
|
+
var t = R.context[e.__c], n = Ne(ue++, 9);
|
|
377
|
+
return n.c = e, t ? (n.__ == null && (n.__ = !0, t.sub(R)), t.props.value) : e.__;
|
|
378
|
+
}
|
|
379
|
+
function An() {
|
|
380
|
+
for (var e; e = Wt.shift(); ) if (e.__P && e.__H) try {
|
|
381
|
+
e.__H.__h.forEach(Se), e.__H.__h.forEach(Je), e.__H.__h = [];
|
|
382
|
+
} catch (t) {
|
|
383
|
+
e.__H.__h = [], N.__e(t, e.__v);
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
N.__b = function(e) {
|
|
387
|
+
R = null, vt && vt(e);
|
|
388
|
+
}, N.__ = function(e, t) {
|
|
389
|
+
e && t.__k && t.__k.__m && (e.__m = t.__k.__m), xt && xt(e, t);
|
|
390
|
+
}, N.__r = function(e) {
|
|
391
|
+
gt && gt(e), ue = 0;
|
|
392
|
+
var t = (R = e.__c).__H;
|
|
393
|
+
t && (Ge === R ? (t.__h = [], R.__h = [], t.__.forEach(function(n) {
|
|
394
|
+
n.__N && (n.__ = n.__N), n.i = n.__N = void 0;
|
|
395
|
+
})) : (t.__h.forEach(Se), t.__h.forEach(Je), t.__h = [], ue = 0)), Ge = R;
|
|
396
|
+
}, N.diffed = function(e) {
|
|
397
|
+
bt && bt(e);
|
|
398
|
+
var t = e.__c;
|
|
399
|
+
t && t.__H && (t.__H.__h.length && (Wt.push(t) !== 1 && yt === N.requestAnimationFrame || ((yt = N.requestAnimationFrame) || Dn)(An)), t.__H.__.forEach(function(n) {
|
|
400
|
+
n.i && (n.__H = n.i), n.i = void 0;
|
|
401
|
+
})), Ge = R = null;
|
|
402
|
+
}, N.__c = function(e, t) {
|
|
403
|
+
t.some(function(n) {
|
|
404
|
+
try {
|
|
405
|
+
n.__h.forEach(Se), n.__h = n.__h.filter(function(r) {
|
|
406
|
+
return !r.__ || Je(r);
|
|
407
|
+
});
|
|
408
|
+
} catch (r) {
|
|
409
|
+
t.some(function(o) {
|
|
410
|
+
o.__h && (o.__h = []);
|
|
411
|
+
}), t = [], N.__e(r, n.__v);
|
|
412
|
+
}
|
|
413
|
+
}), wt && wt(e, t);
|
|
414
|
+
}, N.unmount = function(e) {
|
|
415
|
+
kt && kt(e);
|
|
416
|
+
var t, n = e.__c;
|
|
417
|
+
n && n.__H && (n.__H.__.forEach(function(r) {
|
|
418
|
+
try {
|
|
419
|
+
Se(r);
|
|
420
|
+
} catch (o) {
|
|
421
|
+
t = o;
|
|
422
|
+
}
|
|
423
|
+
}), n.__H = void 0, t && N.__e(t, n.__v));
|
|
424
|
+
};
|
|
425
|
+
var Pt = typeof requestAnimationFrame == "function";
|
|
426
|
+
function Dn(e) {
|
|
427
|
+
var t, n = function() {
|
|
428
|
+
clearTimeout(r), Pt && cancelAnimationFrame(t), setTimeout(e);
|
|
429
|
+
}, r = setTimeout(n, 100);
|
|
430
|
+
Pt && (t = requestAnimationFrame(n));
|
|
431
|
+
}
|
|
432
|
+
function Se(e) {
|
|
433
|
+
var t = R, n = e.__c;
|
|
434
|
+
typeof n == "function" && (e.__c = void 0, n()), R = t;
|
|
435
|
+
}
|
|
436
|
+
function Je(e) {
|
|
437
|
+
var t = R;
|
|
438
|
+
e.__c = e.__(), R = t;
|
|
439
|
+
}
|
|
440
|
+
function Qt(e, t) {
|
|
441
|
+
return !e || e.length !== t.length || t.some(function(n, r) {
|
|
442
|
+
return n !== e[r];
|
|
443
|
+
});
|
|
444
|
+
}
|
|
445
|
+
function $t(e, t) {
|
|
446
|
+
return typeof t == "function" ? t(e) : t;
|
|
447
|
+
}
|
|
448
|
+
function K() {
|
|
449
|
+
const { language: e, translations: t } = F(z);
|
|
450
|
+
function n(r) {
|
|
451
|
+
if (!t)
|
|
452
|
+
return r;
|
|
453
|
+
const o = t[e][r];
|
|
454
|
+
return o || t.en[r] || r;
|
|
455
|
+
}
|
|
456
|
+
return {
|
|
457
|
+
t: n
|
|
458
|
+
};
|
|
459
|
+
}
|
|
460
|
+
const Tn = () => {
|
|
461
|
+
const { t: e } = K(), { isTestMode: t } = F(z);
|
|
462
|
+
return /* @__PURE__ */ f("footer", { class: "flex flex-col items-center gap-4 text-xs", children: [
|
|
463
|
+
/* @__PURE__ */ f("a", { href: "https://moyasar.com/?ref=payment-form-v1.14.0", target: "_blank", class: "text-black/70", children: [
|
|
464
|
+
e("form.powered_by"),
|
|
465
|
+
" ",
|
|
466
|
+
/* @__PURE__ */ f("strong", { children: e("common.moyasar") })
|
|
467
|
+
] }),
|
|
468
|
+
t && /* @__PURE__ */ f("span", { class: "text-red-600", children: e("common.test_mode_disclaimer") })
|
|
469
|
+
] });
|
|
470
|
+
}, Mn = {
|
|
471
|
+
"error.authentication_error": "خطأ في المصادقة، الخدمة غير متوفرة حالياً",
|
|
472
|
+
"error.authorization_error": "خطأ في التفويض، الخدمة غير متوفرة حالياً",
|
|
473
|
+
"error.network": "خطأ في الشبكة",
|
|
474
|
+
"error.unknown": "حدث خطأ غير متوقع",
|
|
475
|
+
"error.invalid_mobile": "رقم الجوال غير صحيح",
|
|
476
|
+
"error.invalid_otp": "رمز التحقق غير صحيح",
|
|
477
|
+
"error.invalid_request_error": "طلب دفع غير صحيح",
|
|
478
|
+
"error.mobile_not_registered": "رقم الجوال غير مسجل",
|
|
479
|
+
"error.account_inactive_error": "حساب التاجر غير نشط",
|
|
480
|
+
"error.invalid_name": "يجب إدخال الاسم الأول والأخير",
|
|
481
|
+
"error.unsupported_cc_type": "نوع البطاقة الإئتمانية غير مدعوم",
|
|
482
|
+
"error.invalid_cc_number": "رقم البطاقة الإئتمانية غير صحيح",
|
|
483
|
+
"error.invalid_date": "تاريخ الإنتهاء غير صحيح",
|
|
484
|
+
"error.invalid_month": "شهر الإنتهاء غير صحيح",
|
|
485
|
+
"error.invalid_year": "سنة الإنتهاء غير صحيحة",
|
|
486
|
+
"error.invalid_csc": "رمز الأمان للبطاقة غير صحيح",
|
|
487
|
+
"error.cant_start_payment": "خطأ في بدء عملية الدفع، يرجى المحاولة لاحقاً",
|
|
488
|
+
"error.otp_time_out": "انتهت مدة رمز التحقق، يرجى المحاولة مرة أخرى",
|
|
489
|
+
"error.api_error": "حدث خطأ، يرجى تحديث الصفحة والمحاولة مرة أخرى",
|
|
490
|
+
"error.applePay": "تعذر الاتصال أو تفويض العملية",
|
|
491
|
+
"error.m070": "غير مسموح للتاجر بإجراء عمليات في نظام 3Ds",
|
|
492
|
+
"error.m071": "غير مسموح للتاجر بإجراء عمليات مباشرة بدون نظام 3Ds",
|
|
493
|
+
"error.m072": "لا يوجد للبائع حساب بنكي فعال",
|
|
494
|
+
"error.m074": "بلد البطاقة الائتمانية غير مسموح به",
|
|
495
|
+
"error.m075": "حساب التاجر غير مشترك في فواتير ميسر",
|
|
496
|
+
"error.m076": "حساب التاجر غير مسموح له باستخدام طريقة الدفع هذه",
|
|
497
|
+
"error.m077": "حساب التاجر لا يمكنه استخدام طريقة دفع STC Pay",
|
|
498
|
+
"form.cc": "بطاقة ائتمانية",
|
|
499
|
+
"form.code": "الرمز",
|
|
500
|
+
"form.mobile": "رقم الجوال",
|
|
501
|
+
"form.otp": "رمز التحقق",
|
|
502
|
+
"form.required": "مطلوب",
|
|
503
|
+
"form.name_on_card": "الاسم على البطاقة",
|
|
504
|
+
"form.last_name": "اسم العائلة",
|
|
505
|
+
"form.card_info": "معلومات البطاقة",
|
|
506
|
+
"form.date": "تاريخ الانتهاء",
|
|
507
|
+
"form.csc": "رمز التحقق CVC",
|
|
508
|
+
"form.or_pay_with_card": "أو ادفع بالبطاقة",
|
|
509
|
+
"form.powered_by": "مدعوم بواسطة",
|
|
510
|
+
"form.save_card_notice": "سيتم حفظ بيانات بطاقتك عند الإرسال",
|
|
511
|
+
"button.pay": "ادفع",
|
|
512
|
+
"button.pay-with": "ادفع باستخدام",
|
|
513
|
+
"button.buy": "اشتر باستخدام",
|
|
514
|
+
"button.donate": "تبرع باستخدام",
|
|
515
|
+
"button.book": "احجز باستخدام",
|
|
516
|
+
"button.check-out": "اتمام الشراء باستخدام",
|
|
517
|
+
"button.subscribe": "اشترك باستخدام",
|
|
518
|
+
"button.add-money": "أضف رصيد باستخدام",
|
|
519
|
+
"button.contribute": "ساهم باستخدام",
|
|
520
|
+
"button.order": "اطلب باستخدام",
|
|
521
|
+
"button.reload": "أعد الشحن باستخدام",
|
|
522
|
+
"button.rent": "استأجر باستخدام",
|
|
523
|
+
"button.support": "ادعم باستخدام",
|
|
524
|
+
"button.tip": "اترك إكرامية باستخدام",
|
|
525
|
+
"button.top-up": "اشحن باستخدام",
|
|
526
|
+
"button.continue": "المتابعة للدفع",
|
|
527
|
+
"button.verify": "تحقق",
|
|
528
|
+
"button.proceed": "متابعة",
|
|
529
|
+
"button.cancel": "إلغاء",
|
|
530
|
+
"validation.is_invalid": ":attr غير صحيح",
|
|
531
|
+
"validation.can_t_be_blank": ":attr مطلوب",
|
|
532
|
+
"validation.should_be_english_letters_only": "الاسم يجب أن يحتوي على أحرف إنجليزية ومسافات فقط",
|
|
533
|
+
"validation.first_and_last_name_required": "يجب إدخال الاسم الأول والأخير",
|
|
534
|
+
"common.moyasar": "ميسر",
|
|
535
|
+
"common.test_mode_disclaimer": "وضع الاختبار مفعل: يرجى عدم الاستخدام في بيئة غير تجريبية!"
|
|
536
|
+
}, On = {
|
|
537
|
+
"error.authentication_error": "Authentication error, service is unavailable now",
|
|
538
|
+
"error.authorization_error": "Authorization error, service is unavailable now",
|
|
539
|
+
"error.network": "Network Error",
|
|
540
|
+
"error.unknown": "Unexpected error occurred",
|
|
541
|
+
"error.invalid_mobile": "Invalid mobile number",
|
|
542
|
+
"error.invalid_otp": "Invalid verification code",
|
|
543
|
+
"error.invalid_request_error": "Invalid payment request",
|
|
544
|
+
"error.mobile_not_registered": "Mobile number is not registered",
|
|
545
|
+
"error.account_inactive_error": "Merchant account is not active",
|
|
546
|
+
"error.invalid_name": "First and last names are required",
|
|
547
|
+
"error.unsupported_cc_type": "Unsupported card type",
|
|
548
|
+
"error.invalid_cc_number": "Invalid credit card",
|
|
549
|
+
"error.invalid_date": "Invalid date",
|
|
550
|
+
"error.invalid_month": "Invalid month",
|
|
551
|
+
"error.invalid_year": "Invalid year",
|
|
552
|
+
"error.invalid_csc": "Invalid CVC number",
|
|
553
|
+
"error.cant_start_payment": "Error initiating payment, please try again later",
|
|
554
|
+
"error.otp_time_out": "OTP time has finished, please try again",
|
|
555
|
+
"error.api_error": "An error has occurred, please refresh the page and try again.",
|
|
556
|
+
"error.applePay": "Unable to connect or authorize transaction",
|
|
557
|
+
"error.m070": "Merchant is not allowed to transact in 3Ds",
|
|
558
|
+
"error.m071": "Merchant is not allowed to transact directly without 3Ds",
|
|
559
|
+
"error.m072": "Merchant does not have bank MID specified",
|
|
560
|
+
"error.m074": "Credit card country is not allowed",
|
|
561
|
+
"error.m075": "Merchant account is not subscribed to Moyasar invoices",
|
|
562
|
+
"error.m076": "Merchant account is not allowed to use this payment method",
|
|
563
|
+
"error.m077": "Merchant account cannot use stc pay method",
|
|
564
|
+
"form.cc": "Credit Card",
|
|
565
|
+
"form.code": "Code",
|
|
566
|
+
"form.mobile": "Mobile number",
|
|
567
|
+
"form.otp": "Verification code",
|
|
568
|
+
"form.required": "Required",
|
|
569
|
+
"form.name_on_card": "Name on card",
|
|
570
|
+
"form.last_name": "Last name",
|
|
571
|
+
"form.card_info": "Card information",
|
|
572
|
+
"form.date": "Expiry date",
|
|
573
|
+
"form.csc": "CVC",
|
|
574
|
+
"form.or_pay_with_card": "Or pay with card",
|
|
575
|
+
"form.powered_by": "Powered by",
|
|
576
|
+
"form.save_card_notice": "You card data will be saved upon submit.",
|
|
577
|
+
"button.pay": "Pay",
|
|
578
|
+
"button.pay-with": "Pay with",
|
|
579
|
+
"button.buy": "Buy with",
|
|
580
|
+
"button.donate": "Donate with",
|
|
581
|
+
"button.book": "Book with",
|
|
582
|
+
"button.check-out": "Check out with",
|
|
583
|
+
"button.subscribe": "Subscribe with",
|
|
584
|
+
"button.add-money": "Add money with",
|
|
585
|
+
"button.contribute": "Contribute with",
|
|
586
|
+
"button.order": "Order with",
|
|
587
|
+
"button.reload": "Reload with",
|
|
588
|
+
"button.rent": "Rent with",
|
|
589
|
+
"button.support": "Support with",
|
|
590
|
+
"button.tip": "Tip with",
|
|
591
|
+
"button.top-up": "Top Up with",
|
|
592
|
+
"button.continue": "Continue with payment",
|
|
593
|
+
"button.verify": "Verify",
|
|
594
|
+
"button.proceed": "Proceed",
|
|
595
|
+
"button.cancel": "Cancel",
|
|
596
|
+
"validation.is_invalid": "Invalid :attr",
|
|
597
|
+
"validation.can_t_be_blank": ":attr is required",
|
|
598
|
+
"validation.should_be_english_letters_only": "Name may only have English alphabet and spaces",
|
|
599
|
+
"validation.first_and_last_name_required": "Both first and last name are required",
|
|
600
|
+
"common.moyasar": "Moyasar",
|
|
601
|
+
"common.test_mode_disclaimer": "Test Mode Enabled: Please do not use in production!"
|
|
602
|
+
}, Rn = (e) => {
|
|
603
|
+
const t = {
|
|
604
|
+
en: On,
|
|
605
|
+
ar: Mn
|
|
606
|
+
};
|
|
607
|
+
return e && Object.entries(e).forEach(([n, r]) => {
|
|
608
|
+
t[n] || (t[n] = {}), Object.entries(r).forEach(([o, a]) => {
|
|
609
|
+
t[n][o] = a;
|
|
610
|
+
});
|
|
611
|
+
}), t;
|
|
612
|
+
}, In = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20width='100%25'%20height='100%25'%20viewBox='0%200%20450%20133'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20xml:space='preserve'%20xmlns:serif='http://www.serif.com/'%20style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;'%3e%3cg%3e%3cpath%20d='M291.862,97.715l0,-69.89l11.852,0l0,5.604c3.607,-4.509%208.954,-6.957%2015.588,-6.957c13.656,0%2023.447,10.886%2023.447,26.474c0,15.588%20-9.855,26.668%20-23.447,26.668c-6.699,0%20-11.981,-2.577%20-15.588,-7.086l0,25.186l-11.852,0l0,0.001Zm11.853,-51.209l-0,12.883c2.512,5.218%207.021,9.018%2013.527,9.018c7.859,0%2013.141,-5.862%2013.141,-15.524c-0,-9.533%20-5.282,-15.331%20-13.141,-15.331c-6.506,0.064%20-11.015,3.607%20-13.527,8.954'%20style='fill:%2302aa7c;fill-rule:nonzero;'/%3e%3cpath%20d='M350.415,63.769c0,-8.503%205.282,-14.429%2014.042,-15.524l20.162,-2.577l0,-2.512c0,-3.027%20-1.546,-4.638%20-4.38,-4.638l-25.315,0l0,-10.757l25.766,0c10.242,0%2015.846,5.024%2015.846,13.914l0,36.394l-11.981,0l0,-6.119c-3.478,4.896%20-9.211,7.665%20-16.619,7.665c-10.435,0%20-17.521,-6.377%20-17.521,-15.846m20.419,6.183c6.055,0%2011.659,-3.414%2013.72,-8.438l0,-6.313l-15.395,2.126c-4.251,0.58%20-6.635,2.834%20-6.635,6.506c0.001,3.929%203.028,6.119%208.31,6.119'%20style='fill:%2302aa7c;fill-rule:nonzero;'/%3e%3cpath%20d='M405.167,86.958l8.632,0c3.285,0%204.767,-1.353%205.862,-4.445l1.546,-4.445l-18.294,-50.308l12.368,0l11.401,35.042l0.258,0l10.886,-35.042l12.174,0l-20.033,57.78c-2.705,7.923%20-6.313,12.174%20-15.137,12.174l-9.662,0l-0.001,-10.756Z'%20style='fill:%2302aa7c;fill-rule:nonzero;'/%3e%3cpath%20d='M43.48,132.306c13.785,0%2025.122,-4.316%2032.594,-11.53c5.604,-5.54%208.889,-13.012%208.889,-21.643c0,-7.794%20-2.899,-14.815%20-8.245,-20.162c-5.346,-5.347%20-13.012,-9.276%20-22.674,-11.144l-15.846,-3.092c-6.57,-1.224%20-10.306,-4.509%20-10.306,-9.082c0,-5.991%205.797,-10.113%2015.073,-10.113c5.797,0%2010.757,1.868%2014.042,5.153c2.061,2.255%203.478,5.153%203.929,8.438l22.867,-5.153c-0.644,-6.57%20-3.736,-12.368%20-8.438,-17.134c-7.536,-7.408%20-19.067,-12.11%20-32.658,-12.11c-12.561,0%20-23.06,4.123%20-30.339,10.693c-6.184,5.797%20-9.662,13.591%20-9.662,22.287c0,7.601%202.448,14.042%207.408,18.938c4.96,4.96%2012.174,8.632%2021.643,10.95l15.653,3.736c7.859,1.868%2011.337,4.767%2011.337,9.92c0,6.377%20-5.797,10.113%20-15.266,10.113c-6.828,0%20-12.368,-2.255%20-15.846,-5.991c-2.448,-2.448%20-3.929,-5.797%20-4.123,-9.469l-23.512,5.154c0.644,7.021%203.929,13.205%208.889,18.165c7.794,8.18%2020.42,13.076%2034.591,13.076m174.048,0c15.266,0%2026.99,-5.54%2035.041,-13.398c6.377,-6.184%2010.306,-13.398%2012.368,-20.806l-24.091,-8.052c-1.031,3.736%20-3.092,7.665%20-6.377,10.693c-3.929,3.736%20-9.276,6.377%20-16.941,6.377c-7.021,0%20-13.591,-2.705%20-18.358,-7.408c-4.767,-4.96%20-7.665,-12.174%20-7.665,-21.257c-0,-9.276%202.899,-16.297%207.665,-21.257c4.702,-4.767%2011.144,-7.214%2018.165,-7.214c7.408,-0%2012.561,2.448%2016.297,6.184c3.092,3.092%204.96,7.021%206.184,10.95l24.542,-8.245c-1.868,-7.214%20-5.797,-14.429%20-11.53,-20.419c-8.245,-8.052%20-20.226,-13.785%20-36.072,-13.785c-14.622,-0%20-27.827,5.54%20-37.296,15.073c-9.469,9.662%20-15.266,23.125%20-15.266,38.778c0,15.653%205.991,29.051%2015.653,38.778c9.403,9.468%2022.801,15.008%2037.681,15.008m-83.288,0c10.693,0%2018.358,-3.285%2021.643,-6.184l0,-22.287c-2.512,1.868%20-7.408,4.123%20-13.849,4.123c-4.573,0%20-7.859,-1.031%20-10.306,-3.285c-2.061,-2.061%20-3.092,-5.604%20-3.092,-10.306l0,-94.367l-27.247,0l0,27.827l54.43,0l0,26.41l-54.43,0l0,46.829c0,9.469%202.899,17.134%208.052,22.481c5.797,5.667%2014.299,8.759%2024.799,8.759'%20style='fill:%23fff;fill-rule:nonzero;'/%3e%3c/g%3e%3c/svg%3e";
|
|
613
|
+
function en(e) {
|
|
614
|
+
var t, n, r = "";
|
|
615
|
+
if (typeof e == "string" || typeof e == "number") r += e;
|
|
616
|
+
else if (typeof e == "object") if (Array.isArray(e)) {
|
|
617
|
+
var o = e.length;
|
|
618
|
+
for (t = 0; t < o; t++) e[t] && (n = en(e[t])) && (r && (r += " "), r += n);
|
|
619
|
+
} else for (n in e) e[n] && (r && (r += " "), r += n);
|
|
620
|
+
return r;
|
|
621
|
+
}
|
|
622
|
+
function Nn() {
|
|
623
|
+
for (var e, t, n = 0, r = "", o = arguments.length; n < o; n++) (e = arguments[n]) && (t = en(e)) && (r && (r += " "), r += t);
|
|
624
|
+
return r;
|
|
625
|
+
}
|
|
626
|
+
const oe = (...e) => Nn(e), We = (e) => {
|
|
627
|
+
const p = e, {
|
|
628
|
+
children: t,
|
|
629
|
+
type: n = "button",
|
|
630
|
+
variant: r = "primary",
|
|
631
|
+
onClick: o,
|
|
632
|
+
disabled: a,
|
|
633
|
+
busy: i,
|
|
634
|
+
fail: s,
|
|
635
|
+
success: u
|
|
636
|
+
} = p, l = be(p, [
|
|
637
|
+
"children",
|
|
638
|
+
"type",
|
|
639
|
+
"variant",
|
|
640
|
+
"onClick",
|
|
641
|
+
"disabled",
|
|
642
|
+
"busy",
|
|
643
|
+
"fail",
|
|
644
|
+
"success"
|
|
645
|
+
]), { isProcessing: d } = F(z), c = {
|
|
646
|
+
primary: "bg-primary text-white",
|
|
647
|
+
stc: "bg-stc text-white",
|
|
648
|
+
error: "bg-error text-white pointer-events-none",
|
|
649
|
+
success: "bg-success text-white"
|
|
650
|
+
};
|
|
651
|
+
function _() {
|
|
652
|
+
return s ? c.error : u ? c.success : c[r];
|
|
653
|
+
}
|
|
654
|
+
return /* @__PURE__ */ f(
|
|
655
|
+
"button",
|
|
656
|
+
O(S({}, l), {
|
|
657
|
+
type: n,
|
|
658
|
+
disabled: d || a,
|
|
659
|
+
onClick: o,
|
|
660
|
+
class: oe([
|
|
661
|
+
"flex h-11 w-full cursor-pointer items-center justify-center gap-2 rounded-lg px-3 py-2 transition-colors disabled:cursor-default disabled:opacity-70",
|
|
662
|
+
_(),
|
|
663
|
+
e.class,
|
|
664
|
+
d && !s && "pointer-events-none grayscale"
|
|
665
|
+
]),
|
|
666
|
+
children: [
|
|
667
|
+
s ? /* @__PURE__ */ f(
|
|
668
|
+
"svg",
|
|
669
|
+
{
|
|
670
|
+
class: "h-5 w-5",
|
|
671
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
672
|
+
viewBox: "0 0 24 24",
|
|
673
|
+
fill: "none",
|
|
674
|
+
stroke: "currentColor",
|
|
675
|
+
"stroke-width": "2",
|
|
676
|
+
"stroke-linecap": "round",
|
|
677
|
+
"stroke-linejoin": "round",
|
|
678
|
+
children: [
|
|
679
|
+
/* @__PURE__ */ f("circle", { cx: "12", cy: "12", r: "10" }),
|
|
680
|
+
/* @__PURE__ */ f("path", { d: "m15 9-6 6" }),
|
|
681
|
+
/* @__PURE__ */ f("path", { d: "m9 9 6 6" })
|
|
682
|
+
]
|
|
683
|
+
}
|
|
684
|
+
) : t,
|
|
685
|
+
i && /* @__PURE__ */ f(
|
|
686
|
+
"svg",
|
|
687
|
+
{
|
|
688
|
+
class: "h-4 w-4 animate-spin text-white",
|
|
689
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
690
|
+
fill: "none",
|
|
691
|
+
viewBox: "0 0 24 24",
|
|
692
|
+
children: [
|
|
693
|
+
/* @__PURE__ */ f(
|
|
694
|
+
"circle",
|
|
695
|
+
{
|
|
696
|
+
class: "opacity-25",
|
|
697
|
+
cx: "12",
|
|
698
|
+
cy: "12",
|
|
699
|
+
r: "10",
|
|
700
|
+
stroke: "currentColor",
|
|
701
|
+
"stroke-width": "4"
|
|
702
|
+
}
|
|
703
|
+
),
|
|
704
|
+
/* @__PURE__ */ f(
|
|
705
|
+
"path",
|
|
706
|
+
{
|
|
707
|
+
class: "opacity-75",
|
|
708
|
+
fill: "currentColor",
|
|
709
|
+
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
710
|
+
}
|
|
711
|
+
)
|
|
712
|
+
]
|
|
713
|
+
}
|
|
714
|
+
),
|
|
715
|
+
u && /* @__PURE__ */ f(
|
|
716
|
+
"svg",
|
|
717
|
+
{
|
|
718
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
719
|
+
viewBox: "0 0 24 24",
|
|
720
|
+
fill: "none",
|
|
721
|
+
stroke: "currentColor",
|
|
722
|
+
"stroke-width": "2",
|
|
723
|
+
"stroke-linecap": "round",
|
|
724
|
+
"stroke-linejoin": "round",
|
|
725
|
+
class: "h-4 w-4",
|
|
726
|
+
children: [
|
|
727
|
+
/* @__PURE__ */ f("path", { d: "M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5" }),
|
|
728
|
+
/* @__PURE__ */ f("path", { class: "animate-fade-in", d: "m9 11 3 3L22 4" })
|
|
729
|
+
]
|
|
730
|
+
}
|
|
731
|
+
)
|
|
732
|
+
]
|
|
733
|
+
})
|
|
734
|
+
);
|
|
735
|
+
}, de = (e) => {
|
|
736
|
+
const u = e, { name: t, placeholder: n, type: r = "text", onBlur: o, disabled: a } = u, i = be(u, ["name", "placeholder", "type", "onBlur", "disabled"]), { isProcessing: s } = F(z);
|
|
737
|
+
return /* @__PURE__ */ f(
|
|
738
|
+
"input",
|
|
739
|
+
O(S({}, i), {
|
|
740
|
+
dir: "ltr",
|
|
741
|
+
id: t,
|
|
742
|
+
name: t,
|
|
743
|
+
disabled: s || a,
|
|
744
|
+
class: oe([
|
|
745
|
+
"relative block w-full rounded-lg border-0 px-4 py-2 text-sm text-black shadow-input placeholder:text-black/70 focus:z-[2] focus:shadow-input-focus focus:outline-none",
|
|
746
|
+
e.class,
|
|
747
|
+
s && "pointer-events-none grayscale",
|
|
748
|
+
e.error && "z-[1] shadow-input-error"
|
|
749
|
+
]),
|
|
750
|
+
type: r,
|
|
751
|
+
placeholder: n,
|
|
752
|
+
onBlur: (l) => {
|
|
753
|
+
const d = l.target;
|
|
754
|
+
d.classList.add("shadow-input-error", "z-[1]"), d.value.trim() && d.classList.remove("shadow-input-error", "z-[1]"), o && typeof o == "function" && o(l);
|
|
755
|
+
}
|
|
756
|
+
})
|
|
757
|
+
);
|
|
758
|
+
}, st = it({});
|
|
759
|
+
function Fn(e, t) {
|
|
760
|
+
for (var n in t) e[n] = t[n];
|
|
761
|
+
return e;
|
|
762
|
+
}
|
|
763
|
+
function Et(e, t) {
|
|
764
|
+
for (var n in e) if (n !== "__source" && !(n in t)) return !0;
|
|
765
|
+
for (var r in t) if (r !== "__source" && e[r] !== t[r]) return !0;
|
|
766
|
+
return !1;
|
|
767
|
+
}
|
|
768
|
+
function St(e, t) {
|
|
769
|
+
this.props = e, this.context = t;
|
|
770
|
+
}
|
|
771
|
+
(St.prototype = new X()).isPureReactComponent = !0, St.prototype.shouldComponentUpdate = function(e, t) {
|
|
772
|
+
return Et(this.props, e) || Et(this.state, t);
|
|
773
|
+
};
|
|
774
|
+
var Ct = E.__b;
|
|
775
|
+
E.__b = function(e) {
|
|
776
|
+
e.type && e.type.__f && e.ref && (e.props.ref = e.ref, e.ref = null), Ct && Ct(e);
|
|
777
|
+
};
|
|
778
|
+
var Un = E.__e;
|
|
779
|
+
E.__e = function(e, t, n, r) {
|
|
780
|
+
if (e.then) {
|
|
781
|
+
for (var o, a = t; a = a.__; ) if ((o = a.__c) && o.__c) return t.__e == null && (t.__e = n.__e, t.__k = n.__k), o.__c(e, t);
|
|
782
|
+
}
|
|
783
|
+
Un(e, t, n, r);
|
|
784
|
+
};
|
|
785
|
+
var At = E.unmount;
|
|
786
|
+
function tn(e, t, n) {
|
|
787
|
+
return e && (e.__c && e.__c.__H && (e.__c.__H.__.forEach(function(r) {
|
|
788
|
+
typeof r.__c == "function" && r.__c();
|
|
789
|
+
}), e.__c.__H = null), (e = Fn({}, e)).__c != null && (e.__c.__P === n && (e.__c.__P = t), e.__c = null), e.__k = e.__k && e.__k.map(function(r) {
|
|
790
|
+
return tn(r, t, n);
|
|
791
|
+
})), e;
|
|
792
|
+
}
|
|
793
|
+
function nn(e, t, n) {
|
|
794
|
+
return e && n && (e.__v = null, e.__k = e.__k && e.__k.map(function(r) {
|
|
795
|
+
return nn(r, t, n);
|
|
796
|
+
}), e.__c && e.__c.__P === t && (e.__e && n.appendChild(e.__e), e.__c.__e = !0, e.__c.__P = n)), e;
|
|
797
|
+
}
|
|
798
|
+
function Be() {
|
|
799
|
+
this.__u = 0, this.t = null, this.__b = null;
|
|
800
|
+
}
|
|
801
|
+
function rn(e) {
|
|
802
|
+
var t = e.__.__c;
|
|
803
|
+
return t && t.__a && t.__a(e);
|
|
804
|
+
}
|
|
805
|
+
function ke() {
|
|
806
|
+
this.u = null, this.o = null;
|
|
807
|
+
}
|
|
808
|
+
E.unmount = function(e) {
|
|
809
|
+
var t = e.__c;
|
|
810
|
+
t && t.__R && t.__R(), t && 32 & e.__u && (e.type = null), At && At(e);
|
|
811
|
+
}, (Be.prototype = new X()).__c = function(e, t) {
|
|
812
|
+
var n = t.__c, r = this;
|
|
813
|
+
r.t == null && (r.t = []), r.t.push(n);
|
|
814
|
+
var o = rn(r.__v), a = !1, i = function() {
|
|
815
|
+
a || (a = !0, n.__R = null, o ? o(s) : s());
|
|
816
|
+
};
|
|
817
|
+
n.__R = i;
|
|
818
|
+
var s = function() {
|
|
819
|
+
if (!--r.__u) {
|
|
820
|
+
if (r.state.__a) {
|
|
821
|
+
var u = r.state.__a;
|
|
822
|
+
r.__v.__k[0] = nn(u, u.__c.__P, u.__c.__O);
|
|
823
|
+
}
|
|
824
|
+
var l;
|
|
825
|
+
for (r.setState({ __a: r.__b = null }); l = r.t.pop(); ) l.forceUpdate();
|
|
826
|
+
}
|
|
827
|
+
};
|
|
828
|
+
r.__u++ || 32 & t.__u || r.setState({ __a: r.__b = r.__v.__k[0] }), e.then(i, i);
|
|
829
|
+
}, Be.prototype.componentWillUnmount = function() {
|
|
830
|
+
this.t = [];
|
|
831
|
+
}, Be.prototype.render = function(e, t) {
|
|
832
|
+
if (this.__b) {
|
|
833
|
+
if (this.__v.__k) {
|
|
834
|
+
var n = document.createElement("div"), r = this.__v.__k[0].__c;
|
|
835
|
+
this.__v.__k[0] = tn(this.__b, n, r.__O = r.__P);
|
|
836
|
+
}
|
|
837
|
+
this.__b = null;
|
|
838
|
+
}
|
|
839
|
+
var o = t.__a && Ze(re, null, e.fallback);
|
|
840
|
+
return o && (o.__u &= -33), [Ze(re, null, t.__a ? null : e.children), o];
|
|
841
|
+
};
|
|
842
|
+
var Dt = function(e, t, n) {
|
|
843
|
+
if (++n[1] === n[0] && e.o.delete(t), e.props.revealOrder && (e.props.revealOrder[0] !== "t" || !e.o.size)) for (n = e.u; n; ) {
|
|
844
|
+
for (; n.length > 3; ) n.pop()();
|
|
845
|
+
if (n[1] < n[0]) break;
|
|
846
|
+
e.u = n = n[2];
|
|
847
|
+
}
|
|
848
|
+
};
|
|
849
|
+
(ke.prototype = new X()).__a = function(e) {
|
|
850
|
+
var t = this, n = rn(t.__v), r = t.o.get(e);
|
|
851
|
+
return r[0]++, function(o) {
|
|
852
|
+
var a = function() {
|
|
853
|
+
t.props.revealOrder ? (r.push(o), Dt(t, e, r)) : o();
|
|
854
|
+
};
|
|
855
|
+
n ? n(a) : a();
|
|
856
|
+
};
|
|
857
|
+
}, ke.prototype.render = function(e) {
|
|
858
|
+
this.u = null, this.o = /* @__PURE__ */ new Map();
|
|
859
|
+
var t = De(e.children);
|
|
860
|
+
e.revealOrder && e.revealOrder[0] === "b" && t.reverse();
|
|
861
|
+
for (var n = t.length; n--; ) this.o.set(t[n], this.u = [1, 0, this.u]);
|
|
862
|
+
return e.children;
|
|
863
|
+
}, ke.prototype.componentDidUpdate = ke.prototype.componentDidMount = function() {
|
|
864
|
+
var e = this;
|
|
865
|
+
this.o.forEach(function(t, n) {
|
|
866
|
+
Dt(e, n, t);
|
|
867
|
+
});
|
|
868
|
+
};
|
|
869
|
+
var Ln = typeof Symbol != "undefined" && Symbol.for && Symbol.for("react.element") || 60103, Vn = /^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/, Gn = /^on(Ani|Tra|Tou|BeforeInp|Compo)/, Bn = /[A-Z0-9]/g, zn = typeof document != "undefined", jn = function(e) {
|
|
870
|
+
return (typeof Symbol != "undefined" && typeof Symbol() == "symbol" ? /fil|che|rad/ : /fil|che|ra/).test(e);
|
|
871
|
+
};
|
|
872
|
+
X.prototype.isReactComponent = {}, ["componentWillMount", "componentWillReceiveProps", "componentWillUpdate"].forEach(function(e) {
|
|
873
|
+
Object.defineProperty(X.prototype, e, { configurable: !0, get: function() {
|
|
874
|
+
return this["UNSAFE_" + e];
|
|
875
|
+
}, set: function(t) {
|
|
876
|
+
Object.defineProperty(this, e, { configurable: !0, writable: !0, value: t });
|
|
877
|
+
} });
|
|
878
|
+
});
|
|
879
|
+
var Tt = E.event;
|
|
880
|
+
function Hn() {
|
|
881
|
+
}
|
|
882
|
+
function Kn() {
|
|
883
|
+
return this.cancelBubble;
|
|
884
|
+
}
|
|
885
|
+
function Zn() {
|
|
886
|
+
return this.defaultPrevented;
|
|
887
|
+
}
|
|
888
|
+
E.event = function(e) {
|
|
889
|
+
return Tt && (e = Tt(e)), e.persist = Hn, e.isPropagationStopped = Kn, e.isDefaultPrevented = Zn, e.nativeEvent = e;
|
|
890
|
+
};
|
|
891
|
+
var qn = { enumerable: !1, configurable: !0, get: function() {
|
|
892
|
+
return this.class;
|
|
893
|
+
} }, Mt = E.vnode;
|
|
894
|
+
E.vnode = function(e) {
|
|
895
|
+
typeof e.type == "string" && function(t) {
|
|
896
|
+
var n = t.props, r = t.type, o = {};
|
|
897
|
+
for (var a in n) {
|
|
898
|
+
var i = n[a];
|
|
899
|
+
if (!(a === "value" && "defaultValue" in n && i == null || zn && a === "children" && r === "noscript" || a === "class" || a === "className")) {
|
|
900
|
+
var s = a.toLowerCase();
|
|
901
|
+
a === "defaultValue" && "value" in n && n.value == null ? a = "value" : a === "download" && i === !0 ? i = "" : s === "translate" && i === "no" ? i = !1 : s === "ondoubleclick" ? a = "ondblclick" : s !== "onchange" || r !== "input" && r !== "textarea" || jn(n.type) ? s === "onfocus" ? a = "onfocusin" : s === "onblur" ? a = "onfocusout" : Gn.test(a) ? a = s : r.indexOf("-") === -1 && Vn.test(a) ? a = a.replace(Bn, "-$&").toLowerCase() : i === null && (i = void 0) : s = a = "oninput", s === "oninput" && o[a = s] && (a = "oninputCapture"), o[a] = i;
|
|
902
|
+
}
|
|
903
|
+
}
|
|
904
|
+
r == "select" && o.multiple && Array.isArray(o.value) && (o.value = De(n.children).forEach(function(u) {
|
|
905
|
+
u.props.selected = o.value.indexOf(u.props.value) != -1;
|
|
906
|
+
})), r == "select" && o.defaultValue != null && (o.value = De(n.children).forEach(function(u) {
|
|
907
|
+
u.props.selected = o.multiple ? o.defaultValue.indexOf(u.props.value) != -1 : o.defaultValue == u.props.value;
|
|
908
|
+
})), n.class && !n.className ? (o.class = n.class, Object.defineProperty(o, "className", qn)) : (n.className && !n.class || n.class && n.className) && (o.class = o.className = n.className), t.props = o;
|
|
909
|
+
}(e), e.$$typeof = Ln, Mt && Mt(e);
|
|
910
|
+
};
|
|
911
|
+
var Ot = E.__r;
|
|
912
|
+
E.__r = function(e) {
|
|
913
|
+
Ot && Ot(e), e.__c;
|
|
914
|
+
};
|
|
915
|
+
var Rt = E.diffed;
|
|
916
|
+
E.diffed = function(e) {
|
|
917
|
+
Rt && Rt(e);
|
|
918
|
+
var t = e.props, n = e.__e;
|
|
919
|
+
n != null && e.type === "textarea" && "value" in t && t.value !== n.value && (n.value = t.value == null ? "" : t.value);
|
|
920
|
+
};
|
|
921
|
+
function pe(e, t, n) {
|
|
922
|
+
var r = this, o = J(null), a = J(0), i = J(null), s = J([]), u = J(), l = J(), d = J(e), c = J(!0);
|
|
923
|
+
d.current = e;
|
|
924
|
+
var _ = typeof window != "undefined", p = !t && t !== 0 && _;
|
|
925
|
+
if (typeof e != "function") throw new TypeError("Expected a function");
|
|
926
|
+
t = +t || 0;
|
|
927
|
+
var y = !!(n = n || {}).leading, g = !("trailing" in n) || !!n.trailing, m = "maxWait" in n, h = "debounceOnServer" in n && !!n.debounceOnServer, v = m ? Math.max(+n.maxWait || 0, t) : null;
|
|
928
|
+
H(function() {
|
|
929
|
+
return c.current = !0, function() {
|
|
930
|
+
c.current = !1;
|
|
931
|
+
};
|
|
932
|
+
}, []);
|
|
933
|
+
var k = le(function() {
|
|
934
|
+
var w = function(C) {
|
|
935
|
+
var M = s.current, j = u.current;
|
|
936
|
+
return s.current = u.current = null, a.current = C, l.current = d.current.apply(j, M);
|
|
937
|
+
}, b = function(C, M) {
|
|
938
|
+
p && cancelAnimationFrame(i.current), i.current = p ? requestAnimationFrame(C) : setTimeout(C, M);
|
|
939
|
+
}, x = function(C) {
|
|
940
|
+
if (!c.current) return !1;
|
|
941
|
+
var M = C - o.current;
|
|
942
|
+
return !o.current || M >= t || M < 0 || m && C - a.current >= v;
|
|
943
|
+
}, A = function(C) {
|
|
944
|
+
return i.current = null, g && s.current ? w(C) : (s.current = u.current = null, l.current);
|
|
945
|
+
}, D = function C() {
|
|
946
|
+
var M = Date.now();
|
|
947
|
+
if (x(M)) return A(M);
|
|
948
|
+
if (c.current) {
|
|
949
|
+
var j = t - (M - o.current), Q = m ? Math.min(j, v - (M - a.current)) : j;
|
|
950
|
+
b(C, Q);
|
|
951
|
+
}
|
|
952
|
+
}, L = function() {
|
|
953
|
+
if (_ || h) {
|
|
954
|
+
var C = Date.now(), M = x(C);
|
|
955
|
+
if (s.current = [].slice.call(arguments), u.current = r, o.current = C, M) {
|
|
956
|
+
if (!i.current && c.current) return a.current = o.current, b(D, t), y ? w(o.current) : l.current;
|
|
957
|
+
if (m) return b(D, t), w(o.current);
|
|
958
|
+
}
|
|
959
|
+
return i.current || b(D, t), l.current;
|
|
960
|
+
}
|
|
961
|
+
};
|
|
962
|
+
return L.cancel = function() {
|
|
963
|
+
i.current && (p ? cancelAnimationFrame(i.current) : clearTimeout(i.current)), a.current = 0, s.current = o.current = u.current = i.current = null;
|
|
964
|
+
}, L.isPending = function() {
|
|
965
|
+
return !!i.current;
|
|
966
|
+
}, L.flush = function() {
|
|
967
|
+
return i.current ? A(Date.now()) : l.current;
|
|
968
|
+
}, L;
|
|
969
|
+
}, [y, m, t, v, g, p, _, h]);
|
|
970
|
+
return k;
|
|
971
|
+
}
|
|
972
|
+
var Yn = Object.defineProperty, Jn = (e, t, n) => t in e ? Yn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, Te = (e, t, n) => Jn(e, typeof t != "symbol" ? t + "" : t, n);
|
|
973
|
+
const It = {
|
|
974
|
+
"#": { pattern: /[0-9]/ },
|
|
975
|
+
"@": { pattern: /[a-zA-Z]/ },
|
|
976
|
+
"*": { pattern: /[a-zA-Z0-9]/ }
|
|
977
|
+
}, Nt = (e, t, n) => e.replaceAll(t, "").replace(n, ".").replace("..", ".").replace(/[^.\d]/g, ""), Ft = (e, t, n) => {
|
|
978
|
+
var o;
|
|
979
|
+
var r;
|
|
980
|
+
return new Intl.NumberFormat((o = (r = n.number) == null ? void 0 : r.locale) != null ? o : "en", {
|
|
981
|
+
minimumFractionDigits: e,
|
|
982
|
+
maximumFractionDigits: t,
|
|
983
|
+
roundingMode: "trunc"
|
|
984
|
+
});
|
|
985
|
+
}, Wn = (e, t = !0, n) => {
|
|
986
|
+
var m, h, v;
|
|
987
|
+
var r, o, a, i;
|
|
988
|
+
const s = ((r = n.number) == null ? void 0 : r.unsigned) == null && e.startsWith("-") ? "-" : "", u = (m = (o = n.number) == null ? void 0 : o.fraction) != null ? m : 0;
|
|
989
|
+
let l = Ft(0, u, n);
|
|
990
|
+
const d = l.formatToParts(1000.12), c = (h = (a = d.find((k) => k.type === "group")) == null ? void 0 : a.value) != null ? h : " ", _ = (v = (i = d.find((k) => k.type === "decimal")) == null ? void 0 : i.value) != null ? v : ".", p = Nt(e, c, _);
|
|
991
|
+
if (Number.isNaN(parseFloat(p))) return s;
|
|
992
|
+
const y = p.split(".");
|
|
993
|
+
if (y[1] != null && y[1].length >= 1) {
|
|
994
|
+
const k = y[1].length <= u ? y[1].length : u;
|
|
995
|
+
l = Ft(k, u, n);
|
|
996
|
+
}
|
|
997
|
+
let g = l.format(parseFloat(p));
|
|
998
|
+
return t ? u > 0 && p.endsWith(".") && !p.slice(0, -1).includes(".") && (g += _) : g = Nt(g, c, _), s + g;
|
|
999
|
+
};
|
|
1000
|
+
class Xn {
|
|
1001
|
+
constructor(t = {}) {
|
|
1002
|
+
var r;
|
|
1003
|
+
Te(this, "opts", {}), Te(this, "memo", /* @__PURE__ */ new Map());
|
|
1004
|
+
const n = S({}, t);
|
|
1005
|
+
if (n.tokens != null) {
|
|
1006
|
+
n.tokens = n.tokensReplace ? S({}, n.tokens) : S(S({}, It), n.tokens);
|
|
1007
|
+
for (const o of Object.values(n.tokens))
|
|
1008
|
+
typeof o.pattern == "string" && (o.pattern = new RegExp(o.pattern));
|
|
1009
|
+
} else
|
|
1010
|
+
n.tokens = It;
|
|
1011
|
+
Array.isArray(n.mask) && (n.mask.length > 1 ? n.mask = [...n.mask].sort((o, a) => o.length - a.length) : n.mask = (r = n.mask[0]) != null ? r : ""), n.mask === "" && (n.mask = null), this.opts = n;
|
|
1012
|
+
}
|
|
1013
|
+
masked(t) {
|
|
1014
|
+
return this.process(t, this.findMask(t));
|
|
1015
|
+
}
|
|
1016
|
+
unmasked(t) {
|
|
1017
|
+
return this.process(t, this.findMask(t), !1);
|
|
1018
|
+
}
|
|
1019
|
+
isEager() {
|
|
1020
|
+
return this.opts.eager === !0;
|
|
1021
|
+
}
|
|
1022
|
+
isReversed() {
|
|
1023
|
+
return this.opts.reversed === !0;
|
|
1024
|
+
}
|
|
1025
|
+
completed(t) {
|
|
1026
|
+
const n = this.findMask(t);
|
|
1027
|
+
if (this.opts.mask == null || n == null) return !1;
|
|
1028
|
+
const r = this.process(t, n).length;
|
|
1029
|
+
return typeof this.opts.mask == "string" ? r >= this.opts.mask.length : r >= n.length;
|
|
1030
|
+
}
|
|
1031
|
+
findMask(t) {
|
|
1032
|
+
var o, a;
|
|
1033
|
+
const n = this.opts.mask;
|
|
1034
|
+
if (n == null)
|
|
1035
|
+
return null;
|
|
1036
|
+
if (typeof n == "string")
|
|
1037
|
+
return n;
|
|
1038
|
+
if (typeof n == "function")
|
|
1039
|
+
return n(t);
|
|
1040
|
+
const r = this.process(t, (o = n.slice(-1).pop()) != null ? o : "", !1);
|
|
1041
|
+
return (a = n.find((i) => this.process(t, i, !1).length >= r.length)) != null ? a : "";
|
|
1042
|
+
}
|
|
1043
|
+
escapeMask(t) {
|
|
1044
|
+
const n = [], r = [];
|
|
1045
|
+
return t.split("").forEach((o, a) => {
|
|
1046
|
+
o === "!" && t[a - 1] !== "!" ? r.push(a - r.length) : n.push(o);
|
|
1047
|
+
}), { mask: n.join(""), escaped: r };
|
|
1048
|
+
}
|
|
1049
|
+
process(t, n, r = !0) {
|
|
1050
|
+
if (this.opts.number != null) return Wn(t, r, this.opts);
|
|
1051
|
+
if (n == null) return t;
|
|
1052
|
+
const o = `v=${t},mr=${n},m=${r ? 1 : 0}`;
|
|
1053
|
+
if (this.memo.has(o)) return this.memo.get(o);
|
|
1054
|
+
const { mask: a, escaped: i } = this.escapeMask(n), s = [], u = this.opts.tokens != null ? this.opts.tokens : {}, l = this.isReversed() ? -1 : 1, d = this.isReversed() ? "unshift" : "push", c = this.isReversed() ? 0 : a.length - 1, _ = this.isReversed() ? () => m > -1 && h > -1 : () => m < a.length && h < t.length, p = (k) => !this.isReversed() && k <= c || this.isReversed() && k >= c;
|
|
1055
|
+
let y, g = -1, m = this.isReversed() ? a.length - 1 : 0, h = this.isReversed() ? t.length - 1 : 0, v = !1;
|
|
1056
|
+
for (; _(); ) {
|
|
1057
|
+
const k = a.charAt(m), w = u[k], b = (w == null ? void 0 : w.transform) != null ? w.transform(t.charAt(h)) : t.charAt(h);
|
|
1058
|
+
if (!i.includes(m) && w != null ? (b.match(w.pattern) != null ? (s[d](b), w.repeated ? (g === -1 ? g = m : m === c && m !== g && (m = g - l), c === g && (m -= l)) : w.multiple && (v = !0, m -= l), m += l) : w.multiple ? v && (m += l, h -= l, v = !1) : b === y ? y = void 0 : w.optional && (m += l, h -= l), h += l) : (r && !this.isEager() && s[d](k), b === k && !this.isEager() ? h += l : y = k, this.isEager() || (m += l)), this.isEager())
|
|
1059
|
+
for (; p(m) && (u[a.charAt(m)] == null || i.includes(m)); ) {
|
|
1060
|
+
if (r) {
|
|
1061
|
+
if (s[d](a.charAt(m)), t.charAt(h) === a.charAt(m)) {
|
|
1062
|
+
m += l, h += l;
|
|
1063
|
+
continue;
|
|
1064
|
+
}
|
|
1065
|
+
} else a.charAt(m) === t.charAt(h) && (h += l);
|
|
1066
|
+
m += l;
|
|
1067
|
+
}
|
|
1068
|
+
}
|
|
1069
|
+
return this.memo.set(o, s.join("")), this.memo.get(o);
|
|
1070
|
+
}
|
|
1071
|
+
}
|
|
1072
|
+
const on = (e) => JSON.parse(e.replaceAll("'", '"')), Qn = (e, t = {}) => {
|
|
1073
|
+
const n = S({}, t);
|
|
1074
|
+
e.dataset.maska != null && e.dataset.maska !== "" && (n.mask = $n(e.dataset.maska)), e.dataset.maskaEager != null && (n.eager = xe(e.dataset.maskaEager)), e.dataset.maskaReversed != null && (n.reversed = xe(e.dataset.maskaReversed)), e.dataset.maskaTokensReplace != null && (n.tokensReplace = xe(e.dataset.maskaTokensReplace)), e.dataset.maskaTokens != null && (n.tokens = er(e.dataset.maskaTokens));
|
|
1075
|
+
const r = {};
|
|
1076
|
+
return e.dataset.maskaNumberLocale != null && (r.locale = e.dataset.maskaNumberLocale), e.dataset.maskaNumberFraction != null && (r.fraction = parseInt(e.dataset.maskaNumberFraction)), e.dataset.maskaNumberUnsigned != null && (r.unsigned = xe(e.dataset.maskaNumberUnsigned)), (e.dataset.maskaNumber != null || Object.values(r).length > 0) && (n.number = r), n;
|
|
1077
|
+
}, xe = (e) => e !== "" ? !!JSON.parse(e) : !0, $n = (e) => e.startsWith("[") && e.endsWith("]") ? on(e) : e, er = (e) => {
|
|
1078
|
+
if (e.startsWith("{") && e.endsWith("}"))
|
|
1079
|
+
return on(e);
|
|
1080
|
+
const t = {};
|
|
1081
|
+
return e.split("|").forEach((n) => {
|
|
1082
|
+
const r = n.split(":");
|
|
1083
|
+
t[r[0]] = {
|
|
1084
|
+
pattern: new RegExp(r[1]),
|
|
1085
|
+
optional: r[2] === "optional",
|
|
1086
|
+
multiple: r[2] === "multiple",
|
|
1087
|
+
repeated: r[2] === "repeated"
|
|
1088
|
+
};
|
|
1089
|
+
}), t;
|
|
1090
|
+
};
|
|
1091
|
+
class Fe {
|
|
1092
|
+
constructor(t, n = {}) {
|
|
1093
|
+
Te(this, "items", /* @__PURE__ */ new Map()), Te(this, "onInput", (r) => {
|
|
1094
|
+
if (r instanceof CustomEvent && r.type === "input" && !r.isTrusted && !r.bubbles)
|
|
1095
|
+
return;
|
|
1096
|
+
const o = r.target, a = this.items.get(o), i = "inputType" in r && r.inputType.startsWith("delete"), s = a.isEager(), u = i && s && a.unmasked(o.value) === "" ? "" : o.value;
|
|
1097
|
+
this.fixCursor(o, i, () => this.setValue(o, u));
|
|
1098
|
+
}), this.options = n, this.init(this.getInputs(t));
|
|
1099
|
+
}
|
|
1100
|
+
update(t = {}) {
|
|
1101
|
+
this.options = S({}, t), this.init(Array.from(this.items.keys()));
|
|
1102
|
+
}
|
|
1103
|
+
updateValue(t) {
|
|
1104
|
+
t.value !== "" && t.value !== this.processInput(t).masked && this.setValue(t, t.value);
|
|
1105
|
+
}
|
|
1106
|
+
destroy() {
|
|
1107
|
+
for (const t of this.items.keys())
|
|
1108
|
+
t.removeEventListener("input", this.onInput);
|
|
1109
|
+
this.items.clear();
|
|
1110
|
+
}
|
|
1111
|
+
init(t) {
|
|
1112
|
+
const n = this.getOptions(this.options);
|
|
1113
|
+
for (const r of t) {
|
|
1114
|
+
this.items.has(r) || r.addEventListener("input", this.onInput, { capture: !0 });
|
|
1115
|
+
const o = new Xn(Qn(r, n));
|
|
1116
|
+
this.items.set(r, o), queueMicrotask(() => this.updateValue(r)), r.selectionStart === null && o.isEager() && console.warn("Maska: input of `%s` type is not supported", r.type);
|
|
1117
|
+
}
|
|
1118
|
+
}
|
|
1119
|
+
getInputs(t) {
|
|
1120
|
+
return typeof t == "string" ? Array.from(document.querySelectorAll(t)) : "length" in t ? Array.from(t) : [t];
|
|
1121
|
+
}
|
|
1122
|
+
getOptions(t) {
|
|
1123
|
+
const i = t, { onMaska: n, preProcess: r, postProcess: o } = i;
|
|
1124
|
+
return be(i, ["onMaska", "preProcess", "postProcess"]);
|
|
1125
|
+
}
|
|
1126
|
+
fixCursor(t, n, r) {
|
|
1127
|
+
const o = t.selectionStart, a = t.value;
|
|
1128
|
+
if (r(), o === null || o === a.length && !n) return;
|
|
1129
|
+
const i = t.value, s = a.slice(0, o), u = i.slice(0, o), l = this.processInput(t, s).unmasked, d = this.processInput(t, u).unmasked;
|
|
1130
|
+
let c = o;
|
|
1131
|
+
s !== u && (c += n ? i.length - a.length : l.length - d.length), t.setSelectionRange(c, c);
|
|
1132
|
+
}
|
|
1133
|
+
setValue(t, n) {
|
|
1134
|
+
const r = this.processInput(t, n);
|
|
1135
|
+
t.value = r.masked, this.options.onMaska != null && (Array.isArray(this.options.onMaska) ? this.options.onMaska.forEach((o) => o(r)) : this.options.onMaska(r)), t.dispatchEvent(new CustomEvent("maska", { detail: r })), t.dispatchEvent(new CustomEvent("input", { detail: r.masked }));
|
|
1136
|
+
}
|
|
1137
|
+
processInput(t, n) {
|
|
1138
|
+
const r = this.items.get(t);
|
|
1139
|
+
let o = n != null ? n : t.value;
|
|
1140
|
+
this.options.preProcess != null && (o = this.options.preProcess(o));
|
|
1141
|
+
let a = r.masked(o);
|
|
1142
|
+
return this.options.postProcess != null && (a = this.options.postProcess(a)), {
|
|
1143
|
+
masked: a,
|
|
1144
|
+
unmasked: r.unmasked(o),
|
|
1145
|
+
completed: r.completed(o)
|
|
1146
|
+
};
|
|
1147
|
+
}
|
|
1148
|
+
}
|
|
1149
|
+
const tr = ({ showOtp: e, value: t, setValue: n }) => {
|
|
1150
|
+
const { t: r } = K(), { handleBlur: o, err: a } = F(st), i = "### ### ####", s = (l) => {
|
|
1151
|
+
const d = l.target, { value: c } = d;
|
|
1152
|
+
n(c);
|
|
1153
|
+
}, u = pe(o, 1e3);
|
|
1154
|
+
return H(() => {
|
|
1155
|
+
new Fe('[name="mysr-stc-mobile"]');
|
|
1156
|
+
}, []), /* @__PURE__ */ f(
|
|
1157
|
+
de,
|
|
1158
|
+
{
|
|
1159
|
+
name: "mysr-stc-mobile",
|
|
1160
|
+
label: r("form.mobile"),
|
|
1161
|
+
type: "text",
|
|
1162
|
+
inputMode: "numeric",
|
|
1163
|
+
maxLength: i.length,
|
|
1164
|
+
autocomplete: "tel-national",
|
|
1165
|
+
placeholder: "05x xxx xxxx",
|
|
1166
|
+
class: oe(["animate-fade-in text-center", !e && "hidden"]),
|
|
1167
|
+
onAnimationEnd: (l) => {
|
|
1168
|
+
l.target && l.target.focus();
|
|
1169
|
+
},
|
|
1170
|
+
value: t,
|
|
1171
|
+
onKeyUp: (l) => {
|
|
1172
|
+
s(l), u(l);
|
|
1173
|
+
},
|
|
1174
|
+
onBlur: o,
|
|
1175
|
+
error: a.phone,
|
|
1176
|
+
"data-maska": i,
|
|
1177
|
+
"data-maska-eager": !0
|
|
1178
|
+
}
|
|
1179
|
+
);
|
|
1180
|
+
}, nr = ({ showPhone: e, value: t, setValue: n }) => {
|
|
1181
|
+
const { t: r } = K(), { handleBlur: o, err: a } = F(st), i = (u) => {
|
|
1182
|
+
const l = u.target, { value: d } = l;
|
|
1183
|
+
n(d);
|
|
1184
|
+
}, s = pe(o, 1e3);
|
|
1185
|
+
return H(() => {
|
|
1186
|
+
new Fe('[name="mysr-stc-otp"]');
|
|
1187
|
+
}, []), /* @__PURE__ */ f(
|
|
1188
|
+
de,
|
|
1189
|
+
{
|
|
1190
|
+
name: "mysr-stc-otp",
|
|
1191
|
+
label: r("form.otp"),
|
|
1192
|
+
type: "text",
|
|
1193
|
+
inputMode: "numeric",
|
|
1194
|
+
autocomplete: "one-time-code",
|
|
1195
|
+
placeholder: r("form.code"),
|
|
1196
|
+
class: oe(["animate-fade-in text-center", e && "hidden"]),
|
|
1197
|
+
onAnimationEnd: (u) => {
|
|
1198
|
+
u.target && u.target.focus();
|
|
1199
|
+
},
|
|
1200
|
+
value: t,
|
|
1201
|
+
onKeyUp: (u) => {
|
|
1202
|
+
i(u), s(u);
|
|
1203
|
+
},
|
|
1204
|
+
onBlur: o,
|
|
1205
|
+
error: a.otp,
|
|
1206
|
+
"data-maska": "### ###",
|
|
1207
|
+
"data-maska-eager": !0
|
|
1208
|
+
}
|
|
1209
|
+
);
|
|
1210
|
+
}, B = (e) => e.split(" ").join(""), rr = ({
|
|
1211
|
+
countTo: e,
|
|
1212
|
+
callback: t
|
|
1213
|
+
}) => {
|
|
1214
|
+
const n = J(null), r = Xt(() => {
|
|
1215
|
+
const s = e ? new Date(e).getTime() - (/* @__PURE__ */ new Date()).getTime() : 0;
|
|
1216
|
+
return s < 0 ? 0 : s;
|
|
1217
|
+
}, [e]), [o, a] = I(r());
|
|
1218
|
+
H(() => (n.current = setInterval(() => {
|
|
1219
|
+
a(r());
|
|
1220
|
+
}, 500), () => {
|
|
1221
|
+
n.current && clearInterval(n.current);
|
|
1222
|
+
}), [r]), H(() => {
|
|
1223
|
+
o === 0 && (n.current && clearInterval(n.current), typeof t == "function" && t(0));
|
|
1224
|
+
}, [t, o]);
|
|
1225
|
+
const i = () => {
|
|
1226
|
+
const s = Math.floor(o / 1e3 / 60 / 60), u = Math.floor((o / 1e3 / 60 / 60 - s) * 60), l = Math.floor(((o / 1e3 / 60 / 60 - s) * 60 - u) * 60);
|
|
1227
|
+
return /* @__PURE__ */ f("span", { children: [
|
|
1228
|
+
u,
|
|
1229
|
+
":",
|
|
1230
|
+
l < 10 ? `0${l}` : l
|
|
1231
|
+
] });
|
|
1232
|
+
};
|
|
1233
|
+
return !e || !o ? null : /* @__PURE__ */ f("div", { class: oe("inline-flex gap-2 text-sm"), children: i() });
|
|
1234
|
+
}, or = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20width='100%25'%20height='100%25'%20viewBox='0%200%20512%20174'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20xml:space='preserve'%20xmlns:serif='http://www.serif.com/'%20style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;'%3e%3cg%3e%3cpath%20d='M326.531,121.529l-0,-74.676l12.663,0l0,5.988c3.854,-4.818%209.567,-7.433%2016.655,-7.433c14.592,-0%2025.053,11.631%2025.053,28.286c-0,16.656%20-10.53,28.494%20-25.053,28.494c-7.157,0%20-12.801,-2.753%20-16.655,-7.571l0,26.911l-12.663,-0l-0,0.001Zm12.664,-54.716l0,13.765c2.684,5.576%207.502,9.636%2014.453,9.636c8.398,-0%2014.041,-6.264%2014.041,-16.587c0,-10.186%20-5.643,-16.381%20-14.041,-16.381c-6.951,0.069%20-11.769,3.854%20-14.453,9.567'%20style='fill:%2302aa7c;fill-rule:nonzero;'%20/%3e%3cpath%20d='M389.093,85.258c-0,-9.085%205.643,-15.417%2015.003,-16.587l21.543,-2.753l-0,-2.684c-0,-3.234%20-1.652,-4.956%20-4.68,-4.956l-27.048,0l-0,-11.493l27.53,-0c10.943,-0%2016.931,5.368%2016.931,14.867l-0,38.885l-12.802,0l0,-6.538c-3.716,5.232%20-9.841,8.19%20-17.757,8.19c-11.149,0%20-18.72,-6.813%20-18.72,-16.931m21.817,6.607c6.469,-0%2012.457,-3.648%2014.659,-9.016l0,-6.745l-16.449,2.271c-4.542,0.62%20-7.089,3.028%20-7.089,6.952c0.001,4.198%203.235,6.538%208.879,6.538'%20style='fill:%2302aa7c;fill-rule:nonzero;'%20/%3e%3cpath%20d='M447.594,110.035l9.223,0c3.51,0%205.093,-1.446%206.263,-4.749l1.652,-4.75l-19.547,-53.752l13.215,-0l12.182,37.441l0.275,0l11.632,-37.441l13.007,-0l-21.404,61.736c-2.891,8.465%20-6.746,13.008%20-16.174,13.008l-10.323,-0l-0.001,-11.493Z'%20style='fill:%2302aa7c;fill-rule:nonzero;'%20/%3e%3cpath%20d='M61.142,158.488c14.729,0%2026.842,-4.611%2034.826,-12.319c5.987,-5.92%209.497,-13.903%209.497,-23.125c0,-8.328%20-3.097,-15.83%20-8.809,-21.543c-5.712,-5.713%20-13.903,-9.911%20-24.227,-11.907l-16.931,-3.304c-7.02,-1.307%20-11.011,-4.817%20-11.011,-9.703c-0,-6.402%206.194,-10.806%2016.105,-10.806c6.194,0%2011.493,1.996%2015.003,5.506c2.202,2.409%203.716,5.506%204.198,9.016l24.433,-5.506c-0.688,-7.02%20-3.992,-13.215%20-9.016,-18.307c-8.052,-7.915%20-20.372,-12.939%20-34.894,-12.939c-13.421,-0%20-24.639,4.405%20-32.416,11.425c-6.608,6.194%20-10.324,14.521%20-10.324,23.813c0,8.121%202.616,15.003%207.915,20.234c5.3,5.3%2013.008,9.223%2023.125,11.7l16.725,3.992c8.397,1.996%2012.113,5.093%2012.113,10.599c0,6.814%20-6.194,10.806%20-16.311,10.806c-7.295,-0%20-13.215,-2.41%20-16.931,-6.402c-2.616,-2.615%20-4.198,-6.194%20-4.405,-10.117l-25.122,5.507c0.688,7.502%204.198,14.109%209.498,19.409c8.327,8.74%2021.818,13.971%2036.959,13.971m185.965,0c16.311,0%2028.838,-5.919%2037.44,-14.315c6.814,-6.608%2011.012,-14.316%2013.215,-22.231l-25.74,-8.603c-1.102,3.992%20-3.304,8.19%20-6.814,11.425c-4.198,3.992%20-9.911,6.814%20-18.101,6.814c-7.502,-0%20-14.522,-2.891%20-19.615,-7.916c-5.093,-5.299%20-8.19,-13.007%20-8.19,-22.712c0,-9.911%203.098,-17.413%208.19,-22.713c5.024,-5.093%2011.907,-7.708%2019.409,-7.708c7.915,0%2013.421,2.616%2017.413,6.608c3.303,3.304%205.299,7.502%206.607,11.7l26.222,-8.81c-1.995,-7.708%20-6.193,-15.417%20-12.319,-21.817c-8.81,-8.603%20-21.611,-14.729%20-38.542,-14.729c-15.623,0%20-29.732,5.919%20-39.849,16.105c-10.118,10.324%20-16.312,24.709%20-16.312,41.433c0,16.725%206.401,31.04%2016.725,41.433c10.047,10.117%2024.362,16.036%2040.261,16.036m-88.991,0c11.425,0%2019.615,-3.51%2023.125,-6.607l0,-23.813c-2.684,1.996%20-7.915,4.405%20-14.797,4.405c-4.886,-0%20-8.397,-1.102%20-11.012,-3.51c-2.202,-2.202%20-3.303,-5.988%20-3.303,-11.012l-0,-100.828l-29.113,0l0,29.732l58.157,0l-0,28.219l-58.157,-0l0,50.035c0,10.117%203.097,18.307%208.603,24.02c6.194,6.055%2015.278,9.359%2026.497,9.359'%20style='fill:%23502c84;fill-rule:nonzero;'%20/%3e%3c/g%3e%3c/svg%3e";
|
|
1235
|
+
function an(e) {
|
|
1236
|
+
return e.errors !== void 0;
|
|
1237
|
+
}
|
|
1238
|
+
const ar = () => {
|
|
1239
|
+
const { t: e } = K(), [t, n] = I(!1), {
|
|
1240
|
+
amount: r,
|
|
1241
|
+
currency: o,
|
|
1242
|
+
description: a,
|
|
1243
|
+
publishable_api_key: i,
|
|
1244
|
+
metadata: s,
|
|
1245
|
+
invoice_id: u,
|
|
1246
|
+
version: l,
|
|
1247
|
+
base_url: d,
|
|
1248
|
+
on_failure: c,
|
|
1249
|
+
setFormSettings: _
|
|
1250
|
+
} = F(z), p = (v) => {
|
|
1251
|
+
_ && (n(v), _((k) => O(S({}, k), {
|
|
1252
|
+
isProcessing: v
|
|
1253
|
+
})));
|
|
1254
|
+
}, y = {
|
|
1255
|
+
amount: r,
|
|
1256
|
+
currency: o,
|
|
1257
|
+
description: a,
|
|
1258
|
+
publishable_api_key: i
|
|
1259
|
+
};
|
|
1260
|
+
s && Object.keys(s).length > 0 && (y.metadata = s), u && (y.invoice_id = u.toLowerCase());
|
|
1261
|
+
const g = (v) => {
|
|
1262
|
+
_ && _((k) => O(S({}, k), {
|
|
1263
|
+
apiError: `${e("error." + v.type)}, ${v.message}`
|
|
1264
|
+
}));
|
|
1265
|
+
}, m = () => {
|
|
1266
|
+
_ && _((v) => O(S({}, v), { apiError: "" }));
|
|
1267
|
+
};
|
|
1268
|
+
return {
|
|
1269
|
+
processing: t,
|
|
1270
|
+
postData: (w) => Y(void 0, [w], function* ({
|
|
1271
|
+
data: v,
|
|
1272
|
+
path: k
|
|
1273
|
+
}) {
|
|
1274
|
+
p(!0), m();
|
|
1275
|
+
const b = k || `${d}/v1/payments`;
|
|
1276
|
+
try {
|
|
1277
|
+
const x = yield fetch(b, {
|
|
1278
|
+
method: "POST",
|
|
1279
|
+
headers: {
|
|
1280
|
+
"Content-Type": "application/json",
|
|
1281
|
+
"X-Moyasar-Form-Version": l
|
|
1282
|
+
},
|
|
1283
|
+
body: JSON.stringify(S(S({}, y), v))
|
|
1284
|
+
});
|
|
1285
|
+
if (!x.ok) {
|
|
1286
|
+
if (typeof x == "object") {
|
|
1287
|
+
const A = yield x.json();
|
|
1288
|
+
if (console.log("fetch error:", A), !an(A)) {
|
|
1289
|
+
g({
|
|
1290
|
+
type: "api_error",
|
|
1291
|
+
message: `Error code: ${x.status}`,
|
|
1292
|
+
errors: null
|
|
1293
|
+
});
|
|
1294
|
+
return;
|
|
1295
|
+
}
|
|
1296
|
+
return g(A), A;
|
|
1297
|
+
}
|
|
1298
|
+
return yield Promise.reject(x);
|
|
1299
|
+
}
|
|
1300
|
+
return x.json();
|
|
1301
|
+
} catch (x) {
|
|
1302
|
+
if (c)
|
|
1303
|
+
try {
|
|
1304
|
+
yield c(x);
|
|
1305
|
+
} catch (A) {
|
|
1306
|
+
console.error("An error happened when firing failure callback"), console.error(A);
|
|
1307
|
+
}
|
|
1308
|
+
console.error(x);
|
|
1309
|
+
} finally {
|
|
1310
|
+
p(!1);
|
|
1311
|
+
}
|
|
1312
|
+
})
|
|
1313
|
+
};
|
|
1314
|
+
}, ir = () => {
|
|
1315
|
+
const { apiError: e } = F(z), [t, n] = I(!1);
|
|
1316
|
+
return H(() => {
|
|
1317
|
+
n(!!e);
|
|
1318
|
+
}, [e]), H(() => {
|
|
1319
|
+
let r = null;
|
|
1320
|
+
return t && (r = setTimeout(() => {
|
|
1321
|
+
n(!1);
|
|
1322
|
+
}, 3e3)), () => {
|
|
1323
|
+
r && clearTimeout(r);
|
|
1324
|
+
};
|
|
1325
|
+
}, [t]), {
|
|
1326
|
+
fail: t
|
|
1327
|
+
};
|
|
1328
|
+
}, sr = (n) => Y(void 0, [n], function* ({
|
|
1329
|
+
on_initiating: e,
|
|
1330
|
+
setFormSettings: t
|
|
1331
|
+
}) {
|
|
1332
|
+
const r = (a) => {
|
|
1333
|
+
if (typeof a != "object" || !t)
|
|
1334
|
+
return;
|
|
1335
|
+
const i = ["callback_url", "description", "metadata", "amount"];
|
|
1336
|
+
for (const s in a)
|
|
1337
|
+
if (!i.includes(s))
|
|
1338
|
+
throw new Error(`Changing ${s} is not allowed!`);
|
|
1339
|
+
t((s) => S(S({}, s), a));
|
|
1340
|
+
};
|
|
1341
|
+
if (!e)
|
|
1342
|
+
return Promise.resolve();
|
|
1343
|
+
if (typeof e != "function")
|
|
1344
|
+
throw new Error("Invalid on_initiating handler");
|
|
1345
|
+
const o = yield e();
|
|
1346
|
+
if (typeof o == "boolean")
|
|
1347
|
+
return o;
|
|
1348
|
+
if (typeof o == "object")
|
|
1349
|
+
return r(o), !0;
|
|
1350
|
+
throw new Error(`Invalid on_initiating handler result: ${o}`);
|
|
1351
|
+
}), lr = (e, t, n) => Y(void 0, null, function* () {
|
|
1352
|
+
var o;
|
|
1353
|
+
const r = `${e}${e.indexOf("?") > -1 ? "&" : "?"}id=${t.id}&status=${t.status}&message=${(o = t.source) == null ? void 0 : o.message}`;
|
|
1354
|
+
n && typeof n == "function" ? yield n(r) : window.location.href = r;
|
|
1355
|
+
}), cr = (n) => Y(void 0, [n], function* ({
|
|
1356
|
+
payment: e,
|
|
1357
|
+
on_completed: t
|
|
1358
|
+
}) {
|
|
1359
|
+
if (t !== null) {
|
|
1360
|
+
if (typeof t != "function")
|
|
1361
|
+
throw new Error("Invalid on_completed handler");
|
|
1362
|
+
try {
|
|
1363
|
+
yield t(e);
|
|
1364
|
+
} catch (r) {
|
|
1365
|
+
throw new Error("Unexpected error while handling on_completed callback");
|
|
1366
|
+
}
|
|
1367
|
+
}
|
|
1368
|
+
}), _e = ({
|
|
1369
|
+
defaultError: e
|
|
1370
|
+
}) => {
|
|
1371
|
+
const { callback_url: t, on_initiating: n, on_redirect: r, on_completed: o, setFormSettings: a } = F(z), [i, s] = I(e), { processing: u, postData: l } = ar(), [d, c] = I(!1), [_, p] = I(!1), { fail: y } = ir();
|
|
1372
|
+
function g(A) {
|
|
1373
|
+
return Y(this, arguments, function* ({ data: v, path: k, onSuccess: w, onFailed: b, initPayment: x }) {
|
|
1374
|
+
const D = yield l({
|
|
1375
|
+
data: v,
|
|
1376
|
+
path: k
|
|
1377
|
+
});
|
|
1378
|
+
an(D) || (D && (w && w(D), o && !x && (yield cr({
|
|
1379
|
+
payment: D,
|
|
1380
|
+
on_completed: o
|
|
1381
|
+
}).catch((L) => {
|
|
1382
|
+
console.error(L);
|
|
1383
|
+
})), D.status === "paid" && (p(!0), setTimeout(() => {
|
|
1384
|
+
lr(t, D, r).catch(() => {
|
|
1385
|
+
});
|
|
1386
|
+
}, 100)), D.status === "failed" && b && b(D)), c(!1));
|
|
1387
|
+
});
|
|
1388
|
+
}
|
|
1389
|
+
function m(v) {
|
|
1390
|
+
return Y(this, null, function* () {
|
|
1391
|
+
if (c(!0), v.initPayment) {
|
|
1392
|
+
try {
|
|
1393
|
+
const k = yield sr({
|
|
1394
|
+
on_initiating: n,
|
|
1395
|
+
setFormSettings: a
|
|
1396
|
+
});
|
|
1397
|
+
if (typeof k == "boolean" && !k) {
|
|
1398
|
+
c(!1);
|
|
1399
|
+
return;
|
|
1400
|
+
}
|
|
1401
|
+
yield g(v);
|
|
1402
|
+
} catch (k) {
|
|
1403
|
+
console.error(k), c(!1);
|
|
1404
|
+
}
|
|
1405
|
+
return;
|
|
1406
|
+
}
|
|
1407
|
+
yield g(v);
|
|
1408
|
+
});
|
|
1409
|
+
}
|
|
1410
|
+
const h = le(() => u || d, [u, d]);
|
|
1411
|
+
return {
|
|
1412
|
+
makePayment: m,
|
|
1413
|
+
busy: d,
|
|
1414
|
+
fail: y,
|
|
1415
|
+
success: _,
|
|
1416
|
+
processing: u,
|
|
1417
|
+
loading: h,
|
|
1418
|
+
error: i,
|
|
1419
|
+
setError: s
|
|
1420
|
+
};
|
|
1421
|
+
}, sn = ({ inForm: e = !1 }) => {
|
|
1422
|
+
const { apiError: t, showForm: n } = F(z);
|
|
1423
|
+
return n && !e ? null : /* @__PURE__ */ f("p", { class: "flex flex-col gap-2 rounded-md border border-error bg-red-100 px-4 py-2 text-xs font-medium text-error empty:hidden", children: t });
|
|
1424
|
+
}, ur = () => {
|
|
1425
|
+
const { t: e } = K(), { formattedAmount: t, isRtl: n, fixed_width: r, setFormSettings: o, showForm: a } = F(z), [i, s] = I(null), [u, l] = I(!1), d = {
|
|
1426
|
+
phone: "",
|
|
1427
|
+
otp: ""
|
|
1428
|
+
}, {
|
|
1429
|
+
makePayment: c,
|
|
1430
|
+
busy: _,
|
|
1431
|
+
fail: p,
|
|
1432
|
+
success: y,
|
|
1433
|
+
loading: g,
|
|
1434
|
+
error: m,
|
|
1435
|
+
setError: h
|
|
1436
|
+
} = _e({ defaultError: d }), [v, k] = I(""), [w, b] = I(""), [x, A] = I(""), D = (U) => {
|
|
1437
|
+
const T = /^05[503649187][0-9]{7}$/.test(B(U));
|
|
1438
|
+
return h((Z) => O(S({}, Z), {
|
|
1439
|
+
phone: T ? "" : "error.invalid_mobile"
|
|
1440
|
+
})), T;
|
|
1441
|
+
}, L = (U) => {
|
|
1442
|
+
const T = /^[0-9]{4,}$/.test(B(U));
|
|
1443
|
+
return h((Z) => O(S({}, Z), {
|
|
1444
|
+
otp: T ? "" : "error.invalid_otp"
|
|
1445
|
+
})), T;
|
|
1446
|
+
}, C = (U) => {
|
|
1447
|
+
const { value: T, name: Z } = U.target, te = T.trim();
|
|
1448
|
+
if (l(!1), !te) {
|
|
1449
|
+
l(!te);
|
|
1450
|
+
return;
|
|
1451
|
+
}
|
|
1452
|
+
Z === "mysr-stc-mobile" && D(te), Z === "mysr-stc-otp" && L(te);
|
|
1453
|
+
}, M = () => {
|
|
1454
|
+
if (!D(v)) return;
|
|
1455
|
+
function U(T) {
|
|
1456
|
+
const { transaction_url: Z } = T.source;
|
|
1457
|
+
A(Z), s((/* @__PURE__ */ new Date()).getTime() + 5 * 60 * 1e3);
|
|
1458
|
+
}
|
|
1459
|
+
c({
|
|
1460
|
+
data: {
|
|
1461
|
+
source: {
|
|
1462
|
+
type: "stcpay",
|
|
1463
|
+
mobile: B(v)
|
|
1464
|
+
}
|
|
1465
|
+
},
|
|
1466
|
+
onSuccess: U,
|
|
1467
|
+
initPayment: !0
|
|
1468
|
+
}).catch((T) => {
|
|
1469
|
+
console.error(T);
|
|
1470
|
+
});
|
|
1471
|
+
}, j = () => {
|
|
1472
|
+
if (!i || !L(w)) return;
|
|
1473
|
+
function U(T) {
|
|
1474
|
+
var Z;
|
|
1475
|
+
T.status === "failed" && ((Z = T.source) == null ? void 0 : Z.message) === "Invalid OTP" && (h((te) => O(S({}, te), {
|
|
1476
|
+
otp: "error.invalid_otp"
|
|
1477
|
+
})), b(""), s(null));
|
|
1478
|
+
}
|
|
1479
|
+
c({
|
|
1480
|
+
data: {
|
|
1481
|
+
otp_value: B(w)
|
|
1482
|
+
},
|
|
1483
|
+
path: x,
|
|
1484
|
+
onFailed: U
|
|
1485
|
+
}).catch((T) => {
|
|
1486
|
+
console.error(T);
|
|
1487
|
+
});
|
|
1488
|
+
}, Q = (U) => {
|
|
1489
|
+
if (U.preventDefault(), h(d), !i) {
|
|
1490
|
+
M();
|
|
1491
|
+
return;
|
|
1492
|
+
}
|
|
1493
|
+
j();
|
|
1494
|
+
}, V = (U) => {
|
|
1495
|
+
U > 0 || (h((T) => O(S({}, T), {
|
|
1496
|
+
otp: "error.otp_time_out"
|
|
1497
|
+
})), b(""), s(null));
|
|
1498
|
+
}, $ = le(() => m.phone || i && m.otp && m.otp !== "error.otp_time_out" ? !0 : u || g, [m, u, g]), ee = (U) => o((T) => O(S({}, T), { showForm: U })), [ce, fe] = I(!1), ve = () => {
|
|
1499
|
+
fe(!0);
|
|
1500
|
+
}, Ve = () => {
|
|
1501
|
+
ce && (k(""), b(""), h(d), ee(!1), fe(!1), l(!1));
|
|
1502
|
+
};
|
|
1503
|
+
return /* @__PURE__ */ f(
|
|
1504
|
+
st.Provider,
|
|
1505
|
+
{
|
|
1506
|
+
value: {
|
|
1507
|
+
err: m,
|
|
1508
|
+
setErr: h,
|
|
1509
|
+
handleBlur: C
|
|
1510
|
+
},
|
|
1511
|
+
children: /* @__PURE__ */ f(re, { children: [
|
|
1512
|
+
/* @__PURE__ */ f(We, { variant: "stc", onClick: () => ee(!0), children: /* @__PURE__ */ f(
|
|
1513
|
+
"img",
|
|
1514
|
+
{
|
|
1515
|
+
class: "pointer-events-none h-4 max-h-full",
|
|
1516
|
+
height: 16,
|
|
1517
|
+
width: 55,
|
|
1518
|
+
alt: "STC Pay",
|
|
1519
|
+
src: In
|
|
1520
|
+
}
|
|
1521
|
+
) }),
|
|
1522
|
+
a && /* @__PURE__ */ f(re, { children: [
|
|
1523
|
+
/* @__PURE__ */ f(
|
|
1524
|
+
"div",
|
|
1525
|
+
{
|
|
1526
|
+
class: oe([
|
|
1527
|
+
"fixed inset-0 z-[9] bg-gray-500/75 transition-opacity",
|
|
1528
|
+
ce ? "animate-fade-out duration-300" : "animate-fade-in duration-200"
|
|
1529
|
+
])
|
|
1530
|
+
}
|
|
1531
|
+
),
|
|
1532
|
+
/* @__PURE__ */ f("div", { class: "fixed inset-0 z-10 flex flex-col justify-end md:justify-center", children: /* @__PURE__ */ f(
|
|
1533
|
+
"div",
|
|
1534
|
+
{
|
|
1535
|
+
class: oe([
|
|
1536
|
+
"flex w-full origin-bottom flex-col gap-4 rounded-t-lg border-neutral-300 bg-slate-100 p-4 shadow transition-all md:rounded-b-lg lg:p-10",
|
|
1537
|
+
r && "md:mx-auto md:max-w-96 lg:max-w-screen-sm",
|
|
1538
|
+
ce ? "animate-dialog-out-mobile duration-200 md:animate-dialog-out" : "animate-dialog-in-mobile duration-300 md:animate-dialog-in"
|
|
1539
|
+
]),
|
|
1540
|
+
onAnimationEnd: Ve,
|
|
1541
|
+
children: [
|
|
1542
|
+
/* @__PURE__ */ f(sn, { inForm: !0 }),
|
|
1543
|
+
/* @__PURE__ */ f("div", { class: "flex items-center", children: [
|
|
1544
|
+
/* @__PURE__ */ f("img", { alt: "", src: or, class: "h-5" }),
|
|
1545
|
+
/* @__PURE__ */ f("button", { onClick: ve, class: "ms-auto", children: "Cancel" })
|
|
1546
|
+
] }),
|
|
1547
|
+
/* @__PURE__ */ f("form", { class: "flex flex-col gap-4", onSubmit: Q, children: [
|
|
1548
|
+
/* @__PURE__ */ f("div", { class: "space-y-2", children: [
|
|
1549
|
+
/* @__PURE__ */ f("div", { class: "flex items-end justify-between text-xs font-medium", children: [
|
|
1550
|
+
i ? /* @__PURE__ */ f("label", { for: "mysr-stc-mobile", children: e("form.otp") }) : /* @__PURE__ */ f("label", { for: "mysr-stc-otp", children: e("form.mobile") }),
|
|
1551
|
+
u && /* @__PURE__ */ f("span", { class: "uppercase text-error", children: e("form.required") })
|
|
1552
|
+
] }),
|
|
1553
|
+
/* @__PURE__ */ f(
|
|
1554
|
+
tr,
|
|
1555
|
+
{
|
|
1556
|
+
value: v,
|
|
1557
|
+
setValue: k,
|
|
1558
|
+
showOtp: !i && typeof i != "number"
|
|
1559
|
+
}
|
|
1560
|
+
),
|
|
1561
|
+
/* @__PURE__ */ f(
|
|
1562
|
+
nr,
|
|
1563
|
+
{
|
|
1564
|
+
value: w,
|
|
1565
|
+
setValue: b,
|
|
1566
|
+
showPhone: !i && typeof i != "number"
|
|
1567
|
+
}
|
|
1568
|
+
)
|
|
1569
|
+
] }),
|
|
1570
|
+
/* @__PURE__ */ f(
|
|
1571
|
+
We,
|
|
1572
|
+
{
|
|
1573
|
+
success: y,
|
|
1574
|
+
fail: p,
|
|
1575
|
+
busy: _,
|
|
1576
|
+
variant: "stc",
|
|
1577
|
+
class: "flex gap-1",
|
|
1578
|
+
disabled: $,
|
|
1579
|
+
type: "submit",
|
|
1580
|
+
children: [
|
|
1581
|
+
!n && e("button.pay"),
|
|
1582
|
+
" ",
|
|
1583
|
+
i ? /* @__PURE__ */ f(rr, { countTo: i, callback: V }) : t
|
|
1584
|
+
]
|
|
1585
|
+
}
|
|
1586
|
+
)
|
|
1587
|
+
] }),
|
|
1588
|
+
/* @__PURE__ */ f("p", { class: "flex flex-col gap-2 text-xs font-medium text-error empty:hidden", children: Object.entries(m).map(([U, T]) => /* @__PURE__ */ f("span", { class: "empty:hidden", children: e(T) }, U)) })
|
|
1589
|
+
]
|
|
1590
|
+
}
|
|
1591
|
+
) })
|
|
1592
|
+
] })
|
|
1593
|
+
] })
|
|
1594
|
+
}
|
|
1595
|
+
);
|
|
1596
|
+
}, dr = () => {
|
|
1597
|
+
const { t: e } = K(), {
|
|
1598
|
+
base_url: t,
|
|
1599
|
+
payment_button_type: n,
|
|
1600
|
+
publishable_api_key: r,
|
|
1601
|
+
apple_pay: o,
|
|
1602
|
+
payment_options: a,
|
|
1603
|
+
currency: i,
|
|
1604
|
+
supported_networks: s,
|
|
1605
|
+
decimalAmount: u,
|
|
1606
|
+
statement_descriptor: l,
|
|
1607
|
+
setFormSettings: d
|
|
1608
|
+
} = F(z), { makePayment: c } = _e({ defaultError: {} });
|
|
1609
|
+
function _() {
|
|
1610
|
+
if (!ApplePaySession)
|
|
1611
|
+
return;
|
|
1612
|
+
const p = (o == null ? void 0 : o.label) || (a == null ? void 0 : a.label), g = {
|
|
1613
|
+
countryCode: (o == null ? void 0 : o.country) || (a == null ? void 0 : a.country),
|
|
1614
|
+
currencyCode: i,
|
|
1615
|
+
supportedNetworks: s,
|
|
1616
|
+
merchantCapabilities: o.merchant_capabilities,
|
|
1617
|
+
total: {
|
|
1618
|
+
label: p,
|
|
1619
|
+
amount: u
|
|
1620
|
+
}
|
|
1621
|
+
}, m = new ApplePaySession(o.version, g);
|
|
1622
|
+
m.onvalidatemerchant = (h) => {
|
|
1623
|
+
const v = {
|
|
1624
|
+
validation_url: h.validationURL,
|
|
1625
|
+
display_name: p,
|
|
1626
|
+
domain_name: window.location.hostname,
|
|
1627
|
+
publishable_api_key: r
|
|
1628
|
+
}, k = o.validate_merchant_url || `${t}/v1/applepay/initiate`;
|
|
1629
|
+
fetch(k, {
|
|
1630
|
+
method: "POST",
|
|
1631
|
+
headers: {
|
|
1632
|
+
"Content-Type": "application/json"
|
|
1633
|
+
},
|
|
1634
|
+
body: JSON.stringify(v)
|
|
1635
|
+
}).then((w) => w.ok ? w : Promise.reject(w)).then((w) => w.json()).then((w) => {
|
|
1636
|
+
m.completeMerchantValidation(w);
|
|
1637
|
+
}).catch((w) => {
|
|
1638
|
+
console.error("Apple Pay error:", w), d((b) => O(S({}, b), {
|
|
1639
|
+
apiError: e("error.applePay")
|
|
1640
|
+
})), m.abort();
|
|
1641
|
+
});
|
|
1642
|
+
}, m.onpaymentauthorized = (h) => {
|
|
1643
|
+
const v = {
|
|
1644
|
+
source: {
|
|
1645
|
+
type: "applepay",
|
|
1646
|
+
token: JSON.stringify(h.payment.token)
|
|
1647
|
+
}
|
|
1648
|
+
};
|
|
1649
|
+
l && (v.statement_descriptor = l);
|
|
1650
|
+
function k(b) {
|
|
1651
|
+
var A;
|
|
1652
|
+
console.error(b), m.completePayment({
|
|
1653
|
+
status: ApplePaySession.STATUS_FAILURE,
|
|
1654
|
+
errors: []
|
|
1655
|
+
});
|
|
1656
|
+
let x = "Payment failed.";
|
|
1657
|
+
b instanceof Response ? x += " Error: " + b.statusText : typeof b == "string" ? x += " Error: " + b : b.status === "failed" && (x += " Error: " + ((A = b.source) == null ? void 0 : A.message)), d((D) => O(S({}, D), {
|
|
1658
|
+
apiError: x
|
|
1659
|
+
}));
|
|
1660
|
+
}
|
|
1661
|
+
function w(b) {
|
|
1662
|
+
console.error(b), m.completePayment({
|
|
1663
|
+
status: ApplePaySession.STATUS_SUCCESS
|
|
1664
|
+
});
|
|
1665
|
+
}
|
|
1666
|
+
c({
|
|
1667
|
+
data: v,
|
|
1668
|
+
onFailed: k,
|
|
1669
|
+
onSuccess: w
|
|
1670
|
+
}).catch((b) => {
|
|
1671
|
+
console.error(b);
|
|
1672
|
+
});
|
|
1673
|
+
}, m.oncancel = () => {
|
|
1674
|
+
try {
|
|
1675
|
+
m.abort();
|
|
1676
|
+
} catch (h) {
|
|
1677
|
+
console.error(h);
|
|
1678
|
+
}
|
|
1679
|
+
}, m.begin();
|
|
1680
|
+
}
|
|
1681
|
+
return /* @__PURE__ */ f(
|
|
1682
|
+
"button",
|
|
1683
|
+
{
|
|
1684
|
+
class: "apple-pay-button",
|
|
1685
|
+
style: { "-apple-pay-button-type": n },
|
|
1686
|
+
onClick: _
|
|
1687
|
+
}
|
|
1688
|
+
);
|
|
1689
|
+
}, pr = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAeEAAABLCAMAAABwZM8AAAADAFBMVEUAAAD////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////9/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f3+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7LtSl7AAAA/3RSTlMAAQIDBAUGBwgJCgsMDQ4PEBESExQVFhcYGRobHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2Nzg5Ojs8PT4/QEFCQ0RFRkdISUpLTE1O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", fr = () => {
|
|
1690
|
+
const {
|
|
1691
|
+
isTestMode: e,
|
|
1692
|
+
payment_button_type: t,
|
|
1693
|
+
samsung_pay: n,
|
|
1694
|
+
payment_options: r,
|
|
1695
|
+
supported_networks: o,
|
|
1696
|
+
currency: a,
|
|
1697
|
+
decimalAmount: i,
|
|
1698
|
+
setFormSettings: s
|
|
1699
|
+
} = F(z), [u, l] = I(!1), [d, c] = I(!1), { makePayment: _ } = _e({ defaultError: {} }), { t: p } = K(), y = J(null);
|
|
1700
|
+
H(() => {
|
|
1701
|
+
let h = null;
|
|
1702
|
+
return u || (h = setInterval(() => {
|
|
1703
|
+
window.SamsungPay && l(!0);
|
|
1704
|
+
}, 100)), () => {
|
|
1705
|
+
clearInterval(h);
|
|
1706
|
+
};
|
|
1707
|
+
}, [u]);
|
|
1708
|
+
const g = le(() => {
|
|
1709
|
+
if (!(!u || !n))
|
|
1710
|
+
return new SamsungPay.PaymentClient({ environment: n.environment });
|
|
1711
|
+
}, [u]);
|
|
1712
|
+
if (H(() => Y(void 0, null, function* () {
|
|
1713
|
+
if (!g || !n)
|
|
1714
|
+
return;
|
|
1715
|
+
const h = n.version, v = n.service_id, k = o == null ? void 0 : o.filter((b) => b !== "mada").map((b) => b.toLowerCase()), w = {
|
|
1716
|
+
version: h,
|
|
1717
|
+
serviceId: v,
|
|
1718
|
+
protocol: "PROTOCOL_3DS",
|
|
1719
|
+
allowedBrands: k
|
|
1720
|
+
};
|
|
1721
|
+
y.current = () => Y(void 0, null, function* () {
|
|
1722
|
+
const { order_number: b, id: x, country: A, label: D } = n, L = D || (r == null ? void 0 : r.label), C = A || (r == null ? void 0 : r.country), M = {
|
|
1723
|
+
orderNumber: b,
|
|
1724
|
+
merchant: {
|
|
1725
|
+
name: L,
|
|
1726
|
+
id: x,
|
|
1727
|
+
countryCode: C,
|
|
1728
|
+
url: window.location.hostname
|
|
1729
|
+
},
|
|
1730
|
+
amount: {
|
|
1731
|
+
option: "FORMAT_TOTAL_ESTIMATED_AMOUNT",
|
|
1732
|
+
currency: a,
|
|
1733
|
+
total: i
|
|
1734
|
+
}
|
|
1735
|
+
}, j = () => {
|
|
1736
|
+
g.notify({
|
|
1737
|
+
status: "CHARGED",
|
|
1738
|
+
provider: "Moyasar"
|
|
1739
|
+
});
|
|
1740
|
+
}, Q = (V) => {
|
|
1741
|
+
var ee;
|
|
1742
|
+
g.notify({
|
|
1743
|
+
status: "REJECTED",
|
|
1744
|
+
provider: "Moyasar"
|
|
1745
|
+
});
|
|
1746
|
+
let $ = "Payment failed.";
|
|
1747
|
+
V instanceof Payment && V.isFailed() ? $ += " Error: " + ((ee = V.source) == null ? void 0 : ee.message) : V instanceof Response ? $ += " Error: " + V.statusText : typeof V == "string" && ($ += " Error: " + V);
|
|
1748
|
+
};
|
|
1749
|
+
try {
|
|
1750
|
+
const V = yield g.loadPaymentSheet(
|
|
1751
|
+
w,
|
|
1752
|
+
M
|
|
1753
|
+
);
|
|
1754
|
+
_({
|
|
1755
|
+
initPayment: !0,
|
|
1756
|
+
data: {
|
|
1757
|
+
source: {
|
|
1758
|
+
type: "samsungpay",
|
|
1759
|
+
token: V["3DS"].data
|
|
1760
|
+
}
|
|
1761
|
+
},
|
|
1762
|
+
onFailed: Q,
|
|
1763
|
+
onSuccess: j
|
|
1764
|
+
});
|
|
1765
|
+
} catch (V) {
|
|
1766
|
+
try {
|
|
1767
|
+
g.notify({
|
|
1768
|
+
status: "ERRED",
|
|
1769
|
+
provider: "Moyasar"
|
|
1770
|
+
});
|
|
1771
|
+
} catch ($) {
|
|
1772
|
+
}
|
|
1773
|
+
console.log("Samsung Pay error: ", V);
|
|
1774
|
+
}
|
|
1775
|
+
});
|
|
1776
|
+
try {
|
|
1777
|
+
(yield g.isReadyToPay(w)).result ? c(!0) : s((x) => O(S({}, x), {
|
|
1778
|
+
apiError: "Cannot initialize Samsung Pay"
|
|
1779
|
+
}));
|
|
1780
|
+
} catch (b) {
|
|
1781
|
+
try {
|
|
1782
|
+
g.notify({
|
|
1783
|
+
status: "ERRED",
|
|
1784
|
+
provider: "Moyasar"
|
|
1785
|
+
});
|
|
1786
|
+
} catch (x) {
|
|
1787
|
+
}
|
|
1788
|
+
s((x) => O(S({}, x), {
|
|
1789
|
+
apiError: "Cannot initialize Samsung Pay"
|
|
1790
|
+
})), console.error("Samsung Pay Error: ", b);
|
|
1791
|
+
}
|
|
1792
|
+
}), [g, n]), !u || !d)
|
|
1793
|
+
return null;
|
|
1794
|
+
const m = t === "pay" ? "pay-with" : t;
|
|
1795
|
+
return /* @__PURE__ */ f(
|
|
1796
|
+
"button",
|
|
1797
|
+
{
|
|
1798
|
+
class: "flex h-11 w-full items-center justify-center gap-1 rounded-md bg-black text-white",
|
|
1799
|
+
onClick: y.current,
|
|
1800
|
+
children: [
|
|
1801
|
+
/* @__PURE__ */ f("span", { children: p(`button.${m}`) }),
|
|
1802
|
+
/* @__PURE__ */ f("img", { src: pr, alt: "", class: "-mb-[3px] h-[22px]" }),
|
|
1803
|
+
/* @__PURE__ */ f("div", { class: "mb-0.5 h-[9px] w-[9px] rotate-45 rounded-sm border-r-[3px] border-t-[3px] border-white" })
|
|
1804
|
+
]
|
|
1805
|
+
}
|
|
1806
|
+
);
|
|
1807
|
+
}, mr = () => {
|
|
1808
|
+
const {
|
|
1809
|
+
language: e,
|
|
1810
|
+
payment_button_type: t,
|
|
1811
|
+
google_pay: n,
|
|
1812
|
+
payment_options: r,
|
|
1813
|
+
supported_networks: o,
|
|
1814
|
+
currency: a,
|
|
1815
|
+
decimalAmount: i,
|
|
1816
|
+
setFormSettings: s
|
|
1817
|
+
} = F(z), [u, l] = I(!1), { makePayment: d } = _e({ defaultError: {} });
|
|
1818
|
+
H(() => {
|
|
1819
|
+
let _ = null;
|
|
1820
|
+
return u || (_ = setInterval(() => {
|
|
1821
|
+
var p, y;
|
|
1822
|
+
(y = (p = window.google) == null ? void 0 : p.payments) != null && y.api && l(!0);
|
|
1823
|
+
}, 100)), () => {
|
|
1824
|
+
clearInterval(_);
|
|
1825
|
+
};
|
|
1826
|
+
}, [u]);
|
|
1827
|
+
const c = le(() => {
|
|
1828
|
+
if (u)
|
|
1829
|
+
return new google.payments.api.PaymentsClient({
|
|
1830
|
+
environment: n.environment
|
|
1831
|
+
});
|
|
1832
|
+
}, [u]);
|
|
1833
|
+
return H(() => Y(void 0, null, function* () {
|
|
1834
|
+
const _ = document.getElementById("googlePay-container");
|
|
1835
|
+
if (!c || !n || (_ == null ? void 0 : _.children.length) >= 1)
|
|
1836
|
+
return;
|
|
1837
|
+
n.merchant_id;
|
|
1838
|
+
const p = o == null ? void 0 : o.filter((x) => x !== "mada").map((x) => x.toUpperCase()), y = n.auth_methods, g = {
|
|
1839
|
+
apiVersion: 2,
|
|
1840
|
+
apiVersionMinor: 0
|
|
1841
|
+
}, m = {
|
|
1842
|
+
type: "CARD",
|
|
1843
|
+
parameters: {
|
|
1844
|
+
allowedAuthMethods: y,
|
|
1845
|
+
allowedCardNetworks: p
|
|
1846
|
+
}
|
|
1847
|
+
}, h = Object.assign({}, g);
|
|
1848
|
+
h.allowedPaymentMethods = [m];
|
|
1849
|
+
const v = () => Y(void 0, null, function* () {
|
|
1850
|
+
const { country: x, label: A, merchant_id: D } = n, L = A || (r == null ? void 0 : r.label), C = x || (r == null ? void 0 : r.country), M = O(S({}, g), {
|
|
1851
|
+
allowedPaymentMethods: [b],
|
|
1852
|
+
merchantInfo: {
|
|
1853
|
+
merchantId: D,
|
|
1854
|
+
merchantName: L
|
|
1855
|
+
},
|
|
1856
|
+
transactionInfo: {
|
|
1857
|
+
countryCode: C,
|
|
1858
|
+
currencyCode: a,
|
|
1859
|
+
totalPriceStatus: "FINAL",
|
|
1860
|
+
totalPrice: i
|
|
1861
|
+
}
|
|
1862
|
+
});
|
|
1863
|
+
try {
|
|
1864
|
+
const j = yield c.loadPaymentData(M);
|
|
1865
|
+
d({
|
|
1866
|
+
initPayment: !0,
|
|
1867
|
+
data: {
|
|
1868
|
+
source: {
|
|
1869
|
+
type: "googlepay",
|
|
1870
|
+
token: j.paymentMethodData.tokenizationData.token
|
|
1871
|
+
}
|
|
1872
|
+
}
|
|
1873
|
+
});
|
|
1874
|
+
} catch (j) {
|
|
1875
|
+
console.error(j);
|
|
1876
|
+
}
|
|
1877
|
+
}), k = () => {
|
|
1878
|
+
const x = c.createButton({
|
|
1879
|
+
onClick: v,
|
|
1880
|
+
buttonLocale: e,
|
|
1881
|
+
buttonColor: "black",
|
|
1882
|
+
buttonType: t,
|
|
1883
|
+
buttonRadius: 6,
|
|
1884
|
+
buttonSizeMode: "fill"
|
|
1885
|
+
});
|
|
1886
|
+
_.appendChild(x);
|
|
1887
|
+
}, w = {
|
|
1888
|
+
type: "PAYMENT_GATEWAY",
|
|
1889
|
+
parameters: {
|
|
1890
|
+
gateway: "moyasar",
|
|
1891
|
+
gatewayMerchantId: n.gateway_merchant_id
|
|
1892
|
+
}
|
|
1893
|
+
}, b = Object.assign({}, m, {
|
|
1894
|
+
tokenizationSpecification: w
|
|
1895
|
+
});
|
|
1896
|
+
try {
|
|
1897
|
+
(yield c.isReadyToPay(h)).result ? k() : s((A) => O(S({}, A), {
|
|
1898
|
+
apiError: "Cannot initialize Google Pay"
|
|
1899
|
+
}));
|
|
1900
|
+
} catch (x) {
|
|
1901
|
+
s((A) => O(S({}, A), {
|
|
1902
|
+
apiError: "Cannot initialize Google Pay"
|
|
1903
|
+
})), console.error("Google Pay Error: ", x);
|
|
1904
|
+
}
|
|
1905
|
+
}), [c, n]), u ? /* @__PURE__ */ f(
|
|
1906
|
+
"div",
|
|
1907
|
+
{
|
|
1908
|
+
id: "googlePay-container",
|
|
1909
|
+
class: "flex h-11 items-center justify-center rounded-md bg-black empty:hidden"
|
|
1910
|
+
}
|
|
1911
|
+
) : null;
|
|
1912
|
+
}, hr = () => {
|
|
1913
|
+
const { t: e } = K(), { methods: t, apple_pay: n, samsung_pay: r, google_pay: o } = F(z), a = t.includes("stcpay"), i = t.includes("creditcard"), s = location.protocol === "https:" && t.includes("applepay") && typeof window.ApplePaySession != "undefined" && ApplePaySession.canMakePayments() && (n == null ? void 0 : n.version) && ApplePaySession.supportsVersion(n == null ? void 0 : n.version), u = !!(r != null && r.service_id), l = !!(o != null && o.merchant_id);
|
|
1914
|
+
return !s && !a && !u && !l ? null : /* @__PURE__ */ f("div", { class: "flex w-full flex-col gap-4", role: "main", children: [
|
|
1915
|
+
a && /* @__PURE__ */ f(ur, {}),
|
|
1916
|
+
s && /* @__PURE__ */ f(dr, {}),
|
|
1917
|
+
u && /* @__PURE__ */ f(fr, {}),
|
|
1918
|
+
l && /* @__PURE__ */ f(mr, {}),
|
|
1919
|
+
i && /* @__PURE__ */ f("p", { class: "flex items-center gap-4", children: [
|
|
1920
|
+
/* @__PURE__ */ f("hr", { class: "grow bg-neutral-300" }),
|
|
1921
|
+
/* @__PURE__ */ f("span", { class: "text-neutral-800/90", children: e("form.or_pay_with_card") }),
|
|
1922
|
+
/* @__PURE__ */ f("hr", { class: "grow bg-neutral-300" })
|
|
1923
|
+
] })
|
|
1924
|
+
] });
|
|
1925
|
+
}, Xe = ["mada", "visa", "amex", "masterCard"], Qe = [
|
|
1926
|
+
"creditcard",
|
|
1927
|
+
"applepay",
|
|
1928
|
+
"stcpay",
|
|
1929
|
+
"samsungpay"
|
|
1930
|
+
], $e = [
|
|
1931
|
+
"supports3DS",
|
|
1932
|
+
"supportsCredit",
|
|
1933
|
+
"supportsDebit",
|
|
1934
|
+
"supportsEMV"
|
|
1935
|
+
], _r = [
|
|
1936
|
+
"pay",
|
|
1937
|
+
"buy",
|
|
1938
|
+
"plain",
|
|
1939
|
+
"book",
|
|
1940
|
+
"check-out",
|
|
1941
|
+
"subscribe",
|
|
1942
|
+
"add-money",
|
|
1943
|
+
"contribute",
|
|
1944
|
+
"order",
|
|
1945
|
+
"reload",
|
|
1946
|
+
"rent",
|
|
1947
|
+
"support",
|
|
1948
|
+
"tip",
|
|
1949
|
+
"top-up",
|
|
1950
|
+
"continue"
|
|
1951
|
+
], Ut = {
|
|
1952
|
+
ADP: 0,
|
|
1953
|
+
AFN: 0,
|
|
1954
|
+
ALL: 0,
|
|
1955
|
+
AMD: 0,
|
|
1956
|
+
BHD: 3,
|
|
1957
|
+
BIF: 0,
|
|
1958
|
+
BYN: 2,
|
|
1959
|
+
BYR: 0,
|
|
1960
|
+
CAD: 2,
|
|
1961
|
+
CHF: 2,
|
|
1962
|
+
CLF: 4,
|
|
1963
|
+
CLP: 0,
|
|
1964
|
+
COP: 0,
|
|
1965
|
+
CRC: 0,
|
|
1966
|
+
CZK: 0,
|
|
1967
|
+
default: 2,
|
|
1968
|
+
DJF: 0,
|
|
1969
|
+
DKK: 2,
|
|
1970
|
+
ESP: 0,
|
|
1971
|
+
GNF: 0,
|
|
1972
|
+
GYD: 0,
|
|
1973
|
+
HUF: 0,
|
|
1974
|
+
IDR: 0,
|
|
1975
|
+
IQD: 0,
|
|
1976
|
+
IRR: 0,
|
|
1977
|
+
ISK: 0,
|
|
1978
|
+
ITL: 0,
|
|
1979
|
+
JOD: 3,
|
|
1980
|
+
JPY: 0,
|
|
1981
|
+
KMF: 0,
|
|
1982
|
+
KPW: 0,
|
|
1983
|
+
KRW: 0,
|
|
1984
|
+
KWD: 3,
|
|
1985
|
+
LAK: 0,
|
|
1986
|
+
LBP: 2,
|
|
1987
|
+
LUF: 0,
|
|
1988
|
+
LYD: 3,
|
|
1989
|
+
MGA: 0,
|
|
1990
|
+
MGF: 0,
|
|
1991
|
+
MMK: 0,
|
|
1992
|
+
MNT: 0,
|
|
1993
|
+
MRO: 0,
|
|
1994
|
+
MUR: 0,
|
|
1995
|
+
NOK: 0,
|
|
1996
|
+
OMR: 3,
|
|
1997
|
+
PKR: 0,
|
|
1998
|
+
PYG: 0,
|
|
1999
|
+
RSD: 0,
|
|
2000
|
+
RWF: 0,
|
|
2001
|
+
SEK: 0,
|
|
2002
|
+
SLL: 0,
|
|
2003
|
+
SOS: 0,
|
|
2004
|
+
STD: 0,
|
|
2005
|
+
SYP: 0,
|
|
2006
|
+
TMM: 0,
|
|
2007
|
+
TND: 3,
|
|
2008
|
+
TRL: 0,
|
|
2009
|
+
TWD: 0,
|
|
2010
|
+
TZS: 0,
|
|
2011
|
+
UGX: 0,
|
|
2012
|
+
UYI: 0,
|
|
2013
|
+
UYW: 4,
|
|
2014
|
+
UZS: 0,
|
|
2015
|
+
VEF: 0,
|
|
2016
|
+
VND: 0,
|
|
2017
|
+
VUV: 0,
|
|
2018
|
+
XAF: 0,
|
|
2019
|
+
XOF: 0,
|
|
2020
|
+
XPF: 0,
|
|
2021
|
+
YER: 0,
|
|
2022
|
+
ZMK: 0,
|
|
2023
|
+
ZWD: 0
|
|
2024
|
+
}, yr = [
|
|
2025
|
+
"22337902",
|
|
2026
|
+
"22337986",
|
|
2027
|
+
"22402030",
|
|
2028
|
+
"40177800",
|
|
2029
|
+
"403024",
|
|
2030
|
+
"40545400",
|
|
2031
|
+
"406136",
|
|
2032
|
+
"406996",
|
|
2033
|
+
"40719700",
|
|
2034
|
+
"40728100",
|
|
2035
|
+
"40739500",
|
|
2036
|
+
"407520",
|
|
2037
|
+
"409201",
|
|
2038
|
+
"410621",
|
|
2039
|
+
"410685",
|
|
2040
|
+
"410834",
|
|
2041
|
+
"412565",
|
|
2042
|
+
"417633",
|
|
2043
|
+
"419593",
|
|
2044
|
+
"420132",
|
|
2045
|
+
"421141",
|
|
2046
|
+
"42222200",
|
|
2047
|
+
"422817",
|
|
2048
|
+
"422818",
|
|
2049
|
+
"422819",
|
|
2050
|
+
"428331",
|
|
2051
|
+
"428671",
|
|
2052
|
+
"428672",
|
|
2053
|
+
"428673",
|
|
2054
|
+
"431361",
|
|
2055
|
+
"432328",
|
|
2056
|
+
"434107",
|
|
2057
|
+
"439954",
|
|
2058
|
+
"440533",
|
|
2059
|
+
"440647",
|
|
2060
|
+
"440795",
|
|
2061
|
+
"442429",
|
|
2062
|
+
"442463",
|
|
2063
|
+
"445564",
|
|
2064
|
+
"446393",
|
|
2065
|
+
"446404",
|
|
2066
|
+
"446672",
|
|
2067
|
+
"45488707",
|
|
2068
|
+
"45501701",
|
|
2069
|
+
"455036",
|
|
2070
|
+
"455708",
|
|
2071
|
+
"457865",
|
|
2072
|
+
"457997",
|
|
2073
|
+
"458456",
|
|
2074
|
+
"462220",
|
|
2075
|
+
"468540",
|
|
2076
|
+
"468541",
|
|
2077
|
+
"468542",
|
|
2078
|
+
"468543",
|
|
2079
|
+
"474491",
|
|
2080
|
+
"483010",
|
|
2081
|
+
"483011",
|
|
2082
|
+
"483012",
|
|
2083
|
+
"484783",
|
|
2084
|
+
"486094",
|
|
2085
|
+
"486095",
|
|
2086
|
+
"486096",
|
|
2087
|
+
"489318",
|
|
2088
|
+
"489319",
|
|
2089
|
+
"49098000",
|
|
2090
|
+
"49098001",
|
|
2091
|
+
"492464",
|
|
2092
|
+
"504300",
|
|
2093
|
+
"513213",
|
|
2094
|
+
"515079",
|
|
2095
|
+
"516138",
|
|
2096
|
+
"520058",
|
|
2097
|
+
"521076",
|
|
2098
|
+
"52166100",
|
|
2099
|
+
"524130",
|
|
2100
|
+
"524514",
|
|
2101
|
+
"524940",
|
|
2102
|
+
"529415",
|
|
2103
|
+
"529741",
|
|
2104
|
+
"530060",
|
|
2105
|
+
"531196",
|
|
2106
|
+
"535825",
|
|
2107
|
+
"535989",
|
|
2108
|
+
"536023",
|
|
2109
|
+
"537767",
|
|
2110
|
+
"53973776",
|
|
2111
|
+
"543085",
|
|
2112
|
+
"543357",
|
|
2113
|
+
"549760",
|
|
2114
|
+
"554180",
|
|
2115
|
+
"555610",
|
|
2116
|
+
"558563",
|
|
2117
|
+
"588845",
|
|
2118
|
+
"588848",
|
|
2119
|
+
"588850",
|
|
2120
|
+
"604906",
|
|
2121
|
+
"636120",
|
|
2122
|
+
"968201",
|
|
2123
|
+
"968202",
|
|
2124
|
+
"968203",
|
|
2125
|
+
"968204",
|
|
2126
|
+
"968205",
|
|
2127
|
+
"968206",
|
|
2128
|
+
"968207",
|
|
2129
|
+
"968208",
|
|
2130
|
+
"968209",
|
|
2131
|
+
"968211",
|
|
2132
|
+
"968212"
|
|
2133
|
+
], ln = (e) => {
|
|
2134
|
+
const t = !e, n = /^[a-zA-Z\-\s]+$/.test(e), r = /^[a-zA-Z-]+\s+?([a-zA-Z-]+\s?)+$/.test(e);
|
|
2135
|
+
return {
|
|
2136
|
+
isEmpty: t,
|
|
2137
|
+
isEnglishOnly: n,
|
|
2138
|
+
isValidFormat: r,
|
|
2139
|
+
isValid: !t && n && r
|
|
2140
|
+
};
|
|
2141
|
+
}, vr = ({ value: e, setValue: t, err: n, setErr: r }) => {
|
|
2142
|
+
const { t: o } = K(), [a, i] = I(!1), s = (d) => {
|
|
2143
|
+
const c = d.target.value.trim(), { isEmpty: _, isEnglishOnly: p, isValidFormat: y } = ln(c);
|
|
2144
|
+
if (_) {
|
|
2145
|
+
i(!c);
|
|
2146
|
+
return;
|
|
2147
|
+
}
|
|
2148
|
+
if (!p) {
|
|
2149
|
+
r((g) => O(S({}, g), { name: "validation.should_be_english_letters_only" }));
|
|
2150
|
+
return;
|
|
2151
|
+
}
|
|
2152
|
+
if (!y) {
|
|
2153
|
+
r((g) => O(S({}, g), { name: "validation.first_and_last_name_required" }));
|
|
2154
|
+
return;
|
|
2155
|
+
}
|
|
2156
|
+
i(!1), r((g) => O(S({}, g), { name: "" }));
|
|
2157
|
+
}, u = (d) => {
|
|
2158
|
+
const c = d.target, { value: _ } = c;
|
|
2159
|
+
t(_);
|
|
2160
|
+
}, l = pe(s, 1e3);
|
|
2161
|
+
return /* @__PURE__ */ f("div", { class: "space-y-2", role: "complementary", "aria-label": o("form.name_on_card"), children: [
|
|
2162
|
+
/* @__PURE__ */ f("div", { class: "flex items-end justify-between text-xs font-medium", children: [
|
|
2163
|
+
/* @__PURE__ */ f("label", { for: "mysr-cc-name", children: o("form.name_on_card") }),
|
|
2164
|
+
a && /* @__PURE__ */ f("span", { class: "uppercase text-error", children: o("form.required") })
|
|
2165
|
+
] }),
|
|
2166
|
+
/* @__PURE__ */ f(
|
|
2167
|
+
de,
|
|
2168
|
+
{
|
|
2169
|
+
name: "mysr-cc-name",
|
|
2170
|
+
placeholder: o("form.name_on_card"),
|
|
2171
|
+
onBlur: s,
|
|
2172
|
+
class: n.name ? "shadow-input-error" : "",
|
|
2173
|
+
autocomplete: "cc-name",
|
|
2174
|
+
dir: "ltr",
|
|
2175
|
+
value: e,
|
|
2176
|
+
onKeyUp: (d) => {
|
|
2177
|
+
u(d), l(d);
|
|
2178
|
+
},
|
|
2179
|
+
onChange: u
|
|
2180
|
+
}
|
|
2181
|
+
),
|
|
2182
|
+
n.name && /* @__PURE__ */ f("p", { class: "text-xs font-medium text-error", children: o(n.name) })
|
|
2183
|
+
] });
|
|
2184
|
+
}, cn = (e, t) => {
|
|
2185
|
+
const n = t === "amex" ? /^\d{4}$/.test(e) : /^\d{3}$/.test(e);
|
|
2186
|
+
return {
|
|
2187
|
+
isValid: n,
|
|
2188
|
+
msg: n ? "" : "error.invalid_csc"
|
|
2189
|
+
};
|
|
2190
|
+
}, Ue = it({}), gr = ({ setValue: e }) => {
|
|
2191
|
+
const { t } = K(), { handleBlur: n, err: r } = F(Ue), o = "** / **", a = (s) => {
|
|
2192
|
+
const u = s.target, { value: l } = u;
|
|
2193
|
+
e(l);
|
|
2194
|
+
}, i = pe(n, 1e3);
|
|
2195
|
+
return H(() => {
|
|
2196
|
+
new Fe('[name="mysr-cc-exp"]');
|
|
2197
|
+
}, []), /* @__PURE__ */ f(
|
|
2198
|
+
de,
|
|
2199
|
+
{
|
|
2200
|
+
"aria-label": t("form.date"),
|
|
2201
|
+
name: "mysr-cc-exp",
|
|
2202
|
+
onBlur: n,
|
|
2203
|
+
class: "rounded-none rounded-bl-lg",
|
|
2204
|
+
placeholder: "MM / YY",
|
|
2205
|
+
autocomplete: "cc-exp",
|
|
2206
|
+
inputMode: "numeric",
|
|
2207
|
+
maxLength: o.length,
|
|
2208
|
+
"data-maska": o,
|
|
2209
|
+
"data-maska-eager": !0,
|
|
2210
|
+
onKeyUp: (s) => {
|
|
2211
|
+
a(s), i(s);
|
|
2212
|
+
},
|
|
2213
|
+
error: r.exp
|
|
2214
|
+
}
|
|
2215
|
+
);
|
|
2216
|
+
}, br = ({ value: e, setValue: t }) => {
|
|
2217
|
+
const { t: n } = K(), { handleBlur: r, err: o, config: a } = F(Ue), i = (u) => {
|
|
2218
|
+
const l = u.target, { value: d } = l;
|
|
2219
|
+
t(d);
|
|
2220
|
+
}, s = pe(r, 1e3);
|
|
2221
|
+
return /* @__PURE__ */ f(
|
|
2222
|
+
de,
|
|
2223
|
+
{
|
|
2224
|
+
"aria-label": n("form.csc"),
|
|
2225
|
+
name: "mysr-cc-csc",
|
|
2226
|
+
onBlur: r,
|
|
2227
|
+
class: "rounded-none rounded-br-lg",
|
|
2228
|
+
placeholder: "CVC",
|
|
2229
|
+
autocomplete: "cc-csc",
|
|
2230
|
+
inputMode: "numeric",
|
|
2231
|
+
maxLength: a.csc,
|
|
2232
|
+
value: e,
|
|
2233
|
+
onKeyUp: (u) => {
|
|
2234
|
+
i(u), s(u);
|
|
2235
|
+
},
|
|
2236
|
+
error: o.csc
|
|
2237
|
+
}
|
|
2238
|
+
);
|
|
2239
|
+
}, wr = (e) => /^4/.test(B(e)), kr = (e) => /^(?:5[1-5][0-9]{2}|222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)/.test(B(e)), un = (e) => /^3[47]/.test(B(e)), dn = (e) => {
|
|
2240
|
+
const t = B(e), n = t.slice(0, 6), r = t.slice(0, 8);
|
|
2241
|
+
for (const o of yr)
|
|
2242
|
+
if (o == n || o == r)
|
|
2243
|
+
return !0;
|
|
2244
|
+
return !1;
|
|
2245
|
+
}, lt = () => {
|
|
2246
|
+
const { supported_networks: e } = F(z);
|
|
2247
|
+
function t(n) {
|
|
2248
|
+
let r = "";
|
|
2249
|
+
return wr(n) && (r = "visa"), kr(n) && (r = "masterCard"), un(n) && (r = "amex"), dn(n) && (r = "mada"), r === "" || !e.includes(r) ? "" : r;
|
|
2250
|
+
}
|
|
2251
|
+
return {
|
|
2252
|
+
getCardSchema: t
|
|
2253
|
+
};
|
|
2254
|
+
}, xr = ({ value: e, setValue: t }) => {
|
|
2255
|
+
const { t: n } = K(), { handleBlur: r, err: o, setType: a } = F(Ue), { getCardSchema: i } = lt(), s = (l) => {
|
|
2256
|
+
const d = l.target, { value: c } = d;
|
|
2257
|
+
t(c), a(i(c));
|
|
2258
|
+
}, u = pe(r, 1e3);
|
|
2259
|
+
return H(() => {
|
|
2260
|
+
new Fe('[name="mysr-cc-number"]', {
|
|
2261
|
+
mask: (l) => un(l) ? "#### ###### #####" : "#### #### #### ####"
|
|
2262
|
+
});
|
|
2263
|
+
}, []), /* @__PURE__ */ f(
|
|
2264
|
+
de,
|
|
2265
|
+
{
|
|
2266
|
+
"aria-label": n("form.cc"),
|
|
2267
|
+
name: "mysr-cc-number",
|
|
2268
|
+
placeholder: "1234 5678 9101 1121",
|
|
2269
|
+
onBlur: r,
|
|
2270
|
+
class: "col-span-full rounded-b-none",
|
|
2271
|
+
autocomplete: "cc-number",
|
|
2272
|
+
inputMode: "numeric",
|
|
2273
|
+
value: e,
|
|
2274
|
+
onKeyUp: (l) => {
|
|
2275
|
+
s(l), u(l);
|
|
2276
|
+
},
|
|
2277
|
+
onChange: s,
|
|
2278
|
+
error: o.cc
|
|
2279
|
+
}
|
|
2280
|
+
);
|
|
2281
|
+
}, Pr = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20width='100%25'%20height='100%25'%20viewBox='0%200%2096%2064'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20xml:space='preserve'%20xmlns:serif='http://www.serif.com/'%20style='fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;'%3e%3cpath%20d='M95,6.894c0,-3.253%20-2.641,-5.894%20-5.894,-5.894l-82.212,0c-3.253,0%20-5.894,2.641%20-5.894,5.894l0,50.212c0,3.253%202.641,5.894%205.894,5.894l82.212,0c3.253,0%205.894,-2.641%205.894,-5.894l0,-50.212Z'%20style='fill:%23fff;stroke:%237e7e7e;stroke-width:0.5px;'/%3e%3cclipPath%20id='_clip1'%3e%3crect%20x='7.179'%20y='18.832'%20width='81.642'%20height='26.336'/%3e%3c/clipPath%3e%3cg%20clip-path='url(%23_clip1)'%3e%3cg%3e%3cpath%20d='M47.418,19.387l-5.431,25.384l-6.567,0l5.432,-25.384l6.566,0Zm27.627,16.39l3.457,-9.532l1.989,9.532l-5.446,0Zm7.326,8.994l6.074,0l-5.3,-25.384l-5.607,0c-1.259,0%20-2.323,0.733%20-2.795,1.863l-9.852,23.521l6.895,0l1.37,-3.79l8.424,-0l0.791,3.79Zm-17.137,-8.287c0.028,-6.701%20-9.267,-7.069%20-9.201,-10.062c0.019,-0.912%200.887,-1.879%202.784,-2.127c0.943,-0.123%203.534,-0.218%206.476,1.136l1.152,-5.383c-1.58,-0.574%20-3.614,-1.125%20-6.143,-1.125c-6.49,-0%20-11.059,3.451%20-11.097,8.391c-0.041,3.655%203.261,5.693%205.75,6.908c2.557,1.245%203.417,2.041%203.406,3.154c-0.017,1.704%20-2.041,2.455%20-3.929,2.485c-3.302,0.052%20-5.218,-0.892%20-6.745,-1.603l-1.19,5.562c1.534,0.705%204.365,1.317%207.303,1.348c6.898,0%2011.411,-3.408%2011.434,-8.684Zm-27.2,-17.097l-10.639,25.384l-6.942,0l-5.235,-20.258c-0.318,-1.248%20-0.595,-1.705%20-1.562,-2.23c-1.576,-0.857%20-4.183,-1.66%20-6.477,-2.158l0.157,-0.738l11.173,0c1.423,0%202.705,0.948%203.028,2.588l2.765,14.69l6.833,-17.278l6.899,0Z'%20style='fill:%230d357f;fill-rule:nonzero;'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e", Er = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20width='100%25'%20height='100%25'%20viewBox='0%200%2096%2064'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20xml:space='preserve'%20xmlns:serif='http://www.serif.com/'%20style='fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;'%3e%3cpath%20d='M95,7.094c0,-3.363%20-2.731,-6.094%20-6.094,-6.094l-81.812,0c-3.363,0%20-6.094,2.731%20-6.094,6.094l-0,49.812c-0,3.363%202.731,6.094%206.094,6.094l81.812,0c3.363,0%206.094,-2.731%206.094,-6.094l0,-49.812Z'%20style='fill:%23fff;stroke:%23b1b1b1;stroke-width:0.5px;'/%3e%3cpath%20d='M95,6.894c0,-3.253%20-2.641,-5.894%20-5.894,-5.894l-82.212,0c-3.253,0%20-5.894,2.641%20-5.894,5.894l0,50.212c0,3.253%202.641,5.894%205.894,5.894l82.212,0c3.253,0%205.894,-2.641%205.894,-5.894l0,-50.212Z'%20style='fill:%23fff;stroke:%237e7e7e;stroke-width:0.5px;'/%3e%3cg%20opacity='0'%3e%3crect%20x='14.04'%20y='9.539'%20width='67.919'%20height='44.921'%20style='fill:%23fff;'/%3e%3c/g%3e%3crect%20x='39.044'%20y='17.366'%20width='17.917'%20height='29.263'%20style='fill:%23ff5f00;'/%3e%3cpath%20d='M40.89,32c-0.005,-5.706%202.619,-11.106%207.107,-14.629c-3.278,-2.576%20-7.329,-3.978%20-11.498,-3.978c-10.209,0%20-18.61,8.401%20-18.61,18.61c0,10.208%208.401,18.609%2018.61,18.609c4.169,-0%208.22,-1.401%2011.498,-3.978c-4.489,-3.524%20-7.113,-8.927%20-7.107,-14.634Z'%20style='fill:%23eb001b;fill-rule:nonzero;'/%3e%3cpath%20d='M76.33,43.533l0,-0.6l0.259,0l-0,-0.124l-0.615,-0l-0,0.124l0.242,0l0,0.6l0.114,-0Zm1.194,-0l0,-0.724l-0.186,-0l-0.217,0.517l-0.217,-0.517l-0.186,-0l-0,0.724l0.134,-0l0,-0.548l0.202,0.47l0.139,0l0.202,-0.47l0,0.548l0.129,-0Z'%20style='fill:%23f79e1b;fill-rule:nonzero;'/%3e%3cpath%20d='M78.108,32c0,10.209%20-8.4,18.609%20-18.609,18.609c-4.171,-0%20-8.223,-1.402%20-11.502,-3.98c4.487,-3.526%207.111,-8.926%207.111,-14.632c-0,-5.705%20-2.624,-11.106%20-7.111,-14.631c3.279,-2.578%207.331,-3.98%2011.502,-3.98c10.209,-0%2018.609,8.4%2018.609,18.609l0,0.005Z'%20style='fill:%23f79e1b;fill-rule:nonzero;'/%3e%3c/svg%3e", Sr = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20width='100%25'%20height='100%25'%20viewBox='0%200%2096%2064'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20xml:space='preserve'%20xmlns:serif='http://www.serif.com/'%20style='fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;'%3e%3cpath%20d='M95,7.053c0,-3.341%20-2.712,-6.053%20-6.053,-6.053l-81.894,-0c-3.341,-0%20-6.053,2.712%20-6.053,6.053l0,49.894c0,3.341%202.712,6.053%206.053,6.053l81.894,0c3.341,0%206.053,-2.712%206.053,-6.053l0,-49.894Z'%20style='fill:%23006fcf;stroke:%237e7e7e;stroke-width:0.5px;'/%3e%3cg%3e%3cpath%20d='M54.459,9.71l-10.404,23.609l8.342,0l0,21.172l26.31,0l4.061,-4.51l4.063,4.534l7.933,0l0,-2.672l-6.538,0l-5.395,-5.867l-5.44,5.88l-22.088,0l0,-18.444l22.202,0l5.408,5.938l5.476,-5.963l6.352,-0l0,-2.626l-4.935,-0l-0,-12.769l-4.686,12.699l-4.45,0l-4.823,-12.608l0,12.647l-10.546,0l-1.49,-3.637l-8.559,0l-1.457,3.589l-5.544,0l8.116,-18.39l6.498,-0l8.058,18.438l-0,-18.443l7.875,-0l4.161,11.351l4.127,-11.364l7.714,0.003l0,-2.656l-9.767,-0l-2.048,5.839l-2.2,-5.8l-12.552,-0l-0.077,7.83l-3.474,-7.76l-10.223,-0.02Z'%20style='fill:%23fff;'/%3e%3cpath%20d='M59.526,16.941l-2.53,5.961l5.011,0l-2.481,-5.961Z'%20style='fill:%23fff;'/%3e%3cpath%20d='M60.312,37.605l10.641,-0l0,-4.147l8.738,9.184l-8.621,9.204l-0.101,0l0,-4.221l-10.669,-0l-0,-2.905l10.397,0l-0,-4.077l-10.397,0l0.012,-3.038Z'%20style='fill:%23fff;'/%3e%3cpath%20d='M94.723,47.865l0,3.969l-8.581,-9.23l8.59,-9.225l-0,3.95l-4.946,5.265l4.937,5.271Z'%20style='fill:%23fff;'/%3e%3c/g%3e%3c/svg%3e", Cr = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20width='100%25'%20height='100%25'%20viewBox='0%200%2096%2064'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20xml:space='preserve'%20xmlns:serif='http://www.serif.com/'%20style='fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;'%3e%3cpath%20d='M95,6.894c0,-3.253%20-2.641,-5.894%20-5.894,-5.894l-82.212,0c-3.253,0%20-5.894,2.641%20-5.894,5.894l0,50.212c0,3.253%202.641,5.894%205.894,5.894l82.212,0c3.253,0%205.894,-2.641%205.894,-5.894l0,-50.212Z'%20style='fill:%23fff;stroke:%237e7e7e;stroke-width:0.5px;'/%3e%3cg%3e%3crect%20x='5.311'%20y='34.182'%20width='36.116'%20height='12.031'%20style='fill:%2384b740;'/%3e%3crect%20x='5.311'%20y='17.765'%20width='36.116'%20height='12.042'%20style='fill:%23259bd6;'/%3e%3cpath%20d='M77.542,43.769l-0.161,0.032c-0.557,0.107%20-0.761,0.15%20-1.168,0.15c-0.944,-0%20-2.059,-0.483%20-2.059,-2.756c-0,-1.169%200.193,-2.724%201.951,-2.724l0.011,0c0.3,0.022%200.644,0.054%201.287,0.247l0.139,0.043l0,5.008Zm0.29,-11.335l-0.29,0.054l0,4.203l-0.257,-0.075l-0.075,-0.021c-0.29,-0.086%20-0.954,-0.279%20-1.598,-0.279c-3.517,0%20-4.257,2.659%20-4.257,4.89c0,3.056%201.716,4.815%204.708,4.815c1.265,-0%202.198,-0.129%203.141,-0.44c0.869,-0.279%201.18,-0.676%201.18,-1.523l-0,-12.063c-0.836,0.15%20-1.705,0.3%20-2.552,0.439'%20style='fill:%2327292d;fill-rule:nonzero;'/%3e%3cpath%20d='M87.997,43.844l-0.15,0.043l-0.536,0.139c-0.504,0.129%20-0.954,0.204%20-1.297,0.204c-0.826,-0%20-1.319,-0.408%20-1.319,-1.105c-0,-0.45%200.203,-1.211%201.555,-1.211l1.747,-0l0,1.93Zm-1.233,-7.582c-1.083,0%20-2.198,0.193%20-3.581,0.622l-0.901,0.268l0.3,2.038l0.88,-0.29c0.922,-0.3%202.069,-0.493%202.927,-0.493c0.386,0%201.566,0%201.566,1.276l-0,0.558l-1.641,-0c-2.992,-0%20-4.375,0.954%20-4.375,3.002c-0,1.748%201.276,2.799%203.421,2.799c0.664,-0%201.587,-0.129%202.38,-0.322l0.043,-0.01l0.043,0.01l0.268,0.043c0.836,0.15%201.705,0.3%202.552,0.461l0,-6.691c0,-2.166%20-1.308,-3.271%20-3.882,-3.271'%20style='fill:%2327292d;fill-rule:nonzero;'/%3e%3cpath%20d='M67.162,43.844l-0.15,0.043l-0.536,0.139c-0.504,0.129%20-0.944,0.204%20-1.297,0.204c-0.826,-0%20-1.319,-0.408%20-1.319,-1.105c-0,-0.45%200.203,-1.211%201.544,-1.211l1.748,-0l0.01,1.93Zm-1.222,-7.582c-1.094,0%20-2.198,0.193%20-3.582,0.622l-0.9,0.268l0.3,2.038l0.879,-0.29c0.922,-0.3%202.07,-0.493%202.928,-0.493c0.386,0%201.565,0%201.565,1.276l0,0.558l-1.641,-0c-2.991,-0%20-4.385,0.954%20-4.385,3.002c-0,1.748%201.276,2.799%203.431,2.799c0.665,-0%201.587,-0.129%202.381,-0.322l0.043,-0.01l0.042,0.01l0.258,0.043c0.847,0.15%201.705,0.3%202.552,0.472l-0,-6.691c0.011,-2.188%20-1.298,-3.282%20-3.871,-3.282'%20style='fill:%2327292d;fill-rule:nonzero;'/%3e%3cpath%20d='M55.871,36.284c-1.362,-0%20-2.488,0.45%20-2.906,0.643l-0.107,0.054l-0.097,-0.075c-0.579,-0.418%20-1.426,-0.633%20-2.606,-0.633c-1.04,0%20-2.016,0.15%20-3.077,0.461c-0.912,0.279%20-1.266,0.719%20-1.266,1.544l0,7.646l2.853,0l-0,-7.067l0.139,-0.042c0.579,-0.193%200.922,-0.226%201.255,-0.226c0.826,0%201.244,0.44%201.244,1.298l-0,6.048l2.809,-0l0,-6.166c0,-0.365%20-0.075,-0.579%20-0.086,-0.622l-0.096,-0.182l0.193,-0.086c0.429,-0.193%200.901,-0.29%201.394,-0.29c0.568,0%201.244,0.226%201.244,1.298l-0,6.048l2.799,-0l-0,-6.327c-0,-2.241%20-1.201,-3.324%20-3.689,-3.324'%20style='fill:%2327292d;fill-rule:nonzero;'/%3e%3cpath%20d='M85.896,25.614c-0.419,0%20-1.116,-0.043%20-1.662,-0.15l-0.161,-0.032l-0,-4.128c-0,-0.344%20-0.065,-0.558%20-0.075,-0.59l-0.086,-0.172l0.182,-0.075c0.043,-0.021%200.086,-0.032%200.14,-0.053l0.032,-0.022c0.064,-0.021%200.128,-0.043%200.193,-0.064c0.032,-0.011%200.053,-0.022%200.075,-0.022c0.633,-0.171%201.212,-0.15%201.469,-0.171l0.011,-0c1.748,-0%201.951,1.555%201.951,2.723c-0.01,2.274%20-1.136,2.756%20-2.069,2.756m-0.011,-7.849l-0.075,-0c-1.641,-0%20-3.324,0.45%20-3.925,1.33c-0.321,0.429%20-0.504,0.965%20-0.514,1.597l-0,4.258c-0,0.364%20-0.076,0.504%20-0.086,0.536l-0.097,0.182l-5.179,-0l-0,-2.96l-0.011,0c-0.064,-3.12%20-1.909,-4.836%20-4.579,-4.836l-2.605,0c-0.108,0.762%20-0.193,1.298%20-0.301,2.059l2.595,0c1.362,0%202.081,1.158%202.081,2.938l-0,2.981l-0.183,-0.096c-0.032,-0.011%20-0.257,-0.086%20-0.611,-0.086l-4.482,-0c-0.086,0.568%20-0.193,1.308%20-0.311,2.048l13.779,0c0.472,-0.096%201.019,-0.182%201.491,-0.257c0.697,0.343%201.994,0.525%202.884,0.525c2.992,0%204.933,-2.005%204.933,-5.093c-0.011,-3.056%20-1.887,-5.062%20-4.804,-5.126'%20style='fill:%2327292d;fill-rule:nonzero;'/%3e%3cpath%20d='M57.78,28.971l4.074,-0c2.992,-0%204.386,-0.987%204.386,-3.421c0,-1.748%20-1.276,-3.142%20-3.421,-3.142l-2.755,0c-0.826,0%20-1.319,-0.472%20-1.319,-1.265c-0,-0.536%200.203,-1.201%201.554,-1.201l6.027,-0c0.129,-0.783%200.193,-1.276%200.311,-2.059l-6.262,-0c-2.917,-0%20-4.386,1.222%20-4.386,3.26c-0,2.016%201.276,3.067%203.42,3.067l2.756,-0c0.826,-0%201.319,0.654%201.319,1.34c0,0.45%20-0.203,1.383%20-1.544,1.383l-0.461,0l-8.825,-0.021l-1.609,-0c-1.361,-0%20-2.316,-0.772%20-2.316,-2.563l0,-1.233c0,-1.866%200.74,-3.024%202.316,-3.024l2.617,-0c0.118,-0.794%200.193,-1.298%200.3,-2.048l-3.571,-0c-2.67,-0%20-4.514,1.791%20-4.579,4.911l0,1.394c0.065,3.12%201.909,4.611%204.579,4.611l2.606,-0l4.783,0.011Z'%20style='fill:%2327292d;fill-rule:nonzero;'/%3e%3c/g%3e%3c/svg%3e", Ar = ({ type: e }) => {
|
|
2282
|
+
const t = "h-4 sm:h-5 w-auto object-contain object-center";
|
|
2283
|
+
return /* @__PURE__ */ f("div", { class: "absolute right-2 top-1/4 z-[2] flex -translate-y-1/2 items-center gap-1", children: [
|
|
2284
|
+
{
|
|
2285
|
+
alt: "AMEX",
|
|
2286
|
+
src: Sr
|
|
2287
|
+
},
|
|
2288
|
+
{
|
|
2289
|
+
alt: "MADA",
|
|
2290
|
+
src: Cr
|
|
2291
|
+
},
|
|
2292
|
+
{
|
|
2293
|
+
alt: "Visa",
|
|
2294
|
+
src: Pr
|
|
2295
|
+
},
|
|
2296
|
+
{
|
|
2297
|
+
alt: "MasterCard",
|
|
2298
|
+
src: Er
|
|
2299
|
+
}
|
|
2300
|
+
].filter((r) => e !== "" ? e.toLowerCase() === r.alt.toLowerCase() : !0).map((r) => /* @__PURE__ */ f("img", { class: t, alt: r.alt, src: r.src, loading: "lazy" })) });
|
|
2301
|
+
}, pn = (e) => {
|
|
2302
|
+
const t = "#### #### #### ####", n = {
|
|
2303
|
+
mask: t,
|
|
2304
|
+
validator: (o) => /^(?:5[1-5][0-9]{2}|222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}$/.test(
|
|
2305
|
+
B(o)
|
|
2306
|
+
),
|
|
2307
|
+
csc: 3
|
|
2308
|
+
}, r = {
|
|
2309
|
+
amex: {
|
|
2310
|
+
mask: "#### ###### #####",
|
|
2311
|
+
validator: (o) => /^3[47][0-9]{13}$/.test(B(o)),
|
|
2312
|
+
csc: 4
|
|
2313
|
+
},
|
|
2314
|
+
mada: {
|
|
2315
|
+
mask: t,
|
|
2316
|
+
validator: (o) => dn(o) && /\d{16}/.test(B(o)),
|
|
2317
|
+
csc: 3
|
|
2318
|
+
},
|
|
2319
|
+
visa: {
|
|
2320
|
+
mask: t,
|
|
2321
|
+
validator: (o) => /^4[0-9]{12}(?:[0-9]{3})?$/.test(B(o)),
|
|
2322
|
+
csc: 3
|
|
2323
|
+
},
|
|
2324
|
+
mastercard: n,
|
|
2325
|
+
masterCard: n
|
|
2326
|
+
};
|
|
2327
|
+
return e === "" ? r.visa : r[e];
|
|
2328
|
+
}, fn = (e) => {
|
|
2329
|
+
const [t, n] = e.split("/"), r = parseInt(t.trim()), o = r >= 1 && r <= 12, a = parseInt(n == null ? void 0 : n.trim()), i = Number.isNaN(a) || a < +(/* @__PURE__ */ new Date()).getFullYear().toString().slice(-2) || a > 99, s = /^\d{2} ?\/ ?\d{2}$/.test(e);
|
|
2330
|
+
return {
|
|
2331
|
+
isValidExpFormat: s,
|
|
2332
|
+
isValidYear: !i,
|
|
2333
|
+
inValidMonth: o,
|
|
2334
|
+
isValid: s && !i && o
|
|
2335
|
+
};
|
|
2336
|
+
}, Dr = (e) => {
|
|
2337
|
+
const t = [0, 2, 4, 6, 8, 1, 3, 5, 7, 9];
|
|
2338
|
+
if (typeof e != "string") throw new TypeError("Expected string input");
|
|
2339
|
+
if (!e) return !1;
|
|
2340
|
+
let n = e.length, r = !0, o = 0;
|
|
2341
|
+
for (; n; ) {
|
|
2342
|
+
const a = e.charCodeAt(--n) - 48;
|
|
2343
|
+
if (a < 0 || a > 9) return !1;
|
|
2344
|
+
r = !r, o += r ? t[a] : a;
|
|
2345
|
+
}
|
|
2346
|
+
return o % 10 === 0;
|
|
2347
|
+
}, mn = () => {
|
|
2348
|
+
const { getCardSchema: e } = lt();
|
|
2349
|
+
function t(n, r) {
|
|
2350
|
+
const o = r || e(n);
|
|
2351
|
+
if (!o && n.length > 3)
|
|
2352
|
+
return !1;
|
|
2353
|
+
const { validator: a } = pn(o), i = a(n), s = Dr(n);
|
|
2354
|
+
return i && s;
|
|
2355
|
+
}
|
|
2356
|
+
return {
|
|
2357
|
+
isValidCc: t
|
|
2358
|
+
};
|
|
2359
|
+
}, Tr = ({ cc: e, setCc: t, cvc: n, setCvc: r, exp: o, setExp: a, err: i, setErr: s }) => {
|
|
2360
|
+
const { t: u } = K(), [l, d] = I(!1), [c, _] = I(""), { isValidCc: p } = mn(), y = Xt(() => pn(c), [c]), g = (m) => {
|
|
2361
|
+
const { value: h, name: v } = m.target, k = B(h.trim());
|
|
2362
|
+
if (!k) {
|
|
2363
|
+
d(!k);
|
|
2364
|
+
return;
|
|
2365
|
+
}
|
|
2366
|
+
if (v === "mysr-cc-csc") {
|
|
2367
|
+
const { msg: w } = cn(k, c);
|
|
2368
|
+
s((b) => O(S({}, b), {
|
|
2369
|
+
csc: w
|
|
2370
|
+
}));
|
|
2371
|
+
}
|
|
2372
|
+
if (v === "mysr-cc-exp") {
|
|
2373
|
+
const { isValidExpFormat: w, isValidYear: b, inValidMonth: x } = fn(k);
|
|
2374
|
+
s((A) => O(S({}, A), {
|
|
2375
|
+
exp_month: x ? "" : "error.invalid_month",
|
|
2376
|
+
exp_year: b ? "" : "error.invalid_year",
|
|
2377
|
+
exp: w ? "" : "error.invalid_date"
|
|
2378
|
+
}));
|
|
2379
|
+
}
|
|
2380
|
+
v === "mysr-cc-number" && s((w) => O(S({}, w), {
|
|
2381
|
+
cc: c === "" ? "error.unsupported_cc_type" : p(k) ? "" : "error.invalid_cc_number"
|
|
2382
|
+
}));
|
|
2383
|
+
};
|
|
2384
|
+
return H(() => {
|
|
2385
|
+
Object.values(i).filter((m) => m).length === 0 && d(!1);
|
|
2386
|
+
}, [i]), /* @__PURE__ */ f(
|
|
2387
|
+
Ue.Provider,
|
|
2388
|
+
{
|
|
2389
|
+
value: {
|
|
2390
|
+
err: i,
|
|
2391
|
+
setErr: s,
|
|
2392
|
+
handleBlur: g,
|
|
2393
|
+
type: c,
|
|
2394
|
+
setType: _,
|
|
2395
|
+
config: y()
|
|
2396
|
+
},
|
|
2397
|
+
children: /* @__PURE__ */ f("div", { class: "space-y-2", role: "complementary", "aria-label": u("form.card_info"), children: [
|
|
2398
|
+
/* @__PURE__ */ f("div", { class: "flex items-end justify-between text-xs font-medium", children: [
|
|
2399
|
+
/* @__PURE__ */ f("legend", { children: u("form.card_info") }),
|
|
2400
|
+
l && /* @__PURE__ */ f("span", { class: "uppercase text-error", children: u("form.required") })
|
|
2401
|
+
] }),
|
|
2402
|
+
/* @__PURE__ */ f("div", { class: "relative grid grid-cols-2 gap-y-[1px]", dir: "ltr", children: [
|
|
2403
|
+
/* @__PURE__ */ f(xr, { value: e, setValue: t }),
|
|
2404
|
+
/* @__PURE__ */ f(Ar, { type: c }),
|
|
2405
|
+
/* @__PURE__ */ f(gr, { value: o, setValue: a }),
|
|
2406
|
+
/* @__PURE__ */ f(br, { value: n, setValue: r })
|
|
2407
|
+
] }),
|
|
2408
|
+
/* @__PURE__ */ f("p", { class: "flex flex-col gap-2 text-xs font-medium text-error", children: Object.entries(i).filter(([m]) => m !== "name").map(([m, h]) => /* @__PURE__ */ f("span", { class: "empty:hidden", children: u(h) }, m)) })
|
|
2409
|
+
] })
|
|
2410
|
+
}
|
|
2411
|
+
);
|
|
2412
|
+
}, Mr = () => {
|
|
2413
|
+
const { t: e } = K(), {
|
|
2414
|
+
formattedAmount: t,
|
|
2415
|
+
isRtl: n,
|
|
2416
|
+
credit_card: r,
|
|
2417
|
+
statement_descriptor: o,
|
|
2418
|
+
callback_url: a,
|
|
2419
|
+
payment_button_type: i
|
|
2420
|
+
} = F(z), [s, u] = I(""), [l, d] = I(""), [c, _] = I(""), [p, y] = I(""), { getCardSchema: g } = lt(), { isValidCc: m } = mn(), h = {
|
|
2421
|
+
name: "",
|
|
2422
|
+
csc: "",
|
|
2423
|
+
cc: "",
|
|
2424
|
+
exp: "",
|
|
2425
|
+
exp_month: "",
|
|
2426
|
+
exp_year: ""
|
|
2427
|
+
}, {
|
|
2428
|
+
makePayment: v,
|
|
2429
|
+
busy: k,
|
|
2430
|
+
fail: w,
|
|
2431
|
+
success: b,
|
|
2432
|
+
loading: x,
|
|
2433
|
+
error: A,
|
|
2434
|
+
setError: D
|
|
2435
|
+
} = _e({ defaultError: h });
|
|
2436
|
+
return /* @__PURE__ */ f("form", { class: "space-y-6", onSubmit: (M) => {
|
|
2437
|
+
M.preventDefault();
|
|
2438
|
+
const { isValid: j } = ln(s), Q = B(l), V = B(p), $ = B(c), ee = g(Q), ce = m(Q, ee), { isValid: fe } = cn($, ee), { isValid: ve } = fn(V);
|
|
2439
|
+
if (!j || !ce || !fe || !ve) {
|
|
2440
|
+
const q = S({}, h);
|
|
2441
|
+
j || (q.name = e("error.invalid_name")), ce || (q.cc = e("error.invalid_cc_number")), fe || (q.csc = e("error.invalid_csc")), ve || (q.exp = e("error.invalid_date")), D(q);
|
|
2442
|
+
return;
|
|
2443
|
+
}
|
|
2444
|
+
const [Ve, U] = V.split("/"), T = {
|
|
2445
|
+
type: "creditcard",
|
|
2446
|
+
name: s,
|
|
2447
|
+
number: Q,
|
|
2448
|
+
month: Ve,
|
|
2449
|
+
year: U,
|
|
2450
|
+
cvc: $
|
|
2451
|
+
};
|
|
2452
|
+
r != null && r.manual && (T.manual = !0), r != null && r.save_card && (T.save_card = !0), o && (T.statement_descriptor = o);
|
|
2453
|
+
function Z(q) {
|
|
2454
|
+
const { transaction_url: yn } = q.source;
|
|
2455
|
+
window.location.href = yn;
|
|
2456
|
+
}
|
|
2457
|
+
function te(q) {
|
|
2458
|
+
console.error(q);
|
|
2459
|
+
}
|
|
2460
|
+
v({
|
|
2461
|
+
data: {
|
|
2462
|
+
callback_url: a,
|
|
2463
|
+
source: T
|
|
2464
|
+
},
|
|
2465
|
+
initPayment: !0,
|
|
2466
|
+
onFailed: te,
|
|
2467
|
+
onSuccess: Z
|
|
2468
|
+
}).catch((q) => {
|
|
2469
|
+
console.error(q);
|
|
2470
|
+
});
|
|
2471
|
+
}, children: [
|
|
2472
|
+
/* @__PURE__ */ f(vr, { value: s, setValue: u, err: A, setErr: D }),
|
|
2473
|
+
/* @__PURE__ */ f(
|
|
2474
|
+
Tr,
|
|
2475
|
+
{
|
|
2476
|
+
cc: l,
|
|
2477
|
+
setCc: d,
|
|
2478
|
+
cvc: c,
|
|
2479
|
+
setCvc: _,
|
|
2480
|
+
exp: p,
|
|
2481
|
+
setExp: y,
|
|
2482
|
+
err: A,
|
|
2483
|
+
setErr: D
|
|
2484
|
+
}
|
|
2485
|
+
),
|
|
2486
|
+
/* @__PURE__ */ f(We, { type: "submit", disabled: x, success: b, fail: w, busy: k, children: [
|
|
2487
|
+
(i !== "plain" || !n) && e(`button.${i}`),
|
|
2488
|
+
" ",
|
|
2489
|
+
t
|
|
2490
|
+
] }),
|
|
2491
|
+
(r == null ? void 0 : r.save_card) && /* @__PURE__ */ f(
|
|
2492
|
+
"p",
|
|
2493
|
+
{
|
|
2494
|
+
class: "flex items-center justify-center gap-2 text-xs text-primary-400",
|
|
2495
|
+
role: "complementary",
|
|
2496
|
+
"aria-label": e("form.save_card_notice"),
|
|
2497
|
+
children: [
|
|
2498
|
+
/* @__PURE__ */ f(
|
|
2499
|
+
"svg",
|
|
2500
|
+
{
|
|
2501
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2502
|
+
viewBox: "0 0 20 20",
|
|
2503
|
+
class: "h-4 w-4 shrink-0",
|
|
2504
|
+
fill: "currentColor",
|
|
2505
|
+
children: /* @__PURE__ */ f(
|
|
2506
|
+
"path",
|
|
2507
|
+
{
|
|
2508
|
+
"fill-rule": "evenodd",
|
|
2509
|
+
d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z",
|
|
2510
|
+
"clip-rule": "evenodd"
|
|
2511
|
+
}
|
|
2512
|
+
)
|
|
2513
|
+
}
|
|
2514
|
+
),
|
|
2515
|
+
e("form.save_card_notice")
|
|
2516
|
+
]
|
|
2517
|
+
}
|
|
2518
|
+
)
|
|
2519
|
+
] });
|
|
2520
|
+
};
|
|
2521
|
+
var et = function(e, t) {
|
|
2522
|
+
return et = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(n, r) {
|
|
2523
|
+
n.__proto__ = r;
|
|
2524
|
+
} || function(n, r) {
|
|
2525
|
+
for (var o in r) Object.prototype.hasOwnProperty.call(r, o) && (n[o] = r[o]);
|
|
2526
|
+
}, et(e, t);
|
|
2527
|
+
};
|
|
2528
|
+
function Or(e, t) {
|
|
2529
|
+
if (typeof t != "function" && t !== null)
|
|
2530
|
+
throw new TypeError("Class extends value " + String(t) + " is not a constructor or null");
|
|
2531
|
+
et(e, t);
|
|
2532
|
+
function n() {
|
|
2533
|
+
this.constructor = e;
|
|
2534
|
+
}
|
|
2535
|
+
e.prototype = t === null ? Object.create(t) : (n.prototype = t.prototype, new n());
|
|
2536
|
+
}
|
|
2537
|
+
var W = function() {
|
|
2538
|
+
return W = Object.assign || function(t) {
|
|
2539
|
+
for (var n, r = 1, o = arguments.length; r < o; r++) {
|
|
2540
|
+
n = arguments[r];
|
|
2541
|
+
for (var a in n) Object.prototype.hasOwnProperty.call(n, a) && (t[a] = n[a]);
|
|
2542
|
+
}
|
|
2543
|
+
return t;
|
|
2544
|
+
}, W.apply(this, arguments);
|
|
2545
|
+
};
|
|
2546
|
+
function Le(e, t, n, r) {
|
|
2547
|
+
function o(a) {
|
|
2548
|
+
return a instanceof n ? a : new n(function(i) {
|
|
2549
|
+
i(a);
|
|
2550
|
+
});
|
|
2551
|
+
}
|
|
2552
|
+
return new (n || (n = Promise))(function(a, i) {
|
|
2553
|
+
function s(d) {
|
|
2554
|
+
try {
|
|
2555
|
+
l(r.next(d));
|
|
2556
|
+
} catch (c) {
|
|
2557
|
+
i(c);
|
|
2558
|
+
}
|
|
2559
|
+
}
|
|
2560
|
+
function u(d) {
|
|
2561
|
+
try {
|
|
2562
|
+
l(r.throw(d));
|
|
2563
|
+
} catch (c) {
|
|
2564
|
+
i(c);
|
|
2565
|
+
}
|
|
2566
|
+
}
|
|
2567
|
+
function l(d) {
|
|
2568
|
+
d.done ? a(d.value) : o(d.value).then(s, u);
|
|
2569
|
+
}
|
|
2570
|
+
l((r = r.apply(e, t || [])).next());
|
|
2571
|
+
});
|
|
2572
|
+
}
|
|
2573
|
+
function ye(e, t) {
|
|
2574
|
+
var n = { label: 0, sent: function() {
|
|
2575
|
+
if (a[0] & 1) throw a[1];
|
|
2576
|
+
return a[1];
|
|
2577
|
+
}, trys: [], ops: [] }, r, o, a, i;
|
|
2578
|
+
return i = { next: s(0), throw: s(1), return: s(2) }, typeof Symbol == "function" && (i[Symbol.iterator] = function() {
|
|
2579
|
+
return this;
|
|
2580
|
+
}), i;
|
|
2581
|
+
function s(l) {
|
|
2582
|
+
return function(d) {
|
|
2583
|
+
return u([l, d]);
|
|
2584
|
+
};
|
|
2585
|
+
}
|
|
2586
|
+
function u(l) {
|
|
2587
|
+
if (r) throw new TypeError("Generator is already executing.");
|
|
2588
|
+
for (; i && (i = 0, l[0] && (n = 0)), n; ) try {
|
|
2589
|
+
if (r = 1, o && (a = l[0] & 2 ? o.return : l[0] ? o.throw || ((a = o.return) && a.call(o), 0) : o.next) && !(a = a.call(o, l[1])).done) return a;
|
|
2590
|
+
switch (o = 0, a && (l = [l[0] & 2, a.value]), l[0]) {
|
|
2591
|
+
case 0:
|
|
2592
|
+
case 1:
|
|
2593
|
+
a = l;
|
|
2594
|
+
break;
|
|
2595
|
+
case 4:
|
|
2596
|
+
return n.label++, { value: l[1], done: !1 };
|
|
2597
|
+
case 5:
|
|
2598
|
+
n.label++, o = l[1], l = [0];
|
|
2599
|
+
continue;
|
|
2600
|
+
case 7:
|
|
2601
|
+
l = n.ops.pop(), n.trys.pop();
|
|
2602
|
+
continue;
|
|
2603
|
+
default:
|
|
2604
|
+
if (a = n.trys, !(a = a.length > 0 && a[a.length - 1]) && (l[0] === 6 || l[0] === 2)) {
|
|
2605
|
+
n = 0;
|
|
2606
|
+
continue;
|
|
2607
|
+
}
|
|
2608
|
+
if (l[0] === 3 && (!a || l[1] > a[0] && l[1] < a[3])) {
|
|
2609
|
+
n.label = l[1];
|
|
2610
|
+
break;
|
|
2611
|
+
}
|
|
2612
|
+
if (l[0] === 6 && n.label < a[1]) {
|
|
2613
|
+
n.label = a[1], a = l;
|
|
2614
|
+
break;
|
|
2615
|
+
}
|
|
2616
|
+
if (a && n.label < a[2]) {
|
|
2617
|
+
n.label = a[2], n.ops.push(l);
|
|
2618
|
+
break;
|
|
2619
|
+
}
|
|
2620
|
+
a[2] && n.ops.pop(), n.trys.pop();
|
|
2621
|
+
continue;
|
|
2622
|
+
}
|
|
2623
|
+
l = t.call(e, n);
|
|
2624
|
+
} catch (d) {
|
|
2625
|
+
l = [6, d], o = 0;
|
|
2626
|
+
} finally {
|
|
2627
|
+
r = a = 0;
|
|
2628
|
+
}
|
|
2629
|
+
if (l[0] & 5) throw l[1];
|
|
2630
|
+
return { value: l[0] ? l[1] : void 0, done: !0 };
|
|
2631
|
+
}
|
|
2632
|
+
}
|
|
2633
|
+
function Rr(e) {
|
|
2634
|
+
var t = typeof Symbol == "function" && Symbol.iterator, n = t && e[t], r = 0;
|
|
2635
|
+
if (n) return n.call(e);
|
|
2636
|
+
if (e && typeof e.length == "number") return {
|
|
2637
|
+
next: function() {
|
|
2638
|
+
return e && r >= e.length && (e = void 0), { value: e && e[r++], done: !e };
|
|
2639
|
+
}
|
|
2640
|
+
};
|
|
2641
|
+
throw new TypeError(t ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
2642
|
+
}
|
|
2643
|
+
function Me(e, t) {
|
|
2644
|
+
var n = typeof Symbol == "function" && e[Symbol.iterator];
|
|
2645
|
+
if (!n) return e;
|
|
2646
|
+
var r = n.call(e), o, a = [], i;
|
|
2647
|
+
try {
|
|
2648
|
+
for (; (t === void 0 || t-- > 0) && !(o = r.next()).done; ) a.push(o.value);
|
|
2649
|
+
} catch (s) {
|
|
2650
|
+
i = { error: s };
|
|
2651
|
+
} finally {
|
|
2652
|
+
try {
|
|
2653
|
+
o && !o.done && (n = r.return) && n.call(r);
|
|
2654
|
+
} finally {
|
|
2655
|
+
if (i) throw i.error;
|
|
2656
|
+
}
|
|
2657
|
+
}
|
|
2658
|
+
return a;
|
|
2659
|
+
}
|
|
2660
|
+
function Oe(e, t, n) {
|
|
2661
|
+
if (n || arguments.length === 2) for (var r = 0, o = t.length, a; r < o; r++)
|
|
2662
|
+
(a || !(r in t)) && (a || (a = Array.prototype.slice.call(t, 0, r)), a[r] = t[r]);
|
|
2663
|
+
return e.concat(a || Array.prototype.slice.call(t));
|
|
2664
|
+
}
|
|
2665
|
+
function Lt() {
|
|
2666
|
+
for (var e = [], t = 0; t < arguments.length; t++)
|
|
2667
|
+
e[t] = arguments[t];
|
|
2668
|
+
return e.length === 0 ? function(n) {
|
|
2669
|
+
return n;
|
|
2670
|
+
} : e.length === 1 ? e[0] : e.reduce(function(n, r) {
|
|
2671
|
+
return function() {
|
|
2672
|
+
for (var o = [], a = 0; a < arguments.length; a++)
|
|
2673
|
+
o[a] = arguments[a];
|
|
2674
|
+
return n(r.apply(void 0, Oe([], Me(o), !1)));
|
|
2675
|
+
};
|
|
2676
|
+
});
|
|
2677
|
+
}
|
|
2678
|
+
function Ir(e) {
|
|
2679
|
+
if (e)
|
|
2680
|
+
return Object.keys(e).forEach(function(t) {
|
|
2681
|
+
typeof e[t] == "object" && (e[t] = JSON.stringify(e[t])), e[t] = String(e[t]);
|
|
2682
|
+
}), e;
|
|
2683
|
+
}
|
|
2684
|
+
function Vt(e) {
|
|
2685
|
+
if (e)
|
|
2686
|
+
return Object.keys(e).forEach(function(t) {
|
|
2687
|
+
typeof e[t] == "string" || typeof e[t] == "boolean" || typeof e[t] == "number" || (e[t] = JSON.stringify(e[t]));
|
|
2688
|
+
}), e;
|
|
2689
|
+
}
|
|
2690
|
+
function Nr(e) {
|
|
2691
|
+
return typeof e == "object" && typeof e.message != "undefined";
|
|
2692
|
+
}
|
|
2693
|
+
function Fr(e) {
|
|
2694
|
+
if (typeof e.stacktrace != "undefined" || typeof e["opera#sourceloc"] != "undefined") {
|
|
2695
|
+
var t = e.stacktrace, n = t === void 0 ? "" : t;
|
|
2696
|
+
return n.split(`
|
|
2697
|
+
`).filter(function(a) {
|
|
2698
|
+
return a !== "";
|
|
2699
|
+
});
|
|
2700
|
+
} else if (e.stack) {
|
|
2701
|
+
var r = e.stack, o = r === void 0 ? "" : r;
|
|
2702
|
+
return o.split(`
|
|
2703
|
+
`).filter(function(a) {
|
|
2704
|
+
return a !== "";
|
|
2705
|
+
});
|
|
2706
|
+
} else
|
|
2707
|
+
return ["No stacktrace available"];
|
|
2708
|
+
}
|
|
2709
|
+
function Ur(e) {
|
|
2710
|
+
return Object.keys(e).map(function(t) {
|
|
2711
|
+
return "".concat(encodeURIComponent(t), "=").concat(encodeURIComponent(e[t]));
|
|
2712
|
+
}).join("&");
|
|
2713
|
+
}
|
|
2714
|
+
function hn() {
|
|
2715
|
+
return Object.prototype.toString.call(typeof process != "undefined" ? process : 0) === "[object process]";
|
|
2716
|
+
}
|
|
2717
|
+
function Ce() {
|
|
2718
|
+
return hn() ? global : typeof window != "undefined" ? window : typeof self != "undefined" ? self : {};
|
|
2719
|
+
}
|
|
2720
|
+
var Lr = function() {
|
|
2721
|
+
function e(t) {
|
|
2722
|
+
this._data = t;
|
|
2723
|
+
}
|
|
2724
|
+
return e.prototype.toJSON = function() {
|
|
2725
|
+
return JSON.stringify(this._data);
|
|
2726
|
+
}, e.prototype.serialize = function() {
|
|
2727
|
+
return this._data;
|
|
2728
|
+
}, e;
|
|
2729
|
+
}(), Vr = "1.3.31", tt = function() {
|
|
2730
|
+
function e() {
|
|
2731
|
+
}
|
|
2732
|
+
return e.serialize = function() {
|
|
2733
|
+
return {
|
|
2734
|
+
transport: this.transport(),
|
|
2735
|
+
origin: this.origin()
|
|
2736
|
+
};
|
|
2737
|
+
}, e.origin = function() {
|
|
2738
|
+
var t = Ce();
|
|
2739
|
+
return t.location ? t.location.origin || "".concat(t.location.protocol, "//").concat(t.location.hostname) : "";
|
|
2740
|
+
}, e.transport = function() {
|
|
2741
|
+
var t = Ce();
|
|
2742
|
+
return hn() && typeof jest == "undefined" ? "NodeHTTP" : t.XDomainRequest ? "XDomainRequest" : t.XMLHttpRequest && !t.fetch ? "XMLHttpRequest" : "fetch";
|
|
2743
|
+
}, e.supportsPromises = function() {
|
|
2744
|
+
var t = Ce();
|
|
2745
|
+
return "Promise" in t && "resolve" in t.Promise && "reject" in t.Promise && "all" in t.Promise && "race" in t.Promise && function() {
|
|
2746
|
+
var n;
|
|
2747
|
+
return new t.Promise(function(r) {
|
|
2748
|
+
n = r;
|
|
2749
|
+
}), typeof n == "function";
|
|
2750
|
+
}();
|
|
2751
|
+
}, e;
|
|
2752
|
+
}(), Gr = function() {
|
|
2753
|
+
function e(t) {
|
|
2754
|
+
this.url = t;
|
|
2755
|
+
}
|
|
2756
|
+
return e.prototype.send = function(t) {
|
|
2757
|
+
var n = this;
|
|
2758
|
+
return new Promise(function(r, o) {
|
|
2759
|
+
var a, i = new XDomainRequest(), s = new RegExp("^https?:");
|
|
2760
|
+
i.onload = function() {
|
|
2761
|
+
return r({});
|
|
2762
|
+
}, i.open("POST", n.url.replace(s, (a = window == null ? void 0 : window.location) === null || a === void 0 ? void 0 : a.protocol)), setTimeout(function() {
|
|
2763
|
+
try {
|
|
2764
|
+
i.send(t);
|
|
2765
|
+
} catch (u) {
|
|
2766
|
+
o(u);
|
|
2767
|
+
}
|
|
2768
|
+
}, 0);
|
|
2769
|
+
});
|
|
2770
|
+
}, e;
|
|
2771
|
+
}(), Br = function() {
|
|
2772
|
+
function e(t) {
|
|
2773
|
+
this.url = t;
|
|
2774
|
+
}
|
|
2775
|
+
return e.prototype.send = function(t) {
|
|
2776
|
+
var n = this;
|
|
2777
|
+
return new Promise(function(r, o) {
|
|
2778
|
+
try {
|
|
2779
|
+
var a = new XMLHttpRequest();
|
|
2780
|
+
a.onreadystatechange = function() {
|
|
2781
|
+
a.readyState === XMLHttpRequest.DONE && r({});
|
|
2782
|
+
}, a.open("POST", n.url), a.send(t);
|
|
2783
|
+
} catch (i) {
|
|
2784
|
+
o(i);
|
|
2785
|
+
}
|
|
2786
|
+
});
|
|
2787
|
+
}, e;
|
|
2788
|
+
}(), zr = function() {
|
|
2789
|
+
function e(t, n) {
|
|
2790
|
+
this.url = t;
|
|
2791
|
+
}
|
|
2792
|
+
return e.prototype.send = function(t) {
|
|
2793
|
+
return Le(this, void 0, void 0, function() {
|
|
2794
|
+
var n, r, o;
|
|
2795
|
+
return ye(this, function(a) {
|
|
2796
|
+
switch (a.label) {
|
|
2797
|
+
case 0:
|
|
2798
|
+
return [4, fetch(this.url, {
|
|
2799
|
+
method: "POST",
|
|
2800
|
+
body: t
|
|
2801
|
+
})];
|
|
2802
|
+
case 1:
|
|
2803
|
+
return n = a.sent(), r = n.statusText, o = n.ok, [2, o ? Promise.resolve({}) : Promise.reject({ statusText: r })];
|
|
2804
|
+
}
|
|
2805
|
+
});
|
|
2806
|
+
});
|
|
2807
|
+
}, e;
|
|
2808
|
+
}(), jr = function() {
|
|
2809
|
+
function e(t) {
|
|
2810
|
+
this.url = t, this.https = import("./__vite-browser-external-DYxpcVy9.mjs");
|
|
2811
|
+
}
|
|
2812
|
+
return e.prototype.send = function(t) {
|
|
2813
|
+
var n = this, r = {
|
|
2814
|
+
method: "POST",
|
|
2815
|
+
headers: {
|
|
2816
|
+
"Content-Type": "application/json",
|
|
2817
|
+
"Content-Length": t.length
|
|
2818
|
+
}
|
|
2819
|
+
};
|
|
2820
|
+
return new Promise(function(o, a) {
|
|
2821
|
+
n.https.then(function(i) {
|
|
2822
|
+
var s = i.request(n.url, r, function() {
|
|
2823
|
+
}).on("error", function(u) {
|
|
2824
|
+
return a(u);
|
|
2825
|
+
});
|
|
2826
|
+
s.write(t), s.end(), o({});
|
|
2827
|
+
}).catch(function(i) {
|
|
2828
|
+
console.warn("NodeTransport is being used, but the HTTPS module could not be imported. No data will be sent to AppSignal."), a(i);
|
|
2829
|
+
});
|
|
2830
|
+
});
|
|
2831
|
+
}, e;
|
|
2832
|
+
}(), Hr = function() {
|
|
2833
|
+
function e(t) {
|
|
2834
|
+
this._uri = t.uri || "https://appsignal-endpoint.net/collect", this._apiKey = t.key, this._clientVersion = t.version, this._transport = this._createTransport(this._url());
|
|
2835
|
+
}
|
|
2836
|
+
return e.prototype.push = function(t) {
|
|
2837
|
+
return Le(this, void 0, void 0, function() {
|
|
2838
|
+
return ye(this, function(n) {
|
|
2839
|
+
switch (n.label) {
|
|
2840
|
+
case 0:
|
|
2841
|
+
return [4, this._transport.send(t.toJSON())];
|
|
2842
|
+
case 1:
|
|
2843
|
+
return n.sent(), [2, t];
|
|
2844
|
+
}
|
|
2845
|
+
});
|
|
2846
|
+
});
|
|
2847
|
+
}, e.prototype._createTransport = function(t) {
|
|
2848
|
+
switch (tt.transport()) {
|
|
2849
|
+
case "XDomainRequest":
|
|
2850
|
+
return new Gr(t);
|
|
2851
|
+
case "XMLHttpRequest":
|
|
2852
|
+
return new Br(t);
|
|
2853
|
+
case "NodeHTTP":
|
|
2854
|
+
return new jr(t);
|
|
2855
|
+
default:
|
|
2856
|
+
return new zr(t);
|
|
2857
|
+
}
|
|
2858
|
+
}, e.prototype._url = function() {
|
|
2859
|
+
var t = this._authorization();
|
|
2860
|
+
return "".concat(this._uri, "?").concat(Ur(t));
|
|
2861
|
+
}, e.prototype._authorization = function() {
|
|
2862
|
+
return {
|
|
2863
|
+
api_key: this._apiKey,
|
|
2864
|
+
version: this._clientVersion
|
|
2865
|
+
};
|
|
2866
|
+
}, e;
|
|
2867
|
+
}(), Pe = function(e) {
|
|
2868
|
+
Or(t, e);
|
|
2869
|
+
function t(n) {
|
|
2870
|
+
return e.call(this, W({ timestamp: Math.round((/* @__PURE__ */ new Date()).getTime() / 1e3), namespace: "frontend", error: {
|
|
2871
|
+
name: "NullError",
|
|
2872
|
+
message: "No error has been set",
|
|
2873
|
+
backtrace: []
|
|
2874
|
+
} }, n)) || this;
|
|
2875
|
+
}
|
|
2876
|
+
return t.prototype.setAction = function(n) {
|
|
2877
|
+
return !n || typeof n != "string" ? this : (this._data.action = n, this);
|
|
2878
|
+
}, t.prototype.setNamespace = function(n) {
|
|
2879
|
+
return !n || typeof n != "string" ? this : (this._data.namespace = n, this);
|
|
2880
|
+
}, t.prototype.setError = function(n) {
|
|
2881
|
+
return !n || !Nr(n) ? this : (this._data.error = {
|
|
2882
|
+
name: n.name || "[unknown]",
|
|
2883
|
+
message: n.message,
|
|
2884
|
+
backtrace: Fr(n)
|
|
2885
|
+
}, this);
|
|
2886
|
+
}, t.prototype.setTags = function(n) {
|
|
2887
|
+
return this._data.tags = W(W({}, this._data.tags), Ir(n)), this;
|
|
2888
|
+
}, t.prototype.setParams = function(n) {
|
|
2889
|
+
return this._data.params = W(W({}, this._data.params), n), this;
|
|
2890
|
+
}, t.prototype.setBreadcrumbs = function(n) {
|
|
2891
|
+
return this._data.breadcrumbs = n, this;
|
|
2892
|
+
}, t;
|
|
2893
|
+
}(Lr), Kr = function() {
|
|
2894
|
+
function e(t) {
|
|
2895
|
+
this._data = t || [];
|
|
2896
|
+
}
|
|
2897
|
+
return e.prototype.clear = function() {
|
|
2898
|
+
this._data = [];
|
|
2899
|
+
}, e.prototype.values = function() {
|
|
2900
|
+
return this._data;
|
|
2901
|
+
}, e.prototype.push = function(t) {
|
|
2902
|
+
var n;
|
|
2903
|
+
return Array.isArray(t) ? (n = this._data).push.apply(n, Oe([], Me(t), !1)) : this._data.push(t);
|
|
2904
|
+
}, e.prototype.drain = function() {
|
|
2905
|
+
return ye(this, function(t) {
|
|
2906
|
+
switch (t.label) {
|
|
2907
|
+
case 0:
|
|
2908
|
+
return this._data.length > 0 ? [4, this._data.shift()] : [3, 2];
|
|
2909
|
+
case 1:
|
|
2910
|
+
return t.sent(), [3, 0];
|
|
2911
|
+
case 2:
|
|
2912
|
+
return [2];
|
|
2913
|
+
}
|
|
2914
|
+
});
|
|
2915
|
+
}, e;
|
|
2916
|
+
}(), Zr = function() {
|
|
2917
|
+
function e(t, n, r) {
|
|
2918
|
+
this._retries = 0, this._timerID = 0, this._duration = 0, this._api = n, this._queue = t, this.options = W({ limit: 5, initialDuration: 1e3 }, r), this.reset();
|
|
2919
|
+
}
|
|
2920
|
+
return e.prototype.schedule = function(t) {
|
|
2921
|
+
var n = this;
|
|
2922
|
+
t === void 0 && (t = this._duration);
|
|
2923
|
+
var r = Ce(), o = 1.3, a = function() {
|
|
2924
|
+
return Le(n, void 0, void 0, function() {
|
|
2925
|
+
var i, s, u, l, d, c, _;
|
|
2926
|
+
return ye(this, function(p) {
|
|
2927
|
+
switch (p.label) {
|
|
2928
|
+
case 0:
|
|
2929
|
+
p.trys.push([0, 7, 8, 9]), i = Rr(this._queue.drain()), s = i.next(), p.label = 1;
|
|
2930
|
+
case 1:
|
|
2931
|
+
if (s.done) return [3, 6];
|
|
2932
|
+
if (u = s.value, !u)
|
|
2933
|
+
return [2];
|
|
2934
|
+
p.label = 2;
|
|
2935
|
+
case 2:
|
|
2936
|
+
return p.trys.push([2, 4, , 5]), [4, this._api.push(u)];
|
|
2937
|
+
case 3:
|
|
2938
|
+
return p.sent(), [3, 5];
|
|
2939
|
+
case 4:
|
|
2940
|
+
return p.sent(), l = Math.floor(Math.pow(t, o)), this._retries = this._retries - 1, this._retries === 0 ? this.reset() : (this._queue.push(u), this._timerID = this.schedule(l)), [2];
|
|
2941
|
+
case 5:
|
|
2942
|
+
return s = i.next(), [3, 1];
|
|
2943
|
+
case 6:
|
|
2944
|
+
return [3, 9];
|
|
2945
|
+
case 7:
|
|
2946
|
+
return d = p.sent(), c = { error: d }, [3, 9];
|
|
2947
|
+
case 8:
|
|
2948
|
+
try {
|
|
2949
|
+
s && !s.done && (_ = i.return) && _.call(i);
|
|
2950
|
+
} finally {
|
|
2951
|
+
if (c) throw c.error;
|
|
2952
|
+
}
|
|
2953
|
+
return [7];
|
|
2954
|
+
case 9:
|
|
2955
|
+
return this.reset(), [2];
|
|
2956
|
+
}
|
|
2957
|
+
});
|
|
2958
|
+
});
|
|
2959
|
+
};
|
|
2960
|
+
return r.setTimeout(a, t);
|
|
2961
|
+
}, e.prototype.reset = function() {
|
|
2962
|
+
var t = this.options, n = t.limit, r = t.initialDuration;
|
|
2963
|
+
this._retries = n, this._duration = r;
|
|
2964
|
+
}, e;
|
|
2965
|
+
}(), qr = function() {
|
|
2966
|
+
function e(t) {
|
|
2967
|
+
this.VERSION = Vr, this.ignored = [], this._breadcrumbs = [], this._hooks = {
|
|
2968
|
+
decorators: Array(),
|
|
2969
|
+
overrides: Array()
|
|
2970
|
+
}, this._env = tt.serialize(), this._queue = new Kr([]);
|
|
2971
|
+
var n = t.key, r = n === void 0 ? "" : n, o = t.uri, a = t.revision, i = t.ignoreErrors;
|
|
2972
|
+
a && typeof a != "string" && (t.revision = String(a)), r === "" && console.info("[APPSIGNAL]: Started in development mode."), this._api = new Hr({
|
|
2973
|
+
key: r,
|
|
2974
|
+
uri: o,
|
|
2975
|
+
version: this.VERSION
|
|
2976
|
+
}), i && Array.isArray(i) && (this.ignored = i), this._dispatcher = new Zr(this._queue, this._api), this._options = t;
|
|
2977
|
+
}
|
|
2978
|
+
return e.prototype.send = function(t, n, r) {
|
|
2979
|
+
var o = this;
|
|
2980
|
+
if (!(t instanceof Error) && !(t instanceof Pe) && !(t && t.error instanceof Error)) {
|
|
2981
|
+
console.error("[APPSIGNAL]: Can't send error, given error is not a valid type");
|
|
2982
|
+
return;
|
|
2983
|
+
}
|
|
2984
|
+
var a;
|
|
2985
|
+
if ("error" in t ? a = t.error : a = t, this.ignored.length !== 0) {
|
|
2986
|
+
if (a && "message" in a && this.ignored.some(function(d) {
|
|
2987
|
+
return d.test(a.message);
|
|
2988
|
+
})) {
|
|
2989
|
+
console.warn("[APPSIGNAL]: Ignored an error: ".concat(a.message));
|
|
2990
|
+
return;
|
|
2991
|
+
}
|
|
2992
|
+
if (a instanceof Pe) {
|
|
2993
|
+
var i = a.serialize().error;
|
|
2994
|
+
if (i.message && this.ignored.some(function(d) {
|
|
2995
|
+
return d.test(i.message);
|
|
2996
|
+
})) {
|
|
2997
|
+
console.warn("[APPSIGNAL]: Ignored a span: ".concat(i.message));
|
|
2998
|
+
return;
|
|
2999
|
+
}
|
|
3000
|
+
}
|
|
3001
|
+
}
|
|
3002
|
+
var s = a instanceof Pe ? a : this._createSpanFromError(a);
|
|
3003
|
+
if (this._hooks.decorators.length > 0 && Lt.apply(void 0, Oe([], Me(this._hooks.decorators), !1))(s), n)
|
|
3004
|
+
if (typeof n == "function") {
|
|
3005
|
+
var u = n;
|
|
3006
|
+
u(s);
|
|
3007
|
+
} else {
|
|
3008
|
+
console.warn("[APPSIGNAL]: DEPRECATED: Calling the `send`/`sendError` function with a tags object is deprecated. Use the callback argument instead.");
|
|
3009
|
+
var l = Vt(n) || {};
|
|
3010
|
+
s.setTags(l);
|
|
3011
|
+
}
|
|
3012
|
+
if (r && (console.warn("[APPSIGNAL]: DEPRECATED: Calling the `send`/`sendError` function with a namespace is deprecated. Use the callback argument instead."), s.setNamespace(r)), this._breadcrumbs.length > 0 && s.setBreadcrumbs(this._breadcrumbs), this._hooks.overrides.length > 0 && Lt.apply(void 0, Oe([], Me(this._hooks.overrides), !1))(s), tt.supportsPromises())
|
|
3013
|
+
if (this._breadcrumbs = [], !this._options.key)
|
|
3014
|
+
console.warn("[APPSIGNAL]: Span not sent because we're in development mode:", s);
|
|
3015
|
+
else
|
|
3016
|
+
return this._api.push(s).catch(function() {
|
|
3017
|
+
o._queue.push(s), setTimeout(function() {
|
|
3018
|
+
return o._dispatcher.schedule();
|
|
3019
|
+
}, 0);
|
|
3020
|
+
});
|
|
3021
|
+
else {
|
|
3022
|
+
console.error("[APPSIGNAL]: Error not sent. A Promise polyfill is required.");
|
|
3023
|
+
return;
|
|
3024
|
+
}
|
|
3025
|
+
}, e.prototype.sendError = function(t, n, r) {
|
|
3026
|
+
return this.send(t, n, r);
|
|
3027
|
+
}, e.prototype.use = function(t) {
|
|
3028
|
+
t.call(this);
|
|
3029
|
+
}, e.prototype.createSpan = function(t) {
|
|
3030
|
+
var n = this._options, r = n.revision, o = r === void 0 ? "" : r, a = n.namespace, i = new Pe({
|
|
3031
|
+
environment: this._env,
|
|
3032
|
+
revision: o
|
|
3033
|
+
});
|
|
3034
|
+
return a && i.setNamespace(a), t && typeof t == "function" && t(i), i;
|
|
3035
|
+
}, e.prototype.wrap = function(t, n, r) {
|
|
3036
|
+
return Le(this, void 0, void 0, function() {
|
|
3037
|
+
var o;
|
|
3038
|
+
return ye(this, function(a) {
|
|
3039
|
+
switch (a.label) {
|
|
3040
|
+
case 0:
|
|
3041
|
+
return a.trys.push([0, 2, , 5]), [4, t()];
|
|
3042
|
+
case 1:
|
|
3043
|
+
return [2, a.sent()];
|
|
3044
|
+
case 2:
|
|
3045
|
+
return o = a.sent(), o instanceof Error || o instanceof ErrorEvent ? [4, this.sendError(o, n, r)] : [3, 4];
|
|
3046
|
+
case 3:
|
|
3047
|
+
a.sent(), a.label = 4;
|
|
3048
|
+
case 4:
|
|
3049
|
+
return [2, Promise.reject(o)];
|
|
3050
|
+
case 5:
|
|
3051
|
+
return [2];
|
|
3052
|
+
}
|
|
3053
|
+
});
|
|
3054
|
+
});
|
|
3055
|
+
}, e.prototype.addDecorator = function(t) {
|
|
3056
|
+
this._hooks.decorators.push(t);
|
|
3057
|
+
}, e.prototype.addOverride = function(t) {
|
|
3058
|
+
this._hooks.overrides.push(t);
|
|
3059
|
+
}, e.prototype.demo = function() {
|
|
3060
|
+
var t = this._createSpanFromError(new Error("Hello world! This is an error used for demonstration purposes."));
|
|
3061
|
+
t.setAction("TestAction").setParams({
|
|
3062
|
+
path: "/hello",
|
|
3063
|
+
method: "GET"
|
|
3064
|
+
}).setTags({
|
|
3065
|
+
demo_sample: "true"
|
|
3066
|
+
}), this.send(t);
|
|
3067
|
+
}, e.prototype.addBreadcrumb = function(t) {
|
|
3068
|
+
var n = W(W({ timestamp: Math.round((/* @__PURE__ */ new Date()).getTime() / 1e3) }, t), { metadata: Vt(t.metadata) });
|
|
3069
|
+
if (!n.category) {
|
|
3070
|
+
console.warn("[APPSIGNAL]: Breadcrumb not added. `category` is missing.");
|
|
3071
|
+
return;
|
|
3072
|
+
}
|
|
3073
|
+
if (!n.action) {
|
|
3074
|
+
console.warn("[APPSIGNAL]: Breadcrumb not added. `action` is missing.");
|
|
3075
|
+
return;
|
|
3076
|
+
}
|
|
3077
|
+
this._breadcrumbs.length === 20 && this._breadcrumbs.pop(), this._breadcrumbs.unshift(n);
|
|
3078
|
+
}, e.prototype._createSpanFromError = function(t) {
|
|
3079
|
+
var n = this.createSpan();
|
|
3080
|
+
return n.setError(t), n;
|
|
3081
|
+
}, e;
|
|
3082
|
+
}();
|
|
3083
|
+
const Yr = new qr({
|
|
3084
|
+
key: "e4ff3075-0d9e-48cf-a8af-b0443befbbec",
|
|
3085
|
+
revision: Jt
|
|
3086
|
+
});
|
|
3087
|
+
var Jr = /* @__PURE__ */ function() {
|
|
3088
|
+
var e = function(t, n) {
|
|
3089
|
+
return e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(r, o) {
|
|
3090
|
+
r.__proto__ = o;
|
|
3091
|
+
} || function(r, o) {
|
|
3092
|
+
for (var a in o) Object.prototype.hasOwnProperty.call(o, a) && (r[a] = o[a]);
|
|
3093
|
+
}, e(t, n);
|
|
3094
|
+
};
|
|
3095
|
+
return function(t, n) {
|
|
3096
|
+
if (typeof n != "function" && n !== null)
|
|
3097
|
+
throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");
|
|
3098
|
+
e(t, n);
|
|
3099
|
+
function r() {
|
|
3100
|
+
this.constructor = t;
|
|
3101
|
+
}
|
|
3102
|
+
t.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype, new r());
|
|
3103
|
+
};
|
|
3104
|
+
}(), nt = function() {
|
|
3105
|
+
return nt = Object.assign || function(e) {
|
|
3106
|
+
for (var t, n = 1, r = arguments.length; n < r; n++) {
|
|
3107
|
+
t = arguments[n];
|
|
3108
|
+
for (var o in t) Object.prototype.hasOwnProperty.call(t, o) && (e[o] = t[o]);
|
|
3109
|
+
}
|
|
3110
|
+
return e;
|
|
3111
|
+
}, nt.apply(this, arguments);
|
|
3112
|
+
}, Wr = function(e) {
|
|
3113
|
+
Jr(t, e);
|
|
3114
|
+
function t() {
|
|
3115
|
+
var n = e !== null && e.apply(this, arguments) || this;
|
|
3116
|
+
return n.state = { error: void 0 }, n;
|
|
3117
|
+
}
|
|
3118
|
+
return t.prototype.componentDidCatch = function(n, r) {
|
|
3119
|
+
var o = this.props, a = o.instance, i = o.action, s = o.tags, u = n.name, l = n.message, d = n.stack, c = a.createSpan();
|
|
3120
|
+
c.setError({
|
|
3121
|
+
name: u,
|
|
3122
|
+
message: l,
|
|
3123
|
+
stack: d
|
|
3124
|
+
}).setTags(nt({ framework: "Preact" }, s)), i && i !== "" && c.setAction(i), a.send(c), this.setState({ error: n });
|
|
3125
|
+
}, t.prototype.render = function() {
|
|
3126
|
+
return this.state.error ? this.props.fallback ? this.props.fallback(this.state.error) : null : this.props.children;
|
|
3127
|
+
}, t.defaultProps = {
|
|
3128
|
+
action: ""
|
|
3129
|
+
}, t;
|
|
3130
|
+
}(X);
|
|
3131
|
+
const Xr = () => /* @__PURE__ */ f("div", { class: "mx-auto w-fit rounded-lg border-red-800 bg-red-500/20 p-4 font-mono text-sm leading-6", children: /* @__PURE__ */ f("h2", { class: "mb-4 text-center text-xl font-medium", children: "Something went wrong" }) });
|
|
3132
|
+
function Qr({ config: e }) {
|
|
3133
|
+
const { amount: t, currency: n, language: r, translations: o, publishable_api_key: a } = e, i = document.documentElement.dir === "rtl" || r === "ar", s = Ut[n] || Ut.default, u = s === 0 ? t : parseFloat((t / pt(10, s)).toFixed(s)), l = new Intl.NumberFormat("en", {
|
|
3134
|
+
style: "currency",
|
|
3135
|
+
currency: n,
|
|
3136
|
+
currencyDisplay: "symbol",
|
|
3137
|
+
minimumFractionDigits: s
|
|
3138
|
+
}).format(u), [d, c] = I(O(S({
|
|
3139
|
+
version: Jt,
|
|
3140
|
+
base_url: "https://apimig.moyasar.com"
|
|
3141
|
+
}, e), {
|
|
3142
|
+
translations: Rn(o),
|
|
3143
|
+
formattedAmount: l,
|
|
3144
|
+
decimalAmount: u.toFixed(s).toString(),
|
|
3145
|
+
isProcessing: !1,
|
|
3146
|
+
isRtl: i,
|
|
3147
|
+
showForm: !1,
|
|
3148
|
+
isTestMode: (a == null ? void 0 : a.startsWith("pk_test")) || location.protocol === "http:"
|
|
3149
|
+
}));
|
|
3150
|
+
return H(() => {
|
|
3151
|
+
var _, p;
|
|
3152
|
+
if (!window.SamsungPay && e.samsung_pay) {
|
|
3153
|
+
const y = document.createElement("script");
|
|
3154
|
+
y.src = "https://img.mpay.samsung.com/gsmpi/sdk/samsungpay_web_sdk.js", document.body.append(y);
|
|
3155
|
+
}
|
|
3156
|
+
if (!((p = (_ = window.google) == null ? void 0 : _.payments) != null && p.api) && e.google_pay) {
|
|
3157
|
+
const y = document.createElement("script");
|
|
3158
|
+
y.src = "https://pay.google.com/gp/p/js/pay.js", document.body.append(y);
|
|
3159
|
+
}
|
|
3160
|
+
}, []), /* @__PURE__ */ f(
|
|
3161
|
+
z.Provider,
|
|
3162
|
+
{
|
|
3163
|
+
value: O(S({}, d), {
|
|
3164
|
+
setFormSettings: c
|
|
3165
|
+
}),
|
|
3166
|
+
children: /* @__PURE__ */ f(
|
|
3167
|
+
Wr,
|
|
3168
|
+
{
|
|
3169
|
+
instance: Yr,
|
|
3170
|
+
tags: { tag: "moyasar-payment-form" },
|
|
3171
|
+
fallback: () => /* @__PURE__ */ f(Xr, {}),
|
|
3172
|
+
children: /* @__PURE__ */ f(
|
|
3173
|
+
"div",
|
|
3174
|
+
{
|
|
3175
|
+
class: oe([
|
|
3176
|
+
"box-border flex w-full min-w-60 flex-col gap-4 text-base leading-4 text-black/90",
|
|
3177
|
+
e.fixed_width && "md:mx-auto md:max-w-80"
|
|
3178
|
+
]),
|
|
3179
|
+
dir: r === "ar" ? "rtl" : "ltr",
|
|
3180
|
+
children: [
|
|
3181
|
+
/* @__PURE__ */ f(sn, {}),
|
|
3182
|
+
/* @__PURE__ */ f(hr, {}),
|
|
3183
|
+
e.methods.includes("creditcard") && /* @__PURE__ */ f(Mr, {}),
|
|
3184
|
+
/* @__PURE__ */ f(Tn, {})
|
|
3185
|
+
]
|
|
3186
|
+
}
|
|
3187
|
+
)
|
|
3188
|
+
}
|
|
3189
|
+
)
|
|
3190
|
+
}
|
|
3191
|
+
);
|
|
3192
|
+
}
|
|
3193
|
+
const $r = (e) => {
|
|
3194
|
+
function t(n) {
|
|
3195
|
+
if (typeof n != "function") return !1;
|
|
3196
|
+
const r = (n == null ? void 0 : n.constructor.prototype.constructor.name) === "AsyncFunction", o = n.toString().startsWith("async");
|
|
3197
|
+
return r || o;
|
|
3198
|
+
}
|
|
3199
|
+
return e.on_initiating && !t(e.on_initiating) && P(
|
|
3200
|
+
"On initiating must be a promise based callback, check documentation for implementation details"
|
|
3201
|
+
), e.on_completed && !t(e.on_completed) && P(
|
|
3202
|
+
"On completed must be a promise based callback, check documentation for implementation details"
|
|
3203
|
+
), e.on_failure && !t(e.on_failure) && P(
|
|
3204
|
+
"On failure must be a promise based callback, check documentation for implementation details"
|
|
3205
|
+
), e.on_redirect && !t(e.on_redirect) && P(
|
|
3206
|
+
"On redirect must be a promise based callback, check documentation for implementation details"
|
|
3207
|
+
), !0;
|
|
3208
|
+
}, eo = (e) => {
|
|
3209
|
+
var t, n;
|
|
3210
|
+
return e.payment_button_type && typeof e.payment_button_type != "string" && ie("Payment button type"), e.payment_button_type && !_r.includes(e.payment_button_type) && P("Unsupported button type, check documentation for list of supported types"), e.language && typeof e.language != "string" && ie("Language"), e.translations && typeof e.translations != "object" && ie("Translations"), e.metadata && typeof e.metadata != "object" && P("Metadata must be and object"), e.metadata && Object.entries(e.metadata).length > 50 && P("Only 50 Key/Value pairs are allowed in metadata"), e.invoice_id && typeof e.invoice_id != "string" && P("Invoice ID must be a string"), e.invoice_id && (/^[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12}$/.test(
|
|
3211
|
+
(t = e.invoice_id) != null ? t : ""
|
|
3212
|
+
) || P("Invalid invoice ID format")), e.statement_descriptor && typeof e.statement_descriptor != "string" && P("Statement descriptor must be a string"), e.statement_descriptor && (/^[\w\s\d\-~]{1,64}$/.test((n = e.statement_descriptor) != null ? n : "") || P(
|
|
3213
|
+
'Invalid format for the statement descriptor [length between 1 and 64 characters, allowed alphanumeric characters, white-spaces, "/", "-" and "~" symbols] '
|
|
3214
|
+
)), e.fixed_width && typeof e.fixed_width != "boolean" && P("Fixed width expects boolean value"), !0;
|
|
3215
|
+
}, ze = (e, t) => e.every((n) => t.includes(n)), to = (e) => {
|
|
3216
|
+
var t, n, r, o, a, i, s, u, l, d, c, _;
|
|
3217
|
+
if (e.methods && !Array.isArray(e.methods) && P("Methods must be an array"), e.methods.includes("creditcard") && ((t = e.credit_card) != null && t.manual && typeof e.credit_card.manual != "boolean" && P("Credit Card manual option must be a boolean"), (n = e.credit_card) != null && n.save_card && typeof e.credit_card.save_card != "boolean" && P("Credit Card save card option must be a boolean")), e.methods.includes("applepay") && (e.apple_pay || G("Apple Pay configuration"), e.apple_pay)) {
|
|
3218
|
+
const p = e.apple_pay.country || ((r = e.payment_options) == null ? void 0 : r.country), y = e.apple_pay.label || ((o = e.payment_options) == null ? void 0 : o.label);
|
|
3219
|
+
p || G("Apple Pay country or Payment Options country"), (p == null ? void 0 : p.trim().length) !== 2 && P("Country must be two-letter ISO 3166 country code"), y || G("Apple Pay label or Payment Options label"), (y == null ? void 0 : y.trim().length) === 0 && P("Apple Pay label or Payment Options label can't be empty"), e.apple_pay.validate_merchant_url && !_n(e.apple_pay.validate_merchant_url) && ie("Apple Pay Validate Merchant URL"), (a = e.apple_pay) != null && a.merchant_capabilities && (ze(e.apple_pay.merchant_capabilities, $e) || P(`Apple Pay merchant capabilities supports only ${$e.join(", ")}`)), (i = e.apple_pay) != null && i.supported_countries && !Array.isArray(e.apple_pay.supported_countries) && P("Apple Pay Supported Countries must be an array of country codes");
|
|
3220
|
+
}
|
|
3221
|
+
if (e.samsung_pay) {
|
|
3222
|
+
const p = e.samsung_pay.country || ((s = e.payment_options) == null ? void 0 : s.country), y = e.samsung_pay.label || ((u = e.payment_options) == null ? void 0 : u.label), g = e.samsung_pay.order_number, m = e.publishable_api_key.startsWith("pk_test") || location.protocol === "http:";
|
|
3223
|
+
!window.SamsungPay && m && console.warn(
|
|
3224
|
+
"To speed up loading of Samsung Pay button you can include the Samsung Pay Web SDK JavaScript file in your website front-end directly. If there will be no Samsung Pay available on form initialization it will be loaded automatically"
|
|
3225
|
+
), e.samsung_pay.service_id || G("Samsung Pay service_id"), e.samsung_pay.service_id.trim().length === 0 && P("Samsung Pay service_id can't be empty"), g || G("Samsung Pay order_number or Payment Options order_number"), (g == null ? void 0 : g.trim().length) === 0 && P("Order number can't be empty"), p || G("Samsung Pay country or Payment Options country"), (p == null ? void 0 : p.trim().length) !== 2 && P("Country must be two-letter ISO 3166 country code"), y || G("Samsung Pay label or Payment Options label"), (y == null ? void 0 : y.trim().length) === 0 && P("Samsung Pay label or Payment Options label can't be empty");
|
|
3226
|
+
}
|
|
3227
|
+
if (e.google_pay) {
|
|
3228
|
+
const p = e.google_pay.country || ((l = e.payment_options) == null ? void 0 : l.country), y = e.google_pay.label || ((d = e.payment_options) == null ? void 0 : d.label), g = e.publishable_api_key.startsWith("pk_test") || location.protocol === "http:", m = e.google_pay.environment;
|
|
3229
|
+
!((_ = (c = window.google) == null ? void 0 : c.payments) != null && _.api) && g && console.warn(
|
|
3230
|
+
"To speed up loading of Google Pay button you can include the Google Pay Web SDK JavaScript file in your website front-end directly. If there will be no Google Pay available on form initialization it will be loaded automatically"
|
|
3231
|
+
), e.google_pay.merchant_id || G("Google Pay service_id"), e.google_pay.merchant_id.trim().length === 0 && P("Google Pay service_id can't be empty"), p || G("Google Pay country or Payment Options country"), (p == null ? void 0 : p.trim().length) !== 2 && P("Country must be two-letter ISO 3166 country code"), y || G("Google Pay label or Payment Options label"), (y == null ? void 0 : y.trim().length) === 0 && P("Google Pay label or Payment Options label can't be empty"), m && !["PRODUCTION", "TEST"].includes(m) && P("Google Pay environment can be set to `TEST` or `PRODUCTION`");
|
|
3232
|
+
const { auth_methods: h } = e.google_pay;
|
|
3233
|
+
h && !Array.isArray(h) && P("Google Pay auth_methods must be an array"), h && !h.every((v) => v === "PAN_ONLY" || v === "CRYPTOGRAM_3DS") && P("Google Pay auth_methods must contain 'CRYPTOGRAM_3DS' and/or 'PAN_ONLY'");
|
|
3234
|
+
}
|
|
3235
|
+
return e.methods && (ze(e.methods, Qe) || P(`Moyasar form supports only ${Qe.join(", ")} methods`)), e.supported_networks && (ze(e.supported_networks, Xe) || P(`Moyasar form supports only ${Xe.join(", ")} networks`)), !0;
|
|
3236
|
+
}, no = (e) => (e.element || G("element"), typeof e.element != "string" && !(e.element instanceof Element) && ie("Element"), typeof e.element == "string" && !document.querySelector(e.element) && P(`Selector ${e.element} does't exist id DOM`), e.publishable_api_key.trim() || G("publishable_api_key"), e.publishable_api_key && (/^pk_(test|live)_.{40}$/.test(e.publishable_api_key) || ie("Publishable API Key"), location.protocol.toLowerCase() === "http:" && e.publishable_api_key.startsWith("pk_live") && P(
|
|
3237
|
+
"Production key (pk_live) require secure connection, for development use key starting with pk_test"
|
|
3238
|
+
)), e.amount || G("amount"), e.amount && ((typeof e.amount != "number" || e.amount < 100) && P("Amount must be a non-negative integer. Minimal supported value is 100."), Number.isInteger(e.amount) || P(
|
|
3239
|
+
"Amount must be in minor unit of selected currency, e.g. for $19.99 set amount to 1999."
|
|
3240
|
+
)), e.currency || G("currency"), e.currency && e.currency.trim().length !== 3 && P("Currency must be in ISO 3166-1 alpha-3 country code format"), e.description || G("description"), e.description && e.description.trim().length === 0 && P("Description can't be empty"), e.callback_url || G("callback_url"), _n(e.callback_url) || ie("Callback URL"), !0), P = (e) => {
|
|
3241
|
+
throw window.silentError && console.error(e), new Error(e);
|
|
3242
|
+
}, G = (e) => P(`Missing entry: ${e} is required`), ie = (e) => P(`${e} is invalid`), _n = (e) => typeof e == "string" && /^https?:\/\/.+/.test(e), ro = (e, t = !1) => (t && (window.silentError = t), no(e), to(e), eo(e), $r(e), !0), oo = (e) => {
|
|
3243
|
+
const t = e.publishable_api_key.startsWith("pk_test") || location.protocol === "http:";
|
|
3244
|
+
try {
|
|
3245
|
+
ro(e, t);
|
|
3246
|
+
} catch (o) {
|
|
3247
|
+
const a = document.createElement("div"), i = "moyasarFallbackRoot";
|
|
3248
|
+
a.id = i, document.body.appendChild(a), _t(/* @__PURE__ */ f(() => /* @__PURE__ */ f("div", { class: "mx-auto w-fit rounded-lg border-red-800 bg-red-500/20 p-4 font-mono text-sm leading-6", children: [
|
|
3249
|
+
/* @__PURE__ */ f("h2", { class: "mb-4 text-center text-xl font-medium", children: "Form configuration issue!" }),
|
|
3250
|
+
/* @__PURE__ */ f("p", { children: "Please check configuration for missing properties or incorrect values." }),
|
|
3251
|
+
/* @__PURE__ */ f("p", { children: "Check browser console for more information" })
|
|
3252
|
+
] }), {}), document.getElementById(i));
|
|
3253
|
+
return;
|
|
3254
|
+
}
|
|
3255
|
+
const n = e.element;
|
|
3256
|
+
let r;
|
|
3257
|
+
typeof n == "string" && (r = document.querySelector(n)), n instanceof Element && (r = n), r && (r.setAttribute("moyasar-payment-form-root", ""), r.setAttribute("lang", e.language), _t(/* @__PURE__ */ f(Qr, { config: e }), r));
|
|
3258
|
+
}, ao = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
3259
|
+
let io = (e = 21) => {
|
|
3260
|
+
let t = "", n = crypto.getRandomValues(new Uint8Array(e));
|
|
3261
|
+
for (; e--; )
|
|
3262
|
+
t += ao[n[e] & 63];
|
|
3263
|
+
return t;
|
|
3264
|
+
};
|
|
3265
|
+
const so = (e) => {
|
|
3266
|
+
const t = S({}, e);
|
|
3267
|
+
return e.payment_button_type || (t.payment_button_type = "pay"), e.language || (t.language = document.documentElement.lang || "en"), e.methods || (t.methods = Qe), e.supported_networks && (t.supported_networks = e.supported_networks.map(
|
|
3268
|
+
(n) => n === "mastercard" ? "masterCard" : n
|
|
3269
|
+
)), e.supported_networks || (t.supported_networks = Xe.filter((n) => n !== "amex")), !e.fixed_width && e.fixed_width !== !1 && (t.fixed_width = !0), e.apple_pay && (e.apple_pay.version || (t.apple_pay.version = 6), e.apple_pay.merchant_capabilities || (t.apple_pay.merchant_capabilities = $e.filter(
|
|
3270
|
+
(n) => n !== "supportsEMV"
|
|
3271
|
+
)), e.apple_pay.supported_countries || (t.apple_pay.supported_countries = ["SA"])), e.samsung_pay && (e.samsung_pay.version || (t.samsung_pay.version = 2), e.samsung_pay.environment || (t.samsung_pay.environment = "PRODUCTION")), e.google_pay && (e.google_pay.environment || (t.google_pay.environment = "PRODUCTION"), e.google_pay.auth_methods || (t.google_pay.auth_methods = ["PAN_ONLY", "CRYPTOGRAM_3DS"]), e.google_pay.gateway_merchant_id || (t.google_pay.gateway_merchant_id = io(36))), t;
|
|
3272
|
+
};
|
|
3273
|
+
class co {
|
|
3274
|
+
static init(t) {
|
|
3275
|
+
const n = so(t);
|
|
3276
|
+
oo(n);
|
|
3277
|
+
}
|
|
3278
|
+
}
|
|
3279
|
+
export {
|
|
3280
|
+
co as default
|
|
3281
|
+
};
|