@builder.io/sdk-qwik 0.0.6 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2521 @@
1
+ "use strict";
2
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
+ const qwik = require("@builder.io/qwik");
4
+ const jsxRuntime = require("@builder.io/qwik/jsx-runtime");
5
+ const TARGET = "qwik";
6
+ function isBrowser() {
7
+ return typeof window !== "undefined" && typeof document !== "undefined";
8
+ }
9
+ const registry = {};
10
+ function register(type, info) {
11
+ let typeList = registry[type];
12
+ if (!typeList)
13
+ typeList = registry[type] = [];
14
+ typeList.push(info);
15
+ if (isBrowser()) {
16
+ const message = {
17
+ type: "builder.register",
18
+ data: {
19
+ type,
20
+ info
21
+ }
22
+ };
23
+ try {
24
+ parent.postMessage(message, "*");
25
+ if (parent !== window)
26
+ window.postMessage(message, "*");
27
+ } catch (err) {
28
+ console.debug("Could not postmessage", err);
29
+ }
30
+ }
31
+ }
32
+ const registerInsertMenu = () => {
33
+ register("insertMenu", {
34
+ name: "_default",
35
+ default: true,
36
+ items: [
37
+ {
38
+ name: "Box"
39
+ },
40
+ {
41
+ name: "Text"
42
+ },
43
+ {
44
+ name: "Image"
45
+ },
46
+ {
47
+ name: "Columns"
48
+ },
49
+ ...TARGET === "reactNative" ? [] : [
50
+ {
51
+ name: "Core:Section"
52
+ },
53
+ {
54
+ name: "Core:Button"
55
+ },
56
+ {
57
+ name: "Embed"
58
+ },
59
+ {
60
+ name: "Custom Code"
61
+ }
62
+ ]
63
+ ]
64
+ });
65
+ };
66
+ const setupBrowserForEditing = () => {
67
+ var _a;
68
+ if (isBrowser()) {
69
+ (_a = window.parent) == null || _a.postMessage({
70
+ type: "builder.sdkInfo",
71
+ data: {
72
+ target: TARGET,
73
+ supportsPatchUpdates: false
74
+ }
75
+ }, "*");
76
+ window.addEventListener("message", ({ data }) => {
77
+ var _a2, _b;
78
+ if (data)
79
+ switch (data.type) {
80
+ case "builder.evaluate": {
81
+ const text = data.data.text;
82
+ const args = data.data.arguments || [];
83
+ const id = data.data.id;
84
+ const fn = new Function(text);
85
+ let result;
86
+ let error = null;
87
+ try {
88
+ result = fn.apply(null, args);
89
+ } catch (err) {
90
+ error = err;
91
+ }
92
+ if (error)
93
+ (_a2 = window.parent) == null || _a2.postMessage({
94
+ type: "builder.evaluateError",
95
+ data: {
96
+ id,
97
+ error: error.message
98
+ }
99
+ }, "*");
100
+ else if (result && typeof result.then === "function")
101
+ result.then((finalResult) => {
102
+ var _a3;
103
+ (_a3 = window.parent) == null || _a3.postMessage({
104
+ type: "builder.evaluateResult",
105
+ data: {
106
+ id,
107
+ result: finalResult
108
+ }
109
+ }, "*");
110
+ }).catch(console.error);
111
+ else
112
+ (_b = window.parent) == null || _b.postMessage({
113
+ type: "builder.evaluateResult",
114
+ data: {
115
+ result,
116
+ id
117
+ }
118
+ }, "*");
119
+ break;
120
+ }
121
+ }
122
+ });
123
+ }
124
+ };
125
+ var stdin_default = qwik.createContext("Builder");
126
+ function isIframe() {
127
+ return isBrowser() && window.self !== window.top;
128
+ }
129
+ function isEditing() {
130
+ return isIframe() && window.location.search.indexOf("builder.frameEditing=") !== -1;
131
+ }
132
+ const SIZES = {
133
+ small: {
134
+ min: 320,
135
+ default: 321,
136
+ max: 640
137
+ },
138
+ medium: {
139
+ min: 641,
140
+ default: 642,
141
+ max: 991
142
+ },
143
+ large: {
144
+ min: 990,
145
+ default: 991,
146
+ max: 1200
147
+ }
148
+ };
149
+ const getMaxWidthQueryForSize = (size) => `@media (max-width: ${SIZES[size].max}px)`;
150
+ function evaluate({ code, context, state, event }) {
151
+ if (code === "") {
152
+ console.warn("Skipping evaluation of empty code block.");
153
+ return;
154
+ }
155
+ const builder = {
156
+ isEditing: isEditing(),
157
+ isBrowser: isBrowser(),
158
+ isServer: !isBrowser()
159
+ };
160
+ const useReturn = !(code.includes(";") || code.includes(" return ") || code.trim().startsWith("return "));
161
+ const useCode = useReturn ? `return (${code});` : code;
162
+ try {
163
+ return new Function("builder", "Builder", "state", "context", "event", useCode)(builder, builder, state, context, event);
164
+ } catch (e) {
165
+ console.warn("Builder custom code error: ", e);
166
+ }
167
+ }
168
+ const set = (obj, _path, value) => {
169
+ if (Object(obj) !== obj)
170
+ return obj;
171
+ const path = Array.isArray(_path) ? _path : _path.toString().match(/[^.[\]]+/g);
172
+ path.slice(0, -1).reduce(
173
+ (a, c, i) => Object(a[c]) === a[c] ? a[c] : a[c] = Math.abs(Number(path[i + 1])) >> 0 === +path[i + 1] ? [] : {},
174
+ obj
175
+ )[path[path.length - 1]] = value;
176
+ return obj;
177
+ };
178
+ function transformBlock(block) {
179
+ return block;
180
+ }
181
+ var __defProp$7 = Object.defineProperty;
182
+ var __defProps$5 = Object.defineProperties;
183
+ var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
184
+ var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
185
+ var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
186
+ var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
187
+ var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, {
188
+ enumerable: true,
189
+ configurable: true,
190
+ writable: true,
191
+ value
192
+ }) : obj[key] = value;
193
+ var __spreadValues$7 = (a, b) => {
194
+ for (var prop in b || (b = {}))
195
+ if (__hasOwnProp$7.call(b, prop))
196
+ __defNormalProp$7(a, prop, b[prop]);
197
+ if (__getOwnPropSymbols$7) {
198
+ for (var prop of __getOwnPropSymbols$7(b))
199
+ if (__propIsEnum$7.call(b, prop))
200
+ __defNormalProp$7(a, prop, b[prop]);
201
+ }
202
+ return a;
203
+ };
204
+ var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
205
+ const evaluateBindings = ({ block, context, state }) => {
206
+ if (!block.bindings)
207
+ return block;
208
+ const copied = __spreadProps$5(__spreadValues$7({}, block), {
209
+ properties: __spreadValues$7({}, block.properties),
210
+ actions: __spreadValues$7({}, block.actions)
211
+ });
212
+ for (const binding in block.bindings) {
213
+ const expression = block.bindings[binding];
214
+ const value = evaluate({
215
+ code: expression,
216
+ state,
217
+ context
218
+ });
219
+ set(copied, binding, value);
220
+ }
221
+ return copied;
222
+ };
223
+ function getProcessedBlock(options) {
224
+ const { state, context } = options;
225
+ const block = transformBlock(options.block);
226
+ if (evaluateBindings)
227
+ return evaluateBindings({
228
+ block,
229
+ state,
230
+ context
231
+ });
232
+ else
233
+ return block;
234
+ }
235
+ const camelToKebabCase = (string) => string.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase();
236
+ const convertStyleMaptoCSS = (style) => {
237
+ const cssProps = Object.entries(style).map(([key, value]) => {
238
+ if (typeof value === "string")
239
+ return `${camelToKebabCase(key)}: ${value};`;
240
+ });
241
+ return cssProps.join("\n");
242
+ };
243
+ const RenderInlinedStyles = /* @__PURE__ */ qwik.componentQrl(qwik.inlinedQrl((props) => {
244
+ const state = {};
245
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {
246
+ children: /* @__PURE__ */ jsxRuntime.jsx(state.tagName, {
247
+ children: props.styles
248
+ })
249
+ });
250
+ }, "RenderInlinedStyles_component_0sD5UmyM3Rg"));
251
+ const RenderInlinedStyles$1 = RenderInlinedStyles;
252
+ const useBlock$1 = function useBlock(props, state) {
253
+ return getProcessedBlock({
254
+ block: props.block,
255
+ state: props.context.state,
256
+ context: props.context.context,
257
+ evaluateBindings: true
258
+ });
259
+ };
260
+ const css = function css2(props, state) {
261
+ const styles = useBlock$1(props).responsiveStyles;
262
+ const largeStyles = styles?.large;
263
+ const mediumStyles = styles?.medium;
264
+ const smallStyles = styles?.small;
265
+ return `
266
+ ${largeStyles ? `.${useBlock$1(props).id} {${convertStyleMaptoCSS(largeStyles)}}` : ""}
267
+ ${mediumStyles ? `${getMaxWidthQueryForSize("medium")} {
268
+ .${useBlock$1(props).id} {${convertStyleMaptoCSS(mediumStyles)}}
269
+ }` : ""}
270
+ ${smallStyles ? `${getMaxWidthQueryForSize("small")} {
271
+ .${useBlock$1(props).id} {${convertStyleMaptoCSS(smallStyles)}}
272
+ }` : ""}
273
+ }`;
274
+ };
275
+ const BlockStyles = (props) => {
276
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {
277
+ children: TARGET === "vue2" || TARGET === "vue3" || TARGET === "svelte" ? /* @__PURE__ */ jsxRuntime.jsx(RenderInlinedStyles$1, {
278
+ styles: css(props)
279
+ }) : null
280
+ });
281
+ };
282
+ const BlockStyles$1 = BlockStyles;
283
+ function capitalizeFirstLetter(string) {
284
+ return string.charAt(0).toUpperCase() + string.slice(1);
285
+ }
286
+ const getEventHandlerName = (key) => `on${capitalizeFirstLetter(key)}`;
287
+ function getBlockActions(options) {
288
+ var _a;
289
+ const obj = {};
290
+ const optionActions = (_a = options.block.actions) != null ? _a : {};
291
+ for (const key in optionActions) {
292
+ if (!optionActions.hasOwnProperty(key))
293
+ continue;
294
+ const value = optionActions[key];
295
+ obj[getEventHandlerName(key)] = (event) => evaluate({
296
+ code: value,
297
+ context: options.context,
298
+ state: options.state,
299
+ event
300
+ });
301
+ }
302
+ return obj;
303
+ }
304
+ var __defProp$6 = Object.defineProperty;
305
+ var __defProps$4 = Object.defineProperties;
306
+ var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;
307
+ var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
308
+ var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
309
+ var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
310
+ var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, {
311
+ enumerable: true,
312
+ configurable: true,
313
+ writable: true,
314
+ value
315
+ }) : obj[key] = value;
316
+ var __spreadValues$6 = (a, b) => {
317
+ for (var prop in b || (b = {}))
318
+ if (__hasOwnProp$6.call(b, prop))
319
+ __defNormalProp$6(a, prop, b[prop]);
320
+ if (__getOwnPropSymbols$6) {
321
+ for (var prop of __getOwnPropSymbols$6(b))
322
+ if (__propIsEnum$6.call(b, prop))
323
+ __defNormalProp$6(a, prop, b[prop]);
324
+ }
325
+ return a;
326
+ };
327
+ var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));
328
+ function getBlockComponentOptions(block) {
329
+ var _a;
330
+ return __spreadProps$4(__spreadValues$6(__spreadValues$6({}, (_a = block.component) == null ? void 0 : _a.options), block.options), {
331
+ builderBlock: block
332
+ });
333
+ }
334
+ var __defProp$5 = Object.defineProperty;
335
+ var __defProps$3 = Object.defineProperties;
336
+ var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
337
+ var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
338
+ var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
339
+ var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
340
+ var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, {
341
+ enumerable: true,
342
+ configurable: true,
343
+ writable: true,
344
+ value
345
+ }) : obj[key] = value;
346
+ var __spreadValues$5 = (a, b) => {
347
+ for (var prop in b || (b = {}))
348
+ if (__hasOwnProp$5.call(b, prop))
349
+ __defNormalProp$5(a, prop, b[prop]);
350
+ if (__getOwnPropSymbols$5) {
351
+ for (var prop of __getOwnPropSymbols$5(b))
352
+ if (__propIsEnum$5.call(b, prop))
353
+ __defNormalProp$5(a, prop, b[prop]);
354
+ }
355
+ return a;
356
+ };
357
+ var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
358
+ function getBlockProperties(block) {
359
+ var _a;
360
+ return __spreadProps$3(__spreadValues$5({}, block.properties), {
361
+ "builder-id": block.id,
362
+ class: [
363
+ block.id,
364
+ "builder-block",
365
+ block.class,
366
+ (_a = block.properties) == null ? void 0 : _a.class
367
+ ].filter(Boolean).join(" ")
368
+ });
369
+ }
370
+ const convertStyleObject = (obj) => {
371
+ return obj;
372
+ };
373
+ const sanitizeBlockStyles = (_styles) => {
374
+ };
375
+ var __defProp$4 = Object.defineProperty;
376
+ var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
377
+ var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
378
+ var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
379
+ var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, {
380
+ enumerable: true,
381
+ configurable: true,
382
+ writable: true,
383
+ value
384
+ }) : obj[key] = value;
385
+ var __spreadValues$4 = (a, b) => {
386
+ for (var prop in b || (b = {}))
387
+ if (__hasOwnProp$4.call(b, prop))
388
+ __defNormalProp$4(a, prop, b[prop]);
389
+ if (__getOwnPropSymbols$4) {
390
+ for (var prop of __getOwnPropSymbols$4(b))
391
+ if (__propIsEnum$4.call(b, prop))
392
+ __defNormalProp$4(a, prop, b[prop]);
393
+ }
394
+ return a;
395
+ };
396
+ function getBlockStyles(block) {
397
+ var _a, _b, _c, _d, _e;
398
+ const styles = __spreadValues$4(__spreadValues$4({}, convertStyleObject((_a = block.responsiveStyles) == null ? void 0 : _a.large)), block.styles);
399
+ if ((_b = block.responsiveStyles) == null ? void 0 : _b.medium)
400
+ styles[getMaxWidthQueryForSize("medium")] = convertStyleObject((_c = block.responsiveStyles) == null ? void 0 : _c.medium);
401
+ if ((_d = block.responsiveStyles) == null ? void 0 : _d.small)
402
+ styles[getMaxWidthQueryForSize("small")] = convertStyleObject((_e = block.responsiveStyles) == null ? void 0 : _e.small);
403
+ sanitizeBlockStyles();
404
+ return styles;
405
+ }
406
+ function getBlockTag(block) {
407
+ return block.tagName || "div";
408
+ }
409
+ const EMPTY_HTML_ELEMENTS = [
410
+ "area",
411
+ "base",
412
+ "br",
413
+ "col",
414
+ "embed",
415
+ "hr",
416
+ "img",
417
+ "input",
418
+ "keygen",
419
+ "link",
420
+ "meta",
421
+ "param",
422
+ "source",
423
+ "track",
424
+ "wbr"
425
+ ];
426
+ const isEmptyHtmlElement = (tagName3) => {
427
+ return typeof tagName3 === "string" && EMPTY_HTML_ELEMENTS.includes(tagName3.toLowerCase());
428
+ };
429
+ const RenderComponent = (props) => {
430
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {
431
+ children: props.componentRef ? /* @__PURE__ */ jsxRuntime.jsxs(props.componentRef, {
432
+ ...props.componentOptions,
433
+ children: [
434
+ (props.blockChildren || []).map((child) => {
435
+ return /* @__PURE__ */ jsxRuntime.jsx(RenderBlock$1, {
436
+ block: child,
437
+ context: props.context
438
+ }, "render-block-" + child.id);
439
+ }),
440
+ (props.blockChildren || []).map((child) => {
441
+ return /* @__PURE__ */ jsxRuntime.jsx(BlockStyles$1, {
442
+ block: child,
443
+ context: props.context
444
+ }, "block-style-" + child.id);
445
+ })
446
+ ]
447
+ }) : null
448
+ });
449
+ };
450
+ const RenderComponent$1 = RenderComponent;
451
+ const RenderRepeatedBlock = /* @__PURE__ */ qwik.componentQrl(qwik.inlinedQrl((props) => {
452
+ qwik.useContextProvider(stdin_default, qwik.useStore({
453
+ content: (() => {
454
+ return props.repeatContext.content;
455
+ })(),
456
+ state: (() => {
457
+ return props.repeatContext.state;
458
+ })(),
459
+ context: (() => {
460
+ return props.repeatContext.context;
461
+ })(),
462
+ apiKey: (() => {
463
+ return props.repeatContext.apiKey;
464
+ })(),
465
+ registeredComponents: (() => {
466
+ return props.repeatContext.registeredComponents;
467
+ })()
468
+ }));
469
+ return /* @__PURE__ */ jsxRuntime.jsx(RenderBlock$1, {
470
+ block: props.block,
471
+ context: props.context
472
+ });
473
+ }, "RenderRepeatedBlock_component_fV0PdmPN990"));
474
+ const RenderRepeatedBlock$1 = RenderRepeatedBlock;
475
+ const component = function component2(props, state) {
476
+ const componentName = getProcessedBlock({
477
+ block: props.block,
478
+ state: props.context.state,
479
+ context: props.context.context,
480
+ evaluateBindings: false
481
+ }).component?.name;
482
+ if (!componentName)
483
+ return null;
484
+ const ref = props.context.registeredComponents[componentName];
485
+ if (!ref) {
486
+ console.warn(`
487
+ Could not find a registered component named "${componentName}".
488
+ If you registered it, is the file that registered it imported by the file that needs to render it?`);
489
+ return void 0;
490
+ } else
491
+ return ref;
492
+ };
493
+ const componentInfo$9 = function componentInfo(props, state) {
494
+ if (component(props)) {
495
+ const { component: _, ...info } = component(props);
496
+ return info;
497
+ } else
498
+ return void 0;
499
+ };
500
+ const componentRef = function componentRef2(props, state) {
501
+ return component(props)?.component;
502
+ };
503
+ const tagName = function tagName2(props, state) {
504
+ return getBlockTag(useBlock2(props));
505
+ };
506
+ const useBlock2 = function useBlock3(props, state) {
507
+ return repeatItemData(props) ? props.block : getProcessedBlock({
508
+ block: props.block,
509
+ state: props.context.state,
510
+ context: props.context.context,
511
+ evaluateBindings: true
512
+ });
513
+ };
514
+ const attributes = function attributes2(props, state) {
515
+ return {
516
+ ...getBlockProperties(useBlock2(props)),
517
+ ...getBlockActions({
518
+ block: useBlock2(props),
519
+ state: props.context.state,
520
+ context: props.context.context
521
+ }),
522
+ style: getBlockStyles(useBlock2(props))
523
+ };
524
+ };
525
+ const shouldWrap = function shouldWrap2(props, state) {
526
+ return !componentInfo$9(props)?.noWrap;
527
+ };
528
+ const componentOptions = function componentOptions2(props, state) {
529
+ return {
530
+ ...getBlockComponentOptions(useBlock2(props)),
531
+ ...shouldWrap(props) ? {} : {
532
+ attributes: attributes(props)
533
+ }
534
+ };
535
+ };
536
+ const renderComponentProps = function renderComponentProps2(props, state) {
537
+ return {
538
+ blockChildren: children(props),
539
+ componentRef: componentRef(props),
540
+ componentOptions: componentOptions(props)
541
+ };
542
+ };
543
+ const children = function children2(props, state) {
544
+ return useBlock2(props).children ?? [];
545
+ };
546
+ const childrenWithoutParentComponent = function childrenWithoutParentComponent2(props, state) {
547
+ const shouldRenderChildrenOutsideRef = !componentRef(props) && !repeatItemData(props);
548
+ return shouldRenderChildrenOutsideRef ? children(props) : [];
549
+ };
550
+ const repeatItemData = function repeatItemData2(props, state) {
551
+ const { repeat, ...blockWithoutRepeat } = props.block;
552
+ if (!repeat?.collection)
553
+ return void 0;
554
+ const itemsArray = evaluate({
555
+ code: repeat.collection,
556
+ state: props.context.state,
557
+ context: props.context.context
558
+ });
559
+ if (!Array.isArray(itemsArray))
560
+ return void 0;
561
+ const collectionName = repeat.collection.split(".").pop();
562
+ const itemNameToUse = repeat.itemName || (collectionName ? collectionName + "Item" : "item");
563
+ const repeatArray = itemsArray.map(
564
+ (item, index) => ({
565
+ context: {
566
+ ...props.context,
567
+ state: {
568
+ ...props.context.state,
569
+ $index: index,
570
+ $item: item,
571
+ [itemNameToUse]: item,
572
+ [`$${itemNameToUse}Index`]: index
573
+ }
574
+ },
575
+ block: blockWithoutRepeat
576
+ })
577
+ );
578
+ return repeatArray;
579
+ };
580
+ const RenderBlock = (props) => {
581
+ const state = {};
582
+ state.tagName = tagName(props);
583
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {
584
+ children: shouldWrap(props) ? !isEmptyHtmlElement(tagName(props)) ? /* @__PURE__ */ jsxRuntime.jsxs(state.tagName, {
585
+ ...attributes(props),
586
+ children: [
587
+ repeatItemData(props) ? (repeatItemData(props) || []).map((data, index) => {
588
+ return /* @__PURE__ */ jsxRuntime.jsx(RenderRepeatedBlock$1, {
589
+ repeatContext: data.context,
590
+ block: data.block
591
+ }, index);
592
+ }) : null,
593
+ !repeatItemData(props) ? /* @__PURE__ */ jsxRuntime.jsx(RenderComponent$1, {
594
+ ...renderComponentProps(props)
595
+ }) : null,
596
+ (childrenWithoutParentComponent(props) || []).map((child) => {
597
+ return /* @__PURE__ */ jsxRuntime.jsx(RenderBlock, {
598
+ block: child,
599
+ context: props.context
600
+ }, "render-block-" + child.id);
601
+ }),
602
+ (childrenWithoutParentComponent(props) || []).map((child) => {
603
+ return /* @__PURE__ */ jsxRuntime.jsx(BlockStyles$1, {
604
+ block: child,
605
+ context: props.context
606
+ }, "block-style-" + child.id);
607
+ })
608
+ ]
609
+ }) : /* @__PURE__ */ jsxRuntime.jsx(state.tagName, {
610
+ ...attributes(props)
611
+ }) : /* @__PURE__ */ jsxRuntime.jsx(RenderComponent$1, {
612
+ ...renderComponentProps(props),
613
+ context: props.context
614
+ })
615
+ });
616
+ };
617
+ const RenderBlock$1 = RenderBlock;
618
+ const className = function className2(props, state, builderContext) {
619
+ return "builder-blocks" + (!props.blocks?.length ? " no-blocks" : "");
620
+ };
621
+ const onClick$1 = function onClick(props, state, builderContext) {
622
+ if (isEditing() && !props.blocks?.length)
623
+ window.parent?.postMessage({
624
+ type: "builder.clickEmptyBlocks",
625
+ data: {
626
+ parentElementId: props.parent,
627
+ dataPath: props.path
628
+ }
629
+ }, "*");
630
+ };
631
+ const onMouseEnter = function onMouseEnter2(props, state, builderContext) {
632
+ if (isEditing() && !props.blocks?.length)
633
+ window.parent?.postMessage({
634
+ type: "builder.hoverEmptyBlocks",
635
+ data: {
636
+ parentElementId: props.parent,
637
+ dataPath: props.path
638
+ }
639
+ }, "*");
640
+ };
641
+ const RenderBlocks = /* @__PURE__ */ qwik.componentQrl(qwik.inlinedQrl((props) => {
642
+ qwik.useStylesScopedQrl(qwik.inlinedQrl(STYLES$2, "RenderBlocks_component_useStylesScoped_QNti2s7juQc"));
643
+ const builderContext = qwik.useContext(stdin_default);
644
+ const state = {};
645
+ return /* @__PURE__ */ jsxRuntime.jsx(qwik.Host, {
646
+ class: className(props) + " div-RenderBlocks",
647
+ "builder-path": props.path,
648
+ "builder-parent-id": props.parent,
649
+ dataSet: {
650
+ class: className(props)
651
+ },
652
+ onClick$: qwik.inlinedQrl((event) => {
653
+ const [builderContext2, props2, state2] = qwik.useLexicalScope();
654
+ return onClick$1(props2);
655
+ }, "RenderBlocks_component_Host_onClick_81ErKSpyspw", [
656
+ builderContext,
657
+ props,
658
+ state
659
+ ]),
660
+ onMouseEnter$: qwik.inlinedQrl((event) => {
661
+ const [builderContext2, props2, state2] = qwik.useLexicalScope();
662
+ return onMouseEnter(props2);
663
+ }, "RenderBlocks_component_Host_onMouseEnter_h6rWG6KLkHE", [
664
+ builderContext,
665
+ props,
666
+ state
667
+ ]),
668
+ children: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, {
669
+ children: [
670
+ props.blocks ? (props.blocks || []).map((block) => {
671
+ return /* @__PURE__ */ jsxRuntime.jsx(RenderBlock$1, {
672
+ block,
673
+ context: builderContext
674
+ }, "render-block-" + block.id);
675
+ }) : null,
676
+ props.blocks ? (props.blocks || []).map((block) => {
677
+ return /* @__PURE__ */ jsxRuntime.jsx(BlockStyles$1, {
678
+ block,
679
+ context: builderContext
680
+ }, "block-style-" + block.id);
681
+ }) : null
682
+ ]
683
+ })
684
+ });
685
+ }, "RenderBlocks_component_SXGwmVyEM0s"), {
686
+ tagName: "div"
687
+ });
688
+ const RenderBlocks$1 = RenderBlocks;
689
+ const STYLES$2 = `.div-RenderBlocks {
690
+ display: flex;
691
+ flex-direction: column;
692
+ align-items: stretch; }`;
693
+ const getGutterSize = function getGutterSize2(props, state) {
694
+ return typeof props.space === "number" ? props.space || 0 : 20;
695
+ };
696
+ const getColumns = function getColumns2(props, state) {
697
+ return props.columns || [];
698
+ };
699
+ const getWidth = function getWidth2(props, state, index) {
700
+ const columns = getColumns(props);
701
+ return columns[index]?.width || 100 / columns.length;
702
+ };
703
+ const getColumnCssWidth = function getColumnCssWidth2(props, state, index) {
704
+ const columns = getColumns(props);
705
+ const gutterSize = getGutterSize(props);
706
+ const subtractWidth = gutterSize * (columns.length - 1) / columns.length;
707
+ return `calc(${getWidth(props, state, index)}% - ${subtractWidth}px)`;
708
+ };
709
+ const maybeApplyForTablet = function maybeApplyForTablet2(props, state, prop) {
710
+ const _stackColumnsAt = props.stackColumnsAt || "tablet";
711
+ return _stackColumnsAt === "tablet" ? prop : "inherit";
712
+ };
713
+ const columnsCssVars = function columnsCssVars2(props, state) {
714
+ const flexDir = props.stackColumnsAt === "never" ? "inherit" : props.reverseColumnsWhenStacked ? "column-reverse" : "column";
715
+ return {
716
+ "--flex-dir": flexDir,
717
+ "--flex-dir-tablet": maybeApplyForTablet(props, state, flexDir)
718
+ };
719
+ };
720
+ const columnCssVars = function columnCssVars2(props, state) {
721
+ const width = "100%";
722
+ const marginLeft = "0";
723
+ return {
724
+ "--column-width": width,
725
+ "--column-margin-left": marginLeft,
726
+ "--column-width-tablet": maybeApplyForTablet(props, state, width),
727
+ "--column-margin-left-tablet": maybeApplyForTablet(props, state, marginLeft)
728
+ };
729
+ };
730
+ const Columns = /* @__PURE__ */ qwik.componentQrl(qwik.inlinedQrl((props) => {
731
+ qwik.useStylesScopedQrl(qwik.inlinedQrl(STYLES$1, "Columns_component_useStylesScoped_704fWXyHORo"));
732
+ const state = {};
733
+ return /* @__PURE__ */ jsxRuntime.jsx(qwik.Host, {
734
+ class: "builder-columns div-Columns",
735
+ style: columnsCssVars(props, state),
736
+ children: (props.columns || []).map((column, index) => {
737
+ return /* @__PURE__ */ jsxRuntime.jsx("div", {
738
+ class: "builder-column div-Columns-2",
739
+ style: {
740
+ width: getColumnCssWidth(props, state, index),
741
+ marginLeft: `${index === 0 ? 0 : getGutterSize(props)}px`,
742
+ ...columnCssVars(props, state)
743
+ },
744
+ children: /* @__PURE__ */ jsxRuntime.jsx(RenderBlocks$1, {
745
+ blocks: column.blocks
746
+ })
747
+ }, index);
748
+ })
749
+ });
750
+ }, "Columns_component_0PeVQGTMczc"), {
751
+ tagName: "div"
752
+ });
753
+ const Columns$1 = Columns;
754
+ const STYLES$1 = `.div-Columns {
755
+ display: flex;
756
+ align-items: stretch;
757
+ line-height: normal; }@media (max-width: 999px) { .div-Columns {
758
+ flex-direction: var(--flex-dir-tablet); } }@media (max-width: 639px) { .div-Columns {
759
+ flex-direction: var(--flex-dir); } }.div-Columns-2 {
760
+ flex-grow: 1; }@media (max-width: 999px) { .div-Columns-2 {
761
+ width: var(--column-width-tablet) !important;
762
+ margin-left: var(--column-margin-left-tablet) !important; } }@media (max-width: 639px) { .div-Columns-2 {
763
+ width: var(--column-width) !important;
764
+ margin-left: var(--column-margin-left) !important; } }`;
765
+ function removeProtocol(path) {
766
+ return path.replace(/http(s)?:/, "");
767
+ }
768
+ function updateQueryParam(uri = "", key, value) {
769
+ const re = new RegExp("([?&])" + key + "=.*?(&|$)", "i");
770
+ const separator = uri.indexOf("?") !== -1 ? "&" : "?";
771
+ if (uri.match(re))
772
+ return uri.replace(re, "$1" + key + "=" + encodeURIComponent(value) + "$2");
773
+ return uri + separator + key + "=" + encodeURIComponent(value);
774
+ }
775
+ function getShopifyImageUrl(src, size) {
776
+ if (!src || !(src == null ? void 0 : src.match(/cdn\.shopify\.com/)) || !size)
777
+ return src;
778
+ if (size === "master")
779
+ return removeProtocol(src);
780
+ const match = src.match(/(_\d+x(\d+)?)?(\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif)(\?v=\d+)?)/i);
781
+ if (match) {
782
+ const prefix = src.split(match[0]);
783
+ const suffix = match[3];
784
+ const useSize = size.match("x") ? size : `${size}x`;
785
+ return removeProtocol(`${prefix[0]}_${useSize}${suffix}`);
786
+ }
787
+ return null;
788
+ }
789
+ function getSrcSet(url) {
790
+ if (!url)
791
+ return url;
792
+ const sizes = [
793
+ 100,
794
+ 200,
795
+ 400,
796
+ 800,
797
+ 1200,
798
+ 1600,
799
+ 2e3
800
+ ];
801
+ if (url.match(/builder\.io/)) {
802
+ let srcUrl = url;
803
+ const widthInSrc = Number(url.split("?width=")[1]);
804
+ if (!isNaN(widthInSrc))
805
+ srcUrl = `${srcUrl} ${widthInSrc}w`;
806
+ return sizes.filter(
807
+ (size) => size !== widthInSrc
808
+ ).map(
809
+ (size) => `${updateQueryParam(url, "width", size)} ${size}w`
810
+ ).concat([
811
+ srcUrl
812
+ ]).join(", ");
813
+ }
814
+ if (url.match(/cdn\.shopify\.com/))
815
+ return sizes.map(
816
+ (size) => [
817
+ getShopifyImageUrl(url, `${size}x${size}`),
818
+ size
819
+ ]
820
+ ).filter(
821
+ ([sizeUrl]) => !!sizeUrl
822
+ ).map(
823
+ ([sizeUrl, size]) => `${sizeUrl} ${size}w`
824
+ ).concat([
825
+ url
826
+ ]).join(", ");
827
+ return url;
828
+ }
829
+ const srcSetToUse = function srcSetToUse2(props, state) {
830
+ const imageToUse = props.image || props.src;
831
+ const url = imageToUse;
832
+ if (!url || !(url.match(/builder\.io/) || url.match(/cdn\.shopify\.com/)))
833
+ return props.srcset;
834
+ if (props.srcset && props.image?.includes("builder.io/api/v1/image")) {
835
+ if (!props.srcset.includes(props.image.split("?")[0])) {
836
+ console.debug("Removed given srcset");
837
+ return getSrcSet(url);
838
+ }
839
+ } else if (props.image && !props.srcset)
840
+ return getSrcSet(url);
841
+ return getSrcSet(url);
842
+ };
843
+ const webpSrcSet = function webpSrcSet2(props, state) {
844
+ if (srcSetToUse(props)?.match(/builder\.io/) && !props.noWebp)
845
+ return srcSetToUse(props).replace(/\?/g, "?format=webp&");
846
+ else
847
+ return "";
848
+ };
849
+ const Image = /* @__PURE__ */ qwik.componentQrl(qwik.inlinedQrl((props) => {
850
+ qwik.useStylesScopedQrl(qwik.inlinedQrl(STYLES, "Image_component_useStylesScoped_gRbO7w7SeZA"));
851
+ return /* @__PURE__ */ jsxRuntime.jsx(qwik.Host, {
852
+ class: "div-Image",
853
+ children: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, {
854
+ children: [
855
+ /* @__PURE__ */ jsxRuntime.jsxs("picture", {
856
+ children: [
857
+ webpSrcSet(props) ? /* @__PURE__ */ jsxRuntime.jsx("source", {
858
+ type: "image/webp",
859
+ srcset: webpSrcSet(props)
860
+ }) : null,
861
+ /* @__PURE__ */ jsxRuntime.jsx("img", {
862
+ loading: "lazy",
863
+ alt: props.altText,
864
+ role: props.altText ? "presentation" : void 0,
865
+ style: {
866
+ objectPosition: props.backgroundSize || "center",
867
+ objectFit: props.backgroundSize || "cover"
868
+ },
869
+ class: "builder-image" + (props.className ? " " + props.className : "") + " img-Image",
870
+ src: props.image,
871
+ srcset: srcSetToUse(props),
872
+ sizes: props.sizes
873
+ }),
874
+ /* @__PURE__ */ jsxRuntime.jsx("source", {
875
+ srcset: srcSetToUse(props)
876
+ })
877
+ ]
878
+ }),
879
+ props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length) ? /* @__PURE__ */ jsxRuntime.jsx("div", {
880
+ class: "builder-image-sizer div-Image-2",
881
+ style: {
882
+ paddingTop: props.aspectRatio * 100 + "%"
883
+ }
884
+ }) : null,
885
+ props.builderBlock?.children?.length && props.fitContent ? /* @__PURE__ */ jsxRuntime.jsx(qwik.Slot, {}) : null,
886
+ !props.fitContent ? /* @__PURE__ */ jsxRuntime.jsx("div", {
887
+ class: "div-Image-3",
888
+ children: /* @__PURE__ */ jsxRuntime.jsx(qwik.Slot, {})
889
+ }) : null
890
+ ]
891
+ })
892
+ });
893
+ }, "Image_component_y3S3Zox9wEo"), {
894
+ tagName: "div"
895
+ });
896
+ const Image$1 = Image;
897
+ const STYLES = `.div-Image {
898
+ position: relative; }.img-Image {
899
+ opacity: 1;
900
+ transition: opacity 0.2s ease-in-out;
901
+ position: absolute;
902
+ height: 100%;
903
+ width: 100%;
904
+ top: 0px;
905
+ left: 0px; }.div-Image-2 {
906
+ width: 100%;
907
+ pointer-events: none;
908
+ font-size: 0; }.div-Image-3 {
909
+ display: flex;
910
+ flex-direction: column;
911
+ align-items: stretch;
912
+ position: absolute;
913
+ top: 0;
914
+ left: 0;
915
+ width: 100%;
916
+ height: 100%; }`;
917
+ const Text = /* @__PURE__ */ qwik.componentQrl(qwik.inlinedQrl((props) => {
918
+ return /* @__PURE__ */ jsxRuntime.jsx(qwik.Host, {
919
+ class: "builder-text",
920
+ dangerouslySetInnerHTML: props.text
921
+ });
922
+ }, "Text_component_ci0NVEdoK0Q"), {
923
+ tagName: "div"
924
+ });
925
+ const Text$1 = Text;
926
+ const videoProps = function videoProps2(props, state) {
927
+ return {
928
+ ...props.autoPlay === true ? {
929
+ autoPlay: true
930
+ } : {},
931
+ ...props.muted === true ? {
932
+ muted: true
933
+ } : {},
934
+ ...props.controls === true ? {
935
+ controls: true
936
+ } : {},
937
+ ...props.loop === true ? {
938
+ loop: true
939
+ } : {},
940
+ ...props.playsInline === true ? {
941
+ playsInline: true
942
+ } : {}
943
+ };
944
+ };
945
+ const Video = /* @__PURE__ */ qwik.componentQrl(qwik.inlinedQrl((props) => {
946
+ return /* @__PURE__ */ jsxRuntime.jsx(qwik.Host, {
947
+ ...videoProps(props),
948
+ style: {
949
+ width: "100%",
950
+ height: "100%",
951
+ ...props.attributes?.style,
952
+ objectFit: props.fit,
953
+ objectPosition: props.position,
954
+ borderRadius: 1
955
+ },
956
+ src: props.video || "no-src",
957
+ poster: props.posterImage
958
+ });
959
+ }, "Video_component_O5sPuWlrTvk"), {
960
+ tagName: "video"
961
+ });
962
+ const Video$1 = Video;
963
+ const Button = /* @__PURE__ */ qwik.componentQrl(qwik.inlinedQrl((props) => {
964
+ return /* @__PURE__ */ jsxRuntime.jsx(qwik.Fragment, {
965
+ children: props.link ? /* @__PURE__ */ jsxRuntime.jsx("a", {
966
+ role: "button",
967
+ ...props.attributes,
968
+ href: props.link,
969
+ target: props.openLinkInNewTab ? "_blank" : void 0,
970
+ children: props.text
971
+ }) : /* @__PURE__ */ jsxRuntime.jsx("span", {
972
+ ...props.attributes,
973
+ children: props.text
974
+ })
975
+ });
976
+ }, "Button_component_FtjCELjtKF4"));
977
+ const Button$1 = Button;
978
+ const componentInfo$8 = {
979
+ name: "Core:Button",
980
+ builtIn: true,
981
+ image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",
982
+ defaultStyles: {
983
+ appearance: "none",
984
+ paddingTop: "15px",
985
+ paddingBottom: "15px",
986
+ paddingLeft: "25px",
987
+ paddingRight: "25px",
988
+ backgroundColor: "#000000",
989
+ color: "white",
990
+ borderRadius: "4px",
991
+ textAlign: "center",
992
+ cursor: "pointer"
993
+ },
994
+ inputs: [
995
+ {
996
+ name: "text",
997
+ type: "text",
998
+ defaultValue: "Click me!",
999
+ bubble: true
1000
+ },
1001
+ {
1002
+ name: "link",
1003
+ type: "url",
1004
+ bubble: true
1005
+ },
1006
+ {
1007
+ name: "openLinkInNewTab",
1008
+ type: "boolean",
1009
+ defaultValue: false,
1010
+ friendlyName: "Open link in new tab"
1011
+ }
1012
+ ],
1013
+ static: true,
1014
+ noWrap: true
1015
+ };
1016
+ function markSerializable(fn) {
1017
+ fn.__qwik_serializable__ = true;
1018
+ return fn;
1019
+ }
1020
+ const componentInfo$7 = {
1021
+ name: "Columns",
1022
+ builtIn: true,
1023
+ inputs: [
1024
+ {
1025
+ name: "columns",
1026
+ type: "array",
1027
+ broadcast: true,
1028
+ subFields: [
1029
+ {
1030
+ name: "blocks",
1031
+ type: "array",
1032
+ hideFromUI: true,
1033
+ defaultValue: [
1034
+ {
1035
+ "@type": "@builder.io/sdk:Element",
1036
+ responsiveStyles: {
1037
+ large: {
1038
+ display: "flex",
1039
+ flexDirection: "column",
1040
+ alignItems: "stretch",
1041
+ flexShrink: "0",
1042
+ position: "relative",
1043
+ marginTop: "30px",
1044
+ textAlign: "center",
1045
+ lineHeight: "normal",
1046
+ height: "auto",
1047
+ minHeight: "20px",
1048
+ minWidth: "20px",
1049
+ overflow: "hidden"
1050
+ }
1051
+ },
1052
+ component: {
1053
+ name: "Image",
1054
+ options: {
1055
+ image: "https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",
1056
+ backgroundPosition: "center",
1057
+ backgroundSize: "cover",
1058
+ aspectRatio: 0.7004048582995948
1059
+ }
1060
+ }
1061
+ },
1062
+ {
1063
+ "@type": "@builder.io/sdk:Element",
1064
+ responsiveStyles: {
1065
+ large: {
1066
+ display: "flex",
1067
+ flexDirection: "column",
1068
+ alignItems: "stretch",
1069
+ flexShrink: "0",
1070
+ position: "relative",
1071
+ marginTop: "30px",
1072
+ textAlign: "center",
1073
+ lineHeight: "normal",
1074
+ height: "auto"
1075
+ }
1076
+ },
1077
+ component: {
1078
+ name: "Text",
1079
+ options: {
1080
+ text: "<p>Enter some text...</p>"
1081
+ }
1082
+ }
1083
+ }
1084
+ ]
1085
+ },
1086
+ {
1087
+ name: "width",
1088
+ type: "number",
1089
+ hideFromUI: true,
1090
+ helperText: "Width %, e.g. set to 50 to fill half of the space"
1091
+ },
1092
+ {
1093
+ name: "link",
1094
+ type: "url",
1095
+ helperText: "Optionally set a url that clicking this column will link to"
1096
+ }
1097
+ ],
1098
+ defaultValue: [
1099
+ {
1100
+ blocks: [
1101
+ {
1102
+ "@type": "@builder.io/sdk:Element",
1103
+ responsiveStyles: {
1104
+ large: {
1105
+ display: "flex",
1106
+ flexDirection: "column",
1107
+ alignItems: "stretch",
1108
+ flexShrink: "0",
1109
+ position: "relative",
1110
+ marginTop: "30px",
1111
+ textAlign: "center",
1112
+ lineHeight: "normal",
1113
+ height: "auto",
1114
+ minHeight: "20px",
1115
+ minWidth: "20px",
1116
+ overflow: "hidden"
1117
+ }
1118
+ },
1119
+ component: {
1120
+ name: "Image",
1121
+ options: {
1122
+ image: "https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",
1123
+ backgroundPosition: "center",
1124
+ backgroundSize: "cover",
1125
+ aspectRatio: 0.7004048582995948
1126
+ }
1127
+ }
1128
+ },
1129
+ {
1130
+ "@type": "@builder.io/sdk:Element",
1131
+ responsiveStyles: {
1132
+ large: {
1133
+ display: "flex",
1134
+ flexDirection: "column",
1135
+ alignItems: "stretch",
1136
+ flexShrink: "0",
1137
+ position: "relative",
1138
+ marginTop: "30px",
1139
+ textAlign: "center",
1140
+ lineHeight: "normal",
1141
+ height: "auto"
1142
+ }
1143
+ },
1144
+ component: {
1145
+ name: "Text",
1146
+ options: {
1147
+ text: "<p>Enter some text...</p>"
1148
+ }
1149
+ }
1150
+ }
1151
+ ]
1152
+ },
1153
+ {
1154
+ blocks: [
1155
+ {
1156
+ "@type": "@builder.io/sdk:Element",
1157
+ responsiveStyles: {
1158
+ large: {
1159
+ display: "flex",
1160
+ flexDirection: "column",
1161
+ alignItems: "stretch",
1162
+ flexShrink: "0",
1163
+ position: "relative",
1164
+ marginTop: "30px",
1165
+ textAlign: "center",
1166
+ lineHeight: "normal",
1167
+ height: "auto",
1168
+ minHeight: "20px",
1169
+ minWidth: "20px",
1170
+ overflow: "hidden"
1171
+ }
1172
+ },
1173
+ component: {
1174
+ name: "Image",
1175
+ options: {
1176
+ image: "https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",
1177
+ backgroundPosition: "center",
1178
+ backgroundSize: "cover",
1179
+ aspectRatio: 0.7004048582995948
1180
+ }
1181
+ }
1182
+ },
1183
+ {
1184
+ "@type": "@builder.io/sdk:Element",
1185
+ responsiveStyles: {
1186
+ large: {
1187
+ display: "flex",
1188
+ flexDirection: "column",
1189
+ alignItems: "stretch",
1190
+ flexShrink: "0",
1191
+ position: "relative",
1192
+ marginTop: "30px",
1193
+ textAlign: "center",
1194
+ lineHeight: "normal",
1195
+ height: "auto"
1196
+ }
1197
+ },
1198
+ component: {
1199
+ name: "Text",
1200
+ options: {
1201
+ text: "<p>Enter some text...</p>"
1202
+ }
1203
+ }
1204
+ }
1205
+ ]
1206
+ }
1207
+ ],
1208
+ onChange: markSerializable((options) => {
1209
+ function clearWidths() {
1210
+ columns.forEach((col) => {
1211
+ col.delete("width");
1212
+ });
1213
+ }
1214
+ const columns = options.get("columns");
1215
+ if (Array.isArray(columns)) {
1216
+ const containsColumnWithWidth = !!columns.find(
1217
+ (col) => col.get("width")
1218
+ );
1219
+ if (containsColumnWithWidth) {
1220
+ const containsColumnWithoutWidth = !!columns.find(
1221
+ (col) => !col.get("width")
1222
+ );
1223
+ if (containsColumnWithoutWidth)
1224
+ clearWidths();
1225
+ else {
1226
+ const sumWidths = columns.reduce((memo, col) => {
1227
+ return memo + col.get("width");
1228
+ }, 0);
1229
+ const widthsDontAddUp = sumWidths !== 100;
1230
+ if (widthsDontAddUp)
1231
+ clearWidths();
1232
+ }
1233
+ }
1234
+ }
1235
+ })
1236
+ },
1237
+ {
1238
+ name: "space",
1239
+ type: "number",
1240
+ defaultValue: 20,
1241
+ helperText: "Size of gap between columns",
1242
+ advanced: true
1243
+ },
1244
+ {
1245
+ name: "stackColumnsAt",
1246
+ type: "string",
1247
+ defaultValue: "tablet",
1248
+ helperText: "Convert horizontal columns to vertical at what device size",
1249
+ enum: [
1250
+ "tablet",
1251
+ "mobile",
1252
+ "never"
1253
+ ],
1254
+ advanced: true
1255
+ },
1256
+ {
1257
+ name: "reverseColumnsWhenStacked",
1258
+ type: "boolean",
1259
+ defaultValue: false,
1260
+ helperText: "When stacking columns for mobile devices, reverse the ordering",
1261
+ advanced: true
1262
+ }
1263
+ ]
1264
+ };
1265
+ const componentInfo$6 = {
1266
+ name: "Fragment",
1267
+ static: true,
1268
+ hidden: true,
1269
+ builtIn: true,
1270
+ canHaveChildren: true,
1271
+ noWrap: true
1272
+ };
1273
+ const FragmentComponent = /* @__PURE__ */ qwik.componentQrl(qwik.inlinedQrl((props) => {
1274
+ return /* @__PURE__ */ jsxRuntime.jsx(qwik.Host, {
1275
+ children: /* @__PURE__ */ jsxRuntime.jsx(qwik.Slot, {})
1276
+ });
1277
+ }, "FragmentComponent_component_FJmqlA66Rjg"), {
1278
+ tagName: "span"
1279
+ });
1280
+ const Fragment = FragmentComponent;
1281
+ const componentInfo$5 = {
1282
+ name: "Image",
1283
+ static: true,
1284
+ builtIn: true,
1285
+ 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",
1286
+ defaultStyles: {
1287
+ position: "relative",
1288
+ minHeight: "20px",
1289
+ minWidth: "20px",
1290
+ overflow: "hidden"
1291
+ },
1292
+ canHaveChildren: true,
1293
+ inputs: [
1294
+ {
1295
+ name: "image",
1296
+ type: "file",
1297
+ bubble: true,
1298
+ allowedFileTypes: [
1299
+ "jpeg",
1300
+ "jpg",
1301
+ "png",
1302
+ "svg"
1303
+ ],
1304
+ required: true,
1305
+ defaultValue: "https://cdn.builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",
1306
+ onChange: markSerializable((options) => {
1307
+ const DEFAULT_ASPECT_RATIO = 0.7041;
1308
+ options.delete("srcset");
1309
+ options.delete("noWebp");
1310
+ function loadImage(url, timeout = 6e4) {
1311
+ return new Promise((resolve, reject) => {
1312
+ const img = document.createElement("img");
1313
+ let loaded = false;
1314
+ img.onload = () => {
1315
+ loaded = true;
1316
+ resolve(img);
1317
+ };
1318
+ img.addEventListener("error", (event) => {
1319
+ console.warn("Image load failed", event.error);
1320
+ reject(event.error);
1321
+ });
1322
+ img.src = url;
1323
+ setTimeout(() => {
1324
+ if (!loaded)
1325
+ reject(new Error("Image load timed out"));
1326
+ }, timeout);
1327
+ });
1328
+ }
1329
+ function round(num) {
1330
+ return Math.round(num * 1e3) / 1e3;
1331
+ }
1332
+ const value = options.get("image");
1333
+ const aspectRatio = options.get("aspectRatio");
1334
+ fetch(value).then(
1335
+ (res) => res.blob()
1336
+ ).then((blob) => {
1337
+ if (blob.type.includes("svg"))
1338
+ options.set("noWebp", true);
1339
+ });
1340
+ if (value && (!aspectRatio || aspectRatio === DEFAULT_ASPECT_RATIO))
1341
+ return loadImage(value).then((img) => {
1342
+ const possiblyUpdatedAspectRatio = options.get("aspectRatio");
1343
+ if (options.get("image") === value && (!possiblyUpdatedAspectRatio || possiblyUpdatedAspectRatio === DEFAULT_ASPECT_RATIO)) {
1344
+ if (img.width && img.height) {
1345
+ options.set("aspectRatio", round(img.height / img.width));
1346
+ options.set("height", img.height);
1347
+ options.set("width", img.width);
1348
+ }
1349
+ }
1350
+ });
1351
+ })
1352
+ },
1353
+ {
1354
+ name: "backgroundSize",
1355
+ type: "text",
1356
+ defaultValue: "cover",
1357
+ enum: [
1358
+ {
1359
+ label: "contain",
1360
+ value: "contain",
1361
+ helperText: "The image should never get cropped"
1362
+ },
1363
+ {
1364
+ label: "cover",
1365
+ value: "cover",
1366
+ helperText: "The image should fill it's box, cropping when needed"
1367
+ }
1368
+ ]
1369
+ },
1370
+ {
1371
+ name: "backgroundPosition",
1372
+ type: "text",
1373
+ defaultValue: "center",
1374
+ enum: [
1375
+ "center",
1376
+ "top",
1377
+ "left",
1378
+ "right",
1379
+ "bottom",
1380
+ "top left",
1381
+ "top right",
1382
+ "bottom left",
1383
+ "bottom right"
1384
+ ]
1385
+ },
1386
+ {
1387
+ name: "altText",
1388
+ type: "string",
1389
+ helperText: "Text to display when the user has images off"
1390
+ },
1391
+ {
1392
+ name: "height",
1393
+ type: "number",
1394
+ hideFromUI: true
1395
+ },
1396
+ {
1397
+ name: "width",
1398
+ type: "number",
1399
+ hideFromUI: true
1400
+ },
1401
+ {
1402
+ name: "sizes",
1403
+ type: "string",
1404
+ hideFromUI: true
1405
+ },
1406
+ {
1407
+ name: "srcset",
1408
+ type: "string",
1409
+ hideFromUI: true
1410
+ },
1411
+ {
1412
+ name: "lazy",
1413
+ type: "boolean",
1414
+ defaultValue: true,
1415
+ hideFromUI: true
1416
+ },
1417
+ {
1418
+ name: "fitContent",
1419
+ type: "boolean",
1420
+ helperText: "When child blocks are provided, fit to them instead of using the image's aspect ratio",
1421
+ defaultValue: true
1422
+ },
1423
+ {
1424
+ name: "aspectRatio",
1425
+ type: "number",
1426
+ 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",
1427
+ advanced: true,
1428
+ defaultValue: 0.7041
1429
+ }
1430
+ ]
1431
+ };
1432
+ const componentInfo$4 = {
1433
+ name: "Core:Section",
1434
+ static: true,
1435
+ builtIn: true,
1436
+ image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
1437
+ inputs: [
1438
+ {
1439
+ name: "maxWidth",
1440
+ type: "number",
1441
+ defaultValue: 1200
1442
+ },
1443
+ {
1444
+ name: "lazyLoad",
1445
+ type: "boolean",
1446
+ defaultValue: false,
1447
+ advanced: true,
1448
+ description: "Only render this section when in view"
1449
+ }
1450
+ ],
1451
+ defaultStyles: {
1452
+ paddingLeft: "20px",
1453
+ paddingRight: "20px",
1454
+ paddingTop: "50px",
1455
+ paddingBottom: "50px",
1456
+ marginTop: "0px",
1457
+ width: "100vw",
1458
+ marginLeft: "calc(50% - 50vw)"
1459
+ },
1460
+ canHaveChildren: true,
1461
+ defaultChildren: [
1462
+ {
1463
+ "@type": "@builder.io/sdk:Element",
1464
+ responsiveStyles: {
1465
+ large: {
1466
+ textAlign: "center"
1467
+ }
1468
+ },
1469
+ component: {
1470
+ name: "Text",
1471
+ options: {
1472
+ 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>"
1473
+ }
1474
+ }
1475
+ }
1476
+ ]
1477
+ };
1478
+ const SectionComponent = /* @__PURE__ */ qwik.componentQrl(qwik.inlinedQrl((props) => {
1479
+ return /* @__PURE__ */ jsxRuntime.jsx(qwik.Host, {
1480
+ ...props.attributes,
1481
+ style: (() => {
1482
+ props.maxWidth && typeof props.maxWidth === "number" ? props.maxWidth : void 0;
1483
+ })(),
1484
+ children: /* @__PURE__ */ jsxRuntime.jsx(qwik.Slot, {})
1485
+ });
1486
+ }, "SectionComponent_component_m1CcjCwgHug"), {
1487
+ tagName: "section"
1488
+ });
1489
+ const Section = SectionComponent;
1490
+ const componentInfo$3 = {
1491
+ name: "Symbol",
1492
+ noWrap: true,
1493
+ static: true,
1494
+ builtIn: true,
1495
+ inputs: [
1496
+ {
1497
+ name: "symbol",
1498
+ type: "uiSymbol"
1499
+ },
1500
+ {
1501
+ name: "dataOnly",
1502
+ helperText: "Make this a data symbol that doesn't display any UI",
1503
+ type: "boolean",
1504
+ defaultValue: false,
1505
+ advanced: true,
1506
+ hideFromUI: true
1507
+ },
1508
+ {
1509
+ name: "inheritState",
1510
+ helperText: "Inherit the parent component state and data",
1511
+ type: "boolean",
1512
+ defaultValue: false,
1513
+ advanced: true
1514
+ },
1515
+ {
1516
+ name: "renderToLiquid",
1517
+ helperText: "Render this symbols contents to liquid. Turn off to fetch with javascript and use custom targeting",
1518
+ type: "boolean",
1519
+ defaultValue: false,
1520
+ advanced: true,
1521
+ hideFromUI: true
1522
+ },
1523
+ {
1524
+ name: "useChildren",
1525
+ hideFromUI: true,
1526
+ type: "boolean"
1527
+ }
1528
+ ]
1529
+ };
1530
+ const componentInfo$2 = {
1531
+ name: "Text",
1532
+ static: true,
1533
+ builtIn: true,
1534
+ 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",
1535
+ inputs: [
1536
+ {
1537
+ name: "text",
1538
+ type: "html",
1539
+ required: true,
1540
+ autoFocus: true,
1541
+ bubble: true,
1542
+ defaultValue: "Enter some text..."
1543
+ }
1544
+ ],
1545
+ defaultStyles: {
1546
+ lineHeight: "normal",
1547
+ height: "auto",
1548
+ textAlign: "center"
1549
+ }
1550
+ };
1551
+ const componentInfo$1 = {
1552
+ name: "Video",
1553
+ canHaveChildren: true,
1554
+ builtIn: true,
1555
+ defaultStyles: {
1556
+ minHeight: "20px",
1557
+ minWidth: "20px"
1558
+ },
1559
+ 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",
1560
+ inputs: [
1561
+ {
1562
+ name: "video",
1563
+ type: "file",
1564
+ allowedFileTypes: [
1565
+ "mp4"
1566
+ ],
1567
+ bubble: true,
1568
+ defaultValue: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/assets%2FKQlEmWDxA0coC3PK6UvkrjwkIGI2%2F28cb070609f546cdbe5efa20e931aa4b?alt=media&token=912e9551-7a7c-4dfb-86b6-3da1537d1a7f",
1569
+ required: true
1570
+ },
1571
+ {
1572
+ name: "posterImage",
1573
+ type: "file",
1574
+ allowedFileTypes: [
1575
+ "jpeg",
1576
+ "png"
1577
+ ],
1578
+ helperText: "Image to show before the video plays"
1579
+ },
1580
+ {
1581
+ name: "autoPlay",
1582
+ type: "boolean",
1583
+ defaultValue: true
1584
+ },
1585
+ {
1586
+ name: "controls",
1587
+ type: "boolean",
1588
+ defaultValue: false
1589
+ },
1590
+ {
1591
+ name: "muted",
1592
+ type: "boolean",
1593
+ defaultValue: true
1594
+ },
1595
+ {
1596
+ name: "loop",
1597
+ type: "boolean",
1598
+ defaultValue: true
1599
+ },
1600
+ {
1601
+ name: "playsInline",
1602
+ type: "boolean",
1603
+ defaultValue: true
1604
+ },
1605
+ {
1606
+ name: "fit",
1607
+ type: "text",
1608
+ defaultValue: "cover",
1609
+ enum: [
1610
+ "contain",
1611
+ "cover",
1612
+ "fill",
1613
+ "auto"
1614
+ ]
1615
+ },
1616
+ {
1617
+ name: "fitContent",
1618
+ type: "boolean",
1619
+ helperText: "When child blocks are provided, fit to them instead of using the aspect ratio",
1620
+ defaultValue: true,
1621
+ advanced: true
1622
+ },
1623
+ {
1624
+ name: "position",
1625
+ type: "text",
1626
+ defaultValue: "center",
1627
+ enum: [
1628
+ "center",
1629
+ "top",
1630
+ "left",
1631
+ "right",
1632
+ "bottom",
1633
+ "top left",
1634
+ "top right",
1635
+ "bottom left",
1636
+ "bottom right"
1637
+ ]
1638
+ },
1639
+ {
1640
+ name: "height",
1641
+ type: "number",
1642
+ advanced: true
1643
+ },
1644
+ {
1645
+ name: "width",
1646
+ type: "number",
1647
+ advanced: true
1648
+ },
1649
+ {
1650
+ name: "aspectRatio",
1651
+ type: "number",
1652
+ advanced: true,
1653
+ defaultValue: 0.7004048582995948
1654
+ },
1655
+ {
1656
+ name: "lazyLoad",
1657
+ type: "boolean",
1658
+ helperText: 'Load this video "lazily" - as in only when a user scrolls near the video. Recommended for optmized performance and bandwidth consumption',
1659
+ defaultValue: true,
1660
+ advanced: true
1661
+ }
1662
+ ]
1663
+ };
1664
+ const componentInfo2 = {
1665
+ name: "Embed",
1666
+ static: true,
1667
+ builtIn: true,
1668
+ inputs: [
1669
+ {
1670
+ name: "url",
1671
+ type: "url",
1672
+ required: true,
1673
+ defaultValue: "",
1674
+ helperText: "e.g. enter a youtube url, google map, etc",
1675
+ onChange: markSerializable((options) => {
1676
+ const url = options.get("url");
1677
+ if (url) {
1678
+ options.set("content", "Loading...");
1679
+ const apiKey = "ae0e60e78201a3f2b0de4b";
1680
+ return fetch(`https://iframe.ly/api/iframely?url=${url}&api_key=${apiKey}`).then(
1681
+ (res) => res.json()
1682
+ ).then((data) => {
1683
+ if (options.get("url") === url) {
1684
+ if (data.html)
1685
+ options.set("content", data.html);
1686
+ else
1687
+ options.set("content", "Invalid url, please try another");
1688
+ }
1689
+ }).catch((_err) => {
1690
+ options.set("content", "There was an error embedding this URL, please try again or another URL");
1691
+ });
1692
+ } else
1693
+ options.delete("content");
1694
+ })
1695
+ },
1696
+ {
1697
+ name: "content",
1698
+ type: "html",
1699
+ defaultValue: '<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',
1700
+ hideFromUI: true
1701
+ }
1702
+ ]
1703
+ };
1704
+ const SCRIPT_MIME_TYPES = [
1705
+ "text/javascript",
1706
+ "application/javascript",
1707
+ "application/ecmascript"
1708
+ ];
1709
+ const isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
1710
+ const findAndRunScripts = function findAndRunScripts2(props, state, elem) {
1711
+ const scripts = elem.getElementsByTagName("script");
1712
+ for (let i = 0; i < scripts.length; i++) {
1713
+ const script = scripts[i];
1714
+ if (script.src && !state.scriptsInserted.includes(script.src)) {
1715
+ state.scriptsInserted.push(script.src);
1716
+ const newScript = document.createElement("script");
1717
+ newScript.async = true;
1718
+ newScript.src = script.src;
1719
+ document.head.appendChild(newScript);
1720
+ } else if (isJsScript(script) && !state.scriptsRun.includes(script.innerText))
1721
+ try {
1722
+ state.scriptsRun.push(script.innerText);
1723
+ new Function(script.innerText)();
1724
+ } catch (error) {
1725
+ console.warn("`Embed`: Error running script:", error);
1726
+ }
1727
+ }
1728
+ };
1729
+ const Embed = /* @__PURE__ */ qwik.componentQrl(qwik.inlinedQrl((props) => {
1730
+ const elem = qwik.useRef();
1731
+ const state = qwik.useStore({
1732
+ scriptsInserted: [],
1733
+ scriptsRun: [],
1734
+ ranInitFn: false
1735
+ });
1736
+ qwik.useWatchQrl(qwik.inlinedQrl(({ track: track2 }) => {
1737
+ const [elem2, props2, state2] = qwik.useLexicalScope();
1738
+ state2 && track2(state2, "ranInitFn");
1739
+ if (elem2 && !state2.ranInitFn) {
1740
+ state2.ranInitFn = true;
1741
+ findAndRunScripts(props2, state2, elem2);
1742
+ }
1743
+ }, "Embed_component_useWatch_XE41s3iNuto", [
1744
+ elem,
1745
+ props,
1746
+ state
1747
+ ]));
1748
+ return /* @__PURE__ */ jsxRuntime.jsx(qwik.Host, {
1749
+ class: "builder-embed",
1750
+ ref: elem,
1751
+ dangerouslySetInnerHTML: props.content
1752
+ });
1753
+ }, "Embed_component_CP6B8Y76ylw"), {
1754
+ tagName: "div"
1755
+ });
1756
+ const embed = Embed;
1757
+ var __defProp$3 = Object.defineProperty;
1758
+ var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;
1759
+ var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
1760
+ var __propIsEnum$3 = Object.prototype.propertyIsEnumerable;
1761
+ var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, {
1762
+ enumerable: true,
1763
+ configurable: true,
1764
+ writable: true,
1765
+ value
1766
+ }) : obj[key] = value;
1767
+ var __spreadValues$3 = (a, b) => {
1768
+ for (var prop in b || (b = {}))
1769
+ if (__hasOwnProp$3.call(b, prop))
1770
+ __defNormalProp$3(a, prop, b[prop]);
1771
+ if (__getOwnPropSymbols$3) {
1772
+ for (var prop of __getOwnPropSymbols$3(b))
1773
+ if (__propIsEnum$3.call(b, prop))
1774
+ __defNormalProp$3(a, prop, b[prop]);
1775
+ }
1776
+ return a;
1777
+ };
1778
+ const getDefaultRegisteredComponents = () => [
1779
+ __spreadValues$3({
1780
+ component: Columns$1
1781
+ }, componentInfo$7),
1782
+ __spreadValues$3({
1783
+ component: Image$1
1784
+ }, componentInfo$5),
1785
+ __spreadValues$3({
1786
+ component: Text$1
1787
+ }, componentInfo$2),
1788
+ __spreadValues$3({
1789
+ component: Video$1
1790
+ }, componentInfo$1),
1791
+ __spreadValues$3({
1792
+ component: Symbol$2
1793
+ }, componentInfo$3),
1794
+ __spreadValues$3({
1795
+ component: Button$1
1796
+ }, componentInfo$8),
1797
+ __spreadValues$3({
1798
+ component: Section
1799
+ }, componentInfo$4),
1800
+ __spreadValues$3({
1801
+ component: Fragment
1802
+ }, componentInfo$6),
1803
+ __spreadValues$3({
1804
+ component: embed
1805
+ }, componentInfo2)
1806
+ ];
1807
+ var __defProp$2 = Object.defineProperty;
1808
+ var __defProps$2 = Object.defineProperties;
1809
+ var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
1810
+ var __getOwnPropSymbols$2 = Object.getOwnPropertySymbols;
1811
+ var __hasOwnProp$2 = Object.prototype.hasOwnProperty;
1812
+ var __propIsEnum$2 = Object.prototype.propertyIsEnumerable;
1813
+ var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, {
1814
+ enumerable: true,
1815
+ configurable: true,
1816
+ writable: true,
1817
+ value
1818
+ }) : obj[key] = value;
1819
+ var __spreadValues$2 = (a, b) => {
1820
+ for (var prop in b || (b = {}))
1821
+ if (__hasOwnProp$2.call(b, prop))
1822
+ __defNormalProp$2(a, prop, b[prop]);
1823
+ if (__getOwnPropSymbols$2) {
1824
+ for (var prop of __getOwnPropSymbols$2(b))
1825
+ if (__propIsEnum$2.call(b, prop))
1826
+ __defNormalProp$2(a, prop, b[prop]);
1827
+ }
1828
+ return a;
1829
+ };
1830
+ var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
1831
+ function flatten(object, path = null, separator = ".") {
1832
+ return Object.keys(object).reduce((acc, key) => {
1833
+ const value = object[key];
1834
+ const newPath = [
1835
+ path,
1836
+ key
1837
+ ].filter(Boolean).join(separator);
1838
+ const isObject = [
1839
+ typeof value === "object",
1840
+ value !== null,
1841
+ !(Array.isArray(value) && value.length === 0)
1842
+ ].every(Boolean);
1843
+ return isObject ? __spreadValues$2(__spreadValues$2({}, acc), flatten(value, newPath, separator)) : __spreadProps$2(__spreadValues$2({}, acc), {
1844
+ [newPath]: value
1845
+ });
1846
+ }, {});
1847
+ }
1848
+ const BUILDER_SEARCHPARAMS_PREFIX = "builder.";
1849
+ const convertSearchParamsToQueryObject = (searchParams) => {
1850
+ const options = {};
1851
+ searchParams.forEach((value, key) => {
1852
+ options[key] = value;
1853
+ });
1854
+ return options;
1855
+ };
1856
+ const getBuilderSearchParams = (options) => {
1857
+ const newOptions = {};
1858
+ Object.keys(options).forEach((key) => {
1859
+ if (key.startsWith(BUILDER_SEARCHPARAMS_PREFIX)) {
1860
+ const trimmedKey = key.replace(BUILDER_SEARCHPARAMS_PREFIX, "");
1861
+ newOptions[trimmedKey] = options[key];
1862
+ }
1863
+ });
1864
+ return newOptions;
1865
+ };
1866
+ const getBuilderSearchParamsFromWindow = () => {
1867
+ if (!isBrowser())
1868
+ return {};
1869
+ const searchParams = new URLSearchParams(window.location.search);
1870
+ return getBuilderSearchParams(convertSearchParamsToQueryObject(searchParams));
1871
+ };
1872
+ const normalizeSearchParams = (searchParams) => searchParams instanceof URLSearchParams ? convertSearchParamsToQueryObject(searchParams) : searchParams;
1873
+ function getGlobalThis() {
1874
+ if (typeof globalThis !== "undefined")
1875
+ return globalThis;
1876
+ if (typeof window !== "undefined")
1877
+ return window;
1878
+ if (typeof global !== "undefined")
1879
+ return global;
1880
+ if (typeof self !== "undefined")
1881
+ return self;
1882
+ return null;
1883
+ }
1884
+ var __async$1 = (__this, __arguments, generator) => {
1885
+ return new Promise((resolve, reject) => {
1886
+ var fulfilled = (value) => {
1887
+ try {
1888
+ step(generator.next(value));
1889
+ } catch (e) {
1890
+ reject(e);
1891
+ }
1892
+ };
1893
+ var rejected = (value) => {
1894
+ try {
1895
+ step(generator.throw(value));
1896
+ } catch (e) {
1897
+ reject(e);
1898
+ }
1899
+ };
1900
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
1901
+ step((generator = generator.apply(__this, __arguments)).next());
1902
+ });
1903
+ };
1904
+ function getFetch() {
1905
+ return __async$1(this, null, function* () {
1906
+ const globalFetch = getGlobalThis().fetch;
1907
+ if (typeof globalFetch === "undefined" && typeof global !== "undefined") {
1908
+ const nodeFetch = Promise.resolve().then(() => require("./index.d8c1e37f.cjs")).then(
1909
+ (d) => d.default
1910
+ );
1911
+ return nodeFetch.default || nodeFetch;
1912
+ }
1913
+ return globalFetch.default || globalFetch;
1914
+ });
1915
+ }
1916
+ const handleABTesting = (item, testGroups) => {
1917
+ if (item.variations && Object.keys(item.variations).length) {
1918
+ const testGroup = item.id ? testGroups[item.id] : void 0;
1919
+ const variationValue = testGroup ? item.variations[testGroup] : void 0;
1920
+ if (testGroup && variationValue) {
1921
+ item.data = variationValue.data;
1922
+ item.testVariationId = variationValue.id;
1923
+ item.testVariationName = variationValue.name;
1924
+ } else {
1925
+ let n = 0;
1926
+ const random = Math.random();
1927
+ let set2 = false;
1928
+ for (const id in item.variations) {
1929
+ const variation = item.variations[id];
1930
+ const testRatio = variation.testRatio;
1931
+ n += testRatio;
1932
+ if (random < n) {
1933
+ const variationName = variation.name || (variation.id === item.id ? "Default variation" : "");
1934
+ set2 = true;
1935
+ Object.assign(item, {
1936
+ data: variation.data,
1937
+ testVariationId: variation.id,
1938
+ testVariationName: variationName
1939
+ });
1940
+ }
1941
+ }
1942
+ if (!set2)
1943
+ Object.assign(item, {
1944
+ testVariationId: item.id,
1945
+ testVariationName: "Default"
1946
+ });
1947
+ }
1948
+ }
1949
+ };
1950
+ var __defProp$1 = Object.defineProperty;
1951
+ var __defProps$1 = Object.defineProperties;
1952
+ var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
1953
+ var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
1954
+ var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
1955
+ var __propIsEnum$1 = Object.prototype.propertyIsEnumerable;
1956
+ var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, {
1957
+ enumerable: true,
1958
+ configurable: true,
1959
+ writable: true,
1960
+ value
1961
+ }) : obj[key] = value;
1962
+ var __spreadValues$1 = (a, b) => {
1963
+ for (var prop in b || (b = {}))
1964
+ if (__hasOwnProp$1.call(b, prop))
1965
+ __defNormalProp$1(a, prop, b[prop]);
1966
+ if (__getOwnPropSymbols$1) {
1967
+ for (var prop of __getOwnPropSymbols$1(b))
1968
+ if (__propIsEnum$1.call(b, prop))
1969
+ __defNormalProp$1(a, prop, b[prop]);
1970
+ }
1971
+ return a;
1972
+ };
1973
+ var __spreadProps$1 = (a, b) => __defProps$1(a, __getOwnPropDescs$1(b));
1974
+ var __async = (__this, __arguments, generator) => {
1975
+ return new Promise((resolve, reject) => {
1976
+ var fulfilled = (value) => {
1977
+ try {
1978
+ step(generator.next(value));
1979
+ } catch (e) {
1980
+ reject(e);
1981
+ }
1982
+ };
1983
+ var rejected = (value) => {
1984
+ try {
1985
+ step(generator.throw(value));
1986
+ } catch (e) {
1987
+ reject(e);
1988
+ }
1989
+ };
1990
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
1991
+ step((generator = generator.apply(__this, __arguments)).next());
1992
+ });
1993
+ };
1994
+ const fetch$ = getFetch();
1995
+ function getContent(options) {
1996
+ return __async(this, null, function* () {
1997
+ return (yield getAllContent(__spreadProps$1(__spreadValues$1({}, options), {
1998
+ limit: 1
1999
+ }))).results[0] || null;
2000
+ });
2001
+ }
2002
+ const generateContentUrl = (options) => {
2003
+ const { limit = 1, userAttributes, query, noTraverse = false, model, apiKey } = options;
2004
+ const url = new URL(`https://cdn.builder.io/api/v2/content/${model}?apiKey=${apiKey}&limit=${limit}&noTraverse=${noTraverse}`);
2005
+ const queryOptions = __spreadValues$1(__spreadValues$1({}, getBuilderSearchParamsFromWindow()), normalizeSearchParams(options.options || {}));
2006
+ const flattened = flatten(queryOptions);
2007
+ for (const key in flattened)
2008
+ url.searchParams.set(key, String(flattened[key]));
2009
+ if (userAttributes)
2010
+ url.searchParams.set("userAttributes", JSON.stringify(userAttributes));
2011
+ if (query) {
2012
+ const flattened2 = flatten({
2013
+ query
2014
+ });
2015
+ for (const key in flattened2)
2016
+ url.searchParams.set(key, JSON.stringify(flattened2[key]));
2017
+ }
2018
+ return url;
2019
+ };
2020
+ function getAllContent(options) {
2021
+ return __async(this, null, function* () {
2022
+ const url = generateContentUrl(options);
2023
+ const fetch2 = yield fetch$;
2024
+ const content = yield fetch2(url.href).then(
2025
+ (res) => res.json()
2026
+ );
2027
+ if (options.testGroups)
2028
+ for (const item of content.results)
2029
+ handleABTesting(item, options.testGroups);
2030
+ return content;
2031
+ });
2032
+ }
2033
+ function isPreviewing() {
2034
+ if (!isBrowser())
2035
+ return false;
2036
+ if (isEditing())
2037
+ return false;
2038
+ return Boolean(location.search.indexOf("builder.preview=") !== -1);
2039
+ }
2040
+ var __defProp = Object.defineProperty;
2041
+ var __defProps = Object.defineProperties;
2042
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
2043
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
2044
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
2045
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
2046
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {
2047
+ enumerable: true,
2048
+ configurable: true,
2049
+ writable: true,
2050
+ value
2051
+ }) : obj[key] = value;
2052
+ var __spreadValues = (a, b) => {
2053
+ for (var prop in b || (b = {}))
2054
+ if (__hasOwnProp.call(b, prop))
2055
+ __defNormalProp(a, prop, b[prop]);
2056
+ if (__getOwnPropSymbols) {
2057
+ for (var prop of __getOwnPropSymbols(b))
2058
+ if (__propIsEnum.call(b, prop))
2059
+ __defNormalProp(a, prop, b[prop]);
2060
+ }
2061
+ return a;
2062
+ };
2063
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
2064
+ var __objRest = (source, exclude) => {
2065
+ var target = {};
2066
+ for (var prop in source)
2067
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
2068
+ target[prop] = source[prop];
2069
+ if (source != null && __getOwnPropSymbols) {
2070
+ for (var prop of __getOwnPropSymbols(source))
2071
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
2072
+ target[prop] = source[prop];
2073
+ }
2074
+ return target;
2075
+ };
2076
+ const components = [];
2077
+ function registerComponent(component3, info) {
2078
+ components.push(__spreadValues({
2079
+ component: component3
2080
+ }, info));
2081
+ console.warn("registerComponent is deprecated. Use the `customComponents` prop in RenderContent instead to provide your custom components to the builder SDK.");
2082
+ return component3;
2083
+ }
2084
+ const createRegisterComponentMessage = (_a) => {
2085
+ var info = __objRest(_a, [
2086
+ "component"
2087
+ ]);
2088
+ return {
2089
+ type: "builder.registerComponent",
2090
+ data: prepareComponentInfoToSend(info)
2091
+ };
2092
+ };
2093
+ const fastClone = (obj) => JSON.parse(JSON.stringify(obj));
2094
+ const serializeValue = (value) => typeof value === "function" ? serializeFn(value) : fastClone(value);
2095
+ const serializeFn = (fnValue) => {
2096
+ const fnStr = fnValue.toString().trim();
2097
+ const appendFunction = !fnStr.startsWith("function") && !fnStr.startsWith("(");
2098
+ return `return (${appendFunction ? "function " : ""}${fnStr}).apply(this, arguments)`;
2099
+ };
2100
+ const prepareComponentInfoToSend = (_c) => {
2101
+ var { inputs } = _c, info = __objRest(_c, [
2102
+ "inputs"
2103
+ ]);
2104
+ return __spreadProps(__spreadValues({}, fastClone(info)), {
2105
+ inputs: inputs == null ? void 0 : inputs.map(
2106
+ (input) => Object.entries(input).reduce(
2107
+ (acc, [key, value]) => __spreadProps(__spreadValues({}, acc), {
2108
+ [key]: serializeValue(value)
2109
+ }),
2110
+ {}
2111
+ )
2112
+ )
2113
+ });
2114
+ };
2115
+ function track(event, properties) {
2116
+ if (isEditing())
2117
+ return;
2118
+ if (!(isBrowser() || TARGET === "reactNative"))
2119
+ return;
2120
+ return fetch(`https://builder.io/api/v1/track`, {
2121
+ method: "POST",
2122
+ body: JSON.stringify({
2123
+ events: [
2124
+ {
2125
+ type: event,
2126
+ data: properties
2127
+ }
2128
+ ]
2129
+ }),
2130
+ headers: {
2131
+ "content-type": "application/json"
2132
+ },
2133
+ mode: "cors"
2134
+ });
2135
+ }
2136
+ const getCssFromFont = function getCssFromFont2(props, state, font) {
2137
+ const family = font.family + (font.kind && !font.kind.includes("#") ? ", " + font.kind : "");
2138
+ const name = family.split(",")[0];
2139
+ const url = font.fileUrl ?? font?.files?.regular;
2140
+ let str = "";
2141
+ if (url && family && name)
2142
+ str += `
2143
+ @font-face {
2144
+ font-family: "${family}";
2145
+ src: local("${name}"), url('${url}') format('woff2');
2146
+ font-display: fallback;
2147
+ font-weight: 400;
2148
+ }
2149
+ `.trim();
2150
+ if (font.files)
2151
+ for (const weight in font.files) {
2152
+ const isNumber = String(Number(weight)) === weight;
2153
+ if (!isNumber)
2154
+ continue;
2155
+ const weightUrl = font.files[weight];
2156
+ if (weightUrl && weightUrl !== url)
2157
+ str += `
2158
+ @font-face {
2159
+ font-family: "${family}";
2160
+ src: url('${weightUrl}') format('woff2');
2161
+ font-display: fallback;
2162
+ font-weight: ${weight};
2163
+ }
2164
+ `.trim();
2165
+ }
2166
+ return str;
2167
+ };
2168
+ const getFontCss = function getFontCss2(props, state, { customFonts }) {
2169
+ return customFonts?.map(
2170
+ (font) => getCssFromFont(props, state, font)
2171
+ )?.join(" ") || "";
2172
+ };
2173
+ const injectedStyles = function injectedStyles2(props, state) {
2174
+ return `
2175
+ ${props.cssCode || ""}
2176
+ ${getFontCss(props, state, {
2177
+ customFonts: props.customFonts
2178
+ })}`;
2179
+ };
2180
+ const RenderContentStyles = /* @__PURE__ */ qwik.componentQrl(qwik.inlinedQrl((props) => {
2181
+ const state = {};
2182
+ return /* @__PURE__ */ jsxRuntime.jsx(RenderInlinedStyles$1, {
2183
+ styles: injectedStyles(props, state)
2184
+ });
2185
+ }, "RenderContentStyles_component_32XAr483K2o"));
2186
+ const RenderContentStyles$1 = RenderContentStyles;
2187
+ const useContent = function useContent2(props, state) {
2188
+ const mergedContent = {
2189
+ ...props.content,
2190
+ ...state.overrideContent,
2191
+ data: {
2192
+ ...props.content?.data,
2193
+ ...props.data,
2194
+ ...state.overrideContent?.data
2195
+ }
2196
+ };
2197
+ return mergedContent;
2198
+ };
2199
+ const contentState = function contentState2(props, state) {
2200
+ return {
2201
+ ...props.content?.data?.state,
2202
+ ...props.data,
2203
+ ...state.overrideState
2204
+ };
2205
+ };
2206
+ const contextContext = function contextContext2(props, state) {
2207
+ return props.context || {};
2208
+ };
2209
+ const allRegisteredComponents = function allRegisteredComponents2(props, state) {
2210
+ const allComponentsArray = [
2211
+ ...getDefaultRegisteredComponents(),
2212
+ ...components,
2213
+ ...props.customComponents || []
2214
+ ];
2215
+ const allComponents = allComponentsArray.reduce(
2216
+ (acc, curr) => ({
2217
+ ...acc,
2218
+ [curr.name]: curr
2219
+ }),
2220
+ {}
2221
+ );
2222
+ return allComponents;
2223
+ };
2224
+ const processMessage = function processMessage2(props, state, event) {
2225
+ const { data } = event;
2226
+ if (data)
2227
+ switch (data.type) {
2228
+ case "builder.contentUpdate": {
2229
+ const messageContent = data.data;
2230
+ const key = messageContent.key || messageContent.alias || messageContent.entry || messageContent.modelName;
2231
+ const contentData = messageContent.data;
2232
+ if (key === props.model)
2233
+ state.overrideContent = contentData;
2234
+ break;
2235
+ }
2236
+ }
2237
+ };
2238
+ const evaluateJsCode = function evaluateJsCode2(props, state) {
2239
+ const jsCode = useContent(props, state)?.data?.jsCode;
2240
+ if (jsCode)
2241
+ evaluate({
2242
+ code: jsCode,
2243
+ context: contextContext(props),
2244
+ state: contentState(props, state)
2245
+ });
2246
+ };
2247
+ const httpReqsData = function httpReqsData2(props, state) {
2248
+ return {};
2249
+ };
2250
+ const onClick2 = function onClick3(props, state, _event) {
2251
+ if (useContent(props, state) && props.canTrack !== false)
2252
+ track("click", {
2253
+ contentId: useContent(props, state).id
2254
+ });
2255
+ };
2256
+ const evalExpression = function evalExpression2(props, state, expression) {
2257
+ return expression.replace(
2258
+ /{{([^}]+)}}/g,
2259
+ (_match, group) => evaluate({
2260
+ code: group,
2261
+ context: contextContext(props),
2262
+ state: contentState(props, state)
2263
+ })
2264
+ );
2265
+ };
2266
+ const handleRequest = function handleRequest2(props, state, { url, key }) {
2267
+ const fetchAndSetState = async () => {
2268
+ const fetch2 = await getFetch();
2269
+ const response = await fetch2(url);
2270
+ const json = await response.json();
2271
+ const newOverrideState = {
2272
+ ...state.overrideState,
2273
+ [key]: json
2274
+ };
2275
+ state.overrideState = newOverrideState;
2276
+ };
2277
+ fetchAndSetState();
2278
+ };
2279
+ const runHttpRequests = function runHttpRequests2(props, state) {
2280
+ const requests = useContent(props, state)?.data?.httpRequests ?? {};
2281
+ Object.entries(requests).forEach(([key, url]) => {
2282
+ if (url && (!httpReqsData()[key] || isEditing())) {
2283
+ const evaluatedUrl = evalExpression(props, state, url);
2284
+ handleRequest(props, state, {
2285
+ url: evaluatedUrl,
2286
+ key
2287
+ });
2288
+ }
2289
+ });
2290
+ };
2291
+ const emitStateUpdate = function emitStateUpdate2(props, state) {
2292
+ if (isEditing())
2293
+ window.dispatchEvent(new CustomEvent("builder:component:stateChange", {
2294
+ detail: {
2295
+ state: contentState(props, state),
2296
+ ref: {
2297
+ name: props.model
2298
+ }
2299
+ }
2300
+ }));
2301
+ };
2302
+ const shouldRenderContentStyles = function shouldRenderContentStyles2(props, state) {
2303
+ return Boolean((useContent(props, state)?.data?.cssCode || useContent(props, state)?.data?.customFonts?.length) && TARGET !== "reactNative");
2304
+ };
2305
+ const RenderContent = /* @__PURE__ */ qwik.componentQrl(qwik.inlinedQrl((props) => {
2306
+ const hostElement = qwik.useHostElement();
2307
+ const state = qwik.useStore({
2308
+ forceReRenderCount: 0,
2309
+ overrideContent: null,
2310
+ update: 0,
2311
+ overrideState: {}
2312
+ });
2313
+ qwik.useContextProvider(stdin_default, qwik.useStore({
2314
+ content: (() => {
2315
+ return useContent(props, state);
2316
+ })(),
2317
+ state: (() => {
2318
+ return contentState(props, state);
2319
+ })(),
2320
+ context: (() => {
2321
+ return contextContext(props);
2322
+ })(),
2323
+ apiKey: (() => {
2324
+ return props.apiKey;
2325
+ })(),
2326
+ registeredComponents: (() => {
2327
+ return allRegisteredComponents(props);
2328
+ })()
2329
+ }));
2330
+ qwik.useClientEffectQrl(qwik.inlinedQrl(() => {
2331
+ const [hostElement2, props2, state2] = qwik.useLexicalScope();
2332
+ if (isBrowser()) {
2333
+ if (isEditing()) {
2334
+ state2.forceReRenderCount++;
2335
+ qwik._useMutableProps(hostElement2, true);
2336
+ registerInsertMenu();
2337
+ setupBrowserForEditing();
2338
+ Object.values(allRegisteredComponents(props2)).forEach((registeredComponent) => {
2339
+ const message = createRegisterComponentMessage(registeredComponent);
2340
+ window.parent?.postMessage(message, "*");
2341
+ });
2342
+ window.addEventListener("message", processMessage.bind(null, props2, state2));
2343
+ window.addEventListener("builder:component:stateChangeListenerActivated", emitStateUpdate.bind(null, props2, state2));
2344
+ }
2345
+ if (useContent(props2, state2) && props2.canTrack !== false)
2346
+ track("impression", {
2347
+ contentId: useContent(props2, state2).id
2348
+ });
2349
+ if (isPreviewing()) {
2350
+ const searchParams = new URL(location.href).searchParams;
2351
+ if (props2.model && searchParams.get("builder.preview") === props2.model) {
2352
+ const previewApiKey = searchParams.get("apiKey") || searchParams.get("builder.space");
2353
+ if (previewApiKey)
2354
+ getContent({
2355
+ model: props2.model,
2356
+ apiKey: previewApiKey
2357
+ }).then((content) => {
2358
+ if (content)
2359
+ state2.overrideContent = content;
2360
+ });
2361
+ }
2362
+ }
2363
+ evaluateJsCode(props2, state2);
2364
+ runHttpRequests(props2, state2);
2365
+ emitStateUpdate(props2, state2);
2366
+ }
2367
+ }, "RenderContent_component_useClientEffect_ntruwSC9lSo", [
2368
+ hostElement,
2369
+ props,
2370
+ state
2371
+ ]));
2372
+ qwik.useWatchQrl(qwik.inlinedQrl(({ track: track1 }) => {
2373
+ const [props2, state2] = qwik.useLexicalScope();
2374
+ state2.useContent?.data && track1(state2.useContent?.data, "jsCode");
2375
+ evaluateJsCode(props2, state2);
2376
+ }, "RenderContent_component_useWatch_1P0ujLQOmzc", [
2377
+ props,
2378
+ state
2379
+ ]));
2380
+ qwik.useWatchQrl(qwik.inlinedQrl(({ track: track2 }) => {
2381
+ const [props2, state2] = qwik.useLexicalScope();
2382
+ state2.useContent?.data && track2(state2.useContent?.data, "httpRequests");
2383
+ runHttpRequests(props2, state2);
2384
+ }, "RenderContent_component_useWatch_1_0hAcn4V2AZw", [
2385
+ props,
2386
+ state
2387
+ ]));
2388
+ qwik.useWatchQrl(qwik.inlinedQrl(({ track: track3 }) => {
2389
+ const [props2, state2] = qwik.useLexicalScope();
2390
+ state2 && track3(state2, "contentState");
2391
+ emitStateUpdate(props2, state2);
2392
+ }, "RenderContent_component_useWatch_2_t2n8zpl4mRs", [
2393
+ props,
2394
+ state
2395
+ ]));
2396
+ qwik.useCleanupQrl(qwik.inlinedQrl(() => {
2397
+ const [props2, state2] = qwik.useLexicalScope();
2398
+ if (isBrowser()) {
2399
+ window.removeEventListener("message", processMessage.bind(null, props2, state2));
2400
+ window.removeEventListener("builder:component:stateChangeListenerActivated", emitStateUpdate.bind(null, props2, state2));
2401
+ }
2402
+ }, "RenderContent_component_useCleanup_sGf1npb03WA", [
2403
+ props,
2404
+ state
2405
+ ]));
2406
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {
2407
+ children: useContent(props, state) ? /* @__PURE__ */ jsxRuntime.jsxs("div", {
2408
+ onClick$: qwik.inlinedQrl((event) => {
2409
+ const [props2, state2] = qwik.useLexicalScope();
2410
+ return onClick2(props2, state2);
2411
+ }, "RenderContent_component__Fragment_div_onClick_76e3rL00UYE", [
2412
+ props,
2413
+ state
2414
+ ]),
2415
+ "builder-content-id": useContent(props, state)?.id,
2416
+ children: [
2417
+ shouldRenderContentStyles(props, state) ? /* @__PURE__ */ jsxRuntime.jsx(RenderContentStyles$1, {
2418
+ cssCode: useContent(props, state)?.data?.cssCode,
2419
+ customFonts: useContent(props, state)?.data?.customFonts
2420
+ }) : null,
2421
+ /* @__PURE__ */ jsxRuntime.jsx(RenderBlocks$1, {
2422
+ blocks: useContent(props, state)?.data?.blocks
2423
+ }, state.forceReRenderCount)
2424
+ ]
2425
+ }) : null
2426
+ });
2427
+ }, "RenderContent_component_I00xF3zGD1I"));
2428
+ const RenderContent$1 = RenderContent;
2429
+ const Symbol$1 = /* @__PURE__ */ qwik.componentQrl(qwik.inlinedQrl((props) => {
2430
+ const builderContext = qwik.useContext(stdin_default);
2431
+ const state = qwik.useStore({
2432
+ className: "builder-symbol",
2433
+ content: null
2434
+ });
2435
+ qwik.useClientEffectQrl(qwik.inlinedQrl(() => {
2436
+ const [props2, state2] = qwik.useLexicalScope();
2437
+ state2.content = props2.symbol?.content;
2438
+ }, "Symbol_component_useClientEffect_nexfMR52XGY", [
2439
+ props,
2440
+ state
2441
+ ]));
2442
+ qwik.useWatchQrl(qwik.inlinedQrl(({ track: track2 }) => {
2443
+ const [builderContext2, props2, state2] = qwik.useLexicalScope();
2444
+ props2.symbol && track2(props2.symbol, "content");
2445
+ props2.symbol && track2(props2.symbol, "model");
2446
+ props2.symbol && track2(props2.symbol, "entry");
2447
+ state2 && track2(state2, "content");
2448
+ const symbolToUse = props2.symbol;
2449
+ if (symbolToUse && !symbolToUse.content && !state2.content && symbolToUse.model)
2450
+ getContent({
2451
+ model: symbolToUse.model,
2452
+ apiKey: builderContext2.apiKey,
2453
+ query: {
2454
+ id: symbolToUse.entry
2455
+ }
2456
+ }).then((response) => {
2457
+ state2.content = response;
2458
+ });
2459
+ }, "Symbol_component_useWatch_cKXWtr2eEjY", [
2460
+ builderContext,
2461
+ props,
2462
+ state
2463
+ ]));
2464
+ return /* @__PURE__ */ jsxRuntime.jsx(qwik.Host, {
2465
+ ...props.attributes,
2466
+ dataSet: {
2467
+ class: state.className
2468
+ },
2469
+ class: state.className,
2470
+ children: /* @__PURE__ */ jsxRuntime.jsx(RenderContent$1, {
2471
+ apiKey: builderContext.apiKey,
2472
+ context: builderContext.context,
2473
+ customComponents: Object.values(builderContext.registeredComponents),
2474
+ data: {
2475
+ ...props.symbol?.data,
2476
+ ...builderContext.state,
2477
+ ...props.symbol?.content?.data?.state
2478
+ },
2479
+ model: props.symbol?.model,
2480
+ content: state.content
2481
+ })
2482
+ });
2483
+ }, "Symbol_component_Dn8mGpai87I"), {
2484
+ tagName: "div"
2485
+ });
2486
+ const Symbol$2 = Symbol$1;
2487
+ const settings = {};
2488
+ function setEditorSettings(newSettings) {
2489
+ if (isBrowser()) {
2490
+ Object.assign(settings, newSettings);
2491
+ const message = {
2492
+ type: "builder.settingsChange",
2493
+ data: settings
2494
+ };
2495
+ parent.postMessage(message, "*");
2496
+ }
2497
+ }
2498
+ exports.Button = Button$1;
2499
+ exports.Columns = Columns$1;
2500
+ exports.Fragment = Fragment;
2501
+ exports.Image = Image$1;
2502
+ exports.RenderBlocks = RenderBlocks$1;
2503
+ exports.RenderContent = RenderContent$1;
2504
+ exports.Section = Section;
2505
+ exports.Symbol = Symbol$2;
2506
+ exports.Text = Text$1;
2507
+ exports.Video = Video$1;
2508
+ exports.components = components;
2509
+ exports.convertSearchParamsToQueryObject = convertSearchParamsToQueryObject;
2510
+ exports.createRegisterComponentMessage = createRegisterComponentMessage;
2511
+ exports.generateContentUrl = generateContentUrl;
2512
+ exports.getAllContent = getAllContent;
2513
+ exports.getBuilderSearchParams = getBuilderSearchParams;
2514
+ exports.getBuilderSearchParamsFromWindow = getBuilderSearchParamsFromWindow;
2515
+ exports.getContent = getContent;
2516
+ exports.isEditing = isEditing;
2517
+ exports.isPreviewing = isPreviewing;
2518
+ exports.normalizeSearchParams = normalizeSearchParams;
2519
+ exports.register = register;
2520
+ exports.registerComponent = registerComponent;
2521
+ exports.setEditorSettings = setEditorSettings;