@builder.io/sdk-solid 0.6.4 → 0.7.1-0

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.
@@ -170,6 +170,19 @@ var getFunctionArguments = ({
170
170
  event
171
171
  });
172
172
  };
173
+ var getBuilderGlobals = () => ({
174
+ isEditing: isEditing(),
175
+ isBrowser: isBrowser(),
176
+ isServer: !isBrowser(),
177
+ getUserAttributes: () => getUserAttributes()
178
+ });
179
+ var parseCode = (code, {
180
+ isExpression = true
181
+ }) => {
182
+ const useReturn = isExpression && !(code.includes(";") || code.includes(" return ") || code.trim().startsWith("return "));
183
+ const useCode = useReturn ? `return (${code});` : code;
184
+ return useCode;
185
+ };
173
186
 
174
187
  // src/functions/evaluate/browser-runtime/browser.js
175
188
  var runInBrowser = ({
@@ -211,6 +224,155 @@ function flattenState(rootState, localState, rootSetState) {
211
224
  });
212
225
  }
213
226
 
227
+ // src/functions/evaluate/node-runtime/safeDynamicRequire.js
228
+ var noop = () => null;
229
+ var safeDynamicRequire = noop;
230
+ try {
231
+ safeDynamicRequire = eval("require");
232
+ } catch (error) {
233
+ }
234
+
235
+ // src/functions/set.js
236
+ var set = (obj, _path, value) => {
237
+ if (Object(obj) !== obj) {
238
+ return obj;
239
+ }
240
+ const path = Array.isArray(_path) ? _path : _path.toString().match(/[^.[\]]+/g);
241
+ path.slice(0, -1).reduce((a, c, i) => Object(a[c]) === a[c] ? a[c] : a[c] = Math.abs(Number(path[i + 1])) >> 0 === +path[i + 1] ? [] : {}, obj)[path[path.length - 1]] = value;
242
+ return obj;
243
+ };
244
+
245
+ // src/functions/evaluate/node-runtime/node-runtime.js
246
+ var __defProp = Object.defineProperty;
247
+ var __defProps = Object.defineProperties;
248
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
249
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
250
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
251
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
252
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {
253
+ enumerable: true,
254
+ configurable: true,
255
+ writable: true,
256
+ value
257
+ }) : obj[key] = value;
258
+ var __spreadValues = (a, b) => {
259
+ for (var prop in b || (b = {}))
260
+ if (__hasOwnProp.call(b, prop))
261
+ __defNormalProp(a, prop, b[prop]);
262
+ if (__getOwnPropSymbols)
263
+ for (var prop of __getOwnPropSymbols(b)) {
264
+ if (__propIsEnum.call(b, prop))
265
+ __defNormalProp(a, prop, b[prop]);
266
+ }
267
+ return a;
268
+ };
269
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
270
+ var ivm = safeDynamicRequire("isolated-vm");
271
+ var getSyncValName = (key) => `bldr_${key}_sync`;
272
+ var BUILDER_SET_STATE_NAME = "BUILDER_SET_STATE";
273
+ var INJECTED_IVM_GLOBAL = "BUILDER_IVM";
274
+ var REF_TO_PROXY_FN = `
275
+ var refToProxy = (obj) => {
276
+ if (typeof obj !== 'object' || obj === null) {
277
+ return obj;
278
+ }
279
+ return new Proxy({}, {
280
+ get(target, key) {
281
+ if (key === 'copySync') {
282
+ return () => obj.copySync();
283
+ }
284
+ const val = obj.getSync(key);
285
+ if (typeof val?.getSync === 'function') {
286
+ return refToProxy(val);
287
+ }
288
+ return val;
289
+ },
290
+ set(target, key, value) {
291
+ const v = typeof value === 'object' ? new ${INJECTED_IVM_GLOBAL}.Reference(value) : value;
292
+ obj.setSync(key, v);
293
+ ${BUILDER_SET_STATE_NAME}(key, value)
294
+ },
295
+ deleteProperty(target, key) {
296
+ obj.deleteSync(key);
297
+ }
298
+ })
299
+ }
300
+ `;
301
+ var processCode = ({
302
+ code,
303
+ args
304
+ }) => {
305
+ const fnArgs = args.map(([name]) => `var ${name} = refToProxy(${getSyncValName(name)}); `).join("");
306
+ return `
307
+ ${REF_TO_PROXY_FN}
308
+ ${fnArgs}
309
+ function theFunction() {
310
+ ${code}
311
+ }
312
+
313
+ let output = theFunction()
314
+
315
+ if (typeof output === 'object' && output !== null) {
316
+ output = JSON.stringify(output.copySync ? output.copySync() : output);
317
+ }
318
+
319
+ output;
320
+ `;
321
+ };
322
+ var getIsolateContext = () => {
323
+ const isolate = new ivm.Isolate({
324
+ memoryLimit: 128
325
+ });
326
+ return isolate.createContextSync();
327
+ };
328
+ var runInNode = ({
329
+ code,
330
+ builder,
331
+ context,
332
+ event,
333
+ localState,
334
+ rootSetState,
335
+ rootState
336
+ }) => {
337
+ const state = fastClone(__spreadValues(__spreadValues({}, rootState), localState));
338
+ const args = getFunctionArguments({
339
+ builder,
340
+ context,
341
+ event,
342
+ state
343
+ });
344
+ const isolateContext = getIsolateContext();
345
+ const jail = isolateContext.global;
346
+ jail.setSync("global", jail.derefInto());
347
+ jail.setSync("log", function(...logArgs) {
348
+ });
349
+ jail.setSync(BUILDER_SET_STATE_NAME, function(key, value) {
350
+ set(rootState, key, value);
351
+ rootSetState == null ? void 0 : rootSetState(rootState);
352
+ });
353
+ args.forEach(([key, arg]) => {
354
+ const val = typeof arg === "object" ? new ivm.Reference(key === "builder" ? __spreadProps(__spreadValues({}, arg), {
355
+ getUserAttributes: () => arg.getUserAttributes()
356
+ }) : arg) : null;
357
+ jail.setSync(getSyncValName(key), val);
358
+ });
359
+ jail.setSync(INJECTED_IVM_GLOBAL, ivm);
360
+ const evalStr = processCode({
361
+ code,
362
+ args
363
+ });
364
+ const resultStr = isolateContext.evalSync(evalStr);
365
+ try {
366
+ const res = JSON.parse(resultStr);
367
+ return res;
368
+ } catch (_error) {
369
+ return resultStr;
370
+ }
371
+ };
372
+
373
+ // src/functions/evaluate/choose-eval.js
374
+ var chooseBrowserOrServerEval = (args) => isBrowser() ? runInBrowser(args) : runInNode(args);
375
+
214
376
  // src/functions/evaluate/evaluate.js
215
377
  function evaluate({
216
378
  code,
@@ -225,17 +387,11 @@ function evaluate({
225
387
  logger.warn("Skipping evaluation of empty code block.");
226
388
  return;
227
389
  }
228
- const builder = {
229
- isEditing: isEditing(),
230
- isBrowser: isBrowser(),
231
- isServer: !isBrowser(),
232
- getUserAttributes: () => getUserAttributes()
233
- };
234
- const useReturn = isExpression && !(code.includes(";") || code.includes(" return ") || code.trim().startsWith("return "));
235
- const useCode = useReturn ? `return (${code});` : code;
236
390
  const args = {
237
- code: useCode,
238
- builder,
391
+ code: parseCode(code, {
392
+ isExpression
393
+ }),
394
+ builder: getBuilderGlobals(),
239
395
  context,
240
396
  event,
241
397
  rootSetState,
@@ -243,7 +399,7 @@ function evaluate({
243
399
  localState
244
400
  };
245
401
  try {
246
- return runInBrowser(args);
402
+ return chooseBrowserOrServerEval(args);
247
403
  } catch (e) {
248
404
  logger.error("Failed code evaluation: " + e.message, {
249
405
  code
@@ -252,46 +408,36 @@ function evaluate({
252
408
  }
253
409
  }
254
410
 
255
- // src/functions/set.js
256
- var set = (obj, _path, value) => {
257
- if (Object(obj) !== obj) {
258
- return obj;
259
- }
260
- const path = Array.isArray(_path) ? _path : _path.toString().match(/[^.[\]]+/g);
261
- path.slice(0, -1).reduce((a, c, i) => Object(a[c]) === a[c] ? a[c] : a[c] = Math.abs(Number(path[i + 1])) >> 0 === +path[i + 1] ? [] : {}, obj)[path[path.length - 1]] = value;
262
- return obj;
263
- };
264
-
265
411
  // src/functions/transform-block.js
266
412
  function transformBlock(block) {
267
413
  return block;
268
414
  }
269
415
 
270
416
  // src/functions/get-processed-block.js
271
- var __defProp = Object.defineProperty;
272
- var __defProps = Object.defineProperties;
273
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
274
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
275
- var __hasOwnProp = Object.prototype.hasOwnProperty;
276
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
277
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {
417
+ var __defProp2 = Object.defineProperty;
418
+ var __defProps2 = Object.defineProperties;
419
+ var __getOwnPropDescs2 = Object.getOwnPropertyDescriptors;
420
+ var __getOwnPropSymbols2 = Object.getOwnPropertySymbols;
421
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
422
+ var __propIsEnum2 = Object.prototype.propertyIsEnumerable;
423
+ var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, {
278
424
  enumerable: true,
279
425
  configurable: true,
280
426
  writable: true,
281
427
  value
282
428
  }) : obj[key] = value;
283
- var __spreadValues = (a, b) => {
429
+ var __spreadValues2 = (a, b) => {
284
430
  for (var prop in b || (b = {}))
285
- if (__hasOwnProp.call(b, prop))
286
- __defNormalProp(a, prop, b[prop]);
287
- if (__getOwnPropSymbols)
288
- for (var prop of __getOwnPropSymbols(b)) {
289
- if (__propIsEnum.call(b, prop))
290
- __defNormalProp(a, prop, b[prop]);
431
+ if (__hasOwnProp2.call(b, prop))
432
+ __defNormalProp2(a, prop, b[prop]);
433
+ if (__getOwnPropSymbols2)
434
+ for (var prop of __getOwnPropSymbols2(b)) {
435
+ if (__propIsEnum2.call(b, prop))
436
+ __defNormalProp2(a, prop, b[prop]);
291
437
  }
292
438
  return a;
293
439
  };
294
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
440
+ var __spreadProps2 = (a, b) => __defProps2(a, __getOwnPropDescs2(b));
295
441
  var evaluateBindings = ({
296
442
  block,
297
443
  context,
@@ -303,9 +449,9 @@ var evaluateBindings = ({
303
449
  return block;
304
450
  }
305
451
  const copy = fastClone(block);
306
- const copied = __spreadProps(__spreadValues({}, copy), {
307
- properties: __spreadValues({}, copy.properties),
308
- actions: __spreadValues({}, copy.actions)
452
+ const copied = __spreadProps2(__spreadValues2({}, copy), {
453
+ properties: __spreadValues2({}, copy.properties),
454
+ actions: __spreadValues2({}, copy.actions)
309
455
  });
310
456
  for (const binding in block.bindings) {
311
457
  const expression = block.bindings[binding];
@@ -453,62 +599,62 @@ var Block_styles_default = BlockStyles;
453
599
  import { Show as Show5, For as For2, createSignal as createSignal4 } from "solid-js";
454
600
 
455
601
  // src/functions/get-block-component-options.js
456
- var __defProp2 = Object.defineProperty;
457
- var __defProps2 = Object.defineProperties;
458
- var __getOwnPropDescs2 = Object.getOwnPropertyDescriptors;
459
- var __getOwnPropSymbols2 = Object.getOwnPropertySymbols;
460
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
461
- var __propIsEnum2 = Object.prototype.propertyIsEnumerable;
462
- var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, {
602
+ var __defProp3 = Object.defineProperty;
603
+ var __defProps3 = Object.defineProperties;
604
+ var __getOwnPropDescs3 = Object.getOwnPropertyDescriptors;
605
+ var __getOwnPropSymbols3 = Object.getOwnPropertySymbols;
606
+ var __hasOwnProp3 = Object.prototype.hasOwnProperty;
607
+ var __propIsEnum3 = Object.prototype.propertyIsEnumerable;
608
+ var __defNormalProp3 = (obj, key, value) => key in obj ? __defProp3(obj, key, {
463
609
  enumerable: true,
464
610
  configurable: true,
465
611
  writable: true,
466
612
  value
467
613
  }) : obj[key] = value;
468
- var __spreadValues2 = (a, b) => {
614
+ var __spreadValues3 = (a, b) => {
469
615
  for (var prop in b || (b = {}))
470
- if (__hasOwnProp2.call(b, prop))
471
- __defNormalProp2(a, prop, b[prop]);
472
- if (__getOwnPropSymbols2)
473
- for (var prop of __getOwnPropSymbols2(b)) {
474
- if (__propIsEnum2.call(b, prop))
475
- __defNormalProp2(a, prop, b[prop]);
616
+ if (__hasOwnProp3.call(b, prop))
617
+ __defNormalProp3(a, prop, b[prop]);
618
+ if (__getOwnPropSymbols3)
619
+ for (var prop of __getOwnPropSymbols3(b)) {
620
+ if (__propIsEnum3.call(b, prop))
621
+ __defNormalProp3(a, prop, b[prop]);
476
622
  }
477
623
  return a;
478
624
  };
479
- var __spreadProps2 = (a, b) => __defProps2(a, __getOwnPropDescs2(b));
625
+ var __spreadProps3 = (a, b) => __defProps3(a, __getOwnPropDescs3(b));
480
626
  function getBlockComponentOptions(block) {
481
627
  var _a;
482
- return __spreadProps2(__spreadValues2(__spreadValues2({}, (_a = block.component) == null ? void 0 : _a.options), block.options), {
628
+ return __spreadProps3(__spreadValues3(__spreadValues3({}, (_a = block.component) == null ? void 0 : _a.options), block.options), {
483
629
  builderBlock: block
484
630
  });
485
631
  }
486
632
 
487
633
  // src/functions/sanitize-react-native-block-styles.js
488
- var __defProp3 = Object.defineProperty;
489
- var __defProps3 = Object.defineProperties;
490
- var __getOwnPropDescs3 = Object.getOwnPropertyDescriptors;
491
- var __getOwnPropSymbols3 = Object.getOwnPropertySymbols;
492
- var __hasOwnProp3 = Object.prototype.hasOwnProperty;
493
- var __propIsEnum3 = Object.prototype.propertyIsEnumerable;
494
- var __defNormalProp3 = (obj, key, value) => key in obj ? __defProp3(obj, key, {
634
+ var __defProp4 = Object.defineProperty;
635
+ var __defProps4 = Object.defineProperties;
636
+ var __getOwnPropDescs4 = Object.getOwnPropertyDescriptors;
637
+ var __getOwnPropSymbols4 = Object.getOwnPropertySymbols;
638
+ var __hasOwnProp4 = Object.prototype.hasOwnProperty;
639
+ var __propIsEnum4 = Object.prototype.propertyIsEnumerable;
640
+ var __defNormalProp4 = (obj, key, value) => key in obj ? __defProp4(obj, key, {
495
641
  enumerable: true,
496
642
  configurable: true,
497
643
  writable: true,
498
644
  value
499
645
  }) : obj[key] = value;
500
- var __spreadValues3 = (a, b) => {
646
+ var __spreadValues4 = (a, b) => {
501
647
  for (var prop in b || (b = {}))
502
- if (__hasOwnProp3.call(b, prop))
503
- __defNormalProp3(a, prop, b[prop]);
504
- if (__getOwnPropSymbols3)
505
- for (var prop of __getOwnPropSymbols3(b)) {
506
- if (__propIsEnum3.call(b, prop))
507
- __defNormalProp3(a, prop, b[prop]);
648
+ if (__hasOwnProp4.call(b, prop))
649
+ __defNormalProp4(a, prop, b[prop]);
650
+ if (__getOwnPropSymbols4)
651
+ for (var prop of __getOwnPropSymbols4(b)) {
652
+ if (__propIsEnum4.call(b, prop))
653
+ __defNormalProp4(a, prop, b[prop]);
508
654
  }
509
655
  return a;
510
656
  };
511
- var __spreadProps3 = (a, b) => __defProps3(a, __getOwnPropDescs3(b));
657
+ var __spreadProps4 = (a, b) => __defProps4(a, __getOwnPropDescs4(b));
512
658
  var propertiesThatMustBeNumber = /* @__PURE__ */ new Set(["lineHeight"]);
513
659
  var displayValues = /* @__PURE__ */ new Set(["flex", "none"]);
514
660
  var SHOW_WARNINGS = false;
@@ -540,43 +686,43 @@ var sanitizeReactNativeBlockStyles = (styles) => {
540
686
  const newValue = parseFloat(propertyValue);
541
687
  const normalizedValue = normalizeNumber(newValue);
542
688
  if (normalizedValue) {
543
- return __spreadProps3(__spreadValues3({}, acc), {
689
+ return __spreadProps4(__spreadValues4({}, acc), {
544
690
  [key]: normalizedValue
545
691
  });
546
692
  } else {
547
693
  return acc;
548
694
  }
549
695
  } else if (propertyValue === "0") {
550
- return __spreadProps3(__spreadValues3({}, acc), {
696
+ return __spreadProps4(__spreadValues4({}, acc), {
551
697
  [key]: 0
552
698
  });
553
699
  }
554
700
  }
555
- return __spreadProps3(__spreadValues3({}, acc), {
701
+ return __spreadProps4(__spreadValues4({}, acc), {
556
702
  [key]: propertyValue
557
703
  });
558
704
  }, {});
559
705
  };
560
706
 
561
707
  // src/functions/get-react-native-block-styles.js
562
- var __defProp4 = Object.defineProperty;
563
- var __getOwnPropSymbols4 = Object.getOwnPropertySymbols;
564
- var __hasOwnProp4 = Object.prototype.hasOwnProperty;
565
- var __propIsEnum4 = Object.prototype.propertyIsEnumerable;
566
- var __defNormalProp4 = (obj, key, value) => key in obj ? __defProp4(obj, key, {
708
+ var __defProp5 = Object.defineProperty;
709
+ var __getOwnPropSymbols5 = Object.getOwnPropertySymbols;
710
+ var __hasOwnProp5 = Object.prototype.hasOwnProperty;
711
+ var __propIsEnum5 = Object.prototype.propertyIsEnumerable;
712
+ var __defNormalProp5 = (obj, key, value) => key in obj ? __defProp5(obj, key, {
567
713
  enumerable: true,
568
714
  configurable: true,
569
715
  writable: true,
570
716
  value
571
717
  }) : obj[key] = value;
572
- var __spreadValues4 = (a, b) => {
718
+ var __spreadValues5 = (a, b) => {
573
719
  for (var prop in b || (b = {}))
574
- if (__hasOwnProp4.call(b, prop))
575
- __defNormalProp4(a, prop, b[prop]);
576
- if (__getOwnPropSymbols4)
577
- for (var prop of __getOwnPropSymbols4(b)) {
578
- if (__propIsEnum4.call(b, prop))
579
- __defNormalProp4(a, prop, b[prop]);
720
+ if (__hasOwnProp5.call(b, prop))
721
+ __defNormalProp5(a, prop, b[prop]);
722
+ if (__getOwnPropSymbols5)
723
+ for (var prop of __getOwnPropSymbols5(b)) {
724
+ if (__propIsEnum5.call(b, prop))
725
+ __defNormalProp5(a, prop, b[prop]);
580
726
  }
581
727
  return a;
582
728
  };
@@ -589,7 +735,7 @@ function getReactNativeBlockStyles({
589
735
  if (!responsiveStyles) {
590
736
  return {};
591
737
  }
592
- const styles = __spreadValues4(__spreadValues4(__spreadValues4(__spreadValues4(__spreadValues4({}, context.inheritedStyles), responsiveStyles.large || {}), responsiveStyles.medium || {}), responsiveStyles.small || {}), blockStyles);
738
+ const styles = __spreadValues5(__spreadValues5(__spreadValues5(__spreadValues5(__spreadValues5({}, context.inheritedStyles), responsiveStyles.large || {}), responsiveStyles.medium || {}), responsiveStyles.small || {}), blockStyles);
593
739
  const newStyles = sanitizeReactNativeBlockStyles(styles);
594
740
  return newStyles;
595
741
  }
@@ -600,30 +746,30 @@ function transformBlockProperties(properties) {
600
746
  }
601
747
 
602
748
  // src/functions/get-block-properties.js
603
- var __defProp5 = Object.defineProperty;
604
- var __defProps4 = Object.defineProperties;
605
- var __getOwnPropDescs4 = Object.getOwnPropertyDescriptors;
606
- var __getOwnPropSymbols5 = Object.getOwnPropertySymbols;
607
- var __hasOwnProp5 = Object.prototype.hasOwnProperty;
608
- var __propIsEnum5 = Object.prototype.propertyIsEnumerable;
609
- var __defNormalProp5 = (obj, key, value) => key in obj ? __defProp5(obj, key, {
749
+ var __defProp6 = Object.defineProperty;
750
+ var __defProps5 = Object.defineProperties;
751
+ var __getOwnPropDescs5 = Object.getOwnPropertyDescriptors;
752
+ var __getOwnPropSymbols6 = Object.getOwnPropertySymbols;
753
+ var __hasOwnProp6 = Object.prototype.hasOwnProperty;
754
+ var __propIsEnum6 = Object.prototype.propertyIsEnumerable;
755
+ var __defNormalProp6 = (obj, key, value) => key in obj ? __defProp6(obj, key, {
610
756
  enumerable: true,
611
757
  configurable: true,
612
758
  writable: true,
613
759
  value
614
760
  }) : obj[key] = value;
615
- var __spreadValues5 = (a, b) => {
761
+ var __spreadValues6 = (a, b) => {
616
762
  for (var prop in b || (b = {}))
617
- if (__hasOwnProp5.call(b, prop))
618
- __defNormalProp5(a, prop, b[prop]);
619
- if (__getOwnPropSymbols5)
620
- for (var prop of __getOwnPropSymbols5(b)) {
621
- if (__propIsEnum5.call(b, prop))
622
- __defNormalProp5(a, prop, b[prop]);
763
+ if (__hasOwnProp6.call(b, prop))
764
+ __defNormalProp6(a, prop, b[prop]);
765
+ if (__getOwnPropSymbols6)
766
+ for (var prop of __getOwnPropSymbols6(b)) {
767
+ if (__propIsEnum6.call(b, prop))
768
+ __defNormalProp6(a, prop, b[prop]);
623
769
  }
624
770
  return a;
625
771
  };
626
- var __spreadProps4 = (a, b) => __defProps4(a, __getOwnPropDescs4(b));
772
+ var __spreadProps5 = (a, b) => __defProps5(a, __getOwnPropDescs5(b));
627
773
  var extractRelevantRootBlockProperties = (block) => {
628
774
  return {
629
775
  href: block.href
@@ -634,7 +780,7 @@ function getBlockProperties({
634
780
  context
635
781
  }) {
636
782
  var _a;
637
- const properties = __spreadProps4(__spreadValues5(__spreadValues5({}, extractRelevantRootBlockProperties(block)), block.properties), {
783
+ const properties = __spreadProps5(__spreadValues6(__spreadValues6({}, extractRelevantRootBlockProperties(block)), block.properties), {
638
784
  "builder-id": block.id,
639
785
  style: block.style ? getStyleAttribute(block.style) : void 0,
640
786
  class: [block.id, "builder-block", block.class, (_a = block.properties) == null ? void 0 : _a.class].filter(Boolean).join(" ")
@@ -664,38 +810,38 @@ function getStyleAttribute(style) {
664
810
  }
665
811
 
666
812
  // src/components/block/block.helpers.js
667
- var __defProp6 = Object.defineProperty;
668
- var __defProps5 = Object.defineProperties;
669
- var __getOwnPropDescs5 = Object.getOwnPropertyDescriptors;
670
- var __getOwnPropSymbols6 = Object.getOwnPropertySymbols;
671
- var __hasOwnProp6 = Object.prototype.hasOwnProperty;
672
- var __propIsEnum6 = Object.prototype.propertyIsEnumerable;
673
- var __defNormalProp6 = (obj, key, value) => key in obj ? __defProp6(obj, key, {
813
+ var __defProp7 = Object.defineProperty;
814
+ var __defProps6 = Object.defineProperties;
815
+ var __getOwnPropDescs6 = Object.getOwnPropertyDescriptors;
816
+ var __getOwnPropSymbols7 = Object.getOwnPropertySymbols;
817
+ var __hasOwnProp7 = Object.prototype.hasOwnProperty;
818
+ var __propIsEnum7 = Object.prototype.propertyIsEnumerable;
819
+ var __defNormalProp7 = (obj, key, value) => key in obj ? __defProp7(obj, key, {
674
820
  enumerable: true,
675
821
  configurable: true,
676
822
  writable: true,
677
823
  value
678
824
  }) : obj[key] = value;
679
- var __spreadValues6 = (a, b) => {
825
+ var __spreadValues7 = (a, b) => {
680
826
  for (var prop in b || (b = {}))
681
- if (__hasOwnProp6.call(b, prop))
682
- __defNormalProp6(a, prop, b[prop]);
683
- if (__getOwnPropSymbols6)
684
- for (var prop of __getOwnPropSymbols6(b)) {
685
- if (__propIsEnum6.call(b, prop))
686
- __defNormalProp6(a, prop, b[prop]);
827
+ if (__hasOwnProp7.call(b, prop))
828
+ __defNormalProp7(a, prop, b[prop]);
829
+ if (__getOwnPropSymbols7)
830
+ for (var prop of __getOwnPropSymbols7(b)) {
831
+ if (__propIsEnum7.call(b, prop))
832
+ __defNormalProp7(a, prop, b[prop]);
687
833
  }
688
834
  return a;
689
835
  };
690
- var __spreadProps5 = (a, b) => __defProps5(a, __getOwnPropDescs5(b));
836
+ var __spreadProps6 = (a, b) => __defProps6(a, __getOwnPropDescs6(b));
691
837
  var __objRest = (source, exclude) => {
692
838
  var target = {};
693
839
  for (var prop in source)
694
- if (__hasOwnProp6.call(source, prop) && exclude.indexOf(prop) < 0)
840
+ if (__hasOwnProp7.call(source, prop) && exclude.indexOf(prop) < 0)
695
841
  target[prop] = source[prop];
696
- if (source != null && __getOwnPropSymbols6)
697
- for (var prop of __getOwnPropSymbols6(source)) {
698
- if (exclude.indexOf(prop) < 0 && __propIsEnum6.call(source, prop))
842
+ if (source != null && __getOwnPropSymbols7)
843
+ for (var prop of __getOwnPropSymbols7(source)) {
844
+ if (exclude.indexOf(prop) < 0 && __propIsEnum7.call(source, prop))
699
845
  target[prop] = source[prop];
700
846
  }
701
847
  return target;
@@ -751,8 +897,8 @@ var getRepeatItemData = ({
751
897
  const collectionName = repeat.collection.split(".").pop();
752
898
  const itemNameToUse = repeat.itemName || (collectionName ? collectionName + "Item" : "item");
753
899
  const repeatArray = itemsArray.map((item, index) => ({
754
- context: __spreadProps5(__spreadValues6({}, context), {
755
- localState: __spreadProps5(__spreadValues6({}, context.localState), {
900
+ context: __spreadProps6(__spreadValues7({}, context), {
901
+ localState: __spreadProps6(__spreadValues7({}, context.localState), {
756
902
  $index: index,
757
903
  $item: item,
758
904
  [itemNameToUse]: item,
@@ -867,24 +1013,24 @@ function InteractiveElement(props) {
867
1013
  var interactive_element_default = InteractiveElement;
868
1014
 
869
1015
  // src/components/block/components/component-ref/component-ref.helpers.js
870
- var __defProp7 = Object.defineProperty;
871
- var __getOwnPropSymbols7 = Object.getOwnPropertySymbols;
872
- var __hasOwnProp7 = Object.prototype.hasOwnProperty;
873
- var __propIsEnum7 = Object.prototype.propertyIsEnumerable;
874
- var __defNormalProp7 = (obj, key, value) => key in obj ? __defProp7(obj, key, {
1016
+ var __defProp8 = Object.defineProperty;
1017
+ var __getOwnPropSymbols8 = Object.getOwnPropertySymbols;
1018
+ var __hasOwnProp8 = Object.prototype.hasOwnProperty;
1019
+ var __propIsEnum8 = Object.prototype.propertyIsEnumerable;
1020
+ var __defNormalProp8 = (obj, key, value) => key in obj ? __defProp8(obj, key, {
875
1021
  enumerable: true,
876
1022
  configurable: true,
877
1023
  writable: true,
878
1024
  value
879
1025
  }) : obj[key] = value;
880
- var __spreadValues7 = (a, b) => {
1026
+ var __spreadValues8 = (a, b) => {
881
1027
  for (var prop in b || (b = {}))
882
- if (__hasOwnProp7.call(b, prop))
883
- __defNormalProp7(a, prop, b[prop]);
884
- if (__getOwnPropSymbols7)
885
- for (var prop of __getOwnPropSymbols7(b)) {
886
- if (__propIsEnum7.call(b, prop))
887
- __defNormalProp7(a, prop, b[prop]);
1028
+ if (__hasOwnProp8.call(b, prop))
1029
+ __defNormalProp8(a, prop, b[prop]);
1030
+ if (__getOwnPropSymbols8)
1031
+ for (var prop of __getOwnPropSymbols8(b)) {
1032
+ if (__propIsEnum8.call(b, prop))
1033
+ __defNormalProp8(a, prop, b[prop]);
888
1034
  }
889
1035
  return a;
890
1036
  };
@@ -903,7 +1049,7 @@ var getWrapperProps = ({
903
1049
  context,
904
1050
  wrapperProps: componentOptions
905
1051
  };
906
- return isInteractive ? interactiveElementProps : __spreadValues7(__spreadValues7({}, componentOptions), includeBlockProps ? {
1052
+ return isInteractive ? interactiveElementProps : __spreadValues8(__spreadValues8({}, componentOptions), includeBlockProps ? {
907
1053
  attributes: getBlockProperties({
908
1054
  block: builderBlock,
909
1055
  context: contextValue
@@ -1483,31 +1629,31 @@ import { onMount as onMount4, on as on3, createEffect as createEffect3, createSi
1483
1629
  import { Show as Show11, For as For5, onMount as onMount3, createSignal as createSignal14 } from "solid-js";
1484
1630
 
1485
1631
  // src/components/content-variants/helpers.js
1486
- var __defProp8 = Object.defineProperty;
1487
- var __defProps6 = Object.defineProperties;
1488
- var __getOwnPropDescs6 = Object.getOwnPropertyDescriptors;
1489
- var __getOwnPropSymbols8 = Object.getOwnPropertySymbols;
1490
- var __hasOwnProp8 = Object.prototype.hasOwnProperty;
1491
- var __propIsEnum8 = Object.prototype.propertyIsEnumerable;
1492
- var __defNormalProp8 = (obj, key, value) => key in obj ? __defProp8(obj, key, {
1632
+ var __defProp9 = Object.defineProperty;
1633
+ var __defProps7 = Object.defineProperties;
1634
+ var __getOwnPropDescs7 = Object.getOwnPropertyDescriptors;
1635
+ var __getOwnPropSymbols9 = Object.getOwnPropertySymbols;
1636
+ var __hasOwnProp9 = Object.prototype.hasOwnProperty;
1637
+ var __propIsEnum9 = Object.prototype.propertyIsEnumerable;
1638
+ var __defNormalProp9 = (obj, key, value) => key in obj ? __defProp9(obj, key, {
1493
1639
  enumerable: true,
1494
1640
  configurable: true,
1495
1641
  writable: true,
1496
1642
  value
1497
1643
  }) : obj[key] = value;
1498
- var __spreadValues8 = (a, b) => {
1644
+ var __spreadValues9 = (a, b) => {
1499
1645
  for (var prop in b || (b = {}))
1500
- if (__hasOwnProp8.call(b, prop))
1501
- __defNormalProp8(a, prop, b[prop]);
1502
- if (__getOwnPropSymbols8)
1503
- for (var prop of __getOwnPropSymbols8(b)) {
1504
- if (__propIsEnum8.call(b, prop))
1505
- __defNormalProp8(a, prop, b[prop]);
1646
+ if (__hasOwnProp9.call(b, prop))
1647
+ __defNormalProp9(a, prop, b[prop]);
1648
+ if (__getOwnPropSymbols9)
1649
+ for (var prop of __getOwnPropSymbols9(b)) {
1650
+ if (__propIsEnum9.call(b, prop))
1651
+ __defNormalProp9(a, prop, b[prop]);
1506
1652
  }
1507
1653
  return a;
1508
1654
  };
1509
- var __spreadProps6 = (a, b) => __defProps6(a, __getOwnPropDescs6(b));
1510
- var getVariants = (content) => Object.values((content == null ? void 0 : content.variations) || {}).map((variant) => __spreadProps6(__spreadValues8({}, variant), {
1655
+ var __spreadProps7 = (a, b) => __defProps7(a, __getOwnPropDescs7(b));
1656
+ var getVariants = (content) => Object.values((content == null ? void 0 : content.variations) || {}).map((variant) => __spreadProps7(__spreadValues9({}, variant), {
1511
1657
  testVariationId: variant.id,
1512
1658
  id: content == null ? void 0 : content.id
1513
1659
  }));
@@ -2402,44 +2548,42 @@ import { onMount, createSignal as createSignal10 } from "solid-js";
2402
2548
  function CustomCode(props) {
2403
2549
  const [scriptsInserted, setScriptsInserted] = createSignal10([]);
2404
2550
  const [scriptsRun, setScriptsRun] = createSignal10([]);
2405
- function findAndRunScripts() {
2406
- if (elem && elem.getElementsByTagName && typeof window !== "undefined") {
2407
- const scripts = elem.getElementsByTagName("script");
2408
- for (let i = 0; i < scripts.length; i++) {
2409
- const script = scripts[i];
2410
- if (script.src) {
2411
- if (scriptsInserted().includes(script.src)) {
2412
- continue;
2413
- }
2414
- scriptsInserted().push(script.src);
2415
- const newScript = document.createElement("script");
2416
- newScript.async = true;
2417
- newScript.src = script.src;
2418
- document.head.appendChild(newScript);
2419
- } else if (!script.type || [
2420
- "text/javascript",
2421
- "application/javascript",
2422
- "application/ecmascript"
2423
- ].includes(script.type)) {
2424
- if (scriptsRun().includes(script.innerText)) {
2425
- continue;
2426
- }
2427
- try {
2428
- scriptsRun().push(script.innerText);
2429
- new Function(script.innerText)();
2430
- } catch (error) {
2431
- }
2551
+ let elementRef;
2552
+ onMount(() => {
2553
+ if (!elementRef?.getElementsByTagName || typeof window === "undefined") {
2554
+ return;
2555
+ }
2556
+ const scripts = elementRef.getElementsByTagName("script");
2557
+ for (let i = 0; i < scripts.length; i++) {
2558
+ const script = scripts[i];
2559
+ if (script.src) {
2560
+ if (scriptsInserted().includes(script.src)) {
2561
+ continue;
2562
+ }
2563
+ scriptsInserted().push(script.src);
2564
+ const newScript = document.createElement("script");
2565
+ newScript.async = true;
2566
+ newScript.src = script.src;
2567
+ document.head.appendChild(newScript);
2568
+ } else if (!script.type || [
2569
+ "text/javascript",
2570
+ "application/javascript",
2571
+ "application/ecmascript"
2572
+ ].includes(script.type)) {
2573
+ if (scriptsRun().includes(script.innerText)) {
2574
+ continue;
2575
+ }
2576
+ try {
2577
+ scriptsRun().push(script.innerText);
2578
+ new Function(script.innerText)();
2579
+ } catch (error) {
2432
2580
  }
2433
2581
  }
2434
2582
  }
2435
- }
2436
- let elem;
2437
- onMount(() => {
2438
- findAndRunScripts();
2439
2583
  });
2440
2584
  return <div
2441
2585
  class={"builder-custom-code" + (props.replaceNodes ? " replace-nodes" : "")}
2442
- ref={elem}
2586
+ ref={elementRef}
2443
2587
  innerHTML={props.code}
2444
2588
  />;
2445
2589
  }
@@ -2471,84 +2615,84 @@ var componentInfo11 = {
2471
2615
  };
2472
2616
 
2473
2617
  // src/constants/builder-registered-components.js
2474
- var __defProp9 = Object.defineProperty;
2475
- var __getOwnPropSymbols9 = Object.getOwnPropertySymbols;
2476
- var __hasOwnProp9 = Object.prototype.hasOwnProperty;
2477
- var __propIsEnum9 = Object.prototype.propertyIsEnumerable;
2478
- var __defNormalProp9 = (obj, key, value) => key in obj ? __defProp9(obj, key, {
2618
+ var __defProp10 = Object.defineProperty;
2619
+ var __getOwnPropSymbols10 = Object.getOwnPropertySymbols;
2620
+ var __hasOwnProp10 = Object.prototype.hasOwnProperty;
2621
+ var __propIsEnum10 = Object.prototype.propertyIsEnumerable;
2622
+ var __defNormalProp10 = (obj, key, value) => key in obj ? __defProp10(obj, key, {
2479
2623
  enumerable: true,
2480
2624
  configurable: true,
2481
2625
  writable: true,
2482
2626
  value
2483
2627
  }) : obj[key] = value;
2484
- var __spreadValues9 = (a, b) => {
2628
+ var __spreadValues10 = (a, b) => {
2485
2629
  for (var prop in b || (b = {}))
2486
- if (__hasOwnProp9.call(b, prop))
2487
- __defNormalProp9(a, prop, b[prop]);
2488
- if (__getOwnPropSymbols9)
2489
- for (var prop of __getOwnPropSymbols9(b)) {
2490
- if (__propIsEnum9.call(b, prop))
2491
- __defNormalProp9(a, prop, b[prop]);
2630
+ if (__hasOwnProp10.call(b, prop))
2631
+ __defNormalProp10(a, prop, b[prop]);
2632
+ if (__getOwnPropSymbols10)
2633
+ for (var prop of __getOwnPropSymbols10(b)) {
2634
+ if (__propIsEnum10.call(b, prop))
2635
+ __defNormalProp10(a, prop, b[prop]);
2492
2636
  }
2493
2637
  return a;
2494
2638
  };
2495
- var getDefaultRegisteredComponents = () => [__spreadValues9({
2639
+ var getDefaultRegisteredComponents = () => [__spreadValues10({
2496
2640
  component: button_default
2497
- }, componentInfo), __spreadValues9({
2641
+ }, componentInfo), __spreadValues10({
2498
2642
  component: columns_default
2499
- }, componentInfo2), __spreadValues9({
2643
+ }, componentInfo2), __spreadValues10({
2500
2644
  component: custom_code_default
2501
- }, componentInfo11), __spreadValues9({
2645
+ }, componentInfo11), __spreadValues10({
2502
2646
  component: embed_default
2503
- }, componentInfo9), __spreadValues9({
2647
+ }, componentInfo9), __spreadValues10({
2504
2648
  component: fragment_default
2505
- }, componentInfo3), __spreadValues9({
2649
+ }, componentInfo3), __spreadValues10({
2506
2650
  component: image_default
2507
- }, componentInfo4), __spreadValues9({
2651
+ }, componentInfo4), __spreadValues10({
2508
2652
  component: img_default
2509
- }, componentInfo10), __spreadValues9({
2653
+ }, componentInfo10), __spreadValues10({
2510
2654
  component: section_default
2511
- }, componentInfo5), __spreadValues9({
2655
+ }, componentInfo5), __spreadValues10({
2512
2656
  component: symbol_default
2513
- }, componentInfo6), __spreadValues9({
2657
+ }, componentInfo6), __spreadValues10({
2514
2658
  component: text_default
2515
- }, componentInfo7), __spreadValues9({
2659
+ }, componentInfo7), __spreadValues10({
2516
2660
  component: video_default
2517
2661
  }, componentInfo8)];
2518
2662
 
2519
2663
  // src/functions/register-component.js
2520
- var __defProp10 = Object.defineProperty;
2521
- var __defProps7 = Object.defineProperties;
2522
- var __getOwnPropDescs7 = Object.getOwnPropertyDescriptors;
2523
- var __getOwnPropSymbols10 = Object.getOwnPropertySymbols;
2524
- var __hasOwnProp10 = Object.prototype.hasOwnProperty;
2525
- var __propIsEnum10 = Object.prototype.propertyIsEnumerable;
2526
- var __defNormalProp10 = (obj, key, value) => key in obj ? __defProp10(obj, key, {
2664
+ var __defProp11 = Object.defineProperty;
2665
+ var __defProps8 = Object.defineProperties;
2666
+ var __getOwnPropDescs8 = Object.getOwnPropertyDescriptors;
2667
+ var __getOwnPropSymbols11 = Object.getOwnPropertySymbols;
2668
+ var __hasOwnProp11 = Object.prototype.hasOwnProperty;
2669
+ var __propIsEnum11 = Object.prototype.propertyIsEnumerable;
2670
+ var __defNormalProp11 = (obj, key, value) => key in obj ? __defProp11(obj, key, {
2527
2671
  enumerable: true,
2528
2672
  configurable: true,
2529
2673
  writable: true,
2530
2674
  value
2531
2675
  }) : obj[key] = value;
2532
- var __spreadValues10 = (a, b) => {
2676
+ var __spreadValues11 = (a, b) => {
2533
2677
  for (var prop in b || (b = {}))
2534
- if (__hasOwnProp10.call(b, prop))
2535
- __defNormalProp10(a, prop, b[prop]);
2536
- if (__getOwnPropSymbols10)
2537
- for (var prop of __getOwnPropSymbols10(b)) {
2538
- if (__propIsEnum10.call(b, prop))
2539
- __defNormalProp10(a, prop, b[prop]);
2678
+ if (__hasOwnProp11.call(b, prop))
2679
+ __defNormalProp11(a, prop, b[prop]);
2680
+ if (__getOwnPropSymbols11)
2681
+ for (var prop of __getOwnPropSymbols11(b)) {
2682
+ if (__propIsEnum11.call(b, prop))
2683
+ __defNormalProp11(a, prop, b[prop]);
2540
2684
  }
2541
2685
  return a;
2542
2686
  };
2543
- var __spreadProps7 = (a, b) => __defProps7(a, __getOwnPropDescs7(b));
2687
+ var __spreadProps8 = (a, b) => __defProps8(a, __getOwnPropDescs8(b));
2544
2688
  var __objRest2 = (source, exclude) => {
2545
2689
  var target = {};
2546
2690
  for (var prop in source)
2547
- if (__hasOwnProp10.call(source, prop) && exclude.indexOf(prop) < 0)
2691
+ if (__hasOwnProp11.call(source, prop) && exclude.indexOf(prop) < 0)
2548
2692
  target[prop] = source[prop];
2549
- if (source != null && __getOwnPropSymbols10)
2550
- for (var prop of __getOwnPropSymbols10(source)) {
2551
- if (exclude.indexOf(prop) < 0 && __propIsEnum10.call(source, prop))
2693
+ if (source != null && __getOwnPropSymbols11)
2694
+ for (var prop of __getOwnPropSymbols11(source)) {
2695
+ if (exclude.indexOf(prop) < 0 && __propIsEnum11.call(source, prop))
2552
2696
  target[prop] = source[prop];
2553
2697
  }
2554
2698
  return target;
@@ -2568,8 +2712,8 @@ var serializeComponentInfo = (_a) => {
2568
2712
  var _b = _a, {
2569
2713
  inputs
2570
2714
  } = _b, info = __objRest2(_b, ["inputs"]);
2571
- return __spreadProps7(__spreadValues10({}, fastClone(info)), {
2572
- inputs: inputs == null ? void 0 : inputs.map((input) => Object.entries(input).reduce((acc, [key, value]) => __spreadProps7(__spreadValues10({}, acc), {
2715
+ return __spreadProps8(__spreadValues11({}, fastClone(info)), {
2716
+ inputs: inputs == null ? void 0 : inputs.map((input) => Object.entries(input).reduce((acc, [key, value]) => __spreadProps8(__spreadValues11({}, acc), {
2573
2717
  [key]: serializeValue(value)
2574
2718
  }), {}))
2575
2719
  });
@@ -2666,30 +2810,30 @@ ${getFontCss({
2666
2810
  var Styles_default = ContentStyles;
2667
2811
 
2668
2812
  // src/components/content/content.helpers.js
2669
- var __defProp11 = Object.defineProperty;
2670
- var __defProps8 = Object.defineProperties;
2671
- var __getOwnPropDescs8 = Object.getOwnPropertyDescriptors;
2672
- var __getOwnPropSymbols11 = Object.getOwnPropertySymbols;
2673
- var __hasOwnProp11 = Object.prototype.hasOwnProperty;
2674
- var __propIsEnum11 = Object.prototype.propertyIsEnumerable;
2675
- var __defNormalProp11 = (obj, key, value) => key in obj ? __defProp11(obj, key, {
2813
+ var __defProp12 = Object.defineProperty;
2814
+ var __defProps9 = Object.defineProperties;
2815
+ var __getOwnPropDescs9 = Object.getOwnPropertyDescriptors;
2816
+ var __getOwnPropSymbols12 = Object.getOwnPropertySymbols;
2817
+ var __hasOwnProp12 = Object.prototype.hasOwnProperty;
2818
+ var __propIsEnum12 = Object.prototype.propertyIsEnumerable;
2819
+ var __defNormalProp12 = (obj, key, value) => key in obj ? __defProp12(obj, key, {
2676
2820
  enumerable: true,
2677
2821
  configurable: true,
2678
2822
  writable: true,
2679
2823
  value
2680
2824
  }) : obj[key] = value;
2681
- var __spreadValues11 = (a, b) => {
2825
+ var __spreadValues12 = (a, b) => {
2682
2826
  for (var prop in b || (b = {}))
2683
- if (__hasOwnProp11.call(b, prop))
2684
- __defNormalProp11(a, prop, b[prop]);
2685
- if (__getOwnPropSymbols11)
2686
- for (var prop of __getOwnPropSymbols11(b)) {
2687
- if (__propIsEnum11.call(b, prop))
2688
- __defNormalProp11(a, prop, b[prop]);
2827
+ if (__hasOwnProp12.call(b, prop))
2828
+ __defNormalProp12(a, prop, b[prop]);
2829
+ if (__getOwnPropSymbols12)
2830
+ for (var prop of __getOwnPropSymbols12(b)) {
2831
+ if (__propIsEnum12.call(b, prop))
2832
+ __defNormalProp12(a, prop, b[prop]);
2689
2833
  }
2690
2834
  return a;
2691
2835
  };
2692
- var __spreadProps8 = (a, b) => __defProps8(a, __getOwnPropDescs8(b));
2836
+ var __spreadProps9 = (a, b) => __defProps9(a, __getOwnPropDescs9(b));
2693
2837
  var getContextStateInitialValue = ({
2694
2838
  content,
2695
2839
  data,
@@ -2703,17 +2847,17 @@ var getContextStateInitialValue = ({
2703
2847
  defaultValues[input.name] = input.defaultValue;
2704
2848
  }
2705
2849
  });
2706
- const stateToUse = __spreadValues11(__spreadValues11(__spreadValues11({}, (_c = content == null ? void 0 : content.data) == null ? void 0 : _c.state), data), locale ? {
2850
+ const stateToUse = __spreadValues12(__spreadValues12(__spreadValues12({}, (_c = content == null ? void 0 : content.data) == null ? void 0 : _c.state), data), locale ? {
2707
2851
  locale
2708
2852
  } : {});
2709
- return __spreadValues11(__spreadValues11({}, defaultValues), stateToUse);
2853
+ return __spreadValues12(__spreadValues12({}, defaultValues), stateToUse);
2710
2854
  };
2711
2855
  var getContentInitialValue = ({
2712
2856
  content,
2713
2857
  data
2714
2858
  }) => {
2715
- return !content ? void 0 : __spreadProps8(__spreadValues11({}, content), {
2716
- data: __spreadValues11(__spreadValues11({}, content == null ? void 0 : content.data), data),
2859
+ return !content ? void 0 : __spreadProps9(__spreadValues12({}, content), {
2860
+ data: __spreadValues12(__spreadValues12({}, content == null ? void 0 : content.data), data),
2717
2861
  meta: content == null ? void 0 : content.meta
2718
2862
  });
2719
2863
  };
@@ -2962,38 +3106,38 @@ var setVisitorId = ({
2962
3106
  });
2963
3107
 
2964
3108
  // src/functions/track/index.js
2965
- var __defProp12 = Object.defineProperty;
2966
- var __defProps9 = Object.defineProperties;
2967
- var __getOwnPropDescs9 = Object.getOwnPropertyDescriptors;
2968
- var __getOwnPropSymbols12 = Object.getOwnPropertySymbols;
2969
- var __hasOwnProp12 = Object.prototype.hasOwnProperty;
2970
- var __propIsEnum12 = Object.prototype.propertyIsEnumerable;
2971
- var __defNormalProp12 = (obj, key, value) => key in obj ? __defProp12(obj, key, {
3109
+ var __defProp13 = Object.defineProperty;
3110
+ var __defProps10 = Object.defineProperties;
3111
+ var __getOwnPropDescs10 = Object.getOwnPropertyDescriptors;
3112
+ var __getOwnPropSymbols13 = Object.getOwnPropertySymbols;
3113
+ var __hasOwnProp13 = Object.prototype.hasOwnProperty;
3114
+ var __propIsEnum13 = Object.prototype.propertyIsEnumerable;
3115
+ var __defNormalProp13 = (obj, key, value) => key in obj ? __defProp13(obj, key, {
2972
3116
  enumerable: true,
2973
3117
  configurable: true,
2974
3118
  writable: true,
2975
3119
  value
2976
3120
  }) : obj[key] = value;
2977
- var __spreadValues12 = (a, b) => {
3121
+ var __spreadValues13 = (a, b) => {
2978
3122
  for (var prop in b || (b = {}))
2979
- if (__hasOwnProp12.call(b, prop))
2980
- __defNormalProp12(a, prop, b[prop]);
2981
- if (__getOwnPropSymbols12)
2982
- for (var prop of __getOwnPropSymbols12(b)) {
2983
- if (__propIsEnum12.call(b, prop))
2984
- __defNormalProp12(a, prop, b[prop]);
3123
+ if (__hasOwnProp13.call(b, prop))
3124
+ __defNormalProp13(a, prop, b[prop]);
3125
+ if (__getOwnPropSymbols13)
3126
+ for (var prop of __getOwnPropSymbols13(b)) {
3127
+ if (__propIsEnum13.call(b, prop))
3128
+ __defNormalProp13(a, prop, b[prop]);
2985
3129
  }
2986
3130
  return a;
2987
3131
  };
2988
- var __spreadProps9 = (a, b) => __defProps9(a, __getOwnPropDescs9(b));
3132
+ var __spreadProps10 = (a, b) => __defProps10(a, __getOwnPropDescs10(b));
2989
3133
  var __objRest3 = (source, exclude) => {
2990
3134
  var target = {};
2991
3135
  for (var prop in source)
2992
- if (__hasOwnProp12.call(source, prop) && exclude.indexOf(prop) < 0)
3136
+ if (__hasOwnProp13.call(source, prop) && exclude.indexOf(prop) < 0)
2993
3137
  target[prop] = source[prop];
2994
- if (source != null && __getOwnPropSymbols12)
2995
- for (var prop of __getOwnPropSymbols12(source)) {
2996
- if (exclude.indexOf(prop) < 0 && __propIsEnum12.call(source, prop))
3138
+ if (source != null && __getOwnPropSymbols13)
3139
+ for (var prop of __getOwnPropSymbols13(source)) {
3140
+ if (exclude.indexOf(prop) < 0 && __propIsEnum13.call(source, prop))
2997
3141
  target[prop] = source[prop];
2998
3142
  }
2999
3143
  return target;
@@ -3047,8 +3191,8 @@ var createEvent = (_a) => __async3(void 0, null, function* () {
3047
3191
  } = _b, properties = __objRest3(_b, ["type", "canTrack", "apiKey", "metadata"]);
3048
3192
  return {
3049
3193
  type: eventType,
3050
- data: __spreadProps9(__spreadValues12(__spreadProps9(__spreadValues12({}, properties), {
3051
- metadata: __spreadValues12({
3194
+ data: __spreadProps10(__spreadValues13(__spreadProps10(__spreadValues13({}, properties), {
3195
+ metadata: __spreadValues13({
3052
3196
  url: location.href
3053
3197
  }, metadata)
3054
3198
  }), yield getTrackingEventData({
@@ -3087,12 +3231,12 @@ function _track(eventProps) {
3087
3231
  });
3088
3232
  });
3089
3233
  }
3090
- var track = (args) => _track(__spreadProps9(__spreadValues12({}, args), {
3234
+ var track = (args) => _track(__spreadProps10(__spreadValues13({}, args), {
3091
3235
  canTrack: true
3092
3236
  }));
3093
3237
 
3094
3238
  // src/constants/sdk-version.js
3095
- var SDK_VERSION = "0.6.4";
3239
+ var SDK_VERSION = "0.7.1-0";
3096
3240
 
3097
3241
  // src/functions/register.js
3098
3242
  var registry = {};
@@ -3284,24 +3428,24 @@ var getInteractionPropertiesForEvent = (event) => {
3284
3428
  };
3285
3429
 
3286
3430
  // src/helpers/ab-tests.js
3287
- var __defProp13 = Object.defineProperty;
3288
- var __getOwnPropSymbols13 = Object.getOwnPropertySymbols;
3289
- var __hasOwnProp13 = Object.prototype.hasOwnProperty;
3290
- var __propIsEnum13 = Object.prototype.propertyIsEnumerable;
3291
- var __defNormalProp13 = (obj, key, value) => key in obj ? __defProp13(obj, key, {
3431
+ var __defProp14 = Object.defineProperty;
3432
+ var __getOwnPropSymbols14 = Object.getOwnPropertySymbols;
3433
+ var __hasOwnProp14 = Object.prototype.hasOwnProperty;
3434
+ var __propIsEnum14 = Object.prototype.propertyIsEnumerable;
3435
+ var __defNormalProp14 = (obj, key, value) => key in obj ? __defProp14(obj, key, {
3292
3436
  enumerable: true,
3293
3437
  configurable: true,
3294
3438
  writable: true,
3295
3439
  value
3296
3440
  }) : obj[key] = value;
3297
- var __spreadValues13 = (a, b) => {
3441
+ var __spreadValues14 = (a, b) => {
3298
3442
  for (var prop in b || (b = {}))
3299
- if (__hasOwnProp13.call(b, prop))
3300
- __defNormalProp13(a, prop, b[prop]);
3301
- if (__getOwnPropSymbols13)
3302
- for (var prop of __getOwnPropSymbols13(b)) {
3303
- if (__propIsEnum13.call(b, prop))
3304
- __defNormalProp13(a, prop, b[prop]);
3443
+ if (__hasOwnProp14.call(b, prop))
3444
+ __defNormalProp14(a, prop, b[prop]);
3445
+ if (__getOwnPropSymbols14)
3446
+ for (var prop of __getOwnPropSymbols14(b)) {
3447
+ if (__propIsEnum14.call(b, prop))
3448
+ __defNormalProp14(a, prop, b[prop]);
3305
3449
  }
3306
3450
  return a;
3307
3451
  };
@@ -3417,7 +3561,7 @@ var handleABTestingSync = ({
3417
3561
  item,
3418
3562
  testGroupId
3419
3563
  });
3420
- return __spreadValues13(__spreadValues13({}, item), variationValue);
3564
+ return __spreadValues14(__spreadValues14({}, item), variationValue);
3421
3565
  };
3422
3566
  var handleABTesting = (_0) => __async4(void 0, [_0], function* ({
3423
3567
  item,
@@ -3440,7 +3584,7 @@ var handleABTesting = (_0) => __async4(void 0, [_0], function* ({
3440
3584
  item,
3441
3585
  testGroupId
3442
3586
  });
3443
- return __spreadValues13(__spreadValues13({}, item), variationValue);
3587
+ return __spreadValues14(__spreadValues14({}, item), variationValue);
3444
3588
  });
3445
3589
 
3446
3590
  // src/helpers/canTrack.js
@@ -3452,36 +3596,36 @@ function getPreviewContent(_searchParams) {
3452
3596
  }
3453
3597
 
3454
3598
  // src/helpers/flatten.js
3455
- var __defProp14 = Object.defineProperty;
3456
- var __defProps10 = Object.defineProperties;
3457
- var __getOwnPropDescs10 = Object.getOwnPropertyDescriptors;
3458
- var __getOwnPropSymbols14 = Object.getOwnPropertySymbols;
3459
- var __hasOwnProp14 = Object.prototype.hasOwnProperty;
3460
- var __propIsEnum14 = Object.prototype.propertyIsEnumerable;
3461
- var __defNormalProp14 = (obj, key, value) => key in obj ? __defProp14(obj, key, {
3599
+ var __defProp15 = Object.defineProperty;
3600
+ var __defProps11 = Object.defineProperties;
3601
+ var __getOwnPropDescs11 = Object.getOwnPropertyDescriptors;
3602
+ var __getOwnPropSymbols15 = Object.getOwnPropertySymbols;
3603
+ var __hasOwnProp15 = Object.prototype.hasOwnProperty;
3604
+ var __propIsEnum15 = Object.prototype.propertyIsEnumerable;
3605
+ var __defNormalProp15 = (obj, key, value) => key in obj ? __defProp15(obj, key, {
3462
3606
  enumerable: true,
3463
3607
  configurable: true,
3464
3608
  writable: true,
3465
3609
  value
3466
3610
  }) : obj[key] = value;
3467
- var __spreadValues14 = (a, b) => {
3611
+ var __spreadValues15 = (a, b) => {
3468
3612
  for (var prop in b || (b = {}))
3469
- if (__hasOwnProp14.call(b, prop))
3470
- __defNormalProp14(a, prop, b[prop]);
3471
- if (__getOwnPropSymbols14)
3472
- for (var prop of __getOwnPropSymbols14(b)) {
3473
- if (__propIsEnum14.call(b, prop))
3474
- __defNormalProp14(a, prop, b[prop]);
3613
+ if (__hasOwnProp15.call(b, prop))
3614
+ __defNormalProp15(a, prop, b[prop]);
3615
+ if (__getOwnPropSymbols15)
3616
+ for (var prop of __getOwnPropSymbols15(b)) {
3617
+ if (__propIsEnum15.call(b, prop))
3618
+ __defNormalProp15(a, prop, b[prop]);
3475
3619
  }
3476
3620
  return a;
3477
3621
  };
3478
- var __spreadProps10 = (a, b) => __defProps10(a, __getOwnPropDescs10(b));
3622
+ var __spreadProps11 = (a, b) => __defProps11(a, __getOwnPropDescs11(b));
3479
3623
  function flatten(object, path = null, separator = ".") {
3480
3624
  return Object.keys(object).reduce((acc, key) => {
3481
3625
  const value = object[key];
3482
3626
  const newPath = [path, key].filter(Boolean).join(separator);
3483
3627
  const isObject = [typeof value === "object", value !== null, !(Array.isArray(value) && value.length === 0)].every(Boolean);
3484
- return isObject ? __spreadValues14(__spreadValues14({}, acc), flatten(value, newPath, separator)) : __spreadProps10(__spreadValues14({}, acc), {
3628
+ return isObject ? __spreadValues15(__spreadValues15({}, acc), flatten(value, newPath, separator)) : __spreadProps11(__spreadValues15({}, acc), {
3485
3629
  [newPath]: value
3486
3630
  });
3487
3631
  }, {});
@@ -3524,39 +3668,49 @@ var normalizeSearchParams = (searchParams) => searchParams instanceof URLSearchP
3524
3668
  var DEFAULT_API_VERSION = "v3";
3525
3669
 
3526
3670
  // src/functions/get-content/generate-content-url.js
3527
- var __defProp15 = Object.defineProperty;
3528
- var __getOwnPropSymbols15 = Object.getOwnPropertySymbols;
3529
- var __hasOwnProp15 = Object.prototype.hasOwnProperty;
3530
- var __propIsEnum15 = Object.prototype.propertyIsEnumerable;
3531
- var __defNormalProp15 = (obj, key, value) => key in obj ? __defProp15(obj, key, {
3671
+ var __defProp16 = Object.defineProperty;
3672
+ var __getOwnPropSymbols16 = Object.getOwnPropertySymbols;
3673
+ var __hasOwnProp16 = Object.prototype.hasOwnProperty;
3674
+ var __propIsEnum16 = Object.prototype.propertyIsEnumerable;
3675
+ var __defNormalProp16 = (obj, key, value) => key in obj ? __defProp16(obj, key, {
3532
3676
  enumerable: true,
3533
3677
  configurable: true,
3534
3678
  writable: true,
3535
3679
  value
3536
3680
  }) : obj[key] = value;
3537
- var __spreadValues15 = (a, b) => {
3681
+ var __spreadValues16 = (a, b) => {
3538
3682
  for (var prop in b || (b = {}))
3539
- if (__hasOwnProp15.call(b, prop))
3540
- __defNormalProp15(a, prop, b[prop]);
3541
- if (__getOwnPropSymbols15)
3542
- for (var prop of __getOwnPropSymbols15(b)) {
3543
- if (__propIsEnum15.call(b, prop))
3544
- __defNormalProp15(a, prop, b[prop]);
3683
+ if (__hasOwnProp16.call(b, prop))
3684
+ __defNormalProp16(a, prop, b[prop]);
3685
+ if (__getOwnPropSymbols16)
3686
+ for (var prop of __getOwnPropSymbols16(b)) {
3687
+ if (__propIsEnum16.call(b, prop))
3688
+ __defNormalProp16(a, prop, b[prop]);
3545
3689
  }
3546
3690
  return a;
3547
3691
  };
3692
+ var isPositiveNumber = (thing) => typeof thing === "number" && !isNaN(thing) && thing >= 0;
3548
3693
  var generateContentUrl = (options) => {
3694
+ let {
3695
+ noTraverse = false
3696
+ } = options;
3549
3697
  const {
3550
3698
  limit = 30,
3551
3699
  userAttributes,
3552
3700
  query,
3553
- noTraverse = false,
3554
3701
  model,
3555
3702
  apiKey,
3556
3703
  includeRefs = true,
3557
3704
  enrich,
3558
3705
  locale,
3559
- apiVersion = DEFAULT_API_VERSION
3706
+ apiVersion = DEFAULT_API_VERSION,
3707
+ fields,
3708
+ omit,
3709
+ offset,
3710
+ cacheSeconds,
3711
+ staleCacheSeconds,
3712
+ sort,
3713
+ includeUnpublished
3560
3714
  } = options;
3561
3715
  if (!apiKey) {
3562
3716
  throw new Error("Missing API key");
@@ -3564,8 +3718,35 @@ var generateContentUrl = (options) => {
3564
3718
  if (!["v2", "v3"].includes(apiVersion)) {
3565
3719
  throw new Error(`Invalid apiVersion: expected 'v2' or 'v3', received '${apiVersion}'`);
3566
3720
  }
3721
+ if ((options.limit === void 0 || options.limit > 1) && !("noTraverse" in options)) {
3722
+ noTraverse = true;
3723
+ }
3567
3724
  const url = new URL(`https://cdn.builder.io/api/${apiVersion}/content/${model}?apiKey=${apiKey}&limit=${limit}&noTraverse=${noTraverse}&includeRefs=${includeRefs}${locale ? `&locale=${locale}` : ""}${enrich ? `&enrich=${enrich}` : ""}`);
3568
- const queryOptions = __spreadValues15(__spreadValues15({}, getBuilderSearchParamsFromWindow()), normalizeSearchParams(options.options || {}));
3725
+ url.searchParams.set("omit", omit || "meta.componentsUsed");
3726
+ if (fields) {
3727
+ url.searchParams.set("fields", fields);
3728
+ }
3729
+ if (Number.isFinite(offset) && offset > -1) {
3730
+ url.searchParams.set("offset", String(Math.floor(offset)));
3731
+ }
3732
+ if (typeof includeUnpublished === "boolean") {
3733
+ url.searchParams.set("includeUnpublished", String(includeUnpublished));
3734
+ }
3735
+ if (cacheSeconds && isPositiveNumber(cacheSeconds)) {
3736
+ url.searchParams.set("cacheSeconds", String(cacheSeconds));
3737
+ }
3738
+ if (staleCacheSeconds && isPositiveNumber(staleCacheSeconds)) {
3739
+ url.searchParams.set("staleCacheSeconds", String(staleCacheSeconds));
3740
+ }
3741
+ if (sort) {
3742
+ const flattened2 = flatten({
3743
+ sort
3744
+ });
3745
+ for (const key in flattened2) {
3746
+ url.searchParams.set(key, JSON.stringify(flattened2[key]));
3747
+ }
3748
+ }
3749
+ const queryOptions = __spreadValues16(__spreadValues16({}, getBuilderSearchParamsFromWindow()), normalizeSearchParams(options.options || {}));
3569
3750
  const flattened = flatten(queryOptions);
3570
3751
  for (const key in flattened) {
3571
3752
  url.searchParams.set(key, String(flattened[key]));
@@ -3585,30 +3766,30 @@ var generateContentUrl = (options) => {
3585
3766
  };
3586
3767
 
3587
3768
  // src/functions/get-content/index.js
3588
- var __defProp16 = Object.defineProperty;
3589
- var __defProps11 = Object.defineProperties;
3590
- var __getOwnPropDescs11 = Object.getOwnPropertyDescriptors;
3591
- var __getOwnPropSymbols16 = Object.getOwnPropertySymbols;
3592
- var __hasOwnProp16 = Object.prototype.hasOwnProperty;
3593
- var __propIsEnum16 = Object.prototype.propertyIsEnumerable;
3594
- var __defNormalProp16 = (obj, key, value) => key in obj ? __defProp16(obj, key, {
3769
+ var __defProp17 = Object.defineProperty;
3770
+ var __defProps12 = Object.defineProperties;
3771
+ var __getOwnPropDescs12 = Object.getOwnPropertyDescriptors;
3772
+ var __getOwnPropSymbols17 = Object.getOwnPropertySymbols;
3773
+ var __hasOwnProp17 = Object.prototype.hasOwnProperty;
3774
+ var __propIsEnum17 = Object.prototype.propertyIsEnumerable;
3775
+ var __defNormalProp17 = (obj, key, value) => key in obj ? __defProp17(obj, key, {
3595
3776
  enumerable: true,
3596
3777
  configurable: true,
3597
3778
  writable: true,
3598
3779
  value
3599
3780
  }) : obj[key] = value;
3600
- var __spreadValues16 = (a, b) => {
3781
+ var __spreadValues17 = (a, b) => {
3601
3782
  for (var prop in b || (b = {}))
3602
- if (__hasOwnProp16.call(b, prop))
3603
- __defNormalProp16(a, prop, b[prop]);
3604
- if (__getOwnPropSymbols16)
3605
- for (var prop of __getOwnPropSymbols16(b)) {
3606
- if (__propIsEnum16.call(b, prop))
3607
- __defNormalProp16(a, prop, b[prop]);
3783
+ if (__hasOwnProp17.call(b, prop))
3784
+ __defNormalProp17(a, prop, b[prop]);
3785
+ if (__getOwnPropSymbols17)
3786
+ for (var prop of __getOwnPropSymbols17(b)) {
3787
+ if (__propIsEnum17.call(b, prop))
3788
+ __defNormalProp17(a, prop, b[prop]);
3608
3789
  }
3609
3790
  return a;
3610
3791
  };
3611
- var __spreadProps11 = (a, b) => __defProps11(a, __getOwnPropDescs11(b));
3792
+ var __spreadProps12 = (a, b) => __defProps12(a, __getOwnPropDescs12(b));
3612
3793
  var __async5 = (__this, __arguments, generator) => {
3613
3794
  return new Promise((resolve, reject) => {
3614
3795
  var fulfilled = (value) => {
@@ -3632,7 +3813,7 @@ var __async5 = (__this, __arguments, generator) => {
3632
3813
  var checkContentHasResults = (content) => "results" in content;
3633
3814
  function fetchOneEntry(options) {
3634
3815
  return __async5(this, null, function* () {
3635
- const allContent = yield fetchEntries(__spreadProps11(__spreadValues16({}, options), {
3816
+ const allContent = yield fetchEntries(__spreadProps12(__spreadValues17({}, options), {
3636
3817
  limit: 1
3637
3818
  }));
3638
3819
  if (allContent) {
@@ -3712,9 +3893,6 @@ function isPreviewing() {
3712
3893
 
3713
3894
  // src/components/content/components/enable-editor.jsx
3714
3895
  function EnableEditor(props) {
3715
- const [canTrackToUse, setCanTrackToUse] = createSignal12(
3716
- checkIsDefined(props.canTrack) ? props.canTrack : true
3717
- );
3718
3896
  const [forceReRenderCount, setForceReRenderCount] = createSignal12(0);
3719
3897
  const [lastUpdated, setLastUpdated] = createSignal12(0);
3720
3898
  const [shouldSendResetCookie, setShouldSendResetCookie] = createSignal12(false);
@@ -3790,7 +3968,7 @@ function EnableEditor(props) {
3790
3968
  const contentId = props.builderContextSignal.content?.id;
3791
3969
  _track({
3792
3970
  type: "click",
3793
- canTrack: canTrackToUse(),
3971
+ canTrack: getDefaultCanTrack(props.canTrack),
3794
3972
  contentId,
3795
3973
  apiKey: props.apiKey,
3796
3974
  variationId: variationId !== contentId ? variationId : void 0,
@@ -3853,13 +4031,8 @@ function EnableEditor(props) {
3853
4031
  }
3854
4032
  let elementRef;
3855
4033
  onMount2(() => {
3856
- if (!props.apiKey) {
3857
- logger.error(
3858
- "No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."
3859
- );
3860
- }
3861
4034
  if (isBrowser()) {
3862
- if (isEditing()) {
4035
+ if (isEditing() && true) {
3863
4036
  setForceReRenderCount(forceReRenderCount() + 1);
3864
4037
  window.addEventListener("message", processMessage);
3865
4038
  registerInsertMenu();
@@ -3885,18 +4058,20 @@ function EnableEditor(props) {
3885
4058
  emitStateUpdate
3886
4059
  );
3887
4060
  }
3888
- if (props.builderContextSignal.content) {
4061
+ const shouldTrackImpression = props.builderContextSignal.content && getDefaultCanTrack(props.canTrack);
4062
+ if (shouldTrackImpression) {
3889
4063
  const variationId = props.builderContextSignal.content?.testVariationId;
3890
4064
  const contentId = props.builderContextSignal.content?.id;
4065
+ const apiKeyProp = props.apiKey;
3891
4066
  _track({
3892
4067
  type: "impression",
3893
- canTrack: canTrackToUse(),
4068
+ canTrack: true,
3894
4069
  contentId,
3895
- apiKey: props.apiKey,
4070
+ apiKey: apiKeyProp,
3896
4071
  variationId: variationId !== contentId ? variationId : void 0
3897
4072
  });
3898
4073
  }
3899
- if (isPreviewing()) {
4074
+ if (isPreviewing() && true) {
3900
4075
  const searchParams = new URL(location.href).searchParams;
3901
4076
  const searchParamPreviewModel = searchParams.get("builder.preview");
3902
4077
  const searchParamPreviewId = searchParams.get(
@@ -3915,11 +4090,18 @@ function EnableEditor(props) {
3915
4090
  });
3916
4091
  }
3917
4092
  }
3918
- evaluateJsCode();
3919
- runHttpRequests();
3920
- emitStateUpdate();
3921
4093
  }
3922
4094
  });
4095
+ onMount2(() => {
4096
+ if (!props.apiKey) {
4097
+ logger.error(
4098
+ "No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."
4099
+ );
4100
+ }
4101
+ evaluateJsCode();
4102
+ runHttpRequests();
4103
+ emitStateUpdate();
4104
+ });
3923
4105
  function onUpdateFn_0() {
3924
4106
  if (props.content) {
3925
4107
  mergeNewContent(props.content);
@@ -3956,6 +4138,7 @@ function EnableEditor(props) {
3956
4138
  createEffect2(on2(() => [props.builderContextSignal.rootState], onUpdateFn_4));
3957
4139
  return <stdin_default.Provider value={props.builderContextSignal}><Show9 when={props.builderContextSignal.content}><div
3958
4140
  class={props.classNameProp}
4141
+ {...{}}
3959
4142
  key={forceReRenderCount()}
3960
4143
  ref={elementRef}
3961
4144
  onClick={(event) => onClick(event)}
@@ -4163,24 +4346,24 @@ function ContentVariants(props) {
4163
4346
  var Content_variants_default = ContentVariants;
4164
4347
 
4165
4348
  // src/blocks/symbol/symbol.helpers.js
4166
- var __defProp17 = Object.defineProperty;
4167
- var __getOwnPropSymbols17 = Object.getOwnPropertySymbols;
4168
- var __hasOwnProp17 = Object.prototype.hasOwnProperty;
4169
- var __propIsEnum17 = Object.prototype.propertyIsEnumerable;
4170
- var __defNormalProp17 = (obj, key, value) => key in obj ? __defProp17(obj, key, {
4349
+ var __defProp18 = Object.defineProperty;
4350
+ var __getOwnPropSymbols18 = Object.getOwnPropertySymbols;
4351
+ var __hasOwnProp18 = Object.prototype.hasOwnProperty;
4352
+ var __propIsEnum18 = Object.prototype.propertyIsEnumerable;
4353
+ var __defNormalProp18 = (obj, key, value) => key in obj ? __defProp18(obj, key, {
4171
4354
  enumerable: true,
4172
4355
  configurable: true,
4173
4356
  writable: true,
4174
4357
  value
4175
4358
  }) : obj[key] = value;
4176
- var __spreadValues17 = (a, b) => {
4359
+ var __spreadValues18 = (a, b) => {
4177
4360
  for (var prop in b || (b = {}))
4178
- if (__hasOwnProp17.call(b, prop))
4179
- __defNormalProp17(a, prop, b[prop]);
4180
- if (__getOwnPropSymbols17)
4181
- for (var prop of __getOwnPropSymbols17(b)) {
4182
- if (__propIsEnum17.call(b, prop))
4183
- __defNormalProp17(a, prop, b[prop]);
4361
+ if (__hasOwnProp18.call(b, prop))
4362
+ __defNormalProp18(a, prop, b[prop]);
4363
+ if (__getOwnPropSymbols18)
4364
+ for (var prop of __getOwnPropSymbols18(b)) {
4365
+ if (__propIsEnum18.call(b, prop))
4366
+ __defNormalProp18(a, prop, b[prop]);
4184
4367
  }
4185
4368
  return a;
4186
4369
  };
@@ -4209,7 +4392,7 @@ var fetchSymbolContent = (_0) => __async6(void 0, [_0], function* ({
4209
4392
  symbol
4210
4393
  }) {
4211
4394
  if ((symbol == null ? void 0 : symbol.model) && (builderContextValue == null ? void 0 : builderContextValue.apiKey)) {
4212
- return fetchOneEntry(__spreadValues17({
4395
+ return fetchOneEntry(__spreadValues18({
4213
4396
  model: symbol.model,
4214
4397
  apiKey: builderContextValue.apiKey,
4215
4398
  apiVersion: builderContextValue.apiVersion
@@ -4290,30 +4473,30 @@ function setEditorSettings(newSettings) {
4290
4473
  }
4291
4474
 
4292
4475
  // src/functions/fetch-builder-props.js
4293
- var __defProp18 = Object.defineProperty;
4294
- var __defProps12 = Object.defineProperties;
4295
- var __getOwnPropDescs12 = Object.getOwnPropertyDescriptors;
4296
- var __getOwnPropSymbols18 = Object.getOwnPropertySymbols;
4297
- var __hasOwnProp18 = Object.prototype.hasOwnProperty;
4298
- var __propIsEnum18 = Object.prototype.propertyIsEnumerable;
4299
- var __defNormalProp18 = (obj, key, value) => key in obj ? __defProp18(obj, key, {
4476
+ var __defProp19 = Object.defineProperty;
4477
+ var __defProps13 = Object.defineProperties;
4478
+ var __getOwnPropDescs13 = Object.getOwnPropertyDescriptors;
4479
+ var __getOwnPropSymbols19 = Object.getOwnPropertySymbols;
4480
+ var __hasOwnProp19 = Object.prototype.hasOwnProperty;
4481
+ var __propIsEnum19 = Object.prototype.propertyIsEnumerable;
4482
+ var __defNormalProp19 = (obj, key, value) => key in obj ? __defProp19(obj, key, {
4300
4483
  enumerable: true,
4301
4484
  configurable: true,
4302
4485
  writable: true,
4303
4486
  value
4304
4487
  }) : obj[key] = value;
4305
- var __spreadValues18 = (a, b) => {
4488
+ var __spreadValues19 = (a, b) => {
4306
4489
  for (var prop in b || (b = {}))
4307
- if (__hasOwnProp18.call(b, prop))
4308
- __defNormalProp18(a, prop, b[prop]);
4309
- if (__getOwnPropSymbols18)
4310
- for (var prop of __getOwnPropSymbols18(b)) {
4311
- if (__propIsEnum18.call(b, prop))
4312
- __defNormalProp18(a, prop, b[prop]);
4490
+ if (__hasOwnProp19.call(b, prop))
4491
+ __defNormalProp19(a, prop, b[prop]);
4492
+ if (__getOwnPropSymbols19)
4493
+ for (var prop of __getOwnPropSymbols19(b)) {
4494
+ if (__propIsEnum19.call(b, prop))
4495
+ __defNormalProp19(a, prop, b[prop]);
4313
4496
  }
4314
4497
  return a;
4315
4498
  };
4316
- var __spreadProps12 = (a, b) => __defProps12(a, __getOwnPropDescs12(b));
4499
+ var __spreadProps13 = (a, b) => __defProps13(a, __getOwnPropDescs13(b));
4317
4500
  var __async7 = (__this, __arguments, generator) => {
4318
4501
  return new Promise((resolve, reject) => {
4319
4502
  var fulfilled = (value) => {
@@ -4337,10 +4520,10 @@ var __async7 = (__this, __arguments, generator) => {
4337
4520
  var fetchBuilderProps = (_args) => __async7(void 0, null, function* () {
4338
4521
  var _a, _b, _c;
4339
4522
  const urlPath = _args.path || ((_a = _args.url) == null ? void 0 : _a.pathname) || ((_b = _args.userAttributes) == null ? void 0 : _b.urlPath);
4340
- const getContentArgs = __spreadProps12(__spreadValues18({}, _args), {
4523
+ const getContentArgs = __spreadProps13(__spreadValues19({}, _args), {
4341
4524
  apiKey: _args.apiKey,
4342
4525
  model: _args.model || "page",
4343
- userAttributes: __spreadValues18(__spreadValues18({}, _args.userAttributes), urlPath ? {
4526
+ userAttributes: __spreadValues19(__spreadValues19({}, _args.userAttributes), urlPath ? {
4344
4527
  urlPath
4345
4528
  } : {}),
4346
4529
  options: getBuilderSearchParams(_args.searchParams || ((_c = _args.url) == null ? void 0 : _c.searchParams) || _args.options)