(self.webpackChunkRemoteClient = self.webpackChunkRemoteClient || []).push([
  [3232],
  {
    48190: (e, t, r) => {
      'use strict';
      function a(e) {}
      r.d(t, { n: () => a }), r(76506);
    },
    85557: (e, t, r) => {
      'use strict';
      r.d(t, { m: () => n });
      var a = r(53785),
        i = r(89623);
      const n = {
        inches: (0, a.c)(1, 'meters', 'inches'),
        feet: (0, a.c)(1, 'meters', 'feet'),
        'us-feet': (0, a.c)(1, 'meters', 'us-feet'),
        yards: (0, a.c)(1, 'meters', 'yards'),
        miles: (0, a.c)(1, 'meters', 'miles'),
        'nautical-miles': (0, a.c)(1, 'meters', 'nautical-miles'),
        millimeters: (0, a.c)(1, 'meters', 'millimeters'),
        centimeters: (0, a.c)(1, 'meters', 'centimeters'),
        decimeters: (0, a.c)(1, 'meters', 'decimeters'),
        meters: (0, a.c)(1, 'meters', 'meters'),
        kilometers: (0, a.c)(1, 'meters', 'kilometers'),
        'decimal-degrees': 1 / (0, a.l)(1, 'meters', i.e.radius),
      };
    },
    52228: (e, t, r) => {
      'use strict';
      function a(e) {
        return e && 'esri.renderers.visualVariables.SizeVariable' === e.declaredClass;
      }
      function i(e) {
        return null != e && !isNaN(e) && isFinite(e);
      }
      function n(e) {
        return e.valueExpression
          ? 'expression'
          : e.field && 'string' == typeof e.field
          ? 'field'
          : 'unknown';
      }
      function s(e, t) {
        const r = t || n(e),
          a = e.valueUnit || 'unknown';
        return 'unknown' === r
          ? 'constant'
          : e.stops
          ? 'stops'
          : null != e.minSize &&
            null != e.maxSize &&
            null != e.minDataValue &&
            null != e.maxDataValue
          ? 'clamped-linear'
          : 'unknown' === a
          ? null != e.minSize && null != e.minDataValue
            ? e.minSize && e.minDataValue
              ? 'proportional'
              : 'additive'
            : 'identity'
          : 'real-world-size';
      }
      r.d(t, { a: () => s, b: () => i, g: () => n, i: () => a });
    },
    74057: (e, t, r) => {
      'use strict';
      r.d(t, {
        PR: () => x,
        Lq: () => y,
        Km: () => m,
        cM: () => b,
        ap: () => h,
        V3: () => w,
        B3: () => f,
      });
      var a = r(48027),
        i = r(23761),
        n = r(48190),
        s = r(92143),
        o = r(76506),
        l = r(85557),
        u = r(52228);
      r(54174),
        r(82426),
        r(91306),
        r(31450),
        r(71552),
        r(40642),
        r(74569),
        r(21801),
        r(34250),
        r(86656),
        r(22723),
        r(17533),
        r(81172),
        r(73796),
        r(74673),
        r(21972),
        r(23639),
        r(91055),
        r(27794),
        r(6906),
        r(50406),
        r(60991),
        r(26341),
        r(97714),
        r(60947),
        r(2906),
        r(91597),
        r(86787),
        r(35132),
        r(89623),
        r(84069),
        r(44567),
        r(98380),
        r(92896),
        r(22781),
        r(57251),
        r(32422),
        r(86748),
        r(15324),
        r(76996),
        r(14249),
        r(9801),
        r(53523),
        r(59465),
        r(42911),
        r(46826),
        r(45433),
        r(60217),
        r(29107),
        r(30574),
        r(2157),
        r(25977),
        r(7471),
        r(54414),
        r(1648),
        r(8925),
        r(33921),
        r(3482),
        r(45154),
        r(16769),
        r(55531),
        r(30582),
        r(593),
        r(85699),
        r(63136),
        r(96055),
        r(47776),
        r(18033),
        r(6331),
        r(62048),
        r(4292),
        r(75626),
        r(72652),
        r(29641),
        r(30493),
        r(70821),
        r(82673),
        r(34229),
        r(37029),
        r(96467),
        r(63571),
        r(30776),
        r(63130),
        r(25696),
        r(66396),
        r(42775),
        r(95834),
        r(34394),
        r(57150),
        r(76726),
        r(20444),
        r(76393),
        r(78548),
        r(2497),
        r(49906),
        r(46527),
        r(48649),
        r(9960),
        r(3101),
        r(5853),
        r(39141),
        r(32101),
        r(38742),
        r(48243),
        r(34635),
        r(10401),
        r(49900),
        r(66284),
        r(82058),
        r(88762),
        r(73173),
        r(22739),
        r(20543),
        r(67477),
        r(78533),
        r(74653),
        r(91091),
        r(58943),
        r(70737),
        r(8487),
        r(17817),
        r(90814),
        r(15459),
        r(61847),
        r(16796),
        r(16955),
        r(22401),
        r(77894),
        r(55187),
        r(8586),
        r(44509),
        r(69814),
        r(11305),
        r(62259),
        r(44790),
        r(5909),
        r(60669),
        r(48208),
        r(51589),
        r(53785),
        r(95587);
      const c = s.L.getLogger('esri.renderers.visualVariables.support.visualVariableUtils'),
        p = new i.Z(),
        d = Math.PI,
        f = /^\s*(return\s+)?\$view\.scale\s*(;)?\s*$/i;
      function y(e, t, r) {
        const i =
          'visualVariables' in e && e.visualVariables
            ? e.visualVariables.filter((e) => 'color' === e.type)[0]
            : e;
        if (!i) return;
        if ('esri.renderers.visualVariables.ColorVariable' !== i.declaredClass)
          return void c.warn(
            'The visualVariable should be an instance of esri.renderers.visualVariables.ColorVariable',
          );
        const n = 'number' == typeof t,
          s = n ? null : t,
          l = s && s.attributes;
        let u = n ? t : null;
        const p = i.field,
          { ipData: d, hasExpression: f } = i.cache;
        let y = i.cache.compiledFunc;
        if (!p && !f) {
          const e = i.stops;
          return e && e[0] && e[0].color;
        }
        if ('number' != typeof u)
          if (f) {
            if (!(0, o.i)(r) || !(0, o.i)(r.arcade))
              return void c.error('Use of arcade expressions requires an arcade context');
            const e = {
                viewingMode: r.viewingMode,
                scale: r.scale,
                spatialReference: r.spatialReference,
              },
              t = r.arcade.arcadeUtils,
              a = t.getViewInfo(e),
              n = t.createExecContext(s, a);
            if (!y) {
              const e = t.createSyntaxTree(i.valueExpression);
              (y = t.createFunction(e)), (i.cache.compiledFunc = y);
            }
            u = t.executeFunction(y, n);
          } else l && (u = l[p]);
        const m = i.normalizationField,
          b = l ? parseFloat(l[m]) : void 0;
        if (null != u && (!m || n || (!isNaN(b) && 0 !== b))) {
          isNaN(b) || n || (u /= b);
          const e = S(u, d);
          if (e) {
            const t = e[0],
              n = e[1],
              s =
                t === n
                  ? i.stops[t].color
                  : a.Z.blendColors(
                      i.stops[t].color,
                      i.stops[n].color,
                      e[2],
                      (0, o.i)(r) ? r.color : void 0,
                    );
            return new a.Z(s);
          }
        }
      }
      function m(e, t, r) {
        const a =
          'visualVariables' in e && e.visualVariables
            ? e.visualVariables.filter((e) => 'opacity' === e.type)[0]
            : e;
        if (!a) return;
        if ('esri.renderers.visualVariables.OpacityVariable' !== a.declaredClass)
          return void c.warn(
            'The visualVariable should be an instance of esri.renderers.visualVariables.OpacityVariable',
          );
        const i = 'number' == typeof t,
          n = i ? null : t,
          s = n && n.attributes;
        let l = i ? t : null;
        const u = a.field,
          { ipData: p, hasExpression: d } = a.cache;
        let f = a.cache.compiledFunc;
        if (!u && !d) {
          const e = a.stops;
          return e && e[0] && e[0].opacity;
        }
        if ('number' != typeof l)
          if (d) {
            if ((0, o.b)(r) || (0, o.b)(r.arcade))
              return void c.error('Use of arcade expressions requires an arcade context');
            const e = {
                viewingMode: r.viewingMode,
                scale: r.scale,
                spatialReference: r.spatialReference,
              },
              t = r.arcade.arcadeUtils,
              i = t.getViewInfo(e),
              s = t.createExecContext(n, i);
            if (!f) {
              const e = t.createSyntaxTree(a.valueExpression);
              (f = t.createFunction(e)), (a.cache.compiledFunc = f);
            }
            l = t.executeFunction(f, s);
          } else s && (l = s[u]);
        const y = a.normalizationField,
          m = s ? parseFloat(s[y]) : void 0;
        if (null != l && (!y || i || (!isNaN(m) && 0 !== m))) {
          isNaN(m) || i || (l /= m);
          const e = S(l, p);
          if (e) {
            const t = e[0],
              r = e[1];
            if (t === r) return a.stops[t].opacity;
            {
              const i = a.stops[t].opacity;
              return i + (a.stops[r].opacity - i) * e[2];
            }
          }
        }
      }
      function b(e, t, r) {
        const a =
          'visualVariables' in e && e.visualVariables
            ? e.visualVariables.filter((e) => 'rotation' === e.type)[0]
            : e;
        if (!a) return;
        if ('esri.renderers.visualVariables.RotationVariable' !== a.declaredClass)
          return void c.warn(
            'The visualVariable should be an instance of esri.renderers.visualVariables.RotationVariable',
          );
        const i = a.axis || 'heading',
          n = 'heading' === i && 'arithmetic' === a.rotationType ? 90 : 0,
          s = 'heading' === i && 'arithmetic' === a.rotationType ? -1 : 1,
          l = 'number' == typeof t ? null : t,
          u = l && l.attributes,
          p = a.field,
          { hasExpression: d } = a.cache;
        let f = a.cache.compiledFunc,
          y = 0;
        if (!p && !d) return y;
        if (d) {
          if ((0, o.b)(r) || (0, o.b)(r.arcade))
            return void c.error('Use of arcade expressions requires an arcade context');
          const e = {
              viewingMode: r.viewingMode,
              scale: r.scale,
              spatialReference: r.spatialReference,
            },
            t = r.arcade.arcadeUtils,
            i = t.getViewInfo(e),
            n = t.createExecContext(l, i);
          if (!f) {
            const e = t.createSyntaxTree(a.valueExpression);
            (f = t.createFunction(e)), (a.cache.compiledFunc = f);
          }
          y = t.executeFunction(f, n);
        } else u && (y = u[p] || 0);
        return (y = 'number' != typeof y || isNaN(y) ? null : n + s * y), y;
      }
      function h(e, t, r) {
        const a =
          'visualVariables' in e && e.visualVariables
            ? e.visualVariables.filter((e) => 'size' === e.type)[0]
            : e;
        if (!a) return;
        if ('esri.renderers.visualVariables.SizeVariable' !== a.declaredClass)
          return void c.warn(
            'The visualVariable should be an instance of esri.renderers.visualVariables.SizeVariable',
          );
        const i = (function (e, t, r, a, i) {
          switch (t.transformationType) {
            case 'additive':
              return (function (e, t, r, a) {
                return e + (g(t.minSize, r, a) || t.minDataValue);
              })(e, t, r, a);
            case 'constant':
              return (function (e, t, r) {
                const a = e.stops;
                let i = a && a.length && a[0].size;
                return null == i && (i = e.minSize), g(i, t, r);
              })(t, r, a);
            case 'clamped-linear':
              return (function (e, t, r, a) {
                const i = (e - t.minDataValue) / (t.maxDataValue - t.minDataValue),
                  n = g(t.minSize, r, a),
                  s = g(t.maxSize, r, a),
                  l = (0, o.i)(a) ? a.shape : void 0;
                if (e <= t.minDataValue) return n;
                if (e >= t.maxDataValue) return s;
                if ('area' === t.scaleBy && l) {
                  const e = 'circle' === l,
                    t = e ? d * (n / 2) ** 2 : n * n,
                    r = t + i * ((e ? d * (s / 2) ** 2 : s * s) - t);
                  return e ? 2 * Math.sqrt(r / d) : Math.sqrt(r);
                }
                return n + i * (s - n);
              })(e, t, r, a);
            case 'proportional':
              return (function (e, t, r, a) {
                const i = (0, o.i)(a) ? a.shape : void 0,
                  n = e / t.minDataValue,
                  s = g(t.minSize, r, a),
                  l = g(t.maxSize, r, a);
                let u = null;
                return (
                  (u =
                    'circle' === i
                      ? 2 * Math.sqrt(n * (s / 2) ** 2)
                      : 'square' === i || 'diamond' === i || 'image' === i
                      ? Math.sqrt(n * s ** 2)
                      : n * s),
                  v(u, s, l)
                );
              })(e, t, r, a);
            case 'stops':
              return (function (e, t, r, a, i) {
                const [n, s, o] = S(e, i);
                if (n === s) return g(t.stops[n].size, r, a);
                {
                  const e = g(t.stops[n].size, r, a);
                  return e + (g(t.stops[s].size, r, a) - e) * o;
                }
              })(e, t, r, a, i);
            case 'real-world-size':
              return (function (e, t, r, a) {
                const i = ((0, o.i)(a) && a.resolution ? a.resolution : 1) * l.m[t.valueUnit],
                  n = g(t.minSize, r, a),
                  s = g(t.maxSize, r, a),
                  { valueRepresentation: u } = t;
                let c = null;
                return (
                  (c =
                    'area' === u
                      ? (2 * Math.sqrt(e / d)) / i
                      : 'radius' === u || 'distance' === u
                      ? (2 * e) / i
                      : e / i),
                  v(c, n, s)
                );
              })(e, t, r, a);
            case 'identity':
              return e;
            case 'unknown':
              return null;
          }
        })(
          (function (e, t, r) {
            const a = 'number' == typeof t,
              i = a ? null : t,
              n = i && i.attributes;
            let s = a ? t : null;
            const { isScaleDriven: l } = e.cache;
            let p = e.cache.compiledFunc;
            if (l) {
              const t = (0, o.i)(r) ? r.scale : void 0,
                a = (0, o.i)(r) ? r.view : void 0;
              s =
                null == t || '3d' === a
                  ? (function (e) {
                      let t = null,
                        r = null;
                      const a = e.stops;
                      return (
                        a
                          ? ((t = a[0].value), (r = a[a.length - 1].value))
                          : ((t = e.minDataValue || 0), (r = e.maxDataValue || 0)),
                        (t + r) / 2
                      );
                    })(e)
                  : t;
            } else if (!a)
              switch (e.inputValueType) {
                case 'expression': {
                  if ((0, o.b)(r) || (0, o.b)(r.arcade))
                    return void c.error('Use of arcade expressions requires an arcade context');
                  const t = {
                      viewingMode: r.viewingMode,
                      scale: r.scale,
                      spatialReference: r.spatialReference,
                    },
                    a = r.arcade.arcadeUtils,
                    n = a.getViewInfo(t),
                    l = a.createExecContext(i, n);
                  if (!p) {
                    const t = a.createSyntaxTree(e.valueExpression);
                    (p = a.createFunction(t)), (e.cache.compiledFunc = p);
                  }
                  s = a.executeFunction(p, l);
                  break;
                }
                case 'field':
                  n && (s = n[e.field]);
                  break;
                case 'unknown':
                  s = null;
              }
            if (!(0, u.b)(s)) return null;
            if (a || !e.normalizationField) return s;
            const d = n ? parseFloat(n[e.normalizationField]) : null;
            return (0, u.b)(d) && 0 !== d ? s / d : null;
          })(a, t, r),
          a,
          t,
          r,
          a.cache.ipData,
        );
        return null == i || isNaN(i) ? 0 : i;
      }
      function g(e, t, r) {
        return null == e ? null : (0, u.i)(e) ? h(e, t, r) : (0, u.b)(e) ? e : null;
      }
      function v(e, t, r) {
        return (0, u.b)(r) && e > r ? r : (0, u.b)(t) && e < t ? t : e;
      }
      function w(e, t, r) {
        const { isScaleDriven: a } = e.cache;
        if (!((a && '3d' === r) || t)) return null;
        const i = { scale: t, view: r };
        let n = g(e.minSize, p, i),
          s = g(e.maxSize, p, i);
        if (null != n || null != s) {
          if (n > s) {
            const e = s;
            (s = n), (n = e);
          }
          return { minSize: n, maxSize: s };
        }
      }
      function S(e, t) {
        if (!t) return;
        let r = 0,
          a = t.length - 1;
        return (
          t.some((t, i) => (e < t ? ((a = i), !0) : ((r = i), !1))),
          [r, a, (e - t[r]) / (t[a] - t[r])]
        );
      }
      function x(e, t, r) {
        const a = ['proportional', 'proportional', 'proportional'];
        for (const i of e) {
          const e = i.useSymbolValue ? 'symbol-value' : h(i, t, r);
          switch (i.axis) {
            case 'width':
              a[0] = e;
              break;
            case 'depth':
              a[1] = e;
              break;
            case 'height':
              a[2] = e;
              break;
            case 'width-and-depth':
              (a[0] = e), (a[1] = e);
              break;
            case 'all':
            case void 0:
            case null:
              (a[0] = e), (a[1] = e), (a[2] = e);
              break;
            default:
              (0, n.n)(i.axis);
          }
        }
        return a;
      }
    },
    63232: (e, t, r) => {
      'use strict';
      r.r(t), r.d(t, { default: () => et });
      var a = r(29768),
        i = r(57251),
        n = r(34250),
        s = r(76506),
        o = r(91306),
        l = (r(92143), r(17533)),
        u = r(31450),
        c = r(88762),
        p = r(82058),
        d = r(60991),
        f = r(99403),
        y = r(32101),
        m = r(44567),
        b = r(74057),
        h = r(21972),
        g = r(21801),
        v = r(60947),
        w = (r(23639), r(86656), r(22723), r(91055), r(27794), r(6906), r(50406)),
        S = (r(81172), r(71552), r(40642), r(73796), r(74673));
      r(26341), r(97714), r(2906), r(91597), r(86787), r(35132), r(89623);
      let x = class extends h.Z {
        constructor() {
          super(...arguments),
            (this.outSpatialReference = null),
            (this.processExtent = null),
            (this.processSpatialReference = null),
            (this.returnFeatureCollection = !1),
            (this.returnM = !1),
            (this.returnZ = !1);
        }
      };
      (0, a._)([(0, n.Cb)({ type: v.Z })], x.prototype, 'outSpatialReference', void 0),
        (0, a._)([(0, n.Cb)({ type: g.Z })], x.prototype, 'processExtent', void 0),
        (0, a._)([(0, n.Cb)({ type: v.Z })], x.prototype, 'processSpatialReference', void 0),
        (0, a._)([(0, n.Cb)({ nonNullable: !0 })], x.prototype, 'returnFeatureCollection', void 0),
        (0, a._)([(0, n.Cb)({ nonNullable: !0 })], x.prototype, 'returnM', void 0),
        (0, a._)([(0, n.Cb)({ nonNullable: !0 })], x.prototype, 'returnZ', void 0),
        (x = (0, a._)([(0, l.j)('esri/rest/geoprocessor/GPOptions')], x)),
        (x.from = (0, o.e)(x));
      const V = x;
      var P = r(81731),
        D = r(95533),
        I = r(97546);
      let M = class extends S.a {
        constructor() {
          super(...arguments),
            (this.extent = null),
            (this.height = null),
            (this.href = null),
            (this.opacity = 1),
            (this.rotation = 0),
            (this.scale = null),
            (this.visible = !0),
            (this.width = null);
        }
      };
      (0, a._)([(0, n.Cb)({ type: g.Z })], M.prototype, 'extent', void 0),
        (0, a._)([(0, n.Cb)()], M.prototype, 'height', void 0),
        (0, a._)([(0, n.Cb)()], M.prototype, 'href', void 0),
        (0, a._)([(0, n.Cb)()], M.prototype, 'opacity', void 0),
        (0, a._)([(0, n.Cb)()], M.prototype, 'rotation', void 0),
        (0, a._)([(0, n.Cb)()], M.prototype, 'scale', void 0),
        (0, a._)([(0, n.Cb)()], M.prototype, 'visible', void 0),
        (0, a._)([(0, n.Cb)()], M.prototype, 'width', void 0),
        (M = (0, a._)([(0, l.j)('esri.layer.support.MapImage')], M));
      const L = M;
      let G = class extends S.a {
        constructor(e) {
          super(e), (this.itemId = null), (this.url = null);
        }
      };
      (0, a._)(
        [
          (0, n.Cb)({
            type: String,
            json: { read: { source: 'itemID' }, write: { target: 'itemID' } },
          }),
        ],
        G.prototype,
        'itemId',
        void 0,
      ),
        (0, a._)([(0, n.Cb)({ type: String, json: { write: !0 } })], G.prototype, 'url', void 0),
        (G = (0, a._)([(0, l.j)('esri.rest.support.DataFile')], G));
      const C = G;
      var F = r(87258);
      const O = new i.J(
        {
          esriMeters: 'meters',
          esriFeet: 'feet',
          esriKilometers: 'kilometers',
          esriMiles: 'miles',
          esriNauticalMiles: 'nautical-miles',
          esriYards: 'yards',
        },
        { ignoreUnknown: !1 },
      );
      let T = class extends S.a {
        constructor(e) {
          super(e), (this.distance = 0), (this.units = null);
        }
      };
      (0, a._)([(0, n.Cb)({ json: { write: !0 } })], T.prototype, 'distance', void 0),
        (0, a._)(
          [(0, n.Cb)({ json: { read: O.read, write: O.write } })],
          T.prototype,
          'units',
          void 0,
        ),
        (T = (0, a._)([(0, l.j)('esri/rest/support/LinearUnit')], T));
      const _ = T,
        N = new i.J({
          GPBoolean: 'boolean',
          GPDataFile: 'data-file',
          GPDate: 'date',
          GPDouble: 'double',
          GPFeatureRecordSetLayer: 'feature-record-set-layer',
          GPField: 'field',
          GPLinearUnit: 'linear-unit',
          GPLong: 'long',
          GPRasterData: 'raster-data',
          GPRasterDataLayer: 'raster-data-layer',
          GPRecordSet: 'record-set',
          GPString: 'string',
          'GPMultiValue:GPBoolean': 'multi-value',
          'GPMultiValue:GPDataFile': 'multi-value',
          'GPMultiValue:GPDate': 'multi-value',
          'GPMultiValue:GPDouble': 'multi-value',
          'GPMultiValue:GPFeatureRecordSetLayer': 'multi-value',
          'GPMultiValue:GPField': 'multi-value',
          'GPMultiValue:GPLinearUnit': 'multi-value',
          'GPMultiValue:GPLong': 'multi-value',
          'GPMultiValue:GPRasterData': 'multi-value',
          'GPMultiValue:GPRasterDataLayer': 'multi-value',
          'GPMultiValue:GPRecordSet': 'multi-value',
          'GPMultiValue:GPString': 'multi-value',
        });
      let k = class extends S.a {
        constructor(e) {
          super(e), (this.dataType = null), (this.value = null);
        }
      };
      (0, a._)(
        [(0, n.Cb)({ json: { read: N.read, write: N.write } })],
        k.prototype,
        'dataType',
        void 0,
      ),
        (0, a._)([(0, n.Cb)()], k.prototype, 'value', void 0),
        (k = (0, a._)([(0, l.j)('esri.rest.support.ParameterValue')], k));
      const J = k;
      let R = class extends S.a {
        constructor(e) {
          super(e), (this.format = null), (this.itemId = null), (this.url = null);
        }
      };
      (0, a._)([(0, n.Cb)()], R.prototype, 'format', void 0),
        (0, a._)(
          [(0, n.Cb)({ json: { read: { source: 'itemID' }, write: { target: 'itemID' } } })],
          R.prototype,
          'itemId',
          void 0,
        ),
        (0, a._)([(0, n.Cb)()], R.prototype, 'url', void 0),
        (R = (0, a._)([(0, l.j)('esri/rest/support/RasterData')], R));
      const j = R;
      var E,
        z = r(2710);
      async function U(e, t, r, a, i) {
        const n = {},
          s = {},
          o = [];
        return (
          (function (e, t, r) {
            for (const a in e) {
              const i = e[a];
              if (i && 'object' == typeof i && i instanceof F.default) {
                const { features: e } = i;
                (r[a] = [t.length, t.length + e.length]),
                  e.forEach((e) => {
                    t.push(e.geometry);
                  });
              }
            }
          })(a, o, n),
          (0, D.aX)(o).then((o) => {
            const {
                outSpatialReference: l,
                processExtent: u,
                processSpatialReference: c,
                returnFeatureCollection: d,
                returnM: f,
                returnZ: y,
              } = r,
              { path: m } = (0, P.p)(e);
            for (const e in n) {
              const t = n[e];
              s[e] = o.slice(t[0], t[1]);
            }
            const b = l ? l.wkid || l : null,
              h = c ? c.wkid || c : null,
              g =
                'execute' === t
                  ? {
                      returnFeatureCollection: d || void 0,
                      returnM: f || void 0,
                      returnZ: y || void 0,
                    }
                  : null,
              v = q(
                {
                  ...(u
                    ? { context: { extent: u, outSR: b, processSR: h } }
                    : { 'env:outSR': b, 'env:processSR': h }),
                  ...a,
                  ...g,
                  f: 'json',
                },
                null,
                s,
              ),
              w = { ...i, query: v };
            return (0, p.default)(`${m}/${t}`, w);
          })
        );
      }
      function A(e) {
        const t = e.dataType,
          r = J.fromJSON(e);
        switch (t) {
          case 'GPBoolean':
          case 'GPDouble':
          case 'GPLong':
          case 'GPString':
            return r;
          case 'GPDate':
            r.value = new Date(r.value);
            break;
          case 'GPDataFile':
            r.value = C.fromJSON(r.value);
            break;
          case 'GPLinearUnit':
            r.value = _.fromJSON(r.value);
            break;
          case 'GPFeatureRecordSetLayer':
          case 'GPRecordSet': {
            const t = e.value.url;
            r.value = t ? C.fromJSON(r.value) : F.default.fromJSON(r.value);
            break;
          }
          case 'GPRasterData':
          case 'GPRasterDataLayer': {
            const t = e.value.mapImage;
            r.value = t ? L.fromJSON(t) : j.fromJSON(r.value);
            break;
          }
          case 'GPField':
            r.value = I.Z.fromJSON(r.value);
            break;
          case 'GPMultiValue:GPBoolean':
          case 'GPMultiValue:GPDouble':
          case 'GPMultiValue:GPLong':
          case 'GPMultiValue:GPString':
            return r;
          case 'GPMultiValue:GPDate': {
            const e = r.value;
            r.value = e.map((e) => new Date(e));
            break;
          }
          case 'GPMultiValue:GPDataFile':
            r.value = r.value.map((e) => C.fromJSON(e));
            break;
          case 'GPMultiValue:GPLinearUnit':
            r.value = r.value.map((e) => _.fromJSON(e));
            break;
          case 'GPMultiValue:GPFeatureRecordSetLayer':
          case 'GPMultiValue:GPRecordSet':
            r.value = r.value.map((e) => F.default.fromJSON(e));
            break;
          case 'GPMultiValue:GPRasterData':
          case 'GPMultiValue:GPRasterDataLayer':
            r.value = r.value.map((e) => (e ? L.fromJSON(e) : j.fromJSON(r.value)));
            break;
          case 'GPMultiValue:GPField':
            r.value = r.value.map((e) => I.Z.fromJSON(e));
        }
        return r;
      }
      function q(e, t, r) {
        for (const t in e) {
          const r = e[t];
          Array.isArray(r)
            ? (e[t] = JSON.stringify(r.map((e) => q({ item: e }, !0).item)))
            : r instanceof Date && (e[t] = r.getTime());
        }
        return (0, P.e)(e, t, r);
      }
      r(98380),
        r(92896),
        r(94751),
        r(32422),
        r(84069),
        r(74569),
        r(22781),
        r(59465),
        r(9801),
        r(53523),
        r(42911),
        r(46826),
        r(45433),
        r(54732),
        r(23761),
        r(86748),
        r(15324),
        r(76996),
        r(14249),
        r(60217),
        r(29107),
        r(30574),
        r(2157),
        r(25977),
        r(7471),
        r(54414),
        r(1648),
        r(8925),
        r(33921),
        r(3482),
        r(45154),
        r(16769),
        r(55531),
        r(30582),
        r(593),
        r(85699),
        r(63136),
        r(96055),
        r(47776),
        r(18033),
        r(6331),
        r(62048),
        r(4292),
        r(75626),
        r(72652),
        r(29641),
        r(30493),
        r(70821),
        r(82673),
        r(34229),
        r(37029),
        r(96467),
        r(63571),
        r(30776),
        r(48027),
        r(54174),
        r(82426),
        r(63130),
        r(25696),
        r(66396),
        r(42775),
        r(95834),
        r(34394),
        r(57150),
        r(76726),
        r(20444),
        r(76393),
        r(78548),
        r(2497),
        r(49906),
        r(46527),
        r(48649),
        r(9960),
        r(3101),
        r(5853),
        r(39141),
        r(38742),
        r(48243),
        r(34635),
        r(10401),
        r(49900),
        r(66284),
        r(73173),
        r(22739),
        r(20543),
        r(67477),
        r(78533),
        r(74653),
        r(91091),
        r(58943),
        r(70737),
        r(8487),
        r(17817),
        r(90814),
        r(15459),
        r(61847),
        r(16796),
        r(16955),
        r(22401),
        r(77894),
        r(55187),
        r(8586),
        r(44509),
        r(69814),
        r(11305),
        r(62259),
        r(44790),
        r(5909),
        r(60669),
        r(48208),
        r(51589);
      const $ = new i.J({
        esriJobCancelled: 'job-cancelled',
        esriJobCancelling: 'job-cancelling',
        esriJobDeleted: 'job-deleted',
        esriJobDeleting: 'job-deleting',
        esriJobTimedOut: 'job-timed-out',
        esriJobExecuting: 'job-executing',
        esriJobFailed: 'job-failed',
        esriJobNew: 'job-new',
        esriJobSubmitted: 'job-submitted',
        esriJobSucceeded: 'job-succeeded',
        esriJobWaiting: 'job-waiting',
      });
      let Z = (E = class extends S.a {
        constructor(e) {
          super(e),
            (this.jobId = null),
            (this.jobStatus = null),
            (this.messages = null),
            (this.requestOptions = null),
            (this.sourceUrl = null),
            (this._timer = null);
        }
        cancelJob(e) {
          const { jobId: t, sourceUrl: r } = this,
            { path: a } = (0, P.p)(r),
            i = { ...this.requestOptions, ...e, query: { f: 'json' } };
          return (
            this._clearTimer(),
            (0, p.default)(`${a}/jobs/${t}/cancel`, i).then((e) => {
              const t = E.fromJSON(e.data);
              return (this.messages = t.messages), (this.jobStatus = t.jobStatus), this;
            })
          );
        }
        destroy() {
          clearInterval(this._timer);
        }
        checkJobStatus(e) {
          const { path: t } = (0, P.p)(this.sourceUrl),
            r = { ...this.requestOptions, ...e, query: { f: 'json' } },
            a = `${t}/jobs/${this.jobId}`;
          return (0, p.default)(a, r).then(({ data: e }) => {
            const t = E.fromJSON(e);
            return (this.messages = t.messages), (this.jobStatus = t.jobStatus), this;
          });
        }
        fetchResultData(e, t, r) {
          t = V.from(t || {});
          const { returnFeatureCollection: a, returnM: i, returnZ: n, outSpatialReference: s } = t,
            { path: o } = (0, P.p)(this.sourceUrl),
            l = q(
              {
                returnFeatureCollection: a,
                returnM: i,
                returnZ: n,
                outSR: s,
                returnType: 'data',
                f: 'json',
              },
              null,
            ),
            u = { ...this.requestOptions, ...r, query: l },
            c = `${o}/jobs/${this.jobId}/results/${e}`;
          return (0, p.default)(c, u).then((e) => A(e.data));
        }
        fetchResultImage(e, t, r) {
          const { path: a } = (0, P.p)(this.sourceUrl),
            i = q({ ...t.toJSON(), f: 'json' }),
            n = { ...this.requestOptions, ...r, query: i },
            s = `${a}/jobs/${this.jobId}/results/${e}`;
          return (0, p.default)(s, n).then((e) => A(e.data));
        }
        async fetchResultMapImageLayer() {
          const { path: e } = (0, P.p)(this.sourceUrl),
            t = e.indexOf('/GPServer/'),
            a = `${e.substring(0, t)}/MapServer/jobs/${this.jobId}`;
          return new (0,
          (
            await Promise.all([
              r.e(4851),
              r.e(5959),
              r.e(208),
              r.e(3770),
              r.e(9615),
              r.e(2883),
            ]).then(r.bind(r, 62883))
          ).default)({ url: a });
        }
        async waitForJobCompletion(e = {}) {
          const { interval: t = 1e3, signal: r, statusCallback: a } = e;
          return new Promise((e, i) => {
            (0, w.fu)(r, () => {
              this._clearTimer(), i((0, w.zE)());
            }),
              this._clearTimer();
            const n = setInterval(() => {
              this._timer || i((0, w.zE)()),
                this.checkJobStatus(this.requestOptions).then((t) => {
                  const { jobStatus: r } = t;
                  switch (((this.jobStatus = r), r)) {
                    case 'job-succeeded':
                      this._clearTimer(), e(this);
                      break;
                    case 'job-submitted':
                    case 'job-executing':
                    case 'job-waiting':
                    case 'job-new':
                      a && a(this);
                      break;
                    case 'job-cancelled':
                    case 'job-cancelling':
                    case 'job-deleted':
                    case 'job-deleting':
                    case 'job-timed-out':
                    case 'job-failed':
                      this._clearTimer(), i(this);
                  }
                });
            }, t);
            this._timer = n;
          });
        }
        _clearTimer() {
          this._timer && (clearInterval(this._timer), (this._timer = null));
        }
      });
      (0, a._)([(0, n.Cb)()], Z.prototype, 'jobId', void 0),
        (0, a._)([(0, n.Cb)({ json: { read: $.read } })], Z.prototype, 'jobStatus', void 0),
        (0, a._)([(0, n.Cb)({ type: [z.Z] })], Z.prototype, 'messages', void 0),
        (0, a._)([(0, n.Cb)()], Z.prototype, 'requestOptions', void 0),
        (0, a._)([(0, n.Cb)({ json: { write: !0 } })], Z.prototype, 'sourceUrl', void 0),
        (Z = E = (0, a._)([(0, l.j)('esri.rest.support.JobInfo')], Z));
      const B = Z,
        K = new i.J({
          PDF: 'pdf',
          PNG32: 'png32',
          PNG8: 'png8',
          JPG: 'jpg',
          GIF: 'gif',
          EPS: 'eps',
          SVG: 'svg',
          SVGZ: 'svgz',
        }),
        W = (K.fromJSON.bind(K), K.toJSON.bind(K)),
        Q = new i.J({
          MAP_ONLY: 'map-only',
          'A3 Landscape': 'a3-landscape',
          'A3 Portrait': 'a3-portrait',
          'A4 Landscape': 'a4-landscape',
          'A4 Portrait': 'a4-portrait',
          'Letter ANSI A Landscape': 'letter-ansi-a-landscape',
          'Letter ANSI A Portrait': 'letter-ansi-a-portrait',
          'Tabloid ANSI B Landscape': 'tabloid-ansi-b-landscape',
          'Tabloid ANSI B Portrait': 'tabloid-ansi-b-portrait',
        }),
        Y = (Q.fromJSON.bind(Q), Q.toJSON.bind(Q));
      let H = class extends h.Z {
        constructor(e) {
          super(e),
            (this.attributionVisible = !0),
            (this.exportOptions = { width: 800, height: 1100, dpi: 96 }),
            (this.forceFeatureAttributes = !1),
            (this.format = 'png32'),
            (this.label = null),
            (this.layout = 'map-only'),
            (this.layoutOptions = null),
            (this.outScale = 0),
            (this.scalePreserved = !0),
            (this.showLabels = !0);
        }
      };
      (0, a._)([(0, n.Cb)()], H.prototype, 'attributionVisible', void 0),
        (0, a._)([(0, n.Cb)()], H.prototype, 'exportOptions', void 0),
        (0, a._)([(0, n.Cb)()], H.prototype, 'forceFeatureAttributes', void 0),
        (0, a._)([(0, n.Cb)()], H.prototype, 'format', void 0),
        (0, a._)([(0, n.Cb)()], H.prototype, 'label', void 0),
        (0, a._)([(0, n.Cb)()], H.prototype, 'layout', void 0),
        (0, a._)([(0, n.Cb)()], H.prototype, 'layoutOptions', void 0),
        (0, a._)([(0, n.Cb)()], H.prototype, 'outScale', void 0),
        (0, a._)([(0, n.Cb)()], H.prototype, 'scalePreserved', void 0),
        (0, a._)([(0, n.Cb)()], H.prototype, 'showLabels', void 0),
        (H = (0, a._)([(0, l.j)('esri.rest.support.PrintTemplate')], H));
      const X = H;
      var ee = r(31292);
      function te(e, t) {
        const { graphic: r, renderer: a, symbol: i } = t,
          n = i.type;
        if (
          'text' === n ||
          'shield-label-symbol' === n ||
          !('visualVariables' in a) ||
          !a.visualVariables
        )
          return;
        const s = a.getVisualVariablesForType('size'),
          o = a.getVisualVariablesForType('color'),
          l = a.getVisualVariablesForType('opacity'),
          u = a.getVisualVariablesForType('rotation'),
          c = s && s[0],
          p = o && o[0],
          d = l && l[0],
          y = u && u[0];
        if (c) {
          const t = 'simple-marker' === n ? i.style : null,
            a = (0, b.ap)(c, r, { shape: t });
          null != a &&
            ('simple-marker' === n
              ? (e.size = (0, f.p)(a))
              : 'picture-marker' === n
              ? ((e.width = (0, f.p)(a)), (e.height = (0, f.p)(a)))
              : 'simple-line' === n
              ? (e.width = (0, f.p)(a))
              : e.outline && (e.outline.width = (0, f.p)(a)));
        }
        if (p) {
          const t = (0, b.Lq)(p, r);
          ((t && 'simple-marker' === n) || 'simple-line' === n || 'simple-fill' === n) &&
            (e.color = t ? t.toJSON() : void 0);
        }
        if (d) {
          const t = (0, b.Km)(d, r);
          null != t && e.color && (e.color[3] = Math.round(255 * t));
        }
        y && (e.angle = -(0, b.cM)(a, r));
      }
      function re(e) {
        return e && 'bing-maps' === e.type;
      }
      function ae(e) {
        return e && 'csv' === e.type;
      }
      function ie(e) {
        return e && 'feature' === e.type;
      }
      function ne(e) {
        return e && 'geojson' === e.type;
      }
      function se(e) {
        return e && 'graphics' === e.type;
      }
      function oe(e) {
        return e && 'group' === e.type;
      }
      function le(e) {
        return e && 'esri.views.2d.layers.GroupLayerView2D' === e.declaredClass;
      }
      function ue(e) {
        return e && 'imagery' === e.type;
      }
      function ce(e) {
        return e && 'kml' === e.type;
      }
      function pe(e) {
        return e && 'map-image' === e.type;
      }
      function de(e) {
        return e && 'map-notes' === e.type;
      }
      function fe(e) {
        return e && 'open-street-map' === e.type;
      }
      function ye(e) {
        return e && 'stream' === e.type;
      }
      function me(e) {
        return e && 'tile' === e.type;
      }
      function be(e) {
        return e && 'vector-tile' === e.type;
      }
      function he(e) {
        return e && 'web-tile' === e.type;
      }
      function ge(e) {
        return e && 'wms' === e.type;
      }
      function ve(e) {
        return e && 'wmts' === e.type;
      }
      r(48190), r(85557), r(53785), r(95587), r(93314), r(35197), r(69218), r(27207);
      const we = { Feet: 'ft', Kilometers: 'km', Meters: 'm', Miles: 'mi' },
        Se = new i.J({
          esriFeet: 'Feet',
          esriKilometers: 'Kilometers',
          esriMeters: 'Meters',
          esriMiles: 'Miles',
        }),
        xe = new i.J({
          esriExecutionTypeSynchronous: 'sync',
          esriExecutionTypeAsynchronous: 'async',
        }),
        Ve = new ee.Z({ returnGeometry: !0 }),
        Pe = new Map();
      async function De(e, t, r) {
        const a = Me(e);
        let i = Pe.get(a);
        return Promise.resolve()
          .then(() =>
            i
              ? { data: i.gpMetadata }
              : ((i = {
                  gpServerUrl: a,
                  is11xService: !1,
                  legendLayerNameMap: [],
                  legendLayers: [],
                }),
                (0, p.default)(a, { query: { f: 'json' } })),
          )
          .then(
            (e) => (
              (i.gpMetadata = e.data),
              (i.cimVersion = i.gpMetadata.cimVersion),
              (i.is11xService = !!i.cimVersion),
              Pe.set(a, i),
              Ie(t, i)
            ),
          )
          .then((a) => {
            const n = (function (e) {
              return e.gpMetadata && e.gpMetadata.executionType
                ? xe.fromJSON(e.gpMetadata.executionType)
                : 'sync';
            })(i);
            let s;
            const o = (e) =>
              'sync' === n
                ? e.results && e.results[0] && e.results[0].value
                : s.fetchResultData('Output_File', null, r).then((e) => e.value);
            return 'async' === n
              ? (async function (e, t, r, a) {
                  return (
                    (r = V.from(r || {})),
                    U(e, 'submitJob', r, t, a).then((t) => {
                      const r = B.fromJSON(t.data);
                      return (r.sourceUrl = e), r;
                    })
                  );
                })(e, a, null, r).then(
                  (e) => ((s = e), e.waitForJobCompletion({ interval: t.updateDelay }).then(o)),
                )
              : (async function (e, t, r, a) {
                  return U(e, 'execute', (r = V.from(r || {})), t, a).then((e) => {
                    const t = e.data.results || [],
                      r = e.data.messages || [];
                    return { results: t.map(A), messages: r.map((e) => z.Z.fromJSON(e)) };
                  });
                })(e, a, null, r).then(o);
          });
      }
      async function Ie(e, t) {
        t = t || { is11xService: !1, legendLayerNameMap: [], legendLayers: [] };
        const r = e.template || new X();
        null == r.showLabels && (r.showLabels = !0);
        const a = r.exportOptions;
        let i;
        const n = Y(r.layout);
        if (a && ((i = { dpi: a.dpi }), 'map_only' === n.toLowerCase() || '' === n)) {
          const e = a.width,
            t = a.height;
          i.outputSize = [e, t];
        }
        const o = r.layoutOptions;
        let l;
        if (o) {
          let e, t;
          'Miles' === o.scalebarUnit || 'Kilometers' === o.scalebarUnit
            ? ((e = 'Kilometers'), (t = 'Miles'))
            : ('Meters' !== o.scalebarUnit && 'Feet' !== o.scalebarUnit) ||
              ((e = 'Meters'), (t = 'Feet')),
            (l = {
              titleText: o.titleText,
              authorText: o.authorText,
              copyrightText: o.copyrightText,
              customTextElements: o.customTextElements,
              scaleBarOptions: {
                metricUnit: Se.toJSON(e),
                metricLabel: we[e],
                nonMetricUnit: Se.toJSON(t),
                nonMetricLabel: we[t],
              },
            });
        }
        let u = null;
        o &&
          o.legendLayers &&
          (u = o.legendLayers.map((e) => {
            t.legendLayerNameMap[e.layerId] = e.title;
            const r = { id: e.layerId };
            return e.subLayerIds && (r.subLayerIds = e.subLayerIds), r;
          }));
        const c = await (async function (e, t, r) {
          const a = e.view;
          let i = a.spatialReference;
          const n = { operationalLayers: await Le(a, t, r) };
          let o = r.ssExtent || e.extent || a.extent;
          if (
            (i && i.isWrappable && ((o = o.clone()._normalize(!0)), (i = o.spatialReference)),
            (n.mapOptions = {
              extent: o && o.toJSON(),
              spatialReference: i && i.toJSON(),
              showAttribution: t.attributionVisible,
            }),
            (r.ssExtent = null),
            a.background && (n.background = a.background.toJSON()),
            a.rotation && (n.mapOptions.rotation = -a.rotation),
            t.scalePreserved && (n.mapOptions.scale = t.outScale || a.scale),
            a.timeExtent)
          ) {
            const e = (0, s.i)(a.timeExtent.start) ? a.timeExtent.start.getTime() : null,
              t = (0, s.i)(a.timeExtent.end) ? a.timeExtent.end.getTime() : null;
            n.mapOptions.time = [e, t];
          }
          return n;
        })(e, r, t);
        if (c.operationalLayers) {
          const e = new RegExp(
              '[\\u4E00-\\u9FFF\\u0E00-\\u0E7F\\u0900-\\u097F\\u3040-\\u309F\\u30A0-\\u30FF\\u31F0-\\u31FF]',
            ),
            r = /[\u0600-\u06FF]/,
            a = (t) => {
              const a = t.text,
                i = t.font,
                n = i && i.family && i.family.toLowerCase();
              a &&
                i &&
                ('arial' === n || 'arial unicode ms' === n) &&
                ((i.family = e.test(a) ? 'Arial Unicode MS' : 'Arial'),
                'normal' !== i.style && r.test(a) && (i.family = 'Arial Unicode MS'));
            },
            i = () => {
              throw new d.Z(
                'print-task:cim-symbol-unsupported',
                'CIMSymbol is not supported by a print service published from ArcMap',
              );
            };
          c.operationalLayers.forEach((e) => {
            var r, n, s;
            null != (r = e.featureCollection) && r.layers
              ? e.featureCollection.layers.forEach((e) => {
                  var r, n, s, o;
                  if (
                    null != (r = e.layerDefinition) &&
                    null != (n = r.drawingInfo) &&
                    null != (s = n.renderer) &&
                    s.symbol
                  ) {
                    const r = e.layerDefinition.drawingInfo.renderer;
                    'esriTS' === r.symbol.type
                      ? a(r.symbol)
                      : 'CIMSymbolReference' !== r.symbol.type || t.is11xService || i();
                  }
                  null != (o = e.featureSet) &&
                    o.features &&
                    e.featureSet.features.forEach((e) => {
                      e.symbol &&
                        ('esriTS' === e.symbol.type
                          ? a(e.symbol)
                          : 'CIMSymbolReference' !== e.symbol.type || t.is11xService || i());
                    });
                })
              : !t.is11xService &&
                null != (n = e.layerDefinition) &&
                null != (s = n.drawingInfo) &&
                s.renderer &&
                JSON.stringify(e.layerDefinition.drawingInfo.renderer).includes(
                  '"type":"CIMSymbolReference"',
                ) &&
                i();
          });
        }
        e.outSpatialReference && (c.mapOptions.spatialReference = e.outSpatialReference.toJSON()),
          Object.assign(c, { exportOptions: i, layoutOptions: l || {} }),
          Object.assign(c.layoutOptions, {
            legendOptions: { operationalLayers: null != u ? u : t.legendLayers.slice() },
          }),
          (t.legendLayers.length = 0),
          Pe.set(t.gpServerUrl, t);
        const p = { Web_Map_as_JSON: JSON.stringify(c), Format: W(r.format), Layout_Template: n };
        return e.extraParameters && Object.assign(p, e.extraParameters), p;
      }
      function Me(e) {
        let t = e;
        const r = t.lastIndexOf('/GPServer/');
        return r > 0 && (t = t.slice(0, r + 9)), t;
      }
      async function Le(e, t, r) {
        const a = [],
          i = { layerView: null, printTemplate: t, view: e };
        let n = 0;
        t.scalePreserved && (n = t.outScale || e.scale);
        const s = (function (e, t) {
          const r = e.allLayerViews.items;
          if (t === e.scale) return r.filter((e) => !e.suspended);
          const a = new Array();
          for (const e of r)
            (le(e.parent) && !a.includes(e.parent)) ||
              !e.visible ||
              (t && 'isVisibleAtScale' in e && !e.isVisibleAtScale(t)) ||
              a.push(e);
          return a;
        })(e, n);
        for (const e of s) {
          const t = e.layer;
          if (!t.loaded || oe(t)) continue;
          let n;
          (i.layerView = e),
            (n = re(t)
              ? Ge(t)
              : ae(t)
              ? await Ce(t, i, r)
              : ie(t)
              ? await Oe(t, i, r)
              : ne(t)
              ? await Te(t, i, r)
              : se(t)
              ? await _e(t, i, r)
              : ue(t)
              ? Ne(t, r)
              : ce(t)
              ? await ke(t, i, r)
              : pe(t)
              ? Je(t, i, r)
              : de(t)
              ? await Re(i, r)
              : fe(t)
              ? { type: 'OpenStreetMap' }
              : ye(t)
              ? await Ee(t, i, r)
              : me(t)
              ? ze(t)
              : be(t)
              ? await Ue(t, i, r)
              : he(t)
              ? Ae(t)
              : ge(t)
              ? qe(t)
              : ve(t)
              ? $e(t)
              : await je(t, i, r)),
            n &&
              (Array.isArray(n)
                ? a.push(...n)
                : ((n.id = t.id),
                  (n.title = r.legendLayerNameMap[t.id] || t.title),
                  (n.opacity = t.opacity),
                  (n.minScale = t.minScale || 0),
                  (n.maxScale = t.maxScale || 0),
                  a.push(n)));
        }
        if (
          (n &&
            a.forEach((e) => {
              (e.minScale = 0), (e.maxScale = 0);
            }),
          e.graphics && e.graphics.length)
        ) {
          const i = await Fe(null, e.graphics, t, r);
          i && a.push(i);
        }
        return a;
      }
      function Ge(e) {
        return {
          culture: e.culture,
          key: e.key,
          type:
            'BingMaps' +
            ('aerial' === e.style ? 'Aerial' : 'hybrid' === e.style ? 'Hybrid' : 'Road'),
        };
      }
      async function Ce(e, { layerView: t, printTemplate: r }, a) {
        let i;
        return (
          a.legendLayers && a.legendLayers.push({ id: e.id }),
          a.is11xService
            ? ((i = { type: 'CSV' }),
              e.write(i, { origin: 'web-map' }),
              delete i.popupInfo,
              delete i.layerType,
              (i.showLabels = r.showLabels && e.labelsVisible),
              i)
            : Fe(e, await We(t), r, a)
        );
      }
      async function Fe(e, t, r, a) {
        let i;
        const n = {
            layerDefinition: {
              name: 'polygonLayer',
              geometryType: 'esriGeometryPolygon',
              drawingInfo: { renderer: null },
            },
            featureSet: { geometryType: 'esriGeometryPolygon', features: [] },
          },
          s = {
            layerDefinition: {
              name: 'polylineLayer',
              geometryType: 'esriGeometryPolyline',
              drawingInfo: { renderer: null },
            },
            featureSet: { geometryType: 'esriGeometryPolyline', features: [] },
          },
          o = {
            layerDefinition: {
              name: 'pointLayer',
              geometryType: 'esriGeometryPoint',
              drawingInfo: { renderer: null },
            },
            featureSet: { geometryType: 'esriGeometryPoint', features: [] },
          },
          l = {
            layerDefinition: {
              name: 'multipointLayer',
              geometryType: 'esriGeometryMultipoint',
              drawingInfo: { renderer: null },
            },
            featureSet: { geometryType: 'esriGeometryMultipoint', features: [] },
          },
          u = {
            layerDefinition: {
              name: 'pointLayer',
              geometryType: 'esriGeometryPoint',
              drawingInfo: { renderer: null },
            },
            featureSet: { geometryType: 'esriGeometryPoint', features: [] },
          };
        if (((u.layerDefinition.name = 'textLayer'), delete u.layerDefinition.drawingInfo, e)) {
          if (
            ('esri.layers.FeatureLayer' === e.declaredClass ||
            'esri.layers.StreamLayer' === e.declaredClass
              ? (n.layerDefinition.name = s.layerDefinition.name = o.layerDefinition.name = l.layerDefinition.name =
                  a.legendLayerNameMap[e.id] || e.get('arcgisProps.title') || e.title)
              : 'esri.layers.GraphicsLayer' === e.declaredClass && (t = e.graphics.items),
            e.renderer)
          ) {
            const t = e.renderer.toJSON();
            (n.layerDefinition.drawingInfo.renderer = t),
              (s.layerDefinition.drawingInfo.renderer = t),
              (o.layerDefinition.drawingInfo.renderer = t),
              (l.layerDefinition.drawingInfo.renderer = t);
          }
          if (r.showLabels && e.labelsVisible && 'function' == typeof e.write) {
            var c, p;
            const t =
              null == (c = e.write({}, { origin: 'web-map' }).layerDefinition) ||
              null == (p = c.drawingInfo)
                ? void 0
                : p.labelingInfo;
            t &&
              ((i = !0),
              (n.layerDefinition.drawingInfo.labelingInfo = t),
              (s.layerDefinition.drawingInfo.labelingInfo = t),
              (o.layerDefinition.drawingInfo.labelingInfo = t),
              (l.layerDefinition.drawingInfo.labelingInfo = t));
          }
        }
        let d;
        (null != e && e.renderer) ||
          i ||
          (delete n.layerDefinition.drawingInfo,
          delete s.layerDefinition.drawingInfo,
          delete o.layerDefinition.drawingInfo,
          delete l.layerDefinition.drawingInfo);
        const f = null == e ? void 0 : e.fieldsIndex,
          y = null == e ? void 0 : e.renderer;
        if (f) {
          if (y && 'function' == typeof y.collectRequiredFields) {
            const e = new Set();
            await y.collectRequiredFields(e, f), (d = Array.from(e));
          }
          const e = f.fields.map((e) => e.toJSON());
          (n.layerDefinition.fields = e),
            (s.layerDefinition.fields = e),
            (o.layerDefinition.fields = e),
            (l.layerDefinition.fields = e);
        }
        const b = t && t.length;
        let h;
        for (let i = 0; i < b; i++) {
          const c = t[i] || t.getItemAt(i);
          if (!1 === c.visible || !c.geometry) continue;
          if (
            ((h = c.toJSON()),
            h.hasOwnProperty('popupTemplate') && delete h.popupTemplate,
            h.geometry && h.geometry.z && delete h.geometry.z,
            h.symbol && h.symbol.outline && 'esriCLS' === h.symbol.outline.type && !a.is11xService)
          )
            continue;
          !a.is11xService &&
            h.symbol &&
            h.symbol.outline &&
            h.symbol.outline.color &&
            h.symbol.outline.color[3] &&
            (h.symbol.outline.color[3] = 255);
          const p =
            e &&
            e.renderer &&
            (('valueExpression' in e.renderer && e.renderer.valueExpression) ||
              ('hasVisualVariables' in e.renderer && e.renderer.hasVisualVariables()));
          if (!h.symbol && e && e.renderer && p && !a.is11xService) {
            const t = e.renderer,
              r = await t.getSymbolAsync(c);
            if (!r) continue;
            (h.symbol = r.toJSON()),
              'hasVisualVariables' in t &&
                t.hasVisualVariables() &&
                te(h.symbol, { renderer: t, graphic: c, symbol: r });
          }
          if (
            (h.symbol &&
              (h.symbol.angle || delete h.symbol.angle,
              Qe(h.symbol)
                ? (h.symbol = await Be(h.symbol, a))
                : h.symbol.text && delete h.attributes),
            (!r || !r.forceFeatureAttributes) && d && d.length)
          ) {
            const e = {};
            d.forEach((t) => {
              h.attributes && h.attributes.hasOwnProperty(t) && (e[t] = h.attributes[t]);
            }),
              (h.attributes = e);
          }
          'polygon' === c.geometry.type
            ? n.featureSet.features.push(h)
            : 'polyline' === c.geometry.type
            ? s.featureSet.features.push(h)
            : 'point' === c.geometry.type
            ? h.symbol && h.symbol.text
              ? u.featureSet.features.push(h)
              : o.featureSet.features.push(h)
            : 'multipoint' === c.geometry.type
            ? l.featureSet.features.push(h)
            : 'extent' === c.geometry.type &&
              ((h.geometry = m.Z.fromExtent(c.geometry).toJSON()), n.featureSet.features.push(h));
        }
        const g = [n, s, l, o, u].filter((e) => e.featureSet.features.length > 0);
        for (const e of g) {
          const t = e.featureSet.features.every((e) => e.symbol);
          !t ||
            (r && r.forceFeatureAttributes) ||
            e.featureSet.features.forEach((e) => {
              delete e.attributes;
            }),
            t && delete e.layerDefinition.drawingInfo,
            e.layerDefinition.drawingInfo &&
              e.layerDefinition.drawingInfo.renderer &&
              (await Ke(e.layerDefinition.drawingInfo.renderer, a));
        }
        return g.length ? { featureCollection: { layers: g }, showLabels: i } : null;
      }
      async function Oe(e, t, r) {
        var a, i;
        let n;
        r.legendLayers && r.legendLayers.push({ id: e.id });
        const s = e.renderer;
        if (
          e.featureReduction ||
          (s && 'dot-density' === s.type && (!r.is11xService || parseFloat(r.cimVersion) < 2.6))
        )
          return je(e, t, r);
        const { layerView: o, printTemplate: l, view: u } = t,
          c =
            s &&
            (('valueExpression' in s && s.valueExpression) ||
              ('hasVisualVariables' in s && s.hasVisualVariables())),
          p =
            'feature-layer' !== (null == (a = e.source) ? void 0 : a.type) &&
            'ogc-feature' !== (null == (i = e.source) ? void 0 : i.type);
        if (
          (!r.is11xService && c) ||
          e.featureReduction ||
          p ||
          !s ||
          ('field' in s && null != s.field && ('string' != typeof s.field || !e.getField(s.field)))
        ) {
          const t = await We(o);
          n = await Fe(e, t, l, r);
        } else {
          var d, f;
          if (
            ((n = {
              id: (y = e.write()).id,
              title: y.title,
              opacity: y.opacity,
              minScale: y.minScale,
              maxScale: y.maxScale,
              url: y.url,
              layerDefinition: y.layerDefinition,
            }),
            (n.showLabels = l.showLabels && e.labelsVisible),
            Ze(n, e),
            null != (d = n.layerDefinition) &&
              null != (f = d.drawingInfo) &&
              f.renderer &&
              (delete n.layerDefinition.minScale,
              delete n.layerDefinition.maxScale,
              await Ke(n.layerDefinition.drawingInfo.renderer, r),
              'visualVariables' in s && s.visualVariables && s.visualVariables[0]))
          ) {
            const e = s.visualVariables[0];
            if (
              'size' === e.type &&
              e.maxSize &&
              'number' != typeof e.maxSize &&
              e.minSize &&
              'number' != typeof e.minSize
            ) {
              const t = (0, b.V3)(e, u.scale);
              (n.layerDefinition.drawingInfo.renderer.visualVariables[0].minSize = t.minSize),
                (n.layerDefinition.drawingInfo.renderer.visualVariables[0].maxSize = t.maxSize);
            }
          }
        }
        var y;
        return n;
      }
      async function Te(e, { layerView: t, printTemplate: r }, a) {
        return a.legendLayers && a.legendLayers.push({ id: e.id }), Fe(e, await We(t), r, a);
      }
      async function _e(e, { printTemplate: t }, r) {
        return Fe(e, null, t, r);
      }
      function Ne(e, t) {
        t.legendLayers && t.legendLayers.push({ id: e.id });
        const r = {
          bandIds: e.bandIds,
          compressionQuality: e.compressionQuality,
          format: e.format,
          interpolation: e.interpolation,
        };
        if (
          ((e.mosaicRule || e.definitionExpression) &&
            (r.mosaicRule = e.exportImageServiceParameters.mosaicRule.toJSON()),
          e.renderingRule || e.renderer)
        )
          if (t.is11xService)
            e.renderingRule && (r.renderingRule = e.renderingRule.toJSON()),
              e.renderer &&
                ((r.layerDefinition = r.layerDefinition || {}),
                (r.layerDefinition.drawingInfo = r.layerDefinition.drawingInfo || {}),
                (r.layerDefinition.drawingInfo.renderer = e.renderer.toJSON()));
          else {
            const t = e.exportImageServiceParameters.combineRendererWithRenderingRule();
            t && (r.renderingRule = t.toJSON());
          }
        return Ze(r, e), r;
      }
      async function ke(e, t, r) {
        const a = t.printTemplate;
        if (r.is11xService) {
          const t = { type: 'kml' };
          return (
            e.write(t, { origin: 'web-map' }), delete t.layerType, (t.url = (0, y.Fv)(e.url)), t
          );
        }
        {
          const i = [],
            n = t.layerView;
          n.allVisibleMapImages.forEach((t, r) => {
            const a = {
              id: `${e.id}_image${r}`,
              type: 'image',
              title: e.id,
              minScale: e.minScale || 0,
              maxScale: e.maxScale || 0,
              opacity: e.opacity,
              extent: t.extent,
            };
            'data:image/png;base64,' === t.href.substr(0, 22)
              ? (a.imageData = t.href.substr(22))
              : (a.url = t.href),
              i.push(a);
          });
          const s = [
              ...n.allVisiblePoints.items,
              ...n.allVisiblePolylines.items,
              ...n.allVisiblePolygons.items,
            ],
            o = { id: e.id, ...(await Fe(null, s, a, r)) };
          return i.push(o), i;
        }
      }
      function Je(e, { view: t }, r) {
        let a;
        const i = { id: e.id, subLayerIds: [] };
        let n = [];
        const s = t.scale,
          o = (e) => {
            const t = 0 === s,
              r = 0 === e.minScale || s <= e.minScale,
              a = 0 === e.maxScale || s >= e.maxScale;
            if (e.visible && (t || (r && a)))
              if (e.sublayers) e.sublayers.forEach(o);
              else {
                const t = e.toExportImageJSON(),
                  r = {
                    id: e.id,
                    name: e.title,
                    layerDefinition: {
                      drawingInfo: t.drawingInfo,
                      definitionExpression: t.definitionExpression,
                      source: t.source,
                    },
                  };
                n.unshift(r), i.subLayerIds.push(e.id);
              }
          };
        return (
          e.sublayers && e.sublayers.forEach(o),
          n.length &&
            ((n = n.map(({ id: e, name: t, layerDefinition: r }) => ({
              id: e,
              name: t,
              layerDefinition: r,
            }))),
            (a = {
              layers: n,
              visibleLayers: e.capabilities.exportMap.supportsDynamicLayers
                ? void 0
                : i.subLayerIds,
            }),
            Ze(a, e),
            r.legendLayers.push(i)),
          a
        );
      }
      async function Re({ layerView: e, printTemplate: t }, r) {
        const a = [],
          i = e.layer;
        if ((0, s.i)(i.featureCollections))
          for (const e of i.featureCollections) {
            const i = await Fe(e, e.source, t, r);
            i && a.push(...i.featureCollection.layers);
          }
        else if ((0, s.i)(i.sublayers))
          for (const e of i.sublayers) {
            const i = await Fe(null, e.graphics, t, r);
            i && a.push(...i.featureCollection.layers);
          }
        return { featureCollection: { layers: a } };
      }
      async function je(e, { printTemplate: t, view: r }, a) {
        const i = { type: 'image' },
          n = { format: 'png', ignoreBackground: !0, layers: [e], rotation: 0 },
          s = a.ssExtent || r.extent.clone();
        let o = 96,
          l = !0,
          u = !0;
        if (t.exportOptions) {
          const e = t.exportOptions;
          e.dpi > 0 && (o = e.dpi),
            e.width > 0 && (l = e.width % 2 == r.width % 2),
            e.height > 0 && (u = e.height % 2 == r.height % 2);
        }
        if (
          'map-only' === t.layout &&
          t.scalePreserved &&
          (!t.outScale || t.outScale === r.scale) &&
          96 === o &&
          (!l || !u) &&
          ((n.area = { x: 0, y: 0, width: r.width, height: r.height }),
          l || (n.area.width -= 1),
          u || (n.area.height -= 1),
          !a.ssExtent)
        ) {
          const e = r.toMap((0, f.c)(n.area.width, n.area.height));
          (s.ymin = e.y), (s.xmax = e.x), (a.ssExtent = s);
        }
        i.extent = s.clone()._normalize(!0).toJSON();
        const c = await r.takeScreenshot(n),
          { data: p } = (0, y.sJ)(c.dataUrl);
        return (i.imageData = p), i;
      }
      async function Ee(e, { layerView: t, printTemplate: r }, a) {
        return a.legendLayers && a.legendLayers.push({ id: e.id }), Fe(e, await We(t), r, a);
      }
      function ze(e) {
        const t = { customParameters: e.customParameters };
        return Ze(t, e), t;
      }
      async function Ue(e, t, r) {
        if (r.is11xService && e.serviceUrl && e.styleUrl) {
          const t = c.id && c.id.findCredential(e.styleUrl),
            a = c.id && c.id.findCredential(e.serviceUrl);
          if ((!t && !a) || '2.1.0' !== r.cimVersion) {
            const r = { type: 'VectorTileLayer' };
            return (
              (r.styleUrl = (0, y.Fv)(e.styleUrl)),
              t && (r.token = t.token),
              a &&
                a.token !== r.token &&
                (r.additionalTokens = [{ url: e.serviceUrl, token: a.token }]),
              r
            );
          }
        }
        return je(e, t, r);
      }
      function Ae(e) {
        const t = {
          type: 'WebTiledLayer',
          urlTemplate: e.urlTemplate.replace(/\${/g, '{'),
          credits: e.copyright,
        };
        return e.subDomains && e.subDomains.length > 0 && (t.subDomains = e.subDomains), t;
      }
      function qe(e) {
        let t;
        const r = [],
          a = (e) => {
            e.visible && (e.sublayers ? e.sublayers.forEach(a) : e.name && r.unshift(e.name));
          };
        return (
          e.sublayers && e.sublayers.forEach(a),
          r.length &&
            (t = {
              type: 'wms',
              customLayerParameters: e.customLayerParameters,
              customParameters: e.customParameters,
              transparentBackground: e.imageTransparency,
              visibleLayers: r,
              url: (0, y.Fv)(e.url),
              version: e.version,
            }),
          t
        );
      }
      function $e(e) {
        const t = e.activeLayer;
        return {
          type: 'wmts',
          customLayerParameters: e.customLayerParameters,
          customParameters: e.customParameters,
          format: t.imageFormat,
          layer: t.id,
          style: t.styleId,
          tileMatrixSet: t.tileMatrixSetId,
          url: (0, y.Fv)(e.url),
        };
      }
      function Ze(e, t) {
        if (t.url)
          if (((e.url = (0, y.Fv)(e.url || t.url)), 'apiKey' in t && t.apiKey)) e.token = t.apiKey;
          else if (u.Z.apiKey && (0, p.s)(t.url)) e.token = u.Z.apiKey;
          else {
            var r, a;
            e.token =
              null == (r = c.id) || null == (a = r.findCredential(t.url)) ? void 0 : a.token;
          }
      }
      async function Be(e, t) {
        t.canvas || (t.canvas = document.createElement('canvas'));
        const r = 1024;
        (t.canvas.width = r), (t.canvas.height = r);
        const a = t.canvas.getContext('2d');
        let i, n;
        if (e.path) {
          var s;
          const t = new Path2D(e.path);
          t.closePath(),
            (a.fillStyle = Array.isArray(e.color)
              ? `rgba(${e.color[0]},${e.color[1]},${e.color[2]},${e.color[3] / 255})`
              : 'rgb(0,0,0)'),
            a.fill(t);
          const o = (function (e, t = 15) {
            const r = e.canvas.width,
              a = e.canvas.height,
              i = e.getImageData(0, 0, r, a).data;
            let n, s, o, l, u, c;
            e: for (s = a; s--; )
              for (n = r; n--; )
                if (i[4 * (r * s + n) + 3] > t) {
                  c = s;
                  break e;
                }
            if (!c) return null;
            e: for (n = r; n--; )
              for (s = c + 1; s--; )
                if (i[4 * (r * s + n) + 3] > t) {
                  u = n;
                  break e;
                }
            e: for (n = 0; n <= u; ++n)
              for (s = c + 1; s--; )
                if (i[4 * (r * s + n) + 3] > t) {
                  o = n;
                  break e;
                }
            e: for (s = 0; s <= c; ++s)
              for (n = o; n <= u; ++n)
                if (i[4 * (r * s + n) + 3] > t) {
                  l = s;
                  break e;
                }
            return { x: o, y: l, width: u - o, height: c - l };
          })(a);
          if (!o) return null;
          a.clearRect(0, 0, r, r);
          const l = (0, f.a)(e.size) / Math.max(o.width, o.height);
          a.scale(l, l);
          const u = r / l,
            c = u / 2 - o.width / 2 - o.x,
            p = u / 2 - o.height / 2 - o.y;
          if (
            (a.translate(c, p),
            Array.isArray(e.color) && a.fill(t),
            null != (s = e.outline) && s.width && Array.isArray(e.outline.color))
          ) {
            const r = e.outline;
            (a.lineWidth = (0, f.a)(r.width) / l),
              (a.lineJoin = 'round'),
              (a.strokeStyle = `rgba(${r.color[0]},${r.color[1]},${r.color[2]},${
                r.color[3] / 255
              })`),
              a.stroke(t),
              (o.width += a.lineWidth),
              (o.height += a.lineWidth);
          }
          (o.width *= l), (o.height *= l);
          const d = a.getImageData(
            512 - o.width / 2,
            512 - o.height / 2,
            Math.ceil(o.width),
            Math.ceil(o.height),
          );
          (i = d.width),
            (n = d.height),
            (a.canvas.width = i),
            (a.canvas.height = n),
            a.putImageData(d, 0, 0);
        } else {
          const t =
              'image/svg+xml' === e.contentType
                ? 'data:image/svg+xml;base64,' + e.imageData
                : e.url,
            r = (await (0, p.default)(t, { responseType: 'image' })).data;
          (i = (0, f.a)(e.width)),
            (n = (0, f.a)(e.height)),
            (a.canvas.width = i),
            (a.canvas.height = n),
            a.drawImage(r, 0, 0, a.canvas.width, a.canvas.height);
        }
        return {
          type: 'esriPMS',
          imageData: a.canvas.toDataURL('image/png').substr(22),
          angle: e.angle,
          contentType: 'image/png',
          height: (0, f.p)(n),
          width: (0, f.p)(i),
          xoffset: e.xoffset,
          yoffset: e.yoffset,
        };
      }
      async function Ke(e, t) {
        const r = e.type;
        if ('simple' === r && Qe(e.symbol)) e.symbol = await Be(e.symbol, t);
        else if ('uniqueValue' === r || 'classBreaks' === r) {
          Qe(e.defaultSymbol) && (e.defaultSymbol = await Be(e.defaultSymbol, t));
          const a = e['uniqueValue' === r ? 'uniqueValueInfos' : 'classBreakInfos'];
          if (a) for (const e of a) Qe(e.symbol) && (e.symbol = await Be(e.symbol, t));
        }
      }
      async function We(e) {
        return e.queryFeatures(Ve).then((e) => e.features);
      }
      function Qe(e) {
        return (
          e && (e.path || 'image/svg+xml' === e.contentType || (e.url && e.url.endsWith('.svg')))
        );
      }
      var Ye = r(658);
      const He = new i.J({
        esriExecutionTypeSynchronous: 'sync',
        esriExecutionTypeAsynchronous: 'async',
      });
      let Xe = class extends Ye.Z {
        constructor(...e) {
          super(...e), (this._gpMetadata = null), (this.updateDelay = 1e3);
        }
        get mode() {
          return this._gpMetadata && this._gpMetadata.executionType
            ? He.fromJSON(this._gpMetadata.executionType)
            : 'sync';
        }
        execute(e, t) {
          return (
            e && (e.updateDelay = this.updateDelay),
            De(this.url, e, { ...this.requestOptions, ...t })
          );
        }
        async _getGpPrintParams(e) {
          const t = Me(this.url);
          return Ie(e, Pe.get(t));
        }
      };
      (0, a._)([(0, n.Cb)()], Xe.prototype, '_gpMetadata', void 0),
        (0, a._)([(0, n.Cb)({ readOnly: !0 })], Xe.prototype, 'mode', null),
        (0, a._)([(0, n.Cb)()], Xe.prototype, 'updateDelay', void 0),
        (Xe = (0, a._)([(0, l.j)('esri.tasks.PrintTask')], Xe));
      const et = Xe;
    },
  },
]);
