chunk-LHFSJ6EZ.js 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. import {
  2. a,
  3. c
  4. } from "./chunk-ILP23N26.js";
  5. import {
  6. p as p2
  7. } from "./chunk-27P5ZSC7.js";
  8. import {
  9. U,
  10. c as c2,
  11. d,
  12. j as j2,
  13. p as p3
  14. } from "./chunk-UPD4MTCL.js";
  15. import {
  16. c as c3,
  17. l2 as l,
  18. p2 as p
  19. } from "./chunk-EN7YGJWG.js";
  20. import {
  21. i
  22. } from "./chunk-65BYCSII.js";
  23. import {
  24. B
  25. } from "./chunk-4NKD334K.js";
  26. import {
  27. Ot,
  28. j
  29. } from "./chunk-VBRY5KJM.js";
  30. import {
  31. s3 as s
  32. } from "./chunk-EMJ4ZSM2.js";
  33. import {
  34. r
  35. } from "./chunk-GZT4BVFP.js";
  36. // node_modules/@arcgis/core/symbols/support/webStyleSymbolUtils.js
  37. function j3(t, e, r2, l2) {
  38. return t.name ? t.styleName && t.styleName === "Esri2DPointSymbolsStyle" ? d2(t, e, l2) : c2(t, e, l2).then((o) => h(o, t.name, e, r2, l2)) : Promise.reject(new s("symbolstyleutils:style-symbol-reference-name-missing", "Missing name in style symbol reference"));
  39. }
  40. function h(f, b, j4, h2, d3) {
  41. const U2 = f.data, N = j4 && r(j4.portal) ? j4.portal : B.getDefault(), w = { portal: N, url: j(f.baseUrl), origin: "portal-item" }, D = U2.items.find((t) => t.name === b);
  42. if (!D) {
  43. const t = `The symbol name '${b}' could not be found`;
  44. return Promise.reject(new s("symbolstyleutils:symbol-name-not-found", t, { symbolName: b }));
  45. }
  46. let P = i(d(D, h2), w), S = D.thumbnail && D.thumbnail.href;
  47. const E = D.thumbnail && D.thumbnail.imageData;
  48. c() && (P = a(P), S = a(S));
  49. const O = { portal: N, url: j(Ot(P)), origin: "portal-item" };
  50. return j2(P, d3).then((e) => {
  51. const r2 = h2 === "cimRef" ? p3(e.data) : e.data, o = p2(r2, O);
  52. if (o && c3(o)) {
  53. if (S) {
  54. const t = i(S, w);
  55. o.thumbnail = new p({ url: t });
  56. } else
  57. E && (o.thumbnail = new p({ url: `data:image/png;base64,${E}` }));
  58. f.styleUrl ? o.styleOrigin = new l({ portal: j4.portal, styleUrl: f.styleUrl, name: b }) : f.styleName && (o.styleOrigin = new l({ portal: j4.portal, styleName: f.styleName, name: b }));
  59. }
  60. return o;
  61. });
  62. }
  63. function d2(t, e, r2) {
  64. const o = U.replace(/\{SymbolName\}/gi, t.name), i2 = r(e.portal) ? e.portal : B.getDefault();
  65. return j2(o, r2).then((t2) => {
  66. const e2 = p3(t2.data);
  67. return p2(e2, { portal: i2, url: j(Ot(o)), origin: "portal-item" });
  68. });
  69. }
  70. export {
  71. j3 as j,
  72. h
  73. };
  74. //# sourceMappingURL=chunk-LHFSJ6EZ.js.map