moyasar-payment-form 2.2.14 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/moyasar.mjs CHANGED
@@ -1,22 +1,22 @@
1
1
  /**
2
2
  * name: moyasar-payment-form
3
- * version: v2.2.14
3
+ * version: v2.3.0
4
4
  * description: Moyasar payment form utilities
5
5
  * author: Jan Jagieła - Railwaymen Team
6
6
  * homepage: https://docs.moyasar.com
7
7
  */
8
- var Ne = Object.defineProperty, _e = Object.defineProperties;
8
+ var _e = Object.defineProperty, Ne = Object.defineProperties;
9
9
  var Ie = Object.getOwnPropertyDescriptors;
10
10
  var MA = Object.getOwnPropertySymbols;
11
11
  var gt = Object.prototype.hasOwnProperty, ht = Object.prototype.propertyIsEnumerable;
12
- var yt = Math.pow, vt = (A, t, e) => t in A ? Ne(A, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : A[t] = e, k = (A, t) => {
12
+ var yt = Math.pow, vt = (A, t, e) => t in A ? _e(A, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : A[t] = e, B = (A, t) => {
13
13
  for (var e in t || (t = {}))
14
14
  gt.call(t, e) && vt(A, e, t[e]);
15
15
  if (MA)
16
16
  for (var e of MA(t))
17
17
  ht.call(t, e) && vt(A, e, t[e]);
18
18
  return A;
19
- }, L = (A, t) => _e(A, Ie(t));
19
+ }, N = (A, t) => Ne(A, Ie(t));
20
20
  var gA = (A, t) => {
21
21
  var e = {};
22
22
  for (var n in A)
@@ -26,24 +26,24 @@ var gA = (A, t) => {
26
26
  t.indexOf(n) < 0 && ht.call(A, n) && (e[n] = A[n]);
27
27
  return e;
28
28
  };
29
- var H = (A, t, e) => new Promise((n, r) => {
30
- var a = (c) => {
29
+ var R = (A, t, e) => new Promise((n, r) => {
30
+ var a = (i) => {
31
31
  try {
32
- l(e.next(c));
32
+ l(e.next(i));
33
33
  } catch (s) {
34
34
  r(s);
35
35
  }
36
- }, o = (c) => {
36
+ }, o = (i) => {
37
37
  try {
38
- l(e.throw(c));
38
+ l(e.throw(i));
39
39
  } catch (s) {
40
40
  r(s);
41
41
  }
42
- }, l = (c) => c.done ? n(c.value) : Promise.resolve(c.value).then(a, o);
42
+ }, l = (i) => i.done ? n(i.value) : Promise.resolve(i.value).then(a, o);
43
43
  l((e = e.apply(A, t)).next());
44
44
  });
45
- var zA, S, Ae, rA, wt, te, ee, ne, at, YA, ZA, re, yA = {}, ae = [], Oe = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, bA = Array.isArray;
46
- function eA(A, t) {
45
+ var zA, S, Ae, sA, wt, te, ee, ne, at, YA, ZA, re, yA = {}, ae = [], Oe = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, bA = Array.isArray;
46
+ function aA(A, t) {
47
47
  for (var e in t) A[e] = t[e];
48
48
  return A;
49
49
  }
@@ -60,16 +60,16 @@ function XA(A, t, e, n, r) {
60
60
  var a = { type: A, props: t, key: e, ref: n, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: r == null ? ++Ae : r, __i: -1, __u: 0 };
61
61
  return r == null && S.vnode != null && S.vnode(a), a;
62
62
  }
63
- function j(A) {
63
+ function F(A) {
64
64
  return A.children;
65
65
  }
66
- function AA(A, t) {
66
+ function nA(A, t) {
67
67
  this.props = A, this.context = t;
68
68
  }
69
- function cA(A, t) {
70
- if (t == null) return A.__ ? cA(A.__, A.__i + 1) : null;
69
+ function uA(A, t) {
70
+ if (t == null) return A.__ ? uA(A.__, A.__i + 1) : null;
71
71
  for (var e; t < A.__k.length; t++) if ((e = A.__k[t]) != null && e.__e != null) return e.__e;
72
- return typeof A.type == "function" ? cA(A) : null;
72
+ return typeof A.type == "function" ? uA(A) : null;
73
73
  }
74
74
  function oe(A) {
75
75
  var t, e;
@@ -82,21 +82,21 @@ function oe(A) {
82
82
  }
83
83
  }
84
84
  function HA(A) {
85
- (!A.__d && (A.__d = !0) && rA.push(A) && !LA.__r++ || wt != S.debounceRendering) && ((wt = S.debounceRendering) || te)(LA);
85
+ (!A.__d && (A.__d = !0) && sA.push(A) && !LA.__r++ || wt != S.debounceRendering) && ((wt = S.debounceRendering) || te)(LA);
86
86
  }
87
87
  function LA() {
88
- for (var A, t, e, n, r, a, o, l = 1; rA.length; ) rA.length > l && rA.sort(ee), A = rA.shift(), l = rA.length, A.__d && (e = void 0, r = (n = (t = A).__v).__e, a = [], o = [], t.__P && ((e = eA({}, n)).__v = n.__v + 1, S.vnode && S.vnode(e), lt(t.__P, e, n, t.__n, t.__P.namespaceURI, 32 & n.__u ? [r] : null, a, r == null ? cA(n) : r, !!(32 & n.__u), o), e.__v = n.__v, e.__.__k[e.__i] = e, ce(a, e, o), e.__e != r && oe(e)));
88
+ for (var A, t, e, n, r, a, o, l = 1; sA.length; ) sA.length > l && sA.sort(ee), A = sA.shift(), l = sA.length, A.__d && (e = void 0, r = (n = (t = A).__v).__e, a = [], o = [], t.__P && ((e = aA({}, n)).__v = n.__v + 1, S.vnode && S.vnode(e), lt(t.__P, e, n, t.__n, t.__P.namespaceURI, 32 & n.__u ? [r] : null, a, r == null ? uA(n) : r, !!(32 & n.__u), o), e.__v = n.__v, e.__.__k[e.__i] = e, ie(a, e, o), e.__e != r && oe(e)));
89
89
  LA.__r = 0;
90
90
  }
91
- function le(A, t, e, n, r, a, o, l, c, s, p) {
92
- var i, f, d, y, h, v, m = n && n.__k || ae, g = t.length;
93
- for (c = ze(e, t, m, c, g), i = 0; i < g; i++) (d = e.__k[i]) != null && (f = d.__i == -1 ? yA : m[d.__i] || yA, d.__i = i, v = lt(A, d, f, r, a, o, l, c, s, p), y = d.__e, d.ref && f.ref != d.ref && (f.ref && st(f.ref, null, d), p.push(d.ref, d.__c || y, d)), h == null && y != null && (h = y), 4 & d.__u || f.__k === d.__k ? c = se(d, c, A) : typeof d.type == "function" && v !== void 0 ? c = v : y && (c = y.nextSibling), d.__u &= -7);
94
- return e.__e = h, c;
91
+ function le(A, t, e, n, r, a, o, l, i, s, p) {
92
+ var c, f, d, y, b, v, m = n && n.__k || ae, g = t.length;
93
+ for (i = ze(e, t, m, i, g), c = 0; c < g; c++) (d = e.__k[c]) != null && (f = d.__i == -1 ? yA : m[d.__i] || yA, d.__i = c, v = lt(A, d, f, r, a, o, l, i, s, p), y = d.__e, d.ref && f.ref != d.ref && (f.ref && st(f.ref, null, d), p.push(d.ref, d.__c || y, d)), b == null && y != null && (b = y), 4 & d.__u || f.__k === d.__k ? i = se(d, i, A) : typeof d.type == "function" && v !== void 0 ? i = v : y && (i = y.nextSibling), d.__u &= -7);
94
+ return e.__e = b, i;
95
95
  }
96
96
  function ze(A, t, e, n, r) {
97
- var a, o, l, c, s, p = e.length, i = p, f = 0;
98
- for (A.__k = new Array(r), a = 0; a < r; a++) (o = t[a]) != null && typeof o != "boolean" && typeof o != "function" ? (c = a + f, (o = A.__k[a] = typeof o == "string" || typeof o == "number" || typeof o == "bigint" || o.constructor == String ? XA(null, o, null, null, null) : bA(o) ? XA(j, { children: o }, null, null, null) : o.constructor == null && o.__b > 0 ? XA(o.type, o.props, o.key, o.ref ? o.ref : null, o.__v) : o).__ = A, o.__b = A.__b + 1, l = null, (s = o.__i = Ue(o, e, c, i)) != -1 && (i--, (l = e[s]) && (l.__u |= 2)), l == null || l.__v == null ? (s == -1 && (r > p ? f-- : r < p && f++), typeof o.type != "function" && (o.__u |= 4)) : s != c && (s == c - 1 ? f-- : s == c + 1 ? f++ : (s > c ? f-- : f++, o.__u |= 4))) : A.__k[a] = null;
99
- if (i) for (a = 0; a < p; a++) (l = e[a]) != null && !(2 & l.__u) && (l.__e == n && (n = cA(l)), ue(l, l));
97
+ var a, o, l, i, s, p = e.length, c = p, f = 0;
98
+ for (A.__k = new Array(r), a = 0; a < r; a++) (o = t[a]) != null && typeof o != "boolean" && typeof o != "function" ? (i = a + f, (o = A.__k[a] = typeof o == "string" || typeof o == "number" || typeof o == "bigint" || o.constructor == String ? XA(null, o, null, null, null) : bA(o) ? XA(F, { children: o }, null, null, null) : o.constructor == null && o.__b > 0 ? XA(o.type, o.props, o.key, o.ref ? o.ref : null, o.__v) : o).__ = A, o.__b = A.__b + 1, l = null, (s = o.__i = Ue(o, e, i, c)) != -1 && (c--, (l = e[s]) && (l.__u |= 2)), l == null || l.__v == null ? (s == -1 && (r > p ? f-- : r < p && f++), typeof o.type != "function" && (o.__u |= 4)) : s != i && (s == i - 1 ? f-- : s == i + 1 ? f++ : (s > i ? f-- : f++, o.__u |= 4))) : A.__k[a] = null;
99
+ if (c) for (a = 0; a < p; a++) (l = e[a]) != null && !(2 & l.__u) && (l.__e == n && (n = uA(l)), ue(l, l));
100
100
  return n;
101
101
  }
102
102
  function se(A, t, e) {
@@ -105,27 +105,27 @@ function se(A, t, e) {
105
105
  for (n = A.__k, r = 0; n && r < n.length; r++) n[r] && (n[r].__ = A, t = se(n[r], t, e));
106
106
  return t;
107
107
  }
108
- A.__e != t && (t && A.type && !e.contains(t) && (t = cA(A)), e.insertBefore(A.__e, t || null), t = A.__e);
108
+ A.__e != t && (t && A.type && !e.contains(t) && (t = uA(A)), e.insertBefore(A.__e, t || null), t = A.__e);
109
109
  do
110
110
  t = t && t.nextSibling;
111
111
  while (t != null && t.nodeType == 8);
112
112
  return t;
113
113
  }
114
- function NA(A, t) {
114
+ function _A(A, t) {
115
115
  return t = t || [], A == null || typeof A == "boolean" || (bA(A) ? A.some(function(e) {
116
- NA(e, t);
116
+ _A(e, t);
117
117
  }) : t.push(A)), t;
118
118
  }
119
119
  function Ue(A, t, e, n) {
120
- var r, a, o = A.key, l = A.type, c = t[e];
121
- if (c === null && A.key == null || c && o == c.key && l == c.type && !(2 & c.__u)) return e;
122
- if (n > (c != null && !(2 & c.__u) ? 1 : 0)) for (r = e - 1, a = e + 1; r >= 0 || a < t.length; ) {
120
+ var r, a, o = A.key, l = A.type, i = t[e];
121
+ if (i === null && A.key == null || i && o == i.key && l == i.type && !(2 & i.__u)) return e;
122
+ if (n > (i != null && !(2 & i.__u) ? 1 : 0)) for (r = e - 1, a = e + 1; r >= 0 || a < t.length; ) {
123
123
  if (r >= 0) {
124
- if ((c = t[r]) && !(2 & c.__u) && o == c.key && l == c.type) return r;
124
+ if ((i = t[r]) && !(2 & i.__u) && o == i.key && l == i.type) return r;
125
125
  r--;
126
126
  }
127
127
  if (a < t.length) {
128
- if ((c = t[a]) && !(2 & c.__u) && o == c.key && l == c.type) return a;
128
+ if ((i = t[a]) && !(2 & i.__u) && o == i.key && l == i.type) return a;
129
129
  a++;
130
130
  }
131
131
  }
@@ -162,43 +162,43 @@ function Ct(A) {
162
162
  }
163
163
  };
164
164
  }
165
- function lt(A, t, e, n, r, a, o, l, c, s) {
166
- var p, i, f, d, y, h, v, m, g, M, C, w, D, B, I, X, T, P = t.type;
165
+ function lt(A, t, e, n, r, a, o, l, i, s) {
166
+ var p, c, f, d, y, b, v, m, g, D, w, C, M, k, Q, P, O, L = t.type;
167
167
  if (t.constructor != null) return null;
168
- 128 & e.__u && (c = !!(32 & e.__u), a = [l = t.__e = e.__e]), (p = S.__b) && p(t);
169
- A: if (typeof P == "function") try {
170
- if (m = t.props, g = "prototype" in P && P.prototype.render, M = (p = P.contextType) && n[p.__c], C = p ? M ? M.props.value : p.__ : n, e.__c ? v = (i = t.__c = e.__c).__ = i.__E : (g ? t.__c = i = new P(m, C) : (t.__c = i = new AA(m, C), i.constructor = P, i.render = Ge), M && M.sub(i), i.props = m, i.state || (i.state = {}), i.context = C, i.__n = n, f = i.__d = !0, i.__h = [], i._sb = []), g && i.__s == null && (i.__s = i.state), g && P.getDerivedStateFromProps != null && (i.__s == i.state && (i.__s = eA({}, i.__s)), eA(i.__s, P.getDerivedStateFromProps(m, i.__s))), d = i.props, y = i.state, i.__v = t, f) g && P.getDerivedStateFromProps == null && i.componentWillMount != null && i.componentWillMount(), g && i.componentDidMount != null && i.__h.push(i.componentDidMount);
168
+ 128 & e.__u && (i = !!(32 & e.__u), a = [l = t.__e = e.__e]), (p = S.__b) && p(t);
169
+ A: if (typeof L == "function") try {
170
+ if (m = t.props, g = "prototype" in L && L.prototype.render, D = (p = L.contextType) && n[p.__c], w = p ? D ? D.props.value : p.__ : n, e.__c ? v = (c = t.__c = e.__c).__ = c.__E : (g ? t.__c = c = new L(m, w) : (t.__c = c = new nA(m, w), c.constructor = L, c.render = Ge), D && D.sub(c), c.props = m, c.state || (c.state = {}), c.context = w, c.__n = n, f = c.__d = !0, c.__h = [], c._sb = []), g && c.__s == null && (c.__s = c.state), g && L.getDerivedStateFromProps != null && (c.__s == c.state && (c.__s = aA({}, c.__s)), aA(c.__s, L.getDerivedStateFromProps(m, c.__s))), d = c.props, y = c.state, c.__v = t, f) g && L.getDerivedStateFromProps == null && c.componentWillMount != null && c.componentWillMount(), g && c.componentDidMount != null && c.__h.push(c.componentDidMount);
171
171
  else {
172
- if (g && P.getDerivedStateFromProps == null && m !== d && i.componentWillReceiveProps != null && i.componentWillReceiveProps(m, C), !i.__e && i.shouldComponentUpdate != null && i.shouldComponentUpdate(m, i.__s, C) === !1 || t.__v == e.__v) {
173
- for (t.__v != e.__v && (i.props = m, i.state = i.__s, i.__d = !1), t.__e = e.__e, t.__k = e.__k, t.__k.some(function(Q) {
174
- Q && (Q.__ = t);
175
- }), w = 0; w < i._sb.length; w++) i.__h.push(i._sb[w]);
176
- i._sb = [], i.__h.length && o.push(i);
172
+ if (g && L.getDerivedStateFromProps == null && m !== d && c.componentWillReceiveProps != null && c.componentWillReceiveProps(m, w), !c.__e && c.shouldComponentUpdate != null && c.shouldComponentUpdate(m, c.__s, w) === !1 || t.__v == e.__v) {
173
+ for (t.__v != e.__v && (c.props = m, c.state = c.__s, c.__d = !1), t.__e = e.__e, t.__k = e.__k, t.__k.some(function(X) {
174
+ X && (X.__ = t);
175
+ }), C = 0; C < c._sb.length; C++) c.__h.push(c._sb[C]);
176
+ c._sb = [], c.__h.length && o.push(c);
177
177
  break A;
178
178
  }
179
- i.componentWillUpdate != null && i.componentWillUpdate(m, i.__s, C), g && i.componentDidUpdate != null && i.__h.push(function() {
180
- i.componentDidUpdate(d, y, h);
179
+ c.componentWillUpdate != null && c.componentWillUpdate(m, c.__s, w), g && c.componentDidUpdate != null && c.__h.push(function() {
180
+ c.componentDidUpdate(d, y, b);
181
181
  });
182
182
  }
183
- if (i.context = C, i.props = m, i.__P = A, i.__e = !1, D = S.__r, B = 0, g) {
184
- for (i.state = i.__s, i.__d = !1, D && D(t), p = i.render(i.props, i.state, i.context), I = 0; I < i._sb.length; I++) i.__h.push(i._sb[I]);
185
- i._sb = [];
183
+ if (c.context = w, c.props = m, c.__P = A, c.__e = !1, M = S.__r, k = 0, g) {
184
+ for (c.state = c.__s, c.__d = !1, M && M(t), p = c.render(c.props, c.state, c.context), Q = 0; Q < c._sb.length; Q++) c.__h.push(c._sb[Q]);
185
+ c._sb = [];
186
186
  } else do
187
- i.__d = !1, D && D(t), p = i.render(i.props, i.state, i.context), i.state = i.__s;
188
- while (i.__d && ++B < 25);
189
- i.state = i.__s, i.getChildContext != null && (n = eA(eA({}, n), i.getChildContext())), g && !f && i.getSnapshotBeforeUpdate != null && (h = i.getSnapshotBeforeUpdate(d, y)), X = p, p != null && p.type === j && p.key == null && (X = ie(p.props.children)), l = le(A, bA(X) ? X : [X], t, e, n, r, a, o, l, c, s), i.base = t.__e, t.__u &= -161, i.__h.length && o.push(i), v && (i.__E = i.__ = null);
190
- } catch (Q) {
191
- if (t.__v = null, c || a != null) if (Q.then) {
192
- for (t.__u |= c ? 160 : 128; l && l.nodeType == 8 && l.nextSibling; ) l = l.nextSibling;
187
+ c.__d = !1, M && M(t), p = c.render(c.props, c.state, c.context), c.state = c.__s;
188
+ while (c.__d && ++k < 25);
189
+ c.state = c.__s, c.getChildContext != null && (n = aA(aA({}, n), c.getChildContext())), g && !f && c.getSnapshotBeforeUpdate != null && (b = c.getSnapshotBeforeUpdate(d, y)), P = p, p != null && p.type === F && p.key == null && (P = ce(p.props.children)), l = le(A, bA(P) ? P : [P], t, e, n, r, a, o, l, i, s), c.base = t.__e, t.__u &= -161, c.__h.length && o.push(c), v && (c.__E = c.__ = null);
190
+ } catch (X) {
191
+ if (t.__v = null, i || a != null) if (X.then) {
192
+ for (t.__u |= i ? 160 : 128; l && l.nodeType == 8 && l.nextSibling; ) l = l.nextSibling;
193
193
  a[a.indexOf(l)] = null, t.__e = l;
194
- } else for (T = a.length; T--; ) ot(a[T]);
194
+ } else for (O = a.length; O--; ) ot(a[O]);
195
195
  else t.__e = e.__e, t.__k = e.__k;
196
- S.__e(Q, t, e);
196
+ S.__e(X, t, e);
197
197
  }
198
- else a == null && t.__v == e.__v ? (t.__k = e.__k, t.__e = e.__e) : l = t.__e = Ee(e.__e, t, e, n, r, a, o, c, s);
198
+ else a == null && t.__v == e.__v ? (t.__k = e.__k, t.__e = e.__e) : l = t.__e = Ee(e.__e, t, e, n, r, a, o, i, s);
199
199
  return (p = S.diffed) && p(t), 128 & t.__u ? void 0 : l;
200
200
  }
201
- function ce(A, t, e) {
201
+ function ie(A, t, e) {
202
202
  for (var n = 0; n < e.length; n++) st(e[n], e[++n], e[++n]);
203
203
  S.__c && S.__c(t, A), A.some(function(r) {
204
204
  try {
@@ -210,11 +210,11 @@ function ce(A, t, e) {
210
210
  }
211
211
  });
212
212
  }
213
- function ie(A) {
214
- return typeof A != "object" || A == null || A.__b && A.__b > 0 ? A : bA(A) ? A.map(ie) : eA({}, A);
213
+ function ce(A) {
214
+ return typeof A != "object" || A == null || A.__b && A.__b > 0 ? A : bA(A) ? A.map(ce) : aA({}, A);
215
215
  }
216
- function Ee(A, t, e, n, r, a, o, l, c) {
217
- var s, p, i, f, d, y, h, v = e.props, m = t.props, g = t.type;
216
+ function Ee(A, t, e, n, r, a, o, l, i) {
217
+ var s, p, c, f, d, y, b, v = e.props, m = t.props, g = t.type;
218
218
  if (g == "svg" ? r = "http://www.w3.org/2000/svg" : g == "math" ? r = "http://www.w3.org/1998/Math/MathML" : r || (r = "http://www.w3.org/1999/xhtml"), a != null) {
219
219
  for (s = 0; s < a.length; s++) if ((d = a[s]) && "setAttribute" in d == !!g && (g ? d.localName == g : d.nodeType == 3)) {
220
220
  A = d, a[s] = null;
@@ -229,16 +229,16 @@ function Ee(A, t, e, n, r, a, o, l, c) {
229
229
  else {
230
230
  if (a = a && zA.call(A.childNodes), v = e.props || yA, !l && a != null) for (v = {}, s = 0; s < A.attributes.length; s++) v[(d = A.attributes[s]).name] = d.value;
231
231
  for (s in v) if (d = v[s], s != "children") {
232
- if (s == "dangerouslySetInnerHTML") i = d;
232
+ if (s == "dangerouslySetInnerHTML") c = d;
233
233
  else if (!(s in m)) {
234
234
  if (s == "value" && "defaultValue" in m || s == "checked" && "defaultChecked" in m) continue;
235
235
  kA(A, s, null, d, r);
236
236
  }
237
237
  }
238
- for (s in m) d = m[s], s == "children" ? f = d : s == "dangerouslySetInnerHTML" ? p = d : s == "value" ? y = d : s == "checked" ? h = d : l && typeof d != "function" || v[s] === d || kA(A, s, d, v[s], r);
239
- if (p) l || i && (p.__html == i.__html || p.__html == A.innerHTML) || (A.innerHTML = p.__html), t.__k = [];
240
- else if (i && (A.innerHTML = ""), le(t.type == "template" ? A.content : A, bA(f) ? f : [f], t, e, n, g == "foreignObject" ? "http://www.w3.org/1999/xhtml" : r, a, o, a ? a[0] : e.__k && cA(e, 0), l, c), a != null) for (s = a.length; s--; ) ot(a[s]);
241
- l || (s = "value", g == "progress" && y == null ? A.removeAttribute("value") : y != null && (y !== A[s] || g == "progress" && !y || g == "option" && y != v[s]) && kA(A, s, y, v[s], r), s = "checked", h != null && h != A[s] && kA(A, s, h, v[s], r));
238
+ for (s in m) d = m[s], s == "children" ? f = d : s == "dangerouslySetInnerHTML" ? p = d : s == "value" ? y = d : s == "checked" ? b = d : l && typeof d != "function" || v[s] === d || kA(A, s, d, v[s], r);
239
+ if (p) l || c && (p.__html == c.__html || p.__html == A.innerHTML) || (A.innerHTML = p.__html), t.__k = [];
240
+ else if (c && (A.innerHTML = ""), le(t.type == "template" ? A.content : A, bA(f) ? f : [f], t, e, n, g == "foreignObject" ? "http://www.w3.org/1999/xhtml" : r, a, o, a ? a[0] : e.__k && uA(e, 0), l, i), a != null) for (s = a.length; s--; ) ot(a[s]);
241
+ l || (s = "value", g == "progress" && y == null ? A.removeAttribute("value") : y != null && (y !== A[s] || g == "progress" && !y || g == "option" && y != v[s]) && kA(A, s, y, v[s], r), s = "checked", b != null && b != A[s] && kA(A, s, b, v[s], r));
242
242
  }
243
243
  return A;
244
244
  }
@@ -270,9 +270,9 @@ function Ge(A, t, e) {
270
270
  }
271
271
  function Dt(A, t, e) {
272
272
  var n, r, a, o;
273
- t == document && (t = document.documentElement), S.__ && S.__(A, t), r = (n = !1) ? null : t.__k, a = [], o = [], lt(t, A = t.__k = KA(j, null, [A]), r || yA, yA, t.namespaceURI, r ? null : t.firstChild ? zA.call(t.childNodes) : null, a, r ? r.__e : t.firstChild, n, o), ce(a, A, o);
273
+ t == document && (t = document.documentElement), S.__ && S.__(A, t), r = (n = !1) ? null : t.__k, a = [], o = [], lt(t, A = t.__k = KA(F, null, [A]), r || yA, yA, t.namespaceURI, r ? null : t.firstChild ? zA.call(t.childNodes) : null, a, r ? r.__e : t.firstChild, n, o), ie(a, A, o);
274
274
  }
275
- function ct(A) {
275
+ function it(A) {
276
276
  function t(e) {
277
277
  var n, r;
278
278
  return this.getChildContext || (n = /* @__PURE__ */ new Set(), (r = {})[t.__c] = this, this.getChildContext = function() {
@@ -302,87 +302,87 @@ zA = ae.slice, S = { __e: function(A, t, e, n) {
302
302
  A = l;
303
303
  }
304
304
  throw A;
305
- } }, Ae = 0, AA.prototype.setState = function(A, t) {
305
+ } }, Ae = 0, nA.prototype.setState = function(A, t) {
306
306
  var e;
307
- e = this.__s != null && this.__s != this.state ? this.__s : this.__s = eA({}, this.state), typeof A == "function" && (A = A(eA({}, e), this.props)), A && eA(e, A), A != null && this.__v && (t && this._sb.push(t), HA(this));
308
- }, AA.prototype.forceUpdate = function(A) {
307
+ e = this.__s != null && this.__s != this.state ? this.__s : this.__s = aA({}, this.state), typeof A == "function" && (A = A(aA({}, e), this.props)), A && aA(e, A), A != null && this.__v && (t && this._sb.push(t), HA(this));
308
+ }, nA.prototype.forceUpdate = function(A) {
309
309
  this.__v && (this.__e = !0, A && this.__h.push(A), HA(this));
310
- }, AA.prototype.render = j, rA = [], te = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, ee = function(A, t) {
310
+ }, nA.prototype.render = F, sA = [], te = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, ee = function(A, t) {
311
311
  return A.__v.__b - t.__v.__b;
312
312
  }, LA.__r = 0, ne = /(PointerCapture)$|Capture$/i, at = 0, YA = Ct(!1), ZA = Ct(!0), re = 0;
313
313
  var Je = 0;
314
314
  function u(A, t, e, n, r, a) {
315
315
  t || (t = {});
316
- var o, l, c = t;
317
- if ("ref" in c) for (l in c = {}, t) l == "ref" ? o = t[l] : c[l] = t[l];
318
- var s = { type: A, props: c, key: e, ref: o, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: --Je, __i: -1, __u: 0, __source: r, __self: a };
319
- if (typeof A == "function" && (o = A.defaultProps)) for (l in o) c[l] === void 0 && (c[l] = o[l]);
316
+ var o, l, i = t;
317
+ if ("ref" in i) for (l in i = {}, t) l == "ref" ? o = t[l] : i[l] = t[l];
318
+ var s = { type: A, props: i, key: e, ref: o, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: --Je, __i: -1, __u: 0, __source: r, __self: a };
319
+ if (typeof A == "function" && (o = A.defaultProps)) for (l in o) i[l] === void 0 && (i[l] = o[l]);
320
320
  return S.vnode && S.vnode(s), s;
321
321
  }
322
- const it = "2.2.14", q = ct({});
323
- var iA, U, qA, Mt, wA = 0, pe = [], G = S, kt = G.__b, Bt = G.__r, St = G.diffed, Pt = G.__c, Xt = G.unmount, Tt = G.__;
322
+ const ct = "2.3.0", q = it({});
323
+ var pA, U, qA, Mt, wA = 0, pe = [], G = S, kt = G.__b, Bt = G.__r, St = G.diffed, Pt = G.__c, Xt = G.unmount, Tt = G.__;
324
324
  function UA(A, t) {
325
325
  G.__h && G.__h(U, A, wA || t), wA = 0;
326
326
  var e = U.__H || (U.__H = { __: [], __h: [] });
327
327
  return A >= e.__.length && e.__.push({}), e.__[A];
328
328
  }
329
- function O(A) {
329
+ function z(A) {
330
330
  return wA = 1, xe(me, A);
331
331
  }
332
332
  function xe(A, t, e) {
333
- var n = UA(iA++, 2);
333
+ var n = UA(pA++, 2);
334
334
  if (n.t = A, !n.__c && (n.__ = [e ? e(t) : me(void 0, t), function(l) {
335
- var c = n.__N ? n.__N[0] : n.__[0], s = n.t(c, l);
336
- c !== s && (n.__N = [s, n.__[1]], n.__c.setState({}));
335
+ var i = n.__N ? n.__N[0] : n.__[0], s = n.t(i, l);
336
+ i !== s && (n.__N = [s, n.__[1]], n.__c.setState({}));
337
337
  }], n.__c = U, !U.__f)) {
338
- var r = function(l, c, s) {
338
+ var r = function(l, i, s) {
339
339
  if (!n.__c.__H) return !0;
340
340
  var p = n.__c.__H.__.filter(function(f) {
341
341
  return !!f.__c;
342
342
  });
343
343
  if (p.every(function(f) {
344
344
  return !f.__N;
345
- })) return !a || a.call(this, l, c, s);
346
- var i = n.__c.props !== l;
345
+ })) return !a || a.call(this, l, i, s);
346
+ var c = n.__c.props !== l;
347
347
  return p.forEach(function(f) {
348
348
  if (f.__N) {
349
349
  var d = f.__[0];
350
- f.__ = f.__N, f.__N = void 0, d !== f.__[0] && (i = !0);
350
+ f.__ = f.__N, f.__N = void 0, d !== f.__[0] && (c = !0);
351
351
  }
352
- }), a && a.call(this, l, c, s) || i;
352
+ }), a && a.call(this, l, i, s) || c;
353
353
  };
354
354
  U.__f = !0;
355
355
  var a = U.shouldComponentUpdate, o = U.componentWillUpdate;
356
- U.componentWillUpdate = function(l, c, s) {
356
+ U.componentWillUpdate = function(l, i, s) {
357
357
  if (this.__e) {
358
358
  var p = a;
359
- a = void 0, r(l, c, s), a = p;
359
+ a = void 0, r(l, i, s), a = p;
360
360
  }
361
- o && o.call(this, l, c, s);
361
+ o && o.call(this, l, i, s);
362
362
  }, U.shouldComponentUpdate = r;
363
363
  }
364
364
  return n.__N || n.__;
365
365
  }
366
366
  function V(A, t) {
367
- var e = UA(iA++, 3);
367
+ var e = UA(pA++, 3);
368
368
  !G.__s && fe(e.__H, t) && (e.__ = A, e.u = t, U.__H.__h.push(e));
369
369
  }
370
- function $(A) {
371
- return wA = 5, oA(function() {
370
+ function tA(A) {
371
+ return wA = 5, cA(function() {
372
372
  return { current: A };
373
373
  }, []);
374
374
  }
375
- function oA(A, t) {
376
- var e = UA(iA++, 7);
375
+ function cA(A, t) {
376
+ var e = UA(pA++, 7);
377
377
  return fe(e.__H, t) && (e.__ = A(), e.__H = t, e.__h = A), e.__;
378
378
  }
379
379
  function de(A, t) {
380
- return wA = 8, oA(function() {
380
+ return wA = 8, cA(function() {
381
381
  return A;
382
382
  }, t);
383
383
  }
384
384
  function E(A) {
385
- var t = U.context[A.__c], e = UA(iA++, 9);
385
+ var t = U.context[A.__c], e = UA(pA++, 9);
386
386
  return e.c = A, t ? (e.__ == null && (e.__ = !0, t.sub(U)), t.props.value) : A.__;
387
387
  }
388
388
  function qe() {
@@ -397,11 +397,11 @@ G.__b = function(A) {
397
397
  }, G.__ = function(A, t) {
398
398
  A && t.__k && t.__k.__m && (A.__m = t.__k.__m), Tt && Tt(A, t);
399
399
  }, G.__r = function(A) {
400
- Bt && Bt(A), iA = 0;
400
+ Bt && Bt(A), pA = 0;
401
401
  var t = (U = A.__c).__H;
402
402
  t && (qA === U ? (t.__h = [], U.__h = [], t.__.forEach(function(e) {
403
403
  e.__N && (e.__ = e.__N), e.u = e.__N = void 0;
404
- })) : (t.__h.forEach(TA), t.__h.forEach(RA), t.__h = [], iA = 0)), qA = U;
404
+ })) : (t.__h.forEach(TA), t.__h.forEach(RA), t.__h = [], pA = 0)), qA = U;
405
405
  }, G.diffed = function(A) {
406
406
  St && St(A);
407
407
  var t = A.__c;
@@ -454,7 +454,7 @@ function fe(A, t) {
454
454
  function me(A, t) {
455
455
  return typeof t == "function" ? t(A) : t;
456
456
  }
457
- function Y() {
457
+ function Z() {
458
458
  const { language: A, translations: t } = E(q);
459
459
  function e(n) {
460
460
  if (!t)
@@ -558,9 +558,9 @@ function Ve() {
558
558
  );
559
559
  }
560
560
  const Ye = () => {
561
- const { t: A } = Y(), { isTestMode: t, show_footer: e } = E(q);
561
+ const { t: A } = Z(), { isTestMode: t, show_footer: e } = E(q);
562
562
  return /* @__PURE__ */ u("div", { className: "mt-2 flex w-full flex-col items-center justify-center gap-5 text-xs", children: [
563
- /* @__PURE__ */ u("a", { href: `https://moyasar.com/?ref=payment-form-v${it}`, children: e && /* @__PURE__ */ u(Ve, {}) }),
563
+ /* @__PURE__ */ u("a", { href: `https://moyasar.com/?ref=payment-form-v${ct}`, children: e && /* @__PURE__ */ u(Ve, {}) }),
564
564
  t && /* @__PURE__ */ u("span", { class: "text-red-600", children: A("common.test_mode_disclaimer") })
565
565
  ] });
566
566
  }, Ze = {
@@ -571,6 +571,8 @@ const Ye = () => {
571
571
  "error.invalid_mobile": "رقم الجوال غير صحيح",
572
572
  "error.invalid_otp": "رمز التحقق غير صحيح",
573
573
  "error.invalid_request_error": "طلب دفع غير صحيح",
574
+ "error.invalid_client_secret": "تعذّر التحقق من جلسة الدفع. يرجى تحديث الصفحة والمحاولة مرة أخرى",
575
+ "error.intent_not_fulfillable": "لا يمكن إتمام هذه العملية، يرجى إعادة بدء عملية الدفع",
574
576
  "error.mobile_not_registered": "رقم الجوال غير مسجل",
575
577
  "error.account_inactive_error": "حساب التاجر غير نشط",
576
578
  "error.invalid_name": "يجب إدخال الاسم الأول والأخير",
@@ -639,6 +641,8 @@ const Ye = () => {
639
641
  "error.invalid_mobile": "Invalid mobile number",
640
642
  "error.invalid_otp": "Invalid verification code",
641
643
  "error.invalid_request_error": "Invalid payment request",
644
+ "error.invalid_client_secret": " We couldn't verify this payment session. Please refresh the page and try again.",
645
+ "error.intent_not_fulfillable": "This payment can no longer be completed, please restart the checkout",
642
646
  "error.mobile_not_registered": "Mobile number is not registered",
643
647
  "error.account_inactive_error": "Merchant account is not active",
644
648
  "error.invalid_name": "First and last names are required",
@@ -723,7 +727,7 @@ function je() {
723
727
  for (var A, t, e = 0, n = "", r = arguments.length; e < r; e++) (A = arguments[e]) && (t = ve(A)) && (n && (n += " "), n += t);
724
728
  return n;
725
729
  }
726
- const tA = (...A) => je(A), _A = (A) => {
730
+ const rA = (...A) => je(A), NA = (A) => {
727
731
  const d = A, {
728
732
  children: t,
729
733
  type: e = "button",
@@ -732,7 +736,7 @@ const tA = (...A) => je(A), _A = (A) => {
732
736
  disabled: a,
733
737
  busy: o,
734
738
  fail: l,
735
- success: c
739
+ success: i
736
740
  } = d, s = gA(d, [
737
741
  "children",
738
742
  "type",
@@ -742,22 +746,22 @@ const tA = (...A) => je(A), _A = (A) => {
742
746
  "busy",
743
747
  "fail",
744
748
  "success"
745
- ]), { isProcessing: p } = E(q), i = {
749
+ ]), { isProcessing: p } = E(q), c = {
746
750
  primary: "bg-primary text-white",
747
751
  stc: "bg-stc text-white",
748
752
  error: "bg-error text-white pointer-events-none",
749
753
  success: "bg-success text-white"
750
754
  };
751
755
  function f() {
752
- return l ? i.error : c ? i.success : i[n];
756
+ return l ? c.error : i ? c.success : c[n];
753
757
  }
754
758
  return /* @__PURE__ */ u(
755
759
  "button",
756
- L(k({}, s), {
760
+ N(B({}, s), {
757
761
  type: e,
758
762
  disabled: p || a,
759
763
  onClick: r,
760
- class: tA([
764
+ class: rA([
761
765
  "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",
762
766
  f(),
763
767
  A.class,
@@ -812,7 +816,7 @@ const tA = (...A) => je(A), _A = (A) => {
812
816
  ]
813
817
  }
814
818
  ),
815
- c && /* @__PURE__ */ u(
819
+ i && /* @__PURE__ */ u(
816
820
  "svg",
817
821
  {
818
822
  xmlns: "http://www.w3.org/2000/svg",
@@ -854,19 +858,19 @@ const tA = (...A) => je(A), _A = (A) => {
854
858
  ) : null, ut = ({
855
859
  currency: A,
856
860
  formattedAmount: t
857
- }) => /* @__PURE__ */ u(j, { children: [
861
+ }) => /* @__PURE__ */ u(F, { children: [
858
862
  /* @__PURE__ */ u(An, { currency: A }),
859
863
  /* @__PURE__ */ u("span", { children: t })
860
- ] }), pA = (A) => {
861
- const c = A, { name: t, placeholder: e, type: n = "text", onBlur: r, disabled: a } = c, o = gA(c, ["name", "placeholder", "type", "onBlur", "disabled"]), { isProcessing: l } = E(q);
864
+ ] }), fA = (A) => {
865
+ const i = A, { name: t, placeholder: e, type: n = "text", onBlur: r, disabled: a } = i, o = gA(i, ["name", "placeholder", "type", "onBlur", "disabled"]), { isProcessing: l } = E(q);
862
866
  return /* @__PURE__ */ u(
863
867
  "input",
864
- L(k({}, o), {
868
+ N(B({}, o), {
865
869
  dir: "ltr",
866
870
  id: t,
867
871
  name: t,
868
872
  disabled: l || a,
869
- class: tA([
873
+ class: rA([
870
874
  "relative block w-full rounded-lg border-0 px-4 py-2 text-sm text-black placeholder-gray-300 shadow-input focus:z-[2] focus:shadow-input-focus focus:outline-none",
871
875
  A.class,
872
876
  l && "pointer-events-none grayscale",
@@ -880,7 +884,7 @@ const tA = (...A) => je(A), _A = (A) => {
880
884
  }
881
885
  })
882
886
  );
883
- }, pt = ct({});
887
+ }, pt = it({});
884
888
  function tn(A, t) {
885
889
  for (var e in t) A[e] = t[e];
886
890
  return A;
@@ -890,15 +894,15 @@ function Lt(A, t) {
890
894
  for (var n in t) if (n !== "__source" && A[n] !== t[n]) return !0;
891
895
  return !1;
892
896
  }
893
- function Nt(A, t) {
897
+ function _t(A, t) {
894
898
  this.props = A, this.context = t;
895
899
  }
896
- (Nt.prototype = new AA()).isPureReactComponent = !0, Nt.prototype.shouldComponentUpdate = function(A, t) {
900
+ (_t.prototype = new nA()).isPureReactComponent = !0, _t.prototype.shouldComponentUpdate = function(A, t) {
897
901
  return Lt(this.props, A) || Lt(this.state, t);
898
902
  };
899
- var _t = S.__b;
903
+ var Nt = S.__b;
900
904
  S.__b = function(A) {
901
- A.type && A.type.__f && A.ref && (A.props.ref = A.ref, A.ref = null), _t && _t(A);
905
+ A.type && A.type.__f && A.ref && (A.props.ref = A.ref, A.ref = null), Nt && Nt(A);
902
906
  };
903
907
  var en = S.__e;
904
908
  S.__e = function(A, t, e, n) {
@@ -933,7 +937,7 @@ function BA() {
933
937
  S.unmount = function(A) {
934
938
  var t = A.__c;
935
939
  t && t.__R && t.__R(), t && 32 & A.__u && (A.type = null), It && It(A);
936
- }, (WA.prototype = new AA()).__c = function(A, t) {
940
+ }, (WA.prototype = new nA()).__c = function(A, t) {
937
941
  var e = t.__c, n = this;
938
942
  n.o == null && (n.o = []), n.o.push(e);
939
943
  var r = ye(n.__v), a = !1, o = function() {
@@ -943,8 +947,8 @@ S.unmount = function(A) {
943
947
  var l = function() {
944
948
  if (!--n.__u) {
945
949
  if (n.state.__a) {
946
- var c = n.state.__a;
947
- n.__v.__k[0] = he(c, c.__c.__P, c.__c.__O);
950
+ var i = n.state.__a;
951
+ n.__v.__k[0] = he(i, i.__c.__P, i.__c.__O);
948
952
  }
949
953
  var s;
950
954
  for (n.setState({ __a: n.__b = null }); s = n.o.pop(); ) s.forceUpdate();
@@ -961,8 +965,8 @@ S.unmount = function(A) {
961
965
  }
962
966
  this.__b = null;
963
967
  }
964
- var r = t.__a && KA(j, null, A.fallback);
965
- return r && (r.__u &= -33), [KA(j, null, t.__a ? null : A.children), r];
968
+ var r = t.__a && KA(F, null, A.fallback);
969
+ return r && (r.__u &= -33), [KA(F, null, t.__a ? null : A.children), r];
966
970
  };
967
971
  var Ot = function(A, t, e) {
968
972
  if (++e[1] === e[0] && A.l.delete(t), A.props.revealOrder && (A.props.revealOrder[0] !== "t" || !A.l.size)) for (e = A.i; e; ) {
@@ -971,7 +975,7 @@ var Ot = function(A, t, e) {
971
975
  A.i = e = e[2];
972
976
  }
973
977
  };
974
- (BA.prototype = new AA()).__a = function(A) {
978
+ (BA.prototype = new nA()).__a = function(A) {
975
979
  var t = this, e = ye(t.__v), n = t.l.get(A);
976
980
  return n[0]++, function(r) {
977
981
  var a = function() {
@@ -981,7 +985,7 @@ var Ot = function(A, t, e) {
981
985
  };
982
986
  }, BA.prototype.render = function(A) {
983
987
  this.i = null, this.l = /* @__PURE__ */ new Map();
984
- var t = NA(A.children);
988
+ var t = _A(A.children);
985
989
  A.revealOrder && A.revealOrder[0] === "b" && t.reverse();
986
990
  for (var e = t.length; e--; ) this.l.set(t[e], this.i = [1, 0, this.i]);
987
991
  return A.children;
@@ -994,8 +998,8 @@ var Ot = function(A, t, e) {
994
998
  var nn = typeof Symbol != "undefined" && Symbol.for && Symbol.for("react.element") || 60103, rn = /^(?: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]/, an = /^on(Ani|Tra|Tou|BeforeInp|Compo)/, on = /[A-Z0-9]/g, ln = typeof document != "undefined", sn = function(A) {
995
999
  return (typeof Symbol != "undefined" && typeof Symbol() == "symbol" ? /fil|che|rad/ : /fil|che|ra/).test(A);
996
1000
  };
997
- AA.prototype.isReactComponent = {}, ["componentWillMount", "componentWillReceiveProps", "componentWillUpdate"].forEach(function(A) {
998
- Object.defineProperty(AA.prototype, A, { configurable: !0, get: function() {
1001
+ nA.prototype.isReactComponent = {}, ["componentWillMount", "componentWillReceiveProps", "componentWillUpdate"].forEach(function(A) {
1002
+ Object.defineProperty(nA.prototype, A, { configurable: !0, get: function() {
999
1003
  return this["UNSAFE_" + A];
1000
1004
  }, set: function(t) {
1001
1005
  Object.defineProperty(this, A, { configurable: !0, writable: !0, value: t });
@@ -1022,13 +1026,13 @@ S.vnode = function(A) {
1022
1026
  for (var o in e) {
1023
1027
  var l = e[o];
1024
1028
  if (!(o === "value" && "defaultValue" in e && l == null || ln && o === "children" && n === "noscript" || o === "class" || o === "className")) {
1025
- var c = o.toLowerCase();
1026
- o === "defaultValue" && "value" in e && e.value == null ? o = "value" : o === "download" && l === !0 ? l = "" : c === "translate" && l === "no" ? l = !1 : c[0] === "o" && c[1] === "n" ? c === "ondoubleclick" ? o = "ondblclick" : c !== "onchange" || n !== "input" && n !== "textarea" || sn(e.type) ? c === "onfocus" ? o = "onfocusin" : c === "onblur" ? o = "onfocusout" : an.test(o) && (o = c) : c = o = "oninput" : a && rn.test(o) ? o = o.replace(on, "-$&").toLowerCase() : l === null && (l = void 0), c === "oninput" && r[o = c] && (o = "oninputCapture"), r[o] = l;
1029
+ var i = o.toLowerCase();
1030
+ o === "defaultValue" && "value" in e && e.value == null ? o = "value" : o === "download" && l === !0 ? l = "" : i === "translate" && l === "no" ? l = !1 : i[0] === "o" && i[1] === "n" ? i === "ondoubleclick" ? o = "ondblclick" : i !== "onchange" || n !== "input" && n !== "textarea" || sn(e.type) ? i === "onfocus" ? o = "onfocusin" : i === "onblur" ? o = "onfocusout" : an.test(o) && (o = i) : i = o = "oninput" : a && rn.test(o) ? o = o.replace(on, "-$&").toLowerCase() : l === null && (l = void 0), i === "oninput" && r[o = i] && (o = "oninputCapture"), r[o] = l;
1027
1031
  }
1028
1032
  }
1029
- n == "select" && r.multiple && Array.isArray(r.value) && (r.value = NA(e.children).forEach(function(s) {
1033
+ n == "select" && r.multiple && Array.isArray(r.value) && (r.value = _A(e.children).forEach(function(s) {
1030
1034
  s.props.selected = r.value.indexOf(s.props.value) != -1;
1031
- })), n == "select" && r.defaultValue != null && (r.value = NA(e.children).forEach(function(s) {
1035
+ })), n == "select" && r.defaultValue != null && (r.value = _A(e.children).forEach(function(s) {
1032
1036
  s.props.selected = r.multiple ? r.defaultValue.indexOf(s.props.value) != -1 : r.defaultValue == s.props.value;
1033
1037
  })), e.class && !e.className ? (r.class = e.class, Object.defineProperty(r, "className", dn)) : (e.className && !e.class || e.class && e.className) && (r.class = r.className = e.className), t.props = r;
1034
1038
  }(A), A.$$typeof = nn, Ut && Ut(A);
@@ -1043,57 +1047,57 @@ S.diffed = function(A) {
1043
1047
  var t = A.props, e = A.__e;
1044
1048
  e != null && A.type === "textarea" && "value" in t && t.value !== e.value && (e.value = t.value == null ? "" : t.value);
1045
1049
  };
1046
- function dA(A, t, e, n) {
1047
- var r = this, a = $(null), o = $(0), l = $(0), c = $(null), s = $([]), p = $(), i = $(), f = $(A), d = $(!0);
1050
+ function mA(A, t, e, n) {
1051
+ var r = this, a = tA(null), o = tA(0), l = tA(0), i = tA(null), s = tA([]), p = tA(), c = tA(), f = tA(A), d = tA(!0);
1048
1052
  f.current = A;
1049
- var y = typeof window != "undefined", h = !t && t !== 0 && y;
1053
+ var y = typeof window != "undefined", b = !t && t !== 0 && y;
1050
1054
  if (typeof A != "function") throw new TypeError("Expected a function");
1051
1055
  t = +t || 0;
1052
- var v = !!(e = e || {}).leading, m = !("trailing" in e) || !!e.trailing, g = "maxWait" in e, M = "debounceOnServer" in e && !!e.debounceOnServer, C = g ? Math.max(+e.maxWait || 0, t) : null;
1056
+ var v = !!(e = e || {}).leading, m = !("trailing" in e) || !!e.trailing, g = "maxWait" in e, D = "debounceOnServer" in e && !!e.debounceOnServer, w = g ? Math.max(+e.maxWait || 0, t) : null;
1053
1057
  V(function() {
1054
1058
  return d.current = !0, function() {
1055
1059
  d.current = !1;
1056
1060
  };
1057
1061
  }, []);
1058
- var w = oA(function() {
1059
- var D = function(N) {
1060
- var z = s.current, Z = p.current;
1061
- return s.current = p.current = null, o.current = N, l.current = l.current || N, i.current = f.current.apply(Z, z);
1062
- }, B = function(N, z) {
1063
- h && cancelAnimationFrame(c.current), c.current = h ? requestAnimationFrame(N) : setTimeout(N, z);
1064
- }, I = function(N) {
1062
+ var C = cA(function() {
1063
+ var M = function(_) {
1064
+ var T = s.current, Y = p.current;
1065
+ return s.current = p.current = null, o.current = _, l.current = l.current || _, c.current = f.current.apply(Y, T);
1066
+ }, k = function(_, T) {
1067
+ b && cancelAnimationFrame(i.current), i.current = b ? requestAnimationFrame(_) : setTimeout(_, T);
1068
+ }, Q = function(_) {
1065
1069
  if (!d.current) return !1;
1066
- var z = N - a.current;
1067
- return !a.current || z >= t || z < 0 || g && N - o.current >= C;
1068
- }, X = function(N) {
1069
- return c.current = null, m && s.current ? D(N) : (s.current = p.current = null, i.current);
1070
- }, T = function N() {
1071
- var z = Date.now();
1072
- if (v && l.current === o.current && P(), I(z)) return X(z);
1070
+ var T = _ - a.current;
1071
+ return !a.current || T >= t || T < 0 || g && _ - o.current >= w;
1072
+ }, P = function(_) {
1073
+ return i.current = null, m && s.current ? M(_) : (s.current = p.current = null, c.current);
1074
+ }, O = function _() {
1075
+ var T = Date.now();
1076
+ if (v && l.current === o.current && L(), Q(T)) return P(T);
1073
1077
  if (d.current) {
1074
- var Z = t - (z - a.current), lA = g ? Math.min(Z, C - (z - o.current)) : Z;
1075
- B(N, lA);
1078
+ var Y = t - (T - a.current), $ = g ? Math.min(Y, w - (T - o.current)) : Y;
1079
+ k(_, $);
1076
1080
  }
1077
- }, P = function() {
1078
- }, Q = function() {
1079
- if (y || M) {
1080
- var N = Date.now(), z = I(N);
1081
- if (s.current = [].slice.call(arguments), p.current = r, a.current = N, z) {
1082
- if (!c.current && d.current) return o.current = a.current, B(T, t), v ? D(a.current) : i.current;
1083
- if (g) return B(T, t), D(a.current);
1081
+ }, L = function() {
1082
+ }, X = function() {
1083
+ if (y || D) {
1084
+ var _ = Date.now(), T = Q(_);
1085
+ if (s.current = [].slice.call(arguments), p.current = r, a.current = _, T) {
1086
+ if (!i.current && d.current) return o.current = a.current, k(O, t), v ? M(a.current) : c.current;
1087
+ if (g) return k(O, t), M(a.current);
1084
1088
  }
1085
- return c.current || B(T, t), i.current;
1089
+ return i.current || k(O, t), c.current;
1086
1090
  }
1087
1091
  };
1088
- return Q.cancel = function() {
1089
- c.current && (h ? cancelAnimationFrame(c.current) : clearTimeout(c.current)), o.current = 0, s.current = a.current = p.current = c.current = null;
1090
- }, Q.isPending = function() {
1091
- return !!c.current;
1092
- }, Q.flush = function() {
1093
- return c.current ? X(Date.now()) : i.current;
1094
- }, Q;
1095
- }, [v, g, t, C, m, h, y, M, n]);
1096
- return w;
1092
+ return X.cancel = function() {
1093
+ i.current && (b ? cancelAnimationFrame(i.current) : clearTimeout(i.current)), o.current = 0, s.current = a.current = p.current = i.current = null;
1094
+ }, X.isPending = function() {
1095
+ return !!i.current;
1096
+ }, X.flush = function() {
1097
+ return i.current ? P(Date.now()) : c.current;
1098
+ }, X;
1099
+ }, [v, g, t, w, m, b, y, D, n]);
1100
+ return C;
1097
1101
  }
1098
1102
  var fn = Object.defineProperty, mn = (A, t, e) => t in A ? fn(A, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : A[t] = e, hA = (A, t, e) => mn(A, typeof t != "symbol" ? t + "" : t, e);
1099
1103
  const Jt = {
@@ -1111,25 +1115,25 @@ const Jt = {
1111
1115
  }, vn = (A, t = !0, e) => {
1112
1116
  var v, m, g;
1113
1117
  var n, r, a, o;
1114
- const l = ((n = e.number) == null ? void 0 : n.unsigned) !== !0 && A.startsWith("-") ? "-" : "", c = (v = (r = e.number) == null ? void 0 : r.fraction) != null ? v : 0;
1115
- let s = qt(0, c, e);
1116
- const p = s.formatToParts(1000.12), i = (m = (a = p.find((M) => M.type === "group")) == null ? void 0 : a.value) != null ? m : " ", f = (g = (o = p.find((M) => M.type === "decimal")) == null ? void 0 : o.value) != null ? g : ".", d = xt(A, i, f);
1118
+ const l = ((n = e.number) == null ? void 0 : n.unsigned) !== !0 && A.startsWith("-") ? "-" : "", i = (v = (r = e.number) == null ? void 0 : r.fraction) != null ? v : 0;
1119
+ let s = qt(0, i, e);
1120
+ const p = s.formatToParts(1000.12), c = (m = (a = p.find((D) => D.type === "group")) == null ? void 0 : a.value) != null ? m : " ", f = (g = (o = p.find((D) => D.type === "decimal")) == null ? void 0 : o.value) != null ? g : ".", d = xt(A, c, f);
1117
1121
  if (Number.isNaN(parseFloat(d))) return l;
1118
1122
  const y = d.split(".");
1119
1123
  if (y[1] != null && y[1].length >= 1) {
1120
- const M = y[1].length <= c ? y[1].length : c;
1121
- s = qt(M, c, e);
1124
+ const D = y[1].length <= i ? y[1].length : i;
1125
+ s = qt(D, i, e);
1122
1126
  }
1123
- let h = s.format(parseFloat(d));
1124
- return t ? c > 0 && d.endsWith(".") && !d.slice(0, -1).includes(".") && (h += f) : h = xt(h, i, f), l + h;
1127
+ let b = s.format(parseFloat(d));
1128
+ return t ? i > 0 && d.endsWith(".") && !d.slice(0, -1).includes(".") && (b += f) : b = xt(b, c, f), l + b;
1125
1129
  };
1126
1130
  class gn {
1127
1131
  constructor(t = {}) {
1128
1132
  var n;
1129
1133
  hA(this, "opts", {}), hA(this, "memo", /* @__PURE__ */ new Map());
1130
- const e = k({}, t);
1134
+ const e = B({}, t);
1131
1135
  if (e.tokens != null) {
1132
- e.tokens = e.tokensReplace ? k({}, e.tokens) : k(k({}, Jt), e.tokens);
1136
+ e.tokens = e.tokensReplace ? B({}, e.tokens) : B(B({}, Jt), e.tokens);
1133
1137
  for (const r of Object.values(e.tokens))
1134
1138
  typeof r.pattern == "string" && (r.pattern = new RegExp(r.pattern));
1135
1139
  } else
@@ -1177,12 +1181,12 @@ class gn {
1177
1181
  if (e == null) return t;
1178
1182
  const r = `v=${t},mr=${e},m=${n ? 1 : 0}`;
1179
1183
  if (this.memo.has(r)) return this.memo.get(r);
1180
- const { mask: a, escaped: o } = this.escapeMask(e), l = [], c = this.opts.tokens != null ? this.opts.tokens : {}, s = this.isReversed() ? -1 : 1, p = this.isReversed() ? "unshift" : "push", i = this.isReversed() ? 0 : a.length - 1, f = this.isReversed() ? () => v > -1 && m > -1 : () => v < a.length && m < t.length, d = (M) => !this.isReversed() && M <= i || this.isReversed() && M >= i;
1181
- let y, h = -1, v = this.isReversed() ? a.length - 1 : 0, m = this.isReversed() ? t.length - 1 : 0, g = !1;
1184
+ const { mask: a, escaped: o } = this.escapeMask(e), l = [], i = this.opts.tokens != null ? this.opts.tokens : {}, s = this.isReversed() ? -1 : 1, p = this.isReversed() ? "unshift" : "push", c = this.isReversed() ? 0 : a.length - 1, f = this.isReversed() ? () => v > -1 && m > -1 : () => v < a.length && m < t.length, d = (D) => !this.isReversed() && D <= c || this.isReversed() && D >= c;
1185
+ let y, b = -1, v = this.isReversed() ? a.length - 1 : 0, m = this.isReversed() ? t.length - 1 : 0, g = !1;
1182
1186
  for (; f(); ) {
1183
- const M = a.charAt(v), C = c[M], w = (C == null ? void 0 : C.transform) != null ? C.transform(t.charAt(m)) : t.charAt(m);
1184
- if (!o.includes(v) && C != null ? (w.match(C.pattern) != null ? (l[p](w), C.repeated ? (h === -1 ? h = v : v === i && v !== h && (v = h - s), i === h && (v -= s)) : C.multiple && (g = !0, v -= s), v += s) : C.multiple ? g && (v += s, m -= s, g = !1) : w === y ? y = void 0 : C.optional && (v += s, m -= s), m += s) : (n && !this.isEager() && l[p](M), w === M && !this.isEager() ? m += s : y = M, this.isEager() || (v += s)), this.isEager())
1185
- for (; d(v) && (c[a.charAt(v)] == null || o.includes(v)); ) {
1187
+ const D = a.charAt(v), w = i[D], C = (w == null ? void 0 : w.transform) != null ? w.transform(t.charAt(m)) : t.charAt(m);
1188
+ if (!o.includes(v) && w != null ? (C.match(w.pattern) != null ? (l[p](C), w.repeated ? (b === -1 ? b = v : v === c && v !== b && (v = b - s), c === b && (v -= s)) : w.multiple && (g = !0, v -= s), v += s) : w.multiple ? g && (v += s, m -= s, g = !1) : C === y ? y = void 0 : w.optional && (v += s, m -= s), m += s) : (n && !this.isEager() && l[p](D), C === D && !this.isEager() ? m += s : y = D, this.isEager() || (v += s)), this.isEager())
1189
+ for (; d(v) && (i[a.charAt(v)] == null || o.includes(v)); ) {
1186
1190
  if (n) {
1187
1191
  if (l[p](a.charAt(v)), t.charAt(m) === a.charAt(v)) {
1188
1192
  v += s, m += s;
@@ -1196,7 +1200,7 @@ class gn {
1196
1200
  }
1197
1201
  }
1198
1202
  const we = (A) => JSON.parse(A.replaceAll("'", '"')), hn = (A, t = {}) => {
1199
- const e = k({}, t);
1203
+ const e = B({}, t);
1200
1204
  A.dataset.maska != null && A.dataset.maska !== "" && (e.mask = yn(A.dataset.maska)), A.dataset.maskaEager != null && (e.eager = SA(A.dataset.maskaEager)), A.dataset.maskaReversed != null && (e.reversed = SA(A.dataset.maskaReversed)), A.dataset.maskaTokensReplace != null && (e.tokensReplace = SA(A.dataset.maskaTokensReplace)), A.dataset.maskaTokens != null && (e.tokens = wn(A.dataset.maskaTokens));
1201
1205
  const n = {};
1202
1206
  return A.dataset.maskaNumberLocale != null && (n.locale = A.dataset.maskaNumberLocale), A.dataset.maskaNumberFraction != null && (n.fraction = parseInt(A.dataset.maskaNumberFraction)), A.dataset.maskaNumberUnsigned != null && (n.unsigned = SA(A.dataset.maskaNumberUnsigned)), (A.dataset.maskaNumber != null || Object.values(n).length > 0) && (e.number = n), e;
@@ -1221,12 +1225,12 @@ class EA {
1221
1225
  return;
1222
1226
  const r = n.target, a = this.items.get(r);
1223
1227
  if (a === void 0) return;
1224
- const o = "inputType" in n && n.inputType.startsWith("delete"), l = a.isEager(), c = o && l && a.unmasked(r.value) === "" ? "" : r.value;
1225
- this.fixCursor(r, o, () => this.setValue(r, c));
1228
+ const o = "inputType" in n && n.inputType.startsWith("delete"), l = a.isEager(), i = o && l && a.unmasked(r.value) === "" ? "" : r.value;
1229
+ this.fixCursor(r, o, () => this.setValue(r, i));
1226
1230
  }), this.options = e, this.eventAbortController = new AbortController(), this.init(this.getInputs(t));
1227
1231
  }
1228
1232
  update(t = {}) {
1229
- this.options = k({}, t), this.init(Array.from(this.items.keys()));
1233
+ this.options = B({}, t), this.init(Array.from(this.items.keys()));
1230
1234
  }
1231
1235
  updateValue(t) {
1232
1236
  var e;
@@ -1257,10 +1261,10 @@ class EA {
1257
1261
  var r, a;
1258
1262
  const o = t.selectionStart, l = t.value;
1259
1263
  if (n(), o === null || o === l.length && !e) return;
1260
- const c = t.value, s = l.slice(0, o), p = c.slice(0, o), i = (r = this.processInput(t, s)) == null ? void 0 : r.unmasked, f = (a = this.processInput(t, p)) == null ? void 0 : a.unmasked;
1261
- if (i === void 0 || f === void 0) return;
1264
+ const i = t.value, s = l.slice(0, o), p = i.slice(0, o), c = (r = this.processInput(t, s)) == null ? void 0 : r.unmasked, f = (a = this.processInput(t, p)) == null ? void 0 : a.unmasked;
1265
+ if (c === void 0 || f === void 0) return;
1262
1266
  let d = o;
1263
- s !== p && (d += e ? c.length - l.length : i.length - f.length), t.setSelectionRange(d, d);
1267
+ s !== p && (d += e ? i.length - l.length : c.length - f.length), t.setSelectionRange(d, d);
1264
1268
  }
1265
1269
  setValue(t, e) {
1266
1270
  const n = this.processInput(t, e);
@@ -1280,14 +1284,14 @@ class EA {
1280
1284
  }
1281
1285
  }
1282
1286
  const bn = ({ showOtp: A, value: t, setValue: e }) => {
1283
- const { t: n } = Y(), { handleBlur: r, err: a } = E(pt), o = "### ### ####", l = (s) => {
1284
- const p = s.target, { value: i } = p;
1285
- e(i);
1286
- }, c = dA(r, 1e3);
1287
+ const { t: n } = Z(), { handleBlur: r, err: a } = E(pt), o = "### ### ####", l = (s) => {
1288
+ const p = s.target, { value: c } = p;
1289
+ e(c);
1290
+ }, i = mA(r, 1e3);
1287
1291
  return V(() => {
1288
1292
  new EA('[name="mysr-stc-mobile"]');
1289
1293
  }, []), /* @__PURE__ */ u(
1290
- pA,
1294
+ fA,
1291
1295
  {
1292
1296
  name: "mysr-stc-mobile",
1293
1297
  label: n("form.mobile"),
@@ -1296,13 +1300,13 @@ const bn = ({ showOtp: A, value: t, setValue: e }) => {
1296
1300
  maxLength: o.length,
1297
1301
  autocomplete: "tel-national",
1298
1302
  placeholder: "05x xxx xxxx",
1299
- class: tA(["animate-fade-in text-center", !A && "hidden"]),
1303
+ class: rA(["animate-fade-in text-center", !A && "hidden"]),
1300
1304
  onAnimationEnd: (s) => {
1301
1305
  s.target && s.target.focus();
1302
1306
  },
1303
1307
  value: t,
1304
1308
  onKeyUp: (s) => {
1305
- l(s), c(s);
1309
+ l(s), i(s);
1306
1310
  },
1307
1311
  onBlur: r,
1308
1312
  error: a.phone,
@@ -1311,14 +1315,14 @@ const bn = ({ showOtp: A, value: t, setValue: e }) => {
1311
1315
  }
1312
1316
  );
1313
1317
  }, Cn = ({ showPhone: A, value: t, setValue: e }) => {
1314
- const { t: n } = Y(), { handleBlur: r, err: a } = E(pt), o = (c) => {
1315
- const s = c.target, { value: p } = s;
1318
+ const { t: n } = Z(), { handleBlur: r, err: a } = E(pt), o = (i) => {
1319
+ const s = i.target, { value: p } = s;
1316
1320
  e(p);
1317
- }, l = dA(r, 1e3);
1321
+ }, l = mA(r, 1e3);
1318
1322
  return V(() => {
1319
1323
  new EA('[name="mysr-stc-otp"]');
1320
1324
  }, []), /* @__PURE__ */ u(
1321
- pA,
1325
+ fA,
1322
1326
  {
1323
1327
  name: "mysr-stc-otp",
1324
1328
  label: n("form.otp"),
@@ -1326,13 +1330,13 @@ const bn = ({ showOtp: A, value: t, setValue: e }) => {
1326
1330
  inputMode: "numeric",
1327
1331
  autocomplete: "one-time-code",
1328
1332
  placeholder: n("form.code"),
1329
- class: tA(["animate-fade-in text-center", A && "hidden"]),
1330
- onAnimationEnd: (c) => {
1331
- c.target && c.target.focus();
1333
+ class: rA(["animate-fade-in text-center", A && "hidden"]),
1334
+ onAnimationEnd: (i) => {
1335
+ i.target && i.target.focus();
1332
1336
  },
1333
1337
  value: t,
1334
- onKeyUp: (c) => {
1335
- o(c), l(c);
1338
+ onKeyUp: (i) => {
1339
+ o(i), l(i);
1336
1340
  },
1337
1341
  onBlur: r,
1338
1342
  error: a.otp,
@@ -1344,10 +1348,10 @@ const bn = ({ showOtp: A, value: t, setValue: e }) => {
1344
1348
  countTo: A,
1345
1349
  callback: t
1346
1350
  }) => {
1347
- const e = $(null), n = de(() => {
1351
+ const e = tA(null), n = de(() => {
1348
1352
  const l = A ? new Date(A).getTime() - (/* @__PURE__ */ new Date()).getTime() : 0;
1349
1353
  return l < 0 ? 0 : l;
1350
- }, [A]), [r, a] = O(n());
1354
+ }, [A]), [r, a] = z(n());
1351
1355
  V(() => (e.current = setInterval(() => {
1352
1356
  a(n());
1353
1357
  }, 500), () => {
@@ -1356,105 +1360,121 @@ const bn = ({ showOtp: A, value: t, setValue: e }) => {
1356
1360
  r === 0 && (e.current && clearInterval(e.current), typeof t == "function" && t(0));
1357
1361
  }, [t, r]);
1358
1362
  const o = () => {
1359
- const l = Math.floor(r / 1e3 / 60 / 60), c = Math.floor((r / 1e3 / 60 / 60 - l) * 60), s = Math.floor(((r / 1e3 / 60 / 60 - l) * 60 - c) * 60);
1363
+ const l = Math.floor(r / 1e3 / 60 / 60), i = Math.floor((r / 1e3 / 60 / 60 - l) * 60), s = Math.floor(((r / 1e3 / 60 / 60 - l) * 60 - i) * 60);
1360
1364
  return /* @__PURE__ */ u("span", { children: [
1361
- c,
1365
+ i,
1362
1366
  ":",
1363
1367
  s < 10 ? `0${s}` : s
1364
1368
  ] });
1365
1369
  };
1366
- return !A || !r ? null : /* @__PURE__ */ u("div", { class: tA("inline-flex gap-2 text-sm"), children: o() });
1370
+ return !A || !r ? null : /* @__PURE__ */ u("div", { class: rA("inline-flex gap-2 text-sm"), children: o() });
1367
1371
  }, Mn = "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";
1368
1372
  function be(A) {
1369
1373
  return A.errors !== void 0;
1370
1374
  }
1371
1375
  const kn = () => {
1372
- const { t: A } = Y(), [t, e] = O(!1), {
1376
+ const { t: A } = Z(), [t, e] = z(!1), {
1373
1377
  given_id: n,
1374
1378
  amount: r,
1375
1379
  currency: a,
1376
1380
  description: o,
1377
1381
  publishable_api_key: l,
1378
- metadata: c,
1382
+ metadata: i,
1379
1383
  invoice_id: s,
1380
1384
  version: p,
1381
- base_url: i,
1385
+ base_url: c,
1382
1386
  apply_coupon: f,
1383
1387
  splits: d,
1384
1388
  on_failure: y,
1385
- setFormSettings: h
1386
- } = E(q), v = (w) => {
1387
- h && (e(w), h((D) => L(k({}, D), {
1388
- isProcessing: w
1389
+ use_payment_intent: b,
1390
+ payment_intent: v,
1391
+ setFormSettings: m
1392
+ } = E(q), g = (k) => {
1393
+ m && (e(k), m((Q) => N(B({}, Q), {
1394
+ isProcessing: k
1389
1395
  })));
1390
- }, m = {
1396
+ }, D = {
1391
1397
  amount: r,
1392
1398
  currency: a,
1393
1399
  description: o,
1394
1400
  publishable_api_key: l
1395
1401
  };
1396
- n && (m.given_id = n), c && Object.keys(c).length > 0 && (m.metadata = c), s && (m.invoice_id = s.toLowerCase()), f !== void 0 && (m.apply_coupon = f), d && (m.splits = d);
1397
- const g = (w) => H(void 0, null, function* () {
1398
- if (h && (h((D) => L(k({}, D), {
1399
- apiError: `${A("error." + w.type)}, ${w.message}`
1402
+ n && (D.given_id = n), i && Object.keys(i).length > 0 && (D.metadata = i), s && (D.invoice_id = s.toLowerCase()), f !== void 0 && (D.apply_coupon = f), d && (D.splits = d);
1403
+ const w = (k) => R(void 0, null, function* () {
1404
+ if (m && (m((Q) => N(B({}, Q), {
1405
+ apiError: `${A("error." + k.type)}, ${k.message}`
1400
1406
  })), y))
1401
1407
  try {
1402
- yield y(w);
1403
- } catch (D) {
1404
- console.error("An error happened when firing failure callback"), console.error(D);
1408
+ yield y(k);
1409
+ } catch (Q) {
1410
+ console.error("An error happened when firing failure callback"), console.error(Q);
1405
1411
  }
1406
- }), M = () => {
1407
- h && h((w) => L(k({}, w), { apiError: "" }));
1412
+ }), C = () => {
1413
+ m && m((k) => N(B({}, k), { apiError: "" }));
1408
1414
  };
1409
1415
  return {
1410
1416
  processing: t,
1411
- postData: (I) => H(void 0, [I], function* ({
1412
- updatedPaymentConfig: w,
1413
- data: D,
1414
- path: B
1417
+ postData: (O) => R(void 0, [O], function* ({
1418
+ updatedPaymentConfig: k,
1419
+ data: Q,
1420
+ path: P
1415
1421
  }) {
1416
- v(!0), M();
1417
- const X = B || `${i}/v1/payments`;
1422
+ var L, X;
1423
+ g(!0), C();
1418
1424
  try {
1419
- const T = yield fetch(X, {
1425
+ const _ = k, T = (L = _.payment_intent) != null ? L : v, Y = (X = _.use_payment_intent) != null ? X : b, $ = B(B(B({}, D), Q), k);
1426
+ delete $.use_payment_intent, delete $.payment_intent;
1427
+ let oA = P || `${c}/v1/payments`;
1428
+ if (!P && Y) {
1429
+ if (!(T != null && T.id) || !(T != null && T.client_secret)) {
1430
+ yield w({
1431
+ type: "invalid_client_secret",
1432
+ message: "A payment intent id and client secret are required to fulfill the payment.",
1433
+ errors: null
1434
+ });
1435
+ return;
1436
+ }
1437
+ oA = `${c}/v1/payment_intents/${T.id}/fulfill`, $.client_secret = T.client_secret;
1438
+ }
1439
+ const K = yield fetch(oA, {
1420
1440
  method: "POST",
1421
1441
  headers: {
1422
1442
  "Content-Type": "application/json",
1423
1443
  "X-Moyasar-Form-Version": p
1424
1444
  },
1425
- body: JSON.stringify(k(k(k({}, m), D), w))
1445
+ body: JSON.stringify($)
1426
1446
  });
1427
- if (!T.ok) {
1428
- if (typeof T == "object") {
1429
- const P = yield T.json();
1430
- if (console.error("fetch error:", P), !be(P)) {
1431
- yield g({
1447
+ if (!K.ok) {
1448
+ if (typeof K == "object") {
1449
+ const eA = yield K.json();
1450
+ if (console.error("fetch error:", eA), !be(eA)) {
1451
+ yield w({
1432
1452
  type: "api_error",
1433
- message: `Error code: ${T.status}`,
1453
+ message: `Error code: ${K.status}`,
1434
1454
  errors: null
1435
1455
  });
1436
1456
  return;
1437
1457
  }
1438
- return yield g(P), P;
1458
+ return yield w(eA), eA;
1439
1459
  }
1440
- return yield Promise.reject(T);
1460
+ return yield Promise.reject(K);
1441
1461
  }
1442
- return yield T.json();
1443
- } catch (T) {
1462
+ return yield K.json();
1463
+ } catch (_) {
1444
1464
  if (y)
1445
1465
  try {
1446
- yield y(T);
1447
- } catch (P) {
1448
- console.error("An error happened when firing failure callback"), console.error(P);
1466
+ yield y(_);
1467
+ } catch (T) {
1468
+ console.error("An error happened when firing failure callback"), console.error(T);
1449
1469
  }
1450
- console.error(T);
1470
+ console.error(_);
1451
1471
  } finally {
1452
- v(!1);
1472
+ g(!1);
1453
1473
  }
1454
1474
  })
1455
1475
  };
1456
1476
  }, Bn = () => {
1457
- const { apiError: A } = E(q), [t, e] = O(!1);
1477
+ const { apiError: A } = E(q), [t, e] = z(!1);
1458
1478
  return V(() => {
1459
1479
  e(!!A);
1460
1480
  }, [A]), V(() => {
@@ -1467,7 +1487,7 @@ const kn = () => {
1467
1487
  }, [t]), {
1468
1488
  fail: t
1469
1489
  };
1470
- }, Sn = (n) => H(void 0, [n], function* ({
1490
+ }, Sn = (n) => R(void 0, [n], function* ({
1471
1491
  source: A,
1472
1492
  on_initiating: t,
1473
1493
  setFormSettings: e
@@ -1483,11 +1503,13 @@ const kn = () => {
1483
1503
  "splits",
1484
1504
  "publishable_api_key",
1485
1505
  "currency",
1486
- "save_card"
1506
+ "save_card",
1507
+ "use_payment_intent",
1508
+ "payment_intent"
1487
1509
  ];
1488
- for (const c in o)
1489
- if (!l.includes(c))
1490
- throw new Error(`Changing ${c} is not allowed!`);
1510
+ for (const i in o)
1511
+ if (!l.includes(i))
1512
+ throw new Error(`Changing ${i} is not allowed!`);
1491
1513
  if (o && "save_card" in o && typeof o.save_card != "boolean")
1492
1514
  throw new Error("save_card must be a boolean");
1493
1515
  return o;
@@ -1500,13 +1522,13 @@ const kn = () => {
1500
1522
  if (typeof a == "boolean")
1501
1523
  return a;
1502
1524
  if (typeof a == "object")
1503
- return r(a), e && a !== null && Object.keys(a).length > 0 && e((o) => k(k({}, o), a)), a;
1525
+ return r(a), e && a !== null && Object.keys(a).length > 0 && e((o) => B(B({}, o), a)), a;
1504
1526
  throw new Error(`Invalid on_initiating handler result: ${a}`);
1505
- }), VA = (A, t, e) => H(void 0, null, function* () {
1527
+ }), VA = (A, t, e) => R(void 0, null, function* () {
1506
1528
  var r;
1507
1529
  const n = `${A}${A.indexOf("?") > -1 ? "&" : "?"}id=${t.id}&status=${t.status}&message=${(r = t.source) == null ? void 0 : r.message}`;
1508
1530
  e && typeof e == "function" ? yield e(n) : window.location.href = n;
1509
- }), Pn = (e) => H(void 0, [e], function* ({
1531
+ }), Pn = (e) => R(void 0, [e], function* ({
1510
1532
  payment: A,
1511
1533
  on_completed: t
1512
1534
  }) {
@@ -1566,7 +1588,7 @@ const kn = () => {
1566
1588
  "tip",
1567
1589
  "top-up",
1568
1590
  "continue"
1569
- ], uA = {
1591
+ ], dA = {
1570
1592
  ADP: 0,
1571
1593
  AFN: 0,
1572
1594
  ALL: 0,
@@ -1753,7 +1775,7 @@ const kn = () => {
1753
1775
  t,
1754
1776
  typeof e == "string" ? e.trim() : e
1755
1777
  ]).filter(([, t]) => t != null && t !== "")
1756
- ), fA = ({
1778
+ ), vA = ({
1757
1779
  defaultError: A
1758
1780
  }) => {
1759
1781
  const {
@@ -1764,164 +1786,164 @@ const kn = () => {
1764
1786
  sender: a,
1765
1787
  recipient: o,
1766
1788
  setFormSettings: l
1767
- } = E(q), [c, s] = O(A), { processing: p, postData: i } = kn(), [f, d] = O(!1), [y, h] = O(!1), { fail: v } = Bn();
1768
- function m(T, P) {
1769
- return H(this, arguments, function* ({ data: C, path: w, onSuccess: D, onFailed: B, initPayment: I }, X) {
1770
- var z;
1771
- const Q = yield i({
1772
- updatedPaymentConfig: X,
1773
- data: C,
1774
- path: w
1775
- }), N = typeof X == "object" && X !== null && "callback_url" in X && typeof X.callback_url == "string" ? X.callback_url : t;
1776
- if (be(Q)) {
1789
+ } = E(q), [i, s] = z(A), { processing: p, postData: c } = kn(), [f, d] = z(!1), [y, b] = z(!1), { fail: v } = Bn();
1790
+ function m(O, L) {
1791
+ return R(this, arguments, function* ({ data: w, path: C, onSuccess: M, onFailed: k, initPayment: Q }, P) {
1792
+ var T;
1793
+ const X = yield c({
1794
+ updatedPaymentConfig: P,
1795
+ data: w,
1796
+ path: C
1797
+ }), _ = typeof P == "object" && P !== null && "callback_url" in P && typeof P.callback_url == "string" ? P.callback_url : t;
1798
+ if (be(X)) {
1777
1799
  d(!1);
1778
1800
  return;
1779
1801
  }
1780
- Q && (r && I && (yield Pn({
1781
- payment: Q,
1802
+ X && (r && Q && (yield Pn({
1803
+ payment: X,
1782
1804
  on_completed: r
1783
- }).catch((Z) => {
1784
- console.error(Z);
1785
- })), D && Q.status !== "failed" && D(Q), ["paid", "authorized"].includes(Q.status) && (h(!0), setTimeout(() => {
1786
- VA(N, Q, n).catch(() => {
1805
+ }).catch((Y) => {
1806
+ console.error(Y);
1807
+ })), M && X.status !== "failed" && M(X), ["paid", "authorized"].includes(X.status) && (b(!0), setTimeout(() => {
1808
+ VA(_, X, n).catch(() => {
1787
1809
  });
1788
- }, 100)), Q.status === "initiated" && ((z = Q.source) == null ? void 0 : z.type) === "sadadbill" && (h(!0), setTimeout(() => {
1789
- VA(N, Q, n).catch(() => {
1810
+ }, 100)), X.status === "initiated" && ((T = X.source) == null ? void 0 : T.type) === "sadadbill" && (b(!0), setTimeout(() => {
1811
+ VA(_, X, n).catch(() => {
1790
1812
  });
1791
- }, 100)), Q.status === "failed" && (B && B(Q), setTimeout(() => {
1792
- VA(N, Q, n).catch(() => {
1813
+ }, 100)), X.status === "failed" && (k && k(X), setTimeout(() => {
1814
+ VA(_, X, n).catch(() => {
1793
1815
  });
1794
1816
  }, 100))), d(!1);
1795
1817
  });
1796
1818
  }
1797
- function g(C) {
1798
- return H(this, null, function* () {
1799
- var I;
1819
+ function g(w) {
1820
+ return R(this, null, function* () {
1821
+ var Q;
1800
1822
  d(!0);
1801
- const w = (I = C.data.source) == null ? void 0 : I.type, B = a && o && typeof w == "string" && $A.includes(w) ? L(k({}, C), {
1802
- data: L(k({}, C.data), {
1823
+ const C = (Q = w.data.source) == null ? void 0 : Q.type, k = a && o && typeof C == "string" && $A.includes(C) ? N(B({}, w), {
1824
+ data: N(B({}, w.data), {
1803
1825
  sender: Vt(a),
1804
1826
  recipient: Vt(o)
1805
1827
  })
1806
- }) : C;
1807
- if (B.initPayment) {
1808
- let T = B.data.source;
1828
+ }) : w;
1829
+ if (k.initPayment) {
1830
+ let O = k.data.source;
1809
1831
  try {
1810
- (T == null ? void 0 : T.type) === "creditcard" && typeof T.number == "string" && (T = {
1832
+ (O == null ? void 0 : O.type) === "creditcard" && typeof O.number == "string" && (O = {
1811
1833
  type: "creditcard",
1812
- bin: T.number.substring(0, 8)
1834
+ bin: O.number.substring(0, 8)
1813
1835
  });
1814
- const P = yield Sn({
1815
- source: T,
1836
+ const L = yield Sn({
1837
+ source: O,
1816
1838
  on_initiating: e,
1817
1839
  setFormSettings: l
1818
1840
  });
1819
- if (typeof P == "boolean" && !P) {
1841
+ if (typeof L == "boolean" && !L) {
1820
1842
  d(!1);
1821
1843
  return;
1822
1844
  }
1823
- const X = P && typeof P == "object" ? k({}, P) : {}, { save_card: N } = X, z = gA(X, ["save_card"]), Z = typeof N == "boolean" && typeof w == "string" && Tn.includes(w) ? L(k({}, B), { data: L(k({}, B.data), { source: L(k({}, B.data.source), { save_card: N }) }) }) : B;
1824
- yield m(Z, z);
1825
- } catch (P) {
1826
- console.error(P), d(!1);
1845
+ const P = L && typeof L == "object" ? B({}, L) : {}, { save_card: _ } = P, T = gA(P, ["save_card"]), Y = typeof _ == "boolean" && typeof C == "string" && Tn.includes(C) ? N(B({}, k), { data: N(B({}, k.data), { source: N(B({}, k.data.source), { save_card: _ }) }) }) : k;
1846
+ yield m(Y, T);
1847
+ } catch (L) {
1848
+ console.error(L), d(!1);
1827
1849
  }
1828
1850
  return;
1829
1851
  }
1830
- yield m(B, {});
1852
+ yield m(k, {});
1831
1853
  });
1832
1854
  }
1833
- const M = oA(() => p || f, [p, f]);
1855
+ const D = cA(() => p || f, [p, f]);
1834
1856
  return {
1835
1857
  makePayment: g,
1836
1858
  busy: f,
1837
1859
  fail: v,
1838
1860
  success: y,
1839
1861
  processing: p,
1840
- loading: M,
1841
- error: c,
1862
+ loading: D,
1863
+ error: i,
1842
1864
  setError: s
1843
1865
  };
1844
1866
  }, dt = ({ inForm: A = !1 }) => {
1845
1867
  const { apiError: t, showForm: e } = E(q);
1846
1868
  return e && !A ? null : /* @__PURE__ */ u("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 });
1847
- }, Nn = () => {
1848
- const { t: A } = Y(), { formattedAmount: t, currency: e, isRtl: n, fixed_width: r, setFormSettings: a, showForm: o } = E(q), [l, c] = O(null), [s, p] = O(!1), i = {
1869
+ }, _n = () => {
1870
+ const { t: A } = Z(), { formattedAmount: t, currency: e, isRtl: n, fixed_width: r, setFormSettings: a, showForm: o } = E(q), [l, i] = z(null), [s, p] = z(!1), c = {
1849
1871
  phone: "",
1850
1872
  otp: ""
1851
1873
  }, {
1852
1874
  makePayment: f,
1853
1875
  busy: d,
1854
1876
  fail: y,
1855
- success: h,
1877
+ success: b,
1856
1878
  loading: v,
1857
1879
  error: m,
1858
1880
  setError: g
1859
- } = fA({ defaultError: i }), [M, C] = O(""), [w, D] = O(""), [B, I] = O(""), X = (J) => {
1860
- const _ = /^05[503649187][0-9]{7}$/.test(W(J));
1861
- return g((K) => L(k({}, K), {
1862
- phone: _ ? "" : "error.invalid_mobile"
1863
- })), _;
1864
- }, T = (J) => {
1865
- const _ = /^[0-9]{4,}$/.test(W(J));
1866
- return g((K) => L(k({}, K), {
1867
- otp: _ ? "" : "error.invalid_otp"
1868
- })), _;
1869
- }, P = (J) => {
1870
- const { value: _, name: K } = J.target, nA = _.trim();
1871
- if (p(!1), !nA) {
1872
- p(!nA);
1881
+ } = vA({ defaultError: c }), [D, w] = z(""), [C, M] = z(""), [k, Q] = z(""), P = (J) => {
1882
+ const I = /^05[503649187][0-9]{7}$/.test(W(J));
1883
+ return g((H) => N(B({}, H), {
1884
+ phone: I ? "" : "error.invalid_mobile"
1885
+ })), I;
1886
+ }, O = (J) => {
1887
+ const I = /^[0-9]{4,}$/.test(W(J));
1888
+ return g((H) => N(B({}, H), {
1889
+ otp: I ? "" : "error.invalid_otp"
1890
+ })), I;
1891
+ }, L = (J) => {
1892
+ const { value: I, name: H } = J.target, lA = I.trim();
1893
+ if (p(!1), !lA) {
1894
+ p(!lA);
1873
1895
  return;
1874
1896
  }
1875
- K === "mysr-stc-mobile" && X(nA), K === "mysr-stc-otp" && T(nA);
1876
- }, Q = () => {
1877
- if (!X(M)) return;
1878
- function J(_) {
1879
- const { transaction_url: K } = _.source;
1880
- I(K), c((/* @__PURE__ */ new Date()).getTime() + 5 * 60 * 1e3);
1897
+ H === "mysr-stc-mobile" && P(lA), H === "mysr-stc-otp" && O(lA);
1898
+ }, X = () => {
1899
+ if (!P(D)) return;
1900
+ function J(I) {
1901
+ const { transaction_url: H } = I.source;
1902
+ Q(H), i((/* @__PURE__ */ new Date()).getTime() + 5 * 60 * 1e3);
1881
1903
  }
1882
1904
  f({
1883
1905
  data: {
1884
1906
  source: {
1885
1907
  type: "stcpay",
1886
- mobile: W(M)
1908
+ mobile: W(D)
1887
1909
  }
1888
1910
  },
1889
1911
  onSuccess: J,
1890
1912
  initPayment: !0
1891
- }).catch((_) => {
1892
- console.error(_);
1913
+ }).catch((I) => {
1914
+ console.error(I);
1893
1915
  });
1894
- }, N = () => {
1895
- if (!l || !T(w)) return;
1896
- function J(_) {
1897
- var K;
1898
- _.status === "failed" && ((K = _.source) == null ? void 0 : K.message) === "Invalid OTP" && (g((nA) => L(k({}, nA), {
1916
+ }, _ = () => {
1917
+ if (!l || !O(C)) return;
1918
+ function J(I) {
1919
+ var H;
1920
+ I.status === "failed" && ((H = I.source) == null ? void 0 : H.message) === "Invalid OTP" && (g((lA) => N(B({}, lA), {
1899
1921
  otp: "error.invalid_otp"
1900
- })), D(""), c(null));
1922
+ })), M(""), i(null));
1901
1923
  }
1902
1924
  f({
1903
1925
  data: {
1904
- otp_value: W(w)
1926
+ otp_value: W(C)
1905
1927
  },
1906
- path: B,
1928
+ path: k,
1907
1929
  onFailed: J
1908
- }).catch((_) => {
1909
- console.error(_);
1930
+ }).catch((I) => {
1931
+ console.error(I);
1910
1932
  });
1911
- }, z = (J) => {
1912
- if (J.preventDefault(), g(i), !l) {
1913
- Q();
1933
+ }, T = (J) => {
1934
+ if (J.preventDefault(), g(c), !l) {
1935
+ X();
1914
1936
  return;
1915
1937
  }
1916
- N();
1917
- }, Z = (J) => {
1918
- J > 0 || (g((_) => L(k({}, _), {
1938
+ _();
1939
+ }, Y = (J) => {
1940
+ J > 0 || (g((I) => N(B({}, I), {
1919
1941
  otp: "error.otp_time_out"
1920
- })), D(""), c(null));
1921
- }, lA = oA(() => m.phone || l && m.otp && m.otp !== "error.otp_time_out" ? !0 : s || v, [m, s, v]), mA = (J) => a((_) => L(k({}, _), { showForm: J })), [sA, vA] = O(!1), DA = () => {
1922
- vA(!0);
1942
+ })), M(""), i(null));
1943
+ }, $ = cA(() => m.phone || l && m.otp && m.otp !== "error.otp_time_out" ? !0 : s || v, [m, s, v]), oA = (J) => a((I) => N(B({}, I), { showForm: J })), [K, eA] = z(!1), DA = () => {
1944
+ eA(!0);
1923
1945
  }, xA = () => {
1924
- sA && (C(""), D(""), g(i), mA(!1), vA(!1), p(!1));
1946
+ K && (w(""), M(""), g(c), oA(!1), eA(!1), p(!1));
1925
1947
  };
1926
1948
  return /* @__PURE__ */ u(
1927
1949
  pt.Provider,
@@ -1929,10 +1951,10 @@ const kn = () => {
1929
1951
  value: {
1930
1952
  err: m,
1931
1953
  setErr: g,
1932
- handleBlur: P
1954
+ handleBlur: L
1933
1955
  },
1934
- children: /* @__PURE__ */ u(j, { children: [
1935
- /* @__PURE__ */ u(_A, { variant: "stc", onClick: () => mA(!0), children: /* @__PURE__ */ u(
1956
+ children: /* @__PURE__ */ u(F, { children: [
1957
+ /* @__PURE__ */ u(NA, { variant: "stc", onClick: () => oA(!0), children: /* @__PURE__ */ u(
1936
1958
  "img",
1937
1959
  {
1938
1960
  class: "pointer-events-none h-4 max-h-full",
@@ -1942,23 +1964,23 @@ const kn = () => {
1942
1964
  src: Re
1943
1965
  }
1944
1966
  ) }),
1945
- o && /* @__PURE__ */ u(j, { children: [
1967
+ o && /* @__PURE__ */ u(F, { children: [
1946
1968
  /* @__PURE__ */ u(
1947
1969
  "div",
1948
1970
  {
1949
- class: tA([
1971
+ class: rA([
1950
1972
  "fixed inset-0 z-[9] bg-gray-500/75 transition-opacity",
1951
- sA ? "animate-fade-out duration-300" : "animate-fade-in duration-200"
1973
+ K ? "animate-fade-out duration-300" : "animate-fade-in duration-200"
1952
1974
  ])
1953
1975
  }
1954
1976
  ),
1955
1977
  /* @__PURE__ */ u("div", { class: "fixed inset-0 z-10 flex flex-col justify-end md:justify-center", children: /* @__PURE__ */ u(
1956
1978
  "div",
1957
1979
  {
1958
- class: tA([
1980
+ class: rA([
1959
1981
  "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",
1960
1982
  r && "md:mx-auto md:max-w-96 lg:max-w-screen-sm",
1961
- sA ? "animate-dialog-out-mobile duration-200 md:animate-dialog-out" : "animate-dialog-in-mobile duration-300 md:animate-dialog-in"
1983
+ K ? "animate-dialog-out-mobile duration-200 md:animate-dialog-out" : "animate-dialog-in-mobile duration-300 md:animate-dialog-in"
1962
1984
  ]),
1963
1985
  onAnimationEnd: xA,
1964
1986
  children: [
@@ -1967,7 +1989,7 @@ const kn = () => {
1967
1989
  /* @__PURE__ */ u("img", { alt: "", src: Mn, class: "h-5" }),
1968
1990
  /* @__PURE__ */ u("button", { onClick: DA, class: "ms-auto", children: "Cancel" })
1969
1991
  ] }),
1970
- /* @__PURE__ */ u("form", { class: "flex flex-col gap-4", onSubmit: z, children: [
1992
+ /* @__PURE__ */ u("form", { class: "flex flex-col gap-4", onSubmit: T, children: [
1971
1993
  /* @__PURE__ */ u("div", { class: "space-y-2", children: [
1972
1994
  /* @__PURE__ */ u("div", { class: "flex items-end justify-between text-xs font-medium", children: [
1973
1995
  l ? /* @__PURE__ */ u("label", { for: "mysr-stc-mobile", children: A("form.otp") }) : /* @__PURE__ */ u("label", { for: "mysr-stc-otp", children: A("form.mobile") }),
@@ -1976,39 +1998,39 @@ const kn = () => {
1976
1998
  /* @__PURE__ */ u(
1977
1999
  bn,
1978
2000
  {
1979
- value: M,
1980
- setValue: C,
2001
+ value: D,
2002
+ setValue: w,
1981
2003
  showOtp: !l && typeof l != "number"
1982
2004
  }
1983
2005
  ),
1984
2006
  /* @__PURE__ */ u(
1985
2007
  Cn,
1986
2008
  {
1987
- value: w,
1988
- setValue: D,
2009
+ value: C,
2010
+ setValue: M,
1989
2011
  showPhone: !l && typeof l != "number"
1990
2012
  }
1991
2013
  )
1992
2014
  ] }),
1993
2015
  /* @__PURE__ */ u(
1994
- _A,
2016
+ NA,
1995
2017
  {
1996
- success: h,
2018
+ success: b,
1997
2019
  fail: y,
1998
2020
  busy: d,
1999
2021
  variant: "stc",
2000
2022
  class: "flex gap-1",
2001
- disabled: lA,
2023
+ disabled: $,
2002
2024
  type: "submit",
2003
2025
  children: [
2004
2026
  !n && A("button.pay"),
2005
2027
  " ",
2006
- l ? /* @__PURE__ */ u(Dn, { countTo: l, callback: Z }) : /* @__PURE__ */ u("span", { class: "currency-amount", children: /* @__PURE__ */ u(ut, { currency: e, formattedAmount: t }) })
2028
+ l ? /* @__PURE__ */ u(Dn, { countTo: l, callback: Y }) : /* @__PURE__ */ u("span", { class: "currency-amount", children: /* @__PURE__ */ u(ut, { currency: e, formattedAmount: t }) })
2007
2029
  ]
2008
2030
  }
2009
2031
  )
2010
2032
  ] }),
2011
- /* @__PURE__ */ u("p", { class: "flex flex-col gap-2 text-xs font-medium text-error empty:hidden", children: Object.entries(m).map(([J, _]) => /* @__PURE__ */ u("span", { class: "empty:hidden", children: A(_) }, J)) })
2033
+ /* @__PURE__ */ u("p", { class: "flex flex-col gap-2 text-xs font-medium text-error empty:hidden", children: Object.entries(m).map(([J, I]) => /* @__PURE__ */ u("span", { class: "empty:hidden", children: A(I) }, J)) })
2012
2034
  ]
2013
2035
  }
2014
2036
  ) })
@@ -2016,8 +2038,8 @@ const kn = () => {
2016
2038
  ] })
2017
2039
  }
2018
2040
  );
2019
- }, _n = () => {
2020
- const { t: A } = Y(), {
2041
+ }, Nn = () => {
2042
+ const { t: A } = Z(), {
2021
2043
  base_url: t,
2022
2044
  publishable_api_key: e,
2023
2045
  apple_pay: n,
@@ -2025,14 +2047,14 @@ const kn = () => {
2025
2047
  currency: a,
2026
2048
  supported_networks: o,
2027
2049
  decimalAmount: l,
2028
- statement_descriptor: c,
2050
+ statement_descriptor: i,
2029
2051
  setFormSettings: s,
2030
2052
  on_failure: p
2031
- } = E(q), { makePayment: i } = fA({ defaultError: {} });
2053
+ } = E(q), { makePayment: c } = vA({ defaultError: {} });
2032
2054
  function f() {
2033
2055
  if (!ApplePaySession)
2034
2056
  return;
2035
- const d = (n == null ? void 0 : n.label) || (r == null ? void 0 : r.label), h = {
2057
+ const d = (n == null ? void 0 : n.label) || (r == null ? void 0 : r.label), b = {
2036
2058
  countryCode: (n == null ? void 0 : n.country) || (r == null ? void 0 : r.country),
2037
2059
  currencyCode: a,
2038
2060
  supportedNetworks: o.map(
@@ -2043,30 +2065,30 @@ const kn = () => {
2043
2065
  label: d,
2044
2066
  amount: l
2045
2067
  }
2046
- }, v = new ApplePaySession(n.version, h);
2068
+ }, v = new ApplePaySession(n.version, b);
2047
2069
  v.onvalidatemerchant = (m) => {
2048
2070
  const g = {
2049
2071
  validation_url: m.validationURL,
2050
2072
  display_name: d,
2051
2073
  domain_name: window.location.hostname,
2052
2074
  publishable_api_key: e
2053
- }, M = n.validate_merchant_url || `${t}/v1/applepay/initiate`;
2054
- fetch(M, {
2075
+ }, D = n.validate_merchant_url || `${t}/v1/applepay/initiate`;
2076
+ fetch(D, {
2055
2077
  method: "POST",
2056
2078
  headers: {
2057
2079
  "Content-Type": "application/json"
2058
2080
  },
2059
2081
  body: JSON.stringify(g)
2060
- }).then((C) => C.ok ? C : Promise.reject(C)).then((C) => C.json()).then((C) => {
2061
- v.completeMerchantValidation(C);
2062
- }).catch((C) => {
2063
- if (console.error("Apple Pay error:", C), s((w) => L(k({}, w), {
2082
+ }).then((w) => w.ok ? w : Promise.reject(w)).then((w) => w.json()).then((w) => {
2083
+ v.completeMerchantValidation(w);
2084
+ }).catch((w) => {
2085
+ if (console.error("Apple Pay error:", w), s((C) => N(B({}, C), {
2064
2086
  apiError: A("error.applePay")
2065
2087
  })), p)
2066
2088
  try {
2067
- p(C);
2068
- } catch (w) {
2069
- console.error("An error happened when firing failure callback"), console.error(w);
2089
+ p(w);
2090
+ } catch (C) {
2091
+ console.error("An error happened when firing failure callback"), console.error(C);
2070
2092
  }
2071
2093
  v.abort();
2072
2094
  });
@@ -2079,24 +2101,24 @@ const kn = () => {
2079
2101
  save_card: !!(n != null && n.save_card)
2080
2102
  }
2081
2103
  };
2082
- c && (g.source.statement_descriptor = c);
2083
- function M(w) {
2104
+ i && (g.source.statement_descriptor = i);
2105
+ function D(C) {
2084
2106
  v.completePayment({
2085
2107
  status: ApplePaySession.STATUS_FAILURE
2086
2108
  });
2087
2109
  }
2088
- function C(w) {
2110
+ function w(C) {
2089
2111
  v.completePayment({
2090
2112
  status: ApplePaySession.STATUS_SUCCESS
2091
2113
  });
2092
2114
  }
2093
- i({
2115
+ c({
2094
2116
  data: g,
2095
- onFailed: M,
2096
- onSuccess: C,
2117
+ onFailed: D,
2118
+ onSuccess: w,
2097
2119
  initPayment: !0
2098
- }).catch((w) => {
2099
- console.error(w);
2120
+ }).catch((C) => {
2121
+ console.error(C);
2100
2122
  });
2101
2123
  }, v.oncancel = () => {
2102
2124
  console.log("Apple Pay payment cancelled by user");
@@ -2111,35 +2133,35 @@ const kn = () => {
2111
2133
  supported_networks: n,
2112
2134
  currency: r,
2113
2135
  decimalAmount: a
2114
- } = E(q), [o, l] = O(!1), [c, s] = O(!1), { makePayment: p } = fA({ defaultError: {} }), { t: i } = Y(), f = $(null);
2136
+ } = E(q), [o, l] = z(!1), [i, s] = z(!1), { makePayment: p } = vA({ defaultError: {} }), { t: c } = Z(), f = tA(null);
2115
2137
  V(() => {
2116
- let h = null;
2117
- return o || (h = setInterval(() => {
2138
+ let b = null;
2139
+ return o || (b = setInterval(() => {
2118
2140
  window.SamsungPay && l(!0);
2119
2141
  }, 100)), () => {
2120
- clearInterval(h);
2142
+ clearInterval(b);
2121
2143
  };
2122
2144
  }, [o]);
2123
- const d = oA(() => {
2145
+ const d = cA(() => {
2124
2146
  if (!(!o || !t))
2125
2147
  return new SamsungPay.PaymentClient({ environment: t.environment });
2126
2148
  }, [o]);
2127
- if (V(() => H(void 0, null, function* () {
2149
+ if (V(() => R(void 0, null, function* () {
2128
2150
  if (!d || !t)
2129
2151
  return;
2130
- const h = ["visa", "mastercard", "amex", "mada"], v = n == null ? void 0 : n.filter((g) => h.includes(g.toLowerCase())).map((g) => g.toLowerCase()), m = {
2152
+ const b = ["visa", "mastercard", "amex", "mada"], v = n == null ? void 0 : n.filter((g) => b.includes(g.toLowerCase())).map((g) => g.toLowerCase()), m = {
2131
2153
  version: t.version.toString(),
2132
2154
  serviceId: t.service_id,
2133
2155
  protocol: "PROTOCOL_3DS",
2134
2156
  allowedBrands: v
2135
2157
  };
2136
- f.current = () => H(void 0, null, function* () {
2137
- const { order_number: g, id: M, country: C, label: w } = t, D = w || (e == null ? void 0 : e.label), B = C || (e == null ? void 0 : e.country), I = {
2158
+ f.current = () => R(void 0, null, function* () {
2159
+ const { order_number: g, id: D, country: w, label: C } = t, M = C || (e == null ? void 0 : e.label), k = w || (e == null ? void 0 : e.country), Q = {
2138
2160
  orderNumber: g,
2139
2161
  merchant: {
2140
- name: D,
2141
- id: M,
2142
- countryCode: B,
2162
+ name: M,
2163
+ id: D,
2164
+ countryCode: k,
2143
2165
  url: window.location.hostname
2144
2166
  },
2145
2167
  amount: {
@@ -2147,44 +2169,44 @@ const kn = () => {
2147
2169
  currency: r,
2148
2170
  total: a
2149
2171
  }
2150
- }, X = () => {
2172
+ }, P = () => {
2151
2173
  d.notify({
2152
2174
  status: "CHARGED",
2153
2175
  provider: "Moyasar"
2154
2176
  });
2155
- }, T = (P) => {
2177
+ }, O = (L) => {
2156
2178
  d.notify({
2157
2179
  status: "REJECTED",
2158
2180
  provider: "Moyasar"
2159
2181
  });
2160
2182
  };
2161
2183
  try {
2162
- const P = yield d.loadPaymentSheet(
2184
+ const L = yield d.loadPaymentSheet(
2163
2185
  m,
2164
- I
2186
+ Q
2165
2187
  );
2166
2188
  yield p({
2167
2189
  initPayment: !0,
2168
2190
  data: {
2169
2191
  source: {
2170
2192
  type: "samsungpay",
2171
- token: P["3DS"].data,
2193
+ token: L["3DS"].data,
2172
2194
  manual: !!(t != null && t.manual),
2173
2195
  save_card: !!(t != null && t.save_card)
2174
2196
  }
2175
2197
  },
2176
- onFailed: T,
2177
- onSuccess: X
2198
+ onFailed: O,
2199
+ onSuccess: P
2178
2200
  });
2179
- } catch (P) {
2201
+ } catch (L) {
2180
2202
  try {
2181
2203
  d.notify({
2182
2204
  status: "ERRED",
2183
2205
  provider: "Moyasar"
2184
2206
  });
2185
- } catch (Q) {
2207
+ } catch (X) {
2186
2208
  }
2187
- console.error("Samsung Pay error: ", P);
2209
+ console.error("Samsung Pay error: ", L);
2188
2210
  }
2189
2211
  });
2190
2212
  try {
@@ -2195,11 +2217,11 @@ const kn = () => {
2195
2217
  status: "ERRED",
2196
2218
  provider: "Moyasar"
2197
2219
  });
2198
- } catch (M) {
2220
+ } catch (D) {
2199
2221
  }
2200
2222
  console.error("Samsung Pay Error: ", g);
2201
2223
  }
2202
- }), [d, t]), !o || !c)
2224
+ }), [d, t]), !o || !i)
2203
2225
  return null;
2204
2226
  const y = A === "pay" ? "pay-with" : A;
2205
2227
  return /* @__PURE__ */ u(
@@ -2208,7 +2230,7 @@ const kn = () => {
2208
2230
  class: "flex h-11 w-full items-center justify-center gap-1 rounded-md bg-black text-white",
2209
2231
  onClick: f.current,
2210
2232
  children: [
2211
- /* @__PURE__ */ u("span", { children: i(`button.${y}`) }),
2233
+ /* @__PURE__ */ u("span", { children: c(`button.${y}`) }),
2212
2234
  /* @__PURE__ */ u("img", { src: In, alt: "", class: "-mb-[3px] h-[22px]" }),
2213
2235
  /* @__PURE__ */ u("div", { class: "mb-0.5 h-[9px] w-[9px] rotate-45 rounded-sm border-r-[3px] border-t-[3px] border-white" })
2214
2236
  ]
@@ -2224,28 +2246,28 @@ const kn = () => {
2224
2246
  currency: a,
2225
2247
  decimalAmount: o,
2226
2248
  setFormSettings: l
2227
- } = E(q), [c, s] = O(!1), { makePayment: p } = fA({ defaultError: {} });
2249
+ } = E(q), [i, s] = z(!1), { makePayment: p } = vA({ defaultError: {} });
2228
2250
  V(() => {
2229
2251
  let f = null;
2230
- return c || (f = setInterval(() => {
2252
+ return i || (f = setInterval(() => {
2231
2253
  var d, y;
2232
2254
  (y = (d = window.google) == null ? void 0 : d.payments) != null && y.api && s(!0);
2233
2255
  }, 100)), () => {
2234
2256
  clearInterval(f);
2235
2257
  };
2236
- }, [c]);
2237
- const i = oA(() => {
2238
- if (c)
2258
+ }, [i]);
2259
+ const c = cA(() => {
2260
+ if (i)
2239
2261
  return new google.payments.api.PaymentsClient({
2240
2262
  environment: e.environment
2241
2263
  });
2242
- }, [c]);
2243
- return V(() => H(void 0, null, function* () {
2264
+ }, [i]);
2265
+ return V(() => R(void 0, null, function* () {
2244
2266
  const f = document.getElementById("googlePay-container");
2245
- if (!i || !e || (f == null ? void 0 : f.children.length) >= 1)
2267
+ if (!c || !e || (f == null ? void 0 : f.children.length) >= 1)
2246
2268
  return;
2247
2269
  e.merchant_id;
2248
- const d = r == null ? void 0 : r.filter((D) => D !== "mada").map((D) => D.toUpperCase()), y = e.auth_methods, h = {
2270
+ const d = r == null ? void 0 : r.filter((M) => M !== "mada").map((M) => M.toUpperCase()), y = e.auth_methods, b = {
2249
2271
  apiVersion: 2,
2250
2272
  apiVersionMinor: 0
2251
2273
  }, v = {
@@ -2254,38 +2276,38 @@ const kn = () => {
2254
2276
  allowedAuthMethods: y,
2255
2277
  allowedCardNetworks: d
2256
2278
  }
2257
- }, m = Object.assign({}, h);
2279
+ }, m = Object.assign({}, b);
2258
2280
  m.allowedPaymentMethods = [v];
2259
- const g = () => H(void 0, null, function* () {
2260
- const { country: D, label: B, merchant_id: I } = e, X = B || (n == null ? void 0 : n.label), T = D || (n == null ? void 0 : n.country), P = L(k({}, h), {
2261
- allowedPaymentMethods: [w],
2281
+ const g = () => R(void 0, null, function* () {
2282
+ const { country: M, label: k, merchant_id: Q } = e, P = k || (n == null ? void 0 : n.label), O = M || (n == null ? void 0 : n.country), L = N(B({}, b), {
2283
+ allowedPaymentMethods: [C],
2262
2284
  merchantInfo: {
2263
- merchantId: I,
2264
- merchantName: X
2285
+ merchantId: Q,
2286
+ merchantName: P
2265
2287
  },
2266
2288
  transactionInfo: {
2267
- countryCode: T,
2289
+ countryCode: O,
2268
2290
  currencyCode: a,
2269
2291
  totalPriceStatus: "FINAL",
2270
2292
  totalPrice: o
2271
2293
  }
2272
2294
  });
2273
2295
  try {
2274
- const Q = yield i.loadPaymentData(P);
2296
+ const X = yield c.loadPaymentData(L);
2275
2297
  p({
2276
2298
  initPayment: !0,
2277
2299
  data: {
2278
2300
  source: {
2279
2301
  type: "googlepay",
2280
- token: Q.paymentMethodData.tokenizationData.token
2302
+ token: X.paymentMethodData.tokenizationData.token
2281
2303
  }
2282
2304
  }
2283
2305
  });
2284
- } catch (Q) {
2285
- console.error(Q);
2306
+ } catch (X) {
2307
+ console.error(X);
2286
2308
  }
2287
- }), M = () => {
2288
- const D = i.createButton({
2309
+ }), D = () => {
2310
+ const M = c.createButton({
2289
2311
  onClick: g,
2290
2312
  buttonLocale: A,
2291
2313
  buttonColor: "black",
@@ -2293,26 +2315,26 @@ const kn = () => {
2293
2315
  buttonRadius: 6,
2294
2316
  buttonSizeMode: "fill"
2295
2317
  });
2296
- f.appendChild(D);
2297
- }, C = {
2318
+ f.appendChild(M);
2319
+ }, w = {
2298
2320
  type: "PAYMENT_GATEWAY",
2299
2321
  parameters: {
2300
2322
  gateway: "moyasar",
2301
2323
  gatewayMerchantId: e.gateway_merchant_id
2302
2324
  }
2303
- }, w = Object.assign({}, v, {
2304
- tokenizationSpecification: C
2325
+ }, C = Object.assign({}, v, {
2326
+ tokenizationSpecification: w
2305
2327
  });
2306
2328
  try {
2307
- (yield i.isReadyToPay(m)).result ? M() : l((B) => L(k({}, B), {
2329
+ (yield c.isReadyToPay(m)).result ? D() : l((k) => N(B({}, k), {
2308
2330
  apiError: "Cannot initialize Google Pay"
2309
2331
  }));
2310
- } catch (D) {
2311
- l((B) => L(k({}, B), {
2332
+ } catch (M) {
2333
+ l((k) => N(B({}, k), {
2312
2334
  apiError: "Cannot initialize Google Pay"
2313
- })), console.error("Google Pay Error: ", D);
2335
+ })), console.error("Google Pay Error: ", M);
2314
2336
  }
2315
- }), [i, e]), c ? /* @__PURE__ */ u(
2337
+ }), [c, e]), i ? /* @__PURE__ */ u(
2316
2338
  "div",
2317
2339
  {
2318
2340
  id: "googlePay-container",
@@ -2320,11 +2342,11 @@ const kn = () => {
2320
2342
  }
2321
2343
  ) : null;
2322
2344
  }, Yt = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='utf-8'?%3e%3c!--%20Generator:%20Adobe%20Illustrator%2023.0.1,%20SVG%20Export%20Plug-In%20.%20SVG%20Version:%206.00%20Build%200)%20--%3e%3csvg%20version='1.1'%20id='Layer_1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20x='0px'%20y='0px'%20viewBox='91%20347%20820%20306'%20style='enable-background:new%200%200%201000%201000;'%20xml:space='preserve'%3e%3cstyle%20type='text/css'%3e%20.st0{fill:%23929497;}%20.st1{fill:%23ED7624;}%20%3c/style%3e%3cg%20id='Asset_1'%20transform='translate(295%20638)'%3e%3cg%20id='Layer_1_1_'%3e%3cpath%20id='Path_13'%20class='st0'%20d='M129.5-280.8H88.6C69.3-227.2,36.8-138.2,18.9-89.4c-1.8,4.7-4,9.2-6.7,13.5h28.3%20c7.7-0.5,14.6-4.8,18.3-11.6c0.6-1,1.2-2.1,1.6-3.2l17.1-46.7l0,0C98.7-195.5,127.4-274.4,129.5-280.8'/%3e%3cpath%20id='Path_14'%20class='st1'%20d='M564.2-178.3l-17.1,46.8c-3.2,8.3-10.9,14-19.8,14.6H499c2.9-4.6,5.4-9.5,7.2-14.6l17.1-46.8%20h-41l-17,46.8c-3.2,8.3-11,14-19.8,14.6H417c2.9-4.6,5.3-9.5,7.2-14.6l17.1-46.8h-41l-17,46.8c-3.2,8.3-10.9,14-19.8,14.6h-131%20c3-4.5,5.4-9.3,7.3-14.3l4.3-12c11.2-30.8-4.7-55.6-35.4-55.6h-46.6l-14.9,40.9H194c8.1,0,12.3,6.5,9.3,14.6l-4.5,12%20c-3.2,8.2-10.9,13.8-19.7,14.3h-67.4l-14.9,41h415.9c30.8,0,64.2-24.7,75.4-55.3l17.2-47.1L564.2-178.3z'/%3e%3cpath%20id='Path_15'%20class='st1'%20d='M-85.6-75.9h-108.3l14.9-41h108.4c8.9-0.6,16.7-6.3,20-14.6l4.2-11.6c2.9-8.1-1.2-14.6-9.3-14.6%20H-123l14.9-41h67.2c30.8,0,46.5,24.9,35.4,55.6l-4.2,11.6C-20.9-100.7-54.9-76-85.6-75.9'/%3e%3cpath%20id='Path_16'%20class='st0'%20d='M96.6-29.2h-5l-1.9,5.1h5L96.6-29.2z'/%3e%3cpath%20id='Path_17'%20class='st0'%20d='M107.3-14.1c-0.6,2-2,3.7-3.8,4.8c-1.6,0.7-3.4,1-5.2,0.9H85.7c-2,0.2-4.1-0.3-5.8-1.5%20c-1.3-1.2-1.4-3.3-0.3-6.3l2.9-7.7h-5.1l-2.9,7.7c-3.2,8.7,0,13.1,9.9,13.1h16.7c4.5,0,8.5-3,9.8-7.4l5-13.6h-5L107.3-14.1z'/%3e%3cpath%20id='Path_18'%20class='st0'%20d='M105.4-29.2h-5.1l-1.8,5.1h5L105.4-29.2z'/%3e%3cpath%20id='Path_19'%20class='st0'%20d='M140-13.3c0.6-1.7,1.6-3.2,2.9-4.5c1.2-1.3,2.9-2,4.7-2c2.4,0,3.6,1.2,3.6,3.6l5.2-2.1%20c-0.1-3.4-2.9-6.1-6.3-6c-0.2,0-0.4,0-0.6,0c-3.2,0-6.3,1.2-8.8,3.2c-2.6,2-4.7,4.6-5.9,7.7c-0.6,1.5-0.9,3.2-0.8,4.9h-8.3%20c-1.3,0.2-2.7-0.1-3.8-0.8c-0.7-0.7-0.7-2.2,0-4.4l7.1-19.3H124l-7.7,21.3c-0.9,1.9-1,4-0.3,6c1,1.7,2.9,2.7,4.9,2.4H151l1.9-5.3%20h-13.1c-0.7-1.6-0.7-3.4,0-4.9'/%3e%3cpath%20id='Path_20'%20class='st0'%20d='M210.5-33.5h-5l-1.9,5.1h5L210.5-33.5z'/%3e%3cpath%20id='Path_21'%20class='st0'%20d='M204.7-24.5c-6.5,0.3-12.2,4.5-14.3,10.6c-0.7,1.7-0.9,3.6-0.7,5.5h-12.6l2-5.4%20c2.2-6,0-10.4-5.8-10.4c-6.3,0.2-11.9,4.3-14.1,10.2c-2.2,6.1,0.6,10.7,6.2,10.7h4.9c-1.3,2.3-3.8,3.6-6.4,3.6l-1.5,4%20c5.5,0.3,10.5-2.7,12.8-7.7h21.7c6.5-0.3,12.1-4.5,14.2-10.6c2.2-6-0.2-10.8-6.4-10.8%20M171.9-8.6h-4.6c-2.8,0-3.8-2.6-2.8-5.7%20c1-3,3.7-5,6.9-5.2c2.7,0,3.6,1.9,2.8,4.7L171.9-8.6z%20M198.7-8.1c-3.1,0-4.2-2.7-3-6c0.9-3.2,3.7-5.6,7.1-5.9c3.1,0,4.3,2.6,3,6.1%20C204.8-10.7,202-8.4,198.7-8.1'/%3e%3cpath%20id='Path_22'%20class='st0'%20d='M299.4-13.2c-0.4,1.2-0.9,2.3-1.6,3.3c-1,1.1-2.4,1.6-3.8,1.5h-11.6c1.4-1.5,2.5-3.4,3-5.4%20l7-19.3h-5.1l-7.1,19.3c-0.4,1.3-1,2.5-1.8,3.5c-1,1.1-2.4,1.7-3.8,1.6h-7.7l0.5-1.3c1.1-2.4,1.1-5.3,0-7.7%20c-1.3-2.2-3.8-3.4-6.3-3.1c-3.1,0-6.2,1.1-8.6,3c-2.6,2-4.5,4.6-5.6,7.7c0,0.5-0.4,1-0.5,1.5h-10.7c2.9-7.9,1.6-12.9-3.8-15%20c-0.8-0.3-1.7-0.6-2.5-0.7h-4.8l-1.7,4.7c1.5,0,3,0.1,4.5,0.4c4.3,1,5.4,4.5,3.2,10.6h-16.7l-1.9,5.2h34.7%20c1.1,2.7,3.9,4.2,6.8,3.8c3.6,0,7.2-1.4,9.8-3.8h30.3c5.1,0.1,9.6-3.4,10.8-8.4l7.7-21.4h-5.2L299.4-13.2z%20M259.2-5.5%20c-1.2,1.1-2.7,1.7-4.3,1.7c-3.2,0-4.2-2.7-3-6c0.6-1.5,1.5-2.9,2.7-4c1.2-1.2,2.8-1.8,4.4-1.8c1.4-0.1,2.7,0.6,3.2,1.9%20c0.4,1.4,0.3,2.9-0.3,4.2C261.4-8.1,260.5-6.7,259.2-5.5'/%3e%3cpath%20id='Path_23'%20class='st0'%20d='M336.3-23.3c-0.8-0.3-1.7-0.6-2.5-0.7h-4.8l-1.7,4.7c1.5,0,3,0.1,4.5,0.4%20c4.3,1,5.4,4.5,3.2,10.6h-16.6l-1.9,5.2h21.9l1.9-5.2C343-16.2,341.7-21.2,336.3-23.3'/%3e%3cpath%20id='Path_24'%20class='st0'%20d='M343-3.1h5.1L359-32.9h-5.1L343-3.1z'/%3e%3cpath%20id='Path_25'%20class='st0'%20d='M417.9-13.5c-1.2,3.4-3.2,5.1-5.8,5.1h-4.9c1.5-1.6,2.6-3.5,3.1-5.6l3.8-10.1H409l-3.8,10.6%20c-1.2,3.4-3.2,5.1-5.8,5.1h-4.8v-0.3c1.3-1.6,2.2-3.4,2.8-5.4l3.8-10.1h-5.5l-3.8,10.2c-1.3,3.7-3.3,5.4-5.9,5.4h-9.5%20c2.8-7.7,1.6-12.9-3.8-15c-0.8-0.3-1.7-0.6-2.5-0.7h-4.8l-1.7,4.7c1.5,0,3,0.1,4.5,0.4c4.3,1,5.4,4.5,3.2,10.6h-16.7l-1.9,5.2h58%20c6.2-0.7,11.3-5,12.9-11l3.7-9.9H422L417.9-13.5z'/%3e%3cpath%20id='Path_26'%20class='st0'%20d='M465-24.1h-13c-7.2,0.3-13.4,5.3-15.4,12.3l-5.7,16.2h5.2l5.6-15.4c1.8-5,5.2-8.1,8.6-8.1h3.8%20c-1.4,1.6-2.6,3.4-3.3,5.4c-2.2,6,0.3,10.7,6.5,10.7c6.4-0.3,12-4.5,14.2-10.6c2.2-6.1-0.2-10.8-6.4-10.8%20M459.2-7.7%20c-3.1,0-4.3-2.7-3-6c0.9-3.2,3.7-5.6,7.1-5.9c3.2,0,4.2,2.6,3,6.1C465.3-10.3,462.5-8,459.2-7.7'/%3e%3cpath%20id='Path_27'%20class='st0'%20d='M524.6-33.4h-5l-1.9,5.1h5L524.6-33.4z'/%3e%3cpath%20id='Path_28'%20class='st0'%20d='M551.8-33.4h-5l-1.8,5.1h5L551.8-33.4z'/%3e%3cpath%20id='Path_29'%20class='st0'%20d='M543.3-24.1l-3.8,10.8c-0.4,1.2-0.9,2.3-1.6,3.3c-1,1.1-2.4,1.6-3.8,1.5h-8.3%20c3.8-10.5,1.6-15.8-6.2-15.8c-4.9,0-10.2,2.5-16.5,8l6.7-16.7h-5.1l-8.9,24.5h-10.6c-1.3,0.2-2.7-0.1-3.8-0.8%20c-0.7-0.7-0.7-2.2,0-4.4l7.1-19.3h-5l-7.7,21.3c-0.9,1.9-1.1,4-0.3,6c1,1.7,2.9,2.7,4.9,2.4h52.9c5.1,0.1,9.6-3.4,10.8-8.4%20l4.6-12.6L543.3-24.1z%20M520.2-8.4h-20.5c5.4-6.4,12.5-11.2,17.6-11.2c4.4,0,5.7,3.8,3.6,9.7c-0.1,0.5-0.3,1-0.6,1.5'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e", Un = () => {
2323
- const { t: A } = Y(), { formattedAmount: t, currency: e, sadadbill: n } = E(q), [r, a] = O(!1), [o, l] = O(!1), { makePayment: c, busy: s, fail: p, success: i, loading: f } = fA({ defaultError: {} }), d = () => {
2324
- c({
2345
+ const { t: A } = Z(), { formattedAmount: t, currency: e, sadadbill: n } = E(q), [r, a] = z(!1), [o, l] = z(!1), { makePayment: i, busy: s, fail: p, success: c, loading: f } = vA({ defaultError: {} }), d = () => {
2346
+ i({
2325
2347
  initPayment: !0,
2326
2348
  data: {
2327
- source: k({
2349
+ source: B({
2328
2350
  type: "sadadbill"
2329
2351
  }, n != null ? n : {})
2330
2352
  }
@@ -2333,10 +2355,10 @@ const kn = () => {
2333
2355
  });
2334
2356
  }, y = () => {
2335
2357
  l(!0);
2336
- }, h = () => {
2358
+ }, b = () => {
2337
2359
  o && (a(!1), l(!1));
2338
2360
  };
2339
- return /* @__PURE__ */ u(j, { children: [
2361
+ return /* @__PURE__ */ u(F, { children: [
2340
2362
  /* @__PURE__ */ u(
2341
2363
  "button",
2342
2364
  {
@@ -2347,11 +2369,11 @@ const kn = () => {
2347
2369
  children: /* @__PURE__ */ u("img", { src: Yt, alt: A("sadad_bill.button"), class: "h-8" })
2348
2370
  }
2349
2371
  ),
2350
- r && /* @__PURE__ */ u(j, { children: [
2372
+ r && /* @__PURE__ */ u(F, { children: [
2351
2373
  /* @__PURE__ */ u(
2352
2374
  "div",
2353
2375
  {
2354
- class: tA([
2376
+ class: rA([
2355
2377
  "fixed inset-0 z-[9] bg-gray-500/75 transition-opacity",
2356
2378
  o ? "animate-fade-out duration-300" : "animate-fade-in duration-200"
2357
2379
  ])
@@ -2360,11 +2382,11 @@ const kn = () => {
2360
2382
  /* @__PURE__ */ u("div", { class: "fixed inset-0 z-10 flex flex-col justify-end md:justify-center", children: /* @__PURE__ */ u(
2361
2383
  "div",
2362
2384
  {
2363
- class: tA([
2385
+ class: rA([
2364
2386
  "flex w-full origin-bottom flex-col gap-4 rounded-t-lg border-neutral-300 bg-slate-100 p-4 shadow transition-all md:mx-auto md:max-w-96 md:rounded-b-lg lg:max-w-screen-sm lg:p-10",
2365
2387
  o ? "animate-dialog-out-mobile duration-200 md:animate-dialog-out" : "animate-dialog-in-mobile duration-300 md:animate-dialog-in"
2366
2388
  ]),
2367
- onAnimationEnd: h,
2389
+ onAnimationEnd: b,
2368
2390
  children: [
2369
2391
  /* @__PURE__ */ u(dt, { inForm: !0 }),
2370
2392
  /* @__PURE__ */ u("div", { class: "flex items-center", children: [
@@ -2373,9 +2395,9 @@ const kn = () => {
2373
2395
  ] }),
2374
2396
  /* @__PURE__ */ u("p", { class: "text-sm leading-5 text-neutral-800/90", children: A("sadad_bill.description") }),
2375
2397
  /* @__PURE__ */ u(
2376
- _A,
2398
+ NA,
2377
2399
  {
2378
- success: i,
2400
+ success: c,
2379
2401
  fail: p,
2380
2402
  busy: s,
2381
2403
  variant: "primary",
@@ -2395,10 +2417,10 @@ const kn = () => {
2395
2417
  ] })
2396
2418
  ] });
2397
2419
  }, En = () => {
2398
- const { t: A } = Y(), { methods: t, apple_pay: e, samsung_pay: n, google_pay: r } = E(q), a = t.includes("stcpay"), o = t.includes("creditcard"), l = t.includes("sadadbill"), c = location.protocol === "https:" && t.includes("applepay") && typeof window.ApplePaySession != "undefined" && ApplePaySession.canMakePayments() && (e == null ? void 0 : e.version) && ApplePaySession.supportsVersion(e == null ? void 0 : e.version), s = !!(n != null && n.service_id), p = !!(r != null && r.merchant_id);
2399
- return !c && !a && !s && !p && !l ? null : /* @__PURE__ */ u("div", { class: "flex w-full flex-col gap-4", role: "main", children: [
2400
- a && /* @__PURE__ */ u(Nn, {}),
2401
- c && /* @__PURE__ */ u(_n, {}),
2420
+ const { t: A } = Z(), { methods: t, apple_pay: e, samsung_pay: n, google_pay: r } = E(q), a = t.includes("stcpay"), o = t.includes("creditcard"), l = t.includes("sadadbill"), i = location.protocol === "https:" && t.includes("applepay") && typeof window.ApplePaySession != "undefined" && ApplePaySession.canMakePayments() && (e == null ? void 0 : e.version) && ApplePaySession.supportsVersion(e == null ? void 0 : e.version), s = !!(n != null && n.service_id), p = !!(r != null && r.merchant_id);
2421
+ return !i && !a && !s && !p && !l ? null : /* @__PURE__ */ u("div", { class: "flex w-full flex-col gap-4", role: "main", children: [
2422
+ a && /* @__PURE__ */ u(_n, {}),
2423
+ i && /* @__PURE__ */ u(Nn, {}),
2402
2424
  s && /* @__PURE__ */ u(On, {}),
2403
2425
  p && /* @__PURE__ */ u(zn, {}),
2404
2426
  l && /* @__PURE__ */ u(Un, {}),
@@ -2417,32 +2439,32 @@ const kn = () => {
2417
2439
  isValid: !t && e && n
2418
2440
  };
2419
2441
  }, Gn = ({ value: A, setValue: t, err: e, setErr: n }) => {
2420
- const { t: r } = Y(), [a, o] = O(!1), l = (p) => {
2421
- const i = p.target.value.trim(), { isEmpty: f, isEnglishOnly: d, isValidFormat: y } = Ce(i);
2442
+ const { t: r } = Z(), [a, o] = z(!1), l = (p) => {
2443
+ const c = p.target.value.trim(), { isEmpty: f, isEnglishOnly: d, isValidFormat: y } = Ce(c);
2422
2444
  if (f) {
2423
- o(!i);
2445
+ o(!c);
2424
2446
  return;
2425
2447
  }
2426
2448
  if (!d) {
2427
- n((h) => L(k({}, h), { name: "validation.should_be_english_letters_only" }));
2449
+ n((b) => N(B({}, b), { name: "validation.should_be_english_letters_only" }));
2428
2450
  return;
2429
2451
  }
2430
2452
  if (!y) {
2431
- n((h) => L(k({}, h), { name: "validation.first_and_last_name_required" }));
2453
+ n((b) => N(B({}, b), { name: "validation.first_and_last_name_required" }));
2432
2454
  return;
2433
2455
  }
2434
- o(!1), n((h) => L(k({}, h), { name: "" }));
2435
- }, c = (p) => {
2436
- const i = p.target, { value: f } = i;
2456
+ o(!1), n((b) => N(B({}, b), { name: "" }));
2457
+ }, i = (p) => {
2458
+ const c = p.target, { value: f } = c;
2437
2459
  t(f);
2438
- }, s = dA(l, 1e3);
2460
+ }, s = mA(l, 1e3);
2439
2461
  return /* @__PURE__ */ u("div", { class: "space-y-2", role: "complementary", "aria-label": r("form.name_on_card"), children: [
2440
2462
  /* @__PURE__ */ u("div", { class: "flex items-end justify-between text-xs font-medium", children: [
2441
2463
  /* @__PURE__ */ u("label", { for: "mysr-cc-name", children: r("form.name_on_card") }),
2442
2464
  a && /* @__PURE__ */ u("span", { class: "uppercase text-error", children: r("form.required") })
2443
2465
  ] }),
2444
2466
  /* @__PURE__ */ u(
2445
- pA,
2467
+ fA,
2446
2468
  {
2447
2469
  name: "mysr-cc-name",
2448
2470
  placeholder: r("form.name_on_card"),
@@ -2452,9 +2474,9 @@ const kn = () => {
2452
2474
  dir: "ltr",
2453
2475
  value: A,
2454
2476
  onKeyUp: (p) => {
2455
- c(p), s(p);
2477
+ i(p), s(p);
2456
2478
  },
2457
- onChange: c
2479
+ onChange: i
2458
2480
  }
2459
2481
  ),
2460
2482
  e.name && /* @__PURE__ */ u("p", { class: "text-xs font-medium text-error", children: r(e.name) })
@@ -2465,15 +2487,15 @@ const kn = () => {
2465
2487
  isValid: e,
2466
2488
  msg: e ? "" : "error.invalid_csc"
2467
2489
  };
2468
- }, GA = ct({}), Jn = ({ setValue: A }) => {
2469
- const { t } = Y(), { handleBlur: e, err: n } = E(GA), r = "** / **", a = (l) => {
2470
- const c = l.target, { value: s } = c;
2490
+ }, GA = it({}), Jn = ({ setValue: A }) => {
2491
+ const { t } = Z(), { handleBlur: e, err: n } = E(GA), r = "** / **", a = (l) => {
2492
+ const i = l.target, { value: s } = i;
2471
2493
  A(s);
2472
- }, o = dA(e, 1e3);
2494
+ }, o = mA(e, 1e3);
2473
2495
  return V(() => {
2474
2496
  new EA('[name="mysr-cc-exp"]');
2475
2497
  }, []), /* @__PURE__ */ u(
2476
- pA,
2498
+ fA,
2477
2499
  {
2478
2500
  "aria-label": t("form.date"),
2479
2501
  name: "mysr-cc-exp",
@@ -2492,12 +2514,12 @@ const kn = () => {
2492
2514
  }
2493
2515
  );
2494
2516
  }, xn = ({ value: A, setValue: t }) => {
2495
- const { t: e } = Y(), { handleBlur: n, err: r, config: a } = E(GA), o = (c) => {
2496
- const s = c.target, { value: p } = s;
2517
+ const { t: e } = Z(), { handleBlur: n, err: r, config: a } = E(GA), o = (i) => {
2518
+ const s = i.target, { value: p } = s;
2497
2519
  t(p);
2498
- }, l = dA(n, 1e3);
2520
+ }, l = mA(n, 1e3);
2499
2521
  return /* @__PURE__ */ u(
2500
- pA,
2522
+ fA,
2501
2523
  {
2502
2524
  "aria-label": e("form.csc"),
2503
2525
  name: "mysr-cc-csc",
@@ -2508,8 +2530,8 @@ const kn = () => {
2508
2530
  inputMode: "numeric",
2509
2531
  maxLength: a.csc,
2510
2532
  value: A,
2511
- onKeyUp: (c) => {
2512
- o(c), l(c);
2533
+ onKeyUp: (i) => {
2534
+ o(i), l(i);
2513
2535
  },
2514
2536
  error: r.csc
2515
2537
  }
@@ -2530,16 +2552,16 @@ const kn = () => {
2530
2552
  getCardSchema: t
2531
2553
  };
2532
2554
  }, Vn = ({ value: A, setValue: t }) => {
2533
- const { t: e } = Y(), { handleBlur: n, err: r, setType: a } = E(GA), { getCardSchema: o } = ft(), l = (s) => {
2534
- const p = s.target, { value: i } = p;
2535
- t(i), a(o(i));
2536
- }, c = dA(n, 1e3);
2555
+ const { t: e } = Z(), { handleBlur: n, err: r, setType: a } = E(GA), { getCardSchema: o } = ft(), l = (s) => {
2556
+ const p = s.target, { value: c } = p;
2557
+ t(c), a(o(c));
2558
+ }, i = mA(n, 1e3);
2537
2559
  return V(() => {
2538
2560
  new EA('[name="mysr-cc-number"]', {
2539
2561
  mask: (s) => Me(s) ? "#### ###### #####" : "#### #### #### ####"
2540
2562
  });
2541
2563
  }, []), /* @__PURE__ */ u(
2542
- pA,
2564
+ fA,
2543
2565
  {
2544
2566
  "aria-label": e("form.cc"),
2545
2567
  name: "mysr-cc-number",
@@ -2550,7 +2572,7 @@ const kn = () => {
2550
2572
  inputMode: "numeric",
2551
2573
  value: A,
2552
2574
  onKeyUp: (s) => {
2553
- l(s), c(s);
2575
+ l(s), i(s);
2554
2576
  },
2555
2577
  onChange: l,
2556
2578
  error: r.cc
@@ -2648,28 +2670,28 @@ const kn = () => {
2648
2670
  isValidCc: t
2649
2671
  };
2650
2672
  }, $n = ({ cc: A, setCc: t, cvc: e, setCvc: n, exp: r, setExp: a, err: o, setErr: l }) => {
2651
- const { t: c } = Y(), [s, p] = O(!1), [i, f] = O(""), { isValidCc: d } = Xe(), y = de(() => Se(i), [i]), h = (v) => {
2652
- const { value: m, name: g } = v.target, M = W(m.trim());
2653
- if (!M) {
2654
- p(!M);
2673
+ const { t: i } = Z(), [s, p] = z(!1), [c, f] = z(""), { isValidCc: d } = Xe(), y = de(() => Se(c), [c]), b = (v) => {
2674
+ const { value: m, name: g } = v.target, D = W(m.trim());
2675
+ if (!D) {
2676
+ p(!D);
2655
2677
  return;
2656
2678
  }
2657
2679
  if (g === "mysr-cc-csc") {
2658
- const { msg: C } = De(M, i);
2659
- l((w) => L(k({}, w), {
2660
- csc: C
2680
+ const { msg: w } = De(D, c);
2681
+ l((C) => N(B({}, C), {
2682
+ csc: w
2661
2683
  }));
2662
2684
  }
2663
2685
  if (g === "mysr-cc-exp") {
2664
- const { isValidExpFormat: C, isValidYear: w, inValidMonth: D } = Pe(M);
2665
- l((B) => L(k({}, B), {
2666
- exp_month: D ? "" : "error.invalid_month",
2667
- exp_year: w ? "" : "error.invalid_year",
2668
- exp: C ? "" : "error.invalid_date"
2686
+ const { isValidExpFormat: w, isValidYear: C, inValidMonth: M } = Pe(D);
2687
+ l((k) => N(B({}, k), {
2688
+ exp_month: M ? "" : "error.invalid_month",
2689
+ exp_year: C ? "" : "error.invalid_year",
2690
+ exp: w ? "" : "error.invalid_date"
2669
2691
  }));
2670
2692
  }
2671
- g === "mysr-cc-number" && l((C) => L(k({}, C), {
2672
- cc: i === "" ? "error.unsupported_cc_type" : d(M) ? "" : "error.invalid_cc_number"
2693
+ g === "mysr-cc-number" && l((w) => N(B({}, w), {
2694
+ cc: c === "" ? "error.unsupported_cc_type" : d(D) ? "" : "error.invalid_cc_number"
2673
2695
  }));
2674
2696
  };
2675
2697
  return V(() => {
@@ -2680,28 +2702,28 @@ const kn = () => {
2680
2702
  value: {
2681
2703
  err: o,
2682
2704
  setErr: l,
2683
- handleBlur: h,
2684
- type: i,
2705
+ handleBlur: b,
2706
+ type: c,
2685
2707
  setType: f,
2686
2708
  config: y()
2687
2709
  },
2688
- children: /* @__PURE__ */ u("div", { class: "space-y-2", role: "complementary", "aria-label": c("form.card_info"), children: [
2710
+ children: /* @__PURE__ */ u("div", { class: "space-y-2", role: "complementary", "aria-label": i("form.card_info"), children: [
2689
2711
  /* @__PURE__ */ u("div", { class: "flex items-end justify-between text-xs font-medium", children: [
2690
- /* @__PURE__ */ u("legend", { children: c("form.card_info") }),
2691
- s && /* @__PURE__ */ u("span", { class: "uppercase text-error", children: c("form.required") })
2712
+ /* @__PURE__ */ u("legend", { children: i("form.card_info") }),
2713
+ s && /* @__PURE__ */ u("span", { class: "uppercase text-error", children: i("form.required") })
2692
2714
  ] }),
2693
2715
  /* @__PURE__ */ u("div", { class: "relative grid grid-cols-2 gap-y-[1px]", dir: "ltr", children: [
2694
2716
  /* @__PURE__ */ u(Vn, { value: A, setValue: t }),
2695
- /* @__PURE__ */ u(jn, { type: i }),
2717
+ /* @__PURE__ */ u(jn, { type: c }),
2696
2718
  /* @__PURE__ */ u(Jn, { value: r, setValue: a }),
2697
2719
  /* @__PURE__ */ u(xn, { value: e, setValue: n })
2698
2720
  ] }),
2699
- /* @__PURE__ */ u("p", { class: "flex flex-col gap-2 text-xs font-medium text-error", children: Object.entries(o).filter(([v]) => v !== "name").map(([v, m]) => /* @__PURE__ */ u("span", { class: "empty:hidden", children: c(m) }, v)) })
2721
+ /* @__PURE__ */ u("p", { class: "flex flex-col gap-2 text-xs font-medium text-error", children: Object.entries(o).filter(([v]) => v !== "name").map(([v, m]) => /* @__PURE__ */ u("span", { class: "empty:hidden", children: i(m) }, v)) })
2700
2722
  ] })
2701
2723
  }
2702
2724
  );
2703
2725
  }, Ar = () => {
2704
- const { t: A } = Y(), {
2726
+ const { t: A } = Z(), {
2705
2727
  formattedAmount: t,
2706
2728
  isRtl: e,
2707
2729
  credit_card: n,
@@ -2709,7 +2731,7 @@ const kn = () => {
2709
2731
  callback_url: a,
2710
2732
  payment_button_type: o,
2711
2733
  currency: l
2712
- } = E(q), [c, s] = O(""), [p, i] = O(""), [f, d] = O(""), [y, h] = O(""), { getCardSchema: v } = ft(), { isValidCc: m } = Xe(), g = {
2734
+ } = E(q), [i, s] = z(""), [p, c] = z(""), [f, d] = z(""), [y, b] = z(""), { getCardSchema: v } = ft(), { isValidCc: m } = Xe(), g = {
2713
2735
  name: "",
2714
2736
  csc: "",
2715
2737
  cc: "",
@@ -2717,65 +2739,65 @@ const kn = () => {
2717
2739
  exp_month: "",
2718
2740
  exp_year: ""
2719
2741
  }, {
2720
- makePayment: M,
2721
- busy: C,
2722
- fail: w,
2723
- success: D,
2724
- loading: B,
2725
- error: I,
2726
- setError: X
2727
- } = fA({ defaultError: g });
2728
- return /* @__PURE__ */ u("form", { class: "space-y-6", onSubmit: (Q) => {
2729
- Q.preventDefault();
2730
- const { isValid: N } = Ce(c), z = W(p), Z = W(y), lA = W(f), mA = v(z), sA = m(z, mA), { isValid: vA } = De(lA, mA), { isValid: DA } = Pe(Z);
2731
- if (!N || !sA || !vA || !DA) {
2732
- const F = k({}, g);
2733
- N || (F.name = A("error.invalid_name")), sA || (F.cc = A("error.invalid_cc_number")), vA || (F.csc = A("error.invalid_csc")), DA || (F.exp = A("error.invalid_date")), X(F);
2742
+ makePayment: D,
2743
+ busy: w,
2744
+ fail: C,
2745
+ success: M,
2746
+ loading: k,
2747
+ error: Q,
2748
+ setError: P
2749
+ } = vA({ defaultError: g });
2750
+ return /* @__PURE__ */ u("form", { class: "space-y-6", onSubmit: (X) => {
2751
+ X.preventDefault();
2752
+ const { isValid: _ } = Ce(i), T = W(p), Y = W(y), $ = W(f), oA = v(T), K = m(T, oA), { isValid: eA } = De($, oA), { isValid: DA } = Pe(Y);
2753
+ if (!_ || !K || !eA || !DA) {
2754
+ const AA = B({}, g);
2755
+ _ || (AA.name = A("error.invalid_name")), K || (AA.cc = A("error.invalid_cc_number")), eA || (AA.csc = A("error.invalid_csc")), DA || (AA.exp = A("error.invalid_date")), P(AA);
2734
2756
  return;
2735
2757
  }
2736
- const [xA, J] = Z.split("/"), _ = {
2758
+ const [xA, J] = Y.split("/"), I = {
2737
2759
  type: "creditcard",
2738
- name: c,
2739
- number: z,
2760
+ name: i,
2761
+ number: T,
2740
2762
  month: xA,
2741
2763
  year: J,
2742
- cvc: lA
2764
+ cvc: $
2743
2765
  };
2744
- n != null && n.manual && (_.manual = !0), n != null && n.save_card && (_.save_card = !0), r && (_.statement_descriptor = r);
2745
- function K(F) {
2746
- const { transaction_url: mt } = F.source;
2766
+ n != null && n.manual && (I.manual = !0), n != null && n.save_card && (I.save_card = !0), r && (I.statement_descriptor = r);
2767
+ function H(AA) {
2768
+ const { transaction_url: mt } = AA.source;
2747
2769
  mt && (n == null ? void 0 : n.auto_redirect_3ds) !== !1 && (window.location.href = mt);
2748
2770
  }
2749
- function nA(F) {
2750
- console.error(F);
2771
+ function lA(AA) {
2772
+ console.error(AA);
2751
2773
  }
2752
- M({
2774
+ D({
2753
2775
  data: {
2754
2776
  callback_url: a,
2755
- source: _
2777
+ source: I
2756
2778
  },
2757
2779
  initPayment: !0,
2758
- onFailed: nA,
2759
- onSuccess: K
2760
- }).catch((F) => {
2761
- console.error(F);
2780
+ onFailed: lA,
2781
+ onSuccess: H
2782
+ }).catch((AA) => {
2783
+ console.error(AA);
2762
2784
  });
2763
2785
  }, children: [
2764
- /* @__PURE__ */ u(Gn, { value: c, setValue: s, err: I, setErr: X }),
2786
+ /* @__PURE__ */ u(Gn, { value: i, setValue: s, err: Q, setErr: P }),
2765
2787
  /* @__PURE__ */ u(
2766
2788
  $n,
2767
2789
  {
2768
2790
  cc: p,
2769
- setCc: i,
2791
+ setCc: c,
2770
2792
  cvc: f,
2771
2793
  setCvc: d,
2772
2794
  exp: y,
2773
- setExp: h,
2774
- err: I,
2775
- setErr: X
2795
+ setExp: b,
2796
+ err: Q,
2797
+ setErr: P
2776
2798
  }
2777
2799
  ),
2778
- /* @__PURE__ */ u(_A, { type: "submit", disabled: B, success: D, fail: w, busy: C, children: /* @__PURE__ */ u(j, { children: [
2800
+ /* @__PURE__ */ u(NA, { type: "submit", disabled: k, success: M, fail: C, busy: w, children: /* @__PURE__ */ u(F, { children: [
2779
2801
  (o !== "plain" || !e) && A(`button.${o}`),
2780
2802
  " ",
2781
2803
  /* @__PURE__ */ u("span", { class: "currency-amount", children: /* @__PURE__ */ u(ut, { currency: l, formattedAmount: t }) })
@@ -2826,14 +2848,14 @@ function tr(A, t) {
2826
2848
  }
2827
2849
  A.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e());
2828
2850
  }
2829
- var R = function() {
2830
- return R = Object.assign || function(t) {
2851
+ var j = function() {
2852
+ return j = Object.assign || function(t) {
2831
2853
  for (var e, n = 1, r = arguments.length; n < r; n++) {
2832
2854
  e = arguments[n];
2833
2855
  for (var a in e) Object.prototype.hasOwnProperty.call(e, a) && (t[a] = e[a]);
2834
2856
  }
2835
2857
  return t;
2836
- }, R.apply(this, arguments);
2858
+ }, j.apply(this, arguments);
2837
2859
  };
2838
2860
  function JA(A, t, e, n) {
2839
2861
  function r(a) {
@@ -2845,19 +2867,19 @@ function JA(A, t, e, n) {
2845
2867
  function l(p) {
2846
2868
  try {
2847
2869
  s(n.next(p));
2848
- } catch (i) {
2849
- o(i);
2870
+ } catch (c) {
2871
+ o(c);
2850
2872
  }
2851
2873
  }
2852
- function c(p) {
2874
+ function i(p) {
2853
2875
  try {
2854
2876
  s(n.throw(p));
2855
- } catch (i) {
2856
- o(i);
2877
+ } catch (c) {
2878
+ o(c);
2857
2879
  }
2858
2880
  }
2859
2881
  function s(p) {
2860
- p.done ? a(p.value) : r(p.value).then(l, c);
2882
+ p.done ? a(p.value) : r(p.value).then(l, i);
2861
2883
  }
2862
2884
  s((n = n.apply(A, t || [])).next());
2863
2885
  });
@@ -2872,10 +2894,10 @@ function CA(A, t) {
2872
2894
  }), o;
2873
2895
  function l(s) {
2874
2896
  return function(p) {
2875
- return c([s, p]);
2897
+ return i([s, p]);
2876
2898
  };
2877
2899
  }
2878
- function c(s) {
2900
+ function i(s) {
2879
2901
  if (n) throw new TypeError("Generator is already executing.");
2880
2902
  for (; o && (o = 0, s[0] && (e = 0)), e; ) try {
2881
2903
  if (n = 1, r && (a = s[0] & 2 ? r.return : s[0] ? r.throw || ((a = r.return) && a.call(r), 0) : r.next) && !(a = a.call(r, s[1])).done) return a;
@@ -3058,13 +3080,13 @@ var or = function() {
3058
3080
  }, o.open("POST", e.url.replace(l, (a = window == null ? void 0 : window.location) === null || a === void 0 ? void 0 : a.protocol)), setTimeout(function() {
3059
3081
  try {
3060
3082
  o.send(t);
3061
- } catch (c) {
3062
- r(c);
3083
+ } catch (i) {
3084
+ r(i);
3063
3085
  }
3064
3086
  }, 0);
3065
3087
  });
3066
3088
  }, A;
3067
- }(), cr = function() {
3089
+ }(), ir = function() {
3068
3090
  function A(t) {
3069
3091
  this.url = t;
3070
3092
  }
@@ -3081,7 +3103,7 @@ var or = function() {
3081
3103
  }
3082
3104
  });
3083
3105
  }, A;
3084
- }(), ir = function() {
3106
+ }(), cr = function() {
3085
3107
  function A(t, e) {
3086
3108
  this.url = t;
3087
3109
  }
@@ -3116,8 +3138,8 @@ var or = function() {
3116
3138
  return new Promise(function(r, a) {
3117
3139
  e.https.then(function(o) {
3118
3140
  var l = o.request(e.url, n, function() {
3119
- }).on("error", function(c) {
3120
- return a(c);
3141
+ }).on("error", function(i) {
3142
+ return a(i);
3121
3143
  });
3122
3144
  l.write(t), l.end(), r({});
3123
3145
  }).catch(function(o) {
@@ -3145,11 +3167,11 @@ var or = function() {
3145
3167
  case "XDomainRequest":
3146
3168
  return new sr(t);
3147
3169
  case "XMLHttpRequest":
3148
- return new cr(t);
3170
+ return new ir(t);
3149
3171
  case "NodeHTTP":
3150
3172
  return new ur(t);
3151
3173
  default:
3152
- return new ir(t);
3174
+ return new cr(t);
3153
3175
  }
3154
3176
  }, A.prototype._url = function() {
3155
3177
  var t = this._authorization();
@@ -3163,7 +3185,7 @@ var or = function() {
3163
3185
  }(), PA = function(A) {
3164
3186
  tr(t, A);
3165
3187
  function t(e) {
3166
- return A.call(this, R({ timestamp: Math.round((/* @__PURE__ */ new Date()).getTime() / 1e3), namespace: "frontend", error: {
3188
+ return A.call(this, j({ timestamp: Math.round((/* @__PURE__ */ new Date()).getTime() / 1e3), namespace: "frontend", error: {
3167
3189
  name: "NullError",
3168
3190
  message: "No error has been set",
3169
3191
  backtrace: []
@@ -3180,13 +3202,13 @@ var or = function() {
3180
3202
  backtrace: rr(e)
3181
3203
  }, this);
3182
3204
  }, t.prototype.setTags = function(e) {
3183
- return this._data.tags = R(R({}, this._data.tags), er(e)), this;
3205
+ return this._data.tags = j(j({}, this._data.tags), er(e)), this;
3184
3206
  }, t.prototype.setParams = function(e) {
3185
- return this._data.params = R(R({}, this._data.params), e), this;
3207
+ return this._data.params = j(j({}, this._data.params), e), this;
3186
3208
  }, t.prototype.setBreadcrumbs = function(e) {
3187
3209
  return this._data.breadcrumbs = e, this;
3188
3210
  }, t.prototype.setEnvironment = function(e) {
3189
- return this._data.environment = R(R({}, this._data.environment), e), this;
3211
+ return this._data.environment = j(j({}, this._data.environment), e), this;
3190
3212
  }, t.prototype.cleanBacktracePath = function(e) {
3191
3213
  if (e.length === 0)
3192
3214
  return this;
@@ -3198,10 +3220,10 @@ var or = function() {
3198
3220
  if (!l)
3199
3221
  return r;
3200
3222
  try {
3201
- for (var c = Te(e), s = c.next(); !s.done; s = c.next()) {
3202
- var p = s.value, i = l.match(p);
3203
- if (!(!i || i.length < 2)) {
3204
- var f = i.slice(1).join("");
3223
+ for (var i = Te(e), s = i.next(); !s.done; s = i.next()) {
3224
+ var p = s.value, c = l.match(p);
3225
+ if (!(!c || c.length < 2)) {
3226
+ var f = c.slice(1).join("");
3205
3227
  if (f)
3206
3228
  return n++, r.replace(l, f);
3207
3229
  }
@@ -3210,7 +3232,7 @@ var or = function() {
3210
3232
  a = { error: d };
3211
3233
  } finally {
3212
3234
  try {
3213
- s && !s.done && (o = c.return) && o.call(c);
3235
+ s && !s.done && (o = i.return) && o.call(i);
3214
3236
  } finally {
3215
3237
  if (a) throw a.error;
3216
3238
  }
@@ -3258,40 +3280,40 @@ var fr = function() {
3258
3280
  }, A;
3259
3281
  }(), mr = function() {
3260
3282
  function A(t, e, n) {
3261
- this._retries = 0, this._timerID = 0, this._duration = 0, this._api = e, this._queue = t, this.options = R({ limit: 5, initialDuration: 1e3 }, n), this.reset();
3283
+ this._retries = 0, this._timerID = 0, this._duration = 0, this._api = e, this._queue = t, this.options = j({ limit: 5, initialDuration: 1e3 }, n), this.reset();
3262
3284
  }
3263
3285
  return A.prototype.schedule = function(t) {
3264
3286
  var e = this;
3265
3287
  t === void 0 && (t = this._duration);
3266
3288
  var n = QA(), r = 1.3, a = function() {
3267
3289
  return JA(e, void 0, void 0, function() {
3268
- var o, l, c, s, p, i, f;
3290
+ var o, l, i, s, p, c, f;
3269
3291
  return CA(this, function(d) {
3270
3292
  switch (d.label) {
3271
3293
  case 0:
3272
3294
  d.trys.push([0, 7, 8, 9]), o = Te(this._queue.drain()), l = o.next(), d.label = 1;
3273
3295
  case 1:
3274
3296
  if (l.done) return [3, 6];
3275
- if (c = l.value, !c)
3297
+ if (i = l.value, !i)
3276
3298
  return [2];
3277
3299
  d.label = 2;
3278
3300
  case 2:
3279
- return d.trys.push([2, 4, , 5]), [4, this._api.push(c)];
3301
+ return d.trys.push([2, 4, , 5]), [4, this._api.push(i)];
3280
3302
  case 3:
3281
3303
  return d.sent(), [3, 5];
3282
3304
  case 4:
3283
- return d.sent(), s = Math.floor(Math.pow(t, r)), this._retries = this._retries - 1, this._retries === 0 ? this.reset() : (this._queue.push(c), this._timerID = this.schedule(s)), [2];
3305
+ return d.sent(), s = Math.floor(Math.pow(t, r)), this._retries = this._retries - 1, this._retries === 0 ? this.reset() : (this._queue.push(i), this._timerID = this.schedule(s)), [2];
3284
3306
  case 5:
3285
3307
  return l = o.next(), [3, 1];
3286
3308
  case 6:
3287
3309
  return [3, 9];
3288
3310
  case 7:
3289
- return p = d.sent(), i = { error: p }, [3, 9];
3311
+ return p = d.sent(), c = { error: p }, [3, 9];
3290
3312
  case 8:
3291
3313
  try {
3292
3314
  l && !l.done && (f = o.return) && f.call(o);
3293
3315
  } finally {
3294
- if (i) throw i.error;
3316
+ if (c) throw c.error;
3295
3317
  }
3296
3318
  return [7];
3297
3319
  case 9:
@@ -3316,10 +3338,10 @@ var fr = function() {
3316
3338
  key: n,
3317
3339
  uri: r,
3318
3340
  version: this.VERSION
3319
- }), o && Array.isArray(o) && (this.ignored = o.filter(function(c) {
3320
- return c instanceof RegExp;
3321
- }).map(Ht)), l && (Array.isArray(l) ? this.matchBacktracePaths = l : this.matchBacktracePaths = [l], this.matchBacktracePaths = this.matchBacktracePaths.filter(function(c) {
3322
- return c instanceof RegExp;
3341
+ }), o && Array.isArray(o) && (this.ignored = o.filter(function(i) {
3342
+ return i instanceof RegExp;
3343
+ }).map(Ht)), l && (Array.isArray(l) ? this.matchBacktracePaths = l : this.matchBacktracePaths = [l], this.matchBacktracePaths = this.matchBacktracePaths.filter(function(i) {
3344
+ return i instanceof RegExp;
3323
3345
  }).map(Ht)), this._dispatcher = new mr(this._queue, this._api), this._options = t;
3324
3346
  }
3325
3347
  return A.prototype.send = function(t, e, n) {
@@ -3349,8 +3371,8 @@ var fr = function() {
3349
3371
  var l = a instanceof PA ? a : this._createSpanFromError(a);
3350
3372
  if (this._hooks.decorators.length > 0 && Zt.apply(void 0, OA([], IA(this._hooks.decorators), !1))(l), e)
3351
3373
  if (typeof e == "function") {
3352
- var c = e;
3353
- c(l);
3374
+ var i = e;
3375
+ i(l);
3354
3376
  } else {
3355
3377
  console.warn("[APPSIGNAL]: DEPRECATED: Calling the `send`/`sendError` function with a tags object is deprecated. Use the callback argument instead.");
3356
3378
  var s = Kt(e) || {};
@@ -3412,7 +3434,7 @@ var fr = function() {
3412
3434
  demo_sample: "true"
3413
3435
  }), this.send(t);
3414
3436
  }, A.prototype.addBreadcrumb = function(t) {
3415
- var e = R(R({ timestamp: Math.round((/* @__PURE__ */ new Date()).getTime() / 1e3) }, t), { metadata: Kt(t.metadata) });
3437
+ var e = j(j({ timestamp: Math.round((/* @__PURE__ */ new Date()).getTime() / 1e3) }, t), { metadata: Kt(t.metadata) });
3416
3438
  if (!e.category) {
3417
3439
  console.warn("[APPSIGNAL]: Breadcrumb not added. `category` is missing.");
3418
3440
  return;
@@ -3432,7 +3454,7 @@ function Ht(A) {
3432
3454
  }
3433
3455
  const gr = new vr({
3434
3456
  key: "95fc54a8-f3ef-454c-b93d-e7e765de19f0",
3435
- revision: it
3457
+ revision: ct
3436
3458
  });
3437
3459
  var hr = /* @__PURE__ */ function() {
3438
3460
  var A = function(t, e) {
@@ -3466,29 +3488,29 @@ var hr = /* @__PURE__ */ function() {
3466
3488
  return e.state = { error: void 0 }, e;
3467
3489
  }
3468
3490
  return t.prototype.componentDidCatch = function(e, n) {
3469
- var r = this.props, a = r.instance, o = r.action, l = r.tags, c = e.name, s = e.message, p = e.stack, i = a.createSpan();
3470
- i.setError({
3471
- name: c,
3491
+ var r = this.props, a = r.instance, o = r.action, l = r.tags, i = e.name, s = e.message, p = e.stack, c = a.createSpan();
3492
+ c.setError({
3493
+ name: i,
3472
3494
  message: s,
3473
3495
  stack: p
3474
- }).setTags(et({ framework: "Preact" }, l)), o && o !== "" && i.setAction(o), a.send(i), this.setState({ error: e });
3496
+ }).setTags(et({ framework: "Preact" }, l)), o && o !== "" && c.setAction(o), a.send(c), this.setState({ error: e });
3475
3497
  }, t.prototype.render = function() {
3476
3498
  return this.state.error ? this.props.fallback ? this.props.fallback(this.state.error) : null : this.props.children;
3477
3499
  }, t.defaultProps = {
3478
3500
  action: ""
3479
3501
  }, t;
3480
- }(AA);
3502
+ }(nA);
3481
3503
  let nt = null;
3482
3504
  function wr(A) {
3483
3505
  nt = A;
3484
3506
  }
3485
3507
  const br = () => /* @__PURE__ */ u("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__ */ u("h2", { class: "mb-4 text-center text-xl font-medium", children: "Something went wrong" }) });
3486
3508
  function rt(A, t) {
3487
- const e = uA[t] || uA.default;
3509
+ const e = dA[t] || dA.default;
3488
3510
  return e === 0 ? A : parseFloat((A / yt(10, e)).toFixed(e));
3489
3511
  }
3490
3512
  function Rt(A, t) {
3491
- const e = uA[t] || uA.default, n = rt(A, t);
3513
+ const e = dA[t] || dA.default, n = rt(A, t);
3492
3514
  let r = new Intl.NumberFormat("en", {
3493
3515
  style: "currency",
3494
3516
  currency: t,
@@ -3498,31 +3520,31 @@ function Rt(A, t) {
3498
3520
  return ["SAR", "AED"].includes(t) && (r = r.replace(t, "").trim()), r;
3499
3521
  }
3500
3522
  function Cr({ config: A }) {
3501
- const { amount: t, currency: e, language: n, translations: r, publishable_api_key: a } = A, o = document.documentElement.dir === "rtl" || n === "ar", l = uA[e] || uA.default, c = rt(t, e), s = Rt(t, e), [p, i] = O(L(k({
3502
- version: it
3523
+ const { amount: t, currency: e, language: n, translations: r, publishable_api_key: a } = A, o = document.documentElement.dir === "rtl" || n === "ar", l = dA[e] || dA.default, i = rt(t, e), s = Rt(t, e), [p, c] = z(N(B({
3524
+ version: ct
3503
3525
  }, A), {
3504
3526
  translations: He(r),
3505
3527
  formattedAmount: s,
3506
- decimalAmount: c.toFixed(l).toString(),
3528
+ decimalAmount: i.toFixed(l).toString(),
3507
3529
  isProcessing: !1,
3508
3530
  isRtl: o,
3509
3531
  showForm: !1,
3510
3532
  isTestMode: (a == null ? void 0 : a.startsWith("pk_test")) || location.protocol === "http:"
3511
3533
  }));
3512
- wr(i), V(() => {
3513
- i((y) => L(k({}, y), {
3534
+ wr(c), V(() => {
3535
+ c((y) => N(B({}, y), {
3514
3536
  amount: p.amount,
3515
3537
  formattedAmount: Rt(p.amount, p.currency),
3516
3538
  decimalAmount: rt(p.amount, p.currency).toFixed(l).toString()
3517
3539
  }));
3518
3540
  }, [p.amount]);
3519
- const [f, d] = O({
3541
+ const [f, d] = z({
3520
3542
  samsung: !A.samsung_pay,
3521
3543
  google: !A.google_pay,
3522
3544
  apple: !A.apple_pay
3523
3545
  });
3524
3546
  return V(() => {
3525
- var h, v;
3547
+ var b, v;
3526
3548
  const y = (m, g) => {
3527
3549
  document.body.append(
3528
3550
  Object.assign(document.createElement("script"), {
@@ -3533,19 +3555,19 @@ function Cr({ config: A }) {
3533
3555
  };
3534
3556
  !window.SamsungPay && A.samsung_pay && y(
3535
3557
  "https://img.mpay.samsung.com/gsmpi/sdk/samsungpay_web_sdk.js",
3536
- () => d((m) => L(k({}, m), { samsung: !0 }))
3537
- ), !((v = (h = window.google) == null ? void 0 : h.payments) != null && v.api) && A.google_pay && y(
3558
+ () => d((m) => N(B({}, m), { samsung: !0 }))
3559
+ ), !((v = (b = window.google) == null ? void 0 : b.payments) != null && v.api) && A.google_pay && y(
3538
3560
  "https://pay.google.com/gp/p/js/pay.js",
3539
- () => d((m) => L(k({}, m), { google: !0 }))
3561
+ () => d((m) => N(B({}, m), { google: !0 }))
3540
3562
  ), A.apple_pay && y(
3541
3563
  "https://applepay.cdn-apple.com/jsapi/1.latest/apple-pay-sdk.js",
3542
- () => d((m) => L(k({}, m), { apple: !0 }))
3564
+ () => d((m) => N(B({}, m), { apple: !0 }))
3543
3565
  );
3544
3566
  }, []), /* @__PURE__ */ u(
3545
3567
  q.Provider,
3546
3568
  {
3547
- value: L(k({}, p), {
3548
- setFormSettings: i,
3569
+ value: N(B({}, p), {
3570
+ setFormSettings: c,
3549
3571
  scriptsLoaded: f
3550
3572
  }),
3551
3573
  children: /* @__PURE__ */ u(
@@ -3557,7 +3579,7 @@ function Cr({ config: A }) {
3557
3579
  children: /* @__PURE__ */ u("div", { id: "mysr", children: /* @__PURE__ */ u(
3558
3580
  "div",
3559
3581
  {
3560
- class: tA([
3582
+ class: rA([
3561
3583
  "box-border flex w-full min-w-60 flex-col gap-4 text-base leading-4 text-black/90",
3562
3584
  A.fixed_width && "md:mx-auto md:max-w-80"
3563
3585
  ]),
@@ -3599,87 +3621,89 @@ const Dr = {
3599
3621
  };
3600
3622
  function jt(A, t, e) {
3601
3623
  if (typeof t != "object" || t === null || Array.isArray(t)) {
3602
- b(`\`${A}\` must be an object`);
3624
+ h(`\`${A}\` must be an object`);
3603
3625
  return;
3604
3626
  }
3605
3627
  const n = t;
3606
3628
  for (const r of Object.keys(n))
3607
- Object.prototype.hasOwnProperty.call(e, r) || b(`\`${A}.${r}\` is not a supported field`);
3629
+ Object.prototype.hasOwnProperty.call(e, r) || h(`\`${A}.${r}\` is not a supported field`);
3608
3630
  for (const [r, a] of Object.entries(e)) {
3609
3631
  const o = n[r], l = typeof o == "string" ? o.trim() : o;
3610
3632
  if (l == null || l === "") {
3611
3633
  a.required && x(`${A}.${r}`);
3612
3634
  continue;
3613
3635
  }
3614
- typeof l != "string" && b(`\`${A}.${r}\` must be a string`), typeof l == "string" && a.max !== void 0 && l.length > a.max && b(`\`${A}.${r}\` must be at most ${a.max} characters`);
3636
+ typeof l != "string" && h(`\`${A}.${r}\` must be a string`), typeof l == "string" && a.max !== void 0 && l.length > a.max && h(`\`${A}.${r}\` must be at most ${a.max} characters`);
3615
3637
  }
3616
3638
  }
3617
3639
  const kr = (A) => {
3618
3640
  var n;
3619
3641
  if (!A.sender && !A.recipient)
3620
3642
  return !0;
3621
- (!A.sender || !A.recipient) && b("`sender` and `recipient` must be provided together for AFT payments");
3643
+ (!A.sender || !A.recipient) && h("`sender` and `recipient` must be provided together for AFT payments");
3622
3644
  const e = [...(n = A.methods) != null ? n : [], ...A.google_pay ? ["googlepay"] : []].filter((r) => !$A.includes(r));
3623
- return e.length > 0 && b(
3645
+ return e.length > 0 && h(
3624
3646
  `AFT payments support only ${$A.join(", ")}; disable ${e.join(", ")} when \`sender\`/\`recipient\` are provided`
3625
- ), jt("sender", A.sender, Dr), jt("recipient", A.recipient, Mr), Wt.includes(A.sender.id_type) || b(`\`sender.id_type\` must be one of: ${Wt.join(", ")}`), A.sender.country_code && !$t(A.sender.country_code) && b("`sender.country_code` must be a 2-letter ISO 3166-1 alpha-2 code"), A.recipient.country && !$t(A.recipient.country) && b("`recipient.country` must be a 2-letter ISO 3166-1 alpha-2 code"), !0;
3647
+ ), jt("sender", A.sender, Dr), jt("recipient", A.recipient, Mr), Wt.includes(A.sender.id_type) || h(`\`sender.id_type\` must be one of: ${Wt.join(", ")}`), A.sender.country_code && !$t(A.sender.country_code) && h("`sender.country_code` must be a 2-letter ISO 3166-1 alpha-2 code"), A.recipient.country && !$t(A.recipient.country) && h("`recipient.country` must be a 2-letter ISO 3166-1 alpha-2 code"), !0;
3626
3648
  }, Br = (A) => {
3627
3649
  function t(e) {
3628
3650
  if (typeof e != "function") return !1;
3629
3651
  const n = (e == null ? void 0 : e.constructor.prototype.constructor.name) === "AsyncFunction", r = e.toString().startsWith("async");
3630
3652
  return n || r;
3631
3653
  }
3632
- return A.on_initiating && !t(A.on_initiating) && b(
3654
+ return A.on_initiating && !t(A.on_initiating) && h(
3633
3655
  "On initiating must be a promise based callback, check documentation for implementation details"
3634
- ), A.on_completed && !t(A.on_completed) && b(
3656
+ ), A.on_completed && !t(A.on_completed) && h(
3635
3657
  "On completed must be a promise based callback, check documentation for implementation details"
3636
- ), A.on_failure && !t(A.on_failure) && b(
3658
+ ), A.on_failure && !t(A.on_failure) && h(
3637
3659
  "On failure must be a promise based callback, check documentation for implementation details"
3638
- ), A.on_redirect && !t(A.on_redirect) && b(
3660
+ ), A.on_redirect && !t(A.on_redirect) && h(
3639
3661
  "On redirect must be a promise based callback, check documentation for implementation details"
3640
3662
  ), !0;
3641
3663
  };
3642
3664
  function Sr(A) {
3643
3665
  for (const t of A)
3644
- Object.prototype.hasOwnProperty.call(t, "amount") || x("amount"), typeof t.amount != "number" && b("`amount` must be a number"), Number.isInteger(t.amount) || b(
3666
+ Object.prototype.hasOwnProperty.call(t, "amount") || x("amount"), typeof t.amount != "number" && h("`amount` must be a number"), Number.isInteger(t.amount) || h(
3645
3667
  "amount must be in minor unit of selected currency, e.g. for $19.99 set amount to 1999."
3646
- ), t.amount == 0 && b("amount must be non-zero value"), t.recipient_id || x("recipient_id"), typeof t.recipient_id != "string" && b("`recipient_id` must be a UUID string"), t.fee_source && typeof t.fee_source != "boolean" && b("`fee_source` must be a boolean"), t.refundable && typeof t.refundable != "boolean" && b("`refundable` must be a boolean"), t.reference && typeof t.reference != "string" && b("`reference` must be a string"), t.description && typeof t.description != "string" && b("`description` must be a string");
3668
+ ), t.amount == 0 && h("amount must be non-zero value"), t.recipient_id || x("recipient_id"), typeof t.recipient_id != "string" && h("`recipient_id` must be a UUID string"), t.fee_source && typeof t.fee_source != "boolean" && h("`fee_source` must be a boolean"), t.refundable && typeof t.refundable != "boolean" && h("`refundable` must be a boolean"), t.reference && typeof t.reference != "string" && h("`reference` must be a string"), t.description && typeof t.description != "string" && h("`description` must be a string");
3647
3669
  }
3648
3670
  const Pr = (A) => {
3649
3671
  var t, e;
3650
- return A.payment_button_type && typeof A.payment_button_type != "string" && aA("Payment button type"), A.given_id && (/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(A.given_id) || b("`given_id` must be a valid UUID v4")), A.payment_button_type && !Qn.includes(A.payment_button_type) && b("Unsupported button type, check documentation for list of supported types"), A.language && typeof A.language != "string" && aA("Language"), A.translations && typeof A.translations != "object" && aA("Translations"), A.metadata && typeof A.metadata != "object" && b("Metadata must be and object"), A.metadata && Object.entries(A.metadata).length > 50 && b("Only 50 Key/Value pairs are allowed in metadata"), A.invoice_id && typeof A.invoice_id != "string" && b("Invoice ID must be a string"), A.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(
3672
+ return A.payment_button_type && typeof A.payment_button_type != "string" && iA("Payment button type"), A.given_id && (/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(A.given_id) || h("`given_id` must be a valid UUID v4")), A.payment_button_type && !Qn.includes(A.payment_button_type) && h("Unsupported button type, check documentation for list of supported types"), A.language && typeof A.language != "string" && iA("Language"), A.translations && typeof A.translations != "object" && iA("Translations"), A.metadata && typeof A.metadata != "object" && h("Metadata must be and object"), A.metadata && Object.entries(A.metadata).length > 50 && h("Only 50 Key/Value pairs are allowed in metadata"), A.invoice_id && typeof A.invoice_id != "string" && h("Invoice ID must be a string"), A.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(
3651
3673
  (t = A.invoice_id) != null ? t : ""
3652
- ) || b("Invalid invoice ID format")), A.statement_descriptor && typeof A.statement_descriptor != "string" && b("Statement descriptor must be a string"), A.statement_descriptor && (/^[\w\s\d\-~]{1,64}$/.test((e = A.statement_descriptor) != null ? e : "") || b(
3674
+ ) || h("Invalid invoice ID format")), A.statement_descriptor && typeof A.statement_descriptor != "string" && h("Statement descriptor must be a string"), A.statement_descriptor && (/^[\w\s\d\-~]{1,64}$/.test((e = A.statement_descriptor) != null ? e : "") || h(
3653
3675
  'Invalid format for the statement descriptor [length between 1 and 64 characters, allowed alphanumeric characters, white-spaces, "/", "-" and "~" symbols] '
3654
- )), A.fixed_width && typeof A.fixed_width != "boolean" && b("Fixed width expects boolean value"), A.apply_coupon && typeof A.apply_coupon != "boolean" && b("apply_coupon should be a boolean"), A.splits && !Array.isArray(A.splits) && b("splits must be an array"), A.splits && A.splits.length == 0 && b("splits must be an array that contains split details"), A.splits && A.splits.length > 0 && Sr(A.splits), !0;
3676
+ )), A.fixed_width && typeof A.fixed_width != "boolean" && h("Fixed width expects boolean value"), A.apply_coupon && typeof A.apply_coupon != "boolean" && h("apply_coupon should be a boolean"), A.splits && !Array.isArray(A.splits) && h("splits must be an array"), A.splits && A.splits.length == 0 && h("splits must be an array that contains split details"), A.splits && A.splits.length > 0 && Sr(A.splits), !0;
3655
3677
  }, Ft = (A, t) => A.every((e) => t.includes(e)), Xr = (A) => {
3656
- var t, e, n, r, a, o, l, c, s, p, i, f, d, y, h, v, m, g, M, C;
3657
- if (A.methods && !Array.isArray(A.methods) && b("Methods must be an array"), A.methods.includes("creditcard") && ((t = A.credit_card) != null && t.manual && typeof A.credit_card.manual != "boolean" && b("Credit Card manual option must be a boolean"), (e = A.credit_card) != null && e.save_card && typeof A.credit_card.save_card != "boolean" && b("Credit Card save card option must be a boolean")), A.methods.includes("applepay") && (A.apple_pay || x("Apple Pay configuration"), A.apple_pay)) {
3658
- const w = A.apple_pay.country || ((n = A.payment_options) == null ? void 0 : n.country), D = A.apple_pay.label || ((r = A.payment_options) == null ? void 0 : r.label), B = /^[\x20-\x7E]+$/;
3659
- w || x("Apple Pay country or Payment Options country"), (w == null ? void 0 : w.trim().length) !== 2 && b("Country must be two-letter ISO 3166 country code"), D || x("Apple Pay label or Payment Options label"), (D == null ? void 0 : D.trim().length) === 0 && b("Apple Pay label or Payment Options label can't be empty"), typeof D == "string" && !B.test(D) && b("Apple Pay label or Payment Options label should be English characters only"), (a = A.apple_pay) != null && a.manual && typeof ((o = A.apple_pay) == null ? void 0 : o.manual) != "boolean" && b("Apple Pay manual option must be a boolean"), (l = A.apple_pay) != null && l.save_card && typeof ((c = A.apple_pay) == null ? void 0 : c.save_card) != "boolean" && b("Apple Pay save card option must be a boolean"), (s = A.samsung_pay) != null && s.manual && typeof ((p = A.samsung_pay) == null ? void 0 : p.manual) != "boolean" && b("Samsung Pay manual option must be a boolean"), (i = A.samsung_pay) != null && i.save_card && typeof ((f = A.samsung_pay) == null ? void 0 : f.save_card) != "boolean" && b("Samsung Pay save card option must be a boolean"), A.apple_pay.validate_merchant_url && !Le(A.apple_pay.validate_merchant_url) && aA("Apple Pay Validate Merchant URL"), (d = A.apple_pay) != null && d.merchant_capabilities && (Ft(A.apple_pay.merchant_capabilities, FA) || b(`Apple Pay merchant capabilities supports only ${FA.join(", ")}`)), (y = A.apple_pay) != null && y.supported_countries && !Array.isArray(A.apple_pay.supported_countries) && b("Apple Pay Supported Countries must be an array of country codes");
3678
+ var t, e, n, r, a, o, l, i, s, p, c, f, d, y, b, v, m, g, D, w;
3679
+ if (A.methods && !Array.isArray(A.methods) && h("Methods must be an array"), A.methods.includes("creditcard") && ((t = A.credit_card) != null && t.manual && typeof A.credit_card.manual != "boolean" && h("Credit Card manual option must be a boolean"), (e = A.credit_card) != null && e.save_card && typeof A.credit_card.save_card != "boolean" && h("Credit Card save card option must be a boolean")), A.methods.includes("applepay") && (A.apple_pay || x("Apple Pay configuration"), A.apple_pay)) {
3680
+ const C = A.apple_pay.country || ((n = A.payment_options) == null ? void 0 : n.country), M = A.apple_pay.label || ((r = A.payment_options) == null ? void 0 : r.label), k = /^[\x20-\x7E]+$/;
3681
+ C || x("Apple Pay country or Payment Options country"), (C == null ? void 0 : C.trim().length) !== 2 && h("Country must be two-letter ISO 3166 country code"), M || x("Apple Pay label or Payment Options label"), (M == null ? void 0 : M.trim().length) === 0 && h("Apple Pay label or Payment Options label can't be empty"), typeof M == "string" && !k.test(M) && h("Apple Pay label or Payment Options label should be English characters only"), (a = A.apple_pay) != null && a.manual && typeof ((o = A.apple_pay) == null ? void 0 : o.manual) != "boolean" && h("Apple Pay manual option must be a boolean"), (l = A.apple_pay) != null && l.save_card && typeof ((i = A.apple_pay) == null ? void 0 : i.save_card) != "boolean" && h("Apple Pay save card option must be a boolean"), (s = A.samsung_pay) != null && s.manual && typeof ((p = A.samsung_pay) == null ? void 0 : p.manual) != "boolean" && h("Samsung Pay manual option must be a boolean"), (c = A.samsung_pay) != null && c.save_card && typeof ((f = A.samsung_pay) == null ? void 0 : f.save_card) != "boolean" && h("Samsung Pay save card option must be a boolean"), A.apple_pay.validate_merchant_url && !Le(A.apple_pay.validate_merchant_url) && iA("Apple Pay Validate Merchant URL"), (d = A.apple_pay) != null && d.merchant_capabilities && (Ft(A.apple_pay.merchant_capabilities, FA) || h(`Apple Pay merchant capabilities supports only ${FA.join(", ")}`)), (y = A.apple_pay) != null && y.supported_countries && !Array.isArray(A.apple_pay.supported_countries) && h("Apple Pay Supported Countries must be an array of country codes");
3660
3682
  }
3661
3683
  if (A.samsung_pay) {
3662
- const w = A.samsung_pay.country || ((h = A.payment_options) == null ? void 0 : h.country), D = A.samsung_pay.label || ((v = A.payment_options) == null ? void 0 : v.label), B = A.samsung_pay.order_number, I = A.publishable_api_key.startsWith("pk_test") || location.protocol === "http:";
3663
- !window.SamsungPay && I && console.warn(
3684
+ const C = A.samsung_pay.country || ((b = A.payment_options) == null ? void 0 : b.country), M = A.samsung_pay.label || ((v = A.payment_options) == null ? void 0 : v.label), k = A.samsung_pay.order_number, Q = A.publishable_api_key.startsWith("pk_test") || location.protocol === "http:";
3685
+ !window.SamsungPay && Q && console.warn(
3664
3686
  "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"
3665
- ), A.samsung_pay.service_id || x("Samsung Pay service_id"), A.samsung_pay.service_id.trim().length === 0 && b("Samsung Pay service_id can't be empty"), B || x("Samsung Pay order_number or Payment Options order_number"), (B == null ? void 0 : B.trim().length) === 0 && b("Order number can't be empty"), w || x("Samsung Pay country or Payment Options country"), (w == null ? void 0 : w.trim().length) !== 2 && b("Country must be two-letter ISO 3166 country code"), D || x("Samsung Pay label or Payment Options label"), (D == null ? void 0 : D.trim().length) === 0 && b("Samsung Pay label or Payment Options label can't be empty");
3687
+ ), A.samsung_pay.service_id || x("Samsung Pay service_id"), A.samsung_pay.service_id.trim().length === 0 && h("Samsung Pay service_id can't be empty"), k || x("Samsung Pay order_number or Payment Options order_number"), (k == null ? void 0 : k.trim().length) === 0 && h("Order number can't be empty"), C || x("Samsung Pay country or Payment Options country"), (C == null ? void 0 : C.trim().length) !== 2 && h("Country must be two-letter ISO 3166 country code"), M || x("Samsung Pay label or Payment Options label"), (M == null ? void 0 : M.trim().length) === 0 && h("Samsung Pay label or Payment Options label can't be empty");
3666
3688
  }
3667
3689
  if (A.google_pay) {
3668
- const w = A.google_pay.country || ((m = A.payment_options) == null ? void 0 : m.country), D = A.google_pay.label || ((g = A.payment_options) == null ? void 0 : g.label), B = A.publishable_api_key.startsWith("pk_test") || location.protocol === "http:", I = A.google_pay.environment;
3669
- !((C = (M = window.google) == null ? void 0 : M.payments) != null && C.api) && B && console.warn(
3690
+ const C = A.google_pay.country || ((m = A.payment_options) == null ? void 0 : m.country), M = A.google_pay.label || ((g = A.payment_options) == null ? void 0 : g.label), k = A.publishable_api_key.startsWith("pk_test") || location.protocol === "http:", Q = A.google_pay.environment;
3691
+ !((w = (D = window.google) == null ? void 0 : D.payments) != null && w.api) && k && console.warn(
3670
3692
  "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"
3671
- ), A.google_pay.merchant_id || x("Google Pay service_id"), A.google_pay.merchant_id.trim().length === 0 && b("Google Pay service_id can't be empty"), w || x("Google Pay country or Payment Options country"), (w == null ? void 0 : w.trim().length) !== 2 && b("Country must be two-letter ISO 3166 country code"), D || x("Google Pay label or Payment Options label"), (D == null ? void 0 : D.trim().length) === 0 && b("Google Pay label or Payment Options label can't be empty"), I && !["PRODUCTION", "TEST"].includes(I) && b("Google Pay environment can be set to `TEST` or `PRODUCTION`");
3672
- const { auth_methods: X } = A.google_pay;
3673
- X && !Array.isArray(X) && b("Google Pay auth_methods must be an array"), X && !X.every((T) => T === "PAN_ONLY" || T === "CRYPTOGRAM_3DS") && b("Google Pay auth_methods must contain 'CRYPTOGRAM_3DS' and/or 'PAN_ONLY'");
3693
+ ), A.google_pay.merchant_id || x("Google Pay service_id"), A.google_pay.merchant_id.trim().length === 0 && h("Google Pay service_id can't be empty"), C || x("Google Pay country or Payment Options country"), (C == null ? void 0 : C.trim().length) !== 2 && h("Country must be two-letter ISO 3166 country code"), M || x("Google Pay label or Payment Options label"), (M == null ? void 0 : M.trim().length) === 0 && h("Google Pay label or Payment Options label can't be empty"), Q && !["PRODUCTION", "TEST"].includes(Q) && h("Google Pay environment can be set to `TEST` or `PRODUCTION`");
3694
+ const { auth_methods: P } = A.google_pay;
3695
+ P && !Array.isArray(P) && h("Google Pay auth_methods must be an array"), P && !P.every((O) => O === "PAN_ONLY" || O === "CRYPTOGRAM_3DS") && h("Google Pay auth_methods must contain 'CRYPTOGRAM_3DS' and/or 'PAN_ONLY'");
3674
3696
  }
3675
- return A.supported_networks && (Ft(A.supported_networks, jA) || b(`Moyasar form supports only ${jA.join(", ")} networks`)), !0;
3676
- }, Tr = (A) => (A.element || x("element"), typeof A.element != "string" && !(A.element instanceof Element) && aA("Element"), typeof A.element == "string" && !document.querySelector(A.element) && b(`Selector ${A.element} does't exist id DOM`), A.publishable_api_key.trim() || x("publishable_api_key"), A.publishable_api_key && (/^pk_(test|live)_/.test(A.publishable_api_key) || aA("Publishable API Key"), location.protocol.toLowerCase() === "http:" && A.publishable_api_key.startsWith("pk_live") && b(
3697
+ return A.supported_networks && (Ft(A.supported_networks, jA) || h(`Moyasar form supports only ${jA.join(", ")} networks`)), !0;
3698
+ }, Tr = (A) => (A.element || x("element"), typeof A.element != "string" && !(A.element instanceof Element) && iA("Element"), typeof A.element == "string" && !document.querySelector(A.element) && h(`Selector ${A.element} does't exist id DOM`), A.publishable_api_key.trim() || x("publishable_api_key"), A.publishable_api_key && (/^pk_(test|live)_/.test(A.publishable_api_key) || iA("Publishable API Key"), location.protocol.toLowerCase() === "http:" && A.publishable_api_key.startsWith("pk_live") && h(
3677
3699
  "Production key (pk_live) require secure connection, for development use key starting with pk_test"
3678
- )), A.amount || x("amount"), A.amount && ((typeof A.amount != "number" || A.amount < 100) && b("Amount must be a non-negative integer. Minimal supported value is 100."), Number.isInteger(A.amount) || b(
3700
+ )), A.amount || x("amount"), A.amount && ((typeof A.amount != "number" || A.amount < 100) && h("Amount must be a non-negative integer. Minimal supported value is 100."), Number.isInteger(A.amount) || h(
3679
3701
  "Amount must be in minor unit of selected currency, e.g. for $19.99 set amount to 1999."
3680
- )), A.currency || x("currency"), A.currency && A.currency.trim().length !== 3 && b("Currency must be in ISO 3166-1 alpha-3 country code format"), A.description || x("description"), A.description && A.description.trim().length === 0 && b("Description can't be empty"), A.callback_url || x("callback_url"), Le(A.callback_url) || aA("Callback URL"), !0), b = (A) => {
3702
+ )), A.currency || x("currency"), A.currency && A.currency.trim().length !== 3 && h("Currency must be in ISO 3166-1 alpha-3 country code format"), A.description || x("description"), A.description && A.description.trim().length === 0 && h("Description can't be empty"), A.callback_url || x("callback_url"), Le(A.callback_url) || iA("Callback URL"), !0), Qr = (A) => (A.use_payment_intent !== void 0 && typeof A.use_payment_intent != "boolean" && h("use_payment_intent must be a boolean"), A.payment_intent !== void 0 && ((typeof A.payment_intent != "object" || A.payment_intent === null) && h("payment_intent must be an object with an id and a client_secret"), (typeof A.payment_intent.id != "string" || !A.payment_intent.id.trim()) && h("payment_intent.id must be a non-empty string"), (typeof A.payment_intent.client_secret != "string" || !A.payment_intent.client_secret.trim()) && h("payment_intent.client_secret must be a non-empty string")), A.use_payment_intent === !0 && !A.payment_intent && !A.on_initiating && h(
3703
+ "use_payment_intent is enabled but no payment_intent was provided; supply payment_intent in the config or return it from on_initiating"
3704
+ ), !0), h = (A) => {
3681
3705
  throw window.silentError && console.error(A), new Error(A);
3682
- }, x = (A) => b(`Missing entry: ${A} is required`), aA = (A) => b(`${A} is invalid`), Le = (A) => typeof A == "string" && /^https?:\/\/.+/.test(A), $t = (A) => typeof A == "string" && /^[A-Za-z]{2}$/.test(A), Qr = (A, t = !1) => (t && (window.silentError = t), Tr(A), Xr(A), Pr(A), kr(A), Br(A), !0), Lr = (A) => {
3706
+ }, x = (A) => h(`Missing entry: ${A} is required`), iA = (A) => h(`${A} is invalid`), Le = (A) => typeof A == "string" && /^https?:\/\/.+/.test(A), $t = (A) => typeof A == "string" && /^[A-Za-z]{2}$/.test(A), Lr = (A, t = !1) => (t && (window.silentError = t), Tr(A), Xr(A), Pr(A), kr(A), Br(A), Qr(A), !0), _r = (A) => {
3683
3707
  const t = A.publishable_api_key.startsWith("pk_test") || location.protocol === "http:", e = A.element;
3684
3708
  let n;
3685
3709
  if (typeof e == "string" && (n = document.querySelector(e)), e instanceof Element && (n = e), !n) {
@@ -3689,7 +3713,7 @@ const Pr = (A) => {
3689
3713
  return;
3690
3714
  }
3691
3715
  try {
3692
- Qr(A, t);
3716
+ Lr(A, t);
3693
3717
  } catch (r) {
3694
3718
  console.error(r), Dt(/* @__PURE__ */ u(() => /* @__PURE__ */ u("div", { class: "mx-auto w-fit rounded-lg border-red-800 bg-red-500/20 p-4 font-mono text-sm leading-6", children: [
3695
3719
  /* @__PURE__ */ u("h2", { class: "mb-4 text-center text-xl font-medium", children: "Form configuration issue!" }),
@@ -3700,27 +3724,27 @@ const Pr = (A) => {
3700
3724
  }
3701
3725
  n.setAttribute("lang", A.language), Dt(/* @__PURE__ */ u(Cr, { config: A }), n);
3702
3726
  }, Nr = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
3703
- let _r = (A = 21) => {
3727
+ let Ir = (A = 21) => {
3704
3728
  let t = "", e = crypto.getRandomValues(new Uint8Array(A |= 0));
3705
3729
  for (; A--; )
3706
3730
  t += Nr[e[A] & 63];
3707
3731
  return t;
3708
3732
  };
3709
- const Ir = (A) => {
3710
- const t = k({}, A);
3733
+ const Or = (A) => {
3734
+ const t = B({}, A);
3711
3735
  return "show_footer" in A || (t.show_footer = !0), A.base_url || (t.base_url = "https://api.moyasar.com"), A.payment_button_type || (t.payment_button_type = "pay"), A.language || (t.language = document.documentElement.lang || "en"), A.methods || (t.methods = Xn), A.supported_networks || (t.supported_networks = jA.filter((e) => e !== "amex")), !A.fixed_width && A.fixed_width !== !1 && (t.fixed_width = !0), A.apple_pay && (A.apple_pay.version || (t.apple_pay.version = 6), A.apple_pay.merchant_capabilities || (t.apple_pay.merchant_capabilities = FA.filter(
3712
3736
  (e) => e !== "supportsEMV"
3713
- )), A.apple_pay.supported_countries || (t.apple_pay.supported_countries = ["SA"])), A.samsung_pay && (A.samsung_pay.version || (t.samsung_pay.version = 2), A.samsung_pay.environment || (t.samsung_pay.environment = "PRODUCTION")), A.google_pay && (A.google_pay.environment || (t.google_pay.environment = "PRODUCTION"), A.google_pay.auth_methods || (t.google_pay.auth_methods = ["PAN_ONLY", "CRYPTOGRAM_3DS"]), A.google_pay.gateway_merchant_id || (t.google_pay.gateway_merchant_id = _r(36))), t;
3737
+ )), A.apple_pay.supported_countries || (t.apple_pay.supported_countries = ["SA"])), A.samsung_pay && (A.samsung_pay.version || (t.samsung_pay.version = 2), A.samsung_pay.environment || (t.samsung_pay.environment = "PRODUCTION")), A.google_pay && (A.google_pay.environment || (t.google_pay.environment = "PRODUCTION"), A.google_pay.auth_methods || (t.google_pay.auth_methods = ["PAN_ONLY", "CRYPTOGRAM_3DS"]), A.google_pay.gateway_merchant_id || (t.google_pay.gateway_merchant_id = Ir(36))), t;
3714
3738
  };
3715
- class zr {
3739
+ class Ur {
3716
3740
  static init(t) {
3717
- const e = Ir(t);
3718
- Lr(e);
3741
+ const e = Or(t);
3742
+ _r(e);
3719
3743
  }
3720
3744
  static setAmount(t) {
3721
- nt ? nt((e) => L(k({}, e), { amount: t })) : console.warn("Form not yet initialized.");
3745
+ nt ? nt((e) => N(B({}, e), { amount: t })) : console.warn("Form not yet initialized.");
3722
3746
  }
3723
3747
  }
3724
3748
  export {
3725
- zr as default
3749
+ Ur as default
3726
3750
  };