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

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 Ye, 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 Ue, 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 Be, 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 Ze, 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 zr, MenuItemType as Rt, MenuGroup as wt, MenuPosition as Pt, getMenuHiddenObservable as Dt, IMenuService as Ur } from "@univerjs/ui";
11
+ import { Observable as ke, combineLatest as Lr, merge as Yt } from "rxjs";
12
+ import Yr, { createContext as Br, useState as ie, useEffect as Bt, useRef as Ht, useContext as In, useMemo as Se, createElement as He, forwardRef as tt } from "react";
13
+ import { InputNumber as Vt, Select as Jt, SelectList as Wt, Button as hn } from "@univerjs/design";
14
+ import { useDependency as de, useInjector as Hr } from "@wendellhu/redi/react-bindings";
15
+ const Le = {
16
16
  id: "sheet.command.numfmt.set.numfmt",
17
- type: ze.COMMAND,
17
+ type: Ye.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((z) => {
33
+ const B = f.values[z];
34
+ B.ranges = Ie(B.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
+ }, Vr = {
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,726 +259,726 @@ 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 qr(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 }, z = Object.assign({}, R);
350
+ function B(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
+ z[s] = o ?? R[s];
356
356
  }
357
357
  }
358
- return { ...A };
358
+ return { ...z };
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 q(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, q({ 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] }, q(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", q({ 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 || q(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), q({ 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), q(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");
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
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);
431
+ !C.type && U && !U.used && 80 & U.size && (U.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);
433
+ C.size = 64, C.type = "sec", C.pad = /ss/.test(P);
434
434
  const U = g[g.length - 1];
435
435
  U && 32 & U.size ? C.used = !0 : U && U.indeterminate && (delete U.indeterminate, U.size = 32, U.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), q(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, q({ 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), q({ type: "subsec", size: P, decimals: C, date: 1, raw: c[0] }, s);
443
+ } else if ((c = /^\\(.)/.exec(m)) || (c = /^"([^"]*?)"/.exec(m)))
444
+ q(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);
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 && q(F, s);
450
+ const U = v(P);
451
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);
452
+ const H = parseInt(P, 16);
453
+ isFinite(H) && 16711680 & H && (H >> 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, q("%", s);
459
+ else if (c = /^_(\\.|.)/.exec(m))
460
+ q(" ", s);
461
+ else if (c = /^\./.exec(m))
462
+ q({ 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", q({ 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]], q(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) && q({ 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 Zt(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 Yn(i) {
570
+ return Qt(i + 1462);
571
571
  }
572
- function Fn(s) {
573
- if (s === 60)
572
+ function Bn(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 ? Bn(m) : s === -1 ? Yn(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 ?? 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 Hn(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 Vn(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] === ".") {
655
- Y--;
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 U = String(D(C < 0 ? k * 10 ** -C : k / 10 ** C, 15));
652
+ let H = U.length, Y = !0, Z = 0;
653
+ for (; Z <= U.length; ) {
654
+ if (U[Z] === ".") {
655
+ H--;
656
656
  break;
657
657
  }
658
- U[q] === "0" && H ? Y-- : H = !1, q++;
658
+ U[Z] === "0" && Y ? H-- : Y = !1, Z++;
659
659
  }
660
- F = Y - C, F < 0 && (F = 0, k = 0);
660
+ F = H - 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, U = 0, H = 0;
692
+ const Y = 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
- const B = Math.ceil(Math.log10(L < 0 ? -L : L)), j = 10 ** (16 - Math.floor(B));
696
+ const V = Math.ceil(Math.log10(L < 0 ? -L : L)), j = 10 ** (16 - Math.floor(V));
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 V = 10 ** -rn(L, s.int_max), j = D(L * V, s.frac_max) / V;
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) {
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;
714
- c = B ? c.slice(0, B) + L : L;
710
+ if (s.grouping) {
711
+ let L = "", V = c.length;
712
+ for (V > s.group_pri && (V -= s.group_pri, L = Y.group + c.slice(V, V + s.group_pri) + L); V > s.group_sec; )
713
+ V -= s.group_sec, L = Y.group + c.slice(V, V + s.group_sec) + L;
714
+ c = V ? c.slice(0, V) + L : L;
715
715
  }
716
- r.dec_fractions && (g = String(D(s, r.frac_max)).split(".")[1] || "");
717
- let q = !1;
718
- if (r.fractions) {
719
- const L = Math.abs(r.integer ? s % 1 : s);
716
+ s.dec_fractions && (g = String(D(i, s.frac_max)).split(".")[1] || "");
717
+ let Z = !1;
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 (Z = !0, isFinite(s.denominator))
722
+ y += s.denominator, M += D(L * s.denominator), M === "0" && (M = "", y = "", Z = !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 V = E(L, s.integer ? s.num_max : 1 / 0, s.den_max);
725
+ M += V[0], y += V[1], s.integer && M === "0" && (c || (c = "0"), M = "", y = "", Z = !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;
733
- (B === 512 && Y > 0.9995 || B === 256 && Y > 0.995 || B === 128 && Y > 0.95 || !B && Y >= 0.5) && (S++, Y = 0);
728
+ if (s.date) {
729
+ N = Math.trunc(i);
730
+ const L = We * (i - N);
731
+ if (S = Math.floor(L), H = L - S, Math.abs(H) < 1e-6 ? H = 0 : H > 0.9999 && (H = 0, S += 1, S === We && (S = 0, N += 1)), H) {
732
+ const V = 512 & s.date || 256 & s.date || 128 & s.date;
733
+ (V === 512 && H > 0.9995 || V === 256 && H > 0.995 || V === 128 && H > 0.95 || !V && H >= 0.5) && (S++, H = 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 V = Xt(i, s.date_system, o.leap1900);
737
+ k = V[0], A = V[1], T = V[2];
738
738
  }
739
739
  if (S) {
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;
740
+ const V = S < 0 ? We + S : S;
741
+ U = Math.floor(V) % 60, F = Math.floor(V / 60) % 60, P = Math.floor(V / 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 ? [Y.negative] : [], 0, i, Y).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, V = s.tokens.length; L < V; 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" ? Z ? w.push(j.value) : (s.num_min > 0 || s.den_min > 0) && w.push(j.value.replace(/./g, W["?"])) : j.rule === "num+int" ? Z && c ? w.push(j.value) : s.den_min > 0 && (c || s.num_min) && w.push(j.value.replace(/./g, W["?"])) : j.rule === "den" && (Z ? 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 : Y.decimal);
765
765
  else if (j.type === "general")
766
- Kt(w, 0, s, H);
766
+ tn(w, 0, i, Y);
767
767
  else if (j.type === "exp")
768
- w.push(H.exponent);
768
+ w.push(Y.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(Y.negative) : w.push(Y.negative));
771
771
  else if (j.type === "plus")
772
- w.push(H.positive);
772
+ w.push(Y.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
+ Z ? 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(Y.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(Y.mmmm6[A - 1].charAt(0)) : w.push(Y.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(Y.mmm6[A - 1]) : w.push(Y.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(Y.mmmm6[A - 1]) : w.push(Y.mmmm[A - 1]);
804
804
  else if (j.type === "weekday-short")
805
- w.push(H.ddd[C]);
805
+ w.push(Y.ddd[C]);
806
806
  else if (j.type === "weekday")
807
- w.push(H.dddd[C]);
807
+ w.push(Y.dddd[C]);
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
816
  w.push(j.pad && U < 10 ? "0" : "", U);
817
817
  else if (j.type === "subsec") {
818
- w.push(H.decimal);
819
- const K = Y.toFixed(r.sec_decimals);
818
+ w.push(Y.decimal);
819
+ const K = H.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(Y.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(Y.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(Y.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(Y.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 qn = { jan: 1, feb: 2, mar: 3, apr: 4, may: 5, jun: 6, jul: 7, aug: 8, sep: 9, oct: 10, nov: 11, dec: 12 }, Zn = { 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
879
  for (let U = 0; U < o.length; U++) {
880
- const Y = o[U];
881
- if (Y === "-") {
882
- if (x || E)
880
+ const H = o[U];
881
+ if (H === "-") {
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(H)) {
886
+ if (A)
887
887
  return null;
888
- $ = !0, T = Y;
889
- } else if (Y === "(") {
890
- if (E || x)
888
+ A = !0, T = H;
889
+ } else if (H === "(") {
890
+ if (N || x)
891
891
  return null;
892
- E = !0, g = -1;
893
- } else if (Y === "%") {
894
- if (N)
892
+ N = !0, g = -1;
893
+ } else if (H === "%") {
894
+ if (k)
895
895
  return null;
896
- N = !0;
896
+ k = !0;
897
897
  }
898
898
  }
899
899
  for (let U = 0; U < y.length; U++) {
900
- const Y = y[U];
901
- if (Ie.test(Y)) {
902
- if ($)
900
+ const H = y[U];
901
+ if (De.test(H)) {
902
+ if (A)
903
903
  return null;
904
- $ = !0, T = Y, C = !0;
905
- } else if (Y === ")") {
906
- if (S || !E)
904
+ A = !0, T = H, C = !0;
905
+ } else if (H === ")") {
906
+ if (S || !N)
907
907
  return null;
908
908
  S = !0;
909
- } else if (Y === "%") {
910
- if (N)
909
+ } else if (H === "%") {
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 ($) {
922
+ c = _.includes(".") ? "0.00%" : "0%", P *= 0.01;
923
+ } else if (A) {
924
924
  const U = _.includes(".") ? "#,##0.00" : "#,##0";
925
925
  c = C ? U + T : T + U;
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" ? Zn : qn)[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,179 @@ 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({}, B(), 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: Vn(c), isText: Jn(c), isPercent: Hn(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((Y) => Y.type === "string" && (N ? Y.value === N : De.test(Y.value)));
1069
+ let P = "G", F = A >= 0 ? Math.min(15, A) : "", U = "", H = "";
1070
+ if (k && k.color && (H = "-", T.color = 1), S.parens && (U = "()", 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 Y = 0, Z = 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++);
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] : "";
1077
+ const re = w.type;
1078
+ /^(b-)?year/.test(re) ? (be += "Y", Z++) : re.startsWith("month") ? (be += "M", Z++) : /^(week)?day/.test(re) ? (be += "D", Z++) : re !== "hour" && re !== "min" && re !== "sec" && re !== "am" || (be += re[0], Y++);
1079
+ }), T.type = "date", Z && Y ? T.type = "datetime" : !Z && Y && (T.type = "time");
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 + H + U, 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({}, B(), s).throws ? Zt(i) : function(m) {
1095
1095
  try {
1096
- return Bt(p);
1096
+ return Zt(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 = B, 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 Zr = Rn.exports, Qr = Zr;
1120
+ const ge = /* @__PURE__ */ qr(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 !== Ue.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
+ Ze((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) => e ? ge.getInfo(e).maxDecimals ?? t : t, Ve = (e, t) => {
1121
1201
  if (e && !t || !e && t)
1122
1202
  return !1;
1123
- const a = (v) => v.reduce(
1203
+ const r = (v) => v.reduce(
1124
1204
  (h, f) => {
1125
1205
  if (h.isEnd)
1126
1206
  return h;
@@ -1128,54 +1208,54 @@ const he = /* @__PURE__ */ Br(Wr), Me = (e, t = 0) => e ? he.getInfo(e).maxDecim
1128
1208
  return f.type === "point" ? (h.isEnd = !0, h) : { ...h, result: h.result + b };
1129
1209
  },
1130
1210
  { 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(
1211
+ ).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);
1212
+ return l === u && d === p && n[1].color === a[1].color;
1213
+ }, 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
1214
  /\.0*/g,
1135
- `${t > 0 ? "." : ""}${dn(Number(t || 0))}`
1215
+ `${t > 0 ? "." : ""}${gn(Number(t || 0))}`
1136
1216
  ) : /0([^0]?)|0$/.test(n) ? n.replace(
1137
1217
  /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 = {
1218
+ `0${t > 0 ? "." : ""}${gn(Number(t || 0))}$1`
1219
+ ) : n).join(";"), ns = (e) => /\.0?/.test(e) || /0([^0]?)|0$/.test(e), Pn = {
1140
1220
  id: "sheet.command.numfmt.add.decimal.command",
1141
- type: ze.COMMAND,
1221
+ type: Ye.COMMAND,
1142
1222
  handler: async (e) => {
1143
- const t = e.get(je), a = e.get(Ve), n = e.get(be), i = e.get(ge), l = a.getSelections();
1223
+ const t = e.get(Ce), r = e.get(Be), n = e.get(ye), a = e.get(ve), l = r.getSelections();
1144
1224
  if (!l || !l.length)
1145
1225
  return !1;
1146
- const u = i.getCurrentUniverSheetInstance(), d = u.getActiveSheet(), m = u.getUnitId(), v = d.getSheetId();
1226
+ const u = a.getCurrentUniverSheetInstance(), d = u.getActiveSheet(), p = u.getUnitId(), v = d.getSheetId();
1147
1227
  let h = 0;
1148
1228
  l.forEach((D) => {
1149
- ne.foreach(D.range, (P, R) => {
1150
- const A = n.getValue(m, v, P, R);
1151
- if (!A)
1229
+ ne.foreach(D.range, (E, R) => {
1230
+ const z = n.getValue(p, v, E, R);
1231
+ if (!z)
1152
1232
  return;
1153
- const V = Me(A.pattern);
1154
- h = V > h ? V : h;
1233
+ const B = Re(z.pattern);
1234
+ h = B > h ? B : h;
1155
1235
  });
1156
1236
  });
1157
- const f = h + 1, b = te(`0${f > 0 ? ".0" : ""}`, f), I = [];
1237
+ const f = h + 1, b = ee(`0${f > 0 ? ".0" : ""}`, f), I = [];
1158
1238
  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"))
1239
+ ne.foreach(D.range, (E, R) => {
1240
+ const z = n.getValue(p, v, E, R);
1241
+ if (!z || Ve(z.pattern, "0.0"))
1162
1242
  I.push({
1163
- row: P,
1243
+ row: E,
1164
1244
  col: R,
1165
1245
  pattern: b
1166
1246
  });
1167
1247
  else {
1168
- const V = Me(A.pattern), W = te(A.pattern, V + 1);
1169
- W !== A.pattern && I.push({
1170
- row: P,
1248
+ const B = Re(z.pattern), W = ee(z.pattern, B + 1);
1249
+ W !== z.pattern && I.push({
1250
+ row: E,
1171
1251
  col: R,
1172
1252
  pattern: W
1173
1253
  });
1174
1254
  }
1175
1255
  });
1176
- }), I.length ? await t.executeCommand(Ue.id, { values: I }) : !1;
1256
+ }), I.length ? await t.executeCommand(Le.id, { values: I }) : !1;
1177
1257
  }
1178
- }, Kr = [
1258
+ }, rs = [
1179
1259
  {
1180
1260
  label: "1930-08-05",
1181
1261
  suffix: "yyyy-MM-dd"
@@ -1220,7 +1300,7 @@ const he = /* @__PURE__ */ Br(Wr), Me = (e, t = 0) => e ? he.getInfo(e).maxDecim
1220
1300
  label: "08-05 下午 01:30",
1221
1301
  suffix: "MM-dd A/P hh:mm"
1222
1302
  }
1223
- ], Zr = [
1303
+ ], ss = [
1224
1304
  {
1225
1305
  label: "(1,235)",
1226
1306
  suffix: "#,##0_);(#,##0)"
@@ -1248,7 +1328,7 @@ const he = /* @__PURE__ */ Br(Wr), Me = (e, t = 0) => e ? he.getInfo(e).maxDecim
1248
1328
  suffix: "#,##0.00_);[Red]-#,##0.00",
1249
1329
  color: "red"
1250
1330
  }
1251
- ], Mn = [
1331
+ ], Dn = [
1252
1332
  {
1253
1333
  label: (e) => `${e}1,235`,
1254
1334
  suffix: (e) => `"${e}"#,##0.00_);"${e}"#,##0.00`
@@ -1276,74 +1356,74 @@ const he = /* @__PURE__ */ Br(Wr), Me = (e, t = 0) => e ? he.getInfo(e).maxDecim
1276
1356
  suffix: (e) => `"${e}"#,##0.00_);[Red]-"${e}"#,##0.00`,
1277
1357
  color: "red"
1278
1358
  }
1279
- ], jn = {
1359
+ ], On = {
1280
1360
  id: "sheet.command.numfmt.set.currency",
1281
- type: ze.COMMAND,
1361
+ type: Ye.COMMAND,
1282
1362
  handler: async (e) => {
1283
- const t = e.get(je), n = e.get(Ve).getSelections();
1363
+ const t = e.get(Ce), n = e.get(Be).getSelections();
1284
1364
  if (!n || !n.length)
1285
1365
  return !1;
1286
- const i = [], l = Mn[0].suffix("¥");
1366
+ const a = [], l = Dn[0].suffix("¥");
1287
1367
  return n.forEach((d) => {
1288
- ne.foreach(d.range, (m, v) => {
1289
- i.push({ row: m, col: v, pattern: l, type: "currency" });
1368
+ ne.foreach(d.range, (p, v) => {
1369
+ a.push({ row: p, col: v, pattern: l, type: "currency" });
1290
1370
  });
1291
- }), await t.executeCommand(Ue.id, { values: i });
1371
+ }), await t.executeCommand(Le.id, { values: a });
1292
1372
  }
1293
- }, xn = {
1373
+ }, En = {
1294
1374
  id: "sheet.command.numfmt.subtract.decimal.command",
1295
- type: ze.COMMAND,
1375
+ type: Ye.COMMAND,
1296
1376
  handler: async (e) => {
1297
- const t = e.get(je), a = e.get(Ve), n = e.get(be), i = e.get(ge), l = a.getSelections();
1377
+ const t = e.get(Ce), r = e.get(Be), n = e.get(ye), a = e.get(ve), l = r.getSelections();
1298
1378
  if (!l || !l.length)
1299
1379
  return !1;
1300
- const u = i.getCurrentUniverSheetInstance(), d = u.getActiveSheet(), m = u.getUnitId(), v = d.getSheetId();
1380
+ const u = a.getCurrentUniverSheetInstance(), d = u.getActiveSheet(), p = u.getUnitId(), v = d.getSheetId();
1301
1381
  let h = 0;
1302
- l.forEach((P) => {
1303
- ne.foreach(P.range, (R, A) => {
1304
- const V = n.getValue(m, v, R, A);
1305
- if (!V)
1382
+ l.forEach((E) => {
1383
+ ne.foreach(E.range, (R, z) => {
1384
+ const B = n.getValue(p, v, R, z);
1385
+ if (!B)
1306
1386
  return;
1307
- const W = Me(V.pattern);
1387
+ const W = Re(B.pattern);
1308
1388
  h = W > h ? W : h;
1309
1389
  });
1310
1390
  });
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);
1315
- if (!V || Be(V.pattern, "0.0"))
1391
+ const f = h - 1, b = ee(`0${f > 0 ? ".0" : "."}`, f), I = [];
1392
+ return l.forEach((E) => {
1393
+ ne.foreach(E.range, (R, z) => {
1394
+ const B = n.getValue(p, v, R, z);
1395
+ if (!B || Ve(B.pattern, "0.0"))
1316
1396
  I.push({
1317
1397
  row: R,
1318
- col: A,
1398
+ col: z,
1319
1399
  pattern: b
1320
1400
  });
1321
1401
  else {
1322
- const W = Me(V.pattern);
1402
+ const W = Re(B.pattern);
1323
1403
  I.push({
1324
1404
  row: R,
1325
- col: A,
1326
- pattern: te(V.pattern, W - 1)
1405
+ col: z,
1406
+ pattern: ee(B.pattern, W - 1)
1327
1407
  });
1328
1408
  }
1329
1409
  });
1330
- }), await t.executeCommand(Ue.id, { values: I });
1410
+ }), await t.executeCommand(Le.id, { values: I });
1331
1411
  }
1332
- }, Dt = {
1412
+ }, Ft = {
1333
1413
  id: "sheet.operation.close.numfmt.panel",
1334
- type: ze.OPERATION,
1414
+ type: Ye.OPERATION,
1335
1415
  handler: () => (
1336
1416
  // do nothing,just notify panel is closed
1337
1417
  !0
1338
1418
  )
1339
- }, Ht = Cr("INumfmtController");
1340
- er(Ee.Rendered, Ht);
1341
- const vt = {
1419
+ }, Kt = wr("INumfmtController");
1420
+ or(_e.Rendered, Kt);
1421
+ const Ct = {
1342
1422
  id: "sheet.operation.open.numfmt.panel",
1343
- type: ze.OPERATION,
1344
- handler: (e) => (e.get(Ht).openPanel(), !0)
1423
+ type: Ye.OPERATION,
1424
+ handler: (e) => (e.get(Kt).openPanel(), !0)
1345
1425
  };
1346
- var In = { exports: {} }, xt = {};
1426
+ var Nn = { exports: {} }, Ot = {};
1347
1427
  /**
1348
1428
  * @license React
1349
1429
  * react-jsx-runtime.production.min.js
@@ -1353,23 +1433,23 @@ var In = { exports: {} }, xt = {};
1353
1433
  * This source code is licensed under the MIT license found in the
1354
1434
  * LICENSE file in the root directory of this source tree.
1355
1435
  */
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);
1436
+ var as = Yr, 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 };
1437
+ function kn(e, t, r) {
1438
+ var n, a = {}, l = null, u = null;
1439
+ r !== void 0 && (l = "" + r), t.key !== void 0 && (l = "" + t.key), t.ref !== void 0 && (u = t.ref);
1360
1440
  for (n in t)
1361
- es.call(t, n) && !ns.hasOwnProperty(n) && (i[n] = t[n]);
1441
+ cs.call(t, n) && !us.hasOwnProperty(n) && (a[n] = t[n]);
1362
1442
  if (e && e.defaultProps)
1363
1443
  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 };
1444
+ a[n] === void 0 && (a[n] = t[n]);
1445
+ return { $$typeof: is, type: e, key: l, ref: u, props: a, _owner: ls.current };
1366
1446
  }
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 = [
1447
+ Ot.Fragment = os;
1448
+ Ot.jsx = kn;
1449
+ Ot.jsxs = kn;
1450
+ Nn.exports = Ot;
1451
+ var O = Nn.exports;
1452
+ const qt = Br([]), Ut = [
1373
1453
  "$",
1374
1454
  "£",
1375
1455
  "¥",
@@ -1398,12 +1478,12 @@ const Vt = Ar([]), Nt = [
1398
1478
  "₾",
1399
1479
  "₿"
1400
1480
  ];
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 {
1481
+ var ds = Object.defineProperty, ms = Object.getOwnPropertyDescriptor, ps = (e, t, r, n) => {
1482
+ for (var a = n > 1 ? void 0 : n ? ms(t, r) : t, l = e.length - 1, u; l >= 0; l--)
1483
+ (u = e[l]) && (a = (n ? u(t, r, a) : u(a)) || a);
1484
+ return n && a && ds(t, r, a), a;
1485
+ }, fs = (e, t) => (r, n) => t(r, n, e);
1486
+ let Mt = class {
1407
1487
  constructor(e) {
1408
1488
  this._localStorageService = e;
1409
1489
  }
@@ -1411,34 +1491,34 @@ let _t = class {
1411
1491
  return `userHabitController_${e}`;
1412
1492
  }
1413
1493
  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);
1494
+ const r = this._getKey(e);
1495
+ return this._localStorageService.getItem(r).then((n) => {
1496
+ n || this._localStorageService.setItem(r, t);
1417
1497
  });
1418
1498
  }
1419
1499
  markHabit(e, t) {
1420
- const a = this._getKey(e);
1421
- this._localStorageService.getItem(a).then((n) => {
1500
+ const r = this._getKey(e);
1501
+ this._localStorageService.getItem(r).then((n) => {
1422
1502
  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);
1503
+ const a = n.findIndex((l) => l === t);
1504
+ a > -1 && n.splice(a, 1), n.unshift(t), this._localStorageService.setItem(r, n);
1425
1505
  }
1426
1506
  });
1427
1507
  }
1428
1508
  async getHabit(e, t) {
1429
- const a = this._getKey(e), n = await this._localStorageService.getItem(a);
1509
+ const r = this._getKey(e), n = await this._localStorageService.getItem(r);
1430
1510
  if (t && n) {
1431
- const i = n.map((l, u, d) => {
1432
- const m = d.length;
1511
+ const a = n.map((l, u, d) => {
1512
+ const p = d.length;
1433
1513
  return {
1434
1514
  value: l,
1435
- priority: m - u
1515
+ priority: p - u
1436
1516
  };
1437
1517
  });
1438
1518
  return t.sort((l, u) => {
1439
1519
  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;
1520
+ const d = ((v = a.find((f) => f.value === l)) == null ? void 0 : v.priority) || -1;
1521
+ return (((h = a.find((f) => f.value === u)) == null ? void 0 : h.priority) || -1) - d;
1442
1522
  });
1443
1523
  }
1444
1524
  return n || [];
@@ -1447,131 +1527,125 @@ let _t = class {
1447
1527
  this._localStorageService.removeItem(e);
1448
1528
  }
1449
1529
  };
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(() => {
1530
+ Mt = ps([
1531
+ fs(0, $(cr))
1532
+ ], Mt);
1533
+ const vn = "numfmtCurrency", hs = (e) => {
1534
+ const t = de(Mt), [r, n] = ie(Ut);
1535
+ return Bt(() => {
1456
1536
  t.addHabit("numfmtCurrency", []).then(() => {
1457
- t.getHabit(mn, [...Nt]).then((l) => {
1537
+ t.getHabit(vn, [...Ut]).then((l) => {
1458
1538
  n(l), e && e(l);
1459
1539
  });
1460
1540
  });
1461
- }, []), { userHabitCurrency: a, mark: (l) => {
1462
- t.markHabit(mn, l);
1541
+ }, []), { userHabitCurrency: r, mark: (l) => {
1542
+ t.markHabit(vn, l);
1463
1543
  } };
1464
- }, cs = () => {
1465
- const e = At([]), [t, a] = ie({});
1466
- return $t(() => {
1467
- e.current.forEach((i) => {
1468
- i();
1544
+ }, gs = () => {
1545
+ const e = Ht([]), [t, r] = ie({});
1546
+ return Bt(() => {
1547
+ e.current.forEach((a) => {
1548
+ a();
1469
1549
  }), e.current = [];
1470
- }, [t]), (i) => {
1471
- e.current.push(i), a({});
1550
+ }, [t]), (a) => {
1551
+ e.current.push(a), r({});
1472
1552
  };
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);
1553
+ }, nt = (e) => Ut.find((r) => e.includes(r)), vs = (e) => !!nt(e) && e.startsWith("_("), _s = (e) => {
1554
+ const [t, r] = ie(() => Re(e.defaultPattern || "", 2)), n = In(qt), [a, l] = ie(() => nt(e.defaultPattern) || n[0]), u = Se(() => n.map((f) => ({ label: f, value: f })), []), p = de(me).t;
1555
+ e.action.current = () => ee(`_("${a}"* #,##0${t > 0 ? ".0" : ""}_)`, t);
1476
1556
  const v = (f) => {
1477
- l(f), e.onChange(te(`_("${f}"* #,##0${t > 0 ? ".0" : ""}_)`, t));
1557
+ l(f), e.onChange(ee(`_("${f}"* #,##0${t > 0 ? ".0" : ""}_)`, t));
1478
1558
  }, h = (f) => {
1479
1559
  const b = f || 0;
1480
- a(b), e.onChange(te(`_("${i}"* #,##0${b > 0 ? ".0" : ""}_)`, b));
1560
+ r(b), e.onChange(ee(`_("${a}"* #,##0${b > 0 ? ".0" : ""}_)`, b));
1481
1561
  };
1482
1562
  return /* @__PURE__ */ O.jsxs("div", { children: [
1483
1563
  /* @__PURE__ */ O.jsxs("div", { className: "m-t-16 options ", children: [
1484
1564
  /* @__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 }) })
1565
+ /* @__PURE__ */ O.jsx("div", { className: "label", children: p("sheet.numfmt.decimalLength") }),
1566
+ /* @__PURE__ */ O.jsx("div", { className: "m-t-8 w-120", children: /* @__PURE__ */ O.jsx(Vt, { value: t, max: 20, min: 0, onChange: h }) })
1487
1567
  ] }),
1488
1568
  /* @__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 }) })
1569
+ /* @__PURE__ */ O.jsx("div", { className: "label", children: p("sheet.numfmt.currencyType") }),
1570
+ /* @__PURE__ */ O.jsx("div", { className: "m-t-8 w-140", children: /* @__PURE__ */ O.jsx(Jt, { onChange: v, options: u, value: a }) })
1491
1571
  ] })
1492
1572
  ] }),
1493
- /* @__PURE__ */ O.jsx("div", { className: "describe m-t-14", children: m("sheet.numfmt.accountingDes") })
1573
+ /* @__PURE__ */ O.jsx("div", { className: "describe m-t-14", children: p("sheet.numfmt.accountingDes") })
1494
1574
  ] });
1495
- }, Ot = (e) => Mn.map((t) => ({
1575
+ }, $t = (e) => Dn.map((t) => ({
1496
1576
  label: t.label(e),
1497
1577
  value: t.suffix(e),
1498
1578
  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));
1579
+ })), 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) => {
1580
+ const r = de(me).t, n = In(qt), [a, l] = ie(() => nt(e.defaultPattern) || n[0]), [u, d] = ie(() => Re(e.defaultPattern || "", 2)), [p, v] = ie(() => {
1581
+ var z;
1582
+ const E = $t(a);
1583
+ return ((z = E.find((B) => Ve(B.value, e.defaultPattern))) == null ? void 0 : z.value) || E[0].value;
1584
+ }), h = Se(() => $t(a), [a]), f = Se(() => n.map((E) => ({ label: E, value: E })), [n]);
1585
+ e.action.current = () => ee(p, u);
1586
+ const b = (E) => {
1587
+ l(E);
1588
+ const R = $t(E)[0].value;
1589
+ v(R), e.onChange(ee(R, u));
1590
+ }, I = (E) => {
1591
+ v(E), e.onChange(ee(E, u));
1592
+ }, D = (E) => {
1593
+ d(E || 0), e.onChange(ee(p, E || 0));
1514
1594
  };
1515
1595
  return /* @__PURE__ */ O.jsxs("div", { children: [
1516
1596
  /* @__PURE__ */ O.jsxs("div", { className: "m-t-16 options ", children: [
1517
1597
  /* @__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 }) })
1598
+ /* @__PURE__ */ O.jsx("div", { className: "label", children: r("sheet.numfmt.decimalLength") }),
1599
+ /* @__PURE__ */ O.jsx("div", { className: "m-t-8 w-120", children: /* @__PURE__ */ O.jsx(Vt, { value: u, max: 20, min: 0, onChange: D }) })
1520
1600
  ] }),
1521
1601
  /* @__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 }) })
1602
+ /* @__PURE__ */ O.jsx("div", { className: "label", children: r("sheet.numfmt.currencyType") }),
1603
+ /* @__PURE__ */ O.jsx("div", { className: "m-t-8 w-140", children: /* @__PURE__ */ O.jsx(Jt, { onChange: b, options: f, value: a }) })
1527
1604
  ] })
1528
1605
  ] }),
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") })
1606
+ /* @__PURE__ */ O.jsx("div", { className: "m-t-16 label", children: r("sheet.numfmt.negType") }),
1607
+ /* @__PURE__ */ O.jsx("div", { className: "m-t-8", children: /* @__PURE__ */ O.jsx(Wt, { onChange: I, options: h, value: p }) }),
1608
+ /* @__PURE__ */ O.jsx("div", { className: "describe m-t-14", children: r("sheet.numfmt.currencyDes") })
1535
1609
  ] });
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(() => {
1610
+ }, Ss = (e) => {
1611
+ const t = ge.getInfo(e);
1612
+ return Tn().map((r) => r.value).includes(e) || ["date", "datetime", "time"].includes(t.type);
1613
+ }, Cs = (e) => {
1614
+ const t = Se(Tn, []), n = de(me).t, [a, l] = ie(() => {
1541
1615
  if (e.defaultPattern) {
1542
- const d = t.find((m) => m.value === e.defaultPattern);
1616
+ const d = t.find((p) => p.value === e.defaultPattern);
1543
1617
  if (d)
1544
1618
  return d.value;
1545
1619
  }
1546
1620
  return t[0].value;
1547
1621
  });
1548
- e.action.current = () => i;
1622
+ e.action.current = () => a;
1549
1623
  const u = (d) => {
1550
1624
  l(d), e.onChange(d);
1551
1625
  };
1552
1626
  return /* @__PURE__ */ O.jsxs("div", { children: [
1553
1627
  /* @__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 }) }),
1628
+ /* @__PURE__ */ O.jsx("div", { className: "m-t-8", children: /* @__PURE__ */ O.jsx(Wt, { value: a, options: t, onChange: u }) }),
1555
1629
  /* @__PURE__ */ O.jsx("div", { className: "describe m-t-14", children: n("sheet.numfmt.dateDes") })
1556
1630
  ] });
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)));
1631
+ }, Ms = (e) => !e, js = (e) => {
1632
+ const r = de(me).t;
1633
+ return e.action.current = () => "", /* @__PURE__ */ O.jsx("div", { children: /* @__PURE__ */ O.jsx("div", { className: "describe m-t-14", children: r("sheet.numfmt.generalDes") }) });
1634
+ }, xs = (e) => Fn().some((t) => Ve(t.value, e)), Is = (e) => {
1635
+ const t = de(me), r = Se(Fn, []), [n, a] = ie(() => Re(e.defaultPattern || "", 0)), [l, u] = ie(() => {
1636
+ const f = r.find((b) => Ve(b.value, e.defaultPattern || ""));
1637
+ return (f == null ? void 0 : f.value) || r[0].value;
1638
+ }), d = Se(() => ee(l, Number(n || 0)), [l, n]), p = Se(() => !ns(l), [l]), v = (f) => {
1639
+ a(f || 0), e.onChange(ee(l, Number(f || 0)));
1566
1640
  }, h = (f) => {
1567
- i(Me(f, 0)), u(f), e.onChange(f);
1641
+ a(Re(f, 0)), u(f), e.onChange(f);
1568
1642
  };
1569
1643
  return e.action.current = () => d, /* @__PURE__ */ O.jsxs("div", { children: [
1570
1644
  /* @__PURE__ */ O.jsx("div", { className: "m-t-16 label", children: t.t("sheet.numfmt.decimalLength") }),
1571
1645
  /* @__PURE__ */ O.jsx("div", { className: "m-t-8", children: /* @__PURE__ */ O.jsx(
1572
- Ut,
1646
+ Vt,
1573
1647
  {
1574
- disabled: m,
1648
+ disabled: p,
1575
1649
  value: n,
1576
1650
  max: 20,
1577
1651
  min: 0,
@@ -1582,739 +1656,319 @@ const mn = "numfmtCurrency", os = (e) => {
1582
1656
  " ",
1583
1657
  t.t("sheet.numfmt.negType")
1584
1658
  ] }),
1585
- /* @__PURE__ */ O.jsx("div", { className: "m-t-8", children: /* @__PURE__ */ O.jsx(Lt, { onChange: h, options: a, value: l }) }),
1659
+ /* @__PURE__ */ O.jsx("div", { className: "m-t-8", children: /* @__PURE__ */ O.jsx(Wt, { onChange: h, options: r, value: l }) }),
1586
1660
  /* @__PURE__ */ O.jsx("div", { className: "describe m-t-14", children: t.t("sheet.numfmt.thousandthPercentileDes") })
1587
1661
  ] });
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(
1662
+ }, Rs = (e) => {
1663
+ const { defaultValue: t, defaultPattern: r, row: n, col: a } = e.value, l = de(me), u = Ht(() => ""), d = l.t, p = gs(), v = Se(
1590
1664
  () => [
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 }
1665
+ { label: "sheet.numfmt.general", component: js },
1666
+ { label: "sheet.numfmt.accounting", component: _s },
1667
+ { label: "sheet.numfmt.currency", component: bs },
1668
+ { label: "sheet.numfmt.date", component: Cs },
1669
+ { label: "sheet.numfmt.thousandthPercentile", component: Is }
1596
1670
  ].map((G) => ({ ...G, label: d(G.label) })),
1597
1671
  []
1598
- ), [h, f] = ie(A), [b, I] = ie(() => `${n}_${i}`), { mark: D, userHabitCurrency: P } = os(() => I(`${n}_${i}_userCurrency'`)), R = ye(() => {
1672
+ ), [h, f] = ie(z), [b, I] = ie(() => `${n}_${a}`), { mark: D, userHabitCurrency: E } = hs(() => I(`${n}_${a}_userCurrency'`)), R = Se(() => {
1599
1673
  var G;
1600
- return (G = v.find((pe) => pe.label === h)) == null ? void 0 : G.component;
1674
+ return (G = v.find((fe) => fe.label === h)) == null ? void 0 : G.component;
1601
1675
  }, [h]);
1602
- function A() {
1603
- return [hs, ls, ds, ps, vs].reduce((pe, Te, Z) => pe || (Te(a) ? v[Z].label : ""), "") || v[0].label;
1676
+ function z() {
1677
+ return [Ms, vs, ys, Ss, xs].reduce((fe, $e, q) => fe || ($e(r) ? v[q].label : ""), "") || v[0].label;
1604
1678
  }
1605
- const V = v.map((G) => ({
1679
+ const B = v.map((G) => ({
1606
1680
  label: G.label,
1607
1681
  value: G.label
1608
1682
  })), W = (G) => {
1609
- f(G), m(() => e.onChange({ type: "change", value: u.current() || "" }));
1683
+ f(G), p(() => e.onChange({ type: "change", value: u.current() || "" }));
1610
1684
  }, Q = (G) => {
1611
1685
  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 = () => {
1686
+ }, pe = () => {
1687
+ const G = u.current() || "", fe = nt(G);
1688
+ fe && D(fe), e.onChange({ type: "confirm", value: G });
1689
+ }, Pe = () => {
1616
1690
  e.onChange({ type: "cancel", value: "" });
1617
- }, Ie = {
1691
+ }, De = {
1618
1692
  onChange: Q,
1619
1693
  defaultValue: t,
1620
- defaultPattern: a,
1694
+ defaultPattern: r,
1621
1695
  action: u
1622
1696
  };
1623
- return $t(() => {
1624
- f(A()), I(`${n}_${i}`);
1625
- }, [n, i]), /* @__PURE__ */ O.jsxs("div", { className: "numfmt-panel p-b-20", children: [
1697
+ return Bt(() => {
1698
+ f(z()), I(`${n}_${a}`);
1699
+ }, [n, a]), /* @__PURE__ */ O.jsxs("div", { className: "numfmt-panel p-b-20", children: [
1626
1700
  /* @__PURE__ */ O.jsxs("div", { children: [
1627
1701
  /* @__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 }) }) })
1702
+ /* @__PURE__ */ O.jsx("div", { className: "m-t-8", children: /* @__PURE__ */ O.jsx(Jt, { onChange: W, options: B, value: h }) }),
1703
+ /* @__PURE__ */ O.jsx("div", { children: R && /* @__PURE__ */ O.jsx(qt.Provider, { value: E, children: /* @__PURE__ */ He(R, { ...De, key: b }) }) })
1630
1704
  ] }),
1631
1705
  /* @__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") })
1706
+ /* @__PURE__ */ O.jsx(hn, { size: "small", onClick: Pe, className: "m-r-12", children: d("sheet.numfmt.cancel") }),
1707
+ /* @__PURE__ */ O.jsx(hn, { type: "primary", size: "small", onClick: pe, children: d("sheet.numfmt.confirm") })
1634
1708
  ] })
1635
1709
  ] });
1636
1710
  };
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" }
1711
+ var ws = Object.defineProperty, Ps = Object.getOwnPropertyDescriptor, Ds = (e, t, r, n) => {
1712
+ for (var a = n > 1 ? void 0 : n ? Ps(t, r) : t, l = e.length - 1, u; l >= 0; l--)
1713
+ (u = e[l]) && (a = (n ? u(t, r, a) : u(a)) || a);
1714
+ return n && a && ws(t, r, a), a;
1715
+ }, se = (e, t) => (r, n) => t(r, n, e);
1716
+ let mt = class extends Me {
1717
+ constructor(t, r, n, a, l, u, d, p, v, h, f, b) {
1718
+ super();
1719
+ /**
1720
+ * If _previewPattern is null ,the realTimeRenderingInterceptor will skip and if it is '',realTimeRenderingInterceptor will clear numfmt.
1721
+ * @private
1722
+ * @type {(string | null)}
1723
+ * @memberof NumfmtController
1724
+ */
1725
+ Ne(this, "_previewPattern", "");
1726
+ Ne(this, "openPanel", () => {
1727
+ const t = this._sidebarService, r = this._selectionManagerService, n = this._commandService, a = this._univerInstanceService, l = this._numfmtService, u = this._localeService, p = (r.getSelectionRanges() || [])[0];
1728
+ if (!p)
1729
+ return !1;
1730
+ const v = a.getCurrentUniverSheetInstance(), h = v.getActiveSheet(), f = h.getCellRaw(p.startRow, p.startColumn), b = l.getValue(
1731
+ v.getUnitId(),
1732
+ h.getSheetId(),
1733
+ p.startRow,
1734
+ p.startColumn
1735
+ );
1736
+ let I = "";
1737
+ b && (I = b.pattern);
1738
+ const D = (f == null ? void 0 : f.t) === Ue.NUMBER ? f.v : 12345678, E = {
1739
+ onChange: (R) => {
1740
+ var z, B;
1741
+ if (R.type === "change")
1742
+ this._previewPattern = R.value, this._sheetSkeletonManagerService.reCalculate(), (B = (z = this._renderManagerService.getRenderById(v.getUnitId())) == null ? void 0 : z.mainComponent) == null || B.makeDirty();
1743
+ else if (R.type === "confirm") {
1744
+ const W = r.getSelectionRanges() || [], Q = { values: [] }, pe = Gt(R.value);
1745
+ W.forEach((Pe) => {
1746
+ ne.foreach(Pe, (De, G) => {
1747
+ Q.values.push({
1748
+ row: De,
1749
+ col: G,
1750
+ pattern: R.value,
1751
+ type: pe
1752
+ });
1753
+ });
1754
+ }), n.executeCommand(Le.id, Q), t.close();
1755
+ } else
1756
+ R.type === "cancel" && t.close();
1757
+ },
1758
+ value: { defaultPattern: I, defaultValue: D, row: p.startRow, col: p.startColumn }
1759
+ };
1760
+ t.open({
1761
+ header: { title: u.t("sheet.numfmt.title") },
1762
+ children: {
1763
+ label: Qe,
1764
+ ...E
1765
+ // need passthrough to react props.
1766
+ },
1767
+ onClose: () => {
1768
+ var R, z;
1769
+ this._sheetSkeletonManagerService.reCalculate(), (z = (R = this._renderManagerService.getRenderById(v.getUnitId())) == null ? void 0 : R.mainComponent) == null || z.makeDirty(), n.executeCommand(Ft.id);
1731
1770
  }
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"
1771
+ });
1772
+ });
1773
+ 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();
1774
+ }
1775
+ _initCommands() {
1776
+ [
1777
+ Pn,
1778
+ En,
1779
+ On,
1780
+ Ct,
1781
+ Ft,
1782
+ Le
1783
+ ].forEach((t) => {
1784
+ this.disposeWithMe(this._commandService.registerCommand(t));
1785
+ });
1786
+ }
1787
+ _initPanel() {
1788
+ this._componentManager.register(Qe, Rs);
1789
+ }
1790
+ _initInterceptorCommands() {
1791
+ const t = this;
1792
+ this.disposeWithMe(
1793
+ this._sheetInterceptorService.interceptCommand({
1794
+ getMutations(r) {
1795
+ switch (r.id) {
1796
+ case mr.id:
1797
+ case dr.id: {
1798
+ const n = t._univerInstanceService.getCurrentUniverSheetInstance().getUnitId(), a = t._univerInstanceService.getCurrentUniverSheetInstance().getActiveSheet().getSheetId(), l = t._selectionManagerService.getSelectionRanges();
1799
+ if (!(l != null && l.length))
1800
+ break;
1801
+ const u = {
1802
+ unitId: n,
1803
+ subUnitId: a,
1804
+ ranges: []
1805
+ }, d = t._numfmtService.getModel(n, a);
1806
+ l.forEach((v) => {
1807
+ ne.foreach(v, (h, f) => {
1808
+ d != null && d.getValue(h, f) && u.ranges.push({
1809
+ startColumn: f,
1810
+ endColumn: f,
1811
+ startRow: h,
1812
+ endRow: h
1813
+ });
1814
+ });
1815
+ }), u.ranges = Ie(u.ranges);
1816
+ const p = Fe(t._injector, u);
1817
+ return {
1818
+ redos: [{ id: te.id, params: u }],
1819
+ undos: p
1820
+ };
1821
+ }
1745
1822
  }
1823
+ return {
1824
+ redos: [],
1825
+ undos: []
1826
+ };
1746
1827
  }
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
1828
+ })
1829
+ );
1830
+ }
1831
+ _initRealTimeRenderingInterceptor() {
1832
+ const t = new ke((n) => {
1833
+ this._commandService.onCommandExecuted((a) => {
1834
+ a.id === Ct.id && n.next(!0), a.id === Ft.id && n.next(!1);
1835
+ });
1836
+ }), r = Lr([
1837
+ t,
1838
+ this._selectionManagerService.selectionMoveEnd$.pipe(
1839
+ Ze((n) => n ? n.map((a) => a.range) : [])
1840
+ )
1841
+ ]);
1842
+ this.disposeWithMe(
1843
+ Te(
1844
+ r.pipe(
1845
+ jn(
1846
+ ([n, a]) => new ke((l) => {
1847
+ const u = new Sn();
1848
+ return n && a.length && l.next({ selectionRanges: a, disposableCollection: u }), () => {
1849
+ u.dispose();
1850
+ };
1851
+ })
1852
+ ),
1853
+ kr(() => {
1854
+ this._previewPattern = null;
1855
+ })
1856
+ ).subscribe(({ disposableCollection: n, selectionRanges: a }) => {
1857
+ var u, d;
1858
+ const l = this._univerInstanceService.getCurrentUniverSheetInstance();
1859
+ this.openPanel(), n.add(
1860
+ this._sheetInterceptorService.intercept(Cn.CELL_CONTENT, {
1861
+ priority: 99,
1862
+ handler: (p, v, h) => {
1863
+ const { row: f, col: b } = v;
1864
+ if (a.find(
1865
+ (I) => I.startColumn <= b && I.endColumn >= b && I.startRow <= f && I.endRow >= f
1866
+ )) {
1867
+ const I = v.worksheet.getCellRaw(f, b), D = I == null ? void 0 : I.v, E = I == null ? void 0 : I.t;
1868
+ if (D == null || E !== Ue.NUMBER || this._previewPattern === null)
1869
+ return h(p);
1870
+ const R = wn(this._previewPattern, D);
1871
+ if (R.color) {
1872
+ const B = this._themeService.getCurrentTheme()[`${R.color}500`];
1873
+ return {
1874
+ ...p,
1875
+ v: R.result,
1876
+ t: Ue.STRING,
1877
+ s: { cl: { rgb: B } }
1878
+ };
1879
+ }
1880
+ return {
1881
+ ...p,
1882
+ v: R.result,
1883
+ t: Ue.STRING
1884
+ };
1885
+ }
1886
+ return h(p);
1887
+ }
1888
+ })
1889
+ ), (d = (u = this._renderManagerService.getRenderById(l.getUnitId())) == null ? void 0 : u.mainComponent) == null || d.makeDirty();
1890
+ })
1891
+ )
1892
+ );
1893
+ }
1894
+ _commandExecutedListener() {
1895
+ const t = [te.id, oe.id];
1896
+ this.disposeWithMe(
1897
+ Te(
1898
+ Yt(
1899
+ new ke((r) => {
1900
+ const n = this._commandService.onCommandExecuted((a) => {
1901
+ if (t.includes(a.id)) {
1902
+ const l = a.params;
1903
+ r.next(l.unitId);
1904
+ }
1905
+ });
1906
+ return () => {
1907
+ n.dispose();
1908
+ };
1909
+ }),
1910
+ this._numfmtService.modelReplace$
1911
+ ).pipe(Tr(16)).subscribe((r) => {
1912
+ var n, a;
1913
+ this._sheetSkeletonManagerService.reCalculate(), (a = (n = this._renderManagerService.getRenderById(r)) == null ? void 0 : n.mainComponent) == null || a.makeDirty();
1914
+ })
1915
+ )
1916
+ );
1917
+ }
1918
+ };
1919
+ mt = Ds([
1920
+ je(_e.Rendered, mt),
1921
+ se(0, $(xt)),
1922
+ se(1, $(bn)),
1923
+ se(2, $(we)),
1924
+ se(3, $(ve)),
1925
+ se(4, $(Lt)),
1926
+ se(5, $(Ce)),
1927
+ se(6, $(Be)),
1928
+ se(7, $($r)),
1929
+ se(8, $(ye)),
1930
+ se(9, $(xn)),
1931
+ se(10, $(zr)),
1932
+ se(11, $(me))
1933
+ ], mt);
1934
+ var Os = Object.defineProperty, Es = Object.getOwnPropertyDescriptor, Ns = (e, t, r, n) => {
1935
+ for (var a = n > 1 ? void 0 : n ? Es(t, r) : t, l = e.length - 1, u; l >= 0; l--)
1936
+ (u = e[l]) && (a = (n ? u(t, r, a) : u(a)) || a);
1937
+ return n && a && Os(t, r, a), a;
1938
+ }, ct = (e, t) => (r, n) => t(r, n, e);
1939
+ let pt = class extends Me {
1940
+ constructor(t, r, n, a) {
1941
+ super();
1942
+ Ne(this, "_copyInfo");
1943
+ this._sheetClipboardService = t, this._injector = r, this._numfmtService = n, this._univerInstanceService = a, this._initClipboardHook();
1944
+ }
1945
+ _initClipboardHook() {
1946
+ this.disposeWithMe(
1947
+ this._sheetClipboardService.addClipboardHook({
1948
+ id: Qe,
1949
+ onBeforeCopy: (t, r, n) => this._collectNumfmt(t, r, n),
1950
+ onPasteCells: (t, r, n, a) => {
1951
+ const { copyType: l = mn.COPY, pasteType: u } = a, { range: d } = t || {}, { range: p } = r;
1952
+ return this._generateNumfmtMutations(p, { copyType: l, pasteType: u, copyRange: d });
1953
+ }
1954
+ })
1955
+ );
1956
+ }
1957
+ _collectNumfmt(t, r, n) {
1958
+ const a = new yn();
1959
+ this._copyInfo = {
1960
+ matrix: a,
1961
+ info: {
1962
+ unitId: t,
1963
+ subUnitId: r
2310
1964
  }
2311
1965
  };
2312
- const l = this._numfmtService.getModel(t, a);
1966
+ const l = this._numfmtService.getModel(t, r);
2313
1967
  l && ne.foreach(n, (u, d) => {
2314
- const m = this._numfmtService.getValue(t, a, u, d, l);
2315
- if (!m)
1968
+ const p = this._numfmtService.getValue(t, r, u, d, l);
1969
+ if (!p)
2316
1970
  return;
2317
- const v = ht.getRelativeRange(
1971
+ const v = bt.getRelativeRange(
2318
1972
  {
2319
1973
  startRow: u,
2320
1974
  endRow: u,
@@ -2323,114 +1977,112 @@ let dt = class extends Le {
2323
1977
  },
2324
1978
  n
2325
1979
  );
2326
- i.setValue(v.startRow, v.startColumn, {
2327
- pattern: m.pattern,
2328
- type: m.type
1980
+ a.setValue(v.startRow, v.startColumn, {
1981
+ pattern: p.pattern,
1982
+ type: p.type
2329
1983
  });
2330
1984
  });
2331
1985
  }
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)
1986
+ _generateNumfmtMutations(t, r) {
1987
+ const n = this._univerInstanceService.getCurrentUniverSheetInstance(), a = n.getActiveSheet(), l = n.getUnitId(), u = a.getSheetId();
1988
+ if (r.copyType === mn.CUT)
2335
1989
  return this._copyInfo = null, { redos: [], undos: [] };
2336
- if (!this._copyInfo || !this._copyInfo.matrix.getSizeOf() || !a.copyRange)
1990
+ if (!this._copyInfo || !this._copyInfo.matrix.getSizeOf() || !r.copyRange)
2337
1991
  return { redos: [], undos: [] };
2338
- if ([cn.SPECIAL_PASTE_COL_WIDTH, cn.SPECIAL_PASTE_VALUE].includes(
2339
- a.pasteType
1992
+ if ([pn.SPECIAL_PASTE_COL_WIDTH, pn.SPECIAL_PASTE_VALUE].includes(
1993
+ r.pasteType
2340
1994
  ))
2341
1995
  return { redos: [], undos: [] };
2342
- const d = xr(a.copyRange, t, !0), m = [], v = { unitId: l, subUnitId: u, ranges: [] }, h = this._numfmtService.getModel(l, u);
1996
+ const d = Or(r.copyRange, t, !0), p = [], v = { unitId: l, subUnitId: u, ranges: [] }, h = this._numfmtService.getModel(l, u);
2343
1997
  ne.foreach(t, (I, D) => {
2344
1998
  this._numfmtService.getValue(l, u, I, D, h) && v.ranges.push({ startRow: I, startColumn: D, endRow: I, endColumn: D });
2345
1999
  }), d.forEach((I) => {
2346
- this._copyInfo && this._copyInfo.matrix.forValue((D, P, R) => {
2347
- const A = ht.getPositionRange(
2000
+ this._copyInfo && this._copyInfo.matrix.forValue((D, E, R) => {
2001
+ const z = bt.getPositionRange(
2348
2002
  {
2349
2003
  startRow: D,
2350
2004
  endRow: D,
2351
- startColumn: P,
2352
- endColumn: P
2005
+ startColumn: E,
2006
+ endColumn: E
2353
2007
  },
2354
2008
  I.startRange
2355
2009
  );
2356
- m.push({
2357
- row: A.startRow,
2358
- col: A.startColumn,
2010
+ p.push({
2011
+ row: z.startRow,
2012
+ col: z.startColumn,
2359
2013
  pattern: R.pattern,
2360
2014
  type: R.type
2361
2015
  });
2362
2016
  });
2363
2017
  });
2364
- const f = qe(l, u, m);
2018
+ const f = Xe(l, u, p);
2365
2019
  Object.keys(f.values).forEach((I) => {
2366
2020
  const D = f.values[I];
2367
- D.ranges = Ce(D.ranges);
2368
- }), v.ranges = Ce(v.ranges);
2021
+ D.ranges = Ie(D.ranges);
2022
+ }), v.ranges = Ie(v.ranges);
2369
2023
  const b = [
2370
- ...Qe(this._injector, f),
2371
- ...Pe(this._injector, v)
2024
+ ...et(this._injector, f),
2025
+ ...Fe(this._injector, v)
2372
2026
  ];
2373
2027
  return {
2374
2028
  redos: [
2375
- { id: re.id, params: v },
2029
+ { id: te.id, params: v },
2376
2030
  { id: oe.id, params: f }
2377
2031
  ],
2378
- undos: b
2032
+ undos: St(b)
2379
2033
  };
2380
2034
  }
2381
2035
  };
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 = () => {
2036
+ pt = Ns([
2037
+ je(_e.Rendered, pt),
2038
+ ct(0, $(Er)),
2039
+ ct(1, $(we)),
2040
+ ct(2, $(ye)),
2041
+ ct(3, $(ve))
2042
+ ], pt);
2043
+ var ks = Object.defineProperty, Ts = Object.getOwnPropertyDescriptor, Fs = (e, t, r, n) => {
2044
+ for (var a = n > 1 ? void 0 : n ? Ts(t, r) : t, l = e.length - 1, u; l >= 0; l--)
2045
+ (u = e[l]) && (a = (n ? u(t, r, a) : u(a)) || a);
2046
+ return n && a && ks(t, r, a), a;
2047
+ }, qe = (e, t) => (r, n) => t(r, n, e);
2048
+ const $s = () => {
2395
2049
  let e = [];
2396
2050
  return {
2397
- add: (i, l, u, d, m) => e.push({ unitId: i, subUnitId: l, row: u, col: d, value: m }),
2051
+ add: (a, l, u, d, p) => e.push({ unitId: a, subUnitId: l, row: u, col: d, value: p }),
2398
2052
  getEffects: () => e,
2399
2053
  clean: () => {
2400
2054
  e = [];
2401
2055
  }
2402
2056
  };
2403
2057
  };
2404
- let mt = class extends Le {
2405
- constructor(t, a, n, i, l) {
2058
+ let ft = class extends Me {
2059
+ constructor(t, r, n, a, l) {
2406
2060
  super();
2407
2061
  // 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();
2062
+ Ne(this, "_collectEffectMutation", $s());
2063
+ this._sheetInterceptorService = t, this._numfmtService = r, this._univerInstanceService = n, this._injector = a, this._editorBridgeService = l, this._initInterceptorEditorStart(), this._initInterceptorEditorEnd(), this._initInterceptorCommands();
2410
2064
  }
2411
2065
  _initInterceptorEditorStart() {
2412
2066
  this.disposeWithMe(
2413
- De(
2067
+ Te(
2414
2068
  this._editorBridgeService.interceptor.intercept(
2415
2069
  this._editorBridgeService.interceptor.getInterceptPoints().BEFORE_CELL_EDIT,
2416
2070
  {
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,
2071
+ handler: (t, r, n) => {
2072
+ const a = r.row, l = r.col, u = this._numfmtService.getValue(
2073
+ r.unitId,
2074
+ r.subUnitId,
2075
+ a,
2422
2076
  l
2423
2077
  );
2424
2078
  if (u)
2425
- switch (Yt(u.pattern)) {
2079
+ switch (Gt(u.pattern)) {
2426
2080
  case "scientific":
2427
2081
  case "percent":
2428
2082
  case "currency":
2429
2083
  case "grouped":
2430
- case "number": {
2431
- const m = a.worksheet.getCellRaw(i, l);
2432
- return m && Gs(m, ["s"]);
2433
- }
2084
+ case "number":
2085
+ return r.worksheet.getCellRaw(a, l);
2434
2086
  case "date":
2435
2087
  case "time":
2436
2088
  case "datetime":
@@ -2451,45 +2103,45 @@ let mt = class extends Le {
2451
2103
  */
2452
2104
  _initInterceptorEditorEnd() {
2453
2105
  this.disposeWithMe(
2454
- De(
2106
+ Te(
2455
2107
  this._editorBridgeService.interceptor.intercept(
2456
2108
  this._editorBridgeService.interceptor.getInterceptPoints().AFTER_CELL_EDIT,
2457
2109
  {
2458
- handler: (t, a, n) => {
2110
+ handler: (t, r, n) => {
2459
2111
  this._collectEffectMutation.clean();
2460
- const i = this._numfmtService.getValue(
2461
- a.unitId,
2462
- a.subUnitId,
2463
- a.row,
2464
- a.col
2112
+ const a = this._numfmtService.getValue(
2113
+ r.unitId,
2114
+ r.subUnitId,
2115
+ r.row,
2116
+ r.col
2465
2117
  ), l = () => {
2466
- i && this._collectEffectMutation.add(
2467
- a.unitId,
2468
- a.subUnitId,
2469
- a.row,
2470
- a.col,
2118
+ a && this._collectEffectMutation.add(
2119
+ r.unitId,
2120
+ r.subUnitId,
2121
+ r.row,
2122
+ r.col,
2471
2123
  null
2472
2124
  );
2473
2125
  };
2474
2126
  if (!(t != null && t.v))
2475
2127
  return n(t);
2476
- const u = String(t.v), d = he.parseDate(u) || he.parseTime(u);
2128
+ const u = String(t.v), d = ge.parseDate(u) || ge.parseTime(u);
2477
2129
  if (!!d) {
2478
2130
  if (d && d.z) {
2479
2131
  const v = Number(d.v);
2480
2132
  return this._collectEffectMutation.add(
2481
- a.unitId,
2482
- a.subUnitId,
2483
- a.row,
2484
- a.col,
2133
+ r.unitId,
2134
+ r.subUnitId,
2135
+ r.row,
2136
+ r.col,
2485
2137
  {
2486
2138
  type: "date",
2487
2139
  pattern: d.z
2488
2140
  }
2489
- ), { ...t, v, t: Ae.NUMBER };
2141
+ ), { ...t, v, t: Ue.NUMBER };
2490
2142
  }
2491
2143
  } else
2492
- (["date", "time", "datetime"].includes((i == null ? void 0 : i.type) || "") || !Ks(u)) && l();
2144
+ (["date", "time", "datetime"].includes((a == null ? void 0 : a.type) || "") || !As(u)) && l();
2493
2145
  return n(t);
2494
2146
  }
2495
2147
  }
@@ -2501,10 +2153,10 @@ let mt = class extends Le {
2501
2153
  const t = this;
2502
2154
  this.disposeWithMe(
2503
2155
  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();
2156
+ getMutations(r) {
2157
+ switch (r.id) {
2158
+ case pr.id: {
2159
+ const n = t._univerInstanceService.getCurrentUniverSheetInstance().getUnitId(), a = t._univerInstanceService.getCurrentUniverSheetInstance().getActiveSheet().getSheetId(), l = t._collectEffectMutation.getEffects();
2508
2160
  if (!l.length)
2509
2161
  return {
2510
2162
  redos: [],
@@ -2526,27 +2178,27 @@ let mt = class extends Le {
2526
2178
  endColumn: h.col,
2527
2179
  startColumn: h.col,
2528
2180
  endRow: h.row
2529
- })), m = [], v = [];
2181
+ })), p = [], v = [];
2530
2182
  if (u) {
2531
2183
  const h = {
2532
2184
  id: oe.id,
2533
- params: qe(n, i, u)
2185
+ params: Xe(n, a, u)
2534
2186
  };
2535
- m.push(h), v.push(...Qe(t._injector, h.params));
2187
+ p.push(h), v.push(...et(t._injector, h.params));
2536
2188
  }
2537
2189
  if (d) {
2538
2190
  const h = {
2539
- id: re.id,
2191
+ id: te.id,
2540
2192
  params: {
2541
2193
  unitId: n,
2542
- subUnitId: i,
2194
+ subUnitId: a,
2543
2195
  ranges: d
2544
2196
  }
2545
2197
  };
2546
- m.push(h), v.push(...Pe(t._injector, h.params));
2198
+ p.push(h), v.push(...Fe(t._injector, h.params));
2547
2199
  }
2548
2200
  return {
2549
- redos: m,
2201
+ redos: p,
2550
2202
  undos: v.reverse()
2551
2203
  };
2552
2204
  }
@@ -2560,201 +2212,582 @@ let mt = class extends Le {
2560
2212
  );
2561
2213
  }
2562
2214
  };
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) {
2215
+ ft = Fs([
2216
+ je(_e.Rendered, ft),
2217
+ qe(0, $(xt)),
2218
+ qe(1, $(ye)),
2219
+ qe(2, $(ve)),
2220
+ qe(3, $(we)),
2221
+ qe(4, $(Nr))
2222
+ ], ft);
2223
+ function As(e) {
2576
2224
  return /^-?\d+(\.\d+)?$/.test(e);
2577
2225
  }
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();
2226
+ var zs = Object.defineProperty, Us = Object.getOwnPropertyDescriptor, Ls = (e, t, r, n) => {
2227
+ for (var a = n > 1 ? void 0 : n ? Us(t, r) : t, l = e.length - 1, u; l >= 0; l--)
2228
+ (u = e[l]) && (a = (n ? u(t, r, a) : u(a)) || a);
2229
+ return n && a && zs(t, r, a), a;
2230
+ }, Ys = (e, t) => (r, n) => t(r, n, e);
2231
+ let ht = class extends Me {
2232
+ constructor(t) {
2233
+ super();
2234
+ Ne(this, "_initLocal", () => {
2235
+ this._localeService.load({ zhCN: Vr });
2236
+ });
2237
+ this._localeService = t, this._initLocal();
2238
+ }
2239
+ };
2240
+ ht = Ls([
2241
+ je(_e.Rendered, ht),
2242
+ Ys(0, $(me))
2243
+ ], ht);
2244
+ var ae = function() {
2245
+ return ae = Object.assign || function(e) {
2246
+ for (var t, r = 1, n = arguments.length; r < n; r++) {
2247
+ t = arguments[r];
2248
+ for (var a in t)
2249
+ Object.prototype.hasOwnProperty.call(t, a) && (e[a] = t[a]);
2250
+ }
2251
+ return e;
2252
+ }, ae.apply(this, arguments);
2253
+ }, Bs = function(e, t) {
2254
+ var r = {};
2255
+ for (var n in e)
2256
+ Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 && (r[n] = e[n]);
2257
+ if (e != null && typeof Object.getOwnPropertySymbols == "function")
2258
+ for (var a = 0, n = Object.getOwnPropertySymbols(e); a < n.length; a++)
2259
+ t.indexOf(n[a]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[a]) && (r[n[a]] = e[n[a]]);
2260
+ return r;
2261
+ }, rt = tt(function(e, t) {
2262
+ var r = e.icon, n = e.id, a = e.className, l = e.extend, u = Bs(e, ["icon", "id", "className", "extend"]), d = "univerjs-icon univerjs-icon-".concat(n, " ").concat(a || "").trim(), p = Ht("_".concat(Js()));
2263
+ return $n(r, "".concat(n), { defIds: r.defIds, idSuffix: p.current }, ae({ ref: t, className: d }, u), l);
2264
+ });
2265
+ function $n(e, t, r, n, a) {
2266
+ return He(e.tag, ae(ae({ key: t }, Hs(e, r, a)), n), (Vs(e, r).children || []).map(function(l, u) {
2267
+ return $n(l, "".concat(t, "-").concat(e.tag, "-").concat(u), r, void 0, a);
2268
+ }));
2269
+ }
2270
+ function Hs(e, t, r) {
2271
+ var n = ae({}, e.attrs);
2272
+ r != null && r.colorChannel1 && n.fill === "colorChannel1" && (n.fill = r.colorChannel1);
2273
+ var a = t.defIds;
2274
+ 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) {
2275
+ var u = l[0], d = l[1];
2276
+ typeof d == "string" && (n[u] = d.replace(/url\(#(.*)\)/, "url(#$1".concat(t.idSuffix, ")")));
2277
+ })), n;
2278
+ }
2279
+ function Vs(e, t) {
2280
+ var r, n = t.defIds;
2281
+ 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) {
2282
+ 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;
2283
+ }) }) : e;
2284
+ }
2285
+ function Js() {
2286
+ return Math.random().toString(36).substring(2, 8);
2287
+ }
2288
+ rt.displayName = "UniverIcon";
2289
+ var Ws = {
2290
+ tag: "svg",
2291
+ attrs: { fill: "none", viewBox: "0 0 17 17", width: "1em", height: "1em" },
2292
+ children: [
2293
+ {
2294
+ tag: "path",
2295
+ attrs: {
2296
+ fill: "currentColor",
2297
+ d: "M4.93 3.83a2.33 2.33 0 014.67 0v2.64a2.33 2.33 0 01-4.67 0V3.83zm2.33-1a1 1 0 00-1 1v2.64a1 1 0 002 0V3.83a1 1 0 00-1-1zM10.93 3.83a2.33 2.33 0 014.67 0v2.64a2.33 2.33 0 01-4.67 0V3.83zm2.33-1a1 1 0 00-1 1v2.64a1 1 0 102 0V3.83a1 1 0 00-1-1z",
2298
+ fillRule: "evenodd",
2299
+ clipRule: "evenodd"
2300
+ }
2301
+ },
2302
+ {
2303
+ tag: "path",
2304
+ attrs: {
2305
+ fill: "currentColor",
2306
+ d: "M13.4 9.81a.67.67 0 00-.94.94l.86.87H7.26a.67.67 0 100 1.33h6.06l-.86.86a.67.67 0 10.94.94l2-2a.67.67 0 000-.94l-2-2zM2.26 8.21c0-.36.3-.66.67-.66h.33a.67.67 0 010 1.33h-.33a.67.67 0 01-.67-.67z"
2307
+ }
2308
+ }
2309
+ ]
2310
+ }, An = tt(function(e, t) {
2311
+ return He(rt, Object.assign({}, e, {
2312
+ id: "add-digits-single",
2313
+ ref: t,
2314
+ icon: Ws
2315
+ }));
2316
+ });
2317
+ An.displayName = "AddDigitsSingle";
2318
+ const Gs = An;
2319
+ var Ks = {
2320
+ tag: "svg",
2321
+ attrs: { fill: "none", viewBox: "0 0 17 17", width: "1em", height: "1em" },
2322
+ children: [
2323
+ {
2324
+ tag: "mask",
2325
+ attrs: {
2326
+ id: "mask0_102_556",
2327
+ style: { "mask-type": "alpha" },
2328
+ width: 17,
2329
+ height: 17,
2330
+ x: 0,
2331
+ y: 0,
2332
+ maskUnits: "userSpaceOnUse"
2333
+ },
2334
+ children: [
2335
+ { tag: "path", attrs: { fill: "#D9D9D9", d: "M.56.77h16v16h-16z" } }
2336
+ ]
2337
+ },
2338
+ {
2339
+ tag: "g",
2340
+ attrs: { mask: "url(#mask0_102_556)" },
2341
+ children: [
2342
+ {
2343
+ tag: "path",
2344
+ attrs: {
2345
+ fill: "currentColor",
2346
+ d: "M1.2 4.77c.5-.5 1.32-.5 1.83 0l5.1 5.1a.6.6 0 00.86 0l5.1-5.1a1.3 1.3 0 011.84 1.84l-5.95 5.96a2 2 0 01-2.83 0L1.19 6.6a1.3 1.3 0 010-1.84z",
2347
+ fillRule: "evenodd",
2348
+ clipRule: "evenodd"
2349
+ }
2350
+ }
2351
+ ]
2352
+ }
2353
+ ]
2354
+ }, zn = tt(function(e, t) {
2355
+ return He(rt, Object.assign({}, e, {
2356
+ id: "more-down-single",
2357
+ ref: t,
2358
+ icon: Ks
2359
+ }));
2360
+ });
2361
+ zn.displayName = "MoreDownSingle";
2362
+ const qs = zn;
2363
+ var Zs = {
2364
+ tag: "svg",
2365
+ attrs: { fill: "none", viewBox: "0 0 17 17", width: "1em", height: "1em" },
2366
+ children: [
2367
+ {
2368
+ tag: "path",
2369
+ attrs: {
2370
+ fill: "currentColor",
2371
+ d: "M5.13 3.84a2.33 2.33 0 014.67 0v2.7a2.33 2.33 0 01-4.67 0v-2.7zm2.34-1a1 1 0 00-1 1v2.7a1 1 0 002 0v-2.7a1 1 0 00-1-1z",
2372
+ fillRule: "evenodd",
2373
+ clipRule: "evenodd"
2374
+ }
2375
+ },
2376
+ {
2377
+ tag: "path",
2378
+ attrs: {
2379
+ fill: "currentColor",
2380
+ d: "M2.13 8.2c0-.37.3-.67.67-.67h.33a.67.67 0 010 1.34H2.8a.67.67 0 01-.67-.67zM8.94 9.79c.26.26.26.68 0 .94l-.86.86h5.39a.67.67 0 010 1.34h-5.4l.87.86a.67.67 0 11-.95.94l-2-2a.66.66 0 010-.94l2-2a.67.67 0 01.95 0z"
2381
+ }
2382
+ }
2383
+ ]
2384
+ }, Un = tt(function(e, t) {
2385
+ return He(rt, Object.assign({}, e, {
2386
+ id: "reduce-digits-single",
2387
+ ref: t,
2388
+ icon: Zs
2389
+ }));
2390
+ });
2391
+ Un.displayName = "ReduceDigitsSingle";
2392
+ const Qs = Un;
2393
+ var Xs = {
2394
+ tag: "svg",
2395
+ attrs: { fill: "none", viewBox: "0 0 17 17", width: "1em", height: "1em" },
2396
+ children: [
2397
+ {
2398
+ tag: "path",
2399
+ attrs: {
2400
+ fill: "currentColor",
2401
+ d: "M4.65 1.78c.3-.23.7-.17.93.13l3.01 4.3 3.01-4.3a.67.67 0 011.07.8L9.93 6.65h2.74a.67.67 0 110 1.33H9.26v1.94h3.67a.67.67 0 010 1.33H9.26v2.88a.67.67 0 01-1.33 0v-2.88H4.26a.67.67 0 010-1.33h3.67V7.98H4.5a.67.67 0 010-1.33h2.75L4.5 2.7a.67.67 0 01.14-.93z"
2402
+ }
2403
+ }
2404
+ ]
2405
+ }, Ln = tt(function(e, t) {
2406
+ return He(rt, Object.assign({}, e, {
2407
+ id: "rmb-single",
2408
+ ref: t,
2409
+ icon: Xs
2410
+ }));
2411
+ });
2412
+ Ln.displayName = "RmbSingle";
2413
+ const ea = Ln, gt = [
2414
+ {
2415
+ label: "sheet.numfmt.general",
2416
+ pattern: null
2417
+ },
2418
+ {
2419
+ label: "sheet.numfmt.text",
2420
+ pattern: "@@@"
2421
+ },
2422
+ "|",
2423
+ {
2424
+ label: "sheet.numfmt.number",
2425
+ pattern: "0"
2426
+ },
2427
+ "|",
2428
+ {
2429
+ label: "sheet.numfmt.accounting",
2430
+ pattern: '"¥" #,##0.00_);[Red]("¥"#,##0.00)'
2431
+ },
2432
+ {
2433
+ label: "sheet.numfmt.financialValue",
2434
+ pattern: "#,##0.00;[Red]#,##0.00"
2435
+ },
2436
+ {
2437
+ label: "sheet.numfmt.currency",
2438
+ pattern: '"¥"#,##0.00_);[Red]("¥"#,##0.00)'
2439
+ },
2440
+ {
2441
+ label: "sheet.numfmt.roundingCurrency",
2442
+ pattern: '"¥"#,##0;[Red]"¥"#,##0'
2443
+ },
2444
+ "|",
2445
+ {
2446
+ label: "sheet.numfmt.date",
2447
+ pattern: "yyyy-mm-dd;@"
2448
+ },
2449
+ {
2450
+ label: "sheet.numfmt.time",
2451
+ pattern: 'am/pm h":"mm":"ss'
2452
+ },
2453
+ {
2454
+ label: "sheet.numfmt.dateTime",
2455
+ pattern: "yyyy-m-d am/pm h:mm"
2456
+ },
2457
+ {
2458
+ label: "sheet.numfmt.timeDuration",
2459
+ pattern: "h:mm:ss"
2460
+ },
2461
+ "|",
2462
+ {
2463
+ label: "sheet.numfmt.moreFmt",
2464
+ pattern: ""
2465
+ }
2466
+ ], ta = (e) => {
2467
+ const t = de(me), r = e.value ?? t.t("sheet.numfmt.general");
2468
+ return /* @__PURE__ */ O.jsx("span", { className: "more-numfmt-type", children: r });
2469
+ }, na = () => {
2470
+ const e = de(Ce), t = de(me), r = Hr(), n = de(Be), a = (d) => {
2471
+ const p = n.getLast();
2472
+ if (!p)
2473
+ return;
2474
+ const v = r.get(Ar), h = p.range, f = [];
2475
+ ne.foreach(h, (b, I) => {
2476
+ d ? f.push({ row: b, col: I, pattern: d, type: Gt(d) }) : f.push({ row: b, col: I });
2477
+ }), e.executeCommand(Le.id, { values: f }), v.focus();
2478
+ }, l = (d) => {
2479
+ if (d === 0)
2480
+ a(null);
2481
+ else if (d === gt.length - 1)
2482
+ e.executeCommand(Ct.id);
2483
+ else {
2484
+ const p = gt[d];
2485
+ p.pattern && a(p.pattern);
2486
+ }
2487
+ }, u = 1220;
2488
+ 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(
2489
+ "div",
2490
+ {
2491
+ className: "option-item m-t-4",
2492
+ onClick: () => {
2493
+ l(p);
2494
+ },
2495
+ children: [
2496
+ /* @__PURE__ */ O.jsx("div", { children: t.t(d.label) }),
2497
+ /* @__PURE__ */ O.jsx("div", { className: "m-l-26", children: d.pattern ? ge.format(d.pattern || "", u, { locale: "zh-CN" }) : "" })
2498
+ ]
2499
+ },
2500
+ p
2501
+ )) });
2502
+ }, ra = (e) => {
2503
+ const t = "icon-rmbSingle";
2504
+ return e.register(t, ea), e.register("MoreDownSingle", qs), (r) => ({
2505
+ icon: t,
2506
+ id: On.id,
2507
+ title: "sheet.numfmt.currency",
2508
+ tooltip: "sheet.numfmt.currency",
2509
+ type: Rt.BUTTON,
2510
+ group: wt.TOOLBAR_FORMULAS_INSERT,
2511
+ positions: [Pt.TOOLBAR_START],
2512
+ hidden$: Dt(r, jt.SHEET),
2513
+ disabled$: It(r)
2514
+ });
2515
+ }, sa = (e) => {
2516
+ const t = "icon-addDigitsSingle";
2517
+ return e.register(t, Gs), (r) => ({
2518
+ icon: t,
2519
+ id: Pn.id,
2520
+ title: "sheet.numfmt.addDecimal",
2521
+ tooltip: "sheet.numfmt.addDecimal",
2522
+ type: Rt.BUTTON,
2523
+ positions: [Pt.TOOLBAR_START],
2524
+ group: wt.TOOLBAR_FORMULAS_INSERT,
2525
+ hidden$: Dt(r, jt.SHEET),
2526
+ disabled$: It(r)
2527
+ });
2528
+ }, aa = (e) => {
2529
+ const t = "icon-reduceDigitsSingle";
2530
+ return e.register(t, Qs), (r) => ({
2531
+ icon: t,
2532
+ id: En.id,
2533
+ title: "sheet.numfmt.subtractDecimal",
2534
+ tooltip: "sheet.numfmt.subtractDecimal",
2535
+ type: Rt.BUTTON,
2536
+ group: wt.TOOLBAR_FORMULAS_INSERT,
2537
+ positions: [Pt.TOOLBAR_START],
2538
+ hidden$: Dt(r, jt.SHEET),
2539
+ disabled$: It(r)
2540
+ });
2541
+ }, ia = (e) => {
2542
+ const t = "sheet.numfmt.moreNumfmtType", r = "sheet.numfmt.moreNumfmtType.options";
2543
+ return e.register(t, ta), e.register(r, na), (n) => {
2544
+ const a = n.get(ye), l = n.get(ve), u = n.get(Ce), d = n.get(me), p = n.get(Be), v = new ke(
2545
+ (h) => Yt(
2546
+ p.selectionMoveEnd$,
2547
+ new ke((f) => {
2548
+ const b = [te.id, oe.id], I = u.onCommandExecuted((D) => {
2549
+ b.includes(D.id) && f.next(null);
2550
+ });
2551
+ return () => I.dispose();
2552
+ })
2553
+ ).subscribe(() => {
2554
+ const f = p.getSelections();
2555
+ if (f && f[0]) {
2556
+ const b = l.getCurrentUniverSheetInstance(), I = b.getActiveSheet(), D = f[0].range, E = D.startRow, R = D.startColumn, z = a.getValue(b.getUnitId(), I.getSheetId(), E, R);
2557
+ let B = d.t("sheet.numfmt.general");
2558
+ if (z) {
2559
+ const W = z.pattern, Q = gt.filter((pe) => typeof pe == "object" && pe.pattern).find(
2560
+ (pe) => Ve(W, pe.pattern)
2561
+ );
2562
+ Q && typeof Q == "object" && Q.pattern ? B = d.t(Q.label) : B = d.t("sheet.numfmt.moreFmt");
2563
+ }
2564
+ h.next(B);
2565
+ }
2566
+ })
2567
+ );
2568
+ return {
2569
+ // icon: 'MoreDownSingle',
2570
+ label: t,
2571
+ id: Ct.id,
2572
+ tooltip: "sheet.numfmt.title",
2573
+ type: Rt.SELECTOR,
2574
+ group: wt.TOOLBAR_FORMULAS_INSERT,
2575
+ positions: [Pt.TOOLBAR_START],
2576
+ selections: [
2577
+ {
2578
+ label: {
2579
+ name: r,
2580
+ hoverable: !1
2581
+ }
2582
+ }
2583
+ ],
2584
+ value$: v,
2585
+ hidden$: Dt(n, jt.SHEET),
2586
+ disabled$: It(n)
2587
+ };
2588
+ };
2589
+ };
2590
+ var oa = Object.defineProperty, ca = Object.getOwnPropertyDescriptor, la = (e, t, r, n) => {
2591
+ for (var a = n > 1 ? void 0 : n ? ca(t, r) : t, l = e.length - 1, u; l >= 0; l--)
2592
+ (u = e[l]) && (a = (n ? u(t, r, a) : u(a)) || a);
2593
+ return n && a && oa(t, r, a), a;
2594
+ }, At = (e, t) => (r, n) => t(r, n, e);
2595
+ let vt = class extends Me {
2596
+ constructor(e, t, r) {
2597
+ super(), this._injector = e, this._componentManager = t, this._menuService = r, this._initMenu();
2598
+ }
2599
+ _initMenu() {
2600
+ [sa, aa, ra, ia].map((e) => e(this._componentManager)).forEach((e) => {
2601
+ this.disposeWithMe(this._menuService.addMenuItem(e(this._injector)));
2602
+ });
2603
+ }
2604
+ };
2605
+ vt = la([
2606
+ je(_e.Rendered, vt),
2607
+ At(0, $(we)),
2608
+ At(1, $(xn)),
2609
+ At(2, $(Ur))
2610
+ ], vt);
2611
+ var ua = Object.defineProperty, da = Object.getOwnPropertyDescriptor, ma = (e, t, r, n) => {
2612
+ for (var a = n > 1 ? void 0 : n ? da(t, r) : t, l = e.length - 1, u; l >= 0; l--)
2613
+ (u = e[l]) && (a = (n ? u(t, r, a) : u(a)) || a);
2614
+ return n && a && ua(t, r, a), a;
2615
+ }, ze = (e, t) => (r, n) => t(r, n, e);
2616
+ const pa = [oe.id, te.id];
2617
+ let _t = class extends Me {
2618
+ constructor(e, t, r, n, a, l) {
2619
+ super(), this._numfmtService = e, this._univerInstanceService = t, this._injector = r, this._refRangeService = n, this._sheetSkeletonManagerService = a, this._commandService = l, this._registerRefRange(), this._mergeRefMutations();
2587
2620
  }
2588
2621
  _mergeRefMutations() {
2589
2622
  this._refRangeService.interceptor.intercept(this._refRangeService.interceptor.getInterceptPoints().MERGE_REDO, {
2590
- handler: (e, t, a) => {
2623
+ handler: (e, t, r) => {
2591
2624
  if (!e)
2592
- return a(e);
2593
- const n = e.filter((i) => !Xs.includes(i.id));
2594
- return n.push(...Et(e)), a(n);
2625
+ return r(e);
2626
+ const n = e.filter((a) => !pa.includes(a.id));
2627
+ return n.push(...St(e)), r(n);
2595
2628
  }
2596
2629
  });
2597
2630
  }
2598
2631
  _registerRefRange() {
2599
2632
  this.disposeWithMe(
2600
- De(
2601
- Ft(
2633
+ Te(
2634
+ Yt(
2602
2635
  this._sheetSkeletonManagerService.currentSkeleton$.pipe(
2603
2636
  Ze((e) => e == null ? void 0 : e.sheetId),
2604
- _n()
2637
+ Mn()
2605
2638
  ),
2606
2639
  this._numfmtService.modelReplace$
2607
2640
  ).pipe(
2608
- yn(
2609
- () => new Oe((e) => {
2610
- const t = new gn();
2641
+ jn(
2642
+ () => new ke((e) => {
2643
+ const t = new Sn();
2611
2644
  return e.next(t), () => {
2612
2645
  t.dispose();
2613
2646
  };
2614
2647
  })
2615
2648
  )
2616
2649
  ).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) => {
2650
+ 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
2651
  const h = {
2619
- startRow: m,
2652
+ startRow: p,
2620
2653
  startColumn: v,
2621
- endRow: m,
2654
+ endRow: p,
2622
2655
  endColumn: v
2623
2656
  };
2624
2657
  let f = [];
2625
2658
  switch (d.id) {
2626
2659
  case ue.DeleteRangeMoveLeftCommandId: {
2627
- f = yr(d, h);
2660
+ f = xr(d, h);
2628
2661
  break;
2629
2662
  }
2630
2663
  case ue.DeleteRangeMoveUpCommandId: {
2631
- f = _r(d, h);
2664
+ f = jr(d, h);
2632
2665
  break;
2633
2666
  }
2634
2667
  case ue.InsertColCommandId: {
2635
- f = vr(d, h);
2668
+ f = Mr(d, h);
2636
2669
  break;
2637
2670
  }
2638
2671
  case ue.InsertRangeMoveDownCommandId: {
2639
- f = gr(d, h);
2672
+ f = Cr(d, h);
2640
2673
  break;
2641
2674
  }
2642
2675
  case ue.InsertRangeMoveRightCommandId: {
2643
- f = hr(d, h);
2676
+ f = Sr(d, h);
2644
2677
  break;
2645
2678
  }
2646
2679
  case ue.InsertRowCommandId: {
2647
- f = fr(d, h);
2680
+ f = br(d, h);
2648
2681
  break;
2649
2682
  }
2650
2683
  case ue.MoveRangeCommandId: {
2651
- f = pr(d, h);
2684
+ f = yr(d, h);
2652
2685
  break;
2653
2686
  }
2654
2687
  case ue.RemoveColCommandId: {
2655
- f = mr(d, h);
2688
+ f = _r(d, h);
2656
2689
  break;
2657
2690
  }
2658
2691
  case ue.RemoveRowCommandId: {
2659
- f = dr(d, h);
2692
+ f = vr(d, h);
2660
2693
  break;
2661
2694
  }
2662
2695
  case ue.MoveColsCommandId: {
2663
- f = ur(d, h);
2696
+ f = gr(d, h);
2664
2697
  break;
2665
2698
  }
2666
2699
  case ue.MoveRowsCommandId:
2667
- f = lr(d, h);
2700
+ f = hr(d, h);
2668
2701
  }
2669
- const b = br(f, h), I = this._numfmtService.getValue(a, n, m, v);
2702
+ const b = Ir(f, h), I = this._numfmtService.getValue(r, n, p, v);
2670
2703
  if (!b && I) {
2671
2704
  const D = {
2672
- id: re.id,
2705
+ id: te.id,
2673
2706
  params: {
2674
- unitId: a,
2707
+ unitId: r,
2675
2708
  subUnitId: n,
2676
- ranges: [{ startColumn: v, startRow: m, endColumn: v, endRow: m }]
2709
+ ranges: [{ startColumn: v, startRow: p, endColumn: v, endRow: p }]
2677
2710
  }
2678
- }, P = Pe(this._injector, D.params);
2711
+ }, E = Fe(this._injector, D.params);
2679
2712
  return {
2680
2713
  redos: [D],
2681
- undos: P
2714
+ undos: E
2682
2715
  };
2683
2716
  }
2684
2717
  if (I && b) {
2685
- const D = [], P = [], R = [
2718
+ const D = [], E = [], R = [
2686
2719
  {
2687
2720
  pattern: I.pattern,
2688
2721
  type: I.type,
2689
2722
  row: b.startRow,
2690
2723
  col: b.startColumn
2691
2724
  }
2692
- ], A = {
2725
+ ], z = {
2693
2726
  id: oe.id,
2694
- params: qe(a, n, R)
2695
- }, V = Qe(this._injector, A.params), W = {
2696
- id: re.id,
2727
+ params: Xe(r, n, R)
2728
+ }, B = et(this._injector, z.params), W = {
2729
+ id: te.id,
2697
2730
  params: {
2698
- unitId: a,
2731
+ unitId: r,
2699
2732
  subUnitId: n,
2700
- ranges: [{ startColumn: v, startRow: m, endColumn: v, endRow: m }]
2733
+ ranges: [{ startColumn: v, startRow: p, endColumn: v, endRow: p }]
2701
2734
  }
2702
- }, Q = Pe(this._injector, W.params);
2703
- return D.push(A, W), P.push(...V, ...Q), {
2735
+ }, Q = Fe(this._injector, W.params);
2736
+ return D.push(z, W), E.push(...B, ...Q), {
2704
2737
  redos: D,
2705
- undos: P.reverse()
2738
+ undos: E.reverse()
2706
2739
  };
2707
2740
  }
2708
2741
  return { redos: [], undos: [] };
2709
2742
  };
2710
- i && i.forValue((d, m) => {
2743
+ a && a.forValue((d, p) => {
2711
2744
  const v = {
2712
2745
  startRow: d,
2713
- startColumn: m,
2746
+ startColumn: p,
2714
2747
  endRow: d,
2715
- endColumn: m
2748
+ endColumn: p
2716
2749
  }, h = this._refRangeService.registerRefRange(
2717
2750
  v,
2718
- (f) => u(f, d, m)
2751
+ (f) => u(f, d, p)
2719
2752
  );
2720
- l.set(`${d}_${m}`, h), e.add(h);
2753
+ l.set(`${d}_${p}`, h), e.add(h);
2721
2754
  }), e.add(
2722
- De(
2723
- new Oe((d) => {
2755
+ Te(
2756
+ new ke((d) => {
2724
2757
  e.add(
2725
- this._commandService.onCommandExecuted((m) => {
2726
- [oe.id, re.id].includes(m.id) && d.next(m.params);
2758
+ this._commandService.onCommandExecuted((p) => {
2759
+ [oe.id, te.id].includes(p.id) && d.next(p.params);
2727
2760
  })
2728
2761
  );
2729
2762
  }).pipe(
2730
- ln(
2731
- (d) => d.unitId === a && d.subUnitId === n
2763
+ fn(
2764
+ (d) => d.unitId === r && d.subUnitId === n
2732
2765
  ),
2733
- Ze((d) => d.ranges ? d.ranges : d.values ? Object.keys(d.values).reduce((m, v) => {
2766
+ Ze((d) => d.ranges ? d.ranges : d.values ? Object.keys(d.values).reduce((p, v) => {
2734
2767
  const h = d.values[v];
2735
- return m.push(...h.ranges), m;
2768
+ return p.push(...h.ranges), p;
2736
2769
  }, []) : []),
2737
2770
  Fr(300),
2738
2771
  // updating the listener moves to the next queue
2739
2772
  Ze(
2740
- (d) => d.reduce((m, v) => (m.push(...v), m), [])
2773
+ (d) => d.reduce((p, v) => (p.push(...v), p), [])
2741
2774
  ),
2742
- ln((d) => !!d.length)
2775
+ fn((d) => !!d.length)
2743
2776
  ).subscribe((d) => {
2744
- d.forEach((m) => {
2745
- ne.foreach(m, (v, h) => {
2777
+ d.forEach((p) => {
2778
+ ne.foreach(p, (v, h) => {
2746
2779
  const f = `${v}_${h}`, b = l.get(f);
2747
- if (l.delete(f), b && b.dispose(), this._numfmtService.getValue(a, n, v, h)) {
2780
+ if (l.delete(f), b && b.dispose(), this._numfmtService.getValue(r, n, v, h)) {
2748
2781
  const D = {
2749
2782
  startRow: v,
2750
2783
  startColumn: h,
2751
2784
  endRow: v,
2752
2785
  endColumn: h
2753
- }, P = this._refRangeService.registerRefRange(
2786
+ }, E = this._refRangeService.registerRefRange(
2754
2787
  D,
2755
2788
  (R) => u(R, v, h)
2756
2789
  );
2757
- l.set(f, P), e.add(P);
2790
+ l.set(f, E), e.add(E);
2758
2791
  }
2759
2792
  });
2760
2793
  });
@@ -2766,43 +2799,43 @@ let pt = class extends Le {
2766
2799
  );
2767
2800
  }
2768
2801
  };
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();
2802
+ _t = ma([
2803
+ je(_e.Rendered, _t),
2804
+ ze(0, $(ye)),
2805
+ ze(1, $(ve)),
2806
+ ze(2, $(we)),
2807
+ ze(3, $(fr)),
2808
+ ze(4, $(Lt)),
2809
+ ze(5, $(Ce))
2810
+ ], _t);
2811
+ var fa = Object.defineProperty, ha = Object.getOwnPropertyDescriptor, ga = (e, t, r, n) => {
2812
+ for (var a = n > 1 ? void 0 : n ? ha(t, r) : t, l = e.length - 1, u; l >= 0; l--)
2813
+ (u = e[l]) && (a = (n ? u(t, r, a) : u(a)) || a);
2814
+ return n && a && fa(t, r, a), a;
2815
+ }, lt = (e, t) => (r, n) => t(r, n, e);
2816
+ let yt = class extends Me {
2817
+ constructor(e, t, r, n) {
2818
+ super(), this._numfmtService = e, this._sheetInterceptorService = t, this._univerInstanceService = r, this._injector = n, this._initSheetChange();
2786
2819
  }
2787
2820
  _initSheetChange() {
2788
2821
  this.disposeWithMe(
2789
2822
  this._sheetInterceptorService.interceptCommand({
2790
2823
  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)
2824
+ if (e.id === Rr.id) {
2825
+ const t = e.params, r = t.unitId || va(this._univerInstanceService), n = t.subUnitId || _a(this._univerInstanceService), a = this._numfmtService.getModel(r, n);
2826
+ if (!a)
2794
2827
  return { redos: [], undos: [] };
2795
2828
  const l = [];
2796
- i.forValue((m, v) => {
2797
- l.push({ startColumn: v, endColumn: v, startRow: m, endRow: m });
2829
+ a.forValue((p, v) => {
2830
+ l.push({ startColumn: v, endColumn: v, startRow: p, endRow: p });
2798
2831
  });
2799
2832
  const u = {
2800
- unitId: a,
2833
+ unitId: r,
2801
2834
  subUnitId: n,
2802
- ranges: Ce(l)
2803
- }, d = Pe(this._injector, u);
2835
+ ranges: Ie(l)
2836
+ }, d = Fe(this._injector, u);
2804
2837
  return {
2805
- redos: [{ id: re.id, params: u }],
2838
+ redos: [{ id: te.id, params: u }],
2806
2839
  undos: d
2807
2840
  };
2808
2841
  }
@@ -2812,33 +2845,33 @@ let ft = class extends Le {
2812
2845
  );
2813
2846
  }
2814
2847
  };
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 {
2848
+ yt = ga([
2849
+ je(_e.Rendered, yt),
2850
+ lt(0, $(ye)),
2851
+ lt(1, $(xt)),
2852
+ lt(2, $(ve)),
2853
+ lt(3, $(we))
2854
+ ], yt);
2855
+ const va = (e) => e.getCurrentUniverSheetInstance().getUnitId(), _a = (e) => e.getCurrentUniverSheetInstance().getActiveSheet().getSheetId();
2856
+ var ya = Object.defineProperty, ba = Object.getOwnPropertyDescriptor, Sa = (e, t, r, n) => {
2857
+ for (var a = n > 1 ? void 0 : n ? ba(t, r) : t, l = e.length - 1, u; l >= 0; l--)
2858
+ (u = e[l]) && (a = (n ? u(t, r, a) : u(a)) || a);
2859
+ return n && a && ya(t, r, a), a;
2860
+ }, Ca = (e, t) => (r, n) => t(r, n, e), zt;
2861
+ let _n = (zt = class extends lr {
2829
2862
  constructor(e, t) {
2830
- super(gt), this._injector = t;
2863
+ super(Qe), this._injector = t;
2831
2864
  }
2832
2865
  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]);
2866
+ 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
2867
  }
2835
- }, ke(Pt, "type", sr.Sheet), Pt);
2836
- fn = oa([
2837
- ca(1, z(Ne))
2838
- ], fn);
2868
+ }, Ne(zt, "type", ur.Sheet), zt);
2869
+ _n = Sa([
2870
+ Ca(1, $(we))
2871
+ ], _n);
2839
2872
  export {
2840
- Ue as SetNumfmtCommand,
2841
- fn as UniverSheetsNumfmtPlugin,
2842
- Sa as enUS,
2843
- zr as zhCN
2873
+ Le as SetNumfmtCommand,
2874
+ _n as UniverSheetsNumfmtPlugin,
2875
+ Ta as enUS,
2876
+ Vr as zhCN
2844
2877
  };