@plasmicpkgs/plasmic-wordpress-graphql 0.0.77 → 0.0.79

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