@builder.io/sdk-qwik 0.7.3 → 0.7.5

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.
@@ -3948,8 +3948,9 @@ const Block = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) =>
3948
3948
  props
3949
3949
  ]));
3950
3950
  const processedBlock = useComputedQrl(/* @__PURE__ */ inlinedQrl(() => {
3951
- const [props2, repeatItem2] = useLexicalScope();
3952
- return repeatItem2.value ? props2.block : getProcessedBlock({
3951
+ var _a2;
3952
+ const [props2] = useLexicalScope();
3953
+ return ((_a2 = props2.block.repeat) == null ? void 0 : _a2.collection) ? props2.block : getProcessedBlock({
3953
3954
  block: props2.block,
3954
3955
  localState: props2.context.localState,
3955
3956
  rootState: props2.context.rootState,
@@ -3958,8 +3959,7 @@ const Block = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) =>
3958
3959
  shouldEvaluateBindings: true
3959
3960
  });
3960
3961
  }, "Block_component_processedBlock_useComputed_ESKw0l5FcBc", [
3961
- props,
3962
- repeatItem
3962
+ props
3963
3963
  ]));
3964
3964
  const Tag = useComputedQrl(/* @__PURE__ */ inlinedQrl(() => {
3965
3965
  const [props2] = useLexicalScope();
@@ -3968,14 +3968,19 @@ const Block = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) =>
3968
3968
  props
3969
3969
  ]));
3970
3970
  const canShowBlock = useComputedQrl(/* @__PURE__ */ inlinedQrl(() => {
3971
- const [processedBlock2] = useLexicalScope();
3971
+ var _a2, _b;
3972
+ const [processedBlock2, props2, repeatItem2] = useLexicalScope();
3972
3973
  if ("hide" in processedBlock2.value)
3973
3974
  return !processedBlock2.value.hide;
3974
3975
  if ("show" in processedBlock2.value)
3975
3976
  return processedBlock2.value.show;
3977
+ if (((_a2 = props2.block.repeat) == null ? void 0 : _a2.collection) && !((_b = repeatItem2.value) == null ? void 0 : _b.length))
3978
+ return false;
3976
3979
  return true;
3977
3980
  }, "Block_component_canShowBlock_useComputed_NJEFz8ICF08", [
3978
- processedBlock
3981
+ processedBlock,
3982
+ props,
3983
+ repeatItem
3979
3984
  ]));
3980
3985
  const childrenWithoutParentComponent = useComputedQrl(/* @__PURE__ */ inlinedQrl(() => {
3981
3986
  var _a2;
@@ -5804,6 +5809,8 @@ const componentInfo = {
5804
5809
  ]
5805
5810
  };
5806
5811
  const Video = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
5812
+ var _a, _b, _c, _d, _e, _f, _g;
5813
+ _jsxBranch();
5807
5814
  const videoProps = useComputedQrl(/* @__PURE__ */ inlinedQrl(() => {
5808
5815
  const [props2] = useLexicalScope();
5809
5816
  return {
@@ -5827,43 +5834,83 @@ const Video = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) =>
5827
5834
  props
5828
5835
  ]));
5829
5836
  const spreadProps = useComputedQrl(/* @__PURE__ */ inlinedQrl(() => {
5830
- const [props2, videoProps2] = useLexicalScope();
5837
+ const [videoProps2] = useLexicalScope();
5831
5838
  return {
5832
- ...props2.attributes,
5833
5839
  ...videoProps2.value
5834
5840
  };
5835
5841
  }, "Video_component_spreadProps_useComputed_ZdLsx18NYH4", [
5836
- props,
5837
5842
  videoProps
5838
5843
  ]));
5839
- return /* @__PURE__ */ _jsxS("video", {
5840
- ...spreadProps.value
5841
- }, {
5842
- poster: _fnSignal((p0) => p0.posterImage, [
5843
- props
5844
- ], "p0.posterImage"),
5845
- preload: _fnSignal((p0) => p0.preload || "metadata", [
5846
- props
5847
- ], 'p0.preload||"metadata"'),
5848
- src: _fnSignal((p0) => p0.video || "no-src", [
5849
- props
5850
- ], 'p0.video||"no-src"'),
5851
- style: _fnSignal((p0) => {
5852
- var _a;
5853
- return {
5844
+ return /* @__PURE__ */ _jsxQ("div", null, {
5845
+ style: {
5846
+ position: "relative"
5847
+ }
5848
+ }, [
5849
+ /* @__PURE__ */ _jsxS("video", {
5850
+ ...spreadProps.value,
5851
+ children: !props.lazyLoad ? /* @__PURE__ */ _jsxQ("source", null, {
5852
+ src: _fnSignal((p0) => p0.video, [
5853
+ props
5854
+ ], "p0.video"),
5855
+ type: "video/mp4"
5856
+ }, null, 3, "j7_0") : null,
5857
+ style: {
5854
5858
  width: "100%",
5855
5859
  height: "100%",
5856
- ...(_a = p0.attributes) == null ? void 0 : _a.style,
5857
- objectFit: p0.fit,
5858
- objectPosition: p0.position,
5860
+ ...(_a = props.attributes) == null ? void 0 : _a.style,
5861
+ objectFit: props.fit,
5862
+ objectPosition: props.position,
5859
5863
  // Hack to get object fit to work as expected and
5860
5864
  // not have the video overflow
5861
- borderRadius: 1
5862
- };
5863
- }, [
5864
- props
5865
- ], '{width:"100%",height:"100%",...p0.attributes?.style,objectFit:p0.fit,objectPosition:p0.position,borderRadius:1}')
5866
- }, 0, "j7_0");
5865
+ zIndex: 2,
5866
+ borderRadius: "1px",
5867
+ ...props.aspectRatio ? {
5868
+ position: "absolute"
5869
+ } : null
5870
+ }
5871
+ }, {
5872
+ class: "builder-video",
5873
+ poster: _fnSignal((p0) => p0.posterImage, [
5874
+ props
5875
+ ], "p0.posterImage"),
5876
+ preload: _fnSignal((p0) => p0.preload || "metadata", [
5877
+ props
5878
+ ], 'p0.preload||"metadata"'),
5879
+ src: _fnSignal((p0) => p0.video || "no-src", [
5880
+ props
5881
+ ], 'p0.video||"no-src"')
5882
+ }, 0, null),
5883
+ props.aspectRatio && !(props.fitContent && ((_c = (_b = props.builderBlock) == null ? void 0 : _b.children) == null ? void 0 : _c.length)) ? /* @__PURE__ */ _jsxQ("div", null, {
5884
+ style: _fnSignal((p0) => ({
5885
+ width: "100%",
5886
+ paddingTop: p0.aspectRatio * 100 + "%",
5887
+ pointerEvents: "none",
5888
+ fontSize: "0px"
5889
+ }), [
5890
+ props
5891
+ ], '{width:"100%",paddingTop:p0.aspectRatio*100+"%",pointerEvents:"none",fontSize:"0px"}')
5892
+ }, null, 3, "j7_1") : null,
5893
+ ((_e = (_d = props.builderBlock) == null ? void 0 : _d.children) == null ? void 0 : _e.length) && props.fitContent ? /* @__PURE__ */ _jsxQ("div", null, {
5894
+ style: {
5895
+ display: "flex",
5896
+ flexDirection: "column",
5897
+ alignItems: "stretch"
5898
+ }
5899
+ }, /* @__PURE__ */ _jsxC(Slot, null, 3, "j7_2"), 1, "j7_3") : null,
5900
+ ((_g = (_f = props.builderBlock) == null ? void 0 : _f.children) == null ? void 0 : _g.length) && !props.fitContent ? /* @__PURE__ */ _jsxQ("div", null, {
5901
+ style: {
5902
+ pointerEvents: "none",
5903
+ display: "flex",
5904
+ flexDirection: "column",
5905
+ alignItems: "stretch",
5906
+ position: "absolute",
5907
+ top: "0",
5908
+ left: "0",
5909
+ width: "100%",
5910
+ height: "100%"
5911
+ }
5912
+ }, /* @__PURE__ */ _jsxC(Slot, null, 3, "j7_4"), 1, "j7_5") : null
5913
+ ], 1, "j7_6");
5867
5914
  }, "Video_component_qdcTZflYyoQ"));
5868
5915
  const getDefaultRegisteredComponents = () => [
5869
5916
  {
@@ -5929,12 +5976,16 @@ const serializeComponentInfo = ({ inputs, ...info }) => ({
5929
5976
  [key]: serializeValue(value)
5930
5977
  }), {}))
5931
5978
  });
5979
+ const UPDATE_COOKIES_AND_STYLES_SCRIPT = "function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {\n function getAndSetVariantId() {\n function setCookie(name, value, days) {\n let expires = '';\n if (days) {\n const date = new Date();\n date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);\n expires = '; expires=' + date.toUTCString();\n }\n document.cookie = name + '=' + (value || '') + expires + '; path=/' + '; Secure; SameSite=None';\n }\n function getCookie(name) {\n const nameEQ = name + '=';\n const ca = document.cookie.split(';');\n for (let i = 0; i < ca.length; i++) {\n let c = ca[i];\n while (c.charAt(0) === ' ') c = c.substring(1, c.length);\n if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);\n }\n return null;\n }\n const cookieName = `builder.tests.${contentId}`;\n const variantInCookie = getCookie(cookieName);\n const availableIDs = variants.map(vr => vr.id).concat(contentId);\n if (variantInCookie && availableIDs.includes(variantInCookie)) {\n return variantInCookie;\n }\n let n = 0;\n const random = Math.random();\n for (let i = 0; i < variants.length; i++) {\n const variant = variants[i];\n const testRatio = variant.testRatio;\n n += testRatio;\n if (random < n) {\n setCookie(cookieName, variant.id);\n return variant.id;\n }\n }\n setCookie(cookieName, contentId);\n return contentId;\n }\n const winningVariantId = getAndSetVariantId();\n const styleEl = document.currentScript?.previousElementSibling;\n if (isHydrationTarget) {\n styleEl.remove();\n const thisScriptEl = document.currentScript;\n thisScriptEl?.remove();\n } else {\n const newStyleStr = variants.concat({\n id: contentId\n }).filter(variant => variant.id !== winningVariantId).map(value => {\n return `.variant-${value.id} { display: none; }\n `;\n }).join('');\n styleEl.innerHTML = newStyleStr;\n }\n}";
5980
+ const UPDATE_VARIANT_VISIBILITY_SCRIPT = "function updateVariantVisibility(variantContentId, defaultContentId, isHydrationTarget) {\n if (!navigator.cookieEnabled) {\n return;\n }\n function getCookie(name) {\n const nameEQ = name + '=';\n const ca = document.cookie.split(';');\n for (let i = 0; i < ca.length; i++) {\n let c = ca[i];\n while (c.charAt(0) === ' ') c = c.substring(1, c.length);\n if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);\n }\n return null;\n }\n const cookieName = `builder.tests.${defaultContentId}`;\n const winningVariant = getCookie(cookieName);\n const parentDiv = document.currentScript?.parentElement;\n const isDefaultContent = variantContentId === defaultContentId;\n const isWinningVariant = winningVariant === variantContentId;\n if (isWinningVariant && !isDefaultContent) {\n parentDiv?.removeAttribute('hidden');\n parentDiv?.removeAttribute('aria-hidden');\n } else if (!isWinningVariant && isDefaultContent) {\n parentDiv?.setAttribute('hidden', 'true');\n parentDiv?.setAttribute('aria-hidden', 'true');\n }\n if (isHydrationTarget) {\n if (!isWinningVariant) {\n parentDiv?.remove();\n }\n const thisScriptEl = document.currentScript;\n thisScriptEl?.remove();\n }\n return;\n}";
5981
+ const UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME = "builderIoAbTest";
5982
+ const UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME = "builderIoRenderContent";
5932
5983
  const getVariants = (content) => Object.values((content == null ? void 0 : content.variations) || {}).map((variant) => ({
5933
5984
  ...variant,
5934
5985
  testVariationId: variant.id,
5935
5986
  id: content == null ? void 0 : content.id
5936
5987
  }));
5937
- const checkShouldRunVariants = ({ canTrack, content }) => {
5988
+ const checkShouldRenderVariants = ({ canTrack, content }) => {
5938
5989
  const hasVariants = getVariants(content).length > 0;
5939
5990
  if (!hasVariants)
5940
5991
  return false;
@@ -5944,131 +5995,27 @@ const checkShouldRunVariants = ({ canTrack, content }) => {
5944
5995
  return false;
5945
5996
  return true;
5946
5997
  };
5947
- function bldrAbTest(contentId, variants, isHydrationTarget2) {
5948
- var _a;
5949
- function getAndSetVariantId2() {
5950
- function setCookie2(name, value, days) {
5951
- let expires = "";
5952
- if (days) {
5953
- const date = /* @__PURE__ */ new Date();
5954
- date.setTime(date.getTime() + days * 864e5);
5955
- expires = "; expires=" + date.toUTCString();
5956
- }
5957
- document.cookie = name + "=" + (value || "") + expires + "; path=/; Secure; SameSite=None";
5958
- }
5959
- function getCookie2(name) {
5960
- const nameEQ = name + "=";
5961
- const ca2 = document.cookie.split(";");
5962
- for (let i = 0; i < ca2.length; i++) {
5963
- let c = ca2[i];
5964
- while (c.charAt(0) === " ")
5965
- c = c.substring(1, c.length);
5966
- if (c.indexOf(nameEQ) === 0)
5967
- return c.substring(nameEQ.length, c.length);
5968
- }
5969
- return null;
5970
- }
5971
- const cookieName = `builder.tests.${contentId}`;
5972
- const variantInCookie = getCookie2(cookieName);
5973
- const availableIDs = variants.map((vr) => vr.id).concat(contentId);
5974
- if (variantInCookie && availableIDs.includes(variantInCookie))
5975
- return variantInCookie;
5976
- let n = 0;
5977
- const random = Math.random();
5978
- for (let i = 0; i < variants.length; i++) {
5979
- const variant = variants[i];
5980
- const testRatio = variant.testRatio;
5981
- n += testRatio;
5982
- if (random < n) {
5983
- setCookie2(cookieName, variant.id);
5984
- return variant.id;
5985
- }
5986
- }
5987
- setCookie2(cookieName, contentId);
5988
- return contentId;
5989
- }
5990
- const winningVariantId = getAndSetVariantId2();
5991
- const styleEl = (_a = document.currentScript) == null ? void 0 : _a.previousElementSibling;
5992
- if (isHydrationTarget2) {
5993
- styleEl.remove();
5994
- const thisScriptEl = document.currentScript;
5995
- thisScriptEl == null ? void 0 : thisScriptEl.remove();
5996
- } else {
5997
- const newStyleStr = variants.concat({
5998
- id: contentId
5999
- }).filter((variant) => variant.id !== winningVariantId).map((value) => {
6000
- return `.variant-${value.id} { display: none; }
6001
- `;
6002
- }).join("");
6003
- styleEl.innerHTML = newStyleStr;
6004
- }
6005
- }
6006
- function bldrCntntScrpt(variantContentId, defaultContentId, isHydrationTarget2) {
6007
- var _a;
6008
- if (!navigator.cookieEnabled)
6009
- return;
6010
- function getCookie2(name) {
6011
- const nameEQ = name + "=";
6012
- const ca2 = document.cookie.split(";");
6013
- for (let i = 0; i < ca2.length; i++) {
6014
- let c = ca2[i];
6015
- while (c.charAt(0) === " ")
6016
- c = c.substring(1, c.length);
6017
- if (c.indexOf(nameEQ) === 0)
6018
- return c.substring(nameEQ.length, c.length);
6019
- }
6020
- return null;
6021
- }
6022
- const cookieName = `builder.tests.${defaultContentId}`;
6023
- const variantId = getCookie2(cookieName);
6024
- const parentDiv = (_a = document.currentScript) == null ? void 0 : _a.parentElement;
6025
- const variantIsDefaultContent = variantContentId === defaultContentId;
6026
- if (variantId === variantContentId) {
6027
- if (variantIsDefaultContent)
6028
- return;
6029
- parentDiv == null ? void 0 : parentDiv.removeAttribute("hidden");
6030
- parentDiv == null ? void 0 : parentDiv.removeAttribute("aria-hidden");
6031
- } else {
6032
- if (variantIsDefaultContent) {
6033
- if (isHydrationTarget2)
6034
- parentDiv == null ? void 0 : parentDiv.remove();
6035
- else {
6036
- parentDiv == null ? void 0 : parentDiv.setAttribute("hidden", "true");
6037
- parentDiv == null ? void 0 : parentDiv.setAttribute("aria-hidden", "true");
6038
- }
6039
- }
6040
- return;
6041
- }
6042
- return;
6043
- }
6044
5998
  const getIsHydrationTarget = (target) => target === "react" || target === "reactNative";
6045
5999
  const isHydrationTarget = getIsHydrationTarget(TARGET);
6046
- const AB_TEST_FN_NAME = "builderIoAbTest";
6047
- const CONTENT_FN_NAME = "builderIoRenderContent";
6048
- const getScriptString = () => {
6049
- const fnStr = bldrAbTest.toString().replace(/\s+/g, " ");
6050
- const fnStr2 = bldrCntntScrpt.toString().replace(/\s+/g, " ");
6051
- return `
6052
- window.${AB_TEST_FN_NAME} = ${fnStr}
6053
- window.${CONTENT_FN_NAME} = ${fnStr2}
6000
+ const getScriptString = () => `
6001
+ window.${UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME} = ${UPDATE_COOKIES_AND_STYLES_SCRIPT}
6002
+ window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME} = ${UPDATE_VARIANT_VISIBILITY_SCRIPT}
6054
6003
  `;
6055
- };
6056
- const getVariantsScriptString = (variants, contentId) => {
6057
- return `
6058
- window.${AB_TEST_FN_NAME}("${contentId}",${JSON.stringify(variants)}, ${isHydrationTarget})`;
6059
- };
6060
- const getRenderContentScriptString = ({ contentId, variationId }) => {
6061
- return `
6062
- window.${CONTENT_FN_NAME}("${variationId}", "${contentId}", ${isHydrationTarget})`;
6063
- };
6004
+ const getUpdateCookieAndStylesScript = (variants, contentId) => `
6005
+ window.${UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME}(
6006
+ "${contentId}",${JSON.stringify(variants)}, ${isHydrationTarget}
6007
+ )`;
6008
+ const getUpdateVariantVisibilityScript = ({ contentId, variationId }) => `window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME}(
6009
+ "${variationId}", "${contentId}", ${isHydrationTarget}
6010
+ )`;
6064
6011
  const InlinedScript = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
6065
6012
  return /* @__PURE__ */ _jsxQ("script", null, {
6066
6013
  dangerouslySetInnerHTML: _fnSignal((p0) => p0.scriptStr, [
6067
6014
  props
6068
6015
  ], "p0.scriptStr"),
6069
- id: _fnSignal((p0) => p0.id, [
6016
+ id: _fnSignal((p0) => p0.id || "", [
6070
6017
  props
6071
- ], "p0.id")
6018
+ ], 'p0.id||""')
6072
6019
  }, null, 3, "WO_0");
6073
6020
  }, "InlinedScript_component_hwThBdhA8rw"));
6074
6021
  function getGlobalThis() {
@@ -6448,7 +6395,7 @@ const getInteractionPropertiesForEvent = (event) => {
6448
6395
  }
6449
6396
  };
6450
6397
  };
6451
- const SDK_VERSION = "0.7.3";
6398
+ const SDK_VERSION = "0.7.5";
6452
6399
  const registry = {};
6453
6400
  function register(type, info) {
6454
6401
  let typeList = registry[type];
@@ -6706,7 +6653,7 @@ const emitStateUpdate = function emitStateUpdate2(props, state, elementRef) {
6706
6653
  }));
6707
6654
  };
6708
6655
  const EnableEditor = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
6709
- var _a, _b, _c;
6656
+ var _a, _b, _c, _d, _e;
6710
6657
  _jsxBranch();
6711
6658
  const elementRef = useSignal();
6712
6659
  const state = useStore({
@@ -6766,7 +6713,7 @@ const EnableEditor = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
6766
6713
  state
6767
6714
  ]));
6768
6715
  useOn("qvisible", /* @__PURE__ */ inlinedQrl((event, element) => {
6769
- var _a2, _b2, _c2, _d;
6716
+ var _a2, _b2, _c2, _d2;
6770
6717
  if (isBrowser()) {
6771
6718
  if (isEditing() && element)
6772
6719
  element.dispatchEvent(new CustomEvent("initeditingbldr"));
@@ -6774,7 +6721,7 @@ const EnableEditor = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
6774
6721
  if (shouldTrackImpression) {
6775
6722
  const variationId = (_b2 = element.attributes.getNamedItem("variationId")) == null ? void 0 : _b2.value;
6776
6723
  const contentId = (_c2 = element.attributes.getNamedItem("contentId")) == null ? void 0 : _c2.value;
6777
- const apiKeyProp = (_d = element.attributes.getNamedItem("apiKey")) == null ? void 0 : _d.value;
6724
+ const apiKeyProp = (_d2 = element.attributes.getNamedItem("apiKey")) == null ? void 0 : _d2.value;
6778
6725
  _track({
6779
6726
  type: "impression",
6780
6727
  canTrack: true,
@@ -6872,7 +6819,7 @@ const EnableEditor = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
6872
6819
  hidden: true,
6873
6820
  "aria-hidden": true
6874
6821
  },
6875
- class: props.classNameProp
6822
+ class: `variant-${((_d = props.content) == null ? void 0 : _d.testVariationId) || ((_e = props.content) == null ? void 0 : _e.id)}`
6876
6823
  }, /* @__PURE__ */ _jsxC(Slot, null, 3, "06_0")) : null
6877
6824
  }, 1, "06_1");
6878
6825
  }, "EnableEditor_component_ko1mO8oaj8k"));
@@ -6959,22 +6906,19 @@ ${getFontCss({
6959
6906
  const getContextStateInitialValue = ({ content, data, locale }) => {
6960
6907
  var _a, _b, _c;
6961
6908
  const defaultValues = {};
6962
- (_b = (_a = content == null ? void 0 : content.data) == null ? void 0 : _a.inputs) == null ? void 0 : _b.forEach((input) => {
6963
- var _a2;
6964
- if (input.name && input.defaultValue !== void 0 && ((_a2 = content == null ? void 0 : content.data) == null ? void 0 : _a2.state) && content.data.state[input.name] === void 0)
6909
+ const initialState = ((_a = content == null ? void 0 : content.data) == null ? void 0 : _a.state) || {};
6910
+ (_c = (_b = content == null ? void 0 : content.data) == null ? void 0 : _b.inputs) == null ? void 0 : _c.forEach((input) => {
6911
+ if (input.name && input.defaultValue !== void 0)
6965
6912
  defaultValues[input.name] = input.defaultValue;
6966
6913
  });
6967
- const stateToUse = {
6968
- ...(_c = content == null ? void 0 : content.data) == null ? void 0 : _c.state,
6914
+ return {
6915
+ ...defaultValues,
6916
+ ...initialState,
6969
6917
  ...data,
6970
6918
  ...locale ? {
6971
6919
  locale
6972
6920
  } : {}
6973
6921
  };
6974
- return {
6975
- ...defaultValues,
6976
- ...stateToUse
6977
- };
6978
6922
  };
6979
6923
  const getContentInitialValue = ({ content, data }) => {
6980
6924
  return !content ? void 0 : {
@@ -7036,7 +6980,7 @@ const ContentComponent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl
7036
6980
  ...serializeComponentInfo(info)
7037
6981
  }
7038
6982
  }), {}),
7039
- scriptStr: getRenderContentScriptString({
6983
+ scriptStr: getUpdateVariantVisibilityScript({
7040
6984
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
7041
6985
  variationId: (_a = props.content) == null ? void 0 : _a.testVariationId,
7042
6986
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
@@ -7073,9 +7017,6 @@ const ContentComponent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl
7073
7017
  get enrich() {
7074
7018
  return props.enrich;
7075
7019
  },
7076
- get classNameProp() {
7077
- return props.classNameProp;
7078
- },
7079
7020
  get showContent() {
7080
7021
  return props.showContent;
7081
7022
  },
@@ -7164,9 +7105,6 @@ const ContentComponent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl
7164
7105
  canTrack: _fnSignal((p0) => p0.canTrack, [
7165
7106
  props
7166
7107
  ], "p0.canTrack"),
7167
- classNameProp: _fnSignal((p0) => p0.classNameProp, [
7168
- props
7169
- ], "p0.classNameProp"),
7170
7108
  content: _fnSignal((p0) => p0.content, [
7171
7109
  props
7172
7110
  ], "p0.content"),
@@ -7194,19 +7132,19 @@ const ContentComponent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl
7194
7132
  const ContentVariants = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
7195
7133
  _jsxBranch();
7196
7134
  const state = useStore({
7197
- shouldRenderVariants: checkShouldRunVariants({
7135
+ shouldRenderVariants: checkShouldRenderVariants({
7198
7136
  canTrack: getDefaultCanTrack(props.canTrack),
7199
7137
  content: props.content
7200
7138
  })
7201
7139
  });
7202
- const variantScriptStr = useComputedQrl(/* @__PURE__ */ inlinedQrl(() => {
7140
+ const updateCookieAndStylesScriptStr = useComputedQrl(/* @__PURE__ */ inlinedQrl(() => {
7203
7141
  var _a;
7204
7142
  const [props2] = useLexicalScope();
7205
- return getVariantsScriptString(getVariants(props2.content).map((value) => ({
7143
+ return getUpdateCookieAndStylesScript(getVariants(props2.content).map((value) => ({
7206
7144
  id: value.testVariationId,
7207
7145
  testRatio: value.testRatio
7208
7146
  })), ((_a = props2.content) == null ? void 0 : _a.id) || "");
7209
- }, "ContentVariants_component_variantScriptStr_useComputed_ldWqWafT8Ww", [
7147
+ }, "ContentVariants_component_updateCookieAndStylesScriptStr_useComputed_FtJXWpnoDYg", [
7210
7148
  props
7211
7149
  ]));
7212
7150
  const hideVariantsStyleString = useComputedQrl(/* @__PURE__ */ inlinedQrl(() => {
@@ -7263,11 +7201,11 @@ const ContentVariants = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl(
7263
7201
  }, 3, "XM_1"),
7264
7202
  /* @__PURE__ */ _jsxC(InlinedScript, {
7265
7203
  get scriptStr() {
7266
- return variantScriptStr.value;
7204
+ return updateCookieAndStylesScriptStr.value;
7267
7205
  },
7268
7206
  [_IMMUTABLE]: {
7269
7207
  scriptStr: _fnSignal((p0) => p0.value, [
7270
- variantScriptStr
7208
+ updateCookieAndStylesScriptStr
7271
7209
  ], "p0.value")
7272
7210
  }
7273
7211
  }, 3, "XM_2"),
@@ -7275,9 +7213,6 @@ const ContentVariants = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl(
7275
7213
  return /* @__PURE__ */ _jsxC(ContentComponent, {
7276
7214
  content: variant,
7277
7215
  showContent: false,
7278
- get classNameProp() {
7279
- return void 0;
7280
- },
7281
7216
  get model() {
7282
7217
  return props.model;
7283
7218
  },
@@ -7321,7 +7256,6 @@ const ContentVariants = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl(
7321
7256
  canTrack: _fnSignal((p0) => p0.canTrack, [
7322
7257
  props
7323
7258
  ], "p0.canTrack"),
7324
- classNameProp: _IMMUTABLE,
7325
7259
  context: _fnSignal((p0) => p0.context, [
7326
7260
  props
7327
7261
  ], "p0.context"),
@@ -7356,10 +7290,6 @@ const ContentVariants = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl(
7356
7290
  get content() {
7357
7291
  return defaultContent.value;
7358
7292
  },
7359
- get classNameProp() {
7360
- var _a;
7361
- return `variant-${(_a = props.content) == null ? void 0 : _a.id}`;
7362
- },
7363
7293
  showContent: true,
7364
7294
  get model() {
7365
7295
  return props.model;
@@ -7404,12 +7334,6 @@ const ContentVariants = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl(
7404
7334
  canTrack: _fnSignal((p0) => p0.canTrack, [
7405
7335
  props
7406
7336
  ], "p0.canTrack"),
7407
- classNameProp: _fnSignal((p0) => {
7408
- var _a;
7409
- return `variant-${(_a = p0.content) == null ? void 0 : _a.id}`;
7410
- }, [
7411
- props
7412
- ], "`variant-${p0.content?.id}`"),
7413
7337
  content: _fnSignal((p0) => p0.value, [
7414
7338
  defaultContent
7415
7339
  ], "p0.value"),