@devgateway/dvz-ui-react 1.6.20 → 1.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/_virtual/_commonjsHelpers.js +1 -0
- package/dist/cjs/_virtual/debounce.js +1 -0
- package/dist/cjs/embeddable/big-filter/BigNumberGroup.js +1 -0
- package/dist/cjs/embeddable/big-filter/BigNumberItem.js +1 -0
- package/dist/cjs/embeddable/big-filter/DataProvider.js +1 -0
- package/dist/cjs/embeddable/big-filter/index.js +1 -0
- package/dist/cjs/embeddable/big-number/index.js +1 -1
- package/dist/cjs/embeddable/big-number-trend/Alternative.js +1 -0
- package/dist/cjs/embeddable/big-number-trend/Classic.js +1 -0
- package/dist/cjs/embeddable/big-number-trend/index.js +1 -1
- package/dist/cjs/embeddable/chart/Bar.js +1 -1
- package/dist/cjs/embeddable/chart/Line.js +1 -1
- package/dist/cjs/embeddable/chart/data/Bar.js +1 -1
- package/dist/cjs/embeddable/chart/data/Line.js +1 -1
- package/dist/cjs/embeddable/chart/data/Utils.js +1 -1
- package/dist/cjs/embeddable/chart/index.js +1 -1
- package/dist/cjs/embeddable/d3Map/BaseLayer.js +1 -1
- package/dist/cjs/embeddable/d3Map/BreaksStyles.js +1 -1
- package/dist/cjs/embeddable/d3Map/DataLayer.js +1 -1
- package/dist/cjs/embeddable/d3Map/FlowLayer.js +1 -1
- package/dist/cjs/embeddable/d3Map/GradientColors.js +1 -1
- package/dist/cjs/embeddable/d3Map/LatLongLayer.js +1 -1
- package/dist/cjs/embeddable/d3Map/Layer.js +1 -1
- package/dist/cjs/embeddable/d3Map/Legends.js +1 -1
- package/dist/cjs/embeddable/d3Map/ProjectedContainer.js +1 -1
- package/dist/cjs/embeddable/d3Map/Utils.js +1 -1
- package/dist/cjs/embeddable/d3Map/ZoomControl.js +1 -1
- package/dist/cjs/embeddable/d3Map/index.js +1 -1
- package/dist/cjs/embeddable/data/CategoriesProvider.js +1 -1
- package/dist/cjs/embeddable/data/D3MapDataConsumer.js +1 -0
- package/dist/cjs/embeddable/data/D3MapDataProvider.js +1 -0
- package/dist/cjs/embeddable/data/DataContext.js +1 -1
- package/dist/cjs/embeddable/data/DataProvider.js +1 -1
- package/dist/cjs/embeddable/data-paragraph/index.js +1 -0
- package/dist/cjs/embeddable/download/dom-to-image.js +2 -2
- package/dist/cjs/embeddable/download/index.js +5 -5
- package/dist/cjs/embeddable/filter/index.js +1 -1
- package/dist/cjs/embeddable/grouped-bars/GroupedBars.js +1 -0
- package/dist/cjs/embeddable/grouped-bars/index.js +1 -0
- package/dist/cjs/embeddable/index.js +1 -1
- package/dist/cjs/embeddable/posts-filter/CategoricalFilter.js +1 -1
- package/dist/cjs/embeddable/reducers/data-api.js +1 -1
- package/dist/cjs/embeddable/reducers/data.js +1 -1
- package/dist/cjs/embeddable/utils/common.js +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/layout/Customizer.js +1 -1
- package/dist/cjs/layout/SearchControl.js +1 -1
- package/dist/cjs/layout/containers/SlugPostContainer.js +1 -1
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_Symbol.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseGetTag.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseTrim.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_freeGlobal.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getRawTag.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_objectToString.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_root.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_trimmedEndIndex.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/debounce.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObject.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObjectLike.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isSymbol.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/now.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/toNumber.js +1 -0
- package/dist/cjs/styles.css +1 -1
- package/dist/esm/_virtual/_commonjsHelpers.js +8 -0
- package/dist/esm/_virtual/debounce.js +7 -0
- package/dist/esm/embeddable/big-filter/BigNumberGroup.js +129 -0
- package/dist/esm/embeddable/big-filter/BigNumberItem.js +107 -0
- package/dist/esm/embeddable/big-filter/DataProvider.js +53 -0
- package/dist/esm/embeddable/big-filter/index.js +130 -0
- package/dist/esm/embeddable/big-number/index.js +154 -102
- package/dist/esm/embeddable/big-number-trend/Alternative.js +227 -0
- package/dist/esm/embeddable/big-number-trend/Classic.js +190 -0
- package/dist/esm/embeddable/big-number-trend/index.js +12 -147
- package/dist/esm/embeddable/chart/Bar.js +450 -395
- package/dist/esm/embeddable/chart/Line.js +216 -184
- package/dist/esm/embeddable/chart/data/Bar.js +16 -18
- package/dist/esm/embeddable/chart/data/Line.js +27 -24
- package/dist/esm/embeddable/chart/data/Utils.js +3 -1
- package/dist/esm/embeddable/chart/index.js +168 -162
- package/dist/esm/embeddable/d3Map/BaseLayer.js +25 -28
- package/dist/esm/embeddable/d3Map/BreaksStyles.js +17 -10
- package/dist/esm/embeddable/d3Map/DataLayer.js +290 -289
- package/dist/esm/embeddable/d3Map/FlowLayer.js +122 -136
- package/dist/esm/embeddable/d3Map/GradientColors.js +27 -20
- package/dist/esm/embeddable/d3Map/LatLongLayer.js +62 -62
- package/dist/esm/embeddable/d3Map/Layer.js +31 -27
- package/dist/esm/embeddable/d3Map/Legends.js +204 -190
- package/dist/esm/embeddable/d3Map/ProjectedContainer.js +1 -3
- package/dist/esm/embeddable/d3Map/Utils.js +12 -8
- package/dist/esm/embeddable/d3Map/ZoomControl.js +41 -41
- package/dist/esm/embeddable/d3Map/index.js +135 -117
- package/dist/esm/embeddable/data/CategoriesProvider.js +39 -26
- package/dist/esm/embeddable/data/D3MapDataConsumer.js +7 -0
- package/dist/esm/embeddable/data/D3MapDataProvider.js +83 -0
- package/dist/esm/embeddable/data/DataContext.js +2 -2
- package/dist/esm/embeddable/data/DataProvider.js +124 -55
- package/dist/esm/embeddable/data-paragraph/index.js +168 -0
- package/dist/esm/embeddable/download/dom-to-image.js +163 -148
- package/dist/esm/embeddable/download/index.js +102 -76
- package/dist/esm/embeddable/filter/index.js +335 -298
- package/dist/esm/embeddable/grouped-bars/GroupedBars.js +549 -0
- package/dist/esm/embeddable/grouped-bars/index.js +16 -0
- package/dist/esm/embeddable/index.js +33 -30
- package/dist/esm/embeddable/posts-filter/CategoricalFilter.js +18 -18
- package/dist/esm/embeddable/reducers/data-api.js +39 -35
- package/dist/esm/embeddable/reducers/data.js +141 -182
- package/dist/esm/embeddable/utils/common.js +3 -3
- package/dist/esm/index.js +111 -94
- package/dist/esm/layout/Customizer.js +10 -9
- package/dist/esm/layout/SearchControl.js +103 -113
- package/dist/esm/layout/containers/SlugPostContainer.js +1 -1
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_Symbol.js +11 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseGetTag.js +16 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseTrim.js +14 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_freeGlobal.js +11 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getRawTag.js +21 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_objectToString.js +13 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_root.js +11 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_trimmedEndIndex.js +15 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/debounce.js +60 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObject.js +13 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObjectLike.js +12 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isSymbol.js +15 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/now.js +13 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/toNumber.js +28 -0
- package/dist/esm/styles.css +1 -1
- package/dist/types/embeddable/big-filter/BigNumberGroup.d.ts +3 -0
- package/dist/types/embeddable/big-filter/BigNumberItem.d.ts +2 -0
- package/dist/types/embeddable/big-filter/DataProvider.d.ts +7 -0
- package/dist/types/embeddable/big-filter/index.d.ts +5 -0
- package/dist/types/embeddable/big-number-trend/Alternative.d.ts +5 -0
- package/dist/types/embeddable/big-number-trend/Classic.d.ts +5 -0
- package/dist/types/embeddable/big-number-trend/index.d.ts +2 -4
- package/dist/types/embeddable/chart/Bar.d.ts +3 -0
- package/dist/types/embeddable/chart/Line.d.ts +6 -0
- package/dist/types/embeddable/d3Map/GradientColors.d.ts +6 -2
- package/dist/types/embeddable/d3Map/Layer.d.ts +1 -1
- package/dist/types/embeddable/d3Map/Utils.d.ts +1 -1
- package/dist/types/embeddable/data/D3MapDataProvider.d.ts +7 -0
- package/dist/types/embeddable/data/index.d.ts +6 -0
- package/dist/types/embeddable/data-paragraph/index.d.ts +5 -0
- package/dist/types/embeddable/filter/index.d.ts +13 -1
- package/dist/types/embeddable/grouped-bars/GroupedBars.d.ts +5 -0
- package/dist/types/embeddable/grouped-bars/index.d.ts +3 -0
- package/dist/types/embeddable/reducers/data-api.d.ts +5 -0
- package/dist/types/embeddable/reducers/data.d.ts +16 -9
- package/dist/types/embeddable/utils/index.d.ts +1 -0
- package/dist/types/embeddable/utils/parseUtils.d.ts +0 -6
- package/dist/types/index.d.ts +6 -0
- package/dist/types/layout/Customizer.d.ts +1 -0
- package/dist/types/layout/containers/PageContainer.d.ts +8 -0
- package/dist/types/layout/containers/PostContainer.d.ts +0 -0
- package/dist/types/layout/index.d.ts +1 -0
- package/dist/types/utils/Logger.d.ts +1 -0
- package/package.json +3 -2
- /package/dist/types/embeddable/data/{DataConsumerMap.d.ts → D3MapDataConsumer.d.ts} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const d = z(), I = K(), F = Q(), N = Y(), k = {
|
|
2
2
|
// Default is to fail on error, no placeholder
|
|
3
3
|
imagePlaceholder: void 0,
|
|
4
4
|
// Default cache bust is false, it will use the cache
|
|
@@ -13,75 +13,75 @@ const h = z(), R = K(), F = Q(), N = Y(), k = {
|
|
|
13
13
|
impl: {
|
|
14
14
|
fontFaces: F,
|
|
15
15
|
images: N,
|
|
16
|
-
util:
|
|
17
|
-
inliner:
|
|
16
|
+
util: d,
|
|
17
|
+
inliner: I,
|
|
18
18
|
options: {}
|
|
19
19
|
}
|
|
20
20
|
};
|
|
21
21
|
typeof module < "u" ? module.exports = b : globalThis.domtoimage = b;
|
|
22
|
-
async function j(o,
|
|
23
|
-
|
|
24
|
-
const
|
|
22
|
+
async function j(o, n) {
|
|
23
|
+
n = n || {}, $(n);
|
|
24
|
+
const t = await Promise.resolve(o), s = await O(t, n.filter, !0), l = await W(s), r = await q(l), c = await h(r);
|
|
25
25
|
return await J(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
c,
|
|
27
|
+
n.width || d.width(o),
|
|
28
|
+
n.height || d.height(o)
|
|
29
29
|
);
|
|
30
|
-
function
|
|
31
|
-
return
|
|
32
|
-
m.style[g] =
|
|
30
|
+
function h(m) {
|
|
31
|
+
return n.bgcolor && (m.style.backgroundColor = n.bgcolor), n.width && (m.style.width = n.width + "px"), n.height && (m.style.height = n.height + "px"), n.style && Object.keys(n.style).forEach(function(g) {
|
|
32
|
+
m.style[g] = n.style[g];
|
|
33
33
|
}), m;
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
-
async function V(o,
|
|
37
|
-
const
|
|
38
|
-
return
|
|
36
|
+
async function V(o, n) {
|
|
37
|
+
const t = await R(o, n || {});
|
|
38
|
+
return t ? t.getContext("2d").getImageData(
|
|
39
39
|
0,
|
|
40
40
|
0,
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
d.width(o),
|
|
42
|
+
d.height(o)
|
|
43
43
|
).data : null;
|
|
44
44
|
}
|
|
45
|
-
async function _(o,
|
|
46
|
-
const
|
|
47
|
-
return
|
|
45
|
+
async function _(o, n) {
|
|
46
|
+
const t = await R(o, n || {});
|
|
47
|
+
return t ? t.toDataURL() : null;
|
|
48
48
|
}
|
|
49
|
-
async function X(o,
|
|
50
|
-
|
|
51
|
-
const
|
|
52
|
-
return
|
|
49
|
+
async function X(o, n) {
|
|
50
|
+
n = n || {};
|
|
51
|
+
const t = await R(o, n);
|
|
52
|
+
return t ? t.toDataURL("image/jpeg", n.quality || 1) : null;
|
|
53
53
|
}
|
|
54
|
-
function G(o,
|
|
55
|
-
return
|
|
54
|
+
function G(o, n) {
|
|
55
|
+
return R(o, n || {}).then(d.canvasToBlob);
|
|
56
56
|
}
|
|
57
57
|
function $(o) {
|
|
58
58
|
typeof o.imagePlaceholder > "u" ? b.impl.options.imagePlaceholder = k.imagePlaceholder : b.impl.options.imagePlaceholder = o.imagePlaceholder, typeof o.cacheBust > "u" ? b.impl.options.cacheBust = k.cacheBust : b.impl.options.cacheBust = o.cacheBust;
|
|
59
59
|
}
|
|
60
|
-
function
|
|
61
|
-
return j(o,
|
|
62
|
-
const l =
|
|
63
|
-
return r ? (r.drawImage(
|
|
64
|
-
}).catch(function(
|
|
65
|
-
console.error("Failed to draw canvas:",
|
|
60
|
+
function R(o, n) {
|
|
61
|
+
return j(o, n).then(d.makeImage).then(d.delay(100)).then(function(s) {
|
|
62
|
+
const l = t(o, n), r = l.getContext("2d");
|
|
63
|
+
return r ? (r.drawImage(s, 0, 0), l) : new HTMLCanvasElement();
|
|
64
|
+
}).catch(function(s) {
|
|
65
|
+
console.error("Failed to draw canvas:", s);
|
|
66
66
|
});
|
|
67
|
-
function
|
|
68
|
-
const r = document.createElement("canvas"),
|
|
69
|
-
r.width = (l.width ||
|
|
67
|
+
function t(s, l) {
|
|
68
|
+
const r = document.createElement("canvas"), c = s.getBoundingClientRect(), h = window.devicePixelRatio || 1;
|
|
69
|
+
r.width = (l.width || c.width) * h, r.height = (l.height || c.height) * h, r.style.width = (l.width || c.width) + "px", r.style.height = (l.height || c.height) + "px";
|
|
70
70
|
const m = r.getContext("2d");
|
|
71
|
-
return m ? (m.scale(
|
|
71
|
+
return m ? (m.scale(h, h), l.bgcolor && (m.fillStyle = l.bgcolor, m.fillRect(0, 0, r.width, r.height)), r) : new HTMLCanvasElement();
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
-
async function O(o,
|
|
75
|
-
if (!
|
|
76
|
-
const
|
|
74
|
+
async function O(o, n, t) {
|
|
75
|
+
if (!t && n && !n(o)) return Promise.resolve();
|
|
76
|
+
const s = await Promise.resolve(o), l = await c(s), r = await h(o, l, n);
|
|
77
77
|
return m(o, r);
|
|
78
|
-
function
|
|
79
|
-
return g instanceof HTMLCanvasElement ?
|
|
78
|
+
function c(g) {
|
|
79
|
+
return g instanceof HTMLCanvasElement ? d.makeImage(g.toDataURL()) : g.cloneNode(!1);
|
|
80
80
|
}
|
|
81
|
-
async function
|
|
81
|
+
async function h(g, a, T) {
|
|
82
82
|
const x = g.childNodes;
|
|
83
|
-
if (x.length === 0) return Promise.resolve(
|
|
84
|
-
return await C(
|
|
83
|
+
if (x.length === 0) return Promise.resolve(a);
|
|
84
|
+
return await C(a, d.asArray(x), T), a;
|
|
85
85
|
function C(U, v, p) {
|
|
86
86
|
let w = Promise.resolve();
|
|
87
87
|
return v.forEach(function(e) {
|
|
@@ -93,17 +93,17 @@ async function O(o, t, n) {
|
|
|
93
93
|
}), w;
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
|
-
function m(g,
|
|
97
|
-
if (!(
|
|
96
|
+
function m(g, a) {
|
|
97
|
+
if (!(a instanceof Element)) return a;
|
|
98
98
|
return Promise.resolve().then(T).then(x).then(C).then(U).then(function() {
|
|
99
|
-
return
|
|
99
|
+
return a;
|
|
100
100
|
});
|
|
101
101
|
function T() {
|
|
102
|
-
v(window.getComputedStyle(g),
|
|
102
|
+
v(window.getComputedStyle(g), a.style);
|
|
103
103
|
function v(p, w) {
|
|
104
104
|
p.cssText ? w.cssText = p.cssText : e(p, w);
|
|
105
105
|
function e(i, f) {
|
|
106
|
-
|
|
106
|
+
d.asArray(i).forEach(function(u) {
|
|
107
107
|
f.setProperty(
|
|
108
108
|
u,
|
|
109
109
|
i.getPropertyValue(u),
|
|
@@ -120,10 +120,10 @@ async function O(o, t, n) {
|
|
|
120
120
|
function v(p) {
|
|
121
121
|
const w = window.getComputedStyle(g, p), e = w.getPropertyValue("content");
|
|
122
122
|
if (e === "" || e === "none") return;
|
|
123
|
-
const i =
|
|
124
|
-
|
|
123
|
+
const i = d.uid();
|
|
124
|
+
a.className = a.className + " " + i;
|
|
125
125
|
const f = document.createElement("style");
|
|
126
|
-
f.appendChild(u(i, p, w)),
|
|
126
|
+
f.appendChild(u(i, p, w)), a.appendChild(f);
|
|
127
127
|
function u(y, E, S) {
|
|
128
128
|
const B = "." + y + ":" + E, P = S.cssText ? L(S) : H(S);
|
|
129
129
|
return document.createTextNode(B + "{" + P + "}");
|
|
@@ -132,7 +132,7 @@ async function O(o, t, n) {
|
|
|
132
132
|
return A.cssText + " content: " + D + ";";
|
|
133
133
|
}
|
|
134
134
|
function H(A) {
|
|
135
|
-
return
|
|
135
|
+
return d.asArray(A).map(D).join("; ") + ";";
|
|
136
136
|
function D(M) {
|
|
137
137
|
return M + ": " + A.getPropertyValue(M) + (A.getPropertyPriority(M) ? " !important" : "");
|
|
138
138
|
}
|
|
@@ -141,47 +141,47 @@ async function O(o, t, n) {
|
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
143
|
function C() {
|
|
144
|
-
g instanceof HTMLTextAreaElement && (
|
|
144
|
+
g instanceof HTMLTextAreaElement && (a.innerHTML = g.value), g instanceof HTMLInputElement && a.setAttribute("value", g.value);
|
|
145
145
|
}
|
|
146
146
|
function U() {
|
|
147
|
-
|
|
148
|
-
const p =
|
|
149
|
-
p &&
|
|
147
|
+
a instanceof SVGElement && (a.setAttribute("xmlns", "http://www.w3.org/2000/svg"), a instanceof SVGRectElement && ["width", "height"].forEach(function(v) {
|
|
148
|
+
const p = a.getAttribute(v);
|
|
149
|
+
p && a.style.setProperty(v, p);
|
|
150
150
|
}));
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
154
|
async function W(o) {
|
|
155
|
-
const
|
|
156
|
-
return o.appendChild(
|
|
155
|
+
const n = await F.resolveAll(), t = document.createElement("style");
|
|
156
|
+
return o.appendChild(t), t.appendChild(document.createTextNode(n)), o;
|
|
157
157
|
}
|
|
158
158
|
function q(o) {
|
|
159
159
|
return N.inlineAll(o).then(function() {
|
|
160
160
|
return o;
|
|
161
161
|
});
|
|
162
162
|
}
|
|
163
|
-
function J(o,
|
|
164
|
-
return Promise.resolve(o).then(function(
|
|
165
|
-
return
|
|
166
|
-
}).then(
|
|
167
|
-
return '<foreignObject x="0" y="0" width="100%" height="100%">' +
|
|
168
|
-
}).then(function(
|
|
169
|
-
return '<svg xmlns="http://www.w3.org/2000/svg" width="' +
|
|
170
|
-
}).then(function(
|
|
171
|
-
return "data:image/svg+xml;charset=utf-8," +
|
|
163
|
+
function J(o, n, t) {
|
|
164
|
+
return Promise.resolve(o).then(function(s) {
|
|
165
|
+
return s.setAttribute("xmlns", "http://www.w3.org/1999/xhtml"), new XMLSerializer().serializeToString(s);
|
|
166
|
+
}).then(d.escapeXhtml).then(function(s) {
|
|
167
|
+
return '<foreignObject x="0" y="0" width="100%" height="100%">' + s + "</foreignObject>";
|
|
168
|
+
}).then(function(s) {
|
|
169
|
+
return '<svg xmlns="http://www.w3.org/2000/svg" width="' + n + '" height="' + t + '">' + s + "</svg>";
|
|
170
|
+
}).then(function(s) {
|
|
171
|
+
return "data:image/svg+xml;charset=utf-8," + s;
|
|
172
172
|
});
|
|
173
173
|
}
|
|
174
174
|
function z() {
|
|
175
175
|
return {
|
|
176
176
|
escape: T,
|
|
177
|
-
parseExtension:
|
|
178
|
-
mimeType:
|
|
179
|
-
dataAsUrl:
|
|
180
|
-
isDataUrl:
|
|
177
|
+
parseExtension: n,
|
|
178
|
+
mimeType: t,
|
|
179
|
+
dataAsUrl: a,
|
|
180
|
+
isDataUrl: s,
|
|
181
181
|
canvasToBlob: r,
|
|
182
|
-
resolveUrl:
|
|
182
|
+
resolveUrl: c,
|
|
183
183
|
getAndEncode: g,
|
|
184
|
-
uid:
|
|
184
|
+
uid: h(),
|
|
185
185
|
delay: x,
|
|
186
186
|
asArray: C,
|
|
187
187
|
escapeXhtml: U,
|
|
@@ -201,18 +201,20 @@ function z() {
|
|
|
201
201
|
jpeg: i,
|
|
202
202
|
gif: "image/gif",
|
|
203
203
|
tiff: "image/tiff",
|
|
204
|
-
svg: "image/svg+xml"
|
|
204
|
+
svg: "image/svg+xml",
|
|
205
|
+
webp: "image/webp",
|
|
206
|
+
avif: "image/avif"
|
|
205
207
|
};
|
|
206
208
|
}
|
|
207
|
-
function
|
|
209
|
+
function n(e) {
|
|
208
210
|
const i = /\.([^\.\/]*?)$/g.exec(e);
|
|
209
211
|
return i ? i[1] : "";
|
|
210
212
|
}
|
|
211
|
-
function
|
|
212
|
-
const i =
|
|
213
|
+
function t(e) {
|
|
214
|
+
const i = n(e).toLowerCase();
|
|
213
215
|
return o()[i] || "";
|
|
214
216
|
}
|
|
215
|
-
function
|
|
217
|
+
function s(e) {
|
|
216
218
|
return e.search(/^(data:)/) !== -1;
|
|
217
219
|
}
|
|
218
220
|
function l(e) {
|
|
@@ -230,13 +232,13 @@ function z() {
|
|
|
230
232
|
e.toBlob(i);
|
|
231
233
|
}) : l(e);
|
|
232
234
|
}
|
|
233
|
-
function
|
|
235
|
+
function c(e, i) {
|
|
234
236
|
const f = document.implementation.createHTMLDocument(), u = f.createElement("base");
|
|
235
237
|
f.head.appendChild(u);
|
|
236
238
|
const y = f.createElement("a");
|
|
237
239
|
return f.body.appendChild(y), u.href = i, y.href = e, y.href;
|
|
238
240
|
}
|
|
239
|
-
function
|
|
241
|
+
function h() {
|
|
240
242
|
let e = 0;
|
|
241
243
|
return function() {
|
|
242
244
|
return "u" + i() + e++;
|
|
@@ -282,7 +284,7 @@ function z() {
|
|
|
282
284
|
}
|
|
283
285
|
});
|
|
284
286
|
}
|
|
285
|
-
function
|
|
287
|
+
function a(e, i) {
|
|
286
288
|
return "data:" + i + ";base64," + e;
|
|
287
289
|
}
|
|
288
290
|
function T(e) {
|
|
@@ -322,48 +324,48 @@ function K() {
|
|
|
322
324
|
const o = /url\(['"]?([^'"]+?)['"]?\)/g;
|
|
323
325
|
return {
|
|
324
326
|
inlineAll: l,
|
|
325
|
-
shouldProcess:
|
|
327
|
+
shouldProcess: n,
|
|
326
328
|
impl: {
|
|
327
|
-
readUrls:
|
|
328
|
-
inline:
|
|
329
|
+
readUrls: t,
|
|
330
|
+
inline: s
|
|
329
331
|
}
|
|
330
332
|
};
|
|
331
|
-
function
|
|
333
|
+
function n(r) {
|
|
332
334
|
return r.search(o) !== -1;
|
|
333
335
|
}
|
|
334
|
-
function
|
|
335
|
-
const
|
|
336
|
-
let
|
|
337
|
-
for (; (
|
|
338
|
-
|
|
339
|
-
return
|
|
340
|
-
return !
|
|
336
|
+
function t(r) {
|
|
337
|
+
const c = [];
|
|
338
|
+
let h;
|
|
339
|
+
for (; (h = o.exec(r)) !== null; )
|
|
340
|
+
c.push(h[1]);
|
|
341
|
+
return c.filter(function(m) {
|
|
342
|
+
return !d.isDataUrl(m);
|
|
341
343
|
});
|
|
342
344
|
}
|
|
343
|
-
function
|
|
344
|
-
return Promise.resolve(
|
|
345
|
-
return
|
|
346
|
-
}).then(m ||
|
|
347
|
-
return
|
|
348
|
-
}).then(function(
|
|
349
|
-
return r.replace(g(
|
|
345
|
+
function s(r, c, h, m) {
|
|
346
|
+
return Promise.resolve(c).then(function(a) {
|
|
347
|
+
return h ? d.resolveUrl(a, h) : a;
|
|
348
|
+
}).then(m || d.getAndEncode).then(function(a) {
|
|
349
|
+
return d.dataAsUrl(a, d.mimeType(c));
|
|
350
|
+
}).then(function(a) {
|
|
351
|
+
return r.replace(g(c), "$1" + a + "$3");
|
|
350
352
|
});
|
|
351
|
-
function g(
|
|
352
|
-
return new RegExp(`(url\\(['"]?)(` +
|
|
353
|
+
function g(a) {
|
|
354
|
+
return new RegExp(`(url\\(['"]?)(` + d.escape(a) + `)(['"]?\\))`, "g");
|
|
353
355
|
}
|
|
354
356
|
}
|
|
355
|
-
function l(r,
|
|
357
|
+
function l(r, c, h) {
|
|
356
358
|
if (m()) return Promise.resolve(r);
|
|
357
|
-
return Promise.resolve(r).then(
|
|
358
|
-
let
|
|
359
|
+
return Promise.resolve(r).then(t).then(function(g) {
|
|
360
|
+
let a = Promise.resolve(r);
|
|
359
361
|
return g.forEach(function(T) {
|
|
360
|
-
|
|
361
|
-
return
|
|
362
|
+
a = a.then(function(x) {
|
|
363
|
+
return s(x, T, c, h);
|
|
362
364
|
});
|
|
363
|
-
}),
|
|
365
|
+
}), a;
|
|
364
366
|
});
|
|
365
367
|
function m() {
|
|
366
|
-
return !
|
|
368
|
+
return !n(r);
|
|
367
369
|
}
|
|
368
370
|
}
|
|
369
371
|
}
|
|
@@ -371,48 +373,48 @@ function Q() {
|
|
|
371
373
|
return {
|
|
372
374
|
resolveAll: o,
|
|
373
375
|
impl: {
|
|
374
|
-
readAll:
|
|
376
|
+
readAll: n
|
|
375
377
|
}
|
|
376
378
|
};
|
|
377
379
|
function o() {
|
|
378
|
-
return
|
|
380
|
+
return n().then(function(t) {
|
|
379
381
|
return Promise.all(
|
|
380
|
-
|
|
381
|
-
return
|
|
382
|
+
t.map(function(s) {
|
|
383
|
+
return s.resolve();
|
|
382
384
|
})
|
|
383
385
|
);
|
|
384
|
-
}).then(function(
|
|
385
|
-
return
|
|
386
|
+
}).then(function(t) {
|
|
387
|
+
return t.join(`
|
|
386
388
|
`);
|
|
387
389
|
});
|
|
388
390
|
}
|
|
389
|
-
function
|
|
390
|
-
return Promise.resolve(
|
|
391
|
+
function n() {
|
|
392
|
+
return Promise.resolve(d.asArray(document.styleSheets)).then(s).then(t).then(function(r) {
|
|
391
393
|
return r.map(l);
|
|
392
394
|
});
|
|
393
|
-
function
|
|
394
|
-
return r.filter(function(
|
|
395
|
-
return
|
|
396
|
-
}).filter(function(
|
|
397
|
-
return
|
|
395
|
+
function t(r) {
|
|
396
|
+
return r.filter(function(c) {
|
|
397
|
+
return c.type === CSSRule.FONT_FACE_RULE;
|
|
398
|
+
}).filter(function(c) {
|
|
399
|
+
return I.shouldProcess(c.style.getPropertyValue("src"));
|
|
398
400
|
});
|
|
399
401
|
}
|
|
400
|
-
function
|
|
401
|
-
const
|
|
402
|
-
return r.forEach(function(
|
|
403
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
402
|
+
function s(r) {
|
|
403
|
+
const c = [];
|
|
404
|
+
return r.forEach(function(h) {
|
|
405
|
+
if (Object.prototype.hasOwnProperty.call(h, "cssRules"))
|
|
404
406
|
try {
|
|
405
|
-
|
|
407
|
+
d.asArray(h.cssRules || []).forEach(c.push.bind(c));
|
|
406
408
|
} catch (m) {
|
|
407
|
-
console.log("Error while reading CSS rules from " +
|
|
409
|
+
console.log("Error while reading CSS rules from " + h.href, m.toString());
|
|
408
410
|
}
|
|
409
|
-
}),
|
|
411
|
+
}), c;
|
|
410
412
|
}
|
|
411
413
|
function l(r) {
|
|
412
414
|
return {
|
|
413
415
|
resolve: function() {
|
|
414
|
-
const
|
|
415
|
-
return
|
|
416
|
+
const h = (r.parentStyleSheet || {}).href;
|
|
417
|
+
return I.inlineAll(r.cssText, h);
|
|
416
418
|
},
|
|
417
419
|
src: function() {
|
|
418
420
|
return r.style.getPropertyValue("src");
|
|
@@ -423,40 +425,53 @@ function Q() {
|
|
|
423
425
|
}
|
|
424
426
|
function Y() {
|
|
425
427
|
return {
|
|
426
|
-
inlineAll:
|
|
428
|
+
inlineAll: n,
|
|
427
429
|
impl: {
|
|
428
430
|
newImage: o
|
|
429
431
|
}
|
|
430
432
|
};
|
|
431
|
-
function o(
|
|
433
|
+
function o(t) {
|
|
432
434
|
return {
|
|
433
|
-
inline:
|
|
435
|
+
inline: s
|
|
434
436
|
};
|
|
435
|
-
function
|
|
436
|
-
return
|
|
437
|
-
return
|
|
437
|
+
function s(l) {
|
|
438
|
+
return d.isDataUrl(t.src) ? Promise.resolve() : Promise.resolve(t.src).then(l || d.getAndEncode).then(function(r) {
|
|
439
|
+
return d.dataAsUrl(r, d.mimeType(t.src));
|
|
438
440
|
}).then(function(r) {
|
|
439
|
-
return new Promise(function(
|
|
440
|
-
|
|
441
|
+
return new Promise(function(c) {
|
|
442
|
+
t.onload = function() {
|
|
443
|
+
c();
|
|
444
|
+
}, t.onerror = function() {
|
|
445
|
+
const h = b.impl.options.imagePlaceholder;
|
|
446
|
+
if (h)
|
|
447
|
+
try {
|
|
448
|
+
t.onload = null, t.onerror = null, t.src = h, t.srcset = "";
|
|
449
|
+
} catch (m) {
|
|
450
|
+
console.error("Image placeholder assignment failed:", m);
|
|
451
|
+
}
|
|
452
|
+
else
|
|
453
|
+
console.warn("Image inline failed, continuing without placeholder:", t.src);
|
|
454
|
+
c();
|
|
455
|
+
}, t.src = r, t.srcset = "";
|
|
441
456
|
});
|
|
442
457
|
});
|
|
443
458
|
}
|
|
444
459
|
}
|
|
445
|
-
function t
|
|
446
|
-
if (!(
|
|
447
|
-
return
|
|
448
|
-
return
|
|
449
|
-
|
|
450
|
-
return
|
|
460
|
+
function n(t) {
|
|
461
|
+
if (!(t instanceof Element)) return Promise.resolve(t);
|
|
462
|
+
return s(t).then(function() {
|
|
463
|
+
return t instanceof HTMLImageElement ? o(t).inline() : Promise.all(
|
|
464
|
+
d.asArray(t.childNodes).map(function(l) {
|
|
465
|
+
return n(l);
|
|
451
466
|
})
|
|
452
467
|
);
|
|
453
468
|
});
|
|
454
|
-
function
|
|
469
|
+
function s(l) {
|
|
455
470
|
const r = l.style.getPropertyValue("background");
|
|
456
|
-
return r ?
|
|
471
|
+
return r ? I.inlineAll(r).then(function(c) {
|
|
457
472
|
l.style.setProperty(
|
|
458
473
|
"background",
|
|
459
|
-
|
|
474
|
+
c,
|
|
460
475
|
l.style.getPropertyPriority("background")
|
|
461
476
|
);
|
|
462
477
|
}).then(function() {
|