@builder.io/sdk-solid 4.0.7 → 4.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/edge/dev.js CHANGED
@@ -1,4 +1,4 @@
1
- import { delegateEvents, createComponent, spread, mergeProps, insert, effect, setAttribute, className, style, template, use, Dynamic, memo } from 'solid-js/web';
1
+ import { delegateEvents, createComponent, memo, spread, mergeProps, insert, effect, setAttribute, className, style, template, use, Dynamic } from 'solid-js/web';
2
2
  import { createContext, useContext, Show, For, createMemo, onMount, createSignal, createEffect, on } from 'solid-js';
3
3
 
4
4
  var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
@@ -4399,6 +4399,7 @@ var awaiter_default = Awaiter;
4399
4399
 
4400
4400
  // src/components/block/components/interactive-element.tsx
4401
4401
  function InteractiveElement(props) {
4402
+ createSignal(0);
4402
4403
  const attributes = createMemo(() => {
4403
4404
  return props.includeBlockProps ? {
4404
4405
  ...getBlockProperties({
@@ -4417,6 +4418,11 @@ function InteractiveElement(props) {
4417
4418
  const targetWrapperProps = createMemo(() => {
4418
4419
  return props.wrapperProps;
4419
4420
  });
4421
+ const onUpdateFn_0_props_wrapperProps = createMemo(() => props.wrapperProps);
4422
+ const onUpdateFn_0_props_block__component__options = createMemo(() => props.block?.component?.options);
4423
+ function onUpdateFn_0() {
4424
+ }
4425
+ createEffect(on(() => [onUpdateFn_0_props_wrapperProps(), onUpdateFn_0_props_block__component__options()], onUpdateFn_0));
4420
4426
  return createComponent(Show, {
4421
4427
  get fallback() {
4422
4428
  return createComponent(Dynamic, mergeProps(targetWrapperProps, {
@@ -4843,7 +4849,7 @@ function Block(props) {
4843
4849
  });
4844
4850
  }
4845
4851
  var block_default = Block;
4846
- var _tmpl$2 = /* @__PURE__ */ template(`<style>.dynamic-023c60f2 {
4852
+ var _tmpl$2 = /* @__PURE__ */ template(`<style>.dynamic-450facf4 {
4847
4853
  display: flex;
4848
4854
  flex-direction: column;
4849
4855
  align-items: stretch;
@@ -4892,7 +4898,7 @@ function BlocksWrapper(props) {
4892
4898
  createEffect(on(() => [onUpdateFn_0_props_blocks()], onUpdateFn_0));
4893
4899
  return [createComponent(Dynamic, mergeProps({
4894
4900
  get ["class"]() {
4895
- return className() + " dynamic-023c60f2";
4901
+ return className() + " dynamic-450facf4";
4896
4902
  },
4897
4903
  ref(r$) {
4898
4904
  const _ref$ = blocksWrapperRef;
@@ -4939,17 +4945,17 @@ function Blocks(props) {
4939
4945
  get styleProp() {
4940
4946
  return props.styleProp;
4941
4947
  },
4948
+ get BlocksWrapperProps() {
4949
+ return props.BlocksWrapperProps || props.context?.BlocksWrapperProps || builderContext?.BlocksWrapperProps;
4950
+ },
4942
4951
  get classNameProp() {
4943
4952
  return props.className;
4944
4953
  },
4945
4954
  get BlocksWrapper() {
4946
4955
  return props.context?.BlocksWrapper || builderContext?.BlocksWrapper;
4947
4956
  },
4948
- get BlocksWrapperProps() {
4949
- return props.context?.BlocksWrapperProps || builderContext?.BlocksWrapperProps;
4950
- },
4951
4957
  get children() {
4952
- return createComponent(Show, {
4958
+ return [memo(() => props.children), createComponent(Show, {
4953
4959
  get when() {
4954
4960
  return props.blocks;
4955
4961
  },
@@ -4978,7 +4984,7 @@ function Blocks(props) {
4978
4984
  }
4979
4985
  });
4980
4986
  }
4981
- });
4987
+ })];
4982
4988
  }
4983
4989
  });
4984
4990
  }
@@ -5403,6 +5409,166 @@ function SectionComponent(props) {
5403
5409
  }
5404
5410
  var section_default = SectionComponent;
5405
5411
 
5412
+ // src/blocks/personalization-container/helpers/inlined-fns.ts
5413
+ function filterWithCustomTargeting(userAttributes, query, startDate, endDate) {
5414
+ function isString(val) {
5415
+ return typeof val === "string";
5416
+ }
5417
+ function isNumber(val) {
5418
+ return typeof val === "number";
5419
+ }
5420
+ function objectMatchesQuery(userattr, query2) {
5421
+ const result = (() => {
5422
+ const property = query2.property;
5423
+ const operator = query2.operator;
5424
+ let testValue = query2.value;
5425
+ if (query2 && query2.property === "urlPath" && query2.value && typeof query2.value === "string" && query2.value !== "/" && query2.value.endsWith("/")) {
5426
+ testValue = query2.value.slice(0, -1);
5427
+ }
5428
+ if (!(property && operator)) {
5429
+ return true;
5430
+ }
5431
+ if (Array.isArray(testValue)) {
5432
+ if (operator === "isNot") {
5433
+ return testValue.every((val) => objectMatchesQuery(userattr, {
5434
+ property,
5435
+ operator,
5436
+ value: val
5437
+ }));
5438
+ }
5439
+ return !!testValue.find((val) => objectMatchesQuery(userattr, {
5440
+ property,
5441
+ operator,
5442
+ value: val
5443
+ }));
5444
+ }
5445
+ const value = userattr[property];
5446
+ if (Array.isArray(value)) {
5447
+ return value.includes(testValue);
5448
+ }
5449
+ switch (operator) {
5450
+ case "is":
5451
+ return value === testValue;
5452
+ case "isNot":
5453
+ return value !== testValue;
5454
+ case "contains":
5455
+ return (isString(value) || Array.isArray(value)) && value.includes(String(testValue));
5456
+ case "startsWith":
5457
+ return isString(value) && value.startsWith(String(testValue));
5458
+ case "endsWith":
5459
+ return isString(value) && value.endsWith(String(testValue));
5460
+ case "greaterThan":
5461
+ return isNumber(value) && isNumber(testValue) && value > testValue;
5462
+ case "lessThan":
5463
+ return isNumber(value) && isNumber(testValue) && value < testValue;
5464
+ case "greaterThanOrEqualTo":
5465
+ return isNumber(value) && isNumber(testValue) && value >= testValue;
5466
+ case "lessThanOrEqualTo":
5467
+ return isNumber(value) && isNumber(testValue) && value <= testValue;
5468
+ default:
5469
+ return false;
5470
+ }
5471
+ })();
5472
+ return result;
5473
+ }
5474
+ const item = {
5475
+ query,
5476
+ startDate,
5477
+ endDate
5478
+ };
5479
+ const now = userAttributes.date && new Date(userAttributes.date) || /* @__PURE__ */ new Date();
5480
+ if (item.startDate && new Date(item.startDate) > now) {
5481
+ return false;
5482
+ } else if (item.endDate && new Date(item.endDate) < now) {
5483
+ return false;
5484
+ }
5485
+ if (!item.query || !item.query.length) {
5486
+ return true;
5487
+ }
5488
+ return item.query.every((filter) => {
5489
+ return objectMatchesQuery(userAttributes, filter);
5490
+ });
5491
+ }
5492
+ var PERSONALIZATION_SCRIPT = "function getPersonalizedVariant(variants, blockId, isHydrationTarget, locale) {\n if (!navigator.cookieEnabled) {\n return;\n }\n function getCookie(name) {\n const nameEQ = name + '=';\n const ca = document.cookie.split(';');\n for (let i = 0; i < ca.length; i++) {\n let c = ca[i];\n while (c.charAt(0) == ' ') c = c.substring(1, c.length);\n if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);\n }\n return null;\n }\n const attributes = JSON.parse(getCookie('builder.userAttributes') || '{}');\n if (locale) {\n attributes.locale = locale;\n }\n const winningVariantIndex = variants?.findIndex(function (variant) {\n return window.filterWithCustomTargeting(attributes, variant.query, variant.startDate, variant.endDate);\n });\n const parentDiv = document.currentScript?.parentElement;\n const variantId = parentDiv?.getAttribute('data-variant-id');\n const isDefaultVariant = variantId === `${blockId}-default`;\n const isWinningVariant = winningVariantIndex !== -1 && variantId === `${blockId}-${winningVariantIndex}` || winningVariantIndex === -1 && isDefaultVariant;\n if (isWinningVariant && !isDefaultVariant) {\n parentDiv?.removeAttribute('hidden');\n parentDiv?.removeAttribute('aria-hidden');\n } else if (!isWinningVariant && isDefaultVariant) {\n parentDiv?.setAttribute('hidden', 'true');\n parentDiv?.setAttribute('aria-hidden', 'true');\n }\n if (isHydrationTarget) {\n if (!isWinningVariant) {\n const itsStyleEl = parentDiv?.previousElementSibling;\n if (itsStyleEl) {\n itsStyleEl.remove();\n }\n parentDiv?.remove();\n }\n const thisScript = document.currentScript;\n if (thisScript) {\n thisScript.remove();\n }\n }\n}";
5493
+ var FILTER_WITH_CUSTOM_TARGETING_SCRIPT = "function filterWithCustomTargeting(userAttributes, query, startDate, endDate) {\n function isString(val) {\n return typeof val === 'string';\n }\n function isNumber(val) {\n return typeof val === 'number';\n }\n function objectMatchesQuery(userattr, query) {\n const result = (() => {\n const property = query.property;\n const operator = query.operator;\n let testValue = query.value;\n if (query && query.property === 'urlPath' && query.value && typeof query.value === 'string' && query.value !== '/' && query.value.endsWith('/')) {\n testValue = query.value.slice(0, -1);\n }\n if (!(property && operator)) {\n return true;\n }\n if (Array.isArray(testValue)) {\n if (operator === 'isNot') {\n return testValue.every(val => objectMatchesQuery(userattr, {\n property,\n operator,\n value: val\n }));\n }\n return !!testValue.find(val => objectMatchesQuery(userattr, {\n property,\n operator,\n value: val\n }));\n }\n const value = userattr[property];\n if (Array.isArray(value)) {\n return value.includes(testValue);\n }\n switch (operator) {\n case 'is':\n return value === testValue;\n case 'isNot':\n return value !== testValue;\n case 'contains':\n return (isString(value) || Array.isArray(value)) && value.includes(String(testValue));\n case 'startsWith':\n return isString(value) && value.startsWith(String(testValue));\n case 'endsWith':\n return isString(value) && value.endsWith(String(testValue));\n case 'greaterThan':\n return isNumber(value) && isNumber(testValue) && value > testValue;\n case 'lessThan':\n return isNumber(value) && isNumber(testValue) && value < testValue;\n case 'greaterThanOrEqualTo':\n return isNumber(value) && isNumber(testValue) && value >= testValue;\n case 'lessThanOrEqualTo':\n return isNumber(value) && isNumber(testValue) && value <= testValue;\n default:\n return false;\n }\n })();\n return result;\n }\n const item = {\n query,\n startDate,\n endDate\n };\n const now = userAttributes.date && new Date(userAttributes.date) || new Date();\n if (item.startDate && new Date(item.startDate) > now) {\n return false;\n } else if (item.endDate && new Date(item.endDate) < now) {\n return false;\n }\n if (!item.query || !item.query.length) {\n return true;\n }\n return item.query.every(filter => {\n return objectMatchesQuery(userAttributes, filter);\n });\n}";
5494
+ var UPDATE_VISIBILITY_STYLES_SCRIPT = "function updateVisibilityStylesScript(variants, blockId, isHydrationTarget, locale) {\n function getCookie(name) {\n const nameEQ = name + '=';\n const ca = document.cookie.split(';');\n for (let i = 0; i < ca.length; i++) {\n let c = ca[i];\n while (c.charAt(0) == ' ') c = c.substring(1, c.length);\n if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);\n }\n return null;\n }\n const visibilityStylesEl = document.currentScript?.previousElementSibling;\n if (!visibilityStylesEl) {\n return;\n }\n if (isHydrationTarget) {\n visibilityStylesEl.remove();\n const currentScript = document.currentScript;\n if (currentScript) {\n currentScript.remove();\n }\n } else {\n const attributes = JSON.parse(getCookie('builder.userAttributes') || '{}');\n if (locale) {\n attributes.locale = locale;\n }\n const winningVariantIndex = variants?.findIndex(function (variant) {\n return window.filterWithCustomTargeting(attributes, variant.query, variant.startDate, variant.endDate);\n });\n if (winningVariantIndex !== -1) {\n let newStyleStr = variants?.map((_, index) => {\n if (index === winningVariantIndex) return '';\n return `div[data-variant-id=\"${blockId}-${index}\"] { display: none !important; } `;\n }).join('') || '';\n newStyleStr += `div[data-variant-id=\"${blockId}-default\"] { display: none !important; } `;\n visibilityStylesEl.innerHTML = newStyleStr;\n }\n }\n}";
5495
+
5496
+ // src/blocks/personalization-container/helpers.ts
5497
+ var DEFAULT_INDEX = "default";
5498
+ var FILTER_WITH_CUSTOM_TARGETING_SCRIPT_FN_NAME = "filterWithCustomTargeting";
5499
+ var BUILDER_IO_PERSONALIZATION_SCRIPT_FN_NAME = "builderIoPersonalization";
5500
+ var UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME = "updateVisibilityStylesScript";
5501
+ var SDKS_SUPPORTING_PERSONALIZATION = ["react", "vue", "svelte"];
5502
+ var SDKS_REQUIRING_RESET_APPROACH = ["vue", "svelte"];
5503
+ function checkShouldRenderVariants(variants, canTrack) {
5504
+ const hasVariants = variants && variants.length > 0;
5505
+ if (TARGET === "reactNative")
5506
+ return false;
5507
+ if (!hasVariants)
5508
+ return false;
5509
+ if (!canTrack)
5510
+ return false;
5511
+ if (SDKS_REQUIRING_RESET_APPROACH.includes(TARGET))
5512
+ return true;
5513
+ if (isBrowser())
5514
+ return false;
5515
+ return true;
5516
+ }
5517
+ function getBlocksToRender({
5518
+ variants,
5519
+ previewingIndex,
5520
+ isHydrated,
5521
+ filteredVariants,
5522
+ fallbackBlocks
5523
+ }) {
5524
+ const fallback = {
5525
+ blocks: fallbackBlocks ?? [],
5526
+ path: "this.children",
5527
+ index: DEFAULT_INDEX
5528
+ };
5529
+ if (isHydrated && isEditing()) {
5530
+ if (typeof previewingIndex === "number" && previewingIndex < (variants?.length ?? 0)) {
5531
+ const variant = variants?.[previewingIndex];
5532
+ if (variant) {
5533
+ return {
5534
+ blocks: variant.blocks,
5535
+ path: `variants.${previewingIndex}.blocks`,
5536
+ index: previewingIndex
5537
+ };
5538
+ }
5539
+ }
5540
+ return fallback;
5541
+ }
5542
+ if (isBrowser()) {
5543
+ const winningVariant = filteredVariants?.[0];
5544
+ if (winningVariant && variants) {
5545
+ const variantIndex = variants.indexOf(winningVariant);
5546
+ if (variantIndex !== -1) {
5547
+ return {
5548
+ blocks: winningVariant.blocks,
5549
+ path: `variants.${variantIndex}.blocks`,
5550
+ index: variantIndex
5551
+ };
5552
+ }
5553
+ }
5554
+ }
5555
+ return fallback;
5556
+ }
5557
+ var getInitPersonalizationVariantsFnsScriptString = () => {
5558
+ return `
5559
+ window.${FILTER_WITH_CUSTOM_TARGETING_SCRIPT_FN_NAME} = ${FILTER_WITH_CUSTOM_TARGETING_SCRIPT}
5560
+ window.${BUILDER_IO_PERSONALIZATION_SCRIPT_FN_NAME} = ${PERSONALIZATION_SCRIPT}
5561
+ window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME} = ${UPDATE_VISIBILITY_STYLES_SCRIPT}
5562
+ `;
5563
+ };
5564
+ var isHydrationTarget = TARGET === "react";
5565
+ var getPersonalizationScript = (variants, blockId, locale) => {
5566
+ return `window.${BUILDER_IO_PERSONALIZATION_SCRIPT_FN_NAME}(${JSON.stringify(variants)}, "${blockId}", ${isHydrationTarget}${locale ? `, "${locale}"` : ""})`;
5567
+ };
5568
+ var getUpdateVisibilityStylesScript = (variants, blockId, locale) => {
5569
+ return `window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME}(${JSON.stringify(variants)}, "${blockId}", ${isHydrationTarget}${locale ? `, "${locale}"` : ""})`;
5570
+ };
5571
+
5406
5572
  // src/helpers/url.ts
5407
5573
  var getTopLevelDomain = (host) => {
5408
5574
  if (host === "localhost" || host === "127.0.0.1") {
@@ -6382,7 +6548,8 @@ var componentInfo6 = {
6382
6548
  name: "PersonalizationContainer",
6383
6549
  shouldReceiveBuilderProps: {
6384
6550
  builderBlock: true,
6385
- builderContext: true
6551
+ builderContext: true,
6552
+ builderComponents: true
6386
6553
  },
6387
6554
  noWrap: true,
6388
6555
  image: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F37229ed30d8c41dfb10b8cca1992053a",
@@ -6444,208 +6611,22 @@ function isPreviewing(_search) {
6444
6611
  return Boolean(normalizedSearch.indexOf("builder.preview=") !== -1);
6445
6612
  }
6446
6613
 
6447
- // src/blocks/personalization-container/helpers/inlined-fns.ts
6448
- function filterWithCustomTargeting(userAttributes, query, startDate, endDate) {
6449
- function isString(val) {
6450
- return typeof val === "string";
6451
- }
6452
- function isNumber(val) {
6453
- return typeof val === "number";
6454
- }
6455
- function objectMatchesQuery(userattr, query2) {
6456
- const result = (() => {
6457
- const property = query2.property;
6458
- const operator = query2.operator;
6459
- let testValue = query2.value;
6460
- if (query2 && query2.property === "urlPath" && query2.value && typeof query2.value === "string" && query2.value !== "/" && query2.value.endsWith("/")) {
6461
- testValue = query2.value.slice(0, -1);
6462
- }
6463
- if (!(property && operator)) {
6464
- return true;
6465
- }
6466
- if (Array.isArray(testValue)) {
6467
- if (operator === "isNot") {
6468
- return testValue.every((val) => objectMatchesQuery(userattr, {
6469
- property,
6470
- operator,
6471
- value: val
6472
- }));
6473
- }
6474
- return !!testValue.find((val) => objectMatchesQuery(userattr, {
6475
- property,
6476
- operator,
6477
- value: val
6478
- }));
6479
- }
6480
- const value = userattr[property];
6481
- if (Array.isArray(value)) {
6482
- return value.includes(testValue);
6483
- }
6484
- switch (operator) {
6485
- case "is":
6486
- return value === testValue;
6487
- case "isNot":
6488
- return value !== testValue;
6489
- case "contains":
6490
- return (isString(value) || Array.isArray(value)) && value.includes(String(testValue));
6491
- case "startsWith":
6492
- return isString(value) && value.startsWith(String(testValue));
6493
- case "endsWith":
6494
- return isString(value) && value.endsWith(String(testValue));
6495
- case "greaterThan":
6496
- return isNumber(value) && isNumber(testValue) && value > testValue;
6497
- case "lessThan":
6498
- return isNumber(value) && isNumber(testValue) && value < testValue;
6499
- case "greaterThanOrEqualTo":
6500
- return isNumber(value) && isNumber(testValue) && value >= testValue;
6501
- case "lessThanOrEqualTo":
6502
- return isNumber(value) && isNumber(testValue) && value <= testValue;
6503
- default:
6504
- return false;
6505
- }
6506
- })();
6507
- return result;
6508
- }
6509
- const item = {
6510
- query,
6511
- startDate,
6512
- endDate
6513
- };
6514
- const now = userAttributes.date && new Date(userAttributes.date) || /* @__PURE__ */ new Date();
6515
- if (item.startDate && new Date(item.startDate) > now) {
6516
- return false;
6517
- } else if (item.endDate && new Date(item.endDate) < now) {
6518
- return false;
6519
- }
6520
- if (!item.query || !item.query.length) {
6521
- return true;
6522
- }
6523
- return item.query.every((filter) => {
6524
- return objectMatchesQuery(userAttributes, filter);
6525
- });
6526
- }
6527
- var PERSONALIZATION_SCRIPT = `function getPersonalizedVariant(variants, blockId, locale) {
6528
- if (!navigator.cookieEnabled) {
6529
- return;
6530
- }
6531
- function getCookie(name) {
6532
- const nameEQ = name + '=';
6533
- const ca = document.cookie.split(';');
6534
- for (let i = 0; i < ca.length; i++) {
6535
- let c = ca[i];
6536
- while (c.charAt(0) == ' ') c = c.substring(1, c.length);
6537
- if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
6538
- }
6539
- return null;
6540
- }
6541
- function removeVariants() {
6542
- variants?.forEach(function (_, index) {
6543
- document.querySelector('template[data-variant-id="' + blockId + '-' + index + '"]')?.remove();
6544
- });
6545
- document.querySelector('script[data-id="variants-script-' + blockId + '"]')?.remove();
6546
- document.querySelector('style[data-id="variants-styles-' + blockId + '"]')?.remove();
6547
- }
6548
- const attributes = JSON.parse(getCookie('builder.userAttributes') || '{}');
6549
- if (locale) {
6550
- attributes.locale = locale;
6551
- }
6552
- const winningVariantIndex = variants?.findIndex(function (variant) {
6553
- return filterWithCustomTargeting(attributes, variant.query, variant.startDate, variant.endDate);
6554
- });
6555
- const isDebug = location.href.includes('builder.debug=true');
6556
- if (isDebug) {
6557
- console.debug('PersonalizationContainer', {
6558
- attributes,
6559
- variants,
6560
- winningVariantIndex
6561
- });
6562
- }
6563
- if (winningVariantIndex !== -1) {
6564
- const winningVariant = document.querySelector('template[data-variant-id="' + blockId + '-' + winningVariantIndex + '"]');
6565
- if (winningVariant) {
6566
- const parentNode = winningVariant.parentNode;
6567
- if (parentNode) {
6568
- const newParent = parentNode.cloneNode(false);
6569
- newParent.appendChild(winningVariant.content.firstChild);
6570
- newParent.appendChild(winningVariant.content.lastChild);
6571
- parentNode.parentNode?.replaceChild(newParent, parentNode);
6572
- }
6573
- if (isDebug) {
6574
- console.debug('PersonalizationContainer', 'Winning variant Replaced:', winningVariant);
6575
- }
6576
- }
6577
- } else if (variants && variants.length > 0) {
6578
- removeVariants();
6579
- }
6580
- }`;
6581
- var FILTER_WITH_CUSTOM_TARGETING_SCRIPT = "function filterWithCustomTargeting(userAttributes, query, startDate, endDate) {\n function isString(val) {\n return typeof val === 'string';\n }\n function isNumber(val) {\n return typeof val === 'number';\n }\n function objectMatchesQuery(userattr, query) {\n const result = (() => {\n const property = query.property;\n const operator = query.operator;\n let testValue = query.value;\n if (query && query.property === 'urlPath' && query.value && typeof query.value === 'string' && query.value !== '/' && query.value.endsWith('/')) {\n testValue = query.value.slice(0, -1);\n }\n if (!(property && operator)) {\n return true;\n }\n if (Array.isArray(testValue)) {\n if (operator === 'isNot') {\n return testValue.every(val => objectMatchesQuery(userattr, {\n property,\n operator,\n value: val\n }));\n }\n return !!testValue.find(val => objectMatchesQuery(userattr, {\n property,\n operator,\n value: val\n }));\n }\n const value = userattr[property];\n if (Array.isArray(value)) {\n return value.includes(testValue);\n }\n switch (operator) {\n case 'is':\n return value === testValue;\n case 'isNot':\n return value !== testValue;\n case 'contains':\n return (isString(value) || Array.isArray(value)) && value.includes(String(testValue));\n case 'startsWith':\n return isString(value) && value.startsWith(String(testValue));\n case 'endsWith':\n return isString(value) && value.endsWith(String(testValue));\n case 'greaterThan':\n return isNumber(value) && isNumber(testValue) && value > testValue;\n case 'lessThan':\n return isNumber(value) && isNumber(testValue) && value < testValue;\n case 'greaterThanOrEqualTo':\n return isNumber(value) && isNumber(testValue) && value >= testValue;\n case 'lessThanOrEqualTo':\n return isNumber(value) && isNumber(testValue) && value <= testValue;\n default:\n return false;\n }\n })();\n return result;\n }\n const item = {\n query,\n startDate,\n endDate\n };\n const now = userAttributes.date && new Date(userAttributes.date) || new Date();\n if (item.startDate && new Date(item.startDate) > now) {\n return false;\n } else if (item.endDate && new Date(item.endDate) < now) {\n return false;\n }\n if (!item.query || !item.query.length) {\n return true;\n }\n return item.query.every(filter => {\n return objectMatchesQuery(userAttributes, filter);\n });\n}";
6582
-
6583
- // src/blocks/personalization-container/helpers.ts
6584
- function checkShouldRenderVariants(variants, canTrack) {
6585
- const hasVariants = variants && variants.length > 0;
6586
- if (TARGET === "reactNative")
6587
- return false;
6588
- if (!hasVariants)
6589
- return false;
6590
- if (!canTrack)
6591
- return false;
6592
- if (TARGET === "vue" || TARGET === "svelte")
6593
- return true;
6594
- if (isBrowser())
6595
- return false;
6596
- return true;
6597
- }
6598
- function getBlocksToRender({
6599
- variants,
6600
- previewingIndex,
6601
- isHydrated,
6602
- filteredVariants,
6603
- fallbackBlocks
6604
- }) {
6605
- const fallback = {
6606
- blocks: fallbackBlocks ?? [],
6607
- path: "this.children"
6608
- };
6609
- if (isHydrated && isEditing()) {
6610
- if (typeof previewingIndex === "number" && previewingIndex < (variants?.length ?? 0)) {
6611
- const variant = variants[previewingIndex];
6612
- return {
6613
- blocks: variant.blocks,
6614
- path: `component.options.variants.${previewingIndex}.blocks`
6615
- };
6616
- }
6617
- return fallback;
6618
- }
6619
- if (isBrowser()) {
6620
- const winningVariant = filteredVariants?.[0];
6621
- if (winningVariant) {
6622
- return {
6623
- blocks: winningVariant.blocks,
6624
- path: `component.options.variants.${variants?.indexOf(winningVariant)}.blocks`
6625
- };
6626
- }
6627
- }
6628
- return fallback;
6629
- }
6630
- var getPersonalizationScript = (variants, blockId, locale) => {
6631
- return `
6632
- (function() {
6633
- ${FILTER_WITH_CUSTOM_TARGETING_SCRIPT}
6634
- ${PERSONALIZATION_SCRIPT}
6635
- getPersonalizedVariant(${JSON.stringify(variants)}, "${blockId}"${locale ? `, "${locale}"` : ""})
6636
- })();
6637
- `;
6638
- };
6639
-
6640
6614
  // src/blocks/personalization-container/personalization-container.tsx
6641
6615
  var _tmpl$9 = /* @__PURE__ */ template(`<div>`);
6642
- var _tmpl$25 = /* @__PURE__ */ template(`<template>`);
6643
6616
  function PersonalizationContainer(props) {
6644
6617
  const [userAttributes, setUserAttributes] = createSignal(userAttributesService.getUserAttributes());
6645
6618
  const [scriptStr, setScriptStr] = createSignal(getPersonalizationScript(props.variants, props.builderBlock?.id || "none", props.builderContext?.rootState?.locale));
6619
+ const [updateVisibilityStylesScript, setUpdateVisibilityStylesScript] = createSignal(getUpdateVisibilityStylesScript(props.variants, props.builderBlock?.id || "none", props.builderContext?.rootState?.locale));
6646
6620
  const [unsubscribers, setUnsubscribers] = createSignal([]);
6647
6621
  const [shouldRenderVariants, setShouldRenderVariants] = createSignal(checkShouldRenderVariants(props.variants, getDefaultCanTrack(props.builderContext?.canTrack)));
6648
- const [isHydrated, setIsHydrated] = createSignal(false);
6622
+ const [shouldResetVariants, setShouldResetVariants] = createSignal(false);
6623
+ const attrs = createMemo(() => {
6624
+ return {
6625
+ ...props.attributes,
6626
+ ...{},
6627
+ [getClassPropName()]: `builder-personalization-container ${props.attributes[getClassPropName()] || ""}`
6628
+ };
6629
+ });
6649
6630
  const filteredVariants = createMemo(() => {
6650
6631
  return (props.variants || []).filter((variant) => {
6651
6632
  return filterWithCustomTargeting({
@@ -6660,26 +6641,26 @@ function PersonalizationContainer(props) {
6660
6641
  return getBlocksToRender({
6661
6642
  variants: props.variants,
6662
6643
  fallbackBlocks: props.builderBlock?.children,
6663
- isHydrated: isHydrated(),
6644
+ isHydrated: shouldResetVariants(),
6664
6645
  filteredVariants: filteredVariants(),
6665
6646
  previewingIndex: props.previewingIndex
6666
6647
  });
6667
6648
  });
6668
6649
  const hideVariantsStyleString = createMemo(() => {
6669
- return (props.variants || []).map((_, index) => `[data-variant-id="${props.builderBlock?.id}-${index}"] { display: none; } `).join("");
6650
+ return (props.variants || []).map((_, index) => `div[data-variant-id="${props.builderBlock?.id}-${index}"] { display: none !important; } `).join("");
6670
6651
  });
6671
6652
  let rootRef;
6672
6653
  onMount(() => {
6673
- setIsHydrated(true);
6674
- const unsub = userAttributesService.subscribeOnUserAttributesChange((attrs) => {
6675
- setUserAttributes(attrs);
6654
+ setShouldResetVariants(true);
6655
+ const unsub = userAttributesService.subscribeOnUserAttributesChange((attrs2) => {
6656
+ setUserAttributes(attrs2);
6676
6657
  });
6677
6658
  if (!(isEditing() || isPreviewing())) {
6678
6659
  const variant = filteredVariants()[0];
6679
6660
  if (rootRef) {
6680
6661
  rootRef.dispatchEvent(new CustomEvent("builder.variantLoaded", {
6681
6662
  detail: {
6682
- variant: variant || "default",
6663
+ variant: variant || DEFAULT_INDEX,
6683
6664
  content: props.builderContext?.content
6684
6665
  },
6685
6666
  bubbles: true
@@ -6689,7 +6670,7 @@ function PersonalizationContainer(props) {
6689
6670
  if (entry.isIntersecting && rootRef) {
6690
6671
  rootRef.dispatchEvent(new CustomEvent("builder.variantDisplayed", {
6691
6672
  detail: {
6692
- variant: variant || "default",
6673
+ variant: variant || DEFAULT_INDEX,
6693
6674
  content: props.builderContext?.content
6694
6675
  },
6695
6676
  bubbles: true
@@ -6706,70 +6687,158 @@ function PersonalizationContainer(props) {
6706
6687
  const _el$ = _tmpl$9();
6707
6688
  const _ref$ = rootRef;
6708
6689
  typeof _ref$ === "function" ? use(_ref$, _el$) : rootRef = _el$;
6709
- spread(_el$, mergeProps({
6710
- get ["class"]() {
6711
- return `builder-personalization-container ${props.attributes?.className || ""}`;
6712
- }
6713
- }, () => props.attributes), false, true);
6690
+ spread(_el$, mergeProps(attrs), false, true);
6714
6691
  insert(_el$, createComponent(Show, {
6715
6692
  get when() {
6716
- return shouldRenderVariants();
6693
+ return memo(() => !!shouldResetVariants())() && SDKS_REQUIRING_RESET_APPROACH.includes(TARGET);
6717
6694
  },
6718
6695
  get children() {
6719
- return [createComponent(For, {
6720
- get each() {
6721
- return props.variants;
6696
+ return createComponent(blocks_default, {
6697
+ get blocks() {
6698
+ return blocksToRender().blocks;
6722
6699
  },
6723
- children: (variant, _index) => {
6724
- const index = _index();
6725
- return (() => {
6726
- const _el$2 = _tmpl$25();
6727
- setAttribute(_el$2, "key", index);
6728
- insert(_el$2, createComponent(blocks_default, {
6729
- get blocks() {
6730
- return variant.blocks;
6731
- },
6732
- get parent() {
6733
- return props.builderBlock?.id;
6734
- },
6735
- path: `component.options.variants.${index}.blocks`
6736
- }));
6737
- effect(() => setAttribute(_el$2, "data-variant-id", `${props.builderBlock?.id}-${index}`));
6738
- return _el$2;
6739
- })();
6740
- }
6741
- }), createComponent(inlined_styles_default, {
6742
- get nonce() {
6743
- return props.builderContext?.nonce || "";
6700
+ get parent() {
6701
+ return props.builderBlock?.id;
6744
6702
  },
6745
- get styles() {
6746
- return hideVariantsStyleString();
6703
+ get path() {
6704
+ return blocksToRender().path;
6747
6705
  },
6748
- get id() {
6749
- return `variants-styles-${props.builderBlock?.id}`;
6750
- }
6751
- }), createComponent(inlined_script_default, {
6752
- get nonce() {
6753
- return props.builderContext?.nonce || "";
6706
+ get context() {
6707
+ return props.builderContext;
6754
6708
  },
6755
- get scriptStr() {
6756
- return scriptStr();
6709
+ get registeredComponents() {
6710
+ return props.builderComponents;
6757
6711
  },
6758
- get id() {
6759
- return `variants-script-${props.builderBlock?.id}`;
6712
+ get BlocksWrapperProps() {
6713
+ return {
6714
+ ...props.builderContext?.BlocksWrapperProps,
6715
+ "data-variant-id": `${props.builderBlock?.id}-${blocksToRender().index}`
6716
+ };
6760
6717
  }
6761
- })];
6718
+ });
6762
6719
  }
6763
6720
  }), null);
6764
- insert(_el$, createComponent(blocks_default, {
6765
- get blocks() {
6766
- return blocksToRender().blocks;
6767
- },
6768
- get parent() {
6769
- return props.builderBlock?.id;
6721
+ insert(_el$, createComponent(Show, {
6722
+ get when() {
6723
+ return memo(() => !!!shouldResetVariants())() && SDKS_REQUIRING_RESET_APPROACH.includes(TARGET) || !SDKS_REQUIRING_RESET_APPROACH.includes(TARGET);
6770
6724
  },
6771
- get path() {
6772
- return blocksToRender().path;
6725
+ get children() {
6726
+ return [createComponent(Show, {
6727
+ get when() {
6728
+ return shouldRenderVariants();
6729
+ },
6730
+ get children() {
6731
+ return [createComponent(inlined_styles_default, {
6732
+ get nonce() {
6733
+ return props.builderContext?.nonce || "";
6734
+ },
6735
+ get styles() {
6736
+ return hideVariantsStyleString();
6737
+ },
6738
+ get id() {
6739
+ return `variants-styles-${props.builderBlock?.id}`;
6740
+ }
6741
+ }), createComponent(inlined_script_default, {
6742
+ get nonce() {
6743
+ return props.builderContext?.nonce || "";
6744
+ },
6745
+ get scriptStr() {
6746
+ return updateVisibilityStylesScript();
6747
+ },
6748
+ get id() {
6749
+ return `variants-visibility-script-${props.builderBlock?.id}`;
6750
+ }
6751
+ }), createComponent(For, {
6752
+ get each() {
6753
+ return props.variants;
6754
+ },
6755
+ children: (variant, _index) => {
6756
+ const index = _index();
6757
+ return createComponent(blocks_default, {
6758
+ get key() {
6759
+ return `${props.builderBlock?.id}-${index}`;
6760
+ },
6761
+ get BlocksWrapperProps() {
6762
+ return {
6763
+ ...props.builderContext?.BlocksWrapperProps,
6764
+ "aria-hidden": true,
6765
+ hidden: true,
6766
+ "data-variant-id": `${props.builderBlock?.id}-${index}`
6767
+ };
6768
+ },
6769
+ get blocks() {
6770
+ return variant.blocks;
6771
+ },
6772
+ get parent() {
6773
+ return props.builderBlock?.id;
6774
+ },
6775
+ path: `component.options.variants.${index}.blocks`,
6776
+ get context() {
6777
+ return props.builderContext;
6778
+ },
6779
+ get registeredComponents() {
6780
+ return props.builderComponents;
6781
+ },
6782
+ get children() {
6783
+ return createComponent(inlined_script_default, {
6784
+ get nonce() {
6785
+ return props.builderContext?.nonce || "";
6786
+ },
6787
+ get scriptStr() {
6788
+ return scriptStr();
6789
+ },
6790
+ get id() {
6791
+ return `variants-script-${props.builderBlock?.id}-${index}`;
6792
+ }
6793
+ });
6794
+ }
6795
+ });
6796
+ }
6797
+ })];
6798
+ }
6799
+ }), createComponent(blocks_default, {
6800
+ get blocks() {
6801
+ return blocksToRender().blocks;
6802
+ },
6803
+ get parent() {
6804
+ return props.builderBlock?.id;
6805
+ },
6806
+ get path() {
6807
+ return blocksToRender().path;
6808
+ },
6809
+ get context() {
6810
+ return props.builderContext;
6811
+ },
6812
+ get registeredComponents() {
6813
+ return props.builderComponents;
6814
+ },
6815
+ get BlocksWrapperProps() {
6816
+ return {
6817
+ ...props.builderContext?.BlocksWrapperProps,
6818
+ "data-variant-id": `${props.builderBlock?.id}-${blocksToRender().index}`
6819
+ };
6820
+ },
6821
+ get children() {
6822
+ return createComponent(Show, {
6823
+ get when() {
6824
+ return shouldRenderVariants();
6825
+ },
6826
+ get children() {
6827
+ return createComponent(inlined_script_default, {
6828
+ get nonce() {
6829
+ return props.builderContext?.nonce || "";
6830
+ },
6831
+ get scriptStr() {
6832
+ return scriptStr();
6833
+ },
6834
+ get id() {
6835
+ return `variants-script-${props.builderBlock?.id}-${DEFAULT_INDEX}`;
6836
+ }
6837
+ });
6838
+ }
6839
+ });
6840
+ }
6841
+ })];
6773
6842
  }
6774
6843
  }), null);
6775
6844
  return _el$;
@@ -7056,7 +7125,7 @@ var componentInfo10 = {
7056
7125
  }
7057
7126
  };
7058
7127
  var _tmpl$11 = /* @__PURE__ */ template(`<div>`);
7059
- var _tmpl$26 = /* @__PURE__ */ template(`<div><div class=builder-tabs-wrap>`);
7128
+ var _tmpl$25 = /* @__PURE__ */ template(`<div><div class=builder-tabs-wrap>`);
7060
7129
  var _tmpl$33 = /* @__PURE__ */ template(`<span>`);
7061
7130
  function Tabs(props) {
7062
7131
  const [activeTab, setActiveTab] = createSignal(props.defaultActiveTab ? props.defaultActiveTab - 1 : 0);
@@ -7071,7 +7140,7 @@ function Tabs(props) {
7071
7140
  }
7072
7141
  }
7073
7142
  return (() => {
7074
- const _el$ = _tmpl$26(), _el$2 = _el$.firstChild;
7143
+ const _el$ = _tmpl$25(), _el$2 = _el$.firstChild;
7075
7144
  _el$2.style.setProperty("display", "flex");
7076
7145
  _el$2.style.setProperty("flex-direction", "row");
7077
7146
  _el$2.style.setProperty("overflow", "auto");
@@ -7603,7 +7672,7 @@ function logFetch(url) {
7603
7672
 
7604
7673
  // src/blocks/form/form/form.tsx
7605
7674
  var _tmpl$15 = /* @__PURE__ */ template(`<pre class="builder-form-error-text pre-04a43b72">`);
7606
- var _tmpl$27 = /* @__PURE__ */ template(`<form>`);
7675
+ var _tmpl$26 = /* @__PURE__ */ template(`<form>`);
7607
7676
  var _tmpl$34 = /* @__PURE__ */ template(`<style>.pre-04a43b72 {
7608
7677
  padding: 10px;
7609
7678
  color: red;
@@ -7796,7 +7865,7 @@ function FormComponent(props) {
7796
7865
  }
7797
7866
  let formRef;
7798
7867
  return [(() => {
7799
- const _el$ = _tmpl$27();
7868
+ const _el$ = _tmpl$26();
7800
7869
  _el$.addEventListener("submit", (event) => onSubmit(event));
7801
7870
  const _ref$ = formRef;
7802
7871
  typeof _ref$ === "function" ? use(_ref$, _el$) : formRef = _el$;
@@ -8008,7 +8077,7 @@ var componentInfo16 = {
8008
8077
  noWrap: true
8009
8078
  };
8010
8079
  var _tmpl$17 = /* @__PURE__ */ template(`<select>`);
8011
- var _tmpl$28 = /* @__PURE__ */ template(`<option>`);
8080
+ var _tmpl$27 = /* @__PURE__ */ template(`<option>`);
8012
8081
  function SelectComponent(props) {
8013
8082
  return (() => {
8014
8083
  const _el$ = _tmpl$17();
@@ -8036,7 +8105,7 @@ function SelectComponent(props) {
8036
8105
  children: (option, _index) => {
8037
8106
  const index = _index();
8038
8107
  return (() => {
8039
- const _el$2 = _tmpl$28();
8108
+ const _el$2 = _tmpl$27();
8040
8109
  insert(_el$2, () => option.name || option.value);
8041
8110
  effect(() => setAttribute(_el$2, "key", `${option.name}-${index}`));
8042
8111
  effect(() => _el$2.value = option.value);
@@ -8280,7 +8349,7 @@ var componentInfo20 = {
8280
8349
  }
8281
8350
  };
8282
8351
  var _tmpl$21 = /* @__PURE__ */ template(`<div>`);
8283
- var _tmpl$29 = /* @__PURE__ */ template(`<div><video class=builder-video><source type=video/mp4>`);
8352
+ var _tmpl$28 = /* @__PURE__ */ template(`<div><video class=builder-video><source type=video/mp4>`);
8284
8353
  function Video(props) {
8285
8354
  const [lazyVideoObserver, setLazyVideoObserver] = createSignal(void 0);
8286
8355
  const videoProps = createMemo(() => {
@@ -8336,7 +8405,7 @@ function Video(props) {
8336
8405
  }
8337
8406
  });
8338
8407
  return (() => {
8339
- const _el$ = _tmpl$29(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild;
8408
+ const _el$ = _tmpl$28(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild;
8340
8409
  _el$.style.setProperty("position", "relative");
8341
8410
  const _ref$ = videoRef;
8342
8411
  typeof _ref$ === "function" ? use(_ref$, _el$2) : videoRef = _el$2;
@@ -8473,7 +8542,7 @@ var getDefaultRegisteredComponents = () => [{
8473
8542
  }, {
8474
8543
  component: text_default,
8475
8544
  ...componentInfo11
8476
- }, ...TARGET === "react" ? [{
8545
+ }, ...SDKS_SUPPORTING_PERSONALIZATION.includes(TARGET) ? [{
8477
8546
  component: personalization_container_default,
8478
8547
  ...componentInfo6
8479
8548
  }] : [], ...TARGET === "rsc" ? [] : [{
@@ -8510,7 +8579,7 @@ var UPDATE_VARIANT_VISIBILITY_SCRIPT = "function updateVariantVisibility(variant
8510
8579
 
8511
8580
  // src/components/content-variants/helpers.ts
8512
8581
  var UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME = "builderIoAbTest";
8513
- var UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME = "builderIoRenderContent";
8582
+ var UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME2 = "builderIoRenderContent";
8514
8583
  var getVariants = (content) => Object.values(content?.variations || {}).map((variant) => ({
8515
8584
  ...variant,
8516
8585
  testVariationId: variant.id,
@@ -8535,20 +8604,20 @@ var checkShouldRenderVariants2 = ({
8535
8604
  };
8536
8605
  var getIsHydrationTarget = (target) => target === "react" || target === "reactNative";
8537
8606
  var isAngularSDK = TARGET === "angular";
8538
- var isHydrationTarget = getIsHydrationTarget(TARGET);
8607
+ var isHydrationTarget2 = getIsHydrationTarget(TARGET);
8539
8608
  var getInitVariantsFnsScriptString = () => `
8540
8609
  window.${UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME} = ${UPDATE_COOKIES_AND_STYLES_SCRIPT}
8541
- window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME} = ${UPDATE_VARIANT_VISIBILITY_SCRIPT}
8610
+ window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME2} = ${UPDATE_VARIANT_VISIBILITY_SCRIPT}
8542
8611
  `;
8543
8612
  var getUpdateCookieAndStylesScript = (variants, contentId) => `
8544
8613
  window.${UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME}(
8545
- "${contentId}",${JSON.stringify(variants)}, ${isHydrationTarget}, ${isAngularSDK}
8614
+ "${contentId}",${JSON.stringify(variants)}, ${isHydrationTarget2}, ${isAngularSDK}
8546
8615
  )`;
8547
8616
  var getUpdateVariantVisibilityScript = ({
8548
8617
  contentId,
8549
8618
  variationId
8550
- }) => `window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME}(
8551
- "${variationId}", "${contentId}", ${isHydrationTarget}
8619
+ }) => `window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME2}(
8620
+ "${variationId}", "${contentId}", ${isHydrationTarget2}
8552
8621
  )`;
8553
8622
 
8554
8623
  // src/helpers/preview-lru-cache/get.ts
@@ -8557,7 +8626,7 @@ function getPreviewContent(_searchParams) {
8557
8626
  }
8558
8627
 
8559
8628
  // src/constants/sdk-version.ts
8560
- var SDK_VERSION = "4.0.7";
8629
+ var SDK_VERSION = "4.0.9";
8561
8630
 
8562
8631
  // src/helpers/sdk-headers.ts
8563
8632
  var getSdkHeaders = () => ({
@@ -9980,7 +10049,7 @@ function ContentVariants(props) {
9980
10049
  return !props.isNestedRender && TARGET !== "reactNative";
9981
10050
  },
9982
10051
  get children() {
9983
- return createComponent(inlined_script_default, {
10052
+ return [createComponent(inlined_script_default, {
9984
10053
  id: "builderio-init-variants-fns",
9985
10054
  get scriptStr() {
9986
10055
  return getInitVariantsFnsScriptString();
@@ -9988,7 +10057,22 @@ function ContentVariants(props) {
9988
10057
  get nonce() {
9989
10058
  return props.nonce || "";
9990
10059
  }
9991
- });
10060
+ }), createComponent(Show, {
10061
+ get when() {
10062
+ return SDKS_SUPPORTING_PERSONALIZATION.includes(TARGET);
10063
+ },
10064
+ get children() {
10065
+ return createComponent(inlined_script_default, {
10066
+ id: "builderio-init-personalization-variants-fns",
10067
+ get nonce() {
10068
+ return props.nonce || "";
10069
+ },
10070
+ get scriptStr() {
10071
+ return getInitPersonalizationVariantsFnsScriptString();
10072
+ }
10073
+ });
10074
+ }
10075
+ })];
9992
10076
  }
9993
10077
  }), createComponent(Show, {
9994
10078
  get when() {
@@ -10176,9 +10260,10 @@ var fetchSymbolContent = async ({
10176
10260
  };
10177
10261
 
10178
10262
  // src/blocks/symbol/symbol.tsx
10179
- var _tmpl$30 = /* @__PURE__ */ template(`<div>`);
10263
+ var _tmpl$29 = /* @__PURE__ */ template(`<div>`);
10180
10264
  function Symbol2(props) {
10181
10265
  const [contentToUse, setContentToUse] = createSignal(props.symbol?.content);
10266
+ const [symbolEntry, setSymbolEntry] = createSignal(props.symbol?.entry);
10182
10267
  const blocksWrapper = createMemo(() => {
10183
10268
  return "div";
10184
10269
  });
@@ -10189,7 +10274,7 @@ function Symbol2(props) {
10189
10274
  return [...[props.attributes[getClassPropName()]], "builder-symbol", props.symbol?.inline ? "builder-inline-symbol" : void 0, props.symbol?.dynamic || props.dynamic ? "builder-dynamic-symbol" : void 0].filter(Boolean).join(" ");
10190
10275
  });
10191
10276
  function setContent() {
10192
- if (contentToUse())
10277
+ if (contentToUse() && symbolEntry() === props.symbol?.entry)
10193
10278
  return;
10194
10279
  fetchSymbolContent({
10195
10280
  symbol: props.symbol,
@@ -10197,6 +10282,7 @@ function Symbol2(props) {
10197
10282
  }).then((newContent) => {
10198
10283
  if (newContent) {
10199
10284
  setContentToUse(newContent);
10285
+ setSymbolEntry(props.symbol?.entry);
10200
10286
  }
10201
10287
  });
10202
10288
  }
@@ -10208,7 +10294,7 @@ function Symbol2(props) {
10208
10294
  }
10209
10295
  createEffect(on(() => [onUpdateFn_0_props_symbol()], onUpdateFn_0));
10210
10296
  return (() => {
10211
- const _el$ = _tmpl$30();
10297
+ const _el$ = _tmpl$29();
10212
10298
  spread(_el$, mergeProps({
10213
10299
  get ["class"]() {
10214
10300
  return className();