@builder.io/sdk-vue 0.4.2 → 0.4.4
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/package.json +1 -1
- package/packages/_vue2/dist/{block-styles.cacb4849.cjs → block-styles.0037defd.cjs} +1 -1
- package/packages/_vue2/dist/{block-styles.6a1d7394.js → block-styles.bc8cdc9f.js} +4 -4
- package/packages/_vue2/dist/{css.49cc4003.js → css.5dc54b85.js} +2 -2
- package/packages/{_vue3/dist/css.627e21ae.cjs → _vue2/dist/css.91bb94e8.cjs} +1 -1
- package/packages/_vue2/dist/{evaluate.7d21bb04.cjs → evaluate.10e091b0.cjs} +1 -1
- package/packages/_vue2/dist/{evaluate.6ab6e7cb.js → evaluate.f654f563.js} +1 -1
- package/packages/_vue2/dist/{index.2473a355.js → index.a1dfdaec.js} +103 -103
- package/packages/_vue2/dist/{index.95d9006f.cjs → index.a4e21f82.cjs} +6 -6
- package/packages/_vue2/dist/render-block.55b40822.cjs +3 -0
- package/packages/_vue2/dist/{render-block.22052bd8.js → render-block.df744a97.js} +6 -6
- package/packages/_vue2/dist/{render-component.ec485884.js → render-component.9632b476.js} +3 -3
- package/packages/_vue2/dist/{render-component.f3cccaa9.cjs → render-component.baf2d372.cjs} +1 -1
- package/packages/_vue2/dist/{render-content.a6b17a6c.js → render-content.30c701ec.js} +5 -5
- package/packages/_vue2/dist/{render-content.d53085e5.cjs → render-content.d464cccb.cjs} +1 -1
- package/packages/_vue2/dist/{render-inlined-styles.2286ef7c.js → render-inlined-styles.36b7a3a4.js} +1 -1
- package/packages/_vue2/dist/{render-inlined-styles.b322c74a.cjs → render-inlined-styles.469ed053.cjs} +1 -1
- package/packages/_vue2/dist/{render-repeated-block.ac4f1559.js → render-repeated-block.7f4862b2.js} +2 -2
- package/packages/_vue2/dist/{render-repeated-block.253c96e6.cjs → render-repeated-block.e9bfa3cd.cjs} +1 -1
- package/packages/_vue2/dist/{render-styles.a148b748.js → render-styles.43e1e2a4.js} +2 -2
- package/packages/_vue2/dist/{render-styles.0cb949b0.cjs → render-styles.ad11935f.cjs} +2 -2
- package/packages/_vue2/dist/sdk.cjs +1 -1
- package/packages/_vue2/dist/sdk.js +1 -1
- package/packages/_vue2/dist/src/components/render-block/render-repeated-block.vue.d.ts +0 -9
- package/packages/_vue2/dist/src/constants/sdk-version.d.ts +1 -1
- package/packages/_vue3/dist/sdk.cjs +72 -1
- package/packages/_vue3/dist/sdk.js +3251 -22
- package/packages/_vue3/dist/src/components/render-block/render-repeated-block.vue.d.ts +0 -9
- package/packages/_vue3/dist/src/constants/sdk-version.d.ts +1 -1
- package/packages/_vue3/dist/style.css +1 -1
- package/packages/_vue2/dist/css.c26b7ab4.cjs +0 -6
- package/packages/_vue2/dist/render-block.9342f7b5.cjs +0 -3
- package/packages/_vue3/dist/block-styles.5b949efb.cjs +0 -1
- package/packages/_vue3/dist/block-styles.e91165b8.js +0 -72
- package/packages/_vue3/dist/css.41ed2294.js +0 -75
- package/packages/_vue3/dist/evaluate.0662f166.js +0 -63
- package/packages/_vue3/dist/evaluate.da45a33b.cjs +0 -4
- package/packages/_vue3/dist/index.3a561c6a.js +0 -1394
- package/packages/_vue3/dist/index.3e17c057.cjs +0 -32
- package/packages/_vue3/dist/render-block.20c07cb1.cjs +0 -3
- package/packages/_vue3/dist/render-block.e9a2cb71.js +0 -273
- package/packages/_vue3/dist/render-component.20ef18f7.cjs +0 -1
- package/packages/_vue3/dist/render-component.afa60a7b.js +0 -42
- package/packages/_vue3/dist/render-content.20bd0f8d.js +0 -1354
- package/packages/_vue3/dist/render-content.e790eee5.cjs +0 -1
- package/packages/_vue3/dist/render-inlined-styles.0444f4fe.js +0 -16
- package/packages/_vue3/dist/render-inlined-styles.14d9ba36.cjs +0 -1
- package/packages/_vue3/dist/render-repeated-block.5a245883.js +0 -32
- package/packages/_vue3/dist/render-repeated-block.75230844.cjs +0 -1
- package/packages/_vue3/dist/render-styles.73c7ba5a.js +0 -80
- package/packages/_vue3/dist/render-styles.bd7475f8.cjs +0 -31
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("vue"),s=require("./index.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("vue"),s=require("./index.a4e21f82.cjs"),r=require("./css.91bb94e8.cjs");require("./evaluate.10e091b0.cjs");const S=()=>Promise.resolve().then(()=>require("./render-inlined-styles.469ed053.cjs")).then(e=>e.default).catch(e=>{throw console.error("Error while attempting to dynamically import component RenderInlinedStyles at ../render-inlined-styles.vue",e),e}),y=h.defineComponent({name:"block-styles",components:{RenderInlinedStyles:S},props:["block","context"],data(){return{TARGET:s.TARGET}},computed:{useBlock(){return r.getProcessedBlock({block:this.block,localState:this.context.localState,rootState:this.context.rootState,rootSetState:this.context.rootSetState,context:this.context.context,shouldEvaluateBindings:!0})},canShowBlock(){return s.checkIsDefined(this.useBlock.hide)?!this.useBlock.hide:s.checkIsDefined(this.useBlock.show)?this.useBlock.show:!0},css(){var a;const e=this.useBlock.responsiveStyles,t=this.context.content,o=s.getSizesForBreakpoints(((a=t==null?void 0:t.meta)==null?void 0:a.breakpoints)||{}),l=e==null?void 0:e.large,c=e==null?void 0:e.medium,i=e==null?void 0:e.small,n=this.useBlock.id;if(!n)return"";const u=l?r.createCssClass({className:n,styles:l}):"",d=c?r.createCssClass({className:n,styles:c,mediaQuery:s.getMaxWidthQueryForSize("medium",o)}):"",m=i?r.createCssClass({className:n,styles:i,mediaQuery:s.getMaxWidthQueryForSize("small",o)}):"";return[u,d,m].join(" ")}}});var k=function(){var t=this,o=t._self._c;return t._self._setupProxy,t.TARGET!=="reactNative"&&t.css&&t.canShowBlock?o("render-inlined-styles",{attrs:{styles:t.css}}):t._e()},p=[],f=s.normalizeComponent(y,k,p,!1,null,null,null,null);const _=f.exports;exports.default=_;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineComponent as p } from "vue";
|
|
2
|
-
import { T as S, c as i, g as k, a as m, n as y } from "./index.
|
|
3
|
-
import { g as f, c as n } from "./css.
|
|
4
|
-
import "./evaluate.
|
|
5
|
-
const _ = () => import("./render-inlined-styles.
|
|
2
|
+
import { T as S, c as i, g as k, a as m, n as y } from "./index.a1dfdaec.js";
|
|
3
|
+
import { g as f, c as n } from "./css.5dc54b85.js";
|
|
4
|
+
import "./evaluate.f654f563.js";
|
|
5
|
+
const _ = () => import("./render-inlined-styles.36b7a3a4.js").then((t) => t.default).catch((t) => {
|
|
6
6
|
throw console.error(
|
|
7
7
|
"Error while attempting to dynamically import component RenderInlinedStyles at ../render-inlined-styles.vue",
|
|
8
8
|
t
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { e as u } from "./evaluate.
|
|
2
|
-
import { f as p, c as l } from "./index.
|
|
1
|
+
import { e as u } from "./evaluate.f654f563.js";
|
|
2
|
+
import { f as p, c as l } from "./index.a1dfdaec.js";
|
|
3
3
|
const g = (e, t, n) => {
|
|
4
4
|
if (Object(e) !== e)
|
|
5
5
|
return e;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const d=require("./evaluate.10e091b0.cjs"),a=require("./index.a4e21f82.cjs"),p=(e,t,n)=>{if(Object(e)!==e)return e;const s=Array.isArray(t)?t:t.toString().match(/[^.[\]]+/g);return s.slice(0,-1).reduce((c,r,o)=>Object(c[r])===c[r]?c[r]:c[r]=Math.abs(Number(s[o+1]))>>0===+s[o+1]?[]:{},e)[s[s.length-1]]=n,e};const g=({block:e,context:t,localState:n,rootState:s,rootSetState:c})=>{if(!e.bindings)return e;const r=a.fastClone(e),o={...r,properties:{...r.properties},actions:{...r.actions}};for(const i in e.bindings){const l=e.bindings[i],f=d.evaluate({code:l,localState:n,rootState:s,rootSetState:c,context:t});p(o,i,f)}return o};function C({block:e,context:t,shouldEvaluateBindings:n,localState:s,rootState:c,rootSetState:r}){const o=e;return n?g({block:o,localState:s,rootState:c,rootSetState:r,context:t}):o}const S=e=>e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase(),u=e=>Object.entries(e).map(([n,s])=>{if(typeof s=="string")return`${S(n)}: ${s};`}).filter(a.checkIsDefined),v=e=>u(e).join(`
|
|
2
2
|
`),y=({mediaQuery:e,className:t,styles:n})=>{const s=`.${t} {
|
|
3
3
|
${v(n)}
|
|
4
4
|
}`;return e?`${e} {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const t=require("./index.
|
|
1
|
+
"use strict";const t=require("./index.a4e21f82.cjs");function f({code:n,context:r,localState:i,rootState:s,rootSetState:e,event:u,isExpression:w=!0}){if(n===""){console.warn("Skipping evaluation of empty code block.");return}const c={isEditing:t.isEditing(),isBrowser:t.isBrowser(),isServer:!t.isBrowser()},l=w&&!(n.includes(";")||n.includes(" return ")||n.trim().startsWith("return "))?`return (${n});`:n;try{return new Function("builder","Builder","state","context","event",l)(c,c,o(s,i,e),r,u)}catch(d){console.warn(`Builder custom code error:
|
|
2
2
|
While Evaluating:
|
|
3
3
|
`,l,`
|
|
4
4
|
`,d)}}function o(n,r,i){if(n===r)throw new Error("rootState === localState");return new Proxy(n,{get:(s,e)=>r&&e in r?r[e]:n[e],set:(s,e,u)=>{if(r&&e in r)throw new Error("Writing to local state is not allowed as it is read-only.");return n[e]=u,i==null||i(n),!0}})}exports.evaluate=f;
|
|
@@ -71,7 +71,7 @@ var nt = function() {
|
|
|
71
71
|
null,
|
|
72
72
|
null
|
|
73
73
|
);
|
|
74
|
-
const
|
|
74
|
+
const He = ot.exports, A = (e) => JSON.parse(JSON.stringify(e)), M = {
|
|
75
75
|
small: {
|
|
76
76
|
min: 320,
|
|
77
77
|
default: 321,
|
|
@@ -87,7 +87,7 @@ const De = ot.exports, A = (e) => JSON.parse(JSON.stringify(e)), M = {
|
|
|
87
87
|
default: 991,
|
|
88
88
|
max: 1200
|
|
89
89
|
}
|
|
90
|
-
},
|
|
90
|
+
}, qe = (e, t = M) => `@media (max-width: ${t[e].max}px)`, st = ({ small: e, medium: t }) => {
|
|
91
91
|
const n = A(M);
|
|
92
92
|
if (!e || !t)
|
|
93
93
|
return n;
|
|
@@ -109,7 +109,7 @@ const De = ot.exports, A = (e) => JSON.parse(JSON.stringify(e)), M = {
|
|
|
109
109
|
min: s,
|
|
110
110
|
default: s + 1
|
|
111
111
|
}, n;
|
|
112
|
-
},
|
|
112
|
+
}, x = "vue2", it = Symbol(), E = {
|
|
113
113
|
Builder: {
|
|
114
114
|
content: null,
|
|
115
115
|
context: {},
|
|
@@ -128,7 +128,7 @@ const De = ot.exports, A = (e) => JSON.parse(JSON.stringify(e)), M = {
|
|
|
128
128
|
"Error while attempting to dynamically import component RenderBlocks at ../../components/render-blocks.vue",
|
|
129
129
|
e
|
|
130
130
|
), e;
|
|
131
|
-
}), ct = () => import("./render-inlined-styles.
|
|
131
|
+
}), ct = () => import("./render-inlined-styles.36b7a3a4.js").then((e) => e.default).catch((e) => {
|
|
132
132
|
throw console.error(
|
|
133
133
|
"Error while attempting to dynamically import component RenderInlinedStyles at ../../components/render-inlined-styles.vue",
|
|
134
134
|
e
|
|
@@ -152,7 +152,7 @@ const De = ot.exports, A = (e) => JSON.parse(JSON.stringify(e)), M = {
|
|
|
152
152
|
cols: this.columns || [],
|
|
153
153
|
stackAt: this.stackColumnsAt || "tablet",
|
|
154
154
|
flexDir: this.stackColumnsAt === "never" ? "row" : this.reverseColumnsWhenStacked ? "column-reverse" : "column",
|
|
155
|
-
TARGET:
|
|
155
|
+
TARGET: x
|
|
156
156
|
};
|
|
157
157
|
},
|
|
158
158
|
inject: {
|
|
@@ -280,7 +280,7 @@ var ut = function() {
|
|
|
280
280
|
null,
|
|
281
281
|
null
|
|
282
282
|
);
|
|
283
|
-
const
|
|
283
|
+
const Je = ft.exports, mt = g({
|
|
284
284
|
name: "builder-fragment-component",
|
|
285
285
|
props: []
|
|
286
286
|
});
|
|
@@ -297,7 +297,7 @@ var pt = function() {
|
|
|
297
297
|
null,
|
|
298
298
|
null
|
|
299
299
|
);
|
|
300
|
-
const
|
|
300
|
+
const Xe = _t.exports;
|
|
301
301
|
function V(e) {
|
|
302
302
|
return e.replace(/http(s)?:/, "");
|
|
303
303
|
}
|
|
@@ -408,22 +408,22 @@ var vt = function() {
|
|
|
408
408
|
null,
|
|
409
409
|
null
|
|
410
410
|
);
|
|
411
|
-
const
|
|
411
|
+
const Qe = kt.exports;
|
|
412
412
|
function h() {
|
|
413
413
|
return typeof window < "u" && typeof document < "u";
|
|
414
414
|
}
|
|
415
415
|
function xt() {
|
|
416
416
|
return h() && window.self !== window.top;
|
|
417
417
|
}
|
|
418
|
-
function
|
|
418
|
+
function T() {
|
|
419
419
|
return xt() && window.location.search.indexOf("builder.frameEditing=") !== -1;
|
|
420
420
|
}
|
|
421
|
-
const Ct = () => import("./block-styles.
|
|
421
|
+
const Ct = () => import("./block-styles.bc8cdc9f.js").then((e) => e.default).catch((e) => {
|
|
422
422
|
throw console.error(
|
|
423
423
|
"Error while attempting to dynamically import component BlockStyles at ./render-block/block-styles.vue",
|
|
424
424
|
e
|
|
425
425
|
), e;
|
|
426
|
-
}), wt = () => import("./render-block.
|
|
426
|
+
}), wt = () => import("./render-block.df744a97.js").then((e) => e.default).catch((e) => {
|
|
427
427
|
throw console.error(
|
|
428
428
|
"Error while attempting to dynamically import component RenderBlock at ./render-block/render-block.vue",
|
|
429
429
|
e
|
|
@@ -444,7 +444,7 @@ const Ct = () => import("./block-styles.6a1d7394.js").then((e) => e.default).cat
|
|
|
444
444
|
methods: {
|
|
445
445
|
onClick() {
|
|
446
446
|
var e, t;
|
|
447
|
-
|
|
447
|
+
T() && !((e = this.blocks) != null && e.length) && ((t = window.parent) == null || t.postMessage(
|
|
448
448
|
{
|
|
449
449
|
type: "builder.clickEmptyBlocks",
|
|
450
450
|
data: {
|
|
@@ -457,7 +457,7 @@ const Ct = () => import("./block-styles.6a1d7394.js").then((e) => e.default).cat
|
|
|
457
457
|
},
|
|
458
458
|
onMouseEnter() {
|
|
459
459
|
var e, t;
|
|
460
|
-
|
|
460
|
+
T() && !((e = this.blocks) != null && e.length) && ((t = window.parent) == null || t.postMessage(
|
|
461
461
|
{
|
|
462
462
|
type: "builder.hoverEmptyBlocks",
|
|
463
463
|
data: {
|
|
@@ -552,11 +552,11 @@ var Vt = function() {
|
|
|
552
552
|
null,
|
|
553
553
|
null
|
|
554
554
|
);
|
|
555
|
-
const
|
|
556
|
-
log: (...e) => console.log(
|
|
557
|
-
error: (...e) => console.error(
|
|
558
|
-
warn: (...e) => console.warn(
|
|
559
|
-
debug: (...e) => console.debug(
|
|
555
|
+
const Ye = jt.exports, C = "[Builder.io]: ", v = {
|
|
556
|
+
log: (...e) => console.log(C, ...e),
|
|
557
|
+
error: (...e) => console.error(C, ...e),
|
|
558
|
+
warn: (...e) => console.warn(C, ...e),
|
|
559
|
+
debug: (...e) => console.debug(C, ...e)
|
|
560
560
|
}, k = (e) => e != null, Bt = (e) => {
|
|
561
561
|
if (e === "localhost" || e === "127.0.0.1")
|
|
562
562
|
return e;
|
|
@@ -676,7 +676,7 @@ const Qe = jt.exports, x = "[Builder.io]: ", v = {
|
|
|
676
676
|
...e,
|
|
677
677
|
...o
|
|
678
678
|
};
|
|
679
|
-
},
|
|
679
|
+
}, w = (e) => k(e) ? e : !0;
|
|
680
680
|
function Ht() {
|
|
681
681
|
return typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : globalThis;
|
|
682
682
|
}
|
|
@@ -762,8 +762,8 @@ const ne = async (e) => {
|
|
|
762
762
|
const t = H(e);
|
|
763
763
|
return await (await Jt(t.href)).json();
|
|
764
764
|
}, re = async (e, t) => {
|
|
765
|
-
const n =
|
|
766
|
-
if (!n || !(h() ||
|
|
765
|
+
const n = w(e.canTrack);
|
|
766
|
+
if (!n || !(h() || x === "reactNative"))
|
|
767
767
|
return t;
|
|
768
768
|
try {
|
|
769
769
|
const r = [];
|
|
@@ -783,7 +783,7 @@ async function oe(e) {
|
|
|
783
783
|
return v.error("Error fetching data. ", t), null;
|
|
784
784
|
}
|
|
785
785
|
}
|
|
786
|
-
const se = () => import("./render-content.
|
|
786
|
+
const se = () => import("./render-content.30c701ec.js").then((e) => e.default).catch((e) => {
|
|
787
787
|
throw console.error(
|
|
788
788
|
"Error while attempting to dynamically import component RenderContent at ../../components/render-content/render-content.vue",
|
|
789
789
|
e
|
|
@@ -887,7 +887,7 @@ var ae = function() {
|
|
|
887
887
|
null,
|
|
888
888
|
null
|
|
889
889
|
);
|
|
890
|
-
const
|
|
890
|
+
const Ze = le.exports, ue = g({
|
|
891
891
|
name: "builder-text",
|
|
892
892
|
props: ["text"]
|
|
893
893
|
});
|
|
@@ -906,7 +906,7 @@ var de = function() {
|
|
|
906
906
|
null,
|
|
907
907
|
null
|
|
908
908
|
);
|
|
909
|
-
const
|
|
909
|
+
const tn = me.exports, pe = g({
|
|
910
910
|
name: "builder-video",
|
|
911
911
|
props: [
|
|
912
912
|
"autoPlay",
|
|
@@ -969,10 +969,10 @@ var he = function() {
|
|
|
969
969
|
null,
|
|
970
970
|
null
|
|
971
971
|
);
|
|
972
|
-
const
|
|
972
|
+
const en = be.exports, $ = (e) => Object.values((e == null ? void 0 : e.variations) || {}), j = ({
|
|
973
973
|
canTrack: e,
|
|
974
974
|
content: t
|
|
975
|
-
}) => !(!(
|
|
975
|
+
}) => !(!($(t).length > 0) || !e || h());
|
|
976
976
|
function ge(e, t, n) {
|
|
977
977
|
function r() {
|
|
978
978
|
function i(m, d, b) {
|
|
@@ -1047,7 +1047,7 @@ function ye(e, t, n) {
|
|
|
1047
1047
|
return;
|
|
1048
1048
|
}
|
|
1049
1049
|
}
|
|
1050
|
-
const
|
|
1050
|
+
const ve = (e) => e === "react" || e === "reactNative" || e === "vue3" || e === "vue2", J = ve(x), B = "bldrAbTest", X = "bldrCntntScrpt", Se = (e, t) => {
|
|
1051
1051
|
const n = ge.toString().replace(/\s+/g, " "), r = ye.toString().replace(/\s+/g, " ");
|
|
1052
1052
|
return `
|
|
1053
1053
|
const ${B} = ${n}
|
|
@@ -1056,25 +1056,25 @@ const J = (e) => e === "react" || e === "reactNative" || e === "vue3" || e === "
|
|
|
1056
1056
|
e
|
|
1057
1057
|
)}, ${J})
|
|
1058
1058
|
`;
|
|
1059
|
-
},
|
|
1059
|
+
}, nn = ({
|
|
1060
1060
|
parentContentId: e,
|
|
1061
1061
|
contentId: t
|
|
1062
1062
|
}) => `
|
|
1063
|
-
${X}("${t}", "${e}", ${J})`,
|
|
1063
|
+
${X}("${t}", "${e}", ${J})`, ke = () => import("./render-content.30c701ec.js").then((e) => e.default).catch((e) => {
|
|
1064
1064
|
throw console.error(
|
|
1065
1065
|
"Error while attempting to dynamically import component RenderContent at ../render-content/render-content.vue",
|
|
1066
1066
|
e
|
|
1067
1067
|
), e;
|
|
1068
|
-
}),
|
|
1068
|
+
}), xe = () => import("./render-inlined-styles.36b7a3a4.js").then((e) => e.default).catch((e) => {
|
|
1069
1069
|
throw console.error(
|
|
1070
1070
|
"Error while attempting to dynamically import component RenderInlinedStyles at ../render-inlined-styles.vue",
|
|
1071
1071
|
e
|
|
1072
1072
|
), e;
|
|
1073
|
-
}),
|
|
1073
|
+
}), Ce = g({
|
|
1074
1074
|
name: "render-content-variants",
|
|
1075
1075
|
components: {
|
|
1076
|
-
RenderInlinedStyles:
|
|
1077
|
-
RenderContent:
|
|
1076
|
+
RenderInlinedStyles: xe,
|
|
1077
|
+
RenderContent: ke
|
|
1078
1078
|
},
|
|
1079
1079
|
props: [
|
|
1080
1080
|
"content",
|
|
@@ -1087,60 +1087,60 @@ const J = (e) => e === "react" || e === "reactNative" || e === "vue3" || e === "
|
|
|
1087
1087
|
data() {
|
|
1088
1088
|
var e;
|
|
1089
1089
|
return {
|
|
1090
|
-
variantScriptStr:
|
|
1091
|
-
|
|
1090
|
+
variantScriptStr: Se(
|
|
1091
|
+
$(this.content).map((t) => ({
|
|
1092
1092
|
id: t.id,
|
|
1093
1093
|
testRatio: t.testRatio
|
|
1094
1094
|
})),
|
|
1095
1095
|
((e = this.content) == null ? void 0 : e.id) || ""
|
|
1096
1096
|
),
|
|
1097
1097
|
shouldRenderVariants: j({
|
|
1098
|
-
canTrack:
|
|
1098
|
+
canTrack: w(this.canTrack),
|
|
1099
1099
|
content: this.content
|
|
1100
1100
|
}),
|
|
1101
|
-
hideVariantsStyleString:
|
|
1101
|
+
hideVariantsStyleString: $(this.content).map((t) => `.variant-${t.id} { display: none; } `).join(""),
|
|
1102
1102
|
contentToRender: j({
|
|
1103
|
-
canTrack:
|
|
1103
|
+
canTrack: w(this.canTrack),
|
|
1104
1104
|
content: this.content
|
|
1105
1105
|
}) ? this.content : Gt({
|
|
1106
1106
|
item: this.content,
|
|
1107
|
-
canTrack:
|
|
1107
|
+
canTrack: w(this.canTrack)
|
|
1108
1108
|
}),
|
|
1109
|
-
getVariants:
|
|
1109
|
+
getVariants: $
|
|
1110
1110
|
};
|
|
1111
1111
|
}
|
|
1112
1112
|
});
|
|
1113
|
-
var
|
|
1113
|
+
var we = function() {
|
|
1114
1114
|
var r, o, s, i;
|
|
1115
1115
|
var t = this, n = t._self._c;
|
|
1116
1116
|
return t._self._setupProxy, n("div", [t.shouldRenderVariants ? [n("render-inlined-styles", { attrs: { id: `variants-styles-${(r = t.content) == null ? void 0 : r.id}`, styles: t.hideVariantsStyleString } }), n("script", { tag: "component", attrs: { id: `variants-script-${(o = t.content) == null ? void 0 : o.id}` }, domProps: { innerHTML: t._s(t.variantScriptStr) } }), t._l(t.getVariants(t.content), function(u, a) {
|
|
1117
1117
|
var c;
|
|
1118
1118
|
return n("render-content", { key: u.id, attrs: { content: u, apiKey: t.apiKey, apiVersion: t.apiVersion, canTrack: t.canTrack, customComponents: t.customComponents, hideContent: !0, parentContentId: (c = t.content) == null ? void 0 : c.id, isSsrAbTest: t.shouldRenderVariants } });
|
|
1119
1119
|
})] : t._e(), n("render-content", { attrs: { model: t.model, content: t.contentToRender, apiKey: t.apiKey, apiVersion: t.apiVersion, canTrack: t.canTrack, customComponents: t.customComponents, classNameProp: `variant-${(s = t.content) == null ? void 0 : s.id}`, parentContentId: (i = t.content) == null ? void 0 : i.id, isSsrAbTest: t.shouldRenderVariants } })], 2);
|
|
1120
|
-
},
|
|
1121
|
-
xe,
|
|
1120
|
+
}, $e = [], Te = /* @__PURE__ */ y(
|
|
1122
1121
|
Ce,
|
|
1123
1122
|
we,
|
|
1123
|
+
$e,
|
|
1124
1124
|
!1,
|
|
1125
1125
|
null,
|
|
1126
1126
|
null,
|
|
1127
1127
|
null,
|
|
1128
1128
|
null
|
|
1129
1129
|
);
|
|
1130
|
-
const
|
|
1131
|
-
function
|
|
1132
|
-
return !h() ||
|
|
1130
|
+
const rn = Te.exports;
|
|
1131
|
+
function on() {
|
|
1132
|
+
return !h() || T() ? !1 : Boolean(location.search.indexOf("builder.preview=") !== -1);
|
|
1133
1133
|
}
|
|
1134
|
-
const
|
|
1134
|
+
const Re = (e) => {
|
|
1135
1135
|
const t = e.toString().trim();
|
|
1136
1136
|
return `return (${!t.startsWith("function") && !t.startsWith("(") ? "function " : ""}${t}).apply(this, arguments)`;
|
|
1137
|
-
},
|
|
1137
|
+
}, sn = [], an = ({
|
|
1138
1138
|
component: e,
|
|
1139
1139
|
...t
|
|
1140
1140
|
}) => ({
|
|
1141
1141
|
type: "builder.registerComponent",
|
|
1142
|
-
data:
|
|
1143
|
-
}),
|
|
1142
|
+
data: Ae(t)
|
|
1143
|
+
}), Ie = (e) => typeof e == "function" ? Re(e) : A(e), Ae = ({
|
|
1144
1144
|
inputs: e,
|
|
1145
1145
|
...t
|
|
1146
1146
|
}) => ({
|
|
@@ -1149,13 +1149,13 @@ const Te = (e) => {
|
|
|
1149
1149
|
(n) => Object.entries(n).reduce(
|
|
1150
1150
|
(r, [o, s]) => ({
|
|
1151
1151
|
...r,
|
|
1152
|
-
[o]:
|
|
1152
|
+
[o]: Ie(s)
|
|
1153
1153
|
}),
|
|
1154
1154
|
{}
|
|
1155
1155
|
)
|
|
1156
1156
|
)
|
|
1157
1157
|
}), N = {};
|
|
1158
|
-
function
|
|
1158
|
+
function cn(e, t) {
|
|
1159
1159
|
let n = N[e];
|
|
1160
1160
|
if (n || (n = N[e] = []), n.push(t), h()) {
|
|
1161
1161
|
const r = {
|
|
@@ -1173,7 +1173,7 @@ function an(e, t) {
|
|
|
1173
1173
|
}
|
|
1174
1174
|
}
|
|
1175
1175
|
const F = {};
|
|
1176
|
-
function
|
|
1176
|
+
function ln(e) {
|
|
1177
1177
|
if (h()) {
|
|
1178
1178
|
Object.assign(F, e);
|
|
1179
1179
|
const t = {
|
|
@@ -1183,16 +1183,16 @@ function cn(e) {
|
|
|
1183
1183
|
parent.postMessage(t, "*");
|
|
1184
1184
|
}
|
|
1185
1185
|
}
|
|
1186
|
-
function
|
|
1186
|
+
function Ee() {
|
|
1187
1187
|
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) {
|
|
1188
1188
|
const t = Math.random() * 16 | 0;
|
|
1189
1189
|
return (e == "x" ? t : t & 3 | 8).toString(16);
|
|
1190
1190
|
});
|
|
1191
1191
|
}
|
|
1192
1192
|
function Q() {
|
|
1193
|
-
return
|
|
1193
|
+
return Ee().replace(/-/g, "");
|
|
1194
1194
|
}
|
|
1195
|
-
const Y = "builderSessionId",
|
|
1195
|
+
const Y = "builderSessionId", Oe = async ({
|
|
1196
1196
|
canTrack: e
|
|
1197
1197
|
}) => {
|
|
1198
1198
|
if (!e)
|
|
@@ -1204,13 +1204,13 @@ const Y = "builderSessionId", Ee = async ({
|
|
|
1204
1204
|
if (k(t))
|
|
1205
1205
|
return t;
|
|
1206
1206
|
{
|
|
1207
|
-
const n =
|
|
1208
|
-
return
|
|
1207
|
+
const n = Ve();
|
|
1208
|
+
return Pe({ id: n, canTrack: e }), n;
|
|
1209
1209
|
}
|
|
1210
|
-
},
|
|
1210
|
+
}, Ve = () => Q(), Pe = ({
|
|
1211
1211
|
id: e,
|
|
1212
1212
|
canTrack: t
|
|
1213
|
-
}) => L({ name: Y, value: e, canTrack: t }), Z = () => h() && typeof localStorage < "u" ? localStorage : void 0,
|
|
1213
|
+
}) => L({ name: Y, value: e, canTrack: t }), Z = () => h() && typeof localStorage < "u" ? localStorage : void 0, je = ({
|
|
1214
1214
|
key: e,
|
|
1215
1215
|
canTrack: t
|
|
1216
1216
|
}) => {
|
|
@@ -1221,7 +1221,7 @@ const Y = "builderSessionId", Ee = async ({
|
|
|
1221
1221
|
console.debug("[LocalStorage] GET error: ", r);
|
|
1222
1222
|
return;
|
|
1223
1223
|
}
|
|
1224
|
-
},
|
|
1224
|
+
}, Be = ({
|
|
1225
1225
|
key: e,
|
|
1226
1226
|
canTrack: t,
|
|
1227
1227
|
value: n
|
|
@@ -1232,34 +1232,34 @@ const Y = "builderSessionId", Ee = async ({
|
|
|
1232
1232
|
} catch (o) {
|
|
1233
1233
|
console.debug("[LocalStorage] SET error: ", o);
|
|
1234
1234
|
}
|
|
1235
|
-
}, tt = "builderVisitorId",
|
|
1235
|
+
}, tt = "builderVisitorId", Ne = ({ canTrack: e }) => {
|
|
1236
1236
|
if (!e)
|
|
1237
1237
|
return;
|
|
1238
|
-
const t =
|
|
1238
|
+
const t = je({
|
|
1239
1239
|
key: tt,
|
|
1240
1240
|
canTrack: e
|
|
1241
1241
|
});
|
|
1242
1242
|
if (k(t))
|
|
1243
1243
|
return t;
|
|
1244
1244
|
{
|
|
1245
|
-
const n =
|
|
1246
|
-
return
|
|
1245
|
+
const n = Fe();
|
|
1246
|
+
return Me({ id: n, canTrack: e }), n;
|
|
1247
1247
|
}
|
|
1248
|
-
},
|
|
1248
|
+
}, Fe = () => Q(), Me = ({
|
|
1249
1249
|
id: e,
|
|
1250
1250
|
canTrack: t
|
|
1251
|
-
}) =>
|
|
1251
|
+
}) => Be({
|
|
1252
1252
|
key: tt,
|
|
1253
1253
|
value: e,
|
|
1254
1254
|
canTrack: t
|
|
1255
|
-
}),
|
|
1255
|
+
}), Ue = () => {
|
|
1256
1256
|
if (h()) {
|
|
1257
1257
|
const e = new URL(location.href);
|
|
1258
1258
|
return e.pathname === "" && (e.pathname = "/"), e;
|
|
1259
1259
|
} else
|
|
1260
1260
|
return console.warn("Cannot get location for tracking in non-browser environment"), null;
|
|
1261
|
-
},
|
|
1262
|
-
const e =
|
|
1261
|
+
}, We = () => typeof navigator == "object" && navigator.userAgent || "", Le = () => {
|
|
1262
|
+
const e = We(), t = {
|
|
1263
1263
|
Android() {
|
|
1264
1264
|
return e.match(/Android/i);
|
|
1265
1265
|
},
|
|
@@ -1276,25 +1276,25 @@ const Y = "builderSessionId", Ee = async ({
|
|
|
1276
1276
|
return e.match(/IEMobile/i) || e.match(/WPDesktop/i);
|
|
1277
1277
|
},
|
|
1278
1278
|
any() {
|
|
1279
|
-
return t.Android() || t.BlackBerry() || t.iOS() || t.Opera() || t.Windows() ||
|
|
1279
|
+
return t.Android() || t.BlackBerry() || t.iOS() || t.Opera() || t.Windows() || x === "reactNative";
|
|
1280
1280
|
}
|
|
1281
|
-
}, n = e.match(/Tablet|iPad/i), r =
|
|
1281
|
+
}, n = e.match(/Tablet|iPad/i), r = Ue();
|
|
1282
1282
|
return {
|
|
1283
1283
|
urlPath: r == null ? void 0 : r.pathname,
|
|
1284
1284
|
host: (r == null ? void 0 : r.host) || (r == null ? void 0 : r.hostname),
|
|
1285
1285
|
device: n ? "tablet" : t.any() ? "mobile" : "desktop"
|
|
1286
1286
|
};
|
|
1287
|
-
},
|
|
1287
|
+
}, ze = async ({
|
|
1288
1288
|
canTrack: e
|
|
1289
1289
|
}) => {
|
|
1290
1290
|
if (!e)
|
|
1291
1291
|
return { visitorId: void 0, sessionId: void 0 };
|
|
1292
|
-
const t = await
|
|
1292
|
+
const t = await Oe({ canTrack: e }), n = Ne({ canTrack: e });
|
|
1293
1293
|
return {
|
|
1294
1294
|
sessionId: t,
|
|
1295
1295
|
visitorId: n
|
|
1296
1296
|
};
|
|
1297
|
-
},
|
|
1297
|
+
}, Ke = async ({
|
|
1298
1298
|
type: e,
|
|
1299
1299
|
canTrack: t,
|
|
1300
1300
|
apiKey: n,
|
|
@@ -1308,23 +1308,23 @@ const Y = "builderSessionId", Ee = async ({
|
|
|
1308
1308
|
url: location.href,
|
|
1309
1309
|
...r
|
|
1310
1310
|
},
|
|
1311
|
-
...await
|
|
1312
|
-
userAttributes:
|
|
1311
|
+
...await ze({ canTrack: t }),
|
|
1312
|
+
userAttributes: Le(),
|
|
1313
1313
|
ownerId: n
|
|
1314
1314
|
}
|
|
1315
1315
|
});
|
|
1316
|
-
async function
|
|
1316
|
+
async function Ge(e) {
|
|
1317
1317
|
if (!e.apiKey) {
|
|
1318
1318
|
v.error(
|
|
1319
1319
|
"Missing API key for track call. Please provide your API key."
|
|
1320
1320
|
);
|
|
1321
1321
|
return;
|
|
1322
1322
|
}
|
|
1323
|
-
if (!!e.canTrack &&
|
|
1324
|
-
return fetch("https://builder.io/api/v1/track", {
|
|
1323
|
+
if (!!e.canTrack && !T() && !!(h() || x === "reactNative"))
|
|
1324
|
+
return fetch("https://cdn.builder.io/api/v1/track", {
|
|
1325
1325
|
method: "POST",
|
|
1326
1326
|
body: JSON.stringify({
|
|
1327
|
-
events: [await
|
|
1327
|
+
events: [await Ke(e)]
|
|
1328
1328
|
}),
|
|
1329
1329
|
headers: {
|
|
1330
1330
|
"content-type": "application/json"
|
|
@@ -1334,41 +1334,41 @@ async function Ke(e) {
|
|
|
1334
1334
|
console.error("Failed to track: ", t);
|
|
1335
1335
|
});
|
|
1336
1336
|
}
|
|
1337
|
-
const
|
|
1337
|
+
const un = (e) => Ge({ ...e, canTrack: !0 });
|
|
1338
1338
|
export {
|
|
1339
1339
|
Et as A,
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
T,
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1340
|
+
He as B,
|
|
1341
|
+
Je as C,
|
|
1342
|
+
Xe as F,
|
|
1343
|
+
Qe as I,
|
|
1344
|
+
Ye as S,
|
|
1345
|
+
x as T,
|
|
1346
|
+
en as V,
|
|
1347
|
+
Ge as _,
|
|
1348
|
+
qe as a,
|
|
1349
1349
|
h as b,
|
|
1350
1350
|
k as c,
|
|
1351
|
-
|
|
1352
|
-
|
|
1351
|
+
Ze as d,
|
|
1352
|
+
tn as e,
|
|
1353
1353
|
A as f,
|
|
1354
1354
|
st as g,
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1355
|
+
nn as h,
|
|
1356
|
+
T as i,
|
|
1357
|
+
sn as j,
|
|
1358
1358
|
E as k,
|
|
1359
1359
|
v as l,
|
|
1360
|
-
|
|
1360
|
+
an as m,
|
|
1361
1361
|
y as n,
|
|
1362
|
-
|
|
1362
|
+
on as o,
|
|
1363
1363
|
ee as p,
|
|
1364
1364
|
Jt as q,
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1365
|
+
cn as r,
|
|
1366
|
+
Re as s,
|
|
1367
|
+
ln as t,
|
|
1368
1368
|
oe as u,
|
|
1369
1369
|
re as v,
|
|
1370
1370
|
Yt as w,
|
|
1371
|
-
|
|
1371
|
+
un as x,
|
|
1372
1372
|
At as y,
|
|
1373
|
-
|
|
1373
|
+
rn as z
|
|
1374
1374
|
};
|