@rhc-office/sdk 6.6.351 → 6.6.367
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/dist/api/annotation-tool.d.ts +25 -0
- package/dist/api/annotation-tool.d.ts.map +1 -1
- package/dist/api/digital-sign-environment.d.ts +6 -0
- package/dist/api/digital-sign-environment.d.ts.map +1 -1
- package/dist/api/document-tool.d.ts +3 -0
- package/dist/api/document-tool.d.ts.map +1 -1
- package/dist/browser/document-viewer.js +1 -1
- package/dist/browser/document-viewer.js.map +1 -1
- package/dist/browser.d.ts +4 -2
- package/dist/browser.d.ts.map +1 -1
- package/dist/index.js +279 -244
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +1 -1
- package/dist/index.umd.cjs.map +1 -1
- package/dist/tools/AnnotationToolImpl.d.ts +3 -0
- package/dist/tools/AnnotationToolImpl.d.ts.map +1 -1
- package/dist/viewer/DocumentSDK.d.ts +3 -0
- package/dist/viewer/DocumentSDK.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/api/annotation-tool.ts +31 -0
- package/src/api/digital-sign-environment.ts +56 -20
- package/src/api/document-tool.ts +3 -0
- package/src/browser.ts +5 -0
- package/src/tools/AnnotationToolImpl.ts +15 -0
- package/src/viewer/DocumentSDK.ts +65 -3
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
var
|
|
2
|
-
const
|
|
1
|
+
var Y = /* @__PURE__ */ ((t) => (t.DEFAULT = "default", t.COMPACT = "compact", t.HIDE = "none", t))(Y || {});
|
|
2
|
+
const U = "RIGHT_CENTER", N = "REGULAR_ESM", B = "auto", k = "__RHC_OFFICE_DIGITAL_SIGN_ENVIRONMENT__", E = {
|
|
3
3
|
defaults: {
|
|
4
4
|
bjca: {
|
|
5
5
|
pin: ""
|
|
6
6
|
},
|
|
7
7
|
deviceType: "client",
|
|
8
|
-
edgePosition:
|
|
8
|
+
edgePosition: U,
|
|
9
9
|
kol: {
|
|
10
10
|
appId: "",
|
|
11
11
|
appName: "",
|
|
@@ -17,8 +17,8 @@ const L = "RIGHT_CENTER", F = "REGULAR_ESM", U = "auto", S = "__RHC_OFFICE_DIGIT
|
|
|
17
17
|
pin: "",
|
|
18
18
|
usbKeyType: 14
|
|
19
19
|
},
|
|
20
|
-
rsaMode:
|
|
21
|
-
signatureType:
|
|
20
|
+
rsaMode: B,
|
|
21
|
+
signatureType: N
|
|
22
22
|
},
|
|
23
23
|
signServer: {
|
|
24
24
|
authSource: "Password",
|
|
@@ -38,7 +38,7 @@ const L = "RIGHT_CENTER", F = "REGULAR_ESM", U = "auto", S = "__RHC_OFFICE_DIGIT
|
|
|
38
38
|
usbKeyType: 14
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
},
|
|
41
|
+
}, x = (t) => ({
|
|
42
42
|
bjca: {
|
|
43
43
|
pin: t.bjca.pin
|
|
44
44
|
},
|
|
@@ -57,7 +57,7 @@ const L = "RIGHT_CENTER", F = "REGULAR_ESM", U = "auto", S = "__RHC_OFFICE_DIGIT
|
|
|
57
57
|
},
|
|
58
58
|
rsaMode: t.rsaMode,
|
|
59
59
|
signatureType: t.signatureType
|
|
60
|
-
}),
|
|
60
|
+
}), K = (t) => ({
|
|
61
61
|
authSource: t.authSource,
|
|
62
62
|
defaultLogin: t.defaultLogin,
|
|
63
63
|
defaultPassword: t.defaultPassword,
|
|
@@ -74,10 +74,10 @@ const L = "RIGHT_CENTER", F = "REGULAR_ESM", U = "auto", S = "__RHC_OFFICE_DIGIT
|
|
|
74
74
|
checkCertificateBinding: t.usbKey.checkCertificateBinding,
|
|
75
75
|
usbKeyType: t.usbKey.usbKeyType
|
|
76
76
|
}
|
|
77
|
-
}),
|
|
78
|
-
defaults:
|
|
79
|
-
signServer:
|
|
80
|
-
}),
|
|
77
|
+
}), g = (t) => ({
|
|
78
|
+
defaults: x(t.defaults),
|
|
79
|
+
signServer: K(t.signServer)
|
|
80
|
+
}), y = (t) => ({
|
|
81
81
|
defaults: t.defaults ? {
|
|
82
82
|
...t.defaults,
|
|
83
83
|
bjca: t.defaults.bjca ? { ...t.defaults.bjca } : void 0,
|
|
@@ -89,7 +89,7 @@ const L = "RIGHT_CENTER", F = "REGULAR_ESM", U = "auto", S = "__RHC_OFFICE_DIGIT
|
|
|
89
89
|
kol: t.signServer.kol ? { ...t.signServer.kol } : void 0,
|
|
90
90
|
usbKey: t.signServer.usbKey ? { ...t.signServer.usbKey } : void 0
|
|
91
91
|
} : void 0
|
|
92
|
-
}),
|
|
92
|
+
}), W = (t, n) => n ? {
|
|
93
93
|
bjca: {
|
|
94
94
|
pin: n.bjca?.pin ?? t.bjca.pin
|
|
95
95
|
},
|
|
@@ -108,7 +108,7 @@ const L = "RIGHT_CENTER", F = "REGULAR_ESM", U = "auto", S = "__RHC_OFFICE_DIGIT
|
|
|
108
108
|
},
|
|
109
109
|
rsaMode: n.rsaMode ?? t.rsaMode,
|
|
110
110
|
signatureType: n.signatureType ?? t.signatureType
|
|
111
|
-
} :
|
|
111
|
+
} : x(t), $ = (t, n) => n ? {
|
|
112
112
|
authSource: n.authSource ?? t.authSource,
|
|
113
113
|
defaultLogin: n.defaultLogin ?? t.defaultLogin,
|
|
114
114
|
defaultPassword: n.defaultPassword ?? t.defaultPassword,
|
|
@@ -125,62 +125,72 @@ const L = "RIGHT_CENTER", F = "REGULAR_ESM", U = "auto", S = "__RHC_OFFICE_DIGIT
|
|
|
125
125
|
checkCertificateBinding: n.usbKey?.checkCertificateBinding ?? t.usbKey.checkCertificateBinding,
|
|
126
126
|
usbKeyType: n.usbKey?.usbKeyType ?? t.usbKey.usbKeyType
|
|
127
127
|
}
|
|
128
|
-
} :
|
|
129
|
-
defaults:
|
|
130
|
-
signServer:
|
|
131
|
-
}),
|
|
132
|
-
|
|
133
|
-
...t.defaults,
|
|
134
|
-
...n.defaults
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
} : void 0
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
...
|
|
153
|
-
...
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
...
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
128
|
+
} : K(t), V = (t, n) => ({
|
|
129
|
+
defaults: W(t.defaults, n.defaults),
|
|
130
|
+
signServer: $(t.signServer, n.signServer)
|
|
131
|
+
}), X = (t, n) => {
|
|
132
|
+
const e = t.defaults?.bjca || n.defaults?.bjca ? {
|
|
133
|
+
...t.defaults?.bjca,
|
|
134
|
+
...n.defaults?.bjca
|
|
135
|
+
} : void 0, i = t.defaults?.kol || n.defaults?.kol ? {
|
|
136
|
+
...t.defaults?.kol,
|
|
137
|
+
...n.defaults?.kol
|
|
138
|
+
} : void 0, r = t.defaults?.plugin || n.defaults?.plugin ? {
|
|
139
|
+
...t.defaults?.plugin,
|
|
140
|
+
...n.defaults?.plugin
|
|
141
|
+
} : void 0, a = t.signServer?.kol || n.signServer?.kol ? {
|
|
142
|
+
...t.signServer?.kol,
|
|
143
|
+
...n.signServer?.kol
|
|
144
|
+
} : void 0, s = t.signServer?.usbKey || n.signServer?.usbKey ? {
|
|
145
|
+
...t.signServer?.usbKey,
|
|
146
|
+
...n.signServer?.usbKey
|
|
147
|
+
} : void 0;
|
|
148
|
+
return {
|
|
149
|
+
defaults: t.defaults || n.defaults ? {
|
|
150
|
+
...t.defaults,
|
|
151
|
+
...n.defaults,
|
|
152
|
+
...e ? { bjca: e } : {},
|
|
153
|
+
...i ? { kol: i } : {},
|
|
154
|
+
...r ? { plugin: r } : {}
|
|
155
|
+
} : void 0,
|
|
156
|
+
signServer: t.signServer || n.signServer ? {
|
|
157
|
+
...t.signServer,
|
|
158
|
+
...n.signServer,
|
|
159
|
+
...a ? { kol: a } : {},
|
|
160
|
+
...s ? { usbKey: s } : {}
|
|
161
|
+
} : void 0
|
|
162
|
+
};
|
|
163
|
+
}, J = () => globalThis, p = () => {
|
|
164
|
+
const t = J();
|
|
165
|
+
return t[k] || (t[k] = {
|
|
166
|
+
current: g(E),
|
|
167
|
+
defaults: g(E),
|
|
165
168
|
overrides: {}
|
|
166
|
-
}), t[
|
|
167
|
-
},
|
|
168
|
-
const
|
|
169
|
-
return
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
}
|
|
174
|
-
const n = b();
|
|
175
|
-
return n.overrides = Y(n.overrides, x(t)), n.current = V(n.current, t), n.current;
|
|
169
|
+
}), t[k];
|
|
170
|
+
}, lt = () => p().current, ct = () => {
|
|
171
|
+
const t = p();
|
|
172
|
+
return {
|
|
173
|
+
current: g(t.current),
|
|
174
|
+
defaults: g(t.defaults),
|
|
175
|
+
overrides: y(t.overrides)
|
|
176
|
+
};
|
|
176
177
|
}, ht = (t) => {
|
|
177
|
-
const n =
|
|
178
|
-
return
|
|
179
|
-
}, gt = {
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
178
|
+
const n = p();
|
|
179
|
+
return n.defaults = g(t), n.current = V(n.defaults, n.overrides), n.current;
|
|
180
|
+
}, gt = (t) => {
|
|
181
|
+
const n = p();
|
|
182
|
+
return n.current = g(t), n.overrides = y(t), n.current;
|
|
183
|
+
}, mt = (t) => {
|
|
184
|
+
const n = p();
|
|
185
|
+
return n.overrides = X(n.overrides, y(t)), n.current = V(n.current, t), n.current;
|
|
186
|
+
}, pt = (t) => {
|
|
187
|
+
const n = p();
|
|
188
|
+
return t && (n.defaults = g(t)), n.overrides = {}, n.current = g(n.defaults), n.current;
|
|
189
|
+
}, bt = {
|
|
190
|
+
EDGE_POSITION: U,
|
|
191
|
+
RSA_MODE: B,
|
|
192
|
+
SIGNATURE_TYPE: N
|
|
193
|
+
}, f = (t) => {
|
|
184
194
|
if (t.length !== 0)
|
|
185
195
|
return t.length === 1 ? t[0] : t;
|
|
186
196
|
}, d = (t, n, e) => new Proxy(
|
|
@@ -201,16 +211,16 @@ const L = "RIGHT_CENTER", F = "REGULAR_ESM", U = "auto", S = "__RHC_OFFICE_DIGIT
|
|
|
201
211
|
return a.state?.(e.state.snapshot(), s);
|
|
202
212
|
const o = a.adapterMethod ?? r;
|
|
203
213
|
if (a.kind === "query")
|
|
204
|
-
return e.bridge.request(t, o,
|
|
214
|
+
return e.bridge.request(t, o, f(s));
|
|
205
215
|
if (a.kind === "callbackQuery") {
|
|
206
216
|
const c = s.find((h) => typeof h == "function"), l = s.filter((h) => typeof h != "function");
|
|
207
|
-
e.bridge.request(t, o,
|
|
208
|
-
const
|
|
209
|
-
c?.(...
|
|
217
|
+
e.bridge.request(t, o, f(l)).then((h) => {
|
|
218
|
+
const j = a.mapCallbackResult?.(h) ?? [h];
|
|
219
|
+
c?.(...j);
|
|
210
220
|
}).catch(e.onAsyncError);
|
|
211
221
|
return;
|
|
212
222
|
}
|
|
213
|
-
const u = e.bridge.request(t, o,
|
|
223
|
+
const u = e.bridge.request(t, o, f(s)).catch((c) => {
|
|
214
224
|
e.onAsyncError(c);
|
|
215
225
|
});
|
|
216
226
|
if (a.returnsResult)
|
|
@@ -221,7 +231,7 @@ const L = "RIGHT_CENTER", F = "REGULAR_ESM", U = "auto", S = "__RHC_OFFICE_DIGIT
|
|
|
221
231
|
};
|
|
222
232
|
}
|
|
223
233
|
}
|
|
224
|
-
),
|
|
234
|
+
), Z = (t) => typeof t == "object" && t !== null && !Array.isArray(t) && "id" in t, P = (t) => t.annotations?.filter(Z).map((n) => ({ ...n })) ?? [], ee = (t) => {
|
|
225
235
|
switch (t) {
|
|
226
236
|
case "select":
|
|
227
237
|
case "pen":
|
|
@@ -241,7 +251,7 @@ const L = "RIGHT_CENTER", F = "REGULAR_ESM", U = "auto", S = "__RHC_OFFICE_DIGIT
|
|
|
241
251
|
default:
|
|
242
252
|
return "none";
|
|
243
253
|
}
|
|
244
|
-
},
|
|
254
|
+
}, te = {
|
|
245
255
|
addAnnotationEventCallback: {
|
|
246
256
|
kind: "callbackRegister",
|
|
247
257
|
callback: (t, n) => {
|
|
@@ -255,15 +265,15 @@ const L = "RIGHT_CENTER", F = "REGULAR_ESM", U = "auto", S = "__RHC_OFFICE_DIGIT
|
|
|
255
265
|
},
|
|
256
266
|
getAnnotationMode: {
|
|
257
267
|
kind: "stateGetter",
|
|
258
|
-
state: (t) =>
|
|
268
|
+
state: (t) => ee(t.annotationMode)
|
|
259
269
|
},
|
|
260
270
|
getAnnotations: {
|
|
261
271
|
kind: "stateGetter",
|
|
262
|
-
state: (t) =>
|
|
272
|
+
state: (t) => P(t)
|
|
263
273
|
},
|
|
264
274
|
getAnnotationsCount: {
|
|
265
275
|
kind: "stateGetter",
|
|
266
|
-
state: (t) =>
|
|
276
|
+
state: (t) => P(t).length
|
|
267
277
|
},
|
|
268
278
|
openAnnotationView: { kind: "command" },
|
|
269
279
|
closeAnnotationView: { kind: "command" },
|
|
@@ -275,29 +285,32 @@ const L = "RIGHT_CENTER", F = "REGULAR_ESM", U = "auto", S = "__RHC_OFFICE_DIGIT
|
|
|
275
285
|
canRedoAnnotation: { kind: "query" },
|
|
276
286
|
selectAnnotationTool: { kind: "command" },
|
|
277
287
|
selectAnnotationStamp: { kind: "command" },
|
|
288
|
+
getCustomStamps: { kind: "query" },
|
|
289
|
+
addCustomTextStamp: { kind: "query" },
|
|
290
|
+
addCustomImageStamp: { kind: "query" },
|
|
278
291
|
setAnnotationPenColor: { kind: "command" },
|
|
279
292
|
setAnnotationPenWidth: { kind: "command" },
|
|
280
293
|
setAnnotationPenStyle: { kind: "command" }
|
|
281
294
|
};
|
|
282
|
-
class
|
|
295
|
+
class ne {
|
|
283
296
|
constructor(n) {
|
|
284
|
-
this.openAnnotationView = (e) => this.adapter.openAnnotationView(e), this.closeAnnotationView = () => this.adapter.closeAnnotationView(), this.saveAnnotations = (e) => this.adapter.saveAnnotations(e), this.clearAnnotations = () => this.adapter.clearAnnotations(), this.undoAnnotation = () => this.adapter.undoAnnotation(), this.redoAnnotation = () => this.adapter.redoAnnotation(), this.canUndoAnnotation = () => this.adapter.canUndoAnnotation(), this.canRedoAnnotation = () => this.adapter.canRedoAnnotation(), this.selectAnnotationTool = (e, i) => this.adapter.selectAnnotationTool(e, i), this.selectAnnotationStamp = (e) => this.adapter.selectAnnotationStamp(e), this.setAnnotationPenColor = (e) => this.adapter.setAnnotationPenColor(e), this.setAnnotationPenWidth = (e) => this.adapter.setAnnotationPenWidth(e), this.setAnnotationPenStyle = (e) => this.adapter.setAnnotationPenStyle(e), this.isInAnnotationMode = () => this.adapter.isInAnnotationMode(), this.getAnnotationMode = () => this.adapter.getAnnotationMode(), this.getAnnotations = () => this.adapter.getAnnotations(), this.getAnnotationsCount = () => this.adapter.getAnnotationsCount(), this.addAnnotationEventCallback = (e) => this.adapter.addAnnotationEventCallback(e), this.adapter = d(
|
|
297
|
+
this.openAnnotationView = (e) => this.adapter.openAnnotationView(e), this.closeAnnotationView = () => this.adapter.closeAnnotationView(), this.saveAnnotations = (e) => this.adapter.saveAnnotations(e), this.clearAnnotations = () => this.adapter.clearAnnotations(), this.undoAnnotation = () => this.adapter.undoAnnotation(), this.redoAnnotation = () => this.adapter.redoAnnotation(), this.canUndoAnnotation = () => this.adapter.canUndoAnnotation(), this.canRedoAnnotation = () => this.adapter.canRedoAnnotation(), this.selectAnnotationTool = (e, i) => this.adapter.selectAnnotationTool(e, i), this.selectAnnotationStamp = (e) => this.adapter.selectAnnotationStamp(e), this.getCustomStamps = () => this.adapter.getCustomStamps(), this.addCustomTextStamp = (e) => this.adapter.addCustomTextStamp(e), this.addCustomImageStamp = (e) => this.adapter.addCustomImageStamp(e), this.setAnnotationPenColor = (e) => this.adapter.setAnnotationPenColor(e), this.setAnnotationPenWidth = (e) => this.adapter.setAnnotationPenWidth(e), this.setAnnotationPenStyle = (e) => this.adapter.setAnnotationPenStyle(e), this.isInAnnotationMode = () => this.adapter.isInAnnotationMode(), this.getAnnotationMode = () => this.adapter.getAnnotationMode(), this.getAnnotations = () => this.adapter.getAnnotations(), this.getAnnotationsCount = () => this.adapter.getAnnotationsCount(), this.addAnnotationEventCallback = (e) => this.adapter.addAnnotationEventCallback(e), this.adapter = d(
|
|
285
298
|
"annotation",
|
|
286
|
-
|
|
299
|
+
te,
|
|
287
300
|
n
|
|
288
301
|
);
|
|
289
302
|
}
|
|
290
303
|
}
|
|
291
|
-
const
|
|
304
|
+
const ie = {
|
|
292
305
|
configSecurityProvider: { kind: "command" },
|
|
293
306
|
getSecurityProviders: { kind: "query" }
|
|
294
307
|
};
|
|
295
|
-
class
|
|
308
|
+
class re {
|
|
296
309
|
constructor(n) {
|
|
297
|
-
this.configSecurityProvider = (e) => this.adapter.configSecurityProvider(e), this.getSecurityProviders = () => this.adapter.getSecurityProviders(), this.adapter = d("crypto",
|
|
310
|
+
this.configSecurityProvider = (e) => this.adapter.configSecurityProvider(e), this.getSecurityProviders = () => this.adapter.getSecurityProviders(), this.adapter = d("crypto", ie, n);
|
|
298
311
|
}
|
|
299
312
|
}
|
|
300
|
-
const
|
|
313
|
+
const C = (t) => t.digitalSignatures ? [...t.digitalSignatures] : [], ae = {
|
|
301
314
|
addDigitalSignatureRetrieveCallback: {
|
|
302
315
|
kind: "callbackRegister",
|
|
303
316
|
callback: (t, n) => {
|
|
@@ -334,25 +347,25 @@ const E = (t) => t.digitalSignatures ? [...t.digitalSignatures] : [], re = {
|
|
|
334
347
|
listDigitalSignatures: { kind: "callbackQuery" },
|
|
335
348
|
getDigitalSignatures: {
|
|
336
349
|
kind: "stateGetter",
|
|
337
|
-
state: (t) =>
|
|
350
|
+
state: (t) => C(t)
|
|
338
351
|
},
|
|
339
352
|
getDigitalSignaturesCount: {
|
|
340
353
|
kind: "stateGetter",
|
|
341
|
-
state: (t) =>
|
|
354
|
+
state: (t) => C(t).length
|
|
342
355
|
},
|
|
343
356
|
enableDigitalSignatureInfoView: { kind: "command" },
|
|
344
357
|
enableDigitalSignatureRevocation: { kind: "command" }
|
|
345
358
|
};
|
|
346
|
-
class
|
|
359
|
+
class se {
|
|
347
360
|
constructor(n) {
|
|
348
361
|
this.addDigitalSignatureRetrieveCallback = (e) => this.adapter.addDigitalSignatureRetrieveCallback(e), this.addDigitalSignatureParseCallback = (e) => this.adapter.addDigitalSignatureParseCallback(e), this.setCryptoProvider = (e, i, r) => this.adapter.setCryptoProvider(e, i, r), this.setSealSource = (e) => this.adapter.setSealSource(e), this.setDefaultStampPassword = (e) => this.adapter.setDefaultStampPassword(e), this.setDefaultSealPassword = (e) => this.adapter.setDefaultSealPassword(e), this.setDefaultKeystorePassword = (e) => this.adapter.setDefaultKeystorePassword(e), this.setDefaultUSBKeyPassword = (e) => this.adapter.setDefaultUSBKeyPassword(e), this.addDigitalSignCallback = (e) => this.adapter.addDigitalSignCallback(e), this.setupExternalSealServer = (e) => this.adapter.setupExternalSealServer(e), this.setDigitalSignOptions = (e) => this.adapter.setDigitalSignOptions(e), this.setExternalDigitalSignOptions = (e) => this.adapter.setExternalDigitalSignOptions(e), this.setPDFDigitalSignCaptionOptions = (e) => this.adapter.setPDFDigitalSignCaptionOptions(e), this.addDigitalSignature = (e, i) => this.adapter.addDigitalSignature(e, i), this.addDigitalSignatureBySelectedSearchHighlight = (e) => this.adapter.addDigitalSignatureBySelectedSearchHighlight(e), this.listDigitalSignatures = (e) => this.adapter.listDigitalSignatures(e), this.getDigitalSignatures = () => this.adapter.getDigitalSignatures(), this.getDigitalSignaturesCount = () => this.adapter.getDigitalSignaturesCount(), this.enableDigitalSignatureInfoView = (e) => this.adapter.enableDigitalSignatureInfoView(e), this.enableDigitalSignatureRevocation = (e) => this.adapter.enableDigitalSignatureRevocation(e), this.adapter = d(
|
|
349
362
|
"digitalSign",
|
|
350
|
-
|
|
363
|
+
ae,
|
|
351
364
|
n
|
|
352
365
|
);
|
|
353
366
|
}
|
|
354
367
|
}
|
|
355
|
-
const
|
|
368
|
+
const oe = "rhc-office.editor-adapter", de = 1, ue = "__RHC_OFFICE_EDITOR_ADAPTER__", D = "rhcOfficeAdapterReady", A = "rhcOfficeAdapterEvent", G = "data-rhc-office-reader-id", le = {
|
|
356
369
|
addDocumentOpenedCallback: {
|
|
357
370
|
kind: "callbackRegister",
|
|
358
371
|
callback: (t, n) => {
|
|
@@ -401,7 +414,7 @@ const se = "rhc-office.editor-adapter", oe = 1, de = "__RHC_OFFICE_EDITOR_ADAPTE
|
|
|
401
414
|
print: { kind: "command" },
|
|
402
415
|
createPreview: { kind: "command" }
|
|
403
416
|
};
|
|
404
|
-
class
|
|
417
|
+
class ce {
|
|
405
418
|
constructor(n) {
|
|
406
419
|
this.context = n, this.addDocumentOpenedCallback = (e) => this.adapter.addDocumentOpenedCallback(e), this.addDocumentSavedCallback = (e) => this.adapter.addDocumentSavedCallback(e), this.addDocumentClosedCallback = (e) => this.adapter.addDocumentClosedCallback(e), this.openPDFDocument = (e, i) => this.adapter.openPDFDocument(e, i), this.openPdfDocument = (e, i) => this.adapter.openPdfDocument(e, i), this.openOFDDocument = (e, i) => this.adapter.openOFDDocument(e, i), this.openOfdDocument = (e, i) => this.adapter.openOfdDocument(e, i), this.openOfficeDocument = (e, i) => this.adapter.openOfficeDocument(e, i), this.openImageDocument = (e, i) => this.adapter.openImageDocument(e, i), this.openTextDocument = (e, i) => this.adapter.openTextDocument(e, i), this.openFromLocalStorage = () => this.adapter.openFromLocalStorage(), this.setUploadUrl = (e) => this.adapter.setUploadUrl(e), this.save = (e, i, r) => this.adapter.save(e, i, r), this.saveAs = (e) => {
|
|
407
420
|
const i = this.context.bridge.getReaderId();
|
|
@@ -413,41 +426,41 @@ class le {
|
|
|
413
426
|
error: "Reader is not mounted or does not expose saveAs."
|
|
414
427
|
});
|
|
415
428
|
const r = document.querySelector(
|
|
416
|
-
`[${
|
|
429
|
+
`[${G}="${i}"]`
|
|
417
430
|
);
|
|
418
431
|
return typeof r?.saveAs == "function" ? r.saveAs(e) : this.adapter.saveAs(e);
|
|
419
432
|
}, this.getDocumentContent = (e) => this.adapter.getDocumentContent(e), this.closeDocument = (e, i, r) => this.adapter.closeDocument(e, i, r), this.isDocumentOpened = () => this.adapter.isDocumentOpened(), this.isDocumentModified = () => this.adapter.isDocumentModified(), this.print = () => this.adapter.print(), this.createPreview = (e, i) => this.adapter.createPreview(e, i), this.adapter = d(
|
|
420
433
|
"document",
|
|
421
|
-
|
|
434
|
+
le,
|
|
422
435
|
n
|
|
423
436
|
);
|
|
424
437
|
}
|
|
425
438
|
}
|
|
426
|
-
const
|
|
439
|
+
const he = {
|
|
427
440
|
clearFind: { kind: "command" },
|
|
428
441
|
findNext: { kind: "command" },
|
|
429
442
|
findPrevious: { kind: "command" }
|
|
430
443
|
};
|
|
431
|
-
class
|
|
444
|
+
class ge {
|
|
432
445
|
constructor(n) {
|
|
433
|
-
this.clearFind = () => this.adapter.clearFind(), this.findNext = (e) => this.adapter.findNext(e), this.findPrevious = (e) => this.adapter.findPrevious(e), this.adapter = d("find",
|
|
446
|
+
this.clearFind = () => this.adapter.clearFind(), this.findNext = (e) => this.adapter.findNext(e), this.findPrevious = (e) => this.adapter.findPrevious(e), this.adapter = d("find", he, n);
|
|
434
447
|
}
|
|
435
448
|
}
|
|
436
|
-
const
|
|
449
|
+
const me = {
|
|
437
450
|
configFileUpload: { kind: "command" },
|
|
438
451
|
setHttpHeaders: { kind: "command" },
|
|
439
452
|
setHttpFormFields: { kind: "command" }
|
|
440
453
|
};
|
|
441
|
-
class
|
|
454
|
+
class pe {
|
|
442
455
|
constructor(n) {
|
|
443
456
|
this.configFileUpload = (e) => this.adapter.configFileUpload(e), this.setHttpHeaders = (e) => this.adapter.setHttpHeaders(e), this.setHttpFormFields = (e) => this.adapter.setHttpFormFields(e), this.adapter = d(
|
|
444
457
|
"networking",
|
|
445
|
-
|
|
458
|
+
me,
|
|
446
459
|
n
|
|
447
460
|
);
|
|
448
461
|
}
|
|
449
462
|
}
|
|
450
|
-
const
|
|
463
|
+
const be = () => ({
|
|
451
464
|
clearContent: { kind: "command", returnsResult: !0 },
|
|
452
465
|
commit: { kind: "command", returnsResult: !0 },
|
|
453
466
|
deletePages: { kind: "command", returnsResult: !0 },
|
|
@@ -462,17 +475,17 @@ const pe = () => ({
|
|
|
462
475
|
rotateLeft: { kind: "command", returnsResult: !0 },
|
|
463
476
|
rotateRight: { kind: "command", returnsResult: !0 },
|
|
464
477
|
undo: { kind: "command", returnsResult: !0 }
|
|
465
|
-
}),
|
|
466
|
-
class
|
|
478
|
+
}), Se = (t) => t instanceof Uint8Array ? t : new Uint8Array(t);
|
|
479
|
+
class ke {
|
|
467
480
|
constructor(n) {
|
|
468
|
-
this.getSnapshot = () => this.adapter.getSnapshot(), this.execute = (e) => this.adapter.execute(e), this.newPage = (e, i) => this.adapter.newPage(e, i), this.deletePages = (e) => this.adapter.deletePages(e), this.duplicatePages = (e, i) => this.adapter.duplicatePages(e, i), this.rotateLeft = (e) => this.adapter.rotateLeft(e), this.rotateRight = (e) => this.adapter.rotateRight(e), this.clearContent = (e) => this.adapter.clearContent(e), this.moveBefore = (e, i) => this.adapter.moveBefore(e, i), this.moveAfter = (e, i) => this.adapter.moveAfter(e, i), this.importDocument = (e, i) => this.adapter.importDocument(
|
|
481
|
+
this.getSnapshot = () => this.adapter.getSnapshot(), this.execute = (e) => this.adapter.execute(e), this.newPage = (e, i) => this.adapter.newPage(e, i), this.deletePages = (e) => this.adapter.deletePages(e), this.duplicatePages = (e, i) => this.adapter.duplicatePages(e, i), this.rotateLeft = (e) => this.adapter.rotateLeft(e), this.rotateRight = (e) => this.adapter.rotateRight(e), this.clearContent = (e) => this.adapter.clearContent(e), this.moveBefore = (e, i) => this.adapter.moveBefore(e, i), this.moveAfter = (e, i) => this.adapter.moveAfter(e, i), this.importDocument = (e, i) => this.adapter.importDocument(Se(e), i), this.extractPages = (e, i) => this.adapter.extractPages(e, i), this.undo = () => this.adapter.undo(), this.commit = () => this.adapter.commit(), this.adapter = d(
|
|
469
482
|
"pageArrange",
|
|
470
|
-
|
|
483
|
+
be(),
|
|
471
484
|
n
|
|
472
485
|
);
|
|
473
486
|
}
|
|
474
487
|
}
|
|
475
|
-
const
|
|
488
|
+
const fe = (t) => ({
|
|
476
489
|
addPageChangeCallback: {
|
|
477
490
|
kind: "callbackRegister",
|
|
478
491
|
callback: (n, e) => {
|
|
@@ -522,16 +535,16 @@ const ke = (t) => ({
|
|
|
522
535
|
gotoPreviousPage: { kind: "command" },
|
|
523
536
|
rotatePage: { kind: "command" }
|
|
524
537
|
});
|
|
525
|
-
class
|
|
538
|
+
class Re {
|
|
526
539
|
constructor(n) {
|
|
527
540
|
this.addPageChangeCallback = (e) => this.adapter.addPageChangeCallback(e), this.addPageModeChangeCallback = (e) => this.adapter.addPageModeChangeCallback(e), this.getPageCount = (e) => this.adapter.getPageCount(e), this.getPageIndex = (e) => this.adapter.getPageIndex(e), this.setSinglePageViewMode = () => this.adapter.setSinglePageViewMode(), this.setTwoPagesViewMode = () => this.adapter.setTwoPagesViewMode(), this.setPageScrollVertical = () => this.adapter.setPageScrollVertical(), this.setPageScrollHorizontal = () => this.adapter.setPageScrollHorizontal(), this.setPageCursorPanDrag = () => this.adapter.setPageCursorPanDrag(), this.setPageCursorTextSelect = () => this.adapter.setPageCursorTextSelect(), this.rotateCW = () => this.adapter.rotateCW(), this.rotateCCW = () => this.adapter.rotateCCW(), this.autoFitPage = () => this.adapter.autoFitPage(), this.fitPageSize = () => this.adapter.fitPageSize(), this.fitPageWidth = () => this.adapter.fitPageWidth(), this.fitPageHeight = () => this.adapter.fitPageHeight(), this.increasePageScale = () => this.adapter.increasePageScale(), this.decreasePageScale = () => this.adapter.decreasePageScale(), this.setPageScale = (e) => this.adapter.setPageScale(e), this.setPageBlendColor = (e, i, r, a) => this.adapter.setPageBlendColor(e, i, r, a), this.gotoPage = (e, i, r) => this.adapter.gotoPage(e, i, r), this.gotoNextPage = () => this.adapter.gotoNextPage(), this.gotoPreviousPage = () => this.adapter.gotoPreviousPage(), this.rotatePage = (e) => this.adapter.rotatePage(e), this.adapter = d(
|
|
528
541
|
"page",
|
|
529
|
-
|
|
542
|
+
fe(n),
|
|
530
543
|
n
|
|
531
544
|
);
|
|
532
545
|
}
|
|
533
546
|
}
|
|
534
|
-
const
|
|
547
|
+
const Te = {
|
|
535
548
|
open: { kind: "command" },
|
|
536
549
|
setFormFieldValue: { kind: "command" },
|
|
537
550
|
setFormFieldReadonly: { kind: "command" },
|
|
@@ -548,28 +561,28 @@ const Re = {
|
|
|
548
561
|
mapCallbackResult: (t) => [Array.isArray(t) ? t : []]
|
|
549
562
|
}
|
|
550
563
|
};
|
|
551
|
-
class
|
|
564
|
+
class ve {
|
|
552
565
|
constructor(n) {
|
|
553
566
|
this.open = () => this.adapter.open(), this.setFormFieldValue = (e, i) => this.adapter.setFormFieldValue(e, i), this.setFormFieldReadonly = (e, i) => this.adapter.setFormFieldReadonly(e, i), this.commit = (e) => this.adapter.commit(e), this.clear = (e) => this.adapter.clear(e), this.toKeyValue = (e) => this.adapter.toKeyValue(e), this.adapter = d(
|
|
554
567
|
"pdfFormFiller",
|
|
555
|
-
|
|
568
|
+
Te,
|
|
556
569
|
n
|
|
557
570
|
);
|
|
558
571
|
}
|
|
559
572
|
}
|
|
560
|
-
const
|
|
573
|
+
const ye = /\s*,\s*/, Ee = /\s*-\s*/, R = (t) => {
|
|
561
574
|
const n = Number.parseInt(t.trim(), 10);
|
|
562
575
|
return !Number.isFinite(n) || n <= 0 ? null : n;
|
|
563
|
-
},
|
|
564
|
-
const n = t.split(
|
|
576
|
+
}, Pe = (t) => {
|
|
577
|
+
const n = t.split(Ee);
|
|
565
578
|
if (n.length === 1) {
|
|
566
|
-
const r =
|
|
579
|
+
const r = R(n[0] ?? "");
|
|
567
580
|
return r ? [r] : [];
|
|
568
581
|
}
|
|
569
|
-
const e =
|
|
582
|
+
const e = R(n[0] ?? ""), i = R(n[1] ?? "");
|
|
570
583
|
return !e || !i || i < e ? [] : Array.from({ length: i - e + 1 }, (r, a) => e + a);
|
|
571
|
-
},
|
|
572
|
-
class
|
|
584
|
+
}, Ce = (t) => t ? t.split(ye).flatMap((e) => Pe(e)).filter((e, i, r) => r.indexOf(e) === i) : [];
|
|
585
|
+
class De {
|
|
573
586
|
constructor(n, e, i) {
|
|
574
587
|
this.setFieldName = (r) => {
|
|
575
588
|
this.key = r;
|
|
@@ -580,7 +593,7 @@ class Ce {
|
|
|
580
593
|
}, this.key = n, this.value = e, this.description = i;
|
|
581
594
|
}
|
|
582
595
|
}
|
|
583
|
-
class
|
|
596
|
+
class Ae {
|
|
584
597
|
constructor() {
|
|
585
598
|
this.fields = [], this.keywordTextFixedPositions = void 0, this.keywordOffsetX = 0, this.keywordOffsetY = 0, this.bookmarkOffsetX = 0, this.bookmarkOffsetY = 0, this.printMargin = 0, this.grayscaleSealImage = !1, this.signType = 0, this.sealPosition = 0, this.getSignType = () => this.signType, this.setSignType = (n) => {
|
|
586
599
|
this.signType = n;
|
|
@@ -590,7 +603,7 @@ class De {
|
|
|
590
603
|
this.sealPosition = n;
|
|
591
604
|
}, this.setPageRange = (n) => {
|
|
592
605
|
this.pageRange = n;
|
|
593
|
-
}, this.getPageRange = () => this.pageRange, this.getPageRanges = () =>
|
|
606
|
+
}, this.getPageRange = () => this.pageRange, this.getPageRanges = () => Ce(this.pageRange), this.setSignUserData = (n) => {
|
|
594
607
|
this.signUserData = n;
|
|
595
608
|
}, this.setPrintMargin = (n) => {
|
|
596
609
|
this.printMargin = n;
|
|
@@ -603,23 +616,23 @@ class De {
|
|
|
603
616
|
};
|
|
604
617
|
}
|
|
605
618
|
}
|
|
606
|
-
const
|
|
619
|
+
const Me = {
|
|
607
620
|
getSecuritySettings: { kind: "query" },
|
|
608
621
|
isSecuritySettingsLocalEditable: { kind: "query" },
|
|
609
622
|
setSecuritySettingsLocalEditable: { kind: "query" },
|
|
610
623
|
setSecuritySettings: { kind: "query" },
|
|
611
624
|
openSecuritySettingsDialog: { kind: "command" }
|
|
612
625
|
};
|
|
613
|
-
class
|
|
626
|
+
class we {
|
|
614
627
|
constructor(n) {
|
|
615
628
|
this.getSecuritySettings = () => this.adapter.getSecuritySettings(), this.setSecuritySettings = (e) => this.adapter.setSecuritySettings(e), this.isSecuritySettingsLocalEditable = () => this.adapter.isSecuritySettingsLocalEditable(), this.setSecuritySettingsLocalEditable = (e) => this.adapter.setSecuritySettingsLocalEditable(e), this.openSecuritySettingsDialog = () => this.adapter.openSecuritySettingsDialog(), this.adapter = d(
|
|
616
629
|
"security",
|
|
617
|
-
|
|
630
|
+
Me,
|
|
618
631
|
n
|
|
619
632
|
);
|
|
620
633
|
}
|
|
621
634
|
}
|
|
622
|
-
const
|
|
635
|
+
const Ie = {
|
|
623
636
|
setSignServer: { kind: "command" },
|
|
624
637
|
addSignServerAuthCallback: {
|
|
625
638
|
kind: "callbackRegister",
|
|
@@ -639,11 +652,11 @@ const we = {
|
|
|
639
652
|
setSignServerLoginFromUSBKey: { kind: "command" },
|
|
640
653
|
setUserAuthSource: { kind: "command" }
|
|
641
654
|
};
|
|
642
|
-
class
|
|
655
|
+
class _e {
|
|
643
656
|
constructor(n) {
|
|
644
657
|
this.setSignServer = (e) => this.adapter.setSignServer(e), this.addSignServerAuthCallback = (e) => this.adapter.addSignServerAuthCallback(e), this.setSignServerDefaultLogin = (e) => this.adapter.setSignServerDefaultLogin(e), this.setDefaultSignServerLogin = (e) => this.adapter.setDefaultSignServerLogin(e), this.setSignServerDefaultPassword = (e) => this.adapter.setSignServerDefaultPassword(e), this.setDefaultSignServerPassword = (e) => this.adapter.setDefaultSignServerPassword(e), this.loginNTKOSignServer = (e, i, r) => this.adapter.loginNTKOSignServer(e, i, r), this.loginSignServer = (e, i, r, a) => this.adapter.loginSignServer(e, i, r, a), this.signOutSignServer = () => this.adapter.signOutSignServer(), this.isAuthenticatedOnSignServer = () => this.adapter.isAuthenticatedOnSignServer(), this.setSignServerLoginFromUSBKey = (e, i) => this.adapter.setSignServerLoginFromUSBKey(e, i), this.setUserAuthSource = (e) => this.adapter.setUserAuthSource(e), this.adapter = d(
|
|
645
658
|
"signServer",
|
|
646
|
-
|
|
659
|
+
Ie,
|
|
647
660
|
n
|
|
648
661
|
);
|
|
649
662
|
}
|
|
@@ -651,7 +664,7 @@ class Ie {
|
|
|
651
664
|
const Oe = {
|
|
652
665
|
createPDF417Barcode: { kind: "command" }
|
|
653
666
|
};
|
|
654
|
-
class
|
|
667
|
+
class Le {
|
|
655
668
|
constructor(n) {
|
|
656
669
|
this.createPDF417Barcode = (e, i, r, a, s, o, u) => this.adapter.createPDF417Barcode(e, i, r, a, s, o, u), this.adapter = d(
|
|
657
670
|
"symbology",
|
|
@@ -660,7 +673,7 @@ class _e {
|
|
|
660
673
|
);
|
|
661
674
|
}
|
|
662
675
|
}
|
|
663
|
-
const
|
|
676
|
+
const Fe = {
|
|
664
677
|
setup: { kind: "command" },
|
|
665
678
|
create: { kind: "command" },
|
|
666
679
|
getMarkups: { kind: "callbackQuery" },
|
|
@@ -668,16 +681,16 @@ const Le = {
|
|
|
668
681
|
removeAllMarkups: { kind: "command" },
|
|
669
682
|
sign: { kind: "callbackQuery" }
|
|
670
683
|
};
|
|
671
|
-
class
|
|
684
|
+
class Ue {
|
|
672
685
|
constructor(n) {
|
|
673
686
|
this.setup = (e) => this.adapter.setup(e), this.create = (e) => this.adapter.create(e), this.getMarkups = (e) => this.adapter.getMarkups(e), this.removeMarkup = (e, i) => this.adapter.removeMarkup(e, i), this.removeAllMarkups = (e) => this.adapter.removeAllMarkups(e), this.sign = (e) => this.adapter.sign(e), this.adapter = d(
|
|
674
687
|
"templateSign",
|
|
675
|
-
|
|
688
|
+
Fe,
|
|
676
689
|
n
|
|
677
690
|
);
|
|
678
691
|
}
|
|
679
692
|
}
|
|
680
|
-
const
|
|
693
|
+
const Ne = /* @__PURE__ */ new Set([2, 5]), Be = (t) => ({
|
|
681
694
|
showToolbarMenu: { kind: "command" },
|
|
682
695
|
hideToolbarMenu: { kind: "command" },
|
|
683
696
|
setupToolbarMenu: { kind: "command" },
|
|
@@ -715,13 +728,13 @@ const Ue = /* @__PURE__ */ new Set([2, 5]), Ne = (t) => ({
|
|
|
715
728
|
exitBookViewMode: { kind: "command" },
|
|
716
729
|
isBookViewActivated: {
|
|
717
730
|
kind: "stateGetter",
|
|
718
|
-
state: () =>
|
|
731
|
+
state: () => Ne.has(t.state.snapshot().pageMode)
|
|
719
732
|
},
|
|
720
733
|
requestFullScreen: { kind: "command" },
|
|
721
734
|
exitFullScreen: { kind: "command" },
|
|
722
735
|
invalidateView: { kind: "command" }
|
|
723
736
|
});
|
|
724
|
-
class
|
|
737
|
+
class xe {
|
|
725
738
|
constructor(n) {
|
|
726
739
|
this.showToolbarMenu = () => (this.warnLegacyRibbonMethod("showToolbarMenu", "showRibbonMenu"), this.showRibbonMenu()), this.hideToolbarMenu = () => (this.warnLegacyRibbonMethod("hideToolbarMenu", "hideRibbonMenu"), this.hideRibbonMenu()), this.setupToolbarMenu = (e) => (this.warnLegacyRibbonMethod(
|
|
727
740
|
"setupToolbarMenu",
|
|
@@ -729,13 +742,13 @@ class Be {
|
|
|
729
742
|
), this.setupRibbonMenu(e)), this.showToolbarMenuItem = (e) => (this.warnLegacyRibbonMethod("showToolbarMenuItem", "showRibbonMenuItem"), this.showRibbonMenuItem(e)), this.hideToolbarMenuItem = (e) => (this.warnLegacyRibbonMethod("hideToolbarMenuItem", "hideRibbonMenuItem"), this.hideRibbonMenuItem(e)), this.setupRibbonMenu = (e) => (this.warnLegacyRibbonMethod(
|
|
730
743
|
"setupRibbonMenu",
|
|
731
744
|
"showRibbonMenu/hideRibbonMenu/setupRibbonMenuTab"
|
|
732
|
-
), typeof e == "boolean" ? e ? this.showRibbonMenu() : this.hideRibbonMenu() : this.setupRibbonMenuTab(e.menu, { visible: e.visible })), this.setupRibbonMenuItem = (e, i, r) => (this.warnLegacyRibbonMethod("setupRibbonMenuItem", "setupRibbonMenuItemState"), this.setupRibbonMenuItemState(e, { visible: i, config: r })), this.setupRibbonTitleBar = (e) => (this.warnLegacyRibbonMethod("setupRibbonTitleBar", "showRibbonTabs/hideRibbonTabs"), e ? this.showRibbonTabs() : this.hideRibbonTabs()), this.showRibbonMenu = () => this.adapter.showRibbonMenu(), this.hideRibbonMenu = () => this.adapter.hideRibbonMenu(), this.showRibbonMenuItem = (e, i) => (this.warnLegacyRibbonMethod("showRibbonMenuItem", "setupRibbonMenuItemState"), this.setupRibbonMenuItemState(e, { visible: !0, config: i })), this.hideRibbonMenuItem = (e, i) => (this.warnLegacyRibbonMethod("hideRibbonMenuItem", "setupRibbonMenuItemState"), this.setupRibbonMenuItemState(e, { visible: !1, config: i })), this.showRibbonTitleBar = () => (this.warnLegacyRibbonMethod("showRibbonTitleBar", "showRibbonTabs"), this.showRibbonTabs()), this.hideRibbonTitleBar = () => (this.warnLegacyRibbonMethod("hideRibbonTitleBar", "hideRibbonTabs"), this.hideRibbonTabs()), this.showRibbonTabs = () => this.adapter.showRibbonTabs(), this.hideRibbonTabs = () => this.adapter.hideRibbonTabs(), this.selectRibbonMenu = (e) => this.adapter.selectRibbonMenu(e), this.setupRibbonMenuTab = (e, i) => this.adapter.setupRibbonMenuTab(e, i), this.showRibbonMenuTab = (e) => this.adapter.showRibbonMenuTab(e), this.hideRibbonMenuTab = (e) => this.adapter.hideRibbonMenuTab(e), this.enableRibbonMenuTab = (e) => this.adapter.enableRibbonMenuTab(e), this.disableRibbonMenuTab = (e) => this.adapter.disableRibbonMenuTab(e), this.setupRibbonMenuItemState = (e, i) => this.adapter.setupRibbonMenuItemState(e, i), this.enableRibbonMenuItem = (e, i) => this.setupRibbonMenuItemState(e, { disabled: !1, config: i }), this.disableRibbonMenuItem = (e, i) => this.setupRibbonMenuItemState(e, { disabled: !0, config: i }), this.setRibbonMenuButtonStyle = (e, i) => this.adapter.setRibbonMenuButtonStyle(e, i), this.setWatermark = (e) => this.adapter.setWatermark(e), this.setCompactMode = (e) => this.adapter.setCompactMode(e), this.setRulerVisible = (e) => this.adapter.setRulerVisible(e), this.toggleSidebar = () => this.adapter.toggleSidebar(), this.enterBookViewMode = (e) => this.adapter.enterBookViewMode(e), this.exitBookViewMode = () => this.adapter.exitBookViewMode(), this.isBookViewActivated = () => this.adapter.isBookViewActivated(), this.requestFullScreen = () => this.adapter.requestFullScreen(), this.exitFullScreen = () => this.adapter.exitFullScreen(), this.invalidateView = () => this.adapter.invalidateView(), this.adapter = d("ui",
|
|
745
|
+
), typeof e == "boolean" ? e ? this.showRibbonMenu() : this.hideRibbonMenu() : this.setupRibbonMenuTab(e.menu, { visible: e.visible })), this.setupRibbonMenuItem = (e, i, r) => (this.warnLegacyRibbonMethod("setupRibbonMenuItem", "setupRibbonMenuItemState"), this.setupRibbonMenuItemState(e, { visible: i, config: r })), this.setupRibbonTitleBar = (e) => (this.warnLegacyRibbonMethod("setupRibbonTitleBar", "showRibbonTabs/hideRibbonTabs"), e ? this.showRibbonTabs() : this.hideRibbonTabs()), this.showRibbonMenu = () => this.adapter.showRibbonMenu(), this.hideRibbonMenu = () => this.adapter.hideRibbonMenu(), this.showRibbonMenuItem = (e, i) => (this.warnLegacyRibbonMethod("showRibbonMenuItem", "setupRibbonMenuItemState"), this.setupRibbonMenuItemState(e, { visible: !0, config: i })), this.hideRibbonMenuItem = (e, i) => (this.warnLegacyRibbonMethod("hideRibbonMenuItem", "setupRibbonMenuItemState"), this.setupRibbonMenuItemState(e, { visible: !1, config: i })), this.showRibbonTitleBar = () => (this.warnLegacyRibbonMethod("showRibbonTitleBar", "showRibbonTabs"), this.showRibbonTabs()), this.hideRibbonTitleBar = () => (this.warnLegacyRibbonMethod("hideRibbonTitleBar", "hideRibbonTabs"), this.hideRibbonTabs()), this.showRibbonTabs = () => this.adapter.showRibbonTabs(), this.hideRibbonTabs = () => this.adapter.hideRibbonTabs(), this.selectRibbonMenu = (e) => this.adapter.selectRibbonMenu(e), this.setupRibbonMenuTab = (e, i) => this.adapter.setupRibbonMenuTab(e, i), this.showRibbonMenuTab = (e) => this.adapter.showRibbonMenuTab(e), this.hideRibbonMenuTab = (e) => this.adapter.hideRibbonMenuTab(e), this.enableRibbonMenuTab = (e) => this.adapter.enableRibbonMenuTab(e), this.disableRibbonMenuTab = (e) => this.adapter.disableRibbonMenuTab(e), this.setupRibbonMenuItemState = (e, i) => this.adapter.setupRibbonMenuItemState(e, i), this.enableRibbonMenuItem = (e, i) => this.setupRibbonMenuItemState(e, { disabled: !1, config: i }), this.disableRibbonMenuItem = (e, i) => this.setupRibbonMenuItemState(e, { disabled: !0, config: i }), this.setRibbonMenuButtonStyle = (e, i) => this.adapter.setRibbonMenuButtonStyle(e, i), this.setWatermark = (e) => this.adapter.setWatermark(e), this.setCompactMode = (e) => this.adapter.setCompactMode(e), this.setRulerVisible = (e) => this.adapter.setRulerVisible(e), this.toggleSidebar = () => this.adapter.toggleSidebar(), this.enterBookViewMode = (e) => this.adapter.enterBookViewMode(e), this.exitBookViewMode = () => this.adapter.exitBookViewMode(), this.isBookViewActivated = () => this.adapter.isBookViewActivated(), this.requestFullScreen = () => this.adapter.requestFullScreen(), this.exitFullScreen = () => this.adapter.exitFullScreen(), this.invalidateView = () => this.adapter.invalidateView(), this.adapter = d("ui", Be(n), n);
|
|
733
746
|
}
|
|
734
747
|
warnLegacyRibbonMethod(n, e) {
|
|
735
748
|
console.warn(`[RHC Office SDK] ui.${n} is deprecated. Use ui.${e} instead.`);
|
|
736
749
|
}
|
|
737
750
|
}
|
|
738
|
-
const
|
|
751
|
+
const Ke = (t) => {
|
|
739
752
|
if (!t)
|
|
740
753
|
return;
|
|
741
754
|
const n = t.trim().toLowerCase();
|
|
@@ -743,68 +756,68 @@ const xe = (t) => {
|
|
|
743
756
|
return "auto";
|
|
744
757
|
if (n === "light" || n === "dark" || n === "high-contrast" || n === "auto")
|
|
745
758
|
return n;
|
|
746
|
-
},
|
|
759
|
+
}, q = (t) => {
|
|
747
760
|
const n = new URL(t, globalThis.location?.href ?? "http://localhost/");
|
|
748
761
|
return n.hash = "", n.pathname.endsWith("/") || (n.pathname = `${n.pathname}/`), n.toString();
|
|
749
|
-
}, Ve = (t) => new URL("editors.bootstrap.js", t).toString(),
|
|
750
|
-
const e =
|
|
762
|
+
}, Ve = (t) => new URL("editors.bootstrap.js", t).toString(), Ge = (t, n) => {
|
|
763
|
+
const e = q(t);
|
|
751
764
|
return {
|
|
752
765
|
...n,
|
|
753
766
|
appUrl: e,
|
|
754
|
-
theme:
|
|
767
|
+
theme: Ke(n.theme)
|
|
755
768
|
};
|
|
756
|
-
},
|
|
769
|
+
}, m = "rhc-office-editor", T = "__RHC_OFFICE_SDK_READER_LOADER__", H = () => {
|
|
757
770
|
const t = globalThis;
|
|
758
|
-
return t[
|
|
771
|
+
return t[T] || (t[T] = {
|
|
759
772
|
activeAppUrl: null,
|
|
760
773
|
loadPromises: /* @__PURE__ */ new Map()
|
|
761
|
-
}), t[
|
|
762
|
-
},
|
|
763
|
-
class
|
|
774
|
+
}), t[T];
|
|
775
|
+
}, qe = (t) => Array.from(document.querySelectorAll("script")).find((n) => n.src === t) ?? null;
|
|
776
|
+
class M extends Error {
|
|
764
777
|
constructor(n) {
|
|
765
778
|
super(`Failed to load reader bootstrap script: ${n}`), this.name = "ReaderScriptLoadError";
|
|
766
779
|
}
|
|
767
780
|
}
|
|
768
|
-
class
|
|
781
|
+
class He extends Error {
|
|
769
782
|
constructor(n, e) {
|
|
770
783
|
super(
|
|
771
|
-
`Reader Web Component "${
|
|
784
|
+
`Reader Web Component "${m}" is already bound to ${n} and cannot be reloaded from ${e}.`
|
|
772
785
|
), this.name = "ReaderSourceConflictError";
|
|
773
786
|
}
|
|
774
787
|
}
|
|
775
|
-
const
|
|
776
|
-
const n =
|
|
788
|
+
const z = (t) => {
|
|
789
|
+
const n = H();
|
|
777
790
|
if (n.activeAppUrl && n.activeAppUrl !== t)
|
|
778
|
-
throw new
|
|
779
|
-
},
|
|
780
|
-
const n =
|
|
781
|
-
|
|
791
|
+
throw new He(n.activeAppUrl, t);
|
|
792
|
+
}, ze = (t) => {
|
|
793
|
+
const n = H();
|
|
794
|
+
z(t);
|
|
782
795
|
const e = n.loadPromises.get(t);
|
|
783
796
|
if (e)
|
|
784
797
|
return e;
|
|
785
|
-
if (globalThis.customElements?.get(
|
|
798
|
+
if (globalThis.customElements?.get(m)) {
|
|
786
799
|
n.activeAppUrl = t;
|
|
787
800
|
const s = Promise.resolve();
|
|
788
801
|
return n.loadPromises.set(t, s), s;
|
|
789
802
|
}
|
|
790
|
-
const i = Ve(t), r =
|
|
803
|
+
const i = Ve(t), r = qe(i);
|
|
791
804
|
n.activeAppUrl = t;
|
|
792
805
|
const a = new Promise((s, o) => {
|
|
793
806
|
const u = (h) => {
|
|
794
|
-
h?.remove(), o(new
|
|
807
|
+
h?.remove(), o(new M(i));
|
|
795
808
|
}, c = () => {
|
|
796
|
-
globalThis.customElements.whenDefined(
|
|
809
|
+
globalThis.customElements.whenDefined(m).then(() => {
|
|
797
810
|
s();
|
|
798
811
|
}).catch(o);
|
|
799
812
|
};
|
|
800
813
|
if (r) {
|
|
801
|
-
if (globalThis.customElements?.get(
|
|
814
|
+
if (globalThis.customElements?.get(m)) {
|
|
802
815
|
s();
|
|
803
816
|
return;
|
|
804
817
|
}
|
|
805
818
|
r.addEventListener(
|
|
806
819
|
"error",
|
|
807
|
-
() => o(new
|
|
820
|
+
() => o(new M(i)),
|
|
808
821
|
{
|
|
809
822
|
once: !0
|
|
810
823
|
}
|
|
@@ -814,21 +827,21 @@ const H = (t) => {
|
|
|
814
827
|
const l = document.createElement("script");
|
|
815
828
|
l.src = i, l.async = !0, l.dataset.rhcOfficeSdkReader = t, l.addEventListener("load", c, { once: !0 }), l.addEventListener("error", () => u(l), { once: !0 }), document.head.appendChild(l);
|
|
816
829
|
}).catch((s) => {
|
|
817
|
-
throw n.loadPromises.delete(t), !globalThis.customElements?.get(
|
|
830
|
+
throw n.loadPromises.delete(t), !globalThis.customElements?.get(m) && n.activeAppUrl === t && (n.activeAppUrl = null), s;
|
|
818
831
|
});
|
|
819
832
|
return n.loadPromises.set(t, a), a;
|
|
820
|
-
},
|
|
833
|
+
}, Qe = 5e3, je = 5e3, Ye = () => {
|
|
821
834
|
const t = globalThis.crypto;
|
|
822
835
|
return typeof t?.randomUUID == "function" ? t.randomUUID() : `adapter-${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
823
|
-
},
|
|
824
|
-
class
|
|
836
|
+
}, b = () => globalThis[ue];
|
|
837
|
+
class We extends Error {
|
|
825
838
|
constructor(n, e, i) {
|
|
826
839
|
super(e), this.name = "ReaderBridgeError", this.code = n, this.details = i;
|
|
827
840
|
}
|
|
828
841
|
}
|
|
829
|
-
class
|
|
842
|
+
class $e {
|
|
830
843
|
constructor(n) {
|
|
831
|
-
this.readerId = null, this.readyTimeoutMs = n?.readyTimeoutMs ??
|
|
844
|
+
this.readerId = null, this.readyTimeoutMs = n?.readyTimeoutMs ?? je, this.requestTimeoutMs = n?.requestTimeoutMs ?? Qe;
|
|
832
845
|
}
|
|
833
846
|
configureTimeouts(n) {
|
|
834
847
|
this.readyTimeoutMs = n?.readyTimeoutMs ?? this.readyTimeoutMs, this.requestTimeoutMs = n?.requestTimeoutMs ?? this.requestTimeoutMs;
|
|
@@ -843,7 +856,7 @@ class je {
|
|
|
843
856
|
const a = await this.requestRaw(n, e, i, r);
|
|
844
857
|
if (a.ok)
|
|
845
858
|
return a.result;
|
|
846
|
-
throw new
|
|
859
|
+
throw new We(
|
|
847
860
|
a.error.code,
|
|
848
861
|
a.error.message,
|
|
849
862
|
a.error.details
|
|
@@ -870,9 +883,9 @@ class je {
|
|
|
870
883
|
}
|
|
871
884
|
};
|
|
872
885
|
const s = {
|
|
873
|
-
protocol:
|
|
874
|
-
version:
|
|
875
|
-
requestId:
|
|
886
|
+
protocol: oe,
|
|
887
|
+
version: de,
|
|
888
|
+
requestId: Ye(),
|
|
876
889
|
readerId: this.readerId,
|
|
877
890
|
tool: n,
|
|
878
891
|
method: e,
|
|
@@ -885,25 +898,25 @@ class je {
|
|
|
885
898
|
);
|
|
886
899
|
}
|
|
887
900
|
getCapabilities() {
|
|
888
|
-
return this.readerId ?
|
|
901
|
+
return this.readerId ? b()?.getCapabilities(this.readerId) ?? null : null;
|
|
889
902
|
}
|
|
890
903
|
async waitForReady(n) {
|
|
891
904
|
return this.readerId ? !!await this.waitForAdapter(this.readerId, n?.timeoutMs) : !1;
|
|
892
905
|
}
|
|
893
906
|
async waitForAdapter(n, e = this.readyTimeoutMs) {
|
|
894
|
-
const i =
|
|
907
|
+
const i = b();
|
|
895
908
|
return i?.getCapabilities(n) ? i : new Promise((r) => {
|
|
896
909
|
let a;
|
|
897
910
|
const s = () => {
|
|
898
|
-
a && clearTimeout(a), globalThis.removeEventListener(
|
|
911
|
+
a && clearTimeout(a), globalThis.removeEventListener(D, o);
|
|
899
912
|
}, o = (u) => {
|
|
900
913
|
if ((u instanceof CustomEvent ? u.detail : void 0)?.readerId !== n)
|
|
901
914
|
return;
|
|
902
|
-
const l =
|
|
915
|
+
const l = b();
|
|
903
916
|
s(), r(l ?? null);
|
|
904
917
|
};
|
|
905
|
-
globalThis.addEventListener(
|
|
906
|
-
s(), r(
|
|
918
|
+
globalThis.addEventListener(D, o), a = setTimeout(() => {
|
|
919
|
+
s(), r(b()?.getCapabilities(n) ? b() : null);
|
|
907
920
|
}, e);
|
|
908
921
|
});
|
|
909
922
|
}
|
|
@@ -934,7 +947,7 @@ class je {
|
|
|
934
947
|
});
|
|
935
948
|
}
|
|
936
949
|
}
|
|
937
|
-
const
|
|
950
|
+
const w = {
|
|
938
951
|
annotationEnabled: !1,
|
|
939
952
|
documentModified: !1,
|
|
940
953
|
documentOpened: !1,
|
|
@@ -943,12 +956,12 @@ const A = {
|
|
|
943
956
|
pageMode: 0,
|
|
944
957
|
zoomLevel: 100
|
|
945
958
|
};
|
|
946
|
-
class
|
|
959
|
+
class Xe {
|
|
947
960
|
constructor() {
|
|
948
|
-
this.state = { ...
|
|
961
|
+
this.state = { ...w };
|
|
949
962
|
}
|
|
950
963
|
reset() {
|
|
951
|
-
this.state = { ...
|
|
964
|
+
this.state = { ...w };
|
|
952
965
|
}
|
|
953
966
|
update(n) {
|
|
954
967
|
n && (this.state = {
|
|
@@ -972,18 +985,18 @@ class Ye {
|
|
|
972
985
|
};
|
|
973
986
|
}
|
|
974
987
|
}
|
|
975
|
-
const
|
|
976
|
-
if (!
|
|
988
|
+
const Je = (t) => typeof t == "object" && t !== null && !Array.isArray(t) ? t : void 0, Q = (t) => typeof t == "object" && t !== null && !Array.isArray(t), I = (t) => {
|
|
989
|
+
if (!Q(t))
|
|
977
990
|
return;
|
|
978
991
|
const n = {};
|
|
979
992
|
return typeof t.currentPage == "number" && (n.currentPage = t.currentPage), typeof t.documentType == "string" && (n.documentType = t.documentType), typeof t.totalPages == "number" ? n.totalPages = t.totalPages : typeof t.pageCount == "number" && (n.totalPages = t.pageCount), typeof t.zoomLevel == "number" && (n.zoomLevel = t.zoomLevel), Object.keys(n).length > 0 ? n : void 0;
|
|
980
|
-
},
|
|
981
|
-
if (!
|
|
993
|
+
}, Ze = (t) => {
|
|
994
|
+
if (!Q(t))
|
|
982
995
|
return {
|
|
983
996
|
success: !0,
|
|
984
997
|
status: "ok"
|
|
985
998
|
};
|
|
986
|
-
const n =
|
|
999
|
+
const n = I(t.state), e = I(t), i = typeof t.error == "string" ? t.error : void 0, r = typeof t.success == "boolean" ? t.success : !i, a = typeof t.status == "string" ? t.status : r ? "ok" : "error";
|
|
987
1000
|
return {
|
|
988
1001
|
success: r,
|
|
989
1002
|
status: a,
|
|
@@ -991,7 +1004,7 @@ const Xe = (t) => typeof t == "object" && t !== null && !Array.isArray(t) ? t :
|
|
|
991
1004
|
state: n ?? e
|
|
992
1005
|
};
|
|
993
1006
|
};
|
|
994
|
-
class
|
|
1007
|
+
class et {
|
|
995
1008
|
constructor() {
|
|
996
1009
|
this.annotationEvents = [], this.annotationPersist = [], this.annotationRetrieve = [], this.digitalAnnotationRetrieve = [], this.digitalSign = [], this.digitalSignatureParse = [], this.digitalSignatureRetrieve = [], this.documentClosed = [], this.documentOpened = [], this.documentSaved = [], this.pageChange = [], this.pageModeChange = [], this.signServerAuth = [];
|
|
997
1010
|
}
|
|
@@ -999,7 +1012,7 @@ class Ze {
|
|
|
999
1012
|
switch (n) {
|
|
1000
1013
|
case "documentOpened":
|
|
1001
1014
|
case "documentLoaded": {
|
|
1002
|
-
const i =
|
|
1015
|
+
const i = Ze(e);
|
|
1003
1016
|
this.documentOpened.forEach(
|
|
1004
1017
|
(r) => r(i.status ?? "ok", i.error ?? "", i)
|
|
1005
1018
|
);
|
|
@@ -1028,7 +1041,7 @@ class Ze {
|
|
|
1028
1041
|
this.annotationEvents.forEach(
|
|
1029
1042
|
(r) => r(
|
|
1030
1043
|
i.event ?? "annotationEvent",
|
|
1031
|
-
|
|
1044
|
+
Je(i.payload)
|
|
1032
1045
|
)
|
|
1033
1046
|
);
|
|
1034
1047
|
return;
|
|
@@ -1065,15 +1078,15 @@ class Ze {
|
|
|
1065
1078
|
}
|
|
1066
1079
|
}
|
|
1067
1080
|
}
|
|
1068
|
-
const
|
|
1081
|
+
const S = "__RHC_OFFICE_READER_RUNTIME__", tt = "__rhcOfficeReaderRuntimeConfig", nt = [
|
|
1069
1082
|
"documentLoaded",
|
|
1070
1083
|
"documentStateChange",
|
|
1071
1084
|
"documentError"
|
|
1072
|
-
],
|
|
1085
|
+
], it = "readerReady", rt = "readerUnload", v = "readerError", at = () => typeof globalThis.crypto?.randomUUID == "function" ? globalThis.crypto.randomUUID() : `rhc-reader-${Date.now()}-${Math.random().toString(36).slice(2)}`, _ = (t, n) => ({
|
|
1073
1086
|
appUrl: n?.appUrl ?? null,
|
|
1074
1087
|
configuration: n,
|
|
1075
1088
|
element: t
|
|
1076
|
-
}),
|
|
1089
|
+
}), st = (t) => {
|
|
1077
1090
|
if (typeof t == "string") {
|
|
1078
1091
|
const n = document.getElementById(t);
|
|
1079
1092
|
if (!n)
|
|
@@ -1085,52 +1098,52 @@ const et = [
|
|
|
1085
1098
|
if (!(t instanceof HTMLDivElement))
|
|
1086
1099
|
throw new Error("Reader container must be a div element.");
|
|
1087
1100
|
return t;
|
|
1088
|
-
},
|
|
1101
|
+
}, ot = () => {
|
|
1089
1102
|
const t = typeof globalThis.matchMedia == "function";
|
|
1090
1103
|
return (t ? globalThis.matchMedia("(prefers-contrast: more)").matches : !1) ? "high-contrast" : (t ? globalThis.matchMedia("(prefers-color-scheme: dark)").matches : !1) ? "dark" : "light";
|
|
1091
|
-
},
|
|
1104
|
+
}, O = (t, n) => {
|
|
1092
1105
|
const e = t;
|
|
1093
1106
|
if (typeof e.addEventListener == "function") {
|
|
1094
1107
|
e.addEventListener("change", n);
|
|
1095
1108
|
return;
|
|
1096
1109
|
}
|
|
1097
1110
|
typeof e.addListener == "function" && e.addListener(n);
|
|
1098
|
-
},
|
|
1111
|
+
}, L = (t, n) => {
|
|
1099
1112
|
const e = t;
|
|
1100
1113
|
if (typeof e.removeEventListener == "function") {
|
|
1101
1114
|
e.removeEventListener("change", n);
|
|
1102
1115
|
return;
|
|
1103
1116
|
}
|
|
1104
1117
|
typeof e.removeListener == "function" && e.removeListener(n);
|
|
1105
|
-
},
|
|
1118
|
+
}, dt = (t) => {
|
|
1106
1119
|
t.style.display || (t.style.display = "block"), t.style.width || (t.style.width = "100%"), t.style.height || (t.style.height = "100%");
|
|
1107
|
-
},
|
|
1120
|
+
}, F = (t, n) => {
|
|
1108
1121
|
const e = n;
|
|
1109
1122
|
if (!e)
|
|
1110
1123
|
return t.removeAttribute("theme"), null;
|
|
1111
1124
|
if (e !== "auto")
|
|
1112
1125
|
return t.setAttribute("theme", e), null;
|
|
1113
1126
|
const i = () => {
|
|
1114
|
-
t.setAttribute("theme",
|
|
1127
|
+
t.setAttribute("theme", ot());
|
|
1115
1128
|
};
|
|
1116
1129
|
if (i(), typeof globalThis.matchMedia != "function")
|
|
1117
1130
|
return null;
|
|
1118
1131
|
const r = globalThis.matchMedia("(prefers-color-scheme: dark)"), a = globalThis.matchMedia("(prefers-contrast: more)"), s = () => {
|
|
1119
1132
|
i();
|
|
1120
1133
|
};
|
|
1121
|
-
return
|
|
1122
|
-
|
|
1134
|
+
return O(r, s), O(a, s), () => {
|
|
1135
|
+
L(r, s), L(a, s);
|
|
1123
1136
|
};
|
|
1124
1137
|
};
|
|
1125
|
-
class
|
|
1138
|
+
class ut {
|
|
1126
1139
|
constructor(n) {
|
|
1127
|
-
this.bridge = new
|
|
1140
|
+
this.bridge = new $e(), this.callbacks = new et(), this.readerState = new Xe(), this.bridgeToolContext = {
|
|
1128
1141
|
bridge: this.bridge,
|
|
1129
1142
|
callbacks: this.callbacks,
|
|
1130
1143
|
debug: () => this.debugEnabled,
|
|
1131
1144
|
onAsyncError: (e) => this.reportAdapterError(e),
|
|
1132
1145
|
state: this.readerState
|
|
1133
|
-
}, this.documentTool = new
|
|
1146
|
+
}, this.documentTool = new ce(this.bridgeToolContext), this.uiTool = new xe(this.bridgeToolContext), this.pageTool = new Re(this.bridgeToolContext), this.pageArrangeTool = new ke(this.bridgeToolContext), this.findTool = new ge(this.bridgeToolContext), this.signServerTool = new _e(this.bridgeToolContext), this.digitalSignTool = new se(this.bridgeToolContext), this.symbologyTool = new Le(this.bridgeToolContext), this.annotationTool = new ne(this.bridgeToolContext), this.templateSignTool = new Ue(this.bridgeToolContext), this.pdfFormFiller = new ve(this.bridgeToolContext), this.networkingTool = new pe(this.bridgeToolContext), this.cryptoTool = new re(this.bridgeToolContext), this.securityTool = new we(this.bridgeToolContext), this.readyCallbacks = [], this.unloadCallbacks = [], this.debugEnabled = !1, this.isReady = !1, this.removed = !1, this.mountToken = 0, this.hostContainer = null, this.readerElement = null, this.readerId = null, this.normalizedConfiguration = null, this.runtimeRestoreState = null, this.nativeEventCleanupCallbacks = [], this.themeCleanup = null, this.enableDebug = (e) => {
|
|
1134
1147
|
this.debugEnabled = e;
|
|
1135
1148
|
}, this.changeLanguage = (e) => {
|
|
1136
1149
|
this.readerElement && this.readerElement.setAttribute("language", e);
|
|
@@ -1138,7 +1151,7 @@ class ot {
|
|
|
1138
1151
|
this.themeCleanup?.(), this.themeCleanup = null, this.normalizedConfiguration = this.normalizedConfiguration ? {
|
|
1139
1152
|
...this.normalizedConfiguration,
|
|
1140
1153
|
theme: e
|
|
1141
|
-
} : null, this.readerElement && (this.themeCleanup =
|
|
1154
|
+
} : null, this.readerElement && (this.themeCleanup = F(this.readerElement, e));
|
|
1142
1155
|
}, this.setSessionUser = (e) => {
|
|
1143
1156
|
this.sessionUser = e;
|
|
1144
1157
|
}, this.setSessionUserId = (e) => {
|
|
@@ -1162,24 +1175,24 @@ class ot {
|
|
|
1162
1175
|
}, this.setReaderEventListener = (e) => {
|
|
1163
1176
|
this.readerEventListener = e;
|
|
1164
1177
|
}, this.embedReader = (e, i, r) => {
|
|
1165
|
-
const a =
|
|
1166
|
-
|
|
1167
|
-
const o =
|
|
1178
|
+
const a = st(e), s = q(i);
|
|
1179
|
+
z(s);
|
|
1180
|
+
const o = Ge(s, r), u = this.mountToken + 1;
|
|
1168
1181
|
this.removeReader(), this.mountToken = u, this.removed = !1, this.hostContainer = a, this.normalizedConfiguration = o, this.mountReader(a, o, u);
|
|
1169
1182
|
}, this.removeReader = () => {
|
|
1170
1183
|
const e = !!(this.readerElement || this.hostContainer);
|
|
1171
|
-
if (this.mountToken += 1, this.cleanupNativeEventForwarders(), this.cleanupThemeBinding(), this.readerElement?.parentNode && this.readerElement.parentNode.removeChild(this.readerElement), this.readerElement = null, this.readerId = null, this.bridge.setReaderId(null), this.readerState.reset(), this.hostContainer = null, this.normalizedConfiguration = null, this.isReady = !1, this.removed = !0, !e)
|
|
1184
|
+
if (this.mountToken += 1, this.cleanupNativeEventForwarders(), this.cleanupThemeBinding(), this.restoreReaderRuntimeConfig(), this.readerElement?.parentNode && this.readerElement.parentNode.removeChild(this.readerElement), this.readerElement = null, this.readerId = null, this.bridge.setReaderId(null), this.readerState.reset(), this.hostContainer = null, this.normalizedConfiguration = null, this.isReady = !1, this.removed = !0, !e)
|
|
1172
1185
|
return;
|
|
1173
|
-
const i =
|
|
1174
|
-
this.emitReaderEvent(
|
|
1175
|
-
}, this.getDocumentTool = () => this.documentTool, this.getUITool = () => this.uiTool, this.getPageTool = () => this.pageTool, this.getPageArrangeTool = () => this.pageArrangeTool, this.getFindTool = () => this.findTool, this.getSignServerTool = () => this.signServerTool, this.getDigitalSignTool = () => this.digitalSignTool, this.getSymbologyTool = () => this.symbologyTool, this.getAnnotationTool = () => this.annotationTool, this.getTemplateSignTool = () => this.templateSignTool, this.getPdfFormFiller = () => this.pdfFormFiller, this.getNetworkingTool = () => this.networkingTool, this.getCryptoTool = () => this.cryptoTool, this.getSecurityTool = () => this.securityTool, this.createDigitalSignOptions = () => new
|
|
1186
|
+
const i = _(null, null);
|
|
1187
|
+
this.emitReaderEvent(rt, i), this.unloadCallbacks.forEach((r) => r());
|
|
1188
|
+
}, this.getDocumentTool = () => this.documentTool, this.getUITool = () => this.uiTool, this.getPageTool = () => this.pageTool, this.getPageArrangeTool = () => this.pageArrangeTool, this.getFindTool = () => this.findTool, this.getSignServerTool = () => this.signServerTool, this.getDigitalSignTool = () => this.digitalSignTool, this.getSymbologyTool = () => this.symbologyTool, this.getAnnotationTool = () => this.annotationTool, this.getTemplateSignTool = () => this.templateSignTool, this.getPdfFormFiller = () => this.pdfFormFiller, this.getNetworkingTool = () => this.networkingTool, this.getCryptoTool = () => this.cryptoTool, this.getSecurityTool = () => this.securityTool, this.createDigitalSignOptions = () => new Ae(), this.createKVField = (e, i, r) => new De(e, i, r), this.mountReader = async (e, i, r) => {
|
|
1176
1189
|
try {
|
|
1177
|
-
if (await
|
|
1190
|
+
if (await ze(i.appUrl), this.mountToken !== r)
|
|
1178
1191
|
return;
|
|
1179
|
-
const a = document.createElement(
|
|
1180
|
-
a.setAttribute(
|
|
1192
|
+
const a = document.createElement(m), s = at();
|
|
1193
|
+
a.setAttribute(G, s), this.readerId = s, this.bridge.setReaderId(s), dt(a), this.applyReaderRuntimeConfig(a, i);
|
|
1181
1194
|
const o = i.compactViewer === !0 && i.keepPCMenu !== !0;
|
|
1182
|
-
if (a.toggleAttribute("data-sdk-compact-mode", o), a.setAttribute("language", i.language ?? "zh_CN"), this.themeCleanup =
|
|
1195
|
+
if (a.toggleAttribute("data-sdk-compact-mode", o), a.setAttribute("language", i.language ?? "zh_CN"), this.themeCleanup = F(a, i.theme), this.bindNativeReaderEvents(a), e.replaceChildren(a), this.readerElement = a, await Promise.resolve(), this.mountToken !== r)
|
|
1183
1196
|
return;
|
|
1184
1197
|
const u = await this.bridge.waitForReady();
|
|
1185
1198
|
if (this.mountToken !== r)
|
|
@@ -1187,8 +1200,8 @@ class ot {
|
|
|
1187
1200
|
if (!u)
|
|
1188
1201
|
throw new Error("Editor adapter is not available.");
|
|
1189
1202
|
this.isReady = !0;
|
|
1190
|
-
const c =
|
|
1191
|
-
this.emitReaderEvent(
|
|
1203
|
+
const c = _(a, i);
|
|
1204
|
+
this.emitReaderEvent(it, c), this.readyCallbacks.forEach((l) => l());
|
|
1192
1205
|
} catch (a) {
|
|
1193
1206
|
if (this.mountToken !== r)
|
|
1194
1207
|
return;
|
|
@@ -1200,15 +1213,15 @@ class ot {
|
|
|
1200
1213
|
const a = r instanceof CustomEvent ? r.detail : null;
|
|
1201
1214
|
!a || a.readerId !== this.readerId || (this.readerState.update(a.statePatch), this.callbacks.emit(a.event, a.payload), this.emitReaderEvent(a.event, a.payload));
|
|
1202
1215
|
};
|
|
1203
|
-
e.addEventListener(
|
|
1216
|
+
e.addEventListener(A, i), this.nativeEventCleanupCallbacks.push(() => {
|
|
1204
1217
|
e.removeEventListener(
|
|
1205
|
-
|
|
1218
|
+
A,
|
|
1206
1219
|
i
|
|
1207
1220
|
);
|
|
1208
|
-
}),
|
|
1221
|
+
}), nt.forEach((r) => {
|
|
1209
1222
|
const a = (s) => {
|
|
1210
1223
|
const o = s instanceof CustomEvent ? s.detail : s;
|
|
1211
|
-
r === "documentLoaded" && this.readerState.setDocumentOpened(!0), this.emitReaderEvent(r, o), r === "documentError" && this.emitReaderEvent(
|
|
1224
|
+
r === "documentLoaded" && this.readerState.setDocumentOpened(!0), this.emitReaderEvent(r, o), r === "documentError" && this.emitReaderEvent(v, o);
|
|
1212
1225
|
};
|
|
1213
1226
|
e.addEventListener(r, a), this.nativeEventCleanupCallbacks.push(() => {
|
|
1214
1227
|
e.removeEventListener(r, a);
|
|
@@ -1221,41 +1234,63 @@ class ot {
|
|
|
1221
1234
|
}, this.emitReaderEvent = (e, i) => {
|
|
1222
1235
|
this.readerEventListener?.(e, i);
|
|
1223
1236
|
}, this.reportReaderError = (e) => {
|
|
1224
|
-
this.isReady = !1, this.debugEnabled && console.error("[RHC Office SDK] Reader mount failed", e), this.emitReaderEvent(
|
|
1237
|
+
this.isReady = !1, this.debugEnabled && console.error("[RHC Office SDK] Reader mount failed", e), this.emitReaderEvent(v, e);
|
|
1225
1238
|
}, this.reportAdapterError = (e) => {
|
|
1226
|
-
this.debugEnabled && console.error("[RHC Office SDK] Adapter command failed", e), this.emitReaderEvent(
|
|
1239
|
+
this.debugEnabled && console.error("[RHC Office SDK] Adapter command failed", e), this.emitReaderEvent(v, e);
|
|
1227
1240
|
}, this.bridge.configureTimeouts({
|
|
1228
1241
|
readyTimeoutMs: n?.readyTimeoutMs,
|
|
1229
1242
|
requestTimeoutMs: n?.requestTimeoutMs
|
|
1230
1243
|
});
|
|
1231
1244
|
}
|
|
1245
|
+
applyReaderRuntimeConfig(n, e) {
|
|
1246
|
+
this.restoreReaderRuntimeConfig();
|
|
1247
|
+
const i = {
|
|
1248
|
+
hostKind: "server",
|
|
1249
|
+
server: {
|
|
1250
|
+
baseUrl: e.appUrl
|
|
1251
|
+
}
|
|
1252
|
+
}, r = n;
|
|
1253
|
+
r[tt] = i;
|
|
1254
|
+
const a = globalThis, s = a[S];
|
|
1255
|
+
this.runtimeRestoreState = {
|
|
1256
|
+
hadPreviousRuntime: s !== void 0,
|
|
1257
|
+
...s !== void 0 ? { previousRuntime: s } : {}
|
|
1258
|
+
}, a[S] = i;
|
|
1259
|
+
}
|
|
1260
|
+
restoreReaderRuntimeConfig() {
|
|
1261
|
+
if (!this.runtimeRestoreState)
|
|
1262
|
+
return;
|
|
1263
|
+
const n = globalThis;
|
|
1264
|
+
this.runtimeRestoreState.hadPreviousRuntime ? n[S] = this.runtimeRestoreState.previousRuntime : Reflect.deleteProperty(n, S), this.runtimeRestoreState = null;
|
|
1265
|
+
}
|
|
1232
1266
|
}
|
|
1233
|
-
const
|
|
1267
|
+
const St = (t) => new ut(t);
|
|
1234
1268
|
export {
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1269
|
+
ne as AnnotationToolImpl,
|
|
1270
|
+
re as CryptoToolImpl,
|
|
1271
|
+
bt as DIGITAL_SIGN_DEFAULTS,
|
|
1272
|
+
Ae as DigitalSignOptions,
|
|
1273
|
+
se as DigitalSignToolImpl,
|
|
1274
|
+
ut as DocumentSDK,
|
|
1275
|
+
ce as DocumentToolImpl,
|
|
1276
|
+
ge as FindToolImpl,
|
|
1277
|
+
De as KVField,
|
|
1278
|
+
pe as NetworkingToolImpl,
|
|
1279
|
+
ke as PageArrangeToolImpl,
|
|
1280
|
+
Re as PageToolImpl,
|
|
1281
|
+
ve as PdfFormFillerImpl,
|
|
1282
|
+
we as SecurityToolImpl,
|
|
1283
|
+
_e as SignServerToolImpl,
|
|
1284
|
+
Le as SymbologyToolImpl,
|
|
1285
|
+
Ue as TemplateSignToolImpl,
|
|
1286
|
+
xe as UIToolImpl,
|
|
1287
|
+
Y as WatermarkDisplay,
|
|
1288
|
+
St as createNewDocumentSdk,
|
|
1289
|
+
lt as getDigitalSignEnvironment,
|
|
1290
|
+
ct as getDigitalSignEnvironmentSource,
|
|
1291
|
+
ht as initializeDigitalSignEnvironment,
|
|
1292
|
+
mt as patchDigitalSignEnvironment,
|
|
1293
|
+
pt as resetDigitalSignEnvironment,
|
|
1294
|
+
gt as setDigitalSignEnvironment
|
|
1260
1295
|
};
|
|
1261
1296
|
//# sourceMappingURL=index.js.map
|