tds-map-methods 0.1.8 → 0.1.10
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/index.cjs +7 -7
- package/index.js +907 -858
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -9,12 +9,12 @@ import { fromLonLat as rt } from "ol/proj.js";
|
|
|
9
9
|
import Qr from "ol/layer/Tile.js";
|
|
10
10
|
import { TileWMS as An, XYZ as mn } from "ol/source.js";
|
|
11
11
|
import jt from "ol/source/ImageCanvas.js";
|
|
12
|
-
import
|
|
12
|
+
import yt from "ol/layer/Image.js";
|
|
13
13
|
import { contours as Ht } from "d3-contour";
|
|
14
14
|
import Gr from "ol/format/GeoJSON.js";
|
|
15
15
|
import ot from "ol/layer/Vector.js";
|
|
16
|
-
import
|
|
17
|
-
import { Style as
|
|
16
|
+
import Dt from "ol/source/Vector.js";
|
|
17
|
+
import { Style as me, Stroke as he, Fill as ye, Text as wt, Circle as Qt, Icon as pn } from "ol/style.js";
|
|
18
18
|
import Ut from "ol/Feature.js";
|
|
19
19
|
import { LineString as vn, Point as mr } from "ol/geom.js";
|
|
20
20
|
function Hi() {
|
|
@@ -51,7 +51,7 @@ function Dn(n) {
|
|
|
51
51
|
typhoonAuthorization: n.typhoonAuthorization === void 0 ? Ae.typhoonAuthorization : String(n.typhoonAuthorization)
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
|
-
function
|
|
54
|
+
function Ce() {
|
|
55
55
|
return { ...Ae };
|
|
56
56
|
}
|
|
57
57
|
function Ri() {
|
|
@@ -66,7 +66,7 @@ function yn(n) {
|
|
|
66
66
|
function wn(n, e) {
|
|
67
67
|
const t = String(n || "").trim();
|
|
68
68
|
if (!t || yn(t)) return t;
|
|
69
|
-
const r =
|
|
69
|
+
const r = Ce(), i = bn(
|
|
70
70
|
e === void 0 ? r.serviceBaseUrl : e
|
|
71
71
|
);
|
|
72
72
|
return i ? t === i || t.startsWith(i + "/") ? t : i + "/" + t.replace(/^\/+/, "") : t.startsWith("/") ? t : "/" + t;
|
|
@@ -90,7 +90,7 @@ async function En(n) {
|
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
async function ir(n, e = {}) {
|
|
93
|
-
const t =
|
|
93
|
+
const t = Ce(), r = Number(e.timeout ?? t.requestTimeout), i = Cn(e.signal, Number.isFinite(r) ? r : 6e4), o = new Headers(e.headers), u = e.authorization ?? t.serviceAuthorization;
|
|
94
94
|
u && !o.has("Authorization") && o.set("Authorization", u);
|
|
95
95
|
try {
|
|
96
96
|
const s = await fetch(wn(n, e.baseUrl), {
|
|
@@ -179,7 +179,7 @@ function Qi(n, e) {
|
|
|
179
179
|
function Tn(n) {
|
|
180
180
|
return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
|
|
181
181
|
}
|
|
182
|
-
var Rt = { exports: {} },
|
|
182
|
+
var Rt = { exports: {} }, mt = {}, Le = {}, We = {}, vr;
|
|
183
183
|
function Wt() {
|
|
184
184
|
if (vr) return We;
|
|
185
185
|
vr = 1;
|
|
@@ -335,22 +335,22 @@ function jr() {
|
|
|
335
335
|
}
|
|
336
336
|
m.constructor != c && (typeof c != "function" && console.error("unknown Class:" + c), m.constructor = c);
|
|
337
337
|
}
|
|
338
|
-
var h = {}, a = h.ELEMENT_NODE = 1,
|
|
339
|
-
|
|
340
|
-
var C =
|
|
341
|
-
|
|
342
|
-
var
|
|
343
|
-
|
|
344
|
-
var F =
|
|
345
|
-
|
|
346
|
-
function
|
|
338
|
+
var h = {}, a = h.ELEMENT_NODE = 1, v = h.ATTRIBUTE_NODE = 2, y = h.TEXT_NODE = 3, A = h.CDATA_SECTION_NODE = 4, D = h.ENTITY_REFERENCE_NODE = 5, p = h.ENTITY_NODE = 6, E = h.PROCESSING_INSTRUCTION_NODE = 7, P = h.COMMENT_NODE = 8, B = h.DOCUMENT_NODE = 9, S = h.DOCUMENT_TYPE_NODE = 10, X = h.DOCUMENT_FRAGMENT_NODE = 11, O = h.NOTATION_NODE = 12, N = {}, z = {};
|
|
339
|
+
N.INDEX_SIZE_ERR = (z[1] = "Index size error", 1), N.DOMSTRING_SIZE_ERR = (z[2] = "DOMString size error", 2);
|
|
340
|
+
var C = N.HIERARCHY_REQUEST_ERR = (z[3] = "Hierarchy request error", 3);
|
|
341
|
+
N.WRONG_DOCUMENT_ERR = (z[4] = "Wrong document", 4), N.INVALID_CHARACTER_ERR = (z[5] = "Invalid character", 5), N.NO_DATA_ALLOWED_ERR = (z[6] = "No data allowed", 6), N.NO_MODIFICATION_ALLOWED_ERR = (z[7] = "No modification allowed", 7);
|
|
342
|
+
var T = N.NOT_FOUND_ERR = (z[8] = "Not found", 8);
|
|
343
|
+
N.NOT_SUPPORTED_ERR = (z[9] = "Not supported", 9);
|
|
344
|
+
var F = N.INUSE_ATTRIBUTE_ERR = (z[10] = "Attribute in use", 10);
|
|
345
|
+
N.INVALID_STATE_ERR = (z[11] = "Invalid state", 11), N.SYNTAX_ERR = (z[12] = "Syntax error", 12), N.INVALID_MODIFICATION_ERR = (z[13] = "Invalid modification", 13), N.NAMESPACE_ERR = (z[14] = "Invalid namespace", 14), N.INVALID_ACCESS_ERR = (z[15] = "Invalid access", 15);
|
|
346
|
+
function M(c, f) {
|
|
347
347
|
if (f instanceof Error)
|
|
348
348
|
var m = f;
|
|
349
349
|
else
|
|
350
|
-
m = this, Error.call(this, z[c]), this.message = z[c], Error.captureStackTrace && Error.captureStackTrace(this,
|
|
350
|
+
m = this, Error.call(this, z[c]), this.message = z[c], Error.captureStackTrace && Error.captureStackTrace(this, M);
|
|
351
351
|
return m.code = c, f && (this.message = this.message + ": " + f), m;
|
|
352
352
|
}
|
|
353
|
-
|
|
353
|
+
M.prototype = Error.prototype, l(N, M);
|
|
354
354
|
function R() {
|
|
355
355
|
}
|
|
356
356
|
R.prototype = {
|
|
@@ -393,9 +393,9 @@ function jr() {
|
|
|
393
393
|
}
|
|
394
394
|
};
|
|
395
395
|
function g(c, f) {
|
|
396
|
-
this._node = c, this._refresh = f,
|
|
396
|
+
this._node = c, this._refresh = f, b(this);
|
|
397
397
|
}
|
|
398
|
-
function
|
|
398
|
+
function b(c) {
|
|
399
399
|
var f = c._node._inc || c._node.ownerDocument._inc;
|
|
400
400
|
if (c._inc !== f) {
|
|
401
401
|
var m = c._refresh(c._node);
|
|
@@ -406,7 +406,7 @@ function jr() {
|
|
|
406
406
|
}
|
|
407
407
|
}
|
|
408
408
|
g.prototype.item = function(c) {
|
|
409
|
-
return
|
|
409
|
+
return b(this), this[c] || null;
|
|
410
410
|
}, d(g, R);
|
|
411
411
|
function w() {
|
|
412
412
|
}
|
|
@@ -432,7 +432,7 @@ function jr() {
|
|
|
432
432
|
k && (K(k, c, m), m.ownerElement = null);
|
|
433
433
|
}
|
|
434
434
|
} else
|
|
435
|
-
throw new
|
|
435
|
+
throw new M(T, new Error(c.tagName + "@" + m));
|
|
436
436
|
}
|
|
437
437
|
w.prototype = {
|
|
438
438
|
length: 0,
|
|
@@ -447,7 +447,7 @@ function jr() {
|
|
|
447
447
|
setNamedItem: function(c) {
|
|
448
448
|
var f = c.ownerElement;
|
|
449
449
|
if (f && f != this._ownerElement)
|
|
450
|
-
throw new
|
|
450
|
+
throw new M(F);
|
|
451
451
|
var m = this.getNamedItem(c.nodeName);
|
|
452
452
|
return I(this._ownerElement, this, c, m), m;
|
|
453
453
|
},
|
|
@@ -455,7 +455,7 @@ function jr() {
|
|
|
455
455
|
setNamedItemNS: function(c) {
|
|
456
456
|
var f = c.ownerElement, m;
|
|
457
457
|
if (f && f != this._ownerElement)
|
|
458
|
-
throw new
|
|
458
|
+
throw new M(F);
|
|
459
459
|
return m = this.getNamedItemNS(c.namespaceURI, c.localName), I(this._ownerElement, this, c, m), m;
|
|
460
460
|
},
|
|
461
461
|
/* returns Node */
|
|
@@ -575,7 +575,7 @@ function jr() {
|
|
|
575
575
|
return le(this, c, f);
|
|
576
576
|
},
|
|
577
577
|
replaceChild: function(c, f) {
|
|
578
|
-
le(this, c, f,
|
|
578
|
+
le(this, c, f, ve), f && this.removeChild(f);
|
|
579
579
|
},
|
|
580
580
|
removeChild: function(c) {
|
|
581
581
|
return U(this, c);
|
|
@@ -626,7 +626,7 @@ function jr() {
|
|
|
626
626
|
if (Object.prototype.hasOwnProperty.call(m, x) && m[x] === c)
|
|
627
627
|
return x;
|
|
628
628
|
}
|
|
629
|
-
f = f.nodeType ==
|
|
629
|
+
f = f.nodeType == v ? f.ownerDocument : f.parentNode;
|
|
630
630
|
}
|
|
631
631
|
return null;
|
|
632
632
|
},
|
|
@@ -636,7 +636,7 @@ function jr() {
|
|
|
636
636
|
var m = f._nsMap;
|
|
637
637
|
if (m && Object.prototype.hasOwnProperty.call(m, c))
|
|
638
638
|
return m[c];
|
|
639
|
-
f = f.nodeType ==
|
|
639
|
+
f = f.nodeType == v ? f.ownerDocument : f.parentNode;
|
|
640
640
|
}
|
|
641
641
|
return null;
|
|
642
642
|
},
|
|
@@ -711,7 +711,7 @@ function jr() {
|
|
|
711
711
|
var x = e(m, _);
|
|
712
712
|
return !(f && x && m.indexOf(x) > m.indexOf(f));
|
|
713
713
|
}
|
|
714
|
-
function
|
|
714
|
+
function de(c, f) {
|
|
715
715
|
var m = c.childNodes || [];
|
|
716
716
|
function x(k) {
|
|
717
717
|
return $(k) && k !== f;
|
|
@@ -723,9 +723,9 @@ function jr() {
|
|
|
723
723
|
}
|
|
724
724
|
function ue(c, f, m) {
|
|
725
725
|
if (!te(c))
|
|
726
|
-
throw new
|
|
726
|
+
throw new M(C, "Unexpected parent node type " + c.nodeType);
|
|
727
727
|
if (m && m.parentNode !== c)
|
|
728
|
-
throw new
|
|
728
|
+
throw new M(T, "child not in parent");
|
|
729
729
|
if (
|
|
730
730
|
// 4. If `node` is not a DocumentFragment, DocumentType, Element, or CharacterData node, then throw a "HierarchyRequestError" DOMException.
|
|
731
731
|
!se(f) || // 5. If either `node` is a Text node and `parent` is a document,
|
|
@@ -734,55 +734,55 @@ function jr() {
|
|
|
734
734
|
// or `node` is a doctype and `parent` is not a document, then throw a "HierarchyRequestError" DOMException.
|
|
735
735
|
_(f) && c.nodeType !== Q.DOCUMENT_NODE
|
|
736
736
|
)
|
|
737
|
-
throw new
|
|
737
|
+
throw new M(
|
|
738
738
|
C,
|
|
739
739
|
"Unexpected node type " + f.nodeType + " for parent node type " + c.nodeType
|
|
740
740
|
);
|
|
741
741
|
}
|
|
742
|
-
function
|
|
742
|
+
function pe(c, f, m) {
|
|
743
743
|
var x = c.childNodes || [], q = f.childNodes || [];
|
|
744
744
|
if (f.nodeType === Q.DOCUMENT_FRAGMENT_NODE) {
|
|
745
745
|
var k = q.filter($);
|
|
746
746
|
if (k.length > 1 || e(q, ae))
|
|
747
|
-
throw new
|
|
747
|
+
throw new M(C, "More than one element or text in fragment");
|
|
748
748
|
if (k.length === 1 && !ne(c, m))
|
|
749
|
-
throw new
|
|
749
|
+
throw new M(C, "Element in fragment can not be inserted before doctype");
|
|
750
750
|
}
|
|
751
751
|
if ($(f) && !ne(c, m))
|
|
752
|
-
throw new
|
|
752
|
+
throw new M(C, "Only one element can be added and only after doctype");
|
|
753
753
|
if (_(f)) {
|
|
754
754
|
if (e(x, _))
|
|
755
|
-
throw new
|
|
755
|
+
throw new M(C, "Only one doctype is allowed");
|
|
756
756
|
var re = e(x, $);
|
|
757
757
|
if (m && x.indexOf(re) < x.indexOf(m))
|
|
758
|
-
throw new
|
|
758
|
+
throw new M(C, "Doctype can only be inserted before an element");
|
|
759
759
|
if (!m && re)
|
|
760
|
-
throw new
|
|
760
|
+
throw new M(C, "Doctype can not be appended since element is present");
|
|
761
761
|
}
|
|
762
762
|
}
|
|
763
|
-
function
|
|
763
|
+
function ve(c, f, m) {
|
|
764
764
|
var x = c.childNodes || [], q = f.childNodes || [];
|
|
765
765
|
if (f.nodeType === Q.DOCUMENT_FRAGMENT_NODE) {
|
|
766
766
|
var k = q.filter($);
|
|
767
767
|
if (k.length > 1 || e(q, ae))
|
|
768
|
-
throw new
|
|
769
|
-
if (k.length === 1 && !
|
|
770
|
-
throw new
|
|
768
|
+
throw new M(C, "More than one element or text in fragment");
|
|
769
|
+
if (k.length === 1 && !de(c, m))
|
|
770
|
+
throw new M(C, "Element in fragment can not be inserted before doctype");
|
|
771
771
|
}
|
|
772
|
-
if ($(f) && !
|
|
773
|
-
throw new
|
|
772
|
+
if ($(f) && !de(c, m))
|
|
773
|
+
throw new M(C, "Only one element can be added and only after doctype");
|
|
774
774
|
if (_(f)) {
|
|
775
|
-
if (e(x, function(
|
|
776
|
-
return _(
|
|
775
|
+
if (e(x, function(be) {
|
|
776
|
+
return _(be) && be !== m;
|
|
777
777
|
}))
|
|
778
|
-
throw new
|
|
778
|
+
throw new M(C, "Only one doctype is allowed");
|
|
779
779
|
var re = e(x, $);
|
|
780
780
|
if (m && x.indexOf(re) < x.indexOf(m))
|
|
781
|
-
throw new
|
|
781
|
+
throw new M(C, "Doctype can only be inserted before an element");
|
|
782
782
|
}
|
|
783
783
|
}
|
|
784
784
|
function le(c, f, m, x) {
|
|
785
|
-
ue(c, f, m), c.nodeType === Q.DOCUMENT_NODE && (x ||
|
|
785
|
+
ue(c, f, m), c.nodeType === Q.DOCUMENT_NODE && (x || pe)(c, f, m);
|
|
786
786
|
var q = f.parentNode;
|
|
787
787
|
if (q && q.removeChild(f), f.nodeType === X) {
|
|
788
788
|
var k = f.firstChild;
|
|
@@ -795,12 +795,12 @@ function jr() {
|
|
|
795
795
|
k.previousSibling = fe, re.nextSibling = m, fe ? fe.nextSibling = k : c.firstChild = k, m == null ? c.lastChild = re : m.previousSibling = re;
|
|
796
796
|
do {
|
|
797
797
|
k.parentNode = c;
|
|
798
|
-
var
|
|
799
|
-
|
|
798
|
+
var be = c.ownerDocument || c;
|
|
799
|
+
De(k, be);
|
|
800
800
|
} while (k !== re && (k = k.nextSibling));
|
|
801
801
|
return Z(c.ownerDocument || c, c), f.nodeType == X && (f.firstChild = f.lastChild = null), f;
|
|
802
802
|
}
|
|
803
|
-
function
|
|
803
|
+
function De(c, f) {
|
|
804
804
|
if (c.ownerDocument !== f) {
|
|
805
805
|
if (c.ownerDocument = f, c.nodeType === a && c.attributes)
|
|
806
806
|
for (var m = 0; m < c.attributes.length; m++) {
|
|
@@ -808,13 +808,13 @@ function jr() {
|
|
|
808
808
|
x && (x.ownerDocument = f);
|
|
809
809
|
}
|
|
810
810
|
for (var q = c.firstChild; q; )
|
|
811
|
-
|
|
811
|
+
De(q, f), q = q.nextSibling;
|
|
812
812
|
}
|
|
813
813
|
}
|
|
814
814
|
function ee(c, f) {
|
|
815
815
|
f.parentNode && f.parentNode.removeChild(f), f.parentNode = c, f.previousSibling = c.lastChild, f.nextSibling = null, f.previousSibling ? f.previousSibling.nextSibling = f : c.firstChild = f, c.lastChild = f, Z(c.ownerDocument, c, f);
|
|
816
816
|
var m = c.ownerDocument || c;
|
|
817
|
-
return
|
|
817
|
+
return De(f, m), f;
|
|
818
818
|
}
|
|
819
819
|
j.prototype = {
|
|
820
820
|
//implementation : null,
|
|
@@ -837,17 +837,17 @@ function jr() {
|
|
|
837
837
|
}
|
|
838
838
|
return c;
|
|
839
839
|
}
|
|
840
|
-
return le(this, c, f),
|
|
840
|
+
return le(this, c, f), De(c, this), this.documentElement === null && c.nodeType === a && (this.documentElement = c), c;
|
|
841
841
|
},
|
|
842
842
|
removeChild: function(c) {
|
|
843
843
|
return this.documentElement == c && (this.documentElement = null), U(this, c);
|
|
844
844
|
},
|
|
845
845
|
replaceChild: function(c, f) {
|
|
846
|
-
le(this, c, f,
|
|
846
|
+
le(this, c, f, ve), De(c, this), f && this.removeChild(f), $(c) && (this.documentElement = c);
|
|
847
847
|
},
|
|
848
848
|
// Introduced in DOM Level 2:
|
|
849
849
|
importNode: function(c, f) {
|
|
850
|
-
return
|
|
850
|
+
return gt(this, c, f);
|
|
851
851
|
},
|
|
852
852
|
// Introduced in DOM Level 2:
|
|
853
853
|
getElementById: function(c) {
|
|
@@ -909,11 +909,11 @@ function jr() {
|
|
|
909
909
|
return f.ownerDocument = this, f.appendData(c), f;
|
|
910
910
|
},
|
|
911
911
|
createComment: function(c) {
|
|
912
|
-
var f = new
|
|
912
|
+
var f = new at();
|
|
913
913
|
return f.ownerDocument = this, f.appendData(c), f;
|
|
914
914
|
},
|
|
915
915
|
createCDATASection: function(c) {
|
|
916
|
-
var f = new
|
|
916
|
+
var f = new ct();
|
|
917
917
|
return f.ownerDocument = this, f.appendData(c), f;
|
|
918
918
|
},
|
|
919
919
|
createProcessingInstruction: function(c, f) {
|
|
@@ -1013,10 +1013,10 @@ function jr() {
|
|
|
1013
1013
|
}, j.prototype.getElementsByTagName = oe.prototype.getElementsByTagName, j.prototype.getElementsByTagNameNS = oe.prototype.getElementsByTagNameNS, d(oe, Q);
|
|
1014
1014
|
function Pe() {
|
|
1015
1015
|
}
|
|
1016
|
-
Pe.prototype.nodeType =
|
|
1017
|
-
function
|
|
1016
|
+
Pe.prototype.nodeType = v, d(Pe, Q);
|
|
1017
|
+
function Ee() {
|
|
1018
1018
|
}
|
|
1019
|
-
|
|
1019
|
+
Ee.prototype = {
|
|
1020
1020
|
data: "",
|
|
1021
1021
|
substringData: function(c, f) {
|
|
1022
1022
|
return this.data.substring(c, c + f);
|
|
@@ -1037,7 +1037,7 @@ function jr() {
|
|
|
1037
1037
|
var x = this.data.substring(0, c), q = this.data.substring(c + f);
|
|
1038
1038
|
m = x + m + q, this.nodeValue = this.data = m, this.length = m.length;
|
|
1039
1039
|
}
|
|
1040
|
-
}, d(
|
|
1040
|
+
}, d(Ee, Q);
|
|
1041
1041
|
function Fe() {
|
|
1042
1042
|
}
|
|
1043
1043
|
Fe.prototype = {
|
|
@@ -1049,31 +1049,31 @@ function jr() {
|
|
|
1049
1049
|
var x = this.ownerDocument.createTextNode(m);
|
|
1050
1050
|
return this.parentNode && this.parentNode.insertBefore(x, this.nextSibling), x;
|
|
1051
1051
|
}
|
|
1052
|
-
}, d(Fe,
|
|
1053
|
-
function st() {
|
|
1054
|
-
}
|
|
1055
|
-
st.prototype = {
|
|
1056
|
-
nodeName: "#comment",
|
|
1057
|
-
nodeType: N
|
|
1058
|
-
}, d(st, Ce);
|
|
1052
|
+
}, d(Fe, Ee);
|
|
1059
1053
|
function at() {
|
|
1060
1054
|
}
|
|
1061
1055
|
at.prototype = {
|
|
1056
|
+
nodeName: "#comment",
|
|
1057
|
+
nodeType: P
|
|
1058
|
+
}, d(at, Ee);
|
|
1059
|
+
function ct() {
|
|
1060
|
+
}
|
|
1061
|
+
ct.prototype = {
|
|
1062
1062
|
nodeName: "#cdata-section",
|
|
1063
1063
|
nodeType: A
|
|
1064
|
-
}, d(
|
|
1064
|
+
}, d(ct, Ee);
|
|
1065
1065
|
function qe() {
|
|
1066
1066
|
}
|
|
1067
1067
|
qe.prototype.nodeType = S, d(qe, Q);
|
|
1068
|
-
function
|
|
1068
|
+
function lt() {
|
|
1069
1069
|
}
|
|
1070
|
-
|
|
1070
|
+
lt.prototype.nodeType = O, d(lt, Q);
|
|
1071
1071
|
function Qe() {
|
|
1072
1072
|
}
|
|
1073
1073
|
Qe.prototype.nodeType = p, d(Qe, Q);
|
|
1074
1074
|
function Se() {
|
|
1075
1075
|
}
|
|
1076
|
-
Se.prototype.nodeType =
|
|
1076
|
+
Se.prototype.nodeType = D, d(Se, Q);
|
|
1077
1077
|
function Ze() {
|
|
1078
1078
|
}
|
|
1079
1079
|
Ze.prototype.nodeName = "#document-fragment", Ze.prototype.nodeType = X, d(Ze, Q);
|
|
@@ -1083,9 +1083,9 @@ function jr() {
|
|
|
1083
1083
|
function Ke() {
|
|
1084
1084
|
}
|
|
1085
1085
|
Ke.prototype.serializeToString = function(c, f, m) {
|
|
1086
|
-
return
|
|
1087
|
-
}, Q.prototype.toString =
|
|
1088
|
-
function
|
|
1086
|
+
return ft.call(c, f, m);
|
|
1087
|
+
}, Q.prototype.toString = ft;
|
|
1088
|
+
function ft(c, f) {
|
|
1089
1089
|
var m = [], x = this.nodeType == 9 && this.documentElement || this, q = x.prefix, k = x.namespaceURI;
|
|
1090
1090
|
if (k && q == null) {
|
|
1091
1091
|
var q = x.lookupPrefix(k);
|
|
@@ -1097,7 +1097,7 @@ function jr() {
|
|
|
1097
1097
|
}
|
|
1098
1098
|
return Oe(this, m, c, f, re), m.join("");
|
|
1099
1099
|
}
|
|
1100
|
-
function
|
|
1100
|
+
function ht(c, f, m) {
|
|
1101
1101
|
var x = c.prefix || "", q = c.namespaceURI;
|
|
1102
1102
|
if (!q || x === "xml" && q === t.XML || q === t.XMLNS)
|
|
1103
1103
|
return !1;
|
|
@@ -1108,7 +1108,7 @@ function jr() {
|
|
|
1108
1108
|
}
|
|
1109
1109
|
return !0;
|
|
1110
1110
|
}
|
|
1111
|
-
function
|
|
1111
|
+
function dt(c, f, m) {
|
|
1112
1112
|
c.push(" ", f, '="', m.replace(/[<>&"\t\n\r]/g, J), '"');
|
|
1113
1113
|
}
|
|
1114
1114
|
function Oe(c, f, m, x, q) {
|
|
@@ -1124,7 +1124,7 @@ function jr() {
|
|
|
1124
1124
|
case a:
|
|
1125
1125
|
var k = c.attributes, re = k.length, ce = c.firstChild, fe = c.tagName;
|
|
1126
1126
|
m = t.isHTML(c.namespaceURI) || m;
|
|
1127
|
-
var
|
|
1127
|
+
var be = fe;
|
|
1128
1128
|
if (!m && !c.prefix && c.namespaceURI) {
|
|
1129
1129
|
for (var Xe, Te = 0; Te < k.length; Te++)
|
|
1130
1130
|
if (k.item(Te).name === "xmlns") {
|
|
@@ -1143,27 +1143,27 @@ function jr() {
|
|
|
1143
1143
|
for (var Ge = q.length - 1; Ge >= 0; Ge--) {
|
|
1144
1144
|
var Ve = q[Ge];
|
|
1145
1145
|
if (Ve.namespace === c.namespaceURI) {
|
|
1146
|
-
Ve.prefix && (
|
|
1146
|
+
Ve.prefix && (be = Ve.prefix + ":" + fe);
|
|
1147
1147
|
break;
|
|
1148
1148
|
}
|
|
1149
1149
|
}
|
|
1150
1150
|
}
|
|
1151
|
-
f.push("<",
|
|
1151
|
+
f.push("<", be);
|
|
1152
1152
|
for (var ke = 0; ke < re; ke++) {
|
|
1153
|
-
var
|
|
1154
|
-
|
|
1153
|
+
var Be = k.item(ke);
|
|
1154
|
+
Be.prefix == "xmlns" ? q.push({ prefix: Be.localName, namespace: Be.value }) : Be.nodeName == "xmlns" && q.push({ prefix: "", namespace: Be.value });
|
|
1155
1155
|
}
|
|
1156
1156
|
for (var ke = 0; ke < re; ke++) {
|
|
1157
|
-
var
|
|
1158
|
-
if (
|
|
1159
|
-
var je =
|
|
1160
|
-
|
|
1157
|
+
var Be = k.item(ke);
|
|
1158
|
+
if (ht(Be, m, q)) {
|
|
1159
|
+
var je = Be.prefix || "", At = Be.namespaceURI;
|
|
1160
|
+
dt(f, je ? "xmlns:" + je : "xmlns", At), q.push({ prefix: je, namespace: At });
|
|
1161
1161
|
}
|
|
1162
|
-
Oe(
|
|
1162
|
+
Oe(Be, f, m, x, q);
|
|
1163
1163
|
}
|
|
1164
|
-
if (fe ===
|
|
1165
|
-
var je = c.prefix || "",
|
|
1166
|
-
|
|
1164
|
+
if (fe === be && ht(c, m, q)) {
|
|
1165
|
+
var je = c.prefix || "", At = c.namespaceURI;
|
|
1166
|
+
dt(f, je ? "xmlns:" + je : "xmlns", At), q.push({ prefix: je, namespace: At });
|
|
1167
1167
|
}
|
|
1168
1168
|
if (ce || m && !/^(?:meta|link|img|br|hr|input)$/i.test(fe)) {
|
|
1169
1169
|
if (f.push(">"), m && /^script$/i.test(fe))
|
|
@@ -1172,7 +1172,7 @@ function jr() {
|
|
|
1172
1172
|
else
|
|
1173
1173
|
for (; ce; )
|
|
1174
1174
|
Oe(ce, f, m, x, q.slice()), ce = ce.nextSibling;
|
|
1175
|
-
f.push("</",
|
|
1175
|
+
f.push("</", be, ">");
|
|
1176
1176
|
} else
|
|
1177
1177
|
f.push("/>");
|
|
1178
1178
|
return;
|
|
@@ -1181,15 +1181,15 @@ function jr() {
|
|
|
1181
1181
|
for (var ce = c.firstChild; ce; )
|
|
1182
1182
|
Oe(ce, f, m, x, q.slice()), ce = ce.nextSibling;
|
|
1183
1183
|
return;
|
|
1184
|
-
case
|
|
1185
|
-
return
|
|
1184
|
+
case v:
|
|
1185
|
+
return dt(f, c.name, c.value);
|
|
1186
1186
|
case y:
|
|
1187
1187
|
return f.push(
|
|
1188
1188
|
c.data.replace(/[<&>]/g, J)
|
|
1189
1189
|
);
|
|
1190
1190
|
case A:
|
|
1191
1191
|
return f.push("<![CDATA[", c.data, "]]>");
|
|
1192
|
-
case
|
|
1192
|
+
case P:
|
|
1193
1193
|
return f.push("<!--", c.data, "-->");
|
|
1194
1194
|
case S:
|
|
1195
1195
|
var dr = c.publicId, $e = c.systemId;
|
|
@@ -1204,7 +1204,7 @@ function jr() {
|
|
|
1204
1204
|
return;
|
|
1205
1205
|
case E:
|
|
1206
1206
|
return f.push("<?", c.target, " ", c.data, "?>");
|
|
1207
|
-
case
|
|
1207
|
+
case D:
|
|
1208
1208
|
return f.push("&", c.nodeName, ";");
|
|
1209
1209
|
//case ENTITY_NODE:
|
|
1210
1210
|
//case NOTATION_NODE:
|
|
@@ -1212,7 +1212,7 @@ function jr() {
|
|
|
1212
1212
|
f.push("??", c.nodeName);
|
|
1213
1213
|
}
|
|
1214
1214
|
}
|
|
1215
|
-
function
|
|
1215
|
+
function gt(c, f, m) {
|
|
1216
1216
|
var x;
|
|
1217
1217
|
switch (f.nodeType) {
|
|
1218
1218
|
case a:
|
|
@@ -1224,13 +1224,13 @@ function jr() {
|
|
|
1224
1224
|
//}
|
|
1225
1225
|
case X:
|
|
1226
1226
|
break;
|
|
1227
|
-
case
|
|
1227
|
+
case v:
|
|
1228
1228
|
m = !0;
|
|
1229
1229
|
break;
|
|
1230
1230
|
}
|
|
1231
1231
|
if (x || (x = f.cloneNode(!1)), x.ownerDocument = c, x.parentNode = null, m)
|
|
1232
1232
|
for (var q = f.firstChild; q; )
|
|
1233
|
-
x.appendChild(
|
|
1233
|
+
x.appendChild(gt(c, q, m)), q = q.nextSibling;
|
|
1234
1234
|
return x;
|
|
1235
1235
|
}
|
|
1236
1236
|
function _e(c, f, m) {
|
|
@@ -1242,12 +1242,12 @@ function jr() {
|
|
|
1242
1242
|
}
|
|
1243
1243
|
switch (f.childNodes && (x.childNodes = new R()), x.ownerDocument = c, x.nodeType) {
|
|
1244
1244
|
case a:
|
|
1245
|
-
var re = f.attributes, fe = x.attributes = new w(),
|
|
1245
|
+
var re = f.attributes, fe = x.attributes = new w(), be = re.length;
|
|
1246
1246
|
fe._ownerElement = x;
|
|
1247
|
-
for (var Xe = 0; Xe <
|
|
1247
|
+
for (var Xe = 0; Xe < be; Xe++)
|
|
1248
1248
|
x.setAttributeNode(_e(c, re.item(Xe), !0));
|
|
1249
1249
|
break;
|
|
1250
|
-
case
|
|
1250
|
+
case v:
|
|
1251
1251
|
m = !0;
|
|
1252
1252
|
}
|
|
1253
1253
|
if (m)
|
|
@@ -1274,7 +1274,7 @@ function jr() {
|
|
|
1274
1274
|
};
|
|
1275
1275
|
Object.defineProperty(g.prototype, "length", {
|
|
1276
1276
|
get: function() {
|
|
1277
|
-
return
|
|
1277
|
+
return b(this), this.$$length;
|
|
1278
1278
|
}
|
|
1279
1279
|
}), Object.defineProperty(Q.prototype, "textContent", {
|
|
1280
1280
|
get: function() {
|
|
@@ -1298,9 +1298,9 @@ function jr() {
|
|
|
1298
1298
|
}
|
|
1299
1299
|
} catch {
|
|
1300
1300
|
}
|
|
1301
|
-
return Le.DocumentType = qe, Le.DOMException =
|
|
1301
|
+
return Le.DocumentType = qe, Le.DOMException = M, Le.DOMImplementation = G, Le.Element = oe, Le.Node = Q, Le.NodeList = R, Le.XMLSerializer = Ke, Le;
|
|
1302
1302
|
}
|
|
1303
|
-
var
|
|
1303
|
+
var pt = {}, Jt = {}, br;
|
|
1304
1304
|
function Ln() {
|
|
1305
1305
|
return br || (br = 1, (function(n) {
|
|
1306
1306
|
var e = Wt().freeze;
|
|
@@ -3445,25 +3445,25 @@ function Fn() {
|
|
|
3445
3445
|
if (yr) return xt;
|
|
3446
3446
|
yr = 1;
|
|
3447
3447
|
var n = Wt().NAMESPACE, e = /[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/, t = new RegExp("[\\-\\.0-9" + e.source.slice(1, -1) + "\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"), r = new RegExp("^" + e.source + t.source + "*(?::" + e.source + t.source + "*)?$"), i = 0, o = 1, u = 2, s = 3, l = 4, d = 5, h = 6, a = 7;
|
|
3448
|
-
function
|
|
3449
|
-
this.message = C, this.locator =
|
|
3448
|
+
function v(C, T) {
|
|
3449
|
+
this.message = C, this.locator = T, Error.captureStackTrace && Error.captureStackTrace(this, v);
|
|
3450
3450
|
}
|
|
3451
|
-
|
|
3451
|
+
v.prototype = new Error(), v.prototype.name = v.name;
|
|
3452
3452
|
function y() {
|
|
3453
3453
|
}
|
|
3454
3454
|
y.prototype = {
|
|
3455
|
-
parse: function(C,
|
|
3456
|
-
var
|
|
3457
|
-
|
|
3455
|
+
parse: function(C, T, F) {
|
|
3456
|
+
var M = this.domBuilder;
|
|
3457
|
+
M.startDocument(), S(T, T = {}), A(
|
|
3458
3458
|
C,
|
|
3459
|
-
|
|
3459
|
+
T,
|
|
3460
3460
|
F,
|
|
3461
|
-
|
|
3461
|
+
M,
|
|
3462
3462
|
this.errorHandler
|
|
3463
|
-
),
|
|
3463
|
+
), M.endDocument();
|
|
3464
3464
|
}
|
|
3465
3465
|
};
|
|
3466
|
-
function A(C,
|
|
3466
|
+
function A(C, T, F, M, R) {
|
|
3467
3467
|
function g(ee) {
|
|
3468
3468
|
if (ee > 65535) {
|
|
3469
3469
|
ee -= 65536;
|
|
@@ -3472,14 +3472,14 @@ function Fn() {
|
|
|
3472
3472
|
} else
|
|
3473
3473
|
return String.fromCharCode(ee);
|
|
3474
3474
|
}
|
|
3475
|
-
function
|
|
3475
|
+
function b(ee) {
|
|
3476
3476
|
var oe = ee.slice(1, -1);
|
|
3477
3477
|
return Object.hasOwnProperty.call(F, oe) ? F[oe] : oe.charAt(0) === "#" ? g(parseInt(oe.substr(1).replace("x", "0x"))) : (R.error("entity not found:" + ee), ee);
|
|
3478
3478
|
}
|
|
3479
3479
|
function w(ee) {
|
|
3480
3480
|
if (ee > j) {
|
|
3481
|
-
var oe = C.substring(j, ee).replace(/&#?\w+;/g,
|
|
3482
|
-
Q && L(j),
|
|
3481
|
+
var oe = C.substring(j, ee).replace(/&#?\w+;/g, b);
|
|
3482
|
+
Q && L(j), M.characters(oe, 0, ee - j), j = ee;
|
|
3483
3483
|
}
|
|
3484
3484
|
}
|
|
3485
3485
|
function L(ee, oe) {
|
|
@@ -3487,13 +3487,13 @@ function Fn() {
|
|
|
3487
3487
|
I = oe.index, H = I + oe[0].length, Q.lineNumber++;
|
|
3488
3488
|
Q.columnNumber = ee - I + 1;
|
|
3489
3489
|
}
|
|
3490
|
-
for (var I = 0, H = 0, G = /.*(?:\r\n?|\n)|.*$/g, Q =
|
|
3490
|
+
for (var I = 0, H = 0, G = /.*(?:\r\n?|\n)|.*$/g, Q = M.locator, J = [{ currentNSMap: T }], Y = {}, j = 0; ; ) {
|
|
3491
3491
|
try {
|
|
3492
3492
|
var W = C.indexOf("<", j);
|
|
3493
3493
|
if (W < 0) {
|
|
3494
3494
|
if (!C.substr(j).match(/^\s*$/)) {
|
|
3495
|
-
var K =
|
|
3496
|
-
K.appendChild(Z),
|
|
3495
|
+
var K = M.doc, Z = K.createTextNode(C.substr(j));
|
|
3496
|
+
K.appendChild(Z), M.currentElement = Z;
|
|
3497
3497
|
}
|
|
3498
3498
|
return;
|
|
3499
3499
|
}
|
|
@@ -3503,9 +3503,9 @@ function Fn() {
|
|
|
3503
3503
|
ue < 0 ? (U = C.substring(W + 2).replace(/[\s<].*/, ""), R.error("end tag name: " + U + " is not complete:" + te.tagName), ue = W + 1 + U.length) : U.match(/\s</) && (U = U.replace(/[\s<].*/, ""), R.error("end tag name: " + U + " maybe not complete"), ue = W + 1 + U.length);
|
|
3504
3504
|
var se = te.localNSMap, _ = te.tagName == U, $ = _ || te.tagName && te.tagName.toLowerCase() == U.toLowerCase();
|
|
3505
3505
|
if ($) {
|
|
3506
|
-
if (
|
|
3506
|
+
if (M.endElement(te.uri, te.localName, U), se)
|
|
3507
3507
|
for (var ae in se)
|
|
3508
|
-
Object.prototype.hasOwnProperty.call(se, ae) &&
|
|
3508
|
+
Object.prototype.hasOwnProperty.call(se, ae) && M.endPrefixMapping(ae);
|
|
3509
3509
|
_ || R.fatalError("end tag name: " + U + " is not match the current start tagName:" + te.tagName);
|
|
3510
3510
|
} else
|
|
3511
3511
|
J.push(te);
|
|
@@ -3513,37 +3513,37 @@ function Fn() {
|
|
|
3513
3513
|
break;
|
|
3514
3514
|
// end elment
|
|
3515
3515
|
case "?":
|
|
3516
|
-
Q && L(W), ue =
|
|
3516
|
+
Q && L(W), ue = O(C, W, M);
|
|
3517
3517
|
break;
|
|
3518
3518
|
case "!":
|
|
3519
|
-
Q && L(W), ue = X(C, W,
|
|
3519
|
+
Q && L(W), ue = X(C, W, M, R);
|
|
3520
3520
|
break;
|
|
3521
3521
|
default:
|
|
3522
3522
|
Q && L(W);
|
|
3523
|
-
var ne = new
|
|
3524
|
-
if (!ne.closed && B(C, ue, ne.tagName, Y) && (ne.closed = !0, F.nbsp || R.warning("unclosed xml attribute")), Q &&
|
|
3525
|
-
for (var
|
|
3526
|
-
var
|
|
3527
|
-
L(
|
|
3523
|
+
var ne = new N(), de = J[J.length - 1].currentNSMap, ue = p(C, W, ne, de, b, R), pe = ne.length;
|
|
3524
|
+
if (!ne.closed && B(C, ue, ne.tagName, Y) && (ne.closed = !0, F.nbsp || R.warning("unclosed xml attribute")), Q && pe) {
|
|
3525
|
+
for (var ve = D(Q, {}), le = 0; le < pe; le++) {
|
|
3526
|
+
var De = ne[le];
|
|
3527
|
+
L(De.offset), De.locator = D(Q, {});
|
|
3528
3528
|
}
|
|
3529
|
-
|
|
3529
|
+
M.locator = ve, E(ne, M, de) && J.push(ne), M.locator = Q;
|
|
3530
3530
|
} else
|
|
3531
|
-
E(ne,
|
|
3532
|
-
n.isHTML(ne.uri) && !ne.closed ? ue =
|
|
3531
|
+
E(ne, M, de) && J.push(ne);
|
|
3532
|
+
n.isHTML(ne.uri) && !ne.closed ? ue = P(C, ue, ne.tagName, b, M) : ue++;
|
|
3533
3533
|
}
|
|
3534
3534
|
} catch (ee) {
|
|
3535
|
-
if (ee instanceof
|
|
3535
|
+
if (ee instanceof v)
|
|
3536
3536
|
throw ee;
|
|
3537
3537
|
R.error("element parse error: " + ee), ue = -1;
|
|
3538
3538
|
}
|
|
3539
3539
|
ue > j ? j = ue : w(Math.max(W, j) + 1);
|
|
3540
3540
|
}
|
|
3541
3541
|
}
|
|
3542
|
-
function
|
|
3543
|
-
return
|
|
3542
|
+
function D(C, T) {
|
|
3543
|
+
return T.lineNumber = C.lineNumber, T.columnNumber = C.columnNumber, T;
|
|
3544
3544
|
}
|
|
3545
|
-
function p(C,
|
|
3546
|
-
function
|
|
3545
|
+
function p(C, T, F, M, R, g) {
|
|
3546
|
+
function b(Q, J, Y) {
|
|
3547
3547
|
F.attributeNames.hasOwnProperty(Q) && g.fatalError("Attribute " + Q + " redefined"), F.addValue(
|
|
3548
3548
|
Q,
|
|
3549
3549
|
// @see https://www.w3.org/TR/xml/#AVNormalize
|
|
@@ -3554,12 +3554,12 @@ function Fn() {
|
|
|
3554
3554
|
Y
|
|
3555
3555
|
);
|
|
3556
3556
|
}
|
|
3557
|
-
for (var w, L, I = ++
|
|
3557
|
+
for (var w, L, I = ++T, H = i; ; ) {
|
|
3558
3558
|
var G = C.charAt(I);
|
|
3559
3559
|
switch (G) {
|
|
3560
3560
|
case "=":
|
|
3561
3561
|
if (H === o)
|
|
3562
|
-
w = C.slice(
|
|
3562
|
+
w = C.slice(T, I), H = s;
|
|
3563
3563
|
else if (H === u)
|
|
3564
3564
|
H = s;
|
|
3565
3565
|
else
|
|
@@ -3568,19 +3568,19 @@ function Fn() {
|
|
|
3568
3568
|
case "'":
|
|
3569
3569
|
case '"':
|
|
3570
3570
|
if (H === s || H === o)
|
|
3571
|
-
if (H === o && (g.warning('attribute value must after "="'), w = C.slice(
|
|
3572
|
-
L = C.slice(
|
|
3571
|
+
if (H === o && (g.warning('attribute value must after "="'), w = C.slice(T, I)), T = I + 1, I = C.indexOf(G, T), I > 0)
|
|
3572
|
+
L = C.slice(T, I), b(w, L, T - 1), H = d;
|
|
3573
3573
|
else
|
|
3574
3574
|
throw new Error("attribute value no end '" + G + "' match");
|
|
3575
3575
|
else if (H == l)
|
|
3576
|
-
L = C.slice(
|
|
3576
|
+
L = C.slice(T, I), b(w, L, T), g.warning('attribute "' + w + '" missed start quot(' + G + ")!!"), T = I + 1, H = d;
|
|
3577
3577
|
else
|
|
3578
3578
|
throw new Error('attribute value must after "="');
|
|
3579
3579
|
break;
|
|
3580
3580
|
case "/":
|
|
3581
3581
|
switch (H) {
|
|
3582
3582
|
case i:
|
|
3583
|
-
F.setTagName(C.slice(
|
|
3583
|
+
F.setTagName(C.slice(T, I));
|
|
3584
3584
|
case d:
|
|
3585
3585
|
case h:
|
|
3586
3586
|
case a:
|
|
@@ -3597,11 +3597,11 @@ function Fn() {
|
|
|
3597
3597
|
}
|
|
3598
3598
|
break;
|
|
3599
3599
|
case "":
|
|
3600
|
-
return g.error("unexpected end of input"), H == i && F.setTagName(C.slice(
|
|
3600
|
+
return g.error("unexpected end of input"), H == i && F.setTagName(C.slice(T, I)), I;
|
|
3601
3601
|
case ">":
|
|
3602
3602
|
switch (H) {
|
|
3603
3603
|
case i:
|
|
3604
|
-
F.setTagName(C.slice(
|
|
3604
|
+
F.setTagName(C.slice(T, I));
|
|
3605
3605
|
case d:
|
|
3606
3606
|
case h:
|
|
3607
3607
|
case a:
|
|
@@ -3610,9 +3610,9 @@ function Fn() {
|
|
|
3610
3610
|
case l:
|
|
3611
3611
|
//Compatible state
|
|
3612
3612
|
case o:
|
|
3613
|
-
L = C.slice(
|
|
3613
|
+
L = C.slice(T, I), L.slice(-1) === "/" && (F.closed = !0, L = L.slice(0, -1));
|
|
3614
3614
|
case u:
|
|
3615
|
-
H === u && (L = w), H == l ? (g.warning('attribute "' + L + '" missed quot(")!'),
|
|
3615
|
+
H === u && (L = w), H == l ? (g.warning('attribute "' + L + '" missed quot(")!'), b(w, L, T)) : ((!n.isHTML(M[""]) || !L.match(/^(?:disabled|checked|selected)$/i)) && g.warning('attribute "' + L + '" missed value!! "' + L + '" instead!!'), b(L, L, T));
|
|
3616
3616
|
break;
|
|
3617
3617
|
case s:
|
|
3618
3618
|
throw new Error("attribute value missed!!");
|
|
@@ -3625,14 +3625,14 @@ function Fn() {
|
|
|
3625
3625
|
if (G <= " ")
|
|
3626
3626
|
switch (H) {
|
|
3627
3627
|
case i:
|
|
3628
|
-
F.setTagName(C.slice(
|
|
3628
|
+
F.setTagName(C.slice(T, I)), H = h;
|
|
3629
3629
|
break;
|
|
3630
3630
|
case o:
|
|
3631
|
-
w = C.slice(
|
|
3631
|
+
w = C.slice(T, I), H = u;
|
|
3632
3632
|
break;
|
|
3633
3633
|
case l:
|
|
3634
|
-
var L = C.slice(
|
|
3635
|
-
g.warning('attribute "' + L + '" missed quot(")!!'),
|
|
3634
|
+
var L = C.slice(T, I);
|
|
3635
|
+
g.warning('attribute "' + L + '" missed quot(")!!'), b(w, L, T);
|
|
3636
3636
|
case d:
|
|
3637
3637
|
H = h;
|
|
3638
3638
|
break;
|
|
@@ -3643,15 +3643,15 @@ function Fn() {
|
|
|
3643
3643
|
//case S_ATTR:void();break;
|
|
3644
3644
|
//case S_ATTR_NOQUOT_VALUE:void();break;
|
|
3645
3645
|
case u:
|
|
3646
|
-
F.tagName, (!n.isHTML(
|
|
3646
|
+
F.tagName, (!n.isHTML(M[""]) || !w.match(/^(?:disabled|checked|selected)$/i)) && g.warning('attribute "' + w + '" missed value!! "' + w + '" instead2!!'), b(w, w, T), T = I, H = o;
|
|
3647
3647
|
break;
|
|
3648
3648
|
case d:
|
|
3649
3649
|
g.warning('attribute space is required"' + w + '"!!');
|
|
3650
3650
|
case h:
|
|
3651
|
-
H = o,
|
|
3651
|
+
H = o, T = I;
|
|
3652
3652
|
break;
|
|
3653
3653
|
case s:
|
|
3654
|
-
H = l,
|
|
3654
|
+
H = l, T = I;
|
|
3655
3655
|
break;
|
|
3656
3656
|
case a:
|
|
3657
3657
|
throw new Error("elements closed character '/' and '>' must be connected to");
|
|
@@ -3660,91 +3660,91 @@ function Fn() {
|
|
|
3660
3660
|
I++;
|
|
3661
3661
|
}
|
|
3662
3662
|
}
|
|
3663
|
-
function E(C,
|
|
3664
|
-
for (var
|
|
3665
|
-
var g = C[G],
|
|
3663
|
+
function E(C, T, F) {
|
|
3664
|
+
for (var M = C.tagName, R = null, G = C.length; G--; ) {
|
|
3665
|
+
var g = C[G], b = g.qName, w = g.value, Q = b.indexOf(":");
|
|
3666
3666
|
if (Q > 0)
|
|
3667
|
-
var L = g.prefix =
|
|
3667
|
+
var L = g.prefix = b.slice(0, Q), I = b.slice(Q + 1), H = L === "xmlns" && I;
|
|
3668
3668
|
else
|
|
3669
|
-
I =
|
|
3670
|
-
g.localName = I, H !== !1 && (R == null && (R = {}, S(F, F = {})), F[H] = R[H] = w, g.uri = n.XMLNS,
|
|
3669
|
+
I = b, L = null, H = b === "xmlns" && "";
|
|
3670
|
+
g.localName = I, H !== !1 && (R == null && (R = {}, S(F, F = {})), F[H] = R[H] = w, g.uri = n.XMLNS, T.startPrefixMapping(H, w));
|
|
3671
3671
|
}
|
|
3672
3672
|
for (var G = C.length; G--; ) {
|
|
3673
3673
|
g = C[G];
|
|
3674
3674
|
var L = g.prefix;
|
|
3675
3675
|
L && (L === "xml" && (g.uri = n.XML), L !== "xmlns" && (g.uri = F[L || ""]));
|
|
3676
3676
|
}
|
|
3677
|
-
var Q =
|
|
3678
|
-
Q > 0 ? (L = C.prefix =
|
|
3677
|
+
var Q = M.indexOf(":");
|
|
3678
|
+
Q > 0 ? (L = C.prefix = M.slice(0, Q), I = C.localName = M.slice(Q + 1)) : (L = null, I = C.localName = M);
|
|
3679
3679
|
var J = C.uri = F[L || ""];
|
|
3680
|
-
if (
|
|
3681
|
-
if (
|
|
3680
|
+
if (T.startElement(J, I, M, C), C.closed) {
|
|
3681
|
+
if (T.endElement(J, I, M), R)
|
|
3682
3682
|
for (L in R)
|
|
3683
|
-
Object.prototype.hasOwnProperty.call(R, L) &&
|
|
3683
|
+
Object.prototype.hasOwnProperty.call(R, L) && T.endPrefixMapping(L);
|
|
3684
3684
|
} else
|
|
3685
3685
|
return C.currentNSMap = F, C.localNSMap = R, !0;
|
|
3686
3686
|
}
|
|
3687
|
-
function
|
|
3687
|
+
function P(C, T, F, M, R) {
|
|
3688
3688
|
if (/^(?:script|textarea)$/i.test(F)) {
|
|
3689
|
-
var g = C.indexOf("</" + F + ">",
|
|
3690
|
-
if (/[&<]/.test(
|
|
3691
|
-
return /^script$/i.test(F) ? (R.characters(
|
|
3689
|
+
var g = C.indexOf("</" + F + ">", T), b = C.substring(T + 1, g);
|
|
3690
|
+
if (/[&<]/.test(b))
|
|
3691
|
+
return /^script$/i.test(F) ? (R.characters(b, 0, b.length), g) : (b = b.replace(/&#?\w+;/g, M), R.characters(b, 0, b.length), g);
|
|
3692
3692
|
}
|
|
3693
|
-
return
|
|
3693
|
+
return T + 1;
|
|
3694
3694
|
}
|
|
3695
|
-
function B(C,
|
|
3696
|
-
var R =
|
|
3697
|
-
return R == null && (R = C.lastIndexOf("</" + F + ">"), R <
|
|
3695
|
+
function B(C, T, F, M) {
|
|
3696
|
+
var R = M[F];
|
|
3697
|
+
return R == null && (R = C.lastIndexOf("</" + F + ">"), R < T && (R = C.lastIndexOf("</" + F)), M[F] = R), R < T;
|
|
3698
3698
|
}
|
|
3699
|
-
function S(C,
|
|
3699
|
+
function S(C, T) {
|
|
3700
3700
|
for (var F in C)
|
|
3701
|
-
Object.prototype.hasOwnProperty.call(C, F) && (
|
|
3701
|
+
Object.prototype.hasOwnProperty.call(C, F) && (T[F] = C[F]);
|
|
3702
3702
|
}
|
|
3703
|
-
function X(C,
|
|
3704
|
-
var R = C.charAt(
|
|
3703
|
+
function X(C, T, F, M) {
|
|
3704
|
+
var R = C.charAt(T + 2);
|
|
3705
3705
|
switch (R) {
|
|
3706
3706
|
case "-":
|
|
3707
|
-
if (C.charAt(
|
|
3708
|
-
var g = C.indexOf("-->",
|
|
3709
|
-
return g >
|
|
3707
|
+
if (C.charAt(T + 3) === "-") {
|
|
3708
|
+
var g = C.indexOf("-->", T + 4);
|
|
3709
|
+
return g > T ? (F.comment(C, T + 4, g - T - 4), g + 3) : (M.error("Unclosed comment"), -1);
|
|
3710
3710
|
} else
|
|
3711
3711
|
return -1;
|
|
3712
3712
|
default:
|
|
3713
|
-
if (C.substr(
|
|
3714
|
-
var g = C.indexOf("]]>",
|
|
3715
|
-
return F.startCDATA(), F.characters(C,
|
|
3713
|
+
if (C.substr(T + 3, 6) == "CDATA[") {
|
|
3714
|
+
var g = C.indexOf("]]>", T + 9);
|
|
3715
|
+
return F.startCDATA(), F.characters(C, T + 9, g - T - 9), F.endCDATA(), g + 3;
|
|
3716
3716
|
}
|
|
3717
|
-
var
|
|
3718
|
-
if (w > 1 && /!doctype/i.test(
|
|
3719
|
-
var L =
|
|
3720
|
-
w > 3 && (/^public$/i.test(
|
|
3721
|
-
var G =
|
|
3717
|
+
var b = z(C, T), w = b.length;
|
|
3718
|
+
if (w > 1 && /!doctype/i.test(b[0][0])) {
|
|
3719
|
+
var L = b[1][0], I = !1, H = !1;
|
|
3720
|
+
w > 3 && (/^public$/i.test(b[2][0]) ? (I = b[3][0], H = w > 4 && b[4][0]) : /^system$/i.test(b[2][0]) && (H = b[3][0]));
|
|
3721
|
+
var G = b[w - 1];
|
|
3722
3722
|
return F.startDTD(L, I, H), F.endDTD(), G.index + G[0].length;
|
|
3723
3723
|
}
|
|
3724
3724
|
}
|
|
3725
3725
|
return -1;
|
|
3726
3726
|
}
|
|
3727
|
-
function
|
|
3728
|
-
var
|
|
3729
|
-
if (
|
|
3730
|
-
var R = C.substring(
|
|
3731
|
-
return R ? (R[0].length, F.processingInstruction(R[1], R[2]),
|
|
3727
|
+
function O(C, T, F) {
|
|
3728
|
+
var M = C.indexOf("?>", T);
|
|
3729
|
+
if (M) {
|
|
3730
|
+
var R = C.substring(T, M).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);
|
|
3731
|
+
return R ? (R[0].length, F.processingInstruction(R[1], R[2]), M + 2) : -1;
|
|
3732
3732
|
}
|
|
3733
3733
|
return -1;
|
|
3734
3734
|
}
|
|
3735
|
-
function
|
|
3735
|
+
function N() {
|
|
3736
3736
|
this.attributeNames = {};
|
|
3737
3737
|
}
|
|
3738
|
-
|
|
3738
|
+
N.prototype = {
|
|
3739
3739
|
setTagName: function(C) {
|
|
3740
3740
|
if (!r.test(C))
|
|
3741
3741
|
throw new Error("invalid tagName:" + C);
|
|
3742
3742
|
this.tagName = C;
|
|
3743
3743
|
},
|
|
3744
|
-
addValue: function(C,
|
|
3744
|
+
addValue: function(C, T, F) {
|
|
3745
3745
|
if (!r.test(C))
|
|
3746
3746
|
throw new Error("invalid attribute:" + C);
|
|
3747
|
-
this.attributeNames[C] = this.length, this[this.length++] = { qName: C, value:
|
|
3747
|
+
this.attributeNames[C] = this.length, this[this.length++] = { qName: C, value: T, offset: F };
|
|
3748
3748
|
},
|
|
3749
3749
|
length: 0,
|
|
3750
3750
|
getLocalName: function(C) {
|
|
@@ -3773,16 +3773,16 @@ function Fn() {
|
|
|
3773
3773
|
// getType:function(uri,localName){}
|
|
3774
3774
|
// getType:function(i){},
|
|
3775
3775
|
};
|
|
3776
|
-
function z(C,
|
|
3777
|
-
var F,
|
|
3778
|
-
for (R.lastIndex =
|
|
3779
|
-
if (
|
|
3776
|
+
function z(C, T) {
|
|
3777
|
+
var F, M = [], R = /'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;
|
|
3778
|
+
for (R.lastIndex = T, R.exec(C); F = R.exec(C); )
|
|
3779
|
+
if (M.push(F), F[1]) return M;
|
|
3780
3780
|
}
|
|
3781
|
-
return xt.XMLReader = y, xt.ParseError =
|
|
3781
|
+
return xt.XMLReader = y, xt.ParseError = v, xt;
|
|
3782
3782
|
}
|
|
3783
3783
|
var wr;
|
|
3784
3784
|
function Sn() {
|
|
3785
|
-
if (wr) return
|
|
3785
|
+
if (wr) return pt;
|
|
3786
3786
|
wr = 1;
|
|
3787
3787
|
var n = Wt(), e = jr(), t = Ln(), r = Fn(), i = e.DOMImplementation, o = n.NAMESPACE, u = r.ParseError, s = r.XMLReader;
|
|
3788
3788
|
function l(p) {
|
|
@@ -3794,29 +3794,29 @@ function Sn() {
|
|
|
3794
3794
|
this.options = p || { locator: {} };
|
|
3795
3795
|
}
|
|
3796
3796
|
d.prototype.parseFromString = function(p, E) {
|
|
3797
|
-
var
|
|
3798
|
-
|
|
3799
|
-
var
|
|
3797
|
+
var P = this.options, B = new s(), S = P.domBuilder || new a(), X = P.errorHandler, O = P.locator, N = P.xmlns || {}, z = /\/x?html?$/.test(E), C = z ? t.HTML_ENTITIES : t.XML_ENTITIES;
|
|
3798
|
+
O && S.setDocumentLocator(O), B.errorHandler = h(X, S, O), B.domBuilder = P.domBuilder || S, z && (N[""] = o.HTML), N.xml = N.xml || o.XML;
|
|
3799
|
+
var T = P.normalizeLineEndings || l;
|
|
3800
3800
|
return p && typeof p == "string" ? B.parse(
|
|
3801
|
-
|
|
3802
|
-
|
|
3801
|
+
T(p),
|
|
3802
|
+
N,
|
|
3803
3803
|
C
|
|
3804
3804
|
) : B.errorHandler.error("invalid doc source"), S.doc;
|
|
3805
3805
|
};
|
|
3806
|
-
function h(p, E,
|
|
3806
|
+
function h(p, E, P) {
|
|
3807
3807
|
if (!p) {
|
|
3808
3808
|
if (E instanceof a)
|
|
3809
3809
|
return E;
|
|
3810
3810
|
p = E;
|
|
3811
3811
|
}
|
|
3812
3812
|
var B = {}, S = p instanceof Function;
|
|
3813
|
-
|
|
3814
|
-
function X(
|
|
3815
|
-
var
|
|
3816
|
-
!
|
|
3817
|
-
p(
|
|
3818
|
-
} : p), B[
|
|
3819
|
-
|
|
3813
|
+
P = P || {};
|
|
3814
|
+
function X(O) {
|
|
3815
|
+
var N = p[O];
|
|
3816
|
+
!N && S && (N = p.length == 2 ? function(z) {
|
|
3817
|
+
p(O, z);
|
|
3818
|
+
} : p), B[O] = N && function(z) {
|
|
3819
|
+
N("[xmldom " + O + "] " + z + y(P));
|
|
3820
3820
|
} || function() {
|
|
3821
3821
|
};
|
|
3822
3822
|
}
|
|
@@ -3825,22 +3825,22 @@ function Sn() {
|
|
|
3825
3825
|
function a() {
|
|
3826
3826
|
this.cdata = !1;
|
|
3827
3827
|
}
|
|
3828
|
-
function
|
|
3828
|
+
function v(p, E) {
|
|
3829
3829
|
E.lineNumber = p.lineNumber, E.columnNumber = p.columnNumber;
|
|
3830
3830
|
}
|
|
3831
3831
|
a.prototype = {
|
|
3832
3832
|
startDocument: function() {
|
|
3833
3833
|
this.doc = new i().createDocument(null, null, null), this.locator && (this.doc.documentURI = this.locator.systemId);
|
|
3834
3834
|
},
|
|
3835
|
-
startElement: function(p, E,
|
|
3836
|
-
var S = this.doc, X = S.createElementNS(p,
|
|
3837
|
-
|
|
3838
|
-
for (var
|
|
3839
|
-
var p = B.getURI(
|
|
3840
|
-
this.locator &&
|
|
3835
|
+
startElement: function(p, E, P, B) {
|
|
3836
|
+
var S = this.doc, X = S.createElementNS(p, P || E), O = B.length;
|
|
3837
|
+
D(this, X), this.currentElement = X, this.locator && v(this.locator, X);
|
|
3838
|
+
for (var N = 0; N < O; N++) {
|
|
3839
|
+
var p = B.getURI(N), z = B.getValue(N), P = B.getQName(N), C = S.createAttributeNS(p, P);
|
|
3840
|
+
this.locator && v(B.getLocator(N), C), C.value = C.nodeValue = z, X.setAttributeNode(C);
|
|
3841
3841
|
}
|
|
3842
3842
|
},
|
|
3843
|
-
endElement: function(p, E,
|
|
3843
|
+
endElement: function(p, E, P) {
|
|
3844
3844
|
var B = this.currentElement;
|
|
3845
3845
|
B.tagName, this.currentElement = B.parentNode;
|
|
3846
3846
|
},
|
|
@@ -3849,18 +3849,18 @@ function Sn() {
|
|
|
3849
3849
|
endPrefixMapping: function(p) {
|
|
3850
3850
|
},
|
|
3851
3851
|
processingInstruction: function(p, E) {
|
|
3852
|
-
var
|
|
3853
|
-
this.locator &&
|
|
3852
|
+
var P = this.doc.createProcessingInstruction(p, E);
|
|
3853
|
+
this.locator && v(this.locator, P), D(this, P);
|
|
3854
3854
|
},
|
|
3855
|
-
ignorableWhitespace: function(p, E,
|
|
3855
|
+
ignorableWhitespace: function(p, E, P) {
|
|
3856
3856
|
},
|
|
3857
|
-
characters: function(p, E,
|
|
3857
|
+
characters: function(p, E, P) {
|
|
3858
3858
|
if (p = A.apply(this, arguments), p) {
|
|
3859
3859
|
if (this.cdata)
|
|
3860
3860
|
var B = this.doc.createCDATASection(p);
|
|
3861
3861
|
else
|
|
3862
3862
|
var B = this.doc.createTextNode(p);
|
|
3863
|
-
this.currentElement ? this.currentElement.appendChild(B) : /^\s*$/.test(p) && this.doc.appendChild(B), this.locator &&
|
|
3863
|
+
this.currentElement ? this.currentElement.appendChild(B) : /^\s*$/.test(p) && this.doc.appendChild(B), this.locator && v(this.locator, B);
|
|
3864
3864
|
}
|
|
3865
3865
|
},
|
|
3866
3866
|
skippedEntity: function(p) {
|
|
@@ -3872,10 +3872,10 @@ function Sn() {
|
|
|
3872
3872
|
(this.locator = p) && (p.lineNumber = 0);
|
|
3873
3873
|
},
|
|
3874
3874
|
//LexicalHandler
|
|
3875
|
-
comment: function(p, E,
|
|
3875
|
+
comment: function(p, E, P) {
|
|
3876
3876
|
p = A.apply(this, arguments);
|
|
3877
3877
|
var B = this.doc.createComment(p);
|
|
3878
|
-
this.locator &&
|
|
3878
|
+
this.locator && v(this.locator, B), D(this, B);
|
|
3879
3879
|
},
|
|
3880
3880
|
startCDATA: function() {
|
|
3881
3881
|
this.cdata = !0;
|
|
@@ -3883,11 +3883,11 @@ function Sn() {
|
|
|
3883
3883
|
endCDATA: function() {
|
|
3884
3884
|
this.cdata = !1;
|
|
3885
3885
|
},
|
|
3886
|
-
startDTD: function(p, E,
|
|
3886
|
+
startDTD: function(p, E, P) {
|
|
3887
3887
|
var B = this.doc.implementation;
|
|
3888
3888
|
if (B && B.createDocumentType) {
|
|
3889
|
-
var S = B.createDocumentType(p, E,
|
|
3890
|
-
this.locator &&
|
|
3889
|
+
var S = B.createDocumentType(p, E, P);
|
|
3890
|
+
this.locator && v(this.locator, S), D(this, S), this.doc.doctype = S;
|
|
3891
3891
|
}
|
|
3892
3892
|
},
|
|
3893
3893
|
/**
|
|
@@ -3909,25 +3909,25 @@ function Sn() {
|
|
|
3909
3909
|
return `
|
|
3910
3910
|
@` + (p.systemId || "") + "#[line:" + p.lineNumber + ",col:" + p.columnNumber + "]";
|
|
3911
3911
|
}
|
|
3912
|
-
function A(p, E,
|
|
3913
|
-
return typeof p == "string" ? p.substr(E,
|
|
3912
|
+
function A(p, E, P) {
|
|
3913
|
+
return typeof p == "string" ? p.substr(E, P) : p.length >= E + P || E ? new java.lang.String(p, E, P) + "" : p;
|
|
3914
3914
|
}
|
|
3915
3915
|
"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g, function(p) {
|
|
3916
3916
|
a.prototype[p] = function() {
|
|
3917
3917
|
return null;
|
|
3918
3918
|
};
|
|
3919
3919
|
});
|
|
3920
|
-
function
|
|
3920
|
+
function D(p, E) {
|
|
3921
3921
|
p.currentElement ? p.currentElement.appendChild(E) : p.doc.appendChild(E);
|
|
3922
3922
|
}
|
|
3923
|
-
return
|
|
3923
|
+
return pt.__DOMHandler = a, pt.normalizeLineEndings = l, pt.DOMParser = d, pt;
|
|
3924
3924
|
}
|
|
3925
3925
|
var Cr;
|
|
3926
3926
|
function Mn() {
|
|
3927
|
-
if (Cr) return
|
|
3927
|
+
if (Cr) return mt;
|
|
3928
3928
|
Cr = 1;
|
|
3929
3929
|
var n = jr();
|
|
3930
|
-
return
|
|
3930
|
+
return mt.DOMImplementation = n.DOMImplementation, mt.XMLSerializer = n.XMLSerializer, mt.DOMParser = Sn().DOMParser, mt;
|
|
3931
3931
|
}
|
|
3932
3932
|
var On = Rt.exports, Er;
|
|
3933
3933
|
function Xn() {
|
|
@@ -3942,8 +3942,8 @@ function Xn() {
|
|
|
3942
3942
|
r.arrayAccessForm = r.arrayAccessForm || "none", r.emptyNodeForm = r.emptyNodeForm || "text", r.jsAttributeFilter = r.jsAttributeFilter, r.jsAttributeConverter = r.jsAttributeConverter, r.attributeConverters = r.attributeConverters || [], r.datetimeAccessFormPaths = r.datetimeAccessFormPaths || [], r.arrayAccessFormPaths = r.arrayAccessFormPaths || [], r.xmldomOptions = r.xmldomOptions || {}, r.enableToStringFunc === void 0 && (r.enableToStringFunc = !0), r.skipEmptyTextNodesForObj === void 0 && (r.skipEmptyTextNodesForObj = !0), r.stripWhitespaces === void 0 && (r.stripWhitespaces = !0), r.useDoubleQuotes === void 0 && (r.useDoubleQuotes = !0), r.ignoreRoot === void 0 && (r.ignoreRoot = !1), r.escapeMode === void 0 && (r.escapeMode = !0), r.attributePrefix === void 0 && (r.attributePrefix = "_"), r.selfClosingElements === void 0 && (r.selfClosingElements = !0), r.keepCData === void 0 && (r.keepCData = !1), r.keepText === void 0 && (r.keepText = !1), r.jsDateUTC === void 0 && (r.jsDateUTC = !1);
|
|
3943
3943
|
}
|
|
3944
3944
|
function u() {
|
|
3945
|
-
function g(
|
|
3946
|
-
var w = String(
|
|
3945
|
+
function g(b) {
|
|
3946
|
+
var w = String(b);
|
|
3947
3947
|
return w.length === 1 && (w = "0" + w), w;
|
|
3948
3948
|
}
|
|
3949
3949
|
typeof String.prototype.trim != "function" && (String.prototype.trim = function() {
|
|
@@ -3962,8 +3962,8 @@ function Xn() {
|
|
|
3962
3962
|
DOCUMENT_NODE: 9
|
|
3963
3963
|
};
|
|
3964
3964
|
function l(g) {
|
|
3965
|
-
var
|
|
3966
|
-
return
|
|
3965
|
+
var b = g.localName;
|
|
3966
|
+
return b == null && (b = g.baseName), (b == null || b === "") && (b = g.nodeName), b;
|
|
3967
3967
|
}
|
|
3968
3968
|
function d(g) {
|
|
3969
3969
|
return g.prefix;
|
|
@@ -3974,8 +3974,8 @@ function Xn() {
|
|
|
3974
3974
|
function a(g) {
|
|
3975
3975
|
return g.replace(/</g, "<").replace(/>/g, ">").replace(/"/g, '"').replace(/'/g, "'").replace(/&/g, "&");
|
|
3976
3976
|
}
|
|
3977
|
-
function
|
|
3978
|
-
if (r.arrayAccessForm === "property" && (g[
|
|
3977
|
+
function v(g, b, w) {
|
|
3978
|
+
if (r.arrayAccessForm === "property" && (g[b] instanceof Array ? g[b + "_asArray"] = g[b] : g[b + "_asArray"] = [g[b]]), !(g[b] instanceof Array) && r.arrayAccessFormPaths.length > 0) {
|
|
3979
3979
|
for (var L = !1, I = 0; I < r.arrayAccessFormPaths.length; I++) {
|
|
3980
3980
|
var H = r.arrayAccessFormPaths[I];
|
|
3981
3981
|
if (typeof H == "string") {
|
|
@@ -3988,23 +3988,23 @@ function Xn() {
|
|
|
3988
3988
|
L = !0;
|
|
3989
3989
|
break;
|
|
3990
3990
|
}
|
|
3991
|
-
} else if (typeof H == "function" && H(
|
|
3991
|
+
} else if (typeof H == "function" && H(b, w)) {
|
|
3992
3992
|
L = !0;
|
|
3993
3993
|
break;
|
|
3994
3994
|
}
|
|
3995
3995
|
}
|
|
3996
|
-
L && (g[
|
|
3996
|
+
L && (g[b] = [g[b]]);
|
|
3997
3997
|
}
|
|
3998
3998
|
}
|
|
3999
3999
|
function y(g) {
|
|
4000
|
-
var
|
|
4000
|
+
var b = 60, w = g.split(/[-T:+Z]/g), L = new Date(w[0], w[1] - 1, w[2]), I = w[5].split(".");
|
|
4001
4001
|
if (L.setHours(w[3], w[4], I[0]), I.length > 1 && L.setMilliseconds(I[1]), w[6] && w[7]) {
|
|
4002
|
-
var H = w[6] *
|
|
4002
|
+
var H = w[6] * b + Number(w[7]), G = /\d\d-\d\d:\d\d$/.test(g) ? "-" : "+";
|
|
4003
4003
|
H = 0 + (G === "-" ? -1 * H : H), L.setMinutes(L.getMinutes() - H - L.getTimezoneOffset());
|
|
4004
4004
|
} else g.indexOf("Z", g.length - 1) !== -1 && (L = new Date(Date.UTC(L.getFullYear(), L.getMonth(), L.getDate(), L.getHours(), L.getMinutes(), L.getSeconds(), L.getMilliseconds())));
|
|
4005
4005
|
return L;
|
|
4006
4006
|
}
|
|
4007
|
-
function A(g,
|
|
4007
|
+
function A(g, b, w) {
|
|
4008
4008
|
if (r.datetimeAccessFormPaths.length > 0)
|
|
4009
4009
|
for (var L = w.split(".#")[0], I = 0; I < r.datetimeAccessFormPaths.length; I++) {
|
|
4010
4010
|
var H = r.datetimeAccessFormPaths[I];
|
|
@@ -4019,22 +4019,22 @@ function Xn() {
|
|
|
4019
4019
|
}
|
|
4020
4020
|
return g;
|
|
4021
4021
|
}
|
|
4022
|
-
function
|
|
4023
|
-
for (var
|
|
4022
|
+
function D(g) {
|
|
4023
|
+
for (var b = {}, w = g.childNodes, L = 0; L < w.length; L++) {
|
|
4024
4024
|
var I = w.item(L);
|
|
4025
4025
|
if (I.nodeType === s.ELEMENT_NODE) {
|
|
4026
4026
|
var H = l(I);
|
|
4027
|
-
r.ignoreRoot ?
|
|
4027
|
+
r.ignoreRoot ? b = E(I, H) : b[H] = E(I, H);
|
|
4028
4028
|
}
|
|
4029
4029
|
}
|
|
4030
|
-
return
|
|
4030
|
+
return b;
|
|
4031
4031
|
}
|
|
4032
|
-
function p(g,
|
|
4032
|
+
function p(g, b) {
|
|
4033
4033
|
var w = {};
|
|
4034
4034
|
w.__cnt = 0;
|
|
4035
4035
|
for (var L = g.childNodes, I = 0; I < L.length; I++) {
|
|
4036
4036
|
var H = L.item(I), G = l(H);
|
|
4037
|
-
H.nodeType !== s.COMMENT_NODE && (w.__cnt++, w[G] == null ? (w[G] = E(H,
|
|
4037
|
+
H.nodeType !== s.COMMENT_NODE && (w.__cnt++, w[G] == null ? (w[G] = E(H, b + "." + G), v(w, G, b + "." + G)) : (w[G] instanceof Array || (w[G] = [w[G]], v(w, G, b + "." + G)), w[G][w[G].length] = E(H, b + "." + G)));
|
|
4038
4038
|
}
|
|
4039
4039
|
for (var Q = 0; Q < g.attributes.length; Q++) {
|
|
4040
4040
|
var J = g.attributes.item(Q);
|
|
@@ -4047,15 +4047,15 @@ function Xn() {
|
|
|
4047
4047
|
}
|
|
4048
4048
|
var K = d(g);
|
|
4049
4049
|
return K && (w.__cnt++, w.__prefix = K), w["#text"] && (w.__text = w["#text"], w.__text instanceof Array && (w.__text = w.__text.join(`
|
|
4050
|
-
`)), r.escapeMode && (w.__text = a(w.__text)), r.stripWhitespaces && (w.__text = w.__text.trim()), delete w["#text"], r.arrayAccessForm === "property" && delete w["#text_asArray"], w.__text = A(w.__text, "#text",
|
|
4050
|
+
`)), r.escapeMode && (w.__text = a(w.__text)), r.stripWhitespaces && (w.__text = w.__text.trim()), delete w["#text"], r.arrayAccessForm === "property" && delete w["#text_asArray"], w.__text = A(w.__text, "#text", b + ".#text")), w.hasOwnProperty("#cdata-section") && (w.__cdata = w["#cdata-section"], delete w["#cdata-section"], r.arrayAccessForm === "property" && delete w["#cdata-section_asArray"]), w.__cnt === 1 && w.__text && !r.keepText ? w = w.__text : w.__cnt === 0 && r.emptyNodeForm === "text" ? w = "" : w.__cnt > 1 && w.__text !== void 0 && r.skipEmptyTextNodesForObj && (r.stripWhitespaces && w.__text === "" || w.__text.trim() === "") && delete w.__text, delete w.__cnt, !r.keepCData && !w.hasOwnProperty("__text") && w.hasOwnProperty("__cdata") && Object.keys(w).length === 1 ? w.__cdata ? w.__cdata : "" : (r.enableToStringFunc && (w.__text || w.__cdata) && (w.toString = function() {
|
|
4051
4051
|
return (this.__text ? this.__text : "") + (this.__cdata ? this.__cdata : "");
|
|
4052
4052
|
}), w);
|
|
4053
4053
|
}
|
|
4054
|
-
function E(g,
|
|
4055
|
-
return g.nodeType === s.DOCUMENT_NODE ?
|
|
4054
|
+
function E(g, b) {
|
|
4055
|
+
return g.nodeType === s.DOCUMENT_NODE ? D(g) : g.nodeType === s.ELEMENT_NODE ? p(g, b) : g.nodeType === s.TEXT_NODE || g.nodeType === s.CDATA_SECTION_NODE ? g.nodeValue : null;
|
|
4056
4056
|
}
|
|
4057
|
-
function
|
|
4058
|
-
var I = "<" + (g && g.__prefix ? g.__prefix + ":" : "") +
|
|
4057
|
+
function P(g, b, w, L) {
|
|
4058
|
+
var I = "<" + (g && g.__prefix ? g.__prefix + ":" : "") + b;
|
|
4059
4059
|
if (w)
|
|
4060
4060
|
for (var H = 0; H < w.length; H++) {
|
|
4061
4061
|
var G = w[H], Q = g[G];
|
|
@@ -4063,93 +4063,93 @@ function Xn() {
|
|
|
4063
4063
|
}
|
|
4064
4064
|
return L ? I += " />" : I += ">", I;
|
|
4065
4065
|
}
|
|
4066
|
-
function B(g,
|
|
4067
|
-
return "</" + (g && g.__prefix ? g.__prefix + ":" : "") +
|
|
4066
|
+
function B(g, b) {
|
|
4067
|
+
return "</" + (g && g.__prefix ? g.__prefix + ":" : "") + b + ">";
|
|
4068
4068
|
}
|
|
4069
|
-
function S(g,
|
|
4070
|
-
return g.indexOf(
|
|
4069
|
+
function S(g, b) {
|
|
4070
|
+
return g.indexOf(b, g.length - b.length) !== -1;
|
|
4071
4071
|
}
|
|
4072
|
-
function X(g,
|
|
4073
|
-
return !!(r.arrayAccessForm === "property" && S(
|
|
4072
|
+
function X(g, b) {
|
|
4073
|
+
return !!(r.arrayAccessForm === "property" && S(b.toString(), "_asArray") || b.toString().indexOf(r.attributePrefix) === 0 || b.toString().indexOf("__") === 0 || g[b] instanceof Function);
|
|
4074
4074
|
}
|
|
4075
|
-
function
|
|
4076
|
-
var
|
|
4075
|
+
function O(g) {
|
|
4076
|
+
var b = 0;
|
|
4077
4077
|
if (g instanceof Object)
|
|
4078
4078
|
for (var w in g)
|
|
4079
|
-
X(g, w) ||
|
|
4080
|
-
return
|
|
4079
|
+
X(g, w) || b++;
|
|
4080
|
+
return b;
|
|
4081
4081
|
}
|
|
4082
|
-
function
|
|
4083
|
-
var
|
|
4082
|
+
function N(g) {
|
|
4083
|
+
var b = [];
|
|
4084
4084
|
if (g instanceof Object)
|
|
4085
4085
|
for (var w in g)
|
|
4086
|
-
w.toString().indexOf("__") === -1 && w.toString().indexOf(r.attributePrefix) === 0 &&
|
|
4087
|
-
return
|
|
4086
|
+
w.toString().indexOf("__") === -1 && w.toString().indexOf(r.attributePrefix) === 0 && b.push(w);
|
|
4087
|
+
return b;
|
|
4088
4088
|
}
|
|
4089
4089
|
function z(g) {
|
|
4090
|
-
var
|
|
4091
|
-
return g.__cdata && (
|
|
4090
|
+
var b = "";
|
|
4091
|
+
return g.__cdata && (b += "<![CDATA[" + g.__cdata + "]]>"), (g.__text || typeof g.__text == "number" || typeof g.__text == "boolean") && (r.escapeMode ? b += h(g.__text) : b += g.__text), b;
|
|
4092
4092
|
}
|
|
4093
4093
|
function C(g) {
|
|
4094
|
-
var
|
|
4095
|
-
return g instanceof Object ?
|
|
4094
|
+
var b = "";
|
|
4095
|
+
return g instanceof Object ? b += z(g) : g !== null && (r.escapeMode ? b += h(g) : b += g), b;
|
|
4096
4096
|
}
|
|
4097
|
-
function
|
|
4097
|
+
function T(g, b, w) {
|
|
4098
4098
|
var L = "";
|
|
4099
4099
|
if (g.length === 0)
|
|
4100
|
-
L +=
|
|
4100
|
+
L += P(g, b, w, !0);
|
|
4101
4101
|
else
|
|
4102
4102
|
for (var I = 0; I < g.length; I++)
|
|
4103
|
-
L += F(g[I],
|
|
4103
|
+
L += F(g[I], b, N(g[I]));
|
|
4104
4104
|
return L;
|
|
4105
4105
|
}
|
|
4106
|
-
function F(g,
|
|
4106
|
+
function F(g, b, w) {
|
|
4107
4107
|
var L = "";
|
|
4108
|
-
if (r.jsAttributeFilter && r.jsAttributeFilter.call(null,
|
|
4108
|
+
if (r.jsAttributeFilter && r.jsAttributeFilter.call(null, b, g))
|
|
4109
4109
|
return L;
|
|
4110
|
-
if (r.jsAttributeConverter && (g = r.jsAttributeConverter.call(null,
|
|
4111
|
-
L +=
|
|
4110
|
+
if (r.jsAttributeConverter && (g = r.jsAttributeConverter.call(null, b, g)), (g == null || g === "") && r.selfClosingElements)
|
|
4111
|
+
L += P(g, b, w, !0);
|
|
4112
4112
|
else if (typeof g == "object")
|
|
4113
4113
|
if (Object.prototype.toString.call(g) === "[object Array]")
|
|
4114
|
-
L +=
|
|
4114
|
+
L += T(g, b, w);
|
|
4115
4115
|
else if (g instanceof Date)
|
|
4116
|
-
L +=
|
|
4116
|
+
L += P(g, b, w, !1), L += r.jsDateUTC ? g.toUTCString() : g.toISOString(), L += B(g, b);
|
|
4117
4117
|
else {
|
|
4118
|
-
var I =
|
|
4119
|
-
I > 0 || typeof g.__text == "number" || typeof g.__text == "boolean" || g.__text || g.__cdata ? (L +=
|
|
4118
|
+
var I = O(g);
|
|
4119
|
+
I > 0 || typeof g.__text == "number" || typeof g.__text == "boolean" || g.__text || g.__cdata ? (L += P(g, b, w, !1), L += M(g), L += B(g, b)) : r.selfClosingElements ? L += P(g, b, w, !0) : (L += P(g, b, w, !1), L += B(g, b));
|
|
4120
4120
|
}
|
|
4121
4121
|
else
|
|
4122
|
-
L +=
|
|
4122
|
+
L += P(g, b, w, !1), L += C(g), L += B(g, b);
|
|
4123
4123
|
return L;
|
|
4124
4124
|
}
|
|
4125
|
-
function
|
|
4126
|
-
var
|
|
4125
|
+
function M(g) {
|
|
4126
|
+
var b = "", w = O(g);
|
|
4127
4127
|
if (w > 0) {
|
|
4128
4128
|
for (var L in g)
|
|
4129
4129
|
if (!X(g, L)) {
|
|
4130
|
-
var I = g[L], H =
|
|
4131
|
-
|
|
4130
|
+
var I = g[L], H = N(I);
|
|
4131
|
+
b += F(I, L, H);
|
|
4132
4132
|
}
|
|
4133
4133
|
}
|
|
4134
|
-
return
|
|
4134
|
+
return b += C(g), b;
|
|
4135
4135
|
}
|
|
4136
4136
|
function R(g) {
|
|
4137
4137
|
if (g === void 0 || typeof g != "string")
|
|
4138
4138
|
return null;
|
|
4139
|
-
var
|
|
4139
|
+
var b = null, w = null;
|
|
4140
4140
|
if (e)
|
|
4141
|
-
|
|
4141
|
+
b = new e(r.xmldomOptions), w = b.parseFromString(g, "text/xml");
|
|
4142
4142
|
else if (window && window.DOMParser) {
|
|
4143
|
-
|
|
4143
|
+
b = new window.DOMParser();
|
|
4144
4144
|
var L = null, I = window.ActiveXObject || "ActiveXObject" in window;
|
|
4145
4145
|
if (!I && document.all && !document.addEventListener)
|
|
4146
4146
|
try {
|
|
4147
|
-
L =
|
|
4147
|
+
L = b.parseFromString("INVALID", "text/xml").childNodes[0].namespaceURI;
|
|
4148
4148
|
} catch {
|
|
4149
4149
|
L = null;
|
|
4150
4150
|
}
|
|
4151
4151
|
try {
|
|
4152
|
-
w =
|
|
4152
|
+
w = b.parseFromString(g, "text/xml"), L !== null && w.getElementsByTagNameNS(L, "parsererror").length > 0 && (w = null);
|
|
4153
4153
|
} catch {
|
|
4154
4154
|
w = null;
|
|
4155
4155
|
}
|
|
@@ -4157,24 +4157,24 @@ function Xn() {
|
|
|
4157
4157
|
g.indexOf("<?") === 0 && (g = g.substr(g.indexOf("?>") + 2)), w = new ActiveXObject("Microsoft.XMLDOM"), w.async = "false", w.loadXML(g);
|
|
4158
4158
|
return w;
|
|
4159
4159
|
}
|
|
4160
|
-
this.asArray = function(
|
|
4161
|
-
return
|
|
4162
|
-
}, this.toXmlDateTime = function(
|
|
4163
|
-
return
|
|
4164
|
-
}, this.asDateTime = function(
|
|
4165
|
-
return typeof
|
|
4166
|
-
}, this.xml2dom = function(
|
|
4167
|
-
return R(
|
|
4168
|
-
}, this.dom2js = function(
|
|
4169
|
-
return E(
|
|
4170
|
-
}, this.js2dom = function(
|
|
4171
|
-
var w = this.js2xml(
|
|
4160
|
+
this.asArray = function(b) {
|
|
4161
|
+
return b == null ? [] : b instanceof Array ? b : [b];
|
|
4162
|
+
}, this.toXmlDateTime = function(b) {
|
|
4163
|
+
return b instanceof Date ? b.toISOString() : typeof b == "number" ? new Date(b).toISOString() : null;
|
|
4164
|
+
}, this.asDateTime = function(b) {
|
|
4165
|
+
return typeof b == "string" ? y(b) : b;
|
|
4166
|
+
}, this.xml2dom = function(b) {
|
|
4167
|
+
return R(b);
|
|
4168
|
+
}, this.dom2js = function(b) {
|
|
4169
|
+
return E(b, null);
|
|
4170
|
+
}, this.js2dom = function(b) {
|
|
4171
|
+
var w = this.js2xml(b);
|
|
4172
4172
|
return R(w);
|
|
4173
|
-
}, this.xml2js = function(
|
|
4174
|
-
var w = R(
|
|
4173
|
+
}, this.xml2js = function(b) {
|
|
4174
|
+
var w = R(b);
|
|
4175
4175
|
return w != null ? this.dom2js(w) : null;
|
|
4176
|
-
}, this.js2xml = function(
|
|
4177
|
-
return
|
|
4176
|
+
}, this.js2xml = function(b) {
|
|
4177
|
+
return M(b);
|
|
4178
4178
|
}, this.getVersion = function() {
|
|
4179
4179
|
return i;
|
|
4180
4180
|
};
|
|
@@ -4227,15 +4227,15 @@ function Nt(n, e, t) {
|
|
|
4227
4227
|
return n + (e - n) * t;
|
|
4228
4228
|
}
|
|
4229
4229
|
function sr(n, e, t, r = 5, i = 1.2) {
|
|
4230
|
-
function o(h, a,
|
|
4231
|
-
return Math.exp(-(h * h + a * a) / (2 *
|
|
4230
|
+
function o(h, a, v) {
|
|
4231
|
+
return Math.exp(-(h * h + a * a) / (2 * v * v));
|
|
4232
4232
|
}
|
|
4233
4233
|
const u = Math.floor(r / 2);
|
|
4234
4234
|
let s = [], l = 0;
|
|
4235
4235
|
for (let h = -u; h <= u; h++)
|
|
4236
4236
|
for (let a = -u; a <= u; a++) {
|
|
4237
|
-
const
|
|
4238
|
-
s.push(
|
|
4237
|
+
const v = o(a, h, i);
|
|
4238
|
+
s.push(v), l += v;
|
|
4239
4239
|
}
|
|
4240
4240
|
s = s.map((h) => h / l);
|
|
4241
4241
|
const d = Array.from(
|
|
@@ -4248,13 +4248,13 @@ function sr(n, e, t, r = 5, i = 1.2) {
|
|
|
4248
4248
|
d[h][a] = void 0;
|
|
4249
4249
|
continue;
|
|
4250
4250
|
}
|
|
4251
|
-
let
|
|
4252
|
-
for (let
|
|
4251
|
+
let v = 0, y = 0, A = 0;
|
|
4252
|
+
for (let D = -u; D <= u; D++)
|
|
4253
4253
|
for (let p = -u; p <= u; p++) {
|
|
4254
|
-
const E = Math.min(e - 1, Math.max(0, a + p)),
|
|
4255
|
-
B !== void 0 && (
|
|
4254
|
+
const E = Math.min(e - 1, Math.max(0, a + p)), P = Math.min(t - 1, Math.max(0, h + D)), B = n[P][E];
|
|
4255
|
+
B !== void 0 && (v += B * s[A], y += s[A]), A++;
|
|
4256
4256
|
}
|
|
4257
|
-
d[h][a] = y > 0 ?
|
|
4257
|
+
d[h][a] = y > 0 ? v / y : void 0;
|
|
4258
4258
|
}
|
|
4259
4259
|
return d;
|
|
4260
4260
|
}
|
|
@@ -4304,62 +4304,62 @@ function Vi(n, e, t, r) {
|
|
|
4304
4304
|
});
|
|
4305
4305
|
}
|
|
4306
4306
|
function $t(n, e, t, r, i) {
|
|
4307
|
-
const o = Math.floor(e), u = Math.min(o + 1, r - 1), s = Math.floor(t), l = Math.min(s + 1, i - 1), d = n[s * r + o], h = n[s * r + u], a = n[l * r + o],
|
|
4308
|
-
return d * (1 - y) * (1 - A) + h * y * (1 - A) + a * (1 - y) * A +
|
|
4307
|
+
const o = Math.floor(e), u = Math.min(o + 1, r - 1), s = Math.floor(t), l = Math.min(s + 1, i - 1), d = n[s * r + o], h = n[s * r + u], a = n[l * r + o], v = n[l * r + u], y = e - o, A = t - s;
|
|
4308
|
+
return d * (1 - y) * (1 - A) + h * y * (1 - A) + a * (1 - y) * A + v * y * A;
|
|
4309
4309
|
}
|
|
4310
4310
|
async function it(n, e, t, r, i) {
|
|
4311
4311
|
let o = 0, u = 0;
|
|
4312
4312
|
const s = document.createElement("canvas"), l = s.getContext("2d"), d = new Image(), h = await Rn(n, r, i?.signal);
|
|
4313
|
-
return d.src = h, new Promise((a,
|
|
4313
|
+
return d.src = h, new Promise((a, v) => {
|
|
4314
4314
|
d.onload = () => {
|
|
4315
4315
|
o = d.width, u = d.height, s.width = o, s.height = u, l.clearRect(0, 0, o, u), l.drawImage(d, 0, 0);
|
|
4316
|
-
const A = l.getImageData(0, 0, o, u).data, [
|
|
4317
|
-
const R = (
|
|
4316
|
+
const A = l.getImageData(0, 0, o, u).data, [D, p] = e, E = (F, M) => {
|
|
4317
|
+
const R = (M * o + F) * 4;
|
|
4318
4318
|
return [
|
|
4319
4319
|
A[R] ?? 0,
|
|
4320
4320
|
A[R + 1] ?? 0,
|
|
4321
4321
|
A[R + 2] ?? 0,
|
|
4322
4322
|
A[R + 3] ?? 0
|
|
4323
4323
|
];
|
|
4324
|
-
},
|
|
4324
|
+
}, P = (F, M, R, g, b = 4) => Math.abs(F - g[0]) <= b && Math.abs(M - g[1]) <= b && Math.abs(R - g[2]) <= b, B = i?.detectNoDataByBorderColor !== !1;
|
|
4325
4325
|
let S = [];
|
|
4326
|
-
const X = (F,
|
|
4326
|
+
const X = (F, M, R) => S.some((g) => P(F, M, R, g, 6));
|
|
4327
4327
|
if (B) {
|
|
4328
|
-
const F = E(0, 0),
|
|
4329
|
-
for (const I of
|
|
4330
|
-
const H = w.find((G) =>
|
|
4328
|
+
const F = E(0, 0), M = E(Math.max(0, o - 1), 0), R = E(0, Math.max(0, u - 1)), g = E(Math.max(0, o - 1), Math.max(0, u - 1)), b = [F, M, R, g].filter((I) => I[3] > 0).map((I) => [I[0], I[1], I[2]]), w = [];
|
|
4329
|
+
for (const I of b) {
|
|
4330
|
+
const H = w.find((G) => P(I[0], I[1], I[2], G.rgb, 6));
|
|
4331
4331
|
H ? H.count += 1 : w.push({ rgb: I, count: 1 });
|
|
4332
4332
|
}
|
|
4333
4333
|
w.sort((I, H) => H.count - I.count);
|
|
4334
4334
|
const L = w[0];
|
|
4335
4335
|
S = L && L.count >= 3 ? [L.rgb] : [];
|
|
4336
4336
|
}
|
|
4337
|
-
const
|
|
4338
|
-
if (F < 0 || F >=
|
|
4339
|
-
const
|
|
4340
|
-
(A[
|
|
4337
|
+
const O = o * u, N = new Uint8Array(O), z = [], C = (F) => {
|
|
4338
|
+
if (F < 0 || F >= O || N[F]) return;
|
|
4339
|
+
const M = F * 4, R = A[M] ?? 0, g = A[M + 1] ?? 0, b = A[M + 2] ?? 0;
|
|
4340
|
+
(A[M + 3] ?? 0) > 0 && S.length > 0 && X(R, g, b) && (N[F] = 1, z.push(F));
|
|
4341
4341
|
};
|
|
4342
4342
|
for (let F = 0; F < o; F++)
|
|
4343
4343
|
C(F), C((u - 1) * o + F);
|
|
4344
4344
|
for (let F = 0; F < u; F++)
|
|
4345
4345
|
C(F * o), C(F * o + (o - 1));
|
|
4346
4346
|
for (let F = 0; F < z.length; F++) {
|
|
4347
|
-
const
|
|
4348
|
-
R > 0 && C(
|
|
4347
|
+
const M = z[F], R = M % o, g = Math.floor(M / o);
|
|
4348
|
+
R > 0 && C(M - 1), R < o - 1 && C(M + 1), g > 0 && C(M - o), g < u - 1 && C(M + o);
|
|
4349
4349
|
}
|
|
4350
|
-
const
|
|
4350
|
+
const T = [];
|
|
4351
4351
|
for (let F = 0; F < u; F++)
|
|
4352
|
-
for (let
|
|
4353
|
-
const R = (F * o +
|
|
4354
|
-
if ((A[R + 3] ?? 0) === 0 ||
|
|
4355
|
-
|
|
4352
|
+
for (let M = 0; M < o; M++) {
|
|
4353
|
+
const R = (F * o + M) * 4, g = F * o + M, b = A[R] ?? 0, w = A[R + 1] ?? 0, L = A[R + 2] ?? 0;
|
|
4354
|
+
if ((A[R + 3] ?? 0) === 0 || N[g] === 1) {
|
|
4355
|
+
T.push(void 0);
|
|
4356
4356
|
continue;
|
|
4357
4357
|
}
|
|
4358
|
-
const H = 0.299 *
|
|
4359
|
-
G <
|
|
4358
|
+
const H = 0.299 * b + 0.587 * w + 0.114 * L, G = D + H / 255 * (p - D);
|
|
4359
|
+
G < D ? t?.[0] ? T.push(void 0) : T.push(D) : G > p ? t?.[1] ? T.push(void 0) : T.push(p) : T.push(G);
|
|
4360
4360
|
}
|
|
4361
|
-
a({ grayArr:
|
|
4362
|
-
}, d.onerror = () =>
|
|
4361
|
+
a({ grayArr: T, width: o, height: u });
|
|
4362
|
+
}, d.onerror = () => v(new Error(`Failed to decode image response: ${n}`));
|
|
4363
4363
|
});
|
|
4364
4364
|
}
|
|
4365
4365
|
function et(n) {
|
|
@@ -4411,14 +4411,14 @@ function Yr(n, e) {
|
|
|
4411
4411
|
const i = n.length, o = Math.max(0, Math.min(i, Math.floor(Math.min(t, r)))), u = Math.max(0, Math.min(i, Math.ceil(Math.max(t, r))));
|
|
4412
4412
|
return n.slice(o, u);
|
|
4413
4413
|
}
|
|
4414
|
-
function
|
|
4414
|
+
function Ct(n, e) {
|
|
4415
4415
|
const t = Yr(n, e);
|
|
4416
4416
|
if (!t.length) return;
|
|
4417
4417
|
const r = t.find((s) => s?.scope?.length), i = [...t].reverse().find((s) => s?.scope?.length), o = r?.scope?.length ? Number(r.scope[0]) : void 0, u = i?.scope?.length ? Number(i.scope[i.scope.length - 1]) : void 0;
|
|
4418
4418
|
if (!(typeof o > "u" || isNaN(o)))
|
|
4419
4419
|
return typeof u > "u" || isNaN(u) ? [o, o] : [o, u];
|
|
4420
4420
|
}
|
|
4421
|
-
function
|
|
4421
|
+
function xe(n, e) {
|
|
4422
4422
|
const t = [], r = {}, i = Yr(n, e);
|
|
4423
4423
|
for (const u of i) {
|
|
4424
4424
|
const s = u?.scope?.length ? Number(u.scope[0]) : NaN;
|
|
@@ -4450,33 +4450,33 @@ async function Gt(n) {
|
|
|
4450
4450
|
if (!i) return;
|
|
4451
4451
|
const { extent: s, scope: l, legend: d, legendScope: h } = i;
|
|
4452
4452
|
if (!s) return;
|
|
4453
|
-
const a = Et(s),
|
|
4454
|
-
qt(l?.[0]) && (
|
|
4455
|
-
const { grayArr: y, width: A, height:
|
|
4453
|
+
const a = Et(s), v = [-99999, 99999];
|
|
4454
|
+
qt(l?.[0]) && (v[0] = l[0]), qt(l?.[1]) && (v[1] = l[1]);
|
|
4455
|
+
const { grayArr: y, width: A, height: D } = await it(
|
|
4456
4456
|
o,
|
|
4457
|
-
|
|
4457
|
+
v,
|
|
4458
4458
|
void 0,
|
|
4459
4459
|
u,
|
|
4460
4460
|
{ signal: n.signal }
|
|
4461
|
-
), { uniqueThresholds: p, colorMap: E } =
|
|
4462
|
-
for (let
|
|
4463
|
-
|
|
4464
|
-
for (let
|
|
4465
|
-
|
|
4461
|
+
), { uniqueThresholds: p, colorMap: E } = xe(d, h), P = [];
|
|
4462
|
+
for (let O = 0; O < D; O++) {
|
|
4463
|
+
P[O] = [];
|
|
4464
|
+
for (let N = 0; N < A; N++)
|
|
4465
|
+
P[O][N] = y[O * A + N];
|
|
4466
4466
|
}
|
|
4467
|
-
const B = sr(
|
|
4468
|
-
for (let
|
|
4469
|
-
S[
|
|
4470
|
-
for (let
|
|
4471
|
-
const z =
|
|
4472
|
-
S[
|
|
4473
|
-
const C = B[
|
|
4474
|
-
X[
|
|
4467
|
+
const B = sr(P, A, D), S = [], X = [];
|
|
4468
|
+
for (let O = 0; O < D; O++) {
|
|
4469
|
+
S[O] = [], X[O] = [];
|
|
4470
|
+
for (let N = 0; N < A; N++) {
|
|
4471
|
+
const z = P[O] && typeof P[O][N] < "u" ? P[O][N] : void 0;
|
|
4472
|
+
S[O][N] = z == null || isNaN(Number(z)) ? NaN : Number(z);
|
|
4473
|
+
const C = B[O] && typeof B[O][N] < "u" ? B[O][N] : void 0;
|
|
4474
|
+
X[O][N] = C == null || isNaN(Number(C)) ? NaN : Number(C);
|
|
4475
4475
|
}
|
|
4476
4476
|
}
|
|
4477
4477
|
return {
|
|
4478
4478
|
width: A,
|
|
4479
|
-
height:
|
|
4479
|
+
height: D,
|
|
4480
4480
|
extent: a,
|
|
4481
4481
|
rawArr2D: S,
|
|
4482
4482
|
smoothArr2D: X,
|
|
@@ -4503,35 +4503,35 @@ function Jr(n, e) {
|
|
|
4503
4503
|
function Vn(n, e, t) {
|
|
4504
4504
|
const r = (X) => {
|
|
4505
4505
|
if (Array.isArray(X) && X.length >= 2) {
|
|
4506
|
-
const
|
|
4507
|
-
if (Number.isFinite(
|
|
4506
|
+
const O = Number(X[0]), N = Number(X[1]);
|
|
4507
|
+
if (Number.isFinite(O) && Number.isFinite(N)) return [O, N];
|
|
4508
4508
|
}
|
|
4509
4509
|
if (typeof X == "string") {
|
|
4510
|
-
const
|
|
4511
|
-
if (
|
|
4510
|
+
const O = X.split(",").map((N) => Number(N.trim())).filter((N) => Number.isFinite(N));
|
|
4511
|
+
if (O.length >= 2) return [O[0], O[1]];
|
|
4512
4512
|
}
|
|
4513
|
-
}, i =
|
|
4513
|
+
}, i = Ce(), o = Number(t?.imageSize ?? i.imageSize), u = Number.isFinite(o) && o > 0 ? Math.round(o) : i.imageSize, { bbox: s, width: l, height: d } = Jr(n.config.extent, u), h = n?.config?.layerConfig ?? {}, a = h.LAYERS, v = String(h.VERSION ?? "1.1.1"), y = v.startsWith("1.3") ? { CRS: "EPSG:3857" } : { SRS: "EPSG:3857" }, A = r(n?.config?.scope) ?? [0, 0], D = r(n?.config?.componentScope) ?? r(n?.config?.uvScope) ?? r(h.COMPONENT_SCALE_RANGE) ?? r(h.COMPONENT_SCOPE) ?? r(h.UV_SCOPE);
|
|
4514
4514
|
let p = A;
|
|
4515
4515
|
if (Ar(a) && a.length > 1)
|
|
4516
|
-
if (
|
|
4517
|
-
const X = Math.max(Math.abs(
|
|
4516
|
+
if (D) {
|
|
4517
|
+
const X = Math.max(Math.abs(D[0]), Math.abs(D[1]));
|
|
4518
4518
|
p = [-X, X];
|
|
4519
4519
|
} else {
|
|
4520
|
-
const X = Number(A[0]),
|
|
4521
|
-
if (Number.isFinite(X) && Number.isFinite(
|
|
4522
|
-
const
|
|
4523
|
-
p = [-
|
|
4520
|
+
const X = Number(A[0]), O = Number(A[1]);
|
|
4521
|
+
if (Number.isFinite(X) && Number.isFinite(O)) {
|
|
4522
|
+
const N = Math.max(Math.abs(X), Math.abs(O));
|
|
4523
|
+
p = [-N, N];
|
|
4524
4524
|
}
|
|
4525
4525
|
}
|
|
4526
|
-
const E = p.toString(),
|
|
4526
|
+
const E = p.toString(), P = String(
|
|
4527
4527
|
t?.serviceBaseUrl ?? n?.serviceBaseUrl ?? n?.config?.serviceBaseUrl ?? i.serviceBaseUrl
|
|
4528
|
-
).replace(/\/$/, ""), B = String(n.url || "").replace(/^\/+/, ""), S = `${
|
|
4528
|
+
).replace(/\/$/, ""), B = String(n.url || "").replace(/^\/+/, ""), S = `${P}/wms/${B}`;
|
|
4529
4529
|
if (Ar(a)) {
|
|
4530
4530
|
const X = [];
|
|
4531
|
-
return a.forEach((
|
|
4532
|
-
const
|
|
4531
|
+
return a.forEach((O) => {
|
|
4532
|
+
const N = {
|
|
4533
4533
|
SERVICE: "WMS",
|
|
4534
|
-
VERSION:
|
|
4534
|
+
VERSION: v,
|
|
4535
4535
|
REQUEST: "GetMap",
|
|
4536
4536
|
FORMAT: "image/png",
|
|
4537
4537
|
...h,
|
|
@@ -4542,12 +4542,12 @@ function Vn(n, e, t) {
|
|
|
4542
4542
|
WIDTH: "" + l,
|
|
4543
4543
|
HEIGHT: "" + d
|
|
4544
4544
|
};
|
|
4545
|
-
|
|
4545
|
+
N.LAYERS = O, X.push(`${S}?${new URLSearchParams(N).toString()}`);
|
|
4546
4546
|
}), X;
|
|
4547
4547
|
} else {
|
|
4548
4548
|
const X = {
|
|
4549
4549
|
SERVICE: "WMS",
|
|
4550
|
-
VERSION:
|
|
4550
|
+
VERSION: v,
|
|
4551
4551
|
REQUEST: "GetMap",
|
|
4552
4552
|
FORMAT: "image/png",
|
|
4553
4553
|
...h,
|
|
@@ -4584,8 +4584,8 @@ function ki(n, e, t, r) {
|
|
|
4584
4584
|
i = A;
|
|
4585
4585
|
break;
|
|
4586
4586
|
}
|
|
4587
|
-
const o = e[i], u = e[i + 1], s = (n - o) / (u - o), l = t[i], d = t[i + 1], h = Math.round(Nt(l[0], d[0], s)), a = Math.round(Nt(l[1], d[1], s)),
|
|
4588
|
-
return [h, a,
|
|
4587
|
+
const o = e[i], u = e[i + 1], s = (n - o) / (u - o), l = t[i], d = t[i + 1], h = Math.round(Nt(l[0], d[0], s)), a = Math.round(Nt(l[1], d[1], s)), v = Math.round(Nt(l[2], d[2], s)), y = Math.round(Nt(l[3] ?? 255, d[3] ?? 255, s));
|
|
4588
|
+
return [h, a, v, y];
|
|
4589
4589
|
}
|
|
4590
4590
|
}
|
|
4591
4591
|
const kn = new Hn({ attributePrefix: "" });
|
|
@@ -4652,12 +4652,12 @@ function Nr(n) {
|
|
|
4652
4652
|
});
|
|
4653
4653
|
}
|
|
4654
4654
|
async function Un(n, e, t, r, i, o, u) {
|
|
4655
|
-
const s =
|
|
4655
|
+
const s = Ce(), l = [
|
|
4656
4656
|
t.west,
|
|
4657
4657
|
t.south,
|
|
4658
4658
|
t.east,
|
|
4659
4659
|
t.north
|
|
4660
|
-
], { bbox: d, width: h, height: a } = Jr(l, s.imageSize),
|
|
4660
|
+
], { bbox: d, width: h, height: a } = Jr(l, s.imageSize), v = new URLSearchParams({
|
|
4661
4661
|
service: "WMS",
|
|
4662
4662
|
version: "1.3.0",
|
|
4663
4663
|
request: "GetMetadata",
|
|
@@ -4669,18 +4669,18 @@ async function Un(n, e, t, r, i, o, u) {
|
|
|
4669
4669
|
time: r || "",
|
|
4670
4670
|
width: String(h),
|
|
4671
4671
|
height: String(a)
|
|
4672
|
-
}), y = o ?? s.serviceBaseUrl, A = String(n).replace(/^\/+/, ""),
|
|
4672
|
+
}), y = o ?? s.serviceBaseUrl, A = String(n).replace(/^\/+/, ""), D = await ir("wms/" + A + "?" + v.toString(), {
|
|
4673
4673
|
baseUrl: y,
|
|
4674
4674
|
authorization: i,
|
|
4675
4675
|
signal: u
|
|
4676
|
-
}), p = (
|
|
4676
|
+
}), p = (D.headers.get("content-type") || "").toLowerCase();
|
|
4677
4677
|
if (!p.includes("json")) {
|
|
4678
|
-
const E = await
|
|
4678
|
+
const E = await D.text();
|
|
4679
4679
|
throw new Error(
|
|
4680
4680
|
"WMS min/max response has invalid content type: " + (p || "unknown") + "; " + E.slice(0, 240)
|
|
4681
4681
|
);
|
|
4682
4682
|
}
|
|
4683
|
-
return await
|
|
4683
|
+
return await D.json();
|
|
4684
4684
|
}
|
|
4685
4685
|
async function Yn(n, e, t = {}) {
|
|
4686
4686
|
try {
|
|
@@ -4695,7 +4695,7 @@ async function Yn(n, e, t = {}) {
|
|
|
4695
4695
|
}
|
|
4696
4696
|
}
|
|
4697
4697
|
async function Pr(n) {
|
|
4698
|
-
const e =
|
|
4698
|
+
const e = Ce(), t = n.authorization ?? e.serviceAuthorization, r = n.serviceBaseUrl ?? e.serviceBaseUrl;
|
|
4699
4699
|
let i = n.filePath, o;
|
|
4700
4700
|
for (let p = 0; p < 6; p++) {
|
|
4701
4701
|
if (o = await Yn(i, t, {
|
|
@@ -4713,23 +4713,23 @@ async function Pr(n) {
|
|
|
4713
4713
|
d.replace(/\/$/, "") + l + "/dataset.xml",
|
|
4714
4714
|
t,
|
|
4715
4715
|
{ baseUrl: r, signal: n.signal }
|
|
4716
|
-
), { latLonBox: a, timeSpan:
|
|
4717
|
-
if (A &&
|
|
4716
|
+
), { latLonBox: a, timeSpan: v, axis: y } = jn(h), A = y.find((p) => p.name === "time"), D = [];
|
|
4717
|
+
if (A && v?.begin) {
|
|
4718
4718
|
const p = Number(A.values?.npts), E = String(
|
|
4719
4719
|
A.attribute?.find((S) => S.name === "units")?.value || ""
|
|
4720
|
-
).toLowerCase(),
|
|
4720
|
+
).toLowerCase(), P = E.includes("hour") ? "hour" : E.includes("minute") ? "minute" : "second", B = Number(A.values?.resolution);
|
|
4721
4721
|
if (p > 1 && Number.isFinite(B) && B !== 0)
|
|
4722
4722
|
for (let S = 0; S < p; S++)
|
|
4723
|
-
|
|
4724
|
-
Je(
|
|
4723
|
+
D.push(
|
|
4724
|
+
Je(v.begin).add(S * B, P).format("YYYYMMDDHHmmss")
|
|
4725
4725
|
);
|
|
4726
4726
|
else
|
|
4727
|
-
|
|
4727
|
+
D.push(Je(v.begin).format("YYYYMMDDHHmmss"));
|
|
4728
4728
|
}
|
|
4729
4729
|
return {
|
|
4730
4730
|
type: "file",
|
|
4731
4731
|
latLonBox: a,
|
|
4732
|
-
timeList:
|
|
4732
|
+
timeList: D,
|
|
4733
4733
|
fileList: o.data,
|
|
4734
4734
|
url: l,
|
|
4735
4735
|
authorization: t
|
|
@@ -4758,22 +4758,22 @@ function Jn(n) {
|
|
|
4758
4758
|
async function Zn(n, e, t, r, i, o) {
|
|
4759
4759
|
const u = n.config?.scope, s = Number(u?.[0]), l = Number(u?.[1]), d = Number.isFinite(s), h = Number.isFinite(l);
|
|
4760
4760
|
if (d && h) return [s, l];
|
|
4761
|
-
const a = Jn(n.config?.layerConfig?.LAYERS),
|
|
4761
|
+
const a = Jn(n.config?.layerConfig?.LAYERS), v = Tr(void 0, n.config?.extent) ?? Tr(i);
|
|
4762
4762
|
if (!a.length) throw new Error('Layer "' + n.id + '" has no WMS LAYERS setting');
|
|
4763
|
-
if (!
|
|
4764
|
-
const y =
|
|
4763
|
+
if (!v) throw new Error('Layer "' + n.id + '" has no valid extent');
|
|
4764
|
+
const y = Ce(), A = n.serviceBaseUrl ?? o.serviceBaseUrl ?? y.serviceBaseUrl, D = t ? Je(t).utc().format("YYYY-MM-DDTHH:mm:ss.000[Z]") : void 0, p = await Promise.all(
|
|
4765
4765
|
a.map(
|
|
4766
4766
|
(X) => Un(
|
|
4767
4767
|
e,
|
|
4768
4768
|
X,
|
|
4769
|
-
b,
|
|
4770
4769
|
v,
|
|
4770
|
+
D,
|
|
4771
4771
|
r,
|
|
4772
4772
|
A,
|
|
4773
4773
|
o.signal
|
|
4774
4774
|
)
|
|
4775
4775
|
)
|
|
4776
|
-
), E = Math.min(...p.map((X) => Number(X.min))),
|
|
4776
|
+
), E = Math.min(...p.map((X) => Number(X.min))), P = Math.max(...p.map((X) => Number(X.max))), B = d ? s : E, S = h ? l : P;
|
|
4777
4777
|
if (!Number.isFinite(B) || !Number.isFinite(S))
|
|
4778
4778
|
throw new Error('Invalid WMS min/max response for layer "' + n.id + '"');
|
|
4779
4779
|
return [B, S];
|
|
@@ -4781,7 +4781,7 @@ async function Zn(n, e, t, r, i, o) {
|
|
|
4781
4781
|
async function ji(n, e = {}) {
|
|
4782
4782
|
const t = Array.isArray(n.type) ? n.type : [n.type];
|
|
4783
4783
|
if (t.includes("typhoon")) return { ...n, show: !0 };
|
|
4784
|
-
const r =
|
|
4784
|
+
const r = Ce();
|
|
4785
4785
|
let i = n.url, o = n.time, u = n.authorization ?? e.authorization ?? r.serviceAuthorization, s;
|
|
4786
4786
|
if (!i) {
|
|
4787
4787
|
let a = await Pr({
|
|
@@ -5008,7 +5008,7 @@ fn main(@builtin(global_invocation_id) gid: vec3<u32>) {
|
|
|
5008
5008
|
}
|
|
5009
5009
|
`;
|
|
5010
5010
|
}
|
|
5011
|
-
function
|
|
5011
|
+
function vt(n, e, t) {
|
|
5012
5012
|
const r = n.createBuffer({
|
|
5013
5013
|
size: e.byteLength,
|
|
5014
5014
|
usage: t,
|
|
@@ -5053,7 +5053,7 @@ function to(n, e, t, r) {
|
|
|
5053
5053
|
for (let s = 0; s < i; s++) {
|
|
5054
5054
|
const l = e[s] ?? 0, d = e[s + 1] ?? l;
|
|
5055
5055
|
if (n < l || n > d) continue;
|
|
5056
|
-
const h = t[s] ?? [0, 0, 0, 0], a = t[s + 1] ?? h,
|
|
5056
|
+
const h = t[s] ?? [0, 0, 0, 0], a = t[s + 1] ?? h, v = Math.max(d - l, 1e-6), y = Math.max(0, Math.min(1, (n - l) / v));
|
|
5057
5057
|
return [
|
|
5058
5058
|
h[0] + (a[0] - h[0]) * y,
|
|
5059
5059
|
h[1] + (a[1] - h[1]) * y,
|
|
@@ -5080,28 +5080,28 @@ function ro(n) {
|
|
|
5080
5080
|
h.width = e, h.height = t;
|
|
5081
5081
|
const a = h.getContext("2d");
|
|
5082
5082
|
if (!a) return null;
|
|
5083
|
-
const
|
|
5083
|
+
const v = a.createImageData(e, t), y = v.data;
|
|
5084
5084
|
for (let A = 0; A < t; A++)
|
|
5085
|
-
for (let
|
|
5086
|
-
const E = (A * e +
|
|
5087
|
-
if (!Lr(
|
|
5085
|
+
for (let D = 0; D < e; D++) {
|
|
5086
|
+
const E = (A * e + D) * 4, P = r?.[A]?.[D];
|
|
5087
|
+
if (!Lr(P, l)) {
|
|
5088
5088
|
y[E] = 0, y[E + 1] = 0, y[E + 2] = 0, y[E + 3] = 0;
|
|
5089
5089
|
continue;
|
|
5090
5090
|
}
|
|
5091
|
-
const B = i?.[A]?.[
|
|
5091
|
+
const B = i?.[A]?.[D];
|
|
5092
5092
|
if (!Zr(B)) {
|
|
5093
5093
|
y[E] = 0, y[E + 1] = 0, y[E + 2] = 0, y[E + 3] = 0;
|
|
5094
5094
|
continue;
|
|
5095
5095
|
}
|
|
5096
5096
|
const S = to(Number(B), o, u, s);
|
|
5097
|
-
let X = 0,
|
|
5097
|
+
let X = 0, O = 0;
|
|
5098
5098
|
for (let F = A - 1; F <= A + 1; F++)
|
|
5099
|
-
for (let
|
|
5100
|
-
F < 0 ||
|
|
5101
|
-
const
|
|
5102
|
-
y[E] = Math.max(0, Math.min(255, Math.round(S[0] ?? 0))), y[E + 1] = Math.max(0, Math.min(255, Math.round(S[1] ?? 0))), y[E + 2] = Math.max(0, Math.min(255, Math.round(S[2] ?? 0))), y[E + 3] =
|
|
5099
|
+
for (let M = D - 1; M <= D + 1; M++)
|
|
5100
|
+
F < 0 || M < 0 || F >= t || M >= e || (O += 1, Lr(r?.[F]?.[M], l) && (X += 1));
|
|
5101
|
+
const N = O ? X / O : 0, z = d ? eo(0.58, 0.9, N) : 1, C = S[3] ?? 255, T = Math.max(0, Math.min(255, Math.round(C * z)));
|
|
5102
|
+
y[E] = Math.max(0, Math.min(255, Math.round(S[0] ?? 0))), y[E + 1] = Math.max(0, Math.min(255, Math.round(S[1] ?? 0))), y[E + 2] = Math.max(0, Math.min(255, Math.round(S[2] ?? 0))), y[E + 3] = T;
|
|
5103
5103
|
}
|
|
5104
|
-
return a.putImageData(
|
|
5104
|
+
return a.putImageData(v, 0, 0), h;
|
|
5105
5105
|
}
|
|
5106
5106
|
function Fr(n, e, t) {
|
|
5107
5107
|
const r = n.createShader(e);
|
|
@@ -5149,7 +5149,7 @@ function oo(n) {
|
|
|
5149
5149
|
preserveDrawingBuffer: !0
|
|
5150
5150
|
});
|
|
5151
5151
|
if (!a) return null;
|
|
5152
|
-
const
|
|
5152
|
+
const v = `#version 300 es
|
|
5153
5153
|
in vec2 a_position;
|
|
5154
5154
|
out vec2 v_uv;
|
|
5155
5155
|
void main() {
|
|
@@ -5273,27 +5273,27 @@ void main() {
|
|
|
5273
5273
|
outColor = vec4(c.rgb / 255.0, (c.a / 255.0) * edgeAlpha);
|
|
5274
5274
|
}`;
|
|
5275
5275
|
try {
|
|
5276
|
-
const A = no(a,
|
|
5276
|
+
const A = no(a, v, y);
|
|
5277
5277
|
a.useProgram(A);
|
|
5278
|
-
const
|
|
5278
|
+
const D = new Float32Array([-1, -1, 1, -1, -1, 1, 1, 1]), p = a.createBuffer();
|
|
5279
5279
|
if (!p)
|
|
5280
5280
|
return a.deleteProgram(A), null;
|
|
5281
|
-
a.bindBuffer(a.ARRAY_BUFFER, p), a.bufferData(a.ARRAY_BUFFER,
|
|
5281
|
+
a.bindBuffer(a.ARRAY_BUFFER, p), a.bufferData(a.ARRAY_BUFFER, D, a.STATIC_DRAW);
|
|
5282
5282
|
const E = a.getAttribLocation(A, "a_position");
|
|
5283
5283
|
if (E < 0)
|
|
5284
5284
|
return a.deleteBuffer(p), a.deleteProgram(A), null;
|
|
5285
5285
|
a.enableVertexAttribArray(E), a.vertexAttribPointer(E, 2, a.FLOAT, !1, 0, 0);
|
|
5286
|
-
const
|
|
5287
|
-
if (!
|
|
5286
|
+
const P = a.createTexture();
|
|
5287
|
+
if (!P)
|
|
5288
5288
|
return a.deleteBuffer(p), a.deleteProgram(A), null;
|
|
5289
5289
|
const B = a.createTexture();
|
|
5290
5290
|
if (!B)
|
|
5291
|
-
return a.deleteTexture(
|
|
5291
|
+
return a.deleteTexture(P), a.deleteBuffer(p), a.deleteProgram(A), null;
|
|
5292
5292
|
const S = a.createTexture();
|
|
5293
5293
|
if (!S)
|
|
5294
|
-
return a.deleteTexture(B), a.deleteTexture(
|
|
5295
|
-
const X = Vt(e, t, i),
|
|
5296
|
-
a.activeTexture(a.TEXTURE0), a.bindTexture(a.TEXTURE_2D,
|
|
5294
|
+
return a.deleteTexture(B), a.deleteTexture(P), a.deleteBuffer(p), a.deleteProgram(A), null;
|
|
5295
|
+
const X = Vt(e, t, i), O = Vt(e, t, r), N = Kn(e, t, r);
|
|
5296
|
+
a.activeTexture(a.TEXTURE0), a.bindTexture(a.TEXTURE_2D, P), a.pixelStorei(a.UNPACK_ALIGNMENT, 1), a.texParameteri(a.TEXTURE_2D, a.TEXTURE_MIN_FILTER, a.NEAREST), a.texParameteri(a.TEXTURE_2D, a.TEXTURE_MAG_FILTER, a.NEAREST), a.texParameteri(a.TEXTURE_2D, a.TEXTURE_WRAP_S, a.CLAMP_TO_EDGE), a.texParameteri(a.TEXTURE_2D, a.TEXTURE_WRAP_T, a.CLAMP_TO_EDGE), a.texImage2D(a.TEXTURE_2D, 0, a.R32F, e, t, 0, a.RED, a.FLOAT, X), a.activeTexture(a.TEXTURE1), a.bindTexture(a.TEXTURE_2D, B), a.texParameteri(a.TEXTURE_2D, a.TEXTURE_MIN_FILTER, a.NEAREST), a.texParameteri(a.TEXTURE_2D, a.TEXTURE_MAG_FILTER, a.NEAREST), a.texParameteri(a.TEXTURE_2D, a.TEXTURE_WRAP_S, a.CLAMP_TO_EDGE), a.texParameteri(a.TEXTURE_2D, a.TEXTURE_WRAP_T, a.CLAMP_TO_EDGE), a.texImage2D(a.TEXTURE_2D, 0, a.R32F, e, t, 0, a.RED, a.FLOAT, O), a.activeTexture(a.TEXTURE2), a.bindTexture(a.TEXTURE_2D, S), a.texParameteri(a.TEXTURE_2D, a.TEXTURE_MIN_FILTER, a.LINEAR), a.texParameteri(a.TEXTURE_2D, a.TEXTURE_MAG_FILTER, a.LINEAR), a.texParameteri(a.TEXTURE_2D, a.TEXTURE_WRAP_S, a.CLAMP_TO_EDGE), a.texParameteri(a.TEXTURE_2D, a.TEXTURE_WRAP_T, a.CLAMP_TO_EDGE), a.texImage2D(
|
|
5297
5297
|
a.TEXTURE_2D,
|
|
5298
5298
|
0,
|
|
5299
5299
|
a.R8,
|
|
@@ -5302,16 +5302,16 @@ void main() {
|
|
|
5302
5302
|
0,
|
|
5303
5303
|
a.RED,
|
|
5304
5304
|
a.UNSIGNED_BYTE,
|
|
5305
|
-
|
|
5305
|
+
N
|
|
5306
5306
|
);
|
|
5307
|
-
const z = new Float32Array(Ue), C = new Float32Array(Ue * 4),
|
|
5308
|
-
for (let
|
|
5309
|
-
z[
|
|
5310
|
-
const w = u[
|
|
5307
|
+
const z = new Float32Array(Ue), C = new Float32Array(Ue * 4), T = Math.min(o.length, Ue);
|
|
5308
|
+
for (let b = 0; b < T; b++) {
|
|
5309
|
+
z[b] = o[b] ?? 0;
|
|
5310
|
+
const w = u[b] ?? [0, 0, 0, 0], L = b * 4;
|
|
5311
5311
|
C[L] = w[0], C[L + 1] = w[1], C[L + 2] = w[2], C[L + 3] = w[3] ?? 255;
|
|
5312
5312
|
}
|
|
5313
|
-
const F = l && typeof l[0] < "u" ? Number(l[0]) : 0,
|
|
5314
|
-
return a.uniform1i(a.getUniformLocation(A, "u_values"), 0), a.uniform1i(a.getUniformLocation(A, "u_maskValues"), 1), a.uniform1i(a.getUniformLocation(A, "u_validMask"), 2), a.uniform1i(a.getUniformLocation(A, "u_thresholdCount"),
|
|
5313
|
+
const F = l && typeof l[0] < "u" ? Number(l[0]) : 0, M = l && typeof l[1] < "u" ? Number(l[1]) : 0, R = l && typeof l[0] < "u" ? 1 : 0, g = l && typeof l[1] < "u" ? 1 : 0;
|
|
5314
|
+
return a.uniform1i(a.getUniformLocation(A, "u_values"), 0), a.uniform1i(a.getUniformLocation(A, "u_maskValues"), 1), a.uniform1i(a.getUniformLocation(A, "u_validMask"), 2), a.uniform1i(a.getUniformLocation(A, "u_thresholdCount"), T), a.uniform1i(a.getUniformLocation(A, "u_colorMode"), s === "gradient" ? 1 : 0), a.uniform1fv(a.getUniformLocation(A, "u_thresholds"), z), a.uniform4fv(a.getUniformLocation(A, "u_colors"), C), a.uniform1f(a.getUniformLocation(A, "u_minScope"), F), a.uniform1f(a.getUniformLocation(A, "u_maxScope"), M), a.uniform1i(a.getUniformLocation(A, "u_hasMin"), R), a.uniform1i(a.getUniformLocation(A, "u_hasMax"), g), a.uniform1i(a.getUniformLocation(A, "u_softenMaskEdge"), d ? 1 : 0), a.viewport(0, 0, e, t), a.clearColor(0, 0, 0, 0), a.clear(a.COLOR_BUFFER_BIT), a.drawArrays(a.TRIANGLE_STRIP, 0, 4), a.activeTexture(a.TEXTURE2), a.bindTexture(a.TEXTURE_2D, null), a.activeTexture(a.TEXTURE1), a.bindTexture(a.TEXTURE_2D, null), a.activeTexture(a.TEXTURE0), a.bindTexture(a.TEXTURE_2D, null), a.bindBuffer(a.ARRAY_BUFFER, null), a.deleteTexture(S), a.deleteTexture(P), a.deleteTexture(B), a.deleteBuffer(p), a.deleteProgram(A), h;
|
|
5315
5315
|
} catch (A) {
|
|
5316
5316
|
return console.warn("[FcstLayer] WebGL2 渲染失败", A), null;
|
|
5317
5317
|
}
|
|
@@ -5333,39 +5333,39 @@ async function io(n) {
|
|
|
5333
5333
|
const h = await _n();
|
|
5334
5334
|
if (!h) return null;
|
|
5335
5335
|
h.pushErrorScope("validation");
|
|
5336
|
-
const a = e * t,
|
|
5336
|
+
const a = e * t, v = Vt(e, t, i), y = Vt(e, t, r), A = new Float32Array(o), D = new Float32Array(A.length * 4);
|
|
5337
5337
|
for (let K = 0; K < A.length; K++) {
|
|
5338
5338
|
const Z = u[K] ?? [0, 0, 0, 0], U = K * 4;
|
|
5339
|
-
|
|
5339
|
+
D[U] = Z[0], D[U + 1] = Z[1], D[U + 2] = Z[2], D[U + 3] = Z[3] ?? 255;
|
|
5340
5340
|
}
|
|
5341
|
-
const p = l && typeof l[0] < "u" ? Number(l[0]) : 0, E = l && typeof l[1] < "u" ? Number(l[1]) : 0,
|
|
5342
|
-
X.setUint32(0, e, !0), X.setUint32(4, t, !0), X.setUint32(8, A.length, !0), X.setUint32(12, s === "gradient" ? 1 : 0, !0), X.setFloat32(16, p, !0), X.setFloat32(20, E, !0), X.setUint32(24,
|
|
5343
|
-
const
|
|
5341
|
+
const p = l && typeof l[0] < "u" ? Number(l[0]) : 0, E = l && typeof l[1] < "u" ? Number(l[1]) : 0, P = l && typeof l[0] < "u" ? 1 : 0, B = l && typeof l[1] < "u" ? 1 : 0, S = new ArrayBuffer(48), X = new DataView(S);
|
|
5342
|
+
X.setUint32(0, e, !0), X.setUint32(4, t, !0), X.setUint32(8, A.length, !0), X.setUint32(12, s === "gradient" ? 1 : 0, !0), X.setFloat32(16, p, !0), X.setFloat32(20, E, !0), X.setUint32(24, P, !0), X.setUint32(28, B, !0), X.setUint32(32, d ? 1 : 0, !0);
|
|
5343
|
+
const O = globalThis.GPUBufferUsage, N = globalThis.GPUMapMode, z = vt(
|
|
5344
5344
|
h,
|
|
5345
|
-
|
|
5346
|
-
|
|
5347
|
-
), C =
|
|
5345
|
+
v.buffer,
|
|
5346
|
+
O.STORAGE | O.COPY_DST
|
|
5347
|
+
), C = vt(
|
|
5348
5348
|
h,
|
|
5349
5349
|
y.buffer,
|
|
5350
|
-
|
|
5351
|
-
),
|
|
5350
|
+
O.STORAGE | O.COPY_DST
|
|
5351
|
+
), T = vt(
|
|
5352
5352
|
h,
|
|
5353
5353
|
A.buffer,
|
|
5354
|
-
|
|
5355
|
-
), F =
|
|
5354
|
+
O.STORAGE | O.COPY_DST
|
|
5355
|
+
), F = vt(
|
|
5356
5356
|
h,
|
|
5357
|
-
|
|
5358
|
-
|
|
5359
|
-
),
|
|
5357
|
+
D.buffer,
|
|
5358
|
+
O.STORAGE | O.COPY_DST
|
|
5359
|
+
), M = vt(
|
|
5360
5360
|
h,
|
|
5361
5361
|
S,
|
|
5362
|
-
|
|
5362
|
+
O.UNIFORM | O.COPY_DST
|
|
5363
5363
|
), R = a * 4, g = h.createBuffer({
|
|
5364
5364
|
size: R,
|
|
5365
|
-
usage:
|
|
5366
|
-
}),
|
|
5365
|
+
usage: O.STORAGE | O.COPY_SRC
|
|
5366
|
+
}), b = h.createBuffer({
|
|
5367
5367
|
size: R,
|
|
5368
|
-
usage:
|
|
5368
|
+
usage: O.COPY_DST | O.MAP_READ
|
|
5369
5369
|
}), w = h.createShaderModule({ code: $n() }), L = h.createComputePipeline({
|
|
5370
5370
|
layout: "auto",
|
|
5371
5371
|
compute: {
|
|
@@ -5377,23 +5377,23 @@ async function io(n) {
|
|
|
5377
5377
|
entries: [
|
|
5378
5378
|
{ binding: 0, resource: { buffer: z } },
|
|
5379
5379
|
{ binding: 1, resource: { buffer: C } },
|
|
5380
|
-
{ binding: 2, resource: { buffer:
|
|
5380
|
+
{ binding: 2, resource: { buffer: T } },
|
|
5381
5381
|
{ binding: 3, resource: { buffer: F } },
|
|
5382
|
-
{ binding: 4, resource: { buffer:
|
|
5382
|
+
{ binding: 4, resource: { buffer: M } },
|
|
5383
5383
|
{ binding: 5, resource: { buffer: g } }
|
|
5384
5384
|
]
|
|
5385
5385
|
}), H = h.createCommandEncoder(), G = H.beginComputePass();
|
|
5386
|
-
G.setPipeline(L), G.setBindGroup(0, I), G.dispatchWorkgroups(Math.ceil(a / 64)), G.end(), H.copyBufferToBuffer(g, 0,
|
|
5386
|
+
G.setPipeline(L), G.setBindGroup(0, I), G.dispatchWorkgroups(Math.ceil(a / 64)), G.end(), H.copyBufferToBuffer(g, 0, b, 0, R), h.queue.submit([H.finish()]);
|
|
5387
5387
|
const Q = await h.popErrorScope();
|
|
5388
5388
|
if (Q)
|
|
5389
|
-
return z.destroy(), C.destroy(),
|
|
5390
|
-
await
|
|
5391
|
-
const J =
|
|
5392
|
-
|
|
5389
|
+
return z.destroy(), C.destroy(), T.destroy(), F.destroy(), M.destroy(), g.destroy(), b.destroy(), console.warn("[FcstLayer] WebGPU validation error", Q), null;
|
|
5390
|
+
await b.mapAsync(N.READ);
|
|
5391
|
+
const J = b.getMappedRange(), Y = new Uint8ClampedArray(J.slice(0));
|
|
5392
|
+
b.unmap();
|
|
5393
5393
|
const j = document.createElement("canvas");
|
|
5394
5394
|
j.width = e, j.height = t;
|
|
5395
5395
|
const W = j.getContext("2d");
|
|
5396
|
-
return W ? (W.putImageData(new ImageData(Y, e, t), 0, 0), z.destroy(), C.destroy(),
|
|
5396
|
+
return W ? (W.putImageData(new ImageData(Y, e, t), 0, 0), z.destroy(), C.destroy(), T.destroy(), F.destroy(), M.destroy(), g.destroy(), b.destroy(), j) : null;
|
|
5397
5397
|
} catch (h) {
|
|
5398
5398
|
return console.warn("[FcstLayer] WebGPU 渲染失败", h), null;
|
|
5399
5399
|
}
|
|
@@ -5477,7 +5477,7 @@ class Kr {
|
|
|
5477
5477
|
if (!this.isCurrentRequest(s)) return;
|
|
5478
5478
|
const h = d ?? await this.getSourceFromParams(l);
|
|
5479
5479
|
if (!this.isCurrentRequest(s) || !h) return;
|
|
5480
|
-
const a = new
|
|
5480
|
+
const a = new yt({
|
|
5481
5481
|
className: e,
|
|
5482
5482
|
source: h,
|
|
5483
5483
|
zIndex: u,
|
|
@@ -5489,7 +5489,7 @@ class Kr {
|
|
|
5489
5489
|
async getSourceFromParams(e = this.options) {
|
|
5490
5490
|
const { config: t } = e, { mode: r, legend: i, legendScope: o } = t, u = await this.getOrLoadContourData(e);
|
|
5491
5491
|
if (!u || e?.signal?.aborted) return;
|
|
5492
|
-
const { rawArr2D: s, smoothArr2D: l, extent: d, width: h, height: a } = u,
|
|
5492
|
+
const { rawArr2D: s, smoothArr2D: l, extent: d, width: h, height: a } = u, v = this.getValueTransformFn(e), y = this.applyValueTransform2D(s, "raw", v), A = this.applyValueTransform2D(l, "smooth", v), { colorMap: D } = xe(i), { colorMap: p } = xe(i, o), E = Ct(i, o) ?? t.scope;
|
|
5493
5493
|
return await this.getFcstRasterSource(
|
|
5494
5494
|
{
|
|
5495
5495
|
smoothArr2D: A,
|
|
@@ -5497,11 +5497,11 @@ class Kr {
|
|
|
5497
5497
|
extent: d,
|
|
5498
5498
|
width: h,
|
|
5499
5499
|
height: a,
|
|
5500
|
-
colorMap:
|
|
5500
|
+
colorMap: D,
|
|
5501
5501
|
selectedColorMap: p,
|
|
5502
5502
|
colorMode: r,
|
|
5503
5503
|
scope: E,
|
|
5504
|
-
rasterCacheKey: this.getRasterRenderCacheKey(e,
|
|
5504
|
+
rasterCacheKey: this.getRasterRenderCacheKey(e, D)
|
|
5505
5505
|
},
|
|
5506
5506
|
e
|
|
5507
5507
|
);
|
|
@@ -5515,14 +5515,14 @@ class Kr {
|
|
|
5515
5515
|
const o = (async () => {
|
|
5516
5516
|
const u = await Gt(e);
|
|
5517
5517
|
if (!u) return null;
|
|
5518
|
-
const { uniqueThresholds: s, rawArr2D: l, smoothArr2D: d, extent: h, width: a, height:
|
|
5518
|
+
const { uniqueThresholds: s, rawArr2D: l, smoothArr2D: d, extent: h, width: a, height: v } = u, y = {
|
|
5519
5519
|
schemaVersion: Tt,
|
|
5520
5520
|
uniqueThresholds: s,
|
|
5521
5521
|
rawArr2D: l,
|
|
5522
5522
|
smoothArr2D: d,
|
|
5523
5523
|
extent: h,
|
|
5524
5524
|
width: a,
|
|
5525
|
-
height:
|
|
5525
|
+
height: v
|
|
5526
5526
|
};
|
|
5527
5527
|
return this.setCachedContourData(t, y), y;
|
|
5528
5528
|
})();
|
|
@@ -5542,16 +5542,16 @@ class Kr {
|
|
|
5542
5542
|
if (!o) return null;
|
|
5543
5543
|
const { rawArr2D: u, smoothArr2D: s, extent: l, width: d, height: h } = o, a = r ? s : u;
|
|
5544
5544
|
if (!a || d <= 0 || h <= 0) return null;
|
|
5545
|
-
const
|
|
5546
|
-
if (
|
|
5547
|
-
const y =
|
|
5548
|
-
if (B <= 0 || S <= 0 || y <
|
|
5549
|
-
const X = (y -
|
|
5545
|
+
const v = rt([e, t]);
|
|
5546
|
+
if (v.length < 2) return null;
|
|
5547
|
+
const y = v[0], A = v[1], [D, p, E, P] = l, B = E - D, S = P - p;
|
|
5548
|
+
if (B <= 0 || S <= 0 || y < D || y > E || A < p || A > P) return null;
|
|
5549
|
+
const X = (y - D) / B * (d - 1), O = (P - A) / S * (h - 1), N = Math.max(0, Math.min(d - 1, Math.round(X))), z = Math.max(0, Math.min(h - 1, Math.round(O))), C = a?.[z]?.[N];
|
|
5550
5550
|
if (C == null || isNaN(Number(C))) return null;
|
|
5551
|
-
const
|
|
5551
|
+
const T = this.applyValueTransformValue(
|
|
5552
5552
|
Number(C),
|
|
5553
5553
|
{
|
|
5554
|
-
x:
|
|
5554
|
+
x: N,
|
|
5555
5555
|
y: z,
|
|
5556
5556
|
width: d,
|
|
5557
5557
|
height: h,
|
|
@@ -5559,7 +5559,7 @@ class Kr {
|
|
|
5559
5559
|
},
|
|
5560
5560
|
this.getValueTransformFn(i)
|
|
5561
5561
|
);
|
|
5562
|
-
return
|
|
5562
|
+
return T == null || isNaN(Number(T)) ? null : Number(T);
|
|
5563
5563
|
}
|
|
5564
5564
|
async getValueByLngLat(e, t, r = !1) {
|
|
5565
5565
|
return this.getValueByLonLat(e, t, r);
|
|
@@ -5571,7 +5571,7 @@ class Kr {
|
|
|
5571
5571
|
if (!s || s.schemaVersion !== Tt)
|
|
5572
5572
|
return this.contourCache.delete(u), null;
|
|
5573
5573
|
this.contourCache.delete(u), this.contourCache.set(u, s);
|
|
5574
|
-
const { colorMap: l } =
|
|
5574
|
+
const { colorMap: l } = xe(i), { colorMap: d } = xe(i, o), h = this.getValueTransformFn(e), a = this.applyValueTransform2D(s.rawArr2D, "raw", h), v = this.applyValueTransform2D(
|
|
5575
5575
|
s.smoothArr2D,
|
|
5576
5576
|
"smooth",
|
|
5577
5577
|
h
|
|
@@ -5580,11 +5580,11 @@ class Kr {
|
|
|
5580
5580
|
{
|
|
5581
5581
|
...s,
|
|
5582
5582
|
rawArr2D: a,
|
|
5583
|
-
smoothArr2D:
|
|
5583
|
+
smoothArr2D: v,
|
|
5584
5584
|
colorMap: l,
|
|
5585
5585
|
selectedColorMap: d,
|
|
5586
5586
|
colorMode: r,
|
|
5587
|
-
scope:
|
|
5587
|
+
scope: Ct(i, o) ?? t.scope,
|
|
5588
5588
|
rasterCacheKey: this.getRasterRenderCacheKey(e, l)
|
|
5589
5589
|
},
|
|
5590
5590
|
e
|
|
@@ -5603,16 +5603,16 @@ class Kr {
|
|
|
5603
5603
|
selectedColorMap: d = l,
|
|
5604
5604
|
colorMode: h = "discrete",
|
|
5605
5605
|
scope: a,
|
|
5606
|
-
rasterCacheKey:
|
|
5607
|
-
} = e, y = Object.keys(l).map((
|
|
5608
|
-
let
|
|
5609
|
-
if (
|
|
5610
|
-
this.rasterRenderCache.delete(
|
|
5606
|
+
rasterCacheKey: v = this.getRasterRenderCacheKey(t, l)
|
|
5607
|
+
} = e, y = Object.keys(l).map((N) => Number(N)).filter((N) => !isNaN(N)).sort((N, z) => N - z), A = y.map((N) => zt(l[N]));
|
|
5608
|
+
let D = this.rasterRenderCache.get(v);
|
|
5609
|
+
if (D)
|
|
5610
|
+
this.rasterRenderCache.delete(v), this.rasterRenderCache.set(v, D);
|
|
5611
5611
|
else {
|
|
5612
|
-
let
|
|
5613
|
-
|
|
5614
|
-
const z = t?.config?.alignWithIsoline === !0, C = t?.config?.isolineSmooth === !1 ? 0 : nt(t?.config?.isolineSmoothness),
|
|
5615
|
-
|
|
5612
|
+
let N = this.rasterRenderLoadingTasks.get(v);
|
|
5613
|
+
N || (N = (async () => {
|
|
5614
|
+
const z = t?.config?.alignWithIsoline === !0, C = t?.config?.isolineSmooth === !1 ? 0 : nt(t?.config?.isolineSmoothness), T = z ? Ur(r, u, s, C) : i, F = r, M = z && h !== "gradient" ? this.createIsolineContourFills(
|
|
5615
|
+
T,
|
|
5616
5616
|
u,
|
|
5617
5617
|
s,
|
|
5618
5618
|
y,
|
|
@@ -5625,7 +5625,7 @@ class Kr {
|
|
|
5625
5625
|
width: Math.max(1, Math.floor(u)),
|
|
5626
5626
|
height: Math.max(1, Math.floor(s)),
|
|
5627
5627
|
rawArr2D: F,
|
|
5628
|
-
smoothArr2D:
|
|
5628
|
+
smoothArr2D: T,
|
|
5629
5629
|
thresholds: y,
|
|
5630
5630
|
colorsRGBA: A,
|
|
5631
5631
|
colorMode: h,
|
|
@@ -5635,22 +5635,22 @@ class Kr {
|
|
|
5635
5635
|
const g = {
|
|
5636
5636
|
canvas: R,
|
|
5637
5637
|
renderMask: F,
|
|
5638
|
-
renderValues:
|
|
5639
|
-
contourFills:
|
|
5638
|
+
renderValues: T,
|
|
5639
|
+
contourFills: M
|
|
5640
5640
|
};
|
|
5641
|
-
return this.setCachedRasterRender(
|
|
5642
|
-
})(), this.rasterRenderLoadingTasks.set(
|
|
5641
|
+
return this.setCachedRasterRender(v, g), g;
|
|
5642
|
+
})(), this.rasterRenderLoadingTasks.set(v, N));
|
|
5643
5643
|
try {
|
|
5644
|
-
|
|
5644
|
+
D = await N ?? void 0;
|
|
5645
5645
|
} finally {
|
|
5646
|
-
this.rasterRenderLoadingTasks.get(
|
|
5646
|
+
this.rasterRenderLoadingTasks.get(v) === N && this.rasterRenderLoadingTasks.delete(v);
|
|
5647
5647
|
}
|
|
5648
5648
|
}
|
|
5649
|
-
if (!
|
|
5650
|
-
const p = Object.keys(d).map(Number).filter(Number.isFinite).sort((
|
|
5651
|
-
(
|
|
5652
|
-
), B = p[0], S = p[p.length - 1], X = typeof S == "number" && y.some((
|
|
5653
|
-
|
|
5649
|
+
if (!D) return null;
|
|
5650
|
+
const p = Object.keys(d).map(Number).filter(Number.isFinite).sort((N, z) => N - z), E = new Set(p), P = D.contourFills?.filter(
|
|
5651
|
+
(N) => E.has(N.threshold)
|
|
5652
|
+
), B = p[0], S = p[p.length - 1], X = typeof S == "number" && y.some((N) => N > S), O = typeof B == "number" && Number.isFinite(B) && typeof S == "number" && Number.isFinite(S) ? this.createLegendEdgeColorCanvas(
|
|
5653
|
+
D.renderValues,
|
|
5654
5654
|
u,
|
|
5655
5655
|
s,
|
|
5656
5656
|
B,
|
|
@@ -5659,15 +5659,15 @@ class Kr {
|
|
|
5659
5659
|
zt(d[S])
|
|
5660
5660
|
) : void 0;
|
|
5661
5661
|
return this.createFcstCanvasSource(
|
|
5662
|
-
|
|
5662
|
+
D.canvas,
|
|
5663
5663
|
o,
|
|
5664
5664
|
h,
|
|
5665
|
-
|
|
5665
|
+
D.renderMask,
|
|
5666
5666
|
a,
|
|
5667
5667
|
t,
|
|
5668
|
-
|
|
5669
|
-
t?.config?.alignWithIsoline === !0 ?
|
|
5670
|
-
|
|
5668
|
+
P,
|
|
5669
|
+
t?.config?.alignWithIsoline === !0 ? D.renderValues : void 0,
|
|
5670
|
+
O,
|
|
5671
5671
|
X
|
|
5672
5672
|
);
|
|
5673
5673
|
}
|
|
@@ -5721,13 +5721,13 @@ class Kr {
|
|
|
5721
5721
|
for (let l = 0; l < t; l++) {
|
|
5722
5722
|
const d = [], h = r.length;
|
|
5723
5723
|
for (let a = 0; a < h; a++) {
|
|
5724
|
-
const
|
|
5725
|
-
if (!
|
|
5726
|
-
const A =
|
|
5727
|
-
if (typeof A != "number" || typeof
|
|
5724
|
+
const v = r[a], y = r[(a + 1) % h];
|
|
5725
|
+
if (!v || !y) continue;
|
|
5726
|
+
const A = v[0], D = v[1], p = y[0], E = y[1];
|
|
5727
|
+
if (typeof A != "number" || typeof D != "number" || typeof p != "number" || typeof E != "number")
|
|
5728
5728
|
continue;
|
|
5729
|
-
const
|
|
5730
|
-
d.push([
|
|
5729
|
+
const P = 0.75 * A + 0.25 * p, B = 0.75 * D + 0.25 * E, S = 0.25 * A + 0.75 * p, X = 0.25 * D + 0.75 * E;
|
|
5730
|
+
d.push([P, B], [S, X]);
|
|
5731
5731
|
}
|
|
5732
5732
|
if (r = d, r.length < 3) break;
|
|
5733
5733
|
}
|
|
@@ -5755,39 +5755,39 @@ class Kr {
|
|
|
5755
5755
|
if (!o) return null;
|
|
5756
5756
|
const s = this.getMaskSmoothIterations(u), l = t * r;
|
|
5757
5757
|
if (!l) return null;
|
|
5758
|
-
const d = i && typeof i[0] < "u", h = i && typeof i[1] < "u", a = d ? Number(i[0]) : 0,
|
|
5758
|
+
const d = i && typeof i[0] < "u", h = i && typeof i[1] < "u", a = d ? Number(i[0]) : 0, v = h ? Number(i[1]) : 0, y = new Float32Array(l);
|
|
5759
5759
|
let A = 0;
|
|
5760
5760
|
for (let B = 0; B < r; B++)
|
|
5761
5761
|
for (let S = 0; S < t; S++) {
|
|
5762
|
-
const X = B * t + S,
|
|
5763
|
-
|
|
5762
|
+
const X = B * t + S, O = e?.[B]?.[S], N = O == null || isNaN(Number(O)) ? void 0 : Number(O);
|
|
5763
|
+
N !== void 0 && (!d || N >= a) && (!h || N <= v) && (y[X] = 1, A += 1);
|
|
5764
5764
|
}
|
|
5765
5765
|
if (!A) return null;
|
|
5766
|
-
const
|
|
5766
|
+
const D = Ht().size([t, r]).thresholds([0.5])(
|
|
5767
5767
|
y
|
|
5768
5768
|
);
|
|
5769
|
-
if (!
|
|
5769
|
+
if (!D.length) return null;
|
|
5770
5770
|
const p = [];
|
|
5771
|
-
for (const B of
|
|
5771
|
+
for (const B of D) {
|
|
5772
5772
|
const S = B.coordinates ?? [];
|
|
5773
5773
|
for (const X of S)
|
|
5774
5774
|
p.push(X);
|
|
5775
5775
|
}
|
|
5776
|
-
const E = o ? this.smoothMaskContourPolygons(p, s) : p,
|
|
5776
|
+
const E = o ? this.smoothMaskContourPolygons(p, s) : p, P = new Path2D();
|
|
5777
5777
|
for (const B of E)
|
|
5778
5778
|
for (const S of B) {
|
|
5779
5779
|
if (!S.length) continue;
|
|
5780
5780
|
const X = S[0];
|
|
5781
5781
|
if (!(!X || typeof X[0] != "number" || typeof X[1] != "number")) {
|
|
5782
|
-
|
|
5783
|
-
for (let
|
|
5784
|
-
const
|
|
5785
|
-
!
|
|
5782
|
+
P.moveTo(X[0], X[1]);
|
|
5783
|
+
for (let O = 1; O < S.length; O++) {
|
|
5784
|
+
const N = S[O];
|
|
5785
|
+
!N || typeof N[0] != "number" || typeof N[1] != "number" || P.lineTo(N[0], N[1]);
|
|
5786
5786
|
}
|
|
5787
|
-
|
|
5787
|
+
P.closePath();
|
|
5788
5788
|
}
|
|
5789
5789
|
}
|
|
5790
|
-
return
|
|
5790
|
+
return P;
|
|
5791
5791
|
}
|
|
5792
5792
|
createIsolineContourPath(e, t, r, i, o = this.options) {
|
|
5793
5793
|
const u = i && typeof i[0] < "u" ? Number(i[0]) : NaN, s = i && typeof i[1] < "u" ? Number(i[1]) : 1 / 0;
|
|
@@ -5796,29 +5796,29 @@ class Kr {
|
|
|
5796
5796
|
let d = 0;
|
|
5797
5797
|
for (let y = 0; y < r; y++) {
|
|
5798
5798
|
const A = e[y];
|
|
5799
|
-
for (let
|
|
5800
|
-
const p = A?.[
|
|
5801
|
-
l[y * t +
|
|
5799
|
+
for (let D = 0; D < t; D++) {
|
|
5800
|
+
const p = A?.[D], E = p !== void 0 && Number.isFinite(p) && p <= s;
|
|
5801
|
+
l[y * t + D] = E ? p : NaN, E && p >= u && (d += 1);
|
|
5802
5802
|
}
|
|
5803
5803
|
}
|
|
5804
5804
|
if (!d) return null;
|
|
5805
5805
|
const h = o?.config?.isolineSmooth === !1 ? 0 : nt(o?.config?.isolineSmoothness), a = Ht().size([t, r]).thresholds([u]).smooth(h > 0)(l);
|
|
5806
5806
|
if (!a.length) return null;
|
|
5807
|
-
const
|
|
5807
|
+
const v = new Path2D();
|
|
5808
5808
|
for (const y of a)
|
|
5809
5809
|
for (const A of y.coordinates ?? [])
|
|
5810
|
-
for (const
|
|
5811
|
-
const p =
|
|
5810
|
+
for (const D of A) {
|
|
5811
|
+
const p = D[0];
|
|
5812
5812
|
if (p) {
|
|
5813
|
-
|
|
5814
|
-
for (let E = 1; E <
|
|
5815
|
-
const
|
|
5816
|
-
|
|
5813
|
+
v.moveTo(p[0], p[1]);
|
|
5814
|
+
for (let E = 1; E < D.length; E++) {
|
|
5815
|
+
const P = D[E];
|
|
5816
|
+
P && v.lineTo(P[0], P[1]);
|
|
5817
5817
|
}
|
|
5818
|
-
|
|
5818
|
+
v.closePath();
|
|
5819
5819
|
}
|
|
5820
5820
|
}
|
|
5821
|
-
return
|
|
5821
|
+
return v;
|
|
5822
5822
|
}
|
|
5823
5823
|
createIsolineContourFills(e, t, r, i, o, u, s = this.options) {
|
|
5824
5824
|
const l = u && typeof u[0] < "u" ? Number(u[0]) : -1 / 0, d = u && typeof u[1] < "u" ? Number(u[1]) : 1 / 0, h = i.filter(
|
|
@@ -5827,45 +5827,45 @@ class Kr {
|
|
|
5827
5827
|
if (!h.length || t < 2 || r < 2) return [];
|
|
5828
5828
|
const a = new Float64Array(t * r);
|
|
5829
5829
|
for (let E = 0; E < r; E++) {
|
|
5830
|
-
const
|
|
5830
|
+
const P = e[E];
|
|
5831
5831
|
for (let B = 0; B < t; B++) {
|
|
5832
|
-
const S =
|
|
5832
|
+
const S = P?.[B];
|
|
5833
5833
|
a[E * t + B] = S !== void 0 && Number.isFinite(S) ? S : NaN;
|
|
5834
5834
|
}
|
|
5835
5835
|
}
|
|
5836
|
-
const
|
|
5837
|
-
i.forEach((E,
|
|
5838
|
-
const B = o[
|
|
5836
|
+
const v = s?.config?.isolineSmooth === !1 ? 0 : nt(s?.config?.isolineSmoothness), y = Ht().size([t, r]).thresholds(h).smooth(v > 0)(a), A = new globalThis.Map();
|
|
5837
|
+
i.forEach((E, P) => {
|
|
5838
|
+
const B = o[P];
|
|
5839
5839
|
B && A.set(E, B);
|
|
5840
5840
|
});
|
|
5841
|
-
const
|
|
5842
|
-
for (const B of
|
|
5841
|
+
const D = (E, P) => {
|
|
5842
|
+
for (const B of P.coordinates ?? [])
|
|
5843
5843
|
for (const S of B) {
|
|
5844
5844
|
const X = S[0];
|
|
5845
5845
|
if (!X) continue;
|
|
5846
|
-
const
|
|
5847
|
-
if (!(typeof
|
|
5848
|
-
E.moveTo(
|
|
5846
|
+
const O = X[0], N = X[1];
|
|
5847
|
+
if (!(typeof O != "number" || typeof N != "number")) {
|
|
5848
|
+
E.moveTo(O, N);
|
|
5849
5849
|
for (let z = 1; z < S.length; z++) {
|
|
5850
|
-
const C = S[z],
|
|
5851
|
-
typeof
|
|
5850
|
+
const C = S[z], T = C?.[0], F = C?.[1];
|
|
5851
|
+
typeof T == "number" && typeof F == "number" && E.lineTo(T, F);
|
|
5852
5852
|
}
|
|
5853
5853
|
E.closePath();
|
|
5854
5854
|
}
|
|
5855
5855
|
}
|
|
5856
5856
|
}, p = [];
|
|
5857
5857
|
for (let E = 0; E < y.length; E++) {
|
|
5858
|
-
const
|
|
5858
|
+
const P = y[E], B = Number(P.value), S = A.get(B);
|
|
5859
5859
|
if (!S) continue;
|
|
5860
5860
|
const X = new Path2D();
|
|
5861
|
-
|
|
5862
|
-
const
|
|
5863
|
-
|
|
5864
|
-
const
|
|
5861
|
+
D(X, P);
|
|
5862
|
+
const O = y[E + 1];
|
|
5863
|
+
O && D(X, O);
|
|
5864
|
+
const N = Math.max(0, Math.min(1, (S[3] ?? 255) / 255));
|
|
5865
5865
|
p.push({
|
|
5866
5866
|
threshold: B,
|
|
5867
5867
|
path: X,
|
|
5868
|
-
color: `rgba(${S[0]}, ${S[1]}, ${S[2]}, ${
|
|
5868
|
+
color: `rgba(${S[0]}, ${S[1]}, ${S[2]}, ${N})`
|
|
5869
5869
|
});
|
|
5870
5870
|
}
|
|
5871
5871
|
return p;
|
|
@@ -5877,15 +5877,15 @@ class Kr {
|
|
|
5877
5877
|
h.width = Math.max(1, Math.floor(t)), h.height = Math.max(1, Math.floor(r));
|
|
5878
5878
|
const a = h.getContext("2d");
|
|
5879
5879
|
if (!a) return null;
|
|
5880
|
-
const
|
|
5880
|
+
const v = a.createImageData(h.width, h.height), y = v.data;
|
|
5881
5881
|
for (let A = 0; A < h.height; A++) {
|
|
5882
|
-
const
|
|
5882
|
+
const D = e[A];
|
|
5883
5883
|
for (let p = 0; p < h.width; p++) {
|
|
5884
|
-
const E =
|
|
5884
|
+
const E = D?.[p];
|
|
5885
5885
|
E === void 0 || !Number.isFinite(E) || E < l || (o ? E >= d : E > d) || (y[(A * h.width + p) * 4 + 3] = 255);
|
|
5886
5886
|
}
|
|
5887
5887
|
}
|
|
5888
|
-
return a.putImageData(
|
|
5888
|
+
return a.putImageData(v, 0, 0), h;
|
|
5889
5889
|
}
|
|
5890
5890
|
createLegendEdgeColorCanvas(e, t, r, i, o, u, s) {
|
|
5891
5891
|
const l = document.createElement("canvas");
|
|
@@ -5893,22 +5893,22 @@ class Kr {
|
|
|
5893
5893
|
const d = l.getContext("2d");
|
|
5894
5894
|
if (!d) return null;
|
|
5895
5895
|
const h = d.createImageData(l.width, l.height), a = h.data;
|
|
5896
|
-
for (let
|
|
5897
|
-
const y = e[
|
|
5896
|
+
for (let v = 0; v < l.height; v++) {
|
|
5897
|
+
const y = e[v];
|
|
5898
5898
|
for (let A = 0; A < l.width; A++) {
|
|
5899
|
-
const
|
|
5900
|
-
if (
|
|
5901
|
-
const p =
|
|
5899
|
+
const D = y?.[A];
|
|
5900
|
+
if (D === void 0 || !Number.isFinite(D)) continue;
|
|
5901
|
+
const p = D <= i ? u : D >= o ? s : void 0;
|
|
5902
5902
|
if (!p) continue;
|
|
5903
|
-
const E = (
|
|
5903
|
+
const E = (v * l.width + A) * 4;
|
|
5904
5904
|
a[E] = p[0], a[E + 1] = p[1], a[E + 2] = p[2], a[E + 3] = p[3];
|
|
5905
5905
|
}
|
|
5906
5906
|
}
|
|
5907
5907
|
return d.putImageData(h, 0, 0), l;
|
|
5908
5908
|
}
|
|
5909
5909
|
createFcstCanvasSource(e, t, r = "discrete", i, o, u = this.options, s, l, d, h = !1) {
|
|
5910
|
-
const a = document.createElement("canvas"),
|
|
5911
|
-
|
|
5910
|
+
const a = document.createElement("canvas"), v = r === "gradient", y = u?.config?.pixelSnap === !0, A = u?.config?.useDevicePixelRatio === !0, D = u?.config?.alignWithIsoline === !0, p = i ? this.createScopeMaskCanvas(
|
|
5911
|
+
D ? l ?? i : i,
|
|
5912
5912
|
e.width,
|
|
5913
5913
|
e.height,
|
|
5914
5914
|
o,
|
|
@@ -5918,25 +5918,25 @@ class Kr {
|
|
|
5918
5918
|
projection: "EPSG:3857",
|
|
5919
5919
|
ratio: 1,
|
|
5920
5920
|
// Avoid resampling across the validity edge when exact contour alignment is requested.
|
|
5921
|
-
interpolate:
|
|
5922
|
-
canvasFunction: (
|
|
5923
|
-
const
|
|
5921
|
+
interpolate: v && !D,
|
|
5922
|
+
canvasFunction: (P, B, S, X) => {
|
|
5923
|
+
const O = A ? Math.max(1, S || 1) : 1, N = X ?? [1, 1], z = Math.max(1, Math.floor((N[0] ?? 1) * O)), C = Math.max(1, Math.floor((N[1] ?? 1) * O));
|
|
5924
5924
|
a.width !== z && (a.width = z), a.height !== C && (a.height = C);
|
|
5925
|
-
const
|
|
5926
|
-
if (!
|
|
5927
|
-
|
|
5928
|
-
const [F,
|
|
5925
|
+
const T = a.getContext("2d", { alpha: !0 });
|
|
5926
|
+
if (!T) return a;
|
|
5927
|
+
T.clearRect(0, 0, z, C);
|
|
5928
|
+
const [F, M, R, g] = P, [b, w, L, I] = t, H = R - F, G = g - M;
|
|
5929
5929
|
if (H <= 0 || G <= 0) return a;
|
|
5930
|
-
const Q = z / H, J = C / G, Y = (
|
|
5930
|
+
const Q = z / H, J = C / G, Y = (b - F) * Q, j = (g - I) * J, W = (L - b) * Q, K = (I - w) * J;
|
|
5931
5931
|
if (W <= 0 || K <= 0) return a;
|
|
5932
5932
|
const Z = y ? Math.floor(Y) : Y, U = y ? Math.floor(j) : j, te = y ? Math.ceil(Y + W) : Y + W, se = y ? Math.ceil(j + K) : j + K, _ = Math.max(1, te - Z), $ = Math.max(1, se - U);
|
|
5933
5933
|
if (s?.length) {
|
|
5934
|
-
|
|
5934
|
+
T.save(), T.translate(Z, U), T.scale(_ / e.width, $ / e.height);
|
|
5935
5935
|
for (const ae of s)
|
|
5936
|
-
|
|
5937
|
-
return
|
|
5936
|
+
T.fillStyle = ae.color, T.fill(ae.path, "evenodd");
|
|
5937
|
+
return T.restore(), a;
|
|
5938
5938
|
}
|
|
5939
|
-
return
|
|
5939
|
+
return T.imageSmoothingEnabled = v && !D, v && !D && (T.imageSmoothingQuality = "high"), T.drawImage(e, Z, U, _, $), d && (T.save(), T.globalCompositeOperation = "source-atop", T.imageSmoothingEnabled = v && !D, v && !D && (T.imageSmoothingQuality = "high"), T.drawImage(d, Z, U, _, $), T.restore()), p && (T.save(), T.globalCompositeOperation = "destination-in", T.imageSmoothingEnabled = v && !D, v && !D && (T.imageSmoothingQuality = "high"), T.drawImage(p, Z, U, _, $), T.restore()), a;
|
|
5940
5940
|
}
|
|
5941
5941
|
});
|
|
5942
5942
|
}
|
|
@@ -6029,7 +6029,7 @@ class Kt {
|
|
|
6029
6029
|
o && this.delete();
|
|
6030
6030
|
const u = o ? o.getZIndex() : t + 1, s = await this.getSourceFromCache() ?? await this.getSourceFromParams();
|
|
6031
6031
|
if (!s) return;
|
|
6032
|
-
const l = new
|
|
6032
|
+
const l = new yt({
|
|
6033
6033
|
className: i,
|
|
6034
6034
|
source: s,
|
|
6035
6035
|
zIndex: u,
|
|
@@ -6100,10 +6100,10 @@ class Kt {
|
|
|
6100
6100
|
interpolateValue(e, t, r, i, o) {
|
|
6101
6101
|
const u = Math.floor(i), s = Math.ceil(i), l = Math.floor(o), d = Math.ceil(o);
|
|
6102
6102
|
if (u < 0 || s >= t || l < 0 || d >= r) return null;
|
|
6103
|
-
const h = Number(e[l]?.[u]), a = Number(e[l]?.[s]),
|
|
6104
|
-
if (![h, a,
|
|
6105
|
-
const A = i - u,
|
|
6106
|
-
return h * (1 - A) * (1 -
|
|
6103
|
+
const h = Number(e[l]?.[u]), a = Number(e[l]?.[s]), v = Number(e[d]?.[u]), y = Number(e[d]?.[s]);
|
|
6104
|
+
if (![h, a, v, y].every((p) => Number.isFinite(p))) return null;
|
|
6105
|
+
const A = i - u, D = o - l;
|
|
6106
|
+
return h * (1 - A) * (1 - D) + a * A * (1 - D) + v * (1 - A) * D + y * A * D;
|
|
6107
6107
|
}
|
|
6108
6108
|
getValueTransformFn() {
|
|
6109
6109
|
const e = this.getRuntimeConfig();
|
|
@@ -6120,40 +6120,40 @@ class Kt {
|
|
|
6120
6120
|
}
|
|
6121
6121
|
}
|
|
6122
6122
|
createGridCanvasSource(e) {
|
|
6123
|
-
const t = document.createElement("canvas"), { rawArr2D: r, extent: i, width: o, height: u } = e, s = this.getTextDrawOptions(), l = this.getRuntimeConfig(), d = typeof l?.valueTransform == "function" || typeof l?.valueTransform == "string" && l.valueTransform.trim().length > 0, h = l?.valueTransformAffectsScope !== !1, a =
|
|
6123
|
+
const t = document.createElement("canvas"), { rawArr2D: r, extent: i, width: o, height: u } = e, s = this.getTextDrawOptions(), l = this.getRuntimeConfig(), d = typeof l?.valueTransform == "function" || typeof l?.valueTransform == "string" && l.valueTransform.trim().length > 0, h = l?.valueTransformAffectsScope !== !1, a = Ct(this.options.config.legend, this.options.config.legendScope) ?? this.options.config.scope;
|
|
6124
6124
|
return new jt({
|
|
6125
6125
|
projection: "EPSG:3857",
|
|
6126
6126
|
ratio: 1,
|
|
6127
6127
|
interpolate: !1,
|
|
6128
|
-
canvasFunction: (
|
|
6129
|
-
const p =
|
|
6130
|
-
t.width !==
|
|
6128
|
+
canvasFunction: (v, y, A, D) => {
|
|
6129
|
+
const p = D ?? [1, 1], E = Math.max(1, Math.floor(p[0] ?? 1)), P = Math.max(1, Math.floor(p[1] ?? 1)), B = this.map.getSize(), S = Math.max(1, Math.floor(B?.[0] ?? E)), X = Math.max(1, Math.floor(B?.[1] ?? P)), O = E / S, N = P / X, z = s.useDevicePixelRatio ? Math.max(1, Number(A || 1)) : 1, C = Math.max(0.01, (O + N) * 0.5 / z), T = E, F = P, M = S, R = X;
|
|
6130
|
+
t.width !== T && (t.width = T), t.height !== F && (t.height = F);
|
|
6131
6131
|
const g = t.getContext("2d", { alpha: !0 });
|
|
6132
6132
|
if (!g) return t;
|
|
6133
|
-
g.setTransform(1, 0, 0, 1, 0, 0), g.clearRect(0, 0,
|
|
6134
|
-
const [
|
|
6133
|
+
g.setTransform(1, 0, 0, 1, 0, 0), g.clearRect(0, 0, T, F), g.font = `${Math.max(10, Math.round(s.fontSize * C))}px ${s.fontFamily}`, g.fillStyle = s.fontColor, g.strokeStyle = s.strokeColor, g.lineWidth = Math.max(0, s.strokeWidth * C), g.lineJoin = "round", g.miterLimit = 2, g.textAlign = "center", g.textBaseline = "middle";
|
|
6134
|
+
const [b, w, L, I] = v, [H, G, Q, J] = i, Y = L - b, j = I - w, W = Q - H, K = J - G;
|
|
6135
6135
|
if (Y <= 0 || j <= 0 || W <= 0 || K <= 0) return t;
|
|
6136
6136
|
const Z = Math.max(8, Math.round(s.pixelStep));
|
|
6137
6137
|
for (let U = Z / 2; U < R; U += Z)
|
|
6138
|
-
for (let te = Z / 2; te <
|
|
6139
|
-
const se =
|
|
6138
|
+
for (let te = Z / 2; te < M; te += Z) {
|
|
6139
|
+
const se = b + te / M * Y, _ = I - U / R * j;
|
|
6140
6140
|
if (se < H || se > Q || _ < G || _ > J) continue;
|
|
6141
6141
|
const $ = (se - H) / W * (o - 1), ae = (J - _) / K * (u - 1), ne = this.interpolateValue(r, o, u, $, ae);
|
|
6142
6142
|
if (ne === null) continue;
|
|
6143
|
-
const
|
|
6143
|
+
const de = this.applyValueTransformValue(ne, {
|
|
6144
6144
|
x: $,
|
|
6145
6145
|
y: ae,
|
|
6146
6146
|
width: o,
|
|
6147
6147
|
height: u,
|
|
6148
6148
|
source: "raw"
|
|
6149
6149
|
});
|
|
6150
|
-
if (!Number.isFinite(
|
|
6150
|
+
if (!Number.isFinite(de))
|
|
6151
6151
|
continue;
|
|
6152
|
-
const ue = d && !h ? ne :
|
|
6152
|
+
const ue = d && !h ? ne : de;
|
|
6153
6153
|
if (!this.isValueInScope(ue, a))
|
|
6154
6154
|
continue;
|
|
6155
|
-
const
|
|
6156
|
-
g.lineWidth > 0 && g.strokeText(
|
|
6155
|
+
const pe = de.toFixed(s.decimals), ve = te * O, le = U * N;
|
|
6156
|
+
g.lineWidth > 0 && g.strokeText(pe, ve, le), g.fillText(pe, ve, le);
|
|
6157
6157
|
}
|
|
6158
6158
|
return t;
|
|
6159
6159
|
}
|
|
@@ -6196,7 +6196,7 @@ class ho {
|
|
|
6196
6196
|
i && this.delete();
|
|
6197
6197
|
const o = i ? i.getZIndex() : r ?? 1200, u = this.getSourceFromCache();
|
|
6198
6198
|
if (u) {
|
|
6199
|
-
const l = new
|
|
6199
|
+
const l = new yt({
|
|
6200
6200
|
source: u,
|
|
6201
6201
|
className: e + "-arrow",
|
|
6202
6202
|
zIndex: o
|
|
@@ -6209,7 +6209,7 @@ class ho {
|
|
|
6209
6209
|
...s,
|
|
6210
6210
|
extent: this.options.config.extent,
|
|
6211
6211
|
config: this.options.config
|
|
6212
|
-
}), d = new
|
|
6212
|
+
}), d = new yt({
|
|
6213
6213
|
source: l,
|
|
6214
6214
|
className: e + "-arrow",
|
|
6215
6215
|
zIndex: o
|
|
@@ -6240,26 +6240,26 @@ class ho {
|
|
|
6240
6240
|
projection: "EPSG:3857",
|
|
6241
6241
|
ratio: 1,
|
|
6242
6242
|
canvasFunction: (l, d, h, a) => {
|
|
6243
|
-
const
|
|
6243
|
+
const v = a ?? [1, 1], y = Math.max(1, Math.floor((v[0] ?? 1) * h)), A = Math.max(1, Math.floor((v[1] ?? 1) * h));
|
|
6244
6244
|
s.width !== y && (s.width = y), s.height !== A && (s.height = A);
|
|
6245
|
-
const
|
|
6246
|
-
if (!
|
|
6247
|
-
|
|
6248
|
-
const [p, E,
|
|
6245
|
+
const D = s.getContext("2d", { alpha: !0 });
|
|
6246
|
+
if (!D) return s;
|
|
6247
|
+
D.clearRect(0, 0, y, A), D.fillStyle = u, D.font = `${Math.max(1, Math.floor(o * h))}px Arial`, D.textAlign = "center", D.textBaseline = "middle";
|
|
6248
|
+
const [p, E, P, B] = l, [S, X, O, N] = t, z = P - p, C = B - E;
|
|
6249
6249
|
if (z <= 0 || C <= 0) return s;
|
|
6250
|
-
const
|
|
6251
|
-
if (
|
|
6252
|
-
const g =
|
|
6253
|
-
if (g <= 0 ||
|
|
6250
|
+
const T = Math.max(p, S), F = Math.max(E, X), M = Math.min(P, O), R = Math.min(B, N);
|
|
6251
|
+
if (T >= M || F >= R) return s;
|
|
6252
|
+
const g = O - S, b = N - X;
|
|
6253
|
+
if (g <= 0 || b <= 0) return s;
|
|
6254
6254
|
const w = Math.max(1, y - 1), L = Math.max(1, A - 1), I = Math.max(1, Math.floor(i * h)), H = Math.max(
|
|
6255
6255
|
g / Math.max(1, e.width - 1),
|
|
6256
|
-
|
|
6256
|
+
b / Math.max(1, e.height - 1)
|
|
6257
6257
|
), G = H > 0 && isFinite(d) ? Math.max(1, Math.floor(d / H)) : 1, Q = Math.max(I, Math.min(I * 6, I * G)), J = Math.max(
|
|
6258
6258
|
0,
|
|
6259
|
-
Math.floor((
|
|
6259
|
+
Math.floor((T - p) / z * w)
|
|
6260
6260
|
), Y = Math.min(
|
|
6261
6261
|
y - 1,
|
|
6262
|
-
Math.ceil((
|
|
6262
|
+
Math.ceil((M - p) / z * w)
|
|
6263
6263
|
), j = Math.max(
|
|
6264
6264
|
0,
|
|
6265
6265
|
Math.floor((B - R) / C * L)
|
|
@@ -6271,12 +6271,12 @@ class ho {
|
|
|
6271
6271
|
for (let K = j; K <= W; K += Q)
|
|
6272
6272
|
for (let Z = J; Z <= Y; Z += Q) {
|
|
6273
6273
|
const U = p + z * Z / w, te = B - C * K / L;
|
|
6274
|
-
if (U < S || U >
|
|
6274
|
+
if (U < S || U > O || te < X || te > N)
|
|
6275
6275
|
continue;
|
|
6276
|
-
const se = (U - S) / g * (e.width - 1), _ = (
|
|
6276
|
+
const se = (U - S) / g * (e.width - 1), _ = (N - te) / b * (e.height - 1), $ = $t(e.angle, se, _, e.width, e.height);
|
|
6277
6277
|
if (!isFinite($)) continue;
|
|
6278
6278
|
const ae = ($ - 90) * Math.PI / 180;
|
|
6279
|
-
|
|
6279
|
+
D.save(), D.translate(Z, K), D.rotate(ae), D.fillText("→", 0, 0), D.restore();
|
|
6280
6280
|
}
|
|
6281
6281
|
return s;
|
|
6282
6282
|
}
|
|
@@ -6340,7 +6340,7 @@ const go = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAA
|
|
|
6340
6340
|
function bo() {
|
|
6341
6341
|
return new DOMException("The operation was aborted", "AbortError");
|
|
6342
6342
|
}
|
|
6343
|
-
function
|
|
6343
|
+
function bt(n) {
|
|
6344
6344
|
if (n?.aborted) throw n.reason ?? bo();
|
|
6345
6345
|
}
|
|
6346
6346
|
function en(n, e) {
|
|
@@ -6401,9 +6401,9 @@ function Co(n) {
|
|
|
6401
6401
|
let u = Number.parseInt(o[2], 10);
|
|
6402
6402
|
const s = [];
|
|
6403
6403
|
for (t++; u > 0 && t < n.length; ) {
|
|
6404
|
-
const
|
|
6405
|
-
for (let y = 0; y + 2 <
|
|
6406
|
-
s.push([
|
|
6404
|
+
const v = n[t].trim().split(/\s+/).map(Number).filter(Number.isFinite);
|
|
6405
|
+
for (let y = 0; y + 2 < v.length && u > 0; y += 3)
|
|
6406
|
+
s.push([v[y], v[y + 1]]), u--;
|
|
6407
6407
|
t++;
|
|
6408
6408
|
}
|
|
6409
6409
|
let l = !1;
|
|
@@ -6414,8 +6414,8 @@ function Co(n) {
|
|
|
6414
6414
|
const a = s[s.length - 1];
|
|
6415
6415
|
if (s.length > 3 && !rr(s[0], a, 0.1) && s.push([...s[0]]), s.length > 3 && rr(s[0], s[s.length - 1], 0.1)) {
|
|
6416
6416
|
rn(s) && s.reverse();
|
|
6417
|
-
const
|
|
6418
|
-
(
|
|
6417
|
+
const v = s[0], y = s[s.length - 1];
|
|
6418
|
+
(v[0] !== y[0] || v[1] !== y[1]) && s.push([...s[0]]), e.push(V.polygon([s], { level: d, noLabelZero: l }));
|
|
6419
6419
|
}
|
|
6420
6420
|
i--;
|
|
6421
6421
|
}
|
|
@@ -6470,9 +6470,9 @@ function xo(n) {
|
|
|
6470
6470
|
let l = Number.parseInt(u[2], 10);
|
|
6471
6471
|
const d = [];
|
|
6472
6472
|
for (o++; o < r && l > 0; ) {
|
|
6473
|
-
const
|
|
6474
|
-
for (let y = 0; y + 2 <
|
|
6475
|
-
d.push([
|
|
6473
|
+
const v = n[o].trim().split(/\s+/).map(Number).filter(Number.isFinite);
|
|
6474
|
+
for (let y = 0; y + 2 < v.length && l > 0; y += 3)
|
|
6475
|
+
d.push([v[y], v[y + 1]]), l--;
|
|
6476
6476
|
o++;
|
|
6477
6477
|
}
|
|
6478
6478
|
let h = !1;
|
|
@@ -6489,7 +6489,7 @@ function xo(n) {
|
|
|
6489
6489
|
}
|
|
6490
6490
|
return e;
|
|
6491
6491
|
}
|
|
6492
|
-
function
|
|
6492
|
+
function we(n) {
|
|
6493
6493
|
try {
|
|
6494
6494
|
const e = V.bbox(n);
|
|
6495
6495
|
return e.length < 4 || e.slice(0, 4).some((t) => !Number.isFinite(t)) ? null : [e[0], e[1], e[2], e[3]];
|
|
@@ -6497,7 +6497,7 @@ function xe(n) {
|
|
|
6497
6497
|
return null;
|
|
6498
6498
|
}
|
|
6499
6499
|
}
|
|
6500
|
-
function
|
|
6500
|
+
function st(n, e) {
|
|
6501
6501
|
return !n || !e ? !0 : !(n[2] < e[0] || n[0] > e[2] || n[3] < e[1] || n[1] > e[3]);
|
|
6502
6502
|
}
|
|
6503
6503
|
function lr(n) {
|
|
@@ -6532,8 +6532,8 @@ function Po(n) {
|
|
|
6532
6532
|
if (e.forEach((u, s) => {
|
|
6533
6533
|
let l = -1, d = Number.POSITIVE_INFINITY;
|
|
6534
6534
|
e.forEach((h, a) => {
|
|
6535
|
-
const
|
|
6536
|
-
s === a ||
|
|
6535
|
+
const v = t[a] ?? 0;
|
|
6536
|
+
s === a || v >= d || !st(we(u), we(h)) || !No(u, h) || (l = a, d = v);
|
|
6537
6537
|
}), l >= 0 && r.set(s, l);
|
|
6538
6538
|
}), !r.size) return e;
|
|
6539
6539
|
const i = new globalThis.Map();
|
|
@@ -6548,12 +6548,12 @@ function Po(n) {
|
|
|
6548
6548
|
for (const d of i.get(s) ?? [])
|
|
6549
6549
|
l = l.flatMap((h) => {
|
|
6550
6550
|
try {
|
|
6551
|
-
if (!
|
|
6551
|
+
if (!st(we(h), we(d)) || !V.booleanIntersects(h, d))
|
|
6552
6552
|
return [h];
|
|
6553
6553
|
const a = V.difference(V.featureCollection([h, d]));
|
|
6554
|
-
return a ? V.flatten(a).features.map((
|
|
6555
|
-
...
|
|
6556
|
-
properties: { ...u.properties ?? {}, ...
|
|
6554
|
+
return a ? V.flatten(a).features.map((v) => ({
|
|
6555
|
+
...v,
|
|
6556
|
+
properties: { ...u.properties ?? {}, ...v.properties ?? {} }
|
|
6557
6557
|
})) : [];
|
|
6558
6558
|
} catch {
|
|
6559
6559
|
return [h];
|
|
@@ -6609,17 +6609,17 @@ function Lo(n, e) {
|
|
|
6609
6609
|
return t.forEach((o) => {
|
|
6610
6610
|
const u = o.slice().sort((l, d) => Number(d.properties?.level) - Number(l.properties?.level)), s = [];
|
|
6611
6611
|
for (const l of u) {
|
|
6612
|
-
|
|
6612
|
+
bt(e);
|
|
6613
6613
|
let d = lr(l);
|
|
6614
6614
|
for (const h of s)
|
|
6615
6615
|
if (d = d.flatMap((a) => {
|
|
6616
6616
|
try {
|
|
6617
|
-
if (!
|
|
6617
|
+
if (!st(we(a), h.bbox)) return [a];
|
|
6618
6618
|
if (!V.booleanIntersects(a, h.feature)) return [a];
|
|
6619
|
-
const
|
|
6619
|
+
const v = V.difference(
|
|
6620
6620
|
V.featureCollection([a, h.feature])
|
|
6621
6621
|
);
|
|
6622
|
-
return
|
|
6622
|
+
return v ? V.flatten(v).features.map((y) => ({
|
|
6623
6623
|
...y,
|
|
6624
6624
|
properties: { ...l.properties ?? {}, ...y.properties ?? {} }
|
|
6625
6625
|
})) : [];
|
|
@@ -6627,7 +6627,7 @@ function Lo(n, e) {
|
|
|
6627
6627
|
return [a];
|
|
6628
6628
|
}
|
|
6629
6629
|
}), !d.length) break;
|
|
6630
|
-
for (const h of d) s.push({ feature: h, bbox:
|
|
6630
|
+
for (const h of d) s.push({ feature: h, bbox: we(h) });
|
|
6631
6631
|
i.push(...d);
|
|
6632
6632
|
}
|
|
6633
6633
|
}), [...r, ...i];
|
|
@@ -6667,8 +6667,8 @@ function So(n, e, t = 1e-3) {
|
|
|
6667
6667
|
const s = lr(u).map((l, d) => {
|
|
6668
6668
|
const h = l.geometry.coordinates[0];
|
|
6669
6669
|
for (let a = 0; a < h.length; a++) {
|
|
6670
|
-
const
|
|
6671
|
-
(A) => V.distance(A,
|
|
6670
|
+
const v = V.point(h[a]), y = r.features.find(
|
|
6671
|
+
(A) => V.distance(A, v, { units: "kilometers" }) <= t * 2
|
|
6672
6672
|
);
|
|
6673
6673
|
y && (h[a] = [...y.geometry.coordinates]);
|
|
6674
6674
|
}
|
|
@@ -6681,21 +6681,65 @@ function So(n, e, t = 1e-3) {
|
|
|
6681
6681
|
}
|
|
6682
6682
|
function Mo(n, e) {
|
|
6683
6683
|
const t = e.filter(
|
|
6684
|
-
(
|
|
6685
|
-
).map((
|
|
6686
|
-
|
|
6687
|
-
|
|
6688
|
-
|
|
6689
|
-
|
|
6690
|
-
|
|
6691
|
-
|
|
6692
|
-
})
|
|
6693
|
-
|
|
6684
|
+
(d) => String(d.properties?.symbolId) === kt
|
|
6685
|
+
).map((d) => V.point(d.geometry.coordinates, d.properties));
|
|
6686
|
+
if (!t.length) return n;
|
|
6687
|
+
const r = n.map((d, h) => ({
|
|
6688
|
+
feature: d,
|
|
6689
|
+
index: h,
|
|
6690
|
+
bbox: we(d),
|
|
6691
|
+
level: Number(d.properties?.level)
|
|
6692
|
+
})).filter(
|
|
6693
|
+
({ feature: d, level: h }) => /polygon/i.test(String(d.geometry?.type ?? "")) && Number.isFinite(h)
|
|
6694
|
+
), i = /* @__PURE__ */ new Set(), o = r.filter(({ feature: d, index: h }) => {
|
|
6695
|
+
const a = t.some((v) => {
|
|
6696
|
+
try {
|
|
6697
|
+
return V.booleanPointInPolygon(v, d);
|
|
6698
|
+
} catch {
|
|
6699
|
+
return !1;
|
|
6700
|
+
}
|
|
6701
|
+
});
|
|
6702
|
+
return a && i.add(h), a;
|
|
6703
|
+
});
|
|
6704
|
+
for (; o.length; ) {
|
|
6705
|
+
const d = o.pop();
|
|
6706
|
+
for (const h of r)
|
|
6707
|
+
if (!(i.has(h.index) || h.level !== d.level || !st(h.bbox, d.bbox))) {
|
|
6708
|
+
try {
|
|
6709
|
+
if (!V.booleanIntersects(d.feature, h.feature)) continue;
|
|
6710
|
+
} catch {
|
|
6711
|
+
continue;
|
|
6712
|
+
}
|
|
6713
|
+
i.add(h.index), o.push(h);
|
|
6714
|
+
}
|
|
6715
|
+
}
|
|
6716
|
+
const u = n.map((d, h) => i.has(h) ? {
|
|
6717
|
+
...d,
|
|
6694
6718
|
properties: {
|
|
6695
|
-
...
|
|
6719
|
+
...d.properties ?? {},
|
|
6696
6720
|
isFreezingRain: !0
|
|
6697
6721
|
}
|
|
6698
|
-
}
|
|
6722
|
+
} : d), s = new globalThis.Map();
|
|
6723
|
+
for (const { feature: d, index: h, level: a } of r) {
|
|
6724
|
+
if (!i.has(h)) continue;
|
|
6725
|
+
const v = s.get(a) ?? [];
|
|
6726
|
+
v.push(d), s.set(a, v);
|
|
6727
|
+
}
|
|
6728
|
+
const l = [];
|
|
6729
|
+
return s.forEach((d, h) => {
|
|
6730
|
+
try {
|
|
6731
|
+
const a = d.length === 1 ? d[0] : V.union(V.featureCollection(d));
|
|
6732
|
+
if (!a) return;
|
|
6733
|
+
l.push({
|
|
6734
|
+
...a,
|
|
6735
|
+
properties: {
|
|
6736
|
+
level: String(d[0]?.properties?.level ?? h),
|
|
6737
|
+
isFreezingRainBoundary: !0
|
|
6738
|
+
}
|
|
6739
|
+
});
|
|
6740
|
+
} catch {
|
|
6741
|
+
}
|
|
6742
|
+
}), [...u, ...l];
|
|
6699
6743
|
}
|
|
6700
6744
|
function Oo(n, e) {
|
|
6701
6745
|
const t = n.split(/\r?\n/), r = Co(t), i = Eo(t), o = Bo(t).filter(
|
|
@@ -6703,31 +6747,31 @@ function Oo(n, e) {
|
|
|
6703
6747
|
), u = xo(t).filter(
|
|
6704
6748
|
(A) => A.geometry?.type === "LineString" && Number(A.properties?.level) === 0
|
|
6705
6749
|
);
|
|
6706
|
-
|
|
6750
|
+
bt(e);
|
|
6707
6751
|
let s = r.features;
|
|
6708
6752
|
if (s.length > 1)
|
|
6709
6753
|
try {
|
|
6710
6754
|
const A = V.union(r);
|
|
6711
|
-
A && (s = V.flatten(A).features.map((
|
|
6712
|
-
...
|
|
6755
|
+
A && (s = V.flatten(A).features.map((D, p) => ({
|
|
6756
|
+
...D,
|
|
6713
6757
|
properties: {
|
|
6714
|
-
...
|
|
6715
|
-
id:
|
|
6758
|
+
...D.properties ?? {},
|
|
6759
|
+
id: D.properties?.id ?? `u-${p}`
|
|
6716
6760
|
}
|
|
6717
6761
|
})));
|
|
6718
6762
|
} catch {
|
|
6719
6763
|
s = r.features;
|
|
6720
6764
|
}
|
|
6721
|
-
const l = u.map((A) => ({ feature: A, bbox:
|
|
6765
|
+
const l = u.map((A) => ({ feature: A, bbox: we(A) }));
|
|
6722
6766
|
for (const A of l)
|
|
6723
|
-
|
|
6767
|
+
bt(e), s = s.flatMap((D) => {
|
|
6724
6768
|
try {
|
|
6725
|
-
if (!
|
|
6726
|
-
if (!V.booleanIntersects(
|
|
6727
|
-
const p = So(
|
|
6728
|
-
return p.features.length ? p.features : [
|
|
6769
|
+
if (!st(we(D), A.bbox)) return [D];
|
|
6770
|
+
if (!V.booleanIntersects(D, A.feature)) return [D];
|
|
6771
|
+
const p = So(D, A.feature);
|
|
6772
|
+
return p.features.length ? p.features : [D];
|
|
6729
6773
|
} catch {
|
|
6730
|
-
return [
|
|
6774
|
+
return [D];
|
|
6731
6775
|
}
|
|
6732
6776
|
});
|
|
6733
6777
|
const d = o.filter(
|
|
@@ -6736,42 +6780,42 @@ function Oo(n, e) {
|
|
|
6736
6780
|
feature: A,
|
|
6737
6781
|
point: V.point(A.geometry.coordinates, A.properties)
|
|
6738
6782
|
})), h = s.map((A) => {
|
|
6739
|
-
let
|
|
6783
|
+
let D = cr;
|
|
6740
6784
|
for (const p of d)
|
|
6741
6785
|
try {
|
|
6742
6786
|
if (V.booleanPointInPolygon(p.point, A)) {
|
|
6743
|
-
|
|
6787
|
+
D = ut(p.feature.properties?.symbolId);
|
|
6744
6788
|
break;
|
|
6745
6789
|
}
|
|
6746
6790
|
} catch {
|
|
6747
6791
|
}
|
|
6748
|
-
return { ...A, properties: { symbolId:
|
|
6792
|
+
return { ...A, properties: { symbolId: D } };
|
|
6749
6793
|
}), a = r.features.map((A) => ({
|
|
6750
6794
|
feature: A,
|
|
6751
|
-
bbox:
|
|
6752
|
-
})),
|
|
6795
|
+
bbox: we(A)
|
|
6796
|
+
})), v = [];
|
|
6753
6797
|
for (const A of h) {
|
|
6754
|
-
|
|
6755
|
-
const
|
|
6798
|
+
bt(e);
|
|
6799
|
+
const D = we(A);
|
|
6756
6800
|
for (const p of a)
|
|
6757
|
-
if (
|
|
6801
|
+
if (st(D, p.bbox))
|
|
6758
6802
|
try {
|
|
6759
6803
|
const E = V.intersect(
|
|
6760
6804
|
V.featureCollection([A, p.feature])
|
|
6761
6805
|
);
|
|
6762
6806
|
if (!E) continue;
|
|
6763
|
-
const
|
|
6807
|
+
const P = {
|
|
6764
6808
|
...p.feature.properties ?? {},
|
|
6765
6809
|
...A.properties ?? {}
|
|
6766
6810
|
};
|
|
6767
6811
|
V.flatten(E).features.forEach((B) => {
|
|
6768
|
-
B.properties = { ...
|
|
6812
|
+
B.properties = { ...P, ...B.properties ?? {} }, v.push(B);
|
|
6769
6813
|
});
|
|
6770
6814
|
} catch {
|
|
6771
6815
|
}
|
|
6772
6816
|
}
|
|
6773
6817
|
const y = Lo(
|
|
6774
|
-
To(
|
|
6818
|
+
To(v),
|
|
6775
6819
|
e
|
|
6776
6820
|
);
|
|
6777
6821
|
return {
|
|
@@ -6840,92 +6884,97 @@ function Ro(n, e, t) {
|
|
|
6840
6884
|
} = t, d = {
|
|
6841
6885
|
dataProjection: "EPSG:4326",
|
|
6842
6886
|
featureProjection: n.getView().getProjection()
|
|
6843
|
-
}, h = (
|
|
6887
|
+
}, h = (D) => new Gr().readFeatures({ type: "FeatureCollection", features: D }, d), a = new globalThis.Map(), y = [new ot({
|
|
6844
6888
|
className: r,
|
|
6845
6889
|
opacity: Math.max(0, Math.min(1, i)),
|
|
6846
6890
|
zIndex: t.zIndex ?? 10,
|
|
6847
6891
|
visible: t.visible ?? !0,
|
|
6848
|
-
source: new
|
|
6849
|
-
style: (
|
|
6850
|
-
const p = ut(
|
|
6851
|
-
if (
|
|
6852
|
-
|
|
6892
|
+
source: new Dt({ features: h(e.vectorFeatures) }),
|
|
6893
|
+
style: (D) => {
|
|
6894
|
+
const p = ut(D.get("symbolId")), E = D.get("isFreezingRain") === !0, P = D.get("isFreezingRainBoundary") === !0, B = D.get("level"), S = `${p}_${String(B)}_${E}_${P}_${o}_${u}_${s}`, X = a.get(S);
|
|
6895
|
+
if (X) return X;
|
|
6896
|
+
if (P) {
|
|
6897
|
+
const N = [
|
|
6898
|
+
new me({
|
|
6899
|
+
zIndex: 3,
|
|
6900
|
+
stroke: new he({ color: Ao, width: 3 })
|
|
6901
|
+
})
|
|
6902
|
+
];
|
|
6903
|
+
return a.set(S, N), N;
|
|
6904
|
+
}
|
|
6905
|
+
const O = [];
|
|
6853
6906
|
if (u) {
|
|
6854
|
-
const
|
|
6855
|
-
|
|
6856
|
-
new
|
|
6907
|
+
const N = Io(p, B);
|
|
6908
|
+
O.push(
|
|
6909
|
+
new me({
|
|
6857
6910
|
fill: new ye({
|
|
6858
|
-
color: p === "24" ? Ho(
|
|
6911
|
+
color: p === "24" ? Ho(N) ?? N : N
|
|
6859
6912
|
})
|
|
6860
6913
|
})
|
|
6861
6914
|
);
|
|
6862
6915
|
}
|
|
6863
|
-
|
|
6864
|
-
|
|
6865
|
-
|
|
6866
|
-
new
|
|
6867
|
-
|
|
6868
|
-
|
|
6869
|
-
|
|
6870
|
-
|
|
6871
|
-
|
|
6872
|
-
|
|
6873
|
-
|
|
6874
|
-
|
|
6875
|
-
|
|
6876
|
-
|
|
6877
|
-
})
|
|
6878
|
-
);
|
|
6879
|
-
}
|
|
6880
|
-
return a.set(B, X), X;
|
|
6916
|
+
return (s && !E || o) && O.push(
|
|
6917
|
+
new me({
|
|
6918
|
+
zIndex: 1,
|
|
6919
|
+
stroke: s && !E ? new he({ color: "#000", width: 1 }) : void 0,
|
|
6920
|
+
text: o ? new wt({
|
|
6921
|
+
text: String(B ?? ""),
|
|
6922
|
+
font: "bold 16px sans-serif",
|
|
6923
|
+
fill: new ye({ color: "#333" }),
|
|
6924
|
+
stroke: new he({ color: "#fff", width: 3 }),
|
|
6925
|
+
placement: "line",
|
|
6926
|
+
overflow: !0
|
|
6927
|
+
}) : void 0
|
|
6928
|
+
})
|
|
6929
|
+
), a.set(S, O), O;
|
|
6881
6930
|
}
|
|
6882
6931
|
})];
|
|
6883
6932
|
if (e.noteFeatures.length && (o || l)) {
|
|
6884
|
-
const
|
|
6933
|
+
const D = new globalThis.Map();
|
|
6885
6934
|
y.push(
|
|
6886
6935
|
new ot({
|
|
6887
6936
|
className: `${r}-notes`,
|
|
6888
6937
|
zIndex: (t.zIndex ?? 10) + 2,
|
|
6889
6938
|
visible: t.visible ?? !0,
|
|
6890
|
-
source: new
|
|
6939
|
+
source: new Dt({ features: h(e.noteFeatures) }),
|
|
6891
6940
|
style: (p) => {
|
|
6892
|
-
const E = String(p.get("text") ?? ""),
|
|
6893
|
-
let B =
|
|
6894
|
-
return B || (B = new
|
|
6941
|
+
const E = String(p.get("text") ?? ""), P = `${E}_${o}_${l}`;
|
|
6942
|
+
let B = D.get(P);
|
|
6943
|
+
return B || (B = new me({
|
|
6895
6944
|
image: l ? new Qt({
|
|
6896
6945
|
radius: 4,
|
|
6897
6946
|
fill: new ye({ color: "#ffffffcc" }),
|
|
6898
|
-
stroke: new
|
|
6947
|
+
stroke: new he({ color: "#ff4d4f", width: 1.5 })
|
|
6899
6948
|
}) : void 0,
|
|
6900
|
-
text: o ? new
|
|
6949
|
+
text: o ? new wt({
|
|
6901
6950
|
text: E,
|
|
6902
6951
|
font: "bold 14px sans-serif",
|
|
6903
6952
|
fill: new ye({ color: "#ff4d4f" }),
|
|
6904
|
-
stroke: new
|
|
6953
|
+
stroke: new he({ color: "#fff", width: 2 }),
|
|
6905
6954
|
offsetY: -12
|
|
6906
6955
|
}) : void 0
|
|
6907
|
-
}),
|
|
6956
|
+
}), D.set(P, B)), B;
|
|
6908
6957
|
}
|
|
6909
6958
|
})
|
|
6910
6959
|
);
|
|
6911
6960
|
}
|
|
6912
6961
|
const A = l ? e.symbolFeatures : e.symbolFeatures.filter(
|
|
6913
|
-
(
|
|
6962
|
+
(D) => String(D.properties?.symbolId) === kt
|
|
6914
6963
|
);
|
|
6915
6964
|
if (A.length) {
|
|
6916
|
-
const
|
|
6965
|
+
const D = new globalThis.Map();
|
|
6917
6966
|
y.push(
|
|
6918
6967
|
new ot({
|
|
6919
6968
|
className: `${r}-filtered`,
|
|
6920
6969
|
zIndex: (t.zIndex ?? 10) + 3,
|
|
6921
6970
|
visible: t.visible ?? !0,
|
|
6922
|
-
source: new
|
|
6971
|
+
source: new Dt({ features: h(A) }),
|
|
6923
6972
|
style: (p) => {
|
|
6924
6973
|
const E = ut(p.get("symbolId"));
|
|
6925
|
-
let
|
|
6926
|
-
if (!
|
|
6974
|
+
let P = D.get(E);
|
|
6975
|
+
if (!P) {
|
|
6927
6976
|
if (E === kt)
|
|
6928
|
-
|
|
6977
|
+
P = new me({
|
|
6929
6978
|
image: new pn({
|
|
6930
6979
|
src: go,
|
|
6931
6980
|
anchor: [0.5, 0.5],
|
|
@@ -6934,17 +6983,17 @@ function Ro(n, e, t) {
|
|
|
6934
6983
|
});
|
|
6935
6984
|
else {
|
|
6936
6985
|
const B = E === "23" ? "#5f4bb6" : E === "24" ? "#2f7ea1" : "#2d9f3b";
|
|
6937
|
-
|
|
6986
|
+
P = new me({
|
|
6938
6987
|
image: new Qt({
|
|
6939
6988
|
radius: 5,
|
|
6940
6989
|
fill: new ye({ color: B }),
|
|
6941
|
-
stroke: new
|
|
6990
|
+
stroke: new he({ color: "#fff", width: 1.5 })
|
|
6942
6991
|
})
|
|
6943
6992
|
});
|
|
6944
6993
|
}
|
|
6945
|
-
|
|
6994
|
+
D.set(E, P);
|
|
6946
6995
|
}
|
|
6947
|
-
return
|
|
6996
|
+
return P;
|
|
6948
6997
|
}
|
|
6949
6998
|
})
|
|
6950
6999
|
);
|
|
@@ -6954,7 +7003,7 @@ function Ro(n, e, t) {
|
|
|
6954
7003
|
async function zo(n, e) {
|
|
6955
7004
|
if (!e.className || !e.filePath) return;
|
|
6956
7005
|
const t = en(n, e.className), r = await Xo(e);
|
|
6957
|
-
if (
|
|
7006
|
+
if (bt(e.signal), !Or(n, e.className, t)) return;
|
|
6958
7007
|
const i = n.getLayers().getArray().find((u) => u.getClassName() === e.className), o = Ro(n, r, {
|
|
6959
7008
|
...e,
|
|
6960
7009
|
zIndex: i?.getZIndex() ?? e.zIndex,
|
|
@@ -7106,10 +7155,10 @@ function Jo(n, e, t) {
|
|
|
7106
7155
|
return or.get(n)?.get(e) === t;
|
|
7107
7156
|
}
|
|
7108
7157
|
function Zo(n) {
|
|
7109
|
-
return typeof n.isolineBorderColor == "string" ? n.isolineBorderColor : typeof n.isolineColor == "string" ? n.isolineColor : n.isolineColor === !0 ?
|
|
7158
|
+
return typeof n.isolineBorderColor == "string" ? n.isolineBorderColor : typeof n.isolineColor == "string" ? n.isolineColor : n.isolineColor === !0 ? xe(n.legend ?? [], n.legendScope).colorMap : nr;
|
|
7110
7159
|
}
|
|
7111
7160
|
function Ko(n) {
|
|
7112
|
-
return
|
|
7161
|
+
return xe(n.legend ?? [], n.legendScope).colorMap;
|
|
7113
7162
|
}
|
|
7114
7163
|
function Xr(n) {
|
|
7115
7164
|
if (typeof n == "string") return () => n;
|
|
@@ -7130,37 +7179,37 @@ function _o(n, e, t) {
|
|
|
7130
7179
|
return [i, o, u, s / 255 * Math.max(0, Math.min(1, t))];
|
|
7131
7180
|
}
|
|
7132
7181
|
function Ir(n, e, t, r) {
|
|
7133
|
-
const i = new globalThis.Map(), o = [], [u, s, l, d] = r, h = (l - u) / e, a = (d - s) / t,
|
|
7182
|
+
const i = new globalThis.Map(), o = [], [u, s, l, d] = r, h = (l - u) / e, a = (d - s) / t, v = (A) => {
|
|
7134
7183
|
if (!Array.isArray(A) || A.length < 2) return null;
|
|
7135
|
-
const
|
|
7184
|
+
const D = [];
|
|
7136
7185
|
for (const p of A)
|
|
7137
|
-
!Array.isArray(p) || p.length < 2 || !Number.isFinite(p[0]) || !Number.isFinite(p[1]) ||
|
|
7138
|
-
return
|
|
7139
|
-
}, y = (A,
|
|
7186
|
+
!Array.isArray(p) || p.length < 2 || !Number.isFinite(p[0]) || !Number.isFinite(p[1]) || D.push([u + p[0] * h, d - p[1] * a]);
|
|
7187
|
+
return D.length >= 2 ? D : null;
|
|
7188
|
+
}, y = (A, D) => {
|
|
7140
7189
|
const p = i.get(A) ?? [];
|
|
7141
|
-
p.push(
|
|
7190
|
+
p.push(D), i.set(A, p);
|
|
7142
7191
|
};
|
|
7143
7192
|
for (const A of n) {
|
|
7144
|
-
const
|
|
7145
|
-
if (!(!Number.isFinite(
|
|
7193
|
+
const D = Number(A.value);
|
|
7194
|
+
if (!(!Number.isFinite(D) || !Array.isArray(A.coordinates))) {
|
|
7146
7195
|
if (A.type === "Polygon") {
|
|
7147
|
-
const p = A.coordinates.map(
|
|
7148
|
-
p.length && (o.push({ type: "Polygon", coordinates: p, value:
|
|
7196
|
+
const p = A.coordinates.map(v).filter((E) => !!E);
|
|
7197
|
+
p.length && (o.push({ type: "Polygon", coordinates: p, value: D }), p.forEach((E) => y(D, E)));
|
|
7149
7198
|
} else if (A.type === "MultiPolygon") {
|
|
7150
7199
|
const p = [];
|
|
7151
7200
|
for (const E of A.coordinates) {
|
|
7152
|
-
const
|
|
7153
|
-
|
|
7201
|
+
const P = E.map(v).filter((B) => !!B);
|
|
7202
|
+
P.length && (p.push(P), P.forEach((B) => y(D, B)));
|
|
7154
7203
|
}
|
|
7155
|
-
p.length && o.push({ type: "MultiPolygon", coordinates: p, value:
|
|
7204
|
+
p.length && o.push({ type: "MultiPolygon", coordinates: p, value: D });
|
|
7156
7205
|
}
|
|
7157
7206
|
}
|
|
7158
7207
|
}
|
|
7159
7208
|
return {
|
|
7160
7209
|
lines: [...i.entries()].map(
|
|
7161
|
-
([A,
|
|
7210
|
+
([A, D]) => D.length === 1 ? { type: "LineString", coordinates: D[0], value: A } : { type: "MultiLineString", coordinates: D, value: A }
|
|
7162
7211
|
),
|
|
7163
|
-
polygons: o.sort((A,
|
|
7212
|
+
polygons: o.sort((A, D) => A.value - D.value)
|
|
7164
7213
|
};
|
|
7165
7214
|
}
|
|
7166
7215
|
function $o(n) {
|
|
@@ -7184,24 +7233,24 @@ function $o(n) {
|
|
|
7184
7233
|
async function ei(n) {
|
|
7185
7234
|
const e = await Yo(n);
|
|
7186
7235
|
if (!e) return { lines: [], polygons: [] };
|
|
7187
|
-
const { rawArr2D: t, extent: r, width: i, height: o } = e, { uniqueThresholds: u } =
|
|
7236
|
+
const { rawArr2D: t, extent: r, width: i, height: o } = e, { uniqueThresholds: u } = xe(n.config.legend ?? []);
|
|
7188
7237
|
if (i < 2 || o < 2 || u.length === 0)
|
|
7189
7238
|
return { lines: [], polygons: [] };
|
|
7190
7239
|
const s = un(n.config), l = Ur(t, i, o, s), d = new Float64Array(i * o);
|
|
7191
7240
|
for (let y = 0; y < o; y++) {
|
|
7192
7241
|
const A = l[y];
|
|
7193
|
-
for (let
|
|
7194
|
-
const p = A?.[
|
|
7195
|
-
d[y * i +
|
|
7242
|
+
for (let D = 0; D < i; D++) {
|
|
7243
|
+
const p = A?.[D];
|
|
7244
|
+
d[y * i + D] = p === void 0 || !Number.isFinite(p) ? NaN : p;
|
|
7196
7245
|
}
|
|
7197
7246
|
}
|
|
7198
|
-
const h = Ht().size([i, o]).thresholds(u).smooth(s > 0)(d), a = Ir(h, i, o, r),
|
|
7247
|
+
const h = Ht().size([i, o]).thresholds(u).smooth(s > 0)(d), a = Ir(h, i, o, r), v = Ir(
|
|
7199
7248
|
$o(h),
|
|
7200
7249
|
i,
|
|
7201
7250
|
o,
|
|
7202
7251
|
r
|
|
7203
7252
|
);
|
|
7204
|
-
return { lines: a.lines, polygons:
|
|
7253
|
+
return { lines: a.lines, polygons: v.polygons };
|
|
7205
7254
|
}
|
|
7206
7255
|
async function an(n, e) {
|
|
7207
7256
|
const t = He.get(n);
|
|
@@ -7231,46 +7280,46 @@ function ti(n) {
|
|
|
7231
7280
|
lineWidth: d = 1.2,
|
|
7232
7281
|
showLabel: h = !0,
|
|
7233
7282
|
zIndex: a = 9999,
|
|
7234
|
-
visible:
|
|
7283
|
+
visible: v = !0,
|
|
7235
7284
|
geometryCacheKey: y,
|
|
7236
7285
|
visibleThresholds: A
|
|
7237
|
-
} = n,
|
|
7238
|
-
const z = Number(
|
|
7286
|
+
} = n, D = Xr(o), p = Xr(u), E = A ? new Set(A) : void 0, P = new globalThis.Map(), B = (N) => {
|
|
7287
|
+
const z = Number(N.get("value"));
|
|
7239
7288
|
if (E && !E.has(z)) return;
|
|
7240
|
-
const C =
|
|
7289
|
+
const C = N.get("geometryKind") === "fill" ? "fill" : "line";
|
|
7241
7290
|
if (C === "fill" && !s) return;
|
|
7242
|
-
const
|
|
7243
|
-
let F =
|
|
7244
|
-
return F || (C === "fill" ? (F = new
|
|
7291
|
+
const T = `${C}:${z}`;
|
|
7292
|
+
let F = P.get(T);
|
|
7293
|
+
return F || (C === "fill" ? (F = new me({
|
|
7245
7294
|
fill: new ye({ color: _o(p, z, l) }),
|
|
7246
7295
|
zIndex: 0
|
|
7247
|
-
}),
|
|
7248
|
-
stroke: new
|
|
7249
|
-
text: h ? new
|
|
7296
|
+
}), P.set(T, F), F) : (F = new me({
|
|
7297
|
+
stroke: new he({ color: D(z), width: d }),
|
|
7298
|
+
text: h ? new wt({
|
|
7250
7299
|
text: Number.isInteger(z) ? String(z) : String(Number(z.toFixed(1))),
|
|
7251
7300
|
fill: new ye({ color: "#fff" }),
|
|
7252
|
-
stroke: new
|
|
7301
|
+
stroke: new he({ color: "#000", width: 3 }),
|
|
7253
7302
|
placement: "line",
|
|
7254
7303
|
overflow: !1
|
|
7255
7304
|
}) : void 0,
|
|
7256
7305
|
zIndex: 1
|
|
7257
|
-
}),
|
|
7306
|
+
}), P.set(T, F), F));
|
|
7258
7307
|
}, S = fr(e, t);
|
|
7259
7308
|
if (y && S instanceof ot && S.get("isolineGeometryCacheKey") === y)
|
|
7260
|
-
return S.setStyle(B), S.setZIndex(a), S.setVisible(
|
|
7309
|
+
return S.setStyle(B), S.setZIndex(a), S.setVisible(v), S.setDeclutter(h), S.changed(), S;
|
|
7261
7310
|
const X = new Gr().readFeatures(
|
|
7262
7311
|
{
|
|
7263
7312
|
type: "FeatureCollection",
|
|
7264
7313
|
features: [
|
|
7265
|
-
...s || y ? i.map(({ value:
|
|
7314
|
+
...s || y ? i.map(({ value: N, ...z }) => ({
|
|
7266
7315
|
type: "Feature",
|
|
7267
7316
|
geometry: z,
|
|
7268
|
-
properties: { value:
|
|
7317
|
+
properties: { value: N, geometryKind: "fill" }
|
|
7269
7318
|
})) : [],
|
|
7270
|
-
...r.map(({ value:
|
|
7319
|
+
...r.map(({ value: N, ...z }) => ({
|
|
7271
7320
|
type: "Feature",
|
|
7272
7321
|
geometry: z,
|
|
7273
|
-
properties: { value:
|
|
7322
|
+
properties: { value: N, geometryKind: "line" }
|
|
7274
7323
|
}))
|
|
7275
7324
|
]
|
|
7276
7325
|
},
|
|
@@ -7278,22 +7327,22 @@ function ti(n) {
|
|
|
7278
7327
|
dataProjection: "EPSG:3857",
|
|
7279
7328
|
featureProjection: e.getView().getProjection()
|
|
7280
7329
|
}
|
|
7281
|
-
),
|
|
7330
|
+
), O = new ot({
|
|
7282
7331
|
className: t,
|
|
7283
|
-
source: new
|
|
7332
|
+
source: new Dt({ features: X }),
|
|
7284
7333
|
zIndex: a,
|
|
7285
|
-
visible:
|
|
7334
|
+
visible: v,
|
|
7286
7335
|
declutter: h,
|
|
7287
7336
|
style: B
|
|
7288
7337
|
});
|
|
7289
|
-
return y &&
|
|
7338
|
+
return y && O.set("isolineGeometryCacheKey", y), nn(e, t), e.addLayer(O), O;
|
|
7290
7339
|
}
|
|
7291
7340
|
async function ri(n, e) {
|
|
7292
7341
|
const { id: t, config: r } = e, i = sn(n, t);
|
|
7293
7342
|
if (!e.url || e.signal?.aborted) return;
|
|
7294
7343
|
const o = on(e), u = await an(o, e);
|
|
7295
7344
|
if (e.signal?.aborted || !Jo(n, t, i)) return;
|
|
7296
|
-
const s = fr(n, t), { uniqueThresholds: l } =
|
|
7345
|
+
const s = fr(n, t), { uniqueThresholds: l } = xe(
|
|
7297
7346
|
r.legend ?? [],
|
|
7298
7347
|
r.legendScope
|
|
7299
7348
|
);
|
|
@@ -7410,9 +7459,9 @@ class ui extends Kr {
|
|
|
7410
7459
|
);
|
|
7411
7460
|
for (let u = 0; u < i; u++)
|
|
7412
7461
|
for (let s = 0; s < r; s++) {
|
|
7413
|
-
const l = u * r + s, d = e[l], h = t[l], a = typeof d < "u" && Number.isFinite(Number(d)),
|
|
7414
|
-
if (!a && !
|
|
7415
|
-
const y = a ? Number(d) : 0, A =
|
|
7462
|
+
const l = u * r + s, d = e[l], h = t[l], a = typeof d < "u" && Number.isFinite(Number(d)), v = typeof h < "u" && Number.isFinite(Number(h));
|
|
7463
|
+
if (!a && !v) continue;
|
|
7464
|
+
const y = a ? Number(d) : 0, A = v ? Number(h) : 0;
|
|
7416
7465
|
o[u][s] = Math.sqrt(y * y + A * A);
|
|
7417
7466
|
}
|
|
7418
7467
|
return o;
|
|
@@ -7445,24 +7494,24 @@ class ui extends Kr {
|
|
|
7445
7494
|
const l = this.windVectorLoadingTasks.get(u);
|
|
7446
7495
|
if (l) return l;
|
|
7447
7496
|
const d = (async () => {
|
|
7448
|
-
const h = this.getComponentScope(e), [a,
|
|
7497
|
+
const h = this.getComponentScope(e), [a, v] = await Promise.all([
|
|
7449
7498
|
it(o[0], h, void 0, i, {
|
|
7450
7499
|
detectNoDataByBorderColor: !1
|
|
7451
7500
|
}),
|
|
7452
7501
|
it(o[1], h, void 0, i, {
|
|
7453
7502
|
detectNoDataByBorderColor: !1
|
|
7454
7503
|
})
|
|
7455
|
-
]), y = Math.min(a?.width ?? 0,
|
|
7456
|
-
if (!y || !A || !a?.grayArr || !
|
|
7457
|
-
const
|
|
7458
|
-
for (let
|
|
7459
|
-
const B = Number(a.grayArr[
|
|
7460
|
-
|
|
7504
|
+
]), y = Math.min(a?.width ?? 0, v?.width ?? 0), A = Math.min(a?.height ?? 0, v?.height ?? 0);
|
|
7505
|
+
if (!y || !A || !a?.grayArr || !v?.grayArr) return null;
|
|
7506
|
+
const D = new Float32Array(y * A), p = new Float32Array(y * A);
|
|
7507
|
+
for (let P = 0; P < y * A; P++) {
|
|
7508
|
+
const B = Number(a.grayArr[P]), S = Number(v.grayArr[P]);
|
|
7509
|
+
D[P] = Number.isFinite(B) ? B : 0, p[P] = Number.isFinite(S) ? S : 0;
|
|
7461
7510
|
}
|
|
7462
7511
|
const E = {
|
|
7463
7512
|
width: y,
|
|
7464
7513
|
height: A,
|
|
7465
|
-
u:
|
|
7514
|
+
u: D,
|
|
7466
7515
|
v: p,
|
|
7467
7516
|
extent: Et(r.extent)
|
|
7468
7517
|
};
|
|
@@ -7496,12 +7545,12 @@ class ui extends Kr {
|
|
|
7496
7545
|
const l = (async () => {
|
|
7497
7546
|
const d = await this.getOrLoadWindVectorData(e);
|
|
7498
7547
|
if (!d) return null;
|
|
7499
|
-
const { u: h, v: a, width:
|
|
7548
|
+
const { u: h, v: a, width: v, height: y, extent: A } = d, D = this.buildWindSpeedGrid(h, a, v, y), p = sr(D, v, y), E = this.prepareGrid(D, v, y), P = this.prepareGrid(p, v, y), B = {
|
|
7500
7549
|
schemaVersion: Hr,
|
|
7501
7550
|
rawArr2D: E,
|
|
7502
|
-
smoothArr2D:
|
|
7551
|
+
smoothArr2D: P,
|
|
7503
7552
|
extent: A,
|
|
7504
|
-
width:
|
|
7553
|
+
width: v,
|
|
7505
7554
|
height: y
|
|
7506
7555
|
};
|
|
7507
7556
|
return this.contourCache.set(o, B), B;
|
|
@@ -7520,11 +7569,11 @@ class ui extends Kr {
|
|
|
7520
7569
|
return super.getSourceFromParams(e);
|
|
7521
7570
|
const i = await this.getOrLoadContourData(e);
|
|
7522
7571
|
if (!i) return;
|
|
7523
|
-
const { rawArr2D: o, smoothArr2D: u, extent: s, width: l, height: d } = i, h = this.getValueTransformFn(e), a = this.applyValueTransform2D(o, "raw", h),
|
|
7572
|
+
const { rawArr2D: o, smoothArr2D: u, extent: s, width: l, height: d } = i, h = this.getValueTransformFn(e), a = this.applyValueTransform2D(o, "raw", h), v = this.applyValueTransform2D(u, "smooth", h), { colorMap: y } = xe(t.legend, t.legendScope), A = Ct(t.legend, t.legendScope) ?? t.scope;
|
|
7524
7573
|
return this.getFcstRasterSource(
|
|
7525
7574
|
{
|
|
7526
7575
|
rawArr2D: a,
|
|
7527
|
-
smoothArr2D:
|
|
7576
|
+
smoothArr2D: v,
|
|
7528
7577
|
extent: s,
|
|
7529
7578
|
width: l,
|
|
7530
7579
|
height: d,
|
|
@@ -7587,7 +7636,7 @@ class Rr {
|
|
|
7587
7636
|
}
|
|
7588
7637
|
getVisibleWindSpeedScope() {
|
|
7589
7638
|
const e = this.getRuntimeConfig();
|
|
7590
|
-
return
|
|
7639
|
+
return Ct(e.legend, e.legendScope) ?? e.scope;
|
|
7591
7640
|
}
|
|
7592
7641
|
getWindShaftConfig() {
|
|
7593
7642
|
const e = this.getRuntimeConfig(), t = e.windShaftConfig ?? {}, r = e.gridConfig ?? {}, i = (o, u) => {
|
|
@@ -7646,17 +7695,17 @@ class Rr {
|
|
|
7646
7695
|
if (!l || !d) return null;
|
|
7647
7696
|
const h = new Float32Array(l * d), a = new Float32Array(l * d);
|
|
7648
7697
|
for (let y = 0; y < l * d; y++) {
|
|
7649
|
-
const A = Number(u.grayArr[y]),
|
|
7650
|
-
h[y] = Number.isFinite(A) ? A : 0, a[y] = Number.isFinite(
|
|
7698
|
+
const A = Number(u.grayArr[y]), D = Number(s.grayArr[y]);
|
|
7699
|
+
h[y] = Number.isFinite(A) ? A : 0, a[y] = Number.isFinite(D) ? D : 0;
|
|
7651
7700
|
}
|
|
7652
|
-
const
|
|
7701
|
+
const v = {
|
|
7653
7702
|
width: l,
|
|
7654
7703
|
height: d,
|
|
7655
7704
|
u: h,
|
|
7656
7705
|
v: a,
|
|
7657
7706
|
extent: Et(e.extent)
|
|
7658
7707
|
};
|
|
7659
|
-
return this.contourCache.set(t,
|
|
7708
|
+
return this.contourCache.set(t, v), v;
|
|
7660
7709
|
}
|
|
7661
7710
|
createWindShaftSource(e, t) {
|
|
7662
7711
|
const r = this.getWindShaftConfig(), {
|
|
@@ -7668,67 +7717,67 @@ class Rr {
|
|
|
7668
7717
|
maxLevel: d,
|
|
7669
7718
|
spriteCellSize: h,
|
|
7670
7719
|
baseFontSize: a,
|
|
7671
|
-
iconYOffsetRatio:
|
|
7720
|
+
iconYOffsetRatio: v,
|
|
7672
7721
|
firstRowMaxLevel: y,
|
|
7673
7722
|
firstRowStartX: A,
|
|
7674
|
-
firstRowY:
|
|
7723
|
+
firstRowY: D,
|
|
7675
7724
|
secondRowOffsetX: p,
|
|
7676
7725
|
secondRowY: E
|
|
7677
|
-
} = r,
|
|
7726
|
+
} = r, P = this.getVisibleWindSpeedScope(), B = document.createElement("canvas"), [S, X, O, N] = e.extent, z = O - S, C = N - X;
|
|
7678
7727
|
return new jt({
|
|
7679
7728
|
projection: "EPSG:3857",
|
|
7680
7729
|
ratio: 1,
|
|
7681
7730
|
interpolate: !1,
|
|
7682
|
-
canvasFunction: (
|
|
7683
|
-
const g = R ?? [1, 1],
|
|
7684
|
-
B.width !==
|
|
7685
|
-
const L = this.map.getSize(), I = Math.max(1, Math.floor(L?.[0] ??
|
|
7731
|
+
canvasFunction: (T, F, M, R) => {
|
|
7732
|
+
const g = R ?? [1, 1], b = Math.max(1, Math.floor(g[0] ?? 1)), w = Math.max(1, Math.floor(g[1] ?? 1));
|
|
7733
|
+
B.width !== b && (B.width = b), B.height !== w && (B.height = w);
|
|
7734
|
+
const L = this.map.getSize(), I = Math.max(1, Math.floor(L?.[0] ?? b)), H = Math.max(1, Math.floor(L?.[1] ?? w)), G = b / I, Q = w / H, J = (G + Q) * 0.5, Y = B.getContext("2d", { alpha: !0 });
|
|
7686
7735
|
if (!Y) return B;
|
|
7687
|
-
Y.clearRect(0, 0,
|
|
7688
|
-
const j = o / a * J, W = h * j, K = h * j, [Z, U, te, se] =
|
|
7736
|
+
Y.clearRect(0, 0, b, w);
|
|
7737
|
+
const j = o / a * J, W = h * j, K = h * j, [Z, U, te, se] = T, _ = te - Z, $ = se - U;
|
|
7689
7738
|
if (_ <= 0 || $ <= 0 || z <= 0 || C <= 0) return B;
|
|
7690
|
-
const ae = Math.max(Z, S), ne = Math.max(U, X),
|
|
7691
|
-
if (ae >=
|
|
7692
|
-
const
|
|
7739
|
+
const ae = Math.max(Z, S), ne = Math.max(U, X), de = Math.min(te, O), ue = Math.min(se, N);
|
|
7740
|
+
if (ae >= de || ne >= ue) return B;
|
|
7741
|
+
const pe = Math.max(1, I - 1), ve = Math.max(1, H - 1), le = Math.max(8, Math.round(i)), De = Math.max(
|
|
7693
7742
|
0,
|
|
7694
|
-
Math.floor((ae - Z) / _ *
|
|
7743
|
+
Math.floor((ae - Z) / _ * pe)
|
|
7695
7744
|
), ee = Math.min(
|
|
7696
7745
|
I - 1,
|
|
7697
|
-
Math.ceil((
|
|
7746
|
+
Math.ceil((de - Z) / _ * pe)
|
|
7698
7747
|
), oe = Math.max(
|
|
7699
7748
|
0,
|
|
7700
|
-
Math.floor((se - ue) / $ *
|
|
7749
|
+
Math.floor((se - ue) / $ * ve)
|
|
7701
7750
|
), Pe = Math.min(
|
|
7702
7751
|
H - 1,
|
|
7703
|
-
Math.ceil((se - ne) / $ *
|
|
7752
|
+
Math.ceil((se - ne) / $ * ve)
|
|
7704
7753
|
);
|
|
7705
|
-
if (
|
|
7706
|
-
for (let
|
|
7707
|
-
for (let Fe =
|
|
7708
|
-
const
|
|
7754
|
+
if (De > ee || oe > Pe) return B;
|
|
7755
|
+
for (let Ee = oe; Ee <= Pe; Ee += le)
|
|
7756
|
+
for (let Fe = De; Fe <= ee; Fe += le) {
|
|
7757
|
+
const at = Z + _ * Fe / pe, ct = se - $ * Ee / ve, qe = (at - S) / z * (e.width - 1), lt = (N - ct) / C * (e.height - 1), Qe = $t(e.u, qe, lt, e.width, e.height), Se = $t(e.v, qe, lt, e.width, e.height);
|
|
7709
7758
|
if (!Number.isFinite(Qe) || !Number.isFinite(Se)) continue;
|
|
7710
7759
|
const Ze = Math.atan2(Qe, Se) * (180 / Math.PI), Me = Math.sqrt(Qe * Qe + Se * Se);
|
|
7711
7760
|
if (Me <= s) continue;
|
|
7712
|
-
if (Array.isArray(
|
|
7713
|
-
const
|
|
7714
|
-
if (Number.isFinite(
|
|
7761
|
+
if (Array.isArray(P) && P.length === 2) {
|
|
7762
|
+
const gt = Math.min(Number(P[0]), Number(P[1])), _e = Math.max(Number(P[0]), Number(P[1]));
|
|
7763
|
+
if (Number.isFinite(gt) && Number.isFinite(_e) && (Me < gt || Me > _e))
|
|
7715
7764
|
continue;
|
|
7716
7765
|
}
|
|
7717
7766
|
const Ke = Math.min(Math.ceil(Me / l), d - 1);
|
|
7718
|
-
let
|
|
7719
|
-
Ke > y && (
|
|
7720
|
-
const
|
|
7721
|
-
Y.translate(
|
|
7767
|
+
let ft = A + Ke, ht = D;
|
|
7768
|
+
Ke > y && (ft = Ke - p, ht = E), Y.save();
|
|
7769
|
+
const dt = Fe * G, Oe = Ee * Q;
|
|
7770
|
+
Y.translate(dt, Oe), Y.rotate(Ze * Math.PI / 180), Y.drawImage(
|
|
7722
7771
|
t,
|
|
7723
|
-
lt * h,
|
|
7724
7772
|
ft * h,
|
|
7773
|
+
ht * h,
|
|
7725
7774
|
h,
|
|
7726
7775
|
h,
|
|
7727
7776
|
-W / 2,
|
|
7728
|
-
-K *
|
|
7777
|
+
-K * v,
|
|
7729
7778
|
W,
|
|
7730
7779
|
K
|
|
7731
|
-
), Y.globalCompositeOperation = "source-atop", Y.fillStyle = u, Y.fillRect(-W / 2, -K *
|
|
7780
|
+
), Y.globalCompositeOperation = "source-atop", Y.fillStyle = u, Y.fillRect(-W / 2, -K * v, W, K), Y.globalCompositeOperation = "source-over", Y.restore();
|
|
7732
7781
|
}
|
|
7733
7782
|
return B;
|
|
7734
7783
|
}
|
|
@@ -7751,7 +7800,7 @@ class Rr {
|
|
|
7751
7800
|
o && this.delete();
|
|
7752
7801
|
const u = o ? o.getZIndex() : t + 1, s = await this.getSourceFromCache() ?? await this.getSourceFromParams();
|
|
7753
7802
|
if (!s) return;
|
|
7754
|
-
const l = new
|
|
7803
|
+
const l = new yt({
|
|
7755
7804
|
source: s,
|
|
7756
7805
|
className: i,
|
|
7757
7806
|
zIndex: u,
|
|
@@ -7881,15 +7930,15 @@ class ai {
|
|
|
7881
7930
|
}).then(async (h) => {
|
|
7882
7931
|
const a = (h.headers.get("content-type") || "").toLowerCase();
|
|
7883
7932
|
if (!h.ok) {
|
|
7884
|
-
const
|
|
7933
|
+
const v = await h.text();
|
|
7885
7934
|
throw new Error(
|
|
7886
|
-
`WMS tile request failed: ${h.status} ${h.statusText}; ${
|
|
7935
|
+
`WMS tile request failed: ${h.status} ${h.statusText}; ${v.slice(0, 240)}`
|
|
7887
7936
|
);
|
|
7888
7937
|
}
|
|
7889
7938
|
if (!a.includes("image/")) {
|
|
7890
|
-
const
|
|
7939
|
+
const v = await h.text();
|
|
7891
7940
|
throw new Error(
|
|
7892
|
-
`WMS tile response is not image: ${a}; ${
|
|
7941
|
+
`WMS tile response is not image: ${a}; ${v.slice(0, 240)}`
|
|
7893
7942
|
);
|
|
7894
7943
|
}
|
|
7895
7944
|
return h.blob();
|
|
@@ -7969,13 +8018,13 @@ function ci(n) {
|
|
|
7969
8018
|
return String(n ?? "").trim().replace(/\/+$/, "");
|
|
7970
8019
|
}
|
|
7971
8020
|
function li(n, e) {
|
|
7972
|
-
const t =
|
|
8021
|
+
const t = Ce();
|
|
7973
8022
|
return `${ci(
|
|
7974
8023
|
e || t.typhoonServiceBaseUrl || t.serviceBaseUrl
|
|
7975
8024
|
)}/${n.replace(/^\/+/, "")}`;
|
|
7976
8025
|
}
|
|
7977
8026
|
async function cn(n, e) {
|
|
7978
|
-
const t =
|
|
8027
|
+
const t = Ce(), r = e?.authorization ?? t.typhoonAuthorization, i = await fetch(li(n, e?.serviceBaseUrl), {
|
|
7979
8028
|
credentials: "include",
|
|
7980
8029
|
signal: e?.signal,
|
|
7981
8030
|
headers: r ? { Authorization: r } : void 0
|
|
@@ -7995,11 +8044,11 @@ async function cn(n, e) {
|
|
|
7995
8044
|
return await i.json();
|
|
7996
8045
|
}
|
|
7997
8046
|
function fi(n) {
|
|
7998
|
-
const e = n?.dataPath ||
|
|
8047
|
+
const e = n?.dataPath || Ce().typhoonDataPath;
|
|
7999
8048
|
return cn(`fileServer/${e}/typhoon_list.json`, n);
|
|
8000
8049
|
}
|
|
8001
8050
|
function hi(n, e) {
|
|
8002
|
-
const t = e?.dataPath ||
|
|
8051
|
+
const t = e?.dataPath || Ce().typhoonDataPath;
|
|
8003
8052
|
return cn(`fileServer/${t}/${n}.json`, e);
|
|
8004
8053
|
}
|
|
8005
8054
|
const di = ["BABJ|WTPQ20", "RJTD|WTPQ51", "RJTD|WTPQ50"], zr = ["#d9480f", "#1971c2", "#2b8a3e", "#862e9c", "#0b7285", "#c92a2a"], gi = {
|
|
@@ -8097,7 +8146,7 @@ class mi {
|
|
|
8097
8146
|
render(e, t) {
|
|
8098
8147
|
const r = Number.isFinite(Number(this.options.config?.zIndex)) ? Number(this.options.config.zIndex) : 30, i = ge(this.map, this.getClassName());
|
|
8099
8148
|
i && this.delete();
|
|
8100
|
-
const o = i ? i.getZIndex() : r, u = new
|
|
8149
|
+
const o = i ? i.getZIndex() : r, u = new Dt();
|
|
8101
8150
|
t.forEach((l, d) => {
|
|
8102
8151
|
const h = e.find((a) => a.num_inati === l.typhoon_num);
|
|
8103
8152
|
this.appendTyphoonFeatures(u, l, h, zr[d % zr.length]);
|
|
@@ -8119,15 +8168,15 @@ class mi {
|
|
|
8119
8168
|
if (Object.entries(t.obs ?? {}).forEach(([d, h]) => {
|
|
8120
8169
|
const a = It(Xt(h));
|
|
8121
8170
|
if (!a.length) return;
|
|
8122
|
-
const
|
|
8171
|
+
const v = d === u;
|
|
8123
8172
|
this.addLineFeature(e, a, {
|
|
8124
8173
|
kind: "obs",
|
|
8125
8174
|
sourceName: d,
|
|
8126
8175
|
color: i,
|
|
8127
|
-
isPrimary:
|
|
8176
|
+
isPrimary: v,
|
|
8128
8177
|
typhoonName: o,
|
|
8129
8178
|
typhoonNum: t.typhoon_num
|
|
8130
|
-
}),
|
|
8179
|
+
}), v && this.addPointFeatures(e, a, {
|
|
8131
8180
|
kind: "obs",
|
|
8132
8181
|
sourceName: d,
|
|
8133
8182
|
color: i,
|
|
@@ -8139,18 +8188,18 @@ class mi {
|
|
|
8139
8188
|
Object.entries(t.fcst ?? {}).forEach(([d, h]) => {
|
|
8140
8189
|
const a = It(Xt(h));
|
|
8141
8190
|
if (!a.length) return;
|
|
8142
|
-
const
|
|
8191
|
+
const v = d === l, y = this.getForecastAnchorPoint(t, d, a, u), A = y ? [y, ...a] : a;
|
|
8143
8192
|
this.addLineFeature(e, A, {
|
|
8144
8193
|
kind: "fcst",
|
|
8145
8194
|
sourceName: d,
|
|
8146
8195
|
color: i,
|
|
8147
|
-
isPrimary:
|
|
8196
|
+
isPrimary: v,
|
|
8148
8197
|
typhoonName: o,
|
|
8149
8198
|
typhoonNum: t.typhoon_num
|
|
8150
8199
|
}), this.addForecastLabelFeature(e, a[a.length - 1], {
|
|
8151
8200
|
sourceName: d,
|
|
8152
8201
|
color: i,
|
|
8153
|
-
isPrimary:
|
|
8202
|
+
isPrimary: v,
|
|
8154
8203
|
typhoonName: o,
|
|
8155
8204
|
typhoonNum: t.typhoon_num
|
|
8156
8205
|
});
|
|
@@ -8205,50 +8254,50 @@ class mi {
|
|
|
8205
8254
|
const h = this.getGradeColor(o, r);
|
|
8206
8255
|
let a;
|
|
8207
8256
|
if (t === "obs-line")
|
|
8208
|
-
a = new
|
|
8209
|
-
stroke: new
|
|
8257
|
+
a = new me({
|
|
8258
|
+
stroke: new he({
|
|
8210
8259
|
color: s ? h : `${h}80`,
|
|
8211
8260
|
width: s ? 3 : 1.5
|
|
8212
8261
|
})
|
|
8213
8262
|
});
|
|
8214
8263
|
else if (t === "fcst-line")
|
|
8215
|
-
a = new
|
|
8216
|
-
stroke: new
|
|
8264
|
+
a = new me({
|
|
8265
|
+
stroke: new he({
|
|
8217
8266
|
color: s ? h : `${h}80`,
|
|
8218
8267
|
width: s ? 2 : 1.25,
|
|
8219
8268
|
lineDash: [8, 8]
|
|
8220
8269
|
})
|
|
8221
8270
|
});
|
|
8222
8271
|
else if (t === "fcst-label")
|
|
8223
|
-
a = new
|
|
8272
|
+
a = new me({
|
|
8224
8273
|
image: new Qt({
|
|
8225
8274
|
radius: s ? 4.5 : 3.5,
|
|
8226
8275
|
fill: new ye({ color: h }),
|
|
8227
|
-
stroke: new
|
|
8276
|
+
stroke: new he({ color: "#fff", width: 1.5 })
|
|
8228
8277
|
}),
|
|
8229
|
-
text: new
|
|
8278
|
+
text: new wt({
|
|
8230
8279
|
text: i,
|
|
8231
8280
|
font: s ? "bold 12px sans-serif" : "12px sans-serif",
|
|
8232
8281
|
fill: new ye({ color: "#1f2937" }),
|
|
8233
|
-
stroke: new
|
|
8282
|
+
stroke: new he({ color: "#fff", width: 4 }),
|
|
8234
8283
|
offsetX: 8,
|
|
8235
8284
|
offsetY: -8,
|
|
8236
8285
|
textAlign: "left"
|
|
8237
8286
|
})
|
|
8238
8287
|
});
|
|
8239
8288
|
else {
|
|
8240
|
-
const
|
|
8241
|
-
a = new
|
|
8289
|
+
const v = t === "latest-point";
|
|
8290
|
+
a = new me({
|
|
8242
8291
|
image: new Qt({
|
|
8243
|
-
radius:
|
|
8292
|
+
radius: v ? 6 : 4,
|
|
8244
8293
|
fill: new ye({ color: h }),
|
|
8245
|
-
stroke: new
|
|
8294
|
+
stroke: new he({ color: "#fff", width: v ? 2 : 1.5 })
|
|
8246
8295
|
}),
|
|
8247
|
-
text:
|
|
8296
|
+
text: v ? new wt({
|
|
8248
8297
|
text: u,
|
|
8249
8298
|
font: "bold 13px sans-serif",
|
|
8250
8299
|
fill: new ye({ color: "#1f2937" }),
|
|
8251
|
-
stroke: new
|
|
8300
|
+
stroke: new he({ color: "#fff", width: 4 }),
|
|
8252
8301
|
offsetY: -16
|
|
8253
8302
|
}) : void 0
|
|
8254
8303
|
});
|
|
@@ -8472,16 +8521,16 @@ export {
|
|
|
8472
8521
|
kr as fetchXmlData,
|
|
8473
8522
|
lo as forEachLinkedGridLayer,
|
|
8474
8523
|
sr as gaussianBlur2D,
|
|
8475
|
-
|
|
8524
|
+
xe as generateLegend,
|
|
8476
8525
|
Gt as getContourParams,
|
|
8477
8526
|
it as getGrayDataFromImage,
|
|
8478
8527
|
ge as getLayerByClassName,
|
|
8479
8528
|
Yr as getLegendItemsByScope,
|
|
8480
|
-
|
|
8529
|
+
Ct as getLegendValueScope,
|
|
8481
8530
|
ar as getLinkedGridLayer,
|
|
8482
8531
|
ru as getLoadedLayerOptions,
|
|
8483
8532
|
tu as getLoadedLayers,
|
|
8484
|
-
|
|
8533
|
+
Ce as getMapMethodsConfig,
|
|
8485
8534
|
Yn as getMenuList,
|
|
8486
8535
|
jn as getNCXmlData,
|
|
8487
8536
|
Nr as getNodeData,
|