@builder.io/sdk-vue 0.5.6 → 0.5.8

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.
Files changed (58) hide show
  1. package/package.json +1 -1
  2. package/packages/_vue2/dist/{block-styles.ac28ad89.js → block-styles.53de235b.js} +5 -5
  3. package/packages/_vue2/dist/{block-styles.d7a0bd18.cjs → block-styles.62ab6928.cjs} +1 -1
  4. package/packages/_vue2/dist/{block-wrapper.877d598e.js → block-wrapper.42f7cc18.js} +5 -5
  5. package/packages/_vue2/dist/{block-wrapper.4020c35e.cjs → block-wrapper.ffff3ae1.cjs} +1 -1
  6. package/packages/_vue2/dist/{block.4db8867b.js → block.32028ed9.js} +7 -7
  7. package/packages/_vue2/dist/{block.03f6b1f1.cjs → block.e75fc1fd.cjs} +2 -2
  8. package/packages/_vue2/dist/{blocks-wrapper.88129f1c.js → blocks-wrapper.545648f8.js} +6 -6
  9. package/packages/_vue2/dist/{blocks-wrapper.69dad1d3.cjs → blocks-wrapper.f2ac2ced.cjs} +1 -1
  10. package/packages/_vue2/dist/{component-ref.ae6b00e2.js → component-ref.93c96dcf.js} +6 -6
  11. package/packages/_vue2/dist/{component-ref.5beb6576.cjs → component-ref.db6118ae.cjs} +1 -1
  12. package/packages/_vue2/dist/{content.4429d811.cjs → content.f8c10901.cjs} +1 -1
  13. package/packages/_vue2/dist/{content.d83d212f.js → content.f9bd5fcb.js} +5 -5
  14. package/packages/_vue2/dist/{css.ec4684cd.cjs → css.0a7231c0.cjs} +1 -1
  15. package/packages/_vue2/dist/{css.e33adaf0.js → css.3ca25316.js} +1 -1
  16. package/packages/_vue2/dist/{enable-editor.7bbb8293.cjs → enable-editor.02af1249.cjs} +1 -1
  17. package/packages/_vue2/dist/{enable-editor.2a84c36c.js → enable-editor.94619084.js} +22 -22
  18. package/packages/_vue2/dist/{evaluate.15b2ed56.js → evaluate.05948f83.js} +2 -2
  19. package/packages/_vue2/dist/{evaluate.eba0e0f9.cjs → evaluate.0c3fa60b.cjs} +1 -1
  20. package/packages/_vue2/dist/{get-block-actions.1973b4d5.cjs → get-block-actions.f638af63.cjs} +1 -1
  21. package/packages/_vue2/dist/{get-block-actions.db2ac618.js → get-block-actions.fcd3a65b.js} +2 -2
  22. package/packages/_vue2/dist/{get-block-properties.322d544d.js → get-block-properties.1c8b2787.js} +2 -2
  23. package/packages/_vue2/dist/{get-block-properties.ef1464fb.cjs → get-block-properties.f62d4730.cjs} +1 -1
  24. package/packages/_vue2/dist/{get-processed-block.c9980195.js → get-processed-block.39e600d4.js} +2 -2
  25. package/packages/_vue2/dist/{get-processed-block.9d4edbee.cjs → get-processed-block.e1ff6ece.cjs} +1 -1
  26. package/packages/_vue2/dist/{index.fc359faf.js → index.68a558a0.js} +85 -85
  27. package/packages/_vue2/dist/{index.0c5f9582.cjs → index.df94ab6d.cjs} +7 -7
  28. package/packages/_vue2/dist/{inlined-script.3e92a79e.cjs → inlined-script.4c3c12d0.cjs} +1 -1
  29. package/packages/_vue2/dist/{inlined-script.1b247526.js → inlined-script.502cfeff.js} +1 -1
  30. package/packages/_vue2/dist/{inlined-styles.32485f82.js → inlined-styles.1f1d5537.js} +1 -1
  31. package/packages/_vue2/dist/{inlined-styles.f9ade1ef.cjs → inlined-styles.f6b48786.cjs} +1 -1
  32. package/packages/_vue2/dist/{interactive-element.c8119384.js → interactive-element.a31f191b.js} +5 -5
  33. package/packages/_vue2/dist/{interactive-element.21050a26.cjs → interactive-element.edc14cd8.cjs} +1 -1
  34. package/packages/_vue2/dist/{non-node-runtime.84ddb11a.js → non-node-runtime.ded1660b.js} +1 -1
  35. package/packages/_vue2/dist/{non-node-runtime.ddd24d83.cjs → non-node-runtime.fc00e390.cjs} +1 -1
  36. package/packages/_vue2/dist/{repeated-block.f4f2b4be.cjs → repeated-block.9268c636.cjs} +1 -1
  37. package/packages/_vue2/dist/{repeated-block.4fbd3217.js → repeated-block.d58b000e.js} +2 -2
  38. package/packages/_vue2/dist/sdk.cjs +1 -1
  39. package/packages/_vue2/dist/sdk.js +4 -4
  40. package/packages/_vue2/dist/src/constants/sdk-version.d.ts +1 -1
  41. package/packages/_vue2/dist/style.css +1 -1
  42. package/packages/_vue2/dist/{styles.29f558ce.js → styles.4301545b.js} +2 -2
  43. package/packages/_vue2/dist/{styles.b060113b.cjs → styles.46962285.cjs} +3 -3
  44. package/packages/_vue3/dist/{block-wrapper.759209a2.cjs → block-wrapper.bf1030b0.cjs} +1 -1
  45. package/packages/_vue3/dist/{block-wrapper.0604faad.js → block-wrapper.c8ec3e80.js} +2 -2
  46. package/packages/_vue3/dist/{component-ref.72a8476f.js → component-ref.5b93cf21.js} +2 -2
  47. package/packages/_vue3/dist/{component-ref.cc553de5.cjs → component-ref.cd85a4b1.cjs} +1 -1
  48. package/packages/_vue3/dist/{get-block-actions.b8fe4107.cjs → get-block-actions.60bff98a.cjs} +1 -1
  49. package/packages/_vue3/dist/{get-block-actions.0fc3b0b7.js → get-block-actions.6af8791d.js} +1 -1
  50. package/packages/_vue3/dist/{index.1bb7374b.cjs → index.39827af2.cjs} +7 -7
  51. package/packages/_vue3/dist/{index.ebaa8c07.js → index.953837d2.js} +92 -92
  52. package/packages/_vue3/dist/{non-node-runtime.d7d010c9.cjs → non-node-runtime.5930ba44.cjs} +7 -7
  53. package/packages/_vue3/dist/{non-node-runtime.b16cf7b9.js → non-node-runtime.814a2495.js} +1 -1
  54. package/packages/_vue3/dist/{repeated-block.115e1f66.cjs → repeated-block.0a776412.cjs} +1 -1
  55. package/packages/_vue3/dist/{repeated-block.ee20f5f0.js → repeated-block.f409b451.js} +2 -2
  56. package/packages/_vue3/dist/sdk.cjs +1 -1
  57. package/packages/_vue3/dist/sdk.js +1 -1
  58. package/packages/_vue3/dist/src/constants/sdk-version.d.ts +1 -1
@@ -1,4 +1,4 @@
1
- "use strict";const s=require("./index.0c5f9582.cjs");function a(){const r=()=>{var e;return typeof process<"u"&&((e=process==null?void 0:process.versions)==null?void 0:e.node)};return!s.isBrowser()&&!r()}let g;a()&&Promise.resolve().then(()=>require("./non-node-runtime.ddd24d83.cjs")).then(r=>{g=r.runInNonNode}).catch(r=>{const e="Error importing JS interpreter for non-Node.js runtimes. Make sure `js-interpreter` is installed.\n Read more here: https://github.com/BuilderIO/builder/tree/main/packages/sdks/README.md#non-nodejs-runtimes-edge-serverless\n ";s.logger.error(e,r),g=(...i)=>{s.logger.error(e)}});function w({code:r,context:e,localState:i,rootState:t,rootSetState:n,event:u,isExpression:o=!0}){if(r===""){s.logger.warn("Skipping evaluation of empty code block.");return}const d={isEditing:s.isEditing(),isBrowser:s.isBrowser(),isServer:!s.isBrowser()},c={useCode:o&&!(r.includes(";")||r.includes(" return ")||r.trim().startsWith("return "))?`return (${r});`:r,builder:d,context:e,event:u,rootSetState:n,rootState:t,localState:i};return s.isBrowser()?f(c):a()?g(c):h(c)}const f=({useCode:r,builder:e,context:i,event:t,localState:n,rootSetState:u,rootState:o})=>{const d=m(o,n,u);try{return new Function("builder","Builder","state","context","event",r)(e,e,d,i,t)}catch(l){s.logger.warn(`Builder custom code error:
1
+ "use strict";const s=require("./index.df94ab6d.cjs");function a(){const r=()=>{var e;return typeof process<"u"&&((e=process==null?void 0:process.versions)==null?void 0:e.node)};return!s.isBrowser()&&!r()}let g;a()&&Promise.resolve().then(()=>require("./non-node-runtime.fc00e390.cjs")).then(r=>{g=r.runInNonNode}).catch(r=>{const e="Error importing JS interpreter for non-Node.js runtimes. Make sure `js-interpreter` is installed.\n Read more here: https://github.com/BuilderIO/builder/tree/main/packages/sdks/README.md#non-nodejs-runtimes-edge-serverless\n ";s.logger.error(e,r),g=(...i)=>{s.logger.error(e)}});function w({code:r,context:e,localState:i,rootState:t,rootSetState:n,event:u,isExpression:o=!0}){if(r===""){s.logger.warn("Skipping evaluation of empty code block.");return}const d={isEditing:s.isEditing(),isBrowser:s.isBrowser(),isServer:!s.isBrowser()},c={useCode:o&&!(r.includes(";")||r.includes(" return ")||r.trim().startsWith("return "))?`return (${r});`:r,builder:d,context:e,event:u,rootSetState:n,rootState:t,localState:i};return s.isBrowser()?f(c):a()?g(c):h(c)}const f=({useCode:r,builder:e,context:i,event:t,localState:n,rootSetState:u,rootState:o})=>{const d=m(o,n,u);try{return new Function("builder","Builder","state","context","event",r)(e,e,d,i,t)}catch(l){s.logger.warn(`Builder custom code error:
2
2
  While Evaluating:
3
3
  `,r,`
4
4
  `,l)}},h=r=>f(r);function m(r,e,i){if(r===e)throw new Error("rootState === localState");return new Proxy(r,{get:(t,n)=>e&&n in e?e[n]:r[n],set:(t,n,u)=>{if(e&&n in e)throw new Error("Writing to local state is not allowed as it is read-only.");return r[n]=u,i==null||i(r),!0}})}exports.evaluate=w;
@@ -1 +1 @@
1
- "use strict";const s=require("./index.0c5f9582.cjs"),l=require("./evaluate.eba0e0f9.cjs"),i=e=>`v-on:${e.toLowerCase()}`,u=(e,t)=>a=>l.evaluate({code:e,context:t.context,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,event:a,isExpression:!1});function v(e){var n;const t={},a=(n=e.block.actions)!=null?n:{};for(const o in a){if(!a.hasOwnProperty(o))continue;const r=a[o];let c=i(o);if(e.stripPrefix)switch(s.TARGET){case"vue2":case"vue3":c=c.replace("v-on:","");break;case"svelte":c=c.replace("on:","");break}t[c]=u(r,e)}return t}exports.getBlockActions=v;
1
+ "use strict";const s=require("./index.df94ab6d.cjs"),l=require("./evaluate.0c3fa60b.cjs"),i=e=>`v-on:${e.toLowerCase()}`,u=(e,t)=>a=>l.evaluate({code:e,context:t.context,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,event:a,isExpression:!1});function v(e){var n;const t={},a=(n=e.block.actions)!=null?n:{};for(const o in a){if(!a.hasOwnProperty(o))continue;const r=a[o];let c=i(o);if(e.stripPrefix)switch(s.TARGET){case"vue2":case"vue3":c=c.replace("v-on:","");break;case"svelte":c=c.replace("on:","");break}t[c]=u(r,e)}return t}exports.getBlockActions=v;
@@ -1,5 +1,5 @@
1
- import { T as s } from "./index.fc359faf.js";
2
- import { e as l } from "./evaluate.15b2ed56.js";
1
+ import { T as s } from "./index.68a558a0.js";
2
+ import { e as l } from "./evaluate.05948f83.js";
3
3
  const i = (e) => `v-on:${e.toLowerCase()}`, v = (e, t) => (o) => l({
4
4
  code: e,
5
5
  context: t.context,
@@ -1,5 +1,5 @@
1
- import { T as o } from "./index.fc359faf.js";
2
- import { a } from "./css.e33adaf0.js";
1
+ import { T as o } from "./index.68a558a0.js";
2
+ import { a } from "./css.3ca25316.js";
3
3
  function n(e) {
4
4
  const t = {};
5
5
  if (typeof e != "string")
@@ -1 +1 @@
1
- "use strict";const c=require("./index.0c5f9582.cjs"),n=require("./css.ec4684cd.cjs");function i(e){const t={};if(typeof e!="string")return t;const r=e.trim().split(/\\s+/);for(const s of r)t[s]=!0;return t}function o(e){return e.class=i(e.class),e}const a=e=>({href:e.href});function u({block:e,context:t}){var s;const r={...a(e),...e.properties,"builder-id":e.id,style:e.style?l(e.style):void 0,class:[e.id,"builder-block",e.class,(s=e.properties)==null?void 0:s.class].filter(Boolean).join(" ")};return o(r)}function l(e){switch(c.TARGET){case"svelte":case"vue2":case"vue3":case"solid":return n.convertStyleMapToCSSArray(e).join(" ");case"qwik":case"reactNative":case"react":case"rsc":return e}}exports.getBlockProperties=u;
1
+ "use strict";const c=require("./index.df94ab6d.cjs"),n=require("./css.0a7231c0.cjs");function i(e){const t={};if(typeof e!="string")return t;const r=e.trim().split(/\\s+/);for(const s of r)t[s]=!0;return t}function o(e){return e.class=i(e.class),e}const a=e=>({href:e.href});function u({block:e,context:t}){var s;const r={...a(e),...e.properties,"builder-id":e.id,style:e.style?l(e.style):void 0,class:[e.id,"builder-block",e.class,(s=e.properties)==null?void 0:s.class].filter(Boolean).join(" ")};return o(r)}function l(e){switch(c.TARGET){case"svelte":case"vue2":case"vue3":case"solid":return n.convertStyleMapToCSSArray(e).join(" ");case"qwik":case"reactNative":case"react":case"rsc":return e}}exports.getBlockProperties=u;
@@ -1,5 +1,5 @@
1
- import { e as p } from "./evaluate.15b2ed56.js";
2
- import { f as u } from "./index.fc359faf.js";
1
+ import { e as p } from "./evaluate.05948f83.js";
2
+ import { f as u } from "./index.68a558a0.js";
3
3
  import { s as d } from "./set.b219ab0e.js";
4
4
  const m = ({
5
5
  block: n,
@@ -1 +1 @@
1
- "use strict";const d=require("./evaluate.eba0e0f9.cjs"),f=require("./index.0c5f9582.cjs"),l=require("./set.87eb0329.cjs");const g=({block:e,context:t,localState:r,rootState:i,rootSetState:o})=>{if(!e.bindings)return e;const n=f.fastClone(e),s={...n,properties:{...n.properties},actions:{...n.actions}};for(const c in e.bindings){const u=e.bindings[c],a=d.evaluate({code:u,localState:r,rootState:i,rootSetState:o,context:t});l.set(s,c,a)}return s};function p({block:e,context:t,shouldEvaluateBindings:r,localState:i,rootState:o,rootSetState:n}){const s=e;return r?g({block:s,localState:i,rootState:o,rootSetState:n,context:t}):s}exports.getProcessedBlock=p;
1
+ "use strict";const d=require("./evaluate.0c3fa60b.cjs"),f=require("./index.df94ab6d.cjs"),l=require("./set.87eb0329.cjs");const g=({block:e,context:t,localState:r,rootState:i,rootSetState:o})=>{if(!e.bindings)return e;const n=f.fastClone(e),s={...n,properties:{...n.properties},actions:{...n.actions}};for(const c in e.bindings){const a=e.bindings[c],u=d.evaluate({code:a,localState:r,rootState:i,rootSetState:o,context:t});l.set(s,c,u)}return s};function p({block:e,context:t,shouldEvaluateBindings:r,localState:i,rootState:o,rootSetState:n}){const s=e;return r?g({block:s,localState:i,rootState:o,rootSetState:n,context:t}):s}exports.getProcessedBlock=p;
@@ -67,7 +67,7 @@ var it = function() {
67
67
  null,
68
68
  null
69
69
  );
70
- const nn = ct.exports, P = (e) => JSON.parse(JSON.stringify(e)), U = {
70
+ const on = ct.exports, P = (e) => JSON.parse(JSON.stringify(e)), U = {
71
71
  small: {
72
72
  min: 320,
73
73
  default: 321,
@@ -83,7 +83,7 @@ const nn = ct.exports, P = (e) => JSON.parse(JSON.stringify(e)), U = {
83
83
  default: 991,
84
84
  max: 1200
85
85
  }
86
- }, on = (e, t = U) => `@media (max-width: ${t[e].max}px)`, lt = ({
86
+ }, rn = (e, t = U) => `@media (max-width: ${t[e].max}px)`, lt = ({
87
87
  small: e,
88
88
  medium: t
89
89
  }) => {
@@ -113,7 +113,7 @@ const nn = ct.exports, P = (e) => JSON.parse(JSON.stringify(e)), U = {
113
113
  "Error while attempting to dynamically import component Blocks at ../../components/blocks/blocks.vue",
114
114
  e
115
115
  ), e;
116
- }), dt = () => import("./inlined-styles.32485f82.js").then((e) => e.default).catch((e) => {
116
+ }), dt = () => import("./inlined-styles.1f1d5537.js").then((e) => e.default).catch((e) => {
117
117
  throw console.error(
118
118
  "Error while attempting to dynamically import component InlinedStyles at ../../components/inlined-styles.vue",
119
119
  e
@@ -258,7 +258,7 @@ var pt = function() {
258
258
  null,
259
259
  null
260
260
  );
261
- const rn = ht.exports, _t = b({
261
+ const sn = ht.exports, _t = b({
262
262
  name: "builder-fragment-component",
263
263
  props: []
264
264
  });
@@ -275,7 +275,7 @@ var bt = function() {
275
275
  null,
276
276
  null
277
277
  );
278
- const sn = yt.exports;
278
+ const an = yt.exports;
279
279
  function B(e) {
280
280
  return e.replace(/http(s)?:/, "");
281
281
  }
@@ -384,7 +384,7 @@ var xt = function() {
384
384
  null,
385
385
  null
386
386
  );
387
- const an = Ct.exports, $t = b({
387
+ const cn = Ct.exports, $t = b({
388
388
  name: "builder-section-component",
389
389
  props: ["attributes", "maxWidth"],
390
390
  data() {
@@ -415,7 +415,7 @@ var Tt = function() {
415
415
  null,
416
416
  null
417
417
  );
418
- const cn = Rt.exports, C = "[Builder.io]: ", v = {
418
+ const ln = Rt.exports, C = "[Builder.io]: ", v = {
419
419
  log: (...e) => console.log(C, ...e),
420
420
  error: (...e) => console.error(C, ...e),
421
421
  warn: (...e) => console.warn(C, ...e),
@@ -522,7 +522,7 @@ var Ot = function() {
522
522
  null,
523
523
  null
524
524
  );
525
- const ln = Bt.exports, jt = b({
525
+ const un = Bt.exports, jt = b({
526
526
  name: "builder-text",
527
527
  props: ["text"]
528
528
  });
@@ -542,7 +542,7 @@ var Nt = function() {
542
542
  null,
543
543
  null
544
544
  );
545
- const un = Ut.exports, Mt = b({
545
+ const dn = Ut.exports, Mt = b({
546
546
  name: "builder-video",
547
547
  props: [
548
548
  "autoPlay",
@@ -606,7 +606,7 @@ var Wt = function() {
606
606
  null,
607
607
  null
608
608
  );
609
- const dn = Lt.exports, zt = Symbol(), Gt = {
609
+ const mn = Lt.exports, zt = Symbol(), Gt = {
610
610
  Builder: {
611
611
  content: null,
612
612
  context: {},
@@ -623,17 +623,17 @@ const dn = Lt.exports, zt = Symbol(), Gt = {
623
623
  }, Dt = Symbol(), Ht = {
624
624
  Components: { registeredComponents: {} },
625
625
  key: Dt
626
- }, Jt = () => import("./block-styles.ac28ad89.js").then((e) => e.default).catch((e) => {
626
+ }, Jt = () => import("./block-styles.53de235b.js").then((e) => e.default).catch((e) => {
627
627
  throw console.error(
628
628
  "Error while attempting to dynamically import component BlockStyles at ../block/components/block-styles.vue",
629
629
  e
630
630
  ), e;
631
- }), Xt = () => import("./block.4db8867b.js").then((e) => e.default).catch((e) => {
631
+ }), Xt = () => import("./block.32028ed9.js").then((e) => e.default).catch((e) => {
632
632
  throw console.error(
633
633
  "Error while attempting to dynamically import component Block at ../block/block.vue",
634
634
  e
635
635
  ), e;
636
- }), qt = () => import("./blocks-wrapper.88129f1c.js").then((e) => e.default).catch((e) => {
636
+ }), qt = () => import("./blocks-wrapper.545648f8.js").then((e) => e.default).catch((e) => {
637
637
  throw console.error(
638
638
  "Error while attempting to dynamically import component BlocksWrapper at ./blocks-wrapper.vue",
639
639
  e
@@ -769,7 +769,7 @@ const se = (e) => e === "react" || e === "reactNative", W = se(w), K = "builderI
769
769
  window.${L} = ${t}
770
770
  `;
771
771
  }, ae = (e, t) => `
772
- window.${K}("${t}",${JSON.stringify(e)}, ${W})`, mn = ({
772
+ window.${K}("${t}",${JSON.stringify(e)}, ${W})`, pn = ({
773
773
  contentId: e,
774
774
  variationId: t
775
775
  }) => `
@@ -907,17 +907,17 @@ const se = (e) => e === "react" || e === "reactNative", W = se(w), K = "builderI
907
907
  ...e,
908
908
  ...r
909
909
  };
910
- }, ye = () => import("./content.d83d212f.js").then((e) => e.default).catch((e) => {
910
+ }, ye = () => import("./content.f9bd5fcb.js").then((e) => e.default).catch((e) => {
911
911
  throw console.error(
912
912
  "Error while attempting to dynamically import component ContentComponent at ../content/content.vue",
913
913
  e
914
914
  ), e;
915
- }), ve = () => import("./inlined-styles.32485f82.js").then((e) => e.default).catch((e) => {
915
+ }), ve = () => import("./inlined-styles.1f1d5537.js").then((e) => e.default).catch((e) => {
916
916
  throw console.error(
917
917
  "Error while attempting to dynamically import component InlinedStyles at ../inlined-styles.vue",
918
918
  e
919
919
  ), e;
920
- }), Se = () => import("./inlined-script.1b247526.js").then((e) => e.default).catch((e) => {
920
+ }), Se = () => import("./inlined-script.502cfeff.js").then((e) => e.default).catch((e) => {
921
921
  throw console.error(
922
922
  "Error while attempting to dynamically import component InlinedScript at ../inlined-script.vue",
923
923
  e
@@ -1004,23 +1004,23 @@ var xe = function() {
1004
1004
  const q = Ce.exports, $e = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1005
1005
  __proto__: null,
1006
1006
  default: q
1007
- }, Symbol.toStringTag, { value: "Module" })), pn = M, fn = q;
1007
+ }, Symbol.toStringTag, { value: "Module" })), fn = M, hn = q;
1008
1008
  function Te() {
1009
1009
  return y() && window.self !== window.top;
1010
1010
  }
1011
1011
  function Q() {
1012
1012
  return Te() && window.location.search.indexOf("builder.frameEditing=") !== -1;
1013
1013
  }
1014
- function hn() {
1014
+ function _n() {
1015
1015
  return !y() || Q() ? !1 : Boolean(location.search.indexOf("builder.preview=") !== -1);
1016
1016
  }
1017
- const _n = [], bn = (e) => ({
1017
+ const bn = [], gn = (e) => ({
1018
1018
  type: "builder.registerComponent",
1019
- data: e
1019
+ data: Ae(e)
1020
1020
  }), Ie = (e) => {
1021
1021
  const t = e.toString().trim();
1022
1022
  return `return (${!t.startsWith("function") && !t.startsWith("(") ? "function " : ""}${t}).apply(this, arguments)`;
1023
- }, Re = (e) => typeof e == "function" ? Ie(e) : P(e), gn = ({
1023
+ }, Re = (e) => typeof e == "function" ? Ie(e) : P(e), Ae = ({
1024
1024
  inputs: e,
1025
1025
  ...t
1026
1026
  }) => ({
@@ -1058,17 +1058,17 @@ function vn(e) {
1058
1058
  parent.postMessage(t, "*");
1059
1059
  }
1060
1060
  }
1061
- function Ae() {
1061
+ function Pe() {
1062
1062
  return typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : globalThis;
1063
1063
  }
1064
- function Pe() {
1065
- const e = Ae().fetch;
1064
+ function Ve() {
1065
+ const e = Pe().fetch;
1066
1066
  if (typeof e > "u")
1067
1067
  throw console.warn(`Builder SDK could not find a global fetch function. Make sure you have a polyfill for fetch in your project.
1068
1068
  For more information, read https://github.com/BuilderIO/this-package-uses-fetch`), new Error("Builder SDK could not find a global `fetch` function");
1069
1069
  return e;
1070
1070
  }
1071
- const Ve = Pe();
1071
+ const Oe = Ve();
1072
1072
  function R(e, t = null, n = ".") {
1073
1073
  return Object.keys(e).reduce((o, r) => {
1074
1074
  const s = e[r], i = [t, r].filter(Boolean).join(n);
@@ -1081,7 +1081,7 @@ function R(e, t = null, n = ".") {
1081
1081
  };
1082
1082
  }, {});
1083
1083
  }
1084
- const F = "builder.", Oe = "options.", Ee = (e) => {
1084
+ const F = "builder.", Ee = "options.", Be = (e) => {
1085
1085
  const t = {};
1086
1086
  return e.forEach((n, o) => {
1087
1087
  t[o] = n;
@@ -1092,16 +1092,16 @@ const F = "builder.", Oe = "options.", Ee = (e) => {
1092
1092
  const t = Z(e), n = {};
1093
1093
  return Object.keys(t).forEach((o) => {
1094
1094
  if (o.startsWith(F)) {
1095
- const r = o.replace(F, "").replace(Oe, "");
1095
+ const r = o.replace(F, "").replace(Ee, "");
1096
1096
  n[r] = t[o];
1097
1097
  }
1098
1098
  }), n;
1099
- }, Be = () => {
1099
+ }, je = () => {
1100
1100
  if (!y())
1101
1101
  return {};
1102
1102
  const e = new URLSearchParams(window.location.search);
1103
1103
  return Y(e);
1104
- }, Z = (e) => e instanceof URLSearchParams ? Ee(e) : e, je = "v3", O = (e) => {
1104
+ }, Z = (e) => e instanceof URLSearchParams ? Be(e) : e, Ne = "v3", O = (e) => {
1105
1105
  const {
1106
1106
  limit: t = 30,
1107
1107
  userAttributes: n,
@@ -1112,14 +1112,14 @@ const F = "builder.", Oe = "options.", Ee = (e) => {
1112
1112
  includeRefs: u = !0,
1113
1113
  enrich: a,
1114
1114
  locale: d,
1115
- apiVersion: p = je
1115
+ apiVersion: p = Ne
1116
1116
  } = e;
1117
1117
  if (!i)
1118
1118
  throw new Error("Missing API key");
1119
1119
  if (!["v2", "v3"].includes(p))
1120
1120
  throw new Error(`Invalid apiVersion: expected 'v2' or 'v3', received '${p}'`);
1121
1121
  const f = new URL(`https://cdn.builder.io/api/${p}/content/${s}?apiKey=${i}&limit=${t}&noTraverse=${r}&includeRefs=${u}${d ? `&locale=${d}` : ""}${a ? `&enrich=${a}` : ""}`), c = {
1122
- ...Be(),
1122
+ ...je(),
1123
1123
  ...Z(e.options || {})
1124
1124
  }, m = R(c);
1125
1125
  for (const l in m)
@@ -1132,7 +1132,7 @@ const F = "builder.", Oe = "options.", Ee = (e) => {
1132
1132
  f.searchParams.set(h, JSON.stringify(l[h]));
1133
1133
  }
1134
1134
  return f;
1135
- }, Ne = (e) => "results" in e;
1135
+ }, Fe = (e) => "results" in e;
1136
1136
  async function E(e) {
1137
1137
  const t = await tt({
1138
1138
  ...e,
@@ -1140,10 +1140,10 @@ async function E(e) {
1140
1140
  });
1141
1141
  return t && t.results[0] || null;
1142
1142
  }
1143
- const Sn = E, Fe = async (e) => {
1143
+ const Sn = E, Ue = async (e) => {
1144
1144
  const t = O(e);
1145
- return await (await Ve(t.href)).json();
1146
- }, Ue = async (e, t, n = O(e)) => {
1145
+ return await (await Oe(t.href)).json();
1146
+ }, Me = async (e, t, n = O(e)) => {
1147
1147
  const o = I(e.canTrack);
1148
1148
  if (n.search.includes("preview="), !o || !(y() || w === "reactNative"))
1149
1149
  return t;
@@ -1162,8 +1162,8 @@ const Sn = E, Fe = async (e) => {
1162
1162
  };
1163
1163
  async function tt(e) {
1164
1164
  try {
1165
- const t = O(e), n = await Fe(e);
1166
- return Ne(n) ? Ue(e, n) : (v.error("Error fetching data. ", {
1165
+ const t = O(e), n = await Ue(e);
1166
+ return Fe(n) ? Me(e, n) : (v.error("Error fetching data. ", {
1167
1167
  url: t,
1168
1168
  content: n,
1169
1169
  options: e
@@ -1173,16 +1173,16 @@ async function tt(e) {
1173
1173
  }
1174
1174
  }
1175
1175
  const kn = tt;
1176
- function Me() {
1176
+ function We() {
1177
1177
  return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) {
1178
1178
  const t = Math.random() * 16 | 0;
1179
1179
  return (e == "x" ? t : t & 3 | 8).toString(16);
1180
1180
  });
1181
1181
  }
1182
1182
  function et() {
1183
- return Me().replace(/-/g, "");
1183
+ return We().replace(/-/g, "");
1184
1184
  }
1185
- const nt = "builderSessionId", We = async ({
1185
+ const nt = "builderSessionId", Ke = async ({
1186
1186
  canTrack: e
1187
1187
  }) => {
1188
1188
  if (!e)
@@ -1194,20 +1194,20 @@ const nt = "builderSessionId", We = async ({
1194
1194
  if (x(t))
1195
1195
  return t;
1196
1196
  {
1197
- const n = Ke();
1198
- return Le({
1197
+ const n = Le();
1198
+ return ze({
1199
1199
  id: n,
1200
1200
  canTrack: e
1201
1201
  }), n;
1202
1202
  }
1203
- }, Ke = () => et(), Le = ({
1203
+ }, Le = () => et(), ze = ({
1204
1204
  id: e,
1205
1205
  canTrack: t
1206
1206
  }) => D({
1207
1207
  name: nt,
1208
1208
  value: e,
1209
1209
  canTrack: t
1210
- }), ot = () => y() && typeof localStorage < "u" ? localStorage : void 0, ze = ({
1210
+ }), ot = () => y() && typeof localStorage < "u" ? localStorage : void 0, Ge = ({
1211
1211
  key: e,
1212
1212
  canTrack: t
1213
1213
  }) => {
@@ -1218,7 +1218,7 @@ const nt = "builderSessionId", We = async ({
1218
1218
  console.debug("[LocalStorage] GET error: ", o);
1219
1219
  return;
1220
1220
  }
1221
- }, Ge = ({
1221
+ }, De = ({
1222
1222
  key: e,
1223
1223
  canTrack: t,
1224
1224
  value: n
@@ -1229,39 +1229,39 @@ const nt = "builderSessionId", We = async ({
1229
1229
  } catch (r) {
1230
1230
  console.debug("[LocalStorage] SET error: ", r);
1231
1231
  }
1232
- }, rt = "builderVisitorId", De = ({
1232
+ }, rt = "builderVisitorId", He = ({
1233
1233
  canTrack: e
1234
1234
  }) => {
1235
1235
  if (!e)
1236
1236
  return;
1237
- const t = ze({
1237
+ const t = Ge({
1238
1238
  key: rt,
1239
1239
  canTrack: e
1240
1240
  });
1241
1241
  if (x(t))
1242
1242
  return t;
1243
1243
  {
1244
- const n = He();
1245
- return Je({
1244
+ const n = Je();
1245
+ return Xe({
1246
1246
  id: n,
1247
1247
  canTrack: e
1248
1248
  }), n;
1249
1249
  }
1250
- }, He = () => et(), Je = ({
1250
+ }, Je = () => et(), Xe = ({
1251
1251
  id: e,
1252
1252
  canTrack: t
1253
- }) => Ge({
1253
+ }) => De({
1254
1254
  key: rt,
1255
1255
  value: e,
1256
1256
  canTrack: t
1257
- }), Xe = () => {
1257
+ }), qe = () => {
1258
1258
  if (y()) {
1259
1259
  const e = new URL(location.href);
1260
1260
  return e.pathname === "" && (e.pathname = "/"), e;
1261
1261
  } else
1262
1262
  return console.warn("Cannot get location for tracking in non-browser environment"), null;
1263
- }, qe = () => typeof navigator == "object" && navigator.userAgent || "", Qe = () => {
1264
- const e = qe(), t = {
1263
+ }, Qe = () => typeof navigator == "object" && navigator.userAgent || "", Ye = () => {
1264
+ const e = Qe(), t = {
1265
1265
  Android() {
1266
1266
  return e.match(/Android/i);
1267
1267
  },
@@ -1280,13 +1280,13 @@ const nt = "builderSessionId", We = async ({
1280
1280
  any() {
1281
1281
  return t.Android() || t.BlackBerry() || t.iOS() || t.Opera() || t.Windows() || w === "reactNative";
1282
1282
  }
1283
- }, n = e.match(/Tablet|iPad/i), o = Xe();
1283
+ }, n = e.match(/Tablet|iPad/i), o = qe();
1284
1284
  return {
1285
1285
  urlPath: o == null ? void 0 : o.pathname,
1286
1286
  host: (o == null ? void 0 : o.host) || (o == null ? void 0 : o.hostname),
1287
1287
  device: n ? "tablet" : t.any() ? "mobile" : "desktop"
1288
1288
  };
1289
- }, Ye = async ({
1289
+ }, Ze = async ({
1290
1290
  canTrack: e
1291
1291
  }) => {
1292
1292
  if (!e)
@@ -1294,16 +1294,16 @@ const nt = "builderSessionId", We = async ({
1294
1294
  visitorId: void 0,
1295
1295
  sessionId: void 0
1296
1296
  };
1297
- const t = await We({
1297
+ const t = await Ke({
1298
1298
  canTrack: e
1299
- }), n = De({
1299
+ }), n = He({
1300
1300
  canTrack: e
1301
1301
  });
1302
1302
  return {
1303
1303
  sessionId: t,
1304
1304
  visitorId: n
1305
1305
  };
1306
- }, Ze = async ({
1306
+ }, tn = async ({
1307
1307
  type: e,
1308
1308
  canTrack: t,
1309
1309
  apiKey: n,
@@ -1317,14 +1317,14 @@ const nt = "builderSessionId", We = async ({
1317
1317
  url: location.href,
1318
1318
  ...o
1319
1319
  },
1320
- ...await Ye({
1320
+ ...await Ze({
1321
1321
  canTrack: t
1322
1322
  }),
1323
- userAttributes: Qe(),
1323
+ userAttributes: Ye(),
1324
1324
  ownerId: n
1325
1325
  }
1326
1326
  });
1327
- async function tn(e) {
1327
+ async function en(e) {
1328
1328
  if (!e.apiKey) {
1329
1329
  v.error("Missing API key for track call. Please provide your API key.");
1330
1330
  return;
@@ -1333,7 +1333,7 @@ async function tn(e) {
1333
1333
  return fetch("https://cdn.builder.io/api/v1/track", {
1334
1334
  method: "POST",
1335
1335
  body: JSON.stringify({
1336
- events: [await Ze(e)]
1336
+ events: [await tn(e)]
1337
1337
  }),
1338
1338
  headers: {
1339
1339
  "content-type": "application/json"
@@ -1343,7 +1343,7 @@ async function tn(e) {
1343
1343
  console.error("Failed to track: ", t);
1344
1344
  });
1345
1345
  }
1346
- const xn = (e) => tn({
1346
+ const xn = (e) => en({
1347
1347
  ...e,
1348
1348
  canTrack: !0
1349
1349
  }), wn = async (e) => {
@@ -1368,45 +1368,45 @@ const xn = (e) => tn({
1368
1368
  };
1369
1369
  export {
1370
1370
  Y as A,
1371
- nn as B,
1372
- rn as C,
1371
+ on as B,
1372
+ sn as C,
1373
1373
  xn as D,
1374
1374
  wn as E,
1375
- sn as F,
1375
+ an as F,
1376
1376
  M as G,
1377
1377
  q as H,
1378
- an as I,
1379
- fn as J,
1378
+ cn as I,
1379
+ hn as J,
1380
1380
  ee as K,
1381
- pn as R,
1382
- cn as S,
1381
+ fn as R,
1382
+ ln as S,
1383
1383
  w as T,
1384
- dn as V,
1385
- tn as _,
1386
- on as a,
1384
+ mn as V,
1385
+ en as _,
1386
+ rn as a,
1387
1387
  Q as b,
1388
1388
  x as c,
1389
1389
  A as d,
1390
- ln as e,
1390
+ un as e,
1391
1391
  P as f,
1392
1392
  lt as g,
1393
- un as h,
1393
+ dn as h,
1394
1394
  y as i,
1395
- mn as j,
1396
- _n as k,
1395
+ pn as j,
1396
+ bn as k,
1397
1397
  v as l,
1398
1398
  Ht as m,
1399
1399
  g as n,
1400
1400
  Gt as o,
1401
- hn as p,
1402
- E as q,
1401
+ gn as p,
1402
+ _n as q,
1403
1403
  yn as r,
1404
- gn as s,
1405
- Ve as t,
1406
- bn as u,
1404
+ Ae as s,
1405
+ E as t,
1406
+ Oe as u,
1407
1407
  vn as v,
1408
1408
  tt as w,
1409
1409
  kn as x,
1410
1410
  Sn as y,
1411
- Ue as z
1411
+ Me as z
1412
1412
  };