@busha/ramp-web-sdk 0.1.8 → 0.1.11
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/index.es.js +244 -245
- package/dist/index.umd.js +5 -5
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
function Ce(r) {
|
|
1
|
+
var ke = Object.defineProperty;
|
|
2
|
+
var Ce = (r, e, t) => e in r ? ke(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
|
+
var z = (r, e, t) => Ce(r, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
const V = "busha-ramp-container", G = "busha-ramp-loader", X = "busha-ramp-styles", ee = "busha-ramp-close-btn", L = "busha-ramp-iframe", De = "busha-ramp-form", re = "https://buy.busha.co", xe = "https://sell.busha.co", ge = "https://sandbox.buy.busha.co", Ee = "https://sandbox.sell.busha.co", Ae = "INITIALIZED", le = "CANCELLED", Ie = "COMPLETED";
|
|
5
|
+
function je(r) {
|
|
7
6
|
return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
|
|
8
7
|
}
|
|
9
|
-
var J,
|
|
10
|
-
function
|
|
11
|
-
if (
|
|
12
|
-
|
|
8
|
+
var J, ce;
|
|
9
|
+
function Ne() {
|
|
10
|
+
if (ce) return J;
|
|
11
|
+
ce = 1;
|
|
13
12
|
function r(c) {
|
|
14
13
|
this._maxSize = c, this.clear();
|
|
15
14
|
}
|
|
@@ -28,31 +27,31 @@ function De() {
|
|
|
28
27
|
setter: function(c) {
|
|
29
28
|
var m = l(c);
|
|
30
29
|
return o.get(c) || o.set(c, function(O, x) {
|
|
31
|
-
for (var
|
|
32
|
-
var D = m[
|
|
30
|
+
for (var w = 0, T = m.length, C = O; w < T - 1; ) {
|
|
31
|
+
var D = m[w];
|
|
33
32
|
if (D === "__proto__" || D === "constructor" || D === "prototype")
|
|
34
33
|
return O;
|
|
35
|
-
C = C[m[
|
|
34
|
+
C = C[m[w++]];
|
|
36
35
|
}
|
|
37
|
-
C[m[
|
|
36
|
+
C[m[w]] = x;
|
|
38
37
|
});
|
|
39
38
|
},
|
|
40
39
|
getter: function(c, m) {
|
|
41
|
-
var
|
|
40
|
+
var v = l(c);
|
|
42
41
|
return d.get(c) || d.set(c, function(x) {
|
|
43
|
-
for (var
|
|
44
|
-
if (x != null || !m) x = x[w
|
|
42
|
+
for (var w = 0, T = v.length; w < T; )
|
|
43
|
+
if (x != null || !m) x = x[v[w++]];
|
|
45
44
|
else return;
|
|
46
45
|
return x;
|
|
47
46
|
});
|
|
48
47
|
},
|
|
49
48
|
join: function(c) {
|
|
50
|
-
return c.reduce(function(m,
|
|
51
|
-
return m + (p(
|
|
49
|
+
return c.reduce(function(m, v) {
|
|
50
|
+
return m + (p(v) || t.test(v) ? "[" + v + "]" : (m ? "." : "") + v);
|
|
52
51
|
}, "");
|
|
53
52
|
},
|
|
54
|
-
forEach: function(c, m,
|
|
55
|
-
h(Array.isArray(c) ? c : f(c), m,
|
|
53
|
+
forEach: function(c, m, v) {
|
|
54
|
+
h(Array.isArray(c) ? c : f(c), m, v);
|
|
56
55
|
}
|
|
57
56
|
};
|
|
58
57
|
function l(c) {
|
|
@@ -66,10 +65,10 @@ function De() {
|
|
|
66
65
|
function f(c) {
|
|
67
66
|
return c.match(e) || [""];
|
|
68
67
|
}
|
|
69
|
-
function h(c, m,
|
|
70
|
-
var O = c.length, x,
|
|
71
|
-
for (
|
|
72
|
-
x = c[
|
|
68
|
+
function h(c, m, v) {
|
|
69
|
+
var O = c.length, x, w, T, C;
|
|
70
|
+
for (w = 0; w < O; w++)
|
|
71
|
+
x = c[w], x && (E(x) && (x = '"' + x + '"'), C = p(x), T = !C && /^\d+$/.test(x), m.call(v, x, C, T, w, c));
|
|
73
72
|
}
|
|
74
73
|
function p(c) {
|
|
75
74
|
return typeof c == "string" && c && ["'", '"'].indexOf(c.charAt(0)) !== -1;
|
|
@@ -85,10 +84,10 @@ function De() {
|
|
|
85
84
|
}
|
|
86
85
|
return J;
|
|
87
86
|
}
|
|
88
|
-
var
|
|
89
|
-
function
|
|
90
|
-
if (
|
|
91
|
-
|
|
87
|
+
var M = Ne(), Q, fe;
|
|
88
|
+
function Me() {
|
|
89
|
+
if (fe) return Q;
|
|
90
|
+
fe = 1;
|
|
92
91
|
const r = /[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g, e = (l) => l.match(r) || [], t = (l) => l[0].toUpperCase() + l.slice(1), n = (l, f) => e(l).join(f).toLowerCase(), s = (l) => e(l).reduce(
|
|
93
92
|
(f, h) => `${f}${f ? h[0].toUpperCase() + h.slice(1).toLowerCase() : h.toLowerCase()}`,
|
|
94
93
|
""
|
|
@@ -104,12 +103,12 @@ function Ae() {
|
|
|
104
103
|
titleCase: (l) => e(l).map(t).join(" ")
|
|
105
104
|
}, Q;
|
|
106
105
|
}
|
|
107
|
-
var W =
|
|
108
|
-
function
|
|
109
|
-
if (
|
|
110
|
-
|
|
106
|
+
var W = Me(), q = { exports: {} }, de;
|
|
107
|
+
function Ue() {
|
|
108
|
+
if (de) return q.exports;
|
|
109
|
+
de = 1, q.exports = function(s) {
|
|
111
110
|
return r(e(s), s);
|
|
112
|
-
},
|
|
111
|
+
}, q.exports.array = r;
|
|
113
112
|
function r(s, a) {
|
|
114
113
|
var i = s.length, u = new Array(i), o = {}, d = i, l = t(a), f = n(s);
|
|
115
114
|
for (a.forEach(function(p) {
|
|
@@ -164,39 +163,39 @@ function Ie() {
|
|
|
164
163
|
a.set(s[i], i);
|
|
165
164
|
return a;
|
|
166
165
|
}
|
|
167
|
-
return
|
|
166
|
+
return q.exports;
|
|
168
167
|
}
|
|
169
|
-
var
|
|
170
|
-
const
|
|
171
|
-
function
|
|
168
|
+
var Pe = Ue();
|
|
169
|
+
const Re = /* @__PURE__ */ je(Pe), ze = Object.prototype.toString, Le = Error.prototype.toString, Ve = RegExp.prototype.toString, qe = typeof Symbol < "u" ? Symbol.prototype.toString : () => "", Ze = /^Symbol\((.*)\)(.*)$/;
|
|
170
|
+
function Be(r) {
|
|
172
171
|
return r != +r ? "NaN" : r === 0 && 1 / r < 0 ? "-0" : "" + r;
|
|
173
172
|
}
|
|
174
|
-
function
|
|
173
|
+
function he(r, e = !1) {
|
|
175
174
|
if (r == null || r === !0 || r === !1) return "" + r;
|
|
176
175
|
const t = typeof r;
|
|
177
|
-
if (t === "number") return
|
|
176
|
+
if (t === "number") return Be(r);
|
|
178
177
|
if (t === "string") return e ? `"${r}"` : r;
|
|
179
178
|
if (t === "function") return "[Function " + (r.name || "anonymous") + "]";
|
|
180
|
-
if (t === "symbol") return
|
|
181
|
-
const n =
|
|
182
|
-
return n === "Date" ? isNaN(r.getTime()) ? "" + r : r.toISOString(r) : n === "Error" || r instanceof Error ? "[" + Le.call(r) + "]" : n === "RegExp" ?
|
|
179
|
+
if (t === "symbol") return qe.call(r).replace(Ze, "Symbol($1)");
|
|
180
|
+
const n = ze.call(r).slice(8, -1);
|
|
181
|
+
return n === "Date" ? isNaN(r.getTime()) ? "" + r : r.toISOString(r) : n === "Error" || r instanceof Error ? "[" + Le.call(r) + "]" : n === "RegExp" ? Ve.call(r) : null;
|
|
183
182
|
}
|
|
184
183
|
function I(r, e) {
|
|
185
|
-
let t =
|
|
184
|
+
let t = he(r, e);
|
|
186
185
|
return t !== null ? t : JSON.stringify(r, function(n, s) {
|
|
187
|
-
let a =
|
|
186
|
+
let a = he(this[n], e);
|
|
188
187
|
return a !== null ? a : s;
|
|
189
188
|
}, 2);
|
|
190
189
|
}
|
|
191
|
-
function
|
|
190
|
+
function we(r) {
|
|
192
191
|
return r == null ? [] : [].concat(r);
|
|
193
192
|
}
|
|
194
|
-
let
|
|
195
|
-
|
|
196
|
-
class
|
|
193
|
+
let ve, _e, Fe, Ye = /\$\{\s*(\w+)\s*\}/g;
|
|
194
|
+
ve = Symbol.toStringTag;
|
|
195
|
+
class pe {
|
|
197
196
|
constructor(e, t, n, s) {
|
|
198
|
-
this.name = void 0, this.message = void 0, this.value = void 0, this.path = void 0, this.type = void 0, this.params = void 0, this.errors = void 0, this.inner = void 0, this[
|
|
199
|
-
if (
|
|
197
|
+
this.name = void 0, this.message = void 0, this.value = void 0, this.path = void 0, this.type = void 0, this.params = void 0, this.errors = void 0, this.inner = void 0, this[ve] = "Error", this.name = "ValidationError", this.value = t, this.path = n, this.type = s, this.errors = [], this.inner = [], we(e).forEach((a) => {
|
|
198
|
+
if (F.isError(a)) {
|
|
200
199
|
this.errors.push(...a.errors);
|
|
201
200
|
const i = a.inner.length ? a.inner : [a];
|
|
202
201
|
this.inner.push(...i);
|
|
@@ -205,30 +204,30 @@ class he {
|
|
|
205
204
|
}), this.message = this.errors.length > 1 ? `${this.errors.length} errors occurred` : this.errors[0];
|
|
206
205
|
}
|
|
207
206
|
}
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
class
|
|
207
|
+
_e = Symbol.hasInstance;
|
|
208
|
+
Fe = Symbol.toStringTag;
|
|
209
|
+
class F extends Error {
|
|
211
210
|
static formatError(e, t) {
|
|
212
211
|
const n = t.label || t.path || "this";
|
|
213
212
|
return t = Object.assign({}, t, {
|
|
214
213
|
path: n,
|
|
215
214
|
originalPath: t.path
|
|
216
|
-
}), typeof e == "string" ? e.replace(
|
|
215
|
+
}), typeof e == "string" ? e.replace(Ye, (s, a) => I(t[a])) : typeof e == "function" ? e(t) : e;
|
|
217
216
|
}
|
|
218
217
|
static isError(e) {
|
|
219
218
|
return e && e.name === "ValidationError";
|
|
220
219
|
}
|
|
221
220
|
constructor(e, t, n, s, a) {
|
|
222
|
-
const i = new
|
|
221
|
+
const i = new pe(e, t, n, s);
|
|
223
222
|
if (a)
|
|
224
223
|
return i;
|
|
225
|
-
super(), this.value = void 0, this.path = void 0, this.type = void 0, this.params = void 0, this.errors = [], this.inner = [], this[
|
|
224
|
+
super(), this.value = void 0, this.path = void 0, this.type = void 0, this.params = void 0, this.errors = [], this.inner = [], this[Fe] = "Error", this.name = i.name, this.message = i.message, this.type = i.type, this.value = i.value, this.path = i.path, this.errors = i.errors, this.inner = i.inner, Error.captureStackTrace && Error.captureStackTrace(this, F);
|
|
226
225
|
}
|
|
227
|
-
static [
|
|
228
|
-
return
|
|
226
|
+
static [_e](e) {
|
|
227
|
+
return pe[Symbol.hasInstance](e) || super[Symbol.hasInstance](e);
|
|
229
228
|
}
|
|
230
229
|
}
|
|
231
|
-
let
|
|
230
|
+
let $ = {
|
|
232
231
|
default: "${path} is invalid",
|
|
233
232
|
required: "${path} is a required field",
|
|
234
233
|
defined: "${path} must be defined",
|
|
@@ -244,7 +243,7 @@ let F = {
|
|
|
244
243
|
const s = n != null && n !== t ? ` (cast from the value \`${I(n, !0)}\`).` : ".";
|
|
245
244
|
return e !== "mixed" ? `${r} must be a \`${e}\` type, but the final value was: \`${I(t, !0)}\`` + s : `${r} must match the configured type. The validated value was: \`${I(t, !0)}\`` + s;
|
|
246
245
|
}
|
|
247
|
-
},
|
|
246
|
+
}, _ = {
|
|
248
247
|
length: "${path} must be exactly ${length} characters",
|
|
249
248
|
min: "${path} must be at least ${min} characters",
|
|
250
249
|
max: "${path} must be at most ${max} characters",
|
|
@@ -258,7 +257,7 @@ let F = {
|
|
|
258
257
|
trim: "${path} must be a trimmed string",
|
|
259
258
|
lowercase: "${path} must be a lowercase string",
|
|
260
259
|
uppercase: "${path} must be a upper case string"
|
|
261
|
-
},
|
|
260
|
+
}, Ge = {
|
|
262
261
|
min: "${path} must be greater than or equal to ${min}",
|
|
263
262
|
max: "${path} must be less than or equal to ${max}",
|
|
264
263
|
lessThan: "${path} must be less than ${less}",
|
|
@@ -269,16 +268,16 @@ let F = {
|
|
|
269
268
|
}, te = {
|
|
270
269
|
min: "${path} field must be later than ${min}",
|
|
271
270
|
max: "${path} field must be at earlier than ${max}"
|
|
272
|
-
},
|
|
271
|
+
}, He = {
|
|
273
272
|
isValue: "${path} field must be ${value}"
|
|
274
273
|
}, B = {
|
|
275
274
|
noUnknown: "${path} field has unspecified keys: ${unknown}",
|
|
276
275
|
exact: "${path} object contains unknown properties: ${properties}"
|
|
277
|
-
},
|
|
276
|
+
}, Ke = {
|
|
278
277
|
min: "${path} field must have at least ${min} items",
|
|
279
278
|
max: "${path} field must have less than or equal to ${max} items",
|
|
280
279
|
length: "${path} must have ${length} items"
|
|
281
|
-
},
|
|
280
|
+
}, Xe = {
|
|
282
281
|
notType: (r) => {
|
|
283
282
|
const {
|
|
284
283
|
path: e,
|
|
@@ -289,21 +288,21 @@ let F = {
|
|
|
289
288
|
if (t.length < s) return `${e} tuple value has too few items, expected a length of ${s} but got ${t.length} for value: \`${I(t, !0)}\``;
|
|
290
289
|
if (t.length > s) return `${e} tuple value has too many items, expected a length of ${s} but got ${t.length} for value: \`${I(t, !0)}\``;
|
|
291
290
|
}
|
|
292
|
-
return
|
|
291
|
+
return F.formatError($.notType, r);
|
|
293
292
|
}
|
|
294
293
|
};
|
|
295
294
|
Object.assign(/* @__PURE__ */ Object.create(null), {
|
|
296
|
-
mixed:
|
|
297
|
-
string:
|
|
298
|
-
number:
|
|
295
|
+
mixed: $,
|
|
296
|
+
string: _,
|
|
297
|
+
number: Ge,
|
|
299
298
|
date: te,
|
|
300
299
|
object: B,
|
|
301
|
-
array:
|
|
302
|
-
boolean:
|
|
303
|
-
tuple:
|
|
300
|
+
array: Ke,
|
|
301
|
+
boolean: He,
|
|
302
|
+
tuple: Xe
|
|
304
303
|
});
|
|
305
|
-
const
|
|
306
|
-
class
|
|
304
|
+
const se = (r) => r && r.__isYupSchema__;
|
|
305
|
+
class H {
|
|
307
306
|
static fromOptions(e, t) {
|
|
308
307
|
if (!t.then && !t.otherwise) throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");
|
|
309
308
|
let {
|
|
@@ -311,7 +310,7 @@ class G {
|
|
|
311
310
|
then: s,
|
|
312
311
|
otherwise: a
|
|
313
312
|
} = t, i = typeof n == "function" ? n : (...u) => u.every((o) => o === n);
|
|
314
|
-
return new
|
|
313
|
+
return new H(e, (u, o) => {
|
|
315
314
|
var d;
|
|
316
315
|
let l = i(...u) ? s : a;
|
|
317
316
|
return (d = l == null ? void 0 : l(o)) != null ? d : o;
|
|
@@ -328,7 +327,7 @@ class G {
|
|
|
328
327
|
if (s === void 0 || // @ts-ignore this can be base
|
|
329
328
|
s === e)
|
|
330
329
|
return e;
|
|
331
|
-
if (!
|
|
330
|
+
if (!se(s)) throw new TypeError("conditions must return a schema object");
|
|
332
331
|
return s.resolve(t);
|
|
333
332
|
}
|
|
334
333
|
}
|
|
@@ -336,13 +335,13 @@ const Z = {
|
|
|
336
335
|
context: "$",
|
|
337
336
|
value: "."
|
|
338
337
|
};
|
|
339
|
-
class
|
|
338
|
+
class U {
|
|
340
339
|
constructor(e, t = {}) {
|
|
341
340
|
if (this.key = void 0, this.isContext = void 0, this.isValue = void 0, this.isSibling = void 0, this.path = void 0, this.getter = void 0, this.map = void 0, typeof e != "string") throw new TypeError("ref must be a string, got: " + e);
|
|
342
341
|
if (this.key = e.trim(), e === "") throw new TypeError("ref must be a non-empty string");
|
|
343
342
|
this.isContext = this.key[0] === Z.context, this.isValue = this.key[0] === Z.value, this.isSibling = !this.isContext && !this.isValue;
|
|
344
343
|
let n = this.isContext ? Z.context : this.isValue ? Z.value : "";
|
|
345
|
-
this.path = this.key.slice(n.length), this.getter = this.path &&
|
|
344
|
+
this.path = this.key.slice(n.length), this.getter = this.path && M.getter(this.path, !0), this.map = t.map;
|
|
346
345
|
}
|
|
347
346
|
getValue(e, t, n) {
|
|
348
347
|
let s = this.isContext ? n : this.isValue ? e : t;
|
|
@@ -374,9 +373,9 @@ class L {
|
|
|
374
373
|
return e && e.__isYupRef;
|
|
375
374
|
}
|
|
376
375
|
}
|
|
377
|
-
|
|
378
|
-
const
|
|
379
|
-
function
|
|
376
|
+
U.prototype.__isYupRef = !0;
|
|
377
|
+
const N = (r) => r == null;
|
|
378
|
+
function P(r) {
|
|
380
379
|
function e({
|
|
381
380
|
value: t,
|
|
382
381
|
path: n = "",
|
|
@@ -398,10 +397,10 @@ function M(r) {
|
|
|
398
397
|
disableStackTrace: c = i.spec.disableStackTrace
|
|
399
398
|
} = s;
|
|
400
399
|
function m(g) {
|
|
401
|
-
return
|
|
400
|
+
return U.isRef(g) ? g.getValue(t, y, b) : g;
|
|
402
401
|
}
|
|
403
|
-
function
|
|
404
|
-
const
|
|
402
|
+
function v(g = {}) {
|
|
403
|
+
const j = Object.assign({
|
|
405
404
|
value: t,
|
|
406
405
|
originalValue: a,
|
|
407
406
|
label: i.spec.label,
|
|
@@ -409,9 +408,9 @@ function M(r) {
|
|
|
409
408
|
spec: i.spec,
|
|
410
409
|
disableStackTrace: g.disableStackTrace || c
|
|
411
410
|
}, f, g.params);
|
|
412
|
-
for (const
|
|
413
|
-
const
|
|
414
|
-
return
|
|
411
|
+
for (const oe of Object.keys(j)) j[oe] = m(j[oe]);
|
|
412
|
+
const ue = new F(F.formatError(g.message || h, j), t, j.path, g.type || d, j.disableStackTrace);
|
|
413
|
+
return ue.params = j, ue;
|
|
415
414
|
}
|
|
416
415
|
const O = E ? u : o;
|
|
417
416
|
let x = {
|
|
@@ -419,38 +418,38 @@ function M(r) {
|
|
|
419
418
|
parent: y,
|
|
420
419
|
type: d,
|
|
421
420
|
from: s.from,
|
|
422
|
-
createError:
|
|
421
|
+
createError: v,
|
|
423
422
|
resolve: m,
|
|
424
423
|
options: s,
|
|
425
424
|
originalValue: a,
|
|
426
425
|
schema: i
|
|
427
426
|
};
|
|
428
|
-
const
|
|
429
|
-
|
|
427
|
+
const w = (g) => {
|
|
428
|
+
F.isError(g) ? O(g) : g ? o(null) : O(v());
|
|
430
429
|
}, T = (g) => {
|
|
431
|
-
|
|
430
|
+
F.isError(g) ? O(g) : u(g);
|
|
432
431
|
};
|
|
433
|
-
if (p &&
|
|
434
|
-
return
|
|
432
|
+
if (p && N(t))
|
|
433
|
+
return w(!0);
|
|
435
434
|
let D;
|
|
436
435
|
try {
|
|
437
|
-
var
|
|
438
|
-
if (D = l.call(x, t, x), typeof ((
|
|
436
|
+
var ae;
|
|
437
|
+
if (D = l.call(x, t, x), typeof ((ae = D) == null ? void 0 : ae.then) == "function") {
|
|
439
438
|
if (s.sync)
|
|
440
439
|
throw new Error(`Validation test of type: "${x.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);
|
|
441
|
-
return Promise.resolve(D).then(
|
|
440
|
+
return Promise.resolve(D).then(w, T);
|
|
442
441
|
}
|
|
443
442
|
} catch (g) {
|
|
444
443
|
T(g);
|
|
445
444
|
return;
|
|
446
445
|
}
|
|
447
|
-
|
|
446
|
+
w(D);
|
|
448
447
|
}
|
|
449
448
|
return e.OPTIONS = r, e;
|
|
450
449
|
}
|
|
451
|
-
function
|
|
450
|
+
function Je(r, e, t, n = t) {
|
|
452
451
|
let s, a, i;
|
|
453
|
-
return e ? (
|
|
452
|
+
return e ? (M.forEach(e, (u, o, d) => {
|
|
454
453
|
let l = o ? u.slice(1, u.length - 1) : u;
|
|
455
454
|
r = r.resolve({
|
|
456
455
|
context: n,
|
|
@@ -479,11 +478,11 @@ function Xe(r, e, t, n = t) {
|
|
|
479
478
|
schema: r
|
|
480
479
|
};
|
|
481
480
|
}
|
|
482
|
-
class
|
|
481
|
+
class K extends Set {
|
|
483
482
|
describe() {
|
|
484
483
|
const e = [];
|
|
485
484
|
for (const t of this.values())
|
|
486
|
-
e.push(
|
|
485
|
+
e.push(U.isRef(t) ? t.describe() : t);
|
|
487
486
|
return e;
|
|
488
487
|
}
|
|
489
488
|
resolveAll(e) {
|
|
@@ -493,15 +492,15 @@ class H extends Set {
|
|
|
493
492
|
return t;
|
|
494
493
|
}
|
|
495
494
|
clone() {
|
|
496
|
-
return new
|
|
495
|
+
return new K(this.values());
|
|
497
496
|
}
|
|
498
497
|
merge(e, t) {
|
|
499
498
|
const n = this.clone();
|
|
500
499
|
return e.forEach((s) => n.add(s)), t.forEach((s) => n.delete(s)), n;
|
|
501
500
|
}
|
|
502
501
|
}
|
|
503
|
-
function
|
|
504
|
-
if (
|
|
502
|
+
function R(r, e = /* @__PURE__ */ new Map()) {
|
|
503
|
+
if (se(r) || !r || typeof r != "object") return r;
|
|
505
504
|
if (e.has(r)) return e.get(r);
|
|
506
505
|
let t;
|
|
507
506
|
if (r instanceof Date)
|
|
@@ -510,24 +509,24 @@ function P(r, e = /* @__PURE__ */ new Map()) {
|
|
|
510
509
|
t = new RegExp(r), e.set(r, t);
|
|
511
510
|
else if (Array.isArray(r)) {
|
|
512
511
|
t = new Array(r.length), e.set(r, t);
|
|
513
|
-
for (let n = 0; n < r.length; n++) t[n] =
|
|
512
|
+
for (let n = 0; n < r.length; n++) t[n] = R(r[n], e);
|
|
514
513
|
} else if (r instanceof Map) {
|
|
515
514
|
t = /* @__PURE__ */ new Map(), e.set(r, t);
|
|
516
|
-
for (const [n, s] of r.entries()) t.set(n,
|
|
515
|
+
for (const [n, s] of r.entries()) t.set(n, R(s, e));
|
|
517
516
|
} else if (r instanceof Set) {
|
|
518
517
|
t = /* @__PURE__ */ new Set(), e.set(r, t);
|
|
519
|
-
for (const n of r) t.add(
|
|
518
|
+
for (const n of r) t.add(R(n, e));
|
|
520
519
|
} else if (r instanceof Object) {
|
|
521
520
|
t = {}, e.set(r, t);
|
|
522
|
-
for (const [n, s] of Object.entries(r)) t[n] =
|
|
521
|
+
for (const [n, s] of Object.entries(r)) t[n] = R(s, e);
|
|
523
522
|
} else
|
|
524
523
|
throw Error(`Unable to clone ${r}`);
|
|
525
524
|
return t;
|
|
526
525
|
}
|
|
527
|
-
class
|
|
526
|
+
class S {
|
|
528
527
|
constructor(e) {
|
|
529
|
-
this.type = void 0, this.deps = [], this.tests = void 0, this.transforms = void 0, this.conditions = [], this._mutate = void 0, this.internalTests = {}, this._whitelist = new
|
|
530
|
-
this.typeError(
|
|
528
|
+
this.type = void 0, this.deps = [], this.tests = void 0, this.transforms = void 0, this.conditions = [], this._mutate = void 0, this.internalTests = {}, this._whitelist = new K(), this._blacklist = new K(), this.exclusiveTests = /* @__PURE__ */ Object.create(null), this._typeCheck = void 0, this.spec = void 0, this.tests = [], this.transforms = [], this.withMutation(() => {
|
|
529
|
+
this.typeError($.notType);
|
|
531
530
|
}), this.type = e.type, this._typeCheck = e.check, this.spec = Object.assign({
|
|
532
531
|
strip: !1,
|
|
533
532
|
strict: !1,
|
|
@@ -549,7 +548,7 @@ class $ {
|
|
|
549
548
|
if (this._mutate)
|
|
550
549
|
return e && Object.assign(this.spec, e), this;
|
|
551
550
|
const t = Object.create(Object.getPrototypeOf(this));
|
|
552
|
-
return t.type = this.type, t._typeCheck = this._typeCheck, t._whitelist = this._whitelist.clone(), t._blacklist = this._blacklist.clone(), t.internalTests = Object.assign({}, this.internalTests), t.exclusiveTests = Object.assign({}, this.exclusiveTests), t.deps = [...this.deps], t.conditions = [...this.conditions], t.tests = [...this.tests], t.transforms = [...this.transforms], t.spec =
|
|
551
|
+
return t.type = this.type, t._typeCheck = this._typeCheck, t._whitelist = this._whitelist.clone(), t._blacklist = this._blacklist.clone(), t.internalTests = Object.assign({}, this.internalTests), t.exclusiveTests = Object.assign({}, this.exclusiveTests), t.deps = [...this.deps], t.conditions = [...this.conditions], t.tests = [...this.tests], t.transforms = [...this.transforms], t.spec = R(Object.assign({}, this.spec, e)), t;
|
|
553
552
|
}
|
|
554
553
|
label(e) {
|
|
555
554
|
let t = this.clone();
|
|
@@ -606,7 +605,7 @@ class $ {
|
|
|
606
605
|
value: e
|
|
607
606
|
}, t)), s = t.assert === "ignore-optionality", a = n._cast(e, t);
|
|
608
607
|
if (t.assert !== !1 && !n.isType(a)) {
|
|
609
|
-
if (s &&
|
|
608
|
+
if (s && N(a))
|
|
610
609
|
return a;
|
|
611
610
|
let i = I(e), u = I(a);
|
|
612
611
|
throw new TypeError(`The value of ${t.path || "field"} could not be cast to a value that satisfies the schema type: "${n.type}".
|
|
@@ -717,9 +716,9 @@ attempted value: ${i}
|
|
|
717
716
|
value: e
|
|
718
717
|
})), a = (n = t == null ? void 0 : t.disableStackTrace) != null ? n : s.spec.disableStackTrace;
|
|
719
718
|
return new Promise((i, u) => s._validate(e, t, (o, d) => {
|
|
720
|
-
|
|
719
|
+
F.isError(o) && (o.value = d), u(o);
|
|
721
720
|
}, (o, d) => {
|
|
722
|
-
o.length ? u(new
|
|
721
|
+
o.length ? u(new F(o, d, void 0, void 0, a)) : i(d);
|
|
723
722
|
}));
|
|
724
723
|
}
|
|
725
724
|
validateSync(e, t) {
|
|
@@ -730,15 +729,15 @@ attempted value: ${i}
|
|
|
730
729
|
return s._validate(e, Object.assign({}, t, {
|
|
731
730
|
sync: !0
|
|
732
731
|
}), (u, o) => {
|
|
733
|
-
throw
|
|
732
|
+
throw F.isError(u) && (u.value = o), u;
|
|
734
733
|
}, (u, o) => {
|
|
735
|
-
if (u.length) throw new
|
|
734
|
+
if (u.length) throw new F(u, e, void 0, void 0, i);
|
|
736
735
|
a = o;
|
|
737
736
|
}), a;
|
|
738
737
|
}
|
|
739
738
|
isValid(e, t) {
|
|
740
739
|
return this.validate(e, t).then(() => !0, (n) => {
|
|
741
|
-
if (
|
|
740
|
+
if (F.isError(n)) return !1;
|
|
742
741
|
throw n;
|
|
743
742
|
});
|
|
744
743
|
}
|
|
@@ -746,13 +745,13 @@ attempted value: ${i}
|
|
|
746
745
|
try {
|
|
747
746
|
return this.validateSync(e, t), !0;
|
|
748
747
|
} catch (n) {
|
|
749
|
-
if (
|
|
748
|
+
if (F.isError(n)) return !1;
|
|
750
749
|
throw n;
|
|
751
750
|
}
|
|
752
751
|
}
|
|
753
752
|
_getDefault(e) {
|
|
754
753
|
let t = this.spec.default;
|
|
755
|
-
return t == null ? t : typeof t == "function" ? t.call(this, e) :
|
|
754
|
+
return t == null ? t : typeof t == "function" ? t.call(this, e) : R(t);
|
|
756
755
|
}
|
|
757
756
|
getDefault(e) {
|
|
758
757
|
return this.resolve(e || {})._getDefault(e);
|
|
@@ -771,7 +770,7 @@ attempted value: ${i}
|
|
|
771
770
|
const n = this.clone({
|
|
772
771
|
nullable: e
|
|
773
772
|
});
|
|
774
|
-
return n.internalTests.nullable =
|
|
773
|
+
return n.internalTests.nullable = P({
|
|
775
774
|
message: t,
|
|
776
775
|
name: "nullable",
|
|
777
776
|
test(s) {
|
|
@@ -783,7 +782,7 @@ attempted value: ${i}
|
|
|
783
782
|
const n = this.clone({
|
|
784
783
|
optional: e
|
|
785
784
|
});
|
|
786
|
-
return n.internalTests.optionality =
|
|
785
|
+
return n.internalTests.optionality = P({
|
|
787
786
|
message: t,
|
|
788
787
|
name: "optionality",
|
|
789
788
|
test(s) {
|
|
@@ -794,16 +793,16 @@ attempted value: ${i}
|
|
|
794
793
|
optional() {
|
|
795
794
|
return this.optionality(!0);
|
|
796
795
|
}
|
|
797
|
-
defined(e =
|
|
796
|
+
defined(e = $.defined) {
|
|
798
797
|
return this.optionality(!1, e);
|
|
799
798
|
}
|
|
800
799
|
nullable() {
|
|
801
800
|
return this.nullability(!0);
|
|
802
801
|
}
|
|
803
|
-
nonNullable(e =
|
|
802
|
+
nonNullable(e = $.notNull) {
|
|
804
803
|
return this.nullability(!1, e);
|
|
805
804
|
}
|
|
806
|
-
required(e =
|
|
805
|
+
required(e = $.required) {
|
|
807
806
|
return this.clone().withMutation((t) => t.nonNullable(e).defined(e));
|
|
808
807
|
}
|
|
809
808
|
notRequired() {
|
|
@@ -837,22 +836,22 @@ attempted value: ${i}
|
|
|
837
836
|
name: e[0],
|
|
838
837
|
message: e[1],
|
|
839
838
|
test: e[2]
|
|
840
|
-
}, t.message === void 0 && (t.message =
|
|
841
|
-
let n = this.clone(), s =
|
|
839
|
+
}, t.message === void 0 && (t.message = $.default), typeof t.test != "function") throw new TypeError("`test` is a required parameters");
|
|
840
|
+
let n = this.clone(), s = P(t), a = t.exclusive || t.name && n.exclusiveTests[t.name] === !0;
|
|
842
841
|
if (t.exclusive && !t.name)
|
|
843
842
|
throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");
|
|
844
843
|
return t.name && (n.exclusiveTests[t.name] = !!t.exclusive), n.tests = n.tests.filter((i) => !(i.OPTIONS.name === t.name && (a || i.OPTIONS.test === s.OPTIONS.test))), n.tests.push(s), n;
|
|
845
844
|
}
|
|
846
845
|
when(e, t) {
|
|
847
846
|
!Array.isArray(e) && typeof e != "string" && (t = e, e = ".");
|
|
848
|
-
let n = this.clone(), s =
|
|
847
|
+
let n = this.clone(), s = we(e).map((a) => new U(a));
|
|
849
848
|
return s.forEach((a) => {
|
|
850
849
|
a.isSibling && n.deps.push(a.key);
|
|
851
|
-
}), n.conditions.push(typeof t == "function" ? new
|
|
850
|
+
}), n.conditions.push(typeof t == "function" ? new H(s, t) : H.fromOptions(s, t)), n;
|
|
852
851
|
}
|
|
853
852
|
typeError(e) {
|
|
854
853
|
let t = this.clone();
|
|
855
|
-
return t.internalTests.typeError =
|
|
854
|
+
return t.internalTests.typeError = P({
|
|
856
855
|
message: e,
|
|
857
856
|
name: "typeError",
|
|
858
857
|
skipAbsent: !0,
|
|
@@ -865,11 +864,11 @@ attempted value: ${i}
|
|
|
865
864
|
}
|
|
866
865
|
}), t;
|
|
867
866
|
}
|
|
868
|
-
oneOf(e, t =
|
|
867
|
+
oneOf(e, t = $.oneOf) {
|
|
869
868
|
let n = this.clone();
|
|
870
869
|
return e.forEach((s) => {
|
|
871
870
|
n._whitelist.add(s), n._blacklist.delete(s);
|
|
872
|
-
}), n.internalTests.whiteList =
|
|
871
|
+
}), n.internalTests.whiteList = P({
|
|
873
872
|
message: t,
|
|
874
873
|
name: "oneOf",
|
|
875
874
|
skipAbsent: !0,
|
|
@@ -884,11 +883,11 @@ attempted value: ${i}
|
|
|
884
883
|
}
|
|
885
884
|
}), n;
|
|
886
885
|
}
|
|
887
|
-
notOneOf(e, t =
|
|
886
|
+
notOneOf(e, t = $.notOneOf) {
|
|
888
887
|
let n = this.clone();
|
|
889
888
|
return e.forEach((s) => {
|
|
890
889
|
n._blacklist.add(s), n._whitelist.delete(s);
|
|
891
|
-
}), n.internalTests.blacklist =
|
|
890
|
+
}), n.internalTests.blacklist = P({
|
|
892
891
|
message: t,
|
|
893
892
|
name: "notOneOf",
|
|
894
893
|
test(s) {
|
|
@@ -934,22 +933,22 @@ attempted value: ${i}
|
|
|
934
933
|
};
|
|
935
934
|
}
|
|
936
935
|
}
|
|
937
|
-
|
|
938
|
-
for (const r of ["validate", "validateSync"])
|
|
936
|
+
S.prototype.__isYupSchema__ = !0;
|
|
937
|
+
for (const r of ["validate", "validateSync"]) S.prototype[`${r}At`] = function(e, t, n = {}) {
|
|
939
938
|
const {
|
|
940
939
|
parent: s,
|
|
941
940
|
parentPath: a,
|
|
942
941
|
schema: i
|
|
943
|
-
} =
|
|
942
|
+
} = Je(this, e, t, n.context);
|
|
944
943
|
return i[r](s && s[a], Object.assign({}, n, {
|
|
945
944
|
parent: s,
|
|
946
945
|
path: e
|
|
947
946
|
}));
|
|
948
947
|
};
|
|
949
|
-
for (const r of ["equals", "is"])
|
|
950
|
-
for (const r of ["not", "nope"])
|
|
951
|
-
const
|
|
952
|
-
function
|
|
948
|
+
for (const r of ["equals", "is"]) S.prototype[r] = S.prototype.oneOf;
|
|
949
|
+
for (const r of ["not", "nope"]) S.prototype[r] = S.prototype.notOneOf;
|
|
950
|
+
const Qe = /^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;
|
|
951
|
+
function We(r) {
|
|
953
952
|
const e = ne(r);
|
|
954
953
|
if (!e) return Date.parse ? Date.parse(r) : Number.NaN;
|
|
955
954
|
if (e.z === void 0 && e.plusMinus === void 0)
|
|
@@ -959,7 +958,7 @@ function He(r) {
|
|
|
959
958
|
}
|
|
960
959
|
function ne(r) {
|
|
961
960
|
var e, t;
|
|
962
|
-
const n =
|
|
961
|
+
const n = Qe.exec(r);
|
|
963
962
|
return n ? {
|
|
964
963
|
year: k(n[1]),
|
|
965
964
|
month: k(n[2], 1) - 1,
|
|
@@ -981,17 +980,17 @@ function ne(r) {
|
|
|
981
980
|
function k(r, e = 0) {
|
|
982
981
|
return Number(r) || e;
|
|
983
982
|
}
|
|
984
|
-
let
|
|
983
|
+
let et = (
|
|
985
984
|
// eslint-disable-next-line
|
|
986
985
|
/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/
|
|
987
|
-
),
|
|
986
|
+
), tt = (
|
|
988
987
|
// eslint-disable-next-line
|
|
989
988
|
/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i
|
|
990
|
-
),
|
|
989
|
+
), nt = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i, rt = "^\\d{4}-\\d{2}-\\d{2}", st = "\\d{2}:\\d{2}:\\d{2}", it = "(([+-]\\d{2}(:?\\d{2})?)|Z)", at = new RegExp(`${rt}T${st}(\\.\\d+)?${it}$`), ut = (r) => N(r) || r === r.trim(), ot = {}.toString();
|
|
991
990
|
function A() {
|
|
992
|
-
return new
|
|
991
|
+
return new $e();
|
|
993
992
|
}
|
|
994
|
-
class
|
|
993
|
+
class $e extends S {
|
|
995
994
|
constructor() {
|
|
996
995
|
super({
|
|
997
996
|
type: "string",
|
|
@@ -1002,13 +1001,13 @@ class _e extends $ {
|
|
|
1002
1001
|
this.transform((e, t, n) => {
|
|
1003
1002
|
if (!n.spec.coerce || n.isType(e) || Array.isArray(e)) return e;
|
|
1004
1003
|
const s = e != null && e.toString ? e.toString() : e;
|
|
1005
|
-
return s ===
|
|
1004
|
+
return s === ot ? e : s;
|
|
1006
1005
|
});
|
|
1007
1006
|
});
|
|
1008
1007
|
}
|
|
1009
1008
|
required(e) {
|
|
1010
1009
|
return super.required(e).withMutation((t) => t.test({
|
|
1011
|
-
message: e ||
|
|
1010
|
+
message: e || $.required,
|
|
1012
1011
|
name: "required",
|
|
1013
1012
|
skipAbsent: !0,
|
|
1014
1013
|
test: (n) => !!n.length
|
|
@@ -1017,7 +1016,7 @@ class _e extends $ {
|
|
|
1017
1016
|
notRequired() {
|
|
1018
1017
|
return super.notRequired().withMutation((e) => (e.tests = e.tests.filter((t) => t.OPTIONS.name !== "required"), e));
|
|
1019
1018
|
}
|
|
1020
|
-
length(e, t =
|
|
1019
|
+
length(e, t = _.length) {
|
|
1021
1020
|
return this.test({
|
|
1022
1021
|
message: t,
|
|
1023
1022
|
name: "length",
|
|
@@ -1031,7 +1030,7 @@ class _e extends $ {
|
|
|
1031
1030
|
}
|
|
1032
1031
|
});
|
|
1033
1032
|
}
|
|
1034
|
-
min(e, t =
|
|
1033
|
+
min(e, t = _.min) {
|
|
1035
1034
|
return this.test({
|
|
1036
1035
|
message: t,
|
|
1037
1036
|
name: "min",
|
|
@@ -1045,7 +1044,7 @@ class _e extends $ {
|
|
|
1045
1044
|
}
|
|
1046
1045
|
});
|
|
1047
1046
|
}
|
|
1048
|
-
max(e, t =
|
|
1047
|
+
max(e, t = _.max) {
|
|
1049
1048
|
return this.test({
|
|
1050
1049
|
name: "max",
|
|
1051
1050
|
exclusive: !0,
|
|
@@ -1067,7 +1066,7 @@ class _e extends $ {
|
|
|
1067
1066
|
name: a
|
|
1068
1067
|
} = t : s = t), this.test({
|
|
1069
1068
|
name: a || "matches",
|
|
1070
|
-
message: s ||
|
|
1069
|
+
message: s || _.matches,
|
|
1071
1070
|
params: {
|
|
1072
1071
|
regex: e
|
|
1073
1072
|
},
|
|
@@ -1075,22 +1074,22 @@ class _e extends $ {
|
|
|
1075
1074
|
test: (i) => i === "" && n || i.search(e) !== -1
|
|
1076
1075
|
});
|
|
1077
1076
|
}
|
|
1078
|
-
email(e =
|
|
1079
|
-
return this.matches(
|
|
1077
|
+
email(e = _.email) {
|
|
1078
|
+
return this.matches(et, {
|
|
1080
1079
|
name: "email",
|
|
1081
1080
|
message: e,
|
|
1082
1081
|
excludeEmptyString: !0
|
|
1083
1082
|
});
|
|
1084
1083
|
}
|
|
1085
|
-
url(e =
|
|
1086
|
-
return this.matches(
|
|
1084
|
+
url(e = _.url) {
|
|
1085
|
+
return this.matches(tt, {
|
|
1087
1086
|
name: "url",
|
|
1088
1087
|
message: e,
|
|
1089
1088
|
excludeEmptyString: !0
|
|
1090
1089
|
});
|
|
1091
1090
|
}
|
|
1092
|
-
uuid(e =
|
|
1093
|
-
return this.matches(
|
|
1091
|
+
uuid(e = _.uuid) {
|
|
1092
|
+
return this.matches(nt, {
|
|
1094
1093
|
name: "uuid",
|
|
1095
1094
|
message: e,
|
|
1096
1095
|
excludeEmptyString: !1
|
|
@@ -1102,13 +1101,13 @@ class _e extends $ {
|
|
|
1102
1101
|
message: t = "",
|
|
1103
1102
|
allowOffset: n = !1,
|
|
1104
1103
|
precision: s = void 0
|
|
1105
|
-
} = e : t = e), this.matches(
|
|
1104
|
+
} = e : t = e), this.matches(at, {
|
|
1106
1105
|
name: "datetime",
|
|
1107
|
-
message: t ||
|
|
1106
|
+
message: t || _.datetime,
|
|
1108
1107
|
excludeEmptyString: !0
|
|
1109
1108
|
}).test({
|
|
1110
1109
|
name: "datetime_offset",
|
|
1111
|
-
message: t ||
|
|
1110
|
+
message: t || _.datetime_offset,
|
|
1112
1111
|
params: {
|
|
1113
1112
|
allowOffset: n
|
|
1114
1113
|
},
|
|
@@ -1120,7 +1119,7 @@ class _e extends $ {
|
|
|
1120
1119
|
}
|
|
1121
1120
|
}).test({
|
|
1122
1121
|
name: "datetime_precision",
|
|
1123
|
-
message: t ||
|
|
1122
|
+
message: t || _.datetime_precision,
|
|
1124
1123
|
params: {
|
|
1125
1124
|
precision: s
|
|
1126
1125
|
},
|
|
@@ -1136,48 +1135,48 @@ class _e extends $ {
|
|
|
1136
1135
|
ensure() {
|
|
1137
1136
|
return this.default("").transform((e) => e === null ? "" : e);
|
|
1138
1137
|
}
|
|
1139
|
-
trim(e =
|
|
1138
|
+
trim(e = _.trim) {
|
|
1140
1139
|
return this.transform((t) => t != null ? t.trim() : t).test({
|
|
1141
1140
|
message: e,
|
|
1142
1141
|
name: "trim",
|
|
1143
|
-
test:
|
|
1142
|
+
test: ut
|
|
1144
1143
|
});
|
|
1145
1144
|
}
|
|
1146
|
-
lowercase(e =
|
|
1147
|
-
return this.transform((t) =>
|
|
1145
|
+
lowercase(e = _.lowercase) {
|
|
1146
|
+
return this.transform((t) => N(t) ? t : t.toLowerCase()).test({
|
|
1148
1147
|
message: e,
|
|
1149
1148
|
name: "string_case",
|
|
1150
1149
|
exclusive: !0,
|
|
1151
1150
|
skipAbsent: !0,
|
|
1152
|
-
test: (t) =>
|
|
1151
|
+
test: (t) => N(t) || t === t.toLowerCase()
|
|
1153
1152
|
});
|
|
1154
1153
|
}
|
|
1155
|
-
uppercase(e =
|
|
1156
|
-
return this.transform((t) =>
|
|
1154
|
+
uppercase(e = _.uppercase) {
|
|
1155
|
+
return this.transform((t) => N(t) ? t : t.toUpperCase()).test({
|
|
1157
1156
|
message: e,
|
|
1158
1157
|
name: "string_case",
|
|
1159
1158
|
exclusive: !0,
|
|
1160
1159
|
skipAbsent: !0,
|
|
1161
|
-
test: (t) =>
|
|
1160
|
+
test: (t) => N(t) || t === t.toUpperCase()
|
|
1162
1161
|
});
|
|
1163
1162
|
}
|
|
1164
1163
|
}
|
|
1165
|
-
A.prototype =
|
|
1166
|
-
let
|
|
1167
|
-
class
|
|
1164
|
+
A.prototype = $e.prototype;
|
|
1165
|
+
let lt = /* @__PURE__ */ new Date(""), ct = (r) => Object.prototype.toString.call(r) === "[object Date]";
|
|
1166
|
+
class ie extends S {
|
|
1168
1167
|
constructor() {
|
|
1169
1168
|
super({
|
|
1170
1169
|
type: "date",
|
|
1171
1170
|
check(e) {
|
|
1172
|
-
return
|
|
1171
|
+
return ct(e) && !isNaN(e.getTime());
|
|
1173
1172
|
}
|
|
1174
1173
|
}), this.withMutation(() => {
|
|
1175
|
-
this.transform((e, t, n) => !n.spec.coerce || n.isType(e) || e === null ? e : (e =
|
|
1174
|
+
this.transform((e, t, n) => !n.spec.coerce || n.isType(e) || e === null ? e : (e = We(e), isNaN(e) ? ie.INVALID_DATE : new Date(e)));
|
|
1176
1175
|
});
|
|
1177
1176
|
}
|
|
1178
1177
|
prepareParam(e, t) {
|
|
1179
1178
|
let n;
|
|
1180
|
-
if (
|
|
1179
|
+
if (U.isRef(e))
|
|
1181
1180
|
n = e;
|
|
1182
1181
|
else {
|
|
1183
1182
|
let s = this.cast(e);
|
|
@@ -1217,20 +1216,20 @@ class se extends $ {
|
|
|
1217
1216
|
});
|
|
1218
1217
|
}
|
|
1219
1218
|
}
|
|
1220
|
-
|
|
1221
|
-
function
|
|
1219
|
+
ie.INVALID_DATE = lt;
|
|
1220
|
+
function ft(r, e = []) {
|
|
1222
1221
|
let t = [], n = /* @__PURE__ */ new Set(), s = new Set(e.map(([i, u]) => `${i}-${u}`));
|
|
1223
1222
|
function a(i, u) {
|
|
1224
|
-
let o =
|
|
1223
|
+
let o = M.split(i)[0];
|
|
1225
1224
|
n.add(o), s.has(`${u}-${o}`) || t.push([u, o]);
|
|
1226
1225
|
}
|
|
1227
1226
|
for (const i of Object.keys(r)) {
|
|
1228
1227
|
let u = r[i];
|
|
1229
|
-
n.add(i),
|
|
1228
|
+
n.add(i), U.isRef(u) && u.isSibling ? a(u.path, i) : se(u) && "deps" in u && u.deps.forEach((o) => a(o, i));
|
|
1230
1229
|
}
|
|
1231
|
-
return
|
|
1230
|
+
return Re.array(Array.from(n), t).reverse();
|
|
1232
1231
|
}
|
|
1233
|
-
function
|
|
1232
|
+
function me(r, e) {
|
|
1234
1233
|
let t = 1 / 0;
|
|
1235
1234
|
return r.some((n, s) => {
|
|
1236
1235
|
var a;
|
|
@@ -1238,10 +1237,10 @@ function pe(r, e) {
|
|
|
1238
1237
|
return t = s, !0;
|
|
1239
1238
|
}), t;
|
|
1240
1239
|
}
|
|
1241
|
-
function
|
|
1242
|
-
return (e, t) =>
|
|
1240
|
+
function Se(r) {
|
|
1241
|
+
return (e, t) => me(r, e) - me(r, t);
|
|
1243
1242
|
}
|
|
1244
|
-
const
|
|
1243
|
+
const dt = (r, e, t) => {
|
|
1245
1244
|
if (typeof r != "string")
|
|
1246
1245
|
return r;
|
|
1247
1246
|
let n = r;
|
|
@@ -1266,29 +1265,29 @@ function Y(r) {
|
|
|
1266
1265
|
types: r.spec.types.map(Y)
|
|
1267
1266
|
}) : "optional" in r ? r.optional() : r;
|
|
1268
1267
|
}
|
|
1269
|
-
const
|
|
1270
|
-
const t = [...
|
|
1268
|
+
const ht = (r, e) => {
|
|
1269
|
+
const t = [...M.normalizePath(e)];
|
|
1271
1270
|
if (t.length === 1) return t[0] in r;
|
|
1272
|
-
let n = t.pop(), s =
|
|
1271
|
+
let n = t.pop(), s = M.getter(M.join(t), !0)(r);
|
|
1273
1272
|
return !!(s && n in s);
|
|
1274
1273
|
};
|
|
1275
|
-
let
|
|
1276
|
-
function
|
|
1274
|
+
let ye = (r) => Object.prototype.toString.call(r) === "[object Object]";
|
|
1275
|
+
function be(r, e) {
|
|
1277
1276
|
let t = Object.keys(r.fields);
|
|
1278
1277
|
return Object.keys(e).filter((n) => t.indexOf(n) === -1);
|
|
1279
1278
|
}
|
|
1280
|
-
const
|
|
1281
|
-
function
|
|
1282
|
-
return new
|
|
1279
|
+
const pt = Se([]);
|
|
1280
|
+
function Oe(r) {
|
|
1281
|
+
return new Te(r);
|
|
1283
1282
|
}
|
|
1284
|
-
class
|
|
1283
|
+
class Te extends S {
|
|
1285
1284
|
constructor(e) {
|
|
1286
1285
|
super({
|
|
1287
1286
|
type: "object",
|
|
1288
1287
|
check(t) {
|
|
1289
|
-
return
|
|
1288
|
+
return ye(t) || typeof t == "function";
|
|
1290
1289
|
}
|
|
1291
|
-
}), this.fields = /* @__PURE__ */ Object.create(null), this._sortErrors =
|
|
1290
|
+
}), this.fields = /* @__PURE__ */ Object.create(null), this._sortErrors = pt, this._nodes = [], this._excludedEdges = [], this.withMutation(() => {
|
|
1292
1291
|
e && this.shape(e);
|
|
1293
1292
|
});
|
|
1294
1293
|
}
|
|
@@ -1310,7 +1309,7 @@ class Se extends $ {
|
|
|
1310
1309
|
context: t.context,
|
|
1311
1310
|
parent: o
|
|
1312
1311
|
});
|
|
1313
|
-
let E = h instanceof
|
|
1312
|
+
let E = h instanceof S ? h.spec : void 0, c = E == null ? void 0 : E.strict;
|
|
1314
1313
|
if (E != null && E.strip) {
|
|
1315
1314
|
l = l || f in s;
|
|
1316
1315
|
continue;
|
|
@@ -1334,7 +1333,7 @@ class Se extends $ {
|
|
|
1334
1333
|
schema: this,
|
|
1335
1334
|
value: i
|
|
1336
1335
|
}, ...a], t.__validating = !0, t.originalValue = i, super._validate(e, t, n, (o, d) => {
|
|
1337
|
-
if (!u || !
|
|
1336
|
+
if (!u || !ye(d)) {
|
|
1338
1337
|
s(o, d);
|
|
1339
1338
|
return;
|
|
1340
1339
|
}
|
|
@@ -1342,7 +1341,7 @@ class Se extends $ {
|
|
|
1342
1341
|
let l = [];
|
|
1343
1342
|
for (let f of this._nodes) {
|
|
1344
1343
|
let h = this.fields[f];
|
|
1345
|
-
!h ||
|
|
1344
|
+
!h || U.isRef(h) || l.push(h.asNestedTest({
|
|
1346
1345
|
options: t,
|
|
1347
1346
|
key: f,
|
|
1348
1347
|
parent: d,
|
|
@@ -1393,7 +1392,7 @@ class Se extends $ {
|
|
|
1393
1392
|
}
|
|
1394
1393
|
setFields(e, t) {
|
|
1395
1394
|
let n = this.clone();
|
|
1396
|
-
return n.fields = e, n._nodes =
|
|
1395
|
+
return n.fields = e, n._nodes = ft(e, t), n._sortErrors = Se(Object.keys(e)), t && (n._excludedEdges = t), n;
|
|
1397
1396
|
}
|
|
1398
1397
|
shape(e, t = []) {
|
|
1399
1398
|
return this.clone().withMutation((n) => {
|
|
@@ -1423,16 +1422,16 @@ class Se extends $ {
|
|
|
1423
1422
|
return this.pick(t);
|
|
1424
1423
|
}
|
|
1425
1424
|
from(e, t, n) {
|
|
1426
|
-
let s =
|
|
1425
|
+
let s = M.getter(e, !0);
|
|
1427
1426
|
return this.transform((a) => {
|
|
1428
1427
|
if (!a) return a;
|
|
1429
1428
|
let i = a;
|
|
1430
|
-
return
|
|
1429
|
+
return ht(a, e) && (i = Object.assign({}, a), n || delete i[e], i[t] = s(a)), i;
|
|
1431
1430
|
});
|
|
1432
1431
|
}
|
|
1433
1432
|
/** Parse an input JSON string to an object */
|
|
1434
1433
|
json() {
|
|
1435
|
-
return this.transform(
|
|
1434
|
+
return this.transform(dt);
|
|
1436
1435
|
}
|
|
1437
1436
|
/**
|
|
1438
1437
|
* Similar to `noUnknown` but only validates that an object is the right shape without stripping the unknown keys
|
|
@@ -1444,7 +1443,7 @@ class Se extends $ {
|
|
|
1444
1443
|
message: e || B.exact,
|
|
1445
1444
|
test(t) {
|
|
1446
1445
|
if (t == null) return !0;
|
|
1447
|
-
const n =
|
|
1446
|
+
const n = be(this.schema, t);
|
|
1448
1447
|
return n.length === 0 || this.createError({
|
|
1449
1448
|
params: {
|
|
1450
1449
|
properties: n.join(", ")
|
|
@@ -1466,7 +1465,7 @@ class Se extends $ {
|
|
|
1466
1465
|
message: t,
|
|
1467
1466
|
test(s) {
|
|
1468
1467
|
if (s == null) return !0;
|
|
1469
|
-
const a =
|
|
1468
|
+
const a = be(this.schema, s);
|
|
1470
1469
|
return !e || a.length === 0 || this.createError({
|
|
1471
1470
|
params: {
|
|
1472
1471
|
unknown: a.join(", ")
|
|
@@ -1510,27 +1509,27 @@ class Se extends $ {
|
|
|
1510
1509
|
return n;
|
|
1511
1510
|
}
|
|
1512
1511
|
}
|
|
1513
|
-
|
|
1514
|
-
const
|
|
1515
|
-
function
|
|
1516
|
-
if (document.head.querySelector(`#${
|
|
1512
|
+
Oe.prototype = Te.prototype;
|
|
1513
|
+
const mt = "#000639", yt = '<svg width="40" height="41" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 10.5C0 4.977 4.477.5 10 .5h20c5.523 0 10 4.477 10 10v20c0 5.523-4.477 10-10 10H10c-5.523 0-10-4.477-10-10v-20Z" fill="#F1F1F1"/><path fill-rule="evenodd" clip-rule="evenodd" d="M25.927 15.78a.75.75 0 1 0-1.06-1.06l-4.793 4.793-4.793-4.793a.75.75 0 0 0-1.061 1.06l4.793 4.793-4.793 4.793a.75.75 0 1 0 1.06 1.061l4.794-4.793 4.793 4.793a.75.75 0 0 0 1.06-1.06l-4.793-4.794 4.793-4.793Z" fill="#000639"/></svg>';
|
|
1514
|
+
function bt() {
|
|
1515
|
+
if (document.head.querySelector(`#${X}`)) return;
|
|
1517
1516
|
const e = document.createElement("style");
|
|
1518
|
-
e.id =
|
|
1517
|
+
e.id = X, e.dataset.testid = X, document.head.appendChild(e), e.textContent = `
|
|
1519
1518
|
|
|
1520
|
-
#${
|
|
1519
|
+
#${V}, #${V} * {
|
|
1521
1520
|
margin: 0;
|
|
1522
1521
|
padding: 0px;
|
|
1523
1522
|
box-sizing: border-box;
|
|
1524
1523
|
}
|
|
1525
1524
|
|
|
1526
|
-
#${
|
|
1525
|
+
#${G} {
|
|
1527
1526
|
position: absolute;
|
|
1528
1527
|
top: 50%;
|
|
1529
1528
|
left: 50%;
|
|
1530
1529
|
transform: translate(-50%, -50%);
|
|
1531
1530
|
}
|
|
1532
1531
|
|
|
1533
|
-
#${
|
|
1532
|
+
#${L} {
|
|
1534
1533
|
position: absolute;
|
|
1535
1534
|
top: 50%;
|
|
1536
1535
|
left: 50%;
|
|
@@ -1548,28 +1547,28 @@ function ht() {
|
|
|
1548
1547
|
}
|
|
1549
1548
|
`;
|
|
1550
1549
|
}
|
|
1551
|
-
function
|
|
1552
|
-
|
|
1550
|
+
function xt(r) {
|
|
1551
|
+
Oe({
|
|
1553
1552
|
fiatAmount: A().optional(),
|
|
1554
1553
|
fiatCurrency: A().optional(),
|
|
1555
1554
|
cryptoAmount: A().optional(),
|
|
1556
1555
|
cryptoCurrency: A().optional(),
|
|
1557
|
-
publicKey: A().
|
|
1556
|
+
publicKey: A().optional(),
|
|
1558
1557
|
redirectUrl: A().optional(),
|
|
1559
1558
|
side: A().oneOf(["buy", "sell"]).required()
|
|
1560
1559
|
}).validateSync(r, { abortEarly: !1 });
|
|
1561
1560
|
}
|
|
1562
|
-
function
|
|
1561
|
+
function gt() {
|
|
1563
1562
|
const r = document.createElement("div");
|
|
1564
|
-
return r.id =
|
|
1563
|
+
return r.id = V, r.dataset.testid = V, r.style.position = "fixed", r.style.top = "0px", r.style.left = "0px", r.style.width = "100%", r.style.height = "100%", r.style.zIndex = "999999999", r.style.backgroundColor = "rgba(0, 0, 0, 0.4)", r;
|
|
1565
1564
|
}
|
|
1566
|
-
function
|
|
1565
|
+
function Et() {
|
|
1567
1566
|
const r = document.createElement("button");
|
|
1568
|
-
return r.id = ee, r.dataset.testid = ee, r.setAttribute("type", "button"), r.style.width = "40px", r.style.height = "40px", r.style.position = "absolute", r.style.right = "0", r.style.zIndex = "40", r.style.backgroundColor = "transparent", r.style.border = "none", r.innerHTML =
|
|
1567
|
+
return r.id = ee, r.dataset.testid = ee, r.setAttribute("type", "button"), r.style.width = "40px", r.style.height = "40px", r.style.position = "absolute", r.style.right = "0", r.style.zIndex = "40", r.style.backgroundColor = "transparent", r.style.border = "none", r.innerHTML = yt, r;
|
|
1569
1568
|
}
|
|
1570
|
-
function
|
|
1569
|
+
function wt() {
|
|
1571
1570
|
const r = document.createElement("div");
|
|
1572
|
-
return r.id =
|
|
1571
|
+
return r.id = G, r.dataset.testid = G, r.style.width = "40px", r.style.height = "40px", r.style.backgroundColor = "transparent", r.style.border = `2px solid ${mt}`, r.style.borderLeftColor = "transparent", r.style.borderBottomColor = "transparent", r.style.borderRadius = "100%", r.animate && r.animate(
|
|
1573
1572
|
[{ transform: "rotate(0)" }, { transform: "rotate(360deg)" }],
|
|
1574
1573
|
{
|
|
1575
1574
|
duration: 300,
|
|
@@ -1577,13 +1576,13 @@ function bt() {
|
|
|
1577
1576
|
}
|
|
1578
1577
|
), r;
|
|
1579
1578
|
}
|
|
1580
|
-
function
|
|
1579
|
+
function vt() {
|
|
1581
1580
|
const r = document.createElement("iframe");
|
|
1582
|
-
return r.dataset.testid =
|
|
1581
|
+
return r.dataset.testid = L, r.name = L, r.id = L, r.allow = `clipboard-write self ${re}`, r;
|
|
1583
1582
|
}
|
|
1584
|
-
function
|
|
1585
|
-
const t = r ?? !1, a = e.side === "buy" ?
|
|
1586
|
-
i.target =
|
|
1583
|
+
function _t({ sandbox: r, ...e }) {
|
|
1584
|
+
const t = r ?? !1, n = t ? ge : re, s = t ? Ee : xe, a = e.side === "buy" ? n : s, i = document.createElement("form");
|
|
1585
|
+
i.target = L, i.dataset.testid = De, i.action = a ?? "", i.method = "GET", i.style.display = "none", ((f) => {
|
|
1587
1586
|
const h = process.env.NODE_ENV === "production", p = ["onSuccess", "onClose"];
|
|
1588
1587
|
h && p.push("side");
|
|
1589
1588
|
for (const y in f) {
|
|
@@ -1597,13 +1596,13 @@ function gt({ sandbox: r, ...e }) {
|
|
|
1597
1596
|
const l = document.createElement("input");
|
|
1598
1597
|
return l.name = "parentOrigin", l.value = window.location.origin, i.appendChild(d), i.appendChild(l), i;
|
|
1599
1598
|
}
|
|
1600
|
-
class
|
|
1599
|
+
class $t {
|
|
1601
1600
|
constructor(e) {
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
const t = process.env.NODE_ENV === "test", n = this.payload.sandboxMode ?? !1, i = this.payload.side === "buy" ?
|
|
1601
|
+
z(this, "payload");
|
|
1602
|
+
z(this, "container", null);
|
|
1603
|
+
z(this, "boundClose");
|
|
1604
|
+
z(this, "onMessage", (e) => {
|
|
1605
|
+
const t = process.env.NODE_ENV === "test", n = this.payload.sandboxMode ?? !1, s = n ? ge : re, a = n ? Ee : xe, i = this.payload.side === "buy" ? s : a;
|
|
1607
1606
|
if (t) {
|
|
1608
1607
|
if (e.source !== window) return;
|
|
1609
1608
|
} else {
|
|
@@ -1612,35 +1611,35 @@ class _t {
|
|
|
1612
1611
|
if (e.origin !== u.origin) return;
|
|
1613
1612
|
}
|
|
1614
1613
|
if (this.payload) {
|
|
1615
|
-
if (e.data.status ===
|
|
1616
|
-
const u = document.getElementById(
|
|
1614
|
+
if (e.data.status === Ae) {
|
|
1615
|
+
const u = document.getElementById(G);
|
|
1617
1616
|
u && u.remove();
|
|
1618
1617
|
}
|
|
1619
|
-
e.data.status ===
|
|
1618
|
+
e.data.status === le && (this.payload.onClose && this.payload.onClose(e.data), this.cleanup()), e.data.status === Ie && (this.payload.onSuccess && this.payload.onSuccess(e.data), this.cleanup());
|
|
1620
1619
|
}
|
|
1621
1620
|
});
|
|
1622
|
-
|
|
1621
|
+
bt(), xt(e), this.payload = e, this.boundClose = this.close.bind(this);
|
|
1623
1622
|
}
|
|
1624
1623
|
show() {
|
|
1625
|
-
this.container =
|
|
1626
|
-
const e =
|
|
1624
|
+
this.container = gt();
|
|
1625
|
+
const e = wt(), t = Et();
|
|
1627
1626
|
t.addEventListener("click", this.boundClose), this.container.appendChild(e), this.container.appendChild(t);
|
|
1628
|
-
const n =
|
|
1627
|
+
const n = vt();
|
|
1629
1628
|
this.container.appendChild(n), document.body.appendChild(this.container);
|
|
1630
|
-
const s =
|
|
1629
|
+
const s = _t(this.payload);
|
|
1631
1630
|
this.container.appendChild(s), s.submit(), window.addEventListener("message", this.onMessage);
|
|
1632
1631
|
}
|
|
1633
1632
|
close() {
|
|
1634
1633
|
this.payload.onClose && this.payload.onClose({
|
|
1635
|
-
status:
|
|
1634
|
+
status: le,
|
|
1636
1635
|
data: { reference: "" }
|
|
1637
1636
|
}), this.cleanup();
|
|
1638
1637
|
}
|
|
1639
1638
|
cleanup() {
|
|
1640
|
-
const e = document.getElementById(
|
|
1639
|
+
const e = document.getElementById(V), t = document.getElementById(ee);
|
|
1641
1640
|
t && t.removeEventListener("click", this.boundClose), window.removeEventListener("message", this.onMessage), e && document.body.removeChild(e);
|
|
1642
1641
|
}
|
|
1643
1642
|
}
|
|
1644
1643
|
export {
|
|
1645
|
-
|
|
1644
|
+
$t as BushaRampWidget
|
|
1646
1645
|
};
|