@plasmicpkgs/plasmic-yotpo 0.0.3 → 0.0.5

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.
@@ -4,694 +4,337 @@ import React, { useContext } from 'react';
4
4
  import { usePlasmicQueryData } from '@plasmicapp/query';
5
5
  import L from 'lodash-es';
6
6
 
7
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
7
+ function _regeneratorRuntime() {
8
+ _regeneratorRuntime = function () {
9
+ return e;
10
+ };
11
+ var t,
12
+ e = {},
13
+ r = Object.prototype,
14
+ n = r.hasOwnProperty,
15
+ o = Object.defineProperty || function (t, e, r) {
16
+ t[e] = r.value;
17
+ },
18
+ i = "function" == typeof Symbol ? Symbol : {},
19
+ a = i.iterator || "@@iterator",
20
+ c = i.asyncIterator || "@@asyncIterator",
21
+ u = i.toStringTag || "@@toStringTag";
22
+ function define(t, e, r) {
23
+ return Object.defineProperty(t, e, {
24
+ value: r,
25
+ enumerable: !0,
26
+ configurable: !0,
27
+ writable: !0
28
+ }), t[e];
29
+ }
8
30
  try {
9
- var info = gen[key](arg);
10
- var value = info.value;
11
- } catch (error) {
12
- reject(error);
13
- return;
31
+ define({}, "");
32
+ } catch (t) {
33
+ define = function (t, e, r) {
34
+ return t[e] = r;
35
+ };
14
36
  }
15
- if (info.done) {
16
- resolve(value);
17
- } else {
18
- Promise.resolve(value).then(_next, _throw);
37
+ function wrap(t, e, r, n) {
38
+ var i = e && e.prototype instanceof Generator ? e : Generator,
39
+ a = Object.create(i.prototype),
40
+ c = new Context(n || []);
41
+ return o(a, "_invoke", {
42
+ value: makeInvokeMethod(t, r, c)
43
+ }), a;
19
44
  }
20
- }
21
- function _asyncToGenerator(fn) {
22
- return function () {
23
- var self = this,
24
- args = arguments;
25
- return new Promise(function (resolve, reject) {
26
- var gen = fn.apply(self, args);
27
- function _next(value) {
28
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
29
- }
30
- function _throw(err) {
31
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
32
- }
33
- _next(undefined);
34
- });
35
- };
36
- }
37
-
38
- function createCommonjsModule(fn, module) {
39
- return module = { exports: {} }, fn(module, module.exports), module.exports;
40
- }
41
-
42
- var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
43
- /**
44
- * Copyright (c) 2014-present, Facebook, Inc.
45
- *
46
- * This source code is licensed under the MIT license found in the
47
- * LICENSE file in the root directory of this source tree.
48
- */
49
-
50
- var runtime = function (exports) {
51
-
52
- var Op = Object.prototype;
53
- var hasOwn = Op.hasOwnProperty;
54
- var undefined$1; // More compressible than void 0.
55
- var $Symbol = typeof Symbol === "function" ? Symbol : {};
56
- var iteratorSymbol = $Symbol.iterator || "@@iterator";
57
- var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
58
- var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
59
- function define(obj, key, value) {
60
- Object.defineProperty(obj, key, {
61
- value: value,
62
- enumerable: true,
63
- configurable: true,
64
- writable: true
65
- });
66
- return obj[key];
67
- }
45
+ function tryCatch(t, e, r) {
68
46
  try {
69
- // IE 8 has a broken Object.defineProperty that only works on DOM objects.
70
- define({}, "");
71
- } catch (err) {
72
- define = function define(obj, key, value) {
73
- return obj[key] = value;
47
+ return {
48
+ type: "normal",
49
+ arg: t.call(e, r)
50
+ };
51
+ } catch (t) {
52
+ return {
53
+ type: "throw",
54
+ arg: t
74
55
  };
75
56
  }
76
- function wrap(innerFn, outerFn, self, tryLocsList) {
77
- // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
78
- var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
79
- var generator = Object.create(protoGenerator.prototype);
80
- var context = new Context(tryLocsList || []);
81
-
82
- // The ._invoke method unifies the implementations of the .next,
83
- // .throw, and .return methods.
84
- generator._invoke = makeInvokeMethod(innerFn, self, context);
85
- return generator;
86
- }
87
- exports.wrap = wrap;
88
-
89
- // Try/catch helper to minimize deoptimizations. Returns a completion
90
- // record like context.tryEntries[i].completion. This interface could
91
- // have been (and was previously) designed to take a closure to be
92
- // invoked without arguments, but in all the cases we care about we
93
- // already have an existing method we want to call, so there's no need
94
- // to create a new function object. We can even get away with assuming
95
- // the method takes exactly one argument, since that happens to be true
96
- // in every case, so we don't have to touch the arguments object. The
97
- // only additional allocation required is the completion record, which
98
- // has a stable shape and so hopefully should be cheap to allocate.
99
- function tryCatch(fn, obj, arg) {
100
- try {
101
- return {
102
- type: "normal",
103
- arg: fn.call(obj, arg)
104
- };
105
- } catch (err) {
106
- return {
107
- type: "throw",
108
- arg: err
109
- };
110
- }
111
- }
112
- var GenStateSuspendedStart = "suspendedStart";
113
- var GenStateSuspendedYield = "suspendedYield";
114
- var GenStateExecuting = "executing";
115
- var GenStateCompleted = "completed";
116
-
117
- // Returning this object from the innerFn has the same effect as
118
- // breaking out of the dispatch switch statement.
119
- var ContinueSentinel = {};
120
-
121
- // Dummy constructor functions that we use as the .constructor and
122
- // .constructor.prototype properties for functions that return Generator
123
- // objects. For full spec compliance, you may wish to configure your
124
- // minifier not to mangle the names of these two functions.
125
- function Generator() {}
126
- function GeneratorFunction() {}
127
- function GeneratorFunctionPrototype() {}
128
-
129
- // This is a polyfill for %IteratorPrototype% for environments that
130
- // don't natively support it.
131
- var IteratorPrototype = {};
132
- define(IteratorPrototype, iteratorSymbol, function () {
133
- return this;
57
+ }
58
+ e.wrap = wrap;
59
+ var h = "suspendedStart",
60
+ l = "suspendedYield",
61
+ f = "executing",
62
+ s = "completed",
63
+ y = {};
64
+ function Generator() {}
65
+ function GeneratorFunction() {}
66
+ function GeneratorFunctionPrototype() {}
67
+ var p = {};
68
+ define(p, a, function () {
69
+ return this;
70
+ });
71
+ var d = Object.getPrototypeOf,
72
+ v = d && d(d(values([])));
73
+ v && v !== r && n.call(v, a) && (p = v);
74
+ var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
75
+ function defineIteratorMethods(t) {
76
+ ["next", "throw", "return"].forEach(function (e) {
77
+ define(t, e, function (t) {
78
+ return this._invoke(e, t);
79
+ });
134
80
  });
135
- var getProto = Object.getPrototypeOf;
136
- var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
137
- if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
138
- // This environment has a native %IteratorPrototype%; use it instead
139
- // of the polyfill.
140
- IteratorPrototype = NativeIteratorPrototype;
141
- }
142
- var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
143
- GeneratorFunction.prototype = GeneratorFunctionPrototype;
144
- define(Gp, "constructor", GeneratorFunctionPrototype);
145
- define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
146
- GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction");
147
-
148
- // Helper for defining the .next, .throw, and .return methods of the
149
- // Iterator interface in terms of a single ._invoke method.
150
- function defineIteratorMethods(prototype) {
151
- ["next", "throw", "return"].forEach(function (method) {
152
- define(prototype, method, function (arg) {
153
- return this._invoke(method, arg);
81
+ }
82
+ function AsyncIterator(t, e) {
83
+ function invoke(r, o, i, a) {
84
+ var c = tryCatch(t[r], t, o);
85
+ if ("throw" !== c.type) {
86
+ var u = c.arg,
87
+ h = u.value;
88
+ return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
89
+ invoke("next", t, i, a);
90
+ }, function (t) {
91
+ invoke("throw", t, i, a);
92
+ }) : e.resolve(h).then(function (t) {
93
+ u.value = t, i(u);
94
+ }, function (t) {
95
+ return invoke("throw", t, i, a);
154
96
  });
155
- });
156
- }
157
- exports.isGeneratorFunction = function (genFun) {
158
- var ctor = typeof genFun === "function" && genFun.constructor;
159
- return ctor ? ctor === GeneratorFunction ||
160
- // For the native GeneratorFunction constructor, the best we can
161
- // do is to check its .name property.
162
- (ctor.displayName || ctor.name) === "GeneratorFunction" : false;
163
- };
164
- exports.mark = function (genFun) {
165
- if (Object.setPrototypeOf) {
166
- Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
167
- } else {
168
- genFun.__proto__ = GeneratorFunctionPrototype;
169
- define(genFun, toStringTagSymbol, "GeneratorFunction");
170
- }
171
- genFun.prototype = Object.create(Gp);
172
- return genFun;
173
- };
174
-
175
- // Within the body of any async function, `await x` is transformed to
176
- // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
177
- // `hasOwn.call(value, "__await")` to determine if the yielded value is
178
- // meant to be awaited.
179
- exports.awrap = function (arg) {
180
- return {
181
- __await: arg
182
- };
183
- };
184
- function AsyncIterator(generator, PromiseImpl) {
185
- function invoke(method, arg, resolve, reject) {
186
- var record = tryCatch(generator[method], generator, arg);
187
- if (record.type === "throw") {
188
- reject(record.arg);
189
- } else {
190
- var result = record.arg;
191
- var value = result.value;
192
- if (value && typeof value === "object" && hasOwn.call(value, "__await")) {
193
- return PromiseImpl.resolve(value.__await).then(function (value) {
194
- invoke("next", value, resolve, reject);
195
- }, function (err) {
196
- invoke("throw", err, resolve, reject);
197
- });
198
- }
199
- return PromiseImpl.resolve(value).then(function (unwrapped) {
200
- // When a yielded Promise is resolved, its final value becomes
201
- // the .value of the Promise<{value,done}> result for the
202
- // current iteration.
203
- result.value = unwrapped;
204
- resolve(result);
205
- }, function (error) {
206
- // If a rejected Promise was yielded, throw the rejection back
207
- // into the async generator function so it can be handled there.
208
- return invoke("throw", error, resolve, reject);
209
- });
210
- }
211
97
  }
212
- var previousPromise;
213
- function enqueue(method, arg) {
98
+ a(c.arg);
99
+ }
100
+ var r;
101
+ o(this, "_invoke", {
102
+ value: function (t, n) {
214
103
  function callInvokeWithMethodAndArg() {
215
- return new PromiseImpl(function (resolve, reject) {
216
- invoke(method, arg, resolve, reject);
104
+ return new e(function (e, r) {
105
+ invoke(t, n, e, r);
217
106
  });
218
107
  }
219
- return previousPromise =
220
- // If enqueue has been called before, then we want to wait until
221
- // all previous Promises have been resolved before calling invoke,
222
- // so that results are always delivered in the correct order. If
223
- // enqueue has not been called before, then it is important to
224
- // call invoke immediately, without waiting on a callback to fire,
225
- // so that the async generator function has the opportunity to do
226
- // any necessary setup in a predictable way. This predictability
227
- // is why the Promise constructor synchronously invokes its
228
- // executor callback, and why async functions synchronously
229
- // execute code before the first await. Since we implement simple
230
- // async functions in terms of async generators, it is especially
231
- // important to get this right, even though it requires care.
232
- previousPromise ? previousPromise.then(callInvokeWithMethodAndArg,
233
- // Avoid propagating failures to Promises returned by later
234
- // invocations of the iterator.
235
- callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
108
+ return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
236
109
  }
237
-
238
- // Define the unified helper method that is used to implement .next,
239
- // .throw, and .return (see defineIteratorMethods).
240
- this._invoke = enqueue;
241
- }
242
- defineIteratorMethods(AsyncIterator.prototype);
243
- define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
244
- return this;
245
110
  });
246
- exports.AsyncIterator = AsyncIterator;
247
-
248
- // Note that simple async functions are implemented on top of
249
- // AsyncIterator objects; they just return a Promise for the value of
250
- // the final result produced by the iterator.
251
- exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
252
- if (PromiseImpl === void 0) PromiseImpl = Promise;
253
- var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
254
- return exports.isGeneratorFunction(outerFn) ? iter // If outerFn is a generator, return the full iterator.
255
- : iter.next().then(function (result) {
256
- return result.done ? result.value : iter.next();
257
- });
258
- };
259
- function makeInvokeMethod(innerFn, self, context) {
260
- var state = GenStateSuspendedStart;
261
- return function invoke(method, arg) {
262
- if (state === GenStateExecuting) {
263
- throw new Error("Generator is already running");
264
- }
265
- if (state === GenStateCompleted) {
266
- if (method === "throw") {
267
- throw arg;
268
- }
269
-
270
- // Be forgiving, per 25.3.3.3.3 of the spec:
271
- // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
272
- return doneResult();
273
- }
274
- context.method = method;
275
- context.arg = arg;
276
- while (true) {
277
- var delegate = context.delegate;
278
- if (delegate) {
279
- var delegateResult = maybeInvokeDelegate(delegate, context);
280
- if (delegateResult) {
281
- if (delegateResult === ContinueSentinel) continue;
282
- return delegateResult;
283
- }
284
- }
285
- if (context.method === "next") {
286
- // Setting context._sent for legacy support of Babel's
287
- // function.sent implementation.
288
- context.sent = context._sent = context.arg;
289
- } else if (context.method === "throw") {
290
- if (state === GenStateSuspendedStart) {
291
- state = GenStateCompleted;
292
- throw context.arg;
293
- }
294
- context.dispatchException(context.arg);
295
- } else if (context.method === "return") {
296
- context.abrupt("return", context.arg);
297
- }
298
- state = GenStateExecuting;
299
- var record = tryCatch(innerFn, self, context);
300
- if (record.type === "normal") {
301
- // If an exception is thrown from innerFn, we leave state ===
302
- // GenStateExecuting and loop back for another invocation.
303
- state = context.done ? GenStateCompleted : GenStateSuspendedYield;
304
- if (record.arg === ContinueSentinel) {
305
- continue;
306
- }
307
- return {
308
- value: record.arg,
309
- done: context.done
310
- };
311
- } else if (record.type === "throw") {
312
- state = GenStateCompleted;
313
- // Dispatch the exception by looping back around to the
314
- // context.dispatchException(context.arg) call above.
315
- context.method = "throw";
316
- context.arg = record.arg;
111
+ }
112
+ function makeInvokeMethod(e, r, n) {
113
+ var o = h;
114
+ return function (i, a) {
115
+ if (o === f) throw new Error("Generator is already running");
116
+ if (o === s) {
117
+ if ("throw" === i) throw a;
118
+ return {
119
+ value: t,
120
+ done: !0
121
+ };
122
+ }
123
+ for (n.method = i, n.arg = a;;) {
124
+ var c = n.delegate;
125
+ if (c) {
126
+ var u = maybeInvokeDelegate(c, n);
127
+ if (u) {
128
+ if (u === y) continue;
129
+ return u;
317
130
  }
318
131
  }
319
- };
320
- }
321
-
322
- // Call delegate.iterator[context.method](context.arg) and handle the
323
- // result, either by returning a { value, done } result from the
324
- // delegate iterator, or by modifying context.method and context.arg,
325
- // setting context.delegate to null, and returning the ContinueSentinel.
326
- function maybeInvokeDelegate(delegate, context) {
327
- var method = delegate.iterator[context.method];
328
- if (method === undefined$1) {
329
- // A .throw or .return when the delegate iterator has no .throw
330
- // method always terminates the yield* loop.
331
- context.delegate = null;
332
- if (context.method === "throw") {
333
- // Note: ["return"] must be used for ES3 parsing compatibility.
334
- if (delegate.iterator["return"]) {
335
- // If the delegate iterator has a return method, give it a
336
- // chance to clean up.
337
- context.method = "return";
338
- context.arg = undefined$1;
339
- maybeInvokeDelegate(delegate, context);
340
- if (context.method === "throw") {
341
- // If maybeInvokeDelegate(context) changed context.method from
342
- // "return" to "throw", let that override the TypeError below.
343
- return ContinueSentinel;
344
- }
345
- }
346
- context.method = "throw";
347
- context.arg = new TypeError("The iterator does not provide a 'throw' method");
132
+ if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
133
+ if (o === h) throw o = s, n.arg;
134
+ n.dispatchException(n.arg);
135
+ } else "return" === n.method && n.abrupt("return", n.arg);
136
+ o = f;
137
+ var p = tryCatch(e, r, n);
138
+ if ("normal" === p.type) {
139
+ if (o = n.done ? s : l, p.arg === y) continue;
140
+ return {
141
+ value: p.arg,
142
+ done: n.done
143
+ };
348
144
  }
349
- return ContinueSentinel;
350
- }
351
- var record = tryCatch(method, delegate.iterator, context.arg);
352
- if (record.type === "throw") {
353
- context.method = "throw";
354
- context.arg = record.arg;
355
- context.delegate = null;
356
- return ContinueSentinel;
145
+ "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
357
146
  }
358
- var info = record.arg;
359
- if (!info) {
360
- context.method = "throw";
361
- context.arg = new TypeError("iterator result is not an object");
362
- context.delegate = null;
363
- return ContinueSentinel;
364
- }
365
- if (info.done) {
366
- // Assign the result of the finished delegate to the temporary
367
- // variable specified by delegate.resultName (see delegateYield).
368
- context[delegate.resultName] = info.value;
369
-
370
- // Resume execution at the desired location (see delegateYield).
371
- context.next = delegate.nextLoc;
372
-
373
- // If context.method was "throw" but the delegate handled the
374
- // exception, let the outer generator proceed normally. If
375
- // context.method was "next", forget context.arg since it has been
376
- // "consumed" by the delegate iterator. If context.method was
377
- // "return", allow the original .return call to continue in the
378
- // outer generator.
379
- if (context.method !== "return") {
380
- context.method = "next";
381
- context.arg = undefined$1;
382
- }
383
- } else {
384
- // Re-yield the result returned by the delegate method.
385
- return info;
147
+ };
148
+ }
149
+ function maybeInvokeDelegate(e, r) {
150
+ var n = r.method,
151
+ o = e.iterator[n];
152
+ if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
153
+ var i = tryCatch(o, e.iterator, r.arg);
154
+ if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
155
+ var a = i.arg;
156
+ return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
157
+ }
158
+ function pushTryEntry(t) {
159
+ var e = {
160
+ tryLoc: t[0]
161
+ };
162
+ 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
163
+ }
164
+ function resetTryEntry(t) {
165
+ var e = t.completion || {};
166
+ e.type = "normal", delete e.arg, t.completion = e;
167
+ }
168
+ function Context(t) {
169
+ this.tryEntries = [{
170
+ tryLoc: "root"
171
+ }], t.forEach(pushTryEntry, this), this.reset(!0);
172
+ }
173
+ function values(e) {
174
+ if (e || "" === e) {
175
+ var r = e[a];
176
+ if (r) return r.call(e);
177
+ if ("function" == typeof e.next) return e;
178
+ if (!isNaN(e.length)) {
179
+ var o = -1,
180
+ i = function next() {
181
+ for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
182
+ return next.value = t, next.done = !0, next;
183
+ };
184
+ return i.next = i;
386
185
  }
387
-
388
- // The delegate iterator is finished, so forget it and continue with
389
- // the outer generator.
390
- context.delegate = null;
391
- return ContinueSentinel;
392
186
  }
393
-
394
- // Define Generator.prototype.{next,throw,return} in terms of the
395
- // unified ._invoke helper method.
396
- defineIteratorMethods(Gp);
397
- define(Gp, toStringTagSymbol, "Generator");
398
-
399
- // A Generator should always return itself as the iterator object when the
400
- // @@iterator function is called on it. Some browsers' implementations of the
401
- // iterator prototype chain incorrectly implement this, causing the Generator
402
- // object to not be returned from this call. This ensures that doesn't happen.
403
- // See https://github.com/facebook/regenerator/issues/274 for more details.
404
- define(Gp, iteratorSymbol, function () {
405
- return this;
406
- });
407
- define(Gp, "toString", function () {
408
- return "[object Generator]";
187
+ throw new TypeError(typeof e + " is not iterable");
188
+ }
189
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
190
+ value: GeneratorFunctionPrototype,
191
+ configurable: !0
192
+ }), o(GeneratorFunctionPrototype, "constructor", {
193
+ value: GeneratorFunction,
194
+ configurable: !0
195
+ }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
196
+ var e = "function" == typeof t && t.constructor;
197
+ return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
198
+ }, e.mark = function (t) {
199
+ return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
200
+ }, e.awrap = function (t) {
201
+ return {
202
+ __await: t
203
+ };
204
+ }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
205
+ return this;
206
+ }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
207
+ void 0 === i && (i = Promise);
208
+ var a = new AsyncIterator(wrap(t, r, n, o), i);
209
+ return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
210
+ return t.done ? t.value : a.next();
409
211
  });
410
- function pushTryEntry(locs) {
411
- var entry = {
412
- tryLoc: locs[0]
413
- };
414
- if (1 in locs) {
415
- entry.catchLoc = locs[1];
416
- }
417
- if (2 in locs) {
418
- entry.finallyLoc = locs[2];
419
- entry.afterLoc = locs[3];
212
+ }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
213
+ return this;
214
+ }), define(g, "toString", function () {
215
+ return "[object Generator]";
216
+ }), e.keys = function (t) {
217
+ var e = Object(t),
218
+ r = [];
219
+ for (var n in e) r.push(n);
220
+ return r.reverse(), function next() {
221
+ for (; r.length;) {
222
+ var t = r.pop();
223
+ if (t in e) return next.value = t, next.done = !1, next;
420
224
  }
421
- this.tryEntries.push(entry);
422
- }
423
- function resetTryEntry(entry) {
424
- var record = entry.completion || {};
425
- record.type = "normal";
426
- delete record.arg;
427
- entry.completion = record;
428
- }
429
- function Context(tryLocsList) {
430
- // The root entry object (effectively a try statement without a catch
431
- // or a finally block) gives us a place to store values thrown from
432
- // locations where there is no enclosing try statement.
433
- this.tryEntries = [{
434
- tryLoc: "root"
435
- }];
436
- tryLocsList.forEach(pushTryEntry, this);
437
- this.reset(true);
438
- }
439
- exports.keys = function (object) {
440
- var keys = [];
441
- for (var key in object) {
442
- keys.push(key);
443
- }
444
- keys.reverse();
445
-
446
- // Rather than returning an object with a next method, we keep
447
- // things simple and return the next function itself.
448
- return function next() {
449
- while (keys.length) {
450
- var key = keys.pop();
451
- if (key in object) {
452
- next.value = key;
453
- next.done = false;
454
- return next;
455
- }
456
- }
457
-
458
- // To avoid creating an additional object, we just hang the .value
459
- // and .done properties off the next function object itself. This
460
- // also ensures that the minifier will not anonymize the function.
461
- next.done = true;
462
- return next;
463
- };
225
+ return next.done = !0, next;
464
226
  };
465
- function values(iterable) {
466
- if (iterable) {
467
- var iteratorMethod = iterable[iteratorSymbol];
468
- if (iteratorMethod) {
469
- return iteratorMethod.call(iterable);
470
- }
471
- if (typeof iterable.next === "function") {
472
- return iterable;
473
- }
474
- if (!isNaN(iterable.length)) {
475
- var i = -1,
476
- next = function next() {
477
- while (++i < iterable.length) {
478
- if (hasOwn.call(iterable, i)) {
479
- next.value = iterable[i];
480
- next.done = false;
481
- return next;
482
- }
483
- }
484
- next.value = undefined$1;
485
- next.done = true;
486
- return next;
487
- };
488
- return next.next = next;
489
- }
227
+ }, e.values = values, Context.prototype = {
228
+ constructor: Context,
229
+ reset: function (e) {
230
+ if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
231
+ },
232
+ stop: function () {
233
+ this.done = !0;
234
+ var t = this.tryEntries[0].completion;
235
+ if ("throw" === t.type) throw t.arg;
236
+ return this.rval;
237
+ },
238
+ dispatchException: function (e) {
239
+ if (this.done) throw e;
240
+ var r = this;
241
+ function handle(n, o) {
242
+ return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
490
243
  }
491
-
492
- // Return an iterator with no values.
493
- return {
494
- next: doneResult
495
- };
496
- }
497
- exports.values = values;
498
- function doneResult() {
499
- return {
500
- value: undefined$1,
501
- done: true
502
- };
503
- }
504
- Context.prototype = {
505
- constructor: Context,
506
- reset: function reset(skipTempReset) {
507
- this.prev = 0;
508
- this.next = 0;
509
- // Resetting context._sent for legacy support of Babel's
510
- // function.sent implementation.
511
- this.sent = this._sent = undefined$1;
512
- this.done = false;
513
- this.delegate = null;
514
- this.method = "next";
515
- this.arg = undefined$1;
516
- this.tryEntries.forEach(resetTryEntry);
517
- if (!skipTempReset) {
518
- for (var name in this) {
519
- // Not sure about the optimal order of these conditions:
520
- if (name.charAt(0) === "t" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) {
521
- this[name] = undefined$1;
522
- }
523
- }
524
- }
525
- },
526
- stop: function stop() {
527
- this.done = true;
528
- var rootEntry = this.tryEntries[0];
529
- var rootRecord = rootEntry.completion;
530
- if (rootRecord.type === "throw") {
531
- throw rootRecord.arg;
532
- }
533
- return this.rval;
534
- },
535
- dispatchException: function dispatchException(exception) {
536
- if (this.done) {
537
- throw exception;
538
- }
539
- var context = this;
540
- function handle(loc, caught) {
541
- record.type = "throw";
542
- record.arg = exception;
543
- context.next = loc;
544
- if (caught) {
545
- // If the dispatched exception was caught by a catch block,
546
- // then let that catch block handle the exception normally.
547
- context.method = "next";
548
- context.arg = undefined$1;
549
- }
550
- return !!caught;
551
- }
552
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
553
- var entry = this.tryEntries[i];
554
- var record = entry.completion;
555
- if (entry.tryLoc === "root") {
556
- // Exception thrown outside of any try block that could handle
557
- // it, so set the completion value of the entire function to
558
- // throw the exception.
559
- return handle("end");
560
- }
561
- if (entry.tryLoc <= this.prev) {
562
- var hasCatch = hasOwn.call(entry, "catchLoc");
563
- var hasFinally = hasOwn.call(entry, "finallyLoc");
564
- if (hasCatch && hasFinally) {
565
- if (this.prev < entry.catchLoc) {
566
- return handle(entry.catchLoc, true);
567
- } else if (this.prev < entry.finallyLoc) {
568
- return handle(entry.finallyLoc);
569
- }
570
- } else if (hasCatch) {
571
- if (this.prev < entry.catchLoc) {
572
- return handle(entry.catchLoc, true);
573
- }
574
- } else if (hasFinally) {
575
- if (this.prev < entry.finallyLoc) {
576
- return handle(entry.finallyLoc);
577
- }
578
- } else {
579
- throw new Error("try statement without catch or finally");
580
- }
244
+ for (var o = this.tryEntries.length - 1; o >= 0; --o) {
245
+ var i = this.tryEntries[o],
246
+ a = i.completion;
247
+ if ("root" === i.tryLoc) return handle("end");
248
+ if (i.tryLoc <= this.prev) {
249
+ var c = n.call(i, "catchLoc"),
250
+ u = n.call(i, "finallyLoc");
251
+ if (c && u) {
252
+ if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
253
+ if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
254
+ } else if (c) {
255
+ if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
256
+ } else {
257
+ if (!u) throw new Error("try statement without catch or finally");
258
+ if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
581
259
  }
582
260
  }
583
- },
584
- abrupt: function abrupt(type, arg) {
585
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
586
- var entry = this.tryEntries[i];
587
- if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
588
- var finallyEntry = entry;
589
- break;
590
- }
591
- }
592
- if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) {
593
- // Ignore the finally entry if control is not jumping to a
594
- // location outside the try/catch block.
595
- finallyEntry = null;
596
- }
597
- var record = finallyEntry ? finallyEntry.completion : {};
598
- record.type = type;
599
- record.arg = arg;
600
- if (finallyEntry) {
601
- this.method = "next";
602
- this.next = finallyEntry.finallyLoc;
603
- return ContinueSentinel;
604
- }
605
- return this.complete(record);
606
- },
607
- complete: function complete(record, afterLoc) {
608
- if (record.type === "throw") {
609
- throw record.arg;
610
- }
611
- if (record.type === "break" || record.type === "continue") {
612
- this.next = record.arg;
613
- } else if (record.type === "return") {
614
- this.rval = this.arg = record.arg;
615
- this.method = "return";
616
- this.next = "end";
617
- } else if (record.type === "normal" && afterLoc) {
618
- this.next = afterLoc;
619
- }
620
- return ContinueSentinel;
621
- },
622
- finish: function finish(finallyLoc) {
623
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
624
- var entry = this.tryEntries[i];
625
- if (entry.finallyLoc === finallyLoc) {
626
- this.complete(entry.completion, entry.afterLoc);
627
- resetTryEntry(entry);
628
- return ContinueSentinel;
629
- }
261
+ }
262
+ },
263
+ abrupt: function (t, e) {
264
+ for (var r = this.tryEntries.length - 1; r >= 0; --r) {
265
+ var o = this.tryEntries[r];
266
+ if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
267
+ var i = o;
268
+ break;
630
269
  }
631
- },
632
- "catch": function _catch(tryLoc) {
633
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
634
- var entry = this.tryEntries[i];
635
- if (entry.tryLoc === tryLoc) {
636
- var record = entry.completion;
637
- if (record.type === "throw") {
638
- var thrown = record.arg;
639
- resetTryEntry(entry);
640
- }
641
- return thrown;
270
+ }
271
+ i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
272
+ var a = i ? i.completion : {};
273
+ return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
274
+ },
275
+ complete: function (t, e) {
276
+ if ("throw" === t.type) throw t.arg;
277
+ return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
278
+ },
279
+ finish: function (t) {
280
+ for (var e = this.tryEntries.length - 1; e >= 0; --e) {
281
+ var r = this.tryEntries[e];
282
+ if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
283
+ }
284
+ },
285
+ catch: function (t) {
286
+ for (var e = this.tryEntries.length - 1; e >= 0; --e) {
287
+ var r = this.tryEntries[e];
288
+ if (r.tryLoc === t) {
289
+ var n = r.completion;
290
+ if ("throw" === n.type) {
291
+ var o = n.arg;
292
+ resetTryEntry(r);
642
293
  }
294
+ return o;
643
295
  }
644
-
645
- // The context.catch method must only be called with a location
646
- // argument that corresponds to a known catch block.
647
- throw new Error("illegal catch attempt");
648
- },
649
- delegateYield: function delegateYield(iterable, resultName, nextLoc) {
650
- this.delegate = {
651
- iterator: values(iterable),
652
- resultName: resultName,
653
- nextLoc: nextLoc
654
- };
655
- if (this.method === "next") {
656
- // Deliberately forget the last sent value so that we don't
657
- // accidentally pass it on to the delegate.
658
- this.arg = undefined$1;
659
- }
660
- return ContinueSentinel;
661
296
  }
662
- };
663
-
664
- // Regardless of whether this script is executing as a CommonJS module
665
- // or not, return the runtime object so that we can declare the variable
666
- // regeneratorRuntime in the outer scope, which allows this module to be
667
- // injected easily by `bin/regenerator --include-runtime script.js`.
668
- return exports;
669
- }(
670
- // If this script is executing as a CommonJS module, use module.exports
671
- // as the regeneratorRuntime namespace. Otherwise create a new empty
672
- // object. Either way, the resulting object will be used to initialize
673
- // the regeneratorRuntime variable at the top of this file.
674
- module.exports );
675
- try {
676
- regeneratorRuntime = runtime;
677
- } catch (accidentalStrictMode) {
678
- // This module should not be running in strict mode, so the above
679
- // assignment should always work unless something is misconfigured. Just
680
- // in case runtime.js accidentally runs in strict mode, in modern engines
681
- // we can explicitly access globalThis. In older engines we can escape
682
- // strict mode using a global Function call. This could conceivably fail
683
- // if a Content Security Policy forbids using Function, but in that case
684
- // the proper solution is to fix the accidental strict mode problem. If
685
- // you've misconfigured your bundler to force strict mode and applied a
686
- // CSP to forbid Function, and you're not willing to fix either of those
687
- // problems, please detail your unique predicament in a GitHub issue.
688
- if (typeof globalThis === "object") {
689
- globalThis.regeneratorRuntime = runtime;
690
- } else {
691
- Function("r", "regeneratorRuntime = r")(runtime);
297
+ throw new Error("illegal catch attempt");
298
+ },
299
+ delegateYield: function (e, r, n) {
300
+ return this.delegate = {
301
+ iterator: values(e),
302
+ resultName: r,
303
+ nextLoc: n
304
+ }, "next" === this.method && (this.arg = t), y;
692
305
  }
306
+ }, e;
307
+ }
308
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
309
+ try {
310
+ var info = gen[key](arg);
311
+ var value = info.value;
312
+ } catch (error) {
313
+ reject(error);
314
+ return;
693
315
  }
694
- });
316
+ if (info.done) {
317
+ resolve(value);
318
+ } else {
319
+ Promise.resolve(value).then(_next, _throw);
320
+ }
321
+ }
322
+ function _asyncToGenerator(fn) {
323
+ return function () {
324
+ var self = this,
325
+ args = arguments;
326
+ return new Promise(function (resolve, reject) {
327
+ var gen = fn.apply(self, args);
328
+ function _next(value) {
329
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
330
+ }
331
+ function _throw(err) {
332
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
333
+ }
334
+ _next(undefined);
335
+ });
336
+ };
337
+ }
695
338
 
696
339
  function ensure(x) {
697
340
  if (x === null || x === undefined) {
@@ -749,7 +392,7 @@ var YotpoReviewsMeta = {
749
392
  type: "choice",
750
393
  options: function options(props, ctx) {
751
394
  var _ctx$reviews$map, _ctx$reviews;
752
- return (_ctx$reviews$map = ctx == null ? void 0 : (_ctx$reviews = ctx.reviews) == null ? void 0 : _ctx$reviews.map(function (item) {
395
+ return (_ctx$reviews$map = ctx == null || (_ctx$reviews = ctx.reviews) == null ? void 0 : _ctx$reviews.map(function (item) {
753
396
  return {
754
397
  label: item == null ? void 0 : item.name,
755
398
  value: item == null ? void 0 : item.id
@@ -792,60 +435,56 @@ function YotpoReviews(_ref2) {
792
435
  document.body.removeChild(script);
793
436
  };
794
437
  }, [creds]);
795
- var _usePlasmicQueryData = usePlasmicQueryData(cacheKey + "/reviews", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
438
+ var _usePlasmicQueryData = usePlasmicQueryData(cacheKey + "/reviews", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
796
439
  var options, res;
797
- return runtime_1.wrap(function _callee$(_context) {
798
- while (1) {
799
- switch (_context.prev = _context.next) {
800
- case 0:
801
- options = {
802
- method: "GET",
803
- headers: {
804
- accept: "application/json",
805
- "Content-Type": "application/json"
806
- }
807
- };
808
- _context.next = 3;
809
- return fetch("https://api.yotpo.com/v1/apps/" + creds.appKey + "/reviews?utoken=" + creds.uToken, options);
810
- case 3:
811
- res = _context.sent;
812
- return _context.abrupt("return", res.json());
813
- case 5:
814
- case "end":
815
- return _context.stop();
816
- }
440
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
441
+ while (1) switch (_context.prev = _context.next) {
442
+ case 0:
443
+ options = {
444
+ method: "GET",
445
+ headers: {
446
+ accept: "application/json",
447
+ "Content-Type": "application/json"
448
+ }
449
+ };
450
+ _context.next = 3;
451
+ return fetch("https://api.yotpo.com/v1/apps/" + creds.appKey + "/reviews?utoken=" + creds.uToken, options);
452
+ case 3:
453
+ res = _context.sent;
454
+ return _context.abrupt("return", res.json());
455
+ case 5:
456
+ case "end":
457
+ return _context.stop();
817
458
  }
818
459
  }, _callee);
819
460
  }))),
820
461
  reviewsData = _usePlasmicQueryData.data;
821
- var _usePlasmicQueryData2 = usePlasmicQueryData(cacheKey + "/review", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2() {
462
+ var _usePlasmicQueryData2 = usePlasmicQueryData(cacheKey + "/review", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
822
463
  var options, res;
823
- return runtime_1.wrap(function _callee2$(_context2) {
824
- while (1) {
825
- switch (_context2.prev = _context2.next) {
826
- case 0:
827
- if (reviewId) {
828
- _context2.next = 2;
829
- break;
464
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
465
+ while (1) switch (_context2.prev = _context2.next) {
466
+ case 0:
467
+ if (reviewId) {
468
+ _context2.next = 2;
469
+ break;
470
+ }
471
+ return _context2.abrupt("return", undefined);
472
+ case 2:
473
+ options = {
474
+ method: "GET",
475
+ headers: {
476
+ accept: "application/json",
477
+ "Content-Type": "application/json"
830
478
  }
831
- return _context2.abrupt("return", undefined);
832
- case 2:
833
- options = {
834
- method: "GET",
835
- headers: {
836
- accept: "application/json",
837
- "Content-Type": "application/json"
838
- }
839
- };
840
- _context2.next = 5;
841
- return fetch("https://api.yotpo.com/reviews/" + reviewId + "?utoken=" + creds.uToken, options);
842
- case 5:
843
- res = _context2.sent;
844
- return _context2.abrupt("return", res.json());
845
- case 7:
846
- case "end":
847
- return _context2.stop();
848
- }
479
+ };
480
+ _context2.next = 5;
481
+ return fetch("https://api.yotpo.com/reviews/" + reviewId + "?utoken=" + creds.uToken, options);
482
+ case 5:
483
+ res = _context2.sent;
484
+ return _context2.abrupt("return", res.json());
485
+ case 7:
486
+ case "end":
487
+ return _context2.stop();
849
488
  }
850
489
  }, _callee2);
851
490
  }))),
@@ -856,7 +495,7 @@ function YotpoReviews(_ref2) {
856
495
  var data = Object.values(reviewsData).map(function (item) {
857
496
  return item;
858
497
  });
859
- setControlContextData == null ? void 0 : setControlContextData({
498
+ setControlContextData == null || setControlContextData({
860
499
  reviews: data[0] || []
861
500
  });
862
501
  if (!creds.uToken || !creds.appKey) {
@@ -905,7 +544,7 @@ var YotpoStarRatingMeta = {
905
544
  type: "choice",
906
545
  options: function options(props, ctx) {
907
546
  var _ctx$reviews$map2, _ctx$reviews2;
908
- return (_ctx$reviews$map2 = ctx == null ? void 0 : (_ctx$reviews2 = ctx.reviews) == null ? void 0 : _ctx$reviews2.map(function (item) {
547
+ return (_ctx$reviews$map2 = ctx == null || (_ctx$reviews2 = ctx.reviews) == null ? void 0 : _ctx$reviews2.map(function (item) {
909
548
  return {
910
549
  label: item == null ? void 0 : item.name,
911
550
  value: item == null ? void 0 : item.id
@@ -936,60 +575,56 @@ function YotpoStarRating(_ref5) {
936
575
  document.body.removeChild(script);
937
576
  };
938
577
  }, [creds]);
939
- var _usePlasmicQueryData3 = usePlasmicQueryData(cacheKey + "/starReviews", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3() {
578
+ var _usePlasmicQueryData3 = usePlasmicQueryData(cacheKey + "/starReviews", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
940
579
  var options, res;
941
- return runtime_1.wrap(function _callee3$(_context3) {
942
- while (1) {
943
- switch (_context3.prev = _context3.next) {
944
- case 0:
945
- options = {
946
- method: "GET",
947
- headers: {
948
- accept: "application/json",
949
- "Content-Type": "application/json"
950
- }
951
- };
952
- _context3.next = 3;
953
- return fetch("https://api.yotpo.com/v1/apps/" + creds.appKey + "/reviews?utoken=" + creds.uToken, options);
954
- case 3:
955
- res = _context3.sent;
956
- return _context3.abrupt("return", res.json());
957
- case 5:
958
- case "end":
959
- return _context3.stop();
960
- }
580
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
581
+ while (1) switch (_context3.prev = _context3.next) {
582
+ case 0:
583
+ options = {
584
+ method: "GET",
585
+ headers: {
586
+ accept: "application/json",
587
+ "Content-Type": "application/json"
588
+ }
589
+ };
590
+ _context3.next = 3;
591
+ return fetch("https://api.yotpo.com/v1/apps/" + creds.appKey + "/reviews?utoken=" + creds.uToken, options);
592
+ case 3:
593
+ res = _context3.sent;
594
+ return _context3.abrupt("return", res.json());
595
+ case 5:
596
+ case "end":
597
+ return _context3.stop();
961
598
  }
962
599
  }, _callee3);
963
600
  }))),
964
601
  reviews = _usePlasmicQueryData3.data;
965
- var _usePlasmicQueryData4 = usePlasmicQueryData(cacheKey + "/starReview", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4() {
602
+ var _usePlasmicQueryData4 = usePlasmicQueryData(cacheKey + "/starReview", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
966
603
  var options, res;
967
- return runtime_1.wrap(function _callee4$(_context4) {
968
- while (1) {
969
- switch (_context4.prev = _context4.next) {
970
- case 0:
971
- if (productId) {
972
- _context4.next = 2;
973
- break;
604
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
605
+ while (1) switch (_context4.prev = _context4.next) {
606
+ case 0:
607
+ if (productId) {
608
+ _context4.next = 2;
609
+ break;
610
+ }
611
+ return _context4.abrupt("return", undefined);
612
+ case 2:
613
+ options = {
614
+ method: "GET",
615
+ headers: {
616
+ accept: "application/json",
617
+ "Content-Type": "application/json"
974
618
  }
975
- return _context4.abrupt("return", undefined);
976
- case 2:
977
- options = {
978
- method: "GET",
979
- headers: {
980
- accept: "application/json",
981
- "Content-Type": "application/json"
982
- }
983
- };
984
- _context4.next = 5;
985
- return fetch("https://api.yotpo.com/reviews/" + productId + "?utoken=" + creds.uToken, options);
986
- case 5:
987
- res = _context4.sent;
988
- return _context4.abrupt("return", res.json());
989
- case 7:
990
- case "end":
991
- return _context4.stop();
992
- }
619
+ };
620
+ _context4.next = 5;
621
+ return fetch("https://api.yotpo.com/reviews/" + productId + "?utoken=" + creds.uToken, options);
622
+ case 5:
623
+ res = _context4.sent;
624
+ return _context4.abrupt("return", res.json());
625
+ case 7:
626
+ case "end":
627
+ return _context4.stop();
993
628
  }
994
629
  }, _callee4);
995
630
  }))),
@@ -1003,7 +638,7 @@ function YotpoStarRating(_ref5) {
1003
638
  var data = Object.values(reviews).map(function (item) {
1004
639
  return item;
1005
640
  });
1006
- setControlContextData == null ? void 0 : setControlContextData({
641
+ setControlContextData == null || setControlContextData({
1007
642
  reviews: data[0] || []
1008
643
  });
1009
644
  if (!review) {