@plasmicpkgs/plasmic-yotpo 0.0.87 → 0.0.89
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/plasmic-yotpo.cjs.development.js +130 -335
- package/dist/plasmic-yotpo.cjs.development.js.map +1 -1
- package/dist/plasmic-yotpo.cjs.production.min.js +1 -1
- package/dist/plasmic-yotpo.cjs.production.min.js.map +1 -1
- package/dist/plasmic-yotpo.esm.js +130 -335
- package/dist/plasmic-yotpo.esm.js.map +1 -1
- package/package.json +3 -3
|
@@ -36,306 +36,113 @@ function _asyncToGenerator(n) {
|
|
|
36
36
|
});
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
|
-
function
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
return o(a, "_invoke", {
|
|
74
|
-
value: makeInvokeMethod(t, r, c)
|
|
75
|
-
}), a;
|
|
76
|
-
}
|
|
77
|
-
function tryCatch(t, e, r) {
|
|
78
|
-
try {
|
|
79
|
-
return {
|
|
80
|
-
type: "normal",
|
|
81
|
-
arg: t.call(e, r)
|
|
82
|
-
};
|
|
83
|
-
} catch (t) {
|
|
84
|
-
return {
|
|
85
|
-
type: "throw",
|
|
86
|
-
arg: t
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
e.wrap = wrap;
|
|
91
|
-
var h = "suspendedStart",
|
|
92
|
-
l = "suspendedYield",
|
|
93
|
-
f = "executing",
|
|
94
|
-
s = "completed",
|
|
95
|
-
y = {};
|
|
96
|
-
function Generator() {}
|
|
97
|
-
function GeneratorFunction() {}
|
|
98
|
-
function GeneratorFunctionPrototype() {}
|
|
99
|
-
var p = {};
|
|
100
|
-
define(p, a, function () {
|
|
101
|
-
return this;
|
|
102
|
-
});
|
|
103
|
-
var d = Object.getPrototypeOf,
|
|
104
|
-
v = d && d(d(values([])));
|
|
105
|
-
v && v !== r && n.call(v, a) && (p = v);
|
|
106
|
-
var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
|
|
107
|
-
function defineIteratorMethods(t) {
|
|
108
|
-
["next", "throw", "return"].forEach(function (e) {
|
|
109
|
-
define(t, e, function (t) {
|
|
110
|
-
return this._invoke(e, t);
|
|
111
|
-
});
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
function AsyncIterator(t, e) {
|
|
115
|
-
function invoke(r, o, i, a) {
|
|
116
|
-
var c = tryCatch(t[r], t, o);
|
|
117
|
-
if ("throw" !== c.type) {
|
|
118
|
-
var u = c.arg,
|
|
119
|
-
h = u.value;
|
|
120
|
-
return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
|
|
121
|
-
invoke("next", t, i, a);
|
|
122
|
-
}, function (t) {
|
|
123
|
-
invoke("throw", t, i, a);
|
|
124
|
-
}) : e.resolve(h).then(function (t) {
|
|
125
|
-
u.value = t, i(u);
|
|
126
|
-
}, function (t) {
|
|
127
|
-
return invoke("throw", t, i, a);
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
a(c.arg);
|
|
131
|
-
}
|
|
132
|
-
var r;
|
|
133
|
-
o(this, "_invoke", {
|
|
134
|
-
value: function (t, n) {
|
|
135
|
-
function callInvokeWithMethodAndArg() {
|
|
136
|
-
return new e(function (e, r) {
|
|
137
|
-
invoke(t, n, e, r);
|
|
138
|
-
});
|
|
39
|
+
function _regenerator() {
|
|
40
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
41
|
+
var e,
|
|
42
|
+
t,
|
|
43
|
+
r = "function" == typeof Symbol ? Symbol : {},
|
|
44
|
+
n = r.iterator || "@@iterator",
|
|
45
|
+
o = r.toStringTag || "@@toStringTag";
|
|
46
|
+
function i(r, n, o, i) {
|
|
47
|
+
var c = n && n.prototype instanceof Generator ? n : Generator,
|
|
48
|
+
u = Object.create(c.prototype);
|
|
49
|
+
return _regeneratorDefine(u, "_invoke", function (r, n, o) {
|
|
50
|
+
var i,
|
|
51
|
+
c,
|
|
52
|
+
u,
|
|
53
|
+
f = 0,
|
|
54
|
+
p = o || [],
|
|
55
|
+
y = !1,
|
|
56
|
+
G = {
|
|
57
|
+
p: 0,
|
|
58
|
+
n: 0,
|
|
59
|
+
v: e,
|
|
60
|
+
a: d,
|
|
61
|
+
f: d.bind(e, 4),
|
|
62
|
+
d: function (t, r) {
|
|
63
|
+
return i = t, c = 0, u = e, G.n = r, a;
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
function d(r, n) {
|
|
67
|
+
for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) {
|
|
68
|
+
var o,
|
|
69
|
+
i = p[t],
|
|
70
|
+
d = G.p,
|
|
71
|
+
l = i[2];
|
|
72
|
+
r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0));
|
|
139
73
|
}
|
|
140
|
-
|
|
74
|
+
if (o || r > 1) return a;
|
|
75
|
+
throw y = !0, n;
|
|
141
76
|
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
77
|
+
return function (o, p, l) {
|
|
78
|
+
if (f > 1) throw TypeError("Generator is already running");
|
|
79
|
+
for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) {
|
|
80
|
+
i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u);
|
|
81
|
+
try {
|
|
82
|
+
if (f = 2, i) {
|
|
83
|
+
if (c || (o = "next"), t = i[o]) {
|
|
84
|
+
if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object");
|
|
85
|
+
if (!t.done) return t;
|
|
86
|
+
u = t.value, c < 2 && (c = 0);
|
|
87
|
+
} else 1 === c && (t = i.return) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1);
|
|
88
|
+
i = e;
|
|
89
|
+
} else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break;
|
|
90
|
+
} catch (t) {
|
|
91
|
+
i = e, c = 1, u = t;
|
|
92
|
+
} finally {
|
|
93
|
+
f = 1;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
150
96
|
return {
|
|
151
97
|
value: t,
|
|
152
|
-
done:
|
|
98
|
+
done: y
|
|
153
99
|
};
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
var c = n.delegate;
|
|
157
|
-
if (c) {
|
|
158
|
-
var u = maybeInvokeDelegate(c, n);
|
|
159
|
-
if (u) {
|
|
160
|
-
if (u === y) continue;
|
|
161
|
-
return u;
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
|
|
165
|
-
if (o === h) throw o = s, n.arg;
|
|
166
|
-
n.dispatchException(n.arg);
|
|
167
|
-
} else "return" === n.method && n.abrupt("return", n.arg);
|
|
168
|
-
o = f;
|
|
169
|
-
var p = tryCatch(e, r, n);
|
|
170
|
-
if ("normal" === p.type) {
|
|
171
|
-
if (o = n.done ? s : l, p.arg === y) continue;
|
|
172
|
-
return {
|
|
173
|
-
value: p.arg,
|
|
174
|
-
done: n.done
|
|
175
|
-
};
|
|
176
|
-
}
|
|
177
|
-
"throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
|
|
178
|
-
}
|
|
179
|
-
};
|
|
180
|
-
}
|
|
181
|
-
function maybeInvokeDelegate(e, r) {
|
|
182
|
-
var n = r.method,
|
|
183
|
-
o = e.iterator[n];
|
|
184
|
-
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;
|
|
185
|
-
var i = tryCatch(o, e.iterator, r.arg);
|
|
186
|
-
if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
|
|
187
|
-
var a = i.arg;
|
|
188
|
-
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);
|
|
189
|
-
}
|
|
190
|
-
function pushTryEntry(t) {
|
|
191
|
-
var e = {
|
|
192
|
-
tryLoc: t[0]
|
|
193
|
-
};
|
|
194
|
-
1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
|
|
195
|
-
}
|
|
196
|
-
function resetTryEntry(t) {
|
|
197
|
-
var e = t.completion || {};
|
|
198
|
-
e.type = "normal", delete e.arg, t.completion = e;
|
|
199
|
-
}
|
|
200
|
-
function Context(t) {
|
|
201
|
-
this.tryEntries = [{
|
|
202
|
-
tryLoc: "root"
|
|
203
|
-
}], t.forEach(pushTryEntry, this), this.reset(!0);
|
|
100
|
+
};
|
|
101
|
+
}(r, o, i), !0), u;
|
|
204
102
|
}
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
return i.next = i;
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
throw new TypeError(typeof e + " is not iterable");
|
|
103
|
+
var a = {};
|
|
104
|
+
function Generator() {}
|
|
105
|
+
function GeneratorFunction() {}
|
|
106
|
+
function GeneratorFunctionPrototype() {}
|
|
107
|
+
t = Object.getPrototypeOf;
|
|
108
|
+
var c = [][n] ? t(t([][n]())) : (_regeneratorDefine(t = {}, n, function () {
|
|
109
|
+
return this;
|
|
110
|
+
}), t),
|
|
111
|
+
u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c);
|
|
112
|
+
function f(e) {
|
|
113
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e;
|
|
220
114
|
}
|
|
221
|
-
return GeneratorFunction.prototype = GeneratorFunctionPrototype,
|
|
222
|
-
value: GeneratorFunctionPrototype,
|
|
223
|
-
configurable: !0
|
|
224
|
-
}), o(GeneratorFunctionPrototype, "constructor", {
|
|
225
|
-
value: GeneratorFunction,
|
|
226
|
-
configurable: !0
|
|
227
|
-
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
|
|
228
|
-
var e = "function" == typeof t && t.constructor;
|
|
229
|
-
return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
|
|
230
|
-
}, e.mark = function (t) {
|
|
231
|
-
return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
|
|
232
|
-
}, e.awrap = function (t) {
|
|
233
|
-
return {
|
|
234
|
-
__await: t
|
|
235
|
-
};
|
|
236
|
-
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
|
|
115
|
+
return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine(u), _regeneratorDefine(u, o, "Generator"), _regeneratorDefine(u, n, function () {
|
|
237
116
|
return this;
|
|
238
|
-
}),
|
|
239
|
-
void 0 === i && (i = Promise);
|
|
240
|
-
var a = new AsyncIterator(wrap(t, r, n, o), i);
|
|
241
|
-
return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
|
|
242
|
-
return t.done ? t.value : a.next();
|
|
243
|
-
});
|
|
244
|
-
}, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
|
|
245
|
-
return this;
|
|
246
|
-
}), define(g, "toString", function () {
|
|
117
|
+
}), _regeneratorDefine(u, "toString", function () {
|
|
247
118
|
return "[object Generator]";
|
|
248
|
-
}),
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
return r.reverse(), function next() {
|
|
253
|
-
for (; r.length;) {
|
|
254
|
-
var t = r.pop();
|
|
255
|
-
if (t in e) return next.value = t, next.done = !1, next;
|
|
256
|
-
}
|
|
257
|
-
return next.done = !0, next;
|
|
119
|
+
}), (_regenerator = function () {
|
|
120
|
+
return {
|
|
121
|
+
w: i,
|
|
122
|
+
m: f
|
|
258
123
|
};
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
function handle(n, o) {
|
|
274
|
-
return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
|
|
275
|
-
}
|
|
276
|
-
for (var o = this.tryEntries.length - 1; o >= 0; --o) {
|
|
277
|
-
var i = this.tryEntries[o],
|
|
278
|
-
a = i.completion;
|
|
279
|
-
if ("root" === i.tryLoc) return handle("end");
|
|
280
|
-
if (i.tryLoc <= this.prev) {
|
|
281
|
-
var c = n.call(i, "catchLoc"),
|
|
282
|
-
u = n.call(i, "finallyLoc");
|
|
283
|
-
if (c && u) {
|
|
284
|
-
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
285
|
-
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
286
|
-
} else if (c) {
|
|
287
|
-
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
288
|
-
} else {
|
|
289
|
-
if (!u) throw Error("try statement without catch or finally");
|
|
290
|
-
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
},
|
|
295
|
-
abrupt: function (t, e) {
|
|
296
|
-
for (var r = this.tryEntries.length - 1; r >= 0; --r) {
|
|
297
|
-
var o = this.tryEntries[r];
|
|
298
|
-
if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
|
|
299
|
-
var i = o;
|
|
300
|
-
break;
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
|
|
304
|
-
var a = i ? i.completion : {};
|
|
305
|
-
return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
|
|
306
|
-
},
|
|
307
|
-
complete: function (t, e) {
|
|
308
|
-
if ("throw" === t.type) throw t.arg;
|
|
309
|
-
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;
|
|
310
|
-
},
|
|
311
|
-
finish: function (t) {
|
|
312
|
-
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
313
|
-
var r = this.tryEntries[e];
|
|
314
|
-
if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
|
|
315
|
-
}
|
|
316
|
-
},
|
|
317
|
-
catch: function (t) {
|
|
318
|
-
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
319
|
-
var r = this.tryEntries[e];
|
|
320
|
-
if (r.tryLoc === t) {
|
|
321
|
-
var n = r.completion;
|
|
322
|
-
if ("throw" === n.type) {
|
|
323
|
-
var o = n.arg;
|
|
324
|
-
resetTryEntry(r);
|
|
325
|
-
}
|
|
326
|
-
return o;
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
throw Error("illegal catch attempt");
|
|
330
|
-
},
|
|
331
|
-
delegateYield: function (e, r, n) {
|
|
332
|
-
return this.delegate = {
|
|
333
|
-
iterator: values(e),
|
|
334
|
-
resultName: r,
|
|
335
|
-
nextLoc: n
|
|
336
|
-
}, "next" === this.method && (this.arg = t), y;
|
|
124
|
+
})();
|
|
125
|
+
}
|
|
126
|
+
function _regeneratorDefine(e, r, n, t) {
|
|
127
|
+
var i = Object.defineProperty;
|
|
128
|
+
try {
|
|
129
|
+
i({}, "", {});
|
|
130
|
+
} catch (e) {
|
|
131
|
+
i = 0;
|
|
132
|
+
}
|
|
133
|
+
_regeneratorDefine = function (e, r, n, t) {
|
|
134
|
+
function o(r, n) {
|
|
135
|
+
_regeneratorDefine(e, r, function (e) {
|
|
136
|
+
return this._invoke(r, n, e);
|
|
137
|
+
});
|
|
337
138
|
}
|
|
338
|
-
|
|
139
|
+
r ? i ? i(e, r, {
|
|
140
|
+
value: n,
|
|
141
|
+
enumerable: !t,
|
|
142
|
+
configurable: !t,
|
|
143
|
+
writable: !t
|
|
144
|
+
}) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2));
|
|
145
|
+
}, _regeneratorDefine(e, r, n, t);
|
|
339
146
|
}
|
|
340
147
|
|
|
341
148
|
function ensure(x) {
|
|
@@ -437,10 +244,10 @@ function YotpoReviews(_ref2) {
|
|
|
437
244
|
document.body.removeChild(script);
|
|
438
245
|
};
|
|
439
246
|
}, [creds]);
|
|
440
|
-
var _usePlasmicQueryData = query.usePlasmicQueryData(cacheKey + "/reviews", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/
|
|
247
|
+
var _usePlasmicQueryData = query.usePlasmicQueryData(cacheKey + "/reviews", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
|
|
441
248
|
var options, res;
|
|
442
|
-
return
|
|
443
|
-
while (1) switch (_context.
|
|
249
|
+
return _regenerator().w(function (_context) {
|
|
250
|
+
while (1) switch (_context.n) {
|
|
444
251
|
case 0:
|
|
445
252
|
options = {
|
|
446
253
|
method: "GET",
|
|
@@ -449,29 +256,26 @@ function YotpoReviews(_ref2) {
|
|
|
449
256
|
"Content-Type": "application/json"
|
|
450
257
|
}
|
|
451
258
|
};
|
|
452
|
-
_context.
|
|
259
|
+
_context.n = 1;
|
|
453
260
|
return fetch("https://api.yotpo.com/v1/apps/" + creds.appKey + "/reviews?utoken=" + creds.uToken, options);
|
|
454
|
-
case
|
|
455
|
-
res = _context.
|
|
456
|
-
return _context.
|
|
457
|
-
case 5:
|
|
458
|
-
case "end":
|
|
459
|
-
return _context.stop();
|
|
261
|
+
case 1:
|
|
262
|
+
res = _context.v;
|
|
263
|
+
return _context.a(2, res.json());
|
|
460
264
|
}
|
|
461
265
|
}, _callee);
|
|
462
266
|
}))),
|
|
463
267
|
reviewsData = _usePlasmicQueryData.data;
|
|
464
|
-
var _usePlasmicQueryData2 = query.usePlasmicQueryData(cacheKey + "/review", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/
|
|
268
|
+
var _usePlasmicQueryData2 = query.usePlasmicQueryData(cacheKey + "/review", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
|
|
465
269
|
var options, res;
|
|
466
|
-
return
|
|
467
|
-
while (1) switch (_context2.
|
|
270
|
+
return _regenerator().w(function (_context2) {
|
|
271
|
+
while (1) switch (_context2.n) {
|
|
468
272
|
case 0:
|
|
469
273
|
if (reviewId) {
|
|
470
|
-
_context2.
|
|
274
|
+
_context2.n = 1;
|
|
471
275
|
break;
|
|
472
276
|
}
|
|
473
|
-
return _context2.
|
|
474
|
-
case
|
|
277
|
+
return _context2.a(2, undefined);
|
|
278
|
+
case 1:
|
|
475
279
|
options = {
|
|
476
280
|
method: "GET",
|
|
477
281
|
headers: {
|
|
@@ -479,14 +283,11 @@ function YotpoReviews(_ref2) {
|
|
|
479
283
|
"Content-Type": "application/json"
|
|
480
284
|
}
|
|
481
285
|
};
|
|
482
|
-
_context2.
|
|
286
|
+
_context2.n = 2;
|
|
483
287
|
return fetch("https://api.yotpo.com/reviews/" + reviewId + "?utoken=" + creds.uToken, options);
|
|
484
|
-
case
|
|
485
|
-
res = _context2.
|
|
486
|
-
return _context2.
|
|
487
|
-
case 7:
|
|
488
|
-
case "end":
|
|
489
|
-
return _context2.stop();
|
|
288
|
+
case 2:
|
|
289
|
+
res = _context2.v;
|
|
290
|
+
return _context2.a(2, res.json());
|
|
490
291
|
}
|
|
491
292
|
}, _callee2);
|
|
492
293
|
}))),
|
|
@@ -577,10 +378,10 @@ function YotpoStarRating(_ref5) {
|
|
|
577
378
|
document.body.removeChild(script);
|
|
578
379
|
};
|
|
579
380
|
}, [creds]);
|
|
580
|
-
var _usePlasmicQueryData3 = query.usePlasmicQueryData(cacheKey + "/starReviews", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/
|
|
381
|
+
var _usePlasmicQueryData3 = query.usePlasmicQueryData(cacheKey + "/starReviews", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3() {
|
|
581
382
|
var options, res;
|
|
582
|
-
return
|
|
583
|
-
while (1) switch (_context3.
|
|
383
|
+
return _regenerator().w(function (_context3) {
|
|
384
|
+
while (1) switch (_context3.n) {
|
|
584
385
|
case 0:
|
|
585
386
|
options = {
|
|
586
387
|
method: "GET",
|
|
@@ -589,29 +390,26 @@ function YotpoStarRating(_ref5) {
|
|
|
589
390
|
"Content-Type": "application/json"
|
|
590
391
|
}
|
|
591
392
|
};
|
|
592
|
-
_context3.
|
|
393
|
+
_context3.n = 1;
|
|
593
394
|
return fetch("https://api.yotpo.com/v1/apps/" + creds.appKey + "/reviews?utoken=" + creds.uToken, options);
|
|
594
|
-
case
|
|
595
|
-
res = _context3.
|
|
596
|
-
return _context3.
|
|
597
|
-
case 5:
|
|
598
|
-
case "end":
|
|
599
|
-
return _context3.stop();
|
|
395
|
+
case 1:
|
|
396
|
+
res = _context3.v;
|
|
397
|
+
return _context3.a(2, res.json());
|
|
600
398
|
}
|
|
601
399
|
}, _callee3);
|
|
602
400
|
}))),
|
|
603
401
|
reviews = _usePlasmicQueryData3.data;
|
|
604
|
-
var _usePlasmicQueryData4 = query.usePlasmicQueryData(cacheKey + "/starReview", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/
|
|
402
|
+
var _usePlasmicQueryData4 = query.usePlasmicQueryData(cacheKey + "/starReview", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4() {
|
|
605
403
|
var options, res;
|
|
606
|
-
return
|
|
607
|
-
while (1) switch (_context4.
|
|
404
|
+
return _regenerator().w(function (_context4) {
|
|
405
|
+
while (1) switch (_context4.n) {
|
|
608
406
|
case 0:
|
|
609
407
|
if (productId) {
|
|
610
|
-
_context4.
|
|
408
|
+
_context4.n = 1;
|
|
611
409
|
break;
|
|
612
410
|
}
|
|
613
|
-
return _context4.
|
|
614
|
-
case
|
|
411
|
+
return _context4.a(2, undefined);
|
|
412
|
+
case 1:
|
|
615
413
|
options = {
|
|
616
414
|
method: "GET",
|
|
617
415
|
headers: {
|
|
@@ -619,14 +417,11 @@ function YotpoStarRating(_ref5) {
|
|
|
619
417
|
"Content-Type": "application/json"
|
|
620
418
|
}
|
|
621
419
|
};
|
|
622
|
-
_context4.
|
|
420
|
+
_context4.n = 2;
|
|
623
421
|
return fetch("https://api.yotpo.com/reviews/" + productId + "?utoken=" + creds.uToken, options);
|
|
624
|
-
case
|
|
625
|
-
res = _context4.
|
|
626
|
-
return _context4.
|
|
627
|
-
case 7:
|
|
628
|
-
case "end":
|
|
629
|
-
return _context4.stop();
|
|
422
|
+
case 2:
|
|
423
|
+
res = _context4.v;
|
|
424
|
+
return _context4.a(2, res.json());
|
|
630
425
|
}
|
|
631
426
|
}, _callee4);
|
|
632
427
|
}))),
|