@kedataindo/docflow-vue 0.0.8 → 0.0.10

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/dist/index.js CHANGED
@@ -2,13 +2,14 @@ var df = Object.defineProperty;
2
2
  var mf = (e, t, i) => t in e ? df(e, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[t] = i;
3
3
  var gi = (e, t, i) => mf(e, typeof t != "symbol" ? t + "" : t, i);
4
4
  import { createEditor as hf, definePlugin as ct, FontSizeExtension as bf, setSearchQuery as gf, clearSearch as vf, getSearchState as yf, searchNext as xf, searchPrev as wf, replaceCurrent as _f, replaceAll as kf, sanitizePastedHTML as Sf } from "@kedataindo/docflow-core";
5
- import { ref as G, shallowRef as Cf, computed as fe, onMounted as $i, onUnmounted as Ut, watch as ze, unref as S, nextTick as Gn, inject as Of, provide as Af, defineComponent as tt, openBlock as N, createElementBlock as R, Fragment as Te, renderList as De, normalizeStyle as at, createElementVNode as y, createCommentVNode as ae, createBlock as Xe, Teleport as Tf, toDisplayString as I, normalizeClass as ge, h as As, withDirectives as Se, withKeys as Zt, vModelText as Re, createVNode as Y, withModifiers as _e, Transition as Ar, withCtx as Gi, renderSlot as xn, createTextVNode as je, resolveDynamicComponent as _i, vModelSelect as Mc, toRaw as ts, normalizeProps as il, guardReactiveProps as nl, vModelCheckbox as is, vModelRadio as Tr } from "vue";
5
+ import { httpKeyStorage as HO, localStorageKeyStorage as qO, memoryKeyStorage as VO, openaiCompatibleProvider as GO, toAIStreamFn as WO } from "@kedataindo/docflow-core";
6
+ import { ref as G, shallowRef as Cf, computed as pe, onMounted as $i, onUnmounted as Ut, watch as ze, unref as S, nextTick as Gn, inject as Of, provide as Af, defineComponent as tt, openBlock as N, createElementBlock as R, Fragment as Te, renderList as De, normalizeStyle as at, createElementVNode as y, createCommentVNode as ae, createBlock as Xe, Teleport as Tf, toDisplayString as I, normalizeClass as ge, h as As, withDirectives as Se, withKeys as Zt, vModelText as Re, createVNode as Y, withModifiers as _e, Transition as Ar, withCtx as Gi, renderSlot as xn, createTextVNode as je, resolveDynamicComponent as _i, vModelSelect as Mc, toRaw as ts, normalizeProps as il, guardReactiveProps as nl, vModelCheckbox as is, vModelRadio as Tr } from "vue";
6
7
  import { VirtualPageOverlay as Ef, getPageSize as Mf, PAGE_SIZES as ns } from "@kedataindo/docflow-layout-engine";
7
8
  function If(e) {
8
- const t = G(null), i = Cf(null), n = G(!1), r = fe(() => {
9
+ const t = G(null), i = Cf(null), n = G(!1), r = pe(() => {
9
10
  var l;
10
11
  return ((l = i.value) == null ? void 0 : l.editor) ?? null;
11
- }), a = fe(() => {
12
+ }), a = pe(() => {
12
13
  var l;
13
14
  return ((l = i.value) == null ? void 0 : l.pluginActions) ?? {};
14
15
  }), s = () => {
@@ -60,6 +61,20 @@ function If(e) {
60
61
  isReady: n
61
62
  };
62
63
  }
64
+ function LO(e) {
65
+ const t = pe(
66
+ () => {
67
+ var r, a, s;
68
+ return (s = (a = (r = e.value) == null ? void 0 : r.storage) == null ? void 0 : a.editorContext) == null ? void 0 : s.aiStream;
69
+ }
70
+ ), i = pe(
71
+ () => {
72
+ var r, a, s;
73
+ return (s = (a = (r = e.value) == null ? void 0 : r.storage) == null ? void 0 : a.editorContext) == null ? void 0 : s.aiDraft;
74
+ }
75
+ ), n = pe(() => !!t.value);
76
+ return { aiStream: t, aiDraft: i, isAIAvailable: n };
77
+ }
63
78
  const rl = "docs-editor-theme", rs = G(!1);
64
79
  function Ic() {
65
80
  const e = (i) => {
@@ -1184,7 +1199,7 @@ function $f() {
1184
1199
  return ["en", "id"];
1185
1200
  }
1186
1201
  function Bf(e) {
1187
- const t = G({ totalPages: 1, visiblePages: [], config: { pageSize: { id: "a4", name: "A4", pageWidth: 794, pageHeight: 1123 }, margins: { top: 20, bottom: 20, left: 50, right: 50 }, pageGap: 50, headerLeft: "", headerRight: "", footerLeft: "", footerRight: "" } }), i = fe(() => t.value.totalPages), n = fe(() => t.value.visiblePages), r = G(!1);
1202
+ const t = G({ totalPages: 1, visiblePages: [], config: { pageSize: { id: "a4", name: "A4", pageWidth: 794, pageHeight: 1123 }, margins: { top: 20, bottom: 20, left: 50, right: 50 }, pageGap: 50, headerLeft: "", headerRight: "", footerLeft: "", footerRight: "" } }), i = pe(() => t.value.totalPages), n = pe(() => t.value.visiblePages), r = G(!1);
1188
1203
  let a = null, s = null;
1189
1204
  const o = async () => {
1190
1205
  var m;
@@ -1229,14 +1244,14 @@ const Ff = {
1229
1244
  isReady: { type: Boolean }
1230
1245
  },
1231
1246
  setup(e) {
1232
- const t = e, i = fe(() => t.data.visiblePages), n = fe(() => t.data.config), r = fe(() => n.value.pageSize), a = fe(() => ({
1247
+ const t = e, i = pe(() => t.data.visiblePages), n = pe(() => t.data.config), r = pe(() => n.value.pageSize), a = pe(() => ({
1233
1248
  height: `${n.value.pageGap}px`
1234
- })), s = fe(() => ({
1249
+ })), s = pe(() => ({
1235
1250
  paddingTop: `${n.value.margins.top}px`,
1236
1251
  paddingLeft: `${n.value.margins.left}px`,
1237
1252
  paddingRight: `${n.value.margins.right}px`,
1238
1253
  height: `${n.value.margins.top}px`
1239
- })), o = fe(() => ({
1254
+ })), o = pe(() => ({
1240
1255
  paddingBottom: `${n.value.margins.bottom}px`,
1241
1256
  paddingLeft: `${n.value.margins.left}px`,
1242
1257
  paddingRight: `${n.value.margins.right}px`
@@ -2579,7 +2594,7 @@ const Yt = ce("x", [
2579
2594
  z && z !== a.title && s("update:title", z), l.value = a.title, o.value = !1;
2580
2595
  }, d = (z) => z.split(" ").map((F) => F[0]).join("").slice(0, 2).toUpperCase(), f = (z) => {
2581
2596
  s("export", z), u.value = null;
2582
- }, m = fe(() => d(a.userName) || "?"), g = G(!1), h = fe(() => ({
2597
+ }, m = pe(() => d(a.userName) || "?"), g = G(!1), h = pe(() => ({
2583
2598
  File: {
2584
2599
  label: n("header.file"),
2585
2600
  items: [
@@ -2735,7 +2750,7 @@ const Yt = ce("x", [
2735
2750
  { label: n("header.about"), action: "about" }
2736
2751
  ]
2737
2752
  }
2738
- })), v = fe(() => Object.keys(h.value)), b = G(null), w = (z) => {
2753
+ })), v = pe(() => Object.keys(h.value)), b = G(null), w = (z) => {
2739
2754
  u.value = u.value === z ? null : z, b.value = null;
2740
2755
  }, x = G(!1), _ = () => {
2741
2756
  x.value = !x.value;
@@ -3182,7 +3197,7 @@ const Yt = ce("x", [
3182
3197
  function s(J) {
3183
3198
  return J ? a[J] ?? null : null;
3184
3199
  }
3185
- const o = fe(() => {
3200
+ const o = pe(() => {
3186
3201
  const J = [];
3187
3202
  for (const B of n.plugins ?? [])
3188
3203
  !B.toolbar || B.toolbar.length === 0 || J.push({ pluginId: B.id, items: B.toolbar });
@@ -3259,10 +3274,10 @@ const Yt = ce("x", [
3259
3274
  const te = n.editor.commands[J.action];
3260
3275
  typeof te == "function" && (te(...J.args ?? []), n.editor.commands.focus());
3261
3276
  }
3262
- const f = fe(() => {
3277
+ const f = pe(() => {
3263
3278
  var J;
3264
3279
  return l.value, (J = n.editor) == null ? void 0 : J.getAttributes("textStyle").color;
3265
- }), m = fe(() => {
3280
+ }), m = pe(() => {
3266
3281
  var B, te;
3267
3282
  l.value;
3268
3283
  const J = (B = n.editor) == null ? void 0 : B.getAttributes("highlight");
@@ -3289,11 +3304,11 @@ const Yt = ce("x", [
3289
3304
  }
3290
3305
  J === "setTextColor" ? (Ve = B.unsetColor) == null || Ve.call(B).run() : J === "setHighlight" && ((it = B.unsetHighlight) == null || it.call(B).run()), (ot = n.editor) == null || ot.commands.focus(), L.value = null;
3291
3306
  }
3292
- const v = ["toggleHeading1", "toggleHeading2", "toggleHeading3", "toggleHeading4", "toggleHeading5", "toggleHeading6"], b = ["alignLeft", "alignCenter", "alignRight", "alignJustify"], w = ["toggleBulletList", "toggleOrderedList", "toggleTaskList"], x = ["setLink", "insertImage", "insertTable", "toggleBlockquote", "toggleCodeBlock", "insertFootnote", "insertPageBreak", "setPageBreak", "togglePageBreak", "addPageBreak"], _ = ["setTextColor", "setHighlight"], O = fe(() => o.value.flatMap((J) => J.items)), A = fe(() => O.value.filter((J) => b.includes(J.action))), U = fe(() => O.value.filter((J) => w.includes(J.action))), k = fe(() => O.value.filter((J) => x.includes(J.action))), C = fe(() => O.value.filter((J) => _.includes(J.action))), D = fe(() => C.value.find((J) => J.action === "setTextColor")), z = fe(() => C.value.find((J) => J.action === "setHighlight")), F = fe(
3307
+ const v = ["toggleHeading1", "toggleHeading2", "toggleHeading3", "toggleHeading4", "toggleHeading5", "toggleHeading6"], b = ["alignLeft", "alignCenter", "alignRight", "alignJustify"], w = ["toggleBulletList", "toggleOrderedList", "toggleTaskList"], x = ["setLink", "insertImage", "insertTable", "toggleBlockquote", "toggleCodeBlock", "insertFootnote", "insertPageBreak", "setPageBreak", "togglePageBreak", "addPageBreak"], _ = ["setTextColor", "setHighlight"], O = pe(() => o.value.flatMap((J) => J.items)), A = pe(() => O.value.filter((J) => b.includes(J.action))), U = pe(() => O.value.filter((J) => w.includes(J.action))), k = pe(() => O.value.filter((J) => x.includes(J.action))), C = pe(() => O.value.filter((J) => _.includes(J.action))), D = pe(() => C.value.find((J) => J.action === "setTextColor")), z = pe(() => C.value.find((J) => J.action === "setHighlight")), F = pe(
3293
3308
  () => O.value.filter(
3294
3309
  (J) => !v.includes(J.action) && !b.includes(J.action) && !w.includes(J.action) && !x.includes(J.action) && !_.includes(J.action)
3295
3310
  )
3296
- ), P = fe(() => {
3311
+ ), P = pe(() => {
3297
3312
  l.value;
3298
3313
  const J = n.editor;
3299
3314
  if (J) {
@@ -3316,10 +3331,10 @@ const Yt = ce("x", [
3316
3331
  function H(J) {
3317
3332
  return n.activeSidebar === J ? Ph : $h;
3318
3333
  }
3319
- const ne = fe(() => {
3334
+ const ne = pe(() => {
3320
3335
  var J;
3321
3336
  return ((J = n.plugins) == null ? void 0 : J.some((B) => B.id === "citation")) ?? !1;
3322
- }), ee = fe(
3337
+ }), ee = pe(
3323
3338
  () => {
3324
3339
  var J, B, te;
3325
3340
  return (
@@ -3337,7 +3352,7 @@ const Yt = ce("x", [
3337
3352
  function W() {
3338
3353
  r("print");
3339
3354
  }
3340
- const pe = fe(() => [
3355
+ const fe = pe(() => [
3341
3356
  { value: "paragraph", label: i("toolbar.normalText") },
3342
3357
  { value: "heading-1", label: i("header.heading1") },
3343
3358
  { value: "heading-2", label: i("header.heading2") },
@@ -3359,24 +3374,24 @@ const Yt = ce("x", [
3359
3374
  }
3360
3375
  L.value = null;
3361
3376
  }
3362
- const se = fe(() => {
3377
+ const se = pe(() => {
3363
3378
  l.value;
3364
3379
  const J = n.editor;
3365
3380
  if (!J) return "paragraph";
3366
3381
  for (let B = 1; B <= 6; B++)
3367
3382
  if (J.isActive("heading", { level: B })) return `heading-${B}`;
3368
3383
  return "paragraph";
3369
- }), le = fe(
3384
+ }), le = pe(
3370
3385
  () => {
3371
3386
  var J;
3372
- return ((J = pe.value.find((B) => B.value === se.value)) == null ? void 0 : J.label) ?? i("toolbar.normalText");
3387
+ return ((J = fe.value.find((B) => B.value === se.value)) == null ? void 0 : J.label) ?? i("toolbar.normalText");
3373
3388
  }
3374
3389
  ), Z = [
3375
3390
  { value: "arial", label: "Arial" },
3376
3391
  { value: "inter", label: "Inter" },
3377
3392
  { value: "serif", label: "Serif" },
3378
3393
  { value: "mono", label: "Monospace" }
3379
- ], E = G("arial"), X = fe(
3394
+ ], E = G("arial"), X = pe(
3380
3395
  () => {
3381
3396
  var J;
3382
3397
  return ((J = Z.find((B) => B.value === E.value)) == null ? void 0 : J.label) ?? "Arial";
@@ -3386,7 +3401,7 @@ const Yt = ce("x", [
3386
3401
  var B;
3387
3402
  E.value = J, L.value = null, (B = n.editor) == null || B.commands.focus();
3388
3403
  }
3389
- const be = [8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 26, 28, 36, 48, 72], Ue = fe(() => {
3404
+ const be = [8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 26, 28, 36, 48, 72], Ue = pe(() => {
3390
3405
  var Ve;
3391
3406
  l.value;
3392
3407
  const J = n.editor;
@@ -3517,7 +3532,7 @@ const Yt = ce("x", [
3517
3532
  Y(S(ki), { class: "h-3.5 w-3.5 flex-shrink-0 text-slate-400" })
3518
3533
  ], 42, Qm),
3519
3534
  L.value === "heading" ? (N(), R("div", Zm, [
3520
- (N(!0), R(Te, null, De(pe.value, (te) => (N(), R("button", {
3535
+ (N(!0), R(Te, null, De(fe.value, (te) => (N(), R("button", {
3521
3536
  key: te.value,
3522
3537
  type: "button",
3523
3538
  class: ge(["flex w-full items-center px-3 py-1.5 text-left hover:bg-slate-50 dark:hover:bg-white/5", se.value === te.value ? "text-blue-600 dark:text-blue-300" : "text-slate-700 dark:text-slate-200"]),
@@ -3836,7 +3851,7 @@ const Yt = ce("x", [
3836
3851
  }), ze(i, () => {
3837
3852
  n.value = !1;
3838
3853
  });
3839
- const a = fe(() => {
3854
+ const a = pe(() => {
3840
3855
  var h, v, b, w;
3841
3856
  return i.value, [
3842
3857
  { id: "bold", label: "Bold", action: "toggleBold", icon: $c, active: (h = t.editor) == null ? void 0 : h.isActive("bold") },
@@ -3844,10 +3859,10 @@ const Yt = ce("x", [
3844
3859
  { id: "underline", label: "Underline", action: "toggleUnderline", icon: Jc, active: (b = t.editor) == null ? void 0 : b.isActive("underline") },
3845
3860
  { id: "link", label: "Link", action: "setLink", icon: Gc, active: (w = t.editor) == null ? void 0 : w.isActive("link") }
3846
3861
  ];
3847
- }), s = fe(() => {
3862
+ }), s = pe(() => {
3848
3863
  var h, v, b;
3849
3864
  return i.value, !!((b = (v = (h = t.editor) == null ? void 0 : h.storage) == null ? void 0 : v.editorContext) != null && b.aiStream);
3850
- }), o = fe(() => {
3865
+ }), o = pe(() => {
3851
3866
  var h, v, b;
3852
3867
  return i.value, ((b = (v = (h = t.editor) == null ? void 0 : h.storage) == null ? void 0 : v.ai) == null ? void 0 : b.preview) ?? null;
3853
3868
  }), l = [
@@ -3875,7 +3890,7 @@ const Yt = ce("x", [
3875
3890
  var h;
3876
3891
  (h = u()) == null || h.aiReject();
3877
3892
  }
3878
- const m = fe(() => t.position ? {
3893
+ const m = pe(() => t.position ? {
3879
3894
  top: `${t.position.top}px`,
3880
3895
  left: `${t.position.left}px`
3881
3896
  } : {});
@@ -4028,11 +4043,11 @@ const Yt = ce("x", [
4028
4043
  },
4029
4044
  emits: ["update:pageSize"],
4030
4045
  setup(e, { emit: t }) {
4031
- const { t: i } = Et(), n = e, r = t, a = fe(() => n.lastSaved ? new Date(n.lastSaved).toLocaleTimeString([], {
4046
+ const { t: i } = Et(), n = e, r = t, a = pe(() => n.lastSaved ? new Date(n.lastSaved).toLocaleTimeString([], {
4032
4047
  hour: "2-digit",
4033
4048
  minute: "2-digit",
4034
4049
  second: "2-digit"
4035
- }) : i("statusBar.never")), s = fe(() => {
4050
+ }) : i("statusBar.never")), s = pe(() => {
4036
4051
  var o, l;
4037
4052
  return ((l = (o = n.pageSizes) == null ? void 0 : o.find((u) => u.id === n.pageSize)) == null ? void 0 : l.name) ?? n.pageSize.toUpperCase();
4038
4053
  });
@@ -4100,16 +4115,16 @@ const Yt = ce("x", [
4100
4115
  layoutOptions: {}
4101
4116
  },
4102
4117
  setup(e) {
4103
- const t = e, i = fe(() => {
4118
+ const t = e, i = pe(() => {
4104
4119
  var s, o;
4105
4120
  return {
4106
4121
  pageWidth: ((s = t.layoutOptions) == null ? void 0 : s.pageWidth) ?? 794,
4107
4122
  margins: ((o = t.layoutOptions) == null ? void 0 : o.margins) ?? { top: 96, bottom: 96, left: 96, right: 96 }
4108
4123
  };
4109
- }), n = fe(() => {
4124
+ }), n = pe(() => {
4110
4125
  const s = Math.floor(i.value.pageWidth / 48);
4111
4126
  return Array.from({ length: s + 1 }, (o, l) => l * 48);
4112
- }), r = fe(() => `${i.value.margins.left}px`), a = fe(() => `${i.value.pageWidth - i.value.margins.right}px`);
4127
+ }), r = pe(() => `${i.value.margins.left}px`), a = pe(() => `${i.value.pageWidth - i.value.margins.right}px`);
4113
4128
  return (s, o) => (N(), R("div", xb, [
4114
4129
  y("div", {
4115
4130
  class: "absolute inset-y-0 mx-auto h-full",
@@ -4144,13 +4159,13 @@ const Yt = ce("x", [
4144
4159
  layoutOptions: {}
4145
4160
  },
4146
4161
  setup(e) {
4147
- const t = e, i = fe(() => {
4162
+ const t = e, i = pe(() => {
4148
4163
  var r, a;
4149
4164
  return {
4150
4165
  pageHeight: ((r = t.layoutOptions) == null ? void 0 : r.pageHeight) ?? 1123,
4151
4166
  margins: ((a = t.layoutOptions) == null ? void 0 : a.margins) ?? { top: 96, bottom: 96, left: 96, right: 96 }
4152
4167
  };
4153
- }), n = fe(() => {
4168
+ }), n = pe(() => {
4154
4169
  const r = Math.floor(i.value.pageHeight / 48);
4155
4170
  return Array.from({ length: r + 1 }, (a, s) => s * 48);
4156
4171
  });
@@ -4239,7 +4254,7 @@ const Yt = ce("x", [
4239
4254
  w == null || w.off("update", u), w == null || w.off("selectionUpdate", d), l !== null && (clearTimeout(l), l = null), p(), d(), b == null || b.on("update", u), b == null || b.on("selectionUpdate", d);
4240
4255
  }
4241
4256
  );
4242
- const f = fe(
4257
+ const f = pe(
4243
4258
  () => a.value.filter(
4244
4259
  (b) => b.text.toLowerCase().includes(s.value.toLowerCase())
4245
4260
  )
@@ -4436,7 +4451,7 @@ const Yt = ce("x", [
4436
4451
  const E = `sidebars.references.types.${Z}`, X = r(E);
4437
4452
  return X === E ? Z : X;
4438
4453
  }
4439
- const p = fe(() => {
4454
+ const p = pe(() => {
4440
4455
  const Z = a.value.trim().toLowerCase();
4441
4456
  return Z ? i.sources.filter((E) => [
4442
4457
  E.title,
@@ -4464,7 +4479,7 @@ const Yt = ce("x", [
4464
4479
  function P(Z) {
4465
4480
  h.value.splice(Z, 1), h.value.length === 0 && h.value.push({ family: "", given: "" });
4466
4481
  }
4467
- const L = fe(() => ["book", "chapter", "report", "thesis", "document"].includes(m.value)), Q = fe(() => ["article-journal", "chapter"].includes(m.value)), j = fe(() => ["article-journal", "chapter"].includes(m.value)), K = fe(() => ["webpage", "report"].includes(m.value)), H = fe(() => g.value.trim().length > 0);
4482
+ const L = pe(() => ["book", "chapter", "report", "thesis", "document"].includes(m.value)), Q = pe(() => ["article-journal", "chapter"].includes(m.value)), j = pe(() => ["article-journal", "chapter"].includes(m.value)), K = pe(() => ["webpage", "report"].includes(m.value)), H = pe(() => g.value.trim().length > 0);
4468
4483
  function ne() {
4469
4484
  const Z = h.value.filter((oe) => oe.family.trim() || oe.given.trim()).map((oe) => ({ family: oe.family.trim(), given: oe.given.trim() })), E = parseInt(v.value, 10), X = {
4470
4485
  id: f.value ?? crypto.randomUUID(),
@@ -4481,14 +4496,14 @@ const Yt = ce("x", [
4481
4496
  function $(Z) {
4482
4497
  window.confirm(r("sidebars.references.confirmDelete").replace("{title}", Z.title ?? Z.id)) && n("remove", Z.id);
4483
4498
  }
4484
- const V = G(!1), W = G(""), pe = G(null);
4499
+ const V = G(!1), W = G(""), fe = G(null);
4485
4500
  function de() {
4486
4501
  const Z = W.value.trim();
4487
4502
  !Z || i.importing || (n("import-doi", Z), W.value = "");
4488
4503
  }
4489
4504
  function se() {
4490
4505
  var Z;
4491
- i.importing || (Z = pe.value) == null || Z.click();
4506
+ i.importing || (Z = fe.value) == null || Z.click();
4492
4507
  }
4493
4508
  async function le(Z) {
4494
4509
  var Ue;
@@ -4670,7 +4685,7 @@ const Yt = ce("x", [
4670
4685
  ], 8, Ug),
4671
4686
  y("input", {
4672
4687
  ref_key: "bibFileInput",
4673
- ref: pe,
4688
+ ref: fe,
4674
4689
  type: "file",
4675
4690
  accept: ".bib,.ris,application/x-bibtex,text/plain",
4676
4691
  class: "hidden",
@@ -9447,19 +9462,19 @@ c.DateParser = function() {
9447
9462
  }
9448
9463
  }
9449
9464
  k = k.replace(/([A-Za-z])\./g, "$1");
9450
- var $ = "", V = "", W = {}, pe, de;
9465
+ var $ = "", V = "", W = {}, fe, de;
9451
9466
  if (k.slice(0, 1) === '"' && k.slice(-1) === '"')
9452
9467
  return W.literal = k.slice(1, -1), W;
9453
9468
  if (D > -1 && z > -1) {
9454
9469
  var se = k.split("/");
9455
- se.length > 3 ? (pe = "-", k = k.replace(/\_/g, "-"), de = "/", P = k.split(A)) : (pe = "/", k = k.replace(/\_/g, "/"), de = "-", P = k.split(O));
9470
+ se.length > 3 ? (fe = "-", k = k.replace(/\_/g, "-"), de = "/", P = k.split(A)) : (fe = "/", k = k.replace(/\_/g, "/"), de = "-", P = k.split(O));
9456
9471
  } else
9457
- k = k.replace(/\//g, "-"), k = k.replace(/\_/g, "-"), pe = "-", de = "-", P = k.split(_);
9472
+ k = k.replace(/\//g, "-"), k = k.replace(/\_/g, "-"), fe = "-", de = "-", P = k.split(_);
9458
9473
  for (var le = [], H = 0, ne = P.length; H < ne; H++) {
9459
9474
  var L = P[H].match(/^\s*([\-\/]|[^\-\/\~\?0-9]+|[\-~?0-9]+)\s*$/);
9460
9475
  L && le.push(L[1]);
9461
9476
  }
9462
- var Z = le.indexOf(pe), E = [], X = !1;
9477
+ var Z = le.indexOf(fe), E = [], X = !1;
9463
9478
  Z > -1 ? (E.push([0, Z]), E.push([Z + 1, le.length]), X = !0) : E.push([0, le.length]);
9464
9479
  for (var oe = "", H = 0, ne = E.length; H < ne; H++) {
9465
9480
  var be = E[H], Ue = le.slice(be[0], be[1]);
@@ -10322,7 +10337,7 @@ c.Output.Queue.adjust = function(e) {
10322
10337
  function W() {
10323
10338
  return n[Q];
10324
10339
  }
10325
- var pe = F ? W : V;
10340
+ var fe = F ? W : V;
10326
10341
  function de() {
10327
10342
  var E = n[Q][j];
10328
10343
  typeof E == "string" ? (H(), K(), ne(E)) : (ne(Q), H());
@@ -10332,7 +10347,7 @@ c.Output.Queue.adjust = function(e) {
10332
10347
  typeof E == "string" ? (H(), K(), ee(E)) : (ee(j), K());
10333
10348
  }
10334
10349
  var le = F ? de : se, Z = Q === j;
10335
- Z ? $() : pe() && le();
10350
+ Z ? $() : fe() && le();
10336
10351
  }
10337
10352
  function w(k) {
10338
10353
  if (k.blobs && typeof k.blobs == "string") {
@@ -10650,8 +10665,8 @@ c.Engine.prototype.processCitationCluster = function(e, t, i, n) {
10650
10665
  this.tmp.authorstring_request = !0;
10651
10666
  var W = this.registry.registry[L[o][0].id].disambig;
10652
10667
  this.tmp.authorstring_request = !0, c.getAmbiguousCite.call(this, L[o][0], W);
10653
- var pe = this.registry.authorstrings[L[o][0].id];
10654
- this.tmp.authorstring_request = !1, L[o][1].sortkeys = [pe].concat(V);
10668
+ var fe = this.registry.authorstrings[L[o][0].id];
10669
+ this.tmp.authorstring_request = !1, L[o][1].sortkeys = [fe].concat(V);
10655
10670
  }
10656
10671
  L.sort(this.citation.srt.compareCompositeKeys);
10657
10672
  for (var de = !1, se = !1, le = !1, o = 0, l = L.length; o < l; o += 1)
@@ -10890,8 +10905,8 @@ c.getCitationCluster = function(e, t) {
10890
10905
  this.tmp.cite_index = s, m = e[s][0], o = e[s][1], o = c.parseLocator.call(this, o), l = this.tmp.have_collapsed;
10891
10906
  var W = !1;
10892
10907
  if (s > 0 && e[s - 1][1] && (W = !!e[s - 1][1].locator), u = {}, this.tmp.shadow_numbers = {}, !this.tmp.just_looking && this.opt.hasPlaceholderTerm) {
10893
- var pe = this.output;
10894
- this.output = new c.Output.Queue(this), this.output.adjust = new c.Output.Queue.adjust(), c.getAmbiguousCite.call(this, m, null, !1, o), this.output = pe;
10908
+ var fe = this.output;
10909
+ this.output = new c.Output.Queue(this), this.output.adjust = new c.Output.Queue.adjust(), c.getAmbiguousCite.call(this, m, null, !1, o), this.output = fe;
10895
10910
  }
10896
10911
  if (this.tmp.in_cite_predecessor = !1, s > 0 ? c.getCite.call(this, m, o, "" + e[s - 1][0].id, !0) : (this.tmp.term_predecessor = !1, c.getCite.call(this, m, o, null, !0)), this.tmp.cite_renders_content || (x = {
10897
10912
  citationID: "" + this.tmp.citation_id,
@@ -11307,16 +11322,16 @@ c.Engine.prototype.localeSet = function(e, t, i) {
11307
11322
  this.locale[i].opts["leading-noise-words"] = W;
11308
11323
  } else if (m === "@name-as-sort-order") {
11309
11324
  this.locale[i].opts["name-as-sort-order"] = {};
11310
- for (var pe = s[m].split(/\s+/), b = 0, w = pe.length; b < w; b += 1)
11311
- this.locale[i].opts["name-as-sort-order"][pe[b]] = !0;
11325
+ for (var fe = s[m].split(/\s+/), b = 0, w = fe.length; b < w; b += 1)
11326
+ this.locale[i].opts["name-as-sort-order"][fe[b]] = !0;
11312
11327
  } else if (m === "@name-as-reverse-order") {
11313
11328
  this.locale[i].opts["name-as-reverse-order"] = {};
11314
- for (var pe = s[m].split(/\s+/), b = 0, w = pe.length; b < w; b += 1)
11315
- this.locale[i].opts["name-as-reverse-order"][pe[b]] = !0;
11329
+ for (var fe = s[m].split(/\s+/), b = 0, w = fe.length; b < w; b += 1)
11330
+ this.locale[i].opts["name-as-reverse-order"][fe[b]] = !0;
11316
11331
  } else if (m === "@name-never-short") {
11317
11332
  this.locale[i].opts["name-never-short"] = {};
11318
- for (var pe = s[m].split(/\s+/), b = 0, w = pe.length; b < w; b += 1)
11319
- this.locale[i].opts["name-never-short"][pe[b]] = !0;
11333
+ for (var fe = s[m].split(/\s+/), b = 0, w = fe.length; b < w; b += 1)
11334
+ this.locale[i].opts["name-never-short"][fe[b]] = !0;
11320
11335
  }
11321
11336
  }
11322
11337
  }
@@ -14697,15 +14712,15 @@ c.Engine.prototype.processNumber = function(e, t, i) {
14697
14712
  }
14698
14713
  return $;
14699
14714
  }
14700
- function g($, V, W, pe, de) {
14701
- pe = pe || "";
14715
+ function g($, V, W, fe, de) {
14716
+ fe = fe || "";
14702
14717
  var se = {};
14703
14718
  if (!V && !c.STATUTE_SUBDIV_STRINGS_REVERSE[i] && (V = "var:" + i), V) {
14704
14719
  var le = V.match(/(\s*)([^\s]+)(\s*)/);
14705
14720
  a === "page" && de === 0 && ["p.", "pp."].indexOf(le[2]) === -1 ? (se.gotosleepability = !0, se.labelVisibility = !0) : se.labelVisibility = !1, se.label = le[2], se.origLabel = $, se.labelSuffix = le[3] ? le[3] : "", se.plural = 0;
14706
14721
  }
14707
14722
  var le = W.match(/^([0-9]*[a-zA-Z]+0*)?([0-9]+(?:[a-zA-Z]*|[-,a-zA-Z]+))$/);
14708
- return le ? (se.particle = le[1] ? le[1] : "", se.value = le[2]) : (se.particle = "", se.value = W), se.joiningSuffix = pe.replace(/\s*-\s*/, "-"), se;
14723
+ return le ? (se.particle = le[1] ? le[1] : "", se.value = le[2]) : (se.particle = "", se.value = W), se.joiningSuffix = fe.replace(/\s*-\s*/, "-"), se;
14709
14724
  }
14710
14725
  function h($) {
14711
14726
  for (var V = $.length - 2; V > -1; V -= 2)
@@ -14714,17 +14729,17 @@ c.Engine.prototype.processNumber = function(e, t, i) {
14714
14729
  }
14715
14730
  function v($, V) {
14716
14731
  V = V || "", $ = m($);
14717
- var W, pe, de;
14732
+ var W, fe, de;
14718
14733
  if (i === "page" && $.indexOf("–") > -1 && ($ = $.replace(/\u2013/g, "-")), $.indexOf("\\-") > -1) {
14719
- W = new RegExp(u.source.replace("\\-", "")), pe = new RegExp(p.source.replace("\\-", ""));
14734
+ W = new RegExp(u.source.replace("\\-", "")), fe = new RegExp(p.source.replace("\\-", ""));
14720
14735
  for (var se = $.split("\\-"), le = 0, Z = se.length; le < Z; le++)
14721
14736
  se[le] = se[le].replace(/\-/g, "–");
14722
14737
  de = se.join("\\-"), de = de.replace(/\\/g, "");
14723
14738
  } else
14724
- W = u, pe = p, de = $;
14739
+ W = u, fe = p, de = $;
14725
14740
  var E = [], X = de.match(W);
14726
14741
  if (X) {
14727
- for (var se = de.split(pe), le = 0, Z = X.length; le < Z; le++)
14742
+ for (var se = de.split(fe), le = 0, Z = X.length; le < Z; le++)
14728
14743
  X[le].match(l) && (se[le].match(/[a-zA-Z]$/) && se[le].match(/^[a-zA-Z]/) ? X[le] = f : X[le] = " " + f + " ");
14729
14744
  var oe = !1;
14730
14745
  for (var le in se)
@@ -14765,9 +14780,9 @@ c.Engine.prototype.processNumber = function(e, t, i) {
14765
14780
  !$[V].joiningSuffix && $[V + 1].label && ($[V].joiningSuffix = " ");
14766
14781
  }
14767
14782
  function w($, V, W) {
14768
- var pe = $[W.pos], de = $[V].value, se = pe.joiningSuffix === "\\-";
14769
- de.particle && de.particle !== pe.particle && (W.collapsible = !1);
14770
- var le = de.match(/^[0-9]+([-,:a-zA-Z]*)$/), Z = pe.value.match(/^(?:[0-9]+|[ixv]+)([-,:a-zA-Z]*|\-[\-0-9]+)$/);
14783
+ var fe = $[W.pos], de = $[V].value, se = fe.joiningSuffix === "\\-";
14784
+ de.particle && de.particle !== fe.particle && (W.collapsible = !1);
14785
+ var le = de.match(/^[0-9]+([-,:a-zA-Z]*)$/), Z = fe.value.match(/^(?:[0-9]+|[ixv]+)([-,:a-zA-Z]*|\-[\-0-9]+)$/);
14771
14786
  if ((!de || !le || !Z || se) && (W.collapsible = !1, (!de || !Z) && (W.numeric = !1), se && W.count--), (le && le[1] || Z && Z[1]) && (W.collapsible = !1), $[V].collapsible === void 0) {
14772
14787
  for (var E = V, X = V + W.count; E < X; E++)
14773
14788
  isNaN(parseInt($[E].value)) && !$[E].value.match(/^[ivxlcmIVXLCM]+$/) ? $[E].collapsible = !1 : $[E].collapsible = !0;
@@ -14781,13 +14796,13 @@ c.Engine.prototype.processNumber = function(e, t, i) {
14781
14796
  }
14782
14797
  function _($) {
14783
14798
  if ($.length !== 0) {
14784
- for (var V = 0, W = 1, pe = 1, de = $.length; pe < de; pe++) {
14785
- var se = $[pe - 1], le = $[pe];
14799
+ for (var V = 0, W = 1, fe = 1, de = $.length; fe < de; fe++) {
14800
+ var se = $[fe - 1], le = $[fe];
14786
14801
  if (se.label === le.label && se.particle === se.particle)
14787
14802
  W++;
14788
14803
  else {
14789
14804
  var Z = JSON.parse(JSON.stringify($[V]));
14790
- Z.pos = V, Z.count = W, Z.numeric = !0, w($, V, Z), se.label !== le.label && x($, V, Z), V = pe, W = 1;
14805
+ Z.pos = V, Z.count = W, Z.numeric = !0, w($, V, Z), se.label !== le.label && x($, V, Z), V = fe, W = 1;
14791
14806
  }
14792
14807
  }
14793
14808
  var Z = JSON.parse(JSON.stringify($[V]));
@@ -14800,11 +14815,11 @@ c.Engine.prototype.processNumber = function(e, t, i) {
14800
14815
  function A($) {
14801
14816
  var V = c.Util.cloneToken(e), W = new c.Token();
14802
14817
  r.tmp.just_looking || (W.decorations = V.decorations, V.decorations = [], W.strings.prefix = V.strings.prefix, V.strings.prefix = "", W.strings.suffix = V.strings.suffix, V.strings.suffix = "");
14803
- var pe = $.length ? $[0].label : null;
14818
+ var fe = $.length ? $[0].label : null;
14804
14819
  if ($.length) {
14805
14820
  for (var de = 0, se = $.length; de < se; de++) {
14806
14821
  var le = $[de], Z = c.Util.cloneToken(V);
14807
- Z.gender = e.gender, pe === le.label && (Z.formatter = e.formatter), le.numeric && (Z.successor_prefix = le.successor_prefix), Z.strings.suffix = Z.strings.suffix + O(le.joiningSuffix), le.styling = Z;
14822
+ Z.gender = e.gender, fe === le.label && (Z.formatter = e.formatter), le.numeric && (Z.successor_prefix = le.successor_prefix), Z.strings.suffix = Z.strings.suffix + O(le.joiningSuffix), le.styling = Z;
14808
14823
  }
14809
14824
  r.tmp.just_looking || $[0].value.slice(0, 1) === '"' && $[$.length - 1].value.slice(-1) === '"' && ($[0].value = $[0].value.slice(1), $[$.length - 1].value = $[$.length - 1].value.slice(0, -1), W.decorations.push(["@quotes", !0]));
14810
14825
  }
@@ -14813,17 +14828,17 @@ c.Engine.prototype.processNumber = function(e, t, i) {
14813
14828
  function U($, V) {
14814
14829
  var W = !0;
14815
14830
  if (["locator", "locator-extra", "page"].indexOf($) > -1) {
14816
- var pe;
14817
- V.origLabel ? pe = V.origLabel : pe = V.label, W = !!r.getTerm(c.STATUTE_SUBDIV_STRINGS[pe]);
14831
+ var fe;
14832
+ V.origLabel ? fe = V.origLabel : fe = V.label, W = !!r.getTerm(c.STATUTE_SUBDIV_STRINGS[fe]);
14818
14833
  }
14819
14834
  return W;
14820
14835
  }
14821
14836
  function k($, V) {
14822
14837
  return $ === "page" || ["locator", "locator-extra"].indexOf($) > -1 && (["p."].indexOf(V.label) > -1 || ["p."].indexOf(V.origLabel) > -1);
14823
14838
  }
14824
- function C($, V, W, pe) {
14839
+ function C($, V, W, fe) {
14825
14840
  var de = k($, V), se = U($, V);
14826
- return se && W === "-" && pe && ((de || ["locator", "locator-extra", "issue", "volume", "edition", "number"].indexOf($) > -1) && (W = r.getTerm("page-range-delimiter"), W || (W = "–")), $ === "collection-number" && (W = r.getTerm("year-range-delimiter"), W || (W = "–"))), W;
14841
+ return se && W === "-" && fe && ((de || ["locator", "locator-extra", "issue", "volume", "edition", "number"].indexOf($) > -1) && (W = r.getTerm("page-range-delimiter"), W || (W = "–")), $ === "collection-number" && (W = r.getTerm("year-range-delimiter"), W || (W = "–"))), W;
14827
14842
  }
14828
14843
  function D($, V, W) {
14829
14844
  if (!(V < 1) && W.count === 2 && $[V - 1].particle === $[V].particle) {
@@ -14835,12 +14850,12 @@ c.Engine.prototype.processNumber = function(e, t, i) {
14835
14850
  $[V - 1].joiningSuffix = C(i, $[V], $[V - 1].joiningSuffix, !0);
14836
14851
  return;
14837
14852
  }
14838
- var pe = $[V], de = k(i, pe), se;
14853
+ var fe = $[V], de = k(i, fe), se;
14839
14854
  de && !isNaN(parseInt($[V - 1].value)) && !isNaN(parseInt($[V].value)) ? (se = $[V - 1].particle + $[V - 1].value + " - " + $[V].particle + $[V].value, se = r.fun.page_mangler(se)) : (("" + $[V - 1].value).match(/^([0-9]+|[ivxlcmIVXLCM]+)$/) && ("" + $[V].value).match(/^([0-9]+|[ivxlcmIVXLCM]+)$/) && ($[V - 1].joiningSuffix = r.getTerm("page-range-delimiter")), se = $[V - 1].value + O($[V - 1].joiningSuffix) + $[V].value);
14840
14855
  var le = se.match(/^((?:[0-9]*[a-zA-Z]+0*))?([0-9]+[a-z]*)(\s*[^0-9]+\s*)([-,a-zA-Z]?0*)([0-9]+[a-z]*)$/);
14841
14856
  if (le) {
14842
14857
  var Z = le[3];
14843
- Z = C(i, pe, Z, $[V].numeric), $[V - 1].particle = le[1], $[V - 1].value = le[2], $[V - 1].joiningSuffix = Z, $[V].particle = le[4], $[V].value = le[5];
14858
+ Z = C(i, fe, Z, $[V].numeric), $[V - 1].particle = le[1], $[V - 1].value = le[2], $[V - 1].joiningSuffix = Z, $[V].particle = le[4], $[V].value = le[5];
14844
14859
  }
14845
14860
  W.count = 0;
14846
14861
  }
@@ -14850,7 +14865,7 @@ c.Engine.prototype.processNumber = function(e, t, i) {
14850
14865
  for (var V = {
14851
14866
  count: 0,
14852
14867
  label: null
14853
- }, W = 0, pe = $.length; W < pe; W++) {
14868
+ }, W = 0, fe = $.length; W < fe; W++) {
14854
14869
  var de = $[W];
14855
14870
  if (de.collapsible)
14856
14871
  V.label === de.label && de.joiningSuffix === "-" ? V.count = 1 : V.label === de.label && de.joiningSuffix !== "-" ? (V.count++, V.count === 2 && D($, W, V)) : V.label !== de.label ? (V.label = de.label, V.count = 1) : (V.count = 1, V.label = de.label);
@@ -14864,8 +14879,8 @@ c.Engine.prototype.processNumber = function(e, t, i) {
14864
14879
  }
14865
14880
  }
14866
14881
  function F($, V, W) {
14867
- var pe = $[V];
14868
- W.length && (pe.numeric = W[0].numeric, pe.collapsible = W[0].collapsible, pe.plural = W[0].plural, pe.label = c.STATUTE_SUBDIV_STRINGS[W[0].label], i === "number" && pe.label === "issue" && r.getTerm("number") && (pe.label = "number"));
14882
+ var fe = $[V];
14883
+ W.length && (fe.numeric = W[0].numeric, fe.collapsible = W[0].collapsible, fe.plural = W[0].plural, fe.label = c.STATUTE_SUBDIV_STRINGS[W[0].label], i === "number" && fe.label === "issue" && r.getTerm("number") && (fe.label = "number"));
14869
14884
  }
14870
14885
  if (e && this.tmp.shadow_numbers[a] && this.tmp.shadow_numbers[a].values.length) {
14871
14886
  var P = this.tmp.shadow_numbers[a].values;
@@ -15278,8 +15293,8 @@ c.Util.FlipFlopper = function(e) {
15278
15293
  for (var ne = [], ee = {}, $ = [e[e.tmp.area].opt.layout_decorations].concat(H.alldecor), V = $.length - 1; V > -1; V--) {
15279
15294
  var W = $[V];
15280
15295
  if (W)
15281
- for (var pe = W.length - 1; pe > -1; pe--) {
15282
- var de = W[pe];
15296
+ for (var fe = W.length - 1; fe > -1; fe--) {
15297
+ var de = W[fe];
15283
15298
  ["@font-weight", "@font-style", "@font-variant"].indexOf(de[0]) > -1 && !ee[de[0]] && (Q[1] !== "normal" && (H.decorations.push([de[0], "normal"]), ne.push([de[0], "normal"])), ee[de[0]] = !0);
15284
15299
  }
15285
15300
  }
@@ -41611,10 +41626,10 @@ const P_ = { class: "ai-sidebar flex h-full w-80 flex-shrink-0 flex-col border-l
41611
41626
  }
41612
41627
  const s = G([]), o = G(""), l = G(!1), u = G(null), p = G(null), d = G(null);
41613
41628
  let f = null;
41614
- const m = fe(() => {
41629
+ const m = pe(() => {
41615
41630
  var j, K, H;
41616
41631
  return i.aiStream ? i.aiStream : (H = (K = (j = a()) == null ? void 0 : j.storage) == null ? void 0 : K.editorContext) == null ? void 0 : H.aiStream;
41617
- }), g = fe(() => {
41632
+ }), g = pe(() => {
41618
41633
  var j, K, H;
41619
41634
  return i.aiDraft ? i.aiDraft : (H = (K = (j = a()) == null ? void 0 : j.storage) == null ? void 0 : K.editorContext) == null ? void 0 : H.aiDraft;
41620
41635
  }), h = G(!1), v = G(0);
@@ -41628,7 +41643,7 @@ const P_ = { class: "ai-sidebar flex h-full w-80 flex-shrink-0 flex-col border-l
41628
41643
  },
41629
41644
  { immediate: !0 }
41630
41645
  );
41631
- const w = fe(() => {
41646
+ const w = pe(() => {
41632
41647
  var ne;
41633
41648
  v.value;
41634
41649
  const j = (ne = a()) == null ? void 0 : ne.state;
@@ -41725,7 +41740,7 @@ const P_ = { class: "ai-sidebar flex h-full w-80 flex-shrink-0 flex-col border-l
41725
41740
  var j, K, H;
41726
41741
  w.value && ((H = (K = (j = a()) == null ? void 0 : j.commands) == null ? void 0 : K.aiTransform) == null || H.call(K, { action: "rewrite" }));
41727
41742
  }
41728
- const z = fe(() => [
41743
+ const z = pe(() => [
41729
41744
  { label: r("sidebars.ai.summarize"), icon: Ns, color: "text-cyan-500", action: "summarize", needsSelection: !0 },
41730
41745
  { label: r("sidebars.ai.fixGrammar"), icon: rd, color: "text-emerald-500", action: "grammar", needsSelection: !0 },
41731
41746
  { label: r("sidebars.ai.continue"), icon: Wd, color: "text-amber-500", action: "generate", prompt: "Continue writing naturally from where the text ends, matching the existing style." },
@@ -41756,7 +41771,7 @@ const P_ = { class: "ai-sidebar flex h-full w-80 flex-shrink-0 flex-col border-l
41756
41771
  ee.dispatch(ne.tr.insertText(D_(j.text), $, V)), ee.focus(), P(K);
41757
41772
  return;
41758
41773
  }
41759
- const pe = new Map(j.citations.map((E) => [E.ref, E])), de = L_(j.text, pe, W), se = ne.schema, le = de.map((E) => typeof E == "string" ? se.text(E) : se.nodeFromJSON(E)).filter((E) => !!E), Z = new ue(ie.from(le), 0, 0);
41774
+ const fe = new Map(j.citations.map((E) => [E.ref, E])), de = L_(j.text, fe, W), se = ne.schema, le = de.map((E) => typeof E == "string" ? se.text(E) : se.nodeFromJSON(E)).filter((E) => !!E), Z = new ue(ie.from(le), 0, 0);
41760
41775
  ee.dispatch(ne.tr.replace($, V, Z)), ee.focus(), P(K);
41761
41776
  }
41762
41777
  function Q() {
@@ -41933,7 +41948,7 @@ const P_ = { class: "ai-sidebar flex h-full w-80 flex-shrink-0 flex-col border-l
41933
41948
  },
41934
41949
  emits: ["add-comment", "add-reply", "resolve-comment"],
41935
41950
  setup(e, { emit: t }) {
41936
- const i = e, n = t, { t: r } = Et(), a = G(""), s = G({}), o = G(null), l = G("active"), u = fe(
41951
+ const i = e, n = t, { t: r } = Et(), a = G(""), s = G({}), o = G(null), l = G("active"), u = pe(
41937
41952
  () => (i.comments ?? []).filter(
41938
41953
  (m) => l.value === "resolved" ? m.resolved : !m.resolved
41939
41954
  )
@@ -42109,7 +42124,7 @@ const P_ = { class: "ai-sidebar flex h-full w-80 flex-shrink-0 flex-col border-l
42109
42124
  function o() {
42110
42125
  a.value.trim() && (n("save-snapshot", a.value.trim()), a.value = "", s.value = !1);
42111
42126
  }
42112
- const l = fe(() => i.snapshots ?? []);
42127
+ const l = pe(() => i.snapshots ?? []);
42113
42128
  return (u, p) => (N(), R("div", Hk, [
42114
42129
  y("div", qk, [
42115
42130
  y("h3", Vk, [
@@ -42348,7 +42363,7 @@ const P_ = { class: "ai-sidebar flex h-full w-80 flex-shrink-0 flex-col border-l
42348
42363
  }, { immediate: !0 }), ze(() => n.shareUrl, (d) => {
42349
42364
  o.value = i("editor.email.defaultBody", { url: d });
42350
42365
  }, { immediate: !0 });
42351
- const l = fe(() => {
42366
+ const l = pe(() => {
42352
42367
  const d = new URLSearchParams();
42353
42368
  s.value.trim() && d.set("subject", s.value.trim()), o.value.trim() && d.set("body", o.value.trim());
42354
42369
  const f = d.toString();
@@ -42459,7 +42474,7 @@ const P_ = { class: "ai-sidebar flex h-full w-80 flex-shrink-0 flex-col border-l
42459
42474
  },
42460
42475
  emits: ["close"],
42461
42476
  setup(e, { emit: t }) {
42462
- const { t: i } = Et(), n = e, r = t, a = G(null), s = G(""), o = G(""), l = G({ query: "", matches: [], activeIndex: 0 }), u = fe(() => {
42477
+ const { t: i } = Et(), n = e, r = t, a = G(null), s = G(""), o = G(""), l = G({ query: "", matches: [], activeIndex: 0 }), u = pe(() => {
42463
42478
  if (!s.value) return "";
42464
42479
  const { matches: w, activeIndex: x } = l.value;
42465
42480
  return w.length === 0 ? i("editor.findReplace.noMatches") : i("editor.findReplace.matchCount", { current: x + 1, total: w.length });
@@ -42797,11 +42812,11 @@ const U2 = { class: "docs-editor flex h-screen w-full flex-col overflow-hidden b
42797
42812
  ), ze(r, (T) => {
42798
42813
  n("update:locale", T);
42799
42814
  });
42800
- const o = G({ top: 72, bottom: 72, left: 90, right: 90 }), l = G("portrait"), u = G(i.pageSize ?? "a4"), p = G(i.pageless ?? !1), d = fe(() => {
42815
+ const o = G({ top: 72, bottom: 72, left: 90, right: 90 }), l = G("portrait"), u = G(i.pageSize ?? "a4"), p = G(i.pageless ?? !1), d = pe(() => {
42801
42816
  const T = Mf(u.value) ?? ns[0];
42802
42817
  let M = T.pageWidth, q = T.pageHeight;
42803
42818
  return l.value === "landscape" && ([M, q] = [q, M]), { pageHeight: q, pageWidth: M, margins: { ...o.value } };
42804
- }), { isDark: f } = Ic(), m = fe(() => i.virtualPages === !0), g = fe(() => ({
42819
+ }), { isDark: f } = Ic(), m = pe(() => i.virtualPages === !0), g = pe(() => ({
42805
42820
  enabled: !p.value && !m.value,
42806
42821
  pageHeight: d.value.pageHeight,
42807
42822
  pageWidth: d.value.pageWidth,
@@ -42830,11 +42845,11 @@ const U2 = { class: "docs-editor flex h-screen w-full flex-col overflow-hidden b
42830
42845
  v.tabs.forEach((T) => {
42831
42846
  A.value[T.id] = T.content;
42832
42847
  });
42833
- const U = G(v.activeTabId), k = fe(() => A.value[U.value]), C = G(!1), D = G(null), z = G(null), F = G(localStorage.getItem("docflow:view:showRuler") !== "false"), P = G(!1);
42848
+ const U = G(v.activeTabId), k = pe(() => A.value[U.value]), C = G(!1), D = G(null), z = G(null), F = G(localStorage.getItem("docflow:view:showRuler") !== "false"), P = G(!1);
42834
42849
  ze(F, (T) => {
42835
42850
  localStorage.setItem("docflow:view:showRuler", T ? "true" : "false");
42836
42851
  });
42837
- const L = G(0), Q = G(0), j = G("saved"), K = G(Date.now()), H = G(null), ne = fe(() => {
42852
+ const L = G(0), Q = G(0), j = G("saved"), K = G(Date.now()), H = G(null), ne = pe(() => {
42838
42853
  const T = [];
42839
42854
  for (const M of i.plugins)
42840
42855
  for (const q of M.slashCommands || [])
@@ -42861,11 +42876,11 @@ const U2 = { class: "docs-editor flex h-screen w-full flex-col overflow-hidden b
42861
42876
  })()
42862
42877
  ), V = G(((tl = i.citation) == null ? void 0 : tl.style) || "chicago-notes-bibliography");
42863
42878
  let W = null;
42864
- const pe = G(!1), de = (T) => {
42865
- W == null || W(T), W = null, pe.value = !1;
42879
+ const fe = G(!1), de = (T) => {
42880
+ W == null || W(T), W = null, fe.value = !1;
42866
42881
  }, se = () => new Promise((T) => {
42867
- de(null), W = T, pe.value = !0, z.value = "references";
42868
- }), le = fe(() => {
42882
+ de(null), W = T, fe.value = !0, z.value = "references";
42883
+ }), le = pe(() => {
42869
42884
  const T = i.citation;
42870
42885
  if (T)
42871
42886
  return {
@@ -42909,7 +42924,7 @@ const U2 = { class: "docs-editor flex h-screen w-full flex-col overflow-hidden b
42909
42924
  ze(z, (T, M) => {
42910
42925
  M === "references" && T !== "references" && de(null);
42911
42926
  });
42912
- const xt = G(!1), J = G(""), B = fe(
42927
+ const xt = G(!1), J = G(""), B = pe(
42913
42928
  () => {
42914
42929
  var T, M;
42915
42930
  return !!((T = i.citation) != null && T.onImportDoi || (M = i.citation) != null && M.onImportBibliography);
@@ -42973,7 +42988,7 @@ const U2 = { class: "docs-editor flex h-screen w-full flex-col overflow-hidden b
42973
42988
  E.value && (Xt && clearTimeout(Xt), Xt = setTimeout(() => {
42974
42989
  E.value && E.value.view.dispatch(E.value.state.tr);
42975
42990
  }, 150));
42976
- }, Nt = G(1), Qe = G(1), ln = fe(() => {
42991
+ }, Nt = G(1), Qe = G(1), ln = pe(() => {
42977
42992
  const T = d.value;
42978
42993
  return {
42979
42994
  pageSize: { id: u.value, name: u.value.toUpperCase(), pageWidth: T.pageWidth, pageHeight: T.pageHeight },
@@ -42990,7 +43005,7 @@ const U2 = { class: "docs-editor flex h-screen w-full flex-col overflow-hidden b
42990
43005
  isReady: cn,
42991
43006
  refreshData: lr
42992
43007
  } = Bf({
42993
- editorRef: fe(() => E.value),
43008
+ editorRef: pe(() => E.value),
42994
43009
  scrollRef: ui,
42995
43010
  config: ln.value,
42996
43011
  bufferPages: 2
@@ -43693,7 +43708,7 @@ const U2 = { class: "docs-editor flex h-screen w-full flex-col overflow-hidden b
43693
43708
  key: 2,
43694
43709
  sources: $.value,
43695
43710
  "active-style": V.value,
43696
- "picker-mode": pe.value,
43711
+ "picker-mode": fe.value,
43697
43712
  "can-import": B.value,
43698
43713
  importing: xt.value,
43699
43714
  "import-message": J.value,
@@ -44100,10 +44115,10 @@ const U2 = { class: "docs-editor flex h-screen w-full flex-col overflow-hidden b
44100
44115
  ])) : ae("", !0)
44101
44116
  ]));
44102
44117
  }
44103
- }), PO = /* @__PURE__ */ po(eO, [["__scopeId", "data-v-a81be603"]]), tO = { class: "docs-editor-pages flex flex-col items-center gap-10" }, iO = ["data-page-index"], nO = ["data-node-type", "data-from", "data-to"], rO = ["innerHTML"], aO = {
44118
+ }), $O = /* @__PURE__ */ po(eO, [["__scopeId", "data-v-a81be603"]]), tO = { class: "docs-editor-pages flex flex-col items-center gap-10" }, iO = ["data-page-index"], nO = ["data-node-type", "data-from", "data-to"], rO = ["innerHTML"], aO = {
44104
44119
  key: 1,
44105
44120
  class: "docs-editor-page__block-fallback flex justify-between text-sm text-slate-700"
44106
- }, sO = { class: "docs-editor-page__block-type font-medium" }, oO = { class: "docs-editor-page__block-range text-slate-500" }, $O = /* @__PURE__ */ tt({
44121
+ }, sO = { class: "docs-editor-page__block-type font-medium" }, oO = { class: "docs-editor-page__block-range text-slate-500" }, BO = /* @__PURE__ */ tt({
44107
44122
  __name: "PageView",
44108
44123
  props: {
44109
44124
  pages: {},
@@ -44129,10 +44144,10 @@ const U2 = { class: "docs-editor flex h-screen w-full flex-col overflow-hidden b
44129
44144
  ), Ut(() => {
44130
44145
  t.editor && typeof t.editor.off == "function" && t.editor.off("update", n);
44131
44146
  });
44132
- const r = fe(() => {
44147
+ const r = pe(() => {
44133
44148
  var f, m;
44134
44149
  return ((m = (f = t.editor) == null ? void 0 : f.view) == null ? void 0 : m.dom) ?? null;
44135
- }), a = fe(() => {
44150
+ }), a = pe(() => {
44136
44151
  var f, m, g;
44137
44152
  return {
44138
44153
  pageHeight: ((f = t.layoutOptions) == null ? void 0 : f.pageHeight) ?? 1123,
@@ -44145,7 +44160,7 @@ const U2 = { class: "docs-editor flex h-screen w-full flex-col overflow-hidden b
44145
44160
  },
44146
44161
  maxCharsPerPage: 0
44147
44162
  };
44148
- }), s = fe(() => {
44163
+ }), s = pe(() => {
44149
44164
  const { pageWidth: f, pageHeight: m, margins: g } = a.value;
44150
44165
  return t.isPageless ? {
44151
44166
  width: `${f}px`,
@@ -44184,7 +44199,7 @@ const U2 = { class: "docs-editor flex h-screen w-full flex-col overflow-hidden b
44184
44199
  } catch {
44185
44200
  return null;
44186
44201
  }
44187
- }, p = fe(() => {
44202
+ }, p = pe(() => {
44188
44203
  i.value;
44189
44204
  const f = /* @__PURE__ */ new Map();
44190
44205
  if (!t.editor || !r.value) return f;
@@ -44242,7 +44257,7 @@ const U2 = { class: "docs-editor flex h-screen w-full flex-col overflow-hidden b
44242
44257
  }, TO = ["onClick"], EO = {
44243
44258
  key: 1,
44244
44259
  class: "text-xs leading-relaxed text-slate-400 dark:text-slate-500 italic mt-1 font-sans"
44245
- }, MO = { class: "flex flex-col gap-2 md:hidden" }, IO = ["title", "onClick"], BO = /* @__PURE__ */ tt({
44260
+ }, MO = { class: "flex flex-col gap-2 md:hidden" }, IO = ["title", "onClick"], FO = /* @__PURE__ */ tt({
44246
44261
  __name: "DocumentTabsSidebar",
44247
44262
  props: {
44248
44263
  tabs: { default: () => [{ id: "tab-1", label: "Tab 1", active: !0 }] },
@@ -44251,7 +44266,7 @@ const U2 = { class: "docs-editor flex h-screen w-full flex-col overflow-hidden b
44251
44266
  },
44252
44267
  emits: ["collapse", "add-tab", "select-tab", "delete-tab", "rename-tab"],
44253
44268
  setup(e, { emit: t }) {
44254
- const { t: i } = Et(), n = e, r = fe(() => n.backTitle || i("common.cancel")), a = t, s = G(null), o = G(null), l = G(""), u = (w) => {
44269
+ const { t: i } = Et(), n = e, r = pe(() => n.backTitle || i("common.cancel")), a = t, s = G(null), o = G(null), l = G(""), u = (w) => {
44255
44270
  o.value = w.id, l.value = w.label, s.value = null;
44256
44271
  }, p = (w) => {
44257
44272
  l.value.trim() && a("rename-tab", { id: w, label: l.value.trim() }), o.value = null;
@@ -44426,13 +44441,13 @@ export {
44426
44441
  Qh as BubbleMenu,
44427
44442
  jk as CommentsSidebar,
44428
44443
  QS as DetailsDialog,
44429
- PO as DocsEditor,
44430
- BO as DocumentTabsSidebar,
44444
+ $O as DocsEditor,
44445
+ FO as DocumentTabsSidebar,
44431
44446
  Uh as EditorToolbar,
44432
44447
  h2 as EmailDialog,
44433
44448
  Rm as HeaderBar,
44434
44449
  mS as HistorySidebar,
44435
- $O as PageView,
44450
+ BO as PageView,
44436
44451
  Jf as SlashMenu,
44437
44452
  yb as StatusBar,
44438
44453
  tg as TOCSidebar,
@@ -44441,9 +44456,15 @@ export {
44441
44456
  zf as getLocaleMessages,
44442
44457
  Pf as getLocaleName,
44443
44458
  $f as getSupportedLocales,
44459
+ HO as httpKeyStorage,
44444
44460
  Es as isLocale,
44461
+ qO as localStorageKeyStorage,
44462
+ VO as memoryKeyStorage,
44445
44463
  Ts as messages,
44464
+ GO as openaiCompatibleProvider,
44446
44465
  Lf as provideLocale,
44466
+ WO as toAIStreamFn,
44467
+ LO as useAIProvider,
44447
44468
  If as useEditor,
44448
44469
  Et as useLocale,
44449
44470
  Ic as useTheme