@heliofi/checkout-react 3.1.0 → 4.0.2
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/README.md +1 -1
- package/dist/helio-checkout-react.es.d.ts +0 -5
- package/dist/helio-checkout-react.es.js +40 -477
- package/package.json +12 -13
- package/dist/helio-checkout-react.umd.js +0 -31
package/README.md
CHANGED
|
@@ -56,7 +56,6 @@ export declare const HelioCheckout: (props: HelioCheckoutReactProps) => JSX_2.El
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
themeMode: EmbedThemeMode;
|
|
59
|
-
dropShadow?: boolean;
|
|
60
59
|
colors?: {
|
|
61
60
|
/** @deprecated - for internal use only */
|
|
62
61
|
primaryButtonBackground?: string;
|
|
@@ -75,14 +74,10 @@ export declare const HelioCheckout: (props: HelioCheckoutReactProps) => JSX_2.El
|
|
|
75
74
|
/** @deprecated - for internal use only */
|
|
76
75
|
backgroundSecondary?: string;
|
|
77
76
|
/** @deprecated - for internal use only */
|
|
78
|
-
primaryButtonShadow?: string;
|
|
79
|
-
/** @deprecated - for internal use only */
|
|
80
77
|
backgroundDashboard?: string;
|
|
81
78
|
/** @deprecated - for internal use only */
|
|
82
79
|
shadowPrimaryGray?: string;
|
|
83
80
|
/** @deprecated - for internal use only */
|
|
84
|
-
shadowWalletButton?: string;
|
|
85
|
-
/** @deprecated - for internal use only */
|
|
86
81
|
textLabel?: string;
|
|
87
82
|
/** @deprecated - for internal use only */
|
|
88
83
|
iconFillColor?: string;
|
|
@@ -1,499 +1,62 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* @license React
|
|
5
|
-
* react-jsx-runtime.production.js
|
|
6
|
-
*
|
|
7
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
8
|
-
*
|
|
9
|
-
* This source code is licensed under the MIT license found in the
|
|
10
|
-
* LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/
|
|
12
|
-
var ge;
|
|
13
|
-
function Ne() {
|
|
14
|
-
if (ge) return A;
|
|
15
|
-
ge = 1;
|
|
16
|
-
var a = Symbol.for("react.transitional.element"), c = Symbol.for("react.fragment");
|
|
17
|
-
function g(S, u, f) {
|
|
18
|
-
var d = null;
|
|
19
|
-
if (f !== void 0 && (d = "" + f), u.key !== void 0 && (d = "" + u.key), "key" in u) {
|
|
20
|
-
f = {};
|
|
21
|
-
for (var E in u)
|
|
22
|
-
E !== "key" && (f[E] = u[E]);
|
|
23
|
-
} else f = u;
|
|
24
|
-
return u = f.ref, {
|
|
25
|
-
$$typeof: a,
|
|
26
|
-
type: S,
|
|
27
|
-
key: d,
|
|
28
|
-
ref: u !== void 0 ? u : null,
|
|
29
|
-
props: f
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
return A.Fragment = c, A.jsx = g, A.jsxs = g, A;
|
|
33
|
-
}
|
|
34
|
-
var O = {};
|
|
35
|
-
/**
|
|
36
|
-
* @license React
|
|
37
|
-
* react-jsx-runtime.development.js
|
|
38
|
-
*
|
|
39
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
40
|
-
*
|
|
41
|
-
* This source code is licensed under the MIT license found in the
|
|
42
|
-
* LICENSE file in the root directory of this source tree.
|
|
43
|
-
*/
|
|
44
|
-
var he;
|
|
45
|
-
function Pe() {
|
|
46
|
-
return he || (he = 1, process.env.NODE_ENV !== "production" && function() {
|
|
47
|
-
function a(e) {
|
|
48
|
-
if (e == null) return null;
|
|
49
|
-
if (typeof e == "function")
|
|
50
|
-
return e.$$typeof === ke ? null : e.displayName || e.name || null;
|
|
51
|
-
if (typeof e == "string") return e;
|
|
52
|
-
switch (e) {
|
|
53
|
-
case W:
|
|
54
|
-
return "Fragment";
|
|
55
|
-
case Te:
|
|
56
|
-
return "Portal";
|
|
57
|
-
case D:
|
|
58
|
-
return "Profiler";
|
|
59
|
-
case Q:
|
|
60
|
-
return "StrictMode";
|
|
61
|
-
case F:
|
|
62
|
-
return "Suspense";
|
|
63
|
-
case I:
|
|
64
|
-
return "SuspenseList";
|
|
65
|
-
}
|
|
66
|
-
if (typeof e == "object")
|
|
67
|
-
switch (typeof e.tag == "number" && console.error(
|
|
68
|
-
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
69
|
-
), e.$$typeof) {
|
|
70
|
-
case re:
|
|
71
|
-
return (e.displayName || "Context") + ".Provider";
|
|
72
|
-
case ee:
|
|
73
|
-
return (e._context.displayName || "Context") + ".Consumer";
|
|
74
|
-
case H:
|
|
75
|
-
var r = e.render;
|
|
76
|
-
return e = e.displayName, e || (e = r.displayName || r.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
77
|
-
case L:
|
|
78
|
-
return r = e.displayName || null, r !== null ? r : a(e.type) || "Memo";
|
|
79
|
-
case q:
|
|
80
|
-
r = e._payload, e = e._init;
|
|
81
|
-
try {
|
|
82
|
-
return a(e(r));
|
|
83
|
-
} catch {
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
return null;
|
|
87
|
-
}
|
|
88
|
-
function c(e) {
|
|
89
|
-
return "" + e;
|
|
90
|
-
}
|
|
91
|
-
function g(e) {
|
|
92
|
-
try {
|
|
93
|
-
c(e);
|
|
94
|
-
var r = !1;
|
|
95
|
-
} catch {
|
|
96
|
-
r = !0;
|
|
97
|
-
}
|
|
98
|
-
if (r) {
|
|
99
|
-
r = console;
|
|
100
|
-
var t = r.error, n = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
101
|
-
return t.call(
|
|
102
|
-
r,
|
|
103
|
-
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
104
|
-
n
|
|
105
|
-
), c(e);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
function S() {
|
|
109
|
-
}
|
|
110
|
-
function u() {
|
|
111
|
-
if (y === 0) {
|
|
112
|
-
ne = console.log, ae = console.info, se = console.warn, ue = console.error, ce = console.group, ie = console.groupCollapsed, le = console.groupEnd;
|
|
113
|
-
var e = {
|
|
114
|
-
configurable: !0,
|
|
115
|
-
enumerable: !0,
|
|
116
|
-
value: S,
|
|
117
|
-
writable: !0
|
|
118
|
-
};
|
|
119
|
-
Object.defineProperties(console, {
|
|
120
|
-
info: e,
|
|
121
|
-
log: e,
|
|
122
|
-
warn: e,
|
|
123
|
-
error: e,
|
|
124
|
-
group: e,
|
|
125
|
-
groupCollapsed: e,
|
|
126
|
-
groupEnd: e
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
y++;
|
|
130
|
-
}
|
|
131
|
-
function f() {
|
|
132
|
-
if (y--, y === 0) {
|
|
133
|
-
var e = { configurable: !0, enumerable: !0, writable: !0 };
|
|
134
|
-
Object.defineProperties(console, {
|
|
135
|
-
log: C({}, e, { value: ne }),
|
|
136
|
-
info: C({}, e, { value: ae }),
|
|
137
|
-
warn: C({}, e, { value: se }),
|
|
138
|
-
error: C({}, e, { value: ue }),
|
|
139
|
-
group: C({}, e, { value: ce }),
|
|
140
|
-
groupCollapsed: C({}, e, { value: ie }),
|
|
141
|
-
groupEnd: C({}, e, { value: le })
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
0 > y && console.error(
|
|
145
|
-
"disabledDepth fell below zero. This is a bug in React. Please file an issue."
|
|
146
|
-
);
|
|
147
|
-
}
|
|
148
|
-
function d(e) {
|
|
149
|
-
if (V === void 0)
|
|
150
|
-
try {
|
|
151
|
-
throw Error();
|
|
152
|
-
} catch (t) {
|
|
153
|
-
var r = t.stack.trim().match(/\n( *(at )?)/);
|
|
154
|
-
V = r && r[1] || "", fe = -1 < t.stack.indexOf(`
|
|
155
|
-
at`) ? " (<anonymous>)" : -1 < t.stack.indexOf("@") ? "@unknown:0:0" : "";
|
|
156
|
-
}
|
|
157
|
-
return `
|
|
158
|
-
` + V + e + fe;
|
|
159
|
-
}
|
|
160
|
-
function E(e, r) {
|
|
161
|
-
if (!e || B) return "";
|
|
162
|
-
var t = G.get(e);
|
|
163
|
-
if (t !== void 0) return t;
|
|
164
|
-
B = !0, t = Error.prepareStackTrace, Error.prepareStackTrace = void 0;
|
|
165
|
-
var n = null;
|
|
166
|
-
n = _.H, _.H = null, u();
|
|
167
|
-
try {
|
|
168
|
-
var i = {
|
|
169
|
-
DetermineComponentFrameRoot: function() {
|
|
170
|
-
try {
|
|
171
|
-
if (r) {
|
|
172
|
-
var h = function() {
|
|
173
|
-
throw Error();
|
|
174
|
-
};
|
|
175
|
-
if (Object.defineProperty(h.prototype, "props", {
|
|
176
|
-
set: function() {
|
|
177
|
-
throw Error();
|
|
178
|
-
}
|
|
179
|
-
}), typeof Reflect == "object" && Reflect.construct) {
|
|
180
|
-
try {
|
|
181
|
-
Reflect.construct(h, []);
|
|
182
|
-
} catch (m) {
|
|
183
|
-
var Y = m;
|
|
184
|
-
}
|
|
185
|
-
Reflect.construct(e, [], h);
|
|
186
|
-
} else {
|
|
187
|
-
try {
|
|
188
|
-
h.call();
|
|
189
|
-
} catch (m) {
|
|
190
|
-
Y = m;
|
|
191
|
-
}
|
|
192
|
-
e.call(h.prototype);
|
|
193
|
-
}
|
|
194
|
-
} else {
|
|
195
|
-
try {
|
|
196
|
-
throw Error();
|
|
197
|
-
} catch (m) {
|
|
198
|
-
Y = m;
|
|
199
|
-
}
|
|
200
|
-
(h = e()) && typeof h.catch == "function" && h.catch(function() {
|
|
201
|
-
});
|
|
202
|
-
}
|
|
203
|
-
} catch (m) {
|
|
204
|
-
if (m && Y && typeof m.stack == "string")
|
|
205
|
-
return [m.stack, Y.stack];
|
|
206
|
-
}
|
|
207
|
-
return [null, null];
|
|
208
|
-
}
|
|
209
|
-
};
|
|
210
|
-
i.DetermineComponentFrameRoot.displayName = "DetermineComponentFrameRoot";
|
|
211
|
-
var s = Object.getOwnPropertyDescriptor(
|
|
212
|
-
i.DetermineComponentFrameRoot,
|
|
213
|
-
"name"
|
|
214
|
-
);
|
|
215
|
-
s && s.configurable && Object.defineProperty(
|
|
216
|
-
i.DetermineComponentFrameRoot,
|
|
217
|
-
"name",
|
|
218
|
-
{ value: "DetermineComponentFrameRoot" }
|
|
219
|
-
);
|
|
220
|
-
var o = i.DetermineComponentFrameRoot(), b = o[0], w = o[1];
|
|
221
|
-
if (b && w) {
|
|
222
|
-
var l = b.split(`
|
|
223
|
-
`), x = w.split(`
|
|
224
|
-
`);
|
|
225
|
-
for (o = s = 0; s < l.length && !l[s].includes(
|
|
226
|
-
"DetermineComponentFrameRoot"
|
|
227
|
-
); )
|
|
228
|
-
s++;
|
|
229
|
-
for (; o < x.length && !x[o].includes(
|
|
230
|
-
"DetermineComponentFrameRoot"
|
|
231
|
-
); )
|
|
232
|
-
o++;
|
|
233
|
-
if (s === l.length || o === x.length)
|
|
234
|
-
for (s = l.length - 1, o = x.length - 1; 1 <= s && 0 <= o && l[s] !== x[o]; )
|
|
235
|
-
o--;
|
|
236
|
-
for (; 1 <= s && 0 <= o; s--, o--)
|
|
237
|
-
if (l[s] !== x[o]) {
|
|
238
|
-
if (s !== 1 || o !== 1)
|
|
239
|
-
do
|
|
240
|
-
if (s--, o--, 0 > o || l[s] !== x[o]) {
|
|
241
|
-
var R = `
|
|
242
|
-
` + l[s].replace(
|
|
243
|
-
" at new ",
|
|
244
|
-
" at "
|
|
245
|
-
);
|
|
246
|
-
return e.displayName && R.includes("<anonymous>") && (R = R.replace("<anonymous>", e.displayName)), typeof e == "function" && G.set(e, R), R;
|
|
247
|
-
}
|
|
248
|
-
while (1 <= s && 0 <= o);
|
|
249
|
-
break;
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
} finally {
|
|
253
|
-
B = !1, _.H = n, f(), Error.prepareStackTrace = t;
|
|
254
|
-
}
|
|
255
|
-
return l = (l = e ? e.displayName || e.name : "") ? d(l) : "", typeof e == "function" && G.set(e, l), l;
|
|
256
|
-
}
|
|
257
|
-
function k(e) {
|
|
258
|
-
if (e == null) return "";
|
|
259
|
-
if (typeof e == "function") {
|
|
260
|
-
var r = e.prototype;
|
|
261
|
-
return E(
|
|
262
|
-
e,
|
|
263
|
-
!(!r || !r.isReactComponent)
|
|
264
|
-
);
|
|
265
|
-
}
|
|
266
|
-
if (typeof e == "string") return d(e);
|
|
267
|
-
switch (e) {
|
|
268
|
-
case F:
|
|
269
|
-
return d("Suspense");
|
|
270
|
-
case I:
|
|
271
|
-
return d("SuspenseList");
|
|
272
|
-
}
|
|
273
|
-
if (typeof e == "object")
|
|
274
|
-
switch (e.$$typeof) {
|
|
275
|
-
case H:
|
|
276
|
-
return e = E(e.render, !1), e;
|
|
277
|
-
case L:
|
|
278
|
-
return k(e.type);
|
|
279
|
-
case q:
|
|
280
|
-
r = e._payload, e = e._init;
|
|
281
|
-
try {
|
|
282
|
-
return k(e(r));
|
|
283
|
-
} catch {
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
return "";
|
|
287
|
-
}
|
|
288
|
-
function p() {
|
|
289
|
-
var e = _.A;
|
|
290
|
-
return e === null ? null : e.getOwner();
|
|
291
|
-
}
|
|
292
|
-
function N(e) {
|
|
293
|
-
if (oe.call(e, "key")) {
|
|
294
|
-
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
295
|
-
if (r && r.isReactWarning) return !1;
|
|
296
|
-
}
|
|
297
|
-
return e.key !== void 0;
|
|
298
|
-
}
|
|
299
|
-
function P(e, r) {
|
|
300
|
-
function t() {
|
|
301
|
-
de || (de = !0, console.error(
|
|
302
|
-
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
303
|
-
r
|
|
304
|
-
));
|
|
305
|
-
}
|
|
306
|
-
t.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
307
|
-
get: t,
|
|
308
|
-
configurable: !0
|
|
309
|
-
});
|
|
310
|
-
}
|
|
311
|
-
function M() {
|
|
312
|
-
var e = a(this.type);
|
|
313
|
-
return Ee[e] || (Ee[e] = !0, console.error(
|
|
314
|
-
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
315
|
-
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
316
|
-
}
|
|
317
|
-
function v(e, r, t, n, i, s) {
|
|
318
|
-
return t = s.ref, e = {
|
|
319
|
-
$$typeof: U,
|
|
320
|
-
type: e,
|
|
321
|
-
key: r,
|
|
322
|
-
props: s,
|
|
323
|
-
_owner: i
|
|
324
|
-
}, (t !== void 0 ? t : null) !== null ? Object.defineProperty(e, "ref", {
|
|
325
|
-
enumerable: !1,
|
|
326
|
-
get: M
|
|
327
|
-
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
328
|
-
configurable: !1,
|
|
329
|
-
enumerable: !1,
|
|
330
|
-
writable: !0,
|
|
331
|
-
value: 0
|
|
332
|
-
}), Object.defineProperty(e, "_debugInfo", {
|
|
333
|
-
configurable: !1,
|
|
334
|
-
enumerable: !1,
|
|
335
|
-
writable: !0,
|
|
336
|
-
value: null
|
|
337
|
-
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
338
|
-
}
|
|
339
|
-
function j(e, r, t, n, i, s) {
|
|
340
|
-
if (typeof e == "string" || typeof e == "function" || e === W || e === D || e === Q || e === F || e === I || e === Se || typeof e == "object" && e !== null && (e.$$typeof === q || e.$$typeof === L || e.$$typeof === re || e.$$typeof === ee || e.$$typeof === H || e.$$typeof === we || e.getModuleId !== void 0)) {
|
|
341
|
-
var o = r.children;
|
|
342
|
-
if (o !== void 0)
|
|
343
|
-
if (n)
|
|
344
|
-
if (z(o)) {
|
|
345
|
-
for (n = 0; n < o.length; n++)
|
|
346
|
-
Z(o[n], e);
|
|
347
|
-
Object.freeze && Object.freeze(o);
|
|
348
|
-
} else
|
|
349
|
-
console.error(
|
|
350
|
-
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
351
|
-
);
|
|
352
|
-
else Z(o, e);
|
|
353
|
-
} else
|
|
354
|
-
o = "", (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (o += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."), e === null ? n = "null" : z(e) ? n = "array" : e !== void 0 && e.$$typeof === U ? (n = "<" + (a(e.type) || "Unknown") + " />", o = " Did you accidentally export a JSX literal instead of a component?") : n = typeof e, console.error(
|
|
355
|
-
"React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",
|
|
356
|
-
n,
|
|
357
|
-
o
|
|
358
|
-
);
|
|
359
|
-
if (oe.call(r, "key")) {
|
|
360
|
-
o = a(e);
|
|
361
|
-
var b = Object.keys(r).filter(function(l) {
|
|
362
|
-
return l !== "key";
|
|
363
|
-
});
|
|
364
|
-
n = 0 < b.length ? "{key: someKey, " + b.join(": ..., ") + ": ...}" : "{key: someKey}", ve[o + n] || (b = 0 < b.length ? "{" + b.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
365
|
-
`A props object containing a "key" prop is being spread into JSX:
|
|
366
|
-
let props = %s;
|
|
367
|
-
<%s {...props} />
|
|
368
|
-
React keys must be passed directly to JSX without using spread:
|
|
369
|
-
let props = %s;
|
|
370
|
-
<%s key={someKey} {...props} />`,
|
|
371
|
-
n,
|
|
372
|
-
o,
|
|
373
|
-
b,
|
|
374
|
-
o
|
|
375
|
-
), ve[o + n] = !0);
|
|
376
|
-
}
|
|
377
|
-
if (o = null, t !== void 0 && (g(t), o = "" + t), N(r) && (g(r.key), o = "" + r.key), "key" in r) {
|
|
378
|
-
t = {};
|
|
379
|
-
for (var w in r)
|
|
380
|
-
w !== "key" && (t[w] = r[w]);
|
|
381
|
-
} else t = r;
|
|
382
|
-
return o && P(
|
|
383
|
-
t,
|
|
384
|
-
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
385
|
-
), v(e, o, s, i, p(), t);
|
|
386
|
-
}
|
|
387
|
-
function Z(e, r) {
|
|
388
|
-
if (typeof e == "object" && e && e.$$typeof !== je) {
|
|
389
|
-
if (z(e))
|
|
390
|
-
for (var t = 0; t < e.length; t++) {
|
|
391
|
-
var n = e[t];
|
|
392
|
-
$(n) && K(n, r);
|
|
393
|
-
}
|
|
394
|
-
else if ($(e))
|
|
395
|
-
e._store && (e._store.validated = 1);
|
|
396
|
-
else if (e === null || typeof e != "object" ? t = null : (t = te && e[te] || e["@@iterator"], t = typeof t == "function" ? t : null), typeof t == "function" && t !== e.entries && (t = t.call(e), t !== e))
|
|
397
|
-
for (; !(e = t.next()).done; )
|
|
398
|
-
$(e.value) && K(e.value, r);
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
function $(e) {
|
|
402
|
-
return typeof e == "object" && e !== null && e.$$typeof === U;
|
|
403
|
-
}
|
|
404
|
-
function K(e, r) {
|
|
405
|
-
if (e._store && !e._store.validated && e.key == null && (e._store.validated = 1, r = Ce(r), !be[r])) {
|
|
406
|
-
be[r] = !0;
|
|
407
|
-
var t = "";
|
|
408
|
-
e && e._owner != null && e._owner !== p() && (t = null, typeof e._owner.tag == "number" ? t = a(e._owner.type) : typeof e._owner.name == "string" && (t = e._owner.name), t = " It was passed a child from " + t + ".");
|
|
409
|
-
var n = _.getCurrentStack;
|
|
410
|
-
_.getCurrentStack = function() {
|
|
411
|
-
var i = k(e.type);
|
|
412
|
-
return n && (i += n() || ""), i;
|
|
413
|
-
}, console.error(
|
|
414
|
-
'Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',
|
|
415
|
-
r,
|
|
416
|
-
t
|
|
417
|
-
), _.getCurrentStack = n;
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
function Ce(e) {
|
|
421
|
-
var r = "", t = p();
|
|
422
|
-
return t && (t = a(t.type)) && (r = `
|
|
423
|
-
|
|
424
|
-
Check the render method of \`` + t + "`."), r || (e = a(e)) && (r = `
|
|
425
|
-
|
|
426
|
-
Check the top-level render call using <` + e + ">."), r;
|
|
427
|
-
}
|
|
428
|
-
var xe = ye, U = Symbol.for("react.transitional.element"), Te = Symbol.for("react.portal"), W = Symbol.for("react.fragment"), Q = Symbol.for("react.strict_mode"), D = Symbol.for("react.profiler"), ee = Symbol.for("react.consumer"), re = Symbol.for("react.context"), H = Symbol.for("react.forward_ref"), F = Symbol.for("react.suspense"), I = Symbol.for("react.suspense_list"), L = Symbol.for("react.memo"), q = Symbol.for("react.lazy"), Se = Symbol.for("react.offscreen"), te = Symbol.iterator, ke = Symbol.for("react.client.reference"), _ = xe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, oe = Object.prototype.hasOwnProperty, C = Object.assign, we = Symbol.for("react.client.reference"), z = Array.isArray, y = 0, ne, ae, se, ue, ce, ie, le;
|
|
429
|
-
S.__reactDisabledLog = !0;
|
|
430
|
-
var V, fe, B = !1, G = new (typeof WeakMap == "function" ? WeakMap : Map)(), je = Symbol.for("react.client.reference"), de, Ee = {}, ve = {}, be = {};
|
|
431
|
-
O.Fragment = W, O.jsx = function(e, r, t, n, i) {
|
|
432
|
-
return j(e, r, t, !1, n, i);
|
|
433
|
-
}, O.jsxs = function(e, r, t, n, i) {
|
|
434
|
-
return j(e, r, t, !0, n, i);
|
|
435
|
-
};
|
|
436
|
-
}()), O;
|
|
437
|
-
}
|
|
438
|
-
process.env.NODE_ENV === "production" ? X.exports = Ne() : X.exports = Pe();
|
|
439
|
-
var T = X.exports;
|
|
440
|
-
const pe = ({ children: a }) => /* @__PURE__ */ T.jsxs("div", { children: [
|
|
1
|
+
import { jsxs as k, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { Component as b, useRef as g, useState as c, useEffect as E, useLayoutEffect as I } from "react";
|
|
3
|
+
const m = ({ children: e }) => /* @__PURE__ */ k("div", { children: [
|
|
441
4
|
"Error loading Helio Checkout for React",
|
|
442
|
-
|
|
5
|
+
e ? `: ${e}` : ""
|
|
443
6
|
] });
|
|
444
|
-
class
|
|
445
|
-
constructor(
|
|
446
|
-
super(
|
|
7
|
+
class L extends b {
|
|
8
|
+
constructor(t) {
|
|
9
|
+
super(t), this.state = { hasError: !1 };
|
|
447
10
|
}
|
|
448
11
|
static getDerivedStateFromError() {
|
|
449
12
|
return { hasError: !0 };
|
|
450
13
|
}
|
|
451
14
|
render() {
|
|
452
|
-
return this.state.hasError ? /* @__PURE__ */
|
|
15
|
+
return this.state.hasError ? /* @__PURE__ */ n(m, {}) : this.props.children;
|
|
453
16
|
}
|
|
454
17
|
}
|
|
455
|
-
const
|
|
456
|
-
const
|
|
457
|
-
return
|
|
458
|
-
},
|
|
459
|
-
const
|
|
460
|
-
return
|
|
461
|
-
let
|
|
462
|
-
if (
|
|
463
|
-
const
|
|
464
|
-
if (
|
|
465
|
-
const
|
|
466
|
-
if (!
|
|
467
|
-
|
|
18
|
+
const w = "https://embed.hel.io/assets/index-v1.js", p = "helio-checkout-react-v1", x = (e = w) => {
|
|
19
|
+
const t = document.createElement("script");
|
|
20
|
+
return t.setAttribute("type", "module"), t.setAttribute("id", p), t.setAttribute("src", e), document.body.appendChild(t), t;
|
|
21
|
+
}, F = ({ config: e }) => {
|
|
22
|
+
const t = g(null), [u, C] = c(!1), [o, S] = c(), [d, s] = c("");
|
|
23
|
+
return E(() => C(!0), []), E(() => {
|
|
24
|
+
let l = !1;
|
|
25
|
+
if (o) return;
|
|
26
|
+
const i = () => {
|
|
27
|
+
if (l) return;
|
|
28
|
+
const r = window.helioCheckout;
|
|
29
|
+
if (!r) {
|
|
30
|
+
s(
|
|
468
31
|
"Unable to load helio checkout - missing init function on window.helioCheckout"
|
|
469
32
|
);
|
|
470
33
|
return;
|
|
471
34
|
}
|
|
472
|
-
|
|
473
|
-
},
|
|
474
|
-
const
|
|
475
|
-
return
|
|
476
|
-
|
|
35
|
+
S(() => r);
|
|
36
|
+
}, a = (r) => {
|
|
37
|
+
const f = () => s("Error loading script tag");
|
|
38
|
+
return r.addEventListener("load", i), r.addEventListener("error", f), () => {
|
|
39
|
+
l = !0, r.removeEventListener("load", i), r.removeEventListener("error", f);
|
|
477
40
|
};
|
|
478
|
-
},
|
|
479
|
-
`script#${
|
|
41
|
+
}, h = document.querySelector(
|
|
42
|
+
`script#${p}`
|
|
480
43
|
);
|
|
481
|
-
if (
|
|
482
|
-
window.helioCheckout ?
|
|
44
|
+
if (h) {
|
|
45
|
+
window.helioCheckout ? i() : a(h);
|
|
483
46
|
return;
|
|
484
47
|
}
|
|
485
|
-
const
|
|
486
|
-
return
|
|
487
|
-
}, [
|
|
488
|
-
if (!(!
|
|
489
|
-
if (!
|
|
490
|
-
|
|
48
|
+
const v = x(e.embedScriptSource);
|
|
49
|
+
return a(v);
|
|
50
|
+
}, [o, e.embedScriptSource]), I(() => {
|
|
51
|
+
if (!(!o || !u)) {
|
|
52
|
+
if (!t.current) {
|
|
53
|
+
s("Missing element to mount Helio checkout");
|
|
491
54
|
return;
|
|
492
55
|
}
|
|
493
|
-
|
|
56
|
+
o(t.current, e);
|
|
494
57
|
}
|
|
495
|
-
}, [
|
|
496
|
-
},
|
|
58
|
+
}, [o, u, e]), d ? /* @__PURE__ */ n(m, { children: d }) : o ? /* @__PURE__ */ n("div", { ref: t }) : null;
|
|
59
|
+
}, R = (e) => /* @__PURE__ */ n(L, { children: /* @__PURE__ */ n(F, { config: e.config }) }), j = (e) => /* @__PURE__ */ n(R, { config: e.config });
|
|
497
60
|
export {
|
|
498
|
-
|
|
61
|
+
j as HelioCheckout
|
|
499
62
|
};
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@heliofi/checkout-react",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "4.0.2",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"dev": "vite",
|
|
8
|
-
"build": "
|
|
8
|
+
"build": "vite build",
|
|
9
9
|
"build:vercel": "tsc && vite build --config vite-vercel.config.ts",
|
|
10
10
|
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
|
11
11
|
"lint:strict": "yarn lint",
|
|
@@ -16,32 +16,31 @@
|
|
|
16
16
|
"prepublishOnly": "rimraf dist && yarn build",
|
|
17
17
|
"test": "vitest run",
|
|
18
18
|
"test:watch": "vitest",
|
|
19
|
-
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
19
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
20
|
+
"typecheck:fast": "tsc --noEmit --incremental"
|
|
20
21
|
},
|
|
21
|
-
"main": "./dist/helio-checkout-react.
|
|
22
|
+
"main": "./dist/helio-checkout-react.es.js",
|
|
22
23
|
"module": "./dist/helio-checkout-react.es.js",
|
|
23
24
|
"types": "./dist/helio-checkout-react.es.d.ts",
|
|
24
25
|
"exports": {
|
|
25
26
|
".": {
|
|
26
|
-
"import": "./dist/helio-checkout-react.es.js"
|
|
27
|
-
"require": "./dist/helio-checkout-react.umd.js"
|
|
27
|
+
"import": "./dist/helio-checkout-react.es.js"
|
|
28
28
|
}
|
|
29
29
|
},
|
|
30
30
|
"files": [
|
|
31
31
|
"dist/helio-checkout-react.es.js",
|
|
32
|
-
"dist/helio-checkout-react.es.d.ts"
|
|
33
|
-
"dist/helio-checkout-react.umd.js"
|
|
32
|
+
"dist/helio-checkout-react.es.d.ts"
|
|
34
33
|
],
|
|
35
34
|
"peerDependencies": {
|
|
36
|
-
"react": "
|
|
37
|
-
"react-dom": "
|
|
35
|
+
"react": ">=18.2.0 <20",
|
|
36
|
+
"react-dom": ">=18.2.0 <20"
|
|
38
37
|
},
|
|
39
38
|
"devDependencies": {
|
|
40
39
|
"@testing-library/dom": "^9.3.3",
|
|
41
40
|
"@testing-library/jest-dom": "5.16.5",
|
|
42
41
|
"@testing-library/react": "^14.0.0",
|
|
43
|
-
"@types/react": "
|
|
44
|
-
"@types/react-dom": "
|
|
42
|
+
"@types/react": ">=18.2.0 <20",
|
|
43
|
+
"@types/react-dom": ">=18.2.0 <20",
|
|
45
44
|
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
|
46
45
|
"@typescript-eslint/parser": "^6.0.0",
|
|
47
46
|
"@vitejs/plugin-react": "^4.3.2",
|
|
@@ -52,6 +51,6 @@
|
|
|
52
51
|
"typescript": "5.1.6",
|
|
53
52
|
"vite": "5.4.8",
|
|
54
53
|
"vite-plugin-dts": "^3.7.1",
|
|
55
|
-
"vitest": "
|
|
54
|
+
"vitest": "3.2.4"
|
|
56
55
|
}
|
|
57
56
|
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
(function(_,f){typeof exports=="object"&&typeof module<"u"?f(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],f):(_=typeof globalThis<"u"?globalThis:_||self,f(_["react-library-scaffold"]={},_.React))})(this,function(_,f){"use strict";var W={exports:{}},R={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react-jsx-runtime.production.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var Q;function Ce(){if(Q)return R;Q=1;var a=Symbol.for("react.transitional.element"),c=Symbol.for("react.fragment");function h(j,u,d){var E=null;if(d!==void 0&&(E=""+d),u.key!==void 0&&(E=""+u.key),"key"in u){d={};for(var v in u)v!=="key"&&(d[v]=u[v])}else d=u;return u=d.ref,{$$typeof:a,type:j,key:E,ref:u!==void 0?u:null,props:d}}return R.Fragment=c,R.jsx=h,R.jsxs=h,R}var O={};/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react-jsx-runtime.development.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var q;function Te(){return q||(q=1,process.env.NODE_ENV!=="production"&&function(){function a(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Pe?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case L:return"Fragment";case Ae:return"Portal";case ne:return"Profiler";case oe:return"StrictMode";case V:return"Suspense";case B:return"SuspenseList"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case se:return(e.displayName||"Context")+".Provider";case ae:return(e._context.displayName||"Context")+".Consumer";case z:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case G:return r=e.displayName||null,r!==null?r:a(e.type)||"Memo";case J:r=e._payload,e=e._init;try{return a(e(r))}catch{}}return null}function c(e){return""+e}function h(e){try{c(e);var r=!1}catch{r=!0}if(r){r=console;var t=r.error,n=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t.call(r,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",n),c(e)}}function j(){}function u(){if(N===0){ie=console.log,le=console.info,fe=console.warn,de=console.error,Ee=console.group,ve=console.groupCollapsed,be=console.groupEnd;var e={configurable:!0,enumerable:!0,value:j,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}N++}function d(){if(N--,N===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:x({},e,{value:ie}),info:x({},e,{value:le}),warn:x({},e,{value:fe}),error:x({},e,{value:de}),group:x({},e,{value:Ee}),groupCollapsed:x({},e,{value:ve}),groupEnd:x({},e,{value:be})})}0>N&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}function E(e){if(Z===void 0)try{throw Error()}catch(t){var r=t.stack.trim().match(/\n( *(at )?)/);Z=r&&r[1]||"",me=-1<t.stack.indexOf(`
|
|
18
|
-
at`)?" (<anonymous>)":-1<t.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
19
|
-
`+Z+e+me}function v(e,r){if(!e||$)return"";var t=K.get(e);if(t!==void 0)return t;$=!0,t=Error.prepareStackTrace,Error.prepareStackTrace=void 0;var n=null;n=S.H,S.H=null,u();try{var i={DetermineComponentFrameRoot:function(){try{if(r){var p=function(){throw Error()};if(Object.defineProperty(p.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(p,[])}catch(g){var U=g}Reflect.construct(e,[],p)}else{try{p.call()}catch(g){U=g}e.call(p.prototype)}}else{try{throw Error()}catch(g){U=g}(p=e())&&typeof p.catch=="function"&&p.catch(function(){})}}catch(g){if(g&&U&&typeof g.stack=="string")return[g.stack,U.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var s=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");s&&s.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var o=i.DetermineComponentFrameRoot(),m=o[0],w=o[1];if(m&&w){var l=m.split(`
|
|
20
|
-
`),y=w.split(`
|
|
21
|
-
`);for(o=s=0;s<l.length&&!l[s].includes("DetermineComponentFrameRoot");)s++;for(;o<y.length&&!y[o].includes("DetermineComponentFrameRoot");)o++;if(s===l.length||o===y.length)for(s=l.length-1,o=y.length-1;1<=s&&0<=o&&l[s]!==y[o];)o--;for(;1<=s&&0<=o;s--,o--)if(l[s]!==y[o]){if(s!==1||o!==1)do if(s--,o--,0>o||l[s]!==y[o]){var P=`
|
|
22
|
-
`+l[s].replace(" at new "," at ");return e.displayName&&P.includes("<anonymous>")&&(P=P.replace("<anonymous>",e.displayName)),typeof e=="function"&&K.set(e,P),P}while(1<=s&&0<=o);break}}}finally{$=!1,S.H=n,d(),Error.prepareStackTrace=t}return l=(l=e?e.displayName||e.name:"")?E(l):"",typeof e=="function"&&K.set(e,l),l}function k(e){if(e==null)return"";if(typeof e=="function"){var r=e.prototype;return v(e,!(!r||!r.isReactComponent))}if(typeof e=="string")return E(e);switch(e){case V:return E("Suspense");case B:return E("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case z:return e=v(e.render,!1),e;case G:return k(e.type);case J:r=e._payload,e=e._init;try{return k(e(r))}catch{}}return""}function T(){var e=S.A;return e===null?null:e.getOwner()}function M(e){if(ce.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function Y(e,r){function t(){ge||(ge=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",r))}t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}function H(){var e=a(this.type);return he[e]||(he[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function b(e,r,t,n,i,s){return t=s.ref,e={$$typeof:I,type:e,key:r,props:s,_owner:i},(t!==void 0?t:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:H}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function A(e,r,t,n,i,s){if(typeof e=="string"||typeof e=="function"||e===L||e===ne||e===oe||e===V||e===B||e===Ne||typeof e=="object"&&e!==null&&(e.$$typeof===J||e.$$typeof===G||e.$$typeof===se||e.$$typeof===ae||e.$$typeof===z||e.$$typeof===Me||e.getModuleId!==void 0)){var o=r.children;if(o!==void 0)if(n)if(X(o)){for(n=0;n<o.length;n++)re(o[n],e);Object.freeze&&Object.freeze(o)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else re(o,e)}else o="",(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(o+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),e===null?n="null":X(e)?n="array":e!==void 0&&e.$$typeof===I?(n="<"+(a(e.type)||"Unknown")+" />",o=" Did you accidentally export a JSX literal instead of a component?"):n=typeof e,console.error("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",n,o);if(ce.call(r,"key")){o=a(e);var m=Object.keys(r).filter(function(l){return l!=="key"});n=0<m.length?"{key: someKey, "+m.join(": ..., ")+": ...}":"{key: someKey}",pe[o+n]||(m=0<m.length?"{"+m.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
23
|
-
let props = %s;
|
|
24
|
-
<%s {...props} />
|
|
25
|
-
React keys must be passed directly to JSX without using spread:
|
|
26
|
-
let props = %s;
|
|
27
|
-
<%s key={someKey} {...props} />`,n,o,m,o),pe[o+n]=!0)}if(o=null,t!==void 0&&(h(t),o=""+t),M(r)&&(h(r.key),o=""+r.key),"key"in r){t={};for(var w in r)w!=="key"&&(t[w]=r[w])}else t=r;return o&&Y(t,typeof e=="function"?e.displayName||e.name||"Unknown":e),b(e,o,s,i,T(),t)}function re(e,r){if(typeof e=="object"&&e&&e.$$typeof!==Ye){if(X(e))for(var t=0;t<e.length;t++){var n=e[t];F(n)&&te(n,r)}else if(F(e))e._store&&(e._store.validated=1);else if(e===null||typeof e!="object"?t=null:(t=ue&&e[ue]||e["@@iterator"],t=typeof t=="function"?t:null),typeof t=="function"&&t!==e.entries&&(t=t.call(e),t!==e))for(;!(e=t.next()).done;)F(e.value)&&te(e.value,r)}}function F(e){return typeof e=="object"&&e!==null&&e.$$typeof===I}function te(e,r){if(e._store&&!e._store.validated&&e.key==null&&(e._store.validated=1,r=Re(r),!_e[r])){_e[r]=!0;var t="";e&&e._owner!=null&&e._owner!==T()&&(t=null,typeof e._owner.tag=="number"?t=a(e._owner.type):typeof e._owner.name=="string"&&(t=e._owner.name),t=" It was passed a child from "+t+".");var n=S.getCurrentStack;S.getCurrentStack=function(){var i=k(e.type);return n&&(i+=n()||""),i},console.error('Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',r,t),S.getCurrentStack=n}}function Re(e){var r="",t=T();return t&&(t=a(t.type))&&(r=`
|
|
28
|
-
|
|
29
|
-
Check the render method of \``+t+"`."),r||(e=a(e))&&(r=`
|
|
30
|
-
|
|
31
|
-
Check the top-level render call using <`+e+">."),r}var Oe=f,I=Symbol.for("react.transitional.element"),Ae=Symbol.for("react.portal"),L=Symbol.for("react.fragment"),oe=Symbol.for("react.strict_mode"),ne=Symbol.for("react.profiler"),ae=Symbol.for("react.consumer"),se=Symbol.for("react.context"),z=Symbol.for("react.forward_ref"),V=Symbol.for("react.suspense"),B=Symbol.for("react.suspense_list"),G=Symbol.for("react.memo"),J=Symbol.for("react.lazy"),Ne=Symbol.for("react.offscreen"),ue=Symbol.iterator,Pe=Symbol.for("react.client.reference"),S=Oe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ce=Object.prototype.hasOwnProperty,x=Object.assign,Me=Symbol.for("react.client.reference"),X=Array.isArray,N=0,ie,le,fe,de,Ee,ve,be;j.__reactDisabledLog=!0;var Z,me,$=!1,K=new(typeof WeakMap=="function"?WeakMap:Map),Ye=Symbol.for("react.client.reference"),ge,he={},pe={},_e={};O.Fragment=L,O.jsx=function(e,r,t,n,i){return A(e,r,t,!1,n,i)},O.jsxs=function(e,r,t,n,i){return A(e,r,t,!0,n,i)}}()),O}process.env.NODE_ENV==="production"?W.exports=Ce():W.exports=Te();var C=W.exports;const D=({children:a})=>C.jsxs("div",{children:["Error loading Helio Checkout for React",a?`: ${a}`:""]});class Se extends f.Component{constructor(c){super(c),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}render(){return this.state.hasError?C.jsx(D,{}):this.props.children}}const xe="https://embed.hel.io/assets/index-v1.js",ee="helio-checkout-react-v1",ye=(a=xe)=>{const c=document.createElement("script");return c.setAttribute("type","module"),c.setAttribute("id",ee),c.setAttribute("src",a),document.body.appendChild(c),c},je=({config:a})=>{const c=f.useRef(null),[h,j]=f.useState(!1),[u,d]=f.useState(),[E,v]=f.useState("");return f.useEffect(()=>j(!0),[]),f.useEffect(()=>{let k=!1;if(u)return;const T=()=>{if(k)return;const b=window.helioCheckout;if(!b){v("Unable to load helio checkout - missing init function on window.helioCheckout");return}d(()=>b)},M=b=>{const A=()=>v("Error loading script tag");return b.addEventListener("load",T),b.addEventListener("error",A),()=>{k=!0,b.removeEventListener("load",T),b.removeEventListener("error",A)}},Y=document.querySelector(`script#${ee}`);if(Y){window.helioCheckout?T():M(Y);return}const H=ye(a.embedScriptSource);return M(H)},[u,a.embedScriptSource]),f.useLayoutEffect(()=>{if(!(!u||!h)){if(!c.current){v("Missing element to mount Helio checkout");return}u(c.current,a)}},[u,h,a]),E?C.jsx(D,{children:E}):u?C.jsx("div",{ref:c}):null},ke=a=>C.jsx(Se,{children:C.jsx(je,{config:a.config})}),we=a=>C.jsx(ke,{config:a.config});_.HelioCheckout=we,Object.defineProperty(_,Symbol.toStringTag,{value:"Module"})});
|