@paprize/react 0.0.3 → 0.0.4
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/paprize-react.d.ts +5 -4
- package/dist/paprize-react.js +672 -1447
- package/dist/paprize-react.js.map +1 -0
- package/dist/paprize-react.umd.cjs +12 -5
- package/dist/paprize-react.umd.cjs.map +1 -0
- package/package.json +1 -2
package/dist/paprize-react.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { jsx as w, jsxs as X, Fragment as E } from "react/jsx-runtime";
|
|
2
|
+
import me, { useInsertionEffect as Oe, useRef as x, createElement as We, createContext as ie, useReducer as Ve, useEffect as D, useDebugValue as Ue, useCallback as je, useContext as $, Children as Je, isValidElement as qe, useMemo as L, useState as we, useId as Se } from "react";
|
|
3
|
+
import { paprize_isReady as Ge, getVisibleHeight as Z, logger as W, defaultPlugins as Ke, isDebugMode as be, Paginator as Ye, tempContainerClassName as Qe, pageBreakAttributeName as Xe, configToAttributeMap as Ze, paprize_readJsonDataFile as et } from "@paprize/core";
|
|
4
|
+
import { createPortal as tt } from "react-dom";
|
|
5
|
+
function re(e) {
|
|
6
|
+
Oe(() => {
|
|
6
7
|
const t = document.createElement("style");
|
|
7
8
|
return t.textContent = e, document.head.appendChild(t), () => t.remove();
|
|
8
9
|
}, [e]);
|
|
9
10
|
}
|
|
10
|
-
const
|
|
11
|
+
const B = "paprize-preview", nt = `
|
|
11
12
|
:root {
|
|
12
13
|
--paprize-page-background-color: #ffffff;
|
|
13
14
|
--paprize-page-margin-bottom: 10px;
|
|
@@ -22,7 +23,7 @@ const wt = `
|
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
@media screen {
|
|
25
|
-
|
|
26
|
+
.${B} {
|
|
26
27
|
min-height: 100vh;
|
|
27
28
|
display: flex;
|
|
28
29
|
flex-direction: column;
|
|
@@ -41,341 +42,347 @@ const wt = `
|
|
|
41
42
|
margin-bottom: var(--paprize-section-margin-bottom);
|
|
42
43
|
}
|
|
43
44
|
}
|
|
45
|
+
|
|
46
|
+
@media print {
|
|
47
|
+
html *:not(.${B}):not(.${B} *):not(:has(.${B})) {
|
|
48
|
+
display: none !important;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
44
51
|
`;
|
|
45
|
-
function
|
|
46
|
-
return
|
|
52
|
+
function on({ children: e }) {
|
|
53
|
+
return re(nt), /* @__PURE__ */ w("div", { className: B, children: e });
|
|
47
54
|
}
|
|
48
|
-
const
|
|
49
|
-
function
|
|
55
|
+
const z = {};
|
|
56
|
+
function ye(e, t) {
|
|
50
57
|
return e.unstable_is ? e.unstable_is(t) : t === e;
|
|
51
58
|
}
|
|
52
|
-
function
|
|
59
|
+
function Ae(e) {
|
|
53
60
|
return "init" in e;
|
|
54
61
|
}
|
|
55
|
-
function
|
|
62
|
+
function ee(e) {
|
|
56
63
|
return !!e.write;
|
|
57
64
|
}
|
|
58
|
-
function
|
|
65
|
+
function de(e) {
|
|
59
66
|
return "v" in e || "e" in e;
|
|
60
67
|
}
|
|
61
|
-
function
|
|
68
|
+
function U(e) {
|
|
62
69
|
if ("e" in e)
|
|
63
70
|
throw e.e;
|
|
64
|
-
if ((
|
|
71
|
+
if ((z ? "production" : void 0) !== "production" && !("v" in e))
|
|
65
72
|
throw new Error("[Bug] atom state is not initialized");
|
|
66
73
|
return e.v;
|
|
67
74
|
}
|
|
68
|
-
const
|
|
69
|
-
function
|
|
75
|
+
const j = /* @__PURE__ */ new WeakMap();
|
|
76
|
+
function Pe(e) {
|
|
70
77
|
var t;
|
|
71
|
-
return
|
|
72
|
-
}
|
|
73
|
-
function
|
|
74
|
-
const t =
|
|
75
|
-
t?.[0] && (t[0] = !1, t[1].forEach((
|
|
76
|
-
}
|
|
77
|
-
function
|
|
78
|
-
let
|
|
79
|
-
if (!
|
|
80
|
-
|
|
81
|
-
const
|
|
82
|
-
|
|
78
|
+
return J(e) && !!((t = j.get(e)) != null && t[0]);
|
|
79
|
+
}
|
|
80
|
+
function ot(e) {
|
|
81
|
+
const t = j.get(e);
|
|
82
|
+
t?.[0] && (t[0] = !1, t[1].forEach((o) => o()));
|
|
83
|
+
}
|
|
84
|
+
function te(e, t) {
|
|
85
|
+
let o = j.get(e);
|
|
86
|
+
if (!o) {
|
|
87
|
+
o = [!0, /* @__PURE__ */ new Set()], j.set(e, o);
|
|
88
|
+
const n = () => {
|
|
89
|
+
o[0] = !1;
|
|
83
90
|
};
|
|
84
|
-
e.then(
|
|
91
|
+
e.then(n, n);
|
|
85
92
|
}
|
|
86
|
-
|
|
93
|
+
o[1].add(t);
|
|
87
94
|
}
|
|
88
|
-
function
|
|
95
|
+
function J(e) {
|
|
89
96
|
return typeof e?.then == "function";
|
|
90
97
|
}
|
|
91
|
-
function
|
|
92
|
-
if (!
|
|
93
|
-
|
|
94
|
-
const
|
|
95
|
-
t.then(
|
|
98
|
+
function _e(e, t, o) {
|
|
99
|
+
if (!o.p.has(e)) {
|
|
100
|
+
o.p.add(e);
|
|
101
|
+
const n = () => o.p.delete(e);
|
|
102
|
+
t.then(n, n);
|
|
96
103
|
}
|
|
97
104
|
}
|
|
98
|
-
function
|
|
99
|
-
var
|
|
105
|
+
function ke(e, t, o) {
|
|
106
|
+
var n;
|
|
100
107
|
const i = /* @__PURE__ */ new Set();
|
|
101
|
-
for (const r of ((
|
|
102
|
-
|
|
108
|
+
for (const r of ((n = o.get(e)) == null ? void 0 : n.t) || [])
|
|
109
|
+
o.has(r) && i.add(r);
|
|
103
110
|
for (const r of t.p)
|
|
104
111
|
i.add(r);
|
|
105
112
|
return i;
|
|
106
113
|
}
|
|
107
|
-
const
|
|
108
|
-
var n;
|
|
109
|
-
return (n = t.unstable_onInit) == null ? void 0 : n.call(t, e);
|
|
110
|
-
}, Ct = (e, t, n) => {
|
|
114
|
+
const it = (e, t, ...o) => t.read(...o), rt = (e, t, ...o) => t.write(...o), st = (e, t) => {
|
|
111
115
|
var o;
|
|
112
|
-
return (o = t.
|
|
113
|
-
},
|
|
114
|
-
|
|
115
|
-
|
|
116
|
+
return (o = t.unstable_onInit) == null ? void 0 : o.call(t, e);
|
|
117
|
+
}, at = (e, t, o) => {
|
|
118
|
+
var n;
|
|
119
|
+
return (n = t.onMount) == null ? void 0 : n.call(t, o);
|
|
120
|
+
}, ct = (e, t) => {
|
|
121
|
+
const o = _(e), n = o[0], i = o[9];
|
|
122
|
+
if ((z ? "production" : void 0) !== "production" && !t)
|
|
116
123
|
throw new Error("Atom is undefined or null");
|
|
117
|
-
let r =
|
|
118
|
-
return r || (r = { d: /* @__PURE__ */ new Map(), p: /* @__PURE__ */ new Set(), n: 0 },
|
|
119
|
-
},
|
|
120
|
-
const t =
|
|
124
|
+
let r = n.get(t);
|
|
125
|
+
return r || (r = { d: /* @__PURE__ */ new Map(), p: /* @__PURE__ */ new Set(), n: 0 }, n.set(t, r), i?.(e, t)), r;
|
|
126
|
+
}, lt = (e) => {
|
|
127
|
+
const t = _(e), o = t[1], n = t[3], i = t[4], r = t[5], s = t[6], f = t[13], p = [], c = (a) => {
|
|
121
128
|
try {
|
|
122
|
-
|
|
129
|
+
a();
|
|
123
130
|
} catch (g) {
|
|
124
|
-
|
|
131
|
+
p.push(g);
|
|
125
132
|
}
|
|
126
133
|
};
|
|
127
134
|
do {
|
|
128
|
-
s.f &&
|
|
129
|
-
const
|
|
130
|
-
|
|
131
|
-
var
|
|
132
|
-
return (
|
|
133
|
-
}),
|
|
134
|
-
} while (
|
|
135
|
-
if (
|
|
136
|
-
throw new AggregateError(
|
|
137
|
-
},
|
|
138
|
-
const t =
|
|
135
|
+
s.f && c(s.f);
|
|
136
|
+
const a = /* @__PURE__ */ new Set(), g = a.add.bind(a);
|
|
137
|
+
n.forEach((h) => {
|
|
138
|
+
var v;
|
|
139
|
+
return (v = o.get(h)) == null ? void 0 : v.l.forEach(g);
|
|
140
|
+
}), n.clear(), r.forEach(g), r.clear(), i.forEach(g), i.clear(), a.forEach(c), n.size && f(e);
|
|
141
|
+
} while (n.size || r.size || i.size);
|
|
142
|
+
if (p.length)
|
|
143
|
+
throw new AggregateError(p);
|
|
144
|
+
}, ut = (e) => {
|
|
145
|
+
const t = _(e), o = t[1], n = t[2], i = t[3], r = t[11], s = t[14], f = t[17], p = [], c = /* @__PURE__ */ new WeakSet(), a = /* @__PURE__ */ new WeakSet(), g = Array.from(i);
|
|
139
146
|
for (; g.length; ) {
|
|
140
|
-
const
|
|
141
|
-
if (
|
|
147
|
+
const h = g[g.length - 1], v = r(e, h);
|
|
148
|
+
if (a.has(h)) {
|
|
142
149
|
g.pop();
|
|
143
150
|
continue;
|
|
144
151
|
}
|
|
145
|
-
if (
|
|
146
|
-
if (
|
|
147
|
-
|
|
148
|
-
else if ((
|
|
152
|
+
if (c.has(h)) {
|
|
153
|
+
if (n.get(h) === v.n)
|
|
154
|
+
p.push([h, v]);
|
|
155
|
+
else if ((z ? "production" : void 0) !== "production" && n.has(h))
|
|
149
156
|
throw new Error("[Bug] invalidated atom exists");
|
|
150
|
-
|
|
157
|
+
a.add(h), g.pop();
|
|
151
158
|
continue;
|
|
152
159
|
}
|
|
153
|
-
|
|
154
|
-
for (const
|
|
155
|
-
|
|
156
|
-
}
|
|
157
|
-
for (let
|
|
158
|
-
const [
|
|
159
|
-
let
|
|
160
|
-
for (const
|
|
161
|
-
if (
|
|
162
|
-
|
|
160
|
+
c.add(h);
|
|
161
|
+
for (const m of ke(h, v, o))
|
|
162
|
+
c.has(m) || g.push(m);
|
|
163
|
+
}
|
|
164
|
+
for (let h = p.length - 1; h >= 0; --h) {
|
|
165
|
+
const [v, m] = p[h];
|
|
166
|
+
let l = !1;
|
|
167
|
+
for (const d of m.d.keys())
|
|
168
|
+
if (d !== v && i.has(d)) {
|
|
169
|
+
l = !0;
|
|
163
170
|
break;
|
|
164
171
|
}
|
|
165
|
-
|
|
172
|
+
l && (s(e, v), f(e, v)), n.delete(v);
|
|
166
173
|
}
|
|
167
|
-
},
|
|
168
|
-
var
|
|
169
|
-
const
|
|
170
|
-
if (
|
|
171
|
-
([
|
|
174
|
+
}, dt = (e, t) => {
|
|
175
|
+
var o;
|
|
176
|
+
const n = _(e), i = n[1], r = n[2], s = n[3], f = n[6], p = n[7], c = n[11], a = n[12], g = n[13], h = n[14], v = n[16], m = n[17], l = c(e, t);
|
|
177
|
+
if (de(l) && (i.has(t) && r.get(t) !== l.n || Array.from(l.d).every(
|
|
178
|
+
([b, R]) => (
|
|
172
179
|
// Recursively, read the atom state of the dependency, and
|
|
173
180
|
// check if the atom epoch number is unchanged
|
|
174
|
-
|
|
181
|
+
h(e, b).n === R
|
|
175
182
|
)
|
|
176
183
|
)))
|
|
177
|
-
return
|
|
178
|
-
|
|
179
|
-
let
|
|
180
|
-
function
|
|
181
|
-
i.has(t) && (
|
|
182
|
-
}
|
|
183
|
-
function
|
|
184
|
-
var
|
|
185
|
-
if (
|
|
186
|
-
const
|
|
187
|
-
if (!
|
|
188
|
-
if (
|
|
189
|
-
|
|
184
|
+
return l;
|
|
185
|
+
l.d.clear();
|
|
186
|
+
let d = !0;
|
|
187
|
+
function u() {
|
|
188
|
+
i.has(t) && (m(e, t), g(e), a(e));
|
|
189
|
+
}
|
|
190
|
+
function y(b) {
|
|
191
|
+
var R;
|
|
192
|
+
if (ye(t, b)) {
|
|
193
|
+
const T = c(e, b);
|
|
194
|
+
if (!de(T))
|
|
195
|
+
if (Ae(b))
|
|
196
|
+
q(e, b, b.init);
|
|
190
197
|
else
|
|
191
198
|
throw new Error("no atom init");
|
|
192
|
-
return
|
|
199
|
+
return U(T);
|
|
193
200
|
}
|
|
194
|
-
const
|
|
201
|
+
const C = h(e, b);
|
|
195
202
|
try {
|
|
196
|
-
return
|
|
203
|
+
return U(C);
|
|
197
204
|
} finally {
|
|
198
|
-
|
|
205
|
+
l.d.set(b, C.n), Pe(l.v) && _e(t, l.v, C), (R = i.get(b)) == null || R.t.add(t), d || u();
|
|
199
206
|
}
|
|
200
207
|
}
|
|
201
|
-
let
|
|
202
|
-
const
|
|
208
|
+
let A, I;
|
|
209
|
+
const k = {
|
|
203
210
|
get signal() {
|
|
204
|
-
return
|
|
211
|
+
return A || (A = new AbortController()), A.signal;
|
|
205
212
|
},
|
|
206
213
|
get setSelf() {
|
|
207
|
-
return (
|
|
208
|
-
if ((
|
|
214
|
+
return (z ? "production" : void 0) !== "production" && !ee(t) && console.warn("setSelf function cannot be used with read-only atom"), !I && ee(t) && (I = (...b) => {
|
|
215
|
+
if ((z ? "production" : void 0) !== "production" && d && console.warn("setSelf function cannot be called in sync"), !d)
|
|
209
216
|
try {
|
|
210
|
-
return
|
|
217
|
+
return v(e, t, ...b);
|
|
211
218
|
} finally {
|
|
212
|
-
g(e),
|
|
219
|
+
g(e), a(e);
|
|
213
220
|
}
|
|
214
|
-
}),
|
|
221
|
+
}), I;
|
|
215
222
|
}
|
|
216
|
-
},
|
|
223
|
+
}, H = l.n;
|
|
217
224
|
try {
|
|
218
|
-
const
|
|
219
|
-
return
|
|
220
|
-
} catch (
|
|
221
|
-
return delete
|
|
225
|
+
const b = p(e, t, y, k);
|
|
226
|
+
return q(e, t, b), J(b) && (te(b, () => A?.abort()), b.then(u, u)), l;
|
|
227
|
+
} catch (b) {
|
|
228
|
+
return delete l.v, l.e = b, ++l.n, l;
|
|
222
229
|
} finally {
|
|
223
|
-
|
|
230
|
+
d = !1, H !== l.n && r.get(t) === H && (r.set(t, l.n), s.add(t), (o = f.c) == null || o.call(f, t));
|
|
224
231
|
}
|
|
225
|
-
},
|
|
226
|
-
const
|
|
232
|
+
}, ft = (e, t) => {
|
|
233
|
+
const o = _(e), n = o[1], i = o[2], r = o[11], s = [t];
|
|
227
234
|
for (; s.length; ) {
|
|
228
|
-
const
|
|
229
|
-
for (const
|
|
230
|
-
const
|
|
231
|
-
i.set(
|
|
235
|
+
const f = s.pop(), p = r(e, f);
|
|
236
|
+
for (const c of ke(f, p, n)) {
|
|
237
|
+
const a = r(e, c);
|
|
238
|
+
i.set(c, a.n), s.push(c);
|
|
232
239
|
}
|
|
233
240
|
}
|
|
234
|
-
},
|
|
235
|
-
const
|
|
236
|
-
let
|
|
237
|
-
const
|
|
238
|
-
var
|
|
239
|
-
const
|
|
241
|
+
}, Ie = (e, t, ...o) => {
|
|
242
|
+
const n = _(e), i = n[3], r = n[6], s = n[8], f = n[11], p = n[12], c = n[13], a = n[14], g = n[15], h = n[17];
|
|
243
|
+
let v = !0;
|
|
244
|
+
const m = (d) => U(a(e, d)), l = (d, ...u) => {
|
|
245
|
+
var y;
|
|
246
|
+
const A = f(e, d);
|
|
240
247
|
try {
|
|
241
|
-
if (
|
|
242
|
-
if (!
|
|
248
|
+
if (ye(t, d)) {
|
|
249
|
+
if (!Ae(d))
|
|
243
250
|
throw new Error("atom not writable");
|
|
244
|
-
const
|
|
245
|
-
|
|
251
|
+
const I = A.n, k = u[0];
|
|
252
|
+
q(e, d, k), h(e, d), I !== A.n && (i.add(d), (y = r.c) == null || y.call(r, d), g(e, d));
|
|
246
253
|
return;
|
|
247
254
|
} else
|
|
248
|
-
return
|
|
255
|
+
return Ie(e, d, ...u);
|
|
249
256
|
} finally {
|
|
250
|
-
|
|
257
|
+
v || (c(e), p(e));
|
|
251
258
|
}
|
|
252
259
|
};
|
|
253
260
|
try {
|
|
254
|
-
return s(e, t,
|
|
261
|
+
return s(e, t, m, l, ...o);
|
|
255
262
|
} finally {
|
|
256
|
-
|
|
263
|
+
v = !1;
|
|
257
264
|
}
|
|
258
|
-
},
|
|
259
|
-
var
|
|
260
|
-
const
|
|
261
|
-
if (
|
|
262
|
-
for (const [
|
|
263
|
-
if (!
|
|
264
|
-
const
|
|
265
|
-
|
|
265
|
+
}, gt = (e, t) => {
|
|
266
|
+
var o;
|
|
267
|
+
const n = _(e), i = n[1], r = n[3], s = n[6], f = n[11], p = n[15], c = n[18], a = n[19], g = f(e, t), h = i.get(t);
|
|
268
|
+
if (h && !Pe(g.v)) {
|
|
269
|
+
for (const [v, m] of g.d)
|
|
270
|
+
if (!h.d.has(v)) {
|
|
271
|
+
const l = f(e, v);
|
|
272
|
+
c(e, v).t.add(t), h.d.add(v), m !== l.n && (r.add(v), (o = s.c) == null || o.call(s, v), p(e, v));
|
|
266
273
|
}
|
|
267
|
-
for (const
|
|
268
|
-
if (!g.d.has(
|
|
269
|
-
|
|
270
|
-
const
|
|
271
|
-
|
|
274
|
+
for (const v of h.d || [])
|
|
275
|
+
if (!g.d.has(v)) {
|
|
276
|
+
h.d.delete(v);
|
|
277
|
+
const m = a(e, v);
|
|
278
|
+
m?.t.delete(t);
|
|
272
279
|
}
|
|
273
280
|
}
|
|
274
|
-
},
|
|
275
|
-
var
|
|
276
|
-
const
|
|
277
|
-
let
|
|
278
|
-
if (!
|
|
281
|
+
}, Le = (e, t) => {
|
|
282
|
+
var o;
|
|
283
|
+
const n = _(e), i = n[1], r = n[4], s = n[6], f = n[10], p = n[11], c = n[12], a = n[13], g = n[14], h = n[16], v = p(e, t);
|
|
284
|
+
let m = i.get(t);
|
|
285
|
+
if (!m) {
|
|
279
286
|
g(e, t);
|
|
280
|
-
for (const
|
|
281
|
-
|
|
282
|
-
if (
|
|
287
|
+
for (const l of v.d.keys())
|
|
288
|
+
Le(e, l).t.add(t);
|
|
289
|
+
if (m = {
|
|
283
290
|
l: /* @__PURE__ */ new Set(),
|
|
284
|
-
d: new Set(
|
|
291
|
+
d: new Set(v.d.keys()),
|
|
285
292
|
t: /* @__PURE__ */ new Set()
|
|
286
|
-
}, i.set(t,
|
|
287
|
-
const
|
|
288
|
-
let
|
|
289
|
-
const
|
|
293
|
+
}, i.set(t, m), (o = s.m) == null || o.call(s, t), ee(t)) {
|
|
294
|
+
const l = () => {
|
|
295
|
+
let d = !0;
|
|
296
|
+
const u = (...y) => {
|
|
290
297
|
try {
|
|
291
|
-
return
|
|
298
|
+
return h(e, t, ...y);
|
|
292
299
|
} finally {
|
|
293
|
-
|
|
300
|
+
d || (a(e), c(e));
|
|
294
301
|
}
|
|
295
302
|
};
|
|
296
303
|
try {
|
|
297
|
-
const
|
|
298
|
-
|
|
299
|
-
|
|
304
|
+
const y = f(e, t, u);
|
|
305
|
+
y && (m.u = () => {
|
|
306
|
+
d = !0;
|
|
300
307
|
try {
|
|
301
|
-
|
|
308
|
+
y();
|
|
302
309
|
} finally {
|
|
303
|
-
|
|
310
|
+
d = !1;
|
|
304
311
|
}
|
|
305
312
|
});
|
|
306
313
|
} finally {
|
|
307
|
-
|
|
314
|
+
d = !1;
|
|
308
315
|
}
|
|
309
316
|
};
|
|
310
|
-
r.add(
|
|
317
|
+
r.add(l);
|
|
311
318
|
}
|
|
312
319
|
}
|
|
313
|
-
return
|
|
314
|
-
},
|
|
315
|
-
var
|
|
316
|
-
const
|
|
317
|
-
let
|
|
318
|
-
if (
|
|
319
|
-
var
|
|
320
|
-
return (
|
|
320
|
+
return m;
|
|
321
|
+
}, pt = (e, t) => {
|
|
322
|
+
var o;
|
|
323
|
+
const n = _(e), i = n[1], r = n[5], s = n[6], f = n[11], p = n[19], c = f(e, t);
|
|
324
|
+
let a = i.get(t);
|
|
325
|
+
if (a && !a.l.size && !Array.from(a.t).some((g) => {
|
|
326
|
+
var h;
|
|
327
|
+
return (h = i.get(g)) == null ? void 0 : h.d.has(t);
|
|
321
328
|
})) {
|
|
322
|
-
|
|
323
|
-
for (const g of
|
|
324
|
-
const
|
|
325
|
-
|
|
329
|
+
a.u && r.add(a.u), a = void 0, i.delete(t), (o = s.u) == null || o.call(s, t);
|
|
330
|
+
for (const g of c.d.keys()) {
|
|
331
|
+
const h = p(e, g);
|
|
332
|
+
h?.t.delete(t);
|
|
326
333
|
}
|
|
327
334
|
return;
|
|
328
335
|
}
|
|
329
|
-
return
|
|
330
|
-
},
|
|
331
|
-
const
|
|
332
|
-
if (
|
|
333
|
-
for (const
|
|
334
|
-
|
|
336
|
+
return a;
|
|
337
|
+
}, q = (e, t, o) => {
|
|
338
|
+
const n = _(e)[11], i = n(e, t), r = "v" in i, s = i.v;
|
|
339
|
+
if (J(o))
|
|
340
|
+
for (const f of i.d.keys())
|
|
341
|
+
_e(
|
|
335
342
|
t,
|
|
336
|
-
|
|
337
|
-
|
|
343
|
+
o,
|
|
344
|
+
n(e, f)
|
|
338
345
|
);
|
|
339
|
-
i.v =
|
|
340
|
-
},
|
|
341
|
-
const
|
|
342
|
-
return
|
|
343
|
-
},
|
|
344
|
-
const
|
|
346
|
+
i.v = o, delete i.e, (!r || !Object.is(s, i.v)) && (++i.n, J(s) && ot(s));
|
|
347
|
+
}, ht = (e, t) => {
|
|
348
|
+
const o = _(e)[14];
|
|
349
|
+
return U(o(e, t));
|
|
350
|
+
}, vt = (e, t, ...o) => {
|
|
351
|
+
const n = _(e), i = n[12], r = n[13], s = n[16];
|
|
345
352
|
try {
|
|
346
|
-
return s(e, t, ...
|
|
353
|
+
return s(e, t, ...o);
|
|
347
354
|
} finally {
|
|
348
355
|
r(e), i(e);
|
|
349
356
|
}
|
|
350
|
-
},
|
|
351
|
-
const
|
|
352
|
-
return
|
|
353
|
-
|
|
357
|
+
}, mt = (e, t, o) => {
|
|
358
|
+
const n = _(e), i = n[12], r = n[18], s = n[19], p = r(e, t).l;
|
|
359
|
+
return p.add(o), i(e), () => {
|
|
360
|
+
p.delete(o), s(e, t), i(e);
|
|
354
361
|
};
|
|
355
|
-
},
|
|
356
|
-
function
|
|
357
|
-
const t =
|
|
358
|
-
if ((
|
|
362
|
+
}, Ce = /* @__PURE__ */ new WeakMap();
|
|
363
|
+
function _(e) {
|
|
364
|
+
const t = Ce.get(e);
|
|
365
|
+
if ((z ? "production" : void 0) !== "production" && !t)
|
|
359
366
|
throw new Error(
|
|
360
367
|
"Store must be created by buildStore to read its building blocks"
|
|
361
368
|
);
|
|
362
369
|
return t;
|
|
363
370
|
}
|
|
364
|
-
function
|
|
371
|
+
function wt(...e) {
|
|
365
372
|
const t = {
|
|
366
|
-
get(
|
|
367
|
-
const i =
|
|
368
|
-
return i(t,
|
|
373
|
+
get(n) {
|
|
374
|
+
const i = _(t)[21];
|
|
375
|
+
return i(t, n);
|
|
369
376
|
},
|
|
370
|
-
set(
|
|
371
|
-
const r =
|
|
372
|
-
return r(t,
|
|
377
|
+
set(n, ...i) {
|
|
378
|
+
const r = _(t)[22];
|
|
379
|
+
return r(t, n, ...i);
|
|
373
380
|
},
|
|
374
|
-
sub(
|
|
375
|
-
const r =
|
|
376
|
-
return r(t,
|
|
381
|
+
sub(n, i) {
|
|
382
|
+
const r = _(t)[23];
|
|
383
|
+
return r(t, n, i);
|
|
377
384
|
}
|
|
378
|
-
},
|
|
385
|
+
}, o = [
|
|
379
386
|
// store state
|
|
380
387
|
/* @__PURE__ */ new WeakMap(),
|
|
381
388
|
// atomStateMap
|
|
@@ -392,75 +399,75 @@ function Ot(...e) {
|
|
|
392
399
|
{},
|
|
393
400
|
// storeHooks
|
|
394
401
|
// atom interceptors
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
402
|
+
it,
|
|
403
|
+
rt,
|
|
404
|
+
st,
|
|
405
|
+
at,
|
|
399
406
|
// building-block functions
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
].map((
|
|
414
|
-
return
|
|
415
|
-
}
|
|
416
|
-
const
|
|
417
|
-
let
|
|
418
|
-
function
|
|
419
|
-
const
|
|
407
|
+
ct,
|
|
408
|
+
lt,
|
|
409
|
+
ut,
|
|
410
|
+
dt,
|
|
411
|
+
ft,
|
|
412
|
+
Ie,
|
|
413
|
+
gt,
|
|
414
|
+
Le,
|
|
415
|
+
pt,
|
|
416
|
+
q,
|
|
417
|
+
ht,
|
|
418
|
+
vt,
|
|
419
|
+
mt
|
|
420
|
+
].map((n, i) => e[i] || n);
|
|
421
|
+
return Ce.set(t, Object.freeze(o)), t;
|
|
422
|
+
}
|
|
423
|
+
const Ee = {};
|
|
424
|
+
let St = 0;
|
|
425
|
+
function N(e, t) {
|
|
426
|
+
const o = `atom${++St}`, n = {
|
|
420
427
|
toString() {
|
|
421
|
-
return (
|
|
428
|
+
return (Ee ? "production" : void 0) !== "production" && this.debugLabel ? o + ":" + this.debugLabel : o;
|
|
422
429
|
}
|
|
423
430
|
};
|
|
424
|
-
return typeof e == "function" ?
|
|
431
|
+
return typeof e == "function" ? n.read = e : (n.init = e, n.read = bt, n.write = yt), t && (n.write = t), n;
|
|
425
432
|
}
|
|
426
|
-
function
|
|
433
|
+
function bt(e) {
|
|
427
434
|
return e(this);
|
|
428
435
|
}
|
|
429
|
-
function
|
|
436
|
+
function yt(e, t, o) {
|
|
430
437
|
return t(
|
|
431
438
|
this,
|
|
432
|
-
typeof
|
|
439
|
+
typeof o == "function" ? o(e(this)) : o
|
|
433
440
|
);
|
|
434
441
|
}
|
|
435
|
-
function
|
|
436
|
-
return
|
|
442
|
+
function se() {
|
|
443
|
+
return wt();
|
|
437
444
|
}
|
|
438
|
-
let
|
|
439
|
-
function
|
|
440
|
-
return
|
|
445
|
+
let F;
|
|
446
|
+
function At() {
|
|
447
|
+
return F || (F = se(), (Ee ? "production" : void 0) !== "production" && (globalThis.__JOTAI_DEFAULT_STORE__ || (globalThis.__JOTAI_DEFAULT_STORE__ = F), globalThis.__JOTAI_DEFAULT_STORE__ !== F && console.warn(
|
|
441
448
|
"Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"
|
|
442
|
-
))),
|
|
449
|
+
))), F;
|
|
443
450
|
}
|
|
444
|
-
const
|
|
451
|
+
const Pt = {}, Re = ie(
|
|
445
452
|
void 0
|
|
446
453
|
);
|
|
447
|
-
function
|
|
448
|
-
return
|
|
454
|
+
function xe(e) {
|
|
455
|
+
return $(Re) || At();
|
|
449
456
|
}
|
|
450
|
-
function
|
|
457
|
+
function _t({
|
|
451
458
|
children: e,
|
|
452
459
|
store: t
|
|
453
460
|
}) {
|
|
454
|
-
const
|
|
455
|
-
return !t && !
|
|
456
|
-
|
|
461
|
+
const o = x(void 0);
|
|
462
|
+
return !t && !o.current && (o.current = se()), We(
|
|
463
|
+
Re.Provider,
|
|
457
464
|
{
|
|
458
|
-
value: t ||
|
|
465
|
+
value: t || o.current
|
|
459
466
|
},
|
|
460
467
|
e
|
|
461
468
|
);
|
|
462
469
|
}
|
|
463
|
-
const
|
|
470
|
+
const ne = (e) => typeof e?.then == "function", oe = (e) => {
|
|
464
471
|
e.status || (e.status = "pending", e.then(
|
|
465
472
|
(t) => {
|
|
466
473
|
e.status = "fulfilled", e.value = t;
|
|
@@ -469,100 +476,100 @@ const ge = (e) => typeof e?.then == "function", he = (e) => {
|
|
|
469
476
|
e.status = "rejected", e.reason = t;
|
|
470
477
|
}
|
|
471
478
|
));
|
|
472
|
-
},
|
|
479
|
+
}, kt = me.use || // A shim for older React versions
|
|
473
480
|
((e) => {
|
|
474
481
|
if (e.status === "pending")
|
|
475
482
|
throw e;
|
|
476
483
|
if (e.status === "fulfilled")
|
|
477
484
|
return e.value;
|
|
478
|
-
throw e.status === "rejected" ? e.reason : (
|
|
479
|
-
}),
|
|
480
|
-
let
|
|
481
|
-
return
|
|
485
|
+
throw e.status === "rejected" ? e.reason : (oe(e), e);
|
|
486
|
+
}), Y = /* @__PURE__ */ new WeakMap(), fe = (e, t) => {
|
|
487
|
+
let o = Y.get(e);
|
|
488
|
+
return o || (o = new Promise((n, i) => {
|
|
482
489
|
let r = e;
|
|
483
|
-
const s = (
|
|
484
|
-
r ===
|
|
485
|
-
},
|
|
486
|
-
r ===
|
|
487
|
-
},
|
|
490
|
+
const s = (c) => (a) => {
|
|
491
|
+
r === c && n(a);
|
|
492
|
+
}, f = (c) => (a) => {
|
|
493
|
+
r === c && i(a);
|
|
494
|
+
}, p = () => {
|
|
488
495
|
try {
|
|
489
|
-
const
|
|
490
|
-
|
|
491
|
-
} catch (
|
|
492
|
-
i(
|
|
496
|
+
const c = t();
|
|
497
|
+
ne(c) ? (Y.set(c, o), r = c, c.then(s(c), f(c)), te(c, p)) : n(c);
|
|
498
|
+
} catch (c) {
|
|
499
|
+
i(c);
|
|
493
500
|
}
|
|
494
501
|
};
|
|
495
|
-
e.then(s(e),
|
|
496
|
-
}),
|
|
502
|
+
e.then(s(e), f(e)), te(e, p);
|
|
503
|
+
}), Y.set(e, o)), o;
|
|
497
504
|
};
|
|
498
|
-
function
|
|
499
|
-
const { delay:
|
|
500
|
-
(
|
|
505
|
+
function G(e, t) {
|
|
506
|
+
const { delay: o, unstable_promiseStatus: n = !me.use } = {}, i = xe(), [[r, s, f], p] = Ve(
|
|
507
|
+
(a) => {
|
|
501
508
|
const g = i.get(e);
|
|
502
|
-
return Object.is(
|
|
509
|
+
return Object.is(a[0], g) && a[1] === i && a[2] === e ? a : [g, i, e];
|
|
503
510
|
},
|
|
504
511
|
void 0,
|
|
505
512
|
() => [i.get(e), i, e]
|
|
506
513
|
);
|
|
507
|
-
let
|
|
508
|
-
if ((s !== i ||
|
|
509
|
-
const
|
|
510
|
-
if (
|
|
514
|
+
let c = r;
|
|
515
|
+
if ((s !== i || f !== e) && (p(), c = i.get(e)), D(() => {
|
|
516
|
+
const a = i.sub(e, () => {
|
|
517
|
+
if (n)
|
|
511
518
|
try {
|
|
512
519
|
const g = i.get(e);
|
|
513
|
-
|
|
514
|
-
|
|
520
|
+
ne(g) && oe(
|
|
521
|
+
fe(g, () => i.get(e))
|
|
515
522
|
);
|
|
516
523
|
} catch {
|
|
517
524
|
}
|
|
518
|
-
if (typeof
|
|
519
|
-
setTimeout(
|
|
525
|
+
if (typeof o == "number") {
|
|
526
|
+
setTimeout(p, o);
|
|
520
527
|
return;
|
|
521
528
|
}
|
|
522
|
-
|
|
529
|
+
p();
|
|
523
530
|
});
|
|
524
|
-
return
|
|
525
|
-
}, [i, e,
|
|
526
|
-
const
|
|
527
|
-
return
|
|
531
|
+
return p(), a;
|
|
532
|
+
}, [i, e, o, n]), Ue(c), ne(c)) {
|
|
533
|
+
const a = fe(c, () => i.get(e));
|
|
534
|
+
return n && oe(a), kt(a);
|
|
528
535
|
}
|
|
529
|
-
return
|
|
536
|
+
return c;
|
|
530
537
|
}
|
|
531
|
-
function
|
|
532
|
-
const
|
|
533
|
-
return
|
|
538
|
+
function ae(e, t) {
|
|
539
|
+
const o = xe();
|
|
540
|
+
return je(
|
|
534
541
|
(...i) => {
|
|
535
|
-
if ((
|
|
542
|
+
if ((Pt ? "production" : void 0) !== "production" && !("write" in e))
|
|
536
543
|
throw new Error("not writable atom");
|
|
537
|
-
return
|
|
544
|
+
return o.set(e, ...i);
|
|
538
545
|
},
|
|
539
|
-
[
|
|
546
|
+
[o, e]
|
|
540
547
|
);
|
|
541
548
|
}
|
|
542
|
-
const
|
|
549
|
+
const It = se(), Lt = {
|
|
543
550
|
totalPages: 0,
|
|
544
551
|
isPaginated: !1,
|
|
545
552
|
pendingSuspensions: /* @__PURE__ */ new Set()
|
|
546
|
-
},
|
|
547
|
-
|
|
548
|
-
const
|
|
553
|
+
}, M = N(/* @__PURE__ */ new Map());
|
|
554
|
+
M.debugLabel = "sectionsAtom";
|
|
555
|
+
const ce = N({
|
|
549
556
|
totalSections: 0,
|
|
550
557
|
isPaginated: !1
|
|
551
558
|
});
|
|
552
|
-
|
|
553
|
-
function
|
|
554
|
-
const e =
|
|
555
|
-
return
|
|
556
|
-
const
|
|
559
|
+
ce.debugLabel = "reportAtom";
|
|
560
|
+
function Ct() {
|
|
561
|
+
const e = ae(ce), t = G(M);
|
|
562
|
+
return D(() => {
|
|
563
|
+
const o = t.size, n = Array.from(t.values()).every(
|
|
557
564
|
(i) => i.isPaginated
|
|
558
565
|
);
|
|
559
|
-
window[
|
|
560
|
-
isPaginated:
|
|
561
|
-
totalSections:
|
|
566
|
+
window[Ge] = n, e({
|
|
567
|
+
isPaginated: n && o > 0,
|
|
568
|
+
totalSections: o
|
|
562
569
|
});
|
|
563
570
|
}, [t, e]), null;
|
|
564
571
|
}
|
|
565
|
-
const
|
|
572
|
+
const Et = `
|
|
566
573
|
html {
|
|
567
574
|
box-sizing: border-box;
|
|
568
575
|
}
|
|
@@ -578,229 +585,229 @@ const qt = `
|
|
|
578
585
|
flex-direction: column;
|
|
579
586
|
}
|
|
580
587
|
`;
|
|
581
|
-
function
|
|
582
|
-
return
|
|
588
|
+
function rn({ children: e }) {
|
|
589
|
+
return re(Et), /* @__PURE__ */ X(_t, { store: It, children: [
|
|
583
590
|
e,
|
|
584
|
-
/* @__PURE__ */
|
|
591
|
+
/* @__PURE__ */ w(Ct, {})
|
|
585
592
|
] });
|
|
586
593
|
}
|
|
587
|
-
function
|
|
588
|
-
return /* @__PURE__ */
|
|
594
|
+
function ze({ children: e }) {
|
|
595
|
+
return /* @__PURE__ */ w(E, { children: e });
|
|
589
596
|
}
|
|
590
|
-
function
|
|
591
|
-
return /* @__PURE__ */
|
|
597
|
+
function Me({ children: e }) {
|
|
598
|
+
return /* @__PURE__ */ w(E, { children: e });
|
|
592
599
|
}
|
|
593
|
-
function
|
|
594
|
-
return /* @__PURE__ */
|
|
600
|
+
function Te({ children: e }) {
|
|
601
|
+
return /* @__PURE__ */ w(E, { children: e });
|
|
595
602
|
}
|
|
596
|
-
function
|
|
597
|
-
return /* @__PURE__ */
|
|
603
|
+
function Fe({ children: e }) {
|
|
604
|
+
return /* @__PURE__ */ w(E, { children: e });
|
|
598
605
|
}
|
|
599
|
-
function
|
|
600
|
-
return /* @__PURE__ */
|
|
606
|
+
function Be({ children: e }) {
|
|
607
|
+
return /* @__PURE__ */ w(E, { children: e });
|
|
601
608
|
}
|
|
602
|
-
function
|
|
603
|
-
return /* @__PURE__ */
|
|
609
|
+
function De({ children: e }) {
|
|
610
|
+
return /* @__PURE__ */ w(E, { children: e });
|
|
604
611
|
}
|
|
605
|
-
function
|
|
612
|
+
function Rt(e) {
|
|
606
613
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
607
614
|
}
|
|
608
|
-
var
|
|
609
|
-
function
|
|
610
|
-
return
|
|
611
|
-
(function(t,
|
|
612
|
-
e.exports ? e.exports =
|
|
613
|
-
})(
|
|
615
|
+
var V = { exports: {} }, xt = V.exports, ge;
|
|
616
|
+
function zt() {
|
|
617
|
+
return ge || (ge = 1, (function(e) {
|
|
618
|
+
(function(t, o) {
|
|
619
|
+
e.exports ? e.exports = o() : t.log = o();
|
|
620
|
+
})(xt, function() {
|
|
614
621
|
var t = function() {
|
|
615
|
-
},
|
|
622
|
+
}, o = "undefined", n = typeof window !== o && typeof window.navigator !== o && /Trident\/|MSIE /.test(window.navigator.userAgent), i = [
|
|
616
623
|
"trace",
|
|
617
624
|
"debug",
|
|
618
625
|
"info",
|
|
619
626
|
"warn",
|
|
620
627
|
"error"
|
|
621
628
|
], r = {}, s = null;
|
|
622
|
-
function
|
|
623
|
-
var
|
|
624
|
-
if (typeof
|
|
625
|
-
return
|
|
629
|
+
function f(l, d) {
|
|
630
|
+
var u = l[d];
|
|
631
|
+
if (typeof u.bind == "function")
|
|
632
|
+
return u.bind(l);
|
|
626
633
|
try {
|
|
627
|
-
return Function.prototype.bind.call(
|
|
634
|
+
return Function.prototype.bind.call(u, l);
|
|
628
635
|
} catch {
|
|
629
636
|
return function() {
|
|
630
|
-
return Function.prototype.apply.apply(
|
|
637
|
+
return Function.prototype.apply.apply(u, [l, arguments]);
|
|
631
638
|
};
|
|
632
639
|
}
|
|
633
640
|
}
|
|
634
|
-
function
|
|
641
|
+
function p() {
|
|
635
642
|
console.log && (console.log.apply ? console.log.apply(console, arguments) : Function.prototype.apply.apply(console.log, [console, arguments])), console.trace && console.trace();
|
|
636
643
|
}
|
|
637
|
-
function
|
|
638
|
-
return
|
|
644
|
+
function c(l) {
|
|
645
|
+
return l === "debug" && (l = "log"), typeof console === o ? !1 : l === "trace" && n ? p : console[l] !== void 0 ? f(console, l) : console.log !== void 0 ? f(console, "log") : t;
|
|
639
646
|
}
|
|
640
|
-
function
|
|
641
|
-
for (var
|
|
642
|
-
var
|
|
643
|
-
this[
|
|
647
|
+
function a() {
|
|
648
|
+
for (var l = this.getLevel(), d = 0; d < i.length; d++) {
|
|
649
|
+
var u = i[d];
|
|
650
|
+
this[u] = d < l ? t : this.methodFactory(u, l, this.name);
|
|
644
651
|
}
|
|
645
|
-
if (this.log = this.debug, typeof console ===
|
|
652
|
+
if (this.log = this.debug, typeof console === o && l < this.levels.SILENT)
|
|
646
653
|
return "No console available for logging";
|
|
647
654
|
}
|
|
648
|
-
function g(
|
|
655
|
+
function g(l) {
|
|
649
656
|
return function() {
|
|
650
|
-
typeof console !==
|
|
657
|
+
typeof console !== o && (a.call(this), this[l].apply(this, arguments));
|
|
651
658
|
};
|
|
652
659
|
}
|
|
653
|
-
function
|
|
654
|
-
return
|
|
660
|
+
function h(l, d, u) {
|
|
661
|
+
return c(l) || g.apply(this, arguments);
|
|
655
662
|
}
|
|
656
|
-
function
|
|
657
|
-
var
|
|
658
|
-
typeof
|
|
659
|
-
function
|
|
660
|
-
var
|
|
661
|
-
if (!(typeof window ===
|
|
663
|
+
function v(l, d) {
|
|
664
|
+
var u = this, y, A, I, k = "loglevel";
|
|
665
|
+
typeof l == "string" ? k += ":" + l : typeof l == "symbol" && (k = void 0);
|
|
666
|
+
function H(S) {
|
|
667
|
+
var P = (i[S] || "silent").toUpperCase();
|
|
668
|
+
if (!(typeof window === o || !k)) {
|
|
662
669
|
try {
|
|
663
|
-
window.localStorage[
|
|
670
|
+
window.localStorage[k] = P;
|
|
664
671
|
return;
|
|
665
672
|
} catch {
|
|
666
673
|
}
|
|
667
674
|
try {
|
|
668
|
-
window.document.cookie = encodeURIComponent(
|
|
675
|
+
window.document.cookie = encodeURIComponent(k) + "=" + P + ";";
|
|
669
676
|
} catch {
|
|
670
677
|
}
|
|
671
678
|
}
|
|
672
679
|
}
|
|
673
|
-
function
|
|
674
|
-
var
|
|
675
|
-
if (!(typeof window ===
|
|
680
|
+
function b() {
|
|
681
|
+
var S;
|
|
682
|
+
if (!(typeof window === o || !k)) {
|
|
676
683
|
try {
|
|
677
|
-
|
|
684
|
+
S = window.localStorage[k];
|
|
678
685
|
} catch {
|
|
679
686
|
}
|
|
680
|
-
if (typeof
|
|
687
|
+
if (typeof S === o)
|
|
681
688
|
try {
|
|
682
|
-
var
|
|
683
|
-
|
|
684
|
-
|
|
689
|
+
var P = window.document.cookie, O = encodeURIComponent(k), ue = P.indexOf(O + "=");
|
|
690
|
+
ue !== -1 && (S = /^([^;]+)/.exec(
|
|
691
|
+
P.slice(ue + O.length + 1)
|
|
685
692
|
)[1]);
|
|
686
693
|
} catch {
|
|
687
694
|
}
|
|
688
|
-
return
|
|
695
|
+
return u.levels[S] === void 0 && (S = void 0), S;
|
|
689
696
|
}
|
|
690
697
|
}
|
|
691
|
-
function
|
|
692
|
-
if (!(typeof window ===
|
|
698
|
+
function R() {
|
|
699
|
+
if (!(typeof window === o || !k)) {
|
|
693
700
|
try {
|
|
694
|
-
window.localStorage.removeItem(
|
|
701
|
+
window.localStorage.removeItem(k);
|
|
695
702
|
} catch {
|
|
696
703
|
}
|
|
697
704
|
try {
|
|
698
|
-
window.document.cookie = encodeURIComponent(
|
|
705
|
+
window.document.cookie = encodeURIComponent(k) + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC";
|
|
699
706
|
} catch {
|
|
700
707
|
}
|
|
701
708
|
}
|
|
702
709
|
}
|
|
703
|
-
function
|
|
704
|
-
var
|
|
705
|
-
if (typeof
|
|
706
|
-
return
|
|
707
|
-
throw new TypeError("log.setLevel() called with invalid level: " +
|
|
710
|
+
function C(S) {
|
|
711
|
+
var P = S;
|
|
712
|
+
if (typeof P == "string" && u.levels[P.toUpperCase()] !== void 0 && (P = u.levels[P.toUpperCase()]), typeof P == "number" && P >= 0 && P <= u.levels.SILENT)
|
|
713
|
+
return P;
|
|
714
|
+
throw new TypeError("log.setLevel() called with invalid level: " + S);
|
|
708
715
|
}
|
|
709
|
-
|
|
716
|
+
u.name = l, u.levels = {
|
|
710
717
|
TRACE: 0,
|
|
711
718
|
DEBUG: 1,
|
|
712
719
|
INFO: 2,
|
|
713
720
|
WARN: 3,
|
|
714
721
|
ERROR: 4,
|
|
715
722
|
SILENT: 5
|
|
716
|
-
},
|
|
717
|
-
return
|
|
718
|
-
},
|
|
719
|
-
return
|
|
720
|
-
},
|
|
721
|
-
|
|
722
|
-
},
|
|
723
|
-
|
|
724
|
-
},
|
|
725
|
-
|
|
726
|
-
},
|
|
727
|
-
|
|
728
|
-
},
|
|
729
|
-
if (s !==
|
|
730
|
-
for (var
|
|
731
|
-
r[
|
|
732
|
-
},
|
|
723
|
+
}, u.methodFactory = d || h, u.getLevel = function() {
|
|
724
|
+
return I ?? A ?? y;
|
|
725
|
+
}, u.setLevel = function(S, P) {
|
|
726
|
+
return I = C(S), P !== !1 && H(I), a.call(u);
|
|
727
|
+
}, u.setDefaultLevel = function(S) {
|
|
728
|
+
A = C(S), b() || u.setLevel(S, !1);
|
|
729
|
+
}, u.resetLevel = function() {
|
|
730
|
+
I = null, R(), a.call(u);
|
|
731
|
+
}, u.enableAll = function(S) {
|
|
732
|
+
u.setLevel(u.levels.TRACE, S);
|
|
733
|
+
}, u.disableAll = function(S) {
|
|
734
|
+
u.setLevel(u.levels.SILENT, S);
|
|
735
|
+
}, u.rebuild = function() {
|
|
736
|
+
if (s !== u && (y = C(s.getLevel())), a.call(u), s === u)
|
|
737
|
+
for (var S in r)
|
|
738
|
+
r[S].rebuild();
|
|
739
|
+
}, y = C(
|
|
733
740
|
s ? s.getLevel() : "WARN"
|
|
734
741
|
);
|
|
735
|
-
var
|
|
736
|
-
|
|
742
|
+
var T = b();
|
|
743
|
+
T != null && (I = C(T)), a.call(u);
|
|
737
744
|
}
|
|
738
|
-
s = new
|
|
739
|
-
if (typeof
|
|
745
|
+
s = new v(), s.getLogger = function(d) {
|
|
746
|
+
if (typeof d != "symbol" && typeof d != "string" || d === "")
|
|
740
747
|
throw new TypeError("You must supply a name when creating a logger.");
|
|
741
|
-
var
|
|
742
|
-
return
|
|
743
|
-
|
|
748
|
+
var u = r[d];
|
|
749
|
+
return u || (u = r[d] = new v(
|
|
750
|
+
d,
|
|
744
751
|
s.methodFactory
|
|
745
|
-
)),
|
|
752
|
+
)), u;
|
|
746
753
|
};
|
|
747
|
-
var
|
|
754
|
+
var m = typeof window !== o ? window.log : void 0;
|
|
748
755
|
return s.noConflict = function() {
|
|
749
|
-
return typeof window !==
|
|
756
|
+
return typeof window !== o && window.log === s && (window.log = m), s;
|
|
750
757
|
}, s.getLoggers = function() {
|
|
751
758
|
return r;
|
|
752
759
|
}, s.default = s, s;
|
|
753
760
|
});
|
|
754
|
-
})(
|
|
755
|
-
}
|
|
756
|
-
var
|
|
757
|
-
const
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
761
|
+
})(V)), V.exports;
|
|
762
|
+
}
|
|
763
|
+
var Mt = zt();
|
|
764
|
+
const Tt = /* @__PURE__ */ Rt(Mt), pe = [
|
|
765
|
+
ze,
|
|
766
|
+
Te,
|
|
767
|
+
Me,
|
|
768
|
+
De,
|
|
769
|
+
Be,
|
|
770
|
+
Fe
|
|
764
771
|
];
|
|
765
|
-
function
|
|
772
|
+
function Ft(e) {
|
|
766
773
|
let t = null;
|
|
767
|
-
const
|
|
768
|
-
if (
|
|
769
|
-
if (!
|
|
770
|
-
throw
|
|
771
|
-
const i =
|
|
774
|
+
const o = {};
|
|
775
|
+
if (Je.forEach(e, (n) => {
|
|
776
|
+
if (!qe(n))
|
|
777
|
+
throw Tt.error("Invalid React element found in children", { child: n }), new Error("Invalid React element found in children");
|
|
778
|
+
const i = pe.find((r) => r === n.type);
|
|
772
779
|
if (!i)
|
|
773
780
|
throw Error(
|
|
774
|
-
`Component "${
|
|
781
|
+
`Component "${n.type}" is not valid as a child for Section, Expected one of: ${pe.map((r) => r.name).join(",")}`
|
|
775
782
|
);
|
|
776
783
|
switch (i) {
|
|
777
|
-
case
|
|
778
|
-
|
|
784
|
+
case Be:
|
|
785
|
+
o.sectionHeader = n;
|
|
779
786
|
break;
|
|
780
|
-
case
|
|
781
|
-
|
|
787
|
+
case Fe:
|
|
788
|
+
o.sectionFooter = n;
|
|
782
789
|
break;
|
|
783
|
-
case
|
|
784
|
-
t =
|
|
790
|
+
case ze:
|
|
791
|
+
t = n;
|
|
785
792
|
break;
|
|
786
|
-
case
|
|
787
|
-
|
|
793
|
+
case Te:
|
|
794
|
+
o.header = n;
|
|
788
795
|
break;
|
|
789
|
-
case
|
|
790
|
-
|
|
796
|
+
case Me:
|
|
797
|
+
o.footer = n;
|
|
791
798
|
break;
|
|
792
|
-
case
|
|
793
|
-
|
|
799
|
+
case De:
|
|
800
|
+
o.overlay = n;
|
|
794
801
|
break;
|
|
795
802
|
}
|
|
796
803
|
}), !t)
|
|
797
804
|
throw Error("PageContent component is a required child for Section");
|
|
798
|
-
return { ...
|
|
805
|
+
return { ...o, content: t };
|
|
799
806
|
}
|
|
800
|
-
function
|
|
807
|
+
function Bt(e, t) {
|
|
801
808
|
return t === "landscape" ? { height: e.width, width: e.height } : e;
|
|
802
809
|
}
|
|
803
|
-
function
|
|
810
|
+
function Dt(e, t) {
|
|
804
811
|
return `@page section-${e} {
|
|
805
812
|
margin: none;
|
|
806
813
|
size:${t.width} ${t.height};
|
|
@@ -808,634 +815,40 @@ function nn(e, t) {
|
|
|
808
815
|
height:${t.height};
|
|
809
816
|
}`;
|
|
810
817
|
}
|
|
811
|
-
const
|
|
812
|
-
function it(e) {
|
|
813
|
-
return e.nodeType === Node.ELEMENT_NODE;
|
|
814
|
-
}
|
|
815
|
-
function rn(e) {
|
|
816
|
-
return e.nodeType === Node.TEXT_NODE;
|
|
817
|
-
}
|
|
818
|
-
function ie(e) {
|
|
819
|
-
const t = e.getBoundingClientRect(), n = getComputedStyle(e), o = parseFloat(n.marginTop) || 0, i = parseFloat(n.marginBottom) || 0;
|
|
820
|
-
return t.height + o + i;
|
|
821
|
-
}
|
|
822
|
-
function sn(e) {
|
|
823
|
-
e.style.visibility = "hidden", e.style.position = "absolute", e.style.left = "-9999px", e.style.top = "-9999px";
|
|
824
|
-
}
|
|
825
|
-
class $ {
|
|
826
|
-
name;
|
|
827
|
-
defaultValue;
|
|
828
|
-
_reader;
|
|
829
|
-
constructor(t, n, o) {
|
|
830
|
-
this.name = t, this._reader = n, this.defaultValue = o;
|
|
831
|
-
}
|
|
832
|
-
read(t) {
|
|
833
|
-
return this._reader(t);
|
|
834
|
-
}
|
|
835
|
-
static createStr(t, n) {
|
|
836
|
-
return new $(t, (o) => o, n);
|
|
837
|
-
}
|
|
838
|
-
static createBool(t, n) {
|
|
839
|
-
return new $(
|
|
840
|
-
t,
|
|
841
|
-
(o) => o === "true",
|
|
842
|
-
n
|
|
843
|
-
);
|
|
844
|
-
}
|
|
845
|
-
}
|
|
846
|
-
const re = {
|
|
847
|
-
hyphen: $.createStr("hyphen", "-"),
|
|
848
|
-
keepOnSamePage: $.createBool("keep-on-same-page", !1),
|
|
849
|
-
hyphenationEnabled: $.createBool(
|
|
850
|
-
"hyphenation-enabled",
|
|
851
|
-
!0
|
|
852
|
-
)
|
|
853
|
-
};
|
|
854
|
-
function an(e) {
|
|
855
|
-
const t = {};
|
|
856
|
-
for (const n in e) {
|
|
857
|
-
const o = e[n];
|
|
858
|
-
if (o !== void 0) {
|
|
859
|
-
const i = re[n];
|
|
860
|
-
t[`${ke}${i.name}`] = String(o);
|
|
861
|
-
}
|
|
862
|
-
}
|
|
863
|
-
return t;
|
|
864
|
-
}
|
|
865
|
-
const cn = Object.fromEntries(
|
|
866
|
-
Object.entries(re).map(([e, t]) => [
|
|
867
|
-
e,
|
|
868
|
-
t.defaultValue
|
|
869
|
-
])
|
|
870
|
-
), Le = /* @__PURE__ */ new WeakMap();
|
|
871
|
-
function rt(e) {
|
|
872
|
-
if (!e)
|
|
873
|
-
return {};
|
|
874
|
-
if (!(e instanceof Element))
|
|
875
|
-
return rt(e?.parentNode);
|
|
876
|
-
const t = {};
|
|
877
|
-
for (const i in re) {
|
|
878
|
-
const r = re[i], s = `${ke}${r.name}`, d = e.getAttribute(s);
|
|
879
|
-
d !== null && (t[i] = r.read(d));
|
|
880
|
-
}
|
|
881
|
-
const o = { ...e.parentNode ? Le.get(e.parentNode) : void 0, ...t };
|
|
882
|
-
return Le.set(e, o), o;
|
|
883
|
-
}
|
|
884
|
-
const st = {
|
|
885
|
-
id: "default",
|
|
886
|
-
plugins: [],
|
|
887
|
-
...cn
|
|
888
|
-
};
|
|
889
|
-
function ln(e, t) {
|
|
890
|
-
const n = rt(e);
|
|
891
|
-
return { ...st, ...t, ...n };
|
|
892
|
-
}
|
|
893
|
-
const N = F.getLogger(on);
|
|
894
|
-
N.setDefaultLevel("info");
|
|
895
|
-
const le = "\x1B[46mPLUGIN\x1B[0m";
|
|
896
|
-
function D(e, t, ...n) {
|
|
897
|
-
e.sort((o, i) => o.order - i.order).forEach((o) => {
|
|
898
|
-
const i = o[t];
|
|
899
|
-
if (i) {
|
|
900
|
-
N.debug(
|
|
901
|
-
le,
|
|
902
|
-
`executing plugin ${o.name}:${String(t)} ()`,
|
|
903
|
-
n
|
|
904
|
-
);
|
|
905
|
-
try {
|
|
906
|
-
i(...n), N.debug(
|
|
907
|
-
le,
|
|
908
|
-
`plugin ${o.name}:${String(t)} executed`,
|
|
909
|
-
n
|
|
910
|
-
);
|
|
911
|
-
} catch (r) {
|
|
912
|
-
N.debug(
|
|
913
|
-
le,
|
|
914
|
-
`plugin ${o.name}:${String(t)} failed`,
|
|
915
|
-
r
|
|
916
|
-
);
|
|
917
|
-
}
|
|
918
|
-
}
|
|
919
|
-
});
|
|
920
|
-
}
|
|
921
|
-
const W = {
|
|
922
|
-
Element: "element",
|
|
923
|
-
Text: "text"
|
|
924
|
-
};
|
|
925
|
-
class Ee {
|
|
926
|
-
_node;
|
|
927
|
-
_transaction;
|
|
928
|
-
type = W.Element;
|
|
929
|
-
config;
|
|
930
|
-
constructor(t, n, o) {
|
|
931
|
-
this._node = t, this._transaction = n, this.config = o;
|
|
932
|
-
}
|
|
933
|
-
appendChild(t) {
|
|
934
|
-
this._transaction.isActive && this._transaction.addRollbackCallback(() => {
|
|
935
|
-
this._node.removeChild(t.getNode());
|
|
936
|
-
}), this._node.appendChild(t.getNode());
|
|
937
|
-
}
|
|
938
|
-
clone(t) {
|
|
939
|
-
const n = this._node.cloneNode(t), o = new Ee(
|
|
940
|
-
n,
|
|
941
|
-
this._transaction,
|
|
942
|
-
this.config
|
|
943
|
-
);
|
|
944
|
-
return D(
|
|
945
|
-
this.config.plugins,
|
|
946
|
-
"onClone",
|
|
947
|
-
this.config.id,
|
|
948
|
-
this._node,
|
|
949
|
-
o
|
|
950
|
-
), o;
|
|
951
|
-
}
|
|
952
|
-
getHeight() {
|
|
953
|
-
return ie(this._node);
|
|
954
|
-
}
|
|
955
|
-
remove() {
|
|
956
|
-
this._transaction.addCommitCallback(() => {
|
|
957
|
-
this._node.remove();
|
|
958
|
-
});
|
|
959
|
-
}
|
|
960
|
-
isEmpty() {
|
|
961
|
-
return this._node.innerHTML === "";
|
|
962
|
-
}
|
|
963
|
-
getChildrenCount() {
|
|
964
|
-
return this._node.childNodes.length;
|
|
965
|
-
}
|
|
966
|
-
getNode() {
|
|
967
|
-
return this._node;
|
|
968
|
-
}
|
|
969
|
-
}
|
|
970
|
-
class un {
|
|
971
|
-
_node;
|
|
972
|
-
_transaction;
|
|
973
|
-
type = W.Text;
|
|
974
|
-
config;
|
|
975
|
-
constructor(t, n, o) {
|
|
976
|
-
this._node = t, this._transaction = n, this.config = o;
|
|
977
|
-
}
|
|
978
|
-
get textContent() {
|
|
979
|
-
return this._node.textContent ?? "";
|
|
980
|
-
}
|
|
981
|
-
set textContent(t) {
|
|
982
|
-
this._node.textContent = t;
|
|
983
|
-
}
|
|
984
|
-
remove() {
|
|
985
|
-
this._transaction.addCommitCallback(() => {
|
|
986
|
-
this._node.remove();
|
|
987
|
-
});
|
|
988
|
-
}
|
|
989
|
-
getNode() {
|
|
990
|
-
return this._node;
|
|
991
|
-
}
|
|
992
|
-
}
|
|
993
|
-
function me(e, t, n) {
|
|
994
|
-
if (rn(e))
|
|
995
|
-
return new un(e, t, n);
|
|
996
|
-
if (it(e))
|
|
997
|
-
return new Ee(e, t, n);
|
|
998
|
-
throw new Error("Unsupported node type");
|
|
999
|
-
}
|
|
1000
|
-
const J = "\x1B[106mDOM\x1B[0m";
|
|
1001
|
-
class dn {
|
|
1002
|
-
_transaction;
|
|
1003
|
-
_treeWalker;
|
|
1004
|
-
_config;
|
|
1005
|
-
_completed = !1;
|
|
1006
|
-
_currentNode = null;
|
|
1007
|
-
_previousNode = null;
|
|
1008
|
-
constructor(t, n, o) {
|
|
1009
|
-
this._transaction = n, this._config = o, this._treeWalker = document.createTreeWalker(
|
|
1010
|
-
t,
|
|
1011
|
-
NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_TEXT
|
|
1012
|
-
);
|
|
1013
|
-
}
|
|
1014
|
-
get completed() {
|
|
1015
|
-
return this._completed;
|
|
1016
|
-
}
|
|
1017
|
-
get currentNode() {
|
|
1018
|
-
return this._currentNode;
|
|
1019
|
-
}
|
|
1020
|
-
get previousNode() {
|
|
1021
|
-
return this._previousNode;
|
|
1022
|
-
}
|
|
1023
|
-
nextNode() {
|
|
1024
|
-
this._treeWalker.nextNode() || (this._completed = !0), N.debug(J, "moving to next node"), this.setState();
|
|
1025
|
-
}
|
|
1026
|
-
nextSiblingOrParentSibling() {
|
|
1027
|
-
let t = 0;
|
|
1028
|
-
if (this._treeWalker.nextSibling())
|
|
1029
|
-
return N.debug(J, "moving to next sibling node"), this.setState(), { parentsTraversed: t };
|
|
1030
|
-
for (; this._treeWalker.parentNode(); )
|
|
1031
|
-
if (t++, this._treeWalker.nextSibling())
|
|
1032
|
-
return N.debug(
|
|
1033
|
-
J,
|
|
1034
|
-
"moving to parent sibling node, traversed:",
|
|
1035
|
-
t
|
|
1036
|
-
), this.setState(), { parentsTraversed: t };
|
|
1037
|
-
return this._completed = !0, { parentsTraversed: t };
|
|
1038
|
-
}
|
|
1039
|
-
firstChildOrNextNode() {
|
|
1040
|
-
return this._treeWalker.firstChild() ? (N.debug(J, "moving to first child node"), this.setState(), { parentsTraversed: 1 }) : (this.nextNode(), { parentsTraversed: 0 });
|
|
1041
|
-
}
|
|
1042
|
-
setState() {
|
|
1043
|
-
this._previousNode = this._currentNode, this._currentNode = me(
|
|
1044
|
-
this._treeWalker.currentNode,
|
|
1045
|
-
this._transaction,
|
|
1046
|
-
ln(this._treeWalker.currentNode, this._config)
|
|
1047
|
-
), this.currentNode, this.previousNode, N.debug(J, "moved to node", {
|
|
1048
|
-
currentNode: this.currentNode,
|
|
1049
|
-
previousNode: this.previousNode
|
|
1050
|
-
});
|
|
1051
|
-
}
|
|
1052
|
-
}
|
|
1053
|
-
class pn {
|
|
1054
|
-
_onRollback;
|
|
1055
|
-
_onCommit;
|
|
1056
|
-
isActive;
|
|
1057
|
-
constructor() {
|
|
1058
|
-
this._onRollback = [], this._onCommit = [], this.isActive = !1;
|
|
1059
|
-
}
|
|
1060
|
-
start = () => {
|
|
1061
|
-
if (this.isActive)
|
|
1062
|
-
throw new Error("Transaction already in progress");
|
|
1063
|
-
this.isActive = !0, this._onRollback = [], this._onCommit = [];
|
|
1064
|
-
};
|
|
1065
|
-
addRollbackCallback = (t) => {
|
|
1066
|
-
this._onRollback.push(t);
|
|
1067
|
-
};
|
|
1068
|
-
addCommitCallback = (t) => {
|
|
1069
|
-
if (!this.isActive) {
|
|
1070
|
-
t();
|
|
1071
|
-
return;
|
|
1072
|
-
}
|
|
1073
|
-
this._onCommit.push(t);
|
|
1074
|
-
};
|
|
1075
|
-
rollback = () => {
|
|
1076
|
-
this.isActive && (this.isActive = !1, this._onRollback.forEach((t) => t()));
|
|
1077
|
-
};
|
|
1078
|
-
commit = () => {
|
|
1079
|
-
this.isActive && (this.isActive = !1, this._onCommit.forEach((t) => t()));
|
|
1080
|
-
};
|
|
1081
|
-
}
|
|
1082
|
-
const Ie = "\x1B[102mPAGE\x1B[0m";
|
|
1083
|
-
class q {
|
|
1084
|
-
currentPage;
|
|
1085
|
-
activeElement;
|
|
1086
|
-
currentElement;
|
|
1087
|
-
parentStack;
|
|
1088
|
-
pageIsFull;
|
|
1089
|
-
pageIndex;
|
|
1090
|
-
pageHeight;
|
|
1091
|
-
constructor(t, n, o, i, r, s, d) {
|
|
1092
|
-
this.currentPage = t, this.activeElement = n, this.currentElement = o, this.parentStack = i, this.pageIsFull = r, this.pageIndex = s, this.pageHeight = d;
|
|
1093
|
-
}
|
|
1094
|
-
static create(t, n, o, i) {
|
|
1095
|
-
return new q(
|
|
1096
|
-
t,
|
|
1097
|
-
null,
|
|
1098
|
-
t,
|
|
1099
|
-
n,
|
|
1100
|
-
!1,
|
|
1101
|
-
o,
|
|
1102
|
-
i
|
|
1103
|
-
);
|
|
1104
|
-
}
|
|
1105
|
-
clone = () => new q(
|
|
1106
|
-
this.currentPage,
|
|
1107
|
-
this.activeElement,
|
|
1108
|
-
this.currentElement,
|
|
1109
|
-
[...this.parentStack],
|
|
1110
|
-
this.pageIsFull,
|
|
1111
|
-
this.pageIndex,
|
|
1112
|
-
this.pageHeight
|
|
1113
|
-
);
|
|
1114
|
-
}
|
|
1115
|
-
class Ce {
|
|
1116
|
-
_pageState;
|
|
1117
|
-
_transaction;
|
|
1118
|
-
_tempContainer;
|
|
1119
|
-
_config;
|
|
1120
|
-
constructor(t, n, o, i) {
|
|
1121
|
-
this._tempContainer = t, this._config = i, this._transaction = o;
|
|
1122
|
-
const r = Ce.createPageHtmlElement(
|
|
1123
|
-
n.width
|
|
1124
|
-
), s = this.createNewPage(r);
|
|
1125
|
-
this._pageState = q.create(s, [], 0, n.height), D(this._config.plugins, "onNewPage", i.id, this);
|
|
1126
|
-
}
|
|
1127
|
-
nextPage() {
|
|
1128
|
-
const t = this.createNewPage(
|
|
1129
|
-
this._pageState.currentPage.getNode().cloneNode(!1)
|
|
1130
|
-
), n = q.create(
|
|
1131
|
-
t,
|
|
1132
|
-
[],
|
|
1133
|
-
this._pageState.pageIndex + 1,
|
|
1134
|
-
this._pageState.pageHeight
|
|
1135
|
-
);
|
|
1136
|
-
this.cloneParentStackToNewPage(n), this.cleanupEmptyParent(), this._pageState = n, D(
|
|
1137
|
-
this._config.plugins,
|
|
1138
|
-
"onNewPage",
|
|
1139
|
-
this._config.id,
|
|
1140
|
-
this
|
|
1141
|
-
);
|
|
1142
|
-
}
|
|
1143
|
-
cloneParentStackToNewPage(t) {
|
|
1144
|
-
for (const n of this._pageState.parentStack) {
|
|
1145
|
-
const o = n.clone(!1);
|
|
1146
|
-
t.currentElement.appendChild(o), t.currentElement = o, t.parentStack.push(o);
|
|
1147
|
-
}
|
|
1148
|
-
}
|
|
1149
|
-
cleanupEmptyParent() {
|
|
1150
|
-
const t = [...this._pageState.parentStack], n = () => {
|
|
1151
|
-
for (let o = t.length - 1; o >= 0; o--) {
|
|
1152
|
-
const i = t[o];
|
|
1153
|
-
i.isEmpty() && i.remove();
|
|
1154
|
-
}
|
|
1155
|
-
};
|
|
1156
|
-
this._transaction.addCommitCallback(n);
|
|
1157
|
-
}
|
|
1158
|
-
enterElement() {
|
|
1159
|
-
if (!this._pageState.activeElement || this._pageState.activeElement.type !== W.Element)
|
|
1160
|
-
throw new Error("Invalid state: activeElement is not an Element");
|
|
1161
|
-
N.debug(
|
|
1162
|
-
Ie,
|
|
1163
|
-
"entering an element",
|
|
1164
|
-
this._pageState.activeElement
|
|
1165
|
-
), this._pageState.currentElement = this._pageState.activeElement, this._pageState.parentStack.push(this._pageState.activeElement);
|
|
1166
|
-
}
|
|
1167
|
-
leaveElement() {
|
|
1168
|
-
this._pageState.activeElement = null;
|
|
1169
|
-
const t = this._pageState.parentStack.pop();
|
|
1170
|
-
N.debug(Ie, "leaving a parent element", t);
|
|
1171
|
-
const n = this._pageState.parentStack.at(-1);
|
|
1172
|
-
this._pageState.currentElement = n ?? this._pageState.currentPage;
|
|
1173
|
-
}
|
|
1174
|
-
static createPageHtmlElement(t) {
|
|
1175
|
-
const n = document.createElement("div");
|
|
1176
|
-
return n.style.width = `${t}px`, n.style.maxWidth = `${t}px`, n;
|
|
1177
|
-
}
|
|
1178
|
-
createNewPage(t) {
|
|
1179
|
-
return this._tempContainer.appendChild(t), this._transaction.isActive && this._transaction.addRollbackCallback(() => {
|
|
1180
|
-
this._tempContainer.removeChild(t);
|
|
1181
|
-
}), me(t, this._transaction, this._config);
|
|
1182
|
-
}
|
|
1183
|
-
startTransaction() {
|
|
1184
|
-
this._transaction.start();
|
|
1185
|
-
const t = this._pageState.clone();
|
|
1186
|
-
return this._transaction.addRollbackCallback(() => {
|
|
1187
|
-
this._pageState = t;
|
|
1188
|
-
}), this._transaction;
|
|
1189
|
-
}
|
|
1190
|
-
hasEmptySpace(t) {
|
|
1191
|
-
return !this._pageState.pageIsFull && this._pageState.currentPage.getHeight() + (t || 1e-4) <= this._pageState.pageHeight;
|
|
1192
|
-
}
|
|
1193
|
-
isOverFlow() {
|
|
1194
|
-
return this._pageState.currentPage.getHeight() > this._pageState.pageHeight;
|
|
1195
|
-
}
|
|
1196
|
-
markPageAsFull() {
|
|
1197
|
-
this._pageState.pageIsFull = !0;
|
|
1198
|
-
}
|
|
1199
|
-
appendChild(t, n) {
|
|
1200
|
-
const o = t.clone(n);
|
|
1201
|
-
return this._pageState.currentElement.appendChild(o), this._pageState.activeElement = o, o;
|
|
1202
|
-
}
|
|
1203
|
-
addTextNode(t) {
|
|
1204
|
-
if (this._pageState.activeElement?.type === W.Text)
|
|
1205
|
-
return this._pageState.activeElement;
|
|
1206
|
-
const n = document.createTextNode(t), o = me(
|
|
1207
|
-
n,
|
|
1208
|
-
this._transaction,
|
|
1209
|
-
this._config
|
|
1210
|
-
);
|
|
1211
|
-
return this._pageState.currentElement.appendChild(o), this._pageState.activeElement = o, o;
|
|
1212
|
-
}
|
|
1213
|
-
getPageState() {
|
|
1214
|
-
return this._pageState;
|
|
1215
|
-
}
|
|
1216
|
-
}
|
|
1217
|
-
const x = {
|
|
1218
|
-
None: 0,
|
|
1219
|
-
// The node fits completely on the page, no further splitting required.
|
|
1220
|
-
FullNodePlaced: 1,
|
|
1221
|
-
// The entire node was placed on the page, continue with the next sibling or element.
|
|
1222
|
-
SplitChildren: 2
|
|
1223
|
-
// The node is too large for the page, and its children must be paginated individually.
|
|
1224
|
-
};
|
|
1225
|
-
function fn(e, t) {
|
|
1226
|
-
const n = Re(e, t);
|
|
1227
|
-
if (n !== x.None)
|
|
1228
|
-
return n;
|
|
1229
|
-
const { rollback: o, commit: i } = t.startTransaction();
|
|
1230
|
-
t.nextPage();
|
|
1231
|
-
const r = Re(e, t);
|
|
1232
|
-
return r !== x.None ? (i(), r) : (o(), N.debug("Element is too big to fit on a page", e), x.None);
|
|
1233
|
-
}
|
|
1234
|
-
function Re(e, t) {
|
|
1235
|
-
if (t.hasEmptySpace(e.getHeight())) {
|
|
1236
|
-
const o = t.appendChild(e, !0);
|
|
1237
|
-
if (t.isOverFlow())
|
|
1238
|
-
o.remove();
|
|
1239
|
-
else
|
|
1240
|
-
return x.FullNodePlaced;
|
|
1241
|
-
}
|
|
1242
|
-
if (e.config.keepOnSamePage || e.getChildrenCount() === 0)
|
|
1243
|
-
return x.None;
|
|
1244
|
-
const n = t.appendChild(e, !1);
|
|
1245
|
-
return t.isOverFlow() ? (n.remove(), x.None) : x.SplitChildren;
|
|
1246
|
-
}
|
|
1247
|
-
function gn(e, t) {
|
|
1248
|
-
let n = x.FullNodePlaced;
|
|
1249
|
-
const o = e.textContent.split(/(\s+)/).filter((s) => s !== "");
|
|
1250
|
-
let i, r = 0;
|
|
1251
|
-
for (; i || r < o.length; ) {
|
|
1252
|
-
const s = i ?? o[r], d = hn(s, t, e.config);
|
|
1253
|
-
d.completed || (n = x.None), d.pendingToken ? i = d.pendingToken : (i = void 0, r++);
|
|
1254
|
-
}
|
|
1255
|
-
return n;
|
|
1256
|
-
}
|
|
1257
|
-
function hn(e, t, n) {
|
|
1258
|
-
t.hasEmptySpace() || t.nextPage();
|
|
1259
|
-
let o = t.addTextNode("");
|
|
1260
|
-
const i = o.textContent;
|
|
1261
|
-
if (o.textContent += e, !t.isOverFlow())
|
|
1262
|
-
return {
|
|
1263
|
-
completed: !0
|
|
1264
|
-
};
|
|
1265
|
-
o.textContent = i;
|
|
1266
|
-
const r = mn(e, t, n);
|
|
1267
|
-
return {
|
|
1268
|
-
pendingToken: r.leftovers,
|
|
1269
|
-
completed: r.completed
|
|
1270
|
-
};
|
|
1271
|
-
}
|
|
1272
|
-
function mn(e, t, n) {
|
|
1273
|
-
const { rollback: o, commit: i } = t.startTransaction();
|
|
1274
|
-
if (t.nextPage(), t.addTextNode(e), !t.isOverFlow())
|
|
1275
|
-
return i(), {
|
|
1276
|
-
completed: !0
|
|
1277
|
-
};
|
|
1278
|
-
if (o(), !n.hyphenationEnabled)
|
|
1279
|
-
return N.warn("Hyphenation disabled, skipping oversized token:", e), {
|
|
1280
|
-
completed: !1
|
|
1281
|
-
};
|
|
1282
|
-
const r = vn(e, n.hyphen, t);
|
|
1283
|
-
return {
|
|
1284
|
-
completed: !0,
|
|
1285
|
-
leftovers: r && r.length > 0 ? r : void 0
|
|
1286
|
-
};
|
|
1287
|
-
}
|
|
1288
|
-
function vn(e, t, n) {
|
|
1289
|
-
const o = n.addTextNode("");
|
|
1290
|
-
let i = "";
|
|
1291
|
-
for (let r = 0; r < e.length; r++) {
|
|
1292
|
-
const s = e[r], d = i + s;
|
|
1293
|
-
if (o.textContent = d + t, !n.hasEmptySpace())
|
|
1294
|
-
return o.textContent = i ? i + t : "", n.markPageAsFull(), e.slice(r);
|
|
1295
|
-
i = d;
|
|
1296
|
-
}
|
|
1297
|
-
return null;
|
|
1298
|
-
}
|
|
1299
|
-
const G = "\x1B[103mPAGINATOR\x1B[0m";
|
|
1300
|
-
class se {
|
|
1301
|
-
_domState;
|
|
1302
|
-
_pageManager;
|
|
1303
|
-
_transaction;
|
|
1304
|
-
_tempContainer;
|
|
1305
|
-
_config;
|
|
1306
|
-
constructor(t, n, o) {
|
|
1307
|
-
this._config = { ...st, ...o }, this._tempContainer = se.createTempContainer(this._config.id), this._transaction = new pn(), this._domState = new dn(t, this._transaction, this._config), this._pageManager = new Ce(
|
|
1308
|
-
this._tempContainer,
|
|
1309
|
-
n,
|
|
1310
|
-
this._transaction,
|
|
1311
|
-
this._config
|
|
1312
|
-
);
|
|
1313
|
-
}
|
|
1314
|
-
static createTempContainer(t) {
|
|
1315
|
-
const n = document.createElement("div");
|
|
1316
|
-
return n.style.display = "flex", n.style.flexDirection = "column", n.style.gap = "20px", n.setAttribute(`${ke}-section-id`, t), n.classList.add(ot), sn(n), document.body.appendChild(n), n;
|
|
1317
|
-
}
|
|
1318
|
-
static paginate(t, n, o) {
|
|
1319
|
-
const i = new se(t, n, o);
|
|
1320
|
-
i.processAllNodes();
|
|
1321
|
-
const r = Array.from(i._tempContainer.childNodes).filter((s) => it(s)).map((s) => s.innerHTML);
|
|
1322
|
-
return i._tempContainer.remove(), r;
|
|
1323
|
-
}
|
|
1324
|
-
processAllNodes() {
|
|
1325
|
-
this._domState.nextNode();
|
|
1326
|
-
do {
|
|
1327
|
-
switch (F.debug(
|
|
1328
|
-
G,
|
|
1329
|
-
"paginating node",
|
|
1330
|
-
this._domState.currentNode
|
|
1331
|
-
), this.processCurrentNode()) {
|
|
1332
|
-
case x.None:
|
|
1333
|
-
this.handleNodeSkipped();
|
|
1334
|
-
break;
|
|
1335
|
-
case x.FullNodePlaced:
|
|
1336
|
-
this.handleFullNodePlaced();
|
|
1337
|
-
break;
|
|
1338
|
-
case x.SplitChildren:
|
|
1339
|
-
this.handleChildrenSplit();
|
|
1340
|
-
break;
|
|
1341
|
-
}
|
|
1342
|
-
D(
|
|
1343
|
-
this._config.plugins,
|
|
1344
|
-
"afterVisitNode",
|
|
1345
|
-
this._config.id,
|
|
1346
|
-
this._domState,
|
|
1347
|
-
this._pageManager
|
|
1348
|
-
);
|
|
1349
|
-
} while (this._domState.completed === !1);
|
|
1350
|
-
F.debug(G, "pagination completed");
|
|
1351
|
-
}
|
|
1352
|
-
handleNodeSkipped() {
|
|
1353
|
-
F.debug(G, "node skipped - couldn't paginate"), this._domState.currentNode, this._domState.nextNode();
|
|
1354
|
-
}
|
|
1355
|
-
handleFullNodePlaced() {
|
|
1356
|
-
F.debug(G, "node fully paginated");
|
|
1357
|
-
const { parentsTraversed: t } = this._domState.nextSiblingOrParentSibling();
|
|
1358
|
-
for (let n = 0; n < t; n++)
|
|
1359
|
-
this._pageManager.leaveElement();
|
|
1360
|
-
}
|
|
1361
|
-
handleChildrenSplit() {
|
|
1362
|
-
F.debug(
|
|
1363
|
-
G,
|
|
1364
|
-
"node partially paginated - splitting children"
|
|
1365
|
-
), this._domState.firstChildOrNextNode().parentsTraversed === 1 && this._domState.previousNode?.type === W.Element && this._pageManager.enterElement();
|
|
1366
|
-
}
|
|
1367
|
-
processCurrentNode() {
|
|
1368
|
-
if (!this._domState.currentNode)
|
|
1369
|
-
return x.None;
|
|
1370
|
-
if (this._domState.currentNode.type === W.Element) {
|
|
1371
|
-
const t = {};
|
|
1372
|
-
return D(
|
|
1373
|
-
this._config.plugins,
|
|
1374
|
-
"onVisitElement",
|
|
1375
|
-
this._config.id,
|
|
1376
|
-
this._domState,
|
|
1377
|
-
this._pageManager,
|
|
1378
|
-
t
|
|
1379
|
-
), t.result !== void 0 ? t.result : fn(
|
|
1380
|
-
this._domState.currentNode,
|
|
1381
|
-
this._pageManager
|
|
1382
|
-
);
|
|
1383
|
-
} else {
|
|
1384
|
-
const t = {};
|
|
1385
|
-
return D(
|
|
1386
|
-
this._config.plugins,
|
|
1387
|
-
"onVisitText",
|
|
1388
|
-
this._config.id,
|
|
1389
|
-
this._domState,
|
|
1390
|
-
this._pageManager,
|
|
1391
|
-
t
|
|
1392
|
-
), t.result !== void 0 ? t.result : gn(
|
|
1393
|
-
this._domState.currentNode,
|
|
1394
|
-
this._pageManager
|
|
1395
|
-
);
|
|
1396
|
-
}
|
|
1397
|
-
}
|
|
1398
|
-
}
|
|
1399
|
-
const at = "data-pz-page-break", Sn = "pageBreak", _n = {
|
|
1400
|
-
name: Sn,
|
|
1401
|
-
order: 1,
|
|
1402
|
-
onVisitElement: (e, t, n, o) => {
|
|
1403
|
-
t.currentNode.getNode().getAttribute(at) === "true" && (n.markPageAsFull(), o.result = x.FullNodePlaced);
|
|
1404
|
-
}
|
|
1405
|
-
}, wn = [_n], ct = Se({
|
|
818
|
+
const $e = ie({
|
|
1406
819
|
pageNumber: 0,
|
|
1407
820
|
totalPages: 0
|
|
1408
821
|
});
|
|
1409
|
-
function
|
|
822
|
+
function $t(e) {
|
|
1410
823
|
return e ? `${e.top} ${e.right} ${e.bottom} ${e.left}` : "0";
|
|
1411
824
|
}
|
|
1412
|
-
function
|
|
1413
|
-
const t = e.getBoundingClientRect(),
|
|
825
|
+
function Nt(e) {
|
|
826
|
+
const t = e.getBoundingClientRect(), o = getComputedStyle(e), n = parseFloat(o.marginLeft) || 0, i = parseFloat(o.marginRight) || 0;
|
|
1414
827
|
return {
|
|
1415
|
-
height:
|
|
1416
|
-
width: t.width +
|
|
828
|
+
height: Z(e),
|
|
829
|
+
width: t.width + n + i
|
|
1417
830
|
};
|
|
1418
831
|
}
|
|
1419
|
-
const
|
|
1420
|
-
function
|
|
832
|
+
const K = ie("");
|
|
833
|
+
function he({
|
|
1421
834
|
elements: e,
|
|
1422
835
|
dimensions: t,
|
|
1423
|
-
margin:
|
|
1424
|
-
pageNumber:
|
|
836
|
+
margin: o,
|
|
837
|
+
pageNumber: n,
|
|
1425
838
|
totalPages: i,
|
|
1426
839
|
ref: r,
|
|
1427
840
|
sectionHeaderRef: s,
|
|
1428
|
-
sectionFooterRef:
|
|
1429
|
-
contentRef:
|
|
841
|
+
sectionFooterRef: f,
|
|
842
|
+
contentRef: p
|
|
1430
843
|
}) {
|
|
1431
|
-
const
|
|
1432
|
-
() => ({ pageNumber:
|
|
1433
|
-
[
|
|
844
|
+
const c = $(K), a = L(
|
|
845
|
+
() => ({ pageNumber: n, totalPages: i }),
|
|
846
|
+
[n, i]
|
|
1434
847
|
);
|
|
1435
|
-
return /* @__PURE__ */
|
|
848
|
+
return /* @__PURE__ */ w($e, { value: a, children: /* @__PURE__ */ X(
|
|
1436
849
|
"div",
|
|
1437
850
|
{
|
|
1438
|
-
id: `${
|
|
851
|
+
id: `${c}-${n}`,
|
|
1439
852
|
className: "paprize-page paprize-page-component",
|
|
1440
853
|
ref: r,
|
|
1441
854
|
style: {
|
|
@@ -1443,11 +856,11 @@ function Fe({
|
|
|
1443
856
|
height: t.height,
|
|
1444
857
|
maxHeight: t.height,
|
|
1445
858
|
position: "relative",
|
|
1446
|
-
padding:
|
|
859
|
+
padding: $t(o),
|
|
1447
860
|
zIndex: 1
|
|
1448
861
|
},
|
|
1449
862
|
children: [
|
|
1450
|
-
e.sectionHeader &&
|
|
863
|
+
e.sectionHeader && n == 1 && /* @__PURE__ */ w(
|
|
1451
864
|
"div",
|
|
1452
865
|
{
|
|
1453
866
|
className: "paprize-page-component",
|
|
@@ -1455,8 +868,8 @@ function Fe({
|
|
|
1455
868
|
children: e.sectionHeader
|
|
1456
869
|
}
|
|
1457
870
|
),
|
|
1458
|
-
e.header && /* @__PURE__ */
|
|
1459
|
-
/* @__PURE__ */
|
|
871
|
+
e.header && /* @__PURE__ */ w("div", { className: "paprize-page-component", children: e.header }),
|
|
872
|
+
/* @__PURE__ */ w(
|
|
1460
873
|
"div",
|
|
1461
874
|
{
|
|
1462
875
|
style: {
|
|
@@ -1464,11 +877,11 @@ function Fe({
|
|
|
1464
877
|
width: "100%",
|
|
1465
878
|
height: "100%"
|
|
1466
879
|
},
|
|
1467
|
-
ref:
|
|
880
|
+
ref: p,
|
|
1468
881
|
children: e.content
|
|
1469
882
|
}
|
|
1470
883
|
),
|
|
1471
|
-
e.overlay && /* @__PURE__ */
|
|
884
|
+
e.overlay && /* @__PURE__ */ w(
|
|
1472
885
|
"div",
|
|
1473
886
|
{
|
|
1474
887
|
style: {
|
|
@@ -1481,18 +894,18 @@ function Fe({
|
|
|
1481
894
|
children: e.overlay
|
|
1482
895
|
}
|
|
1483
896
|
),
|
|
1484
|
-
(e.footer || e.sectionFooter) && /* @__PURE__ */
|
|
897
|
+
(e.footer || e.sectionFooter) && /* @__PURE__ */ X(
|
|
1485
898
|
"div",
|
|
1486
899
|
{
|
|
1487
900
|
className: "paprize-page-component",
|
|
1488
901
|
style: { marginTop: "auto" },
|
|
1489
902
|
children: [
|
|
1490
|
-
e.footer && /* @__PURE__ */
|
|
1491
|
-
e.sectionFooter &&
|
|
903
|
+
e.footer && /* @__PURE__ */ w("div", { className: "paprize-page-component", children: e.footer }),
|
|
904
|
+
e.sectionFooter && n == i && /* @__PURE__ */ w(
|
|
1492
905
|
"div",
|
|
1493
906
|
{
|
|
1494
907
|
className: "paprize-page-component",
|
|
1495
|
-
ref:
|
|
908
|
+
ref: f,
|
|
1496
909
|
children: e.sectionFooter
|
|
1497
910
|
}
|
|
1498
911
|
)
|
|
@@ -1503,262 +916,265 @@ function Fe({
|
|
|
1503
916
|
}
|
|
1504
917
|
) });
|
|
1505
918
|
}
|
|
1506
|
-
function
|
|
1507
|
-
const { height:
|
|
1508
|
-
return { height:
|
|
919
|
+
function Ht(e, t, o) {
|
|
920
|
+
const { height: n, width: i } = Nt(e), r = t ? Z(t) : 0, s = o ? Z(o) : 0;
|
|
921
|
+
return { height: n, width: i, sectionHeaderHeight: r, sectionFooterHeight: s };
|
|
1509
922
|
}
|
|
1510
|
-
function
|
|
923
|
+
function Ot(e, t, o) {
|
|
1511
924
|
return {
|
|
1512
925
|
name: "sectionPageHeight",
|
|
1513
926
|
order: 1,
|
|
1514
|
-
afterVisitNode: (
|
|
1515
|
-
!i.completed ||
|
|
927
|
+
afterVisitNode: (n, i, r) => {
|
|
928
|
+
!i.completed || o <= 0 || r.hasEmptySpace(o) || r.nextPage();
|
|
1516
929
|
},
|
|
1517
|
-
onNewPage: (
|
|
930
|
+
onNewPage: (n, i) => {
|
|
1518
931
|
const r = i.getPageState();
|
|
1519
|
-
r.pageIndex === 0 ? r.pageHeight = e +
|
|
932
|
+
r.pageIndex === 0 ? r.pageHeight = e + o : r.pageHeight = e + t + o;
|
|
1520
933
|
}
|
|
1521
934
|
};
|
|
1522
935
|
}
|
|
1523
|
-
function
|
|
1524
|
-
const
|
|
1525
|
-
() =>
|
|
936
|
+
function Wt(e, t) {
|
|
937
|
+
const o = L(
|
|
938
|
+
() => N(null, (n, i, ...r) => e(n, i, ...r)),
|
|
1526
939
|
[e]
|
|
1527
940
|
);
|
|
1528
|
-
return
|
|
941
|
+
return ae(o);
|
|
1529
942
|
}
|
|
1530
|
-
const
|
|
943
|
+
const Vt = {
|
|
1531
944
|
totalPages: 0,
|
|
1532
945
|
isPaginated: !1,
|
|
1533
946
|
pendingSuspensions: 0
|
|
1534
|
-
},
|
|
1535
|
-
const e =
|
|
1536
|
-
() =>
|
|
1537
|
-
const i =
|
|
947
|
+
}, Ne = () => {
|
|
948
|
+
const e = $(K), t = L(
|
|
949
|
+
() => N((n) => {
|
|
950
|
+
const i = n(M).get(e);
|
|
1538
951
|
return i ? {
|
|
1539
952
|
totalPages: i.totalPages,
|
|
1540
953
|
isPaginated: i.isPaginated,
|
|
1541
954
|
pendingSuspensions: i.pendingSuspensions.size
|
|
1542
|
-
} :
|
|
955
|
+
} : Vt;
|
|
1543
956
|
}),
|
|
1544
957
|
[e]
|
|
1545
|
-
),
|
|
958
|
+
), o = G(t);
|
|
1546
959
|
return {
|
|
1547
960
|
sectionId: e,
|
|
1548
|
-
totalPages:
|
|
961
|
+
totalPages: o.totalPages
|
|
1549
962
|
};
|
|
1550
963
|
};
|
|
1551
|
-
function
|
|
1552
|
-
return
|
|
964
|
+
function Ut(e) {
|
|
965
|
+
return Ne(), Wt((o) => (o(M).get(e)?.pendingSuspensions?.size ?? 0) > 0);
|
|
1553
966
|
}
|
|
1554
|
-
const
|
|
1555
|
-
const t =
|
|
1556
|
-
() =>
|
|
967
|
+
const le = (e) => {
|
|
968
|
+
const t = L(
|
|
969
|
+
() => N(
|
|
1557
970
|
() => 0,
|
|
1558
|
-
(
|
|
1559
|
-
|
|
1560
|
-
|
|
971
|
+
(o, n, i) => {
|
|
972
|
+
n(
|
|
973
|
+
M,
|
|
1561
974
|
(r) => new Map(r).set(
|
|
1562
975
|
e,
|
|
1563
|
-
i(r.get(e) ??
|
|
976
|
+
i(r.get(e) ?? Lt)
|
|
1564
977
|
)
|
|
1565
978
|
);
|
|
1566
979
|
}
|
|
1567
980
|
),
|
|
1568
981
|
[e]
|
|
1569
982
|
);
|
|
1570
|
-
return
|
|
1571
|
-
},
|
|
1572
|
-
function
|
|
1573
|
-
const i =
|
|
983
|
+
return ae(t);
|
|
984
|
+
}, Q = "\x1B[41mREACT\x1B[0m", ve = (e, t, o, n, i) => e?.dimensions === o && e?.margin === n && e?.elements === t && e?.config === i && e?.elements === t;
|
|
985
|
+
function jt(e, t, o, n) {
|
|
986
|
+
const i = $(K), r = Ut(i), s = le(i), f = x(null), [p, c] = we({
|
|
1574
987
|
results: null,
|
|
1575
988
|
isLoading: !0
|
|
1576
|
-
}),
|
|
1577
|
-
return
|
|
1578
|
-
|
|
1579
|
-
|
|
989
|
+
}), a = x(null), g = x(null), h = x(null), v = x(null);
|
|
990
|
+
return D(() => {
|
|
991
|
+
ve(
|
|
992
|
+
f.current,
|
|
1580
993
|
e,
|
|
1581
994
|
t,
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
) ||
|
|
995
|
+
o,
|
|
996
|
+
n
|
|
997
|
+
) || c({
|
|
1585
998
|
results: null,
|
|
1586
999
|
isLoading: !0
|
|
1587
1000
|
});
|
|
1588
|
-
}, [t, e,
|
|
1589
|
-
if (!
|
|
1001
|
+
}, [t, e, o, n]), D(() => {
|
|
1002
|
+
if (!a.current || !v.current || ve(f.current, e, t, o, n))
|
|
1590
1003
|
return;
|
|
1591
1004
|
if (r()) {
|
|
1592
|
-
|
|
1005
|
+
W.info(Q, `Section "${i}" is suspended`);
|
|
1593
1006
|
return;
|
|
1594
1007
|
}
|
|
1595
|
-
const { height:
|
|
1596
|
-
|
|
1008
|
+
const { height: m, width: l, sectionFooterHeight: d, sectionHeaderHeight: u } = Ht(
|
|
1009
|
+
v.current,
|
|
1597
1010
|
g.current,
|
|
1598
|
-
|
|
1599
|
-
),
|
|
1600
|
-
...
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1011
|
+
h.current
|
|
1012
|
+
), y = [
|
|
1013
|
+
...n.plugins ?? Ke,
|
|
1014
|
+
Ot(
|
|
1015
|
+
m,
|
|
1016
|
+
u,
|
|
1017
|
+
d
|
|
1605
1018
|
)
|
|
1606
1019
|
];
|
|
1607
|
-
|
|
1020
|
+
be() && (a.current.style.maxHeight = "none", a.current.style.height = "auto"), W.debug(Q, "Calling Paginator", {
|
|
1608
1021
|
sectionName: i,
|
|
1609
|
-
height:
|
|
1610
|
-
width:
|
|
1611
|
-
sectionFooterHeight:
|
|
1612
|
-
sectionHeaderHeight:
|
|
1613
|
-
plugins:
|
|
1022
|
+
height: m,
|
|
1023
|
+
width: l,
|
|
1024
|
+
sectionFooterHeight: d,
|
|
1025
|
+
sectionHeaderHeight: u,
|
|
1026
|
+
plugins: y
|
|
1614
1027
|
});
|
|
1615
|
-
const
|
|
1616
|
-
|
|
1617
|
-
{ height:
|
|
1618
|
-
{ ...
|
|
1028
|
+
const A = Ye.paginate(
|
|
1029
|
+
v.current,
|
|
1030
|
+
{ height: m, width: l },
|
|
1031
|
+
{ ...n, plugins: y }
|
|
1619
1032
|
);
|
|
1620
|
-
|
|
1033
|
+
W.debug(Q, "Paginator Result", {
|
|
1621
1034
|
sectionName: i,
|
|
1622
|
-
paginatorResult:
|
|
1623
|
-
}),
|
|
1624
|
-
results:
|
|
1035
|
+
paginatorResult: A
|
|
1036
|
+
}), c({
|
|
1037
|
+
results: A,
|
|
1625
1038
|
isLoading: !1
|
|
1626
|
-
}), s((
|
|
1627
|
-
...
|
|
1628
|
-
totalPages:
|
|
1039
|
+
}), s((I) => ({
|
|
1040
|
+
...I,
|
|
1041
|
+
totalPages: A.length,
|
|
1629
1042
|
isPaginated: !0
|
|
1630
|
-
})),
|
|
1043
|
+
})), f.current = { elements: e, dimensions: t, margin: o, config: n };
|
|
1631
1044
|
}), {
|
|
1632
|
-
...
|
|
1633
|
-
pageRef:
|
|
1045
|
+
...p,
|
|
1046
|
+
pageRef: a,
|
|
1634
1047
|
sectionHeaderRef: g,
|
|
1635
|
-
sectionFooterRef:
|
|
1636
|
-
contentRef:
|
|
1048
|
+
sectionFooterRef: h,
|
|
1049
|
+
contentRef: v
|
|
1637
1050
|
};
|
|
1638
1051
|
}
|
|
1639
|
-
function
|
|
1052
|
+
function Jt({
|
|
1640
1053
|
elements: e,
|
|
1641
1054
|
dimensions: t,
|
|
1642
|
-
margin:
|
|
1643
|
-
config:
|
|
1055
|
+
margin: o,
|
|
1056
|
+
config: n
|
|
1644
1057
|
}) {
|
|
1645
|
-
const { results: i, pageRef: r, sectionHeaderRef: s, sectionFooterRef:
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1058
|
+
const { results: i, pageRef: r, sectionHeaderRef: s, sectionFooterRef: f, contentRef: p } = jt(e, t, o, n);
|
|
1059
|
+
if (i !== null)
|
|
1060
|
+
return /* @__PURE__ */ w(E, { children: i.map((a, g) => /* @__PURE__ */ w(
|
|
1061
|
+
he,
|
|
1062
|
+
{
|
|
1063
|
+
elements: {
|
|
1064
|
+
...e,
|
|
1065
|
+
content: /* @__PURE__ */ w(
|
|
1066
|
+
"div",
|
|
1067
|
+
{
|
|
1068
|
+
style: { display: "contents" },
|
|
1069
|
+
dangerouslySetInnerHTML: {
|
|
1070
|
+
__html: a
|
|
1071
|
+
}
|
|
1657
1072
|
}
|
|
1658
|
-
|
|
1659
|
-
|
|
1073
|
+
)
|
|
1074
|
+
},
|
|
1075
|
+
dimensions: t,
|
|
1076
|
+
margin: o,
|
|
1077
|
+
pageNumber: g + 1,
|
|
1078
|
+
totalPages: i.length
|
|
1660
1079
|
},
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
top: "-9999px"
|
|
1673
|
-
}, children: /* @__PURE__ */ b(
|
|
1674
|
-
Fe,
|
|
1080
|
+
g
|
|
1081
|
+
)) });
|
|
1082
|
+
const c = be() ? void 0 : {
|
|
1083
|
+
visibility: "hidden",
|
|
1084
|
+
position: "absolute",
|
|
1085
|
+
left: "-9999px",
|
|
1086
|
+
top: "-9999px"
|
|
1087
|
+
};
|
|
1088
|
+
return tt(
|
|
1089
|
+
/* @__PURE__ */ w("div", { className: Qe, style: c, children: /* @__PURE__ */ w(
|
|
1090
|
+
he,
|
|
1675
1091
|
{
|
|
1676
1092
|
elements: e,
|
|
1677
1093
|
dimensions: t,
|
|
1678
|
-
margin:
|
|
1094
|
+
margin: o,
|
|
1679
1095
|
pageNumber: 1,
|
|
1680
1096
|
totalPages: 1,
|
|
1681
1097
|
ref: r,
|
|
1682
1098
|
sectionHeaderRef: s,
|
|
1683
|
-
sectionFooterRef:
|
|
1684
|
-
contentRef:
|
|
1099
|
+
sectionFooterRef: f,
|
|
1100
|
+
contentRef: p
|
|
1685
1101
|
}
|
|
1686
1102
|
) }),
|
|
1687
1103
|
document.body
|
|
1688
1104
|
);
|
|
1689
1105
|
}
|
|
1690
|
-
function
|
|
1106
|
+
function sn({
|
|
1691
1107
|
children: e,
|
|
1692
1108
|
dimension: t,
|
|
1693
|
-
orientation:
|
|
1694
|
-
margin:
|
|
1109
|
+
orientation: o = "portrait",
|
|
1110
|
+
margin: n,
|
|
1695
1111
|
config: i
|
|
1696
1112
|
}) {
|
|
1697
|
-
const r =
|
|
1113
|
+
const r = Se(), s = L(
|
|
1698
1114
|
() => ({ ...i, id: i?.id ?? r }),
|
|
1699
1115
|
[i, r]
|
|
1700
|
-
),
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
}, [
|
|
1704
|
-
const
|
|
1116
|
+
), f = s.id, p = le(f);
|
|
1117
|
+
L(() => {
|
|
1118
|
+
p((a) => ({ ...a, isPaginated: !1 }));
|
|
1119
|
+
}, [p]);
|
|
1120
|
+
const c = L(
|
|
1705
1121
|
() => ({
|
|
1706
|
-
dimensions:
|
|
1707
|
-
elements:
|
|
1708
|
-
margin:
|
|
1122
|
+
dimensions: Bt(t, o),
|
|
1123
|
+
elements: Ft(e),
|
|
1124
|
+
margin: n,
|
|
1709
1125
|
config: s
|
|
1710
1126
|
}),
|
|
1711
|
-
[e, t,
|
|
1127
|
+
[e, t, n, s, o]
|
|
1712
1128
|
);
|
|
1713
|
-
return
|
|
1129
|
+
return re(Dt(f, c.dimensions)), /* @__PURE__ */ w(
|
|
1714
1130
|
"section",
|
|
1715
1131
|
{
|
|
1716
1132
|
className: "paprize-section",
|
|
1717
|
-
id: `section-${
|
|
1718
|
-
style: { page: `section-${
|
|
1719
|
-
children: /* @__PURE__ */
|
|
1720
|
-
|
|
1133
|
+
id: `section-${f}`,
|
|
1134
|
+
style: { page: `section-${f}` },
|
|
1135
|
+
children: /* @__PURE__ */ w(K, { value: f, children: /* @__PURE__ */ w(
|
|
1136
|
+
Jt,
|
|
1721
1137
|
{
|
|
1722
|
-
elements:
|
|
1723
|
-
dimensions:
|
|
1724
|
-
margin:
|
|
1725
|
-
config:
|
|
1138
|
+
elements: c.elements,
|
|
1139
|
+
dimensions: c.dimensions,
|
|
1140
|
+
margin: c.margin,
|
|
1141
|
+
config: c.config
|
|
1726
1142
|
}
|
|
1727
1143
|
) })
|
|
1728
1144
|
}
|
|
1729
1145
|
);
|
|
1730
1146
|
}
|
|
1731
|
-
function
|
|
1732
|
-
return /* @__PURE__ */
|
|
1147
|
+
function an() {
|
|
1148
|
+
return /* @__PURE__ */ w("span", { [Xe]: "true" });
|
|
1733
1149
|
}
|
|
1734
|
-
function
|
|
1735
|
-
return /* @__PURE__ */
|
|
1150
|
+
function cn({ children: e, ...t }) {
|
|
1151
|
+
return /* @__PURE__ */ w(
|
|
1736
1152
|
"div",
|
|
1737
1153
|
{
|
|
1738
1154
|
style: { display: "contents" },
|
|
1739
|
-
...
|
|
1155
|
+
...Ze(t),
|
|
1740
1156
|
children: e
|
|
1741
1157
|
}
|
|
1742
1158
|
);
|
|
1743
1159
|
}
|
|
1744
|
-
const
|
|
1745
|
-
const e =
|
|
1160
|
+
const ln = () => {
|
|
1161
|
+
const e = $($e);
|
|
1746
1162
|
return {
|
|
1747
1163
|
pageNumber: e.pageNumber,
|
|
1748
1164
|
totalPages: e.totalPages
|
|
1749
1165
|
};
|
|
1750
1166
|
};
|
|
1751
|
-
function
|
|
1752
|
-
const e =
|
|
1753
|
-
return
|
|
1167
|
+
function un() {
|
|
1168
|
+
const e = G(M), t = G(ce);
|
|
1169
|
+
return L(
|
|
1754
1170
|
() => ({
|
|
1755
1171
|
totalSections: t.totalSections,
|
|
1756
1172
|
isPaginated: t.isPaginated,
|
|
1757
1173
|
isFirstPaginationCompleted: t.totalSections > 0,
|
|
1758
1174
|
sections: Array.from(e.entries()).map(
|
|
1759
|
-
([
|
|
1760
|
-
sectionId:
|
|
1761
|
-
totalPages:
|
|
1175
|
+
([o, { totalPages: n, isPaginated: i }]) => ({
|
|
1176
|
+
sectionId: o,
|
|
1177
|
+
totalPages: n,
|
|
1762
1178
|
isPaginated: i
|
|
1763
1179
|
})
|
|
1764
1180
|
)
|
|
@@ -1766,242 +1182,50 @@ function Qn() {
|
|
|
1766
1182
|
[t.isPaginated, t.totalSections, e]
|
|
1767
1183
|
);
|
|
1768
1184
|
}
|
|
1769
|
-
function
|
|
1770
|
-
const
|
|
1771
|
-
return
|
|
1772
|
-
t &&
|
|
1185
|
+
function qt(e, t = !0) {
|
|
1186
|
+
const o = Se(), n = le(e);
|
|
1187
|
+
return L(() => {
|
|
1188
|
+
t && n((i) => ({
|
|
1773
1189
|
...i,
|
|
1774
|
-
pendingSuspensions: new Set(i.pendingSuspensions).add(
|
|
1190
|
+
pendingSuspensions: new Set(i.pendingSuspensions).add(o)
|
|
1775
1191
|
}));
|
|
1776
|
-
}, [
|
|
1192
|
+
}, [o, n, t]), L(() => ({
|
|
1777
1193
|
release: () => {
|
|
1778
|
-
|
|
1194
|
+
n((i) => {
|
|
1779
1195
|
const r = new Set(i.pendingSuspensions);
|
|
1780
|
-
return r.delete(
|
|
1196
|
+
return r.delete(o), {
|
|
1781
1197
|
...i,
|
|
1782
1198
|
pendingSuspensions: r
|
|
1783
1199
|
};
|
|
1784
1200
|
});
|
|
1785
1201
|
}
|
|
1786
|
-
}), [
|
|
1787
|
-
}
|
|
1788
|
-
const Ln = "paprize";
|
|
1789
|
-
class H {
|
|
1790
|
-
name;
|
|
1791
|
-
defaultValue;
|
|
1792
|
-
_reader;
|
|
1793
|
-
constructor(t, n, o) {
|
|
1794
|
-
this.name = t, this._reader = n, this.defaultValue = o;
|
|
1795
|
-
}
|
|
1796
|
-
read(t) {
|
|
1797
|
-
return this._reader(t);
|
|
1798
|
-
}
|
|
1799
|
-
static createStr(t, n) {
|
|
1800
|
-
return new H(t, (o) => o, n);
|
|
1801
|
-
}
|
|
1802
|
-
static createBool(t, n) {
|
|
1803
|
-
return new H(
|
|
1804
|
-
t,
|
|
1805
|
-
(o) => o === "true",
|
|
1806
|
-
n
|
|
1807
|
-
);
|
|
1808
|
-
}
|
|
1809
|
-
}
|
|
1810
|
-
const In = {
|
|
1811
|
-
hyphen: H.createStr("hyphen", "-"),
|
|
1812
|
-
keepOnSamePage: H.createBool("keep-on-same-page", !1),
|
|
1813
|
-
hyphenationEnabled: H.createBool(
|
|
1814
|
-
"hyphenation-enabled",
|
|
1815
|
-
!0
|
|
1816
|
-
)
|
|
1817
|
-
}, Rn = Object.fromEntries(
|
|
1818
|
-
Object.entries(In).map(([e, t]) => [
|
|
1819
|
-
e,
|
|
1820
|
-
t.defaultValue
|
|
1821
|
-
])
|
|
1822
|
-
);
|
|
1823
|
-
({
|
|
1824
|
-
...Rn
|
|
1825
|
-
});
|
|
1826
|
-
function Fn(e) {
|
|
1827
|
-
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
1828
|
-
}
|
|
1829
|
-
var ve = { exports: {} }, zn = ve.exports, Oe;
|
|
1830
|
-
function On() {
|
|
1831
|
-
return Oe || (Oe = 1, (function(e) {
|
|
1832
|
-
(function(t, n) {
|
|
1833
|
-
e.exports ? e.exports = n() : t.log = n();
|
|
1834
|
-
})(zn, function() {
|
|
1835
|
-
var t = function() {
|
|
1836
|
-
}, n = "undefined", o = typeof window !== n && typeof window.navigator !== n && /Trident\/|MSIE /.test(window.navigator.userAgent), i = [
|
|
1837
|
-
"trace",
|
|
1838
|
-
"debug",
|
|
1839
|
-
"info",
|
|
1840
|
-
"warn",
|
|
1841
|
-
"error"
|
|
1842
|
-
], r = {}, s = null;
|
|
1843
|
-
function d(a, u) {
|
|
1844
|
-
var c = a[u];
|
|
1845
|
-
if (typeof c.bind == "function")
|
|
1846
|
-
return c.bind(a);
|
|
1847
|
-
try {
|
|
1848
|
-
return Function.prototype.bind.call(c, a);
|
|
1849
|
-
} catch {
|
|
1850
|
-
return function() {
|
|
1851
|
-
return Function.prototype.apply.apply(c, [a, arguments]);
|
|
1852
|
-
};
|
|
1853
|
-
}
|
|
1854
|
-
}
|
|
1855
|
-
function h() {
|
|
1856
|
-
console.log && (console.log.apply ? console.log.apply(console, arguments) : Function.prototype.apply.apply(console.log, [console, arguments])), console.trace && console.trace();
|
|
1857
|
-
}
|
|
1858
|
-
function p(a) {
|
|
1859
|
-
return a === "debug" && (a = "log"), typeof console === n ? !1 : a === "trace" && o ? h : console[a] !== void 0 ? d(console, a) : console.log !== void 0 ? d(console, "log") : t;
|
|
1860
|
-
}
|
|
1861
|
-
function l() {
|
|
1862
|
-
for (var a = this.getLevel(), u = 0; u < i.length; u++) {
|
|
1863
|
-
var c = i[u];
|
|
1864
|
-
this[c] = u < a ? t : this.methodFactory(c, a, this.name);
|
|
1865
|
-
}
|
|
1866
|
-
if (this.log = this.debug, typeof console === n && a < this.levels.SILENT)
|
|
1867
|
-
return "No console available for logging";
|
|
1868
|
-
}
|
|
1869
|
-
function g(a) {
|
|
1870
|
-
return function() {
|
|
1871
|
-
typeof console !== n && (l.call(this), this[a].apply(this, arguments));
|
|
1872
|
-
};
|
|
1873
|
-
}
|
|
1874
|
-
function v(a, u, c) {
|
|
1875
|
-
return p(a) || g.apply(this, arguments);
|
|
1876
|
-
}
|
|
1877
|
-
function m(a, u) {
|
|
1878
|
-
var c = this, k, C, E, w = "loglevel";
|
|
1879
|
-
typeof a == "string" ? w += ":" + a : typeof a == "symbol" && (w = void 0);
|
|
1880
|
-
function O(f) {
|
|
1881
|
-
var S = (i[f] || "silent").toUpperCase();
|
|
1882
|
-
if (!(typeof window === n || !w)) {
|
|
1883
|
-
try {
|
|
1884
|
-
window.localStorage[w] = S;
|
|
1885
|
-
return;
|
|
1886
|
-
} catch {
|
|
1887
|
-
}
|
|
1888
|
-
try {
|
|
1889
|
-
window.document.cookie = encodeURIComponent(w) + "=" + S + ";";
|
|
1890
|
-
} catch {
|
|
1891
|
-
}
|
|
1892
|
-
}
|
|
1893
|
-
}
|
|
1894
|
-
function y() {
|
|
1895
|
-
var f;
|
|
1896
|
-
if (!(typeof window === n || !w)) {
|
|
1897
|
-
try {
|
|
1898
|
-
f = window.localStorage[w];
|
|
1899
|
-
} catch {
|
|
1900
|
-
}
|
|
1901
|
-
if (typeof f === n)
|
|
1902
|
-
try {
|
|
1903
|
-
var S = window.document.cookie, R = encodeURIComponent(w), U = S.indexOf(R + "=");
|
|
1904
|
-
U !== -1 && (f = /^([^;]+)/.exec(
|
|
1905
|
-
S.slice(U + R.length + 1)
|
|
1906
|
-
)[1]);
|
|
1907
|
-
} catch {
|
|
1908
|
-
}
|
|
1909
|
-
return c.levels[f] === void 0 && (f = void 0), f;
|
|
1910
|
-
}
|
|
1911
|
-
}
|
|
1912
|
-
function L() {
|
|
1913
|
-
if (!(typeof window === n || !w)) {
|
|
1914
|
-
try {
|
|
1915
|
-
window.localStorage.removeItem(w);
|
|
1916
|
-
} catch {
|
|
1917
|
-
}
|
|
1918
|
-
try {
|
|
1919
|
-
window.document.cookie = encodeURIComponent(w) + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC";
|
|
1920
|
-
} catch {
|
|
1921
|
-
}
|
|
1922
|
-
}
|
|
1923
|
-
}
|
|
1924
|
-
function P(f) {
|
|
1925
|
-
var S = f;
|
|
1926
|
-
if (typeof S == "string" && c.levels[S.toUpperCase()] !== void 0 && (S = c.levels[S.toUpperCase()]), typeof S == "number" && S >= 0 && S <= c.levels.SILENT)
|
|
1927
|
-
return S;
|
|
1928
|
-
throw new TypeError("log.setLevel() called with invalid level: " + f);
|
|
1929
|
-
}
|
|
1930
|
-
c.name = a, c.levels = {
|
|
1931
|
-
TRACE: 0,
|
|
1932
|
-
DEBUG: 1,
|
|
1933
|
-
INFO: 2,
|
|
1934
|
-
WARN: 3,
|
|
1935
|
-
ERROR: 4,
|
|
1936
|
-
SILENT: 5
|
|
1937
|
-
}, c.methodFactory = u || v, c.getLevel = function() {
|
|
1938
|
-
return E ?? C ?? k;
|
|
1939
|
-
}, c.setLevel = function(f, S) {
|
|
1940
|
-
return E = P(f), S !== !1 && O(E), l.call(c);
|
|
1941
|
-
}, c.setDefaultLevel = function(f) {
|
|
1942
|
-
C = P(f), y() || c.setLevel(f, !1);
|
|
1943
|
-
}, c.resetLevel = function() {
|
|
1944
|
-
E = null, L(), l.call(c);
|
|
1945
|
-
}, c.enableAll = function(f) {
|
|
1946
|
-
c.setLevel(c.levels.TRACE, f);
|
|
1947
|
-
}, c.disableAll = function(f) {
|
|
1948
|
-
c.setLevel(c.levels.SILENT, f);
|
|
1949
|
-
}, c.rebuild = function() {
|
|
1950
|
-
if (s !== c && (k = P(s.getLevel())), l.call(c), s === c)
|
|
1951
|
-
for (var f in r)
|
|
1952
|
-
r[f].rebuild();
|
|
1953
|
-
}, k = P(
|
|
1954
|
-
s ? s.getLevel() : "WARN"
|
|
1955
|
-
);
|
|
1956
|
-
var I = y();
|
|
1957
|
-
I != null && (E = P(I)), l.call(c);
|
|
1958
|
-
}
|
|
1959
|
-
s = new m(), s.getLogger = function(a) {
|
|
1960
|
-
if (typeof a != "symbol" && typeof a != "string" || a === "")
|
|
1961
|
-
throw new TypeError("You must supply a name when creating a logger.");
|
|
1962
|
-
var u = r[a];
|
|
1963
|
-
return u || (u = r[a] = new m(
|
|
1964
|
-
a,
|
|
1965
|
-
s.methodFactory
|
|
1966
|
-
)), u;
|
|
1967
|
-
};
|
|
1968
|
-
var _ = typeof window !== n ? window.log : void 0;
|
|
1969
|
-
return s.noConflict = function() {
|
|
1970
|
-
return typeof window !== n && window.log === s && (window.log = _), s;
|
|
1971
|
-
}, s.getLoggers = function() {
|
|
1972
|
-
return r;
|
|
1973
|
-
}, s.default = s, s;
|
|
1974
|
-
});
|
|
1975
|
-
})(ve)), ve.exports;
|
|
1202
|
+
}), [o, n]);
|
|
1976
1203
|
}
|
|
1977
|
-
|
|
1978
|
-
const
|
|
1979
|
-
ut.setDefaultLevel("info");
|
|
1980
|
-
function Dn(e, t) {
|
|
1981
|
-
const { sectionId: n } = lt(), { release: o } = Tn(n), [i, r] = $e({
|
|
1204
|
+
function Gt(e, t) {
|
|
1205
|
+
const { sectionId: o } = Ne(), { release: n } = qt(o), [i, r] = we({
|
|
1982
1206
|
state: "loading",
|
|
1983
1207
|
value: t
|
|
1984
1208
|
});
|
|
1985
|
-
return
|
|
1209
|
+
return L(() => {
|
|
1986
1210
|
e.then((s) => r({ state: "hasData", value: s })).catch((s) => {
|
|
1987
|
-
r({ state: "hasError", value: s }),
|
|
1211
|
+
r({ state: "hasError", value: s }), W.error("Error in useSuspenseForPromise", s);
|
|
1988
1212
|
});
|
|
1989
|
-
}, [e]),
|
|
1990
|
-
i.state !== "loading" &&
|
|
1991
|
-
}, [i,
|
|
1213
|
+
}, [e]), D(() => {
|
|
1214
|
+
i.state !== "loading" && n();
|
|
1215
|
+
}, [i, n]), i.value;
|
|
1992
1216
|
}
|
|
1993
|
-
function
|
|
1217
|
+
function Kt(e) {
|
|
1994
1218
|
let t = null;
|
|
1995
1219
|
return () => (t || (t = e()), t);
|
|
1996
1220
|
}
|
|
1997
|
-
const
|
|
1998
|
-
const e = await window[
|
|
1221
|
+
const Yt = Kt(async () => {
|
|
1222
|
+
const e = await window[et]?.();
|
|
1999
1223
|
return e ? JSON.parse(e) : null;
|
|
2000
1224
|
});
|
|
2001
|
-
function
|
|
2002
|
-
return
|
|
1225
|
+
function dn(e) {
|
|
1226
|
+
return Gt(Yt(), e);
|
|
2003
1227
|
}
|
|
2004
|
-
const
|
|
1228
|
+
const Qt = {
|
|
2005
1229
|
A1: { height: "841mm", width: "594mm" },
|
|
2006
1230
|
A2: { height: "594mm", width: "420mm" },
|
|
2007
1231
|
A3: { height: "420mm", width: "297mm" },
|
|
@@ -2014,31 +1238,32 @@ const Wn = {
|
|
|
2014
1238
|
Letter: { height: "8.5in", width: "11in" },
|
|
2015
1239
|
Legal: { height: "11in", width: "8.5in" },
|
|
2016
1240
|
Tabloid: { height: "11in", width: "17in" }
|
|
2017
|
-
},
|
|
1241
|
+
}, Xt = {
|
|
2018
1242
|
Normal: { top: "1in", right: "1in", bottom: "1in", left: "1in" },
|
|
2019
1243
|
Narrow: { top: "0.4in", right: "0.6in", bottom: "0.6in", left: "0.6in" },
|
|
2020
1244
|
Wide: { top: "0.5in", right: "2in", bottom: "0.5in", left: "2in" },
|
|
2021
1245
|
None: { top: "0in", right: "0in", bottom: "0in", left: "0in" }
|
|
2022
|
-
},
|
|
1246
|
+
}, fn = Qt, gn = Xt;
|
|
2023
1247
|
export {
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
1248
|
+
cn as Layout,
|
|
1249
|
+
an as PageBreak,
|
|
1250
|
+
ze as PageContent,
|
|
1251
|
+
Me as PageFooter,
|
|
1252
|
+
Te as PageHeader,
|
|
1253
|
+
De as PageOverlay,
|
|
1254
|
+
on as ReportPreview,
|
|
1255
|
+
rn as ReportRoot,
|
|
1256
|
+
sn as Section,
|
|
1257
|
+
Fe as SectionFooter,
|
|
1258
|
+
Be as SectionHeader,
|
|
1259
|
+
Yt as jsonData,
|
|
1260
|
+
gn as pageMargin,
|
|
1261
|
+
fn as pageSize,
|
|
1262
|
+
dn as useJsonData,
|
|
1263
|
+
ln as usePageInfo,
|
|
1264
|
+
un as useReportInfo,
|
|
1265
|
+
Ne as useSectionInfo,
|
|
1266
|
+
qt as useSectionSuspension,
|
|
1267
|
+
Gt as useSuspenseForPromise
|
|
2044
1268
|
};
|
|
1269
|
+
//# sourceMappingURL=paprize-react.js.map
|