@univerjs/sheets-conditional-formatting-ui 0.7.0-nightly.202505251606 → 0.8.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/es/index.js CHANGED
@@ -20,11 +20,11 @@ const Dn = {
20
20
  handler(t, e) {
21
21
  if (!e)
22
22
  return !1;
23
- const { ranges: r, style: n, stopIfTrue: i, operator: s } = e, o = t.get(Q), d = t.get(te), a = t.get(z), u = Ce(a);
24
- if (!u) return !1;
25
- const { unitId: l, subUnitId: h } = u, v = o.createCfId(l, h), f = {
23
+ const { ranges: r, style: n, stopIfTrue: i, operator: s } = e, o = t.get(Q), d = t.get(te), a = t.get(z), h = Ce(a);
24
+ if (!h) return !1;
25
+ const { unitId: l, subUnitId: u } = h, g = o.createCfId(l, u), p = {
26
26
  ranges: r,
27
- cfId: v,
27
+ cfId: g,
28
28
  stopIfTrue: !!i,
29
29
  rule: {
30
30
  type: U.highlightCell,
@@ -33,7 +33,7 @@ const Dn = {
33
33
  style: n
34
34
  }
35
35
  };
36
- return d.executeCommand(se.id, { unitId: l, subUnitId: h, rule: f });
36
+ return d.executeCommand(se.id, { unitId: l, subUnitId: u, rule: p });
37
37
  }
38
38
  }, $n = {
39
39
  type: he.COMMAND,
@@ -43,16 +43,16 @@ const Dn = {
43
43
  return !1;
44
44
  const { ranges: r, config: n, stopIfTrue: i } = e, s = t.get(Q), o = t.get(te), d = t.get(z), a = Ce(d);
45
45
  if (!a) return !1;
46
- const { unitId: u, subUnitId: l } = a, h = s.createCfId(u, l), v = {
46
+ const { unitId: h, subUnitId: l } = a, u = s.createCfId(h, l), g = {
47
47
  ranges: r,
48
- cfId: h,
48
+ cfId: u,
49
49
  stopIfTrue: !!i,
50
50
  rule: {
51
51
  type: U.colorScale,
52
52
  config: n
53
53
  }
54
54
  };
55
- return o.executeCommand(se.id, { unitId: u, subUnitId: l, rule: v });
55
+ return o.executeCommand(se.id, { unitId: h, subUnitId: l, rule: g });
56
56
  }
57
57
  }, jn = {
58
58
  type: he.COMMAND,
@@ -60,15 +60,15 @@ const Dn = {
60
60
  handler(t, e) {
61
61
  if (!e)
62
62
  return !1;
63
- const { ranges: r, min: n, max: i, nativeColor: s, positiveColor: o, isGradient: d, stopIfTrue: a, isShowValue: u } = e, l = t.get(Q), h = t.get(z), v = Ce(h);
64
- if (!v) return !1;
65
- const { unitId: f, subUnitId: S } = v, p = t.get(te), T = l.createCfId(f, S), _ = {
63
+ const { ranges: r, min: n, max: i, nativeColor: s, positiveColor: o, isGradient: d, stopIfTrue: a, isShowValue: h } = e, l = t.get(Q), u = t.get(z), g = Ce(u);
64
+ if (!g) return !1;
65
+ const { unitId: p, subUnitId: S } = g, f = t.get(te), T = l.createCfId(p, S), _ = {
66
66
  ranges: r,
67
67
  cfId: T,
68
68
  stopIfTrue: !!a,
69
69
  rule: {
70
70
  type: U.dataBar,
71
- isShowValue: u,
71
+ isShowValue: h,
72
72
  config: {
73
73
  min: n,
74
74
  max: i,
@@ -78,7 +78,7 @@ const Dn = {
78
78
  }
79
79
  }
80
80
  };
81
- return p.executeCommand(se.id, { unitId: f, subUnitId: S, rule: _ });
81
+ return f.executeCommand(se.id, { unitId: p, subUnitId: S, rule: _ });
82
82
  }
83
83
  }, Hn = {
84
84
  type: he.COMMAND,
@@ -88,9 +88,9 @@ const Dn = {
88
88
  return !1;
89
89
  const { ranges: r, style: n, stopIfTrue: i } = e, s = t.get(Q), o = t.get(te), d = t.get(z), a = Ce(d);
90
90
  if (!a) return !1;
91
- const { unitId: u, subUnitId: l } = a, h = s.createCfId(u, l), v = {
91
+ const { unitId: h, subUnitId: l } = a, u = s.createCfId(h, l), g = {
92
92
  ranges: r,
93
- cfId: h,
93
+ cfId: u,
94
94
  stopIfTrue: !!i,
95
95
  rule: {
96
96
  type: U.highlightCell,
@@ -98,7 +98,7 @@ const Dn = {
98
98
  style: n
99
99
  }
100
100
  };
101
- return o.executeCommand(se.id, { unitId: u, subUnitId: l, rule: v });
101
+ return o.executeCommand(se.id, { unitId: h, subUnitId: l, rule: g });
102
102
  }
103
103
  }, Bn = {
104
104
  type: he.COMMAND,
@@ -106,44 +106,44 @@ const Dn = {
106
106
  handler(t, e) {
107
107
  if (!e)
108
108
  return !1;
109
- const { ranges: r, style: n, stopIfTrue: i, operator: s, value: o } = e, d = t.get(Q), a = t.get(te), u = t.get(z), l = Ce(u);
109
+ const { ranges: r, style: n, stopIfTrue: i, operator: s, value: o } = e, d = t.get(Q), a = t.get(te), h = t.get(z), l = Ce(h);
110
110
  if (!l) return !1;
111
- const { unitId: h, subUnitId: v } = l, f = d.createCfId(h, v);
111
+ const { unitId: u, subUnitId: g } = l, p = d.createCfId(u, g);
112
112
  let S;
113
113
  if ([P.between, P.notBetween].includes(s)) {
114
- const p = o;
115
- if (p.length !== 2 || !Array.isArray(p))
114
+ const f = o;
115
+ if (f.length !== 2 || !Array.isArray(f))
116
116
  return !1;
117
117
  S = {
118
118
  ranges: r,
119
- cfId: f,
119
+ cfId: p,
120
120
  stopIfTrue: !!i,
121
121
  rule: {
122
122
  type: U.highlightCell,
123
123
  subType: F.number,
124
124
  operator: s,
125
125
  style: n,
126
- value: p
126
+ value: f
127
127
  }
128
128
  };
129
129
  } else {
130
- const p = o;
131
- if (typeof p != "number")
130
+ const f = o;
131
+ if (typeof f != "number")
132
132
  return !1;
133
133
  S = {
134
134
  ranges: r,
135
- cfId: f,
135
+ cfId: p,
136
136
  stopIfTrue: !!i,
137
137
  rule: {
138
138
  type: U.highlightCell,
139
139
  subType: F.number,
140
140
  operator: s,
141
141
  style: n,
142
- value: p
142
+ value: f
143
143
  }
144
144
  };
145
145
  }
146
- return a.executeCommand(se.id, { unitId: h, subUnitId: v, rule: S });
146
+ return a.executeCommand(se.id, { unitId: u, subUnitId: g, rule: S });
147
147
  }
148
148
  }, Wn = {
149
149
  type: he.COMMAND,
@@ -151,9 +151,9 @@ const Dn = {
151
151
  handler(t, e) {
152
152
  if (!e)
153
153
  return !1;
154
- const { ranges: r, style: n, stopIfTrue: i, isPercent: s, isBottom: o, value: d } = e, a = t.get(Q), u = t.get(z), l = t.get(te), h = Ce(u);
155
- if (!h) return !1;
156
- const { unitId: v, subUnitId: f } = h, S = a.createCfId(v, f), p = {
154
+ const { ranges: r, style: n, stopIfTrue: i, isPercent: s, isBottom: o, value: d } = e, a = t.get(Q), h = t.get(z), l = t.get(te), u = Ce(h);
155
+ if (!u) return !1;
156
+ const { unitId: g, subUnitId: p } = u, S = a.createCfId(g, p), f = {
157
157
  ranges: r,
158
158
  cfId: S,
159
159
  stopIfTrue: !!i,
@@ -166,7 +166,7 @@ const Dn = {
166
166
  value: d
167
167
  }
168
168
  };
169
- return l.executeCommand(se.id, { unitId: v, subUnitId: f, rule: p });
169
+ return l.executeCommand(se.id, { unitId: g, subUnitId: p, rule: f });
170
170
  }
171
171
  }, qn = {
172
172
  type: he.COMMAND,
@@ -174,11 +174,11 @@ const Dn = {
174
174
  handler(t, e) {
175
175
  if (!e)
176
176
  return !1;
177
- const { ranges: r, style: n, stopIfTrue: i, operator: s, value: o } = e, d = t.get(Q), a = t.get(z), u = Ce(a);
178
- if (!u) return !1;
179
- const { unitId: l, subUnitId: h } = u, v = t.get(te), f = d.createCfId(l, h), S = {
177
+ const { ranges: r, style: n, stopIfTrue: i, operator: s, value: o } = e, d = t.get(Q), a = t.get(z), h = Ce(a);
178
+ if (!h) return !1;
179
+ const { unitId: l, subUnitId: u } = h, g = t.get(te), p = d.createCfId(l, u), S = {
180
180
  ranges: r,
181
- cfId: f,
181
+ cfId: p,
182
182
  stopIfTrue: !!i,
183
183
  rule: {
184
184
  type: U.highlightCell,
@@ -188,7 +188,7 @@ const Dn = {
188
188
  value: o
189
189
  }
190
190
  };
191
- return v.executeCommand(se.id, { unitId: l, subUnitId: h, rule: S });
191
+ return g.executeCommand(se.id, { unitId: l, subUnitId: u, rule: S });
192
192
  }
193
193
  }, Gn = {
194
194
  type: he.COMMAND,
@@ -196,11 +196,11 @@ const Dn = {
196
196
  handler(t, e) {
197
197
  if (!e)
198
198
  return !1;
199
- const { ranges: r, style: n, stopIfTrue: i, operator: s } = e, o = t.get(Q), d = t.get(z), a = t.get(te), u = Ce(d);
200
- if (!u) return !1;
201
- const { unitId: l, subUnitId: h } = u, v = o.createCfId(l, h), f = {
199
+ const { ranges: r, style: n, stopIfTrue: i, operator: s } = e, o = t.get(Q), d = t.get(z), a = t.get(te), h = Ce(d);
200
+ if (!h) return !1;
201
+ const { unitId: l, subUnitId: u } = h, g = o.createCfId(l, u), p = {
202
202
  ranges: r,
203
- cfId: v,
203
+ cfId: g,
204
204
  stopIfTrue: !!i,
205
205
  rule: {
206
206
  type: U.highlightCell,
@@ -209,7 +209,7 @@ const Dn = {
209
209
  style: n
210
210
  }
211
211
  };
212
- return a.executeCommand(se.id, { unitId: l, subUnitId: h, rule: f });
212
+ return a.executeCommand(se.id, { unitId: l, subUnitId: u, rule: p });
213
213
  }
214
214
  }, zn = {
215
215
  type: he.COMMAND,
@@ -219,9 +219,9 @@ const Dn = {
219
219
  return !1;
220
220
  const { ranges: r, style: n, stopIfTrue: i } = e, s = t.get(Q), o = t.get(z), d = t.get(te), a = Ce(o);
221
221
  if (!a) return !1;
222
- const { unitId: u, subUnitId: l } = a, h = s.createCfId(u, l), v = {
222
+ const { unitId: h, subUnitId: l } = a, u = s.createCfId(h, l), g = {
223
223
  ranges: r,
224
- cfId: h,
224
+ cfId: u,
225
225
  stopIfTrue: !!i,
226
226
  rule: {
227
227
  type: U.highlightCell,
@@ -229,7 +229,7 @@ const Dn = {
229
229
  style: n
230
230
  }
231
231
  };
232
- return d.executeCommand(se.id, { unitId: u, subUnitId: l, rule: v });
232
+ return d.executeCommand(se.id, { unitId: h, subUnitId: l, rule: g });
233
233
  }
234
234
  };
235
235
  var oe = function() {
@@ -319,8 +319,8 @@ var hi = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 17", width: "1em"
319
319
  });
320
320
  ot.displayName = "SlashSingle";
321
321
  const Me = (t) => {
322
- const { color: e, onChange: r, disable: n = !1, iconId: i = "PaintBucket", className: s, isNeedDropdownIcon: o = !0 } = t, d = W(zt), a = J(() => new fn(e), [e]), u = d.get(i);
323
- return u ? n ? /* @__PURE__ */ c(u, { className: X("univer-fill-primary-600", s), extend: { colorChannel1: a.isValid ? e : "" } }) : /* @__PURE__ */ c(
322
+ const { color: e, onChange: r, disable: n = !1, iconId: i = "PaintBucket", className: s, isNeedDropdownIcon: o = !0 } = t, d = W(zt), a = J(() => new fn(e), [e]), h = d.get(i);
323
+ return h ? n ? /* @__PURE__ */ c(h, { className: X("univer-fill-primary-600", s), extend: { colorChannel1: a.isValid ? e : "" } }) : /* @__PURE__ */ c(
324
324
  Zt,
325
325
  {
326
326
  overlay: /* @__PURE__ */ c("div", { className: "univer-rounded-lg univer-p-4", children: /* @__PURE__ */ c(Wr, { value: e, onChange: r }) }),
@@ -329,7 +329,7 @@ const Me = (t) => {
329
329
  {
330
330
  className: X("univer-flex univer-cursor-pointer univer-items-center univer-rounded univer-p-1 dark:hover:!univer-bg-gray-700 hover:univer-bg-gray-100", s),
331
331
  children: [
332
- /* @__PURE__ */ c(u, { className: "univer-fill-primary-600", extend: { colorChannel1: a.isValid ? e : "" } }),
332
+ /* @__PURE__ */ c(h, { className: "univer-fill-primary-600", extend: { colorChannel1: a.isValid ? e : "" } }),
333
333
  o && /* @__PURE__ */ c(
334
334
  Vt,
335
335
  {
@@ -342,67 +342,73 @@ const Me = (t) => {
342
342
  }
343
343
  ) : null;
344
344
  }, We = (t) => {
345
- var s, o, d;
345
+ var s, o, d, a, h;
346
346
  const e = t.rule;
347
347
  if (!e) return null;
348
348
  const r = J(() => {
349
349
  if (e.type === U.colorScale) {
350
- const a = e.config.map((h, v) => ({ color: new fn(h.color), value: v })), u = a.length - 1;
351
- return new Array(5).fill("").map((h, v, f) => v * u / (f.length - 1)).map((h) => dr(a, h));
350
+ const l = e.config.map((p, S) => ({ color: new fn(p.color), value: S })), u = l.length - 1;
351
+ return new Array(5).fill("").map((p, S, f) => S * u / (f.length - 1)).map((p) => dr(l, p));
352
352
  }
353
353
  return null;
354
354
  }, [e]), n = J(() => {
355
355
  if (e.type === U.iconSet)
356
- return e.config.map((a) => {
357
- const u = Ee[a.iconType];
358
- return u && u[Number(a.iconId)];
356
+ return e.config.map((l) => {
357
+ const u = Ee[l.iconType];
358
+ return u && u[Number(l.iconId)];
359
359
  });
360
- }, [e]), i = `univer-pointer-events-none univer-flex univer-h-5 univer-min-w-[72px] univer-items-center
361
- univer-justify-center univer-text-xs`;
360
+ }, [e]), i = "univer-pointer-events-none univer-flex univer-h-5 univer-min-w-[72px] univer-items-center univer-justify-center univer-text-xs";
362
361
  switch (e.type) {
363
362
  case U.dataBar: {
364
- const { isGradient: a } = e.config, u = a ? `linear-gradient(to right, ${e.config.positiveColor || Ke}, rgb(255 255 255))` : e.config.positiveColor, l = a ? `linear-gradient(to right, rgb(255 255 255),${e.config.nativeColor || Xe})` : e.config.nativeColor;
363
+ const { isGradient: l } = e.config, u = l ? `linear-gradient(to right, ${e.config.positiveColor || Ke}, rgb(255 255 255))` : e.config.positiveColor, g = l ? `linear-gradient(to right, rgb(255 255 255),${e.config.nativeColor || Xe})` : e.config.nativeColor;
365
364
  return /* @__PURE__ */ k("div", { className: i, children: [
366
365
  /* @__PURE__ */ c(
367
366
  "div",
368
367
  {
369
- className: "univer-h-full univer-w-1/2",
368
+ className: "univer-h-full univer-w-1/2 univer-border univer-border-solid",
370
369
  style: {
371
- background: l,
372
- border: `1px solid ${e.config.nativeColor || Xe}`
370
+ background: g,
371
+ borderColor: (s = e.config.nativeColor) != null ? s : Xe
373
372
  }
374
373
  }
375
374
  ),
376
375
  /* @__PURE__ */ c(
377
376
  "div",
378
377
  {
379
- className: "univer-h-full univer-w-1/2",
378
+ className: "univer-h-full univer-w-1/2 univer-border univer-border-solid",
380
379
  style: {
381
380
  background: u,
382
- border: `1px solid ${e.config.positiveColor || Ke}`
381
+ borderColor: (o = e.config.positiveColor) != null ? o : Ke
383
382
  }
384
383
  }
385
384
  )
386
385
  ] });
387
386
  }
388
387
  case U.colorScale:
389
- return r && /* @__PURE__ */ c("div", { className: i, children: r.map((a, u) => /* @__PURE__ */ c("div", { className: "univer-h-full", style: { width: `${100 / r.length}%`, background: a } }, u)) });
388
+ return r && /* @__PURE__ */ c("div", { className: i, children: r.map((l, u) => /* @__PURE__ */ c(
389
+ "div",
390
+ {
391
+ className: "univer-h-full",
392
+ style: { width: `${100 / r.length}%`, background: l }
393
+ },
394
+ u
395
+ )) });
390
396
  case U.iconSet:
391
- return n && /* @__PURE__ */ c("div", { className: i, children: n.map((a, u) => a ? /* @__PURE__ */ c("img", { className: "univer-h-full", src: a, draggable: !1 }, u) : /* @__PURE__ */ c(ot, {}, u)) });
397
+ return n && /* @__PURE__ */ c("div", { className: i, children: n.map((l, u) => l ? /* @__PURE__ */ c("img", { className: "univer-h-full", src: l, draggable: !1 }, u) : /* @__PURE__ */ c(ot, {}, u)) });
392
398
  case U.highlightCell: {
393
- const { ul: a, st: u, it: l, bl: h, bg: v, cl: f } = e.style, S = (a == null ? void 0 : a.s) === ae.TRUE, p = (u == null ? void 0 : u.s) === ae.TRUE, T = l === ae.TRUE, _ = h === ae.TRUE, R = (s = v == null ? void 0 : v.rgb) != null ? s : hr, w = (o = f == null ? void 0 : f.rgb) != null ? o : vr, x = {
394
- textDecoration: (d = `${S ? "underline" : ""} ${p ? "line-through" : ""}`.replace(/^ /, "")) != null ? d : void 0,
395
- backgroundColor: R,
396
- color: w
399
+ const { ul: l, st: u, it: g, bl: p, bg: S, cl: f } = e.style, T = (l == null ? void 0 : l.s) === ae.TRUE, _ = (u == null ? void 0 : u.s) === ae.TRUE, R = g === ae.TRUE, w = p === ae.TRUE, x = (d = S == null ? void 0 : S.rgb) != null ? d : hr, v = (a = f == null ? void 0 : f.rgb) != null ? a : vr, C = {
400
+ textDecoration: (h = `${T ? "underline" : ""} ${_ ? "line-through" : ""}`.replace(/^ /, "")) != null ? h : void 0,
401
+ backgroundColor: x,
402
+ color: v
397
403
  };
398
404
  return /* @__PURE__ */ c(
399
405
  "div",
400
406
  {
401
407
  className: X(i, {
402
- "univer-font-bold": _,
403
- "univer-italic": T
408
+ "univer-font-bold": w,
409
+ "univer-italic": R
404
410
  }),
405
- style: x,
411
+ style: C,
406
412
  children: "123"
407
413
  }
408
414
  );
@@ -410,46 +416,46 @@ const Me = (t) => {
410
416
  }
411
417
  }, at = X("univer-mt-5 univer-px-1 univer-py-2 univer-rounded", He), Re = (t, e) => ({ label: e.t(`sheet.cf.valueType.${t}`), value: t }), Lt = (t) => {
412
418
  var S;
413
- const { type: e, className: r, onChange: n, id: i, value: s } = t, o = W(z), d = o.getCurrentUnitForType($.UNIVER_SHEET).getUnitId(), a = (S = o.getCurrentUnitForType($.UNIVER_SHEET).getActiveSheet()) == null ? void 0 : S.getSheetId(), u = J(() => String(s).startsWith("=") ? String(s) : "=", [s]), l = J(() => [A.max, A.min, "none"].includes(e) ? { disabled: !0 } : [A.percent, A.percentile].includes(e) ? {
419
+ const { type: e, className: r, onChange: n, id: i, value: s } = t, o = W(z), d = o.getCurrentUnitForType($.UNIVER_SHEET).getUnitId(), a = (S = o.getCurrentUnitForType($.UNIVER_SHEET).getActiveSheet()) == null ? void 0 : S.getSheetId(), h = J(() => String(s).startsWith("=") ? String(s) : "=", [s]), l = J(() => [A.max, A.min, "none"].includes(e) ? { disabled: !0 } : [A.percent, A.percentile].includes(e) ? {
414
420
  min: 0,
415
421
  max: 100
416
422
  } : {
417
423
  min: Number.MIN_SAFE_INTEGER,
418
424
  max: Number.MAX_SAFE_INTEGER
419
- }, [e]), h = de(null), [v, f] = N(!1);
420
- return Nt((p) => {
425
+ }, [e]), u = de(null), [g, p] = N(!1);
426
+ return Nt((f) => {
421
427
  var _;
422
- ((_ = h.current) == null ? void 0 : _.isClickOutSide(p)) && f(!1);
428
+ ((_ = u.current) == null ? void 0 : _.isClickOutSide(f)) && p(!1);
423
429
  }), e === A.formula ? /* @__PURE__ */ c("div", { className: "univer-ml-1 univer-w-full", children: /* @__PURE__ */ c(
424
430
  Mt,
425
431
  {
426
- ref: h,
432
+ ref: u,
427
433
  className: X("univer-box-border univer-h-8 univer-w-full univer-cursor-pointer univer-items-center univer-rounded-lg univer-bg-white univer-pt-2 univer-transition-colors [&>div:first-child]:univer-px-2.5 [&>div]:univer-h-5 [&>div]:univer-ring-transparent dark:!univer-bg-gray-700 dark:!univer-text-white hover:univer-border-primary-600", He),
428
- initValue: u,
434
+ initValue: h,
429
435
  unitId: d,
430
436
  subUnitId: a,
431
- isFocus: v,
432
- onChange: (p = "") => {
433
- n(p || "");
437
+ isFocus: g,
438
+ onChange: (f = "") => {
439
+ n(f || "");
434
440
  },
435
- onFocus: () => f(!0)
441
+ onFocus: () => p(!0)
436
442
  }
437
- ) }) : /* @__PURE__ */ c(Ne, { className: r, value: Number(t.value) || 0, onChange: (p) => t.onChange(p || 0), ...l });
443
+ ) }) : /* @__PURE__ */ c(Ne, { className: r, value: Number(t.value) || 0, onChange: (f) => t.onChange(f || 0), ...l });
438
444
  }, vi = (t) => {
439
445
  var L;
440
- const { interceptorManager: e } = t, r = W(re), n = ((L = t.rule) == null ? void 0 : L.type) === U.colorScale ? t.rule : void 0, i = [Re(A.num, r), Re(A.percent, r), Re(A.percentile, r), Re(A.formula, r)], s = [Re(A.min, r), ...i], o = [Re("none", r), ...i], d = [Re(A.max, r), ...i], [a, u] = N(() => {
446
+ const { interceptorManager: e } = t, r = W(re), n = ((L = t.rule) == null ? void 0 : L.type) === U.colorScale ? t.rule : void 0, i = [Re(A.num, r), Re(A.percent, r), Re(A.percentile, r), Re(A.formula, r)], s = [Re(A.min, r), ...i], o = [Re("none", r), ...i], d = [Re(A.max, r), ...i], [a, h] = N(() => {
441
447
  var I;
442
448
  const m = A.min;
443
449
  return n && ((I = n.config[0]) == null ? void 0 : I.value.type) || m;
444
- }), [l, h] = N(() => {
450
+ }), [l, u] = N(() => {
445
451
  var I;
446
452
  const m = "none";
447
453
  return !n || n.config.length !== 3 ? m : ((I = n.config[1]) == null ? void 0 : I.value.type) || m;
448
- }), [v, f] = N(() => {
454
+ }), [g, p] = N(() => {
449
455
  var I;
450
456
  const m = A.max;
451
457
  return n && ((I = n.config[n.config.length - 1]) == null ? void 0 : I.value.type) || m;
452
- }), [S, p] = N(() => {
458
+ }), [S, f] = N(() => {
453
459
  if (!n)
454
460
  return 10;
455
461
  const I = n.config[0];
@@ -466,7 +472,7 @@ const Me = (t) => {
466
472
  return 90;
467
473
  const I = (H = n.config[n.config.length - 1]) == null ? void 0 : H.value.value;
468
474
  return I === void 0 ? 90 : I;
469
- }), [x, g] = N(() => {
475
+ }), [x, v] = N(() => {
470
476
  var I;
471
477
  const m = "#d0d9fb";
472
478
  return n && ((I = n.config[0]) == null ? void 0 : I.color) || m;
@@ -484,9 +490,9 @@ const Me = (t) => {
484
490
  }, []);
485
491
  K(() => e.intercept(e.getInterceptPoints().submit, {
486
492
  handler() {
487
- return E({ minType: a, medianType: l, maxType: v, minValue: S, medianValue: T, maxValue: R, minColor: x, medianColor: C, maxColor: y });
493
+ return E({ minType: a, medianType: l, maxType: g, minValue: S, medianValue: T, maxValue: R, minColor: x, medianColor: C, maxColor: y });
488
494
  }
489
- }), [E, a, l, v, S, T, R, x, C, y, e]);
495
+ }), [E, a, l, g, S, T, R, x, C, y, e]);
490
496
  const V = (m) => {
491
497
  t.onChange(E(m));
492
498
  };
@@ -498,7 +504,7 @@ const Me = (t) => {
498
504
  children: r.t("sheet.cf.panel.styleRule")
499
505
  }
500
506
  ),
501
- /* @__PURE__ */ c("div", { className: at, children: /* @__PURE__ */ c(We, { rule: E({ minType: a, medianType: l, maxType: v, minValue: S, medianValue: T, maxValue: R, minColor: x, medianColor: C, maxColor: y }) }) }),
507
+ /* @__PURE__ */ c("div", { className: at, children: /* @__PURE__ */ c(We, { rule: E({ minType: a, medianType: l, maxType: g, minValue: S, medianValue: T, maxValue: R, minColor: x, medianColor: C, maxColor: y }) }) }),
502
508
  /* @__PURE__ */ c(
503
509
  "div",
504
510
  {
@@ -514,12 +520,12 @@ const Me = (t) => {
514
520
  options: s,
515
521
  value: a,
516
522
  onChange: (m) => {
517
- u(m);
523
+ h(m);
518
524
  const I = Je(m, 10);
519
- p(I), V({
525
+ f(I), V({
520
526
  minType: m,
521
527
  medianType: l,
522
- maxType: v,
528
+ maxType: g,
523
529
  minValue: I,
524
530
  medianValue: T,
525
531
  maxValue: R,
@@ -538,10 +544,10 @@ const Me = (t) => {
538
544
  value: S,
539
545
  type: a,
540
546
  onChange: (m) => {
541
- p(m), V({
547
+ f(m), V({
542
548
  minType: a,
543
549
  medianType: l,
544
- maxType: v,
550
+ maxType: g,
545
551
  minValue: m,
546
552
  medianValue: T,
547
553
  maxValue: R,
@@ -558,10 +564,10 @@ const Me = (t) => {
558
564
  className: "univer-ml-1",
559
565
  color: x,
560
566
  onChange: (m) => {
561
- g(m), V({
567
+ v(m), V({
562
568
  minType: a,
563
569
  medianType: l,
564
- maxType: v,
570
+ maxType: g,
565
571
  minValue: S,
566
572
  medianValue: T,
567
573
  maxValue: R,
@@ -588,12 +594,12 @@ const Me = (t) => {
588
594
  options: o,
589
595
  value: l,
590
596
  onChange: (m) => {
591
- h(m);
597
+ u(m);
592
598
  const I = Je(m, 50);
593
599
  _(I), V({
594
600
  minType: a,
595
601
  medianType: m,
596
- maxType: v,
602
+ maxType: g,
597
603
  minValue: S,
598
604
  medianValue: I,
599
605
  maxValue: R,
@@ -615,7 +621,7 @@ const Me = (t) => {
615
621
  _(m), V({
616
622
  minType: a,
617
623
  medianType: l,
618
- maxType: v,
624
+ maxType: g,
619
625
  minValue: S,
620
626
  medianValue: m,
621
627
  maxValue: R,
@@ -635,7 +641,7 @@ const Me = (t) => {
635
641
  b(m), V({
636
642
  minType: a,
637
643
  medianType: l,
638
- maxType: v,
644
+ maxType: g,
639
645
  minValue: S,
640
646
  medianValue: T,
641
647
  maxValue: R,
@@ -660,9 +666,9 @@ const Me = (t) => {
660
666
  {
661
667
  className: "univer-flex-shrink-0",
662
668
  options: d,
663
- value: v,
669
+ value: g,
664
670
  onChange: (m) => {
665
- f(m);
671
+ p(m);
666
672
  const I = Je(m, 90);
667
673
  w(I), V({
668
674
  minType: a,
@@ -684,12 +690,12 @@ const Me = (t) => {
684
690
  id: "max",
685
691
  className: "univer-ml-1",
686
692
  value: R,
687
- type: v,
693
+ type: g,
688
694
  onChange: (m) => {
689
695
  w(m), V({
690
696
  minType: a,
691
697
  medianType: l,
692
- maxType: v,
698
+ maxType: g,
693
699
  minValue: S,
694
700
  medianValue: T,
695
701
  maxValue: m,
@@ -709,7 +715,7 @@ const Me = (t) => {
709
715
  M(m), V({
710
716
  minType: a,
711
717
  medianType: l,
712
- maxType: v,
718
+ maxType: g,
713
719
  minValue: S,
714
720
  medianValue: T,
715
721
  maxValue: R,
@@ -723,13 +729,13 @@ const Me = (t) => {
723
729
  ] })
724
730
  ] });
725
731
  }, Ue = (t, e) => ({ label: e.t(`sheet.cf.valueType.${t}`), value: t }), sn = (t) => {
726
- var p;
727
- const { onChange: e, className: r, value: n, type: i, id: s, disabled: o = !1 } = t, d = W(z), a = d.getCurrentUnitForType($.UNIVER_SHEET).getUnitId(), u = (p = d.getCurrentUnitForType($.UNIVER_SHEET).getActiveSheet()) == null ? void 0 : p.getSheetId(), l = de(null), [h, v] = N(!1);
732
+ var f;
733
+ const { onChange: e, className: r, value: n, type: i, id: s, disabled: o = !1 } = t, d = W(z), a = d.getCurrentUnitForType($.UNIVER_SHEET).getUnitId(), h = (f = d.getCurrentUnitForType($.UNIVER_SHEET).getActiveSheet()) == null ? void 0 : f.getSheetId(), l = de(null), [u, g] = N(!1);
728
734
  Nt((T) => {
729
735
  var R;
730
- ((R = l.current) == null ? void 0 : R.isClickOutSide(T)) && v(!1);
736
+ ((R = l.current) == null ? void 0 : R.isClickOutSide(T)) && g(!1);
731
737
  });
732
- const f = de(n), S = J(() => [A.percentile, A.percent].includes(i) ? {
738
+ const p = de(n), S = J(() => [A.percentile, A.percent].includes(i) ? {
733
739
  max: 100,
734
740
  min: 0
735
741
  } : {
@@ -737,7 +743,7 @@ const Me = (t) => {
737
743
  max: Number.MAX_SAFE_INTEGER
738
744
  }, [i]);
739
745
  if (i === A.formula) {
740
- const T = String(f.current).startsWith("=") ? String(f.current) || "" : "=";
746
+ const T = String(p.current).startsWith("=") ? String(p.current) || "" : "=";
741
747
  return /* @__PURE__ */ c("div", { className: "univer-ml-3 univer-w-full", children: /* @__PURE__ */ c(
742
748
  Mt,
743
749
  {
@@ -745,12 +751,12 @@ const Me = (t) => {
745
751
  className: X("univer-box-border univer-h-8 univer-w-full univer-cursor-pointer univer-items-center univer-rounded-lg univer-bg-white univer-pt-2 univer-transition-colors [&>div:first-child]:univer-px-2.5 [&>div]:univer-h-5 [&>div]:univer-ring-transparent dark:!univer-bg-gray-700 dark:!univer-text-white hover:univer-border-primary-600", He),
746
752
  initValue: T,
747
753
  unitId: a,
748
- subUnitId: u,
749
- isFocus: h,
754
+ subUnitId: h,
755
+ isFocus: u,
750
756
  onChange: (_ = "") => {
751
757
  e(_ || "");
752
758
  },
753
- onFocus: () => v(!0)
759
+ onFocus: () => g(!0)
754
760
  }
755
761
  ) });
756
762
  }
@@ -775,16 +781,16 @@ const Me = (t) => {
775
781
  }), [o, d] = N(() => {
776
782
  var m;
777
783
  return n ? ((m = n.config) == null ? void 0 : m.positiveColor) || Ke : Ke;
778
- }), [a, u] = N(() => {
784
+ }), [a, h] = N(() => {
779
785
  var m;
780
786
  return n ? ((m = n.config) == null ? void 0 : m.nativeColor) || Xe : Xe;
781
- }), l = [Ue(A.num, r), Ue(A.percent, r), Ue(A.percentile, r), Ue(A.formula, r)], h = [Ue(A.min, r), ...l], v = [Ue(A.max, r), ...l], [f, S] = N(() => {
787
+ }), l = [Ue(A.num, r), Ue(A.percent, r), Ue(A.percentile, r), Ue(A.formula, r)], u = [Ue(A.min, r), ...l], g = [Ue(A.max, r), ...l], [p, S] = N(() => {
782
788
  var I;
783
- const m = h[0].value;
789
+ const m = u[0].value;
784
790
  return n && ((I = n.config) == null ? void 0 : I.min.type) || m;
785
- }), [p, T] = N(() => {
791
+ }), [f, T] = N(() => {
786
792
  var I;
787
- const m = v[0].value;
793
+ const m = g[0].value;
788
794
  return n && ((I = n.config) == null ? void 0 : I.max.type) || m;
789
795
  }), [_, R] = N(() => {
790
796
  var H;
@@ -798,7 +804,7 @@ const Me = (t) => {
798
804
  return 100;
799
805
  const I = ((H = n.config) == null ? void 0 : H.max) || {};
800
806
  return I.type === A.formula ? I.value || "=" : I.value === void 0 ? 100 : I.value;
801
- }), [g, C] = N(() => n ? n.isShowValue === void 0 ? !0 : !!n.isShowValue : !0), b = (m) => ({ config: {
807
+ }), [v, C] = N(() => n ? n.isShowValue === void 0 ? !0 : !!n.isShowValue : !0), b = (m) => ({ config: {
802
808
  min: { type: m.minValueType, value: m.minValue },
803
809
  max: { type: m.maxValueType, value: m.maxValue },
804
810
  isGradient: m.isGradient === "1",
@@ -807,32 +813,32 @@ const Me = (t) => {
807
813
  }, type: U.dataBar, isShowValue: m.isShowValue });
808
814
  K(() => e.intercept(e.getInterceptPoints().submit, {
809
815
  handler() {
810
- return b({ isGradient: i, minValue: _, minValueType: f, maxValue: w, maxValueType: p, positiveColor: o, nativeColor: a, isShowValue: g });
816
+ return b({ isGradient: i, minValue: _, minValueType: p, maxValue: w, maxValueType: f, positiveColor: o, nativeColor: a, isShowValue: v });
811
817
  }
812
- }), [i, _, f, w, p, o, a, e, g]);
818
+ }), [i, _, p, w, f, o, a, e, v]);
813
819
  const y = (m) => {
814
820
  t.onChange(b(m));
815
821
  }, M = (m) => {
816
822
  d(m), y({
817
823
  isGradient: i,
818
824
  minValue: _,
819
- minValueType: f,
825
+ minValueType: p,
820
826
  maxValue: w,
821
- maxValueType: p,
827
+ maxValueType: f,
822
828
  positiveColor: m,
823
829
  nativeColor: a,
824
- isShowValue: g
830
+ isShowValue: v
825
831
  });
826
832
  }, E = (m) => {
827
- u(m), y({
833
+ h(m), y({
828
834
  isGradient: i,
829
835
  minValue: _,
830
- minValueType: f,
836
+ minValueType: p,
831
837
  maxValue: w,
832
- maxValueType: p,
838
+ maxValueType: f,
833
839
  positiveColor: o,
834
840
  nativeColor: m,
835
- isShowValue: g
841
+ isShowValue: v
836
842
  });
837
843
  }, V = (m) => l.map((I) => I.value).includes(m);
838
844
  return /* @__PURE__ */ k("div", { children: [
@@ -849,12 +855,12 @@ const Me = (t) => {
849
855
  rule: b({
850
856
  isGradient: i,
851
857
  minValue: _,
852
- minValueType: f,
858
+ minValueType: p,
853
859
  maxValue: w,
854
- maxValueType: p,
860
+ maxValueType: f,
855
861
  positiveColor: o,
856
862
  nativeColor: a,
857
- isShowValue: g
863
+ isShowValue: v
858
864
  })
859
865
  }
860
866
  ) }),
@@ -875,12 +881,12 @@ const Me = (t) => {
875
881
  s(m), y({
876
882
  isGradient: m,
877
883
  minValue: _,
878
- minValueType: f,
884
+ minValueType: p,
879
885
  maxValue: w,
880
- maxValueType: p,
886
+ maxValueType: f,
881
887
  positiveColor: o,
882
888
  nativeColor: a,
883
- isShowValue: g
889
+ isShowValue: v
884
890
  });
885
891
  },
886
892
  children: [
@@ -893,14 +899,14 @@ const Me = (t) => {
893
899
  /* @__PURE__ */ c(
894
900
  yt,
895
901
  {
896
- checked: !g,
902
+ checked: !v,
897
903
  onChange: (m) => {
898
904
  C(!m), y({
899
905
  isGradient: m,
900
906
  minValue: _,
901
- minValueType: f,
907
+ minValueType: p,
902
908
  maxValue: w,
903
- maxValueType: p,
909
+ maxValueType: f,
904
910
  positiveColor: o,
905
911
  nativeColor: a,
906
912
  isShowValue: !m
@@ -956,8 +962,8 @@ const Me = (t) => {
956
962
  le,
957
963
  {
958
964
  className: "univer-w-1/2 univer-flex-shrink-0",
959
- options: h,
960
- value: f,
965
+ options: u,
966
+ value: p,
961
967
  onChange: (m) => {
962
968
  S(m);
963
969
  const I = Je(m, 10);
@@ -966,10 +972,10 @@ const Me = (t) => {
966
972
  minValue: I,
967
973
  minValueType: m,
968
974
  maxValue: w,
969
- maxValueType: p,
975
+ maxValueType: f,
970
976
  positiveColor: o,
971
977
  nativeColor: a,
972
- isShowValue: g
978
+ isShowValue: v
973
979
  });
974
980
  }
975
981
  }
@@ -979,19 +985,19 @@ const Me = (t) => {
979
985
  {
980
986
  id: "min",
981
987
  className: "univer-ml-3",
982
- disabled: !V(f),
983
- type: f,
988
+ disabled: !V(p),
989
+ type: p,
984
990
  value: _,
985
991
  onChange: (m) => {
986
992
  R(m || 0), y({
987
993
  isGradient: i,
988
994
  minValue: m || 0,
989
- minValueType: f,
995
+ minValueType: p,
990
996
  maxValue: w,
991
- maxValueType: p,
997
+ maxValueType: f,
992
998
  positiveColor: o,
993
999
  nativeColor: a,
994
- isShowValue: g
1000
+ isShowValue: v
995
1001
  });
996
1002
  }
997
1003
  }
@@ -1009,20 +1015,20 @@ const Me = (t) => {
1009
1015
  le,
1010
1016
  {
1011
1017
  className: "univer-w-1/2 univer-flex-shrink-0",
1012
- options: v,
1013
- value: p,
1018
+ options: g,
1019
+ value: f,
1014
1020
  onChange: (m) => {
1015
1021
  T(m);
1016
1022
  const I = Je(m, 90);
1017
1023
  x(I), y({
1018
1024
  isGradient: i,
1019
1025
  minValue: _,
1020
- minValueType: f,
1026
+ minValueType: p,
1021
1027
  maxValue: I,
1022
1028
  maxValueType: m,
1023
1029
  positiveColor: o,
1024
1030
  nativeColor: a,
1025
- isShowValue: g
1031
+ isShowValue: v
1026
1032
  });
1027
1033
  }
1028
1034
  }
@@ -1031,20 +1037,20 @@ const Me = (t) => {
1031
1037
  sn,
1032
1038
  {
1033
1039
  className: "univer-ml-3",
1034
- disabled: !V(p),
1040
+ disabled: !V(f),
1035
1041
  id: "max",
1036
- type: p,
1042
+ type: f,
1037
1043
  value: w,
1038
1044
  onChange: (m) => {
1039
1045
  x(m || 0), y({
1040
1046
  isGradient: i,
1041
1047
  minValue: _,
1042
- minValueType: f,
1048
+ minValueType: p,
1043
1049
  maxValue: m || 0,
1044
- maxValueType: p,
1050
+ maxValueType: f,
1045
1051
  positiveColor: o,
1046
1052
  nativeColor: a,
1047
- isShowValue: g
1053
+ isShowValue: v
1048
1054
  });
1049
1055
  }
1050
1056
  }
@@ -1059,17 +1065,17 @@ const Me = (t) => {
1059
1065
  }), [d, a] = N(() => {
1060
1066
  if (e != null && e.it)
1061
1067
  return e.it;
1062
- }), [u, l] = N(() => {
1068
+ }), [h, l] = N(() => {
1063
1069
  if (e != null && e.ul)
1064
1070
  return e.ul.s;
1065
- }), [h, v] = N(() => {
1071
+ }), [u, g] = N(() => {
1066
1072
  if (e != null && e.st)
1067
1073
  return e.st.s;
1068
- }), [f, S] = N(() => {
1074
+ }), [p, S] = N(() => {
1069
1075
  var b;
1070
1076
  const C = "#2f56ef";
1071
1077
  return (b = e == null ? void 0 : e.cl) != null && b.rgb ? e.cl.rgb : C;
1072
- }), [p, T] = N(() => {
1078
+ }), [f, T] = N(() => {
1073
1079
  var b;
1074
1080
  const C = "#e8ecfc";
1075
1081
  return (b = e == null ? void 0 : e.bg) != null && b.rgb ? e.bg.rgb : C;
@@ -1079,14 +1085,14 @@ const Me = (t) => {
1079
1085
  bl: s,
1080
1086
  it: d
1081
1087
  };
1082
- f !== void 0 && (C.cl = { rgb: f }), p !== void 0 && (C.bg = { rgb: p }), h !== void 0 && (C.st = { s: h }), u !== void 0 && (C.ul = { s: u }), r(gr(C));
1083
- }, [s, d, u, h, f, p]);
1084
- const g = "univer-flex univer-cursor-pointer univer-items-center univer-rounded univer-px-1";
1088
+ p !== void 0 && (C.cl = { rgb: p }), f !== void 0 && (C.bg = { rgb: f }), u !== void 0 && (C.st = { s: u }), h !== void 0 && (C.ul = { s: h }), r(gr(C));
1089
+ }, [s, d, h, u, p, f]);
1090
+ const v = "univer-flex univer-cursor-pointer univer-items-center univer-rounded univer-px-1";
1085
1091
  return /* @__PURE__ */ k("div", { className: X("univer-my-2.5 univer-flex univer-justify-between", n), children: [
1086
1092
  _ && /* @__PURE__ */ c(
1087
1093
  "div",
1088
1094
  {
1089
- className: X(g, {
1095
+ className: X(v, {
1090
1096
  "univer-bg-gray-100": ut(s || ae.FALSE)
1091
1097
  }),
1092
1098
  onClick: () => o(ct(s)),
@@ -1096,7 +1102,7 @@ const Me = (t) => {
1096
1102
  R && /* @__PURE__ */ c(
1097
1103
  "div",
1098
1104
  {
1099
- className: X(g, {
1105
+ className: X(v, {
1100
1106
  "univer-bg-gray-100": ut(d || ae.FALSE)
1101
1107
  }),
1102
1108
  onClick: () => a(ct(d)),
@@ -1106,47 +1112,47 @@ const Me = (t) => {
1106
1112
  w && /* @__PURE__ */ c(
1107
1113
  "div",
1108
1114
  {
1109
- className: X(g, {
1110
- "univer-bg-gray-100": ut(u || ae.FALSE)
1115
+ className: X(v, {
1116
+ "univer-bg-gray-100": ut(h || ae.FALSE)
1111
1117
  }),
1112
- onClick: () => l(ct(u)),
1118
+ onClick: () => l(ct(h)),
1113
1119
  children: /* @__PURE__ */ c(w, {})
1114
1120
  }
1115
1121
  ),
1116
1122
  x && /* @__PURE__ */ c(
1117
1123
  "div",
1118
1124
  {
1119
- className: X(g, {
1120
- "univer-bg-gray-100": ut(h || ae.FALSE)
1125
+ className: X(v, {
1126
+ "univer-bg-gray-100": ut(u || ae.FALSE)
1121
1127
  }),
1122
- onClick: () => v(ct(h)),
1128
+ onClick: () => g(ct(u)),
1123
1129
  children: /* @__PURE__ */ c(x, {})
1124
1130
  }
1125
1131
  ),
1126
- /* @__PURE__ */ c(Me, { color: f, onChange: S, iconId: "FontColor" }),
1127
- /* @__PURE__ */ c(Me, { color: p, onChange: T, iconId: "PaintBucket" })
1132
+ /* @__PURE__ */ c(Me, { color: p, onChange: S, iconId: "FontColor" }),
1133
+ /* @__PURE__ */ c(Me, { color: f, onChange: T, iconId: "PaintBucket" })
1128
1134
  ] });
1129
1135
  }, mi = (t) => {
1130
1136
  var x;
1131
- const { onChange: e, interceptorManager: r } = t, n = W(re), s = W(z).getCurrentUnitForType($.UNIVER_SHEET), o = s.getActiveSheet(), d = ((x = t.rule) == null ? void 0 : x.type) === U.highlightCell ? t.rule : void 0, a = de(null), [u, l] = N(!1), h = de(null), [v, f] = N({}), [S, p] = N(() => (d == null ? void 0 : d.subType) === F.formula ? d.value : "="), [T, _] = N(void 0), R = (g) => ({
1132
- style: g.style,
1137
+ const { onChange: e, interceptorManager: r } = t, n = W(re), s = W(z).getCurrentUnitForType($.UNIVER_SHEET), o = s.getActiveSheet(), d = ((x = t.rule) == null ? void 0 : x.type) === U.highlightCell ? t.rule : void 0, a = de(null), [h, l] = N(!1), u = de(null), [g, p] = N({}), [S, f] = N(() => (d == null ? void 0 : d.subType) === F.formula ? d.value : "="), [T, _] = N(void 0), R = (v) => ({
1138
+ style: v.style,
1133
1139
  value: S,
1134
1140
  type: U.highlightCell,
1135
1141
  subType: F.formula
1136
1142
  });
1137
1143
  K(() => r.intercept(r.getInterceptPoints().submit, {
1138
1144
  handler() {
1139
- return R({ style: v });
1145
+ return R({ style: g });
1140
1146
  }
1141
- }), [v, S, r]), K(() => r.intercept(r.getInterceptPoints().beforeSubmit, {
1147
+ }), [g, S, r]), K(() => r.intercept(r.getInterceptPoints().beforeSubmit, {
1142
1148
  handler: (C, b, y) => T || S.length === 1 || !S.startsWith("=") ? (_(n.t("sheet.cf.errorMessage.formulaError")), !1) : y(C)
1143
1149
  }), [T, S]);
1144
- const w = (g) => {
1145
- e(R(g));
1150
+ const w = (v) => {
1151
+ e(R(v));
1146
1152
  };
1147
- return Nt((g) => {
1153
+ return Nt((v) => {
1148
1154
  var b;
1149
- ((b = h.current) == null ? void 0 : b.isClickOutSide(g)) && l(!1);
1155
+ ((b = u.current) == null ? void 0 : b.isClickOutSide(v)) && l(!1);
1150
1156
  }), /* @__PURE__ */ k("div", { ref: a, children: [
1151
1157
  /* @__PURE__ */ c(
1152
1158
  "div",
@@ -1158,61 +1164,55 @@ const Me = (t) => {
1158
1164
  /* @__PURE__ */ c("div", { className: "univer-mt-3", children: /* @__PURE__ */ c(
1159
1165
  Mt,
1160
1166
  {
1161
- ref: h,
1167
+ ref: u,
1162
1168
  className: X("univer-box-border univer-h-8 univer-w-full univer-cursor-pointer univer-items-center univer-rounded-lg univer-bg-white univer-pt-2 univer-transition-colors [&>div:first-child]:univer-px-2.5 [&>div]:univer-h-5 [&>div]:univer-ring-transparent dark:!univer-bg-gray-700 dark:!univer-text-white hover:univer-border-primary-600", He),
1163
1169
  errorText: T,
1164
- isFocus: u,
1170
+ isFocus: h,
1165
1171
  initValue: S,
1166
1172
  unitId: s.getUnitId(),
1167
1173
  subUnitId: o == null ? void 0 : o.getSheetId(),
1168
1174
  onFocus: () => {
1169
1175
  l(!0);
1170
1176
  },
1171
- onChange: (g) => {
1172
- p(g), w({ style: v });
1177
+ onChange: (v) => {
1178
+ f(v), w({ style: g });
1173
1179
  },
1174
- onVerify: (g, C) => {
1175
- !g || C.length === 1 ? _(n.t("sheet.cf.errorMessage.formulaError")) : _(void 0);
1180
+ onVerify: (v, C) => {
1181
+ !v || C.length === 1 ? _(n.t("sheet.cf.errorMessage.formulaError")) : _(void 0);
1176
1182
  }
1177
1183
  }
1178
1184
  ) }),
1179
- /* @__PURE__ */ c("div", { className: at, children: /* @__PURE__ */ c(We, { rule: R({ style: v }) }) }),
1185
+ /* @__PURE__ */ c("div", { className: at, children: /* @__PURE__ */ c(We, { rule: R({ style: g }) }) }),
1180
1186
  /* @__PURE__ */ c(
1181
1187
  Yt,
1182
1188
  {
1183
1189
  style: d == null ? void 0 : d.style,
1184
1190
  className: "univer-mt-3",
1185
- onChange: (g) => {
1186
- f(g), w({ style: g });
1191
+ onChange: (v) => {
1192
+ p(v), w({ style: v });
1187
1193
  }
1188
1194
  }
1189
1195
  )
1190
1196
  ] });
1191
- }, dt = (t) => /* @__PURE__ */ k("div", { style: { position: "relative" }, children: [
1197
+ }, dt = (t) => /* @__PURE__ */ k("div", { className: "univer-relative", children: [
1192
1198
  /* @__PURE__ */ c(
1193
1199
  "div",
1194
1200
  {
1195
- style: {
1196
- position: "absolute",
1197
- zIndex: 999,
1198
- bottom: "-13px",
1199
- fontSize: "10px",
1200
- color: "red"
1201
- },
1201
+ className: "univer-absolute univer-bottom-[-13px] univer-z-[999] univer-text-[10px] univer-text-red-500",
1202
1202
  children: t.errorText
1203
1203
  }
1204
1204
  ),
1205
1205
  t.children
1206
1206
  ] }), q = (t, e) => ({ label: e.t(`sheet.cf.operator.${t}`), value: t }), fi = (t) => {
1207
- const { type: e, operator: r, onChange: n, value: i, interceptorManager: s } = t, o = W(re), [d, a] = N(() => typeof i == "number" ? i : 0), [u, l] = N(""), [h, v] = N(() => typeof i == "string" ? i : ""), [f, S] = N(""), [p, T] = N(() => Array.isArray(i) ? i[0] === void 0 ? 0 : i[0] : 0), [_, R] = N(""), [w, x] = N(() => Array.isArray(i) ? i[1] === void 0 ? 100 : i[1] : 100), [g, C] = N("");
1207
+ const { type: e, operator: r, onChange: n, value: i, interceptorManager: s } = t, o = W(re), [d, a] = N(() => typeof i == "number" ? i : 0), [h, l] = N(""), [u, g] = N(() => typeof i == "string" ? i : ""), [p, S] = N(""), [f, T] = N(() => Array.isArray(i) ? i[0] === void 0 ? 0 : i[0] : 0), [_, R] = N(""), [w, x] = N(() => Array.isArray(i) ? i[1] === void 0 ? 100 : i[1] : 100), [v, C] = N("");
1208
1208
  switch (K(() => {
1209
1209
  switch (e) {
1210
1210
  case F.text: {
1211
- [j.beginsWith, j.endsWith, j.containsText, j.notContainsText, j.equal, j.notEqual].includes(r) && n(h);
1211
+ [j.beginsWith, j.endsWith, j.containsText, j.notContainsText, j.equal, j.notEqual].includes(r) && n(u);
1212
1212
  break;
1213
1213
  }
1214
1214
  case F.number: {
1215
- [P.equal, P.notEqual, P.greaterThan, P.greaterThanOrEqual, P.lessThan, P.lessThanOrEqual].includes(r) && n(d), [P.between, P.notBetween].includes(r) && n([p, w]);
1215
+ [P.equal, P.notEqual, P.greaterThan, P.greaterThanOrEqual, P.lessThan, P.lessThanOrEqual].includes(r) && n(d), [P.between, P.notBetween].includes(r) && n([f, w]);
1216
1216
  break;
1217
1217
  }
1218
1218
  }
@@ -1222,7 +1222,7 @@ const Me = (t) => {
1222
1222
  switch (e) {
1223
1223
  case F.text:
1224
1224
  if ([j.beginsWith, j.containsText, j.endsWith, j.notEqual, j.notContainsText, j.equal].includes(r))
1225
- return h ? E(y) : (S(o.t("sheet.cf.errorMessage.notBlank")), !1);
1225
+ return u ? E(y) : (S(o.t("sheet.cf.errorMessage.notBlank")), !1);
1226
1226
  }
1227
1227
  return E(y);
1228
1228
  }
@@ -1230,16 +1230,16 @@ const Me = (t) => {
1230
1230
  return () => {
1231
1231
  b();
1232
1232
  };
1233
- }, [e, d, h, r]), e) {
1233
+ }, [e, d, u, r]), e) {
1234
1234
  case F.text: {
1235
1235
  if ([j.beginsWith, j.endsWith, j.containsText, j.notContainsText, j.equal, j.notEqual].includes(r)) {
1236
1236
  const b = (y) => {
1237
- v(y), n(y);
1237
+ g(y), n(y);
1238
1238
  };
1239
- return /* @__PURE__ */ c("div", { className: "univer-mt-3", children: /* @__PURE__ */ c(dt, { errorText: f, children: /* @__PURE__ */ c(
1239
+ return /* @__PURE__ */ c("div", { className: "univer-mt-3", children: /* @__PURE__ */ c(dt, { errorText: p, children: /* @__PURE__ */ c(
1240
1240
  Gr,
1241
1241
  {
1242
- value: h,
1242
+ value: u,
1243
1243
  onChange: (y) => {
1244
1244
  S(""), b(y);
1245
1245
  }
@@ -1253,7 +1253,7 @@ const Me = (t) => {
1253
1253
  const b = (y) => {
1254
1254
  a(y || 0), n(y || 0), l("");
1255
1255
  };
1256
- return /* @__PURE__ */ c("div", { className: "univer-mt-3", children: /* @__PURE__ */ c(dt, { errorText: u, children: /* @__PURE__ */ c(
1256
+ return /* @__PURE__ */ c("div", { className: "univer-mt-3", children: /* @__PURE__ */ c(dt, { errorText: h, children: /* @__PURE__ */ c(
1257
1257
  Ne,
1258
1258
  {
1259
1259
  className: "univer-w-full",
@@ -1268,11 +1268,11 @@ const Me = (t) => {
1268
1268
  const b = (M) => {
1269
1269
  T(M || 0), n([M || 0, w]), R("");
1270
1270
  }, y = (M) => {
1271
- x(M || 0), n([p, M || 0]), C("");
1271
+ x(M || 0), n([f, M || 0]), C("");
1272
1272
  };
1273
1273
  return /* @__PURE__ */ k("div", { className: "univer-mt-3 univer-flex univer-items-center", children: [
1274
- /* @__PURE__ */ c(dt, { errorText: _, children: /* @__PURE__ */ c(Ne, { min: Number.MIN_SAFE_INTEGER, max: Number.MAX_SAFE_INTEGER, value: p, onChange: b }) }),
1275
- /* @__PURE__ */ c(dt, { errorText: g, children: /* @__PURE__ */ c(
1274
+ /* @__PURE__ */ c(dt, { errorText: _, children: /* @__PURE__ */ c(Ne, { min: Number.MIN_SAFE_INTEGER, max: Number.MAX_SAFE_INTEGER, value: f, onChange: b }) }),
1275
+ /* @__PURE__ */ c(dt, { errorText: v, children: /* @__PURE__ */ c(
1276
1276
  Ne,
1277
1277
  {
1278
1278
  className: "univer-ml-3",
@@ -1330,8 +1330,8 @@ const Me = (t) => {
1330
1330
  }, an = (t) => {
1331
1331
  var x;
1332
1332
  const { interceptorManager: e, onChange: r } = t, n = W(re), i = ((x = t.rule) == null ? void 0 : x.type) === U.highlightCell ? t.rule : void 0, [s, o] = N(() => {
1333
- const g = F.text;
1334
- return i && i.subType || g;
1333
+ const v = F.text;
1334
+ return i && i.subType || v;
1335
1335
  }), d = [{
1336
1336
  value: F.text,
1337
1337
  label: n.t("sheet.cf.subRuleType.text")
@@ -1347,70 +1347,70 @@ const Me = (t) => {
1347
1347
  }, {
1348
1348
  value: F.uniqueValues,
1349
1349
  label: n.t("sheet.cf.subRuleType.uniqueValues")
1350
- }], a = J(() => on(s, n), [s]), [u, l] = N(() => {
1351
- const g = a ? a[0].value : void 0;
1352
- return i && i.operator || g;
1353
- }), [h, v] = N(() => {
1350
+ }], a = J(() => on(s, n), [s]), [h, l] = N(() => {
1351
+ const v = a ? a[0].value : void 0;
1352
+ return i && i.operator || v;
1353
+ }), [u, g] = N(() => {
1354
1354
  var b;
1355
- const g = "";
1356
- return i ? (b = i.value) != null ? b : mt(i.subType, i.operator) : g;
1357
- }), [f, S] = N({}), p = J(() => (g) => {
1355
+ const v = "";
1356
+ return i ? (b = i.value) != null ? b : mt(i.subType, i.operator) : v;
1357
+ }), [p, S] = N({}), f = J(() => (v) => {
1358
1358
  var C, b, y, M, E, V, L, m, I, H, Y, ge, me, ke, Fe;
1359
- switch (g.subType || s) {
1359
+ switch (v.subType || s) {
1360
1360
  case F.text: {
1361
- if ([j.beginsWith, j.endsWith, j.containsText, j.notContainsText, j.equal, j.notEqual].includes(u))
1361
+ if ([j.beginsWith, j.endsWith, j.containsText, j.notContainsText, j.equal, j.notEqual].includes(h))
1362
1362
  return {
1363
1363
  type: U.highlightCell,
1364
- subType: (C = g.subType) != null ? C : s,
1365
- operator: (b = g.operator) != null ? b : u,
1366
- style: (y = g.style) != null ? y : f,
1367
- value: (M = g.value) != null ? M : h
1364
+ subType: (C = v.subType) != null ? C : s,
1365
+ operator: (b = v.operator) != null ? b : h,
1366
+ style: (y = v.style) != null ? y : p,
1367
+ value: (M = v.value) != null ? M : u
1368
1368
  };
1369
1369
  break;
1370
1370
  }
1371
1371
  case F.number: {
1372
- if ([P.equal, P.notEqual, P.greaterThan, P.greaterThanOrEqual, P.lessThan, P.lessThanOrEqual].includes(u))
1372
+ if ([P.equal, P.notEqual, P.greaterThan, P.greaterThanOrEqual, P.lessThan, P.lessThanOrEqual].includes(h))
1373
1373
  return {
1374
1374
  type: U.highlightCell,
1375
- subType: (E = g.subType) != null ? E : s,
1376
- operator: (V = g.operator) != null ? V : u,
1377
- style: (L = g.style) != null ? L : f,
1378
- value: (m = g.value) != null ? m : h
1375
+ subType: (E = v.subType) != null ? E : s,
1376
+ operator: (V = v.operator) != null ? V : h,
1377
+ style: (L = v.style) != null ? L : p,
1378
+ value: (m = v.value) != null ? m : u
1379
1379
  };
1380
- if ([P.between, P.notBetween].includes(u))
1380
+ if ([P.between, P.notBetween].includes(h))
1381
1381
  return {
1382
1382
  type: U.highlightCell,
1383
- subType: (I = g.subType) != null ? I : s,
1384
- operator: (H = g.operator) != null ? H : u,
1385
- style: (Y = g.style) != null ? Y : f,
1386
- value: (ge = g.value) != null ? ge : h
1383
+ subType: (I = v.subType) != null ? I : s,
1384
+ operator: (H = v.operator) != null ? H : h,
1385
+ style: (Y = v.style) != null ? Y : p,
1386
+ value: (ge = v.value) != null ? ge : u
1387
1387
  };
1388
1388
  break;
1389
1389
  }
1390
1390
  }
1391
1391
  return {
1392
1392
  type: U.highlightCell,
1393
- subType: (me = g.subType) != null ? me : s,
1394
- operator: (ke = g.operator) != null ? ke : u,
1395
- style: (Fe = g.style) != null ? Fe : f
1393
+ subType: (me = v.subType) != null ? me : s,
1394
+ operator: (ke = v.operator) != null ? ke : h,
1395
+ style: (Fe = v.style) != null ? Fe : p
1396
1396
  };
1397
- }, [s, u, h, f]);
1397
+ }, [s, h, u, p]);
1398
1398
  K(() => e.intercept(e.getInterceptPoints().submit, {
1399
1399
  handler() {
1400
- return p({});
1400
+ return f({});
1401
1401
  }
1402
- }), [p, e]), K(() => {
1403
- d.some((g) => g.value === s) || o(d[0].value);
1402
+ }), [f, e]), K(() => {
1403
+ d.some((v) => v.value === s) || o(d[0].value);
1404
1404
  }, [d]);
1405
- const T = (g) => {
1406
- const C = g, b = on(C, n), y = b && b[0].value;
1407
- o(C), l(y), y && v(mt(C, y)), r(p({ subType: C, operator: y }));
1408
- }, _ = (g) => {
1409
- const C = g;
1410
- l(C), r(p({ operator: C }));
1411
- }, R = (g) => {
1412
- v(g), r(p({ value: g }));
1413
- }, w = J(() => `${s}_${u}_${Math.random()}`, [s, u]);
1405
+ const T = (v) => {
1406
+ const C = v, b = on(C, n), y = b && b[0].value;
1407
+ o(C), l(y), y && g(mt(C, y)), r(f({ subType: C, operator: y }));
1408
+ }, _ = (v) => {
1409
+ const C = v;
1410
+ l(C), r(f({ operator: C }));
1411
+ }, R = (v) => {
1412
+ g(v), r(f({ value: v }));
1413
+ }, w = J(() => `${s}_${h}_${Math.random()}`, [s, h]);
1414
1414
  return /* @__PURE__ */ k("div", { children: [
1415
1415
  /* @__PURE__ */ c(
1416
1416
  "div",
@@ -1434,7 +1434,7 @@ const Me = (t) => {
1434
1434
  {
1435
1435
  className: "univer-mt-3 univer-w-full",
1436
1436
  onChange: _,
1437
- value: u || "",
1437
+ value: h || "",
1438
1438
  options: a
1439
1439
  }
1440
1440
  )
@@ -1442,33 +1442,33 @@ const Me = (t) => {
1442
1442
  /* @__PURE__ */ c(
1443
1443
  fi,
1444
1444
  {
1445
- value: h,
1445
+ value: u,
1446
1446
  interceptorManager: e,
1447
1447
  type: s,
1448
- operator: u,
1448
+ operator: h,
1449
1449
  rule: i,
1450
1450
  onChange: R
1451
1451
  },
1452
1452
  w
1453
1453
  ),
1454
- /* @__PURE__ */ c("div", { className: at, children: /* @__PURE__ */ c(We, { rule: p({}) }) }),
1454
+ /* @__PURE__ */ c("div", { className: at, children: /* @__PURE__ */ c(We, { rule: f({}) }) }),
1455
1455
  /* @__PURE__ */ c(
1456
1456
  Yt,
1457
1457
  {
1458
1458
  style: i == null ? void 0 : i.style,
1459
1459
  className: "univer-ml-1",
1460
- onChange: (g) => {
1461
- S(g), r(p({ style: g }));
1460
+ onChange: (v) => {
1461
+ S(v), r(f({ style: v }));
1462
1462
  }
1463
1463
  }
1464
1464
  )
1465
1465
  ] });
1466
1466
  }, Xn = (t, e) => (Ee[t] || [])[Number(e)] || "", pi = (t) => {
1467
1467
  var l;
1468
- const { error: e, type: r, onChange: n } = t, i = W(z), s = i.getCurrentUnitForType($.UNIVER_SHEET).getUnitId(), o = (l = i.getCurrentUnitForType($.UNIVER_SHEET).getActiveSheet()) == null ? void 0 : l.getSheetId(), d = de(null), [a, u] = N(!1);
1469
- return Nt((h) => {
1470
- var f;
1471
- ((f = d.current) == null ? void 0 : f.isClickOutSide(h)) && u(!1);
1468
+ const { error: e, type: r, onChange: n } = t, i = W(z), s = i.getCurrentUnitForType($.UNIVER_SHEET).getUnitId(), o = (l = i.getCurrentUnitForType($.UNIVER_SHEET).getActiveSheet()) == null ? void 0 : l.getSheetId(), d = de(null), [a, h] = N(!1);
1469
+ return Nt((u) => {
1470
+ var p;
1471
+ ((p = d.current) == null ? void 0 : p.isClickOutSide(u)) && h(!1);
1472
1472
  }), /* @__PURE__ */ c("div", { className: "univer-relative", children: r !== A.formula ? /* @__PURE__ */ k(Bt, { children: [
1473
1473
  /* @__PURE__ */ c(
1474
1474
  Ne,
@@ -1477,7 +1477,7 @@ const Me = (t) => {
1477
1477
  "univer-border-red-500": e
1478
1478
  }),
1479
1479
  value: Number(t.value) || 0,
1480
- onChange: (h) => n(h != null ? h : 0)
1480
+ onChange: (u) => n(u != null ? u : 0)
1481
1481
  }
1482
1482
  ),
1483
1483
  e && /* @__PURE__ */ c("div", { className: "univer-absolute univer-text-xs univer-text-red-500", children: e })
@@ -1489,10 +1489,10 @@ const Me = (t) => {
1489
1489
  unitId: s,
1490
1490
  subUnitId: o,
1491
1491
  isFocus: a,
1492
- onChange: (h = "") => {
1493
- n(h || "");
1492
+ onChange: (u = "") => {
1493
+ n(u || "");
1494
1494
  },
1495
- onFocus: () => u(!0)
1495
+ onFocus: () => h(!0)
1496
1496
  }
1497
1497
  ) }) });
1498
1498
  }, ln = (t, e, r) => ({
@@ -1517,14 +1517,14 @@ const Me = (t) => {
1517
1517
  "a",
1518
1518
  {
1519
1519
  className: "univer-cursor-pointer univer-rounded dark:hover:!univer-bg-gray-700 hover:univer-bg-gray-100",
1520
- children: d.list.map((a, u) => /* @__PURE__ */ c(
1520
+ children: d.list.map((a, h) => /* @__PURE__ */ c(
1521
1521
  "img",
1522
1522
  {
1523
1523
  className: "univer-size-5",
1524
1524
  src: a,
1525
1525
  draggable: !1
1526
1526
  },
1527
- u
1527
+ h
1528
1528
  ))
1529
1529
  }
1530
1530
  )
@@ -1537,11 +1537,11 @@ const Me = (t) => {
1537
1537
  const i = [];
1538
1538
  for (const s in Ee) {
1539
1539
  const o = Ee[s], d = s;
1540
- o.forEach((a, u) => {
1540
+ o.forEach((a, h) => {
1541
1541
  i.push({
1542
1542
  iconType: d,
1543
1543
  base64: a,
1544
- iconId: String(u)
1544
+ iconId: String(h)
1545
1545
  });
1546
1546
  });
1547
1547
  }
@@ -1584,26 +1584,26 @@ const Me = (t) => {
1584
1584
  { label: i.t(`sheet.cf.valueType.${A.percent}`), value: A.percent },
1585
1585
  { label: i.t(`sheet.cf.valueType.${A.percentile}`), value: A.percentile },
1586
1586
  { label: i.t(`sheet.cf.valueType.${A.formula}`), value: A.formula }
1587
- ], d = (h, v) => {
1588
- e([String(v), "value", "value"], h);
1589
- }, a = (h, v) => {
1590
- e([String(v), "operator"], h);
1591
- const f = mt(F.number, h);
1592
- d(f, v);
1593
- }, u = (h, v) => {
1594
- e([String(v), "value", "type"], h);
1595
- const f = r[v], S = mt(F.number, f.operator);
1596
- d(S, v);
1587
+ ], d = (u, g) => {
1588
+ e([String(g), "value", "value"], u);
1589
+ }, a = (u, g) => {
1590
+ e([String(g), "operator"], u);
1591
+ const p = mt(F.number, u);
1592
+ d(p, g);
1593
+ }, h = (u, g) => {
1594
+ e([String(g), "value", "type"], u);
1595
+ const p = r[g], S = mt(F.number, p.operator);
1596
+ d(S, g);
1597
1597
  };
1598
- return J(() => r.map((h, v) => {
1599
- const f = n[v], S = Xn(h.iconType, h.iconId), p = v === r.length - 1, T = v === 0, _ = r[v - 1], R = (_ == null ? void 0 : _.value.type) === A.formula ? i.t("sheet.cf.valueType.formula") : _ == null ? void 0 : _.value.value, w = (x, g) => {
1600
- const C = { ...h, iconId: g, iconType: x };
1601
- e([String(v)], C);
1598
+ return J(() => r.map((u, g) => {
1599
+ const p = n[g], S = Xn(u.iconType, u.iconId), f = g === r.length - 1, T = g === 0, _ = r[g - 1], R = (_ == null ? void 0 : _.value.type) === A.formula ? i.t("sheet.cf.valueType.formula") : _ == null ? void 0 : _.value.value, w = (x, v) => {
1600
+ const C = { ...u, iconId: v, iconType: x };
1601
+ e([String(g)], C);
1602
1602
  };
1603
1603
  return /* @__PURE__ */ k(
1604
1604
  "div",
1605
1605
  {
1606
- className: v ? "univer-mt-6" : "univer-mt-3",
1606
+ className: g ? "univer-mt-6" : "univer-mt-3",
1607
1607
  children: [
1608
1608
  /* @__PURE__ */ k(
1609
1609
  "div",
@@ -1616,13 +1616,13 @@ const Me = (t) => {
1616
1616
  className: "univer-w-[45%]",
1617
1617
  children: [
1618
1618
  i.t("sheet.cf.iconSet.icon"),
1619
- v + 1
1619
+ g + 1
1620
1620
  ]
1621
1621
  }
1622
1622
  ),
1623
1623
  /* @__PURE__ */ c("div", { className: "univer-w-[45%]", children: /* @__PURE__ */ k(Bt, { children: [
1624
- !T && !p && i.t("sheet.cf.iconSet.rule"),
1625
- !T && !p && /* @__PURE__ */ k(
1624
+ !T && !f && i.t("sheet.cf.iconSet.rule"),
1625
+ !T && !f && /* @__PURE__ */ k(
1626
1626
  "span",
1627
1627
  {
1628
1628
  className: "univer-font-medium univer-text-gray-600 dark:!univer-text-gray-200",
@@ -1631,7 +1631,7 @@ const Me = (t) => {
1631
1631
  i.t("sheet.cf.iconSet.when"),
1632
1632
  i.t(`sheet.cf.symbol.${Ht(_.operator)}`),
1633
1633
  R,
1634
- p ? "" : ` ${i.t("sheet.cf.iconSet.and")} `,
1634
+ f ? "" : ` ${i.t("sheet.cf.iconSet.and")} `,
1635
1635
  ")"
1636
1636
  ]
1637
1637
  }
@@ -1644,7 +1644,7 @@ const Me = (t) => {
1644
1644
  /* @__PURE__ */ c("div", { className: "univer-flex univer-items-center", children: /* @__PURE__ */ c(
1645
1645
  Zt,
1646
1646
  {
1647
- overlay: /* @__PURE__ */ c("div", { className: "univer-rounded-lg univer-p-4", children: /* @__PURE__ */ c(yi, { onClick: w, iconId: h.iconId, iconType: h.iconType }) }),
1647
+ overlay: /* @__PURE__ */ c("div", { className: "univer-rounded-lg univer-p-4", children: /* @__PURE__ */ c(yi, { onClick: w, iconId: u.iconId, iconType: u.iconType }) }),
1648
1648
  children: /* @__PURE__ */ k(
1649
1649
  "div",
1650
1650
  {
@@ -1662,7 +1662,7 @@ const Me = (t) => {
1662
1662
  )
1663
1663
  }
1664
1664
  ) }),
1665
- p ? /* @__PURE__ */ k(
1665
+ f ? /* @__PURE__ */ k(
1666
1666
  "div",
1667
1667
  {
1668
1668
  className: "univer-mt-0 univer-w-[45%] univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",
@@ -1672,7 +1672,7 @@ const Me = (t) => {
1672
1672
  i.t("sheet.cf.iconSet.when"),
1673
1673
  i.t(`sheet.cf.symbol.${Ht(_.operator)}`),
1674
1674
  R,
1675
- p ? "" : ` ${i.t("sheet.cf.iconSet.and")} `
1675
+ f ? "" : ` ${i.t("sheet.cf.iconSet.and")} `
1676
1676
  ] })
1677
1677
  ]
1678
1678
  }
@@ -1680,14 +1680,14 @@ const Me = (t) => {
1680
1680
  le,
1681
1681
  {
1682
1682
  options: s,
1683
- value: h.operator,
1683
+ value: u.operator,
1684
1684
  onChange: (x) => {
1685
- a(x, v);
1685
+ a(x, g);
1686
1686
  }
1687
1687
  }
1688
1688
  )
1689
1689
  ] }),
1690
- p ? /* @__PURE__ */ c("div", {}) : /* @__PURE__ */ k(Bt, { children: [
1690
+ f ? /* @__PURE__ */ c("div", {}) : /* @__PURE__ */ k(Bt, { children: [
1691
1691
  /* @__PURE__ */ k(
1692
1692
  "div",
1693
1693
  {
@@ -1708,21 +1708,21 @@ const Me = (t) => {
1708
1708
  {
1709
1709
  className: "univer-flex-shrink-0",
1710
1710
  options: o,
1711
- value: h.value.type,
1711
+ value: u.value.type,
1712
1712
  onChange: (x) => {
1713
- u(x, v);
1713
+ h(x, g);
1714
1714
  }
1715
1715
  }
1716
1716
  ),
1717
1717
  /* @__PURE__ */ c("div", { children: /* @__PURE__ */ c(
1718
1718
  pi,
1719
1719
  {
1720
- id: v,
1721
- type: h.value.type,
1722
- error: f,
1723
- value: h.value.value || "",
1720
+ id: g,
1721
+ type: u.value.type,
1722
+ error: p,
1723
+ value: u.value.value || "",
1724
1724
  onChange: (x) => {
1725
- d(x, v);
1725
+ d(x, g);
1726
1726
  }
1727
1727
  }
1728
1728
  ) })
@@ -1732,32 +1732,32 @@ const Me = (t) => {
1732
1732
  ] })
1733
1733
  ]
1734
1734
  },
1735
- v
1735
+ g
1736
1736
  );
1737
1737
  }), [r, n]);
1738
1738
  }, Si = (t) => {
1739
1739
  var x;
1740
1740
  const { interceptorManager: e } = t, r = ((x = t.rule) == null ? void 0 : x.type) === U.iconSet ? t.rule : void 0, n = W(re), [i, s] = N({}), [o, d] = N(() => {
1741
- const g = Object.keys(Ee)[0];
1741
+ const v = Object.keys(Ee)[0];
1742
1742
  if (r && r.config.length) {
1743
1743
  const C = r.config[0].iconType;
1744
1744
  if (!r.config.some((y) => y.iconType !== C))
1745
1745
  return C;
1746
1746
  }
1747
- return g;
1748
- }), [a, u] = N(() => {
1747
+ return v;
1748
+ }), [a, h] = N(() => {
1749
1749
  if (r && r.config.length)
1750
1750
  return Wt.deepClone(r == null ? void 0 : r.config);
1751
- const g = Ee[o] || [];
1752
- return new Array(g.length).fill("").map((C, b, y) => b === y.length - 1 ? {
1751
+ const v = Ee[o] || [];
1752
+ return new Array(v.length).fill("").map((C, b, y) => b === y.length - 1 ? {
1753
1753
  operator: P.lessThanOrEqual,
1754
1754
  value: { type: A.num, value: Number.MAX_SAFE_INTEGER },
1755
1755
  iconType: o,
1756
1756
  iconId: String(b)
1757
1757
  } : ln(o, b, y));
1758
- }), [l, h] = N(() => r ? !!r.isShowValue : !0), v = J(() => {
1759
- const g = a.map((C) => Xn(C.iconType, C.iconId));
1760
- return /* @__PURE__ */ c("div", { className: "univer-flex univer-items-center", children: g.map((C, b) => C ? /* @__PURE__ */ c(
1758
+ }), [l, u] = N(() => r ? !!r.isShowValue : !0), g = J(() => {
1759
+ const v = a.map((C) => Xn(C.iconType, C.iconId));
1760
+ return /* @__PURE__ */ c("div", { className: "univer-flex univer-items-center", children: v.map((C, b) => C ? /* @__PURE__ */ c(
1761
1761
  "img",
1762
1762
  {
1763
1763
  className: "univer-size-5",
@@ -1765,8 +1765,8 @@ const Me = (t) => {
1765
1765
  },
1766
1766
  b
1767
1767
  ) : /* @__PURE__ */ c(ot, { className: "univer-size-5" }, b)) });
1768
- }, [a]), f = (g) => {
1769
- if (g.reduce((b, y, M) => b.preType && !b.result || g.length - 1 === M ? b : y.value.type === A.formula ? {
1768
+ }, [a]), p = (v) => {
1769
+ if (v.reduce((b, y, M) => b.preType && !b.result || v.length - 1 === M ? b : y.value.type === A.formula ? {
1770
1770
  preType: A.formula,
1771
1771
  result: !1
1772
1772
  } : b.preType ? {
@@ -1775,48 +1775,48 @@ const Me = (t) => {
1775
1775
  } : {
1776
1776
  result: !0,
1777
1777
  preType: y.value.type
1778
- }, { result: !0, preType: "" }).result && [A.num, A.percent, A.percentile].includes(g[0].value.type)) {
1778
+ }, { result: !0, preType: "" }).result && [A.num, A.percent, A.percentile].includes(v[0].value.type)) {
1779
1779
  const b = {};
1780
- return g.forEach((y, M, E) => {
1780
+ return v.forEach((y, M, E) => {
1781
1781
  if (M - 1 < 0 || M === E.length - 1)
1782
1782
  return;
1783
- const L = g[M - 1], m = Ht(L.operator);
1783
+ const L = v[M - 1], m = Ht(L.operator);
1784
1784
  fr({ operator: m, value: L.value.value }, y.value.value) || (b[M] = `${n.t(`sheet.cf.form.${m}`, String(L.value.value))} `);
1785
1785
  }), b;
1786
1786
  }
1787
1787
  return {};
1788
- }, S = (g, C) => {
1789
- sr(a, g) !== C && (or(a, g, C), u([...a]), s(f(a)));
1790
- }, p = (g) => {
1791
- d(g);
1792
- const C = Ee[g] || [], b = new Array(C.length).fill("").map((y, M, E) => ln(g, M, E));
1793
- u(b), s(f(b));
1788
+ }, S = (v, C) => {
1789
+ sr(a, v) !== C && (or(a, v, C), h([...a]), s(p(a)));
1790
+ }, f = (v) => {
1791
+ d(v);
1792
+ const C = Ee[v] || [], b = new Array(C.length).fill("").map((y, M, E) => ln(v, M, E));
1793
+ h(b), s(p(b));
1794
1794
  };
1795
1795
  K(() => {
1796
- const g = e.intercept(e.getInterceptPoints().submit, {
1796
+ const v = e.intercept(e.getInterceptPoints().submit, {
1797
1797
  handler() {
1798
1798
  return { type: U.iconSet, isShowValue: l, config: a };
1799
1799
  }
1800
1800
  });
1801
1801
  return () => {
1802
- g();
1802
+ v();
1803
1803
  };
1804
1804
  }, [l, a, e]), K(() => {
1805
- const g = e.intercept(e.getInterceptPoints().beforeSubmit, {
1805
+ const v = e.intercept(e.getInterceptPoints().beforeSubmit, {
1806
1806
  handler() {
1807
1807
  return Object.keys(i).length === 0;
1808
1808
  }
1809
1809
  });
1810
1810
  return () => {
1811
- g();
1811
+ v();
1812
1812
  };
1813
1813
  }, [l, a, e, i]);
1814
1814
  const T = () => {
1815
- const g = a.map((C) => ({ ...C }));
1815
+ const v = a.map((C) => ({ ...C }));
1816
1816
  a.forEach((C, b) => {
1817
- const y = a.length - 1 - b, M = g[y];
1817
+ const y = a.length - 1 - b, M = v[y];
1818
1818
  C.iconId = M.iconId, C.iconType = M.iconType;
1819
- }), u([...a]);
1819
+ }), h([...a]);
1820
1820
  }, _ = W(Lr), [R, w] = N();
1821
1821
  return Ar(R, _.rootContainerElement), /* @__PURE__ */ k("div", { children: [
1822
1822
  /* @__PURE__ */ c("div", { className: "univer-mt-4 univer-text-sm univer-text-gray-600", children: n.t("sheet.cf.panel.styleRule") }),
@@ -1826,11 +1826,11 @@ const Me = (t) => {
1826
1826
  overlay: /* @__PURE__ */ c("div", { className: "univer-rounded-lg univer-p-4", children: /* @__PURE__ */ c(
1827
1827
  Ci,
1828
1828
  {
1829
- ref: (g) => {
1830
- !R && g && w(g);
1829
+ ref: (v) => {
1830
+ !R && v && w(v);
1831
1831
  },
1832
1832
  iconType: o,
1833
- onClick: p
1833
+ onClick: f
1834
1834
  }
1835
1835
  ) }),
1836
1836
  children: /* @__PURE__ */ k(
@@ -1838,7 +1838,7 @@ const Me = (t) => {
1838
1838
  {
1839
1839
  className: X("univer-box-border univer-flex univer-h-8 univer-w-full univer-items-center univer-justify-between univer-rounded-md univer-bg-white univer-px-4 univer-py-2 univer-text-xs univer-text-gray-600 univer-transition-all hover:univer-border-primary-600", He),
1840
1840
  children: [
1841
- v,
1841
+ g,
1842
1842
  /* @__PURE__ */ c(Vt, {})
1843
1843
  ]
1844
1844
  }
@@ -1851,8 +1851,8 @@ const Me = (t) => {
1851
1851
  n.t("sheet.cf.iconSet.reverseIconOrder")
1852
1852
  ] }),
1853
1853
  /* @__PURE__ */ k("div", { className: "univer-ml-6 univer-flex univer-items-center univer-text-xs", children: [
1854
- /* @__PURE__ */ c(yt, { checked: !l, onChange: (g) => {
1855
- h(!g);
1854
+ /* @__PURE__ */ c(yt, { checked: !l, onChange: (v) => {
1855
+ u(!v);
1856
1856
  } }),
1857
1857
  n.t("sheet.cf.iconSet.onlyShowIcon")
1858
1858
  ] })
@@ -1875,7 +1875,7 @@ const Me = (t) => {
1875
1875
  }
1876
1876
  }
1877
1877
  return _;
1878
- }), [a, u] = N(() => {
1878
+ }), [a, h] = N(() => {
1879
1879
  const R = i == null ? void 0 : i.type;
1880
1880
  if (!i)
1881
1881
  return 10;
@@ -1887,7 +1887,7 @@ const Me = (t) => {
1887
1887
  }
1888
1888
  }
1889
1889
  return 10;
1890
- }), [l, h] = N(() => {
1890
+ }), [l, u] = N(() => {
1891
1891
  const R = i == null ? void 0 : i.type;
1892
1892
  if (!i)
1893
1893
  return !1;
@@ -1899,23 +1899,23 @@ const Me = (t) => {
1899
1899
  }
1900
1900
  }
1901
1901
  return !1;
1902
- }), [v, f] = N({}), S = (_) => {
1903
- const { type: R, isPercent: w, value: x, style: g } = _;
1902
+ }), [g, p] = N({}), S = (_) => {
1903
+ const { type: R, isPercent: w, value: x, style: v } = _;
1904
1904
  if (R === "isNotBottom")
1905
- return { type: U.highlightCell, subType: F.rank, isPercent: w, isBottom: !1, value: x, style: g };
1905
+ return { type: U.highlightCell, subType: F.rank, isPercent: w, isBottom: !1, value: x, style: v };
1906
1906
  if (R === "isBottom")
1907
- return { type: U.highlightCell, subType: F.rank, isPercent: w, isBottom: !0, value: x, style: g };
1907
+ return { type: U.highlightCell, subType: F.rank, isPercent: w, isBottom: !0, value: x, style: v };
1908
1908
  if (R === "greaterThanAverage")
1909
- return { type: U.highlightCell, subType: F.average, operator: P.greaterThan, style: g };
1909
+ return { type: U.highlightCell, subType: F.average, operator: P.greaterThan, style: v };
1910
1910
  if (R === "lessThanAverage")
1911
- return { type: U.highlightCell, subType: F.average, operator: P.lessThan, style: g };
1911
+ return { type: U.highlightCell, subType: F.average, operator: P.lessThan, style: v };
1912
1912
  };
1913
1913
  K(() => r.intercept(r.getInterceptPoints().submit, {
1914
1914
  handler() {
1915
- return S({ type: o, isPercent: l, value: a, style: v });
1915
+ return S({ type: o, isPercent: l, value: a, style: g });
1916
1916
  }
1917
- }), [o, l, a, v, r]);
1918
- const p = (_) => {
1917
+ }), [o, l, a, g, r]);
1918
+ const f = (_) => {
1919
1919
  e(S(_));
1920
1920
  };
1921
1921
  return /* @__PURE__ */ k("div", { children: [
@@ -1933,7 +1933,7 @@ const Me = (t) => {
1933
1933
  value: o,
1934
1934
  options: s,
1935
1935
  onChange: (_) => {
1936
- d(_), p({ type: _, isPercent: l, value: a, style: v });
1936
+ d(_), f({ type: _, isPercent: l, value: a, style: g });
1937
1937
  }
1938
1938
  }
1939
1939
  ),
@@ -1946,7 +1946,7 @@ const Me = (t) => {
1946
1946
  value: a,
1947
1947
  onChange: (_) => {
1948
1948
  const R = _ || 0;
1949
- u(R), p({ type: o, isPercent: l, value: R, style: v });
1949
+ h(R), f({ type: o, isPercent: l, value: R, style: g });
1950
1950
  }
1951
1951
  }
1952
1952
  ),
@@ -1960,7 +1960,7 @@ const Me = (t) => {
1960
1960
  {
1961
1961
  checked: l,
1962
1962
  onChange: (_) => {
1963
- h(!!_), p({ type: o, isPercent: !!_, value: a, style: v });
1963
+ u(!!_), f({ type: o, isPercent: !!_, value: a, style: g });
1964
1964
  }
1965
1965
  }
1966
1966
  ),
@@ -1969,14 +1969,14 @@ const Me = (t) => {
1969
1969
  }
1970
1970
  )
1971
1971
  ] }),
1972
- /* @__PURE__ */ c("div", { className: at, children: /* @__PURE__ */ c(We, { rule: S({ type: o, isPercent: l, value: a, style: v }) }) }),
1972
+ /* @__PURE__ */ c("div", { className: at, children: /* @__PURE__ */ c(We, { rule: S({ type: o, isPercent: l, value: a, style: g }) }) }),
1973
1973
  /* @__PURE__ */ c(
1974
1974
  Yt,
1975
1975
  {
1976
1976
  style: i == null ? void 0 : i.style,
1977
1977
  className: "univer-mt-3",
1978
1978
  onChange: (_) => {
1979
- f(_), p({ type: o, isPercent: l, value: a, style: _ });
1979
+ p(_), f({ type: o, isPercent: l, value: a, style: _ });
1980
1980
  }
1981
1981
  }
1982
1982
  )
@@ -1986,23 +1986,23 @@ const Me = (t) => {
1986
1986
  return (e = t.getCurrentUnitForType($.UNIVER_SHEET).getActiveSheet()) == null ? void 0 : e.getSheetId();
1987
1987
  }, Ri = (t) => {
1988
1988
  var b, y, M;
1989
- const e = W(re), r = W(te), n = W(z), i = W(Q), s = W($e), o = cn(n), d = un(n), [a, u] = N(void 0), l = de((y = (b = t.rule) == null ? void 0 : b.ranges) != null ? y : []), h = J(() => {
1989
+ const e = W(re), r = W(te), n = W(z), i = W(Q), s = W($e), o = cn(n), d = un(n), [a, h] = N(void 0), l = de((y = (b = t.rule) == null ? void 0 : b.ranges) != null ? y : []), u = J(() => {
1990
1990
  var V, L, m;
1991
1991
  let E = (V = t.rule) == null ? void 0 : V.ranges;
1992
1992
  return E != null && E.length || (E = (m = (L = s.getCurrentSelections()) == null ? void 0 : L.map((I) => I.range)) != null ? m : []), l.current = E, E != null && E.length ? E.map((I) => {
1993
1993
  const H = Un(I);
1994
1994
  return H === "NaN" ? "" : H;
1995
1995
  }).filter((I) => !!I).join(",") : "";
1996
- }, [t.rule]), v = [
1996
+ }, [t.rule]), g = [
1997
1997
  { label: e.t("sheet.cf.ruleType.highlightCell"), value: "1" },
1998
1998
  { label: e.t("sheet.cf.panel.rankAndAverage"), value: "2" },
1999
1999
  { label: e.t("sheet.cf.ruleType.dataBar"), value: "3" },
2000
2000
  { label: e.t("sheet.cf.ruleType.colorScale"), value: "4" },
2001
2001
  { label: e.t("sheet.cf.ruleType.formula"), value: "5" },
2002
2002
  { label: e.t("sheet.cf.ruleType.iconSet"), value: "6" }
2003
- ], [f, S] = N(() => {
2003
+ ], [p, S] = N(() => {
2004
2004
  var L, m;
2005
- const E = (L = t.rule) == null ? void 0 : L.rule.type, V = v[0].value;
2005
+ const E = (L = t.rule) == null ? void 0 : L.rule.type, V = g[0].value;
2006
2006
  if (!E)
2007
2007
  return V;
2008
2008
  switch (E) {
@@ -2030,8 +2030,8 @@ const Me = (t) => {
2030
2030
  return "6";
2031
2031
  }
2032
2032
  return V;
2033
- }), p = de(void 0), T = J(() => new ar({ beforeSubmit: _i, submit: Ti }), []), _ = J(() => {
2034
- switch (f) {
2033
+ }), f = de(void 0), T = J(() => new ar({ beforeSubmit: _i, submit: Ti }), []), _ = J(() => {
2034
+ switch (p) {
2035
2035
  case "1":
2036
2036
  return an;
2037
2037
  case "2":
@@ -2047,7 +2047,7 @@ const Me = (t) => {
2047
2047
  default:
2048
2048
  return an;
2049
2049
  }
2050
- }, [f]);
2050
+ }, [p]);
2051
2051
  K(() => {
2052
2052
  const E = r.onCommandExecuted((V) => {
2053
2053
  if (V.id === Rr.id) {
@@ -2059,7 +2059,7 @@ const Me = (t) => {
2059
2059
  return () => E.dispose();
2060
2060
  }, []);
2061
2061
  const R = (E) => {
2062
- p.current = E;
2062
+ f.current = E;
2063
2063
  }, w = (E) => {
2064
2064
  const V = E.split(",").filter((L) => !!L).map(Zr).map((L) => L.range);
2065
2065
  l.current = V;
@@ -2082,10 +2082,10 @@ const Me = (t) => {
2082
2082
  t.rule && t.rule.cfId ? (Y = { ...t.rule, ranges: V, rule: m }, r.executeCommand(Cr.id, { unitId: I, subUnitId: H, rule: Y }), t.onCancel()) : (Y = { cfId: i.createCfId(I, H), ranges: V, rule: m, stopIfTrue: !1 }, r.executeCommand(_n.id, { unitId: I, subUnitId: H, rule: Y }), t.onCancel());
2083
2083
  }
2084
2084
  }
2085
- }, g = () => {
2085
+ }, v = () => {
2086
2086
  t.onCancel();
2087
2087
  }, C = (E, V) => {
2088
- E ? V.length < 1 ? u(e.t("sheet.cf.errorMessage.rangeError")) : u(void 0) : u(e.t("sheet.cf.errorMessage.rangeError"));
2088
+ E ? V.length < 1 ? h(e.t("sheet.cf.errorMessage.rangeError")) : h(void 0) : h(e.t("sheet.cf.errorMessage.rangeError"));
2089
2089
  };
2090
2090
  return /* @__PURE__ */ k("div", { children: [
2091
2091
  /* @__PURE__ */ c(
@@ -2101,7 +2101,7 @@ const Me = (t) => {
2101
2101
  {
2102
2102
  unitId: o,
2103
2103
  subUnitId: d,
2104
- initialValue: h,
2104
+ initialValue: u,
2105
2105
  onChange: (E, V) => w(V),
2106
2106
  onVerify: C
2107
2107
  }
@@ -2119,8 +2119,8 @@ const Me = (t) => {
2119
2119
  le,
2120
2120
  {
2121
2121
  className: "univer-mt-4 univer-w-full",
2122
- value: f,
2123
- options: v,
2122
+ value: p,
2123
+ options: g,
2124
2124
  onChange: (E) => S(E)
2125
2125
  }
2126
2126
  ),
@@ -2133,7 +2133,7 @@ const Me = (t) => {
2133
2133
  }
2134
2134
  ),
2135
2135
  /* @__PURE__ */ k("div", { className: "univer-mt-4 univer-flex univer-justify-end", children: [
2136
- /* @__PURE__ */ c(Jt, { onClick: g, children: e.t("sheet.cf.panel.cancel") }),
2136
+ /* @__PURE__ */ c(Jt, { onClick: v, children: e.t("sheet.cf.panel.cancel") }),
2137
2137
  /* @__PURE__ */ c(Jt, { className: "univer-ml-3", variant: "primary", onClick: x, children: e.t("sheet.cf.panel.submit") })
2138
2138
  ] })
2139
2139
  ] });
@@ -2165,15 +2165,15 @@ let De = class extends ce {
2165
2165
  const n = this._localeService.getLocales(), i = e.split("."), s = n && this._localeService.resolveKeyPath(n, i);
2166
2166
  if (typeof s == "string") {
2167
2167
  const o = [];
2168
- return this._findReplaceIndex(s).forEach((d, a, u) => {
2169
- const l = u[a - 1] || { endIndex: -1 };
2168
+ return this._findReplaceIndex(s).forEach((d, a, h) => {
2169
+ const l = h[a - 1] || { endIndex: -1 };
2170
2170
  if (l.endIndex + 1 < d.startIndex) {
2171
- const h = s.slice(l.endIndex + 1, d.startIndex);
2172
- h && o.push(h);
2171
+ const u = s.slice(l.endIndex + 1, d.startIndex);
2172
+ u && o.push(u);
2173
2173
  }
2174
- if (r[d.key] && o.push(r[d.key]), a === u.length - 1) {
2175
- const h = s.slice(d.endIndex + 1);
2176
- h && o.push(h);
2174
+ if (r[d.key] && o.push(r[d.key]), a === h.length - 1) {
2175
+ const u = s.slice(d.endIndex + 1);
2176
+ u && o.push(u);
2177
2177
  }
2178
2178
  }), o;
2179
2179
  }
@@ -2223,14 +2223,14 @@ const Ni = (t, e) => {
2223
2223
  };
2224
2224
  let dn = 0;
2225
2225
  const Mi = (t) => {
2226
- const { onClick: e } = t, r = W(Q), n = W(z), i = W($e), s = W(te), o = W(re), d = W(ve), a = W(Fn), u = W(De), l = Dr(() => n.getCurrentTypeOfUnit$($.UNIVER_SHEET), void 0, void 0, []), h = l.getUnitId(), v = l.getActiveSheet();
2227
- if (!v)
2226
+ const { onClick: e } = t, r = W(Q), n = W(z), i = W($e), s = W(te), o = W(re), d = W(ve), a = W(Fn), h = W(De), l = Dr(() => n.getCurrentTypeOfUnit$($.UNIVER_SHEET), void 0, void 0, []), u = l.getUnitId(), g = l.getActiveSheet();
2227
+ if (!g)
2228
2228
  throw new Error("No active sheet found");
2229
- const f = v.getSheetId(), [S, p] = N([]), [T, _] = N("2"), [R, w] = N(0), [x, g] = N(-1), [C, b] = N(dn), y = de(null), M = [
2229
+ const p = g.getSheetId(), [S, f] = N([]), [T, _] = N("2"), [R, w] = N(0), [x, v] = N(-1), [C, b] = N(dn), y = de(null), M = [
2230
2230
  { label: o.t("sheet.cf.panel.workSheet"), value: "2" },
2231
2231
  { label: o.t("sheet.cf.panel.selectedRange"), value: "1" }
2232
2232
  ], E = () => {
2233
- const D = r.getSubunitRules(h, f);
2233
+ const D = r.getSubunitRules(u, p);
2234
2234
  if (!D || !D.length)
2235
2235
  return [];
2236
2236
  if (T === "1") {
@@ -2250,7 +2250,7 @@ const Mi = (t) => {
2250
2250
  return () => D.dispose();
2251
2251
  }), K(() => {
2252
2252
  L(E);
2253
- }, [T, R, h, f]), K(() => {
2253
+ }, [T, R, u, p]), K(() => {
2254
2254
  if (T === "2")
2255
2255
  return;
2256
2256
  const D = new xe((B) => {
@@ -2265,7 +2265,7 @@ const Mi = (t) => {
2265
2265
  return () => {
2266
2266
  D.unsubscribe();
2267
2267
  };
2268
- }, [n, T, h, f]), K(() => {
2268
+ }, [n, T, u, p]), K(() => {
2269
2269
  const D = r.$ruleChange.subscribe(() => {
2270
2270
  w(Math.random());
2271
2271
  });
@@ -2304,10 +2304,10 @@ const Mi = (t) => {
2304
2304
  throw new Error("No active sheet found");
2305
2305
  s.executeCommand(Kt.id, { unitId: B, subUnitId: G, cfId: D.cfId });
2306
2306
  }, I = (D, B) => {
2307
- g(B.y);
2307
+ v(B.y);
2308
2308
  }, H = (D, B, G) => {
2309
2309
  var lt;
2310
- g(-1);
2310
+ v(-1);
2311
2311
  const Z = n.getCurrentUnitOfType($.UNIVER_SHEET).getUnitId(), ee = (lt = n.getCurrentUnitOfType($.UNIVER_SHEET).getActiveSheet()) == null ? void 0 : lt.getSheetId();
2312
2312
  if (!Z || !ee)
2313
2313
  throw new Error("No active sheet found");
@@ -2319,7 +2319,7 @@ const Mi = (t) => {
2319
2319
  }, Y = () => {
2320
2320
  t.onCreate();
2321
2321
  }, ge = () => {
2322
- T === "2" ? s.executeCommand(Rn.id) : T === "1" && V.map((B) => ({ unitId: h, subUnitId: f, cfId: B.cfId })).forEach((B) => {
2322
+ T === "2" ? s.executeCommand(Rn.id) : T === "1" && V.map((B) => ({ unitId: u, subUnitId: p, cfId: B.cfId })).forEach((B) => {
2323
2323
  s.executeCommand(Kt.id, B);
2324
2324
  });
2325
2325
  }, me = J(() => {
@@ -2337,7 +2337,7 @@ const Mi = (t) => {
2337
2337
  }, [V]);
2338
2338
  return /* @__PURE__ */ k("div", { children: [
2339
2339
  /* @__PURE__ */ k("div", { className: "univer-flex univer-items-center univer-justify-between univer-gap-2 univer-text-sm", children: [
2340
- /* @__PURE__ */ c("div", { className: "univer-flex univer-items-center univer-gap-2", children: u.tWithReactNode(
2340
+ /* @__PURE__ */ c("div", { className: "univer-flex univer-items-center univer-gap-2", children: h.tWithReactNode(
2341
2341
  "sheet.cf.panel.managerRuleSelect",
2342
2342
  /* @__PURE__ */ c(
2343
2343
  le,
@@ -2389,9 +2389,9 @@ const Mi = (t) => {
2389
2389
  "univer-bg-gray-100 dark:!univer-bg-gray-700": x === B
2390
2390
  }),
2391
2391
  onMouseMove: () => {
2392
- D.ranges !== S && p(D.ranges);
2392
+ D.ranges !== S && f(D.ranges);
2393
2393
  },
2394
- onMouseLeave: () => p([]),
2394
+ onMouseLeave: () => f([]),
2395
2395
  onClick: () => {
2396
2396
  e(D);
2397
2397
  },
@@ -2428,7 +2428,7 @@ const Mi = (t) => {
2428
2428
  "univer-flex univer-items-center univer-justify-center": x === B
2429
2429
  }),
2430
2430
  onClick: (G) => {
2431
- G.stopPropagation(), m(D), p([]);
2431
+ G.stopPropagation(), m(D), f([]);
2432
2432
  },
2433
2433
  children: /* @__PURE__ */ c(gt, {})
2434
2434
  }
@@ -2626,15 +2626,15 @@ let et = class extends ce {
2626
2626
  const o = this._injector.invoke((l) => Er(n, l, e, r));
2627
2627
  if (!o)
2628
2628
  return;
2629
- const { rows: d, cols: a } = o, u = /* @__PURE__ */ new Set();
2630
- d.forEach((l, h) => {
2631
- a.forEach((v, f) => {
2632
- const S = this._conditionalFormattingViewModel.getCellCfs(e, r, l, v);
2633
- S && (S.forEach((p) => u.add(p.cfId)), i.setValue(h, f, S.map((p) => p.cfId)));
2629
+ const { rows: d, cols: a } = o, h = /* @__PURE__ */ new Set();
2630
+ d.forEach((l, u) => {
2631
+ a.forEach((g, p) => {
2632
+ const S = this._conditionalFormattingViewModel.getCellCfs(e, r, l, g);
2633
+ S && (S.forEach((f) => h.add(f.cfId)), i.setValue(u, p, S.map((f) => f.cfId)));
2634
2634
  });
2635
- }), u.forEach((l) => {
2636
- const h = this._conditionalFormattingRuleModel.getRule(e, r, l);
2637
- h && (s[l] = h.rule);
2635
+ }), h.forEach((l) => {
2636
+ const u = this._conditionalFormattingRuleModel.getRule(e, r, l);
2637
+ u && (s[l] = u.rule);
2638
2638
  });
2639
2639
  }
2640
2640
  // eslint-disable-next-line max-lines-per-function
@@ -2654,13 +2654,13 @@ let et = class extends ce {
2654
2654
  r.pasteType
2655
2655
  ))
2656
2656
  return { redos: [], undos: [] };
2657
- const { ranges: [a, u], mapFunc: l } = Pn([r.copyRange, e]), h = Jr(a, u, !0), v = {};
2658
- pe.foreach(u, (g, C) => {
2659
- const { row: b, col: y } = l(g, C), M = this._conditionalFormattingViewModel.getCellCfs(s, o, b, y);
2657
+ const { ranges: [a, h], mapFunc: l } = Pn([r.copyRange, e]), u = Jr(a, h, !0), g = {};
2658
+ pe.foreach(h, (v, C) => {
2659
+ const { row: b, col: y } = l(v, C), M = this._conditionalFormattingViewModel.getCellCfs(s, o, b, y);
2660
2660
  M && M.forEach((E) => {
2661
- if (!v[E.cfId]) {
2661
+ if (!g[E.cfId]) {
2662
2662
  const V = new we();
2663
- v[E.cfId] = V;
2663
+ g[E.cfId] = V;
2664
2664
  const L = this._conditionalFormattingRuleModel.getRule(s, o, E.cfId);
2665
2665
  L == null || L.ranges.forEach((m) => {
2666
2666
  pe.foreach(m, (I, H) => {
@@ -2668,17 +2668,17 @@ let et = class extends ce {
2668
2668
  });
2669
2669
  });
2670
2670
  }
2671
- v[E.cfId].realDeleteValue(b, y);
2671
+ g[E.cfId].realDeleteValue(b, y);
2672
2672
  });
2673
2673
  });
2674
- const { matrix: f, info: S } = this._copyInfo, p = [];
2674
+ const { matrix: p, info: S } = this._copyInfo, f = [];
2675
2675
  let T = this._conditionalFormattingRuleModel.createCfId(s, o);
2676
- const _ = {}, R = (g) => {
2677
- if (_[g])
2678
- return _[g];
2679
- const C = S == null ? void 0 : S.cfMap[g], b = [...this._conditionalFormattingRuleModel.getSubunitRules(s, o) || [], ...p].find((y) => Wt.diffValue(y.rule, C));
2676
+ const _ = {}, R = (v) => {
2677
+ if (_[v])
2678
+ return _[v];
2679
+ const C = S == null ? void 0 : S.cfMap[v], b = [...this._conditionalFormattingRuleModel.getSubunitRules(s, o) || [], ...f].find((y) => Wt.diffValue(y.rule, C));
2680
2680
  if (b)
2681
- return _[g] = b, b;
2681
+ return _[v] = b, b;
2682
2682
  {
2683
2683
  const y = {
2684
2684
  rule: C,
@@ -2686,11 +2686,11 @@ let et = class extends ce {
2686
2686
  ranges: [],
2687
2687
  stopIfTrue: !1
2688
2688
  };
2689
- return _[g] = y, p.push(y), T = `${Number(T) + 1}`, y;
2689
+ return _[v] = y, f.push(y), T = `${Number(T) + 1}`, y;
2690
2690
  }
2691
2691
  };
2692
- h.forEach((g) => {
2693
- f && f.forValue((C, b, y) => {
2692
+ u.forEach((v) => {
2693
+ p && p.forValue((C, b, y) => {
2694
2694
  const M = fe.getPositionRange(
2695
2695
  {
2696
2696
  startRow: C,
@@ -2698,41 +2698,41 @@ let et = class extends ce {
2698
2698
  startColumn: b,
2699
2699
  endColumn: b
2700
2700
  },
2701
- g.startRange
2701
+ v.startRange
2702
2702
  ), { row: E, col: V } = l(M.startRow, M.startColumn);
2703
2703
  y.forEach((L) => {
2704
- if (!v[L]) {
2704
+ if (!g[L]) {
2705
2705
  const m = R(L), I = new we();
2706
- v[L] = I, m.ranges.forEach((H) => {
2706
+ g[L] = I, m.ranges.forEach((H) => {
2707
2707
  pe.foreach(H, (Y, ge) => {
2708
2708
  I.setValue(Y, ge, 1);
2709
2709
  });
2710
2710
  });
2711
2711
  }
2712
- v[L].setValue(E, V, 1);
2712
+ g[L].setValue(E, V, 1);
2713
2713
  });
2714
2714
  });
2715
2715
  });
2716
2716
  const w = [], x = [];
2717
- for (const g in v) {
2718
- const C = v[g], b = pt(Ct(C));
2717
+ for (const v in g) {
2718
+ const C = g[v], b = pt(Ct(C));
2719
2719
  if (!b.length) {
2720
2720
  const y = {
2721
2721
  unitId: s,
2722
2722
  subUnitId: o,
2723
- cfId: g
2723
+ cfId: v
2724
2724
  };
2725
2725
  w.push({ id: Se.id, params: y }), x.push(...Le(this._injector, y));
2726
2726
  }
2727
- if (p.some((y) => y.cfId === g)) {
2728
- const y = R(g), M = {
2727
+ if (f.some((y) => y.cfId === v)) {
2728
+ const y = R(v), M = {
2729
2729
  unitId: s,
2730
2730
  subUnitId: o,
2731
2731
  rule: { ...y, ranges: b }
2732
2732
  };
2733
2733
  w.push({ id: se.id, params: M }), x.push(xn(this._injector, M));
2734
2734
  } else {
2735
- const y = this._conditionalFormattingRuleModel.getRule(s, o, g);
2735
+ const y = this._conditionalFormattingRuleModel.getRule(s, o, v);
2736
2736
  if (!y)
2737
2737
  continue;
2738
2738
  const M = {
@@ -2794,20 +2794,20 @@ let nt = class extends ce {
2794
2794
  _initRefRange() {
2795
2795
  const t = /* @__PURE__ */ new Map(), e = (n, i, s) => `${n}_${i}_${s}`, r = (n, i, s) => {
2796
2796
  const o = (a) => {
2797
- const u = [...s.ranges], l = u.map((v) => Vr(v, a)).filter((v) => !!v);
2798
- if (Sr(l, u))
2797
+ const h = [...s.ranges], l = h.map((g) => Vr(g, a)).filter((g) => !!g);
2798
+ if (Sr(l, h))
2799
2799
  return { redos: [], undos: [] };
2800
2800
  if (l.length) {
2801
- const v = { unitId: n, subUnitId: i, rule: { ...s, ranges: l } }, f = [{ id: be.id, params: v }], S = Ae(this._injector, v);
2802
- return { redos: f, undos: S };
2801
+ const g = { unitId: n, subUnitId: i, rule: { ...s, ranges: l } }, p = [{ id: be.id, params: g }], S = Ae(this._injector, g);
2802
+ return { redos: p, undos: S };
2803
2803
  } else {
2804
- const v = { unitId: n, subUnitId: i, cfId: s.cfId }, f = [{ id: Se.id, params: v }], S = Le(this._injector, v);
2805
- return { redos: f, undos: S };
2804
+ const g = { unitId: n, subUnitId: i, cfId: s.cfId }, p = [{ id: Se.id, params: g }], S = Le(this._injector, g);
2805
+ return { redos: p, undos: S };
2806
2806
  }
2807
2807
  }, d = [];
2808
2808
  s.ranges.forEach((a) => {
2809
- const u = this._refRangeService.registerRefRange(a, o);
2810
- d.push(() => u.dispose());
2809
+ const h = this._refRangeService.registerRefRange(a, o);
2810
+ d.push(() => h.dispose());
2811
2811
  }), t.set(e(n, i, s.cfId), () => d.forEach((a) => a()));
2812
2812
  };
2813
2813
  this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.subscribe((n) => {
@@ -2819,13 +2819,13 @@ let nt = class extends ce {
2819
2819
  break;
2820
2820
  }
2821
2821
  case "delete": {
2822
- const u = t.get(e(i, s, o.cfId));
2823
- u && u();
2822
+ const h = t.get(e(i, s, o.cfId));
2823
+ h && h();
2824
2824
  break;
2825
2825
  }
2826
2826
  case "set": {
2827
- const u = t.get(e(i, s, o.cfId));
2828
- u && u(), r(n.unitId, n.subUnitId, n.rule);
2827
+ const h = t.get(e(i, s, o.cfId));
2828
+ h && h(), r(n.unitId, n.subUnitId, n.rule);
2829
2829
  }
2830
2830
  }
2831
2831
  })), this.disposeWithMe(Cn(() => {
@@ -2950,53 +2950,53 @@ let It = class extends ce {
2950
2950
  // eslint-disable-next-line max-lines-per-function
2951
2951
  _initAutoFill() {
2952
2952
  const t = () => ({ redos: [], undos: [] }), e = (i, s, o, d, a) => {
2953
- var f;
2954
- const u = this._univerInstanceService.getCurrentUnitForType($.UNIVER_SHEET).getUnitId(), l = (f = this._univerInstanceService.getCurrentUnitForType($.UNIVER_SHEET).getActiveSheet()) == null ? void 0 : f.getSheetId();
2955
- if (!u || !l)
2953
+ var p;
2954
+ const h = this._univerInstanceService.getCurrentUnitForType($.UNIVER_SHEET).getUnitId(), l = (p = this._univerInstanceService.getCurrentUnitForType($.UNIVER_SHEET).getActiveSheet()) == null ? void 0 : p.getSheetId();
2955
+ if (!h || !l)
2956
2956
  return;
2957
- const h = {
2957
+ const u = {
2958
2958
  startRow: i.row,
2959
2959
  startColumn: i.col,
2960
2960
  endColumn: i.col,
2961
2961
  endRow: i.row
2962
- }, v = {
2962
+ }, g = {
2963
2963
  startRow: s.row,
2964
2964
  startColumn: s.col,
2965
2965
  endColumn: s.col,
2966
2966
  endRow: s.row
2967
2967
  };
2968
- pe.foreach(o, (S, p) => {
2968
+ pe.foreach(o, (S, f) => {
2969
2969
  const T = fe.getPositionRange(
2970
2970
  {
2971
2971
  startRow: S,
2972
- startColumn: p,
2973
- endColumn: p,
2972
+ startColumn: f,
2973
+ endColumn: f,
2974
2974
  endRow: S
2975
2975
  },
2976
- h
2976
+ u
2977
2977
  ), _ = fe.getPositionRange(
2978
2978
  {
2979
2979
  startRow: S,
2980
- startColumn: p,
2981
- endColumn: p,
2980
+ startColumn: f,
2981
+ endColumn: f,
2982
2982
  endRow: S
2983
2983
  },
2984
- v
2984
+ g
2985
2985
  ), { row: R, col: w } = a(T.startRow, T.startColumn), x = this._conditionalFormattingViewModel.getCellCfs(
2986
- u,
2986
+ h,
2987
2987
  l,
2988
2988
  R,
2989
2989
  w
2990
- ), { row: g, col: C } = a(_.startRow, _.startColumn), b = this._conditionalFormattingViewModel.getCellCfs(
2991
- u,
2990
+ ), { row: v, col: C } = a(_.startRow, _.startColumn), b = this._conditionalFormattingViewModel.getCellCfs(
2991
+ h,
2992
2992
  l,
2993
- g,
2993
+ v,
2994
2994
  C
2995
2995
  );
2996
2996
  b && b.forEach((y) => {
2997
2997
  let M = d.get(y.cfId);
2998
2998
  if (!d.get(y.cfId)) {
2999
- const E = this._conditionalFormattingRuleModel.getRule(u, l, y.cfId);
2999
+ const E = this._conditionalFormattingRuleModel.getRule(h, l, y.cfId);
3000
3000
  if (!E)
3001
3001
  return;
3002
3002
  M = new we(), E.ranges.forEach((V) => {
@@ -3005,11 +3005,11 @@ let It = class extends ce {
3005
3005
  });
3006
3006
  }), d.set(y.cfId, M);
3007
3007
  }
3008
- M.realDeleteValue(g, C);
3008
+ M.realDeleteValue(v, C);
3009
3009
  }), x && x.forEach((y) => {
3010
3010
  let M = d.get(y.cfId);
3011
3011
  if (!d.get(y.cfId)) {
3012
- const E = this._conditionalFormattingRuleModel.getRule(u, l, y.cfId);
3012
+ const E = this._conditionalFormattingRuleModel.getRule(h, l, y.cfId);
3013
3013
  if (!E)
3014
3014
  return;
3015
3015
  M = new we(), E.ranges.forEach((V) => {
@@ -3018,22 +3018,22 @@ let It = class extends ce {
3018
3018
  });
3019
3019
  }), d.set(y.cfId, M);
3020
3020
  }
3021
- M.setValue(g, C, 1);
3021
+ M.setValue(v, C, 1);
3022
3022
  });
3023
3023
  });
3024
3024
  }, r = (i, s) => {
3025
3025
  var _, R, w;
3026
- const o = (_ = this._univerInstanceService.getCurrentUnitForType($.UNIVER_SHEET)) == null ? void 0 : _.getUnitId(), d = (w = (R = this._univerInstanceService.getCurrentUnitForType($.UNIVER_SHEET)) == null ? void 0 : R.getActiveSheet()) == null ? void 0 : w.getSheetId(), a = /* @__PURE__ */ new Map(), u = [], l = [];
3026
+ const o = (_ = this._univerInstanceService.getCurrentUnitForType($.UNIVER_SHEET)) == null ? void 0 : _.getUnitId(), d = (w = (R = this._univerInstanceService.getCurrentUnitForType($.UNIVER_SHEET)) == null ? void 0 : R.getActiveSheet()) == null ? void 0 : w.getSheetId(), a = /* @__PURE__ */ new Map(), h = [], l = [];
3027
3027
  if (!o || !d)
3028
3028
  return t();
3029
- const h = Pn([i, s]), [v, f] = h.ranges, { mapFunc: S } = h, p = {
3030
- row: v.startRow,
3031
- col: v.startColumn
3029
+ const u = Pn([i, s]), [g, p] = u.ranges, { mapFunc: S } = u, f = {
3030
+ row: g.startRow,
3031
+ col: g.startColumn
3032
3032
  };
3033
- return ei(v, f).forEach((x) => {
3034
- e(p, x.repeatStartCell, x.relativeRange, a, S);
3035
- }), a.forEach((x, g) => {
3036
- const C = this._conditionalFormattingRuleModel.getRule(o, d, g);
3033
+ return ei(g, p).forEach((x) => {
3034
+ e(f, x.repeatStartCell, x.relativeRange, a, S);
3035
+ }), a.forEach((x, v) => {
3036
+ const C = this._conditionalFormattingRuleModel.getRule(o, d, v);
3037
3037
  if (!C)
3038
3038
  return;
3039
3039
  const b = pt(Ct(x));
@@ -3043,18 +3043,18 @@ let It = class extends ce {
3043
3043
  subUnitId: d,
3044
3044
  rule: { ...C, ranges: b }
3045
3045
  };
3046
- u.push({ id: be.id, params: y }), l.push(...Ae(this._injector, y));
3046
+ h.push({ id: be.id, params: y }), l.push(...Ae(this._injector, y));
3047
3047
  } else {
3048
3048
  const y = {
3049
3049
  unitId: o,
3050
3050
  subUnitId: d,
3051
3051
  cfId: C.cfId
3052
3052
  };
3053
- u.push({ id: Se.id, params: y }), l.push(...Le(this._injector, y));
3053
+ h.push({ id: Se.id, params: y }), l.push(...Le(this._injector, y));
3054
3054
  }
3055
3055
  }), {
3056
3056
  undos: l,
3057
- redos: u
3057
+ redos: h
3058
3058
  };
3059
3059
  }, n = {
3060
3060
  id: st,
@@ -3091,17 +3091,17 @@ let _t = class extends ce {
3091
3091
  var i;
3092
3092
  const e = [], r = [], n = { redos: e, undos: r };
3093
3093
  if ([Fr.id, Ur.id].includes(t.id)) {
3094
- const s = (i = this._selectionManagerService.getCurrentSelections()) == null ? void 0 : i.map((f) => f.range);
3094
+ const s = (i = this._selectionManagerService.getCurrentSelections()) == null ? void 0 : i.map((p) => p.range);
3095
3095
  if (!s)
3096
3096
  return n;
3097
3097
  const o = this._univerInstanceService.getCurrentUnitForType($.UNIVER_SHEET), d = o.getActiveSheet();
3098
3098
  if (!d)
3099
3099
  return n;
3100
- const a = o.getUnitId(), u = d.getSheetId(), l = this._conditionalFormattingRuleModel.getSubunitRules(a, u);
3100
+ const a = o.getUnitId(), h = d.getSheetId(), l = this._conditionalFormattingRuleModel.getSubunitRules(a, h);
3101
3101
  if (!l || !l.length)
3102
3102
  return n;
3103
- const { redos: h, undos: v } = hn(this._injector, l, s, a, u);
3104
- e.push(...h), r.push(...v);
3103
+ const { redos: u, undos: g } = hn(this._injector, l, s, a, h);
3104
+ e.push(...u), r.push(...g);
3105
3105
  }
3106
3106
  return n;
3107
3107
  }
@@ -3128,18 +3128,18 @@ _t = Yi([
3128
3128
  ], _t);
3129
3129
  function hn(t, e, r, n, i) {
3130
3130
  const s = [], o = [];
3131
- return e.filter((d) => r.some((a) => d.ranges.some((u) => fe.getIntersects(u, a)))).forEach((d) => {
3132
- const u = new Pr().add(...d.ranges).subtract(...r).merge();
3133
- if (u.length) {
3131
+ return e.filter((d) => r.some((a) => d.ranges.some((h) => fe.getIntersects(h, a)))).forEach((d) => {
3132
+ const h = new Pr().add(...d.ranges).subtract(...r).merge();
3133
+ if (h.length) {
3134
3134
  const l = {
3135
3135
  id: be.id,
3136
3136
  params: {
3137
3137
  unitId: n,
3138
3138
  subUnitId: i,
3139
- rule: { ...d, ranges: u }
3139
+ rule: { ...d, ranges: h }
3140
3140
  }
3141
- }, h = Ae(t, l.params);
3142
- s.push(l), o.push(...h);
3141
+ }, u = Ae(t, l.params);
3142
+ s.push(l), o.push(...u);
3143
3143
  } else {
3144
3144
  const l = {
3145
3145
  id: Se.id,
@@ -3148,8 +3148,8 @@ function hn(t, e, r, n, i) {
3148
3148
  subUnitId: i,
3149
3149
  cfId: d.cfId
3150
3150
  }
3151
- }, h = Le(t, l.params);
3152
- s.push(l), o.push(...h);
3151
+ }, u = Le(t, l.params);
3152
+ s.push(l), o.push(...u);
3153
3153
  }
3154
3154
  }), { redos: s, undos: o };
3155
3155
  }
@@ -3178,18 +3178,18 @@ let Tt = class extends ce {
3178
3178
  t || r(t);
3179
3179
  const n = this._conditionalFormattingService.composeStyle(e.unitId, e.subUnitId, e.row, e.col), i = (o = n == null ? void 0 : n.style) != null ? o : {}, s = Object.keys(i);
3180
3180
  if (t != null && t.p)
3181
- return (a = (d = t.p.body) == null ? void 0 : d.textRuns) == null || a.forEach((u) => {
3182
- u.ts && s.forEach((l) => {
3183
- var h;
3184
- (h = u.ts) == null || delete h[l];
3181
+ return (a = (d = t.p.body) == null ? void 0 : d.textRuns) == null || a.forEach((h) => {
3182
+ h.ts && s.forEach((l) => {
3183
+ var u;
3184
+ (u = h.ts) == null || delete u[l];
3185
3185
  });
3186
3186
  }), r(t);
3187
3187
  {
3188
- const u = { ...(typeof (t == null ? void 0 : t.s) == "string" ? e.workbook.getStyles().get(t.s) : t == null ? void 0 : t.s) || {} };
3189
- s.forEach((h) => {
3190
- delete u[h];
3188
+ const h = { ...(typeof (t == null ? void 0 : t.s) == "string" ? e.workbook.getStyles().get(t.s) : t == null ? void 0 : t.s) || {} };
3189
+ s.forEach((u) => {
3190
+ delete h[u];
3191
3191
  });
3192
- const l = { ...t, s: { ...u } };
3192
+ const l = { ...t, s: { ...h } };
3193
3193
  return r(l);
3194
3194
  }
3195
3195
  }
@@ -3285,48 +3285,48 @@ const gn = [
3285
3285
  const e = t.get($e), r = t.get(te), n = t.get(z), i = t.get(Q), s = new xe((a) => Ln(
3286
3286
  e.selectionMoveEnd$,
3287
3287
  e.selectionSet$,
3288
- new xe((u) => {
3289
- const l = r.onCommandExecuted((h) => {
3290
- var p;
3291
- const { id: v, params: f } = h, S = (p = n.getCurrentUnitForType($.UNIVER_SHEET)) == null ? void 0 : p.getUnitId();
3292
- gn.includes(v) && f.unitId === S && u.next(null);
3288
+ new xe((h) => {
3289
+ const l = r.onCommandExecuted((u) => {
3290
+ var f;
3291
+ const { id: g, params: p } = u, S = (f = n.getCurrentUnitForType($.UNIVER_SHEET)) == null ? void 0 : f.getUnitId();
3292
+ gn.includes(g) && p.unitId === S && h.next(null);
3293
3293
  });
3294
3294
  return () => l.dispose();
3295
3295
  })
3296
3296
  ).pipe(rn(16)).subscribe(() => {
3297
- var p;
3298
- const u = ((p = e.getCurrentSelections()) == null ? void 0 : p.map((T) => T.range)) || [], l = n.getCurrentUnitForType($.UNIVER_SHEET);
3297
+ var f;
3298
+ const h = ((f = e.getCurrentSelections()) == null ? void 0 : f.map((T) => T.range)) || [], l = n.getCurrentUnitForType($.UNIVER_SHEET);
3299
3299
  if (!l) return;
3300
- const h = l.getActiveSheet();
3301
- if (!h) return;
3302
- const S = (i.getSubunitRules(l.getUnitId(), h.getSheetId()) || []).filter((T) => T.ranges.some((_) => u.some((R) => fe.intersects(R, _)))).map((T) => T.ranges).every((T) => ft(t, l.getUnitId(), h.getSheetId(), T));
3300
+ const u = l.getActiveSheet();
3301
+ if (!u) return;
3302
+ const S = (i.getSubunitRules(l.getUnitId(), u.getSheetId()) || []).filter((T) => T.ranges.some((_) => h.some((R) => fe.intersects(R, _)))).map((T) => T.ranges).every((T) => ft(t, l.getUnitId(), u.getSheetId(), T));
3303
3303
  a.next(S);
3304
3304
  })), o = new xe(
3305
- (a) => new xe((u) => {
3306
- const l = r.onCommandExecuted((h) => {
3307
- var p;
3308
- const { id: v, params: f } = h, S = (p = n.getCurrentUnitForType($.UNIVER_SHEET)) == null ? void 0 : p.getUnitId();
3309
- gn.includes(v) && f.unitId === S && u.next(null);
3305
+ (a) => new xe((h) => {
3306
+ const l = r.onCommandExecuted((u) => {
3307
+ var f;
3308
+ const { id: g, params: p } = u, S = (f = n.getCurrentUnitForType($.UNIVER_SHEET)) == null ? void 0 : f.getUnitId();
3309
+ gn.includes(g) && p.unitId === S && h.next(null);
3310
3310
  });
3311
3311
  return () => l.dispose();
3312
3312
  }).pipe(rn(16)).subscribe(() => {
3313
- const u = n.getCurrentUnitForType($.UNIVER_SHEET);
3314
- if (!u) return;
3315
- const l = u.getActiveSheet();
3313
+ const h = n.getCurrentUnitForType($.UNIVER_SHEET);
3314
+ if (!h) return;
3315
+ const l = h.getActiveSheet();
3316
3316
  if (!l) return;
3317
- const h = i.getSubunitRules(u.getUnitId(), l.getSheetId()) || [];
3318
- if (!h.length)
3317
+ const u = i.getSubunitRules(h.getUnitId(), l.getSheetId()) || [];
3318
+ if (!u.length)
3319
3319
  return a.next(!1), !1;
3320
- const v = h.map((f) => f.ranges).every((f) => ft(t, u.getUnitId(), l.getSheetId(), f));
3321
- a.next(v);
3320
+ const g = u.map((p) => p.ranges).every((p) => ft(t, h.getUnitId(), l.getSheetId(), p));
3321
+ a.next(g);
3322
3322
  })
3323
3323
  ), d = new xe((a) => {
3324
- s.subscribe((u) => {
3325
- const l = Ye.find((h) => h.value === ie.clearRangeRules);
3326
- l && (l.disabled = !u, a.next(Ye));
3327
- }), o.subscribe((u) => {
3328
- const l = Ye.find((h) => h.value === ie.clearWorkSheetRules);
3329
- l && (l.disabled = !u, a.next(Ye));
3324
+ s.subscribe((h) => {
3325
+ const l = Ye.find((u) => u.value === ie.clearRangeRules);
3326
+ l && (l.disabled = !h, a.next(Ye));
3327
+ }), o.subscribe((h) => {
3328
+ const l = Ye.find((u) => u.value === ie.clearWorkSheetRules);
3329
+ l && (l.disabled = !h, a.next(Ye));
3330
3330
  }), a.next(Ye);
3331
3331
  });
3332
3332
  return {
@@ -3368,7 +3368,7 @@ var ns = Object.getOwnPropertyDescriptor, rs = (t, e, r, n) => {
3368
3368
  return i;
3369
3369
  }, Oe = (t, e) => (r, n) => e(r, n, t);
3370
3370
  const is = (t, e) => {
3371
- const r = (l) => l.endRow - l.startRow + 1, n = (l) => l.endColumn - l.startColumn + 1, i = r(e) % r(t), s = n(e) % n(t), o = Math.floor(r(e) / r(t)), d = Math.floor(n(e) / n(t)), a = [], u = {
3371
+ const r = (l) => l.endRow - l.startRow + 1, n = (l) => l.endColumn - l.startColumn + 1, i = r(e) % r(t), s = n(e) % n(t), o = Math.floor(r(e) / r(t)), d = Math.floor(n(e) / n(t)), a = [], h = {
3372
3372
  startRow: 0,
3373
3373
  endRow: r(t) - 1,
3374
3374
  startColumn: 0,
@@ -3381,18 +3381,18 @@ const is = (t, e) => {
3381
3381
  startColumn: e.startColumn,
3382
3382
  endColumn: e.startColumn
3383
3383
  };
3384
- return a.push({ repeatRelativeRange: u, startRange: l }), a;
3384
+ return a.push({ repeatRelativeRange: h, startRange: l }), a;
3385
3385
  }
3386
3386
  for (let l = 0; l < o + (i ? 0.1 : 0); l++)
3387
- for (let h = 0; h < d + (s ? 0.1 : 0); h++) {
3388
- const v = r(t) * l, f = n(t) * h, S = {
3389
- startRow: v + e.startRow,
3390
- endRow: v + e.startRow,
3391
- startColumn: f + e.startColumn,
3392
- endColumn: f + e.startColumn
3387
+ for (let u = 0; u < d + (s ? 0.1 : 0); u++) {
3388
+ const g = r(t) * l, p = n(t) * u, S = {
3389
+ startRow: g + e.startRow,
3390
+ endRow: g + e.startRow,
3391
+ startColumn: p + e.startColumn,
3392
+ endColumn: p + e.startColumn
3393
3393
  };
3394
- let p = u;
3395
- l === o && i && (p = { ...p }, p.endRow = p.endRow - (r(t) - i)), h === d && s && (p = { ...p }, p.endColumn = p.endColumn - (n(t) - s)), a.push({ repeatRelativeRange: p, startRange: S });
3394
+ let f = h;
3395
+ l === o && i && (f = { ...f }, f.endRow = f.endRow - (r(t) - i)), u === d && s && (f = { ...f }, f.endColumn = f.endColumn - (n(t) - s)), a.push({ repeatRelativeRange: f, startRange: S });
3396
3396
  }
3397
3397
  return a;
3398
3398
  };
@@ -3404,13 +3404,13 @@ let xt = class extends ce {
3404
3404
  }
3405
3405
  // eslint-disable-next-line max-lines-per-function
3406
3406
  _initFormattingPainter() {
3407
- const e = () => ({ redos: [], undos: [] }), r = (s, o, d, a, u) => {
3408
- const { unitId: l, subUnitId: h } = this._painterConfig, { targetUnitId: v, targetSubUnitId: f } = u, S = {
3407
+ const e = () => ({ redos: [], undos: [] }), r = (s, o, d, a, h) => {
3408
+ const { unitId: l, subUnitId: u } = this._painterConfig, { targetUnitId: g, targetSubUnitId: p } = h, S = {
3409
3409
  startRow: s.row,
3410
3410
  startColumn: s.col,
3411
3411
  endColumn: s.col,
3412
3412
  endRow: s.row
3413
- }, p = {
3413
+ }, f = {
3414
3414
  startRow: o.row,
3415
3415
  startColumn: o.col,
3416
3416
  endColumn: o.col,
@@ -3432,22 +3432,22 @@ let xt = class extends ce {
3432
3432
  endColumn: _,
3433
3433
  endRow: T
3434
3434
  },
3435
- p
3435
+ f
3436
3436
  ), x = this._conditionalFormattingViewModel.getCellCfs(
3437
3437
  l,
3438
- h,
3438
+ u,
3439
3439
  R.startRow,
3440
3440
  R.startColumn
3441
- ), g = this._conditionalFormattingViewModel.getCellCfs(
3442
- v,
3443
- f,
3441
+ ), v = this._conditionalFormattingViewModel.getCellCfs(
3442
+ g,
3443
+ p,
3444
3444
  w.startRow,
3445
3445
  w.startColumn
3446
3446
  );
3447
- g && g.forEach((C) => {
3447
+ v && v.forEach((C) => {
3448
3448
  let b = a.get(C.cfId);
3449
3449
  if (!a.get(C.cfId)) {
3450
- const y = this._conditionalFormattingRuleModel.getRule(v, f, C.cfId);
3450
+ const y = this._conditionalFormattingRuleModel.getRule(g, p, C.cfId);
3451
3451
  if (!y)
3452
3452
  return;
3453
3453
  b = new we(), y.ranges.forEach((M) => {
@@ -3464,19 +3464,19 @@ let xt = class extends ce {
3464
3464
  });
3465
3465
  }, n = (s, o, d) => {
3466
3466
  var R;
3467
- const { range: a, unitId: u, subUnitId: l } = this._painterConfig, h = s !== u || l !== o, v = /* @__PURE__ */ new Map(), f = [], S = [];
3468
- if (!s || !o || !u || !l)
3467
+ const { range: a, unitId: h, subUnitId: l } = this._painterConfig, u = s !== h || l !== o, g = /* @__PURE__ */ new Map(), p = [], S = [];
3468
+ if (!s || !o || !h || !l)
3469
3469
  return e();
3470
- const p = (R = this._conditionalFormattingRuleModel.getSubunitRules(u, l)) != null ? R : [];
3471
- p == null || p.forEach((w) => {
3472
- const { ranges: x, cfId: g } = w;
3470
+ const f = (R = this._conditionalFormattingRuleModel.getSubunitRules(h, l)) != null ? R : [];
3471
+ f == null || f.forEach((w) => {
3472
+ const { ranges: x, cfId: v } = w;
3473
3473
  if (x.some((C) => fe.intersects(a, C))) {
3474
3474
  const C = new we();
3475
- h || x.forEach((b) => {
3475
+ u || x.forEach((b) => {
3476
3476
  pe.foreach(b, (y, M) => {
3477
3477
  C.setValue(y, M, 1);
3478
3478
  });
3479
- }), v.set(g, C);
3479
+ }), g.set(v, C);
3480
3480
  }
3481
3481
  });
3482
3482
  const T = {
@@ -3484,28 +3484,28 @@ let xt = class extends ce {
3484
3484
  col: a.startColumn
3485
3485
  };
3486
3486
  return is(a, d).forEach((w) => {
3487
- r(T, { row: w.startRange.startRow, col: w.startRange.startColumn }, w.repeatRelativeRange, v, { targetUnitId: s, targetSubUnitId: o });
3488
- }), v.forEach((w, x) => {
3489
- if (h) {
3490
- const g = this._conditionalFormattingRuleModel.getRule(s, o, x), C = pt(Ct(w));
3491
- if (g)
3487
+ r(T, { row: w.startRange.startRow, col: w.startRange.startColumn }, w.repeatRelativeRange, g, { targetUnitId: s, targetSubUnitId: o });
3488
+ }), g.forEach((w, x) => {
3489
+ if (u) {
3490
+ const v = this._conditionalFormattingRuleModel.getRule(s, o, x), C = pt(Ct(w));
3491
+ if (v)
3492
3492
  if (C.length) {
3493
3493
  const b = {
3494
3494
  unitId: s,
3495
3495
  subUnitId: o,
3496
- rule: { ...g, ranges: C }
3496
+ rule: { ...v, ranges: C }
3497
3497
  };
3498
- f.push({ id: be.id, params: b }), S.push(...Ae(this._injector, b));
3498
+ p.push({ id: be.id, params: b }), S.push(...Ae(this._injector, b));
3499
3499
  } else {
3500
3500
  const b = {
3501
3501
  unitId: s,
3502
3502
  subUnitId: o,
3503
- cfId: g.cfId
3503
+ cfId: v.cfId
3504
3504
  };
3505
- f.push({ id: Se.id, params: b }), S.push(...Le(this._injector, b));
3505
+ p.push({ id: Se.id, params: b }), S.push(...Le(this._injector, b));
3506
3506
  }
3507
3507
  else if (C.length) {
3508
- const b = this._conditionalFormattingRuleModel.getRule(u, l, x);
3508
+ const b = this._conditionalFormattingRuleModel.getRule(h, l, x);
3509
3509
  if (b) {
3510
3510
  const y = {
3511
3511
  unitId: s,
@@ -3516,33 +3516,33 @@ let xt = class extends ce {
3516
3516
  ranges: C
3517
3517
  }
3518
3518
  };
3519
- f.push({ id: se.id, params: y }), S.push(xn(this._injector, y));
3519
+ p.push({ id: se.id, params: y }), S.push(xn(this._injector, y));
3520
3520
  }
3521
3521
  }
3522
3522
  } else {
3523
- const g = this._conditionalFormattingRuleModel.getRule(u, l, x);
3524
- if (!g)
3523
+ const v = this._conditionalFormattingRuleModel.getRule(h, l, x);
3524
+ if (!v)
3525
3525
  return;
3526
3526
  const C = pt(Ct(w));
3527
3527
  if (C.length) {
3528
3528
  const b = {
3529
- unitId: u,
3529
+ unitId: h,
3530
3530
  subUnitId: l,
3531
- rule: { ...g, ranges: C }
3531
+ rule: { ...v, ranges: C }
3532
3532
  };
3533
- f.push({ id: be.id, params: b }), S.push(...Ae(this._injector, b));
3533
+ p.push({ id: be.id, params: b }), S.push(...Ae(this._injector, b));
3534
3534
  } else {
3535
3535
  const b = {
3536
- unitId: u,
3536
+ unitId: h,
3537
3537
  subUnitId: l,
3538
- cfId: g.cfId
3538
+ cfId: v.cfId
3539
3539
  };
3540
- f.push({ id: Se.id, params: b }), S.push(...Le(this._injector, b));
3540
+ p.push({ id: Se.id, params: b }), S.push(...Le(this._injector, b));
3541
3541
  }
3542
3542
  }
3543
3543
  }), {
3544
3544
  undos: S,
3545
- redos: f
3545
+ redos: p
3546
3546
  };
3547
3547
  }, i = {
3548
3548
  id: st,
@@ -3551,8 +3551,8 @@ let xt = class extends ce {
3551
3551
  switch (s) {
3552
3552
  case Ot.INFINITE:
3553
3553
  case Ot.ONCE: {
3554
- const u = (o = this._univerInstanceService.getCurrentUnitForType($.UNIVER_SHEET)) == null ? void 0 : o.getUnitId(), l = (a = (d = this._univerInstanceService.getCurrentUnitForType($.UNIVER_SHEET)) == null ? void 0 : d.getActiveSheet()) == null ? void 0 : a.getSheetId(), h = this._sheetsSelectionsService.getCurrentLastSelection(), v = h == null ? void 0 : h.range;
3555
- u && l && v && (this._painterConfig = { unitId: u, subUnitId: l, range: v });
3554
+ const h = (o = this._univerInstanceService.getCurrentUnitForType($.UNIVER_SHEET)) == null ? void 0 : o.getUnitId(), l = (a = (d = this._univerInstanceService.getCurrentUnitForType($.UNIVER_SHEET)) == null ? void 0 : d.getActiveSheet()) == null ? void 0 : a.getSheetId(), u = this._sheetsSelectionsService.getCurrentLastSelection(), g = u == null ? void 0 : u.range;
3555
+ h && l && g && (this._painterConfig = { unitId: h, subUnitId: l, range: g });
3556
3556
  break;
3557
3557
  }
3558
3558
  case Ot.OFF: {
@@ -3594,8 +3594,8 @@ let wt = class extends ce {
3594
3594
  const s = i.with(On);
3595
3595
  this.disposeWithMe(s.currentSkeleton$.subscribe((o) => {
3596
3596
  if (o) {
3597
- const d = o.skeleton.rowColumnSegment, a = d.endColumn - d.startColumn + 1, l = (d.endRow - d.startRow + 1) * a * 9, h = Math.max(Tr, l);
3598
- this._conditionalFormattingViewModel.setCacheLength(h);
3597
+ const d = o.skeleton.rowColumnSegment, a = d.endColumn - d.startColumn + 1, l = (d.endRow - d.startRow + 1) * a * 9, u = Math.max(Tr, l);
3598
+ this._conditionalFormattingViewModel.setCacheLength(u);
3599
3599
  }
3600
3600
  }));
3601
3601
  };