@builder.io/sdk-solid 3.0.3 → 3.0.6

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.
@@ -4639,8 +4639,9 @@ function BlocksWrapper(props) {
4639
4639
  if (!props.path) {
4640
4640
  return void 0;
4641
4641
  }
4642
+ const thisPrefix = "this.";
4642
4643
  const pathPrefix = "component.options.";
4643
- return props.path.startsWith(pathPrefix) ? props.path : `${pathPrefix}${props.path || ""}`;
4644
+ return props.path.startsWith(thisPrefix) ? props.path.replace(thisPrefix, "") : props.path.startsWith(pathPrefix) ? props.path : `${pathPrefix}${props.path || ""}`;
4644
4645
  });
4645
4646
  function onClick() {
4646
4647
  if (isEditing() && !props.blocks?.length) {
@@ -4675,7 +4676,7 @@ function BlocksWrapper(props) {
4675
4676
  });
4676
4677
  return <>
4677
4678
  <Dynamic4
4678
- class={className() + " dynamic-3c4beb0c"}
4679
+ class={className() + " dynamic-3d7ff108"}
4679
4680
  ref={blocksWrapperRef}
4680
4681
  builder-path={dataPath()}
4681
4682
  builder-parent-id={props.parent}
@@ -4687,7 +4688,7 @@ function BlocksWrapper(props) {
4687
4688
  {...props.BlocksWrapperProps}
4688
4689
  component={props.BlocksWrapper}
4689
4690
  >{props.children}</Dynamic4>
4690
- <style>{`.dynamic-3c4beb0c {
4691
+ <style>{`.dynamic-3d7ff108 {
4691
4692
  display: flex;
4692
4693
  flex-direction: column;
4693
4694
  align-items: stretch;
@@ -4852,7 +4853,7 @@ function Columns(props) {
4852
4853
  }
4853
4854
  return <>
4854
4855
  <div
4855
- class={getColumnsClass(props.builderBlock?.id) + " div-3e5f33a4"}
4856
+ class={getColumnsClass(props.builderBlock?.id) + " div-6331dfc5"}
4856
4857
  style={columnsCssVars()}
4857
4858
  {...{}}
4858
4859
  >
@@ -4871,17 +4872,17 @@ function Columns(props) {
4871
4872
  ><Blocks_default
4872
4873
  path={`columns.${index}.blocks`}
4873
4874
  parent={props.builderBlock.id}
4874
- styleProp={{
4875
- flexGrow: "1"
4876
- }}
4877
4875
  context={props.builderContext}
4878
4876
  registeredComponents={props.builderComponents}
4879
4877
  linkComponent={props.builderLinkComponent}
4880
4878
  blocks={column.blocks}
4879
+ styleProp={{
4880
+ "flex-grow": "1"
4881
+ }}
4881
4882
  /></Dynamic_renderer_default>;
4882
4883
  }}</For4>
4883
4884
  </div>
4884
- <style>{`.div-3e5f33a4 {
4885
+ <style>{`.div-6331dfc5 {
4885
4886
  display: flex;
4886
4887
  line-height: normal;
4887
4888
  }`}</style>
@@ -4896,7 +4897,7 @@ function FragmentComponent(props) {
4896
4897
  var fragment_default = FragmentComponent;
4897
4898
 
4898
4899
  // src/blocks/image/image.tsx
4899
- import { Show as Show8, onMount as onMount4, createMemo as createMemo8 } from "solid-js";
4900
+ import { Show as Show8, createMemo as createMemo8 } from "solid-js";
4900
4901
 
4901
4902
  // src/blocks/image/image.helpers.ts
4902
4903
  function removeProtocol(path) {
@@ -4985,14 +4986,12 @@ function Image(props) {
4985
4986
  const out = props.aspectRatio ? aspectRatioStyles : void 0;
4986
4987
  return out;
4987
4988
  });
4988
- onMount4(() => {
4989
- });
4990
4989
  return <>
4991
4990
  <>
4992
4991
  <picture>
4993
4992
  <Show8 when={webpSrcSet()}><source type="image/webp" srcset={webpSrcSet()} /></Show8>
4994
4993
  <img
4995
- class={"builder-image" + (props.className ? " " + props.className : "") + " img-56e07140"}
4994
+ class={"builder-image" + (props.className ? " " + props.className : "") + " img-dc6700b4"}
4996
4995
  loading={props.highPriority ? "eager" : "lazy"}
4997
4996
  fetchpriority={props.highPriority ? "high" : "auto"}
4998
4997
  alt={props.altText}
@@ -5010,22 +5009,22 @@ function Image(props) {
5010
5009
  <Show8
5011
5010
  when={props.aspectRatio && !(props.builderBlock?.children?.length && props.fitContent)}
5012
5011
  ><div
5013
- class="builder-image-sizer div-56e07140"
5012
+ class="builder-image-sizer div-dc6700b4"
5014
5013
  style={{
5015
5014
  "padding-top": props.aspectRatio * 100 + "%"
5016
5015
  }}
5017
5016
  /></Show8>
5018
5017
  <Show8 when={props.builderBlock?.children?.length && props.fitContent}>{props.children}</Show8>
5019
- <Show8 when={!props.fitContent && props.builderBlock?.children?.length}><div class="div-56e07140-2">{props.children}</div></Show8>
5018
+ <Show8 when={!props.fitContent && props.builderBlock?.children?.length}><div class="div-dc6700b4-2">{props.children}</div></Show8>
5020
5019
  </>
5021
- <style>{`.img-56e07140 {
5020
+ <style>{`.img-dc6700b4 {
5022
5021
  opacity: 1;
5023
5022
  transition: opacity 0.2s ease-in-out;
5024
- }.div-56e07140 {
5023
+ }.div-dc6700b4 {
5025
5024
  width: 100%;
5026
5025
  pointer-events: none;
5027
5026
  font-size: 0;
5028
- }.div-56e07140-2 {
5027
+ }.div-dc6700b4-2 {
5029
5028
  display: flex;
5030
5029
  flex-direction: column;
5031
5030
  align-items: stretch;
@@ -5061,10 +5060,10 @@ function SectionComponent(props) {
5061
5060
  var section_default = SectionComponent;
5062
5061
 
5063
5062
  // src/blocks/symbol/symbol.tsx
5064
- import { onMount as onMount8, on as on4, createEffect as createEffect4, createMemo as createMemo19, createSignal as createSignal19 } from "solid-js";
5063
+ import { onMount as onMount8, on as on4, createEffect as createEffect4, createMemo as createMemo20, createSignal as createSignal20 } from "solid-js";
5065
5064
 
5066
5065
  // src/components/content-variants/content-variants.tsx
5067
- import { Show as Show15, For as For9, onMount as onMount7, createSignal as createSignal18, createMemo as createMemo18 } from "solid-js";
5066
+ import { Show as Show16, For as For9, onMount as onMount7, createSignal as createSignal19, createMemo as createMemo19 } from "solid-js";
5068
5067
 
5069
5068
  // src/helpers/url.ts
5070
5069
  var getTopLevelDomain = (host) => {
@@ -5254,11 +5253,61 @@ var handleABTesting = async ({
5254
5253
  };
5255
5254
  };
5256
5255
 
5256
+ // src/helpers/user-attributes.ts
5257
+ var USER_ATTRIBUTES_COOKIE_NAME = "builder.userAttributes";
5258
+ function createUserAttributesService() {
5259
+ let canTrack = true;
5260
+ const subscribers = /* @__PURE__ */ new Set();
5261
+ return {
5262
+ setUserAttributes(newAttrs) {
5263
+ if (!isBrowser()) {
5264
+ return;
5265
+ }
5266
+ const userAttributes = {
5267
+ ...this.getUserAttributes(),
5268
+ ...newAttrs
5269
+ };
5270
+ setCookie({
5271
+ name: USER_ATTRIBUTES_COOKIE_NAME,
5272
+ value: JSON.stringify(userAttributes),
5273
+ canTrack
5274
+ });
5275
+ subscribers.forEach((callback) => callback(userAttributes));
5276
+ },
5277
+ getUserAttributes() {
5278
+ if (!isBrowser()) {
5279
+ return {};
5280
+ }
5281
+ return JSON.parse(getCookieSync({
5282
+ name: USER_ATTRIBUTES_COOKIE_NAME,
5283
+ canTrack
5284
+ }) || "{}");
5285
+ },
5286
+ subscribeOnUserAttributesChange(callback) {
5287
+ subscribers.add(callback);
5288
+ return () => {
5289
+ subscribers.delete(callback);
5290
+ };
5291
+ },
5292
+ setCanTrack(value) {
5293
+ canTrack = value;
5294
+ }
5295
+ };
5296
+ }
5297
+ var userAttributesService = createUserAttributesService();
5298
+ var setClientUserAttributes = (attributes) => {
5299
+ userAttributesService.setUserAttributes(attributes);
5300
+ };
5301
+
5257
5302
  // src/helpers/canTrack.ts
5258
- var getDefaultCanTrack = (canTrack) => checkIsDefined(canTrack) ? canTrack : true;
5303
+ var getDefaultCanTrack = (canTrack) => {
5304
+ const result = checkIsDefined(canTrack) ? canTrack : true;
5305
+ userAttributesService.setCanTrack(result);
5306
+ return result;
5307
+ };
5259
5308
 
5260
5309
  // src/components/content/content.tsx
5261
- import { Show as Show14, createSignal as createSignal17 } from "solid-js";
5310
+ import { Show as Show15, createSignal as createSignal18 } from "solid-js";
5262
5311
 
5263
5312
  // src/blocks/accordion/component-info.ts
5264
5313
  var defaultTitle = {
@@ -5952,8 +6001,388 @@ var componentInfo5 = {
5952
6001
  }
5953
6002
  };
5954
6003
 
5955
- // src/blocks/section/component-info.ts
6004
+ // src/blocks/personalization-container/component-info.ts
5956
6005
  var componentInfo6 = {
6006
+ name: "PersonalizationContainer",
6007
+ shouldReceiveBuilderProps: {
6008
+ builderBlock: true,
6009
+ builderContext: true
6010
+ },
6011
+ noWrap: true,
6012
+ image: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F37229ed30d8c41dfb10b8cca1992053a",
6013
+ canHaveChildren: true,
6014
+ inputs: [{
6015
+ name: "variants",
6016
+ defaultValue: [],
6017
+ behavior: "personalizationVariantList",
6018
+ type: "list",
6019
+ subFields: [{
6020
+ name: "name",
6021
+ type: "text"
6022
+ }, {
6023
+ name: "query",
6024
+ friendlyName: "Targeting rules",
6025
+ type: "BuilderQuery",
6026
+ defaultValue: []
6027
+ }, {
6028
+ name: "startDate",
6029
+ type: "date"
6030
+ }, {
6031
+ name: "endDate",
6032
+ type: "date"
6033
+ }, {
6034
+ name: "blocks",
6035
+ type: "uiBlocks",
6036
+ hideFromUI: true,
6037
+ defaultValue: []
6038
+ }]
6039
+ }]
6040
+ };
6041
+
6042
+ // src/blocks/personalization-container/personalization-container.tsx
6043
+ import { Show as Show10, For as For6, onMount as onMount4, createSignal as createSignal10, createMemo as createMemo10 } from "solid-js";
6044
+
6045
+ // src/components/inlined-script.tsx
6046
+ function InlinedScript(props) {
6047
+ return <><script
6048
+ innerHTML={props.scriptStr}
6049
+ data-id={props.id}
6050
+ nonce={props.nonce || ""}
6051
+ /></>;
6052
+ }
6053
+ var Inlined_script_default = InlinedScript;
6054
+
6055
+ // src/functions/is-previewing.ts
6056
+ function isPreviewing(_search) {
6057
+ const search = _search || (isBrowser() ? window.location.search : void 0);
6058
+ if (!search) {
6059
+ return false;
6060
+ }
6061
+ const normalizedSearch = getSearchString(search);
6062
+ return Boolean(normalizedSearch.indexOf("builder.preview=") !== -1);
6063
+ }
6064
+
6065
+ // src/blocks/personalization-container/helpers/inlined-fns.ts
6066
+ function filterWithCustomTargeting(userAttributes, query, startDate, endDate) {
6067
+ function isString(val) {
6068
+ return typeof val === "string";
6069
+ }
6070
+ function isNumber(val) {
6071
+ return typeof val === "number";
6072
+ }
6073
+ function objectMatchesQuery(userattr, query2) {
6074
+ const result = (() => {
6075
+ const property = query2.property;
6076
+ const operator = query2.operator;
6077
+ let testValue = query2.value;
6078
+ if (query2 && query2.property === "urlPath" && query2.value && typeof query2.value === "string" && query2.value !== "/" && query2.value.endsWith("/")) {
6079
+ testValue = query2.value.slice(0, -1);
6080
+ }
6081
+ if (!(property && operator)) {
6082
+ return true;
6083
+ }
6084
+ if (Array.isArray(testValue)) {
6085
+ if (operator === "isNot") {
6086
+ return testValue.every((val) => objectMatchesQuery(userattr, {
6087
+ property,
6088
+ operator,
6089
+ value: val
6090
+ }));
6091
+ }
6092
+ return !!testValue.find((val) => objectMatchesQuery(userattr, {
6093
+ property,
6094
+ operator,
6095
+ value: val
6096
+ }));
6097
+ }
6098
+ const value = userattr[property];
6099
+ if (Array.isArray(value)) {
6100
+ return value.includes(testValue);
6101
+ }
6102
+ switch (operator) {
6103
+ case "is":
6104
+ return value === testValue;
6105
+ case "isNot":
6106
+ return value !== testValue;
6107
+ case "contains":
6108
+ return (isString(value) || Array.isArray(value)) && value.includes(String(testValue));
6109
+ case "startsWith":
6110
+ return isString(value) && value.startsWith(String(testValue));
6111
+ case "endsWith":
6112
+ return isString(value) && value.endsWith(String(testValue));
6113
+ case "greaterThan":
6114
+ return isNumber(value) && isNumber(testValue) && value > testValue;
6115
+ case "lessThan":
6116
+ return isNumber(value) && isNumber(testValue) && value < testValue;
6117
+ case "greaterThanOrEqualTo":
6118
+ return isNumber(value) && isNumber(testValue) && value >= testValue;
6119
+ case "lessThanOrEqualTo":
6120
+ return isNumber(value) && isNumber(testValue) && value <= testValue;
6121
+ default:
6122
+ return false;
6123
+ }
6124
+ })();
6125
+ return result;
6126
+ }
6127
+ const item = {
6128
+ query,
6129
+ startDate,
6130
+ endDate
6131
+ };
6132
+ const now = userAttributes.date && new Date(userAttributes.date) || /* @__PURE__ */ new Date();
6133
+ if (item.startDate && new Date(item.startDate) > now) {
6134
+ return false;
6135
+ } else if (item.endDate && new Date(item.endDate) < now) {
6136
+ return false;
6137
+ }
6138
+ if (!item.query || !item.query.length) {
6139
+ return true;
6140
+ }
6141
+ return item.query.every((filter) => {
6142
+ return objectMatchesQuery(userAttributes, filter);
6143
+ });
6144
+ }
6145
+ var PERSONALIZATION_SCRIPT = `function getPersonalizedVariant(variants, blockId, locale) {
6146
+ if (!navigator.cookieEnabled) {
6147
+ return;
6148
+ }
6149
+ function getCookie(name) {
6150
+ const nameEQ = name + '=';
6151
+ const ca = document.cookie.split(';');
6152
+ for (let i = 0; i < ca.length; i++) {
6153
+ let c = ca[i];
6154
+ while (c.charAt(0) == ' ') c = c.substring(1, c.length);
6155
+ if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
6156
+ }
6157
+ return null;
6158
+ }
6159
+ function removeVariants() {
6160
+ variants?.forEach(function (_, index) {
6161
+ document.querySelector('template[data-variant-id="' + blockId + '-' + index + '"]')?.remove();
6162
+ });
6163
+ document.querySelector('script[data-id="variants-script-' + blockId + '"]')?.remove();
6164
+ document.querySelector('style[data-id="variants-styles-' + blockId + '"]')?.remove();
6165
+ }
6166
+ const attributes = JSON.parse(getCookie('builder.userAttributes') || '{}');
6167
+ if (locale) {
6168
+ attributes.locale = locale;
6169
+ }
6170
+ const winningVariantIndex = variants?.findIndex(function (variant) {
6171
+ return filterWithCustomTargeting(attributes, variant.query, variant.startDate, variant.endDate);
6172
+ });
6173
+ const isDebug = location.href.includes('builder.debug=true');
6174
+ if (isDebug) {
6175
+ console.debug('PersonalizationContainer', {
6176
+ attributes,
6177
+ variants,
6178
+ winningVariantIndex
6179
+ });
6180
+ }
6181
+ if (winningVariantIndex !== -1) {
6182
+ const winningVariant = document.querySelector('template[data-variant-id="' + blockId + '-' + winningVariantIndex + '"]');
6183
+ if (winningVariant) {
6184
+ const parentNode = winningVariant.parentNode;
6185
+ if (parentNode) {
6186
+ const newParent = parentNode.cloneNode(false);
6187
+ newParent.appendChild(winningVariant.content.firstChild);
6188
+ newParent.appendChild(winningVariant.content.lastChild);
6189
+ parentNode.parentNode?.replaceChild(newParent, parentNode);
6190
+ }
6191
+ if (isDebug) {
6192
+ console.debug('PersonalizationContainer', 'Winning variant Replaced:', winningVariant);
6193
+ }
6194
+ }
6195
+ } else if (variants && variants.length > 0) {
6196
+ removeVariants();
6197
+ }
6198
+ }`;
6199
+ 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}";
6200
+
6201
+ // src/blocks/personalization-container/helpers.ts
6202
+ function checkShouldRenderVariants(variants, canTrack) {
6203
+ const hasVariants = variants && variants.length > 0;
6204
+ if (TARGET === "reactNative")
6205
+ return false;
6206
+ if (!hasVariants)
6207
+ return false;
6208
+ if (!canTrack)
6209
+ return false;
6210
+ if (TARGET === "vue" || TARGET === "svelte")
6211
+ return true;
6212
+ if (isBrowser())
6213
+ return false;
6214
+ return true;
6215
+ }
6216
+ function getBlocksToRender({
6217
+ variants,
6218
+ previewingIndex,
6219
+ isHydrated,
6220
+ filteredVariants,
6221
+ fallbackBlocks
6222
+ }) {
6223
+ const fallback = {
6224
+ blocks: fallbackBlocks ?? [],
6225
+ path: "this.children"
6226
+ };
6227
+ if (isHydrated && isEditing()) {
6228
+ if (typeof previewingIndex === "number" && previewingIndex < (variants?.length ?? 0)) {
6229
+ const variant = variants[previewingIndex];
6230
+ return {
6231
+ blocks: variant.blocks,
6232
+ path: `component.options.variants.${previewingIndex}.blocks`
6233
+ };
6234
+ }
6235
+ return fallback;
6236
+ }
6237
+ if (isBrowser()) {
6238
+ const winningVariant = filteredVariants?.[0];
6239
+ if (winningVariant) {
6240
+ return {
6241
+ blocks: winningVariant.blocks,
6242
+ path: `component.options.variants.${variants?.indexOf(winningVariant)}.blocks`
6243
+ };
6244
+ }
6245
+ }
6246
+ return fallback;
6247
+ }
6248
+ var getPersonalizationScript = (variants, blockId, locale) => {
6249
+ return `
6250
+ (function() {
6251
+ ${FILTER_WITH_CUSTOM_TARGETING_SCRIPT}
6252
+ ${PERSONALIZATION_SCRIPT}
6253
+ getPersonalizedVariant(${JSON.stringify(variants)}, "${blockId}"${locale ? `, "${locale}"` : ""})
6254
+ })();
6255
+ `;
6256
+ };
6257
+
6258
+ // src/blocks/personalization-container/personalization-container.tsx
6259
+ function PersonalizationContainer(props) {
6260
+ const [userAttributes, setUserAttributes] = createSignal10(
6261
+ userAttributesService.getUserAttributes()
6262
+ );
6263
+ const [scriptStr, setScriptStr] = createSignal10(
6264
+ getPersonalizationScript(
6265
+ props.variants,
6266
+ props.builderBlock?.id || "none",
6267
+ props.builderContext?.rootState?.locale
6268
+ )
6269
+ );
6270
+ const [unsubscribers, setUnsubscribers] = createSignal10([]);
6271
+ const [shouldRenderVariants, setShouldRenderVariants] = createSignal10(
6272
+ checkShouldRenderVariants(
6273
+ props.variants,
6274
+ getDefaultCanTrack(props.builderContext?.canTrack)
6275
+ )
6276
+ );
6277
+ const [isHydrated, setIsHydrated] = createSignal10(false);
6278
+ const filteredVariants = createMemo10(() => {
6279
+ return (props.variants || []).filter((variant) => {
6280
+ return filterWithCustomTargeting(
6281
+ {
6282
+ ...props.builderContext?.rootState?.locale ? {
6283
+ locale: props.builderContext?.rootState?.locale
6284
+ } : {},
6285
+ ...userAttributes()
6286
+ },
6287
+ variant.query,
6288
+ variant.startDate,
6289
+ variant.endDate
6290
+ );
6291
+ });
6292
+ });
6293
+ const blocksToRender = createMemo10(() => {
6294
+ return getBlocksToRender({
6295
+ variants: props.variants,
6296
+ fallbackBlocks: props.builderBlock?.children,
6297
+ isHydrated: isHydrated(),
6298
+ filteredVariants: filteredVariants(),
6299
+ previewingIndex: props.previewingIndex
6300
+ });
6301
+ });
6302
+ const hideVariantsStyleString = createMemo10(() => {
6303
+ return (props.variants || []).map(
6304
+ (_, index) => `[data-variant-id="${props.builderBlock?.id}-${index}"] { display: none; } `
6305
+ ).join("");
6306
+ });
6307
+ let rootRef;
6308
+ onMount4(() => {
6309
+ setIsHydrated(true);
6310
+ const unsub = userAttributesService.subscribeOnUserAttributesChange(
6311
+ (attrs) => {
6312
+ setUserAttributes(attrs);
6313
+ }
6314
+ );
6315
+ if (!(isEditing() || isPreviewing())) {
6316
+ const variant = filteredVariants()[0];
6317
+ if (rootRef) {
6318
+ rootRef.dispatchEvent(
6319
+ new CustomEvent("builder.variantLoaded", {
6320
+ detail: {
6321
+ variant: variant || "default",
6322
+ content: props.builderContext?.content
6323
+ },
6324
+ bubbles: true
6325
+ })
6326
+ );
6327
+ const observer = new IntersectionObserver((entries) => {
6328
+ entries.forEach((entry) => {
6329
+ if (entry.isIntersecting && rootRef) {
6330
+ rootRef.dispatchEvent(
6331
+ new CustomEvent("builder.variantDisplayed", {
6332
+ detail: {
6333
+ variant: variant || "default",
6334
+ content: props.builderContext?.content
6335
+ },
6336
+ bubbles: true
6337
+ })
6338
+ );
6339
+ }
6340
+ });
6341
+ });
6342
+ observer.observe(rootRef);
6343
+ }
6344
+ }
6345
+ unsubscribers().push(unsub);
6346
+ });
6347
+ return <><div
6348
+ class={`builder-personalization-container ${props.attributes?.className || ""}`}
6349
+ ref={rootRef}
6350
+ {...props.attributes}
6351
+ >
6352
+ <Show10 when={shouldRenderVariants()}>
6353
+ <For6 each={props.variants}>{(variant, _index) => {
6354
+ const index = _index();
6355
+ return <template
6356
+ key={index}
6357
+ data-variant-id={`${props.builderBlock?.id}-${index}`}
6358
+ ><Blocks_default
6359
+ blocks={variant.blocks}
6360
+ parent={props.builderBlock?.id}
6361
+ path={`component.options.variants.${index}.blocks`}
6362
+ /></template>;
6363
+ }}</For6>
6364
+ <Inlined_styles_default
6365
+ nonce={props.builderContext?.nonce || ""}
6366
+ styles={hideVariantsStyleString()}
6367
+ id={`variants-styles-${props.builderBlock?.id}`}
6368
+ />
6369
+ <Inlined_script_default
6370
+ nonce={props.builderContext?.nonce || ""}
6371
+ scriptStr={scriptStr()}
6372
+ id={`variants-script-${props.builderBlock?.id}`}
6373
+ />
6374
+ </Show10>
6375
+ <Blocks_default
6376
+ blocks={blocksToRender().blocks}
6377
+ parent={props.builderBlock?.id}
6378
+ path={blocksToRender().path}
6379
+ />
6380
+ </div></>;
6381
+ }
6382
+ var personalization_container_default = PersonalizationContainer;
6383
+
6384
+ // src/blocks/section/component-info.ts
6385
+ var componentInfo7 = {
5957
6386
  name: "Core:Section",
5958
6387
  static: true,
5959
6388
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
@@ -5995,7 +6424,7 @@ var componentInfo6 = {
5995
6424
  };
5996
6425
 
5997
6426
  // src/blocks/slot/component-info.ts
5998
- var componentInfo7 = {
6427
+ var componentInfo8 = {
5999
6428
  name: "Slot",
6000
6429
  isRSC: true,
6001
6430
  description: "Allow child blocks to be inserted into this content when used as a Symbol",
@@ -6034,7 +6463,7 @@ function Slot(props) {
6034
6463
  var slot_default = Slot;
6035
6464
 
6036
6465
  // src/blocks/symbol/component-info.ts
6037
- var componentInfo8 = {
6466
+ var componentInfo9 = {
6038
6467
  name: "Symbol",
6039
6468
  noWrap: true,
6040
6469
  static: true,
@@ -6116,7 +6545,7 @@ var defaultElement = {
6116
6545
  }
6117
6546
  }
6118
6547
  };
6119
- var componentInfo9 = {
6548
+ var componentInfo10 = {
6120
6549
  name: "Builder: Tabs",
6121
6550
  inputs: [{
6122
6551
  name: "tabs",
@@ -6222,9 +6651,9 @@ var componentInfo9 = {
6222
6651
  };
6223
6652
 
6224
6653
  // src/blocks/tabs/tabs.tsx
6225
- import { Show as Show10, For as For6, createSignal as createSignal10 } from "solid-js";
6654
+ import { Show as Show11, For as For7, createSignal as createSignal11 } from "solid-js";
6226
6655
  function Tabs(props) {
6227
- const [activeTab, setActiveTab] = createSignal10(
6656
+ const [activeTab, setActiveTab] = createSignal11(
6228
6657
  props.defaultActiveTab ? props.defaultActiveTab - 1 : 0
6229
6658
  );
6230
6659
  function activeTabContent(active) {
@@ -6246,7 +6675,7 @@ function Tabs(props) {
6246
6675
  "justify-content": props.tabHeaderLayout || "flex-start",
6247
6676
  overflow: "auto"
6248
6677
  }}
6249
- ><For6 each={props.tabs}>{(tab, _index) => {
6678
+ ><For7 each={props.tabs}>{(tab, _index) => {
6250
6679
  const index = _index();
6251
6680
  return <span
6252
6681
  class={`builder-tab-wrap ${activeTab() === index ? "builder-tab-active" : ""}`}
@@ -6263,21 +6692,21 @@ function Tabs(props) {
6263
6692
  registeredComponents={props.builderComponents}
6264
6693
  linkComponent={props.builderLinkComponent}
6265
6694
  /></span>;
6266
- }}</For6></div>
6267
- <Show10 when={activeTabContent(activeTab())}><div><Blocks_default
6695
+ }}</For7></div>
6696
+ <Show11 when={activeTabContent(activeTab())}><div><Blocks_default
6268
6697
  parent={props.builderBlock.id}
6269
6698
  path={`tabs.${activeTab()}.content`}
6270
6699
  blocks={activeTabContent(activeTab())}
6271
6700
  context={props.builderContext}
6272
6701
  registeredComponents={props.builderComponents}
6273
6702
  linkComponent={props.builderLinkComponent}
6274
- /></div></Show10>
6703
+ /></div></Show11>
6275
6704
  </div></>;
6276
6705
  }
6277
6706
  var tabs_default = Tabs;
6278
6707
 
6279
6708
  // src/blocks/text/component-info.ts
6280
- var componentInfo10 = {
6709
+ var componentInfo11 = {
6281
6710
  shouldReceiveBuilderProps: {
6282
6711
  builderBlock: TARGET === "reactNative" ? true : false,
6283
6712
  builderContext: true
@@ -6314,7 +6743,7 @@ function Text(props) {
6314
6743
  var text_default = Text;
6315
6744
 
6316
6745
  // src/blocks/custom-code/component-info.ts
6317
- var componentInfo11 = {
6746
+ var componentInfo12 = {
6318
6747
  name: "Custom Code",
6319
6748
  static: true,
6320
6749
  requiredPermissions: ["editCode"],
@@ -6339,10 +6768,10 @@ var componentInfo11 = {
6339
6768
  };
6340
6769
 
6341
6770
  // src/blocks/custom-code/custom-code.tsx
6342
- import { onMount as onMount5, createSignal as createSignal11 } from "solid-js";
6771
+ import { onMount as onMount5, createSignal as createSignal12 } from "solid-js";
6343
6772
  function CustomCode(props) {
6344
- const [scriptsInserted, setScriptsInserted] = createSignal11([]);
6345
- const [scriptsRun, setScriptsRun] = createSignal11([]);
6773
+ const [scriptsInserted, setScriptsInserted] = createSignal12([]);
6774
+ const [scriptsRun, setScriptsRun] = createSignal12([]);
6346
6775
  let elementRef;
6347
6776
  onMount5(() => {
6348
6777
  if (!elementRef?.getElementsByTagName || typeof window === "undefined") {
@@ -6385,7 +6814,7 @@ function CustomCode(props) {
6385
6814
  var custom_code_default = CustomCode;
6386
6815
 
6387
6816
  // src/blocks/embed/component-info.ts
6388
- var componentInfo12 = {
6817
+ var componentInfo13 = {
6389
6818
  name: "Embed",
6390
6819
  static: true,
6391
6820
  inputs: [{
@@ -6403,7 +6832,7 @@ var componentInfo12 = {
6403
6832
  };
6404
6833
 
6405
6834
  // src/blocks/embed/embed.tsx
6406
- import { on as on2, createEffect as createEffect2, createMemo as createMemo12, createSignal as createSignal12 } from "solid-js";
6835
+ import { on as on2, createEffect as createEffect2, createMemo as createMemo13, createSignal as createSignal13 } from "solid-js";
6407
6836
 
6408
6837
  // src/blocks/embed/helpers.ts
6409
6838
  var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "application/ecmascript"];
@@ -6411,9 +6840,9 @@ var isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
6411
6840
 
6412
6841
  // src/blocks/embed/embed.tsx
6413
6842
  function Embed(props) {
6414
- const [scriptsInserted, setScriptsInserted] = createSignal12([]);
6415
- const [scriptsRun, setScriptsRun] = createSignal12([]);
6416
- const [ranInitFn, setRanInitFn] = createSignal12(false);
6843
+ const [scriptsInserted, setScriptsInserted] = createSignal13([]);
6844
+ const [scriptsRun, setScriptsRun] = createSignal13([]);
6845
+ const [ranInitFn, setRanInitFn] = createSignal13(false);
6417
6846
  function findAndRunScripts() {
6418
6847
  if (!elem || !elem.getElementsByTagName)
6419
6848
  return;
@@ -6436,8 +6865,8 @@ function Embed(props) {
6436
6865
  }
6437
6866
  }
6438
6867
  let elem;
6439
- const onUpdateFn_0_elem = createMemo12(() => elem);
6440
- const onUpdateFn_0_ranInitFn__ = createMemo12(() => ranInitFn());
6868
+ const onUpdateFn_0_elem = createMemo13(() => elem);
6869
+ const onUpdateFn_0_ranInitFn__ = createMemo13(() => ranInitFn());
6441
6870
  function onUpdateFn_0() {
6442
6871
  if (elem && !ranInitFn()) {
6443
6872
  setRanInitFn(true);
@@ -6452,7 +6881,7 @@ function Embed(props) {
6452
6881
  var embed_default = Embed;
6453
6882
 
6454
6883
  // src/blocks/form/form/component-info.ts
6455
- var componentInfo13 = {
6884
+ var componentInfo14 = {
6456
6885
  name: "Form:Form",
6457
6886
  // editableTags: ['builder-form-error']
6458
6887
  defaults: {
@@ -6692,7 +7121,7 @@ var componentInfo13 = {
6692
7121
  };
6693
7122
 
6694
7123
  // src/blocks/form/form/form.tsx
6695
- import { Show as Show11, For as For7, createSignal as createSignal13 } from "solid-js";
7124
+ import { Show as Show12, createSignal as createSignal14 } from "solid-js";
6696
7125
 
6697
7126
  // src/functions/get-env.ts
6698
7127
  var validEnvList = ["production", "qa", "test", "development", "dev", "cdn-qa", "cloud", "fast", "cdn2", "cdn-prod"];
@@ -6712,9 +7141,9 @@ function logFetch(url) {
6712
7141
 
6713
7142
  // src/blocks/form/form/form.tsx
6714
7143
  function FormComponent(props) {
6715
- const [formState, setFormState] = createSignal13("unsubmitted");
6716
- const [responseData, setResponseData] = createSignal13(null);
6717
- const [formErrorMessage, setFormErrorMessage] = createSignal13("");
7144
+ const [formState, setFormState] = createSignal14("unsubmitted");
7145
+ const [responseData, setResponseData] = createSignal14(null);
7146
+ const [formErrorMessage, setFormErrorMessage] = createSignal14("");
6718
7147
  function mergeNewRootState(newData) {
6719
7148
  const combinedState = {
6720
7149
  ...props.builderContext.rootState,
@@ -6909,34 +7338,25 @@ function FormComponent(props) {
6909
7338
  {...{}}
6910
7339
  {...props.attributes}
6911
7340
  >
6912
- <Show11 when={props.builderBlock && props.builderBlock.children}><For7 each={props.builderBlock?.children}>{(block, _index) => {
6913
- const idx = _index();
6914
- return <Block_default
6915
- key={`form-block-${idx}`}
6916
- block={block}
6917
- context={props.builderContext}
6918
- registeredComponents={props.builderComponents}
6919
- linkComponent={props.builderLinkComponent}
6920
- />;
6921
- }}</For7></Show11>
6922
- <Show11 when={submissionState() === "error"}><Blocks_default
7341
+ {props.children}
7342
+ <Show12 when={submissionState() === "error"}><Blocks_default
6923
7343
  path="errorMessage"
6924
7344
  blocks={props.errorMessage}
6925
7345
  context={props.builderContext}
6926
- /></Show11>
6927
- <Show11 when={submissionState() === "sending"}><Blocks_default
7346
+ /></Show12>
7347
+ <Show12 when={submissionState() === "sending"}><Blocks_default
6928
7348
  path="sendingMessage"
6929
7349
  blocks={props.sendingMessage}
6930
7350
  context={props.builderContext}
6931
- /></Show11>
6932
- <Show11 when={submissionState() === "error" && responseData()}><pre class="builder-form-error-text pre-27d18614">{JSON.stringify(responseData(), null, 2)}</pre></Show11>
6933
- <Show11 when={submissionState() === "success"}><Blocks_default
7351
+ /></Show12>
7352
+ <Show12 when={submissionState() === "error" && responseData()}><pre class="builder-form-error-text pre-04a43b72">{JSON.stringify(responseData(), null, 2)}</pre></Show12>
7353
+ <Show12 when={submissionState() === "success"}><Blocks_default
6934
7354
  path="successMessage"
6935
7355
  blocks={props.successMessage}
6936
7356
  context={props.builderContext}
6937
- /></Show11>
7357
+ /></Show12>
6938
7358
  </form>
6939
- <style>{`.pre-27d18614 {
7359
+ <style>{`.pre-04a43b72 {
6940
7360
  padding: 10px;
6941
7361
  color: red;
6942
7362
  text-align: center;
@@ -6946,7 +7366,7 @@ function FormComponent(props) {
6946
7366
  var form_default = FormComponent;
6947
7367
 
6948
7368
  // src/blocks/form/input/component-info.ts
6949
- var componentInfo14 = {
7369
+ var componentInfo15 = {
6950
7370
  name: "Form:Input",
6951
7371
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
6952
7372
  inputs: [
@@ -7016,7 +7436,7 @@ function FormInputComponent(props) {
7016
7436
  var input_default = FormInputComponent;
7017
7437
 
7018
7438
  // src/blocks/form/select/component-info.ts
7019
- var componentInfo15 = {
7439
+ var componentInfo16 = {
7020
7440
  name: "Form:Select",
7021
7441
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
7022
7442
  defaultStyles: {
@@ -7079,7 +7499,7 @@ function SelectComponent(props) {
7079
7499
  var select_default = SelectComponent;
7080
7500
 
7081
7501
  // src/blocks/form/submit-button/component-info.ts
7082
- var componentInfo16 = {
7502
+ var componentInfo17 = {
7083
7503
  name: "Form:SubmitButton",
7084
7504
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
7085
7505
  defaultStyles: {
@@ -7113,7 +7533,7 @@ function SubmitButton(props) {
7113
7533
  var submit_button_default = SubmitButton;
7114
7534
 
7115
7535
  // src/blocks/form/textarea/component-info.ts
7116
- var componentInfo17 = {
7536
+ var componentInfo18 = {
7117
7537
  name: "Form:TextArea",
7118
7538
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Ff74a2f3de58c4c3e939204e5b6b8f6c3",
7119
7539
  inputs: [{
@@ -7166,7 +7586,7 @@ function Textarea(props) {
7166
7586
  var textarea_default = Textarea;
7167
7587
 
7168
7588
  // src/blocks/img/component-info.ts
7169
- var componentInfo18 = {
7589
+ var componentInfo19 = {
7170
7590
  // friendlyName?
7171
7591
  name: "Raw:Img",
7172
7592
  hideFromInsertMenu: true,
@@ -7199,7 +7619,7 @@ function ImgComponent(props) {
7199
7619
  var img_default = ImgComponent;
7200
7620
 
7201
7621
  // src/blocks/video/component-info.ts
7202
- var componentInfo19 = {
7622
+ var componentInfo20 = {
7203
7623
  name: "Video",
7204
7624
  canHaveChildren: true,
7205
7625
  defaultStyles: {
@@ -7286,9 +7706,9 @@ var componentInfo19 = {
7286
7706
  };
7287
7707
 
7288
7708
  // src/blocks/video/video.tsx
7289
- import { Show as Show12, createMemo as createMemo14 } from "solid-js";
7709
+ import { Show as Show13, createMemo as createMemo15 } from "solid-js";
7290
7710
  function Video(props) {
7291
- const videoProps = createMemo14(() => {
7711
+ const videoProps = createMemo15(() => {
7292
7712
  return {
7293
7713
  ...props.autoPlay === true ? {
7294
7714
  autoPlay: true
@@ -7307,7 +7727,7 @@ function Video(props) {
7307
7727
  } : {}
7308
7728
  };
7309
7729
  });
7310
- const spreadProps = createMemo14(() => {
7730
+ const spreadProps = createMemo15(() => {
7311
7731
  return {
7312
7732
  ...videoProps()
7313
7733
  };
@@ -7329,7 +7749,6 @@ function Video(props) {
7329
7749
  "object-position": props.position,
7330
7750
  // Hack to get object fit to work as expected and
7331
7751
  // not have the video overflow
7332
- "z-index": 2,
7333
7752
  "border-radius": "1px",
7334
7753
  ...props.aspectRatio ? {
7335
7754
  position: "absolute"
@@ -7337,8 +7756,8 @@ function Video(props) {
7337
7756
  }}
7338
7757
  src={props.video || "no-src"}
7339
7758
  poster={props.posterImage}
7340
- ><Show12 when={!props.lazyLoad}><source type="video/mp4" src={props.video} /></Show12></video>
7341
- <Show12
7759
+ ><Show13 when={!props.lazyLoad}><source type="video/mp4" src={props.video} /></Show13></video>
7760
+ <Show13
7342
7761
  when={props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length)}
7343
7762
  ><div
7344
7763
  style={{
@@ -7347,15 +7766,15 @@ function Video(props) {
7347
7766
  "pointer-events": "none",
7348
7767
  "font-size": "0px"
7349
7768
  }}
7350
- /></Show12>
7351
- <Show12 when={props.builderBlock?.children?.length && props.fitContent}><div
7769
+ /></Show13>
7770
+ <Show13 when={props.builderBlock?.children?.length && props.fitContent}><div
7352
7771
  style={{
7353
7772
  display: "flex",
7354
7773
  "flex-direction": "column",
7355
7774
  "align-items": "stretch"
7356
7775
  }}
7357
- >{props.children}</div></Show12>
7358
- <Show12 when={props.builderBlock?.children?.length && !props.fitContent}><div
7776
+ >{props.children}</div></Show13>
7777
+ <Show13 when={props.builderBlock?.children?.length && !props.fitContent}><div
7359
7778
  style={{
7360
7779
  "pointer-events": "none",
7361
7780
  display: "flex",
@@ -7367,7 +7786,7 @@ function Video(props) {
7367
7786
  width: "100%",
7368
7787
  height: "100%"
7369
7788
  }}
7370
- >{props.children}</div></Show12>
7789
+ >{props.children}</div></Show13>
7371
7790
  </div></>;
7372
7791
  }
7373
7792
  var video_default = Video;
@@ -7375,31 +7794,31 @@ var video_default = Video;
7375
7794
  // src/constants/extra-components.ts
7376
7795
  var getExtraComponents = () => [{
7377
7796
  component: custom_code_default,
7378
- ...componentInfo11
7797
+ ...componentInfo12
7379
7798
  }, {
7380
7799
  component: embed_default,
7381
- ...componentInfo12
7800
+ ...componentInfo13
7382
7801
  }, ...TARGET === "rsc" ? [] : [{
7383
7802
  component: form_default,
7384
- ...componentInfo13
7803
+ ...componentInfo14
7385
7804
  }, {
7386
7805
  component: input_default,
7387
- ...componentInfo14
7806
+ ...componentInfo15
7388
7807
  }, {
7389
7808
  component: submit_button_default,
7390
- ...componentInfo16
7809
+ ...componentInfo17
7391
7810
  }, {
7392
7811
  component: select_default,
7393
- ...componentInfo15
7812
+ ...componentInfo16
7394
7813
  }, {
7395
7814
  component: textarea_default,
7396
- ...componentInfo17
7815
+ ...componentInfo18
7397
7816
  }], {
7398
7817
  component: img_default,
7399
- ...componentInfo18
7818
+ ...componentInfo19
7400
7819
  }, {
7401
7820
  component: video_default,
7402
- ...componentInfo19
7821
+ ...componentInfo20
7403
7822
  }];
7404
7823
 
7405
7824
  // src/constants/builder-registered-components.ts
@@ -7417,19 +7836,22 @@ var getDefaultRegisteredComponents = () => [{
7417
7836
  ...componentInfo5
7418
7837
  }, {
7419
7838
  component: section_default,
7420
- ...componentInfo6
7839
+ ...componentInfo7
7421
7840
  }, {
7422
7841
  component: slot_default,
7423
- ...componentInfo7
7842
+ ...componentInfo8
7424
7843
  }, {
7425
7844
  component: symbol_default,
7426
- ...componentInfo8
7845
+ ...componentInfo9
7427
7846
  }, {
7428
7847
  component: text_default,
7429
- ...componentInfo10
7430
- }, ...TARGET === "rsc" ? [] : [{
7848
+ ...componentInfo11
7849
+ }, ...TARGET === "react" ? [{
7850
+ component: personalization_container_default,
7851
+ ...componentInfo6
7852
+ }] : [], ...TARGET === "rsc" ? [] : [{
7431
7853
  component: tabs_default,
7432
- ...componentInfo9
7854
+ ...componentInfo10
7433
7855
  }, {
7434
7856
  component: accordion_default,
7435
7857
  ...componentInfo
@@ -7467,7 +7889,7 @@ var getVariants = (content) => Object.values(content?.variations || {}).map((var
7467
7889
  testVariationId: variant.id,
7468
7890
  id: content?.id
7469
7891
  }));
7470
- var checkShouldRenderVariants = ({
7892
+ var checkShouldRenderVariants2 = ({
7471
7893
  canTrack,
7472
7894
  content
7473
7895
  }) => {
@@ -7501,24 +7923,14 @@ var getUpdateVariantVisibilityScript = ({
7501
7923
  "${variationId}", "${contentId}", ${isHydrationTarget}
7502
7924
  )`;
7503
7925
 
7504
- // src/components/inlined-script.tsx
7505
- function InlinedScript(props) {
7506
- return <><script
7507
- innerHTML={props.scriptStr}
7508
- data-id={props.id}
7509
- nonce={props.nonce || ""}
7510
- /></>;
7511
- }
7512
- var Inlined_script_default = InlinedScript;
7513
-
7514
7926
  // src/components/content/components/enable-editor.tsx
7515
7927
  import {
7516
- Show as Show13,
7928
+ Show as Show14,
7517
7929
  onMount as onMount6,
7518
7930
  on as on3,
7519
7931
  createEffect as createEffect3,
7520
- createMemo as createMemo15,
7521
- createSignal as createSignal15
7932
+ createMemo as createMemo16,
7933
+ createSignal as createSignal16
7522
7934
  } from "solid-js";
7523
7935
  import { Dynamic as Dynamic5 } from "solid-js/web";
7524
7936
 
@@ -7528,7 +7940,7 @@ function getPreviewContent(_searchParams) {
7528
7940
  }
7529
7941
 
7530
7942
  // src/constants/sdk-version.ts
7531
- var SDK_VERSION = "3.0.3";
7943
+ var SDK_VERSION = "3.0.6";
7532
7944
 
7533
7945
  // src/helpers/sdk-headers.ts
7534
7946
  var getSdkHeaders = () => ({
@@ -7823,16 +8235,6 @@ async function fetchEntries(options) {
7823
8235
  return _processContentResult(options, content);
7824
8236
  }
7825
8237
 
7826
- // src/functions/is-previewing.ts
7827
- function isPreviewing(_search) {
7828
- const search = _search || (isBrowser() ? window.location.search : void 0);
7829
- if (!search) {
7830
- return false;
7831
- }
7832
- const normalizedSearch = getSearchString(search);
7833
- return Boolean(normalizedSearch.indexOf("builder.preview=") !== -1);
7834
- }
7835
-
7836
8238
  // src/helpers/uuid.ts
7837
8239
  function uuidv4() {
7838
8240
  return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) {
@@ -8155,7 +8557,8 @@ var setupBrowserForEditing = (options = {}) => {
8155
8557
  // Supports builder-model="..." attribute which is needed to
8156
8558
  // scope our '+ add block' button styling
8157
8559
  supportsAddBlockScoping: true,
8158
- supportsCustomBreakpoints: true
8560
+ supportsCustomBreakpoints: true,
8561
+ blockLevelPersonalization: true
8159
8562
  }
8160
8563
  }, "*");
8161
8564
  window.parent?.postMessage({
@@ -8370,12 +8773,12 @@ var getWrapperClassName = (variationId) => {
8370
8773
 
8371
8774
  // src/components/content/components/enable-editor.tsx
8372
8775
  function EnableEditor(props) {
8373
- const [ContentWrapper, setContentWrapper] = createSignal15(
8776
+ const [ContentWrapper, setContentWrapper] = createSignal16(
8374
8777
  props.contentWrapper || "div"
8375
8778
  );
8376
- const [httpReqsData, setHttpReqsData] = createSignal15({});
8377
- const [httpReqsPending, setHttpReqsPending] = createSignal15({});
8378
- const [clicked, setClicked] = createSignal15(false);
8779
+ const [httpReqsData, setHttpReqsData] = createSignal16({});
8780
+ const [httpReqsPending, setHttpReqsPending] = createSignal16({});
8781
+ const [clicked, setClicked] = createSignal16(false);
8379
8782
  function mergeNewRootState(newData) {
8380
8783
  const combinedState = {
8381
8784
  ...props.builderContextSignal.rootState,
@@ -8409,7 +8812,7 @@ function EnableEditor(props) {
8409
8812
  content: newContentValue
8410
8813
  }));
8411
8814
  }
8412
- const showContentProps = createMemo15(() => {
8815
+ const showContentProps = createMemo16(() => {
8413
8816
  return props.showContent ? {} : {
8414
8817
  hidden: true,
8415
8818
  "aria-hidden": true
@@ -8584,14 +8987,14 @@ function EnableEditor(props) {
8584
8987
  }
8585
8988
  }
8586
8989
  });
8587
- const onUpdateFn_0_props_content = createMemo15(() => props.content);
8990
+ const onUpdateFn_0_props_content = createMemo16(() => props.content);
8588
8991
  function onUpdateFn_0() {
8589
8992
  if (props.content) {
8590
8993
  mergeNewContent(props.content);
8591
8994
  }
8592
8995
  }
8593
8996
  createEffect3(on3(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
8594
- const onUpdateFn_1_props_builderContextSignal_rootState = createMemo15(
8997
+ const onUpdateFn_1_props_builderContextSignal_rootState = createMemo16(
8595
8998
  () => props.builderContextSignal.rootState
8596
8999
  );
8597
9000
  function onUpdateFn_1() {
@@ -8603,14 +9006,14 @@ function EnableEditor(props) {
8603
9006
  onUpdateFn_1
8604
9007
  )
8605
9008
  );
8606
- const onUpdateFn_2_props_data = createMemo15(() => props.data);
9009
+ const onUpdateFn_2_props_data = createMemo16(() => props.data);
8607
9010
  function onUpdateFn_2() {
8608
9011
  if (props.data) {
8609
9012
  mergeNewRootState(props.data);
8610
9013
  }
8611
9014
  }
8612
9015
  createEffect3(on3(() => [onUpdateFn_2_props_data()], onUpdateFn_2));
8613
- const onUpdateFn_3_props_locale = createMemo15(() => props.locale);
9016
+ const onUpdateFn_3_props_locale = createMemo16(() => props.locale);
8614
9017
  function onUpdateFn_3() {
8615
9018
  if (props.locale) {
8616
9019
  mergeNewRootState({
@@ -8619,7 +9022,7 @@ function EnableEditor(props) {
8619
9022
  }
8620
9023
  }
8621
9024
  createEffect3(on3(() => [onUpdateFn_3_props_locale()], onUpdateFn_3));
8622
- return <><builder_context_default.Provider value={props.builderContextSignal}><Show13
9025
+ return <><builder_context_default.Provider value={props.builderContextSignal}><Show14
8623
9026
  when={props.builderContextSignal.content || needsElementRefDivForEditing()}
8624
9027
  ><Dynamic5
8625
9028
  class={getWrapperClassName(
@@ -8637,14 +9040,14 @@ function EnableEditor(props) {
8637
9040
  {...showContentProps()}
8638
9041
  {...props.contentWrapperProps}
8639
9042
  component={ContentWrapper()}
8640
- >{props.children}</Dynamic5></Show13></builder_context_default.Provider></>;
9043
+ >{props.children}</Dynamic5></Show14></builder_context_default.Provider></>;
8641
9044
  }
8642
9045
  var Enable_editor_default = EnableEditor;
8643
9046
 
8644
9047
  // src/components/content/components/styles.tsx
8645
- import { createSignal as createSignal16 } from "solid-js";
9048
+ import { createSignal as createSignal17 } from "solid-js";
8646
9049
  function ContentStyles(props) {
8647
- const [injectedStyles, setInjectedStyles] = createSignal16(
9050
+ const [injectedStyles, setInjectedStyles] = createSignal17(
8648
9051
  `
8649
9052
  ${getCss({
8650
9053
  cssCode: props.cssCode,
@@ -8702,7 +9105,7 @@ var getContentInitialValue = ({
8702
9105
 
8703
9106
  // src/components/content/content.tsx
8704
9107
  function ContentComponent(props) {
8705
- const [scriptStr, setScriptStr] = createSignal17(
9108
+ const [scriptStr, setScriptStr] = createSignal18(
8706
9109
  getUpdateVariantVisibilityScript({
8707
9110
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
8708
9111
  variationId: props.content?.testVariationId,
@@ -8710,7 +9113,7 @@ function ContentComponent(props) {
8710
9113
  contentId: props.content?.id
8711
9114
  })
8712
9115
  );
8713
- const [registeredComponents, setRegisteredComponents] = createSignal17(
9116
+ const [registeredComponents, setRegisteredComponents] = createSignal18(
8714
9117
  [
8715
9118
  ...getDefaultRegisteredComponents(),
8716
9119
  ...props.customComponents || []
@@ -8725,7 +9128,7 @@ function ContentComponent(props) {
8725
9128
  {}
8726
9129
  )
8727
9130
  );
8728
- const [builderContextSignal, setBuilderContextSignal] = createSignal17({
9131
+ const [builderContextSignal, setBuilderContextSignal] = createSignal18({
8729
9132
  content: getContentInitialValue({
8730
9133
  content: props.content,
8731
9134
  data: props.data
@@ -8809,18 +9212,18 @@ function ContentComponent(props) {
8809
9212
  setBuilderContextSignal
8810
9213
  }}
8811
9214
  >
8812
- <Show14 when={props.isSsrAbTest}><Inlined_script_default
9215
+ <Show15 when={props.isSsrAbTest}><Inlined_script_default
8813
9216
  id="builderio-variant-visibility"
8814
9217
  scriptStr={scriptStr()}
8815
9218
  nonce={props.nonce || ""}
8816
- /></Show14>
8817
- <Show14 when={TARGET !== "reactNative"}><Styles_default
9219
+ /></Show15>
9220
+ <Show15 when={TARGET !== "reactNative"}><Styles_default
8818
9221
  nonce={props.nonce || ""}
8819
9222
  isNestedRender={props.isNestedRender}
8820
9223
  contentId={builderContextSignal().content?.id}
8821
9224
  cssCode={builderContextSignal().content?.data?.cssCode}
8822
9225
  customFonts={builderContextSignal().content?.data?.customFonts}
8823
- /></Show14>
9226
+ /></Show15>
8824
9227
  <Blocks_default
8825
9228
  blocks={builderContextSignal().content?.data?.blocks}
8826
9229
  context={builderContextSignal()}
@@ -8833,13 +9236,13 @@ var Content_default = ContentComponent;
8833
9236
 
8834
9237
  // src/components/content-variants/content-variants.tsx
8835
9238
  function ContentVariants(props) {
8836
- const [shouldRenderVariants, setShouldRenderVariants] = createSignal18(
8837
- checkShouldRenderVariants({
9239
+ const [shouldRenderVariants, setShouldRenderVariants] = createSignal19(
9240
+ checkShouldRenderVariants2({
8838
9241
  canTrack: getDefaultCanTrack(props.canTrack),
8839
9242
  content: props.content
8840
9243
  })
8841
9244
  );
8842
- const updateCookieAndStylesScriptStr = createMemo18(() => {
9245
+ const updateCookieAndStylesScriptStr = createMemo19(() => {
8843
9246
  return getUpdateCookieAndStylesScript(
8844
9247
  getVariants(props.content).map((value) => ({
8845
9248
  id: value.testVariationId,
@@ -8848,10 +9251,10 @@ function ContentVariants(props) {
8848
9251
  props.content?.id || ""
8849
9252
  );
8850
9253
  });
8851
- const hideVariantsStyleString = createMemo18(() => {
9254
+ const hideVariantsStyleString = createMemo19(() => {
8852
9255
  return getVariants(props.content).map((value) => `.variant-${value.testVariationId} { display: none; } `).join("");
8853
9256
  });
8854
- const defaultContent = createMemo18(() => {
9257
+ const defaultContent = createMemo19(() => {
8855
9258
  return shouldRenderVariants() ? {
8856
9259
  ...props.content,
8857
9260
  testVariationId: props.content?.id
@@ -8864,12 +9267,12 @@ function ContentVariants(props) {
8864
9267
  setShouldRenderVariants(false);
8865
9268
  });
8866
9269
  return <><>
8867
- <Show15 when={!props.isNestedRender && TARGET !== "reactNative"}><Inlined_script_default
9270
+ <Show16 when={!props.isNestedRender && TARGET !== "reactNative"}><Inlined_script_default
8868
9271
  id="builderio-init-variants-fns"
8869
9272
  scriptStr={getInitVariantsFnsScriptString()}
8870
9273
  nonce={props.nonce || ""}
8871
- /></Show15>
8872
- <Show15 when={shouldRenderVariants()}>
9274
+ /></Show16>
9275
+ <Show16 when={shouldRenderVariants()}>
8873
9276
  <Inlined_styles_default
8874
9277
  id="builderio-variants"
8875
9278
  styles={hideVariantsStyleString()}
@@ -8908,7 +9311,7 @@ function ContentVariants(props) {
8908
9311
  {...{}}
8909
9312
  />;
8910
9313
  }}</For9>
8911
- </Show15>
9314
+ </Show16>
8912
9315
  <Content_default
8913
9316
  apiHost={props.apiHost}
8914
9317
  nonce={props.nonce}
@@ -8963,14 +9366,14 @@ var fetchSymbolContent = async ({
8963
9366
 
8964
9367
  // src/blocks/symbol/symbol.tsx
8965
9368
  function Symbol2(props) {
8966
- const [contentToUse, setContentToUse] = createSignal19(props.symbol?.content);
8967
- const blocksWrapper = createMemo19(() => {
9369
+ const [contentToUse, setContentToUse] = createSignal20(props.symbol?.content);
9370
+ const blocksWrapper = createMemo20(() => {
8968
9371
  return "div";
8969
9372
  });
8970
- const contentWrapper = createMemo19(() => {
9373
+ const contentWrapper = createMemo20(() => {
8971
9374
  return "div";
8972
9375
  });
8973
- const className = createMemo19(() => {
9376
+ const className = createMemo20(() => {
8974
9377
  return [
8975
9378
  ...[props.attributes[getClassPropName()]],
8976
9379
  "builder-symbol",
@@ -8992,7 +9395,7 @@ function Symbol2(props) {
8992
9395
  }
8993
9396
  onMount8(() => {
8994
9397
  });
8995
- const onUpdateFn_0_props_symbol = createMemo19(() => props.symbol);
9398
+ const onUpdateFn_0_props_symbol = createMemo20(() => props.symbol);
8996
9399
  function onUpdateFn_0() {
8997
9400
  setContent();
8998
9401
  }
@@ -9077,6 +9480,7 @@ export {
9077
9480
  isEditing,
9078
9481
  isPreviewing,
9079
9482
  register,
9483
+ setClientUserAttributes,
9080
9484
  setEditorSettings,
9081
9485
  subscribeToEditor,
9082
9486
  track