@univerjs/sheets-numfmt 0.1.0-beta.2 → 0.1.0-beta.4

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
@@ -1,26 +1,26 @@
1
- var Kn = Object.defineProperty;
2
- var Zn = (e, t, a) => t in e ? Kn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : e[t] = a;
3
- var ke = (e, t, a) => (Zn(e, typeof t != "symbol" ? t + "" : t, a), a);
4
- import { CommandType as ze, ICommandService as je, IUniverInstanceService as ge, IUndoRedoService as qn, sequenceExecute as Qn, Tools as Xn, Disposable as Le, OnLifecycle as He, LifecycleStages as Ee, Range as ne, Rectangle as ht, runOnLifecycle as er, ILocalStorageService as tr, LocaleService as ve, UniverInstanceType as yt, CellValueType as Ae, ObjectMatrix as hn, toDisposable as De, DisposableCollection as gn, ThemeService as nr, Plugin as rr, PluginType as sr } from "@univerjs/core";
5
- import { transformCellsToRange as qe, rangeMerge as Ce, SetNumfmtMutation as oe, factorySetNumfmtUndoMutation as Qe, RemoveNumfmtMutation as re, factoryRemoveNumfmtUndoMutation as Pe, INumfmtService as be, SelectionManagerService as Ve, getCurrentSheetDisabled$ as bt, ClearSelectionFormatCommand as ar, ClearSelectionAllCommand as ir, INTERCEPTOR_POINT as an, SheetInterceptorService as Tt, SetRangeValuesCommand as or, RefRangeService as cr, EffectRefRangId as ue, handleMoveRows as lr, handleMoveCols as ur, handleIRemoveRow as dr, handleIRemoveCol as mr, handleMoveRange as pr, handleInsertRow as fr, handleInsertRangeMoveRight as hr, handleInsertRangeMoveDown as gr, handleInsertCol as vr, handleDeleteRangeMoveUp as _r, handleDeleteRangeMoveLeft as yr, runRefRangeMutations as br, RemoveSheetCommand as Sr } from "@univerjs/sheets";
6
- import { Inject as z, Injector as Ne, createIdentifier as Cr } from "@wendellhu/redi";
7
- import { IAutoFillService as Mr, APPLY_TYPE as kt, getAutoFillRepeatRange as jr, SheetSkeletonManagerService as vn, COPY_TYPE as on, PREDEFINED_HOOK_NAME as cn, getRepeatRange as xr, ISheetClipboardService as Ir, IEditorBridgeService as Rr } from "@univerjs/sheets-ui";
8
- import { ITextSelectionRenderManager as wr, IRenderManagerService as kr } from "@univerjs/engine-render";
9
- import { MenuItemType as St, MenuGroup as Ct, MenuPosition as Mt, getMenuHiddenObservable as jt, ComponentManager as Dr, IMenuService as Or, ISidebarService as Pr } from "@univerjs/ui";
10
- import { Observable as Oe, merge as Ft, combineLatest as Er } from "rxjs";
11
- import { map as Ze, distinctUntilChanged as _n, switchMap as yn, tap as Nr, debounceTime as Tr, filter as ln, bufferTime as Fr } from "rxjs/operators";
12
- import $r, { createContext as Ar, useState as ie, useEffect as $t, useRef as At, useContext as bn, useMemo as ye, createElement as Ye, forwardRef as Xe } from "react";
13
- import { InputNumber as Ut, Select as zt, SelectList as Lt, Button as un } from "@univerjs/design";
14
- import { useDependency as de, useInjector as Ur } from "@wendellhu/redi/react-bindings";
15
- const Ue = {
1
+ var nr = Object.defineProperty;
2
+ var rr = (e, t, r) => t in e ? nr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
+ var Ne = (e, t, r) => (rr(e, typeof t != "symbol" ? t + "" : t, r), r);
4
+ import { CommandType as He, ICommandService as Ce, IUniverInstanceService as ve, IUndoRedoService as sr, sequenceExecute as ar, Tools as ir, Disposable as Me, OnLifecycle as je, LifecycleStages as _e, Range as ne, Rectangle as bt, ObjectMatrix as yn, CellValueType as ze, toDisposable as Te, ThemeService as bn, runOnLifecycle as or, ILocalStorageService as cr, LocaleService as me, DisposableCollection as Sn, UniverInstanceType as jt, Plugin as lr, PluginType as ur } from "@univerjs/core";
5
+ import { transformCellsToRange as Xe, rangeMerge as Ie, SetNumfmtMutation as oe, factorySetNumfmtUndoMutation as et, RemoveNumfmtMutation as te, factoryRemoveNumfmtUndoMutation as Fe, INumfmtService as ye, INTERCEPTOR_POINT as Cn, SheetInterceptorService as xt, SelectionManagerService as Ve, ClearSelectionFormatCommand as dr, ClearSelectionAllCommand as mr, SetRangeValuesCommand as pr, getCurrentSheetDisabled$ as It, RefRangeService as fr, EffectRefRangId as ue, handleMoveRows as hr, handleMoveCols as gr, handleIRemoveRow as vr, handleIRemoveCol as _r, handleMoveRange as yr, handleInsertRow as br, handleInsertRangeMoveRight as Sr, handleInsertRangeMoveDown as Cr, handleInsertCol as Mr, handleDeleteRangeMoveUp as jr, handleDeleteRangeMoveLeft as xr, runRefRangeMutations as Ir, RemoveSheetCommand as Rr } from "@univerjs/sheets";
6
+ import { Inject as $, Injector as we, createIdentifier as wr } from "@wendellhu/redi";
7
+ import { IAutoFillService as Pr, APPLY_TYPE as Tt, getAutoFillRepeatRange as Dr, SheetSkeletonManagerService as Lt, COPY_TYPE as mn, PREDEFINED_HOOK_NAME as pn, getRepeatRange as Or, ISheetClipboardService as Er, IEditorBridgeService as Nr } from "@univerjs/sheets-ui";
8
+ import { map as qe, distinctUntilChanged as Mn, switchMap as jn, tap as kr, debounceTime as Tr, filter as fn, bufferTime as Fr } from "rxjs/operators";
9
+ import { IRenderManagerService as $r, ITextSelectionRenderManager as Ar } from "@univerjs/engine-render";
10
+ import { ComponentManager as xn, ISidebarService as Ur, MenuItemType as Rt, MenuGroup as wt, MenuPosition as Pt, getMenuHiddenObservable as Dt, IMenuService as zr } from "@univerjs/ui";
11
+ import { Observable as ke, combineLatest as Lr, merge as Ht } from "rxjs";
12
+ import Hr, { createContext as Vr, useState as ie, useEffect as Vt, useRef as Yt, useContext as In, useMemo as Se, createElement as Ye, forwardRef as tt } from "react";
13
+ import { InputNumber as Bt, Select as Jt, SelectList as Wt, Button as hn } from "@univerjs/design";
14
+ import { useDependency as de, useInjector as Yr } from "@wendellhu/redi/react-bindings";
15
+ const Le = {
16
16
  id: "sheet.command.numfmt.set.numfmt",
17
- type: ze.COMMAND,
17
+ type: He.COMMAND,
18
18
  handler: (e, t) => {
19
19
  if (!t)
20
20
  return !1;
21
- const a = e.get(je), n = e.get(ge), i = e.get(qn), l = n.getCurrentUniverSheetInstance(), u = l.getUnitId(), m = l.getActiveSheet().getSheetId(), v = t.values.filter((R) => !!R.pattern), h = t.values.filter((R) => !R.pattern), f = qe(u, m, v), b = {
21
+ const r = e.get(Ce), n = e.get(ve), a = e.get(sr), l = n.getCurrentUniverSheetInstance(), u = l.getUnitId(), p = l.getActiveSheet().getSheetId(), v = t.values.filter((R) => !!R.pattern), h = t.values.filter((R) => !R.pattern), f = Xe(u, p, v), b = {
22
22
  unitId: u,
23
- subUnitId: m,
23
+ subUnitId: p,
24
24
  ranges: h.map((R) => ({
25
25
  startColumn: R.col,
26
26
  startRow: R.row,
@@ -29,32 +29,32 @@ const Ue = {
29
29
  }))
30
30
  }, I = [], D = [];
31
31
  if (v.length) {
32
- Object.keys(f.values).forEach((A) => {
33
- const V = f.values[A];
34
- V.ranges = Ce(V.ranges);
32
+ Object.keys(f.values).forEach((U) => {
33
+ const V = f.values[U];
34
+ V.ranges = Ie(V.ranges);
35
35
  }), I.push({
36
36
  id: oe.id,
37
37
  params: f
38
38
  });
39
- const R = Qe(e, f);
39
+ const R = et(e, f);
40
40
  D.push(...R);
41
41
  }
42
42
  if (h.length) {
43
- b.ranges = Ce(b.ranges), I.push({
44
- id: re.id,
43
+ b.ranges = Ie(b.ranges), I.push({
44
+ id: te.id,
45
45
  params: b
46
46
  });
47
- const R = Pe(e, b);
47
+ const R = Fe(e, b);
48
48
  D.push(...R);
49
49
  }
50
- const P = Qn(I, a).result;
51
- return P && i.pushUndoRedo({
50
+ const E = ar(I, r).result;
51
+ return E && a.pushUndoRedo({
52
52
  unitID: u,
53
53
  undoMutations: D,
54
54
  redoMutations: I
55
- }), P;
55
+ }), E;
56
56
  }
57
- }, Sa = {
57
+ }, Ta = {
58
58
  sheet: {
59
59
  numfmt: {
60
60
  title: "数据格式",
@@ -88,7 +88,7 @@ const Ue = {
88
88
  subtractDecimal: "减少小数位"
89
89
  }
90
90
  }
91
- }, zr = {
91
+ }, Br = {
92
92
  sheet: {
93
93
  numfmt: {
94
94
  title: "数据格式",
@@ -122,8 +122,8 @@ const Ue = {
122
122
  subtractDecimal: "减少小数位"
123
123
  }
124
124
  }
125
- }, gt = "SHEET_NUMFMT_PLUGIN", Et = (e) => {
126
- const t = e.filter((l) => l.id === re.id).map((l) => l.params), a = e.filter((l) => l.id === oe.id).map((l) => l.params), n = [];
125
+ }, Qe = "SHEET_NUMFMT_PLUGIN", St = (e) => {
126
+ const t = e.filter((l) => l.id === te.id).map((l) => l.params), r = e.filter((l) => l.id === oe.id).map((l) => l.params), n = [];
127
127
  if (t[0]) {
128
128
  const l = t.reduce(
129
129
  (u, d) => (u.ranges.push(...d.ranges), u),
@@ -133,19 +133,19 @@ const Ue = {
133
133
  subUnitId: t[0].subUnitId
134
134
  }
135
135
  );
136
- l.ranges = Ce(l.ranges), n.push({ id: re.id, params: l });
136
+ l.ranges = Ie(l.ranges), n.push({ id: te.id, params: l });
137
137
  }
138
- const i = (l, u) => {
139
- const d = Object.keys(l), m = d.findIndex((v) => {
138
+ const a = (l, u) => {
139
+ const d = Object.keys(l), p = d.findIndex((v) => {
140
140
  const h = l[v];
141
- return Xn.diffValue(h, u);
141
+ return ir.diffValue(h, u);
142
142
  });
143
- return d[m];
143
+ return d[p];
144
144
  };
145
- if (a[0]) {
146
- const l = a.reduce(
147
- (u, d) => (Object.keys(d.values).forEach((m) => {
148
- const v = d.values[m], h = d.refMap[m], f = i(u.refMap, h);
145
+ if (r[0]) {
146
+ const l = r.reduce(
147
+ (u, d) => (Object.keys(d.values).forEach((p) => {
148
+ const v = d.values[p], h = d.refMap[p], f = a(u.refMap, h);
149
149
  if (f)
150
150
  u.values[f].ranges.push(...v.ranges);
151
151
  else {
@@ -158,33 +158,33 @@ const Ue = {
158
158
  {
159
159
  values: {},
160
160
  refMap: {},
161
- unitId: a[0].unitId,
162
- subUnitId: a[0].subUnitId
161
+ unitId: r[0].unitId,
162
+ subUnitId: r[0].subUnitId
163
163
  }
164
164
  );
165
165
  Object.keys(l.values).forEach((u) => {
166
166
  const d = l.values[u];
167
- d.ranges = Ce(d.ranges);
167
+ d.ranges = Ie(d.ranges);
168
168
  }), n.push({ id: oe.id, params: l });
169
169
  }
170
170
  return n;
171
171
  };
172
- var Lr = Object.defineProperty, Hr = Object.getOwnPropertyDescriptor, Vr = (e, t, a, n) => {
173
- for (var i = n > 1 ? void 0 : n ? Hr(t, a) : t, l = e.length - 1, u; l >= 0; l--)
174
- (u = e[l]) && (i = (n ? u(t, a, i) : u(i)) || i);
175
- return n && i && Lr(t, a, i), i;
176
- }, at = (e, t) => (a, n) => t(a, n, e);
177
- let ct = class extends Le {
178
- constructor(e, t, a, n) {
179
- super(), this._injector = e, this._univerInstanceService = t, this._numfmtService = a, this._autoFillService = n, this._initAutoFill();
172
+ var Jr = Object.defineProperty, Wr = Object.getOwnPropertyDescriptor, Gr = (e, t, r, n) => {
173
+ for (var a = n > 1 ? void 0 : n ? Wr(t, r) : t, l = e.length - 1, u; l >= 0; l--)
174
+ (u = e[l]) && (a = (n ? u(t, r, a) : u(a)) || a);
175
+ return n && a && Jr(t, r, a), a;
176
+ }, ot = (e, t) => (r, n) => t(r, n, e);
177
+ let ut = class extends Me {
178
+ constructor(e, t, r, n) {
179
+ super(), this._injector = e, this._univerInstanceService = t, this._numfmtService = r, this._autoFillService = n, this._initAutoFill();
180
180
  }
181
181
  _initAutoFill() {
182
- const e = () => ({ redos: [], undos: [] }), t = (i, l, u) => {
183
- const d = this._univerInstanceService.getCurrentUniverSheetInstance().getUnitId(), m = this._univerInstanceService.getCurrentUniverSheetInstance().getActiveSheet().getSheetId(), v = {
184
- startRow: i.row,
185
- startColumn: i.col,
186
- endColumn: i.col,
187
- endRow: i.row
182
+ const e = () => ({ redos: [], undos: [] }), t = (a, l, u) => {
183
+ const d = this._univerInstanceService.getCurrentUniverSheetInstance().getUnitId(), p = this._univerInstanceService.getCurrentUniverSheetInstance().getActiveSheet().getSheetId(), v = {
184
+ startRow: a.row,
185
+ startColumn: a.col,
186
+ endColumn: a.col,
187
+ endRow: a.row
188
188
  }, h = {
189
189
  startRow: l.row,
190
190
  startColumn: l.col,
@@ -192,7 +192,7 @@ let ct = class extends Le {
192
192
  endRow: l.row
193
193
  }, f = [];
194
194
  if (ne.foreach(u, (b, I) => {
195
- const D = ht.getPositionRange(
195
+ const D = bt.getPositionRange(
196
196
  {
197
197
  startRow: b,
198
198
  startColumn: I,
@@ -200,14 +200,14 @@ let ct = class extends Le {
200
200
  endRow: b
201
201
  },
202
202
  v
203
- ), P = this._numfmtService.getValue(
203
+ ), E = this._numfmtService.getValue(
204
204
  d,
205
- m,
205
+ p,
206
206
  D.startRow,
207
207
  D.startColumn
208
208
  );
209
- if (P) {
210
- const R = ht.getPositionRange(
209
+ if (E) {
210
+ const R = bt.getPositionRange(
211
211
  {
212
212
  startRow: b,
213
213
  startColumn: I,
@@ -217,8 +217,8 @@ let ct = class extends Le {
217
217
  h
218
218
  );
219
219
  f.push({
220
- pattern: P.pattern,
221
- type: P.type,
220
+ pattern: E.pattern,
221
+ type: E.type,
222
222
  row: R.startRow,
223
223
  col: R.startColumn
224
224
  });
@@ -226,32 +226,32 @@ let ct = class extends Le {
226
226
  }), f.length) {
227
227
  const b = {
228
228
  id: oe.id,
229
- params: qe(d, m, f)
230
- }, I = Qe(this._injector, b.params);
229
+ params: Xe(d, p, f)
230
+ }, I = et(this._injector, b.params);
231
231
  return {
232
232
  redos: [b],
233
233
  undos: I
234
234
  };
235
235
  }
236
236
  return { redos: [], undos: [] };
237
- }, a = (i, l) => {
238
- const u = [], d = [], m = {
239
- row: i.startRow,
240
- col: i.startColumn
237
+ }, r = (a, l) => {
238
+ const u = [], d = [], p = {
239
+ row: a.startRow,
240
+ col: a.startColumn
241
241
  };
242
- return jr(i, l).forEach((h) => {
243
- const { undos: f, redos: b } = t(m, h.repeatStartCell, h.relativeRange);
242
+ return Dr(a, l).forEach((h) => {
243
+ const { undos: f, redos: b } = t(p, h.repeatStartCell, h.relativeRange);
244
244
  u.push(...f), d.push(...b);
245
245
  }), {
246
- undos: Et(u),
247
- redos: Et(d)
246
+ undos: St(u),
247
+ redos: St(d)
248
248
  };
249
249
  }, n = {
250
- id: gt,
251
- onFillData: (i, l, u) => {
252
- if (u === kt.COPY || u === kt.ONLY_FORMAT || u === kt.SERIES) {
253
- const { source: d, target: m } = i;
254
- return a(d, m);
250
+ id: Qe,
251
+ onFillData: (a, l, u) => {
252
+ if (u === Tt.COPY || u === Tt.ONLY_FORMAT || u === Tt.SERIES) {
253
+ const { source: d, target: p } = a;
254
+ return r(d, p);
255
255
  }
256
256
  return e();
257
257
  }
@@ -259,548 +259,548 @@ let ct = class extends Le {
259
259
  this.disposeWithMe(this._autoFillService.addHook(n));
260
260
  }
261
261
  };
262
- ct = Vr([
263
- He(Ee.Rendered, ct),
264
- at(0, z(Ne)),
265
- at(1, z(ge)),
266
- at(2, z(be)),
267
- at(3, z(Mr))
268
- ], ct);
269
- var Yr = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
270
- function Br(e) {
262
+ ut = Gr([
263
+ je(_e.Rendered, ut),
264
+ ot(0, $(we)),
265
+ ot(1, $(ve)),
266
+ ot(2, $(ye)),
267
+ ot(3, $(Pr))
268
+ ], ut);
269
+ var Kr = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
270
+ function Zr(e) {
271
271
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
272
272
  }
273
- var Sn = { exports: {} };
273
+ var Rn = { exports: {} };
274
274
  (function(e, t) {
275
- (function(a, n) {
275
+ (function(r, n) {
276
276
  e.exports = n();
277
- })(typeof self < "u" ? self : Yr, function() {
277
+ })(typeof self < "u" ? self : Kr, function() {
278
278
  return function() {
279
- var a = { d: function(s, r) {
280
- for (var o in r)
281
- a.o(r, o) && !a.o(s, o) && Object.defineProperty(s, o, { enumerable: !0, get: r[o] });
282
- }, o: function(s, r) {
283
- return Object.prototype.hasOwnProperty.call(s, r);
279
+ var r = { d: function(i, s) {
280
+ for (var o in s)
281
+ r.o(s, o) && !r.o(i, o) && Object.defineProperty(i, o, { enumerable: !0, get: s[o] });
282
+ }, o: function(i, s) {
283
+ return Object.prototype.hasOwnProperty.call(i, s);
284
284
  } }, n = {};
285
- a.d(n, { default: function() {
286
- return Gn;
285
+ r.d(n, { default: function() {
286
+ return tr;
287
287
  } });
288
- var i = { 1078: "af", 1052: "sq", 1118: "am", 5121: "ar_DZ", 15361: "ar_BH", 3073: "ar_EG", 2049: "ar_IQ", 11265: "ar_JO", 13313: "ar_KW", 12289: "ar_LB", 4097: "ar_LY", 6145: "ar_MA", 8193: "ar_OM", 16385: "ar_QA", 1025: "ar_SA", 10241: "ar_SY", 7169: "ar_TN", 14337: "ar_AE", 9217: "ar_YE", 1067: "hy", 1101: "as", 2092: "az_AZ", 1068: "az_AZ", 1069: "eu", 1059: "be", 2117: "bn", 1093: "bn_IN", 5146: "bs", 1026: "bg", 1109: "my", 1027: "ca", 2052: "zh_CN", 3076: "zh_HK", 5124: "zh_MO", 4100: "zh_SG", 1028: "zh_TW", 1050: "hr", 1029: "cs", 1030: "da", 1125: "dv", 2067: "nl_BE", 1043: "nl_NL", 1126: "bin", 3081: "en_AU", 10249: "en_BZ", 4105: "en_CA", 9225: "en_CB", 2057: "en_GB", 16393: "en_IN", 6153: "en_IE", 8201: "en_JM", 5129: "en_NZ", 13321: "en_PH", 7177: "en_ZA", 11273: "en_TT", 1033: "en_US", 12297: "en_ZW", 1061: "et", 1071: "mk", 1080: "fo", 1065: "fa", 1124: "fil", 1035: "fi", 2060: "fr_BE", 11276: "fr_CM", 3084: "fr_CA", 9228: "fr_CG", 12300: "fr_CI", 1036: "fr_FR", 5132: "fr_LU", 13324: "fr_ML", 6156: "fr_MC", 14348: "fr_MA", 10252: "fr_SN", 4108: "fr_CH", 7180: "fr", 1122: "fy_NL", 2108: "gd_IE", 1084: "gd", 1110: "gl", 1079: "ka", 3079: "de_AT", 1031: "de_DE", 5127: "de_LI", 4103: "de_LU", 2055: "de_CH", 1032: "el", 1140: "gn", 1095: "gu", 1279: "en", 1037: "he", 1081: "hi", 1038: "hu", 1039: "is", 1136: "ig_NG", 1057: "id", 1040: "it_IT", 2064: "it_CH", 1041: "ja", 1099: "kn", 1120: "ks", 1087: "kk", 1107: "km", 1111: "kok", 1042: "ko", 1088: "ky", 1108: "lo", 1142: "la", 1062: "lv", 1063: "lt", 2110: "ms_BN", 1086: "ms_MY", 1100: "ml", 1082: "mt", 1112: "mni", 1153: "mi", 1102: "mr", 1104: "mn", 2128: "mn", 1121: "ne", 1044: "no_NO", 2068: "no_NO", 1096: "or", 1045: "pl", 1046: "pt_BR", 2070: "pt_PT", 1094: "pa", 1047: "rm", 2072: "ro_MO", 1048: "ro_RO", 1049: "ru", 2073: "ru_MO", 1083: "se", 1103: "sa", 3098: "sr_SP", 2074: "sr_SP", 1072: "st", 1074: "tn", 1113: "sd", 1115: "si", 1051: "sk", 1060: "sl", 1143: "so", 1070: "sb", 11274: "es_AR", 16394: "es_BO", 13322: "es_CL", 9226: "es_CO", 5130: "es_CR", 7178: "es_DO", 12298: "es_EC", 17418: "es_SV", 4106: "es_GT", 18442: "es_HN", 2058: "es_MX", 19466: "es_NI", 6154: "es_PA", 15370: "es_PY", 10250: "es_PE", 20490: "es_PR", 1034: "es_ES", 14346: "es_UY", 8202: "es_VE", 1089: "sw", 2077: "sv_FI", 1053: "sv_SE", 1114: "syc", 1064: "tg", 1097: "ta", 1092: "tt", 1098: "te", 1054: "th", 1105: "bo", 1073: "ts", 1055: "tr", 1090: "tk", 1058: "uk", 1056: "ur", 2115: "uz_UZ", 1091: "uz_UZ", 1075: "ve", 1066: "vi", 1106: "cy", 1076: "xh", 1085: "yi", 1077: "zu" };
288
+ var a = { 1078: "af", 1052: "sq", 1118: "am", 5121: "ar_DZ", 15361: "ar_BH", 3073: "ar_EG", 2049: "ar_IQ", 11265: "ar_JO", 13313: "ar_KW", 12289: "ar_LB", 4097: "ar_LY", 6145: "ar_MA", 8193: "ar_OM", 16385: "ar_QA", 1025: "ar_SA", 10241: "ar_SY", 7169: "ar_TN", 14337: "ar_AE", 9217: "ar_YE", 1067: "hy", 1101: "as", 2092: "az_AZ", 1068: "az_AZ", 1069: "eu", 1059: "be", 2117: "bn", 1093: "bn_IN", 5146: "bs", 1026: "bg", 1109: "my", 1027: "ca", 2052: "zh_CN", 3076: "zh_HK", 5124: "zh_MO", 4100: "zh_SG", 1028: "zh_TW", 1050: "hr", 1029: "cs", 1030: "da", 1125: "dv", 2067: "nl_BE", 1043: "nl_NL", 1126: "bin", 3081: "en_AU", 10249: "en_BZ", 4105: "en_CA", 9225: "en_CB", 2057: "en_GB", 16393: "en_IN", 6153: "en_IE", 8201: "en_JM", 5129: "en_NZ", 13321: "en_PH", 7177: "en_ZA", 11273: "en_TT", 1033: "en_US", 12297: "en_ZW", 1061: "et", 1071: "mk", 1080: "fo", 1065: "fa", 1124: "fil", 1035: "fi", 2060: "fr_BE", 11276: "fr_CM", 3084: "fr_CA", 9228: "fr_CG", 12300: "fr_CI", 1036: "fr_FR", 5132: "fr_LU", 13324: "fr_ML", 6156: "fr_MC", 14348: "fr_MA", 10252: "fr_SN", 4108: "fr_CH", 7180: "fr", 1122: "fy_NL", 2108: "gd_IE", 1084: "gd", 1110: "gl", 1079: "ka", 3079: "de_AT", 1031: "de_DE", 5127: "de_LI", 4103: "de_LU", 2055: "de_CH", 1032: "el", 1140: "gn", 1095: "gu", 1279: "en", 1037: "he", 1081: "hi", 1038: "hu", 1039: "is", 1136: "ig_NG", 1057: "id", 1040: "it_IT", 2064: "it_CH", 1041: "ja", 1099: "kn", 1120: "ks", 1087: "kk", 1107: "km", 1111: "kok", 1042: "ko", 1088: "ky", 1108: "lo", 1142: "la", 1062: "lv", 1063: "lt", 2110: "ms_BN", 1086: "ms_MY", 1100: "ml", 1082: "mt", 1112: "mni", 1153: "mi", 1102: "mr", 1104: "mn", 2128: "mn", 1121: "ne", 1044: "no_NO", 2068: "no_NO", 1096: "or", 1045: "pl", 1046: "pt_BR", 2070: "pt_PT", 1094: "pa", 1047: "rm", 2072: "ro_MO", 1048: "ro_RO", 1049: "ru", 2073: "ru_MO", 1083: "se", 1103: "sa", 3098: "sr_SP", 2074: "sr_SP", 1072: "st", 1074: "tn", 1113: "sd", 1115: "si", 1051: "sk", 1060: "sl", 1143: "so", 1070: "sb", 11274: "es_AR", 16394: "es_BO", 13322: "es_CL", 9226: "es_CO", 5130: "es_CR", 7178: "es_DO", 12298: "es_EC", 17418: "es_SV", 4106: "es_GT", 18442: "es_HN", 2058: "es_MX", 19466: "es_NI", 6154: "es_PA", 15370: "es_PY", 10250: "es_PE", 20490: "es_PR", 1034: "es_ES", 14346: "es_UY", 8202: "es_VE", 1089: "sw", 2077: "sv_FI", 1053: "sv_SE", 1114: "syc", 1064: "tg", 1097: "ta", 1092: "tt", 1098: "te", 1054: "th", 1105: "bo", 1073: "ts", 1055: "tr", 1090: "tk", 1058: "uk", 1056: "ur", 2115: "uz_UZ", 1091: "uz_UZ", 1075: "ve", 1066: "vi", 1106: "cy", 1076: "xh", 1085: "yi", 1077: "zu" };
289
289
  const l = /^([a-z\d]+)(?:[_-]([a-z\d]+))?(?:\.([a-z\d]+))?(?:@([a-z\d]+))?$/i, u = {}, d = { group: " ", decimal: ".", positive: "+", negative: "-", percent: "%", exponent: "E", nan: "NaN", infinity: "∞", ampm: ["AM", "PM"], mmmm6: ["Muharram", "Safar", "Rabiʻ I", "Rabiʻ II", "Jumada I", "Jumada II", "Rajab", "Shaʻban", "Ramadan", "Shawwal", "Dhuʻl-Qiʻdah", "Dhuʻl-Hijjah"], mmm6: ["Muh.", "Saf.", "Rab. I", "Rab. II", "Jum. I", "Jum. II", "Raj.", "Sha.", "Ram.", "Shaw.", "Dhuʻl-Q.", "Dhuʻl-H."], mmmm: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], mmm: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], dddd: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], ddd: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"] };
290
- function m(s) {
291
- const r = l.exec(s);
292
- if (!r)
293
- throw new SyntaxError("Malformed locale: ".concat(s));
294
- return { lang: r[1] + (r[2] ? "_" + r[2] : ""), language: r[1], territory: r[2] || "", codeset: r[3] || "", modifier: r[4] || "" };
290
+ function p(i) {
291
+ const s = l.exec(i);
292
+ if (!s)
293
+ throw new SyntaxError("Malformed locale: ".concat(i));
294
+ return { lang: s[1] + (s[2] ? "_" + s[2] : ""), language: s[1], territory: s[2] || "", codeset: s[3] || "", modifier: s[4] || "" };
295
295
  }
296
- function v(s) {
297
- if (typeof s == "number")
298
- return i[65535 & s] || null;
299
- const r = parseInt(s, 16);
300
- return isFinite(r) && i[65535 & r] ? i[65535 & r] || null : l.test(s) ? s : null;
296
+ function v(i) {
297
+ if (typeof i == "number")
298
+ return a[65535 & i] || null;
299
+ const s = parseInt(i, 16);
300
+ return isFinite(s) && a[65535 & s] ? a[65535 & s] || null : l.test(i) ? i : null;
301
301
  }
302
- function h(s) {
303
- const r = v(s);
302
+ function h(i) {
303
+ const s = v(i);
304
304
  let o = null;
305
- if (r) {
306
- const p = m(r);
307
- o = u[p.lang] || u[p.language] || null;
305
+ if (s) {
306
+ const m = p(s);
307
+ o = u[m.lang] || u[m.language] || null;
308
308
  }
309
309
  return o;
310
310
  }
311
- function f(s) {
312
- return Object.assign({}, d, s);
311
+ function f(i) {
312
+ return Object.assign({}, d, i);
313
313
  }
314
- function b(s, r) {
315
- const o = typeof r == "object" ? r : m(r);
316
- return u[o.lang] = f(s), o.language === o.lang || u[o.language] || (u[o.language] = f(s)), u[o.lang];
314
+ function b(i, s) {
315
+ const o = typeof s == "object" ? s : p(s);
316
+ return u[o.lang] = f(i), o.language === o.lang || u[o.language] || (u[o.language] = f(i)), u[o.lang];
317
317
  }
318
318
  const I = f({ group: "," });
319
- function D(s, r) {
320
- if (typeof s != "number")
321
- return s;
322
- if (s < 0)
323
- return -D(-s, r);
324
- if (r) {
325
- const o = 10 ** (r || 0) || 1;
326
- return D(s * o, 0) / o;
319
+ function D(i, s) {
320
+ if (typeof i != "number")
321
+ return i;
322
+ if (i < 0)
323
+ return -D(-i, s);
324
+ if (s) {
325
+ const o = 10 ** (s || 0) || 1;
326
+ return D(i * o, 0) / o;
327
327
  }
328
- return Math.round(s);
328
+ return Math.round(i);
329
329
  }
330
330
  I.isDefault = !0, b({ group: ",", ampm: ["上午", "下午"], mmmm: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"], mmm: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], dddd: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"], ddd: ["周日", "周一", "周二", "周三", "周四", "周五", "周六"] }, "zh_CN"), b({ group: ",", nan: "非數值", ampm: ["上午", "下午"], mmmm: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], mmm: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], dddd: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"], ddd: ["週日", "週一", "週二", "週三", "週四", "週五", "週六"] }, "zh_TW"), b({ group: ",", ampm: ["午前", "午後"], mmmm: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], mmm: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], dddd: ["日曜日", "月曜日", "火曜日", "水曜日", "木曜日", "金曜日", "土曜日"], ddd: ["日", "月", "火", "水", "木", "金", "土"] }, "ja"), b({ group: ",", ampm: ["오전", "오후"], mmmm: ["1월", "2월", "3월", "4월", "5월", "6월", "7월", "8월", "9월", "10월", "11월", "12월"], mmm: ["1월", "2월", "3월", "4월", "5월", "6월", "7월", "8월", "9월", "10월", "11월", "12월"], dddd: ["일요일", "월요일", "화요일", "수요일", "목요일", "금요일", "토요일"], ddd: ["일", "월", "화", "수", "목", "금", "토"] }, "ko"), b({ group: ",", ampm: ["ก่อนเที่ยง", "หลังเที่ยง"], mmmm: ["มกราคม", "กุมภาพันธ์", "มีนาคม", "เมษายน", "พฤษภาคม", "มิถุนายน", "กรกฎาคม", "สิงหาคม", "กันยายน", "ตุลาคม", "พฤศจิกายน", "ธันวาคม"], mmm: ["ม.ค.", "ก.พ.", "มี.ค.", "เม.ย.", "พ.ค.", "มิ.ย.", "ก.ค.", "ส.ค.", "ก.ย.", "ต.ค.", "พ.ย.", "ธ.ค."], dddd: ["วันอาทิตย์", "วันจันทร์", "วันอังคาร", "วันพุธ", "วันพฤหัสบดี", "วันศุกร์", "วันเสาร์"], ddd: ["อา.", "จ.", "อ.", "พ.", "พฤ.", "ศ.", "ส."] }, "th"), b({ decimal: ",", ampm: ["dop.", "odp."], mmmm: ["ledna", "února", "března", "dubna", "května", "června", "července", "srpna", "září", "října", "listopadu", "prosince"], mmm: ["led", "úno", "bře", "dub", "kvě", "čvn", "čvc", "srp", "zář", "říj", "lis", "pro"], dddd: ["neděle", "pondělí", "úterý", "středa", "čtvrtek", "pátek", "sobota"], ddd: ["ne", "po", "út", "st", "čt", "pá", "so"] }, "cs"), b({ group: ".", decimal: ",", mmmm: ["januar", "februar", "marts", "april", "maj", "juni", "juli", "august", "september", "oktober", "november", "december"], mmm: ["jan.", "feb.", "mar.", "apr.", "maj", "jun.", "jul.", "aug.", "sep.", "okt.", "nov.", "dec."], dddd: ["søndag", "mandag", "tirsdag", "onsdag", "torsdag", "fredag", "lørdag"], ddd: ["søn.", "man.", "tir.", "ons.", "tor.", "fre.", "lør."] }, "da"), b({ group: ".", decimal: ",", ampm: ["a.m.", "p.m."], mmmm: ["januari", "februari", "maart", "april", "mei", "juni", "juli", "augustus", "september", "oktober", "november", "december"], mmm: ["jan.", "feb.", "mrt.", "apr.", "mei", "jun.", "jul.", "aug.", "sep.", "okt.", "nov.", "dec."], dddd: ["zondag", "maandag", "dinsdag", "woensdag", "donderdag", "vrijdag", "zaterdag"], ddd: ["zo", "ma", "di", "wo", "do", "vr", "za"] }, "nl"), b({ group: "," }, "en"), b({ decimal: ",", nan: "epäluku", ampm: ["ap.", "ip."], mmmm: ["tammikuuta", "helmikuuta", "maaliskuuta", "huhtikuuta", "toukokuuta", "kesäkuuta", "heinäkuuta", "elokuuta", "syyskuuta", "lokakuuta", "marraskuuta", "joulukuuta"], mmm: ["tammik.", "helmik.", "maalisk.", "huhtik.", "toukok.", "kesäk.", "heinäk.", "elok.", "syysk.", "lokak.", "marrask.", "jouluk."], dddd: ["sunnuntaina", "maanantaina", "tiistaina", "keskiviikkona", "torstaina", "perjantaina", "lauantaina"], ddd: ["su", "ma", "ti", "ke", "to", "pe", "la"] }, "fi"), b({ group: " ", decimal: ",", mmmm: ["janvier", "février", "mars", "avril", "mai", "juin", "juillet", "août", "septembre", "octobre", "novembre", "décembre"], mmm: ["janv.", "févr.", "mars", "avr.", "mai", "juin", "juil.", "août", "sept.", "oct.", "nov.", "déc."], dddd: ["dimanche", "lundi", "mardi", "mercredi", "jeudi", "vendredi", "samedi"], ddd: ["dim.", "lun.", "mar.", "mer.", "jeu.", "ven.", "sam."] }, "fr"), b({ group: ".", decimal: ",", mmmm: ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"], mmm: ["Jan.", "Feb.", "März", "Apr.", "Mai", "Juni", "Juli", "Aug.", "Sept.", "Okt.", "Nov.", "Dez."], dddd: ["Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"], ddd: ["So.", "Mo.", "Di.", "Mi.", "Do.", "Fr.", "Sa."] }, "de"), b({ group: ".", decimal: ",", ampm: ["π.μ.", "μ.μ."], mmmm: ["Ιανουαρίου", "Φεβρουαρίου", "Μαρτίου", "Απριλίου", "Μαΐου", "Ιουνίου", "Ιουλίου", "Αυγούστου", "Σεπτεμβρίου", "Οκτωβρίου", "Νοεμβρίου", "Δεκεμβρίου"], mmm: ["Ιαν", "Φεβ", "Μαρ", "Απρ", "Μαΐ", "Ιουν", "Ιουλ", "Αυγ", "Σεπ", "Οκτ", "Νοε", "Δεκ"], dddd: ["Κυριακή", "Δευτέρα", "Τρίτη", "Τετάρτη", "Πέμπτη", "Παρασκευή", "Σάββατο"], ddd: ["Κυρ", "Δευ", "Τρί", "Τετ", "Πέμ", "Παρ", "Σάβ"] }, "el"), b({ decimal: ",", ampm: ["de.", "du."], mmmm: ["január", "február", "március", "április", "május", "június", "július", "augusztus", "szeptember", "október", "november", "december"], mmm: ["jan.", "febr.", "márc.", "ápr.", "máj.", "jún.", "júl.", "aug.", "szept.", "okt.", "nov.", "dec."], dddd: ["vasárnap", "hétfő", "kedd", "szerda", "csütörtök", "péntek", "szombat"], ddd: ["V", "H", "K", "Sze", "Cs", "P", "Szo"] }, "hu"), b({ group: ".", decimal: ",", ampm: ["f.h.", "e.h."], mmmm: ["janúar", "febrúar", "mars", "apríl", "maí", "júní", "júlí", "ágúst", "september", "október", "nóvember", "desember"], mmm: ["jan.", "feb.", "mar.", "apr.", "maí", "jún.", "júl.", "ágú.", "sep.", "okt.", "nóv.", "des."], dddd: ["sunnudagur", "mánudagur", "þriðjudagur", "miðvikudagur", "fimmtudagur", "föstudagur", "laugardagur"], ddd: ["sun.", "mán.", "þri.", "mið.", "fim.", "fös.", "lau."] }, "is"), b({ group: ".", decimal: ",", mmmm: ["Januari", "Februari", "Maret", "April", "Mei", "Juni", "Juli", "Agustus", "September", "Oktober", "November", "Desember"], mmm: ["Jan", "Feb", "Mar", "Apr", "Mei", "Jun", "Jul", "Agu", "Sep", "Okt", "Nov", "Des"], dddd: ["Minggu", "Senin", "Selasa", "Rabu", "Kamis", "Jumat", "Sabtu"], ddd: ["Min", "Sen", "Sel", "Rab", "Kam", "Jum", "Sab"] }, "id"), b({ group: ".", decimal: ",", mmmm: ["gennaio", "febbraio", "marzo", "aprile", "maggio", "giugno", "luglio", "agosto", "settembre", "ottobre", "novembre", "dicembre"], mmm: ["gen", "feb", "mar", "apr", "mag", "giu", "lug", "ago", "set", "ott", "nov", "dic"], dddd: ["domenica", "lunedì", "martedì", "mercoledì", "giovedì", "venerdì", "sabato"], ddd: ["dom", "lun", "mar", "mer", "gio", "ven", "sab"] }, "it"), b({ decimal: ",", ampm: ["a.m.", "p.m."], mmmm: ["januar", "februar", "mars", "april", "mai", "juni", "juli", "august", "september", "oktober", "november", "desember"], mmm: ["jan.", "feb.", "mar.", "apr.", "mai", "jun.", "jul.", "aug.", "sep.", "okt.", "nov.", "des."], dddd: ["søndag", "mandag", "tirsdag", "onsdag", "torsdag", "fredag", "lørdag"], ddd: ["søn.", "man.", "tir.", "ons.", "tor.", "fre.", "lør."] }, "nb"), b({ decimal: ",", mmmm: ["stycznia", "lutego", "marca", "kwietnia", "maja", "czerwca", "lipca", "sierpnia", "września", "października", "listopada", "grudnia"], mmm: ["sty", "lut", "mar", "kwi", "maj", "cze", "lip", "sie", "wrz", "paź", "lis", "gru"], dddd: ["niedziela", "poniedziałek", "wtorek", "środa", "czwartek", "piątek", "sobota"], ddd: ["niedz.", "pon.", "wt.", "śr.", "czw.", "pt.", "sob."] }, "pl"), b({ group: ".", decimal: ",", mmmm: ["janeiro", "fevereiro", "março", "abril", "maio", "junho", "julho", "agosto", "setembro", "outubro", "novembro", "dezembro"], mmm: ["jan.", "fev.", "mar.", "abr.", "mai.", "jun.", "jul.", "ago.", "set.", "out.", "nov.", "dez."], dddd: ["domingo", "segunda-feira", "terça-feira", "quarta-feira", "quinta-feira", "sexta-feira", "sábado"], ddd: ["dom.", "seg.", "ter.", "qua.", "qui.", "sex.", "sáb."] }, "pt"), b({ decimal: ",", nan: "не число", mmmm: ["января", "февраля", "марта", "апреля", "мая", "июня", "июля", "августа", "сентября", "октября", "ноября", "декабря"], mmm: ["янв.", "февр.", "мар.", "апр.", "мая", "июн.", "июл.", "авг.", "сент.", "окт.", "нояб.", "дек."], dddd: ["воскресенье", "понедельник", "вторник", "среда", "четверг", "пятница", "суббота"], ddd: ["вс", "пн", "вт", "ср", "чт", "пт", "сб"] }, "ru"), b({ decimal: ",", mmmm: ["januára", "februára", "marca", "apríla", "mája", "júna", "júla", "augusta", "septembra", "októbra", "novembra", "decembra"], mmm: ["jan", "feb", "mar", "apr", "máj", "jún", "júl", "aug", "sep", "okt", "nov", "dec"], dddd: ["nedeľa", "pondelok", "utorok", "streda", "štvrtok", "piatok", "sobota"], ddd: ["ne", "po", "ut", "st", "št", "pi", "so"] }, "sk"), b({ group: ".", decimal: ",", ampm: ["a. m.", "p. m."], mmmm: ["enero", "febrero", "marzo", "abril", "mayo", "junio", "julio", "agosto", "septiembre", "octubre", "noviembre", "diciembre"], mmm: ["ene.", "feb.", "mar.", "abr.", "may.", "jun.", "jul.", "ago.", "sept.", "oct.", "nov.", "dic."], dddd: ["domingo", "lunes", "martes", "miércoles", "jueves", "viernes", "sábado"], ddd: ["dom.", "lun.", "mar.", "mié.", "jue.", "vie.", "sáb."] }, "es"), b({ decimal: ",", ampm: ["fm", "em"], mmmm: ["januari", "februari", "mars", "april", "maj", "juni", "juli", "augusti", "september", "oktober", "november", "december"], mmm: ["jan.", "feb.", "mars", "apr.", "maj", "juni", "juli", "aug.", "sep.", "okt.", "nov.", "dec."], dddd: ["söndag", "måndag", "tisdag", "onsdag", "torsdag", "fredag", "lördag"], ddd: ["sön", "mån", "tis", "ons", "tors", "fre", "lör"] }, "sv"), b({ group: ".", decimal: ",", ampm: ["ÖÖ", "ÖS"], mmmm: ["Ocak", "Şubat", "Mart", "Nisan", "Mayıs", "Haziran", "Temmuz", "Ağustos", "Eylül", "Ekim", "Kasım", "Aralık"], mmm: ["Oca", "Şub", "Mar", "Nis", "May", "Haz", "Tem", "Ağu", "Eyl", "Eki", "Kas", "Ara"], dddd: ["Pazar", "Pazartesi", "Salı", "Çarşamba", "Perşembe", "Cuma", "Cumartesi"], ddd: ["Paz", "Pzt", "Sal", "Çar", "Per", "Cum", "Cmt"] }, "tr");
331
- function P(s, r, o) {
332
- const p = s < 0 ? -1 : 1, _ = 10 ** (r || 2), M = 10 ** (o || 2);
333
- let y, g, c = Math.abs(s), x = 0, E = 0, S = 0, N = 1;
334
- if ((s = c) % 1 == 0)
335
- g = [s * p, 1];
336
- else if (s < 1e-19)
337
- g = [p, 1e19];
338
- else if (s > 1e19)
339
- g = [1e19 * p, 1];
331
+ function E(i, s, o) {
332
+ const m = i < 0 ? -1 : 1, _ = 10 ** (s || 2), M = 10 ** (o || 2);
333
+ let y, g, c = Math.abs(i), x = 0, N = 0, S = 0, k = 1;
334
+ if ((i = c) % 1 == 0)
335
+ g = [i * m, 1];
336
+ else if (i < 1e-19)
337
+ g = [m, 1e19];
338
+ else if (i > 1e19)
339
+ g = [1e19 * m, 1];
340
340
  else {
341
341
  do
342
- if (c = 1 / (c - Math.floor(c)), y = N, N = N * Math.floor(c) + x, x = y, E = S, S = Math.floor(s * N + 0.5), S >= _ || N >= M)
343
- return [p * E, x];
344
- while (Math.abs(s - S / N) >= 1e-10 && c !== Math.floor(c));
345
- g = [p * S, N];
342
+ if (c = 1 / (c - Math.floor(c)), y = k, k = k * Math.floor(c) + x, x = y, N = S, S = Math.floor(i * k + 0.5), S >= _ || k >= M)
343
+ return [m * N, x];
344
+ while (Math.abs(i - S / k) >= 1e-10 && c !== Math.floor(c));
345
+ g = [m * S, k];
346
346
  }
347
347
  return g;
348
348
  }
349
- const R = { overflow: "######", dateErrorThrows: !1, dateErrorNumber: !0, dateSpanLarge: !0, leap1900: !0, nbsp: !0, throws: !0, invalid: "######", locale: "", ignoreTimezone: !1 }, A = Object.assign({}, R);
350
- function V(s) {
351
- if (s === null && (s = R), s) {
352
- for (const r in s)
353
- if (r in R) {
354
- const o = s[r];
355
- A[r] = o ?? R[r];
349
+ const R = { overflow: "######", dateErrorThrows: !1, dateErrorNumber: !0, dateSpanLarge: !0, leap1900: !0, nbsp: !0, throws: !0, invalid: "######", locale: "", ignoreTimezone: !1 }, U = Object.assign({}, R);
350
+ function V(i) {
351
+ if (i === null && (i = R), i) {
352
+ for (const s in i)
353
+ if (s in R) {
354
+ const o = i[s];
355
+ U[s] = o == null ? R[s] : o;
356
356
  }
357
357
  }
358
- return { ...A };
358
+ return { ...U };
359
359
  }
360
- const W = { "#": "", 0: "0", "?": " " }, Q = { "@": "text", "-": "minus", "+": "plus" }, me = ["#000", "#FFF", "#F00", "#0F0", "#00F", "#FF0", "#F0F", "#0FF", "#000", "#FFF", "#F00", "#0F0", "#00F", "#FF0", "#F0F", "#0FF", "#800", "#080", "#008", "#880", "#808", "#088", "#CCC", "#888", "#99F", "#936", "#FFC", "#CFF", "#606", "#F88", "#06C", "#CCF", "#008", "#F0F", "#FF0", "#0FF", "#808", "#800", "#088", "#00F", "#0CF", "#CFF", "#CFC", "#FF9", "#9CF", "#F9C", "#C9F", "#FC9", "#36F", "#3CC", "#9C0", "#FC0"], xe = ["¤", "$", "£", "¥", "֏", "؋", "৳", "฿", "៛", "₡", "₦", "₩", "₪", "₫", "€", "₭", "₮", "₱", "₲", "₴", "₸", "₹", "₺", "₼", "₽", "₾", "₿"], Ie = new RegExp("[" + xe.join("") + "]");
361
- function G(s, r, o) {
362
- return r[o + "_max"] = s.length, r[o + "_min"] = s.replace(/#/g, "").length, r;
360
+ const W = { "#": "", 0: "0", "?": " " }, Q = { "@": "text", "-": "minus", "+": "plus" }, pe = ["#000", "#FFF", "#F00", "#0F0", "#00F", "#FF0", "#F0F", "#0FF", "#000", "#FFF", "#F00", "#0F0", "#00F", "#FF0", "#F0F", "#0FF", "#800", "#080", "#008", "#880", "#808", "#088", "#CCC", "#888", "#99F", "#936", "#FFC", "#CFF", "#606", "#F88", "#06C", "#CCF", "#008", "#F0F", "#FF0", "#0FF", "#808", "#800", "#088", "#00F", "#0CF", "#CFF", "#CFC", "#FF9", "#9CF", "#F9C", "#C9F", "#FC9", "#36F", "#3CC", "#9C0", "#FC0"], Pe = ["¤", "$", "£", "¥", "֏", "؋", "৳", "฿", "៛", "₡", "₦", "₩", "₪", "₫", "€", "₭", "₮", "₱", "₲", "₴", "₸", "₹", "₺", "₼", "₽", "₾", "₿"], De = new RegExp("[" + Pe.join("") + "]");
361
+ function G(i, s, o) {
362
+ return s[o + "_max"] = i.length, s[o + "_min"] = i.replace(/#/g, "").length, s;
363
363
  }
364
- const pe = {};
365
- function Te(s) {
366
- if (!(s in pe)) {
367
- const r = [], o = s.replace(/^[#,]+/, "").replace(/[1-9]\d*/g, (p) => "?".repeat(p.length));
368
- for (let p = 0; p < o.length; p++) {
369
- const _ = o.charAt(p);
370
- r[p] = _ in W ? W[_] : _;
364
+ const fe = {};
365
+ function $e(i) {
366
+ if (!(i in fe)) {
367
+ const s = [], o = i.replace(/^[#,]+/, "").replace(/[1-9]\d*/g, (m) => "?".repeat(m.length));
368
+ for (let m = 0; m < o.length; m++) {
369
+ const _ = o.charAt(m);
370
+ s[m] = _ in W ? W[_] : _;
371
371
  }
372
- pe[s] = r.join("");
372
+ fe[i] = s.join("");
373
373
  }
374
- return pe[s];
374
+ return fe[i];
375
375
  }
376
- function Z(s, r) {
377
- typeof s == "string" && (s = { type: "string", value: s = s.replace(/ /g, W["?"]) }), r.push(s);
376
+ function Z(i, s) {
377
+ typeof i == "string" && (i = { type: "string", value: i = i.replace(/ /g, W["?"]) }), s.push(i);
378
378
  }
379
- function Re(s) {
380
- const r = [], o = { scale: 1, percent: !1, text: !1, date: 0, date_eval: !1, date_system: 1, sec_decimals: 0, general: !1, clock: 24, int_pattern: [], frac_pattern: [], man_pattern: [], den_pattern: [], num_pattern: [], tokens: r };
381
- let p = s + "", _ = "int", M = !1, y = null;
379
+ function Oe(i) {
380
+ const s = [], o = { scale: 1, percent: !1, text: !1, date: 0, date_eval: !1, date_system: 1, sec_decimals: 0, general: !1, clock: 24, int_pattern: [], frac_pattern: [], man_pattern: [], den_pattern: [], num_pattern: [], tokens: s };
381
+ let m = i + "", _ = "int", M = !1, y = null;
382
382
  const g = [];
383
- let c, x, E = !1;
384
- for (; p && !M; ) {
385
- if (c = /^General/i.exec(p))
386
- o.general = !0, Z({ type: "general" }, r);
387
- else if (_ === "int" && (c = /^[#?0]+(?:,[#?0]+)*/.exec(p)) || _ === "den" && (c = /^[#?\d]+/.exec(p)) || (c = /^[#?0]+/.exec(p)))
388
- o[_ + "_pattern"].push(c[0]), y = { type: _, num: c[0] }, Z(y, r);
389
- else if ((c = /^\//.exec(p)) && o[_ + "_pattern"].length) {
383
+ let c, x, N = !1;
384
+ for (; m && !M; ) {
385
+ if (c = /^General/i.exec(m))
386
+ o.general = !0, Z({ type: "general" }, s);
387
+ else if (_ === "int" && (c = /^[#?0]+(?:,[#?0]+)*/.exec(m)) || _ === "den" && (c = /^[#?\d]+/.exec(m)) || (c = /^[#?0]+/.exec(m)))
388
+ o[_ + "_pattern"].push(c[0]), y = { type: _, num: c[0] }, Z(y, s);
389
+ else if ((c = /^\//.exec(m)) && o[_ + "_pattern"].length) {
390
390
  if (!y)
391
- throw new SyntaxError("Missing a numerator in pattern ".concat(s));
392
- o.fractions = !0, o.num_pattern.push(o[_ + "_pattern"].pop()), y.type = "num", _ = "den", Z({ type: "div" }, r);
393
- } else if (c = /^,+/.exec(p)) {
394
- const C = p.charAt(1) in W;
395
- x.slice(-1) in W && (c[0].length > 1 || !C) ? o.scale = 1e-3 ** c[0].length : o.dec_fractions || Z(c[0], r);
391
+ throw new SyntaxError("Missing a numerator in pattern ".concat(i));
392
+ o.fractions = !0, o.num_pattern.push(o[_ + "_pattern"].pop()), y.type = "num", _ = "den", Z({ type: "div" }, s);
393
+ } else if (c = /^,+/.exec(m)) {
394
+ const C = m.charAt(1) in W;
395
+ x.slice(-1) in W && (c[0].length > 1 || !C) ? o.scale = 1e-3 ** c[0].length : o.dec_fractions || Z(c[0], s);
396
396
  } else {
397
- if (c = /^;/.exec(p)) {
397
+ if (c = /^;/.exec(m)) {
398
398
  M = !0;
399
399
  break;
400
400
  }
401
- if (c = /^[@+-]/.exec(p))
402
- c[0] === "@" && (o.text = !0), Z({ type: Q[c[0]] }, r);
403
- else if (c = /^(?:\[(h+|m+|s+)\])/i.exec(p)) {
404
- const C = c[1].toLowerCase(), k = C[0], F = { type: "", size: 0, date: 1, raw: c[0], pad: C.length };
405
- k === "h" ? (F.size = 16, F.type = "hour-elap") : k === "m" ? (F.size = 32, F.type = "min-elap") : (F.size = 64, F.type = "sec-elap"), o.date = o.date | F.size, g.push(F), Z(F, r);
406
- } else if (c = /^(?:B2)/i.exec(p))
407
- E || (o.date_system = 6);
408
- else if (c = /^(?:B1)/i.exec(p))
409
- E || (o.date_system = 1);
410
- else if (c = /^(?:([hHmMsSyYbBdDegG])\1*)/.exec(p)) {
411
- const C = { type: "", size: 0, date: 1, raw: c[0] }, k = c[0].toLowerCase(), F = k[0];
412
- if (k === "y" || k === "yy")
401
+ if (c = /^[@+-]/.exec(m))
402
+ c[0] === "@" && (o.text = !0), Z({ type: Q[c[0]] }, s);
403
+ else if (c = /^(?:\[(h+|m+|s+)\])/i.exec(m)) {
404
+ const C = c[1].toLowerCase(), P = C[0], F = { type: "", size: 0, date: 1, raw: c[0], pad: C.length };
405
+ P === "h" ? (F.size = 16, F.type = "hour-elap") : P === "m" ? (F.size = 32, F.type = "min-elap") : (F.size = 64, F.type = "sec-elap"), o.date = o.date | F.size, g.push(F), Z(F, s);
406
+ } else if (c = /^(?:B2)/i.exec(m))
407
+ N || (o.date_system = 6);
408
+ else if (c = /^(?:B1)/i.exec(m))
409
+ N || (o.date_system = 1);
410
+ else if (c = /^(?:([hHmMsSyYbBdDegG])\1*)/.exec(m)) {
411
+ const C = { type: "", size: 0, date: 1, raw: c[0] }, P = c[0].toLowerCase(), F = P[0];
412
+ if (P === "y" || P === "yy")
413
413
  C.size = 2, C.type = "year-short";
414
414
  else if (F === "y" || F === "e")
415
415
  C.size = 2, C.type = "year";
416
- else if (k === "b" || k === "bb")
416
+ else if (P === "b" || P === "bb")
417
417
  C.size = 2, C.type = "b-year-short";
418
418
  else if (F === "b")
419
419
  C.size = 2, C.type = "b-year";
420
- else if (k === "d" || k === "dd")
421
- C.size = 8, C.type = "day", C.pad = /dd/.test(k);
422
- else if (k === "ddd")
420
+ else if (P === "d" || P === "dd")
421
+ C.size = 8, C.type = "day", C.pad = /dd/.test(P);
422
+ else if (P === "ddd")
423
423
  C.size = 8, C.type = "weekday-short";
424
424
  else if (F === "d")
425
425
  C.size = 8, C.type = "weekday";
426
426
  else if (F === "h")
427
- C.size = 16, C.type = "hour", C.pad = /hh/i.test(k);
427
+ C.size = 16, C.type = "hour", C.pad = /hh/i.test(P);
428
428
  else if (F === "m") {
429
- k.length === 3 ? (C.size = 4, C.type = "monthname-short") : k.length === 5 ? (C.size = 4, C.type = "monthname-single") : k.length >= 4 && (C.size = 4, C.type = "monthname");
430
- const U = g[g.length - 1];
431
- !C.type && U && !U.used && 80 & U.size && (U.used = !0, C.size = 32, C.type = "min", C.pad = /mm/.test(k)), C.type || (C.size = 4, C.type = "month", C.pad = /mm/.test(k), C.indeterminate = !0);
429
+ P.length === 3 ? (C.size = 4, C.type = "monthname-short") : P.length === 5 ? (C.size = 4, C.type = "monthname-single") : P.length >= 4 && (C.size = 4, C.type = "monthname");
430
+ const z = g[g.length - 1];
431
+ !C.type && z && !z.used && 80 & z.size && (z.used = !0, C.size = 32, C.type = "min", C.pad = /mm/.test(P)), C.type || (C.size = 4, C.type = "month", C.pad = /mm/.test(P), C.indeterminate = !0);
432
432
  } else if (F === "s") {
433
- C.size = 64, C.type = "sec", C.pad = /ss/.test(k);
434
- const U = g[g.length - 1];
435
- U && 32 & U.size ? C.used = !0 : U && U.indeterminate && (delete U.indeterminate, U.size = 32, U.type = "min", C.used = !0);
433
+ C.size = 64, C.type = "sec", C.pad = /ss/.test(P);
434
+ const z = g[g.length - 1];
435
+ z && 32 & z.size ? C.used = !0 : z && z.indeterminate && (delete z.indeterminate, z.size = 32, z.type = "min", C.used = !0);
436
436
  }
437
- o.date = o.date | C.size, o.date_eval = !0, g.push(C), Z(C, r);
438
- } else if (c = /^(?:AM\/PM|am\/pm|A\/P)/.exec(p))
439
- o.clock = 12, o.date = 16 | o.date, o.date_eval = !0, Z({ type: "am", short: c[0] === "A/P" }, r);
440
- else if (o.date && (c = /^\.0{1,3}/i.exec(p))) {
441
- const C = c[0].length - 1, k = [64, 128, 256, 512][C];
442
- o.date = o.date | k, o.date_eval = !0, o.sec_decimals = Math.max(o.sec_decimals, C), Z({ type: "subsec", size: k, decimals: C, date: 1, raw: c[0] }, r);
443
- } else if ((c = /^\\(.)/.exec(p)) || (c = /^"([^"]*?)"/.exec(p)))
444
- Z(c[1], r);
445
- else if (c = /^\[(<[=>]?|>=?|=)\s*(-?[.\d]+)\]/.exec(p))
437
+ o.date = o.date | C.size, o.date_eval = !0, g.push(C), Z(C, s);
438
+ } else if (c = /^(?:AM\/PM|am\/pm|A\/P)/.exec(m))
439
+ o.clock = 12, o.date = 16 | o.date, o.date_eval = !0, Z({ type: "am", short: c[0] === "A/P" }, s);
440
+ else if (o.date && (c = /^\.0{1,3}/i.exec(m))) {
441
+ const C = c[0].length - 1, P = [64, 128, 256, 512][C];
442
+ o.date = o.date | P, o.date_eval = !0, o.sec_decimals = Math.max(o.sec_decimals, C), Z({ type: "subsec", size: P, decimals: C, date: 1, raw: c[0] }, s);
443
+ } else if ((c = /^\\(.)/.exec(m)) || (c = /^"([^"]*?)"/.exec(m)))
444
+ Z(c[1], s);
445
+ else if (c = /^\[(<[=>]?|>=?|=)\s*(-?[.\d]+)\]/.exec(m))
446
446
  o.condition = [c[1], parseFloat(c[2], 10)];
447
- else if (c = /^\[\$([^\]]+)\]/.exec(p)) {
448
- const C = c[1].split("-"), k = C.length < 2 ? "" : C[C.length - 1], F = C[0];
449
- F && Z(F, r);
450
- const U = v(k);
451
- U && (o.locale = U);
452
- const Y = parseInt(k, 16);
453
- isFinite(Y) && 16711680 & Y && (Y >> 16 & 255) === 6 && (o.date_system = 6), E = !0;
454
- } else if (c = /^\[(black|blue|cyan|green|magenta|red|white|yellow|color\s*(\d+))\]/i.exec(p))
455
- o.color = c[2] ? me[parseInt(c[2], 10)] || "#000" : c[1].toLowerCase();
456
- else if (!(c = /^\[(DBNum1|ENG|HIJ|JPN|TWN)\]/i.exec(p))) {
457
- if (c = /^%/.exec(p))
458
- o.scale = 100, o.percent = !0, Z("%", r);
459
- else if (c = /^_(\\.|.)/.exec(p))
460
- Z(" ", r);
461
- else if (c = /^\./.exec(p))
462
- Z({ type: "point", value: c[0] }, r), o.dec_fractions = !0, _ = "frac";
463
- else if (c = /^[Ee]([+-]?|(?=[0#?]))/.exec(p))
464
- o.exponential = !0, o.exp_plus = c[1] === "+", _ = "man", Z({ type: "exp", plus: c[1] === "+" }, r);
465
- else if (!(c = /^\*(\\.|.)/.exec(p))) {
466
- if (c = /^[BENn[]/.exec(p))
467
- throw new SyntaxError("Unexpected char ".concat(p.charAt(0), " in pattern ").concat(s));
468
- p[0] === "(" && (o.parens = !0), c = [p[0]], Z(c[0], r);
447
+ else if (c = /^\[\$([^\]]+)\]/.exec(m)) {
448
+ const C = c[1].split("-"), P = C.length < 2 ? "" : C[C.length - 1], F = C[0];
449
+ F && Z(F, s);
450
+ const z = v(P);
451
+ z && (o.locale = z);
452
+ const Y = parseInt(P, 16);
453
+ isFinite(Y) && 16711680 & Y && (Y >> 16 & 255) === 6 && (o.date_system = 6), N = !0;
454
+ } else if (c = /^\[(black|blue|cyan|green|magenta|red|white|yellow|color\s*(\d+))\]/i.exec(m))
455
+ o.color = c[2] ? pe[parseInt(c[2], 10)] || "#000" : c[1].toLowerCase();
456
+ else if (!(c = /^\[(DBNum1|ENG|HIJ|JPN|TWN)\]/i.exec(m))) {
457
+ if (c = /^%/.exec(m))
458
+ o.scale = 100, o.percent = !0, Z("%", s);
459
+ else if (c = /^_(\\.|.)/.exec(m))
460
+ Z(" ", s);
461
+ else if (c = /^\./.exec(m))
462
+ Z({ type: "point", value: c[0] }, s), o.dec_fractions = !0, _ = "frac";
463
+ else if (c = /^[Ee]([+-]?|(?=[0#?]))/.exec(m))
464
+ o.exponential = !0, o.exp_plus = c[1] === "+", _ = "man", Z({ type: "exp", plus: c[1] === "+" }, s);
465
+ else if (!(c = /^\*(\\.|.)/.exec(m))) {
466
+ if (c = /^[BENn[]/.exec(m))
467
+ throw new SyntaxError("Unexpected char ".concat(m.charAt(0), " in pattern ").concat(i));
468
+ m[0] === "(" && (o.parens = !0), c = [m[0]], Z(c[0], s);
469
469
  }
470
470
  }
471
471
  }
472
- x = c[0], p = p.slice(c ? c[0].length : 1);
472
+ x = c[0], m = m.slice(c ? c[0].length : 1);
473
473
  }
474
- if (o.pattern = s.slice(0, s.length - p.length), /^((?:\[[^\]]+\])+)(;|$)/.test(o.pattern) && !/^\[(?:h+|m+|s+)\]/.test(o.pattern) && Z({ type: "text" }, r), o.fractions && o.dec_fractions || o.fractions && o.exponential)
474
+ if (o.pattern = i.slice(0, i.length - m.length), /^((?:\[[^\]]+\])+)(;|$)/.test(o.pattern) && !/^\[(?:h+|m+|s+)\]/.test(o.pattern) && Z({ type: "text" }, s), o.fractions && o.dec_fractions || o.fractions && o.exponential)
475
475
  throw new SyntaxError("Invalid pattern: ".concat(o.pattern));
476
476
  const S = o.int_pattern.join("");
477
477
  if (o.grouping = S.indexOf(",") >= 0, o.grouping) {
478
- const C = S.split(","), k = C.length;
479
- k === 2 ? (o.group_pri = C[1].length, o.group_sec = o.group_pri) : k > 2 && (o.group_pri = C[k - 1].length, o.group_sec = C[k - 2].length);
478
+ const C = S.split(","), P = C.length;
479
+ P === 2 ? (o.group_pri = C[1].length, o.group_sec = o.group_pri) : P > 2 && (o.group_pri = C[P - 1].length, o.group_sec = C[P - 2].length);
480
480
  } else
481
481
  o.group_pri = 0, o.group_sec = 0;
482
482
  G(S.replace(/[,]/g, ""), o, "int"), G(o.frac_pattern.join(""), o, "frac"), G(o.man_pattern.join(""), o, "man");
483
- let N = o.num_pattern.join(""), $ = o.den_pattern.join("");
484
- const T = /\?/.test($) || /\?/.test(N);
485
- return $ = $.replace(/\d/g, T ? "?" : "#"), T && ($ = $.replace(/#$/g, "?")), G(N, o, "num"), G($, o, "den"), T && (N = N.replace(/#$/g, "?")), o.int_padding = Te(o.int_pattern.join("")), o.man_padding = Te(o.man_pattern.join("")), o.num_padding = Te(N), o.den_padding = Te($), o.den_pattern.length && (o.denominator = parseInt(o.den_pattern.join("").replace(/\D/g, ""), 10)), o.integer = !!o.int_pattern.join("").length, o.fractions && r.forEach((C, k) => {
486
- const F = r[k + 1];
483
+ let k = o.num_pattern.join(""), A = o.den_pattern.join("");
484
+ const T = /\?/.test(A) || /\?/.test(k);
485
+ return A = A.replace(/\d/g, T ? "?" : "#"), T && (A = A.replace(/#$/g, "?")), G(k, o, "num"), G(A, o, "den"), T && (k = k.replace(/#$/g, "?")), o.int_padding = $e(o.int_pattern.join("")), o.man_padding = $e(o.man_pattern.join("")), o.num_padding = $e(k), o.den_padding = $e(A), o.den_pattern.length && (o.denominator = parseInt(o.den_pattern.join("").replace(/\D/g, ""), 10)), o.integer = !!o.int_pattern.join("").length, o.fractions && s.forEach((C, P) => {
486
+ const F = s[P + 1];
487
487
  C.type === "string" && F && (F.type === "num" ? C.rule = "num+int" : F.type === "div" ? C.rule = "num" : F.type === "den" && (C.rule = "den"));
488
488
  }), o;
489
489
  }
490
- const It = (s) => {
491
- const r = s.condition;
492
- r && r[1] < 0 && (r[0] === "<" || r[0] === "<=" || r[0] === "=") || s.tokens.unshift({ type: "minus", volatile: !0 });
490
+ const Et = (i) => {
491
+ const s = i.condition;
492
+ s && s[1] < 0 && (s[0] === "<" || s[0] === "<=" || s[0] === "=") || i.tokens.unshift({ type: "minus", volatile: !0 });
493
493
  };
494
- function Bt(s) {
495
- const r = [];
496
- let o, p = !1, _ = null, M = s, y = 0, g = !1, c = 0, x = 0;
494
+ function qt(i) {
495
+ const s = [];
496
+ let o, m = !1, _ = null, M = i, y = 0, g = !1, c = 0, x = 0;
497
497
  do {
498
- if (g = Re(M), (g.date || g.general) && (g.int_pattern.length || g.frac_pattern.length || g.scale !== 1 || g.text))
498
+ if (g = Oe(M), (g.date || g.general) && (g.int_pattern.length || g.frac_pattern.length || g.scale !== 1 || g.text))
499
499
  throw new Error("Illegal format");
500
- if (g.condition && (x++, p = !0), g.text) {
500
+ if (g.condition && (x++, m = !0), g.text) {
501
501
  if (_)
502
502
  throw new Error("Unexpected partition");
503
503
  _ = g;
504
504
  }
505
- g.locale && (o = v(g.locale)), r.push(g), y = M.charAt(g.pattern.length) === ";" ? 1 : 0, M = M.slice(g.pattern.length + y), c++;
505
+ g.locale && (o = v(g.locale)), s.push(g), y = M.charAt(g.pattern.length) === ";" ? 1 : 0, M = M.slice(g.pattern.length + y), c++;
506
506
  } while (y && c < 4 && x < 3);
507
507
  if (y)
508
508
  throw new Error("Unexpected partition");
509
509
  if (x > 2)
510
510
  throw new Error("Unexpected condition");
511
- const E = r[3];
512
- if (E && (E.int_pattern.length || E.frac_pattern.length || E.date))
511
+ const N = s[3];
512
+ if (N && (N.int_pattern.length || N.frac_pattern.length || N.date))
513
513
  throw new Error("Unexpected partition");
514
- if (p) {
515
- const S = r.length;
516
- if (S === 1 && (r[1] = Re("General"), r[1].generated = !0), S < 3) {
517
- const N = r[0], $ = r[1];
518
- if (It(N), $.condition)
519
- It($);
514
+ if (m) {
515
+ const S = s.length;
516
+ if (S === 1 && (s[1] = Oe("General"), s[1].generated = !0), S < 3) {
517
+ const k = s[0], A = s[1];
518
+ if (Et(k), A.condition)
519
+ Et(A);
520
520
  else {
521
- const T = N.condition;
522
- (T[0] === "=" || T[1] >= 0 && (T[0] === ">" || T[0] === ">=")) && $.tokens.unshift({ type: "minus", volatile: !0 });
521
+ const T = k.condition;
522
+ (T[0] === "=" || T[1] >= 0 && (T[0] === ">" || T[0] === ">=")) && A.tokens.unshift({ type: "minus", volatile: !0 });
523
523
  }
524
524
  } else
525
- r.forEach(It);
525
+ s.forEach(Et);
526
526
  } else {
527
- if (r.length < 4 && _)
528
- for (let S = 0, N = r.length; S < N; S++)
529
- r[S] === _ && r.splice(S, 1);
530
- if (r.length < 1 && _ && (r[0] = Re("General"), r[0].generated = !0), r.length < 2) {
531
- const S = Re(r[0].pattern);
532
- S.tokens.unshift({ type: "minus", volatile: !0 }), S.generated = !0, r.push(S);
527
+ if (s.length < 4 && _)
528
+ for (let S = 0, k = s.length; S < k; S++)
529
+ s[S] === _ && s.splice(S, 1);
530
+ if (s.length < 1 && _ && (s[0] = Oe("General"), s[0].generated = !0), s.length < 2) {
531
+ const S = Oe(s[0].pattern);
532
+ S.tokens.unshift({ type: "minus", volatile: !0 }), S.generated = !0, s.push(S);
533
533
  }
534
- if (r.length < 3) {
535
- const S = Re(r[0].pattern);
536
- S.generated = !0, r.push(S);
534
+ if (s.length < 3) {
535
+ const S = Oe(s[0].pattern);
536
+ S.generated = !0, s.push(S);
537
537
  }
538
- if (r.length < 4)
538
+ if (s.length < 4)
539
539
  if (_)
540
- r.push(_);
540
+ s.push(_);
541
541
  else {
542
- const S = Re("@");
543
- S.generated = !0, r.push(S);
542
+ const S = Oe("@");
543
+ S.generated = !0, s.push(S);
544
544
  }
545
- r[0].condition = [">", 0], r[1].condition = ["<", 0], r[2].condition = null;
545
+ s[0].condition = [">", 0], s[1].condition = ["<", 0], s[2].condition = null;
546
546
  }
547
- return { pattern: s, partitions: r, locale: o };
547
+ return { pattern: i, partitions: s, locale: o };
548
548
  }
549
549
  const X = Math.floor;
550
- function Jt(s) {
551
- if ((!(arguments.length > 1 && arguments[1] !== void 0) || arguments[1]) && s >= 0) {
552
- if (s === 0)
550
+ function Qt(i) {
551
+ if ((!(arguments.length > 1 && arguments[1] !== void 0) || arguments[1]) && i >= 0) {
552
+ if (i === 0)
553
553
  return [1900, 1, 0];
554
- if (s === 60)
554
+ if (i === 60)
555
555
  return [1900, 2, 29];
556
- if (s < 60)
557
- return [1900, s < 32 ? 1 : 2, (s - 1) % 31 + 1];
556
+ if (i < 60)
557
+ return [1900, i < 32 ? 1 : 2, (i - 1) % 31 + 1];
558
558
  }
559
- let o = s + 68569 + 2415019;
560
- const p = X(4 * o / 146097);
561
- o -= X((146097 * p + 3) / 4);
559
+ let o = i + 68569 + 2415019;
560
+ const m = X(4 * o / 146097);
561
+ o -= X((146097 * m + 3) / 4);
562
562
  const _ = X(4e3 * (o + 1) / 1461001);
563
563
  o = o - X(1461 * _ / 4) + 31;
564
564
  const M = X(80 * o / 2447), y = o - X(2447 * M / 80);
565
565
  o = X(M / 11);
566
566
  const g = M + 2 - 12 * o;
567
- return [0 | 100 * (p - 49) + _ + o, 0 | g, 0 | y];
567
+ return [0 | 100 * (m - 49) + _ + o, 0 | g, 0 | y];
568
568
  }
569
- function Tn(s) {
570
- return Jt(s + 1462);
569
+ function Hn(i) {
570
+ return Qt(i + 1462);
571
571
  }
572
- function Fn(s) {
573
- if (s === 60)
572
+ function Vn(i) {
573
+ if (i === 60)
574
574
  throw new Error("#VALUE!");
575
- if (s <= 1)
575
+ if (i <= 1)
576
576
  return [1317, 8, 29];
577
- if (s < 60)
578
- return [1317, s < 32 ? 9 : 10, 1 + (s - 2) % 30];
579
- const r = 10631 / 30, o = 0.1335;
580
- let p = s + 466935;
581
- const _ = X(p / 10631);
582
- p -= 10631 * _;
583
- const M = X((p - o) / r);
584
- p -= X(M * r + o);
585
- const y = X((p + 28.5001) / 29.5);
586
- return y === 13 ? [30 * _ + M, 12, 30] : [30 * _ + M, y, p - X(29.5001 * y - 29)];
577
+ if (i < 60)
578
+ return [1317, i < 32 ? 9 : 10, 1 + (i - 2) % 30];
579
+ const s = 10631 / 30, o = 0.1335;
580
+ let m = i + 466935;
581
+ const _ = X(m / 10631);
582
+ m -= 10631 * _;
583
+ const M = X((m - o) / s);
584
+ m -= X(M * s + o);
585
+ const y = X((m + 28.5001) / 29.5);
586
+ return y === 13 ? [30 * _ + M, 12, 30] : [30 * _ + M, y, m - X(29.5001 * y - 29)];
587
587
  }
588
- function Wt(s) {
589
- let r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, o = !(arguments.length > 2 && arguments[2] !== void 0) || arguments[2];
590
- const p = X(s);
591
- return r === 6 ? Fn(p) : r === -1 ? Tn(p) : Jt(p, o);
588
+ function Xt(i) {
589
+ let s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, o = !(arguments.length > 2 && arguments[2] !== void 0) || arguments[2];
590
+ const m = X(i);
591
+ return s === 6 ? Vn(m) : s === -1 ? Hn(m) : Qt(m, o);
592
592
  }
593
- const nt = Math.floor, Rt = 86400;
594
- function rt(s, r) {
593
+ const st = Math.floor, Nt = 86400;
594
+ function at(i, s) {
595
595
  let o = null;
596
- if (Array.isArray(s)) {
597
- const [p, _, M, y, g, c] = s;
598
- o = Date.UTC(p, _ == null ? 0 : _ - 1, M ?? 1, y || 0, g || 0, c || 0);
599
- } else if (s instanceof Date && (o = 1 * s, !r || !r.ignoreTimezone)) {
600
- const p = /* @__PURE__ */ new Date();
601
- p.setUTCFullYear(s.getFullYear(), s.getMonth(), s.getDate()), p.setUTCHours(s.getHours(), s.getMinutes(), s.getSeconds(), s.getMilliseconds()), o = 1 * p;
596
+ if (Array.isArray(i)) {
597
+ const [m, _, M, y, g, c] = i;
598
+ o = Date.UTC(m, _ == null ? 0 : _ - 1, M != null ? M : 1, y || 0, g || 0, c || 0);
599
+ } else if (i instanceof Date && (o = 1 * i, !s || !s.ignoreTimezone)) {
600
+ const m = /* @__PURE__ */ new Date();
601
+ m.setUTCFullYear(i.getFullYear(), i.getMonth(), i.getDate()), m.setUTCHours(i.getHours(), i.getMinutes(), i.getSeconds(), i.getMilliseconds()), o = 1 * m;
602
602
  }
603
603
  if (o != null && isFinite(o)) {
604
- const p = o / 864e5;
605
- return p - (p <= -25509 ? -25568 : -25569);
604
+ const m = o / 864e5;
605
+ return m - (m <= -25509 ? -25568 : -25569);
606
606
  }
607
- return s;
607
+ return i;
608
608
  }
609
- function Gt(s, r) {
610
- let o = 0 | s;
611
- const p = Rt * (s - o);
612
- let _ = nt(p);
613
- p - _ > 0.9999 && (_ += 1, _ === Rt && (_ = 0, o += 1));
614
- const M = _ < 0 ? Rt + _ : _, [y, g, c] = Wt(s, 0, r && r.leap1900), x = nt(M / 60 / 60) % 60, E = nt(M / 60) % 60, S = nt(M) % 60;
615
- if (r && r.nativeDate) {
616
- const N = /* @__PURE__ */ new Date(0);
617
- return N.setUTCFullYear(y, g - 1, c), N.setUTCHours(x, E, S), N;
609
+ function en(i, s) {
610
+ let o = 0 | i;
611
+ const m = Nt * (i - o);
612
+ let _ = st(m);
613
+ m - _ > 0.9999 && (_ += 1, _ === Nt && (_ = 0, o += 1));
614
+ const M = _ < 0 ? Nt + _ : _, [y, g, c] = Xt(i, 0, s && s.leap1900), x = st(M / 60 / 60) % 60, N = st(M / 60) % 60, S = st(M) % 60;
615
+ if (s && s.nativeDate) {
616
+ const k = /* @__PURE__ */ new Date(0);
617
+ return k.setUTCFullYear(y, g - 1, c), k.setUTCHours(x, N, S), k;
618
618
  }
619
- return [y, g, c, x, E, S];
619
+ return [y, g, c, x, N, S];
620
620
  }
621
- function $n(s) {
622
- return !!(s[0] && s[0].percent || s[1] && s[1].percent || s[2] && s[2].percent || s[3] && s[3].percent);
621
+ function Yn(i) {
622
+ return !!(i[0] && i[0].percent || i[1] && i[1].percent || i[2] && i[2].percent || i[3] && i[3].percent);
623
623
  }
624
- function An(s) {
625
- return !!(s[0] && s[0].date || s[1] && s[1].date || s[2] && s[2].date || s[3] && s[3].date);
624
+ function Bn(i) {
625
+ return !!(i[0] && i[0].date || i[1] && i[1].date || i[2] && i[2].date || i[3] && i[3].date);
626
626
  }
627
- function Un(s) {
628
- const [r, o, p, _] = s;
629
- return !(r && !r.generated || o && !o.generated || p && !p.generated || !_ || !_.text || _.generated);
627
+ function Jn(i) {
628
+ const [s, o, m, _] = i;
629
+ return !(s && !s.generated || o && !o.generated || m && !m.generated || !_ || !_.text || _.generated);
630
630
  }
631
- const zn = { text: 15, datetime: 10.8, date: 10.8, time: 10.8, percent: 10.6, currency: 10.4, grouped: 10.2, scientific: 6, number: 4, fraction: 2, general: 0, error: 0 }, Ln = [["DMY", 1], ["DM", 2], ["MY", 3], ["MDY", 4], ["MD", 5], ["hmsa", 6], ["hma", 7], ["hms", 8], ["hm", 9]], Hn = { total: 1, sign: 0, period: 0, int: 1, frac: 0 }, Je = (s, r) => s.replace(/\./, r.decimal);
632
- function Kt(s, r, o, p) {
631
+ const Wn = { text: 15, datetime: 10.8, date: 10.8, time: 10.8, percent: 10.6, currency: 10.4, grouped: 10.2, scientific: 6, number: 4, fraction: 2, general: 0, error: 0 }, Gn = [["DMY", 1], ["DM", 2], ["MY", 3], ["MDY", 4], ["MD", 5], ["hmsa", 6], ["hma", 7], ["hms", 8], ["hm", 9]], Kn = { total: 1, sign: 0, period: 0, int: 1, frac: 0 }, Je = (i, s) => i.replace(/\./, s.decimal);
632
+ function tn(i, s, o, m) {
633
633
  const _ = 0 | o;
634
634
  if (typeof o == "string")
635
- s.push(o);
635
+ i.push(o);
636
636
  else if (o === _)
637
- s.push(Math.abs(_));
637
+ i.push(Math.abs(_));
638
638
  else {
639
639
  const M = Math.abs(o);
640
640
  let y = M ? Math.floor(Math.log10(M)) : 0, g = y < 0 ? M * 10 ** -y : M / 10 ** y;
641
641
  g === 10 && (g = 1, y++);
642
- const c = function(E) {
642
+ const c = function(N) {
643
643
  let S = !(arguments.length > 1 && arguments[1] !== void 0) || arguments[1];
644
- const N = Math.abs(E);
645
- if (!N)
646
- return Hn;
647
- const $ = S && E < 0 ? 1 : 0, T = Math.floor(N), C = Math.floor(Math.log10(N) + 1);
648
- let k = 0, F = 0;
649
- if (T !== N) {
650
- k = 1;
651
- const U = String(D(C < 0 ? N * 10 ** -C : N / 10 ** C, 15));
652
- let Y = U.length, H = !0, q = 0;
653
- for (; q <= U.length; ) {
654
- if (U[q] === ".") {
644
+ const k = Math.abs(N);
645
+ if (!k)
646
+ return Kn;
647
+ const A = S && N < 0 ? 1 : 0, T = Math.floor(k), C = Math.floor(Math.log10(k) + 1);
648
+ let P = 0, F = 0;
649
+ if (T !== k) {
650
+ P = 1;
651
+ const z = String(D(C < 0 ? k * 10 ** -C : k / 10 ** C, 15));
652
+ let Y = z.length, H = !0, q = 0;
653
+ for (; q <= z.length; ) {
654
+ if (z[q] === ".") {
655
655
  Y--;
656
656
  break;
657
657
  }
658
- U[q] === "0" && H ? Y-- : H = !1, q++;
658
+ z[q] === "0" && H ? Y-- : H = !1, q++;
659
659
  }
660
- F = Y - C, F < 0 && (F = 0, k = 0);
660
+ F = Y - C, F < 0 && (F = 0, P = 0);
661
661
  }
662
- return { total: $ + Math.max(C, 1) + k + F, digits: Math.max(C, 0) + F, sign: $, period: k, int: Math.max(C, 1), frac: F };
662
+ return { total: A + Math.max(C, 1) + P + F, digits: Math.max(C, 0) + F, sign: A, period: P, int: Math.max(C, 1), frac: F };
663
663
  }(M), x = () => {
664
- const E = Math.abs(y);
664
+ const N = Math.abs(y);
665
665
  let S;
666
- S = g === 1 ? g : D(g, 5), s.push(Je(S + "", p), p.exponent, y < 0 ? p.negative : p.positive, E < 10 ? "0" : "", E);
666
+ S = g === 1 ? g : D(g, 5), i.push(Je(S + "", m), m.exponent, y < 0 ? m.negative : m.positive, N < 10 ? "0" : "", N);
667
667
  };
668
668
  if (y >= -4 && y <= -1) {
669
- const E = M.toPrecision(10 + y).replace(/\.?0+$/, "");
670
- s.push(Je(E, p));
669
+ const N = M.toPrecision(10 + y).replace(/\.?0+$/, "");
670
+ i.push(Je(N, m));
671
671
  } else if (y === 10) {
672
- const E = M.toFixed(10).slice(0, 12).replace(/\.$/, "");
673
- s.push(Je(E, p));
672
+ const N = M.toFixed(10).slice(0, 12).replace(/\.$/, "");
673
+ i.push(Je(N, m));
674
674
  } else if (Math.abs(y) <= 9)
675
675
  if (c.total <= 11) {
676
- const E = D(M, 9).toFixed(c.frac);
677
- s.push(Je(E, p));
676
+ const N = D(M, 9).toFixed(c.frac);
677
+ i.push(Je(N, m));
678
678
  } else
679
- y === 9 ? s.push(Math.floor(M)) : y >= 0 && y < 9 ? s.push(D(M, 9 - y)) : x();
679
+ y === 9 ? i.push(Math.floor(M)) : y >= 0 && y < 9 ? i.push(D(M, 9 - y)) : x();
680
680
  else
681
- c.total >= 12 ? x() : Math.floor(M) === M ? s.push(Math.floor(M)) : s.push(Je(D(M, 9).toFixed(c.frac), p));
681
+ c.total >= 12 ? x() : Math.floor(M) === M ? i.push(Math.floor(M)) : i.push(Je(D(M, 9).toFixed(c.frac), m));
682
682
  }
683
- return s;
683
+ return i;
684
684
  }
685
- const We = 86400, Zt = { int: "integer", frac: "fraction", man: "mantissa", num: "numerator", den: "denominator" }, qt = function(s) {
686
- let r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
687
- const o = Math.floor(Math.log10(s));
688
- return r > 1 ? Math.floor(o / r) * r : o;
685
+ const We = 86400, nn = { int: "integer", frac: "fraction", man: "mantissa", num: "numerator", den: "denominator" }, rn = function(i) {
686
+ let s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
687
+ const o = Math.floor(Math.log10(i));
688
+ return s > 1 ? Math.floor(o / s) * s : o;
689
689
  };
690
- function Qt(s, r, o, p) {
691
- let _ = "", M = "", y = "", g = "", c = "", x = 0, E = 0 | s, S = 0, N = 0, $ = 1, T = 0, C = 0, k = 0, F = 0, U = 0, Y = 0;
692
- const H = p || I;
693
- if (!r.text && isFinite(r.scale) && r.scale !== 1 && (s = function(L) {
690
+ function sn(i, s, o, m) {
691
+ let _ = "", M = "", y = "", g = "", c = "", x = 0, N = 0 | i, S = 0, k = 0, A = 1, T = 0, C = 0, P = 0, F = 0, z = 0, Y = 0;
692
+ const H = m || I;
693
+ if (!s.text && isFinite(s.scale) && s.scale !== 1 && (i = function(L) {
694
694
  if (L === 0)
695
695
  return L;
696
696
  const B = Math.ceil(Math.log10(L < 0 ? -L : L)), j = 10 ** (16 - Math.floor(B));
697
697
  return Math.round(L * j) / j;
698
- }(s * r.scale)), r.exponential) {
699
- let L = Math.abs(s);
698
+ }(i * s.scale)), s.exponential) {
699
+ let L = Math.abs(i);
700
700
  if (L) {
701
- const B = 10 ** -qt(L, r.int_max), j = D(L * B, r.frac_max) / B;
702
- x = qt(j, r.int_max);
701
+ const B = 10 ** -rn(L, s.int_max), j = D(L * B, s.frac_max) / B;
702
+ x = rn(j, s.int_max);
703
703
  }
704
- L /= 10 ** x, s = s < 0 ? -L : L, _ += Math.abs(x);
704
+ L /= 10 ** x, i = i < 0 ? -L : L, _ += Math.abs(x);
705
705
  }
706
- if (r.integer) {
707
- const L = Math.abs(D(s, r.fractions ? 1 : r.frac_max));
706
+ if (s.integer) {
707
+ const L = Math.abs(D(i, s.fractions ? 1 : s.frac_max));
708
708
  c += L < 1 ? "" : Math.floor(L);
709
709
  }
710
- if (r.grouping) {
710
+ if (s.grouping) {
711
711
  let L = "", B = c.length;
712
- for (B > r.group_pri && (B -= r.group_pri, L = H.group + c.slice(B, B + r.group_pri) + L); B > r.group_sec; )
713
- B -= r.group_sec, L = H.group + c.slice(B, B + r.group_sec) + L;
712
+ for (B > s.group_pri && (B -= s.group_pri, L = H.group + c.slice(B, B + s.group_pri) + L); B > s.group_sec; )
713
+ B -= s.group_sec, L = H.group + c.slice(B, B + s.group_sec) + L;
714
714
  c = B ? c.slice(0, B) + L : L;
715
715
  }
716
- r.dec_fractions && (g = String(D(s, r.frac_max)).split(".")[1] || "");
716
+ s.dec_fractions && (g = String(D(i, s.frac_max)).split(".")[1] || "");
717
717
  let q = !1;
718
- if (r.fractions) {
719
- const L = Math.abs(r.integer ? s % 1 : s);
718
+ if (s.fractions) {
719
+ const L = Math.abs(s.integer ? i % 1 : i);
720
720
  if (L)
721
- if (q = !0, isFinite(r.denominator))
722
- y += r.denominator, M += D(L * r.denominator), M === "0" && (M = "", y = "", q = !1, c || (c = "0"));
721
+ if (q = !0, isFinite(s.denominator))
722
+ y += s.denominator, M += D(L * s.denominator), M === "0" && (M = "", y = "", q = !1, c || (c = "0"));
723
723
  else {
724
- const B = P(L, r.integer ? r.num_max : 1 / 0, r.den_max);
725
- M += B[0], y += B[1], r.integer && M === "0" && (c || (c = "0"), M = "", y = "", q = !1);
724
+ const B = E(L, s.integer ? s.num_max : 1 / 0, s.den_max);
725
+ M += B[0], y += B[1], s.integer && M === "0" && (c || (c = "0"), M = "", y = "", q = !1);
726
726
  }
727
727
  }
728
- if (r.date) {
729
- E = Math.trunc(s);
730
- const L = We * (s - E);
731
- if (S = Math.floor(L), Y = L - S, Math.abs(Y) < 1e-6 ? Y = 0 : Y > 0.9999 && (Y = 0, S += 1, S === We && (S = 0, E += 1)), Y) {
732
- const B = 512 & r.date || 256 & r.date || 128 & r.date;
728
+ if (s.date) {
729
+ N = Math.trunc(i);
730
+ const L = We * (i - N);
731
+ if (S = Math.floor(L), Y = L - S, Math.abs(Y) < 1e-6 ? Y = 0 : Y > 0.9999 && (Y = 0, S += 1, S === We && (S = 0, N += 1)), Y) {
732
+ const B = 512 & s.date || 256 & s.date || 128 & s.date;
733
733
  (B === 512 && Y > 0.9995 || B === 256 && Y > 0.995 || B === 128 && Y > 0.95 || !B && Y >= 0.5) && (S++, Y = 0);
734
734
  }
735
- if (E || r.date_system) {
736
- const B = Wt(s, r.date_system, o.leap1900);
737
- N = B[0], $ = B[1], T = B[2];
735
+ if (N || s.date_system) {
736
+ const B = Xt(i, s.date_system, o.leap1900);
737
+ k = B[0], A = B[1], T = B[2];
738
738
  }
739
739
  if (S) {
740
740
  const B = S < 0 ? We + S : S;
741
- U = Math.floor(B) % 60, F = Math.floor(B / 60) % 60, k = Math.floor(B / 60 / 60) % 60;
741
+ z = Math.floor(B) % 60, F = Math.floor(B / 60) % 60, P = Math.floor(B / 60 / 60) % 60;
742
742
  }
743
- if (C = (6 + E) % 7, r.date_eval && (_e = s, we = E + S / We, o.dateSpanLarge ? _e < -694324 || we >= 35830291 : _e < 0 || we >= 2958466)) {
743
+ if (C = (6 + N) % 7, s.date_eval && (be = i, Ee = N + S / We, o.dateSpanLarge ? be < -694324 || Ee >= 35830291 : be < 0 || Ee >= 2958466)) {
744
744
  if (o.dateErrorThrows)
745
745
  throw new Error("Date out of bounds");
746
- return o.dateErrorNumber ? Kt(s < 0 ? [H.negative] : [], 0, s, H).join("") : o.overflow;
746
+ return o.dateErrorNumber ? tn(i < 0 ? [H.negative] : [], 0, i, H).join("") : o.overflow;
747
747
  }
748
748
  }
749
- var _e, we;
750
- if (r.int_padding && (c = r.int_padding.length === 1 ? c || r.int_padding : r.int_padding.substring(0, r.int_padding.length - c.length) + c), r.num_padding && (M = r.num_padding.length === 1 ? M || r.num_padding : r.num_padding.substring(0, r.num_padding.length - M.length) + M), r.den_padding && (y = r.den_padding.length === 1 ? y || r.den_padding : y + r.den_padding.slice(y.length)), r.man_padding) {
751
- const L = r.exp_plus ? "+" : "";
752
- _ = r.man_padding.length === 1 ? (x < 0 ? "-" : L) + (_ || r.man_padding) : (x < 0 ? "-" : L) + r.man_padding.slice(0, r.man_padding.length - _.length) + _;
749
+ var be, Ee;
750
+ if (s.int_padding && (c = s.int_padding.length === 1 ? c || s.int_padding : s.int_padding.substring(0, s.int_padding.length - c.length) + c), s.num_padding && (M = s.num_padding.length === 1 ? M || s.num_padding : s.num_padding.substring(0, s.num_padding.length - M.length) + M), s.den_padding && (y = s.den_padding.length === 1 ? y || s.den_padding : y + s.den_padding.slice(y.length)), s.man_padding) {
751
+ const L = s.exp_plus ? "+" : "";
752
+ _ = s.man_padding.length === 1 ? (x < 0 ? "-" : L) + (_ || s.man_padding) : (x < 0 ? "-" : L) + s.man_padding.slice(0, s.man_padding.length - _.length) + _;
753
753
  }
754
754
  const w = [];
755
- let se = 0;
756
- const Se = { int: 0, frac: 0, man: 0, num: 0, den: 0 };
757
- for (let L = 0, B = r.tokens.length; L < B; L++) {
758
- const j = r.tokens[L], st = j.num ? j.num.length : 0;
755
+ let re = 0;
756
+ const xe = { int: 0, frac: 0, man: 0, num: 0, den: 0 };
757
+ for (let L = 0, B = s.tokens.length; L < B; L++) {
758
+ const j = s.tokens[L], it = j.num ? j.num.length : 0;
759
759
  if (j.type === "string")
760
- j.rule ? j.rule === "num" ? q ? w.push(j.value) : (r.num_min > 0 || r.den_min > 0) && w.push(j.value.replace(/./g, W["?"])) : j.rule === "num+int" ? q && c ? w.push(j.value) : r.den_min > 0 && (c || r.num_min) && w.push(j.value.replace(/./g, W["?"])) : j.rule === "den" && (q ? w.push(j.value) : (r.den_min > 0 || r.den_min > 0) && w.push(j.value.replace(/./g, W["?"]))) : w.push(j.value);
760
+ j.rule ? j.rule === "num" ? q ? w.push(j.value) : (s.num_min > 0 || s.den_min > 0) && w.push(j.value.replace(/./g, W["?"])) : j.rule === "num+int" ? q && c ? w.push(j.value) : s.den_min > 0 && (c || s.num_min) && w.push(j.value.replace(/./g, W["?"])) : j.rule === "den" && (q ? w.push(j.value) : (s.den_min > 0 || s.den_min > 0) && w.push(j.value.replace(/./g, W["?"]))) : w.push(j.value);
761
761
  else if (j.type === "error")
762
762
  w.push(o.invalid);
763
763
  else if (j.type === "point")
764
- w.push(r.date ? j.value : H.decimal);
764
+ w.push(s.date ? j.value : H.decimal);
765
765
  else if (j.type === "general")
766
- Kt(w, 0, s, H);
766
+ tn(w, 0, i, H);
767
767
  else if (j.type === "exp")
768
768
  w.push(H.exponent);
769
769
  else if (j.type === "minus")
770
- j.volatile && r.date || j.volatile && (s >= 0 || typeof s != "number") || (j.volatile && !r.fractions && (r.integer || r.dec_fractions) ? (s < 0 && c && c !== "0" || g) && w.push(H.negative) : w.push(H.negative));
770
+ j.volatile && s.date || j.volatile && (i >= 0 || typeof i != "number") || (j.volatile && !s.fractions && (s.integer || s.dec_fractions) ? (i < 0 && c && c !== "0" || g) && w.push(H.negative) : w.push(H.negative));
771
771
  else if (j.type === "plus")
772
772
  w.push(H.positive);
773
773
  else if (j.type === "text")
774
- w.push(s);
774
+ w.push(i);
775
775
  else if (j.type === "div")
776
- q ? w.push("/") : r.num_min > 0 || r.den_min > 0 ? w.push(W["?"]) : w.push(W["#"]);
776
+ q ? w.push("/") : s.num_min > 0 || s.den_min > 0 ? w.push(W["?"]) : w.push(W["#"]);
777
777
  else if (j.type === "int")
778
- if (r.int_pattern.length === 1)
778
+ if (s.int_pattern.length === 1)
779
779
  w.push(c);
780
780
  else {
781
- const K = se ? r.int_pattern.join("").length - Se.int : 1 / 0, Fe = se === r.int_pattern.length - 1 ? 0 : r.int_pattern.join("").length - (Se.int + j.num.length);
782
- w.push(c.substring(c.length - K, c.length - Fe)), se++, Se.int += j.num.length;
781
+ const K = re ? s.int_pattern.join("").length - xe.int : 1 / 0, Ae = re === s.int_pattern.length - 1 ? 0 : s.int_pattern.join("").length - (xe.int + j.num.length);
782
+ w.push(c.substring(c.length - K, c.length - Ae)), re++, xe.int += j.num.length;
783
783
  }
784
784
  else if (j.type === "frac") {
785
- const K = Se.frac;
786
- for (let Fe = 0; Fe < st; Fe++)
787
- w.push(g[Fe + K] || W[j.num[Fe]]);
788
- Se.frac += st;
789
- } else if (j.type in Zt)
790
- r[j.type + "_pattern"].length === 1 ? (j.type === "int" && w.push(c), j.type === "frac" && w.push(g), j.type === "man" && w.push(_), j.type === "num" && w.push(M), j.type === "den" && w.push(y)) : (w.push(Zt[j.type].slice(Se[j.type], Se[j.type] + st)), Se[j.type] += st);
785
+ const K = xe.frac;
786
+ for (let Ae = 0; Ae < it; Ae++)
787
+ w.push(g[Ae + K] || W[j.num[Ae]]);
788
+ xe.frac += it;
789
+ } else if (j.type in nn)
790
+ s[j.type + "_pattern"].length === 1 ? (j.type === "int" && w.push(c), j.type === "frac" && w.push(g), j.type === "man" && w.push(_), j.type === "num" && w.push(M), j.type === "den" && w.push(y)) : (w.push(nn[j.type].slice(xe[j.type], xe[j.type] + it)), xe[j.type] += it);
791
791
  else if (j.type === "year")
792
- N < 0 && w.push(H.negative), w.push(String(Math.abs(N)).padStart(4, "0"));
792
+ k < 0 && w.push(H.negative), w.push(String(Math.abs(k)).padStart(4, "0"));
793
793
  else if (j.type === "year-short") {
794
- const K = N % 100;
794
+ const K = k % 100;
795
795
  w.push(K < 10 ? "0" : "", K);
796
796
  } else if (j.type === "month")
797
- w.push(j.pad && $ < 10 ? "0" : "", $);
797
+ w.push(j.pad && A < 10 ? "0" : "", A);
798
798
  else if (j.type === "monthname-single")
799
- r.date_system === 6 ? w.push(H.mmmm6[$ - 1].charAt(0)) : w.push(H.mmmm[$ - 1].charAt(0));
799
+ s.date_system === 6 ? w.push(H.mmmm6[A - 1].charAt(0)) : w.push(H.mmmm[A - 1].charAt(0));
800
800
  else if (j.type === "monthname-short")
801
- r.date_system === 6 ? w.push(H.mmm6[$ - 1]) : w.push(H.mmm[$ - 1]);
801
+ s.date_system === 6 ? w.push(H.mmm6[A - 1]) : w.push(H.mmm[A - 1]);
802
802
  else if (j.type === "monthname")
803
- r.date_system === 6 ? w.push(H.mmmm6[$ - 1]) : w.push(H.mmmm[$ - 1]);
803
+ s.date_system === 6 ? w.push(H.mmmm6[A - 1]) : w.push(H.mmmm[A - 1]);
804
804
  else if (j.type === "weekday-short")
805
805
  w.push(H.ddd[C]);
806
806
  else if (j.type === "weekday")
@@ -808,177 +808,177 @@ var Sn = { exports: {} };
808
808
  else if (j.type === "day")
809
809
  w.push(j.pad && T < 10 ? "0" : "", T);
810
810
  else if (j.type === "hour") {
811
- const K = k % r.clock || (r.clock < 24 ? r.clock : 0);
811
+ const K = P % s.clock || (s.clock < 24 ? s.clock : 0);
812
812
  w.push(j.pad && K < 10 ? "0" : "", K);
813
813
  } else if (j.type === "min")
814
814
  w.push(j.pad && F < 10 ? "0" : "", F);
815
815
  else if (j.type === "sec")
816
- w.push(j.pad && U < 10 ? "0" : "", U);
816
+ w.push(j.pad && z < 10 ? "0" : "", z);
817
817
  else if (j.type === "subsec") {
818
818
  w.push(H.decimal);
819
- const K = Y.toFixed(r.sec_decimals);
819
+ const K = Y.toFixed(s.sec_decimals);
820
820
  w.push(K.slice(2, 2 + j.decimals));
821
821
  } else if (j.type === "am") {
822
- const K = k < 12 ? 0 : 1;
823
- j.short && !p ? w.push("AP"[K]) : w.push(H.ampm[K]);
822
+ const K = P < 12 ? 0 : 1;
823
+ j.short && !m ? w.push("AP"[K]) : w.push(H.ampm[K]);
824
824
  } else if (j.type === "hour-elap") {
825
- s < 0 && w.push(H.negative);
826
- const K = 24 * E + Math.floor(Math.abs(S) / 3600);
825
+ i < 0 && w.push(H.negative);
826
+ const K = 24 * N + Math.floor(Math.abs(S) / 3600);
827
827
  w.push(String(Math.abs(K)).padStart(j.pad, "0"));
828
828
  } else if (j.type === "min-elap") {
829
- s < 0 && w.push(H.negative);
830
- const K = 1440 * E + Math.floor(Math.abs(S) / 60);
829
+ i < 0 && w.push(H.negative);
830
+ const K = 1440 * N + Math.floor(Math.abs(S) / 60);
831
831
  w.push(String(Math.abs(K)).padStart(j.pad, "0"));
832
832
  } else if (j.type === "sec-elap") {
833
- s < 0 && w.push(H.negative);
834
- const K = E * We + Math.abs(S);
833
+ i < 0 && w.push(H.negative);
834
+ const K = N * We + Math.abs(S);
835
835
  w.push(String(Math.abs(K)).padStart(j.pad, "0"));
836
836
  } else if (j.type === "b-year")
837
- w.push(N + 543);
837
+ w.push(k + 543);
838
838
  else if (j.type === "b-year-short") {
839
- const K = (N + 543) % 100;
839
+ const K = (k + 543) % 100;
840
840
  w.push(K < 10 ? "0" : "", K);
841
841
  }
842
842
  }
843
843
  return o.nbsp ? w.join("") : w.join("").replace(/\u00a0/g, " ");
844
844
  }
845
- function Xt(s, r) {
845
+ function an(i, s) {
846
846
  for (let o = 0; o < 3; o++) {
847
- const p = r[o];
848
- if (p) {
847
+ const m = s[o];
848
+ if (m) {
849
849
  let _;
850
- if (p.condition) {
851
- const M = p.condition[0], y = p.condition[1];
852
- M === "=" ? _ = s === y : M === ">" ? _ = s > y : M === "<" ? _ = s < y : M === ">=" ? _ = s >= y : M === "<=" ? _ = s <= y : M === "<>" && (_ = s !== y);
850
+ if (m.condition) {
851
+ const M = m.condition[0], y = m.condition[1];
852
+ M === "=" ? _ = i === y : M === ">" ? _ = i > y : M === "<" ? _ = i < y : M === ">=" ? _ = i >= y : M === "<=" ? _ = i <= y : M === "<>" && (_ = i !== y);
853
853
  } else
854
854
  _ = !0;
855
855
  if (_)
856
- return p;
856
+ return m;
857
857
  }
858
858
  }
859
859
  }
860
- const en = Re("@"), tn = "black", ce = {};
861
- function le(s, r) {
862
- if (s) {
863
- const o = s[0];
864
- r[o] = r[o] || {}, le(s.slice(1), r[o]);
860
+ const on = Oe("@"), cn = "black", ce = {};
861
+ function le(i, s) {
862
+ if (i) {
863
+ const o = i[0];
864
+ s[o] = s[o] || {}, le(i.slice(1), s[o]);
865
865
  } else
866
- r.$ = !0;
866
+ s.$ = !0;
867
867
  }
868
- ["d-F-y", "d-F-Y", "d-M-y", "d-M-Y", "F-d-y", "F-d-Y", "F-j-y", "F-j-Y", "j-F-y", "j-F-Y", "j-M-y", "j-M-Y", "M-d-y", "M-d-Y", "M-j-y", "M-j-Y", "m-d-y", "m-d-Y", "m-j-y", "m-j-Y", "n-d-y", "n-d-Y", "n-j-y", "n-j-Y", "y-F-d", "y-F-j", "y-M-d", "y-M-j", "Y-F-d", "Y-F-j", "Y-M-d", "Y-m-d", "Y-M-j", "Y-m-j", "Y-n-d", "Y-n-j", "j-F", "j-M", "d-F", "d-M", "n-d", "n-j", "n-Y", "m-d", "m-j", "m-Y", "M-Y", "M-y", "F-y", "F-Y", "Y-M", "Y-n", "Y-m", "Y-F", "Y-M"].forEach((s) => {
869
- le(s, ce), le(s + " x", ce), le(s + " l", ce), le(s + " l x", ce), le("l " + s, ce), le("l " + s + " x", ce), le(s + " D", ce), le(s + " D x", ce), le("D " + s, ce), le("D " + s + " x", ce);
868
+ ["d-F-y", "d-F-Y", "d-M-y", "d-M-Y", "F-d-y", "F-d-Y", "F-j-y", "F-j-Y", "j-F-y", "j-F-Y", "j-M-y", "j-M-Y", "M-d-y", "M-d-Y", "M-j-y", "M-j-Y", "m-d-y", "m-d-Y", "m-j-y", "m-j-Y", "n-d-y", "n-d-Y", "n-j-y", "n-j-Y", "y-F-d", "y-F-j", "y-M-d", "y-M-j", "Y-F-d", "Y-F-j", "Y-M-d", "Y-m-d", "Y-M-j", "Y-m-j", "Y-n-d", "Y-n-j", "j-F", "j-M", "d-F", "d-M", "n-d", "n-j", "n-Y", "m-d", "m-j", "m-Y", "M-Y", "M-y", "F-y", "F-Y", "Y-M", "Y-n", "Y-m", "Y-F", "Y-M"].forEach((i) => {
869
+ le(i, ce), le(i + " x", ce), le(i + " l", ce), le(i + " l x", ce), le("l " + i, ce), le("l " + i + " x", ce), le(i + " D", ce), le(i + " D x", ce), le("D " + i, ce), le("D " + i + " x", ce);
870
870
  });
871
- const Vn = { jan: 1, feb: 2, mar: 3, apr: 4, may: 5, jun: 6, jul: 7, aug: 8, sep: 9, oct: 10, nov: 11, dec: 12 }, Yn = { january: 1, february: 2, march: 3, april: 4, june: 6, july: 7, august: 8, september: 9, october: 10, november: 11, december: 12 }, Bn = { sunday: "l", monday: "l", tuesday: "l", wednesday: "l", thursday: "l", friday: "l", saturday: "l", sun: "D", mon: "D", tue: "D", wed: "D", thu: "D", fri: "D", sat: "D" }, Jn = (/* @__PURE__ */ new Date()).getUTCFullYear();
872
- function nn(s) {
873
- const r = new RegExp("^([\\s+%" + xe.join("") + "(-]*)(((?:(?:\\d[\\d,]*)(?:\\.\\d*)?|(?:\\.\\d+)))([eE][+-]?\\d+)?)([\\s%" + xe.join("") + ")]*)$").exec(s);
874
- if (r) {
875
- const [, o, p, _, M, y] = r;
876
- let g = 1, c = "", x = !1, E = !1, S = !1, N = !1, $ = !1, T = null, C = !1, k = parseFloat(p.replace(/,/g, ""));
877
- if (!isFinite(k))
871
+ const Zn = { jan: 1, feb: 2, mar: 3, apr: 4, may: 5, jun: 6, jul: 7, aug: 8, sep: 9, oct: 10, nov: 11, dec: 12 }, qn = { january: 1, february: 2, march: 3, april: 4, june: 6, july: 7, august: 8, september: 9, october: 10, november: 11, december: 12 }, Qn = { sunday: "l", monday: "l", tuesday: "l", wednesday: "l", thursday: "l", friday: "l", saturday: "l", sun: "D", mon: "D", tue: "D", wed: "D", thu: "D", fri: "D", sat: "D" }, Xn = (/* @__PURE__ */ new Date()).getUTCFullYear();
872
+ function ln(i) {
873
+ const s = new RegExp("^([\\s+%" + Pe.join("") + "(-]*)(((?:(?:\\d[\\d,]*)(?:\\.\\d*)?|(?:\\.\\d+)))([eE][+-]?\\d+)?)([\\s%" + Pe.join("") + ")]*)$").exec(i);
874
+ if (s) {
875
+ const [, o, m, _, M, y] = s;
876
+ let g = 1, c = "", x = !1, N = !1, S = !1, k = !1, A = !1, T = null, C = !1, P = parseFloat(m.replace(/,/g, ""));
877
+ if (!isFinite(P))
878
878
  return null;
879
- for (let U = 0; U < o.length; U++) {
880
- const Y = o[U];
879
+ for (let z = 0; z < o.length; z++) {
880
+ const Y = o[z];
881
881
  if (Y === "-") {
882
- if (x || E)
882
+ if (x || N)
883
883
  return null;
884
884
  x = !0, g = -1;
885
- } else if (Ie.test(Y)) {
886
- if ($)
885
+ } else if (De.test(Y)) {
886
+ if (A)
887
887
  return null;
888
- $ = !0, T = Y;
888
+ A = !0, T = Y;
889
889
  } else if (Y === "(") {
890
- if (E || x)
890
+ if (N || x)
891
891
  return null;
892
- E = !0, g = -1;
892
+ N = !0, g = -1;
893
893
  } else if (Y === "%") {
894
- if (N)
894
+ if (k)
895
895
  return null;
896
- N = !0;
896
+ k = !0;
897
897
  }
898
898
  }
899
- for (let U = 0; U < y.length; U++) {
900
- const Y = y[U];
901
- if (Ie.test(Y)) {
902
- if ($)
899
+ for (let z = 0; z < y.length; z++) {
900
+ const Y = y[z];
901
+ if (De.test(Y)) {
902
+ if (A)
903
903
  return null;
904
- $ = !0, T = Y, C = !0;
904
+ A = !0, T = Y, C = !0;
905
905
  } else if (Y === ")") {
906
- if (S || !E)
906
+ if (S || !N)
907
907
  return null;
908
908
  S = !0;
909
909
  } else if (Y === "%") {
910
- if (N)
910
+ if (k)
911
911
  return null;
912
- N = !0;
912
+ k = !0;
913
913
  }
914
914
  }
915
915
  if (M) {
916
- if (N || $)
916
+ if (k || A)
917
917
  return null;
918
918
  c = "0.00E+00";
919
- } else if (N) {
920
- if ($)
919
+ } else if (k) {
920
+ if (A)
921
921
  return null;
922
- c = _.includes(".") ? "0.00%" : "0%", k *= 0.01;
923
- } else if ($) {
924
- const U = _.includes(".") ? "#,##0.00" : "#,##0";
925
- c = C ? U + T : T + U;
922
+ c = _.includes(".") ? "0.00%" : "0%", P *= 0.01;
923
+ } else if (A) {
924
+ const z = _.includes(".") ? "#,##0.00" : "#,##0";
925
+ c = C ? z + T : T + z;
926
926
  } else
927
927
  _.includes(",") && (c = _.includes(".") ? "#,##0.00" : "#,##0");
928
- const F = { v: k * g };
928
+ const F = { v: P * g };
929
929
  return c && (F.z = c), F;
930
930
  }
931
931
  }
932
- const fe = (s, r, o) => {
933
- const p = o.path || "", _ = Object.keys(r);
932
+ const he = (i, s, o) => {
933
+ const m = o.path || "", _ = Object.keys(s);
934
934
  for (let M = 0; M < _.length; M++) {
935
935
  let y;
936
936
  const g = _[M];
937
- if (r[g]) {
937
+ if (s[g]) {
938
938
  if (g === "$" || g === "€")
939
- s || (y = o);
939
+ i || (y = o);
940
940
  else if (g === "-") {
941
- const c = /^(\s*([./-]|,\s)\s*|\s+)/.exec(s);
941
+ const c = /^(\s*([./-]|,\s)\s*|\s+)/.exec(i);
942
942
  if (c) {
943
943
  const x = c[1] === "-" || c[1] === "/" || c[1] === "." ? c[1] : " ";
944
944
  if (!o.sep || o.sep === x) {
945
- const E = c[0].replace(/\s+/g, " ");
946
- y = fe(s.slice(c[0].length), r[g], { ...o, sep: x, path: p + E });
945
+ const N = c[0].replace(/\s+/g, " ");
946
+ y = he(i.slice(c[0].length), s[g], { ...o, sep: x, path: m + N });
947
947
  }
948
948
  }
949
949
  } else if (g === " ") {
950
- const c = /^[,.]?\s+/.exec(s);
950
+ const c = /^[,.]?\s+/.exec(i);
951
951
  if (c) {
952
952
  const x = c[0].replace(/\s+/g, " ");
953
- y = fe(s.slice(c[0].length), r[g], { ...o, path: p + x });
953
+ y = he(i.slice(c[0].length), s[g], { ...o, path: m + x });
954
954
  }
955
955
  } else if (g === "j" || g === "d") {
956
- const c = /^(0?[1-9]|1\d|2\d|3[01])\b/.exec(s);
957
- c && (y = fe(s.slice(c[0].length), r[g], { ...o, day: c[0], path: p + g }));
956
+ const c = /^(0?[1-9]|1\d|2\d|3[01])\b/.exec(i);
957
+ c && (y = he(i.slice(c[0].length), s[g], { ...o, day: c[0], path: m + g }));
958
958
  } else if (g === "n" || g === "m") {
959
- const c = /^(0?[1-9]|1[012])\b/.exec(s);
960
- c && (y = fe(s.slice(c[0].length), r[g], { ...o, month: +c[0], _mon: c[0], path: p + g }));
959
+ const c = /^(0?[1-9]|1[012])\b/.exec(i);
960
+ c && (y = he(i.slice(c[0].length), s[g], { ...o, month: +c[0], _mon: c[0], path: m + g }));
961
961
  } else if (g === "F" || g === "M") {
962
- const c = /^([a-z]{3,9})\b/i.exec(s), x = c && (g === "F" ? Yn : Vn)[c[0].toLowerCase()];
963
- x && (y = fe(s.slice(c[0].length), r[g], { ...o, month: x, _mon: c[0], path: p + g }));
962
+ const c = /^([a-z]{3,9})\b/i.exec(i), x = c && (g === "F" ? qn : Zn)[c[0].toLowerCase()];
963
+ x && (y = he(i.slice(c[0].length), s[g], { ...o, month: x, _mon: c[0], path: m + g }));
964
964
  } else if (g === "l" || g === "D") {
965
- const c = /^([a-z]{3,9})\b/i.exec(s);
966
- (c && Bn[c[0].toLowerCase()]) === g && (y = fe(s.slice(c[0].length), r[g], { ...o, path: p + g }));
965
+ const c = /^([a-z]{3,9})\b/i.exec(i);
966
+ (c && Qn[c[0].toLowerCase()]) === g && (y = he(i.slice(c[0].length), s[g], { ...o, path: m + g }));
967
967
  } else if (g === "y") {
968
- const c = /^\d\d\b/.exec(s);
968
+ const c = /^\d\d\b/.exec(i);
969
969
  if (c) {
970
970
  const x = +c[0] >= 30 ? +c[0] + 1900 : +c[0] + 2e3;
971
- y = fe(s.slice(c[0].length), r[g], { ...o, year: x, path: p + g });
971
+ y = he(i.slice(c[0].length), s[g], { ...o, year: x, path: m + g });
972
972
  }
973
973
  } else if (g === "Y") {
974
- const c = /^\d\d\d\d\b/.exec(s);
975
- c && (y = fe(s.slice(c[0].length), r[g], { ...o, year: +c[0], path: p + g }));
974
+ const c = /^\d\d\d\d\b/.exec(i);
975
+ c && (y = he(i.slice(c[0].length), s[g], { ...o, year: +c[0], path: m + g }));
976
976
  } else {
977
977
  if (g !== "x")
978
978
  throw new Error('Unknown date token "'.concat(g, '"'));
979
979
  {
980
- const c = wt(s);
981
- c && (y = fe("", r[g], { ...o, time: c.v, tf: c.z, path: p + g }));
980
+ const c = kt(i);
981
+ c && (y = he("", s[g], { ...o, time: c.v, tf: c.z, path: m + g }));
982
982
  }
983
983
  }
984
984
  if (y)
@@ -986,13 +986,13 @@ var Sn = { exports: {} };
986
986
  }
987
987
  }
988
988
  };
989
- function rn(s, r) {
990
- const o = fe(s.trim(), ce, { path: "" });
989
+ function un(i, s) {
990
+ const o = he(i.trim(), ce, { path: "" });
991
991
  if (o) {
992
- var p;
992
+ var m;
993
993
  if (o.sep === "." && o.path.length === 3)
994
994
  return null;
995
- const _ = +((p = o.year) !== null && p !== void 0 ? p : Jn);
995
+ const _ = +((m = o.year) !== null && m !== void 0 ? m : Xn);
996
996
  if (o.day || (o.day = 1), !function(g, c, x) {
997
997
  if (x < 1 || c < 1 || c > 12)
998
998
  return !1;
@@ -1011,16 +1011,16 @@ var Sn = { exports: {} };
1011
1011
  const y = Date.UTC(_, o.month - 1, o.day) / 864e5 + M + (o.time || 0);
1012
1012
  if (y >= 0 && y <= 2958465) {
1013
1013
  const g = o._mon[0] === "0" || o.day[0] === "0" || o._mon.length === 2 && o.day.length === 2, c = o.path.replace(/[jdlDnmMFyYx-]/g, (x) => x === "j" || x === "d" ? g ? "dd" : "d" : x === "D" ? "ddd" : x === "l" ? "dddd" : x === "n" || x === "m" ? g ? "mm" : "m" : x === "M" ? "mmm" : x === "F" ? "mmmm" : x === "y" ? "yy" : x === "x" ? o.tf || "" : x === "Y" ? "yyyy" : x);
1014
- return r && r.nativeDate ? { v: Gt(y, r), z: c } : { v: y, z: c };
1014
+ return s && s.nativeDate ? { v: en(y, s), z: c } : { v: y, z: c };
1015
1015
  }
1016
1016
  }
1017
1017
  return null;
1018
1018
  }
1019
- function wt(s) {
1020
- const r = /^\s*([10]?\d|2[0-4])(?::([0-5]\d|\d))?(?::([0-5]\d|\d))?(\.\d{1,10})?(?:\s*([AP])M?)?\s*$/i.exec(s);
1021
- if (r) {
1022
- const [, o, p, _, M, y] = r;
1023
- if (M && !_ || !y && !p && !_)
1019
+ function kt(i) {
1020
+ const s = /^\s*([10]?\d|2[0-4])(?::([0-5]\d|\d))?(?::([0-5]\d|\d))?(\.\d{1,10})?(?:\s*([AP])M?)?\s*$/i.exec(i);
1021
+ if (s) {
1022
+ const [, o, m, _, M, y] = s;
1023
+ if (M && !_ || !y && !m && !_)
1024
1024
  return null;
1025
1025
  let g = 1 * (o || 0);
1026
1026
  if (y) {
@@ -1028,99 +1028,182 @@ var Sn = { exports: {} };
1028
1028
  return null;
1029
1029
  y[0] !== "p" && y[0] !== "P" || (g += 12);
1030
1030
  }
1031
- return { v: (60 * g * 60 + 60 * (1 * (p || 0)) + 1 * (_ || 0) + 1 * (M || 0)) / 86400, z: (o.length === 2 ? "hh" : "h") + ":mm" + (_ ? ":ss" : "") + (y ? " AM/PM" : "") };
1031
+ return { v: (60 * g * 60 + 60 * (1 * (m || 0)) + 1 * (_ || 0) + 1 * (M || 0)) / 86400, z: (o.length === 2 ? "hh" : "h") + ":mm" + (_ ? ":ss" : "") + (y ? " AM/PM" : "") };
1032
1032
  }
1033
1033
  return null;
1034
1034
  }
1035
- function sn(s) {
1036
- return /^\s*true\s*$/i.test(s) ? { v: !0 } : /^\s*false\s*$/i.test(s) ? { v: !1 } : null;
1035
+ function dn(i) {
1036
+ return /^\s*true\s*$/i.test(i) ? { v: !0 } : /^\s*false\s*$/i.test(i) ? { v: !1 } : null;
1037
1037
  }
1038
1038
  const Ge = {};
1039
- function Wn(s, r) {
1040
- const { pattern: o, partitions: p, locale: _ } = s, M = (c) => {
1041
- const x = Object.assign({}, V(), r, c);
1039
+ function er(i, s) {
1040
+ const { pattern: o, partitions: m, locale: _ } = i, M = (c) => {
1041
+ const x = Object.assign({}, V(), s, c);
1042
1042
  return _ && (x.locale = _), x;
1043
1043
  }, y = (c, x) => {
1044
- const E = M(x);
1045
- return function(S, N, $) {
1046
- const T = h($.locale), C = N[3] ? N[3] : en;
1044
+ const N = M(x);
1045
+ return function(S, k, A) {
1046
+ const T = h(A.locale), C = k[3] ? k[3] : on;
1047
1047
  if (typeof S == "boolean" && (S = S ? "TRUE" : "FALSE"), S == null)
1048
1048
  return "";
1049
1049
  if (typeof S != "number")
1050
- return Qt(S, C, $, T);
1050
+ return sn(S, C, A, T);
1051
1051
  if (!isFinite(S)) {
1052
1052
  const F = T || I;
1053
1053
  return isNaN(S) ? F.nan : (S < 0 ? F.negative : "") + F.infinity;
1054
1054
  }
1055
- const k = Xt(S, N);
1056
- return k ? Qt(S, k, $, T) : $.overflow;
1057
- }(rt(c, E), p, E);
1055
+ const P = an(S, k);
1056
+ return P ? sn(S, P, A, T) : A.overflow;
1057
+ }(at(c, N), m, N);
1058
1058
  };
1059
- y.color = (c, x) => function(E, S) {
1060
- if (typeof E != "number" || !isFinite(E))
1061
- return (S[3] ? S[3].color : en.color) || tn;
1062
- const N = Xt(E, S);
1063
- return N && N.color || tn;
1064
- }(rt(c, M(x)), p);
1059
+ y.color = (c, x) => function(N, S) {
1060
+ if (typeof N != "number" || !isFinite(N))
1061
+ return (S[3] ? S[3].color : on.color) || cn;
1062
+ const k = an(N, S);
1063
+ return k && k.color || cn;
1064
+ }(at(c, M(x)), m);
1065
1065
  const g = function(c) {
1066
1066
  var x;
1067
- let E = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null;
1068
- const [S, N] = c, $ = S.frac_max, T = { type: "general", isDate: An(c), isText: Un(c), isPercent: $n(c), maxDecimals: S.general ? 9 : $, scale: (x = S.scale) !== null && x !== void 0 ? x : 1, color: 0, parentheses: 0, grouped: S.grouping ? 1 : 0, _partitions: c }, C = !T.isDate && !T.isText && !S.error && S.tokens.some((H) => H.type === "string" && (E ? H.value === E : Ie.test(H.value)));
1069
- let k = "G", F = $ >= 0 ? Math.min(15, $) : "", U = "", Y = "";
1070
- if (N && N.color && (Y = "-", T.color = 1), S.parens && (U = "()", T.parentheses = 1), C)
1071
- k = "C", T.type = "currency";
1067
+ let N = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null;
1068
+ const [S, k] = c, A = S.frac_max, T = { type: "general", isDate: Bn(c), isText: Jn(c), isPercent: Yn(c), maxDecimals: S.general ? 9 : A, scale: (x = S.scale) !== null && x !== void 0 ? x : 1, color: 0, parentheses: 0, grouped: S.grouping ? 1 : 0, _partitions: c }, C = !T.isDate && !T.isText && !S.error && S.tokens.some((H) => H.type === "string" && (N ? H.value === N : De.test(H.value)));
1069
+ let P = "G", F = A >= 0 ? Math.min(15, A) : "", z = "", Y = "";
1070
+ if (k && k.color && (Y = "-", T.color = 1), S.parens && (z = "()", T.parentheses = 1), C)
1071
+ P = "C", T.type = "currency";
1072
1072
  else if (S.error)
1073
1073
  T.type = "error", T.maxDecimals = 0;
1074
1074
  else if (T.isDate) {
1075
- let H = 0, q = 0, _e = "";
1075
+ let H = 0, q = 0, be = "";
1076
1076
  S.tokens.forEach((w) => {
1077
- const se = w.type;
1078
- /^(b-)?year/.test(se) ? (_e += "Y", q++) : se.startsWith("month") ? (_e += "M", q++) : /^(week)?day/.test(se) ? (_e += "D", q++) : se !== "hour" && se !== "min" && se !== "sec" && se !== "am" || (_e += se[0], H++);
1077
+ const re = w.type;
1078
+ /^(b-)?year/.test(re) ? (be += "Y", q++) : re.startsWith("month") ? (be += "M", q++) : /^(week)?day/.test(re) ? (be += "D", q++) : re !== "hour" && re !== "min" && re !== "sec" && re !== "am" || (be += re[0], H++);
1079
1079
  }), T.type = "date", q && H ? T.type = "datetime" : !q && H && (T.type = "time");
1080
- const we = Ln.find((w) => _e.startsWith(w[0]));
1081
- k = we ? "D" : "G", F = we ? we[1] : "";
1080
+ const Ee = Gn.find((w) => be.startsWith(w[0]));
1081
+ P = Ee ? "D" : "G", F = Ee ? Ee[1] : "";
1082
1082
  } else
1083
- T.isText ? (k = "G", T.type = "text", F = "", T.maxDecimals = 0) : S.general ? (k = "G", T.type = "general", F = "") : S.fractions ? (k = "G", T.type = "fraction", F = "") : S.exponential ? (k = "S", T.type = "scientific") : T.isPercent ? (k = "P", T.type = "percent") : S.grouping ? (k = ",", T.type = "grouped") : (S.int_max || $) && (k = "F", T.type = "number");
1084
- return T.code = k + F + Y + U, T.level = zn[T.type], Object.freeze(T);
1085
- }(p, (r || {}).currency) || new SyntaxError();
1083
+ T.isText ? (P = "G", T.type = "text", F = "", T.maxDecimals = 0) : S.general ? (P = "G", T.type = "general", F = "") : S.fractions ? (P = "G", T.type = "fraction", F = "") : S.exponential ? (P = "S", T.type = "scientific") : T.isPercent ? (P = "P", T.type = "percent") : S.grouping ? (P = ",", T.type = "grouped") : (S.int_max || A) && (P = "F", T.type = "number");
1084
+ return T.code = P + F + Y + z, T.level = Wn[T.type], Object.freeze(T);
1085
+ }(m, (s || {}).currency) || new SyntaxError();
1086
1086
  return y.info = g, y.dateInfo = function(c) {
1087
1087
  const [x] = c;
1088
1088
  return { year: !!(2 & x.date), month: !!(4 & x.date), day: !!(8 & x.date), hours: !!(16 & x.date), minutes: !!(32 & x.date), seconds: !!(64 & x.date), clockType: x.clock === 12 ? 12 : 24 };
1089
- }(p), y.isPercent = () => !!g.isPercent, y.isDate = () => !!g.isDate, y.isText = () => !!g.isText, y.pattern = o, s.error && (y.error = s.error), y.options = M, y.locale = _ || r && r.locale || "", Object.freeze(y);
1089
+ }(m), y.isPercent = () => !!g.isPercent, y.isDate = () => !!g.isDate, y.isText = () => !!g.isText, y.pattern = o, i.error && (y.error = i.error), y.options = M, y.locale = _ || s && s.locale || "", Object.freeze(y);
1090
1090
  }
1091
- function J(s, r) {
1092
- s || (s = "General");
1091
+ function J(i, s) {
1092
+ i || (i = "General");
1093
1093
  let o = null;
1094
- return Ge[s] ? o = Ge[s] : (o = Object.assign({}, V(), r).throws ? Bt(s) : function(p) {
1094
+ return Ge[i] ? o = Ge[i] : (o = Object.assign({}, V(), s).throws ? qt(i) : function(m) {
1095
1095
  try {
1096
- return Bt(p);
1096
+ return qt(m);
1097
1097
  } catch (_) {
1098
1098
  const M = { tokens: [{ type: "error" }], error: _.message };
1099
- return { pattern: p, partitions: [M, M, M, M], error: _.message, locale: null };
1099
+ return { pattern: m, partitions: [M, M, M, M], error: _.message, locale: null };
1100
1100
  }
1101
- }(s), o.error || (Ge[s] = o)), Wn(o, r);
1101
+ }(i), o.error || (Ge[i] = o)), er(o, s);
1102
1102
  }
1103
- J.isDate = (s) => J(s, { throws: !1 }).isDate(), J.isPercent = (s) => J(s, { throws: !1 }).isPercent(), J.isText = (s) => J(s, { throws: !1 }).isText(), J.getInfo = (s, r) => J(s, { ...r, throws: !1 }).info, J.getDateInfo = (s, r) => J(s, { ...r, throws: !1 }).dateInfo, J.dateToSerial = rt, J.dateFromSerial = Gt, J.options = V, J.dec2frac = P, J.round = D, J.codeToLocale = i, J.parseLocale = m, J.getLocale = h, J.addLocale = (s, r) => {
1104
- const o = m(r);
1105
- return delete Ge[o.lang], delete Ge[o.language], b(s, o);
1106
- }, J.format = function(s, r, o) {
1107
- let p = arguments.length > 3 && arguments[3] !== void 0 && arguments[3];
1108
- const _ = o && typeof o == "object" ? o : { locale: o, throws: !p };
1109
- return J(s, _)(rt(r, _), _);
1110
- }, J.is_date = J.isDate, J.parseNumber = nn, J.parseDate = rn, J.parseTime = wt, J.parseBool = sn, J.parseValue = function(s, r) {
1111
- var o, p, _;
1112
- return (o = (p = (_ = nn(s)) !== null && _ !== void 0 ? _ : rn(s, r)) !== null && p !== void 0 ? p : wt(s)) !== null && o !== void 0 ? o : sn(s);
1103
+ J.isDate = (i) => J(i, { throws: !1 }).isDate(), J.isPercent = (i) => J(i, { throws: !1 }).isPercent(), J.isText = (i) => J(i, { throws: !1 }).isText(), J.getInfo = (i, s) => J(i, { ...s, throws: !1 }).info, J.getDateInfo = (i, s) => J(i, { ...s, throws: !1 }).dateInfo, J.dateToSerial = at, J.dateFromSerial = en, J.options = V, J.dec2frac = E, J.round = D, J.codeToLocale = a, J.parseLocale = p, J.getLocale = h, J.addLocale = (i, s) => {
1104
+ const o = p(s);
1105
+ return delete Ge[o.lang], delete Ge[o.language], b(i, o);
1106
+ }, J.format = function(i, s, o) {
1107
+ let m = arguments.length > 3 && arguments[3] !== void 0 && arguments[3];
1108
+ const _ = o && typeof o == "object" ? o : { locale: o, throws: !m };
1109
+ return J(i, _)(at(s, _), _);
1110
+ }, J.is_date = J.isDate, J.parseNumber = ln, J.parseDate = un, J.parseTime = kt, J.parseBool = dn, J.parseValue = function(i, s) {
1111
+ var o, m, _;
1112
+ return (o = (m = (_ = ln(i)) !== null && _ !== void 0 ? _ : un(i, s)) !== null && m !== void 0 ? m : kt(i)) !== null && o !== void 0 ? o : dn(i);
1113
1113
  };
1114
- var Gn = J;
1114
+ var tr = J;
1115
1115
  return n = n.default;
1116
1116
  }();
1117
1117
  });
1118
- })(Sn);
1119
- var Jr = Sn.exports, Wr = Jr;
1120
- const he = /* @__PURE__ */ Br(Wr), Me = (e, t = 0) => e ? he.getInfo(e).maxDecimals ?? t : t, Be = (e, t) => {
1118
+ })(Rn);
1119
+ var qr = Rn.exports, Qr = qr;
1120
+ const ge = /* @__PURE__ */ Zr(Qr), Gt = (e) => ge.getInfo(e).type || "unknown", wn = (e, t) => {
1121
+ const n = ge.getInfo(e)._partitions[1], a = ge.format(e, t, { locale: "zh-CN" });
1122
+ return t < 0 ? {
1123
+ result: a,
1124
+ color: n.color
1125
+ } : {
1126
+ result: a
1127
+ };
1128
+ };
1129
+ var Xr = Object.defineProperty, es = Object.getOwnPropertyDescriptor, ts = (e, t, r, n) => {
1130
+ for (var a = n > 1 ? void 0 : n ? es(t, r) : t, l = e.length - 1, u; l >= 0; l--)
1131
+ (u = e[l]) && (a = (n ? u(t, r, a) : u(a)) || a);
1132
+ return n && a && Xr(t, r, a), a;
1133
+ }, Ke = (e, t) => (r, n) => t(r, n, e);
1134
+ let dt = class extends Me {
1135
+ constructor(e, t, r, n, a) {
1136
+ super(), this._sheetInterceptorService = e, this._themeService = t, this._sheetSkeletonManagerService = r, this._commandService = n, this._numfmtService = a, this._initInterceptorCellContent();
1137
+ }
1138
+ _initInterceptorCellContent() {
1139
+ const e = new yn();
1140
+ this.disposeWithMe(
1141
+ this._sheetInterceptorService.intercept(Cn.CELL_CONTENT, {
1142
+ handler: (t, r, n) => {
1143
+ const a = r.unitId, l = r.subUnitId, u = this._numfmtService.getValue(a, l, r.row, r.col);
1144
+ if (!u)
1145
+ return n(t);
1146
+ const d = t;
1147
+ if (!d || d.t !== ze.NUMBER)
1148
+ return n(t);
1149
+ let p = "";
1150
+ const v = e.getValue(r.row, r.col);
1151
+ if (v && v.parameters === d.v)
1152
+ return { ...t, ...v.result };
1153
+ const h = wn(u.pattern, Number(d.v));
1154
+ if (p = h.result, !p)
1155
+ return n(t);
1156
+ const f = { v: p };
1157
+ if (h.color) {
1158
+ const b = this._themeService.getCurrentTheme()[`${h.color}500`];
1159
+ b && (f.interceptorStyle = { cl: { rgb: b } });
1160
+ }
1161
+ return e.setValue(r.row, r.col, {
1162
+ result: f,
1163
+ parameters: d.v
1164
+ }), { ...t, ...f };
1165
+ }
1166
+ })
1167
+ ), this.disposeWithMe(
1168
+ this._commandService.onCommandExecuted((t) => {
1169
+ if (t.id === oe.id) {
1170
+ const r = t.params;
1171
+ Object.keys(r.values).forEach((n) => {
1172
+ r.values[n].ranges.forEach((l) => {
1173
+ ne.foreach(l, (u, d) => {
1174
+ e.realDeleteValue(u, d);
1175
+ });
1176
+ });
1177
+ });
1178
+ }
1179
+ })
1180
+ ), this.disposeWithMe(
1181
+ Te(
1182
+ this._sheetSkeletonManagerService.currentSkeleton$.pipe(
1183
+ qe((t) => t == null ? void 0 : t.sheetId),
1184
+ Mn()
1185
+ ).subscribe(() => {
1186
+ e.reset();
1187
+ })
1188
+ )
1189
+ );
1190
+ }
1191
+ };
1192
+ dt = ts([
1193
+ je(_e.Rendered, dt),
1194
+ Ke(0, $(xt)),
1195
+ Ke(1, $(bn)),
1196
+ Ke(2, $(Lt)),
1197
+ Ke(3, $(Ce)),
1198
+ Ke(4, $(ye))
1199
+ ], dt);
1200
+ const Re = (e, t = 0) => {
1201
+ var n;
1202
+ return e && (n = ge.getInfo(e).maxDecimals) != null ? n : t;
1203
+ }, Be = (e, t) => {
1121
1204
  if (e && !t || !e && t)
1122
1205
  return !1;
1123
- const a = (v) => v.reduce(
1206
+ const r = (v) => v.reduce(
1124
1207
  (h, f) => {
1125
1208
  if (h.isEnd)
1126
1209
  return h;
@@ -1128,54 +1211,54 @@ const he = /* @__PURE__ */ Br(Wr), Me = (e, t = 0) => e ? he.getInfo(e).maxDecim
1128
1211
  return f.type === "point" ? (h.isEnd = !0, h) : { ...h, result: h.result + b };
1129
1212
  },
1130
1213
  { isEnd: !1, result: "" }
1131
- ).result, n = he.getInfo(e)._partitions, i = he.getInfo(t)._partitions, l = a(n[0].tokens), u = a(i[0].tokens), d = a(n[1].tokens), m = a(i[1].tokens);
1132
- return l === u && d === m && n[1].color === i[1].color;
1133
- }, dn = (e) => new Array(Math.min(Math.max(0, Number(e)), 30)).fill(0).join(""), te = (e, t) => e.split(";").map((n) => /\.0?/.test(n) ? n.replace(
1214
+ ).result, n = ge.getInfo(e)._partitions, a = ge.getInfo(t)._partitions, l = r(n[0].tokens), u = r(a[0].tokens), d = r(n[1].tokens), p = r(a[1].tokens);
1215
+ return l === u && d === p && n[1].color === a[1].color;
1216
+ }, gn = (e) => new Array(Math.min(Math.max(0, Number(e)), 30)).fill(0).join(""), ee = (e, t) => e.split(";").map((n) => /\.0?/.test(n) ? n.replace(
1134
1217
  /\.0*/g,
1135
- `${t > 0 ? "." : ""}${dn(Number(t || 0))}`
1218
+ `${t > 0 ? "." : ""}${gn(Number(t || 0))}`
1136
1219
  ) : /0([^0]?)|0$/.test(n) ? n.replace(
1137
1220
  /0([^0]+)|0$/,
1138
- `0${t > 0 ? "." : ""}${dn(Number(t || 0))}$1`
1139
- ) : n).join(";"), Gr = (e) => /\.0?/.test(e) || /0([^0]?)|0$/.test(e), Cn = {
1221
+ `0${t > 0 ? "." : ""}${gn(Number(t || 0))}$1`
1222
+ ) : n).join(";"), ns = (e) => /\.0?/.test(e) || /0([^0]?)|0$/.test(e), Pn = {
1140
1223
  id: "sheet.command.numfmt.add.decimal.command",
1141
- type: ze.COMMAND,
1224
+ type: He.COMMAND,
1142
1225
  handler: async (e) => {
1143
- const t = e.get(je), a = e.get(Ve), n = e.get(be), i = e.get(ge), l = a.getSelections();
1226
+ const t = e.get(Ce), r = e.get(Ve), n = e.get(ye), a = e.get(ve), l = r.getSelections();
1144
1227
  if (!l || !l.length)
1145
1228
  return !1;
1146
- const u = i.getCurrentUniverSheetInstance(), d = u.getActiveSheet(), m = u.getUnitId(), v = d.getSheetId();
1229
+ const u = a.getCurrentUniverSheetInstance(), d = u.getActiveSheet(), p = u.getUnitId(), v = d.getSheetId();
1147
1230
  let h = 0;
1148
1231
  l.forEach((D) => {
1149
- ne.foreach(D.range, (P, R) => {
1150
- const A = n.getValue(m, v, P, R);
1151
- if (!A)
1232
+ ne.foreach(D.range, (E, R) => {
1233
+ const U = n.getValue(p, v, E, R);
1234
+ if (!U)
1152
1235
  return;
1153
- const V = Me(A.pattern);
1236
+ const V = Re(U.pattern);
1154
1237
  h = V > h ? V : h;
1155
1238
  });
1156
1239
  });
1157
- const f = h + 1, b = te(`0${f > 0 ? ".0" : ""}`, f), I = [];
1240
+ const f = h + 1, b = ee(`0${f > 0 ? ".0" : ""}`, f), I = [];
1158
1241
  return l.forEach((D) => {
1159
- ne.foreach(D.range, (P, R) => {
1160
- const A = n.getValue(m, v, P, R);
1161
- if (!A || Be(A.pattern, "0.0"))
1242
+ ne.foreach(D.range, (E, R) => {
1243
+ const U = n.getValue(p, v, E, R);
1244
+ if (!U || Be(U.pattern, "0.0"))
1162
1245
  I.push({
1163
- row: P,
1246
+ row: E,
1164
1247
  col: R,
1165
1248
  pattern: b
1166
1249
  });
1167
1250
  else {
1168
- const V = Me(A.pattern), W = te(A.pattern, V + 1);
1169
- W !== A.pattern && I.push({
1170
- row: P,
1251
+ const V = Re(U.pattern), W = ee(U.pattern, V + 1);
1252
+ W !== U.pattern && I.push({
1253
+ row: E,
1171
1254
  col: R,
1172
1255
  pattern: W
1173
1256
  });
1174
1257
  }
1175
1258
  });
1176
- }), I.length ? await t.executeCommand(Ue.id, { values: I }) : !1;
1259
+ }), I.length ? await t.executeCommand(Le.id, { values: I }) : !1;
1177
1260
  }
1178
- }, Kr = [
1261
+ }, rs = [
1179
1262
  {
1180
1263
  label: "1930-08-05",
1181
1264
  suffix: "yyyy-MM-dd"
@@ -1220,7 +1303,7 @@ const he = /* @__PURE__ */ Br(Wr), Me = (e, t = 0) => e ? he.getInfo(e).maxDecim
1220
1303
  label: "08-05 下午 01:30",
1221
1304
  suffix: "MM-dd A/P hh:mm"
1222
1305
  }
1223
- ], Zr = [
1306
+ ], ss = [
1224
1307
  {
1225
1308
  label: "(1,235)",
1226
1309
  suffix: "#,##0_);(#,##0)"
@@ -1248,7 +1331,7 @@ const he = /* @__PURE__ */ Br(Wr), Me = (e, t = 0) => e ? he.getInfo(e).maxDecim
1248
1331
  suffix: "#,##0.00_);[Red]-#,##0.00",
1249
1332
  color: "red"
1250
1333
  }
1251
- ], Mn = [
1334
+ ], Dn = [
1252
1335
  {
1253
1336
  label: (e) => `${e}1,235`,
1254
1337
  suffix: (e) => `"${e}"#,##0.00_);"${e}"#,##0.00`
@@ -1276,74 +1359,74 @@ const he = /* @__PURE__ */ Br(Wr), Me = (e, t = 0) => e ? he.getInfo(e).maxDecim
1276
1359
  suffix: (e) => `"${e}"#,##0.00_);[Red]-"${e}"#,##0.00`,
1277
1360
  color: "red"
1278
1361
  }
1279
- ], jn = {
1362
+ ], On = {
1280
1363
  id: "sheet.command.numfmt.set.currency",
1281
- type: ze.COMMAND,
1364
+ type: He.COMMAND,
1282
1365
  handler: async (e) => {
1283
- const t = e.get(je), n = e.get(Ve).getSelections();
1366
+ const t = e.get(Ce), n = e.get(Ve).getSelections();
1284
1367
  if (!n || !n.length)
1285
1368
  return !1;
1286
- const i = [], l = Mn[0].suffix("¥");
1369
+ const a = [], l = Dn[0].suffix("¥");
1287
1370
  return n.forEach((d) => {
1288
- ne.foreach(d.range, (m, v) => {
1289
- i.push({ row: m, col: v, pattern: l, type: "currency" });
1371
+ ne.foreach(d.range, (p, v) => {
1372
+ a.push({ row: p, col: v, pattern: l, type: "currency" });
1290
1373
  });
1291
- }), await t.executeCommand(Ue.id, { values: i });
1374
+ }), await t.executeCommand(Le.id, { values: a });
1292
1375
  }
1293
- }, xn = {
1376
+ }, En = {
1294
1377
  id: "sheet.command.numfmt.subtract.decimal.command",
1295
- type: ze.COMMAND,
1378
+ type: He.COMMAND,
1296
1379
  handler: async (e) => {
1297
- const t = e.get(je), a = e.get(Ve), n = e.get(be), i = e.get(ge), l = a.getSelections();
1380
+ const t = e.get(Ce), r = e.get(Ve), n = e.get(ye), a = e.get(ve), l = r.getSelections();
1298
1381
  if (!l || !l.length)
1299
1382
  return !1;
1300
- const u = i.getCurrentUniverSheetInstance(), d = u.getActiveSheet(), m = u.getUnitId(), v = d.getSheetId();
1383
+ const u = a.getCurrentUniverSheetInstance(), d = u.getActiveSheet(), p = u.getUnitId(), v = d.getSheetId();
1301
1384
  let h = 0;
1302
- l.forEach((P) => {
1303
- ne.foreach(P.range, (R, A) => {
1304
- const V = n.getValue(m, v, R, A);
1385
+ l.forEach((E) => {
1386
+ ne.foreach(E.range, (R, U) => {
1387
+ const V = n.getValue(p, v, R, U);
1305
1388
  if (!V)
1306
1389
  return;
1307
- const W = Me(V.pattern);
1390
+ const W = Re(V.pattern);
1308
1391
  h = W > h ? W : h;
1309
1392
  });
1310
1393
  });
1311
- const f = h - 1, b = te(`0${f > 0 ? ".0" : "."}`, f), I = [];
1312
- return l.forEach((P) => {
1313
- ne.foreach(P.range, (R, A) => {
1314
- const V = n.getValue(m, v, R, A);
1394
+ const f = h - 1, b = ee(`0${f > 0 ? ".0" : "."}`, f), I = [];
1395
+ return l.forEach((E) => {
1396
+ ne.foreach(E.range, (R, U) => {
1397
+ const V = n.getValue(p, v, R, U);
1315
1398
  if (!V || Be(V.pattern, "0.0"))
1316
1399
  I.push({
1317
1400
  row: R,
1318
- col: A,
1401
+ col: U,
1319
1402
  pattern: b
1320
1403
  });
1321
1404
  else {
1322
- const W = Me(V.pattern);
1405
+ const W = Re(V.pattern);
1323
1406
  I.push({
1324
1407
  row: R,
1325
- col: A,
1326
- pattern: te(V.pattern, W - 1)
1408
+ col: U,
1409
+ pattern: ee(V.pattern, W - 1)
1327
1410
  });
1328
1411
  }
1329
1412
  });
1330
- }), await t.executeCommand(Ue.id, { values: I });
1413
+ }), await t.executeCommand(Le.id, { values: I });
1331
1414
  }
1332
- }, Dt = {
1415
+ }, Ft = {
1333
1416
  id: "sheet.operation.close.numfmt.panel",
1334
- type: ze.OPERATION,
1417
+ type: He.OPERATION,
1335
1418
  handler: () => (
1336
1419
  // do nothing,just notify panel is closed
1337
1420
  !0
1338
1421
  )
1339
- }, Ht = Cr("INumfmtController");
1340
- er(Ee.Rendered, Ht);
1341
- const vt = {
1422
+ }, Kt = wr("INumfmtController");
1423
+ or(_e.Rendered, Kt);
1424
+ const Ct = {
1342
1425
  id: "sheet.operation.open.numfmt.panel",
1343
- type: ze.OPERATION,
1344
- handler: (e) => (e.get(Ht).openPanel(), !0)
1426
+ type: He.OPERATION,
1427
+ handler: (e) => (e.get(Kt).openPanel(), !0)
1345
1428
  };
1346
- var In = { exports: {} }, xt = {};
1429
+ var Nn = { exports: {} }, Ot = {};
1347
1430
  /**
1348
1431
  * @license React
1349
1432
  * react-jsx-runtime.production.min.js
@@ -1353,23 +1436,23 @@ var In = { exports: {} }, xt = {};
1353
1436
  * This source code is licensed under the MIT license found in the
1354
1437
  * LICENSE file in the root directory of this source tree.
1355
1438
  */
1356
- var qr = $r, Qr = Symbol.for("react.element"), Xr = Symbol.for("react.fragment"), es = Object.prototype.hasOwnProperty, ts = qr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, ns = { key: !0, ref: !0, __self: !0, __source: !0 };
1357
- function Rn(e, t, a) {
1358
- var n, i = {}, l = null, u = null;
1359
- a !== void 0 && (l = "" + a), t.key !== void 0 && (l = "" + t.key), t.ref !== void 0 && (u = t.ref);
1439
+ var as = Hr, is = Symbol.for("react.element"), os = Symbol.for("react.fragment"), cs = Object.prototype.hasOwnProperty, ls = as.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, us = { key: !0, ref: !0, __self: !0, __source: !0 };
1440
+ function kn(e, t, r) {
1441
+ var n, a = {}, l = null, u = null;
1442
+ r !== void 0 && (l = "" + r), t.key !== void 0 && (l = "" + t.key), t.ref !== void 0 && (u = t.ref);
1360
1443
  for (n in t)
1361
- es.call(t, n) && !ns.hasOwnProperty(n) && (i[n] = t[n]);
1444
+ cs.call(t, n) && !us.hasOwnProperty(n) && (a[n] = t[n]);
1362
1445
  if (e && e.defaultProps)
1363
1446
  for (n in t = e.defaultProps, t)
1364
- i[n] === void 0 && (i[n] = t[n]);
1365
- return { $$typeof: Qr, type: e, key: l, ref: u, props: i, _owner: ts.current };
1447
+ a[n] === void 0 && (a[n] = t[n]);
1448
+ return { $$typeof: is, type: e, key: l, ref: u, props: a, _owner: ls.current };
1366
1449
  }
1367
- xt.Fragment = Xr;
1368
- xt.jsx = Rn;
1369
- xt.jsxs = Rn;
1370
- In.exports = xt;
1371
- var O = In.exports;
1372
- const Vt = Ar([]), Nt = [
1450
+ Ot.Fragment = os;
1451
+ Ot.jsx = kn;
1452
+ Ot.jsxs = kn;
1453
+ Nn.exports = Ot;
1454
+ var O = Nn.exports;
1455
+ const Zt = Vr([]), zt = [
1373
1456
  "$",
1374
1457
  "£",
1375
1458
  "¥",
@@ -1398,12 +1481,12 @@ const Vt = Ar([]), Nt = [
1398
1481
  "₾",
1399
1482
  "₿"
1400
1483
  ];
1401
- var rs = Object.defineProperty, ss = Object.getOwnPropertyDescriptor, as = (e, t, a, n) => {
1402
- for (var i = n > 1 ? void 0 : n ? ss(t, a) : t, l = e.length - 1, u; l >= 0; l--)
1403
- (u = e[l]) && (i = (n ? u(t, a, i) : u(i)) || i);
1404
- return n && i && rs(t, a, i), i;
1405
- }, is = (e, t) => (a, n) => t(a, n, e);
1406
- let _t = class {
1484
+ var ds = Object.defineProperty, ms = Object.getOwnPropertyDescriptor, ps = (e, t, r, n) => {
1485
+ for (var a = n > 1 ? void 0 : n ? ms(t, r) : t, l = e.length - 1, u; l >= 0; l--)
1486
+ (u = e[l]) && (a = (n ? u(t, r, a) : u(a)) || a);
1487
+ return n && a && ds(t, r, a), a;
1488
+ }, fs = (e, t) => (r, n) => t(r, n, e);
1489
+ let Mt = class {
1407
1490
  constructor(e) {
1408
1491
  this._localStorageService = e;
1409
1492
  }
@@ -1411,34 +1494,34 @@ let _t = class {
1411
1494
  return `userHabitController_${e}`;
1412
1495
  }
1413
1496
  async addHabit(e, t) {
1414
- const a = this._getKey(e);
1415
- return this._localStorageService.getItem(a).then((n) => {
1416
- n || this._localStorageService.setItem(a, t);
1497
+ const r = this._getKey(e);
1498
+ return this._localStorageService.getItem(r).then((n) => {
1499
+ n || this._localStorageService.setItem(r, t);
1417
1500
  });
1418
1501
  }
1419
1502
  markHabit(e, t) {
1420
- const a = this._getKey(e);
1421
- this._localStorageService.getItem(a).then((n) => {
1503
+ const r = this._getKey(e);
1504
+ this._localStorageService.getItem(r).then((n) => {
1422
1505
  if (n) {
1423
- const i = n.findIndex((l) => l === t);
1424
- i > -1 && n.splice(i, 1), n.unshift(t), this._localStorageService.setItem(a, n);
1506
+ const a = n.findIndex((l) => l === t);
1507
+ a > -1 && n.splice(a, 1), n.unshift(t), this._localStorageService.setItem(r, n);
1425
1508
  }
1426
1509
  });
1427
1510
  }
1428
1511
  async getHabit(e, t) {
1429
- const a = this._getKey(e), n = await this._localStorageService.getItem(a);
1512
+ const r = this._getKey(e), n = await this._localStorageService.getItem(r);
1430
1513
  if (t && n) {
1431
- const i = n.map((l, u, d) => {
1432
- const m = d.length;
1514
+ const a = n.map((l, u, d) => {
1515
+ const p = d.length;
1433
1516
  return {
1434
1517
  value: l,
1435
- priority: m - u
1518
+ priority: p - u
1436
1519
  };
1437
1520
  });
1438
1521
  return t.sort((l, u) => {
1439
1522
  var v, h;
1440
- const d = ((v = i.find((f) => f.value === l)) == null ? void 0 : v.priority) || -1;
1441
- return (((h = i.find((f) => f.value === u)) == null ? void 0 : h.priority) || -1) - d;
1523
+ const d = ((v = a.find((f) => f.value === l)) == null ? void 0 : v.priority) || -1;
1524
+ return (((h = a.find((f) => f.value === u)) == null ? void 0 : h.priority) || -1) - d;
1442
1525
  });
1443
1526
  }
1444
1527
  return n || [];
@@ -1447,131 +1530,125 @@ let _t = class {
1447
1530
  this._localStorageService.removeItem(e);
1448
1531
  }
1449
1532
  };
1450
- _t = as([
1451
- is(0, z(tr))
1452
- ], _t);
1453
- const mn = "numfmtCurrency", os = (e) => {
1454
- const t = de(_t), [a, n] = ie(Nt);
1455
- return $t(() => {
1533
+ Mt = ps([
1534
+ fs(0, $(cr))
1535
+ ], Mt);
1536
+ const vn = "numfmtCurrency", hs = (e) => {
1537
+ const t = de(Mt), [r, n] = ie(zt);
1538
+ return Vt(() => {
1456
1539
  t.addHabit("numfmtCurrency", []).then(() => {
1457
- t.getHabit(mn, [...Nt]).then((l) => {
1540
+ t.getHabit(vn, [...zt]).then((l) => {
1458
1541
  n(l), e && e(l);
1459
1542
  });
1460
1543
  });
1461
- }, []), { userHabitCurrency: a, mark: (l) => {
1462
- t.markHabit(mn, l);
1544
+ }, []), { userHabitCurrency: r, mark: (l) => {
1545
+ t.markHabit(vn, l);
1463
1546
  } };
1464
- }, cs = () => {
1465
- const e = At([]), [t, a] = ie({});
1466
- return $t(() => {
1467
- e.current.forEach((i) => {
1468
- i();
1547
+ }, gs = () => {
1548
+ const e = Yt([]), [t, r] = ie({});
1549
+ return Vt(() => {
1550
+ e.current.forEach((a) => {
1551
+ a();
1469
1552
  }), e.current = [];
1470
- }, [t]), (i) => {
1471
- e.current.push(i), a({});
1553
+ }, [t]), (a) => {
1554
+ e.current.push(a), r({});
1472
1555
  };
1473
- }, et = (e) => Nt.find((a) => e.includes(a)), ls = (e) => !!et(e) && e.startsWith("_("), us = (e) => {
1474
- const [t, a] = ie(() => Me(e.defaultPattern || "", 2)), n = bn(Vt), [i, l] = ie(() => et(e.defaultPattern) || n[0]), u = ye(() => n.map((f) => ({ label: f, value: f })), []), m = de(ve).t;
1475
- e.action.current = () => te(`_("${i}"* #,##0${t > 0 ? ".0" : ""}_)`, t);
1556
+ }, nt = (e) => zt.find((r) => e.includes(r)), vs = (e) => !!nt(e) && e.startsWith("_("), _s = (e) => {
1557
+ const [t, r] = ie(() => Re(e.defaultPattern || "", 2)), n = In(Zt), [a, l] = ie(() => nt(e.defaultPattern) || n[0]), u = Se(() => n.map((f) => ({ label: f, value: f })), []), p = de(me).t;
1558
+ e.action.current = () => ee(`_("${a}"* #,##0${t > 0 ? ".0" : ""}_)`, t);
1476
1559
  const v = (f) => {
1477
- l(f), e.onChange(te(`_("${f}"* #,##0${t > 0 ? ".0" : ""}_)`, t));
1560
+ l(f), e.onChange(ee(`_("${f}"* #,##0${t > 0 ? ".0" : ""}_)`, t));
1478
1561
  }, h = (f) => {
1479
1562
  const b = f || 0;
1480
- a(b), e.onChange(te(`_("${i}"* #,##0${b > 0 ? ".0" : ""}_)`, b));
1563
+ r(b), e.onChange(ee(`_("${a}"* #,##0${b > 0 ? ".0" : ""}_)`, b));
1481
1564
  };
1482
1565
  return /* @__PURE__ */ O.jsxs("div", { children: [
1483
1566
  /* @__PURE__ */ O.jsxs("div", { className: "m-t-16 options ", children: [
1484
1567
  /* @__PURE__ */ O.jsxs("div", { className: "option", children: [
1485
- /* @__PURE__ */ O.jsx("div", { className: "label", children: m("sheet.numfmt.decimalLength") }),
1486
- /* @__PURE__ */ O.jsx("div", { className: "m-t-8 w-120", children: /* @__PURE__ */ O.jsx(Ut, { value: t, max: 20, min: 0, onChange: h }) })
1568
+ /* @__PURE__ */ O.jsx("div", { className: "label", children: p("sheet.numfmt.decimalLength") }),
1569
+ /* @__PURE__ */ O.jsx("div", { className: "m-t-8 w-120", children: /* @__PURE__ */ O.jsx(Bt, { value: t, max: 20, min: 0, onChange: h }) })
1487
1570
  ] }),
1488
1571
  /* @__PURE__ */ O.jsxs("div", { className: "option", children: [
1489
- /* @__PURE__ */ O.jsx("div", { className: "label", children: m("sheet.numfmt.currencyType") }),
1490
- /* @__PURE__ */ O.jsx("div", { className: "m-t-8 w-140", children: /* @__PURE__ */ O.jsx(zt, { onChange: v, options: u, value: i }) })
1572
+ /* @__PURE__ */ O.jsx("div", { className: "label", children: p("sheet.numfmt.currencyType") }),
1573
+ /* @__PURE__ */ O.jsx("div", { className: "m-t-8 w-140", children: /* @__PURE__ */ O.jsx(Jt, { onChange: v, options: u, value: a }) })
1491
1574
  ] })
1492
1575
  ] }),
1493
- /* @__PURE__ */ O.jsx("div", { className: "describe m-t-14", children: m("sheet.numfmt.accountingDes") })
1576
+ /* @__PURE__ */ O.jsx("div", { className: "describe m-t-14", children: p("sheet.numfmt.accountingDes") })
1494
1577
  ] });
1495
- }, Ot = (e) => Mn.map((t) => ({
1578
+ }, $t = (e) => Dn.map((t) => ({
1496
1579
  label: t.label(e),
1497
1580
  value: t.suffix(e),
1498
1581
  color: t.color
1499
- })), wn = () => Kr.map((e) => ({ label: e.label, value: e.suffix })), kn = () => Zr.map((e) => ({ label: e.label, value: e.suffix, color: e.color })), ds = (e) => !!et(e) && !e.startsWith("_("), ms = (e) => {
1500
- const a = de(ve).t, n = bn(Vt), [i, l] = ie(() => et(e.defaultPattern) || n[0]), [u, d] = ie(() => Me(e.defaultPattern || "", 2)), [m, v] = ie(() => {
1501
- var A;
1502
- const P = Ot(i);
1503
- return ((A = P.find((V) => Be(V.value, e.defaultPattern))) == null ? void 0 : A.value) || P[0].value;
1504
- }), h = ye(() => Ot(i), [i]), f = ye(() => n.map((P) => ({ label: P, value: P })), [n]);
1505
- e.action.current = () => te(m, u);
1506
- const b = (P) => {
1507
- l(P);
1508
- const R = Ot(P)[0].value;
1509
- v(R), e.onChange(te(R, u));
1510
- }, I = (P) => {
1511
- v(P), e.onChange(te(P, u));
1512
- }, D = (P) => {
1513
- d(P || 0), e.onChange(te(m, P || 0));
1582
+ })), Tn = () => rs.map((e) => ({ label: e.label, value: e.suffix })), Fn = () => ss.map((e) => ({ label: e.label, value: e.suffix, color: e.color })), ys = (e) => !!nt(e) && !e.startsWith("_("), bs = (e) => {
1583
+ const r = de(me).t, n = In(Zt), [a, l] = ie(() => nt(e.defaultPattern) || n[0]), [u, d] = ie(() => Re(e.defaultPattern || "", 2)), [p, v] = ie(() => {
1584
+ var U;
1585
+ const E = $t(a);
1586
+ return ((U = E.find((V) => Be(V.value, e.defaultPattern))) == null ? void 0 : U.value) || E[0].value;
1587
+ }), h = Se(() => $t(a), [a]), f = Se(() => n.map((E) => ({ label: E, value: E })), [n]);
1588
+ e.action.current = () => ee(p, u);
1589
+ const b = (E) => {
1590
+ l(E);
1591
+ const R = $t(E)[0].value;
1592
+ v(R), e.onChange(ee(R, u));
1593
+ }, I = (E) => {
1594
+ v(E), e.onChange(ee(E, u));
1595
+ }, D = (E) => {
1596
+ d(E || 0), e.onChange(ee(p, E || 0));
1514
1597
  };
1515
1598
  return /* @__PURE__ */ O.jsxs("div", { children: [
1516
1599
  /* @__PURE__ */ O.jsxs("div", { className: "m-t-16 options ", children: [
1517
1600
  /* @__PURE__ */ O.jsxs("div", { className: "option", children: [
1518
- /* @__PURE__ */ O.jsx("div", { className: "label", children: a("sheet.numfmt.decimalLength") }),
1519
- /* @__PURE__ */ O.jsx("div", { className: "m-t-8 w-120", children: /* @__PURE__ */ O.jsx(Ut, { value: u, max: 20, min: 0, onChange: D }) })
1601
+ /* @__PURE__ */ O.jsx("div", { className: "label", children: r("sheet.numfmt.decimalLength") }),
1602
+ /* @__PURE__ */ O.jsx("div", { className: "m-t-8 w-120", children: /* @__PURE__ */ O.jsx(Bt, { value: u, max: 20, min: 0, onChange: D }) })
1520
1603
  ] }),
1521
1604
  /* @__PURE__ */ O.jsxs("div", { className: "option", children: [
1522
- /* @__PURE__ */ O.jsxs("div", { className: "label", children: [
1523
- " ",
1524
- a("sheet.numfmt.currencyType")
1525
- ] }),
1526
- /* @__PURE__ */ O.jsx("div", { className: "m-t-8 w-140", children: /* @__PURE__ */ O.jsx(zt, { onChange: b, options: f, value: i }) })
1605
+ /* @__PURE__ */ O.jsx("div", { className: "label", children: r("sheet.numfmt.currencyType") }),
1606
+ /* @__PURE__ */ O.jsx("div", { className: "m-t-8 w-140", children: /* @__PURE__ */ O.jsx(Jt, { onChange: b, options: f, value: a }) })
1527
1607
  ] })
1528
1608
  ] }),
1529
- /* @__PURE__ */ O.jsxs("div", { className: "m-t-16 label", children: [
1530
- " ",
1531
- a("sheet.numfmt.negType")
1532
- ] }),
1533
- /* @__PURE__ */ O.jsx("div", { className: "m-t-8", children: /* @__PURE__ */ O.jsx(Lt, { onChange: I, options: h, value: m }) }),
1534
- /* @__PURE__ */ O.jsx("div", { className: "describe m-t-14", children: a("sheet.numfmt.currencyDes") })
1609
+ /* @__PURE__ */ O.jsx("div", { className: "m-t-16 label", children: r("sheet.numfmt.negType") }),
1610
+ /* @__PURE__ */ O.jsx("div", { className: "m-t-8", children: /* @__PURE__ */ O.jsx(Wt, { onChange: I, options: h, value: p }) }),
1611
+ /* @__PURE__ */ O.jsx("div", { className: "describe m-t-14", children: r("sheet.numfmt.currencyDes") })
1535
1612
  ] });
1536
- }, ps = (e) => {
1537
- const t = he.getInfo(e);
1538
- return wn().map((a) => a.value).includes(e) || ["date", "datetime", "time"].includes(t.type);
1539
- }, fs = (e) => {
1540
- const t = ye(wn, []), n = de(ve).t, [i, l] = ie(() => {
1613
+ }, Ss = (e) => {
1614
+ const t = ge.getInfo(e);
1615
+ return Tn().map((r) => r.value).includes(e) || ["date", "datetime", "time"].includes(t.type);
1616
+ }, Cs = (e) => {
1617
+ const t = Se(Tn, []), n = de(me).t, [a, l] = ie(() => {
1541
1618
  if (e.defaultPattern) {
1542
- const d = t.find((m) => m.value === e.defaultPattern);
1619
+ const d = t.find((p) => p.value === e.defaultPattern);
1543
1620
  if (d)
1544
1621
  return d.value;
1545
1622
  }
1546
1623
  return t[0].value;
1547
1624
  });
1548
- e.action.current = () => i;
1625
+ e.action.current = () => a;
1549
1626
  const u = (d) => {
1550
1627
  l(d), e.onChange(d);
1551
1628
  };
1552
1629
  return /* @__PURE__ */ O.jsxs("div", { children: [
1553
1630
  /* @__PURE__ */ O.jsx("div", { className: "m-t-16 label", children: n("sheet.numfmt.dateType") }),
1554
- /* @__PURE__ */ O.jsx("div", { className: "m-t-8", children: /* @__PURE__ */ O.jsx(Lt, { value: i, options: t, onChange: u }) }),
1631
+ /* @__PURE__ */ O.jsx("div", { className: "m-t-8", children: /* @__PURE__ */ O.jsx(Wt, { value: a, options: t, onChange: u }) }),
1555
1632
  /* @__PURE__ */ O.jsx("div", { className: "describe m-t-14", children: n("sheet.numfmt.dateDes") })
1556
1633
  ] });
1557
- }, hs = (e) => !e, gs = (e) => {
1558
- const a = de(ve).t;
1559
- return e.action.current = () => "", /* @__PURE__ */ O.jsx("div", { children: /* @__PURE__ */ O.jsx("div", { className: "describe m-t-14", children: a("sheet.numfmt.generalDes") }) });
1560
- }, vs = (e) => kn().some((t) => Be(t.value, e)), _s = (e) => {
1561
- const t = de(ve), a = ye(kn, []), [n, i] = ie(() => Me(e.defaultPattern || "", 0)), [l, u] = ie(() => {
1562
- const f = a.find((b) => Be(b.value, e.defaultPattern || ""));
1563
- return (f == null ? void 0 : f.value) || a[0].value;
1564
- }), d = ye(() => te(l, Number(n || 0)), [l, n]), m = ye(() => !Gr(l), [l]), v = (f) => {
1565
- i(f || 0), e.onChange(te(l, Number(f || 0)));
1634
+ }, Ms = (e) => !e, js = (e) => {
1635
+ const r = de(me).t;
1636
+ return e.action.current = () => "", /* @__PURE__ */ O.jsx("div", { children: /* @__PURE__ */ O.jsx("div", { className: "describe m-t-14", children: r("sheet.numfmt.generalDes") }) });
1637
+ }, xs = (e) => Fn().some((t) => Be(t.value, e)), Is = (e) => {
1638
+ const t = de(me), r = Se(Fn, []), [n, a] = ie(() => Re(e.defaultPattern || "", 0)), [l, u] = ie(() => {
1639
+ const f = r.find((b) => Be(b.value, e.defaultPattern || ""));
1640
+ return (f == null ? void 0 : f.value) || r[0].value;
1641
+ }), d = Se(() => ee(l, Number(n || 0)), [l, n]), p = Se(() => !ns(l), [l]), v = (f) => {
1642
+ a(f || 0), e.onChange(ee(l, Number(f || 0)));
1566
1643
  }, h = (f) => {
1567
- i(Me(f, 0)), u(f), e.onChange(f);
1644
+ a(Re(f, 0)), u(f), e.onChange(f);
1568
1645
  };
1569
1646
  return e.action.current = () => d, /* @__PURE__ */ O.jsxs("div", { children: [
1570
1647
  /* @__PURE__ */ O.jsx("div", { className: "m-t-16 label", children: t.t("sheet.numfmt.decimalLength") }),
1571
1648
  /* @__PURE__ */ O.jsx("div", { className: "m-t-8", children: /* @__PURE__ */ O.jsx(
1572
- Ut,
1649
+ Bt,
1573
1650
  {
1574
- disabled: m,
1651
+ disabled: p,
1575
1652
  value: n,
1576
1653
  max: 20,
1577
1654
  min: 0,
@@ -1582,739 +1659,319 @@ const mn = "numfmtCurrency", os = (e) => {
1582
1659
  " ",
1583
1660
  t.t("sheet.numfmt.negType")
1584
1661
  ] }),
1585
- /* @__PURE__ */ O.jsx("div", { className: "m-t-8", children: /* @__PURE__ */ O.jsx(Lt, { onChange: h, options: a, value: l }) }),
1662
+ /* @__PURE__ */ O.jsx("div", { className: "m-t-8", children: /* @__PURE__ */ O.jsx(Wt, { onChange: h, options: r, value: l }) }),
1586
1663
  /* @__PURE__ */ O.jsx("div", { className: "describe m-t-14", children: t.t("sheet.numfmt.thousandthPercentileDes") })
1587
1664
  ] });
1588
- }, ys = (e) => {
1589
- const { defaultValue: t, defaultPattern: a, row: n, col: i } = e.value, l = de(ve), u = At(() => ""), d = l.t, m = cs(), v = ye(
1665
+ }, Rs = (e) => {
1666
+ const { defaultValue: t, defaultPattern: r, row: n, col: a } = e.value, l = de(me), u = Yt(() => ""), d = l.t, p = gs(), v = Se(
1590
1667
  () => [
1591
- { label: "sheet.numfmt.general", component: gs },
1592
- { label: "sheet.numfmt.accounting", component: us },
1593
- { label: "sheet.numfmt.currency", component: ms },
1594
- { label: "sheet.numfmt.date", component: fs },
1595
- { label: "sheet.numfmt.thousandthPercentile", component: _s }
1668
+ { label: "sheet.numfmt.general", component: js },
1669
+ { label: "sheet.numfmt.accounting", component: _s },
1670
+ { label: "sheet.numfmt.currency", component: bs },
1671
+ { label: "sheet.numfmt.date", component: Cs },
1672
+ { label: "sheet.numfmt.thousandthPercentile", component: Is }
1596
1673
  ].map((G) => ({ ...G, label: d(G.label) })),
1597
1674
  []
1598
- ), [h, f] = ie(A), [b, I] = ie(() => `${n}_${i}`), { mark: D, userHabitCurrency: P } = os(() => I(`${n}_${i}_userCurrency'`)), R = ye(() => {
1675
+ ), [h, f] = ie(U), [b, I] = ie(() => `${n}_${a}`), { mark: D, userHabitCurrency: E } = hs(() => I(`${n}_${a}_userCurrency'`)), R = Se(() => {
1599
1676
  var G;
1600
- return (G = v.find((pe) => pe.label === h)) == null ? void 0 : G.component;
1677
+ return (G = v.find((fe) => fe.label === h)) == null ? void 0 : G.component;
1601
1678
  }, [h]);
1602
- function A() {
1603
- return [hs, ls, ds, ps, vs].reduce((pe, Te, Z) => pe || (Te(a) ? v[Z].label : ""), "") || v[0].label;
1679
+ function U() {
1680
+ return [Ms, vs, ys, Ss, xs].reduce((fe, $e, Z) => fe || ($e(r) ? v[Z].label : ""), "") || v[0].label;
1604
1681
  }
1605
1682
  const V = v.map((G) => ({
1606
1683
  label: G.label,
1607
1684
  value: G.label
1608
1685
  })), W = (G) => {
1609
- f(G), m(() => e.onChange({ type: "change", value: u.current() || "" }));
1686
+ f(G), p(() => e.onChange({ type: "change", value: u.current() || "" }));
1610
1687
  }, Q = (G) => {
1611
1688
  e.onChange({ type: "change", value: G });
1612
- }, me = () => {
1613
- const G = u.current() || "", pe = et(G);
1614
- pe && D(pe), e.onChange({ type: "confirm", value: G });
1615
- }, xe = () => {
1689
+ }, pe = () => {
1690
+ const G = u.current() || "", fe = nt(G);
1691
+ fe && D(fe), e.onChange({ type: "confirm", value: G });
1692
+ }, Pe = () => {
1616
1693
  e.onChange({ type: "cancel", value: "" });
1617
- }, Ie = {
1694
+ }, De = {
1618
1695
  onChange: Q,
1619
1696
  defaultValue: t,
1620
- defaultPattern: a,
1697
+ defaultPattern: r,
1621
1698
  action: u
1622
1699
  };
1623
- return $t(() => {
1624
- f(A()), I(`${n}_${i}`);
1625
- }, [n, i]), /* @__PURE__ */ O.jsxs("div", { className: "numfmt-panel p-b-20", children: [
1700
+ return Vt(() => {
1701
+ f(U()), I(`${n}_${a}`);
1702
+ }, [n, a]), /* @__PURE__ */ O.jsxs("div", { className: "numfmt-panel p-b-20", children: [
1626
1703
  /* @__PURE__ */ O.jsxs("div", { children: [
1627
1704
  /* @__PURE__ */ O.jsx("div", { className: "label m-t-14", children: d("sheet.numfmt.numfmtType") }),
1628
- /* @__PURE__ */ O.jsx("div", { className: "m-t-8", children: /* @__PURE__ */ O.jsx(zt, { onChange: W, options: V, value: h }) }),
1629
- /* @__PURE__ */ O.jsx("div", { children: R && /* @__PURE__ */ O.jsx(Vt.Provider, { value: P, children: /* @__PURE__ */ Ye(R, { ...Ie, key: b }) }) })
1705
+ /* @__PURE__ */ O.jsx("div", { className: "m-t-8", children: /* @__PURE__ */ O.jsx(Jt, { onChange: W, options: V, value: h }) }),
1706
+ /* @__PURE__ */ O.jsx("div", { children: R && /* @__PURE__ */ O.jsx(Zt.Provider, { value: E, children: /* @__PURE__ */ Ye(R, { ...De, key: b }) }) })
1630
1707
  ] }),
1631
1708
  /* @__PURE__ */ O.jsxs("div", { className: "btn-list m-t-14 m-b-20", children: [
1632
- /* @__PURE__ */ O.jsx(un, { size: "small", onClick: xe, className: "m-r-12", children: d("sheet.numfmt.cancel") }),
1633
- /* @__PURE__ */ O.jsx(un, { type: "primary", size: "small", onClick: me, children: d("sheet.numfmt.confirm") })
1709
+ /* @__PURE__ */ O.jsx(hn, { size: "small", onClick: Pe, className: "m-r-12", children: d("sheet.numfmt.cancel") }),
1710
+ /* @__PURE__ */ O.jsx(hn, { type: "primary", size: "small", onClick: pe, children: d("sheet.numfmt.confirm") })
1634
1711
  ] })
1635
1712
  ] });
1636
1713
  };
1637
- var ae = function() {
1638
- return ae = Object.assign || function(e) {
1639
- for (var t, a = 1, n = arguments.length; a < n; a++) {
1640
- t = arguments[a];
1641
- for (var i in t)
1642
- Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
1643
- }
1644
- return e;
1645
- }, ae.apply(this, arguments);
1646
- }, bs = function(e, t) {
1647
- var a = {};
1648
- for (var n in e)
1649
- Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 && (a[n] = e[n]);
1650
- if (e != null && typeof Object.getOwnPropertySymbols == "function")
1651
- for (var i = 0, n = Object.getOwnPropertySymbols(e); i < n.length; i++)
1652
- t.indexOf(n[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[i]) && (a[n[i]] = e[n[i]]);
1653
- return a;
1654
- }, tt = Xe(function(e, t) {
1655
- var a = e.icon, n = e.id, i = e.className, l = e.extend, u = bs(e, ["icon", "id", "className", "extend"]), d = "univerjs-icon univerjs-icon-".concat(n, " ").concat(i || "").trim(), m = At("_".concat(Ms()));
1656
- return Dn(a, "".concat(n), { defIds: a.defIds, idSuffix: m.current }, ae({ ref: t, className: d }, u), l);
1657
- });
1658
- function Dn(e, t, a, n, i) {
1659
- return Ye(e.tag, ae(ae({ key: t }, Ss(e, a, i)), n), (Cs(e, a).children || []).map(function(l, u) {
1660
- return Dn(l, "".concat(t, "-").concat(e.tag, "-").concat(u), a, void 0, i);
1661
- }));
1662
- }
1663
- function Ss(e, t, a) {
1664
- var n = ae({}, e.attrs);
1665
- a != null && a.colorChannel1 && n.fill === "colorChannel1" && (n.fill = a.colorChannel1);
1666
- var i = t.defIds;
1667
- return !i || i.length === 0 || (e.tag === "use" && n["xlink:href"] && (n["xlink:href"] = n["xlink:href"] + t.idSuffix), Object.entries(n).forEach(function(l) {
1668
- var u = l[0], d = l[1];
1669
- typeof d == "string" && (n[u] = d.replace(/url\(#(.*)\)/, "url(#$1".concat(t.idSuffix, ")")));
1670
- })), n;
1671
- }
1672
- function Cs(e, t) {
1673
- var a, n = t.defIds;
1674
- return !n || n.length === 0 ? e : e.tag === "defs" && (!((a = e.children) === null || a === void 0) && a.length) ? ae(ae({}, e), { children: e.children.map(function(i) {
1675
- return typeof i.attrs.id == "string" && n && n.indexOf(i.attrs.id) > -1 ? ae(ae({}, i), { attrs: ae(ae({}, i.attrs), { id: i.attrs.id + t.idSuffix }) }) : i;
1676
- }) }) : e;
1677
- }
1678
- function Ms() {
1679
- return Math.random().toString(36).substring(2, 8);
1680
- }
1681
- tt.displayName = "UniverIcon";
1682
- var js = {
1683
- tag: "svg",
1684
- attrs: { fill: "none", viewBox: "0 0 17 17", width: "1em", height: "1em" },
1685
- children: [
1686
- {
1687
- tag: "path",
1688
- attrs: {
1689
- fill: "currentColor",
1690
- d: "M4.93152 3.8348C4.93152 2.54613 5.9762 1.50146 7.26485 1.50146 8.55351 1.50146 9.59819 2.54613 9.59819 3.8348V6.46695C9.59819 7.75561 8.55351 8.80028 7.26485 8.80028 5.9762 8.80028 4.93152 7.75561 4.93152 6.46695V3.8348zM7.26485 2.8348C6.71257 2.8348 6.26485 3.28252 6.26485 3.8348V6.46695C6.26485 7.01923 6.71257 7.46695 7.26485 7.46695 7.81713 7.46695 8.26485 7.01923 8.26485 6.46695V3.8348C8.26485 3.28252 7.81713 2.8348 7.26485 2.8348zM10.9315 3.8348C10.9315 2.54613 11.9762 1.50146 13.2649 1.50146 14.5535 1.50146 15.5982 2.54613 15.5982 3.8348V6.46695C15.5982 7.75561 14.5535 8.80028 13.2649 8.80028 11.9762 8.80028 10.9315 7.75561 10.9315 6.46695V3.8348zM13.2649 2.8348C12.7126 2.8348 12.2649 3.28252 12.2649 3.8348V6.46695C12.2649 7.01923 12.7126 7.46695 13.2649 7.46695 13.8171 7.46695 14.2649 7.01923 14.2649 6.46695V3.8348C14.2649 3.28252 13.8171 2.8348 13.2649 2.8348z",
1691
- fillRule: "evenodd",
1692
- clipRule: "evenodd"
1693
- }
1694
- },
1695
- {
1696
- tag: "path",
1697
- attrs: {
1698
- fill: "currentColor",
1699
- d: "M13.403 9.81183C13.1426 9.55148 12.7205 9.55148 12.4602 9.81183 12.1998 10.0722 12.1998 10.4943 12.4602 10.7546L13.3221 11.6166H7.26493C6.89674 11.6166 6.59827 11.915 6.59827 12.2832 6.59827 12.6514 6.89674 12.9499 7.26493 12.9499H13.3221L12.4602 13.8118C12.1998 14.0722 12.1998 14.4943 12.4602 14.7546 12.7205 15.015 13.1426 15.015 13.403 14.7546L15.3985 12.7591C15.4167 12.7412 15.4339 12.7224 15.4499 12.7026 15.48 12.6655 15.5055 12.6259 15.5264 12.5846 15.5724 12.4941 15.5983 12.3917 15.5983 12.2832 15.5983 12.1748 15.5724 12.0724 15.5264 11.9819 15.5055 11.9406 15.48 11.901 15.4499 11.8639 15.4339 11.8441 15.4167 11.8253 15.3986 11.8074L13.403 9.81183zM2.26489 8.21384C2.26489 7.84565 2.56337 7.54717 2.93156 7.54717H3.26489C3.63308 7.54717 3.93156 7.84565 3.93156 8.21384 3.93156 8.58203 3.63308 8.88051 3.26489 8.88051H2.93156C2.56337 8.88051 2.26489 8.58203 2.26489 8.21384z"
1700
- }
1701
- }
1702
- ]
1703
- }, On = Xe(function(e, t) {
1704
- return Ye(tt, Object.assign({}, e, {
1705
- id: "add-digits-single",
1706
- ref: t,
1707
- icon: js
1708
- }));
1709
- });
1710
- On.displayName = "AddDigitsSingle";
1711
- const xs = On;
1712
- var Is = {
1713
- tag: "svg",
1714
- attrs: { fill: "none", viewBox: "0 0 17 17", width: "1em", height: "1em" },
1715
- children: [
1716
- {
1717
- tag: "mask",
1718
- attrs: {
1719
- id: "mask0_102_556",
1720
- style: { maskType: "alpha" },
1721
- width: 17,
1722
- height: 17,
1723
- x: 0,
1724
- y: 0,
1725
- maskUnits: "userSpaceOnUse"
1726
- },
1727
- children: [
1728
- {
1729
- tag: "path",
1730
- attrs: { fill: "#D9D9D9", d: "M0.56 0.77H16.56V16.77H0.56z" }
1714
+ var ws = Object.defineProperty, Ps = Object.getOwnPropertyDescriptor, Ds = (e, t, r, n) => {
1715
+ for (var a = n > 1 ? void 0 : n ? Ps(t, r) : t, l = e.length - 1, u; l >= 0; l--)
1716
+ (u = e[l]) && (a = (n ? u(t, r, a) : u(a)) || a);
1717
+ return n && a && ws(t, r, a), a;
1718
+ }, se = (e, t) => (r, n) => t(r, n, e);
1719
+ let mt = class extends Me {
1720
+ constructor(t, r, n, a, l, u, d, p, v, h, f, b) {
1721
+ super();
1722
+ /**
1723
+ * If _previewPattern is null ,the realTimeRenderingInterceptor will skip and if it is '',realTimeRenderingInterceptor will clear numfmt.
1724
+ * @private
1725
+ * @type {(string | null)}
1726
+ * @memberof NumfmtController
1727
+ */
1728
+ Ne(this, "_previewPattern", "");
1729
+ Ne(this, "openPanel", () => {
1730
+ const t = this._sidebarService, r = this._selectionManagerService, n = this._commandService, a = this._univerInstanceService, l = this._numfmtService, u = this._localeService, p = (r.getSelectionRanges() || [])[0];
1731
+ if (!p)
1732
+ return !1;
1733
+ const v = a.getCurrentUniverSheetInstance(), h = v.getActiveSheet(), f = h.getCellRaw(p.startRow, p.startColumn), b = l.getValue(
1734
+ v.getUnitId(),
1735
+ h.getSheetId(),
1736
+ p.startRow,
1737
+ p.startColumn
1738
+ );
1739
+ let I = "";
1740
+ b && (I = b.pattern);
1741
+ const D = (f == null ? void 0 : f.t) === ze.NUMBER ? f.v : 12345678, E = {
1742
+ onChange: (R) => {
1743
+ var U, V;
1744
+ if (R.type === "change")
1745
+ this._previewPattern = R.value, this._sheetSkeletonManagerService.reCalculate(), (V = (U = this._renderManagerService.getRenderById(v.getUnitId())) == null ? void 0 : U.mainComponent) == null || V.makeDirty();
1746
+ else if (R.type === "confirm") {
1747
+ const W = r.getSelectionRanges() || [], Q = { values: [] }, pe = Gt(R.value);
1748
+ W.forEach((Pe) => {
1749
+ ne.foreach(Pe, (De, G) => {
1750
+ Q.values.push({
1751
+ row: De,
1752
+ col: G,
1753
+ pattern: R.value,
1754
+ type: pe
1755
+ });
1756
+ });
1757
+ }), n.executeCommand(Le.id, Q), t.close();
1758
+ } else
1759
+ R.type === "cancel" && t.close();
1760
+ },
1761
+ value: { defaultPattern: I, defaultValue: D, row: p.startRow, col: p.startColumn }
1762
+ };
1763
+ t.open({
1764
+ header: { title: u.t("sheet.numfmt.title") },
1765
+ children: {
1766
+ label: Qe,
1767
+ ...E
1768
+ // need passthrough to react props.
1769
+ },
1770
+ onClose: () => {
1771
+ var R, U;
1772
+ this._sheetSkeletonManagerService.reCalculate(), (U = (R = this._renderManagerService.getRenderById(v.getUnitId())) == null ? void 0 : R.mainComponent) == null || U.makeDirty(), n.executeCommand(Ft.id);
1731
1773
  }
1732
- ]
1733
- },
1734
- {
1735
- tag: "g",
1736
- attrs: { mask: "url(#mask0_102_556)" },
1737
- children: [
1738
- {
1739
- tag: "path",
1740
- attrs: {
1741
- fill: "currentColor",
1742
- d: "M1.19318 4.76988C1.70089 4.26222 2.524 4.26226 3.03166 4.76997L8.13929 9.87808C8.3736 10.1124 8.75352 10.1124 8.98784 9.8781L14.0959 4.77C14.6036 4.26232 15.4267 4.26232 15.9344 4.77C16.4421 5.27768 16.4421 6.1008 15.9344 6.60848L9.97775 12.5651C9.19667 13.3462 7.93029 13.3462 7.14925 12.5651L1.1931 6.60836C0.685438 6.10065 0.685477 5.27753 1.19318 4.76988Z",
1743
- fillRule: "evenodd",
1744
- clipRule: "evenodd"
1774
+ });
1775
+ });
1776
+ this._sheetInterceptorService = t, this._themeService = r, this._injector = n, this._univerInstanceService = a, this._sheetSkeletonManagerService = l, this._commandService = u, this._selectionManagerService = d, this._renderManagerService = p, this._numfmtService = v, this._componentManager = h, this._sidebarService = f, this._localeService = b, this._initInterceptorCommands(), this._initRealTimeRenderingInterceptor(), this._initPanel(), this._initCommands(), this._commandExecutedListener();
1777
+ }
1778
+ _initCommands() {
1779
+ [
1780
+ Pn,
1781
+ En,
1782
+ On,
1783
+ Ct,
1784
+ Ft,
1785
+ Le
1786
+ ].forEach((t) => {
1787
+ this.disposeWithMe(this._commandService.registerCommand(t));
1788
+ });
1789
+ }
1790
+ _initPanel() {
1791
+ this._componentManager.register(Qe, Rs);
1792
+ }
1793
+ _initInterceptorCommands() {
1794
+ const t = this;
1795
+ this.disposeWithMe(
1796
+ this._sheetInterceptorService.interceptCommand({
1797
+ getMutations(r) {
1798
+ switch (r.id) {
1799
+ case mr.id:
1800
+ case dr.id: {
1801
+ const n = t._univerInstanceService.getCurrentUniverSheetInstance().getUnitId(), a = t._univerInstanceService.getCurrentUniverSheetInstance().getActiveSheet().getSheetId(), l = t._selectionManagerService.getSelectionRanges();
1802
+ if (!(l != null && l.length))
1803
+ break;
1804
+ const u = {
1805
+ unitId: n,
1806
+ subUnitId: a,
1807
+ ranges: []
1808
+ }, d = t._numfmtService.getModel(n, a);
1809
+ l.forEach((v) => {
1810
+ ne.foreach(v, (h, f) => {
1811
+ d != null && d.getValue(h, f) && u.ranges.push({
1812
+ startColumn: f,
1813
+ endColumn: f,
1814
+ startRow: h,
1815
+ endRow: h
1816
+ });
1817
+ });
1818
+ }), u.ranges = Ie(u.ranges);
1819
+ const p = Fe(t._injector, u);
1820
+ return {
1821
+ redos: [{ id: te.id, params: u }],
1822
+ undos: p
1823
+ };
1824
+ }
1745
1825
  }
1826
+ return {
1827
+ redos: [],
1828
+ undos: []
1829
+ };
1746
1830
  }
1747
- ]
1748
- }
1749
- ]
1750
- }, Pn = Xe(function(e, t) {
1751
- return Ye(tt, Object.assign({}, e, {
1752
- id: "more-down-single",
1753
- ref: t,
1754
- icon: Is
1755
- }));
1756
- });
1757
- Pn.displayName = "MoreDownSingle";
1758
- const Rs = Pn;
1759
- var ws = {
1760
- tag: "svg",
1761
- attrs: { fill: "none", viewBox: "0 0 17 17", width: "1em", height: "1em" },
1762
- children: [
1763
- {
1764
- tag: "path",
1765
- attrs: {
1766
- fill: "currentColor",
1767
- d: "M5.13281 3.84408C5.13281 2.55541 6.17749 1.51074 7.46615 1.51074C8.7548 1.51074 9.79948 2.55541 9.79948 3.84408V6.5337C9.79948 7.82236 8.7548 8.86704 7.46615 8.86704C6.17749 8.86704 5.13281 7.82236 5.13281 6.5337V3.84408ZM7.46615 2.84408C6.91387 2.84408 6.46615 3.29179 6.46615 3.84408V6.5337C6.46615 7.08598 6.91387 7.5337 7.46615 7.5337C8.01842 7.5337 8.46615 7.08598 8.46615 6.5337V3.84408C8.46615 3.29179 8.01842 2.84408 7.46615 2.84408Z",
1768
- fillRule: "evenodd",
1769
- clipRule: "evenodd"
1770
- }
1771
- },
1772
- {
1773
- tag: "path",
1774
- attrs: {
1775
- fill: "currentColor",
1776
- d: "M2.13281 8.20033C2.13281 7.83214 2.43129 7.53366 2.79948 7.53366H3.13281C3.501 7.53366 3.79948 7.83214 3.79948 8.20033 3.79948 8.56852 3.501 8.867 3.13281 8.867H2.79948C2.43129 8.867 2.13281 8.56852 2.13281 8.20033zM8.93763 9.7878C9.19798 10.0481 9.19798 10.4703 8.93763 10.7306L8.0757 11.5925H13.4662C13.8344 11.5925 14.1329 11.891 14.1329 12.2592 14.1329 12.6274 13.8344 12.9259 13.4662 12.9259H8.0757L8.93763 13.7878C9.19798 14.0482 9.19798 14.4703 8.93763 14.7306 8.67728 14.991 8.25517 14.991 7.99482 14.7306L5.99482 12.7306C5.93091 12.6667 5.88268 12.593 5.85015 12.5144 5.81755 12.4358 5.79956 12.3496 5.79956 12.2592 5.79956 12.1688 5.81755 12.0826 5.85015 12.004 5.88268 11.9254 5.93091 11.8517 5.99482 11.7878L7.99482 9.7878C8.25517 9.52745 8.67728 9.52745 8.93763 9.7878z"
1777
- }
1778
- }
1779
- ]
1780
- }, En = Xe(function(e, t) {
1781
- return Ye(tt, Object.assign({}, e, {
1782
- id: "reduce-digits-single",
1783
- ref: t,
1784
- icon: ws
1785
- }));
1786
- });
1787
- En.displayName = "ReduceDigitsSingle";
1788
- const ks = En;
1789
- var Ds = {
1790
- tag: "svg",
1791
- attrs: { fill: "none", viewBox: "0 0 17 17", width: "1em", height: "1em" },
1792
- children: [
1793
- {
1794
- tag: "path",
1795
- attrs: {
1796
- fill: "currentColor",
1797
- d: "M4.64671 1.77571C4.94126 1.55479 5.35913 1.61449 5.58004 1.90904L8.59224 6.20102L11.6044 1.90904C11.8254 1.61449 12.2432 1.55479 12.5378 1.77571C12.8323 1.99662 12.892 2.41449 12.6711 2.70904L9.92567 6.64535H12.6711C13.0393 6.64535 13.3378 6.94382 13.3378 7.31201C13.3378 7.6802 13.0393 7.97868 12.6711 7.97868H9.25887V9.91528H12.9271C13.2953 9.91528 13.5938 10.2138 13.5938 10.582C13.5938 10.9501 13.2953 11.2486 12.9271 11.2486H9.25887V14.1274C9.25887 14.4956 8.96039 14.794 8.5922 14.794C8.22401 14.794 7.92554 14.4956 7.92554 14.1274V11.2486H4.25736C3.88918 11.2486 3.5907 10.9501 3.5907 10.582C3.5907 10.2138 3.88918 9.91528 4.25736 9.91528H7.92554V7.97868H4.51338C4.14519 7.97868 3.84671 7.6802 3.84671 7.31201C3.84671 6.94382 4.14519 6.64535 4.51338 6.64535H7.25882L4.51338 2.70904C4.29246 2.41449 4.35216 1.99662 4.64671 1.77571Z"
1798
- }
1799
- }
1800
- ]
1801
- }, Nn = Xe(function(e, t) {
1802
- return Ye(tt, Object.assign({}, e, {
1803
- id: "rmb-single",
1804
- ref: t,
1805
- icon: Ds
1806
- }));
1807
- });
1808
- Nn.displayName = "RmbSingle";
1809
- const Os = Nn, lt = [
1810
- {
1811
- label: "sheet.numfmt.general",
1812
- pattern: null
1813
- },
1814
- {
1815
- label: "sheet.numfmt.text",
1816
- pattern: "@@@"
1817
- },
1818
- "|",
1819
- {
1820
- label: "sheet.numfmt.number",
1821
- pattern: "0"
1822
- },
1823
- "|",
1824
- {
1825
- label: "sheet.numfmt.accounting",
1826
- pattern: '"¥" #,##0.00_);[Red]("¥"#,##0.00)'
1827
- },
1828
- {
1829
- label: "sheet.numfmt.financialValue",
1830
- pattern: "#,##0.00;[Red]#,##0.00"
1831
- },
1832
- {
1833
- label: "sheet.numfmt.currency",
1834
- pattern: '"¥"#,##0.00_);[Red]("¥"#,##0.00)'
1835
- },
1836
- {
1837
- label: "sheet.numfmt.roundingCurrency",
1838
- pattern: '"¥"#,##0;[Red]"¥"#,##0'
1839
- },
1840
- "|",
1841
- {
1842
- label: "sheet.numfmt.date",
1843
- pattern: "yyyy-mm-dd;@"
1844
- },
1845
- {
1846
- label: "sheet.numfmt.time",
1847
- pattern: 'am/pm h":"mm":"ss'
1848
- },
1849
- {
1850
- label: "sheet.numfmt.dateTime",
1851
- pattern: "yyyy-m-d am/pm h:mm"
1852
- },
1853
- {
1854
- label: "sheet.numfmt.timeDuration",
1855
- pattern: "h:mm:ss"
1856
- },
1857
- "|",
1858
- {
1859
- label: "sheet.numfmt.moreFmt",
1860
- pattern: ""
1861
- }
1862
- ], Yt = (e) => he.getInfo(e).type || "unknown", pn = (e, t) => {
1863
- const n = he.getInfo(e)._partitions[1], i = he.format(e, t, { locale: "zh-CN" });
1864
- return t < 0 ? {
1865
- result: i,
1866
- color: n.color
1867
- } : {
1868
- result: i
1869
- };
1870
- }, Ps = (e) => {
1871
- const t = de(ve), a = e.value ?? t.t("sheet.numfmt.general");
1872
- return /* @__PURE__ */ O.jsx("span", { className: "more-numfmt-type", children: a });
1873
- }, Es = () => {
1874
- const e = de(je), t = de(ve), a = Ur(), n = de(Ve), i = (d) => {
1875
- const m = n.getLast();
1876
- if (!m)
1877
- return;
1878
- const v = a.get(wr), h = m.range, f = [];
1879
- ne.foreach(h, (b, I) => {
1880
- d ? f.push({ row: b, col: I, pattern: d, type: Yt(d) }) : f.push({ row: b, col: I });
1881
- }), e.executeCommand(Ue.id, { values: f }), v.focus();
1882
- }, l = (d) => {
1883
- if (d === 0)
1884
- i(null);
1885
- else if (d === lt.length - 1)
1886
- e.executeCommand(vt.id);
1887
- else {
1888
- const m = lt[d];
1889
- m.pattern && i(m.pattern);
1890
- }
1891
- }, u = 1220;
1892
- return /* @__PURE__ */ O.jsx("div", { className: "more-numfmt-type-options", children: lt.map((d, m) => d === "|" ? /* @__PURE__ */ O.jsx("div", { className: "line m-t-4", onClick: (v) => v.stopPropagation() }, m) : /* @__PURE__ */ O.jsxs(
1893
- "div",
1894
- {
1895
- className: "option-item m-t-4",
1896
- onClick: () => {
1897
- l(m);
1898
- },
1899
- children: [
1900
- /* @__PURE__ */ O.jsx("div", { children: t.t(d.label) }),
1901
- /* @__PURE__ */ O.jsx("div", { className: "m-l-26", children: d.pattern ? he.format(d.pattern || "", u, { locale: "zh-CN" }) : "" })
1902
- ]
1903
- },
1904
- m
1905
- )) });
1906
- }, Ns = (e) => {
1907
- const t = "icon-rmbSingle";
1908
- return e.register(t, Os), e.register("MoreDownSingle", Rs), (a) => ({
1909
- icon: t,
1910
- id: jn.id,
1911
- title: "sheet.numfmt.currency",
1912
- tooltip: "sheet.numfmt.currency",
1913
- type: St.BUTTON,
1914
- group: Ct.TOOLBAR_FORMULAS_INSERT,
1915
- positions: [Mt.TOOLBAR_START],
1916
- hidden$: jt(a, yt.SHEET),
1917
- disabled$: bt(a)
1918
- });
1919
- }, Ts = (e) => {
1920
- const t = "icon-addDigitsSingle";
1921
- return e.register(t, xs), (a) => ({
1922
- icon: t,
1923
- id: Cn.id,
1924
- title: "sheet.numfmt.addDecimal",
1925
- tooltip: "sheet.numfmt.addDecimal",
1926
- type: St.BUTTON,
1927
- positions: [Mt.TOOLBAR_START],
1928
- group: Ct.TOOLBAR_FORMULAS_INSERT,
1929
- hidden$: jt(a, yt.SHEET),
1930
- disabled$: bt(a)
1931
- });
1932
- }, Fs = (e) => {
1933
- const t = "icon-reduceDigitsSingle";
1934
- return e.register(t, ks), (a) => ({
1935
- icon: t,
1936
- id: xn.id,
1937
- title: "sheet.numfmt.subtractDecimal",
1938
- tooltip: "sheet.numfmt.subtractDecimal",
1939
- type: St.BUTTON,
1940
- group: Ct.TOOLBAR_FORMULAS_INSERT,
1941
- positions: [Mt.TOOLBAR_START],
1942
- hidden$: jt(a, yt.SHEET),
1943
- disabled$: bt(a)
1944
- });
1945
- }, $s = (e) => {
1946
- const t = "sheet.numfmt.moreNumfmtType", a = "sheet.numfmt.moreNumfmtType.options";
1947
- return e.register(t, Ps), e.register(a, Es), (n) => {
1948
- const i = n.get(be), l = n.get(ge), u = n.get(je), d = n.get(ve), m = n.get(Ve), v = new Oe(
1949
- (h) => Ft(
1950
- m.selectionMoveEnd$,
1951
- new Oe((f) => {
1952
- const b = [re.id, oe.id], I = u.onCommandExecuted((D) => {
1953
- b.includes(D.id) && f.next(null);
1954
- });
1955
- return () => I.dispose();
1956
- })
1957
- ).subscribe(() => {
1958
- const f = m.getSelections();
1959
- if (f && f[0]) {
1960
- const b = l.getCurrentUniverSheetInstance(), I = b.getActiveSheet(), D = f[0].range, P = D.startRow, R = D.startColumn, A = i.getValue(b.getUnitId(), I.getSheetId(), P, R);
1961
- let V = d.t("sheet.numfmt.general");
1962
- if (A) {
1963
- const W = A.pattern, Q = lt.filter((me) => typeof me == "object" && me.pattern).find(
1964
- (me) => Be(W, me.pattern)
1965
- );
1966
- Q && typeof Q == "object" && Q.pattern ? V = d.t(Q.label) : V = d.t("sheet.numfmt.moreFmt");
1967
- }
1968
- h.next(V);
1969
- }
1970
- })
1971
- );
1972
- return {
1973
- // icon: 'MoreDownSingle',
1974
- label: t,
1975
- id: vt.id,
1976
- tooltip: "sheet.numfmt.title",
1977
- type: St.SELECTOR,
1978
- group: Ct.TOOLBAR_FORMULAS_INSERT,
1979
- positions: [Mt.TOOLBAR_START],
1980
- selections: [
1981
- {
1982
- label: {
1983
- name: a,
1984
- hoverable: !1
1985
- }
1986
- }
1987
- ],
1988
- value$: v,
1989
- hidden$: jt(n, yt.SHEET),
1990
- disabled$: bt(n)
1991
- };
1992
- };
1993
- };
1994
- var As = Object.defineProperty, Us = Object.getOwnPropertyDescriptor, zs = (e, t, a, n) => {
1995
- for (var i = n > 1 ? void 0 : n ? Us(t, a) : t, l = e.length - 1, u; l >= 0; l--)
1996
- (u = e[l]) && (i = (n ? u(t, a, i) : u(i)) || i);
1997
- return n && i && As(t, a, i), i;
1998
- }, ee = (e, t) => (a, n) => t(a, n, e);
1999
- let ut = class extends Le {
2000
- constructor(t, a, n, i, l, u, d, m, v, h, f, b, I) {
2001
- super();
2002
- /**
2003
- * If _previewPattern is null ,the realTimeRenderingInterceptor will skip and if it is '',realTimeRenderingInterceptor will clear numfmt.
2004
- * @private
2005
- * @type {(string | null)}
2006
- * @memberof NumfmtController
2007
- */
2008
- ke(this, "_previewPattern", "");
2009
- ke(this, "openPanel", () => {
2010
- const t = this._sidebarService, a = this._selectionManagerService, n = this._commandService, i = this._univerInstanceService, l = this._numfmtService, u = this._localeService, m = (a.getSelectionRanges() || [])[0];
2011
- if (!m)
2012
- return !1;
2013
- const v = i.getCurrentUniverSheetInstance(), h = v.getActiveSheet(), f = h.getCellRaw(m.startRow, m.startColumn), b = l.getValue(
2014
- v.getUnitId(),
2015
- h.getSheetId(),
2016
- m.startRow,
2017
- m.startColumn
2018
- );
2019
- let I = "";
2020
- b && (I = b.pattern);
2021
- const D = (f == null ? void 0 : f.t) === Ae.NUMBER ? f.v : 12345678, P = {
2022
- onChange: (R) => {
2023
- var A, V;
2024
- if (R.type === "change")
2025
- this._previewPattern = R.value, this._sheetSkeletonManagerService.reCalculate(), (V = (A = this._renderManagerService.getRenderById(v.getUnitId())) == null ? void 0 : A.mainComponent) == null || V.makeDirty();
2026
- else if (R.type === "confirm") {
2027
- const W = a.getSelectionRanges() || [], Q = { values: [] }, me = Yt(R.value);
2028
- W.forEach((xe) => {
2029
- ne.foreach(xe, (Ie, G) => {
2030
- Q.values.push({
2031
- row: Ie,
2032
- col: G,
2033
- pattern: R.value,
2034
- type: me
2035
- });
2036
- });
2037
- }), n.executeCommand(Ue.id, Q), t.close();
2038
- } else
2039
- R.type === "cancel" && t.close();
2040
- },
2041
- value: { defaultPattern: I, defaultValue: D, row: m.startRow, col: m.startColumn }
2042
- };
2043
- t.open({
2044
- header: { title: u.t("sheet.numfmt.title") },
2045
- children: {
2046
- label: gt,
2047
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
2048
- ...P
2049
- // need passthrough to react props.
2050
- },
2051
- onClose: () => {
2052
- var R, A;
2053
- this._sheetSkeletonManagerService.reCalculate(), (A = (R = this._renderManagerService.getRenderById(v.getUnitId())) == null ? void 0 : R.mainComponent) == null || A.makeDirty(), n.executeCommand(Dt.id);
2054
- }
2055
- });
2056
- });
2057
- ke(this, "_initLocal", () => {
2058
- this._localeService.load({ zhCN: zr });
2059
- });
2060
- this._sheetInterceptorService = t, this._themeService = a, this._injector = n, this._univerInstanceService = i, this._sheetSkeletonManagerService = l, this._commandService = u, this._selectionManagerService = d, this._renderManagerService = m, this._numfmtService = v, this._componentManager = h, this._menuService = f, this._sidebarService = b, this._localeService = I, this._initInterceptorCommands(), this._initRealTimeRenderingInterceptor(), this._initPanel(), this._initCommands(), this._commandExecutedListener(), this._initMenu(), this._initInterceptorCellContent(), this._initLocal();
2061
- }
2062
- _initCommands() {
2063
- [
2064
- Cn,
2065
- xn,
2066
- jn,
2067
- vt,
2068
- Dt,
2069
- Ue
2070
- ].forEach((t) => {
2071
- this.disposeWithMe(this._commandService.registerCommand(t));
2072
- });
2073
- }
2074
- _initPanel() {
2075
- this._componentManager.register(gt, ys);
2076
- }
2077
- _initMenu() {
2078
- [Ts, Fs, Ns, $s].map((t) => t(this._componentManager)).forEach((t) => {
2079
- this.disposeWithMe(this._menuService.addMenuItem(t(this._injector)));
2080
- });
2081
- }
2082
- _initInterceptorCommands() {
2083
- const t = this;
2084
- this.disposeWithMe(
2085
- this._sheetInterceptorService.interceptCommand({
2086
- getMutations(a) {
2087
- switch (a.id) {
2088
- case ir.id:
2089
- case ar.id: {
2090
- const n = t._univerInstanceService.getCurrentUniverSheetInstance().getUnitId(), i = t._univerInstanceService.getCurrentUniverSheetInstance().getActiveSheet().getSheetId(), l = t._selectionManagerService.getSelectionRanges();
2091
- if (!(l != null && l.length))
2092
- break;
2093
- const u = {
2094
- unitId: n,
2095
- subUnitId: i,
2096
- ranges: []
2097
- }, d = t._numfmtService.getModel(n, i);
2098
- l.forEach((v) => {
2099
- ne.foreach(v, (h, f) => {
2100
- d != null && d.getValue(h, f) && u.ranges.push({
2101
- startColumn: f,
2102
- endColumn: f,
2103
- startRow: h,
2104
- endRow: h
2105
- });
2106
- });
2107
- }), u.ranges = Ce(u.ranges);
2108
- const m = Pe(t._injector, u);
2109
- return {
2110
- redos: [{ id: re.id, params: u }],
2111
- undos: m
2112
- };
2113
- }
2114
- }
2115
- return {
2116
- redos: [],
2117
- undos: []
2118
- };
2119
- }
2120
- })
2121
- );
2122
- }
2123
- _initInterceptorCellContent() {
2124
- const t = new hn();
2125
- this.disposeWithMe(
2126
- this._sheetInterceptorService.intercept(an.CELL_CONTENT, {
2127
- handler: (a, n, i) => {
2128
- const l = n.unitId, u = n.subUnitId, d = this._numfmtService.getValue(l, u, n.row, n.col);
2129
- if (!d)
2130
- return i(a);
2131
- const m = a;
2132
- if (!m || m.t !== Ae.NUMBER)
2133
- return i(a);
2134
- let v = "";
2135
- const h = t.getValue(n.row, n.col);
2136
- if (h && h.parameters === m.v)
2137
- return { ...a, ...h.result };
2138
- const f = pn(d.pattern, Number(m.v));
2139
- if (v = f.result, !v)
2140
- return i(a);
2141
- const b = { v };
2142
- if (f.color) {
2143
- const I = this._themeService.getCurrentTheme()[`${f.color}500`];
2144
- I && (b.interceptorStyle = { cl: { rgb: I } });
2145
- }
2146
- return t.setValue(n.row, n.col, {
2147
- result: b,
2148
- parameters: m.v
2149
- }), { ...a, ...b };
2150
- }
2151
- })
2152
- ), this.disposeWithMe(
2153
- this._commandService.onCommandExecuted((a) => {
2154
- if (a.id === oe.id) {
2155
- const n = a.params;
2156
- Object.keys(n.values).forEach((i) => {
2157
- n.values[i].ranges.forEach((u) => {
2158
- ne.foreach(u, (d, m) => {
2159
- t.realDeleteValue(d, m);
2160
- });
2161
- });
2162
- });
2163
- }
2164
- })
2165
- ), this.disposeWithMe(
2166
- De(
2167
- this._sheetSkeletonManagerService.currentSkeleton$.pipe(
2168
- Ze((a) => a == null ? void 0 : a.sheetId),
2169
- _n()
2170
- ).subscribe(() => {
2171
- t.reset();
2172
- })
2173
- )
2174
- );
2175
- }
2176
- _initRealTimeRenderingInterceptor() {
2177
- const t = new Oe((n) => {
2178
- this._commandService.onCommandExecuted((i) => {
2179
- i.id === vt.id && n.next(!0), i.id === Dt.id && n.next(!1);
2180
- });
2181
- }), a = Er([
2182
- t,
2183
- this._selectionManagerService.selectionMoveEnd$.pipe(
2184
- Ze((n) => n ? n.map((i) => i.range) : [])
2185
- )
2186
- ]);
2187
- this.disposeWithMe(
2188
- De(
2189
- a.pipe(
2190
- yn(
2191
- ([n, i]) => new Oe((l) => {
2192
- const u = new gn();
2193
- return n && i.length && l.next({ selectionRanges: i, disposableCollection: u }), () => {
2194
- u.dispose();
2195
- };
2196
- })
2197
- ),
2198
- Nr(() => {
2199
- this._previewPattern = null;
2200
- })
2201
- ).subscribe(({ disposableCollection: n, selectionRanges: i }) => {
2202
- var u, d;
2203
- const l = this._univerInstanceService.getCurrentUniverSheetInstance();
2204
- this.openPanel(), n.add(
2205
- this._sheetInterceptorService.intercept(an.CELL_CONTENT, {
2206
- priority: 99,
2207
- handler: (m, v, h) => {
2208
- const { row: f, col: b } = v;
2209
- if (i.find(
2210
- (I) => I.startColumn <= b && I.endColumn >= b && I.startRow <= f && I.endRow >= f
2211
- )) {
2212
- const I = v.worksheet.getCellRaw(f, b), D = I == null ? void 0 : I.v, P = I == null ? void 0 : I.t;
2213
- if (D == null || P !== Ae.NUMBER || this._previewPattern === null)
2214
- return h(m);
2215
- const R = pn(this._previewPattern, D);
2216
- if (R.color) {
2217
- const V = this._themeService.getCurrentTheme()[`${R.color}500`];
2218
- return {
2219
- ...m,
2220
- v: R.result,
2221
- t: Ae.STRING,
2222
- s: { cl: { rgb: V } }
2223
- };
2224
- }
2225
- return {
2226
- ...m,
2227
- v: R.result,
2228
- t: Ae.STRING
2229
- };
2230
- }
2231
- return h(m);
2232
- }
2233
- })
2234
- ), (d = (u = this._renderManagerService.getRenderById(l.getUnitId())) == null ? void 0 : u.mainComponent) == null || d.makeDirty();
2235
- })
2236
- )
2237
- );
2238
- }
2239
- _commandExecutedListener() {
2240
- const t = [re.id, oe.id];
2241
- this.disposeWithMe(
2242
- De(
2243
- Ft(
2244
- new Oe((a) => {
2245
- const n = this._commandService.onCommandExecuted((i) => {
2246
- if (t.includes(i.id)) {
2247
- const l = i.params;
2248
- a.next(l.unitId);
2249
- }
2250
- });
2251
- return () => {
2252
- n.dispose();
2253
- };
2254
- }),
2255
- this._numfmtService.modelReplace$
2256
- ).pipe(Tr(16)).subscribe((a) => {
2257
- var n, i;
2258
- this._sheetSkeletonManagerService.reCalculate(), (i = (n = this._renderManagerService.getRenderById(a)) == null ? void 0 : n.mainComponent) == null || i.makeDirty();
2259
- })
2260
- )
2261
- );
2262
- }
2263
- };
2264
- ut = zs([
2265
- He(Ee.Rendered, ut),
2266
- ee(0, z(Tt)),
2267
- ee(1, z(nr)),
2268
- ee(2, z(Ne)),
2269
- ee(3, z(ge)),
2270
- ee(4, z(vn)),
2271
- ee(5, z(je)),
2272
- ee(6, z(Ve)),
2273
- ee(7, z(kr)),
2274
- ee(8, z(be)),
2275
- ee(9, z(Dr)),
2276
- ee(10, z(Or)),
2277
- ee(11, z(Pr)),
2278
- ee(12, z(ve))
2279
- ], ut);
2280
- var Ls = Object.defineProperty, Hs = Object.getOwnPropertyDescriptor, Vs = (e, t, a, n) => {
2281
- for (var i = n > 1 ? void 0 : n ? Hs(t, a) : t, l = e.length - 1, u; l >= 0; l--)
2282
- (u = e[l]) && (i = (n ? u(t, a, i) : u(i)) || i);
2283
- return n && i && Ls(t, a, i), i;
2284
- }, it = (e, t) => (a, n) => t(a, n, e);
2285
- let dt = class extends Le {
2286
- constructor(t, a, n, i) {
2287
- super();
2288
- ke(this, "_copyInfo");
2289
- this._sheetClipboardService = t, this._injector = a, this._numfmtService = n, this._univerInstanceService = i, this._initClipboardHook();
2290
- }
2291
- _initClipboardHook() {
2292
- this.disposeWithMe(
2293
- this._sheetClipboardService.addClipboardHook({
2294
- id: "numfmt",
2295
- onBeforeCopy: (t, a, n) => this._collectNumfmt(t, a, n),
2296
- onPasteCells: (t, a, n, i) => {
2297
- const { copyType: l = on.COPY, pasteType: u } = i, { range: d } = t || {}, { range: m } = a;
2298
- return this._generateNumfmtMutations(m, { copyType: l, pasteType: u, copyRange: d });
2299
- }
2300
- })
2301
- );
2302
- }
2303
- _collectNumfmt(t, a, n) {
2304
- const i = new hn();
2305
- this._copyInfo = {
2306
- matrix: i,
2307
- info: {
2308
- unitId: t,
2309
- subUnitId: a
1831
+ })
1832
+ );
1833
+ }
1834
+ _initRealTimeRenderingInterceptor() {
1835
+ const t = new ke((n) => {
1836
+ this._commandService.onCommandExecuted((a) => {
1837
+ a.id === Ct.id && n.next(!0), a.id === Ft.id && n.next(!1);
1838
+ });
1839
+ }), r = Lr([
1840
+ t,
1841
+ this._selectionManagerService.selectionMoveEnd$.pipe(
1842
+ qe((n) => n ? n.map((a) => a.range) : [])
1843
+ )
1844
+ ]);
1845
+ this.disposeWithMe(
1846
+ Te(
1847
+ r.pipe(
1848
+ jn(
1849
+ ([n, a]) => new ke((l) => {
1850
+ const u = new Sn();
1851
+ return n && a.length && l.next({ selectionRanges: a, disposableCollection: u }), () => {
1852
+ u.dispose();
1853
+ };
1854
+ })
1855
+ ),
1856
+ kr(() => {
1857
+ this._previewPattern = null;
1858
+ })
1859
+ ).subscribe(({ disposableCollection: n, selectionRanges: a }) => {
1860
+ var u, d;
1861
+ const l = this._univerInstanceService.getCurrentUniverSheetInstance();
1862
+ this.openPanel(), n.add(
1863
+ this._sheetInterceptorService.intercept(Cn.CELL_CONTENT, {
1864
+ priority: 99,
1865
+ handler: (p, v, h) => {
1866
+ const { row: f, col: b } = v;
1867
+ if (a.find(
1868
+ (I) => I.startColumn <= b && I.endColumn >= b && I.startRow <= f && I.endRow >= f
1869
+ )) {
1870
+ const I = v.worksheet.getCellRaw(f, b), D = I == null ? void 0 : I.v, E = I == null ? void 0 : I.t;
1871
+ if (D == null || E !== ze.NUMBER || this._previewPattern === null)
1872
+ return h(p);
1873
+ const R = wn(this._previewPattern, D);
1874
+ if (R.color) {
1875
+ const V = this._themeService.getCurrentTheme()[`${R.color}500`];
1876
+ return {
1877
+ ...p,
1878
+ v: R.result,
1879
+ t: ze.STRING,
1880
+ s: { cl: { rgb: V } }
1881
+ };
1882
+ }
1883
+ return {
1884
+ ...p,
1885
+ v: R.result,
1886
+ t: ze.STRING
1887
+ };
1888
+ }
1889
+ return h(p);
1890
+ }
1891
+ })
1892
+ ), (d = (u = this._renderManagerService.getRenderById(l.getUnitId())) == null ? void 0 : u.mainComponent) == null || d.makeDirty();
1893
+ })
1894
+ )
1895
+ );
1896
+ }
1897
+ _commandExecutedListener() {
1898
+ const t = [te.id, oe.id];
1899
+ this.disposeWithMe(
1900
+ Te(
1901
+ Ht(
1902
+ new ke((r) => {
1903
+ const n = this._commandService.onCommandExecuted((a) => {
1904
+ if (t.includes(a.id)) {
1905
+ const l = a.params;
1906
+ r.next(l.unitId);
1907
+ }
1908
+ });
1909
+ return () => {
1910
+ n.dispose();
1911
+ };
1912
+ }),
1913
+ this._numfmtService.modelReplace$
1914
+ ).pipe(Tr(16)).subscribe((r) => {
1915
+ var n, a;
1916
+ this._sheetSkeletonManagerService.reCalculate(), (a = (n = this._renderManagerService.getRenderById(r)) == null ? void 0 : n.mainComponent) == null || a.makeDirty();
1917
+ })
1918
+ )
1919
+ );
1920
+ }
1921
+ };
1922
+ mt = Ds([
1923
+ je(_e.Rendered, mt),
1924
+ se(0, $(xt)),
1925
+ se(1, $(bn)),
1926
+ se(2, $(we)),
1927
+ se(3, $(ve)),
1928
+ se(4, $(Lt)),
1929
+ se(5, $(Ce)),
1930
+ se(6, $(Ve)),
1931
+ se(7, $($r)),
1932
+ se(8, $(ye)),
1933
+ se(9, $(xn)),
1934
+ se(10, $(Ur)),
1935
+ se(11, $(me))
1936
+ ], mt);
1937
+ var Os = Object.defineProperty, Es = Object.getOwnPropertyDescriptor, Ns = (e, t, r, n) => {
1938
+ for (var a = n > 1 ? void 0 : n ? Es(t, r) : t, l = e.length - 1, u; l >= 0; l--)
1939
+ (u = e[l]) && (a = (n ? u(t, r, a) : u(a)) || a);
1940
+ return n && a && Os(t, r, a), a;
1941
+ }, ct = (e, t) => (r, n) => t(r, n, e);
1942
+ let pt = class extends Me {
1943
+ constructor(t, r, n, a) {
1944
+ super();
1945
+ Ne(this, "_copyInfo");
1946
+ this._sheetClipboardService = t, this._injector = r, this._numfmtService = n, this._univerInstanceService = a, this._initClipboardHook();
1947
+ }
1948
+ _initClipboardHook() {
1949
+ this.disposeWithMe(
1950
+ this._sheetClipboardService.addClipboardHook({
1951
+ id: Qe,
1952
+ onBeforeCopy: (t, r, n) => this._collectNumfmt(t, r, n),
1953
+ onPasteCells: (t, r, n, a) => {
1954
+ const { copyType: l = mn.COPY, pasteType: u } = a, { range: d } = t || {}, { range: p } = r;
1955
+ return this._generateNumfmtMutations(p, { copyType: l, pasteType: u, copyRange: d });
1956
+ }
1957
+ })
1958
+ );
1959
+ }
1960
+ _collectNumfmt(t, r, n) {
1961
+ const a = new yn();
1962
+ this._copyInfo = {
1963
+ matrix: a,
1964
+ info: {
1965
+ unitId: t,
1966
+ subUnitId: r
2310
1967
  }
2311
1968
  };
2312
- const l = this._numfmtService.getModel(t, a);
1969
+ const l = this._numfmtService.getModel(t, r);
2313
1970
  l && ne.foreach(n, (u, d) => {
2314
- const m = this._numfmtService.getValue(t, a, u, d, l);
2315
- if (!m)
1971
+ const p = this._numfmtService.getValue(t, r, u, d, l);
1972
+ if (!p)
2316
1973
  return;
2317
- const v = ht.getRelativeRange(
1974
+ const v = bt.getRelativeRange(
2318
1975
  {
2319
1976
  startRow: u,
2320
1977
  endRow: u,
@@ -2323,114 +1980,112 @@ let dt = class extends Le {
2323
1980
  },
2324
1981
  n
2325
1982
  );
2326
- i.setValue(v.startRow, v.startColumn, {
2327
- pattern: m.pattern,
2328
- type: m.type
1983
+ a.setValue(v.startRow, v.startColumn, {
1984
+ pattern: p.pattern,
1985
+ type: p.type
2329
1986
  });
2330
1987
  });
2331
1988
  }
2332
- _generateNumfmtMutations(t, a) {
2333
- const n = this._univerInstanceService.getCurrentUniverSheetInstance(), i = n.getActiveSheet(), l = n.getUnitId(), u = i.getSheetId();
2334
- if (a.copyType === on.CUT)
1989
+ _generateNumfmtMutations(t, r) {
1990
+ const n = this._univerInstanceService.getCurrentUniverSheetInstance(), a = n.getActiveSheet(), l = n.getUnitId(), u = a.getSheetId();
1991
+ if (r.copyType === mn.CUT)
2335
1992
  return this._copyInfo = null, { redos: [], undos: [] };
2336
- if (!this._copyInfo || !this._copyInfo.matrix.getSizeOf() || !a.copyRange)
1993
+ if (!this._copyInfo || !this._copyInfo.matrix.getSizeOf() || !r.copyRange)
2337
1994
  return { redos: [], undos: [] };
2338
- if ([cn.SPECIAL_PASTE_COL_WIDTH, cn.SPECIAL_PASTE_VALUE].includes(
2339
- a.pasteType
1995
+ if ([pn.SPECIAL_PASTE_COL_WIDTH, pn.SPECIAL_PASTE_VALUE].includes(
1996
+ r.pasteType
2340
1997
  ))
2341
1998
  return { redos: [], undos: [] };
2342
- const d = xr(a.copyRange, t, !0), m = [], v = { unitId: l, subUnitId: u, ranges: [] }, h = this._numfmtService.getModel(l, u);
1999
+ const d = Or(r.copyRange, t, !0), p = [], v = { unitId: l, subUnitId: u, ranges: [] }, h = this._numfmtService.getModel(l, u);
2343
2000
  ne.foreach(t, (I, D) => {
2344
2001
  this._numfmtService.getValue(l, u, I, D, h) && v.ranges.push({ startRow: I, startColumn: D, endRow: I, endColumn: D });
2345
2002
  }), d.forEach((I) => {
2346
- this._copyInfo && this._copyInfo.matrix.forValue((D, P, R) => {
2347
- const A = ht.getPositionRange(
2003
+ this._copyInfo && this._copyInfo.matrix.forValue((D, E, R) => {
2004
+ const U = bt.getPositionRange(
2348
2005
  {
2349
2006
  startRow: D,
2350
2007
  endRow: D,
2351
- startColumn: P,
2352
- endColumn: P
2008
+ startColumn: E,
2009
+ endColumn: E
2353
2010
  },
2354
2011
  I.startRange
2355
2012
  );
2356
- m.push({
2357
- row: A.startRow,
2358
- col: A.startColumn,
2013
+ p.push({
2014
+ row: U.startRow,
2015
+ col: U.startColumn,
2359
2016
  pattern: R.pattern,
2360
2017
  type: R.type
2361
2018
  });
2362
2019
  });
2363
2020
  });
2364
- const f = qe(l, u, m);
2021
+ const f = Xe(l, u, p);
2365
2022
  Object.keys(f.values).forEach((I) => {
2366
2023
  const D = f.values[I];
2367
- D.ranges = Ce(D.ranges);
2368
- }), v.ranges = Ce(v.ranges);
2024
+ D.ranges = Ie(D.ranges);
2025
+ }), v.ranges = Ie(v.ranges);
2369
2026
  const b = [
2370
- ...Qe(this._injector, f),
2371
- ...Pe(this._injector, v)
2027
+ ...et(this._injector, f),
2028
+ ...Fe(this._injector, v)
2372
2029
  ];
2373
2030
  return {
2374
2031
  redos: [
2375
- { id: re.id, params: v },
2032
+ { id: te.id, params: v },
2376
2033
  { id: oe.id, params: f }
2377
2034
  ],
2378
- undos: b
2035
+ undos: St(b)
2379
2036
  };
2380
2037
  }
2381
2038
  };
2382
- dt = Vs([
2383
- He(Ee.Rendered, dt),
2384
- it(0, z(Ir)),
2385
- it(1, z(Ne)),
2386
- it(2, z(be)),
2387
- it(3, z(ge))
2388
- ], dt);
2389
- var Ys = Object.defineProperty, Bs = Object.getOwnPropertyDescriptor, Js = (e, t, a, n) => {
2390
- for (var i = n > 1 ? void 0 : n ? Bs(t, a) : t, l = e.length - 1, u; l >= 0; l--)
2391
- (u = e[l]) && (i = (n ? u(t, a, i) : u(i)) || i);
2392
- return n && i && Ys(t, a, i), i;
2393
- }, Ke = (e, t) => (a, n) => t(a, n, e);
2394
- const Ws = () => {
2039
+ pt = Ns([
2040
+ je(_e.Rendered, pt),
2041
+ ct(0, $(Er)),
2042
+ ct(1, $(we)),
2043
+ ct(2, $(ye)),
2044
+ ct(3, $(ve))
2045
+ ], pt);
2046
+ var ks = Object.defineProperty, Ts = Object.getOwnPropertyDescriptor, Fs = (e, t, r, n) => {
2047
+ for (var a = n > 1 ? void 0 : n ? Ts(t, r) : t, l = e.length - 1, u; l >= 0; l--)
2048
+ (u = e[l]) && (a = (n ? u(t, r, a) : u(a)) || a);
2049
+ return n && a && ks(t, r, a), a;
2050
+ }, Ze = (e, t) => (r, n) => t(r, n, e);
2051
+ const $s = () => {
2395
2052
  let e = [];
2396
2053
  return {
2397
- add: (i, l, u, d, m) => e.push({ unitId: i, subUnitId: l, row: u, col: d, value: m }),
2054
+ add: (a, l, u, d, p) => e.push({ unitId: a, subUnitId: l, row: u, col: d, value: p }),
2398
2055
  getEffects: () => e,
2399
2056
  clean: () => {
2400
2057
  e = [];
2401
2058
  }
2402
2059
  };
2403
2060
  };
2404
- let mt = class extends Le {
2405
- constructor(t, a, n, i, l) {
2061
+ let ft = class extends Me {
2062
+ constructor(t, r, n, a, l) {
2406
2063
  super();
2407
2064
  // collect effect mutations when edit end and push this to commands stack in next commands progress
2408
- ke(this, "_collectEffectMutation", Ws());
2409
- this._sheetInterceptorService = t, this._numfmtService = a, this._univerInstanceService = n, this._injector = i, this._editorBridgeService = l, this._initInterceptorEditorStart(), this._initInterceptorEditorEnd(), this._initInterceptorCommands();
2065
+ Ne(this, "_collectEffectMutation", $s());
2066
+ this._sheetInterceptorService = t, this._numfmtService = r, this._univerInstanceService = n, this._injector = a, this._editorBridgeService = l, this._initInterceptorEditorStart(), this._initInterceptorEditorEnd(), this._initInterceptorCommands();
2410
2067
  }
2411
2068
  _initInterceptorEditorStart() {
2412
2069
  this.disposeWithMe(
2413
- De(
2070
+ Te(
2414
2071
  this._editorBridgeService.interceptor.intercept(
2415
2072
  this._editorBridgeService.interceptor.getInterceptPoints().BEFORE_CELL_EDIT,
2416
2073
  {
2417
- handler: (t, a, n) => {
2418
- const i = a.row, l = a.col, u = this._numfmtService.getValue(
2419
- a.unitId,
2420
- a.subUnitId,
2421
- i,
2074
+ handler: (t, r, n) => {
2075
+ const a = r.row, l = r.col, u = this._numfmtService.getValue(
2076
+ r.unitId,
2077
+ r.subUnitId,
2078
+ a,
2422
2079
  l
2423
2080
  );
2424
2081
  if (u)
2425
- switch (Yt(u.pattern)) {
2082
+ switch (Gt(u.pattern)) {
2426
2083
  case "scientific":
2427
2084
  case "percent":
2428
2085
  case "currency":
2429
2086
  case "grouped":
2430
- case "number": {
2431
- const m = a.worksheet.getCellRaw(i, l);
2432
- return m && Gs(m, ["s"]);
2433
- }
2087
+ case "number":
2088
+ return r.worksheet.getCellRaw(a, l);
2434
2089
  case "date":
2435
2090
  case "time":
2436
2091
  case "datetime":
@@ -2451,45 +2106,45 @@ let mt = class extends Le {
2451
2106
  */
2452
2107
  _initInterceptorEditorEnd() {
2453
2108
  this.disposeWithMe(
2454
- De(
2109
+ Te(
2455
2110
  this._editorBridgeService.interceptor.intercept(
2456
2111
  this._editorBridgeService.interceptor.getInterceptPoints().AFTER_CELL_EDIT,
2457
2112
  {
2458
- handler: (t, a, n) => {
2113
+ handler: (t, r, n) => {
2459
2114
  this._collectEffectMutation.clean();
2460
- const i = this._numfmtService.getValue(
2461
- a.unitId,
2462
- a.subUnitId,
2463
- a.row,
2464
- a.col
2115
+ const a = this._numfmtService.getValue(
2116
+ r.unitId,
2117
+ r.subUnitId,
2118
+ r.row,
2119
+ r.col
2465
2120
  ), l = () => {
2466
- i && this._collectEffectMutation.add(
2467
- a.unitId,
2468
- a.subUnitId,
2469
- a.row,
2470
- a.col,
2121
+ a && this._collectEffectMutation.add(
2122
+ r.unitId,
2123
+ r.subUnitId,
2124
+ r.row,
2125
+ r.col,
2471
2126
  null
2472
2127
  );
2473
2128
  };
2474
2129
  if (!(t != null && t.v))
2475
2130
  return n(t);
2476
- const u = String(t.v), d = he.parseDate(u) || he.parseTime(u);
2131
+ const u = String(t.v), d = ge.parseDate(u) || ge.parseTime(u);
2477
2132
  if (!!d) {
2478
2133
  if (d && d.z) {
2479
2134
  const v = Number(d.v);
2480
2135
  return this._collectEffectMutation.add(
2481
- a.unitId,
2482
- a.subUnitId,
2483
- a.row,
2484
- a.col,
2136
+ r.unitId,
2137
+ r.subUnitId,
2138
+ r.row,
2139
+ r.col,
2485
2140
  {
2486
2141
  type: "date",
2487
2142
  pattern: d.z
2488
2143
  }
2489
- ), { ...t, v, t: Ae.NUMBER };
2144
+ ), { ...t, v, t: ze.NUMBER };
2490
2145
  }
2491
2146
  } else
2492
- (["date", "time", "datetime"].includes((i == null ? void 0 : i.type) || "") || !Ks(u)) && l();
2147
+ (["date", "time", "datetime"].includes((a == null ? void 0 : a.type) || "") || !As(u)) && l();
2493
2148
  return n(t);
2494
2149
  }
2495
2150
  }
@@ -2501,10 +2156,10 @@ let mt = class extends Le {
2501
2156
  const t = this;
2502
2157
  this.disposeWithMe(
2503
2158
  this._sheetInterceptorService.interceptCommand({
2504
- getMutations(a) {
2505
- switch (a.id) {
2506
- case or.id: {
2507
- const n = t._univerInstanceService.getCurrentUniverSheetInstance().getUnitId(), i = t._univerInstanceService.getCurrentUniverSheetInstance().getActiveSheet().getSheetId(), l = t._collectEffectMutation.getEffects();
2159
+ getMutations(r) {
2160
+ switch (r.id) {
2161
+ case pr.id: {
2162
+ const n = t._univerInstanceService.getCurrentUniverSheetInstance().getUnitId(), a = t._univerInstanceService.getCurrentUniverSheetInstance().getActiveSheet().getSheetId(), l = t._collectEffectMutation.getEffects();
2508
2163
  if (!l.length)
2509
2164
  return {
2510
2165
  redos: [],
@@ -2526,27 +2181,27 @@ let mt = class extends Le {
2526
2181
  endColumn: h.col,
2527
2182
  startColumn: h.col,
2528
2183
  endRow: h.row
2529
- })), m = [], v = [];
2184
+ })), p = [], v = [];
2530
2185
  if (u) {
2531
2186
  const h = {
2532
2187
  id: oe.id,
2533
- params: qe(n, i, u)
2188
+ params: Xe(n, a, u)
2534
2189
  };
2535
- m.push(h), v.push(...Qe(t._injector, h.params));
2190
+ p.push(h), v.push(...et(t._injector, h.params));
2536
2191
  }
2537
2192
  if (d) {
2538
2193
  const h = {
2539
- id: re.id,
2194
+ id: te.id,
2540
2195
  params: {
2541
2196
  unitId: n,
2542
- subUnitId: i,
2197
+ subUnitId: a,
2543
2198
  ranges: d
2544
2199
  }
2545
2200
  };
2546
- m.push(h), v.push(...Pe(t._injector, h.params));
2201
+ p.push(h), v.push(...Fe(t._injector, h.params));
2547
2202
  }
2548
2203
  return {
2549
- redos: m,
2204
+ redos: p,
2550
2205
  undos: v.reverse()
2551
2206
  };
2552
2207
  }
@@ -2560,201 +2215,583 @@ let mt = class extends Le {
2560
2215
  );
2561
2216
  }
2562
2217
  };
2563
- mt = Js([
2564
- He(Ee.Rendered, mt),
2565
- Ke(0, z(Tt)),
2566
- Ke(1, z(be)),
2567
- Ke(2, z(ge)),
2568
- Ke(3, z(Ne)),
2569
- Ke(4, z(Rr))
2570
- ], mt);
2571
- const Gs = (e, t) => Object.keys(e).filter((n) => !t.includes(n)).reduce(
2572
- (n, i) => (n[i] = e[i], n),
2573
- {}
2574
- );
2575
- function Ks(e) {
2218
+ ft = Fs([
2219
+ je(_e.Rendered, ft),
2220
+ Ze(0, $(xt)),
2221
+ Ze(1, $(ye)),
2222
+ Ze(2, $(ve)),
2223
+ Ze(3, $(we)),
2224
+ Ze(4, $(Nr))
2225
+ ], ft);
2226
+ function As(e) {
2576
2227
  return /^-?\d+(\.\d+)?$/.test(e);
2577
2228
  }
2578
- var Zs = Object.defineProperty, qs = Object.getOwnPropertyDescriptor, Qs = (e, t, a, n) => {
2579
- for (var i = n > 1 ? void 0 : n ? qs(t, a) : t, l = e.length - 1, u; l >= 0; l--)
2580
- (u = e[l]) && (i = (n ? u(t, a, i) : u(i)) || i);
2581
- return n && i && Zs(t, a, i), i;
2582
- }, $e = (e, t) => (a, n) => t(a, n, e);
2583
- const Xs = [oe.id, re.id];
2584
- let pt = class extends Le {
2585
- constructor(e, t, a, n, i, l) {
2586
- super(), this._numfmtService = e, this._univerInstanceService = t, this._injector = a, this._refRangeService = n, this._sheetSkeletonManagerService = i, this._commandService = l, this._registerRefRange(), this._mergeRefMutations();
2229
+ var Us = Object.defineProperty, zs = Object.getOwnPropertyDescriptor, Ls = (e, t, r, n) => {
2230
+ for (var a = n > 1 ? void 0 : n ? zs(t, r) : t, l = e.length - 1, u; l >= 0; l--)
2231
+ (u = e[l]) && (a = (n ? u(t, r, a) : u(a)) || a);
2232
+ return n && a && Us(t, r, a), a;
2233
+ }, Hs = (e, t) => (r, n) => t(r, n, e);
2234
+ let ht = class extends Me {
2235
+ constructor(t) {
2236
+ super();
2237
+ Ne(this, "_initLocal", () => {
2238
+ this._localeService.load({ zhCN: Br });
2239
+ });
2240
+ this._localeService = t, this._initLocal();
2241
+ }
2242
+ };
2243
+ ht = Ls([
2244
+ je(_e.Rendered, ht),
2245
+ Hs(0, $(me))
2246
+ ], ht);
2247
+ var ae = function() {
2248
+ return ae = Object.assign || function(e) {
2249
+ for (var t, r = 1, n = arguments.length; r < n; r++) {
2250
+ t = arguments[r];
2251
+ for (var a in t)
2252
+ Object.prototype.hasOwnProperty.call(t, a) && (e[a] = t[a]);
2253
+ }
2254
+ return e;
2255
+ }, ae.apply(this, arguments);
2256
+ }, Vs = function(e, t) {
2257
+ var r = {};
2258
+ for (var n in e)
2259
+ Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 && (r[n] = e[n]);
2260
+ if (e != null && typeof Object.getOwnPropertySymbols == "function")
2261
+ for (var a = 0, n = Object.getOwnPropertySymbols(e); a < n.length; a++)
2262
+ t.indexOf(n[a]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[a]) && (r[n[a]] = e[n[a]]);
2263
+ return r;
2264
+ }, rt = tt(function(e, t) {
2265
+ var r = e.icon, n = e.id, a = e.className, l = e.extend, u = Vs(e, ["icon", "id", "className", "extend"]), d = "univerjs-icon univerjs-icon-".concat(n, " ").concat(a || "").trim(), p = Yt("_".concat(Js()));
2266
+ return $n(r, "".concat(n), { defIds: r.defIds, idSuffix: p.current }, ae({ ref: t, className: d }, u), l);
2267
+ });
2268
+ function $n(e, t, r, n, a) {
2269
+ return Ye(e.tag, ae(ae({ key: t }, Ys(e, r, a)), n), (Bs(e, r).children || []).map(function(l, u) {
2270
+ return $n(l, "".concat(t, "-").concat(e.tag, "-").concat(u), r, void 0, a);
2271
+ }));
2272
+ }
2273
+ function Ys(e, t, r) {
2274
+ var n = ae({}, e.attrs);
2275
+ r != null && r.colorChannel1 && n.fill === "colorChannel1" && (n.fill = r.colorChannel1);
2276
+ var a = t.defIds;
2277
+ return !a || a.length === 0 || (e.tag === "use" && n["xlink:href"] && (n["xlink:href"] = n["xlink:href"] + t.idSuffix), Object.entries(n).forEach(function(l) {
2278
+ var u = l[0], d = l[1];
2279
+ typeof d == "string" && (n[u] = d.replace(/url\(#(.*)\)/, "url(#$1".concat(t.idSuffix, ")")));
2280
+ })), n;
2281
+ }
2282
+ function Bs(e, t) {
2283
+ var r, n = t.defIds;
2284
+ return !n || n.length === 0 ? e : e.tag === "defs" && (!((r = e.children) === null || r === void 0) && r.length) ? ae(ae({}, e), { children: e.children.map(function(a) {
2285
+ return typeof a.attrs.id == "string" && n && n.indexOf(a.attrs.id) > -1 ? ae(ae({}, a), { attrs: ae(ae({}, a.attrs), { id: a.attrs.id + t.idSuffix }) }) : a;
2286
+ }) }) : e;
2287
+ }
2288
+ function Js() {
2289
+ return Math.random().toString(36).substring(2, 8);
2290
+ }
2291
+ rt.displayName = "UniverIcon";
2292
+ var Ws = {
2293
+ tag: "svg",
2294
+ attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" },
2295
+ children: [
2296
+ {
2297
+ tag: "path",
2298
+ attrs: {
2299
+ fill: "currentColor",
2300
+ d: "M3.99988 3.60921C3.99988 2.32055 5.04456 1.27588 6.33321 1.27588 7.62187 1.27588 8.66654 2.32055 8.66654 3.60921V6.24136C8.66654 7.53002 7.62187 8.5747 6.33321 8.5747 5.04455 8.5747 3.99988 7.53002 3.99988 6.24136V3.60921zM6.33321 2.60921C5.78093 2.60921 5.33321 3.05693 5.33321 3.60921V6.24136C5.33321 6.79364 5.78093 7.24136 6.33321 7.24136 6.88549 7.24136 7.33321 6.79364 7.33321 6.24136V3.60921C7.33321 3.05693 6.88549 2.60921 6.33321 2.60921zM9.99988 3.60921C9.99988 2.32055 11.0446 1.27588 12.3332 1.27588 13.6219 1.27588 14.6665 2.32055 14.6665 3.60921V6.24136C14.6665 7.53002 13.6219 8.5747 12.3332 8.5747 11.0446 8.5747 9.99988 7.53002 9.99988 6.24136V3.60921zM12.3332 2.60921C11.7809 2.60921 11.3332 3.05693 11.3332 3.60921V6.24136C11.3332 6.79364 11.7809 7.24136 12.3332 7.24136 12.8855 7.24136 13.3332 6.79364 13.3332 6.24136V3.60921C13.3332 3.05693 12.8855 2.60921 12.3332 2.60921z",
2301
+ fillRule: "evenodd",
2302
+ clipRule: "evenodd"
2303
+ }
2304
+ },
2305
+ {
2306
+ tag: "path",
2307
+ attrs: {
2308
+ fill: "currentColor",
2309
+ d: "M12.4713 9.58625C12.211 9.3259 11.7889 9.3259 11.5285 9.58625 11.2682 9.8466 11.2682 10.2687 11.5285 10.5291L12.3904 11.391H6.33329C5.9651 11.391 5.66663 11.6895 5.66663 12.0577 5.66663 12.4258 5.9651 12.7243 6.33329 12.7243H12.3904L11.5285 13.5862C11.2682 13.8466 11.2682 14.2687 11.5285 14.5291 11.7889 14.7894 12.211 14.7894 12.4713 14.5291L14.4669 12.5335C14.4851 12.5156 14.5022 12.4968 14.5183 12.477 14.5484 12.4399 14.5739 12.4003 14.5948 12.359 14.6407 12.2685 14.6666 12.1661 14.6666 12.0577 14.6666 11.9492 14.6407 11.8468 14.5948 11.7563 14.5739 11.715 14.5484 11.6754 14.5183 11.6383 14.5022 11.6185 14.4851 11.5997 14.4669 11.5818L12.4713 9.58625zM1.33325 7.98825C1.33325 7.62006 1.63173 7.32159 1.99992 7.32159H2.33325C2.70144 7.32159 2.99992 7.62006 2.99992 7.98825 2.99992 8.35644 2.70144 8.65492 2.33325 8.65492H1.99992C1.63173 8.65492 1.33325 8.35644 1.33325 7.98825z"
2310
+ }
2311
+ }
2312
+ ]
2313
+ }, An = tt(function(e, t) {
2314
+ return Ye(rt, Object.assign({}, e, {
2315
+ id: "add-digits-single",
2316
+ ref: t,
2317
+ icon: Ws
2318
+ }));
2319
+ });
2320
+ An.displayName = "AddDigitsSingle";
2321
+ const Gs = An;
2322
+ var Ks = {
2323
+ tag: "svg",
2324
+ attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" },
2325
+ children: [
2326
+ {
2327
+ tag: "mask",
2328
+ attrs: {
2329
+ id: "mask0_102_556",
2330
+ style: { "mask-type": "alpha" },
2331
+ width: 16,
2332
+ height: 16,
2333
+ x: 0,
2334
+ y: 0,
2335
+ maskUnits: "userSpaceOnUse"
2336
+ },
2337
+ children: [
2338
+ { tag: "path", attrs: { fill: "#D9D9D9", d: "M0 0H16V16H0z" } }
2339
+ ]
2340
+ },
2341
+ {
2342
+ tag: "g",
2343
+ attrs: { mask: "url(#mask0_102_556)" },
2344
+ children: [
2345
+ {
2346
+ tag: "path",
2347
+ attrs: {
2348
+ fill: "currentColor",
2349
+ d: "M0.629584 3.99986C1.13729 3.4922 1.9604 3.49224 2.46806 3.99995L7.57569 9.10806C7.81 9.3424 8.18992 9.3424 8.42424 9.10808L13.5323 3.99998C14.04 3.4923 14.8631 3.4923 15.3708 3.99998C15.8785 4.50766 15.8785 5.33078 15.3708 5.83846L9.41415 11.7951C8.63307 12.5762 7.36669 12.5762 6.58565 11.7951L0.629497 5.83834C0.121839 5.33063 0.121879 4.50752 0.629584 3.99986Z",
2350
+ fillRule: "evenodd",
2351
+ clipRule: "evenodd"
2352
+ }
2353
+ }
2354
+ ]
2355
+ }
2356
+ ]
2357
+ }, Un = tt(function(e, t) {
2358
+ return Ye(rt, Object.assign({}, e, {
2359
+ id: "more-down-single",
2360
+ ref: t,
2361
+ icon: Ks
2362
+ }));
2363
+ });
2364
+ Un.displayName = "MoreDownSingle";
2365
+ const Zs = Un;
2366
+ var qs = {
2367
+ tag: "svg",
2368
+ attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" },
2369
+ children: [
2370
+ {
2371
+ tag: "path",
2372
+ attrs: {
2373
+ fill: "currentColor",
2374
+ d: "M5 3.61825C5 2.32958 6.04468 1.28491 7.33333 1.28491C8.62199 1.28491 9.66667 2.32958 9.66667 3.61825V6.30787C9.66667 7.59653 8.62199 8.64121 7.33333 8.64121C6.04468 8.64121 5 7.59653 5 6.30787V3.61825ZM7.33333 2.61825C6.78105 2.61825 6.33333 3.06596 6.33333 3.61825V6.30787C6.33333 6.86015 6.78106 7.30787 7.33333 7.30787C7.88561 7.30787 8.33333 6.86015 8.33333 6.30787V3.61825C8.33333 3.06596 7.88561 2.61825 7.33333 2.61825Z",
2375
+ fillRule: "evenodd",
2376
+ clipRule: "evenodd"
2377
+ }
2378
+ },
2379
+ {
2380
+ tag: "path",
2381
+ attrs: {
2382
+ fill: "currentColor",
2383
+ d: "M2 7.9745C2 7.60631 2.29848 7.30783 2.66667 7.30783H3C3.36819 7.30783 3.66667 7.60631 3.66667 7.9745 3.66667 8.34269 3.36819 8.64117 3 8.64117H2.66667C2.29848 8.64117 2 8.34269 2 7.9745zM8.80482 9.56197C9.06517 9.82232 9.06517 10.2444 8.80482 10.5048L7.94289 11.3667H13.3334C13.7016 11.3667 14.0001 11.6652 14.0001 12.0334 14.0001 12.4016 13.7016 12.7 13.3334 12.7H7.94289L8.80482 13.562C9.06517 13.8223 9.06517 14.2444 8.80482 14.5048 8.54447 14.7651 8.12236 14.7651 7.86201 14.5048L5.86201 12.5048C5.79809 12.4409 5.74987 12.3672 5.71733 12.2886 5.68474 12.21 5.66675 12.1238 5.66675 12.0334 5.66675 11.943 5.68474 11.8568 5.71733 11.7782 5.74987 11.6996 5.79809 11.6259 5.86201 11.562L7.86201 9.56197C8.12236 9.30162 8.54447 9.30162 8.80482 9.56197z"
2384
+ }
2385
+ }
2386
+ ]
2387
+ }, zn = tt(function(e, t) {
2388
+ return Ye(rt, Object.assign({}, e, {
2389
+ id: "reduce-digits-single",
2390
+ ref: t,
2391
+ icon: qs
2392
+ }));
2393
+ });
2394
+ zn.displayName = "ReduceDigitsSingle";
2395
+ const Qs = zn;
2396
+ var Xs = {
2397
+ tag: "svg",
2398
+ attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" },
2399
+ children: [
2400
+ {
2401
+ tag: "path",
2402
+ attrs: {
2403
+ fill: "currentColor",
2404
+ d: "M4.05443 1.55744C4.34898 1.33653 4.76685 1.39623 4.98776 1.69078L7.99996 5.98276L11.0122 1.69078C11.2331 1.39623 11.6509 1.33653 11.9455 1.55744C12.24 1.77836 12.2997 2.19623 12.0788 2.49078L9.33338 6.42708H12.0788C12.447 6.42708 12.7455 6.72556 12.7455 7.09375C12.7455 7.46194 12.447 7.76042 12.0788 7.76042H8.66659V9.69702H12.3348C12.703 9.69702 13.0015 9.9955 13.0015 10.3637C13.0015 10.7319 12.703 11.0304 12.3348 11.0304H8.66659V13.9091C8.66659 14.2773 8.36811 14.5758 7.99992 14.5758C7.63173 14.5758 7.33325 14.2773 7.33325 13.9091V11.0304H3.66508C3.29689 11.0304 2.99841 10.7319 2.99841 10.3637C2.99841 9.9955 3.29689 9.69702 3.66508 9.69702H7.33325V7.76042H3.92109C3.5529 7.76042 3.25443 7.46194 3.25443 7.09375C3.25443 6.72556 3.5529 6.42708 3.92109 6.42708H6.66653L3.92109 2.49078C3.70018 2.19623 3.75987 1.77836 4.05443 1.55744Z"
2405
+ }
2406
+ }
2407
+ ]
2408
+ }, Ln = tt(function(e, t) {
2409
+ return Ye(rt, Object.assign({}, e, {
2410
+ id: "rmb-single",
2411
+ ref: t,
2412
+ icon: Xs
2413
+ }));
2414
+ });
2415
+ Ln.displayName = "RmbSingle";
2416
+ const ea = Ln, gt = [
2417
+ {
2418
+ label: "sheet.numfmt.general",
2419
+ pattern: null
2420
+ },
2421
+ {
2422
+ label: "sheet.numfmt.text",
2423
+ pattern: "@@@"
2424
+ },
2425
+ "|",
2426
+ {
2427
+ label: "sheet.numfmt.number",
2428
+ pattern: "0"
2429
+ },
2430
+ "|",
2431
+ {
2432
+ label: "sheet.numfmt.accounting",
2433
+ pattern: '"¥" #,##0.00_);[Red]("¥"#,##0.00)'
2434
+ },
2435
+ {
2436
+ label: "sheet.numfmt.financialValue",
2437
+ pattern: "#,##0.00;[Red]#,##0.00"
2438
+ },
2439
+ {
2440
+ label: "sheet.numfmt.currency",
2441
+ pattern: '"¥"#,##0.00_);[Red]("¥"#,##0.00)'
2442
+ },
2443
+ {
2444
+ label: "sheet.numfmt.roundingCurrency",
2445
+ pattern: '"¥"#,##0;[Red]"¥"#,##0'
2446
+ },
2447
+ "|",
2448
+ {
2449
+ label: "sheet.numfmt.date",
2450
+ pattern: "yyyy-mm-dd;@"
2451
+ },
2452
+ {
2453
+ label: "sheet.numfmt.time",
2454
+ pattern: 'am/pm h":"mm":"ss'
2455
+ },
2456
+ {
2457
+ label: "sheet.numfmt.dateTime",
2458
+ pattern: "yyyy-m-d am/pm h:mm"
2459
+ },
2460
+ {
2461
+ label: "sheet.numfmt.timeDuration",
2462
+ pattern: "h:mm:ss"
2463
+ },
2464
+ "|",
2465
+ {
2466
+ label: "sheet.numfmt.moreFmt",
2467
+ pattern: ""
2468
+ }
2469
+ ], ta = (e) => {
2470
+ var n;
2471
+ const t = de(me), r = (n = e.value) != null ? n : t.t("sheet.numfmt.general");
2472
+ return /* @__PURE__ */ O.jsx("span", { className: "more-numfmt-type", children: r });
2473
+ }, na = () => {
2474
+ const e = de(Ce), t = de(me), r = Yr(), n = de(Ve), a = (d) => {
2475
+ const p = n.getLast();
2476
+ if (!p)
2477
+ return;
2478
+ const v = r.get(Ar), h = p.range, f = [];
2479
+ ne.foreach(h, (b, I) => {
2480
+ d ? f.push({ row: b, col: I, pattern: d, type: Gt(d) }) : f.push({ row: b, col: I });
2481
+ }), e.executeCommand(Le.id, { values: f }), v.focus();
2482
+ }, l = (d) => {
2483
+ if (d === 0)
2484
+ a(null);
2485
+ else if (d === gt.length - 1)
2486
+ e.executeCommand(Ct.id);
2487
+ else {
2488
+ const p = gt[d];
2489
+ p.pattern && a(p.pattern);
2490
+ }
2491
+ }, u = 1220;
2492
+ return /* @__PURE__ */ O.jsx("div", { className: "more-numfmt-type-options", children: gt.map((d, p) => d === "|" ? /* @__PURE__ */ O.jsx("div", { className: "line m-t-4", onClick: (v) => v.stopPropagation() }, p) : /* @__PURE__ */ O.jsxs(
2493
+ "div",
2494
+ {
2495
+ className: "option-item m-t-4",
2496
+ onClick: () => {
2497
+ l(p);
2498
+ },
2499
+ children: [
2500
+ /* @__PURE__ */ O.jsx("div", { children: t.t(d.label) }),
2501
+ /* @__PURE__ */ O.jsx("div", { className: "m-l-26", children: d.pattern ? ge.format(d.pattern || "", u, { locale: "zh-CN" }) : "" })
2502
+ ]
2503
+ },
2504
+ p
2505
+ )) });
2506
+ }, ra = (e) => {
2507
+ const t = "icon-rmbSingle";
2508
+ return e.register(t, ea), e.register("MoreDownSingle", Zs), (r) => ({
2509
+ icon: t,
2510
+ id: On.id,
2511
+ title: "sheet.numfmt.currency",
2512
+ tooltip: "sheet.numfmt.currency",
2513
+ type: Rt.BUTTON,
2514
+ group: wt.TOOLBAR_FORMULAS_INSERT,
2515
+ positions: [Pt.TOOLBAR_START],
2516
+ hidden$: Dt(r, jt.SHEET),
2517
+ disabled$: It(r)
2518
+ });
2519
+ }, sa = (e) => {
2520
+ const t = "icon-addDigitsSingle";
2521
+ return e.register(t, Gs), (r) => ({
2522
+ icon: t,
2523
+ id: Pn.id,
2524
+ title: "sheet.numfmt.addDecimal",
2525
+ tooltip: "sheet.numfmt.addDecimal",
2526
+ type: Rt.BUTTON,
2527
+ positions: [Pt.TOOLBAR_START],
2528
+ group: wt.TOOLBAR_FORMULAS_INSERT,
2529
+ hidden$: Dt(r, jt.SHEET),
2530
+ disabled$: It(r)
2531
+ });
2532
+ }, aa = (e) => {
2533
+ const t = "icon-reduceDigitsSingle";
2534
+ return e.register(t, Qs), (r) => ({
2535
+ icon: t,
2536
+ id: En.id,
2537
+ title: "sheet.numfmt.subtractDecimal",
2538
+ tooltip: "sheet.numfmt.subtractDecimal",
2539
+ type: Rt.BUTTON,
2540
+ group: wt.TOOLBAR_FORMULAS_INSERT,
2541
+ positions: [Pt.TOOLBAR_START],
2542
+ hidden$: Dt(r, jt.SHEET),
2543
+ disabled$: It(r)
2544
+ });
2545
+ }, ia = (e) => {
2546
+ const t = "sheet.numfmt.moreNumfmtType", r = "sheet.numfmt.moreNumfmtType.options";
2547
+ return e.register(t, ta), e.register(r, na), (n) => {
2548
+ const a = n.get(ye), l = n.get(ve), u = n.get(Ce), d = n.get(me), p = n.get(Ve), v = new ke(
2549
+ (h) => Ht(
2550
+ p.selectionMoveEnd$,
2551
+ new ke((f) => {
2552
+ const b = [te.id, oe.id], I = u.onCommandExecuted((D) => {
2553
+ b.includes(D.id) && f.next(null);
2554
+ });
2555
+ return () => I.dispose();
2556
+ })
2557
+ ).subscribe(() => {
2558
+ const f = p.getSelections();
2559
+ if (f && f[0]) {
2560
+ const b = l.getCurrentUniverSheetInstance(), I = b.getActiveSheet(), D = f[0].range, E = D.startRow, R = D.startColumn, U = a.getValue(b.getUnitId(), I.getSheetId(), E, R);
2561
+ let V = d.t("sheet.numfmt.general");
2562
+ if (U) {
2563
+ const W = U.pattern, Q = gt.filter((pe) => typeof pe == "object" && pe.pattern).find(
2564
+ (pe) => Be(W, pe.pattern)
2565
+ );
2566
+ Q && typeof Q == "object" && Q.pattern ? V = d.t(Q.label) : V = d.t("sheet.numfmt.moreFmt");
2567
+ }
2568
+ h.next(V);
2569
+ }
2570
+ })
2571
+ );
2572
+ return {
2573
+ // icon: 'MoreDownSingle',
2574
+ label: t,
2575
+ id: Ct.id,
2576
+ tooltip: "sheet.numfmt.title",
2577
+ type: Rt.SELECTOR,
2578
+ group: wt.TOOLBAR_FORMULAS_INSERT,
2579
+ positions: [Pt.TOOLBAR_START],
2580
+ selections: [
2581
+ {
2582
+ label: {
2583
+ name: r,
2584
+ hoverable: !1
2585
+ }
2586
+ }
2587
+ ],
2588
+ value$: v,
2589
+ hidden$: Dt(n, jt.SHEET),
2590
+ disabled$: It(n)
2591
+ };
2592
+ };
2593
+ };
2594
+ var oa = Object.defineProperty, ca = Object.getOwnPropertyDescriptor, la = (e, t, r, n) => {
2595
+ for (var a = n > 1 ? void 0 : n ? ca(t, r) : t, l = e.length - 1, u; l >= 0; l--)
2596
+ (u = e[l]) && (a = (n ? u(t, r, a) : u(a)) || a);
2597
+ return n && a && oa(t, r, a), a;
2598
+ }, At = (e, t) => (r, n) => t(r, n, e);
2599
+ let vt = class extends Me {
2600
+ constructor(e, t, r) {
2601
+ super(), this._injector = e, this._componentManager = t, this._menuService = r, this._initMenu();
2602
+ }
2603
+ _initMenu() {
2604
+ [sa, aa, ra, ia].map((e) => e(this._componentManager)).forEach((e) => {
2605
+ this.disposeWithMe(this._menuService.addMenuItem(e(this._injector)));
2606
+ });
2607
+ }
2608
+ };
2609
+ vt = la([
2610
+ je(_e.Rendered, vt),
2611
+ At(0, $(we)),
2612
+ At(1, $(xn)),
2613
+ At(2, $(zr))
2614
+ ], vt);
2615
+ var ua = Object.defineProperty, da = Object.getOwnPropertyDescriptor, ma = (e, t, r, n) => {
2616
+ for (var a = n > 1 ? void 0 : n ? da(t, r) : t, l = e.length - 1, u; l >= 0; l--)
2617
+ (u = e[l]) && (a = (n ? u(t, r, a) : u(a)) || a);
2618
+ return n && a && ua(t, r, a), a;
2619
+ }, Ue = (e, t) => (r, n) => t(r, n, e);
2620
+ const pa = [oe.id, te.id];
2621
+ let _t = class extends Me {
2622
+ constructor(e, t, r, n, a, l) {
2623
+ super(), this._numfmtService = e, this._univerInstanceService = t, this._injector = r, this._refRangeService = n, this._sheetSkeletonManagerService = a, this._commandService = l, this._registerRefRange(), this._mergeRefMutations();
2587
2624
  }
2588
2625
  _mergeRefMutations() {
2589
2626
  this._refRangeService.interceptor.intercept(this._refRangeService.interceptor.getInterceptPoints().MERGE_REDO, {
2590
- handler: (e, t, a) => {
2627
+ handler: (e, t, r) => {
2591
2628
  if (!e)
2592
- return a(e);
2593
- const n = e.filter((i) => !Xs.includes(i.id));
2594
- return n.push(...Et(e)), a(n);
2629
+ return r(e);
2630
+ const n = e.filter((a) => !pa.includes(a.id));
2631
+ return n.push(...St(e)), r(n);
2595
2632
  }
2596
2633
  });
2597
2634
  }
2598
2635
  _registerRefRange() {
2599
2636
  this.disposeWithMe(
2600
- De(
2601
- Ft(
2637
+ Te(
2638
+ Ht(
2602
2639
  this._sheetSkeletonManagerService.currentSkeleton$.pipe(
2603
- Ze((e) => e == null ? void 0 : e.sheetId),
2604
- _n()
2640
+ qe((e) => e == null ? void 0 : e.sheetId),
2641
+ Mn()
2605
2642
  ),
2606
2643
  this._numfmtService.modelReplace$
2607
2644
  ).pipe(
2608
- yn(
2609
- () => new Oe((e) => {
2610
- const t = new gn();
2645
+ jn(
2646
+ () => new ke((e) => {
2647
+ const t = new Sn();
2611
2648
  return e.next(t), () => {
2612
2649
  t.dispose();
2613
2650
  };
2614
2651
  })
2615
2652
  )
2616
2653
  ).subscribe((e) => {
2617
- const a = this._univerInstanceService.getCurrentUniverSheetInstance().getUnitId(), n = this._univerInstanceService.getCurrentUniverSheetInstance().getActiveSheet().getSheetId(), i = this._numfmtService.getModel(a, n), l = /* @__PURE__ */ new Map(), u = (d, m, v) => {
2654
+ const r = this._univerInstanceService.getCurrentUniverSheetInstance().getUnitId(), n = this._univerInstanceService.getCurrentUniverSheetInstance().getActiveSheet().getSheetId(), a = this._numfmtService.getModel(r, n), l = /* @__PURE__ */ new Map(), u = (d, p, v) => {
2618
2655
  const h = {
2619
- startRow: m,
2656
+ startRow: p,
2620
2657
  startColumn: v,
2621
- endRow: m,
2658
+ endRow: p,
2622
2659
  endColumn: v
2623
2660
  };
2624
2661
  let f = [];
2625
2662
  switch (d.id) {
2626
2663
  case ue.DeleteRangeMoveLeftCommandId: {
2627
- f = yr(d, h);
2664
+ f = xr(d, h);
2628
2665
  break;
2629
2666
  }
2630
2667
  case ue.DeleteRangeMoveUpCommandId: {
2631
- f = _r(d, h);
2668
+ f = jr(d, h);
2632
2669
  break;
2633
2670
  }
2634
2671
  case ue.InsertColCommandId: {
2635
- f = vr(d, h);
2672
+ f = Mr(d, h);
2636
2673
  break;
2637
2674
  }
2638
2675
  case ue.InsertRangeMoveDownCommandId: {
2639
- f = gr(d, h);
2676
+ f = Cr(d, h);
2640
2677
  break;
2641
2678
  }
2642
2679
  case ue.InsertRangeMoveRightCommandId: {
2643
- f = hr(d, h);
2680
+ f = Sr(d, h);
2644
2681
  break;
2645
2682
  }
2646
2683
  case ue.InsertRowCommandId: {
2647
- f = fr(d, h);
2684
+ f = br(d, h);
2648
2685
  break;
2649
2686
  }
2650
2687
  case ue.MoveRangeCommandId: {
2651
- f = pr(d, h);
2688
+ f = yr(d, h);
2652
2689
  break;
2653
2690
  }
2654
2691
  case ue.RemoveColCommandId: {
2655
- f = mr(d, h);
2692
+ f = _r(d, h);
2656
2693
  break;
2657
2694
  }
2658
2695
  case ue.RemoveRowCommandId: {
2659
- f = dr(d, h);
2696
+ f = vr(d, h);
2660
2697
  break;
2661
2698
  }
2662
2699
  case ue.MoveColsCommandId: {
2663
- f = ur(d, h);
2700
+ f = gr(d, h);
2664
2701
  break;
2665
2702
  }
2666
2703
  case ue.MoveRowsCommandId:
2667
- f = lr(d, h);
2704
+ f = hr(d, h);
2668
2705
  }
2669
- const b = br(f, h), I = this._numfmtService.getValue(a, n, m, v);
2706
+ const b = Ir(f, h), I = this._numfmtService.getValue(r, n, p, v);
2670
2707
  if (!b && I) {
2671
2708
  const D = {
2672
- id: re.id,
2709
+ id: te.id,
2673
2710
  params: {
2674
- unitId: a,
2711
+ unitId: r,
2675
2712
  subUnitId: n,
2676
- ranges: [{ startColumn: v, startRow: m, endColumn: v, endRow: m }]
2713
+ ranges: [{ startColumn: v, startRow: p, endColumn: v, endRow: p }]
2677
2714
  }
2678
- }, P = Pe(this._injector, D.params);
2715
+ }, E = Fe(this._injector, D.params);
2679
2716
  return {
2680
2717
  redos: [D],
2681
- undos: P
2718
+ undos: E
2682
2719
  };
2683
2720
  }
2684
2721
  if (I && b) {
2685
- const D = [], P = [], R = [
2722
+ const D = [], E = [], R = [
2686
2723
  {
2687
2724
  pattern: I.pattern,
2688
2725
  type: I.type,
2689
2726
  row: b.startRow,
2690
2727
  col: b.startColumn
2691
2728
  }
2692
- ], A = {
2729
+ ], U = {
2693
2730
  id: oe.id,
2694
- params: qe(a, n, R)
2695
- }, V = Qe(this._injector, A.params), W = {
2696
- id: re.id,
2731
+ params: Xe(r, n, R)
2732
+ }, V = et(this._injector, U.params), W = {
2733
+ id: te.id,
2697
2734
  params: {
2698
- unitId: a,
2735
+ unitId: r,
2699
2736
  subUnitId: n,
2700
- ranges: [{ startColumn: v, startRow: m, endColumn: v, endRow: m }]
2737
+ ranges: [{ startColumn: v, startRow: p, endColumn: v, endRow: p }]
2701
2738
  }
2702
- }, Q = Pe(this._injector, W.params);
2703
- return D.push(A, W), P.push(...V, ...Q), {
2739
+ }, Q = Fe(this._injector, W.params);
2740
+ return D.push(U, W), E.push(...V, ...Q), {
2704
2741
  redos: D,
2705
- undos: P.reverse()
2742
+ undos: E.reverse()
2706
2743
  };
2707
2744
  }
2708
2745
  return { redos: [], undos: [] };
2709
2746
  };
2710
- i && i.forValue((d, m) => {
2747
+ a && a.forValue((d, p) => {
2711
2748
  const v = {
2712
2749
  startRow: d,
2713
- startColumn: m,
2750
+ startColumn: p,
2714
2751
  endRow: d,
2715
- endColumn: m
2752
+ endColumn: p
2716
2753
  }, h = this._refRangeService.registerRefRange(
2717
2754
  v,
2718
- (f) => u(f, d, m)
2755
+ (f) => u(f, d, p)
2719
2756
  );
2720
- l.set(`${d}_${m}`, h), e.add(h);
2757
+ l.set(`${d}_${p}`, h), e.add(h);
2721
2758
  }), e.add(
2722
- De(
2723
- new Oe((d) => {
2759
+ Te(
2760
+ new ke((d) => {
2724
2761
  e.add(
2725
- this._commandService.onCommandExecuted((m) => {
2726
- [oe.id, re.id].includes(m.id) && d.next(m.params);
2762
+ this._commandService.onCommandExecuted((p) => {
2763
+ [oe.id, te.id].includes(p.id) && d.next(p.params);
2727
2764
  })
2728
2765
  );
2729
2766
  }).pipe(
2730
- ln(
2731
- (d) => d.unitId === a && d.subUnitId === n
2767
+ fn(
2768
+ (d) => d.unitId === r && d.subUnitId === n
2732
2769
  ),
2733
- Ze((d) => d.ranges ? d.ranges : d.values ? Object.keys(d.values).reduce((m, v) => {
2770
+ qe((d) => d.ranges ? d.ranges : d.values ? Object.keys(d.values).reduce((p, v) => {
2734
2771
  const h = d.values[v];
2735
- return m.push(...h.ranges), m;
2772
+ return p.push(...h.ranges), p;
2736
2773
  }, []) : []),
2737
2774
  Fr(300),
2738
2775
  // updating the listener moves to the next queue
2739
- Ze(
2740
- (d) => d.reduce((m, v) => (m.push(...v), m), [])
2776
+ qe(
2777
+ (d) => d.reduce((p, v) => (p.push(...v), p), [])
2741
2778
  ),
2742
- ln((d) => !!d.length)
2779
+ fn((d) => !!d.length)
2743
2780
  ).subscribe((d) => {
2744
- d.forEach((m) => {
2745
- ne.foreach(m, (v, h) => {
2781
+ d.forEach((p) => {
2782
+ ne.foreach(p, (v, h) => {
2746
2783
  const f = `${v}_${h}`, b = l.get(f);
2747
- if (l.delete(f), b && b.dispose(), this._numfmtService.getValue(a, n, v, h)) {
2784
+ if (l.delete(f), b && b.dispose(), this._numfmtService.getValue(r, n, v, h)) {
2748
2785
  const D = {
2749
2786
  startRow: v,
2750
2787
  startColumn: h,
2751
2788
  endRow: v,
2752
2789
  endColumn: h
2753
- }, P = this._refRangeService.registerRefRange(
2790
+ }, E = this._refRangeService.registerRefRange(
2754
2791
  D,
2755
2792
  (R) => u(R, v, h)
2756
2793
  );
2757
- l.set(f, P), e.add(P);
2794
+ l.set(f, E), e.add(E);
2758
2795
  }
2759
2796
  });
2760
2797
  });
@@ -2766,43 +2803,43 @@ let pt = class extends Le {
2766
2803
  );
2767
2804
  }
2768
2805
  };
2769
- pt = Qs([
2770
- He(Ee.Rendered, pt),
2771
- $e(0, z(be)),
2772
- $e(1, z(ge)),
2773
- $e(2, z(Ne)),
2774
- $e(3, z(cr)),
2775
- $e(4, z(vn)),
2776
- $e(5, z(je))
2777
- ], pt);
2778
- var ea = Object.defineProperty, ta = Object.getOwnPropertyDescriptor, na = (e, t, a, n) => {
2779
- for (var i = n > 1 ? void 0 : n ? ta(t, a) : t, l = e.length - 1, u; l >= 0; l--)
2780
- (u = e[l]) && (i = (n ? u(t, a, i) : u(i)) || i);
2781
- return n && i && ea(t, a, i), i;
2782
- }, ot = (e, t) => (a, n) => t(a, n, e);
2783
- let ft = class extends Le {
2784
- constructor(e, t, a, n) {
2785
- super(), this._numfmtService = e, this._sheetInterceptorService = t, this._univerInstanceService = a, this._injector = n, this._initSheetChange();
2806
+ _t = ma([
2807
+ je(_e.Rendered, _t),
2808
+ Ue(0, $(ye)),
2809
+ Ue(1, $(ve)),
2810
+ Ue(2, $(we)),
2811
+ Ue(3, $(fr)),
2812
+ Ue(4, $(Lt)),
2813
+ Ue(5, $(Ce))
2814
+ ], _t);
2815
+ var fa = Object.defineProperty, ha = Object.getOwnPropertyDescriptor, ga = (e, t, r, n) => {
2816
+ for (var a = n > 1 ? void 0 : n ? ha(t, r) : t, l = e.length - 1, u; l >= 0; l--)
2817
+ (u = e[l]) && (a = (n ? u(t, r, a) : u(a)) || a);
2818
+ return n && a && fa(t, r, a), a;
2819
+ }, lt = (e, t) => (r, n) => t(r, n, e);
2820
+ let yt = class extends Me {
2821
+ constructor(e, t, r, n) {
2822
+ super(), this._numfmtService = e, this._sheetInterceptorService = t, this._univerInstanceService = r, this._injector = n, this._initSheetChange();
2786
2823
  }
2787
2824
  _initSheetChange() {
2788
2825
  this.disposeWithMe(
2789
2826
  this._sheetInterceptorService.interceptCommand({
2790
2827
  getMutations: (e) => {
2791
- if (e.id === Sr.id) {
2792
- const t = e.params, a = t.unitId || ra(this._univerInstanceService), n = t.subUnitId || sa(this._univerInstanceService), i = this._numfmtService.getModel(a, n);
2793
- if (!i)
2828
+ if (e.id === Rr.id) {
2829
+ const t = e.params, r = t.unitId || va(this._univerInstanceService), n = t.subUnitId || _a(this._univerInstanceService), a = this._numfmtService.getModel(r, n);
2830
+ if (!a)
2794
2831
  return { redos: [], undos: [] };
2795
2832
  const l = [];
2796
- i.forValue((m, v) => {
2797
- l.push({ startColumn: v, endColumn: v, startRow: m, endRow: m });
2833
+ a.forValue((p, v) => {
2834
+ l.push({ startColumn: v, endColumn: v, startRow: p, endRow: p });
2798
2835
  });
2799
2836
  const u = {
2800
- unitId: a,
2837
+ unitId: r,
2801
2838
  subUnitId: n,
2802
- ranges: Ce(l)
2803
- }, d = Pe(this._injector, u);
2839
+ ranges: Ie(l)
2840
+ }, d = Fe(this._injector, u);
2804
2841
  return {
2805
- redos: [{ id: re.id, params: u }],
2842
+ redos: [{ id: te.id, params: u }],
2806
2843
  undos: d
2807
2844
  };
2808
2845
  }
@@ -2812,33 +2849,33 @@ let ft = class extends Le {
2812
2849
  );
2813
2850
  }
2814
2851
  };
2815
- ft = na([
2816
- He(Ee.Rendered, ft),
2817
- ot(0, z(be)),
2818
- ot(1, z(Tt)),
2819
- ot(2, z(ge)),
2820
- ot(3, z(Ne))
2821
- ], ft);
2822
- const ra = (e) => e.getCurrentUniverSheetInstance().getUnitId(), sa = (e) => e.getCurrentUniverSheetInstance().getActiveSheet().getSheetId();
2823
- var aa = Object.defineProperty, ia = Object.getOwnPropertyDescriptor, oa = (e, t, a, n) => {
2824
- for (var i = n > 1 ? void 0 : n ? ia(t, a) : t, l = e.length - 1, u; l >= 0; l--)
2825
- (u = e[l]) && (i = (n ? u(t, a, i) : u(i)) || i);
2826
- return n && i && aa(t, a, i), i;
2827
- }, ca = (e, t) => (a, n) => t(a, n, e), Pt;
2828
- let fn = (Pt = class extends rr {
2852
+ yt = ga([
2853
+ je(_e.Rendered, yt),
2854
+ lt(0, $(ye)),
2855
+ lt(1, $(xt)),
2856
+ lt(2, $(ve)),
2857
+ lt(3, $(we))
2858
+ ], yt);
2859
+ const va = (e) => e.getCurrentUniverSheetInstance().getUnitId(), _a = (e) => e.getCurrentUniverSheetInstance().getActiveSheet().getSheetId();
2860
+ var ya = Object.defineProperty, ba = Object.getOwnPropertyDescriptor, Sa = (e, t, r, n) => {
2861
+ for (var a = n > 1 ? void 0 : n ? ba(t, r) : t, l = e.length - 1, u; l >= 0; l--)
2862
+ (u = e[l]) && (a = (n ? u(t, r, a) : u(a)) || a);
2863
+ return n && a && ya(t, r, a), a;
2864
+ }, Ca = (e, t) => (r, n) => t(r, n, e), Ut;
2865
+ let _n = (Ut = class extends lr {
2829
2866
  constructor(e, t) {
2830
- super(gt), this._injector = t;
2867
+ super(Qe), this._injector = t;
2831
2868
  }
2832
2869
  onStarting() {
2833
- this._injector.add([Ht, { useClass: ut, lazy: !1 }]), this._injector.add([mt]), this._injector.add([_t]), this._injector.add([pt]), this._injector.add([ft]), this._injector.add([dt]), this._injector.add([ct]);
2870
+ this._injector.add([Kt, { useClass: mt, lazy: !1 }]), this._injector.add([ft]), this._injector.add([Mt]), this._injector.add([_t]), this._injector.add([yt]), this._injector.add([pt]), this._injector.add([ut]), this._injector.add([dt]), this._injector.add([ht]), this._injector.add([vt]);
2834
2871
  }
2835
- }, ke(Pt, "type", sr.Sheet), Pt);
2836
- fn = oa([
2837
- ca(1, z(Ne))
2838
- ], fn);
2872
+ }, Ne(Ut, "type", ur.Sheet), Ut);
2873
+ _n = Sa([
2874
+ Ca(1, $(we))
2875
+ ], _n);
2839
2876
  export {
2840
- Ue as SetNumfmtCommand,
2841
- fn as UniverSheetsNumfmtPlugin,
2842
- Sa as enUS,
2843
- zr as zhCN
2877
+ Le as SetNumfmtCommand,
2878
+ _n as UniverSheetsNumfmtPlugin,
2879
+ Ta as enUS,
2880
+ Br as zhCN
2844
2881
  };