@xlcalc/vue 0.0.0-stage → 0.21.2
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/CHANGELOG.md +42 -0
- package/LICENSE +21 -0
- package/README.md +75 -2
- package/dist/abort.d.ts +6 -0
- package/dist/components/CellDraft.vue.d.ts +7 -0
- package/dist/components/CellEditor.vue.d.ts +3 -0
- package/dist/components/ColourSwatches.vue.d.ts +13 -0
- package/dist/components/DialogShell.vue.d.ts +37 -0
- package/dist/components/ExplainPanel.vue.d.ts +3 -0
- package/dist/components/FilterPopover.vue.d.ts +3 -0
- package/dist/components/FindBar.vue.d.ts +3 -0
- package/dist/components/FormatBorders.vue.d.ts +14 -0
- package/dist/components/FormatColour.vue.d.ts +19 -0
- package/dist/components/FormatDialog.vue.d.ts +24 -0
- package/dist/components/FormulaBar.vue.d.ts +3 -0
- package/dist/components/FunctionList.vue.d.ts +28 -0
- package/dist/components/FunctionTip.vue.d.ts +14 -0
- package/dist/components/InsertFunction.vue.d.ts +9 -0
- package/dist/components/OutlineCell.vue.d.ts +8 -0
- package/dist/components/OutlineLevels.vue.d.ts +7 -0
- package/dist/components/SheetGrid.vue.d.ts +3 -0
- package/dist/components/SheetMarks.vue.d.ts +3 -0
- package/dist/components/SheetMenu.vue.d.ts +3 -0
- package/dist/components/SheetRow.vue.d.ts +18 -0
- package/dist/components/SheetTabs.vue.d.ts +3 -0
- package/dist/components/SheetToolbar.vue.d.ts +43 -0
- package/dist/components/SheetView.vue.d.ts +56 -0
- package/dist/components/ValidationAlert.vue.d.ts +16 -0
- package/dist/components/ValidationDropdown.vue.d.ts +33 -0
- package/dist/components/ValidationPrompt.vue.d.ts +16 -0
- package/dist/components/cf-icons.d.ts +6 -0
- package/dist/components/context.d.ts +4 -0
- package/dist/components/dom.d.ts +7 -0
- package/dist/components/icons.d.ts +33 -0
- package/dist/components/popup.d.ts +29 -0
- package/dist/components/toolbar-icons.d.ts +24 -0
- package/dist/contract/memory.d.ts +108 -0
- package/dist/contract/messages.d.ts +260 -0
- package/dist/contract/source.d.ts +433 -0
- package/dist/contract/view.d.ts +108 -0
- package/dist/contract.d.ts +9 -0
- package/dist/core/ask.d.ts +2 -0
- package/dist/core/autocomplete.d.ts +28 -0
- package/dist/core/cell-style.d.ts +33 -0
- package/dist/core/cell-view.d.ts +104 -0
- package/dist/core/clip.d.ts +43 -0
- package/dist/core/commands.d.ts +47 -0
- package/dist/core/conditional.d.ts +16 -0
- package/dist/core/editing.d.ts +85 -0
- package/dist/core/explain.d.ts +36 -0
- package/dist/core/fill.d.ts +42 -0
- package/dist/core/filter.d.ts +72 -0
- package/dist/core/find.d.ts +53 -0
- package/dist/core/formula.d.ts +41 -0
- package/dist/core/function-tip.d.ts +34 -0
- package/dist/core/geometry.d.ts +55 -0
- package/dist/core/keys.d.ts +8 -0
- package/dist/core/list-keys.d.ts +4 -0
- package/dist/core/list.d.ts +17 -0
- package/dist/core/menu.d.ts +155 -0
- package/dist/core/merge.d.ts +19 -0
- package/dist/core/navigation.d.ts +72 -0
- package/dist/core/outline.d.ts +34 -0
- package/dist/core/point.d.ts +34 -0
- package/dist/core/ref-paint.d.ts +21 -0
- package/dist/core/selection.d.ts +45 -0
- package/dist/core/sheet.d.ts +774 -0
- package/dist/core/state.d.ts +107 -0
- package/dist/core/storage.d.ts +6 -0
- package/dist/core/totals.d.ts +16 -0
- package/dist/core/validation.d.ts +95 -0
- package/dist/core/viewport.d.ts +83 -0
- package/dist/core/windows.d.ts +102 -0
- package/dist/entry.d.ts +3 -0
- package/dist/failure.d.ts +5 -0
- package/dist/filter-key.d.ts +3 -0
- package/dist/find-match.d.ts +24 -0
- package/dist/format-cells.d.ts +85 -0
- package/dist/frame.d.ts +5 -0
- package/dist/grid-ref.d.ts +3 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +12767 -0
- package/dist/lines.d.ts +16 -0
- package/dist/local/find.d.ts +15 -0
- package/dist/local/index.d.ts +3 -0
- package/dist/local/locale.d.ts +5 -0
- package/dist/local/outcome.d.ts +21 -0
- package/dist/local/query.d.ts +23 -0
- package/dist/local/source.d.ts +4 -0
- package/dist/local/types.d.ts +37 -0
- package/dist/local/validation.d.ts +8 -0
- package/dist/local/window.d.ts +16 -0
- package/dist/local/xlsx.d.ts +23 -0
- package/dist/local.js +1025 -0
- package/dist/locale-ref.d.ts +7 -0
- package/dist/locales.d.ts +3 -0
- package/dist/memory-outline.d.ts +31 -0
- package/dist/memory-query.d.ts +26 -0
- package/dist/memory-source.d.ts +3 -0
- package/dist/memory-validation.d.ts +17 -0
- package/dist/messages.d.ts +6 -0
- package/dist/number-formats.d.ts +13 -0
- package/dist/rect.d.ts +9 -0
- package/dist/ru-RU-BVeg6JGM.js +931 -0
- package/dist/sheet-query.d.ts +22 -0
- package/dist/stats.d.ts +8 -0
- package/dist/style.css +2 -0
- package/dist/toolbar.d.ts +39 -0
- package/dist/typed-entry-2l9Ay-hV.js +4559 -0
- package/dist/window-size.d.ts +4 -0
- package/docs/api.md +520 -0
- package/docs/autocomplete.md +60 -0
- package/docs/checks.md +40 -0
- package/docs/clipboard.md +48 -0
- package/docs/editing.md +97 -0
- package/docs/example-app.md +26 -0
- package/docs/find-replace.md +26 -0
- package/docs/list-mode.md +86 -0
- package/docs/local.md +94 -0
- package/docs/quick-start.md +221 -0
- package/docs/sheets.md +61 -0
- package/docs/toolbar.md +72 -0
- package/docs/validation.md +41 -0
- package/docs/view.md +50 -0
- package/package.json +92 -4
|
@@ -0,0 +1,4559 @@
|
|
|
1
|
+
//#region node_modules/xlcalc/dist/arity.js
|
|
2
|
+
function e(e, t) {
|
|
3
|
+
return e ? e.at?.includes(t) ? !0 : e.from === void 0 || t < e.from ? !1 : e.odd ? t % 2 == 1 : !e.even || t % 2 == 0 : !1;
|
|
4
|
+
}
|
|
5
|
+
function t(t) {
|
|
6
|
+
let n = t.args.split(" ").filter(Boolean), r = t.rep ?? 0, i = n.length - r, a = n.filter((e) => !e.endsWith("?")).length, o = r ? t.max ?? 255 : n.length, s = (e) => e <= n.length || (e - i) % r === 0;
|
|
7
|
+
r && !s(o) && o--;
|
|
8
|
+
let c = r === 2 ? {
|
|
9
|
+
min: a,
|
|
10
|
+
max: o,
|
|
11
|
+
parity: i % 2 ? "odd" : "even",
|
|
12
|
+
or: a < n.length
|
|
13
|
+
} : {
|
|
14
|
+
min: a,
|
|
15
|
+
max: o
|
|
16
|
+
};
|
|
17
|
+
return {
|
|
18
|
+
min: a,
|
|
19
|
+
max: o,
|
|
20
|
+
takes: (e) => e >= a && e <= o && s(e),
|
|
21
|
+
counts: c,
|
|
22
|
+
omits: (n) => !e(t.notOmitted, n)
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
var n = (e) => {
|
|
26
|
+
throw Error(`no arities to check ${e}'s arguments by: an entry gives them (useArities)`);
|
|
27
|
+
};
|
|
28
|
+
function r(e) {
|
|
29
|
+
n = e;
|
|
30
|
+
}
|
|
31
|
+
function i(e) {
|
|
32
|
+
let n = /* @__PURE__ */ new Map();
|
|
33
|
+
return (r) => {
|
|
34
|
+
let i = n.get(r);
|
|
35
|
+
return !i && Object.hasOwn(e, r) && n.set(r, i = t(e[r])), i;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
var a = (e) => n(e), o = ["LET"], s = (e) => n(e) !== void 0 || o.includes(e), c = 1048576, l = 16384;
|
|
39
|
+
function u(e) {
|
|
40
|
+
let t = 0;
|
|
41
|
+
for (let n of e.toUpperCase()) t = t * 26 + (n.charCodeAt(0) - 64);
|
|
42
|
+
return t - 1;
|
|
43
|
+
}
|
|
44
|
+
var d = /^[+-]?(\d+\.?\d*|\.\d+)([eE][+-]?\d+)?$/;
|
|
45
|
+
function f(e, t = 0) {
|
|
46
|
+
let n = /^([+-]?)(\d*)\.?(\d*)(?:[eE]([+-]?\d+))?$/.exec(e), r = n[2] + n[3], i = r.search(/[1-9]/);
|
|
47
|
+
if ((i < 0 || r.length - i <= 15) && !t) return Number(e);
|
|
48
|
+
let a = i < 0 ? r : r.slice(0, i + 15).padEnd(r.length, "0");
|
|
49
|
+
return Number(`${n[1]}${a.slice(0, n[2].length)}.${a.slice(n[2].length)}e${Number(n[4] ?? 0) + t}`);
|
|
50
|
+
}
|
|
51
|
+
var p = 864e5, m = /* @__PURE__ */ Date.UTC(1899, 11, 30), h = (e) => e < 61 ? e - 1 : e;
|
|
52
|
+
function g(e) {
|
|
53
|
+
let t = e < 61 ? e + 1 : e;
|
|
54
|
+
return m + Math.round(t * p);
|
|
55
|
+
}
|
|
56
|
+
function _(e) {
|
|
57
|
+
return h((e - m) / p);
|
|
58
|
+
}
|
|
59
|
+
//#endregion
|
|
60
|
+
//#region node_modules/xlcalc/dist/input-error.js
|
|
61
|
+
var v = class extends TypeError {
|
|
62
|
+
path;
|
|
63
|
+
name = "InputError";
|
|
64
|
+
constructor(e, t) {
|
|
65
|
+
super(`${e}: ${t}`), this.path = e;
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
function y(e) {
|
|
69
|
+
return e == null ? String(e) : Array.isArray(e) ? "an array" : typeof e == "object" ? "an object" : typeof e == "function" ? "a function" : typeof e == "string" ? `the string ${JSON.stringify(e)}` : `${typeof e} ${String(e)}`;
|
|
70
|
+
}
|
|
71
|
+
//#endregion
|
|
72
|
+
//#region node_modules/xlcalc/dist/layout/spans.js
|
|
73
|
+
var b = {
|
|
74
|
+
c: "letters such as \"C\" or a span such as \"B:D\"",
|
|
75
|
+
r: "a row number such as \"5\" or a span such as \"5:9\""
|
|
76
|
+
}, x = (e) => e === "rows" ? "row" : "column", S = {
|
|
77
|
+
outlineDeep: (e) => `the ${e.lines} ${e.span} are already at the deepest outline level, 7, and cannot be grouped further`,
|
|
78
|
+
notGrouped: (e) => `the ${e.lines} ${e.span} are not in a group`,
|
|
79
|
+
noSummary: (e) => `${x(e.lines)} ${e.span} is not in a group with a summary ${x(e.lines)}`,
|
|
80
|
+
detailShown: (e) => `the detail of ${x(e.lines)} ${e.span} is already shown`,
|
|
81
|
+
detailHidden: (e) => `the detail of ${x(e.lines)} ${e.span} is already hidden`
|
|
82
|
+
}, C = {
|
|
83
|
+
DIV0: "#DIV/0!",
|
|
84
|
+
NA: "#N/A",
|
|
85
|
+
NAME: "#NAME?",
|
|
86
|
+
NUM: "#NUM!",
|
|
87
|
+
REF: "#REF!",
|
|
88
|
+
VALUE: "#VALUE!",
|
|
89
|
+
NULL: "#NULL!",
|
|
90
|
+
CYCLE: "#CYCLE!",
|
|
91
|
+
SPILL: "#SPILL!",
|
|
92
|
+
CALC: "#CALC!",
|
|
93
|
+
ERROR: "#ERROR!"
|
|
94
|
+
}, w = Object.fromEntries(Object.entries(C).map(([e, t]) => [t, e])), ee = ((e) => e.map((e) => C[e]))([
|
|
95
|
+
"NULL",
|
|
96
|
+
"DIV0",
|
|
97
|
+
"VALUE",
|
|
98
|
+
"REF",
|
|
99
|
+
"NAME",
|
|
100
|
+
"NUM",
|
|
101
|
+
"NA"
|
|
102
|
+
]), te = [...ee, C.SPILL];
|
|
103
|
+
[...te, C.CALC];
|
|
104
|
+
var T = [
|
|
105
|
+
...ee,
|
|
106
|
+
"#GETTING_DATA",
|
|
107
|
+
C.SPILL,
|
|
108
|
+
C.CALC,
|
|
109
|
+
"#FIELD!",
|
|
110
|
+
"#BLOCKED!",
|
|
111
|
+
"#CONNECT!",
|
|
112
|
+
"#BUSY!",
|
|
113
|
+
"#UNKNOWN!",
|
|
114
|
+
"#PYTHON!"
|
|
115
|
+
], ne = (e, t) => t?.[C[e]] ?? C[e], re = (e) => e.t === "op" || e.t === "ident" || e.t === "fn" ? JSON.stringify(e.v) : e.t === "eof" ? "end of formula" : e.t, ie = ({ min: e, max: t, parity: n, or: r }) => {
|
|
116
|
+
let i = e === t ? `${e}` : `${e} to ${t}`;
|
|
117
|
+
return n ? r ? `${e}, or ${n} ${e + 1} to ${t}` : `${i} (${n})` : i;
|
|
118
|
+
}, ae = {
|
|
119
|
+
chars: () => "a name must start with a letter (of any script), _ or \\ and contain only letters, digits, _, ., \\ and ? (255 characters at most)",
|
|
120
|
+
cell: () => "a name must not look like a cell address or an R1C1 reference",
|
|
121
|
+
true: () => "TRUE and FALSE are reserved",
|
|
122
|
+
boolean: (e) => `${e} is a boolean in the workbook's locale`
|
|
123
|
+
}, oe = {
|
|
124
|
+
rowOutOfRange: (e) => `row ${e.row} out of range`,
|
|
125
|
+
columnOutOfRange: (e) => `column ${e.column} out of range`,
|
|
126
|
+
spillAfterRange: () => "a spill reference (#) must follow a single cell",
|
|
127
|
+
spillAcrossSheets: () => "a spill reference (#) must follow a single cell on one sheet",
|
|
128
|
+
unterminatedString: () => "unterminated string",
|
|
129
|
+
unknownErrorLiteral: () => "unknown error literal",
|
|
130
|
+
externalReference: () => "external workbook reference",
|
|
131
|
+
externalAcrossSheets: () => "a reference across the sheets of another workbook is not supported",
|
|
132
|
+
externalSpill: () => "a spill reference into another workbook is not supported",
|
|
133
|
+
referenceAfterSheet: () => "reference expected after sheet name",
|
|
134
|
+
quotedSheetAlone: () => "quoted sheet name without a reference",
|
|
135
|
+
unexpectedCharacter: (e) => `unexpected character ${JSON.stringify(e.char)}`,
|
|
136
|
+
emptyFormula: () => "empty formula",
|
|
137
|
+
tooLong: (e) => `formula longer than ${e.max} characters`,
|
|
138
|
+
tooDeep: (e) => `nesting deeper than ${e.max} levels`,
|
|
139
|
+
unexpectedEnd: () => "unexpected end of formula",
|
|
140
|
+
unexpected: (e) => `unexpected ${re(e.found)}`,
|
|
141
|
+
expected: (e) => `expected ${e.char}, found ${re(e.found)}`,
|
|
142
|
+
commaOutside: () => "comma outside a function call",
|
|
143
|
+
arraySeparator: (e) => `expected , ; or } in an array constant, found ${re(e.found)}`,
|
|
144
|
+
arrayRows: () => "the rows of an array constant must have the same number of values",
|
|
145
|
+
arrayValue: (e) => `an array constant can hold only numbers, text, booleans and errors, found ${re(e.found)}`,
|
|
146
|
+
letTwice: (e) => `LET defines the name ${e.name} twice`,
|
|
147
|
+
letName: (e) => `LET expects a name as argument ${e.position}`,
|
|
148
|
+
letEmpty: () => "LET needs at least a name and its value",
|
|
149
|
+
letTooMany: (e) => `LET takes at most ${e.max} arguments`,
|
|
150
|
+
specUnterminated: () => "unterminated structured reference",
|
|
151
|
+
specBracketInColumn: () => "unexpected [ in a column name (write it as '[)",
|
|
152
|
+
specUnknown: (e) => `unknown table specifier ${e.word}`,
|
|
153
|
+
specSpan: () => "expected [ after : in a structured reference",
|
|
154
|
+
specOpen: () => "expected [ in a structured reference",
|
|
155
|
+
specTwoColumns: () => "two columns in a structured reference (write a span as [A]:[B])",
|
|
156
|
+
specTwice: (e) => `${e.word} twice in a structured reference`,
|
|
157
|
+
specClose: () => "expected ] to close a structured reference",
|
|
158
|
+
specTogether: (e) => `a structured reference cannot combine ${e.words.join(" and ")}`,
|
|
159
|
+
externalLiterals: (e) => `arguments of ${e.fn} must be literals`,
|
|
160
|
+
argumentCount: (e) => `${e.fn} takes ${ie(e.counts)} arguments, got ${e.got}`,
|
|
161
|
+
argumentLeftOut: (e) => `${e.fn} expects a reference as argument ${e.position}, which cannot be omitted`,
|
|
162
|
+
tableRefOutside: () => "a structured reference without a table name outside a table",
|
|
163
|
+
unknownTable: (e) => `unknown table ${e.table}`,
|
|
164
|
+
unknownColumn: (e) => `the table ${e.table} has no column ${e.column}`,
|
|
165
|
+
unknownFunction: (e) => `unknown function ${e.fn}`,
|
|
166
|
+
unknownSheet: (e) => `unknown sheet ${e.sheet}`,
|
|
167
|
+
unknownLink: (e) => `the workbook has no link to ${e.book}`,
|
|
168
|
+
unknownLinkSheet: (e) => `the workbook ${e.book} has no sheet ${e.sheet}`,
|
|
169
|
+
unknownName: (e) => `unknown name ${e.name}`,
|
|
170
|
+
unterminatedSheet: () => "unterminated quoted sheet name",
|
|
171
|
+
unexpectedText: (e) => `unexpected ${JSON.stringify(e.text)}`,
|
|
172
|
+
unexpectedInArray: (e) => `unexpected ${JSON.stringify(e.text)} in an array constant`,
|
|
173
|
+
notWritable: (e) => `${JSON.stringify(e.text)} cannot be written in ${e.tag ?? "the invariant syntax"}`,
|
|
174
|
+
nameRule: (e) => ae[e.rule](e.name),
|
|
175
|
+
sheetNameEmpty: () => "a sheet name must not be empty",
|
|
176
|
+
sheetNameLong: (e) => `a sheet name can have at most 31 characters, and ${JSON.stringify(e.name)} has ${e.length}`,
|
|
177
|
+
sheetNameChar: (e) => `a sheet name must not contain ${JSON.stringify(e.char)} (Excel forbids : \\ / ? * [ ])`,
|
|
178
|
+
sheetNameApostrophe: () => "a sheet name must not begin or end with an apostrophe",
|
|
179
|
+
sheetNameHistory: () => "Excel reserves the sheet name \"History\" (regardless of case)",
|
|
180
|
+
sheetNameTaken: (e) => `a sheet named ${JSON.stringify(e.name)} already exists (sheet names are case-insensitive)`,
|
|
181
|
+
lastSheet: () => "a workbook must contain at least one sheet",
|
|
182
|
+
lastVisibleSheet: (e) => `a workbook must contain at least one visible sheet, and ${JSON.stringify(e.sheet)} is the last one`,
|
|
183
|
+
veryHidden: (e) => `the very hidden sheet ${JSON.stringify(e.sheet)} cannot be deleted or moved: unhide it first`,
|
|
184
|
+
...S,
|
|
185
|
+
insertOffSheet: (e) => `inserting ${e.count} ${e.lines} would push ${e.sheet}!${e.cell} off the sheet`,
|
|
186
|
+
insertMergeOffSheet: (e) => `inserting ${e.count} ${e.lines} would push a merged area of ${e.sheet} off the sheet`,
|
|
187
|
+
arrayPart: (e) => `the operation would change part of the array formula ${e.sheet}!${e.cell} (${e.area})`,
|
|
188
|
+
moveOffSheet: (e) => `the range does not fit on ${e.sheet} at ${e.cell}`,
|
|
189
|
+
copyOffSheet: (e) => `the copy does not fit on ${e.sheet} at ${e.cell}`,
|
|
190
|
+
writesLimit: (e) => `one edit writes ${e.size} cells, over the limit of ${e.max}`,
|
|
191
|
+
moveCutsMerge: (e) => `the moved cells would split the merged area ${e.sheet}!${e.area}`,
|
|
192
|
+
pasteOnMerge: (e) => `the pasted cells would cover part of the merged area ${e.sheet}!${e.area}`,
|
|
193
|
+
filteredPaste: (e) => `the copy skips the rows a filter hid, so it cannot be pasted over the hidden rows of ${e.sheet}!${e.area}`,
|
|
194
|
+
tableLands: (e) => `the table ${e.table} would overlap another table`,
|
|
195
|
+
tableInsertTwo: (e) => `inserting ${e.lines} there would shift cells of the tables ${e.tables.join(" and ")} at once`,
|
|
196
|
+
tableDeleteTwo: (e) => `deleting these ${e.lines} would shift cells of the tables ${e.tables.join(" and ")} at once`,
|
|
197
|
+
tableHeader: (e) => `the header row of the table ${e.table} cannot be deleted without the rest of the table`,
|
|
198
|
+
tableName: (e) => `${JSON.stringify(e.name)}: ${ae[e.rule](e.name)}`,
|
|
199
|
+
tableNameTaken: (e) => `a table named ${e.table} already exists (table names are case-insensitive)`,
|
|
200
|
+
tableNameDefined: (e) => `${JSON.stringify(e.name)} is a defined name (tables and names share one namespace)`,
|
|
201
|
+
tableOverTable: (e) => `${e.range} overlaps the table ${e.table}`,
|
|
202
|
+
tableOverMerge: (e) => `${e.range} overlaps the merged area ${e.area}`,
|
|
203
|
+
mergeInTable: (e) => `${e.range} overlaps the table ${e.table}, whose cells cannot be merged`,
|
|
204
|
+
headerFormula: (e) => `${e.sheet}!${e.cell} is a header cell of the table ${e.table}: it holds its column's name, not a formula`,
|
|
205
|
+
validationError: () => "This value doesn't match the data validation restrictions defined for this cell.",
|
|
206
|
+
explainCells: (e) => `${e.count} cells`,
|
|
207
|
+
explainSpill: (e) => `spilled from ${e.ref}`,
|
|
208
|
+
explainValue: ({ value: e }) => e === void 0 ? "" : e === null ? "empty" : typeof e == "object" ? C[e.error] : JSON.stringify(e),
|
|
209
|
+
explainFormula: (e) => e.formula,
|
|
210
|
+
explainErrorFrom: (e) => `(error from ${e.ref})`,
|
|
211
|
+
explainErrorHere: () => "(the error begins here)",
|
|
212
|
+
explainHeldFrom: (e) => `(held by a circular reference through ${e.ref})`,
|
|
213
|
+
explainHeldHere: () => "(held by a circular reference)"
|
|
214
|
+
}, se = {
|
|
215
|
+
tag: "en-US",
|
|
216
|
+
decimalSeparator: ".",
|
|
217
|
+
listSeparator: ",",
|
|
218
|
+
arrayColumnSeparator: ",",
|
|
219
|
+
arrayRowSeparator: ";",
|
|
220
|
+
booleans: {
|
|
221
|
+
TRUE: "TRUE",
|
|
222
|
+
FALSE: "FALSE"
|
|
223
|
+
},
|
|
224
|
+
errors: {},
|
|
225
|
+
functions: {}
|
|
226
|
+
}, ce = (e) => oe[e.key](e), le = (e) => typeof Intl < "u" ? new Intl.Collator(e, { sensitivity: "accent" }).compare : (e, t) => (e = e.toLowerCase()) < (t = t.toLowerCase()) ? -1 : +(e > t), ue = { compare: /* @__PURE__ */ le("en-US") }, de = /[ıſ]/, E = (e) => de.test(e) ? e.replace(/[^ıſ]+/g, (e) => e.toUpperCase()) : e.toUpperCase();
|
|
227
|
+
function D(e) {
|
|
228
|
+
let t = e.toUpperCase();
|
|
229
|
+
if (t.length === e.length && !de.test(e)) return t;
|
|
230
|
+
let n = "";
|
|
231
|
+
for (let t of e) {
|
|
232
|
+
let e = de.test(t) ? t : t.toUpperCase();
|
|
233
|
+
n += e.length === t.length ? e : t;
|
|
234
|
+
}
|
|
235
|
+
return n;
|
|
236
|
+
}
|
|
237
|
+
//#endregion
|
|
238
|
+
//#region node_modules/xlcalc/dist/strict-args.js
|
|
239
|
+
var fe = "setCellText, setCellTexts, fillCellText and their previews", pe = [
|
|
240
|
+
"maxCells",
|
|
241
|
+
"cursor",
|
|
242
|
+
"count",
|
|
243
|
+
"fields",
|
|
244
|
+
"rows"
|
|
245
|
+
], me = [
|
|
246
|
+
"in",
|
|
247
|
+
"caseSensitive",
|
|
248
|
+
"wildcards",
|
|
249
|
+
"wholeCell",
|
|
250
|
+
"byColumns",
|
|
251
|
+
"skipHidden"
|
|
252
|
+
];
|
|
253
|
+
[...pe, ...me];
|
|
254
|
+
var he = {
|
|
255
|
+
formulaLocal: "getViewport",
|
|
256
|
+
diagnostics: "getViewport",
|
|
257
|
+
maxCells: "getViewport",
|
|
258
|
+
rows: "getViewport, readCells, findCells, replaceInCells and summarizeRanges",
|
|
259
|
+
columns: "getViewport",
|
|
260
|
+
editText: "getViewport",
|
|
261
|
+
appearance: "viewportOf",
|
|
262
|
+
depth: "explain",
|
|
263
|
+
maxNodes: "explain",
|
|
264
|
+
expand: "explain",
|
|
265
|
+
errorDepth: "explain",
|
|
266
|
+
widen: fe,
|
|
267
|
+
refuseInvalid: fe,
|
|
268
|
+
inPlace: fe,
|
|
269
|
+
active: "fillCellText and previewFillCellText",
|
|
270
|
+
caseSensitive: "findCells and replaceInCells",
|
|
271
|
+
wildcards: "findCells and replaceInCells",
|
|
272
|
+
wholeCell: "findCells and replaceInCells",
|
|
273
|
+
byColumns: "findCells",
|
|
274
|
+
skipHidden: "findCells and replaceInCells",
|
|
275
|
+
after: "findCells",
|
|
276
|
+
baseRevision: "a session's calls that change its workbook",
|
|
277
|
+
table: "toLocal and toInvariant",
|
|
278
|
+
clock: "compute and createSession",
|
|
279
|
+
externals: "compute and createSession",
|
|
280
|
+
execution: "compute and createSession",
|
|
281
|
+
display: "compute and createSession",
|
|
282
|
+
cached: "compute and createSession",
|
|
283
|
+
limits: "compute, createSession, the calculators and readXlsx",
|
|
284
|
+
live: "createSession",
|
|
285
|
+
undo: "createSession",
|
|
286
|
+
values: "writeXlsx",
|
|
287
|
+
mode: "writeXlsx"
|
|
288
|
+
};
|
|
289
|
+
function ge(e, t = []) {
|
|
290
|
+
let n = Object.keys(e).flatMap((e) => t.includes(e) || !Object.hasOwn(he, e) ? [] : [`${e} is an option of ${he[e]}`]);
|
|
291
|
+
return n.length ? ` (${n.join("; ")})` : "";
|
|
292
|
+
}
|
|
293
|
+
var _e = (e) => typeof e == "object" && !!e && !Array.isArray(e) || typeof e == "function", ve = (e) => e[Symbol.toStringTag] === "AsyncFunction";
|
|
294
|
+
function ye(e, t = e.name, n = e.length, r = ve(e)) {
|
|
295
|
+
return Object.defineProperties(function(...i) {
|
|
296
|
+
for (let e = n; e < i.length; e++) {
|
|
297
|
+
let a = i[e];
|
|
298
|
+
if (!_e(a)) continue;
|
|
299
|
+
let o = new v(t, `takes ${n} argument${n === 1 ? "" : "s"}, got ${y(a)} as argument ${e + 1}${typeof a == "object" ? ge(a) : ""}`);
|
|
300
|
+
if (r) return Promise.reject(o);
|
|
301
|
+
throw o;
|
|
302
|
+
}
|
|
303
|
+
return e.apply(this, i);
|
|
304
|
+
}, {
|
|
305
|
+
name: { value: t },
|
|
306
|
+
length: { value: n }
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
//#endregion
|
|
310
|
+
//#region node_modules/xlcalc/dist/input/basic.js
|
|
311
|
+
var be = (e) => typeof e == "object" && !!e && !Array.isArray(e);
|
|
312
|
+
function O(e, t, n) {
|
|
313
|
+
if (!be(e)) throw new v(t, `expected ${n}, got ${y(e)}`);
|
|
314
|
+
return e;
|
|
315
|
+
}
|
|
316
|
+
function xe(e, t, n) {
|
|
317
|
+
if (!Array.isArray(e)) throw new v(t, `expected ${n}, got ${y(e)}`);
|
|
318
|
+
return e;
|
|
319
|
+
}
|
|
320
|
+
function k(e, t) {
|
|
321
|
+
if (typeof e != "string") throw new v(t, `expected a string, got ${y(e)}`);
|
|
322
|
+
return e;
|
|
323
|
+
}
|
|
324
|
+
function Se(e, t, n) {
|
|
325
|
+
if (!n.includes(e)) throw new v(t, `expected one of ${n.map((e) => JSON.stringify(e)).join(", ")}, got ${y(e)}`);
|
|
326
|
+
}
|
|
327
|
+
function Ce(e, t, n, r, i = !1) {
|
|
328
|
+
if (typeof e != "number" || !Number.isFinite(e) || e < n || e > r || i && !Number.isInteger(e)) throw new v(t, `expected ${i ? "an integer" : "a number"} from ${n} to ${r}, got ${y(e)}`);
|
|
329
|
+
}
|
|
330
|
+
var we = { format: "numberFormat" };
|
|
331
|
+
function A(e, t, n, r = "") {
|
|
332
|
+
for (let i of Object.keys(e)) if (!n.includes(i)) {
|
|
333
|
+
let e = Object.hasOwn(we, i) && n.includes(we[i]) ? ` (${i} is the old name of ${we[i]})` : "";
|
|
334
|
+
throw new v(t, `unknown field ${JSON.stringify(i)} (expected ${n.join(", ")})${r}${e}`);
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
var Te = (e, t, n, r = "") => A(e, t, n, r + ge(e, n)), Ee = "en-US", De = ["en-US", "ru-RU"], Oe = /* @__PURE__ */ new Map([[Ee, se]]), ke = Oe, j = (e) => typeof e == "object" ? e : Oe.get(e ?? "en-US") ?? se;
|
|
338
|
+
//#endregion
|
|
339
|
+
//#region node_modules/xlcalc/dist/locale/messages.js
|
|
340
|
+
function Ae(e, t) {
|
|
341
|
+
let n = (t) => JSON.stringify(t).replace(".", e.decimalSeparator);
|
|
342
|
+
return {
|
|
343
|
+
loc: e,
|
|
344
|
+
fn: (t) => e.functions[t] ?? t,
|
|
345
|
+
item: (t) => e.tableItems?.[t] ?? t,
|
|
346
|
+
num: n,
|
|
347
|
+
value: (t) => typeof t == "number" ? n(t) : typeof t == "string" ? JSON.stringify(t) : typeof t == "boolean" ? t ? e.booleans.TRUE : e.booleans.FALSE : ne(t.error, e.errors),
|
|
348
|
+
formula: t
|
|
349
|
+
};
|
|
350
|
+
}
|
|
351
|
+
function je(e, t, n = (e) => e) {
|
|
352
|
+
let r = j(e), i = (r.messages ?? ke.get(r.tag)?.messages)?.[t.key];
|
|
353
|
+
return i?.(t, Ae(r, n));
|
|
354
|
+
}
|
|
355
|
+
function Me(e, t, n) {
|
|
356
|
+
return je(e, t, n) ?? ce(t);
|
|
357
|
+
}
|
|
358
|
+
//#endregion
|
|
359
|
+
//#region node_modules/xlcalc/dist/syntax/ast.js
|
|
360
|
+
var M = class extends Error {
|
|
361
|
+
code;
|
|
362
|
+
msg;
|
|
363
|
+
at;
|
|
364
|
+
constructor(e, t, n) {
|
|
365
|
+
super(ce(t)), this.code = e, this.msg = t, this.at = n;
|
|
366
|
+
}
|
|
367
|
+
};
|
|
368
|
+
function N(e, t, n = "syntax") {
|
|
369
|
+
throw new M(n, t, e);
|
|
370
|
+
}
|
|
371
|
+
//#endregion
|
|
372
|
+
//#region node_modules/xlcalc/dist/syntax/table.js
|
|
373
|
+
var P = {
|
|
374
|
+
all: "#All",
|
|
375
|
+
data: "#Data",
|
|
376
|
+
headers: "#Headers",
|
|
377
|
+
totals: "#Totals",
|
|
378
|
+
row: "#This Row"
|
|
379
|
+
}, Ne = Object.values(P), Pe = [
|
|
380
|
+
"all",
|
|
381
|
+
"headers",
|
|
382
|
+
"data",
|
|
383
|
+
"totals",
|
|
384
|
+
"row"
|
|
385
|
+
], Fe = /* @__PURE__ */ new Set([
|
|
386
|
+
"",
|
|
387
|
+
"all",
|
|
388
|
+
"headers",
|
|
389
|
+
"data",
|
|
390
|
+
"totals",
|
|
391
|
+
"row",
|
|
392
|
+
"headers,data",
|
|
393
|
+
"data,totals"
|
|
394
|
+
]);
|
|
395
|
+
function Ie(e) {
|
|
396
|
+
let t = E(e);
|
|
397
|
+
for (let e of Pe) if (E(P[e]) === t) return e;
|
|
398
|
+
}
|
|
399
|
+
var Le = (e, t = !1) => {
|
|
400
|
+
let n = e.replace(/['[\]#]/g, "'$&");
|
|
401
|
+
return t ? n : n.replace(/^@/, "'@");
|
|
402
|
+
};
|
|
403
|
+
function Re(e, { file: t = !1 } = {}) {
|
|
404
|
+
let n = (e) => Le(e, t), r = e.cols ? e.cols.map((e) => `[${n(e)}]`).join(":") : "";
|
|
405
|
+
return e.areas.length ? e.areas.length === 1 && !e.cols ? P[e.areas[0]] : [...e.areas.map((e) => `[${P[e]}]`), ...r ? [r] : []].join(",") : e.cols?.length === 1 ? n(e.cols[0]) : r;
|
|
406
|
+
}
|
|
407
|
+
function ze(e, t, n) {
|
|
408
|
+
let r = t + 1, i = (e) => N(n, e), a = () => {
|
|
409
|
+
for (; e[r] === " ";) r++;
|
|
410
|
+
}, o = () => {
|
|
411
|
+
let t = "";
|
|
412
|
+
for (;;) {
|
|
413
|
+
let n = e[r];
|
|
414
|
+
if (n === void 0 && i({ key: "specUnterminated" }), n === "'") e[r + 1] === void 0 && i({ key: "specUnterminated" }), t += e[r + 1], r += 2;
|
|
415
|
+
else {
|
|
416
|
+
if (n === "]") return t;
|
|
417
|
+
n === "[" && i({ key: "specBracketInColumn" }), t += n, r++;
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
}, s = () => {
|
|
421
|
+
let e = `#${o()}`;
|
|
422
|
+
return Ie(e) ?? i({
|
|
423
|
+
key: "specUnknown",
|
|
424
|
+
word: e
|
|
425
|
+
});
|
|
426
|
+
}, c = () => {
|
|
427
|
+
r++;
|
|
428
|
+
let t = o();
|
|
429
|
+
if (r++, e[r] !== ":") return [t];
|
|
430
|
+
e[r + 1] !== "[" && i({ key: "specSpan" }), r += 2;
|
|
431
|
+
let n = o();
|
|
432
|
+
return r++, [t, n];
|
|
433
|
+
}, l = /* @__PURE__ */ new Set(), u, d = (e) => {
|
|
434
|
+
l.has(e) && i({
|
|
435
|
+
key: "specTwice",
|
|
436
|
+
word: P[e]
|
|
437
|
+
}), l.add(e);
|
|
438
|
+
}, f = r;
|
|
439
|
+
for (; e[f] === " ";) f++;
|
|
440
|
+
if (e[f] === "]") r = f;
|
|
441
|
+
else if (e[f] === "[") {
|
|
442
|
+
for (r = f; e[r] !== "[" && i({ key: "specOpen" }), e[r + 1] === "#" ? (r += 2, d(s()), r++) : (u && i({ key: "specTwoColumns" }), u = c()), a(), e[r] === ",";) r++, a();
|
|
443
|
+
a();
|
|
444
|
+
} else e[r] === "#" ? (r++, d(s())) : e[r] === "@" ? (r++, d("row"), e[r] === "[" ? u = c() : e[r] !== "]" && (u = [o()])) : u = [o()];
|
|
445
|
+
e[r] !== "]" && i({ key: "specClose" });
|
|
446
|
+
let p = Pe.filter((e) => l.has(e));
|
|
447
|
+
return Fe.has(p.join(",")) || i({
|
|
448
|
+
key: "specTogether",
|
|
449
|
+
words: p.map((e) => P[e])
|
|
450
|
+
}), {
|
|
451
|
+
spec: u ? {
|
|
452
|
+
areas: p,
|
|
453
|
+
cols: u
|
|
454
|
+
} : { areas: p },
|
|
455
|
+
end: r + 1
|
|
456
|
+
};
|
|
457
|
+
}
|
|
458
|
+
//#endregion
|
|
459
|
+
//#region node_modules/xlcalc/dist/locale/load.js
|
|
460
|
+
var Be = /^[\p{L}_][\p{L}\p{N}_.]*$/u, Ve = /[\p{L}\p{N}\s"'#(){}[\]!$+\-*/^&=<>%_@?]/u;
|
|
461
|
+
function He(e, t, n, r) {
|
|
462
|
+
let i = k(e[n], `${t}.${n}`);
|
|
463
|
+
if (i.length !== 1 || Ve.test(i) || !r && (i === ":" || i === "\\")) throw new v(`${t}.${n}`, `expected one character that has no other meaning in a formula, got ${JSON.stringify(i)}`);
|
|
464
|
+
return i;
|
|
465
|
+
}
|
|
466
|
+
function Ue(e, t, n, r, i) {
|
|
467
|
+
if (!be(e)) throw new v(t, "expected an object");
|
|
468
|
+
let a = /* @__PURE__ */ new Map();
|
|
469
|
+
for (let [o, s] of Object.entries(e)) {
|
|
470
|
+
if (n && !n.includes(o)) throw new v(t, `unknown key ${JSON.stringify(o)} (expected ${n.join(", ")})`);
|
|
471
|
+
if (typeof s != "string" || !r.test(s)) throw new v(`${t}[${JSON.stringify(o)}]`, `expected ${i}, got ${JSON.stringify(s)}`);
|
|
472
|
+
let e = a.get(D(s));
|
|
473
|
+
if (e !== void 0) throw new v(`${t}[${JSON.stringify(o)}]`, `${JSON.stringify(s)} is also the word for ${e}`);
|
|
474
|
+
a.set(D(s), o);
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
function We(e, t) {
|
|
478
|
+
let n = O(e, t, "a locale's tag or a locale object such as ruRU");
|
|
479
|
+
k(n.tag, `${t}.tag`);
|
|
480
|
+
let r = He(n, t, "decimalSeparator", !1), i = He(n, t, "listSeparator", !1), a = He(n, t, "arrayColumnSeparator", !0), o = He(n, t, "arrayRowSeparator", !0);
|
|
481
|
+
if (r === i || r === a || r === o || a === o) throw new v(t, "the decimal separator, the list separator and the array separators must differ (the list separator may equal an array separator)");
|
|
482
|
+
if (Ue(n.booleans, `${t}.booleans`, ["TRUE", "FALSE"], Be, "a word"), Object.keys(n.booleans).length !== 2) throw new v(`${t}.booleans`, "expected both TRUE and FALSE");
|
|
483
|
+
Ue(n.errors, `${t}.errors`, T, /^#\S+$/u, "an error literal starting with #"), Ue(n.functions, `${t}.functions`, null, Be, "a function name"), n.tableItems !== void 0 && Ue(n.tableItems, `${t}.tableItems`, Ne, /^#[^[\]'@]+$/u, "a specifier starting with #"), n.argumentWords !== void 0 && Ge(n.argumentWords, `${t}.argumentWords`), n.functionText !== void 0 && Ke(n.functionText, `${t}.functionText`);
|
|
484
|
+
}
|
|
485
|
+
function Ge(e, t) {
|
|
486
|
+
if (!be(e)) throw new v(t, "expected an object");
|
|
487
|
+
for (let [n, r] of Object.entries(e)) if (typeof r != "string" || !/^[\p{L}_][\p{L}\p{N}_]*$/u.test(r)) throw new v(`${t}[${JSON.stringify(n)}]`, `expected a word of an argument's name, got ${JSON.stringify(r)}`);
|
|
488
|
+
}
|
|
489
|
+
function Ke(e, t) {
|
|
490
|
+
let n = O(e, t, "an object such as { categories, descriptions }");
|
|
491
|
+
for (let e of ["categories", "descriptions"]) {
|
|
492
|
+
let r = O(n[e], `${t}.${e}`, "an object of texts");
|
|
493
|
+
for (let [n, i] of Object.entries(r)) if (typeof i != "string" || !i) throw new v(`${t}.${e}[${JSON.stringify(n)}]`, `expected text, got ${JSON.stringify(i)}`);
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
var qe = /* @__PURE__ */ new WeakSet();
|
|
497
|
+
function Je(e, t) {
|
|
498
|
+
return (typeof e != "object" || !e || !qe.has(e)) && (We(e, t), qe.add(e)), e;
|
|
499
|
+
}
|
|
500
|
+
var Ye = (e) => e.replace("-", ""), Xe = (e) => `pass the locale as an object: ${Ye(e)} from the package's module locales/${e}`;
|
|
501
|
+
function Ze(e, t, n) {
|
|
502
|
+
let r = k(e, t);
|
|
503
|
+
if (ke.has(r)) return r;
|
|
504
|
+
let i = `loaded: ${[...ke.keys()].join(", ")}`;
|
|
505
|
+
if (De.includes(r)) throw new v(t, `the locale ${r} is not loaded: ${n(r)} (${i})`);
|
|
506
|
+
let a = De.find((e) => e.toLowerCase() === r.toLowerCase());
|
|
507
|
+
throw new v(t, `unknown locale ${JSON.stringify(r)} (${i}${a ? `; tags are case-sensitive: ${a}` : `; the package's: ${De.join(", ")}`})`);
|
|
508
|
+
}
|
|
509
|
+
function Qe(e, t) {
|
|
510
|
+
return typeof e == "string" ? ke.get(Ze(e, t, Xe)) : Je(e, t);
|
|
511
|
+
}
|
|
512
|
+
//#endregion
|
|
513
|
+
//#region node_modules/xlcalc/dist/contract.js
|
|
514
|
+
var $e = 8192, F = "[\\p{L}_][\\p{L}\\p{N}_.]*", et = (e) => e === " " || e === " " || e === "\n" || e === "\r";
|
|
515
|
+
function tt(e, t, n, r) {
|
|
516
|
+
let i = null, a = 0;
|
|
517
|
+
for (let o = t; o < n; o++) {
|
|
518
|
+
let t = e[o];
|
|
519
|
+
if (i) t === i && (i = null);
|
|
520
|
+
else if (t === "\"" || t === "'") i = t;
|
|
521
|
+
else if (t === "[") a++;
|
|
522
|
+
else if (t === "]") a = Math.max(0, a - 1);
|
|
523
|
+
else if (!a && r(t, o)) break;
|
|
524
|
+
}
|
|
525
|
+
return {
|
|
526
|
+
quote: i,
|
|
527
|
+
table: a
|
|
528
|
+
};
|
|
529
|
+
}
|
|
530
|
+
var nt = /[\p{L}\p{N}._]/u;
|
|
531
|
+
function rt(e, t, n = ",") {
|
|
532
|
+
let r = [], i = [], a = !1, { quote: o, table: s } = tt(e, 1, t, (t, o) => {
|
|
533
|
+
if (t === "{") r.push({ kind: "array" });
|
|
534
|
+
else if (t === "}") r.at(-1)?.kind === "array" && r.pop();
|
|
535
|
+
else if (t === "(") {
|
|
536
|
+
let t = o;
|
|
537
|
+
for (; t > 1 && nt.test(e[t - 1]);) t--;
|
|
538
|
+
t < o && i.push(e.slice(t, o)), r.push(t < o ? {
|
|
539
|
+
kind: "call",
|
|
540
|
+
name: e.slice(t, o),
|
|
541
|
+
index: 0,
|
|
542
|
+
open: o
|
|
543
|
+
} : { kind: "group" });
|
|
544
|
+
} else if (t === ")") a = !0, r.at(-1)?.kind !== "array" && r.pop();
|
|
545
|
+
else if (t === n) {
|
|
546
|
+
let e = r.at(-1);
|
|
547
|
+
e?.kind === "call" && e.index++;
|
|
548
|
+
}
|
|
549
|
+
});
|
|
550
|
+
return {
|
|
551
|
+
open: r,
|
|
552
|
+
quote: o,
|
|
553
|
+
table: s,
|
|
554
|
+
shut: a,
|
|
555
|
+
calls: i
|
|
556
|
+
};
|
|
557
|
+
}
|
|
558
|
+
function it(e, t) {
|
|
559
|
+
let n = e[t];
|
|
560
|
+
for (let r = t + 1; r < e.length; r++) if (e[r] === n) {
|
|
561
|
+
if (e[r + 1] === n) r++;
|
|
562
|
+
else return r;
|
|
563
|
+
}
|
|
564
|
+
return -1;
|
|
565
|
+
}
|
|
566
|
+
function at(e, t) {
|
|
567
|
+
let n = 0;
|
|
568
|
+
for (let r = t; r < e.length; r++) if (e[r] === "'") r++;
|
|
569
|
+
else if (e[r] === "[") n++;
|
|
570
|
+
else if (e[r] === "]" && --n === 0) return r + 1;
|
|
571
|
+
return e.length;
|
|
572
|
+
}
|
|
573
|
+
var ot = /^(?:[\p{L}\p{N}_.:]+|'(?:[^']|'')+')?!/u;
|
|
574
|
+
function st(e, t) {
|
|
575
|
+
for (; e[t] === " ";) t++;
|
|
576
|
+
return e[t] === "(";
|
|
577
|
+
}
|
|
578
|
+
var ct = (e) => `(?:[0-9]+(?:${e}[0-9]*)?|${e}[0-9]+)(?:[eE][+-]?[0-9]+)?`, lt = "[\\p{L}_\\\\]", ut = "[\\p{L}\\p{N}_.\\\\?]", dt = `${lt}${ut}*`, ft = /[\p{L}\p{N}_.(\\?]/u;
|
|
579
|
+
new RegExp(ut, "u");
|
|
580
|
+
//#endregion
|
|
581
|
+
//#region node_modules/xlcalc/dist/syntax/tokens.js
|
|
582
|
+
var pt = RegExp(`^${dt}`, "u"), mt = /^'((?:[^']|'')+)'!/, ht = RegExp(`^(${F})!`, "u"), gt = RegExp(`^(${F}):(?:(${F})|'((?:[^']|'')+)')!`, "u"), _t = /^([A-Za-z]{1,3})([0-9]+)$/, vt = /^(\$?)([A-Za-z]{1,3})(\$?)([0-9]+)(?::(\$?)([A-Za-z]{1,3})(\$?)([0-9]+))?/, yt = /^(\$?)([A-Za-z]{1,3}):(\$?)([A-Za-z]{1,3})/, bt = /^(\$?)([0-9]+):(\$?)([0-9]+)/, xt = RegExp(`^${ct("\\.")}`);
|
|
583
|
+
function St(e, t) {
|
|
584
|
+
let n = Number(e);
|
|
585
|
+
return (n < 1 || n > 1048576) && N(t, {
|
|
586
|
+
key: "rowOutOfRange",
|
|
587
|
+
row: e
|
|
588
|
+
}), n - 1;
|
|
589
|
+
}
|
|
590
|
+
function Ct(e, t) {
|
|
591
|
+
let n = u(e);
|
|
592
|
+
return n >= 16384 && N(t, {
|
|
593
|
+
key: "columnOutOfRange",
|
|
594
|
+
column: e
|
|
595
|
+
}), n;
|
|
596
|
+
}
|
|
597
|
+
function wt(e, t) {
|
|
598
|
+
let n = (t) => e[t] ?? "", r = vt.exec(e);
|
|
599
|
+
if (r && r[6] !== void 0 && (n(r[0].length) === "!" || n(r[0].length) === "#") && (r = vt.exec(e.slice(0, e.indexOf(":")))), r && !ft.test(n(r[0].length)) && (r[6] !== void 0 || r[1] || r[3] || Dt(r[2], r[4]))) {
|
|
600
|
+
let e = St(r[4], t), n = Ct(r[2], t), i = r[6] !== void 0, a = i ? St(r[8], t) : e, o = i ? Ct(r[6], t) : n;
|
|
601
|
+
return {
|
|
602
|
+
ref: {
|
|
603
|
+
r1: Math.min(e, a),
|
|
604
|
+
c1: Math.min(n, o),
|
|
605
|
+
r2: Math.max(e, a),
|
|
606
|
+
c2: Math.max(n, o),
|
|
607
|
+
kind: i ? "range" : "cell",
|
|
608
|
+
text: r[0].toUpperCase()
|
|
609
|
+
},
|
|
610
|
+
len: r[0].length
|
|
611
|
+
};
|
|
612
|
+
}
|
|
613
|
+
if (r = yt.exec(e), r && !ft.test(n(r[0].length))) {
|
|
614
|
+
let e = Ct(r[2], t), n = Ct(r[4], t);
|
|
615
|
+
return {
|
|
616
|
+
ref: {
|
|
617
|
+
r1: 0,
|
|
618
|
+
r2: c - 1,
|
|
619
|
+
c1: Math.min(e, n),
|
|
620
|
+
c2: Math.max(e, n),
|
|
621
|
+
kind: "cols",
|
|
622
|
+
text: r[0].toUpperCase()
|
|
623
|
+
},
|
|
624
|
+
len: r[0].length
|
|
625
|
+
};
|
|
626
|
+
}
|
|
627
|
+
if (r = bt.exec(e), r && !ft.test(n(r[0].length))) {
|
|
628
|
+
let e = St(r[2], t), n = St(r[4], t);
|
|
629
|
+
return {
|
|
630
|
+
ref: {
|
|
631
|
+
c1: 0,
|
|
632
|
+
c2: l - 1,
|
|
633
|
+
r1: Math.min(e, n),
|
|
634
|
+
r2: Math.max(e, n),
|
|
635
|
+
kind: "rows",
|
|
636
|
+
text: r[0]
|
|
637
|
+
},
|
|
638
|
+
len: r[0].length
|
|
639
|
+
};
|
|
640
|
+
}
|
|
641
|
+
return null;
|
|
642
|
+
}
|
|
643
|
+
function Tt(e, t, n) {
|
|
644
|
+
return t === "#" ? (e.ref.kind !== "cell" && N(n, { key: "spillAfterRange" }), e.ref.spill = !0, e.len + 1) : e.len;
|
|
645
|
+
}
|
|
646
|
+
var Et = [
|
|
647
|
+
"<>",
|
|
648
|
+
"<=",
|
|
649
|
+
">=",
|
|
650
|
+
"+",
|
|
651
|
+
"-",
|
|
652
|
+
"*",
|
|
653
|
+
"/",
|
|
654
|
+
"^",
|
|
655
|
+
"&",
|
|
656
|
+
"=",
|
|
657
|
+
"<",
|
|
658
|
+
">",
|
|
659
|
+
"%",
|
|
660
|
+
"@",
|
|
661
|
+
":"
|
|
662
|
+
], Dt = (e, t) => u(e) < 16384 && Number(t) >= 1 && Number(t) <= 1048576;
|
|
663
|
+
function Ot(e) {
|
|
664
|
+
let t = _t.exec(e);
|
|
665
|
+
return !!t && Dt(t[1], t[2]);
|
|
666
|
+
}
|
|
667
|
+
var kt = /* @__PURE__ */ new Set([
|
|
668
|
+
"ref",
|
|
669
|
+
"xref",
|
|
670
|
+
"ident",
|
|
671
|
+
"xname",
|
|
672
|
+
"table",
|
|
673
|
+
")"
|
|
674
|
+
]), At = /* @__PURE__ */ new Set([
|
|
675
|
+
"ref",
|
|
676
|
+
"xref",
|
|
677
|
+
"ident",
|
|
678
|
+
"xname",
|
|
679
|
+
"table",
|
|
680
|
+
"fn",
|
|
681
|
+
"("
|
|
682
|
+
]), jt = (e, t) => e === "" && /^[1-9][0-9]*$/.test(t) ? Number(t) : e + t, Mt = /^([^[\]]*)\[([^[\]]+)\]([^[\]]*)$/;
|
|
683
|
+
function Nt(e) {
|
|
684
|
+
let t = [], n = -1, r = (e) => {
|
|
685
|
+
let r = t.at(-1);
|
|
686
|
+
n >= 0 && r && kt.has(r.t) && At.has(e.t) && t.push({
|
|
687
|
+
t: "op",
|
|
688
|
+
v: " ",
|
|
689
|
+
at: n
|
|
690
|
+
}), n = -1, t.push(e);
|
|
691
|
+
}, i = (t, n, i, a) => {
|
|
692
|
+
n.includes(":") && N(i, { key: "externalAcrossSheets" }, "external_ref");
|
|
693
|
+
let o = e.slice(a);
|
|
694
|
+
if (n !== "" && o.slice(0, 5).toUpperCase() === "#REF!") return r({
|
|
695
|
+
t: "err",
|
|
696
|
+
code: "REF",
|
|
697
|
+
sheet: n,
|
|
698
|
+
book: t,
|
|
699
|
+
at: i
|
|
700
|
+
}), a + 5;
|
|
701
|
+
let s = n === "" ? null : wt(o, i);
|
|
702
|
+
if (s) return o[s.len] === "#" && N(i, { key: "externalSpill" }, "external_ref"), r({
|
|
703
|
+
t: "xref",
|
|
704
|
+
book: t,
|
|
705
|
+
sheet: n,
|
|
706
|
+
ref: s.ref,
|
|
707
|
+
at: i
|
|
708
|
+
}), a + s.len;
|
|
709
|
+
let c = pt.exec(o);
|
|
710
|
+
return (!c || o[c[0].length] === "(" || o[c[0].length] === "[") && N(a, { key: "referenceAfterSheet" }), r({
|
|
711
|
+
t: "xname",
|
|
712
|
+
book: t,
|
|
713
|
+
...n === "" ? {} : { sheet: n },
|
|
714
|
+
v: c[0],
|
|
715
|
+
at: i
|
|
716
|
+
}), a + c[0].length;
|
|
717
|
+
}, a = 0;
|
|
718
|
+
for (; a < e.length;) {
|
|
719
|
+
let t = e[a];
|
|
720
|
+
if (et(t)) {
|
|
721
|
+
n < 0 && (n = a), a++;
|
|
722
|
+
continue;
|
|
723
|
+
}
|
|
724
|
+
let o = e.slice(a);
|
|
725
|
+
if (t === "\"") {
|
|
726
|
+
let t = it(e, a);
|
|
727
|
+
t < 0 && N(a, { key: "unterminatedString" }), r({
|
|
728
|
+
t: "str",
|
|
729
|
+
v: e.slice(a + 1, t).replaceAll("\"\"", "\""),
|
|
730
|
+
at: a
|
|
731
|
+
}), a = t + 1;
|
|
732
|
+
continue;
|
|
733
|
+
}
|
|
734
|
+
if (t === "#") {
|
|
735
|
+
let t = te.find((e) => o.toUpperCase().startsWith(e));
|
|
736
|
+
t || N(a, { key: "unknownErrorLiteral" });
|
|
737
|
+
let n = t === "#REF!" ? wt(e.slice(a + 5), a)?.ref.text ?? (o.slice(5).toUpperCase().startsWith("#REF!") ? "#REF!" : "") : "";
|
|
738
|
+
t === "#REF!" && e[a + 5 + n.length] === "#" && (n += "#"), r({
|
|
739
|
+
t: "err",
|
|
740
|
+
code: w[t],
|
|
741
|
+
at: a,
|
|
742
|
+
...n ? { ref: n } : {}
|
|
743
|
+
}), a += t.length + n.length;
|
|
744
|
+
continue;
|
|
745
|
+
}
|
|
746
|
+
if (t === "[") {
|
|
747
|
+
let t = at(e, a), n = ot.exec(e.slice(t));
|
|
748
|
+
if (n) {
|
|
749
|
+
let r = n[0].slice(0, -1);
|
|
750
|
+
a = i(jt("", e.slice(a + 1, t - 1)), r.startsWith("'") ? r.slice(1, -1).replaceAll("''", "'") : r, a, t + n[0].length);
|
|
751
|
+
continue;
|
|
752
|
+
}
|
|
753
|
+
let { spec: o, end: s } = ze(e, a, a);
|
|
754
|
+
r({
|
|
755
|
+
t: "table",
|
|
756
|
+
table: null,
|
|
757
|
+
spec: o,
|
|
758
|
+
at: a
|
|
759
|
+
}), a = s;
|
|
760
|
+
continue;
|
|
761
|
+
}
|
|
762
|
+
if (t === "(" || t === ")" || t === "," || t === "{" || t === "}" || t === ";") {
|
|
763
|
+
r({
|
|
764
|
+
t,
|
|
765
|
+
at: a
|
|
766
|
+
}), a++;
|
|
767
|
+
continue;
|
|
768
|
+
}
|
|
769
|
+
let s = null, c, l = mt.exec(o), u = l && Mt.exec(l[1].replaceAll("''", "'"));
|
|
770
|
+
if (l && u) {
|
|
771
|
+
a = i(jt(u[1], u[2]), u[3], a, a + l[0].length);
|
|
772
|
+
continue;
|
|
773
|
+
}
|
|
774
|
+
if (l) {
|
|
775
|
+
s = l[1].replaceAll("''", "'");
|
|
776
|
+
let e = /[\\/]/.test(s) ? -1 : s.indexOf(":");
|
|
777
|
+
e >= 0 && ([s, c] = [s.slice(0, e), s.slice(e + 1)]);
|
|
778
|
+
} else o.includes("!") && (l = gt.exec(o)) && !Ot(l[1]) ? [s, c] = [l[1], l[2] ?? l[3].replaceAll("''", "'")] : (l = ht.exec(o)) && (s = l[1]);
|
|
779
|
+
if (l && c === void 0 && e.slice(a + l[0].length, a + l[0].length + 5).toUpperCase() === "#REF!") {
|
|
780
|
+
let t = e[a + l[0].length + 5] === "#";
|
|
781
|
+
r({
|
|
782
|
+
t: "err",
|
|
783
|
+
code: "REF",
|
|
784
|
+
sheet: s,
|
|
785
|
+
at: a,
|
|
786
|
+
...t ? { ref: "#" } : {}
|
|
787
|
+
}), a += l[0].length + 5 + +!!t;
|
|
788
|
+
continue;
|
|
789
|
+
}
|
|
790
|
+
if (l) {
|
|
791
|
+
let t = e.slice(a + l[0].length), n = wt(t, a);
|
|
792
|
+
if (n) {
|
|
793
|
+
r({
|
|
794
|
+
t: "ref",
|
|
795
|
+
sheet: s,
|
|
796
|
+
...c === void 0 ? {} : { last: c },
|
|
797
|
+
ref: n.ref,
|
|
798
|
+
at: a
|
|
799
|
+
}), c !== void 0 && t[n.len] === "#" && N(a, { key: "spillAcrossSheets" }), a += l[0].length + Tt(n, t[n.len], a);
|
|
800
|
+
continue;
|
|
801
|
+
}
|
|
802
|
+
let i = c === void 0 ? pt.exec(t) : null;
|
|
803
|
+
if ((!i || t[i[0].length] === "(") && N(a + l[0].length, { key: "referenceAfterSheet" }), t[i[0].length] === "[") {
|
|
804
|
+
let { spec: t, end: n } = ze(e, a + l[0].length + i[0].length, a);
|
|
805
|
+
r({
|
|
806
|
+
t: "table",
|
|
807
|
+
table: i[0],
|
|
808
|
+
spec: t,
|
|
809
|
+
at: a
|
|
810
|
+
}), a = n;
|
|
811
|
+
continue;
|
|
812
|
+
}
|
|
813
|
+
r({
|
|
814
|
+
t: "ident",
|
|
815
|
+
v: i[0],
|
|
816
|
+
at: a,
|
|
817
|
+
sheet: s
|
|
818
|
+
}), a += l[0].length + i[0].length;
|
|
819
|
+
continue;
|
|
820
|
+
}
|
|
821
|
+
if (t === "'" && N(a, { key: "quotedSheetAlone" }), /[0-9$A-Za-z]/.test(t)) {
|
|
822
|
+
let t = wt(o, a);
|
|
823
|
+
if (t) {
|
|
824
|
+
r({
|
|
825
|
+
t: "ref",
|
|
826
|
+
sheet: null,
|
|
827
|
+
ref: t.ref,
|
|
828
|
+
at: a
|
|
829
|
+
}), a += Tt(t, e[a + t.len], a);
|
|
830
|
+
continue;
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
let d = xt.exec(o);
|
|
834
|
+
if (d) {
|
|
835
|
+
r({
|
|
836
|
+
t: "num",
|
|
837
|
+
v: f(d[0]),
|
|
838
|
+
at: a
|
|
839
|
+
}), a += d[0].length;
|
|
840
|
+
continue;
|
|
841
|
+
}
|
|
842
|
+
let p = pt.exec(o);
|
|
843
|
+
if (p) {
|
|
844
|
+
if (st(e, a + p[0].length)) r({
|
|
845
|
+
t: "fn",
|
|
846
|
+
v: D(p[0]),
|
|
847
|
+
at: a
|
|
848
|
+
});
|
|
849
|
+
else if (e[a + p[0].length] === "[") {
|
|
850
|
+
let { spec: t, end: n } = ze(e, a + p[0].length, a);
|
|
851
|
+
r({
|
|
852
|
+
t: "table",
|
|
853
|
+
table: p[0],
|
|
854
|
+
spec: t,
|
|
855
|
+
at: a
|
|
856
|
+
}), a = n;
|
|
857
|
+
continue;
|
|
858
|
+
} else r({
|
|
859
|
+
t: "ident",
|
|
860
|
+
v: p[0],
|
|
861
|
+
at: a
|
|
862
|
+
});
|
|
863
|
+
a += p[0].length;
|
|
864
|
+
continue;
|
|
865
|
+
}
|
|
866
|
+
let m = Et.find((e) => o.startsWith(e));
|
|
867
|
+
m ? (r({
|
|
868
|
+
t: "op",
|
|
869
|
+
v: m,
|
|
870
|
+
at: a
|
|
871
|
+
}), a += m.length) : N(a, {
|
|
872
|
+
key: "unexpectedCharacter",
|
|
873
|
+
char: t
|
|
874
|
+
});
|
|
875
|
+
}
|
|
876
|
+
return t.push({
|
|
877
|
+
t: "eof",
|
|
878
|
+
at: e.length
|
|
879
|
+
}), t;
|
|
880
|
+
}
|
|
881
|
+
//#endregion
|
|
882
|
+
//#region node_modules/xlcalc/dist/syntax/parse.js
|
|
883
|
+
var Pt = [
|
|
884
|
+
[
|
|
885
|
+
"=",
|
|
886
|
+
"<>",
|
|
887
|
+
"<",
|
|
888
|
+
">",
|
|
889
|
+
"<=",
|
|
890
|
+
">="
|
|
891
|
+
],
|
|
892
|
+
["&"],
|
|
893
|
+
["+", "-"],
|
|
894
|
+
["*", "/"],
|
|
895
|
+
["^"]
|
|
896
|
+
], Ft = [" ", ":"], It = 254, Lt = (e) => Rt(e) !== void 0 || Ot(e) && /^(R|C|RC)[0-9]+$/i.test(e);
|
|
897
|
+
function Rt(e) {
|
|
898
|
+
let t = D(e);
|
|
899
|
+
return t === "TRUE" || t !== "FALSE" && void 0;
|
|
900
|
+
}
|
|
901
|
+
function zt(e, t, n = {}) {
|
|
902
|
+
e.trim() === "" && N(0, { key: "emptyFormula" }, "empty"), e.length > 8192 && N($e, {
|
|
903
|
+
key: "tooLong",
|
|
904
|
+
max: $e
|
|
905
|
+
}, "too_long");
|
|
906
|
+
let r = t ?? Nt(e), i = 0, a = 0, o = () => r[i], s = (e) => {
|
|
907
|
+
++a > 64 && N(e, {
|
|
908
|
+
key: "tooDeep",
|
|
909
|
+
max: 64
|
|
910
|
+
}, "too_deep");
|
|
911
|
+
}, c = (e) => {
|
|
912
|
+
if (e === Pt.length) return l();
|
|
913
|
+
let t = c(e + 1);
|
|
914
|
+
for (;;) {
|
|
915
|
+
let n = o();
|
|
916
|
+
if (n.t !== "op" || !Pt[e].includes(n.v)) return t;
|
|
917
|
+
i++;
|
|
918
|
+
let r = c(e + 1);
|
|
919
|
+
t = {
|
|
920
|
+
k: "bin",
|
|
921
|
+
op: n.v,
|
|
922
|
+
a: t,
|
|
923
|
+
b: r
|
|
924
|
+
};
|
|
925
|
+
}
|
|
926
|
+
}, l = () => {
|
|
927
|
+
let e = o();
|
|
928
|
+
if (e.t === "op" && (e.v === "-" || e.v === "+")) {
|
|
929
|
+
i++, s(e.at);
|
|
930
|
+
let t = l();
|
|
931
|
+
return a--, {
|
|
932
|
+
k: "un",
|
|
933
|
+
op: e.v,
|
|
934
|
+
a: t
|
|
935
|
+
};
|
|
936
|
+
}
|
|
937
|
+
return u();
|
|
938
|
+
}, u = () => {
|
|
939
|
+
let e = d();
|
|
940
|
+
for (; o().t === "op" && o().v === "%";) i++, e = {
|
|
941
|
+
k: "pct",
|
|
942
|
+
a: e
|
|
943
|
+
};
|
|
944
|
+
return e;
|
|
945
|
+
}, d = () => {
|
|
946
|
+
let e = o();
|
|
947
|
+
if (e.t !== "op" || e.v !== "@") return f(0);
|
|
948
|
+
i++, s(e.at);
|
|
949
|
+
let t = d();
|
|
950
|
+
return a--, {
|
|
951
|
+
k: "at",
|
|
952
|
+
a: t
|
|
953
|
+
};
|
|
954
|
+
}, f = (e) => {
|
|
955
|
+
if (e === Ft.length) return m();
|
|
956
|
+
let t = f(e + 1);
|
|
957
|
+
for (;;) {
|
|
958
|
+
let n = o();
|
|
959
|
+
if (n.t !== "op" || n.v !== Ft[e]) return t;
|
|
960
|
+
i++, t = {
|
|
961
|
+
k: "bin",
|
|
962
|
+
op: n.v,
|
|
963
|
+
a: t,
|
|
964
|
+
b: f(e + 1)
|
|
965
|
+
};
|
|
966
|
+
}
|
|
967
|
+
}, p = (e) => {
|
|
968
|
+
if (o().t !== ",") return e;
|
|
969
|
+
let t = [e];
|
|
970
|
+
for (; o().t === ",";) i++, t.push(c(0));
|
|
971
|
+
return {
|
|
972
|
+
k: "union",
|
|
973
|
+
items: t
|
|
974
|
+
};
|
|
975
|
+
}, m = () => {
|
|
976
|
+
let e = r[i++];
|
|
977
|
+
switch (e.t) {
|
|
978
|
+
case "num": return {
|
|
979
|
+
k: "num",
|
|
980
|
+
v: e.v
|
|
981
|
+
};
|
|
982
|
+
case "str": return {
|
|
983
|
+
k: "str",
|
|
984
|
+
v: e.v
|
|
985
|
+
};
|
|
986
|
+
case "err": return {
|
|
987
|
+
k: "err",
|
|
988
|
+
code: e.code,
|
|
989
|
+
...e.sheet === void 0 ? {} : { sheet: e.sheet },
|
|
990
|
+
...e.ref === void 0 ? {} : { ref: e.ref },
|
|
991
|
+
...e.book === void 0 ? {} : { book: e.book }
|
|
992
|
+
};
|
|
993
|
+
case "ref": {
|
|
994
|
+
let t = _(e), n = t === void 0 ? void 0 : g.get(D(t));
|
|
995
|
+
return n ? {
|
|
996
|
+
k: "local",
|
|
997
|
+
name: n.name,
|
|
998
|
+
slot: n.slot
|
|
999
|
+
} : e.last === void 0 ? {
|
|
1000
|
+
k: "ref",
|
|
1001
|
+
sheet: e.sheet,
|
|
1002
|
+
ref: e.ref
|
|
1003
|
+
} : {
|
|
1004
|
+
k: "ref3d",
|
|
1005
|
+
first: e.sheet,
|
|
1006
|
+
last: e.last,
|
|
1007
|
+
ref: e.ref
|
|
1008
|
+
};
|
|
1009
|
+
}
|
|
1010
|
+
case "table": return {
|
|
1011
|
+
k: "table",
|
|
1012
|
+
table: e.table,
|
|
1013
|
+
spec: e.spec
|
|
1014
|
+
};
|
|
1015
|
+
case "xref": return {
|
|
1016
|
+
k: "xref",
|
|
1017
|
+
book: e.book,
|
|
1018
|
+
sheet: e.sheet,
|
|
1019
|
+
ref: e.ref
|
|
1020
|
+
};
|
|
1021
|
+
case "xname": return {
|
|
1022
|
+
k: "xname",
|
|
1023
|
+
book: e.book,
|
|
1024
|
+
name: e.v,
|
|
1025
|
+
...e.sheet === void 0 ? {} : { sheet: e.sheet }
|
|
1026
|
+
};
|
|
1027
|
+
case "ident": {
|
|
1028
|
+
if (e.sheet !== void 0) return {
|
|
1029
|
+
k: "name",
|
|
1030
|
+
name: e.v,
|
|
1031
|
+
sheet: e.sheet
|
|
1032
|
+
};
|
|
1033
|
+
let t = Rt(e.v);
|
|
1034
|
+
if (t !== void 0) return {
|
|
1035
|
+
k: "bool",
|
|
1036
|
+
v: t
|
|
1037
|
+
};
|
|
1038
|
+
let n = g.get(D(e.v));
|
|
1039
|
+
return n ? {
|
|
1040
|
+
k: "local",
|
|
1041
|
+
name: n.name,
|
|
1042
|
+
slot: n.slot
|
|
1043
|
+
} : {
|
|
1044
|
+
k: "name",
|
|
1045
|
+
name: e.v
|
|
1046
|
+
};
|
|
1047
|
+
}
|
|
1048
|
+
case "(": {
|
|
1049
|
+
s(e.at);
|
|
1050
|
+
let t = p(c(0));
|
|
1051
|
+
return a--, S(")"), {
|
|
1052
|
+
k: "paren",
|
|
1053
|
+
a: t
|
|
1054
|
+
};
|
|
1055
|
+
}
|
|
1056
|
+
case "{": return b(e.at);
|
|
1057
|
+
case "fn": {
|
|
1058
|
+
if (S("("), s(e.at), e.v === "LET") {
|
|
1059
|
+
let t = y(e.at);
|
|
1060
|
+
return a--, S(")"), t;
|
|
1061
|
+
}
|
|
1062
|
+
let t = [];
|
|
1063
|
+
if (o().t !== ")") for (; t.push(h()), o().t === ",";) i++;
|
|
1064
|
+
return a--, S(")"), {
|
|
1065
|
+
k: "fn",
|
|
1066
|
+
name: e.v,
|
|
1067
|
+
args: t
|
|
1068
|
+
};
|
|
1069
|
+
}
|
|
1070
|
+
default: return N(e.at, e.t === "eof" ? { key: "unexpectedEnd" } : {
|
|
1071
|
+
key: "unexpected",
|
|
1072
|
+
found: I(e)
|
|
1073
|
+
});
|
|
1074
|
+
}
|
|
1075
|
+
}, h = () => o().t === "," || o().t === ")" ? { k: "missing" } : c(0), g = /* @__PURE__ */ new Map(), _ = (t) => {
|
|
1076
|
+
if (t.t !== "ref" || t.sheet !== null || t.ref.kind !== "cell" || t.ref.spill) return;
|
|
1077
|
+
let n = e.slice(t.at, t.at + t.ref.text.length);
|
|
1078
|
+
return Ot(n) && !Lt(n) ? n : void 0;
|
|
1079
|
+
}, v = 0, y = (e) => {
|
|
1080
|
+
let t = [], n = [], a;
|
|
1081
|
+
for (;;) {
|
|
1082
|
+
let e = o(), s = e.t === "ident" && Rt(e.v) === void 0 ? e.v : _(e);
|
|
1083
|
+
if (s !== void 0 && r[i + 1].t === ",") {
|
|
1084
|
+
let r = D(s);
|
|
1085
|
+
t.some((e) => D(e.name) === r) && N(e.at, {
|
|
1086
|
+
key: "letTwice",
|
|
1087
|
+
name: s
|
|
1088
|
+
}), i += 2;
|
|
1089
|
+
let a = {
|
|
1090
|
+
name: s,
|
|
1091
|
+
slot: v++,
|
|
1092
|
+
value: h()
|
|
1093
|
+
};
|
|
1094
|
+
if (t.push(a), n.push([r, g.get(r)]), g.set(r, a), o().t !== ",") break;
|
|
1095
|
+
i++;
|
|
1096
|
+
} else {
|
|
1097
|
+
a = h(), o().t === "," && N(e.at, {
|
|
1098
|
+
key: "letName",
|
|
1099
|
+
position: t.length * 2 + 1
|
|
1100
|
+
});
|
|
1101
|
+
break;
|
|
1102
|
+
}
|
|
1103
|
+
}
|
|
1104
|
+
for (let [e, t] of n.reverse()) t ? g.set(e, t) : g.delete(e);
|
|
1105
|
+
return t.length || N(e, { key: "letEmpty" }), t.length * 2 + +!!a > It && N(e, {
|
|
1106
|
+
key: "letTooMany",
|
|
1107
|
+
max: It
|
|
1108
|
+
}), a ? {
|
|
1109
|
+
k: "let",
|
|
1110
|
+
binds: t,
|
|
1111
|
+
body: a
|
|
1112
|
+
} : {
|
|
1113
|
+
k: "let",
|
|
1114
|
+
binds: t
|
|
1115
|
+
};
|
|
1116
|
+
}, b = (e) => {
|
|
1117
|
+
let t = [[]];
|
|
1118
|
+
for (;;) {
|
|
1119
|
+
t.at(-1).push(x());
|
|
1120
|
+
let e = r[i++];
|
|
1121
|
+
if (e.t !== ",") {
|
|
1122
|
+
if (e.t === ";") t.push([]);
|
|
1123
|
+
else {
|
|
1124
|
+
e.t !== "}" && N(e.at, {
|
|
1125
|
+
key: "arraySeparator",
|
|
1126
|
+
found: I(e)
|
|
1127
|
+
});
|
|
1128
|
+
break;
|
|
1129
|
+
}
|
|
1130
|
+
}
|
|
1131
|
+
}
|
|
1132
|
+
return t.some((e) => e.length !== t[0].length) && N(e, { key: "arrayRows" }), {
|
|
1133
|
+
k: "arr",
|
|
1134
|
+
rows: t
|
|
1135
|
+
};
|
|
1136
|
+
}, x = () => {
|
|
1137
|
+
let e = r[i++];
|
|
1138
|
+
if (e.t === "op" && (e.v === "-" || e.v === "+") && r[i].t === "num") {
|
|
1139
|
+
let t = r[i++];
|
|
1140
|
+
return {
|
|
1141
|
+
k: "num",
|
|
1142
|
+
v: e.v === "-" ? -t.v : t.v
|
|
1143
|
+
};
|
|
1144
|
+
}
|
|
1145
|
+
if (e.t === "num") return {
|
|
1146
|
+
k: "num",
|
|
1147
|
+
v: e.v
|
|
1148
|
+
};
|
|
1149
|
+
if (e.t === "str") return {
|
|
1150
|
+
k: "str",
|
|
1151
|
+
v: e.v
|
|
1152
|
+
};
|
|
1153
|
+
if (e.t === "err" && e.sheet === void 0 && e.ref === void 0) return {
|
|
1154
|
+
k: "err",
|
|
1155
|
+
code: e.code
|
|
1156
|
+
};
|
|
1157
|
+
let t = e.t === "ident" ? Rt(e.v) : void 0;
|
|
1158
|
+
return t === void 0 ? N(e.at, {
|
|
1159
|
+
key: "arrayValue",
|
|
1160
|
+
found: I(e)
|
|
1161
|
+
}) : {
|
|
1162
|
+
k: "bool",
|
|
1163
|
+
v: t
|
|
1164
|
+
};
|
|
1165
|
+
}, S = (e) => {
|
|
1166
|
+
let t = r[i];
|
|
1167
|
+
t.t !== e && N(t.at, {
|
|
1168
|
+
key: "expected",
|
|
1169
|
+
char: e,
|
|
1170
|
+
found: I(t)
|
|
1171
|
+
}), i++;
|
|
1172
|
+
}, C = n.union ? p(c(0)) : c(0), w = o();
|
|
1173
|
+
return w.t !== "eof" && N(w.at, w.t === "," ? { key: "commaOutside" } : {
|
|
1174
|
+
key: "unexpected",
|
|
1175
|
+
found: I(w)
|
|
1176
|
+
}), C;
|
|
1177
|
+
}
|
|
1178
|
+
var I = (e) => e.t === "op" || e.t === "ident" || e.t === "fn" ? {
|
|
1179
|
+
t: e.t,
|
|
1180
|
+
v: e.v
|
|
1181
|
+
} : e.t === "xname" ? {
|
|
1182
|
+
t: "ident",
|
|
1183
|
+
v: e.v
|
|
1184
|
+
} : { t: e.t === "xref" ? "ref" : e.t };
|
|
1185
|
+
//#endregion
|
|
1186
|
+
//#region node_modules/xlcalc/dist/syntax/print.js
|
|
1187
|
+
function L(e, t) {
|
|
1188
|
+
switch (t(e), e.k) {
|
|
1189
|
+
case "fn":
|
|
1190
|
+
for (let n of e.args) L(n, t);
|
|
1191
|
+
break;
|
|
1192
|
+
case "un":
|
|
1193
|
+
case "pct":
|
|
1194
|
+
case "paren":
|
|
1195
|
+
case "at":
|
|
1196
|
+
L(e.a, t);
|
|
1197
|
+
break;
|
|
1198
|
+
case "union":
|
|
1199
|
+
for (let n of e.items) L(n, t);
|
|
1200
|
+
break;
|
|
1201
|
+
case "bin":
|
|
1202
|
+
L(e.a, t), L(e.b, t);
|
|
1203
|
+
break;
|
|
1204
|
+
case "let":
|
|
1205
|
+
for (let n of e.binds) L(n.value, t);
|
|
1206
|
+
e.body && L(e.body, t);
|
|
1207
|
+
}
|
|
1208
|
+
}
|
|
1209
|
+
function Bt(e, t) {
|
|
1210
|
+
let n = (e) => {
|
|
1211
|
+
let r = e, i = (e) => {
|
|
1212
|
+
let t = e.map(n);
|
|
1213
|
+
return t.some((t, n) => t !== e[n]) ? t : e;
|
|
1214
|
+
};
|
|
1215
|
+
switch (e.k) {
|
|
1216
|
+
case "fn": {
|
|
1217
|
+
let t = i(e.args);
|
|
1218
|
+
t !== e.args && (r = {
|
|
1219
|
+
...e,
|
|
1220
|
+
args: t
|
|
1221
|
+
});
|
|
1222
|
+
break;
|
|
1223
|
+
}
|
|
1224
|
+
case "un":
|
|
1225
|
+
case "pct":
|
|
1226
|
+
case "paren":
|
|
1227
|
+
case "at": {
|
|
1228
|
+
let t = n(e.a);
|
|
1229
|
+
t !== e.a && (r = {
|
|
1230
|
+
...e,
|
|
1231
|
+
a: t
|
|
1232
|
+
});
|
|
1233
|
+
break;
|
|
1234
|
+
}
|
|
1235
|
+
case "union": {
|
|
1236
|
+
let t = i(e.items);
|
|
1237
|
+
t !== e.items && (r = {
|
|
1238
|
+
...e,
|
|
1239
|
+
items: t
|
|
1240
|
+
});
|
|
1241
|
+
break;
|
|
1242
|
+
}
|
|
1243
|
+
case "bin": {
|
|
1244
|
+
let [t, i] = [n(e.a), n(e.b)];
|
|
1245
|
+
(t !== e.a || i !== e.b) && (r = {
|
|
1246
|
+
...e,
|
|
1247
|
+
a: t,
|
|
1248
|
+
b: i
|
|
1249
|
+
});
|
|
1250
|
+
break;
|
|
1251
|
+
}
|
|
1252
|
+
case "let": {
|
|
1253
|
+
let t = e.binds.map((e) => {
|
|
1254
|
+
let t = n(e.value);
|
|
1255
|
+
return t === e.value ? e : {
|
|
1256
|
+
...e,
|
|
1257
|
+
value: t
|
|
1258
|
+
};
|
|
1259
|
+
}), i = e.body && n(e.body);
|
|
1260
|
+
(i !== e.body || t.some((t, n) => t !== e.binds[n])) && (r = {
|
|
1261
|
+
...e,
|
|
1262
|
+
binds: t,
|
|
1263
|
+
...i ? { body: i } : {}
|
|
1264
|
+
});
|
|
1265
|
+
break;
|
|
1266
|
+
}
|
|
1267
|
+
}
|
|
1268
|
+
return t(r) ?? r;
|
|
1269
|
+
};
|
|
1270
|
+
return n(e);
|
|
1271
|
+
}
|
|
1272
|
+
var R = E, z = (e) => `'${e.replaceAll("'", "''")}'`;
|
|
1273
|
+
function Vt(e, t) {
|
|
1274
|
+
if (typeof e == "number") return `[${e}]${t}`;
|
|
1275
|
+
let n = Math.max(e.lastIndexOf("/"), e.lastIndexOf("\\")) + 1;
|
|
1276
|
+
return `${e.slice(0, n)}[${e.slice(n)}]${t}`;
|
|
1277
|
+
}
|
|
1278
|
+
function Ht(e, t = {}) {
|
|
1279
|
+
let n = t.str ?? ((e) => `"${e.replaceAll("\"", "\"\"")}"`), r = t.bool ?? ((e) => e ? "TRUE" : "FALSE"), i = t.sheetOf ?? ((e) => e), a = t.nameOf ?? ((e) => e), o = (e) => {
|
|
1280
|
+
switch (e.k) {
|
|
1281
|
+
case "num": return String(e.v);
|
|
1282
|
+
case "str": return n(e.v);
|
|
1283
|
+
case "bool": return r(e.v);
|
|
1284
|
+
case "err": return (e.sheet === void 0 ? "" : `${z(e.book === void 0 ? i(e.sheet) : Vt(e.book, e.sheet))}!`) + C[e.code] + (e.ref ?? "");
|
|
1285
|
+
case "ref": return (e.sheet === null ? "" : `${z(i(e.sheet))}!`) + e.ref.text + (e.ref.spill ? "#" : "");
|
|
1286
|
+
case "ref3d": return `${z(`${i(e.first)}:${i(e.last)}`)}!${e.ref.text}`;
|
|
1287
|
+
case "table": return `${e.table ?? ""}[${Re(e.spec)}]`;
|
|
1288
|
+
case "name": return (e.sheet === void 0 ? "" : `${z(i(e.sheet))}!`) + a(e.name, e.sheet);
|
|
1289
|
+
case "xref": return `${z(Vt(e.book, e.sheet))}!${e.ref.text}`;
|
|
1290
|
+
case "xname": return `${e.sheet === void 0 ? typeof e.book == "number" ? `[${e.book}]` : z(e.book) : z(Vt(e.book, e.sheet))}!${e.name}`;
|
|
1291
|
+
case "at": return `@${c(e.a)}`;
|
|
1292
|
+
case "union": return e.items.map(c).join(",");
|
|
1293
|
+
case "fn": return `${e.name}(${e.args.map(c).join(",")})`;
|
|
1294
|
+
case "un": return e.op + c(e.a);
|
|
1295
|
+
case "pct": return c(e.a) + "%";
|
|
1296
|
+
case "bin": return c(e.a) + e.op + c(e.b);
|
|
1297
|
+
case "paren": return `(${c(e.a)})`;
|
|
1298
|
+
case "arr": return `{${e.rows.map((e) => e.map(c).join(",")).join(";")}}`;
|
|
1299
|
+
case "missing": return "";
|
|
1300
|
+
case "let": return `LET(${[...e.binds.flatMap((e) => [e.name, c(e.value)]), ...e.body ? [c(e.body)] : []].join(",")})`;
|
|
1301
|
+
case "local": return e.name;
|
|
1302
|
+
}
|
|
1303
|
+
}, s = t.node, c = s ? (e) => s(e, c, o) ?? o(e) : o;
|
|
1304
|
+
return c(e);
|
|
1305
|
+
}
|
|
1306
|
+
var Ut = (e, t) => Ht(e, { sheetOf: t });
|
|
1307
|
+
RegExp(`^${F}$`, "u");
|
|
1308
|
+
function Wt(e) {
|
|
1309
|
+
let t = e.replace(/^file:\/\/\/?/i, ""), n = Math.max(t.lastIndexOf("/"), t.lastIndexOf("\\")) + 1;
|
|
1310
|
+
return {
|
|
1311
|
+
dir: t.slice(0, n),
|
|
1312
|
+
file: t.slice(n)
|
|
1313
|
+
};
|
|
1314
|
+
}
|
|
1315
|
+
function Gt(e, t) {
|
|
1316
|
+
let n = E(t.replace(/^file:\/\/\/?/i, "")), r = e.findIndex((e) => E(e.target.replace(/^file:\/\/\/?/i, "")) === n);
|
|
1317
|
+
if (r >= 0) return r + 1;
|
|
1318
|
+
let i = E(Wt(t).file);
|
|
1319
|
+
return e.findIndex((e) => E(Wt(e.target).file) === i) + 1;
|
|
1320
|
+
}
|
|
1321
|
+
var Kt = (e, t, n) => !n?.has(R(t)) && /\.\w+$/.test(t) && Gt(e, t) > 0;
|
|
1322
|
+
function qt(e, t, n) {
|
|
1323
|
+
let r = n ? new Set(n.map(R)) : null, i = null, a = (e) => {
|
|
1324
|
+
let n = typeof e == "number" ? t && e <= t.length ? e : 0 : t ? Gt(t, e) : 0;
|
|
1325
|
+
return !n && !i && (i = {
|
|
1326
|
+
code: "external_ref",
|
|
1327
|
+
message: t ? {
|
|
1328
|
+
key: "unknownLink",
|
|
1329
|
+
book: typeof e == "number" ? `[${e}]` : e
|
|
1330
|
+
} : { key: "externalReference" },
|
|
1331
|
+
needle: typeof e == "number" ? `[${e}]` : Wt(e).file
|
|
1332
|
+
}), n;
|
|
1333
|
+
}, o = (e, n) => {
|
|
1334
|
+
let r = t[e - 1].sheets.find((e) => R(e.name) === R(n))?.name;
|
|
1335
|
+
return r === void 0 && !i && (i = {
|
|
1336
|
+
code: "external_ref",
|
|
1337
|
+
message: {
|
|
1338
|
+
key: "unknownLinkSheet",
|
|
1339
|
+
book: Wt(t[e - 1].target).file,
|
|
1340
|
+
sheet: n
|
|
1341
|
+
},
|
|
1342
|
+
needle: n
|
|
1343
|
+
}), r;
|
|
1344
|
+
}, s = Bt(e, (e) => {
|
|
1345
|
+
if (i) return;
|
|
1346
|
+
if (e.k === "name" && e.sheet !== void 0 && t?.length && Kt(t, e.sheet, r)) return {
|
|
1347
|
+
k: "xname",
|
|
1348
|
+
book: Gt(t, e.sheet),
|
|
1349
|
+
name: e.name
|
|
1350
|
+
};
|
|
1351
|
+
if (e.k === "err" && e.book !== void 0) {
|
|
1352
|
+
let t = a(e.book);
|
|
1353
|
+
return t && t !== e.book ? {
|
|
1354
|
+
...e,
|
|
1355
|
+
book: t
|
|
1356
|
+
} : void 0;
|
|
1357
|
+
}
|
|
1358
|
+
if (e.k !== "xref" && e.k !== "xname") return;
|
|
1359
|
+
let n = a(e.book);
|
|
1360
|
+
if (!n) return;
|
|
1361
|
+
if (e.sheet === void 0) return e.book === n ? void 0 : {
|
|
1362
|
+
...e,
|
|
1363
|
+
book: n
|
|
1364
|
+
};
|
|
1365
|
+
let s = o(n, e.sheet);
|
|
1366
|
+
if (s !== void 0) return e.book === n && e.sheet === s ? void 0 : {
|
|
1367
|
+
...e,
|
|
1368
|
+
book: n,
|
|
1369
|
+
sheet: s
|
|
1370
|
+
};
|
|
1371
|
+
});
|
|
1372
|
+
return i ? {
|
|
1373
|
+
ok: !1,
|
|
1374
|
+
...i
|
|
1375
|
+
} : {
|
|
1376
|
+
ok: !0,
|
|
1377
|
+
ast: s
|
|
1378
|
+
};
|
|
1379
|
+
}
|
|
1380
|
+
function Jt(e, t) {
|
|
1381
|
+
let n;
|
|
1382
|
+
try {
|
|
1383
|
+
n = Nt(e);
|
|
1384
|
+
} catch (t) {
|
|
1385
|
+
if (t instanceof M) return e;
|
|
1386
|
+
throw t;
|
|
1387
|
+
}
|
|
1388
|
+
let r = "", i = 0;
|
|
1389
|
+
for (let a = 0; a < n.length - 1; a++) {
|
|
1390
|
+
let o = n[a], s = n[a + 1].at;
|
|
1391
|
+
for (; s > o.at && et(e[s - 1]);) s--;
|
|
1392
|
+
let c = t(o, e.slice(o.at, s));
|
|
1393
|
+
c !== void 0 && (r += e.slice(i, o.at) + c, i = s);
|
|
1394
|
+
}
|
|
1395
|
+
return i === 0 ? e : r + e.slice(i);
|
|
1396
|
+
}
|
|
1397
|
+
function Yt(e, t, n) {
|
|
1398
|
+
let r = null, i = n ? new Set(n.map(R)) : null, a = Jt(e, (e) => {
|
|
1399
|
+
if (r) return;
|
|
1400
|
+
if (e.t === "ident" && e.sheet !== void 0 && Kt(t, e.sheet, i)) return `[${Gt(t, e.sheet)}]!${e.v}`;
|
|
1401
|
+
if (e.t !== "xref" && e.t !== "xname" && e.t !== "err" || e.book === void 0 || typeof e.book == "number") return;
|
|
1402
|
+
let n = Gt(t, e.book);
|
|
1403
|
+
if (!n) r = {
|
|
1404
|
+
at: e.at,
|
|
1405
|
+
message: {
|
|
1406
|
+
key: "unknownLink",
|
|
1407
|
+
book: e.book
|
|
1408
|
+
}
|
|
1409
|
+
};
|
|
1410
|
+
else return e.t === "err" ? `${z(`[${n}]${e.sheet}`)}!#REF!` : e.t === "xref" ? `${z(`[${n}]${e.sheet}`)}!${e.ref.text}` : e.sheet === void 0 ? `[${n}]!${e.v}` : `${z(`[${n}]${e.sheet}`)}!${e.v}`;
|
|
1411
|
+
});
|
|
1412
|
+
return r ? {
|
|
1413
|
+
ok: !1,
|
|
1414
|
+
...r
|
|
1415
|
+
} : {
|
|
1416
|
+
ok: !0,
|
|
1417
|
+
formula: a
|
|
1418
|
+
};
|
|
1419
|
+
}
|
|
1420
|
+
//#endregion
|
|
1421
|
+
//#region node_modules/xlcalc/dist/syntax/check.js
|
|
1422
|
+
var B = (e, t) => Math.max(0, D(e).indexOf(D(t)));
|
|
1423
|
+
function Xt(e, t, n) {
|
|
1424
|
+
let r = (e) => {
|
|
1425
|
+
switch (e.k) {
|
|
1426
|
+
case "paren":
|
|
1427
|
+
case "un":
|
|
1428
|
+
case "pct":
|
|
1429
|
+
case "at": return r(e.a);
|
|
1430
|
+
case "union":
|
|
1431
|
+
for (let t of e.items) {
|
|
1432
|
+
let e = r(t);
|
|
1433
|
+
if (e) return e;
|
|
1434
|
+
}
|
|
1435
|
+
return null;
|
|
1436
|
+
case "bin": return r(e.a) ?? r(e.b);
|
|
1437
|
+
case "let":
|
|
1438
|
+
for (let t of [...e.binds.map((e) => e.value), ...e.body ? [e.body] : []]) {
|
|
1439
|
+
let e = r(t);
|
|
1440
|
+
if (e) return e;
|
|
1441
|
+
}
|
|
1442
|
+
return null;
|
|
1443
|
+
case "fn": {
|
|
1444
|
+
if (n(e.name)) {
|
|
1445
|
+
for (let n of e.args) if (!(n.k === "num" || n.k === "str" || n.k === "bool" || n.k === "un" && n.a.k === "num")) return new M("unsupported", {
|
|
1446
|
+
key: "externalLiterals",
|
|
1447
|
+
fn: e.name
|
|
1448
|
+
}, B(t, e.name));
|
|
1449
|
+
return null;
|
|
1450
|
+
}
|
|
1451
|
+
let i = a(e.name);
|
|
1452
|
+
if (!i) return null;
|
|
1453
|
+
let o = e.args.length;
|
|
1454
|
+
if (!i.takes(o)) return new M("syntax", {
|
|
1455
|
+
key: "argumentCount",
|
|
1456
|
+
fn: e.name,
|
|
1457
|
+
counts: i.counts,
|
|
1458
|
+
got: o
|
|
1459
|
+
}, B(t, e.name));
|
|
1460
|
+
let s = e.args.findIndex((e, t) => e.k === "missing" && !i.omits(t));
|
|
1461
|
+
if (s >= 0) return new M("syntax", {
|
|
1462
|
+
key: "argumentLeftOut",
|
|
1463
|
+
fn: e.name,
|
|
1464
|
+
position: s + 1
|
|
1465
|
+
}, B(t, e.name));
|
|
1466
|
+
for (let t of e.args) {
|
|
1467
|
+
let e = r(t);
|
|
1468
|
+
if (e) return e;
|
|
1469
|
+
}
|
|
1470
|
+
return null;
|
|
1471
|
+
}
|
|
1472
|
+
default: return null;
|
|
1473
|
+
}
|
|
1474
|
+
};
|
|
1475
|
+
return r(e);
|
|
1476
|
+
}
|
|
1477
|
+
function Zt(e, t, n) {
|
|
1478
|
+
let r = n.tables ? new Map(n.tables.map((e) => [R(e.name), e])) : null, i = /* @__PURE__ */ new Set(), a = null, o = (e, r) => ({
|
|
1479
|
+
ok: !1,
|
|
1480
|
+
code: "unknown_name",
|
|
1481
|
+
message: (n.say ?? ce)(e),
|
|
1482
|
+
at: B(t, r)
|
|
1483
|
+
}), s = Bt(e, (e) => {
|
|
1484
|
+
if (a) return;
|
|
1485
|
+
if (e.k === "name" && e.sheet === void 0 && r?.has(R(e.name))) {
|
|
1486
|
+
let t = r.get(R(e.name));
|
|
1487
|
+
return i.add(t.name), {
|
|
1488
|
+
k: "table",
|
|
1489
|
+
table: t.name,
|
|
1490
|
+
spec: { areas: [] }
|
|
1491
|
+
};
|
|
1492
|
+
}
|
|
1493
|
+
if (e.k !== "table") return;
|
|
1494
|
+
let t = e.table ?? n.table;
|
|
1495
|
+
if (t === void 0) {
|
|
1496
|
+
n.tables && (a = o({ key: "tableRefOutside" }, "["));
|
|
1497
|
+
return;
|
|
1498
|
+
}
|
|
1499
|
+
let s = r?.get(R(t));
|
|
1500
|
+
if (!s) {
|
|
1501
|
+
if (r) {
|
|
1502
|
+
a = o({
|
|
1503
|
+
key: "unknownTable",
|
|
1504
|
+
table: t
|
|
1505
|
+
}, t);
|
|
1506
|
+
return;
|
|
1507
|
+
}
|
|
1508
|
+
return i.add(t), e.table === null ? {
|
|
1509
|
+
...e,
|
|
1510
|
+
table: t
|
|
1511
|
+
} : void 0;
|
|
1512
|
+
}
|
|
1513
|
+
i.add(s.name);
|
|
1514
|
+
let c = e.spec.cols?.map((e) => s.columns.find((t) => R(t) === R(e))), l = e.spec.cols?.find((e, t) => c[t] === void 0);
|
|
1515
|
+
if (l !== void 0) a = o({
|
|
1516
|
+
key: "unknownColumn",
|
|
1517
|
+
table: s.name,
|
|
1518
|
+
column: l
|
|
1519
|
+
}, l);
|
|
1520
|
+
else return {
|
|
1521
|
+
k: "table",
|
|
1522
|
+
table: s.name,
|
|
1523
|
+
spec: c ? {
|
|
1524
|
+
...e.spec,
|
|
1525
|
+
cols: c
|
|
1526
|
+
} : e.spec
|
|
1527
|
+
};
|
|
1528
|
+
});
|
|
1529
|
+
return a ?? {
|
|
1530
|
+
ok: !0,
|
|
1531
|
+
ast: s,
|
|
1532
|
+
tables: [...i]
|
|
1533
|
+
};
|
|
1534
|
+
}
|
|
1535
|
+
function Qt(e, t = {}) {
|
|
1536
|
+
return $t(e, null, t);
|
|
1537
|
+
}
|
|
1538
|
+
function $t(e, t, n = {}) {
|
|
1539
|
+
let r = n.say ?? ce, i;
|
|
1540
|
+
try {
|
|
1541
|
+
i = zt(e, t, { union: n.union });
|
|
1542
|
+
} catch (e) {
|
|
1543
|
+
if (e instanceof M) return {
|
|
1544
|
+
ok: !1,
|
|
1545
|
+
code: e.code,
|
|
1546
|
+
message: r(e.msg),
|
|
1547
|
+
at: e.at
|
|
1548
|
+
};
|
|
1549
|
+
throw e;
|
|
1550
|
+
}
|
|
1551
|
+
let o = n.tables?.length || e.includes("[") ? Zt(i, e, n) : {
|
|
1552
|
+
ok: !0,
|
|
1553
|
+
ast: i,
|
|
1554
|
+
tables: []
|
|
1555
|
+
};
|
|
1556
|
+
if (!o.ok) return o;
|
|
1557
|
+
if (i = o.ast, e.includes("[") || n.externalBooks?.length && e.includes("!")) {
|
|
1558
|
+
let t = qt(i, n.externalBooks, n.sheets);
|
|
1559
|
+
if (!t.ok) return {
|
|
1560
|
+
ok: !1,
|
|
1561
|
+
code: t.code,
|
|
1562
|
+
message: r(t.message),
|
|
1563
|
+
at: B(e, t.needle)
|
|
1564
|
+
};
|
|
1565
|
+
i = t.ast;
|
|
1566
|
+
}
|
|
1567
|
+
let c = new Set((n.externalFunctions ?? []).map(D)), l = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set(), d = /* @__PURE__ */ new Set(), f = [], p = [];
|
|
1568
|
+
L(i, (e) => {
|
|
1569
|
+
e.k === "fn" ? (l.add(e.name), c.has(e.name) && !a(e.name) && p.push(Ut(e))) : e.k === "let" ? l.add("LET") : e.k === "ref" && e.sheet !== null || e.k === "err" && e.sheet !== void 0 && e.book === void 0 ? u.add(e.sheet) : e.k === "ref3d" ? u.add(e.first).add(e.last) : e.k === "name" && (d.add(e.name), f.push([e.name, e.sheet]), e.sheet !== void 0 && u.add(e.sheet));
|
|
1570
|
+
});
|
|
1571
|
+
let m = (t, n, i) => ({
|
|
1572
|
+
ok: !1,
|
|
1573
|
+
code: t,
|
|
1574
|
+
message: r(n),
|
|
1575
|
+
at: B(e, i)
|
|
1576
|
+
});
|
|
1577
|
+
for (let e of l) if (!s(e) && !c.has(e)) return m("unknown_function", {
|
|
1578
|
+
key: "unknownFunction",
|
|
1579
|
+
fn: e
|
|
1580
|
+
}, e);
|
|
1581
|
+
if (n.sheets) {
|
|
1582
|
+
let e = new Set(n.sheets.map(R));
|
|
1583
|
+
for (let t of u) if (!e.has(R(t))) return m("unknown_sheet", {
|
|
1584
|
+
key: "unknownSheet",
|
|
1585
|
+
sheet: t
|
|
1586
|
+
}, t);
|
|
1587
|
+
}
|
|
1588
|
+
if (n.known) {
|
|
1589
|
+
for (let [e, t] of f) if (!n.known(e, t)) return m("unknown_name", {
|
|
1590
|
+
key: "unknownName",
|
|
1591
|
+
name: e
|
|
1592
|
+
}, e);
|
|
1593
|
+
} else if (n.names) {
|
|
1594
|
+
let e = new Set(n.names.map(E));
|
|
1595
|
+
for (let t of d) if (!e.has(E(t))) return m("unknown_name", {
|
|
1596
|
+
key: "unknownName",
|
|
1597
|
+
name: t
|
|
1598
|
+
}, t);
|
|
1599
|
+
}
|
|
1600
|
+
let h = Xt(i, e, (e) => c.has(e) && !a(e));
|
|
1601
|
+
return h ? {
|
|
1602
|
+
ok: !1,
|
|
1603
|
+
code: h.code,
|
|
1604
|
+
message: r(h.msg),
|
|
1605
|
+
at: h.at
|
|
1606
|
+
} : {
|
|
1607
|
+
ok: !0,
|
|
1608
|
+
ast: i,
|
|
1609
|
+
canonical: Ut(i),
|
|
1610
|
+
functions: [...l].sort(),
|
|
1611
|
+
sheets: [...u],
|
|
1612
|
+
names: [...d],
|
|
1613
|
+
externals: [...new Set(p)],
|
|
1614
|
+
tables: o.tables
|
|
1615
|
+
};
|
|
1616
|
+
}
|
|
1617
|
+
RegExp(`^${lt}${ut}{0,254}$`, "u");
|
|
1618
|
+
//#endregion
|
|
1619
|
+
//#region node_modules/xlcalc/dist/input/range.js
|
|
1620
|
+
var en = /^([A-Z]{1,3})([1-9][0-9]*)$/, tn = "XFD1048576";
|
|
1621
|
+
function nn(e, t) {
|
|
1622
|
+
if (typeof e != "string") throw new v(t, `expected a cell address such as "B12", got ${y(e)}`);
|
|
1623
|
+
let n = en.exec(e);
|
|
1624
|
+
if (!n) {
|
|
1625
|
+
let n = en.test(e.toUpperCase()) ? ` (column letters must be upper-case: "${e.toUpperCase()}")` : "";
|
|
1626
|
+
throw new v(t, `invalid cell address ${JSON.stringify(e)}: expected A1 style such as "B12"${n}`);
|
|
1627
|
+
}
|
|
1628
|
+
if (n[1].length < 3 && n[2].length < 7) return e;
|
|
1629
|
+
let r = 0;
|
|
1630
|
+
for (let e of n[1]) r = r * 26 + (e.charCodeAt(0) - 64);
|
|
1631
|
+
if (r > 16384 || Number(n[2]) > 1048576) throw new v(t, `cell address ${JSON.stringify(e)} is outside the sheet (the last cell is ${tn})`);
|
|
1632
|
+
return e;
|
|
1633
|
+
}
|
|
1634
|
+
//#endregion
|
|
1635
|
+
//#region node_modules/xlcalc/dist/numfmt/builtin.js
|
|
1636
|
+
var V = "m/d/yyyy", rn = "h:mm:ss", H = [
|
|
1637
|
+
"General",
|
|
1638
|
+
"0",
|
|
1639
|
+
"0.00",
|
|
1640
|
+
"#,##0",
|
|
1641
|
+
"#,##0.00",
|
|
1642
|
+
"$#,##0_);($#,##0)",
|
|
1643
|
+
"$#,##0_);[Red]($#,##0)",
|
|
1644
|
+
"$#,##0.00_);($#,##0.00)",
|
|
1645
|
+
"$#,##0.00_);[Red]($#,##0.00)",
|
|
1646
|
+
"0%",
|
|
1647
|
+
"0.00%",
|
|
1648
|
+
"0.00E+00",
|
|
1649
|
+
"# ?/?",
|
|
1650
|
+
"# ??/??",
|
|
1651
|
+
V,
|
|
1652
|
+
"d-mmm-yy",
|
|
1653
|
+
"d-mmm",
|
|
1654
|
+
"mmm-yy",
|
|
1655
|
+
"h:mm AM/PM",
|
|
1656
|
+
"h:mm:ss AM/PM",
|
|
1657
|
+
"h:mm",
|
|
1658
|
+
rn,
|
|
1659
|
+
`${V} h:mm`,
|
|
1660
|
+
"General",
|
|
1661
|
+
"General",
|
|
1662
|
+
"General",
|
|
1663
|
+
"General",
|
|
1664
|
+
V,
|
|
1665
|
+
V,
|
|
1666
|
+
V,
|
|
1667
|
+
V,
|
|
1668
|
+
V,
|
|
1669
|
+
rn,
|
|
1670
|
+
rn,
|
|
1671
|
+
rn,
|
|
1672
|
+
rn,
|
|
1673
|
+
V,
|
|
1674
|
+
"#,##0_);(#,##0)",
|
|
1675
|
+
"#,##0_);[Red](#,##0)",
|
|
1676
|
+
"#,##0.00_);(#,##0.00)",
|
|
1677
|
+
"#,##0.00_);[Red](#,##0.00)",
|
|
1678
|
+
"_(* #,##0_);_(* (#,##0);_(* \"-\"_);_(@_)",
|
|
1679
|
+
"_($* #,##0_);_($* (#,##0);_($* \"-\"_);_(@_)",
|
|
1680
|
+
"_(* #,##0.00_);_(* (#,##0.00);_(* \"-\"??_);_(@_)",
|
|
1681
|
+
"_($* #,##0.00_);_($* (#,##0.00);_($* \"-\"??_);_(@_)",
|
|
1682
|
+
"mm:ss",
|
|
1683
|
+
"[h]:mm:ss",
|
|
1684
|
+
"mm:ss.0",
|
|
1685
|
+
"##0.0E+0",
|
|
1686
|
+
"@"
|
|
1687
|
+
], an = (e) => Number.isInteger(e) && e >= 0 && e < H.length, on = (e) => (t) => e[t] ?? H[t];
|
|
1688
|
+
//#endregion
|
|
1689
|
+
//#region node_modules/xlcalc/dist/input/styles.js
|
|
1690
|
+
function sn(e, t) {
|
|
1691
|
+
if (typeof e != "string" && !(typeof e == "number" && an(e))) throw new v(t, `expected a format code or the number of a built-in format, 0 to 49, got ${y(e)}`);
|
|
1692
|
+
}
|
|
1693
|
+
//#endregion
|
|
1694
|
+
//#region node_modules/xlcalc/dist/input.js
|
|
1695
|
+
function cn(e, t) {
|
|
1696
|
+
let n = O(e, t, "a note such as { author: \"Ann\", text: \"Checked\" }");
|
|
1697
|
+
A(n, t, ["author", "text"]), k(n.text, `${t}.text`), n.author !== void 0 && k(n.author, `${t}.author`);
|
|
1698
|
+
}
|
|
1699
|
+
function ln(e, t) {
|
|
1700
|
+
let n = O(e, t, "a hyperlink such as { url: \"https://example.com/\" } or { location: \"Sheet2!B12\" }");
|
|
1701
|
+
A(n, t, [
|
|
1702
|
+
"url",
|
|
1703
|
+
"location",
|
|
1704
|
+
"tooltip"
|
|
1705
|
+
]);
|
|
1706
|
+
for (let e of [
|
|
1707
|
+
"url",
|
|
1708
|
+
"location",
|
|
1709
|
+
"tooltip"
|
|
1710
|
+
]) n[e] !== void 0 && k(n[e], `${t}.${e}`);
|
|
1711
|
+
if (!n.url && !n.location) throw new v(t, "a hyperlink needs a url, a location or both");
|
|
1712
|
+
}
|
|
1713
|
+
var un = /^[A-Z]{1,2}[1-9][0-9]{0,5}$/, dn = [1900, 1904];
|
|
1714
|
+
b.c, b.r;
|
|
1715
|
+
function fn(e, t, n = !0) {
|
|
1716
|
+
return xe(e, t, "an array of linked workbooks such as { target: \"Book2.xlsx\", sheets: [{ name: \"Sheet1\", cells: { A1: 5 } }] }").map((e, r) => {
|
|
1717
|
+
let i = `${t}[${r}]`, a = O(e, i, "a linked workbook such as { target: \"Book2.xlsx\", sheets: [{ name: \"Sheet1\", cells: { A1: 5 } }] }");
|
|
1718
|
+
A(a, i, [
|
|
1719
|
+
"target",
|
|
1720
|
+
"sheets",
|
|
1721
|
+
"names"
|
|
1722
|
+
]), k(a.target, `${i}.target`);
|
|
1723
|
+
let o = xe(a.sheets, `${i}.sheets`, "an array of sheets such as { name: \"Sheet1\", cells: { A1: 5 } }");
|
|
1724
|
+
return o.forEach((e, t) => {
|
|
1725
|
+
let r = `${i}.sheets[${t}]`, a = O(e, r, "a sheet such as { name: \"Sheet1\", cells: { A1: 5 } }");
|
|
1726
|
+
if (A(a, r, [
|
|
1727
|
+
"name",
|
|
1728
|
+
"cells",
|
|
1729
|
+
"refreshError"
|
|
1730
|
+
]), k(a.name, `${r}.name`), a.refreshError !== void 0 && a.refreshError !== !0) throw new v(`${r}.refreshError`, `expected true, got ${y(a.refreshError)}`);
|
|
1731
|
+
if (a.cells === void 0) return;
|
|
1732
|
+
let o = O(a.cells, `${r}.cells`, "an object of stored values by address such as { A1: 5 }");
|
|
1733
|
+
if (n) for (let e of Object.keys(o)) {
|
|
1734
|
+
let t = `${r}.cells[${JSON.stringify(e)}]`;
|
|
1735
|
+
un.test(e) || nn(e, t), pn(o[e], t);
|
|
1736
|
+
}
|
|
1737
|
+
}), a.names !== void 0 && xe(a.names, `${i}.names`, "an array of names such as { name: \"Rate\", ref: \"Sheet1!$B$1\" }").forEach((e, t) => {
|
|
1738
|
+
let n = `${i}.names[${t}]`, r = O(e, n, "a name such as { name: \"Rate\", ref: \"Sheet1!$B$1\" }");
|
|
1739
|
+
A(r, n, [
|
|
1740
|
+
"name",
|
|
1741
|
+
"ref",
|
|
1742
|
+
"sheet"
|
|
1743
|
+
]), k(r.name, `${n}.name`), k(r.ref, `${n}.ref`), r.sheet !== void 0 && Ce(r.sheet, `${n}.sheet`, 0, o.length - 1, !0);
|
|
1744
|
+
}), a;
|
|
1745
|
+
});
|
|
1746
|
+
}
|
|
1747
|
+
function pn(e, t) {
|
|
1748
|
+
if (e === null || typeof e == "string" || typeof e == "boolean" || typeof e == "number" && Number.isFinite(e) || typeof e == "object" && !Array.isArray(e) && Object.keys(e).length === 1 && e.error in C) return e;
|
|
1749
|
+
throw new v(t, `expected a number, text, a boolean, null or { error: code }, got ${y(e)}`);
|
|
1750
|
+
}
|
|
1751
|
+
function mn(e, t = "opts") {
|
|
1752
|
+
if (e === void 0) return {};
|
|
1753
|
+
let n = O(e, t, "options such as { numberFormat: '0%', locale: 'ru-RU' }");
|
|
1754
|
+
return A(n, t, [
|
|
1755
|
+
"numberFormat",
|
|
1756
|
+
"locale",
|
|
1757
|
+
"dateSystem",
|
|
1758
|
+
"now"
|
|
1759
|
+
]), n.numberFormat !== void 0 && sn(n.numberFormat, `${t}.numberFormat`), hn({
|
|
1760
|
+
...n.locale === void 0 ? {} : { locale: n.locale },
|
|
1761
|
+
...n.dateSystem === void 0 ? {} : { dateSystem: n.dateSystem },
|
|
1762
|
+
...n.now === void 0 ? {} : { now: n.now }
|
|
1763
|
+
}, t), n;
|
|
1764
|
+
}
|
|
1765
|
+
function hn(e, t = "opts") {
|
|
1766
|
+
if (e === void 0) return {};
|
|
1767
|
+
let n = O(e, t, "options such as { locale: 'ru-RU', cell: { numberFormat: '0.00' } }");
|
|
1768
|
+
if (A(n, t, [
|
|
1769
|
+
"locale",
|
|
1770
|
+
"dateSystem",
|
|
1771
|
+
"cell",
|
|
1772
|
+
"now",
|
|
1773
|
+
"externalBooks"
|
|
1774
|
+
]), n.locale !== void 0 && Qe(n.locale, `${t}.locale`), n.externalBooks !== void 0 && fn(n.externalBooks, `${t}.externalBooks`, !1), n.dateSystem !== void 0 && Se(n.dateSystem, `${t}.dateSystem`, dn), n.now !== void 0 && Number.isNaN(Date.parse(k(n.now, `${t}.now`)))) throw new v(`${t}.now`, `invalid moment ${JSON.stringify(n.now)}: expected ISO 8601 such as "2026-01-31T12:00:00Z"`);
|
|
1775
|
+
if (n.cell !== void 0 && n.cell !== null) {
|
|
1776
|
+
let e = O(n.cell, `${t}.cell`, "a cell such as { numberFormat: \"0.00\", style: 1 }");
|
|
1777
|
+
if (Object.hasOwn(e, "format") && A({ format: e.format }, `${t}.cell`, [
|
|
1778
|
+
"numberFormat",
|
|
1779
|
+
"style",
|
|
1780
|
+
"meta",
|
|
1781
|
+
"note",
|
|
1782
|
+
"link"
|
|
1783
|
+
]), e.numberFormat !== void 0 && sn(e.numberFormat, `${t}.cell.numberFormat`), e.style !== void 0 && !(Number.isInteger(e.style) && e.style >= 0)) throw new v(`${t}.cell.style`, `expected the index of a style, got ${y(e.style)}`);
|
|
1784
|
+
e.note !== void 0 && cn(e.note, `${t}.cell.note`), e.link !== void 0 && ln(e.link, `${t}.cell.link`);
|
|
1785
|
+
}
|
|
1786
|
+
return n;
|
|
1787
|
+
}
|
|
1788
|
+
//#endregion
|
|
1789
|
+
//#region node_modules/xlcalc/dist/a1.js
|
|
1790
|
+
var gn = RegExp(`^${F}$`, "u"), _n = /^([A-Za-z]{1,3})(\d+)$/, vn = /^(?:([Rr])(\d*)(?:[Cc](\d*))?|[Cc](\d*))/, yn = (e, t) => e === "" || Number(e) >= 1 && Number(e) <= t;
|
|
1791
|
+
function bn(e) {
|
|
1792
|
+
let t = vn.exec(e);
|
|
1793
|
+
if (!t) return !1;
|
|
1794
|
+
let [n, r, i, a, o] = t;
|
|
1795
|
+
if (r === void 0) return yn(o, 16384) && (n.length === e.length || o !== "" && e[n.length] !== ".");
|
|
1796
|
+
if (!yn(i, 1048576)) return !1;
|
|
1797
|
+
let s = a === void 0 || yn(a, 16384) ? n.length : 1 + i.length, c = i !== "" || s === n.length && a !== void 0 && a !== "";
|
|
1798
|
+
return s === e.length || c && e[s] !== ".";
|
|
1799
|
+
}
|
|
1800
|
+
function xn(e) {
|
|
1801
|
+
if (e === void 0) return {
|
|
1802
|
+
TRUE: "TRUE",
|
|
1803
|
+
FALSE: "FALSE"
|
|
1804
|
+
};
|
|
1805
|
+
let t = e?.booleans;
|
|
1806
|
+
if (typeof e == "object" && typeof t?.TRUE == "string" && typeof t.FALSE == "string") return t;
|
|
1807
|
+
let n = typeof e == "string" ? " (it takes no tag, so that the a1 subpath carries no list of locales)" : "";
|
|
1808
|
+
throw new v("locale", `expected a locale object such as ruRU, with its booleans, got ${y(e)}${n}`);
|
|
1809
|
+
}
|
|
1810
|
+
var Sn = /* @__PURE__ */ ye(function(e, t) {
|
|
1811
|
+
let n = k(e, "name"), r = xn(t), i = _n.exec(n);
|
|
1812
|
+
return !gn.test(n) || E(n) === E(r.TRUE) || E(n) === E(r.FALSE) || i !== null && u(i[1]) < 16384 && yn(i[2], 1048576) || bn(n) ? `'${n.replaceAll("'", "''")}'` : n;
|
|
1813
|
+
}), Cn = [
|
|
1814
|
+
"January",
|
|
1815
|
+
"February",
|
|
1816
|
+
"March",
|
|
1817
|
+
"April",
|
|
1818
|
+
"May",
|
|
1819
|
+
"June",
|
|
1820
|
+
"July",
|
|
1821
|
+
"August",
|
|
1822
|
+
"September",
|
|
1823
|
+
"October",
|
|
1824
|
+
"November",
|
|
1825
|
+
"December"
|
|
1826
|
+
], wn = [
|
|
1827
|
+
"Sunday",
|
|
1828
|
+
"Monday",
|
|
1829
|
+
"Tuesday",
|
|
1830
|
+
"Wednesday",
|
|
1831
|
+
"Thursday",
|
|
1832
|
+
"Friday",
|
|
1833
|
+
"Saturday"
|
|
1834
|
+
], Tn = {
|
|
1835
|
+
months: Cn,
|
|
1836
|
+
monthsShort: Cn.map((e) => e.slice(0, 3)),
|
|
1837
|
+
days: wn,
|
|
1838
|
+
daysShort: wn.map((e) => e.slice(0, 3))
|
|
1839
|
+
}, En = (e, t) => t ? {
|
|
1840
|
+
...e,
|
|
1841
|
+
epoch: t
|
|
1842
|
+
} : e, Dn = (e) => e.layout ? " " : " ";
|
|
1843
|
+
function U(e, t) {
|
|
1844
|
+
switch (e.t) {
|
|
1845
|
+
case "lit": return e.s;
|
|
1846
|
+
case "pct": return "%";
|
|
1847
|
+
case "slash": return "/";
|
|
1848
|
+
case "pad": return t.layout ? "" + e.s : " ";
|
|
1849
|
+
case "fill": return "" + e.s;
|
|
1850
|
+
case "ph": return e.c === "0" ? "0" : "";
|
|
1851
|
+
case "dot": return t.decimal;
|
|
1852
|
+
case "comma": return t.group;
|
|
1853
|
+
default: return "";
|
|
1854
|
+
}
|
|
1855
|
+
}
|
|
1856
|
+
//#endregion
|
|
1857
|
+
//#region node_modules/xlcalc/dist/dates.js
|
|
1858
|
+
var On = 1462, kn = (e) => e === 1904 ? On : 0;
|
|
1859
|
+
function An(e, t, n) {
|
|
1860
|
+
let r = /* @__PURE__ */ new Date(0);
|
|
1861
|
+
return r.setUTCFullYear(e, t - 1, n), Math.round((r.getTime() - m) / p);
|
|
1862
|
+
}
|
|
1863
|
+
var jn = (e, t, n) => h(An(e, t, n)), Mn = (e, t, n) => e === 1900 && t === 2 && n === 29 ? 60 : jn(e, t, n), Nn = (e) => e % 4 == 0 && e % 100 != 0 || e % 400 == 0, Pn = (e, t) => [
|
|
1864
|
+
31,
|
|
1865
|
+
Nn(e) ? 29 : 28,
|
|
1866
|
+
31,
|
|
1867
|
+
30,
|
|
1868
|
+
31,
|
|
1869
|
+
30,
|
|
1870
|
+
31,
|
|
1871
|
+
31,
|
|
1872
|
+
30,
|
|
1873
|
+
31,
|
|
1874
|
+
30,
|
|
1875
|
+
31
|
|
1876
|
+
][t - 1], Fn = (e, t) => e === 1900 && t === 2 ? 29 : Pn(e, t), In = 1 / 86400;
|
|
1877
|
+
function Ln(e) {
|
|
1878
|
+
let t = e + In / 2, n = Math.floor(t), r = Math.floor((t - n) / In);
|
|
1879
|
+
return r < 86400 ? {
|
|
1880
|
+
day: n,
|
|
1881
|
+
second: r
|
|
1882
|
+
} : {
|
|
1883
|
+
day: n + 1,
|
|
1884
|
+
second: 0
|
|
1885
|
+
};
|
|
1886
|
+
}
|
|
1887
|
+
function Rn(e) {
|
|
1888
|
+
let t = Math.floor(e);
|
|
1889
|
+
if (t === 0) return {
|
|
1890
|
+
y: 1900,
|
|
1891
|
+
m: 1,
|
|
1892
|
+
d: 0
|
|
1893
|
+
};
|
|
1894
|
+
if (t === 60) return {
|
|
1895
|
+
y: 1900,
|
|
1896
|
+
m: 2,
|
|
1897
|
+
d: 29
|
|
1898
|
+
};
|
|
1899
|
+
let n = new Date(g(t));
|
|
1900
|
+
return {
|
|
1901
|
+
y: n.getUTCFullYear(),
|
|
1902
|
+
m: n.getUTCMonth() + 1,
|
|
1903
|
+
d: n.getUTCDate()
|
|
1904
|
+
};
|
|
1905
|
+
}
|
|
1906
|
+
var zn = Tn.months.map((e) => e.toLowerCase()), Bn = "([a-z]{3,})", Vn = (e, t) => t ? {
|
|
1907
|
+
...e,
|
|
1908
|
+
date: (n) => {
|
|
1909
|
+
let r = e.date(n);
|
|
1910
|
+
return r === null || r < t ? null : r - t;
|
|
1911
|
+
}
|
|
1912
|
+
} : e, Hn = /* @__PURE__ */ new Map();
|
|
1913
|
+
function Un(e) {
|
|
1914
|
+
let t = Hn.get(e);
|
|
1915
|
+
if (!t) {
|
|
1916
|
+
let n = `\\${e}`, r = "(\\d{1,2}|[1-9]\\d{2,3})", i = [
|
|
1917
|
+
[`${r} ?: ?(\\d+)(?: ?: ?(\\d+(?:${n}\\d+)?))? ([ap])m?`, (e) => [
|
|
1918
|
+
e[1],
|
|
1919
|
+
e[2],
|
|
1920
|
+
e[3],
|
|
1921
|
+
e[4]
|
|
1922
|
+
]],
|
|
1923
|
+
["(\\d{1,2}) ([ap])m?", (e) => [
|
|
1924
|
+
e[1],
|
|
1925
|
+
void 0,
|
|
1926
|
+
void 0,
|
|
1927
|
+
e[2]
|
|
1928
|
+
]],
|
|
1929
|
+
[`${r} ?:(?: ?(\\d+)(?: ?:(?: ?(\\d+(?:${n}\\d+)?) ?:?)?)?)?`, (e) => [
|
|
1930
|
+
e[1],
|
|
1931
|
+
e[2],
|
|
1932
|
+
e[3]
|
|
1933
|
+
]],
|
|
1934
|
+
[`(\\d+) ?: ?(\\d+${n}\\d+)`, (e) => [
|
|
1935
|
+
"0",
|
|
1936
|
+
e[1],
|
|
1937
|
+
e[2]
|
|
1938
|
+
]]
|
|
1939
|
+
], a = i.map(([e]) => e.replace(/\((?!\?)/g, "(?:")).join("|");
|
|
1940
|
+
t = {
|
|
1941
|
+
forms: i.map(([e, t]) => [RegExp(`^${e}$`), t]),
|
|
1942
|
+
dateTime: RegExp(`^(.*\\S) (${a})$`),
|
|
1943
|
+
timeDate: RegExp(`^(${a}) (.*\\S)$`)
|
|
1944
|
+
}, Hn.set(e, t);
|
|
1945
|
+
}
|
|
1946
|
+
return t;
|
|
1947
|
+
}
|
|
1948
|
+
var Wn = [
|
|
1949
|
+
[/^(\d{4}) *[-/] *(\d{1,2}) *[-/] *(\d{1,2})$/, (e) => [
|
|
1950
|
+
e[1],
|
|
1951
|
+
e[2],
|
|
1952
|
+
e[3]
|
|
1953
|
+
]],
|
|
1954
|
+
[/^(\d{1,2}) *[-/] *(\d{1,2}) *[-/] *(\d{4}|\d{1,2})$/, (e) => [
|
|
1955
|
+
e[3],
|
|
1956
|
+
e[1],
|
|
1957
|
+
e[2]
|
|
1958
|
+
]],
|
|
1959
|
+
[RegExp(`^(\\d{1,2})(?: *- *| )${Bn}(?: *- *| )(\\d{4}|\\d{2})$`), (e) => [
|
|
1960
|
+
e[3],
|
|
1961
|
+
e[2],
|
|
1962
|
+
e[1]
|
|
1963
|
+
]],
|
|
1964
|
+
[RegExp(`^${Bn} (\\d{1,2}), (\\d{4})$`), (e) => [
|
|
1965
|
+
e[3],
|
|
1966
|
+
e[1],
|
|
1967
|
+
e[2]
|
|
1968
|
+
]]
|
|
1969
|
+
], Gn = /^(\d{1,2}) *[-/] *(\d{1,4})$/, Kn = RegExp(`^${Bn} *[-/]? *(\\d{1,4})$`), qn = RegExp(`^(\\d{1,2}) *[-/]? *${Bn}$`), Jn = (e) => zn.findIndex((t) => t.startsWith(e)) + 1, W = (e) => e.length > 2 ? Number(e) : Number(e) + (Number(e) < 30 ? 2e3 : 1900);
|
|
1970
|
+
function G(e, t, n) {
|
|
1971
|
+
return e < 1900 || e > 9999 || t < 1 || t > 12 || n < 1 || n > Fn(e, t) ? null : Mn(e, t, n);
|
|
1972
|
+
}
|
|
1973
|
+
var Yn = (e, t) => e >= 1 && e <= 12 && t >= 1 && t <= Pn(2e3, e);
|
|
1974
|
+
function Xn(e, t, n) {
|
|
1975
|
+
if (e < 1 || e > 12 || t.length === 3) return null;
|
|
1976
|
+
let r = t.length <= 2 && Yn(e, Number(t));
|
|
1977
|
+
return r && !n ? null : (r ? G(n(), e, Number(t)) : null) ?? G(W(t), e, 1);
|
|
1978
|
+
}
|
|
1979
|
+
function Zn(e, t) {
|
|
1980
|
+
for (let [t, n] of Wn) {
|
|
1981
|
+
let r = t.exec(e);
|
|
1982
|
+
if (!r) continue;
|
|
1983
|
+
let [i, a, o] = n(r);
|
|
1984
|
+
return G(W(i), /^\d+$/.test(a) ? Number(a) : Jn(a), Number(o));
|
|
1985
|
+
}
|
|
1986
|
+
let n = Gn.exec(e);
|
|
1987
|
+
if (n) return Xn(Number(n[1]), n[2], t);
|
|
1988
|
+
if (n = Kn.exec(e)) return Xn(Jn(n[1]), n[2], t);
|
|
1989
|
+
if (n = qn.exec(e)) {
|
|
1990
|
+
let [e, r] = [Jn(n[2]), Number(n[1])];
|
|
1991
|
+
return t && Yn(e, r) ? G(t(), e, r) : null;
|
|
1992
|
+
}
|
|
1993
|
+
return null;
|
|
1994
|
+
}
|
|
1995
|
+
var Qn = (e) => ({
|
|
1996
|
+
date: (t) => Zn(t, e),
|
|
1997
|
+
decimal: "."
|
|
1998
|
+
}), $n = Qn(), er = 1e4 / 24;
|
|
1999
|
+
function tr(e, t) {
|
|
2000
|
+
for (let [n, r] of Un(t).forms) {
|
|
2001
|
+
let i = n.exec(e);
|
|
2002
|
+
if (!i) continue;
|
|
2003
|
+
let [a, o = "0", s = "0", c] = r(i), l = Number(a), u = Number(o), d = Number(s.replace(t, "."));
|
|
2004
|
+
if (u >= 1e4 || d >= 1e4) return null;
|
|
2005
|
+
if (c) {
|
|
2006
|
+
if (l > 12 || u > 59 || d >= 60) return null;
|
|
2007
|
+
l = l % 12 + (c === "p" ? 12 : 0);
|
|
2008
|
+
}
|
|
2009
|
+
let f = (l * 3600 + u * 60 + d) / 86400;
|
|
2010
|
+
return f < er ? f : null;
|
|
2011
|
+
}
|
|
2012
|
+
return null;
|
|
2013
|
+
}
|
|
2014
|
+
var nr = (e, t) => rr(e, t)?.value ?? null;
|
|
2015
|
+
function rr(e, t) {
|
|
2016
|
+
let n = e.replace(/ +$/, "").toLowerCase().replace(/ +/g, " ");
|
|
2017
|
+
if (n === "" || n.startsWith(" ")) return null;
|
|
2018
|
+
let r = tr(n, t.decimal);
|
|
2019
|
+
if (r !== null) return {
|
|
2020
|
+
value: r,
|
|
2021
|
+
date: null,
|
|
2022
|
+
time: n
|
|
2023
|
+
};
|
|
2024
|
+
let i = t.date(n);
|
|
2025
|
+
if (i !== null) return {
|
|
2026
|
+
value: i,
|
|
2027
|
+
date: n,
|
|
2028
|
+
time: null
|
|
2029
|
+
};
|
|
2030
|
+
let a = Un(t.decimal), o = (e, n) => {
|
|
2031
|
+
let [r, i] = [t.date(e), tr(n, t.decimal)];
|
|
2032
|
+
return r === null || i === null ? null : {
|
|
2033
|
+
value: r + i,
|
|
2034
|
+
date: e,
|
|
2035
|
+
time: n
|
|
2036
|
+
};
|
|
2037
|
+
}, s = a.dateTime.exec(n), c = s ? o(s[1], s[2]) : null;
|
|
2038
|
+
return c === null ? (s = a.timeDate.exec(n), s ? o(s[2], s[1]) : null) : c;
|
|
2039
|
+
}
|
|
2040
|
+
var ir = (e, t) => ({
|
|
2041
|
+
value: (n) => e(n) ?? nr(K(n), t),
|
|
2042
|
+
argument: (n) => e(n) ?? nr(n, t)
|
|
2043
|
+
}), ar = 1e308, or = /^((?!0+,)\d+(?:,\d{3,})*|)(\.\d*)?$/, K = (e) => e.replace(/^ +| +$/g, "");
|
|
2044
|
+
function sr(e) {
|
|
2045
|
+
let t = e, n = !1, r = !1;
|
|
2046
|
+
for (;;) {
|
|
2047
|
+
if (!n && t.startsWith("(") && t.endsWith(")")) [n, t] = [!0, t.slice(1, -1)];
|
|
2048
|
+
else if (!r && t.startsWith("%")) [r, t] = [!0, t.slice(1)];
|
|
2049
|
+
else if (!r && t.endsWith("%")) [r, t] = [!0, t.slice(0, -1)];
|
|
2050
|
+
else break;
|
|
2051
|
+
t = K(t);
|
|
2052
|
+
}
|
|
2053
|
+
return {
|
|
2054
|
+
s: t,
|
|
2055
|
+
paren: n,
|
|
2056
|
+
percent: r
|
|
2057
|
+
};
|
|
2058
|
+
}
|
|
2059
|
+
var cr = (e) => dr(e, !0), lr = (e) => dr(e, !1), ur = (e) => dr(e, !1, !1);
|
|
2060
|
+
function dr(e, t, n = !0) {
|
|
2061
|
+
let r = K(e);
|
|
2062
|
+
if (r === "") return null;
|
|
2063
|
+
let { s: i, paren: a, percent: o } = sr(r), s = t && i.endsWith("€"), c = (t ? /^([+-]?) *([$€]?) *([+-]?) *(.*)$/s : /^([+-]?) *(\$?) *([+-]?) *(.*)$/s).exec(s ? K(i.slice(0, -1)) : i);
|
|
2064
|
+
if (c[1] && c[3] || s && c[2]) return null;
|
|
2065
|
+
let l = (c[1] || c[3]) === "-";
|
|
2066
|
+
return a && l || (s || c[2]) && o ? null : fr(c[4], or, (e) => e.replace(/,/g, ""), o, n || c[2] !== "$" && !a, l || a);
|
|
2067
|
+
}
|
|
2068
|
+
function fr(e, t, n, r, i, a) {
|
|
2069
|
+
let o = /^(.*?)([eE][+-]?\d+)$/.exec(e), s = o ? o[1] : e, c = null;
|
|
2070
|
+
if (t.test(s) && /\d/.test(s)) c = f(n(s) + (o ? o[2] : ""), r ? -2 : 0);
|
|
2071
|
+
else if (i) {
|
|
2072
|
+
let t = /^(\d+) (\d+)\/(\d+)$/.exec(e);
|
|
2073
|
+
t && Number(t[3]) > 0 && (c = (Number(t[1]) + Number(t[2]) / Number(t[3])) / (r ? 100 : 1));
|
|
2074
|
+
}
|
|
2075
|
+
return c === null || !(Math.abs(c) < ar) ? null : a ? -c : c;
|
|
2076
|
+
}
|
|
2077
|
+
var pr = ir(cr, $n).argument, mr = ir(lr, $n).argument, hr = (e) => (t) => {
|
|
2078
|
+
let n = t.trim();
|
|
2079
|
+
if (!d.test(n)) return e(t);
|
|
2080
|
+
let r = f(n);
|
|
2081
|
+
return Math.abs(r) < ar ? r : null;
|
|
2082
|
+
};
|
|
2083
|
+
//#endregion
|
|
2084
|
+
//#region node_modules/xlcalc/dist/locale/rules/data.js
|
|
2085
|
+
function gr(e) {
|
|
2086
|
+
let t = {
|
|
2087
|
+
read: !1,
|
|
2088
|
+
year: () => (t.read = !0, e())
|
|
2089
|
+
};
|
|
2090
|
+
return t;
|
|
2091
|
+
}
|
|
2092
|
+
function _r(e, t) {
|
|
2093
|
+
if (!e) return [t(), !1];
|
|
2094
|
+
let n = e.read;
|
|
2095
|
+
e.read = !1;
|
|
2096
|
+
let r = t(), i = e.read;
|
|
2097
|
+
return e.read = n || i, [r, i];
|
|
2098
|
+
}
|
|
2099
|
+
//#endregion
|
|
2100
|
+
//#region node_modules/xlcalc/dist/functions/common.js
|
|
2101
|
+
function vr(e, t) {
|
|
2102
|
+
let [n, r] = e.toExponential().split("e");
|
|
2103
|
+
return Number(`${n}e${Number(r) + t}`);
|
|
2104
|
+
}
|
|
2105
|
+
function yr(e, t, n) {
|
|
2106
|
+
if (e === 0) return 0;
|
|
2107
|
+
let r = vr(Math.abs(e), t);
|
|
2108
|
+
return !Number.isFinite(r) || r >= 2 ** 53 ? e : Math.sign(e) * vr(n(r), -t);
|
|
2109
|
+
}
|
|
2110
|
+
//#endregion
|
|
2111
|
+
//#region node_modules/xlcalc/dist/numfmt/advances.js
|
|
2112
|
+
var br = [
|
|
2113
|
+
[452, "'"],
|
|
2114
|
+
[463, " "],
|
|
2115
|
+
[470, "ilìíîï"],
|
|
2116
|
+
[490, "j"],
|
|
2117
|
+
[504, "¹"],
|
|
2118
|
+
[511, ",‘’‚"],
|
|
2119
|
+
[516, "IÌÍÎÏ"],
|
|
2120
|
+
[517, ".·"],
|
|
2121
|
+
[548, ":;"],
|
|
2122
|
+
[596, "`"],
|
|
2123
|
+
[598, "´"],
|
|
2124
|
+
[621, "()"],
|
|
2125
|
+
[625, "f"],
|
|
2126
|
+
[627, "-"],
|
|
2127
|
+
[628, "[]"],
|
|
2128
|
+
[629, "¸"],
|
|
2129
|
+
[644, "{}"],
|
|
2130
|
+
[653, "J"],
|
|
2131
|
+
[667, "!¡"],
|
|
2132
|
+
[685, "³"],
|
|
2133
|
+
[686, "t"],
|
|
2134
|
+
[688, "²"],
|
|
2135
|
+
[694, "°"],
|
|
2136
|
+
[708, "г"],
|
|
2137
|
+
[714, "r"],
|
|
2138
|
+
[791, "/\\"],
|
|
2139
|
+
[793, "т"],
|
|
2140
|
+
[801, "s"],
|
|
2141
|
+
[804, "¨"],
|
|
2142
|
+
[807, "¯"],
|
|
2143
|
+
[809, "z"],
|
|
2144
|
+
[820, "″"],
|
|
2145
|
+
[821, "\""],
|
|
2146
|
+
[824, "ª"],
|
|
2147
|
+
[857, "“”„"],
|
|
2148
|
+
[861, "L"],
|
|
2149
|
+
[865, "º"],
|
|
2150
|
+
[866, "cçзс"],
|
|
2151
|
+
[880, "Г"],
|
|
2152
|
+
[887, "xх"],
|
|
2153
|
+
[907, "э"],
|
|
2154
|
+
[925, "v"],
|
|
2155
|
+
[927, "yýÿу"],
|
|
2156
|
+
[931, "k"],
|
|
2157
|
+
[941, "FS"],
|
|
2158
|
+
[943, "|"],
|
|
2159
|
+
[949, "?¿"],
|
|
2160
|
+
[950, "к"],
|
|
2161
|
+
[959, "Z"],
|
|
2162
|
+
[960, "ч"],
|
|
2163
|
+
[962, "ь"],
|
|
2164
|
+
[964, "g"],
|
|
2165
|
+
[970, "З"],
|
|
2166
|
+
[971, "я"],
|
|
2167
|
+
[981, "aàáâãäåав"],
|
|
2168
|
+
[998, "TYÝТ"],
|
|
2169
|
+
[1e3, "EÈÉÊËЕЁ"],
|
|
2170
|
+
[1019, "eèéêëеё"],
|
|
2171
|
+
[1020, "#*+<=>^_~¢¤¦§¬±×÷–•"],
|
|
2172
|
+
[1038, "$0123456789£¥®€"],
|
|
2173
|
+
[1045, "л"],
|
|
2174
|
+
[1049, "«»"],
|
|
2175
|
+
[1058, "PÞР"],
|
|
2176
|
+
[1063, "XХ"],
|
|
2177
|
+
[1064, "K"],
|
|
2178
|
+
[1066, "п"],
|
|
2179
|
+
[1076, "bdhnpquðñùúûüþр"],
|
|
2180
|
+
[1080, "oßòóôõöУо"],
|
|
2181
|
+
[1084, "ø"],
|
|
2182
|
+
[1088, "Ь"],
|
|
2183
|
+
[1091, "б"],
|
|
2184
|
+
[1092, "CÇС"],
|
|
2185
|
+
[1095, "н"],
|
|
2186
|
+
[1098, "ъ"],
|
|
2187
|
+
[1101, "Б"],
|
|
2188
|
+
[1107, "ий"],
|
|
2189
|
+
[1109, "ц"],
|
|
2190
|
+
[1112, "RК"],
|
|
2191
|
+
[1114, "BВ"],
|
|
2192
|
+
[1122, "Э"],
|
|
2193
|
+
[1126, "µ"],
|
|
2194
|
+
[1137, "Я"],
|
|
2195
|
+
[1138, "Ч"],
|
|
2196
|
+
[1143, "д"],
|
|
2197
|
+
[1162, "V"],
|
|
2198
|
+
[1185, "AÀÁÂÃÄÅА"],
|
|
2199
|
+
[1200, "¶"],
|
|
2200
|
+
[1251, "Л"],
|
|
2201
|
+
[1259, "Ъ"],
|
|
2202
|
+
[1260, "D"],
|
|
2203
|
+
[1273, "П"],
|
|
2204
|
+
[1276, "HН"],
|
|
2205
|
+
[1278, "ф"],
|
|
2206
|
+
[1279, "Ð"],
|
|
2207
|
+
[1292, "G"],
|
|
2208
|
+
[1303, "¼"],
|
|
2209
|
+
[1308, "Ц"],
|
|
2210
|
+
[1314, "UÙÚÛÜИЙ"],
|
|
2211
|
+
[1319, "Д"],
|
|
2212
|
+
[1322, "NÑ"],
|
|
2213
|
+
[1356, "OÒÓÔÕÖО"],
|
|
2214
|
+
[1359, "Ø"],
|
|
2215
|
+
[1364, "ы"],
|
|
2216
|
+
[1375, "½"],
|
|
2217
|
+
[1378, "Q"],
|
|
2218
|
+
[1383, "¾"],
|
|
2219
|
+
[1385, "м"],
|
|
2220
|
+
[1397, "&"],
|
|
2221
|
+
[1411, "ж"],
|
|
2222
|
+
[1414, "…"],
|
|
2223
|
+
[1428, "Ф"],
|
|
2224
|
+
[1464, "%w"],
|
|
2225
|
+
[1478, "ю"],
|
|
2226
|
+
[1492, "ш"],
|
|
2227
|
+
[1534, "щ"],
|
|
2228
|
+
[1560, "Ы"],
|
|
2229
|
+
[1563, "Æ"],
|
|
2230
|
+
[1583, "æ"],
|
|
2231
|
+
[1636, "m"],
|
|
2232
|
+
[1640, "Ж"],
|
|
2233
|
+
[1709, "©"],
|
|
2234
|
+
[1751, "MМ"],
|
|
2235
|
+
[1778, "Ш"],
|
|
2236
|
+
[1800, "Ю"],
|
|
2237
|
+
[1822, "WЩ"],
|
|
2238
|
+
[1831, "@"],
|
|
2239
|
+
[1854, "—"],
|
|
2240
|
+
[2099, "№"],
|
|
2241
|
+
[2126, "‰"]
|
|
2242
|
+
], xr = [
|
|
2243
|
+
[1038, "₽"],
|
|
2244
|
+
[463, "\xA0"],
|
|
2245
|
+
[627, ""],
|
|
2246
|
+
[452, "′"]
|
|
2247
|
+
], Sr = new Map([...br, ...xr].flatMap(([e, t]) => [...t].map((t) => [t, e]))), Cr = (e) => Sr.get(e) ?? 1038, wr = [
|
|
2248
|
+
[2, " '"],
|
|
2249
|
+
[3, ".,-():{}fijlI"],
|
|
2250
|
+
[4, "/!rstzJ"],
|
|
2251
|
+
[5, "+#^~<>=?_acegkvxyEFLSTYZ"],
|
|
2252
|
+
[6, "0123456789$€£¥bdhnopquABCKPRVX"],
|
|
2253
|
+
[7, "DGHNOQU"],
|
|
2254
|
+
[8, "%&w"],
|
|
2255
|
+
[9, "mM"],
|
|
2256
|
+
[10, "W"]
|
|
2257
|
+
], Tr = [
|
|
2258
|
+
[4, "гт"],
|
|
2259
|
+
[5, "авеёзксучхьэяГЕЁЗТ"],
|
|
2260
|
+
[6, "₽бдийлнпрцъАБВКРСУХЧЬЭЯ"],
|
|
2261
|
+
[7, "мфыДИЙЛНОПЦЪ"],
|
|
2262
|
+
[8, "жшщюФЫ"],
|
|
2263
|
+
[9, "ЖМ"],
|
|
2264
|
+
[10, "ШЩЮ"]
|
|
2265
|
+
], Er = new Map([...wr, ...Tr].flatMap(([e, t]) => [...t].map((t) => [t, e]))), Dr = (e) => Er.get(e) ?? 6;
|
|
2266
|
+
function Or(e) {
|
|
2267
|
+
let t = 0;
|
|
2268
|
+
for (let n of e) t += Dr(n);
|
|
2269
|
+
return t;
|
|
2270
|
+
}
|
|
2271
|
+
var kr = (e) => e - 5;
|
|
2272
|
+
function Ar(e, t) {
|
|
2273
|
+
let n = 0, r = "";
|
|
2274
|
+
for (let i of e) r ? n += r === "" ? t(i) : 0 : i !== "" && i !== "" && (n += t(i === " " ? "0" : i)), r = !r && (i === "" || i === "") ? i : "";
|
|
2275
|
+
return n;
|
|
2276
|
+
}
|
|
2277
|
+
var jr = /^[\x20-\x7e\uFFFE\uFFFF\u2007]*$/;
|
|
2278
|
+
function Mr(e) {
|
|
2279
|
+
if (jr.test(e)) {
|
|
2280
|
+
let t = Ar(e, Dr);
|
|
2281
|
+
return Math.max(t + 7, Math.floor(t * 31 / 30) + 5);
|
|
2282
|
+
}
|
|
2283
|
+
let t = Ar(e, Cr);
|
|
2284
|
+
return Math.max(Math.floor((t * 11 + 1024) / 2048) + 7, Math.floor(t * 11 * 31 / 61440) + 5);
|
|
2285
|
+
}
|
|
2286
|
+
var Nr = (e, t = !1) => "#".repeat(Math.min(255, Math.max(+!!t, Math.floor(e / 5))));
|
|
2287
|
+
//#endregion
|
|
2288
|
+
//#region node_modules/xlcalc/dist/numfmt/general.js
|
|
2289
|
+
function q(e, t) {
|
|
2290
|
+
return yr(e, t, Math.round).toFixed(t);
|
|
2291
|
+
}
|
|
2292
|
+
function Pr(e, t) {
|
|
2293
|
+
if (e < 1e21) return q(e, t);
|
|
2294
|
+
let [n, r] = e.toExponential(14).split("e");
|
|
2295
|
+
return n.replace(".", "").padEnd(Number(r) + 1, "0") + (t ? "." + "0".repeat(t) : "");
|
|
2296
|
+
}
|
|
2297
|
+
var Fr = (e) => e.includes(".") ? e.replace(/\.?0+$/, "") : e, Ir = (e) => `E${e < 0 ? "-" : "+"}${String(Math.abs(e)).padStart(2, "0")}`, Lr = (e) => Number(e.toExponential(14).split("e")[1]);
|
|
2298
|
+
function Rr(e, t) {
|
|
2299
|
+
let [n, r] = e.toExponential(14).split("e"), i = Number(r), a = q(Number(n), t);
|
|
2300
|
+
return Number(a) >= 10 && ([i, a] = [i + 1, q(Number(a) / 10, t)]), Fr(a) + Ir(i);
|
|
2301
|
+
}
|
|
2302
|
+
function zr(e, t = 20) {
|
|
2303
|
+
if (e === 0) return "0";
|
|
2304
|
+
let [n, r] = Math.abs(e).toExponential(14).split("e"), i = Number(r), a = n.replace(".", "").replace(/0+$/, ""), o = i < 0 ? `0.${"0".repeat(-i - 1)}${a}` : a.length <= i + 1 ? a.padEnd(i + 1, "0") : `${a.slice(0, i + 1)}.${a.slice(i + 1)}`, s = o.length <= t ? o : `${a[0]}${a.length > 1 ? "." + a.slice(1) : ""}${Ir(i)}`;
|
|
2305
|
+
return e < 0 ? "-" + s : s;
|
|
2306
|
+
}
|
|
2307
|
+
function Br(e) {
|
|
2308
|
+
if (e === 0) return "0";
|
|
2309
|
+
let t = Math.abs(e), n = String(t);
|
|
2310
|
+
if (n.length <= 11 && !n.includes("e")) return e < 0 ? "-" + n : n;
|
|
2311
|
+
let [r, i] = t.toExponential(14).split("e"), a = Number(i), o = r.replace(".", "").replace(/0+$/, "").length, s = 8 - Math.max(2, String(Math.abs(a)).length), c = a >= 0 ? a < 11 ? Math.max(10, a + 1) : 0 : 10 + a, l = null;
|
|
2312
|
+
if (c > 0 && (o <= c || c >= s)) {
|
|
2313
|
+
let e = Fr(q(t, a >= 0 ? Math.max(0, 9 - a) : 9));
|
|
2314
|
+
e.length <= 11 && (l = e);
|
|
2315
|
+
}
|
|
2316
|
+
if (l === null) {
|
|
2317
|
+
let [e, n] = t.toExponential(s - 1).split("e");
|
|
2318
|
+
l = Fr(e) + Ir(Number(n));
|
|
2319
|
+
}
|
|
2320
|
+
return e < 0 ? "-" + l : l;
|
|
2321
|
+
}
|
|
2322
|
+
function Vr(e, t) {
|
|
2323
|
+
if (e === 0) return "0";
|
|
2324
|
+
let n = e < 0, r = Math.abs(e), i = n ? "-" : "", a = Math.floor((t - (n ? Dr("-") : 0)) / 6), o = Br(r);
|
|
2325
|
+
if (o.length <= a) return i + o;
|
|
2326
|
+
let s = Lr(r), c = s >= -4 && s <= 10;
|
|
2327
|
+
if (c) for (let e = Math.max(0, Math.min(9, a - Math.max(1, s + 1) - 1)); e >= 0; e--) {
|
|
2328
|
+
if (e > 0 && r < 10 ** -e) continue;
|
|
2329
|
+
let t = Fr(q(r, e));
|
|
2330
|
+
if (t !== "0" && t.length <= a) return i + t;
|
|
2331
|
+
}
|
|
2332
|
+
for (let e = 5; e >= 0; e--) {
|
|
2333
|
+
let t = Rr(r, e);
|
|
2334
|
+
if (t.length <= a) return i + t;
|
|
2335
|
+
}
|
|
2336
|
+
let l = q(r, 0);
|
|
2337
|
+
if (l === "0" && a >= 1 && a < 5) return i + l;
|
|
2338
|
+
if (!n && c && a < 1 && l.length === 1) return l;
|
|
2339
|
+
let u = i + Rr(r, 0);
|
|
2340
|
+
return (l.length > 5 || s < -4) && Or(u) <= t ? u : Nr(t, !0);
|
|
2341
|
+
}
|
|
2342
|
+
//#endregion
|
|
2343
|
+
//#region node_modules/xlcalc/dist/values.js
|
|
2344
|
+
var J = class {
|
|
2345
|
+
code;
|
|
2346
|
+
constructor(e) {
|
|
2347
|
+
this.code = e;
|
|
2348
|
+
}
|
|
2349
|
+
}, Hr = {
|
|
2350
|
+
DIV0: new J("DIV0"),
|
|
2351
|
+
NA: new J("NA"),
|
|
2352
|
+
NAME: new J("NAME"),
|
|
2353
|
+
NUM: new J("NUM"),
|
|
2354
|
+
REF: new J("REF"),
|
|
2355
|
+
VALUE: new J("VALUE"),
|
|
2356
|
+
NULL: new J("NULL"),
|
|
2357
|
+
CYCLE: new J("CYCLE"),
|
|
2358
|
+
SPILL: new J("SPILL"),
|
|
2359
|
+
CALC: new J("CALC"),
|
|
2360
|
+
ERROR: new J("ERROR")
|
|
2361
|
+
}, Ur = (e) => e instanceof J;
|
|
2362
|
+
function Wr(e, t, n) {
|
|
2363
|
+
let r = D(t.TRUE), i = D(t.FALSE);
|
|
2364
|
+
return {
|
|
2365
|
+
toNum(t) {
|
|
2366
|
+
return typeof t == "number" ? t : t === null ? 0 : typeof t == "boolean" ? +!!t : Ur(t) ? t : e(t) ?? Hr.VALUE;
|
|
2367
|
+
},
|
|
2368
|
+
toText(e) {
|
|
2369
|
+
return typeof e == "string" ? e : e === null ? "" : typeof e == "boolean" ? e ? t.TRUE : t.FALSE : Ur(e) ? e : n(e);
|
|
2370
|
+
},
|
|
2371
|
+
toBool(e) {
|
|
2372
|
+
if (typeof e == "boolean") return e;
|
|
2373
|
+
if (typeof e == "number") return e !== 0;
|
|
2374
|
+
if (e === null) return !1;
|
|
2375
|
+
if (Ur(e)) return e;
|
|
2376
|
+
let t = D(e);
|
|
2377
|
+
return t === r || t !== i && Hr.VALUE;
|
|
2378
|
+
}
|
|
2379
|
+
};
|
|
2380
|
+
}
|
|
2381
|
+
var { toNum: Gr, toText: Kr, toBool: qr } = Wr(hr(pr), {
|
|
2382
|
+
TRUE: "TRUE",
|
|
2383
|
+
FALSE: "FALSE"
|
|
2384
|
+
}, zr), Jr = (e) => typeof e == "number" ? 0 : typeof e == "string" ? 1 : 2;
|
|
2385
|
+
function Yr(e) {
|
|
2386
|
+
return (t, n) => {
|
|
2387
|
+
t === null && (t = typeof n == "string" ? "" : typeof n != "boolean" && 0), n === null && (n = typeof t == "string" ? "" : typeof t != "boolean" && 0);
|
|
2388
|
+
let r = Jr(t), i = Jr(n);
|
|
2389
|
+
return r === i ? typeof t == "string" ? e(t, n) : t < n ? -1 : +(t > n) : r - i;
|
|
2390
|
+
};
|
|
2391
|
+
}
|
|
2392
|
+
var Xr = Yr(ue.compare);
|
|
2393
|
+
function Zr(e) {
|
|
2394
|
+
return Number.isInteger(e) && Math.abs(e) < 0x38d7ea4c68000 || Math.abs(e) < 0x9184e72a000 && Math.round(e * 100) / 100 === e ? e : Number(e.toPrecision(15));
|
|
2395
|
+
}
|
|
2396
|
+
var Qr = (e) => (t, n) => e(typeof t == "number" ? Zr(t) : t, typeof n == "number" ? Zr(n) : n), $r = Qr(Xr), ei = {
|
|
2397
|
+
"#NULL!": ["NULL", 1],
|
|
2398
|
+
"#DIV/0!": ["DIV0", 2],
|
|
2399
|
+
"#VALUE!": ["VALUE", 3],
|
|
2400
|
+
"#REF!": ["REF", 4],
|
|
2401
|
+
"#NAME?": ["NAME", 5],
|
|
2402
|
+
"#NUM!": ["NUM", 6],
|
|
2403
|
+
"#N/A": ["NA", 7],
|
|
2404
|
+
"#SPILL!": ["SPILL", 9],
|
|
2405
|
+
"#CALC!": ["CALC", 14]
|
|
2406
|
+
};
|
|
2407
|
+
({ ...Object.fromEntries(Object.values(ei)) });
|
|
2408
|
+
function ti(e) {
|
|
2409
|
+
let t = new Map(Object.entries(ei).map(([t, [n]]) => [(e[t] ?? t).toUpperCase(), n]));
|
|
2410
|
+
return (e) => t.get(e.toUpperCase());
|
|
2411
|
+
}
|
|
2412
|
+
var ni = {
|
|
2413
|
+
critNumber: mr,
|
|
2414
|
+
critBool: (e) => /^(TRUE|FALSE)$/i.test(e) ? e.toUpperCase() === "TRUE" : null,
|
|
2415
|
+
cellNumber: (e) => /\d/.test(e) ? pr(e) : null,
|
|
2416
|
+
compareText: ue.compare,
|
|
2417
|
+
critError: ti({})
|
|
2418
|
+
}, Y = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), ri = {
|
|
2419
|
+
decimal: ".",
|
|
2420
|
+
list: ",",
|
|
2421
|
+
arrayColumn: ",",
|
|
2422
|
+
arrayRow: ";"
|
|
2423
|
+
}, ii = new RegExp(dt, "uy"), ai = (e) => new RegExp(ct(Y(e.decimal)), "y");
|
|
2424
|
+
function oi(e, t, n, r) {
|
|
2425
|
+
let i = "", a = 0, o = e.slice(1).trimStart().startsWith("[");
|
|
2426
|
+
for (let s = 0; s < e.length; s++) {
|
|
2427
|
+
let c = e[s];
|
|
2428
|
+
if (c === "'") i += e.slice(s, s + 2), s++;
|
|
2429
|
+
else {
|
|
2430
|
+
if (c === "[") a++;
|
|
2431
|
+
else if (c === "]") a--;
|
|
2432
|
+
else if (c === n && a === 1 && o) {
|
|
2433
|
+
i += r;
|
|
2434
|
+
continue;
|
|
2435
|
+
} else if (c === "#" && e[s - 1] === "[") {
|
|
2436
|
+
let n = e.indexOf("]", s), r = e.slice(s, n < 0 ? e.length : n);
|
|
2437
|
+
i += t.get(D(r)) ?? r, s += r.length - 1;
|
|
2438
|
+
continue;
|
|
2439
|
+
}
|
|
2440
|
+
i += c;
|
|
2441
|
+
}
|
|
2442
|
+
}
|
|
2443
|
+
return i;
|
|
2444
|
+
}
|
|
2445
|
+
function si(e, t, n, r) {
|
|
2446
|
+
let i = [], a = 0, o = 0, s = (t, n) => {
|
|
2447
|
+
i.push({
|
|
2448
|
+
k: t,
|
|
2449
|
+
at: o,
|
|
2450
|
+
text: e.slice(o, o + n),
|
|
2451
|
+
arr: a > 0
|
|
2452
|
+
}), o += n;
|
|
2453
|
+
};
|
|
2454
|
+
for (; o < e.length;) {
|
|
2455
|
+
let c = e[o];
|
|
2456
|
+
if (c === "\"" || c === "'") {
|
|
2457
|
+
let t = it(e, o);
|
|
2458
|
+
if (t < 0) return {
|
|
2459
|
+
at: o,
|
|
2460
|
+
msg: { key: c === "\"" ? "unterminatedString" : "unterminatedSheet" }
|
|
2461
|
+
};
|
|
2462
|
+
s("raw", t + 1 - o + +(c === "'" && e[t + 1] === "!"));
|
|
2463
|
+
continue;
|
|
2464
|
+
}
|
|
2465
|
+
if (c === "#") {
|
|
2466
|
+
let t = D(e.slice(o)), r = n.find((e) => t.startsWith(D(e)));
|
|
2467
|
+
if (r) {
|
|
2468
|
+
s("err", r.length);
|
|
2469
|
+
continue;
|
|
2470
|
+
}
|
|
2471
|
+
}
|
|
2472
|
+
if (c === "[" && a === 0) {
|
|
2473
|
+
let t = at(e, o);
|
|
2474
|
+
s(ot.test(e.slice(t)) ? "raw" : "tbl", t - o);
|
|
2475
|
+
continue;
|
|
2476
|
+
}
|
|
2477
|
+
if (c === "{" && a++, c === "}" && a > 0) {
|
|
2478
|
+
a--, i.push({
|
|
2479
|
+
k: "raw",
|
|
2480
|
+
at: o++,
|
|
2481
|
+
text: c,
|
|
2482
|
+
arr: !0
|
|
2483
|
+
});
|
|
2484
|
+
continue;
|
|
2485
|
+
}
|
|
2486
|
+
if (a > 0 ? c === t.arrayColumn || c === t.arrayRow : c === t.list) {
|
|
2487
|
+
s(a === 0 ? "list" : c === t.arrayColumn ? "col" : "row", 1);
|
|
2488
|
+
continue;
|
|
2489
|
+
}
|
|
2490
|
+
r.lastIndex = o;
|
|
2491
|
+
let l = r.exec(e);
|
|
2492
|
+
if (l) {
|
|
2493
|
+
s("num", l[0].length);
|
|
2494
|
+
continue;
|
|
2495
|
+
}
|
|
2496
|
+
ii.lastIndex = o;
|
|
2497
|
+
let u = ii.exec(e);
|
|
2498
|
+
if (u) {
|
|
2499
|
+
a > 0 && (u[0] = u[0].split(t.arrayColumn)[0].split(t.arrayRow)[0]);
|
|
2500
|
+
let n = o + u[0].length;
|
|
2501
|
+
if (e[n] === "!") {
|
|
2502
|
+
s("raw", u[0].length + 1);
|
|
2503
|
+
continue;
|
|
2504
|
+
}
|
|
2505
|
+
s(st(e, n) ? "fn" : "word", u[0].length);
|
|
2506
|
+
} else s("raw", 1);
|
|
2507
|
+
}
|
|
2508
|
+
return i;
|
|
2509
|
+
}
|
|
2510
|
+
//#endregion
|
|
2511
|
+
//#region node_modules/xlcalc/dist/locale/translate.js
|
|
2512
|
+
var X = (e) => new Map(e.map(([e, t]) => [D(e), t])), ci = (e) => [...new Set(e)].sort((e, t) => t.length - e.length), li = (e) => e.map(([e, t]) => [t, e]), ui = (e) => e.map((e) => [e, e]);
|
|
2513
|
+
function di(e) {
|
|
2514
|
+
let t = {
|
|
2515
|
+
decimal: e.decimalSeparator,
|
|
2516
|
+
list: e.listSeparator,
|
|
2517
|
+
arrayColumn: e.arrayColumnSeparator,
|
|
2518
|
+
arrayRow: e.arrayRowSeparator
|
|
2519
|
+
}, n = T.map((t) => [t, e.errors[t] ?? t]), r = [["TRUE", e.booleans.TRUE], ["FALSE", e.booleans.FALSE]], i = Object.entries(e.functions), a = Ne.map((t) => [t, e.tableItems?.[t] ?? t]);
|
|
2520
|
+
return {
|
|
2521
|
+
invariant: {
|
|
2522
|
+
syn: ri,
|
|
2523
|
+
num: ai(ri),
|
|
2524
|
+
errors: ci(T),
|
|
2525
|
+
fn: X(i),
|
|
2526
|
+
word: X(r),
|
|
2527
|
+
err: X(n),
|
|
2528
|
+
item: X(a)
|
|
2529
|
+
},
|
|
2530
|
+
local: {
|
|
2531
|
+
tag: e.tag,
|
|
2532
|
+
syn: t,
|
|
2533
|
+
num: ai(t),
|
|
2534
|
+
errors: ci([...n.map((e) => e[1]), ...T]),
|
|
2535
|
+
fn: X(li(i)),
|
|
2536
|
+
word: X([...ui(["TRUE", "FALSE"]), ...li(r)]),
|
|
2537
|
+
err: X([...ui(T), ...li(n)]),
|
|
2538
|
+
item: X([...ui(Ne), ...li(a)]),
|
|
2539
|
+
sheet: (t) => Sn(t, e)
|
|
2540
|
+
}
|
|
2541
|
+
};
|
|
2542
|
+
}
|
|
2543
|
+
var fi = (e, t) => ({
|
|
2544
|
+
ok: !1,
|
|
2545
|
+
msg: t,
|
|
2546
|
+
at: e
|
|
2547
|
+
}), pi = (e, t) => e.length > 2 && e.startsWith("'") && e.endsWith("'") && t.word.has(D(e.slice(1, -1)));
|
|
2548
|
+
function mi(e, t) {
|
|
2549
|
+
let n = (e.startsWith("'") ? e.slice(1, -2).replaceAll("''", "'") : e.slice(0, -1)).split(":");
|
|
2550
|
+
return n.length === 1 ? `${t(n[0])}!` : n.length === 2 && n.every((e) => t(e) === e) ? `${n.join(":")}!` : e;
|
|
2551
|
+
}
|
|
2552
|
+
var hi = (e, t) => {
|
|
2553
|
+
let { k: n, text: r } = e[t], i = e[t - 1]?.text;
|
|
2554
|
+
return n === "raw" && r.length > 1 && r.endsWith("!") && r[0] !== "\"" && i !== ":" && !i?.endsWith("]");
|
|
2555
|
+
};
|
|
2556
|
+
function gi(e, t, n, r = 0) {
|
|
2557
|
+
let i = si(e, t.syn, t.errors, t.num);
|
|
2558
|
+
if (!Array.isArray(i)) return fi(r + i.at, i.msg);
|
|
2559
|
+
let a = [/* @__PURE__ */ new Set([n.syn.decimal, n.syn.list]), /* @__PURE__ */ new Set([
|
|
2560
|
+
n.syn.decimal,
|
|
2561
|
+
n.syn.arrayColumn,
|
|
2562
|
+
n.syn.arrayRow
|
|
2563
|
+
])], o = [];
|
|
2564
|
+
for (let [e, s] of i.entries()) {
|
|
2565
|
+
let c = s.text;
|
|
2566
|
+
if (s.k === "num") c = c.replace(t.syn.decimal, n.syn.decimal);
|
|
2567
|
+
else if (s.k === "fn") c = t.fn.get(D(c)) ?? c;
|
|
2568
|
+
else if (s.k === "err") c = t.err.get(D(c)) ?? c;
|
|
2569
|
+
else if (s.k === "list") c = n.syn.list;
|
|
2570
|
+
else if (s.k === "tbl") c = oi(c, t.item, t.syn.list, n.syn.list);
|
|
2571
|
+
else if (s.k === "col") c = n.syn.arrayColumn;
|
|
2572
|
+
else if (s.k === "row") c = n.syn.arrayRow;
|
|
2573
|
+
else if (s.k === "word") {
|
|
2574
|
+
let a = t.word.get(D(c));
|
|
2575
|
+
if (a === void 0 && s.arr) return fi(r + s.at, {
|
|
2576
|
+
key: "unexpectedInArray",
|
|
2577
|
+
text: c
|
|
2578
|
+
});
|
|
2579
|
+
if (a === void 0 && n.word.has(D(c)) && i[e + 1]?.k !== "tbl") {
|
|
2580
|
+
o.push({
|
|
2581
|
+
...s,
|
|
2582
|
+
k: "raw",
|
|
2583
|
+
text: `'${c}'`
|
|
2584
|
+
});
|
|
2585
|
+
continue;
|
|
2586
|
+
}
|
|
2587
|
+
c = a ?? c;
|
|
2588
|
+
} else if (s.k === "raw" && pi(c, t) && !n.word.has(D(c.slice(1, -1)))) {
|
|
2589
|
+
o.push({
|
|
2590
|
+
...s,
|
|
2591
|
+
k: "word",
|
|
2592
|
+
text: c.slice(1, -1)
|
|
2593
|
+
});
|
|
2594
|
+
continue;
|
|
2595
|
+
} else if (a[+!!s.arr].has(c)) return fi(r + s.at, {
|
|
2596
|
+
key: "unexpectedText",
|
|
2597
|
+
text: c
|
|
2598
|
+
});
|
|
2599
|
+
o.push({
|
|
2600
|
+
...s,
|
|
2601
|
+
text: c
|
|
2602
|
+
});
|
|
2603
|
+
}
|
|
2604
|
+
let s = si(o.map((e) => e.text).join(""), n.syn, n.errors, n.num), c = Array.isArray(s) ? s : [], l = o.findIndex((e, t) => c[t]?.k !== e.k || c[t].text !== e.text);
|
|
2605
|
+
if (l >= 0 || c.length !== o.length) {
|
|
2606
|
+
let e = i[l >= 0 ? l : o.length - 1];
|
|
2607
|
+
return fi(r + e.at, {
|
|
2608
|
+
key: "notWritable",
|
|
2609
|
+
text: e.text,
|
|
2610
|
+
...n.tag === void 0 ? {} : { tag: n.tag }
|
|
2611
|
+
});
|
|
2612
|
+
}
|
|
2613
|
+
let u = n.sheet;
|
|
2614
|
+
if (u) for (let e = 0; e < o.length; e++) hi(o, e) && (o[e] = {
|
|
2615
|
+
...o[e],
|
|
2616
|
+
text: mi(o[e].text, u)
|
|
2617
|
+
});
|
|
2618
|
+
let d = o.map((e) => e.text).join(""), f = [], p = 0;
|
|
2619
|
+
for (let e of o) f.push(p), p += e.text.length;
|
|
2620
|
+
return {
|
|
2621
|
+
ok: !0,
|
|
2622
|
+
formula: d,
|
|
2623
|
+
back: (t) => {
|
|
2624
|
+
if (t >= d.length) return r + e.length;
|
|
2625
|
+
let n = 0, a = o.length - 1;
|
|
2626
|
+
for (; n < a;) {
|
|
2627
|
+
let e = n + a + 1 >> 1;
|
|
2628
|
+
f[e] <= t ? n = e : a = e - 1;
|
|
2629
|
+
}
|
|
2630
|
+
let s = i[n];
|
|
2631
|
+
return r + s.at + (s.text.length === o[n].text.length ? t - f[n] : 0);
|
|
2632
|
+
}
|
|
2633
|
+
};
|
|
2634
|
+
}
|
|
2635
|
+
//#endregion
|
|
2636
|
+
//#region node_modules/xlcalc/dist/locale/index.js
|
|
2637
|
+
var _i = /* @__PURE__ */ new WeakMap();
|
|
2638
|
+
function vi(e) {
|
|
2639
|
+
let t = _i.get(e);
|
|
2640
|
+
return t || _i.set(e, t = di(e)), t;
|
|
2641
|
+
}
|
|
2642
|
+
function yi(e) {
|
|
2643
|
+
let t = Qe(e, "locale");
|
|
2644
|
+
return [t, vi(t)];
|
|
2645
|
+
}
|
|
2646
|
+
var bi = (e, t) => ({
|
|
2647
|
+
ok: !1,
|
|
2648
|
+
code: "syntax",
|
|
2649
|
+
message: Me(t, e.msg),
|
|
2650
|
+
at: e.at
|
|
2651
|
+
});
|
|
2652
|
+
function xi(e) {
|
|
2653
|
+
if (e === void 0) return {};
|
|
2654
|
+
let t = O(e, "opts", "options such as { table: 'Sales' }");
|
|
2655
|
+
return Te(t, "opts", ["table", "externalBooks"]), t.table !== void 0 && k(t.table, "opts.table"), t.externalBooks !== void 0 && fn(t.externalBooks, "opts.externalBooks", !1), t;
|
|
2656
|
+
}
|
|
2657
|
+
var Si = (e, t) => e.includes("[") ? Jt(e, (e, n) => e.t === "table" ? t(e, n) : void 0) : e;
|
|
2658
|
+
function Ci(e, t, n) {
|
|
2659
|
+
let [r, i] = yi(t), { table: a, externalBooks: o } = xi(n), s = +!!k(e, "text").startsWith("="), c = gi(e.slice(s), i.local, i.invariant, s);
|
|
2660
|
+
if (!c.ok) return bi(c, r);
|
|
2661
|
+
let l = a === void 0 ? c.formula : Si(c.formula, (e, t) => e.table === null ? a + t : t);
|
|
2662
|
+
if (!o) return {
|
|
2663
|
+
ok: !0,
|
|
2664
|
+
formula: l
|
|
2665
|
+
};
|
|
2666
|
+
let u = Yt(l, o);
|
|
2667
|
+
return u.ok ? u : {
|
|
2668
|
+
ok: !1,
|
|
2669
|
+
code: "external_ref",
|
|
2670
|
+
message: Me(r, u.message),
|
|
2671
|
+
at: c.back(u.at)
|
|
2672
|
+
};
|
|
2673
|
+
}
|
|
2674
|
+
var wi = (e, t, n) => Ti(e, yi(t), n);
|
|
2675
|
+
function Ti(e, [t, n], r) {
|
|
2676
|
+
let i = +!!e.startsWith("="), a = gi(e.slice(i), n.local, n.invariant, i);
|
|
2677
|
+
if (!a.ok) return bi(a, t);
|
|
2678
|
+
let o = Qt(a.formula, {
|
|
2679
|
+
...r,
|
|
2680
|
+
say: (e) => Me(t, e)
|
|
2681
|
+
});
|
|
2682
|
+
if (!o.ok) return {
|
|
2683
|
+
...o,
|
|
2684
|
+
at: a.back(o.at)
|
|
2685
|
+
};
|
|
2686
|
+
let { ast: s, ...c } = o;
|
|
2687
|
+
return c;
|
|
2688
|
+
}
|
|
2689
|
+
//#endregion
|
|
2690
|
+
//#region node_modules/xlcalc/dist/numfmt/hijri.js
|
|
2691
|
+
var Ei = [
|
|
2692
|
+
"محرم",
|
|
2693
|
+
"صفر",
|
|
2694
|
+
"ربيع\xA0الأول",
|
|
2695
|
+
"ربيع\xA0الثاني",
|
|
2696
|
+
"جمادى\xA0الأولى",
|
|
2697
|
+
"جمادى\xA0الثانية",
|
|
2698
|
+
"رجب",
|
|
2699
|
+
"شعبان",
|
|
2700
|
+
"رمضان",
|
|
2701
|
+
"شوال",
|
|
2702
|
+
"ذو\xA0القعدة",
|
|
2703
|
+
"ذو\xA0الحجة"
|
|
2704
|
+
], Di = [
|
|
2705
|
+
"الأحد",
|
|
2706
|
+
"الإثنين",
|
|
2707
|
+
"الثلاثاء",
|
|
2708
|
+
"الأربعاء",
|
|
2709
|
+
"الخميس",
|
|
2710
|
+
"الجمعة",
|
|
2711
|
+
"السبت"
|
|
2712
|
+
], Oi = {
|
|
2713
|
+
months: Ei,
|
|
2714
|
+
monthsShort: Ei,
|
|
2715
|
+
days: Di,
|
|
2716
|
+
daysShort: Di
|
|
2717
|
+
}, ki = -466581, Ai = (e, t) => 29 * (t - 1) + Math.floor((6 * t - 1) / 11) + (e - 1) * 354 + Math.floor((3 + 11 * e) / 30);
|
|
2718
|
+
function ji(e) {
|
|
2719
|
+
let t = (e < 61 ? e + 1 : e) - ki, n = Math.floor((30 * (t - 1) + 10646) / 10631), r = Math.min(12, Math.floor((11 * (t - Ai(n, 1) - 1) + 330) / 325));
|
|
2720
|
+
return {
|
|
2721
|
+
y: n,
|
|
2722
|
+
m: r,
|
|
2723
|
+
d: t - Ai(n, r)
|
|
2724
|
+
};
|
|
2725
|
+
}
|
|
2726
|
+
//#endregion
|
|
2727
|
+
//#region node_modules/xlcalc/dist/numfmt/date.js
|
|
2728
|
+
var Mi = 2958466, Z = (e) => String(e).padStart(2, "0");
|
|
2729
|
+
function Ni(e) {
|
|
2730
|
+
let t = /* @__PURE__ */ new Map(), n = !1;
|
|
2731
|
+
for (let r = 0; r < e.length; r++) {
|
|
2732
|
+
let i = e[r];
|
|
2733
|
+
if (i.t === "date" || i.t === "elapsed") n = !0;
|
|
2734
|
+
else if ((i.t === "dot" || i.t === "lit" && i.point) && n && e[r + 1]?.t === "ph" && e[r + 1].c === "0") {
|
|
2735
|
+
let n = 0;
|
|
2736
|
+
for (; e[r + 1 + n]?.t === "ph" && e[r + 1 + n].c === "0";) n++;
|
|
2737
|
+
t.set(r, n), r += n;
|
|
2738
|
+
}
|
|
2739
|
+
}
|
|
2740
|
+
return t;
|
|
2741
|
+
}
|
|
2742
|
+
function Pi(e, t) {
|
|
2743
|
+
let n = (e) => e?.t === "date" || e?.t === "elapsed" ? e.s[0] : void 0, r = n(e.slice(0, t).findLast((e) => e.t === "date" || e.t === "elapsed")), i = Ni(e), a = e.findIndex((e, n) => n > t && (e.t === "date" || e.t === "elapsed" || i.has(n)));
|
|
2744
|
+
return r === "h" || a > 0 && (i.has(a) || n(e[a]) === "s");
|
|
2745
|
+
}
|
|
2746
|
+
function Fi(e, t, n, r) {
|
|
2747
|
+
let { toks: i } = t, a = n.epoch ?? 0, o = !i.some((e) => e.t === "date" || e.t === "ampm");
|
|
2748
|
+
if (e < 0 && !o && !a) return null;
|
|
2749
|
+
let s = Ni(i), c = (e) => [...s].some(([t, n]) => e > t && e <= t + Math.min(3, n));
|
|
2750
|
+
if (i.some((e, t) => e.t === "ph" && !c(t) || e.t === "pct" || e.t === "exp")) return null;
|
|
2751
|
+
let l = Math.max(0, ...[...s.values()].map((e) => Math.min(3, e))), u = Math.abs(e), d = 86400 * 10 ** l, { day: f, second: p } = l ? {
|
|
2752
|
+
day: Math.floor(u),
|
|
2753
|
+
second: Math.round((u - Math.floor(u)) * d)
|
|
2754
|
+
} : Ln(u);
|
|
2755
|
+
if (p >= d && ([f, p] = [f + 1, p - d]), f + a >= Mi && !o) return null;
|
|
2756
|
+
let m = Math.floor(p / 10 ** l), h = i.some((e) => e.t === "ampm"), { y: g, m: _, d: v } = t.hijri ? ji(f + a) : Rn(f + a), y = (f + a + 6) % 7, b = Math.floor(m / 3600), x = Math.floor(m / 60) % 60, S = m % 60, C = e < 0 ? "-" : "";
|
|
2757
|
+
for (let e = 0; e < i.length; e++) {
|
|
2758
|
+
let t = i[e];
|
|
2759
|
+
if (t.t === "ampm") C += t.s.length > 3 ? b < 12 ? "AM" : "PM" : b < 12 ? t.s[0] : t.s[2];
|
|
2760
|
+
else if (t.t === "elapsed") {
|
|
2761
|
+
let e = t.s[0] === "h" ? f * 24 + b : t.s[0] === "n" ? (f * 24 + b) * 60 + x : f * 86400 + m;
|
|
2762
|
+
C += String(e).padStart(t.s.length, "0");
|
|
2763
|
+
} else if (t.t === "date") {
|
|
2764
|
+
let n = t.s[0], a = t.s.length;
|
|
2765
|
+
if (n === "y") C += a <= 2 ? Z(g % 100) : String(g);
|
|
2766
|
+
else if (n === "d") C += a === 1 ? String(v) : a === 2 ? Z(v) : a === 3 ? r.daysShort[y] : r.days[y];
|
|
2767
|
+
else if (n === "h") {
|
|
2768
|
+
let e = h ? b % 12 || 12 : b;
|
|
2769
|
+
C += a === 1 ? String(e) : Z(e);
|
|
2770
|
+
} else n === "s" ? C += a === 1 ? String(S) : Z(S) : n === "n" || a <= 2 && Pi(i, e) ? C += a === 1 ? String(x) : Z(x) : C += a === 1 ? String(_) : a === 2 ? Z(_) : a === 3 ? r.monthsShort[_ - 1] : a === 4 ? r.months[_ - 1] : r.months[_ - 1][0];
|
|
2771
|
+
} else if (s.has(e)) {
|
|
2772
|
+
let t = s.get(e);
|
|
2773
|
+
C += n.decimal + String(p % 10 ** l).padStart(l, "0").slice(0, t), e += t;
|
|
2774
|
+
} else t.t === "slash" ? C += n.dateSeparator : C += t.t === "dot" || t.t === "comma" ? t.s : U(t, n);
|
|
2775
|
+
}
|
|
2776
|
+
return C;
|
|
2777
|
+
}
|
|
2778
|
+
//#endregion
|
|
2779
|
+
//#region node_modules/xlcalc/dist/numfmt/number.js
|
|
2780
|
+
function Ii(e, t, n, r) {
|
|
2781
|
+
let i = t.findIndex((e) => e.t === "dot"), a = i < 0 ? t.length : i, o = 0, s = !1;
|
|
2782
|
+
for (let e = 0; e < a; e++) {
|
|
2783
|
+
if (t[e].t !== "comma") continue;
|
|
2784
|
+
let n = t.slice(0, e).some((e) => e.t === "ph"), r = t.slice(e + 1, a).some((e) => e.t === "ph");
|
|
2785
|
+
n && r ? s = !0 : n && o++;
|
|
2786
|
+
}
|
|
2787
|
+
for (let e = a + 1; e < t.length; e++) t[e].t === "comma" && !t.slice(e + 1).some((e) => e.t === "ph") && o++;
|
|
2788
|
+
let c = t.filter((e) => e.t === "pct").length, l = c || o ? Number((Math.abs(e) * 100 ** c / 1e3 ** o).toPrecision(15)) : Math.abs(e), u = i < 0 ? [] : t.slice(i + 1).filter((e) => e.t === "ph"), d = t.slice(0, a).filter((e) => e.t === "ph"), f = Pr(l, u.length);
|
|
2789
|
+
l = Number(f);
|
|
2790
|
+
let [p, m = ""] = f.split("."), h = d.filter((e) => e.c === "0").length;
|
|
2791
|
+
p === "0" && h === 0 && (p = ""), p = p.padStart(h, "0"), s && (p = p.replace(/\B(?=(\d{3})+(?!\d))/g, r.group));
|
|
2792
|
+
let g = "", _ = p, v = t.findIndex((e, t) => t < a && e.t === "ph");
|
|
2793
|
+
for (let e = a - 1; e >= 0; e--) {
|
|
2794
|
+
let n = t[e];
|
|
2795
|
+
if (n.t === "ph") {
|
|
2796
|
+
let t = _.length ? _[_.length - 1] : n.c === "0" ? "0" : n.c === "?" ? Dn(r) : "";
|
|
2797
|
+
_ = _.slice(0, -1), g = (e === v ? _ : "") + t + g, e === v && (_ = "");
|
|
2798
|
+
} else n.t !== "comma" && (g = U(n, r) + g);
|
|
2799
|
+
}
|
|
2800
|
+
if (v < 0 && (g = p + g), i >= 0) {
|
|
2801
|
+
let e = m.split("");
|
|
2802
|
+
for (let t = u.length - 1; t >= 0 && e[t] === "0" && u[t].c !== "0"; t--) e[t] = u[t].c === "?" ? Dn(r) : "";
|
|
2803
|
+
let n = 0;
|
|
2804
|
+
g += r.decimal;
|
|
2805
|
+
for (let a of t.slice(i + 1)) a.t === "ph" ? g += e[n++] ?? "" : a.t !== "comma" && (g += U(a, r));
|
|
2806
|
+
}
|
|
2807
|
+
return (n && e < 0 && l !== 0 ? "-" : "") + g;
|
|
2808
|
+
}
|
|
2809
|
+
var Li = (e) => e?.t === "lit" && /^[0-9]$/.test(e.s), Ri = 2 ** 31 - 2;
|
|
2810
|
+
function zi(e, t, n, r, i) {
|
|
2811
|
+
let a = n - 1;
|
|
2812
|
+
for (; a >= 0 && t[a].t === "ph";) a--;
|
|
2813
|
+
let o = t.slice(a + 1, n), s = t.slice(0, a + 1), c = s.some((e) => e.t === "ph"), l = n + 1, u = 0, d = [];
|
|
2814
|
+
if (Li(t[l])) {
|
|
2815
|
+
let e = "";
|
|
2816
|
+
for (; l < t.length && (Li(t[l]) || t[l].t === "ph" && t[l].c === "0"); l++) e += t[l].t === "lit" ? t[l].s : "0";
|
|
2817
|
+
u = Number(e);
|
|
2818
|
+
} else for (; l < t.length && t[l].t === "ph"; l++) d.push(t[l]);
|
|
2819
|
+
if (!o.length || !u && !d.length) return null;
|
|
2820
|
+
let f = Math.abs(e), p = c ? Math.floor(f) : 0, m = f - p, h = 0, g = u;
|
|
2821
|
+
if (u) h = Math.round(m * u);
|
|
2822
|
+
else {
|
|
2823
|
+
let e = Infinity;
|
|
2824
|
+
for (let t = 1, n = 10 ** d.length - 1; t <= n; t++) {
|
|
2825
|
+
let n = Math.round(m * t), r = Math.abs(m - n / t);
|
|
2826
|
+
r < e - 1e-12 && ([e, h, g] = [
|
|
2827
|
+
r,
|
|
2828
|
+
n,
|
|
2829
|
+
t
|
|
2830
|
+
]);
|
|
2831
|
+
}
|
|
2832
|
+
}
|
|
2833
|
+
if (c && h === g && ([p, h] = [p + 1, 0]), h > Ri) return null;
|
|
2834
|
+
let _ = (e, t, n) => {
|
|
2835
|
+
let r = t.slice(0, Math.max(0, t.length - e.length)), a = "0".repeat(r.filter((e) => e.c === "0").length), o = Dn(i).repeat(r.filter((e) => e.c === "?").length);
|
|
2836
|
+
return n ? o + a + e : a + e + o;
|
|
2837
|
+
}, v = s.findLastIndex((e) => e.t === "ph"), y = c ? Ii(p, p === 0 && h === 0 ? s.map((e, t) => t === v ? {
|
|
2838
|
+
t: "ph",
|
|
2839
|
+
c: "0"
|
|
2840
|
+
} : e) : s, !1, i) : s.map((e) => U(e, i)).join(""), b = u ? String(u) : _(String(g), d, !1), x = _(String(h), o, !0) + "/" + b, S = t.slice(l).map((e) => U(e, i)).join(""), C = c && h === 0 ? y + (i.layout ? x.replace(/[^/]/g, " ") : " ".repeat(x.length)) : y + x;
|
|
2841
|
+
return (r && e < 0 && (c || h !== 0) ? "-" : "") + C + S;
|
|
2842
|
+
}
|
|
2843
|
+
function Bi(e, t, n, r, i) {
|
|
2844
|
+
let a = t.slice(0, n), o = a.findIndex((e) => e.t === "dot"), s = Math.max(1, a.slice(0, o < 0 ? a.length : o).filter((e) => e.t === "ph").length), c = o < 0 ? 0 : a.slice(o + 1).filter((e) => e.t === "ph").length, l = Math.abs(e), u = 0, d = 0;
|
|
2845
|
+
if (l !== 0) {
|
|
2846
|
+
let [e, t] = l.toExponential(14).split("e"), n = Number(t);
|
|
2847
|
+
u = Math.floor(n / s) * s, d = Number(`${e}e${n - u}`), Number(q(d, c)) >= 10 ** s && ([u, d] = [u + s, Number(`${e}e${n - u - s}`)]);
|
|
2848
|
+
}
|
|
2849
|
+
let f = Ii(d, l === 0 ? a.map((e) => e.t === "ph" ? {
|
|
2850
|
+
t: "ph",
|
|
2851
|
+
c: "0"
|
|
2852
|
+
} : e) : a, !1, i), p = t[n].plus, m = t.slice(n + 1), h = m.filter((e) => e.t === "ph").length, g = String(Math.abs(u)).padStart(h, "0"), _ = m.filter((e) => e.t !== "ph").map((e) => U(e, i));
|
|
2853
|
+
return (r && e < 0 ? "-" : "") + f + "E" + (u < 0 ? "-" : p ? "+" : "") + g + _.join("");
|
|
2854
|
+
}
|
|
2855
|
+
function Vi(e, t, n, r) {
|
|
2856
|
+
let i = t.findIndex((e) => e.t === "exp");
|
|
2857
|
+
if (i >= 0) return Bi(e, t, i, n, r);
|
|
2858
|
+
let a = t.findIndex((e, n) => e.t === "slash" && t[n - 1]?.t === "ph");
|
|
2859
|
+
return a >= 0 ? zi(e, t, a, n, r) : Ii(e, t, n, r);
|
|
2860
|
+
}
|
|
2861
|
+
//#endregion
|
|
2862
|
+
//#region node_modules/xlcalc/dist/numfmt/palette.js
|
|
2863
|
+
var Hi = "000000 FFFFFF FF0000 00FF00 0000FF FFFF00 FF00FF 00FFFF 800000 008000 000080 808000 800080 008080 C0C0C0 808080 9999FF 993366 FFFFCC CCFFFF 660066 FF8080 0066CC CCCCFF 000080 FF00FF FFFF00 00FFFF 800080 800000 008080 0000FF 00CCFF CCFFFF CCFFCC FFFF99 99CCFF FF99CC CC99FF FFCC99 3366FF 33CCCC 99CC00 FFCC00 FF9900 FF6600 666699 969696 003366 339966 003300 333300 993300 993366 333399 333333".split(" ").map((e) => `#${e}`), Ui = (e) => new Map(e.map((e, t) => [e.toLowerCase(), Hi[t]])), Wi = {
|
|
2864
|
+
decimal: ".",
|
|
2865
|
+
group: ",",
|
|
2866
|
+
general: "general",
|
|
2867
|
+
colors: Ui([
|
|
2868
|
+
"Black",
|
|
2869
|
+
"White",
|
|
2870
|
+
"Red",
|
|
2871
|
+
"Green",
|
|
2872
|
+
"Blue",
|
|
2873
|
+
"Yellow",
|
|
2874
|
+
"Magenta",
|
|
2875
|
+
"Cyan"
|
|
2876
|
+
]),
|
|
2877
|
+
colorWord: "color",
|
|
2878
|
+
letter: (e) => {
|
|
2879
|
+
let t = e.toLowerCase();
|
|
2880
|
+
return "ymdhs".includes(t) ? t : void 0;
|
|
2881
|
+
},
|
|
2882
|
+
same: (e, t) => e.toLowerCase() === t.toLowerCase()
|
|
2883
|
+
};
|
|
2884
|
+
function Gi(e) {
|
|
2885
|
+
let t = [], n = "", r = !1;
|
|
2886
|
+
for (let i = 0; i < e.length; i++) {
|
|
2887
|
+
let a = e[i];
|
|
2888
|
+
a === "\"" && (r = !r), a === "\\" && !r && i + 1 < e.length ? n += a + e[++i] : a === ";" && !r ? (t.push(n), n = "") : n += a;
|
|
2889
|
+
}
|
|
2890
|
+
return t.push(n), t;
|
|
2891
|
+
}
|
|
2892
|
+
var Ki = /^(<>|<=|>=|<|>|=)\s*(-?\d*[.,]?\d+(?:[eE][+-]?\d+)?)$/, qi = {
|
|
2893
|
+
"X-SYSDATE": "F800",
|
|
2894
|
+
"X-SYSTIME": "F400"
|
|
2895
|
+
};
|
|
2896
|
+
function Ji(e, t, n, r) {
|
|
2897
|
+
if (e[0] === "$") {
|
|
2898
|
+
let r = e.indexOf("-"), i = r < 0 ? e.slice(1) : e.slice(1, r);
|
|
2899
|
+
if (i && n.push({
|
|
2900
|
+
t: "lit",
|
|
2901
|
+
s: i
|
|
2902
|
+
}), r >= 0) {
|
|
2903
|
+
let n = e.slice(r + 1).toUpperCase();
|
|
2904
|
+
t.lcid = qi[n] ?? n;
|
|
2905
|
+
}
|
|
2906
|
+
return !0;
|
|
2907
|
+
}
|
|
2908
|
+
let i = e ? r.letter(e[0]) : void 0;
|
|
2909
|
+
if (i && "hmns".includes(i) && [...e].every((t) => r.same(e[0], t))) return n.push({
|
|
2910
|
+
t: "elapsed",
|
|
2911
|
+
s: (i === "m" ? "n" : i).repeat(e.length)
|
|
2912
|
+
}), !0;
|
|
2913
|
+
let a = e.toLowerCase(), o = r.colors.get(a) ?? (a.startsWith(r.colorWord) ? Hi[Number(a.slice(r.colorWord.length).trim()) - 1] : void 0);
|
|
2914
|
+
if (o) t.color = o;
|
|
2915
|
+
else {
|
|
2916
|
+
let n = Ki.exec(e);
|
|
2917
|
+
if (!n) return !1;
|
|
2918
|
+
t.cond = {
|
|
2919
|
+
op: n[1],
|
|
2920
|
+
limit: Number(n[2].replace(r.decimal, "."))
|
|
2921
|
+
};
|
|
2922
|
+
}
|
|
2923
|
+
return !0;
|
|
2924
|
+
}
|
|
2925
|
+
function Yi(e, t) {
|
|
2926
|
+
if (t.refuses?.(e)) return null;
|
|
2927
|
+
let n = [], r = { toks: n }, i = !1, a = 0;
|
|
2928
|
+
for (; a < e.length;) {
|
|
2929
|
+
let o = e[a], s = e.slice(a);
|
|
2930
|
+
if (o === "\"") {
|
|
2931
|
+
let t = e.indexOf("\"", a + 1);
|
|
2932
|
+
if (t < 0) return null;
|
|
2933
|
+
n.push({
|
|
2934
|
+
t: "lit",
|
|
2935
|
+
s: e.slice(a + 1, t)
|
|
2936
|
+
}), a = t + 1;
|
|
2937
|
+
continue;
|
|
2938
|
+
}
|
|
2939
|
+
if (o === "\\" || o === "_" || o === "*") {
|
|
2940
|
+
let t = e[a + 1] ?? "";
|
|
2941
|
+
n.push(o === "\\" ? {
|
|
2942
|
+
t: "lit",
|
|
2943
|
+
s: t
|
|
2944
|
+
} : o === "_" ? {
|
|
2945
|
+
t: "pad",
|
|
2946
|
+
s: t
|
|
2947
|
+
} : {
|
|
2948
|
+
t: "fill",
|
|
2949
|
+
s: t
|
|
2950
|
+
}), a += 2;
|
|
2951
|
+
continue;
|
|
2952
|
+
}
|
|
2953
|
+
if (o === "[") {
|
|
2954
|
+
let i = e.indexOf("]", a);
|
|
2955
|
+
if (i < 0 || !Ji(e.slice(a + 1, i), r, n, t)) return null;
|
|
2956
|
+
a = i + 1;
|
|
2957
|
+
continue;
|
|
2958
|
+
}
|
|
2959
|
+
if (!n.length && /^b[12]/i.test(s)) {
|
|
2960
|
+
s[1] === "1" ? r.lcid = "409" : r.hijri = !0, a += 2;
|
|
2961
|
+
continue;
|
|
2962
|
+
}
|
|
2963
|
+
if (s.toLowerCase().startsWith(t.general)) {
|
|
2964
|
+
n.push({ t: "general" }), a += t.general.length;
|
|
2965
|
+
continue;
|
|
2966
|
+
}
|
|
2967
|
+
let c = /^(AM\/PM|A\/P)/i.exec(s);
|
|
2968
|
+
if (c) {
|
|
2969
|
+
n.push({
|
|
2970
|
+
t: "ampm",
|
|
2971
|
+
s: c[0]
|
|
2972
|
+
}), a += c[0].length;
|
|
2973
|
+
continue;
|
|
2974
|
+
}
|
|
2975
|
+
if ((o === "E" || o === "e") && (e[a + 1] === "+" || e[a + 1] === "-")) {
|
|
2976
|
+
if (o === "e") return null;
|
|
2977
|
+
n.push({
|
|
2978
|
+
t: "exp",
|
|
2979
|
+
plus: e[a + 1] === "+"
|
|
2980
|
+
}), a += 2;
|
|
2981
|
+
continue;
|
|
2982
|
+
}
|
|
2983
|
+
let l = t.letter(o);
|
|
2984
|
+
if (l) {
|
|
2985
|
+
let r = a;
|
|
2986
|
+
for (; r < e.length && t.same(o, e[r]);) r++;
|
|
2987
|
+
n.push({
|
|
2988
|
+
t: "date",
|
|
2989
|
+
s: l.repeat(r - a)
|
|
2990
|
+
}), a = r;
|
|
2991
|
+
} else {
|
|
2992
|
+
if (o === "E" || o === "e") return null;
|
|
2993
|
+
o === "0" || o === "#" || o === "?" ? n.push({
|
|
2994
|
+
t: "ph",
|
|
2995
|
+
c: o
|
|
2996
|
+
}) : o === t.decimal ? n.push(i ? {
|
|
2997
|
+
t: "lit",
|
|
2998
|
+
s: o,
|
|
2999
|
+
point: !0
|
|
3000
|
+
} : {
|
|
3001
|
+
t: "dot",
|
|
3002
|
+
s: o
|
|
3003
|
+
}) : o === t.group ? n.push(t.currency && e.startsWith(t.currency, a + 1) ? {
|
|
3004
|
+
t: "lit",
|
|
3005
|
+
s: o
|
|
3006
|
+
} : {
|
|
3007
|
+
t: "comma",
|
|
3008
|
+
s: o
|
|
3009
|
+
}) : o === "%" ? n.push({ t: "pct" }) : o === "/" ? n.push({ t: "slash" }) : o === "@" ? n.push({ t: "text" }) : n.push({
|
|
3010
|
+
t: "lit",
|
|
3011
|
+
s: o
|
|
3012
|
+
}), i ||= o === t.decimal, a++;
|
|
3013
|
+
}
|
|
3014
|
+
}
|
|
3015
|
+
return r;
|
|
3016
|
+
}
|
|
3017
|
+
var Xi = /* @__PURE__ */ new WeakMap();
|
|
3018
|
+
function Zi(e, t) {
|
|
3019
|
+
let n = Xi.get(t);
|
|
3020
|
+
n || Xi.set(t, n = /* @__PURE__ */ new Map());
|
|
3021
|
+
let r = n.get(e);
|
|
3022
|
+
if (r === void 0) {
|
|
3023
|
+
let i = Gi(e).map((e) => Yi(e, t));
|
|
3024
|
+
r = i.every((e) => e !== null) ? i : null, n.size >= 4096 && n.clear(), n.set(e, r);
|
|
3025
|
+
}
|
|
3026
|
+
return r;
|
|
3027
|
+
}
|
|
3028
|
+
//#endregion
|
|
3029
|
+
//#region node_modules/xlcalc/dist/numfmt/select.js
|
|
3030
|
+
var Qi = (e, t) => e.op === "<" ? t < e.limit : e.op === "<=" ? t <= e.limit : e.op === ">" ? t > e.limit : e.op === ">=" ? t >= e.limit : e.op === "=" ? t === e.limit : t !== e.limit;
|
|
3031
|
+
function $i(e, t) {
|
|
3032
|
+
let n = e.slice(0, t + 1).flatMap((e) => e.cond && e.cond.limit >= 0 ? [e.cond.limit] : []);
|
|
3033
|
+
return ![
|
|
3034
|
+
0,
|
|
3035
|
+
Number.MIN_VALUE,
|
|
3036
|
+
Number.MAX_VALUE,
|
|
3037
|
+
...n.flatMap((e) => [
|
|
3038
|
+
e,
|
|
3039
|
+
e * (1 + 2 ** -50) + Number.MIN_VALUE,
|
|
3040
|
+
e * (1 - 2 ** -50)
|
|
3041
|
+
])
|
|
3042
|
+
].some((n) => n >= 0 && e.slice(0, t).every((e) => !e.cond || !Qi(e.cond, n)) && (!e[t].cond || Qi(e[t].cond, n)));
|
|
3043
|
+
}
|
|
3044
|
+
function ea(e, t) {
|
|
3045
|
+
let n = e.slice(0, 3);
|
|
3046
|
+
if (!n.some((e) => e.cond)) return t < 0 && e.length >= 2 ? {
|
|
3047
|
+
sec: e[1],
|
|
3048
|
+
signed: !1
|
|
3049
|
+
} : {
|
|
3050
|
+
sec: t === 0 && e.length >= 3 ? e[2] : e[0],
|
|
3051
|
+
signed: !0
|
|
3052
|
+
};
|
|
3053
|
+
let r = n.findIndex((e) => !e.cond || Qi(e.cond, t));
|
|
3054
|
+
return r < 0 ? e.length === 1 ? {
|
|
3055
|
+
sec: null,
|
|
3056
|
+
signed: !0
|
|
3057
|
+
} : null : {
|
|
3058
|
+
sec: n[r],
|
|
3059
|
+
signed: !$i(n, r)
|
|
3060
|
+
};
|
|
3061
|
+
}
|
|
3062
|
+
var ta = (e) => e.length >= 4 ? e[3] : e.find((e) => e.toks.some((e) => e.t === "text"));
|
|
3063
|
+
function na(e) {
|
|
3064
|
+
let t = "literal";
|
|
3065
|
+
for (let n of e) {
|
|
3066
|
+
if (n.t === "general") return "general";
|
|
3067
|
+
n.t === "date" || n.t === "elapsed" || n.t === "ampm" ? t = "date" : n.t === "text" && t !== "date" ? t = "text" : (n.t === "ph" || n.t === "exp") && t === "literal" && (t = "number");
|
|
3068
|
+
}
|
|
3069
|
+
return t;
|
|
3070
|
+
}
|
|
3071
|
+
//#endregion
|
|
3072
|
+
//#region node_modules/xlcalc/dist/numfmt.js
|
|
3073
|
+
function ra(e, t) {
|
|
3074
|
+
let n = e.lcid === "F800" ? t.longDate : e.lcid === "F400" ? t.longTime : void 0, r = e.hijri ? Oi : e.lcid && t.names(e.lcid) || t;
|
|
3075
|
+
return n === void 0 ? {
|
|
3076
|
+
sec: e,
|
|
3077
|
+
names: r
|
|
3078
|
+
} : {
|
|
3079
|
+
sec: Zi(n, Wi)[0],
|
|
3080
|
+
names: e.lcid === "F800" && t.longMonths ? {
|
|
3081
|
+
...r,
|
|
3082
|
+
months: t.longMonths
|
|
3083
|
+
} : r
|
|
3084
|
+
};
|
|
3085
|
+
}
|
|
3086
|
+
var ia = (e, t, n) => e.toks.map((e) => e.t === "text" ? t : U(e, n)).join(""), aa = (e) => e.replace(/\uFFFF[^]?/g, "");
|
|
3087
|
+
function oa(e, t, n) {
|
|
3088
|
+
let r = ea(t, e);
|
|
3089
|
+
if (!r) return { sec: null };
|
|
3090
|
+
let { sec: i, signed: a } = r, o = a ? e : Math.abs(e);
|
|
3091
|
+
if (!i) return {
|
|
3092
|
+
general: o,
|
|
3093
|
+
sec: i
|
|
3094
|
+
};
|
|
3095
|
+
let s = na(i.toks);
|
|
3096
|
+
if (s === "general" && i.toks.length === 1) return {
|
|
3097
|
+
general: o,
|
|
3098
|
+
sec: i
|
|
3099
|
+
};
|
|
3100
|
+
if (s === "text") return {
|
|
3101
|
+
general: o,
|
|
3102
|
+
sec: null
|
|
3103
|
+
};
|
|
3104
|
+
let c = a && e < 0 ? "-" : "";
|
|
3105
|
+
if (s === "general") return {
|
|
3106
|
+
text: c + i.toks.map((t) => t.t === "general" ? n.general(Math.abs(e)) : U(t, n)).join(""),
|
|
3107
|
+
sec: i
|
|
3108
|
+
};
|
|
3109
|
+
if (s === "date") {
|
|
3110
|
+
let t = ra(i, n);
|
|
3111
|
+
return {
|
|
3112
|
+
text: Fi(e, t.sec, n, t.names) ?? void 0,
|
|
3113
|
+
sec: i
|
|
3114
|
+
};
|
|
3115
|
+
}
|
|
3116
|
+
return s === "literal" ? {
|
|
3117
|
+
text: c + i.toks.map((e) => U(e, n)).join(""),
|
|
3118
|
+
sec: i
|
|
3119
|
+
} : {
|
|
3120
|
+
text: Vi(e, i.toks, a, n) ?? void 0,
|
|
3121
|
+
sec: i
|
|
3122
|
+
};
|
|
3123
|
+
}
|
|
3124
|
+
var sa = (e, t, n) => t ? oa(e, t, n) : {
|
|
3125
|
+
general: e,
|
|
3126
|
+
sec: null
|
|
3127
|
+
};
|
|
3128
|
+
function ca(e, t, n) {
|
|
3129
|
+
let r = Zi(t, n.codes);
|
|
3130
|
+
if (!r) return null;
|
|
3131
|
+
let { style: i } = n;
|
|
3132
|
+
if (typeof e == "boolean") return i.bool(e);
|
|
3133
|
+
if (t === "") return "";
|
|
3134
|
+
if (typeof e == "string") {
|
|
3135
|
+
let t = n.number(e);
|
|
3136
|
+
if (t === null) {
|
|
3137
|
+
let t = ta(r);
|
|
3138
|
+
return t ? aa(ia(t, e, i)) : e;
|
|
3139
|
+
}
|
|
3140
|
+
e = t;
|
|
3141
|
+
}
|
|
3142
|
+
let { text: a, general: o } = oa(e, r, i);
|
|
3143
|
+
if (o !== void 0) return i.general(o);
|
|
3144
|
+
if (a === void 0) return null;
|
|
3145
|
+
let s = aa(a);
|
|
3146
|
+
return s.length > 255 ? null : s;
|
|
3147
|
+
}
|
|
3148
|
+
function la(e, t) {
|
|
3149
|
+
let n = e.lastIndexOf("");
|
|
3150
|
+
if (n < 0) return Or(e) <= t && e.length <= 255 ? e : null;
|
|
3151
|
+
let r = e[n + 1] ?? "", i = aa(e.slice(0, n)), a = e.slice(n + 2), o = t - Or(i + a);
|
|
3152
|
+
if (o < 0) return null;
|
|
3153
|
+
let s = i + (r && o !== Infinity ? r.repeat(Math.floor(o / Dr(r))) : "") + a;
|
|
3154
|
+
return s.length <= 255 ? s : null;
|
|
3155
|
+
}
|
|
3156
|
+
var ua = (e, t, n) => la(e, t) ?? (n ? aa(e) : Nr(t)), da = (e, t) => {
|
|
3157
|
+
let n = typeof e == "number" ? t.builtin(e) : e;
|
|
3158
|
+
return n === void 0 ? null : Zi(n, Wi);
|
|
3159
|
+
};
|
|
3160
|
+
function fa(e, t, n, r) {
|
|
3161
|
+
if (e === null) return { text: "" };
|
|
3162
|
+
if (typeof e == "object") return { text: ua(n.error(e.error), r, !1) };
|
|
3163
|
+
let i = da(t, n);
|
|
3164
|
+
if (typeof e != "number") {
|
|
3165
|
+
let t = i && ta(i);
|
|
3166
|
+
if (!t && typeof e == "string") return { text: e };
|
|
3167
|
+
let a = typeof e == "boolean" ? n.bool(e) : e, o = ua(t ? ia(t, a, n) : a, r, typeof e == "string");
|
|
3168
|
+
return t?.color ? {
|
|
3169
|
+
text: o,
|
|
3170
|
+
color: t.color
|
|
3171
|
+
} : { text: o };
|
|
3172
|
+
}
|
|
3173
|
+
let { text: a, general: o, sec: s } = sa(e, i, n);
|
|
3174
|
+
if (a === void 0 && o === void 0) return { text: Nr(r) };
|
|
3175
|
+
let c = o === void 0 ? la(a, r) ?? Nr(r) : Vr(o, r).replace(".", n.decimal);
|
|
3176
|
+
return s?.color ? {
|
|
3177
|
+
text: c,
|
|
3178
|
+
color: s.color
|
|
3179
|
+
} : { text: c };
|
|
3180
|
+
}
|
|
3181
|
+
var pa = /* @__PURE__ */ new WeakMap();
|
|
3182
|
+
function ma(e, t, n) {
|
|
3183
|
+
if (e === null) return null;
|
|
3184
|
+
let r = pa.get(n);
|
|
3185
|
+
r || pa.set(n, r = {
|
|
3186
|
+
...n,
|
|
3187
|
+
layout: !0
|
|
3188
|
+
});
|
|
3189
|
+
let i = da(t, n), a;
|
|
3190
|
+
if (typeof e == "object") a = n.error(e.error);
|
|
3191
|
+
else if (typeof e != "number") {
|
|
3192
|
+
let t = i && ta(i), o = typeof e == "boolean" ? n.bool(e) : e;
|
|
3193
|
+
a = t ? ia(t, o, r) : o;
|
|
3194
|
+
} else {
|
|
3195
|
+
let t = sa(e, i, r);
|
|
3196
|
+
if (t.general !== void 0) {
|
|
3197
|
+
let e = n.general(Math.abs(t.general)), r = (t.general < 0 ? Dr("-") : 0) + 6 * e.length;
|
|
3198
|
+
return e.includes("E") ? r + 5 : r + 7;
|
|
3199
|
+
}
|
|
3200
|
+
a = t.text;
|
|
3201
|
+
}
|
|
3202
|
+
return a ? Mr(a) : null;
|
|
3203
|
+
}
|
|
3204
|
+
function ha(e, t, n, r) {
|
|
3205
|
+
if (typeof e != "number") return null;
|
|
3206
|
+
let i = ma(e, t, n);
|
|
3207
|
+
if (i === null || i <= r) return null;
|
|
3208
|
+
let { general: a } = sa(e, da(t, n), n);
|
|
3209
|
+
if (a === void 0) return i;
|
|
3210
|
+
let o = Vr(a, kr(r));
|
|
3211
|
+
return o !== Vr(a, Infinity) && !/[E#]/.test(o) ? null : i;
|
|
3212
|
+
}
|
|
3213
|
+
//#endregion
|
|
3214
|
+
//#region node_modules/xlcalc/dist/locale/lcid.js
|
|
3215
|
+
var ga = {
|
|
3216
|
+
months: [
|
|
3217
|
+
"Январь",
|
|
3218
|
+
"Февраль",
|
|
3219
|
+
"Март",
|
|
3220
|
+
"Апрель",
|
|
3221
|
+
"Май",
|
|
3222
|
+
"Июнь",
|
|
3223
|
+
"Июль",
|
|
3224
|
+
"Август",
|
|
3225
|
+
"Сентябрь",
|
|
3226
|
+
"Октябрь",
|
|
3227
|
+
"Ноябрь",
|
|
3228
|
+
"Декабрь"
|
|
3229
|
+
],
|
|
3230
|
+
monthsShort: [
|
|
3231
|
+
"янв",
|
|
3232
|
+
"фев",
|
|
3233
|
+
"мар",
|
|
3234
|
+
"апр",
|
|
3235
|
+
"май",
|
|
3236
|
+
"июн",
|
|
3237
|
+
"июл",
|
|
3238
|
+
"авг",
|
|
3239
|
+
"сен",
|
|
3240
|
+
"окт",
|
|
3241
|
+
"ноя",
|
|
3242
|
+
"дек"
|
|
3243
|
+
],
|
|
3244
|
+
days: [
|
|
3245
|
+
"воскресенье",
|
|
3246
|
+
"понедельник",
|
|
3247
|
+
"вторник",
|
|
3248
|
+
"среда",
|
|
3249
|
+
"четверг",
|
|
3250
|
+
"пятница",
|
|
3251
|
+
"суббота"
|
|
3252
|
+
],
|
|
3253
|
+
daysShort: [
|
|
3254
|
+
"Вс",
|
|
3255
|
+
"Пн",
|
|
3256
|
+
"Вт",
|
|
3257
|
+
"Ср",
|
|
3258
|
+
"Чт",
|
|
3259
|
+
"Пт",
|
|
3260
|
+
"Сб"
|
|
3261
|
+
]
|
|
3262
|
+
}, _a = (e) => (t) => /\d/.test(t) ? e(t) : null, va = /^([+-]?) *(.*)$/s;
|
|
3263
|
+
function ya(e) {
|
|
3264
|
+
let { decimal: t, group: n } = e, { symbol: r } = e.currency, i = RegExp(`^((?!0+${Y(n)})\\d+(?:${Y(n)}\\d{3,})*|)(${Y(t)}\\d*)?$`), a = e.currency.before ? RegExp(`^([+-]?) *(${Y(r)})? *([+-]?) *(.*)$`, "s") : null;
|
|
3265
|
+
return (e) => {
|
|
3266
|
+
let o = K(e);
|
|
3267
|
+
if (o === "") return null;
|
|
3268
|
+
let { s, paren: c, percent: l } = sr(o), u, d, f;
|
|
3269
|
+
if (a) {
|
|
3270
|
+
let e = a.exec(s);
|
|
3271
|
+
if (e[1] && e[3]) return null;
|
|
3272
|
+
[u, d, f] = [
|
|
3273
|
+
(e[1] || e[3]) === "-",
|
|
3274
|
+
e[4],
|
|
3275
|
+
e[2] !== void 0
|
|
3276
|
+
];
|
|
3277
|
+
} else {
|
|
3278
|
+
f = s.endsWith(r);
|
|
3279
|
+
let e = va.exec(f ? K(s.slice(0, -r.length)) : s);
|
|
3280
|
+
[u, d] = [e[1] === "-", e[2]];
|
|
3281
|
+
}
|
|
3282
|
+
return f && l || c && u ? null : fr(d, i, (e) => e.split(n).join("").replace(t, "."), l, !c && !(a && f), u || c);
|
|
3283
|
+
};
|
|
3284
|
+
}
|
|
3285
|
+
//#endregion
|
|
3286
|
+
//#region node_modules/xlcalc/dist/locale/rules/dates.js
|
|
3287
|
+
var ba = /^(\d{4})[-/.](\d{1,2})[-/.](\d{1,2})$/, xa = /^(\d{1,2})[-/.](\d{1,4})$/, Sa = /^(\d{1,2})[ .-](\p{L}+)(?:(?:\. ?|[ -])(\d{4}|\d{2}))?$/u, Ca = /^(\p{L}+)(?:\. ?|[ -])(\d{4}|\d{2})$/u, wa = {
|
|
3288
|
+
dmy: {
|
|
3289
|
+
re: /^(\d{1,2})[-/.](\d{1,2})[-/.](\d{4}|\d{1,2})$/,
|
|
3290
|
+
y: 3,
|
|
3291
|
+
m: 2,
|
|
3292
|
+
d: 1
|
|
3293
|
+
},
|
|
3294
|
+
mdy: {
|
|
3295
|
+
re: /^(\d{1,2})[-/.](\d{1,2})[-/.](\d{4}|\d{1,2})$/,
|
|
3296
|
+
y: 3,
|
|
3297
|
+
m: 1,
|
|
3298
|
+
d: 2
|
|
3299
|
+
},
|
|
3300
|
+
ymd: {
|
|
3301
|
+
re: /^(\d{4}|\d{2})[-/.](\d{1,2})[-/.](\d{1,2})$/,
|
|
3302
|
+
y: 1,
|
|
3303
|
+
m: 2,
|
|
3304
|
+
d: 3
|
|
3305
|
+
}
|
|
3306
|
+
};
|
|
3307
|
+
function Ta(e, t) {
|
|
3308
|
+
let n = e.months.map((e) => e.toLowerCase()), r = (e) => e.length < 3 ? 0 : n.findIndex((t) => t.startsWith(e)) + 1, i = wa[e.dateOrder], a = () => t.year(), o = e.dateOrder === "dmy" ? (e, t) => t.length <= 2 && Number(t) <= 12 ? G(a(), Number(t), e) : t.length === 3 ? null : G(W(t), e, 1) : (e, t) => Xn(e, t, a);
|
|
3309
|
+
return (e) => {
|
|
3310
|
+
let t = ba.exec(e);
|
|
3311
|
+
if (t) return G(Number(t[1]), Number(t[2]), Number(t[3]));
|
|
3312
|
+
if (t = i.re.exec(e)) return G(W(t[i.y]), Number(t[i.m]), Number(t[i.d]));
|
|
3313
|
+
if (t = xa.exec(e)) return o(Number(t[1]), t[2]);
|
|
3314
|
+
if (t = Sa.exec(e)) {
|
|
3315
|
+
let e = r(t[2]);
|
|
3316
|
+
return e ? G(t[3] === void 0 ? a() : W(t[3]), e, Number(t[1])) : null;
|
|
3317
|
+
}
|
|
3318
|
+
if (t = Ca.exec(e)) {
|
|
3319
|
+
let e = r(t[1]);
|
|
3320
|
+
return e ? G(W(t[2]), e, 1) : null;
|
|
3321
|
+
}
|
|
3322
|
+
return null;
|
|
3323
|
+
};
|
|
3324
|
+
}
|
|
3325
|
+
//#endregion
|
|
3326
|
+
//#region node_modules/xlcalc/dist/locale/rules/format.js
|
|
3327
|
+
var Ea = (e) => e.replace(/"[^"]*"?|\\[\s\S]/g, "");
|
|
3328
|
+
function Da(e) {
|
|
3329
|
+
let { codes: t, decimal: n, group: r } = e, i = new Map([
|
|
3330
|
+
t.day,
|
|
3331
|
+
t.year,
|
|
3332
|
+
t.hour,
|
|
3333
|
+
t.second
|
|
3334
|
+
].map((e, t) => [e.toLowerCase(), "dyhs"[t]])), a = (e) => e === t.month ? "m" : e === t.minute ? "n" : i.get(e.toLowerCase()), o = n !== "." && r !== ".";
|
|
3335
|
+
return {
|
|
3336
|
+
decimal: n,
|
|
3337
|
+
group: r,
|
|
3338
|
+
general: t.general.toLowerCase(),
|
|
3339
|
+
colors: Ui(e.colors),
|
|
3340
|
+
colorWord: t.color.toLowerCase(),
|
|
3341
|
+
letter: a,
|
|
3342
|
+
same: (e, n) => e === t.month || e === t.minute ? e === n : e.toLowerCase() === n.toLowerCase(),
|
|
3343
|
+
currency: e.currency.symbol,
|
|
3344
|
+
refuses: (e) => {
|
|
3345
|
+
let t = Ea(e);
|
|
3346
|
+
return !([...t].some((e) => a(e) !== void 0) || /AM\/PM|A\/P/i.test(t)) && o && /\.[^]*[0#?]/.test(t) || /[0#?]\//.test(t) && t.includes(r);
|
|
3347
|
+
}
|
|
3348
|
+
};
|
|
3349
|
+
}
|
|
3350
|
+
function Oa(e, t, n, r) {
|
|
3351
|
+
let { decimal: i } = t, a = {
|
|
3352
|
+
decimal: i,
|
|
3353
|
+
group: t.group,
|
|
3354
|
+
months: t.months,
|
|
3355
|
+
monthsShort: t.monthsShort,
|
|
3356
|
+
days: t.days,
|
|
3357
|
+
daysShort: t.daysShort,
|
|
3358
|
+
dateSeparator: "/",
|
|
3359
|
+
general: (e) => Br(e).replace(".", i),
|
|
3360
|
+
bool: (t) => e.booleans[t ? "TRUE" : "FALSE"],
|
|
3361
|
+
error: (t) => ne(t, e.errors),
|
|
3362
|
+
names: r,
|
|
3363
|
+
longDate: t.longDate,
|
|
3364
|
+
longTime: t.longTime,
|
|
3365
|
+
longMonths: t.longMonths,
|
|
3366
|
+
builtin: on(t.builtin)
|
|
3367
|
+
};
|
|
3368
|
+
return {
|
|
3369
|
+
text: {
|
|
3370
|
+
codes: Da(t),
|
|
3371
|
+
style: a,
|
|
3372
|
+
number: n
|
|
3373
|
+
},
|
|
3374
|
+
cell: {
|
|
3375
|
+
...a,
|
|
3376
|
+
dateSeparator: t.dateSeparator
|
|
3377
|
+
}
|
|
3378
|
+
};
|
|
3379
|
+
}
|
|
3380
|
+
//#endregion
|
|
3381
|
+
//#region node_modules/xlcalc/dist/locale/rules/regional.js
|
|
3382
|
+
function ka(e, t, n, r, i = 0) {
|
|
3383
|
+
let { decimal: a, group: o, currency: s } = t, c = Vn({
|
|
3384
|
+
date: Ta(t, n),
|
|
3385
|
+
decimal: a
|
|
3386
|
+
}, i), l = ya(t), { value: u, argument: d } = ir(l, c), f = (e) => zr(e).replace(".", a), { toNum: p, toText: m, toBool: h } = Wr(d, e.booleans, f), g = (e) => {
|
|
3387
|
+
let t = h(e);
|
|
3388
|
+
return typeof t == "boolean" ? t : null;
|
|
3389
|
+
}, _ = le(t.collation), v = Yr(_), y = Oa(e, t, d, r), [b, x] = [{
|
|
3390
|
+
...y.text,
|
|
3391
|
+
style: En(y.text.style, i)
|
|
3392
|
+
}, En(y.cell, i)];
|
|
3393
|
+
return {
|
|
3394
|
+
epoch: i,
|
|
3395
|
+
locale: e,
|
|
3396
|
+
decimal: a,
|
|
3397
|
+
group: o,
|
|
3398
|
+
currency: s,
|
|
3399
|
+
clock: n,
|
|
3400
|
+
toNum: p,
|
|
3401
|
+
toText: m,
|
|
3402
|
+
toBool: h,
|
|
3403
|
+
valueText: u,
|
|
3404
|
+
dateText: (e) => nr(e, c),
|
|
3405
|
+
numberOnly: l,
|
|
3406
|
+
dates: c,
|
|
3407
|
+
numberText: f,
|
|
3408
|
+
formatText: (e, t) => ca(e, t, b),
|
|
3409
|
+
display: (e, t, n) => fa(e, t, x, n),
|
|
3410
|
+
fitPoints: (e, t) => ma(e, t, x),
|
|
3411
|
+
typedPoints: (e, t, n) => ha(e, t, x, n),
|
|
3412
|
+
compare: v,
|
|
3413
|
+
compareOp: Qr(v),
|
|
3414
|
+
errorText: (t) => ne(t, e.errors),
|
|
3415
|
+
codePage: t.codePage,
|
|
3416
|
+
critNumber: d,
|
|
3417
|
+
critBool: g,
|
|
3418
|
+
cellNumber: _a(d),
|
|
3419
|
+
critError: ti(e.errors),
|
|
3420
|
+
compareText: _
|
|
3421
|
+
};
|
|
3422
|
+
}
|
|
3423
|
+
//#endregion
|
|
3424
|
+
//#region node_modules/xlcalc/dist/locale/rules.js
|
|
3425
|
+
function Aa(e) {
|
|
3426
|
+
let t = j(e).regional?.builtin;
|
|
3427
|
+
return t ? on(t) : (e) => H[e];
|
|
3428
|
+
}
|
|
3429
|
+
var ja = {
|
|
3430
|
+
name: "windows-1252",
|
|
3431
|
+
chars: String.fromCharCode(8364, 129, 8218, 402, 8222, 8230, 8224, 8225, 710, 8240, 352, 8249, 338, 141, 381, 143, 144, 8216, 8217, 8220, 8221, 8226, 8211, 8212, 732, 8482, 353, 8250, 339, 157, 382, 376, ...Array.from({ length: 96 }, (e, t) => 160 + t))
|
|
3432
|
+
}, Ma = (e) => e === "409" ? Tn : e === "419" ? ga : void 0, Na = {
|
|
3433
|
+
...Tn,
|
|
3434
|
+
decimal: ".",
|
|
3435
|
+
group: ",",
|
|
3436
|
+
dateSeparator: "/",
|
|
3437
|
+
general: Br,
|
|
3438
|
+
bool: (e) => e ? "TRUE" : "FALSE",
|
|
3439
|
+
error: (e) => C[e],
|
|
3440
|
+
names: Ma,
|
|
3441
|
+
longDate: "dddd, mmmm d, yyyy",
|
|
3442
|
+
longTime: "h:mm:ss AM/PM",
|
|
3443
|
+
builtin: (e) => H[e]
|
|
3444
|
+
};
|
|
3445
|
+
function Pa(e, t) {
|
|
3446
|
+
let n = Vn(Qn(() => e.year()), t), { value: r, argument: i } = ir(cr, n), a = ir(lr, n).argument, o = hr(i), s = En(Na, t), c = {
|
|
3447
|
+
codes: Wi,
|
|
3448
|
+
style: s,
|
|
3449
|
+
number: o
|
|
3450
|
+
};
|
|
3451
|
+
return {
|
|
3452
|
+
epoch: t,
|
|
3453
|
+
...ni,
|
|
3454
|
+
...Wr(o, se.booleans, zr),
|
|
3455
|
+
clock: e,
|
|
3456
|
+
critNumber: a,
|
|
3457
|
+
cellNumber: _a(i),
|
|
3458
|
+
locale: se,
|
|
3459
|
+
decimal: ".",
|
|
3460
|
+
group: ",",
|
|
3461
|
+
currency: {
|
|
3462
|
+
symbol: "$",
|
|
3463
|
+
before: !0,
|
|
3464
|
+
space: "",
|
|
3465
|
+
negative: "()"
|
|
3466
|
+
},
|
|
3467
|
+
valueText: r,
|
|
3468
|
+
dateText: (e) => nr(e, n),
|
|
3469
|
+
numberOnly: ur,
|
|
3470
|
+
dates: n,
|
|
3471
|
+
numberText: zr,
|
|
3472
|
+
formatText: (e, t) => ca(e, t, c),
|
|
3473
|
+
display: (e, t, n) => fa(e, t, s, n),
|
|
3474
|
+
fitPoints: (e, t) => ma(e, t, s),
|
|
3475
|
+
typedPoints: (e, t, n) => ha(e, t, s, n),
|
|
3476
|
+
compare: Xr,
|
|
3477
|
+
compareOp: $r,
|
|
3478
|
+
errorText: (e) => C[e],
|
|
3479
|
+
codePage: ja
|
|
3480
|
+
};
|
|
3481
|
+
}
|
|
3482
|
+
var Fa = /* @__PURE__ */ new WeakMap();
|
|
3483
|
+
function Ia(e, t = 0) {
|
|
3484
|
+
let n = j(e), r = Fa.get(n);
|
|
3485
|
+
r || Fa.set(n, r = /* @__PURE__ */ new Map());
|
|
3486
|
+
let i = r.get(t);
|
|
3487
|
+
return i || r.set(t, i = La(n, {
|
|
3488
|
+
year: () => 1900,
|
|
3489
|
+
read: !1
|
|
3490
|
+
}, t)), i;
|
|
3491
|
+
}
|
|
3492
|
+
function La(e, t, n = 0) {
|
|
3493
|
+
let r = j(e);
|
|
3494
|
+
return r.regional ? ka(r, r.regional, t, Ma, n) : Pa(t, n);
|
|
3495
|
+
}
|
|
3496
|
+
//#endregion
|
|
3497
|
+
//#region node_modules/xlcalc/dist/entry/close.js
|
|
3498
|
+
var Ra = /^[\s+-]*[\p{L}_][\p{L}\p{N}._]*\(/u;
|
|
3499
|
+
function za(e) {
|
|
3500
|
+
let { open: t, quote: n, table: r, shut: i, calls: a } = rt(e, e.length);
|
|
3501
|
+
if (r || n === "'" || !n && !t.length) return null;
|
|
3502
|
+
let o = (n ? "\"" : "") + t.map((e) => e.kind === "array" ? "}" : ")").reverse().join(""), s = !n && !i && t.length === 1 && t[0].kind === "call" && Ra.test(e.slice(1)), c = !s && (!t.some((e) => e.kind === "array") || t.length === 1 && /^\s*\{/.test(e.slice(1)));
|
|
3503
|
+
return {
|
|
3504
|
+
closed: e + o,
|
|
3505
|
+
correction: e[0] + (e.slice(1) + o).replace(/^\s+/, ""),
|
|
3506
|
+
silent: s,
|
|
3507
|
+
offered: c,
|
|
3508
|
+
calls: a
|
|
3509
|
+
};
|
|
3510
|
+
}
|
|
3511
|
+
//#endregion
|
|
3512
|
+
//#region node_modules/xlcalc/dist/call-at.js
|
|
3513
|
+
function Ba(e, t) {
|
|
3514
|
+
let n = e.toUpperCase();
|
|
3515
|
+
if (!t) return n;
|
|
3516
|
+
let r = t.functions;
|
|
3517
|
+
return Object.keys(r).find((e) => r[e].toUpperCase() === n) ?? n;
|
|
3518
|
+
}
|
|
3519
|
+
//#endregion
|
|
3520
|
+
//#region node_modules/xlcalc/dist/entry/forms.js
|
|
3521
|
+
var Q = (e, t, n) => Array.from({ length: t - e + 1 }, (t, r) => [e + r, n]), Va = new Map([
|
|
3522
|
+
...Q(5, 8, "currency"),
|
|
3523
|
+
...Q(41, 44, "accounting"),
|
|
3524
|
+
...Q(9, 10, "percent"),
|
|
3525
|
+
[11, "scientific"],
|
|
3526
|
+
[48, "scientific"],
|
|
3527
|
+
...Q(12, 13, "fraction"),
|
|
3528
|
+
...Q(14, 17, "date"),
|
|
3529
|
+
[22, "date"],
|
|
3530
|
+
...Q(27, 31, "date"),
|
|
3531
|
+
[36, "date"],
|
|
3532
|
+
...Q(18, 21, "time"),
|
|
3533
|
+
...Q(32, 35, "time"),
|
|
3534
|
+
...Q(45, 47, "time")
|
|
3535
|
+
]), Ha = {
|
|
3536
|
+
date: "date",
|
|
3537
|
+
time: "time",
|
|
3538
|
+
percent: "percent",
|
|
3539
|
+
currency: "currency",
|
|
3540
|
+
scientific: "scientific",
|
|
3541
|
+
fraction: "fraction"
|
|
3542
|
+
}, Ua = /* @__PURE__ */ new Set([
|
|
3543
|
+
5,
|
|
3544
|
+
6,
|
|
3545
|
+
7,
|
|
3546
|
+
8,
|
|
3547
|
+
41,
|
|
3548
|
+
42,
|
|
3549
|
+
43,
|
|
3550
|
+
44
|
|
3551
|
+
]);
|
|
3552
|
+
function Wa(e, t) {
|
|
3553
|
+
if (typeof e == "number") return e;
|
|
3554
|
+
if (e.toLowerCase() === "general") return 0;
|
|
3555
|
+
let n = Aa(t);
|
|
3556
|
+
for (let t = 0; an(t); t++) if (!Ua.has(t) && H[t] === e && n(t) === e) return t;
|
|
3557
|
+
}
|
|
3558
|
+
function Ga(e, t, n, r) {
|
|
3559
|
+
let i = n === void 0 ? 0 : Wa(n, r);
|
|
3560
|
+
if (i === 0) return t;
|
|
3561
|
+
let a = Ha[e], o = i === void 0 ? void 0 : Va.get(i);
|
|
3562
|
+
return a && o && a !== o ? t : n;
|
|
3563
|
+
}
|
|
3564
|
+
function Ka(e, t) {
|
|
3565
|
+
return e !== void 0 && (Zi(typeof e == "number" ? H[e] : e, Wi)?.[0]?.toks ?? []).some((e) => e.t === t);
|
|
3566
|
+
}
|
|
3567
|
+
//#endregion
|
|
3568
|
+
//#region node_modules/xlcalc/dist/entry/formula.js
|
|
3569
|
+
var qa = {
|
|
3570
|
+
TODAY: 14,
|
|
3571
|
+
DATE: 14,
|
|
3572
|
+
NOW: 22,
|
|
3573
|
+
TIME: 18,
|
|
3574
|
+
PMT: "money",
|
|
3575
|
+
PV: "money",
|
|
3576
|
+
FV: "money",
|
|
3577
|
+
IPMT: "money",
|
|
3578
|
+
PPMT: "money",
|
|
3579
|
+
NPV: "money"
|
|
3580
|
+
}, Ja = /* @__PURE__ */ new Set([
|
|
3581
|
+
"SUM",
|
|
3582
|
+
"MAX",
|
|
3583
|
+
"MIN",
|
|
3584
|
+
"AVERAGE",
|
|
3585
|
+
"ROUND"
|
|
3586
|
+
]), Ya = (e) => e.k === "num" || (e.k === "un" || e.k === "paren" || e.k === "pct") && Ya(e.a) || e.k === "bin" && Ya(e.a) && Ya(e.b);
|
|
3587
|
+
function $(e) {
|
|
3588
|
+
switch (e.k) {
|
|
3589
|
+
case "fn": return qa[e.name] === void 0 ? Ja.has(e.name) ? e.args.map($).find((e) => e !== void 0) : void 0 : qa[e.name];
|
|
3590
|
+
case "un":
|
|
3591
|
+
case "paren": return $(e.a);
|
|
3592
|
+
case "bin": return e.op === "+" ? $(e.a) ?? $(e.b) : e.op === "-" && Ya(e.b) ? $(e.a) : void 0;
|
|
3593
|
+
default: return;
|
|
3594
|
+
}
|
|
3595
|
+
}
|
|
3596
|
+
//#endregion
|
|
3597
|
+
//#region node_modules/xlcalc/dist/entry/read.js
|
|
3598
|
+
function Xa(e, t) {
|
|
3599
|
+
let n = t ? "#,##0.00" : "#,##0", r = `"${e.symbol}"`, i = e.space ? "\\ " : "", a = e.before ? `${r}${i}${n}` : `${n}${i}${r}`;
|
|
3600
|
+
return e.negative === "()" ? `${a}_);[Red]\\(${a}\\)` : `${a};[Red]\\-${a}`;
|
|
3601
|
+
}
|
|
3602
|
+
function Za(e, t) {
|
|
3603
|
+
let n = K(e), r = /\d \d+\/(\d+)/.exec(n), i = r !== null || RegExp(`\\d*${Y(t.decimal)}`).test(n.replace(/[eE][+-]?\d+$/, ""));
|
|
3604
|
+
return n.includes(t.currency.symbol) ? {
|
|
3605
|
+
form: "currency",
|
|
3606
|
+
format: Xa(t.currency, i)
|
|
3607
|
+
} : /\d[eE][+-]?\d/.test(n) ? {
|
|
3608
|
+
form: "scientific",
|
|
3609
|
+
format: 11
|
|
3610
|
+
} : n.includes("%") ? {
|
|
3611
|
+
form: "percent",
|
|
3612
|
+
format: i ? 10 : 9
|
|
3613
|
+
} : r ? {
|
|
3614
|
+
form: "fraction",
|
|
3615
|
+
format: r[1].length > 1 ? 13 : 12
|
|
3616
|
+
} : RegExp(`\\d${Y(t.group)}\\d`).test(n) ? {
|
|
3617
|
+
form: "grouped",
|
|
3618
|
+
format: i ? 4 : 3
|
|
3619
|
+
} : { form: "plain" };
|
|
3620
|
+
}
|
|
3621
|
+
function Qa(e, t) {
|
|
3622
|
+
let n = /[ap]m?$/.test(e), r = e.replace(/ ?[ap]m?$/, "").split(/ ?: ?/), i = r.length > 2 && r[2] !== "";
|
|
3623
|
+
return n ? i ? 19 : 18 : e.includes(t) ? 47 : Number(r[0]) >= 24 ? 46 : i ? 21 : 20;
|
|
3624
|
+
}
|
|
3625
|
+
function $a(e, t, n) {
|
|
3626
|
+
if (e.date === null) return Qa(e.time, n);
|
|
3627
|
+
if (e.time !== null) return 22;
|
|
3628
|
+
if (t) return 16;
|
|
3629
|
+
let r = e.date.match(/\d+/g)?.length ?? 0;
|
|
3630
|
+
return /\p{L}/u.test(e.date) ? r >= 2 ? 15 : 17 : r >= 3 ? 14 : 17;
|
|
3631
|
+
}
|
|
3632
|
+
function eo(e, t) {
|
|
3633
|
+
return t.currency.symbol === "€" || e.includes("%") || e.split("€").length !== 2 ? null : t.numberOnly(e.replace(/ *€ */, ""));
|
|
3634
|
+
}
|
|
3635
|
+
function to(e) {
|
|
3636
|
+
let t = /^ *([+-]?)(\d+)\/(\d+) *$/.exec(e);
|
|
3637
|
+
return t && Number(t[3]) > 0 ? (t[1] === "-" ? -1 : 1) * Number(t[2]) / Number(t[3]) / 100 : null;
|
|
3638
|
+
}
|
|
3639
|
+
function no(e, t, n) {
|
|
3640
|
+
let r = RegExp(`^ *[+-]?(\\d*(?:${Y(n.decimal)}\\d*)?)[eE]([+-]?\\d+) *$`).exec(e);
|
|
3641
|
+
if (!r || !/\d/.test(r[1])) return !1;
|
|
3642
|
+
let i = Number(r[2]);
|
|
3643
|
+
return i > 308 || i < -324 || t === null || Math.abs(t) >= 1e308 || t === 0 && /[1-9]/.test(r[1]);
|
|
3644
|
+
}
|
|
3645
|
+
function ro(e, t, n, r = !1) {
|
|
3646
|
+
let i = r && /^[-+]?\d/.test(e), a = i ? to(e) : null;
|
|
3647
|
+
if (a !== null) return {
|
|
3648
|
+
t: "number",
|
|
3649
|
+
v: a,
|
|
3650
|
+
form: "percent",
|
|
3651
|
+
format: 10
|
|
3652
|
+
};
|
|
3653
|
+
let o = i ? `${e}%` : e, s = t.numberOnly(o);
|
|
3654
|
+
if (no(o, s, t)) return {
|
|
3655
|
+
t: "text",
|
|
3656
|
+
v: o,
|
|
3657
|
+
format: 11
|
|
3658
|
+
};
|
|
3659
|
+
if (s !== null) return {
|
|
3660
|
+
t: "number",
|
|
3661
|
+
v: Math.abs(s) < 22250738585072014e-324 ? 0 : s,
|
|
3662
|
+
...Za(o, t)
|
|
3663
|
+
};
|
|
3664
|
+
let [c, l] = _r(n, () => rr(o, t.dates));
|
|
3665
|
+
if (c) return {
|
|
3666
|
+
t: "number",
|
|
3667
|
+
v: c.value,
|
|
3668
|
+
form: c.date === null ? "time" : "date",
|
|
3669
|
+
format: $a(c, l, t.dates.decimal)
|
|
3670
|
+
};
|
|
3671
|
+
let u = eo(o, t);
|
|
3672
|
+
if (u !== null) return {
|
|
3673
|
+
t: "number",
|
|
3674
|
+
v: u,
|
|
3675
|
+
form: "plain"
|
|
3676
|
+
};
|
|
3677
|
+
let d = D(o), { TRUE: f, FALSE: p } = t.locale.booleans;
|
|
3678
|
+
if (d === D(f) || d === D(p)) return {
|
|
3679
|
+
t: "boolean",
|
|
3680
|
+
v: d === D(f)
|
|
3681
|
+
};
|
|
3682
|
+
let m = ee.find((e) => d === D(t.locale.errors[e] ?? e));
|
|
3683
|
+
return m ? {
|
|
3684
|
+
t: "error",
|
|
3685
|
+
literal: m
|
|
3686
|
+
} : {
|
|
3687
|
+
t: "text",
|
|
3688
|
+
v: o
|
|
3689
|
+
};
|
|
3690
|
+
}
|
|
3691
|
+
//#endregion
|
|
3692
|
+
//#region node_modules/xlcalc/dist/entry/index.js
|
|
3693
|
+
var io = /* @__PURE__ */ new WeakMap();
|
|
3694
|
+
function ao(e, t, n) {
|
|
3695
|
+
let r = io.get(e);
|
|
3696
|
+
r || io.set(e, r = /* @__PURE__ */ new Map());
|
|
3697
|
+
let i = r.get(t);
|
|
3698
|
+
if (!i) {
|
|
3699
|
+
let a = Object.assign(gr(() => a.y), { y: n });
|
|
3700
|
+
r.set(t, i = {
|
|
3701
|
+
rules: La(e, a, t),
|
|
3702
|
+
clock: a
|
|
3703
|
+
});
|
|
3704
|
+
}
|
|
3705
|
+
return i.clock.y = n, i;
|
|
3706
|
+
}
|
|
3707
|
+
var oo = [
|
|
3708
|
+
"style",
|
|
3709
|
+
"meta",
|
|
3710
|
+
"note",
|
|
3711
|
+
"link"
|
|
3712
|
+
], so = /* @__PURE__ */ new Set([
|
|
3713
|
+
"syntax",
|
|
3714
|
+
"empty",
|
|
3715
|
+
"too_long",
|
|
3716
|
+
"too_deep"
|
|
3717
|
+
]);
|
|
3718
|
+
function co(e, t, n, r, i = !1) {
|
|
3719
|
+
let a = r ? { externalBooks: r } : void 0, o = wi(e, n, a), s = i && !o.ok && o.code === "syntax" ? za(e) : null;
|
|
3720
|
+
if (s?.silent) {
|
|
3721
|
+
let i = lo(s.closed, wi(s.closed, n, a), t, n, r);
|
|
3722
|
+
return "formula" in i ? i : {
|
|
3723
|
+
...i,
|
|
3724
|
+
at: Math.min(i.at, e.length + t)
|
|
3725
|
+
};
|
|
3726
|
+
}
|
|
3727
|
+
let c = lo(e, o, t, n, r);
|
|
3728
|
+
return s?.offered && !("formula" in c) && s.calls.every((e) => uo(e, n)) && wi(s.correction, n, a).ok ? {
|
|
3729
|
+
...c,
|
|
3730
|
+
correction: s.correction
|
|
3731
|
+
} : c;
|
|
3732
|
+
}
|
|
3733
|
+
function lo(e, t, n, r, i) {
|
|
3734
|
+
if (t.ok) {
|
|
3735
|
+
let e = Qt(t.canonical);
|
|
3736
|
+
return {
|
|
3737
|
+
formula: t.canonical,
|
|
3738
|
+
...e.ok ? { sets: $(e.ast) } : {}
|
|
3739
|
+
};
|
|
3740
|
+
}
|
|
3741
|
+
if (so.has(t.code) || i && t.code === "external_ref") return {
|
|
3742
|
+
ok: !1,
|
|
3743
|
+
code: t.code,
|
|
3744
|
+
message: t.message,
|
|
3745
|
+
at: t.at + n
|
|
3746
|
+
};
|
|
3747
|
+
let a = Ci(e, r);
|
|
3748
|
+
return a.ok ? { formula: a.formula } : {
|
|
3749
|
+
...a,
|
|
3750
|
+
at: a.at + n
|
|
3751
|
+
};
|
|
3752
|
+
}
|
|
3753
|
+
function uo(e, t) {
|
|
3754
|
+
let n = Ba(e, t);
|
|
3755
|
+
return a(n) !== void 0 && (t.functions[n] ?? n).toUpperCase() === e.toUpperCase();
|
|
3756
|
+
}
|
|
3757
|
+
var fo = (e, t) => e.startsWith("+") && /^\+?[\d.]/.test(e.slice(1).replace(t, ".")), po = "[$€-2]\\ #,##0;[Red]\\-[$€-2]\\ #,##0";
|
|
3758
|
+
function mo(e, t) {
|
|
3759
|
+
return k(e, "text"), ho(e, hn(t));
|
|
3760
|
+
}
|
|
3761
|
+
function ho(e, t, n = "typed") {
|
|
3762
|
+
let r = n === "pasted", i = j(t.locale), a = t.cell ?? {}, o = {};
|
|
3763
|
+
for (let e of oo) a[e] !== void 0 && (o[e] = a[e]);
|
|
3764
|
+
let s = (e, t = a.numberFormat) => ({
|
|
3765
|
+
ok: !0,
|
|
3766
|
+
input: {
|
|
3767
|
+
...e,
|
|
3768
|
+
...t === void 0 ? {} : { numberFormat: t },
|
|
3769
|
+
...o
|
|
3770
|
+
}
|
|
3771
|
+
}), c = n === "replaced" && Ka(a.numberFormat, "text") ? void 0 : a.numberFormat, l = (e, t) => Ga(e, t, c, i) ?? (c === a.numberFormat ? void 0 : a.numberFormat), u = kn(t.dateSystem), d = Rn(Math.floor(_(t.now === void 0 ? Date.now() : Date.parse(t.now)))).y, { rules: f, clock: p } = ao(i, u, d), m = (a, o) => {
|
|
3772
|
+
let c = co(a, o, i, t.externalBooks, n === "typed" || n === "inPlace");
|
|
3773
|
+
if (!("formula" in c)) return r ? s({ value: e }) : c;
|
|
3774
|
+
if (c.sets === void 0) return s({ formula: c.formula });
|
|
3775
|
+
let u = c.sets === "money" ? Xa(f.currency, !0) : c.sets;
|
|
3776
|
+
return s({ formula: c.formula }, l(c.sets === "money" ? "currency" : c.sets === 18 ? "time" : "date", u));
|
|
3777
|
+
};
|
|
3778
|
+
if (e === "") return a.numberFormat !== void 0 || Object.keys(o).length ? s({}) : {
|
|
3779
|
+
ok: !0,
|
|
3780
|
+
input: null
|
|
3781
|
+
};
|
|
3782
|
+
if (e.startsWith("'") && !r) return s({ value: e.slice(1) });
|
|
3783
|
+
if (n !== "replaced" && Ka(a.numberFormat, "text") || e === "=") return s({ value: e });
|
|
3784
|
+
if (e.startsWith("=")) return m(e, 0);
|
|
3785
|
+
let h = ro(e, f, p, (n === "typed" || n === "inPlace") && Ka(a.numberFormat, "pct") && (n === "typed" || /^[-+]/.test(e)));
|
|
3786
|
+
if (/^[-+]./s.test(e) && h.t === "text" && h.format === void 0) return fo(h.v, f.decimal) ? m(h.v.slice(1), 1) : m(h.v, 0);
|
|
3787
|
+
switch (h.t) {
|
|
3788
|
+
case "number": return r && h.form === "plain" && /^€\d+$/.test(e) ? s({ value: h.v }, Ga("currency", po, a.numberFormat, i)) : s({ value: h.v }, l(h.form, h.format));
|
|
3789
|
+
case "boolean": return s({ value: h.v });
|
|
3790
|
+
case "text": return s({ value: h.v }, h.format === void 0 ? a.numberFormat : l("scientific", h.format));
|
|
3791
|
+
case "error": return s({ formula: h.literal });
|
|
3792
|
+
}
|
|
3793
|
+
}
|
|
3794
|
+
//#endregion
|
|
3795
|
+
//#region node_modules/xlcalc/dist/entry/text.js
|
|
3796
|
+
var go = 2958466;
|
|
3797
|
+
function _o(e, t) {
|
|
3798
|
+
if (t === void 0) return "number";
|
|
3799
|
+
let n = ea(Zi(typeof t == "number" ? H[t] : t, Wi) ?? [], e)?.sec;
|
|
3800
|
+
return n ? na(n.toks) === "date" ? n.toks.some((e, t) => e.t === "date" && (e.s[0] === "y" || e.s[0] === "d" || e.s[0] === "m" && !Pi(n.toks, t))) ? "date" : "time" : n.toks.some((e) => e.t === "pct") ? "percent" : "number" : "number";
|
|
3801
|
+
}
|
|
3802
|
+
function vo(e, t, n) {
|
|
3803
|
+
let r = Math.floor(e), i = Math.round((e - r) * 86400);
|
|
3804
|
+
i === 86400 && ([r, i] = [r + 1, 0]);
|
|
3805
|
+
let a = n.display(i / 86400, "[$-F400]h:mm:ss AM/PM", Infinity).text;
|
|
3806
|
+
if (t && r === 0) return a;
|
|
3807
|
+
let o = n.display(r, 14, Infinity).text;
|
|
3808
|
+
return i || t ? `${o} ${a}` : o;
|
|
3809
|
+
}
|
|
3810
|
+
var yo = (e, t) => zr(e, 21).replace(".", t.decimal);
|
|
3811
|
+
function bo(e, t, n) {
|
|
3812
|
+
let r = _o(e, t);
|
|
3813
|
+
return r === "percent" ? `${yo(e * 100, n)}%` : (r === "date" || r === "time") && e >= 0 && e + n.epoch < go ? vo(e, r === "time", n) : yo(e, n);
|
|
3814
|
+
}
|
|
3815
|
+
function xo(e, t) {
|
|
3816
|
+
let n = mo(e, {
|
|
3817
|
+
...t.locale ? { locale: t.locale } : {},
|
|
3818
|
+
...t.dateSystem ? { dateSystem: t.dateSystem } : {},
|
|
3819
|
+
...t.now ? { now: t.now } : {},
|
|
3820
|
+
...t.numberFormat === void 0 ? {} : { cell: { numberFormat: t.numberFormat } }
|
|
3821
|
+
});
|
|
3822
|
+
return !(n.ok && n.input?.value === e && n.input.formula === void 0);
|
|
3823
|
+
}
|
|
3824
|
+
function So(e, t) {
|
|
3825
|
+
return xo(k(e, "text"), mn(t));
|
|
3826
|
+
}
|
|
3827
|
+
function Co(e, t) {
|
|
3828
|
+
return wo(pn(e, "value"), mn(t));
|
|
3829
|
+
}
|
|
3830
|
+
function wo(e, t) {
|
|
3831
|
+
if (e === null) return "";
|
|
3832
|
+
if (typeof e == "string") return xo(e, t) ? `'${e}` : e;
|
|
3833
|
+
let n = Ia(t.locale ?? "en-US", kn(t.dateSystem));
|
|
3834
|
+
return typeof e == "boolean" ? e ? n.locale.booleans.TRUE : n.locale.booleans.FALSE : typeof e == "object" ? n.errorText(e.error) : bo(e, t.numberFormat, n);
|
|
3835
|
+
}
|
|
3836
|
+
//#endregion
|
|
3837
|
+
//#region node_modules/xlcalc/dist/typed-entry.js
|
|
3838
|
+
r(i({
|
|
3839
|
+
ABS: { args: "n" },
|
|
3840
|
+
ACCRINT: { args: "r r r a a a a? a?" },
|
|
3841
|
+
ACCRINTM: { args: "r r a a a?" },
|
|
3842
|
+
ACOS: { args: "n" },
|
|
3843
|
+
ACOSH: { args: "n" },
|
|
3844
|
+
ACOT: { args: "n" },
|
|
3845
|
+
ACOTH: { args: "n" },
|
|
3846
|
+
ADDRESS: { args: "w w w? b? s?" },
|
|
3847
|
+
AGGREGATE: {
|
|
3848
|
+
args: "n n R",
|
|
3849
|
+
rep: 1,
|
|
3850
|
+
max: 254
|
|
3851
|
+
},
|
|
3852
|
+
AMORDEGRC: { args: "a r r a a a a?" },
|
|
3853
|
+
AMORLINC: { args: "a r r a a a a?" },
|
|
3854
|
+
AND: {
|
|
3855
|
+
args: "V",
|
|
3856
|
+
rep: 1
|
|
3857
|
+
},
|
|
3858
|
+
ARABIC: { args: "s" },
|
|
3859
|
+
AREAS: { args: "R" },
|
|
3860
|
+
ARRAYTOTEXT: { args: "G w?" },
|
|
3861
|
+
ASIN: { args: "n" },
|
|
3862
|
+
ASINH: { args: "n" },
|
|
3863
|
+
ATAN: { args: "n" },
|
|
3864
|
+
ATAN2: { args: "n n" },
|
|
3865
|
+
ATANH: { args: "n" },
|
|
3866
|
+
AVEDEV: {
|
|
3867
|
+
args: "N",
|
|
3868
|
+
rep: 1
|
|
3869
|
+
},
|
|
3870
|
+
AVERAGE: {
|
|
3871
|
+
args: "N",
|
|
3872
|
+
rep: 1
|
|
3873
|
+
},
|
|
3874
|
+
AVERAGEA: {
|
|
3875
|
+
args: "Y",
|
|
3876
|
+
rep: 1
|
|
3877
|
+
},
|
|
3878
|
+
AVERAGEIF: {
|
|
3879
|
+
args: "R a R?",
|
|
3880
|
+
notOmitted: { at: [0, 2] }
|
|
3881
|
+
},
|
|
3882
|
+
AVERAGEIFS: {
|
|
3883
|
+
args: "R R a",
|
|
3884
|
+
rep: 2,
|
|
3885
|
+
notOmitted: {
|
|
3886
|
+
at: [0],
|
|
3887
|
+
from: 1,
|
|
3888
|
+
odd: !0
|
|
3889
|
+
}
|
|
3890
|
+
},
|
|
3891
|
+
BAHTTEXT: { args: "n" },
|
|
3892
|
+
BASE: { args: "n n n?" },
|
|
3893
|
+
BESSELI: { args: "x x" },
|
|
3894
|
+
BESSELJ: { args: "x x" },
|
|
3895
|
+
BESSELK: { args: "x x" },
|
|
3896
|
+
BESSELY: { args: "x x" },
|
|
3897
|
+
"BETA.DIST": { args: "n n n b n? n?" },
|
|
3898
|
+
"BETA.INV": { args: "n n n n? n?" },
|
|
3899
|
+
BETADIST: { args: "n n n n? n?" },
|
|
3900
|
+
BETAINV: { args: "n n n n? n?" },
|
|
3901
|
+
BIN2DEC: { args: "v" },
|
|
3902
|
+
BIN2HEX: { args: "a a?" },
|
|
3903
|
+
BIN2OCT: { args: "a a?" },
|
|
3904
|
+
"BINOM.DIST": { args: "i i n b" },
|
|
3905
|
+
"BINOM.DIST.RANGE": { args: "i n i i?" },
|
|
3906
|
+
"BINOM.INV": { args: "i n n" },
|
|
3907
|
+
BINOMDIST: { args: "i i n b" },
|
|
3908
|
+
BITAND: { args: "n n" },
|
|
3909
|
+
BITLSHIFT: { args: "n n" },
|
|
3910
|
+
BITOR: { args: "n n" },
|
|
3911
|
+
BITRSHIFT: { args: "n n" },
|
|
3912
|
+
BITXOR: { args: "n n" },
|
|
3913
|
+
CEILING: { args: "n n" },
|
|
3914
|
+
"CEILING.MATH": { args: "n n? n?" },
|
|
3915
|
+
"CEILING.PRECISE": { args: "n n?" },
|
|
3916
|
+
CHAR: { args: "i" },
|
|
3917
|
+
CHIDIST: { args: "n i" },
|
|
3918
|
+
CHIINV: { args: "n i" },
|
|
3919
|
+
"CHISQ.DIST": { args: "n i b" },
|
|
3920
|
+
"CHISQ.DIST.RT": { args: "n i" },
|
|
3921
|
+
"CHISQ.INV": { args: "n i" },
|
|
3922
|
+
"CHISQ.INV.RT": { args: "n i" },
|
|
3923
|
+
"CHISQ.TEST": { args: "C C" },
|
|
3924
|
+
CHITEST: { args: "C C" },
|
|
3925
|
+
CHOOSE: {
|
|
3926
|
+
args: "i P",
|
|
3927
|
+
rep: 1
|
|
3928
|
+
},
|
|
3929
|
+
CHOOSECOLS: {
|
|
3930
|
+
args: "G V",
|
|
3931
|
+
rep: 1,
|
|
3932
|
+
max: 254
|
|
3933
|
+
},
|
|
3934
|
+
CHOOSEROWS: {
|
|
3935
|
+
args: "G V",
|
|
3936
|
+
rep: 1,
|
|
3937
|
+
max: 254
|
|
3938
|
+
},
|
|
3939
|
+
CLEAN: { args: "s" },
|
|
3940
|
+
CODE: { args: "s" },
|
|
3941
|
+
COLUMN: { args: "R?" },
|
|
3942
|
+
COLUMNS: { args: "G" },
|
|
3943
|
+
COMBIN: { args: "n n" },
|
|
3944
|
+
COMBINA: { args: "n n" },
|
|
3945
|
+
COMPLEX: { args: "a a a?" },
|
|
3946
|
+
CONCAT: {
|
|
3947
|
+
args: "V",
|
|
3948
|
+
rep: 1,
|
|
3949
|
+
max: 254
|
|
3950
|
+
},
|
|
3951
|
+
CONCATENATE: {
|
|
3952
|
+
args: "s",
|
|
3953
|
+
rep: 1
|
|
3954
|
+
},
|
|
3955
|
+
CONFIDENCE: { args: "n n i" },
|
|
3956
|
+
"CONFIDENCE.NORM": { args: "n n i" },
|
|
3957
|
+
"CONFIDENCE.T": { args: "n n i" },
|
|
3958
|
+
CONVERT: { args: "x v v" },
|
|
3959
|
+
CORREL: { args: "C C" },
|
|
3960
|
+
COS: { args: "n" },
|
|
3961
|
+
COSH: { args: "n" },
|
|
3962
|
+
COT: { args: "n" },
|
|
3963
|
+
COTH: { args: "n" },
|
|
3964
|
+
COUNT: {
|
|
3965
|
+
args: "V",
|
|
3966
|
+
rep: 1
|
|
3967
|
+
},
|
|
3968
|
+
COUNTA: {
|
|
3969
|
+
args: "V",
|
|
3970
|
+
rep: 1
|
|
3971
|
+
},
|
|
3972
|
+
COUNTBLANK: { args: "G" },
|
|
3973
|
+
COUNTIF: {
|
|
3974
|
+
args: "R a",
|
|
3975
|
+
notOmitted: { at: [0] }
|
|
3976
|
+
},
|
|
3977
|
+
COUNTIFS: {
|
|
3978
|
+
args: "R a",
|
|
3979
|
+
rep: 2,
|
|
3980
|
+
notOmitted: {
|
|
3981
|
+
from: 0,
|
|
3982
|
+
even: !0
|
|
3983
|
+
}
|
|
3984
|
+
},
|
|
3985
|
+
COUPDAYBS: { args: "r r a a?" },
|
|
3986
|
+
COUPDAYSNC: { args: "r r a a?" },
|
|
3987
|
+
COUPNCD: { args: "r r a a?" },
|
|
3988
|
+
COUPNUM: { args: "r r a a?" },
|
|
3989
|
+
COUPPCD: { args: "r r a a?" },
|
|
3990
|
+
COVAR: { args: "C C" },
|
|
3991
|
+
"COVARIANCE.P": { args: "C C" },
|
|
3992
|
+
"COVARIANCE.S": { args: "C C" },
|
|
3993
|
+
CRITBINOM: { args: "i n n" },
|
|
3994
|
+
CSC: { args: "n" },
|
|
3995
|
+
CSCH: { args: "n" },
|
|
3996
|
+
CUMIPMT: { args: "a a a a a a" },
|
|
3997
|
+
CUMPRINC: { args: "a a a a a a" },
|
|
3998
|
+
DATE: { args: "w w n" },
|
|
3999
|
+
DATEDIF: { args: "d d s" },
|
|
4000
|
+
DATEVALUE: { args: "v" },
|
|
4001
|
+
DAVERAGE: { args: "D r G" },
|
|
4002
|
+
DAY: { args: "t" },
|
|
4003
|
+
DAYS: { args: "v v" },
|
|
4004
|
+
DAYS360: { args: "t t b?" },
|
|
4005
|
+
DB: { args: "n n n n w?" },
|
|
4006
|
+
DCOUNT: { args: "D r G" },
|
|
4007
|
+
DCOUNTA: { args: "D r G" },
|
|
4008
|
+
DDB: { args: "n n n n n?" },
|
|
4009
|
+
DEC2BIN: { args: "a a?" },
|
|
4010
|
+
DEC2HEX: { args: "a a?" },
|
|
4011
|
+
DEC2OCT: { args: "a a?" },
|
|
4012
|
+
DECIMAL: { args: "s n" },
|
|
4013
|
+
DEGREES: { args: "n" },
|
|
4014
|
+
DELTA: { args: "a a?" },
|
|
4015
|
+
DEVSQ: {
|
|
4016
|
+
args: "N",
|
|
4017
|
+
rep: 1
|
|
4018
|
+
},
|
|
4019
|
+
DGET: { args: "D r G" },
|
|
4020
|
+
DISC: { args: "r r a a a?" },
|
|
4021
|
+
DMAX: { args: "D r G" },
|
|
4022
|
+
DMIN: { args: "D r G" },
|
|
4023
|
+
DOLLAR: { args: "n w?" },
|
|
4024
|
+
DOLLARDE: { args: "a a" },
|
|
4025
|
+
DOLLARFR: { args: "a a" },
|
|
4026
|
+
DPRODUCT: { args: "D r G" },
|
|
4027
|
+
DROP: { args: "R n n?" },
|
|
4028
|
+
DSTDEV: { args: "D r G" },
|
|
4029
|
+
DSTDEVP: { args: "D r G" },
|
|
4030
|
+
DSUM: { args: "D r G" },
|
|
4031
|
+
DURATION: { args: "r r a a a a?" },
|
|
4032
|
+
DVAR: { args: "D r G" },
|
|
4033
|
+
DVARP: { args: "D r G" },
|
|
4034
|
+
EDATE: { args: "r a" },
|
|
4035
|
+
EFFECT: { args: "a a" },
|
|
4036
|
+
EOMONTH: { args: "r a" },
|
|
4037
|
+
ERF: { args: "x x?" },
|
|
4038
|
+
"ERF.PRECISE": { args: "x" },
|
|
4039
|
+
ERFC: { args: "x" },
|
|
4040
|
+
"ERFC.PRECISE": { args: "x" },
|
|
4041
|
+
"ERROR.TYPE": { args: "a" },
|
|
4042
|
+
EVEN: { args: "n" },
|
|
4043
|
+
EXACT: { args: "s s" },
|
|
4044
|
+
EXP: { args: "n" },
|
|
4045
|
+
EXPAND: { args: "G n n? a?" },
|
|
4046
|
+
"EXPON.DIST": { args: "n n b" },
|
|
4047
|
+
EXPONDIST: { args: "n n b" },
|
|
4048
|
+
"F.DIST": { args: "n i i b" },
|
|
4049
|
+
"F.DIST.RT": { args: "n i i" },
|
|
4050
|
+
"F.INV": { args: "n i i" },
|
|
4051
|
+
"F.INV.RT": { args: "n i i" },
|
|
4052
|
+
"F.TEST": { args: "M M" },
|
|
4053
|
+
FACT: { args: "n" },
|
|
4054
|
+
FACTDOUBLE: { args: "x" },
|
|
4055
|
+
FALSE: { args: "" },
|
|
4056
|
+
FDIST: { args: "n i i" },
|
|
4057
|
+
FILTER: { args: "G R p?" },
|
|
4058
|
+
FIND: { args: "s s w?" },
|
|
4059
|
+
FINDB: { args: "s s w?" },
|
|
4060
|
+
FINV: { args: "n i i" },
|
|
4061
|
+
FISHER: { args: "n" },
|
|
4062
|
+
FISHERINV: { args: "n" },
|
|
4063
|
+
FIXED: { args: "n w? b?" },
|
|
4064
|
+
FLOOR: { args: "n n" },
|
|
4065
|
+
"FLOOR.MATH": { args: "n n? n?" },
|
|
4066
|
+
"FLOOR.PRECISE": { args: "n n?" },
|
|
4067
|
+
FORECAST: { args: "n C C" },
|
|
4068
|
+
"FORECAST.LINEAR": { args: "n C C" },
|
|
4069
|
+
FREQUENCY: { args: "R R" },
|
|
4070
|
+
FTEST: { args: "M M" },
|
|
4071
|
+
FV: { args: "n n n n? n?" },
|
|
4072
|
+
FVSCHEDULE: { args: "x R" },
|
|
4073
|
+
GAMMA: { args: "n" },
|
|
4074
|
+
"GAMMA.DIST": { args: "n n n b" },
|
|
4075
|
+
"GAMMA.INV": { args: "n n n" },
|
|
4076
|
+
GAMMADIST: { args: "n n n b" },
|
|
4077
|
+
GAMMAINV: { args: "n n n" },
|
|
4078
|
+
GAMMALN: { args: "n" },
|
|
4079
|
+
"GAMMALN.PRECISE": { args: "n" },
|
|
4080
|
+
GAUSS: { args: "n" },
|
|
4081
|
+
GCD: {
|
|
4082
|
+
args: "R",
|
|
4083
|
+
rep: 1
|
|
4084
|
+
},
|
|
4085
|
+
GEOMEAN: {
|
|
4086
|
+
args: "N",
|
|
4087
|
+
rep: 1
|
|
4088
|
+
},
|
|
4089
|
+
GESTEP: { args: "a a?" },
|
|
4090
|
+
GROWTH: { args: "G G? G? b?" },
|
|
4091
|
+
HARMEAN: {
|
|
4092
|
+
args: "N",
|
|
4093
|
+
rep: 1
|
|
4094
|
+
},
|
|
4095
|
+
HEX2BIN: { args: "a a?" },
|
|
4096
|
+
HEX2DEC: { args: "v" },
|
|
4097
|
+
HEX2OCT: { args: "a a?" },
|
|
4098
|
+
HLOOKUP: { args: "a R R a?" },
|
|
4099
|
+
HOUR: { args: "h" },
|
|
4100
|
+
HSTACK: {
|
|
4101
|
+
args: "P",
|
|
4102
|
+
rep: 1,
|
|
4103
|
+
max: 254
|
|
4104
|
+
},
|
|
4105
|
+
HYPERLINK: { args: "v v?" },
|
|
4106
|
+
"HYPGEOM.DIST": { args: "i i i i b" },
|
|
4107
|
+
HYPGEOMDIST: { args: "i i i i" },
|
|
4108
|
+
IF: { args: "a P P?" },
|
|
4109
|
+
IFERROR: { args: "a p" },
|
|
4110
|
+
IFNA: { args: "a p" },
|
|
4111
|
+
IFS: {
|
|
4112
|
+
args: "a P",
|
|
4113
|
+
rep: 2
|
|
4114
|
+
},
|
|
4115
|
+
IMABS: { args: "v" },
|
|
4116
|
+
IMAGINARY: { args: "v" },
|
|
4117
|
+
IMARGUMENT: { args: "v" },
|
|
4118
|
+
IMCONJUGATE: { args: "v" },
|
|
4119
|
+
IMCOS: { args: "v" },
|
|
4120
|
+
IMCOSH: { args: "v" },
|
|
4121
|
+
IMCOT: { args: "v" },
|
|
4122
|
+
IMCSC: { args: "v" },
|
|
4123
|
+
IMCSCH: { args: "v" },
|
|
4124
|
+
IMDIV: { args: "v v" },
|
|
4125
|
+
IMEXP: { args: "v" },
|
|
4126
|
+
IMLN: { args: "v" },
|
|
4127
|
+
IMLOG10: { args: "v" },
|
|
4128
|
+
IMLOG2: { args: "v" },
|
|
4129
|
+
IMPOWER: { args: "v x" },
|
|
4130
|
+
IMPRODUCT: {
|
|
4131
|
+
args: "G",
|
|
4132
|
+
rep: 1
|
|
4133
|
+
},
|
|
4134
|
+
IMREAL: { args: "v" },
|
|
4135
|
+
IMSEC: { args: "v" },
|
|
4136
|
+
IMSECH: { args: "v" },
|
|
4137
|
+
IMSIN: { args: "v" },
|
|
4138
|
+
IMSINH: { args: "v" },
|
|
4139
|
+
IMSQRT: { args: "v" },
|
|
4140
|
+
IMSUB: { args: "v v" },
|
|
4141
|
+
IMSUM: {
|
|
4142
|
+
args: "G",
|
|
4143
|
+
rep: 1
|
|
4144
|
+
},
|
|
4145
|
+
IMTAN: { args: "v" },
|
|
4146
|
+
INDEX: { args: "R w w? w?" },
|
|
4147
|
+
INT: { args: "n" },
|
|
4148
|
+
INTERCEPT: { args: "C C" },
|
|
4149
|
+
INTRATE: { args: "r r a a a?" },
|
|
4150
|
+
IPMT: { args: "n n n n n? n?" },
|
|
4151
|
+
IRR: { args: "G n?" },
|
|
4152
|
+
ISBLANK: { args: "a" },
|
|
4153
|
+
ISERR: { args: "a" },
|
|
4154
|
+
ISERROR: { args: "a" },
|
|
4155
|
+
ISEVEN: { args: "x" },
|
|
4156
|
+
ISLOGICAL: { args: "a" },
|
|
4157
|
+
ISNA: { args: "a" },
|
|
4158
|
+
ISNONTEXT: { args: "a" },
|
|
4159
|
+
ISNUMBER: { args: "a" },
|
|
4160
|
+
"ISO.CEILING": { args: "n n?" },
|
|
4161
|
+
ISODD: { args: "x" },
|
|
4162
|
+
ISOWEEKNUM: { args: "d" },
|
|
4163
|
+
ISPMT: { args: "n n n n" },
|
|
4164
|
+
ISREF: { args: "R" },
|
|
4165
|
+
ISTEXT: { args: "a" },
|
|
4166
|
+
KURT: {
|
|
4167
|
+
args: "N",
|
|
4168
|
+
rep: 1
|
|
4169
|
+
},
|
|
4170
|
+
LARGE: { args: "N n" },
|
|
4171
|
+
LCM: {
|
|
4172
|
+
args: "R",
|
|
4173
|
+
rep: 1
|
|
4174
|
+
},
|
|
4175
|
+
LEFT: { args: "s w?" },
|
|
4176
|
+
LEFTB: { args: "s w?" },
|
|
4177
|
+
LEN: { args: "s" },
|
|
4178
|
+
LENB: { args: "s" },
|
|
4179
|
+
LINEST: { args: "G G? b? b?" },
|
|
4180
|
+
LN: { args: "n" },
|
|
4181
|
+
LOG: { args: "n n?" },
|
|
4182
|
+
LOG10: { args: "n" },
|
|
4183
|
+
LOGEST: { args: "G G? b? b?" },
|
|
4184
|
+
LOGINV: { args: "n n n" },
|
|
4185
|
+
"LOGNORM.DIST": { args: "n n n b" },
|
|
4186
|
+
"LOGNORM.INV": { args: "n n n" },
|
|
4187
|
+
LOGNORMDIST: { args: "n n n" },
|
|
4188
|
+
LOOKUP: { args: "a G R?" },
|
|
4189
|
+
LOWER: { args: "s" },
|
|
4190
|
+
MATCH: { args: "a R r?" },
|
|
4191
|
+
MAX: {
|
|
4192
|
+
args: "N",
|
|
4193
|
+
rep: 1
|
|
4194
|
+
},
|
|
4195
|
+
MAXA: {
|
|
4196
|
+
args: "A",
|
|
4197
|
+
rep: 1
|
|
4198
|
+
},
|
|
4199
|
+
MAXIFS: {
|
|
4200
|
+
args: "R R a",
|
|
4201
|
+
rep: 2,
|
|
4202
|
+
max: 254,
|
|
4203
|
+
notOmitted: {
|
|
4204
|
+
at: [0],
|
|
4205
|
+
from: 1,
|
|
4206
|
+
odd: !0
|
|
4207
|
+
}
|
|
4208
|
+
},
|
|
4209
|
+
MDETERM: { args: "M" },
|
|
4210
|
+
MDURATION: { args: "r r a a a a?" },
|
|
4211
|
+
MEDIAN: {
|
|
4212
|
+
args: "N",
|
|
4213
|
+
rep: 1
|
|
4214
|
+
},
|
|
4215
|
+
MID: { args: "s i i" },
|
|
4216
|
+
MIDB: { args: "s i i" },
|
|
4217
|
+
MIN: {
|
|
4218
|
+
args: "N",
|
|
4219
|
+
rep: 1
|
|
4220
|
+
},
|
|
4221
|
+
MINA: {
|
|
4222
|
+
args: "A",
|
|
4223
|
+
rep: 1
|
|
4224
|
+
},
|
|
4225
|
+
MINIFS: {
|
|
4226
|
+
args: "R R a",
|
|
4227
|
+
rep: 2,
|
|
4228
|
+
max: 254,
|
|
4229
|
+
notOmitted: {
|
|
4230
|
+
at: [0],
|
|
4231
|
+
from: 1,
|
|
4232
|
+
odd: !0
|
|
4233
|
+
}
|
|
4234
|
+
},
|
|
4235
|
+
MINUTE: { args: "h" },
|
|
4236
|
+
MINVERSE: { args: "M" },
|
|
4237
|
+
MIRR: { args: "R n n" },
|
|
4238
|
+
MMULT: { args: "M M" },
|
|
4239
|
+
MOD: { args: "n n" },
|
|
4240
|
+
MODE: {
|
|
4241
|
+
args: "G",
|
|
4242
|
+
rep: 1
|
|
4243
|
+
},
|
|
4244
|
+
"MODE.MULT": {
|
|
4245
|
+
args: "G",
|
|
4246
|
+
rep: 1,
|
|
4247
|
+
max: 254
|
|
4248
|
+
},
|
|
4249
|
+
"MODE.SNGL": {
|
|
4250
|
+
args: "G",
|
|
4251
|
+
rep: 1,
|
|
4252
|
+
max: 254
|
|
4253
|
+
},
|
|
4254
|
+
MONTH: { args: "t" },
|
|
4255
|
+
MROUND: { args: "x x" },
|
|
4256
|
+
MULTINOMIAL: {
|
|
4257
|
+
args: "R",
|
|
4258
|
+
rep: 1
|
|
4259
|
+
},
|
|
4260
|
+
MUNIT: { args: "i" },
|
|
4261
|
+
N: { args: "a" },
|
|
4262
|
+
NA: { args: "" },
|
|
4263
|
+
"NEGBINOM.DIST": { args: "i i n b" },
|
|
4264
|
+
NEGBINOMDIST: { args: "i i n" },
|
|
4265
|
+
NETWORKDAYS: { args: "r r V?" },
|
|
4266
|
+
"NETWORKDAYS.INTL": { args: "r r a? V?" },
|
|
4267
|
+
NOMINAL: { args: "a a" },
|
|
4268
|
+
"NORM.DIST": { args: "n n n b" },
|
|
4269
|
+
"NORM.INV": { args: "n n n" },
|
|
4270
|
+
"NORM.S.DIST": { args: "n b" },
|
|
4271
|
+
"NORM.S.INV": { args: "n" },
|
|
4272
|
+
NORMDIST: { args: "n n n b" },
|
|
4273
|
+
NORMINV: { args: "n n n" },
|
|
4274
|
+
NORMSDIST: { args: "n" },
|
|
4275
|
+
NORMSINV: { args: "n" },
|
|
4276
|
+
NOT: { args: "b" },
|
|
4277
|
+
NOW: { args: "" },
|
|
4278
|
+
NPER: { args: "n n n n? n?" },
|
|
4279
|
+
NPV: {
|
|
4280
|
+
args: "n N",
|
|
4281
|
+
rep: 1
|
|
4282
|
+
},
|
|
4283
|
+
NUMBERVALUE: { args: "s s? s?" },
|
|
4284
|
+
OCT2BIN: { args: "a a?" },
|
|
4285
|
+
OCT2DEC: { args: "v" },
|
|
4286
|
+
OCT2HEX: { args: "a a?" },
|
|
4287
|
+
ODD: { args: "n" },
|
|
4288
|
+
ODDFPRICE: { args: "r r r r a a a a a?" },
|
|
4289
|
+
ODDFYIELD: { args: "r r r r a a a a a?" },
|
|
4290
|
+
ODDLPRICE: { args: "r r r a a a a a?" },
|
|
4291
|
+
ODDLYIELD: { args: "r r r a a a a a?" },
|
|
4292
|
+
OR: {
|
|
4293
|
+
args: "V",
|
|
4294
|
+
rep: 1
|
|
4295
|
+
},
|
|
4296
|
+
PDURATION: { args: "n n n" },
|
|
4297
|
+
PEARSON: { args: "C C" },
|
|
4298
|
+
PERCENTILE: { args: "N n" },
|
|
4299
|
+
"PERCENTILE.EXC": { args: "N n" },
|
|
4300
|
+
"PERCENTILE.INC": { args: "N n" },
|
|
4301
|
+
PERCENTOF: { args: "V V" },
|
|
4302
|
+
PERCENTRANK: { args: "N n i?" },
|
|
4303
|
+
"PERCENTRANK.EXC": { args: "N n i?" },
|
|
4304
|
+
"PERCENTRANK.INC": { args: "N n i?" },
|
|
4305
|
+
PERMUT: { args: "i i" },
|
|
4306
|
+
PERMUTATIONA: { args: "i i" },
|
|
4307
|
+
PHI: { args: "n" },
|
|
4308
|
+
PI: { args: "" },
|
|
4309
|
+
PMT: { args: "n n n n? n?" },
|
|
4310
|
+
POISSON: { args: "n n b" },
|
|
4311
|
+
"POISSON.DIST": { args: "n n b" },
|
|
4312
|
+
POWER: { args: "n n" },
|
|
4313
|
+
PPMT: { args: "n n n n n? n?" },
|
|
4314
|
+
PRICE: { args: "r r a a a a a?" },
|
|
4315
|
+
PRICEDISC: { args: "r r a a a?" },
|
|
4316
|
+
PRICEMAT: { args: "r r r a a a?" },
|
|
4317
|
+
PROB: { args: "M M n n?" },
|
|
4318
|
+
PRODUCT: {
|
|
4319
|
+
args: "N",
|
|
4320
|
+
rep: 1
|
|
4321
|
+
},
|
|
4322
|
+
PROPER: { args: "s" },
|
|
4323
|
+
PV: { args: "n n n n? n?" },
|
|
4324
|
+
QUARTILE: { args: "N n" },
|
|
4325
|
+
"QUARTILE.EXC": { args: "N n" },
|
|
4326
|
+
"QUARTILE.INC": { args: "N n" },
|
|
4327
|
+
QUOTIENT: { args: "x x" },
|
|
4328
|
+
RADIANS: { args: "n" },
|
|
4329
|
+
RAND: { args: "" },
|
|
4330
|
+
RANDARRAY: { args: "n? n? n? n? b?" },
|
|
4331
|
+
RANDBETWEEN: { args: "n n" },
|
|
4332
|
+
RANK: {
|
|
4333
|
+
args: "n N v?",
|
|
4334
|
+
notOmitted: { at: [1] }
|
|
4335
|
+
},
|
|
4336
|
+
"RANK.AVG": {
|
|
4337
|
+
args: "n N v?",
|
|
4338
|
+
notOmitted: { at: [1] }
|
|
4339
|
+
},
|
|
4340
|
+
"RANK.EQ": {
|
|
4341
|
+
args: "n N v?",
|
|
4342
|
+
notOmitted: { at: [1] }
|
|
4343
|
+
},
|
|
4344
|
+
RATE: { args: "n n n n? n? n?" },
|
|
4345
|
+
RECEIVED: { args: "r r a a a?" },
|
|
4346
|
+
REPLACE: { args: "s w w s" },
|
|
4347
|
+
REPLACEB: { args: "s w w s" },
|
|
4348
|
+
REPT: { args: "s i" },
|
|
4349
|
+
RIGHT: { args: "s w?" },
|
|
4350
|
+
RIGHTB: { args: "s w?" },
|
|
4351
|
+
ROMAN: { args: "n v?" },
|
|
4352
|
+
ROUND: { args: "n w" },
|
|
4353
|
+
ROUNDDOWN: { args: "n i" },
|
|
4354
|
+
ROUNDUP: { args: "n i" },
|
|
4355
|
+
ROW: { args: "R?" },
|
|
4356
|
+
ROWS: { args: "G" },
|
|
4357
|
+
RRI: { args: "n n n" },
|
|
4358
|
+
RSQ: { args: "C C" },
|
|
4359
|
+
SEARCH: { args: "s s w?" },
|
|
4360
|
+
SEARCHB: { args: "s s w?" },
|
|
4361
|
+
SEC: { args: "n" },
|
|
4362
|
+
SECH: { args: "n" },
|
|
4363
|
+
SECOND: { args: "h" },
|
|
4364
|
+
SEQUENCE: { args: "n n? n? n?" },
|
|
4365
|
+
SERIESSUM: { args: "x x x V" },
|
|
4366
|
+
SIGN: { args: "n" },
|
|
4367
|
+
SIN: { args: "n" },
|
|
4368
|
+
SINH: { args: "n" },
|
|
4369
|
+
SKEW: {
|
|
4370
|
+
args: "N",
|
|
4371
|
+
rep: 1
|
|
4372
|
+
},
|
|
4373
|
+
"SKEW.P": {
|
|
4374
|
+
args: "N",
|
|
4375
|
+
rep: 1,
|
|
4376
|
+
max: 254
|
|
4377
|
+
},
|
|
4378
|
+
SLN: { args: "n n n" },
|
|
4379
|
+
SLOPE: { args: "C C" },
|
|
4380
|
+
SMALL: { args: "N n" },
|
|
4381
|
+
SORT: { args: "G G? G? b?" },
|
|
4382
|
+
SORTBY: {
|
|
4383
|
+
args: "R R p?",
|
|
4384
|
+
rep: 2,
|
|
4385
|
+
max: 254
|
|
4386
|
+
},
|
|
4387
|
+
SQRT: { args: "n" },
|
|
4388
|
+
SQRTPI: { args: "x" },
|
|
4389
|
+
STANDARDIZE: { args: "n n n" },
|
|
4390
|
+
STDEV: {
|
|
4391
|
+
args: "N",
|
|
4392
|
+
rep: 1
|
|
4393
|
+
},
|
|
4394
|
+
"STDEV.P": {
|
|
4395
|
+
args: "N",
|
|
4396
|
+
rep: 1,
|
|
4397
|
+
max: 254
|
|
4398
|
+
},
|
|
4399
|
+
"STDEV.S": {
|
|
4400
|
+
args: "N",
|
|
4401
|
+
rep: 1,
|
|
4402
|
+
max: 254
|
|
4403
|
+
},
|
|
4404
|
+
STDEVA: {
|
|
4405
|
+
args: "A",
|
|
4406
|
+
rep: 1
|
|
4407
|
+
},
|
|
4408
|
+
STDEVP: {
|
|
4409
|
+
args: "N",
|
|
4410
|
+
rep: 1
|
|
4411
|
+
},
|
|
4412
|
+
STDEVPA: {
|
|
4413
|
+
args: "A",
|
|
4414
|
+
rep: 1
|
|
4415
|
+
},
|
|
4416
|
+
STEYX: { args: "C C" },
|
|
4417
|
+
SUBSTITUTE: { args: "s s s w?" },
|
|
4418
|
+
SUBTOTAL: {
|
|
4419
|
+
args: "n R",
|
|
4420
|
+
rep: 1,
|
|
4421
|
+
notOmitted: { from: 1 }
|
|
4422
|
+
},
|
|
4423
|
+
SUM: {
|
|
4424
|
+
args: "N",
|
|
4425
|
+
rep: 1
|
|
4426
|
+
},
|
|
4427
|
+
SUMIF: {
|
|
4428
|
+
args: "R a R?",
|
|
4429
|
+
notOmitted: { at: [0, 2] }
|
|
4430
|
+
},
|
|
4431
|
+
SUMIFS: {
|
|
4432
|
+
args: "R R a",
|
|
4433
|
+
rep: 2,
|
|
4434
|
+
notOmitted: {
|
|
4435
|
+
at: [0],
|
|
4436
|
+
from: 1,
|
|
4437
|
+
odd: !0
|
|
4438
|
+
}
|
|
4439
|
+
},
|
|
4440
|
+
SUMPRODUCT: {
|
|
4441
|
+
args: "R",
|
|
4442
|
+
rep: 1
|
|
4443
|
+
},
|
|
4444
|
+
SUMSQ: {
|
|
4445
|
+
args: "N",
|
|
4446
|
+
rep: 1
|
|
4447
|
+
},
|
|
4448
|
+
SUMX2MY2: { args: "C C" },
|
|
4449
|
+
SUMX2PY2: { args: "C C" },
|
|
4450
|
+
SUMXMY2: { args: "C C" },
|
|
4451
|
+
SWITCH: {
|
|
4452
|
+
args: "a P P",
|
|
4453
|
+
rep: 1,
|
|
4454
|
+
max: 254
|
|
4455
|
+
},
|
|
4456
|
+
SYD: { args: "n n n n" },
|
|
4457
|
+
T: { args: "a" },
|
|
4458
|
+
"T.DIST": { args: "n i b" },
|
|
4459
|
+
"T.DIST.2T": { args: "n i" },
|
|
4460
|
+
"T.DIST.RT": { args: "n i" },
|
|
4461
|
+
"T.INV": { args: "n i" },
|
|
4462
|
+
"T.INV.2T": { args: "n i" },
|
|
4463
|
+
"T.TEST": { args: "C C w w" },
|
|
4464
|
+
TAKE: { args: "R n n?" },
|
|
4465
|
+
TAN: { args: "n" },
|
|
4466
|
+
TANH: { args: "n" },
|
|
4467
|
+
TBILLEQ: { args: "r r a" },
|
|
4468
|
+
TBILLPRICE: { args: "r r a" },
|
|
4469
|
+
TBILLYIELD: { args: "r r a" },
|
|
4470
|
+
TDIST: { args: "n i w" },
|
|
4471
|
+
TEXT: { args: "v s" },
|
|
4472
|
+
TEXTAFTER: { args: "s V n? i? i? a?" },
|
|
4473
|
+
TEXTBEFORE: { args: "s V n? i? i? a?" },
|
|
4474
|
+
TEXTJOIN: {
|
|
4475
|
+
args: "V b V",
|
|
4476
|
+
rep: 1,
|
|
4477
|
+
max: 254
|
|
4478
|
+
},
|
|
4479
|
+
TEXTSPLIT: { args: "s V V? b? i? a?" },
|
|
4480
|
+
TIME: { args: "n n n" },
|
|
4481
|
+
TIMEVALUE: { args: "v" },
|
|
4482
|
+
TINV: { args: "n i" },
|
|
4483
|
+
TOCOL: { args: "R i? b?" },
|
|
4484
|
+
TODAY: { args: "" },
|
|
4485
|
+
TOROW: { args: "R i? b?" },
|
|
4486
|
+
TRANSPOSE: { args: "R" },
|
|
4487
|
+
TREND: { args: "G G? G? b?" },
|
|
4488
|
+
TRIM: { args: "s" },
|
|
4489
|
+
TRIMMEAN: { args: "N n" },
|
|
4490
|
+
TRUE: { args: "" },
|
|
4491
|
+
TRUNC: { args: "n i?" },
|
|
4492
|
+
TTEST: { args: "C C w w" },
|
|
4493
|
+
TYPE: { args: "R" },
|
|
4494
|
+
UNICHAR: { args: "i" },
|
|
4495
|
+
UNICODE: { args: "s" },
|
|
4496
|
+
UNIQUE: { args: "G b? b?" },
|
|
4497
|
+
UPPER: { args: "s" },
|
|
4498
|
+
VALUE: { args: "v" },
|
|
4499
|
+
VALUETOTEXT: { args: "a w?" },
|
|
4500
|
+
VAR: {
|
|
4501
|
+
args: "N",
|
|
4502
|
+
rep: 1
|
|
4503
|
+
},
|
|
4504
|
+
"VAR.P": {
|
|
4505
|
+
args: "N",
|
|
4506
|
+
rep: 1,
|
|
4507
|
+
max: 254
|
|
4508
|
+
},
|
|
4509
|
+
"VAR.S": {
|
|
4510
|
+
args: "N",
|
|
4511
|
+
rep: 1,
|
|
4512
|
+
max: 254
|
|
4513
|
+
},
|
|
4514
|
+
VARA: {
|
|
4515
|
+
args: "A",
|
|
4516
|
+
rep: 1
|
|
4517
|
+
},
|
|
4518
|
+
VARP: {
|
|
4519
|
+
args: "N",
|
|
4520
|
+
rep: 1
|
|
4521
|
+
},
|
|
4522
|
+
VARPA: {
|
|
4523
|
+
args: "A",
|
|
4524
|
+
rep: 1
|
|
4525
|
+
},
|
|
4526
|
+
VLOOKUP: { args: "a R R a?" },
|
|
4527
|
+
VSTACK: {
|
|
4528
|
+
args: "P",
|
|
4529
|
+
rep: 1,
|
|
4530
|
+
max: 254
|
|
4531
|
+
},
|
|
4532
|
+
WEEKDAY: { args: "a a?" },
|
|
4533
|
+
WEEKNUM: { args: "r a?" },
|
|
4534
|
+
WEIBULL: { args: "n n n b" },
|
|
4535
|
+
"WEIBULL.DIST": { args: "n n n b" },
|
|
4536
|
+
WORKDAY: { args: "r a V?" },
|
|
4537
|
+
"WORKDAY.INTL": { args: "r a a? V?" },
|
|
4538
|
+
WRAPCOLS: { args: "G n a?" },
|
|
4539
|
+
WRAPROWS: { args: "G n a?" },
|
|
4540
|
+
XIRR: { args: "G G a?" },
|
|
4541
|
+
XLOOKUP: { args: "a G R P? n? n?" },
|
|
4542
|
+
XMATCH: { args: "a G n? n?" },
|
|
4543
|
+
XNPV: { args: "a G G" },
|
|
4544
|
+
XOR: {
|
|
4545
|
+
args: "V",
|
|
4546
|
+
rep: 1,
|
|
4547
|
+
max: 254
|
|
4548
|
+
},
|
|
4549
|
+
YEAR: { args: "t" },
|
|
4550
|
+
YEARFRAC: { args: "r r a?" },
|
|
4551
|
+
YIELD: { args: "r r a a a a a?" },
|
|
4552
|
+
YIELDDISC: { args: "r r a a a?" },
|
|
4553
|
+
YIELDMAT: { args: "r r r a a a?" },
|
|
4554
|
+
"Z.TEST": { args: "N n n?" },
|
|
4555
|
+
ZTEST: { args: "N n n?" }
|
|
4556
|
+
}));
|
|
4557
|
+
var To = /* @__PURE__ */ ye(mo), Eo = /* @__PURE__ */ ye(Co), Do = /* @__PURE__ */ ye(So);
|
|
4558
|
+
//#endregion
|
|
4559
|
+
export { Eo as entryText, Do as needsApostrophe, To as parseEntry };
|