(self.webpackChunkRemoteClient = self.webpackChunkRemoteClient || []).push([
  [8989, 3754],
  {
    21781: (e, t, r) => {
      'use strict';
      r.d(t, { A: () => o });
      var s = r(29768),
        i = r(34250),
        n = (r(76506), r(91306), r(92143), r(17533));
      const o = (e) => {
        let t = class extends e {
          get apiKey() {
            var e;
            return this._isOverridden('apiKey')
              ? this._get('apiKey')
              : 'portalItem' in this
              ? null == (e = this.portalItem)
                ? void 0
                : e.apiKey
              : null;
          }
          set apiKey(e) {
            null != e
              ? this._override('apiKey', e)
              : (this._clearOverride('apiKey'), this.clear('apiKey', 'user'));
          }
        };
        return (
          (0, s._)([(0, i.Cb)({ type: String })], t.prototype, 'apiKey', null),
          (t = (0, s._)([(0, n.j)('esri.layers.mixins.APIKeyMixin')], t)),
          t
        );
      };
    },
    75025: (e, t, r) => {
      'use strict';
      r.d(t, { A: () => u });
      var s = r(29768),
        i = r(92143),
        n = r(76506),
        o = r(34250),
        a = (r(91306), r(17533)),
        l = r(21132);
      const u = (e) => {
        let t = class extends e {
          get title() {
            if (this._get('title') && 'defaults' !== this.originOf('title'))
              return this._get('title');
            if (this.url) {
              const e = (0, l.p)(this.url);
              if ((0, n.i)(e) && e.title) return e.title;
            }
            return this._get('title') || '';
          }
          set title(e) {
            this._set('title', e);
          }
          set url(e) {
            this._set('url', (0, l.s)(e, i.L.getLogger(this.declaredClass)));
          }
        };
        return (
          (0, s._)([(0, o.Cb)()], t.prototype, 'title', null),
          (0, s._)([(0, o.Cb)({ type: String })], t.prototype, 'url', null),
          (t = (0, s._)([(0, a.j)('esri.layers.mixins.ArcGISService')], t)),
          t
        );
      };
    },
    83805: (e, t, r) => {
      'use strict';
      r.d(t, { f: () => o });
      var s = r(82058),
        i = r(60991),
        n = r(76506);
      async function o(e, t, r, o, a, l) {
        let u = null;
        if ((0, n.i)(r)) {
          const t = `${e}/nodepages/`,
            i = t + Math.floor(r.rootIndex / r.nodesPerPage);
          try {
            return {
              type: 'page',
              rootPage: (
                await (0, s.default)(i, {
                  query: { f: 'json', token: o },
                  responseType: 'json',
                  signal: l,
                })
              ).data,
              rootIndex: r.rootIndex,
              pageSize: r.nodesPerPage,
              lodMetric: r.lodSelectionMetricType,
              urlPrefix: t,
            };
          } catch (e) {
            (0, n.i)(a) &&
              a.warn(
                '#fetchIndexInfo()',
                'Failed to load root node page. Falling back to node documents.',
                i,
                e,
              ),
              (u = e);
          }
        }
        if (!t) return null;
        const c = `${e}/nodes/`,
          p = c + (t && t.split('/').pop());
        try {
          return {
            type: 'node',
            rootNode: (
              await (0, s.default)(p, {
                query: { f: 'json', token: o },
                responseType: 'json',
                signal: l,
              })
            ).data,
            urlPrefix: c,
          };
        } catch (e) {
          throw new i.Z('sceneservice:root-node-missing', 'Root node missing.', {
            pageError: u,
            nodeError: e,
            url: p,
          });
        }
      }
    },
    98412: (e, t, r) => {
      'use strict';
      r.d(t, { S: () => R });
      var s = r(29768),
        i = r(82058),
        n = r(60991),
        o = r(76506),
        a = r(92143),
        l = r(50406),
        u = r(32101),
        c = r(34250),
        p = (r(91306), r(97714)),
        d = r(17533),
        h = r(2906),
        m = r(25368);
      function y(e) {
        e &&
          e.writtenProperties &&
          e.writtenProperties.forEach((e) => {
            const t = e.target;
            e.newOrigin &&
              e.oldOrigin !== e.newOrigin &&
              (0, m.i)(t) &&
              t.updateOrigin(e.propName, e.newOrigin);
          });
      }
      var f = r(21801),
        v = r(29027),
        g = r(60947),
        w = r(21132),
        S = r(43022),
        I = r(83805),
        _ = r(49900),
        x = r(56420),
        b = r(46857);
      const O = a.L.getLogger('esri.layers.mixins.SceneService'),
        R = (e) => {
          let t = class extends e {
            constructor() {
              super(...arguments),
                (this.spatialReference = null),
                (this.fullExtent = null),
                (this.heightModelInfo = null),
                (this.minScale = 0),
                (this.maxScale = 0),
                (this.version = { major: Number.NaN, minor: Number.NaN, versionString: '' }),
                (this.copyright = null),
                (this.sublayerTitleMode = 'item-title'),
                (this.title = null),
                (this.layerId = null),
                (this.indexInfo = null),
                (this._debouncedSaveOperations = (0, l.Ds)(async (e, t, r) => {
                  switch (e) {
                    case 0:
                      return this._save(t);
                    case 1:
                      return this._saveAs(r, t);
                  }
                }));
            }
            readSpatialReference(e, t) {
              return this._readSpatialReference(t);
            }
            _readSpatialReference(e) {
              if (null != e.spatialReference) return g.Z.fromJSON(e.spatialReference);
              {
                const t = e.store,
                  r = t.indexCRS || t.geographicCRS,
                  s = r && parseInt(r.substring(r.lastIndexOf('/') + 1, r.length), 10);
                return null != s ? new g.Z(s) : null;
              }
            }
            readFullExtent(e, t, r) {
              if (null != e && 'object' == typeof e) return f.Z.fromJSON(e, r);
              const s = t.store,
                i = this._readSpatialReference(t);
              return null == i ||
                null == s ||
                null == s.extent ||
                !Array.isArray(s.extent) ||
                s.extent.some((e) => e < C)
                ? null
                : new f.Z({
                    xmin: s.extent[0],
                    ymin: s.extent[1],
                    xmax: s.extent[2],
                    ymax: s.extent[3],
                    spatialReference: i,
                  });
            }
            readVersion(e, t) {
              const r = t.store,
                s = null != r.version ? r.version.toString() : '',
                i = { major: Number.NaN, minor: Number.NaN, versionString: s },
                n = s.split('.');
              return (
                n.length >= 2 && ((i.major = parseInt(n[0], 10)), (i.minor = parseInt(n[1], 10))), i
              );
            }
            readTitlePortalItem(e) {
              return 'item-title' !== this.sublayerTitleMode ? void 0 : e;
            }
            readTitleService(e, t) {
              const r = this.portalItem && this.portalItem.title;
              if ('item-title' === this.sublayerTitleMode) return (0, w.t)(this.url, t.name);
              let s = t.name;
              if (!s && this.url) {
                const e = (0, w.p)(this.url);
                (0, o.i)(e) && (s = e.title);
              }
              return (
                'item-title-and-service-name' === this.sublayerTitleMode &&
                  r &&
                  (s = r + ' - ' + s),
                (0, w.c)(s)
              );
            }
            set url(e) {
              const t = (0, w.a)({ layer: this, url: e, nonStandardUrlAllowed: !1, logger: O });
              this._set('url', t.url), null != t.layerId && this._set('layerId', t.layerId);
            }
            writeUrl(e, t, r, s) {
              (0, w.w)(this, e, 'layers', t, s);
            }
            get parsedUrl() {
              const e = this._get('url');
              if (!e) return null;
              const t = (0, u.mN)(e);
              return null != this.layerId && (t.path = `${t.path}/layers/${this.layerId}`), t;
            }
            async _fetchIndexAndUpdateExtent(e, t) {
              (this.indexInfo = (0, I.f)(this.parsedUrl.path, this.rootNode, e, this.apiKey, O, t)),
                null == this.fullExtent ||
                  this.fullExtent.hasZ ||
                  this._updateExtent(await this.indexInfo);
            }
            _updateExtent(e) {
              if ('page' === (null == e ? void 0 : e.type)) {
                var t, r;
                const s = e.rootIndex % e.pageSize,
                  i = null == (t = e.rootPage) || null == (r = t.nodes) ? void 0 : r[s];
                if (null == i || null == i.obb || null == i.obb.center || null == i.obb.halfSize)
                  throw new n.Z('sceneservice:invalid-node-page', 'Invalid node page.');
                if (i.obb.center[0] < C || null == this.fullExtent || this.fullExtent.hasZ) return;
                const o = i.obb.halfSize,
                  a = i.obb.center[2],
                  l = Math.sqrt(o[0] * o[0] + o[1] * o[1] + o[2] * o[2]);
                (this.fullExtent.zmin = a - l), (this.fullExtent.zmax = a + l);
              } else if ('node' === (null == e ? void 0 : e.type)) {
                var s;
                const t = null == (s = e.rootNode) ? void 0 : s.mbs;
                if (!Array.isArray(t) || 4 !== t.length || t[0] < C) return;
                const r = t[2],
                  i = t[3];
                (this.fullExtent.zmin = r - i), (this.fullExtent.zmax = r + i);
              }
            }
            async _fetchService(e) {
              if (null == this.url)
                throw new n.Z(
                  'sceneservice:url-not-set',
                  'Scene service can not be loaded without valid portal item or url',
                );
              if (null == this.layerId && /SceneServer\/*$/i.test(this.url)) {
                const t = await this._fetchFirstLayerId(e);
                null != t && (this.layerId = t);
              }
              return this._fetchServiceLayer(e);
            }
            async _fetchFirstLayerId(e) {
              const t = await (0, i.default)(this.url, {
                query: { f: 'json', token: this.apiKey },
                responseType: 'json',
                signal: e,
              });
              if (t.data && Array.isArray(t.data.layers) && t.data.layers.length > 0)
                return t.data.layers[0].id;
            }
            async _fetchServiceLayer(e) {
              const t = await (0, i.default)(this.parsedUrl.path, {
                query: { f: 'json', token: this.apiKey },
                responseType: 'json',
                signal: e,
              });
              t.ssl && (this.url = this.url.replace(/^http:/i, 'https:'));
              const r = t.data;
              this.read(r, { origin: 'service', url: this.parsedUrl }), this.validateLayer(r);
            }
            async _ensureLoadBeforeSave() {
              await this.load(),
                'beforeSave' in this &&
                  'function' == typeof this.beforeSave &&
                  (await this.beforeSave());
            }
            validateLayer(e) {}
            _updateTypeKeywords(e, t, r) {
              e.typeKeywords || (e.typeKeywords = []);
              const s = t.getTypeKeywords();
              for (const t of s) e.typeKeywords.push(t);
              e.typeKeywords &&
                ((e.typeKeywords = e.typeKeywords.filter((e, t, r) => r.indexOf(e) === t)),
                1 === r && (e.typeKeywords = e.typeKeywords.filter((e) => 'Hosted Service' !== e)));
            }
            async _saveAs(e, t) {
              const r = { ...j, ...t };
              let s = x.default.from(e);
              s ||
                (O.error('_saveAs(): requires a portal item parameter'),
                await Promise.reject(
                  new n.Z(
                    'sceneservice:portal-item-required',
                    '_saveAs() requires a portal item to save to',
                  ),
                )),
                s.id && ((s = s.clone()), (s.id = null));
              const i = s.portal || _.Z.getDefault();
              await this._ensureLoadBeforeSave(), (s.type = P), (s.portal = i);
              const o = {
                  origin: 'portal-item',
                  url: null,
                  messages: [],
                  portal: i,
                  portalItem: s,
                  writtenProperties: [],
                  blockedRelativeUrls: [],
                  resources: { toAdd: [], toUpdate: [], toKeep: [], pendingOperations: [] },
                },
                a = { layers: [this.write(null, o)] };
              return (
                await Promise.all(o.resources.pendingOperations),
                await this._validateAgainstJSONSchema(a, o, r),
                (s.url = this.url),
                s.title || (s.title = this.title),
                this._updateTypeKeywords(s, r, 1),
                await i._signIn(),
                await i.user.addItem({ item: s, folder: r && r.folder, data: a }),
                await (0, b.s)(this.resourceReferences, o, null),
                (this.portalItem = s),
                y(o),
                (o.portalItem = s),
                s
              );
            }
            async _save(e) {
              const t = { ...j, ...e };
              this.portalItem ||
                (O.error('_save(): requires the .portalItem property to be set'),
                await Promise.reject(
                  new n.Z(
                    'sceneservice:portal-item-not-set',
                    'Portal item to save to has not been set on this SceneService',
                  ),
                )),
                this.portalItem.type !== P &&
                  (O.error(
                    '_save(): Non-matching portal item type. Got ' +
                      this.portalItem.type +
                      ', expected ' +
                      P,
                  ),
                  await Promise.reject(
                    new n.Z(
                      'sceneservice:portal-item-wrong-type',
                      `Portal item needs to have type "${P}"`,
                    ),
                  )),
                await this._ensureLoadBeforeSave();
              const r = {
                  origin: 'portal-item',
                  url: this.portalItem.itemUrl && (0, u.mN)(this.portalItem.itemUrl),
                  messages: [],
                  portal: this.portalItem.portal || _.Z.getDefault(),
                  portalItem: this.portalItem,
                  writtenProperties: [],
                  blockedRelativeUrls: [],
                  resources: { toAdd: [], toUpdate: [], toKeep: [], pendingOperations: [] },
                },
                s = { layers: [this.write(null, r)] };
              return (
                await Promise.all(r.resources.pendingOperations),
                await this._validateAgainstJSONSchema(s, r, t),
                (this.portalItem.url = this.url),
                this.portalItem.title || (this.portalItem.title = this.title),
                this._updateTypeKeywords(this.portalItem, t, 0),
                await this.portalItem.update({ data: s }),
                await (0, b.s)(this.resourceReferences, r, null),
                y(r),
                this.portalItem
              );
            }
            async _validateAgainstJSONSchema(e, t, s) {
              let i = t.messages
                .filter((e) => 'error' === e.type)
                .map((e) => new n.Z(e.name, e.message, e.details));
              if (
                (s &&
                  s.validationOptions.ignoreUnsupported &&
                  (i = i.filter(
                    (e) =>
                      'layer:unsupported' !== e.name &&
                      'symbol:unsupported' !== e.name &&
                      'symbol-layer:unsupported' !== e.name &&
                      'property:unsupported' !== e.name &&
                      'url:unsupported' !== e.name &&
                      'scenemodification:unsupported' !== e.name,
                  )),
                s.validationOptions.enabled || N)
              ) {
                const t = (await r.e(8718).then(r.bind(r, 88718))).validate(
                  e,
                  s.portalItemLayerType,
                );
                if (t.length > 0) {
                  const e = `Layer item did not validate:\n${t.join('\n')}`;
                  if (
                    (O.error(`_validateAgainstJSONSchema(): ${e}`),
                    'throw' === s.validationOptions.failPolicy)
                  ) {
                    const e = t.map((e) => new n.Z('sceneservice:schema-validation', e)).concat(i);
                    throw new n.Z(
                      'sceneservice-validate:error',
                      'Failed to save layer item due to schema validation, see `details.errors`.',
                      { combined: e },
                    );
                  }
                }
              }
              if (i.length > 0)
                throw new n.Z(
                  'sceneservice:save',
                  "Failed to save SceneService due to unsupported or invalid content. See 'details.errors' for more detailed information",
                  { errors: i },
                );
            }
          };
          return (
            (0, s._)([(0, c.Cb)(S.i)], t.prototype, 'id', void 0),
            (0, s._)([(0, c.Cb)({ type: g.Z })], t.prototype, 'spatialReference', void 0),
            (0, s._)(
              [
                (0, p.r)('spatialReference', [
                  'spatialReference',
                  'store.indexCRS',
                  'store.geographicCRS',
                ]),
              ],
              t.prototype,
              'readSpatialReference',
              null,
            ),
            (0, s._)([(0, c.Cb)({ type: f.Z })], t.prototype, 'fullExtent', void 0),
            (0, s._)(
              [
                (0, p.r)('fullExtent', [
                  'fullExtent',
                  'store.extent',
                  'spatialReference',
                  'store.indexCRS',
                  'store.geographicCRS',
                ]),
              ],
              t.prototype,
              'readFullExtent',
              null,
            ),
            (0, s._)(
              [(0, c.Cb)({ readOnly: !0, type: v.Z })],
              t.prototype,
              'heightModelInfo',
              void 0,
            ),
            (0, s._)(
              [
                (0, c.Cb)({
                  type: Number,
                  json: {
                    name: 'layerDefinition.minScale',
                    write: !0,
                    origins: { service: { read: { source: 'minScale' }, write: !1 } },
                  },
                }),
              ],
              t.prototype,
              'minScale',
              void 0,
            ),
            (0, s._)(
              [
                (0, c.Cb)({
                  type: Number,
                  json: {
                    name: 'layerDefinition.maxScale',
                    write: !0,
                    origins: { service: { read: { source: 'maxScale' }, write: !1 } },
                  },
                }),
              ],
              t.prototype,
              'maxScale',
              void 0,
            ),
            (0, s._)([(0, c.Cb)({ readOnly: !0 })], t.prototype, 'version', void 0),
            (0, s._)([(0, p.r)('version', ['store.version'])], t.prototype, 'readVersion', null),
            (0, s._)(
              [(0, c.Cb)({ type: String, json: { read: { source: 'copyrightText' } } })],
              t.prototype,
              'copyright',
              void 0,
            ),
            (0, s._)(
              [(0, c.Cb)({ type: String, json: { read: !1 } })],
              t.prototype,
              'sublayerTitleMode',
              void 0,
            ),
            (0, s._)([(0, c.Cb)({ type: String })], t.prototype, 'title', void 0),
            (0, s._)([(0, p.r)('portal-item', 'title')], t.prototype, 'readTitlePortalItem', null),
            (0, s._)(
              [(0, p.r)('service', 'title', ['name'])],
              t.prototype,
              'readTitleService',
              null,
            ),
            (0, s._)(
              [
                (0, c.Cb)({
                  type: Number,
                  json: {
                    origins: {
                      service: { read: { source: 'id' } },
                      'portal-item': {
                        write: { target: 'id', isRequired: !0, ignoreOrigin: !0 },
                        read: !1,
                      },
                    },
                  },
                }),
              ],
              t.prototype,
              'layerId',
              void 0,
            ),
            (0, s._)([(0, c.Cb)(S.u)], t.prototype, 'url', null),
            (0, s._)([(0, h.w)('url')], t.prototype, 'writeUrl', null),
            (0, s._)([(0, c.Cb)()], t.prototype, 'parsedUrl', null),
            (0, s._)([(0, c.Cb)({ readOnly: !0 })], t.prototype, 'store', void 0),
            (0, s._)(
              [
                (0, c.Cb)({
                  type: String,
                  readOnly: !0,
                  json: { read: { source: 'store.rootNode' } },
                }),
              ],
              t.prototype,
              'rootNode',
              void 0,
            ),
            (t = (0, s._)([(0, d.j)('esri.layers.mixins.SceneService')], t)),
            t
          );
        },
        C = -1e38,
        N = !1,
        P = 'Scene Service',
        j = {
          getTypeKeywords: () => [],
          portalItemLayerType: 'unknown',
          validationOptions: { enabled: !0, ignoreUnsupported: !1, failPolicy: 'throw' },
        };
    },
    21132: (e, t, r) => {
      'use strict';
      r.d(t, {
        a: () => v,
        b: () => y,
        c: () => h,
        d: () => c,
        e: () => w,
        f: () => d,
        p: () => p,
        s: () => f,
        t: () => m,
        w: () => g,
      });
      var s = r(76506),
        i = r(32101),
        n = r(38742);
      const o = [
          'MapServer',
          'ImageServer',
          'FeatureServer',
          'SceneServer',
          'StreamServer',
          'VectorTileServer',
        ],
        a = new RegExp(
          `^((?:https?:)?\\/\\/\\S+?\\/rest\\/services\\/(.+?)\\/(${o.join(
            '|',
          )}))(?:\\/(?:layers\\/)?(\\d+))?`,
          'i',
        ),
        l = new RegExp(
          `^((?:https?:)?\\/\\/\\S+?\\/([^\\/\\n]+)\\/(${o.join(
            '|',
          )}))(?:\\/(?:layers\\/)?(\\d+))?`,
          'i',
        ),
        u = /(.*?)\/(?:layers\/)?(\d+)\/?$/i;
      function c(e) {
        return !!a.test(e);
      }
      function p(e) {
        const t = (0, i.mN)(e),
          r = t.path.match(a) || t.path.match(l);
        if (!r) return null;
        const [, s, n, o, u] = r,
          c = n.indexOf('/');
        return {
          title: h(-1 !== c ? n.slice(c + 1) : n),
          serverType: o,
          sublayer: null != u && '' !== u ? parseInt(u, 10) : null,
          url: { path: s },
        };
      }
      function d(e) {
        const t = (0, i.mN)(e).path.match(u);
        return t ? { serviceUrl: t[1], sublayerId: Number(t[2]) } : null;
      }
      function h(e) {
        return (e = e.replace(/\s*[/_]+\s*/g, ' '))[0].toUpperCase() + e.slice(1);
      }
      function m(e, t) {
        const r = [];
        if (e) {
          const t = p(e);
          (0, s.i)(t) && t.title && r.push(t.title);
        }
        if (t) {
          const e = h(t);
          r.push(e);
        }
        if (2 === r.length) {
          if (-1 !== r[0].toLowerCase().indexOf(r[1].toLowerCase())) return r[0];
          if (-1 !== r[1].toLowerCase().indexOf(r[0].toLowerCase())) return r[1];
        }
        return r.join(' - ');
      }
      function y(e) {
        if (!e) return !1;
        const t = -1 !== (e = e.toLowerCase()).indexOf('.arcgis.com/'),
          r =
            -1 !== e.indexOf('//services') ||
            -1 !== e.indexOf('//tiles') ||
            -1 !== e.indexOf('//features');
        return t && r;
      }
      function f(e, t) {
        return e ? (0, i.Qj)((0, i.Hu)(e, t)) : e;
      }
      function v(e) {
        let { url: t } = e;
        if (!t) return { url: t };
        t = (0, i.Hu)(t, e.logger);
        const r = (0, i.mN)(t),
          n = p(r.path);
        let o;
        if ((0, s.i)(n))
          null != n.sublayer && null == e.layer.layerId && (o = n.sublayer), (t = n.url.path);
        else if (e.nonStandardUrlAllowed) {
          const e = d(r.path);
          (0, s.i)(e) && ((t = e.serviceUrl), (o = e.sublayerId));
        }
        return { url: (0, i.Qj)(t), layerId: o };
      }
      function g(e, t, r, s, o) {
        (0, n.w)(t, s, 'url', o),
          s.url && null != e.layerId && (s.url = (0, i.v_)(s.url, r, e.layerId.toString()));
      }
      function w(e) {
        if (!e) return !1;
        const t = e.toLowerCase(),
          r = -1 !== t.indexOf('/services/'),
          s = -1 !== t.indexOf('/mapserver/wmsserver'),
          i = -1 !== t.indexOf('/imageserver/wmsserver'),
          n = -1 !== t.indexOf('/wmsserver');
        return r && (s || i || n);
      }
    },
    85557: (e, t, r) => {
      'use strict';
      r.d(t, { m: () => n });
      var s = r(53785),
        i = r(89623);
      const n = {
        inches: (0, s.c)(1, 'meters', 'inches'),
        feet: (0, s.c)(1, 'meters', 'feet'),
        'us-feet': (0, s.c)(1, 'meters', 'us-feet'),
        yards: (0, s.c)(1, 'meters', 'yards'),
        miles: (0, s.c)(1, 'meters', 'miles'),
        'nautical-miles': (0, s.c)(1, 'meters', 'nautical-miles'),
        millimeters: (0, s.c)(1, 'meters', 'millimeters'),
        centimeters: (0, s.c)(1, 'meters', 'centimeters'),
        decimeters: (0, s.c)(1, 'meters', 'decimeters'),
        meters: (0, s.c)(1, 'meters', 'meters'),
        kilometers: (0, s.c)(1, 'meters', 'kilometers'),
        'decimal-degrees': 1 / (0, s.l)(1, 'meters', i.e.radius),
      };
    },
    25368: (e, t, r) => {
      'use strict';
      function s(e) {
        return e && 'getAtOrigin' in e && 'originOf' in e;
      }
      r.d(t, { i: () => s });
    },
    3754: (e, t, r) => {
      'use strict';
      r.r(t),
        r.d(t, {
          addOrUpdateResource: () => l,
          contentToBlob: () => h,
          fetchResources: () => a,
          getSiblingOfSameType: () => m,
          getSiblingOfSameTypeI: () => y,
          removeAllResources: () => c,
          removeResource: () => u,
          splitPrefixFileNameAndExtension: () => d,
        });
      var s = r(82058),
        i = r(60991),
        n = r(76506),
        o = r(32101);
      async function a(e, t = {}, r) {
        await e.load(r);
        const s = (0, o.v_)(e.itemUrl, 'resources'),
          { start: i = 1, num: a = 10, sortOrder: l = 'asc', sortField: u = 'created' } = t,
          c = {
            query: { start: i, num: a, sortOrder: l, sortField: u, token: e.apiKey },
            signal: (0, n.c)(r, 'signal'),
          },
          p = await e.portal._request(s, c);
        return {
          total: p.total,
          nextStart: p.nextStart,
          resources: p.resources.map(({ created: t, size: r, resource: s }) => ({
            created: new Date(t),
            size: r,
            resource: e.resourceFromPath(s),
          })),
        };
      }
      async function l(e, t, r, s) {
        if (!e.hasPath())
          throw new i.Z(
            `portal-item-resource-${t}:invalid-path`,
            'Resource does not have a valid path',
          );
        const a = e.portalItem;
        await a.load(s);
        const l = (0, o.v_)(a.userItemUrl, 'add' === t ? 'addResources' : 'updateResources'),
          [u, c] = p(e.path),
          d = await h(r),
          m = new FormData();
        return (
          u && '.' !== u && m.append('resourcesPrefix', u),
          m.append('fileName', c),
          m.append('file', d, c),
          m.append('f', 'json'),
          (0, n.i)(s) && s.access && m.append('access', s.access),
          await a.portal._request(l, { method: 'post', body: m, signal: (0, n.c)(s, 'signal') }),
          e
        );
      }
      async function u(e, t, r) {
        if (!t.hasPath())
          throw new i.Z(
            'portal-item-resources-remove:invalid-path',
            'Resource does not have a valid path',
          );
        await e.load(r);
        const s = (0, o.v_)(e.userItemUrl, 'removeResources');
        await e.portal._request(s, {
          method: 'post',
          query: { resource: t.path },
          signal: (0, n.c)(r, 'signal'),
        }),
          (t.portalItem = null);
      }
      async function c(e, t) {
        await e.load(t);
        const r = (0, o.v_)(e.userItemUrl, 'removeResources');
        return e.portal._request(r, {
          method: 'post',
          query: { deleteAll: !0 },
          signal: (0, n.c)(t, 'signal'),
        });
      }
      function p(e) {
        const t = e.lastIndexOf('/');
        return -1 === t ? ['.', e] : [e.slice(0, t), e.slice(t + 1)];
      }
      function d(e) {
        const [t, r] = (function (e) {
            const t = (0, o.Ml)(e);
            return (0, n.b)(t) ? [e, ''] : [e.slice(0, e.length - t.length - 1), `.${t}`];
          })(e),
          [s, i] = p(t);
        return [s, i, r];
      }
      async function h(e) {
        return e instanceof Blob ? e : (await (0, s.default)(e.url, { responseType: 'blob' })).data;
      }
      function m(e, t) {
        if (!e.hasPath()) return null;
        const [r, , s] = d(e.path);
        return e.portalItem.resourceFromPath((0, o.v_)(r, t + s));
      }
      function y(e, t) {
        if (!e.hasPath()) return null;
        const [r, , s] = d(e.path);
        return e.portalItem.resourceFromPath((0, o.v_)(r, t + s));
      }
      r(31450), r(71552), r(88762), r(92143), r(40642), r(81172), r(50406);
    },
    46857: (e, t, r) => {
      'use strict';
      r.d(t, { s: () => l });
      var s = r(41864),
        i = r(60991),
        n = r(50406),
        o = r(10279),
        a = r(3754);
      async function l(e, t, r) {
        if (!t || !t.resources) return;
        const s = t.portalItem === e.portalItem ? new Set(e.paths) : new Set();
        (e.paths.length = 0), (e.portalItem = t.portalItem);
        const l = new Set(t.resources.toKeep.map((e) => e.resource.path)),
          p = new Set(),
          d = [];
        l.forEach((t) => {
          s.delete(t), e.paths.push(t);
        });
        for (const i of t.resources.toUpdate)
          if ((s.delete(i.resource.path), l.has(i.resource.path) || p.has(i.resource.path))) {
            const { resource: t, content: s, finish: n, error: l } = i,
              c = (0, a.getSiblingOfSameTypeI)(t, (0, o.g)());
            e.paths.push(c.path), d.push(u({ resource: c, content: s, finish: n, error: l }, r));
          } else e.paths.push(i.resource.path), d.push(c(i, r)), p.add(i.resource.path);
        for (const s of t.resources.toAdd) d.push(u(s, r)), e.paths.push(s.resource.path);
        if (
          (s.forEach((e) => {
            const r = t.portalItem.resourceFromPath(e);
            d.push(r.portalItem.removeResource(r).catch(() => {}));
          }),
          0 === d.length)
        )
          return;
        const h = await (0, n.as)(d);
        (0, n.k_)(r);
        const m = h.filter((e) => 'error' in e).map((e) => e.error);
        if (m.length > 0)
          throw new i.Z('save:resources', 'Failed to save one or more resources', { errors: m });
      }
      async function u(e, t) {
        const r = await (0, s.r)(e.resource.portalItem.addResource(e.resource, e.content, t));
        if (!0 !== r.ok) throw (e.error && e.error(r.error), r.error);
        e.finish && e.finish(e.resource);
      }
      async function c(e, t) {
        const r = await (0, s.r)(e.resource.update(e.content, t));
        if (!0 !== r.ok) throw (e.error(r.error), r.error);
        e.finish(e.resource);
      }
    },
    10279: (e, t, r) => {
      'use strict';
      r.d(t, { g: () => i });
      var s = r(76506);
      function i() {
        const e = n.getRandomValues(new Uint16Array(8));
        (e[3] = (4095 & e[3]) | 16384), (e[4] = (16383 & e[4]) | 32768);
        const t = (t) => e[t].toString(16);
        return t(0) + t(1) + '-' + t(2) + '-' + t(3) + '-' + t(4) + '-' + t(5) + t(6) + t(7);
      }
      const n = s.g.crypto || s.g.msCrypto;
    },
  },
]);
