123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234 |
- import {
- l as l2
- } from "./chunk-AEFA3FTZ.js";
- import {
- d,
- e as e2,
- t
- } from "./chunk-Z6GWVH7Z.js";
- import "./chunk-XBH7TGC2.js";
- import "./chunk-K3NA3LQS.js";
- import {
- b,
- j,
- w
- } from "./chunk-7SW2GQFP.js";
- import "./chunk-TRK7CKWP.js";
- import "./chunk-EGVIPYN2.js";
- import "./chunk-7IKYLNB5.js";
- import "./chunk-7256PFPA.js";
- import "./chunk-EN7YGJWG.js";
- import "./chunk-VBNMTM7L.js";
- import "./chunk-3D3QEPRE.js";
- import "./chunk-JFNNSBWL.js";
- import "./chunk-522WBHUO.js";
- import "./chunk-WNCU6BFU.js";
- import "./chunk-C43UE3Z5.js";
- import {
- l
- } from "./chunk-7XXXCK2A.js";
- import "./chunk-7ZIDBK7B.js";
- import "./chunk-65BYCSII.js";
- import "./chunk-WZQZRKNH.js";
- import "./chunk-LRDX4TO7.js";
- import "./chunk-6A4U74YA.js";
- import "./chunk-GJXW4HL5.js";
- import "./chunk-WJW5DUN6.js";
- import "./chunk-PJ7ZQ4VD.js";
- import "./chunk-WDLTDV2L.js";
- import "./chunk-TERAW6FT.js";
- import "./chunk-N2663GRX.js";
- import {
- e,
- u
- } from "./chunk-WEMIK25H.js";
- import "./chunk-JXW4QTJA.js";
- import "./chunk-UXF37FQ4.js";
- import "./chunk-ZOEK6QHJ.js";
- import "./chunk-XNLG7T2T.js";
- import "./chunk-IR4PV7VK.js";
- import "./chunk-2Z6LERTI.js";
- import "./chunk-OWVBLVP3.js";
- import "./chunk-AFZ7XSEW.js";
- import "./chunk-4NKD334K.js";
- import "./chunk-65K7LC56.js";
- import "./chunk-ATPLLI5W.js";
- import "./chunk-WJ3OEUD3.js";
- import "./chunk-MXB2XLKV.js";
- import "./chunk-XH7RUGVZ.js";
- import "./chunk-TBBTRX4O.js";
- import "./chunk-YBSUITLL.js";
- import "./chunk-ALDCDSPV.js";
- import "./chunk-DT6EAZQ5.js";
- import "./chunk-HNOZUNJ4.js";
- import "./chunk-VNFRAYHO.js";
- import "./chunk-R5IG2D6H.js";
- import "./chunk-VBRY5KJM.js";
- import "./chunk-PDKDCAAD.js";
- import "./chunk-ECW2QABR.js";
- import "./chunk-GCDJLKH4.js";
- import "./chunk-MRJEICT6.js";
- import "./chunk-Y3WMVFTW.js";
- import "./chunk-SAS7RONY.js";
- import "./chunk-WSRBH7BF.js";
- import "./chunk-IHXECKQQ.js";
- import "./chunk-ULGDPLM2.js";
- import {
- s3 as s
- } from "./chunk-EMJ4ZSM2.js";
- import "./chunk-IKP3YN53.js";
- import "./chunk-GZT4BVFP.js";
- import "./chunk-A5ICIBVI.js";
- // node_modules/@arcgis/core/views/support/colorUtils.js
- function e3(r2) {
- let { r: n, g: a, b: o, a: e4 } = r2;
- return e4 < 1 && (n = Math.round(e4 * n + 255 * (1 - e4)), a = Math.round(e4 * a + 255 * (1 - e4)), o = Math.round(e4 * o + 255 * (1 - e4))), new l({ r: n, g: a, b: o });
- }
- function u2(t2) {
- const { r: r2, g: n, b: a } = e3(t2);
- return 0.2126 * r2 + 0.7152 * n + 0.0722 * a;
- }
- // node_modules/@arcgis/core/symbols/support/previewSymbol2D.js
- var h = "picture-fill";
- var p = "picture-marker";
- var d2 = "simple-fill";
- var f = "simple-line";
- var y = "simple-marker";
- var v = "text";
- var w2 = "Aa";
- var g = t.size;
- var b2 = t.maxSize;
- var M = t.maxOutlineSize;
- var k = t.lineWidth;
- var x = 225;
- var z = document.createElement("canvas");
- function L(e4, t2) {
- const a = z.getContext("2d"), n = [];
- return t2 && (t2.weight && n.push(t2.weight), t2.size && n.push(t2.size + "px"), t2.family && n.push(t2.family)), a.font = n.join(" "), a.measureText(e4).width;
- }
- var j2 = 7.2 / 2.54;
- var C = 72 / 2.54;
- function S(e4) {
- if (e4.length === 0)
- return 0;
- if (e4.length > 2) {
- const t2 = e(1), a = parseFloat(e4);
- switch (e4.slice(-2)) {
- case "px":
- return a;
- case "pt":
- return a * t2;
- case "in":
- return 72 * a * t2;
- case "pc":
- return 12 * a * t2;
- case "mm":
- return a * j2 * t2;
- case "cm":
- return a * C * t2;
- }
- }
- return parseFloat(e4);
- }
- function F(e4) {
- const t2 = e4?.size;
- return { width: t2 != null && typeof t2 == "object" && "width" in t2 ? u(t2.width) : null, height: t2 != null && typeof t2 == "object" && "height" in t2 ? u(t2.height) : null };
- }
- async function U(e4, t2) {
- const a = t2.fill, n = e4.color;
- if (a?.type === "pattern" && n && e4.type !== h) {
- const e5 = await w(a.src, n.toCss(true));
- a.src = e5, t2.fill = a;
- }
- }
- function E(e4, t2) {
- return e4 > t2 ? "dark" : "light";
- }
- function Z(e4, t2) {
- const n = typeof t2?.size == "number" ? t2?.size : null, o = n != null ? u(n) : null, i = t2?.maxSize != null ? u(t2.maxSize) : null, r2 = t2?.rotation != null ? t2.rotation : "angle" in e4 ? e4.angle : null, m = b(e4);
- let u3 = j(e4);
- D(e4, 245) !== "dark" || t2?.ignoreWhiteSymbols || (u3 = { width: 0.75, ...u3, color: "#bdc3c7" });
- const x2 = { shape: null, fill: m, stroke: u3, offset: [0, 0] };
- u3?.width && (u3.width = Math.min(u3.width, M));
- const z2 = u3?.width || 0;
- let j3 = t2?.size != null && (t2?.scale == null || t2?.scale), C2 = 0, U2 = 0, E2 = false;
- switch (e4.type) {
- case y: {
- const t3 = e4.style, n2 = Math.min(o != null ? o : u(e4.size), i || b2);
- switch (C2 = n2, U2 = n2, t3) {
- case "circle":
- x2.shape = { type: "circle", cx: 0, cy: 0, r: 0.5 * n2 }, j3 || (C2 += z2, U2 += z2);
- break;
- case "cross":
- x2.shape = { type: "path", path: [{ command: "M", values: [0, 0.5 * U2] }, { command: "L", values: [C2, 0.5 * U2] }, { command: "M", values: [0.5 * C2, 0] }, { command: "L", values: [0.5 * C2, U2] }] };
- break;
- case "diamond":
- x2.shape = { type: "path", path: [{ command: "M", values: [0, 0.5 * U2] }, { command: "L", values: [0.5 * C2, 0] }, { command: "L", values: [C2, 0.5 * U2] }, { command: "L", values: [0.5 * C2, U2] }, { command: "Z", values: [] }] }, j3 || (C2 += z2, U2 += z2);
- break;
- case "square":
- x2.shape = { type: "path", path: [{ command: "M", values: [0, 0] }, { command: "L", values: [C2, 0] }, { command: "L", values: [C2, U2] }, { command: "L", values: [0, U2] }, { command: "Z", values: [] }] }, j3 || (C2 += z2, U2 += z2), r2 && (E2 = true);
- break;
- case "triangle":
- x2.shape = { type: "path", path: [{ command: "M", values: [0.5 * C2, 0] }, { command: "L", values: [C2, U2] }, { command: "L", values: [0, U2] }, { command: "Z", values: [] }] }, j3 || (C2 += z2, U2 += z2), r2 && (E2 = true);
- break;
- case "x":
- x2.shape = { type: "path", path: [{ command: "M", values: [0, 0] }, { command: "L", values: [C2, U2] }, { command: "M", values: [C2, 0] }, { command: "L", values: [0, U2] }] }, r2 && (E2 = true);
- break;
- case "path":
- x2.shape = { type: "path", path: e4.path || "" }, j3 || (C2 += z2, U2 += z2), r2 && (E2 = true), j3 = true;
- }
- break;
- }
- case f: {
- const { width: e5, height: a } = F(t2), n2 = a != null ? a : Math.min(o != null ? o : z2, i || M), l3 = e5 != null ? e5 : k;
- u3.width = n2, C2 = l3, U2 = n2;
- const s2 = x2?.stroke?.cap || "butt", c = s2 === "round";
- j3 = true, x2.stroke.cap = s2 === "butt" ? "square" : s2, x2.shape = { type: "path", path: [{ command: "M", values: [c ? n2 / 2 : 0, U2 / 2] }, { command: "L", values: [c ? C2 - n2 / 2 : C2, U2 / 2] }] };
- break;
- }
- case h:
- case d2: {
- const e5 = typeof t2?.symbolConfig == "object" && t2?.symbolConfig.isSquareFill, { width: a, height: n2 } = F(t2);
- C2 = e5 && a != null ? a : o != null ? o : g, U2 = e5 && n2 != null ? n2 : C2, j3 || (C2 += z2, U2 += z2), j3 = true, x2.shape = e5 ? { type: "path", path: [{ command: "M", values: [0, 0] }, { command: "L", values: [C2, 0] }, { command: "L", values: [C2, U2] }, { command: "L", values: [0, U2] }, { command: "L", values: [0, 0] }, { command: "Z", values: [] }] } : e2.fill[0];
- break;
- }
- case p: {
- let t3 = u(e4.width), n2 = u(e4.height);
- const l3 = o != null ? o : Math.max(t3, n2), s2 = t3 / n2;
- t3 = s2 <= 1 ? Math.ceil(l3 * s2) : l3, n2 = s2 <= 1 ? l3 : Math.ceil(l3 / s2), C2 = Math.min(t3, i || b2), U2 = Math.min(n2, i || b2), x2.shape = { type: "image", x: -Math.round(C2 / 2), y: -Math.round(U2 / 2), width: C2, height: U2, src: e4.url || "" }, r2 && (E2 = true);
- break;
- }
- case v: {
- const t3 = e4, n2 = t3.text || w2, l3 = t3.font, s2 = Math.min(o != null ? o : u(l3.size), i || b2), c = L(n2, { weight: l3.weight, size: s2, family: l3.family }), r3 = /[\uE600-\uE6FF]/.test(n2);
- C2 = r3 ? s2 : c, U2 = s2;
- let m2 = 0.25 * S((l3 ? s2 : 0).toString());
- r3 && (m2 += 5), x2.shape = { type: "text", text: n2, x: t3.xoffset || 0, y: t3.yoffset || m2, align: "middle", alignBaseline: t3.verticalAlignment, decoration: l3 && l3.decoration, rotated: t3.rotated, kerning: t3.kerning }, x2.font = l3 && { size: s2, style: l3.style, decoration: l3.decoration, weight: l3.weight, family: l3.family };
- break;
- }
- }
- return { shapeDescriptor: x2, size: [C2, U2], renderOptions: { node: t2?.node, scale: j3, opacity: t2?.opacity, rotation: r2, useRotationSize: E2, effectView: t2?.effectView } };
- }
- async function q(e4, a) {
- const { shapeDescriptor: n, size: l3, renderOptions: s2 } = Z(e4, a);
- if (!n.shape)
- throw new s("symbolPreview: renderPreviewHTML2D", "symbol not supported.");
- await U(e4, n);
- const o = [[n]];
- if (typeof a?.symbolConfig == "object" && a?.symbolConfig.applyColorModulation) {
- const e5 = 0.6 * l3[0];
- o.unshift([{ ...n, offset: [-e5, 0], fill: d(n.fill, -0.3) }]), o.push([{ ...n, offset: [e5, 0], fill: d(n.fill, 0.3) }]), l3[0] += 2 * e5, s2.scale = false;
- }
- return l2(o, l3, s2);
- }
- function D(t2, a = x) {
- const n = b(t2), o = j(t2), i = !n || "type" in n ? null : new l(n), c = o?.color ? new l(o?.color) : null, r2 = i ? E(u2(i), a) : null, m = c ? E(u2(c), a) : null;
- return m ? r2 ? r2 === m ? r2 : a >= x ? "light" : "dark" : m : r2;
- }
- export {
- D as getContrastingBackgroundTheme,
- Z as getRenderSymbolParameters,
- q as previewSymbol2D
- };
- //# sourceMappingURL=previewSymbol2D-P5PKM6M4.js.map
|