@consumidor-positivo/aurora 0.0.195 → 0.0.197

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.
@@ -0,0 +1,570 @@
1
+ import * as $dbSRa$react from "react";
2
+ import $dbSRa$react__default, { Fragment, useState, useMemo, useRef, useEffect } from "react";
3
+ var render = function render2(props) {
4
+ if (typeof props.children === "function") {
5
+ return $dbSRa$react__default.createElement(Fragment, null, props.children());
6
+ }
7
+ return $dbSRa$react__default.createElement(Fragment, null, props.children || null);
8
+ };
9
+ var Case = function Case2(_ref) {
10
+ var _ref$children = _ref.children, children = _ref$children === void 0 ? null : _ref$children;
11
+ return render({
12
+ children
13
+ });
14
+ };
15
+ var Default = function Default2(_ref) {
16
+ var _ref$children = _ref.children, children = _ref$children === void 0 ? null : _ref$children;
17
+ return render({
18
+ children
19
+ });
20
+ };
21
+ var Else = function Else2(props) {
22
+ return render(props);
23
+ };
24
+ var Fallback = function Fallback2(props) {
25
+ return render(props);
26
+ };
27
+ function asyncGeneratorStep(n, t, e, r, o, a, c) {
28
+ try {
29
+ var i = n[a](c), u = i.value;
30
+ } catch (n2) {
31
+ return void e(n2);
32
+ }
33
+ i.done ? t(u) : Promise.resolve(u).then(r, o);
34
+ }
35
+ function _asyncToGenerator(n) {
36
+ return function() {
37
+ var t = this, e = arguments;
38
+ return new Promise(function(r, o) {
39
+ var a = n.apply(t, e);
40
+ function _next(n2) {
41
+ asyncGeneratorStep(a, r, o, _next, _throw, "next", n2);
42
+ }
43
+ function _throw(n2) {
44
+ asyncGeneratorStep(a, r, o, _next, _throw, "throw", n2);
45
+ }
46
+ _next(void 0);
47
+ });
48
+ };
49
+ }
50
+ function _extends() {
51
+ return _extends = Object.assign ? Object.assign.bind() : function(n) {
52
+ for (var e = 1; e < arguments.length; e++) {
53
+ var t = arguments[e];
54
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
55
+ }
56
+ return n;
57
+ }, _extends.apply(null, arguments);
58
+ }
59
+ function _regeneratorRuntime() {
60
+ _regeneratorRuntime = function() {
61
+ return r;
62
+ };
63
+ var t, r = {}, e = Object.prototype, n = e.hasOwnProperty, o = "function" == typeof Symbol ? Symbol : {}, i = o.iterator || "@@iterator", a = o.asyncIterator || "@@asyncIterator", u = o.toStringTag || "@@toStringTag";
64
+ function c(t2, r2, e2, n2) {
65
+ return Object.defineProperty(t2, r2, {
66
+ value: e2,
67
+ enumerable: !n2,
68
+ configurable: !n2,
69
+ writable: !n2
70
+ });
71
+ }
72
+ try {
73
+ c({}, "");
74
+ } catch (t2) {
75
+ c = function(t3, r2, e2) {
76
+ return t3[r2] = e2;
77
+ };
78
+ }
79
+ function h(r2, e2, n2, o2) {
80
+ var i2 = e2 && e2.prototype instanceof Generator ? e2 : Generator, a2 = Object.create(i2.prototype);
81
+ return c(a2, "_invoke", /* @__PURE__ */ function(r3, e3, n3) {
82
+ var o3 = 1;
83
+ return function(i3, a3) {
84
+ if (3 === o3) throw Error("Generator is already running");
85
+ if (4 === o3) {
86
+ if ("throw" === i3) throw a3;
87
+ return {
88
+ value: t,
89
+ done: true
90
+ };
91
+ }
92
+ for (n3.method = i3, n3.arg = a3; ; ) {
93
+ var u2 = n3.delegate;
94
+ if (u2) {
95
+ var c2 = d(u2, n3);
96
+ if (c2) {
97
+ if (c2 === f) continue;
98
+ return c2;
99
+ }
100
+ }
101
+ if ("next" === n3.method) n3.sent = n3._sent = n3.arg;
102
+ else if ("throw" === n3.method) {
103
+ if (1 === o3) throw o3 = 4, n3.arg;
104
+ n3.dispatchException(n3.arg);
105
+ } else "return" === n3.method && n3.abrupt("return", n3.arg);
106
+ o3 = 3;
107
+ var h2 = s(r3, e3, n3);
108
+ if ("normal" === h2.type) {
109
+ if (o3 = n3.done ? 4 : 2, h2.arg === f) continue;
110
+ return {
111
+ value: h2.arg,
112
+ done: n3.done
113
+ };
114
+ }
115
+ "throw" === h2.type && (o3 = 4, n3.method = "throw", n3.arg = h2.arg);
116
+ }
117
+ };
118
+ }(r2, n2, new Context(o2 || [])), true), a2;
119
+ }
120
+ function s(t2, r2, e2) {
121
+ try {
122
+ return {
123
+ type: "normal",
124
+ arg: t2.call(r2, e2)
125
+ };
126
+ } catch (t3) {
127
+ return {
128
+ type: "throw",
129
+ arg: t3
130
+ };
131
+ }
132
+ }
133
+ r.wrap = h;
134
+ var f = {};
135
+ function Generator() {
136
+ }
137
+ function GeneratorFunction() {
138
+ }
139
+ function GeneratorFunctionPrototype() {
140
+ }
141
+ var l = {};
142
+ c(l, i, function() {
143
+ return this;
144
+ });
145
+ var p = Object.getPrototypeOf, y = p && p(p(x([])));
146
+ y && y !== e && n.call(y, i) && (l = y);
147
+ var v = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(l);
148
+ function g(t2) {
149
+ ["next", "throw", "return"].forEach(function(r2) {
150
+ c(t2, r2, function(t3) {
151
+ return this._invoke(r2, t3);
152
+ });
153
+ });
154
+ }
155
+ function AsyncIterator(t2, r2) {
156
+ function e2(o3, i2, a2, u2) {
157
+ var c2 = s(t2[o3], t2, i2);
158
+ if ("throw" !== c2.type) {
159
+ var h2 = c2.arg, f2 = h2.value;
160
+ return f2 && "object" == typeof f2 && n.call(f2, "__await") ? r2.resolve(f2.__await).then(function(t3) {
161
+ e2("next", t3, a2, u2);
162
+ }, function(t3) {
163
+ e2("throw", t3, a2, u2);
164
+ }) : r2.resolve(f2).then(function(t3) {
165
+ h2.value = t3, a2(h2);
166
+ }, function(t3) {
167
+ return e2("throw", t3, a2, u2);
168
+ });
169
+ }
170
+ u2(c2.arg);
171
+ }
172
+ var o2;
173
+ c(this, "_invoke", function(t3, n2) {
174
+ function i2() {
175
+ return new r2(function(r3, o3) {
176
+ e2(t3, n2, r3, o3);
177
+ });
178
+ }
179
+ return o2 = o2 ? o2.then(i2, i2) : i2();
180
+ }, true);
181
+ }
182
+ function d(r2, e2) {
183
+ var n2 = e2.method, o2 = r2.i[n2];
184
+ if (o2 === t) return e2.delegate = null, "throw" === n2 && r2.i.return && (e2.method = "return", e2.arg = t, d(r2, e2), "throw" === e2.method) || "return" !== n2 && (e2.method = "throw", e2.arg = new TypeError("The iterator does not provide a '" + n2 + "' method")), f;
185
+ var i2 = s(o2, r2.i, e2.arg);
186
+ if ("throw" === i2.type) return e2.method = "throw", e2.arg = i2.arg, e2.delegate = null, f;
187
+ var a2 = i2.arg;
188
+ return a2 ? a2.done ? (e2[r2.r] = a2.value, e2.next = r2.n, "return" !== e2.method && (e2.method = "next", e2.arg = t), e2.delegate = null, f) : a2 : (e2.method = "throw", e2.arg = new TypeError("iterator result is not an object"), e2.delegate = null, f);
189
+ }
190
+ function w(t2) {
191
+ this.tryEntries.push(t2);
192
+ }
193
+ function m(r2) {
194
+ var e2 = r2[4] || {};
195
+ e2.type = "normal", e2.arg = t, r2[4] = e2;
196
+ }
197
+ function Context(t2) {
198
+ this.tryEntries = [[-1]], t2.forEach(w, this), this.reset(true);
199
+ }
200
+ function x(r2) {
201
+ if (null != r2) {
202
+ var e2 = r2[i];
203
+ if (e2) return e2.call(r2);
204
+ if ("function" == typeof r2.next) return r2;
205
+ if (!isNaN(r2.length)) {
206
+ var o2 = -1, a2 = function e3() {
207
+ for (; ++o2 < r2.length; ) if (n.call(r2, o2)) return e3.value = r2[o2], e3.done = false, e3;
208
+ return e3.value = t, e3.done = true, e3;
209
+ };
210
+ return a2.next = a2;
211
+ }
212
+ }
213
+ throw new TypeError(typeof r2 + " is not iterable");
214
+ }
215
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, c(v, "constructor", GeneratorFunctionPrototype), c(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = c(GeneratorFunctionPrototype, u, "GeneratorFunction"), r.isGeneratorFunction = function(t2) {
216
+ var r2 = "function" == typeof t2 && t2.constructor;
217
+ return !!r2 && (r2 === GeneratorFunction || "GeneratorFunction" === (r2.displayName || r2.name));
218
+ }, r.mark = function(t2) {
219
+ return Object.setPrototypeOf ? Object.setPrototypeOf(t2, GeneratorFunctionPrototype) : (t2.__proto__ = GeneratorFunctionPrototype, c(t2, u, "GeneratorFunction")), t2.prototype = Object.create(v), t2;
220
+ }, r.awrap = function(t2) {
221
+ return {
222
+ __await: t2
223
+ };
224
+ }, g(AsyncIterator.prototype), c(AsyncIterator.prototype, a, function() {
225
+ return this;
226
+ }), r.AsyncIterator = AsyncIterator, r.async = function(t2, e2, n2, o2, i2) {
227
+ void 0 === i2 && (i2 = Promise);
228
+ var a2 = new AsyncIterator(h(t2, e2, n2, o2), i2);
229
+ return r.isGeneratorFunction(e2) ? a2 : a2.next().then(function(t3) {
230
+ return t3.done ? t3.value : a2.next();
231
+ });
232
+ }, g(v), c(v, u, "Generator"), c(v, i, function() {
233
+ return this;
234
+ }), c(v, "toString", function() {
235
+ return "[object Generator]";
236
+ }), r.keys = function(t2) {
237
+ var r2 = Object(t2), e2 = [];
238
+ for (var n2 in r2) e2.unshift(n2);
239
+ return function t3() {
240
+ for (; e2.length; ) if ((n2 = e2.pop()) in r2) return t3.value = n2, t3.done = false, t3;
241
+ return t3.done = true, t3;
242
+ };
243
+ }, r.values = x, Context.prototype = {
244
+ constructor: Context,
245
+ reset: function(r2) {
246
+ if (this.prev = this.next = 0, this.sent = this._sent = t, this.done = false, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(m), !r2) for (var e2 in this) "t" === e2.charAt(0) && n.call(this, e2) && !isNaN(+e2.slice(1)) && (this[e2] = t);
247
+ },
248
+ stop: function() {
249
+ this.done = true;
250
+ var t2 = this.tryEntries[0][4];
251
+ if ("throw" === t2.type) throw t2.arg;
252
+ return this.rval;
253
+ },
254
+ dispatchException: function(r2) {
255
+ if (this.done) throw r2;
256
+ var e2 = this;
257
+ function n2(t2) {
258
+ a2.type = "throw", a2.arg = r2, e2.next = t2;
259
+ }
260
+ for (var o2 = e2.tryEntries.length - 1; o2 >= 0; --o2) {
261
+ var i2 = this.tryEntries[o2], a2 = i2[4], u2 = this.prev, c2 = i2[1], h2 = i2[2];
262
+ if (-1 === i2[0]) return n2("end"), false;
263
+ if (!c2 && !h2) throw Error("try statement without catch or finally");
264
+ if (null != i2[0] && i2[0] <= u2) {
265
+ if (u2 < c2) return this.method = "next", this.arg = t, n2(c2), true;
266
+ if (u2 < h2) return n2(h2), false;
267
+ }
268
+ }
269
+ },
270
+ abrupt: function(t2, r2) {
271
+ for (var e2 = this.tryEntries.length - 1; e2 >= 0; --e2) {
272
+ var n2 = this.tryEntries[e2];
273
+ if (n2[0] > -1 && n2[0] <= this.prev && this.prev < n2[2]) {
274
+ var o2 = n2;
275
+ break;
276
+ }
277
+ }
278
+ o2 && ("break" === t2 || "continue" === t2) && o2[0] <= r2 && r2 <= o2[2] && (o2 = null);
279
+ var i2 = o2 ? o2[4] : {};
280
+ return i2.type = t2, i2.arg = r2, o2 ? (this.method = "next", this.next = o2[2], f) : this.complete(i2);
281
+ },
282
+ complete: function(t2, r2) {
283
+ if ("throw" === t2.type) throw t2.arg;
284
+ return "break" === t2.type || "continue" === t2.type ? this.next = t2.arg : "return" === t2.type ? (this.rval = this.arg = t2.arg, this.method = "return", this.next = "end") : "normal" === t2.type && r2 && (this.next = r2), f;
285
+ },
286
+ finish: function(t2) {
287
+ for (var r2 = this.tryEntries.length - 1; r2 >= 0; --r2) {
288
+ var e2 = this.tryEntries[r2];
289
+ if (e2[2] === t2) return this.complete(e2[4], e2[3]), m(e2), f;
290
+ }
291
+ },
292
+ catch: function(t2) {
293
+ for (var r2 = this.tryEntries.length - 1; r2 >= 0; --r2) {
294
+ var e2 = this.tryEntries[r2];
295
+ if (e2[0] === t2) {
296
+ var n2 = e2[4];
297
+ if ("throw" === n2.type) {
298
+ var o2 = n2.arg;
299
+ m(e2);
300
+ }
301
+ return o2;
302
+ }
303
+ }
304
+ throw Error("illegal catch attempt");
305
+ },
306
+ delegateYield: function(r2, e2, n2) {
307
+ return this.delegate = {
308
+ i: x(r2),
309
+ r: e2,
310
+ n: n2
311
+ }, "next" === this.method && (this.arg = t), f;
312
+ }
313
+ }, r;
314
+ }
315
+ var Then = function Then2(props) {
316
+ return render(props);
317
+ };
318
+ function isFunction(input) {
319
+ return typeof input === "function";
320
+ }
321
+ function hasThen(input) {
322
+ return Reflect.has(input, "then") && isFunction(input.then);
323
+ }
324
+ function hasCatch(input) {
325
+ return Reflect.has(input, "catch") && isFunction(input["catch"]);
326
+ }
327
+ function isThenable(input) {
328
+ if (typeof input !== "object" || input === null) return false;
329
+ return input instanceof Promise || input !== Promise.prototype && hasThen(input) && hasCatch(input);
330
+ }
331
+ var shallowArraysEqual = function shallowArraysEqual2(a, b) {
332
+ if (!Array.isArray(a) || !Array.isArray(b)) throw new Error("shallowArraysEqual only accepts arrays as parameters");
333
+ if (a.length !== b.length) return false;
334
+ for (var i = 0; i < a.length; ++i) {
335
+ if (a[i] !== b[i]) return false;
336
+ }
337
+ return true;
338
+ };
339
+ var createCancellablePromise = function createCancellablePromise2(promise) {
340
+ if (!isThenable(promise)) {
341
+ throw new Error("Argument of createCancellablePromise should be a Promise");
342
+ }
343
+ var isCancelled = {
344
+ value: false
345
+ };
346
+ var wrappedPromise = new Promise(/* @__PURE__ */ function() {
347
+ var _ref = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee(res, rej) {
348
+ var d;
349
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
350
+ while (1) switch (_context.prev = _context.next) {
351
+ case 0:
352
+ _context.prev = 0;
353
+ _context.next = 3;
354
+ return promise;
355
+ case 3:
356
+ d = _context.sent;
357
+ if (!isCancelled.value) {
358
+ res(d);
359
+ }
360
+ _context.next = 10;
361
+ break;
362
+ case 7:
363
+ _context.prev = 7;
364
+ _context.t0 = _context["catch"](0);
365
+ if (!isCancelled.value) {
366
+ rej(_context.t0);
367
+ }
368
+ case 10:
369
+ case "end":
370
+ return _context.stop();
371
+ }
372
+ }, _callee, null, [[0, 7]]);
373
+ }));
374
+ return function(_x, _x2) {
375
+ return _ref.apply(this, arguments);
376
+ };
377
+ }());
378
+ Object.keys(promise).forEach(function(key) {
379
+ wrappedPromise[key] = promise[key];
380
+ });
381
+ return {
382
+ promise: wrappedPromise,
383
+ cancel: function cancel() {
384
+ isCancelled.value = true;
385
+ }
386
+ };
387
+ };
388
+ var useSingleton = function useSingleton2(callback, dependencies) {
389
+ if (dependencies === void 0) {
390
+ dependencies = [];
391
+ }
392
+ var hasRan = useRef(false);
393
+ var lastDependencies = useRef([]);
394
+ if (typeof callback !== "function") {
395
+ throw new Error("Incorrect callback parameter for useSingleton hook; expected a function, but got: '" + typeof callback + "'.");
396
+ }
397
+ if (!Array.isArray(dependencies)) {
398
+ throw new Error("Incorrect dependencies parameter for useSingleton; expected an array, but got: '" + typeof dependencies + "'.");
399
+ }
400
+ var hasDependencies = Array.isArray(dependencies) && dependencies.length > 0;
401
+ if (hasDependencies) {
402
+ var hasAnyDependencyChanged = !shallowArraysEqual(lastDependencies.current, dependencies);
403
+ if (hasAnyDependencyChanged) {
404
+ lastDependencies.current = dependencies;
405
+ } else if (hasRan.current) {
406
+ return;
407
+ }
408
+ } else if (hasRan.current) {
409
+ return;
410
+ }
411
+ callback();
412
+ hasRan.current = true;
413
+ };
414
+ function IfAsync(_ref) {
415
+ var promise = _ref.promise, _ref$keepAlive = _ref.keepAlive, keepAlive = _ref$keepAlive === void 0 ? false : _ref$keepAlive, children = _ref.children;
416
+ var _useState = useState(null), isResolved = _useState[0], setIsResolved = _useState[1];
417
+ var _useState2 = useState(null), returnValue = _useState2[0], setReturnValue = _useState2[1];
418
+ var cancellablePromise = useMemo(function() {
419
+ return createCancellablePromise(promise);
420
+ }, [promise]);
421
+ var history = useRef([]);
422
+ useEffect(function() {
423
+ return function() {
424
+ if (!keepAlive) {
425
+ cancellablePromise.cancel();
426
+ }
427
+ };
428
+ }, [cancellablePromise, cancellablePromise.promise, keepAlive]);
429
+ useSingleton(/* @__PURE__ */ _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee() {
430
+ var data;
431
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
432
+ while (1) switch (_context.prev = _context.next) {
433
+ case 0:
434
+ setIsResolved(null);
435
+ setReturnValue(null);
436
+ _context.prev = 2;
437
+ _context.next = 5;
438
+ return cancellablePromise.promise;
439
+ case 5:
440
+ data = _context.sent;
441
+ setReturnValue(data);
442
+ setIsResolved(true);
443
+ history.current.push(cancellablePromise);
444
+ _context.next = 16;
445
+ break;
446
+ case 11:
447
+ _context.prev = 11;
448
+ _context.t0 = _context["catch"](2);
449
+ setReturnValue(_context.t0);
450
+ setIsResolved(false);
451
+ history.current.push(cancellablePromise);
452
+ case 16:
453
+ case "end":
454
+ return _context.stop();
455
+ }
456
+ }, _callee, null, [[2, 11]]);
457
+ })), [cancellablePromise.promise]);
458
+ if (!children || !isThenable(promise)) {
459
+ return null;
460
+ }
461
+ if (isResolved === null) {
462
+ var hasFallback = $dbSRa$react.Children.toArray(children).find(function(c) {
463
+ return c.type === Fallback;
464
+ });
465
+ return $dbSRa$react.createElement(Fragment, null, hasFallback || null);
466
+ }
467
+ if (!isResolved) {
468
+ var hasElse = $dbSRa$react.Children.toArray(children).find(function(c) {
469
+ return c.type === Else;
470
+ });
471
+ if (!hasElse) return $dbSRa$react.createElement(Fragment, null, null);
472
+ var elseElement = hasElse;
473
+ var hasElseProps = hasElse.props;
474
+ if (typeof hasElseProps.children === "function") {
475
+ elseElement = _extends({}, hasElse, {
476
+ props: _extends({}, hasElseProps, {
477
+ children: function children2() {
478
+ return hasElseProps.children(returnValue, history.current, cancellablePromise.promise);
479
+ }
480
+ })
481
+ });
482
+ }
483
+ return $dbSRa$react.createElement(Fragment, null, elseElement);
484
+ }
485
+ var hasThen2 = $dbSRa$react.Children.toArray(children).find(function(c) {
486
+ return c.type === Then;
487
+ });
488
+ if (!hasThen2) return $dbSRa$react.createElement(Fragment, null, null);
489
+ var thenElement = hasThen2;
490
+ var hasThenProps = hasThen2.props;
491
+ if (typeof hasThenProps.children === "function") {
492
+ thenElement = _extends({}, hasThen2, {
493
+ props: _extends({}, hasThenProps, {
494
+ children: function children2() {
495
+ return hasThenProps.children(returnValue, history.current, cancellablePromise.promise);
496
+ }
497
+ })
498
+ });
499
+ }
500
+ return $dbSRa$react.createElement(Fragment, null, thenElement);
501
+ }
502
+ var getConditionResult = function getConditionResult2(condition) {
503
+ var conditionResult = Boolean(typeof condition === "function" ? condition() : condition);
504
+ return conditionResult;
505
+ };
506
+ function tinyWarning(condition, message) {
507
+ if (process.env.NODE_ENV !== "production") {
508
+ if (condition) {
509
+ if (typeof console !== "undefined") {
510
+ console.warn(message);
511
+ }
512
+ try {
513
+ throw new Error(message);
514
+ } catch (x) {
515
+ }
516
+ }
517
+ }
518
+ }
519
+ var If = function If2(_ref) {
520
+ var condition = _ref.condition, _ref$keepAlive = _ref.keepAlive, keepAlive = _ref$keepAlive === void 0 ? false : _ref$keepAlive, children = _ref.children;
521
+ if (!children) {
522
+ return null;
523
+ }
524
+ tinyWarning(!Array.isArray(children) && !(children.type === Else || children.type === Then) || !$dbSRa$react__default.Children.toArray(children).every(function(child) {
525
+ return child.type === Else || child.type === Then || child.type === Fallback;
526
+ }), "The <If> component should contain <Then /> <Else /> or <Fallback /> components as its children");
527
+ if (isThenable(condition)) {
528
+ return $dbSRa$react__default.createElement(IfAsync, {
529
+ promise: condition,
530
+ keepAlive
531
+ }, children);
532
+ }
533
+ var conditionResult = getConditionResult(condition);
534
+ return $dbSRa$react__default.createElement(Fragment, null, $dbSRa$react__default.Children.toArray(children).find(function(c) {
535
+ return c.type !== Else !== !conditionResult;
536
+ }) || null);
537
+ };
538
+ var Switch = function Switch2(_ref) {
539
+ var _ref2;
540
+ var children = _ref.children;
541
+ var matchingCase = void 0;
542
+ var defaultCase = void 0;
543
+ if (isFunction(children)) {
544
+ children = children();
545
+ }
546
+ $dbSRa$react.Children.forEach(children, function(child) {
547
+ if (!$dbSRa$react.isValidElement(child)) {
548
+ return;
549
+ }
550
+ if (!matchingCase && child.type === Case) {
551
+ var childProps = child.props;
552
+ var conditionResult = getConditionResult(childProps.condition);
553
+ if (conditionResult) {
554
+ matchingCase = child;
555
+ }
556
+ } else if (!defaultCase && child.type === Default) {
557
+ defaultCase = child;
558
+ }
559
+ });
560
+ return (_ref2 = matchingCase != null ? matchingCase : defaultCase) != null ? _ref2 : null;
561
+ };
562
+ export {
563
+ Case as C,
564
+ Default as D,
565
+ Else as E,
566
+ If as I,
567
+ Switch as S,
568
+ Then as T
569
+ };
570
+ //# sourceMappingURL=react-if.esm-BV55Vzhf.js.map