@chaibuilder/pages 0.16.0 → 0.16.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/dist/{2AITGKQY-BxEty5Ow.cjs → 2AITGKQY-8xBkB8Pv.cjs} +1 -1
  2. package/dist/{2AITGKQY-BFankGad.js → 2AITGKQY-DI5Po2Nc.js} +2 -2
  3. package/dist/{NCMVHL6D-DP-qw6yT.cjs → NCMVHL6D-B4xqJIpr.cjs} +1 -1
  4. package/dist/{NCMVHL6D-DFMKkQPN.js → NCMVHL6D-kHUQxG8D.js} +2 -2
  5. package/dist/{ZDWCUMSJ-Cu1VTliO.cjs → ZDWCUMSJ-CjlhoCfQ.cjs} +1 -1
  6. package/dist/{ZDWCUMSJ-DU81uAQq.js → ZDWCUMSJ-DRgY2Er1.js} +1 -1
  7. package/dist/{add-new-language-page-0zC1CJZK.js → add-new-language-page-DSB8ohdj.js} +2 -2
  8. package/dist/{add-new-language-page-DQ46xqnc.cjs → add-new-language-page-noBKABVx.cjs} +1 -1
  9. package/dist/{add-new-page-CUtZhDvi.js → add-new-page-BYkFbQvH.js} +1 -1
  10. package/dist/{add-new-page-Ca2H2J-2.cjs → add-new-page-CByS9KqS.cjs} +1 -1
  11. package/dist/ai-panel-content-BBnzp4fO.cjs +1 -0
  12. package/dist/ai-panel-content-DET3HjIR.js +54 -0
  13. package/dist/ai-panel-default-lang-BYfcAA8u.js +178 -0
  14. package/dist/ai-panel-default-lang-D-RS6z5I.cjs +1 -0
  15. package/dist/ai-panel-other-lang-BoD4FsoG.cjs +1 -0
  16. package/dist/ai-panel-other-lang-TVjNYPRK.js +150 -0
  17. package/dist/{ai-panel-quick-prompts-DiNVPPAn.cjs → ai-panel-quick-prompts-BGBdrdP7.cjs} +1 -1
  18. package/dist/{ai-panel-quick-prompts-CpzN48cl.js → ai-panel-quick-prompts-BPrA9nvg.js} +1 -1
  19. package/dist/ai-prompt-input-DB1FpA_q.cjs +1 -0
  20. package/dist/ai-prompt-input-qegCvwnu.js +222 -0
  21. package/dist/ai-translation-prompt--HB1UAhC.js +28 -0
  22. package/dist/ai-translation-prompt-Bj-AM4xK.cjs +1 -0
  23. package/dist/{delete-page-BS10zPLU.js → delete-page-C7xfkDN5.js} +1 -1
  24. package/dist/{delete-page-ClgtvB6n.cjs → delete-page-DJLNpUxo.cjs} +1 -1
  25. package/dist/{digital-asset-manager-MK8ZL6Nd.cjs → digital-asset-manager-BblMbig0.cjs} +1 -1
  26. package/dist/{digital-asset-manager-D_FFLECK.js → digital-asset-manager-INrgGoC0.js} +1 -1
  27. package/dist/{duplicate-page-C1r4cCIJ.js → duplicate-page-B8k4yZxa.js} +2 -2
  28. package/dist/{duplicate-page-BaZrekqu.cjs → duplicate-page-C9XewuHN.cjs} +1 -1
  29. package/dist/{dynamic-page-selector-CjtnFkxO.js → dynamic-page-selector-C7Vos5-l.js} +1 -1
  30. package/dist/{dynamic-page-selector-C4R_vhhz.cjs → dynamic-page-selector-CYYnEngT.cjs} +1 -1
  31. package/dist/index-CyHmr87X.cjs +5 -0
  32. package/dist/{index-D_qadcqD.js → index-DRQI9rlW.js} +864 -858
  33. package/dist/index.cjs +1 -1
  34. package/dist/index.js +1 -1
  35. package/dist/{json-diff-viewer-BURQmaIL.js → json-diff-viewer-8vUwU0Sk.js} +1 -1
  36. package/dist/{json-diff-viewer-CyZVbnpL.cjs → json-diff-viewer-DVskWjAL.cjs} +1 -1
  37. package/dist/{lang-panel-C8yx7PSU.js → lang-panel-B8SeKnwN.js} +2 -2
  38. package/dist/{lang-panel-SUARS5YU.cjs → lang-panel-BeyCHr4u.cjs} +1 -1
  39. package/dist/{mark-as-template-CUHypMlj.js → mark-as-template-CpNHtyfB.js} +1 -1
  40. package/dist/{mark-as-template-DS-nfI06.cjs → mark-as-template-DTEF_hyN.cjs} +1 -1
  41. package/dist/{no-language-page-content-qoHrlxwD.js → no-language-page-content-BPiFDGJr.js} +1 -1
  42. package/dist/{no-language-page-content-DZj3cmtM.cjs → no-language-page-content-DnAP2ICP.cjs} +1 -1
  43. package/dist/{page-creator-HwE9ST54.cjs → page-creator-BawPgFIv.cjs} +1 -1
  44. package/dist/{page-creator-C8VQGfap.js → page-creator-BiDN-rLc.js} +2 -2
  45. package/dist/{page-lock-request-CBVKtxVj.js → page-lock-request-BVYclE6H.js} +1 -1
  46. package/dist/{page-lock-request-Db7-x_EI.cjs → page-lock-request-wIw-W5qT.cjs} +1 -1
  47. package/dist/{page-locked-by-dialog-DEC58QPA.js → page-locked-by-dialog-CuHvd48D.js} +1 -1
  48. package/dist/{page-locked-by-dialog-CvRDaBcN.cjs → page-locked-by-dialog-jZDY0omZ.cjs} +1 -1
  49. package/dist/{page-manager-new-CBxSkcYY.cjs → page-manager-new-BmZlPcpL.cjs} +1 -1
  50. package/dist/{page-manager-new-B1PDwz2w.js → page-manager-new-kMwd9hkH.js} +2 -2
  51. package/dist/{page-manager-search-and-filter-0eTSE1C1.js → page-manager-search-and-filter-BU-1wFbM.js} +1 -1
  52. package/dist/{page-manager-search-and-filter-BRLPHE64.cjs → page-manager-search-and-filter-DMauRN5Y.cjs} +1 -1
  53. package/dist/{page-revisions-content-CTrVTQ_s.cjs → page-revisions-content-BH0Xy_k9.cjs} +1 -1
  54. package/dist/{page-revisions-content-CKcp4He4.js → page-revisions-content-c32By7XR.js} +2 -2
  55. package/dist/{prompt-helper-BtijECyh.cjs → prompt-helper-BLBZjr5q.cjs} +3 -3
  56. package/dist/{prompt-helper-CfyAlam9.js → prompt-helper-Bh7WyDYo.js} +31 -19
  57. package/dist/{publish-pages-content-B6HGaUtO.cjs → publish-pages-content-B5UqPZy0.cjs} +1 -1
  58. package/dist/{publish-pages-content-BMaeNHV2.js → publish-pages-content-BB6l92oG.js} +2 -2
  59. package/dist/{save-to-lib-BKKTPv4h.cjs → save-to-lib-DM1MzZTb.cjs} +1 -1
  60. package/dist/{save-to-lib-CccnzwO8.js → save-to-lib-NvQZll63.js} +1 -1
  61. package/dist/{seo-panel-4KK4r-BP.js → seo-panel-BsMBb5Ep.js} +1 -1
  62. package/dist/{seo-panel-DL_rcWwC.cjs → seo-panel-C20m5SFc.cjs} +1 -1
  63. package/dist/server.cjs +11 -8
  64. package/dist/server.d.ts +2 -1
  65. package/dist/server.js +144 -141
  66. package/dist/{shared-json-ld-DGW40Ccy.js → shared-json-ld-BVqIgANo.js} +1 -1
  67. package/dist/{shared-json-ld-BuYzbmKx.cjs → shared-json-ld-CfWO90c0.cjs} +1 -1
  68. package/dist/{slug-input--8SgDwYu.cjs → slug-input-BewLv-d8.cjs} +1 -1
  69. package/dist/{slug-input-DH5w0H22.js → slug-input-RCGUFL2T.js} +1 -1
  70. package/dist/{theme-panel-footer-Co5VI_i9.cjs → theme-panel-footer-8oSQtfZ5.cjs} +1 -1
  71. package/dist/{theme-panel-footer-CHR7J97n.js → theme-panel-footer-BJB36k8A.js} +1 -1
  72. package/dist/{unmark-as-template-DlA879QF.js → unmark-as-template-CGZ0CCI2.js} +1 -1
  73. package/dist/{unmark-as-template-B3h10oHA.cjs → unmark-as-template-DLNmyum3.cjs} +1 -1
  74. package/dist/{unpublish-page-Bfo_DuW5.cjs → unpublish-page-B_xQPGsZ.cjs} +1 -1
  75. package/dist/{unpublish-page-JzGl35pF.js → unpublish-page-CEtpcrvc.js} +1 -1
  76. package/dist/{web-preview-CJ6JyhJD.js → web-preview-CCGkTRU3.js} +1 -1
  77. package/dist/{web-preview-oG2epixb.cjs → web-preview-Cifi0bwK.cjs} +1 -1
  78. package/package.json +1 -1
  79. package/dist/ai-panel-content-CV-HTsAs.cjs +0 -1
  80. package/dist/ai-panel-content-r2jlUBoR.js +0 -52
  81. package/dist/ai-panel-default-lang-D6RAQW1X.js +0 -173
  82. package/dist/ai-panel-default-lang-EH3w6g25.cjs +0 -1
  83. package/dist/ai-panel-other-lang-BeTdv7yM.js +0 -133
  84. package/dist/ai-panel-other-lang-_gGQTjZQ.cjs +0 -1
  85. package/dist/ai-prompt-input-D-F23bdc.cjs +0 -1
  86. package/dist/ai-prompt-input-vAcIZSB1.js +0 -133
  87. package/dist/ai-translation-prompt-AImJlmDg.cjs +0 -1
  88. package/dist/ai-translation-prompt-BKyp1IW2.js +0 -63
  89. package/dist/index-C64wG61b.cjs +0 -5
package/dist/server.js CHANGED
@@ -126,6 +126,9 @@ Create pure HTML code only. Make it fully responsive using Tailwind CSS v3 class
126
126
  - Ensure the svg has appropriate width and height.
127
127
  - Ensure the svg has appropriate viewBox.
128
128
 
129
+ ## Border radius
130
+ - Use "rounded-md" class for rounded corners which is shadcn theme class
131
+
129
132
  ## THEME RULES (MANDATORY - SHADCN + TAILWIND ONLY) [EXTREMELY IMPORTANT]
130
133
  - MANDATORY: Use ONLY ShadCN semantic tokens + Tailwind utilities for ALL colors.
131
134
  * COLOR TOKENS (Light Mode Reference):
@@ -393,10 +396,10 @@ function xi(e) {
393
396
  function m(w) {
394
397
  const v = s ? w.replace(/^\xEF\xBB\xBF/, "") : w, [l, g] = ki(`${o}${v}`);
395
398
  for (const y of l)
396
- _(y);
399
+ b(y);
397
400
  o = g, s = !1;
398
401
  }
399
- function _(w) {
402
+ function b(w) {
400
403
  if (w === "") {
401
404
  p();
402
405
  return;
@@ -408,12 +411,12 @@ function xi(e) {
408
411
  const v = w.indexOf(":");
409
412
  if (v !== -1) {
410
413
  const l = w.slice(0, v), g = w[v + 1] === " " ? 2 : 1, y = w.slice(v + g);
411
- b(l, y, w);
414
+ _(l, y, w);
412
415
  return;
413
416
  }
414
- b(w, "", w);
417
+ _(w, "", w);
415
418
  }
416
- function b(w, v, l) {
419
+ function _(w, v, l) {
417
420
  switch (w) {
418
421
  case "event":
419
422
  c = v;
@@ -455,7 +458,7 @@ function xi(e) {
455
458
  }), i = void 0, u = "", c = "";
456
459
  }
457
460
  function f(w = {}) {
458
- o && w.consume && _(o), s = !0, i = void 0, u = "", c = "", o = "";
461
+ o && w.consume && b(o), s = !0, i = void 0, u = "", c = "", o = "";
459
462
  }
460
463
  return { feed: m, reset: f };
461
464
  }
@@ -1223,23 +1226,23 @@ const Pu = {
1223
1226
  else {
1224
1227
  const o = (s, i, u) => {
1225
1228
  let c = ot(s), m;
1226
- for (const _ of i) {
1227
- if (_._zod.def.when) {
1228
- if (!_._zod.def.when(s))
1229
+ for (const b of i) {
1230
+ if (b._zod.def.when) {
1231
+ if (!b._zod.def.when(s))
1229
1232
  continue;
1230
1233
  } else if (c)
1231
1234
  continue;
1232
- const b = s.issues.length, p = _._zod.check(s);
1235
+ const _ = s.issues.length, p = b._zod.check(s);
1233
1236
  if (p instanceof Promise && (u == null ? void 0 : u.async) === !1)
1234
1237
  throw new ut();
1235
1238
  if (m || p instanceof Promise)
1236
1239
  m = (m ?? Promise.resolve()).then(async () => {
1237
- await p, s.issues.length !== b && (c || (c = ot(s, b)));
1240
+ await p, s.issues.length !== _ && (c || (c = ot(s, _)));
1238
1241
  });
1239
1242
  else {
1240
- if (s.issues.length === b)
1243
+ if (s.issues.length === _)
1241
1244
  continue;
1242
- c || (c = ot(s, b));
1245
+ c || (c = ot(s, _));
1243
1246
  }
1244
1247
  }
1245
1248
  return m ? m.then(() => s) : s;
@@ -1568,45 +1571,45 @@ function xt(e, t, r, n) {
1568
1571
  const pc = /* @__PURE__ */ h("$ZodObject", (e, t) => {
1569
1572
  Z.init(e, t);
1570
1573
  const r = Dr(() => {
1571
- const _ = Object.keys(t.shape);
1572
- for (const p of _)
1574
+ const b = Object.keys(t.shape);
1575
+ for (const p of b)
1573
1576
  if (!t.shape[p]._zod.traits.has("$ZodType"))
1574
1577
  throw new Error(`Invalid element at key "${p}": expected a Zod schema`);
1575
- const b = Ci(t.shape);
1578
+ const _ = Ci(t.shape);
1576
1579
  return {
1577
1580
  shape: t.shape,
1578
- keys: _,
1579
- keySet: new Set(_),
1580
- numKeys: _.length,
1581
- optionalKeys: new Set(b)
1581
+ keys: b,
1582
+ keySet: new Set(b),
1583
+ numKeys: b.length,
1584
+ optionalKeys: new Set(_)
1582
1585
  };
1583
1586
  });
1584
1587
  C(e._zod, "propValues", () => {
1585
- const _ = t.shape, b = {};
1586
- for (const p in _) {
1587
- const f = _[p]._zod;
1588
+ const b = t.shape, _ = {};
1589
+ for (const p in b) {
1590
+ const f = b[p]._zod;
1588
1591
  if (f.values) {
1589
- b[p] ?? (b[p] = /* @__PURE__ */ new Set());
1592
+ _[p] ?? (_[p] = /* @__PURE__ */ new Set());
1590
1593
  for (const w of f.values)
1591
- b[p].add(w);
1594
+ _[p].add(w);
1592
1595
  }
1593
1596
  }
1594
- return b;
1597
+ return _;
1595
1598
  });
1596
- const n = (_) => {
1597
- const b = new Cu(["shape", "payload", "ctx"]), p = r.value, f = (g) => {
1599
+ const n = (b) => {
1600
+ const _ = new Cu(["shape", "payload", "ctx"]), p = r.value, f = (g) => {
1598
1601
  const y = wn(g);
1599
1602
  return `shape[${y}]._zod.run({ value: input[${y}], issues: [] }, ctx)`;
1600
1603
  };
1601
- b.write("const input = payload.value;");
1604
+ _.write("const input = payload.value;");
1602
1605
  const w = /* @__PURE__ */ Object.create(null);
1603
1606
  let v = 0;
1604
1607
  for (const g of p.keys)
1605
1608
  w[g] = `key_${v++}`;
1606
- b.write("const newResult = {}");
1609
+ _.write("const newResult = {}");
1607
1610
  for (const g of p.keys) {
1608
1611
  const y = w[g], d = wn(g);
1609
- b.write(`const ${y} = ${f(g)};`), b.write(`
1612
+ _.write(`const ${y} = ${f(g)};`), _.write(`
1610
1613
  if (${y}.issues.length) {
1611
1614
  payload.issues = payload.issues.concat(${y}.issues.map(iss => ({
1612
1615
  ...iss,
@@ -1623,36 +1626,36 @@ const pc = /* @__PURE__ */ h("$ZodObject", (e, t) => {
1623
1626
  }
1624
1627
  `);
1625
1628
  }
1626
- b.write("payload.value = newResult;"), b.write("return payload;");
1627
- const l = b.compile();
1628
- return (g, y) => l(_, g, y);
1629
+ _.write("payload.value = newResult;"), _.write("return payload;");
1630
+ const l = _.compile();
1631
+ return (g, y) => l(b, g, y);
1629
1632
  };
1630
1633
  let a;
1631
1634
  const o = zt, s = !Xa.jitless, u = s && Ni.value, c = t.catchall;
1632
1635
  let m;
1633
- e._zod.parse = (_, b) => {
1636
+ e._zod.parse = (b, _) => {
1634
1637
  m ?? (m = r.value);
1635
- const p = _.value;
1638
+ const p = b.value;
1636
1639
  if (!o(p))
1637
- return _.issues.push({
1640
+ return b.issues.push({
1638
1641
  expected: "object",
1639
1642
  code: "invalid_type",
1640
1643
  input: p,
1641
1644
  inst: e
1642
- }), _;
1645
+ }), b;
1643
1646
  const f = [];
1644
- if (s && u && (b == null ? void 0 : b.async) === !1 && b.jitless !== !0)
1645
- a || (a = n(t.shape)), _ = a(_, b);
1647
+ if (s && u && (_ == null ? void 0 : _.async) === !1 && _.jitless !== !0)
1648
+ a || (a = n(t.shape)), b = a(b, _);
1646
1649
  else {
1647
- _.value = {};
1650
+ b.value = {};
1648
1651
  const y = m.shape;
1649
1652
  for (const d of m.keys) {
1650
- const I = y[d]._zod.run({ value: p[d], issues: [] }, b);
1651
- I instanceof Promise ? f.push(I.then((x) => xt(x, _, d, p))) : xt(I, _, d, p);
1653
+ const I = y[d]._zod.run({ value: p[d], issues: [] }, _);
1654
+ I instanceof Promise ? f.push(I.then((x) => xt(x, b, d, p))) : xt(I, b, d, p);
1652
1655
  }
1653
1656
  }
1654
1657
  if (!c)
1655
- return f.length ? Promise.all(f).then(() => _) : _;
1658
+ return f.length ? Promise.all(f).then(() => b) : b;
1656
1659
  const w = [], v = m.keySet, l = c._zod, g = l.def.type;
1657
1660
  for (const y of Object.keys(p)) {
1658
1661
  if (v.has(y))
@@ -1661,15 +1664,15 @@ const pc = /* @__PURE__ */ h("$ZodObject", (e, t) => {
1661
1664
  w.push(y);
1662
1665
  continue;
1663
1666
  }
1664
- const d = l.run({ value: p[y], issues: [] }, b);
1665
- d instanceof Promise ? f.push(d.then((S) => xt(S, _, y, p))) : xt(d, _, y, p);
1667
+ const d = l.run({ value: p[y], issues: [] }, _);
1668
+ d instanceof Promise ? f.push(d.then((S) => xt(S, b, y, p))) : xt(d, b, y, p);
1666
1669
  }
1667
- return w.length && _.issues.push({
1670
+ return w.length && b.issues.push({
1668
1671
  code: "unrecognized_keys",
1669
1672
  keys: w,
1670
1673
  input: p,
1671
1674
  inst: e
1672
- }), f.length ? Promise.all(f).then(() => _) : _;
1675
+ }), f.length ? Promise.all(f).then(() => b) : b;
1673
1676
  };
1674
1677
  });
1675
1678
  function En(e, t, r, n) {
@@ -2516,7 +2519,7 @@ class zn {
2516
2519
  }), this.io = (t == null ? void 0 : t.io) ?? "output", this.seen = /* @__PURE__ */ new Map();
2517
2520
  }
2518
2521
  process(t, r = { path: [], schemaPath: [] }) {
2519
- var _, b, p;
2522
+ var b, _, p;
2520
2523
  var n;
2521
2524
  const a = t._zod.def, o = {
2522
2525
  guid: "uuid",
@@ -2530,7 +2533,7 @@ class zn {
2530
2533
  return s.count++, r.schemaPath.includes(t) && (s.cycle = r.path), s.schema;
2531
2534
  const i = { schema: {}, count: 1, cycle: void 0, path: r.path };
2532
2535
  this.seen.set(t, i);
2533
- const u = (b = (_ = t._zod).toJSONSchema) == null ? void 0 : b.call(_);
2536
+ const u = (_ = (b = t._zod).toJSONSchema) == null ? void 0 : _.call(b);
2534
2537
  if (u)
2535
2538
  i.schema = u;
2536
2539
  else {
@@ -2810,7 +2813,7 @@ class zn {
2810
2813
  return c && Object.assign(i.schema, c), this.io === "input" && G(t) && (delete i.schema.examples, delete i.schema.default), this.io === "input" && i.schema._prefault && ((n = i.schema).default ?? (n.default = i.schema._prefault)), delete i.schema._prefault, this.seen.get(t).schema;
2811
2814
  }
2812
2815
  emit(t, r) {
2813
- var m, _, b, p, f, w;
2816
+ var m, b, _, p, f, w;
2814
2817
  const n = {
2815
2818
  cycles: (r == null ? void 0 : r.cycles) ?? "ref",
2816
2819
  reused: (r == null ? void 0 : r.reused) ?? "inline",
@@ -2859,13 +2862,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
2859
2862
  continue;
2860
2863
  }
2861
2864
  if (n.external) {
2862
- const y = (_ = n.external.registry.get(v[0])) == null ? void 0 : _.id;
2865
+ const y = (b = n.external.registry.get(v[0])) == null ? void 0 : b.id;
2863
2866
  if (t !== v[0] && y) {
2864
2867
  s(v);
2865
2868
  continue;
2866
2869
  }
2867
2870
  }
2868
- if ((b = this.metadataRegistry.get(v[0])) == null ? void 0 : b.id) {
2871
+ if ((_ = this.metadataRegistry.get(v[0])) == null ? void 0 : _.id) {
2869
2872
  s(v);
2870
2873
  continue;
2871
2874
  }
@@ -4806,18 +4809,18 @@ var Pp = (e, t) => {
4806
4809
  var r;
4807
4810
  const n = Mp(t);
4808
4811
  let a = typeof t == "object" && t.definitions ? Object.entries(t.definitions).reduce(
4809
- (c, [m, _]) => {
4810
- var b;
4812
+ (c, [m, b]) => {
4813
+ var _;
4811
4814
  return {
4812
4815
  ...c,
4813
- [m]: (b = $(
4814
- _._def,
4816
+ [m]: (_ = $(
4817
+ b._def,
4815
4818
  {
4816
4819
  ...n,
4817
4820
  currentPath: [...n.basePath, n.definitionPath, m]
4818
4821
  },
4819
4822
  !0
4820
- )) != null ? b : te()
4823
+ )) != null ? _ : te()
4821
4824
  };
4822
4825
  },
4823
4826
  {}
@@ -4946,13 +4949,13 @@ var hr, Gn;
4946
4949
  function Jp() {
4947
4950
  if (Gn) return hr;
4948
4951
  Gn = 1;
4949
- var e = Object.defineProperty, t = Object.getOwnPropertyDescriptor, r = Object.getOwnPropertyNames, n = Object.prototype.hasOwnProperty, a = (m, _) => {
4950
- for (var b in _)
4951
- e(m, b, { get: _[b], enumerable: !0 });
4952
- }, o = (m, _, b, p) => {
4953
- if (typeof _ == "object" || typeof _ == "function")
4954
- for (let f of r(_))
4955
- !n.call(m, f) && f !== b && e(m, f, { get: () => _[f], enumerable: !(p = t(_, f)) || p.enumerable });
4952
+ var e = Object.defineProperty, t = Object.getOwnPropertyDescriptor, r = Object.getOwnPropertyNames, n = Object.prototype.hasOwnProperty, a = (m, b) => {
4953
+ for (var _ in b)
4954
+ e(m, _, { get: b[_], enumerable: !0 });
4955
+ }, o = (m, b, _, p) => {
4956
+ if (typeof b == "object" || typeof b == "function")
4957
+ for (let f of r(b))
4958
+ !n.call(m, f) && f !== _ && e(m, f, { get: () => b[f], enumerable: !(p = t(b, f)) || p.enumerable });
4956
4959
  return m;
4957
4960
  }, s = (m) => o(e({}, "__esModule", { value: !0 }), m), i = {};
4958
4961
  a(i, {
@@ -4961,8 +4964,8 @@ function Jp() {
4961
4964
  }), hr = s(i);
4962
4965
  const u = Symbol.for("@vercel/request-context");
4963
4966
  function c() {
4964
- var _, b;
4965
- return ((b = (_ = globalThis[u]) == null ? void 0 : _.get) == null ? void 0 : b.call(_)) ?? {};
4967
+ var b, _;
4968
+ return ((_ = (b = globalThis[u]) == null ? void 0 : b.get) == null ? void 0 : _.call(b)) ?? {};
4966
4969
  }
4967
4970
  return hr;
4968
4971
  }
@@ -4970,15 +4973,15 @@ var gr, qn;
4970
4973
  function Hp() {
4971
4974
  if (qn) return gr;
4972
4975
  qn = 1;
4973
- var e = Object.defineProperty, t = Object.getOwnPropertyDescriptor, r = Object.getOwnPropertyNames, n = Object.prototype.hasOwnProperty, a = (_, b) => {
4974
- for (var p in b)
4975
- e(_, p, { get: b[p], enumerable: !0 });
4976
- }, o = (_, b, p, f) => {
4977
- if (typeof b == "object" || typeof b == "function")
4978
- for (let w of r(b))
4979
- !n.call(_, w) && w !== p && e(_, w, { get: () => b[w], enumerable: !(f = t(b, w)) || f.enumerable });
4980
- return _;
4981
- }, s = (_) => o(e({}, "__esModule", { value: !0 }), _), i = {};
4976
+ var e = Object.defineProperty, t = Object.getOwnPropertyDescriptor, r = Object.getOwnPropertyNames, n = Object.prototype.hasOwnProperty, a = (b, _) => {
4977
+ for (var p in _)
4978
+ e(b, p, { get: _[p], enumerable: !0 });
4979
+ }, o = (b, _, p, f) => {
4980
+ if (typeof _ == "object" || typeof _ == "function")
4981
+ for (let w of r(_))
4982
+ !n.call(b, w) && w !== p && e(b, w, { get: () => _[w], enumerable: !(f = t(_, w)) || f.enumerable });
4983
+ return b;
4984
+ }, s = (b) => o(e({}, "__esModule", { value: !0 }), b), i = {};
4982
4985
  a(i, {
4983
4986
  getContext: () => u.getContext,
4984
4987
  getVercelOidcToken: () => c,
@@ -5552,7 +5555,7 @@ function yf(e = {}) {
5552
5555
  headers: u,
5553
5556
  fetch: e.fetch,
5554
5557
  o11yHeaders: c()
5555
- }), _ = async () => {
5558
+ }), b = async () => {
5556
5559
  var f, w, v;
5557
5560
  const l = (v = (w = (f = e._internal) == null ? void 0 : f.currentDate) == null ? void 0 : w.call(f).getTime()) != null ? v : Date.now();
5558
5561
  return (!n || l - s > o) && (s = l, n = new ha({
@@ -5565,7 +5568,7 @@ function yf(e = {}) {
5565
5568
  await ft(await u())
5566
5569
  );
5567
5570
  })), a ? Promise.resolve(a) : n;
5568
- }, b = async () => new ha({
5571
+ }, _ = async () => new ha({
5569
5572
  baseURL: i,
5570
5573
  headers: u,
5571
5574
  fetch: e.fetch
@@ -5581,7 +5584,7 @@ function yf(e = {}) {
5581
5584
  );
5582
5585
  return m(f);
5583
5586
  };
5584
- return p.getAvailableModels = _, p.getCredits = b, p.imageModel = (f) => {
5587
+ return p.getAvailableModels = b, p.getCredits = _, p.imageModel = (f) => {
5585
5588
  throw new Si({ modelId: f, modelType: "imageModel" });
5586
5589
  }, p.languageModel = m, p.textEmbeddingModel = (f) => new ff(f, {
5587
5590
  provider: "gateway",
@@ -5793,12 +5796,12 @@ var Of = function(e, t) {
5793
5796
  typeof o == "number" && (o = {
5794
5797
  logLevel: o
5795
5798
  });
5796
- var m = gt("diag"), _ = Af((i = o.logLevel) !== null && i !== void 0 ? i : ee.INFO, a);
5799
+ var m = gt("diag"), b = Af((i = o.logLevel) !== null && i !== void 0 ? i : ee.INFO, a);
5797
5800
  if (m && !o.suppressOverrideMessage) {
5798
- var b = (u = new Error().stack) !== null && u !== void 0 ? u : "<failed to generate stacktrace>";
5799
- m.warn("Current logger will be overwritten from " + b), _.warn("Current logger will overwrite one already registered from " + b);
5801
+ var _ = (u = new Error().stack) !== null && u !== void 0 ? u : "<failed to generate stacktrace>";
5802
+ m.warn("Current logger will be overwritten from " + _), b.warn("Current logger will overwrite one already registered from " + _);
5800
5803
  }
5801
- return Hr("diag", _, r, !0);
5804
+ return Hr("diag", b, r, !0);
5802
5805
  };
5803
5806
  r.setLogger = n, r.disable = function() {
5804
5807
  Yr(Rf, r);
@@ -7830,8 +7833,8 @@ function vh(e) {
7830
7833
  break;
7831
7834
  }
7832
7835
  case "INSIDE_LITERAL": {
7833
- const _ = e.substring(n, u + 1);
7834
- !"false".startsWith(_) && !"true".startsWith(_) && !"null".startsWith(_) ? (t.pop(), t[t.length - 1] === "INSIDE_OBJECT_AFTER_VALUE" ? o(c, u) : t[t.length - 1] === "INSIDE_ARRAY_AFTER_VALUE" && s(c, u)) : r = u;
7836
+ const b = e.substring(n, u + 1);
7837
+ !"false".startsWith(b) && !"true".startsWith(b) && !"null".startsWith(b) ? (t.pop(), t[t.length - 1] === "INSIDE_OBJECT_AFTER_VALUE" ? o(c, u) : t[t.length - 1] === "INSIDE_ARRAY_AFTER_VALUE" && s(c, u)) : r = u;
7835
7838
  break;
7836
7839
  }
7837
7840
  }
@@ -7906,7 +7909,7 @@ function _h({
7906
7909
  new TransformStream({
7907
7910
  async transform(i, u) {
7908
7911
  await n(async ({ state: c, write: m }) => {
7909
- var _, b, p, f;
7912
+ var b, _, p, f;
7910
7913
  function w(d) {
7911
7914
  const I = c.message.parts.filter(Sr).find(
7912
7915
  (x) => x.toolCallId === d
@@ -7986,12 +7989,12 @@ function _h({
7986
7989
  }
7987
7990
  case "text-delta": {
7988
7991
  const d = c.activeTextParts[i.id];
7989
- d.text += i.delta, d.providerMetadata = (_ = i.providerMetadata) != null ? _ : d.providerMetadata, m();
7992
+ d.text += i.delta, d.providerMetadata = (b = i.providerMetadata) != null ? b : d.providerMetadata, m();
7990
7993
  break;
7991
7994
  }
7992
7995
  case "text-end": {
7993
7996
  const d = c.activeTextParts[i.id];
7994
- d.state = "done", d.providerMetadata = (b = i.providerMetadata) != null ? b : d.providerMetadata, delete c.activeTextParts[i.id], m();
7997
+ d.state = "done", d.providerMetadata = (_ = i.providerMetadata) != null ? _ : d.providerMetadata, delete c.activeTextParts[i.id], m();
7995
7998
  break;
7996
7999
  }
7997
8000
  case "reasoning-start": {
@@ -8235,12 +8238,12 @@ function bh({
8235
8238
  let s = !1;
8236
8239
  const i = a.pipeThrough(
8237
8240
  new TransformStream({
8238
- transform(b, p) {
8239
- if (b.type === "start") {
8240
- const f = b;
8241
+ transform(_, p) {
8242
+ if (_.type === "start") {
8243
+ const f = _;
8241
8244
  f.messageId == null && e != null && (f.messageId = e);
8242
8245
  }
8243
- b.type === "abort" && (s = !0), p.enqueue(b);
8246
+ _.type === "abort" && (s = !0), p.enqueue(_);
8244
8247
  }
8245
8248
  })
8246
8249
  );
@@ -8250,22 +8253,22 @@ function bh({
8250
8253
  lastMessage: o ? structuredClone(o) : void 0,
8251
8254
  messageId: e ?? ""
8252
8255
  // will be overridden by the stream
8253
- }), c = async (b) => {
8254
- await b({ state: u, write: () => {
8256
+ }), c = async (_) => {
8257
+ await _({ state: u, write: () => {
8255
8258
  } });
8256
8259
  };
8257
8260
  let m = !1;
8258
- const _ = async () => {
8261
+ const b = async () => {
8259
8262
  if (m || !r)
8260
8263
  return;
8261
8264
  m = !0;
8262
- const b = u.message.id === (o == null ? void 0 : o.id);
8265
+ const _ = u.message.id === (o == null ? void 0 : o.id);
8263
8266
  await r({
8264
8267
  isAborted: s,
8265
- isContinuation: b,
8268
+ isContinuation: _,
8266
8269
  responseMessage: u.message,
8267
8270
  messages: [
8268
- ...b ? t.slice(0, -1) : t,
8271
+ ..._ ? t.slice(0, -1) : t,
8269
8272
  u.message
8270
8273
  ]
8271
8274
  });
@@ -8276,15 +8279,15 @@ function bh({
8276
8279
  onError: n
8277
8280
  }).pipeThrough(
8278
8281
  new TransformStream({
8279
- transform(b, p) {
8280
- p.enqueue(b);
8282
+ transform(_, p) {
8283
+ p.enqueue(_);
8281
8284
  },
8282
8285
  // @ts-expect-error cancel is still new and missing from types https://developer.mozilla.org/en-US/docs/Web/API/TransformStream#browser_compatibility
8283
8286
  async cancel() {
8284
- await _();
8287
+ await b();
8285
8288
  },
8286
8289
  async flush() {
8287
- await _();
8290
+ await b();
8288
8291
  }
8289
8292
  })
8290
8293
  );
@@ -8474,10 +8477,10 @@ function Ih({
8474
8477
  start(l) {
8475
8478
  c = l;
8476
8479
  }
8477
- }), _ = /* @__PURE__ */ new Set(), b = /* @__PURE__ */ new Map();
8480
+ }), b = /* @__PURE__ */ new Set(), _ = /* @__PURE__ */ new Map();
8478
8481
  let p = !1, f;
8479
8482
  function w() {
8480
- p && _.size === 0 && (f != null && c.enqueue(f), c.close());
8483
+ p && b.size === 0 && (f != null && c.enqueue(f), c.close());
8481
8484
  }
8482
8485
  const v = new TransformStream({
8483
8486
  async transform(l, g) {
@@ -8540,7 +8543,7 @@ function Ih({
8540
8543
  break;
8541
8544
  }
8542
8545
  const S = e[d.toolName];
8543
- if (b.set(d.toolCallId, d.input), S.onInputAvailable != null && await S.onInputAvailable({
8546
+ if (_.set(d.toolCallId, d.input), S.onInputAvailable != null && await S.onInputAvailable({
8544
8547
  input: d.input,
8545
8548
  toolCallId: d.toolCallId,
8546
8549
  messages: o,
@@ -8548,7 +8551,7 @@ function Ih({
8548
8551
  experimental_context: u
8549
8552
  }), S.execute != null && d.providerExecuted !== !0) {
8550
8553
  const I = Pd();
8551
- _.add(I), Zr({
8554
+ b.add(I), Zr({
8552
8555
  name: "ai.toolCall",
8553
8556
  attributes: Ve({
8554
8557
  telemetry: n,
@@ -8592,10 +8595,10 @@ function Ih({
8592
8595
  ...d,
8593
8596
  type: "tool-error",
8594
8597
  error: J
8595
- }), _.delete(I), w();
8598
+ }), b.delete(I), w();
8596
8599
  return;
8597
8600
  }
8598
- _.delete(I), w();
8601
+ b.delete(I), w();
8599
8602
  try {
8600
8603
  x.setAttributes(
8601
8604
  Ve({
@@ -8623,14 +8626,14 @@ function Ih({
8623
8626
  type: "tool-error",
8624
8627
  toolCallId: l.toolCallId,
8625
8628
  toolName: d,
8626
- input: b.get(l.toolCallId),
8629
+ input: _.get(l.toolCallId),
8627
8630
  providerExecuted: l.providerExecuted,
8628
8631
  error: l.result
8629
8632
  }) : g.enqueue({
8630
8633
  type: "tool-result",
8631
8634
  toolCallId: l.toolCallId,
8632
8635
  toolName: d,
8633
- input: b.get(l.toolCallId),
8636
+ input: _.get(l.toolCallId),
8634
8637
  output: l.result,
8635
8638
  providerExecuted: l.providerExecuted
8636
8639
  });
@@ -8688,8 +8691,8 @@ function kh({
8688
8691
  headers: u,
8689
8692
  stopWhen: c = lh(1),
8690
8693
  experimental_output: m,
8691
- experimental_telemetry: _,
8692
- prepareStep: b,
8694
+ experimental_telemetry: b,
8695
+ prepareStep: _,
8693
8696
  providerOptions: p,
8694
8697
  experimental_activeTools: f,
8695
8698
  activeTools: w = f,
@@ -8714,7 +8717,7 @@ function kh({
8714
8717
  }) {
8715
8718
  return new Oh({
8716
8719
  model: $s(e),
8717
- telemetry: _,
8720
+ telemetry: b,
8718
8721
  headers: u,
8719
8722
  settings: Ye,
8720
8723
  maxRetries: s,
@@ -8730,7 +8733,7 @@ function kh({
8730
8733
  stopConditions: wa(c),
8731
8734
  output: m,
8732
8735
  providerOptions: p,
8733
- prepareStep: b,
8736
+ prepareStep: _,
8734
8737
  includeRawChunks: y,
8735
8738
  onChunk: d,
8736
8739
  onError: S,
@@ -8807,8 +8810,8 @@ var Oh = class {
8807
8810
  messages: u,
8808
8811
  tools: c,
8809
8812
  toolChoice: m,
8810
- transforms: _,
8811
- activeTools: b,
8813
+ transforms: b,
8814
+ activeTools: _,
8812
8815
  repairToolCall: p,
8813
8816
  stopConditions: f,
8814
8817
  output: w,
@@ -9017,7 +9020,7 @@ var Oh = class {
9017
9020
  return We.stream.cancel(F);
9018
9021
  }
9019
9022
  });
9020
- for (const F of _)
9023
+ for (const F of b)
9021
9024
  tr = tr.pipeThrough(
9022
9025
  F({
9023
9026
  tools: c,
@@ -9085,7 +9088,7 @@ var Oh = class {
9085
9088
  }), { toolChoice: nr, tools: ar } = Um({
9086
9089
  tools: c,
9087
9090
  toolChoice: (Xe = de == null ? void 0 : de.toolChoice) != null ? Xe : m,
9088
- activeTools: (nn = de == null ? void 0 : de.activeTools) != null ? nn : b
9091
+ activeTools: (nn = de == null ? void 0 : de.activeTools) != null ? nn : _
9089
9092
  }), {
9090
9093
  result: { stream: Xs, response: un, request: cn },
9091
9094
  doStreamSpan: De,
@@ -9546,11 +9549,11 @@ var Oh = class {
9546
9549
  const c = t != null ? hh({
9547
9550
  originalMessages: e,
9548
9551
  responseMessageId: t
9549
- }) : void 0, m = {}, _ = (p) => {
9552
+ }) : void 0, m = {}, b = (p) => {
9550
9553
  var f, w;
9551
9554
  const v = m[p];
9552
9555
  return ((w = (f = this.tools) == null ? void 0 : f[v]) == null ? void 0 : w.type) === "dynamic" ? !0 : void 0;
9553
- }, b = this.fullStream.pipeThrough(
9556
+ }, _ = this.fullStream.pipeThrough(
9554
9557
  new TransformStream({
9555
9558
  transform: async (p, f) => {
9556
9559
  const w = n == null ? void 0 : n({ part: p }), v = p.type;
@@ -9632,7 +9635,7 @@ var Oh = class {
9632
9635
  }
9633
9636
  case "tool-input-start": {
9634
9637
  m[p.id] = p.toolName;
9635
- const l = _(p.id);
9638
+ const l = b(p.id);
9636
9639
  f.enqueue({
9637
9640
  type: "tool-input-start",
9638
9641
  toolCallId: p.id,
@@ -9652,7 +9655,7 @@ var Oh = class {
9652
9655
  }
9653
9656
  case "tool-call": {
9654
9657
  m[p.toolCallId] = p.toolName;
9655
- const l = _(p.toolCallId);
9658
+ const l = b(p.toolCallId);
9656
9659
  p.invalid ? f.enqueue({
9657
9660
  type: "tool-input-error",
9658
9661
  toolCallId: p.toolCallId,
@@ -9674,7 +9677,7 @@ var Oh = class {
9674
9677
  break;
9675
9678
  }
9676
9679
  case "tool-result": {
9677
- const l = _(p.toolCallId);
9680
+ const l = b(p.toolCallId);
9678
9681
  f.enqueue({
9679
9682
  type: "tool-output-available",
9680
9683
  toolCallId: p.toolCallId,
@@ -9686,7 +9689,7 @@ var Oh = class {
9686
9689
  break;
9687
9690
  }
9688
9691
  case "tool-error": {
9689
- const l = _(p.toolCallId);
9692
+ const l = b(p.toolCallId);
9690
9693
  f.enqueue({
9691
9694
  type: "tool-output-error",
9692
9695
  toolCallId: p.toolCallId,
@@ -9748,7 +9751,7 @@ var Oh = class {
9748
9751
  );
9749
9752
  return Ot(
9750
9753
  bh({
9751
- stream: b,
9754
+ stream: _,
9752
9755
  messageId: c ?? (t == null ? void 0 : t()),
9753
9756
  originalMessages: e,
9754
9757
  onFinish: r,
@@ -10013,15 +10016,15 @@ class Jh {
10013
10016
  this.options = t, this.model = (t == null ? void 0 : t.model) ?? this.model;
10014
10017
  }
10015
10018
  async handleRequest(t, r) {
10016
- var m, _;
10017
- const { messages: n, image: a, initiator: o = null } = t, s = n.filter((b) => b.role !== "system"), i = s[s.length - 1], u = a ? [
10018
- ...s.slice(0, -1),
10019
+ var _, p;
10020
+ const { messages: n, image: a, initiator: o = null, model: s } = t, i = s || this.model, u = n.filter((f) => f.role !== "system"), c = u[u.length - 1], m = a ? [
10021
+ ...u.slice(0, -1),
10019
10022
  {
10020
10023
  role: "user",
10021
10024
  content: [
10022
10025
  {
10023
10026
  type: "text",
10024
- text: i.content
10027
+ text: c.content
10025
10028
  },
10026
10029
  {
10027
10030
  type: "image",
@@ -10031,12 +10034,12 @@ class Jh {
10031
10034
  }
10032
10035
  ] : n;
10033
10036
  kh({
10034
- model: this.model,
10037
+ model: i,
10035
10038
  system: ci(o),
10036
- messages: u,
10039
+ messages: m,
10037
10040
  temperature: this.temperature,
10038
- onFinish: ((m = this.options) == null ? void 0 : m.onFinish) ?? mn,
10039
- onError: ((_ = this.options) == null ? void 0 : _.onError) ?? mn
10041
+ onFinish: ((_ = this.options) == null ? void 0 : _.onFinish) ?? mn,
10042
+ onError: ((p = this.options) == null ? void 0 : p.onError) ?? mn
10040
10043
  }).pipeTextStreamToResponse(r);
10041
10044
  }
10042
10045
  isConfigured() {
@@ -10208,7 +10211,7 @@ class ng {
10208
10211
  return this.draftMode;
10209
10212
  }
10210
10213
  async handle(t, r, n) {
10211
- var o, s, i, u, c, m, _, b, p, f, w, v;
10214
+ var o, s, i, u, c, m, b, _, p, f, w, v;
10212
10215
  switch (t.action) {
10213
10216
  // Media
10214
10217
  case "UPLOAD_ASSET":
@@ -10233,9 +10236,9 @@ class ng {
10233
10236
  case "REFRESH_TOKEN":
10234
10237
  return (m = this.chaiUsers) == null ? void 0 : m.refreshToken(t.data);
10235
10238
  case "LOGIN":
10236
- return (_ = this.chaiUsers) == null ? void 0 : _.login(t.data);
10239
+ return (b = this.chaiUsers) == null ? void 0 : b.login(t.data);
10237
10240
  case "LOGOUT":
10238
- return (b = this.chaiUsers) == null ? void 0 : b.logout();
10241
+ return (_ = this.chaiUsers) == null ? void 0 : _.logout();
10239
10242
  case "CHECK_USER_STATUS":
10240
10243
  return (p = this.chaiUsers) == null ? void 0 : p.isUserActive(r);
10241
10244
  case "GET_ROLE_AND_PERMISSIONS":
@@ -10397,15 +10400,15 @@ class ng {
10397
10400
  pageProps: n,
10398
10401
  lang: a
10399
10402
  }) {
10400
- var _;
10403
+ var b;
10401
10404
  const o = this.isDraftMode(), s = xe(r), i = t.filter(
10402
- (b) => b._type === "Repeater" && (b == null ? void 0 : b.repeaterItems.includes("{{#"))
10405
+ (_) => _._type === "Repeater" && (_ == null ? void 0 : _.repeaterItems.includes("{{#"))
10403
10406
  );
10404
10407
  let u = {};
10405
10408
  if (i.length > 0) {
10406
- const b = i.map((f) => ({ collectionId: f.repeaterItems.replace("{{#", "").replace("}}", ""), block: f }));
10409
+ const _ = i.map((f) => ({ collectionId: f.repeaterItems.replace("{{#", "").replace("}}", ""), block: f }));
10407
10410
  u = (await Promise.all(
10408
- b.map(async ({ collectionId: f, block: w }) => {
10411
+ _.map(async ({ collectionId: f, block: w }) => {
10409
10412
  const v = yn(f);
10410
10413
  try {
10411
10414
  const l = await (v == null ? void 0 : v.fetch({
@@ -10430,7 +10433,7 @@ class ng {
10430
10433
  }
10431
10434
  const [c, m] = await Promise.all([
10432
10435
  this.getGlobalData(a),
10433
- ((_ = s == null ? void 0 : s.dataProvider) == null ? void 0 : _.call(s, {
10436
+ ((b = s == null ? void 0 : s.dataProvider) == null ? void 0 : b.call(s, {
10434
10437
  lang: a,
10435
10438
  draft: o,
10436
10439
  inBuilder: !1,