chunk-DO6JJUZG.js 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. import {
  2. Y
  3. } from "./chunk-54X4RLMR.js";
  4. import {
  5. f as f2
  6. } from "./chunk-ZIWBDWEW.js";
  7. import {
  8. E,
  9. S
  10. } from "./chunk-23ONSYIH.js";
  11. import {
  12. a,
  13. c
  14. } from "./chunk-ILP23N26.js";
  15. import {
  16. U,
  17. c as c2,
  18. d,
  19. j as j2,
  20. p
  21. } from "./chunk-UPD4MTCL.js";
  22. import {
  23. i
  24. } from "./chunk-65BYCSII.js";
  25. import {
  26. B
  27. } from "./chunk-4NKD334K.js";
  28. import {
  29. j
  30. } from "./chunk-VBRY5KJM.js";
  31. import {
  32. f
  33. } from "./chunk-ULGDPLM2.js";
  34. import {
  35. s3 as s
  36. } from "./chunk-EMJ4ZSM2.js";
  37. import {
  38. r
  39. } from "./chunk-GZT4BVFP.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 c3 = { minScale: l3?.minScale, maxScale: l3?.maxScale }, m = i2(c3);
  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 = t.type === "line" && t.isOutline, t.materialKey = f2(e2, o), t.maxVVSize = r2, t.scaleInfo = c3, 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 i2(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 && t.styleName === "Esri2DPointSymbolsStyle")
  70. return p2(t, o);
  71. try {
  72. return b(await c2(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 = U.replace(/\{SymbolName\}/gi, t.name);
  79. try {
  80. const t2 = await j2(e, r2);
  81. return p(t2.data);
  82. } catch (o) {
  83. return f(o), null;
  84. }
  85. }
  86. async function b(a2, i4, u2, p3) {
  87. const b2 = a2.data, d2 = { portal: u2 && r(u2.portal) ? u2.portal : B.getDefault(), url: j(a2.baseUrl), origin: "portal-item" }, j3 = b2.items.find((t) => t.name === i4);
  88. if (!j3) {
  89. throw new s("symbolstyleutils:symbol-name-not-found", `The symbol name '${i4}' could not be found`, { symbolName: i4 });
  90. }
  91. let h = i(d(j3, "cimRef"), d2);
  92. c() && (h = a(h));
  93. try {
  94. const t = await j2(h, p3);
  95. return p(t.data);
  96. } catch (w) {
  97. return f(w), null;
  98. }
  99. }
  100. // node_modules/@arcgis/core/views/2d/layers/support/cimSymbolUtils.js
  101. var l2 = async (a2, r2, l3) => new l(await Y(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 (e.type === "cim")
  106. return l2(e, t, r2);
  107. if (e.type === "web-style") {
  108. const i4 = { type: "cim", data: await u(e, null, n2), rendererKey: e.rendererKey, maxVVSize: e.maxVVSize };
  109. return l2(i4, t, r2);
  110. }
  111. return e;
  112. };
  113. function i3(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. i3 as i
  132. };
  133. //# sourceMappingURL=chunk-DO6JJUZG.js.map