@idmwx/idmui-gl4 2.4.7 → 2.4.9

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.
@@ -0,0 +1,92 @@
1
+ import { l as b } from "./index-d0ef10ca.js";
2
+ function M(e) {
3
+ return typeof e == "string" && /^data:image\/svg\+xml/i.test(e);
4
+ }
5
+ function C(e) {
6
+ let r = e.indexOf(",");
7
+ return r >= 0 ? decodeURIComponent(e.slice(r + 1)) : "";
8
+ }
9
+ function v(e) {
10
+ return `data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`;
11
+ }
12
+ function F(e) {
13
+ let r = [], t = "", i = 0;
14
+ for (let o = 0; o < e.length; o++) {
15
+ let n = e[o];
16
+ n === "(" && i++, n === ")" && (i = Math.max(0, i - 1)), n === ";" && i === 0 ? (r.push(t), t = "") : t += n;
17
+ }
18
+ return t.trim() && r.push(t), r.map((o) => o.trim()).filter(Boolean);
19
+ }
20
+ function k(e) {
21
+ let r = [], t = "", i = 0;
22
+ for (let n = 0; n < e.length; n++) {
23
+ let s = e[n];
24
+ s === "(" && i++, s === ")" && (i = Math.max(0, i - 1)), s === "," && i === 0 ? (r.push(t.trim()), t = "") : t += s;
25
+ }
26
+ t.trim() && r.push(t.trim());
27
+ let o = [];
28
+ for (let n of r) {
29
+ if (/\binset\b/i.test(n))
30
+ continue;
31
+ let s = n.match(/-?\d+(?:\.\d+)?px/gi) || [], [l = "0px", a = "0px", m = "0px"] = s, u = n.replace(/-?\d+(?:\.\d+)?px/gi, "").replace(/\binset\b/ig, "").trim().replace(/\s{2,}/g, " "), d = !!u && u !== ",";
32
+ o.push(`drop-shadow(${l} ${a} ${m}${d ? ` ${u}` : ""})`);
33
+ }
34
+ return o.join(" ");
35
+ }
36
+ function y(e) {
37
+ let r = F(e), t = null, i = null, o = null, n = [];
38
+ for (let l of r) {
39
+ let a = l.indexOf(":");
40
+ if (a < 0)
41
+ continue;
42
+ let m = l.slice(0, a).trim().toLowerCase(), u = l.slice(a + 1).trim();
43
+ m === "box-shadow" ? o = u : m === "filter" ? t = u : m === "-webkit-filter" ? i = u : n.push([m, u]);
44
+ }
45
+ if (o) {
46
+ let l = k(o);
47
+ l && (t = t ? `${t} ${l}` : l, i = i ? `${i} ${l}` : l);
48
+ }
49
+ let s = [...n];
50
+ return t && s.push(["filter", t]), i && s.push(["-webkit-filter", i]), s.map(([l, a]) => `${l}:${a}`).join(";");
51
+ }
52
+ function I(e) {
53
+ return e.replace(/([^{}]+)\{([^}]*)\}/g, (r, t, i) => `${t}{${y(i)}}`);
54
+ }
55
+ function N(e) {
56
+ return e = e.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi, (r, t) => r.replace(t, I(t))), e = e.replace(/style=(['"])([\s\S]*?)\1/gi, (r, t, i) => `style=${t}${y(i)}${t}`), e;
57
+ }
58
+ function S(e) {
59
+ if (!b() || !M(e))
60
+ return e;
61
+ try {
62
+ let r = C(e), t = N(r);
63
+ return v(t);
64
+ } catch {
65
+ return e;
66
+ }
67
+ }
68
+ async function R(e, r) {
69
+ let { width: t, height: i, scale: o = 1, dpr: n = 1, meta: s = {}, backgroundColor: l } = r;
70
+ e = S(e);
71
+ let a = new Image();
72
+ a.loading = "eager", a.decoding = "sync", a.crossOrigin = "anonymous", a.src = e, await a.decode();
73
+ let m = a.naturalWidth, u = a.naturalHeight, d = Number.isFinite(s.w0) ? s.w0 : m, x = Number.isFinite(s.h0) ? s.h0 : u, c, f, $ = Number.isFinite(t), w = Number.isFinite(i);
74
+ if ($ && w)
75
+ c = Math.max(1, t), f = Math.max(1, i);
76
+ else if ($) {
77
+ let g = t / Math.max(1, d);
78
+ c = t, f = x * g;
79
+ } else if (w) {
80
+ let g = i / Math.max(1, x);
81
+ f = i, c = d * g;
82
+ } else
83
+ c = m, f = u;
84
+ c = c * o, f = f * o;
85
+ let h = document.createElement("canvas");
86
+ h.width = c * n, h.height = f * n, h.style.width = `${c}px`, h.style.height = `${f}px`;
87
+ let p = h.getContext("2d");
88
+ return n !== 1 && p.scale(n, n), l && (p.save(), p.fillStyle = l, p.fillRect(0, 0, c, f), p.restore()), p.drawImage(a, 0, 0, c, f), h;
89
+ }
90
+ export {
91
+ R as W
92
+ };
@@ -0,0 +1,8 @@
1
+ import { W as a } from "./chunk-3VYIPD3A-5f949d1e.js";
2
+ async function o(r, t) {
3
+ let i = await a(r, t), e = new Image();
4
+ return e.src = i.toDataURL(`image/${t.format}`, t.quality), await e.decode(), e.style.width = `${i.width / t.dpr}px`, e.style.height = `${i.height / t.dpr}px`, e;
5
+ }
6
+ export {
7
+ o as d
8
+ };
@@ -0,0 +1,13 @@
1
+ import { W as m } from "./chunk-3VYIPD3A-5f949d1e.js";
2
+ async function a(n, e) {
3
+ let o = e.type;
4
+ if (o === "svg") {
5
+ let t = decodeURIComponent(n.split(",")[1]);
6
+ return new Blob([t], { type: "image/svg+xml" });
7
+ }
8
+ let i = await m(n, e);
9
+ return new Promise((t) => i.toBlob((l) => t(l), `image/${o}`, e.quality));
10
+ }
11
+ export {
12
+ a as m
13
+ };
@@ -0,0 +1,28 @@
1
+ import { m as d } from "./chunk-T4JIPPZO-5461e68d.js";
2
+ import { W as f } from "./chunk-3VYIPD3A-5f949d1e.js";
3
+ import "./index-d0ef10ca.js";
4
+ import "axios";
5
+ import "vuetify";
6
+ import "vue";
7
+ import "mapbox-gl";
8
+ import "moment";
9
+ import "@idm-plugin/geo";
10
+ import "@idm-plugin/meteo";
11
+ import "echarts";
12
+ import "@turf/turf";
13
+ import "@idm-plugin/tag2";
14
+ import "@mapbox/sphericalmercator";
15
+ import "@idm-plugin/tag";
16
+ async function O(a, o) {
17
+ let p = ((o == null ? void 0 : o.format) || (o == null ? void 0 : o.type) || "").toLowerCase(), e = p === "jpg" ? "jpeg" : p || "png", t = (o == null ? void 0 : o.filename) || `snapdom.${e}`, r = { ...o || {}, format: e, type: e };
18
+ if (r.dpr = 1, e === "svg") {
19
+ let l = await d(a, { ...r, type: "svg" }), n = URL.createObjectURL(l), i = document.createElement("a");
20
+ i.href = n, i.download = t, i.click(), URL.revokeObjectURL(n);
21
+ return;
22
+ }
23
+ let c = await f(a, r), m = document.createElement("a");
24
+ m.href = c.toDataURL(`image/${e}`, o == null ? void 0 : o.quality), m.download = t, m.click();
25
+ }
26
+ export {
27
+ O as download
28
+ };