@sheetxl/sdk 0.1.98
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/LICENSE.md +11 -0
- package/README.md +30 -0
- package/build/browser/cjs/7Yh1PqgSd93uKFOq.cjs +6 -0
- package/build/browser/cjs/AbBzPqrBe_7Scafy.cjs +6 -0
- package/build/browser/cjs/B2jt9h-29UhlG-ir.cjs +6 -0
- package/build/browser/cjs/BAY6G2idlFTr3aXF.cjs +6 -0
- package/build/browser/cjs/BJAOd8ki61yYMUO8.cjs +6 -0
- package/build/browser/cjs/BNfn1no9QwiHEFwd.cjs +6 -0
- package/build/browser/cjs/BUkgy8lQRuxtyPlh.cjs +6 -0
- package/build/browser/cjs/B_O3B0P2cyGD9Rbm.cjs +6 -0
- package/build/browser/cjs/BkmEUMAKvuzsSqbR.cjs +7 -0
- package/build/browser/cjs/BlllxPbkhoY0sEC4.cjs +23 -0
- package/build/browser/cjs/BmT4qU5bgAIPFNTH.cjs +124 -0
- package/build/browser/cjs/BqZnbFL2t1u1XgPn.cjs +6 -0
- package/build/browser/cjs/Bs6xUWpBc0gC2FqH.cjs +6 -0
- package/build/browser/cjs/Bsv5BCVCW5dIA5It.cjs +1511 -0
- package/build/browser/cjs/ByZLM15SpxjqWDYX.cjs +6 -0
- package/build/browser/cjs/CaHv2p0pVvOc7XPO.cjs +42 -0
- package/build/browser/cjs/CcIliks7z_TMUXOM.cjs +6 -0
- package/build/browser/cjs/CpbUnis3pqWrW9H4.cjs +11 -0
- package/build/browser/cjs/CvGHijwHYOsCppoo.cjs +6 -0
- package/build/browser/cjs/D5m2Wlak7m4vG0kA.cjs +6 -0
- package/build/browser/cjs/DSNXa0HNC7bG9qZw.cjs +6 -0
- package/build/browser/cjs/DZ-H3oz78Mjq38DI.cjs +6 -0
- package/build/browser/cjs/Da34iNTZrWBA6OUT.cjs +6 -0
- package/build/browser/cjs/DfMNPyGio0O0RToU.cjs +6 -0
- package/build/browser/cjs/Dghi8Yq5nXZtUpoV.cjs +80 -0
- package/build/browser/cjs/Dk63Co0TJejVtNXp.cjs +6 -0
- package/build/browser/cjs/ErSjtO5fMJzUVHk4.cjs +6 -0
- package/build/browser/cjs/G-xZJIN6jjcTuQXA.cjs +6 -0
- package/build/browser/cjs/GPfZ0ZpBee250ywR.cjs +20 -0
- package/build/browser/cjs/IHypcrtWCiX_F0RJ.cjs +11 -0
- package/build/browser/cjs/X-HIF0659hMdI4Fu.cjs +6 -0
- package/build/browser/cjs/index.cjs +6 -0
- package/build/browser/cjs/qhBvSFMQ_DepDCwv.cjs +6 -0
- package/build/browser/cjs/wYOZ6mjOO7MbdyBZ.cjs +6 -0
- package/build/browser/esm/70LlV-Ub5gQiHal4.mjs +10 -0
- package/build/browser/esm/71Qocy3xStWv_56t.mjs +10 -0
- package/build/browser/esm/B9-WgxZWcZj4jdUC.mjs +10 -0
- package/build/browser/esm/BAKRnfUqPzHyyiLx.mjs +3966 -0
- package/build/browser/esm/BChNW8QNTMP8QXKM.mjs +484 -0
- package/build/browser/esm/BCzBxiWxCFs-jcmK.mjs +5651 -0
- package/build/browser/esm/BOn1aDBCyrMSMmVr.mjs +10 -0
- package/build/browser/esm/BPqJ7trmE53kA4iD.mjs +10 -0
- package/build/browser/esm/B_XqbIeKalrEkjs7.mjs +10 -0
- package/build/browser/esm/B_b5FIYJnm4UKAEc.mjs +28 -0
- package/build/browser/esm/BoWGCLoCBi99JpFs.mjs +10 -0
- package/build/browser/esm/Bq9W-xButcfpjGEk.mjs +433 -0
- package/build/browser/esm/ByxOyRbOjkmiHT8z.mjs +10 -0
- package/build/browser/esm/CAxIV1vPiKW9r_Yh.mjs +10 -0
- package/build/browser/esm/CFw23OkHfPquoVEk.mjs +10 -0
- package/build/browser/esm/CG8a93kgahRemVJe.mjs +10 -0
- package/build/browser/esm/CN45di2IcbM8P0Qu.mjs +10 -0
- package/build/browser/esm/COgfNXNmX_PF_eWZ.mjs +35 -0
- package/build/browser/esm/CPv7OpinaYcwbA_W.mjs +10 -0
- package/build/browser/esm/Cfhp3FCr7wP0Rnfu.mjs +10 -0
- package/build/browser/esm/D4GeLOfATuEzvjPr.mjs +1586 -0
- package/build/browser/esm/DMas1DZMe9F5tPaN.mjs +23970 -0
- package/build/browser/esm/DS4xBjO2TN0rQ1lJ.mjs +10 -0
- package/build/browser/esm/DTM0pK30PrZRsXYw.mjs +10 -0
- package/build/browser/esm/DgslJ1_vlPooGZHU.mjs +10 -0
- package/build/browser/esm/DmEPCZ9FSKO_TRTA.mjs +10 -0
- package/build/browser/esm/Do_EO3eQIyPgc7uz.mjs +30 -0
- package/build/browser/esm/ERMewE78C__HUblm.mjs +10 -0
- package/build/browser/esm/Qib5_XvQHWOPzGrm.mjs +10 -0
- package/build/browser/esm/SSYRYFzxzHWQzdAN.mjs +12 -0
- package/build/browser/esm/V_ha0oCA5_oDPanz.mjs +832 -0
- package/build/browser/esm/gTh1PiesKrQblf8O.mjs +10 -0
- package/build/browser/esm/g_p1uVDePbDJJ4nX.mjs +10 -0
- package/build/browser/esm/index.mjs +89 -0
- package/build/licenses/dependencies.txt +1239 -0
- package/build/node/esm/4HPektqH91Rh-rsq.mjs +2445 -0
- package/build/node/esm/70LlV-Ub5gQiHal4.mjs +10 -0
- package/build/node/esm/B9-WgxZWcZj4jdUC.mjs +10 -0
- package/build/node/esm/BDxewg-utn4BhUXl.mjs +35 -0
- package/build/node/esm/BPqJ7trmE53kA4iD.mjs +10 -0
- package/build/node/esm/BUOg554dxBM0VWFi.mjs +22 -0
- package/build/node/esm/B_XqbIeKalrEkjs7.mjs +10 -0
- package/build/node/esm/BoWGCLoCBi99JpFs.mjs +10 -0
- package/build/node/esm/ByxOyRbOjkmiHT8z.mjs +10 -0
- package/build/node/esm/CFw23OkHfPquoVEk.mjs +10 -0
- package/build/node/esm/CG8a93kgahRemVJe.mjs +10 -0
- package/build/node/esm/CN45di2IcbM8P0Qu.mjs +10 -0
- package/build/node/esm/CNOiP4baOWSizP6F.mjs +1070 -0
- package/build/node/esm/CPv7OpinaYcwbA_W.mjs +10 -0
- package/build/node/esm/CVAFJAiy4lznWzaG.mjs +10 -0
- package/build/node/esm/CZd8SSXlusZy49FM.mjs +10 -0
- package/build/node/esm/CZw7SgmfxSHhZZe0.mjs +10 -0
- package/build/node/esm/Cdjab80o1WocCHgN.mjs +13 -0
- package/build/node/esm/CfWoSrOmaP9LrFja.mjs +466 -0
- package/build/node/esm/CnaBpzYiURAKhAxF.mjs +825 -0
- package/build/node/esm/Cp5ea9Hpxse8B4mC.mjs +10 -0
- package/build/node/esm/DH_fbhyW3PwE1rYa.mjs +10 -0
- package/build/node/esm/DNHqdv3-ufdcF5zc.mjs +20 -0
- package/build/node/esm/DS4xBjO2TN0rQ1lJ.mjs +10 -0
- package/build/node/esm/DTM0pK30PrZRsXYw.mjs +10 -0
- package/build/node/esm/DlFgt0KLeXDowatv.mjs +10 -0
- package/build/node/esm/ERMewE78C__HUblm.mjs +10 -0
- package/build/node/esm/GTFYlX2Atw10TdFe.mjs +86 -0
- package/build/node/esm/Qib5_XvQHWOPzGrm.mjs +10 -0
- package/build/node/esm/gTh1PiesKrQblf8O.mjs +10 -0
- package/build/node/esm/g_p1uVDePbDJJ4nX.mjs +10 -0
- package/build/node/esm/index.mjs +23412 -0
- package/build/package.json +58 -0
- package/build/types/index.d.ts +20624 -0
- package/package.json +85 -0
|
@@ -0,0 +1,484 @@
|
|
|
1
|
+
import { $ as he } from "./V_ha0oCA5_oDPanz.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* @license @sheetxl/sdk - A high-performance, embeddable spreadsheet engine. - v0.0.0
|
|
4
|
+
*
|
|
5
|
+
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
6
|
+
* License: The license can be found at https://www.sheetxl.com/license.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* @license @sheetxl/scripting - SheetXL scripting utilities including TypeScript compilation. - v0.0.0
|
|
10
|
+
*
|
|
11
|
+
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
12
|
+
* License: The license can be found at https://www.sheetxl.com/license.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* @license @sheetxl/primitives - Primitive - Base types for SheetXL functions. - v0.0.0
|
|
16
|
+
*
|
|
17
|
+
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
18
|
+
* License: The license can be found at https://www.sheetxl.com/license.
|
|
19
|
+
*/
|
|
20
|
+
var se, q, r;
|
|
21
|
+
(q = se || (se = {})).Orientation = { Column: "column", Row: "row" }, q.Orientations = { ...q.Orientation, Both: "both" }, q.Direction = { Up: "up", Down: "down", Left: "left", Right: "right" }, ((e) => {
|
|
22
|
+
e.Code = { Parse: 0, Null: 1, Div0: 2, Value: 3, Ref: 4, Name: 5, Num: 6, NA: 7, GettingData: 8, Spill: 9, Connect: 10, Blocked: 11, Unknown: 12, Field: 13, Calc: 14, Busy: 16, Python: 19, Timeout: 20 }, e.Label = { Parse: "#PARSE!", Null: "#NULL!", Div0: "#DIV/0!", Value: "#VALUE!", Ref: "#REF!", Name: "#NAME?", Num: "#NUM!", NA: "#N/A", GettingData: "#GETTING_DATA", Spill: "#SPILL!", Connect: "#CONNECT!", Blocked: "#BLOCKED!", Unknown: "#UNKNOWN!", Field: "#FIELD!", Calc: "#CALC!", Busy: "#BUSY!", Python: "#PYTHON!", Timeout: "#TIMEOUT!" };
|
|
23
|
+
class a extends Error {
|
|
24
|
+
constructor(n, i, S, J) {
|
|
25
|
+
super(S, J), this._label = i, this._code = n, this.details = J;
|
|
26
|
+
}
|
|
27
|
+
static {
|
|
28
|
+
this.code = e.Code.Unknown;
|
|
29
|
+
}
|
|
30
|
+
get isFormulaError() {
|
|
31
|
+
return !0;
|
|
32
|
+
}
|
|
33
|
+
getLabel() {
|
|
34
|
+
return this._label;
|
|
35
|
+
}
|
|
36
|
+
getCode() {
|
|
37
|
+
return this._code;
|
|
38
|
+
}
|
|
39
|
+
equals(n) {
|
|
40
|
+
return !!n && (this._code === n._code || this._code === n.code);
|
|
41
|
+
}
|
|
42
|
+
get [Symbol.toStringTag]() {
|
|
43
|
+
return "[FormulaError]";
|
|
44
|
+
}
|
|
45
|
+
toString() {
|
|
46
|
+
return this.message || this._label;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
e.Known = a;
|
|
50
|
+
class T extends a {
|
|
51
|
+
constructor(n, i) {
|
|
52
|
+
super(e.Code.Parse, e.Label.Parse, n, i);
|
|
53
|
+
}
|
|
54
|
+
static {
|
|
55
|
+
this.code = e.Code.Parse;
|
|
56
|
+
}
|
|
57
|
+
getDetails() {
|
|
58
|
+
const n = this.details;
|
|
59
|
+
return { line: n?.line ?? 1, column: n?.column ?? 1, offset: n?.offset ?? 0, length: n?.length ?? 0 };
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
e.Parse = T;
|
|
63
|
+
class x extends a {
|
|
64
|
+
constructor(n, i) {
|
|
65
|
+
super(e.Code.Null, e.Label.Null, n, i);
|
|
66
|
+
}
|
|
67
|
+
static {
|
|
68
|
+
this.code = e.Code.Null;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
e.Null = x;
|
|
72
|
+
class j extends a {
|
|
73
|
+
constructor(n, i) {
|
|
74
|
+
super(e.Code.Div0, e.Label.Div0, n, i);
|
|
75
|
+
}
|
|
76
|
+
static {
|
|
77
|
+
this.code = e.Code.Div0;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
e.Div0 = j;
|
|
81
|
+
class X extends a {
|
|
82
|
+
constructor(n, i) {
|
|
83
|
+
super(e.Code.Value, e.Label.Value, n, i);
|
|
84
|
+
}
|
|
85
|
+
static {
|
|
86
|
+
this.code = e.Code.Value;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
e.Value = X;
|
|
90
|
+
class s extends a {
|
|
91
|
+
constructor(n, i) {
|
|
92
|
+
super(e.Code.Ref, e.Label.Ref, n, i);
|
|
93
|
+
}
|
|
94
|
+
static {
|
|
95
|
+
this.code = e.Code.Ref;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
e.Ref = s;
|
|
99
|
+
class K extends a {
|
|
100
|
+
constructor(n, i) {
|
|
101
|
+
super(e.Code.Name, e.Label.Name, n, i);
|
|
102
|
+
}
|
|
103
|
+
static {
|
|
104
|
+
this.code = e.Code.Name;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
e.Name = K;
|
|
108
|
+
class U extends a {
|
|
109
|
+
constructor(n, i) {
|
|
110
|
+
super(e.Code.Num, e.Label.Num, n, i);
|
|
111
|
+
}
|
|
112
|
+
static {
|
|
113
|
+
this.code = e.Code.Num;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
e.Num = U;
|
|
117
|
+
class z extends a {
|
|
118
|
+
constructor(n, i) {
|
|
119
|
+
super(e.Code.NA, e.Label.NA, n, i);
|
|
120
|
+
}
|
|
121
|
+
static {
|
|
122
|
+
this.code = e.Code.NA;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
e.NA = z;
|
|
126
|
+
class Y extends a {
|
|
127
|
+
constructor(n, i) {
|
|
128
|
+
super(e.Code.GettingData, e.Label.GettingData, n, i);
|
|
129
|
+
}
|
|
130
|
+
static {
|
|
131
|
+
this.code = e.Code.GettingData;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
e.GettingData = Y;
|
|
135
|
+
class M extends a {
|
|
136
|
+
constructor(n, i) {
|
|
137
|
+
super(e.Code.Spill, e.Label.Spill, n, i);
|
|
138
|
+
}
|
|
139
|
+
static {
|
|
140
|
+
this.code = e.Code.Spill;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
e.Spill = M;
|
|
144
|
+
class I extends a {
|
|
145
|
+
constructor(n, i) {
|
|
146
|
+
super(e.Code.Connect, e.Label.Connect, n, i);
|
|
147
|
+
}
|
|
148
|
+
static {
|
|
149
|
+
this.code = e.Code.Connect;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
e.Connect = I;
|
|
153
|
+
class G extends a {
|
|
154
|
+
constructor(n, i) {
|
|
155
|
+
super(e.Code.Blocked, e.Label.Blocked, n, i);
|
|
156
|
+
}
|
|
157
|
+
static {
|
|
158
|
+
this.code = e.Code.Blocked;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
e.Blocked = G;
|
|
162
|
+
class _ extends a {
|
|
163
|
+
constructor(n, i) {
|
|
164
|
+
super(e.Code.Unknown, e.Label.Unknown, n, i);
|
|
165
|
+
}
|
|
166
|
+
static {
|
|
167
|
+
this.code = e.Code.Unknown;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
e.Unknown = _;
|
|
171
|
+
class F extends a {
|
|
172
|
+
constructor(n, i) {
|
|
173
|
+
super(e.Code.Field, e.Label.Field, n, i);
|
|
174
|
+
}
|
|
175
|
+
static {
|
|
176
|
+
this.code = e.Code.Field;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
e.Field = F;
|
|
180
|
+
class Q extends a {
|
|
181
|
+
constructor(n, i) {
|
|
182
|
+
super(e.Code.Calc, e.Label.Calc, n, i);
|
|
183
|
+
}
|
|
184
|
+
static {
|
|
185
|
+
this.code = e.Code.Calc;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
e.Calc = Q;
|
|
189
|
+
class O extends a {
|
|
190
|
+
constructor(n, i) {
|
|
191
|
+
super(e.Code.Busy, e.Label.Busy, n, i);
|
|
192
|
+
}
|
|
193
|
+
static {
|
|
194
|
+
this.code = e.Code.Busy;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
e.Busy = O;
|
|
198
|
+
class P extends a {
|
|
199
|
+
constructor(n, i) {
|
|
200
|
+
super(e.Code.Python, e.Label.Python, n, i);
|
|
201
|
+
}
|
|
202
|
+
static {
|
|
203
|
+
this.code = e.Code.Python;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
e.Python = P;
|
|
207
|
+
class Z extends a {
|
|
208
|
+
constructor(n, i) {
|
|
209
|
+
super(e.Code.Timeout, e.Label.Timeout, n, i);
|
|
210
|
+
}
|
|
211
|
+
static {
|
|
212
|
+
this.code = e.Code.Timeout;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
e.Timeout = Z;
|
|
216
|
+
})(r || (r = {}));
|
|
217
|
+
const f = {};
|
|
218
|
+
f[r.Code.Parse] = r.Parse, f[r.Code.Null] = r.Null, f[r.Code.Div0] = r.Div0, f[r.Code.Value] = r.Value, f[r.Code.Ref] = r.Ref, f[r.Code.Name] = r.Name, f[r.Code.Num] = r.Num, f[r.Code.NA] = r.NA, f[r.Code.GettingData] = r.GettingData, f[r.Code.Spill] = r.Spill, f[r.Code.Connect] = r.Connect, f[r.Code.Blocked] = r.Blocked, f[r.Code.Unknown] = r.Unknown, f[r.Code.Field] = r.Field, f[r.Code.Calc] = r.Calc, f[r.Code.Busy] = r.Busy, f[r.Code.Python] = r.Python, f[r.Code.Timeout] = r.Timeout;
|
|
219
|
+
const ce = /* @__PURE__ */ new Map(), ie = /* @__PURE__ */ new Map(), de = /* @__PURE__ */ new Map(), ue = /* @__PURE__ */ new Map(), le = Object.keys(f);
|
|
220
|
+
for (let e = 0; e < le.length; e++) {
|
|
221
|
+
const a = le[e], T = f[a];
|
|
222
|
+
de.set(r.Label[a], T), ue.set(r.Code[a], T);
|
|
223
|
+
const x = new T();
|
|
224
|
+
ce.set(x.getLabel(), x), ie.set(x.getCode(), x);
|
|
225
|
+
}
|
|
226
|
+
const ge = ie.get(r.Code.Unknown);
|
|
227
|
+
var p;
|
|
228
|
+
(p = r || (r = {})).BuiltIn = { Parse: new p.Parse(), Null: new p.Null(), Div0: new p.Div0(), Value: new p.Value(), Ref: new p.Ref(), Name: new p.Name(), Num: new p.Num(), NA: new p.NA(), GettingData: new p.GettingData(), Spill: new p.Spill(), Connect: new p.Connect(), Blocked: new p.Blocked(), Unknown: new p.Unknown(), Field: new p.Field(), Calc: new p.Calc(), Busy: new p.Busy(), Python: new p.Python(), Timeout: new p.Timeout() }, p.getBuiltInByLabel = (e) => ce.get(e), p.newTypedError = (e, a, T) => {
|
|
229
|
+
let x;
|
|
230
|
+
return x = typeof e == "string" ? de.get(e) : ue.get(e), x || (x = p.Unknown), new x(a, T);
|
|
231
|
+
}, p.getBuiltInById = (e) => ie.get(e) || ge;
|
|
232
|
+
let A = null, H = null;
|
|
233
|
+
const we = { compilerOptions: { target: "esnext" } }, Ce = async () => `
|
|
234
|
+
interface FirstTest {
|
|
235
|
+
isTrue?: boolean;
|
|
236
|
+
}
|
|
237
|
+
`, pe = /* @__PURE__ */ new Map([["IReferenceRange", "r"], ["IRange", "l"]]), me = /* @__PURE__ */ new Map([["IWorkbook", "workbook"], ["ISheet", "sheet"], ["ICellRanges", "ranges"], ["ICellRange", "range"], ["IFormulaContext", "context"]]), ne = (e, a) => {
|
|
238
|
+
Array.from(a.keys()).forEach((T) => {
|
|
239
|
+
const x = a.get(T);
|
|
240
|
+
a.set(`${e}.${T}`, x);
|
|
241
|
+
});
|
|
242
|
+
}, xe = /* @__PURE__ */ new Map([["Scalar", "*"], ["FormulaError.Known", "e"], ["Date", "Date"], ["JSON", "JSON"]]), be = /* @__PURE__ */ new Map([]), oe = "SheetXL";
|
|
243
|
+
ne(oe, pe), ne(oe, me), ne(oe, be);
|
|
244
|
+
const ke = /* @__PURE__ */ new Map([["Promise", () => ({ async: !0 })], ["Observable", () => ({ stream: !0 })]]);
|
|
245
|
+
let W = null;
|
|
246
|
+
async function Te() {
|
|
247
|
+
if (W) return W;
|
|
248
|
+
try {
|
|
249
|
+
return await (await import("./B_b5FIYJnm4UKAEc.mjs")).initialize();
|
|
250
|
+
} catch (e) {
|
|
251
|
+
throw W = null, e;
|
|
252
|
+
} finally {
|
|
253
|
+
W = null;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
async function Se(e) {
|
|
257
|
+
const a = e?.source ?? null;
|
|
258
|
+
if (!a) return null;
|
|
259
|
+
const T = (e.disableBundle || e.declarationsOnly) ?? !1, x = [Ce(), Te()], j = await Promise.all(x), X = j[0], s = j[1];
|
|
260
|
+
let K = "", U = null;
|
|
261
|
+
const z = [], Y = { allowJs: !0, declaration: !1, sourceMap: !1, inlineSourceMap: !1, inlineSources: !1, isolatedModules: !0, preserveConstEnums: !1, module: 99, noResolve: !0, emitDeclarationOnly: !1, target: s.ScriptTarget.ES2020 }, M = "script", I = `${M}.ts`, G = "lib.d.ts", _ = "global.d.ts", F = { [I]: a, [G]: `
|
|
262
|
+
/**
|
|
263
|
+
* Represents the completion of an asynchronous operation
|
|
264
|
+
*/
|
|
265
|
+
interface Promise<T> {
|
|
266
|
+
/**
|
|
267
|
+
* Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
|
|
268
|
+
* resolved value cannot be modified from the callback.
|
|
269
|
+
* @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
|
|
270
|
+
* @returns A Promise for the completion of the callback.
|
|
271
|
+
*/
|
|
272
|
+
finally(onfinally?: (() => void) | undefined | null): Promise<T>;
|
|
273
|
+
}
|
|
274
|
+
`, [_]: X }, Q = { getSourceFile: (t, d, E, l) => s.createSourceFile(t, F[t], s.ScriptTarget.Latest, !0), fileExists: (t) => F[t] !== void 0, readFile: (t) => F[t], writeFile: (t, d) => {
|
|
275
|
+
F[t] = d;
|
|
276
|
+
}, getCurrentDirectory: () => "./", getCanonicalFileName: (t) => t, useCaseSensitiveFileNames: () => !0, getDefaultLibFileName: (t) => G, getNewLine: () => `
|
|
277
|
+
` }, O = s.createProgram([I, _], Y, Q), P = O.getTypeChecker(), Z = O.getSourceFile(I), y = O.emit();
|
|
278
|
+
y.diagnostics.length > 0 && console.warn(y.diagnostics), K = F[`${M}.js`];
|
|
279
|
+
const n = (t, d, E, l) => {
|
|
280
|
+
if (t) {
|
|
281
|
+
if (t.kind === s.SyntaxKind.NumberKeyword) d.scalar = "n";
|
|
282
|
+
else if (t.kind === s.SyntaxKind.StringKeyword) d.scalar = "s";
|
|
283
|
+
else if (t.kind === s.SyntaxKind.BooleanKeyword) d.scalar = "b";
|
|
284
|
+
else if (t.kind === s.SyntaxKind.UndefinedKeyword || t.kind === s.SyntaxKind.NullKeyword || t.kind === s.SyntaxKind.VoidKeyword) {
|
|
285
|
+
if (l) return void S(t, new Error(`'undefined' is not a valid type for input: '${t?.parent?.name?.escapedText}'.`));
|
|
286
|
+
d.scalar = "z";
|
|
287
|
+
} else if (t.kind === s.SyntaxKind.BigIntKeyword) d.scalar = "n";
|
|
288
|
+
else if (t.kind === s.SyntaxKind.AnyKeyword) d.scalar = "z";
|
|
289
|
+
else if (t.kind === s.SyntaxKind.ArrayType) {
|
|
290
|
+
const c = t.elementType;
|
|
291
|
+
if (!c) return void S(t, new Error(`'Array' must be typed: '${t?.parent?.name?.escapedText}'.`));
|
|
292
|
+
d.arrayDepth = (d.arrayDepth ?? 0) + 1, n(c, d, E, l);
|
|
293
|
+
} else if (t.kind !== s.SyntaxKind.TupleType && t.kind === s.SyntaxKind.TypeReference) {
|
|
294
|
+
const c = t.typeName?.getText?.() ?? null, N = pe.get(c);
|
|
295
|
+
let k = !1;
|
|
296
|
+
N && (d.range = N, k = !0);
|
|
297
|
+
const D = xe.get(c);
|
|
298
|
+
if (D && (d.scalar = D), D !== void 0 && (k = !0), l) {
|
|
299
|
+
const g = me.get(c);
|
|
300
|
+
if (g) return g;
|
|
301
|
+
} else {
|
|
302
|
+
const g = ke.get(c);
|
|
303
|
+
if (g) {
|
|
304
|
+
const m = { ...d, ...g() };
|
|
305
|
+
let o = 0;
|
|
306
|
+
if (m.async && o++, m.stream && o++, o > 1) return void S(t, new Error(`'${c}' cannot have multiple modifiers: '${t?.parent?.name?.escapedText}'.`));
|
|
307
|
+
d = m, k = !0;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
if (!k) return void S("node", new Error(`'${c}' is not a valid type: '${t?.parent?.name?.escapedText}'.`));
|
|
311
|
+
const b = t.typeArguments;
|
|
312
|
+
if (b) {
|
|
313
|
+
if (b.length !== 1) return void S(t, new Error(`'${c}' must be typed with exactly 1 type: '${t?.parent?.name?.escapedText}'.`));
|
|
314
|
+
n(b[0], d, E, l);
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
} else S(t, new Error(`Type is not defined for '${d?.name ?? "return"}'.`));
|
|
318
|
+
}, i = [], S = (t, d) => {
|
|
319
|
+
i.push(d);
|
|
320
|
+
};
|
|
321
|
+
if (s.forEachChild(Z, (t) => {
|
|
322
|
+
if (E = t, (s.getCombinedModifierFlags(E) & s.ModifierFlags.Export) !== 0 && s.isFunctionDeclaration(t)) {
|
|
323
|
+
const l = {}, c = { parameters: {} }, N = t?.name?.getText();
|
|
324
|
+
try {
|
|
325
|
+
l.name = N;
|
|
326
|
+
const k = P.getSymbolAtLocation(t.name).getDocumentationComment(P);
|
|
327
|
+
if (k && k.length > 0 && k[0].text) {
|
|
328
|
+
let m = k[0].text;
|
|
329
|
+
m = m.replace(/[\r\n]+/g, "\\n").trim(), c.summary = m;
|
|
330
|
+
}
|
|
331
|
+
const D = {};
|
|
332
|
+
n(t.type, D, l, !1), l.returnType = D;
|
|
333
|
+
const b = {};
|
|
334
|
+
d = t, (s.getCombinedModifierFlags(d) & s.ModifierFlags.Default) !== 0 && (b.default = !0, U = N), Object.keys(b).length > 0 && (l.behavior = b), l.parameters = [];
|
|
335
|
+
const g = /* @__PURE__ */ new Map();
|
|
336
|
+
for (let m = 0; m < t.parameters.length; m++) {
|
|
337
|
+
const o = t.parameters[m], h = {};
|
|
338
|
+
h.name = o.name?.getText();
|
|
339
|
+
const $ = n(o.type, h, l, !0);
|
|
340
|
+
if ($) {
|
|
341
|
+
if (l.parameters.length !== 0) {
|
|
342
|
+
const B = t?.parent, C = B?.name?.getText();
|
|
343
|
+
return void S(t, new Error(`'${l.name}' contexts must be the first parameter: '${C}'.`));
|
|
344
|
+
}
|
|
345
|
+
l.context = $;
|
|
346
|
+
continue;
|
|
347
|
+
}
|
|
348
|
+
let L;
|
|
349
|
+
if ((o.initializer !== void 0 && o.initializer !== null || o.questionToken !== void 0 && o.questionToken !== null) && (h.optional = !0, o.initializer)) try {
|
|
350
|
+
L = o.initializer.kind === s.SyntaxKind.StringLiteral ? o.initializer.text : o.initializer.kind === s.SyntaxKind.NumericLiteral ? parseFloat(o.initializer.text) : o.initializer.kind === s.SyntaxKind.TrueKeyword || o.initializer.kind === s.SyntaxKind.FalseKeyword ? o.initializer.kind === s.SyntaxKind.TrueKeyword : o.initializer.kind === s.SyntaxKind.NullKeyword ? null : o.initializer.kind === s.SyntaxKind.ObjectLiteralExpression || o.initializer.kind === s.SyntaxKind.ArrayLiteralExpression ? o.initializer.getText() : o.initializer.getText?.();
|
|
351
|
+
} catch (B) {
|
|
352
|
+
console.warn(`Couldn't extract default value for parameter '${h.name}'`, B);
|
|
353
|
+
}
|
|
354
|
+
o.dotDotDotToken && (h.rest = !0), l.parameters.push(h);
|
|
355
|
+
const w = { description: "" };
|
|
356
|
+
c.parameters[h.name] = w;
|
|
357
|
+
const u = P.getSymbolAtLocation(o.name).getDocumentationComment(P);
|
|
358
|
+
u && u.length > 0 && u[0].text && (w.description = u[0].text), L !== void 0 && (w.defaultValue = L), g.set(h.name, h);
|
|
359
|
+
}
|
|
360
|
+
if (t.jsDoc && t.jsDoc.length > 0) {
|
|
361
|
+
const m = t.jsDoc;
|
|
362
|
+
for (let o = 0; o < m.length; o++) {
|
|
363
|
+
const h = m[o]?.tags;
|
|
364
|
+
if (h) for (let $ = 0; $ < h.length; $++) {
|
|
365
|
+
const L = h[$];
|
|
366
|
+
let w = L?.tagName?.text;
|
|
367
|
+
if (!w) continue;
|
|
368
|
+
w = w.toLowerCase();
|
|
369
|
+
let u = L.comment;
|
|
370
|
+
const B = w === "hidden";
|
|
371
|
+
if ((typeof u == "string" || B) && (typeof u == "string" && (u = u.replace(/[\r\n]+/g, "\\n").trim()), B || !u || (u = u.split(/\\n/)[0], u && u.length !== 0))) {
|
|
372
|
+
if (u && typeof u == "string") {
|
|
373
|
+
const C = /\{@link(code|plain)?\s+([^}|]+)(?:\s*\|\s*([^}]+))?\}/g;
|
|
374
|
+
let v, R = u, V = [];
|
|
375
|
+
for (; (v = C.exec(u)) !== null; ) {
|
|
376
|
+
const [ee, te, ye, ae] = v, fe = [ye.trim()];
|
|
377
|
+
ae && fe.push(ae.trim());
|
|
378
|
+
}
|
|
379
|
+
u = R, V.length > 0 && w === "see" && (c.links || (c.links = []), c.links.push(...V));
|
|
380
|
+
}
|
|
381
|
+
if (w === "name") {
|
|
382
|
+
const C = u;
|
|
383
|
+
C !== N && (c.name = C);
|
|
384
|
+
} else if (w !== "description") {
|
|
385
|
+
if (w === "summary") {
|
|
386
|
+
const C = u;
|
|
387
|
+
C && (c.summary = C);
|
|
388
|
+
} else if (w === "param") {
|
|
389
|
+
const C = L.name?.text, v = g.get(C);
|
|
390
|
+
if (!v) {
|
|
391
|
+
i.push(new Error(`Parameter '${C}' not found in function '${N}'.`));
|
|
392
|
+
continue;
|
|
393
|
+
}
|
|
394
|
+
if (L.typeExpression && L.typeExpression.type) try {
|
|
395
|
+
const R = L.typeExpression.type;
|
|
396
|
+
if (R.kind === s.SyntaxKind.UnionType) {
|
|
397
|
+
const V = [];
|
|
398
|
+
v.enums = V, R.types.forEach((ee) => {
|
|
399
|
+
if (ee.kind === s.SyntaxKind.LiteralType) {
|
|
400
|
+
const te = ee.literal.text;
|
|
401
|
+
te && V.push(te);
|
|
402
|
+
}
|
|
403
|
+
});
|
|
404
|
+
}
|
|
405
|
+
} catch (R) {
|
|
406
|
+
console.warn("Error parsing JSDoc type expression:", R);
|
|
407
|
+
}
|
|
408
|
+
} else if (w === "returns" || w === "return") l.returnType.description = u;
|
|
409
|
+
else if (w === "category") c.category = u;
|
|
410
|
+
else if (w === "hidden") {
|
|
411
|
+
let C = !0;
|
|
412
|
+
const v = u?.toLowerCase();
|
|
413
|
+
v === "false" ? C = !1 : v !== "true" && (C = u), C !== !1 && (c.hidden = C ?? !0);
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
Object.keys(l.returnType).length === 0 && delete l.returnType, z.push([l, c]);
|
|
421
|
+
} catch (k) {
|
|
422
|
+
S(t, new Error(`'${N}': ${k.message}`));
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
var d, E;
|
|
426
|
+
}), i.length > 0) throw console.warn(i), new Error("There were compilation errors.", { cause: i });
|
|
427
|
+
if (z.length === 0) throw new Error("No exported functions.");
|
|
428
|
+
const J = `${he.uuidV4()}-script`;
|
|
429
|
+
try {
|
|
430
|
+
T || i.length !== 0 || (K = await async function(t, d, E = "/script.js", l = "__SHEETXL") {
|
|
431
|
+
try {
|
|
432
|
+
const c = await async function() {
|
|
433
|
+
if (A) return A;
|
|
434
|
+
if (H) {
|
|
435
|
+
if (await H, !A) throw new Error("ESBuild initialization promise resolved, but instance is not available.");
|
|
436
|
+
return A;
|
|
437
|
+
}
|
|
438
|
+
let g, m;
|
|
439
|
+
H = new Promise((o, h) => {
|
|
440
|
+
g = o, m = h;
|
|
441
|
+
});
|
|
442
|
+
try {
|
|
443
|
+
const { initialize: o } = await import("./Do_EO3eQIyPgc7uz.mjs");
|
|
444
|
+
return A = await o(), g(), A;
|
|
445
|
+
} catch (o) {
|
|
446
|
+
throw console.error("Failed to import or initialize esbuild:", o), H = null, m(o), o;
|
|
447
|
+
}
|
|
448
|
+
}(), N = "@sheetxl/primitives", k = `
|
|
449
|
+
export const FormulaContext = globalThis.${l}?.FormulaContext;
|
|
450
|
+
export const ScalarType = globalThis.${l}?.ScalarType;
|
|
451
|
+
export const Observable = globalThis.${l}?.Observable;
|
|
452
|
+
export const IRange = globalThis.${l}?.IRange;
|
|
453
|
+
export const FormulaError = globalThis.${l}?.FormulaError;
|
|
454
|
+
// Add more exports as needed
|
|
455
|
+
`, D = { name: "sheetxl-esbuild-in-memory", setup(g) {
|
|
456
|
+
const m = "sheetxl-" + (/* @__PURE__ */ new Date()).getTime();
|
|
457
|
+
g.onResolve({ filter: new RegExp(`^(${E.replace("/", "\\/")}|${N})$`) }, (o) => ({ path: o.path, namespace: m })), g.onResolve({ filter: /.*/ }, (o) => {
|
|
458
|
+
if (o.namespace !== m) return console.warn(`esbuild: Treating import "${o.path}" as external.`), { path: o.path, external: !0 };
|
|
459
|
+
}), g.onLoad({ filter: /.*/, namespace: m }, (o) => {
|
|
460
|
+
let h;
|
|
461
|
+
if (o.path === E) h = d;
|
|
462
|
+
else {
|
|
463
|
+
if (o.path !== N) return { errors: [{ text: `Cannot load unknown path in ${m}: ${o.path}` }] };
|
|
464
|
+
h = k;
|
|
465
|
+
}
|
|
466
|
+
return { contents: h, loader: "ts" };
|
|
467
|
+
});
|
|
468
|
+
} }, b = await c.build({ entryPoints: [E], bundle: !0, write: !1, format: "esm", plugins: [D], sourcemap: "inline", tsconfigRaw: we, minify: !0, platform: "neutral" });
|
|
469
|
+
if (b.outputFiles && b.outputFiles.length > 0) return b.outputFiles[0].text;
|
|
470
|
+
throw b.errors && b.errors.length > 0 ? new Error(`esbuild bundling failed: ${b.errors.map((g) => g.text).join(`
|
|
471
|
+
`)}`) : new Error("esbuild did not produce an output file.");
|
|
472
|
+
} catch (c) {
|
|
473
|
+
throw console.error("esbuild bundling process failed:", c), c;
|
|
474
|
+
}
|
|
475
|
+
}(0, K, M));
|
|
476
|
+
} catch {
|
|
477
|
+
console.warn("Error bundling script");
|
|
478
|
+
}
|
|
479
|
+
const re = { functions: z, commitId: J, source: a, name: "Script", language: "typescript", compiled: K };
|
|
480
|
+
return U && (re.autoRun = U), re;
|
|
481
|
+
}
|
|
482
|
+
export {
|
|
483
|
+
Se as compileModule
|
|
484
|
+
};
|