(self.webpackChunkRemoteClient = self.webpackChunkRemoteClient || []).push([
  [1151, 9214],
  {
    59765: (e, t, s) => {
      'use strict';
      s.d(t, { Z: () => d, t: () => u });
      var i = s(29768),
        r = s(74673),
        n = s(35197),
        o = s(34250),
        a = (s(76506), s(91306), s(92143), s(17533)),
        l = s(57251);
      s(21972),
        s(23639),
        s(86656),
        s(22723),
        s(91055),
        s(27794),
        s(6906),
        s(50406),
        s(60991),
        s(81172),
        s(71552),
        s(31450),
        s(40642),
        s(26341);
      const u = (0, l.s)()({
        esriTimeUnitsMilliseconds: 'milliseconds',
        esriTimeUnitsSeconds: 'seconds',
        esriTimeUnitsMinutes: 'minutes',
        esriTimeUnitsHours: 'hours',
        esriTimeUnitsDays: 'days',
        esriTimeUnitsWeeks: 'weeks',
        esriTimeUnitsMonths: 'months',
        esriTimeUnitsYears: 'years',
        esriTimeUnitsDecades: 'decades',
        esriTimeUnitsCenturies: 'centuries',
        esriTimeUnitsUnknown: void 0,
      });
      var h;
      let c = (h = class extends r.a {
        constructor(e) {
          super(e), (this.value = 0), (this.unit = 'milliseconds');
        }
        toMilliseconds() {
          return (0, n.c)(this.value, this.unit, 'milliseconds');
        }
        clone() {
          return new h({ value: this.value, unit: this.unit });
        }
      });
      (0, i._)(
        [(0, o.Cb)({ type: Number, json: { write: !0 }, nonNullable: !0 })],
        c.prototype,
        'value',
        void 0,
      ),
        (0, i._)(
          [
            (0, o.Cb)({
              type: u.apiValues,
              json: { type: u.jsonValues, read: u.read, write: u.write },
              nonNullable: !0,
            }),
          ],
          c.prototype,
          'unit',
          void 0,
        ),
        (c = h = (0, i._)([(0, a.j)('esri.TimeInterval')], c));
      const d = c;
    },
    31151: (e, t, s) => {
      'use strict';
      s.r(t), s.d(t, { FeatureServiceSnappingSourceWorker: () => Y, default: () => H });
      var i = s(29768),
        r = s(76996),
        n = s(82933),
        o = s(76506),
        a = s(50406),
        l = s(617),
        u = s(34250),
        h = (s(91306), s(92143)),
        c = s(17533),
        d = s(60947),
        p = s(56761),
        f = s(50815),
        g = s(43352),
        y = s(77361),
        m = s(31292),
        _ = s(27794),
        b = s(21972),
        v = s(95873),
        x = s(22723),
        w = s(21801),
        I = s(92482),
        S = s(40267),
        F = s(76733),
        T = s(49214),
        C = s(41864);
      function k(e) {
        return 32 + e.length;
      }
      function B(e, t) {
        return 32 + e.length * t;
      }
      s(15324),
        s(91055),
        s(6906),
        s(60991),
        s(81172),
        s(71552),
        s(31450),
        s(40642),
        s(86656),
        s(23639),
        s(74673),
        s(26341),
        s(2906),
        s(53326),
        s(88994),
        s(98576),
        s(44722),
        s(91700),
        s(53785),
        s(57251),
        s(95587),
        s(89623),
        s(98380),
        s(32422),
        s(73796),
        s(97714),
        s(84069),
        s(91597),
        s(86787),
        s(35132),
        s(44567),
        s(92896),
        s(95533),
        s(94751),
        s(74569),
        s(22781),
        s(82058),
        s(88762),
        s(32101),
        s(30831),
        s(72274),
        s(5777),
        s(24251),
        s(72334),
        s(82426),
        s(65775),
        s(12381),
        s(73173),
        s(92624),
        s(77314),
        s(89219),
        s(71435),
        s(19124),
        s(14249),
        s(9801),
        s(53523),
        s(59465),
        s(42911),
        s(46826),
        s(45433),
        s(60217),
        s(7176),
        s(14172),
        s(20438),
        s(40705),
        s(60599),
        s(10401),
        s(22739),
        s(20543),
        s(91162),
        s(49900),
        s(66284),
        s(33921),
        s(3482),
        s(67477),
        s(78533),
        s(74653),
        s(91091),
        s(58943),
        s(56420),
        s(74742),
        s(28239),
        s(88610),
        s(92817),
        s(93314),
        s(35197),
        s(59765),
        s(69218),
        s(97546),
        s(54732),
        s(27207),
        s(11385),
        s(55823),
        s(92847);
      let M = class extends b.Z {
        constructor() {
          super(...arguments), (this.updating = !1), (this.pending = []);
        }
        push(e, t) {
          this.pending.push({ promise: e, callback: t }),
            1 === this.pending.length && this.process();
        }
        process() {
          if (!this.pending.length) return void (this.updating = !1);
          this.updating = !0;
          const e = this.pending[0];
          e.promise
            .then((t) => e.callback(t))
            .catch(() => {})
            .then(() => {
              this.pending.shift(), this.process();
            });
        }
      };
      (0, i._)([(0, u.Cb)()], M.prototype, 'updating', void 0),
        (M = (0, i._)([(0, c.j)('esri.core.AsyncSequence')], M));
      class E {
        constructor(e, t) {
          (this.data = e), (this.resolution = t), (this.state = { type: 0 }), (this.alive = !0);
        }
        process(e) {
          switch (this.state.type) {
            case 0:
              return (
                (this.state = this.gotoFetchCount(this.state, e)),
                this.state.task.promise.then(e.resume, e.resume)
              );
            case 1:
              break;
            case 2:
              return (
                (this.state = this.gotoFetchFeatures(this.state, e)),
                this.state.task.promise.then(e.resume, e.resume)
              );
            case 3:
              break;
            case 4:
              this.state = this.goToDone(this.state, e);
          }
          return null;
        }
        get debugInfo() {
          return { data: this.data, featureCount: this.featureCount, state: this.stateToString };
        }
        get featureCount() {
          switch (this.state.type) {
            case 0:
            case 1:
              return 0;
            case 2:
              return this.state.featureCount;
            case 3:
              return this.state.previous.featureCount;
            case 4:
              return this.state.features.length;
            case 5:
              return this.state.previous.features.length;
          }
        }
        get stateToString() {
          switch (this.state.type) {
            case 0:
              return 'created';
            case 1:
              return 'fetch-count';
            case 2:
              return 'fetched-count';
            case 3:
              return 'fetch-features';
            case 4:
              return 'fetched-features';
            case 5:
              return 'done';
          }
        }
        gotoFetchCount(e, t) {
          return {
            type: 1,
            previous: e,
            task: (0, a.vr)(async (e) => {
              const s = await (0, C.a)(t.fetchCount(this, e));
              1 === this.state.type &&
                (this.state = this.gotoFetchedCount(this.state, s.ok ? s.value : 1 / 0));
            }),
          };
        }
        gotoFetchedCount(e, t) {
          return { type: 2, featureCount: t, previous: e };
        }
        gotoFetchFeatures(e, t) {
          return {
            type: 3,
            previous: e,
            task: (0, a.vr)(async (s) => {
              const i = await (0, C.a)(t.fetchFeatures(this, e.featureCount, s));
              3 === this.state.type &&
                (this.state = this.gotoFetchedFeatures(this.state, i.ok ? i.value : []));
            }),
          };
        }
        gotoFetchedFeatures(e, t) {
          return { type: 4, previous: e, features: t };
        }
        goToDone(e, t) {
          return t.finish(this, e.features), { type: 5, previous: e };
        }
        reset() {
          const e = this.state;
          switch (((this.state = { type: 0 }), e.type)) {
            case 0:
            case 2:
            case 4:
            case 5:
              break;
            case 1:
            case 3:
              e.task.abort();
          }
        }
        intersects(e) {
          return (
            !(!(0, o.b)(e) && this.data.extent) || ((0, I.p)(e, O), (0, I.d)(this.data.extent, O))
          );
        }
      }
      const O = (0, I.a)(),
        P = h.L.getLogger(
          'esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTiledFetcher',
        );
      let R = class extends v.r {
        constructor(e) {
          super(e),
            (this.tilesOfInterest = []),
            (this.availability = 0),
            (this.pendingTiles = new Map()),
            (this.pendingEdits = new M()),
            (this.pendingEditsAbortController = (0, a.yi)());
        }
        get minimumVerticesPerFeature() {
          var e;
          switch (null == (e = this.store) ? void 0 : e.featureStore.geometryType) {
            case 'esriGeometryPoint':
            case 'esriGeometryMultipoint':
              return 1;
            case 'esriGeometryPolygon':
              return 4;
            case 'esriGeometryPolyline':
              return 2;
          }
        }
        set filter(e) {
          const t = this._get('filter'),
            s = this.filterProperties(e);
          JSON.stringify(t) !== JSON.stringify(s) && this._set('filter', s);
        }
        set customParameters(e) {
          const t = this._get('customParameters');
          JSON.stringify(t) !== JSON.stringify(e) && this._set('customParameters', e);
        }
        get configuration() {
          return {
            filter: this.filter,
            customParameters: this.customParameters,
            tileInfo: this.tileInfo,
            tileSize: this.tileSize,
          };
        }
        set tileInfo(e) {
          const t = this._get('tileInfo');
          t !== e &&
            (((0, o.i)(e) && (0, o.i)(t) && JSON.stringify(e) === JSON.stringify(t)) ||
              (this._set('tileInfo', e), (this.store.tileInfo = e)));
        }
        set tileSize(e) {
          this._get('tileSize') !== e && this._set('tileSize', e);
        }
        get updating() {
          return this.updatingHandles.updating || this.pendingEdits.updating;
        }
        initialize() {
          this.initializeFetchExtent(),
            this.updatingHandles.add(this, 'configuration', () => this.refresh()),
            this.updatingHandles.add(
              this,
              'tilesOfInterest',
              (e, t) => {
                (0, _.e)(e, t, ({ id: e }, { id: t }) => e === t) || this.process();
              },
              1,
            );
        }
        destroy() {
          this.pendingTiles.forEach((e) => this.deletePendingTile(e)),
            this.pendingTiles.clear(),
            this.store.destroy(),
            (this.tilesOfInterest.length = 0),
            this.pendingEditsAbortController.abort(),
            (this.pendingEditsAbortController = null);
        }
        refresh() {
          this.store.refresh(),
            this.pendingTiles.forEach((e) => this.deletePendingTile(e)),
            this.process();
        }
        applyEdits(e) {
          this.pendingEdits.push(e, async (e) => {
            if (
              0 === e.addedFeatures.length &&
              0 === e.updatedFeatures.length &&
              0 === e.deletedFeatures.length
            )
              return;
            for (const [, e] of this.pendingTiles) e.reset();
            const t = {
              ...e,
              deletedFeatures: e.deletedFeatures.map(({ objectId: e, globalId: t }) =>
                e && -1 !== e ? e : this.lookupObjectIdByGlobalId(t),
              ),
            };
            await this.updatingHandles.addPromise(
              this.store.processEdits(
                t,
                (e, t) => this.queryFeaturesById(e, t),
                this.pendingEditsAbortController.signal,
              ),
            ),
              this.processPendingTiles();
          });
        }
        initializeFetchExtent() {
          if (!this.capabilities.query.supportsExtent) return;
          const e = (0, a.vr)(async (e) => {
            try {
              var t;
              const s = await (0, T.a)(
                this.url,
                new m.Z({
                  where: '1=1',
                  outSpatialReference: this.spatialReference,
                  cacheHint: !!this.capabilities.query.supportsCacheHint || void 0,
                }),
                { query: this.configuration.customParameters, signal: e },
              );
              this.store.extent = w.Z.fromJSON(null == (t = s.data) ? void 0 : t.extent);
            } catch (e) {
              (0, a.r9)(e), P.warn('Failed to fetch data extent', e);
            }
          });
          this.updatingHandles.addPromise(e.promise.then(() => this.process())),
            this.handles.add((0, x.m)(() => e.abort()));
        }
        get debugInfo() {
          return {
            numberOfFeatures: this.store.featureStore.numFeatures,
            tilesOfInterest: this.tilesOfInterest,
            pendingTiles: Array.from(this.pendingTiles.values()).map((e) => e.debugInfo),
            storedTiles: this.store.debugInfo,
          };
        }
        process() {
          this.markTilesNotAlive(),
            this.createPendingTiles(),
            this.deletePendingTiles(),
            this.processPendingTiles();
        }
        markTilesNotAlive() {
          for (const [, e] of this.pendingTiles) e.alive = !1;
        }
        createPendingTiles() {
          const e = this.collectMissingTilesInfo();
          if ((this.setAvailability((0, o.b)(e) ? 1 : e.coveredArea / e.fullArea), !(0, o.b)(e)))
            for (const { data: t, resolution: s } of e.missingTiles) {
              const e = this.pendingTiles.get(t.id);
              e ? ((e.resolution = s), (e.alive = !0)) : this.createPendingTile(t, s);
            }
        }
        collectMissingTilesInfo() {
          let e = null;
          for (let t = this.tilesOfInterest.length - 1; t >= 0; t--) {
            const s = this.tilesOfInterest[t],
              i = this.store.process(s, (e, t) => this.verifyTileComplexity(e, t));
            (0, o.b)(e) ? (e = i) : e.prepend(i);
          }
          return e;
        }
        deletePendingTiles() {
          for (const [, e] of this.pendingTiles) e.alive || this.deletePendingTile(e);
        }
        processPendingTiles() {
          const e = {
            fetchCount: (e, t) => this.fetchCount(e, t),
            fetchFeatures: (e, t, s) => this.fetchFeatures(e, t, s),
            finish: (e, t) => this.finishPendingTile(e, t),
            resume: () => this.processPendingTiles(),
          };
          if (this.ensureFetchAllCounts(e))
            for (const [, t] of this.pendingTiles)
              this.verifyTileComplexity(this.store.getFeatureCount(t.data), t.resolution) &&
                this.updatingHandles.addPromise(t.process(e));
        }
        verifyTileComplexity(e, t) {
          return this.verifyVertexComplexity(e) && this.verifyFeatureDensity(e, t);
        }
        verifyVertexComplexity(e) {
          return e * this.minimumVerticesPerFeature < z;
        }
        verifyFeatureDensity(e, t) {
          if ((0, o.b)(this.tileInfo)) return !1;
          const s = this.tileSize * t;
          return e * (q / (s * s)) < D;
        }
        ensureFetchAllCounts(e) {
          let t = !0;
          for (const [, s] of this.pendingTiles)
            s.state.type < 2 && this.updatingHandles.addPromise(s.process(e)),
              s.state.type <= 1 && (t = !1);
          return t;
        }
        finishPendingTile(e, t) {
          this.store.add(e.data, t), this.deletePendingTile(e), this.updateAvailability();
        }
        updateAvailability() {
          const e = this.collectMissingTilesInfo();
          this.setAvailability((0, o.b)(e) ? 1 : e.coveredArea / e.fullArea);
        }
        setAvailability(e) {
          this._set('availability', e);
        }
        createPendingTile(e, t) {
          const s = new E(e, t);
          return this.pendingTiles.set(e.id, s), s;
        }
        deletePendingTile(e) {
          e.reset(), this.pendingTiles.delete(e.data.id);
        }
        async fetchCount(e, t) {
          return this.store.fetchCount(e.data, this.url, this.createCountQuery(e), {
            query: this.customParameters,
            timeout: A,
            signal: t,
          });
        }
        async fetchFeatures(e, t, s) {
          let i,
            r = 0,
            n = 0,
            a = t;
          for (;;) {
            const l = this.createFeaturesQuery(e),
              u = this.setPagingParameters(l, r, a),
              { features: h, exceededTransferLimit: c } = await this.queryFeatures(l, s);
            if (
              (u && (r += (0, o.u)(l.num)),
              (n += h.length),
              (i = i ? i.concat(h) : h),
              (a = t - n),
              !u || !c || a <= 0)
            )
              return i;
          }
        }
        filterProperties(e) {
          return (0, o.b)(e)
            ? { where: '1=1', gdbVersion: void 0, timeExtent: void 0 }
            : { where: e.where || '1=1', timeExtent: e.timeExtent, gdbVersion: e.gdbVersion };
        }
        lookupObjectIdByGlobalId(e) {
          const t = this.globalIdField,
            s = this.objectIdField;
          if ((0, o.b)(t)) throw new Error('Expected globalIdField to be defined');
          let i = null;
          if (
            (this.store.featureStore.forEach((r) => {
              var n;
              e === r.attributes[t] && (i = null != (n = r.objectId) ? n : r.attributes[s]);
            }),
            (0, o.b)(i))
          )
            throw new Error(`Expected to find a feature with globalId ${e}`);
          return i;
        }
        queryFeaturesById(e, t) {
          const s = this.createFeaturesQuery(null);
          return (s.objectIds = e), this.queryFeatures(s, t);
        }
        queryFeatures(e, t) {
          return this.capabilities.query.supportsFormatPBF
            ? this.queryFeaturesPBF(e, t)
            : this.queryFeaturesJSON(e, t);
        }
        async queryFeaturesPBF(e, t) {
          const { sourceSpatialReference: s } = this,
            { data: i } = await (0, T.d)(this.url, e, new F.O({ sourceSpatialReference: s }), {
              query: this.configuration.customParameters,
              timeout: A,
              signal: t,
            });
          return (0, S.l)(i);
        }
        async queryFeaturesJSON(e, t) {
          const { sourceSpatialReference: s } = this,
            { data: i } = await (0, T.c)(this.url, e, s, {
              query: this.configuration.customParameters,
              timeout: A,
              signal: t,
            });
          return (0, S.m)(i, this.objectIdField);
        }
        createCountQuery(e) {
          const t = this.createBaseQuery(e);
          return this.capabilities.query.supportsCacheHint && (t.cacheHint = !0), t;
        }
        createFeaturesQuery(e) {
          const t = this.createBaseQuery(e);
          return (
            (t.outFields = this.globalIdField
              ? [this.globalIdField, this.objectIdField]
              : [this.objectIdField]),
            (t.returnGeometry = !0),
            (0, o.i)(e) &&
              (this.capabilities.query.supportsResultType
                ? (t.resultType = 'tile')
                : this.capabilities.query.supportsCacheHint && (t.cacheHint = !0)),
            t
          );
        }
        createBaseQuery(e) {
          const t = new m.Z({
              returnZ: !1,
              returnM: !1,
              geometry:
                (0, o.i)(this.tileInfo) && (0, o.i)(e)
                  ? (0, I.t)(e.data.extent, this.tileInfo.spatialReference)
                  : void 0,
            }),
            s = this.configuration.filter;
          return (
            (0, o.i)(s) &&
              ((t.where = s.where), (t.gdbVersion = s.gdbVersion), (t.timeExtent = s.timeExtent)),
            (t.outSpatialReference = this.spatialReference),
            t
          );
        }
        setPagingParameters(e, t, s) {
          if (!this.capabilities.query.supportsPagination) return !1;
          const {
              supportsMaxRecordCountFactor: i,
              supportsCacheHint: r,
              tileMaxRecordCount: n,
              maxRecordCount: o,
              supportsResultType: a,
            } = this.capabilities.query,
            l = i ? m.Z.MAX_MAX_RECORD_COUNT_FACTOR : 1,
            u = l * ((a || r) && n ? n : o || j);
          return (
            (e.start = t),
            i
              ? ((e.maxRecordCountFactor = Math.min(l, Math.ceil(s / u))),
                (e.num = Math.min(s, e.maxRecordCountFactor * u)))
              : (e.num = Math.min(s, u)),
            !0
          );
        }
      };
      (0, i._)([(0, u.Cb)({ constructOnly: !0 })], R.prototype, 'url', void 0),
        (0, i._)([(0, u.Cb)({ constructOnly: !0 })], R.prototype, 'objectIdField', void 0),
        (0, i._)([(0, u.Cb)({ constructOnly: !0 })], R.prototype, 'globalIdField', void 0),
        (0, i._)([(0, u.Cb)({ constructOnly: !0 })], R.prototype, 'capabilities', void 0),
        (0, i._)([(0, u.Cb)({ constructOnly: !0 })], R.prototype, 'sourceSpatialReference', void 0),
        (0, i._)([(0, u.Cb)({ constructOnly: !0 })], R.prototype, 'spatialReference', void 0),
        (0, i._)([(0, u.Cb)({ constructOnly: !0 })], R.prototype, 'store', void 0),
        (0, i._)([(0, u.Cb)({ readOnly: !0 })], R.prototype, 'minimumVerticesPerFeature', null),
        (0, i._)([(0, u.Cb)()], R.prototype, 'filter', null),
        (0, i._)([(0, u.Cb)()], R.prototype, 'customParameters', null),
        (0, i._)([(0, u.Cb)({ readOnly: !0 })], R.prototype, 'configuration', null),
        (0, i._)([(0, u.Cb)()], R.prototype, 'tileInfo', null),
        (0, i._)([(0, u.Cb)()], R.prototype, 'tileSize', null),
        (0, i._)([(0, u.Cb)()], R.prototype, 'tilesOfInterest', void 0),
        (0, i._)([(0, u.Cb)({ readOnly: !0 })], R.prototype, 'updating', null),
        (0, i._)([(0, u.Cb)({ readOnly: !0 })], R.prototype, 'availability', void 0),
        (R = (0, i._)(
          [
            (0, c.j)(
              'esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTiledFetcher',
            ),
          ],
          R,
        ));
      const j = 2e3,
        A = 6e5,
        z = 1e6,
        q = 25,
        D = 1;
      class N {
        constructor() {
          (this._store = new Map()), (this._byteSize = 0);
        }
        set(e, t) {
          this.delete(e), this._store.set(e, t), (this._byteSize += t.byteSize);
        }
        delete(e) {
          const t = this._store.get(e);
          return !!this._store.delete(e) && ((this._byteSize -= t.byteSize), !0);
        }
        get(e) {
          return this.used(e), this._store.get(e);
        }
        has(e) {
          return this.used(e), this._store.has(e);
        }
        clear() {
          this._store.clear();
        }
        applyByteSizeLimit(e, t) {
          for (const [s, i] of this._store) {
            if (this._byteSize <= e) break;
            this.delete(s), t(i);
          }
        }
        values() {
          return this._store.values();
        }
        [Symbol.iterator]() {
          return this._store[Symbol.iterator]();
        }
        used(e) {
          const t = this._store.get(e);
          t && (this._store.delete(e), this._store.set(e, t));
        }
      }
      let L = class extends b.Z {
        constructor(e) {
          super(e),
            (this.tileInfo = null),
            (this.extent = null),
            (this.maximumByteSize = 10485760),
            (this.tileBounds = new p.B()),
            (this.tiles = new N()),
            (this.refCounts = new Map()),
            (this.tileFeatureCounts = new Map()),
            (this.tmpBoundingRect = (0, I.a)());
        }
        add(e, t) {
          const s = [];
          for (const e of t) 0 === this.referenceFeature(e.objectId) && s.push(e);
          this.addTileStorage(
            e,
            new Set(t.map(({ objectId: e }) => e)),
            this.byteSizeOfFeatures(t),
          ),
            this.featureStore.addMany(s),
            this.tiles.applyByteSizeLimit(this.maximumByteSize, (e) => this.removeTileStorage(e));
        }
        destroy() {
          this.clear(), this.tileFeatureCounts.clear();
        }
        clear() {
          this.featureStore.clear(),
            this.tileBounds.clear(),
            this.tiles.clear(),
            this.refCounts.clear();
        }
        refresh() {
          this.clear(), this.tileFeatureCounts.clear();
        }
        processEdits(e, t, s) {
          return (
            this.processEditsDelete(e.deletedFeatures.concat(e.updatedFeatures)),
            this.processEditsRefetch(e.addedFeatures.concat(e.updatedFeatures), t, s)
          );
        }
        addTileStorage(e, t, s) {
          this.tiles.set(e.id, new G(e, t, s)),
            this.tileBounds.set(e.id, e.extent),
            this.tileFeatureCounts.set(e.id, t.size);
        }
        remove({ id: e }) {
          const t = this.tiles.get(e);
          t && this.removeTileStorage(t);
        }
        removeTileStorage(e) {
          const t = [];
          for (const s of e.objectIds) 1 === this.unreferenceFeature(s) && t.push(s);
          this.featureStore.removeManyById(t);
          const s = e.data.id;
          this.tiles.delete(s), this.tileBounds.delete(s);
        }
        processEditsDelete(e) {
          this.featureStore.removeManyById(e);
          for (const [, t] of this.tiles) {
            for (const s of e) t.objectIds.delete(s);
            this.tileFeatureCounts.set(t.data.id, t.objectIds.size);
          }
          for (const t of e) this.refCounts.delete(t);
        }
        async processEditsRefetch(e, t, s) {
          const i = (await t(e, s)).features,
            { hasZ: r, hasM: n } = this.featureStore;
          for (const e of i) {
            const t = (0, S.g)(this.tmpBoundingRect, e.geometry, r, n);
            this.tileBounds.forEachInBounds(t, (t) => {
              const s = this.tiles.get(t);
              this.featureStore.add(e),
                s.objectIds.has(e.objectId) ||
                  (s.objectIds.add(e.objectId),
                  this.referenceFeature(e.objectId),
                  this.tileFeatureCounts.set(s.data.id, s.objectIds.size));
            });
          }
        }
        process(e, t = () => !0) {
          if (
            (0, o.b)(this.tileInfo) ||
            !e.extent ||
            ((0, o.i)(this.extent) &&
              !(0, I.d)((0, I.p)(this.extent, this.tmpBoundingRect), e.extent))
          )
            return new U(e);
          if (this.tiles.has(e.id)) return new U(e);
          const s = this.createTileTree(e, this.tileInfo);
          return this.simplify(s, t, null, 0, 1), this.collectMissingTiles(e, s, this.tileInfo);
        }
        get debugInfo() {
          return Array.from(this.tiles.values()).map(({ data: e }) => ({
            data: e,
            featureCount: this.tileFeatureCounts.get(e.id) || 0,
          }));
        }
        getFeatureCount(e) {
          const t = this.tileFeatureCounts.get(e.id);
          return null != t ? t : 0;
        }
        async fetchCount(e, t, s, i) {
          const r = this.tileFeatureCounts.get(e.id);
          if (null != r) return r;
          const n = await (0, T.e)(t, s, i);
          return this.tileFeatureCounts.set(e.id, n.data.count), n.data.count;
        }
        createTileTree(e, t) {
          const s = new V(e.level, e.row, e.col);
          return (
            t.updateTileInfo(s, 1),
            this.tileBounds.forEachInBounds(e.extent, (i) => {
              const r = this.tiles.get(i).data;
              this.tilesAreRelated(e, r) &&
                this.populateChildren(s, r, t, this.tileFeatureCounts.get(r.id) || 0);
            }),
            s
          );
        }
        tilesAreRelated(e, t) {
          if (!e || !t) return !1;
          if (e.level === t.level) return e.row === t.row && e.col === t.col;
          const s = e.level < t.level,
            i = s ? e : t,
            r = s ? t : e,
            n = 1 << (r.level - i.level);
          return Math.floor(r.row / n) === i.row && Math.floor(r.col / n) === i.col;
        }
        populateChildren(e, t, s, i) {
          const r = t.level - e.level - 1;
          if (r < 0) return void (e.isLeaf = !0);
          const n = t.row >> r,
            a = t.col >> r,
            l = e.row << 1,
            u = a - (e.col << 1) + ((n - l) << 1),
            h = e.children[u];
          if ((0, o.i)(h)) this.populateChildren(h, t, s, i);
          else {
            const r = new V(e.level + 1, n, a);
            s.updateTileInfo(r, 1), (e.children[u] = r), this.populateChildren(r, t, s, i);
          }
        }
        simplify(e, t, s, i, r) {
          const n = r * r;
          if (e.isLeaf)
            return t(this.getFeatureCount(e), r)
              ? 0
              : (this.remove(e), (0, o.i)(s) && (s.children[i] = null), n);
          const a = r / 2,
            l = a * a;
          let u = 0;
          for (let s = 0; s < e.children.length; s++) {
            const i = e.children[s];
            u += (0, o.i)(i) ? this.simplify(i, t, e, s, a) : l;
          }
          return (
            0 === u
              ? this.mergeChildren(e)
              : 1 - u / n < X && (this.purge(e), (0, o.i)(s) && (s.children[i] = null), (u = n)),
            u
          );
        }
        mergeChildren(e) {
          const t = new Set();
          let s = 0;
          this.forEachLeaf(e, (e) => {
            const i = this.tiles.get(e.id);
            if (i) {
              s += i.byteSize;
              for (const e of i.objectIds) t.has(e) || (t.add(e), this.referenceFeature(e));
              this.remove(e);
            }
          }),
            this.addTileStorage(e, t, s),
            (e.isLeaf = !0),
            (e.children[0] = e.children[1] = e.children[2] = e.children[3] = null),
            this.tileFeatureCounts.set(e.id, t.size);
        }
        forEachLeaf(e, t) {
          for (const s of e.children) (0, o.b)(s) || (s.isLeaf ? t(s) : this.forEachLeaf(s, t));
        }
        purge(e) {
          if (!(0, o.b)(e))
            if (e.isLeaf) this.remove(e);
            else
              for (let t = 0; t < e.children.length; t++) {
                const s = e.children[t];
                this.purge(s), (e.children[t] = null);
              }
        }
        collectMissingTiles(e, t, s) {
          const i = new Z(s, e, this.extent);
          return this.collectMissingTilesRecurse(t, i, 1), i.info;
        }
        collectMissingTilesRecurse(e, t, s) {
          if (e.isLeaf) return;
          if (!e.hasChildren) return void t.addMissing(e.level, e.row, e.col, s);
          const i = s / 2;
          for (let s = 0; s < e.children.length; s++) {
            const r = e.children[s];
            (0, o.b)(r)
              ? t.addMissing(e.level + 1, (e.row << 1) + ((2 & s) >> 1), (e.col << 1) + (1 & s), i)
              : this.collectMissingTilesRecurse(r, t, i);
          }
        }
        referenceFeature(e) {
          const t = (this.refCounts.get(e) || 0) + 1;
          return this.refCounts.set(e, t), 1 === t ? 0 : 2;
        }
        unreferenceFeature(e) {
          const t = (this.refCounts.get(e) || 0) - 1;
          return 0 === t ? (this.refCounts.delete(e), 1) : (t > 0 && this.refCounts.set(e, t), 2);
        }
        byteSizeOfFeatures(e) {
          let t = 0;
          for (const s of e) t += this.byteSizeOfFeature(s);
          return t;
        }
        byteSizeOfFeature(e) {
          return (
            32 +
            this.byteSizeOfGeometry(e.geometry) +
            (function (e) {
              if (!e) return 0;
              let t = 32;
              for (const s in e)
                if (e.hasOwnProperty(s)) {
                  const i = e[s];
                  switch (typeof i) {
                    case 'string':
                      t += k(i);
                      break;
                    case 'number':
                      t += 16;
                      break;
                    case 'boolean':
                      t += 4;
                  }
                }
              return t;
            })(e.attributes)
          );
        }
        byteSizeOfGeometry(e) {
          if (!e) return 0;
          const t = B(e.lengths, 4);
          return 32 + B(e.coords, 8) + t;
        }
        get test() {
          return {
            tiles: Array.from(this.tiles.values()).map(
              (e) => `${e.data.id}:[${Array.from(e.objectIds)}]`,
            ),
            featureReferences: Array.from(this.refCounts.keys()).map(
              (e) => `${e}:${this.refCounts.get(e)}`,
            ),
          };
        }
      };
      (0, i._)([(0, u.Cb)({ constructOnly: !0 })], L.prototype, 'featureStore', void 0),
        (0, i._)([(0, u.Cb)()], L.prototype, 'tileInfo', void 0),
        (0, i._)([(0, u.Cb)()], L.prototype, 'extent', void 0),
        (0, i._)([(0, u.Cb)()], L.prototype, 'maximumByteSize', void 0),
        (L = (0, i._)(
          [
            (0, c.j)(
              'esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTileStore',
            ),
          ],
          L,
        ));
      class G {
        constructor(e, t, s) {
          (this.data = e), (this.objectIds = t), (this.byteSize = s);
        }
      }
      class V {
        constructor(e, t, s) {
          (this.level = e),
            (this.row = t),
            (this.col = s),
            (this.isLeaf = !1),
            (this.extent = null),
            (this.children = [null, null, null, null]);
        }
        get hasChildren() {
          return (
            !this.isLeaf &&
            ((0, o.i)(this.children[0]) ||
              (0, o.i)(this.children[1]) ||
              (0, o.i)(this.children[2]) ||
              (0, o.i)(this.children[3]))
          );
        }
      }
      class U {
        constructor(e, t = []) {
          (this.missingTiles = t),
            (this.fullArea = 0),
            (this.coveredArea = 0),
            (this.fullArea = (0, I.x)(e.extent)),
            (this.coveredArea = this.fullArea);
        }
        prepend(e) {
          (this.missingTiles = e.missingTiles.concat(this.missingTiles)),
            (this.coveredArea += e.coveredArea),
            (this.fullArea += e.fullArea);
        }
      }
      class Z {
        constructor(e, t, s) {
          (this.tileInfo = e),
            (this.extent = null),
            (this.info = new U(t)),
            (0, o.i)(s) && (this.extent = (0, I.p)(s));
        }
        addMissing(e, t, s, i) {
          const r = { id: null, level: e, row: t, col: s };
          this.tileInfo.updateTileInfo(r, 1),
            !(0, o.i)(r.extent) ||
              ((0, o.i)(this.extent) && !(0, I.d)(this.extent, r.extent)) ||
              (this.info.missingTiles.push({ data: r, resolution: i }),
              (this.info.coveredArea -= (0, I.x)(r.extent)));
        }
      }
      const X = 0.18751;
      let Y = class extends r.E.EventedAccessor {
        constructor() {
          super(...arguments),
            (this.isInitializing = !0),
            (this.whenSetup = (0, a.dD)()),
            (this.handles = new n.Z()),
            (this.updatingHandles = new v.W()),
            (this.pendingApplyEdits = new Map());
        }
        get updating() {
          return (
            this.featureFetcher.updating || this.isInitializing || this.updatingHandles.updating
          );
        }
        destroy() {
          this.featureFetcher.destroy(),
            this.queryEngine.destroy(),
            this.featureStore.clear(),
            this.handles.destroy();
        }
        async setup(e) {
          const { geometryType: t, objectIdField: s, timeInfo: i, fields: r } = e.serviceInfo;
          return (
            (this.featureStore = new p.F({ ...e.serviceInfo, hasZ: !1, hasM: !1 })),
            (this.queryEngine = new f.Q({
              spatialReference: e.spatialReference,
              featureStore: this.featureStore,
              geometryType: t,
              fields: r,
              hasZ: !1,
              hasM: !1,
              objectIdField: s,
              timeInfo: i ? y.Z.fromJSON(i) : null,
            })),
            (this.featureFetcher = new R({
              store: new L({ featureStore: this.featureStore }),
              url: e.serviceInfo.url,
              objectIdField: e.serviceInfo.objectIdField,
              globalIdField: e.serviceInfo.globalIdField,
              capabilities: e.serviceInfo.capabilities,
              spatialReference: d.Z.fromJSON(e.spatialReference),
              sourceSpatialReference: d.Z.fromJSON(e.serviceInfo.spatialReference),
            })),
            this.handles.add([
              this.featureFetcher.watch(
                'availability',
                (e) => this.emit('notify-availability', { availability: e }),
                !0,
              ),
              this.watch('updating', () => this.notifyUpdating()),
            ]),
            this.whenSetup.resolve(),
            (this.isInitializing = !1),
            this.configure(e.configuration)
          );
        }
        async configure(e) {
          return (
            await this.updatingHandles.addPromise(this.whenSetup.promise),
            this.updateFeatureFetcherConfiguration(e),
            { result: {} }
          );
        }
        async fetchCandidates(e, t) {
          return (
            await this.whenSetup.promise,
            (0, a.k_)(t),
            {
              result: await this.queryEngine.executeQueryForSnapping(
                {
                  point: e.point,
                  distance: e.distance,
                  types: e.types,
                  query: (0, o.i)(e.filter) ? e.filter : { where: '1=1' },
                },
                (0, o.i)(t) ? t.signal : null,
              ),
            }
          );
        }
        async updateTiles(e, t) {
          return (
            await this.updatingHandles.addPromise(this.whenSetup.promise),
            (0, a.k_)(t),
            (this.featureFetcher.tileSize = e.tileSize),
            (this.featureFetcher.tilesOfInterest = e.tiles),
            (this.featureFetcher.tileInfo = (0, o.i)(e.tileInfo) ? g.Z.fromJSON(e.tileInfo) : null),
            { result: {} }
          );
        }
        async refresh(e, t) {
          return (
            await this.updatingHandles.addPromise(this.whenSetup.promise),
            (0, a.k_)(t),
            this.featureFetcher.refresh(),
            { result: {} }
          );
        }
        async whenNotUpdating(e, t) {
          return (
            await this.updatingHandles.addPromise(this.whenSetup.promise),
            (0, a.k_)(t),
            await (0, a.Hl)((0, l.cm)(this, 'updating'), t),
            { result: {} }
          );
        }
        async getDebugInfo(e, t) {
          return (0, a.k_)(t), { result: this.featureFetcher.debugInfo };
        }
        async beginApplyEdits(e, t) {
          this.updatingHandles.addPromise(this.whenSetup.promise), (0, a.k_)(t);
          const s = (0, a.dD)();
          return (
            this.pendingApplyEdits.set(e.id, s),
            this.featureFetcher.applyEdits(s.promise),
            this.updatingHandles.addPromise(s.promise),
            { result: {} }
          );
        }
        async endApplyEdits(e, t) {
          const s = this.pendingApplyEdits.get(e.id);
          return s && s.resolve(e.edits), (0, a.k_)(t), { result: {} };
        }
        updateFeatureFetcherConfiguration(e) {
          (this.featureFetcher.filter = (0, o.i)(e.filter) ? m.Z.fromJSON(e.filter) : null),
            (this.featureFetcher.customParameters = e.customParameters);
        }
        notifyUpdating() {
          this.emit('notify-updating', { updating: this.updating });
        }
      };
      (0, i._)([(0, u.Cb)({ readOnly: !0 })], Y.prototype, 'updating', null),
        (0, i._)([(0, u.Cb)()], Y.prototype, 'isInitializing', void 0),
        (Y = (0, i._)(
          [
            (0, c.j)(
              'esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceSnappingSourceWorker',
            ),
          ],
          Y,
        ));
      const H = function () {
        return new Y();
      };
    },
    56761: (e, t, s) => {
      'use strict';
      s.d(t, { B: () => p, F: () => f });
      var i = s(60991),
        r = s(76996),
        n = s(92143),
        o = s(76506),
        a = s(53326),
        l = s(92482),
        u = s(40267),
        h = s(88994),
        c = s(44722);
      const d = { minX: 0, minY: 0, maxX: 0, maxY: 0 };
      class p {
        constructor() {
          (this._indexInvalid = !1),
            (this._boundsToLoad = []),
            (this._boundsById = new Map()),
            (this._idByBounds = new Map()),
            (this._index = new h.P(
              9,
              (0, o.h)('csp-restrictions')
                ? (e) => ({ minX: e[0], minY: e[1], maxX: e[2], maxY: e[3] })
                : ['[0]', '[1]', '[2]', '[3]'],
            )),
            (this._loadIndex = () => {
              if (this._indexInvalid) {
                const e = new Array(this._idByBounds.size);
                let t = 0;
                this._idByBounds.forEach((s, i) => {
                  e[t++] = i;
                }),
                  (this._indexInvalid = !1),
                  this._index.clear(),
                  this._index.load(e);
              } else
                this._boundsToLoad.length &&
                  (this._index.load(this._boundsToLoad.filter((e) => this._idByBounds.has(e))),
                  (this._boundsToLoad.length = 0));
            });
        }
        clear() {
          (this._indexInvalid = !1),
            (this._boundsToLoad.length = 0),
            this._boundsById.clear(),
            this._idByBounds.clear(),
            this._index.clear();
        }
        delete(e) {
          const t = this._boundsById.get(e);
          this._boundsById.delete(e),
            t && (this._idByBounds.delete(t), this._indexInvalid || this._index.remove(t));
        }
        forEachInBounds(e, t) {
          this._loadIndex(),
            (function (e, t, s) {
              (d.minX = t[0]), (d.minY = t[1]), (d.maxX = t[2]), (d.maxY = t[3]), e.search(d, s);
            })(this._index, e, (e) => t(this._idByBounds.get(e)));
        }
        get(e) {
          return this._boundsById.get(e);
        }
        has(e) {
          return this._boundsById.has(e);
        }
        invalidateIndex() {
          this._indexInvalid || ((this._indexInvalid = !0), (this._boundsToLoad.length = 0));
        }
        set(e, t) {
          if (!this._indexInvalid) {
            const t = this._boundsById.get(e);
            t && (this._index.remove(t), this._idByBounds.delete(t));
          }
          this._boundsById.set(e, t),
            t &&
              (this._idByBounds.set(t, e),
              this._indexInvalid ||
                (this._boundsToLoad.push(t), this._boundsToLoad.length > 5e4 && this._loadIndex()));
        }
      }
      class f {
        constructor(e) {
          (this.geometryInfo = e),
            (this._boundsStore = new p()),
            (this._featuresById = new Map()),
            (this._markedIds = new Set()),
            (this.events = new r.E()),
            (this.featureAdapter = c.o);
        }
        get geometryType() {
          return this.geometryInfo.geometryType;
        }
        get hasM() {
          return this.geometryInfo.hasM;
        }
        get hasZ() {
          return this.geometryInfo.hasZ;
        }
        get numFeatures() {
          return this._featuresById.size;
        }
        get fullBounds() {
          if (!this.numFeatures) return null;
          const e = (0, l.a)(l.N);
          return (
            this._featuresById.forEach((t) => {
              const s = this._boundsStore.get(t.objectId);
              s &&
                ((e[0] = Math.min(s[0], e[0])),
                (e[1] = Math.min(s[1], e[1])),
                (e[2] = Math.max(s[2], e[2])),
                (e[3] = Math.max(s[3], e[3])));
            }),
            e
          );
        }
        get storeStatistics() {
          let e = 0;
          return (
            this._featuresById.forEach((t) => {
              t.geometry && t.geometry.coords && (e += t.geometry.coords.length);
            }),
            {
              featureCount: this._featuresById.size,
              vertexCount: e / (this.hasZ ? (this.hasM ? 4 : 3) : this.hasM ? 3 : 2),
            }
          );
        }
        add(e) {
          this._add(e), this._emitChanged();
        }
        addMany(e) {
          for (const t of e) this._add(t);
          this._emitChanged();
        }
        clear() {
          this._featuresById.clear(), this._boundsStore.clear(), this._emitChanged();
        }
        removeById(e) {
          const t = this._featuresById.get(e);
          return t ? (this._remove(t), this._emitChanged(), t) : null;
        }
        removeManyById(e) {
          this._boundsStore.invalidateIndex();
          for (const t of e) {
            const e = this._featuresById.get(t);
            e && this._remove(e);
          }
          this._emitChanged();
        }
        forEachBounds(e, t, s) {
          for (const i of e) {
            const e = this._boundsStore.get(i.objectId);
            e && t((0, a.C)(s, e));
          }
        }
        getFeature(e) {
          return this._featuresById.get(e);
        }
        has(e) {
          return this._featuresById.has(e);
        }
        forEach(e) {
          this._featuresById.forEach((t) => e(t));
        }
        forEachInBounds(e, t) {
          this._boundsStore.forEachInBounds(e, (e) => {
            t(this._featuresById.get(e));
          });
        }
        startMarkingUsedFeatures() {
          this._boundsStore.invalidateIndex(), this._markedIds.clear();
        }
        sweep() {
          let e = !1;
          this._featuresById.forEach((t, s) => {
            this._markedIds.has(s) || ((e = !0), this._remove(t));
          }),
            this._markedIds.clear(),
            e && this._emitChanged();
        }
        _emitChanged() {
          this.events.emit('changed', void 0);
        }
        _add(e) {
          if (!e) return;
          const t = e.objectId;
          if (null == t)
            return void n.L.getLogger('esri.layers.graphics.data.FeatureStore').error(
              new i.Z('featurestore:invalid-feature', 'feature id is missing', { feature: e }),
            );
          const s = this._featuresById.get(t);
          let r;
          if (
            (this._markedIds.add(t),
            s
              ? ((e.displayId = s.displayId),
                (r = this._boundsStore.get(t)),
                this._boundsStore.delete(t))
              : (0, o.i)(this.onFeatureAdd) && this.onFeatureAdd(e),
            !e.geometry || !e.geometry.coords || !e.geometry.coords.length)
          )
            return this._boundsStore.set(t, null), void this._featuresById.set(t, e);
          (r = (0, u.g)(
            r || (0, l.a)(),
            e.geometry,
            this.geometryInfo.hasZ,
            this.geometryInfo.hasM,
          )),
            this._boundsStore.set(t, r),
            this._featuresById.set(t, e);
        }
        _remove(e) {
          return (
            (0, o.i)(this.onFeatureRemove) && this.onFeatureRemove(e),
            this._markedIds.delete(e.objectId),
            this._boundsStore.delete(e.objectId),
            this._featuresById.delete(e.objectId),
            e
          );
        }
      }
    },
    88994: (e, t, s) => {
      'use strict';
      s.d(t, { P: () => a });
      var i = s(27794),
        r = s(76506),
        n = s(6906),
        o = s(98576);
      class a {
        constructor(e = 9, t) {
          (this.compareMinX = c),
            (this.compareMinY = d),
            (this.toBBox = function (e) {
              return e;
            }),
            (this._maxEntries = Math.max(4, e || 9)),
            (this._minEntries = Math.max(2, Math.ceil(0.4 * this._maxEntries))),
            t && ('function' == typeof t ? (this.toBBox = t) : this._initFormat(t)),
            this.clear();
        }
        destroy() {
          this.clear(), b.prune(), v.prune(), x.prune(), w.prune();
        }
        all(e) {
          this._all(this.data, e);
        }
        search(e, t) {
          let s = this.data;
          const i = this.toBBox;
          if (m(e, s))
            for (b.clear(); s; ) {
              for (let r = 0, n = s.children.length; r < n; r++) {
                const n = s.children[r],
                  o = s.leaf ? i(n) : n;
                m(e, o) && (s.leaf ? t(n) : y(e, o) ? this._all(n, t) : b.push(n));
              }
              s = b.pop();
            }
        }
        collides(e) {
          let t = this.data;
          const s = this.toBBox;
          if (!m(e, t)) return !1;
          for (b.clear(); t; ) {
            for (let i = 0, r = t.children.length; i < r; i++) {
              const r = t.children[i],
                n = t.leaf ? s(r) : r;
              if (m(e, n)) {
                if (t.leaf || y(e, n)) return !0;
                b.push(r);
              }
            }
            t = b.pop();
          }
          return !1;
        }
        load(e) {
          if (!e.length) return this;
          if (e.length < this._minEntries) {
            for (let t = 0, s = e.length; t < s; t++) this.insert(e[t]);
            return this;
          }
          let t = this._build(e.slice(0, e.length), 0, e.length - 1, 0);
          if (this.data.children.length)
            if (this.data.height === t.height) this._splitRoot(this.data, t);
            else {
              if (this.data.height < t.height) {
                const e = this.data;
                (this.data = t), (t = e);
              }
              this._insert(t, this.data.height - t.height - 1, !0);
            }
          else this.data = t;
          return this;
        }
        insert(e) {
          return e && this._insert(e, this.data.height - 1), this;
        }
        clear() {
          return (this.data = new S([])), this;
        }
        remove(e) {
          if (!e) return this;
          let t,
            s = this.data,
            n = null,
            o = 0,
            a = !1;
          const l = this.toBBox(e);
          for (x.clear(), w.clear(); s || x.length > 0; ) {
            var u;
            if (
              (s ||
                ((s = (0, r.a)(x.pop())),
                (n = x.data[x.length - 1]),
                (o = null != (u = w.pop()) ? u : 0),
                (a = !0)),
              s.leaf && ((t = (0, i.i)(s.children, e, s.children.length, s.indexHint)), -1 !== t))
            )
              return s.children.splice(t, 1), x.push(s), this._condense(x), this;
            a || s.leaf || !y(s, l)
              ? n
                ? (o++, (s = n.children[o]), (a = !1))
                : (s = null)
              : (x.push(s), w.push(o), (o = 0), (n = s), (s = s.children[0]));
          }
          return this;
        }
        toJSON() {
          return this.data;
        }
        fromJSON(e) {
          return (this.data = e), this;
        }
        _all(e, t) {
          let s = e;
          for (v.clear(); s; ) {
            var i;
            if (!0 === s.leaf) for (const e of s.children) t(e);
            else v.pushArray(s.children);
            s = null != (i = v.pop()) ? i : null;
          }
        }
        _build(e, t, s, i) {
          const r = s - t + 1;
          let n = this._maxEntries;
          if (r <= n) {
            const i = new S(e.slice(t, s + 1));
            return l(i, this.toBBox), i;
          }
          i || ((i = Math.ceil(Math.log(r) / Math.log(n))), (n = Math.ceil(r / n ** (i - 1))));
          const o = new F([]);
          o.height = i;
          const a = Math.ceil(r / n),
            u = a * Math.ceil(Math.sqrt(n));
          _(e, t, s, u, this.compareMinX);
          for (let r = t; r <= s; r += u) {
            const t = Math.min(r + u - 1, s);
            _(e, r, t, a, this.compareMinY);
            for (let s = r; s <= t; s += a) {
              const r = Math.min(s + a - 1, t);
              o.children.push(this._build(e, s, r, i - 1));
            }
          }
          return l(o, this.toBBox), o;
        }
        _chooseSubtree(e, t, s, i) {
          for (; i.push(t), !0 !== t.leaf && i.length - 1 !== s; ) {
            let s,
              i = 1 / 0,
              o = 1 / 0;
            for (let a = 0, l = t.children.length; a < l; a++) {
              const l = t.children[a],
                u = p(l),
                h =
                  ((r = e),
                  (n = l),
                  (Math.max(n.maxX, r.maxX) - Math.min(n.minX, r.minX)) *
                    (Math.max(n.maxY, r.maxY) - Math.min(n.minY, r.minY)) -
                    u);
              h < o
                ? ((o = h), (i = u < i ? u : i), (s = l))
                : h === o && u < i && ((i = u), (s = l));
            }
            t = s || t.children[0];
          }
          var r, n;
          return t;
        }
        _insert(e, t, s) {
          const i = this.toBBox,
            r = s ? e : i(e);
          x.clear();
          const n = this._chooseSubtree(r, this.data, t, x);
          for (
            n.children.push(e), h(n, r);
            t >= 0 && x.data[t].children.length > this._maxEntries;

          )
            this._split(x, t), t--;
          this._adjustParentBBoxes(r, x, t);
        }
        _split(e, t) {
          const s = e.data[t],
            i = s.children.length,
            r = this._minEntries;
          this._chooseSplitAxis(s, r, i);
          const n = this._chooseSplitIndex(s, r, i);
          if (!n)
            return void console.log(
              '  Error: assertion failed at PooledRBush._split: no valid split index',
            );
          const o = s.children.splice(n, s.children.length - n),
            a = s.leaf ? new S(o) : new F(o);
          (a.height = s.height),
            l(s, this.toBBox),
            l(a, this.toBBox),
            t ? e.data[t - 1].children.push(a) : this._splitRoot(s, a);
        }
        _splitRoot(e, t) {
          (this.data = new F([e, t])), (this.data.height = e.height + 1), l(this.data, this.toBBox);
        }
        _chooseSplitIndex(e, t, s) {
          let i, r, n;
          i = r = 1 / 0;
          for (let o = t; o <= s - t; o++) {
            const t = u(e, 0, o, this.toBBox),
              a = u(e, o, s, this.toBBox),
              l = g(t, a),
              h = p(t) + p(a);
            l < i
              ? ((i = l), (n = o), (r = h < r ? h : r))
              : l === i && h < r && ((r = h), (n = o));
          }
          return n;
        }
        _chooseSplitAxis(e, t, s) {
          const i = e.leaf ? this.compareMinX : c,
            r = e.leaf ? this.compareMinY : d;
          this._allDistMargin(e, t, s, i) < this._allDistMargin(e, t, s, r) && e.children.sort(i);
        }
        _allDistMargin(e, t, s, i) {
          e.children.sort(i);
          const r = this.toBBox,
            n = u(e, 0, t, r),
            o = u(e, s - t, s, r);
          let a = f(n) + f(o);
          for (let i = t; i < s - t; i++) {
            const t = e.children[i];
            h(n, e.leaf ? r(t) : t), (a += f(n));
          }
          for (let i = s - t - 1; i >= t; i--) {
            const t = e.children[i];
            h(o, e.leaf ? r(t) : t), (a += f(o));
          }
          return a;
        }
        _adjustParentBBoxes(e, t, s) {
          for (let i = s; i >= 0; i--) h(t.data[i], e);
        }
        _condense(e) {
          for (let t = e.length - 1; t >= 0; t--) {
            const s = e.data[t];
            if (0 === s.children.length)
              if (t > 0) {
                const r = e.data[t - 1],
                  n = r.children;
                n.splice((0, i.i)(n, s, n.length, r.indexHint), 1);
              } else this.clear();
            else l(s, this.toBBox);
          }
        }
        _initFormat(e) {
          const t = ['return a', ' - b', ';'];
          (this.compareMinX = new Function('a', 'b', t.join(e[0]))),
            (this.compareMinY = new Function('a', 'b', t.join(e[1]))),
            (this.toBBox = new Function(
              'a',
              'return {minX: a' +
                e[0] +
                ', minY: a' +
                e[1] +
                ', maxX: a' +
                e[2] +
                ', maxY: a' +
                e[3] +
                '};',
            ));
        }
      }
      function l(e, t) {
        u(e, 0, e.children.length, t, e);
      }
      function u(e, t, s, i, r) {
        r || (r = new S([])),
          (r.minX = 1 / 0),
          (r.minY = 1 / 0),
          (r.maxX = -1 / 0),
          (r.maxY = -1 / 0);
        for (let n, o = t; o < s; o++) (n = e.children[o]), h(r, e.leaf ? i(n) : n);
        return r;
      }
      function h(e, t) {
        (e.minX = Math.min(e.minX, t.minX)),
          (e.minY = Math.min(e.minY, t.minY)),
          (e.maxX = Math.max(e.maxX, t.maxX)),
          (e.maxY = Math.max(e.maxY, t.maxY));
      }
      function c(e, t) {
        return e.minX - t.minX;
      }
      function d(e, t) {
        return e.minY - t.minY;
      }
      function p(e) {
        return (e.maxX - e.minX) * (e.maxY - e.minY);
      }
      function f(e) {
        return e.maxX - e.minX + (e.maxY - e.minY);
      }
      function g(e, t) {
        const s = Math.max(e.minX, t.minX),
          i = Math.max(e.minY, t.minY),
          r = Math.min(e.maxX, t.maxX),
          n = Math.min(e.maxY, t.maxY);
        return Math.max(0, r - s) * Math.max(0, n - i);
      }
      function y(e, t) {
        return e.minX <= t.minX && e.minY <= t.minY && t.maxX <= e.maxX && t.maxY <= e.maxY;
      }
      function m(e, t) {
        return t.minX <= e.maxX && t.minY <= e.maxY && t.maxX >= e.minX && t.maxY >= e.minY;
      }
      function _(e, t, s, i, n) {
        const a = [t, s];
        for (; a.length; ) {
          const t = (0, r.a)(a.pop()),
            s = (0, r.a)(a.pop());
          if (t - s <= i) continue;
          const l = s + Math.ceil((t - s) / i / 2) * i;
          (0, o.q)(e, l, s, t, n), a.push(s, l, l, t);
        }
      }
      const b = new n.P(),
        v = new n.P(),
        x = new n.P(),
        w = new n.P({ deallocator: void 0 });
      class I extends class {
        constructor() {
          (this.minX = 1 / 0), (this.minY = 1 / 0), (this.maxX = -1 / 0), (this.maxY = -1 / 0);
        }
      } {
        constructor() {
          super(...arguments), (this.height = 1), (this.indexHint = new i.P());
        }
      }
      class S extends I {
        constructor(e) {
          super(), (this.children = e), (this.leaf = !0);
        }
      }
      class F extends I {
        constructor(e) {
          super(), (this.children = e), (this.leaf = !1);
        }
      }
    },
    54732: (e, t, s) => {
      'use strict';
      s.d(t, { k: () => i });
      const i = new (s(57251).J)({
        esriFieldTypeSmallInteger: 'small-integer',
        esriFieldTypeInteger: 'integer',
        esriFieldTypeSingle: 'single',
        esriFieldTypeDouble: 'double',
        esriFieldTypeLong: 'long',
        esriFieldTypeString: 'string',
        esriFieldTypeDate: 'date',
        esriFieldTypeOID: 'oid',
        esriFieldTypeGeometry: 'geometry',
        esriFieldTypeBlob: 'blob',
        esriFieldTypeRaster: 'raster',
        esriFieldTypeGUID: 'guid',
        esriFieldTypeGlobalID: 'global-id',
        esriFieldTypeXML: 'xml',
      });
    },
    44722: (e, t, s) => {
      'use strict';
      s.d(t, { o: () => n });
      var i = s(71331),
        r = s(85674);
      const n = {
        getObjectId: (e) => e.objectId,
        getAttributes: (e) => e.attributes,
        getAttribute: (e, t) => e.attributes[t],
        cloneWithGeometry: (e, t) => new r.O(t, e.attributes, null, e.objectId),
        getGeometry: (e) => e.geometry,
        getCentroid: (e, t) => (
          e.centroid || (e.centroid = (0, i.g)(new r.a(), e.geometry, t.hasZ, t.hasM)), e.centroid
        ),
      };
    },
    11385: (e, t, s) => {
      'use strict';
      s.d(t, { P: () => a });
      var i = s(76506),
        r = s(91055);
      const n = (0, i.h)('esri-text-decoder') ? new TextDecoder('utf-8') : null,
        o = (0, i.h)('safari') || (0, i.h)('ios') ? 6 : (0, i.h)('ff') ? 12 : 32;
      class a {
        constructor(e, t, s = 0, i = e ? e.byteLength : 0) {
          (this._tag = 0), (this._dataType = 99), this.init(e, t, s, i);
        }
        init(e, t, s, i) {
          (this._data = e), (this._dataView = t), (this._pos = s), (this._end = i);
        }
        clone() {
          return new a(this._data, this._dataView, this._pos, this._end);
        }
        pos() {
          return this._pos;
        }
        move(e) {
          this._pos = e;
        }
        nextTag(e) {
          for (;;) {
            if (this._pos === this._end) return !1;
            const t = this._decodeVarint();
            if (((this._tag = t >> 3), (this._dataType = 7 & t), !e || e === this._tag)) break;
            this.skip();
          }
          return !0;
        }
        next() {
          if (this._pos === this._end) return !1;
          const e = this._decodeVarint();
          return (this._tag = e >> 3), (this._dataType = 7 & e), !0;
        }
        empty() {
          return this._pos >= this._end;
        }
        tag() {
          return this._tag;
        }
        getInt32() {
          return this._decodeVarint();
        }
        getInt64() {
          return this._decodeVarint();
        }
        getUInt32() {
          let e = 4294967295;
          return (
            (e = (127 & this._data[this._pos]) >>> 0),
            this._data[this._pos++] < 128
              ? e
              : ((e = (e | ((127 & this._data[this._pos]) << 7)) >>> 0),
                this._data[this._pos++] < 128
                  ? e
                  : ((e = (e | ((127 & this._data[this._pos]) << 14)) >>> 0),
                    this._data[this._pos++] < 128
                      ? e
                      : ((e = (e | ((127 & this._data[this._pos]) << 21)) >>> 0),
                        this._data[this._pos++] < 128
                          ? e
                          : ((e = (e | ((15 & this._data[this._pos]) << 28)) >>> 0),
                            this._data[this._pos++] < 128 ? e : void 0))))
          );
        }
        getUInt64() {
          return this._decodeVarint();
        }
        getSInt32() {
          const e = this.getUInt32();
          return ((e >>> 1) ^ -(1 & e)) | 0;
        }
        getSInt64() {
          return this._decodeSVarint();
        }
        getBool() {
          const e = 0 !== this._data[this._pos];
          return this._skip(1), e;
        }
        getEnum() {
          return this._decodeVarint();
        }
        getFixed64() {
          const e = this._dataView,
            t = this._pos,
            s = e.getUint32(t, !0) + 4294967296 * e.getUint32(t + 4, !0);
          return this._skip(8), s;
        }
        getSFixed64() {
          const e = this._dataView,
            t = this._pos,
            s = e.getUint32(t, !0) + 4294967296 * e.getInt32(t + 4, !0);
          return this._skip(8), s;
        }
        getDouble() {
          const e = this._dataView.getFloat64(this._pos, !0);
          return this._skip(8), e;
        }
        getFixed32() {
          const e = this._dataView.getUint32(this._pos, !0);
          return this._skip(4), e;
        }
        getSFixed32() {
          const e = this._dataView.getInt32(this._pos, !0);
          return this._skip(4), e;
        }
        getFloat() {
          const e = this._dataView.getFloat32(this._pos, !0);
          return this._skip(4), e;
        }
        getString() {
          const e = this._getLength(),
            t = this._pos,
            s = this._toString(this._data, t, t + e);
          return this._skip(e), s;
        }
        getBytes() {
          const e = this._getLength(),
            t = this._pos,
            s = this._toBytes(this._data, t, t + e);
          return this._skip(e), s;
        }
        getLength() {
          return this._getLengthUnsafe();
        }
        processMessageWithArgs(e, t, s, i) {
          const r = this.getMessage(),
            n = e(r, t, s, i);
          return r.release(), n;
        }
        processMessage(e) {
          const t = this.getMessage(),
            s = e(t);
          return t.release(), s;
        }
        getMessage() {
          const e = this._getLength(),
            t = a.pool.acquire();
          return t.init(this._data, this._dataView, this._pos, this._pos + e), this._skip(e), t;
        }
        release() {
          a.pool.release(this);
        }
        dataType() {
          return this._dataType;
        }
        skip() {
          switch (this._dataType) {
            case 0:
              this._decodeVarint();
              break;
            case 1:
              this._skip(8);
              break;
            case 2:
              this._skip(this._getLength());
              break;
            case 5:
              this._skip(4);
              break;
            default:
              throw new Error('Invalid data type!');
          }
        }
        skipLen(e) {
          this._skip(e);
        }
        _skip(e) {
          if (this._pos + e > this._end) throw new Error('Attempt to skip past the end of buffer!');
          this._pos += e;
        }
        _decodeVarint() {
          const e = this._data;
          let t,
            s = this._pos,
            i = 0;
          if (this._end - s >= 10)
            do {
              if (((t = e[s++]), (i |= 127 & t), 0 == (128 & t))) break;
              if (((t = e[s++]), (i |= (127 & t) << 7), 0 == (128 & t))) break;
              if (((t = e[s++]), (i |= (127 & t) << 14), 0 == (128 & t))) break;
              if (((t = e[s++]), (i |= (127 & t) << 21), 0 == (128 & t))) break;
              if (((t = e[s++]), (i += 268435456 * (127 & t)), 0 == (128 & t))) break;
              if (((t = e[s++]), (i += 34359738368 * (127 & t)), 0 == (128 & t))) break;
              if (((t = e[s++]), (i += 4398046511104 * (127 & t)), 0 == (128 & t))) break;
              if (((t = e[s++]), (i += 562949953421312 * (127 & t)), 0 == (128 & t))) break;
              if (((t = e[s++]), (i += 72057594037927940 * (127 & t)), 0 == (128 & t))) break;
              if (((t = e[s++]), (i += 0x8000000000000000 * (127 & t)), 0 == (128 & t))) break;
              throw new Error('Varint too long!');
            } while (0);
          else {
            let r = 1;
            for (; s !== this._end && ((t = e[s]), 0 != (128 & t)); )
              ++s, (i += (127 & t) * r), (r *= 128);
            if (s === this._end) throw new Error('Varint overrun!');
            ++s, (i += t * r);
          }
          return (this._pos = s), i;
        }
        _decodeSVarint() {
          const e = this._decodeVarint();
          return e % 2 ? -(e + 1) / 2 : e / 2;
        }
        _getLength() {
          if (2 !== this._dataType) throw new Error('Not a delimited data type!');
          return this._decodeVarint();
        }
        _getLengthUnsafe() {
          return this.getUInt32();
        }
        _toString(e, t, s) {
          if ((s = Math.min(this._end, s)) - t > o && n) {
            const i = e.subarray(t, s);
            return n.decode(i);
          }
          let i = '',
            r = '';
          for (let n = t; n < s; ++n) {
            const t = e[n];
            128 & t
              ? (r += '%' + t.toString(16))
              : ((i += decodeURIComponent(r) + String.fromCharCode(t)), (r = ''));
          }
          return r.length && (i += decodeURIComponent(r)), i;
        }
        _toBytes(e, t, s) {
          return (s = Math.min(this._end, s)), new Uint8Array(e.buffer, t, s - t);
        }
      }
      a.pool = new r.O(a, null, (e) => {
        (e._data = null), (e._dataView = null);
      });
    },
    76733: (e, t, s) => {
      'use strict';
      s.d(t, { O: () => c, a: () => C, b: () => g, p: () => O });
      var i = s(60991),
        r = s(76506),
        n = s(11385),
        o = s(85674),
        a = s(53785),
        l = s(60947),
        u = s(9006);
      const h = [
        'esriGeometryPoint',
        'esriGeometryMultipoint',
        'esriGeometryPolyline',
        'esriGeometryPolygon',
      ];
      class c {
        constructor(e) {
          (this.options = e),
            (this.geometryTypes = h),
            (this._coordinatePtr = 0),
            (this._vertexDimension = 0);
        }
        createFeatureResult() {
          return new u.O();
        }
        prepareFeatures(e) {
          (this._vertexDimension = 2),
            e.hasZ && this._vertexDimension++,
            e.hasM && this._vertexDimension++;
        }
        finishFeatureResult(e) {
          if (
            !e ||
            !e.features ||
            !e.hasZ ||
            !this.options.sourceSpatialReference ||
            !e.spatialReference ||
            (0, l.e)(e.spatialReference, this.options.sourceSpatialReference) ||
            e.spatialReference.vcsWkid
          )
            return;
          const t = (0, a.d)(this.options.sourceSpatialReference) / (0, a.d)(e.spatialReference);
          if (1 !== t)
            for (const s of e.features) {
              if (!s.geometry || !s.geometry.coords) continue;
              const e = s.geometry.coords;
              for (let s = 2; s < e.length; s += 3) e[s] *= t;
            }
        }
        addFeature(e, t) {
          e.features.push(t);
        }
        createFeature() {
          return new o.O();
        }
        createSpatialReference() {
          return { wkid: 0 };
        }
        createGeometry() {
          return new o.a();
        }
        addField(e, t) {
          e.fields.push(t);
        }
        allocateCoordinates(e) {
          (e.coords.length = e.lengths.reduce((e, t) => e + t, 0) * this._vertexDimension),
            (this._coordinatePtr = 0);
        }
        addCoordinate(e, t) {
          e.coords[this._coordinatePtr++] = t;
        }
        addCoordinatePoint(e, t) {
          e.coords.push(t);
        }
        addLength(e, t) {
          e.lengths.push(t);
        }
        addQueryGeometry(e, t) {
          (e.queryGeometry = t.queryGeometry), (e.queryGeometryType = t.queryGeometryType);
        }
        createPointGeometry() {
          return new o.a();
        }
      }
      const d = [
          'esriFieldTypeSmallInteger',
          'esriFieldTypeInteger',
          'esriFieldTypeSingle',
          'esriFieldTypeDouble',
          'esriFieldTypeString',
          'esriFieldTypeDate',
          'esriFieldTypeOID',
          'esriFieldTypeGeometry',
          'esriFieldTypeBlob',
          'esriFieldTypeRaster',
          'esriFieldTypeGUID',
          'esriFieldTypeGlobalID',
          'esriFieldTypeXML',
        ],
        p = [
          'sqlTypeBigInt',
          'sqlTypeBinary',
          'sqlTypeBit',
          'sqlTypeChar',
          'sqlTypeDate',
          'sqlTypeDecimal',
          'sqlTypeDouble',
          'sqlTypeFloat',
          'sqlTypeGeometry',
          'sqlTypeGUID',
          'sqlTypeInteger',
          'sqlTypeLongNVarchar',
          'sqlTypeLongVarbinary',
          'sqlTypeLongVarchar',
          'sqlTypeNChar',
          'sqlTypeNVarchar',
          'sqlTypeOther',
          'sqlTypeReal',
          'sqlTypeSmallInt',
          'sqlTypeSqlXml',
          'sqlTypeTime',
          'sqlTypeTimestamp',
          'sqlTypeTimestamp2',
          'sqlTypeTinyInt',
          'sqlTypeVarbinary',
          'sqlTypeVarchar',
        ],
        f = ['upperLeft', 'lowerLeft'];
      function g(e) {
        return e >= d.length ? null : d[e];
      }
      function y(e) {
        return e >= f.length ? null : f[e];
      }
      function m(e, t) {
        return t >= e.geometryTypes.length ? null : e.geometryTypes[t];
      }
      function _(e, t, s) {
        const i = t.createPointGeometry(s);
        for (; e.next(); )
          switch (e.tag()) {
            case 3: {
              const s = e.getUInt32(),
                r = e.pos() + s;
              let n = 0;
              for (; e.pos() < r; ) t.addCoordinatePoint(i, e.getSInt64(), n++);
              break;
            }
            case 1:
            case 2:
            default:
              e.skip();
          }
        return i;
      }
      function b(e, t, s) {
        const i = t.createGeometry(s),
          r = 2 + (s.hasZ ? 1 : 0) + (s.hasM ? 1 : 0);
        for (; e.next(); )
          switch (e.tag()) {
            case 2: {
              const s = e.getUInt32(),
                r = e.pos() + s;
              let n = 0;
              for (; e.pos() < r; ) t.addLength(i, e.getUInt32(), n++);
              break;
            }
            case 3: {
              const s = e.getUInt32(),
                n = e.pos() + s;
              let o = 0;
              for (t.allocateCoordinates(i); e.pos() < n; )
                t.addCoordinate(i, e.getSInt64(), o), o++, o === r && (o = 0);
              break;
            }
            case 1:
            default:
              e.skip();
          }
        return i;
      }
      function v(e) {
        const t = new o.a();
        let s = 'esriGeometryPoint';
        for (; e.next(); )
          switch (e.tag()) {
            case 2: {
              const s = e.getUInt32(),
                i = e.pos() + s;
              for (; e.pos() < i; ) t.lengths.push(e.getUInt32());
              break;
            }
            case 3: {
              const s = e.getUInt32(),
                i = e.pos() + s;
              for (; e.pos() < i; ) t.coords.push(e.getSInt64());
              break;
            }
            case 1:
              s = h[e.getEnum()];
              break;
            default:
              e.skip();
          }
        return { queryGeometry: t, queryGeometryType: s };
      }
      function x(e) {
        for (; e.next(); )
          switch (e.tag()) {
            case 1:
              return e.getString();
            case 2:
              return e.getFloat();
            case 3:
              return e.getDouble();
            case 4:
              return e.getSInt32();
            case 5:
              return e.getUInt32();
            case 6:
              return e.getInt64();
            case 7:
              return e.getUInt64();
            case 8:
              return e.getSInt64();
            case 9:
              return e.getBool();
            default:
              return e.skip(), null;
          }
        return null;
      }
      function w(e) {
        const t = { type: g(0) };
        for (; e.next(); )
          switch (e.tag()) {
            case 1:
              t.name = e.getString();
              break;
            case 2:
              t.type = g(e.getEnum());
              break;
            case 3:
              t.alias = e.getString();
              break;
            case 4:
              t.sqlType = (s = e.getEnum()) >= p.length ? null : p[s];
              break;
            case 5:
              e.skip();
              break;
            case 6:
              t.defaultValue = e.getString();
              break;
            default:
              e.skip();
          }
        var s;
        return t;
      }
      function I(e) {
        const t = {};
        for (; e.next(); )
          switch (e.tag()) {
            case 1:
              t.name = e.getString();
              break;
            case 2:
              t.isSystemMaintained = e.getBool();
              break;
            default:
              e.skip();
          }
        return t;
      }
      function S(e, t, s, i) {
        const r = t.createFeature(s);
        let n = 0;
        for (; e.next(); )
          switch (e.tag()) {
            case 1: {
              const t = i[n++].name;
              r.attributes[t] = e.processMessage(x);
              break;
            }
            case 2:
              r.geometry = e.processMessageWithArgs(b, t, s);
              break;
            case 4:
              r.centroid = e.processMessageWithArgs(_, t, s);
              break;
            default:
              e.skip();
          }
        return r;
      }
      function F(e) {
        const t = [1, 1, 1, 1];
        for (; e.next(); )
          switch (e.tag()) {
            case 1:
              t[0] = e.getDouble();
              break;
            case 2:
              t[1] = e.getDouble();
              break;
            case 4:
              t[2] = e.getDouble();
              break;
            case 3:
              t[3] = e.getDouble();
              break;
            default:
              e.skip();
          }
        return t;
      }
      function T(e) {
        const t = [0, 0, 0, 0];
        for (; e.next(); )
          switch (e.tag()) {
            case 1:
              t[0] = e.getDouble();
              break;
            case 2:
              t[1] = e.getDouble();
              break;
            case 4:
              t[2] = e.getDouble();
              break;
            case 3:
              t[3] = e.getDouble();
              break;
            default:
              e.skip();
          }
        return t;
      }
      function C(e) {
        const t = { originPosition: y(0) };
        for (; e.next(); )
          switch (e.tag()) {
            case 1:
              t.originPosition = y(e.getEnum());
              break;
            case 2:
              t.scale = e.processMessage(F);
              break;
            case 3:
              t.translate = e.processMessage(T);
              break;
            default:
              e.skip();
          }
        return t;
      }
      function k(e) {
        const t = {};
        for (; e.next(); )
          switch (e.tag()) {
            case 1:
              t.shapeAreaFieldName = e.getString();
              break;
            case 2:
              t.shapeLengthFieldName = e.getString();
              break;
            case 3:
              t.units = e.getString();
              break;
            default:
              e.skip();
          }
        return t;
      }
      function B(e, t) {
        const s = t.createSpatialReference();
        for (; e.next(); )
          switch (e.tag()) {
            case 1:
              s.wkid = e.getUInt32();
              break;
            case 5:
              s.wkt = e.getString();
              break;
            case 2:
              s.latestWkid = e.getUInt32();
              break;
            case 3:
              s.vcsWkid = e.getUInt32();
              break;
            case 4:
              s.latestVcsWkid = e.getUInt32();
              break;
            default:
              e.skip();
          }
        return s;
      }
      function M(e, t) {
        const s = t.createFeatureResult();
        s.geometryType = m(t, 0);
        let i = !1;
        for (; e.next(); )
          switch (e.tag()) {
            case 1:
              s.objectIdFieldName = e.getString();
              break;
            case 3:
              s.globalIdFieldName = e.getString();
              break;
            case 4:
              s.geohashFieldName = e.getString();
              break;
            case 5:
              s.geometryProperties = e.processMessage(k);
              break;
            case 7:
              s.geometryType = m(t, e.getEnum());
              break;
            case 8:
              s.spatialReference = e.processMessageWithArgs(B, t);
              break;
            case 10:
              s.hasZ = e.getBool();
              break;
            case 11:
              s.hasM = e.getBool();
              break;
            case 12:
              s.transform = e.processMessage(C);
              break;
            case 9: {
              const t = e.getBool();
              s.exceededTransferLimit = t;
              break;
            }
            case 13:
              t.addField(s, e.processMessage(w));
              break;
            case 15:
              i || (t.prepareFeatures(s), (i = !0)),
                t.addFeature(s, e.processMessageWithArgs(S, t, s, s.fields));
              break;
            case 2:
              s.uniqueIdField = e.processMessage(I);
              break;
            case 6:
            default:
              e.skip();
          }
        return t.finishFeatureResult(s), s;
      }
      function E(e, t) {
        const s = {};
        let i = null;
        for (; e.next(); )
          switch (e.tag()) {
            case 4:
              i = e.processMessageWithArgs(v);
              break;
            case 1:
              s.featureResult = e.processMessageWithArgs(M, t);
              break;
            case 2:
            case 3:
            default:
              e.skip();
          }
        return (0, r.i)(i) && s.featureResult && t.addQueryGeometry(s, i), s;
      }
      function O(e, t) {
        const s = (function (e, t) {
            try {
              const s = 2,
                i = new n.P(new Uint8Array(e), new DataView(e)),
                r = {};
              for (; i.next(); )
                switch (i.tag()) {
                  case s:
                    r.queryResult = i.processMessageWithArgs(E, t);
                    break;
                  default:
                    i.skip();
                }
              return r;
            } catch (e) {
              throw new i.Z('query:parsing-pbf', 'Error while parsing FeatureSet PBF payload', {
                error: e,
              });
            }
          })(e, t),
          r = s.queryResult.featureResult,
          o = s.queryResult.queryGeometry,
          a = s.queryResult.queryGeometryType;
        if (r && r.features && r.features.length && r.objectIdFieldName) {
          const e = r.objectIdFieldName;
          for (const t of r.features) t.attributes && (t.objectId = t.attributes[e]);
        }
        return r && ((r.queryGeometry = o), (r.queryGeometryType = a)), r;
      }
    },
    49214: (e, t, s) => {
      'use strict';
      s.r(t),
        s.d(t, {
          a: () => m,
          b: () => g,
          c: () => d,
          d: () => p,
          e: () => y,
          f: () => f,
          m: () => h,
          q: () => b,
          r: () => _,
        });
      var i = s(82058),
        r = s(76506),
        n = s(32101),
        o = s(32422),
        a = s(95533),
        l = s(76733),
        u = s(55823);
      function h(e) {
        const t = {};
        for (const s in e) {
          if ('declaredClass' === s) continue;
          const i = e[s];
          if (null != i && 'function' != typeof i)
            if (Array.isArray(i)) {
              t[s] = [];
              for (let e = 0; e < i.length; e++) t[s][e] = h(i[e]);
            } else 'object' == typeof i ? i.toJSON && (t[s] = JSON.stringify(i)) : (t[s] = i);
        }
        return t;
      }
      function c(e, t) {
        const s = e.geometry,
          i = e.toJSON(),
          n = i;
        if (
          ((0, r.i)(s) &&
            ((n.geometry = JSON.stringify(s)),
            (n.geometryType = (0, o.Ji)(s)),
            (n.inSR = s.spatialReference.wkid || JSON.stringify(s.spatialReference))),
          i.groupByFieldsForStatistics &&
            (n.groupByFieldsForStatistics = i.groupByFieldsForStatistics.join(',')),
          i.objectIds && (n.objectIds = i.objectIds.join(',')),
          i.orderByFields && (n.orderByFields = i.orderByFields.join(',')),
          !i.outFields ||
          (!i.returnDistinctValues &&
            ((null != t && t.returnCountOnly) ||
              (null != t && t.returnExtentOnly) ||
              (null != t && t.returnIdsOnly)))
            ? delete n.outFields
            : -1 !== i.outFields.indexOf('*')
            ? (n.outFields = '*')
            : (n.outFields = i.outFields.join(',')),
          i.outSR
            ? (n.outSR = i.outSR.wkid || JSON.stringify(i.outSR))
            : s && (i.returnGeometry || i.returnCentroid) && (n.outSR = n.inSR),
          i.returnGeometry && delete i.returnGeometry,
          i.outStatistics && (n.outStatistics = JSON.stringify(i.outStatistics)),
          i.pixelSize && (n.pixelSize = JSON.stringify(i.pixelSize)),
          i.quantizationParameters &&
            (n.quantizationParameters = JSON.stringify(i.quantizationParameters)),
          i.parameterValues && (n.parameterValues = JSON.stringify(i.parameterValues)),
          i.rangeValues && (n.rangeValues = JSON.stringify(i.rangeValues)),
          i.dynamicDataSource &&
            ((n.layer = JSON.stringify({ source: i.dynamicDataSource })),
            delete i.dynamicDataSource),
          i.timeExtent)
        ) {
          const e = i.timeExtent,
            { start: t, end: s } = e;
          (null == t && null == s) ||
            (n.time = t === s ? t : `${null == t ? 'null' : t},${null == s ? 'null' : s}`),
            delete i.timeExtent;
        }
        return n;
      }
      async function d(e, t, s, i) {
        const n =
          (0, r.i)(t.timeExtent) && t.timeExtent.isEmpty
            ? { data: { features: [] } }
            : await _(e, t, 'json', i);
        return (0, u.a)(t, s, n.data), n;
      }
      async function p(e, t, s, i) {
        if ((0, r.i)(t.timeExtent) && t.timeExtent.isEmpty)
          return Promise.resolve({ data: s.createFeatureResult() });
        const n = await f(e, t, i),
          o = n;
        return (o.data = (0, l.p)(n.data, s)), o;
      }
      function f(e, t, s) {
        return _(e, t, 'pbf', s);
      }
      function g(e, t, s) {
        return (0, r.i)(t.timeExtent) && t.timeExtent.isEmpty
          ? Promise.resolve({ data: { objectIds: [] } })
          : _(e, t, 'json', s, { returnIdsOnly: !0 });
      }
      function y(e, t, s) {
        return (0, r.i)(t.timeExtent) && t.timeExtent.isEmpty
          ? Promise.resolve({ data: { count: 0 } })
          : _(e, t, 'json', s, { returnIdsOnly: !0, returnCountOnly: !0 });
      }
      function m(e, t, s) {
        return (0, r.i)(t.timeExtent) && t.timeExtent.isEmpty
          ? Promise.resolve({ data: { count: 0, extent: null } })
          : _(e, t, 'json', s, { returnExtentOnly: !0, returnCountOnly: !0 }).then((e) => {
              const t = e.data;
              if (t.hasOwnProperty('extent')) return e;
              if (t.features) throw new Error('Layer does not support extent calculation.');
              if (t.hasOwnProperty('count'))
                throw new Error('Layer does not support extent calculation.');
              return e;
            });
      }
      function _(e, t, s, o = {}, l = {}) {
        const u = 'string' == typeof e ? (0, n.mN)(e) : e,
          d = t.geometry ? [t.geometry] : [];
        return (
          (o.responseType = 'pbf' === s ? 'array-buffer' : 'json'),
          (0, a.aX)(d, null, o).then((e) => {
            const a = e && e[0];
            (0, r.i)(a) && ((t = t.clone()).geometry = a);
            const d = h({ ...u.query, f: s, ...l, ...c(t, l) });
            return (0, i.default)((0, n.v_)(u.path, 'query'), {
              ...o,
              query: { ...d, ...o.query },
            });
          })
        );
      }
      var b = Object.freeze({
        __proto__: null,
        queryToQueryStringParameters: c,
        executeQuery: d,
        executeQueryPBF: p,
        executeQueryPBFBuffer: f,
        executeQueryForIds: g,
        executeQueryForCount: y,
        executeQueryForExtent: m,
        runQuery: _,
      });
    },
    55823: (e, t, s) => {
      'use strict';
      s.d(t, { a: () => r });
      var i = s(92847);
      function r(e, t, s) {
        if (!s || !s.features || !s.hasZ) return;
        const r = (0, i.g)(s.geometryType, t, e.outSpatialReference);
        if (r) for (const e of s.features) r(e.geometry);
      }
    },
    92847: (e, t, s) => {
      'use strict';
      s.d(t, { g: () => o, u: () => l });
      var i = s(76506),
        r = s(53785),
        n = s(60947);
      function o(e, t, s) {
        if ((0, i.b)(t) || (0, i.b)(s) || s.vcsWkid || (0, n.e)(t, s)) return null;
        const o = (0, r.d)(t) / (0, r.d)(s);
        if (1 === o) return null;
        switch (e) {
          case 'point':
          case 'esriGeometryPoint':
            return (e) => {
              return (s = o), void ((t = e) && null != t.z && (t.z *= s));
              var t, s;
            };
          case 'polyline':
          case 'esriGeometryPolyline':
            return (e) =>
              (function (e, t) {
                if (e) for (const s of e.paths) for (const e of s) e.length > 2 && (e[2] *= t);
              })(e, o);
          case 'polygon':
          case 'esriGeometryPolygon':
            return (e) =>
              (function (e, t) {
                if (e) for (const s of e.rings) for (const e of s) e.length > 2 && (e[2] *= t);
              })(e, o);
          case 'multipoint':
          case 'esriGeometryMultipoint':
            return (e) =>
              (function (e, t) {
                if (e) for (const s of e.points) s.length > 2 && (s[2] *= t);
              })(e, o);
          default:
            return null;
        }
      }
      function a(e, t, s) {
        if (null == e.hasM || e.hasZ)
          for (const e of t) for (const t of e) t.length > 2 && (t[2] *= s);
      }
      function l(e, t, s) {
        if ((!e && !t) || !s) return;
        const i = (0, r.d)(s);
        u(e, s, i), u(t, s, i);
      }
      function u(e, t, s) {
        if (e) for (const i of e) h(i.geometry, t, s);
      }
      function h(e, t, s) {
        if (!e || !e.spatialReference || (0, n.e)(e.spatialReference, t)) return;
        const i = (0, r.d)(e.spatialReference) / s;
        if (1 !== i)
          if ('x' in e) null != e.z && (e.z *= i);
          else if ('rings' in e) a(e, e.rings, i);
          else if ('paths' in e) a(e, e.paths, i);
          else if ('points' in e && (null == e.hasM || e.hasZ))
            for (const t of e.points) t.length > 2 && (t[2] *= i);
      }
    },
    95873: (e, t, s) => {
      'use strict';
      s.d(t, { r: () => f, p: () => p, W: () => c });
      var i = s(29768),
        r = s(21972),
        n = s(82933),
        o = s(34250),
        a = s(17533),
        l = s(76506),
        u = s(6906),
        h = s(617);
      s(23639),
        s(92143),
        s(31450),
        s(71552),
        s(40642),
        s(86656),
        s(22723),
        s(91055),
        s(27794),
        s(91306),
        s(81172),
        s(50406),
        s(60991),
        s(15324),
        s(76996);
      let c = class extends r.Z {
        constructor() {
          super(...arguments),
            (this.updating = !1),
            (this.handleId = 0),
            (this.handles = new n.Z()),
            (this.scheduleHandleId = 0),
            (this.pendingPromises = new Set());
        }
        destroy() {
          this.removeAll(), this.handles.destroy();
        }
        add(e, t, s, i = 0) {
          const r = 0 != (1 & i),
            n = ++this.handleId;
          r || this.installSyncUpdatingWatch(e, t, n);
          const o = 0 != (2 & i) ? (0, h.S1)(e, t, s, r) : e.watch(t, s, r);
          return this.handles.add(o, n), { remove: () => this.handles.remove(n) };
        }
        addOnCollectionPropertyChange(e, t, s, i = 0) {
          const r = 0 != (2 & i),
            n = ++this.handleId;
          return (
            this.handles.add(
              [
                (0, h.on)(e, t, 'after-changes', this.createSyncUpdatingCallback()),
                (0, h.on)(
                  e,
                  t,
                  'change',
                  s,
                  r
                    ? (e) => {
                        s({ added: e.items, removed: [], moved: [], target: e });
                      }
                    : void 0,
                ),
              ],
              n,
            ),
            {
              remove: () => {
                this.handles.remove(n);
              },
            }
          );
        }
        addOnCollectionChange(e, t, s = 0) {
          const i = 0 != (2 & s),
            r = ++this.handleId;
          return (
            this.handles.add(
              [e.on('after-changes', this.createSyncUpdatingCallback()), e.on('change', t)],
              r,
            ),
            i && t({ added: e.items, removed: [], moved: [], target: e }),
            {
              remove: () => {
                this.handles.remove(r);
              },
            }
          );
        }
        addPromise(e) {
          if ((0, l.b)(e)) return e;
          const t = ++this.handleId;
          this.handles.add(
            {
              remove: () => {
                this.pendingPromises.delete(e) &&
                  (0 !== this.pendingPromises.size ||
                    this.handles.has(d) ||
                    this._set('updating', !1));
              },
            },
            t,
          ),
            this.pendingPromises.add(e),
            this._set('updating', !0);
          const s = () => this.handles.remove(t);
          return e.then(s, s), e;
        }
        removeAll() {
          this.pendingPromises.clear(), this.handles.removeAll(), this._set('updating', !1);
        }
        installSyncUpdatingWatch(e, t, s) {
          const i = this.createSyncUpdatingCallback(),
            n = (0, r.r)(() => (0, o.v)(e, t), i);
          return this.handles.add(n, s), n;
        }
        createSyncUpdatingCallback() {
          return () => {
            this.handles.remove(d), ++this.scheduleHandleId;
            const e = this.scheduleHandleId;
            this._get('updating') || this._set('updating', !0),
              this.handles.add(
                (0, u.Os)(() => {
                  e === this.scheduleHandleId &&
                    (this._set('updating', this.pendingPromises.size > 0), this.handles.remove(d));
                }),
                d,
              );
          };
        }
      };
      (0, i._)([(0, o.Cb)({ readOnly: !0 })], c.prototype, 'updating', void 0),
        (c = (0, i._)([(0, a.j)('esri.views.support.WatchUpdatingTracking')], c));
      const d = -42,
        p = (e) => {
          let t = class extends e {
            destroy() {
              this.destroyed || (this.handles.destroy(), this.updatingHandles.destroy());
            }
            get handles() {
              return this._get('handles') || new n.Z();
            }
            get updatingHandles() {
              return this._get('updatingHandles') || new c();
            }
          };
          return (
            (0, i._)([(0, o.Cb)({ readOnly: !0 })], t.prototype, 'handles', null),
            (0, i._)([(0, o.Cb)({ readOnly: !0 })], t.prototype, 'updatingHandles', null),
            (t = (0, i._)([(0, a.j)('esri.core.HandleOwner')], t)),
            t
          );
        };
      let f = class extends p(r.Z) {};
      f = (0, i._)([(0, a.j)('esri.core.HandleOwner')], f);
    },
    82933: (e, t, s) => {
      'use strict';
      s.d(t, { Z: () => h });
      var i = s(29768),
        r = s(21972),
        n = s(15324),
        o = s(76506),
        a = s(34250),
        l = s(17533);
      s(23639),
        s(92143),
        s(31450),
        s(71552),
        s(40642),
        s(86656),
        s(22723),
        s(91055),
        s(27794),
        s(6906),
        s(50406),
        s(60991),
        s(81172),
        s(91306),
        s(76996);
      let u = class extends r.Z {
        constructor(e) {
          super(e), (this._groups = new Map());
        }
        destroy() {
          this.removeAll();
        }
        get size() {
          let e = 0;
          return (
            this._groups.forEach((t) => {
              e += t.length;
            }),
            e
          );
        }
        add(e, t) {
          if (!this._isHandle(e) && !Array.isArray(e) && !n.Z.isCollection(e)) return this;
          const s = this._getOrCreateGroup(t);
          return (
            Array.isArray(e) || n.Z.isCollection(e)
              ? e.forEach((e) => this._isHandle(e) && s.push(e))
              : s.push(e),
            this.notifyChange('size'),
            this
          );
        }
        forEach(e, t) {
          if ('function' == typeof e) this._groups.forEach((t) => t.forEach(e));
          else {
            const s = this._getGroup(e);
            s && t && s.forEach(t);
          }
        }
        has(e) {
          return this._groups.has(this._ensureGroupKey(e));
        }
        remove(e) {
          if (Array.isArray(e) || n.Z.isCollection(e)) return e.forEach(this.remove, this), this;
          if (!this.has(e)) return this;
          const t = this._getGroup(e);
          for (let e = 0; e < t.length; e++) t[e].remove();
          return this._deleteGroup(e), this.notifyChange('size'), this;
        }
        removeAll() {
          return (
            this._groups.forEach((e) => {
              for (let t = 0; t < e.length; t++) e[t].remove();
            }),
            this._groups.clear(),
            this.notifyChange('size'),
            this
          );
        }
        _isHandle(e) {
          return e && !!e.remove;
        }
        _getOrCreateGroup(e) {
          if (this.has(e)) return this._getGroup(e);
          const t = [];
          return this._groups.set(this._ensureGroupKey(e), t), t;
        }
        _getGroup(e) {
          return (0, o.a)(this._groups.get(this._ensureGroupKey(e)));
        }
        _deleteGroup(e) {
          return this._groups.delete(this._ensureGroupKey(e));
        }
        _ensureGroupKey(e) {
          return e || '_default_';
        }
      };
      (0, i._)([(0, a.Cb)({ readOnly: !0 })], u.prototype, 'size', null),
        (u = (0, i._)([(0, l.j)('esri.core.Handles')], u));
      const h = u;
    },
    617: (e, t, s) => {
      'use strict';
      s.d(t, {
        S1: () => h,
        on: () => g,
        OY: () => f,
        cm: () => d,
        N1: () => c,
        LR: () => p,
        tH: () => r,
      });
      var i = s(50406);
      function r(e, t, s, r, n) {
        const o = 'function' == typeof r ? r : null,
          a = 'object' == typeof r ? r : null;
        'boolean' == typeof r && (n = r);
        let l,
          u = !1;
        function h() {
          l && (l.remove(), (l = null));
        }
        const c = (0, i.dD)();
        (0, i.fu)(a, () => {
          h(), c.reject((0, i.zE)());
        });
        const d = {
          then: c.promise.then.bind(c.promise),
          catch: c.promise.catch.bind(c.promise),
          remove: h,
        };
        return (
          Object.freeze(d),
          (l = (function (e, t, s, i, r) {
            const n = e.watch(
              t,
              (t, r, n, o) => {
                (s && !s(t)) || null == i || i.call(e, t, r, n, o);
              },
              r,
            );
            if (Array.isArray(t))
              for (const r of t) {
                const n = e.get(r);
                s && s(n) && (null == i || i.call(e, n, n, t, e));
              }
            else {
              const r = e.get(t);
              s && s(r) && (null == i || i.call(e, r, r, t, e));
            }
            return n;
          })(
            e,
            t,
            s,
            (t, s, i, r) => {
              (u = !0),
                h(),
                o && o.call(e, t, s, i, r),
                c.resolve({ value: t, oldValue: s, propertyName: i, target: r });
            },
            n,
          )),
          u && h(),
          d
        );
      }
      function n(e) {
        return !!e;
      }
      function o(e) {
        return !e;
      }
      function a(e) {
        return !0 === e;
      }
      function l(e) {
        return !1 === e;
      }
      s(76506), s(60991), s(92143), s(31450), s(71552), s(40642), s(81172);
      const u = /\?(\.|$)/g;
      function h(e, t, s, i) {
        const r = Array.isArray(t) ? t : t.indexOf(',') > -1 ? t.split(',') : [t],
          n = (function (e, t, s, i) {
            return e.watch(t, s, i);
          })(e, t, s, i);
        for (const t of r) {
          const i = t.trim().replace(u, '$1'),
            r = e.get(i);
          s.call(e, r, r, i, e);
        }
        return n;
      }
      function c(e, t, s, i) {
        return r(e, t, n, s, i);
      }
      function d(e, t, s, i) {
        return r(e, t, o, s, i);
      }
      function p(e, t, s, i) {
        return r(e, t, a, s, i);
      }
      function f(e, t, s, i) {
        return r(e, t, l, s, i);
      }
      function g(e, t, s, r, n, o, a) {
        const l = {};
        function u(t) {
          const i = l[t];
          i && (o && o(i.target, t, e, s), i.handle.remove(), delete l[t]);
        }
        const c = h(
          e,
          t,
          (t, o, a) => {
            u(a),
              (0, i.i)(t) &&
                ((l[a] = { handle: (0, i.o)(t, s, r), target: t }), n && n(t, a, e, s));
          },
          a,
        );
        return {
          remove() {
            c.remove();
            for (const e in l) u(e);
          },
        };
      }
    },
    97546: (e, t, s) => {
      'use strict';
      s.d(t, { Z: () => y });
      var i,
        r = s(29768),
        n = s(57251),
        o = s(74673),
        a = s(34250),
        l = (s(76506), s(91306)),
        u = (s(92143), s(59465)),
        h = s(97714),
        c = s(17533),
        d = s(9801),
        p = s(54732);
      s(71552),
        s(21972),
        s(23639),
        s(86656),
        s(22723),
        s(91055),
        s(27794),
        s(6906),
        s(50406),
        s(60991),
        s(81172),
        s(31450),
        s(40642),
        s(26341),
        s(53523),
        s(42911),
        s(46826),
        s(45433);
      const f = new n.J({
        binary: 'binary',
        coordinate: 'coordinate',
        countOrAmount: 'count-or-amount',
        dateAndTime: 'date-and-time',
        description: 'description',
        locationOrPlaceName: 'location-or-place-name',
        measurement: 'measurement',
        nameOrTitle: 'name-or-title',
        none: 'none',
        orderedOrRanked: 'ordered-or-ranked',
        percentageOrRatio: 'percentage-or-ratio',
        typeOrCategory: 'type-or-category',
        uniqueIdentifier: 'unique-identifier',
      });
      let g = (i = class extends o.a {
        constructor(e) {
          super(e),
            (this.alias = null),
            (this.defaultValue = void 0),
            (this.description = null),
            (this.domain = null),
            (this.editable = !0),
            (this.length = -1),
            (this.name = null),
            (this.nullable = !0),
            (this.type = null),
            (this.valueType = null);
        }
        readDescription(e, { description: t }) {
          let s;
          try {
            s = JSON.parse(t);
          } catch (e) {}
          return s ? s.value : null;
        }
        readValueType(e, { description: t }) {
          let s;
          try {
            s = JSON.parse(t);
          } catch (e) {}
          return s ? f.fromJSON(s.fieldValueType) : null;
        }
        clone() {
          return new i({
            alias: this.alias,
            defaultValue: this.defaultValue,
            description: this.description,
            domain: (this.domain && this.domain.clone()) || null,
            editable: this.editable,
            length: this.length,
            name: this.name,
            nullable: this.nullable,
            type: this.type,
            valueType: this.valueType,
          });
        }
      });
      (0, r._)([(0, a.Cb)({ type: String, json: { write: !0 } })], g.prototype, 'alias', void 0),
        (0, r._)(
          [(0, a.Cb)({ type: [String, Number], json: { write: { allowNull: !0 } } })],
          g.prototype,
          'defaultValue',
          void 0,
        ),
        (0, r._)([(0, a.Cb)()], g.prototype, 'description', void 0),
        (0, r._)([(0, h.r)('description')], g.prototype, 'readDescription', null),
        (0, r._)(
          [(0, a.Cb)({ types: d.t, json: { read: { reader: d.f }, write: !0 } })],
          g.prototype,
          'domain',
          void 0,
        ),
        (0, r._)(
          [(0, a.Cb)({ type: Boolean, json: { write: !0 } })],
          g.prototype,
          'editable',
          void 0,
        ),
        (0, r._)([(0, a.Cb)({ type: l.I, json: { write: !0 } })], g.prototype, 'length', void 0),
        (0, r._)([(0, a.Cb)({ type: String, json: { write: !0 } })], g.prototype, 'name', void 0),
        (0, r._)(
          [(0, a.Cb)({ type: Boolean, json: { write: !0 } })],
          g.prototype,
          'nullable',
          void 0,
        ),
        (0, r._)([(0, u.e)(p.k)], g.prototype, 'type', void 0),
        (0, r._)([(0, a.Cb)()], g.prototype, 'valueType', void 0),
        (0, r._)([(0, h.r)('valueType', ['description'])], g.prototype, 'readValueType', null),
        (g = i = (0, r._)([(0, c.j)('esri.layers.support.Field')], g));
      const y = g;
    },
    92817: (e, t, s) => {
      'use strict';
      s.d(t, { Z: () => h });
      var i,
        r = s(29768),
        n = s(74673),
        o = s(34250),
        a = (s(76506), s(91306)),
        l = (s(92143), s(17533));
      s(21972),
        s(23639),
        s(86656),
        s(22723),
        s(91055),
        s(27794),
        s(6906),
        s(50406),
        s(60991),
        s(81172),
        s(71552),
        s(31450),
        s(40642),
        s(26341);
      let u = (i = class extends n.a {
        constructor(e) {
          super(e),
            (this.level = 0),
            (this.levelValue = null),
            (this.resolution = 0),
            (this.scale = 0);
        }
        clone() {
          return new i({
            level: this.level,
            levelValue: this.levelValue,
            resolution: this.resolution,
            scale: this.scale,
          });
        }
      });
      (0, r._)([(0, o.Cb)({ type: a.I, json: { write: !0 } })], u.prototype, 'level', void 0),
        (0, r._)(
          [(0, o.Cb)({ type: String, json: { write: !0 } })],
          u.prototype,
          'levelValue',
          void 0,
        ),
        (0, r._)(
          [(0, o.Cb)({ type: Number, json: { write: !0 } })],
          u.prototype,
          'resolution',
          void 0,
        ),
        (0, r._)([(0, o.Cb)({ type: Number, json: { write: !0 } })], u.prototype, 'scale', void 0),
        (u = i = (0, r._)([(0, l.j)('esri.layers.support.LOD')], u));
      const h = u;
    },
    43352: (e, t, s) => {
      'use strict';
      s.d(t, { Z: () => v });
      var i,
        r = s(29768),
        n = s(57251),
        o = s(74673),
        a = s(53785),
        l = s(34250),
        u = (s(76506), s(91306)),
        h = (s(92143), s(97714)),
        c = s(17533),
        d = s(2906),
        p = s(91597),
        f = s(60947),
        g = s(92482),
        y = s(35132),
        m = s(92817);
      s(71552),
        s(21972),
        s(23639),
        s(86656),
        s(22723),
        s(91055),
        s(27794),
        s(6906),
        s(50406),
        s(60991),
        s(81172),
        s(31450),
        s(40642),
        s(26341),
        s(95587),
        s(89623),
        s(86787),
        s(73796),
        s(21801);
      const _ = new n.J({
        PNG: 'png',
        PNG8: 'png8',
        PNG24: 'png24',
        PNG32: 'png32',
        JPEG: 'jpg',
        JPG: 'jpg',
        DIB: 'dib',
        TIFF: 'tiff',
        EMF: 'emf',
        PS: 'ps',
        PDF: 'pdf',
        GIF: 'gif',
        SVG: 'svg',
        SVGZ: 'svgz',
        Mixed: 'mixed',
        MIXED: 'mixed',
        LERC: 'lerc',
        LERC2D: 'lerc2d',
        RAW: 'raw',
        pbf: 'pbf',
      });
      let b = (i = class extends o.a {
        constructor(e) {
          super(e),
            (this.dpi = 96),
            (this.format = null),
            (this.origin = null),
            (this.minScale = 0),
            (this.maxScale = 0),
            (this.size = null),
            (this.spatialReference = null);
        }
        static create(e = {}) {
          const {
            resolutionFactor: t = 1,
            scales: s,
            size: r = 256,
            spatialReference: n = f.Z.WebMercator,
            numLODs: o = 24,
          } = e;
          if (!(0, f.j)(n)) {
            const e = [];
            if (s)
              for (let t = 0; t < s.length; t++) {
                const i = s[t];
                e.push({ level: t, scale: i, resolution: i });
              }
            else {
              let t = 5e-4;
              for (let s = o - 1; s >= 0; s--)
                e.unshift({ level: s, scale: t, resolution: t }), (t *= 2);
            }
            return new i({
              dpi: 96,
              lods: e,
              origin: new p.Z(0, 0, n),
              size: [r, r],
              spatialReference: n,
            });
          }
          const l = (0, f.g)(n),
            u = e.origin
              ? new p.Z({ x: e.origin.x, y: e.origin.y, spatialReference: n })
              : new p.Z(
                  l
                    ? { x: l.origin[0], y: l.origin[1], spatialReference: n }
                    : { x: 0, y: 0, spatialReference: n },
                ),
            h = 1 / (39.37 * (0, a.a)(n) * 96),
            c = [];
          if (s)
            for (let e = 0; e < s.length; e++) {
              const t = s[e],
                i = t * h;
              c.push({ level: e, scale: t, resolution: i });
            }
          else {
            let e = (0, f.l)(n) ? (512 / r) * 591657527.5917094 : (256 / r) * 591657527.591555;
            const s = Math.ceil(o / t);
            c.push({ level: 0, scale: e, resolution: e * h });
            for (let i = 1; i < s; i++) {
              const s = e / 2 ** t,
                r = s * h;
              c.push({ level: i, scale: s, resolution: r }), (e = s);
            }
          }
          return new i({ dpi: 96, lods: c, origin: u, size: [r, r], spatialReference: n });
        }
        get isWrappable() {
          const { spatialReference: e, origin: t } = this;
          if (e && t) {
            const s = (0, f.g)(e);
            return e.isWrappable && Math.abs(s.origin[0] - t.x) <= s.dx;
          }
          return !1;
        }
        readOrigin(e, t) {
          return p.Z.fromJSON({ spatialReference: t.spatialReference, ...e });
        }
        set lods(e) {
          let t = 0,
            s = 0;
          const i = [];
          (this._levelToLOD = {}),
            e &&
              ((t = -1 / 0),
              (s = 1 / 0),
              e.forEach((e) => {
                i.push(e.scale),
                  (t = e.scale > t ? e.scale : t),
                  (s = e.scale < s ? e.scale : s),
                  (this._levelToLOD[e.level] = e);
              })),
            this._set('scales', i),
            this._set('minScale', t),
            this._set('maxScale', s),
            this._set('lods', e),
            this._initializeUpsampleLevels();
        }
        readSize(e, t) {
          return [t.cols, t.rows];
        }
        writeSize(e, t) {
          (t.cols = e[0]), (t.rows = e[0]);
        }
        zoomToScale(e) {
          const t = this.scales;
          if (e <= 0) return t[0];
          if (e >= t.length - 1) return t[t.length - 1];
          {
            const s = Math.floor(e),
              i = s + 1;
            return t[s] / (t[s] / t[i]) ** (e - s);
          }
        }
        scaleToZoom(e) {
          const t = this.scales,
            s = t.length - 1;
          let i = 0;
          for (; i < s; i++) {
            const s = t[i],
              r = t[i + 1];
            if (s <= e) return i;
            if (r === e) return i + 1;
            if (s > e && r < e) return i + Math.log(s / e) / Math.log(s / r);
          }
          return i;
        }
        snapScale(e, t = 0.95) {
          const s = this.scaleToZoom(e);
          return s % Math.floor(s) >= t
            ? this.zoomToScale(Math.ceil(s))
            : this.zoomToScale(Math.floor(s));
        }
        tileAt(e, t, s, i) {
          const r = this.lodAt(e);
          if (!r) return null;
          let n, o;
          if ('number' == typeof t) (n = t), (o = s);
          else if ((0, f.e)(t.spatialReference, this.spatialReference))
            (n = t.x), (o = t.y), (i = s);
          else {
            const e = (0, y.iV)(t, this.spatialReference);
            if (!e) return null;
            (n = e.x), (o = e.y), (i = s);
          }
          const a = r.resolution * this.size[0],
            l = r.resolution * this.size[1];
          return (
            i || (i = { id: null, level: 0, row: 0, col: 0, extent: (0, g.a)() }),
            (i.level = e),
            (i.row = Math.floor((this.origin.y - o) / l + 0.001)),
            (i.col = Math.floor((n - this.origin.x) / a + 0.001)),
            this.updateTileInfo(i),
            i
          );
        }
        updateTileInfo(e, t = 0) {
          let s = this.lodAt(e.level);
          if (!s && 1 === t) {
            const t = this.lods[this.lods.length - 1];
            t.level < e.level && (s = t);
          }
          if (!s) return;
          const i = e.level - s.level,
            r = (s.resolution * this.size[0]) / 2 ** i,
            n = (s.resolution * this.size[1]) / 2 ** i;
          (e.id = `${e.level}/${e.row}/${e.col}`),
            e.extent || (e.extent = (0, g.a)()),
            (e.extent[0] = this.origin.x + e.col * r),
            (e.extent[1] = this.origin.y - (e.row + 1) * n),
            (e.extent[2] = e.extent[0] + r),
            (e.extent[3] = e.extent[1] + n);
        }
        upsampleTile(e) {
          const t = this._upsampleLevels[e.level];
          return !(
            !t ||
            -1 === t.parentLevel ||
            ((e.level = t.parentLevel),
            (e.row = Math.floor(e.row / t.factor + 0.001)),
            (e.col = Math.floor(e.col / t.factor + 0.001)),
            this.updateTileInfo(e),
            0)
          );
        }
        getTileBounds(e, t) {
          const { resolution: s } = this.lodAt(t.level),
            i = s * this.size[0],
            r = s * this.size[1];
          return (
            (e[0] = this.origin.x + t.col * i),
            (e[1] = this.origin.y - (t.row + 1) * r),
            (e[2] = e[0] + i),
            (e[3] = e[1] + r),
            e
          );
        }
        lodAt(e) {
          return (this._levelToLOD && this._levelToLOD[e]) || null;
        }
        clone() {
          return i.fromJSON(this.write({}));
        }
        _initializeUpsampleLevels() {
          const e = this.lods;
          this._upsampleLevels = [];
          let t = null;
          for (let s = 0; s < e.length; s++) {
            const i = e[s];
            (this._upsampleLevels[i.level] = {
              parentLevel: t ? t.level : -1,
              factor: t ? t.resolution / i.resolution : 0,
            }),
              (t = i);
          }
        }
      });
      (0, r._)(
        [(0, l.Cb)({ type: Number, json: { write: !0 } })],
        b.prototype,
        'compressionQuality',
        void 0,
      ),
        (0, r._)([(0, l.Cb)({ type: Number, json: { write: !0 } })], b.prototype, 'dpi', void 0),
        (0, r._)(
          [
            (0, l.Cb)({
              type: String,
              json: {
                read: _.read,
                write: _.write,
                origins: { 'web-scene': { read: !1, write: !1 } },
              },
            }),
          ],
          b.prototype,
          'format',
          void 0,
        ),
        (0, r._)([(0, l.Cb)({ readOnly: !0 })], b.prototype, 'isWrappable', null),
        (0, r._)([(0, l.Cb)({ type: p.Z, json: { write: !0 } })], b.prototype, 'origin', void 0),
        (0, r._)([(0, h.r)('origin')], b.prototype, 'readOrigin', null),
        (0, r._)(
          [(0, l.Cb)({ type: [m.Z], value: null, json: { write: !0 } })],
          b.prototype,
          'lods',
          null,
        ),
        (0, r._)([(0, l.Cb)({ readOnly: !0 })], b.prototype, 'minScale', void 0),
        (0, r._)([(0, l.Cb)({ readOnly: !0 })], b.prototype, 'maxScale', void 0),
        (0, r._)([(0, l.Cb)({ readOnly: !0 })], b.prototype, 'scales', void 0),
        (0, r._)(
          [
            (0, l.Cb)({
              cast: (e) => (Array.isArray(e) ? e : 'number' == typeof e ? [e, e] : [256, 256]),
            }),
          ],
          b.prototype,
          'size',
          void 0,
        ),
        (0, r._)([(0, h.r)('size', ['rows', 'cols'])], b.prototype, 'readSize', null),
        (0, r._)(
          [(0, d.w)('size', { cols: { type: u.I }, rows: { type: u.I } })],
          b.prototype,
          'writeSize',
          null,
        ),
        (0, r._)(
          [(0, l.Cb)({ type: f.Z, json: { write: !0 } })],
          b.prototype,
          'spatialReference',
          void 0,
        ),
        (b = i = (0, r._)([(0, c.j)('esri.layers.support.TileInfo')], b));
      const v = b;
    },
    77361: (e, t, s) => {
      'use strict';
      s.d(t, { Z: () => m });
      var i,
        r = s(29768),
        n = s(93314),
        o = s(59765),
        a = s(74673),
        l = s(76506),
        u = s(34250),
        h = (s(91306), s(92143), s(97714)),
        c = s(17533),
        d = s(2906);
      s(35197),
        s(21972),
        s(23639),
        s(86656),
        s(22723),
        s(91055),
        s(27794),
        s(6906),
        s(50406),
        s(60991),
        s(81172),
        s(71552),
        s(31450),
        s(40642),
        s(26341),
        s(57251);
      let p = (i = class extends a.a {
        constructor(e) {
          super(e), (this.respectsDaylightSaving = !1), (this.timezone = null);
        }
        readRespectsDaylightSaving(e, t) {
          return void 0 !== t.respectsDaylightSaving
            ? t.respectsDaylightSaving
            : void 0 !== t.respectDaylightSaving && t.respectDaylightSaving;
        }
        clone() {
          const { respectsDaylightSaving: e, timezone: t } = this;
          return new i({ respectsDaylightSaving: e, timezone: t });
        }
      });
      (0, r._)(
        [(0, u.Cb)({ type: Boolean, json: { write: !0 } })],
        p.prototype,
        'respectsDaylightSaving',
        void 0,
      ),
        (0, r._)(
          [(0, h.r)('respectsDaylightSaving', ['respectsDaylightSaving', 'respectDaylightSaving'])],
          p.prototype,
          'readRespectsDaylightSaving',
          null,
        ),
        (0, r._)(
          [
            (0, u.Cb)({
              type: String,
              json: { read: { source: 'timeZone' }, write: { target: 'timeZone' } },
            }),
          ],
          p.prototype,
          'timezone',
          void 0,
        ),
        (p = i = (0, r._)([(0, c.j)('esri.layers.support.TimeReference')], p));
      var f,
        g = p;
      let y = (f = class extends a.a {
        constructor(e) {
          super(e),
            (this.cumulative = !1),
            (this.endField = null),
            (this.fullTimeExtent = null),
            (this.hasLiveData = !1),
            (this.interval = null),
            (this.startField = null),
            (this.timeReference = null),
            (this.trackIdField = null),
            (this.useTime = !0);
        }
        readFullTimeExtent(e, t) {
          if (!t.timeExtent || !Array.isArray(t.timeExtent) || 2 !== t.timeExtent.length)
            return null;
          const s = new Date(t.timeExtent[0]),
            i = new Date(t.timeExtent[1]);
          return new n.Z({ start: s, end: i });
        }
        writeFullTimeExtent(e, t) {
          e && (0, l.i)(e.start) && (0, l.i)(e.end)
            ? (t.timeExtent = [e.start.getTime(), e.end.getTime()])
            : (t.timeExtent = null);
        }
        readInterval(e, t) {
          return t.timeInterval && t.timeIntervalUnits
            ? new o.Z({ value: t.timeInterval, unit: o.t.fromJSON(t.timeIntervalUnits) })
            : t.defaultTimeInterval && t.defaultTimeIntervalUnits
            ? new o.Z({
                value: t.defaultTimeInterval,
                unit: o.t.fromJSON(t.defaultTimeIntervalUnits),
              })
            : null;
        }
        writeInterval(e, t) {
          if (e) {
            const s = e.toJSON();
            (t.timeInterval = s.value), (t.timeIntervalUnits = s.unit);
          } else (t.timeInterval = null), (t.timeIntervalUnits = null);
        }
        clone() {
          const {
            cumulative: e,
            endField: t,
            hasLiveData: s,
            interval: i,
            startField: r,
            timeReference: n,
            fullTimeExtent: o,
            trackIdField: a,
            useTime: u,
          } = this;
          return new f({
            cumulative: e,
            endField: t,
            hasLiveData: s,
            interval: i,
            startField: r,
            timeReference: (0, l.d9)(n),
            fullTimeExtent: (0, l.d9)(o),
            trackIdField: a,
            useTime: u,
          });
        }
      });
      (0, r._)(
        [
          (0, u.Cb)({
            type: Boolean,
            json: {
              read: { source: 'exportOptions.timeDataCumulative' },
              write: { target: 'exportOptions.timeDataCumulative' },
            },
          }),
        ],
        y.prototype,
        'cumulative',
        void 0,
      ),
        (0, r._)(
          [
            (0, u.Cb)({
              type: String,
              json: {
                read: { source: 'endTimeField' },
                write: { target: 'endTimeField', allowNull: !0 },
              },
            }),
          ],
          y.prototype,
          'endField',
          void 0,
        ),
        (0, r._)(
          [(0, u.Cb)({ type: n.Z, json: { write: { enabled: !0, allowNull: !0 } } })],
          y.prototype,
          'fullTimeExtent',
          void 0,
        ),
        (0, r._)(
          [(0, h.r)('fullTimeExtent', ['timeExtent'])],
          y.prototype,
          'readFullTimeExtent',
          null,
        ),
        (0, r._)([(0, d.w)('fullTimeExtent')], y.prototype, 'writeFullTimeExtent', null),
        (0, r._)(
          [(0, u.Cb)({ type: Boolean, json: { write: !0 } })],
          y.prototype,
          'hasLiveData',
          void 0,
        ),
        (0, r._)(
          [(0, u.Cb)({ type: o.Z, json: { write: { enabled: !0, allowNull: !0 } } })],
          y.prototype,
          'interval',
          void 0,
        ),
        (0, r._)(
          [
            (0, h.r)('interval', [
              'timeInterval',
              'timeIntervalUnits',
              'defaultTimeInterval',
              'defaultTimeIntervalUnits',
            ]),
          ],
          y.prototype,
          'readInterval',
          null,
        ),
        (0, r._)([(0, d.w)('interval')], y.prototype, 'writeInterval', null),
        (0, r._)(
          [
            (0, u.Cb)({
              type: String,
              json: {
                read: { source: 'startTimeField' },
                write: { target: 'startTimeField', allowNull: !0 },
              },
            }),
          ],
          y.prototype,
          'startField',
          void 0,
        ),
        (0, r._)(
          [(0, u.Cb)({ type: g, json: { write: { enabled: !0, allowNull: !0 } } })],
          y.prototype,
          'timeReference',
          void 0,
        ),
        (0, r._)(
          [(0, u.Cb)({ type: String, json: { write: { enabled: !0, allowNull: !0 } } })],
          y.prototype,
          'trackIdField',
          void 0,
        ),
        (0, r._)(
          [
            (0, u.Cb)({
              type: Boolean,
              json: {
                read: { source: 'exportOptions.useTime' },
                write: { target: 'exportOptions.useTime' },
              },
            }),
          ],
          y.prototype,
          'useTime',
          void 0,
        ),
        (y = f = (0, r._)([(0, c.j)('esri.layers.support.TimeInfo')], y));
      const m = y;
    },
  },
]);
