@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.
@@ -1,5 +1,5 @@
1
1
  import { delegateEvents, createComponent, spread, mergeProps, insert, effect, setAttribute, className, style, template, Dynamic, memo, use } from 'solid-js/web';
2
- import { createContext, useContext, Show, For, createMemo, onMount, createSignal, createEffect, on } from 'solid-js';
2
+ import { createContext, useContext, Show, For, createMemo, createSignal, onMount, createEffect, on } from 'solid-js';
3
3
 
4
4
  // src/blocks/button/button.tsx
5
5
 
@@ -1616,7 +1616,7 @@ function Block(props) {
1616
1616
  });
1617
1617
  }
1618
1618
  var block_default = Block;
1619
- var _tmpl$2 = /* @__PURE__ */ template(`<style>.dynamic-3c4beb0c {
1619
+ var _tmpl$2 = /* @__PURE__ */ template(`<style>.dynamic-3d7ff108 {
1620
1620
  display: flex;
1621
1621
  flex-direction: column;
1622
1622
  align-items: stretch;
@@ -1629,8 +1629,9 @@ function BlocksWrapper(props) {
1629
1629
  if (!props.path) {
1630
1630
  return void 0;
1631
1631
  }
1632
+ const thisPrefix = "this.";
1632
1633
  const pathPrefix = "component.options.";
1633
- return props.path.startsWith(pathPrefix) ? props.path : `${pathPrefix}${props.path || ""}`;
1634
+ return props.path.startsWith(thisPrefix) ? props.path.replace(thisPrefix, "") : props.path.startsWith(pathPrefix) ? props.path : `${pathPrefix}${props.path || ""}`;
1634
1635
  });
1635
1636
  function onClick() {
1636
1637
  if (isEditing() && !props.blocks?.length) {
@@ -1659,7 +1660,7 @@ function BlocksWrapper(props) {
1659
1660
  });
1660
1661
  return [createComponent(Dynamic, mergeProps({
1661
1662
  get ["class"]() {
1662
- return className() + " dynamic-3c4beb0c";
1663
+ return className() + " dynamic-3d7ff108";
1663
1664
  },
1664
1665
  ref(r$) {
1665
1666
  const _ref$ = blocksWrapperRef;
@@ -1758,7 +1759,7 @@ var getColumnsClass = (id) => {
1758
1759
 
1759
1760
  // src/blocks/columns/columns.tsx
1760
1761
  var _tmpl$3 = /* @__PURE__ */ template(`<div>`);
1761
- var _tmpl$22 = /* @__PURE__ */ template(`<style>.div-3e5f33a4 {
1762
+ var _tmpl$22 = /* @__PURE__ */ template(`<style>.div-6331dfc5 {
1762
1763
  display: flex;
1763
1764
  line-height: normal;
1764
1765
  }`);
@@ -1887,7 +1888,7 @@ function Columns(props) {
1887
1888
  const _el$ = _tmpl$3();
1888
1889
  spread(_el$, mergeProps({
1889
1890
  get ["class"]() {
1890
- return getColumnsClass(props.builderBlock?.id) + " div-3e5f33a4";
1891
+ return getColumnsClass(props.builderBlock?.id) + " div-6331dfc5";
1891
1892
  },
1892
1893
  get style() {
1893
1894
  return columnsCssVars();
@@ -1928,9 +1929,6 @@ function Columns(props) {
1928
1929
  get parent() {
1929
1930
  return props.builderBlock.id;
1930
1931
  },
1931
- styleProp: {
1932
- flexGrow: "1"
1933
- },
1934
1932
  get context() {
1935
1933
  return props.builderContext;
1936
1934
  },
@@ -1942,6 +1940,9 @@ function Columns(props) {
1942
1940
  },
1943
1941
  get blocks() {
1944
1942
  return column.blocks;
1943
+ },
1944
+ styleProp: {
1945
+ "flex-grow": "1"
1945
1946
  }
1946
1947
  });
1947
1948
  }
@@ -2012,16 +2013,16 @@ function getSrcSet(url) {
2012
2013
  // src/blocks/image/image.tsx
2013
2014
  var _tmpl$5 = /* @__PURE__ */ template(`<source type=image/webp>`);
2014
2015
  var _tmpl$23 = /* @__PURE__ */ template(`<picture><img>`);
2015
- var _tmpl$32 = /* @__PURE__ */ template(`<div class="builder-image-sizer div-56e07140">`);
2016
- var _tmpl$42 = /* @__PURE__ */ template(`<div class=div-56e07140-2>`);
2017
- var _tmpl$52 = /* @__PURE__ */ template(`<style>.img-56e07140 {
2016
+ var _tmpl$32 = /* @__PURE__ */ template(`<div class="builder-image-sizer div-dc6700b4">`);
2017
+ var _tmpl$42 = /* @__PURE__ */ template(`<div class=div-dc6700b4-2>`);
2018
+ var _tmpl$52 = /* @__PURE__ */ template(`<style>.img-dc6700b4 {
2018
2019
  opacity: 1;
2019
2020
  transition: opacity 0.2s ease-in-out;
2020
- }.div-56e07140 {
2021
+ }.div-dc6700b4 {
2021
2022
  width: 100%;
2022
2023
  pointer-events: none;
2023
2024
  font-size: 0;
2024
- }.div-56e07140-2 {
2025
+ }.div-dc6700b4-2 {
2025
2026
  display: flex;
2026
2027
  flex-direction: column;
2027
2028
  align-items: stretch;
@@ -2071,8 +2072,6 @@ function Image(props) {
2071
2072
  const out = props.aspectRatio ? aspectRatioStyles : void 0;
2072
2073
  return out;
2073
2074
  });
2074
- onMount(() => {
2075
- });
2076
2075
  return [[(() => {
2077
2076
  const _el$ = _tmpl$23(), _el$3 = _el$.firstChild;
2078
2077
  insert(_el$, createComponent(Show, {
@@ -2086,7 +2085,7 @@ function Image(props) {
2086
2085
  }
2087
2086
  }), _el$3);
2088
2087
  effect((_p$) => {
2089
- const _v$ = "builder-image" + (props.className ? " " + props.className : "") + " img-56e07140", _v$2 = props.highPriority ? "eager" : "lazy", _v$3 = props.highPriority ? "high" : "auto", _v$4 = props.altText, _v$5 = props.altText ? void 0 : "presentation", _v$6 = {
2088
+ const _v$ = "builder-image" + (props.className ? " " + props.className : "") + " img-dc6700b4", _v$2 = props.highPriority ? "eager" : "lazy", _v$3 = props.highPriority ? "high" : "auto", _v$4 = props.altText, _v$5 = props.altText ? void 0 : "presentation", _v$6 = {
2090
2089
  "object-position": props.backgroundPosition || "center",
2091
2090
  "object-fit": props.backgroundSize || "cover",
2092
2091
  ...aspectRatioCss()
@@ -2355,8 +2354,58 @@ var handleABTesting = async ({
2355
2354
  };
2356
2355
  };
2357
2356
 
2357
+ // src/helpers/user-attributes.ts
2358
+ var USER_ATTRIBUTES_COOKIE_NAME = "builder.userAttributes";
2359
+ function createUserAttributesService() {
2360
+ let canTrack = true;
2361
+ const subscribers = /* @__PURE__ */ new Set();
2362
+ return {
2363
+ setUserAttributes(newAttrs) {
2364
+ if (!isBrowser()) {
2365
+ return;
2366
+ }
2367
+ const userAttributes = {
2368
+ ...this.getUserAttributes(),
2369
+ ...newAttrs
2370
+ };
2371
+ setCookie({
2372
+ name: USER_ATTRIBUTES_COOKIE_NAME,
2373
+ value: JSON.stringify(userAttributes),
2374
+ canTrack
2375
+ });
2376
+ subscribers.forEach((callback) => callback(userAttributes));
2377
+ },
2378
+ getUserAttributes() {
2379
+ if (!isBrowser()) {
2380
+ return {};
2381
+ }
2382
+ return JSON.parse(getCookieSync({
2383
+ name: USER_ATTRIBUTES_COOKIE_NAME,
2384
+ canTrack
2385
+ }) || "{}");
2386
+ },
2387
+ subscribeOnUserAttributesChange(callback) {
2388
+ subscribers.add(callback);
2389
+ return () => {
2390
+ subscribers.delete(callback);
2391
+ };
2392
+ },
2393
+ setCanTrack(value) {
2394
+ canTrack = value;
2395
+ }
2396
+ };
2397
+ }
2398
+ var userAttributesService = createUserAttributesService();
2399
+ var setClientUserAttributes = (attributes) => {
2400
+ userAttributesService.setUserAttributes(attributes);
2401
+ };
2402
+
2358
2403
  // src/helpers/canTrack.ts
2359
- var getDefaultCanTrack = (canTrack) => checkIsDefined(canTrack) ? canTrack : true;
2404
+ var getDefaultCanTrack = (canTrack) => {
2405
+ const result = checkIsDefined(canTrack) ? canTrack : true;
2406
+ userAttributesService.setCanTrack(result);
2407
+ return result;
2408
+ };
2360
2409
 
2361
2410
  // src/blocks/accordion/component-info.ts
2362
2411
  var defaultTitle = {
@@ -3087,8 +3136,408 @@ var componentInfo5 = {
3087
3136
  }
3088
3137
  };
3089
3138
 
3090
- // src/blocks/section/component-info.ts
3139
+ // src/blocks/personalization-container/component-info.ts
3091
3140
  var componentInfo6 = {
3141
+ name: "PersonalizationContainer",
3142
+ shouldReceiveBuilderProps: {
3143
+ builderBlock: true,
3144
+ builderContext: true
3145
+ },
3146
+ noWrap: true,
3147
+ image: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F37229ed30d8c41dfb10b8cca1992053a",
3148
+ canHaveChildren: true,
3149
+ inputs: [{
3150
+ name: "variants",
3151
+ defaultValue: [],
3152
+ behavior: "personalizationVariantList",
3153
+ type: "list",
3154
+ subFields: [{
3155
+ name: "name",
3156
+ type: "text"
3157
+ }, {
3158
+ name: "query",
3159
+ friendlyName: "Targeting rules",
3160
+ type: "BuilderQuery",
3161
+ defaultValue: []
3162
+ }, {
3163
+ name: "startDate",
3164
+ type: "date"
3165
+ }, {
3166
+ name: "endDate",
3167
+ type: "date"
3168
+ }, {
3169
+ name: "blocks",
3170
+ type: "uiBlocks",
3171
+ hideFromUI: true,
3172
+ defaultValue: []
3173
+ }]
3174
+ }]
3175
+ };
3176
+ var _tmpl$8 = /* @__PURE__ */ template(`<script>`);
3177
+ function InlinedScript(props) {
3178
+ return (() => {
3179
+ const _el$ = _tmpl$8();
3180
+ effect((_p$) => {
3181
+ const _v$ = props.scriptStr, _v$2 = props.id, _v$3 = props.nonce || "";
3182
+ _v$ !== _p$._v$ && (_el$.innerHTML = _p$._v$ = _v$);
3183
+ _v$2 !== _p$._v$2 && setAttribute(_el$, "data-id", _p$._v$2 = _v$2);
3184
+ _v$3 !== _p$._v$3 && setAttribute(_el$, "nonce", _p$._v$3 = _v$3);
3185
+ return _p$;
3186
+ }, {
3187
+ _v$: void 0,
3188
+ _v$2: void 0,
3189
+ _v$3: void 0
3190
+ });
3191
+ return _el$;
3192
+ })();
3193
+ }
3194
+ var inlined_script_default = InlinedScript;
3195
+
3196
+ // src/functions/is-previewing.ts
3197
+ function isPreviewing(_search) {
3198
+ const search = _search || (isBrowser() ? window.location.search : void 0);
3199
+ if (!search) {
3200
+ return false;
3201
+ }
3202
+ const normalizedSearch = getSearchString(search);
3203
+ return Boolean(normalizedSearch.indexOf("builder.preview=") !== -1);
3204
+ }
3205
+
3206
+ // src/blocks/personalization-container/helpers/inlined-fns.ts
3207
+ function filterWithCustomTargeting(userAttributes, query, startDate, endDate) {
3208
+ function isString(val) {
3209
+ return typeof val === "string";
3210
+ }
3211
+ function isNumber(val) {
3212
+ return typeof val === "number";
3213
+ }
3214
+ function objectMatchesQuery(userattr, query2) {
3215
+ const result = (() => {
3216
+ const property = query2.property;
3217
+ const operator = query2.operator;
3218
+ let testValue = query2.value;
3219
+ if (query2 && query2.property === "urlPath" && query2.value && typeof query2.value === "string" && query2.value !== "/" && query2.value.endsWith("/")) {
3220
+ testValue = query2.value.slice(0, -1);
3221
+ }
3222
+ if (!(property && operator)) {
3223
+ return true;
3224
+ }
3225
+ if (Array.isArray(testValue)) {
3226
+ if (operator === "isNot") {
3227
+ return testValue.every((val) => objectMatchesQuery(userattr, {
3228
+ property,
3229
+ operator,
3230
+ value: val
3231
+ }));
3232
+ }
3233
+ return !!testValue.find((val) => objectMatchesQuery(userattr, {
3234
+ property,
3235
+ operator,
3236
+ value: val
3237
+ }));
3238
+ }
3239
+ const value = userattr[property];
3240
+ if (Array.isArray(value)) {
3241
+ return value.includes(testValue);
3242
+ }
3243
+ switch (operator) {
3244
+ case "is":
3245
+ return value === testValue;
3246
+ case "isNot":
3247
+ return value !== testValue;
3248
+ case "contains":
3249
+ return (isString(value) || Array.isArray(value)) && value.includes(String(testValue));
3250
+ case "startsWith":
3251
+ return isString(value) && value.startsWith(String(testValue));
3252
+ case "endsWith":
3253
+ return isString(value) && value.endsWith(String(testValue));
3254
+ case "greaterThan":
3255
+ return isNumber(value) && isNumber(testValue) && value > testValue;
3256
+ case "lessThan":
3257
+ return isNumber(value) && isNumber(testValue) && value < testValue;
3258
+ case "greaterThanOrEqualTo":
3259
+ return isNumber(value) && isNumber(testValue) && value >= testValue;
3260
+ case "lessThanOrEqualTo":
3261
+ return isNumber(value) && isNumber(testValue) && value <= testValue;
3262
+ default:
3263
+ return false;
3264
+ }
3265
+ })();
3266
+ return result;
3267
+ }
3268
+ const item = {
3269
+ query,
3270
+ startDate,
3271
+ endDate
3272
+ };
3273
+ const now = userAttributes.date && new Date(userAttributes.date) || /* @__PURE__ */ new Date();
3274
+ if (item.startDate && new Date(item.startDate) > now) {
3275
+ return false;
3276
+ } else if (item.endDate && new Date(item.endDate) < now) {
3277
+ return false;
3278
+ }
3279
+ if (!item.query || !item.query.length) {
3280
+ return true;
3281
+ }
3282
+ return item.query.every((filter) => {
3283
+ return objectMatchesQuery(userAttributes, filter);
3284
+ });
3285
+ }
3286
+ var PERSONALIZATION_SCRIPT = `function getPersonalizedVariant(variants, blockId, locale) {
3287
+ if (!navigator.cookieEnabled) {
3288
+ return;
3289
+ }
3290
+ function getCookie(name) {
3291
+ const nameEQ = name + '=';
3292
+ const ca = document.cookie.split(';');
3293
+ for (let i = 0; i < ca.length; i++) {
3294
+ let c = ca[i];
3295
+ while (c.charAt(0) == ' ') c = c.substring(1, c.length);
3296
+ if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
3297
+ }
3298
+ return null;
3299
+ }
3300
+ function removeVariants() {
3301
+ variants?.forEach(function (_, index) {
3302
+ document.querySelector('template[data-variant-id="' + blockId + '-' + index + '"]')?.remove();
3303
+ });
3304
+ document.querySelector('script[data-id="variants-script-' + blockId + '"]')?.remove();
3305
+ document.querySelector('style[data-id="variants-styles-' + blockId + '"]')?.remove();
3306
+ }
3307
+ const attributes = JSON.parse(getCookie('builder.userAttributes') || '{}');
3308
+ if (locale) {
3309
+ attributes.locale = locale;
3310
+ }
3311
+ const winningVariantIndex = variants?.findIndex(function (variant) {
3312
+ return filterWithCustomTargeting(attributes, variant.query, variant.startDate, variant.endDate);
3313
+ });
3314
+ const isDebug = location.href.includes('builder.debug=true');
3315
+ if (isDebug) {
3316
+ console.debug('PersonalizationContainer', {
3317
+ attributes,
3318
+ variants,
3319
+ winningVariantIndex
3320
+ });
3321
+ }
3322
+ if (winningVariantIndex !== -1) {
3323
+ const winningVariant = document.querySelector('template[data-variant-id="' + blockId + '-' + winningVariantIndex + '"]');
3324
+ if (winningVariant) {
3325
+ const parentNode = winningVariant.parentNode;
3326
+ if (parentNode) {
3327
+ const newParent = parentNode.cloneNode(false);
3328
+ newParent.appendChild(winningVariant.content.firstChild);
3329
+ newParent.appendChild(winningVariant.content.lastChild);
3330
+ parentNode.parentNode?.replaceChild(newParent, parentNode);
3331
+ }
3332
+ if (isDebug) {
3333
+ console.debug('PersonalizationContainer', 'Winning variant Replaced:', winningVariant);
3334
+ }
3335
+ }
3336
+ } else if (variants && variants.length > 0) {
3337
+ removeVariants();
3338
+ }
3339
+ }`;
3340
+ 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}";
3341
+
3342
+ // src/blocks/personalization-container/helpers.ts
3343
+ function checkShouldRenderVariants(variants, canTrack) {
3344
+ const hasVariants = variants && variants.length > 0;
3345
+ if (TARGET === "reactNative")
3346
+ return false;
3347
+ if (!hasVariants)
3348
+ return false;
3349
+ if (!canTrack)
3350
+ return false;
3351
+ if (TARGET === "vue" || TARGET === "svelte")
3352
+ return true;
3353
+ if (isBrowser())
3354
+ return false;
3355
+ return true;
3356
+ }
3357
+ function getBlocksToRender({
3358
+ variants,
3359
+ previewingIndex,
3360
+ isHydrated,
3361
+ filteredVariants,
3362
+ fallbackBlocks
3363
+ }) {
3364
+ const fallback = {
3365
+ blocks: fallbackBlocks ?? [],
3366
+ path: "this.children"
3367
+ };
3368
+ if (isHydrated && isEditing()) {
3369
+ if (typeof previewingIndex === "number" && previewingIndex < (variants?.length ?? 0)) {
3370
+ const variant = variants[previewingIndex];
3371
+ return {
3372
+ blocks: variant.blocks,
3373
+ path: `component.options.variants.${previewingIndex}.blocks`
3374
+ };
3375
+ }
3376
+ return fallback;
3377
+ }
3378
+ if (isBrowser()) {
3379
+ const winningVariant = filteredVariants?.[0];
3380
+ if (winningVariant) {
3381
+ return {
3382
+ blocks: winningVariant.blocks,
3383
+ path: `component.options.variants.${variants?.indexOf(winningVariant)}.blocks`
3384
+ };
3385
+ }
3386
+ }
3387
+ return fallback;
3388
+ }
3389
+ var getPersonalizationScript = (variants, blockId, locale) => {
3390
+ return `
3391
+ (function() {
3392
+ ${FILTER_WITH_CUSTOM_TARGETING_SCRIPT}
3393
+ ${PERSONALIZATION_SCRIPT}
3394
+ getPersonalizedVariant(${JSON.stringify(variants)}, "${blockId}"${locale ? `, "${locale}"` : ""})
3395
+ })();
3396
+ `;
3397
+ };
3398
+
3399
+ // src/blocks/personalization-container/personalization-container.tsx
3400
+ var _tmpl$9 = /* @__PURE__ */ template(`<div>`);
3401
+ var _tmpl$25 = /* @__PURE__ */ template(`<template>`);
3402
+ function PersonalizationContainer(props) {
3403
+ const [userAttributes, setUserAttributes] = createSignal(userAttributesService.getUserAttributes());
3404
+ const [scriptStr, setScriptStr] = createSignal(getPersonalizationScript(props.variants, props.builderBlock?.id || "none", props.builderContext?.rootState?.locale));
3405
+ const [unsubscribers, setUnsubscribers] = createSignal([]);
3406
+ const [shouldRenderVariants, setShouldRenderVariants] = createSignal(checkShouldRenderVariants(props.variants, getDefaultCanTrack(props.builderContext?.canTrack)));
3407
+ const [isHydrated, setIsHydrated] = createSignal(false);
3408
+ const filteredVariants = createMemo(() => {
3409
+ return (props.variants || []).filter((variant) => {
3410
+ return filterWithCustomTargeting({
3411
+ ...props.builderContext?.rootState?.locale ? {
3412
+ locale: props.builderContext?.rootState?.locale
3413
+ } : {},
3414
+ ...userAttributes()
3415
+ }, variant.query, variant.startDate, variant.endDate);
3416
+ });
3417
+ });
3418
+ const blocksToRender = createMemo(() => {
3419
+ return getBlocksToRender({
3420
+ variants: props.variants,
3421
+ fallbackBlocks: props.builderBlock?.children,
3422
+ isHydrated: isHydrated(),
3423
+ filteredVariants: filteredVariants(),
3424
+ previewingIndex: props.previewingIndex
3425
+ });
3426
+ });
3427
+ const hideVariantsStyleString = createMemo(() => {
3428
+ return (props.variants || []).map((_, index) => `[data-variant-id="${props.builderBlock?.id}-${index}"] { display: none; } `).join("");
3429
+ });
3430
+ let rootRef;
3431
+ onMount(() => {
3432
+ setIsHydrated(true);
3433
+ const unsub = userAttributesService.subscribeOnUserAttributesChange((attrs) => {
3434
+ setUserAttributes(attrs);
3435
+ });
3436
+ if (!(isEditing() || isPreviewing())) {
3437
+ const variant = filteredVariants()[0];
3438
+ if (rootRef) {
3439
+ rootRef.dispatchEvent(new CustomEvent("builder.variantLoaded", {
3440
+ detail: {
3441
+ variant: variant || "default",
3442
+ content: props.builderContext?.content
3443
+ },
3444
+ bubbles: true
3445
+ }));
3446
+ const observer = new IntersectionObserver((entries) => {
3447
+ entries.forEach((entry) => {
3448
+ if (entry.isIntersecting && rootRef) {
3449
+ rootRef.dispatchEvent(new CustomEvent("builder.variantDisplayed", {
3450
+ detail: {
3451
+ variant: variant || "default",
3452
+ content: props.builderContext?.content
3453
+ },
3454
+ bubbles: true
3455
+ }));
3456
+ }
3457
+ });
3458
+ });
3459
+ observer.observe(rootRef);
3460
+ }
3461
+ }
3462
+ unsubscribers().push(unsub);
3463
+ });
3464
+ return (() => {
3465
+ const _el$ = _tmpl$9();
3466
+ const _ref$ = rootRef;
3467
+ typeof _ref$ === "function" ? use(_ref$, _el$) : rootRef = _el$;
3468
+ spread(_el$, mergeProps({
3469
+ get ["class"]() {
3470
+ return `builder-personalization-container ${props.attributes?.className || ""}`;
3471
+ }
3472
+ }, () => props.attributes), false, true);
3473
+ insert(_el$, createComponent(Show, {
3474
+ get when() {
3475
+ return shouldRenderVariants();
3476
+ },
3477
+ get children() {
3478
+ return [createComponent(For, {
3479
+ get each() {
3480
+ return props.variants;
3481
+ },
3482
+ children: (variant, _index) => {
3483
+ const index = _index();
3484
+ return (() => {
3485
+ const _el$2 = _tmpl$25();
3486
+ setAttribute(_el$2, "key", index);
3487
+ insert(_el$2, createComponent(blocks_default, {
3488
+ get blocks() {
3489
+ return variant.blocks;
3490
+ },
3491
+ get parent() {
3492
+ return props.builderBlock?.id;
3493
+ },
3494
+ path: `component.options.variants.${index}.blocks`
3495
+ }));
3496
+ effect(() => setAttribute(_el$2, "data-variant-id", `${props.builderBlock?.id}-${index}`));
3497
+ return _el$2;
3498
+ })();
3499
+ }
3500
+ }), createComponent(inlined_styles_default, {
3501
+ get nonce() {
3502
+ return props.builderContext?.nonce || "";
3503
+ },
3504
+ get styles() {
3505
+ return hideVariantsStyleString();
3506
+ },
3507
+ get id() {
3508
+ return `variants-styles-${props.builderBlock?.id}`;
3509
+ }
3510
+ }), createComponent(inlined_script_default, {
3511
+ get nonce() {
3512
+ return props.builderContext?.nonce || "";
3513
+ },
3514
+ get scriptStr() {
3515
+ return scriptStr();
3516
+ },
3517
+ get id() {
3518
+ return `variants-script-${props.builderBlock?.id}`;
3519
+ }
3520
+ })];
3521
+ }
3522
+ }), null);
3523
+ insert(_el$, createComponent(blocks_default, {
3524
+ get blocks() {
3525
+ return blocksToRender().blocks;
3526
+ },
3527
+ get parent() {
3528
+ return props.builderBlock?.id;
3529
+ },
3530
+ get path() {
3531
+ return blocksToRender().path;
3532
+ }
3533
+ }), null);
3534
+ return _el$;
3535
+ })();
3536
+ }
3537
+ var personalization_container_default = PersonalizationContainer;
3538
+
3539
+ // src/blocks/section/component-info.ts
3540
+ var componentInfo7 = {
3092
3541
  name: "Core:Section",
3093
3542
  static: true,
3094
3543
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
@@ -3130,7 +3579,7 @@ var componentInfo6 = {
3130
3579
  };
3131
3580
 
3132
3581
  // src/blocks/slot/component-info.ts
3133
- var componentInfo7 = {
3582
+ var componentInfo8 = {
3134
3583
  name: "Slot",
3135
3584
  isRSC: true,
3136
3585
  description: "Allow child blocks to be inserted into this content when used as a Symbol",
@@ -3148,10 +3597,10 @@ var componentInfo7 = {
3148
3597
  builderComponents: true
3149
3598
  }
3150
3599
  };
3151
- var _tmpl$8 = /* @__PURE__ */ template(`<div>`);
3600
+ var _tmpl$10 = /* @__PURE__ */ template(`<div>`);
3152
3601
  function Slot(props) {
3153
3602
  return (() => {
3154
- const _el$ = _tmpl$8();
3603
+ const _el$ = _tmpl$10();
3155
3604
  _el$.style.setProperty("pointer-events", "auto");
3156
3605
  spread(_el$, mergeProps(() => !props.builderContext.context?.symbolId && {
3157
3606
  "builder-slot": props.name
@@ -3179,7 +3628,7 @@ function Slot(props) {
3179
3628
  var slot_default = Slot;
3180
3629
 
3181
3630
  // src/blocks/symbol/component-info.ts
3182
- var componentInfo8 = {
3631
+ var componentInfo9 = {
3183
3632
  name: "Symbol",
3184
3633
  noWrap: true,
3185
3634
  static: true,
@@ -3261,7 +3710,7 @@ var defaultElement = {
3261
3710
  }
3262
3711
  }
3263
3712
  };
3264
- var componentInfo9 = {
3713
+ var componentInfo10 = {
3265
3714
  name: "Builder: Tabs",
3266
3715
  inputs: [{
3267
3716
  name: "tabs",
@@ -3365,8 +3814,8 @@ var componentInfo9 = {
3365
3814
  builderLinkComponent: true
3366
3815
  }
3367
3816
  };
3368
- var _tmpl$9 = /* @__PURE__ */ template(`<div>`);
3369
- var _tmpl$25 = /* @__PURE__ */ template(`<div><div class=builder-tabs-wrap>`);
3817
+ var _tmpl$11 = /* @__PURE__ */ template(`<div>`);
3818
+ var _tmpl$26 = /* @__PURE__ */ template(`<div><div class=builder-tabs-wrap>`);
3370
3819
  var _tmpl$33 = /* @__PURE__ */ template(`<span>`);
3371
3820
  function Tabs(props) {
3372
3821
  const [activeTab, setActiveTab] = createSignal(props.defaultActiveTab ? props.defaultActiveTab - 1 : 0);
@@ -3381,7 +3830,7 @@ function Tabs(props) {
3381
3830
  }
3382
3831
  }
3383
3832
  return (() => {
3384
- const _el$ = _tmpl$25(), _el$2 = _el$.firstChild;
3833
+ const _el$ = _tmpl$26(), _el$2 = _el$.firstChild;
3385
3834
  _el$2.style.setProperty("display", "flex");
3386
3835
  _el$2.style.setProperty("flex-direction", "row");
3387
3836
  _el$2.style.setProperty("overflow", "auto");
@@ -3433,7 +3882,7 @@ function Tabs(props) {
3433
3882
  return activeTabContent(activeTab());
3434
3883
  },
3435
3884
  get children() {
3436
- const _el$3 = _tmpl$9();
3885
+ const _el$3 = _tmpl$11();
3437
3886
  insert(_el$3, createComponent(blocks_default, {
3438
3887
  get parent() {
3439
3888
  return props.builderBlock.id;
@@ -3465,7 +3914,7 @@ var tabs_default = Tabs;
3465
3914
  delegateEvents(["click"]);
3466
3915
 
3467
3916
  // src/blocks/text/component-info.ts
3468
- var componentInfo10 = {
3917
+ var componentInfo11 = {
3469
3918
  shouldReceiveBuilderProps: {
3470
3919
  builderBlock: TARGET === "reactNative" ? true : false,
3471
3920
  builderContext: true
@@ -3488,10 +3937,10 @@ var componentInfo10 = {
3488
3937
  textAlign: "center"
3489
3938
  }
3490
3939
  };
3491
- var _tmpl$10 = /* @__PURE__ */ template(`<div class=builder-text>`);
3940
+ var _tmpl$12 = /* @__PURE__ */ template(`<div class=builder-text>`);
3492
3941
  function Text(props) {
3493
3942
  return (() => {
3494
- const _el$ = _tmpl$10();
3943
+ const _el$ = _tmpl$12();
3495
3944
  _el$.style.setProperty("outline", "none");
3496
3945
  effect(() => _el$.innerHTML = props.text?.toString() || "");
3497
3946
  return _el$;
@@ -3500,7 +3949,7 @@ function Text(props) {
3500
3949
  var text_default = Text;
3501
3950
 
3502
3951
  // src/blocks/custom-code/component-info.ts
3503
- var componentInfo11 = {
3952
+ var componentInfo12 = {
3504
3953
  name: "Custom Code",
3505
3954
  static: true,
3506
3955
  requiredPermissions: ["editCode"],
@@ -3523,7 +3972,7 @@ var componentInfo11 = {
3523
3972
  advanced: true
3524
3973
  }]
3525
3974
  };
3526
- var _tmpl$11 = /* @__PURE__ */ template(`<div>`);
3975
+ var _tmpl$13 = /* @__PURE__ */ template(`<div>`);
3527
3976
  function CustomCode(props) {
3528
3977
  const [scriptsInserted, setScriptsInserted] = createSignal([]);
3529
3978
  const [scriptsRun, setScriptsRun] = createSignal([]);
@@ -3558,7 +4007,7 @@ function CustomCode(props) {
3558
4007
  }
3559
4008
  });
3560
4009
  return (() => {
3561
- const _el$ = _tmpl$11();
4010
+ const _el$ = _tmpl$13();
3562
4011
  const _ref$ = elementRef;
3563
4012
  typeof _ref$ === "function" ? use(_ref$, _el$) : elementRef = _el$;
3564
4013
  effect((_p$) => {
@@ -3576,7 +4025,7 @@ function CustomCode(props) {
3576
4025
  var custom_code_default = CustomCode;
3577
4026
 
3578
4027
  // src/blocks/embed/component-info.ts
3579
- var componentInfo12 = {
4028
+ var componentInfo13 = {
3580
4029
  name: "Embed",
3581
4030
  static: true,
3582
4031
  inputs: [{
@@ -3598,7 +4047,7 @@ var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "applicati
3598
4047
  var isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
3599
4048
 
3600
4049
  // src/blocks/embed/embed.tsx
3601
- var _tmpl$12 = /* @__PURE__ */ template(`<div class=builder-embed>`);
4050
+ var _tmpl$14 = /* @__PURE__ */ template(`<div class=builder-embed>`);
3602
4051
  function Embed(props) {
3603
4052
  const [scriptsInserted, setScriptsInserted] = createSignal([]);
3604
4053
  const [scriptsRun, setScriptsRun] = createSignal([]);
@@ -3636,7 +4085,7 @@ function Embed(props) {
3636
4085
  }
3637
4086
  createEffect(on(() => [onUpdateFn_0_elem(), onUpdateFn_0_ranInitFn__()], onUpdateFn_0));
3638
4087
  return (() => {
3639
- const _el$ = _tmpl$12();
4088
+ const _el$ = _tmpl$14();
3640
4089
  const _ref$ = elem;
3641
4090
  typeof _ref$ === "function" ? use(_ref$, _el$) : elem = _el$;
3642
4091
  effect(() => _el$.innerHTML = props.content);
@@ -3646,7 +4095,7 @@ function Embed(props) {
3646
4095
  var embed_default = Embed;
3647
4096
 
3648
4097
  // src/blocks/form/form/component-info.ts
3649
- var componentInfo13 = {
4098
+ var componentInfo14 = {
3650
4099
  name: "Form:Form",
3651
4100
  // editableTags: ['builder-form-error']
3652
4101
  defaults: {
@@ -3902,9 +4351,9 @@ function logFetch(url) {
3902
4351
  }
3903
4352
 
3904
4353
  // src/blocks/form/form/form.tsx
3905
- var _tmpl$13 = /* @__PURE__ */ template(`<pre class="builder-form-error-text pre-27d18614">`);
3906
- var _tmpl$26 = /* @__PURE__ */ template(`<form>`);
3907
- var _tmpl$34 = /* @__PURE__ */ template(`<style>.pre-27d18614 {
4354
+ var _tmpl$15 = /* @__PURE__ */ template(`<pre class="builder-form-error-text pre-04a43b72">`);
4355
+ var _tmpl$27 = /* @__PURE__ */ template(`<form>`);
4356
+ var _tmpl$34 = /* @__PURE__ */ template(`<style>.pre-04a43b72 {
3908
4357
  padding: 10px;
3909
4358
  color: red;
3910
4359
  text-align: center;
@@ -4096,7 +4545,7 @@ function FormComponent(props) {
4096
4545
  }
4097
4546
  let formRef;
4098
4547
  return [(() => {
4099
- const _el$ = _tmpl$26();
4548
+ const _el$ = _tmpl$27();
4100
4549
  _el$.addEventListener("submit", (event) => onSubmit(event));
4101
4550
  const _ref$ = formRef;
4102
4551
  typeof _ref$ === "function" ? use(_ref$, _el$) : formRef = _el$;
@@ -4114,34 +4563,7 @@ function FormComponent(props) {
4114
4563
  return props.name;
4115
4564
  }
4116
4565
  }, {}, {}, () => props.attributes), false, true);
4117
- insert(_el$, createComponent(Show, {
4118
- get when() {
4119
- return props.builderBlock && props.builderBlock.children;
4120
- },
4121
- get children() {
4122
- return createComponent(For, {
4123
- get each() {
4124
- return props.builderBlock?.children;
4125
- },
4126
- children: (block, _index) => {
4127
- const idx = _index();
4128
- return createComponent(block_default, {
4129
- key: `form-block-${idx}`,
4130
- block,
4131
- get context() {
4132
- return props.builderContext;
4133
- },
4134
- get registeredComponents() {
4135
- return props.builderComponents;
4136
- },
4137
- get linkComponent() {
4138
- return props.builderLinkComponent;
4139
- }
4140
- });
4141
- }
4142
- });
4143
- }
4144
- }), null);
4566
+ insert(_el$, () => props.children, null);
4145
4567
  insert(_el$, createComponent(Show, {
4146
4568
  get when() {
4147
4569
  return submissionState() === "error";
@@ -4179,7 +4601,7 @@ function FormComponent(props) {
4179
4601
  return memo(() => submissionState() === "error")() && responseData();
4180
4602
  },
4181
4603
  get children() {
4182
- const _el$2 = _tmpl$13();
4604
+ const _el$2 = _tmpl$15();
4183
4605
  insert(_el$2, () => JSON.stringify(responseData(), null, 2));
4184
4606
  return _el$2;
4185
4607
  }
@@ -4206,7 +4628,7 @@ function FormComponent(props) {
4206
4628
  var form_default = FormComponent;
4207
4629
 
4208
4630
  // src/blocks/form/input/component-info.ts
4209
- var componentInfo14 = {
4631
+ var componentInfo15 = {
4210
4632
  name: "Form:Input",
4211
4633
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
4212
4634
  inputs: [
@@ -4258,10 +4680,10 @@ var componentInfo14 = {
4258
4680
  borderColor: "#ccc"
4259
4681
  }
4260
4682
  };
4261
- var _tmpl$14 = /* @__PURE__ */ template(`<input>`);
4683
+ var _tmpl$16 = /* @__PURE__ */ template(`<input>`);
4262
4684
  function FormInputComponent(props) {
4263
4685
  return (() => {
4264
- const _el$ = _tmpl$14();
4686
+ const _el$ = _tmpl$16();
4265
4687
  spread(_el$, mergeProps({}, () => props.attributes, {
4266
4688
  get key() {
4267
4689
  return isEditing() && props.defaultValue ? props.defaultValue : "default-key";
@@ -4291,7 +4713,7 @@ function FormInputComponent(props) {
4291
4713
  var input_default = FormInputComponent;
4292
4714
 
4293
4715
  // src/blocks/form/select/component-info.ts
4294
- var componentInfo15 = {
4716
+ var componentInfo16 = {
4295
4717
  name: "Form:Select",
4296
4718
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
4297
4719
  defaultStyles: {
@@ -4334,11 +4756,11 @@ var componentInfo15 = {
4334
4756
  static: true,
4335
4757
  noWrap: true
4336
4758
  };
4337
- var _tmpl$15 = /* @__PURE__ */ template(`<select>`);
4338
- var _tmpl$27 = /* @__PURE__ */ template(`<option>`);
4759
+ var _tmpl$17 = /* @__PURE__ */ template(`<select>`);
4760
+ var _tmpl$28 = /* @__PURE__ */ template(`<option>`);
4339
4761
  function SelectComponent(props) {
4340
4762
  return (() => {
4341
- const _el$ = _tmpl$15();
4763
+ const _el$ = _tmpl$17();
4342
4764
  spread(_el$, mergeProps({}, () => props.attributes, {
4343
4765
  get value() {
4344
4766
  return props.value;
@@ -4363,7 +4785,7 @@ function SelectComponent(props) {
4363
4785
  children: (option, _index) => {
4364
4786
  const index = _index();
4365
4787
  return (() => {
4366
- const _el$2 = _tmpl$27();
4788
+ const _el$2 = _tmpl$28();
4367
4789
  insert(_el$2, () => option.name || option.value);
4368
4790
  effect(() => setAttribute(_el$2, "key", `${option.name}-${index}`));
4369
4791
  effect(() => _el$2.value = option.value);
@@ -4377,7 +4799,7 @@ function SelectComponent(props) {
4377
4799
  var select_default = SelectComponent;
4378
4800
 
4379
4801
  // src/blocks/form/submit-button/component-info.ts
4380
- var componentInfo16 = {
4802
+ var componentInfo17 = {
4381
4803
  name: "Form:SubmitButton",
4382
4804
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
4383
4805
  defaultStyles: {
@@ -4403,10 +4825,10 @@ var componentInfo16 = {
4403
4825
  // TODO: defaultChildren
4404
4826
  // canHaveChildren: true,
4405
4827
  };
4406
- var _tmpl$16 = /* @__PURE__ */ template(`<button type=submit>`);
4828
+ var _tmpl$18 = /* @__PURE__ */ template(`<button type=submit>`);
4407
4829
  function SubmitButton(props) {
4408
4830
  return (() => {
4409
- const _el$ = _tmpl$16();
4831
+ const _el$ = _tmpl$18();
4410
4832
  spread(_el$, mergeProps({}, () => props.attributes), false, true);
4411
4833
  insert(_el$, () => props.text);
4412
4834
  return _el$;
@@ -4415,7 +4837,7 @@ function SubmitButton(props) {
4415
4837
  var submit_button_default = SubmitButton;
4416
4838
 
4417
4839
  // src/blocks/form/textarea/component-info.ts
4418
- var componentInfo17 = {
4840
+ var componentInfo18 = {
4419
4841
  name: "Form:TextArea",
4420
4842
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Ff74a2f3de58c4c3e939204e5b6b8f6c3",
4421
4843
  inputs: [{
@@ -4452,10 +4874,10 @@ var componentInfo17 = {
4452
4874
  static: true,
4453
4875
  noWrap: true
4454
4876
  };
4455
- var _tmpl$17 = /* @__PURE__ */ template(`<textarea>`);
4877
+ var _tmpl$19 = /* @__PURE__ */ template(`<textarea>`);
4456
4878
  function Textarea(props) {
4457
4879
  return (() => {
4458
- const _el$ = _tmpl$17();
4880
+ const _el$ = _tmpl$19();
4459
4881
  spread(_el$, mergeProps({}, () => props.attributes, {
4460
4882
  get placeholder() {
4461
4883
  return props.placeholder;
@@ -4479,7 +4901,7 @@ function Textarea(props) {
4479
4901
  var textarea_default = Textarea;
4480
4902
 
4481
4903
  // src/blocks/img/component-info.ts
4482
- var componentInfo18 = {
4904
+ var componentInfo19 = {
4483
4905
  // friendlyName?
4484
4906
  name: "Raw:Img",
4485
4907
  hideFromInsertMenu: true,
@@ -4494,10 +4916,10 @@ var componentInfo18 = {
4494
4916
  noWrap: true,
4495
4917
  static: true
4496
4918
  };
4497
- var _tmpl$18 = /* @__PURE__ */ template(`<img>`);
4919
+ var _tmpl$20 = /* @__PURE__ */ template(`<img>`);
4498
4920
  function ImgComponent(props) {
4499
4921
  return (() => {
4500
- const _el$ = _tmpl$18();
4922
+ const _el$ = _tmpl$20();
4501
4923
  spread(_el$, mergeProps({
4502
4924
  get style() {
4503
4925
  return {
@@ -4521,7 +4943,7 @@ function ImgComponent(props) {
4521
4943
  var img_default = ImgComponent;
4522
4944
 
4523
4945
  // src/blocks/video/component-info.ts
4524
- var componentInfo19 = {
4946
+ var componentInfo20 = {
4525
4947
  name: "Video",
4526
4948
  canHaveChildren: true,
4527
4949
  defaultStyles: {
@@ -4606,8 +5028,8 @@ var componentInfo19 = {
4606
5028
  builderBlock: true
4607
5029
  }
4608
5030
  };
4609
- var _tmpl$19 = /* @__PURE__ */ template(`<source type=video/mp4>`);
4610
- var _tmpl$28 = /* @__PURE__ */ template(`<div>`);
5031
+ var _tmpl$21 = /* @__PURE__ */ template(`<source type=video/mp4>`);
5032
+ var _tmpl$29 = /* @__PURE__ */ template(`<div>`);
4611
5033
  var _tmpl$35 = /* @__PURE__ */ template(`<div><video class=builder-video>`);
4612
5034
  function Video(props) {
4613
5035
  const videoProps = createMemo(() => {
@@ -4650,7 +5072,6 @@ function Video(props) {
4650
5072
  "object-position": props.position,
4651
5073
  // Hack to get object fit to work as expected and
4652
5074
  // not have the video overflow
4653
- "z-index": 2,
4654
5075
  "border-radius": "1px",
4655
5076
  ...props.aspectRatio ? {
4656
5077
  position: "absolute"
@@ -4669,7 +5090,7 @@ function Video(props) {
4669
5090
  return !props.lazyLoad;
4670
5091
  },
4671
5092
  get children() {
4672
- const _el$3 = _tmpl$19();
5093
+ const _el$3 = _tmpl$21();
4673
5094
  effect(() => setAttribute(_el$3, "src", props.video));
4674
5095
  return _el$3;
4675
5096
  }
@@ -4679,7 +5100,7 @@ function Video(props) {
4679
5100
  return props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length);
4680
5101
  },
4681
5102
  get children() {
4682
- const _el$4 = _tmpl$28();
5103
+ const _el$4 = _tmpl$29();
4683
5104
  _el$4.style.setProperty("width", "100%");
4684
5105
  _el$4.style.setProperty("pointer-events", "none");
4685
5106
  _el$4.style.setProperty("font-size", "0px");
@@ -4692,7 +5113,7 @@ function Video(props) {
4692
5113
  return props.builderBlock?.children?.length && props.fitContent;
4693
5114
  },
4694
5115
  get children() {
4695
- const _el$5 = _tmpl$28();
5116
+ const _el$5 = _tmpl$29();
4696
5117
  _el$5.style.setProperty("display", "flex");
4697
5118
  _el$5.style.setProperty("flex-direction", "column");
4698
5119
  _el$5.style.setProperty("align-items", "stretch");
@@ -4705,7 +5126,7 @@ function Video(props) {
4705
5126
  return props.builderBlock?.children?.length && !props.fitContent;
4706
5127
  },
4707
5128
  get children() {
4708
- const _el$6 = _tmpl$28();
5129
+ const _el$6 = _tmpl$29();
4709
5130
  _el$6.style.setProperty("pointer-events", "none");
4710
5131
  _el$6.style.setProperty("display", "flex");
4711
5132
  _el$6.style.setProperty("flex-direction", "column");
@@ -4727,31 +5148,31 @@ var video_default = Video;
4727
5148
  // src/constants/extra-components.ts
4728
5149
  var getExtraComponents = () => [{
4729
5150
  component: custom_code_default,
4730
- ...componentInfo11
5151
+ ...componentInfo12
4731
5152
  }, {
4732
5153
  component: embed_default,
4733
- ...componentInfo12
5154
+ ...componentInfo13
4734
5155
  }, ...TARGET === "rsc" ? [] : [{
4735
5156
  component: form_default,
4736
- ...componentInfo13
5157
+ ...componentInfo14
4737
5158
  }, {
4738
5159
  component: input_default,
4739
- ...componentInfo14
5160
+ ...componentInfo15
4740
5161
  }, {
4741
5162
  component: submit_button_default,
4742
- ...componentInfo16
5163
+ ...componentInfo17
4743
5164
  }, {
4744
5165
  component: select_default,
4745
- ...componentInfo15
5166
+ ...componentInfo16
4746
5167
  }, {
4747
5168
  component: textarea_default,
4748
- ...componentInfo17
5169
+ ...componentInfo18
4749
5170
  }], {
4750
5171
  component: img_default,
4751
- ...componentInfo18
5172
+ ...componentInfo19
4752
5173
  }, {
4753
5174
  component: video_default,
4754
- ...componentInfo19
5175
+ ...componentInfo20
4755
5176
  }];
4756
5177
 
4757
5178
  // src/constants/builder-registered-components.ts
@@ -4769,19 +5190,22 @@ var getDefaultRegisteredComponents = () => [{
4769
5190
  ...componentInfo5
4770
5191
  }, {
4771
5192
  component: section_default,
4772
- ...componentInfo6
5193
+ ...componentInfo7
4773
5194
  }, {
4774
5195
  component: slot_default,
4775
- ...componentInfo7
5196
+ ...componentInfo8
4776
5197
  }, {
4777
5198
  component: symbol_default,
4778
- ...componentInfo8
5199
+ ...componentInfo9
4779
5200
  }, {
4780
5201
  component: text_default,
4781
- ...componentInfo10
4782
- }, ...TARGET === "rsc" ? [] : [{
5202
+ ...componentInfo11
5203
+ }, ...TARGET === "react" ? [{
5204
+ component: personalization_container_default,
5205
+ ...componentInfo6
5206
+ }] : [], ...TARGET === "rsc" ? [] : [{
4783
5207
  component: tabs_default,
4784
- ...componentInfo9
5208
+ ...componentInfo10
4785
5209
  }, {
4786
5210
  component: accordion_default,
4787
5211
  ...componentInfo
@@ -4819,7 +5243,7 @@ var getVariants = (content) => Object.values(content?.variations || {}).map((var
4819
5243
  testVariationId: variant.id,
4820
5244
  id: content?.id
4821
5245
  }));
4822
- var checkShouldRenderVariants = ({
5246
+ var checkShouldRenderVariants2 = ({
4823
5247
  canTrack,
4824
5248
  content
4825
5249
  }) => {
@@ -4852,25 +5276,6 @@ var getUpdateVariantVisibilityScript = ({
4852
5276
  }) => `window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME}(
4853
5277
  "${variationId}", "${contentId}", ${isHydrationTarget}
4854
5278
  )`;
4855
- var _tmpl$20 = /* @__PURE__ */ template(`<script>`);
4856
- function InlinedScript(props) {
4857
- return (() => {
4858
- const _el$ = _tmpl$20();
4859
- effect((_p$) => {
4860
- const _v$ = props.scriptStr, _v$2 = props.id, _v$3 = props.nonce || "";
4861
- _v$ !== _p$._v$ && (_el$.innerHTML = _p$._v$ = _v$);
4862
- _v$2 !== _p$._v$2 && setAttribute(_el$, "data-id", _p$._v$2 = _v$2);
4863
- _v$3 !== _p$._v$3 && setAttribute(_el$, "nonce", _p$._v$3 = _v$3);
4864
- return _p$;
4865
- }, {
4866
- _v$: void 0,
4867
- _v$2: void 0,
4868
- _v$3: void 0
4869
- });
4870
- return _el$;
4871
- })();
4872
- }
4873
- var inlined_script_default = InlinedScript;
4874
5279
 
4875
5280
  // src/helpers/preview-lru-cache/get.ts
4876
5281
  function getPreviewContent(_searchParams) {
@@ -4878,7 +5283,7 @@ function getPreviewContent(_searchParams) {
4878
5283
  }
4879
5284
 
4880
5285
  // src/constants/sdk-version.ts
4881
- var SDK_VERSION = "3.0.3";
5286
+ var SDK_VERSION = "3.0.6";
4882
5287
 
4883
5288
  // src/helpers/sdk-headers.ts
4884
5289
  var getSdkHeaders = () => ({
@@ -5175,16 +5580,6 @@ async function fetchEntries(options) {
5175
5580
  return _processContentResult(options, content);
5176
5581
  }
5177
5582
 
5178
- // src/functions/is-previewing.ts
5179
- function isPreviewing(_search) {
5180
- const search = _search || (isBrowser() ? window.location.search : void 0);
5181
- if (!search) {
5182
- return false;
5183
- }
5184
- const normalizedSearch = getSearchString(search);
5185
- return Boolean(normalizedSearch.indexOf("builder.preview=") !== -1);
5186
- }
5187
-
5188
5583
  // src/helpers/uuid.ts
5189
5584
  function uuidv4() {
5190
5585
  return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) {
@@ -5511,7 +5906,8 @@ var setupBrowserForEditing = (options = {}) => {
5511
5906
  // Supports builder-model="..." attribute which is needed to
5512
5907
  // scope our '+ add block' button styling
5513
5908
  supportsAddBlockScoping: true,
5514
- supportsCustomBreakpoints: true
5909
+ supportsCustomBreakpoints: true,
5910
+ blockLevelPersonalization: true
5515
5911
  }
5516
5912
  }, "*");
5517
5913
  window.parent?.postMessage({
@@ -6248,7 +6644,7 @@ var content_default = ContentComponent;
6248
6644
 
6249
6645
  // src/components/content-variants/content-variants.tsx
6250
6646
  function ContentVariants(props) {
6251
- const [shouldRenderVariants, setShouldRenderVariants] = createSignal(checkShouldRenderVariants({
6647
+ const [shouldRenderVariants, setShouldRenderVariants] = createSignal(checkShouldRenderVariants2({
6252
6648
  canTrack: getDefaultCanTrack(props.canTrack),
6253
6649
  content: props.content
6254
6650
  }));
@@ -6474,7 +6870,7 @@ var fetchSymbolContent = async ({
6474
6870
  };
6475
6871
 
6476
6872
  // src/blocks/symbol/symbol.tsx
6477
- var _tmpl$21 = /* @__PURE__ */ template(`<div>`);
6873
+ var _tmpl$30 = /* @__PURE__ */ template(`<div>`);
6478
6874
  function Symbol(props) {
6479
6875
  const [contentToUse, setContentToUse] = createSignal(props.symbol?.content);
6480
6876
  const blocksWrapper = createMemo(() => {
@@ -6506,7 +6902,7 @@ function Symbol(props) {
6506
6902
  }
6507
6903
  createEffect(on(() => [onUpdateFn_0_props_symbol()], onUpdateFn_0));
6508
6904
  return (() => {
6509
- const _el$ = _tmpl$21();
6905
+ const _el$ = _tmpl$30();
6510
6906
  spread(_el$, mergeProps({
6511
6907
  get ["class"]() {
6512
6908
  return className();
@@ -6598,4 +6994,4 @@ var fetchBuilderProps = async (_args) => {
6598
6994
  };
6599
6995
  };
6600
6996
 
6601
- export { blocks_default as Blocks, builder_context_default as BuilderContext, button_default as Button, columns_default as Columns, content_variants_default as Content, fragment_default as Fragment, image_default as Image, section_default as Section, symbol_default as Symbol, text_default as Text, video_default as Video, _processContentResult, createRegisterComponentMessage, fetchBuilderProps, fetchEntries, fetchOneEntry, getBuilderSearchParams, isEditing, isPreviewing, register, setEditorSettings, subscribeToEditor, track };
6997
+ export { blocks_default as Blocks, builder_context_default as BuilderContext, button_default as Button, columns_default as Columns, content_variants_default as Content, fragment_default as Fragment, image_default as Image, section_default as Section, symbol_default as Symbol, text_default as Text, video_default as Video, _processContentResult, createRegisterComponentMessage, fetchBuilderProps, fetchEntries, fetchOneEntry, getBuilderSearchParams, isEditing, isPreviewing, register, setClientUserAttributes, setEditorSettings, subscribeToEditor, track };