chunk-6LE4RPMZ.js 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. import {
  2. T
  3. } from "./chunk-67RFR4NT.js";
  4. import {
  5. a,
  6. c as c2
  7. } from "./chunk-4HL6BBWO.js";
  8. import {
  9. f as f2
  10. } from "./chunk-3WXSWAUV.js";
  11. import {
  12. E,
  13. S
  14. } from "./chunk-EQNT4A7P.js";
  15. import {
  16. b,
  17. c as c3,
  18. d,
  19. p,
  20. w
  21. } from "./chunk-HKJ7X3BD.js";
  22. import {
  23. c
  24. } from "./chunk-4ONPMX2F.js";
  25. import {
  26. j as j2
  27. } from "./chunk-LU5IJZB4.js";
  28. import {
  29. j
  30. } from "./chunk-VEGAOVMY.js";
  31. import {
  32. f
  33. } from "./chunk-V6P2MAQQ.js";
  34. import {
  35. s3 as s
  36. } from "./chunk-E5O6P5I2.js";
  37. import {
  38. r
  39. } from "./chunk-YXWMMD76.js";
  40. // node_modules/@arcgis/core/symbols/cim/ExpandedCIM.js
  41. var s2 = { marker: E.MARKER, fill: E.FILL, line: E.LINE, text: E.TEXT };
  42. var l = class {
  43. constructor(e, l3, n2, r2) {
  44. const c4 = { minScale: l3 == null ? void 0 : l3.minScale, maxScale: l3 == null ? void 0 : l3.maxScale }, m = i(c4);
  45. this.layers = e, this.data = l3, this.hash = this._createHash() + m, this.rendererKey = n2;
  46. const o = { isOutline: false, placement: null, symbologyType: S.DEFAULT, vvFlags: n2 };
  47. for (const t of e) {
  48. const e2 = s2[t.type];
  49. o.isOutline = "line" === t.type && t.isOutline, t.materialKey = f2(e2, o), t.maxVVSize = r2, t.scaleInfo = c4, t.templateHash += m;
  50. }
  51. }
  52. get type() {
  53. return "expanded-cim";
  54. }
  55. _createHash() {
  56. let e = "";
  57. for (const t of this.layers)
  58. e += t.templateHash;
  59. return e;
  60. }
  61. };
  62. function i(e) {
  63. return e.minScale || e.maxScale ? e.minScale + "-" + e.maxScale : "";
  64. }
  65. // node_modules/@arcgis/core/views/2d/layers/support/webStyleUtils.js
  66. async function u(t, r2, o) {
  67. if (!t.name)
  68. throw new s("style-symbol-reference-name-missing", "Missing name in style symbol reference");
  69. if (t.styleName && "Esri2DPointSymbolsStyle" === t.styleName)
  70. return p2(t, o);
  71. try {
  72. return b2(await c3(t, r2, o), t.name, r2, o);
  73. } catch (s3) {
  74. return f(s3), null;
  75. }
  76. }
  77. async function p2(t, r2) {
  78. const e = w.replace(/\{SymbolName\}/gi, t.name);
  79. try {
  80. const t2 = await b(e, r2);
  81. return p(t2.data);
  82. } catch (o) {
  83. return f(o), null;
  84. }
  85. }
  86. async function b2(a2, i3, u2, p3) {
  87. const b3 = a2.data, d2 = { portal: u2 && r(u2.portal) ? u2.portal : j2.getDefault(), url: j(a2.baseUrl), origin: "portal-item" }, j3 = b3.items.find((t) => t.name === i3);
  88. if (!j3) {
  89. throw new s("symbolstyleutils:symbol-name-not-found", `The symbol name '${i3}' could not be found`, { symbolName: i3 });
  90. }
  91. let h = c(d(j3, "cimRef"), d2);
  92. c2() && (h = a(h));
  93. try {
  94. const t = await b(h, p3);
  95. return p(t.data);
  96. } catch (w2) {
  97. return f(w2), null;
  98. }
  99. }
  100. // node_modules/@arcgis/core/views/2d/layers/support/cimSymbolUtils.js
  101. var l2 = async (a2, r2, l3) => new l(await T(a2.data, r2, l3), a2.data, a2.rendererKey, a2.maxVVSize);
  102. var n = async (e, t, r2, n2) => {
  103. if (!e)
  104. return null;
  105. if ("cim" === e.type)
  106. return l2(e, t, r2);
  107. if ("web-style" === e.type) {
  108. const i3 = { type: "cim", data: await u(e, null, n2), rendererKey: e.rendererKey, maxVVSize: e.maxVVSize };
  109. return l2(i3, t, r2);
  110. }
  111. return e;
  112. };
  113. function i2(e) {
  114. if (!e)
  115. return null;
  116. const { type: t, cim: a2, url: r2, materialHash: l3 } = e, n2 = { cim: a2, type: t, mosaicHash: l3, url: r2, size: null, dashTemplate: null, path: null, text: null, fontName: null, animatedSymbolProperties: null };
  117. switch (t) {
  118. case "marker":
  119. n2.size = e.size, n2.path = e.path, n2.animatedSymbolProperties = e.animatedSymbolProperties;
  120. break;
  121. case "line":
  122. n2.dashTemplate = e.dashTemplate;
  123. break;
  124. case "text":
  125. n2.text = e.text, n2.fontName = e.fontName;
  126. }
  127. return n2;
  128. }
  129. export {
  130. n,
  131. i2 as i
  132. };
  133. //# sourceMappingURL=chunk-6LE4RPMZ.js.map