(self.webpackChunkRemoteClient = self.webpackChunkRemoteClient || []).push([
  [5022],
  {
    97853: (t, e, i) => {
      'use strict';
      i.d(e, { B: () => l });
      var s = i(29768),
        r = i(95873),
        n = i(34250),
        a = (i(76506), i(91306), i(92143), i(17533));
      let o = class extends r.r {
        initialize() {}
        destroy() {}
        get supportsTileUpdates() {
          return !1;
        }
        get spatialReference() {
          const t = this.get('tileStore.tileScheme.spatialReference');
          return (t && t.toJSON()) || null;
        }
      };
      (0, s._)([(0, n.Cb)({ readOnly: !0 })], o.prototype, 'supportsTileUpdates', null),
        (0, s._)([(0, n.Cb)({ constructOnly: !0 })], o.prototype, 'remoteClient', void 0),
        (0, s._)([(0, n.Cb)({ constructOnly: !0 })], o.prototype, 'service', void 0),
        (0, s._)([(0, n.Cb)()], o.prototype, 'spatialReference', null),
        (0, s._)([(0, n.Cb)({ constructOnly: !0 })], o.prototype, 'tileInfo', void 0),
        (0, s._)([(0, n.Cb)({ constructOnly: !0 })], o.prototype, 'tileStore', void 0),
        (o = (0, s._)([(0, a.j)('esri.views.2d.layers.features.processors.BaseProcessor')], o));
      var l = o;
    },
    81317: (t, e, i) => {
      'use strict';
      i.d(e, { c: () => c, o: () => s });
      const s = { Base64: 0, Hex: 1, String: 2, Raw: 3 };
      function r(t, e) {
        const i = (65535 & t) + (65535 & e);
        return (((t >> 16) + (e >> 16) + (i >> 16)) << 16) | (65535 & i);
      }
      function n(t, e, i, s, n, a) {
        return r(((o = r(r(e, t), r(s, a))) << (l = n)) | (o >>> (32 - l)), i);
        var o, l;
      }
      function a(t, e, i, s, r, a, o) {
        return n((e & i) | (~e & s), t, e, r, a, o);
      }
      function o(t, e, i, s, r, a, o) {
        return n((e & s) | (i & ~s), t, e, r, a, o);
      }
      function l(t, e, i, s, r, a, o) {
        return n(e ^ i ^ s, t, e, r, a, o);
      }
      function h(t, e, i, s, r, a, o) {
        return n(i ^ (e | ~s), t, e, r, a, o);
      }
      function c(t, e = s.Hex) {
        const i = e || s.Base64,
          n = (function (t, e) {
            (t[e >> 5] |= 128 << e % 32), (t[14 + (((e + 64) >>> 9) << 4)] = e);
            let i = 1732584193,
              s = -271733879,
              n = -1732584194,
              c = 271733878;
            for (let e = 0; e < t.length; e += 16) {
              const u = i,
                f = s,
                d = n,
                _ = c;
              (i = a(i, s, n, c, t[e + 0], 7, -680876936)),
                (c = a(c, i, s, n, t[e + 1], 12, -389564586)),
                (n = a(n, c, i, s, t[e + 2], 17, 606105819)),
                (s = a(s, n, c, i, t[e + 3], 22, -1044525330)),
                (i = a(i, s, n, c, t[e + 4], 7, -176418897)),
                (c = a(c, i, s, n, t[e + 5], 12, 1200080426)),
                (n = a(n, c, i, s, t[e + 6], 17, -1473231341)),
                (s = a(s, n, c, i, t[e + 7], 22, -45705983)),
                (i = a(i, s, n, c, t[e + 8], 7, 1770035416)),
                (c = a(c, i, s, n, t[e + 9], 12, -1958414417)),
                (n = a(n, c, i, s, t[e + 10], 17, -42063)),
                (s = a(s, n, c, i, t[e + 11], 22, -1990404162)),
                (i = a(i, s, n, c, t[e + 12], 7, 1804603682)),
                (c = a(c, i, s, n, t[e + 13], 12, -40341101)),
                (n = a(n, c, i, s, t[e + 14], 17, -1502002290)),
                (s = a(s, n, c, i, t[e + 15], 22, 1236535329)),
                (i = o(i, s, n, c, t[e + 1], 5, -165796510)),
                (c = o(c, i, s, n, t[e + 6], 9, -1069501632)),
                (n = o(n, c, i, s, t[e + 11], 14, 643717713)),
                (s = o(s, n, c, i, t[e + 0], 20, -373897302)),
                (i = o(i, s, n, c, t[e + 5], 5, -701558691)),
                (c = o(c, i, s, n, t[e + 10], 9, 38016083)),
                (n = o(n, c, i, s, t[e + 15], 14, -660478335)),
                (s = o(s, n, c, i, t[e + 4], 20, -405537848)),
                (i = o(i, s, n, c, t[e + 9], 5, 568446438)),
                (c = o(c, i, s, n, t[e + 14], 9, -1019803690)),
                (n = o(n, c, i, s, t[e + 3], 14, -187363961)),
                (s = o(s, n, c, i, t[e + 8], 20, 1163531501)),
                (i = o(i, s, n, c, t[e + 13], 5, -1444681467)),
                (c = o(c, i, s, n, t[e + 2], 9, -51403784)),
                (n = o(n, c, i, s, t[e + 7], 14, 1735328473)),
                (s = o(s, n, c, i, t[e + 12], 20, -1926607734)),
                (i = l(i, s, n, c, t[e + 5], 4, -378558)),
                (c = l(c, i, s, n, t[e + 8], 11, -2022574463)),
                (n = l(n, c, i, s, t[e + 11], 16, 1839030562)),
                (s = l(s, n, c, i, t[e + 14], 23, -35309556)),
                (i = l(i, s, n, c, t[e + 1], 4, -1530992060)),
                (c = l(c, i, s, n, t[e + 4], 11, 1272893353)),
                (n = l(n, c, i, s, t[e + 7], 16, -155497632)),
                (s = l(s, n, c, i, t[e + 10], 23, -1094730640)),
                (i = l(i, s, n, c, t[e + 13], 4, 681279174)),
                (c = l(c, i, s, n, t[e + 0], 11, -358537222)),
                (n = l(n, c, i, s, t[e + 3], 16, -722521979)),
                (s = l(s, n, c, i, t[e + 6], 23, 76029189)),
                (i = l(i, s, n, c, t[e + 9], 4, -640364487)),
                (c = l(c, i, s, n, t[e + 12], 11, -421815835)),
                (n = l(n, c, i, s, t[e + 15], 16, 530742520)),
                (s = l(s, n, c, i, t[e + 2], 23, -995338651)),
                (i = h(i, s, n, c, t[e + 0], 6, -198630844)),
                (c = h(c, i, s, n, t[e + 7], 10, 1126891415)),
                (n = h(n, c, i, s, t[e + 14], 15, -1416354905)),
                (s = h(s, n, c, i, t[e + 5], 21, -57434055)),
                (i = h(i, s, n, c, t[e + 12], 6, 1700485571)),
                (c = h(c, i, s, n, t[e + 3], 10, -1894986606)),
                (n = h(n, c, i, s, t[e + 10], 15, -1051523)),
                (s = h(s, n, c, i, t[e + 1], 21, -2054922799)),
                (i = h(i, s, n, c, t[e + 8], 6, 1873313359)),
                (c = h(c, i, s, n, t[e + 15], 10, -30611744)),
                (n = h(n, c, i, s, t[e + 6], 15, -1560198380)),
                (s = h(s, n, c, i, t[e + 13], 21, 1309151649)),
                (i = h(i, s, n, c, t[e + 4], 6, -145523070)),
                (c = h(c, i, s, n, t[e + 11], 10, -1120210379)),
                (n = h(n, c, i, s, t[e + 2], 15, 718787259)),
                (s = h(s, n, c, i, t[e + 9], 21, -343485551)),
                (i = r(i, u)),
                (s = r(s, f)),
                (n = r(n, d)),
                (c = r(c, _));
            }
            return [i, s, n, c];
          })(
            (function (t) {
              const e = [];
              for (let i = 0, s = 8 * t.length; i < s; i += 8)
                e[i >> 5] |= (255 & t.charCodeAt(i / 8)) << i % 32;
              return e;
            })(t),
            8 * t.length,
          );
        switch (i) {
          case s.Raw:
            return n;
          case s.Hex:
            return (function (t) {
              const e = '0123456789abcdef',
                i = [];
              for (let s = 0, r = 4 * t.length; s < r; s++)
                i.push(
                  e.charAt((t[s >> 2] >> ((s % 4) * 8 + 4)) & 15) +
                    e.charAt((t[s >> 2] >> ((s % 4) * 8)) & 15),
                );
              return i.join('');
            })(n);
          case s.String:
            return (function (t) {
              const e = [];
              for (let i = 0, s = 32 * t.length; i < s; i += 8)
                e.push(String.fromCharCode((t[i >> 5] >>> i % 32) & 255));
              return e.join('');
            })(n);
          case s.Base64:
            return (function (t) {
              const e = [];
              for (let i = 0, s = 4 * t.length; i < s; i += 3) {
                const s =
                  (((t[i >> 2] >> ((i % 4) * 8)) & 255) << 16) |
                  (((t[(i + 1) >> 2] >> (((i + 1) % 4) * 8)) & 255) << 8) |
                  ((t[(i + 2) >> 2] >> (((i + 2) % 4) * 8)) & 255);
                for (let r = 0; r < 4; r++)
                  8 * i + 6 * r > 32 * t.length
                    ? e.push('=')
                    : e.push(
                        'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.charAt(
                          (s >> (6 * (3 - r))) & 63,
                        ),
                      );
              }
              return e.join('');
            })(n);
        }
      }
    },
    25022: (t, e, i) => {
      'use strict';
      i.r(e), i.d(e, { default: () => Dr });
      var s = i(29768),
        r = i(60991),
        n = i(76506),
        a = i(92143),
        o = i(50406),
        l = i(34250),
        h = (i(91306), i(17533)),
        c = i(93939),
        u = i(60947),
        f = i(55029),
        d = i(82356),
        _ = i(21972),
        m = i(47880),
        p = i(2267),
        g = (i(11084), i(6687));
      const y = new Set(),
        x = [],
        v = new Map(),
        M = [0, 0];
      let S = class extends _.Z {
        constructor(t) {
          super(t),
            (this._keyToItem = new Map()),
            (this.concurrency = 6),
            (this.strategy = 'scale-first'),
            (this.tileInfoView = null);
        }
        initialize() {
          const { concurrency: t, process: e } = this;
          this._queue = new p.Q({
            concurrency: t,
            process: (t, i) => {
              const s = this._keyToItem.get(t);
              return e(s, { signal: i });
            },
            peeker: (t) => t.values().next().value,
          });
        }
        destroy() {
          this.clear(), this._queue.destroy(), (this._queue = null);
        }
        get length() {
          return this._queue ? this._queue.length : 0;
        }
        get onGoingCount() {
          return this._keyToItem.size;
        }
        get updating() {
          return this.length > 0 || this.onGoingCount > 0;
        }
        abort(t) {
          const e = 'string' == typeof t ? t : t.id;
          this._queue.abort(e);
        }
        clear() {
          this._queue.clear(), this._keyToItem.clear(), this.notifyChange('updating');
        }
        has(t) {
          return 'string' == typeof t ? this._keyToItem.has(t) : this._keyToItem.has(t.id);
        }
        isOngoing(t) {
          const e = 'string' == typeof t ? t : t.id;
          return this.has(e) && this._queue.isOngoing(e);
        }
        pause() {
          this._queue.pause();
        }
        push(t, e) {
          const i = t.key.id + '-' + e;
          if (this.has(i)) return this.get(i);
          const s = this._queue.push(i),
            r = () => {
              this._keyToItem.delete(i), this.notifyChange('updating');
            };
          return this._keyToItem.set(i, t), s.then(r, r), this.notifyChange('updating'), s;
        }
        reset() {
          this._queue.reset(), this.notifyChange('updating');
        }
        resume() {
          this._queue.resume();
        }
        _peekByScaleFirst(t) {
          if (!this.state) return t.values().next().value;
          const e = this.tileInfoView;
          let i = Number.NEGATIVE_INFINITY,
            s = Number.POSITIVE_INFINITY;
          t.forEach((t) => {
            const e = this._keyToItem.get(t),
              r = this.tileInfoView.getTileScale(e.key);
            v.has(r) || (v.set(r, []), (i = Math.max(r, i)), (s = Math.min(r, s))),
              v.get(r).push(e.key),
              y.add(r);
          });
          let r = this.state.scale;
          var n, a;
          v.has(r) ||
            ((a = y),
            ((n = x).length = 0),
            a.forEach((t) => n.push(t)),
            x.sort(),
            (r = x.reduce((t, e) => (Math.abs(e - r) < Math.abs(t - r) ? e : t), x[0]))),
            (r = Math.min(r, i)),
            (r = Math.max(r, s));
          const o = v.get(r),
            l = e.getClosestInfoForScale(r),
            h = l.getColumnForX(this.state.center[0]),
            c = l.getRowForY(this.state.center[1]);
          return (
            o.sort((t, e) => {
              const i = l.denormalizeCol(t.col, t.world),
                s = l.denormalizeCol(e.col, e.world);
              return (
                Math.sqrt((h - i) * (h - i) + (c - t.row) * (c - t.row)) -
                Math.sqrt((h - s) * (h - s) + (c - e.row) * (c - e.row))
              );
            }),
            y.clear(),
            v.clear(),
            o[0].id
          );
        }
        _peekByCenterFirst(t) {
          if (!this.state) return t.values().next().value;
          const e = this.tileInfoView,
            i = this.state.center;
          let s = Number.POSITIVE_INFINITY,
            r = null;
          return (
            t.forEach((t) => {
              const n = this._keyToItem.get(t);
              e.getTileCoords(M, n.key);
              const a = (0, m.d)(M, i);
              a < s && ((s = a), (r = n.key));
            }),
            r.id
          );
        }
      };
      (0, s._)([(0, l.Cb)({ constructOnly: !0 })], S.prototype, 'concurrency', void 0),
        (0, s._)([(0, l.Cb)({ constructOnly: !0 })], S.prototype, 'process', void 0),
        (0, s._)([(0, l.Cb)()], S.prototype, 'state', void 0),
        (0, s._)([(0, l.Cb)({ constructOnly: !0 })], S.prototype, 'strategy', void 0),
        (0, s._)([(0, l.Cb)({ constructOnly: !0 })], S.prototype, 'tileInfoView', void 0),
        (0, s._)([(0, l.Cb)({ readOnly: !0 })], S.prototype, 'updating', null),
        (S = (0, s._)([(0, h.j)('esri.views.2d.tiling.PagedTileQueue')], S));
      const b = new Set(),
        w = [],
        P = new Map(),
        C = [0, 0];
      let L = class extends _.Z {
        constructor(t) {
          super(t),
            (this._keyToItem = new Map()),
            (this.concurrency = 6),
            (this.strategy = 'scale-first'),
            (this.tileInfoView = null);
        }
        initialize() {
          const { concurrency: t, process: e, strategy: i } = this;
          this._queue = new p.Q({
            concurrency: t,
            process: (t, i) => {
              const s = this._keyToItem.get(t);
              return e(s, { signal: i });
            },
            peeker:
              'scale-first' === i
                ? (t) => this._peekByScaleFirst(t)
                : (t) => this._peekByCenterFirst(t),
          });
        }
        destroy() {
          this.clear(), this._queue.destroy(), (this._queue = null);
        }
        get length() {
          return this._queue ? this._queue.length : 0;
        }
        get onGoingCount() {
          return this._keyToItem.size;
        }
        get updating() {
          return this.length > 0 || this.onGoingCount > 0;
        }
        abort(t) {
          const e = 'string' == typeof t ? t : t.id;
          this._queue.abort(e);
        }
        clear() {
          this._queue.clear(), this._keyToItem.clear(), this.notifyChange('updating');
        }
        has(t) {
          return 'string' == typeof t ? this._keyToItem.has(t) : this._keyToItem.has(t.id);
        }
        isOngoing(t) {
          const e = 'string' == typeof t ? t : t.id;
          return this.has(e) && this._queue.isOngoing(e);
        }
        pause() {
          this._queue.pause();
        }
        push(t) {
          const e = t.key.id;
          if (this._queue.has(e)) return this._queue.get(e);
          const i = this._queue.push(e),
            s = () => {
              this._keyToItem.delete(e), this.notifyChange('updating');
            };
          return this._keyToItem.set(e, t), i.then(s, s), this.notifyChange('updating'), i;
        }
        reset() {
          this._queue.reset();
        }
        resume() {
          this._queue.resume();
        }
        _peekByScaleFirst(t) {
          if (!this.state) return t.values().next().value;
          const e = this.tileInfoView;
          let i = Number.NEGATIVE_INFINITY,
            s = Number.POSITIVE_INFINITY;
          t.forEach((t) => {
            const e = this._keyToItem.get(t),
              r = this.tileInfoView.getTileScale(e.key);
            P.has(r) || (P.set(r, []), (i = Math.max(r, i)), (s = Math.min(r, s))),
              P.get(r).push(e.key),
              b.add(r);
          });
          let r = this.state.scale;
          var n, a;
          P.has(r) ||
            ((a = b),
            ((n = w).length = 0),
            a.forEach((t) => n.push(t)),
            w.sort(),
            (r = w.reduce((t, e) => (Math.abs(e - r) < Math.abs(t - r) ? e : t), w[0]))),
            (r = Math.min(r, i)),
            (r = Math.max(r, s));
          const o = P.get(r),
            l = e.getClosestInfoForScale(r),
            h = l.getColumnForX(this.state.center[0]),
            c = l.getRowForY(this.state.center[1]);
          return (
            o.sort((t, e) => {
              const i = l.denormalizeCol(t.col, t.world),
                s = l.denormalizeCol(e.col, e.world);
              return (
                Math.sqrt((h - i) * (h - i) + (c - t.row) * (c - t.row)) -
                Math.sqrt((h - s) * (h - s) + (c - e.row) * (c - e.row))
              );
            }),
            b.clear(),
            P.clear(),
            o[0].id
          );
        }
        _peekByCenterFirst(t) {
          if (!this.state) return t.values().next().value;
          const e = this.tileInfoView,
            i = this.state.center;
          let s = Number.POSITIVE_INFINITY,
            r = null;
          return (
            t.forEach((t) => {
              const n = this._keyToItem.get(t);
              e.getTileCoords(C, n.key);
              const a = (0, m.d)(C, i);
              a < s && ((s = a), (r = n.key));
            }),
            r.id
          );
        }
      };
      (0, s._)([(0, l.Cb)({ constructOnly: !0 })], L.prototype, 'concurrency', void 0),
        (0, s._)([(0, l.Cb)({ constructOnly: !0 })], L.prototype, 'process', void 0),
        (0, s._)([(0, l.Cb)()], L.prototype, 'state', void 0),
        (0, s._)([(0, l.Cb)({ constructOnly: !0 })], L.prototype, 'strategy', void 0),
        (0, s._)([(0, l.Cb)({ constructOnly: !0 })], L.prototype, 'tileInfoView', void 0),
        (0, s._)([(0, l.Cb)({ readOnly: !0 })], L.prototype, 'updating', null),
        (L = (0, s._)([(0, h.j)('esri.views.2d.tiling.TileQueue')], L)),
        new g.T(0, 0, 0, 0),
        new Map();
      var k = i(30752),
        I = i(3498),
        T = i(53257),
        E = i(82426),
        z = i(99403);
      function R(t) {
        return (t[0] = 1), (t[1] = 0), (t[2] = 0), (t[3] = 1), (t[4] = 0), (t[5] = 0), t;
      }
      function V(t, e, i) {
        const s = e[0],
          r = e[1],
          n = e[2],
          a = e[3],
          o = e[4],
          l = e[5],
          h = i[0],
          c = i[1],
          u = i[2],
          f = i[3],
          d = i[4],
          _ = i[5];
        return (
          (t[0] = s * h + n * c),
          (t[1] = r * h + a * c),
          (t[2] = s * u + n * f),
          (t[3] = r * u + a * f),
          (t[4] = s * d + n * _ + o),
          (t[5] = r * d + a * _ + l),
          t
        );
      }
      function A(t, e, i) {
        const s = e[0],
          r = e[1],
          n = e[2],
          a = e[3],
          o = e[4],
          l = e[5],
          h = Math.sin(i),
          c = Math.cos(i);
        return (
          (t[0] = s * c + n * h),
          (t[1] = r * c + a * h),
          (t[2] = s * -h + n * c),
          (t[3] = r * -h + a * c),
          (t[4] = o),
          (t[5] = l),
          t
        );
      }
      function O(t, e, i) {
        const s = e[0],
          r = e[1],
          n = e[2],
          a = e[3],
          o = e[4],
          l = e[5],
          h = i[0],
          c = i[1];
        return (
          (t[0] = s),
          (t[1] = r),
          (t[2] = n),
          (t[3] = a),
          (t[4] = s * h + n * c + o),
          (t[5] = r * h + a * c + l),
          t
        );
      }
      function F() {
        const t = new Float32Array(6);
        return (t[0] = 1), (t[3] = 1), t;
      }
      function N(t, e, i, s) {
        const r = e[s],
          n = e[s + 1];
        (t[s] = i[0] * r + i[2] * n + i[4]), (t[s + 1] = i[1] * r + i[3] * n + i[5]);
      }
      function G(t, e, i, s = 0, r = 0, n = 2) {
        const a = r || e.length / n;
        for (let r = s; r < a; r++) N(t, e, i, r * n);
      }
      function W() {
        return new Float32Array(2);
      }
      function B(t, e) {
        const i = new Float32Array(2);
        return (i[0] = t), (i[1] = e), i;
      }
      B(1, 1), B(1, 0), B(0, 1);
      var D,
        X,
        Y,
        H = i(33957),
        U = i(20369),
        Z = i(78537);
      function K(t) {
        switch (t) {
          case 'left':
            return D.Left;
          case 'right':
            return D.Right;
          case 'center':
          case 'justify':
            return D.Center;
        }
      }
      function q(t) {
        switch (t) {
          case 'top':
            return X.Top;
          case 'middle':
            return X.Center;
          case 'baseline':
            return X.Baseline;
          case 'bottom':
            return X.Bottom;
        }
      }
      ((Y = D || (D = {}))[(Y.Left = -1)] = 'Left'),
        (Y[(Y.Center = 0)] = 'Center'),
        (Y[(Y.Right = 1)] = 'Right'),
        (function (t) {
          (t[(t.Top = 1)] = 'Top'),
            (t[(t.Center = 0)] = 'Center'),
            (t[(t.Bottom = -1)] = 'Bottom'),
            (t[(t.Baseline = 2)] = 'Baseline');
        })(X || (X = {}));
      class J {
        constructor(t, e, i, s) {
          (this.center = B(t, e)),
            (this.centerT = W()),
            (this.halfWidth = i / 2),
            (this.halfHeight = s / 2),
            (this.width = i),
            (this.height = s);
        }
        get x() {
          return this.center[0];
        }
        get y() {
          return this.center[1];
        }
        get blX() {
          return this.center[0] + this.halfWidth;
        }
        get blY() {
          return this.center[1] + this.halfHeight;
        }
        get trX() {
          return this.center[0] - this.halfWidth;
        }
        get trY() {
          return this.center[1] - this.halfHeight;
        }
        get xmin() {
          return this.x - this.halfWidth;
        }
        get xmax() {
          return this.x + this.halfWidth;
        }
        get ymin() {
          return this.y - this.halfHeight;
        }
        get ymax() {
          return this.y + this.halfHeight;
        }
        set x(t) {
          this.center[0] = t;
        }
        set y(t) {
          this.center[1] = t;
        }
        clone() {
          return new J(this.x, this.y, this.width, this.height);
        }
        serialize(t) {
          return (
            t.writeF32(this.center[0]),
            t.writeF32(this.center[1]),
            t.push(this.width),
            t.push(this.height),
            t
          );
        }
        findCollisionDelta(t, e = 4) {
          const i = Math.abs(t.centerT[0] - this.centerT[0]),
            s = Math.abs(t.centerT[1] - this.centerT[1]),
            r = (t.halfWidth + this.halfWidth + e) / i,
            n = (t.halfHeight + this.halfHeight + e) / s,
            a = Math.min(r, n);
          return (0, E.H)(a);
        }
        extend(t) {
          const e = Math.min(this.xmin, t.xmin),
            i = Math.min(this.ymin, t.ymin),
            s = Math.max(this.xmax, t.xmax) - e,
            r = Math.max(this.ymax, t.ymax) - i,
            n = e + s / 2,
            a = i + r / 2;
          (this.width = s),
            (this.height = r),
            (this.halfWidth = s / 2),
            (this.halfHeight = r / 2),
            (this.x = n),
            (this.y = a);
        }
        static deserialize(t) {
          const e = t.readF32(),
            i = t.readF32(),
            s = t.readInt32(),
            r = t.readInt32();
          return new J(e, i, s, r);
        }
      }
      const $ = Math.PI / 180;
      class j {
        constructor(t, e, i, s) {
          (this._rotationT = F()),
            (this._xBounds = 0),
            (this._yBounds = 0),
            (this.minZoom = 0),
            (this.maxZoom = 255),
            (this._bounds = null);
          const r = i.rect,
            n = new Float32Array(8);
          (t *= s), (e *= s);
          const a = i.code ? r.width * s : i.metrics.width,
            o = i.code ? r.height * s : i.metrics.height;
          (n[0] = t),
            (n[1] = e),
            (n[2] = t + a),
            (n[3] = e),
            (n[4] = t),
            (n[5] = e + o),
            (n[6] = t + a),
            (n[7] = e + o),
            (this._data = n),
            this._setTextureCoords(r),
            (this._scale = s),
            (this._mosaic = i),
            (this.x = t),
            (this.y = e),
            (this.maxOffset = Math.max(t + a, e + o));
        }
        get width() {
          return this._mosaic.metrics.width * this._scale;
        }
        get mosaic() {
          return this._mosaic;
        }
        set angle(t) {
          (this._angle = t),
            R(this._rotationT),
            A(this._rotationT, this._rotationT, -t),
            this._setOffsets(this._data);
        }
        get angle() {
          return this._angle;
        }
        get xTopLeft() {
          return this._data[0];
        }
        get yTopLeft() {
          return this._data[1];
        }
        get xBottomRight() {
          return this._data[6];
        }
        get yBottomRight() {
          return this._data[7];
        }
        get texcoords() {
          return this._texcoords;
        }
        get textureBinding() {
          return this._mosaic.textureBinding;
        }
        get offsets() {
          return this._offsets || this._setOffsets(this._data), this._offsets;
        }
        get char() {
          return String.fromCharCode(this._mosaic.code);
        }
        get code() {
          return this._mosaic.code;
        }
        get bounds() {
          if (!this._bounds) {
            const { height: t, width: e } = this._mosaic.metrics,
              i = e * this._scale,
              s = Math.abs(t) * this._scale,
              r = new Float32Array(8);
            (r[0] = this.x),
              (r[1] = this.y),
              (r[2] = this.x + i),
              (r[3] = this.y),
              (r[4] = this.x),
              (r[5] = this.y + s),
              (r[6] = this.x + i),
              (r[7] = this.y + s),
              G(r, r, V(F(), this._rotationT, this._T));
            let n = 1 / 0,
              a = 1 / 0,
              o = 0,
              l = 0;
            for (let t = 0; t < 4; t++) {
              const e = r[2 * t],
                i = r[2 * t + 1];
              (n = Math.min(n, e)),
                (a = Math.min(a, i)),
                (o = Math.max(o, e)),
                (l = Math.max(l, i));
            }
            const h = o - n,
              c = l - a,
              u = n + h / 2,
              f = a + c / 2;
            this._bounds = new J(u, f, h, c);
          }
          return this._bounds;
        }
        setTransform(t) {
          (this._T = t), (this._offsets = null);
        }
        _setOffsets(t) {
          this._offsets ||
            (this._offsets = { upperLeft: 0, upperRight: 0, lowerLeft: 0, lowerRight: 0 });
          const e = this._offsets,
            i = new Float32Array(8);
          G(i, t, V(F(), this._rotationT, this._T)),
            (e.upperLeft = (0, H.i)(8 * i[0], 8 * i[1])),
            (e.upperRight = (0, H.i)(8 * i[2], 8 * i[3])),
            (e.lowerLeft = (0, H.i)(8 * i[4], 8 * i[5])),
            (e.lowerRight = (0, H.i)(8 * i[6], 8 * i[7]));
        }
        _setTextureCoords({ x: t, y: e, width: i, height: s }) {
          this._texcoords = {
            upperLeft: (0, H.i)(t, e),
            upperRight: (0, H.i)(t + i, e),
            lowerLeft: (0, H.i)(t, e + s),
            lowerRight: (0, H.i)(t + i, e + s),
          };
        }
      }
      const Q = (t, e) => ({
        code: 0,
        page: 0,
        sdf: !0,
        rect: new U.R(0, 0, 11, 8),
        textureBinding: e,
        metrics: { advance: 0, height: 4, width: t, left: 0, top: 0 },
      });
      class tt {
        constructor(t, e, i) {
          (this._rotation = 0),
            this._decorate(t, e, i),
            (this.glyphs = t),
            (this.bounds = this._createBounds(t)),
            (this.isMultiline = e.length > 1),
            (this._hasRotation = 0 !== i.angle),
            (this._T = this._createGlyphTransform(this.bounds, i));
          for (const e of t) e.setTransform(this._T);
        }
        setRotation(t) {
          if (0 === t && 0 === this._rotation) return;
          this._rotation = t;
          const e = this._T;
          V(
            e,
            (function (t, e) {
              const i = Math.sin(e),
                s = Math.cos(e);
              return (t[0] = s), (t[1] = i), (t[2] = -i), (t[3] = s), (t[4] = 0), (t[5] = 0), t;
            })(F(), t),
            e,
          );
          for (const t of this.glyphs) t.setTransform(this._T);
        }
        _decorate(t, e, i) {
          if (!i.decoration || 'none' === i.decoration || !t.length) return;
          const s = i.scale,
            r = 'underline' === i.decoration ? 30 : 20,
            n = t[0].textureBinding;
          for (const i of e) {
            const e = i.startX * s,
              a = i.startY * s,
              o = (i.width + i.glyphWidthEnd) * s;
            t.push(new j(e, a + r * s, Q(o, n), 1));
          }
        }
        get boundsT() {
          const t = this.bounds,
            e = (0, m.s)(W(), t.x, t.y);
          if (((0, m.t)(e, e, this._T), this._hasRotation)) {
            const i = Math.max(t.width, t.height);
            return new J(e[0], e[1], i, i);
          }
          return new J(e[0], e[1], t.width, t.height);
        }
        _createBounds(t) {
          let e = 1 / 0,
            i = 1 / 0,
            s = 0,
            r = 0;
          for (const n of t)
            (e = Math.min(e, n.xTopLeft)),
              (i = Math.min(i, n.yTopLeft)),
              (s = Math.max(s, n.xTopLeft + n.width)),
              (r = Math.max(r, n.yBottomRight));
          const n = s - e,
            a = r - i;
          return new J(e + n / 2, i + a / 2, n, a);
        }
        _createGlyphTransform(t, e) {
          const i = $ * e.angle,
            s = F(),
            r = W();
          return (
            O(s, s, (0, m.s)(r, e.xOffset, -e.yOffset)),
            e.isCIM
              ? A(s, s, i)
              : (O(s, s, (0, m.s)(r, t.x, t.y)), A(s, s, i), O(s, s, (0, m.s)(r, -t.x, -t.y))),
            s
          );
        }
      }
      class et {
        constructor(t, e, i, s, r, n) {
          (this.glyphWidthEnd = 0),
            (this.startX = 0),
            (this.startY = 0),
            (this.start = Math.max(0, Math.min(e, i))),
            (this.end = Math.max(0, Math.max(e, i))),
            this.end < t.length && (this.glyphWidthEnd = t[this.end].metrics.width),
            (this.width = s),
            (this.yMin = r),
            (this.yMax = n);
        }
      }
      const it = (t) => 10 === t,
        st = (t) => 32 === t,
        rt = new Z.B();
      function nt(t) {
        if (!rt.hasBidiChar(t)) return [t, !1];
        let e;
        return (
          (e = 'rtl' === rt.checkContextual(t) ? 'IDNNN' : 'ICNNN'),
          [rt.bidiTransform(t, e, 'VLYSN'), !0]
        );
      }
      var at = i(86929);
      function ot(t) {
        switch (t) {
          case 'above-along':
          case 'below-along':
          case 'center-along':
          case 'esriServerLinePlacementAboveAlong':
          case 'esriServerLinePlacementBelowAlong':
          case 'esriServerLinePlacementCenterAlong':
            return !0;
          default:
            return !1;
        }
      }
      function lt(t, e, i, s, r) {
        switch (t) {
          case k.a.FILL:
            return _t.from(e, s);
          case k.a.LINE:
            return pt.from(e, i);
          case k.a.MARKER:
            return mt.from(e);
          case k.a.TEXT:
            return gt.from(e);
          case k.a.LABEL:
            return yt.from(e, r);
          default:
            throw new Error(`Unable to createMaterialKey for unknown geometryType ${t}`);
        }
      }
      class ht {
        constructor(t) {
          (this._data = 0), (this._data = t);
        }
        static load(t) {
          const e = this.shared;
          return (e.data = t), e;
        }
        set data(t) {
          this._data = t;
        }
        get data() {
          return this._data;
        }
        get geometryType() {
          return this.bits(8, 11);
        }
        set geometryType(t) {
          this.setBits(t, 8, 11);
        }
        get mapAligned() {
          return !!this.bit(20);
        }
        set mapAligned(t) {
          this.setBit(20, t);
        }
        get sdf() {
          return !!this.bit(11);
        }
        set sdf(t) {
          this.setBit(11, t);
        }
        get pattern() {
          return !!this.bit(12);
        }
        set pattern(t) {
          this.setBit(12, t);
        }
        get textureBinding() {
          return this.bits(0, 8);
        }
        set textureBinding(t) {
          this.setBits(t, 0, 8);
        }
        get geometryTypeString() {
          switch (this.geometryType) {
            case k.a.FILL:
              return 'fill';
            case k.a.MARKER:
              return 'marker';
            case k.a.LINE:
              return 'line';
            case k.a.TEXT:
              return 'text';
            case k.a.LABEL:
              return 'label';
            default:
              throw new r.Z(`Unable to handle unknown geometryType: ${this.geometryType}`);
          }
        }
        setBit(t, e) {
          const i = 1 << t;
          e ? (this._data |= i) : (this._data &= ~i);
        }
        bit(t) {
          return (this._data & (1 << t)) >> t;
        }
        setBits(t, e, i) {
          for (let s = e, r = 0; s < i; s++, r++) this.setBit(s, 0 != (t & (1 << r)));
        }
        bits(t, e) {
          let i = 0;
          for (let s = t, r = 0; s < e; s++, r++) i |= this.bit(s) << r;
          return i;
        }
        hasVV() {
          return !1;
        }
        setVV(t, e) {}
        getVariation() {
          return { mapAligned: this.mapAligned, pattern: this.pattern, sdf: this.sdf };
        }
        getVariationHash() {
          return this._data & ~(7 & this.textureBinding);
        }
      }
      ht.shared = new ht(0);
      const ct = (t) =>
          class extends t {
            get vvSizeMinMaxValue() {
              return 0 !== this.bit(16);
            }
            set vvSizeMinMaxValue(t) {
              this.setBit(16, t);
            }
            get vvSizeScaleStops() {
              return 0 !== this.bit(17);
            }
            set vvSizeScaleStops(t) {
              this.setBit(17, t);
            }
            get vvSizeFieldStops() {
              return 0 !== this.bit(18);
            }
            set vvSizeFieldStops(t) {
              this.setBit(18, t);
            }
            get vvSizeUnitValue() {
              return 0 !== this.bit(19);
            }
            set vvSizeUnitValue(t) {
              this.setBit(19, t);
            }
            hasVV() {
              return (
                super.hasVV() ||
                this.vvSizeMinMaxValue ||
                this.vvSizeScaleStops ||
                this.vvSizeFieldStops ||
                this.vvSizeUnitValue
              );
            }
            setVV(t, e) {
              super.setVV(t, e);
              const i =
                (function (t, e = !1) {
                  const i =
                      k.b.SIZE_FIELD_STOPS |
                      k.b.SIZE_MINMAX_VALUE |
                      k.b.SIZE_SCALE_STOPS |
                      k.b.SIZE_UNIT_VALUE,
                    s =
                      (t &
                        (k.c.FIELD_TARGETS_OUTLINE |
                          k.c.MINMAX_TARGETS_OUTLINE |
                          k.c.SCALE_TARGETS_OUTLINE |
                          k.c.UNIT_TARGETS_OUTLINE)) >>>
                      4;
                  return e ? i & s : i & ~s;
                })(t, e) & t;
              (this.vvSizeMinMaxValue = !!(i & k.b.SIZE_MINMAX_VALUE)),
                (this.vvSizeFieldStops = !!(i & k.b.SIZE_FIELD_STOPS)),
                (this.vvSizeUnitValue = !!(i & k.b.SIZE_UNIT_VALUE)),
                (this.vvSizeScaleStops = !!(i & k.b.SIZE_SCALE_STOPS));
            }
          },
        ut = (t) =>
          class extends t {
            get vvRotation() {
              return 0 !== this.bit(15);
            }
            set vvRotation(t) {
              this.setBit(15, t);
            }
            hasVV() {
              return super.hasVV() || this.vvRotation;
            }
            setVV(t, e) {
              super.setVV(t, e), (this.vvRotation = !e && !!(t & k.b.ROTATION));
            }
          },
        ft = (t) =>
          class extends t {
            get vvColor() {
              return 0 !== this.bit(13);
            }
            set vvColor(t) {
              this.setBit(13, t);
            }
            hasVV() {
              return super.hasVV() || this.vvColor;
            }
            setVV(t, e) {
              super.setVV(t, e), (this.vvColor = !e && !!(t & k.b.COLOR));
            }
          },
        dt = (t) =>
          class extends t {
            get vvOpacity() {
              return 0 !== this.bit(14);
            }
            set vvOpacity(t) {
              this.setBit(14, t);
            }
            hasVV() {
              return super.hasVV() || this.vvOpacity;
            }
            setVV(t, e) {
              super.setVV(t, e), (this.vvOpacity = !e && !!(t & k.b.OPACITY));
            }
          };
      class _t extends ft(dt(ht)) {
        static load(t) {
          const e = this.shared;
          return (e.data = t), e;
        }
        static from(t, e) {
          const i = this.load(0);
          return (i.geometryType = k.a.FILL), e ? (i.dotDensity = !0) : i.setVV(t, !1), i.data;
        }
        getVariation() {
          return {
            ...super.getVariation(),
            dotDensity: this.dotDensity,
            vvColor: this.vvColor,
            vvOpacity: this.vvOpacity,
          };
        }
        get dotDensity() {
          return !!this.bit(15);
        }
        set dotDensity(t) {
          this.setBit(15, t);
        }
      }
      _t.shared = new _t(0);
      class mt extends ft(dt(ut(ct(ht)))) {
        static load(t) {
          const e = this.shared;
          return (e.data = t), e;
        }
        static from(t) {
          const e = this.load(0);
          return (e.geometryType = k.a.MARKER), e.setVV(t, !1), e.data;
        }
        getVariation() {
          return {
            ...super.getVariation(),
            vvColor: this.vvColor,
            vvRotation: this.vvRotation,
            vvOpacity: this.vvOpacity,
            vvSizeFieldStops: this.vvSizeFieldStops,
            vvSizeMinMaxValue: this.vvSizeMinMaxValue,
            vvSizeScaleStops: this.vvSizeScaleStops,
            vvSizeUnitValue: this.vvSizeUnitValue,
          };
        }
      }
      mt.shared = new mt(0);
      class pt extends ft(dt(ct(ht))) {
        static load(t) {
          const e = this.shared;
          return (e.data = t), e;
        }
        static from(t, e) {
          const i = this.load(0);
          return (i.geometryType = k.a.LINE), i.setVV(t, e), i.data;
        }
        getVariation() {
          return {
            ...super.getVariation(),
            vvColor: this.vvColor,
            vvOpacity: this.vvOpacity,
            vvSizeFieldStops: this.vvSizeFieldStops,
            vvSizeMinMaxValue: this.vvSizeMinMaxValue,
            vvSizeScaleStops: this.vvSizeScaleStops,
            vvSizeUnitValue: this.vvSizeUnitValue,
          };
        }
      }
      pt.shared = new pt(0);
      class gt extends ft(dt(ut(ct(ht)))) {
        static load(t) {
          const e = this.shared;
          return (e.data = t), e;
        }
        static from(t) {
          const e = this.load(t);
          return (e.geometryType = k.a.TEXT), e.setVV(t, !1), e.data;
        }
        getVariation() {
          return {
            ...super.getVariation(),
            vvColor: this.vvColor,
            vvOpacity: this.vvOpacity,
            vvRotation: this.vvRotation,
            vvSizeFieldStops: this.vvSizeFieldStops,
            vvSizeMinMaxValue: this.vvSizeMinMaxValue,
            vvSizeScaleStops: this.vvSizeScaleStops,
            vvSizeUnitValue: this.vvSizeUnitValue,
          };
        }
      }
      gt.shared = new gt(0);
      class yt extends ct(ht) {
        static load(t) {
          const e = this.shared;
          return (e.data = t), e;
        }
        static from(t, e) {
          const i = this.load(0);
          return (i.geometryType = k.a.LABEL), i.setVV(t, !1), (i.mapAligned = ot(e)), i.data;
        }
        getVariation() {
          return {
            ...super.getVariation(),
            vvSizeFieldStops: this.vvSizeFieldStops,
            vvSizeMinMaxValue: this.vvSizeMinMaxValue,
            vvSizeScaleStops: this.vvSizeScaleStops,
            vvSizeUnitValue: this.vvSizeUnitValue,
          };
        }
      }
      yt.shared = new yt(0);
      var xt,
        vt = i(40267),
        Mt = i(48027),
        St = i(92482),
        bt = i(98380),
        wt = i(32422);
      class Pt {
        constructor() {
          this.setIdentity();
        }
        getAngle() {
          return (
            (null == this.rz || (0 === this.rz && 1 !== this.rz_c && 0 !== this.rz_s)) &&
              (this.rz = Math.atan2(this.rz_s, this.rz_c)),
            this.rz
          );
        }
        setIdentity() {
          (this.tx = 0),
            (this.ty = 0),
            (this.tz = 0),
            (this.s = 1),
            (this.rx = 0),
            (this.ry = 0),
            (this.rz = 0),
            (this.rz_c = 1),
            (this.rz_s = 0);
        }
        setTranslate(t, e) {
          (this.tx = t), (this.ty = e);
        }
        setTranslateZ(t) {
          this.tz = t;
        }
        setRotateCS(t, e) {
          (this.rz = void 0), (this.rz_c = t), (this.rz_s = e);
        }
        setRotate(t) {
          (this.rz = t), (this.rz_c = void 0), (this.rz_s = void 0);
        }
        setRotateY(t) {
          this.ry = t;
        }
        setScale(t) {
          this.s = t;
        }
        setMeasure(t) {
          this.m = t;
        }
      }
      class Ct {
        constructor(t) {
          this._geometry = t;
        }
        next() {
          const t = this._geometry;
          return (this._geometry = null), t;
        }
      }
      function Lt(t) {
        const e = (0, n.d9)(t);
        return (
          (function (t) {
            t &&
              ((0, wt.oU)(t)
                ? Et(t.rings)
                : (0, wt.l9)(t)
                ? Et(t.paths)
                : (0, wt.aW)(t) && Tt(t.points));
          })(e),
          e
        );
      }
      function kt(t) {
        if (t)
          for (let e = t.length - 1; e > 0; --e) (t[e][0] -= t[e - 1][0]), (t[e][1] -= t[e - 1][1]);
      }
      function It(t) {
        if (t) for (const e of t) kt(e);
      }
      function Tt(t) {
        if (t) {
          const e = t.length;
          for (let i = 1; i < e; ++i) (t[i][0] += t[i - 1][0]), (t[i][1] += t[i - 1][1]);
        }
      }
      function Et(t) {
        if (t) for (const e of t) Tt(e);
      }
      function zt(t) {
        if (t) for (const e of t) Rt(e);
      }
      function Rt(t) {
        t && t.reverse();
      }
      function Vt(t, e, i) {
        return [t[0] + (e[0] - t[0]) * i, t[1] + (e[1] - t[1]) * i];
      }
      function At(t) {
        return t[4];
      }
      function Ot(t, e) {
        t[4] = e;
      }
      class Ft {
        constructor(t, e, i, s) {
          (this.acceptPolygon = e),
            (this.acceptPolyline = i),
            (this.geomUnitsPerPoint = s),
            (this.pathCount = -1),
            (this.pathIndex = -1),
            (this.iteratePath = !1),
            t &&
              ((0, wt.oU)(t)
                ? e && ((this.multiPath = t.rings), (this.isClosed = !0))
                : (0, wt.l9)(t)
                ? i && ((this.multiPath = t.paths), (this.isClosed = !1))
                : (0, wt.YX)(t) && e && ((this.multiPath = Gt(t).rings), (this.isClosed = !0)),
              this.multiPath && (this.pathCount = this.multiPath.length)),
            (this.internalPlacement = new Pt());
        }
        next() {
          if (!this.multiPath) return null;
          for (; this.iteratePath || this.pathIndex < this.pathCount - 1; ) {
            this.iteratePath || this.pathIndex++;
            const t = this.processPath(this.multiPath[this.pathIndex]);
            if (t) return t;
          }
          return (this.pathCount = -1), (this.pathIndex = -1), (this.multiPath = null), null;
        }
      }
      class Nt {
        constructor(t, e, i, s) {
          (this.inputGeometries = t),
            (this.acceptPolygon = e),
            (this.acceptPolyline = i),
            (this.geomUnitsPerPoint = s),
            (this.pathCount = -1),
            (this.pathIndex = -1),
            (this.iteratePath = !1);
        }
        next() {
          for (;;) {
            if (!this.multiPath) {
              let t = this.inputGeometries.next();
              for (; t; ) {
                if (
                  ((0, wt.oU)(t)
                    ? this.acceptPolygon && ((this.multiPath = t.rings), (this.isClosed = !0))
                    : (0, wt.l9)(t)
                    ? this.acceptPolyline && ((this.multiPath = t.paths), (this.isClosed = !1))
                    : (0, wt.YX)(t) &&
                      this.acceptPolygon &&
                      ((this.multiPath = Gt(t).rings), (this.isClosed = !0)),
                  this.multiPath)
                ) {
                  (this.pathCount = this.multiPath.length), (this.pathIndex = -1);
                  break;
                }
                t = this.inputGeometries.next();
              }
              if (!this.multiPath) return null;
            }
            for (; this.iteratePath || this.pathIndex < this.pathCount - 1; ) {
              this.iteratePath || this.pathIndex++;
              const t = this.processPath(this.multiPath[this.pathIndex]);
              if (t) return t;
            }
            (this.pathCount = -1), (this.pathIndex = -1), (this.multiPath = null);
          }
        }
      }
      function Gt(t) {
        return {
          rings: [
            [
              [t.xmin, t.ymin],
              [t.xmin, t.ymax],
              [t.xmax, t.ymax],
              [t.xmax, t.ymin],
              [t.xmin, t.ymin],
            ],
          ],
        };
      }
      class Wt {
        static local() {
          return null === Wt.instance && (Wt.instance = new Wt()), Wt.instance;
        }
        execute(t, e, i) {
          return new Bt(t, e, i);
        }
      }
      Wt.instance = null;
      class Bt {
        constructor(t, e, i) {
          (this._inputGeometries = t),
            (this._angleTolerance = void 0 !== e.angleTolerance ? e.angleTolerance : 120),
            (this._maxCosAngle = Math.cos((1 - Math.abs(this._angleTolerance) / 180) * Math.PI));
        }
        next() {
          let t = this._inputGeometries.next();
          for (; t; ) {
            if ((0, wt.oU)(t)) {
              this._isClosed = !0;
              const e = (0, n.d9)(t);
              return this._processMultipath(e.rings), e;
            }
            if ((0, wt.l9)(t)) {
              this._isClosed = !1;
              const e = (0, n.d9)(t);
              return this._processMultipath(e.paths), e;
            }
            if ((0, wt.YX)(t)) {
              if (this._maxCosAngle) return t;
              this._isClosed = !0;
              const e = [
                [t.xmin, t.ymin],
                [t.xmin, t.ymax],
                [t.xmax, t.ymax],
                [t.xmax, t.ymin],
                [t.xmin, t.ymin],
              ];
              return this._processPath(e), { rings: [e] };
            }
            t = this._inputGeometries.next();
          }
          return null;
        }
        _processMultipath(t) {
          if (t) for (const e of t) this._processPath(e);
        }
        _processPath(t) {
          if (t) {
            let e,
              i,
              s,
              r,
              n,
              a,
              o = t.length,
              l = t[0];
            this._isClosed && ++o;
            for (let h = 1; h < o; ++h) {
              let c;
              c = this._isClosed && h === o - 1 ? t[0] : t[h];
              const u = c[0] - l[0],
                f = c[1] - l[1],
                d = Math.sqrt(u * u + f * f);
              h > 1 && d > 0 && s > 0 && (e * u + i * f) / d / s <= this._maxCosAngle && Ot(l, 1),
                1 === h && ((r = u), (n = f), (a = d)),
                d > 0 && ((l = c), (e = u), (i = f), (s = d));
            }
            this._isClosed &&
              s > 0 &&
              a > 0 &&
              (e * r + i * n) / a / s <= this._maxCosAngle &&
              Ot(t[0], 1);
          }
        }
      }
      class Dt {
        constructor() {
          this._path = [];
        }
        path() {
          return this._path;
        }
        addPath(t, e) {
          e || t.reverse(), Array.prototype.push.apply(this._path, t), e || t.reverse();
        }
        static mergePath(t, e) {
          e && Array.prototype.push.apply(t, e);
        }
        startPath(t) {
          this._path.push(t);
        }
        lineTo(t) {
          this._path.push(t);
        }
        close() {
          const t = this._path;
          t.length > 1 &&
            ((t[0][0] === t[t.length - 1][0] && t[0][1] === t[t.length - 1][1]) ||
              t.push([t[0][0], t[0][1]]));
        }
      }
      class Xt {
        constructor(t = 0, e = !1) {}
        normalize(t) {
          const e = Math.sqrt(t[0] * t[0] + t[1] * t[1]);
          (t[0] /= e), (t[1] /= e);
        }
        calculateLength(t, e) {
          const i = e[0] - t[0],
            s = e[1] - t[1];
          return Math.sqrt(i * i + s * s);
        }
        calculateSegLength(t, e) {
          return this.calculateLength(t[e], t[e + 1]);
        }
        calculatePathLength(t) {
          let e = 0;
          const i = t ? t.length : 0;
          for (let s = 0; s < i - 1; ++s) e += this.calculateSegLength(t, s);
          return e;
        }
        calculatePathArea(t) {
          let e = 0;
          const i = t ? t.length : 0;
          for (let s = 0; s < i - 1; ++s) e += (t[s + 1][0] - t[s][0]) * (t[s + 1][1] + t[s][1]);
          return e / 2;
        }
        getCoord2D(t, e, i) {
          return [t[0] + (e[0] - t[0]) * i, t[1] + (e[1] - t[1]) * i];
        }
        getSegCoord2D(t, e, i) {
          return this.getCoord2D(t[e], t[e + 1], i);
        }
        getAngle(t, e, i) {
          const s = e[0] - t[0],
            r = e[1] - t[1];
          return Math.atan2(r, s);
        }
        getSegAngle(t, e, i) {
          return this.getAngle(t[e], t[e + 1], i);
        }
        getAngleCS(t, e, i) {
          const s = e[0] - t[0],
            r = e[1] - t[1],
            n = Math.sqrt(s * s + r * r);
          return n > 0 ? [s / n, r / n] : [1, 0];
        }
        getSegAngleCS(t, e, i) {
          return this.getAngleCS(t[e], t[e + 1], i);
        }
        cut(t, e, i, s) {
          return [
            i <= 0 ? t[e] : this.getSegCoord2D(t, e, i),
            s >= 1 ? t[e + 1] : this.getSegCoord2D(t, e, s),
          ];
        }
        addSegment(t, e, i) {
          i && t.push(e[0]), t.push(e[1]);
        }
        getSubCurve(t, e, i) {
          const s = [];
          return this.appendSubCurve(s, t, e, i) ? s : null;
        }
        appendSubCurve(t, e, i, s) {
          const r = e ? e.length - 1 : 0;
          let n = 0,
            a = !0,
            o = 0;
          for (; o < r; ) {
            const r = this.calculateSegLength(e, o);
            if (0 !== r) {
              if (a) {
                if (n + r > i) {
                  const l = (i - n) / r;
                  let h = 1,
                    c = !1;
                  n + r >= s && ((h = (s - n) / r), (c = !0));
                  const u = this.cut(e, o, l, h);
                  if ((u && this.addSegment(t, u, a), c)) break;
                  a = !1;
                }
              } else {
                if (n + r > s) {
                  const i = this.cut(e, o, 0, (s - n) / r);
                  i && this.addSegment(t, i, a);
                  break;
                }
                this.addSegment(t, [e[o], e[o + 1]], a);
              }
              (n += r), ++o;
            } else ++o;
          }
          return !0;
        }
        getCIMPointAlong(t, e) {
          const i = t ? t.length - 1 : 0;
          let s = 0,
            r = -1;
          for (; r < i; ) {
            ++r;
            const i = this.calculateSegLength(t, r);
            if (0 !== i) {
              if (s + i > e) {
                const n = (e - s) / i;
                return this.getCoord2D(t[r], t[r + 1], n);
              }
              s += i;
            }
          }
          return null;
        }
        isEmpty(t, e) {
          if (!t || t.length <= 1) return !0;
          const i = t ? t.length - 1 : 0;
          let s = -1;
          for (; s < i; ) {
            if ((++s, t[s + 1][0] !== t[s][0] || t[s + 1][1] !== t[s][1])) return !1;
            if (e && t[s + 1][2] !== t[s][2]) return !1;
          }
          return !0;
        }
        offset(t, e, i, s, r) {
          if (!t || t.length < 2) return null;
          let n = t.length;
          const a = t[0][0] === t[n - 1][0] && t[0][1] === t[n - 1][1];
          if (a) {
            if (t.length < 3) return null;
            --n;
          }
          const o = [];
          let l = a ? t[n - 1] : null,
            h = t[0];
          for (let r = 0; r < n; r++) {
            const c = r === n - 1 ? (a ? t[0] : null) : t[r + 1];
            if (l)
              if (c) {
                const t = [c[0] - h[0], c[1] - h[1]];
                this.normalize(t);
                const r = [h[0] - l[0], h[1] - l[1]];
                this.normalize(r);
                const n = r[0] * t[1] - r[1] * t[0],
                  a = r[0] * t[0] + r[1] * t[1];
                if (n >= 0 == e <= 0) {
                  const i = [t[0] - r[0], t[1] - r[1]];
                  this.normalize(i);
                  const s = Math.sqrt((1 + a) / 2),
                    n = -Math.abs(e) / s;
                  o.push([h[0] - i[0] * n, h[1] - i[1] * n]);
                } else
                  switch (i) {
                    case 'Mitered': {
                      const i = Math.sqrt((1 + a) / 2);
                      if (i > 0 && 1 / i < s) {
                        const s = [t[0] - r[0], t[1] - r[1]];
                        this.normalize(s);
                        const n = Math.abs(e) / i;
                        o.push([h[0] - s[0] * n, h[1] - s[1] * n]);
                        break;
                      }
                    }
                    case 'Bevelled':
                      o.push([h[0] + r[1] * e, h[1] - r[0] * e]),
                        o.push([h[0] + t[1] * e, h[1] - t[0] * e]);
                      break;
                    case 'Rounded': {
                      o.push([h[0] + r[1] * e, h[1] - r[0] * e]);
                      const i = 5,
                        s = 1 / i;
                      let n = s;
                      for (let a = 1; a < i; a++, n += s) {
                        const i = [r[1] * (1 - n) + t[1] * n, -r[0] * (1 - n) - t[0] * n];
                        this.normalize(i), o.push([h[0] + i[0] * e, h[1] + i[1] * e]);
                      }
                      o.push([h[0] + t[1] * e, h[1] - t[0] * e]);
                      break;
                    }
                    case 'Square':
                    default:
                      if (n < 0)
                        o.push([h[0] + (r[1] + r[0]) * e, h[1] + (r[1] - r[0]) * e]),
                          o.push([h[0] + (t[1] - t[0]) * e, h[1] - (t[0] + t[1]) * e]);
                      else {
                        const i = Math.sqrt((1 + Math.abs(a)) / 2),
                          s = [t[0] - r[0], t[1] - r[1]];
                        this.normalize(s);
                        const n = e / i;
                        o.push([h[0] - s[0] * n, h[1] - s[1] * n]);
                      }
                  }
              } else {
                const t = [h[0] - l[0], h[1] - l[1]];
                this.normalize(t), o.push([h[0] + t[1] * e, h[1] - t[0] * e]);
              }
            else {
              const t = [c[0] - h[0], c[1] - h[1]];
              this.normalize(t), o.push([h[0] + t[1] * e, h[1] - t[0] * e]);
            }
            (l = h), (h = c);
          }
          return a && o.push([o[0][0], o[0][1]]), o;
        }
      }
      class Yt {
        static local() {
          return null === Yt.instance && (Yt.instance = new Yt()), Yt.instance;
        }
        execute(t, e, i) {
          return new Ht(t, e, i);
        }
      }
      Yt.instance = null;
      class Ht extends Nt {
        constructor(t, e, i) {
          super(t, !1, !0),
            (this._curveHelper = new Xt()),
            (this._width = (void 0 !== e.width ? e.width : 5) * i),
            (this._arrowType =
              void 0 !== e.geometricEffectArrowType ? e.geometricEffectArrowType : 'OpenEnded'),
            (this._offsetFlattenError = 0.03 * i);
        }
        processPath(t) {
          switch (this._arrowType) {
            case 'OpenEnded':
            default:
              return this._constructSimpleArrow(t, !0);
            case 'Block':
              return this._constructSimpleArrow(t, !1);
            case 'Crossed':
              return this._constructCrossedArrow(t);
          }
        }
        _constructSimpleArrow(t, e) {
          const i = this._curveHelper.calculatePathLength(t);
          let s = this._width;
          i < 2 * s && (s = i / 2);
          const r = this._curveHelper.getSubCurve(t, 0, i - s);
          if (!r) return null;
          const n = s / 2;
          if (this._curveHelper.isEmpty(r, !1)) return null;
          const a = this._constructOffset(r, -n);
          if (!a) return null;
          const o = this._constructOffset(r, n);
          if (!o) return null;
          const l = this._constructArrowBasePoint(a, -n / 2);
          if (!l) return null;
          const h = this._constructArrowBasePoint(o, n / 2);
          if (!h) return null;
          const c = t[t.length - 1];
          e || (this._makeControlPoint(o, !0), this._makeControlPoint(a, !0));
          const u = new Dt();
          return (
            u.addPath(o, !0),
            u.lineTo(h),
            this._makeControlPoint(u.path()),
            u.lineTo(c),
            this._makeControlPoint(u.path()),
            u.lineTo(l),
            this._makeControlPoint(u.path()),
            u.addPath(a, !1),
            e ? { paths: [u.path()] } : (u.close(), { rings: [u.path()] })
          );
        }
        _constructCrossedArrow(t) {
          const e = this._curveHelper.calculatePathLength(t);
          let i = this._width;
          e < 3.732050807568877 * i && (i = e / 3.732050807568877);
          const s = this._curveHelper.getSubCurve(t, 0, e - 2.732050807568877 * i);
          if (!s) return null;
          const r = i / 2;
          if (this._curveHelper.isEmpty(s, !1)) return null;
          const n = this._constructOffset(s, r);
          if (!n) return null;
          const a = this._constructOffset(s, -r);
          if (!a) return null;
          const o = this._curveHelper.getSubCurve(t, 0, e - i);
          if (!o) return null;
          if (this._curveHelper.isEmpty(o, !1)) return null;
          const l = this._constructOffset(o, r);
          if (!l) return null;
          const h = this._constructOffset(o, -r);
          if (!h) return null;
          const c = l[l.length - 1],
            u = this._constructArrowBasePoint(l, r / 2);
          if (!u) return null;
          const f = h[h.length - 1],
            d = this._constructArrowBasePoint(h, -r / 2);
          if (!d) return null;
          const _ = t[t.length - 1];
          this._makeControlPoint(n, !1), this._makeControlPoint(a, !1);
          const m = new Dt();
          return (
            m.addPath(n, !0),
            this._makeControlPoint(m.path()),
            m.lineTo(f),
            m.lineTo(d),
            this._makeControlPoint(m.path()),
            m.lineTo(_),
            this._makeControlPoint(m.path()),
            m.lineTo(u),
            this._makeControlPoint(m.path()),
            m.lineTo(c),
            this._makeControlPoint(m.path()),
            m.addPath(a, !1),
            { paths: [m.path()] }
          );
        }
        _constructOffset(t, e) {
          return this._curveHelper.offset(t, e, 'Rounded', 4, this._offsetFlattenError);
        }
        _constructArrowBasePoint(t, e) {
          if (!t || t.length < 2) return null;
          const i = t[t.length - 2],
            s = t[t.length - 1],
            r = [s[0] - i[0], s[1] - i[1]];
          return this._curveHelper.normalize(r), [s[0] + r[1] * e, s[1] - r[0] * e];
        }
        _makeControlPoint(t, e = !1) {
          Ot(e ? t[0] : t[t.length - 1], 1);
        }
      }
      class Ut {
        static local() {
          return null === Ut.instance && (Ut.instance = new Ut()), Ut.instance;
        }
        execute(t, e, i) {
          return new Zt(t, e, i);
        }
      }
      Ut.instance = null;
      class Zt {
        constructor(t, e, i) {
          (this._inputGeometries = t),
            (this._curveHelper = new Xt()),
            (this._size = (void 0 !== e.size ? e.size : 1) * i),
            (this._offsetFlattenError = 0.03 * i);
        }
        next() {
          let t = this._inputGeometries.next();
          for (; t; ) {
            if ((0, wt.YX)(t))
              if (this._size > 0) {
                const e = [
                    [t.xmin, t.ymin],
                    [t.xmin, t.ymax],
                    [t.xmax, t.ymax],
                    [t.xmax, t.ymin],
                    [t.xmin, t.ymin],
                  ],
                  i = this._curveHelper.offset(
                    e,
                    this._size,
                    'Rounded',
                    4,
                    this._offsetFlattenError,
                  );
                if (i) return { rings: [i] };
              } else {
                if (!(this._size < 0)) return t;
                if (Math.min(t.xmax - t.xmin, t.ymax - t.ymin) + 2 * this._size > 0)
                  return {
                    xmin: t.xmin - this._size,
                    xmax: t.xmax + this._size,
                    ymin: t.ymin - this._size,
                    ymax: t.ymax + this._size,
                  };
              }
            if ((0, wt.oU)(t)) {
              if (0 === this._size) return t;
              const e = [];
              for (const i of t.rings) {
                const t = this._curveHelper.offset(
                  i,
                  this._size,
                  'Rounded',
                  4,
                  this._offsetFlattenError,
                );
                t && e.push(t);
              }
              if (e.length) return { rings: e };
            }
            if ((0, wt.l9)(t) && this._size > 0) {
              const e = [];
              for (const i of t.paths)
                if (i && i.length > 1) {
                  const t = this._curveHelper.offset(
                      i,
                      this._size,
                      'Rounded',
                      4,
                      this._offsetFlattenError,
                    ),
                    s = this._curveHelper.offset(
                      i,
                      -this._size,
                      'Rounded',
                      4,
                      this._offsetFlattenError,
                    );
                  if (t && s) {
                    for (let e = s.length - 1; e >= 0; e--) t.push(s[e]);
                    t.push([t[0][0], t[0][1]]), e.push(t);
                  }
                }
              if (e.length) return { rings: e };
            }
            (0, wt.wp)(t) && this._size, (t = this._inputGeometries.next());
          }
          return null;
        }
      }
      class Kt {
        static local() {
          return null === Kt.instance && (Kt.instance = new Kt()), Kt.instance;
        }
        execute(t, e, i) {
          return new qt(t, e, i);
        }
      }
      Kt.instance = null;
      class qt extends Nt {
        constructor(t, e, i) {
          super(t, !0, !0),
            (this._curveHelper = new Xt()),
            (this._beginCut = (void 0 !== e.beginCut ? e.beginCut : 1) * i),
            (this._endCut = (void 0 !== e.endCut ? e.endCut : 1) * i),
            (this._middleCut = (void 0 !== e.middleCut ? e.middleCut : 0) * i),
            (this._invert = void 0 !== e.invert && e.invert),
            this._beginCut < 0 && (this._beginCut = 0),
            this._endCut < 0 && (this._endCut = 0),
            this._middleCut < 0 && (this._middleCut = 0);
        }
        processPath(t) {
          const e = this._beginCut,
            i = this._endCut,
            s = this._middleCut,
            r = this._curveHelper.calculatePathLength(t),
            n = [];
          if (this._invert)
            if (0 === e && 0 === i && 0 === s);
            else if (e + i + s >= r) n.push(t);
            else {
              let a = this._curveHelper.getSubCurve(t, 0, e);
              a && n.push(a),
                (a = this._curveHelper.getSubCurve(t, 0.5 * (r - s), 0.5 * (r + s))),
                a && n.push(a),
                (a = this._curveHelper.getSubCurve(t, r - i, i)),
                a && n.push(a);
            }
          else if (0 === e && 0 === i && 0 === s) n.push(t);
          else if (e + i + s >= r);
          else if (0 === s) {
            const s = this._curveHelper.getSubCurve(t, e, r - i);
            s && n.push(s);
          } else {
            let a = this._curveHelper.getSubCurve(t, e, 0.5 * (r - s));
            a && n.push(a),
              (a = this._curveHelper.getSubCurve(t, 0.5 * (r + s), r - i)),
              a && n.push(a);
          }
          return 0 === n.length ? null : { paths: n };
        }
      }
      class Jt {
        constructor() {
          (this._values = []),
            (this.extPtGap = 0),
            (this.ctrlPtGap = 0),
            (this._length = 0),
            (this._currentValue = 0);
        }
        isEmpty() {
          return 0 === this._values.length;
        }
        size() {
          return this._values.length;
        }
        init(t, e, i = !0) {
          if ((this._setEmpty(), !t || 0 === t.length)) return !1;
          for (let e = 0; e < t.length; e++) {
            let s = Math.abs(t[e]);
            i && s < 1e-7 && (s = 1e-7), this._values.push(s), (this._length += s);
          }
          return (
            e && 1 & t.length && (this._length *= 2),
            0 !== this._length &&
              ((this.ctrlPtGap = this.extPtGap = 0), (this._currentValue = -1), !0)
          );
        }
        scale(t) {
          const e = this._values ? this._values.length : 0;
          for (let i = 0; i < e; ++i) this._values[i] *= t;
          (this._length *= t), (this.extPtGap *= t), (this.ctrlPtGap *= t);
        }
        addValue(t) {
          (this._length += t), this._values.push(t);
        }
        firstValue() {
          return this._values[0];
        }
        lastValue() {
          return this._values[this._values.length - 1];
        }
        nextValue() {
          return (
            this._currentValue++,
            this._currentValue === this._values.length && (this._currentValue = 0),
            this._values[this._currentValue]
          );
        }
        reset() {
          this._currentValue = -1;
        }
        length() {
          return this._length;
        }
        _setEmpty() {
          (this.extPtGap = this.ctrlPtGap = this._length = 0),
            (this._currentValue = -1),
            (this._values.length = 0);
        }
      }
      class $t {
        constructor() {
          this.reset();
        }
        reset() {
          (this.segment = -1),
            (this.segmentLength = 0),
            (this.abscissa = 0),
            (this.isPathEnd = !1),
            (this.isPartEnd = !1);
        }
        isValid() {
          return -1 !== this.segment;
        }
        copyTo(t) {
          (t.segment = this.segment),
            (t.segmentLength = this.segmentLength),
            (t.abscissa = this.abscissa),
            (t.isPathEnd = this.isPathEnd),
            (t.isPartEnd = this.isPartEnd);
        }
      }
      class jt extends Xt {
        constructor(t = 0, e = !1) {
          super(t, e), (this._tolerance = 0.03), (this._currentPosition = new $t());
        }
        updateTolerance(t) {
          this._tolerance = 0.03 * t;
        }
        init(t, e, i = !0) {
          return (
            i
              ? ((this._patternLength = e.length()),
                (this._partExtPtGap = e.extPtGap),
                (this._partCtrlPtGap = e.ctrlPtGap))
              : ((this._patternLength = 0), (this._partExtPtGap = 0), (this._partCtrlPtGap = 0)),
            this._currentPosition.reset(),
            (this._partSegCount = 0),
            (this._path = t),
            (this._seg = -1),
            this.setPosAtNextPart()
          );
        }
        curPositionIsValid() {
          return this._currentPosition.isValid();
        }
        nextPosition(t, e = 0) {
          const i = new $t();
          return !!this._nextPosition(t, i, null, e) && (i.copyTo(this._currentPosition), !0);
        }
        curPointAndAngle(t) {
          t.pt = this._getPoint(this._currentPosition);
          const [e, i] = this._getAngle(this._currentPosition);
          (t.ca = e), (t.sa = i);
        }
        nextPointAndAngle(t, e, i = 0) {
          const s = new $t();
          if (!this._nextPosition(t, s, null, i)) return !1;
          s.copyTo(this._currentPosition), (e.pt = this._getPoint(s));
          const [r, n] = this._getAngle(s);
          return (e.ca = r), (e.sa = n), !0;
        }
        nextCurve(t) {
          if (0 === t) return null;
          const e = [],
            i = new $t();
          return this._nextPosition(t, i, e, 1) ? (i.copyTo(this._currentPosition), e) : null;
        }
        isPathEnd() {
          return this._currentPosition.isPathEnd;
        }
        getPathEnd() {
          if (-1 === this._currentPosition.segment) throw new Error('missing segment');
          return this._path[this._currentPosition.segment + 1];
        }
        _nextPosition(t, e, i, s) {
          if (this._currentPosition.isPathEnd) return !1;
          let r = this._currentPosition.abscissa;
          for (
            this._currentPosition.segmentLength > 0 && (r /= this._currentPosition.segmentLength),
              this._currentPosition.copyTo(e);
            e.abscissa + t * this._partLengthRatio > e.segmentLength + this._tolerance;

          ) {
            if (i) {
              if (0 === i.length)
                if (0 === r) {
                  const t = this._path[e.segment];
                  i.push([t[0], t[1]]);
                } else i.push(this.getSegCoord2D(this._path, e.segment, r));
              const t = this._path[e.segment + 1];
              i.push([t[0], t[1]]);
            }
            if (
              ((r = 0),
              (t -= (e.segmentLength - e.abscissa) / this._partLengthRatio),
              this._partSegCount)
            )
              (e.segment = this.nextSegment()),
                (e.segmentLength = this.calculateSegLength(this._path, e.segment)),
                (e.abscissa = 0),
                this._partSegCount--;
            else {
              if (!this.setPosAtNextPart())
                return (
                  0 !== s &&
                  ((e.segmentLength = this.calculateSegLength(this._path, e.segment)),
                  (e.isPartEnd = !0),
                  1 === s
                    ? ((e.abscissa = e.segmentLength), (e.isPathEnd = !0))
                    : (e.abscissa = e.segmentLength + t),
                  !0)
                );
              this._currentPosition.copyTo(e);
            }
          }
          if (((e.abscissa += t * this._partLengthRatio), i)) {
            if (0 === i.length)
              if (0 === r) {
                const t = this._path[e.segment];
                i.push([t[0], t[1]]);
              } else i.push(this.getSegCoord2D(this._path, e.segment, r));
            const t = e.abscissa / e.segmentLength;
            if (1 === t) {
              const t = this._path[e.segment + 1];
              i.push([t[0], t[1]]);
            } else i.push(this.getSegCoord2D(this._path, e.segment, t));
          }
          return (
            this._partSegCount ||
              (Math.abs(e.abscissa - e.segmentLength) < this._tolerance &&
                ((e.isPathEnd = this._partIsLast), (e.isPartEnd = !0))),
            !0
          );
        }
        _getPoint(t) {
          if (-1 === t.segment) throw new Error('missing segment');
          const e = t.segmentLength <= 0 ? 0 : t.abscissa / t.segmentLength;
          return this.getSegCoord2D(this._path, t.segment, e);
        }
        _getAngle(t) {
          if (-1 === t.segment) throw new Error('missing segment');
          const e = t.segmentLength <= 0 ? 0 : t.abscissa / t.segmentLength;
          return this.getSegAngleCS(this._path, t.segment, e);
        }
        setPosAtNextPart() {
          for (; this._partSegCount; )
            this.hasNextSegment() && this.nextSegment(), this._partSegCount--;
          if (!this.hasNextSegment()) return !1;
          for (
            this._partLength = 0, this._partIsLast = !0, this._partSegCount = 0;
            this.hasNextSegment();

          )
            if (
              ((this._partLength += this.calculateSegLength(this._path, this.nextSegment())),
              this._partSegCount++,
              1 === At(this._path[this.getEndPointIndex()]))
            ) {
              this._partIsLast = !this.hasNextSegment();
              break;
            }
          let t = this._partSegCount;
          for (; t; ) this.previousSegment(), --t;
          (this._currentPosition.segment = this.nextSegment()),
            (this._currentPosition.segmentLength = this.calculateSegLength(
              this._path,
              this._currentPosition.segment,
            )),
            (this._currentPosition.abscissa = 0),
            (this._currentPosition.isPathEnd = this._currentPosition.isPartEnd = !1),
            --this._partSegCount;
          const e = this.getStartPointIndex();
          this._ctrlPtBegin = 1 === At(this._path[e]);
          let i = e + this._partSegCount + 1;
          if (
            (i >= this._path.length && (i = 0),
            (this._ctrlPtEnd = 1 === At(this._path[i])),
            this._patternLength > 0)
          ) {
            const t = this._ctrlPtBegin ? this._partCtrlPtGap : this._partExtPtGap,
              e = this._ctrlPtEnd ? this._partCtrlPtGap : this._partExtPtGap;
            let i = Math.round((this._partLength - (t + e)) / this._patternLength);
            i <= 0 && (i = t + e > 0 ? 0 : 1),
              (this._partLengthRatio = this._partLength / (t + e + i * this._patternLength)),
              this._partLengthRatio < 0.01 && (this._partLengthRatio = 1);
          } else this._partLengthRatio = 1;
          return !0;
        }
        hasNextSegment() {
          return this._seg < this._path.length - 2;
        }
        previousSegment() {
          return --this._seg;
        }
        nextSegment() {
          return ++this._seg;
        }
        getStartPointIndex() {
          return this._seg;
        }
        getEndPointIndex() {
          return this._seg + 1;
        }
      }
      class Qt {
        static local() {
          return null === Qt.instance && (Qt.instance = new Qt()), Qt.instance;
        }
        execute(t, e, i) {
          return new te(t, e, i);
        }
      }
      Qt.instance = null;
      class te extends Nt {
        constructor(t, e, i) {
          super(t, !0, !0),
            (this._walker = new jt()),
            this._walker.updateTolerance(i),
            (this._endings = e.lineDashEnding),
            (this._customDashPos = void 0 !== e.offsetAlongLine ? e.offsetAlongLine * i : 0),
            (this._offsetAtEnd = void 0 !== e.customEndingOffset ? e.customEndingOffset * i : 0),
            (this._pattern = new Jt()),
            this._pattern.init(e.dashTemplate, !0),
            this._pattern.scale(i);
        }
        processPath(t) {
          if (0 === this._pattern.length()) return (this.iteratePath = !1), { paths: [t] };
          if (!this.iteratePath) {
            let e = !0;
            switch (this._endings) {
              case 'HalfPattern':
              case 'HalfGap':
              default:
                this._pattern.extPtGap = 0;
                break;
              case 'FullPattern':
                this.isClosed || (this._pattern.extPtGap = 0.5 * this._pattern.firstValue());
                break;
              case 'FullGap':
                this.isClosed || (this._pattern.extPtGap = 0.5 * this._pattern.lastValue());
                break;
              case 'NoConstraint':
                this.isClosed || (e = !1);
                break;
              case 'Custom':
                this.isClosed || (this._pattern.extPtGap = 0.5 * this._offsetAtEnd);
            }
            const i = this._walker.calculatePathLength(t);
            if (this._pattern.isEmpty() || i < 0.1 * this._pattern.length()) return { paths: [t] };
            if (!this._walker.init(t, this._pattern, e)) return { paths: [t] };
          }
          let e;
          if (this.iteratePath) e = this._pattern.nextValue();
          else {
            let t;
            switch (this._endings) {
              case 'HalfPattern':
              default:
                t = 0.5 * this._pattern.firstValue();
                break;
              case 'HalfGap':
                t = 0.5 * -this._pattern.lastValue();
                break;
              case 'FullGap':
                t = -this._pattern.lastValue();
                break;
              case 'FullPattern':
                t = 0;
                break;
              case 'NoConstraint':
              case 'Custom':
                t = -this._customDashPos;
            }
            let i = t / this._pattern.length();
            (i -= Math.floor(i)),
              (t = i * this._pattern.length()),
              this._pattern.reset(),
              (e = this._pattern.nextValue());
            let s = !1;
            for (; t >= e; ) (t -= e), (e = this._pattern.nextValue()), (s = !s);
            (e -= t),
              s
                ? (this._walker.nextPosition(e), (e = this._pattern.nextValue()))
                : this.isClosed &&
                  ((this._firstCurve = this._walker.nextCurve(e)),
                  (e = this._pattern.nextValue()),
                  this._walker.nextPosition(e),
                  (e = this._pattern.nextValue()));
          }
          let i = this._walker.nextCurve(e);
          return (
            i
              ? this._walker.isPathEnd()
                ? ((this.iteratePath = !1),
                  this._firstCurve &&
                    (this._firstCurve.splice(0, 1),
                    Dt.mergePath(i, this._firstCurve),
                    (this._firstCurve = null)))
                : ((e = this._pattern.nextValue()),
                  !this._walker.nextPosition(e) || this._walker.isPathEnd()
                    ? ((this.iteratePath = !1),
                      this._firstCurve && ((i = this._firstCurve), (this._firstCurve = null)))
                    : (this.iteratePath = !0))
              : ((this.iteratePath = !1), (i = this._firstCurve), (this._firstCurve = null)),
            { paths: [i] }
          );
        }
      }
      class ee {
        static local() {
          return null === ee.instance && (ee.instance = new ee()), ee.instance;
        }
        execute(t, e, i) {
          return new ie(t, e, i);
        }
      }
      ee.instance = null;
      class ie {
        constructor(t, e, i) {
          switch (
            ((this._inputGeometries = t),
            (this._curveHelper = new Xt()),
            (this._width = (void 0 !== e.width ? e.width : 2) * i),
            e.method)
          ) {
            case 'Mitered':
            default:
              this._method = 'Mitered';
              break;
            case 'Bevelled':
              this._method = 'Bevelled';
              break;
            case 'Rounded':
            case 'TrueBuffer':
              this._method = 'Rounded';
              break;
            case 'Square':
              this._method = 'Square';
          }
          (this._option = e.option), (this._offsetFlattenError = 0.03 * i);
        }
        next() {
          let t = this._inputGeometries.next();
          for (; t; ) {
            if ((0, wt.YX)(t) && this._width > 0) {
              if (Math.min(t.xmax - t.xmin, t.ymax - t.ymin) - 2 * this._width < 0) return t;
              const e = [];
              return (
                e.push([
                  [t.xmin, t.ymin],
                  [t.xmin, t.ymax],
                  [t.xmax, t.ymax],
                  [t.xmax, t.ymin],
                  [t.xmin, t.ymin],
                ]),
                e.push([
                  [t.xmin + this._width, t.ymin + this._width],
                  [t.xmax - this._width, t.ymin + this._width],
                  [t.xmax - this._width, t.ymax - this._width],
                  [t.xmin + this._width, t.ymax - this._width],
                  [t.xmin + this._width, t.ymin + this._width],
                ]),
                { rings: e }
              );
            }
            if ((0, wt.oU)(t) && this._width > 0) {
              const e = [];
              for (const i of t.rings) {
                const t = this._curveHelper.calculatePathLength(i),
                  s = this._curveHelper.offset(
                    i,
                    this._width,
                    this._method,
                    4,
                    this._offsetFlattenError,
                  );
                s && (t < 0 && s.reverse(), e.push(s));
              }
              if (e.length) return { rings: e };
            }
            t = this._inputGeometries.next();
          }
          return null;
        }
      }
      class se {
        static local() {
          return null === se.instance && (se.instance = new se()), se.instance;
        }
        execute(t, e, i) {
          return new re(t, e, i);
        }
      }
      se.instance = null;
      class re extends Nt {
        constructor(t, e, i) {
          super(t, !1, !0),
            (this._curveHelper = new Xt()),
            (this._length = (void 0 !== e.length ? e.length : 20) * i),
            (this._angle = void 0 !== e.angle ? e.angle : 225),
            (this._position = void 0 !== e.position ? e.position : 50),
            this._length < 0 && (this._length = -this._length),
            this._position < 20 && (this._position = 20),
            this._position > 80 && (this._position = 80),
            (this._mirror = !1);
        }
        processPath(t) {
          if (this._curveHelper.isEmpty(t, !1)) return null;
          const e = t[0],
            i = t[t.length - 1],
            s = [i[0] - e[0], i[1] - e[1]];
          this._curveHelper.normalize(s);
          const r = [
              e[0] + ((i[0] - e[0]) * this._position) / 100,
              e[1] + ((i[1] - e[1]) * this._position) / 100,
            ],
            n = Math.cos(((90 - this._angle) / 180) * Math.PI);
          let a = Math.sin(((90 - this._angle) / 180) * Math.PI);
          return (
            this._mirror && (a = -a),
            (this._mirror = !this._mirror),
            {
              paths: [
                [
                  e,
                  [r[0] - (this._length / 2) * n, r[1] - (this._length / 2) * a],
                  [r[0] + (this._length / 2) * n, r[1] + (this._length / 2) * a],
                  i,
                ],
              ],
            }
          );
        }
      }
      class ne {
        static local() {
          return null === ne.instance && (ne.instance = new ne()), ne.instance;
        }
        execute(t, e, i) {
          return new ae(t, e, i);
        }
      }
      ne.instance = null;
      class ae {
        constructor(t, e, i) {
          (this._inputGeometries = t),
            (this._offsetX = void 0 !== e.offsetX ? e.offsetX * i : 0),
            (this._offsetY = void 0 !== e.offsetY ? -e.offsetY * i : 0);
        }
        next() {
          let t = this._inputGeometries.next();
          for (; t; ) {
            if ((0, wt.YX)(t))
              return {
                xmin: t.xmin + this._offsetX,
                xmax: t.xmax + this._offsetX,
                ymin: t.ymin + this._offsetY,
                ymax: t.ymax + this._offsetY,
              };
            if ((0, wt.oU)(t)) {
              const e = (0, n.d9)(t);
              return this._moveMultipath(e.rings, this._offsetX, this._offsetY), e;
            }
            if ((0, wt.l9)(t)) {
              const e = (0, n.d9)(t);
              return this._moveMultipath(e.paths, this._offsetX, this._offsetY), e;
            }
            if ((0, wt.aW)(t)) {
              const e = (0, n.d9)(t);
              return this._movePath(e.points, this._offsetX, this._offsetY), e;
            }
            if ((0, wt.wp)(t)) return { x: t.x + this._offsetX, y: t.y + this._offsetY };
            t = this._inputGeometries.next();
          }
          return null;
        }
        _moveMultipath(t, e, i) {
          if (t) for (const s of t) this._movePath(s, e, i);
        }
        _movePath(t, e, i) {
          if (t) for (const s of t) (s[0] += e), (s[1] += i);
        }
      }
      class oe {
        static local() {
          return null === oe.instance && (oe.instance = new oe()), oe.instance;
        }
        execute(t, e, i) {
          return new le(t, e, i);
        }
      }
      oe.instance = null;
      class le {
        constructor(t, e, i) {
          (this._inputGeometries = t),
            (this._curveHelper = new Xt()),
            (this._offset = (void 0 !== e.offset ? e.offset : 1) * i),
            (this._method = e.method),
            (this._option = e.option),
            (this._offsetFlattenError = 0.03 * i);
        }
        next() {
          let t = this._inputGeometries.next();
          for (; t; ) {
            if (0 === this._offset) return t;
            if ((0, wt.YX)(t)) {
              if ('Rounded' === this._method && this._offset > 0) {
                const e = [
                    [t.xmin, t.ymin],
                    [t.xmin, t.ymax],
                    [t.xmax, t.ymax],
                    [t.xmax, t.ymin],
                    [t.xmin, t.ymin],
                  ],
                  i = this._curveHelper.offset(
                    e,
                    this._offset,
                    this._method,
                    4,
                    this._offsetFlattenError,
                  );
                return i ? { rings: [i] } : null;
              }
              if (Math.min(t.xmax - t.xmin, t.ymax - t.ymin) + 2 * this._offset > 0)
                return {
                  xmin: t.xmin - this._offset,
                  xmax: t.xmax + this._offset,
                  ymin: t.ymin - this._offset,
                  ymax: t.ymax + this._offset,
                };
            }
            if ((0, wt.oU)(t)) {
              const e = [];
              for (const i of t.rings) {
                const t = this._curveHelper.offset(
                  i,
                  this._offset,
                  this._method,
                  4,
                  this._offsetFlattenError,
                );
                t && e.push(t);
              }
              if (e.length) return { rings: e };
            }
            if ((0, wt.l9)(t)) {
              const e = [];
              for (const i of t.paths) {
                const t = this._curveHelper.offset(
                  i,
                  this._offset,
                  this._method,
                  4,
                  this._offsetFlattenError,
                );
                t && e.push(t);
              }
              if (e.length) return { paths: e };
            }
            t = this._inputGeometries.next();
          }
          return null;
        }
      }
      class he {
        static local() {
          return null === he.instance && (he.instance = new he()), he.instance;
        }
        execute(t, e, i) {
          return new ce(t, e, i);
        }
      }
      he.instance = null;
      class ce {
        constructor(t, e, i) {
          (this._inputGeometries = t), (this._reverse = void 0 === e.reverse || e.reverse);
        }
        next() {
          let t = this._inputGeometries.next();
          for (; t; ) {
            if (!this._reverse) return t;
            if ((0, wt.l9)(t)) {
              const e = (0, n.d9)(t);
              return zt(e.paths), e;
            }
            t = this._inputGeometries.next();
          }
          return null;
        }
      }
      class ue {
        static local() {
          return null === ue.instance && (ue.instance = new ue()), ue.instance;
        }
        execute(t, e, i) {
          return new fe(t, e, i);
        }
      }
      ue.instance = null;
      class fe {
        constructor(t, e, i) {
          (this._inputGeometries = t),
            (this._rotateAngle = void 0 !== e.angle ? (-e.angle * Math.PI) / 180 : 0);
        }
        next() {
          let t = this._inputGeometries.next();
          for (; t; ) {
            if (0 === this._rotateAngle) return t;
            const e = (0, St.a)();
            (0, bt.d)(e, t);
            const i = (e[2] + e[0]) / 2,
              s = (e[3] + e[1]) / 2;
            if ((0, wt.YX)(t)) {
              const e = {
                rings: [
                  [
                    [t.xmin, t.ymin],
                    [t.xmin, t.ymax],
                    [t.xmax, t.ymax],
                    [t.xmax, t.ymin],
                    [t.xmin, t.ymin],
                  ],
                ],
              };
              return this._rotateMultipath(e.rings, i, s), e;
            }
            if ((0, wt.oU)(t)) {
              const e = (0, n.d9)(t);
              return this._rotateMultipath(e.rings, i, s), e;
            }
            if ((0, wt.l9)(t)) {
              const e = (0, n.d9)(t);
              return this._rotateMultipath(e.paths, i, s), e;
            }
            if ((0, wt.aW)(t)) {
              const e = (0, n.d9)(t);
              return this._rotatePath(e.points, i, s), e;
            }
            if ((0, wt.wp)(t)) return t;
            t = this._inputGeometries.next();
          }
          return null;
        }
        _rotateMultipath(t, e, i) {
          if (t) for (const s of t) this._rotatePath(s, e, i);
        }
        _rotatePath(t, e, i) {
          if (t) {
            const s = Math.cos(this._rotateAngle),
              r = Math.sin(this._rotateAngle);
            for (const n of t) {
              const t = n[0] - e,
                a = n[1] - i;
              (n[0] = e + t * s - a * r), (n[1] = i + t * r + a * s);
            }
          }
        }
      }
      class de {
        static local() {
          return null === de.instance && (de.instance = new de()), de.instance;
        }
        execute(t, e, i) {
          return new _e(t, e, i);
        }
      }
      de.instance = null;
      class _e {
        constructor(t, e, i) {
          (this._inputGeometries = t),
            (this._xFactor = void 0 !== e.xScaleFactor ? e.xScaleFactor : 1.15),
            (this._yFactor = void 0 !== e.yScaleFactor ? e.yScaleFactor : 1.15);
        }
        next() {
          let t = this._inputGeometries.next();
          for (; t; ) {
            if (1 === this._xFactor && 1 === this._yFactor) return t;
            const e = (0, St.a)();
            (0, bt.d)(e, t);
            const i = (e[2] + e[0]) / 2,
              s = (e[3] + e[1]) / 2;
            if ((0, wt.YX)(t)) {
              const e = {
                rings: [
                  [
                    [t.xmin, t.ymin],
                    [t.xmin, t.ymax],
                    [t.xmax, t.ymax],
                    [t.xmax, t.ymin],
                    [t.xmin, t.ymin],
                  ],
                ],
              };
              return this._scaleMultipath(e.rings, i, s), e;
            }
            if ((0, wt.oU)(t)) {
              const e = (0, n.d9)(t);
              return this._scaleMultipath(e.rings, i, s), e;
            }
            if ((0, wt.l9)(t)) {
              const e = (0, n.d9)(t);
              return this._scaleMultipath(e.paths, i, s), e;
            }
            if ((0, wt.aW)(t)) {
              const e = (0, n.d9)(t);
              return this._scalePath(e.points, i, s), e;
            }
            if ((0, wt.wp)(t)) return t;
            t = this._inputGeometries.next();
          }
          return null;
        }
        _scaleMultipath(t, e, i) {
          if (t) for (const s of t) this._scalePath(s, e, i);
        }
        _scalePath(t, e, i) {
          if (t)
            for (const s of t) {
              const t = (s[0] - e) * this._xFactor,
                r = (s[1] - i) * this._yFactor;
              (s[0] = e + t), (s[1] = i + r);
            }
        }
      }
      class me {
        static local() {
          return null === me.instance && (me.instance = new me()), me.instance;
        }
        execute(t, e, i) {
          return new pe(t, e, i);
        }
      }
      me.instance = null;
      class pe {
        constructor(t, e, i) {
          (this._inputGeometries = t),
            (this._height = (void 0 !== e.amplitude ? e.amplitude : 2) * i),
            (this._period = (void 0 !== e.period ? e.period : 3) * i),
            (this._style = e.waveform),
            this._height <= 0 && (this._height = Math.abs(this._height)),
            this._period <= 0 && (this._period = Math.abs(this._period)),
            (this._pattern = new Jt()),
            this._pattern.addValue(this._period),
            this._pattern.addValue(this._period),
            (this._walker = new jt()),
            this._walker.updateTolerance(i);
        }
        next() {
          let t = this._inputGeometries.next();
          for (; t; ) {
            if (0 === this._height || 0 === this._period) return t;
            if ((0, wt.l9)(t)) {
              const e = this._processGeom(t.paths);
              if (e.length) return { paths: e };
            }
            if ((0, wt.oU)(t)) {
              const e = this._processGeom(t.rings);
              if (e.length) return { rings: e };
            }
            t = this._inputGeometries.next();
          }
          return null;
        }
        _processGeom(t) {
          const e = [];
          for (const i of t)
            if (this._walker.init(i, this._pattern))
              switch (this._style) {
                case 'Sinus':
                default:
                  e.push(this._constructCurve(i, !1));
                  break;
                case 'Square':
                  e.push(this._constructSquare(i));
                  break;
                case 'Triangle':
                  e.push(this._constructTriangle(i));
                  break;
                case 'Random':
                  e.push(this._constructCurve(i, !0));
              }
            else e.push(i);
          return e;
        }
        _constructCurve(t, e) {
          const i = new Dt(),
            s = this._walker.calculatePathLength(t);
          let r = Math.round(s / this._period);
          0 === r && (r = 1);
          const n = 16 * r + 1,
            a = s / r,
            o = this._period / 16,
            l = 1 / n,
            h = (2 * Math.PI * s) / a,
            c = 2 * Math.PI * Math.random(),
            u = 2 * Math.PI * Math.random(),
            f = 2 * Math.PI * Math.random(),
            d = 0.75 - Math.random() / 2,
            _ = 0.75 - Math.random() / 2,
            m = {};
          this._walker.curPointAndAngle(m), i.startPath(m.pt);
          let p = 0;
          for (;;) {
            if (!this._walker.nextPointAndAngle(o, m)) {
              i.lineTo(t[t.length - 1]);
              break;
            }
            {
              const t = p;
              let s;
              if (((p += l), e)) {
                const e = (this._height / 2) * (1 + 0.3 * Math.sin(d * h * t + c));
                (s = e * Math.sin(h * t + u)), (s += e * Math.sin(_ * h * t + f)), (s /= 2);
              } else s = 0.5 * this._height * Math.sin(0.5 * h * t);
              i.lineTo([m.pt[0] - s * m.sa, m.pt[1] + s * m.ca]);
            }
          }
          return i.path();
        }
        _constructSquare(t) {
          const e = new Dt(),
            i = this._walker.calculatePathLength(t);
          Math.round(i / this._period);
          let s = !0;
          for (;;) {
            let t = !1;
            if (this._walker.curPositionIsValid()) {
              const i = {};
              this._walker.curPointAndAngle(i);
              const r = {};
              if (this._walker.nextPointAndAngle(this._period, r)) {
                const n = {};
                this._walker.nextPointAndAngle(this._period, n) &&
                  (s ? (e.startPath(i.pt), (s = !1)) : e.lineTo(i.pt),
                  e.lineTo([
                    i.pt[0] - (this._height / 2) * i.sa,
                    i.pt[1] + (this._height / 2) * i.ca,
                  ]),
                  e.lineTo([
                    r.pt[0] - (this._height / 2) * r.sa,
                    r.pt[1] + (this._height / 2) * r.ca,
                  ]),
                  e.lineTo([
                    r.pt[0] + (this._height / 2) * r.sa,
                    r.pt[1] - (this._height / 2) * r.ca,
                  ]),
                  e.lineTo([
                    n.pt[0] + (this._height / 2) * n.sa,
                    n.pt[1] - (this._height / 2) * n.ca,
                  ]),
                  (t = !0));
              }
            }
            if (!t) {
              e.lineTo(this._walker.getPathEnd());
              break;
            }
          }
          return e.path();
        }
        _constructTriangle(t) {
          const e = new Dt(),
            i = this._walker.calculatePathLength(t);
          Math.round(i / this._period);
          let s = !0;
          for (;;) {
            let t = !1;
            if (this._walker.curPositionIsValid()) {
              const i = {};
              this._walker.curPointAndAngle(i);
              const r = {};
              if (this._walker.nextPointAndAngle(this._period / 2, r)) {
                const n = {};
                this._walker.nextPointAndAngle(this._period, n) &&
                  (this._walker.nextPosition(this._period / 2) &&
                    (s ? (e.startPath(i.pt), (s = !1)) : e.lineTo(i.pt),
                    e.lineTo([
                      r.pt[0] - (this._height / 2) * r.sa,
                      r.pt[1] + (this._height / 2) * r.ca,
                    ]),
                    e.lineTo([
                      n.pt[0] + (this._height / 2) * n.sa,
                      n.pt[1] - (this._height / 2) * n.ca,
                    ])),
                  (t = !0));
              }
            }
            if (!t) {
              e.lineTo(this._walker.getPathEnd());
              break;
            }
          }
          return e.path();
        }
      }
      !(function (t) {
        (t.NoConstraint = 'NoConstraint'),
          (t.WithMarkers = 'WithMarkers'),
          (t.WithFullGap = 'WithFullGap'),
          (t.WithHalfGap = 'WithHalfGap'),
          (t.Custom = 'Custom');
      })(xt || (xt = {}));
      class ge {
        static local() {
          return null === ge.instance && (ge.instance = new ge()), ge.instance;
        }
        execute(t, e, i) {
          return new ye(t, e, i);
        }
      }
      ge.instance = null;
      class ye extends Ft {
        constructor(t, e, i) {
          super(t, !0, !0),
            (this._grometryWalker = new jt()),
            this._grometryWalker.updateTolerance(i),
            (this._angleToLine = void 0 === e.angleToLine || e.angleToLine),
            (this._offset = void 0 !== e.offset ? e.offset * i : 0),
            (this._originalEndings = e.endings),
            (this._offsetAtEnd = void 0 !== e.customEndingOffset ? e.customEndingOffset * i : 0),
            (this._position = void 0 !== e.offsetAlongLine ? e.offsetAlongLine * i : 0),
            (this._pattern = new Jt()),
            this._pattern.init(e.placementTemplate, !1),
            this._pattern.scale(i),
            (this._endings = this._originalEndings);
        }
        processPath(t) {
          if (this._pattern.isEmpty()) return null;
          let e;
          if (this.iteratePath) e = this._pattern.nextValue();
          else {
            this._originalEndings === xt.WithFullGap && this.isClosed
              ? (this._endings = xt.WithMarkers)
              : (this._endings = this._originalEndings),
              (this._pattern.extPtGap = 0);
            let i,
              s = !0;
            switch (this._endings) {
              case xt.NoConstraint:
                (i = -this._position), (i = this._adjustPosition(i)), (s = !1);
                break;
              case xt.WithHalfGap:
              default:
                i = -this._pattern.lastValue() / 2;
                break;
              case xt.WithFullGap:
                (i = -this._pattern.lastValue()),
                  (this._pattern.extPtGap = this._pattern.lastValue());
                break;
              case xt.WithMarkers:
                i = 0;
                break;
              case xt.Custom:
                (i = -this._position),
                  (i = this._adjustPosition(i)),
                  (this._pattern.extPtGap = 0.5 * this._offsetAtEnd);
            }
            if (!this._grometryWalker.init(t, this._pattern, s)) return null;
            this._pattern.reset();
            let r = 0;
            for (; i > r; ) (i -= r), (r = this._pattern.nextValue());
            (r -= i), (e = r), (this.iteratePath = !0);
          }
          const i = {};
          return this._grometryWalker.nextPointAndAngle(e, i)
            ? this._endings === xt.WithFullGap && this._grometryWalker.isPathEnd()
              ? ((this.iteratePath = !1), null)
              : this._endings === xt.WithMarkers &&
                this._grometryWalker.isPathEnd() &&
                ((this.iteratePath = !1), this.isClosed)
              ? null
              : (this.internalPlacement.setTranslate(
                  i.pt[0] + this._offset * i.sa,
                  i.pt[1] - this._offset * i.ca,
                ),
                this._angleToLine && this.internalPlacement.setRotateCS(i.ca, i.sa),
                this.internalPlacement)
            : ((this.iteratePath = !1), null);
        }
        _adjustPosition(t) {
          let e = t / this._pattern.length();
          return (e -= Math.floor(e)), e * this._pattern.length();
        }
      }
      class xe {
        static local() {
          return null === xe.instance && (xe.instance = new xe()), xe.instance;
        }
        execute(t, e, i) {
          return new ve(t, e, i);
        }
      }
      xe.instance = null;
      class ve extends Ft {
        constructor(t, e, i) {
          super(t, !1, !0),
            (this._curveHelper = new Xt()),
            (this._angleToLine = void 0 === e.angleToLine || e.angleToLine),
            (this._offset = void 0 !== e.offset ? e.offset * i : 0),
            (this._type = e.extremityPlacement),
            (this._position = void 0 !== e.offsetAlongLine ? e.offsetAlongLine * i : 0),
            (this._beginProcessed = !1);
        }
        processPath(t) {
          let e;
          switch (this._type) {
            case 'Both':
            default:
              this._beginProcessed
                ? ((e = this._atExtremities(t, this._position, !1)),
                  (this._beginProcessed = !1),
                  (this.iteratePath = !1))
                : ((e = this._atExtremities(t, this._position, !0)),
                  (this._beginProcessed = !0),
                  (this.iteratePath = !0));
              break;
            case 'JustBegin':
              e = this._atExtremities(t, this._position, !0);
              break;
            case 'JustEnd':
              e = this._atExtremities(t, this._position, !1);
              break;
            case 'None':
          }
          return e;
        }
        _atExtremities(t, e, i) {
          const s = t.length;
          if (s < 2) return null;
          const r = i ? 1 : s - 2,
            n = i ? s : -1,
            a = i ? 1 : -1;
          let o,
            l = 0,
            h = i ? t[0] : t[s - 1];
          for (let i = r; i !== n; i += a) {
            (o = h), (h = t[i]);
            const s = this._curveHelper.calculateLength(o, h);
            if (l + s > e) {
              const t = (e - l) / s,
                [i, r] = this._curveHelper.getAngleCS(o, h, t),
                n = Vt(o, h, t);
              return (
                this.internalPlacement.setTranslate(
                  n[0] - this._offset * r,
                  n[1] + this._offset * i,
                ),
                this._angleToLine && this.internalPlacement.setRotateCS(-i, -r),
                this.internalPlacement
              );
            }
            l += s;
          }
          return null;
        }
      }
      class Me {
        static local() {
          return null === Me.instance && (Me.instance = new Me()), Me.instance;
        }
        execute(t, e, i) {
          return new Se(t, e, i);
        }
      }
      Me.instance = null;
      class Se extends Ft {
        constructor(t, e, i) {
          super(t, !0, !0),
            (this._walker = new jt()),
            this._walker.updateTolerance(i),
            (this._angleToLine = void 0 === e.angleToLine || e.angleToLine),
            (this._offset = void 0 !== e.offset ? e.offset * i : 0),
            (this._beginGap = void 0 !== e.beginPosition ? e.beginPosition * i : 0),
            (this._endGap = void 0 !== e.endPosition ? e.endPosition * i : 0),
            (this._flipFirst = void 0 === e.flipFirst || e.flipFirst),
            (this._pattern = new Jt()),
            this._pattern.init(e.positionArray, !1, !1),
            (this._subPathLen = 0),
            (this._posCount = this._pattern.size()),
            (this._isFirst = !0),
            (this._prevPos = 0);
        }
        processPath(t) {
          if (this._pattern.isEmpty()) return null;
          let e;
          if (this.iteratePath) {
            const t = this._pattern.nextValue() * this._subPathLen,
              i = this._beginGap + t;
            (e = i - this._prevPos), (this._prevPos = i);
          } else {
            if (
              ((this._posCount = this._pattern.size()),
              (this._isFirst = !0),
              (this._prevPos = 0),
              (this._subPathLen =
                this._walker.calculatePathLength(t) - this._beginGap - this._endGap),
              this._subPathLen < 0)
            )
              return (this.iteratePath = !1), null;
            if (!this._walker.init(t, this._pattern, !1)) return null;
            this._pattern.reset();
            const i = this._pattern.nextValue() * this._subPathLen,
              s = this._beginGap + i;
            (e = s - this._prevPos), (this._prevPos = s), (this.iteratePath = !0);
          }
          const i = {};
          if (!this._walker.nextPointAndAngle(e, i, 1)) return (this.iteratePath = !1), null;
          this.internalPlacement.setTranslate(
            i.pt[0] + this._offset * i.sa,
            i.pt[1] - this._offset * i.ca,
          );
          const s = this._isFirst && this._flipFirst;
          let r, n;
          return (
            this._angleToLine ? ((r = i.ca), (n = i.sa)) : ((r = 1), (n = 0)),
            s && ((r = -r), (n = -n)),
            this.internalPlacement.setRotateCS(r, n),
            (this._isFirst = !1),
            this._posCount--,
            0 === this._posCount && (this.iteratePath = !1),
            this.internalPlacement
          );
        }
      }
      class be {
        static local() {
          return null === be.instance && (be.instance = new be()), be.instance;
        }
        execute(t, e, i) {
          return new we(t, e, i);
        }
      }
      be.instance = null;
      class we {
        constructor(t, e, i) {
          if (
            ((this._xMin = 0),
            (this._xMax = 0),
            (this._yMin = 0),
            (this._yMax = 0),
            (this._currentX = 0),
            (this._currentY = 0),
            (this._stepX = (void 0 !== e.stepX ? Math.abs(e.stepX) : 16) * i),
            (this._stepY = (void 0 !== e.stepY ? Math.abs(e.stepY) : 16) * i),
            0 !== this._stepX && 0 !== this._stepY && t && void 0 !== t.rings && t.rings)
          ) {
            if (
              ((this._gridType = void 0 !== e.gridType ? e.gridType : 'Fixed'),
              'Random' === this._gridType)
            )
              (this._randomness = void 0 !== e.randomness ? e.randomness / 100 : 1),
                (this._gridAngle = 0),
                (this._shiftOddRows = !1),
                (this._cosAngle = 1),
                (this._sinAngle = 0),
                (this._offsetX = 0),
                (this._offsetY = 0);
            else {
              if (
                ((this._randomness = 0),
                (this._gridAngle = void 0 !== e.gridAngle ? e.gridAngle : 0),
                (this._shiftOddRows = void 0 !== e.shiftOddRows && e.shiftOddRows),
                (this._offsetX = void 0 !== e.offsetX ? e.offsetX * i : 0),
                (this._offsetY = void 0 !== e.offsetY ? e.offsetY * i : 0),
                (this._cosAngle = Math.cos((this._gridAngle / 180) * Math.PI)),
                (this._sinAngle = -Math.sin((this._gridAngle / 180) * Math.PI)),
                this._stepX)
              )
                if (this._offsetX < 0)
                  for (; this._offsetX < -0.5 * this._stepX; ) this._offsetX += this._stepX;
                else for (; this._offsetX >= 0.5 * this._stepX; ) this._offsetX -= this._stepX;
              if (this._stepY)
                if (this._offsetY < 0)
                  for (; this._offsetY < -0.5 * this._stepY; ) this._offsetY += this._stepY;
                else for (; this._offsetY >= 0.5 * this._stepY; ) this._offsetY -= this._stepY;
            }
            (this._graphicOriginX = 0),
              (this._graphicOriginY = 0),
              (this._internalPlacement = new Pt()),
              this._calculateMinMax(t),
              (this._geometry = t);
          }
        }
        next() {
          return this._geometry ? this._nextInside() : null;
        }
        _calculateMinMax(t) {
          let e, i, s, r, n, a, o, l;
          (this._xMin = 0),
            (this._xMax = 0),
            (this._yMin = 0),
            (this._yMax = 0),
            (n = a = Number.MAX_VALUE),
            (o = l = -Number.MAX_VALUE);
          for (const h of t.rings) {
            const t = h ? h.length : 0;
            for (let c = 0; c < t; ++c)
              (e = h[c][0] - this._graphicOriginX - this._offsetX),
                (i = h[c][1] - this._graphicOriginY - this._offsetY),
                (s = this._cosAngle * e - this._sinAngle * i),
                (r = this._sinAngle * e + this._cosAngle * i),
                (n = Math.min(n, s)),
                (o = Math.max(o, s)),
                (a = Math.min(a, r)),
                (l = Math.max(l, r));
          }
          (n += this._graphicOriginX),
            (o += this._graphicOriginX),
            (a += this._graphicOriginY),
            (l += this._graphicOriginY),
            (this._xMin = Math.round(n / this._stepX)),
            (this._xMax = Math.round(o / this._stepX)),
            (this._yMin = Math.round(a / this._stepY)),
            (this._yMax = Math.round(l / this._stepY)),
            (this._currentX = this._xMax + 1),
            (this._currentY = this._yMin - 1);
        }
        _nextInside() {
          for (;;) {
            if (this._currentX > this._xMax) {
              if ((this._currentY++, this._currentY > this._yMax)) return null;
              (this._currentX = this._xMin),
                this._shiftOddRows && this._currentY % 2 && this._currentX--;
            }
            let t = this._currentX * this._stepX + this._offsetX;
            this._shiftOddRows && this._currentY % 2 && (t += 0.5 * this._stepX);
            const e = this._currentY * this._stepY + this._offsetY;
            let i, s;
            return (
              this._currentX++,
              'Random' === this._gridType
                ? ((i =
                    this._graphicOriginX +
                    t +
                    (this._stepX * this._randomness * (0.5 - Math.random()) * 2) / 3),
                  (s =
                    this._graphicOriginY +
                    e +
                    (this._stepY * this._randomness * (0.5 - Math.random()) * 2) / 3))
                : ((i = this._graphicOriginX + this._cosAngle * t + this._sinAngle * e),
                  (s = this._graphicOriginY - this._sinAngle * t + this._cosAngle * e)),
              this._internalPlacement.setTranslate(i, s),
              this._internalPlacement
            );
          }
        }
      }
      class Pe {
        static local() {
          return null === Pe.instance && (Pe.instance = new Pe()), Pe.instance;
        }
        execute(t, e, i) {
          return new Ce(t, e, i);
        }
      }
      Pe.instance = null;
      class Ce extends Ft {
        constructor(t, e, i) {
          super(t, !0, !0),
            (this._curveHelper = new Xt()),
            (this._angleToLine = void 0 === e.angleToLine || e.angleToLine),
            (this._offset = void 0 !== e.offset ? e.offset * i : 0),
            (this._relativeTo = e.relativeTo),
            (this._position = void 0 !== e.startPointOffset ? e.startPointOffset * i : 0),
            (this._epsilon = 0.001 * i);
        }
        processPath(t) {
          const e = this._position;
          if ('SegmentMidpoint' === this._relativeTo) {
            for (
              this.iteratePath ||
              ((this._segmentCount = t.length), (this._curSegment = 1), (this.iteratePath = !0));
              this._curSegment < this._segmentCount;

            ) {
              const e = this._curSegment;
              this._curSegment++;
              const i = t[e - 1],
                s = t[e],
                r = this._curveHelper.calculateLength(i, s);
              if (r < this._epsilon) continue;
              const n = 0.5 + this._position / r,
                [a, o] = this._curveHelper.getAngleCS(i, s, n),
                l = Vt(i, s, n);
              return (
                this.internalPlacement.setTranslate(
                  l[0] - this._offset * o,
                  l[1] + this._offset * a,
                ),
                this._angleToLine && this.internalPlacement.setRotateCS(a, o),
                this.internalPlacement
              );
            }
            return (this.iteratePath = !1), null;
          }
          'LineEnd' === this._relativeTo && Rt(t);
          const i = this.onLine(t, e);
          return 'LineEnd' === this._relativeTo && Rt(t), i;
        }
        onLine(t, e) {
          let i,
            s = !1;
          switch (this._relativeTo) {
            case 'LineMiddle':
            default:
              i = this._curveHelper.calculatePathLength(t) / 2 + e;
              break;
            case 'LineBeginning':
              i = e;
              break;
            case 'LineEnd':
              (i = e), (s = !0);
          }
          const r = t.length;
          let n,
            a = 0,
            o = t[0];
          for (let e = 1; e < r; ++e) {
            (n = o), (o = t[e]);
            const r = this._curveHelper.calculateLength(n, o);
            if (a + r > i) {
              const t = (i - a) / r,
                [e, l] = this._curveHelper.getAngleCS(n, o, t),
                h = Vt(n, o, t),
                c = s ? this._offset : -this._offset;
              return (
                this.internalPlacement.setTranslate(h[0] - c * l, h[1] + c * e),
                this._angleToLine &&
                  (s
                    ? this.internalPlacement.setRotateCS(-e, -l)
                    : this.internalPlacement.setRotateCS(e, l)),
                this.internalPlacement
              );
            }
            a += r;
          }
          return null;
        }
      }
      class Le {
        static local() {
          return null === Le.instance && (Le.instance = new Le()), Le.instance;
        }
        execute(t, e, i) {
          return new ke(t, e, i);
        }
      }
      Le.instance = null;
      class ke extends Ft {
        constructor(t, e, i) {
          super(t, !0, !0),
            (this._curveHelper = new Xt()),
            (this._angleToLine = void 0 === e.angleToLine || e.angleToLine),
            (this._offset = void 0 !== e.offset ? e.offset * i : 0),
            (this._endPoints = void 0 === e.placeOnEndPoints || e.placeOnEndPoints),
            (this._controlPoints = void 0 === e.placeOnControlPoints || e.placeOnControlPoints),
            (this._regularVertices =
              void 0 === e.placeOnRegularVertices || e.placeOnRegularVertices),
            (this._tags = []),
            (this._tagIterator = 0);
        }
        processPath(t) {
          if (
            (this.iteratePath || (this._preparePath(t), (this.iteratePath = !0)),
            this._tagIterator >= this._tags.length)
          )
            return (this._tags.length = 0), (this._tagIterator = 0), (this.iteratePath = !1), null;
          const e = this._tags[this._tagIterator];
          this._angleToLine && this.internalPlacement.setRotate(e[2]);
          let i = e[0],
            s = e[1];
          if (0 !== this._offset) {
            const t = Math.cos(e[2]),
              r = Math.sin(e[2]);
            (i -= this._offset * r), (s += this._offset * t);
          }
          return (
            this.internalPlacement.setTranslate(i, s), this._tagIterator++, this.internalPlacement
          );
        }
        _preparePath(t) {
          (this._tags.length = 0), (this._tagIterator = 0);
          const e = (function (t) {
              return (
                !(!t || 0 === t.length) &&
                t[0][0] === t[t.length - 1][0] &&
                t[0][1] === t[t.length - 1][1]
              );
            })(t),
            i = t.length - 1;
          let s,
            r,
            n = 0,
            a = 0,
            o = 0,
            l = 0,
            h = 0;
          for (; n < i; ) {
            n++, (s = t[n - 1]), (r = t[n]);
            const c = At(s),
              u = At(r);
            (this._angleToLine || 0 !== this._offset) && (l = this._curveHelper.getAngle(s, r, 0)),
              1 === n
                ? e
                  ? ((a = l), (o = c))
                  : this._endPoints && this._tags.push([s[0], s[1], l])
                : 1 === c
                ? this._controlPoints && this._tags.push([s[0], s[1], Ie(h, l)])
                : this._regularVertices && this._tags.push([s[0], s[1], Ie(h, l)]),
              (this._angleToLine || 0 !== this._offset) &&
                (h = this._curveHelper.getAngle(s, r, 1)),
              n === i &&
                (e
                  ? 1 === u || 1 === o
                    ? this._controlPoints && this._tags.push([r[0], r[1], Ie(h, a)])
                    : this._regularVertices && this._tags.push([r[0], r[1], Ie(h, a)])
                  : this._endPoints && this._tags.push([r[0], r[1], h]));
          }
          this._tagIterator = 0;
        }
      }
      function Ie(t, e) {
        const i = Math.PI;
        for (; Math.abs(e - t) > i + 2e-15; ) e - t > i ? (e -= 2 * i) : (e += 2 * i);
        return (t + e) / 2;
      }
      class Te {
        static local() {
          return null === Te.instance && (Te.instance = new Te()), Te.instance;
        }
        execute(t, e, i) {
          return new Ee(t, e, i);
        }
      }
      Te.instance = null;
      class Ee {
        constructor(t, e, i) {
          (this._geometry = t),
            (this._offsetX = void 0 !== e.offsetX ? e.offsetX * i : 0),
            (this._offsetY = void 0 !== e.offsetY ? e.offsetY * i : 0),
            (this._method = void 0 !== e.method ? e.method : 'OnPolygon'),
            (this._internalPlacement = new Pt());
        }
        next() {
          const t = this._geometry;
          return (this._geometry = null), t && void 0 !== t.rings ? this._polygonCenter(t) : null;
        }
        _polygonCenter(t) {
          let e = !1;
          switch (this._method) {
            case 'OnPolygon':
            default:
            case 'CenterOfMass':
            case 'BoundingBoxCenter': {
              const i = (0, St.a)();
              (0, bt.d)(i, t),
                this._internalPlacement.setTranslate(
                  (i[2] + i[0]) / 2 + this._offsetX,
                  (i[3] + i[1]) / 2 - this._offsetY,
                ),
                (e = !0);
              break;
            }
          }
          return e ? this._internalPlacement : null;
        }
      }
      function ze(t) {
        if (!t) return null;
        switch (t.type) {
          case 'CIMGeometricEffectAddControlPoints':
            return Wt.local();
          case 'CIMGeometricEffectArrow':
            return Yt.local();
          case 'CIMGeometricEffectBuffer':
            return Ut.local();
          case 'CIMGeometricEffectCut':
            return Kt.local();
          case 'CIMGeometricEffectDashes':
            return Qt.local();
          case 'CIMGeometricEffectDonut':
            return ee.local();
          case 'CIMGeometricEffectJog':
            return se.local();
          case 'CIMGeometricEffectMove':
            return ne.local();
          case 'CIMGeometricEffectOffset':
            return oe.local();
          case 'CIMGeometricEffectReverse':
            return he.local();
          case 'CIMGeometricEffectRotate':
            return ue.local();
          case 'CIMGeometricEffectScale':
            return de.local();
          case 'CIMGeometricEffectWave':
            return me.local();
        }
        return null;
      }
      function Re(t) {
        if (!t) return null;
        switch (t.type) {
          case 'CIMMarkerPlacementAlongLineSameSize':
            return ge.local();
          case 'CIMMarkerPlacementAtExtremities':
            return xe.local();
          case 'CIMMarkerPlacementAtRatioPositions':
            return Me.local();
          case 'CIMMarkerPlacementInsidePolygon':
            return be.local();
          case 'CIMMarkerPlacementOnLine':
            return Pe.local();
          case 'CIMMarkerPlacementOnVertices':
            return Le.local();
          case 'CIMMarkerPlacementPolygonCenter':
            return Te.local();
        }
        return null;
      }
      class Ve {
        constructor(t = 0, e = 0, i = 0, s = 0) {
          (this.x = t), (this.y = e), (this.width = i), (this.height = s);
        }
        get isEmpty() {
          return this.width <= 0 || this.height <= 0;
        }
        union(t) {
          (this.x = Math.min(this.x, t.x)),
            (this.y = Math.min(this.y, t.y)),
            (this.width = Math.max(this.width, t.width)),
            (this.height = Math.max(this.height, t.height));
        }
      }
      const Ae = Math.PI / 180,
        Oe = a.L.getLogger('esri.symbols.cim.CIMSymbolDrawHelper');
      class Fe {
        constructor(t) {
          this._t = t;
        }
        static createIdentity() {
          return new Fe([1, 0, 0, 0, 1, 0]);
        }
        clone() {
          const t = this._t;
          return new Fe(t.slice());
        }
        transform(t) {
          const e = this._t;
          return [e[0] * t[0] + e[1] * t[1] + e[2], e[3] * t[0] + e[4] * t[1] + e[5]];
        }
        static createScale(t, e) {
          return new Fe([t, 0, 0, 0, e, 0]);
        }
        scale(t, e) {
          const i = this._t;
          return (i[0] *= t), (i[1] *= t), (i[2] *= t), (i[3] *= e), (i[4] *= e), (i[5] *= e), this;
        }
        scaleRatio() {
          return Math.sqrt(this._t[0] * this._t[0] + this._t[1] * this._t[1]);
        }
        static createTranslate(t, e) {
          return new Fe([0, 0, t, 0, 0, e]);
        }
        translate(t, e) {
          const i = this._t;
          return (i[2] += t), (i[5] += e), this;
        }
        static createRotate(t) {
          const e = Math.cos(t),
            i = Math.sin(t);
          return new Fe([e, -i, 0, i, e, 0]);
        }
        rotate(t) {
          return this.multiply(Fe.createRotate(t));
        }
        multiply(t) {
          const e = this._t,
            i = t._t,
            s = e[0] * i[0] + e[3] * i[1],
            r = e[1] * i[0] + e[4] * i[1],
            n = e[2] * i[0] + e[5] * i[1] + i[2],
            a = e[0] * i[3] + e[3] * i[4],
            o = e[1] * i[3] + e[4] * i[4],
            l = e[2] * i[3] + e[5] * i[4] + i[5];
          return (e[0] = s), (e[1] = r), (e[2] = n), (e[3] = a), (e[4] = o), (e[5] = l), this;
        }
      }
      class Ne {
        constructor(t) {
          (this._transfos = []),
            (this._sizeTransfos = []),
            this._transfos.push(t || Fe.createIdentity()),
            this._sizeTransfos.push(t ? t.scaleRatio() : 1);
        }
        transformPt(t) {
          return this._transfos[this._transfos.length - 1].transform(t);
        }
        transformSize(t) {
          return t * this._sizeTransfos[this._sizeTransfos.length - 1];
        }
        back() {
          return this._transfos[this._transfos.length - 1];
        }
        push(t, e) {
          const i = e ? t.scaleRatio() : 1;
          t.multiply(this.back()),
            this._transfos.push(t),
            this._sizeTransfos.push(this._sizeTransfos[this._sizeTransfos.length - 1] * i);
        }
        pop() {
          this._transfos.splice(-1, 1), this._sizeTransfos.splice(-1, 1);
        }
        drawSymbol(t, e) {
          if (t)
            switch (t.type) {
              case 'CIMPointSymbol':
              case 'CIMLineSymbol':
              case 'CIMPolygonSymbol':
                this.drawMultiLayerSymbol(t, e);
            }
        }
        drawMultiLayerSymbol(t, e) {
          if (!t) return;
          const i = t.symbolLayers;
          if (!i) return;
          const s = t.effects;
          if (s) {
            const t = this.executeEffects(s, e);
            if (t) {
              let e = t.next();
              for (; e; ) this.drawSymbolLayers(i, e), (e = t.next());
            }
          } else this.drawSymbolLayers(i, e);
        }
        executeEffects(t, e) {
          let i = new Ct(e);
          for (const e of t) {
            const t = ze(e);
            t && (i = t.execute(i, e, 1));
          }
          return i;
        }
        drawSymbolLayers(t, e) {
          let i = t.length;
          for (; i--; ) {
            const s = t[i];
            if (!s || !1 === s.enable) continue;
            const r = s.effects;
            if (r) {
              const t = this.executeEffects(r, e);
              if (t) {
                let e = t.next();
                for (; e; ) this.drawSymbolLayer(s, e), (e = t.next());
              }
            } else this.drawSymbolLayer(s, e);
          }
        }
        drawSymbolLayer(t, e) {
          switch (t.type) {
            case 'CIMSolidFill':
              this.drawSolidFill(e, t.color);
              break;
            case 'CIMHatchFill':
              this.drawHatchFill(t, e);
              break;
            case 'CIMSolidStroke':
              this.drawSolidStroke(e, t.color, t.width, t.capStyle, t.joinStyle, t.miterLimit);
              break;
            case 'CIMCharacterMarker':
            case 'CIMPictureMarker':
            case 'CIMVectorMarker':
              this.drawMarkerLayer(t, e);
          }
        }
        drawHatchFill(t, e) {
          const i = this._buildHatchPolyline(t, e, 1);
          i &&
            (this.pushClipPath(e), this.drawMultiLayerSymbol(t.lineSymbol, i), this.popClipPath());
        }
        drawMarkerLayer(t, e) {
          const i = t.markerPlacement;
          if (i) {
            const s = Re(i);
            if (s) {
              const r = 'CIMMarkerPlacementInsidePolygon' === i.type;
              r && this.pushClipPath(e);
              const n = 1,
                a = s.execute(e, i, n);
              if (a) {
                let e = a.next();
                for (; e; ) this.drawMarker(t, e), (e = a.next());
              }
              r && this.popClipPath();
            }
          } else {
            const i = new Pt();
            (i.tx = e.x), (i.ty = e.y), this.drawMarker(t, i);
          }
        }
        drawMarker(t, e) {
          switch (t.type) {
            case 'CIMCharacterMarker':
            case 'CIMPictureMarker':
              this.drawPictureMarker(t, e);
              break;
            case 'CIMVectorMarker':
              this.drawVectorMarker(t, e);
          }
        }
        drawPictureMarker(t, e) {
          if (!t) return;
          const i = t.size || 10,
            s = Fe.createIdentity(),
            r = t.anchorPoint;
          if (r) {
            let e = r.x,
              n = r.y;
            'Absolute' !== t.anchorPointUnits && ((e *= i), (n *= i)), s.translate(-e, -n);
          }
          t.rotation && s.rotate(t.rotation * Ae),
            s.translate(t.offsetX || 0, t.offsetY || 0),
            s.translate(e.tx, e.ty),
            this.push(s, !1),
            this.drawImage(t.url, i, t.scaleX),
            this.pop();
        }
        drawVectorMarker(t, e) {
          if (!t) return;
          const i = t.markerGraphics;
          if (!i) return;
          const s = t.size,
            r = t.frame,
            n = r ? r.ymax - r.ymin : 0,
            a = s && n ? s / n : 1,
            o = Fe.createIdentity();
          r && o.translate(0.5 * -(r.xmax + r.xmin), 0.5 * -(r.ymax + r.ymin));
          const l = t.anchorPoint;
          if (l) {
            let e = l.x,
              i = l.y;
            'Absolute' !== t.anchorPointUnits
              ? r && ((e *= r.xmax - r.xmin), (i *= r.ymax - r.ymin))
              : ((e /= a), (i /= a)),
              o.translate(-e, -i);
          }
          1 !== a && o.scale(a, a),
            t.rotation && o.rotate(t.rotation * Ae),
            o.translate(t.offsetX || 0, t.offsetY || 0),
            o.translate(e.tx, e.ty),
            this.push(o, t.scaleSymbolsProportionally);
          for (const t of i)
            (t && t.symbol && t.geometry) || Oe.error('Invalid marker graphic', t),
              this.drawSymbol(t.symbol, t.geometry);
          this.pop();
        }
        _buildHatchPolyline(t, e, i) {
          let s = (void 0 !== t.separation ? t.separation : 4) * i,
            r = void 0 !== t.rotation ? t.rotation : 0;
          if (0 === s) return null;
          s < 0 && (s = -s);
          let n = 0;
          const a = 0.5 * s;
          for (; n > a; ) n -= s;
          for (; n < -a; ) n += s;
          const o = (0, St.a)();
          (0, bt.d)(o, e), (o[0] -= a), (o[1] -= a), (o[2] += a), (o[3] += a);
          const l = [
            [o[0], o[1]],
            [o[0], o[3]],
            [o[2], o[3]],
            [o[2], o[1]],
          ];
          for (; r > 180; ) r -= 180;
          for (; r < 0; ) r += 180;
          const h = Math.cos(r * Ae),
            c = Math.sin(r * Ae),
            u = -s * c,
            f = s * h;
          let d, _, m, p;
          (n =
            (void 0 !== t.offsetX ? t.offsetX * i : 0) * c -
            (void 0 !== t.offsetY ? t.offsetY * i : 0) * h),
            (d = m = Number.MAX_VALUE),
            (_ = p = -Number.MAX_VALUE);
          for (const t of l) {
            const e = t[0],
              i = t[1],
              s = h * e + c * i,
              r = -c * e + h * i;
            (d = Math.min(d, s)), (m = Math.min(m, r)), (_ = Math.max(_, s)), (p = Math.max(p, r));
          }
          m = Math.floor(m / s) * s;
          let g = h * d - c * m - (u * n) / s,
            y = c * d + h * m - (f * n) / s,
            x = h * _ - c * m - (u * n) / s,
            v = c * _ + h * m - (f * n) / s;
          const M = 1 + Math.round((p - m) / s),
            S = [];
          for (let t = 0; t < M; t++)
            (g += u),
              (y += f),
              (x += u),
              (v += f),
              S.push([
                [g, y],
                [x, v],
              ]);
          return { paths: S };
        }
      }
      class Ge extends Ne {
        constructor() {
          super(), this.reset();
        }
        reset() {
          (this._xmin = this._ymin = 1 / 0),
            (this._xmax = this._ymax = -1 / 0),
            (this._clipCount = 0);
        }
        envelope() {
          return new Ve(this._xmin, this._ymin, this._xmax - this._xmin, this._ymax - this._ymin);
        }
        drawSolidFill(t) {
          if (t && !(this._clipCount > 0))
            if ((0, wt.oU)(t)) this._processPath(t.rings, 0);
            else if ((0, wt.l9)(t)) this._processPath(t.paths, 0);
            else if ((0, wt.YX)(t)) {
              const e = Be(t);
              e && this._processPath(e.rings, 0);
            }
        }
        drawSolidStroke(t, e, i) {
          if (!t || this._clipCount > 0) return;
          const s = 0.5 * this.transformSize(i);
          if ((0, wt.oU)(t)) this._processPath(t.rings, s);
          else if ((0, wt.l9)(t)) this._processPath(t.paths, s);
          else if ((0, wt.YX)(t)) {
            const e = Be(t);
            e && this._processPath(e.rings, s);
          }
        }
        pushClipPath(t) {
          this.drawSolidFill(t), ++this._clipCount;
        }
        popClipPath() {
          --this._clipCount;
        }
        drawImage(t, e, i) {
          const s = e / 2;
          this._merge(this.transformPt([0, 0]), s);
        }
        _processPath(t, e) {
          if (t)
            for (const i of t) {
              const t = i ? i.length : 0;
              if (t > 1) {
                this._merge(this.transformPt(i[0]), e);
                for (let s = 1; s < t; ++s) this._merge(this.transformPt(i[s]), e);
              }
            }
        }
        _merge(t, e) {
          t[0] - e < this._xmin && (this._xmin = t[0] - e),
            t[0] + e > this._xmax && (this._xmax = t[0] + e),
            t[1] - e < this._ymin && (this._ymin = t[1] - e),
            t[1] + e > this._ymax && (this._ymax = t[1] + e);
        }
      }
      class We extends Ne {
        constructor(t, e) {
          super(e), (this._ctx = t);
        }
        drawSolidFill(t, e) {
          if (!t) return;
          if ((0, wt.oU)(t)) this._buildPath(t.rings, !0);
          else if ((0, wt.l9)(t)) this._buildPath(t.paths, !0);
          else {
            if (!(0, wt.YX)(t)) return;
            this._buildPath(Be(t).rings, !0);
          }
          const i = this._ctx;
          (i.fillStyle =
            'string' == typeof e
              ? e
              : 'rgba(' +
                Math.round(e[0]) +
                ',' +
                Math.round(e[1]) +
                ',' +
                Math.round(e[2]) +
                ',' +
                e[3] / 255 +
                ')'),
            i.fill('evenodd');
        }
        drawSolidStroke(t, e, i, s, r, n) {
          if (!t || !e || 0 === i) return;
          if ((0, wt.oU)(t)) this._buildPath(t.rings, !0);
          else if ((0, wt.l9)(t)) this._buildPath(t.paths, !1);
          else {
            if (!(0, wt.YX)(t)) return;
            this._buildPath(Be(t).rings, !0);
          }
          const a = this._ctx;
          (a.strokeStyle =
            'string' == typeof e
              ? e
              : 'rgba(' +
                Math.round(e[0]) +
                ',' +
                Math.round(e[1]) +
                ',' +
                Math.round(e[2]) +
                ',' +
                e[3] / 255 +
                ')'),
            (a.lineWidth = this.transformSize(i) + 0.5),
            this._setCapStyle(s),
            this._setJoinStyle(r),
            (a.miterLimit = n),
            a.stroke();
        }
        pushClipPath(t) {
          if ((this._ctx.save(), (0, wt.oU)(t))) this._buildPath(t.rings, !0);
          else if ((0, wt.l9)(t)) this._buildPath(t.paths, !0);
          else {
            if (!(0, wt.YX)(t)) return;
            this._buildPath(Be(t).rings, !0);
          }
          this._ctx.clip('evenodd');
        }
        popClipPath() {
          this._ctx.restore();
        }
        drawImage(t, e, i) {}
        _buildPath(t, e) {
          const i = this._ctx;
          if ((i.beginPath(), t))
            for (const s of t) {
              const t = s ? s.length : 0;
              if (t > 1) {
                let r = this.transformPt(s[0]);
                i.moveTo(r[0], r[1]);
                for (let e = 1; e < t; ++e) (r = this.transformPt(s[e])), i.lineTo(r[0], r[1]);
                e && i.closePath();
              }
            }
        }
        _setCapStyle(t) {
          switch (t) {
            case 'Butt':
              this._ctx.lineCap = 'butt';
              break;
            case 'Round':
              this._ctx.lineCap = 'round';
              break;
            case 'Square':
              this._ctx.lineCap = 'square';
          }
        }
        _setJoinStyle(t) {
          switch (t) {
            case 'Bevel':
              this._ctx.lineJoin = 'bevel';
              break;
            case 'Round':
              this._ctx.lineJoin = 'round';
              break;
            case 'Miter':
              this._ctx.lineJoin = 'miter';
          }
        }
      }
      const Be = (t) =>
          t
            ? {
                spatialReference: t.spatialReference,
                rings: [
                  [
                    [t.xmin, t.ymin],
                    [t.xmin, t.ymax],
                    [t.xmax, t.ymax],
                    [t.xmax, t.ymin],
                    [t.xmin, t.ymin],
                  ],
                ],
              }
            : null,
        De = [1 / 256, 1 / 65536, 1 / 16777216, 1 / 4294967296];
      !(function (t, e = 0) {
        let i = 0;
        for (let s = 0; s < 4; s++) i += t[e + s] * De[s];
      })(new Uint8ClampedArray([255, 255, 255, 255]));
      const Xe = Math.PI,
        Ye = Xe / 2,
        He = a.L.getLogger('esri.symbols.cim.CIMSymbolHelper');
      function Ue(t, e) {
        switch (e.type) {
          case 'CIMSymbolReference': {
            const i = { type: 'point', x: 0, y: 0 };
            t.drawSymbol(e.symbol, i);
            break;
          }
          case 'CIMPointSymbol': {
            const i = { type: 'point', x: 0, y: 0 };
            t.drawSymbol(e, i);
            break;
          }
          case 'CIMTextSymbol':
            break;
          case 'CIMVectorMarker': {
            const i = new Pt();
            t.drawMarker(e, i);
            break;
          }
        }
        return t.envelope();
      }
      class Ze {
        static getEnvelope(t) {
          const e = new Ge();
          if (Array.isArray(t)) {
            let i;
            for (const s of t) i ? i.union(Ue(e, s)) : (i = Ue(e, s));
            return i;
          }
          return Ue(e, t);
        }
        static getTextureAnchor(t) {
          const e = this.getEnvelope(t);
          if (!e || e.width <= 0 || e.height <= 0) return [0, 0, 0];
          const i = 96 / 72,
            s = (e.x + 0.5 * e.width) * i,
            r = -(e.y + 0.5 * e.height) * i,
            n = e.width * i + 2,
            a = e.height * i + 2;
          return [s / n, r / a, a];
        }
        static rasterize(t, e, i, s = !0) {
          const r = i || this.getEnvelope(e);
          if (!r || r.width <= 0 || r.height <= 0) return [null, 0, 0, 0, 0];
          const n = 96 / 72,
            a = (r.x + 0.5 * r.width) * n,
            o = (r.y + 0.5 * r.height) * n;
          (t.width = r.width * n),
            (t.height = r.height * n),
            i || ((t.width += 2), (t.height += 2));
          const l = t.getContext('2d'),
            h = Fe.createScale(n, -n);
          h.translate(0.5 * t.width - a, 0.5 * t.height + o);
          const c = new We(l, h);
          switch (e.type) {
            case 'CIMPointSymbol': {
              const t = { type: 'point', x: 0, y: 0 };
              c.drawSymbol(e, t);
              break;
            }
            case 'CIMVectorMarker': {
              const t = new Pt();
              c.drawMarker(e, t);
              break;
            }
          }
          const u = l.getImageData(0, 0, t.width, t.height),
            f = new Uint8Array(u.data);
          if (s) {
            let t;
            for (let e = 0; e < f.length; e += 4)
              (t = f[e + 3] / 255),
                (f[e] = f[e] * t),
                (f[e + 1] = f[e + 1] * t),
                (f[e + 2] = f[e + 2] * t);
          }
          return [f, t.width, t.height, -a / t.width, -o / t.height];
        }
        static fromSimpleMarker(t) {
          const e = 50;
          let i, s;
          const r = t.style;
          if ('circle' === r || 'esriSMSCircle' === r) {
            const t = 0.25;
            let r = Math.acos(1 - t / e),
              n = Math.ceil(Xe / r / 4);
            0 === n && (n = 1), (r = Ye / n), (n *= 4);
            const a = [];
            a.push([e, 0]);
            for (let t = 1; t < n; t++) a.push([e * Math.cos(t * r), -50 * Math.sin(t * r)]);
            a.push([e, 0]), (i = { rings: [a] }), (s = { xmin: -50, ymin: -50, xmax: e, ymax: e });
          } else if ('cross' === r || 'esriSMSCross' === r) {
            const t = 0;
            (i = {
              rings: [
                [
                  [t, e],
                  [t, t],
                  [e, t],
                  [e, -t],
                  [t, -t],
                  [t, -50],
                  [-t, -50],
                  [-t, -t],
                  [-50, -t],
                  [-50, t],
                  [-t, t],
                  [-t, e],
                  [t, e],
                ],
              ],
            }),
              (s = { xmin: -50, ymin: -50, xmax: e, ymax: e });
          } else if ('diamond' === r || 'esriSMSDiamond' === r)
            (i = {
              rings: [
                [
                  [-50, 0],
                  [0, e],
                  [e, 0],
                  [0, -50],
                  [-50, 0],
                ],
              ],
            }),
              (s = { xmin: -50, ymin: -50, xmax: e, ymax: e });
          else if ('square' === r || 'esriSMSSquare' === r)
            (i = {
              rings: [
                [
                  [-50, -50],
                  [-50, e],
                  [e, e],
                  [e, -50],
                  [-50, -50],
                ],
              ],
            }),
              (s = { xmin: -50, ymin: -50, xmax: e, ymax: e });
          else if ('x' === r || 'esriSMSX' === r) {
            const t = 0;
            (i = {
              rings: [
                [
                  [0, t],
                  [e - t, e],
                  [e, e - t],
                  [t, 0],
                  [e, t - e],
                  [e - t, -50],
                  [0, -t],
                  [t - e, -50],
                  [-50, t - e],
                  [-t, 0],
                  [-50, e - t],
                  [t - e, e],
                  [0, t],
                ],
              ],
            }),
              (s = { xmin: -50, ymin: -50, xmax: e, ymax: e });
          } else if ('triangle' === r || 'esriSMSTriangle' === r) {
            const t = 57.735026918962575,
              e = -t,
              r = (2 / 3) * 100,
              n = r - 100;
            (i = {
              rings: [
                [
                  [e, n],
                  [0, r],
                  [t, n],
                  [e, n],
                ],
              ],
            }),
              (s = { xmin: e, ymin: n, xmax: t, ymax: r });
          } else
            ('arrow' !== r && 'esriSMSArrow' !== r) ||
              ((i = {
                rings: [
                  [
                    [-50, 50],
                    [50, 0],
                    [-50, -50],
                    [-33, -20],
                    [-33, 20],
                    [-50, 50],
                  ],
                ],
              }),
              (s = { xmin: -50, ymin: -50, xmax: e, ymax: e }));
          let n;
          if (i && s) {
            const e = [{ type: 'CIMSolidFill', enable: !0, color: t.color }];
            t.outline &&
              e.push({
                type: 'CIMSolidStroke',
                enable: !0,
                width: t.outline.width,
                color: t.outline.color,
              });
            const r = { type: 'CIMPolygonSymbol', symbolLayers: e };
            n = {
              type: 'CIMPointSymbol',
              symbolLayers: [
                {
                  type: 'CIMVectorMarker',
                  enable: !0,
                  rotation: t.angle,
                  size: t.size,
                  offsetX: t.xoffset,
                  offsetY: t.yoffset,
                  frame: s,
                  markerGraphics: [{ type: 'CIMMarkerGraphic', geometry: i, symbol: r }],
                },
              ],
            };
          }
          return n;
        }
        static fromCIMHatchFill(t) {
          const e = void 0 !== t.separation ? t.separation : 4,
            i = e / 2;
          let s = this._getLineSymbolPeriod(t.lineSymbol) || 4;
          for (; s < 4; ) s *= 2;
          const r = s / 2;
          return {
            type: 'CIMVectorMarker',
            frame: { xmin: -r, xmax: r, ymin: -i, ymax: i },
            markerGraphics: [
              {
                type: 'CIMMarkerGraphic',
                geometry: {
                  paths: [
                    [
                      [-r, 0],
                      [r, 0],
                    ],
                  ],
                },
                symbol: t.lineSymbol,
              },
            ],
            size: e,
          };
        }
        static _getLineSymbolPeriod(t) {
          if (t) {
            const e = this._getEffectsRepeat(t.effects);
            if (e) return e;
            if (t.symbolLayers)
              for (const e of t.symbolLayers) {
                const t = this._getEffectsRepeat(e.effects);
                if (t) return t;
                if (e) {
                  const t = this._getPlacementRepeat(e.markerPlacement);
                  if (t) return t;
                }
              }
          }
          return 0;
        }
        static _getEffectsRepeat(t) {
          if (t)
            for (const e of t)
              if (e)
                switch (e.type) {
                  case 'CIMGeometricEffectDashes': {
                    const t = e.dashTemplate;
                    if (t && t.length) {
                      let e = 0;
                      for (const i of t) e += i;
                      return 1 & t.length && (e *= 2), e;
                    }
                    break;
                  }
                  case 'CIMGeometricEffectWave':
                    return e.period;
                  default:
                    He.error(`unsupported geometric effect type ${e.type}`);
                }
          return 0;
        }
        static _getPlacementRepeat(t) {
          if (t)
            switch (t.type) {
              case 'CIMMarkerPlacementAlongLineSameSize':
              case 'CIMMarkerPlacementAlongLineRandomSize':
              case 'CIMMarkerPlacementAlongLineVariableSize': {
                const e = t.placementTemplate;
                if (e && e.length) {
                  let t = 0;
                  for (const i of e) t += i;
                  return 1 & e.length && (t *= 2), t;
                }
                break;
              }
            }
          return 0;
        }
        static fromCIMInsidePolygon(t) {
          const e = t.markerPlacement,
            i = { type: t.type, ...t };
          let s, r, n, a;
          return (
            (i.markerPlacement = null),
            (i.anchorPoint = null),
            !0 === e.shiftOddRows
              ? ((r = e.stepX / 2),
                (n = e.stepY),
                (a = 2 * e.stepY),
                (s = [
                  { x: -r, y: 0 },
                  { x: r, y: 0 },
                  { x: 0, y: n },
                  { x: 0, y: -n },
                ].map((t) => ({
                  type: 'CIMMarkerGraphic',
                  geometry: t,
                  symbol: { type: 'CIMPointSymbol', symbolLayers: [i] },
                }))))
              : ((r = e.stepX / 2),
                (n = e.stepY / 2),
                (a = e.stepY),
                (s = [
                  {
                    type: 'CIMMarkerGraphic',
                    geometry: { x: 0, y: 0 },
                    symbol: { type: 'CIMPointSymbol', symbolLayers: [i] },
                  },
                ])),
            {
              type: 'CIMVectorMarker',
              frame: { xmin: -r, xmax: r, ymin: -n, ymax: n },
              markerGraphics: s,
              size: a,
            }
          );
        }
        static getFillColor(t) {
          if (!t) return null;
          switch (t.type) {
            case 'CIMPolygonSymbol':
              if (t.symbolLayers)
                for (const e of t.symbolLayers) {
                  const t = Ze.getFillColor(e);
                  if (null != t) return t;
                }
              break;
            case 'CIMTextSymbol':
              return Ze.getFillColor(t.symbol);
            case 'CIMSolidFill':
              return t.color;
          }
        }
        static getStrokeColor(t) {
          if (t)
            switch (t.type) {
              case 'CIMPolygonSymbol':
              case 'CIMLineSymbol':
                if (t.symbolLayers)
                  for (const e of t.symbolLayers) {
                    const t = Ze.getStrokeColor(e);
                    if (void 0 !== t) return t;
                  }
                break;
              case 'CIMTextSymbol':
                return Ze.getStrokeColor(t.symbol);
              case 'CIMSolidStroke':
                return t.color;
            }
        }
        static getStrokeWidth(t) {
          if (t)
            switch (t.type) {
              case 'CIMPolygonSymbol':
              case 'CIMLineSymbol':
                if (t.symbolLayers)
                  for (const e of t.symbolLayers) {
                    const t = Ze.getStrokeWidth(e);
                    if (void 0 !== t) return t;
                  }
                break;
              case 'CIMTextSymbol':
                return Ze.getStrokeWidth(t.symbol);
              case 'CIMSolidStroke':
              case 'CIMGradientStroke':
              case 'CIMPictureStroke':
                return t.width;
            }
        }
        static getSize(t) {
          if (t)
            switch (t.type) {
              case 'CIMPointSymbol':
              case 'CIMLineSymbol':
              case 'CIMPolygonSymbol': {
                let e = 0;
                if (t.symbolLayers)
                  for (const i of t.symbolLayers) {
                    const t = Ze.getSize(i);
                    t > e && (e = t);
                  }
                return e;
              }
              case 'CIMSolidStroke':
              case 'CIMPictureStroke':
              case 'CIMGradientStroke':
                return t.width;
              case 'CIMCharacterMarker':
              case 'CIMPictureMarker':
              case 'CIMVectorMarker':
                return t.size;
            }
        }
        static getMarkerScaleRatio(t) {
          if (t)
            switch (t.type) {
              case 'CIMVectorMarker':
                if (!1 !== t.scaleSymbolsProportionally && t.frame) {
                  const e = t.frame.ymax - t.frame.ymin;
                  return t.size / e;
                }
            }
          return 1;
        }
      }
      class Ke {
        static findApplicableOverrides(t, e, i) {
          if (e) {
            if (t.primitiveName) {
              let s = !1;
              for (const e of i)
                if (e.primitiveName === t.primitiveName) {
                  s = !0;
                  break;
                }
              if (!s) for (const s of e) s.primitiveName === t.primitiveName && i.push(s);
            }
            switch (t.type) {
              case 'CIMPointSymbol':
              case 'CIMLineSymbol':
              case 'CIMPolygonSymbol':
                if (t.effects) for (const s of t.effects) Ke.findApplicableOverrides(s, e, i);
                if (t.symbolLayers)
                  for (const s of t.symbolLayers) Ke.findApplicableOverrides(s, e, i);
                break;
              case 'CIMTextSymbol':
                break;
              case 'CIMSolidStroke':
              case 'CIMPictureStroke':
              case 'CIMGradientStroke':
              case 'CIMSolidFill':
              case 'CIMPictureFill':
              case 'CIMHatchFill':
              case 'CIMGradientFill':
              case 'CIMVectorMarker':
              case 'CIMCharacterMarker':
              case 'CIMPictureMarker':
                if (t.effects) for (const s of t.effects) Ke.findApplicableOverrides(s, e, i);
                if (
                  (t.markerPlacement && Ke.findApplicableOverrides(t.markerPlacement, e, i),
                  'CIMVectorMarker' === t.type)
                ) {
                  if (t.markerGraphics)
                    for (const s of t.markerGraphics)
                      Ke.findApplicableOverrides(s, e, i),
                        Ke.findApplicableOverrides(s.symbol, e, i);
                } else
                  'CIMCharacterMarker' === t.type
                    ? Ke.findApplicableOverrides(t.symbol, e, i)
                    : 'CIMHatchFill' === t.type && Ke.findApplicableOverrides(t.lineSymbol, e, i);
            }
          }
        }
        static applyOverrides(t, e, i, s) {
          if (e) {
            if (t.primitiveName)
              for (const n of e)
                if (n.primitiveName === t.primitiveName) {
                  const e = (r = n.propertyName) ? r.charAt(0).toLowerCase() + r.substr(1) : r;
                  if (
                    (s && s.push({ cim: t, nocapPropertyName: e, value: t[e] }),
                    n.expression && (n.value = Ke.toValue(n.propertyName, n.expression)),
                    i)
                  ) {
                    let e = !1;
                    for (const s of i) s.primitiveName === t.primitiveName && (e = !0);
                    e || i.push(n);
                  }
                  t[e] = n.value;
                }
            var r;
            switch (t.type) {
              case 'CIMPointSymbol':
              case 'CIMLineSymbol':
              case 'CIMPolygonSymbol':
                if (t.effects) for (const r of t.effects) Ke.applyOverrides(r, e, i, s);
                if (t.symbolLayers) for (const r of t.symbolLayers) Ke.applyOverrides(r, e, i, s);
                break;
              case 'CIMTextSymbol':
                break;
              case 'CIMSolidStroke':
              case 'CIMSolidFill':
              case 'CIMVectorMarker':
                if (t.effects) for (const r of t.effects) Ke.applyOverrides(r, e, i, s);
                if ('CIMVectorMarker' === t.type && t.markerGraphics)
                  for (const r of t.markerGraphics)
                    Ke.applyOverrides(r, e, i, s), Ke.applyOverrides(r.symbol, e, i, s);
            }
          }
        }
        static restoreOverrides(t) {
          for (const e of t) e.cim[e.nocapPropertyName] = e.value;
        }
        static buildOverrideKey(t) {
          let e = '';
          for (const i of t)
            void 0 !== i.value &&
              (e += `${i.primitiveName}${i.propertyName}${JSON.stringify(i.value)}`);
          return e;
        }
        static toValue(t, e) {
          if ('DashTemplate' === t) return e.split(' ').map((t) => Number(t));
          if ('Color' === t) {
            const t = new Mt.Z(e).toRgba();
            return (t[3] *= 255), t;
          }
          return e;
        }
      }
      var qe = i(30439),
        Je = i(66992),
        $e = (i(11545), i(85674)),
        je = i(19484),
        Qe = i(40642),
        ti = i(60217);
      function ei(t, e, i) {
        const s = (t) => {
            let e = t.length;
            for (; e--; ) if (-1 === ' /-,\n'.indexOf(t.charAt(e))) return !1;
            return !0;
          },
          r = [];
        let n = 0,
          a = -1;
        do {
          if (((a = e.indexOf('[', n)), a >= n)) {
            if (a > n) {
              const t = e.substr(n, a - n);
              r.push([t, null, s(t)]);
            }
            if (((n = a + 1), (a = e.indexOf(']', n)), a >= n)) {
              if (a > n) {
                const i = t[e.substr(n, a - n)];
                i && r.push([null, i, !1]);
              }
              n = a + 1;
            }
          }
        } while (-1 !== a);
        if (n < e.length - 1) {
          const t = e.substr(n);
          r.push([t, null, s(t)]);
        }
        return (t) => {
          let e = '',
            s = null;
          for (const i of r) {
            const [r, n, a] = i;
            if (r) a ? (s = r) : (s && ((e += s), (s = null)), (e += r));
            else {
              const i = t.attributes[n];
              i && (s && ((e += s), (s = null)), (e += i));
            }
          }
          return ii(e, i);
        };
      }
      function ii(t, e) {
        switch (('string' != typeof t && (t = String(t)), e)) {
          case 'LowerCase':
            return t.toLowerCase();
          case 'Allcaps':
            return t.toUpperCase();
          default:
            return t;
        }
      }
      function si(t) {
        return t ? { r: t[0], g: t[1], b: t[2], a: t[3] / 255 } : { r: 0, g: 0, b: 0, a: 0 };
      }
      var ri = i(71435);
      function ni(t, e, i, s, n) {
        const o =
            t.referencesGeometry() && n
              ? (function (t, e, i) {
                  const { transform: s, hasZ: n, hasM: o } = i;
                  ai.has(e) ||
                    ai.set(
                      e,
                      (function (t) {
                        const e = {};
                        switch (t) {
                          case 'esriGeometryPoint':
                            return (t, i, s, r) => (0, ri.c)(i, e, t, s, r);
                          case 'esriGeometryPolygon':
                            return (t, i, s, r) => (0, ri.a)(i, e, t, s, r);
                          case 'esriGeometryPolyline':
                            return (t, i, s, r) => (0, ri.u)(i, e, t, s, r);
                          case 'esriGeometryMultipoint':
                            return (t, i, s, r) => (0, ri.b)(i, e, t, s, r);
                          default:
                            return (
                              a.L.getLogger('esri.views.2d.support.arcadeOnDemand').error(
                                new r.Z('mapview-arcade', `Unable to handle geometryType: ${t}`),
                              ),
                              (t) => t
                            );
                        }
                      })(e),
                    );
                  const l = ai.get(e)(t.geometry, s, n, o);
                  return { ...t, geometry: l };
                })(e, s, n)
              : e,
          l = t.repurposeFeature(o);
        try {
          return t.evaluate({ ...i, $feature: l });
        } catch (t) {
          return (
            a.L.getLogger('esri.views.2d.support.arcadeOnDemand').warn(
              'Feature arcade evaluation failed:',
              t,
            ),
            null
          );
        }
      }
      const ai = new Map();
      function oi(t) {
        let e = 1 / 0,
          i = -1 / 0,
          s = 1 / 0,
          r = -1 / 0;
        for (const n of t)
          for (const t of n)
            t[0] < e && (e = t[0]),
              t[0] > i && (i = t[0]),
              t[1] < s && (s = t[1]),
              t[1] > r && (r = t[1]);
        return [e, s, i, r];
      }
      function li(t, e, i, s, r) {
        const [n, a, o, l] = t;
        if (o < n || l < a) return [0, 0, 0];
        const h = o - n,
          c = l - a,
          u = Math.floor(31.5),
          f = (128 - 2 * (u + 1)) / Math.max(h, c),
          d = Math.round(h * f) + 2 * u,
          _ = Math.round(c * f) + 2 * u;
        let m = 1;
        e && (m = _ / f / (e.ymax - e.ymin));
        let p = 0,
          g = 0;
        if (s)
          if (r) {
            if (e && i && e.ymax - e.ymin > 0) {
              const t = (e.xmax - e.xmin) / (e.ymax - e.ymin);
              (p = s.x / (i * t)), (g = s.y / i);
            }
          } else (p = s.x), (g = s.y);
        return (
          (p = 0.5 * (e.xmax + e.xmin) + p * (e.xmax - e.xmin)),
          (g = 0.5 * (e.ymax + e.ymin) + g * (e.ymax - e.ymin)),
          (p -= n),
          (g -= a),
          (p *= f),
          (g *= f),
          (p += u),
          (g += u),
          [m, p / d - 0.5, -(g / _ - 0.5)]
        );
      }
      const hi = a.L.getLogger('esri.symbols.cim.cimAnalyzer');
      function ci(t) {
        switch (t) {
          case 'Butt':
            return 0;
          case 'Square':
            return 2;
          case 'Round':
          default:
            return 1;
        }
      }
      function ui(t) {
        switch (t) {
          case 'Bevel':
            return 0;
          case 'Miter':
            return 2;
          case 'Round':
          default:
            return 1;
        }
      }
      function fi(t) {
        switch (t) {
          case 'Left':
          default:
            return 'left';
          case 'Right':
            return 'right';
          case 'Center':
            return 'center';
          case 'Justify':
            return 'justify';
        }
      }
      function di(t) {
        switch (t) {
          case 'Top':
          default:
            return 'top';
          case 'Center':
            return 'middle';
          case 'Baseline':
            return 'baseline';
          case 'Bottom':
            return 'bottom';
        }
      }
      function _i(t, e, i, s) {
        let r;
        t[e] ? (r = t[e]) : ((r = {}), (t[e] = r)), (r[i] = s);
      }
      function mi(t) {
        const e = t.markerPlacement;
        return e && e.angleToLine ? 1 : 0;
      }
      function pi(t, e, i, s, r) {
        const n = t.primitiveName,
          a = si(t.color),
          [o, l] = Ri(i, n),
          h = (0, Qe.n)(JSON.stringify(t) + l).toString();
        r.push({
          type: 'fill',
          templateHash: h,
          materialHash: o ? () => h : h,
          cim: t,
          materialOverrides: null,
          colorLocked: t.colorLocked,
          color: Ei(n, e, 'Color', s, a, Ti),
          height: 0,
          angle: 0,
          offsetX: 0,
          offsetY: 0,
          scaleX: 1,
          effects: t.effects,
        });
      }
      function gi(t, e, i, s, r) {
        const n = t.primitiveName,
          a = t.tintColor ? si(t.tintColor) : { r: 255, g: 255, b: 255, a: 1 },
          [o, l] = Ri(i, n),
          h = (0, Qe.n)(JSON.stringify(t) + l).toString(),
          c = (0, Qe.n)(`${t.url}${JSON.stringify(t.colorSubstitutions)}`).toString();
        r.push({
          type: 'fill',
          templateHash: h,
          materialHash: o ? () => c : c,
          cim: t,
          materialOverrides: null,
          colorLocked: t.colorLocked,
          effects: t.effects,
          color: Ei(n, e, 'TintColor', s, a, Ti),
          height: Ei(n, e, 'Height', s, t.height),
          scaleX: Ei(n, e, 'ScaleX', s, t.scaleX),
          angle: Ei(n, e, 'Rotation', s, t.rotation),
          offsetX: Ei(n, e, 'OffsetX', s, t.offsetX),
          offsetY: Ei(n, e, 'OffsetY', s, t.offsetY),
        });
      }
      function yi(t, e, i, s, r) {
        const n = ['Rotation', 'OffsetX', 'OffsetY'],
          a = i.filter(
            (e) => e.primitiveName !== t.primitiveName && -1 === n.indexOf(e.propertyName),
          ),
          o = t.primitiveName,
          [l, h] = Ri(i, o),
          c = (0, Qe.n)(JSON.stringify(t) + h).toString(),
          u = (0, Qe.n)(`${t.separation}${JSON.stringify(t.lineSymbol)}`).toString();
        r.push({
          type: 'fill',
          templateHash: c,
          materialHash: l ? zi(u, e, a, s) : u,
          cim: t,
          materialOverrides: a,
          colorLocked: t.colorLocked,
          effects: t.effects,
          color: { r: 255, g: 255, b: 255, a: 1 },
          height: Ei(o, e, 'Separation', s, t.separation),
          scaleX: 1,
          angle: Ei(o, e, 'Rotation', s, t.rotation),
          offsetX: Ei(o, e, 'OffsetX', s, t.offsetX),
          offsetY: Ei(o, e, 'OffsetY', s, t.offsetY),
        });
      }
      function xi(t, e, i, s, r) {
        const n = t.primitiveName,
          [a, o] = Ri(i, n),
          l = (0, Qe.n)(JSON.stringify(t) + o).toString();
        r.push({
          type: 'fill',
          templateHash: l,
          materialHash: a ? zi(l, e, i, s) : l,
          cim: t,
          materialOverrides: null,
          colorLocked: t.colorLocked,
          effects: t.effects,
          color: { r: 128, g: 128, b: 128, a: 1 },
          height: 0,
          angle: 0,
          offsetX: 0,
          offsetY: 0,
          scaleX: 1,
        });
      }
      function vi(t, e, i, s, r, n, a) {
        const o = t.primitiveName,
          l = si(t.color),
          h = void 0 !== t.width ? t.width : 4,
          c = ci(t.capStyle),
          u = ui(t.joinStyle),
          f = t.miterLimit,
          [d, _] = Ri(i, o),
          m = (0, Qe.n)(JSON.stringify(t) + _).toString();
        r.push({
          type: 'line',
          templateHash: m,
          materialHash: d ? () => m : m,
          cim: t,
          materialOverrides: null,
          isOutline: n,
          colorLocked: t.colorLocked,
          effects: t.effects,
          color: Ei(o, e, 'Color', s, l, Ti),
          width: Ei(o, e, 'Width', s, h),
          cap: Ei(o, e, 'CapStyle', s, c),
          join: Ei(o, e, 'JoinStyle', s, u),
          miterLimit: Ei(o, e, 'MiterLimit', s, f),
          referenceWidth: a,
          zOrder: Ii(t.name),
          isDashed: !1,
        });
      }
      function Mi(t, e, i, s, r, n, a) {
        const o = (0, Qe.n)(`${t.url}${JSON.stringify(t.colorSubstitutions)}`).toString(),
          l = t.primitiveName,
          h = si(t.tintColor),
          c = void 0 !== t.width ? t.width : 4,
          u = ci(t.capStyle),
          f = ui(t.joinStyle),
          d = t.miterLimit,
          [_, m] = Ri(i, l),
          p = (0, Qe.n)(JSON.stringify(t) + m).toString();
        r.push({
          type: 'line',
          templateHash: p,
          materialHash: _ ? () => o : o,
          cim: t,
          materialOverrides: null,
          isOutline: n,
          colorLocked: t.colorLocked,
          effects: t.effects,
          color: Ei(l, e, 'TintColor', s, h, Ti),
          width: Ei(l, e, 'Width', s, c),
          cap: Ei(l, e, 'CapStyle', s, u),
          join: Ei(l, e, 'JoinStyle', s, f),
          miterLimit: Ei(l, e, 'MiterLimit', s, d),
          referenceWidth: a,
          zOrder: Ii(t.name),
          isDashed: !1,
        });
      }
      function Si(t, e, i, s, r, n, a) {
        const o = t.primitiveName,
          l = void 0 !== t.width ? t.width : 4,
          h = ci(t.capStyle),
          c = ui(t.joinStyle),
          u = t.miterLimit,
          [f, d] = Ri(i, o),
          _ = (0, Qe.n)(JSON.stringify(t) + d).toString();
        r.push({
          type: 'line',
          templateHash: _,
          materialHash: f ? zi(_, e, i, s) : _,
          cim: t,
          materialOverrides: null,
          isOutline: n,
          colorLocked: t.colorLocked,
          effects: t.effects,
          color: { r: 128, g: 128, b: 128, a: 1 },
          width: Ei(o, e, 'Width', s, l),
          cap: Ei(o, e, 'CapStyle', s, h),
          join: Ei(o, e, 'JoinStyle', s, c),
          miterLimit: Ei(o, e, 'MiterLimit', s, u),
          referenceWidth: a,
          zOrder: Ii(t.name),
          isDashed: !1,
        });
      }
      function bi(t, e, i, s, r) {
        const n = t.markerPlacement;
        if (!n || 'CIMMarkerPlacementInsidePolygon' !== n.type) return !1;
        const a = n,
          o = ['Rotation', 'OffsetX', 'OffsetY'],
          l = i.filter(
            (e) => e.primitiveName !== t.primitiveName && -1 === o.indexOf(e.propertyName),
          ),
          [h, c] = Ri(i, a.primitiveName),
          u = (0, Qe.n)(JSON.stringify(t) + c).toString();
        return (
          r.push({
            type: 'fill',
            templateHash: u,
            materialHash: h ? zi(u, e, l, s) : u,
            cim: t,
            materialOverrides: l,
            colorLocked: t.colorLocked,
            effects: t.effects,
            color: { r: 255, g: 255, b: 255, a: 1 },
            height: Ei(a.primitiveName, e, 'StepY', s, a.stepY),
            scaleX: 1,
            angle: Ei(a.primitiveName, e, 'GridAngle', s, a.gridAngle),
            offsetX: Ei(a.primitiveName, e, 'OffsetX', s, a.offsetX),
            offsetY: Ei(a.primitiveName, e, 'OffsetY', s, a.offsetY),
          }),
          !0
        );
      }
      function wi(t, e, i, s, r, n, a) {
        const o = t.primitiveName,
          l = t.size,
          h = t.scaleX,
          c = t.rotation,
          u = t.offsetX,
          f = t.offsetY,
          d = si(t.tintColor),
          _ = (0, Qe.n)(`${t.url}${JSON.stringify(t.colorSubstitutions)}`).toString(),
          [m, p] = Ri(i, o),
          g = (0, Qe.n)(JSON.stringify(t) + p).toString();
        r.push({
          type: 'marker',
          templateHash: g,
          materialHash: m ? () => _ : _,
          cim: t,
          materialOverrides: null,
          colorLocked: t.colorLocked,
          effects: t.effects,
          scaleSymbolsProportionally: !1,
          alignment: n,
          size: Ei(o, e, 'Size', s, l),
          scaleX: Ei(o, e, 'ScaleX', s, h),
          rotation: Ei(o, e, 'Rotation', s, c),
          offsetX: Ei(o, e, 'OffsetX', s, u),
          offsetY: Ei(o, e, 'OffsetY', s, f),
          color: Ei(o, e, 'TintColor', s, d, Ti),
          anchorPoint: t.anchorPoint,
          isAbsoluteAnchorPoint: 'Relative' !== t.anchorPointUnits,
          outlineColor: { r: 0, g: 0, b: 0, a: 0 },
          outlineWidth: 0,
          frameHeight: 0,
          rotateClockwise: t.rotateClockwise,
          referenceSize: a,
          sizeRatio: 1,
          markerPlacement: t.markerPlacement,
        });
      }
      function Pi(t, e, i, s, r, n, a, o) {
        const l = t.markerGraphics;
        if (!l) return;
        let h = 0;
        if (t.scaleSymbolsProportionally) {
          const e = t.frame;
          e && (h = e.ymax - e.ymin);
        }
        for (const c of l)
          if (c) {
            const l = c.symbol;
            if (!l) continue;
            switch (l.type) {
              case 'CIMPointSymbol':
              case 'CIMLineSymbol':
              case 'CIMPolygonSymbol':
                Li(t, c, i, e, s, r, n, a, h, o);
                break;
              case 'CIMTextSymbol':
                Ci(t, c, e, i, s, r, n, a, h);
            }
          }
      }
      function Ci(t, e, i, s, r, n, a, o, l) {
        Ke.findApplicableOverrides(e, s, []);
        const h = e.geometry;
        if (!('x' in h) || !('y' in h)) return;
        const c = e.symbol,
          u = (f = c).underline ? 'underline' : f.strikethrough ? 'line-through' : 'none';
        var f;
        const d = (function (t) {
          let e = 'normal',
            i = 'normal';
          if (t) {
            const s = t.toLowerCase();
            -1 !== s.indexOf('italic')
              ? (e = 'italic')
              : -1 !== s.indexOf('oblique') && (e = 'oblique'),
              -1 !== s.indexOf('bold')
                ? (i = 'bold')
                : -1 !== s.indexOf('light') && (i = 'lighter');
          }
          return { style: e, weight: i };
        })(c.fontStyleName);
        c.font = { family: c.fontFamilyName, decoration: u, ...d };
        const _ = t.frame,
          m = h.x - 0.5 * (_.xmin + _.xmax),
          p = h.y - 0.5 * (_.ymin + _.ymax),
          g = t.size / l,
          y = t.primitiveName,
          x = (c.height || 0) * g,
          v = c.angle || 0,
          M = ((c.offsetX || 0) + m) * g,
          S = ((c.offsetY || 0) + p) * g,
          b = si(Ze.getFillColor(c));
        let w = si(Ze.getStrokeColor(c)),
          P = Ze.getStrokeWidth(c);
        P || ((w = si(Ze.getFillColor(c.haloSymbol))), (P = c.haloSize * g));
        let C = '';
        for (const t of s)
          t.primitiveName === y &&
            void 0 !== t.value &&
            (C += `-${t.primitiveName}-${t.propertyName}-${JSON.stringify(t.value)}`);
        const L =
            JSON.stringify(t.effects) +
            Number(t.colorLocked) +
            JSON.stringify(t.anchorPoint) +
            t.anchorPointUnits +
            JSON.stringify(t.markerPlacement),
          k = (0, Qe.n)(JSON.stringify(e) + L + C).toString();
        n.push({
          type: 'text',
          templateHash: k,
          materialHash: () => (0, Qe.n)(JSON.stringify(c.font)).toString(),
          cim: c,
          materialOverrides: null,
          colorLocked: t.colorLocked,
          effects: t.effects,
          alignment: a,
          anchorPoint: {
            x: t.anchorPoint ? t.anchorPoint.x : 0,
            y: t.anchorPoint ? t.anchorPoint.y : 0,
          },
          isAbsoluteAnchorPoint: 'Relative' !== t.anchorPointUnits,
          fontName: c.fontFamilyName,
          decoration: 'none',
          weight: 'normal',
          style: 'normal',
          size: Ei(y, i, 'Size', r, x),
          angle: Ei(y, i, 'Rotation', r, v),
          offsetX: Ei(y, i, 'OffsetX', r, M),
          offsetY: Ei(y, i, 'OffsetY', r, S),
          horizontalAlignment: fi(c.horizontalAlignment),
          verticalAlignment: di(c.verticalAlignment),
          text: Ei(e.primitiveName, i, 'TextString', r, e.textString, ii, c.textCase),
          color: b,
          outlineColor: w,
          outlineSize: P,
          referenceSize: o,
          sizeRatio: 1,
          markerPlacement: t.markerPlacement,
        });
      }
      function Li(t, e, i, s, r, n, a, o, l, h) {
        const c = e.symbol,
          u = e.geometry;
        if (!u) return;
        const f = c.symbolLayers;
        if (!f) return;
        if (h) return void ki(t, e, s, i, r, n, a, o, l);
        let d = f.length;
        for (; d--; ) {
          const h = f[d];
          if (h && !1 !== h.enable)
            switch (h.type) {
              case 'CIMSolidFill':
              case 'CIMSolidStroke': {
                const c = (_ = u)
                  ? _.rings
                    ? oi(_.rings)
                    : _.paths
                    ? oi(_.paths)
                    : (0, wt.YX)(_)
                    ? [_.xmin, _.ymin, _.xmax, _.ymax]
                    : null
                  : null;
                if (!c) continue;
                const [f, d, m] = li(
                    c,
                    t.frame,
                    t.size,
                    t.anchorPoint,
                    'Relative' !== t.anchorPointUnits,
                  ),
                  p = 'CIMSolidFill' === h.type,
                  g = { type: 'sdf', geom: u, asFill: p },
                  y = t.primitiveName,
                  x = t.size,
                  v = t.rotation || 0,
                  M = t.offsetX,
                  S = t.offsetY,
                  b = h.primitiveName,
                  w = si(p ? Ze.getFillColor(h) : Ze.getStrokeColor(h)),
                  P = p ? { r: 0, g: 0, b: 0, a: 0 } : si(Ze.getStrokeColor(h)),
                  C = Ze.getStrokeWidth(h);
                if (!p && !C) break;
                let L = !1,
                  k = '';
                for (const t of i)
                  (t.primitiveName !== b && t.primitiveName !== y) ||
                    (void 0 !== t.value
                      ? (k += `-${t.primitiveName}-${t.propertyName}-${JSON.stringify(t.value)}`)
                      : t.valueExpressionInfo && (L = !0));
                const I = JSON.stringify({ ...t, markerGraphics: null }),
                  T = (0, Qe.n)(JSON.stringify(g)).toString(),
                  E = {
                    type: 'marker',
                    templateHash: (0, Qe.n)(
                      JSON.stringify(e) + JSON.stringify(h) + I + k,
                    ).toString(),
                    materialHash: L ? () => T : T,
                    cim: g,
                    materialOverrides: null,
                    colorLocked: t.colorLocked,
                    effects: t.effects,
                    scaleSymbolsProportionally: t.scaleSymbolsProportionally,
                    alignment: a,
                    anchorPoint: { x: d, y: m },
                    isAbsoluteAnchorPoint: !1,
                    size: Ei(t.primitiveName, s, 'Size', r, x),
                    rotation: Ei(t.primitiveName, s, 'Rotation', r, v),
                    offsetX: Ei(t.primitiveName, s, 'OffsetX', r, M),
                    offsetY: Ei(t.primitiveName, s, 'OffsetY', r, S),
                    scaleX: 1,
                    frameHeight: l,
                    rotateClockwise: t.rotateClockwise,
                    referenceSize: o,
                    sizeRatio: f,
                    color: Ei(b, s, 'Color', r, w, Ti),
                    outlineColor: Ei(b, s, 'Color', r, P, Ti),
                    outlineWidth: Ei(b, s, 'Width', r, C),
                    markerPlacement: t.markerPlacement,
                  };
                n.push(E);
                break;
              }
              default:
                ki(t, e, s, i, r, n, a, o, l);
            }
        }
        var _;
      }
      function ki(t, e, i, s, r, n, a, o, l) {
        const h = (function (t, e) {
          return {
            type: t.type,
            enable: !0,
            name: t.name,
            colorLocked: t.colorLocked,
            primitiveName: t.primitiveName,
            anchorPoint: t.anchorPoint,
            anchorPointUnits: t.anchorPointUnits,
            offsetX: 0,
            offsetY: 0,
            rotateClockwise: t.rotateClockwise,
            rotation: 0,
            size: t.size,
            billboardMode3D: t.billboardMode3D,
            depth3D: t.depth3D,
            frame: t.frame,
            markerGraphics: [e],
            scaleSymbolsProportionally: t.scaleSymbolsProportionally,
            respectFrame: t.respectFrame,
            clippingPath: t.clippingPath,
            effects: t.effects,
          };
        })(t, e);
        let c = [];
        const u = ['Rotation', 'OffsetX', 'OffsetY'];
        c = s.filter(
          (e) => e.primitiveName !== t.primitiveName || -1 === u.indexOf(e.propertyName),
        );
        let f = '';
        for (const t of s)
          void 0 !== t.value &&
            (f += `-${t.primitiveName}-${t.propertyName}-${JSON.stringify(t.value)}`);
        const [d, _, m] = Ze.getTextureAnchor(h),
          p = t.primitiveName,
          g = t.rotation || 0,
          y = t.offsetX || 0,
          x = t.offsetY || 0,
          v = (0, Qe.n)(JSON.stringify(h) + f).toString(),
          M = {
            type: 'marker',
            templateHash: v,
            materialHash: 0 === c.length ? v : zi(v, i, c, r),
            cim: h,
            materialOverrides: c,
            colorLocked: t.colorLocked,
            effects: t.effects,
            scaleSymbolsProportionally: t.scaleSymbolsProportionally,
            alignment: a,
            anchorPoint: { x: d, y: _ },
            isAbsoluteAnchorPoint: !1,
            size: t.size,
            rotation: Ei(p, i, 'Rotation', r, g),
            offsetX: Ei(p, i, 'OffsetX', r, y),
            offsetY: Ei(p, i, 'OffsetY', r, x),
            color: { r: 0, g: 0, b: 0, a: 0 },
            outlineColor: { r: 0, g: 0, b: 0, a: 0 },
            outlineWidth: 0,
            scaleX: 1,
            frameHeight: l,
            rotateClockwise: t.rotateClockwise,
            referenceSize: o,
            sizeRatio: m / (0, z.a)(t.size),
            markerPlacement: t.markerPlacement,
          };
        n.push(M);
      }
      function Ii(t) {
        if (t && 0 === t.indexOf('Level_')) {
          const e = parseInt(t.substr(6), 10);
          if (NaN !== e) return e;
        }
        return 0;
      }
      function Ti(t) {
        if (!t || 0 === t.length) return null;
        const e = new Mt.Z(t).toRgba();
        return { r: e[0], g: e[1], b: e[2], a: e[3] };
      }
      function Ei(t, e, i, s, r, n, a) {
        const o = e[t];
        if (o) {
          const t = o[i];
          if ('string' == typeof t || 'number' == typeof t || t instanceof Array)
            return n ? n.call(null, t, a) : t;
          if (null != t && t instanceof ti.A)
            return (e, i, o) => {
              let l = ni(t, e, { $view: o }, s.geometryType, i);
              return null !== l && n && (l = n.call(null, l, a)), null !== l ? l : r;
            };
        }
        return r;
      }
      function zi(t, e, i, s) {
        for (const t of i)
          if (t.valueExpressionInfo) {
            const i = e[t.primitiveName] && e[t.primitiveName][t.propertyName];
            i instanceof ti.A && (t.fn = (t, e, r) => ni(i, t, { $view: r }, s.geometryType, e));
          }
        return (e, s, r) => {
          for (const t of i) t.fn && (t.value = t.fn(e, s, r));
          return (0, Qe.n)(t + Ke.buildOverrideKey(i)).toString();
        };
      }
      function Ri(t, e) {
        let i = !1,
          s = '';
        for (const r of t)
          r.primitiveName === e &&
            (void 0 !== r.value
              ? (s += `-${r.primitiveName}-${r.propertyName}-${JSON.stringify(r.value)}`)
              : r.valueExpressionInfo && (i = !0));
        return [i, s];
      }
      var Vi,
        Ai = i(45731),
        Oi =
          (i(55306),
          i(71206),
          i(51979),
          i(60698),
          i(65684),
          i(86758),
          i(95310),
          i(20208),
          i(16218)),
        Fi = i(98788),
        Ni = (i(95533), i(94751), i(81317), i(90319)),
        Gi = (i(38822), i(2906)),
        Wi = i(52228);
      let Bi = (Vi = class extends Ni.Z {
        writeLevels(t, e, i) {
          for (const i in t) {
            const t = this.levels[i];
            return void (e.stops = t);
          }
        }
        clone() {
          return new Vi({
            axis: this.axis,
            field: this.field,
            valueExpression: this.valueExpression,
            valueExpressionTitle: this.valueExpressionTitle,
            maxDataValue: this.maxDataValue,
            maxSize: (0, Wi.i)(this.maxSize) ? this.maxSize.clone() : this.maxSize,
            minDataValue: this.minDataValue,
            minSize: (0, Wi.i)(this.minSize) ? this.minSize.clone() : this.minSize,
            normalizationField: this.normalizationField,
            stops: this.stops && this.stops.map((t) => t.clone()),
            target: this.target,
            useSymbolValue: this.useSymbolValue,
            valueRepresentation: this.valueRepresentation,
            valueUnit: this.valueUnit,
            legendOptions: this.legendOptions && this.legendOptions.clone(),
            levels: (0, n.d9)(this.levels),
          });
        }
      });
      function Di(t, e) {
        return Math.max(t, e);
      }
      function Xi(t) {
        return (function (t) {
          switch (ht.load(t).geometryType) {
            case k.a.MARKER:
              return new mt(t);
            case k.a.FILL:
              return new _t(t);
            case k.a.LINE:
              return new pt(t);
            case k.a.TEXT:
              return new gt(t);
            case k.a.LABEL:
              return new yt(t);
          }
        })(t);
      }
      function Yi(t) {
        switch (t.type) {
          case 'line-marker':
            var e;
            return {
              type: 'line-marker',
              color: null == (e = t.color) ? void 0 : e.toJSON(),
              placement: t.placement,
              style: t.style,
            };
          default:
            return (0, Oi.i)(t.toJSON()).toJSON();
        }
      }
      function Hi(t, e, i) {
        if (!t) return null;
        let s = 0,
          r = !1,
          a = 0;
        switch (
          ((0, n.i)(e) &&
            ((a = (function (t) {
              if (!('visualVariables' in t)) return 0;
              if (!t.hasVisualVariables('size')) return 0;
              const e = t.getVisualVariablesForType('size');
              if (!e[0]) return 0;
              const i = e[0];
              if ('stops' === i.transformationType) return i.stops.map((t) => t.size).reduce(Di, 0);
              if ('clamped-linear' === i.transformationType) {
                let t = -1 / 0,
                  e = -1 / 0;
                return (
                  (t =
                    'number' == typeof i.maxSize
                      ? i.maxSize
                      : i.maxSize.stops.map((t) => t.size).reduce(Di, 0)),
                  (e =
                    'number' == typeof i.minSize
                      ? i.minSize
                      : i.minSize.stops.map((t) => t.size).reduce(Di, 0)),
                  Math.max(t, e)
                );
              }
              return 'real-world-size' === i.transformationType ? 30 : void 0;
            })(e)),
            'visualVariables' in e &&
              ((s = (function (t) {
                if (!t) return k.b.NONE;
                let e = 0;
                for (const i of t)
                  if ('size' === i.type) {
                    const t = (0, Fi.g)(i);
                    (e |= t), 'outline' === i.target && (e |= t << 4);
                  } else
                    'color' === i.type
                      ? (e |= k.b.COLOR)
                      : 'opacity' === i.type
                      ? (e |= k.b.OPACITY)
                      : 'rotation' === i.type && (e |= k.b.ROTATION);
                return e;
              })(e.visualVariables || [])),
              (r = 'dot-density' === e.type))),
          t.type)
        ) {
          case 'simple-fill':
          case 'picture-fill':
            return (function (t, e, i, s) {
              const r = lt(k.a.FILL, e, !1, i),
                n = s ? Xi(r) : r,
                a = t.clone(),
                o = a.outline;
              a.outline = null;
              const l = [],
                h = { materialKey: n, hash: a.hash(), ...Yi(a) };
              if ((l.push(h), o)) {
                const t = lt(k.a.LINE, e, !0, !1),
                  i = { materialKey: s ? Xi(t) : t, hash: o.hash(), ...Yi(o) };
                l.push(i);
              }
              return {
                type: 'composite-symbol',
                layers: l,
                hash: l.reduce((t, e) => e.hash + t, ''),
              };
            })(t, s, r, i);
          case 'simple-marker':
          case 'picture-marker':
            return (function (t, e, i, s) {
              const r = lt(k.a.MARKER, e, !1, !1),
                n = s ? Xi(r) : r,
                a = Yi(t);
              return { materialKey: n, hash: t.hash(), ...a, angle: t.angle, maxVVSize: i };
            })(t, s, a, i);
          case 'simple-line':
            return (function (t, e, i) {
              const s = lt(k.a.LINE, e, !1, !1),
                r = i ? Xi(s) : s,
                n = t.clone(),
                a = n.marker;
              n.marker = null;
              const o = [];
              if ((o.push({ materialKey: r, hash: n.hash(), ...Yi(n) }), a)) {
                var l;
                const t = lt(k.a.MARKER, e, !1, !1),
                  s = i ? Xi(t) : t;
                (a.color = null != (l = a.color) ? l : n.color),
                  o.push({ materialKey: s, hash: a.hash(), lineWidth: n.width, ...Yi(a) });
              }
              return {
                type: 'composite-symbol',
                layers: o,
                hash: o.reduce((t, e) => e.hash + t, ''),
              };
            })(t, s, i);
          case 'text':
            return (function (t, e, i, s) {
              const r = lt(k.a.TEXT, e, !1, !1),
                n = s ? Xi(r) : r,
                a = Yi(t);
              return { materialKey: n, hash: t.hash(), ...a, angle: t.angle, maxVVSize: i };
            })(t, s, a, i);
          case 'label':
            return (function (t, e, i) {
              const s = t.toJSON(),
                r = lt(k.a.LABEL, e, !1, !1, s.labelPlacement);
              return {
                materialKey: i ? Xi(r) : r,
                hash: t.hash(),
                ...s,
                labelPlacement: s.labelPlacement,
              };
            })(t, s, i);
          case 'cim':
            return { type: 'cim', rendererKey: s, data: t.data, maxVVSize: a };
          case 'web-style':
            return { ...Yi(t), type: 'web-style', hash: t.hash(), rendererKey: s, maxVVSize: a };
          default:
            throw new Error(`symbol not supported ${t.type}`);
        }
      }
      (0, s._)([(0, l.Cb)()], Bi.prototype, 'levels', void 0),
        (0, s._)([(0, Gi.w)('levels')], Bi.prototype, 'writeLevels', null),
        (Bi = Vi = (0, s._)([(0, h.j)('esri.views.2d.engine.LevelDependentSizeVariable')], Bi)),
        a.L.getLogger('esri.views.2d.layers.support.clusterUtils'),
        n.h.add('esri-cluster-arcade-enabled', !0),
        (0, n.h)('esri-cluster-arcade-enabled'),
        new (i(57251).J)({
          esriGeometryPoint: 'point',
          esriGeometryMultipoint: 'multipoint',
          esriGeometryPolyline: 'polyline',
          esriGeometryPolygon: 'polygon',
          esriGeometryMultiPatch: 'multipatch',
          mesh: 'mesh',
        }),
        Math.PI,
        F(),
        W(),
        W(),
        W(),
        W(),
        W(),
        W(),
        W(),
        W(),
        d.u.metrics,
        new Ve(0, 0, 24, 24),
        a.L.getLogger('esri.renderers.visualVariables.support.utils'),
        a.L.getLogger('esri.views.2d.layers.features.schemaUtils');
      var Ui = i(89241),
        Zi = (i(96467), i(51589));
      function Ki(t, e) {
        if (t && 'name' in t) {
          const i = t;
          return e && e.error(new r.Z(i.name, i.message, i.details)), !1;
        }
        return !0;
      }
      class qi {
        constructor(t) {
          (this._head = t), (this._cursor = t);
        }
        static from(t, e = 0, i = t.byteLength / Ji.BYTES_PER_RECORD - e) {
          const s = new Ji(new Int32Array(t, e * Ji.BYTES_PER_RECORD, i * Ji.ELEMENTS_PER_RECORD));
          return new qi(s);
        }
        size() {
          var t, e;
          return null != (t = null == (e = this._cursor) ? void 0 : e.size()) ? t : 0;
        }
        get id() {
          return this._cursor.id;
        }
        set id(t) {
          this._cursor.id = t;
        }
        get materialKey() {
          return this._cursor.materialKey;
        }
        set materialKey(t) {
          this._cursor.materialKey = t;
        }
        get insertAfter() {
          return this._cursor.insertAfter;
        }
        get indexFrom() {
          return this._cursor.indexFrom;
        }
        set indexFrom(t) {
          this._cursor.indexFrom = t;
        }
        get indexCount() {
          return this._cursor.indexCount;
        }
        set indexCount(t) {
          this._cursor.indexCount = t;
        }
        get vertexFrom() {
          return this._cursor.vertexFrom;
        }
        set vertexFrom(t) {
          this._cursor.vertexFrom = t;
        }
        get vertexCount() {
          return this._cursor.vertexCount;
        }
        set vertexCount(t) {
          this._cursor.vertexCount = t;
        }
        get index() {
          return this._cursor._index;
        }
        link(t) {
          if (!this._head) return void (this._head = t._head);
          let e = this._head;
          for (; e._link; ) e = e._link;
          e._link = t._head;
        }
        getCursor() {
          return this.copy();
        }
        lookup(t) {
          for (this._cursor = this._head; this._cursor && !this._cursor.lookup(t); ) {
            if (!this._cursor._link) return !1;
            this._cursor = this._cursor._link;
          }
          return !!this._cursor;
        }
        copy() {
          var t;
          const e = new qi(null == (t = this._head) ? void 0 : t.copy());
          if (!e._head) return e;
          let i = e._head,
            s = e._head._link;
          for (; s; ) (i._link = s.copy()), (i = s), (s = i._link);
          return e;
        }
        next() {
          return (
            !!this._cursor &&
            (!!this._cursor.next() ||
              (!!this._cursor._link && ((this._cursor = this._cursor._link), this.next())))
          );
        }
        peekId() {
          var t;
          return null != (t = this._cursor.peekId()) ? t : this._cursor._link.peekId();
        }
        delete(t) {
          let e = this._head,
            i = null;
          for (; e; ) {
            if (e.delete(t))
              return (
                e.isEmpty() &&
                  ((0, n.i)(i) && (i._link = e._link),
                  e === this._head && (this._head = e._link),
                  e === this._cursor && (this._cursor = e._link)),
                !0
              );
            (i = e), (e = e._link);
          }
          return !1;
        }
      }
      (qi.ELEMENTS_PER_RECORD = d.D),
        (qi.BYTES_PER_RECORD = qi.ELEMENTS_PER_RECORD * Int32Array.BYTES_PER_ELEMENT);
      class Ji {
        constructor(t) {
          (this._link = null),
            (this._index = -1),
            (this._deletedCount = 0),
            (this._offsets = { instance: null }),
            (this._packedRecords = t);
        }
        static from(t, e = 0, i = t.byteLength / this.BYTES_PER_RECORD - e) {
          return new Ji(new Int32Array(t, e * this.BYTES_PER_RECORD, i * this.ELEMENTS_PER_RECORD));
        }
        delete(t) {
          const e = this._index,
            i = this.lookup(t);
          if (i)
            for (this.id = 2147483647, ++this._deletedCount; this.next() && this.id === t; )
              (this.id = 2147483647), ++this._deletedCount;
          return (this._index = e), i;
        }
        isEmpty() {
          return this._deletedCount === this.size();
        }
        link(t) {
          this._link ? this._link.link(t) : (this._link = t);
        }
        lookup(t) {
          if ((0, n.b)(this._offsets.instance)) {
            this._offsets.instance = new Map();
            const t = this.copy();
            t._index = -1;
            let e = 0;
            for (; t.next(); )
              t.id !== e && (this._offsets.instance.set(t.id, t._index), (e = t.id));
          }
          if (!this._offsets.instance.has(t)) return !1;
          const e = this._index;
          return (
            (this._index = this._offsets.instance.get(t)),
            2147483647 !== this.id || ((this._index = e), !1)
          );
        }
        get id() {
          return this._packedRecords[this._index * Ji.ELEMENTS_PER_RECORD];
        }
        set id(t) {
          this._packedRecords[this._index * Ji.ELEMENTS_PER_RECORD] = t;
        }
        get materialKey() {
          return this._packedRecords[this._index * Ji.ELEMENTS_PER_RECORD + 1];
        }
        set materialKey(t) {
          this._packedRecords[this._index * Ji.ELEMENTS_PER_RECORD + 1] = t;
        }
        get insertAfter() {
          return this._packedRecords[this._index * Ji.ELEMENTS_PER_RECORD + 2];
        }
        get indexFrom() {
          return this._packedRecords[this._index * Ji.ELEMENTS_PER_RECORD + 3];
        }
        set indexFrom(t) {
          this._packedRecords[this._index * Ji.ELEMENTS_PER_RECORD + 3] = t;
        }
        get indexCount() {
          return this._packedRecords[this._index * Ji.ELEMENTS_PER_RECORD + 4];
        }
        set indexCount(t) {
          this._packedRecords[this._index * Ji.ELEMENTS_PER_RECORD + 4] = t;
        }
        get vertexFrom() {
          return this._packedRecords[this._index * Ji.ELEMENTS_PER_RECORD + 5];
        }
        set vertexFrom(t) {
          this._packedRecords[this._index * Ji.ELEMENTS_PER_RECORD + 5] = t;
        }
        get vertexCount() {
          return this._packedRecords[this._index * Ji.ELEMENTS_PER_RECORD + 6];
        }
        set vertexCount(t) {
          this._packedRecords[this._index * Ji.ELEMENTS_PER_RECORD + 6] = t;
        }
        get index() {
          return this._index;
        }
        size() {
          return this._packedRecords.length / Ji.ELEMENTS_PER_RECORD;
        }
        next() {
          for (; ++this._index < this.size() && 2147483647 === this.id; );
          return this._index < this.size();
        }
        peekId() {
          const t = (this._index + 1) * Ji.ELEMENTS_PER_RECORD;
          return t >= this._packedRecords.length ? 0 : this._packedRecords[t];
        }
        getCursor() {
          return this.copy();
        }
        copy() {
          const t = new Ji(this._packedRecords);
          return (
            (t._link = this._link),
            (t._index = this._index),
            (t._offsets = this._offsets),
            (t._deletedCount = this._deletedCount),
            t
          );
        }
      }
      (Ji.ELEMENTS_PER_RECORD = d.D),
        (Ji.BYTES_PER_RECORD = Ji.ELEMENTS_PER_RECORD * Int32Array.BYTES_PER_ELEMENT);
      const $i = new Map();
      $i.set(k.a.MARKER, { multiplier: 1, indicesPerRecord: 6, verticesPerRecord: 4 }),
        $i.set(k.a.LINE, { multiplier: 1, indicesPerRecord: 24, verticesPerRecord: 8 }),
        $i.set(k.a.FILL, { multiplier: 1, indicesPerRecord: 10, verticesPerRecord: 10 }),
        $i.set(k.a.TEXT, { multiplier: 8, indicesPerRecord: 6, verticesPerRecord: 4 }),
        $i.set(k.a.LABEL, { multiplier: 8, indicesPerRecord: 6, verticesPerRecord: 4 });
      const ji = { marker: k.a.MARKER, fill: k.a.FILL, line: k.a.LINE, text: k.a.TEXT };
      class Qi {
        constructor(t, e, i, s) {
          const r = {
              minScale: null == e ? void 0 : e.minScale,
              maxScale: null == e ? void 0 : e.maxScale,
            },
            n = (function (t) {
              return t.minScale || t.maxScale ? t.minScale + '-' + t.maxScale : '';
            })(r);
          (this.layers = t),
            (this.data = e),
            (this.hash = this._createHash() + n),
            (this.rendererKey = i);
          for (const e of t) {
            const t = ji[e.type];
            (e.materialKey = lt(t, this.rendererKey, !1, !1)),
              (e.maxVVSize = s),
              (e.scaleInfo = r),
              (e.templateHash += n);
          }
        }
        get type() {
          return 'expanded-cim';
        }
        _createHash() {
          let t = '';
          for (const e of this.layers) t += e.templateHash;
          return t;
        }
      }
      const ts = async (t, e) =>
          new Qi(
            await (async function (t, e, i, s) {
              const r = [];
              if (!t) return r;
              let n, a;
              const o = {};
              if ('CIMSymbolReference' !== t.type)
                return hi.error("Expect cim type to be 'CIMSymbolReference'"), r;
              if (((n = t.symbol), (a = t.primitiveOverrides), a)) {
                const t = [];
                for (const i of a) {
                  const s = i.valueExpressionInfo;
                  if (s && e) {
                    const r = s.expression,
                      n = (0, ti.a)(r, e.spatialReference, e.fields).then((t) => {
                        t && _i(o, i.primitiveName, i.propertyName, t);
                      });
                    t.push(n);
                  } else null != i.value && _i(o, i.primitiveName, i.propertyName, i.value);
                }
                await Promise.all(t);
              }
              switch (n.type) {
                case 'CIMPointSymbol':
                case 'CIMLineSymbol':
                case 'CIMPolygonSymbol':
                  !(function (t, e, i, s, r, n) {
                    if (!t) return;
                    const a = t.symbolLayers;
                    if (!a) return;
                    let o;
                    const l = Ze.getSize(t);
                    'CIMPointSymbol' === t.type && 'Map' === t.angleAlignment && (o = 1);
                    let h = a.length;
                    for (; h--; ) {
                      const n = a[h];
                      if (!n || !1 === n.enable) continue;
                      const c = [];
                      switch ((Ke.findApplicableOverrides(n, e, c), n.type)) {
                        case 'CIMSolidFill':
                          pi(n, i, c, s, r);
                          break;
                        case 'CIMPictureFill':
                          gi(n, i, c, s, r);
                          break;
                        case 'CIMHatchFill':
                          yi(n, i, c, s, r);
                          break;
                        case 'CIMGradientFill':
                          xi(n, i, c, s, r);
                          break;
                        case 'CIMSolidStroke':
                          vi(n, i, c, s, r, 'CIMPolygonSymbol' === t.type, l);
                          break;
                        case 'CIMPictureStroke':
                          Mi(n, i, c, s, r, 'CIMPolygonSymbol' === t.type, l);
                          break;
                        case 'CIMGradientStroke':
                          Si(n, i, c, s, r, 'CIMPolygonSymbol' === t.type, l);
                          break;
                        case 'CIMCharacterMarker':
                          if (bi(n, i, c, s, r)) break;
                          break;
                        case 'CIMPictureMarker':
                          if (bi(n, i, c, s, r)) break;
                          'CIMLineSymbol' === t.type && (o = mi(n)), wi(n, i, c, s, r, o, l);
                          break;
                        case 'CIMVectorMarker':
                          if (bi(n, i, c, s, r)) break;
                          'CIMLineSymbol' === t.type && (o = mi(n)),
                            Pi(n, i, c, s, r, o, l, undefined);
                          break;
                        default:
                          hi.error('Cannot analyze CIM layer', n.type);
                      }
                    }
                  })(n, a, o, e, r);
              }
              return r;
            })(t.data, e),
            t.data,
            t.rendererKey,
            t.maxVVSize,
          ),
        es = async (t, e, i) => {
          if (!t) return null;
          if ('cim' === t.type) return ts(t, e);
          if ('web-style' === t.type) {
            const s = Zi.Z.fromJSON(t),
              r = {
                type: 'cim',
                data: (await s.fetchCIMSymbol(i)).data,
                rendererKey: t.rendererKey,
                maxVVSize: t.maxVVSize,
              };
            return ts(r, e);
          }
          return t;
        };
      class is {
        constructor(t, e) {
          this._pos = 0;
          const i = e ? this._roundToNearest(e, t.BYTES_PER_ELEMENT) : 40;
          (this._array = new ArrayBuffer(i)),
            (this._buffer = new t(this._array)),
            (this._ctor = t),
            (this._i16View = new Int16Array(this._array));
        }
        get length() {
          return this._pos;
        }
        _roundToNearest(t, e) {
          const i = Math.round(t);
          return i + (e - (i % e));
        }
        _ensureSize(t) {
          if (this._pos + t >= this._buffer.length) {
            const e = this._roundToNearest(
                1.5 * (this._array.byteLength + t * this._buffer.BYTES_PER_ELEMENT),
                this._buffer.BYTES_PER_ELEMENT,
              ),
              i = new ArrayBuffer(e),
              s = new this._ctor(i);
            s.set(this._buffer, 0),
              (this._array = i),
              (this._buffer = s),
              (this._i16View = new Int16Array(this._array));
          }
        }
        writeF32(t) {
          this._ensureSize(1);
          const e = this._pos;
          return (new Float32Array(this._array, 4 * this._pos, 1)[0] = t), this._pos++, e;
        }
        push(t) {
          this._ensureSize(1);
          const e = this._pos;
          return (this._buffer[this._pos++] = t), e;
        }
        writeFixed(t) {
          this._buffer[this._pos++] = t;
        }
        setValue(t, e) {
          this._buffer[t] = e;
        }
        i1616Add(t, e, i) {
          (this._i16View[2 * t] += e), (this._i16View[2 * t + 1] += i);
        }
        getValue(t) {
          return this._buffer[t];
        }
        incr(t) {
          if (this._buffer.length < t)
            throw new Error('Increment index overflows the target buffer');
          this._buffer[t]++;
        }
        decr(t) {
          this._buffer[t]--;
        }
        writeRegion(t) {
          this._ensureSize(t.length);
          const e = this._pos;
          return this._buffer.set(t, this._pos), (this._pos += t.length), e;
        }
        writeManyFrom(t, e, i) {
          this._ensureSize(i - e);
          for (let s = e; s !== i; s++) this.writeFixed(t._buffer[s]);
        }
        buffer() {
          const t = this._array.slice(0, 4 * this._pos);
          return this.destroy(), t;
        }
        toArray() {
          const t = this._array,
            e = [];
          for (let i = 0; i < t.byteLength / 4; i++) e.push(t[i]);
          return e;
        }
        seek(t) {
          this._pos = t;
        }
        destroy() {
          (this._array = null), (this._buffer = null);
        }
      }
      class ss {
        constructor(t, e, i) {
          this._start = { index: 0, vertex: 0 };
          const s = (function (t, e, i) {
              const { indicesPerRecord: s, multiplier: r, verticesPerRecord: n } = $i.get(t);
              return {
                recordBytes: i * d.D * Uint32Array.BYTES_PER_ELEMENT,
                indexBytes: r * s * i * Uint32Array.BYTES_PER_ELEMENT,
                vertexBytes: r * n * i * e,
              };
            })(t, e, i),
            r = e / 4;
          (this.geometryType = t),
            (this._records = new is(Int32Array, s.recordBytes)),
            (this._indices = new is(Uint32Array, s.indexBytes)),
            (this._vertices = new is(Uint32Array, s.vertexBytes)),
            (this._metrics = new is(Float32Array, 0)),
            (this._strideInt = r);
        }
        serialize(t) {
          const e = this._records.buffer(),
            i = this._indices.buffer(),
            s = this._vertices.buffer(),
            r = this._metrics.length ? this._metrics.buffer() : null,
            n = 4 * this._strideInt;
          return t.push(e, i, s), { stride: n, records: e, indices: i, vertices: s, metrics: r };
        }
        get strideInt() {
          return this._strideInt;
        }
        get recordCount() {
          return this._records.length / d.D;
        }
        get vertexCount() {
          return this._vertices.length / this._strideInt;
        }
        get indexCount() {
          return this._indices.length;
        }
        get indexWriter() {
          return this._indices;
        }
        get vertexWriter() {
          return this._vertices;
        }
        get metricWriter() {
          return this._metrics;
        }
        recordStart() {
          (this._start.index = this._indices.length), (this._start.vertex = this._vertices.length);
        }
        recordEnd(t, e, i, s, r, n, a) {
          this._records.push(t),
            this._records.push(e),
            this._records.push(i),
            this._records.push(s),
            this._records.push(r),
            this._records.push(n),
            this._records.push(a);
        }
        writeIndex(t) {
          this._indices.push(t);
        }
        writeVertex(t) {
          this._vertices.push(t);
        }
        writeVertexF32(t) {
          this._vertices.writeF32(t);
        }
        copyLastFrom(t, e, i) {
          const s = t._records.length - 7,
            r = t._records.getValue(s),
            n = t._records.getValue(s + 1),
            a = t._records.getValue(s + 2),
            o = t._records.getValue(s + 4),
            l = t._records.getValue(s + 6),
            h = this._vertices.length,
            c = (t._start.vertex - this._vertices.length) / this._strideInt,
            u = this._indices.length,
            f = this.vertexCount;
          for (let e = t._start.index; e !== t._indices.length; e++) {
            const i = t._indices.getValue(e);
            this._indices.push(i - c);
          }
          for (let e = t._start.vertex; e !== t._vertices.length; e++) {
            const i = t._vertices.getValue(e);
            this._vertices.push(i);
          }
          for (let t = h; t <= this._vertices.length; t += this._strideInt)
            this._vertices.i1616Add(t, e, i);
          this._records.push(r),
            this._records.push(n),
            this._records.push(a),
            this._records.push(u),
            this._records.push(o),
            this._records.push(f),
            this._records.push(l);
        }
      }
      function rs(t) {
        switch (t) {
          case 1:
          case 8:
          case 32:
            return -1;
          case 2:
          case 64:
            return 0;
          case 4:
          case 16:
          case 128:
            return 1;
        }
      }
      function ns(t) {
        switch (t) {
          case 1:
          case 2:
          case 4:
            return -1;
          case 8:
          case 16:
            return 0;
          case 32:
          case 64:
          case 128:
            return 1;
        }
      }
      class as {
        constructor(t, e, i, s, r) {
          (this._hasDotDensity = !1),
            (this._hasAggregate = !1),
            (this.hasRecords = !1),
            (this._data = { self: new Map(), neighbors: new Array() }),
            (this._current = {
              geometryType: 0,
              writer: null,
              overlaps: 0,
              start: 0,
              insertAfter: 0,
              id: 0,
              materialKey: 0,
              indexStart: 0,
              vertStart: 0,
              isDotDensity: !1,
              bufferingEnabled: !1,
              metricBoxLenPointer: 0,
            }),
            (this.hint = e),
            (this.tileKey = t),
            (this._hasDotDensity = i),
            (this._hasAggregate = s),
            (this._pixelBufferEnabled = r);
        }
        get hasAggregates() {
          return this._hasAggregate;
        }
        get hasPixelBufferEnabled() {
          return this._pixelBufferEnabled;
        }
        serialize(t) {
          const e = [];
          return (
            e.push(this._serializeTileVertexData(this.tileKey, this._data.self)),
            this._data.neighbors.forEach((i, s) => {
              const r = 1 << s,
                n = rs(r),
                a = ns(r),
                o = (0, T.g)(new g.T(this.tileKey), n, a, t);
              e.push(this._serializeTileVertexData(o.id, i));
            }),
            e
          );
        }
        _serializeTileVertexData(t, e) {
          var i, s, r, n, a;
          const o = new Array();
          return {
            message: {
              tileKey: t,
              data: {
                [k.a.MARKER]: null == (i = e.get(k.a.MARKER)) ? void 0 : i.serialize(o),
                [k.a.FILL]: null == (s = e.get(k.a.FILL)) ? void 0 : s.serialize(o),
                [k.a.LINE]: null == (r = e.get(k.a.LINE)) ? void 0 : r.serialize(o),
                [k.a.TEXT]: null == (n = e.get(k.a.TEXT)) ? void 0 : n.serialize(o),
                [k.a.LABEL]: null == (a = e.get(k.a.LABEL)) ? void 0 : a.serialize(o),
              },
            },
            transferList: o,
          };
        }
        featureStart(t = 0) {
          this._current.insertAfter = t;
        }
        featureEnd() {}
        recordStart(t, e, i, s, r) {
          (this._current.writer = this._getVertexWriter(i, s)),
            (this._current.overlaps = 0),
            (this._current.indexStart = this._current.writer.indexCount),
            (this._current.vertStart = this._current.writer.vertexCount),
            (this._current.bufferingEnabled = r),
            (this._current.id = t),
            (this._current.materialKey = e),
            (this._current.geometryType = i),
            (this._current.isDotDensity = !1),
            this._current.writer.recordStart();
        }
        recordCount() {
          return this._current.writer.recordCount;
        }
        vertexCount() {
          return this._current.writer.vertexCount;
        }
        indexCount() {
          return this._current.writer.indexCount;
        }
        vertexBounds(t, e, i, s) {
          this._current.bufferingEnabled && this._addOverlap(t, e, i, s);
        }
        vertexWrite(t) {
          this._current.writer.writeVertex(t);
        }
        vertexWriteF32(t) {
          this._current.writer.writeVertexF32(t);
        }
        vertexEnd() {}
        vertexWriter() {
          return this._current.writer.vertexWriter;
        }
        indexWrite(t) {
          this._current.writer.writeIndex(t);
        }
        indexWriter() {
          return this._current.writer.indexWriter;
        }
        metricWriter() {
          return this._current.writer.metricWriter;
        }
        metricStart(t, e, i, s, r, n, a, o) {
          this._current.writer = this._getVertexWriter(k.a.LABEL, !1);
          const l = this._current.writer.metricWriter;
          l.push((0, I.g)(t)),
            l.push(e),
            l.push(i),
            l.push(s),
            l.push(r),
            l.push(n),
            l.push(a),
            l.push(o),
            l.push(255),
            (this._current.metricBoxLenPointer = l.push(0));
        }
        metricEnd() {
          const t = this._current.writer.metricWriter;
          0 === t.getValue(this._current.metricBoxLenPointer) && t.seek(t.length - 10);
        }
        metricBoxWrite(t, e, i, s) {
          const r = this._current.writer.metricWriter;
          r.incr(this._current.metricBoxLenPointer),
            r.push(0),
            r.push(0),
            r.push(t),
            r.push(e),
            r.push(i),
            r.push(s);
        }
        recordEnd() {
          const t = this._current.indexStart,
            e = this._current.writer.indexCount;
          if (t === e) return !1;
          this.hasRecords = !0;
          const i = e - t,
            s = this._current.vertStart,
            r = this._current.writer.vertexCount - s;
          if (
            (this._current.writer.recordEnd(
              this._current.id,
              this._current.materialKey,
              this._current.insertAfter,
              t,
              i,
              s,
              r,
            ),
            !this._pixelBufferEnabled ||
              this._hasAggregate ||
              0 === this._current.overlaps ||
              this._current.geometryType === k.a.LABEL)
          )
            return !0;
          const n = this._current.writer;
          for (let t = 0; t < 8; t++) {
            const e = 1 << t;
            if (this._current.overlaps & e) {
              if (!this._data.neighbors[t]) {
                const e = new Map();
                this._data.neighbors[t] = e;
              }
              const i = this._data.neighbors[t],
                s = this._current.geometryType;
              if (!i.has(s)) {
                const t = (0, f.f)(s, this._current.isDotDensity).geometry;
                i.set(s, new ss(s, t, d.P));
              }
              const r = i.get(this._current.geometryType),
                a = 8,
                o = 512 * -rs(e) * a,
                l = 512 * -ns(e) * a;
              r.copyLastFrom(n, o, l);
            }
          }
          return !0;
        }
        _addOverlap(t, e, i, s) {
          const r =
            255 ^
            ((t < 0 + i ? 148 : t >= d.k - i ? 41 : 189) |
              (e < 0 + s ? 224 : e >= d.k - s ? 7 : 231));
          this._current.overlaps |= r;
        }
        _getVertexWriter(t, e) {
          if (!this._data.self.has(t)) {
            const e = this._data.self,
              i = (0, f.f)(t, this._hasDotDensity).geometry;
            e.set(t, new ss(t, i, 8e3));
          }
          return this._data.self.get(t);
        }
      }
      function os(t, e, i) {
        return (t[0] = e[0] - i[0]), (t[1] = e[1] - i[1]), t;
      }
      function ls(t, e) {
        return Math.sqrt(t * t + e * e);
      }
      function hs(t) {
        const e = ls(t[0], t[1]);
        (t[0] /= e), (t[1] /= e);
      }
      function cs(t) {
        return 'function' == typeof t;
      }
      function us(t = 2) {
        return 1 / Math.max(t, 1);
      }
      function fs(t, e) {
        return [
          (!!t.minScale && e.scaleToZoom(t.minScale)) || 0,
          (!!t.maxScale && e.scaleToZoom(t.maxScale)) || 100,
        ];
      }
      function ds(t) {
        return t.length - 1;
      }
      function _s(t, e, i = 1) {
        const [s, r] = (function (t, e) {
          return t[e + 1];
        })(t, e);
        return Math.sqrt(s * s + r * r) * i;
      }
      class ms {
        constructor(t, e, i, s, r) {
          (this._segments = t),
            (this._index = e),
            (this._distance = i),
            (this._xStart = s),
            (this._yStart = r),
            (this._done = !1);
        }
        static create(t) {
          return new ms(t, 0, 0, t[0][0], t[0][1]);
        }
        clone() {
          return new ms(this._segments, this._index, this._distance, this.xStart, this.yStart);
        }
        equals(t) {
          return (
            this._index === t._index ||
            (t._index === this._index - 1 && (0 === this._distance || 1 === t._distance)) ||
            (t._index === this._index + 1 && (1 === this._distance || 0 === t._distance))
          );
        }
        leq(t) {
          return (
            this._index < t._index || (this._index === t._index && this._distance <= t._distance)
          );
        }
        geq(t) {
          return (
            this._index > t._index || (this._index === t._index && this._distance >= t._distance)
          );
        }
        get _segment() {
          return this._segments[this._index + 1];
        }
        get angle() {
          const t = this.dy,
            e = (0 * t + -1 * -this.dx) / (1 * this.length);
          let i = Math.acos(e);
          return t > 0 && (i = 2 * Math.PI - i), i;
        }
        get xStart() {
          return this._xStart;
        }
        get yStart() {
          return this._yStart;
        }
        get x() {
          return this.xStart + this.distance * this.dx;
        }
        get y() {
          return this.yStart + this.distance * this.dy;
        }
        get dx() {
          return this._segment[0];
        }
        get dy() {
          return this._segment[1];
        }
        get xMidpoint() {
          return this.xStart + 0.5 * this.dx;
        }
        get yMidpoint() {
          return this.yStart + 0.5 * this.dy;
        }
        get xEnd() {
          return this.xStart + this.dx;
        }
        get yEnd() {
          return this.yStart + this.dy;
        }
        get length() {
          const { dx: t, dy: e } = this;
          return Math.sqrt(t * t + e * e);
        }
        get remainingLength() {
          return this.length * (1 - this._distance);
        }
        get backwardLength() {
          return this.length * this._distance;
        }
        get distance() {
          return this._distance;
        }
        get done() {
          return this._done;
        }
        hasPrev() {
          return this._index - 1 >= 0;
        }
        hasNext() {
          return this._index + 1 < ds(this._segments);
        }
        next() {
          return this.hasNext()
            ? ((this._xStart += this.dx),
              (this._yStart += this.dy),
              (this._distance = 0),
              (this._index += 1),
              this)
            : null;
        }
        prev() {
          return this.hasPrev()
            ? ((this._index -= 1),
              (this._xStart -= this.dx),
              (this._yStart -= this.dy),
              (this._distance = 1),
              this)
            : ((this._done = !0), null);
        }
        _seekBackwards(t, e) {
          const i = this.backwardLength;
          if (t <= i) return (this._distance = (i - t) / this.length), this;
          let s = this.backwardLength;
          for (; this.prev(); ) {
            if (s + this.length > t) return this._seekBackwards(t - s);
            s += this.length;
          }
          return (this._distance = 0), e ? this : null;
        }
        seek(t, e = !1) {
          if (t < 0) return this._seekBackwards(Math.abs(t), e);
          if (t <= this.remainingLength)
            return (this._distance = (this.backwardLength + t) / this.length), this;
          let i = this.remainingLength;
          for (; this.next(); ) {
            if (i + this.length > t) return this.seek(t - i, e);
            i += this.length;
          }
          return (this._distance = 1), e ? this : null;
        }
      }
      function ps(t, e, i) {
        const s = (function (t) {
            let e = 0;
            for (let i = 0; i < ds(t); i++) e += _s(t, i);
            return e;
          })(t),
          r = ms.create(t),
          n = s / 2,
          a = (s - e) / 2,
          o = Math.floor(a / e),
          l = n - o * e;
        r.seek(l);
        for (let t = -o; t <= o; t++)
          r.x < 512 && r.x >= 0 && r.y < 512 && r.y >= 0 && i(r.clone(), t, n + t * e, s),
            r.seek(e);
      }
      function gs(t, e) {
        const i = 1e-6;
        if (e <= 0) return;
        const s = t.length;
        if (s < 3) return;
        const r = [];
        let n = 0;
        r.push(0);
        for (let e = 1; e < s; e++)
          (n += ((a = t[e]), (o = t[e - 1]), ls(a[0] - o[0], a[1] - o[1]))), r.push(n);
        var a, o;
        e = Math.min(e, 0.2 * n);
        const l = [];
        l.push(t[0][0]), l.push(t[0][1]);
        const h = t[s - 1][0],
          c = t[s - 1][1],
          u = os([0, 0], t[0], t[1]);
        hs(u),
          (t[0][0] += e * u[0]),
          (t[0][1] += e * u[1]),
          os(u, t[s - 1], t[s - 2]),
          hs(u),
          (t[s - 1][0] += e * u[0]),
          (t[s - 1][1] += e * u[1]);
        for (let t = 1; t < s; t++) r[t] += e;
        r[s - 1] += e;
        const f = 0.5 * e;
        for (let n = 1; n < s - 1; n++) {
          let a = 0,
            o = 0,
            h = 0;
          for (let s = n - 1; s >= 0 && !(r[s + 1] < r[n] - f); s--) {
            const l = f + r[s + 1] - r[n],
              c = r[s + 1] - r[s],
              u = r[n] - r[s] < f ? 1 : l / c;
            if (Math.abs(u) < i) break;
            const d = u * u,
              _ = u * l - 0.5 * d * c,
              m = (u * c) / e,
              p = t[s + 1],
              g = t[s][0] - p[0],
              y = t[s][1] - p[1];
            (a += (m / _) * (p[0] * u * l + 0.5 * d * (l * g - c * p[0]) - (d * u * c * g) / 3)),
              (o += (m / _) * (p[1] * u * l + 0.5 * d * (l * y - c * p[1]) - (d * u * c * y) / 3)),
              (h += m);
          }
          for (let l = n + 1; l < s && !(r[l - 1] > r[n] + f); l++) {
            const s = f - r[l - 1] + r[n],
              c = r[l] - r[l - 1],
              u = r[l] - r[n] < f ? 1 : s / c;
            if (Math.abs(u) < i) break;
            const d = u * u,
              _ = u * s - 0.5 * d * c,
              m = (u * c) / e,
              p = t[l - 1],
              g = t[l][0] - p[0],
              y = t[l][1] - p[1];
            (a += (m / _) * (p[0] * u * s + 0.5 * d * (s * g - c * p[0]) - (d * u * c * g) / 3)),
              (o += (m / _) * (p[1] * u * s + 0.5 * d * (s * y - c * p[1]) - (d * u * c * y) / 3)),
              (h += m);
          }
          l.push(a / h), l.push(o / h);
        }
        l.push(h), l.push(c);
        for (let e = 0, i = 0; e < s; e++) (t[e][0] = l[i++]), (t[e][1] = l[i++]);
      }
      class ys {
        static getPlacement(t, e, i) {
          const s = Re(e);
          if (!s) return null;
          const r = Lt(t);
          return s.execute(r, e, i);
        }
      }
      const xs = (t) =>
        class extends t {
          constructor(...t) {
            super(...t),
              (this._isCIM = !1),
              (this._vertexBoundsScale = 1),
              (this.geometryType = k.a.TEXT),
              (this._aux = (0, H.a)(0, 0, this._referenceSize, this._bitset));
          }
          bindTextInfo(t, e) {
            t && t.length
              ? (this._shapingInfo = (0, n.e)(t, (t) =>
                  (function (t, e, i) {
                    const s = i.scale,
                      r = new Array(),
                      n = (function (t, e, i) {
                        const s = new Array(),
                          r = i.maxLineWidth * (1 / i.scale),
                          n = e ? t.length - 1 : 0,
                          a = e ? -1 : t.length,
                          o = e ? -1 : 1;
                        let l = n,
                          h = 0,
                          c = 0,
                          u = l,
                          f = u,
                          d = 0,
                          _ = 1 / 0,
                          m = 0;
                        for (; l !== a; ) {
                          const { code: e, metrics: i } = t[l],
                            a = Math.abs(i.top);
                          if (
                            (it(e) ||
                              st(e) ||
                              ((_ = Math.min(_, a)), (m = Math.max(m, a + i.height))),
                            it(e))
                          )
                            l !== n && (s.push(new et(t, u, l - o, h, _, m)), (_ = 1 / 0), (m = 0)),
                              (h = 0),
                              (u = l + o),
                              (f = l + o),
                              (c = 0);
                          else if (st(e)) (f = l + o), (c = 0), (d = i.advance), (h += i.advance);
                          else if (h > r) {
                            if (f !== u) {
                              const e = f - 2 * o;
                              (h -= d),
                                s.push(new et(t, u, e, h - c, _, m)),
                                (_ = 1 / 0),
                                (m = 0),
                                (u = f),
                                (h = c);
                            } else
                              s.push(new et(t, u, l - o, h, _, m)),
                                (_ = 1 / 0),
                                (m = 0),
                                (u = l),
                                (f = l),
                                (h = 0);
                            (h += i.advance), (c += i.advance);
                          } else (h += i.advance), (c += i.advance);
                          l += o;
                        }
                        const p = new et(t, u, l - o, h, _, m);
                        return p.start >= 0 && p.end < t.length && s.push(p), s;
                      })(t, e, i),
                      a = (function (t, e) {
                        let i = 0;
                        for (let e = 0; e < t.length; e++) {
                          const { width: s } = t[e];
                          i = Math.max(s, i);
                        }
                        const s = 'underline' === e.decoration ? 4 : 0,
                          r = t[0].yMin;
                        return {
                          x: 0,
                          y: r,
                          height: t[t.length - 1].yMax + e.lineHeight * (t.length - 1) + s - r,
                          width: i,
                        };
                      })(n, i),
                      { vAlign: o, hAlign: l } = i,
                      h = o === X.Baseline ? 1 : 0,
                      c = h ? 0 : o - 1,
                      u = (1 - h) * -a.y + c * (a.height / 2) + -26 * (h ? 1 : 0);
                    for (let e = 0; e < n.length; e++) {
                      const { start: a, end: o, width: h } = n[e];
                      let c = -1 * (l + 1) * (h / 2) - 3;
                      const f = e * i.lineHeight + u - 3;
                      (n[e].startX = c), (n[e].startY = f);
                      for (let e = a; e <= o; e++) {
                        const i = t[e];
                        if (it(i.code)) continue;
                        const n = new j(c + i.metrics.left, f - i.metrics.top, i, s);
                        (c += i.metrics.advance), r.push(n);
                      }
                    }
                    return new tt(r, n, i);
                  })(t, e, {
                    scale: this._scale,
                    angle: this._angle,
                    xOffset: this._xOffset,
                    yOffset: this._yOffset,
                    hAlign: this._xAlignD,
                    vAlign: this._yAlignD,
                    maxLineWidth: Math.max(32, Math.min(this._lineWidth, 512)),
                    lineHeight: d.M * Math.max(0.25, Math.min(this._lineHeight, 4)),
                    decoration: this._decoration,
                    isCIM: this._isCIM,
                  }),
                ))
              : (this._shapingInfo = null);
          }
          _write(t, e, i) {
            const s = e.getDisplayId();
            this._writeGeometry(t, e, s, i);
          }
          _writeGeometry(t, e, i, s) {
            const r = this._shapingInfo;
            if ((0, n.b)(r)) return;
            if ((0, n.i)(this._textPlacement)) {
              const n = null != s ? s : e.readLegacyGeometry();
              return this._writePlacedText(t, i, n, r);
            }
            const a = s
              ? (0, vt.z)((0, vt.b)(s), 2)
              : 'esriGeometryPolygon' === e.geometryType
              ? e.readCentroid()
              : e.readUnquantizedGeometry();
            if (a) {
              if (a.isPoint) {
                const [e, s] = a.coords;
                return this._writeGlyphs(t, i, { x: e, y: s }, r);
              }
              a.forEachVertex((e, s) => this._writeGlyphs(t, i, { x: e, y: s }, r));
            }
          }
          _writePlacedText(t, e, i, s) {
            const r = (0, n.u)(this._textPlacement),
              a = ys.getPlacement(i, r, (0, z.a)(1));
            if (!a) return;
            let o = a.next();
            for (; null != o; ) {
              const i = o.getAngle();
              s.setRotation(i),
                this._writeGlyphs(t, e, { x: o.tx, y: o.ty }, s),
                s.setRotation(-i),
                (o = a.next());
            }
          }
          _writeGlyphs(t, e, i, s) {
            const r = ht.load(this._materialKey),
              n = (0, H.i)(Math.round(8 * i.x), Math.round(8 * i.y));
            for (const i of s.glyphs) {
              (r.textureBinding = i.textureBinding),
                t.recordStart(e, r.data, this.geometryType, !1, !0);
              const s = i.bounds,
                a = this._vertexBoundsScale;
              t.vertexBounds(s.x * a, s.y * a, s.width * a, s.height * a),
                this._writeVertices(t, e, n, i),
                t.recordEnd();
            }
          }
          _writeGlyph(t, e, i, s, r) {
            const n = ht.load(this._materialKey),
              a = (0, H.i)(Math.round(8 * i), Math.round(8 * s));
            (n.textureBinding = r.textureBinding),
              t.recordStart(e, n.data, this.geometryType, !1, !0);
            const o = r.bounds,
              l = this._vertexBoundsScale;
            t.vertexBounds(o.x * l, o.y * l, o.width * l, o.height * l),
              this._writeVertices(t, e, a, r),
              t.recordEnd();
          }
          _writeVertices(t, e, i, s) {
            const r = t.vertexCount();
            this._writeVertexCommon(t, e, i, s),
              t.vertexWrite(s.offsets.upperLeft),
              t.vertexWrite(s.texcoords.upperLeft),
              t.vertexEnd(),
              this._writeVertexCommon(t, e, i, s),
              t.vertexWrite(s.offsets.upperRight),
              t.vertexWrite(s.texcoords.upperRight),
              t.vertexEnd(),
              this._writeVertexCommon(t, e, i, s),
              t.vertexWrite(s.offsets.lowerLeft),
              t.vertexWrite(s.texcoords.lowerLeft),
              t.vertexEnd(),
              this._writeVertexCommon(t, e, i, s),
              t.vertexWrite(s.offsets.lowerRight),
              t.vertexWrite(s.texcoords.lowerRight),
              t.vertexEnd(),
              t.indexWrite(r + 0),
              t.indexWrite(r + 1),
              t.indexWrite(r + 2),
              t.indexWrite(r + 1),
              t.indexWrite(r + 3),
              t.indexWrite(r + 2);
          }
          _writeVertexCommon(t, e, i, s) {
            const r = this._color,
              n = this._haloColor,
              a = (0, H.a)(0, 0, this._referenceSize, this._bitset),
              o = (0, H.a)(0, 0, this._size, this._haloSize);
            t.vertexWrite(i),
              t.vertexWrite(e),
              t.vertexWrite(r),
              t.vertexWrite(n),
              t.vertexWrite(o),
              t.vertexWrite(a),
              t.vertexWrite(this._minMaxZoom);
          }
        };
      class vs {
        static executeEffects(t, e) {
          const i = Lt(e);
          let s = new Ct(i);
          for (const e of t) {
            const t = ze(e);
            t && (s = t.execute(s, e, 1.3333333333333333));
          }
          return s;
        }
        static next(t) {
          const e = t.next();
          return (
            (function (t) {
              t &&
                ((0, wt.oU)(t)
                  ? It(t.rings)
                  : (0, wt.l9)(t)
                  ? It(t.paths)
                  : (0, wt.aW)(t) && kt(t.points));
            })(e),
            e
          );
        }
      }
      class Ms {
        bindFeature(t, e, i) {}
        write(t, e, i) {
          if ((0, n.b)(this._effects)) return this._write(t, e);
          const s = vs.executeEffects(this._effects, e.readLegacyGeometry());
          let r = vs.next(s);
          for (; r; ) this._write(t, e, r), (r = vs.next(s));
        }
        _write(t, e, i) {}
      }
      class Ss extends xs(Ms) {
        constructor(t, e, i, s, r, n, a, o, l, h, c, u, f, _, m, p, g, y = !1, x, v) {
          super(),
            (this._xOffset = (0, z.a)(u)),
            (this._yOffset = (0, z.a)(f)),
            (this._decoration = l || 'none'),
            (this._color = s),
            (this._haloColor = r),
            (this._haloSize = Math.min(Math.floor(5 * (0, z.a)((0, z.t)(i))), 127)),
            (this._size = Math.min(Math.round((0, z.a)(e)), 127));
          const M = Math.min(Math.round((0, z.a)(e)), 127);
          (this._referenceSize = Math.round(Math.sqrt(256 * M))),
            (this._scale = this._size / 24),
            (this._angle = c),
            (this._justify = (function (t) {
              switch (t) {
                case 'left':
                  return D.Left;
                case 'right':
                  return D.Right;
                case 'center':
                case 'justify':
                  return D.Center;
              }
            })(n || 'center')),
            (this._xAlignD = K(n || 'center')),
            (this._yAlignD = q(a || 'baseline')),
            (this._baseline = 'baseline' === (a || 'baseline')),
            (this._bitset = (1 === o ? 1 : 0) | ((h ? 1 : 0) << 1));
          const S = ht.load(t);
          (S.sdf = !0),
            (this._materialKey = S.data),
            (this._lineWidth = (0, z.a)(_) || 512),
            (this._lineHeight = m || 1),
            (this._textPlacement = p),
            (this._effects = g),
            (this._isCIM = y),
            (this._minMaxZoom = (0, H.i)(Math.round(x * d.d), Math.round(v * d.d)));
        }
        static fromText(t, e) {
          const i = new Ss(
              t.materialKey,
              t.font.size,
              t.haloSize || 0,
              (t.color && (0, at.p)(t.color)) || 0,
              (t.haloColor && (0, at.p)(t.haloColor)) || 0,
              t.horizontalAlignment,
              t.verticalAlignment,
              0,
              t.font.decoration,
              !1,
              t.angle || 0,
              t.xoffset,
              t.yoffset,
              t.lineWidth,
              t.lineHeight,
              null,
              null,
              !1,
              0,
              100,
            ),
            [, s] = nt(t.text);
          return (
            i.bindTextInfo(e, s),
            (i._vertexBoundsScale = t.maxVVSize ? t.maxVVSize / t.font.size : 1),
            i
          );
        }
        static fromCIMText(t, e, i) {
          const s = t.scaleFactor || 1,
            r = t.size * t.sizeRatio * s,
            [n, a] = fs(t.scaleInfo, i),
            o = new Ss(
              t.materialKey,
              r,
              t.outlineSize * t.sizeRatio,
              (0, at.a)(t.color),
              (0, at.a)(t.outlineColor),
              t.horizontalAlignment,
              t.verticalAlignment,
              t.alignment,
              t.decoration,
              t.colorLocked,
              t.angle,
              t.offsetX * t.sizeRatio * s,
              t.offsetY * t.sizeRatio * s,
              512,
              1,
              t.markerPlacement,
              t.effects,
              !0,
              n,
              a,
            ),
            [, l] = nt(t.text);
          return (
            o.bindTextInfo(e, l), (o._vertexBoundsScale = t.maxVVSize ? t.maxVVSize / r : 1), o
          );
        }
      }
      const bs = a.L.getLogger('esri.views.2d.engine.webgl.WGLLabelTemplate'),
        ws = (function (t) {
          const e = new Map();
          return (t) => (
            e.has(t) ||
              e.set(
                t,
                ((t) => {
                  let e = 0;
                  if (0 === t) return 1 / 0;
                  for (; !(t % 2); ) e++, (t /= 2);
                  return e;
                })(t),
              ),
            e.get(t)
          );
        })(),
        Ps = (t) => Math.floor(127 * t + 127),
        Cs = (t) => Math.floor(10 * t),
        Ls = (t) => Math.round(t * (254 / 360));
      class ks extends Ss {
        constructor(t, e, i, s) {
          super(
            t,
            i.font.size,
            i.haloSize || 0,
            (i.color && (0, at.p)(i.color)) || 0,
            (i.haloColor && (0, at.p)(i.haloColor)) || 0,
            i.horizontalAlignment,
            i.verticalAlignment,
            ot(e.labelPlacement) ? 1 : 0,
            i.font.decoration,
            !1,
            i.angle || 0,
            i.xoffset,
            i.yoffset,
            i.lineWidth,
            i.lineHeight,
            null,
            null,
            null,
            null,
            null,
          ),
            (this._outLineLabelAngle = 0),
            (this._refPlacementPadding = 0),
            (this._refPlacementDirX = 0),
            (this._refPlacementDirY = 0),
            (this._refOffsetX = 0),
            (this._refOffsetY = 0),
            (this._zoomLevel = 0),
            (this.geometryType = k.a.LABEL);
          const r = (function (t, e) {
              const i = (!!t.minScale && e.scaleToZoom(t.minScale)) || 0;
              return (0, E.c)(i, 0, 25.5);
            })(e, s),
            n = (function (t, e) {
              const i = (!!t.maxScale && e.scaleToZoom(t.maxScale)) || 255;
              return (0, E.c)(i, 0, 25.5);
            })(e, s),
            a = e.labelPlacement,
            [o, l] = (function (t) {
              switch (t) {
                case 'above-left':
                case 'esriServerPointLabelPlacementAboveLeft':
                  return [D.Right, X.Bottom];
                case 'above-center':
                case 'above-along':
                case 'esriServerPointLabelPlacementAboveCenter':
                case 'esriServerLinePlacementAboveAlong':
                  return [D.Center, X.Bottom];
                case 'above-right':
                case 'esriServerPointLabelPlacementAboveRight':
                  return [D.Left, X.Bottom];
                case 'center-left':
                case 'esriServerPointLabelPlacementCenterLeft':
                  return [D.Right, X.Center];
                case 'center-center':
                case 'center-along':
                case 'esriServerPointLabelPlacementCenterCenter':
                case 'esriServerLinePlacementCenterAlong':
                  return [D.Center, X.Center];
                case 'center-right':
                case 'esriServerPointLabelPlacementCenterRight':
                  return [D.Left, X.Center];
                case 'below-left':
                case 'esriServerPointLabelPlacementBelowLeft':
                  return [D.Right, X.Top];
                case 'below-center':
                case 'below-along':
                case 'esriServerPointLabelPlacementBelowCenter':
                case 'esriServerLinePlacementBelowAlong':
                  return [D.Center, X.Top];
                case 'below-right':
                case 'esriServerPointLabelPlacementBelowRight':
                  return [D.Left, X.Top];
                case 'always-horizontal':
                case 'esriServerPolygonPlacementAlwaysHorizontal':
                  return [D.Center, X.Baseline];
                default:
                  return console.debug(`Found invalid placement type ${t}`), [D.Center, X.Center];
              }
            })(a);
          (this._xAlignD = o),
            (this._yAlignD = l),
            (this._minZoom = r),
            (this._maxZoom = n),
            (this._refPlacementPadding = (0, z.a)(i.haloSize) + d.s);
          const h = yt.load(t);
          (h.sdf = !0), (this._materialKey = h.data);
        }
        static fromLabelClass(t, e) {
          if ('esriServerLinePlacementCenterAlong' === t.labelPlacement) {
            const e = t.symbol;
            (e.xoffset = 0), (e.yoffset = 0), (e.angle = 0), (e.font.decoration = 'none');
          }
          return new ks(t.materialKey, t, t.symbol, e);
        }
        get _shapedBox() {
          return (0, n.u)(this._shapingInfo).bounds;
        }
        setZoomLevel(t) {
          this._zoomLevel = t;
        }
        bindReferenceTemplate(t) {
          let e = (function (t) {
              switch (t) {
                case D.Right:
                  return -1;
                case D.Center:
                  return 0;
                case D.Left:
                  return 1;
                default:
                  return console.debug(`Found invalid horizontal alignment ${t}`), 0;
              }
            })(this._xAlignD),
            i = (function (t) {
              switch (t) {
                case X.Top:
                  return 1;
                case X.Center:
                  return 0;
                case X.Bottom:
                case X.Baseline:
                  return -1;
                default:
                  return console.debug(`Found invalid vertical alignment ${t}`), 0;
              }
            })(this._yAlignD);
          if (((this._refOffsetX = 0), (this._refOffsetY = 0), (0, n.b)(t)))
            return void (this._refSymbolAndPlacementOffset = (0, H.a)(0, 0, Ps(e), Ps(i)));
          if ('circle' === t.boundsType && (e || i)) {
            const t = Math.sqrt(e * e + i * i);
            (e /= t), (i /= t);
          }
          const s = Math.max(t.height, t.width),
            r = 4 * this._refPlacementPadding;
          (this._refSymbolAndPlacementOffset = (0, H.a)(r, s, Ps(e), Ps(i))),
            (this._referenceSize = s),
            (this._refPlacementDirX = e),
            (this._refPlacementDirY = i),
            (this._refOffsetX = t.xOffset),
            (this._refOffsetY = t.yOffset);
        }
        _write(t, e) {
          if ((0, n.b)(this._shapingInfo)) return;
          const i = this._shapingInfo,
            s = e.getDisplayId(),
            a =
              'esriGeometryPolygon' === e.geometryType
                ? e.readLegacyCentroid()
                : e.readLegacyGeometry();
          if (a)
            switch (
              ((this.current = { out: t, inId: s, inShaping: i, zoomLevel: this._zoomLevel }),
              e.geometryType)
            ) {
              case 'esriGeometryPolyline':
                this._placeLineLabels(a);
                break;
              case 'esriGeometryPoint':
              case 'esriGeometryPolygon':
                this._placePointLabels(a);
                break;
              default:
                ((t, e = 'mapview-labeling') => {
                  bs.error(new r.Z(e, t));
                })('mapview-labeling', `Geometry of type ${e.geometryType} is not supported`);
            }
        }
        _isVisible(t, e) {
          const i = Cs(this.current.zoomLevel);
          return Cs(t) <= i && i <= Cs(e);
        }
        _placePointLabels(t) {
          const { out: e, inId: i, inShaping: s } = this.current;
          this._writeGlyphs(e, i, t, s);
        }
        _placeLineLabels(t) {
          const e = (function (t, e) {
              const i = e;
              for (let e = 0; e < t.length; e++) {
                let s = t[e];
                const r = [];
                r.push(s[0]);
                for (let t = 1; t < s.length; t++) {
                  let [e, i] = r[t - 1];
                  (e += s[t][0]), (i += s[t][1]), r.push([e, i]);
                }
                gs(r, i);
                const n = [];
                n.push(r[0]);
                for (let t = 1; t < r.length; t++) {
                  const [e, i] = r[t - 1],
                    [s, a] = r[t],
                    o = Math.round(s - e),
                    l = Math.round(a - i);
                  n.push([o, l]);
                }
                (t[e] = n), (s = n);
              }
              return t;
            })(t.paths, this.current.inShaping.bounds.width),
            i = this._placeSubdivGlyphs.bind(this),
            s = (this._shapedBox.width + 128) / 2;
          for (const t of e) ps(t, s, i);
        }
        _placeSubdivGlyphs(t, e, i, s) {
          const r = ws(e),
            n = this._shapedBox.width / 2,
            a = Math.min(i, s - i),
            o = (0, E.H)(a / (8 + n / 2)),
            l = 0 === e ? o : Math.min(r, o),
            h = Math.max(this._minZoom, this.current.zoomLevel + 1 - l),
            c = this.current.zoomLevel - h,
            u = (this._shapedBox.width / 2) * 2 ** c;
          this.current.inShaping.isMultiline
            ? 0 === e && this._placeStraight(t, h)
            : this._placeCurved(t, h, u);
        }
        _placeStraight(t, e) {
          const { out: i, inId: s, inShaping: r } = this.current;
          this._writeGlyphs(i, s, t, r, e);
        }
        _placeCurved(t, e, i) {
          const { out: s, inId: r } = this.current;
          s.metricStart(r, e, t.x, t.y, 0, 0, 0, 0);
          const n = t.clone(),
            a = (t.angle * (180 / Math.PI)) % 360,
            o = (t.angle * (180 / Math.PI) + 180) % 360;
          (this._outLineLabelAngle = Ls(a)),
            this._placeFirst(n, e, 1),
            this._placeBack(t, n, e, i, 1),
            this._placeForward(t, n, e, i, 1),
            (this._outLineLabelAngle = Ls(o)),
            this._placeFirst(n, e, 0),
            this._placeBack(t, n, e, i, 0),
            this._placeForward(t, n, e, i, 0),
            s.metricEnd();
        }
        _placeBack(t, e, i, s, r) {
          const n = t.clone();
          let a = t.backwardLength + 0;
          for (; n.prev() && !(a >= s); )
            this._placeOnSegment(n, e, a, i, -1, r), (a += n.length + 0);
        }
        _placeForward(t, e, i, s, r) {
          const n = t.clone();
          let a = t.remainingLength + 0;
          for (; n.next() && !(a >= s); )
            this._placeOnSegment(n, e, a, i, 1, r), (a += n.length + 0);
        }
        _placeFirst(t, e, i) {
          const s = t,
            r = this.current.inShaping,
            n = r.glyphs,
            a = this.current.zoomLevel,
            { out: o, inId: l } = this.current;
          for (const h of n) {
            const n = h.x > r.bounds.x ? i : 1 - i,
              c = n * t.remainingLength + (1 - n) * t.backwardLength,
              u = Math.abs(h.x + h.width / 2 - r.bounds.x),
              f = Math.max(0, a + (0, E.H)(u / (c + 0))),
              d = Math.max(e, f);
            if (
              ((h.maxZoom = 25),
              (h.angle = t.angle + (1 - i) * Math.PI),
              (h.minZoom = d),
              !(s.x < 0 || s.x >= 512 || s.y < 0 || s.y >= 512) &&
                (this._writeGlyph(o, l, s.x, s.y, h), i && this._isVisible(h.minZoom, h.maxZoom)))
            ) {
              const t = h.bounds;
              o.metricBoxWrite(t.center[0], t.center[1], t.width, t.height);
            }
          }
        }
        _placeOnSegment(t, e, i, s, r, n) {
          const a = this.current.inShaping.glyphs,
            { out: o, inId: l } = this.current,
            h = this.current.inShaping,
            c = this.current.zoomLevel,
            u = t.dx / t.length,
            f = t.dy / t.length,
            d = { x: t.x + i * -r * u, y: t.y + i * -r * f };
          for (const u of a) {
            const a = u.x > h.bounds.x ? n : 1 - n;
            if (!((a && 1 === r) || (!a && -1 === r))) continue;
            const f = Math.abs(u.x + u.width / 2 - h.bounds.x),
              _ = Math.max(0, c + (0, E.H)(f / i) - 0.1),
              m = Math.max(s, c + (0, E.H)(f / (i + t.length + 0)));
            if (
              0 !== _ &&
              ((u.angle = t.angle + (1 - n) * Math.PI),
              (u.minZoom = m),
              (u.maxZoom = _),
              !(d.x < 0 || d.x >= 512 || d.y < 0 || d.y >= 512) &&
                (this._writeGlyph(o, l, d.x, d.y, u), n && this._isVisible(u.minZoom, u.maxZoom)))
            ) {
              const i = u.bounds,
                s = t.x - e.x,
                r = t.y - e.y;
              o.metricBoxWrite(i.center[0] + s, i.center[1] + r, i.width, i.height);
            }
          }
        }
        _writeGlyphs(t, e, i, s, r = this._minZoom) {
          if (i.x < 0 || i.x >= 512 || i.y < 0 || i.y >= 512) return;
          const n = i.x + this._refOffsetX,
            a = i.y - this._refOffsetY;
          for (const i of s.glyphs)
            (i.minZoom = r), (i.maxZoom = this._maxZoom), this._writeGlyph(t, e, n, a, i);
          const o = this._refPlacementDirX,
            l = this._refPlacementDirY,
            h = s.boundsT;
          t.metricStart(e, r, n, a, o, l, this._referenceSize, this._materialKey),
            t.metricBoxWrite(h.center[0], h.center[1], h.width, h.height),
            t.metricEnd();
        }
        _writeVertexCommon(t, e, i, s) {
          const r = this._color,
            n = this._haloColor,
            a = (0, H.a)(0, 0, this._size, this._haloSize),
            o = Math.max(s.minZoom, this._minZoom),
            l = Math.min(s.maxZoom, this._maxZoom),
            h = (0, H.a)(Cs(o), Cs(l), this._outLineLabelAngle, 0);
          t.vertexWrite(i),
            t.vertexWrite(e),
            t.vertexWrite(r),
            t.vertexWrite(n),
            t.vertexWrite(a),
            t.vertexWrite(this._refSymbolAndPlacementOffset),
            t.vertexWrite(h);
        }
      }
      const Is = (t) =>
        class extends t {
          constructor(...t) {
            super(...t),
              (this.angle = 0),
              (this.xOffset = 0),
              (this.yOffset = 0),
              (this.width = 0),
              (this.height = 0),
              (this.boundsType = 'square'),
              (this._anchorX = 0),
              (this._anchorY = 0),
              (this._computedWidth = 0),
              (this._computedHeight = 0),
              (this._vertexBoundsScaleX = 1),
              (this._vertexBoundsScaleY = 1),
              (this._offsets = {
                xUpperLeft: 0,
                yUpperLeft: 0,
                xUpperRight: 0,
                yUpperRight: 0,
                xBottomLeft: 0,
                yBottomLeft: 0,
                xBottomRight: 0,
                yBottomRight: 0,
              }),
              (this.geometryType = k.a.MARKER);
          }
          _write(t, e, i) {
            const s = e.getDisplayId();
            t.recordStart(s, this._materialKey, this.geometryType, !1, !0),
              this._writeGeometry(t, e, s, i),
              t.recordEnd();
          }
          _writeGeometry(t, e, i, s) {
            if ((0, n.i)(this._markerPlacement)) return this._writePlacedMarkers(t, e, s);
            const r = s
              ? (0, vt.z)((0, vt.b)(s), 2)
              : 'esriGeometryPolygon' === e.geometryType
              ? e.readCentroid()
              : e.readUnquantizedGeometry();
            if (r) {
              if (r.isPoint) {
                const [e, s] = r.coords;
                if (
                  !t.hasAggregates &&
                  t.hasPixelBufferEnabled &&
                  (e < -1 || e >= 513 || s < -1 || s >= 513)
                )
                  return;
                return this._writeVertices(t, i, this._getPos(e, s), e, s);
              }
              r.forEachVertex((e, s) => this._writeVertices(t, i, this._getPos(e, s), e, s));
            }
          }
          _writePlacedMarkers(t, e, i) {
            const s = null != i ? i : e.readLegacyGeometry(),
              r = ys.getPlacement(s, (0, n.u)(this._markerPlacement), (0, z.a)(1));
            if (!r) return;
            const a = e.getDisplayId(),
              o = W(),
              l = F();
            let h = r.next();
            for (; null != h; ) {
              const { tx: e, ty: i } = h;
              e >= -128 &&
                e <= 640 &&
                i >= -128 &&
                i <= 640 &&
                (this._applyTransformation(l, o, h.getAngle() / 0.017453292519944444),
                this._writeVertices(t, a, this._getPos(e, i), e, i)),
                (h = r.next());
            }
          }
          _writeVertices(t, e, i, s, r) {
            const n = t.vertexCount();
            t.vertexBounds(
              s + this.xOffset,
              r - this.yOffset,
              this._computedWidth * this._vertexBoundsScaleX,
              this._computedHeight * this._vertexBoundsScaleY,
            ),
              t.vertexWrite(i),
              t.vertexWrite(this._offsetUpperLeft),
              t.vertexWrite(this._texUpperLeft),
              t.vertexWrite(this._bitestAndDistRatio),
              t.vertexWrite(e),
              t.vertexWrite(this._fillColor),
              t.vertexWrite(this._outlineColor),
              t.vertexWrite(this._sizeOutlineWidth),
              t.vertexWrite(this._minMaxZoom),
              t.vertexEnd(),
              t.vertexWrite(i),
              t.vertexWrite(this._offsetUpperRight),
              t.vertexWrite(this._texUpperRight),
              t.vertexWrite(this._bitestAndDistRatio),
              t.vertexWrite(e),
              t.vertexWrite(this._fillColor),
              t.vertexWrite(this._outlineColor),
              t.vertexWrite(this._sizeOutlineWidth),
              t.vertexWrite(this._minMaxZoom),
              t.vertexEnd(),
              t.vertexWrite(i),
              t.vertexWrite(this._offsetBottomLeft),
              t.vertexWrite(this._texBottomLeft),
              t.vertexWrite(this._bitestAndDistRatio),
              t.vertexWrite(e),
              t.vertexWrite(this._fillColor),
              t.vertexWrite(this._outlineColor),
              t.vertexWrite(this._sizeOutlineWidth),
              t.vertexWrite(this._minMaxZoom),
              t.vertexEnd(),
              t.vertexWrite(i),
              t.vertexWrite(this._offsetBottomRight),
              t.vertexWrite(this._texBottomRight),
              t.vertexWrite(this._bitestAndDistRatio),
              t.vertexWrite(e),
              t.vertexWrite(this._fillColor),
              t.vertexWrite(this._outlineColor),
              t.vertexWrite(this._sizeOutlineWidth),
              t.vertexWrite(this._minMaxZoom),
              t.vertexEnd(),
              t.indexWrite(n + 0),
              t.indexWrite(n + 1),
              t.indexWrite(n + 2),
              t.indexWrite(n + 1),
              t.indexWrite(n + 3),
              t.indexWrite(n + 2);
          }
          _applyTransformation(t, e, i = 0) {
            R(t),
              O(t, t, B(this.xOffset, -this.yOffset)),
              this.angle + i !== 0 && A(t, t, 0.017453292519944444 * (this.angle + i));
            const s = this._computedWidth,
              r = this._computedHeight,
              n = (this._anchorX - 0.5) * s,
              a = (this._anchorY - 0.5) * r;
            (0, m.s)(e, n, a),
              (0, m.t)(e, e, t),
              (this._offsetUpperLeft = (0, H.i)(16 * e[0], 16 * e[1])),
              (this._offsets.xUpperLeft = e[0]),
              (this._offsets.yUpperLeft = e[1]),
              (0, m.s)(e, n + s, a),
              (0, m.t)(e, e, t),
              (this._offsetUpperRight = (0, H.i)(16 * e[0], 16 * e[1])),
              (this._offsets.xUpperRight = e[0]),
              (this._offsets.yUpperRight = e[1]),
              (0, m.s)(e, n, a + r),
              (0, m.t)(e, e, t),
              (this._offsetBottomLeft = (0, H.i)(16 * e[0], 16 * e[1])),
              (this._offsets.xBottomLeft = e[0]),
              (this._offsets.yBottomLeft = e[1]),
              (0, m.s)(e, n + s, a + r),
              (0, m.t)(e, e, t),
              (this._offsetBottomRight = (0, H.i)(16 * e[0], 16 * e[1])),
              (this._offsets.xBottomRight = e[0]),
              (this._offsets.yBottomRight = e[1]);
          }
          _getPos(t, e) {
            return (0, H.i)(Math.round(8 * t), Math.round(8 * e));
          }
        };
      class Ts extends Is(Ms) {
        constructor(t, e, i, s, r, n, a, o, l, h, c, u, f, _, m, p, g, y, x, v, M, S, b) {
          super(),
            (this.angle = s),
            (this.height = a),
            (this.width = n),
            (this.xOffset = e * x),
            (this.yOffset = i * x),
            (this._markerPlacement = v),
            (this._effects = M),
            (this._anchorX = 0.5 - ((0.5 + p) * m.width) / m.width),
            (this._anchorY = 0.5 - ((0.5 + g) * m.height) / m.height),
            (this._minMaxZoom = (0, H.i)(Math.round(S * d.d), Math.round(b * d.d)));
          const w =
              (1 === _ ? 1 : 0) | ((c ? 1 : 0) << 1) | ((f ? 1 : 0) << 2) | ((u ? 1 : 0) << 3),
            P = m && m.sdf,
            C = mt.load(t);
          (C.sdf = P),
            (C.pattern = !0),
            (C.textureBinding = m.textureBinding),
            (this._materialKey = C.data),
            (this._fillColor = r),
            (this._outlineColor = l),
            (this._sizeOutlineWidth = (0, H.a)(
              Math.round(Math.min(Math.sqrt(128 * n), 255)),
              Math.round(Math.min(Math.sqrt(128 * a), 255)),
              Math.round(Math.min(Math.sqrt(128 * h), 255)),
              Math.round(Math.min(Math.sqrt(128 * o), 255)),
            ));
          const L = m.rect.x + d.S,
            k = m.rect.y + d.S,
            I = L + m.width,
            T = k + m.height;
          (this._offsets.xUpperLeft = L),
            (this._offsets.yUpperLeft = k),
            (this._offsets.xUpperRight = I),
            (this._offsets.yUpperRight = k),
            (this._offsets.xBottomLeft = L),
            (this._offsets.yBottomLeft = T),
            (this._offsets.xBottomRight = I),
            (this._offsets.yBottomRight = T),
            (this._texUpperLeft = (0, H.i)(L, k)),
            (this._texUpperRight = (0, H.i)(I, k)),
            (this._texBottomLeft = (0, H.i)(L, T)),
            (this._texBottomRight = (0, H.i)(I, T)),
            (n *= y),
            (a *= y),
            (n *= x),
            (a *= x);
          const E = Math.round(64 * y);
          (this._bitestAndDistRatio = (0, H.i)(w, E)),
            (this._computedWidth = n),
            (this._computedHeight = a);
          const z = W(),
            R = F();
          this._applyTransformation(R, z);
        }
        static fromCIMMarker(t, e, i) {
          const s = (e && e.width) || 1,
            r = (e && e.height) || 1,
            a = t.size,
            o = (s / r) * t.scaleX,
            l = t.scaleSymbolsProportionally && t.frameHeight ? a / t.frameHeight : 1,
            h = (0, at.a)(t.color),
            c = (0, at.a)(t.outlineColor),
            u = (0, z.a)(a),
            f = u * o,
            d = (0, z.a)(t.offsetX || 0),
            _ = (0, z.a)(t.offsetY || 0),
            m = (0, z.a)(t.outlineWidth || 0) * l,
            p = t.alignment || 0,
            g = (0, z.a)(t.referenceSize),
            [y, x] = fs(t.scaleInfo, i);
          let v = t.rotation || 0;
          t.rotateClockwise || (v = -v);
          let M = 0,
            S = 0;
          const b = t.anchorPoint;
          b &&
            (t.isAbsoluteAnchorPoint
              ? a && ((M = -b.x / (a * o)), (S = b.y / a))
              : ((M = b.x), (S = b.y)));
          const w = new Ts(
            t.materialKey,
            d,
            _,
            v,
            h,
            f,
            u,
            g,
            c,
            m,
            t.colorLocked,
            t.scaleSymbolsProportionally,
            !1,
            p,
            e,
            M,
            S,
            t.sizeRatio,
            (0, n.d)(t.scaleFactor, 1),
            t.markerPlacement,
            t.effects,
            y,
            x,
          );
          return (
            (w._vertexBoundsScaleX = t.maxVVSize ? t.maxVVSize / f : 1),
            (w._vertexBoundsScaleY = t.maxVVSize ? t.maxVVSize / u : 1),
            w
          );
        }
        static fromPictureMarker(t, e) {
          const i = Math.round((0, z.a)(t.width)),
            s = Math.round((0, z.a)(t.height)),
            r = d.t,
            n = Math.round((0, z.a)(t.xoffset || 0)),
            a = Math.round((0, z.a)(t.yoffset || 0)),
            o = new Ts(
              t.materialKey,
              n,
              a,
              t.angle,
              r,
              i,
              s,
              s,
              0,
              0,
              !1,
              !1,
              !1,
              0,
              e,
              0,
              0,
              1,
              1,
              null,
              null,
              0,
              100,
            );
          return (
            (o._vertexBoundsScaleX = t.maxVVSize ? t.maxVVSize / t.width : 1),
            (o._vertexBoundsScaleY = t.maxVVSize ? t.maxVVSize / t.height : 1),
            o
          );
        }
        static fromSimpleMarker(t, e) {
          const i = (0, at.p)(t.color),
            s = Math.round((0, z.a)(t.size)),
            r = s,
            n = Math.round((0, z.a)(t.xoffset || 0)),
            a = Math.round((0, z.a)(t.yoffset || 0)),
            o = t.style,
            l = t.outline,
            h = 0 | (l && l.color && (0, at.p)(l.color)),
            c = 0 | (l && l.width && Math.round((0, z.a)(l.width))),
            u = new Ts(
              t.materialKey,
              n,
              a,
              t.angle,
              i,
              s,
              r,
              r,
              h,
              c,
              !1,
              !1,
              'esriSMSCross' === o || 'esriSMSX' === o,
              0,
              e,
              0,
              0,
              126 / 64,
              1,
              null,
              null,
              0,
              100,
            );
          return (
            (u.boundsType = 'esriSMSCircle' === o ? 'circle' : 'square'),
            (u._vertexBoundsScaleX = t.maxVVSize ? t.maxVVSize / t.size : 1),
            (u._vertexBoundsScaleY = t.maxVVSize ? t.maxVVSize / t.size : 1),
            u
          );
        }
        static fromLineSymbolMarker(t, e) {
          const i = (0, at.p)(t.color),
            s = Math.round((0, z.a)(6 * t.lineWidth)),
            r = s,
            n = 'cross' === t.style || 'x' === t.style;
          let a;
          switch (t.placement) {
            case 'begin-end':
              a = 'Both';
              break;
            case 'begin':
              a = 'JustBegin';
              break;
            case 'end':
              a = 'JustEnd';
              break;
            default:
              a = 'None';
          }
          const o = {
              type: 'CIMMarkerPlacementAtExtremities',
              angleToLine: !0,
              offset: 0,
              extremityPlacement: a,
              offsetAlongLine: 0,
            },
            l = new Ts(
              t.materialKey,
              0,
              0,
              0,
              i,
              s,
              r,
              r / 6,
              i,
              n ? Math.round((0, z.a)(t.lineWidth)) : 0,
              !1,
              !1,
              n,
              1,
              e,
              0,
              0,
              126 / 64,
              1,
              o,
              null,
              0,
              100,
            );
          return (l.boundsType = 'circle' === t.style ? 'circle' : 'square'), l;
        }
      }
      function Es(t, e, i, s, r, n, a) {
        er = 0;
        const o = (s - i) * n,
          l = r && r.length,
          h = l ? (r[0] - i) * n : o;
        let c,
          u,
          f,
          d,
          _,
          m = zs(e, i, 0, 0, h, n, !0);
        if (m && m.next !== m.prev) {
          if (
            (l &&
              (m = (function (t, e, i, s, r, n) {
                const a = new Array();
                for (let r = 0, o = s.length; r < o; r++) {
                  const l = zs(t, e, 0, s[r] * n, r < o - 1 ? s[r + 1] * n : i * n, n, !1);
                  l === l.next && (l.steiner = !0), a.push(Gs(l));
                }
                a.sort(Ks);
                for (const t of a) Ws(t, r), (r = Rs(r, r.next));
                return r;
              })(e, i, s, r, m, n)),
            o > 80 * n)
          ) {
            (c = f = e[0 + i * n]), (u = d = e[1 + i * n]);
            for (let t = n; t < h; t += n) {
              const s = e[t + i * n],
                r = e[t + 1 + i * n];
              (c = Math.min(c, s)),
                (u = Math.min(u, r)),
                (f = Math.max(f, s)),
                (d = Math.max(d, r));
            }
            (_ = Math.max(f - c, d - u)), (_ = 0 !== _ ? 1 / _ : 0);
          }
          Vs(m, t, n, c, u, _, a, 0);
        }
      }
      function zs(t, e, i, s, r, n, a) {
        let o;
        if (
          a ===
          (function (t, e, i, s, r, n) {
            let a = 0;
            for (let i = s, o = r - n; i < r; i += n)
              (a += (t[o + e * n] - t[i + e * n]) * (t[i + 1 + e * n] + t[o + 1 + e * n])), (o = i);
            return a;
          })(t, e, 0, s, r, n) >
            0
        )
          for (let i = s; i < r; i += n) o = Fs(i + e * n, t[i + e * n], t[i + 1 + e * n], o);
        else
          for (let i = r - n; i >= s; i -= n) o = Fs(i + e * n, t[i + e * n], t[i + 1 + e * n], o);
        return o && Zs(o, o.next) && (Ns(o), (o = o.next)), o;
      }
      function Rs(t, e = t) {
        if (!t) return t;
        let i,
          s = t;
        do {
          if (((i = !1), s.steiner || (!Zs(s, s.next) && 0 !== Ds(s.prev, s, s.next)))) s = s.next;
          else {
            if ((Ns(s), (s = e = s.prev), s === s.next)) break;
            i = !0;
          }
        } while (i || s !== e);
        return e;
      }
      function Vs(t, e, i, s, r, n, a, o) {
        if (!t) return;
        !o && n && (t = Bs(t, s, r, n));
        let l = t;
        for (; t.prev !== t.next; ) {
          const h = t.prev,
            c = t.next;
          if (n ? Os(t, s, r, n) : As(t))
            e.push(h.index / i + a),
              e.push(t.index / i + a),
              e.push(c.index / i + a),
              Ns(t),
              (t = c.next),
              (l = c.next);
          else if ((t = c) === l) {
            o
              ? 1 === o
                ? Vs((t = qs(t, e, i, a)), e, i, s, r, n, a, 2)
                : 2 === o && Js(t, e, i, s, r, n, a)
              : Vs(Rs(t), e, i, s, r, n, a, 1);
            break;
          }
        }
      }
      function As(t) {
        const e = t.prev,
          i = t,
          s = t.next;
        if (Ds(e, i, s) >= 0) return !1;
        let r = t.next.next;
        const n = r;
        let a = 0;
        for (; r !== t.prev && (0 === a || r !== n); ) {
          if ((a++, Ys(e.x, e.y, i.x, i.y, s.x, s.y, r.x, r.y) && Ds(r.prev, r, r.next) >= 0))
            return !1;
          r = r.next;
        }
        return !0;
      }
      function Os(t, e, i, s) {
        const r = t.prev,
          n = t,
          a = t.next;
        if (Ds(r, n, a) >= 0) return !1;
        const o = r.x < n.x ? (r.x < a.x ? r.x : a.x) : n.x < a.x ? n.x : a.x,
          l = r.y < n.y ? (r.y < a.y ? r.y : a.y) : n.y < a.y ? n.y : a.y,
          h = r.x > n.x ? (r.x > a.x ? r.x : a.x) : n.x > a.x ? n.x : a.x,
          c = r.y > n.y ? (r.y > a.y ? r.y : a.y) : n.y > a.y ? n.y : a.y,
          u = Us(o, l, e, i, s),
          f = Us(h, c, e, i, s);
        let d = t.prevZ,
          _ = t.nextZ;
        for (; d && d.z >= u && _ && _.z <= f; ) {
          if (
            d !== t.prev &&
            d !== t.next &&
            Ys(r.x, r.y, n.x, n.y, a.x, a.y, d.x, d.y) &&
            Ds(d.prev, d, d.next) >= 0
          )
            return !1;
          if (
            ((d = d.prevZ),
            _ !== t.prev &&
              _ !== t.next &&
              Ys(r.x, r.y, n.x, n.y, a.x, a.y, _.x, _.y) &&
              Ds(_.prev, _, _.next) >= 0)
          )
            return !1;
          _ = _.nextZ;
        }
        for (; d && d.z >= u; ) {
          if (
            d !== t.prev &&
            d !== t.next &&
            Ys(r.x, r.y, n.x, n.y, a.x, a.y, d.x, d.y) &&
            Ds(d.prev, d, d.next) >= 0
          )
            return !1;
          d = d.prevZ;
        }
        for (; _ && _.z <= f; ) {
          if (
            _ !== t.prev &&
            _ !== t.next &&
            Ys(r.x, r.y, n.x, n.y, a.x, a.y, _.x, _.y) &&
            Ds(_.prev, _, _.next) >= 0
          )
            return !1;
          _ = _.nextZ;
        }
        return !0;
      }
      function Fs(t, e, i, s) {
        const r = Qs.create(t, e, i);
        return (
          s
            ? ((r.next = s.next), (r.prev = s), (s.next.prev = r), (s.next = r))
            : ((r.prev = r), (r.next = r)),
          r
        );
      }
      function Ns(t) {
        (t.next.prev = t.prev),
          (t.prev.next = t.next),
          t.prevZ && (t.prevZ.nextZ = t.nextZ),
          t.nextZ && (t.nextZ.prevZ = t.prevZ);
      }
      function Gs(t) {
        let e = t,
          i = t;
        do {
          (e.x < i.x || (e.x === i.x && e.y < i.y)) && (i = e), (e = e.next);
        } while (e !== t);
        return i;
      }
      function Ws(t, e) {
        if (
          (e = (function (t, e) {
            let i = e;
            const s = t.x,
              r = t.y;
            let n,
              a = -1 / 0;
            do {
              if (r <= i.y && r >= i.next.y && i.next.y !== i.y) {
                const t = i.x + ((r - i.y) * (i.next.x - i.x)) / (i.next.y - i.y);
                if (t <= s && t > a) {
                  if (((a = t), t === s)) {
                    if (r === i.y) return i;
                    if (r === i.next.y) return i.next;
                  }
                  n = i.x < i.next.x ? i : i.next;
                }
              }
              i = i.next;
            } while (i !== e);
            if (!n) return null;
            if (s === a) return n.prev;
            const o = n,
              l = n.x,
              h = n.y;
            let c,
              u = 1 / 0;
            for (i = n.next; i !== o; )
              s >= i.x &&
                i.x >= l &&
                s !== i.x &&
                Ys(r < h ? s : a, r, l, h, r < h ? a : s, r, i.x, i.y) &&
                ((c = Math.abs(r - i.y) / (s - i.x)),
                (c < u || (c === u && i.x > n.x)) && Hs(i, t) && ((n = i), (u = c))),
                (i = i.next);
            return n;
          })(t, e))
        ) {
          const i = js(e, t);
          Rs(i, i.next);
        }
      }
      function Bs(t, e, i, s) {
        for (let r; r !== t; r = r.next) {
          if (
            ((r = r || t),
            null === r.z && (r.z = Us(r.x, r.y, e, i, s)),
            r.prev.next !== r || r.next.prev !== r)
          )
            return (r.prev.next = r), (r.next.prev = r), Bs(t, e, i, s);
          (r.prevZ = r.prev), (r.nextZ = r.next);
        }
        return (
          (t.prevZ.nextZ = null),
          (t.prevZ = null),
          (function (t) {
            let e,
              i = 1;
            for (;;) {
              let s,
                r = t;
              (t = null), (e = null);
              let n = 0;
              for (; r; ) {
                n++, (s = r);
                let a = 0;
                for (; a < i && s; a++) s = s.nextZ;
                let o = i;
                for (; a > 0 || (o > 0 && s); ) {
                  let i;
                  0 === a
                    ? ((i = s), (s = s.nextZ), o--)
                    : 0 !== o && s
                    ? r.z <= s.z
                      ? ((i = r), (r = r.nextZ), a--)
                      : ((i = s), (s = s.nextZ), o--)
                    : ((i = r), (r = r.nextZ), a--),
                    e ? (e.nextZ = i) : (t = i),
                    (i.prevZ = e),
                    (e = i);
                }
                r = s;
              }
              if (((e.nextZ = null), (i *= 2), n < 2)) return t;
            }
          })(t)
        );
      }
      function Ds(t, e, i) {
        return (e.y - t.y) * (i.x - e.x) - (e.x - t.x) * (i.y - e.y);
      }
      function Xs(t, e, i, s) {
        return (
          !!((Zs(t, e) && Zs(i, s)) || (Zs(t, s) && Zs(i, e))) ||
          (Ds(t, e, i) > 0 != Ds(t, e, s) > 0 && Ds(i, s, t) > 0 != Ds(i, s, e) > 0)
        );
      }
      function Ys(t, e, i, s, r, n, a, o) {
        return (
          (r - a) * (e - o) - (t - a) * (n - o) >= 0 &&
          (t - a) * (s - o) - (i - a) * (e - o) >= 0 &&
          (i - a) * (n - o) - (r - a) * (s - o) >= 0
        );
      }
      function Hs(t, e) {
        return Ds(t.prev, t, t.next) < 0
          ? Ds(t, e, t.next) >= 0 && Ds(t, t.prev, e) >= 0
          : Ds(t, e, t.prev) < 0 || Ds(t, t.next, e) < 0;
      }
      function Us(t, e, i, s, r) {
        return (
          (t =
            1431655765 &
            ((t =
              858993459 &
              ((t =
                252645135 & ((t = 16711935 & ((t = 32767 * (t - i) * r) | (t << 8))) | (t << 4))) |
                (t << 2))) |
              (t << 1))) |
          ((e =
            1431655765 &
            ((e =
              858993459 &
              ((e =
                252645135 & ((e = 16711935 & ((e = 32767 * (e - s) * r) | (e << 8))) | (e << 4))) |
                (e << 2))) |
              (e << 1))) <<
            1)
        );
      }
      function Zs(t, e) {
        return t.x === e.x && t.y === e.y;
      }
      function Ks(t, e) {
        return t.x - e.x;
      }
      function qs(t, e, i, s) {
        let r = t;
        do {
          const n = r.prev,
            a = r.next.next;
          !Zs(n, a) &&
            Xs(n, r, r.next, a) &&
            Hs(n, a) &&
            Hs(a, n) &&
            (e.push(n.index / i + s),
            e.push(r.index / i + s),
            e.push(a.index / i + s),
            Ns(r),
            Ns(r.next),
            (r = t = a)),
            (r = r.next);
        } while (r !== t);
        return r;
      }
      function Js(t, e, i, s, r, n, a) {
        let o = t;
        do {
          let t = o.next.next;
          for (; t !== o.prev; ) {
            if (o.index !== t.index && $s(o, t)) {
              let l = js(o, t);
              return (
                (o = Rs(o, o.next)),
                (l = Rs(l, l.next)),
                Vs(o, e, i, s, r, n, a, 0),
                void Vs(l, e, i, s, r, n, a, 0)
              );
            }
            t = t.next;
          }
          o = o.next;
        } while (o !== t);
      }
      function $s(t, e) {
        return (
          t.next.index !== e.index &&
          t.prev.index !== e.index &&
          !(function (t, e) {
            let i = t;
            do {
              if (
                i.index !== t.index &&
                i.next.index !== t.index &&
                i.index !== e.index &&
                i.next.index !== e.index &&
                Xs(i, i.next, t, e)
              )
                return !0;
              i = i.next;
            } while (i !== t);
            return !1;
          })(t, e) &&
          Hs(t, e) &&
          Hs(e, t) &&
          (function (t, e) {
            let i = t,
              s = !1;
            const r = (t.x + e.x) / 2,
              n = (t.y + e.y) / 2;
            do {
              i.y > n != i.next.y > n &&
                i.next.y !== i.y &&
                r < ((i.next.x - i.x) * (n - i.y)) / (i.next.y - i.y) + i.x &&
                (s = !s),
                (i = i.next);
            } while (i !== t);
            return s;
          })(t, e)
        );
      }
      function js(t, e) {
        const i = Qs.create(t.index, t.x, t.y),
          s = Qs.create(e.index, e.x, e.y),
          r = t.next,
          n = e.prev;
        return (
          (t.next = e),
          (e.prev = t),
          (i.next = r),
          (r.prev = i),
          (s.next = i),
          (i.prev = s),
          (n.next = s),
          (s.prev = n),
          s
        );
      }
      class Qs {
        constructor() {
          (this.index = 0),
            (this.x = 0),
            (this.y = 0),
            (this.prev = null),
            (this.next = null),
            (this.z = null),
            (this.prevZ = null),
            (this.nextZ = null),
            (this.steiner = !1);
        }
        static create(t, e, i) {
          const s = er < tr.length ? tr[er++] : new Qs();
          return (
            (s.index = t),
            (s.x = e),
            (s.y = i),
            (s.prev = null),
            (s.next = null),
            (s.z = null),
            (s.prevZ = null),
            (s.nextZ = null),
            (s.steiner = !1),
            s
          );
        }
      }
      const tr = new Array();
      let er = 0;
      for (let t = 0; t < 8096; t++) tr.push(new Qs());
      const ir = new je.T(),
        sr = new je.a(0, 0, 0, 1, 0),
        rr = new je.a(0, 0, 0, 1, 0);
      function nr(t, e, i) {
        let s = 0;
        for (let r = 1; r < i; r++) {
          const i = t[2 * (e + r - 1)],
            n = t[2 * (e + r - 1) + 1];
          s += (t[2 * (e + r)] - i) * (t[2 * (e + r) + 1] + n);
        }
        return s;
      }
      function ar(t, e, i, s, r) {
        let n = 0;
        for (let a = i; a < s; a += 3) {
          const i = 2 * (t.getValue(a) - r),
            s = 2 * (t.getValue(a + 1) - r),
            o = 2 * (t.getValue(a + 2) - r);
          n += Math.abs(
            (e[i] - e[o]) * (e[s + 1] - e[i + 1]) - (e[i] - e[s]) * (e[o + 1] - e[i + 1]),
          );
        }
        return n;
      }
      sr.setExtent(d.k), rr.setExtent(d.k);
      const or = (t) =>
          class extends t {
            constructor(...t) {
              super(...t), (this.forceLibtess = !1), (this.geometryType = k.a.FILL);
            }
            _write(t, e, i) {
              const s = 'esriGeometryPoint' === e.geometryType,
                r = _t.load(this._materialKey);
              t.recordStart(
                e.getDisplayId(),
                this._materialKey,
                this.geometryType,
                r.dotDensity,
                s,
              ),
                this._writeGeometry(t, e, r, i, s),
                t.recordEnd();
            }
            _writeGeometry(t, e, i, s, r) {
              const a = this._getGeometry(e, s, r);
              if ((0, n.b)(a)) return;
              const o = t.indexCount();
              if (
                !(a.lengths[0] > 1e3) &&
                !this.forceLibtess &&
                (function (t, e) {
                  const { coords: i, lengths: s, hasIndeterminateRingOrder: r } = e,
                    n = t.indexWriter(),
                    a = t.vertexCount();
                  if (r) return !1;
                  const o = n.length;
                  let l = 0;
                  for (let t = 0; t < s.length; ) {
                    let e = t,
                      r = s[t],
                      h = nr(i, l, r);
                    const c = [];
                    for (; ++e < s.length; ) {
                      const t = s[e],
                        n = nr(i, l + r, t);
                      if (!(n > 0)) break;
                      (h += n), c.push(l + r), (r += t);
                    }
                    const u = n.length;
                    Es(n, i, l, l + r, c, 2, a);
                    const f = ar(n, i, u, n.length, a),
                      d = Math.abs(h);
                    if (Math.abs((f - d) / Math.max(1e-7, d)) > 1e-5) return n.seek(o), !1;
                    (t = e), (l += r);
                  }
                  return !0;
                })(t, a)
              )
                return void (
                  !(o === t.indexCount()) && this._writeVertices(t, e, a.coords, a.lengths, i)
                );
              const l = (function (t, e) {
                const i = [],
                  s = [],
                  r = t.indexWriter(),
                  n = t.vertexCount(),
                  { coords: a, lengths: o } = e;
                ir.beginPolygon(i, s);
                let l = 0;
                for (let t = 0; t < o.length; t++) {
                  const i = e.lengths[t];
                  ir.beginContour();
                  for (let t = 0; t < i; t++) {
                    const e = [a[2 * (l + t)], a[2 * (l + t) + 1], 0];
                    ir.addVertex(e, e);
                  }
                  ir.endContour(), (l += i);
                }
                ir.endPolygon();
                for (let t = 0; t < s.length; t++) r.push(s[t] + n);
                return i;
              })(t, a);
              o !== t.indexCount() && this._writeVertices(t, e, l, [l.length / 2], i);
            }
            _writeVertices(t, e, i, s, r) {
              const n = e.getDisplayId();
              let a = 0;
              for (const o of s) {
                const s = o + a;
                for (let o = a; o < s; o++) {
                  const s = i[2 * o],
                    a = i[2 * o + 1],
                    l = (0, H.i)(1 * s, 1 * a);
                  t.vertexBounds(s, a, 0, 0),
                    t.vertexWrite(l),
                    t.vertexWrite(n),
                    r.dotDensity
                      ? t.vertexWriteF32(1 / Math.abs(e.readGeometryArea()))
                      : (t.vertexWrite(this.fillColor),
                        t.vertexWrite(this.tl),
                        t.vertexWrite(this.br),
                        t.vertexWrite(this.aux1),
                        t.vertexWrite(this.aux2),
                        t.vertexWrite(this.aux3),
                        t.vertexWrite(this._minMaxZoom));
                }
                a += o;
              }
            }
            _getGeometry(t, e, i) {
              const s = e ? (0, vt.z)((0, vt.b)(e), 2) : t.readUnquantizedGeometry();
              return s
                ? (function (t, e) {
                    if (
                      !(function (t, e, i) {
                        let s = 0;
                        for (let e = 0; e < t.lengths.length; e++) {
                          const r = t.lengths[e];
                          for (let e = 0; e < r; e++) {
                            const r = t.coords[2 * (e + s)],
                              n = t.coords[2 * (e + s) + 1];
                            if (r < -128 || r > i || n < -128 || n > i) return !0;
                          }
                          s += r;
                        }
                        return !1;
                      })(t, 0, d.k + 128)
                    )
                      return t;
                    sr.setPixelMargin(e), sr.reset(3);
                    let i = 0;
                    for (let e = 0; e < t.lengths.length; e++) {
                      const s = t.lengths[e];
                      let r = t.coords[2 * (0 + i)],
                        n = t.coords[2 * (0 + i) + 1];
                      sr.moveTo(r, n);
                      for (let e = 1; e < s; e++)
                        (r = t.coords[2 * (e + i)]),
                          (n = t.coords[2 * (e + i) + 1]),
                          sr.lineTo(r, n);
                      sr.close(), (i += s);
                    }
                    const s = sr.result(!1);
                    if (!s) return null;
                    const r = [],
                      n = [];
                    for (const t of s) {
                      let e = 0;
                      for (const i of t) n.push(i.x), n.push(i.y), e++;
                      r.push(e);
                    }
                    return new $e.a(r, n);
                  })(s, i ? 256 : 128)
                : null;
            }
          },
        lr = a.L.getLogger('esri.views.2d.engine.webgl.WGLDynamicMeshTemplate');
      class hr extends Ms {
        constructor(t) {
          super(),
            (this._ongoingMaterialRequestMap = new Map()),
            (this._materialCache = new Map()),
            (this._dynamicPropertyMap = new Map()),
            (this._cimLayer = t);
        }
        analyze(t, e, i, s) {
          const r = e.readLegacyFeature(),
            n = this._materialCache,
            a = this._cimLayer.materialHash;
          if (!a)
            return (
              lr.error('A Dynamic mesh template must have a material hash value or function!'),
              Promise.reject(null)
            );
          const o = 'function' == typeof a ? a(r, i, s) : a;
          if (n.has(o)) {
            const t = n.get(o);
            return Promise.resolve(t);
          }
          if (this._ongoingMaterialRequestMap.has(o)) return this._ongoingMaterialRequestMap.get(o);
          const l = (function (t, e) {
            if (!e || 0 === e.length) return t;
            const i = JSON.parse(JSON.stringify(t));
            return Ke.applyOverrides(i, e), i;
          })(this._cimLayer.cim, this._cimLayer.materialOverrides);
          l.mosaicHash = o;
          const h = t
            .getMosaicItem(l)
            .then((t) => (this._ongoingMaterialRequestMap.delete(o), n.set(o, t), t))
            .catch(
              (t) => (
                this._ongoingMaterialRequestMap.delete(o), lr.error('.analyze()', t.message), null
              ),
            );
          return this._ongoingMaterialRequestMap.set(o, h), h;
        }
      }
      class cr extends or(hr) {
        constructor(t, e, i) {
          var s;
          if (
            (super(t),
            (this._minMaxZoom = (0, H.i)(Math.round(e * d.d), Math.round(i * d.d))),
            cs(t.color))
          ) {
            const e = (e, i, s) => {
              const r = t.color(e, i, s);
              return (r && (0, at.a)(r)) || 0;
            };
            this._dynamicPropertyMap.set('fillColor', e);
          } else {
            const e = t.color;
            this.fillColor = (e && (0, at.a)(e)) || 0;
          }
          let r = 0;
          cs(t.height) || (r = t.height || 0);
          const n =
            'CIMMarkerPlacementInsidePolygon' ===
              (null == (s = t.cim.placement) ? void 0 : s.type) && t.cim.placement.shiftOddRows
              ? 2
              : 1;
          this._dynamicPropertyMap.set('_height', (e, i, s) =>
            cs(t.height) ? t.height(e, i, s) * n : r * n,
          );
          let a = 0;
          cs(t.offsetX) || ((a = (0, z.a)(t.offsetX || 0) + 128), a > 255 && (a = 255)),
            this._dynamicPropertyMap.set('_offsetX', (e, i, s) => {
              if (cs(t.offsetX)) {
                let r = (0, z.a)(t.offsetX(e, i, s)) + 128;
                return r > 255 && (r = 255), r;
              }
              return a;
            });
          let o = 1;
          cs(t.scaleX) || (o = t.scaleX || 1),
            this._dynamicPropertyMap.set('_scaleX', (e, i, s) =>
              cs(t.scaleX) ? t.scaleX(e, i, s) : o,
            );
          let l = 0;
          cs(t.offsetY) || ((l = (0, z.a)(-t.offsetY || 0) + 128), l > 255 && (l = 255)),
            this._dynamicPropertyMap.set('_offsetY', (e, i, s) => {
              if (cs(t.offsetY)) {
                let r = (0, z.a)(-t.offsetY(e, i, s)) + 128;
                return r > 255 && (r = 255), r;
              }
              return l;
            });
          let h = 0;
          cs(t.angle) || (h = (0, Je.r)(t.angle) || 0),
            this._dynamicPropertyMap.set('_angle', (e, i, s) =>
              cs(t.angle) ? (0, Je.r)(t.angle(e, i, s)) : h,
            ),
            (this._effects = t.effects),
            (this._cimFillLayer = t),
            (this._fillMaterialKey = _t.load(t.materialKey));
        }
        static fromCIMFill(t, e) {
          const [i, s] = fs(t.scaleInfo, e);
          return new cr(t, i, s);
        }
        bindFeature(t, e, i) {
          const s = t.readLegacyFeature();
          this._dynamicPropertyMap.forEach((t, r) => {
            this[r] = t(s, e, i);
          });
          const r = this._fillMaterialKey,
            n = this._materialCache,
            a = this._cimFillLayer;
          this.aux3 = (0, H.a)(0, 0, this._angle, a.colorLocked ? 1 : 0);
          const o = (0, a.materialHash)(s, e, i),
            l = n.get(o);
          let h = null;
          if ((l && Ki(l.spriteMosaicItem) && (h = l.spriteMosaicItem), h)) {
            const { rect: t, width: e, height: i } = h,
              s = t.x + d.S,
              n = t.y + d.S,
              a = s + e,
              o = n + i;
            let l = (0, E.G)((0, z.a)(this._height));
            l > 255 ? (l = 255) : l <= 0 && (l = (0, E.G)(o - n));
            let c = (0, E.G)((0, z.a)((this._height / i) * e || 0));
            c > 255 ? (c = 255) : c <= 0 && (c = (0, E.G)(a - s));
            const u = this._scaleX,
              f = 1;
            (this.tl = (0, H.i)(s, n)),
              (this.br = (0, H.i)(a, o)),
              (this.aux1 = (0, H.a)(c, l, this._offsetX, this._offsetY)),
              (this.aux2 = (0, H.i)(128 * u, 128 * f)),
              (r.sdf = h.sdf),
              (r.pattern = !0),
              (r.textureBinding = h.textureBinding);
          } else
            (this.tl = 0),
              (this.br = 0),
              (this.aux1 = 0),
              (this.aux2 = 0),
              (r.sdf = !1),
              (r.pattern = !1),
              (r.textureBinding = 0);
          this._materialKey = r.data;
        }
      }
      const ur = (t) =>
          class extends t {
            constructor(...t) {
              super(...t),
                (this.tessellationProperties = {}),
                (this._tessellationOptions = { halfWidth: 0, pixelCoordRatio: 1, offset: 0 }),
                (this.geometryType = k.a.LINE);
            }
            _initializeTessellator(t) {
              const e = pt.load(this._materialKey),
                i = this._tessellationOptions,
                s =
                  e.vvSizeFieldStops ||
                  e.vvSizeMinMaxValue ||
                  e.vvSizeScaleStops ||
                  e.vvSizeUnitValue,
                r = this.tessellationProperties._halfWidth < d.T;
              this.tessellationProperties.minMaxZoom = this._minMaxZoom;
              const n = r && !t && !s;
              (i.wrapDistance = 65535),
                (i.textured = this._isDashed || this._hasPattern),
                (i.offset = this.tessellationProperties.offset),
                (i.halfWidth = this.tessellationProperties._halfWidth);
              const a = n ? 0 : 1;
              this._lineTessellator = new Ai.L(
                fr(this.tessellationProperties, a, a),
                dr(this.tessellationProperties),
                n,
              );
            }
            _write(t, e, i) {
              const s = 'esriGeometryPoint' === e.geometryType;
              t.recordStart(e.getDisplayId(), this._materialKey, this.geometryType, !1, s),
                this._writeGeometry(t, e, i, s),
                t.recordEnd();
            }
            _writeGeometry(t, e, i, s) {
              const r = null != i ? i : e.readLegacyGeometry(),
                a = this._getLines(r, s);
              (0, n.b)(a) || this._writeVertices(t, e, a);
            }
            _getLines(t, e) {
              if ((0, n.b)(t)) return null;
              const i = t.paths || t.rings;
              return (0, n.b)(i)
                ? null
                : (function (t, e) {
                    rr.setPixelMargin(e);
                    const i = rr,
                      s = -e,
                      r = d.k + e;
                    let n = [],
                      a = !1,
                      o = 0;
                    for (; o < t.length; ) {
                      const e = [],
                        l = t[o];
                      i.reset(2);
                      let [h, c] = l[0];
                      if (a) i.moveTo(h, c);
                      else {
                        if (h < s || h > r || c < s || c > r) {
                          a = !0;
                          continue;
                        }
                        e.push({ x: h, y: c });
                      }
                      let u = !1;
                      const f = l.length;
                      for (let t = 1; t < f; ++t)
                        if (((h += l[t][0]), (c += l[t][1]), a)) i.lineTo(h, c);
                        else {
                          if (h < s || h > r || c < s || c > r) {
                            u = !0;
                            break;
                          }
                          e.push({ x: h, y: c });
                        }
                      if (u) a = !0;
                      else {
                        if (a) {
                          const t = i.resultWithStarts();
                          if (t) for (const e of t) n.push(e);
                        } else n.push({ line: e, start: 0 });
                        o++, (a = !1);
                      }
                    }
                    return (n = n.filter((t) => t.line.length > 1)), 0 === n.length ? null : n;
                  })(i, e ? 256 : 16);
            }
            _writeVertices(t, e, i) {
              const s = e.getDisplayId(),
                r = t.vertexCount(),
                n = this.tessellationProperties,
                a = this._tessellationOptions;
              (n.out = t),
                (n.id = s),
                (n.indexCount = 0),
                (n.vertexCount = 0),
                (n.offset = r),
                (a.capType = this._capType),
                (a.joinType = this._joinType);
              for (const { line: t, start: e } of i)
                (a.initialDistance = e % 65535), this._lineTessellator.tessellate(t, a);
            }
          },
        fr = (t, e, i) => (s, r, n, a, o, l, h, c, u, f, d) => {
          const _ = (0, H.i)(d, Math.ceil(1024 * t._halfWidth)),
            m = (0, H.a)(
              Math.round(31 * h),
              Math.round(31 * c),
              Math.round(31 * u),
              Math.round(31 * f),
            ),
            p = (0, H.a)(31 * o, 31 * l, 0, t._bitset),
            g = t.out;
          return (
            g.vertexBounds(s, r, e, i),
            g.vertexWrite((0, H.i)(8 * s, 8 * r)),
            g.vertexWrite(t.id),
            g.vertexWrite(t._fillColor),
            g.vertexWrite(m),
            g.vertexWrite(_),
            g.vertexWrite(t._tl),
            g.vertexWrite(t._br),
            g.vertexWrite(p),
            g.vertexWrite((0, H.i)(Math.ceil(1024 * t._halfReferenceWidth), 0)),
            g.vertexWrite(t.minMaxZoom),
            g.vertexEnd(),
            t.offset + t.vertexCount++
          );
        },
        dr = (t) => (e, i, s) => {
          const r = t.out;
          r.indexWrite(e), r.indexWrite(i), r.indexWrite(s), (t.indexCount += 3);
        };
      class _r extends ur(hr) {
        constructor(t, e, i) {
          super(t),
            (this._minMaxZoom = (0, H.i)(Math.round(e * d.d), Math.round(i * d.d))),
            (this._cimLineLayer = t);
          let s = 0;
          if (
            (cs(t.width) || (s = 0.5 * (0, z.a)(t.width)),
            this._dynamicPropertyMap.set('_halfWidth', (e, i, r) =>
              cs(t.width) ? 0.5 * (0, z.a)(t.width(e, i, r)) : s,
            ),
            cs(t.cap) ? this._dynamicPropertyMap.set('_capType', t.cap) : (this._capType = t.cap),
            cs(t.join)
              ? this._dynamicPropertyMap.set('_joinType', t.join)
              : (this._joinType = t.join),
            cs(t.color))
          ) {
            const e = (e, i, s) => {
              const r = t.color(e, i, s);
              return (r && (0, at.a)(r)) || 0;
            };
            this._dynamicPropertyMap.set('_fillColor', e);
          } else {
            const e = t.color;
            this._fillColor = (e && (0, at.a)(e)) || 0;
          }
          if (cs(t.miterLimit)) {
            const e = (e, i, s) => us(t.miterLimit(e, i, s));
            this._dynamicPropertyMap.set('_miterLimitCosine', e);
          } else this._miterLimitCosine = us(t.miterLimit);
          (this._scaleFactor = t.scaleFactor || 1),
            (this._isDashed = t.isDashed),
            (this._effects = t.effects),
            (this.tessellationProperties._bitset = t.colorLocked ? 1 : 0),
            (this._materialKey = t.materialKey),
            this._initializeTessellator(!0);
        }
        static fromCIMLine(t, e) {
          const [i, s] = fs(t.scaleInfo, e);
          return new _r(t, i, s);
        }
        bindFeature(t, e, i) {
          const s = t.readLegacyFeature();
          this._dynamicPropertyMap.forEach((t, r) => {
            this[r] = t(s, e, i);
          }),
            (this._halfWidth *= this._scaleFactor);
          const r = this._materialCache,
            n = (0, this._cimLineLayer.materialHash)(s, e, i),
            a = r.get(n);
          let o = null;
          if ((a && Ki(a.spriteMosaicItem) && (o = a.spriteMosaicItem), o)) {
            this._hasPattern = !0;
            const { rect: t, width: e, height: i } = o,
              s = t.x + d.S,
              r = t.y + d.S,
              n = s + e,
              a = r + i;
            (this.tessellationProperties._tl = (0, H.i)(s, r)),
              (this.tessellationProperties._br = (0, H.i)(n, a));
          } else
            (this._hasPattern = !1),
              (this.tessellationProperties._tl = 0),
              (this.tessellationProperties._br = 0);
          (this.tessellationProperties._fillColor = this._fillColor),
            (this.tessellationProperties._halfWidth = this._halfWidth),
            (this.tessellationProperties.offset = 0),
            (this.tessellationProperties._halfReferenceWidth = this.tessellationProperties._halfWidth);
          const l = pt.load(this._materialKey);
          o && ((l.sdf = o.sdf), (l.pattern = !0), (l.textureBinding = o.textureBinding)),
            (this._materialKey = l.data);
        }
      }
      const mr = W(),
        pr = F(),
        gr = a.L.getLogger('esri.views.2d.engine.webgl.WGLDynamicMarkerTemplate');
      class yr extends Is(hr) {
        constructor(t, e, i) {
          if (
            (super(t),
            (this._cimMarkerLayer = t),
            (this._minMaxZoom = (0, H.i)(Math.round(e * d.d), Math.round(i * d.d))),
            cs(t.color))
          ) {
            const e = (e, i, s) => (0, at.a)(t.color(e, i, s));
            this._dynamicPropertyMap.set('_fillColor', e);
          } else this._fillColor = (0, at.a)(t.color);
          if (cs(t.outlineColor)) {
            const e = (e, i, s) => (0, at.a)(t.outlineColor(e, i, s));
            this._dynamicPropertyMap.set('_outlineColor', e);
          } else this._outlineColor = (0, at.a)(t.outlineColor);
          if (cs(t.size)) {
            const e = (e, i, s) => (0, z.a)(t.size(e, i, s));
            this._dynamicPropertyMap.set('_size', e);
          } else this._size = (0, z.a)(t.size);
          if (
            (cs(t.scaleX)
              ? this._dynamicPropertyMap.set('_scaleX', t.scaleX)
              : (this._scaleX = t.scaleX),
            cs(t.offsetX))
          ) {
            const e = (e, i, s) => (0, z.a)(t.offsetX(e, i, s));
            this._dynamicPropertyMap.set('xOffset', e);
          } else this.xOffset = (0, z.a)(t.offsetX);
          if (cs(t.offsetY)) {
            const e = (e, i, s) => (0, z.a)(t.offsetY(e, i, s));
            this._dynamicPropertyMap.set('yOffset', e);
          } else this.yOffset = (0, z.a)(t.offsetY);
          if (cs(t.outlineWidth)) {
            const e = (e, i, s) => (0, z.a)(t.outlineWidth(e, i, s));
            this._dynamicPropertyMap.set('_outlineWidth', e);
          } else this._outlineWidth = (0, z.a)(t.outlineWidth);
          cs(t.rotation)
            ? this._dynamicPropertyMap.set('_angle', t.rotation)
            : (this._angle = t.rotation),
            (this._scaleFactor = (0, n.d)(t.scaleFactor, 1)),
            (this._markerPlacement = t.markerPlacement),
            (this._effects = t.effects),
            (this._bitSet =
              (1 === t.alignment ? 1 : 0) |
              ((t.colorLocked ? 1 : 0) << 1) |
              ((t.scaleSymbolsProportionally ? 1 : 0) << 3)),
            (this._materialKey = t.materialKey);
        }
        static fromCIMMarker(t, e) {
          const [i, s] = fs(t.scaleInfo, e);
          return new yr(t, i, s);
        }
        bindFeature(t, e, i) {
          const s = t.readLegacyFeature();
          this._dynamicPropertyMap.forEach((t, r) => {
            this[r] = t(s, e, i);
          });
          const n = this._cimMarkerLayer.materialHash,
            a = 'function' == typeof n ? n(s, e, i) : n,
            o = this._materialCache.get(a);
          if (!o || !Ki(o.spriteMosaicItem) || !o.spriteMosaicItem)
            return void gr.error(
              new r.Z('mapview-cim', 'Encountered an error when binding feature'),
            );
          const l = o.spriteMosaicItem,
            h = this._cimMarkerLayer.sizeRatio,
            c = (l.width / l.height) * this._scaleX,
            u = this._cimMarkerLayer.rotateClockwise ? this._angle : -this._angle;
          let f = this._size,
            _ = f * c;
          const m = this.xOffset,
            p = this.yOffset;
          (this.xOffset *= this._scaleFactor), (this.yOffset *= this._scaleFactor);
          const g =
              this._cimMarkerLayer.scaleSymbolsProportionally && this._cimMarkerLayer.frameHeight
                ? this._size / (0, z.a)(this._cimMarkerLayer.frameHeight)
                : 1,
            y = this._outlineWidth * g,
            x = (0, z.a)(this._cimMarkerLayer.referenceSize);
          let v = 0,
            M = 0;
          const S = this._cimMarkerLayer.anchorPoint;
          S &&
            (this._cimMarkerLayer.isAbsoluteAnchorPoint
              ? this._size && ((v = -S.x / (this._size * c)), (M = S.y / this._size))
              : ((v = S.x), (M = S.y))),
            (this._sizeOutlineWidth = (0, H.a)(
              Math.round(Math.min(Math.sqrt(128 * _), 255)),
              Math.round(Math.min(Math.sqrt(128 * f), 255)),
              Math.round(Math.min(Math.sqrt(128 * y), 255)),
              Math.round(Math.min(Math.sqrt(128 * x), 255)),
            )),
            (this.angle = u);
          const b = Math.round(64 * h);
          this._bitestAndDistRatio = (0, H.i)(this._bitSet, b);
          const w = l.rect.x + d.S,
            P = l.rect.y + d.S,
            C = w + l.width,
            L = P + l.height;
          (this._texUpperLeft = (0, H.i)(w, P)),
            (this._texUpperRight = (0, H.i)(C, P)),
            (this._texBottomLeft = (0, H.i)(w, L)),
            (this._texBottomRight = (0, H.i)(C, L));
          const k = mt.load(this._materialKey);
          (k.sdf = l.sdf),
            (k.pattern = !0),
            (k.textureBinding = l.textureBinding),
            (this._materialKey = k.data),
            (this._anchorX = 0.5 - ((0.5 + v) * l.width) / l.width),
            (this._anchorY = 0.5 - ((0.5 + M) * l.height) / l.height),
            (_ *= h),
            (f *= h),
            (_ *= this._scaleFactor),
            (f *= this._scaleFactor),
            (_ *= l.rect.width / l.width),
            (f *= l.rect.height / l.height),
            (this._computedWidth = _),
            (this._computedHeight = f),
            this._applyTransformation(pr, mr),
            (this.xOffset = m),
            (this.yOffset = p);
        }
      }
      function xr(t) {
        const e = new Array(t.length);
        for (let i = 0; i < t.length; i++) e[i] = t.charCodeAt(i);
        return e;
      }
      class vr extends xs(hr) {
        constructor(t, e, i) {
          super(t),
            (this._horizontalAlignment = 'center'),
            (this._verticalAlignment = 'middle'),
            (this._textToGlyphs = new Map()),
            (this._minMaxZoom = (0, H.i)(Math.round(e * d.d), Math.round(i * d.d)));
          const s = t.scaleFactor || 1;
          if (((this._cimTextLayer = t), cs(t.color))) {
            const e = (e, i, s) => (0, at.a)(t.color(e, i, s));
            this._dynamicPropertyMap.set('_color', e);
          } else this._color = (0, at.a)(t.color);
          if (cs(t.color)) {
            const e = (e, i, s) => (0, at.a)(t.outlineColor(e, i, s));
            this._dynamicPropertyMap.set('_haloColor', e);
          } else this._haloColor = (0, at.a)(t.outlineColor);
          let r, n, a;
          if (
            (cs(t.size) || (r = Math.min(Math.round((0, z.a)(t.size * t.sizeRatio)), 127)),
            this._dynamicPropertyMap.set('_size', (e, i, s) =>
              cs(t.size) ? Math.min(Math.round((0, z.a)(t.size(e, i, s) * t.sizeRatio)), 127) : r,
            ),
            cs(t.outlineSize))
          ) {
            const e = (e, i, s) =>
              Math.min(Math.floor(5 * (0, z.a)(t.outlineSize(e, i, s) * t.sizeRatio)), 127);
            this._dynamicPropertyMap.set('_haloSize', e);
          } else
            this._haloSize = Math.min(Math.floor(5 * (0, z.a)(t.outlineSize * t.sizeRatio)), 127);
          cs(t.offsetX) || (n = Math.round((0, z.a)(t.offsetX * t.sizeRatio))),
            this._dynamicPropertyMap.set('_xOffset', (e, i, s) =>
              cs(t.offsetX) ? Math.round((0, z.a)(t.offsetX(e, i, s) * t.sizeRatio)) : n,
            ),
            cs(t.offsetY) || (a = Math.round((0, z.a)(t.offsetY * t.sizeRatio))),
            this._dynamicPropertyMap.set('_yOffset', (e, i, s) =>
              cs(t.offsetY) ? Math.round((0, z.a)(t.offsetY(e, i, s) * t.sizeRatio)) : a,
            ),
            cs(t.angle) ? this._dynamicPropertyMap.set('_angle', t.angle) : (this._angle = t.angle),
            cs(t.horizontalAlignment)
              ? this._dynamicPropertyMap.set('_horizontalAlignment', t.horizontalAlignment)
              : (this._horizontalAlignment = t.horizontalAlignment),
            cs(t.verticalAlignment)
              ? this._dynamicPropertyMap.set('_verticalAlignment', t.verticalAlignment)
              : (this._verticalAlignment = t.verticalAlignment),
            (this._scaleFactor = s),
            cs(t.text) ? this._dynamicPropertyMap.set('_text', t.text) : (this._text = t.text);
          const o = Math.min(Math.round((0, z.a)(t.referenceSize * t.sizeRatio)), 127);
          (this._referenceSize = Math.round(Math.sqrt(256 * o))),
            (this._materialKey = t.materialKey);
          const l = gt.load(this._materialKey);
          (l.sdf = !0),
            (this._bitset = (1 === t.alignment ? 1 : 0) | ((t.colorLocked ? 1 : 0) << 1)),
            (this._materialKey = l.data),
            (this._decoration = 'none'),
            (this._lineHeight = 1),
            (this._lineWidth = 512),
            (this._textPlacement = t.markerPlacement),
            (this._effects = t.effects),
            (this._isCIM = !0);
        }
        static fromCIMText(t, e) {
          const [i, s] = fs(t.scaleInfo, e);
          return new vr(t, i, s);
        }
        async analyze(t, e, i, s) {
          const r = e.readLegacyFeature(),
            n = (function (t, e, i, s) {
              return 'string' == typeof t.text
                ? t.text
                : 'function' == typeof t.text
                ? t.text(e, i, s)
                : '';
            })(this._cimTextLayer, r, i, s),
            a = await t.getMosaicItem(this._cimTextLayer.cim, xr(n));
          return this._textToGlyphs.set(n, a.glyphMosaicItems), a;
        }
        bindFeature(t, e, i) {
          const s = t.readLegacyFeature();
          if (
            (this._dynamicPropertyMap.forEach((t, r) => {
              this[r] = t(s, e, i);
            }),
            !this._text || 0 === this._text.length)
          )
            return void (this._shapingInfo = null);
          (this._size *= this._scaleFactor),
            (this._scale = this._size / 24),
            (this._xOffset *= this._scaleFactor),
            (this._yOffset *= this._scaleFactor),
            (this._xAlignD = K(this._horizontalAlignment || 'center')),
            (this._yAlignD = q(this._verticalAlignment || 'baseline'));
          const r = this._textToGlyphs.get(this._text);
          this.bindTextInfo(r, !1);
        }
      }
      class Mr extends or(Ms) {
        constructor(t, e, i, s, r, n, a, o, l, h, c) {
          super(), (this._effects = l);
          const u = _t.load(t);
          e && ((u.sdf = e.sdf), (u.pattern = !0), (u.textureBinding = e.textureBinding)),
            (this.fillColor = i),
            (this.tl = s),
            (this.br = r),
            (this.aux1 = n),
            (this.aux2 = a),
            (this.aux3 = o),
            (this._minMaxZoom = (0, H.i)(Math.round(h * d.d), Math.round(c * d.d))),
            (this._materialKey = u.data);
        }
        static fromCIMFill(t, e, i) {
          const s = t.color,
            r = (s && (0, at.a)(s)) || 0,
            n = t.materialKey,
            [a, o] = fs(t.scaleInfo, i);
          if (!e) {
            const e = (0, H.a)(0, 0, 0, t.colorLocked ? 1 : 0);
            return new Mr(n, null, r, 0, 0, 0, 0, e, t.effects, a, o);
          }
          const { rect: l, width: h, height: c } = e,
            u = l.x + d.S,
            f = l.y + d.S,
            _ = u + h,
            m = f + c;
          let p = (0, E.G)(c);
          p > 255 ? (p = 255) : p <= 0 && (p = (0, E.G)(m - f));
          let g = (0, E.G)(h || 0);
          g > 255 ? (g = 255) : g <= 0 && (g = (0, E.G)(_ - u));
          let y = (0, z.a)(t.offsetX || 0) + 128;
          y > 255 && (y = 255);
          let x = (0, z.a)(-t.offsetY || 0) + 128;
          x > 255 && (x = 255);
          const v = t.scaleX || 1,
            M = (0, H.i)(u, f),
            S = (0, H.i)(_, m),
            b = (0, H.a)(g, p, y, x),
            w = (0, H.i)(128 * v, 128),
            P = (0, H.a)(0, 0, (0, Je.d)(t.angle), t.colorLocked ? 1 : 0);
          return new Mr(n, e, r, M, S, b, w, P, t.effects, a, o);
        }
        static fromSimpleFill(t, e, i = !1) {
          const { color: s } = t,
            r = (s && 'esriSFSNull' !== t.style && (0, at.p)(s)) || 0,
            n = (0, H.a)(0, 0, 0, i ? 255 : 0),
            a = t.materialKey;
          if (!e) return new Mr(a, null, r, 0, 0, 0, 0, n, null, 0, 100);
          const { rect: o, width: l, height: h } = e,
            c = o.x + d.S,
            u = o.y + d.S,
            f = c + l,
            _ = u + h,
            m = (0, H.i)(c, u),
            p = (0, H.i)(f, _),
            g = (0, H.a)((0, E.G)(f - c), (0, E.G)(_ - u), 0, 0),
            y = (0, H.i)(128, 128);
          return new Mr(a, e, r, m, p, g, y, n, null, 0, 100);
        }
        static fromPictureFill(t, e, i = !1) {
          const s = d.t,
            { rect: r, width: n, height: a } = e,
            o = r.x + d.S,
            l = r.y + d.S,
            h = o + n,
            c = l + a,
            u = (0, H.i)(o, l),
            f = (0, H.i)(h, c);
          let _ = (0, E.G)((0, z.a)(t.width));
          _ > 255 && (_ = 255);
          let m = (0, E.G)((0, z.a)(t.height));
          m > 255 && (m = 255);
          let p = (0, z.a)(t.xoffset) + 128;
          p > 255 && (p = 255);
          let g = (0, z.a)(-t.yoffset) + 128;
          g > 255 && (g = 255);
          const y = (0, H.a)(_, m, p, g),
            x = (0, H.i)(128 * t.xscale, 128 * t.yscale),
            v = (0, H.a)(0, 0, 0, i ? 255 : 0),
            M = t.materialKey;
          return new Mr(M, e, s, u, f, y, x, v, null, 0, 100);
        }
      }
      const Sr = a.L.getLogger('esri.views.2d.engine.webgl.WGLLineTemplate');
      class br extends ur(Ms) {
        constructor(t, e, i, s, r, n, a, o, l, h, c, u, f, _, m, p, g) {
          super();
          const y = pt.load(t);
          e && ((y.sdf = e.sdf), (y.pattern = !0), (y.textureBinding = e.textureBinding)),
            (this._capType = s),
            (this._joinType = r),
            (this._miterLimitCosine = us(n)),
            (this.tessellationProperties._fillColor = a),
            (this.tessellationProperties._tl = o),
            (this.tessellationProperties._br = l),
            (this._hasPattern = h),
            (this._isDashed = c),
            (this._isColorLocked = u),
            (this._zOrder = _),
            (this._effects = m),
            (this._minMaxZoom = (0, H.i)(Math.round(p * d.d), Math.round(g * d.d))),
            (this._materialKey = y.data),
            (this.tessellationProperties._bitset = u ? 1 : 0),
            (this.tessellationProperties._halfWidth = 0.5 * i),
            (this.tessellationProperties._halfReferenceWidth = 0.5 * f),
            (this.tessellationProperties.offset = 0),
            this._initializeTessellator(!1);
        }
        static fromCIMLine(t, e, i) {
          const s = t.color,
            r = t.scaleFactor || 1,
            n = t.isDashed;
          let a = t.cap;
          n && 1 === a && (a = 2);
          const o = t.join,
            l = (0, z.a)(t.width) * r,
            h = (0, z.a)(t.referenceWidth),
            c = (0, z.a)(t.miterLimit),
            u = (s && (0, at.a)(s)) || 0,
            [f, _] = fs(t.scaleInfo, i);
          if (!e)
            return new br(
              t.materialKey,
              e,
              l,
              a,
              o,
              c,
              u,
              0,
              0,
              !1,
              n,
              t.colorLocked,
              h,
              t.zOrder,
              t.effects,
              f,
              _,
            );
          const { rect: m, width: p, height: g } = e,
            y = m.x + d.S,
            x = m.y + d.S,
            v = y + p,
            M = x + g,
            S = (0, H.i)(y, x),
            b = (0, H.i)(v, M);
          return new br(
            t.materialKey,
            e,
            l,
            a,
            o,
            c,
            u,
            S,
            b,
            !0,
            n,
            t.colorLocked,
            h,
            t.zOrder,
            t.effects,
            f,
            _,
          );
        }
        static fromSimpleLine(t, e) {
          const { color: i } = t,
            s = 'esriSLSSolid' !== t.style && 'esriSLSNull' !== t.style,
            r = (0, f.j)(t.cap || 'round'),
            n = (0, f.k)(t.join || 'round');
          let a = (i && 'esriSLSNull' !== t.style && (0, at.p)(i)) || 0;
          'esriSLSNull' === t.style && (a = 0);
          const o = (0, z.a)(t.width),
            l = t.miterLimit;
          if (!e)
            return new br(t.materialKey, e, o, r, n, l, a, 0, 0, !1, s, !1, o, 0, null, 0, 100);
          const { rect: h, width: c, height: u } = e,
            _ = h.x + d.S,
            m = h.y + d.S,
            p = _ + c,
            g = m + u,
            y = (0, H.i)(_, m),
            x = (0, H.i)(p, g);
          return new br(t.materialKey, e, o, r, n, l, a, y, x, !0, s, !1, o, 0, null, 0, 100);
        }
        static fromPictureLineSymbol(t, e, i, s) {
          return Sr.error('PictureLineSymbol support does not exist!'), null;
        }
      }
      class wr {
        constructor() {
          this._resolver = null;
        }
        isHeld() {
          return !!this._resolver;
        }
        async acquire() {
          if (!this._resolver) return (this._resolver = (0, o.hh)()), Promise.resolve();
          await this._resolver.promise, await this.acquire();
        }
        release() {
          const t = this._resolver;
          (this._resolver = null), t.resolve();
        }
      }
      const Pr = a.L.getLogger('esri.views.2d.engine.webgl.mesh.templates.WGLTemplateStore'),
        Cr = new Array();
      function Lr(t, e) {
        const i = t.length;
        return t.push(null), e.then((e) => (t[i] = e)), t;
      }
      function kr(t) {
        return !!(1 & t);
      }
      class Ir {
        constructor(t, e) {
          (this._idCounter = 1),
            (this._templateIdCounter = 1),
            (this._idToTemplateGroup = new Map()),
            (this._symbolToTemplate = new Map()),
            (this._fetchQueue = []),
            (this._idToResolver = new Map()),
            (this._cimTemplateCache = new Map()),
            (this._cimAnalyses = []),
            (this._lock = new wr()),
            (this._fetchResource = t),
            (this._tileInfo = e);
        }
        get _markerError() {
          return this._errorTemplates.marker[0];
        }
        get _fillError() {
          return this._errorTemplates.fill[0];
        }
        get _lineError() {
          return this._errorTemplates.line[0];
        }
        get _textError() {
          return this._errorTemplates.line[0];
        }
        createTemplateGroup(t, e) {
          this._initErrorTemplates();
          const i = t.hash;
          if (this._symbolToTemplate.has(i)) return this._symbolToTemplate.get(i);
          const s = new Array();
          e && this._createMeshTemplates(s, e, !0), this._createMeshTemplates(s, t, !1);
          const r = this._createGroupId('expanded-cim' === t.type);
          return this._idToTemplateGroup.set(r, s), this._symbolToTemplate.set(i, r), r;
        }
        getTemplateGroup(t) {
          return this._idToTemplateGroup.has(t) ? this._idToTemplateGroup.get(t) : Cr;
        }
        getDynamicTemplateGroup(t) {
          return this._idToTemplateGroup.has(t)
            ? (kr(t) ||
                Pr.error('mapview-template-store', `Id ${t} does not refer to a dynamic template`),
              this._idToTemplateGroup.get(t))
            : Cr;
        }
        getMosaicItem(t, e) {
          const i = this._createTemplateId(),
            s = new Promise((t) => this._idToResolver.set(i, t));
          return this._fetchQueue.push({ symbol: t, id: i, glyphIds: e }), s;
        }
        finalize(t) {
          return this._fetchQueue.length || this._lock.isHeld()
            ? (async function (t, e, i) {
                try {
                  await t.acquire(), await e(i), t.release();
                } catch (e) {
                  throw (t.release(), e);
                }
              })(this._lock, this._fetchAllQueuedResources.bind(this), t)
            : Promise.resolve();
        }
        _initErrorTemplates() {
          this._errorTemplates ||
            (this._errorTemplates = {
              fill: this._createMeshTemplates([], Hi(qe.a), !1),
              marker: this._createMeshTemplates([], Hi(qe.b), !1),
              line: this._createMeshTemplates([], Hi(qe.e), !1),
            });
        }
        _fetchAllQueuedResources(t) {
          if (!this._fetchQueue.length) return Promise.resolve();
          const e = this._fetchQueue,
            i = this._cimAnalyses;
          return (
            (this._fetchQueue = []),
            (this._cimAnalyses = []),
            Promise.all(i)
              .then(() =>
                this._fetchResource(e, t).then((t) => {
                  for (const { id: e, mosaicItem: i } of t)
                    this._idToResolver.get(e)(i), this._idToResolver.delete(e);
                }),
              )
              .catch((t) => {
                (0, o.D_)(t)
                  ? (this._fetchQueue = this._fetchQueue.concat(e))
                  : (function (t) {
                      return 'worker:port-closed' === t.name;
                    })(t) ||
                    Pr.error(
                      new r.Z(
                        'mapview-template-store',
                        'Unable to fetch requested texture resources',
                        t,
                      ),
                    );
              })
          );
        }
        _createGroupId(t) {
          return (this._idCounter++ << 1) | (t ? 1 : 0);
        }
        _createTemplateId() {
          return this._templateIdCounter++;
        }
        async _createSMS(t) {
          const { spriteMosaicItem: e } = await this.getMosaicItem(t);
          return Ki(e, Pr) ? Ts.fromSimpleMarker(t, e) : this._markerError;
        }
        async _createPMS(t) {
          const { spriteMosaicItem: e } = await this.getMosaicItem(t);
          return Ki(e, Pr) ? Ts.fromPictureMarker(t, e) : this._markerError;
        }
        async _createSFS(t, e) {
          const { spriteMosaicItem: i } = await this.getMosaicItem(t);
          return Ki(i, Pr) ? Mr.fromSimpleFill(t, i, e) : this._fillError;
        }
        async _createPFS(t, e) {
          const { spriteMosaicItem: i } = await this.getMosaicItem(t);
          return Ki(i, Pr) ? Mr.fromPictureFill(t, i, e) : this._fillError;
        }
        async _createSLS(t, e) {
          const { spriteMosaicItem: i } = await this.getMosaicItem(t);
          return Ki(i, Pr) ? br.fromSimpleLine(t, i) : this._lineError;
        }
        async _createLMS(t) {
          const { spriteMosaicItem: e } = await this.getMosaicItem(t);
          return Ki(e, Pr) ? Ts.fromLineSymbolMarker(t, e) : this._markerError;
        }
        async _createTS(t) {
          const { glyphMosaicItems: e } = await this.getMosaicItem(t);
          return Ss.fromText(t, e);
        }
        async _createCIMText(t) {
          const { glyphMosaicItems: e } = await this.getMosaicItem(t.cim, xr(t.text));
          return Ki(e, Pr) ? Ss.fromCIMText(t, e, this._tileInfo) : this._textError;
        }
        async _createCIMFill(t) {
          const { spriteMosaicItem: e } = await this.getMosaicItem(t.cim);
          return Ki(e, Pr) ? Mr.fromCIMFill(t, e, this._tileInfo) : this._fillError;
        }
        async _createCIMLine(t) {
          const { spriteMosaicItem: e } = await this.getMosaicItem(t.cim);
          return Ki(e, Pr) ? br.fromCIMLine(t, e, this._tileInfo) : this._lineError;
        }
        async _createCIMMarker(t) {
          const { spriteMosaicItem: e } = await this.getMosaicItem(t.cim);
          return Ki(e, Pr) ? Ts.fromCIMMarker(t, e, this._tileInfo) : this._markerError;
        }
        async _createCIM(t) {
          const e = t.templateHash;
          if (this._cimTemplateCache.has(e)) return this._cimTemplateCache.get(e);
          const i = { ...t, cim: { ...t.cim, mosaicHash: t.materialHash } };
          let s;
          switch (i.type) {
            case 'marker':
              s = this._createCIMMarker(i);
              break;
            case 'line':
              s = this._createCIMLine(i);
              break;
            case 'fill':
              s = this._createCIMFill(i);
              break;
            case 'text':
              s = this._createCIMText(i);
          }
          return s.then((t) => this._cimTemplateCache.set(e, t)), s;
        }
        _createDynamicCIM(t) {
          const e = t.templateHash;
          if (this._cimTemplateCache.has(e)) return this._cimTemplateCache.get(e);
          let i;
          switch (t.type) {
            case 'marker':
              i = yr.fromCIMMarker(t, this._tileInfo);
              break;
            case 'line':
              i = _r.fromCIMLine(t, this._tileInfo);
              break;
            case 'fill':
              i = cr.fromCIMFill(t, this._tileInfo);
              break;
            case 'text':
              i = vr.fromCIMText(t, this._tileInfo);
          }
          return this._cimTemplateCache.set(e, i), i;
        }
        _createPrimitiveMeshTemplates(t, e, i) {
          switch (e.type) {
            case 'esriSMS':
              return Lr(t, this._createSMS(e));
            case 'esriPMS':
              return Lr(t, this._createPMS(e));
            case 'esriSFS':
              return Lr(t, this._createSFS(e, i));
            case 'line-marker':
              return Lr(t, this._createLMS(e));
            case 'esriPFS':
              return Lr(t, this._createPFS(e, i));
            case 'esriSLS':
              return Lr(t, this._createSLS(e, !1));
            case 'esriTS':
              return Lr(t, this._createTS(e));
            default:
              return (
                Pr.error(
                  'Unable to create mesh template for unknown symbol type {: $ }{symbol.type}',
                ),
                t
              );
          }
        }
        _createMeshTemplates(t, e, i) {
          if (-1 !== e.type.indexOf('3d'))
            return Pr.error('3D symbols are not supported with MapView'), t;
          if ('expanded-cim' === e.type) {
            for (const i of e.layers)
              'function' == typeof i.materialHash
                ? t.push(this._createDynamicCIM(i))
                : Lr(t, this._createCIM(i));
            return t;
          }
          if ('composite-symbol' === e.type) {
            for (const s of e.layers) this._createPrimitiveMeshTemplates(t, s, i);
            return t;
          }
          return 'cim' === e.type || 'label' === e.type || 'web-style' === e.type
            ? t
            : this._createPrimitiveMeshTemplates(t, e, i);
        }
      }
      class Tr {
        constructor(t, e, i) {
          (this._geometryType = t), (this._idField = e), (this._templateStore = i);
        }
        update(t, e) {
          (0, n.i)(t.mesh.labels) &&
            (this._labelTemplates = this._createLabelTemplates(t.mesh.labels, e));
        }
        _createLabelTemplates(t, e) {
          const i = new Map();
          if ('simple' === t.type) {
            for (const s of t.classes) {
              const t = ks.fromLabelClass(s, e);
              i.set(s.index, t);
            }
            return i;
          }
          for (const s in t.classes) {
            const r = t.classes[s];
            for (const t of r) {
              const s = ks.fromLabelClass(t, e);
              i.set(t.index, s);
            }
          }
          return i;
        }
        get templates() {
          return this._templateStore;
        }
        async analyze(t, e, i, s, r, a) {
          if ((0, o.Hc)(a)) return;
          let l;
          'dictionary' === e.type && (l = await e.analyze(this._idField, t.copy(), s, r, a));
          let h = 0;
          for (; t.next(); ) {
            let a;
            if (
              ((a = l
                ? l[h++]
                : (0, n.i)(i) &&
                  (0, I.i)(t.getDisplayId()) &&
                  1 !== t.readAttribute('cluster_count')
                ? i.match(this._idField, t, this._geometryType, s, r)
                : e.match(this._idField, t, this._geometryType, s, r)),
              t.setGroupId(a),
              kr(a))
            ) {
              const e = this._templateStore.getDynamicTemplateGroup(a);
              for (const i of e) i && i.analyze && i.analyze(this._templateStore, t, s, r);
            }
          }
          return this._templateStore.finalize(a);
        }
        async analyzeGraphics(t, e, i, s, r) {
          if ((0, o.Hc)(r)) return;
          const n = t.getCursor();
          for (e && (await e.analyze(this._idField, n.copy(), i, s, r)); n.next(); ) {
            let t = n.getGroupId();
            if (
              ((null != t && -1 !== t) ||
                ((t = e.match(this._idField, n, n.geometryType, i, s)), n.setGroupId(t)),
              kr(t))
            ) {
              const e = this._templateStore.getDynamicTemplateGroup(t);
              for (const t of e) t && t.analyze && t.analyze(this._templateStore, n, i, s);
            }
            n.setGroupId(t);
          }
          return this._templateStore.finalize(r);
        }
        writeGraphic(t, e, i) {
          const s = e.getGroupId(),
            r = e.getDisplayId(),
            n = this._templateStore.getTemplateGroup(s);
          if ((t.featureStart(e.insertAfter), null != r)) {
            if (kr(s)) for (const t of n) t.bindFeature(e, null, null);
            if (n) {
              for (const s of n) s && s.write(t, e, i);
              t.featureEnd();
            }
          }
        }
        writeCursor(t, e, i, s, r, a) {
          const o = e.getGroupId(),
            l = e.getDisplayId(),
            h = this._templateStore.getTemplateGroup(o);
          if ((e.getObjectId(), null != l && h)) {
            if (kr(o)) for (const t of h) t.bindFeature(e, i, s);
            for (const i of h) i.write(t, e, r);
            if ((0, n.i)(a) && t.hasRecords) {
              const i = a && this._findLabelRef(h);
              this._writeLabels(t, e, a, i, r);
            }
          }
        }
        _findLabelRef(t) {
          for (const e of t) if (e instanceof Ts) return e;
          return null;
        }
        _writeLabels(t, e, i, s, r) {
          for (const a of i)
            if ((0, n.i)(a) && a) {
              const { glyphs: i, rtl: n, index: o } = a,
                l = this._labelTemplates.get(o);
              l.setZoomLevel(r),
                l.bindReferenceTemplate(s),
                l.bindTextInfo(i, n),
                l.write(t, e, null);
            }
        }
      }
      const Er = a.L.getLogger('esri/views/2d/engine/webgl/util/Matcher');
      async function zr(t, e, i) {
        switch (t.type) {
          case 'simple':
            return Rr.fromBasicRenderer(t, e, i);
          case 'map':
            return Or.fromUVRenderer(t, e, i);
          case 'interval':
            return Ar.fromCBRenderer(t, e, i);
          case 'dictionary':
            return Fr.fromDictionaryRenderer(t, e, i);
          case 'subtype':
            return Vr.fromSubtypes(t, e, i);
        }
      }
      class Rr {
        constructor() {
          (this.type = 'feature'), (this._defaultResult = null);
        }
        static async fromBasicRenderer(t, e, i) {
          const s = new Rr();
          if (t.symbol) {
            const r = await es(t.symbol, i),
              n = e.createTemplateGroup(r, null);
            s.setDefault(n);
          }
          return s;
        }
        size() {
          return 1;
        }
        getDefault() {
          return this._defaultResult;
        }
        setDefault(t) {
          this._defaultResult = t;
        }
        match(t, e, i, s, r) {
          return this.getDefault();
        }
        async analyze(t, e, i, s, r) {
          return null;
        }
      }
      class Vr extends Rr {
        constructor(t, e) {
          super(), (this._subMatchers = t), (this._subtypeField = e);
        }
        static async fromSubtypes(t, e, i) {
          const s = new Map(),
            r = [];
          for (const n in t.renderers) {
            const a = parseInt(n, 10),
              o = zr(t.renderers[n], e, i).then((t) => s.set(a, t));
            r.push(o);
          }
          return await Promise.all(r), new Vr(s, t.subtypeField);
        }
        match(t, e, i, s, r) {
          const n = e.readAttribute(this._subtypeField),
            a = this._subMatchers.get(n);
          return a ? a.match(t, e, i, s, r) : null;
        }
      }
      class Ar extends Rr {
        constructor(t, e, i, s) {
          super(),
            (this.type = 'interval'),
            (this._intervals = []),
            (this._isMaxInclusive = e),
            (this._fieldIndex = s),
            (this._field = t),
            (this._normalizationInfo = i);
        }
        static async fromCBRenderer(t, e, i) {
          const {
              isMaxInclusive: s,
              normalizationField: r,
              normalizationTotal: n,
              normalizationType: a,
            } = t,
            o = t.field,
            l = new Ar(
              o,
              s,
              { normalizationField: r, normalizationTotal: n, normalizationType: a },
              t.fieldIndex,
            ),
            h = await es(t.backgroundFillSymbol, i);
          await Promise.all(
            t.intervals.map(async (t) => {
              const s = await es(t.symbol, i),
                r = await e.createTemplateGroup(s, h),
                n = { min: t.min, max: t.max };
              l.add(n, r);
            }),
          );
          const c = await es(t.defaultSymbol, i);
          if (c) {
            const t = await e.createTemplateGroup(c, h);
            l.setDefault(t);
          }
          return l;
        }
        add(t, e) {
          this._intervals.push({ interval: t, result: e }),
            this._intervals.sort((t, e) => t.interval.min - e.interval.min);
        }
        size() {
          return super.size() + this._intervals.length;
        }
        match(t, e, i, s, r) {
          if (null == this._fieldIndex && !this._field) return this.getDefault();
          const n =
            null != this._fieldIndex
              ? e.getComputedNumericAtIndex(this._fieldIndex)
              : this._getValueFromField(e);
          if (!n && (null == n || isNaN(n))) return this.getDefault();
          for (let t = 0; t < this._intervals.length; t++) {
            const { interval: e, result: i } = this._intervals[t],
              s = n >= e.min,
              r = this._isMaxInclusive ? n <= e.max : n < e.max;
            if (s && r) return i;
          }
          return this.getDefault();
        }
        _needsNormalization() {
          const t = this._normalizationInfo;
          return t && (t.normalizationField || t.normalizationTotal || t.normalizationType);
        }
        _getValueFromField(t) {
          const e = t.readAttribute(this._field);
          if (!this._needsNormalization() || null == e) return e;
          const {
              normalizationField: i,
              normalizationTotal: s,
              normalizationType: r,
            } = this._normalizationInfo,
            n = !!i && t.readAttribute(i);
          if (r)
            switch (r) {
              case 'esriNormalizeByField':
                return n ? e / n : void 0;
              case 'esriNormalizeByLog':
                return Math.log(e) * Math.LOG10E;
              case 'esriNormalizeByPercentOfTotal':
                return (e / s) * 100;
              default:
                return void Er.error(`Found unknown normalization type: ${r}`);
            }
          else Er.error('Normalization is required, but no type was set!');
        }
      }
      class Or extends Rr {
        constructor(t, e, i) {
          super(),
            (this.type = 'map'),
            (this._nullResult = null),
            (this._resultsMap = new Map()),
            (this._fieldsIndex = i),
            (this._fields = t),
            (this._seperator = e || '');
        }
        static async fromUVRenderer(t, e, i) {
          const s = t.fieldDelimiter,
            r = [t.field];
          t.field2 && r.push(t.field2), t.field3 && r.push(t.field3);
          const n = await es(t.backgroundFillSymbol, i),
            a = new Or(r, s, t.fieldIndex);
          await Promise.all(
            t.map.map(async (t) => {
              const s = await es(t.symbol, i),
                r = await e.createTemplateGroup(s, n);
              '<Null>' === t.value ? a.setNullResult(r) : a.add(t.value, r);
            }),
          );
          const o = await es(t.defaultSymbol, i);
          if (o) {
            const t = await e.createTemplateGroup(o, n);
            a.setDefault(t);
          }
          return a;
        }
        setNullResult(t) {
          this._nullResult = t;
        }
        add(t, e) {
          this._resultsMap.set(t.toString(), e);
        }
        size() {
          return super.size() + this._resultsMap.size;
        }
        match(t, e, i, s, r) {
          if (null == this._fieldsIndex && !this._fields) return this.getDefault();
          const n =
            null != this._fieldsIndex
              ? e.getComputedStringAtIndex(this._fieldsIndex)
              : this._getValueFromFields(e);
          if (null !== this._nullResult && (null == n || '' === n || '<Null>' === n))
            return this._nullResult;
          if (!n && null == n) return this.getDefault();
          const a = n.toString();
          return this._resultsMap.has(a) ? this._resultsMap.get(a) : this.getDefault();
        }
        _getValueFromFields(t) {
          const e = [];
          for (const i of this._fields) {
            const s = t.readAttribute(i);
            null == s || '' === s ? e.push('<Null>') : e.push(s);
          }
          return e.join(this._seperator);
        }
      }
      class Fr extends Rr {
        constructor(t, e, i, s) {
          super(),
            (this.type = 'dictionary'),
            (this._groupIdCache = new Ui.L(100)),
            (this._renderer = t),
            (this._fieldMap = t.fieldMap),
            (this._symbolFields = t.getSymbolFields()),
            (this._templates = e),
            (this._info = i),
            (this._scaleFn = s);
        }
        static async fromDictionaryRenderer(t, e, s) {
          const r = (await Promise.resolve().then(i.bind(i, 71206))).default.fromJSON(t.renderer);
          await r.fetchResources({ spatialReference: s.spatialReference, fields: s.fields });
          const n = await (async function (t, e) {
            const i = t || 1;
            if ('number' == typeof i) return (t, e, s) => i;
            const s = await (0, ti.a)(i, e.spatialReference, e.fields);
            return (t, i, r) => ni(s, t, { $view: r }, e.geometryType, i) || 1;
          })(r.scaleExpression, s);
          return new Fr(r, e, s, n);
        }
        async _analyzeFeature(t, e, i, s) {
          const n = t.readLegacyFeature(),
            a = this._scaleFn(n, e, i),
            o = this._attributeHash(n) + '-' + a,
            l = this._groupIdCache.get(o);
          if (l) return l;
          const h = {
              ...i,
              spatialReference: this._info.spatialReference,
              abortOptions: s,
              fields: this._info.fields,
            },
            c = Hi(await this._renderer.getSymbolAsync(n, h), this._renderer),
            u = es(c, this._info, s).then((t) => {
              if ('expanded-cim' !== t.type)
                return (
                  Er.error(
                    new r.Z(
                      'mapview-bad-type',
                      `Found unexpected type ${t.type} in dictionary response`,
                    ),
                  ),
                  null
                );
              t.hash += '-' + a;
              for (const e of t.layers)
                (e.scaleFactor = a),
                  (e.templateHash += '-' + a),
                  'text' === e.type &&
                    'string' == typeof e.text &&
                    e.text.indexOf('[') > -1 &&
                    (e.text = ei(this._fieldMap, e.text, e.cim.textCase));
              return this._templates.createTemplateGroup(t, null);
            });
          return this._groupIdCache.put(o, u, 1), u;
        }
        async analyze(t, e, i, s, r) {
          const n = e.getCursor(),
            a = [];
          for (; n.next(); ) a.push(this._analyzeFeature(n, i, s, r));
          return Promise.all(a);
        }
        match(t, e, i, s, r) {
          return null;
        }
        _attributeHash(t) {
          let e = '';
          for (const i of this._symbolFields) {
            const s = this._fieldMap[i];
            s && (e += t.attributes[s] + '-');
          }
          return e;
        }
      }
      var Nr = i(97853);
      function Gr(t, e) {
        return (!t.minScale || t.minScale >= e) && (!t.maxScale || t.maxScale <= e);
      }
      function Wr(t) {
        const e = t.message,
          i = { message: { data: {}, tileKey: e.tileKey }, transferList: new Array() };
        for (const t in e.data) {
          const s = e.data[t];
          if (((i.message.data[t] = null), (0, n.i)(s))) {
            const e = s.stride,
              r = s.indices.slice(0),
              a = s.vertices.slice(0),
              o = s.records.slice(0),
              l = {
                stride: e,
                indices: r,
                vertices: a,
                records: o,
                metrics: (0, n.e)(s.metrics, (t) => t.slice(0)),
              };
            i.transferList.push(r, a, o), (i.message.data[t] = l);
          }
        }
        return i;
      }
      i(81172),
        i(71552),
        i(31450),
        i(86656),
        i(22723),
        i(23639),
        i(91055),
        i(27794),
        i(6906),
        i(15324),
        i(76996),
        i(74673),
        i(26341),
        i(10638),
        i(15173),
        i(21801),
        i(73796),
        i(97714),
        i(91597),
        i(86787),
        i(35132),
        i(89623),
        i(31292),
        i(74569),
        i(84069),
        i(44567),
        i(92896),
        i(22781),
        i(93314),
        i(35197),
        i(59465),
        i(69218),
        i(97546),
        i(9801),
        i(53523),
        i(42911),
        i(46826),
        i(45433),
        i(54732),
        i(27207),
        i(54174),
        i(5909),
        i(76393),
        i(78548),
        i(2497),
        i(30776),
        i(49906),
        i(60669),
        i(55187),
        i(48208),
        i(5853),
        i(6941),
        i(63571),
        i(14249),
        i(63130),
        i(25696),
        i(66396),
        i(42775),
        i(95834),
        i(34394),
        i(57150),
        i(76726),
        i(20444),
        i(46527),
        i(48649),
        i(9960),
        i(3101),
        i(39141),
        i(32101),
        i(38742),
        i(48243),
        i(34635),
        i(10401),
        i(49900),
        i(66284),
        i(33921),
        i(3482),
        i(82058),
        i(88762),
        i(73173),
        i(22739),
        i(20543),
        i(67477),
        i(78533),
        i(74653),
        i(91091),
        i(58943),
        i(70737),
        i(8487),
        i(17817),
        i(90814),
        i(15459),
        i(61847),
        i(16796),
        i(16955),
        i(22401),
        i(77894),
        i(8586),
        i(44509),
        i(69814),
        i(11305),
        i(62259),
        i(44790),
        i(12158),
        i(74864),
        i(63683),
        i(94479),
        i(45702),
        i(51127),
        i(74071),
        i(51723),
        i(23243),
        i(51669),
        i(6090),
        i(3977),
        i(36741),
        i(11253),
        i(74057),
        i(23761),
        i(86748),
        i(29107),
        i(30574),
        i(2157),
        i(25977),
        i(7471),
        i(54414),
        i(1648),
        i(8925),
        i(45154),
        i(16769),
        i(55531),
        i(30582),
        i(593),
        i(85699),
        i(63136),
        i(96055),
        i(47776),
        i(18033),
        i(6331),
        i(62048),
        i(4292),
        i(75626),
        i(72652),
        i(29641),
        i(30493),
        i(70821),
        i(82673),
        i(34229),
        i(37029),
        i(48190),
        i(85557),
        i(53785),
        i(95587),
        i(94070),
        i(9075),
        i(67541),
        i(91700),
        i(32037),
        i(90811),
        i(238),
        i(71831),
        i(49500),
        i(95873),
        i(82933),
        i(617),
        i(21929),
        i(98576),
        a.L.getLogger('esri.views.2d.layers.features.processors.SymbolProcessor');
      let Br = class extends Nr.B {
        constructor() {
          super(...arguments),
            (this.type = 'symbol'),
            (this._matchers = { feature: null, aggregate: null }),
            (this._bufferData = new Map());
        }
        initialize() {
          this.handles.add([this.tileStore.on('update', this.onTileUpdate.bind(this))]);
        }
        destroy() {}
        get supportsTileUpdates() {
          return !0;
        }
        async update(t, e) {
          const i = e.schema.processors[0];
          if ('symbol' !== i.type) return;
          const s = (0, c.d)(this._schema, i);
          (0, c.h)(s, 'mesh') &&
            ((0, n.h)('esri-2d-update-debug') && console.debug('Applying Update - Processor:', s),
            (t.mesh = !0),
            t.why.mesh.push('Symbology changed'),
            (this._schema = i),
            (this._factory = this._createFactory(i)),
            this._factory.update(i, this.tileStore.tileScheme.tileInfo));
        }
        onTileMessage(t, e, i, s) {
          return (0, o.k_)(s), this._onTileData(t, e, i, s);
        }
        onTileClear(t) {
          return (
            this._bufferData.delete(t.key.id),
            this.remoteClient.invoke('tileRenderer.onTileData', {
              tileKey: t.id,
              data: { clear: !0 },
            })
          );
        }
        onTileError(t, e, i) {
          const s = i.signal,
            r = { tileKey: t.id, error: e };
          return this.remoteClient.invoke('tileRenderer.onTileError', r, { signal: s });
        }
        onTileUpdate(t) {
          for (const e of t.removed)
            this._bufferData.has(e.key.id) &&
              (this._bufferData.get(e.key.id).forEach((t) => {
                const e = new Set();
                (0, f.h)((i) => {
                  const s = t.message.data[i];
                  if ((0, n.i)(s)) {
                    const t = qi.from(s.records).getCursor();
                    for (; t.next(); ) e.add(t.id);
                  }
                });
                const i = t.message.tileKey;
                return this.remoteClient.invoke('tileRenderer.onTileData', {
                  tileKey: i,
                  data: { type: 'update', addOrUpdate: null },
                });
              }),
              this._bufferData.delete(e.key.id));
          for (const e of t.added)
            this._bufferData.forEach((t) => {
              for (const i of t)
                i.message.tileKey === e.id &&
                  this._updateTileMesh('append', e, Wr(i), [], !1, !1, null);
            });
        }
        _addBufferData(t, e) {
          this._bufferData.has(t) || this._bufferData.set(t, []),
            this._bufferData.get(t).push(Wr(e));
        }
        _createFactory(t) {
          const { geometryType: e, objectIdField: i, fields: s } = this.service,
            r = {
              geometryType: e,
              fields: s,
              spatialReference: u.Z.fromJSON(this.spatialReference),
            },
            a = new Ir(
              (t, e) => this.remoteClient.invoke('tileRenderer.getMaterialItems', t, e),
              this.tileStore.tileScheme.tileInfo,
            ),
            { matcher: o, aggregateMatcher: l } = t.mesh;
          return (
            (this._store = a),
            (this._matchers.feature = zr(o, a, r)),
            (this._matchers.aggregate = (0, n.e)(l, (t) => zr(t, a, r))),
            new Tr(e, i, a)
          );
        }
        async _onTileData(t, e, i, s) {
          const { type: r, addOrUpdate: a, remove: l } = e,
            h = e.end;
          if (!a) {
            const e = { type: r, addOrUpdate: null, remove: l, clear: !1, end: h };
            return this.remoteClient.invoke(
              'tileRenderer.onTileData',
              { tileKey: t.id, data: e },
              s,
            );
          }
          const c = this._processFeatures(t, a, i, s);
          try {
            const i = await c;
            if ((0, n.b)(i)) {
              const e = { type: r, addOrUpdate: null, remove: l, clear: !1, end: h };
              return this.remoteClient.invoke(
                'tileRenderer.onTileData',
                { tileKey: t.id, data: e },
                s,
              );
            }
            for (const e of i) t.key.id !== e.message.tileKey && this._addBufferData(t.key.id, e);
            await (0, o.$6)(
              i.map((i) => {
                const n = t.key.id === i.message.tileKey,
                  a = n ? e.remove : [],
                  o = n && e.end;
                return this._updateTileMesh(r, t, i, a, o, e.clear, s.signal);
              }),
            );
          } catch (e) {
            this._handleError(t, e, s);
          }
        }
        async _updateTileMesh(t, e, i, s, r, a, l) {
          const h = t,
            c = i.message.tileKey;
          c !== e.key.id && (r = !1);
          const u = (0, n.e)(i, (t) => t.message),
            f = (0, n.e)(i, (t) => t.transferList) || [],
            d = { type: h, addOrUpdate: u, remove: s, clear: !1, end: r },
            _ = { transferList: (0, n.u)(f) || [], signal: l };
          return (
            (0, o.k_)(_),
            this.remoteClient.invoke('tileRenderer.onTileData', { tileKey: c, data: d }, _)
          );
        }
        async _processFeatures(t, e, i, s) {
          if ((0, n.b)(e) || !e.hasFeatures) return null;
          const r = { transform: t.transform, hasZ: !1, hasM: !1 },
            a = this._factory,
            l = { viewingMode: '', scale: t.scale },
            h = await this._matchers.feature,
            c = await this._matchers.aggregate;
          (0, o.k_)(s);
          const u = this._getLabelInfos(t, e);
          return (
            await a.analyze(e.getCursor(), h, c, r, l),
            (0, o.k_)(s),
            this._writeFeatureSet(t, e, r, u, a, i)
          );
        }
        _writeFeatureSet(t, e, i, s, r, a) {
          const o = e.getSize(),
            l =
              'simple' === this._schema.mesh.matcher.type && this._schema.mesh.matcher.isDotDensity,
            h = new as(t.key.id, { features: o, records: o, metrics: 0 }, l, a, !0),
            c = { viewingMode: '', scale: t.scale },
            u = e.getCursor();
          for (; u.next(); )
            try {
              const e = u.getDisplayId(),
                a = (0, n.i)(s) ? s.get(e) : null;
              r.writeCursor(h, u, i, c, t.level, a);
            } catch (t) {}
          const f = t.tileInfoView.tileInfo.isWrappable;
          return h.serialize(f);
        }
        _handleError(t, e, i) {
          if (!(0, o.D_)(e)) {
            const s = { tileKey: t.id, error: e.message };
            return this.remoteClient.invoke('tileRenderer.onTileError', s, { signal: i.signal });
          }
        }
        _getLabelingSchemaForScale(t) {
          const e = this._schema.mesh.labels;
          if ((0, n.b)(e)) return null;
          if ('subtype' === e.type) {
            const i = { type: 'subtype', classes: {} };
            let s = !1;
            for (const r in e.classes) {
              const n = e.classes[r].filter((e) => Gr(e, t.scale));
              (s = s || !!n.length), (i.classes[r] = n);
            }
            return s ? i : null;
          }
          const i = e.classes.filter((e) => Gr(e, t.scale));
          return i.length ? { type: 'simple', classes: i } : null;
        }
        _getLabels(t, e) {
          if ('subtype' === e.type) {
            var i;
            const s = this.service.subtypeField,
              r = (0, n.G)(s, 'Expected to find subtype Field'),
              a = t.readAttribute(r);
            return null == a ? [] : null != (i = e.classes[a]) ? i : [];
          }
          return e.classes;
        }
        _getLabelInfos(t, e) {
          const i = this._getLabelingSchemaForScale(t);
          if ((0, n.b)(i)) return null;
          const s = new Map(),
            r = e.getCursor();
          for (; r.next(); ) {
            const t = r.getDisplayId(),
              e = [],
              n = (0, I.i)(t),
              a = n && 1 !== r.readAttribute('cluster_count') ? 'aggregate' : 'feature',
              o = this._getLabels(r, i);
            for (const i of o) {
              if (i.target !== a) continue;
              const s = r.getStorage(),
                o =
                  n && 'feature' === a
                    ? s.getComputedStringAtIndex(r.readAttribute('referenceId'), i.fieldIndex)
                    : s.getComputedStringAtIndex(t, i.fieldIndex);
              if (!o) continue;
              const l = nt(o.toString()),
                h = l[0],
                c = l[1];
              this._store.getMosaicItem(i.symbol, xr(h)).then((t) => {
                e[i.index] = { glyphs: t.glyphMosaicItems, rtl: c, index: i.index };
              });
            }
            s.set(t, e);
          }
          return s;
        }
      };
      Br = (0, s._)([(0, h.j)('esri.views.2d.layers.features.processors.SymbolProcessor')], Br);
      const Dr = Br;
    },
    48190: (t, e, i) => {
      'use strict';
      function s(t) {}
      i.d(e, { n: () => s }), i(76506);
    },
    30439: (t, e, i) => {
      'use strict';
      i.d(e, { a: () => u, b: () => h, d: () => l, e: () => c }), i(76506);
      var s = i(5909),
        r = i(78548),
        n = i(60669),
        a = i(48208),
        o = i(6941);
      n.Z.fromJSON(o.d), r.Z.fromJSON(o.a), s.Z.fromJSON(o.b);
      const l = a.Z.fromJSON(o.c),
        h = n.Z.fromJSON(o.e),
        c = r.Z.fromJSON(o.f),
        u = s.Z.fromJSON(o.g);
    },
    85557: (t, e, i) => {
      'use strict';
      i.d(e, { m: () => n });
      var s = i(53785),
        r = i(89623);
      const n = {
        inches: (0, s.c)(1, 'meters', 'inches'),
        feet: (0, s.c)(1, 'meters', 'feet'),
        'us-feet': (0, s.c)(1, 'meters', 'us-feet'),
        yards: (0, s.c)(1, 'meters', 'yards'),
        miles: (0, s.c)(1, 'meters', 'miles'),
        'nautical-miles': (0, s.c)(1, 'meters', 'nautical-miles'),
        millimeters: (0, s.c)(1, 'meters', 'millimeters'),
        centimeters: (0, s.c)(1, 'meters', 'centimeters'),
        decimeters: (0, s.c)(1, 'meters', 'decimeters'),
        meters: (0, s.c)(1, 'meters', 'meters'),
        kilometers: (0, s.c)(1, 'meters', 'kilometers'),
        'decimal-degrees': 1 / (0, s.l)(1, 'meters', r.e.radius),
      };
    },
    52228: (t, e, i) => {
      'use strict';
      function s(t) {
        return t && 'esri.renderers.visualVariables.SizeVariable' === t.declaredClass;
      }
      function r(t) {
        return null != t && !isNaN(t) && isFinite(t);
      }
      function n(t) {
        return t.valueExpression
          ? 'expression'
          : t.field && 'string' == typeof t.field
          ? 'field'
          : 'unknown';
      }
      function a(t, e) {
        const i = e || n(t),
          s = t.valueUnit || 'unknown';
        return 'unknown' === i
          ? 'constant'
          : t.stops
          ? 'stops'
          : null != t.minSize &&
            null != t.maxSize &&
            null != t.minDataValue &&
            null != t.maxDataValue
          ? 'clamped-linear'
          : 'unknown' === s
          ? null != t.minSize && null != t.minDataValue
            ? t.minSize && t.minDataValue
              ? 'proportional'
              : 'additive'
            : 'identity'
          : 'real-world-size';
      }
      i.d(e, { a: () => a, b: () => r, g: () => n, i: () => s });
    },
    53257: (t, e, i) => {
      'use strict';
      function s(t, e, i, s) {
        const r = t.clone(),
          n = 1 << r.level,
          a = r.col + e,
          o = r.row + i;
        return (
          s && a < 0
            ? ((r.col = a + n), (r.world -= 1))
            : a >= n
            ? ((r.col = a - n), (r.world += 1))
            : (r.col = a),
          (r.row = o),
          r
        );
      }
      i.d(e, { g: () => s }), i(91055), i(21801), i(76506), i(31292), i(6687);
    },
    47880: (t, e, i) => {
      'use strict';
      function s(t, e, i) {
        return (t[0] = e), (t[1] = i), t;
      }
      function r(t, e) {
        const i = e[0] - t[0],
          s = e[1] - t[1];
        return Math.sqrt(i * i + s * s);
      }
      function n(t, e, i) {
        const s = e[0],
          r = e[1];
        return (t[0] = i[0] * s + i[2] * r + i[4]), (t[1] = i[1] * s + i[3] * r + i[5]), t;
      }
      i.d(e, { d: () => r, s: () => s, t: () => n });
    },
    74057: (t, e, i) => {
      'use strict';
      i.d(e, {
        PR: () => S,
        Lq: () => _,
        Km: () => m,
        cM: () => p,
        ap: () => g,
        V3: () => v,
        B3: () => d,
      });
      var s = i(48027),
        r = i(23761),
        n = i(48190),
        a = i(92143),
        o = i(76506),
        l = i(85557),
        h = i(52228);
      i(54174),
        i(82426),
        i(91306),
        i(31450),
        i(71552),
        i(40642),
        i(74569),
        i(21801),
        i(34250),
        i(86656),
        i(22723),
        i(17533),
        i(81172),
        i(73796),
        i(74673),
        i(21972),
        i(23639),
        i(91055),
        i(27794),
        i(6906),
        i(50406),
        i(60991),
        i(26341),
        i(97714),
        i(60947),
        i(2906),
        i(91597),
        i(86787),
        i(35132),
        i(89623),
        i(84069),
        i(44567),
        i(98380),
        i(92896),
        i(22781),
        i(57251),
        i(32422),
        i(86748),
        i(15324),
        i(76996),
        i(14249),
        i(9801),
        i(53523),
        i(59465),
        i(42911),
        i(46826),
        i(45433),
        i(60217),
        i(29107),
        i(30574),
        i(2157),
        i(25977),
        i(7471),
        i(54414),
        i(1648),
        i(8925),
        i(33921),
        i(3482),
        i(45154),
        i(16769),
        i(55531),
        i(30582),
        i(593),
        i(85699),
        i(63136),
        i(96055),
        i(47776),
        i(18033),
        i(6331),
        i(62048),
        i(4292),
        i(75626),
        i(72652),
        i(29641),
        i(30493),
        i(70821),
        i(82673),
        i(34229),
        i(37029),
        i(96467),
        i(63571),
        i(30776),
        i(63130),
        i(25696),
        i(66396),
        i(42775),
        i(95834),
        i(34394),
        i(57150),
        i(76726),
        i(20444),
        i(76393),
        i(78548),
        i(2497),
        i(49906),
        i(46527),
        i(48649),
        i(9960),
        i(3101),
        i(5853),
        i(39141),
        i(32101),
        i(38742),
        i(48243),
        i(34635),
        i(10401),
        i(49900),
        i(66284),
        i(82058),
        i(88762),
        i(73173),
        i(22739),
        i(20543),
        i(67477),
        i(78533),
        i(74653),
        i(91091),
        i(58943),
        i(70737),
        i(8487),
        i(17817),
        i(90814),
        i(15459),
        i(61847),
        i(16796),
        i(16955),
        i(22401),
        i(77894),
        i(55187),
        i(8586),
        i(44509),
        i(69814),
        i(11305),
        i(62259),
        i(44790),
        i(5909),
        i(60669),
        i(48208),
        i(51589),
        i(53785),
        i(95587);
      const c = a.L.getLogger('esri.renderers.visualVariables.support.visualVariableUtils'),
        u = new r.Z(),
        f = Math.PI,
        d = /^\s*(return\s+)?\$view\.scale\s*(;)?\s*$/i;
      function _(t, e, i) {
        const r =
          'visualVariables' in t && t.visualVariables
            ? t.visualVariables.filter((t) => 'color' === t.type)[0]
            : t;
        if (!r) return;
        if ('esri.renderers.visualVariables.ColorVariable' !== r.declaredClass)
          return void c.warn(
            'The visualVariable should be an instance of esri.renderers.visualVariables.ColorVariable',
          );
        const n = 'number' == typeof e,
          a = n ? null : e,
          l = a && a.attributes;
        let h = n ? e : null;
        const u = r.field,
          { ipData: f, hasExpression: d } = r.cache;
        let _ = r.cache.compiledFunc;
        if (!u && !d) {
          const t = r.stops;
          return t && t[0] && t[0].color;
        }
        if ('number' != typeof h)
          if (d) {
            if (!(0, o.i)(i) || !(0, o.i)(i.arcade))
              return void c.error('Use of arcade expressions requires an arcade context');
            const t = {
                viewingMode: i.viewingMode,
                scale: i.scale,
                spatialReference: i.spatialReference,
              },
              e = i.arcade.arcadeUtils,
              s = e.getViewInfo(t),
              n = e.createExecContext(a, s);
            if (!_) {
              const t = e.createSyntaxTree(r.valueExpression);
              (_ = e.createFunction(t)), (r.cache.compiledFunc = _);
            }
            h = e.executeFunction(_, n);
          } else l && (h = l[u]);
        const m = r.normalizationField,
          p = l ? parseFloat(l[m]) : void 0;
        if (null != h && (!m || n || (!isNaN(p) && 0 !== p))) {
          isNaN(p) || n || (h /= p);
          const t = M(h, f);
          if (t) {
            const e = t[0],
              n = t[1],
              a =
                e === n
                  ? r.stops[e].color
                  : s.Z.blendColors(
                      r.stops[e].color,
                      r.stops[n].color,
                      t[2],
                      (0, o.i)(i) ? i.color : void 0,
                    );
            return new s.Z(a);
          }
        }
      }
      function m(t, e, i) {
        const s =
          'visualVariables' in t && t.visualVariables
            ? t.visualVariables.filter((t) => 'opacity' === t.type)[0]
            : t;
        if (!s) return;
        if ('esri.renderers.visualVariables.OpacityVariable' !== s.declaredClass)
          return void c.warn(
            'The visualVariable should be an instance of esri.renderers.visualVariables.OpacityVariable',
          );
        const r = 'number' == typeof e,
          n = r ? null : e,
          a = n && n.attributes;
        let l = r ? e : null;
        const h = s.field,
          { ipData: u, hasExpression: f } = s.cache;
        let d = s.cache.compiledFunc;
        if (!h && !f) {
          const t = s.stops;
          return t && t[0] && t[0].opacity;
        }
        if ('number' != typeof l)
          if (f) {
            if ((0, o.b)(i) || (0, o.b)(i.arcade))
              return void c.error('Use of arcade expressions requires an arcade context');
            const t = {
                viewingMode: i.viewingMode,
                scale: i.scale,
                spatialReference: i.spatialReference,
              },
              e = i.arcade.arcadeUtils,
              r = e.getViewInfo(t),
              a = e.createExecContext(n, r);
            if (!d) {
              const t = e.createSyntaxTree(s.valueExpression);
              (d = e.createFunction(t)), (s.cache.compiledFunc = d);
            }
            l = e.executeFunction(d, a);
          } else a && (l = a[h]);
        const _ = s.normalizationField,
          m = a ? parseFloat(a[_]) : void 0;
        if (null != l && (!_ || r || (!isNaN(m) && 0 !== m))) {
          isNaN(m) || r || (l /= m);
          const t = M(l, u);
          if (t) {
            const e = t[0],
              i = t[1];
            if (e === i) return s.stops[e].opacity;
            {
              const r = s.stops[e].opacity;
              return r + (s.stops[i].opacity - r) * t[2];
            }
          }
        }
      }
      function p(t, e, i) {
        const s =
          'visualVariables' in t && t.visualVariables
            ? t.visualVariables.filter((t) => 'rotation' === t.type)[0]
            : t;
        if (!s) return;
        if ('esri.renderers.visualVariables.RotationVariable' !== s.declaredClass)
          return void c.warn(
            'The visualVariable should be an instance of esri.renderers.visualVariables.RotationVariable',
          );
        const r = s.axis || 'heading',
          n = 'heading' === r && 'arithmetic' === s.rotationType ? 90 : 0,
          a = 'heading' === r && 'arithmetic' === s.rotationType ? -1 : 1,
          l = 'number' == typeof e ? null : e,
          h = l && l.attributes,
          u = s.field,
          { hasExpression: f } = s.cache;
        let d = s.cache.compiledFunc,
          _ = 0;
        if (!u && !f) return _;
        if (f) {
          if ((0, o.b)(i) || (0, o.b)(i.arcade))
            return void c.error('Use of arcade expressions requires an arcade context');
          const t = {
              viewingMode: i.viewingMode,
              scale: i.scale,
              spatialReference: i.spatialReference,
            },
            e = i.arcade.arcadeUtils,
            r = e.getViewInfo(t),
            n = e.createExecContext(l, r);
          if (!d) {
            const t = e.createSyntaxTree(s.valueExpression);
            (d = e.createFunction(t)), (s.cache.compiledFunc = d);
          }
          _ = e.executeFunction(d, n);
        } else h && (_ = h[u] || 0);
        return (_ = 'number' != typeof _ || isNaN(_) ? null : n + a * _), _;
      }
      function g(t, e, i) {
        const s =
          'visualVariables' in t && t.visualVariables
            ? t.visualVariables.filter((t) => 'size' === t.type)[0]
            : t;
        if (!s) return;
        if ('esri.renderers.visualVariables.SizeVariable' !== s.declaredClass)
          return void c.warn(
            'The visualVariable should be an instance of esri.renderers.visualVariables.SizeVariable',
          );
        const r = (function (t, e, i, s, r) {
          switch (e.transformationType) {
            case 'additive':
              return (function (t, e, i, s) {
                return t + (y(e.minSize, i, s) || e.minDataValue);
              })(t, e, i, s);
            case 'constant':
              return (function (t, e, i) {
                const s = t.stops;
                let r = s && s.length && s[0].size;
                return null == r && (r = t.minSize), y(r, e, i);
              })(e, i, s);
            case 'clamped-linear':
              return (function (t, e, i, s) {
                const r = (t - e.minDataValue) / (e.maxDataValue - e.minDataValue),
                  n = y(e.minSize, i, s),
                  a = y(e.maxSize, i, s),
                  l = (0, o.i)(s) ? s.shape : void 0;
                if (t <= e.minDataValue) return n;
                if (t >= e.maxDataValue) return a;
                if ('area' === e.scaleBy && l) {
                  const t = 'circle' === l,
                    e = t ? f * (n / 2) ** 2 : n * n,
                    i = e + r * ((t ? f * (a / 2) ** 2 : a * a) - e);
                  return t ? 2 * Math.sqrt(i / f) : Math.sqrt(i);
                }
                return n + r * (a - n);
              })(t, e, i, s);
            case 'proportional':
              return (function (t, e, i, s) {
                const r = (0, o.i)(s) ? s.shape : void 0,
                  n = t / e.minDataValue,
                  a = y(e.minSize, i, s),
                  l = y(e.maxSize, i, s);
                let h = null;
                return (
                  (h =
                    'circle' === r
                      ? 2 * Math.sqrt(n * (a / 2) ** 2)
                      : 'square' === r || 'diamond' === r || 'image' === r
                      ? Math.sqrt(n * a ** 2)
                      : n * a),
                  x(h, a, l)
                );
              })(t, e, i, s);
            case 'stops':
              return (function (t, e, i, s, r) {
                const [n, a, o] = M(t, r);
                if (n === a) return y(e.stops[n].size, i, s);
                {
                  const t = y(e.stops[n].size, i, s);
                  return t + (y(e.stops[a].size, i, s) - t) * o;
                }
              })(t, e, i, s, r);
            case 'real-world-size':
              return (function (t, e, i, s) {
                const r = ((0, o.i)(s) && s.resolution ? s.resolution : 1) * l.m[e.valueUnit],
                  n = y(e.minSize, i, s),
                  a = y(e.maxSize, i, s),
                  { valueRepresentation: h } = e;
                let c = null;
                return (
                  (c =
                    'area' === h
                      ? (2 * Math.sqrt(t / f)) / r
                      : 'radius' === h || 'distance' === h
                      ? (2 * t) / r
                      : t / r),
                  x(c, n, a)
                );
              })(t, e, i, s);
            case 'identity':
              return t;
            case 'unknown':
              return null;
          }
        })(
          (function (t, e, i) {
            const s = 'number' == typeof e,
              r = s ? null : e,
              n = r && r.attributes;
            let a = s ? e : null;
            const { isScaleDriven: l } = t.cache;
            let u = t.cache.compiledFunc;
            if (l) {
              const e = (0, o.i)(i) ? i.scale : void 0,
                s = (0, o.i)(i) ? i.view : void 0;
              a =
                null == e || '3d' === s
                  ? (function (t) {
                      let e = null,
                        i = null;
                      const s = t.stops;
                      return (
                        s
                          ? ((e = s[0].value), (i = s[s.length - 1].value))
                          : ((e = t.minDataValue || 0), (i = t.maxDataValue || 0)),
                        (e + i) / 2
                      );
                    })(t)
                  : e;
            } else if (!s)
              switch (t.inputValueType) {
                case 'expression': {
                  if ((0, o.b)(i) || (0, o.b)(i.arcade))
                    return void c.error('Use of arcade expressions requires an arcade context');
                  const e = {
                      viewingMode: i.viewingMode,
                      scale: i.scale,
                      spatialReference: i.spatialReference,
                    },
                    s = i.arcade.arcadeUtils,
                    n = s.getViewInfo(e),
                    l = s.createExecContext(r, n);
                  if (!u) {
                    const e = s.createSyntaxTree(t.valueExpression);
                    (u = s.createFunction(e)), (t.cache.compiledFunc = u);
                  }
                  a = s.executeFunction(u, l);
                  break;
                }
                case 'field':
                  n && (a = n[t.field]);
                  break;
                case 'unknown':
                  a = null;
              }
            if (!(0, h.b)(a)) return null;
            if (s || !t.normalizationField) return a;
            const f = n ? parseFloat(n[t.normalizationField]) : null;
            return (0, h.b)(f) && 0 !== f ? a / f : null;
          })(s, e, i),
          s,
          e,
          i,
          s.cache.ipData,
        );
        return null == r || isNaN(r) ? 0 : r;
      }
      function y(t, e, i) {
        return null == t ? null : (0, h.i)(t) ? g(t, e, i) : (0, h.b)(t) ? t : null;
      }
      function x(t, e, i) {
        return (0, h.b)(i) && t > i ? i : (0, h.b)(e) && t < e ? e : t;
      }
      function v(t, e, i) {
        const { isScaleDriven: s } = t.cache;
        if (!((s && '3d' === i) || e)) return null;
        const r = { scale: e, view: i };
        let n = y(t.minSize, u, r),
          a = y(t.maxSize, u, r);
        if (null != n || null != a) {
          if (n > a) {
            const t = a;
            (a = n), (n = t);
          }
          return { minSize: n, maxSize: a };
        }
      }
      function M(t, e) {
        if (!e) return;
        let i = 0,
          s = e.length - 1;
        return (
          e.some((e, r) => (t < e ? ((s = r), !0) : ((i = r), !1))),
          [i, s, (t - e[i]) / (e[s] - e[i])]
        );
      }
      function S(t, e, i) {
        const s = ['proportional', 'proportional', 'proportional'];
        for (const r of t) {
          const t = r.useSymbolValue ? 'symbol-value' : g(r, e, i);
          switch (r.axis) {
            case 'width':
              s[0] = t;
              break;
            case 'depth':
              s[1] = t;
              break;
            case 'height':
              s[2] = t;
              break;
            case 'width-and-depth':
              (s[0] = t), (s[1] = t);
              break;
            case 'all':
            case void 0:
            case null:
              (s[0] = t), (s[1] = t), (s[2] = t);
              break;
            default:
              (0, n.n)(r.axis);
          }
        }
        return s;
      }
    },
  },
]);
