@superlogic/spree-pay 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.cjs +95 -1875
- package/build/index.js +64 -1867
- package/package.json +4 -6
package/build/index.cjs
CHANGED
|
@@ -5,9 +5,6 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __commonJS = (cb, mod) => function __require() {
|
|
9
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
10
|
-
};
|
|
11
8
|
var __export = (target, all) => {
|
|
12
9
|
for (var name in all)
|
|
13
10
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -30,954 +27,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
30
27
|
));
|
|
31
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
32
29
|
|
|
33
|
-
// ../../node_modules/react-is/cjs/react-is.production.min.js
|
|
34
|
-
var require_react_is_production_min = __commonJS({
|
|
35
|
-
"../../node_modules/react-is/cjs/react-is.production.min.js"(exports2) {
|
|
36
|
-
"use strict";
|
|
37
|
-
var b = "function" === typeof Symbol && Symbol.for;
|
|
38
|
-
var c = b ? Symbol.for("react.element") : 60103;
|
|
39
|
-
var d = b ? Symbol.for("react.portal") : 60106;
|
|
40
|
-
var e = b ? Symbol.for("react.fragment") : 60107;
|
|
41
|
-
var f = b ? Symbol.for("react.strict_mode") : 60108;
|
|
42
|
-
var g = b ? Symbol.for("react.profiler") : 60114;
|
|
43
|
-
var h = b ? Symbol.for("react.provider") : 60109;
|
|
44
|
-
var k = b ? Symbol.for("react.context") : 60110;
|
|
45
|
-
var l = b ? Symbol.for("react.async_mode") : 60111;
|
|
46
|
-
var m = b ? Symbol.for("react.concurrent_mode") : 60111;
|
|
47
|
-
var n = b ? Symbol.for("react.forward_ref") : 60112;
|
|
48
|
-
var p = b ? Symbol.for("react.suspense") : 60113;
|
|
49
|
-
var q = b ? Symbol.for("react.suspense_list") : 60120;
|
|
50
|
-
var r2 = b ? Symbol.for("react.memo") : 60115;
|
|
51
|
-
var t = b ? Symbol.for("react.lazy") : 60116;
|
|
52
|
-
var v = b ? Symbol.for("react.block") : 60121;
|
|
53
|
-
var w = b ? Symbol.for("react.fundamental") : 60117;
|
|
54
|
-
var x = b ? Symbol.for("react.responder") : 60118;
|
|
55
|
-
var y = b ? Symbol.for("react.scope") : 60119;
|
|
56
|
-
function z(a) {
|
|
57
|
-
if ("object" === typeof a && null !== a) {
|
|
58
|
-
var u = a.$$typeof;
|
|
59
|
-
switch (u) {
|
|
60
|
-
case c:
|
|
61
|
-
switch (a = a.type, a) {
|
|
62
|
-
case l:
|
|
63
|
-
case m:
|
|
64
|
-
case e:
|
|
65
|
-
case g:
|
|
66
|
-
case f:
|
|
67
|
-
case p:
|
|
68
|
-
return a;
|
|
69
|
-
default:
|
|
70
|
-
switch (a = a && a.$$typeof, a) {
|
|
71
|
-
case k:
|
|
72
|
-
case n:
|
|
73
|
-
case t:
|
|
74
|
-
case r2:
|
|
75
|
-
case h:
|
|
76
|
-
return a;
|
|
77
|
-
default:
|
|
78
|
-
return u;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
case d:
|
|
82
|
-
return u;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
function A(a) {
|
|
87
|
-
return z(a) === m;
|
|
88
|
-
}
|
|
89
|
-
exports2.AsyncMode = l;
|
|
90
|
-
exports2.ConcurrentMode = m;
|
|
91
|
-
exports2.ContextConsumer = k;
|
|
92
|
-
exports2.ContextProvider = h;
|
|
93
|
-
exports2.Element = c;
|
|
94
|
-
exports2.ForwardRef = n;
|
|
95
|
-
exports2.Fragment = e;
|
|
96
|
-
exports2.Lazy = t;
|
|
97
|
-
exports2.Memo = r2;
|
|
98
|
-
exports2.Portal = d;
|
|
99
|
-
exports2.Profiler = g;
|
|
100
|
-
exports2.StrictMode = f;
|
|
101
|
-
exports2.Suspense = p;
|
|
102
|
-
exports2.isAsyncMode = function(a) {
|
|
103
|
-
return A(a) || z(a) === l;
|
|
104
|
-
};
|
|
105
|
-
exports2.isConcurrentMode = A;
|
|
106
|
-
exports2.isContextConsumer = function(a) {
|
|
107
|
-
return z(a) === k;
|
|
108
|
-
};
|
|
109
|
-
exports2.isContextProvider = function(a) {
|
|
110
|
-
return z(a) === h;
|
|
111
|
-
};
|
|
112
|
-
exports2.isElement = function(a) {
|
|
113
|
-
return "object" === typeof a && null !== a && a.$$typeof === c;
|
|
114
|
-
};
|
|
115
|
-
exports2.isForwardRef = function(a) {
|
|
116
|
-
return z(a) === n;
|
|
117
|
-
};
|
|
118
|
-
exports2.isFragment = function(a) {
|
|
119
|
-
return z(a) === e;
|
|
120
|
-
};
|
|
121
|
-
exports2.isLazy = function(a) {
|
|
122
|
-
return z(a) === t;
|
|
123
|
-
};
|
|
124
|
-
exports2.isMemo = function(a) {
|
|
125
|
-
return z(a) === r2;
|
|
126
|
-
};
|
|
127
|
-
exports2.isPortal = function(a) {
|
|
128
|
-
return z(a) === d;
|
|
129
|
-
};
|
|
130
|
-
exports2.isProfiler = function(a) {
|
|
131
|
-
return z(a) === g;
|
|
132
|
-
};
|
|
133
|
-
exports2.isStrictMode = function(a) {
|
|
134
|
-
return z(a) === f;
|
|
135
|
-
};
|
|
136
|
-
exports2.isSuspense = function(a) {
|
|
137
|
-
return z(a) === p;
|
|
138
|
-
};
|
|
139
|
-
exports2.isValidElementType = function(a) {
|
|
140
|
-
return "string" === typeof a || "function" === typeof a || a === e || a === m || a === g || a === f || a === p || a === q || "object" === typeof a && null !== a && (a.$$typeof === t || a.$$typeof === r2 || a.$$typeof === h || a.$$typeof === k || a.$$typeof === n || a.$$typeof === w || a.$$typeof === x || a.$$typeof === y || a.$$typeof === v);
|
|
141
|
-
};
|
|
142
|
-
exports2.typeOf = z;
|
|
143
|
-
}
|
|
144
|
-
});
|
|
145
|
-
|
|
146
|
-
// ../../node_modules/react-is/cjs/react-is.development.js
|
|
147
|
-
var require_react_is_development = __commonJS({
|
|
148
|
-
"../../node_modules/react-is/cjs/react-is.development.js"(exports2) {
|
|
149
|
-
"use strict";
|
|
150
|
-
if (process.env.NODE_ENV !== "production") {
|
|
151
|
-
(function() {
|
|
152
|
-
"use strict";
|
|
153
|
-
var hasSymbol = typeof Symbol === "function" && Symbol.for;
|
|
154
|
-
var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for("react.element") : 60103;
|
|
155
|
-
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for("react.portal") : 60106;
|
|
156
|
-
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for("react.fragment") : 60107;
|
|
157
|
-
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for("react.strict_mode") : 60108;
|
|
158
|
-
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for("react.profiler") : 60114;
|
|
159
|
-
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for("react.provider") : 60109;
|
|
160
|
-
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for("react.context") : 60110;
|
|
161
|
-
var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for("react.async_mode") : 60111;
|
|
162
|
-
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for("react.concurrent_mode") : 60111;
|
|
163
|
-
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for("react.forward_ref") : 60112;
|
|
164
|
-
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for("react.suspense") : 60113;
|
|
165
|
-
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for("react.suspense_list") : 60120;
|
|
166
|
-
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for("react.memo") : 60115;
|
|
167
|
-
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for("react.lazy") : 60116;
|
|
168
|
-
var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for("react.block") : 60121;
|
|
169
|
-
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for("react.fundamental") : 60117;
|
|
170
|
-
var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for("react.responder") : 60118;
|
|
171
|
-
var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for("react.scope") : 60119;
|
|
172
|
-
function isValidElementType(type) {
|
|
173
|
-
return typeof type === "string" || typeof type === "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
|
174
|
-
type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === "object" && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
|
|
175
|
-
}
|
|
176
|
-
function typeOf(object) {
|
|
177
|
-
if (typeof object === "object" && object !== null) {
|
|
178
|
-
var $$typeof = object.$$typeof;
|
|
179
|
-
switch ($$typeof) {
|
|
180
|
-
case REACT_ELEMENT_TYPE:
|
|
181
|
-
var type = object.type;
|
|
182
|
-
switch (type) {
|
|
183
|
-
case REACT_ASYNC_MODE_TYPE:
|
|
184
|
-
case REACT_CONCURRENT_MODE_TYPE:
|
|
185
|
-
case REACT_FRAGMENT_TYPE:
|
|
186
|
-
case REACT_PROFILER_TYPE:
|
|
187
|
-
case REACT_STRICT_MODE_TYPE:
|
|
188
|
-
case REACT_SUSPENSE_TYPE:
|
|
189
|
-
return type;
|
|
190
|
-
default:
|
|
191
|
-
var $$typeofType = type && type.$$typeof;
|
|
192
|
-
switch ($$typeofType) {
|
|
193
|
-
case REACT_CONTEXT_TYPE:
|
|
194
|
-
case REACT_FORWARD_REF_TYPE:
|
|
195
|
-
case REACT_LAZY_TYPE:
|
|
196
|
-
case REACT_MEMO_TYPE:
|
|
197
|
-
case REACT_PROVIDER_TYPE:
|
|
198
|
-
return $$typeofType;
|
|
199
|
-
default:
|
|
200
|
-
return $$typeof;
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
case REACT_PORTAL_TYPE:
|
|
204
|
-
return $$typeof;
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
return void 0;
|
|
208
|
-
}
|
|
209
|
-
var AsyncMode = REACT_ASYNC_MODE_TYPE;
|
|
210
|
-
var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
|
|
211
|
-
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
212
|
-
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
213
|
-
var Element = REACT_ELEMENT_TYPE;
|
|
214
|
-
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
215
|
-
var Fragment6 = REACT_FRAGMENT_TYPE;
|
|
216
|
-
var Lazy = REACT_LAZY_TYPE;
|
|
217
|
-
var Memo = REACT_MEMO_TYPE;
|
|
218
|
-
var Portal = REACT_PORTAL_TYPE;
|
|
219
|
-
var Profiler = REACT_PROFILER_TYPE;
|
|
220
|
-
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
221
|
-
var Suspense = REACT_SUSPENSE_TYPE;
|
|
222
|
-
var hasWarnedAboutDeprecatedIsAsyncMode = false;
|
|
223
|
-
function isAsyncMode(object) {
|
|
224
|
-
{
|
|
225
|
-
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
226
|
-
hasWarnedAboutDeprecatedIsAsyncMode = true;
|
|
227
|
-
console["warn"]("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.");
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
|
|
231
|
-
}
|
|
232
|
-
function isConcurrentMode(object) {
|
|
233
|
-
return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
|
|
234
|
-
}
|
|
235
|
-
function isContextConsumer(object) {
|
|
236
|
-
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
237
|
-
}
|
|
238
|
-
function isContextProvider(object) {
|
|
239
|
-
return typeOf(object) === REACT_PROVIDER_TYPE;
|
|
240
|
-
}
|
|
241
|
-
function isElement(object) {
|
|
242
|
-
return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
243
|
-
}
|
|
244
|
-
function isForwardRef(object) {
|
|
245
|
-
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
246
|
-
}
|
|
247
|
-
function isFragment(object) {
|
|
248
|
-
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
249
|
-
}
|
|
250
|
-
function isLazy(object) {
|
|
251
|
-
return typeOf(object) === REACT_LAZY_TYPE;
|
|
252
|
-
}
|
|
253
|
-
function isMemo(object) {
|
|
254
|
-
return typeOf(object) === REACT_MEMO_TYPE;
|
|
255
|
-
}
|
|
256
|
-
function isPortal(object) {
|
|
257
|
-
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
258
|
-
}
|
|
259
|
-
function isProfiler(object) {
|
|
260
|
-
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
261
|
-
}
|
|
262
|
-
function isStrictMode(object) {
|
|
263
|
-
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
264
|
-
}
|
|
265
|
-
function isSuspense(object) {
|
|
266
|
-
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
267
|
-
}
|
|
268
|
-
exports2.AsyncMode = AsyncMode;
|
|
269
|
-
exports2.ConcurrentMode = ConcurrentMode;
|
|
270
|
-
exports2.ContextConsumer = ContextConsumer;
|
|
271
|
-
exports2.ContextProvider = ContextProvider;
|
|
272
|
-
exports2.Element = Element;
|
|
273
|
-
exports2.ForwardRef = ForwardRef;
|
|
274
|
-
exports2.Fragment = Fragment6;
|
|
275
|
-
exports2.Lazy = Lazy;
|
|
276
|
-
exports2.Memo = Memo;
|
|
277
|
-
exports2.Portal = Portal;
|
|
278
|
-
exports2.Profiler = Profiler;
|
|
279
|
-
exports2.StrictMode = StrictMode;
|
|
280
|
-
exports2.Suspense = Suspense;
|
|
281
|
-
exports2.isAsyncMode = isAsyncMode;
|
|
282
|
-
exports2.isConcurrentMode = isConcurrentMode;
|
|
283
|
-
exports2.isContextConsumer = isContextConsumer;
|
|
284
|
-
exports2.isContextProvider = isContextProvider;
|
|
285
|
-
exports2.isElement = isElement;
|
|
286
|
-
exports2.isForwardRef = isForwardRef;
|
|
287
|
-
exports2.isFragment = isFragment;
|
|
288
|
-
exports2.isLazy = isLazy;
|
|
289
|
-
exports2.isMemo = isMemo;
|
|
290
|
-
exports2.isPortal = isPortal;
|
|
291
|
-
exports2.isProfiler = isProfiler;
|
|
292
|
-
exports2.isStrictMode = isStrictMode;
|
|
293
|
-
exports2.isSuspense = isSuspense;
|
|
294
|
-
exports2.isValidElementType = isValidElementType;
|
|
295
|
-
exports2.typeOf = typeOf;
|
|
296
|
-
})();
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
});
|
|
300
|
-
|
|
301
|
-
// ../../node_modules/react-is/index.js
|
|
302
|
-
var require_react_is = __commonJS({
|
|
303
|
-
"../../node_modules/react-is/index.js"(exports2, module2) {
|
|
304
|
-
"use strict";
|
|
305
|
-
if (process.env.NODE_ENV === "production") {
|
|
306
|
-
module2.exports = require_react_is_production_min();
|
|
307
|
-
} else {
|
|
308
|
-
module2.exports = require_react_is_development();
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
});
|
|
312
|
-
|
|
313
|
-
// ../../node_modules/object-assign/index.js
|
|
314
|
-
var require_object_assign = __commonJS({
|
|
315
|
-
"../../node_modules/object-assign/index.js"(exports2, module2) {
|
|
316
|
-
"use strict";
|
|
317
|
-
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
318
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
319
|
-
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
|
320
|
-
function toObject(val) {
|
|
321
|
-
if (val === null || val === void 0) {
|
|
322
|
-
throw new TypeError("Object.assign cannot be called with null or undefined");
|
|
323
|
-
}
|
|
324
|
-
return Object(val);
|
|
325
|
-
}
|
|
326
|
-
function shouldUseNative() {
|
|
327
|
-
try {
|
|
328
|
-
if (!Object.assign) {
|
|
329
|
-
return false;
|
|
330
|
-
}
|
|
331
|
-
var test1 = new String("abc");
|
|
332
|
-
test1[5] = "de";
|
|
333
|
-
if (Object.getOwnPropertyNames(test1)[0] === "5") {
|
|
334
|
-
return false;
|
|
335
|
-
}
|
|
336
|
-
var test2 = {};
|
|
337
|
-
for (var i = 0; i < 10; i++) {
|
|
338
|
-
test2["_" + String.fromCharCode(i)] = i;
|
|
339
|
-
}
|
|
340
|
-
var order2 = Object.getOwnPropertyNames(test2).map(function(n) {
|
|
341
|
-
return test2[n];
|
|
342
|
-
});
|
|
343
|
-
if (order2.join("") !== "0123456789") {
|
|
344
|
-
return false;
|
|
345
|
-
}
|
|
346
|
-
var test3 = {};
|
|
347
|
-
"abcdefghijklmnopqrst".split("").forEach(function(letter) {
|
|
348
|
-
test3[letter] = letter;
|
|
349
|
-
});
|
|
350
|
-
if (Object.keys(Object.assign({}, test3)).join("") !== "abcdefghijklmnopqrst") {
|
|
351
|
-
return false;
|
|
352
|
-
}
|
|
353
|
-
return true;
|
|
354
|
-
} catch (err) {
|
|
355
|
-
return false;
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
module2.exports = shouldUseNative() ? Object.assign : function(target, source) {
|
|
359
|
-
var from;
|
|
360
|
-
var to = toObject(target);
|
|
361
|
-
var symbols;
|
|
362
|
-
for (var s = 1; s < arguments.length; s++) {
|
|
363
|
-
from = Object(arguments[s]);
|
|
364
|
-
for (var key in from) {
|
|
365
|
-
if (hasOwnProperty.call(from, key)) {
|
|
366
|
-
to[key] = from[key];
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
if (getOwnPropertySymbols) {
|
|
370
|
-
symbols = getOwnPropertySymbols(from);
|
|
371
|
-
for (var i = 0; i < symbols.length; i++) {
|
|
372
|
-
if (propIsEnumerable.call(from, symbols[i])) {
|
|
373
|
-
to[symbols[i]] = from[symbols[i]];
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
return to;
|
|
379
|
-
};
|
|
380
|
-
}
|
|
381
|
-
});
|
|
382
|
-
|
|
383
|
-
// ../../node_modules/prop-types/lib/ReactPropTypesSecret.js
|
|
384
|
-
var require_ReactPropTypesSecret = __commonJS({
|
|
385
|
-
"../../node_modules/prop-types/lib/ReactPropTypesSecret.js"(exports2, module2) {
|
|
386
|
-
"use strict";
|
|
387
|
-
var ReactPropTypesSecret = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
|
|
388
|
-
module2.exports = ReactPropTypesSecret;
|
|
389
|
-
}
|
|
390
|
-
});
|
|
391
|
-
|
|
392
|
-
// ../../node_modules/prop-types/lib/has.js
|
|
393
|
-
var require_has = __commonJS({
|
|
394
|
-
"../../node_modules/prop-types/lib/has.js"(exports2, module2) {
|
|
395
|
-
"use strict";
|
|
396
|
-
module2.exports = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
397
|
-
}
|
|
398
|
-
});
|
|
399
|
-
|
|
400
|
-
// ../../node_modules/prop-types/checkPropTypes.js
|
|
401
|
-
var require_checkPropTypes = __commonJS({
|
|
402
|
-
"../../node_modules/prop-types/checkPropTypes.js"(exports2, module2) {
|
|
403
|
-
"use strict";
|
|
404
|
-
var printWarning = function() {
|
|
405
|
-
};
|
|
406
|
-
if (process.env.NODE_ENV !== "production") {
|
|
407
|
-
ReactPropTypesSecret = require_ReactPropTypesSecret();
|
|
408
|
-
loggedTypeFailures = {};
|
|
409
|
-
has = require_has();
|
|
410
|
-
printWarning = function(text) {
|
|
411
|
-
var message = "Warning: " + text;
|
|
412
|
-
if (typeof console !== "undefined") {
|
|
413
|
-
console.error(message);
|
|
414
|
-
}
|
|
415
|
-
try {
|
|
416
|
-
throw new Error(message);
|
|
417
|
-
} catch (x) {
|
|
418
|
-
}
|
|
419
|
-
};
|
|
420
|
-
}
|
|
421
|
-
var ReactPropTypesSecret;
|
|
422
|
-
var loggedTypeFailures;
|
|
423
|
-
var has;
|
|
424
|
-
function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
|
|
425
|
-
if (process.env.NODE_ENV !== "production") {
|
|
426
|
-
for (var typeSpecName in typeSpecs) {
|
|
427
|
-
if (has(typeSpecs, typeSpecName)) {
|
|
428
|
-
var error;
|
|
429
|
-
try {
|
|
430
|
-
if (typeof typeSpecs[typeSpecName] !== "function") {
|
|
431
|
-
var err = Error(
|
|
432
|
-
(componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."
|
|
433
|
-
);
|
|
434
|
-
err.name = "Invariant Violation";
|
|
435
|
-
throw err;
|
|
436
|
-
}
|
|
437
|
-
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
|
|
438
|
-
} catch (ex) {
|
|
439
|
-
error = ex;
|
|
440
|
-
}
|
|
441
|
-
if (error && !(error instanceof Error)) {
|
|
442
|
-
printWarning(
|
|
443
|
-
(componentName || "React class") + ": type specification of " + location + " `" + typeSpecName + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof error + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."
|
|
444
|
-
);
|
|
445
|
-
}
|
|
446
|
-
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
|
|
447
|
-
loggedTypeFailures[error.message] = true;
|
|
448
|
-
var stack = getStack ? getStack() : "";
|
|
449
|
-
printWarning(
|
|
450
|
-
"Failed " + location + " type: " + error.message + (stack != null ? stack : "")
|
|
451
|
-
);
|
|
452
|
-
}
|
|
453
|
-
}
|
|
454
|
-
}
|
|
455
|
-
}
|
|
456
|
-
}
|
|
457
|
-
checkPropTypes.resetWarningCache = function() {
|
|
458
|
-
if (process.env.NODE_ENV !== "production") {
|
|
459
|
-
loggedTypeFailures = {};
|
|
460
|
-
}
|
|
461
|
-
};
|
|
462
|
-
module2.exports = checkPropTypes;
|
|
463
|
-
}
|
|
464
|
-
});
|
|
465
|
-
|
|
466
|
-
// ../../node_modules/prop-types/factoryWithTypeCheckers.js
|
|
467
|
-
var require_factoryWithTypeCheckers = __commonJS({
|
|
468
|
-
"../../node_modules/prop-types/factoryWithTypeCheckers.js"(exports2, module2) {
|
|
469
|
-
"use strict";
|
|
470
|
-
var ReactIs = require_react_is();
|
|
471
|
-
var assign = require_object_assign();
|
|
472
|
-
var ReactPropTypesSecret = require_ReactPropTypesSecret();
|
|
473
|
-
var has = require_has();
|
|
474
|
-
var checkPropTypes = require_checkPropTypes();
|
|
475
|
-
var printWarning = function() {
|
|
476
|
-
};
|
|
477
|
-
if (process.env.NODE_ENV !== "production") {
|
|
478
|
-
printWarning = function(text) {
|
|
479
|
-
var message = "Warning: " + text;
|
|
480
|
-
if (typeof console !== "undefined") {
|
|
481
|
-
console.error(message);
|
|
482
|
-
}
|
|
483
|
-
try {
|
|
484
|
-
throw new Error(message);
|
|
485
|
-
} catch (x) {
|
|
486
|
-
}
|
|
487
|
-
};
|
|
488
|
-
}
|
|
489
|
-
function emptyFunctionThatReturnsNull() {
|
|
490
|
-
return null;
|
|
491
|
-
}
|
|
492
|
-
module2.exports = function(isValidElement2, throwOnDirectAccess) {
|
|
493
|
-
var ITERATOR_SYMBOL = typeof Symbol === "function" && Symbol.iterator;
|
|
494
|
-
var FAUX_ITERATOR_SYMBOL = "@@iterator";
|
|
495
|
-
function getIteratorFn(maybeIterable) {
|
|
496
|
-
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
|
|
497
|
-
if (typeof iteratorFn === "function") {
|
|
498
|
-
return iteratorFn;
|
|
499
|
-
}
|
|
500
|
-
}
|
|
501
|
-
var ANONYMOUS = "<<anonymous>>";
|
|
502
|
-
var ReactPropTypes = {
|
|
503
|
-
array: createPrimitiveTypeChecker("array"),
|
|
504
|
-
bigint: createPrimitiveTypeChecker("bigint"),
|
|
505
|
-
bool: createPrimitiveTypeChecker("boolean"),
|
|
506
|
-
func: createPrimitiveTypeChecker("function"),
|
|
507
|
-
number: createPrimitiveTypeChecker("number"),
|
|
508
|
-
object: createPrimitiveTypeChecker("object"),
|
|
509
|
-
string: createPrimitiveTypeChecker("string"),
|
|
510
|
-
symbol: createPrimitiveTypeChecker("symbol"),
|
|
511
|
-
any: createAnyTypeChecker(),
|
|
512
|
-
arrayOf: createArrayOfTypeChecker,
|
|
513
|
-
element: createElementTypeChecker(),
|
|
514
|
-
elementType: createElementTypeTypeChecker(),
|
|
515
|
-
instanceOf: createInstanceTypeChecker,
|
|
516
|
-
node: createNodeChecker(),
|
|
517
|
-
objectOf: createObjectOfTypeChecker,
|
|
518
|
-
oneOf: createEnumTypeChecker,
|
|
519
|
-
oneOfType: createUnionTypeChecker,
|
|
520
|
-
shape: createShapeTypeChecker,
|
|
521
|
-
exact: createStrictShapeTypeChecker
|
|
522
|
-
};
|
|
523
|
-
function is(x, y) {
|
|
524
|
-
if (x === y) {
|
|
525
|
-
return x !== 0 || 1 / x === 1 / y;
|
|
526
|
-
} else {
|
|
527
|
-
return x !== x && y !== y;
|
|
528
|
-
}
|
|
529
|
-
}
|
|
530
|
-
function PropTypeError(message, data) {
|
|
531
|
-
this.message = message;
|
|
532
|
-
this.data = data && typeof data === "object" ? data : {};
|
|
533
|
-
this.stack = "";
|
|
534
|
-
}
|
|
535
|
-
PropTypeError.prototype = Error.prototype;
|
|
536
|
-
function createChainableTypeChecker(validate) {
|
|
537
|
-
if (process.env.NODE_ENV !== "production") {
|
|
538
|
-
var manualPropTypeCallCache = {};
|
|
539
|
-
var manualPropTypeWarningCount = 0;
|
|
540
|
-
}
|
|
541
|
-
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
|
|
542
|
-
componentName = componentName || ANONYMOUS;
|
|
543
|
-
propFullName = propFullName || propName;
|
|
544
|
-
if (secret !== ReactPropTypesSecret) {
|
|
545
|
-
if (throwOnDirectAccess) {
|
|
546
|
-
var err = new Error(
|
|
547
|
-
"Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"
|
|
548
|
-
);
|
|
549
|
-
err.name = "Invariant Violation";
|
|
550
|
-
throw err;
|
|
551
|
-
} else if (process.env.NODE_ENV !== "production" && typeof console !== "undefined") {
|
|
552
|
-
var cacheKey = componentName + ":" + propName;
|
|
553
|
-
if (!manualPropTypeCallCache[cacheKey] && // Avoid spamming the console because they are often not actionable except for lib authors
|
|
554
|
-
manualPropTypeWarningCount < 3) {
|
|
555
|
-
printWarning(
|
|
556
|
-
"You are manually calling a React.PropTypes validation function for the `" + propFullName + "` prop on `" + componentName + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."
|
|
557
|
-
);
|
|
558
|
-
manualPropTypeCallCache[cacheKey] = true;
|
|
559
|
-
manualPropTypeWarningCount++;
|
|
560
|
-
}
|
|
561
|
-
}
|
|
562
|
-
}
|
|
563
|
-
if (props[propName] == null) {
|
|
564
|
-
if (isRequired) {
|
|
565
|
-
if (props[propName] === null) {
|
|
566
|
-
return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required " + ("in `" + componentName + "`, but its value is `null`."));
|
|
567
|
-
}
|
|
568
|
-
return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required in " + ("`" + componentName + "`, but its value is `undefined`."));
|
|
569
|
-
}
|
|
570
|
-
return null;
|
|
571
|
-
} else {
|
|
572
|
-
return validate(props, propName, componentName, location, propFullName);
|
|
573
|
-
}
|
|
574
|
-
}
|
|
575
|
-
var chainedCheckType = checkType.bind(null, false);
|
|
576
|
-
chainedCheckType.isRequired = checkType.bind(null, true);
|
|
577
|
-
return chainedCheckType;
|
|
578
|
-
}
|
|
579
|
-
function createPrimitiveTypeChecker(expectedType) {
|
|
580
|
-
function validate(props, propName, componentName, location, propFullName, secret) {
|
|
581
|
-
var propValue = props[propName];
|
|
582
|
-
var propType = getPropType(propValue);
|
|
583
|
-
if (propType !== expectedType) {
|
|
584
|
-
var preciseType = getPreciseType(propValue);
|
|
585
|
-
return new PropTypeError(
|
|
586
|
-
"Invalid " + location + " `" + propFullName + "` of type " + ("`" + preciseType + "` supplied to `" + componentName + "`, expected ") + ("`" + expectedType + "`."),
|
|
587
|
-
{ expectedType }
|
|
588
|
-
);
|
|
589
|
-
}
|
|
590
|
-
return null;
|
|
591
|
-
}
|
|
592
|
-
return createChainableTypeChecker(validate);
|
|
593
|
-
}
|
|
594
|
-
function createAnyTypeChecker() {
|
|
595
|
-
return createChainableTypeChecker(emptyFunctionThatReturnsNull);
|
|
596
|
-
}
|
|
597
|
-
function createArrayOfTypeChecker(typeChecker) {
|
|
598
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
599
|
-
if (typeof typeChecker !== "function") {
|
|
600
|
-
return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside arrayOf.");
|
|
601
|
-
}
|
|
602
|
-
var propValue = props[propName];
|
|
603
|
-
if (!Array.isArray(propValue)) {
|
|
604
|
-
var propType = getPropType(propValue);
|
|
605
|
-
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an array."));
|
|
606
|
-
}
|
|
607
|
-
for (var i = 0; i < propValue.length; i++) {
|
|
608
|
-
var error = typeChecker(propValue, i, componentName, location, propFullName + "[" + i + "]", ReactPropTypesSecret);
|
|
609
|
-
if (error instanceof Error) {
|
|
610
|
-
return error;
|
|
611
|
-
}
|
|
612
|
-
}
|
|
613
|
-
return null;
|
|
614
|
-
}
|
|
615
|
-
return createChainableTypeChecker(validate);
|
|
616
|
-
}
|
|
617
|
-
function createElementTypeChecker() {
|
|
618
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
619
|
-
var propValue = props[propName];
|
|
620
|
-
if (!isValidElement2(propValue)) {
|
|
621
|
-
var propType = getPropType(propValue);
|
|
622
|
-
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement."));
|
|
623
|
-
}
|
|
624
|
-
return null;
|
|
625
|
-
}
|
|
626
|
-
return createChainableTypeChecker(validate);
|
|
627
|
-
}
|
|
628
|
-
function createElementTypeTypeChecker() {
|
|
629
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
630
|
-
var propValue = props[propName];
|
|
631
|
-
if (!ReactIs.isValidElementType(propValue)) {
|
|
632
|
-
var propType = getPropType(propValue);
|
|
633
|
-
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement type."));
|
|
634
|
-
}
|
|
635
|
-
return null;
|
|
636
|
-
}
|
|
637
|
-
return createChainableTypeChecker(validate);
|
|
638
|
-
}
|
|
639
|
-
function createInstanceTypeChecker(expectedClass) {
|
|
640
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
641
|
-
if (!(props[propName] instanceof expectedClass)) {
|
|
642
|
-
var expectedClassName = expectedClass.name || ANONYMOUS;
|
|
643
|
-
var actualClassName = getClassName(props[propName]);
|
|
644
|
-
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + actualClassName + "` supplied to `" + componentName + "`, expected ") + ("instance of `" + expectedClassName + "`."));
|
|
645
|
-
}
|
|
646
|
-
return null;
|
|
647
|
-
}
|
|
648
|
-
return createChainableTypeChecker(validate);
|
|
649
|
-
}
|
|
650
|
-
function createEnumTypeChecker(expectedValues) {
|
|
651
|
-
if (!Array.isArray(expectedValues)) {
|
|
652
|
-
if (process.env.NODE_ENV !== "production") {
|
|
653
|
-
if (arguments.length > 1) {
|
|
654
|
-
printWarning(
|
|
655
|
-
"Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."
|
|
656
|
-
);
|
|
657
|
-
} else {
|
|
658
|
-
printWarning("Invalid argument supplied to oneOf, expected an array.");
|
|
659
|
-
}
|
|
660
|
-
}
|
|
661
|
-
return emptyFunctionThatReturnsNull;
|
|
662
|
-
}
|
|
663
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
664
|
-
var propValue = props[propName];
|
|
665
|
-
for (var i = 0; i < expectedValues.length; i++) {
|
|
666
|
-
if (is(propValue, expectedValues[i])) {
|
|
667
|
-
return null;
|
|
668
|
-
}
|
|
669
|
-
}
|
|
670
|
-
var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
|
|
671
|
-
var type = getPreciseType(value);
|
|
672
|
-
if (type === "symbol") {
|
|
673
|
-
return String(value);
|
|
674
|
-
}
|
|
675
|
-
return value;
|
|
676
|
-
});
|
|
677
|
-
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of value `" + String(propValue) + "` " + ("supplied to `" + componentName + "`, expected one of " + valuesString + "."));
|
|
678
|
-
}
|
|
679
|
-
return createChainableTypeChecker(validate);
|
|
680
|
-
}
|
|
681
|
-
function createObjectOfTypeChecker(typeChecker) {
|
|
682
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
683
|
-
if (typeof typeChecker !== "function") {
|
|
684
|
-
return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside objectOf.");
|
|
685
|
-
}
|
|
686
|
-
var propValue = props[propName];
|
|
687
|
-
var propType = getPropType(propValue);
|
|
688
|
-
if (propType !== "object") {
|
|
689
|
-
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an object."));
|
|
690
|
-
}
|
|
691
|
-
for (var key in propValue) {
|
|
692
|
-
if (has(propValue, key)) {
|
|
693
|
-
var error = typeChecker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
|
|
694
|
-
if (error instanceof Error) {
|
|
695
|
-
return error;
|
|
696
|
-
}
|
|
697
|
-
}
|
|
698
|
-
}
|
|
699
|
-
return null;
|
|
700
|
-
}
|
|
701
|
-
return createChainableTypeChecker(validate);
|
|
702
|
-
}
|
|
703
|
-
function createUnionTypeChecker(arrayOfTypeCheckers) {
|
|
704
|
-
if (!Array.isArray(arrayOfTypeCheckers)) {
|
|
705
|
-
process.env.NODE_ENV !== "production" ? printWarning("Invalid argument supplied to oneOfType, expected an instance of array.") : void 0;
|
|
706
|
-
return emptyFunctionThatReturnsNull;
|
|
707
|
-
}
|
|
708
|
-
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
709
|
-
var checker = arrayOfTypeCheckers[i];
|
|
710
|
-
if (typeof checker !== "function") {
|
|
711
|
-
printWarning(
|
|
712
|
-
"Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + getPostfixForTypeWarning(checker) + " at index " + i + "."
|
|
713
|
-
);
|
|
714
|
-
return emptyFunctionThatReturnsNull;
|
|
715
|
-
}
|
|
716
|
-
}
|
|
717
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
718
|
-
var expectedTypes = [];
|
|
719
|
-
for (var i2 = 0; i2 < arrayOfTypeCheckers.length; i2++) {
|
|
720
|
-
var checker2 = arrayOfTypeCheckers[i2];
|
|
721
|
-
var checkerResult = checker2(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
|
|
722
|
-
if (checkerResult == null) {
|
|
723
|
-
return null;
|
|
724
|
-
}
|
|
725
|
-
if (checkerResult.data && has(checkerResult.data, "expectedType")) {
|
|
726
|
-
expectedTypes.push(checkerResult.data.expectedType);
|
|
727
|
-
}
|
|
728
|
-
}
|
|
729
|
-
var expectedTypesMessage = expectedTypes.length > 0 ? ", expected one of type [" + expectedTypes.join(", ") + "]" : "";
|
|
730
|
-
return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`" + expectedTypesMessage + "."));
|
|
731
|
-
}
|
|
732
|
-
return createChainableTypeChecker(validate);
|
|
733
|
-
}
|
|
734
|
-
function createNodeChecker() {
|
|
735
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
736
|
-
if (!isNode(props[propName])) {
|
|
737
|
-
return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`, expected a ReactNode."));
|
|
738
|
-
}
|
|
739
|
-
return null;
|
|
740
|
-
}
|
|
741
|
-
return createChainableTypeChecker(validate);
|
|
742
|
-
}
|
|
743
|
-
function invalidValidatorError(componentName, location, propFullName, key, type) {
|
|
744
|
-
return new PropTypeError(
|
|
745
|
-
(componentName || "React class") + ": " + location + " type `" + propFullName + "." + key + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + type + "`."
|
|
746
|
-
);
|
|
747
|
-
}
|
|
748
|
-
function createShapeTypeChecker(shapeTypes) {
|
|
749
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
750
|
-
var propValue = props[propName];
|
|
751
|
-
var propType = getPropType(propValue);
|
|
752
|
-
if (propType !== "object") {
|
|
753
|
-
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`."));
|
|
754
|
-
}
|
|
755
|
-
for (var key in shapeTypes) {
|
|
756
|
-
var checker = shapeTypes[key];
|
|
757
|
-
if (typeof checker !== "function") {
|
|
758
|
-
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
759
|
-
}
|
|
760
|
-
var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
|
|
761
|
-
if (error) {
|
|
762
|
-
return error;
|
|
763
|
-
}
|
|
764
|
-
}
|
|
765
|
-
return null;
|
|
766
|
-
}
|
|
767
|
-
return createChainableTypeChecker(validate);
|
|
768
|
-
}
|
|
769
|
-
function createStrictShapeTypeChecker(shapeTypes) {
|
|
770
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
771
|
-
var propValue = props[propName];
|
|
772
|
-
var propType = getPropType(propValue);
|
|
773
|
-
if (propType !== "object") {
|
|
774
|
-
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`."));
|
|
775
|
-
}
|
|
776
|
-
var allKeys = assign({}, props[propName], shapeTypes);
|
|
777
|
-
for (var key in allKeys) {
|
|
778
|
-
var checker = shapeTypes[key];
|
|
779
|
-
if (has(shapeTypes, key) && typeof checker !== "function") {
|
|
780
|
-
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
781
|
-
}
|
|
782
|
-
if (!checker) {
|
|
783
|
-
return new PropTypeError(
|
|
784
|
-
"Invalid " + location + " `" + propFullName + "` key `" + key + "` supplied to `" + componentName + "`.\nBad object: " + JSON.stringify(props[propName], null, " ") + "\nValid keys: " + JSON.stringify(Object.keys(shapeTypes), null, " ")
|
|
785
|
-
);
|
|
786
|
-
}
|
|
787
|
-
var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
|
|
788
|
-
if (error) {
|
|
789
|
-
return error;
|
|
790
|
-
}
|
|
791
|
-
}
|
|
792
|
-
return null;
|
|
793
|
-
}
|
|
794
|
-
return createChainableTypeChecker(validate);
|
|
795
|
-
}
|
|
796
|
-
function isNode(propValue) {
|
|
797
|
-
switch (typeof propValue) {
|
|
798
|
-
case "number":
|
|
799
|
-
case "string":
|
|
800
|
-
case "undefined":
|
|
801
|
-
return true;
|
|
802
|
-
case "boolean":
|
|
803
|
-
return !propValue;
|
|
804
|
-
case "object":
|
|
805
|
-
if (Array.isArray(propValue)) {
|
|
806
|
-
return propValue.every(isNode);
|
|
807
|
-
}
|
|
808
|
-
if (propValue === null || isValidElement2(propValue)) {
|
|
809
|
-
return true;
|
|
810
|
-
}
|
|
811
|
-
var iteratorFn = getIteratorFn(propValue);
|
|
812
|
-
if (iteratorFn) {
|
|
813
|
-
var iterator = iteratorFn.call(propValue);
|
|
814
|
-
var step;
|
|
815
|
-
if (iteratorFn !== propValue.entries) {
|
|
816
|
-
while (!(step = iterator.next()).done) {
|
|
817
|
-
if (!isNode(step.value)) {
|
|
818
|
-
return false;
|
|
819
|
-
}
|
|
820
|
-
}
|
|
821
|
-
} else {
|
|
822
|
-
while (!(step = iterator.next()).done) {
|
|
823
|
-
var entry = step.value;
|
|
824
|
-
if (entry) {
|
|
825
|
-
if (!isNode(entry[1])) {
|
|
826
|
-
return false;
|
|
827
|
-
}
|
|
828
|
-
}
|
|
829
|
-
}
|
|
830
|
-
}
|
|
831
|
-
} else {
|
|
832
|
-
return false;
|
|
833
|
-
}
|
|
834
|
-
return true;
|
|
835
|
-
default:
|
|
836
|
-
return false;
|
|
837
|
-
}
|
|
838
|
-
}
|
|
839
|
-
function isSymbol(propType, propValue) {
|
|
840
|
-
if (propType === "symbol") {
|
|
841
|
-
return true;
|
|
842
|
-
}
|
|
843
|
-
if (!propValue) {
|
|
844
|
-
return false;
|
|
845
|
-
}
|
|
846
|
-
if (propValue["@@toStringTag"] === "Symbol") {
|
|
847
|
-
return true;
|
|
848
|
-
}
|
|
849
|
-
if (typeof Symbol === "function" && propValue instanceof Symbol) {
|
|
850
|
-
return true;
|
|
851
|
-
}
|
|
852
|
-
return false;
|
|
853
|
-
}
|
|
854
|
-
function getPropType(propValue) {
|
|
855
|
-
var propType = typeof propValue;
|
|
856
|
-
if (Array.isArray(propValue)) {
|
|
857
|
-
return "array";
|
|
858
|
-
}
|
|
859
|
-
if (propValue instanceof RegExp) {
|
|
860
|
-
return "object";
|
|
861
|
-
}
|
|
862
|
-
if (isSymbol(propType, propValue)) {
|
|
863
|
-
return "symbol";
|
|
864
|
-
}
|
|
865
|
-
return propType;
|
|
866
|
-
}
|
|
867
|
-
function getPreciseType(propValue) {
|
|
868
|
-
if (typeof propValue === "undefined" || propValue === null) {
|
|
869
|
-
return "" + propValue;
|
|
870
|
-
}
|
|
871
|
-
var propType = getPropType(propValue);
|
|
872
|
-
if (propType === "object") {
|
|
873
|
-
if (propValue instanceof Date) {
|
|
874
|
-
return "date";
|
|
875
|
-
} else if (propValue instanceof RegExp) {
|
|
876
|
-
return "regexp";
|
|
877
|
-
}
|
|
878
|
-
}
|
|
879
|
-
return propType;
|
|
880
|
-
}
|
|
881
|
-
function getPostfixForTypeWarning(value) {
|
|
882
|
-
var type = getPreciseType(value);
|
|
883
|
-
switch (type) {
|
|
884
|
-
case "array":
|
|
885
|
-
case "object":
|
|
886
|
-
return "an " + type;
|
|
887
|
-
case "boolean":
|
|
888
|
-
case "date":
|
|
889
|
-
case "regexp":
|
|
890
|
-
return "a " + type;
|
|
891
|
-
default:
|
|
892
|
-
return type;
|
|
893
|
-
}
|
|
894
|
-
}
|
|
895
|
-
function getClassName(propValue) {
|
|
896
|
-
if (!propValue.constructor || !propValue.constructor.name) {
|
|
897
|
-
return ANONYMOUS;
|
|
898
|
-
}
|
|
899
|
-
return propValue.constructor.name;
|
|
900
|
-
}
|
|
901
|
-
ReactPropTypes.checkPropTypes = checkPropTypes;
|
|
902
|
-
ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
|
|
903
|
-
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
904
|
-
return ReactPropTypes;
|
|
905
|
-
};
|
|
906
|
-
}
|
|
907
|
-
});
|
|
908
|
-
|
|
909
|
-
// ../../node_modules/prop-types/factoryWithThrowingShims.js
|
|
910
|
-
var require_factoryWithThrowingShims = __commonJS({
|
|
911
|
-
"../../node_modules/prop-types/factoryWithThrowingShims.js"(exports2, module2) {
|
|
912
|
-
"use strict";
|
|
913
|
-
var ReactPropTypesSecret = require_ReactPropTypesSecret();
|
|
914
|
-
function emptyFunction() {
|
|
915
|
-
}
|
|
916
|
-
function emptyFunctionWithReset() {
|
|
917
|
-
}
|
|
918
|
-
emptyFunctionWithReset.resetWarningCache = emptyFunction;
|
|
919
|
-
module2.exports = function() {
|
|
920
|
-
function shim(props, propName, componentName, location, propFullName, secret) {
|
|
921
|
-
if (secret === ReactPropTypesSecret) {
|
|
922
|
-
return;
|
|
923
|
-
}
|
|
924
|
-
var err = new Error(
|
|
925
|
-
"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types"
|
|
926
|
-
);
|
|
927
|
-
err.name = "Invariant Violation";
|
|
928
|
-
throw err;
|
|
929
|
-
}
|
|
930
|
-
;
|
|
931
|
-
shim.isRequired = shim;
|
|
932
|
-
function getShim() {
|
|
933
|
-
return shim;
|
|
934
|
-
}
|
|
935
|
-
;
|
|
936
|
-
var ReactPropTypes = {
|
|
937
|
-
array: shim,
|
|
938
|
-
bigint: shim,
|
|
939
|
-
bool: shim,
|
|
940
|
-
func: shim,
|
|
941
|
-
number: shim,
|
|
942
|
-
object: shim,
|
|
943
|
-
string: shim,
|
|
944
|
-
symbol: shim,
|
|
945
|
-
any: shim,
|
|
946
|
-
arrayOf: getShim,
|
|
947
|
-
element: shim,
|
|
948
|
-
elementType: shim,
|
|
949
|
-
instanceOf: getShim,
|
|
950
|
-
node: shim,
|
|
951
|
-
objectOf: getShim,
|
|
952
|
-
oneOf: getShim,
|
|
953
|
-
oneOfType: getShim,
|
|
954
|
-
shape: getShim,
|
|
955
|
-
exact: getShim,
|
|
956
|
-
checkPropTypes: emptyFunctionWithReset,
|
|
957
|
-
resetWarningCache: emptyFunction
|
|
958
|
-
};
|
|
959
|
-
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
960
|
-
return ReactPropTypes;
|
|
961
|
-
};
|
|
962
|
-
}
|
|
963
|
-
});
|
|
964
|
-
|
|
965
|
-
// ../../node_modules/prop-types/index.js
|
|
966
|
-
var require_prop_types = __commonJS({
|
|
967
|
-
"../../node_modules/prop-types/index.js"(exports2, module2) {
|
|
968
|
-
"use strict";
|
|
969
|
-
if (process.env.NODE_ENV !== "production") {
|
|
970
|
-
ReactIs = require_react_is();
|
|
971
|
-
throwOnDirectAccess = true;
|
|
972
|
-
module2.exports = require_factoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess);
|
|
973
|
-
} else {
|
|
974
|
-
module2.exports = require_factoryWithThrowingShims()();
|
|
975
|
-
}
|
|
976
|
-
var ReactIs;
|
|
977
|
-
var throwOnDirectAccess;
|
|
978
|
-
}
|
|
979
|
-
});
|
|
980
|
-
|
|
981
30
|
// src/index.ts
|
|
982
31
|
var index_exports = {};
|
|
983
32
|
__export(index_exports, {
|
|
@@ -988,7 +37,7 @@ __export(index_exports, {
|
|
|
988
37
|
module.exports = __toCommonJS(index_exports);
|
|
989
38
|
|
|
990
39
|
// src/SpreePay.tsx
|
|
991
|
-
var
|
|
40
|
+
var import_react7 = require("react");
|
|
992
41
|
var import_swr2 = require("swr");
|
|
993
42
|
|
|
994
43
|
// ../../node_modules/clsx/dist/clsx.mjs
|
|
@@ -4010,827 +3059,24 @@ var SpreeLegal = () => {
|
|
|
4010
3059
|
};
|
|
4011
3060
|
|
|
4012
3061
|
// src/components/Tabs.tsx
|
|
4013
|
-
var
|
|
4014
|
-
|
|
4015
|
-
|
|
4016
|
-
var import_react = __toESM(require("react"), 1);
|
|
4017
|
-
var import_prop_types = __toESM(require_prop_types(), 1);
|
|
4018
|
-
function ownKeys(object, enumerableOnly) {
|
|
4019
|
-
var keys = Object.keys(object);
|
|
4020
|
-
if (Object.getOwnPropertySymbols) {
|
|
4021
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
4022
|
-
if (enumerableOnly) {
|
|
4023
|
-
symbols = symbols.filter(function(sym) {
|
|
4024
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
4025
|
-
});
|
|
4026
|
-
}
|
|
4027
|
-
keys.push.apply(keys, symbols);
|
|
4028
|
-
}
|
|
4029
|
-
return keys;
|
|
4030
|
-
}
|
|
4031
|
-
function _objectSpread2(target) {
|
|
4032
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
4033
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
4034
|
-
if (i % 2) {
|
|
4035
|
-
ownKeys(Object(source), true).forEach(function(key) {
|
|
4036
|
-
_defineProperty(target, key, source[key]);
|
|
4037
|
-
});
|
|
4038
|
-
} else if (Object.getOwnPropertyDescriptors) {
|
|
4039
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
4040
|
-
} else {
|
|
4041
|
-
ownKeys(Object(source)).forEach(function(key) {
|
|
4042
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
4043
|
-
});
|
|
4044
|
-
}
|
|
4045
|
-
}
|
|
4046
|
-
return target;
|
|
4047
|
-
}
|
|
4048
|
-
function _typeof(obj) {
|
|
4049
|
-
"@babel/helpers - typeof";
|
|
4050
|
-
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
4051
|
-
_typeof = function(obj2) {
|
|
4052
|
-
return typeof obj2;
|
|
4053
|
-
};
|
|
4054
|
-
} else {
|
|
4055
|
-
_typeof = function(obj2) {
|
|
4056
|
-
return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
4057
|
-
};
|
|
4058
|
-
}
|
|
4059
|
-
return _typeof(obj);
|
|
4060
|
-
}
|
|
4061
|
-
function _defineProperty(obj, key, value) {
|
|
4062
|
-
if (key in obj) {
|
|
4063
|
-
Object.defineProperty(obj, key, {
|
|
4064
|
-
value,
|
|
4065
|
-
enumerable: true,
|
|
4066
|
-
configurable: true,
|
|
4067
|
-
writable: true
|
|
4068
|
-
});
|
|
4069
|
-
} else {
|
|
4070
|
-
obj[key] = value;
|
|
4071
|
-
}
|
|
4072
|
-
return obj;
|
|
4073
|
-
}
|
|
4074
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
4075
|
-
if (source == null) return {};
|
|
4076
|
-
var target = {};
|
|
4077
|
-
var sourceKeys = Object.keys(source);
|
|
4078
|
-
var key, i;
|
|
4079
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
4080
|
-
key = sourceKeys[i];
|
|
4081
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
4082
|
-
target[key] = source[key];
|
|
4083
|
-
}
|
|
4084
|
-
return target;
|
|
4085
|
-
}
|
|
4086
|
-
function _objectWithoutProperties(source, excluded) {
|
|
4087
|
-
if (source == null) return {};
|
|
4088
|
-
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
4089
|
-
var key, i;
|
|
4090
|
-
if (Object.getOwnPropertySymbols) {
|
|
4091
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
4092
|
-
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
4093
|
-
key = sourceSymbolKeys[i];
|
|
4094
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
4095
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
4096
|
-
target[key] = source[key];
|
|
4097
|
-
}
|
|
4098
|
-
}
|
|
4099
|
-
return target;
|
|
4100
|
-
}
|
|
4101
|
-
function _slicedToArray(arr, i) {
|
|
4102
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
4103
|
-
}
|
|
4104
|
-
function _arrayWithHoles(arr) {
|
|
4105
|
-
if (Array.isArray(arr)) return arr;
|
|
4106
|
-
}
|
|
4107
|
-
function _iterableToArrayLimit(arr, i) {
|
|
4108
|
-
var _i = arr && (typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]);
|
|
4109
|
-
if (_i == null) return;
|
|
4110
|
-
var _arr = [];
|
|
4111
|
-
var _n = true;
|
|
4112
|
-
var _d = false;
|
|
4113
|
-
var _s, _e;
|
|
4114
|
-
try {
|
|
4115
|
-
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
|
4116
|
-
_arr.push(_s.value);
|
|
4117
|
-
if (i && _arr.length === i) break;
|
|
4118
|
-
}
|
|
4119
|
-
} catch (err) {
|
|
4120
|
-
_d = true;
|
|
4121
|
-
_e = err;
|
|
4122
|
-
} finally {
|
|
4123
|
-
try {
|
|
4124
|
-
if (!_n && _i["return"] != null) _i["return"]();
|
|
4125
|
-
} finally {
|
|
4126
|
-
if (_d) throw _e;
|
|
4127
|
-
}
|
|
4128
|
-
}
|
|
4129
|
-
return _arr;
|
|
4130
|
-
}
|
|
4131
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
4132
|
-
if (!o) return;
|
|
4133
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
4134
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
4135
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
4136
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
4137
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
4138
|
-
}
|
|
4139
|
-
function _arrayLikeToArray(arr, len) {
|
|
4140
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
4141
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
4142
|
-
return arr2;
|
|
4143
|
-
}
|
|
4144
|
-
function _nonIterableRest() {
|
|
4145
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
4146
|
-
}
|
|
4147
|
-
var useAttachEvent = function useAttachEvent2(element, event, cb) {
|
|
4148
|
-
var cbDefined = !!cb;
|
|
4149
|
-
var cbRef = import_react.default.useRef(cb);
|
|
4150
|
-
import_react.default.useEffect(function() {
|
|
4151
|
-
cbRef.current = cb;
|
|
4152
|
-
}, [cb]);
|
|
4153
|
-
import_react.default.useEffect(function() {
|
|
4154
|
-
if (!cbDefined || !element) {
|
|
4155
|
-
return function() {
|
|
4156
|
-
};
|
|
4157
|
-
}
|
|
4158
|
-
var decoratedCb = function decoratedCb2() {
|
|
4159
|
-
if (cbRef.current) {
|
|
4160
|
-
cbRef.current.apply(cbRef, arguments);
|
|
4161
|
-
}
|
|
4162
|
-
};
|
|
4163
|
-
element.on(event, decoratedCb);
|
|
4164
|
-
return function() {
|
|
4165
|
-
element.off(event, decoratedCb);
|
|
4166
|
-
};
|
|
4167
|
-
}, [cbDefined, event, element, cbRef]);
|
|
4168
|
-
};
|
|
4169
|
-
var usePrevious = function usePrevious2(value) {
|
|
4170
|
-
var ref = import_react.default.useRef(value);
|
|
4171
|
-
import_react.default.useEffect(function() {
|
|
4172
|
-
ref.current = value;
|
|
4173
|
-
}, [value]);
|
|
4174
|
-
return ref.current;
|
|
4175
|
-
};
|
|
4176
|
-
var isUnknownObject = function isUnknownObject2(raw) {
|
|
4177
|
-
return raw !== null && _typeof(raw) === "object";
|
|
4178
|
-
};
|
|
4179
|
-
var isPromise = function isPromise2(raw) {
|
|
4180
|
-
return isUnknownObject(raw) && typeof raw.then === "function";
|
|
4181
|
-
};
|
|
4182
|
-
var isStripe = function isStripe2(raw) {
|
|
4183
|
-
return isUnknownObject(raw) && typeof raw.elements === "function" && typeof raw.createToken === "function" && typeof raw.createPaymentMethod === "function" && typeof raw.confirmCardPayment === "function";
|
|
4184
|
-
};
|
|
4185
|
-
var PLAIN_OBJECT_STR = "[object Object]";
|
|
4186
|
-
var isEqual = function isEqual2(left, right) {
|
|
4187
|
-
if (!isUnknownObject(left) || !isUnknownObject(right)) {
|
|
4188
|
-
return left === right;
|
|
4189
|
-
}
|
|
4190
|
-
var leftArray = Array.isArray(left);
|
|
4191
|
-
var rightArray = Array.isArray(right);
|
|
4192
|
-
if (leftArray !== rightArray) return false;
|
|
4193
|
-
var leftPlainObject = Object.prototype.toString.call(left) === PLAIN_OBJECT_STR;
|
|
4194
|
-
var rightPlainObject = Object.prototype.toString.call(right) === PLAIN_OBJECT_STR;
|
|
4195
|
-
if (leftPlainObject !== rightPlainObject) return false;
|
|
4196
|
-
if (!leftPlainObject && !leftArray) return left === right;
|
|
4197
|
-
var leftKeys = Object.keys(left);
|
|
4198
|
-
var rightKeys = Object.keys(right);
|
|
4199
|
-
if (leftKeys.length !== rightKeys.length) return false;
|
|
4200
|
-
var keySet = {};
|
|
4201
|
-
for (var i = 0; i < leftKeys.length; i += 1) {
|
|
4202
|
-
keySet[leftKeys[i]] = true;
|
|
4203
|
-
}
|
|
4204
|
-
for (var _i = 0; _i < rightKeys.length; _i += 1) {
|
|
4205
|
-
keySet[rightKeys[_i]] = true;
|
|
4206
|
-
}
|
|
4207
|
-
var allKeys = Object.keys(keySet);
|
|
4208
|
-
if (allKeys.length !== leftKeys.length) {
|
|
4209
|
-
return false;
|
|
4210
|
-
}
|
|
4211
|
-
var l = left;
|
|
4212
|
-
var r2 = right;
|
|
4213
|
-
var pred = function pred2(key) {
|
|
4214
|
-
return isEqual2(l[key], r2[key]);
|
|
4215
|
-
};
|
|
4216
|
-
return allKeys.every(pred);
|
|
4217
|
-
};
|
|
4218
|
-
var extractAllowedOptionsUpdates = function extractAllowedOptionsUpdates2(options, prevOptions, immutableKeys) {
|
|
4219
|
-
if (!isUnknownObject(options)) {
|
|
4220
|
-
return null;
|
|
4221
|
-
}
|
|
4222
|
-
return Object.keys(options).reduce(function(newOptions, key) {
|
|
4223
|
-
var isUpdated = !isUnknownObject(prevOptions) || !isEqual(options[key], prevOptions[key]);
|
|
4224
|
-
if (immutableKeys.includes(key)) {
|
|
4225
|
-
if (isUpdated) {
|
|
4226
|
-
console.warn("Unsupported prop change: options.".concat(key, " is not a mutable property."));
|
|
4227
|
-
}
|
|
4228
|
-
return newOptions;
|
|
4229
|
-
}
|
|
4230
|
-
if (!isUpdated) {
|
|
4231
|
-
return newOptions;
|
|
4232
|
-
}
|
|
4233
|
-
return _objectSpread2(_objectSpread2({}, newOptions || {}), {}, _defineProperty({}, key, options[key]));
|
|
4234
|
-
}, null);
|
|
4235
|
-
};
|
|
4236
|
-
var INVALID_STRIPE_ERROR$2 = "Invalid prop `stripe` supplied to `Elements`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.";
|
|
4237
|
-
var validateStripe = function validateStripe2(maybeStripe) {
|
|
4238
|
-
var errorMsg = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : INVALID_STRIPE_ERROR$2;
|
|
4239
|
-
if (maybeStripe === null || isStripe(maybeStripe)) {
|
|
4240
|
-
return maybeStripe;
|
|
4241
|
-
}
|
|
4242
|
-
throw new Error(errorMsg);
|
|
4243
|
-
};
|
|
4244
|
-
var parseStripeProp = function parseStripeProp2(raw) {
|
|
4245
|
-
var errorMsg = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : INVALID_STRIPE_ERROR$2;
|
|
4246
|
-
if (isPromise(raw)) {
|
|
4247
|
-
return {
|
|
4248
|
-
tag: "async",
|
|
4249
|
-
stripePromise: Promise.resolve(raw).then(function(result) {
|
|
4250
|
-
return validateStripe(result, errorMsg);
|
|
4251
|
-
})
|
|
4252
|
-
};
|
|
4253
|
-
}
|
|
4254
|
-
var stripe = validateStripe(raw, errorMsg);
|
|
4255
|
-
if (stripe === null) {
|
|
4256
|
-
return {
|
|
4257
|
-
tag: "empty"
|
|
4258
|
-
};
|
|
4259
|
-
}
|
|
4260
|
-
return {
|
|
4261
|
-
tag: "sync",
|
|
4262
|
-
stripe
|
|
4263
|
-
};
|
|
4264
|
-
};
|
|
4265
|
-
var registerWithStripeJs = function registerWithStripeJs2(stripe) {
|
|
4266
|
-
if (!stripe || !stripe._registerWrapper || !stripe.registerAppInfo) {
|
|
4267
|
-
return;
|
|
4268
|
-
}
|
|
4269
|
-
stripe._registerWrapper({
|
|
4270
|
-
name: "react-stripe-js",
|
|
4271
|
-
version: "3.9.0"
|
|
4272
|
-
});
|
|
4273
|
-
stripe.registerAppInfo({
|
|
4274
|
-
name: "react-stripe-js",
|
|
4275
|
-
version: "3.9.0",
|
|
4276
|
-
url: "https://stripe.com/docs/stripe-js/react"
|
|
4277
|
-
});
|
|
4278
|
-
};
|
|
4279
|
-
var ElementsContext = /* @__PURE__ */ import_react.default.createContext(null);
|
|
4280
|
-
ElementsContext.displayName = "ElementsContext";
|
|
4281
|
-
var parseElementsContext = function parseElementsContext2(ctx, useCase) {
|
|
4282
|
-
if (!ctx) {
|
|
4283
|
-
throw new Error("Could not find Elements context; You need to wrap the part of your app that ".concat(useCase, " in an <Elements> provider."));
|
|
4284
|
-
}
|
|
4285
|
-
return ctx;
|
|
4286
|
-
};
|
|
4287
|
-
var Elements = function Elements2(_ref) {
|
|
4288
|
-
var rawStripeProp = _ref.stripe, options = _ref.options, children = _ref.children;
|
|
4289
|
-
var parsed = import_react.default.useMemo(function() {
|
|
4290
|
-
return parseStripeProp(rawStripeProp);
|
|
4291
|
-
}, [rawStripeProp]);
|
|
4292
|
-
var _React$useState = import_react.default.useState(function() {
|
|
4293
|
-
return {
|
|
4294
|
-
stripe: parsed.tag === "sync" ? parsed.stripe : null,
|
|
4295
|
-
elements: parsed.tag === "sync" ? parsed.stripe.elements(options) : null
|
|
4296
|
-
};
|
|
4297
|
-
}), _React$useState2 = _slicedToArray(_React$useState, 2), ctx = _React$useState2[0], setContext = _React$useState2[1];
|
|
4298
|
-
import_react.default.useEffect(function() {
|
|
4299
|
-
var isMounted = true;
|
|
4300
|
-
var safeSetContext = function safeSetContext2(stripe) {
|
|
4301
|
-
setContext(function(ctx2) {
|
|
4302
|
-
if (ctx2.stripe) return ctx2;
|
|
4303
|
-
return {
|
|
4304
|
-
stripe,
|
|
4305
|
-
elements: stripe.elements(options)
|
|
4306
|
-
};
|
|
4307
|
-
});
|
|
4308
|
-
};
|
|
4309
|
-
if (parsed.tag === "async" && !ctx.stripe) {
|
|
4310
|
-
parsed.stripePromise.then(function(stripe) {
|
|
4311
|
-
if (stripe && isMounted) {
|
|
4312
|
-
safeSetContext(stripe);
|
|
4313
|
-
}
|
|
4314
|
-
});
|
|
4315
|
-
} else if (parsed.tag === "sync" && !ctx.stripe) {
|
|
4316
|
-
safeSetContext(parsed.stripe);
|
|
4317
|
-
}
|
|
4318
|
-
return function() {
|
|
4319
|
-
isMounted = false;
|
|
4320
|
-
};
|
|
4321
|
-
}, [parsed, ctx, options]);
|
|
4322
|
-
var prevStripe = usePrevious(rawStripeProp);
|
|
4323
|
-
import_react.default.useEffect(function() {
|
|
4324
|
-
if (prevStripe !== null && prevStripe !== rawStripeProp) {
|
|
4325
|
-
console.warn("Unsupported prop change on Elements: You cannot change the `stripe` prop after setting it.");
|
|
4326
|
-
}
|
|
4327
|
-
}, [prevStripe, rawStripeProp]);
|
|
4328
|
-
var prevOptions = usePrevious(options);
|
|
4329
|
-
import_react.default.useEffect(function() {
|
|
4330
|
-
if (!ctx.elements) {
|
|
4331
|
-
return;
|
|
4332
|
-
}
|
|
4333
|
-
var updates = extractAllowedOptionsUpdates(options, prevOptions, ["clientSecret", "fonts"]);
|
|
4334
|
-
if (updates) {
|
|
4335
|
-
ctx.elements.update(updates);
|
|
4336
|
-
}
|
|
4337
|
-
}, [options, prevOptions, ctx.elements]);
|
|
4338
|
-
import_react.default.useEffect(function() {
|
|
4339
|
-
registerWithStripeJs(ctx.stripe);
|
|
4340
|
-
}, [ctx.stripe]);
|
|
4341
|
-
return /* @__PURE__ */ import_react.default.createElement(ElementsContext.Provider, {
|
|
4342
|
-
value: ctx
|
|
4343
|
-
}, children);
|
|
4344
|
-
};
|
|
4345
|
-
Elements.propTypes = {
|
|
4346
|
-
stripe: import_prop_types.default.any,
|
|
4347
|
-
options: import_prop_types.default.object
|
|
4348
|
-
};
|
|
4349
|
-
var useElementsContextWithUseCase = function useElementsContextWithUseCase2(useCaseMessage) {
|
|
4350
|
-
var ctx = import_react.default.useContext(ElementsContext);
|
|
4351
|
-
return parseElementsContext(ctx, useCaseMessage);
|
|
4352
|
-
};
|
|
4353
|
-
var useElements = function useElements2() {
|
|
4354
|
-
var _useElementsContextWi = useElementsContextWithUseCase("calls useElements()"), elements = _useElementsContextWi.elements;
|
|
4355
|
-
return elements;
|
|
4356
|
-
};
|
|
4357
|
-
var ElementsConsumer = function ElementsConsumer2(_ref2) {
|
|
4358
|
-
var children = _ref2.children;
|
|
4359
|
-
var ctx = useElementsContextWithUseCase("mounts <ElementsConsumer>");
|
|
4360
|
-
return children(ctx);
|
|
4361
|
-
};
|
|
4362
|
-
ElementsConsumer.propTypes = {
|
|
4363
|
-
children: import_prop_types.default.func.isRequired
|
|
4364
|
-
};
|
|
4365
|
-
var _excluded$1 = ["on", "session"];
|
|
4366
|
-
var CheckoutSdkContext = /* @__PURE__ */ import_react.default.createContext(null);
|
|
4367
|
-
CheckoutSdkContext.displayName = "CheckoutSdkContext";
|
|
4368
|
-
var parseCheckoutSdkContext = function parseCheckoutSdkContext2(ctx, useCase) {
|
|
4369
|
-
if (!ctx) {
|
|
4370
|
-
throw new Error("Could not find CheckoutProvider context; You need to wrap the part of your app that ".concat(useCase, " in an <CheckoutProvider> provider."));
|
|
4371
|
-
}
|
|
4372
|
-
return ctx;
|
|
4373
|
-
};
|
|
4374
|
-
var CheckoutContext = /* @__PURE__ */ import_react.default.createContext(null);
|
|
4375
|
-
CheckoutContext.displayName = "CheckoutContext";
|
|
4376
|
-
var extractCheckoutContextValue = function extractCheckoutContextValue2(checkoutSdk, sessionState) {
|
|
4377
|
-
if (!checkoutSdk) {
|
|
4378
|
-
return null;
|
|
4379
|
-
}
|
|
4380
|
-
checkoutSdk.on;
|
|
4381
|
-
checkoutSdk.session;
|
|
4382
|
-
var actions = _objectWithoutProperties(checkoutSdk, _excluded$1);
|
|
4383
|
-
if (!sessionState) {
|
|
4384
|
-
return Object.assign(checkoutSdk.session(), actions);
|
|
4385
|
-
}
|
|
4386
|
-
return Object.assign(sessionState, actions);
|
|
4387
|
-
};
|
|
4388
|
-
var INVALID_STRIPE_ERROR$1 = "Invalid prop `stripe` supplied to `CheckoutProvider`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.";
|
|
4389
|
-
var CheckoutProvider = function CheckoutProvider2(_ref) {
|
|
4390
|
-
var rawStripeProp = _ref.stripe, options = _ref.options, children = _ref.children;
|
|
4391
|
-
var parsed = import_react.default.useMemo(function() {
|
|
4392
|
-
return parseStripeProp(rawStripeProp, INVALID_STRIPE_ERROR$1);
|
|
4393
|
-
}, [rawStripeProp]);
|
|
4394
|
-
var _React$useState = import_react.default.useState(null), _React$useState2 = _slicedToArray(_React$useState, 2), session = _React$useState2[0], setSession = _React$useState2[1];
|
|
4395
|
-
var _React$useState3 = import_react.default.useState(function() {
|
|
4396
|
-
return {
|
|
4397
|
-
stripe: parsed.tag === "sync" ? parsed.stripe : null,
|
|
4398
|
-
checkoutSdk: null
|
|
4399
|
-
};
|
|
4400
|
-
}), _React$useState4 = _slicedToArray(_React$useState3, 2), ctx = _React$useState4[0], setContext = _React$useState4[1];
|
|
4401
|
-
var safeSetContext = function safeSetContext2(stripe, checkoutSdk) {
|
|
4402
|
-
setContext(function(ctx2) {
|
|
4403
|
-
if (ctx2.stripe && ctx2.checkoutSdk) {
|
|
4404
|
-
return ctx2;
|
|
4405
|
-
}
|
|
4406
|
-
return {
|
|
4407
|
-
stripe,
|
|
4408
|
-
checkoutSdk
|
|
4409
|
-
};
|
|
4410
|
-
});
|
|
4411
|
-
};
|
|
4412
|
-
var initCheckoutCalledRef = import_react.default.useRef(false);
|
|
4413
|
-
import_react.default.useEffect(function() {
|
|
4414
|
-
var isMounted = true;
|
|
4415
|
-
if (parsed.tag === "async" && !ctx.stripe) {
|
|
4416
|
-
parsed.stripePromise.then(function(stripe) {
|
|
4417
|
-
if (stripe && isMounted && !initCheckoutCalledRef.current) {
|
|
4418
|
-
initCheckoutCalledRef.current = true;
|
|
4419
|
-
stripe.initCheckout(options).then(function(checkoutSdk) {
|
|
4420
|
-
if (checkoutSdk) {
|
|
4421
|
-
safeSetContext(stripe, checkoutSdk);
|
|
4422
|
-
checkoutSdk.on("change", setSession);
|
|
4423
|
-
}
|
|
4424
|
-
});
|
|
4425
|
-
}
|
|
4426
|
-
});
|
|
4427
|
-
} else if (parsed.tag === "sync" && parsed.stripe && !initCheckoutCalledRef.current) {
|
|
4428
|
-
initCheckoutCalledRef.current = true;
|
|
4429
|
-
parsed.stripe.initCheckout(options).then(function(checkoutSdk) {
|
|
4430
|
-
if (checkoutSdk) {
|
|
4431
|
-
safeSetContext(parsed.stripe, checkoutSdk);
|
|
4432
|
-
checkoutSdk.on("change", setSession);
|
|
4433
|
-
}
|
|
4434
|
-
});
|
|
4435
|
-
}
|
|
4436
|
-
return function() {
|
|
4437
|
-
isMounted = false;
|
|
4438
|
-
};
|
|
4439
|
-
}, [parsed, ctx, options, setSession]);
|
|
4440
|
-
var prevStripe = usePrevious(rawStripeProp);
|
|
4441
|
-
import_react.default.useEffect(function() {
|
|
4442
|
-
if (prevStripe !== null && prevStripe !== rawStripeProp) {
|
|
4443
|
-
console.warn("Unsupported prop change on CheckoutProvider: You cannot change the `stripe` prop after setting it.");
|
|
4444
|
-
}
|
|
4445
|
-
}, [prevStripe, rawStripeProp]);
|
|
4446
|
-
var prevOptions = usePrevious(options);
|
|
4447
|
-
var prevCheckoutSdk = usePrevious(ctx.checkoutSdk);
|
|
4448
|
-
import_react.default.useEffect(function() {
|
|
4449
|
-
var _prevOptions$elements, _options$elementsOpti, _prevOptions$elements2, _options$elementsOpti2;
|
|
4450
|
-
if (!ctx.checkoutSdk) {
|
|
4451
|
-
return;
|
|
4452
|
-
}
|
|
4453
|
-
var hasSdkLoaded = Boolean(!prevCheckoutSdk && ctx.checkoutSdk);
|
|
4454
|
-
var previousAppearance = prevOptions === null || prevOptions === void 0 ? void 0 : (_prevOptions$elements = prevOptions.elementsOptions) === null || _prevOptions$elements === void 0 ? void 0 : _prevOptions$elements.appearance;
|
|
4455
|
-
var currentAppearance = options === null || options === void 0 ? void 0 : (_options$elementsOpti = options.elementsOptions) === null || _options$elementsOpti === void 0 ? void 0 : _options$elementsOpti.appearance;
|
|
4456
|
-
var hasAppearanceChanged = !isEqual(currentAppearance, previousAppearance);
|
|
4457
|
-
if (currentAppearance && (hasAppearanceChanged || hasSdkLoaded)) {
|
|
4458
|
-
ctx.checkoutSdk.changeAppearance(currentAppearance);
|
|
4459
|
-
}
|
|
4460
|
-
var previousFonts = prevOptions === null || prevOptions === void 0 ? void 0 : (_prevOptions$elements2 = prevOptions.elementsOptions) === null || _prevOptions$elements2 === void 0 ? void 0 : _prevOptions$elements2.fonts;
|
|
4461
|
-
var currentFonts = options === null || options === void 0 ? void 0 : (_options$elementsOpti2 = options.elementsOptions) === null || _options$elementsOpti2 === void 0 ? void 0 : _options$elementsOpti2.fonts;
|
|
4462
|
-
var hasFontsChanged = !isEqual(previousFonts, currentFonts);
|
|
4463
|
-
if (currentFonts && (hasFontsChanged || hasSdkLoaded)) {
|
|
4464
|
-
ctx.checkoutSdk.loadFonts(currentFonts);
|
|
4465
|
-
}
|
|
4466
|
-
}, [options, prevOptions, ctx.checkoutSdk, prevCheckoutSdk]);
|
|
4467
|
-
import_react.default.useEffect(function() {
|
|
4468
|
-
registerWithStripeJs(ctx.stripe);
|
|
4469
|
-
}, [ctx.stripe]);
|
|
4470
|
-
var checkoutContextValue = import_react.default.useMemo(function() {
|
|
4471
|
-
return extractCheckoutContextValue(ctx.checkoutSdk, session);
|
|
4472
|
-
}, [ctx.checkoutSdk, session]);
|
|
4473
|
-
if (!ctx.checkoutSdk) {
|
|
4474
|
-
return null;
|
|
4475
|
-
}
|
|
4476
|
-
return /* @__PURE__ */ import_react.default.createElement(CheckoutSdkContext.Provider, {
|
|
4477
|
-
value: ctx
|
|
4478
|
-
}, /* @__PURE__ */ import_react.default.createElement(CheckoutContext.Provider, {
|
|
4479
|
-
value: checkoutContextValue
|
|
4480
|
-
}, children));
|
|
4481
|
-
};
|
|
4482
|
-
CheckoutProvider.propTypes = {
|
|
4483
|
-
stripe: import_prop_types.default.any,
|
|
4484
|
-
options: import_prop_types.default.shape({
|
|
4485
|
-
fetchClientSecret: import_prop_types.default.func.isRequired,
|
|
4486
|
-
elementsOptions: import_prop_types.default.object
|
|
4487
|
-
}).isRequired
|
|
4488
|
-
};
|
|
4489
|
-
var useElementsOrCheckoutSdkContextWithUseCase = function useElementsOrCheckoutSdkContextWithUseCase2(useCaseString) {
|
|
4490
|
-
var checkoutSdkContext = import_react.default.useContext(CheckoutSdkContext);
|
|
4491
|
-
var elementsContext = import_react.default.useContext(ElementsContext);
|
|
4492
|
-
if (checkoutSdkContext && elementsContext) {
|
|
4493
|
-
throw new Error("You cannot wrap the part of your app that ".concat(useCaseString, " in both <CheckoutProvider> and <Elements> providers."));
|
|
4494
|
-
}
|
|
4495
|
-
if (checkoutSdkContext) {
|
|
4496
|
-
return parseCheckoutSdkContext(checkoutSdkContext, useCaseString);
|
|
4497
|
-
}
|
|
4498
|
-
return parseElementsContext(elementsContext, useCaseString);
|
|
4499
|
-
};
|
|
4500
|
-
var _excluded = ["mode"];
|
|
4501
|
-
var capitalized = function capitalized2(str) {
|
|
4502
|
-
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
4503
|
-
};
|
|
4504
|
-
var createElementComponent = function createElementComponent2(type, isServer2) {
|
|
4505
|
-
var displayName = "".concat(capitalized(type), "Element");
|
|
4506
|
-
var ClientElement = function ClientElement2(_ref) {
|
|
4507
|
-
var id = _ref.id, className = _ref.className, _ref$options = _ref.options, options = _ref$options === void 0 ? {} : _ref$options, onBlur = _ref.onBlur, onFocus = _ref.onFocus, onReady = _ref.onReady, onChange = _ref.onChange, onEscape = _ref.onEscape, onClick = _ref.onClick, onLoadError = _ref.onLoadError, onLoaderStart = _ref.onLoaderStart, onNetworksChange = _ref.onNetworksChange, onConfirm = _ref.onConfirm, onCancel = _ref.onCancel, onShippingAddressChange = _ref.onShippingAddressChange, onShippingRateChange = _ref.onShippingRateChange;
|
|
4508
|
-
var ctx = useElementsOrCheckoutSdkContextWithUseCase("mounts <".concat(displayName, ">"));
|
|
4509
|
-
var elements = "elements" in ctx ? ctx.elements : null;
|
|
4510
|
-
var checkoutSdk = "checkoutSdk" in ctx ? ctx.checkoutSdk : null;
|
|
4511
|
-
var _React$useState = import_react.default.useState(null), _React$useState2 = _slicedToArray(_React$useState, 2), element = _React$useState2[0], setElement = _React$useState2[1];
|
|
4512
|
-
var elementRef = import_react.default.useRef(null);
|
|
4513
|
-
var domNode = import_react.default.useRef(null);
|
|
4514
|
-
useAttachEvent(element, "blur", onBlur);
|
|
4515
|
-
useAttachEvent(element, "focus", onFocus);
|
|
4516
|
-
useAttachEvent(element, "escape", onEscape);
|
|
4517
|
-
useAttachEvent(element, "click", onClick);
|
|
4518
|
-
useAttachEvent(element, "loaderror", onLoadError);
|
|
4519
|
-
useAttachEvent(element, "loaderstart", onLoaderStart);
|
|
4520
|
-
useAttachEvent(element, "networkschange", onNetworksChange);
|
|
4521
|
-
useAttachEvent(element, "confirm", onConfirm);
|
|
4522
|
-
useAttachEvent(element, "cancel", onCancel);
|
|
4523
|
-
useAttachEvent(element, "shippingaddresschange", onShippingAddressChange);
|
|
4524
|
-
useAttachEvent(element, "shippingratechange", onShippingRateChange);
|
|
4525
|
-
useAttachEvent(element, "change", onChange);
|
|
4526
|
-
var readyCallback;
|
|
4527
|
-
if (onReady) {
|
|
4528
|
-
if (type === "expressCheckout") {
|
|
4529
|
-
readyCallback = onReady;
|
|
4530
|
-
} else {
|
|
4531
|
-
readyCallback = function readyCallback2() {
|
|
4532
|
-
onReady(element);
|
|
4533
|
-
};
|
|
4534
|
-
}
|
|
4535
|
-
}
|
|
4536
|
-
useAttachEvent(element, "ready", readyCallback);
|
|
4537
|
-
import_react.default.useLayoutEffect(function() {
|
|
4538
|
-
if (elementRef.current === null && domNode.current !== null && (elements || checkoutSdk)) {
|
|
4539
|
-
var newElement = null;
|
|
4540
|
-
if (checkoutSdk) {
|
|
4541
|
-
switch (type) {
|
|
4542
|
-
case "payment":
|
|
4543
|
-
newElement = checkoutSdk.createPaymentElement(options);
|
|
4544
|
-
break;
|
|
4545
|
-
case "address":
|
|
4546
|
-
if ("mode" in options) {
|
|
4547
|
-
var mode = options.mode, restOptions = _objectWithoutProperties(options, _excluded);
|
|
4548
|
-
if (mode === "shipping") {
|
|
4549
|
-
newElement = checkoutSdk.createShippingAddressElement(restOptions);
|
|
4550
|
-
} else if (mode === "billing") {
|
|
4551
|
-
newElement = checkoutSdk.createBillingAddressElement(restOptions);
|
|
4552
|
-
} else {
|
|
4553
|
-
throw new Error("Invalid options.mode. mode must be 'billing' or 'shipping'.");
|
|
4554
|
-
}
|
|
4555
|
-
} else {
|
|
4556
|
-
throw new Error("You must supply options.mode. mode must be 'billing' or 'shipping'.");
|
|
4557
|
-
}
|
|
4558
|
-
break;
|
|
4559
|
-
case "expressCheckout":
|
|
4560
|
-
newElement = checkoutSdk.createExpressCheckoutElement(options);
|
|
4561
|
-
break;
|
|
4562
|
-
case "currencySelector":
|
|
4563
|
-
newElement = checkoutSdk.createCurrencySelectorElement();
|
|
4564
|
-
break;
|
|
4565
|
-
case "taxId":
|
|
4566
|
-
newElement = checkoutSdk.createTaxIdElement(options);
|
|
4567
|
-
break;
|
|
4568
|
-
default:
|
|
4569
|
-
throw new Error("Invalid Element type ".concat(displayName, ". You must use either the <PaymentElement />, <AddressElement options={{mode: 'shipping'}} />, <AddressElement options={{mode: 'billing'}} />, or <ExpressCheckoutElement />."));
|
|
4570
|
-
}
|
|
4571
|
-
} else if (elements) {
|
|
4572
|
-
newElement = elements.create(type, options);
|
|
4573
|
-
}
|
|
4574
|
-
elementRef.current = newElement;
|
|
4575
|
-
setElement(newElement);
|
|
4576
|
-
if (newElement) {
|
|
4577
|
-
newElement.mount(domNode.current);
|
|
4578
|
-
}
|
|
4579
|
-
}
|
|
4580
|
-
}, [elements, checkoutSdk, options]);
|
|
4581
|
-
var prevOptions = usePrevious(options);
|
|
4582
|
-
import_react.default.useEffect(function() {
|
|
4583
|
-
if (!elementRef.current) {
|
|
4584
|
-
return;
|
|
4585
|
-
}
|
|
4586
|
-
var updates = extractAllowedOptionsUpdates(options, prevOptions, ["paymentRequest"]);
|
|
4587
|
-
if (updates && "update" in elementRef.current) {
|
|
4588
|
-
elementRef.current.update(updates);
|
|
4589
|
-
}
|
|
4590
|
-
}, [options, prevOptions]);
|
|
4591
|
-
import_react.default.useLayoutEffect(function() {
|
|
4592
|
-
return function() {
|
|
4593
|
-
if (elementRef.current && typeof elementRef.current.destroy === "function") {
|
|
4594
|
-
try {
|
|
4595
|
-
elementRef.current.destroy();
|
|
4596
|
-
elementRef.current = null;
|
|
4597
|
-
} catch (error) {
|
|
4598
|
-
}
|
|
4599
|
-
}
|
|
4600
|
-
};
|
|
4601
|
-
}, []);
|
|
4602
|
-
return /* @__PURE__ */ import_react.default.createElement("div", {
|
|
4603
|
-
id,
|
|
4604
|
-
className,
|
|
4605
|
-
ref: domNode
|
|
4606
|
-
});
|
|
4607
|
-
};
|
|
4608
|
-
var ServerElement = function ServerElement2(props) {
|
|
4609
|
-
useElementsOrCheckoutSdkContextWithUseCase("mounts <".concat(displayName, ">"));
|
|
4610
|
-
var id = props.id, className = props.className;
|
|
4611
|
-
return /* @__PURE__ */ import_react.default.createElement("div", {
|
|
4612
|
-
id,
|
|
4613
|
-
className
|
|
4614
|
-
});
|
|
4615
|
-
};
|
|
4616
|
-
var Element = isServer2 ? ServerElement : ClientElement;
|
|
4617
|
-
Element.propTypes = {
|
|
4618
|
-
id: import_prop_types.default.string,
|
|
4619
|
-
className: import_prop_types.default.string,
|
|
4620
|
-
onChange: import_prop_types.default.func,
|
|
4621
|
-
onBlur: import_prop_types.default.func,
|
|
4622
|
-
onFocus: import_prop_types.default.func,
|
|
4623
|
-
onReady: import_prop_types.default.func,
|
|
4624
|
-
onEscape: import_prop_types.default.func,
|
|
4625
|
-
onClick: import_prop_types.default.func,
|
|
4626
|
-
onLoadError: import_prop_types.default.func,
|
|
4627
|
-
onLoaderStart: import_prop_types.default.func,
|
|
4628
|
-
onNetworksChange: import_prop_types.default.func,
|
|
4629
|
-
onConfirm: import_prop_types.default.func,
|
|
4630
|
-
onCancel: import_prop_types.default.func,
|
|
4631
|
-
onShippingAddressChange: import_prop_types.default.func,
|
|
4632
|
-
onShippingRateChange: import_prop_types.default.func,
|
|
4633
|
-
options: import_prop_types.default.object
|
|
4634
|
-
};
|
|
4635
|
-
Element.displayName = displayName;
|
|
4636
|
-
Element.__elementType = type;
|
|
4637
|
-
return Element;
|
|
4638
|
-
};
|
|
4639
|
-
var isServer = typeof window === "undefined";
|
|
4640
|
-
var EmbeddedCheckoutContext = /* @__PURE__ */ import_react.default.createContext(null);
|
|
4641
|
-
EmbeddedCheckoutContext.displayName = "EmbeddedCheckoutProviderContext";
|
|
4642
|
-
var useStripe = function useStripe2() {
|
|
4643
|
-
var _useElementsOrCheckou = useElementsOrCheckoutSdkContextWithUseCase("calls useStripe()"), stripe = _useElementsOrCheckou.stripe;
|
|
4644
|
-
return stripe;
|
|
4645
|
-
};
|
|
4646
|
-
var AuBankAccountElement = createElementComponent("auBankAccount", isServer);
|
|
4647
|
-
var CardElement = createElementComponent("card", isServer);
|
|
4648
|
-
var CardNumberElement = createElementComponent("cardNumber", isServer);
|
|
4649
|
-
var CardExpiryElement = createElementComponent("cardExpiry", isServer);
|
|
4650
|
-
var CardCvcElement = createElementComponent("cardCvc", isServer);
|
|
4651
|
-
var FpxBankElement = createElementComponent("fpxBank", isServer);
|
|
4652
|
-
var IbanElement = createElementComponent("iban", isServer);
|
|
4653
|
-
var IdealBankElement = createElementComponent("idealBank", isServer);
|
|
4654
|
-
var P24BankElement = createElementComponent("p24Bank", isServer);
|
|
4655
|
-
var EpsBankElement = createElementComponent("epsBank", isServer);
|
|
4656
|
-
var PaymentElement = createElementComponent("payment", isServer);
|
|
4657
|
-
var ExpressCheckoutElement = createElementComponent("expressCheckout", isServer);
|
|
4658
|
-
var CurrencySelectorElement = createElementComponent("currencySelector", isServer);
|
|
4659
|
-
var PaymentRequestButtonElement = createElementComponent("paymentRequestButton", isServer);
|
|
4660
|
-
var LinkAuthenticationElement = createElementComponent("linkAuthentication", isServer);
|
|
4661
|
-
var AddressElement = createElementComponent("address", isServer);
|
|
4662
|
-
var ShippingAddressElement = createElementComponent("shippingAddress", isServer);
|
|
4663
|
-
var PaymentMethodMessagingElement = createElementComponent("paymentMethodMessaging", isServer);
|
|
4664
|
-
var AffirmMessageElement = createElementComponent("affirmMessage", isServer);
|
|
4665
|
-
var AfterpayClearpayMessageElement = createElementComponent("afterpayClearpayMessage", isServer);
|
|
4666
|
-
var TaxIdElement = createElementComponent("taxId", isServer);
|
|
4667
|
-
|
|
4668
|
-
// ../../node_modules/@stripe/stripe-js/dist/index.mjs
|
|
4669
|
-
var RELEASE_TRAIN = "basil";
|
|
4670
|
-
var runtimeVersionToUrlVersion = function runtimeVersionToUrlVersion2(version) {
|
|
4671
|
-
return version === 3 ? "v3" : version;
|
|
4672
|
-
};
|
|
4673
|
-
var ORIGIN = "https://js.stripe.com";
|
|
4674
|
-
var STRIPE_JS_URL = "".concat(ORIGIN, "/").concat(RELEASE_TRAIN, "/stripe.js");
|
|
4675
|
-
var V3_URL_REGEX = /^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/;
|
|
4676
|
-
var STRIPE_JS_URL_REGEX = /^https:\/\/js\.stripe\.com\/(v3|[a-z]+)\/stripe\.js(\?.*)?$/;
|
|
4677
|
-
var EXISTING_SCRIPT_MESSAGE = "loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";
|
|
4678
|
-
var isStripeJSURL = function isStripeJSURL2(url) {
|
|
4679
|
-
return V3_URL_REGEX.test(url) || STRIPE_JS_URL_REGEX.test(url);
|
|
4680
|
-
};
|
|
4681
|
-
var findScript = function findScript2() {
|
|
4682
|
-
var scripts = document.querySelectorAll('script[src^="'.concat(ORIGIN, '"]'));
|
|
4683
|
-
for (var i = 0; i < scripts.length; i++) {
|
|
4684
|
-
var script = scripts[i];
|
|
4685
|
-
if (!isStripeJSURL(script.src)) {
|
|
4686
|
-
continue;
|
|
4687
|
-
}
|
|
4688
|
-
return script;
|
|
4689
|
-
}
|
|
4690
|
-
return null;
|
|
4691
|
-
};
|
|
4692
|
-
var injectScript = function injectScript2(params) {
|
|
4693
|
-
var queryString = params && !params.advancedFraudSignals ? "?advancedFraudSignals=false" : "";
|
|
4694
|
-
var script = document.createElement("script");
|
|
4695
|
-
script.src = "".concat(STRIPE_JS_URL).concat(queryString);
|
|
4696
|
-
var headOrBody = document.head || document.body;
|
|
4697
|
-
if (!headOrBody) {
|
|
4698
|
-
throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");
|
|
4699
|
-
}
|
|
4700
|
-
headOrBody.appendChild(script);
|
|
4701
|
-
return script;
|
|
4702
|
-
};
|
|
4703
|
-
var registerWrapper = function registerWrapper2(stripe, startTime) {
|
|
4704
|
-
if (!stripe || !stripe._registerWrapper) {
|
|
4705
|
-
return;
|
|
4706
|
-
}
|
|
4707
|
-
stripe._registerWrapper({
|
|
4708
|
-
name: "stripe-js",
|
|
4709
|
-
version: "7.8.0",
|
|
4710
|
-
startTime
|
|
4711
|
-
});
|
|
4712
|
-
};
|
|
4713
|
-
var stripePromise$1 = null;
|
|
4714
|
-
var onErrorListener = null;
|
|
4715
|
-
var onLoadListener = null;
|
|
4716
|
-
var onError = function onError2(reject) {
|
|
4717
|
-
return function(cause) {
|
|
4718
|
-
reject(new Error("Failed to load Stripe.js", {
|
|
4719
|
-
cause
|
|
4720
|
-
}));
|
|
4721
|
-
};
|
|
4722
|
-
};
|
|
4723
|
-
var onLoad = function onLoad2(resolve, reject) {
|
|
4724
|
-
return function() {
|
|
4725
|
-
if (window.Stripe) {
|
|
4726
|
-
resolve(window.Stripe);
|
|
4727
|
-
} else {
|
|
4728
|
-
reject(new Error("Stripe.js not available"));
|
|
4729
|
-
}
|
|
4730
|
-
};
|
|
4731
|
-
};
|
|
4732
|
-
var loadScript = function loadScript2(params) {
|
|
4733
|
-
if (stripePromise$1 !== null) {
|
|
4734
|
-
return stripePromise$1;
|
|
4735
|
-
}
|
|
4736
|
-
stripePromise$1 = new Promise(function(resolve, reject) {
|
|
4737
|
-
if (typeof window === "undefined" || typeof document === "undefined") {
|
|
4738
|
-
resolve(null);
|
|
4739
|
-
return;
|
|
4740
|
-
}
|
|
4741
|
-
if (window.Stripe && params) {
|
|
4742
|
-
console.warn(EXISTING_SCRIPT_MESSAGE);
|
|
4743
|
-
}
|
|
4744
|
-
if (window.Stripe) {
|
|
4745
|
-
resolve(window.Stripe);
|
|
4746
|
-
return;
|
|
4747
|
-
}
|
|
4748
|
-
try {
|
|
4749
|
-
var script = findScript();
|
|
4750
|
-
if (script && params) {
|
|
4751
|
-
console.warn(EXISTING_SCRIPT_MESSAGE);
|
|
4752
|
-
} else if (!script) {
|
|
4753
|
-
script = injectScript(params);
|
|
4754
|
-
} else if (script && onLoadListener !== null && onErrorListener !== null) {
|
|
4755
|
-
var _script$parentNode;
|
|
4756
|
-
script.removeEventListener("load", onLoadListener);
|
|
4757
|
-
script.removeEventListener("error", onErrorListener);
|
|
4758
|
-
(_script$parentNode = script.parentNode) === null || _script$parentNode === void 0 ? void 0 : _script$parentNode.removeChild(script);
|
|
4759
|
-
script = injectScript(params);
|
|
4760
|
-
}
|
|
4761
|
-
onLoadListener = onLoad(resolve, reject);
|
|
4762
|
-
onErrorListener = onError(reject);
|
|
4763
|
-
script.addEventListener("load", onLoadListener);
|
|
4764
|
-
script.addEventListener("error", onErrorListener);
|
|
4765
|
-
} catch (error) {
|
|
4766
|
-
reject(error);
|
|
4767
|
-
return;
|
|
4768
|
-
}
|
|
4769
|
-
});
|
|
4770
|
-
return stripePromise$1["catch"](function(error) {
|
|
4771
|
-
stripePromise$1 = null;
|
|
4772
|
-
return Promise.reject(error);
|
|
4773
|
-
});
|
|
4774
|
-
};
|
|
4775
|
-
var initStripe = function initStripe2(maybeStripe, args, startTime) {
|
|
4776
|
-
if (maybeStripe === null) {
|
|
4777
|
-
return null;
|
|
4778
|
-
}
|
|
4779
|
-
var pk = args[0];
|
|
4780
|
-
var isTestKey = pk.match(/^pk_test/);
|
|
4781
|
-
var version = runtimeVersionToUrlVersion(maybeStripe.version);
|
|
4782
|
-
var expectedVersion = RELEASE_TRAIN;
|
|
4783
|
-
if (isTestKey && version !== expectedVersion) {
|
|
4784
|
-
console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("7.8.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
|
|
4785
|
-
}
|
|
4786
|
-
var stripe = maybeStripe.apply(void 0, args);
|
|
4787
|
-
registerWrapper(stripe, startTime);
|
|
4788
|
-
return stripe;
|
|
4789
|
-
};
|
|
4790
|
-
var stripePromise;
|
|
4791
|
-
var loadCalled = false;
|
|
4792
|
-
var getStripePromise = function getStripePromise2() {
|
|
4793
|
-
if (stripePromise) {
|
|
4794
|
-
return stripePromise;
|
|
4795
|
-
}
|
|
4796
|
-
stripePromise = loadScript(null)["catch"](function(error) {
|
|
4797
|
-
stripePromise = null;
|
|
4798
|
-
return Promise.reject(error);
|
|
4799
|
-
});
|
|
4800
|
-
return stripePromise;
|
|
4801
|
-
};
|
|
4802
|
-
Promise.resolve().then(function() {
|
|
4803
|
-
return getStripePromise();
|
|
4804
|
-
})["catch"](function(error) {
|
|
4805
|
-
if (!loadCalled) {
|
|
4806
|
-
console.warn(error);
|
|
4807
|
-
}
|
|
4808
|
-
});
|
|
4809
|
-
var loadStripe = function loadStripe2() {
|
|
4810
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
4811
|
-
args[_key] = arguments[_key];
|
|
4812
|
-
}
|
|
4813
|
-
loadCalled = true;
|
|
4814
|
-
var startTime = Date.now();
|
|
4815
|
-
return getStripePromise().then(function(maybeStripe) {
|
|
4816
|
-
return initStripe(maybeStripe, args, startTime);
|
|
4817
|
-
});
|
|
4818
|
-
};
|
|
3062
|
+
var import_react6 = require("react");
|
|
3063
|
+
var import_react_stripe_js2 = require("@stripe/react-stripe-js");
|
|
3064
|
+
var import_stripe_js = require("@stripe/stripe-js");
|
|
4819
3065
|
|
|
4820
3066
|
// src/context/SpreePayActionsContext.tsx
|
|
4821
|
-
var
|
|
3067
|
+
var import_react = require("react");
|
|
4822
3068
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
4823
|
-
var SpreePayActionsContext = (0,
|
|
3069
|
+
var SpreePayActionsContext = (0, import_react.createContext)(void 0);
|
|
4824
3070
|
var SpreePayProvider = ({ children, env }) => {
|
|
4825
|
-
const processRef = (0,
|
|
4826
|
-
const [selectedPaymentMethod, setSelectedPaymentMethod] = (0,
|
|
3071
|
+
const processRef = (0, import_react.useRef)(null);
|
|
3072
|
+
const [selectedPaymentMethod, setSelectedPaymentMethod] = (0, import_react.useState)({
|
|
4827
3073
|
type: "CREDIT_CARD" /* CREDIT_CARD */,
|
|
4828
3074
|
method: null
|
|
4829
3075
|
});
|
|
4830
|
-
const register = (0,
|
|
3076
|
+
const register = (0, import_react.useCallback)((fn) => {
|
|
4831
3077
|
processRef.current = fn;
|
|
4832
3078
|
}, []);
|
|
4833
|
-
const
|
|
3079
|
+
const process = (0, import_react.useCallback)((data) => {
|
|
4834
3080
|
if (!processRef.current) throw new Error("SpreePay process function not registered");
|
|
4835
3081
|
try {
|
|
4836
3082
|
return processRef.current(data);
|
|
@@ -4841,7 +3087,7 @@ var SpreePayProvider = ({ children, env }) => {
|
|
|
4841
3087
|
const value = {
|
|
4842
3088
|
env,
|
|
4843
3089
|
enabled: Boolean(selectedPaymentMethod.method),
|
|
4844
|
-
process
|
|
3090
|
+
process,
|
|
4845
3091
|
register,
|
|
4846
3092
|
selectedPaymentMethod,
|
|
4847
3093
|
setSelectedPaymentMethod
|
|
@@ -4849,28 +3095,28 @@ var SpreePayProvider = ({ children, env }) => {
|
|
|
4849
3095
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(SpreePayActionsContext.Provider, { value, children });
|
|
4850
3096
|
};
|
|
4851
3097
|
var useSpreePay = () => {
|
|
4852
|
-
const ctx = (0,
|
|
3098
|
+
const ctx = (0, import_react.useContext)(SpreePayActionsContext);
|
|
4853
3099
|
if (!ctx) throw new Error("useSpreePay must be used within a SpreePayProvider");
|
|
4854
3100
|
return { process: ctx.process, enabled: ctx.enabled, selectedPaymentMethod: ctx.selectedPaymentMethod };
|
|
4855
3101
|
};
|
|
4856
3102
|
var useSpreePaymentMethod = () => {
|
|
4857
|
-
const ctx = (0,
|
|
3103
|
+
const ctx = (0, import_react.useContext)(SpreePayActionsContext);
|
|
4858
3104
|
if (!ctx) throw new Error("useSpreePay must be used within a SpreePayProvider");
|
|
4859
3105
|
return { setSelectedPaymentMethod: ctx.setSelectedPaymentMethod, selectedPaymentMethod: ctx.selectedPaymentMethod };
|
|
4860
3106
|
};
|
|
4861
3107
|
var useSpreePayEnv = () => {
|
|
4862
|
-
const ctx = (0,
|
|
3108
|
+
const ctx = (0, import_react.useContext)(SpreePayActionsContext);
|
|
4863
3109
|
if (!ctx) throw new Error("useSpreePay must be used within a SpreePayProvider");
|
|
4864
3110
|
return { env: ctx.env };
|
|
4865
3111
|
};
|
|
4866
3112
|
var useSpreePayRegister = () => {
|
|
4867
|
-
const ctx = (0,
|
|
3113
|
+
const ctx = (0, import_react.useContext)(SpreePayActionsContext);
|
|
4868
3114
|
if (!ctx) throw new Error("useSpreePayRegister must be used within a SpreePayProvider");
|
|
4869
3115
|
return { register: ctx.register };
|
|
4870
3116
|
};
|
|
4871
3117
|
|
|
4872
3118
|
// src/components/CreditCard/CreditCard.tsx
|
|
4873
|
-
var
|
|
3119
|
+
var import_react5 = require("react");
|
|
4874
3120
|
|
|
4875
3121
|
// src/hooks/useCards.ts
|
|
4876
3122
|
var import_swr = __toESM(require("swr"), 1);
|
|
@@ -4961,13 +3207,14 @@ var CardsList = ({ selectedCard, setCard }) => {
|
|
|
4961
3207
|
};
|
|
4962
3208
|
|
|
4963
3209
|
// src/components/CreditCard/CreditCardForm.tsx
|
|
4964
|
-
var
|
|
3210
|
+
var import_react4 = require("react");
|
|
3211
|
+
var import_react_stripe_js = require("@stripe/react-stripe-js");
|
|
4965
3212
|
|
|
4966
3213
|
// ../../node_modules/@radix-ui/react-slot/dist/index.mjs
|
|
4967
|
-
var
|
|
3214
|
+
var React2 = __toESM(require("react"), 1);
|
|
4968
3215
|
|
|
4969
3216
|
// ../../node_modules/@radix-ui/react-compose-refs/dist/index.mjs
|
|
4970
|
-
var
|
|
3217
|
+
var React = __toESM(require("react"), 1);
|
|
4971
3218
|
function setRef(ref, value) {
|
|
4972
3219
|
if (typeof ref === "function") {
|
|
4973
3220
|
return ref(value);
|
|
@@ -5000,7 +3247,7 @@ function composeRefs(...refs) {
|
|
|
5000
3247
|
};
|
|
5001
3248
|
}
|
|
5002
3249
|
function useComposedRefs(...refs) {
|
|
5003
|
-
return
|
|
3250
|
+
return React.useCallback(composeRefs(...refs), refs);
|
|
5004
3251
|
}
|
|
5005
3252
|
|
|
5006
3253
|
// ../../node_modules/@radix-ui/react-slot/dist/index.mjs
|
|
@@ -5008,21 +3255,21 @@ var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
|
5008
3255
|
// @__NO_SIDE_EFFECTS__
|
|
5009
3256
|
function createSlot(ownerName) {
|
|
5010
3257
|
const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
|
|
5011
|
-
const Slot2 =
|
|
3258
|
+
const Slot2 = React2.forwardRef((props, forwardedRef) => {
|
|
5012
3259
|
const { children, ...slotProps } = props;
|
|
5013
|
-
const childrenArray =
|
|
3260
|
+
const childrenArray = React2.Children.toArray(children);
|
|
5014
3261
|
const slottable = childrenArray.find(isSlottable);
|
|
5015
3262
|
if (slottable) {
|
|
5016
3263
|
const newElement = slottable.props.children;
|
|
5017
3264
|
const newChildren = childrenArray.map((child) => {
|
|
5018
3265
|
if (child === slottable) {
|
|
5019
|
-
if (
|
|
5020
|
-
return
|
|
3266
|
+
if (React2.Children.count(newElement) > 1) return React2.Children.only(null);
|
|
3267
|
+
return React2.isValidElement(newElement) ? newElement.props.children : null;
|
|
5021
3268
|
} else {
|
|
5022
3269
|
return child;
|
|
5023
3270
|
}
|
|
5024
3271
|
});
|
|
5025
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children:
|
|
3272
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children: React2.isValidElement(newElement) ? React2.cloneElement(newElement, void 0, newChildren) : null });
|
|
5026
3273
|
}
|
|
5027
3274
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
|
5028
3275
|
});
|
|
@@ -5032,24 +3279,24 @@ function createSlot(ownerName) {
|
|
|
5032
3279
|
var Slot = /* @__PURE__ */ createSlot("Slot");
|
|
5033
3280
|
// @__NO_SIDE_EFFECTS__
|
|
5034
3281
|
function createSlotClone(ownerName) {
|
|
5035
|
-
const SlotClone =
|
|
3282
|
+
const SlotClone = React2.forwardRef((props, forwardedRef) => {
|
|
5036
3283
|
const { children, ...slotProps } = props;
|
|
5037
|
-
if (
|
|
3284
|
+
if (React2.isValidElement(children)) {
|
|
5038
3285
|
const childrenRef = getElementRef(children);
|
|
5039
3286
|
const props2 = mergeProps(slotProps, children.props);
|
|
5040
|
-
if (children.type !==
|
|
3287
|
+
if (children.type !== React2.Fragment) {
|
|
5041
3288
|
props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
|
5042
3289
|
}
|
|
5043
|
-
return
|
|
3290
|
+
return React2.cloneElement(children, props2);
|
|
5044
3291
|
}
|
|
5045
|
-
return
|
|
3292
|
+
return React2.Children.count(children) > 1 ? React2.Children.only(null) : null;
|
|
5046
3293
|
});
|
|
5047
3294
|
SlotClone.displayName = `${ownerName}.SlotClone`;
|
|
5048
3295
|
return SlotClone;
|
|
5049
3296
|
}
|
|
5050
3297
|
var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
|
|
5051
3298
|
function isSlottable(child) {
|
|
5052
|
-
return
|
|
3299
|
+
return React2.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
|
|
5053
3300
|
}
|
|
5054
3301
|
function mergeProps(slotProps, childProps) {
|
|
5055
3302
|
const overrideProps = { ...childProps };
|
|
@@ -5171,27 +3418,27 @@ function Button({
|
|
|
5171
3418
|
}
|
|
5172
3419
|
|
|
5173
3420
|
// ../../node_modules/@radix-ui/react-checkbox/dist/index.mjs
|
|
5174
|
-
var
|
|
3421
|
+
var React10 = __toESM(require("react"), 1);
|
|
5175
3422
|
|
|
5176
3423
|
// ../../node_modules/@radix-ui/react-context/dist/index.mjs
|
|
5177
|
-
var
|
|
3424
|
+
var React3 = __toESM(require("react"), 1);
|
|
5178
3425
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
5179
3426
|
function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
5180
3427
|
let defaultContexts = [];
|
|
5181
3428
|
function createContext3(rootComponentName, defaultContext) {
|
|
5182
|
-
const BaseContext =
|
|
3429
|
+
const BaseContext = React3.createContext(defaultContext);
|
|
5183
3430
|
const index = defaultContexts.length;
|
|
5184
3431
|
defaultContexts = [...defaultContexts, defaultContext];
|
|
5185
3432
|
const Provider = (props) => {
|
|
5186
3433
|
const { scope, children, ...context } = props;
|
|
5187
3434
|
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
|
5188
|
-
const value =
|
|
3435
|
+
const value = React3.useMemo(() => context, Object.values(context));
|
|
5189
3436
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Context.Provider, { value, children });
|
|
5190
3437
|
};
|
|
5191
3438
|
Provider.displayName = rootComponentName + "Provider";
|
|
5192
3439
|
function useContext22(consumerName, scope) {
|
|
5193
3440
|
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
|
5194
|
-
const context =
|
|
3441
|
+
const context = React3.useContext(Context);
|
|
5195
3442
|
if (context) return context;
|
|
5196
3443
|
if (defaultContext !== void 0) return defaultContext;
|
|
5197
3444
|
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
@@ -5200,11 +3447,11 @@ function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
|
5200
3447
|
}
|
|
5201
3448
|
const createScope = () => {
|
|
5202
3449
|
const scopeContexts = defaultContexts.map((defaultContext) => {
|
|
5203
|
-
return
|
|
3450
|
+
return React3.createContext(defaultContext);
|
|
5204
3451
|
});
|
|
5205
3452
|
return function useScope(scope) {
|
|
5206
3453
|
const contexts = scope?.[scopeName] || scopeContexts;
|
|
5207
|
-
return
|
|
3454
|
+
return React3.useMemo(
|
|
5208
3455
|
() => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),
|
|
5209
3456
|
[scope, contexts]
|
|
5210
3457
|
);
|
|
@@ -5227,7 +3474,7 @@ function composeContextScopes(...scopes) {
|
|
|
5227
3474
|
const currentScope = scopeProps[`__scope${scopeName}`];
|
|
5228
3475
|
return { ...nextScopes2, ...currentScope };
|
|
5229
3476
|
}, {});
|
|
5230
|
-
return
|
|
3477
|
+
return React3.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
|
5231
3478
|
};
|
|
5232
3479
|
};
|
|
5233
3480
|
createScope.scopeName = baseScope.scopeName;
|
|
@@ -5245,16 +3492,16 @@ function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForD
|
|
|
5245
3492
|
}
|
|
5246
3493
|
|
|
5247
3494
|
// ../../node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs
|
|
5248
|
-
var
|
|
3495
|
+
var React5 = __toESM(require("react"), 1);
|
|
5249
3496
|
|
|
5250
3497
|
// ../../node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs
|
|
5251
|
-
var
|
|
5252
|
-
var useLayoutEffect2 = globalThis?.document ?
|
|
3498
|
+
var React4 = __toESM(require("react"), 1);
|
|
3499
|
+
var useLayoutEffect2 = globalThis?.document ? React4.useLayoutEffect : () => {
|
|
5253
3500
|
};
|
|
5254
3501
|
|
|
5255
3502
|
// ../../node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs
|
|
5256
3503
|
var React22 = __toESM(require("react"), 1);
|
|
5257
|
-
var useInsertionEffect =
|
|
3504
|
+
var useInsertionEffect = React5[" useInsertionEffect ".trim().toString()] || useLayoutEffect2;
|
|
5258
3505
|
function useControllableState({
|
|
5259
3506
|
prop,
|
|
5260
3507
|
defaultProp,
|
|
@@ -5269,8 +3516,8 @@ function useControllableState({
|
|
|
5269
3516
|
const isControlled = prop !== void 0;
|
|
5270
3517
|
const value = isControlled ? prop : uncontrolledProp;
|
|
5271
3518
|
if (true) {
|
|
5272
|
-
const isControlledRef =
|
|
5273
|
-
|
|
3519
|
+
const isControlledRef = React5.useRef(prop !== void 0);
|
|
3520
|
+
React5.useEffect(() => {
|
|
5274
3521
|
const wasControlled = isControlledRef.current;
|
|
5275
3522
|
if (wasControlled !== isControlled) {
|
|
5276
3523
|
const from = wasControlled ? "controlled" : "uncontrolled";
|
|
@@ -5282,7 +3529,7 @@ function useControllableState({
|
|
|
5282
3529
|
isControlledRef.current = isControlled;
|
|
5283
3530
|
}, [isControlled, caller]);
|
|
5284
3531
|
}
|
|
5285
|
-
const setValue =
|
|
3532
|
+
const setValue = React5.useCallback(
|
|
5286
3533
|
(nextValue) => {
|
|
5287
3534
|
if (isControlled) {
|
|
5288
3535
|
const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue;
|
|
@@ -5301,13 +3548,13 @@ function useUncontrolledState({
|
|
|
5301
3548
|
defaultProp,
|
|
5302
3549
|
onChange
|
|
5303
3550
|
}) {
|
|
5304
|
-
const [value, setValue] =
|
|
5305
|
-
const prevValueRef =
|
|
5306
|
-
const onChangeRef =
|
|
3551
|
+
const [value, setValue] = React5.useState(defaultProp);
|
|
3552
|
+
const prevValueRef = React5.useRef(value);
|
|
3553
|
+
const onChangeRef = React5.useRef(onChange);
|
|
5307
3554
|
useInsertionEffect(() => {
|
|
5308
3555
|
onChangeRef.current = onChange;
|
|
5309
3556
|
}, [onChange]);
|
|
5310
|
-
|
|
3557
|
+
React5.useEffect(() => {
|
|
5311
3558
|
if (prevValueRef.current !== value) {
|
|
5312
3559
|
onChangeRef.current?.(value);
|
|
5313
3560
|
prevValueRef.current = value;
|
|
@@ -5321,10 +3568,10 @@ function isFunction(value) {
|
|
|
5321
3568
|
var SYNC_STATE = Symbol("RADIX:SYNC_STATE");
|
|
5322
3569
|
|
|
5323
3570
|
// ../../node_modules/@radix-ui/react-use-previous/dist/index.mjs
|
|
5324
|
-
var
|
|
5325
|
-
function
|
|
5326
|
-
const ref =
|
|
5327
|
-
return
|
|
3571
|
+
var React6 = __toESM(require("react"), 1);
|
|
3572
|
+
function usePrevious(value) {
|
|
3573
|
+
const ref = React6.useRef({ value, previous: value });
|
|
3574
|
+
return React6.useMemo(() => {
|
|
5328
3575
|
if (ref.current.value !== value) {
|
|
5329
3576
|
ref.current.previous = ref.current.value;
|
|
5330
3577
|
ref.current.value = value;
|
|
@@ -5334,9 +3581,9 @@ function usePrevious3(value) {
|
|
|
5334
3581
|
}
|
|
5335
3582
|
|
|
5336
3583
|
// ../../node_modules/@radix-ui/react-use-size/dist/index.mjs
|
|
5337
|
-
var
|
|
3584
|
+
var React7 = __toESM(require("react"), 1);
|
|
5338
3585
|
function useSize(element) {
|
|
5339
|
-
const [size, setSize] =
|
|
3586
|
+
const [size, setSize] = React7.useState(void 0);
|
|
5340
3587
|
useLayoutEffect2(() => {
|
|
5341
3588
|
if (element) {
|
|
5342
3589
|
setSize({ width: element.offsetWidth, height: element.offsetHeight });
|
|
@@ -5372,9 +3619,9 @@ function useSize(element) {
|
|
|
5372
3619
|
|
|
5373
3620
|
// ../../node_modules/@radix-ui/react-presence/dist/index.mjs
|
|
5374
3621
|
var React23 = __toESM(require("react"), 1);
|
|
5375
|
-
var
|
|
3622
|
+
var React8 = __toESM(require("react"), 1);
|
|
5376
3623
|
function useStateMachine(initialState, machine) {
|
|
5377
|
-
return
|
|
3624
|
+
return React8.useReducer((state, event) => {
|
|
5378
3625
|
const nextState = machine[state][event];
|
|
5379
3626
|
return nextState ?? state;
|
|
5380
3627
|
}, initialState);
|
|
@@ -5497,7 +3744,7 @@ function getElementRef2(element) {
|
|
|
5497
3744
|
}
|
|
5498
3745
|
|
|
5499
3746
|
// ../../node_modules/@radix-ui/react-primitive/dist/index.mjs
|
|
5500
|
-
var
|
|
3747
|
+
var React9 = __toESM(require("react"), 1);
|
|
5501
3748
|
var ReactDOM = __toESM(require("react-dom"), 1);
|
|
5502
3749
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
5503
3750
|
var NODES = [
|
|
@@ -5521,7 +3768,7 @@ var NODES = [
|
|
|
5521
3768
|
];
|
|
5522
3769
|
var Primitive = NODES.reduce((primitive, node) => {
|
|
5523
3770
|
const Slot2 = createSlot(`Primitive.${node}`);
|
|
5524
|
-
const Node =
|
|
3771
|
+
const Node = React9.forwardRef((props, forwardedRef) => {
|
|
5525
3772
|
const { asChild, ...primitiveProps } = props;
|
|
5526
3773
|
const Comp = asChild ? Slot2 : node;
|
|
5527
3774
|
if (typeof window !== "undefined") {
|
|
@@ -5559,9 +3806,9 @@ function CheckboxProvider(props) {
|
|
|
5559
3806
|
onChange: onCheckedChange,
|
|
5560
3807
|
caller: CHECKBOX_NAME
|
|
5561
3808
|
});
|
|
5562
|
-
const [control, setControl] =
|
|
5563
|
-
const [bubbleInput, setBubbleInput] =
|
|
5564
|
-
const hasConsumerStoppedPropagationRef =
|
|
3809
|
+
const [control, setControl] = React10.useState(null);
|
|
3810
|
+
const [bubbleInput, setBubbleInput] = React10.useState(null);
|
|
3811
|
+
const hasConsumerStoppedPropagationRef = React10.useRef(false);
|
|
5565
3812
|
const isFormControl = control ? !!form || !!control.closest("form") : (
|
|
5566
3813
|
// We set this to true by default so that events bubble to forms without JS (SSR)
|
|
5567
3814
|
true
|
|
@@ -5592,7 +3839,7 @@ function CheckboxProvider(props) {
|
|
|
5592
3839
|
);
|
|
5593
3840
|
}
|
|
5594
3841
|
var TRIGGER_NAME = "CheckboxTrigger";
|
|
5595
|
-
var CheckboxTrigger =
|
|
3842
|
+
var CheckboxTrigger = React10.forwardRef(
|
|
5596
3843
|
({ __scopeCheckbox, onKeyDown, onClick, ...checkboxProps }, forwardedRef) => {
|
|
5597
3844
|
const {
|
|
5598
3845
|
control,
|
|
@@ -5607,8 +3854,8 @@ var CheckboxTrigger = React11.forwardRef(
|
|
|
5607
3854
|
bubbleInput
|
|
5608
3855
|
} = useCheckboxContext(TRIGGER_NAME, __scopeCheckbox);
|
|
5609
3856
|
const composedRefs = useComposedRefs(forwardedRef, setControl);
|
|
5610
|
-
const initialCheckedStateRef =
|
|
5611
|
-
|
|
3857
|
+
const initialCheckedStateRef = React10.useRef(checked);
|
|
3858
|
+
React10.useEffect(() => {
|
|
5612
3859
|
const form = control?.form;
|
|
5613
3860
|
if (form) {
|
|
5614
3861
|
const reset = () => setChecked(initialCheckedStateRef.current);
|
|
@@ -5644,7 +3891,7 @@ var CheckboxTrigger = React11.forwardRef(
|
|
|
5644
3891
|
}
|
|
5645
3892
|
);
|
|
5646
3893
|
CheckboxTrigger.displayName = TRIGGER_NAME;
|
|
5647
|
-
var Checkbox =
|
|
3894
|
+
var Checkbox = React10.forwardRef(
|
|
5648
3895
|
(props, forwardedRef) => {
|
|
5649
3896
|
const {
|
|
5650
3897
|
__scopeCheckbox,
|
|
@@ -5692,7 +3939,7 @@ var Checkbox = React11.forwardRef(
|
|
|
5692
3939
|
);
|
|
5693
3940
|
Checkbox.displayName = CHECKBOX_NAME;
|
|
5694
3941
|
var INDICATOR_NAME = "CheckboxIndicator";
|
|
5695
|
-
var CheckboxIndicator =
|
|
3942
|
+
var CheckboxIndicator = React10.forwardRef(
|
|
5696
3943
|
(props, forwardedRef) => {
|
|
5697
3944
|
const { __scopeCheckbox, forceMount, ...indicatorProps } = props;
|
|
5698
3945
|
const context = useCheckboxContext(INDICATOR_NAME, __scopeCheckbox);
|
|
@@ -5716,7 +3963,7 @@ var CheckboxIndicator = React11.forwardRef(
|
|
|
5716
3963
|
);
|
|
5717
3964
|
CheckboxIndicator.displayName = INDICATOR_NAME;
|
|
5718
3965
|
var BUBBLE_INPUT_NAME = "CheckboxBubbleInput";
|
|
5719
|
-
var CheckboxBubbleInput =
|
|
3966
|
+
var CheckboxBubbleInput = React10.forwardRef(
|
|
5720
3967
|
({ __scopeCheckbox, ...props }, forwardedRef) => {
|
|
5721
3968
|
const {
|
|
5722
3969
|
control,
|
|
@@ -5732,9 +3979,9 @@ var CheckboxBubbleInput = React11.forwardRef(
|
|
|
5732
3979
|
setBubbleInput
|
|
5733
3980
|
} = useCheckboxContext(BUBBLE_INPUT_NAME, __scopeCheckbox);
|
|
5734
3981
|
const composedRefs = useComposedRefs(forwardedRef, setBubbleInput);
|
|
5735
|
-
const prevChecked =
|
|
3982
|
+
const prevChecked = usePrevious(checked);
|
|
5736
3983
|
const controlSize = useSize(control);
|
|
5737
|
-
|
|
3984
|
+
React10.useEffect(() => {
|
|
5738
3985
|
const input = bubbleInput;
|
|
5739
3986
|
if (!input) return;
|
|
5740
3987
|
const inputProto = window.HTMLInputElement.prototype;
|
|
@@ -5751,7 +3998,7 @@ var CheckboxBubbleInput = React11.forwardRef(
|
|
|
5751
3998
|
input.dispatchEvent(event);
|
|
5752
3999
|
}
|
|
5753
4000
|
}, [bubbleInput, prevChecked, checked, hasConsumerStoppedPropagationRef]);
|
|
5754
|
-
const defaultCheckedRef =
|
|
4001
|
+
const defaultCheckedRef = React10.useRef(isIndeterminate(checked) ? false : checked);
|
|
5755
4002
|
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
5756
4003
|
Primitive.input,
|
|
5757
4004
|
{
|
|
@@ -5794,7 +4041,7 @@ function getState(checked) {
|
|
|
5794
4041
|
}
|
|
5795
4042
|
|
|
5796
4043
|
// ../../node_modules/lucide-react/dist/esm/createLucideIcon.js
|
|
5797
|
-
var
|
|
4044
|
+
var import_react3 = require("react");
|
|
5798
4045
|
|
|
5799
4046
|
// ../../node_modules/lucide-react/dist/esm/shared/src/utils.js
|
|
5800
4047
|
var toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
@@ -5818,7 +4065,7 @@ var hasA11yProp = (props) => {
|
|
|
5818
4065
|
};
|
|
5819
4066
|
|
|
5820
4067
|
// ../../node_modules/lucide-react/dist/esm/Icon.js
|
|
5821
|
-
var
|
|
4068
|
+
var import_react2 = require("react");
|
|
5822
4069
|
|
|
5823
4070
|
// ../../node_modules/lucide-react/dist/esm/defaultAttributes.js
|
|
5824
4071
|
var defaultAttributes = {
|
|
@@ -5834,7 +4081,7 @@ var defaultAttributes = {
|
|
|
5834
4081
|
};
|
|
5835
4082
|
|
|
5836
4083
|
// ../../node_modules/lucide-react/dist/esm/Icon.js
|
|
5837
|
-
var Icon = (0,
|
|
4084
|
+
var Icon = (0, import_react2.forwardRef)(
|
|
5838
4085
|
({
|
|
5839
4086
|
color = "currentColor",
|
|
5840
4087
|
size = 24,
|
|
@@ -5844,7 +4091,7 @@ var Icon = (0, import_react3.forwardRef)(
|
|
|
5844
4091
|
children,
|
|
5845
4092
|
iconNode,
|
|
5846
4093
|
...rest
|
|
5847
|
-
}, ref) => (0,
|
|
4094
|
+
}, ref) => (0, import_react2.createElement)(
|
|
5848
4095
|
"svg",
|
|
5849
4096
|
{
|
|
5850
4097
|
ref,
|
|
@@ -5858,7 +4105,7 @@ var Icon = (0, import_react3.forwardRef)(
|
|
|
5858
4105
|
...rest
|
|
5859
4106
|
},
|
|
5860
4107
|
[
|
|
5861
|
-
...iconNode.map(([tag, attrs]) => (0,
|
|
4108
|
+
...iconNode.map(([tag, attrs]) => (0, import_react2.createElement)(tag, attrs)),
|
|
5862
4109
|
...Array.isArray(children) ? children : [children]
|
|
5863
4110
|
]
|
|
5864
4111
|
)
|
|
@@ -5866,8 +4113,8 @@ var Icon = (0, import_react3.forwardRef)(
|
|
|
5866
4113
|
|
|
5867
4114
|
// ../../node_modules/lucide-react/dist/esm/createLucideIcon.js
|
|
5868
4115
|
var createLucideIcon = (iconName, iconNode) => {
|
|
5869
|
-
const Component = (0,
|
|
5870
|
-
({ className, ...props }, ref) => (0,
|
|
4116
|
+
const Component = (0, import_react3.forwardRef)(
|
|
4117
|
+
({ className, ...props }, ref) => (0, import_react3.createElement)(Icon, {
|
|
5871
4118
|
ref,
|
|
5872
4119
|
iconNode,
|
|
5873
4120
|
className: mergeClasses(
|
|
@@ -5911,10 +4158,10 @@ function Checkbox2({ className, ...props }) {
|
|
|
5911
4158
|
}
|
|
5912
4159
|
|
|
5913
4160
|
// ../../node_modules/@radix-ui/react-label/dist/index.mjs
|
|
5914
|
-
var
|
|
4161
|
+
var React11 = __toESM(require("react"), 1);
|
|
5915
4162
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
5916
4163
|
var NAME = "Label";
|
|
5917
|
-
var Label =
|
|
4164
|
+
var Label = React11.forwardRef((props, forwardedRef) => {
|
|
5918
4165
|
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
5919
4166
|
Primitive.label,
|
|
5920
4167
|
{
|
|
@@ -5969,10 +4216,10 @@ var stripeElementClasses = {
|
|
|
5969
4216
|
focus: "border-ring ring-ring/50 ring-[3px]"
|
|
5970
4217
|
};
|
|
5971
4218
|
var CreditCardForm = ({ saveCard }) => {
|
|
5972
|
-
const [cardError, setCardError] = (0,
|
|
5973
|
-
const elements = useElements();
|
|
5974
|
-
const stripe = useStripe();
|
|
5975
|
-
const id = (0,
|
|
4219
|
+
const [cardError, setCardError] = (0, import_react4.useState)(void 0);
|
|
4220
|
+
const elements = (0, import_react_stripe_js.useElements)();
|
|
4221
|
+
const stripe = (0, import_react_stripe_js.useStripe)();
|
|
4222
|
+
const id = (0, import_react4.useId)();
|
|
5976
4223
|
const handleSaveCard = async () => {
|
|
5977
4224
|
if (!elements || !stripe) return;
|
|
5978
4225
|
setCardError(void 0);
|
|
@@ -6010,7 +4257,7 @@ var CreditCardForm = ({ saveCard }) => {
|
|
|
6010
4257
|
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
6011
4258
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex w-full flex-col gap-1", children: [
|
|
6012
4259
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
6013
|
-
CardNumberElement,
|
|
4260
|
+
import_react_stripe_js.CardNumberElement,
|
|
6014
4261
|
{
|
|
6015
4262
|
options: {
|
|
6016
4263
|
style,
|
|
@@ -6021,7 +4268,7 @@ var CreditCardForm = ({ saveCard }) => {
|
|
|
6021
4268
|
),
|
|
6022
4269
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex w-full gap-1", children: [
|
|
6023
4270
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
6024
|
-
CardExpiryElement,
|
|
4271
|
+
import_react_stripe_js.CardExpiryElement,
|
|
6025
4272
|
{
|
|
6026
4273
|
options: {
|
|
6027
4274
|
style,
|
|
@@ -6031,7 +4278,7 @@ var CreditCardForm = ({ saveCard }) => {
|
|
|
6031
4278
|
}
|
|
6032
4279
|
),
|
|
6033
4280
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
6034
|
-
CardCvcElement,
|
|
4281
|
+
import_react_stripe_js.CardCvcElement,
|
|
6035
4282
|
{
|
|
6036
4283
|
options: {
|
|
6037
4284
|
style,
|
|
@@ -6054,7 +4301,7 @@ var CreditCardForm = ({ saveCard }) => {
|
|
|
6054
4301
|
// src/components/CreditCard/CreditCard.tsx
|
|
6055
4302
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
6056
4303
|
var CreditCard = () => {
|
|
6057
|
-
const [showForm, setShowForm] = (0,
|
|
4304
|
+
const [showForm, setShowForm] = (0, import_react5.useState)(false);
|
|
6058
4305
|
const { selectedPaymentMethod, setSelectedPaymentMethod } = useSpreePaymentMethod();
|
|
6059
4306
|
const { mutateCards } = useCards();
|
|
6060
4307
|
const setCard = (card) => {
|
|
@@ -6141,14 +4388,14 @@ var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
|
6141
4388
|
var Tabs = () => {
|
|
6142
4389
|
const { env } = useSpreePayEnv();
|
|
6143
4390
|
const { selectedPaymentMethod, setSelectedPaymentMethod } = useSpreePaymentMethod();
|
|
6144
|
-
const
|
|
4391
|
+
const stripePromise = (0, import_react6.useMemo)(() => (0, import_stripe_js.loadStripe)(env.stripePublicKey), [env.stripePublicKey]);
|
|
6145
4392
|
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "mb-4 rounded-2xl border border-black/25 bg-white", children: [
|
|
6146
4393
|
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex w-full flex-col gap-4 border-b-1 border-black/7 px-7 py-6", children: [
|
|
6147
4394
|
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("h2", { className: "text-primary text-2xl font-semibold", children: "Choose a Payment Method" }),
|
|
6148
4395
|
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(TabButtons, { value: selectedPaymentMethod.type, onChange: setSelectedPaymentMethod })
|
|
6149
4396
|
] }),
|
|
6150
4397
|
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "px-7 py-6", children: [
|
|
6151
|
-
selectedPaymentMethod.type === "CREDIT_CARD" /* CREDIT_CARD */ && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Elements, { stripe:
|
|
4398
|
+
selectedPaymentMethod.type === "CREDIT_CARD" /* CREDIT_CARD */ && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_stripe_js2.Elements, { stripe: stripePromise, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(CreditCard, {}) }),
|
|
6152
4399
|
selectedPaymentMethod.type === "CRYPTO" /* CRYPTO */ && null
|
|
6153
4400
|
] })
|
|
6154
4401
|
] });
|
|
@@ -6333,11 +4580,11 @@ var SpreePay = (props) => {
|
|
|
6333
4580
|
const { className } = props;
|
|
6334
4581
|
const { env } = useSpreePayEnv();
|
|
6335
4582
|
const { selectedPaymentMethod } = useSpreePaymentMethod();
|
|
6336
|
-
(0,
|
|
4583
|
+
(0, import_react7.useEffect)(() => {
|
|
6337
4584
|
registerApi({ baseUrl: env.slapiUrl, authKey: env.slapiAuthKey });
|
|
6338
4585
|
}, [env.slapiUrl, env.slapiAuthKey]);
|
|
6339
4586
|
const { register } = useSpreePayRegister();
|
|
6340
|
-
const handlePay = (0,
|
|
4587
|
+
const handlePay = (0, import_react7.useCallback)(
|
|
6341
4588
|
(data) => {
|
|
6342
4589
|
if (selectedPaymentMethod.type === "CREDIT_CARD" /* CREDIT_CARD */ && selectedPaymentMethod.method) {
|
|
6343
4590
|
return cardPayment({ card: selectedPaymentMethod.method, hash: data.hash });
|
|
@@ -6346,7 +4593,7 @@ var SpreePay = (props) => {
|
|
|
6346
4593
|
},
|
|
6347
4594
|
[selectedPaymentMethod]
|
|
6348
4595
|
);
|
|
6349
|
-
(0,
|
|
4596
|
+
(0, import_react7.useEffect)(() => {
|
|
6350
4597
|
register(handlePay);
|
|
6351
4598
|
}, [register, handlePay]);
|
|
6352
4599
|
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_swr2.SWRConfig, { value: { fetcher: slapiFetcher }, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: cn("sl-spreepay", className), children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "w-full max-w-[540px]", children: [
|
|
@@ -6363,33 +4610,6 @@ var SpreePay = (props) => {
|
|
|
6363
4610
|
});
|
|
6364
4611
|
/*! Bundled license information:
|
|
6365
4612
|
|
|
6366
|
-
react-is/cjs/react-is.production.min.js:
|
|
6367
|
-
(** @license React v16.13.1
|
|
6368
|
-
* react-is.production.min.js
|
|
6369
|
-
*
|
|
6370
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6371
|
-
*
|
|
6372
|
-
* This source code is licensed under the MIT license found in the
|
|
6373
|
-
* LICENSE file in the root directory of this source tree.
|
|
6374
|
-
*)
|
|
6375
|
-
|
|
6376
|
-
react-is/cjs/react-is.development.js:
|
|
6377
|
-
(** @license React v16.13.1
|
|
6378
|
-
* react-is.development.js
|
|
6379
|
-
*
|
|
6380
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6381
|
-
*
|
|
6382
|
-
* This source code is licensed under the MIT license found in the
|
|
6383
|
-
* LICENSE file in the root directory of this source tree.
|
|
6384
|
-
*)
|
|
6385
|
-
|
|
6386
|
-
object-assign/index.js:
|
|
6387
|
-
(*
|
|
6388
|
-
object-assign
|
|
6389
|
-
(c) Sindre Sorhus
|
|
6390
|
-
@license MIT
|
|
6391
|
-
*)
|
|
6392
|
-
|
|
6393
4613
|
lucide-react/dist/esm/shared/src/utils.js:
|
|
6394
4614
|
lucide-react/dist/esm/defaultAttributes.js:
|
|
6395
4615
|
lucide-react/dist/esm/Icon.js:
|