@builder.io/sdk-react 4.2.1 → 4.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/browser/blocks-exports.cjs +17 -17
- package/lib/browser/blocks-exports.mjs +759 -742
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +1 -1
- package/lib/browser/{server-entry-4cf669a1.cjs → server-entry-06504dba.cjs} +1 -1
- package/lib/browser/{server-entry-5e98a993.js → server-entry-074665de.js} +1 -1
- package/lib/browser/server-entry.cjs +1 -1
- package/lib/browser/server-entry.mjs +1 -1
- package/lib/edge/{accordion-4bab42b1.cjs → accordion-0768e15a.cjs} +1 -1
- package/lib/edge/{accordion-a8a363e4.js → accordion-d3831f48.js} +1 -1
- package/lib/edge/{blocks-e1f5b0d0.js → blocks-0269007e.js} +105 -106
- package/lib/edge/{blocks-d07d0261.cjs → blocks-2af1d7c9.cjs} +10 -10
- package/lib/edge/blocks-exports.cjs +1 -1
- package/lib/edge/blocks-exports.mjs +2 -2
- package/lib/edge/{button-6734c0bb.cjs → button-050f4fef.cjs} +1 -1
- package/lib/edge/{button-bbcadacf.js → button-a478ff1a.js} +2 -2
- package/lib/edge/{columns-cf3081c6.js → columns-0b3181f1.js} +3 -3
- package/lib/edge/{columns-821cba14.cjs → columns-25375990.cjs} +1 -1
- package/lib/edge/{content-variants-a704e35c.js → content-variants-0dd65b50.js} +426 -415
- package/lib/edge/content-variants-4cab7215.cjs +302 -0
- package/lib/edge/{custom-code-8fcaa31e.cjs → custom-code-eb5aedd2.cjs} +1 -1
- package/lib/edge/{custom-code-f6c30129.js → custom-code-f7a0f1c1.js} +1 -1
- package/lib/edge/{embed-666d3cc4.cjs → embed-69114c35.cjs} +1 -1
- package/lib/edge/{embed-3c0b5564.js → embed-e4979560.js} +1 -1
- package/lib/edge/{form-8b068721.js → form-30fba682.js} +24 -21
- package/lib/edge/form-7b4bd399.cjs +1 -0
- package/lib/edge/{get-class-prop-name-d6d821d6.js → get-class-prop-name-770bdff2.js} +1 -1
- package/lib/edge/{get-class-prop-name-2869a960.cjs → get-class-prop-name-f470d5ce.cjs} +1 -1
- package/lib/edge/{img-dfbd4080.js → img-3bb375bf.js} +1 -1
- package/lib/edge/{img-b04b9b6d.cjs → img-ddf74e12.cjs} +1 -1
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +1 -1
- package/lib/edge/{input-d31d6451.cjs → input-a6caf021.cjs} +1 -1
- package/lib/edge/{input-665ef328.js → input-e4a9fe0b.js} +1 -1
- package/lib/edge/{personalization-container-e784836e.js → personalization-container-64f3cd71.js} +4 -4
- package/lib/edge/{personalization-container-d12566e8.cjs → personalization-container-f7030f08.cjs} +1 -1
- package/lib/edge/{select-c3085265.cjs → select-c217566c.cjs} +1 -1
- package/lib/edge/{select-5fe49bd4.js → select-c59c9ac6.js} +1 -1
- package/lib/edge/{server-entry-acf5ce7d.cjs → server-entry-67200cf1.cjs} +1 -1
- package/lib/edge/{server-entry-c9d5300f.js → server-entry-fb5f2b80.js} +1 -1
- package/lib/edge/server-entry.cjs +1 -1
- package/lib/edge/server-entry.mjs +1 -1
- package/lib/edge/{slot-a17ee2d7.js → slot-26ec2911.js} +3 -3
- package/lib/edge/{slot-cbbbb02e.cjs → slot-ccd946e2.cjs} +1 -1
- package/lib/edge/{symbol-9f960685.js → symbol-10cb2f77.js} +26 -23
- package/lib/edge/symbol-4548e942.cjs +1 -0
- package/lib/edge/tabs-82a9170c.cjs +1 -0
- package/lib/edge/{tabs-26ac5b2f.js → tabs-f9110171.js} +24 -23
- package/lib/node/blocks-exports.cjs +20 -20
- package/lib/node/blocks-exports.mjs +919 -902
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +3 -3
- package/lib/node/init.cjs +1 -1
- package/lib/node/init.mjs +3 -3
- package/lib/node/{server-entry-48724189.js → server-entry-83d3751d.js} +1 -1
- package/lib/node/{server-entry-562c0663.cjs → server-entry-d40e4b66.cjs} +1 -1
- package/lib/node/server-entry.cjs +1 -1
- package/lib/node/server-entry.mjs +1 -1
- package/lib/node/{setIvm-3b6199a0.cjs → setIvm-0a5b2ba2.cjs} +1 -1
- package/lib/node/{setIvm-a7aba6d2.js → setIvm-596668c3.js} +1 -1
- package/lib/node/setIvm.cjs +1 -1
- package/lib/node/setIvm.mjs +2 -2
- package/lib/node/{should-force-browser-runtime-in-node-fdc70f22.js → should-force-browser-runtime-in-node-180c3315.js} +1 -1
- package/lib/node/{should-force-browser-runtime-in-node-cbe0ef14.cjs → should-force-browser-runtime-in-node-5b9e373d.cjs} +1 -1
- package/package.json +1 -1
- package/types/blocks/symbol/symbol.types.d.ts +1 -2
- package/types/components/awaiter.d.ts +1 -11
- package/types/components/awaiter.types.d.ts +7 -0
- package/types/constants/sdk-version.d.ts +1 -1
- package/lib/edge/content-variants-ec180883.cjs +0 -302
- package/lib/edge/form-51f639ab.cjs +0 -1
- package/lib/edge/symbol-b56b5675.cjs +0 -1
- package/lib/edge/tabs-bf6643d7.cjs +0 -1
|
@@ -1,302 +0,0 @@
|
|
|
1
|
-
"use strict";const h=require("react/jsx-runtime"),s=require("react"),r=require("./server-entry-acf5ce7d.cjs"),P=require("./blocks-exports.cjs"),F=require("./blocks-d07d0261.cjs");function re(e,t,n,o){function l(b){return typeof b=="string"}function u(b){return typeof b=="number"}function a(b,f){return(()=>{const C=f.property,R=f.operator;let m=f.value;if(f&&f.property==="urlPath"&&f.value&&typeof f.value=="string"&&f.value!=="/"&&f.value.endsWith("/")&&(m=f.value.slice(0,-1)),!(C&&R))return!0;if(Array.isArray(m))return R==="isNot"?m.every(E=>a(b,{property:C,operator:R,value:E})):!!m.find(E=>a(b,{property:C,operator:R,value:E}));const c=b[C];if(Array.isArray(c))return c.includes(m);switch(R){case"is":return c===m;case"isNot":return c!==m;case"contains":return(l(c)||Array.isArray(c))&&c.includes(String(m));case"startsWith":return l(c)&&c.startsWith(String(m));case"endsWith":return l(c)&&c.endsWith(String(m));case"greaterThan":return u(c)&&u(m)&&c>m;case"lessThan":return u(c)&&u(m)&&c<m;case"greaterThanOrEqualTo":return u(c)&&u(m)&&c>=m;case"lessThanOrEqualTo":return u(c)&&u(m)&&c<=m;default:return!1}})()}const i={query:t,startDate:n,endDate:o},d=e.date&&new Date(e.date)||new Date;return i.startDate&&new Date(i.startDate)>d||i.endDate&&new Date(i.endDate)<d?!1:!i.query||!i.query.length?!0:i.query.every(b=>a(e,b))}const se=`function getPersonalizedVariant(variants, blockId, isHydrationTarget, locale) {
|
|
2
|
-
if (!navigator.cookieEnabled) {
|
|
3
|
-
return;
|
|
4
|
-
}
|
|
5
|
-
function getCookie(name) {
|
|
6
|
-
const nameEQ = name + '=';
|
|
7
|
-
const ca = document.cookie.split(';');
|
|
8
|
-
for (let i = 0; i < ca.length; i++) {
|
|
9
|
-
let c = ca[i];
|
|
10
|
-
while (c.charAt(0) == ' ') c = c.substring(1, c.length);
|
|
11
|
-
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
|
|
12
|
-
}
|
|
13
|
-
return null;
|
|
14
|
-
}
|
|
15
|
-
const attributes = JSON.parse(getCookie('builder.userAttributes') || '{}');
|
|
16
|
-
if (locale) {
|
|
17
|
-
attributes.locale = locale;
|
|
18
|
-
}
|
|
19
|
-
const winningVariantIndex = variants?.findIndex(function (variant) {
|
|
20
|
-
return window.filterWithCustomTargeting(attributes, variant.query, variant.startDate, variant.endDate);
|
|
21
|
-
});
|
|
22
|
-
const parentDiv = document.currentScript?.parentElement;
|
|
23
|
-
const variantId = parentDiv?.getAttribute('data-variant-id');
|
|
24
|
-
const isDefaultVariant = variantId === \`\${blockId}-default\`;
|
|
25
|
-
const isWinningVariant = winningVariantIndex !== -1 && variantId === \`\${blockId}-\${winningVariantIndex}\` || winningVariantIndex === -1 && isDefaultVariant;
|
|
26
|
-
if (isWinningVariant && !isDefaultVariant) {
|
|
27
|
-
parentDiv?.removeAttribute('hidden');
|
|
28
|
-
parentDiv?.removeAttribute('aria-hidden');
|
|
29
|
-
} else if (!isWinningVariant && isDefaultVariant) {
|
|
30
|
-
parentDiv?.setAttribute('hidden', 'true');
|
|
31
|
-
parentDiv?.setAttribute('aria-hidden', 'true');
|
|
32
|
-
}
|
|
33
|
-
if (isHydrationTarget) {
|
|
34
|
-
if (!isWinningVariant) {
|
|
35
|
-
const itsStyleEl = parentDiv?.previousElementSibling;
|
|
36
|
-
if (itsStyleEl) {
|
|
37
|
-
itsStyleEl.remove();
|
|
38
|
-
}
|
|
39
|
-
parentDiv?.remove();
|
|
40
|
-
}
|
|
41
|
-
const thisScript = document.currentScript;
|
|
42
|
-
if (thisScript) {
|
|
43
|
-
thisScript.remove();
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}`,le=`function filterWithCustomTargeting(userAttributes, query, startDate, endDate) {
|
|
47
|
-
function isString(val) {
|
|
48
|
-
return typeof val === 'string';
|
|
49
|
-
}
|
|
50
|
-
function isNumber(val) {
|
|
51
|
-
return typeof val === 'number';
|
|
52
|
-
}
|
|
53
|
-
function objectMatchesQuery(userattr, query) {
|
|
54
|
-
const result = (() => {
|
|
55
|
-
const property = query.property;
|
|
56
|
-
const operator = query.operator;
|
|
57
|
-
let testValue = query.value;
|
|
58
|
-
if (query && query.property === 'urlPath' && query.value && typeof query.value === 'string' && query.value !== '/' && query.value.endsWith('/')) {
|
|
59
|
-
testValue = query.value.slice(0, -1);
|
|
60
|
-
}
|
|
61
|
-
if (!(property && operator)) {
|
|
62
|
-
return true;
|
|
63
|
-
}
|
|
64
|
-
if (Array.isArray(testValue)) {
|
|
65
|
-
if (operator === 'isNot') {
|
|
66
|
-
return testValue.every(val => objectMatchesQuery(userattr, {
|
|
67
|
-
property,
|
|
68
|
-
operator,
|
|
69
|
-
value: val
|
|
70
|
-
}));
|
|
71
|
-
}
|
|
72
|
-
return !!testValue.find(val => objectMatchesQuery(userattr, {
|
|
73
|
-
property,
|
|
74
|
-
operator,
|
|
75
|
-
value: val
|
|
76
|
-
}));
|
|
77
|
-
}
|
|
78
|
-
const value = userattr[property];
|
|
79
|
-
if (Array.isArray(value)) {
|
|
80
|
-
return value.includes(testValue);
|
|
81
|
-
}
|
|
82
|
-
switch (operator) {
|
|
83
|
-
case 'is':
|
|
84
|
-
return value === testValue;
|
|
85
|
-
case 'isNot':
|
|
86
|
-
return value !== testValue;
|
|
87
|
-
case 'contains':
|
|
88
|
-
return (isString(value) || Array.isArray(value)) && value.includes(String(testValue));
|
|
89
|
-
case 'startsWith':
|
|
90
|
-
return isString(value) && value.startsWith(String(testValue));
|
|
91
|
-
case 'endsWith':
|
|
92
|
-
return isString(value) && value.endsWith(String(testValue));
|
|
93
|
-
case 'greaterThan':
|
|
94
|
-
return isNumber(value) && isNumber(testValue) && value > testValue;
|
|
95
|
-
case 'lessThan':
|
|
96
|
-
return isNumber(value) && isNumber(testValue) && value < testValue;
|
|
97
|
-
case 'greaterThanOrEqualTo':
|
|
98
|
-
return isNumber(value) && isNumber(testValue) && value >= testValue;
|
|
99
|
-
case 'lessThanOrEqualTo':
|
|
100
|
-
return isNumber(value) && isNumber(testValue) && value <= testValue;
|
|
101
|
-
default:
|
|
102
|
-
return false;
|
|
103
|
-
}
|
|
104
|
-
})();
|
|
105
|
-
return result;
|
|
106
|
-
}
|
|
107
|
-
const item = {
|
|
108
|
-
query,
|
|
109
|
-
startDate,
|
|
110
|
-
endDate
|
|
111
|
-
};
|
|
112
|
-
const now = userAttributes.date && new Date(userAttributes.date) || new Date();
|
|
113
|
-
if (item.startDate && new Date(item.startDate) > now) {
|
|
114
|
-
return false;
|
|
115
|
-
} else if (item.endDate && new Date(item.endDate) < now) {
|
|
116
|
-
return false;
|
|
117
|
-
}
|
|
118
|
-
if (!item.query || !item.query.length) {
|
|
119
|
-
return true;
|
|
120
|
-
}
|
|
121
|
-
return item.query.every(filter => {
|
|
122
|
-
return objectMatchesQuery(userAttributes, filter);
|
|
123
|
-
});
|
|
124
|
-
}`,ue=`function updateVisibilityStylesScript(variants, blockId, isHydrationTarget, locale) {
|
|
125
|
-
function getCookie(name) {
|
|
126
|
-
const nameEQ = name + '=';
|
|
127
|
-
const ca = document.cookie.split(';');
|
|
128
|
-
for (let i = 0; i < ca.length; i++) {
|
|
129
|
-
let c = ca[i];
|
|
130
|
-
while (c.charAt(0) == ' ') c = c.substring(1, c.length);
|
|
131
|
-
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
|
|
132
|
-
}
|
|
133
|
-
return null;
|
|
134
|
-
}
|
|
135
|
-
const visibilityStylesEl = document.currentScript?.previousElementSibling;
|
|
136
|
-
if (!visibilityStylesEl) {
|
|
137
|
-
return;
|
|
138
|
-
}
|
|
139
|
-
if (isHydrationTarget) {
|
|
140
|
-
visibilityStylesEl.remove();
|
|
141
|
-
const currentScript = document.currentScript;
|
|
142
|
-
if (currentScript) {
|
|
143
|
-
currentScript.remove();
|
|
144
|
-
}
|
|
145
|
-
} else {
|
|
146
|
-
const attributes = JSON.parse(getCookie('builder.userAttributes') || '{}');
|
|
147
|
-
if (locale) {
|
|
148
|
-
attributes.locale = locale;
|
|
149
|
-
}
|
|
150
|
-
const winningVariantIndex = variants?.findIndex(function (variant) {
|
|
151
|
-
return window.filterWithCustomTargeting(attributes, variant.query, variant.startDate, variant.endDate);
|
|
152
|
-
});
|
|
153
|
-
if (winningVariantIndex !== -1) {
|
|
154
|
-
let newStyleStr = variants?.map((_, index) => {
|
|
155
|
-
if (index === winningVariantIndex) return '';
|
|
156
|
-
return \`div[data-variant-id="\${blockId}-\${index}"] { display: none !important; } \`;
|
|
157
|
-
}).join('') || '';
|
|
158
|
-
newStyleStr += \`div[data-variant-id="\${blockId}-default"] { display: none !important; } \`;
|
|
159
|
-
visibilityStylesEl.innerHTML = newStyleStr;
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
}`,Y="default",de="filterWithCustomTargeting",X="builderIoPersonalization",Z="updateVisibilityStylesScript",ee=["react","vue","svelte","qwik"],te=["vue","svelte","qwik"];function ce(e,t){return!(e&&e.length>0)||!t?!1:te.includes(r.TARGET)?!0:!r.isBrowser()}function me({variants:e,previewingIndex:t,isHydrated:n,filteredVariants:o,fallbackBlocks:l}){var a;const u={blocks:l!=null?l:[],path:"this.children",index:Y};if(n&&r.isEditing()){if(typeof t=="number"&&t<((a=e==null?void 0:e.length)!=null?a:0)){const i=e==null?void 0:e[t];if(i)return{blocks:i.blocks,path:`variants.${t}.blocks`,index:t}}return u}if(r.isBrowser()){const i=o==null?void 0:o[0];if(i&&e){const d=e.indexOf(i);if(d!==-1)return{blocks:i.blocks,path:`variants.${d}.blocks`,index:d}}}return u}const pe=()=>`
|
|
163
|
-
window.${de} = ${le}
|
|
164
|
-
window.${X} = ${se}
|
|
165
|
-
window.${Z} = ${ue}
|
|
166
|
-
`,ne=r.TARGET==="react",fe=(e,t,n)=>`window.${X}(${JSON.stringify(e)}, "${t}", ${ne}${n?`, "${n}"`:""})`,ge=(e,t,n)=>`window.${Z}(${JSON.stringify(e)}, "${t}", ${ne}${n?`, "${n}"`:""})`,U={"@type":"@builder.io/sdk:Element",layerName:"Accordion item title",responsiveStyles:{large:{marginTop:"10px",position:"relative",display:"flex",alignItems:"stretch",flexDirection:"column",paddingBottom:"10px"}},children:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{textAlign:"left",display:"flex",flexDirection:"column"}},component:{name:"Text",options:{text:"I am an accordion title. Click me!"}}}]},L={"@type":"@builder.io/sdk:Element",layerName:"Accordion item detail",responsiveStyles:{large:{position:"relative",display:"flex",alignItems:"stretch",flexDirection:"column",marginTop:"10px",paddingBottom:"10px"}},children:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{paddingTop:"50px",textAlign:"left",display:"flex",flexDirection:"column",paddingBottom:"50px"}},component:{name:"Text",options:{text:"I am an accordion detail, hello!"}}}]},he={name:"Builder:Accordion",canHaveChildren:!0,image:"https://cdn.builder.io/api/v1/image/assets%2FagZ9n5CUKRfbL9t6CaJOyVSK4Es2%2Ffab6c1fd3fe542408cbdec078bca7f35",defaultStyles:{display:"flex",flexDirection:"column",alignItems:"stretch"},inputs:[{name:"items",type:"list",broadcast:!0,subFields:[{name:"title",type:"uiBlocks",hideFromUI:!0,defaultValue:[U]},{name:"detail",type:"uiBlocks",hideFromUI:!0,defaultValue:[L]}],defaultValue:[{title:[U],detail:[L]},{title:[U],detail:[L]}],showIf:e=>!e.get("useChildrenForItems")},{name:"oneAtATime",helperText:"Only allow opening one at a time (collapse all others when new item openned)",type:"boolean",defaultValue:!1},{name:"grid",helperText:"Display as a grid",type:"boolean",defaultValue:!1},{name:"gridRowWidth",helperText:"Display as a grid",type:"string",showIf:e=>e.get("grid"),defaultValue:"25%"},{name:"useChildrenForItems",type:"boolean",helperText:"Use child elements for each slide, instead of the array. Useful for dynamically repeating items",advanced:!0,defaultValue:!1,onChange:e=>{e.get("useChildrenForItems")===!0&&e.set("items",[])}}],shouldReceiveBuilderProps:{builderBlock:!0,builderContext:!0,builderComponents:!0,builderLinkComponent:!0}},be=s.lazy(()=>Promise.resolve().then(()=>require("./accordion-4bab42b1.cjs"))),ye={name:"Core:Button",image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",defaultStyles:{appearance:"none",paddingTop:"15px",paddingBottom:"15px",paddingLeft:"25px",paddingRight:"25px",backgroundColor:"#000000",color:"white",borderRadius:"4px",textAlign:"center",cursor:"pointer"},inputs:[{name:"text",type:"text",defaultValue:"Click me!",bubble:!0},{name:"link",type:"url",bubble:!0},{name:"openLinkInNewTab",type:"boolean",defaultValue:!1,friendlyName:"Open link in new tab"}],static:!0,noWrap:!0,shouldReceiveBuilderProps:{builderLinkComponent:!0}},ve={name:"Columns",isRSC:!0,inputs:[{name:"columns",type:"array",broadcast:!0,subFields:[{name:"blocks",type:"array",hideFromUI:!0,defaultValue:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto",minHeight:"20px",minWidth:"20px",overflow:"hidden"}},component:{name:"Image",options:{image:"https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",backgroundPosition:"center",backgroundSize:"cover",aspectRatio:.7004048582995948}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto"}},component:{name:"Text",options:{text:"<p>Enter some text...</p>"}}}]},{name:"width",type:"number",hideFromUI:!0,helperText:"Width %, e.g. set to 50 to fill half of the space"},{name:"link",type:"url",helperText:"Optionally set a url that clicking this column will link to"}],defaultValue:[{blocks:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto",minHeight:"20px",minWidth:"20px",overflow:"hidden"}},component:{name:"Image",options:{image:"https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",backgroundPosition:"center",backgroundSize:"cover",aspectRatio:.7004048582995948}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto"}},component:{name:"Text",options:{text:"<p>Enter some text...</p>"}}}]},{blocks:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto",minHeight:"20px",minWidth:"20px",overflow:"hidden"}},component:{name:"Image",options:{image:"https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",backgroundPosition:"center",backgroundSize:"cover",aspectRatio:.7004048582995948}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto"}},component:{name:"Text",options:{text:"<p>Enter some text...</p>"}}}]}],onChange:e=>{function t(){n.forEach(o=>{o.delete("width")})}const n=e.get("columns");Array.isArray(n)&&n.find(l=>l.get("width"))&&(n.find(u=>!u.get("width"))||n.reduce((i,d)=>i+d.get("width"),0)!==100)&&t()}},{name:"space",type:"number",defaultValue:20,helperText:"Size of gap between columns",advanced:!0},{name:"stackColumnsAt",type:"string",defaultValue:"tablet",helperText:"Convert horizontal columns to vertical at what device size",enum:["tablet","mobile","never"],advanced:!0},{name:"reverseColumnsWhenStacked",type:"boolean",defaultValue:!1,helperText:"When stacking columns for mobile devices, reverse the ordering",advanced:!0}],shouldReceiveBuilderProps:{builderBlock:!0,builderContext:!0,builderComponents:!0,builderLinkComponent:!0}},xe={name:"Fragment",static:!0,hidden:!0,canHaveChildren:!0,noWrap:!0},O=["jpeg","jpg","png","svg","webp","gif","jfif","pjpeg","pjp","apng","avif","tif","tiff","heif","bmp","eps","raw","cr2","nef","orf","sr2","psd","heic","dib","ai"],Se=["mp4","webm","mkv","flv","vob","ogv","ogg","drc","gif","gifv","mng","avi","mov","qt","mts","m2ts","ts","wmv","yuv","rm","rmvb","viv","asf","amv","m4p","mpeg","mpe","m2v","m4v","svi","3gp","3g2","mxf","roq","nsv","f4v","f4p","f4a","f4b"],Te={name:"Image",static:!0,image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",defaultStyles:{position:"relative",minHeight:"20px",minWidth:"20px",overflow:"hidden"},canHaveChildren:!0,inputs:[{name:"image",type:"file",bubble:!0,allowedFileTypes:O,required:!0,defaultValue:"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F72c80f114dc149019051b6852a9e3b7a",onChange:e=>{e.delete("srcset"),e.delete("noWebp");function n(a,i=6e4){return new Promise((d,b)=>{const f=document.createElement("img");let W=!1;f.onload=()=>{W=!0,d(f)},f.addEventListener("error",C=>{console.warn("Image load failed",C.error),b(C.error)}),f.src=a,setTimeout(()=>{W||b(new Error("Image load timed out"))},i)})}function o(a){return Math.round(a*1e3)/1e3}const l=e.get("image"),u=e.get("aspectRatio");if(fetch(l).then(a=>a.blob()).then(a=>{a.type.includes("svg")&&e.set("noWebp",!0)}),l&&(!u||u===.7041))return n(l).then(a=>{const i=e.get("aspectRatio");e.get("image")===l&&(!i||i===.7041)&&a.width&&a.height&&(e.set("aspectRatio",o(a.height/a.width)),e.set("height",a.height),e.set("width",a.width))})}},{name:"backgroundSize",type:"text",defaultValue:"cover",enum:[{label:"contain",value:"contain",helperText:"The image should never get cropped"},{label:"cover",value:"cover",helperText:"The image should fill it's box, cropping when needed"}]},{name:"backgroundPosition",type:"text",defaultValue:"center",enum:["center","top","left","right","bottom","top left","top right","bottom left","bottom right"]},{name:"altText",type:"string",helperText:"Text to display when the user has images off"},{name:"title",type:"string",helperText:"Text to display when hovering over the asset"},{name:"height",type:"number",hideFromUI:!0},{name:"width",type:"number",hideFromUI:!0},{name:"sizes",type:"string",hideFromUI:!0},{name:"srcset",type:"string",hideFromUI:!0},{name:"lazy",type:"boolean",defaultValue:!0,hideFromUI:!0},{name:"fitContent",type:"boolean",helperText:"When child blocks are provided, fit to them instead of using the image's aspect ratio",defaultValue:!0},{name:"highPriority",type:"boolean",advanced:!0,helperText:"Mark this image as high priority compared to other images on the page. This prevents lazy loading of the image and tells the browser to load this image before others on the page."},{name:"aspectRatio",type:"number",helperText:"This is the ratio of height/width, e.g. set to 1.5 for a 300px wide and 200px tall photo. Set to 0 to not force the image to maintain it's aspect ratio",advanced:!0,defaultValue:.7041}],shouldReceiveBuilderProps:{builderBlock:!0}},Ie={name:"PersonalizationContainer",shouldReceiveBuilderProps:{builderBlock:!0,builderContext:!0,builderComponents:!0},noWrap:!0,image:"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F37229ed30d8c41dfb10b8cca1992053a",canHaveChildren:!0,inputs:[{name:"variants",defaultValue:[],behavior:"personalizationVariantList",type:"list",subFields:[{name:"name",type:"text"},{name:"query",friendlyName:"Targeting rules",type:"BuilderQuery",defaultValue:[]},{name:"startDate",type:"date"},{name:"endDate",type:"date"},{name:"blocks",type:"uiBlocks",hideFromUI:!0,defaultValue:[]}]}]},ke=s.lazy(()=>Promise.resolve().then(()=>require("./personalization-container-d12566e8.cjs"))),Ce={name:"Core:Section",static:!0,image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",inputs:[{name:"maxWidth",type:"number",defaultValue:1200},{name:"lazyLoad",type:"boolean",defaultValue:!1,advanced:!0,description:"Only render this section when in view"}],defaultStyles:{paddingLeft:"20px",paddingRight:"20px",paddingTop:"50px",paddingBottom:"50px",marginTop:"0px",width:"100vw",marginLeft:"calc(50% - 50vw)"},canHaveChildren:!0,defaultChildren:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{textAlign:"center"}},component:{name:"Text",options:{text:"<p><b>I am a section! My content keeps from getting too wide, so that it's easy to read even on big screens.</b></p><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur</p>"}}}]},we={name:"Slot",isRSC:!0,description:"Allow child blocks to be inserted into this content when used as a Symbol",docsLink:"https://www.builder.io/c/docs/symbols-with-blocks",image:"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F3aad6de36eae43b59b52c85190fdef56",inputs:[{name:"name",type:"string",required:!0,defaultValue:"children"}],shouldReceiveBuilderProps:{builderContext:!0,builderComponents:!0}},Ee=s.lazy(()=>Promise.resolve().then(()=>require("./slot-cbbbb02e.cjs"))),Ve={name:"Symbol",noWrap:!0,static:!0,isRSC:!0,inputs:[{name:"symbol",type:"uiSymbol"},{name:"dataOnly",helperText:"Make this a data symbol that doesn't display any UI",type:"boolean",defaultValue:!1,advanced:!0,hideFromUI:!0},{name:"inheritState",helperText:"Inherit the parent component state and data",type:"boolean",defaultValue:!1,advanced:!0},{name:"renderToLiquid",helperText:"Render this symbols contents to liquid. Turn off to fetch with javascript and use custom targeting",type:"boolean",defaultValue:!1,advanced:!0,hideFromUI:!0},{name:"useChildren",hideFromUI:!0,type:"boolean"}],shouldReceiveBuilderProps:{builderBlock:!0,builderContext:!0,builderComponents:!0,builderLinkComponent:!0}},H={"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{paddingLeft:"20px",paddingRight:"20px",paddingTop:"10px",paddingBottom:"10px",minWidth:"100px",textAlign:"center",display:"flex",flexDirection:"column",cursor:"pointer",userSelect:"none"}},component:{name:"Text",options:{text:"New tab"}}},j={"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{height:"200px",display:"flex",marginTop:"20px",flexDirection:"column"}},component:{name:"Text",options:{text:"New tab content "}}},Re={name:"Builder: Tabs",inputs:[{name:"tabs",type:"list",broadcast:!0,subFields:[{name:"label",type:"uiBlocks",hideFromUI:!0,defaultValue:[H]},{name:"content",type:"uiBlocks",hideFromUI:!0,defaultValue:[j]}],defaultValue:[{label:[{...H,component:{name:"Text",options:{text:"Tab 1"}}}],content:[{...j,component:{name:"Text",options:{text:"Tab 1 content"}}}]},{label:[{...H,component:{name:"Text",options:{text:"Tab 2"}}}],content:[{...j,component:{name:"Text",options:{text:"Tab 2 content"}}}]}]},{name:"activeTabStyle",type:"uiStyle",helperText:"CSS styles for the active tab",defaultValue:{backgroundColor:"rgba(0, 0, 0, 0.1)"}},{name:"defaultActiveTab",type:"number",helperText:'Default tab to open to. Set to "1" for the first tab, "2" for the second, or choose "0" for none',defaultValue:1,advanced:!0},{name:"collapsible",type:"boolean",helperText:"If on, clicking an open tab closes it so no tabs are active",defaultValue:!1,advanced:!0},{name:"tabHeaderLayout",type:"enum",helperText:"Change the layout of the tab headers (uses justify-content)",defaultValue:"flex-start",enum:[{label:"Center",value:"center"},{label:"Space between",value:"space-between"},{label:"Space around",value:"space-around"},{label:"Left",value:"flex-start"},{label:"Right",value:"flex-end"}]}],shouldReceiveBuilderProps:{builderBlock:!0,builderContext:!0,builderComponents:!0,builderLinkComponent:!0}},Ae=s.lazy(()=>Promise.resolve().then(()=>require("./tabs-bf6643d7.cjs"))),Pe={shouldReceiveBuilderProps:{},name:"Text",static:!0,isRSC:!0,image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-text_fields-24px%20(1).svg?alt=media&token=12177b73-0ee3-42ca-98c6-0dd003de1929",inputs:[{name:"text",type:"html",required:!0,autoFocus:!0,bubble:!0,defaultValue:"Enter some text..."}],defaultStyles:{lineHeight:"normal",height:"auto",textAlign:"center"}},De={name:"Custom Code",static:!0,requiredPermissions:["editCode"],inputs:[{name:"code",type:"html",required:!0,defaultValue:"<p>Hello there, I am custom HTML code!</p>",code:!0},{name:"replaceNodes",type:"boolean",helperText:"Preserve server rendered dom nodes",advanced:!0},{name:"scriptsClientOnly",type:"boolean",defaultValue:!1,helperText:"Only print and run scripts on the client. Important when scripts influence DOM that could be replaced when client loads",advanced:!0}]},Fe=s.lazy(()=>Promise.resolve().then(()=>require("./custom-code-8fcaa31e.cjs"))),We={name:"Embed",static:!0,inputs:[{name:"url",type:"url",required:!0,defaultValue:"",helperText:"e.g. enter a youtube url, google map, etc"},{name:"content",type:"html",defaultValue:'<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',hideFromUI:!0}]},Ne=s.lazy(()=>Promise.resolve().then(()=>require("./embed-666d3cc4.cjs"))),qe={name:"Form:Form",defaults:{responsiveStyles:{large:{marginTop:"15px",paddingBottom:"15px"}}},image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fef36d2a846134910b64b88e6d18c5ca5",inputs:[{name:"sendSubmissionsTo",type:"string",enum:[{label:"Send to email",value:"email",helperText:"Send form submissions to the email address of your choosing"},{label:"Custom",value:"custom",helperText:"Handle where the form requests go manually with a little code, e.g. to your own custom backend"}],defaultValue:"email"},{name:"sendSubmissionsToEmail",type:"string",required:!0,defaultValue:"your@email.com",showIf:'options.get("sendSubmissionsTo") === "email"'},{name:"sendWithJs",type:"boolean",helperText:"Set to false to use basic html form action",defaultValue:!0,showIf:'options.get("sendSubmissionsTo") === "custom"'},{name:"name",type:"string",defaultValue:"My form"},{name:"action",type:"string",helperText:"URL to send the form data to",showIf:'options.get("sendSubmissionsTo") === "custom"'},{name:"contentType",type:"string",defaultValue:"application/json",advanced:!0,enum:["application/json","multipart/form-data","application/x-www-form-urlencoded"],showIf:'options.get("sendSubmissionsTo") === "custom" && options.get("sendWithJs") === true'},{name:"method",type:"string",showIf:'options.get("sendSubmissionsTo") === "custom"',defaultValue:"POST",advanced:!0},{name:"previewState",type:"string",enum:["unsubmitted","sending","success","error"],defaultValue:"unsubmitted",helperText:'Choose a state to edit, e.g. choose "success" to show what users see on success and edit the message',showIf:'options.get("sendSubmissionsTo") !== "zapier" && options.get("sendWithJs") === true'},{name:"successUrl",type:"url",helperText:"Optional URL to redirect the user to on form submission success",showIf:'options.get("sendSubmissionsTo") !== "zapier" && options.get("sendWithJs") === true'},{name:"resetFormOnSubmit",type:"boolean",showIf:"options.get('sendSubmissionsTo') === 'custom' && options.get('sendWithJs') === true",advanced:!0},{name:"successMessage",type:"uiBlocks",hideFromUI:!0,defaultValue:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Text",options:{text:"<span>Thanks!</span>"}}}]},{name:"validate",type:"boolean",defaultValue:!0,advanced:!0},{name:"errorMessagePath",type:"text",advanced:!0,helperText:'Path to where to get the error message from in a JSON response to display to the user, e.g. "error.message" for a response like { "error": { "message": "this username is taken" }}'},{name:"errorMessage",type:"uiBlocks",hideFromUI:!0,defaultValue:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},bindings:{"component.options.text":"state.formErrorMessage || block.component.options.text"},component:{name:"Text",options:{text:"<span>Form submission error :( Please check your answers and try again</span>"}}}]},{name:"sendingMessage",type:"uiBlocks",hideFromUI:!0,defaultValue:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Text",options:{text:"<span>Sending...</span>"}}}]},{name:"customHeaders",type:"map",valueType:{type:"string"},advanced:!0,showIf:'options.get("sendSubmissionsTo") === "custom" && options.get("sendWithJs") === true'}],noWrap:!0,canHaveChildren:!0,defaultChildren:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Text",options:{text:"<span>Enter your name</span>"}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Form:Input",options:{name:"name",placeholder:"Jane Doe"}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Text",options:{text:"<span>Enter your email</span>"}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Form:Input",options:{name:"email",placeholder:"jane@doe.com"}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Form:SubmitButton",options:{text:"Submit"}}}],shouldReceiveBuilderProps:{builderBlock:!0,builderContext:!0,builderComponents:!0,builderLinkComponent:!0}},_e=s.lazy(()=>Promise.resolve().then(()=>require("./form-51f639ab.cjs"))),$e={name:"Form:Input",image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",inputs:[{name:"type",type:"text",enum:["text","number","email","url","checkbox","radio","range","date","datetime-local","search","tel","time","file","month","week","password","color","hidden"],defaultValue:"text"},{name:"name",type:"string",required:!0,helperText:'Every input in a form needs a unique name describing what it takes, e.g. "email"'},{name:"placeholder",type:"string",defaultValue:"Hello there",helperText:"Text to display when there is no value"},{name:"defaultValue",type:"string"},{name:"value",type:"string",advanced:!0},{name:"required",type:"boolean",helperText:"Is this input required to be filled out to submit a form",defaultValue:!1}],noWrap:!0,static:!0,defaultStyles:{paddingTop:"10px",paddingBottom:"10px",paddingLeft:"10px",paddingRight:"10px",borderRadius:"3px",borderWidth:"1px",borderStyle:"solid",borderColor:"#ccc"}},Be=s.lazy(()=>Promise.resolve().then(()=>require("./input-d31d6451.cjs"))),Ue={name:"Form:Select",image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",defaultStyles:{alignSelf:"flex-start"},inputs:[{name:"options",type:"list",required:!0,subFields:[{name:"value",type:"text",required:!0},{name:"name",type:"text"}],defaultValue:[{value:"option 1"},{value:"option 2"}]},{name:"name",type:"string",required:!0,helperText:'Every select in a form needs a unique name describing what it gets, e.g. "email"'},{name:"defaultValue",type:"string"},{name:"value",type:"string",advanced:!0},{name:"required",type:"boolean",defaultValue:!1}],static:!0,noWrap:!0},Le=s.lazy(()=>Promise.resolve().then(()=>require("./select-c3085265.cjs"))),He={name:"Form:SubmitButton",image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",defaultStyles:{appearance:"none",paddingTop:"15px",paddingBottom:"15px",paddingLeft:"25px",paddingRight:"25px",backgroundColor:"#3898EC",color:"white",borderRadius:"4px",cursor:"pointer"},inputs:[{name:"text",type:"text",defaultValue:"Click me"}],static:!0,noWrap:!0},je=s.lazy(()=>Promise.resolve().then(()=>require("./submit-button-b363e0ed.cjs"))),Oe={name:"Form:TextArea",image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Ff74a2f3de58c4c3e939204e5b6b8f6c3",inputs:[{advanced:!0,name:"value",type:"string"},{name:"name",type:"string",required:!0,helperText:'Every input in a form needs a unique name describing what it gets, e.g. "email"'},{name:"defaultValue",type:"string"},{name:"placeholder",type:"string",defaultValue:"Hello there"},{name:"required",type:"boolean",defaultValue:!1}],defaultStyles:{paddingTop:"10px",paddingBottom:"10px",paddingLeft:"10px",paddingRight:"10px",borderRadius:"3px",borderWidth:"1px",borderStyle:"solid",borderColor:"#ccc"},static:!0,noWrap:!0},ze=s.lazy(()=>Promise.resolve().then(()=>require("./textarea-56a875bc.cjs"))),Ke={name:"Raw:Img",hideFromInsertMenu:!0,image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",inputs:[{name:"image",bubble:!0,type:"file",allowedFileTypes:O,required:!0}],noWrap:!0,static:!0},Me=s.lazy(()=>Promise.resolve().then(()=>require("./img-b04b9b6d.cjs"))),Je={name:"Video",canHaveChildren:!0,defaultStyles:{minHeight:"20px",minWidth:"20px"},image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-videocam-24px%20(1).svg?alt=media&token=49a84e4a-b20e-4977-a650-047f986874bb",inputs:[{name:"video",type:"file",allowedFileTypes:Se,bubble:!0,defaultValue:"https://cdn.builder.io/o/assets%2FYJIGb4i01jvw0SRdL5Bt%2Fd27731a526464deba0016216f5f9e570%2Fcompressed?apiKey=YJIGb4i01jvw0SRdL5Bt&token=d27731a526464deba0016216f5f9e570&alt=media&optimized=true",required:!0},{name:"posterImage",type:"file",allowedFileTypes:O,helperText:"Image to show before the video plays"},{name:"autoPlay",type:"boolean",defaultValue:!0},{name:"controls",type:"boolean",defaultValue:!1},{name:"muted",type:"boolean",defaultValue:!0},{name:"loop",type:"boolean",defaultValue:!0},{name:"playsInline",type:"boolean",defaultValue:!0},{name:"fit",type:"text",defaultValue:"cover",enum:["contain","cover","fill","auto"]},{name:"preload",type:"text",defaultValue:"metadata",enum:["auto","metadata","none"]},{name:"fitContent",type:"boolean",helperText:"When child blocks are provided, fit to them instead of using the aspect ratio",defaultValue:!0,advanced:!0},{name:"position",type:"text",defaultValue:"center",enum:["center","top","left","right","bottom","top left","top right","bottom left","bottom right"]},{name:"height",type:"number",advanced:!0},{name:"width",type:"number",advanced:!0},{name:"aspectRatio",type:"number",advanced:!0,defaultValue:.7004048582995948},{name:"lazyLoad",type:"boolean",helperText:'Load this video "lazily" - as in only when a user scrolls near the video. Recommended for optmized performance and bandwidth consumption',defaultValue:!0,advanced:!0}],shouldReceiveBuilderProps:{builderBlock:!0}},Ge=()=>[{component:Fe,...De},{component:Ne,...We},{component:_e,...qe},{component:Be,...$e},{component:je,...He},{component:Le,...Ue},{component:ze,...Oe},{component:Me,...Ke},{component:P.Video,...Je}],K=()=>[{component:P.Button,...ye},{component:P.Columns,...ve},{component:P.Fragment,...xe},{component:P.Image,...Te},{component:P.Section,...Ce},{component:Ee,...we},{component:P.Symbol,...Ve},{component:P.Text,...Pe},...ee.includes(r.TARGET)?[{component:ke,...Ie}]:[],{component:Ae,...Re},{component:be,...he},...Ge()],Qe=`function updateCookiesAndStyles(contentId, variants, isHydrationTarget, isAngularSDK) {
|
|
167
|
-
function getAndSetVariantId() {
|
|
168
|
-
function setCookie(name, value, days) {
|
|
169
|
-
let expires = '';
|
|
170
|
-
if (days) {
|
|
171
|
-
const date = new Date();
|
|
172
|
-
date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);
|
|
173
|
-
expires = '; expires=' + date.toUTCString();
|
|
174
|
-
}
|
|
175
|
-
document.cookie = name + '=' + (value || '') + expires + '; path=/' + '; Secure; SameSite=None';
|
|
176
|
-
}
|
|
177
|
-
function getCookie(name) {
|
|
178
|
-
const nameEQ = name + '=';
|
|
179
|
-
const ca = document.cookie.split(';');
|
|
180
|
-
for (let i = 0; i < ca.length; i++) {
|
|
181
|
-
let c = ca[i];
|
|
182
|
-
while (c.charAt(0) === ' ') c = c.substring(1, c.length);
|
|
183
|
-
if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);
|
|
184
|
-
}
|
|
185
|
-
return null;
|
|
186
|
-
}
|
|
187
|
-
const cookieName = \`builder.tests.\${contentId}\`;
|
|
188
|
-
const variantInCookie = getCookie(cookieName);
|
|
189
|
-
const availableIDs = variants.map(vr => vr.id).concat(contentId);
|
|
190
|
-
if (variantInCookie && availableIDs.includes(variantInCookie)) {
|
|
191
|
-
return variantInCookie;
|
|
192
|
-
}
|
|
193
|
-
let n = 0;
|
|
194
|
-
const random = Math.random();
|
|
195
|
-
for (let i = 0; i < variants.length; i++) {
|
|
196
|
-
const variant = variants[i];
|
|
197
|
-
const testRatio = variant.testRatio;
|
|
198
|
-
n += testRatio;
|
|
199
|
-
if (random < n) {
|
|
200
|
-
setCookie(cookieName, variant.id);
|
|
201
|
-
return variant.id;
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
setCookie(cookieName, contentId);
|
|
205
|
-
return contentId;
|
|
206
|
-
}
|
|
207
|
-
const winningVariantId = getAndSetVariantId();
|
|
208
|
-
let styleEl = document.currentScript?.previousElementSibling;
|
|
209
|
-
if (isAngularSDK) {
|
|
210
|
-
styleEl = document.currentScript?.parentElement?.previousElementSibling?.querySelector('style');
|
|
211
|
-
}
|
|
212
|
-
if (isHydrationTarget) {
|
|
213
|
-
styleEl.remove();
|
|
214
|
-
const thisScriptEl = document.currentScript;
|
|
215
|
-
thisScriptEl?.remove();
|
|
216
|
-
} else {
|
|
217
|
-
const newStyleStr = variants.concat({
|
|
218
|
-
id: contentId
|
|
219
|
-
}).filter(variant => variant.id !== winningVariantId).map(value => {
|
|
220
|
-
return \`.variant-\${value.id} { display: none; }
|
|
221
|
-
\`;
|
|
222
|
-
}).join('');
|
|
223
|
-
styleEl.innerHTML = newStyleStr;
|
|
224
|
-
}
|
|
225
|
-
}`,Ye=`function updateVariantVisibility(variantContentId, defaultContentId, isHydrationTarget) {
|
|
226
|
-
if (!navigator.cookieEnabled) {
|
|
227
|
-
return;
|
|
228
|
-
}
|
|
229
|
-
function getCookie(name) {
|
|
230
|
-
const nameEQ = name + '=';
|
|
231
|
-
const ca = document.cookie.split(';');
|
|
232
|
-
for (let i = 0; i < ca.length; i++) {
|
|
233
|
-
let c = ca[i];
|
|
234
|
-
while (c.charAt(0) === ' ') c = c.substring(1, c.length);
|
|
235
|
-
if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);
|
|
236
|
-
}
|
|
237
|
-
return null;
|
|
238
|
-
}
|
|
239
|
-
const cookieName = \`builder.tests.\${defaultContentId}\`;
|
|
240
|
-
const winningVariant = getCookie(cookieName);
|
|
241
|
-
const parentDiv = document.currentScript?.parentElement;
|
|
242
|
-
const isDefaultContent = variantContentId === defaultContentId;
|
|
243
|
-
const isWinningVariant = winningVariant === variantContentId;
|
|
244
|
-
if (isWinningVariant && !isDefaultContent) {
|
|
245
|
-
parentDiv?.removeAttribute('hidden');
|
|
246
|
-
parentDiv?.removeAttribute('aria-hidden');
|
|
247
|
-
} else if (!isWinningVariant && isDefaultContent) {
|
|
248
|
-
parentDiv?.setAttribute('hidden', 'true');
|
|
249
|
-
parentDiv?.setAttribute('aria-hidden', 'true');
|
|
250
|
-
}
|
|
251
|
-
if (isHydrationTarget) {
|
|
252
|
-
if (!isWinningVariant) {
|
|
253
|
-
parentDiv?.remove();
|
|
254
|
-
}
|
|
255
|
-
const thisScriptEl = document.currentScript;
|
|
256
|
-
thisScriptEl?.remove();
|
|
257
|
-
}
|
|
258
|
-
return;
|
|
259
|
-
}`,ie="builderIoAbTest",ae="builderIoRenderContent",B=e=>Object.values((e==null?void 0:e.variations)||{}).map(t=>({...t,testVariationId:t.id,id:e==null?void 0:e.id})),Xe=({canTrack:e,content:t})=>!(!(B(t).length>0)||!e||r.isBrowser()),Ze=e=>e==="react"||e==="reactNative",et=r.TARGET==="angular",oe=Ze(r.TARGET),tt=()=>`
|
|
260
|
-
window.${ie} = ${Qe}
|
|
261
|
-
window.${ae} = ${Ye}
|
|
262
|
-
`,nt=(e,t)=>`
|
|
263
|
-
window.${ie}(
|
|
264
|
-
"${t}",${JSON.stringify(e)}, ${oe}, ${et}
|
|
265
|
-
)`,it=({contentId:e,variationId:t})=>`window.${ae}(
|
|
266
|
-
"${t}", "${e}", ${oe}
|
|
267
|
-
)`;function $(e){return h.jsx("script",{dangerouslySetInnerHTML:{__html:e.scriptStr},"data-id":e.id,nonce:e.nonce||""})}function M(e){return Math.round(e*1e3)/1e3}const at=(e,t,n=!0)=>{if(!(e instanceof HTMLElement))return null;let o=n?e:e.parentElement;do{if(!o)return null;if(t(o))return o}while(o=o.parentElement);return null},ot=e=>at(e,t=>{const n=t.getAttribute("builder-id")||t.id;return(n==null?void 0:n.indexOf("builder-"))===0}),J=({event:e,target:t})=>{const n=t.getBoundingClientRect(),o=e.clientX-n.left,l=e.clientY-n.top,u=M(o/n.width),a=M(l/n.height);return{x:u,y:a}},rt=e=>{const t=e.target,n=t&&ot(t),o=(n==null?void 0:n.getAttribute("builder-id"))||(n==null?void 0:n.id);return{targetBuilderElement:o||void 0,metadata:{targetOffset:t?J({event:e,target:t}):void 0,builderTargetOffset:n?J({event:e,target:n}):void 0,builderElementIndex:n&&o?[].slice.call(document.getElementsByClassName(o)).indexOf(n):void 0}}},st=["svelte","qwik","vue"],G=()=>st.includes(r.TARGET)&&(r.isEditing()||r.isPreviewing()),lt=e=>{var u,a;const t=e.family+(e.kind&&!e.kind.includes("#")?", "+e.kind:""),n=t.split(",")[0],o=(a=e.fileUrl)!=null?a:(u=e==null?void 0:e.files)==null?void 0:u.regular;let l="";if(o&&t&&n&&(l+=`
|
|
268
|
-
@font-face {
|
|
269
|
-
font-family: "${t}";
|
|
270
|
-
src: local("${n}"), url('${o}') format('woff2');
|
|
271
|
-
font-display: fallback;
|
|
272
|
-
font-weight: 400;
|
|
273
|
-
}
|
|
274
|
-
`.trim()),e.files)for(const i in e.files){if(!(String(Number(i))===i))continue;const b=e.files[i];b&&b!==o&&(l+=`
|
|
275
|
-
@font-face {
|
|
276
|
-
font-family: "${t}";
|
|
277
|
-
src: url('${b}') format('woff2');
|
|
278
|
-
font-display: fallback;
|
|
279
|
-
font-weight: ${i};
|
|
280
|
-
}
|
|
281
|
-
`.trim())}return l},ut=({customFonts:e})=>{var t;return((t=e==null?void 0:e.map(n=>lt(n)))==null?void 0:t.join(" "))||""},dt=({cssCode:e,contentId:t})=>e?t?(e==null?void 0:e.replace(/&/g,`div[builder-content-id="${t}"]`))||"":e:"",ct=`
|
|
282
|
-
.builder-button {
|
|
283
|
-
all: unset;
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
.builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
|
|
287
|
-
margin: 0;
|
|
288
|
-
}
|
|
289
|
-
.builder-text > p, .builder-text > .builder-paragraph {
|
|
290
|
-
color: inherit;
|
|
291
|
-
line-height: inherit;
|
|
292
|
-
letter-spacing: inherit;
|
|
293
|
-
font-weight: inherit;
|
|
294
|
-
font-size: inherit;
|
|
295
|
-
text-align: inherit;
|
|
296
|
-
font-family: inherit;
|
|
297
|
-
}
|
|
298
|
-
`,mt=e=>e?"":ct,pt=e=>`variant-${e}`;function ft(e){var T,w,D;const t=s.useRef(null);s.useState(()=>!1);function n(p){var v,x;const g={...e.builderContextSignal.rootState,...p};e.builderContextSignal.rootSetState?(x=(v=e.builderContextSignal).rootSetState)==null||x.call(v,g):e.setBuilderContextSignal(y=>({...y,rootState:g}))}function o(p){var v,x,y,I,A;const g={...e.builderContextSignal.content,...p,data:{...(v=e.builderContextSignal.content)==null?void 0:v.data,...p==null?void 0:p.data},meta:{...(x=e.builderContextSignal.content)==null?void 0:x.meta,...p==null?void 0:p.meta,breakpoints:((y=p==null?void 0:p.meta)==null?void 0:y.breakpoints)||((A=(I=e.builderContextSignal.content)==null?void 0:I.meta)==null?void 0:A.breakpoints)}};e.setBuilderContextSignal(q=>({...q,content:g}))}function l(){return e.showContent?{}:{hidden:!0,"aria-hidden":!0}}const[u,a]=s.useState(()=>e.contentWrapper||"div");function i(p){return r.createEditorListener({model:e.model,trustedHosts:e.trustedHosts,callbacks:{configureSdk:g=>{var y;const{breakpoints:v,contentId:x}=g;!x||x!==((y=e.builderContextSignal.content)==null?void 0:y.id)||v&&o({meta:{breakpoints:v}})},animation:g=>{F.triggerAnimation(g)},contentUpdate:g=>{o(g)},stateUpdate:g=>{n(g)}}})(p)}const[d,b]=s.useState(()=>({})),[f,W]=s.useState(()=>({})),[C,R]=s.useState(()=>!1);function m(p){var g,v;if(e.builderContextSignal.content){const x=(g=e.builderContextSignal.content)==null?void 0:g.testVariationId,y=(v=e.builderContextSignal.content)==null?void 0:v.id;r._track({apiHost:e.apiHost,type:"click",canTrack:r.getDefaultCanTrack(e.canTrack),contentId:y,apiKey:e.apiKey,variationId:x!==y?x:void 0,...rt(p),unique:!C})}C||R(!0)}function c(){var g,v,x;const p=(x=(v=(g=e.builderContextSignal.content)==null?void 0:g.data)==null?void 0:v.httpRequests)!=null?x:{};Object.entries(p).forEach(([y,I])=>{if(!I)return;const A=typeof I=="object"&&I["@type"]==="@builder.io/core:Request";if(f[y]||d[y]&&!r.isEditing())return;const q=A?I.request.url:I;f[y]=!0;const k=q.replace(/{{([^}]+)}}/g,(V,_)=>String(F.evaluate({code:_,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState}))),S=A?{url:k,method:I.request.method,headers:I.request.headers,body:I.request.body}:{url:k,method:"GET"};r.logFetch(JSON.stringify(S)),fetch(S.url,{method:S.method,headers:S.headers,body:S.body}).then(V=>V.json()).then(V=>{n({[y]:V}),d[y]=!0}).catch(V=>{console.error("error fetching dynamic data",JSON.stringify(I),V)}).finally(()=>{f[y]=!1})})}function E(){r.isEditing()&&window.dispatchEvent(new CustomEvent("builder:component:stateChange",{detail:{state:F.fastClone(e.builderContextSignal.rootState),ref:{name:e.model}}}))}const N=s.useRef(!1);return N.current||(c(),E(),N.current=!0),s.useEffect(()=>{var p,g,v,x,y;if(r.isBrowser()){r.isEditing()&&!e.isNestedRender&&(window.addEventListener("message",i),r.setupBrowserForEditing({...e.locale?{locale:e.locale}:{},...e.enrich?{enrich:e.enrich}:{},...e.trustedHosts?{trustedHosts:e.trustedHosts}:{},modelName:(p=e.model)!=null?p:"",apiKey:e.apiKey}),Object.values(e.builderContextSignal.componentInfos).forEach(k=>{var S,V;if(!((S=k.models)!=null&&S.length)||k.models.includes(e.model)){const _=r.createRegisterComponentMessage(k);(V=window.parent)==null||V.postMessage(_,"*")}}),window.addEventListener("builder:component:stateChangeListenerActivated",E));const I=e.builderContextSignal.content&&r.getDefaultCanTrack(e.canTrack),A=r.getCookieSync({name:`builder.tests.${(g=e.builderContextSignal.content)==null?void 0:g.id}`,canTrack:!0}),q=(v=e.builderContextSignal.content)==null?void 0:v.testVariationId;if(I&&q===A){const k=(x=e.builderContextSignal.content)==null?void 0:x.id,S=e.apiKey;r._track({apiHost:e.apiHost,type:"impression",canTrack:!0,contentId:k,apiKey:S,variationId:A!==k?A:void 0})}if(r.isPreviewing()&&!r.isEditing()){const k=new URL(location.href).searchParams,S=k.get("builder.preview"),V=k.get(`builder.overrides.${S}`),_=k.get("apiKey")||k.get("builder.space");(S==="BUILDER_STUDIO"||S===e.model&&_===e.apiKey&&(!e.content||V===e.content.id))&&r.fetchOneEntry({model:e.model,apiKey:e.apiKey,apiVersion:e.builderContextSignal.apiVersion,...S==="BUILDER_STUDIO"&&((y=e.context)!=null&&y.symbolId)?{query:{id:e.context.symbolId}}:{}}).then(z=>{z&&o(z)})}}},[]),s.useEffect(()=>{e.content&&o(e.content)},[e.content]),s.useEffect(()=>{E()},[e.builderContextSignal.rootState]),s.useEffect(()=>{e.data&&n(e.data)},[e.data]),s.useEffect(()=>{e.locale&&n({locale:e.locale})},[e.locale]),s.useEffect(()=>()=>{r.isBrowser()&&(window.removeEventListener("message",i),window.removeEventListener("builder:component:stateChangeListenerActivated",E))},[]),h.jsx(P.BuilderContext.Provider,{value:e.builderContextSignal,children:e.builderContextSignal.content||G()?h.jsx(u,{ref:t,onClick:p=>m(p),"builder-content-id":(T=e.builderContextSignal.content)==null?void 0:T.id,"builder-model":e.model,className:pt(((w=e.content)==null?void 0:w.testVariationId)||((D=e.content)==null?void 0:D.id)),style:{display:!e.builderContextSignal.content&&G()?"none":void 0},...l(),...e.contentWrapperProps,children:e.children}):null})}function gt(e){const[t,n]=s.useState(()=>`
|
|
299
|
-
${dt({cssCode:e.cssCode,contentId:e.contentId})}
|
|
300
|
-
${ut({customFonts:e.customFonts})}
|
|
301
|
-
${mt(e.isNestedRender)}
|
|
302
|
-
`.trim());return h.jsx(F.InlinedStyles,{id:"builderio-content",styles:t,nonce:e.nonce})}const ht=({content:e,data:t,locale:n})=>{var u,a,i;const o={},l=((u=e==null?void 0:e.data)==null?void 0:u.state)||{};return(i=(a=e==null?void 0:e.data)==null?void 0:a.inputs)==null||i.forEach(d=>{d.name&&d.defaultValue!==void 0&&(o[d.name]=d.defaultValue)}),{...o,...l,...t,...n?{locale:n}:{}}},bt=({content:e,data:t})=>e?{...e,data:{...e==null?void 0:e.data,...t},meta:e==null?void 0:e.meta}:void 0;function Q(e){var b,f,W,C,R,m,c,E,N;const[t,n]=s.useState(()=>{var T,w;return it({variationId:(T=e.content)==null?void 0:T.testVariationId,contentId:(w=e.content)==null?void 0:w.id})});function o(T){i(w=>({...w,rootState:T}))}const[l,u]=s.useState(()=>[...K(),...e.customComponents||[]].reduce((T,{component:w,...D})=>({...T,[D.name]:{component:w,...r.serializeIncludingFunctions(D)}}),{})),[a,i]=s.useState(()=>({content:bt({content:e.content,data:e.data}),localState:void 0,rootState:ht({content:e.content,data:e.data,locale:e.locale}),rootSetState:o,context:e.context||{},canTrack:e.canTrack,apiKey:e.apiKey,apiVersion:e.apiVersion,componentInfos:[...K(),...e.customComponents||[]].reduce((T,{component:w,...D})=>({...T,[D.name]:r.serializeIncludingFunctions(D)}),{}),inheritedStyles:{},BlocksWrapper:e.blocksWrapper||"div",BlocksWrapperProps:e.blocksWrapperProps||{},nonce:e.nonce||"",model:e.model})),d=s.useRef(!1);if(!d.current){e.apiKey||r.logger.error("No API key provided to `Content` component. This can cause issues. Please provide an API key using the `apiKey` prop.");const T=(f=(b=a.content)==null?void 0:b.data)==null?void 0:f.jsCode;T&&F.evaluate({code:T,context:e.context||{},localState:void 0,rootState:a.rootState,rootSetState:w=>{Object.assign(a.rootState,w)},isExpression:!1}),d.current=!0}return h.jsx(F.ComponentsContext.Provider,{value:{registeredComponents:l},children:h.jsxs(ft,{apiHost:e.apiHost,nonce:e.nonce,content:e.content,data:e.data,model:e.model,context:e.context,apiKey:e.apiKey,canTrack:e.canTrack,locale:e.locale,enrich:e.enrich,showContent:e.showContent,builderContextSignal:a,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,trustedHosts:e.trustedHosts,isNestedRender:e.isNestedRender,setBuilderContextSignal:i,children:[e.isSsrAbTest?h.jsx($,{id:"builderio-variant-visibility",scriptStr:t,nonce:e.nonce||""}):null,h.jsx(gt,{nonce:e.nonce||"",isNestedRender:e.isNestedRender,contentId:(W=a.content)==null?void 0:W.id,cssCode:(R=(C=a.content)==null?void 0:C.data)==null?void 0:R.cssCode,customFonts:(c=(m=a.content)==null?void 0:m.data)==null?void 0:c.customFonts}),h.jsx(F.Blocks,{blocks:(N=(E=a.content)==null?void 0:E.data)==null?void 0:N.blocks,context:a,registeredComponents:l,linkComponent:e.linkComponent})]})})}function yt(e){var a;const[t,n]=s.useState(()=>Xe({canTrack:r.getDefaultCanTrack(e.canTrack),content:e.content}));function o(){var i;return nt(B(e.content).map(d=>({id:d.testVariationId,testRatio:d.testRatio})),((i=e.content)==null?void 0:i.id)||"")}function l(){return B(e.content).map(i=>`.variant-${i.testVariationId} { display: none; } `).join("")}function u(){var i;return t?{...e.content,testVariationId:(i=e.content)==null?void 0:i.id}:r.handleABTestingSync({item:e.content,canTrack:r.getDefaultCanTrack(e.canTrack)})}return s.useEffect(()=>{},[]),h.jsxs(h.Fragment,{children:[!e.isNestedRender&&r.TARGET!=="reactNative"?h.jsxs(h.Fragment,{children:[h.jsx($,{id:"builderio-init-variants-fns",scriptStr:tt(),nonce:e.nonce||""}),ee.includes(r.TARGET)?h.jsx($,{id:"builderio-init-personalization-variants-fns",nonce:e.nonce||"",scriptStr:pe()}):null]}):null,t?h.jsxs(h.Fragment,{children:[h.jsx(F.InlinedStyles,{id:"builderio-variants",styles:l(),nonce:e.nonce||""}),h.jsx($,{id:"builderio-variants-visibility",scriptStr:o(),nonce:e.nonce||""}),(a=B(e.content))==null?void 0:a.map(i=>h.jsx(Q,{apiHost:e.apiHost,isNestedRender:e.isNestedRender,nonce:e.nonce,content:i,showContent:!1,model:e.model,data:e.data,context:e.context,apiKey:e.apiKey,apiVersion:e.apiVersion,customComponents:e.customComponents,linkComponent:e.linkComponent,canTrack:e.canTrack,locale:e.locale,enrich:e.enrich,isSsrAbTest:t,blocksWrapper:e.blocksWrapper,blocksWrapperProps:e.blocksWrapperProps,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,trustedHosts:e.trustedHosts},i.testVariationId))]}):null,h.jsx(Q,{apiHost:e.apiHost,nonce:e.nonce,isNestedRender:e.isNestedRender,content:u(),showContent:!0,model:e.model,data:e.data,context:e.context,apiKey:e.apiKey,apiVersion:e.apiVersion,customComponents:e.customComponents,linkComponent:e.linkComponent,canTrack:e.canTrack,locale:e.locale,enrich:e.enrich,isSsrAbTest:t,blocksWrapper:e.blocksWrapper,blocksWrapperProps:e.blocksWrapperProps,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,trustedHosts:e.trustedHosts})]})}const vt=Object.freeze(Object.defineProperty({__proto__:null,default:yt},Symbol.toStringTag,{value:"Module"}));exports.DEFAULT_INDEX=Y;exports.InlinedScript=$;exports.SDKS_REQUIRING_RESET_APPROACH=te;exports.checkShouldRenderVariants=ce;exports.contentVariants=vt;exports.filterWithCustomTargeting=re;exports.getBlocksToRender=me;exports.getPersonalizationScript=fe;exports.getUpdateVisibilityStylesScript=ge;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),S=require("react"),h=require("./blocks-d07d0261.cjs"),q=require("./server-entry-acf5ce7d.cjs");require("./blocks-exports.cjs");require("./get-class-prop-name-2869a960.cjs");require("./dynamic-renderer-b29b45ca.cjs");const A=["production","qa","test","development","dev","cdn-qa","cloud","fast","cdn2","cdn-prod"],O=()=>{const e=process.env.NODE_ENV||"production";return A.includes(e)?e:"production"};function R(e){const r=S.useRef(null),[w,u]=S.useState(()=>"unsubmitted"),[y,E]=S.useState(()=>null),[J,F]=S.useState(()=>"");function x(s){var d,m;const l={...e.builderContext.rootState,...s};e.builderContext.rootSetState?(m=(d=e.builderContext).rootSetState)==null||m.call(d,l):e.builderContext.rootState=l}function g(){return q.isEditing()&&e.previewState||w}function N(s){var d;const l=e.sendWithJs||e.sendSubmissionsTo==="email";if(e.sendSubmissionsTo==="zapier")s.preventDefault();else if(l){if(!(e.action||e.sendSubmissionsTo==="email")){s.preventDefault();return}s.preventDefault();const m=s.currentTarget||s.target,T=e.customHeaders||{};let v;const P=new FormData(m),C=Array.from(m.querySelectorAll("input,select,textarea")).filter(t=>!!t.name).filter(t=>!!t.name&&(t.type!=="radio"||t.checked)).map(t=>{let n;const a=t.name;if(t instanceof HTMLInputElement)if(t.type==="radio"){if(t.checked)return n=t.value,{key:a,value:n}}else if(t.type==="checkbox")n=t.checked;else if(t.type==="number"||t.type==="range"){const f=t.valueAsNumber;isNaN(f)||(n=f)}else t.type==="file"?n=t.files:n=t.value;else n=t.value;return{key:a,value:n}});let c=e.contentType;if(e.sendSubmissionsTo==="email"&&(c="multipart/form-data"),Array.from(C).forEach(({value:t})=>{(t instanceof File||Array.isArray(t)&&t[0]instanceof File||t instanceof FileList)&&(c="multipart/form-data")}),c!=="application/json")v=P;else{const t={};Array.from(C).forEach(({value:n,key:a})=>{h.set(t,a,n)}),v=JSON.stringify(t)}c&&c!=="multipart/form-data"&&(l&&((d=e.action)!=null&&d.includes("zapier.com"))||(T["content-type"]=c));const k=new CustomEvent("presubmit",{detail:{body:v}});if(r.current&&(r.current.dispatchEvent(k),k.defaultPrevented))return;if(u("sending"),e.sendSubmissionsTo==="email"&&(e.sendSubmissionsToEmail==="your@email.com"||!e.sendSubmissionsToEmail)){const t="SubmissionsToEmail is required when sendSubmissionsTo is set to email";console.error(t),u("error"),x({formErrorMessage:t});return}const D=`${O()==="dev"?"http://localhost:5000":"https://builder.io"}/api/v1/form-submit?apiKey=${e.builderContext.apiKey}&to=${btoa(e.sendSubmissionsToEmail||"")}&name=${encodeURIComponent(e.name||"")}`,M=e.sendSubmissionsTo==="email"?D:e.action;q.logFetch(M),fetch(M,{body:v,headers:T,method:e.method||"post"}).then(async t=>{var f,j;let n;const a=t.headers.get("content-type");if(a&&a.indexOf("application/json")!==-1?n=await t.json():n=await t.text(),!t.ok){const b=new CustomEvent("submit:error",{detail:{error:n,status:t.status}});if((f=r.current)!=null&&f.nativeElement&&((j=r.current)==null||j.nativeElement.dispatchEvent(b),b.defaultPrevented))return;E(n),u("error");let i=e.errorMessagePath?h.get(n,e.errorMessagePath):n.message||n.error||n;typeof i!="string"&&(i=JSON.stringify(i)),F(i),x({formErrorMessage:i});return}if(E(n),u(t.ok?"success":"error"),t.ok){const b=new CustomEvent("submit:success",{detail:{res:t,body:n}});if(r.current){if(r.current.dispatchEvent(b),b.defaultPrevented)return;e.resetFormOnSubmit!==!1&&r.current.reset()}if(e.successUrl)if(r.current){const i=new CustomEvent("route",{detail:{url:e.successUrl}});r.current.dispatchEvent(i),i.defaultPrevented||(location.href=e.successUrl)}else location.href=e.successUrl}},t=>{const n=new CustomEvent("submit:error",{detail:{error:t}});r.current&&(r.current.dispatchEvent(n),n.defaultPrevented)||(E(t),u("error"))})}}return o.jsxs(o.Fragment,{children:[" ",o.jsx("style",{children:".pre-26f6d56a { padding: 10px; color: red; text-align: center; }"})," ",o.jsxs("form",{validate:e.validate,ref:r,action:!e.sendWithJs&&e.action,method:e.method,name:e.name,onSubmit:s=>N(s),...e.attributes,children:[e.children,g()==="error"?o.jsx(h.Blocks,{path:"errorMessage",blocks:e.errorMessage,context:e.builderContext}):null,g()==="sending"?o.jsx(h.Blocks,{path:"sendingMessage",blocks:e.sendingMessage,context:e.builderContext}):null,g()==="error"&&y?o.jsx("pre",{className:"builder-form-error-text pre-26f6d56a",children:JSON.stringify(y,null,2)}):null,g()==="success"?o.jsx(h.Blocks,{path:"successMessage",blocks:e.successMessage,context:e.builderContext}):null]})," "]})}exports.default=R;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("react/jsx-runtime"),o=require("react"),S=require("./blocks-exports.cjs"),E=require("./get-class-prop-name-2869a960.cjs"),b=require("./server-entry-acf5ce7d.cjs"),g=async({builderContextValue:e,symbol:n})=>{if(n!=null&&n.model&&(e!=null&&e.apiKey))return b.fetchOneEntry({model:n.model,apiKey:e.apiKey,apiVersion:e.apiVersion,...(n==null?void 0:n.entry)&&{query:{id:n.entry}}}).catch(c=>{b.logger.error("Could not fetch symbol content: ",c)})};function h(e){var a,l,u,d,s;function n(){return"div"}function c(){return"div"}function f(){var t,r;return[e.attributes[E.getClassPropName()],"builder-symbol",(t=e.symbol)!=null&&t.inline?"builder-inline-symbol":void 0,(r=e.symbol)!=null&&r.dynamic||e.dynamic?"builder-dynamic-symbol":void 0].filter(Boolean).join(" ")}const[i,C]=o.useState(()=>{var t;return(t=e.symbol)==null?void 0:t.content}),[v,k]=o.useState(()=>{var t;return(t=e.symbol)==null?void 0:t.entry});function x(){var t;i&&v===((t=e.symbol)==null?void 0:t.entry)||g({symbol:e.symbol,builderContextValue:e.builderContext}).then(r=>{var y;r&&(C(r),k((y=e.symbol)==null?void 0:y.entry))})}return o.useEffect(()=>{},[]),o.useEffect(()=>{x()},[e.symbol]),m.jsx("div",{...e.attributes,className:f(),children:m.jsx(S.Content,{nonce:e.builderContext.nonce,isNestedRender:!0,apiVersion:e.builderContext.apiVersion,apiKey:e.builderContext.apiKey,context:{...e.builderContext.context,symbolId:(a=e.builderBlock)==null?void 0:a.id},customComponents:Object.values(e.builderComponents),data:{...(l=e.symbol)==null?void 0:l.data,...e.builderContext.localState,...(u=i==null?void 0:i.data)==null?void 0:u.state},canTrack:e.builderContext.canTrack,model:(s=(d=e.symbol)==null?void 0:d.model)!=null?s:"",content:i,linkComponent:e.builderLinkComponent,blocksWrapper:n(),contentWrapper:c()})})}exports.default=h;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),u=require("react"),b=require("./blocks-d07d0261.cjs");require("./blocks-exports.cjs");require("./server-entry-acf5ce7d.cjs");require("./get-class-prop-name-2869a960.cjs");require("./dynamic-renderer-b29b45ca.cjs");function s(e){var o;const[t,a]=u.useState(()=>e.defaultActiveTab?e.defaultActiveTab-1:0);function c(n){return e.tabs&&e.tabs[n].content}function r(n){n===t&&e.collapsible?a(-1):a(n)}return l.jsxs("div",{children:[l.jsx("div",{className:"builder-tabs-wrap",style:{display:"flex",flexDirection:"row",justifyContent:e.tabHeaderLayout||"flex-start",overflow:"auto"},children:(o=e.tabs)==null?void 0:o.map((n,i)=>l.jsx("span",{className:`builder-tab-wrap ${t===i?"builder-tab-active":""}`,style:{...t===i?e.activeTabStyle:{}},onClick:d=>r(i),children:l.jsx(b.Blocks,{parent:e.builderBlock.id,path:`tabs.${i}.label`,blocks:n.label,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})},i))}),c(t)?l.jsx("div",{children:l.jsx(b.Blocks,{parent:e.builderBlock.id,path:`tabs.${t}.content`,blocks:c(t),context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})}):null]})}exports.default=s;
|