@silurus/ooxml 0.84.1 → 0.85.1
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/README.md +44 -18
- package/dist/assets/render-worker-BRKOyWVH.js +24 -0
- package/dist/assets/render-worker-CtLMFj9r.js +10 -0
- package/dist/assets/render-worker-NZPOUOTU.js +11 -0
- package/dist/{canvas-viewer-mechanics-CIfhCgYA.js → canvas-viewer-mechanics-CfRzOhz5.js} +308 -234
- package/dist/chart-ex.mjs +270 -270
- package/dist/{comment-ui-runtime-CdMMApEN.js → comment-ui-runtime-CAbpuWi_.js} +4 -4
- package/dist/{comment-ui-runtime-C5qimVMD.js → comment-ui-runtime-DAKBCpsM.js} +5 -5
- package/dist/comment-ui-runtime-DTaaZdXC.js +2 -0
- package/dist/{comments-BAlAyIhb.js → comments-Brfxa3hQ.js} +1 -1
- package/dist/{document-pull-client-BXw6AAhY.js → document-pull-client-BkHHIdR4.js} +4661 -4357
- package/dist/{docx-BA1vB0V-.js → docx-_uelcAui.js} +338 -304
- package/dist/docx.mjs +7 -6
- package/dist/docx_parser_bg.wasm +0 -0
- package/dist/{dom-interaction-boundary-DS6BVyHA.js → dom-interaction-boundary-CMDDgICk.js} +1 -1
- package/dist/index.mjs +3 -3
- package/dist/line-distribute-CiKeWjBF.js +1023 -0
- package/dist/{line-metrics-CXyjyYd5.js → line-metrics-u87yCAfV.js} +2182 -705
- package/dist/math.mjs +2 -2
- package/dist/node.mjs +404 -394
- package/dist/pixel-budget-Dgjw269h.js +37 -0
- package/dist/{plot-area-frame-DuXZzovH.js → plot-area-frame-D5hEOgkJ.js} +691 -1418
- package/dist/{pptx-C17oBD8Z.js → pptx-WpBbS0mq.js} +255 -222
- package/dist/pptx.mjs +7 -6
- package/dist/pptx_parser_bg.wasm +0 -0
- package/dist/raster-target-whZhvVMt.js +87 -0
- package/dist/region-map.mjs +5 -5
- package/dist/{render-CVeGktZG.js → render-DrAAZWwH.js} +9 -6
- package/dist/{render-worker-host-BbhwA24Y.js → render-worker-host-CBVe8aeD.js} +1 -1
- package/dist/{render-worker-host-BWdhjVH_.js → render-worker-host-CHlwYJdK.js} +1 -1
- package/dist/{render-worker-host-CbaQivE7.js → render-worker-host-XDMsyVsv.js} +1 -1
- package/dist/{renderer-Bmky2yBc.js → renderer-XFSCOT6m.js} +1937 -1936
- package/dist/resource-measurement-6uR3Huao.js +150 -0
- package/dist/{session-Cl0RVnMs.js → session-DoPwA4gv.js} +79 -79
- package/dist/{slide-pull-client-BS0EeZo2.js → slide-pull-client-8i8C4VyD.js} +1054 -824
- package/dist/{three-d-B7LsKeOS.js → three-d-YYghQndN.js} +109 -110
- package/dist/three-d.mjs +726 -726
- package/dist/tiff.mjs +664 -78
- package/dist/types/chart-ex.d.ts +2 -2
- package/dist/types/docx.d.ts +31 -13
- package/dist/types/index.d.ts +46 -21
- package/dist/types/math.d.ts +1 -1
- package/dist/types/node.d.ts +11 -7
- package/dist/types/pptx.d.ts +35 -15
- package/dist/types/region-map.d.ts +2 -2
- package/dist/types/three-d.d.ts +2 -2
- package/dist/types/tiff.d.ts +13 -3
- package/dist/types/xlsx.d.ts +30 -13
- package/dist/{worksheet-pull-client-B0zfEVau.js → worksheet-pull-client-Btydoxto.js} +47 -47
- package/dist/{xlsx-FyKAiNo-.js → xlsx-Bd16V4Xx.js} +1395 -1196
- package/dist/xlsx.mjs +7 -6
- package/package.json +2 -2
- package/dist/assets/render-worker-BWPpayBu.js +0 -10
- package/dist/assets/render-worker-CiEWCh_T.js +0 -11
- package/dist/assets/render-worker-Cpmy3GDF.js +0 -24
- package/dist/comment-ui-runtime-aPzHfV_A.js +0 -2
- package/dist/line-distribute-MqInuujx.js +0 -1003
- package/dist/resource-measurement-esyGbzAF.js +0 -120
- package/dist/tiff-contract-Xjn3qXqK.js +0 -69
- /package/dist/{comment-occurrence-C34fWs_F.js → comment-occurrence-tj54AXXB.js} +0 -0
- /package/dist/{highlight-rect-MaCt0om0.js → highlight-rect-DBcYVJDv.js} +0 -0
- /package/dist/{mathjax-DPEX346v.js → mathjax-DS69BmJd.js} +0 -0
- /package/dist/{read-only-comment-decoration-BYCXoSdC.js → read-only-comment-decoration-Mv_SAiHy.js} +0 -0
- /package/dist/{read-only-comment-margin-C7b3l0ro.js → read-only-comment-margin-Cqu-Ir0C.js} +0 -0
- /package/dist/{renderer-module-contract-C6sYZvTV.js → renderer-module-contract-Cu-GKuPd.js} +0 -0
- /package/dist/{source-key-DORuuFb-.js → source-key-BkBB3X82.js} +0 -0
- /package/dist/{transfer-vNOFQuvv.js → transfer-mIj7E7NB.js} +0 -0
- /package/dist/{visible-index-DwJzuGmJ.js → visible-index-DPoQYSDt.js} +0 -0
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { ft as e, ht as t, mt as n, ot as r, yt as i } from "./line-metrics-u87yCAfV.js";
|
|
2
|
+
import { an as a } from "./plot-area-frame-D5hEOgkJ.js";
|
|
3
|
+
import { i as o } from "./pixel-budget-Dgjw269h.js";
|
|
4
|
+
import { r as s } from "./raster-target-whZhvVMt.js";
|
|
5
|
+
//#region packages/core/src/image/duotone-bitmap-by-path.ts
|
|
6
|
+
function c(e, t) {
|
|
7
|
+
return t ? `${e}|duo:${t.clr1}:${t.clr2}` : e;
|
|
8
|
+
}
|
|
9
|
+
var l = "duotone";
|
|
10
|
+
async function u(u, d, f, p, m = {}) {
|
|
11
|
+
let { offscreenFactory: h, failClosedOnDuotoneFailure: g = !1, ..._ } = m, v = f ? {
|
|
12
|
+
..._,
|
|
13
|
+
maxRetainedPixels: Math.min(_.maxRetainedPixels ?? 33554432, Math.floor(o / 4))
|
|
14
|
+
} : _, y = f ? {
|
|
15
|
+
...v,
|
|
16
|
+
targetWidthPx: void 0,
|
|
17
|
+
targetHeightPx: void 0
|
|
18
|
+
} : v, b = f ? e(p, l) : void 0, x = await n(u, d, p, y);
|
|
19
|
+
if (!f || !x) return x;
|
|
20
|
+
let S = await i(u, d, p, y, b, x), C = s(Number(x.width), Number(x.height), _.targetWidthPx, _.targetHeightPx);
|
|
21
|
+
return t(l, `${c(S, f)}${C ? `|resize-width:${C.resizeWidth}` : ""}${g ? "|strict" : ""}`, p, async () => {
|
|
22
|
+
let { w: e, h: t } = a(x);
|
|
23
|
+
if (e <= 0 || t <= 0) return {
|
|
24
|
+
bitmap: g ? null : x,
|
|
25
|
+
owned: !1
|
|
26
|
+
};
|
|
27
|
+
let n = await r(x, f, {
|
|
28
|
+
width: e,
|
|
29
|
+
height: t,
|
|
30
|
+
offscreenFactory: h,
|
|
31
|
+
targetWidthPx: _.targetWidthPx,
|
|
32
|
+
targetHeightPx: _.targetHeightPx
|
|
33
|
+
});
|
|
34
|
+
if (n === x) {
|
|
35
|
+
if (g) return {
|
|
36
|
+
bitmap: null,
|
|
37
|
+
owned: !1
|
|
38
|
+
};
|
|
39
|
+
if (!C) return {
|
|
40
|
+
bitmap: x,
|
|
41
|
+
owned: !1
|
|
42
|
+
};
|
|
43
|
+
if (typeof createImageBitmap > "u") throw Error("createImageBitmap is unavailable for duotone fallback resampling");
|
|
44
|
+
let e = await createImageBitmap(x, C);
|
|
45
|
+
return {
|
|
46
|
+
bitmap: e,
|
|
47
|
+
owned: e !== x
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
let i = n;
|
|
51
|
+
return {
|
|
52
|
+
bitmap: i,
|
|
53
|
+
owned: i !== x
|
|
54
|
+
};
|
|
55
|
+
}, b);
|
|
56
|
+
}
|
|
57
|
+
//#endregion
|
|
58
|
+
//#region packages/core/src/internal/resource-measurement.ts
|
|
59
|
+
function d(e, t) {
|
|
60
|
+
if (!Number.isSafeInteger(e) || e < 0) throw Error(`${t} must be a non-negative safe integer`);
|
|
61
|
+
}
|
|
62
|
+
function f(e, t, n) {
|
|
63
|
+
return d(e, "resource measurement"), d(t, "resource measurement"), d(n, "resource measurement limit"), e > n || t > n || t > n - e ? n === 2 ** 53 - 1 ? n : n + 1 : e + t;
|
|
64
|
+
}
|
|
65
|
+
function p(e, t = 2 ** 53 - 1) {
|
|
66
|
+
d(t, "resource measurement limit");
|
|
67
|
+
let n = 0;
|
|
68
|
+
for (let r = 0; r < e.length; r += 1) {
|
|
69
|
+
let i = e.charCodeAt(r), a;
|
|
70
|
+
if (i <= 127) a = 1;
|
|
71
|
+
else if (i <= 2047) a = 2;
|
|
72
|
+
else if (i >= 55296 && i <= 56319 && r + 1 < e.length) {
|
|
73
|
+
let t = e.charCodeAt(r + 1);
|
|
74
|
+
t >= 56320 && t <= 57343 ? (a = 4, r += 1) : a = 3;
|
|
75
|
+
} else a = 3;
|
|
76
|
+
if (n = f(n, a, t), n > t) return n;
|
|
77
|
+
}
|
|
78
|
+
return n;
|
|
79
|
+
}
|
|
80
|
+
function m(e, t = 2 ** 53 - 1) {
|
|
81
|
+
d(t, "resource measurement limit");
|
|
82
|
+
let n = f(0, 2, t);
|
|
83
|
+
if (n > t) return n;
|
|
84
|
+
for (let r = 0; r < e.length; r += 1) {
|
|
85
|
+
let i = e.charCodeAt(r), a;
|
|
86
|
+
if (i === 34 || i === 92 || i === 8 || i === 9 || i === 10 || i === 12 || i === 13) a = 2;
|
|
87
|
+
else if (i <= 31) a = 6;
|
|
88
|
+
else if (i <= 127) a = 1;
|
|
89
|
+
else if (i <= 2047) a = 2;
|
|
90
|
+
else if (i >= 55296 && i <= 56319 && r + 1 < e.length) {
|
|
91
|
+
let t = e.charCodeAt(r + 1);
|
|
92
|
+
t >= 56320 && t <= 57343 ? (a = 4, r += 1) : a = 6;
|
|
93
|
+
} else a = i >= 55296 && i <= 57343 ? 6 : 3;
|
|
94
|
+
if (n = f(n, a, t), n > t) return n;
|
|
95
|
+
}
|
|
96
|
+
return n;
|
|
97
|
+
}
|
|
98
|
+
function h(e, t) {
|
|
99
|
+
return f(0, e, t);
|
|
100
|
+
}
|
|
101
|
+
function g(e, t = 2 ** 53 - 1, n = !1) {
|
|
102
|
+
if (d(t, "resource measurement limit"), e === null) return {
|
|
103
|
+
jsonBytes: h(4, t),
|
|
104
|
+
stringValueUtf8Bytes: 0
|
|
105
|
+
};
|
|
106
|
+
if (typeof e == "string") return {
|
|
107
|
+
jsonBytes: m(e, t),
|
|
108
|
+
stringValueUtf8Bytes: p(e, t)
|
|
109
|
+
};
|
|
110
|
+
if (typeof e == "boolean") return {
|
|
111
|
+
jsonBytes: h(e ? 4 : 5, t),
|
|
112
|
+
stringValueUtf8Bytes: 0
|
|
113
|
+
};
|
|
114
|
+
if (typeof e == "number") return {
|
|
115
|
+
jsonBytes: h((Number.isFinite(e) ? String(Object.is(e, -0) ? 0 : e) : "null").length, t),
|
|
116
|
+
stringValueUtf8Bytes: 0
|
|
117
|
+
};
|
|
118
|
+
if (typeof e == "bigint") throw TypeError("BigInt values cannot be serialized to JSON");
|
|
119
|
+
if (Array.isArray(e)) {
|
|
120
|
+
let n = h(2, t), r = 0;
|
|
121
|
+
for (let i = 0; i < e.length; i += 1) {
|
|
122
|
+
i !== 0 && (n = f(n, 1, t));
|
|
123
|
+
let a = g(e[i], t, !0);
|
|
124
|
+
n = f(n, a.jsonBytes, t), r = f(r, a.stringValueUtf8Bytes, t);
|
|
125
|
+
}
|
|
126
|
+
return {
|
|
127
|
+
jsonBytes: n,
|
|
128
|
+
stringValueUtf8Bytes: r
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
if (typeof e == "object") {
|
|
132
|
+
let n = h(2, t), r = 0, i = 0;
|
|
133
|
+
for (let [a, o] of Object.entries(e)) {
|
|
134
|
+
if (o === void 0 || typeof o == "function" || typeof o == "symbol") continue;
|
|
135
|
+
i++ !== 0 && (n = f(n, 1, t)), n = f(n, m(a, t), t), n = f(n, 1, t);
|
|
136
|
+
let e = g(o, t);
|
|
137
|
+
n = f(n, e.jsonBytes, t), r = f(r, e.stringValueUtf8Bytes, t);
|
|
138
|
+
}
|
|
139
|
+
return {
|
|
140
|
+
jsonBytes: n,
|
|
141
|
+
stringValueUtf8Bytes: r
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
return {
|
|
145
|
+
jsonBytes: n ? h(4, t) : 0,
|
|
146
|
+
stringValueUtf8Bytes: 0
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
//#endregion
|
|
150
|
+
export { u as a, c as i, g as n, p as r, f as t };
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { t as e } from "./chunk-DmhlhrBa.js";
|
|
2
|
-
import { a as t, u as n } from "./slide-pull-client-
|
|
3
|
-
import { B as r,
|
|
4
|
-
import { t as
|
|
2
|
+
import { a as t, u as n } from "./slide-pull-client-8i8C4VyD.js";
|
|
3
|
+
import { B as r, F as i, G as a, H as o, I as s, K as c, P as l, Q as u, R as d, U as f, W as p, X as m, Y as h, Yt as g, Z as _, q as v, sn as y } from "./line-metrics-u87yCAfV.js";
|
|
4
|
+
import { t as b } from "./transfer-mIj7E7NB.js";
|
|
5
5
|
//#region packages/pptx/src/slide-cursor-operation.ts
|
|
6
|
-
function
|
|
6
|
+
function x(e) {
|
|
7
7
|
try {
|
|
8
|
-
return
|
|
8
|
+
return f(e((e) => e.slide_cursor_resource_usage()));
|
|
9
9
|
} catch (e) {
|
|
10
10
|
if (String(e).includes("slide cursor usage is unavailable")) return;
|
|
11
11
|
throw e;
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function ee(e, t, n, r, i) {
|
|
15
15
|
let a, o;
|
|
16
16
|
try {
|
|
17
17
|
if (i) {
|
|
18
18
|
if (!r) throw Error("slide payload is missing before acknowledgement");
|
|
19
|
-
let t = i(n, r,
|
|
19
|
+
let t = i(n, r, x(e));
|
|
20
20
|
typeof t == "function" ? a = t : t && ({rollback: a, commit: o} = t);
|
|
21
21
|
}
|
|
22
22
|
e((e) => e.acknowledge_slide(t.operationId, t.generation)), o?.();
|
|
@@ -30,7 +30,7 @@ function x(e, t, n, r, i) {
|
|
|
30
30
|
//#endregion
|
|
31
31
|
//#region packages/pptx/src/slide-pull-worker.ts
|
|
32
32
|
var te = "ooxml-pull-resetting", ne = "ooxml-pull-reset-failed", re = class {
|
|
33
|
-
coordinatorGeneration = new
|
|
33
|
+
coordinatorGeneration = new s();
|
|
34
34
|
sessions = /* @__PURE__ */ new Map();
|
|
35
35
|
pendingOpens = /* @__PURE__ */ new Map();
|
|
36
36
|
operationTail = Promise.resolve();
|
|
@@ -45,7 +45,7 @@ var te = "ooxml-pull-resetting", ne = "ooxml-pull-reset-failed", re = class {
|
|
|
45
45
|
return this.coordinatorGeneration;
|
|
46
46
|
}
|
|
47
47
|
reserveOpen(e) {
|
|
48
|
-
if (this.assertReady(),
|
|
48
|
+
if (this.assertReady(), S(e), this.pendingOpens.has(e.sessionId) || this.sessions.has(e.sessionId)) throw Error("slide pull session id is already reserved");
|
|
49
49
|
this.pendingOpens.set(e.sessionId, {
|
|
50
50
|
identity: e,
|
|
51
51
|
canceled: !1
|
|
@@ -61,14 +61,14 @@ var te = "ooxml-pull-resetting", ne = "ooxml-pull-reset-failed", re = class {
|
|
|
61
61
|
if (this.assertReady(), this.resourceFailure) throw this.resourceFailure;
|
|
62
62
|
if (!Number.isSafeInteger(e) || e < 0) throw RangeError("slide index must be a non-negative safe integer");
|
|
63
63
|
let n = this.pendingOpens.get(t.sessionId);
|
|
64
|
-
if (!n || !
|
|
65
|
-
let r,
|
|
64
|
+
if (!n || !C(n.identity, t)) throw Error("slide pull session open reservation is stale or missing");
|
|
65
|
+
let r, a = new Promise((e) => {
|
|
66
66
|
r = e;
|
|
67
|
-
}),
|
|
67
|
+
}), o = this.operationTail.then(() => this.coordinator.enqueue(async () => {
|
|
68
68
|
if (n.canceled) throw Error("slide pull session open was canceled");
|
|
69
|
-
let
|
|
69
|
+
let a, o = !1, s = new i({
|
|
70
70
|
...t,
|
|
71
|
-
maxByteCredit:
|
|
71
|
+
maxByteCredit: g,
|
|
72
72
|
coordinator: this.coordinator,
|
|
73
73
|
driver: {
|
|
74
74
|
pull: (n) => {
|
|
@@ -76,38 +76,38 @@ var te = "ooxml-pull-resetting", ne = "ooxml-pull-reset-failed", re = class {
|
|
|
76
76
|
try {
|
|
77
77
|
r = this.executeArchive((r) => r.pull_slide(e, t.operationId, t.generation, n));
|
|
78
78
|
} catch (e) {
|
|
79
|
-
throw v(e, n,
|
|
79
|
+
throw v(e, n, g) || (this.latchResourceFailure(e), e);
|
|
80
80
|
}
|
|
81
|
-
let
|
|
82
|
-
return this.acceptSlide && (
|
|
83
|
-
payload:
|
|
84
|
-
byteLength:
|
|
81
|
+
let i = b(r);
|
|
82
|
+
return this.acceptSlide && (a = JSON.parse(new TextDecoder().decode(new Uint8Array(i)))), o = !0, {
|
|
83
|
+
payload: i,
|
|
84
|
+
byteLength: i.byteLength,
|
|
85
85
|
done: !0,
|
|
86
|
-
transfer: [
|
|
86
|
+
transfer: [i]
|
|
87
87
|
};
|
|
88
88
|
},
|
|
89
89
|
measureChunk: ({ payload: e }) => e.byteLength,
|
|
90
90
|
acknowledge: () => {
|
|
91
|
-
if (!
|
|
91
|
+
if (!o) throw Error("slide unit is not awaiting acknowledgement");
|
|
92
92
|
try {
|
|
93
|
-
|
|
93
|
+
ee(this.executeArchive, t, e, a, this.acceptSlide);
|
|
94
94
|
} catch (e) {
|
|
95
95
|
throw this.latchResourceFailure(e), e;
|
|
96
96
|
}
|
|
97
|
-
|
|
97
|
+
o = !1, a = void 0, this.sessions.delete(t.sessionId), r();
|
|
98
98
|
},
|
|
99
99
|
cancel: async () => {
|
|
100
100
|
try {
|
|
101
101
|
this.archive() && await this.executeArchive((e) => e.cancel_slide());
|
|
102
102
|
} finally {
|
|
103
|
-
|
|
103
|
+
a = void 0, o = !1, this.sessions.delete(t.sessionId), r();
|
|
104
104
|
}
|
|
105
105
|
},
|
|
106
106
|
close: async () => {
|
|
107
107
|
try {
|
|
108
108
|
this.archive() && await this.executeArchive((e) => e.cancel_slide());
|
|
109
109
|
} finally {
|
|
110
|
-
|
|
110
|
+
a = void 0, o = !1, this.sessions.delete(t.sessionId), r();
|
|
111
111
|
}
|
|
112
112
|
},
|
|
113
113
|
resourceUsage: () => {
|
|
@@ -120,13 +120,13 @@ var te = "ooxml-pull-resetting", ne = "ooxml-pull-reset-failed", re = class {
|
|
|
120
120
|
}
|
|
121
121
|
});
|
|
122
122
|
this.sessions.set(t.sessionId, {
|
|
123
|
-
host:
|
|
123
|
+
host: s,
|
|
124
124
|
identity: t
|
|
125
125
|
}), this.pendingOpens.delete(t.sessionId);
|
|
126
126
|
}));
|
|
127
|
-
this.operationTail =
|
|
127
|
+
this.operationTail = o.then(() => a, () => void 0);
|
|
128
128
|
try {
|
|
129
|
-
await
|
|
129
|
+
await o;
|
|
130
130
|
} catch (e) {
|
|
131
131
|
throw this.pendingOpens.delete(t.sessionId), r(), e;
|
|
132
132
|
}
|
|
@@ -153,9 +153,9 @@ var te = "ooxml-pull-resetting", ne = "ooxml-pull-reset-failed", re = class {
|
|
|
153
153
|
if (n) return n.host.dispatch(e, t);
|
|
154
154
|
let r = this.pendingOpens.get(e.sessionId);
|
|
155
155
|
if (r && (e.kind === "cancel" || e.kind === "close")) {
|
|
156
|
-
let n =
|
|
156
|
+
let n = C(r.identity, e);
|
|
157
157
|
return n && (r.canceled = !0), t(n ? {
|
|
158
|
-
protocol:
|
|
158
|
+
protocol: l,
|
|
159
159
|
kind: "accepted",
|
|
160
160
|
sessionId: e.sessionId,
|
|
161
161
|
operationId: e.operationId,
|
|
@@ -165,7 +165,7 @@ var te = "ooxml-pull-resetting", ne = "ooxml-pull-reset-failed", re = class {
|
|
|
165
165
|
} : this.staleLifecycleResponse(e)), Promise.resolve();
|
|
166
166
|
}
|
|
167
167
|
return e.kind === "cancel" || e.kind === "close" ? (t({
|
|
168
|
-
protocol:
|
|
168
|
+
protocol: l,
|
|
169
169
|
kind: "accepted",
|
|
170
170
|
sessionId: e.sessionId,
|
|
171
171
|
operationId: e.operationId,
|
|
@@ -173,13 +173,13 @@ var te = "ooxml-pull-resetting", ne = "ooxml-pull-reset-failed", re = class {
|
|
|
173
173
|
requestId: e.requestId,
|
|
174
174
|
command: e.kind
|
|
175
175
|
}), Promise.resolve()) : (t({
|
|
176
|
-
protocol:
|
|
176
|
+
protocol: l,
|
|
177
177
|
kind: "error",
|
|
178
178
|
sessionId: e.sessionId,
|
|
179
179
|
operationId: e.operationId,
|
|
180
180
|
generation: e.generation,
|
|
181
181
|
requestId: e.requestId,
|
|
182
|
-
error:
|
|
182
|
+
error: c(/* @__PURE__ */ Error("slide pull session is not open"))
|
|
183
183
|
}), Promise.resolve());
|
|
184
184
|
}
|
|
185
185
|
async dispatchSafely(e, t) {
|
|
@@ -188,13 +188,13 @@ var te = "ooxml-pull-resetting", ne = "ooxml-pull-reset-failed", re = class {
|
|
|
188
188
|
} catch (n) {
|
|
189
189
|
try {
|
|
190
190
|
t({
|
|
191
|
-
protocol:
|
|
191
|
+
protocol: l,
|
|
192
192
|
kind: "error",
|
|
193
193
|
sessionId: e.sessionId,
|
|
194
194
|
operationId: e.operationId,
|
|
195
195
|
generation: e.generation,
|
|
196
196
|
requestId: e.requestId,
|
|
197
|
-
error:
|
|
197
|
+
error: c(n)
|
|
198
198
|
});
|
|
199
199
|
} catch {}
|
|
200
200
|
}
|
|
@@ -227,15 +227,15 @@ var te = "ooxml-pull-resetting", ne = "ooxml-pull-reset-failed", re = class {
|
|
|
227
227
|
for (let { host: t, identity: n } of [...this.sessions.values()]) {
|
|
228
228
|
let r;
|
|
229
229
|
if (await t.dispatch({
|
|
230
|
-
protocol:
|
|
230
|
+
protocol: l,
|
|
231
231
|
kind: "close",
|
|
232
232
|
...n,
|
|
233
233
|
requestId: e++
|
|
234
234
|
}, (e) => {
|
|
235
|
-
e.kind === "error" && (r =
|
|
235
|
+
e.kind === "error" && (r = p(e.error));
|
|
236
236
|
}), r) throw r;
|
|
237
237
|
}
|
|
238
|
-
this.sessions.clear(), await this.operationTail, this.pendingOpens.clear(), this.archive() && await this.executeArchive((e) => e.close_presentation_session()), this.coordinatorGeneration = new
|
|
238
|
+
this.sessions.clear(), await this.operationTail, this.pendingOpens.clear(), this.archive() && await this.executeArchive((e) => e.close_presentation_session()), this.coordinatorGeneration = new s(), this.resourceFailure = void 0;
|
|
239
239
|
}
|
|
240
240
|
assertReady() {
|
|
241
241
|
if (this.lifecycleState !== "ready") throw this.lifecycleError();
|
|
@@ -251,8 +251,8 @@ var te = "ooxml-pull-resetting", ne = "ooxml-pull-reset-failed", re = class {
|
|
|
251
251
|
responseDuringReset(e) {
|
|
252
252
|
if (e.kind === "cancel" || e.kind === "close") {
|
|
253
253
|
let t = this.resetIdentities.get(e.sessionId);
|
|
254
|
-
return t && !
|
|
255
|
-
protocol:
|
|
254
|
+
return t && !C(t, e) ? this.staleLifecycleResponse(e) : {
|
|
255
|
+
protocol: l,
|
|
256
256
|
kind: "accepted",
|
|
257
257
|
sessionId: e.sessionId,
|
|
258
258
|
operationId: e.operationId,
|
|
@@ -262,13 +262,13 @@ var te = "ooxml-pull-resetting", ne = "ooxml-pull-reset-failed", re = class {
|
|
|
262
262
|
};
|
|
263
263
|
}
|
|
264
264
|
return {
|
|
265
|
-
protocol:
|
|
265
|
+
protocol: l,
|
|
266
266
|
kind: "error",
|
|
267
267
|
sessionId: e.sessionId,
|
|
268
268
|
operationId: e.operationId,
|
|
269
269
|
generation: e.generation,
|
|
270
270
|
requestId: e.requestId,
|
|
271
|
-
error:
|
|
271
|
+
error: c(this.lifecycleError())
|
|
272
272
|
};
|
|
273
273
|
}
|
|
274
274
|
requireArchive() {
|
|
@@ -281,7 +281,7 @@ var te = "ooxml-pull-resetting", ne = "ooxml-pull-reset-failed", re = class {
|
|
|
281
281
|
let t = this.sessions.get(e.sessionId);
|
|
282
282
|
if (t) {
|
|
283
283
|
await t.host.dispatch({
|
|
284
|
-
protocol:
|
|
284
|
+
protocol: l,
|
|
285
285
|
kind: "close",
|
|
286
286
|
...e,
|
|
287
287
|
requestId: 1
|
|
@@ -289,18 +289,18 @@ var te = "ooxml-pull-resetting", ne = "ooxml-pull-reset-failed", re = class {
|
|
|
289
289
|
return;
|
|
290
290
|
}
|
|
291
291
|
let n = this.pendingOpens.get(e.sessionId);
|
|
292
|
-
n &&
|
|
292
|
+
n && C(n.identity, e) && (n.canceled = !0);
|
|
293
293
|
}
|
|
294
294
|
readResourceUsage() {
|
|
295
|
-
return
|
|
295
|
+
return x(this.executeArchive);
|
|
296
296
|
}
|
|
297
297
|
latchResourceFailure(e) {
|
|
298
|
-
let t = e instanceof
|
|
298
|
+
let t = e instanceof y ? e : a(e);
|
|
299
299
|
t && (this.resourceFailure ??= t);
|
|
300
300
|
}
|
|
301
301
|
staleLifecycleResponse(e) {
|
|
302
302
|
return {
|
|
303
|
-
protocol:
|
|
303
|
+
protocol: l,
|
|
304
304
|
kind: "error",
|
|
305
305
|
sessionId: e.sessionId,
|
|
306
306
|
operationId: e.operationId,
|
|
@@ -314,24 +314,24 @@ var te = "ooxml-pull-resetting", ne = "ooxml-pull-reset-failed", re = class {
|
|
|
314
314
|
};
|
|
315
315
|
}
|
|
316
316
|
};
|
|
317
|
-
function
|
|
317
|
+
function S(e) {
|
|
318
318
|
if (!Number.isSafeInteger(e.sessionId) || e.sessionId <= 0) throw RangeError("session id must be a positive safe integer");
|
|
319
319
|
if (!Number.isSafeInteger(e.operationId) || e.operationId <= 0) throw RangeError("operation id must be a positive safe integer");
|
|
320
320
|
if (!Number.isSafeInteger(e.generation) || e.generation <= 0) throw RangeError("generation must be a positive safe integer");
|
|
321
321
|
}
|
|
322
|
-
function
|
|
322
|
+
function C(e, t) {
|
|
323
323
|
return e.sessionId === t.sessionId && e.operationId === t.operationId && e.generation === t.generation;
|
|
324
324
|
}
|
|
325
325
|
//#endregion
|
|
326
326
|
//#region packages/core/src/internal/wasm-runtime-generation.ts
|
|
327
|
-
function
|
|
328
|
-
return _(e) ? new
|
|
327
|
+
function ie(e) {
|
|
328
|
+
return _(e) ? new h(`WASM parser trapped and was recycled: ${e instanceof Error ? e.message : String(e)}`) : null;
|
|
329
329
|
}
|
|
330
330
|
var w = class {
|
|
331
331
|
realm;
|
|
332
332
|
live = /* @__PURE__ */ new Set();
|
|
333
333
|
constructor(e, t) {
|
|
334
|
-
this.realm = new
|
|
334
|
+
this.realm = new u(() => e.initSync({ module: t }), () => e.reinit({ module_or_path: t }), ie), this.realm.onPoison((e) => {
|
|
335
335
|
for (let t of this.live) t.poison(e);
|
|
336
336
|
this.live.clear();
|
|
337
337
|
});
|
|
@@ -341,7 +341,7 @@ var w = class {
|
|
|
341
341
|
this.throwIfOpenAborted(t), await this.awaitReadyOrAbort(t), this.throwIfOpenAborted(t);
|
|
342
342
|
let n = this.realm.tryRunReady(e);
|
|
343
343
|
if (!n.current) continue;
|
|
344
|
-
let r = new
|
|
344
|
+
let r = new ae(this, n.value, n.generation);
|
|
345
345
|
if (this.live.add(r), t?.signal?.aborted) throw r.close(t.disposeOnAbort), t.abortError?.() ?? new DOMException("The operation was aborted", "AbortError");
|
|
346
346
|
return r;
|
|
347
347
|
}
|
|
@@ -373,7 +373,7 @@ var w = class {
|
|
|
373
373
|
let n = e.detachForClose();
|
|
374
374
|
this.live.delete(e), n && this.realm.run(() => t(n));
|
|
375
375
|
}
|
|
376
|
-
},
|
|
376
|
+
}, ae = class {
|
|
377
377
|
archive;
|
|
378
378
|
failure;
|
|
379
379
|
proxy;
|
|
@@ -403,19 +403,19 @@ var w = class {
|
|
|
403
403
|
}
|
|
404
404
|
poison(e) {
|
|
405
405
|
let t = this.archive;
|
|
406
|
-
this.failure = e, this.archive = void 0,
|
|
406
|
+
this.failure = e, this.archive = void 0, m(t);
|
|
407
407
|
}
|
|
408
|
-
},
|
|
409
|
-
PptxArchive: () =>
|
|
408
|
+
}, oe = /* @__PURE__ */ e({
|
|
409
|
+
PptxArchive: () => T,
|
|
410
410
|
default: () => Y,
|
|
411
|
-
extract_font: () =>
|
|
412
|
-
extract_image: () =>
|
|
413
|
-
extract_media: () =>
|
|
411
|
+
extract_font: () => se,
|
|
412
|
+
extract_image: () => ce,
|
|
413
|
+
extract_media: () => E,
|
|
414
414
|
initSync: () => ue,
|
|
415
|
-
parse_pptx: () =>
|
|
416
|
-
pptx_to_markdown: () =>
|
|
415
|
+
parse_pptx: () => D,
|
|
416
|
+
pptx_to_markdown: () => O,
|
|
417
417
|
reinit: () => de
|
|
418
|
-
}),
|
|
418
|
+
}), T = class {
|
|
419
419
|
__destroy_into_raw() {
|
|
420
420
|
let e = this.__wbg_ptr;
|
|
421
421
|
return this.__wbg_ptr = 0, A.unregister(this), e;
|
|
@@ -503,32 +503,32 @@ var w = class {
|
|
|
503
503
|
}
|
|
504
504
|
}
|
|
505
505
|
};
|
|
506
|
-
Symbol.dispose && (
|
|
507
|
-
function
|
|
506
|
+
Symbol.dispose && (T.prototype[Symbol.dispose] = T.prototype.free);
|
|
507
|
+
function se(e, t, n, r) {
|
|
508
508
|
let i = R(e, q.__wbindgen_malloc), a = K, o = z(t, q.__wbindgen_malloc, q.__wbindgen_realloc), s = K, c = q.extract_font(i, a, o, s, !L(n), L(n) ? BigInt(0) : n, !L(r), L(r) ? BigInt(0) : r);
|
|
509
509
|
if (c[3]) throw B(c[2]);
|
|
510
510
|
var l = j(c[0], c[1]).slice();
|
|
511
511
|
return q.__wbindgen_free(c[0], c[1] * 1, 1), l;
|
|
512
512
|
}
|
|
513
|
-
function
|
|
513
|
+
function ce(e, t, n, r) {
|
|
514
514
|
let i = R(e, q.__wbindgen_malloc), a = K, o = z(t, q.__wbindgen_malloc, q.__wbindgen_realloc), s = K, c = q.extract_image(i, a, o, s, !L(n), L(n) ? BigInt(0) : n, !L(r), L(r) ? BigInt(0) : r);
|
|
515
515
|
if (c[3]) throw B(c[2]);
|
|
516
516
|
var l = j(c[0], c[1]).slice();
|
|
517
517
|
return q.__wbindgen_free(c[0], c[1] * 1, 1), l;
|
|
518
518
|
}
|
|
519
|
-
function
|
|
519
|
+
function E(e, t, n, r) {
|
|
520
520
|
let i = R(e, q.__wbindgen_malloc), a = K, o = z(t, q.__wbindgen_malloc, q.__wbindgen_realloc), s = K, c = q.extract_media(i, a, o, s, !L(n), L(n) ? BigInt(0) : n, !L(r), L(r) ? BigInt(0) : r);
|
|
521
521
|
if (c[3]) throw B(c[2]);
|
|
522
522
|
var l = j(c[0], c[1]).slice();
|
|
523
523
|
return q.__wbindgen_free(c[0], c[1] * 1, 1), l;
|
|
524
524
|
}
|
|
525
|
-
function
|
|
525
|
+
function D(e, t, n) {
|
|
526
526
|
let r = R(e, q.__wbindgen_malloc), i = K, a = q.parse_pptx(r, i, !L(t), L(t) ? BigInt(0) : t, !L(n), L(n) ? BigInt(0) : n);
|
|
527
527
|
if (a[3]) throw B(a[2]);
|
|
528
528
|
var o = j(a[0], a[1]).slice();
|
|
529
529
|
return q.__wbindgen_free(a[0], a[1] * 1, 1), o;
|
|
530
530
|
}
|
|
531
|
-
function
|
|
531
|
+
function O(e, t, n) {
|
|
532
532
|
let r, i;
|
|
533
533
|
try {
|
|
534
534
|
let s = R(e, q.__wbindgen_malloc), c = K, l = q.pptx_to_markdown(s, c, !L(t), L(t) ? BigInt(0) : t, !L(n), L(n) ? BigInt(0) : n);
|
|
@@ -690,26 +690,26 @@ async function de(e) {
|
|
|
690
690
|
//#region packages/pptx/src/internal/node-acquisition.ts
|
|
691
691
|
var X, Z;
|
|
692
692
|
function fe(e) {
|
|
693
|
-
if (!Z) X = e, Z = new w(
|
|
693
|
+
if (!Z) X = e, Z = new w(oe, e);
|
|
694
694
|
else if (X !== e) throw Error("PPTX runtime was already initialized with another WebAssembly.Module");
|
|
695
695
|
return Z;
|
|
696
696
|
}
|
|
697
697
|
async function pe(e, n, i = {}) {
|
|
698
|
-
let
|
|
699
|
-
enabled:
|
|
698
|
+
let s = r(i), c = new d({
|
|
699
|
+
enabled: s.debug || s.onResourceMetrics !== void 0,
|
|
700
700
|
format: "pptx",
|
|
701
701
|
mode: "node",
|
|
702
702
|
scope: "session",
|
|
703
|
-
policy:
|
|
704
|
-
onMetrics:
|
|
705
|
-
emitToConsole:
|
|
703
|
+
policy: s.policy,
|
|
704
|
+
onMetrics: s.onResourceMetrics,
|
|
705
|
+
emitToConsole: s.debug
|
|
706
706
|
});
|
|
707
707
|
c.setSourceBytes(e.byteLength);
|
|
708
708
|
let l;
|
|
709
709
|
try {
|
|
710
710
|
Q(i.signal);
|
|
711
|
-
let [r,
|
|
712
|
-
l = await fe(n).open(() => new d(e, r,
|
|
711
|
+
let [r, a, u] = o(s.policy), d = T;
|
|
712
|
+
l = await fe(n).open(() => new d(e, r, a, u), {
|
|
713
713
|
signal: i.signal,
|
|
714
714
|
abortError: $,
|
|
715
715
|
disposeOnAbort: (e) => e.free()
|
|
@@ -725,7 +725,7 @@ async function pe(e, n, i = {}) {
|
|
|
725
725
|
try {
|
|
726
726
|
l?.close((e) => e.free());
|
|
727
727
|
} catch {}
|
|
728
|
-
let t =
|
|
728
|
+
let t = a(e) ?? e;
|
|
729
729
|
throw c.fail(t), t;
|
|
730
730
|
}
|
|
731
731
|
}
|
|
@@ -740,4 +740,4 @@ function $() {
|
|
|
740
740
|
//#region packages/pptx/src/internal/session.ts
|
|
741
741
|
var me = /* @__PURE__ */ e({ renderSlide: () => n });
|
|
742
742
|
//#endregion
|
|
743
|
-
export {
|
|
743
|
+
export { x as a, re as i, pe as n, w as r, me as t };
|