@8wave/ai-elements 0.126.0-beta.13 → 0.126.0-beta.14

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.
@@ -1,36 +1,36 @@
1
1
  import { r as e } from "./rolldown-runtime-9rEmUaIe.js";
2
2
  import { t } from "./VvButtonLocalized-BgY-V26j.js";
3
3
  import { r as n } from "./index.es-BYhSukum.js";
4
- import { A as r, B as i, C as a, Et as o, F as s, I as c, J as l, L as u, N as d, Ot as f, Q as p, S as m, Tt as h, V as g, X as ee, _, d as v, f as y, g as b, gt as x, h as S, j as te, k as C, kt as w, ot as T, r as ne, tt as E, v as D, vt as O, w as k, wt as A, x as j, y as M, z as N } from "./vue.runtime.esm-bundler-DZgpK-ja.js";
5
- import { d as re, l as ie } from "./dist-CR8l0inH.js";
6
- import { r as ae } from "./vue-i18n-CDYWo9pX.js";
7
- import { a as oe, i as P, r as se, t as ce } from "./PkSelectionActions-BaX_rsCt.js";
8
- import { t as F } from "./PkEditorRadioButtons-CY0D_EkU.js";
9
- import { i as le, n as I, r as ue } from "./excelNumberFormat-D-AQd3Ap.js";
4
+ import { A as r, B as i, C as a, Et as o, F as s, I as c, J as l, L as u, N as d, Ot as f, Q as p, S as m, Tt as h, V as g, X as _, _ as v, d as y, f as b, g as x, gt as S, h as C, j as ee, k as w, kt as T, ot as E, r as te, tt as D, v as O, vt as k, w as A, wt as j, x as M, y as N, z as P } from "./vue.runtime.esm-bundler-DZgpK-ja.js";
5
+ import { d as ne, l as re } from "./dist-CR8l0inH.js";
6
+ import { r as ie } from "./vue-i18n-CDYWo9pX.js";
7
+ import { a as ae, i as F, r as oe, t as se } from "./PkSelectionActions-BaX_rsCt.js";
8
+ import { t as I } from "./PkEditorRadioButtons-CY0D_EkU.js";
10
9
  import { t as L } from "./_plugin-vue_export-helper-Djzt4Yr7.js";
11
- import { G as de, J as fe, K as R, U as pe, W as me, X as z, Y as B, o as he, q as V, s as ge } from "./utils-3jpXeGGy.js";
10
+ import { i as R, n as z, r as B } from "./excelNumberFormat-D-AQd3Ap.js";
11
+ import { G as ce, J as le, K as ue, U as V, W as de, X as H, Y as U, o as fe, q as pe, s as me } from "./utils-3jpXeGGy.js";
12
12
  // ../../packages/components/src/chat/fileSelection.ts
13
- var H = 2e3, _e = 1e3, U = 60, W = 1400, G = 20, ve = 100, K = (e) => Number(e.slice(1)), q = (e) => {
14
- let t = [...new Set(e)].sort((e, t) => K(e) - K(t)), n = [];
13
+ var W = 2e3, he = 1e3, ge = 60, G = 1400, K = 20, _e = 100, q = (e) => Number(e.slice(1)), J = (e) => {
14
+ let t = [...new Set(e)].sort((e, t) => q(e) - q(t)), n = [];
15
15
  for (let e of t) {
16
16
  let t = n[n.length - 1];
17
- t && K(e) === K(t.to) + 1 ? t.to = e : n.push({
17
+ t && q(e) === q(t.to) + 1 ? t.to = e : n.push({
18
18
  from: e,
19
19
  to: e
20
20
  });
21
21
  }
22
22
  return n.slice(0, 100);
23
- }, ye = (e, t) => {
23
+ }, ve = (e, t) => {
24
24
  let n = [];
25
25
  if (!t) return n;
26
26
  for (let r = e.indexOf(t); r >= 0; r = e.indexOf(t, r + 1)) n.push(r);
27
27
  return n;
28
- }, J = (e, t, n) => {
29
- let r = ye(e, e.slice(t, t + n));
28
+ }, ye = (e, t, n) => {
29
+ let r = ve(e, e.slice(t, t + n));
30
30
  if (r.length < 2) return {};
31
31
  let i = t, a = t + n;
32
- for (let t = !0; a - i <= W; t = !t) {
33
- if (ye(e, e.slice(i, a)).length === 1) return { find: e.slice(i, a) };
32
+ for (let t = !0; a - i <= G; t = !t) {
33
+ if (ve(e, e.slice(i, a)).length === 1) return { find: e.slice(i, a) };
34
34
  if (t && i > 0) i = e.slice(0, i).replace(/\S*\s*$/, "").length;
35
35
  else if (a < e.length) {
36
36
  let t = e.slice(a).match(/^\s*\S*/)?.[0] ?? "";
@@ -41,7 +41,7 @@ var H = 2e3, _e = 1e3, U = 60, W = 1400, G = 20, ve = 100, K = (e) => Number(e.s
41
41
  index: r.indexOf(t) + 1 || 1,
42
42
  of: r.length
43
43
  } };
44
- }, be = (e) => (e.querySelectorAll("[data-quote-skip]").forEach((e) => e.remove()), e.querySelectorAll("[data-paragraph]").forEach((e) => e.append("\n")), e.textContent ?? ""), xe = (e) => e.length > _e ? `${e.slice(0, _e / 2)} […] ${e.slice(-500)}` : e, Se = (e) => {
44
+ }, be = (e) => (e.querySelectorAll("[data-quote-skip]").forEach((e) => e.remove()), e.querySelectorAll("[data-paragraph]").forEach((e) => e.append("\n")), e.textContent ?? ""), xe = (e) => e.length > he ? `${e.slice(0, he / 2)} […] ${e.slice(-500)}` : e, Se = (e) => {
45
45
  let t = e.startContainer.getRootNode().getSelection?.() ?? document.getSelection();
46
46
  try {
47
47
  t?.setBaseAndExtent(e.startContainer, e.startOffset, e.endContainer, e.endOffset);
@@ -55,7 +55,7 @@ var H = 2e3, _e = 1e3, U = 60, W = 1400, G = 20, ve = 100, K = (e) => Number(e.s
55
55
  if (s.length < 2) return;
56
56
  let c = {
57
57
  format: "docx",
58
- runs: q(a),
58
+ runs: J(a),
59
59
  paragraphCount: new Set(a).size,
60
60
  quote: xe(s),
61
61
  measure: () => {
@@ -76,7 +76,7 @@ var H = 2e3, _e = 1e3, U = 60, W = 1400, G = 20, ve = 100, K = (e) => Number(e.s
76
76
  let r = be(n.cloneContents()).replace(/\n$/, ""), a = document.createRange();
77
77
  a.setStart(e, 0), a.setEnd(t.startContainer, t.startOffset);
78
78
  let l = be(a.cloneContents()).length + (o.length - o.trimStart().length);
79
- c.before = r.slice(Math.max(0, l - U), l), c.after = r.slice(l + s.length, l + s.length + U), Object.assign(c, J(r, l, s.length));
79
+ c.before = r.slice(Math.max(0, l - ge), l), c.after = r.slice(l + s.length, l + s.length + ge), Object.assign(c, ye(r, l, s.length));
80
80
  }
81
81
  return c;
82
82
  }, we = (e) => {
@@ -94,7 +94,7 @@ var H = 2e3, _e = 1e3, U = 60, W = 1400, G = 20, ve = 100, K = (e) => Number(e.s
94
94
  e = !1;
95
95
  for (let t of r) t.r1 <= n.r2 && t.r2 >= n.r1 && t.c1 <= n.c2 && t.c2 >= n.c1 && (t.r1 < n.r1 || t.r2 > n.r2 || t.c1 < n.c1 || t.c2 > n.c2) && (n.r1 = Math.min(n.r1, t.r1), n.r2 = Math.max(n.r2, t.r2), n.c1 = Math.min(n.c1, t.c1), n.c2 = Math.max(n.c2, t.c2), e = !0);
96
96
  }
97
- let i = `${we(n.c1)}${n.r1}`, a = `${we(n.c2)}${n.r2}`, o = (e.hiddenRows ?? []).filter((e) => e >= n.r1 && e <= n.r2).slice(0, ve), s = e.columns.filter((e) => e.hidden && e.col >= n.c1 && e.col <= n.c2).map((e) => we(e.col)).slice(0, ve), c = e.rows.filter((e) => e.row >= n.r1 && e.row <= n.r2).flatMap((e) => e.cells.filter((e) => e.col >= n.c1 && e.col <= n.c2 && e.value !== void 0 && e.value !== "")).slice(0, G).map((e) => String(e.value)).join("; ").slice(0, 500);
97
+ let i = `${we(n.c1)}${n.r1}`, a = `${we(n.c2)}${n.r2}`, o = (e.hiddenRows ?? []).filter((e) => e >= n.r1 && e <= n.r2).slice(0, _e), s = e.columns.filter((e) => e.hidden && e.col >= n.c1 && e.col <= n.c2).map((e) => we(e.col)).slice(0, _e), c = e.rows.filter((e) => e.row >= n.r1 && e.row <= n.r2).flatMap((e) => e.cells.filter((e) => e.col >= n.c1 && e.col <= n.c2 && e.value !== void 0 && e.value !== "")).slice(0, K).map((e) => String(e.value)).join("; ").slice(0, 500);
98
98
  return {
99
99
  format: "xlsx",
100
100
  sheet: e.name,
@@ -106,21 +106,21 @@ var H = 2e3, _e = 1e3, U = 60, W = 1400, G = 20, ve = 100, K = (e) => Number(e.s
106
106
  };
107
107
  };
108
108
  // ../../packages/components/src/chat/PkFileChart.vue?vue&type=script&setup=true&lang.ts
109
- C(), T(), h();
109
+ w(), E(), h();
110
110
  var Ee = {
111
111
  class: "pk-file-chart",
112
112
  "data-quote-skip": ""
113
113
  }, De = {
114
114
  key: 1,
115
115
  class: "pk-file-chart__placeholder"
116
- }, Oe = { class: "pk-file-chart__title" }, ke = /*#__PURE__*/ L(/* @__PURE__ */ k({
116
+ }, Y = { class: "pk-file-chart__title" }, Oe = /*#__PURE__*/ L(/* @__PURE__ */ A({
117
117
  __name: "PkFileChart",
118
118
  props: { preview: { type: null } },
119
119
  setup(e) {
120
- let t = a(() => import("./PkChart-BiFofCDF.js")), { t: r } = ae({ useScope: "global" });
120
+ let t = a(() => import("./PkChart-BiFofCDF.js")), { t: r } = ie({ useScope: "global" });
121
121
  return (i, a) => {
122
122
  let o = n;
123
- return N(), M("div", Ee, [e.preview.chart ? (N(), _(A(t), {
123
+ return P(), N("div", Ee, [e.preview.chart ? (P(), v(j(t), {
124
124
  key: 0,
125
125
  chart: e.preview.chart,
126
126
  colors: e.preview.colors,
@@ -130,20 +130,54 @@ var Ee = {
130
130
  "chart",
131
131
  "colors",
132
132
  "legend"
133
- ])) : (N(), M("div", De, [
133
+ ])) : (P(), N("div", De, [
134
134
  m(o, {
135
135
  name: "ri:bar-chart-2-line",
136
136
  class: "text-16"
137
137
  }),
138
- b("span", Oe, w(e.preview.title || A(r)("chatFilePreview.chart")), 1),
139
- b("span", null, w(A(r)("chatFilePreview.chartNotDrawn")), 1)
138
+ x("span", Y, T(e.preview.title || j(r)("chatFilePreview.chart")), 1),
139
+ x("span", null, T(j(r)("chatFilePreview.chartNotDrawn")), 1)
140
140
  ]))]);
141
141
  };
142
142
  }
143
- }), [["styles", [".pk-file-chart{width:100%;height:100%;padding:var(--spacing-8);box-sizing:border-box;color:#595959;background-color:#fff;border:1px solid #d9d9d9;font-family:Calibri,Carlito,Segoe UI,Arial,sans-serif}.pk-file-chart__placeholder{justify-content:center;align-items:center;gap:var(--spacing-4);height:100%;font-size:var(--text-12);text-align:center;flex-direction:column;display:flex}.pk-file-chart__title{font-size:var(--text-14)}"]]]);
143
+ }), [["styles", [".pk-file-chart{width:100%;height:100%;padding:var(--spacing-8);box-sizing:border-box;color:#595959;background-color:#fff;border:1px solid #d9d9d9;font-family:Calibri,Carlito,Segoe UI,Arial,sans-serif}.pk-file-chart__placeholder{justify-content:center;align-items:center;gap:var(--spacing-4);height:100%;font-size:var(--text-12);text-align:center;flex-direction:column;display:flex}.pk-file-chart__title{font-size:var(--text-14)}"]]]), X = (e, t, n, r) => {
144
+ let i = e.numFmt === void 0 ? void 0 : n.numberFormats?.[e.numFmt];
145
+ if (i !== void 0) try {
146
+ return e.format === "date" || R(i) ? z(i, t, r, n.date1904) : B(i, t, r);
147
+ } catch {
148
+ return;
149
+ }
150
+ }, ke = (e, t, n) => {
151
+ let r = e.format === "date" ? e.serial : e.value;
152
+ return typeof r == "number" ? X(e, r, t, n) : void 0;
153
+ }, Ae = (e, t, n, r) => {
154
+ let i = X(e, t, n, r);
155
+ if (i) return i.text;
156
+ let a = e.decimals === void 0 ? { maximumFractionDigits: 10 } : {
157
+ minimumFractionDigits: e.decimals,
158
+ maximumFractionDigits: e.maxDecimals ?? e.decimals
159
+ };
160
+ return new Intl.NumberFormat(r, {
161
+ ...a,
162
+ useGrouping: e.grouped === !0,
163
+ ...e.format === "percent" ? { style: "percent" } : {},
164
+ ...e.format === "currency" && e.currency ? {
165
+ style: "currency",
166
+ currency: e.currency
167
+ } : {}
168
+ }).format(t);
169
+ }, je = (e, t, n) => {
170
+ let r = 0, i = 0, a = 0, o;
171
+ for (let t of e) t && (t.value !== void 0 || t.missing) && (r++, typeof t.value == "number" && (i += t.value, a++, o ??= t));
172
+ if (r) return {
173
+ count: r,
174
+ sum: o ? Ae(o, i, t, n) : void 0,
175
+ average: o ? Ae(o, i / a, t, n) : void 0
176
+ };
177
+ };
144
178
  // ../../packages/components/src/chat/PkSpreadsheetPreview.vue?vue&type=script&setup=true&lang.ts
145
- C(), T(), h(), ne();
146
- var Ae = { class: "pk-spreadsheet-preview" }, je = { class: "pk-spreadsheet-preview__bar" }, Me = ["aria-label"], Ne = ["aria-label"], Pe = ["aria-label"], Fe = [
179
+ w(), E(), h(), te();
180
+ var Me = { class: "pk-spreadsheet-preview" }, Ne = { class: "pk-spreadsheet-preview__bar" }, Pe = ["aria-label"], Fe = ["aria-label"], Ie = ["aria-label"], Le = [
147
181
  "rowspan",
148
182
  "colspan",
149
183
  "data-focus",
@@ -151,19 +185,19 @@ var Ae = { class: "pk-spreadsheet-preview" }, je = { class: "pk-spreadsheet-prev
151
185
  "title",
152
186
  "onMousedown",
153
187
  "onMouseenter"
154
- ], Ie = {
188
+ ], Re = {
155
189
  key: 1,
156
190
  class: "pk-spreadsheet-preview__charts"
157
- }, Le = {
191
+ }, ze = {
158
192
  key: 2,
159
193
  class: "pk-spreadsheet-preview__more"
160
- }, Re = ["aria-label"], ze = ["aria-current", "onClick"], Be = { class: "pk-spreadsheet-preview__status" }, Ve = { class: "pk-spreadsheet-preview__info" }, He = ["title"], Ue = ["title"], We = {
194
+ }, Be = ["aria-label"], Ve = ["aria-current", "onClick"], He = { class: "pk-spreadsheet-preview__status" }, Ue = { class: "pk-spreadsheet-preview__info" }, We = ["title"], Ge = ["title"], Ke = {
161
195
  key: 2,
162
196
  class: "pk-spreadsheet-preview__stats"
163
- }, Ge = {
197
+ }, qe = {
164
198
  key: 0,
165
199
  class: "pk-spreadsheet-preview__average"
166
- }, Ke = { key: 1 }, qe = { class: "pk-spreadsheet-preview__zoom" }, Je = { class: "pk-spreadsheet-preview__percent" }, Ye = 64, Xe = 20, Ze = 28, Qe = 44, $e = 400, et = 10, tt = /*#__PURE__*/ L(/* @__PURE__ */ k({
200
+ }, Je = { key: 1 }, Ye = { class: "pk-spreadsheet-preview__zoom" }, Xe = { class: "pk-spreadsheet-preview__percent" }, Ze = 64, Qe = 20, $e = 28, et = 44, tt = 400, nt = 10, Z = /*#__PURE__*/ L(/* @__PURE__ */ A({
167
201
  __name: "PkSpreadsheetPreview",
168
202
  props: /*@__PURE__*/ d({
169
203
  preview: { type: null },
@@ -176,72 +210,72 @@ var Ae = { class: "pk-spreadsheet-preview" }, je = { class: "pk-spreadsheet-prev
176
210
  }),
177
211
  emits: /*@__PURE__*/ d(["select"], ["update:sheet", "update:zoom"]),
178
212
  setup(e, { emit: n }) {
179
- let r = e, i = n, { t: a, locale: d } = ae({ useScope: "global" }), h = l(e, "sheet"), _ = l(e, "zoom"), C = ee("scrollEl"), { width: T, height: ne } = ie(C, {
213
+ let r = e, i = n, { t: a, locale: d } = ie({ useScope: "global" }), h = l(e, "sheet"), v = l(e, "zoom"), w = _("scrollEl"), { width: E, height: te } = re(w, {
180
214
  width: 0,
181
215
  height: 0
182
- }, { box: "border-box" }), E = S(() => r.preview.sheets[h.value] ?? r.preview.sheets[0]);
216
+ }, { box: "border-box" }), D = C(() => r.preview.sheets[h.value] ?? r.preview.sheets[0]);
183
217
  p(() => r.preview, () => {
184
218
  h.value = 0;
185
219
  });
186
- let O = S(() => r.marked?.get(E.value?.name ?? "")), k = S(() => {
220
+ let k = C(() => r.marked?.get(D.value?.name ?? "")), A = C(() => {
187
221
  let e = /* @__PURE__ */ new Map();
188
- for (let t of O.value ?? []) {
222
+ for (let t of k.value ?? []) {
189
223
  let [n, r] = t.split(":"), i = e.get(Number(n));
190
224
  e.set(Number(n), i ? `${i},${r}` : r);
191
225
  }
192
226
  return e;
193
- }), re = (e, t) => !!O.value?.has(`${e}:${t}`);
227
+ }), ne = (e, t) => !!k.value?.has(`${e}:${t}`);
194
228
  p(() => r.marked, (e) => {
195
- if (!e || O.value) return;
229
+ if (!e || k.value) return;
196
230
  let t = r.preview.sheets.findIndex((t) => e.has(t.name));
197
231
  t >= 0 && (h.value = t);
198
232
  }, { immediate: !0 });
199
- let oe = () => se(C.value, ".pk-spreadsheet-preview__cell--marked");
200
- p(O, oe, { flush: "post" }), u(oe);
201
- let P = (e) => {
233
+ let ae = () => oe(w.value, ".pk-spreadsheet-preview__cell--marked");
234
+ p(k, ae, { flush: "post" }), u(ae);
235
+ let F = (e) => {
202
236
  let t = "";
203
237
  for (let n = e; n > 0; n = Math.floor((n - 1) / 26)) t = String.fromCharCode(65 + (n - 1) % 26) + t;
204
238
  return t;
205
- }, ce = S(() => (E.value?.charts ?? []).reduce((e, t) => ({
239
+ }, se = C(() => (D.value?.charts ?? []).reduce((e, t) => ({
206
240
  col: Math.max(e.col, t.lastCol),
207
241
  row: Math.max(e.row, t.lastRow)
208
242
  }), {
209
243
  col: 0,
210
244
  row: 0
211
- })), F = S(() => {
212
- let e = E.value;
245
+ })), I = C(() => {
246
+ let e = D.value;
213
247
  if (!e) return [];
214
- let t = new Set(e.columns.filter((e) => e.hidden).map((e) => e.col)), n = new Map(e.columns.map((e) => [e.col, e.width])), r = [], i = Qe, a = T.value / _.value;
215
- for (let o = 1; o <= e.lastColumn || o <= ce.value.col || !e.moreColumns && (o <= e.lastColumn + 2 || i < a); o++) {
248
+ let t = new Set(e.columns.filter((e) => e.hidden).map((e) => e.col)), n = new Map(e.columns.map((e) => [e.col, e.width])), r = [], i = et, a = E.value / v.value;
249
+ for (let o = 1; o <= e.lastColumn || o <= se.value.col || !e.moreColumns && (o <= e.lastColumn + 2 || i < a); o++) {
216
250
  if (t.has(o)) continue;
217
- let e = n.get(o) ?? Ye;
251
+ let e = n.get(o) ?? Ze;
218
252
  r.push({
219
253
  col: o,
220
254
  width: e
221
255
  }), i += e;
222
256
  }
223
257
  return r;
224
- }), L = S(() => F.value.reduce((e, t) => e + t.width, Qe)), de = S(() => F.value.map((e) => `${e.col}:${e.width}`).join(",")), fe = /* @__PURE__ */ new WeakMap(), R = S(() => {
225
- let e = E.value;
258
+ }), L = C(() => I.value.reduce((e, t) => e + t.width, et)), R = C(() => I.value.map((e) => `${e.col}:${e.width}`).join(",")), z = /* @__PURE__ */ new WeakMap(), B = C(() => {
259
+ let e = D.value;
226
260
  if (!e) return [];
227
- let t = new Set(e.hiddenRows ?? []), n = new Map(e.rows.map((e) => [e.row, e.height])), r = Math.ceil((ne.value / _.value - Ze) / Xe), i = e.moreRows ? e.lastRow : Math.max(e.lastRow + 5, r + t.size, ce.value.row), a = fe.get(e);
228
- a || (a = /* @__PURE__ */ new Map(), fe.set(e, a));
261
+ let t = new Set(e.hiddenRows ?? []), n = new Map(e.rows.map((e) => [e.row, e.height])), r = Math.ceil((te.value / v.value - $e) / Qe), i = e.moreRows ? e.lastRow : Math.max(e.lastRow + 5, r + t.size, se.value.row), a = z.get(e);
262
+ a || (a = /* @__PURE__ */ new Map(), z.set(e, a));
229
263
  let o = a;
230
264
  return Array.from({ length: i }, (e, t) => t + 1).filter((e) => !t.has(e)).map((e) => {
231
265
  let t = o.get(e);
232
266
  return t || (t = {
233
267
  row: e,
234
- height: n.get(e) ?? Xe
268
+ height: n.get(e) ?? Qe
235
269
  }, o.set(e, t)), t;
236
270
  });
237
- }), pe = S(() => {
238
- let e = E.value?.charts ?? [];
271
+ }), ce = C(() => {
272
+ let e = D.value?.charts ?? [];
239
273
  if (!e.length) return [];
240
- let t = _.value;
274
+ let t = v.value;
241
275
  return e.map((e, n) => {
242
- let r = F.value.reduce((t, n) => n.col < e.col ? t + n.width : t, Qe + e.x), i = R.value.reduce((t, n) => n.row < e.row ? t + n.height : t, Ze + e.y);
276
+ let r = I.value.reduce((t, n) => n.col < e.col ? t + n.width : t, et + e.x), i = B.value.reduce((t, n) => n.row < e.row ? t + n.height : t, $e + e.y);
243
277
  return {
244
- key: `${E.value?.name}:${n}`,
278
+ key: `${D.value?.name}:${n}`,
245
279
  chart: e,
246
280
  css: {
247
281
  left: `${r * t}px`,
@@ -251,58 +285,35 @@ var Ae = { class: "pk-spreadsheet-preview" }, je = { class: "pk-spreadsheet-prev
251
285
  }
252
286
  };
253
287
  });
254
- }), me = S(() => {
288
+ }), le = C(() => {
255
289
  let e = /* @__PURE__ */ new Map();
256
- for (let t of E.value?.rows ?? []) for (let n of t.cells) e.set(`${t.row},${n.col}`, n);
290
+ for (let t of D.value?.rows ?? []) for (let n of t.cells) e.set(`${t.row},${n.col}`, n);
257
291
  return e;
258
- }), z = S(() => {
292
+ }), ue = C(() => {
259
293
  let e = /* @__PURE__ */ new Map();
260
- for (let t of E.value?.rows ?? []) for (let n of t.cells) if (n.span) for (let r = 0; r < n.span.rows; r++) for (let i = 0; i < n.span.cols; i++) (r || i) && e.set(`${t.row + r},${n.col + i}`, {
294
+ for (let t of D.value?.rows ?? []) for (let n of t.cells) if (n.span) for (let r = 0; r < n.span.rows; r++) for (let i = 0; i < n.span.cols; i++) (r || i) && e.set(`${t.row + r},${n.col + i}`, {
261
295
  row: t.row,
262
296
  col: n.col
263
297
  });
264
298
  return e;
265
- }), B = (e, t) => me.value.get(`${e},${t}`), he = (e, t) => {
266
- let n = B(e, t)?.span;
299
+ }), V = (e, t) => le.value.get(`${e},${t}`), de = (e, t) => {
300
+ let n = V(e, t)?.span;
267
301
  if (n) return {
268
- rows: R.value.filter((t) => t.row >= e && t.row < e + n.rows).length,
269
- cols: F.value.filter((e) => e.col >= t && e.col < t + n.cols).length
302
+ rows: B.value.filter((t) => t.row >= e && t.row < e + n.rows).length,
303
+ cols: I.value.filter((e) => e.col >= t && e.col < t + n.cols).length
270
304
  };
271
- }, V = (e) => e?.style === void 0 ? void 0 : r.preview.styles[e.style], ge = (e) => {
272
- let t = e.numFmt === void 0 ? void 0 : r.preview.numberFormats?.[e.numFmt], n = e.value;
273
- if (t !== void 0) try {
274
- return e.format === "date" ? e.serial === void 0 ? void 0 : I(t, e.serial, d.value, r.preview.date1904) : typeof n == "number" ? le(t) ? I(t, n, d.value, r.preview.date1904) : ue(t, n, d.value) : void 0;
275
- } catch {
276
- return;
277
- }
278
- }, H = (e, t) => {
279
- let n = ge(e);
280
- if (n) return n.text;
281
- let r = e.decimals === void 0 ? { maximumFractionDigits: 10 } : {
282
- minimumFractionDigits: e.decimals,
283
- maximumFractionDigits: e.maxDecimals ?? e.decimals
284
- };
285
- return new Intl.NumberFormat(d.value, {
286
- ...r,
287
- useGrouping: e.grouped === !0,
288
- ...e.format === "percent" ? { style: "percent" } : {},
289
- ...e.format === "currency" && e.currency ? {
290
- style: "currency",
291
- currency: e.currency
292
- } : {}
293
- }).format(t);
294
- }, _e = (e) => {
305
+ }, H = (e) => e?.style === void 0 ? void 0 : r.preview.styles[e.style], U = (e) => ke(e, r.preview, d.value), fe = (e) => {
295
306
  let t = /* @__PURE__ */ new Date(`${e}T00:00:00Z`);
296
307
  return Number.isNaN(t.getTime()) ? e : new Intl.DateTimeFormat(d.value, {
297
308
  dateStyle: "short",
298
309
  timeZone: "UTC"
299
310
  }).format(t);
300
- }, U = (e) => {
311
+ }, pe = (e) => {
301
312
  if (!e) return "";
302
313
  if (e.missing) return "—";
303
314
  let t = e.value;
304
- return t === void 0 ? "" : typeof t == "boolean" ? a(t ? "chatFilePreview.true" : "chatFilePreview.false") : e.format === "date" && typeof t == "string" ? ge(e)?.text ?? _e(t) : typeof t == "number" ? H(e, t) : t;
305
- }, W = (e) => {
315
+ return t === void 0 ? "" : typeof t == "boolean" ? a(t ? "chatFilePreview.true" : "chatFilePreview.false") : e.format === "date" && typeof t == "string" ? U(e)?.text ?? fe(t) : typeof t == "number" ? Ae(e, t, r.preview, d.value) : t;
316
+ }, me = (e) => {
306
317
  if (!e) return "";
307
318
  if (e.formula) return `=${e.formula}`;
308
319
  let t = e.value;
@@ -310,9 +321,9 @@ var Ae = { class: "pk-spreadsheet-preview" }, je = { class: "pk-spreadsheet-prev
310
321
  useGrouping: !1,
311
322
  maximumFractionDigits: 15,
312
323
  ...e.format === "percent" ? { style: "percent" } : {}
313
- }).format(t) : U(e);
314
- }, G = (e) => e ? `${e.width}px solid ${e.color}` : void 0, ve = (e, t, n) => {
315
- let r = V(e), i = e?.value, a = typeof i == "number" || e?.format === "date" || !!e?.missing, o = {
324
+ }).format(t) : pe(e);
325
+ }, W = (e) => e ? `${e.width}px solid ${e.color}` : void 0, he = (e, t, n) => {
326
+ let r = H(e), i = e?.value, a = typeof i == "number" || e?.format === "date" || !!e?.missing, o = {
316
327
  textAlign: r?.align ?? (a ? "right" : typeof i == "boolean" || e?.format === "error" ? "center" : "left"),
317
328
  verticalAlign: r?.valign === "top" ? "top" : r?.valign === "middle" ? "middle" : "bottom",
318
329
  whiteSpace: r?.wrap ? "pre-wrap" : "nowrap"
@@ -320,33 +331,33 @@ var Ae = { class: "pk-spreadsheet-preview" }, je = { class: "pk-spreadsheet-prev
320
331
  r?.bold && (o.fontWeight = 700), r?.italic && (o.fontStyle = "italic");
321
332
  let s = [r?.underline ? "underline" : "", r?.strike ? "line-through" : ""].filter(Boolean).join(" ");
322
333
  s && (o.textDecoration = s), r?.size && (o.fontSize = `${r.size}pt`);
323
- let c = e ? ge(e)?.color : void 0;
334
+ let c = e ? U(e)?.color : void 0;
324
335
  if ((c ?? r?.color) && (o.color = c ?? r?.color), r?.fill && (o.backgroundColor = r.fill), r?.indent) {
325
336
  let e = `${4 + r.indent * 9}px`;
326
337
  o.textAlign === "right" ? o.paddingRight = e : o.paddingLeft = e;
327
338
  }
328
- let l = st(t, n);
329
- return K(t, n) ? (o.borderStyle = "hidden", o.boxShadow = [...l, De(e, t, n)].filter(Boolean).join(", ")) : (o.borderTop = G(r?.borders?.top), o.borderRight = G(r?.borders?.right), o.borderBottom = G(r?.borders?.bottom), o.borderLeft = G(r?.borders?.left), o.boxShadow = [...l, ...J(e, t, n)].join(", ")), Object.assign(o, rt(t, n)), o;
330
- }, K = (e, t) => {
331
- let n = E.value?.frozen;
339
+ let l = ot(t, n);
340
+ return ge(t, n) ? (o.borderStyle = "hidden", o.boxShadow = [...l, Se(e, t, n)].filter(Boolean).join(", ")) : (o.borderTop = W(r?.borders?.top), o.borderRight = W(r?.borders?.right), o.borderBottom = W(r?.borders?.bottom), o.borderLeft = W(r?.borders?.left), o.boxShadow = [...l, ..._e(e, t, n)].join(", ")), Object.assign(o, De(t, n)), o;
341
+ }, ge = (e, t) => {
342
+ let n = D.value?.frozen;
332
343
  return !!n && (e <= n.rows || t <= n.cols);
333
- }, q = {
344
+ }, G = {
334
345
  top: (e) => `inset 0 ${e.width}px 0 ${e.color}`,
335
346
  right: (e) => `inset -${e.width}px 0 0 ${e.color}`,
336
347
  bottom: (e) => `inset 0 -${e.width}px 0 ${e.color}`,
337
348
  left: (e) => `inset ${e.width}px 0 0 ${e.color}`
338
- }, ye = (...e) => e.reduce((e, t) => t && (!e || t.width > e.width) ? t : e, void 0), J = (e, t, n) => {
339
- let r = V(e)?.borders;
340
- return [t === R.value[0]?.row && r?.top && q.top(r.top), n === F.value[0]?.col && r?.left && q.left(r.left)].filter((e) => !!e);
341
- }, be = S(() => R.value.map((e) => e.row)), xe = S(() => F.value.map((e) => e.col)), Se = S(() => new Map(be.value.map((e, t) => [e, t]))), Ce = S(() => new Map(xe.value.map((e, t) => [e, t]))), we = (e, t, n, r) => {
349
+ }, K = (...e) => e.reduce((e, t) => t && (!e || t.width > e.width) ? t : e, void 0), _e = (e, t, n) => {
350
+ let r = H(e)?.borders;
351
+ return [t === B.value[0]?.row && r?.top && G.top(r.top), n === I.value[0]?.col && r?.left && G.left(r.left)].filter((e) => !!e);
352
+ }, q = C(() => B.value.map((e) => e.row)), J = C(() => I.value.map((e) => e.col)), ve = C(() => new Map(q.value.map((e, t) => [e, t]))), ye = C(() => new Map(J.value.map((e, t) => [e, t]))), be = (e, t, n, r) => {
342
353
  let i = [], a = t.get(n) ?? e.length;
343
354
  for (; a < e.length && e[a] < n + r; a++) i.push(e[a]);
344
355
  return {
345
356
  spanned: i,
346
357
  next: e[a]
347
358
  };
348
- }, Ee = (e, t, n, r) => {
349
- let { spanned: i, next: a } = we(be.value, Se.value, t, e?.span?.rows ?? 1), { spanned: o, next: s } = we(xe.value, Ce.value, n, e?.span?.cols ?? 1);
359
+ }, xe = (e, t, n, r) => {
360
+ let { spanned: i, next: a } = be(q.value, ve.value, t, e?.span?.rows ?? 1), { spanned: o, next: s } = be(J.value, ye.value, n, e?.span?.cols ?? 1);
350
361
  return (r === "right" ? s === void 0 ? [] : i.map((e) => ({
351
362
  row: e,
352
363
  col: s
@@ -354,35 +365,35 @@ var Ae = { class: "pk-spreadsheet-preview" }, je = { class: "pk-spreadsheet-prev
354
365
  row: a,
355
366
  col: e
356
367
  }))).map((e) => {
357
- let t = z.value.get(`${e.row},${e.col}`) ?? e;
358
- return B(t.row, t.col);
368
+ let t = ue.value.get(`${e.row},${e.col}`) ?? e;
369
+ return V(t.row, t.col);
359
370
  });
360
- }, De = (e, t, n) => {
361
- let r = V(e)?.borders, i = ye(r?.right, ...Ee(e, t, n, "right").map((e) => V(e)?.borders?.left)), a = ye(r?.bottom, ...Ee(e, t, n, "bottom").map((e) => V(e)?.borders?.top)), o = E.value?.gridlines;
371
+ }, Se = (e, t, n) => {
372
+ let r = H(e)?.borders, i = K(r?.right, ...xe(e, t, n, "right").map((e) => H(e)?.borders?.left)), a = K(r?.bottom, ...xe(e, t, n, "bottom").map((e) => H(e)?.borders?.top)), o = D.value?.gridlines;
362
373
  return [
363
- i ? q.right(i) : o && "inset calc(var(--border) * -1) 0 0 var(--pk-spreadsheet-gridline)",
364
- a ? q.bottom(a) : o && "inset 0 calc(var(--border) * -1) 0 var(--pk-spreadsheet-gridline)",
365
- ...J(e, t, n)
374
+ i ? G.right(i) : o && "inset calc(var(--border) * -1) 0 0 var(--pk-spreadsheet-gridline)",
375
+ a ? G.bottom(a) : o && "inset 0 calc(var(--border) * -1) 0 var(--pk-spreadsheet-gridline)",
376
+ ..._e(e, t, n)
366
377
  ].filter(Boolean).join(", ");
367
- }, Oe = (e) => Ze + R.value.filter((t) => t.row < e).reduce((e, t) => e + t.height, 0), tt = (e) => Qe + F.value.filter((t) => t.col < e).reduce((e, t) => e + t.width, 0), nt = S(() => {
368
- let e = E.value?.frozen;
378
+ }, Ce = (e) => $e + B.value.filter((t) => t.row < e).reduce((e, t) => e + t.height, 0), we = (e) => et + I.value.filter((t) => t.col < e).reduce((e, t) => e + t.width, 0), Ee = C(() => {
379
+ let e = D.value?.frozen;
369
380
  return {
370
- top: Oe((e?.rows ?? 0) + 1),
371
- left: tt((e?.cols ?? 0) + 1)
381
+ top: Ce((e?.rows ?? 0) + 1),
382
+ left: we((e?.cols ?? 0) + 1)
372
383
  };
373
- }), rt = (e, t) => {
374
- let n = E.value?.frozen;
384
+ }), De = (e, t) => {
385
+ let n = D.value?.frozen;
375
386
  if (!n) return {};
376
387
  let r = {};
377
- return e <= n.rows && (r.position = "sticky", r.top = `${Oe(e)}px`, r.scrollMarginTop = r.top, r.zIndex = 0), t <= n.cols && (r.position = "sticky", r.left = `${tt(t)}px`, r.scrollMarginLeft = r.left, r.zIndex = +(e <= n.rows)), r;
378
- }, Y = x({
388
+ return e <= n.rows && (r.position = "sticky", r.top = `${Ce(e)}px`, r.scrollMarginTop = r.top, r.zIndex = 0), t <= n.cols && (r.position = "sticky", r.left = `${we(t)}px`, r.scrollMarginLeft = r.left, r.zIndex = +(e <= n.rows)), r;
389
+ }, Y = S({
379
390
  row: 1,
380
391
  col: 1
381
- }), X = x({
392
+ }), X = S({
382
393
  row: 1,
383
394
  col: 1
384
395
  });
385
- p(E, () => {
396
+ p(D, () => {
386
397
  Y.value = {
387
398
  row: 1,
388
399
  col: 1
@@ -391,36 +402,36 @@ var Ae = { class: "pk-spreadsheet-preview" }, je = { class: "pk-spreadsheet-prev
391
402
  col: 1
392
403
  };
393
404
  });
394
- let Z = S(() => ({
405
+ let Z = C(() => ({
395
406
  r1: Math.min(Y.value.row, X.value.row),
396
407
  r2: Math.max(Y.value.row, X.value.row),
397
408
  c1: Math.min(Y.value.col, X.value.col),
398
409
  c2: Math.max(Y.value.col, X.value.col)
399
- })), it = (e, t) => e >= Z.value.r1 && e <= Z.value.r2 && t >= Z.value.c1 && t <= Z.value.c2, at = (e, t) => X.value.row === e && X.value.col === t, ot = (e) => e >= Z.value.r1 && e <= Z.value.r2 ? `${Z.value.c1}:${Z.value.c2}:${X.value.row === e ? X.value.col : 0}:${e === Z.value.r1 ? "t" : ""}${e === Z.value.r2 ? "b" : ""}` : "", st = (e, t) => {
410
+ })), rt = (e, t) => e >= Z.value.r1 && e <= Z.value.r2 && t >= Z.value.c1 && t <= Z.value.c2, it = (e, t) => X.value.row === e && X.value.col === t, at = (e) => e >= Z.value.r1 && e <= Z.value.r2 ? `${Z.value.c1}:${Z.value.c2}:${X.value.row === e ? X.value.col : 0}:${e === Z.value.r1 ? "t" : ""}${e === Z.value.r2 ? "b" : ""}` : "", ot = (e, t) => {
400
411
  let { r1: n, r2: r, c1: i, c2: a } = Z.value;
401
- if (n === r && i === a || !it(e, t)) return [];
402
- let o = B(e, t)?.span, s = e + (o?.rows ?? 1) - 1, c = t + (o?.cols ?? 1) - 1, l = "var(--spacing-2)", u = "var(--pk-spreadsheet-green)";
412
+ if (n === r && i === a || !rt(e, t)) return [];
413
+ let o = V(e, t)?.span, s = e + (o?.rows ?? 1) - 1, c = t + (o?.cols ?? 1) - 1, l = "var(--spacing-2)", u = "var(--pk-spreadsheet-green)";
403
414
  return [
404
415
  e === n && `inset 0 ${l} 0 ${u}`,
405
416
  s >= r && `inset 0 calc(${l} * -1) 0 ${u}`,
406
417
  t === i && `inset ${l} 0 0 ${u}`,
407
418
  c >= a && `inset calc(${l} * -1) 0 0 ${u}`
408
419
  ].filter((e) => !!e);
409
- }, Q = x(!1), ct = (e, t, n) => {
410
- C.value?.focus({ preventScroll: !0 }), X.value = {
420
+ }, Q = S(!1), st = (e, t, n) => {
421
+ w.value?.focus({ preventScroll: !0 }), X.value = {
411
422
  row: e,
412
423
  col: t
413
424
  }, n.shiftKey || (Y.value = {
414
425
  row: e,
415
426
  col: t
416
427
  }), Q.value = !0;
417
- }, lt = (e, t) => {
428
+ }, ct = (e, t) => {
418
429
  Q.value && (X.value = {
419
430
  row: e,
420
431
  col: t
421
432
  });
422
- }, ut, dt = () => {
423
- let e = [...C.value?.querySelectorAll(".pk-spreadsheet-preview__cell--range, [data-focus]") ?? []].map((e) => e.getBoundingClientRect());
433
+ }, lt, ut = () => {
434
+ let e = [...w.value?.querySelectorAll(".pk-spreadsheet-preview__cell--range, [data-focus]") ?? []].map((e) => e.getBoundingClientRect());
424
435
  if (e.length) return {
425
436
  start: {
426
437
  top: Math.min(...e.map((e) => e.top)),
@@ -428,80 +439,80 @@ var Ae = { class: "pk-spreadsheet-preview" }, je = { class: "pk-spreadsheet-prev
428
439
  },
429
440
  bottom: Math.max(...e.map((e) => e.bottom))
430
441
  };
431
- }, ft = () => E.value ? {
432
- ...Te(E.value, Z.value),
433
- measure: dt
442
+ }, dt = () => D.value ? {
443
+ ...Te(D.value, Z.value),
444
+ measure: ut
434
445
  } : void 0;
435
446
  p([Z, Q], () => {
436
- clearTimeout(ut), Q.value || (ut = setTimeout(() => {
447
+ clearTimeout(lt), Q.value || (lt = setTimeout(() => {
437
448
  let e = Z.value, t = e.r2 > e.r1 || e.c2 > e.c1;
438
- i("select", t ? ft() : void 0);
449
+ i("select", t ? dt() : void 0);
439
450
  }, 150));
440
451
  });
441
- let pt = () => {
442
- clearTimeout(ut), i("select", ft());
443
- }, $, mt;
444
- p(E, () => {
445
- mt = void 0;
452
+ let ft = () => {
453
+ clearTimeout(lt), i("select", dt());
454
+ }, $, pt;
455
+ p(D, () => {
456
+ pt = void 0;
446
457
  });
447
- let ht = (e) => {
458
+ let mt = (e) => {
448
459
  let [t, n] = ((e?.closest?.("[data-cell]"))?.dataset.cell ?? "").split(":").map(Number);
449
460
  return t && n ? {
450
461
  row: t,
451
462
  col: n
452
463
  } : void 0;
453
- }, gt = () => {
464
+ }, ht = () => {
454
465
  clearTimeout($?.timer), $?.active && (Q.value = !1), $ = void 0;
455
466
  };
456
467
  c(() => {
457
- gt(), clearTimeout(ut);
468
+ ht(), clearTimeout(lt);
458
469
  });
459
- let _t = () => void s(pt), vt = (e) => {
460
- gt();
461
- let t = e.touches[0], n = e.touches.length === 1 ? ht(e.target) : void 0;
470
+ let gt = () => void s(ft), _t = (e) => {
471
+ ht();
472
+ let t = e.touches[0], n = e.touches.length === 1 ? mt(e.target) : void 0;
462
473
  t && n && ($ = {
463
474
  ...n,
464
475
  x: t.clientX,
465
476
  y: t.clientY,
466
477
  active: !1,
467
478
  timer: setTimeout(() => {
468
- $ && ($.active = !0, C.value?.focus({ preventScroll: !0 }), Y.value = {
479
+ $ && ($.active = !0, w.value?.focus({ preventScroll: !0 }), Y.value = {
469
480
  row: $.row,
470
481
  col: $.col
471
482
  }, X.value = {
472
483
  row: $.row,
473
484
  col: $.col
474
485
  }, Q.value = !0);
475
- }, $e)
486
+ }, tt)
476
487
  });
477
- }, yt = (e) => {
488
+ }, vt = (e) => {
478
489
  let t = e.touches[0];
479
490
  if (!$ || !t) return;
480
491
  if (!$.active) {
481
- (!e.cancelable || Math.hypot(t.clientX - $.x, t.clientY - $.y) > et) && gt();
492
+ (!e.cancelable || Math.hypot(t.clientX - $.x, t.clientY - $.y) > nt) && ht();
482
493
  return;
483
494
  }
484
495
  e.preventDefault();
485
- let n = C.value?.getRootNode(), r = ht(n?.elementFromPoint(t.clientX, t.clientY) ?? null);
496
+ let n = w.value?.getRootNode(), r = mt(n?.elementFromPoint(t.clientX, t.clientY) ?? null);
486
497
  r && (X.value = r);
487
- }, bt = (e) => {
498
+ }, yt = (e) => {
488
499
  if (!$) return;
489
500
  let { row: t, col: n, active: r } = $;
490
- gt(), e.preventDefault();
501
+ ht(), e.preventDefault();
491
502
  let i = Z.value, a = i.r1 === i.r2 && i.c1 === i.c2;
492
503
  if (r) {
493
- a && _t();
504
+ a && gt();
494
505
  return;
495
506
  }
496
- let o = a && at(t, n) && mt === `${t}:${n}`;
497
- mt = `${t}:${n}`, C.value?.focus({ preventScroll: !0 }), Y.value = {
507
+ let o = a && it(t, n) && pt === `${t}:${n}`;
508
+ pt = `${t}:${n}`, w.value?.focus({ preventScroll: !0 }), Y.value = {
498
509
  row: t,
499
510
  col: n
500
511
  }, X.value = {
501
512
  row: t,
502
513
  col: n
503
- }, o && _t();
504
- }, xt = (e) => {
514
+ }, o && gt();
515
+ }, bt = (e) => {
505
516
  let t = {
506
517
  ArrowUp: [-1, 0],
507
518
  ArrowDown: [1, 0],
@@ -512,7 +523,7 @@ var Ae = { class: "pk-spreadsheet-preview" }, je = { class: "pk-spreadsheet-prev
512
523
  }[e.key];
513
524
  if (!t) return;
514
525
  e.preventDefault();
515
- let n = R.value.map((e) => e.row), r = F.value.map((e) => e.col), i = (e) => z.value.get(`${e.row},${e.col}`) ?? e, a = i(X.value), o = n.indexOf(X.value.row), c = r.indexOf(X.value.col), l = a;
526
+ let n = B.value.map((e) => e.row), r = I.value.map((e) => e.col), i = (e) => ue.value.get(`${e.row},${e.col}`) ?? e, a = i(X.value), o = n.indexOf(X.value.row), c = r.indexOf(X.value.col), l = a;
516
527
  for (;;) {
517
528
  let e = Math.min(n.length - 1, Math.max(0, o + t[0])), s = Math.min(r.length - 1, Math.max(0, c + t[1]));
518
529
  if (e === o && s === c || (o = e, c = s, l = i({
@@ -520,166 +531,159 @@ var Ae = { class: "pk-spreadsheet-preview" }, je = { class: "pk-spreadsheet-prev
520
531
  col: r[c]
521
532
  }), l.row !== a.row || l.col !== a.col)) break;
522
533
  }
523
- X.value = l, e.shiftKey || (Y.value = l), s(() => C.value?.querySelector("[data-focus]")?.scrollIntoView({
534
+ X.value = l, e.shiftKey || (Y.value = l), s(() => w.value?.querySelector("[data-focus]")?.scrollIntoView({
524
535
  block: "nearest",
525
536
  inline: "nearest"
526
537
  }));
527
- }, St = S(() => B(X.value.row, X.value.col)), Ct = S(() => {
528
- let { r1: e, r2: t, c1: n, c2: r } = Z.value;
529
- if (e === t && n === r) return;
530
- let i = 0, a = 0, o = 0, s;
531
- for (let c = e; c <= t; c++) for (let e = n; e <= r; e++) {
532
- let t = B(c, e);
533
- t && (t.value !== void 0 || t.missing) && (i++, typeof t.value == "number" && (a += t.value, o++, s ??= t));
534
- }
535
- if (i) return {
536
- count: i,
537
- sum: s ? H(s, a) : void 0,
538
- average: s ? H(s, a / o) : void 0
539
- };
540
- }), wt = (e) => {
541
- _.value = Math.min(2, Math.max(.5, Math.round((_.value + e) * 10) / 10));
538
+ }, xt = C(() => V(X.value.row, X.value.col)), St = C(() => {
539
+ let { r1: e, r2: t, c1: n, c2: i } = Z.value;
540
+ if (e === t && n === i) return;
541
+ let a = [];
542
+ for (let r = e; r <= t; r++) for (let e = n; e <= i; e++) a.push(V(r, e));
543
+ return je(a, r.preview, d.value);
544
+ }), Ct = (e) => {
545
+ v.value = Math.min(2, Math.max(.5, Math.round((v.value + e) * 10) / 10));
542
546
  };
543
547
  return (n, r) => {
544
548
  let i = t;
545
- return N(), M("div", Ae, [
546
- b("div", je, [
547
- b("span", {
549
+ return P(), N("div", Me, [
550
+ x("div", Ne, [
551
+ x("span", {
548
552
  class: "pk-spreadsheet-preview__ref",
549
- "aria-label": A(a)("chatFilePreview.cell")
550
- }, w(P(X.value.col)) + w(X.value.row), 9, Me),
551
- r[6] ||= b("span", {
553
+ "aria-label": j(a)("chatFilePreview.cell")
554
+ }, T(F(X.value.col)) + T(X.value.row), 9, Pe),
555
+ r[6] ||= x("span", {
552
556
  class: "pk-spreadsheet-preview__fx",
553
557
  "aria-hidden": "true"
554
558
  }, "fx", -1),
555
- b("output", {
559
+ x("output", {
556
560
  class: "pk-spreadsheet-preview__formula",
557
- "aria-label": A(a)("chatFilePreview.formulaBar")
558
- }, w(W(St.value)), 9, Ne)
561
+ "aria-label": j(a)("chatFilePreview.formulaBar")
562
+ }, T(me(xt.value)), 9, Fe)
559
563
  ]),
560
- b("div", {
564
+ x("div", {
561
565
  ref_key: "scrollEl",
562
- ref: C,
566
+ ref: w,
563
567
  class: "pk-spreadsheet-preview__scroll",
564
568
  tabindex: "0",
565
569
  role: "grid",
566
- "aria-label": E.value?.name,
567
- onKeydown: xt,
570
+ "aria-label": D.value?.name,
571
+ onKeydown: bt,
568
572
  onMouseup: r[2] ||= (e) => Q.value = !1,
569
573
  onMouseleave: r[3] ||= (e) => Q.value = !1,
570
- onTouchstart: vt,
571
- onTouchmove: yt,
572
- onTouchend: bt,
573
- onTouchcancel: gt
574
+ onTouchstart: _t,
575
+ onTouchmove: vt,
576
+ onTouchend: yt,
577
+ onTouchcancel: ht
574
578
  }, [
575
- E.value ? (N(), M("table", {
579
+ D.value ? (P(), N("table", {
576
580
  key: 0,
577
- class: o(["pk-spreadsheet-preview__grid", { "pk-spreadsheet-preview__grid--lines": E.value.gridlines }]),
581
+ class: o(["pk-spreadsheet-preview__grid", { "pk-spreadsheet-preview__grid--lines": D.value.gridlines }]),
578
582
  style: f({
579
- zoom: _.value,
583
+ zoom: v.value,
580
584
  width: `${L.value}px`,
581
- "--pk-spreadsheet-stuck-top": `${nt.value.top}px`,
582
- "--pk-spreadsheet-stuck-left": `${nt.value.left}px`
585
+ "--pk-spreadsheet-stuck-top": `${Ee.value.top}px`,
586
+ "--pk-spreadsheet-stuck-left": `${Ee.value.left}px`
583
587
  })
584
588
  }, [
585
- b("colgroup", null, [b("col", { style: f({ width: `${Qe}px` }) }, null, 4), (N(!0), M(y, null, g(F.value, (e) => (N(), M("col", {
589
+ x("colgroup", null, [x("col", { style: f({ width: `${et}px` }) }, null, 4), (P(!0), N(b, null, g(I.value, (e) => (P(), N("col", {
586
590
  key: e.col,
587
591
  style: f({ width: `${e.width}px` })
588
592
  }, null, 4))), 128))]),
589
- b("thead", null, [b("tr", { style: f({ height: `${Ze}px` }) }, [r[7] ||= b("th", { class: "pk-spreadsheet-preview__corner" }, null, -1), (N(!0), M(y, null, g(F.value, (e) => (N(), M("th", {
593
+ x("thead", null, [x("tr", { style: f({ height: `${$e}px` }) }, [r[7] ||= x("th", { class: "pk-spreadsheet-preview__corner" }, null, -1), (P(!0), N(b, null, g(I.value, (e) => (P(), N("th", {
590
594
  key: e.col,
591
595
  scope: "col",
592
596
  class: o(["pk-spreadsheet-preview__head", { "pk-spreadsheet-preview__head--current": e.col >= Z.value.c1 && e.col <= Z.value.c2 }]),
593
- style: f(E.value.frozen && e.col <= E.value.frozen.cols ? {
594
- left: `${tt(e.col)}px`,
597
+ style: f(D.value.frozen && e.col <= D.value.frozen.cols ? {
598
+ left: `${we(e.col)}px`,
595
599
  zIndex: 2
596
600
  } : void 0)
597
- }, w(P(e.col)), 7))), 128))], 4)]),
598
- b("tbody", null, [(N(!0), M(y, null, g(R.value, (e, t, n, r) => {
601
+ }, T(F(e.col)), 7))), 128))], 4)]),
602
+ x("tbody", null, [(P(!0), N(b, null, g(B.value, (e, t, n, r) => {
599
603
  let i = [
600
604
  e,
601
- E.value,
602
- de.value,
603
- A(d),
604
- ot(e.row),
605
- k.value.get(e.row)
605
+ D.value,
606
+ R.value,
607
+ j(d),
608
+ at(e.row),
609
+ A.value.get(e.row)
606
610
  ];
607
- if (r && r.el && r.key === e.row && te(r, i)) return r;
608
- let s = (N(), M("tr", {
611
+ if (r && r.el && r.key === e.row && ee(r, i)) return r;
612
+ let s = (P(), N("tr", {
609
613
  key: e.row,
610
614
  style: f({ height: `${e.height}px` })
611
- }, [b("th", {
615
+ }, [x("th", {
612
616
  scope: "row",
613
617
  class: o(["pk-spreadsheet-preview__row", { "pk-spreadsheet-preview__row--current": e.row >= Z.value.r1 && e.row <= Z.value.r2 }]),
614
- style: f(E.value.frozen && e.row <= E.value.frozen.rows ? {
615
- ...rt(e.row, 0),
618
+ style: f(D.value.frozen && e.row <= D.value.frozen.rows ? {
619
+ ...De(e.row, 0),
616
620
  left: 0,
617
621
  zIndex: 4
618
622
  } : void 0)
619
- }, w(e.row), 7), (N(!0), M(y, null, g(F.value, (t) => (N(), M(y, { key: t.col }, [z.value.has(`${e.row},${t.col}`) ? D("", !0) : (N(), M("td", {
623
+ }, T(e.row), 7), (P(!0), N(b, null, g(I.value, (t) => (P(), N(b, { key: t.col }, [ue.value.has(`${e.row},${t.col}`) ? O("", !0) : (P(), N("td", {
620
624
  key: 0,
621
- rowspan: he(e.row, t.col)?.rows,
622
- colspan: he(e.row, t.col)?.cols,
625
+ rowspan: de(e.row, t.col)?.rows,
626
+ colspan: de(e.row, t.col)?.cols,
623
627
  class: o(["pk-spreadsheet-preview__cell", {
624
- "pk-spreadsheet-preview__cell--range": it(e.row, t.col) && !at(e.row, t.col),
625
- "pk-spreadsheet-preview__cell--missing": B(e.row, t.col)?.missing,
626
- "pk-spreadsheet-preview__cell--marked": re(e.row, t.col)
628
+ "pk-spreadsheet-preview__cell--range": rt(e.row, t.col) && !it(e.row, t.col),
629
+ "pk-spreadsheet-preview__cell--missing": V(e.row, t.col)?.missing,
630
+ "pk-spreadsheet-preview__cell--marked": ne(e.row, t.col)
627
631
  }]),
628
- style: f(ve(B(e.row, t.col), e.row, t.col)),
629
- "data-focus": at(e.row, t.col) ? "" : void 0,
632
+ style: f(he(V(e.row, t.col), e.row, t.col)),
633
+ "data-focus": it(e.row, t.col) ? "" : void 0,
630
634
  "data-cell": `${e.row}:${t.col}`,
631
- title: B(e.row, t.col)?.missing ? A(a)("chatFilePreview.missingValue") : void 0,
632
- onMousedown: v((n) => ct(e.row, t.col, n), ["prevent"]),
633
- onMouseenter: (n) => lt(e.row, t.col),
634
- onDblclick: pt
635
- }, w(U(B(e.row, t.col))), 47, Fe))], 64))), 128))], 4));
635
+ title: V(e.row, t.col)?.missing ? j(a)("chatFilePreview.missingValue") : void 0,
636
+ onMousedown: y((n) => st(e.row, t.col, n), ["prevent"]),
637
+ onMouseenter: (n) => ct(e.row, t.col),
638
+ onDblclick: ft
639
+ }, T(pe(V(e.row, t.col))), 47, Le))], 64))), 128))], 4));
636
640
  return s.memo = i, s;
637
641
  }, r, 0), 128))])
638
- ], 6)) : D("", !0),
639
- pe.value.length ? (N(), M("div", Ie, [(N(!0), M(y, null, g(pe.value, (e) => (N(), M("div", {
642
+ ], 6)) : O("", !0),
643
+ ce.value.length ? (P(), N("div", Re, [(P(!0), N(b, null, g(ce.value, (e) => (P(), N("div", {
640
644
  key: e.key,
641
645
  class: "pk-spreadsheet-preview__chart",
642
646
  style: f(e.css)
643
- }, [m(ke, { preview: e.chart }, null, 8, ["preview"])], 4))), 128))])) : D("", !0),
644
- E.value && (E.value.moreRows || E.value.moreColumns) ? (N(), M("p", Le, [E.value.moreRows ? (N(), M(y, { key: 0 }, [j(w(A(a)("chatFilePreview.moreRows", E.value.moreRows)), 1)], 64)) : D("", !0), E.value.moreColumns ? (N(), M(y, { key: 1 }, [j(w(A(a)("chatFilePreview.moreColumns", E.value.moreColumns)), 1)], 64)) : D("", !0)])) : D("", !0)
645
- ], 40, Pe),
646
- b("nav", {
647
+ }, [m(Oe, { preview: e.chart }, null, 8, ["preview"])], 4))), 128))])) : O("", !0),
648
+ D.value && (D.value.moreRows || D.value.moreColumns) ? (P(), N("p", ze, [D.value.moreRows ? (P(), N(b, { key: 0 }, [M(T(j(a)("chatFilePreview.moreRows", D.value.moreRows)), 1)], 64)) : O("", !0), D.value.moreColumns ? (P(), N(b, { key: 1 }, [M(T(j(a)("chatFilePreview.moreColumns", D.value.moreColumns)), 1)], 64)) : O("", !0)])) : O("", !0)
649
+ ], 40, Ie),
650
+ x("nav", {
647
651
  class: "pk-spreadsheet-preview__sheets",
648
- "aria-label": A(a)("chatFilePreview.sheets")
649
- }, [(N(!0), M(y, null, g(e.preview.sheets, (e, t) => (N(), M("button", {
652
+ "aria-label": j(a)("chatFilePreview.sheets")
653
+ }, [(P(!0), N(b, null, g(e.preview.sheets, (e, t) => (P(), N("button", {
650
654
  key: e.name,
651
655
  type: "button",
652
656
  class: "pk-spreadsheet-preview__sheet",
653
657
  "aria-current": t === h.value ? "page" : void 0,
654
658
  onClick: (e) => h.value = t
655
- }, w(e.name), 9, ze))), 128))], 8, Re),
656
- b("div", Be, [b("p", Ve, [e.preview.staleFormulas ? (N(), M("span", {
659
+ }, T(e.name), 9, Ve))), 128))], 8, Be),
660
+ x("div", He, [x("p", Ue, [e.preview.staleFormulas ? (P(), N("span", {
657
661
  key: 0,
658
662
  class: "pk-spreadsheet-preview__note",
659
- title: A(a)("chatFilePreview.staleFormulas")
660
- }, w(A(a)("chatFilePreview.staleFormulas")), 9, He)) : e.preview.computedFormulas ? (N(), M("span", {
663
+ title: j(a)("chatFilePreview.staleFormulas")
664
+ }, T(j(a)("chatFilePreview.staleFormulas")), 9, We)) : e.preview.computedFormulas ? (P(), N("span", {
661
665
  key: 1,
662
666
  class: "pk-spreadsheet-preview__note",
663
- title: A(a)("chatFilePreview.computedFormulas")
664
- }, w(A(a)("chatFilePreview.computedFormulas")), 9, Ue)) : D("", !0), Ct.value ? (N(), M("span", We, [
665
- Ct.value.average ? (N(), M("span", Ge, w(A(a)("chatFilePreview.average")) + " " + w(Ct.value.average), 1)) : D("", !0),
666
- b("span", null, w(A(a)("chatFilePreview.count")) + " " + w(Ct.value.count), 1),
667
- Ct.value.sum ? (N(), M("span", Ke, w(A(a)("chatFilePreview.sum")) + " " + w(Ct.value.sum), 1)) : D("", !0)
668
- ])) : D("", !0)]), b("div", qe, [
667
+ title: j(a)("chatFilePreview.computedFormulas")
668
+ }, T(j(a)("chatFilePreview.computedFormulas")), 9, Ge)) : O("", !0), St.value ? (P(), N("span", Ke, [
669
+ St.value.average ? (P(), N("span", qe, T(j(a)("chatFilePreview.average")) + " " + T(St.value.average), 1)) : O("", !0),
670
+ x("span", null, T(j(a)("chatFilePreview.count")) + " " + T(St.value.count), 1),
671
+ St.value.sum ? (P(), N("span", Je, T(j(a)("chatFilePreview.sum")) + " " + T(St.value.sum), 1)) : O("", !0)
672
+ ])) : O("", !0)]), x("div", Ye, [
669
673
  m(i, {
670
674
  modifiers: "action-quiet",
671
675
  icon: "ri:subtract-line",
672
- "aria-label": A(a)("chatFilePreview.zoomOut"),
673
- disabled: _.value <= .5,
674
- onClick: r[4] ||= (e) => wt(-.1)
676
+ "aria-label": j(a)("chatFilePreview.zoomOut"),
677
+ disabled: v.value <= .5,
678
+ onClick: r[4] ||= (e) => Ct(-.1)
675
679
  }, null, 8, ["aria-label", "disabled"]),
676
- b("span", Je, w(Math.round(_.value * 100)) + "% ", 1),
680
+ x("span", Xe, T(Math.round(v.value * 100)) + "% ", 1),
677
681
  m(i, {
678
682
  modifiers: "action-quiet",
679
683
  icon: "ri:add-line",
680
- "aria-label": A(a)("chatFilePreview.zoomIn"),
681
- disabled: _.value >= 2,
682
- onClick: r[5] ||= (e) => wt(.1)
684
+ "aria-label": j(a)("chatFilePreview.zoomIn"),
685
+ disabled: v.value >= 2,
686
+ onClick: r[5] ||= (e) => Ct(.1)
683
687
  }, null, 8, ["aria-label", "disabled"])
684
688
  ])])
685
689
  ]);
@@ -687,12 +691,12 @@ var Ae = { class: "pk-spreadsheet-preview" }, je = { class: "pk-spreadsheet-prev
687
691
  }
688
692
  }), [["styles", [".pk-spreadsheet-preview{--pk-spreadsheet-green:#217346;--pk-spreadsheet-green-head:#217346;--pk-spreadsheet-gridline:#e1e1e1;flex-direction:column;flex:1;min-height:0;display:flex}.pk-spreadsheet-preview__bar{min-height:var(--spacing-40);border-bottom:var(--border) solid var(--color-surface-3);background-color:var(--color-surface);font-size:var(--text-14);align-items:stretch;display:flex}.pk-spreadsheet-preview__ref{width:var(--spacing-96);padding:0 var(--spacing-12);box-sizing:border-box;border-right:var(--border) solid var(--color-surface-3);font-variant-numeric:tabular-nums;flex-shrink:0;align-items:center;display:flex}.pk-spreadsheet-preview__fx{width:var(--spacing-40);border-right:var(--border) solid var(--color-surface-3);color:var(--color-word-3);flex-shrink:0;justify-content:center;align-items:center;font-family:Georgia,serif;font-style:italic;display:flex}.pk-spreadsheet-preview__formula{min-width:0;padding:0 var(--spacing-12);text-overflow:ellipsis;white-space:nowrap;flex:1;align-items:center;display:flex;overflow:hidden}.pk-spreadsheet-preview__scroll{cursor:cell;background-color:#fff;outline:none;flex:1;min-height:0;position:relative;overflow:auto}.pk-spreadsheet-preview__scroll:focus-visible{box-shadow:inset 0 0 0 var(--spacing-2) var(--input-focus-color)}.pk-spreadsheet-preview__grid{border-collapse:collapse;table-layout:fixed;color:#000;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;font-family:Calibri,Carlito,Segoe UI,Arial,sans-serif;font-size:11pt}.pk-spreadsheet-preview__grid td{max-width:0;padding:0 var(--spacing-4);text-overflow:clip;background-color:#fff;line-height:1.2;overflow:hidden}.pk-spreadsheet-preview__grid--lines td{border:var(--border) solid var(--pk-spreadsheet-gridline)}.pk-spreadsheet-preview__charts{z-index:0;pointer-events:none;position:absolute;top:0;left:0}.pk-spreadsheet-preview__chart{pointer-events:auto;cursor:default;position:absolute}.pk-spreadsheet-preview__corner,.pk-spreadsheet-preview__head,.pk-spreadsheet-preview__row{z-index:1;box-shadow:var(--pk-spreadsheet-lines);background-color:var(--color-surface-1);color:var(--color-word-3);font-family:var(--font-family-sans);font-size:var(--text-12);font-weight:var(--font-normal);text-align:center;border-style:hidden;position:sticky}.pk-spreadsheet-preview__corner,.pk-spreadsheet-preview__head{padding:var(--spacing-4) var(--spacing-4) var(--spacing-2);vertical-align:middle;line-height:1;top:0}.pk-spreadsheet-preview__row{vertical-align:middle}.pk-spreadsheet-preview__corner{--pk-spreadsheet-lines:inset 0 0 0 var(--border) var(--color-surface-3);z-index:5;left:0}.pk-spreadsheet-preview__head{--pk-spreadsheet-lines:inset 0 var(--border) 0 var(--color-surface-3), inset calc(var(--border) * -1) calc(var(--border) * -1) 0 var(--color-surface-3)}.pk-spreadsheet-preview__row{--pk-spreadsheet-lines:inset var(--border) 0 0 var(--color-surface-3), inset calc(var(--border) * -1) calc(var(--border) * -1) 0 var(--color-surface-3);padding:0 var(--spacing-4);font-variant-numeric:tabular-nums;left:0}.pk-spreadsheet-preview__head--current{background-color:var(--color-surface-2);box-shadow:var(--pk-spreadsheet-lines), inset 0 calc((var(--spacing-2) + var(--border)) * -1) 0 var(--pk-spreadsheet-green-head);color:var(--pk-spreadsheet-green-head);font-weight:var(--font-medium)}.pk-spreadsheet-preview__row--current{background-color:var(--color-surface-2);box-shadow:var(--pk-spreadsheet-lines), inset calc((var(--spacing-2) + var(--border)) * -1) 0 0 var(--pk-spreadsheet-green-head);color:var(--pk-spreadsheet-green-head);font-weight:var(--font-medium)}.pk-spreadsheet-preview__cell[data-focus]{scroll-margin-top:var(--pk-spreadsheet-stuck-top);scroll-margin-left:var(--pk-spreadsheet-stuck-left);outline:var(--spacing-2) solid var(--pk-spreadsheet-green);outline-offset:calc(var(--spacing-2) * -1)}.pk-spreadsheet-preview__cell--range{background-image:linear-gradient(#1f1d2b1f,#1f1d2b1f)}.pk-spreadsheet-preview__cell--missing{color:#6b6880}.pk-spreadsheet-preview__cell--marked{background-image:linear-gradient(var(--pk-spreadsheet-mark), var(--pk-spreadsheet-mark));animation:pk-spreadsheet-preview-marked 3.5s var(--ease-out) forwards}@media (prefers-reduced-motion:reduce){.pk-spreadsheet-preview__cell--marked{--pk-spreadsheet-mark:#facc1573;animation:none}}.pk-spreadsheet-preview__more{padding:var(--spacing-8) var(--spacing-12);color:#6b6880;font-size:var(--text-12);margin:0;position:sticky;left:0}.pk-spreadsheet-preview__sheets{min-height:var(--spacing-32);padding-left:var(--spacing-40);border-top:var(--border) solid var(--color-surface-3);background-color:var(--color-surface-1);flex-shrink:0;display:flex;overflow-x:auto}@media (pointer:coarse){.pk-spreadsheet-preview__sheets{min-height:var(--spacing-40)}}.pk-spreadsheet-preview__status{min-height:var(--spacing-40);border-top:var(--border) solid var(--color-surface-3);background-color:var(--color-surface-1);font-size:var(--text-12);flex-shrink:0;align-items:center;display:flex}.pk-spreadsheet-preview__sheet{padding:0 var(--spacing-16);border:0;border-right:var(--border) solid var(--color-surface-3);color:var(--color-word-2);font:inherit;font-size:var(--text-12);white-space:nowrap;cursor:pointer;background:0 0;flex-shrink:0}.pk-spreadsheet-preview__sheet:first-child{border-left:var(--border) solid var(--color-surface-3)}.pk-spreadsheet-preview__sheet:hover{background-color:var(--color-surface-2)}.pk-spreadsheet-preview__sheet[aria-current=page]{background-color:var(--color-surface);box-shadow:inset 0 calc(var(--spacing-2) * -1) 0 var(--pk-spreadsheet-green-head);color:var(--pk-spreadsheet-green-head);font-weight:var(--font-semibold)}.pk-spreadsheet-preview__info{align-items:center;gap:var(--spacing-16);min-width:0;padding:0 var(--spacing-12);color:var(--color-word-2);font-variant-numeric:tabular-nums;white-space:nowrap;flex:1;margin:0;display:flex;overflow:hidden}.pk-spreadsheet-preview__note{min-width:0;color:var(--color-word-3);text-overflow:ellipsis;overflow:hidden}.pk-spreadsheet-preview__stats{gap:var(--spacing-12);flex-shrink:0;margin-left:auto;display:flex}@container (width<26rem){.pk-spreadsheet-preview__average{display:none}}.pk-spreadsheet-preview__zoom{align-items:center;gap:var(--spacing-2);padding-right:var(--spacing-8);flex-shrink:0;display:flex}.pk-spreadsheet-preview__percent{min-width:var(--spacing-40);font-variant-numeric:tabular-nums;text-align:center}@media (prefers-color-scheme:dark){:where(:host,:root,.theme):not(.theme--light) .pk-spreadsheet-preview{--pk-spreadsheet-green-head:#5fbf8f}}:where(.theme.theme--dark) .pk-spreadsheet-preview{--pk-spreadsheet-green-head:#5fbf8f}@property --pk-spreadsheet-mark{syntax:\"<color>\";inherits:false;initial-value:#0000}@keyframes pk-spreadsheet-preview-marked{0%,30%{--pk-spreadsheet-mark:#facc1573}to{--pk-spreadsheet-mark:#facc1500}}"]]]);
689
693
  // ../../packages/components/src/chat/PkWordPreviewRuns.vue?vue&type=script&setup=true&lang.ts
690
- C(), h(), T();
691
- var nt = ["src"], rt = {
694
+ w(), h(), E();
695
+ var rt = ["src"], it = {
692
696
  key: 2,
693
697
  class: "pk-word-preview__image",
694
698
  "data-quote-skip": ""
695
- }, Y = ["title"], X = ["title"], Z = ["data-quote-skip"], it = /* @__PURE__ */ k({
699
+ }, at = ["title"], ot = ["title"], Q = ["data-quote-skip"], st = /* @__PURE__ */ A({
696
700
  __name: "PkWordPreviewRuns",
697
701
  props: {
698
702
  runs: { type: Array },
@@ -701,7 +705,7 @@ var nt = ["src"], rt = {
701
705
  numbers: { type: Object }
702
706
  },
703
707
  setup(e) {
704
- let t = e, { t: n } = ae({ useScope: "global" }), i = r(ge, void 0), a = r(he, void 0), s = (e) => e.picture ? z(i?.value, e.picture.ref) : void 0, c = (e) => e.chart ? a?.value?.[e.chart.ref] : void 0, l = (e) => t.page ? B(e) : "inline", u = (e) => l(e) === "page" ? {
708
+ let t = e, { t: n } = ie({ useScope: "global" }), i = r(me, void 0), a = r(fe, void 0), s = (e) => e.picture ? H(i?.value, e.picture.ref) : void 0, c = (e) => e.chart ? a?.value?.[e.chart.ref] : void 0, l = (e) => t.page ? U(e) : "inline", u = (e) => l(e) === "page" ? {
705
709
  ...e,
706
710
  anchor: void 0
707
711
  } : e, d = (e) => {
@@ -710,7 +714,7 @@ var nt = ["src"], rt = {
710
714
  aspectRatio: `${e.width} / ${e.height}`
711
715
  }, r = e.anchor, i = t.page;
712
716
  if (!r || !i) return n;
713
- let a = r.xFrom === "page" ? r.x - i.margins.left : r.x, o = B(e);
717
+ let a = r.xFrom === "page" ? r.x - i.margins.left : r.x, o = U(e);
714
718
  if (o === "around") {
715
719
  let t = i.width - i.margins.left - i.margins.right, o = a + e.width / 2 < t / 2;
716
720
  return {
@@ -731,59 +735,59 @@ var nt = ["src"], rt = {
731
735
  top: `${r.y}pt`,
732
736
  zIndex: r.wrap === "behind" ? -1 : 1
733
737
  };
734
- }, p = (e) => e.field && t.numbers ? String(t.numbers[e.field]) : e.text, h = S(() => {
735
- let e = de(t.runs, t.mode ?? "markup"), n = (e) => {
738
+ }, p = (e) => e.field && t.numbers ? String(t.numbers[e.field]) : e.text, h = C(() => {
739
+ let e = ce(t.runs, t.mode ?? "markup"), n = (e) => {
736
740
  let n = e.picture ?? (e.chart && u(e.chart));
737
- return !!n && !!t.page && ["around", "block"].includes(B(n));
741
+ return !!n && !!t.page && ["around", "block"].includes(U(n));
738
742
  };
739
743
  return [...e.filter(n), ...e.filter((e) => !n(e))];
740
- }), ee = S(() => !t.mode || t.mode === "markup"), _ = (e) => {
744
+ }), _ = C(() => !t.mode || t.mode === "markup"), v = (e) => {
741
745
  let t = {};
742
- e.font && (t.fontFamily = me(e.font)), t.fontSize = e.size ? `${e.size}pt` : "var(--pk-word-size)", e.color && (t.color = e.color), e.highlight && (t.backgroundColor = e.highlight), e.bold && (t.fontWeight = 700), e.italic && (t.fontStyle = "italic");
746
+ e.font && (t.fontFamily = de(e.font)), t.fontSize = e.size ? `${e.size}pt` : "var(--pk-word-size)", e.color && (t.color = e.color), e.highlight && (t.backgroundColor = e.highlight), e.bold && (t.fontWeight = 700), e.italic && (t.fontStyle = "italic");
743
747
  let n = [e.underline ? "underline" : "", e.strike ? "line-through" : ""].filter(Boolean).join(" ");
744
748
  return n && (t.textDecoration = n), e.caps && (t.textTransform = "uppercase"), e.vertAlign && (t.verticalAlign = e.vertAlign, t.fontSize = `${(e.size ?? 11) * .65}pt`), t;
745
- }, v = (e) => {
746
- let t = _(e), n = new Set(String(t.textDecoration ?? "").split(" ").filter(Boolean));
749
+ }, y = (e) => {
750
+ let t = v(e), n = new Set(String(t.textDecoration ?? "").split(" ").filter(Boolean));
747
751
  return n.add(e.change === "deleted" ? "line-through" : "underline"), {
748
752
  ...t,
749
753
  textDecoration: [...n].join(" ")
750
754
  };
751
- }, b = (e) => e.author ? n("chatFilePreview.revisionBy", { author: e.author }) : void 0;
752
- return (e, t) => (N(!0), M(y, null, g(h.value, (e, t) => (N(), M(y, { key: t }, [e.image ? (N(), M(y, { key: 0 }, [e.chart && c(e) ? (N(), M("span", {
755
+ }, x = (e) => e.author ? n("chatFilePreview.revisionBy", { author: e.author }) : void 0;
756
+ return (e, t) => (P(!0), N(b, null, g(h.value, (e, t) => (P(), N(b, { key: t }, [e.image ? (P(), N(b, { key: 0 }, [e.chart && c(e) ? (P(), N("span", {
753
757
  key: 0,
754
758
  class: o(["pk-word-preview__chart", `pk-word-preview__chart--${l(u(e.chart))}`]),
755
759
  style: f(d(u(e.chart)))
756
- }, [m(ke, { preview: c(e) }, null, 8, ["preview"])], 6)) : e.picture && s(e) ? (N(), M(y, { key: 1 }, [l(e.picture) === "page" ? D("", !0) : (N(), M("img", {
760
+ }, [m(Oe, { preview: c(e) }, null, 8, ["preview"])], 6)) : e.picture && s(e) ? (P(), N(b, { key: 1 }, [l(e.picture) === "page" ? O("", !0) : (P(), N("img", {
757
761
  key: 0,
758
762
  class: o(["pk-word-preview__picture", `pk-word-preview__picture--${l(e.picture)}`]),
759
763
  style: f(d(e.picture)),
760
764
  src: s(e),
761
765
  alt: ""
762
- }, null, 14, nt))], 64)) : (N(), M("span", rt, w(A(n)("chatFilePreview.image")), 1))], 64)) : ee.value && e.change === "deleted" ? (N(), M("del", {
766
+ }, null, 14, rt))], 64)) : (P(), N("span", it, T(j(n)("chatFilePreview.image")), 1))], 64)) : _.value && e.change === "deleted" ? (P(), N("del", {
763
767
  key: 1,
764
768
  class: "pk-word-preview__removed",
765
769
  "data-quote-skip": "",
766
- style: f(v(e)),
767
- title: b(e)
768
- }, w(p(e)), 13, Y)) : ee.value && e.change === "inserted" ? (N(), M("ins", {
770
+ style: f(y(e)),
771
+ title: x(e)
772
+ }, T(p(e)), 13, at)) : _.value && e.change === "inserted" ? (P(), N("ins", {
769
773
  key: 2,
770
774
  class: "pk-word-preview__added",
771
- style: f(v(e)),
772
- title: b(e)
773
- }, w(p(e)), 13, X)) : (N(), M("span", {
775
+ style: f(y(e)),
776
+ title: x(e)
777
+ }, T(p(e)), 13, ot)) : (P(), N("span", {
774
778
  key: 3,
775
- style: f(_(e)),
779
+ style: f(v(e)),
776
780
  "data-quote-skip": e.label ? "" : void 0
777
- }, w(p(e)), 13, Z))], 64))), 128));
781
+ }, T(p(e)), 13, Q))], 64))), 128));
778
782
  }
779
783
  });
780
784
  // ../../packages/components/src/chat/PkWordPreviewBlock.vue?vue&type=script&setup=true&lang.ts
781
- C(), h();
782
- var at = { key: 0 }, ot = ["data-paragraph", "colspan"], st = [
785
+ w(), h();
786
+ var ct = { key: 0 }, lt = ["data-paragraph", "colspan"], ut = [
783
787
  "data-paragraph",
784
788
  "role",
785
789
  "aria-level"
786
- ], Q = { key: 1 }, ct = /* @__PURE__ */ k({
790
+ ], dt = { key: 1 }, ft = /* @__PURE__ */ A({
787
791
  __name: "PkWordPreviewBlock",
788
792
  props: {
789
793
  block: { type: null },
@@ -794,7 +798,7 @@ var at = { key: 0 }, ot = ["data-paragraph", "colspan"], st = [
794
798
  marked: { type: Set }
795
799
  },
796
800
  setup(e) {
797
- let t = e, n = S(() => {
801
+ let t = e, n = C(() => {
798
802
  if (t.block.kind === "table") return {};
799
803
  let e = t.block.style ?? {};
800
804
  return {
@@ -808,26 +812,26 @@ var at = { key: 0 }, ot = ["data-paragraph", "colspan"], st = [
808
812
  backgroundColor: e.shading,
809
813
  fontSize: e.size ? `${e.size}pt` : void 0
810
814
  };
811
- }), r = S(() => {
815
+ }), r = C(() => {
812
816
  if (t.block.kind === "table") return {};
813
817
  let e = -(t.block.style?.firstLine ?? 0);
814
818
  return e > 0 ? { minWidth: `calc(${e}pt * var(--pk-word-indent-scale, 1))` } : { paddingRight: "6pt" };
815
- }), i = S(() => t.mode === "markup" && t.block.kind !== "table" && t.block.runs.some((e) => e.change)), a = S(() => t.block.kind === "table" && t.row !== void 0 ? t.block.rows[t.row] : void 0), s = S(() => {
819
+ }), i = C(() => t.mode === "markup" && t.block.kind !== "table" && t.block.runs.some((e) => e.change)), a = C(() => t.block.kind === "table" && t.row !== void 0 ? t.block.rows[t.row] : void 0), s = C(() => {
816
820
  if (t.block.kind !== "table") return [];
817
821
  let e = t.block.widths ?? [], n = e.reduce((e, t) => e + t, 0);
818
822
  return n ? e.map((e) => `${e / n * 100}%`) : [];
819
- }), c = S(() => t.block.kind !== "table" && !!t.block.id && !!t.marked?.has(t.block.id)), l = (e) => !!e?.some((e) => t.marked?.has(e)), u = S(() => t.mode === "markup" && !!a.value?.some((e) => e.runs.some((e) => e.change)));
820
- return (t, d) => e.block.kind === "table" && a.value ? (N(), M("table", {
823
+ }), c = C(() => t.block.kind !== "table" && !!t.block.id && !!t.marked?.has(t.block.id)), l = (e) => !!e?.some((e) => t.marked?.has(e)), u = C(() => t.mode === "markup" && !!a.value?.some((e) => e.runs.some((e) => e.change)));
824
+ return (t, d) => e.block.kind === "table" && a.value ? (P(), N("table", {
821
825
  key: 0,
822
826
  class: o(["pk-word-preview__table", {
823
827
  "pk-word-preview__table--lines": e.block.borders,
824
828
  "pk-word-preview__table--next": e.row !== 0,
825
829
  "pk-word-preview__changed": u.value
826
830
  }])
827
- }, [s.value.length ? (N(), M("colgroup", at, [(N(!0), M(y, null, g(s.value, (e, t) => (N(), M("col", {
831
+ }, [s.value.length ? (P(), N("colgroup", ct, [(P(!0), N(b, null, g(s.value, (e, t) => (P(), N("col", {
828
832
  key: t,
829
833
  style: f({ width: e })
830
- }, null, 4))), 128))])) : D("", !0), b("tbody", null, [b("tr", null, [(N(!0), M(y, null, g(a.value, (t, n) => (N(), M("td", {
834
+ }, null, 4))), 128))])) : O("", !0), x("tbody", null, [x("tr", null, [(P(!0), N(b, null, g(a.value, (t, n) => (P(), N("td", {
831
835
  key: n,
832
836
  "data-paragraph": t.ids?.join(" "),
833
837
  class: o({ "pk-word-preview__marked": l(t.ids) }),
@@ -837,7 +841,7 @@ var at = { key: 0 }, ot = ["data-paragraph", "colspan"], st = [
837
841
  textAlign: t.align,
838
842
  fontSize: t.size ? `${t.size}pt` : void 0
839
843
  })
840
- }, [m(it, {
844
+ }, [m(st, {
841
845
  runs: t.runs,
842
846
  mode: e.mode,
843
847
  numbers: e.numbers
@@ -845,7 +849,7 @@ var at = { key: 0 }, ot = ["data-paragraph", "colspan"], st = [
845
849
  "runs",
846
850
  "mode",
847
851
  "numbers"
848
- ])], 14, ot))), 128))])])], 2)) : e.block.kind === "table" ? D("", !0) : (N(), M("div", {
852
+ ])], 14, lt))), 128))])])], 2)) : e.block.kind === "table" ? O("", !0) : (P(), N("div", {
849
853
  key: 1,
850
854
  class: o(["pk-word-preview__block", {
851
855
  "pk-word-preview__changed": i.value,
@@ -856,13 +860,13 @@ var at = { key: 0 }, ot = ["data-paragraph", "colspan"], st = [
856
860
  "aria-level": e.block.kind === "heading" ? Math.max(1, e.block.level) : void 0,
857
861
  style: f(n.value)
858
862
  }, [
859
- e.block.label ? (N(), M("span", {
863
+ e.block.label ? (P(), N("span", {
860
864
  key: 0,
861
865
  class: "pk-word-preview__label",
862
866
  "data-quote-skip": "",
863
867
  style: f(r.value)
864
- }, w(e.block.label), 5)) : D("", !0),
865
- m(it, {
868
+ }, T(e.block.label), 5)) : O("", !0),
869
+ m(st, {
866
870
  runs: e.block.runs,
867
871
  mode: e.mode,
868
872
  page: e.page,
@@ -873,13 +877,13 @@ var at = { key: 0 }, ot = ["data-paragraph", "colspan"], st = [
873
877
  "page",
874
878
  "numbers"
875
879
  ]),
876
- !e.block.label && !e.block.runs.length ? (N(), M("br", Q)) : D("", !0)
877
- ], 14, st));
880
+ !e.block.label && !e.block.runs.length ? (P(), N("br", dt)) : O("", !0)
881
+ ], 14, ut));
878
882
  }
879
883
  });
880
884
  // ../../packages/components/src/chat/PkWordPreviewPart.vue?vue&type=script&setup=true&lang.ts
881
- C(), h();
882
- var lt = { class: "pk-word-preview__part" }, ut = ["src"], dt = /* @__PURE__ */ k({
885
+ w(), h();
886
+ var $ = { class: "pk-word-preview__part" }, pt = ["src"], mt = /* @__PURE__ */ A({
883
887
  __name: "PkWordPreviewPart",
884
888
  props: {
885
889
  blocks: { type: Array },
@@ -889,13 +893,13 @@ var lt = { class: "pk-word-preview__part" }, ut = ["src"], dt = /* @__PURE__ */
889
893
  numbers: { type: Object }
890
894
  },
891
895
  setup(e) {
892
- let t = e, n = r(ge, void 0), i = S(() => pe(t.blocks, t.mode)), a = S(() => fe(t.blocks, t.mode).flatMap((e) => {
893
- let r = z(n?.value, e.ref);
896
+ let t = e, n = r(me, void 0), i = C(() => V(t.blocks, t.mode)), a = C(() => le(t.blocks, t.mode).flatMap((e) => {
897
+ let r = H(n?.value, e.ref);
894
898
  return r ? [{
895
899
  src: r,
896
- css: V(e, t.section.page)
900
+ css: pe(e, t.section.page)
897
901
  }] : [];
898
- })), o = S(() => {
902
+ })), o = C(() => {
899
903
  let { margins: e } = t.section.page;
900
904
  return {
901
905
  left: `${e.left}pt`,
@@ -903,10 +907,10 @@ var lt = { class: "pk-word-preview__part" }, ut = ["src"], dt = /* @__PURE__ */
903
907
  ...t.where === "header" ? { top: `${t.section.headerDistance}pt` } : { bottom: `${t.section.footerDistance}pt` }
904
908
  };
905
909
  });
906
- return (t, n) => (N(), M("div", lt, [b("div", {
910
+ return (t, n) => (P(), N("div", $, [x("div", {
907
911
  class: "pk-word-preview__part-flow",
908
912
  style: f(o.value)
909
- }, [(N(!0), M(y, null, g(i.value, (t) => (N(), _(ct, {
913
+ }, [(P(!0), N(b, null, g(i.value, (t) => (P(), v(ft, {
910
914
  key: t.key,
911
915
  block: e.blocks[t.block],
912
916
  row: t.row,
@@ -919,48 +923,48 @@ var lt = { class: "pk-word-preview__part" }, ut = ["src"], dt = /* @__PURE__ */
919
923
  "mode",
920
924
  "page",
921
925
  "numbers"
922
- ]))), 128))], 4), (N(!0), M(y, null, g(a.value, (e, t) => (N(), M("img", {
926
+ ]))), 128))], 4), (P(!0), N(b, null, g(a.value, (e, t) => (P(), N("img", {
923
927
  key: t,
924
928
  class: "pk-word-preview__float",
925
929
  style: f(e.css),
926
930
  src: e.src,
927
931
  alt: ""
928
- }, null, 12, ut))), 128))]));
932
+ }, null, 12, pt))), 128))]));
929
933
  }
930
934
  });
931
935
  // ../../packages/components/src/chat/PkWordPreview.vue?vue&type=script&setup=true&lang.ts
932
- C(), T(), h();
933
- var ft = ["aria-label"], pt = {
936
+ w(), E(), h();
937
+ var ht = ["aria-label"], gt = {
934
938
  class: "pk-word-preview__tabs",
935
939
  role: "tablist"
936
- }, $ = ["aria-selected"], mt = ["aria-selected"], ht = {
940
+ }, _t = ["aria-selected"], vt = ["aria-selected"], yt = {
937
941
  key: 0,
938
942
  class: "pk-word-preview__list"
939
- }, gt = ["aria-current", "onClick"], _t = { class: "pk-word-preview__entry-text" }, vt = {
943
+ }, bt = ["aria-current", "onClick"], xt = { class: "pk-word-preview__entry-text" }, St = {
940
944
  key: 0,
941
945
  class: "u-dot"
942
- }, yt = {
946
+ }, Ct = {
943
947
  key: 0,
944
948
  class: "pk-word-preview__none"
945
- }, bt = {
949
+ }, wt = {
946
950
  key: 1,
947
951
  class: "pk-word-preview__list"
948
- }, xt = ["onClick"], St = {
952
+ }, Tt = ["onClick"], Et = {
949
953
  key: 0,
950
954
  class: "pk-word-preview__removed"
951
- }, Ct = {
955
+ }, Dt = {
952
956
  key: 1,
953
957
  class: "pk-word-preview__added"
954
- }, wt = { class: "pk-word-preview__main" }, Tt = ["aria-label"], Et = ["src"], Dt = {
958
+ }, Ot = { class: "pk-word-preview__main" }, kt = ["aria-label"], At = ["src"], jt = {
955
959
  key: 2,
956
960
  class: "pk-word-preview__truncated"
957
- }, Ot = { class: "pk-word-preview__status" }, kt = {
961
+ }, Mt = { class: "pk-word-preview__status" }, Nt = {
958
962
  key: 0,
959
963
  class: "pk-word-preview__count"
960
- }, At = { class: "pk-word-preview__count" }, jt = {
964
+ }, Pt = { class: "pk-word-preview__count" }, Ft = {
961
965
  key: 1,
962
966
  class: "pk-word-preview__legend"
963
- }, Mt = ["title"], Nt = { class: "pk-word-preview__removed" }, Pt = { class: "pk-word-preview__added" }, Ft = { class: "pk-word-preview__percent" }, It = ["data-part"], Lt = 96 / 72, Rt = .5, zt = /*#__PURE__*/ L(/* @__PURE__ */ k({
967
+ }, It = ["title"], Lt = { class: "pk-word-preview__removed" }, Rt = { class: "pk-word-preview__added" }, zt = { class: "pk-word-preview__percent" }, Bt = ["data-part"], Vt = 96 / 72, Ht = .5, Ut = /*#__PURE__*/ L(/* @__PURE__ */ A({
964
968
  __name: "PkWordPreview",
965
969
  props: /*@__PURE__*/ d({
966
970
  preview: { type: null },
@@ -977,24 +981,24 @@ var ft = ["aria-label"], pt = {
977
981
  }),
978
982
  emits: /*@__PURE__*/ d(["select"], ["update:fit", "update:zoom"]),
979
983
  setup(e, { emit: n }) {
980
- let r = e, a = n, { t: d } = ae({ useScope: "global" });
981
- i(ge, S(() => r.preview.images)), i(he, S(() => r.preview.charts));
982
- let h = (e) => de(e, r.mode), v = S(() => pe(r.preview.blocks, r.mode)), te = ee("rootEl"), C = ee("scrollEl"), T = ee("measureEl"), { width: ne } = ie(te), { width: E } = ie(C), O = S(() => ne.value >= 1e3), k = S(() => r.preview.sections?.length ? r.preview.sections : [{
984
+ let r = e, a = n, { t: d } = ie({ useScope: "global" });
985
+ i(me, C(() => r.preview.images)), i(fe, C(() => r.preview.charts));
986
+ let h = (e) => ce(e, r.mode), y = C(() => V(r.preview.blocks, r.mode)), ee = _("rootEl"), w = _("scrollEl"), E = _("measureEl"), { width: te } = re(ee), { width: D } = re(w), k = C(() => te.value >= 1e3), A = C(() => r.preview.sections?.length ? r.preview.sections : [{
983
987
  page: r.preview.page,
984
988
  headerDistance: 0,
985
989
  footerDistance: 0,
986
990
  headers: {},
987
991
  footers: {}
988
- }]), j = S(() => k.value[0].page), re = S(() => (E.value - 48) / (j.value.width * Lt)), P = S(() => ne.value === 0 || E.value === 0 || re.value >= Rt), ce = S(() => ({
989
- fontFamily: me(r.preview.defaults.font),
992
+ }]), M = C(() => A.value[0].page), ne = C(() => (D.value - 48) / (M.value.width * Vt)), F = C(() => te.value === 0 || D.value === 0 || ne.value >= Ht), se = C(() => ({
993
+ fontFamily: de(r.preview.defaults.font),
990
994
  fontSize: `${r.preview.defaults.size}pt`,
991
995
  color: r.preview.defaults.color ?? "#000000",
992
- "--pk-word-line": R(r.preview.defaults.font),
996
+ "--pk-word-line": ue(r.preview.defaults.font),
993
997
  "--pk-word-size": `${r.preview.defaults.size}pt`
994
- })), F = S(() => j.value.width - j.value.margins.left - j.value.margins.right), le = S(() => ({
995
- ...ce.value,
996
- width: `${F.value}pt`
997
- })), I = ee("flowEl"), { width: ue } = ie(I), L = S(() => {
998
+ })), I = C(() => M.value.width - M.value.margins.left - M.value.margins.right), L = C(() => ({
999
+ ...se.value,
1000
+ width: `${I.value}pt`
1001
+ })), R = _("flowEl"), { width: z } = re(R), B = C(() => {
998
1002
  let e = /* @__PURE__ */ new Map(), t = 0;
999
1003
  for (let n of r.preview.blocks) {
1000
1004
  if (n.kind === "table") continue;
@@ -1007,37 +1011,37 @@ var ft = ["aria-label"], pt = {
1007
1011
  let n = 0;
1008
1012
  for (let [r, i] of [...e].sort((e, t) => e[0] - t[0])) if (n += i, n > t / 10) return r;
1009
1013
  return 0;
1010
- }), B = S(() => ({
1011
- ...ce.value,
1012
- "--pk-word-indent-shared": `${L.value}pt`,
1013
- "--pk-word-indent-scale": ue.value ? Math.min(1, ue.value / (F.value * Lt)) : 1
1014
- })), H = x([]), _e = x({}), U = async () => {
1014
+ }), U = C(() => ({
1015
+ ...se.value,
1016
+ "--pk-word-indent-shared": `${B.value}pt`,
1017
+ "--pk-word-indent-scale": z.value ? Math.min(1, z.value / (I.value * Vt)) : 1
1018
+ })), W = S([]), he = S({}), ge = async () => {
1015
1019
  await s();
1016
- let e = T.value?.querySelectorAll("[data-item]");
1017
- H.value = [...e ?? []].map((e) => e.getBoundingClientRect().height);
1018
- let t = T.value?.querySelectorAll("[data-part]");
1019
- _e.value = Object.fromEntries([...t ?? []].map((e) => [e.dataset.part ?? "", e.getBoundingClientRect().height]));
1020
+ let e = E.value?.querySelectorAll("[data-item]");
1021
+ W.value = [...e ?? []].map((e) => e.getBoundingClientRect().height);
1022
+ let t = E.value?.querySelectorAll("[data-part]");
1023
+ he.value = Object.fromEntries([...t ?? []].map((e) => [e.dataset.part ?? "", e.getBoundingClientRect().height]));
1020
1024
  };
1021
1025
  p([
1022
- v,
1023
- P,
1026
+ y,
1027
+ F,
1024
1028
  () => r.preview.parts
1025
- ], U, { flush: "post" }), u(() => {
1026
- U(), document.fonts?.ready.then(U);
1029
+ ], ge, { flush: "post" }), u(() => {
1030
+ ge(), document.fonts?.ready.then(ge);
1027
1031
  });
1028
- let W = S(() => {
1029
- if (!P.value || H.value.length !== v.value.length) return [{
1030
- items: v.value.map((e, t) => t),
1032
+ let G = C(() => {
1033
+ if (!F.value || W.value.length !== y.value.length) return [{
1034
+ items: y.value.map((e, t) => t),
1031
1035
  section: 0,
1032
1036
  number: 1,
1033
- top: j.value.margins.top,
1034
- bottom: j.value.margins.bottom
1037
+ top: M.value.margins.top,
1038
+ bottom: M.value.margins.bottom
1035
1039
  }];
1036
1040
  let e = [], t = 0, n = !0, i = 0, a, o = () => {
1037
- let r = k.value[t];
1041
+ let r = A.value[t];
1038
1042
  return n && r.pageStart !== void 0 ? r.pageStart : (a ?? e[e.length - 1]?.number ?? 0) + 1;
1039
1043
  }, s = (e) => {
1040
- let i = k.value[t], a = (t) => n && i.titlePage ? t.first : r.preview.evenAndOddHeaders && e % 2 == 0 ? t.even : t.default, o = a(i.headers), s = a(i.footers), c = (e) => e ? (_e.value[e] ?? 0) / Lt : 0;
1044
+ let i = A.value[t], a = (t) => n && i.titlePage ? t.first : r.preview.evenAndOddHeaders && e % 2 == 0 ? t.even : t.default, o = a(i.headers), s = a(i.footers), c = (e) => e ? (he.value[e] ?? 0) / Vt : 0;
1041
1045
  return {
1042
1046
  header: o,
1043
1047
  footer: s,
@@ -1053,177 +1057,177 @@ var ft = ["aria-label"], pt = {
1053
1057
  ...s(r)
1054
1058
  }), n = !1, i = 0;
1055
1059
  };
1056
- return v.value.forEach((r, l) => {
1057
- r.section !== void 0 && r.section !== t && k.value[r.section] && (t = r.section, n = r.breakBefore || !e.length, n || (a = k.value[t].pageStart));
1058
- let u = e[e.length - 1], d = u && k.value[u.section].page, f = d ? (d.height - u.top - u.bottom) * Lt : 0, p = H.value[l];
1059
- for (let e = l; v.value[e]?.keepNext && e + 1 < v.value.length && !v.value[e + 1].breakBefore; e++) p += H.value[e + 1];
1060
- (!u || u.items.length && (r.breakBefore || i + H.value[l] > f || i + p > f && p <= (() => {
1060
+ return y.value.forEach((r, l) => {
1061
+ r.section !== void 0 && r.section !== t && A.value[r.section] && (t = r.section, n = r.breakBefore || !e.length, n || (a = A.value[t].pageStart));
1062
+ let u = e[e.length - 1], d = u && A.value[u.section].page, f = d ? (d.height - u.top - u.bottom) * Vt : 0, p = W.value[l];
1063
+ for (let e = l; y.value[e]?.keepNext && e + 1 < y.value.length && !y.value[e + 1].breakBefore; e++) p += W.value[e + 1];
1064
+ (!u || u.items.length && (r.breakBefore || i + W.value[l] > f || i + p > f && p <= (() => {
1061
1065
  let e = s(o());
1062
- return (k.value[t].page.height - e.top - e.bottom) * Lt;
1063
- })())) && c(), e[e.length - 1].items.push(l), i += H.value[l];
1066
+ return (A.value[t].page.height - e.top - e.bottom) * Vt;
1067
+ })())) && c(), e[e.length - 1].items.push(l), i += W.value[l];
1064
1068
  }), e.length || c(), e;
1065
- }), G = S(() => {
1069
+ }), K = C(() => {
1066
1070
  let e = /* @__PURE__ */ new Map();
1067
- for (let t of W.value) e.set(t.section, (e.get(t.section) ?? 0) + 1);
1068
- return W.value.map((t) => ({
1071
+ for (let t of G.value) e.set(t.section, (e.get(t.section) ?? 0) + 1);
1072
+ return G.value.map((t) => ({
1069
1073
  page: t.number,
1070
- pages: W.value.length,
1074
+ pages: G.value.length,
1071
1075
  sectionPages: e.get(t.section) ?? 1
1072
1076
  }));
1073
- }), ve = (e) => {
1074
- let t = k.value[e.section].page;
1077
+ }), _e = (e) => {
1078
+ let t = A.value[e.section].page;
1075
1079
  return {
1076
- ...ce.value,
1080
+ ...se.value,
1077
1081
  width: `${t.width}pt`,
1078
1082
  minHeight: `${t.height}pt`,
1079
1083
  padding: `${e.top}pt ${t.margins.right}pt ${e.bottom}pt ${t.margins.left}pt`
1080
1084
  };
1081
- }, K = (e) => {
1082
- let t = [...new Set(e.items.map((e) => v.value[e].block))];
1083
- return fe(t.map((e) => r.preview.blocks[e]), r.mode).flatMap((t) => {
1084
- let n = z(r.preview.images, t.ref);
1085
+ }, q = (e) => {
1086
+ let t = [...new Set(e.items.map((e) => y.value[e].block))];
1087
+ return le(t.map((e) => r.preview.blocks[e]), r.mode).flatMap((t) => {
1088
+ let n = H(r.preview.images, t.ref);
1085
1089
  return n ? [{
1086
1090
  src: n,
1087
- css: V(t, k.value[e.section].page)
1091
+ css: pe(t, A.value[e.section].page)
1088
1092
  }] : [];
1089
1093
  });
1090
- }, q = l(e, "fit"), ye = l(e, "zoom"), J = S(() => q.value ? Math.min(1.25, Math.max(.3, re.value)) : ye.value), be = (e) => {
1091
- ye.value = Math.min(2, Math.max(.3, Math.round((J.value + e) * 10) / 10)), q.value = !1;
1092
- }, xe = x(0), Se = x(), we = () => {
1093
- let e = C.value?.getBoundingClientRect();
1094
+ }, J = l(e, "fit"), ve = l(e, "zoom"), ye = C(() => J.value ? Math.min(1.25, Math.max(.3, ne.value)) : ve.value), be = (e) => {
1095
+ ve.value = Math.min(2, Math.max(.3, Math.round((ye.value + e) * 10) / 10)), J.value = !1;
1096
+ }, xe = S(0), Se = S(), we = () => {
1097
+ let e = w.value?.getBoundingClientRect();
1094
1098
  if (!e) return;
1095
- let t = C.value?.querySelectorAll("[data-page]") ?? [], n = 0;
1099
+ let t = w.value?.querySelectorAll("[data-page]") ?? [], n = 0;
1096
1100
  for (let [r, i] of [...t].entries()) {
1097
1101
  if (i.getBoundingClientRect().top - e.top > e.height / 3) break;
1098
1102
  n = r;
1099
1103
  }
1100
1104
  xe.value = n;
1101
1105
  let r;
1102
- for (let t of ke.value) {
1103
- let n = C.value?.querySelector(`[data-key="${t.key}"]`);
1106
+ for (let t of Oe.value) {
1107
+ let n = w.value?.querySelector(`[data-key="${t.key}"]`);
1104
1108
  if (n) {
1105
1109
  if (n.getBoundingClientRect().top - e.top > 48) break;
1106
1110
  r = t.key;
1107
1111
  }
1108
1112
  }
1109
- Se.value = r ?? ke.value[0]?.key;
1113
+ Se.value = r ?? Oe.value[0]?.key;
1110
1114
  }, Te = 0, Ee = () => {
1111
1115
  Te ||= requestAnimationFrame(() => {
1112
1116
  Te = 0, we();
1113
1117
  });
1114
1118
  };
1115
- c(() => cancelAnimationFrame(Te)), p(W, () => s(Ee));
1116
- let { selection: De } = oe({
1117
- root: () => C.value?.getRootNode(),
1119
+ c(() => cancelAnimationFrame(Te)), p(G, () => s(Ee));
1120
+ let { selection: De } = ae({
1121
+ root: () => w.value?.getRootNode(),
1118
1122
  touch: !0
1119
1123
  });
1120
1124
  p(De, (e) => {
1121
- let t = C.value;
1125
+ let t = w.value;
1122
1126
  a("select", e && t ? Ce(t, e.range, ".pk-word-preview__measure, .pk-word-preview__part") : void 0);
1123
1127
  });
1124
- let Oe = (e) => h(e).map((e) => e.text).join("").replace(/\s+/g, " ").trim(), ke = S(() => v.value.flatMap((e) => {
1125
- let t = r.preview.blocks[e.block], n = t.kind === "heading" ? [t.label, Oe(t.runs)].filter(Boolean).join(" ") : "";
1128
+ let Y = (e) => h(e).map((e) => e.text).join("").replace(/\s+/g, " ").trim(), Oe = C(() => y.value.flatMap((e) => {
1129
+ let t = r.preview.blocks[e.block], n = t.kind === "heading" ? [t.label, Y(t.runs)].filter(Boolean).join(" ") : "";
1126
1130
  return t.kind === "heading" && t.level <= 3 && n ? [{
1127
1131
  key: e.key,
1128
1132
  level: t.level,
1129
1133
  text: n
1130
1134
  }] : [];
1131
- })), Ae = (e) => e.length > 60 ? `${e.slice(0, 60)}…` : e, je = S(() => v.value.flatMap((e) => {
1135
+ })), X = (e) => e.length > 60 ? `${e.slice(0, 60)}…` : e, ke = C(() => y.value.flatMap((e) => {
1132
1136
  let t = r.preview.blocks[e.block], n = t.kind === "table" ? (t.rows[e.row ?? 0] ?? []).flatMap((e) => e.runs) : t.runs, i = n.filter((e) => e.change === "deleted").map((e) => e.text).join(" ").trim(), a = n.filter((e) => e.change === "inserted").map((e) => e.text).join(" ").trim();
1133
1137
  return i || a ? [{
1134
1138
  key: e.key,
1135
- removed: Ae(i),
1136
- added: Ae(a)
1139
+ removed: X(i),
1140
+ added: X(a)
1137
1141
  }] : [];
1138
- })), Me;
1139
- p([() => r.marked, W], ([e]) => {
1140
- !e || e === Me || P.value && H.value.length !== v.value.length || se(C.value, ".pk-word-preview__marked") && (Me = e);
1142
+ })), Ae;
1143
+ p([() => r.marked, G], ([e]) => {
1144
+ !e || e === Ae || F.value && W.value.length !== y.value.length || oe(w.value, ".pk-word-preview__marked") && (Ae = e);
1141
1145
  }, {
1142
1146
  flush: "post",
1143
1147
  immediate: !0
1144
1148
  });
1145
- let Ne = x("outline"), Pe = x(!1), Fe = (e) => {
1146
- C.value?.querySelector(`[data-key="${e}"]`)?.scrollIntoView({
1149
+ let je = S("outline"), Me = S(!1), Ne = (e) => {
1150
+ w.value?.querySelector(`[data-key="${e}"]`)?.scrollIntoView({
1147
1151
  block: "start",
1148
1152
  behavior: "smooth"
1149
- }), O.value || (Pe.value = !1);
1150
- }, Ie = S(() => r.preview.blocks.flatMap((e) => e.kind === "table" ? e.rows.flat().map((e) => Oe(e.runs)) : [Oe(e.runs)]).join(" ").split(/\s+/).filter(Boolean).length), Le = S(() => r.preview.revisionAuthors.join(", "));
1153
+ }), k.value || (Me.value = !1);
1154
+ }, Pe = C(() => r.preview.blocks.flatMap((e) => e.kind === "table" ? e.rows.flat().map((e) => Y(e.runs)) : [Y(e.runs)]).join(" ").split(/\s+/).filter(Boolean).length), Fe = C(() => r.preview.revisionAuthors.join(", "));
1151
1155
  return (n, r) => {
1152
1156
  let i = t;
1153
- return N(), M("div", {
1157
+ return P(), N("div", {
1154
1158
  ref_key: "rootEl",
1155
- ref: te,
1156
- class: o(["pk-word-preview", { "pk-word-preview--paged": P.value }])
1159
+ ref: ee,
1160
+ class: o(["pk-word-preview", { "pk-word-preview--paged": F.value }])
1157
1161
  }, [
1158
- (O.value || Pe.value) && (ke.value.length || je.value.length) ? (N(), M("aside", {
1162
+ (k.value || Me.value) && (Oe.value.length || ke.value.length) ? (P(), N("aside", {
1159
1163
  key: 0,
1160
- class: o(["pk-word-preview__side", { "pk-word-preview__side--over": !O.value }]),
1161
- "aria-label": A(d)("chatFilePreview.outline")
1162
- }, [b("div", pt, [b("button", {
1164
+ class: o(["pk-word-preview__side", { "pk-word-preview__side--over": !k.value }]),
1165
+ "aria-label": j(d)("chatFilePreview.outline")
1166
+ }, [x("div", gt, [x("button", {
1163
1167
  type: "button",
1164
1168
  role: "tab",
1165
1169
  class: "pk-word-preview__tab",
1166
- "aria-selected": Ne.value === "outline",
1167
- onClick: r[0] ||= (e) => Ne.value = "outline"
1168
- }, w(A(d)("chatFilePreview.outline")), 9, $), je.value.length ? (N(), M("button", {
1170
+ "aria-selected": je.value === "outline",
1171
+ onClick: r[0] ||= (e) => je.value = "outline"
1172
+ }, T(j(d)("chatFilePreview.outline")), 9, _t), ke.value.length ? (P(), N("button", {
1169
1173
  key: 0,
1170
1174
  type: "button",
1171
1175
  role: "tab",
1172
1176
  class: "pk-word-preview__tab",
1173
- "aria-selected": Ne.value === "changes",
1174
- onClick: r[1] ||= (e) => Ne.value = "changes"
1175
- }, w(A(d)("chatFilePreview.changes", { count: je.value.length })), 9, mt)) : D("", !0)]), Ne.value === "outline" || !je.value.length ? (N(), M("nav", ht, [(N(!0), M(y, null, g(ke.value, (e) => (N(), M("button", {
1177
+ "aria-selected": je.value === "changes",
1178
+ onClick: r[1] ||= (e) => je.value = "changes"
1179
+ }, T(j(d)("chatFilePreview.changes", { count: ke.value.length })), 9, vt)) : O("", !0)]), je.value === "outline" || !ke.value.length ? (P(), N("nav", yt, [(P(!0), N(b, null, g(Oe.value, (e) => (P(), N("button", {
1176
1180
  key: e.key,
1177
1181
  type: "button",
1178
1182
  class: o(["pk-word-preview__entry", `pk-word-preview__entry--${Math.min(e.level, 3)}`]),
1179
1183
  "aria-current": Se.value === e.key ? "location" : void 0,
1180
- onClick: (t) => Fe(e.key)
1181
- }, [b("span", _t, w(e.text), 1), je.value.some((t) => t.key === e.key) ? (N(), M("span", vt)) : D("", !0)], 10, gt))), 128)), ke.value.length ? D("", !0) : (N(), M("p", yt, w(A(d)("chatFilePreview.noHeadings")), 1))])) : (N(), M("nav", bt, [(N(!0), M(y, null, g(je.value, (e) => (N(), M("button", {
1184
+ onClick: (t) => Ne(e.key)
1185
+ }, [x("span", xt, T(e.text), 1), ke.value.some((t) => t.key === e.key) ? (P(), N("span", St)) : O("", !0)], 10, bt))), 128)), Oe.value.length ? O("", !0) : (P(), N("p", Ct, T(j(d)("chatFilePreview.noHeadings")), 1))])) : (P(), N("nav", wt, [(P(!0), N(b, null, g(ke.value, (e) => (P(), N("button", {
1182
1186
  key: e.key,
1183
1187
  type: "button",
1184
1188
  class: "pk-word-preview__entry pk-word-preview__entry--change",
1185
- onClick: (t) => Fe(e.key)
1186
- }, [e.removed ? (N(), M("del", St, w(e.removed), 1)) : D("", !0), e.added ? (N(), M("ins", Ct, w(e.added), 1)) : D("", !0)], 8, xt))), 128))]))], 10, ft)) : D("", !0),
1187
- b("div", wt, [b("div", {
1189
+ onClick: (t) => Ne(e.key)
1190
+ }, [e.removed ? (P(), N("del", Et, T(e.removed), 1)) : O("", !0), e.added ? (P(), N("ins", Dt, T(e.added), 1)) : O("", !0)], 8, Tt))), 128))]))], 10, ht)) : O("", !0),
1191
+ x("div", Ot, [x("div", {
1188
1192
  ref_key: "scrollEl",
1189
- ref: C,
1193
+ ref: w,
1190
1194
  class: "pk-word-preview__scroll",
1191
1195
  onScroll: Ee
1192
- }, [P.value ? (N(), M("div", {
1196
+ }, [F.value ? (P(), N("div", {
1193
1197
  key: 0,
1194
1198
  class: "pk-word-preview__pages",
1195
- style: f({ zoom: J.value })
1196
- }, [(N(!0), M(y, null, g(W.value, (t, n) => (N(), M("article", {
1199
+ style: f({ zoom: ye.value })
1200
+ }, [(P(!0), N(b, null, g(G.value, (t, n) => (P(), N("article", {
1197
1201
  key: n,
1198
1202
  "data-page": "",
1199
1203
  class: "pk-word-preview__page",
1200
- "aria-label": A(d)("chatFilePreview.pageOf", {
1204
+ "aria-label": j(d)("chatFilePreview.pageOf", {
1201
1205
  page: n + 1,
1202
- count: W.value.length
1206
+ count: G.value.length
1203
1207
  }),
1204
- style: f(ve(t))
1208
+ style: f(_e(t))
1205
1209
  }, [
1206
- t.header && e.preview.parts?.[t.header] ? (N(), _(dt, {
1210
+ t.header && e.preview.parts?.[t.header] ? (P(), v(mt, {
1207
1211
  key: 0,
1208
1212
  blocks: e.preview.parts[t.header],
1209
1213
  where: "header",
1210
- section: k.value[t.section],
1214
+ section: A.value[t.section],
1211
1215
  mode: e.mode,
1212
- numbers: G.value[n]
1216
+ numbers: K.value[n]
1213
1217
  }, null, 8, [
1214
1218
  "blocks",
1215
1219
  "section",
1216
1220
  "mode",
1217
1221
  "numbers"
1218
- ])) : D("", !0),
1219
- (N(!0), M(y, null, g(t.items, (r) => (N(), _(ct, {
1220
- key: v.value[r].key,
1221
- "data-key": v.value[r].key,
1222
- block: e.preview.blocks[v.value[r].block],
1223
- row: v.value[r].row,
1222
+ ])) : O("", !0),
1223
+ (P(!0), N(b, null, g(t.items, (r) => (P(), v(ft, {
1224
+ key: y.value[r].key,
1225
+ "data-key": y.value[r].key,
1226
+ block: e.preview.blocks[y.value[r].block],
1227
+ row: y.value[r].row,
1224
1228
  mode: e.mode,
1225
- page: k.value[t.section].page,
1226
- numbers: G.value[n],
1229
+ page: A.value[t.section].page,
1230
+ numbers: K.value[n],
1227
1231
  marked: e.marked
1228
1232
  }, null, 8, [
1229
1233
  "data-key",
@@ -1234,33 +1238,33 @@ var ft = ["aria-label"], pt = {
1234
1238
  "numbers",
1235
1239
  "marked"
1236
1240
  ]))), 128)),
1237
- (N(!0), M(y, null, g(K(t), (e, t) => (N(), M("img", {
1241
+ (P(!0), N(b, null, g(q(t), (e, t) => (P(), N("img", {
1238
1242
  key: `image-${t}`,
1239
1243
  class: "pk-word-preview__float",
1240
1244
  style: f(e.css),
1241
1245
  src: e.src,
1242
1246
  alt: ""
1243
- }, null, 12, Et))), 128)),
1244
- t.footer && e.preview.parts?.[t.footer] ? (N(), _(dt, {
1247
+ }, null, 12, At))), 128)),
1248
+ t.footer && e.preview.parts?.[t.footer] ? (P(), v(mt, {
1245
1249
  key: 1,
1246
1250
  blocks: e.preview.parts[t.footer],
1247
1251
  where: "footer",
1248
- section: k.value[t.section],
1252
+ section: A.value[t.section],
1249
1253
  mode: e.mode,
1250
- numbers: G.value[n]
1254
+ numbers: K.value[n]
1251
1255
  }, null, 8, [
1252
1256
  "blocks",
1253
1257
  "section",
1254
1258
  "mode",
1255
1259
  "numbers"
1256
- ])) : D("", !0)
1257
- ], 12, Tt))), 128))], 4)) : (N(), M("article", {
1260
+ ])) : O("", !0)
1261
+ ], 12, kt))), 128))], 4)) : (P(), N("article", {
1258
1262
  key: 1,
1259
1263
  ref_key: "flowEl",
1260
- ref: I,
1264
+ ref: R,
1261
1265
  class: "pk-word-preview__page pk-word-preview__page--flow",
1262
- style: f(B.value)
1263
- }, [(N(!0), M(y, null, g(v.value, (t) => (N(), _(ct, {
1266
+ style: f(U.value)
1267
+ }, [(P(!0), N(b, null, g(y.value, (t) => (P(), v(ft, {
1264
1268
  key: t.key,
1265
1269
  "data-key": t.key,
1266
1270
  block: e.preview.blocks[t.block],
@@ -1273,47 +1277,47 @@ var ft = ["aria-label"], pt = {
1273
1277
  "row",
1274
1278
  "mode",
1275
1279
  "marked"
1276
- ]))), 128))], 4)), e.preview.truncated ? (N(), M("p", Dt, w(A(d)("chatFilePreview.truncated")), 1)) : D("", !0)], 544), b("div", Ot, [
1277
- P.value ? (N(), M("span", kt, w(A(d)("chatFilePreview.pageOf", {
1280
+ ]))), 128))], 4)), e.preview.truncated ? (P(), N("p", jt, T(j(d)("chatFilePreview.truncated")), 1)) : O("", !0)], 544), x("div", Mt, [
1281
+ F.value ? (P(), N("span", Nt, T(j(d)("chatFilePreview.pageOf", {
1278
1282
  page: xe.value + 1,
1279
- count: W.value.length
1280
- })), 1)) : D("", !0),
1281
- b("span", At, w(A(d)("chatFilePreview.words", Ie.value)), 1),
1282
- e.mode === "markup" && e.preview.revisionAuthors.length ? (N(), M("span", jt, [
1283
- b("span", {
1283
+ count: G.value.length
1284
+ })), 1)) : O("", !0),
1285
+ x("span", Pt, T(j(d)("chatFilePreview.words", Pe.value)), 1),
1286
+ e.mode === "markup" && e.preview.revisionAuthors.length ? (P(), N("span", Ft, [
1287
+ x("span", {
1284
1288
  class: "pk-word-preview__legend-text",
1285
- title: A(d)("chatFilePreview.revisionsOf", { authors: Le.value })
1286
- }, w(A(d)("chatFilePreview.revisionsOf", { authors: Le.value })), 9, Mt),
1287
- b("del", Nt, w(A(d)("chatFilePreview.removed")), 1),
1288
- b("ins", Pt, w(A(d)("chatFilePreview.added")), 1)
1289
- ])) : D("", !0),
1290
- r[6] ||= b("span", { class: "pk-word-preview__spacer" }, null, -1),
1291
- !O.value && (ke.value.length || je.value.length) ? (N(), _(i, {
1289
+ title: j(d)("chatFilePreview.revisionsOf", { authors: Fe.value })
1290
+ }, T(j(d)("chatFilePreview.revisionsOf", { authors: Fe.value })), 9, It),
1291
+ x("del", Lt, T(j(d)("chatFilePreview.removed")), 1),
1292
+ x("ins", Rt, T(j(d)("chatFilePreview.added")), 1)
1293
+ ])) : O("", !0),
1294
+ r[6] ||= x("span", { class: "pk-word-preview__spacer" }, null, -1),
1295
+ !k.value && (Oe.value.length || ke.value.length) ? (P(), v(i, {
1292
1296
  key: 2,
1293
1297
  class: "pk-word-preview__outline-toggle",
1294
1298
  modifiers: "action-quiet",
1295
1299
  icon: "ri:list-unordered",
1296
- label: A(d)("chatFilePreview.outline"),
1297
- title: A(d)("chatFilePreview.outline"),
1298
- "aria-label": A(d)("chatFilePreview.outline"),
1299
- "aria-expanded": Pe.value,
1300
- onClick: r[2] ||= (e) => Pe.value = !Pe.value
1300
+ label: j(d)("chatFilePreview.outline"),
1301
+ title: j(d)("chatFilePreview.outline"),
1302
+ "aria-label": j(d)("chatFilePreview.outline"),
1303
+ "aria-expanded": Me.value,
1304
+ onClick: r[2] ||= (e) => Me.value = !Me.value
1301
1305
  }, null, 8, [
1302
1306
  "label",
1303
1307
  "title",
1304
1308
  "aria-label",
1305
1309
  "aria-expanded"
1306
- ])) : D("", !0),
1307
- P.value ? (N(), M(y, { key: 3 }, [
1310
+ ])) : O("", !0),
1311
+ F.value ? (P(), N(b, { key: 3 }, [
1308
1312
  m(i, {
1309
1313
  class: "pk-word-preview__fit",
1310
1314
  modifiers: "action-quiet",
1311
1315
  icon: "ri:expand-width-line",
1312
- label: A(d)("chatFilePreview.fitWidth"),
1313
- title: A(d)("chatFilePreview.fitWidth"),
1314
- "aria-label": A(d)("chatFilePreview.fitWidth"),
1315
- disabled: q.value,
1316
- onClick: r[3] ||= (e) => q.value = !0
1316
+ label: j(d)("chatFilePreview.fitWidth"),
1317
+ title: j(d)("chatFilePreview.fitWidth"),
1318
+ "aria-label": j(d)("chatFilePreview.fitWidth"),
1319
+ disabled: J.value,
1320
+ onClick: r[3] ||= (e) => J.value = !0
1317
1321
  }, null, 8, [
1318
1322
  "label",
1319
1323
  "title",
@@ -1323,81 +1327,81 @@ var ft = ["aria-label"], pt = {
1323
1327
  m(i, {
1324
1328
  modifiers: "action-quiet",
1325
1329
  icon: "ri:subtract-line",
1326
- "aria-label": A(d)("chatFilePreview.zoomOut"),
1327
- disabled: J.value <= .3,
1330
+ "aria-label": j(d)("chatFilePreview.zoomOut"),
1331
+ disabled: ye.value <= .3,
1328
1332
  onClick: r[4] ||= (e) => be(-.1)
1329
1333
  }, null, 8, ["aria-label", "disabled"]),
1330
- b("span", Ft, w(Math.round(J.value * 100)) + "% ", 1),
1334
+ x("span", zt, T(Math.round(ye.value * 100)) + "% ", 1),
1331
1335
  m(i, {
1332
1336
  modifiers: "action-quiet",
1333
1337
  icon: "ri:add-line",
1334
- "aria-label": A(d)("chatFilePreview.zoomIn"),
1335
- disabled: J.value >= 2,
1338
+ "aria-label": j(d)("chatFilePreview.zoomIn"),
1339
+ disabled: ye.value >= 2,
1336
1340
  onClick: r[5] ||= (e) => be(.1)
1337
1341
  }, null, 8, ["aria-label", "disabled"])
1338
- ], 64)) : D("", !0)
1342
+ ], 64)) : O("", !0)
1339
1343
  ])]),
1340
- P.value ? (N(), M("div", {
1344
+ F.value ? (P(), N("div", {
1341
1345
  key: 1,
1342
1346
  ref_key: "measureEl",
1343
- ref: T,
1347
+ ref: E,
1344
1348
  class: "pk-word-preview__measure",
1345
1349
  "aria-hidden": "true",
1346
- style: f(le.value)
1347
- }, [(N(!0), M(y, null, g(v.value, (t) => (N(), M("div", {
1350
+ style: f(L.value)
1351
+ }, [(P(!0), N(b, null, g(y.value, (t) => (P(), N("div", {
1348
1352
  key: t.key,
1349
1353
  "data-item": ""
1350
- }, [m(ct, {
1354
+ }, [m(ft, {
1351
1355
  block: e.preview.blocks[t.block],
1352
1356
  row: t.row,
1353
1357
  mode: e.mode,
1354
- page: j.value
1358
+ page: M.value
1355
1359
  }, null, 8, [
1356
1360
  "block",
1357
1361
  "row",
1358
1362
  "mode",
1359
1363
  "page"
1360
- ])]))), 128)), (N(!0), M(y, null, g(e.preview.parts, (t, n) => (N(), M("div", {
1364
+ ])]))), 128)), (P(!0), N(b, null, g(e.preview.parts, (t, n) => (P(), N("div", {
1361
1365
  key: n,
1362
1366
  "data-part": n
1363
- }, [(N(!0), M(y, null, g(A(pe)(t, e.mode), (n) => (N(), _(ct, {
1367
+ }, [(P(!0), N(b, null, g(j(V)(t, e.mode), (n) => (P(), v(ft, {
1364
1368
  key: n.key,
1365
1369
  block: t[n.block],
1366
1370
  row: n.row,
1367
1371
  mode: e.mode,
1368
- page: j.value
1372
+ page: M.value
1369
1373
  }, null, 8, [
1370
1374
  "block",
1371
1375
  "row",
1372
1376
  "mode",
1373
1377
  "page"
1374
- ]))), 128))], 8, It))), 128))], 4)) : D("", !0)
1378
+ ]))), 128))], 8, Bt))), 128))], 4)) : O("", !0)
1375
1379
  ], 2);
1376
1380
  };
1377
1381
  }
1378
1382
  }), [["styles", [".pk-word-preview{flex:1;min-height:0;display:flex;position:relative}.pk-word-preview__side{gap:var(--spacing-12);width:16.5rem;padding:var(--spacing-12);box-sizing:border-box;border-right:var(--border) solid var(--color-surface-3);background-color:var(--color-surface);flex-direction:column;flex-shrink:0;display:flex;overflow-y:auto}.pk-word-preview__side--over{inset:0 auto var(--spacing-40) 0;z-index:3;box-shadow:var(--shadow-lg);position:absolute}.pk-word-preview__tabs{border-bottom:var(--border) solid var(--color-surface-3);display:flex}.pk-word-preview__tab{min-height:var(--spacing-40);color:var(--color-word-3);font:inherit;font-size:var(--text-14);cursor:pointer;background:0 0;border:0;flex:1}.pk-word-preview__tab[aria-selected=true]{box-shadow:inset 0 calc(var(--spacing-2) * -1) 0 var(--color-word-1);color:var(--color-word-1);font-weight:var(--font-semibold)}.pk-word-preview__list{border:var(--border) solid var(--color-surface-3);border-radius:var(--rounded-lg);flex-direction:column;flex-shrink:0;display:flex;overflow:hidden}.pk-word-preview__entry{align-items:center;gap:var(--spacing-8);min-height:var(--spacing-40);padding:var(--spacing-8) var(--spacing-12);border:0;border-bottom:var(--border) solid var(--color-surface-2);color:var(--color-word-2);font:inherit;font-size:var(--text-14);text-align:start;cursor:pointer;transition:background-color var(--duration-150) var(--ease-out);background:0 0;display:flex}.pk-word-preview__entry:last-child{border-bottom:0}.pk-word-preview__entry:hover{background-color:var(--color-surface-1)}.pk-word-preview__entry[aria-current=location]{background-color:var(--color-surface-2);box-shadow:inset var(--spacing-3) 0 0 var(--color-word-2);color:var(--color-word-1);font-weight:var(--font-medium)}.pk-word-preview__entry--0{font-weight:var(--font-semibold)}.pk-word-preview__entry--2{padding-left:var(--spacing-24)}.pk-word-preview__entry--3{padding-left:var(--spacing-36)}.pk-word-preview__entry--change{gap:var(--spacing-4) var(--spacing-8);font-size:var(--text-12);flex-wrap:wrap}.pk-word-preview__entry-text{flex:1;min-width:0}.pk-word-preview__none{padding:var(--spacing-md);color:var(--color-word-3);font-size:var(--text-12);text-align:center;margin:0}.pk-word-preview__main{flex-direction:column;flex:1;min-width:0;display:flex}.pk-word-preview__scroll{min-height:0;padding:var(--spacing-md);background-color:var(--color-surface-2);flex:1;overflow:auto}.pk-word-preview__pages{align-items:center;gap:var(--spacing-24);flex-direction:column;width:max-content;min-width:100%;display:flex}.pk-word-preview__page{isolation:isolate;box-sizing:border-box;--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light;line-height:var(--pk-word-line,1.17);overflow-wrap:break-word;background-color:#fff;position:relative;overflow:hidden;box-shadow:0 1px 3px #140e3329,0 10px 28px #140e3314}.pk-word-preview__page--flow{width:100%;padding:var(--spacing-24) var(--spacing-20)}.pk-word-preview__measure{visibility:hidden;pointer-events:none;height:0;line-height:var(--pk-word-line,1.17);overflow-wrap:break-word;position:absolute;top:0;left:-100000px;overflow:hidden}.pk-word-preview__block{white-space:pre-wrap;margin:0;display:flow-root;position:relative}.pk-word-preview__picture{vertical-align:baseline;max-width:100%;height:auto}.pk-word-preview__picture--paragraph{max-width:none}.pk-word-preview__chart{text-indent:0;white-space:normal;vertical-align:bottom;max-width:100%;display:inline-block}.pk-word-preview__chart--paragraph{max-width:none}.pk-word-preview__float{max-width:none;position:absolute}.pk-word-preview__part{pointer-events:none;position:absolute;inset:0}.pk-word-preview__part-flow{pointer-events:auto;position:absolute}.pk-word-preview__label{text-indent:0;display:inline-block}.pk-word-preview__changed:before{content:\"\";background-color:#3f3c51;width:1.5pt;position:absolute;top:0;bottom:0;left:-14pt}.pk-word-preview__marked{isolation:isolate;position:relative}.pk-word-preview__marked:after{content:\"\";z-index:-1;pointer-events:none;animation:pk-word-preview-marked 3.5s var(--ease-out) forwards;background-color:#facc1566;position:absolute;inset:0}@media (prefers-reduced-motion:reduce){.pk-word-preview__marked:after{animation:none}}.pk-word-preview__table{border-collapse:collapse;table-layout:fixed;width:100%;margin:0;position:relative}.pk-word-preview__table td{vertical-align:top;white-space:pre-wrap;overflow-wrap:anywhere;padding:0 5.4pt}.pk-word-preview__table--lines td{border:.5pt solid #000}.pk-word-preview__table--lines.pk-word-preview__table--next td{border-top:0}.pk-word-preview__removed{color:var(--u-danger-text,#c42b3c);text-decoration:line-through}.pk-word-preview__added{color:var(--u-success-text,#178230);text-underline-offset:.2em;text-decoration:underline}.pk-word-preview__page .pk-word-preview__removed{color:#c42b3c}.pk-word-preview__page .pk-word-preview__added{color:#178230}.pk-word-preview__removed+.pk-word-preview__added{margin-inline-start:.15em}.pk-word-preview__image{padding:var(--spacing-2) var(--spacing-8);border:var(--border) dashed #c9c8d2;border-radius:var(--rounded);color:#6b6880;text-indent:0;font-size:9pt;display:inline-block}.pk-word-preview__truncated{margin:var(--spacing-md) 0 0;color:var(--color-word-3);font-size:var(--text-12);text-align:center}.pk-word-preview__status{align-items:center;gap:var(--spacing-16);min-height:var(--spacing-40);padding:0 var(--spacing-8) 0 var(--spacing-12);border-top:var(--border) solid var(--color-surface-3);background-color:var(--color-surface-1);color:var(--color-word-2);font-size:var(--text-12);white-space:nowrap;display:flex}.pk-word-preview__status>*{flex-shrink:0}.pk-word-preview__count{font-variant-numeric:tabular-nums}.pk-word-preview__status>.pk-word-preview__legend{gap:var(--spacing-8);flex-shrink:1;min-width:0;display:flex}.pk-word-preview__legend-text{text-overflow:ellipsis;min-width:0;overflow:hidden}.pk-word-preview__legend>.pk-word-preview__removed,.pk-word-preview__legend>.pk-word-preview__added{flex-shrink:0}.pk-word-preview__spacer{flex:1}@container (width<46rem){.pk-word-preview__status{gap:var(--spacing-12)}.pk-word-preview__outline-toggle .vv-button__label,.pk-word-preview__fit .vv-button__label{display:none}}.pk-word-preview__percent{min-width:var(--spacing-40);font-variant-numeric:tabular-nums;text-align:center}@keyframes pk-word-preview-marked{30%{opacity:1}to{opacity:0}}"]]]);
1379
1383
  // ../../packages/components/src/chat/PkFilePreview.vue?vue&type=script&setup=true&lang.ts
1380
- C(), h(), T();
1381
- var Bt = ["aria-label"], Vt = { class: "pk-file-preview__head" }, Ht = { class: "pk-file-preview__file" }, Ut = {
1384
+ w(), h(), E();
1385
+ var Wt = ["aria-label"], Gt = { class: "pk-file-preview__head" }, Kt = { class: "pk-file-preview__file" }, qt = {
1382
1386
  class: "pk-file-preview__tile",
1383
1387
  "aria-hidden": "true"
1384
- }, Wt = { class: "pk-file-preview__name" }, Gt = { class: "pk-file-preview__title" }, Kt = {
1388
+ }, Jt = { class: "pk-file-preview__name" }, Yt = { class: "pk-file-preview__title" }, Xt = {
1385
1389
  class: "pk-file-preview__note",
1386
1390
  role: "status"
1387
- }, qt = {
1391
+ }, Zt = {
1388
1392
  key: 0,
1389
1393
  class: "pk-file-preview__progress",
1390
1394
  "aria-hidden": "true"
1391
- }, Jt = {
1395
+ }, Qt = {
1392
1396
  key: 1,
1393
1397
  class: "pk-file-preview__tools"
1394
- }, Yt = ["aria-label"], Xt = { class: "pk-file-preview__version" }, Zt = { class: "pk-file-preview__mode-long" }, Qt = { class: "pk-file-preview__mode-short" }, $t = { class: "pk-file-preview__actions" }, en = { class: "pk-file-preview__body" }, tn = {
1398
+ }, $t = ["aria-label"], en = { class: "pk-file-preview__version" }, tn = { class: "pk-file-preview__mode-long" }, nn = { class: "pk-file-preview__mode-short" }, rn = { class: "pk-file-preview__actions" }, an = { class: "pk-file-preview__body" }, on = {
1395
1399
  key: 0,
1396
1400
  class: "pk-file-preview__skeleton vv-skeleton"
1397
- }, nn = {
1401
+ }, sn = {
1398
1402
  key: 1,
1399
1403
  class: "pk-file-preview__empty"
1400
- }, rn = /*@__PURE__*/ k({
1404
+ }, cn = /*@__PURE__*/ A({
1401
1405
  __name: "PkFilePreview",
1402
1406
  props: /*@__PURE__*/ d({
1403
1407
  kind: { type: String },
@@ -1442,13 +1446,13 @@ var Bt = ["aria-label"], Vt = { class: "pk-file-preview__head" }, Ht = { class:
1442
1446
  "update:fit"
1443
1447
  ]),
1444
1448
  setup(e, { emit: r }) {
1445
- let i = e, a = r, { t: c, locale: u } = ae({ useScope: "global" }), d = x(!1), f;
1449
+ let i = e, a = r, { t: c, locale: u } = ie({ useScope: "global" }), d = S(!1), f;
1446
1450
  p(() => i.working, (e, t) => {
1447
1451
  e ? (f = t === void 0 ? void 0 : i.version, d.value = !1) : f !== void 0 && (d.value = i.version === f, f = void 0);
1448
1452
  }, { immediate: !0 }), p(() => [i.version, i.fileId], () => {
1449
1453
  i.working || (d.value = !1);
1450
1454
  });
1451
- let h = S(() => i.versions ?? []), v = S(() => i.version ? h.value.indexOf(i.version) : -1), te = S(() => v.value > 0 ? h.value[v.value - 1] : void 0), C = S(() => v.value >= 0 && v.value < h.value.length - 1 ? h.value[v.value + 1] : void 0), T = l(e, "mode"), ne = l(e, "sheet"), k = l(e, "zoom"), ie = l(e, "fit"), oe = S(() => [
1455
+ let h = C(() => i.versions ?? []), y = C(() => i.version ? h.value.indexOf(i.version) : -1), ee = C(() => y.value > 0 ? h.value[y.value - 1] : void 0), w = C(() => y.value >= 0 && y.value < h.value.length - 1 ? h.value[y.value + 1] : void 0), E = l(e, "mode"), te = l(e, "sheet"), A = l(e, "zoom"), re = l(e, "fit"), ae = C(() => [
1452
1456
  {
1453
1457
  value: "markup",
1454
1458
  label: c("chatFilePreview.modeMarkup")
@@ -1461,48 +1465,48 @@ var Bt = ["aria-label"], Vt = { class: "pk-file-preview__head" }, Ht = { class:
1461
1465
  value: "original",
1462
1466
  label: c("chatFilePreview.modeOriginal")
1463
1467
  }
1464
- ]), se = S(() => i.preview?.kind === "word" && i.preview.revisionAuthors.length > 0);
1468
+ ]), oe = C(() => i.preview?.kind === "word" && i.preview.revisionAuthors.length > 0);
1465
1469
  p(() => i.version, () => {
1466
- T.value = "markup";
1470
+ E.value = "markup";
1467
1471
  });
1468
- let le = ee("rootEl"), I = O(), ue = x(!1), L = () => {
1469
- I.value = void 0, ue.value = !1;
1472
+ let L = _("rootEl"), R = k(), z = S(!1), B = () => {
1473
+ R.value = void 0, z.value = !1;
1470
1474
  };
1471
1475
  p(() => [
1472
1476
  i.version,
1473
1477
  i.preview,
1474
- T.value,
1475
- ne.value
1476
- ], L);
1477
- let de = (e) => {
1478
- ue.value || (I.value = e);
1479
- }, fe = S(() => I.value?.format === "docx" && P());
1480
- p(ue, async (e, t) => {
1481
- let n = I.value;
1478
+ E.value,
1479
+ te.value
1480
+ ], B);
1481
+ let ce = (e) => {
1482
+ z.value || (R.value = e);
1483
+ }, le = C(() => R.value?.format === "docx" && F());
1484
+ p(z, async (e, t) => {
1485
+ let n = R.value;
1482
1486
  t && !e && n?.format === "docx" && (await s(), n.restore());
1483
1487
  });
1484
- let R = S(() => !i.version || i.version === h.value[h.value.length - 1]), pe = () => {
1488
+ let ue = C(() => !i.version || i.version === h.value[h.value.length - 1]), V = () => {
1485
1489
  let e = h.value[h.value.length - 1];
1486
1490
  e && a("version", e);
1487
- }, me = S(() => {
1488
- let e = I.value;
1489
- return e?.format === "docx" ? e.paragraphCount > 200 : (e?.cells ?? 0) > H;
1490
- }), z = S(() => I.value?.format === "docx" && T.value === "original"), B = S(() => me.value || z.value), he = S(() => z.value ? c("selectionActions.hintOriginal") : me.value ? c(I.value?.format === "docx" ? "selectionActions.hintParagraphs" : "selectionActions.hintCells", { count: I.value?.format === "docx" ? 200 : H }) : void 0), V = (e) => e[u.value] ?? e[u.value.split("-")[0]] ?? Object.values(e)[0] ?? "", ge = ["explain", "summarize"], _e = S(() => {
1491
- let e = I.value, t = i.selectionActions;
1491
+ }, de = C(() => {
1492
+ let e = R.value;
1493
+ return e?.format === "docx" ? e.paragraphCount > 200 : (e?.cells ?? 0) > W;
1494
+ }), H = C(() => R.value?.format === "docx" && E.value === "original"), U = C(() => de.value || H.value), fe = C(() => H.value ? c("selectionActions.hintOriginal") : de.value ? c(R.value?.format === "docx" ? "selectionActions.hintParagraphs" : "selectionActions.hintCells", { count: R.value?.format === "docx" ? 200 : W }) : void 0), pe = (e) => e[u.value] ?? e[u.value.split("-")[0]] ?? Object.values(e)[0] ?? "", me = ["explain", "summarize"], he = C(() => {
1495
+ let e = R.value, t = i.selectionActions;
1492
1496
  if (!e || !t) return [];
1493
1497
  let n = e.format;
1494
- return [...(n === "docx" && B.value ? ge : t.builtIns).map((e) => ({
1498
+ return [...(n === "docx" && U.value ? me : t.builtIns).map((e) => ({
1495
1499
  id: e,
1496
1500
  label: c(`selectionActions.builtIn.${e}`),
1497
1501
  ...e === "translate" && { asks: c("selectionActions.translateAsks") },
1498
1502
  prompt: (t) => c(`selectionActions.prompt.${n}.${e}`, { language: t ?? "" })
1499
- })), ...(B.value ? [] : t.actions).map((e) => ({
1503
+ })), ...(U.value ? [] : t.actions).map((e) => ({
1500
1504
  id: e.id,
1501
- label: V(e.label),
1505
+ label: pe(e.label),
1502
1506
  icon: e.icon,
1503
- prompt: () => V(e.prompt)
1507
+ prompt: () => pe(e.prompt)
1504
1508
  }))];
1505
- }), U = (e) => {
1509
+ }), ge = (e) => {
1506
1510
  if (e.format === "docx") return c("selectionActions.labelParagraphs", {
1507
1511
  file: i.filename,
1508
1512
  count: e.paragraphCount
@@ -1518,20 +1522,20 @@ var Bt = ["aria-label"], Vt = { class: "pk-file-preview__head" }, Ht = { class:
1518
1522
  sheet: e.sheet,
1519
1523
  cell: t
1520
1524
  });
1521
- }, W = (e) => {
1525
+ }, G = (e) => {
1522
1526
  if (!i.fileId || !i.storedFileName) return;
1523
1527
  let t = {
1524
1528
  fileId: i.fileId,
1525
1529
  version: i.version ?? 1,
1526
1530
  storedFileName: i.storedFileName,
1527
- label: U(e).slice(0, 200)
1531
+ label: ge(e).slice(0, 200)
1528
1532
  };
1529
1533
  if (e.format === "docx") {
1530
1534
  let { measure: n, ...r } = e;
1531
1535
  return {
1532
1536
  ...t,
1533
1537
  ...r,
1534
- ...z.value && { original: !0 }
1538
+ ...H.value && { original: !0 }
1535
1539
  };
1536
1540
  }
1537
1541
  let { measure: n, cells: r, ...a } = e;
@@ -1539,23 +1543,23 @@ var Bt = ["aria-label"], Vt = { class: "pk-file-preview__head" }, Ht = { class:
1539
1543
  ...t,
1540
1544
  ...a
1541
1545
  };
1542
- }, G = (e, t) => {
1543
- let n = I.value, r = n && W(n);
1546
+ }, K = (e, t) => {
1547
+ let n = R.value, r = n && G(n);
1544
1548
  r && (a("selectionSend", e, r, {
1545
1549
  id: t,
1546
1550
  size: n.format === "docx" ? n.paragraphCount : n.cells
1547
- }), L(), document.getSelection()?.removeAllRanges());
1548
- }, ve = (e, t) => {
1549
- let n = _e.value.find((t) => t.id === e);
1550
- n && G(n.prompt(t), e);
1551
- }, K = x(0);
1552
- re(le, "scroll", () => K.value++, {
1551
+ }), B(), document.getSelection()?.removeAllRanges());
1552
+ }, _e = (e, t) => {
1553
+ let n = he.value.find((t) => t.id === e);
1554
+ n && K(n.prompt(t), e);
1555
+ }, q = S(0);
1556
+ ne(L, "scroll", () => q.value++, {
1553
1557
  capture: !0,
1554
1558
  passive: !0
1555
- }), re(window, "resize", () => K.value++, { passive: !0 });
1556
- let q = S(() => {
1557
- K.value;
1558
- let e = I.value?.measure(), t = le.value?.getBoundingClientRect();
1559
+ }), ne(window, "resize", () => q.value++, { passive: !0 });
1560
+ let J = C(() => {
1561
+ q.value;
1562
+ let e = R.value?.measure(), t = L.value?.getBoundingClientRect();
1559
1563
  if (e && t) return {
1560
1564
  start: {
1561
1565
  top: e.start.top - t.top,
@@ -1572,161 +1576,161 @@ var Bt = ["aria-label"], Vt = { class: "pk-file-preview__head" }, Ht = { class:
1572
1576
  });
1573
1577
  return (r, i) => {
1574
1578
  let s = n, l = t;
1575
- return N(), M("section", {
1579
+ return P(), N("section", {
1576
1580
  ref_key: "rootEl",
1577
- ref: le,
1581
+ ref: L,
1578
1582
  class: "pk-file-preview",
1579
1583
  "aria-label": e.filename,
1580
1584
  tabindex: "-1",
1581
1585
  autofocus: ""
1582
1586
  }, [
1583
- b("header", Vt, [
1584
- b("div", Ht, [b("span", Ut, [m(s, {
1587
+ x("header", Gt, [
1588
+ x("div", Kt, [x("span", qt, [m(s, {
1585
1589
  name: e.kind === "word" ? "ri:file-word-2-line" : "ri:file-excel-2-line",
1586
1590
  class: o(e.kind === "word" ? "pk-file-preview__icon--word" : "pk-file-preview__icon--sheet")
1587
- }, null, 8, ["name", "class"])]), b("div", Wt, [b("strong", Gt, w(e.filename), 1), b("span", Kt, [e.working ? (N(), M(y, { key: 0 }, [i[14] ||= b("span", {
1591
+ }, null, 8, ["name", "class"])]), x("div", Jt, [x("strong", Yt, T(e.filename), 1), x("span", Xt, [e.working ? (P(), N(b, { key: 0 }, [i[14] ||= x("span", {
1588
1592
  class: "pk-file-preview__spinner",
1589
1593
  "aria-hidden": "true"
1590
- }, null, -1), j(" " + w(A(c)("chatFilePreview.working")), 1)], 64)) : d.value ? (N(), M(y, { key: 1 }, [j(w(A(c)("chatFilePreview.answeredInChat")) + " ", 1), m(l, {
1594
+ }, null, -1), M(" " + T(j(c)("chatFilePreview.working")), 1)], 64)) : d.value ? (P(), N(b, { key: 1 }, [M(T(j(c)("chatFilePreview.answeredInChat")) + " ", 1), m(l, {
1591
1595
  modifiers: "link",
1592
1596
  class: "pk-file-preview__show-chat",
1593
- label: A(c)("chatFilePreview.showChat"),
1597
+ label: j(c)("chatFilePreview.showChat"),
1594
1598
  onClick: i[0] ||= (e) => a("showChat")
1595
- }, null, 8, ["label"])], 64)) : (N(), M(y, { key: 2 }, [j(w(A(c)("chatFilePreview.readOnly")), 1)], 64))])])]),
1596
- e.working ? (N(), M("div", qt)) : D("", !0),
1597
- e.version && h.value.length > 1 || se.value ? (N(), M("div", Jt, [e.version && h.value.length > 1 ? (N(), M("nav", {
1599
+ }, null, 8, ["label"])], 64)) : (P(), N(b, { key: 2 }, [M(T(j(c)("chatFilePreview.readOnly")), 1)], 64))])])]),
1600
+ e.working ? (P(), N("div", Zt)) : O("", !0),
1601
+ e.version && h.value.length > 1 || oe.value ? (P(), N("div", Qt, [e.version && h.value.length > 1 ? (P(), N("nav", {
1598
1602
  key: 0,
1599
1603
  class: "pk-file-preview__versions",
1600
- "aria-label": A(c)("chatFilePreview.versions")
1604
+ "aria-label": j(c)("chatFilePreview.versions")
1601
1605
  }, [
1602
1606
  m(l, {
1603
1607
  modifiers: "action-quiet",
1604
1608
  icon: "ri:arrow-left-s-line",
1605
- "aria-label": A(c)("chatFilePreview.previousVersion"),
1606
- disabled: !te.value,
1607
- onClick: i[1] ||= (e) => te.value && a("version", te.value)
1609
+ "aria-label": j(c)("chatFilePreview.previousVersion"),
1610
+ disabled: !ee.value,
1611
+ onClick: i[1] ||= (e) => ee.value && a("version", ee.value)
1608
1612
  }, null, 8, ["aria-label", "disabled"]),
1609
- b("span", Xt, w(A(c)("chatFilePreview.versionOf", {
1613
+ x("span", en, T(j(c)("chatFilePreview.versionOf", {
1610
1614
  version: e.version,
1611
1615
  count: h.value.length
1612
1616
  })), 1),
1613
1617
  m(l, {
1614
1618
  modifiers: "action-quiet",
1615
1619
  icon: "ri:arrow-right-s-line",
1616
- "aria-label": A(c)("chatFilePreview.nextVersion"),
1617
- disabled: !C.value,
1618
- onClick: i[2] ||= (e) => C.value && a("version", C.value)
1620
+ "aria-label": j(c)("chatFilePreview.nextVersion"),
1621
+ disabled: !w.value,
1622
+ onClick: i[2] ||= (e) => w.value && a("version", w.value)
1619
1623
  }, null, 8, ["aria-label", "disabled"])
1620
- ], 8, Yt)) : D("", !0), se.value ? (N(), _(F, {
1624
+ ], 8, $t)) : O("", !0), oe.value ? (P(), v(I, {
1621
1625
  key: 1,
1622
- modelValue: T.value,
1623
- "onUpdate:modelValue": i[3] ||= (e) => T.value = e,
1626
+ modelValue: E.value,
1627
+ "onUpdate:modelValue": i[3] ||= (e) => E.value = e,
1624
1628
  name: "revisions",
1625
1629
  segmented: "",
1626
1630
  class: "pk-file-preview__modes u-segmented-fit mb-0",
1627
- "aria-label": A(c)("chatFilePreview.modes"),
1628
- options: oe.value
1631
+ "aria-label": j(c)("chatFilePreview.modes"),
1632
+ options: ae.value
1629
1633
  }, {
1630
- markup: E(() => [b("span", Zt, w(A(c)("chatFilePreview.modeMarkup")), 1), b("span", Qt, w(A(c)("chatFilePreview.modeMarkupShort")), 1)]),
1634
+ markup: D(() => [x("span", tn, T(j(c)("chatFilePreview.modeMarkup")), 1), x("span", nn, T(j(c)("chatFilePreview.modeMarkupShort")), 1)]),
1631
1635
  _: 1
1632
1636
  }, 8, [
1633
1637
  "modelValue",
1634
1638
  "aria-label",
1635
1639
  "options"
1636
- ])) : D("", !0)])) : D("", !0),
1637
- b("div", $t, [
1638
- e.restorable ? (N(), _(l, {
1640
+ ])) : O("", !0)])) : O("", !0),
1641
+ x("div", rn, [
1642
+ e.restorable ? (P(), v(l, {
1639
1643
  key: 0,
1640
1644
  modifiers: "action-quiet",
1641
1645
  icon: "ri:arrow-go-back-line",
1642
- label: A(c)("chatFilePreview.restore"),
1646
+ label: j(c)("chatFilePreview.restore"),
1643
1647
  onClick: i[4] ||= (e) => a("restore")
1644
- }, null, 8, ["label"])) : D("", !0),
1648
+ }, null, 8, ["label"])) : O("", !0),
1645
1649
  m(l, {
1646
1650
  href: e.downloadUrl,
1647
1651
  download: "",
1648
1652
  modifiers: "action-quiet",
1649
1653
  icon: "ri:download-line",
1650
- title: A(c)("chatFilePreview.download"),
1651
- "aria-label": A(c)("chatFilePreview.download")
1654
+ title: j(c)("chatFilePreview.download"),
1655
+ "aria-label": j(c)("chatFilePreview.download")
1652
1656
  }, null, 8, [
1653
1657
  "href",
1654
1658
  "title",
1655
1659
  "aria-label"
1656
1660
  ]),
1657
- e.resize === "expand" ? (N(), _(l, {
1661
+ e.resize === "expand" ? (P(), v(l, {
1658
1662
  key: 1,
1659
1663
  modifiers: "action-quiet",
1660
1664
  icon: "ri:fullscreen-line",
1661
- title: A(c)("chatFilePreview.expand"),
1662
- "aria-label": A(c)("chatFilePreview.expand"),
1665
+ title: j(c)("chatFilePreview.expand"),
1666
+ "aria-label": j(c)("chatFilePreview.expand"),
1663
1667
  onClick: i[5] ||= (e) => a("resize")
1664
- }, null, 8, ["title", "aria-label"])) : e.resize === "shrink" ? (N(), _(l, {
1668
+ }, null, 8, ["title", "aria-label"])) : e.resize === "shrink" ? (P(), v(l, {
1665
1669
  key: 2,
1666
1670
  modifiers: "action-quiet",
1667
1671
  icon: "ri:fullscreen-exit-line",
1668
- title: A(c)("chatFilePreview.shrink"),
1669
- "aria-label": A(c)("chatFilePreview.shrink"),
1672
+ title: j(c)("chatFilePreview.shrink"),
1673
+ "aria-label": j(c)("chatFilePreview.shrink"),
1670
1674
  onClick: i[6] ||= (e) => a("resize")
1671
- }, null, 8, ["title", "aria-label"])) : D("", !0),
1675
+ }, null, 8, ["title", "aria-label"])) : O("", !0),
1672
1676
  m(l, {
1673
1677
  modifiers: "action-quiet",
1674
1678
  icon: "ri:close-line",
1675
- title: A(c)("chatFilePreview.close"),
1676
- "aria-label": A(c)("chatFilePreview.close"),
1679
+ title: j(c)("chatFilePreview.close"),
1680
+ "aria-label": j(c)("chatFilePreview.close"),
1677
1681
  onClick: i[7] ||= (e) => a("close")
1678
1682
  }, null, 8, ["title", "aria-label"])
1679
1683
  ])
1680
1684
  ]),
1681
- b("div", en, [e.loading ? (N(), M("div", tn, [(N(), M(y, null, g(8, (e) => b("div", {
1685
+ x("div", an, [e.loading ? (P(), N("div", on, [(P(), N(b, null, g(8, (e) => x("div", {
1682
1686
  key: e,
1683
1687
  class: o(["vv-skeleton__item pk-file-preview__skeleton-line", e % 3 ? "w-full" : "w-128"])
1684
- }, null, 2)), 64))])) : e.error || !e.preview ? (N(), M("p", nn, w(A(c)("chatFilePreview.unavailable")), 1)) : e.preview.kind === "word" ? (N(), _(zt, {
1688
+ }, null, 2)), 64))])) : e.error || !e.preview ? (P(), N("p", sn, T(j(c)("chatFilePreview.unavailable")), 1)) : e.preview.kind === "word" ? (P(), v(Ut, {
1685
1689
  key: 2,
1686
- zoom: k.value,
1687
- "onUpdate:zoom": i[8] ||= (e) => k.value = e,
1688
- fit: ie.value,
1689
- "onUpdate:fit": i[9] ||= (e) => ie.value = e,
1690
+ zoom: A.value,
1691
+ "onUpdate:zoom": i[8] ||= (e) => A.value = e,
1692
+ fit: re.value,
1693
+ "onUpdate:fit": i[9] ||= (e) => re.value = e,
1690
1694
  preview: e.preview,
1691
- mode: se.value ? T.value : "markup",
1695
+ mode: oe.value ? E.value : "markup",
1692
1696
  marked: e.changes?.kind === "word" ? e.changes.paragraphs : void 0,
1693
- onSelect: de
1697
+ onSelect: ce
1694
1698
  }, null, 8, [
1695
1699
  "zoom",
1696
1700
  "fit",
1697
1701
  "preview",
1698
1702
  "mode",
1699
1703
  "marked"
1700
- ])) : (N(), _(tt, {
1704
+ ])) : (P(), v(Z, {
1701
1705
  key: 3,
1702
- sheet: ne.value,
1703
- "onUpdate:sheet": i[10] ||= (e) => ne.value = e,
1704
- zoom: k.value,
1705
- "onUpdate:zoom": i[11] ||= (e) => k.value = e,
1706
+ sheet: te.value,
1707
+ "onUpdate:sheet": i[10] ||= (e) => te.value = e,
1708
+ zoom: A.value,
1709
+ "onUpdate:zoom": i[11] ||= (e) => A.value = e,
1706
1710
  preview: e.preview,
1707
1711
  marked: e.changes?.kind === "spreadsheet" ? e.changes.cells : void 0,
1708
- onSelect: de
1712
+ onSelect: ce
1709
1713
  }, null, 8, [
1710
1714
  "sheet",
1711
1715
  "zoom",
1712
1716
  "preview",
1713
1717
  "marked"
1714
1718
  ]))]),
1715
- e.selectionActions && I.value && q.value ? (N(), _(ce, {
1719
+ e.selectionActions && R.value && J.value ? (P(), v(se, {
1716
1720
  key: 0,
1717
- asking: ue.value,
1718
- "onUpdate:asking": i[12] ||= (e) => ue.value = e,
1721
+ asking: z.value,
1722
+ "onUpdate:asking": i[12] ||= (e) => z.value = e,
1719
1723
  strategy: "absolute",
1720
- anchor: q.value,
1721
- actions: _e.value,
1722
- hint: he.value,
1723
- touch: fe.value,
1724
- note: R.value ? void 0 : A(c)("selectionActions.notLatest", { version: e.version }),
1725
- "note-action": A(c)("selectionActions.openLatest"),
1726
- onAction: ve,
1727
- onAsk: i[13] ||= (e) => G(e, "ask"),
1728
- onNote: pe,
1729
- onClose: L
1724
+ anchor: J.value,
1725
+ actions: he.value,
1726
+ hint: fe.value,
1727
+ touch: le.value,
1728
+ note: ue.value ? void 0 : j(c)("selectionActions.notLatest", { version: e.version }),
1729
+ "note-action": j(c)("selectionActions.openLatest"),
1730
+ onAction: _e,
1731
+ onAsk: i[13] ||= (e) => K(e, "ask"),
1732
+ onNote: V,
1733
+ onClose: B
1730
1734
  }, null, 8, [
1731
1735
  "asking",
1732
1736
  "anchor",
@@ -1735,11 +1739,11 @@ var Bt = ["aria-label"], Vt = { class: "pk-file-preview__head" }, Ht = { class:
1735
1739
  "touch",
1736
1740
  "note",
1737
1741
  "note-action"
1738
- ])) : D("", !0)
1739
- ], 8, Bt);
1742
+ ])) : O("", !0)
1743
+ ], 8, Wt);
1740
1744
  };
1741
1745
  }
1742
- }), an = ".pk-file-preview{background-color:var(--color-surface);height:100%;min-height:0;color:var(--color-word-1);outline:none;flex-direction:column;display:flex;position:relative;container-type:inline-size}.pk-file-preview__head{align-items:center;gap:var(--spacing-8) var(--spacing-12);padding:var(--spacing-12) var(--spacing-12) var(--spacing-12) var(--spacing-md);border-bottom:var(--border) solid var(--color-surface-3);flex-wrap:wrap;display:flex;position:relative}.pk-file-preview__file{align-items:center;gap:var(--spacing-12);flex:12rem;min-width:0;display:flex}.pk-file-preview__tile{width:var(--spacing-32);height:var(--spacing-32);border:var(--border) solid var(--color-surface-3);border-radius:var(--rounded);flex-shrink:0;justify-content:center;align-items:center;display:flex}.pk-file-preview__tile .vv-icon{width:var(--spacing-18);height:var(--spacing-18)}.pk-file-preview__icon--word{color:#2b7de9}.pk-file-preview__icon--sheet{color:#1f9d57}.pk-file-preview__name{flex-direction:column;min-width:0;display:flex}.pk-file-preview__title{font-size:var(--text-14);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.pk-file-preview__note{align-items:center;gap:var(--spacing-6);color:var(--color-word-3);font-size:var(--text-12);display:flex}.pk-file-preview__spinner{width:var(--spacing-12);height:var(--spacing-12);border:var(--spacing-2) solid var(--color-surface-4);border-top-color:var(--color-word-2);border-radius:50%;flex-shrink:0;animation:.8s linear infinite pk-file-preview-spin}.pk-file-preview__progress{right:0;bottom:calc(-1 * var(--border));height:var(--spacing-2);position:absolute;left:0;overflow:hidden}.pk-file-preview__progress:before{content:\"\";background-color:var(--color-word-3);width:30%;animation:1.4s ease-in-out infinite pk-file-preview-progress;position:absolute;top:0;bottom:0}@media (prefers-reduced-motion:reduce){.pk-file-preview__spinner,.pk-file-preview__progress:before{animation:none}}@keyframes pk-file-preview-spin{to{rotate:360deg}}@keyframes pk-file-preview-progress{0%{left:-30%}to{left:100%}}.pk-file-preview__show-chat{font-size:var(--text-12)}.pk-file-preview__tools{align-items:center;gap:var(--spacing-8) var(--spacing-12);flex-wrap:wrap;display:flex}.pk-file-preview__versions{align-items:center;gap:var(--spacing-2);display:flex}.pk-file-preview__version{font-size:var(--text-14);font-weight:var(--font-semibold);font-variant-numeric:tabular-nums;white-space:nowrap}.pk-file-preview__actions{align-items:center;gap:var(--spacing-8);margin-left:auto;display:flex}@container (width<52rem){.pk-file-preview__file{order:1}.pk-file-preview__actions{order:2}.pk-file-preview__tools{flex-basis:100%;order:3}.pk-file-preview__tools .pk-file-preview__modes{flex:auto}}.pk-file-preview__mode-short{display:none}@container (width<38rem){.pk-file-preview__mode-long{display:none}.pk-file-preview__mode-short{display:inline}}@container (width<30rem){.pk-file-preview__tools .pk-file-preview__modes{flex:100%}.pk-file-preview__tools .pk-file-preview__modes .vv-radio{padding-inline:var(--spacing-4)}}.pk-file-preview__body{background-color:var(--color-surface-1);flex-direction:column;flex:1;min-height:0;display:flex}.pk-file-preview__skeleton{width:min(42rem, 100% - 2 * var(--spacing-md));margin:var(--spacing-md) auto;padding:var(--spacing-lg);box-sizing:border-box;border:var(--border) solid var(--color-surface-3);border-radius:var(--rounded);background-color:var(--color-surface)}.pk-file-preview__skeleton-line{height:var(--spacing-12);margin-bottom:var(--spacing-12);border-radius:var(--rounded)}.pk-file-preview__empty{margin:var(--spacing-lg) var(--spacing-md);color:var(--color-word-3);font-size:var(--text-14);text-align:center}", on = /* @__PURE__ */ e({ default: () => sn }), sn = /*#__PURE__*/ L(rn, [["styles", [an]]]);
1743
- export { on as n, sn as t };
1746
+ }), ln = ".pk-file-preview{background-color:var(--color-surface);height:100%;min-height:0;color:var(--color-word-1);outline:none;flex-direction:column;display:flex;position:relative;container-type:inline-size}.pk-file-preview__head{align-items:center;gap:var(--spacing-8) var(--spacing-12);padding:var(--spacing-12) var(--spacing-12) var(--spacing-12) var(--spacing-md);border-bottom:var(--border) solid var(--color-surface-3);flex-wrap:wrap;display:flex;position:relative}.pk-file-preview__file{align-items:center;gap:var(--spacing-12);flex:12rem;min-width:0;display:flex}.pk-file-preview__tile{width:var(--spacing-32);height:var(--spacing-32);border:var(--border) solid var(--color-surface-3);border-radius:var(--rounded);flex-shrink:0;justify-content:center;align-items:center;display:flex}.pk-file-preview__tile .vv-icon{width:var(--spacing-18);height:var(--spacing-18)}.pk-file-preview__icon--word{color:#2b7de9}.pk-file-preview__icon--sheet{color:#1f9d57}.pk-file-preview__name{flex-direction:column;min-width:0;display:flex}.pk-file-preview__title{font-size:var(--text-14);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.pk-file-preview__note{align-items:center;gap:var(--spacing-6);color:var(--color-word-3);font-size:var(--text-12);display:flex}.pk-file-preview__spinner{width:var(--spacing-12);height:var(--spacing-12);border:var(--spacing-2) solid var(--color-surface-4);border-top-color:var(--color-word-2);border-radius:50%;flex-shrink:0;animation:.8s linear infinite pk-file-preview-spin}.pk-file-preview__progress{right:0;bottom:calc(-1 * var(--border));height:var(--spacing-2);position:absolute;left:0;overflow:hidden}.pk-file-preview__progress:before{content:\"\";background-color:var(--color-word-3);width:30%;animation:1.4s ease-in-out infinite pk-file-preview-progress;position:absolute;top:0;bottom:0}@media (prefers-reduced-motion:reduce){.pk-file-preview__spinner,.pk-file-preview__progress:before{animation:none}}@keyframes pk-file-preview-spin{to{rotate:360deg}}@keyframes pk-file-preview-progress{0%{left:-30%}to{left:100%}}.pk-file-preview__show-chat{font-size:var(--text-12)}.pk-file-preview__tools{align-items:center;gap:var(--spacing-8) var(--spacing-12);flex-wrap:wrap;display:flex}.pk-file-preview__versions{align-items:center;gap:var(--spacing-2);display:flex}.pk-file-preview__version{font-size:var(--text-14);font-weight:var(--font-semibold);font-variant-numeric:tabular-nums;white-space:nowrap}.pk-file-preview__actions{align-items:center;gap:var(--spacing-8);margin-left:auto;display:flex}@container (width<52rem){.pk-file-preview__file{order:1}.pk-file-preview__actions{order:2}.pk-file-preview__tools{flex-basis:100%;order:3}.pk-file-preview__tools .pk-file-preview__modes{flex:auto}}.pk-file-preview__mode-short{display:none}@container (width<38rem){.pk-file-preview__mode-long{display:none}.pk-file-preview__mode-short{display:inline}}@container (width<30rem){.pk-file-preview__tools .pk-file-preview__modes{flex:100%}.pk-file-preview__tools .pk-file-preview__modes .vv-radio{padding-inline:var(--spacing-4)}}.pk-file-preview__body{background-color:var(--color-surface-1);flex-direction:column;flex:1;min-height:0;display:flex}.pk-file-preview__skeleton{width:min(42rem, 100% - 2 * var(--spacing-md));margin:var(--spacing-md) auto;padding:var(--spacing-lg);box-sizing:border-box;border:var(--border) solid var(--color-surface-3);border-radius:var(--rounded);background-color:var(--color-surface)}.pk-file-preview__skeleton-line{height:var(--spacing-12);margin-bottom:var(--spacing-12);border-radius:var(--rounded)}.pk-file-preview__empty{margin:var(--spacing-lg) var(--spacing-md);color:var(--color-word-3);font-size:var(--text-14);text-align:center}", un = /* @__PURE__ */ e({ default: () => dn }), dn = /*#__PURE__*/ L(cn, [["styles", [ln]]]);
1747
+ export { un as n, dn as t };
1744
1748
 
1745
- //# sourceMappingURL=PkFilePreview-CW04wd9z.js.map
1749
+ //# sourceMappingURL=PkFilePreview-SBGa95Ca.js.map