mapicgc-gl-js 1.0.7 → 1.0.8

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.
Files changed (52) hide show
  1. package/README.md +2 -4
  2. package/dist/array-utils-flat-DeB-J5jn.mjs +1523 -0
  3. package/dist/assets/maplibre-gl-worker-HMCkgiD4.js +10 -0
  4. package/dist/buffer-transform-CH0poqqn.mjs +941 -0
  5. package/dist/expression-CtaQKvTZ.mjs +3444 -0
  6. package/dist/get-attribute-from-layouts-DqvACIaG.mjs +936 -0
  7. package/dist/{html2canvas-DhrjCa5K-6_3CwS_m.mjs → html2canvas-Cgp0Hyhk-HIw4n-A9.mjs} +105 -109
  8. package/dist/{index.es-D_FsJY9H-CO3QIBGM.mjs → index.es-lgdlL0gw-Bl7I-U5B.mjs} +176 -176
  9. package/dist/mapicgc-gl-js.css +1 -1
  10. package/dist/mapicgc-gl.css +199 -0
  11. package/dist/mapicgc-gl.js +5079 -856
  12. package/dist/mapicgc-gl.mjs +85573 -61841
  13. package/dist/purify.es-DNpVkA56-DxzGf9c8.mjs +769 -0
  14. package/dist/{chunk-efA98nb6-Dfm7IivL.mjs → rolldown-runtime-3b4jIN3o-CmciV3xi.mjs} +2 -2
  15. package/dist/{typeof-CTd55yxz-BxqQpTq1.mjs → typeof-C3azmBUr-9LkZMuan.mjs} +1 -1
  16. package/dist/webgl-Cep-x0-T.mjs +784 -0
  17. package/package.json +20 -15
  18. package/public/mapicgc-gl.css +199 -0
  19. package/src/controls/ApiTerritorialControl.js +222 -0
  20. package/src/index.js +18 -1
  21. package/src/map/Map.js +245 -144
  22. package/src/mapicgc-config.json +1303 -8
  23. package/src/plugins/CompareMaps.js +2 -1
  24. package/src/territorial/ApiTerritorialControl.js +1 -0
  25. package/src/territorial/mostraPanellInfo.js +250 -0
  26. package/src/territorial/searchApiTerritorialICGC.js +250 -0
  27. package/test/exemples/addApiTerritorialICGC.html +113 -0
  28. package/test/exemples/addBasemap.html +4 -4
  29. package/test/exemples/addCompare.html +7 -6
  30. package/test/exemples/addControl.html +12 -6
  31. package/test/exemples/addFeatureQuery.html +5 -4
  32. package/test/exemples/addGeocoderICGC.html +5 -4
  33. package/test/exemples/addICGCTerrain.html +5 -4
  34. package/test/exemples/addICGCTerrainCustomStyle.html +5 -4
  35. package/test/exemples/addImageLayerICGC.html +5 -4
  36. package/test/exemples/addLayerGeojson.html +5 -4
  37. package/test/exemples/addLayerTree.html +5 -4
  38. package/test/exemples/addLogo.html +5 -3
  39. package/test/exemples/addMapStyle.html +5 -4
  40. package/test/exemples/addMarker.html +5 -4
  41. package/test/exemples/addMouseCoordinateControl.html +5 -4
  42. package/test/exemples/addReliefStyle.html +6 -5
  43. package/test/exemples/addVectorLayerICGC.html +5 -4
  44. package/test/exemples/advancedExemple.html +5 -4
  45. package/test/exemples/fetchData.html +6 -5
  46. package/test/exemples/fetchDataAndMenu.html +5 -4
  47. package/test/exemples/styleOrto3D.html +8 -4
  48. package/test/vitest/ApiTerritorialControl.test.js +76 -0
  49. package/vite.config.mjs +16 -5
  50. package/dist/purify.es-DVGU85zV-CJOZ7ABI.mjs +0 -549
  51. package/dist/webgl-device-B1jTrfKA.mjs +0 -6880
  52. package/dist/webgl-device-D8jkwRzb.mjs +0 -2
@@ -1,6 +1,6 @@
1
- import { n as e, t } from "./chunk-efA98nb6-Dfm7IivL.mjs";
2
- import { t as n } from "./typeof-CTd55yxz-BxqQpTq1.mjs";
3
- //#region node_modules/@watergis/maplibre-gl-export/dist/index.es-D_FsJY9H.js
1
+ import { n as e, t } from "./rolldown-runtime-3b4jIN3o-CmciV3xi.mjs";
2
+ import { t as n } from "./typeof-C3azmBUr-9LkZMuan.mjs";
3
+ //#region node_modules/@watergis/maplibre-gl-export/dist/index.es-lgdlL0gw.js
4
4
  var r = /* @__PURE__ */ e((e, t) => {
5
5
  var n = function(e) {
6
6
  return e && e.Math === Math && e;
@@ -863,7 +863,7 @@ var r = /* @__PURE__ */ e((e, t) => {
863
863
  });
864
864
  }, pe.prototype = c(R, "then", function(e, t) {
865
865
  var r = P(this), i = re(v(this, L));
866
- return r.parent = !0, i.ok = p(e) ? e : !0, i.fail = p(t) && t, i.domain = n ? ne.domain : void 0, r.state === se ? r.reactions.add(i) : b(function() {
866
+ return r.parent = !0, i.ok = !p(e) || e, i.fail = p(t) && t, i.domain = n ? ne.domain : void 0, r.state === se ? r.reactions.add(i) : b(function() {
867
867
  _e(i, r);
868
868
  }), i.promise;
869
869
  }), me = function() {
@@ -1494,16 +1494,18 @@ var bt = /* @__PURE__ */ e((e, t) => {
1494
1494
  }, O = t + " Iterator", k = !1, A = e.prototype, j = A[S] || A["@@iterator"] || m && A[m], M = !x && j || D(m), N = t === "Array" && A.entries || j, P, F, I;
1495
1495
  if (N && (P = l(N.call(new e())), P !== Object.prototype && P.next && (!i && l(P) !== b && (u ? u(P, b) : o(P[S]) || p(P, S, E)), d(P, O, !0, !0), i && (h[O] = E))), v && m === w && j && j.name !== w && (!i && y ? f(A, "name", w) : (k = !0, M = function() {
1496
1496
  return r(j, this);
1497
- })), m) if (F = {
1498
- values: D(w),
1499
- keys: g ? M : D(C),
1500
- entries: D(T)
1501
- }, _) for (I in F) (x || k || !(I in A)) && p(A, I, F[I]);
1502
- else n({
1503
- target: t,
1504
- proto: !0,
1505
- forced: x || k
1506
- }, F);
1497
+ })), m) {
1498
+ if (F = {
1499
+ values: D(w),
1500
+ keys: g ? M : D(C),
1501
+ entries: D(T)
1502
+ }, _) for (I in F) (x || k || !(I in A)) && p(A, I, F[I]);
1503
+ else n({
1504
+ target: t,
1505
+ proto: !0,
1506
+ forced: x || k
1507
+ }, F);
1508
+ }
1507
1509
  return (!i || _) && A[S] !== M && p(A, S, M, { name: m }), h[t] = M, F;
1508
1510
  };
1509
1511
  }), Yt = /* @__PURE__ */ e((e, t) => {
@@ -2177,10 +2179,12 @@ function Pn(e, t, n, r, i) {
2177
2179
  }
2178
2180
  i.type & K.HORIZ_LINE_TO && t !== 0 && (i.type = K.LINE_TO, i.y = i.relative ? 0 : c), i.type & K.VERT_LINE_TO && n !== 0 && (i.type = K.LINE_TO, i.x = i.relative ? 0 : s), i.x !== void 0 && (i.x = i.x * e + m * n + (f ? 0 : a)), i.y !== void 0 && (i.y = p * t + i.y * r + (f ? 0 : o)), i.x1 !== void 0 && (i.x1 = i.x1 * e + i.y1 * n + (f ? 0 : a)), i.y1 !== void 0 && (i.y1 = u * t + i.y1 * r + (f ? 0 : o)), i.x2 !== void 0 && (i.x2 = i.x2 * e + i.y2 * n + (f ? 0 : a)), i.y2 !== void 0 && (i.y2 = d * t + i.y2 * r + (f ? 0 : o));
2179
2181
  var g = e * r - t * n;
2180
- if (i.xRot !== void 0 && (e !== 1 || t !== 0 || n !== 0 || r !== 1)) if (g === 0) delete i.rX, delete i.rY, delete i.xRot, delete i.lArcFlag, delete i.sweepFlag, i.type = K.LINE_TO;
2181
- else {
2182
- var _ = i.xRot * Math.PI / 180, v = Math.sin(_), y = Math.cos(_), b = 1 / h(i.rX), x = 1 / h(i.rY), S = h(y) * b + h(v) * x, C = 2 * v * y * (b - x), w = h(v) * b + h(y) * x, T = S * r * r - C * t * r + w * t * t, E = C * (e * r + t * n) - 2 * (S * n * r + w * e * t), D = S * n * n - C * e * n + w * e * e, O = (Math.atan2(E, T - D) + Math.PI) % Math.PI / 2, k = Math.sin(O), A = Math.cos(O);
2183
- i.rX = Math.abs(g) / Math.sqrt(T * h(A) + E * k * A + D * h(k)), i.rY = Math.abs(g) / Math.sqrt(T * h(k) - E * k * A + D * h(A)), i.xRot = 180 * O / Math.PI;
2182
+ if (i.xRot !== void 0 && (e !== 1 || t !== 0 || n !== 0 || r !== 1)) {
2183
+ if (g === 0) delete i.rX, delete i.rY, delete i.xRot, delete i.lArcFlag, delete i.sweepFlag, i.type = K.LINE_TO;
2184
+ else {
2185
+ var _ = i.xRot * Math.PI / 180, v = Math.sin(_), y = Math.cos(_), b = 1 / h(i.rX), x = 1 / h(i.rY), S = h(y) * b + h(v) * x, C = 2 * v * y * (b - x), w = h(v) * b + h(y) * x, T = S * r * r - C * t * r + w * t * t, E = C * (e * r + t * n) - 2 * (S * n * r + w * e * t), D = S * n * n - C * e * n + w * e * e, O = (Math.atan2(E, T - D) + Math.PI) % Math.PI / 2, k = Math.sin(O), A = Math.cos(O);
2186
+ i.rX = Math.abs(g) / Math.sqrt(T * h(A) + E * k * A + D * h(k)), i.rY = Math.abs(g) / Math.sqrt(T * h(k) - E * k * A + D * h(A)), i.xRot = 180 * O / Math.PI;
2187
+ }
2184
2188
  }
2185
2189
  return i.sweepFlag !== void 0 && 0 > g && (i.sweepFlag = +!i.sweepFlag), i;
2186
2190
  });
@@ -2351,87 +2355,94 @@ var Fn, In = function() {
2351
2355
  t.push(e), n.curArgs.length = 0, n.canParseCommandOrComma = !0;
2352
2356
  }, i = 0; i < e.length; i++) {
2353
2357
  var a = e[i], o = !(this.curCommandType !== K.ARC || this.curArgs.length !== 3 && this.curArgs.length !== 4 || this.curNumber.length !== 1 || this.curNumber !== "0" && this.curNumber !== "1"), s = Rn(a) && (this.curNumber === "0" && a === "0" || o);
2354
- if (!Rn(a) || s) if (a !== "e" && a !== "E") if (a !== "-" && a !== "+" || !this.curNumberHasExp || this.curNumberHasExpDigits) if (a !== "." || this.curNumberHasExp || this.curNumberHasDecimal || o) {
2355
- if (this.curNumber && this.curCommandType !== -1) {
2356
- var c = Number(this.curNumber);
2357
- if (isNaN(c)) throw SyntaxError("Invalid number ending at " + i);
2358
- if (this.curCommandType === K.ARC) {
2359
- if (this.curArgs.length === 0 || this.curArgs.length === 1) {
2360
- if (0 > c) throw SyntaxError("Expected positive number, got \"" + c + "\" at index \"" + i + "\"");
2361
- } else if ((this.curArgs.length === 3 || this.curArgs.length === 4) && this.curNumber !== "0" && this.curNumber !== "1") throw SyntaxError("Expected a flag, got \"" + this.curNumber + "\" at index \"" + i + "\"");
2362
- }
2363
- this.curArgs.push(c), this.curArgs.length === Bn[this.curCommandType] && (K.HORIZ_LINE_TO === this.curCommandType ? r({
2364
- type: K.HORIZ_LINE_TO,
2365
- relative: this.curCommandRelative,
2366
- x: c
2367
- }) : K.VERT_LINE_TO === this.curCommandType ? r({
2368
- type: K.VERT_LINE_TO,
2369
- relative: this.curCommandRelative,
2370
- y: c
2371
- }) : this.curCommandType === K.MOVE_TO || this.curCommandType === K.LINE_TO || this.curCommandType === K.SMOOTH_QUAD_TO ? (r({
2372
- type: this.curCommandType,
2373
- relative: this.curCommandRelative,
2374
- x: this.curArgs[0],
2375
- y: this.curArgs[1]
2376
- }), K.MOVE_TO === this.curCommandType && (this.curCommandType = K.LINE_TO)) : this.curCommandType === K.CURVE_TO ? r({
2377
- type: K.CURVE_TO,
2378
- relative: this.curCommandRelative,
2379
- x1: this.curArgs[0],
2380
- y1: this.curArgs[1],
2381
- x2: this.curArgs[2],
2382
- y2: this.curArgs[3],
2383
- x: this.curArgs[4],
2384
- y: this.curArgs[5]
2385
- }) : this.curCommandType === K.SMOOTH_CURVE_TO ? r({
2386
- type: K.SMOOTH_CURVE_TO,
2387
- relative: this.curCommandRelative,
2388
- x2: this.curArgs[0],
2389
- y2: this.curArgs[1],
2390
- x: this.curArgs[2],
2391
- y: this.curArgs[3]
2392
- }) : this.curCommandType === K.QUAD_TO ? r({
2393
- type: K.QUAD_TO,
2394
- relative: this.curCommandRelative,
2395
- x1: this.curArgs[0],
2396
- y1: this.curArgs[1],
2397
- x: this.curArgs[2],
2398
- y: this.curArgs[3]
2399
- }) : this.curCommandType === K.ARC && r({
2400
- type: K.ARC,
2401
- relative: this.curCommandRelative,
2402
- rX: this.curArgs[0],
2403
- rY: this.curArgs[1],
2404
- xRot: this.curArgs[2],
2405
- lArcFlag: this.curArgs[3],
2406
- sweepFlag: this.curArgs[4],
2407
- x: this.curArgs[5],
2408
- y: this.curArgs[6]
2409
- })), this.curNumber = "", this.curNumberHasExpDigits = !1, this.curNumberHasExp = !1, this.curNumberHasDecimal = !1, this.canParseCommandOrComma = !0;
2410
- }
2411
- if (!Ln(a)) if (a === "," && this.canParseCommandOrComma) this.canParseCommandOrComma = !1;
2412
- else if (a !== "+" && a !== "-" && a !== ".") if (s) this.curNumber = a, this.curNumberHasDecimal = !1;
2413
- else {
2414
- if (this.curArgs.length !== 0) throw SyntaxError("Unterminated command at index " + i + ".");
2415
- if (!this.canParseCommandOrComma) throw SyntaxError("Unexpected character \"" + a + "\" at index " + i + ". Command cannot follow comma");
2416
- if (this.canParseCommandOrComma = !1, a !== "z" && a !== "Z") if (a === "h" || a === "H") this.curCommandType = K.HORIZ_LINE_TO, this.curCommandRelative = a === "h";
2417
- else if (a === "v" || a === "V") this.curCommandType = K.VERT_LINE_TO, this.curCommandRelative = a === "v";
2418
- else if (a === "m" || a === "M") this.curCommandType = K.MOVE_TO, this.curCommandRelative = a === "m";
2419
- else if (a === "l" || a === "L") this.curCommandType = K.LINE_TO, this.curCommandRelative = a === "l";
2420
- else if (a === "c" || a === "C") this.curCommandType = K.CURVE_TO, this.curCommandRelative = a === "c";
2421
- else if (a === "s" || a === "S") this.curCommandType = K.SMOOTH_CURVE_TO, this.curCommandRelative = a === "s";
2422
- else if (a === "q" || a === "Q") this.curCommandType = K.QUAD_TO, this.curCommandRelative = a === "q";
2423
- else if (a === "t" || a === "T") this.curCommandType = K.SMOOTH_QUAD_TO, this.curCommandRelative = a === "t";
2424
- else {
2425
- if (a !== "a" && a !== "A") throw SyntaxError("Unexpected character \"" + a + "\" at index " + i + ".");
2426
- this.curCommandType = K.ARC, this.curCommandRelative = a === "a";
2427
- }
2428
- else t.push({ type: K.CLOSE_PATH }), this.canParseCommandOrComma = !0, this.curCommandType = -1;
2429
- }
2430
- else this.curNumber = a, this.curNumberHasDecimal = a === ".";
2431
- } else this.curNumber += a, this.curNumberHasDecimal = !0;
2432
- else this.curNumber += a;
2433
- else this.curNumber += a, this.curNumberHasExp = !0;
2434
- else this.curNumber += a, this.curNumberHasExpDigits = this.curNumberHasExp;
2358
+ if (!Rn(a) || s) {
2359
+ if (a !== "e" && a !== "E") {
2360
+ if (a !== "-" && a !== "+" || !this.curNumberHasExp || this.curNumberHasExpDigits) {
2361
+ if (a !== "." || this.curNumberHasExp || this.curNumberHasDecimal || o) {
2362
+ if (this.curNumber && this.curCommandType !== -1) {
2363
+ var c = Number(this.curNumber);
2364
+ if (isNaN(c)) throw SyntaxError("Invalid number ending at " + i);
2365
+ if (this.curCommandType === K.ARC) {
2366
+ if (this.curArgs.length === 0 || this.curArgs.length === 1) {
2367
+ if (0 > c) throw SyntaxError("Expected positive number, got \"" + c + "\" at index \"" + i + "\"");
2368
+ } else if ((this.curArgs.length === 3 || this.curArgs.length === 4) && this.curNumber !== "0" && this.curNumber !== "1") throw SyntaxError("Expected a flag, got \"" + this.curNumber + "\" at index \"" + i + "\"");
2369
+ }
2370
+ this.curArgs.push(c), this.curArgs.length === Bn[this.curCommandType] && (K.HORIZ_LINE_TO === this.curCommandType ? r({
2371
+ type: K.HORIZ_LINE_TO,
2372
+ relative: this.curCommandRelative,
2373
+ x: c
2374
+ }) : K.VERT_LINE_TO === this.curCommandType ? r({
2375
+ type: K.VERT_LINE_TO,
2376
+ relative: this.curCommandRelative,
2377
+ y: c
2378
+ }) : this.curCommandType === K.MOVE_TO || this.curCommandType === K.LINE_TO || this.curCommandType === K.SMOOTH_QUAD_TO ? (r({
2379
+ type: this.curCommandType,
2380
+ relative: this.curCommandRelative,
2381
+ x: this.curArgs[0],
2382
+ y: this.curArgs[1]
2383
+ }), K.MOVE_TO === this.curCommandType && (this.curCommandType = K.LINE_TO)) : this.curCommandType === K.CURVE_TO ? r({
2384
+ type: K.CURVE_TO,
2385
+ relative: this.curCommandRelative,
2386
+ x1: this.curArgs[0],
2387
+ y1: this.curArgs[1],
2388
+ x2: this.curArgs[2],
2389
+ y2: this.curArgs[3],
2390
+ x: this.curArgs[4],
2391
+ y: this.curArgs[5]
2392
+ }) : this.curCommandType === K.SMOOTH_CURVE_TO ? r({
2393
+ type: K.SMOOTH_CURVE_TO,
2394
+ relative: this.curCommandRelative,
2395
+ x2: this.curArgs[0],
2396
+ y2: this.curArgs[1],
2397
+ x: this.curArgs[2],
2398
+ y: this.curArgs[3]
2399
+ }) : this.curCommandType === K.QUAD_TO ? r({
2400
+ type: K.QUAD_TO,
2401
+ relative: this.curCommandRelative,
2402
+ x1: this.curArgs[0],
2403
+ y1: this.curArgs[1],
2404
+ x: this.curArgs[2],
2405
+ y: this.curArgs[3]
2406
+ }) : this.curCommandType === K.ARC && r({
2407
+ type: K.ARC,
2408
+ relative: this.curCommandRelative,
2409
+ rX: this.curArgs[0],
2410
+ rY: this.curArgs[1],
2411
+ xRot: this.curArgs[2],
2412
+ lArcFlag: this.curArgs[3],
2413
+ sweepFlag: this.curArgs[4],
2414
+ x: this.curArgs[5],
2415
+ y: this.curArgs[6]
2416
+ })), this.curNumber = "", this.curNumberHasExpDigits = !1, this.curNumberHasExp = !1, this.curNumberHasDecimal = !1, this.canParseCommandOrComma = !0;
2417
+ }
2418
+ if (!Ln(a)) {
2419
+ if (a === "," && this.canParseCommandOrComma) this.canParseCommandOrComma = !1;
2420
+ else if (a !== "+" && a !== "-" && a !== ".") {
2421
+ if (s) this.curNumber = a, this.curNumberHasDecimal = !1;
2422
+ else {
2423
+ if (this.curArgs.length !== 0) throw SyntaxError("Unterminated command at index " + i + ".");
2424
+ if (!this.canParseCommandOrComma) throw SyntaxError("Unexpected character \"" + a + "\" at index " + i + ". Command cannot follow comma");
2425
+ if (this.canParseCommandOrComma = !1, a !== "z" && a !== "Z") {
2426
+ if (a === "h" || a === "H") this.curCommandType = K.HORIZ_LINE_TO, this.curCommandRelative = a === "h";
2427
+ else if (a === "v" || a === "V") this.curCommandType = K.VERT_LINE_TO, this.curCommandRelative = a === "v";
2428
+ else if (a === "m" || a === "M") this.curCommandType = K.MOVE_TO, this.curCommandRelative = a === "m";
2429
+ else if (a === "l" || a === "L") this.curCommandType = K.LINE_TO, this.curCommandRelative = a === "l";
2430
+ else if (a === "c" || a === "C") this.curCommandType = K.CURVE_TO, this.curCommandRelative = a === "c";
2431
+ else if (a === "s" || a === "S") this.curCommandType = K.SMOOTH_CURVE_TO, this.curCommandRelative = a === "s";
2432
+ else if (a === "q" || a === "Q") this.curCommandType = K.QUAD_TO, this.curCommandRelative = a === "q";
2433
+ else if (a === "t" || a === "T") this.curCommandType = K.SMOOTH_QUAD_TO, this.curCommandRelative = a === "t";
2434
+ else {
2435
+ if (a !== "a" && a !== "A") throw SyntaxError("Unexpected character \"" + a + "\" at index " + i + ".");
2436
+ this.curCommandType = K.ARC, this.curCommandRelative = a === "a";
2437
+ }
2438
+ } else t.push({ type: K.CLOSE_PATH }), this.canParseCommandOrComma = !0, this.curCommandType = -1;
2439
+ }
2440
+ } else this.curNumber = a, this.curNumberHasDecimal = a === ".";
2441
+ }
2442
+ } else this.curNumber += a, this.curNumberHasDecimal = !0;
2443
+ } else this.curNumber += a;
2444
+ } else this.curNumber += a, this.curNumberHasExp = !0;
2445
+ } else this.curNumber += a, this.curNumberHasExpDigits = this.curNumberHasExp;
2435
2446
  }
2436
2447
  return t;
2437
2448
  }, t.prototype.transform = function(e) {
@@ -3095,7 +3106,7 @@ function Xn(e) {
3095
3106
  createImage: n.loadImage
3096
3107
  };
3097
3108
  }
3098
- var Zn = /* @__PURE__ */ Object.freeze({
3109
+ var Zn = /*#__PURE__*/ Object.freeze({
3099
3110
  __proto__: null,
3100
3111
  offscreen: Yn,
3101
3112
  node: Xn
@@ -3231,7 +3242,7 @@ var J = class e {
3231
3242
  return this.getString().replace(/[0-9.-]/g, "");
3232
3243
  }
3233
3244
  getPixels(e) {
3234
- var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
3245
+ var t = arguments.length > 1 && arguments[1] !== void 0 && arguments[1];
3235
3246
  if (!this.hasValue()) return 0;
3236
3247
  var [n, r] = typeof e == "boolean" ? [void 0, e] : [e], { viewPort: i } = this.document.screen;
3237
3248
  switch (!0) {
@@ -3392,7 +3403,7 @@ var Tr = class {
3392
3403
  }
3393
3404
  }
3394
3405
  checkPath(e, t) {
3395
- if (!(!this.working || !t)) {
3406
+ if (this.working && t) {
3396
3407
  var { events: n, eventElements: r } = this;
3397
3408
  n.forEach((n, i) => {
3398
3409
  var { x: a, y: o } = n;
@@ -3401,7 +3412,7 @@ var Tr = class {
3401
3412
  }
3402
3413
  }
3403
3414
  checkBoundingBox(e, t) {
3404
- if (!(!this.working || !t)) {
3415
+ if (this.working && t) {
3405
3416
  var { events: n, eventElements: r } = this;
3406
3417
  n.forEach((n, i) => {
3407
3418
  var { x: a, y: o } = n;
@@ -3473,9 +3484,7 @@ var Tr = class {
3473
3484
  case v === "meet":
3474
3485
  n.scale(x, x);
3475
3486
  break;
3476
- case v === "slice":
3477
- n.scale(S, S);
3478
- break;
3487
+ case v === "slice": n.scale(S, S);
3479
3488
  }
3480
3489
  n.translate(-c, -l);
3481
3490
  }
@@ -3724,8 +3733,8 @@ Hr.transformTypes = {
3724
3733
  };
3725
3734
  var X = class e {
3726
3735
  constructor(e, t) {
3727
- var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1;
3728
- if (this.document = e, this.node = t, this.captureTextNodes = n, this.attributes = Object.create(null), this.styles = Object.create(null), this.stylesSpecificity = Object.create(null), this.animationFrozen = !1, this.animationFrozenValue = "", this.parent = null, this.children = [], !(!t || t.nodeType !== 1)) {
3736
+ var n = arguments.length > 2 && arguments[2] !== void 0 && arguments[2];
3737
+ if (this.document = e, this.node = t, this.captureTextNodes = n, this.attributes = Object.create(null), this.styles = Object.create(null), this.stylesSpecificity = Object.create(null), this.animationFrozen = !1, this.animationFrozenValue = "", this.parent = null, this.children = [], t && t.nodeType === 1) {
3729
3738
  Array.from(t.attributes).forEach((t) => {
3730
3739
  var n = nr(t.nodeName);
3731
3740
  this.attributes[n] = new J(e, n, t.value);
@@ -3746,7 +3755,7 @@ var X = class e {
3746
3755
  }
3747
3756
  }
3748
3757
  getAttribute(e) {
3749
- var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, n = this.attributes[e];
3758
+ var t = arguments.length > 1 && arguments[1] !== void 0 && arguments[1], n = this.attributes[e];
3750
3759
  if (!n && t) {
3751
3760
  var r = new J(this.document, e, "");
3752
3761
  return this.attributes[e] = r, r;
@@ -3758,7 +3767,7 @@ var X = class e {
3758
3767
  return J.empty(this.document);
3759
3768
  }
3760
3769
  getStyle(e) {
3761
- var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1, r = this.styles[e];
3770
+ var t = arguments.length > 1 && arguments[1] !== void 0 && arguments[1], n = arguments.length > 2 && arguments[2] !== void 0 && arguments[2], r = this.styles[e];
3762
3771
  if (r) return r;
3763
3772
  var i = this.getAttribute(e);
3764
3773
  if (i != null && i.hasValue()) return this.styles[e] = i, i;
@@ -3776,7 +3785,7 @@ var X = class e {
3776
3785
  return r || J.empty(this.document);
3777
3786
  }
3778
3787
  render(e) {
3779
- if (!(this.getStyle("display").getString() === "none" || this.getStyle("visibility").getString() === "hidden")) {
3788
+ if (this.getStyle("display").getString() !== "none" && this.getStyle("visibility").getString() !== "hidden") {
3780
3789
  if (e.save(), this.getStyle("mask").hasValue()) {
3781
3790
  var t = this.getStyle("mask").getDefinition();
3782
3791
  t && (this.applyEffects(e), t.apply(e, this));
@@ -4055,7 +4064,7 @@ var Yr = class {
4055
4064
  return e;
4056
4065
  }
4057
4066
  setContext(e) {
4058
- var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
4067
+ var t = arguments.length > 1 && arguments[1] !== void 0 && arguments[1];
4059
4068
  if (!t) {
4060
4069
  var n = this.getStyle("fill"), r = this.getStyle("fill-opacity"), i = this.getStyle("stroke"), a = this.getStyle("stroke-opacity");
4061
4070
  if (n.isUrlDefinition()) {
@@ -4080,7 +4089,7 @@ var Yr = class {
4080
4089
  var d = this.getStyle("stroke-linecap"), f = this.getStyle("stroke-linejoin"), p = this.getStyle("stroke-miterlimit"), m = this.getStyle("stroke-dasharray"), h = this.getStyle("stroke-dashoffset");
4081
4090
  if (d.hasValue() && (e.lineCap = d.getString()), f.hasValue() && (e.lineJoin = f.getString()), p.hasValue() && (e.miterLimit = p.getNumber()), m.hasValue() && m.getString() !== "none") {
4082
4091
  var g = q(m.getString());
4083
- e.setLineDash === void 0 ? e.webkitLineDash === void 0 ? e.mozDash !== void 0 && !(g.length === 1 && g[0] === 0) && (e.mozDash = g) : e.webkitLineDash = g : e.setLineDash(g);
4092
+ e.setLineDash === void 0 ? e.webkitLineDash === void 0 ? e.mozDash !== void 0 && (g.length !== 1 || g[0] !== 0) && (e.mozDash = g) : e.webkitLineDash = g : e.setLineDash(g);
4084
4093
  var _ = h.getPixels();
4085
4094
  e.lineDashOffset === void 0 ? e.webkitLineDashOffset === void 0 ? e.mozDashOffset !== void 0 && (e.mozDashOffset = _) : e.webkitLineDashOffset = _ : e.lineDashOffset = _;
4086
4095
  }
@@ -4128,9 +4137,7 @@ var Yr = class {
4128
4137
  case Z.ARC:
4129
4138
  this.pathA(e, n);
4130
4139
  break;
4131
- case Z.CLOSE_PATH:
4132
- this.pathZ(e, n);
4133
- break;
4140
+ case Z.CLOSE_PATH: this.pathZ(e, n);
4134
4141
  }
4135
4142
  return n;
4136
4143
  }
@@ -4289,10 +4296,10 @@ var Yr = class {
4289
4296
  }
4290
4297
  }, Qr = class e extends Xr {
4291
4298
  constructor(t, n, r) {
4292
- super(t, n, new.target === e ? !0 : r), this.type = "text", this.x = 0, this.y = 0, this.measureCache = -1;
4299
+ super(t, n, new.target === e || r), this.type = "text", this.x = 0, this.y = 0, this.measureCache = -1;
4293
4300
  }
4294
4301
  setContext(e) {
4295
- var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
4302
+ var t = arguments.length > 1 && arguments[1] !== void 0 && arguments[1];
4296
4303
  super.setContext(e, t);
4297
4304
  var n = this.getStyle("dominant-baseline").getTextBaseline() || this.getStyle("alignment-baseline").getTextBaseline();
4298
4305
  n && (e.textBaseline = n);
@@ -4362,9 +4369,9 @@ var Yr = class {
4362
4369
  }
4363
4370
  applyAnchoring() {
4364
4371
  if (!(this.textChunkStart >= this.leafTexts.length)) {
4365
- var e = this.leafTexts[this.textChunkStart], t = e.getStyle("text-anchor").getString("start"), n = !1, r = 0;
4366
- r = t === "start" && !n || t === "end" && n ? e.x - this.minX : t === "end" && !n || t === "start" && n ? e.x - this.maxX : e.x - (this.minX + this.maxX) / 2;
4367
- for (var i = this.textChunkStart; i < this.leafTexts.length; i++) this.leafTexts[i].x += r;
4372
+ var e = this.leafTexts[this.textChunkStart], t = e.getStyle("text-anchor").getString("start"), n = 0;
4373
+ n = t === "start" ? e.x - this.minX : t === "end" ? e.x - this.maxX : e.x - (this.minX + this.maxX) / 2;
4374
+ for (var r = this.textChunkStart; r < this.leafTexts.length; r++) this.leafTexts[r].x += n;
4368
4375
  this.minX = Infinity, this.maxX = -Infinity, this.textChunkStart = this.leafTexts.length;
4369
4376
  }
4370
4377
  }
@@ -4434,7 +4441,7 @@ var Yr = class {
4434
4441
  }
4435
4442
  }, $r = class e extends Qr {
4436
4443
  constructor(t, n, r) {
4437
- super(t, n, new.target === e ? !0 : r), this.type = "tspan", this.text = this.children.length > 0 ? "" : this.getTextFromNode();
4444
+ super(t, n, new.target === e || r), this.type = "tspan", this.text = this.children.length > 0 ? "" : this.getTextFromNode();
4438
4445
  }
4439
4446
  getText() {
4440
4447
  return this.text;
@@ -4478,11 +4485,13 @@ var Yr = class {
4478
4485
  super.clearContext(e), this.document.screen.viewPort.removeCurrent();
4479
4486
  }
4480
4487
  resize(e) {
4481
- var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : e, n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1, r = this.getAttribute("width", !0), i = this.getAttribute("height", !0), a = this.getAttribute("viewBox"), o = this.getAttribute("style"), s = r.getNumber(0), c = i.getNumber(0);
4482
- if (n) if (typeof n == "string") this.getAttribute("preserveAspectRatio", !0).setValue(n);
4483
- else {
4484
- var l = this.getAttribute("preserveAspectRatio");
4485
- l.hasValue() && l.setValue(l.getString().replace(/^\s*(\S.*\S)\s*$/, "$1"));
4488
+ var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : e, n = arguments.length > 2 && arguments[2] !== void 0 && arguments[2], r = this.getAttribute("width", !0), i = this.getAttribute("height", !0), a = this.getAttribute("viewBox"), o = this.getAttribute("style"), s = r.getNumber(0), c = i.getNumber(0);
4489
+ if (n) {
4490
+ if (typeof n == "string") this.getAttribute("preserveAspectRatio", !0).setValue(n);
4491
+ else {
4492
+ var l = this.getAttribute("preserveAspectRatio");
4493
+ l.hasValue() && l.setValue(l.getString().replace(/^\s*(\S.*\S)\s*$/, "$1"));
4494
+ }
4486
4495
  }
4487
4496
  if (r.setValue(e), i.setValue(t), a.hasValue() || a.setValue(`0 0 ${s || e} ${c || t}`), o.hasValue()) {
4488
4497
  var u = this.getStyle("width"), d = this.getStyle("height");
@@ -4748,7 +4757,6 @@ var Yr = class {
4748
4757
  case "glyph":
4749
4758
  var s = a;
4750
4759
  s.arabicForm ? (this.isRTL = !0, this.isArabic = !0, this.glyphs[s.unicode] === void 0 && (this.glyphs[s.unicode] = Object.create(null)), this.glyphs[s.unicode][s.arabicForm] = s) : this.glyphs[s.unicode] = s;
4751
- break;
4752
4760
  }
4753
4761
  }
4754
4762
  render() {}
@@ -4823,7 +4831,7 @@ function Ti(e) {
4823
4831
  }
4824
4832
  var Ei = class extends Qr {
4825
4833
  constructor(e, t, n) {
4826
- super(e, t, n), this.type = "textPath", this.textWidth = 0, this.textHeight = 0, this.pathLength = -1, this.glyphInfo = null, this.letterSpacingCache = [], this.measuresCache = new Map([["", 0]]);
4834
+ super(e, t, n), this.type = "textPath", this.textWidth = 0, this.textHeight = 0, this.pathLength = -1, this.glyphInfo = null, this.letterSpacingCache = [], this.measuresCache = /* @__PURE__ */ new Map([["", 0]]);
4827
4835
  var r = this.getHrefAttribute().getDefinition();
4828
4836
  this.text = this.getTextFromNode(), this.dataArray = this.parsePathData(r);
4829
4837
  }
@@ -4851,9 +4859,7 @@ var Ei = class extends Qr {
4851
4859
  var [i, a, o, s, c, l, u, d] = r, f = o > s ? o : s, p = o > s ? 1 : o / s, m = o > s ? s / o : 1;
4852
4860
  e && (e.translate(i, a), e.rotate(u), e.scale(p, m), e.arc(0, 0, f, c, c + l, !!(1 - d)), e.scale(1 / p, 1 / m), e.rotate(-u), e.translate(-i, -a));
4853
4861
  break;
4854
- case Z.CLOSE_PATH:
4855
- e && e.closePath();
4856
- break;
4862
+ case Z.CLOSE_PATH: e && e.closePath();
4857
4863
  }
4858
4864
  });
4859
4865
  }
@@ -4910,7 +4916,7 @@ var Ei = class extends Qr {
4910
4916
  var g = this.getPathLength(), _ = this.getStyle("startOffset").getNumber(0) * g, v = 0;
4911
4917
  (o === "middle" || o === "center") && (v = -h / 2), (o === "end" || o === "right") && (v = -h), v += _, n.forEach((t, i) => {
4912
4918
  var { offset: s, segment: c, rotation: l } = this.findSegmentToFitChar(e, o, h, g, r, v, a, t, i);
4913
- v = s, !(!c.p0 || !c.p1) && this.glyphInfo.push({
4919
+ v = s, c.p0 && c.p1 && this.glyphInfo.push({
4914
4920
  text: n[i],
4915
4921
  p0: c.p0,
4916
4922
  p1: c.p1,
@@ -4952,9 +4958,7 @@ var Ei = class extends Qr {
4952
4958
  case Z.ARC:
4953
4959
  c = this.pathA(n);
4954
4960
  break;
4955
- case Z.CLOSE_PATH:
4956
- Q.pathZ(n);
4957
- break;
4961
+ case Z.CLOSE_PATH: Q.pathZ(n);
4958
4962
  }
4959
4963
  o.type === Z.CLOSE_PATH ? t.push({
4960
4964
  type: Z.CLOSE_PATH,
@@ -5083,9 +5087,7 @@ var Ei = class extends Qr {
5083
5087
  case Z.CURVE_TO:
5084
5088
  s = o / a.pathLength, s > 1 && (s = 1), r = this.getPointOnCubicBezier(s, a.start.x, a.start.y, a.points[0], a.points[1], a.points[2], a.points[3], a.points[4], a.points[5]);
5085
5089
  break;
5086
- case Z.QUAD_TO:
5087
- s = o / a.pathLength, s > 1 && (s = 1), r = this.getPointOnQuadraticBezier(s, a.start.x, a.start.y, a.points[0], a.points[1], a.points[2], a.points[3]);
5088
- break;
5090
+ case Z.QUAD_TO: s = o / a.pathLength, s > 1 && (s = 1), r = this.getPointOnQuadraticBezier(s, a.start.x, a.start.y, a.points[0], a.points[1], a.points[2], a.points[3]);
5089
5091
  }
5090
5092
  if (r) return r;
5091
5093
  break;
@@ -5169,7 +5171,7 @@ var Ei = class extends Qr {
5169
5171
  var n = Di.exec(e);
5170
5172
  if (n) {
5171
5173
  var r = n[5];
5172
- n[4] === "base64" ? t.image = atob(r) : t.image = decodeURIComponent(r);
5174
+ t.image = n[4] === "base64" ? atob(r) : decodeURIComponent(r);
5173
5175
  } else try {
5174
5176
  t.image = yield (yield t.document.fetch(e)).text();
5175
5177
  } catch (t) {
@@ -5180,7 +5182,7 @@ var Ei = class extends Qr {
5180
5182
  }
5181
5183
  renderChildren(e) {
5182
5184
  var { document: t, image: n, loaded: r } = this, i = this.getAttribute("x").getPixels("x"), a = this.getAttribute("y").getPixels("y"), o = this.getStyle("width").getPixels("x"), s = this.getStyle("height").getPixels("y");
5183
- if (!(!r || !n || !o || !s)) {
5185
+ if (r && n && o && s) {
5184
5186
  if (e.save(), e.translate(i, a), this.isSvg) {
5185
5187
  var c = t.canvg.forkString(e, this.image, {
5186
5188
  ignoreMouse: !0,
@@ -5378,35 +5380,33 @@ var Ii = class extends X {
5378
5380
  1
5379
5381
  ];
5380
5382
  break;
5381
- case "luminanceToAlpha":
5382
- r = [
5383
- 0,
5384
- 0,
5385
- 0,
5386
- 0,
5387
- 0,
5388
- 0,
5389
- 0,
5390
- 0,
5391
- 0,
5392
- 0,
5393
- 0,
5394
- 0,
5395
- 0,
5396
- 0,
5397
- 0,
5398
- .2125,
5399
- .7154,
5400
- .0721,
5401
- 0,
5402
- 0,
5403
- 0,
5404
- 0,
5405
- 0,
5406
- 0,
5407
- 1
5408
- ];
5409
- break;
5383
+ case "luminanceToAlpha": r = [
5384
+ 0,
5385
+ 0,
5386
+ 0,
5387
+ 0,
5388
+ 0,
5389
+ 0,
5390
+ 0,
5391
+ 0,
5392
+ 0,
5393
+ 0,
5394
+ 0,
5395
+ 0,
5396
+ 0,
5397
+ 0,
5398
+ 0,
5399
+ .2125,
5400
+ .7154,
5401
+ .0721,
5402
+ 0,
5403
+ 0,
5404
+ 0,
5405
+ 0,
5406
+ 0,
5407
+ 0,
5408
+ 1
5409
+ ];
5410
5410
  }
5411
5411
  this.matrix = r, this.includeOpacity = this.getAttribute("includeOpacity").hasValue();
5412
5412
  }
@@ -5597,7 +5597,7 @@ function Zi(e) {
5597
5597
  }
5598
5598
  function Qi() {
5599
5599
  return Qi = yt(function* (e) {
5600
- var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, n = document.createElement("img");
5600
+ var t = arguments.length > 1 && arguments[1] !== void 0 && arguments[1], n = document.createElement("img");
5601
5601
  return t && (n.crossOrigin = "Anonymous"), new Promise((t, r) => {
5602
5602
  n.onload = () => {
5603
5603
  t(n);
@@ -5692,13 +5692,13 @@ var na = class e {
5692
5692
  static from(t, n) {
5693
5693
  var r = arguments;
5694
5694
  return yt(function* () {
5695
- var i = r.length > 2 && r[2] !== void 0 ? r[2] : {};
5696
- return new e(t, yield new Mr(i).parse(n), i);
5695
+ var i = r.length > 2 && r[2] !== void 0 ? r[2] : {}, a = yield new Mr(i).parse(n);
5696
+ return new e(t, a, i);
5697
5697
  })();
5698
5698
  }
5699
5699
  static fromString(t, n) {
5700
- var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
5701
- return new e(t, new Mr(r).parseFromString(n), r);
5700
+ var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, i = new Mr(r).parseFromString(n);
5701
+ return new e(t, i, r);
5702
5702
  }
5703
5703
  fork(t, n) {
5704
5704
  var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
@@ -5733,7 +5733,7 @@ var na = class e {
5733
5733
  this.screen.stop();
5734
5734
  }
5735
5735
  resize(e) {
5736
- var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : e, n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1;
5736
+ var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : e, n = arguments.length > 2 && arguments[2] !== void 0 && arguments[2];
5737
5737
  this.documentElement.resize(e, t, n);
5738
5738
  }
5739
5739
  };