@arcgis/common-components 5.1.0-next.103 → 5.1.0-next.105

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,95 +1,96 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import { c as D } from "../../chunks/runtime.js";
3
- import { css as q, html as d } from "lit";
4
- import { keyed as v } from "lit/directives/keyed.js";
5
- import { ref as T } from "lit/directives/ref.js";
6
- import { LitElement as x, createEvent as b, safeClassMap as F } from "@arcgis/lumina";
7
- import { Task as k } from "@lit/task";
8
- import { log as V, composeMissingPropertyMessage as I } from "@arcgis/toolkit/log";
9
- import E from "@arcgis/core/config.js";
10
- import * as _ from "@arcgis/core/core/reactiveUtils.js";
11
- import * as y from "@arcgis/core/intl.js";
12
- import * as N from "@arcgis/core/applications/PortalApp/layerUtils.js";
13
- import * as S from "@arcgis/core/core/lang.js";
14
- import R from "@arcgis/core/smartMapping/statistics/summaryStatistics.js";
15
- import A from "@arcgis/core/smartMapping/statistics/uniqueValues.js";
16
- import { i as p } from "../../chunks/commonFunctions.js";
17
- import L from "@arcgis/core/rest/support/Query.js";
18
- import { u as Z } from "../../chunks/useT9n.js";
19
- function P(a) {
20
- return a.type === "scene" ? a.associatedLayer?.url : a.url ?? void 0;
2
+ import { c as G } from "../../chunks/runtime.js";
3
+ import { css as U, html as c } from "lit";
4
+ import { keyed as b } from "lit/directives/keyed.js";
5
+ import { ref as D } from "lit/directives/ref.js";
6
+ import { LitElement as W, createEvent as q, safeClassMap as V } from "@arcgis/lumina";
7
+ import { Task as Q } from "@lit/task";
8
+ import { log as L, composeMissingPropertyMessage as x } from "@arcgis/toolkit/log";
9
+ import H from "@arcgis/core/config.js";
10
+ import * as k from "@arcgis/core/core/reactiveUtils.js";
11
+ import * as h from "@arcgis/core/intl.js";
12
+ import * as R from "@arcgis/core/applications/PortalApp/layerUtils.js";
13
+ import * as I from "@arcgis/core/core/lang.js";
14
+ import J from "@arcgis/core/smartMapping/statistics/summaryStatistics.js";
15
+ import j from "@arcgis/core/smartMapping/statistics/uniqueValues.js";
16
+ import { i as f } from "../../chunks/commonFunctions.js";
17
+ import { i as y, a as S, b as $, c as _, d as T, e as A, f as v, g as F, h as Z, j as z, k as B, l as K, m as N, n as X, o as P, p as Y } from "../../chunks/layer-utils.js";
18
+ import ee from "@arcgis/core/rest/support/Query.js";
19
+ import { u as te } from "../../chunks/useT9n.js";
20
+ function ie(a) {
21
+ return a.associatedLayer?.url;
21
22
  }
22
- const M = {
23
+ const se = {
23
24
  dateStyle: "short",
24
25
  timeStyle: "short"
25
- }, U = {
26
+ }, ae = {
26
27
  timeStyle: "medium"
27
28
  };
28
- function G(a) {
29
+ function re(a) {
29
30
  const { layer: e, fieldName: t } = a;
30
31
  let i;
31
- const n = N.supportsFieldConfiguration(e);
32
+ const n = R.supportsFieldConfiguration(e);
32
33
  let s;
33
34
  "popupTemplate" in e && (s = e.popupTemplate);
34
35
  const r = s ? s.fieldInfos : [];
35
- return O(a)?.filter((u) => u.name === t).forEach((u) => {
36
- const l = !n && r ? r.filter((g) => g.fieldName === u.name) : void 0, o = n ? e.getFieldAlias(t) : l?.length ? l[0].label : u.alias;
36
+ return M(a)?.filter((u) => u.name === t).forEach((u) => {
37
+ const o = !n && r ? r.filter((g) => g.fieldName === u.name) : void 0, l = n ? e.getFieldAlias(t) : o?.length ? o[0].label : u.alias;
37
38
  /^raster.(item|service)pixelvalue/iu.test(t) && (u.type = "double");
38
- const c = {
39
+ const d = {
39
40
  layerField: u,
40
- label: o || u.name
41
+ label: l || u.name
41
42
  };
42
- c.codedValues = j(t, a), H(c), c.simpleFieldType && (i = c);
43
+ d.codedValues = ue(t, a), le(d), d.simpleFieldType && (i = d);
43
44
  }), i;
44
45
  }
45
- function O(a) {
46
+ function M(a) {
46
47
  const { layer: e } = a;
47
- return e.type === "imagery-tile" || e.type === "wcs" || e.type === "imagery" && e.rasterFields.length ? e.rasterFields : e.fields;
48
+ return y(e) || S(e) || T(e) && e.rasterFields.length ? e.rasterFields : "fields" in e ? e.fields : [];
48
49
  }
49
- async function C(a) {
50
+ async function E(a) {
50
51
  a.statisticsStatus = "in-progress";
51
52
  const { layer: e, view: t } = a;
52
- if (e.type === "imagery-tile" || e.type === "wcs" || e.type === "stream" || e.type === "voxel")
53
+ if (y(e) || S(e) || F(e) || $(e))
53
54
  throw new Error("could not get feature count");
54
55
  try {
55
- return await z(e, t);
56
+ return await ce(e, t);
56
57
  } catch {
57
58
  return;
58
59
  }
59
60
  }
60
- async function Q(a) {
61
+ async function ne(a) {
61
62
  const { layer: e, view: t, fieldName: i, fieldInfo: n } = a;
62
- if (e.type === "imagery-tile" || e.type === "wcs" || e.type === "voxel")
63
+ if (y(e) || S(e) || $(e))
63
64
  throw new Error("could not get statistics for ImageryTileLayer/WCSLayer/VoxelLayer");
64
65
  if (!n || n.layerField.type === "oid" || n.layerField.type === "guid" || n.layerField.type === "global-id")
65
- return { totalCount: await C(a), nullcount: 0 };
66
+ return { totalCount: await E(a), nullcount: 0 };
66
67
  try {
67
- const s = await R({
68
+ const s = await J({
68
69
  layer: e,
69
70
  view: t,
70
71
  field: i,
71
72
  outStatisticTypes: { exclude: ["median"] }
72
73
  });
73
- if (!p(s.count))
74
+ if (!f(s.count))
74
75
  throw new Error("could not get statistics");
75
76
  const r = "sourceJSON" in e && e.sourceJSON.maxRecordCount === s.count;
76
- if (p(s.nullcount) && !r)
77
+ if (f(s.nullcount) && !r)
77
78
  return { ...s, totalCount: s.count + s.nullcount };
78
79
  {
79
- const m = await C(a);
80
+ const m = await E(a);
80
81
  return { ...s, totalCount: m };
81
82
  }
82
83
  } catch {
83
84
  throw new Error("could not get statistics");
84
85
  }
85
86
  }
86
- async function W(a) {
87
+ async function oe(a) {
87
88
  const { layer: e, view: t, fieldName: i } = a;
88
- if (e.type === "imagery-tile" || e.type === "wcs" || e.type === "voxel")
89
+ if (y(e) || S(e) || $(e))
89
90
  throw new Error("could not get unique values for ImageryLayer/ImageryTileLayer/WCSLayer/VoxelLayer");
90
- e.type === "feature" && !e.url && (e.outFields = ["*"]);
91
+ _(e) && (e.outFields = ["*"]);
91
92
  try {
92
- return await A({
93
+ return await j({
93
94
  layer: e,
94
95
  view: t,
95
96
  field: i
@@ -98,7 +99,7 @@ async function W(a) {
98
99
  throw new Error("could not get unique values");
99
100
  }
100
101
  }
101
- function H(a) {
102
+ function le(a) {
102
103
  switch (a.layerField.type) {
103
104
  case "string":
104
105
  a.simpleFieldType = "string";
@@ -132,48 +133,48 @@ function H(a) {
132
133
  break;
133
134
  }
134
135
  }
135
- function j(a, e) {
136
+ function ue(a, e) {
136
137
  const { layer: t } = e;
137
- if (t.type === "subtype-sublayer" && t.subtypeField === a) {
138
- const l = t.parent?.subtypes?.find((o) => o.code === t.subtypeCode);
139
- if (l)
140
- return [{ code: l.code, name: l.name }];
138
+ if (A(t) && t.subtypeField === a) {
139
+ const o = t.parent?.subtypes?.find((l) => l.code === t.subtypeCode);
140
+ if (o)
141
+ return [{ code: o.code, name: o.name }];
141
142
  }
142
- if (t.type !== "feature" && t.type !== "imagery")
143
+ if (!v(t) && !T(t))
143
144
  return;
144
- const i = t.type === "feature" ? t.typeIdField : void 0, n = t.type === "feature" ? t.types : void 0;
145
+ const i = v(t) ? t.typeIdField : void 0, n = v(t) ? t.types : void 0;
145
146
  let s;
146
- const m = O(e)?.find((l) => l.name === a), u = m?.domain;
147
- return t.type === "feature" && i && n ? (i === a ? s = n.map(
148
- (l) => (
147
+ const m = M(e)?.find((o) => o.name === a), u = m?.domain;
148
+ return v(t) && i && n ? (i === a ? s = n.map(
149
+ (o) => (
149
150
  // fake coded values
150
151
  {
151
- code: l.id,
152
- name: l.name
152
+ code: o.id,
153
+ name: o.name
153
154
  }
154
155
  )
155
- ) : (s = [], n.forEach((l) => {
156
- if (!l.domains[a] || l.domains[a].type === "inherited") {
157
- const o = u;
158
- o?.codedValues && o.codedValues.forEach(async (c) => {
156
+ ) : (s = [], n.forEach((o) => {
157
+ if (!o.domains[a] || o.domains[a].type === "inherited") {
158
+ const l = u;
159
+ l?.codedValues && l.codedValues.forEach((d) => {
159
160
  let g = !1;
160
- s.forEach((f) => {
161
- f.code === c.code && (g = !0, `, ${f.name},`.includes(`, ${c.name},`) || (f.name += `, ${c.name}`));
162
- }), g || s.push(S.clone(c));
161
+ s.forEach((p) => {
162
+ p.code === d.code && (g = !0, `, ${p.name},`.includes(`, ${d.name},`) || (p.name += `, ${d.name}`));
163
+ }), g || s.push(I.clone(d));
163
164
  });
164
- } else l.domains[a].codedValues && l.domains[a].codedValues.forEach(async (o) => {
165
- let c = !1;
165
+ } else o.domains[a].codedValues && o.domains[a].codedValues.forEach((l) => {
166
+ let d = !1;
166
167
  s.forEach((g) => {
167
- g.code === o.code && (c = !0, `, ${g.name},`.includes(`, ${o.name},`) || (g.name += `, ${o.name}`));
168
- }), c || s.push(S.clone(o));
168
+ g.code === l.code && (d = !0, `, ${g.name},`.includes(`, ${l.name},`) || (g.name += `, ${l.name}`));
169
+ }), d || s.push(I.clone(l));
169
170
  });
170
- })), !s.length && u?.codedValues && (s = S.clone(u.codedValues))) : u?.codedValues && (s = m.domain.codedValues), s?.length ? s : void 0;
171
+ })), !s.length && u?.codedValues && (s = I.clone(u.codedValues))) : u?.codedValues && (s = m.domain.codedValues), s?.length ? s : void 0;
171
172
  }
172
- async function J(a) {
173
+ async function de(a) {
173
174
  const { view: e, layer: t } = a;
174
- if (t.type === "imagery" || t.type === "imagery-tile" || t.type === "wcs")
175
+ if (T(t) || y(t) || S(t))
175
176
  throw new Error("could not get feature");
176
- if (t.type === "feature" && !t.url || t.type === "wfs") {
177
+ if (_(t) || Z(t)) {
177
178
  const i = t.createQuery();
178
179
  i.start = 0, i.num = 5, i.outFields = ["*"];
179
180
  const n = await t.queryFeatures(i);
@@ -182,44 +183,44 @@ async function J(a) {
182
183
  throw new Error("could not get feature");
183
184
  } else {
184
185
  if (!e)
185
- return await w(a);
186
+ return await C(a);
186
187
  let i;
187
- if (t.type === "subtype-sublayer" || t.type === "sublayer") {
188
+ if (A(t) || z(t)) {
188
189
  let s = t.parent;
189
- for (; ["subtype-group", "map-image"].includes(s.type); )
190
+ for (; B(s) || K(s); )
190
191
  s = s.parent;
191
192
  i = await e.whenLayerView(s);
192
193
  } else
193
194
  i = await e.whenLayerView(t);
194
- if (i.availableFields.length === t.fields.length || ["stream", "ogc-feature"].includes(t.type) && i.availableFields.length > 0) {
195
+ if (i.availableFields.length === t.fields.length || (F(t) || N(t)) && i.availableFields.length > 0) {
195
196
  const s = t.createQuery();
196
197
  s.start = 0, s.num = 5, s.outFields = ["*"];
197
198
  const r = await i.queryFeatures(s);
198
- return r.features?.length ? r : await w(a);
199
+ return r.features?.length ? r : await C(a);
199
200
  } else
200
- return await w(a);
201
+ return await C(a);
201
202
  }
202
203
  }
203
- async function w(a) {
204
+ async function C(a) {
204
205
  const { layer: e } = a;
205
- if (["imagery", "imagery-tile", "stream", "ogc-feature"].includes(e.type))
206
+ if (T(e) || y(e) || F(e) || N(e))
206
207
  throw new Error("cannot get feature from service");
207
- const t = new L({
208
+ const t = new ee({
208
209
  where: "1=1",
209
210
  outFields: ["*"],
210
211
  returnGeometry: !1
211
212
  });
212
213
  return "sourceJSON" in e && e.sourceJSON?.advancedQueryCapabilities?.supportsPagination && (t.num = 1), await e.queryFeatures(t);
213
214
  }
214
- async function z(a, e) {
215
- if (a.type === "feature" && !a.url)
216
- return await B(a);
217
- if (a.type === "feature" || a.type === "csv" || a.type === "scene" || a.type === "wfs" || a.type === "geojson")
215
+ async function ce(a, e) {
216
+ if (_(a))
217
+ return await me(a);
218
+ if (v(a) || X(a) || P(a) || Z(a) || Y(a))
218
219
  return await a.queryFeatureCount();
219
- if (e && (a.type === "stream" || a.type === "ogc-feature"))
220
- return await K(a, e);
220
+ if (e && (F(a) || N(a)))
221
+ return await fe(a, e);
221
222
  }
222
- async function B(a) {
223
+ async function me(a) {
223
224
  const e = a.createQuery();
224
225
  e.outFields = ["*"];
225
226
  const t = await a.queryFeatures(e);
@@ -227,27 +228,27 @@ async function B(a) {
227
228
  return t.features.length;
228
229
  throw new Error("could not get feature count");
229
230
  }
230
- async function K(a, e) {
231
+ async function fe(a, e) {
231
232
  return await (await e.whenLayerView(a)).queryFeatureCount();
232
233
  }
233
- const X = q`:host{height:100%}.container{padding:var(--calcite-space-xs);background-color:var(--calcite-color-foreground-1)}.title{font-weight:700;padding:5px 0}.missing,.data{color:#a9a9a9}.count{white-space:nowrap}.section{padding:var(--calcite-space-xs) 0}.statistics-row{border-top:var(--calcite-border-width-sm) solid var(--calcite-color-border-2);padding:var(--calcite-space-xs) 0;display:flex;justify-content:space-between}.statistics-row-top-values{border-top:var(--calcite-border-width-sm) solid var(--calctie-color-border-2);padding:20px 0 var(--calcite-space-xs) 0;display:flex;justify-content:space-between}`;
234
- class Y extends x {
234
+ const pe = U`:host{height:100%}.container{padding:var(--calcite-space-xs);background-color:var(--calcite-color-foreground-1)}.title{font-weight:700;padding:5px 0}.missing,.data{color:#a9a9a9}.count{white-space:nowrap}.section{padding:var(--calcite-space-xs) 0}.statistics-row{border-top:var(--calcite-border-width-sm) solid var(--calcite-color-border-2);padding:var(--calcite-space-xs) 0;display:flex;justify-content:space-between}.statistics-row-top-values{border-top:var(--calcite-border-width-sm) solid var(--calctie-color-border-2);padding:20px 0 var(--calcite-space-xs) 0;display:flex;justify-content:space-between}`;
235
+ class ge extends W {
235
236
  constructor() {
236
- super(...arguments), this._messages = Z({ blocking: !0 }), this._propWatcherTask = new k(this, {
237
+ super(...arguments), this._messages = te({ blocking: !0 }), this._propWatcherTask = new Q(this, {
237
238
  task: async ([e, t]) => {
238
- const i = p(e) && p(t);
239
- if (p(e) || V("error", this, I("layer")), p(t) || V("error", this, I("fieldName")), !i)
239
+ const i = f(e) && f(t);
240
+ if (f(e) || L("error", this, x("layer")), f(t) || L("error", this, x("fieldName")), !i)
240
241
  throw new Error();
241
242
  await this.processProps(), this._propWatcherTask.autoRun = !1;
242
243
  },
243
244
  args: () => [this.layer, this.fieldName]
244
- }), this.oneFeatureResponseStatus = "missing", this.statisticsStatus = "missing", this.uniqueValuesStatus = "missing", this.hideAlias = !1, this.hideNumericFormat = !1, this.hideStatistics = !1, this.arcgisComplete = b(), this.arcgisFieldInfoComplete = b();
245
+ }), this.oneFeatureResponseStatus = "missing", this.statisticsStatus = "missing", this.uniqueValuesStatus = "missing", this.hideAlias = !1, this.hideNumericFormat = !1, this.hideStatistics = !1, this.arcgisComplete = q(), this.arcgisFieldInfoComplete = q();
245
246
  }
246
247
  static {
247
248
  this.properties = { oneFeatureResponseStatus: 16, oneFeatureResponse: 16, statisticsStatus: 16, statistics: 16, uniqueValuesStatus: 16, uniqueValues: 16, view: 0, layer: 0, fieldName: 1, hideAlias: 5, hideNumericFormat: 5, hideStatistics: 5 };
248
249
  }
249
250
  static {
250
- this.styles = X;
251
+ this.styles = pe;
251
252
  }
252
253
  async refresh() {
253
254
  await this.processProps(), this.requestUpdate();
@@ -262,26 +263,26 @@ class Y extends x {
262
263
  let s;
263
264
  if (t.declaredClass === "esri.layers.support.Sublayer") {
264
265
  const r = t;
265
- e && await _.whenOnce(() => !e.updating), s = await r.createFeatureLayer(), await s?.load();
266
+ e && await k.whenOnce(() => !e.updating), s = await r.createFeatureLayer(), await s?.load();
266
267
  }
267
268
  this.props = {
268
269
  view: e,
269
270
  layer: s ?? t,
270
271
  fieldName: i,
271
272
  hideStatistics: n
272
- }, this.props.fieldInfo = G(this.props), t.type === "scene" && E.request.interceptors?.push({
273
- urls: `${P(t)}/${t.layerId}`,
273
+ }, this.props.fieldInfo = re(this.props), P(t) && H.request.interceptors?.push({
274
+ urls: `${ie(t)}/${t.layerId}`,
274
275
  before(r) {
275
276
  r.requestOptions.authMode = "no-prompt";
276
277
  }
277
278
  }), this.oneFeatureResponseStatus = "in-progress";
278
279
  try {
279
- const r = await J(this.props);
280
+ const r = await de(this.props);
280
281
  this.oneFeatureResponse = r, this.oneFeatureResponseStatus = "success";
281
282
  } catch {
282
283
  this.oneFeatureResponseStatus = "failed";
283
284
  }
284
- if (t.type === "stream") {
285
+ if (F(t)) {
285
286
  this.uniqueValuesStatus = "failed", this.statisticsStatus = "failed";
286
287
  return;
287
288
  }
@@ -290,7 +291,7 @@ class Y extends x {
290
291
  else {
291
292
  this.uniqueValuesStatus = "in-progress";
292
293
  try {
293
- const r = await W(this.props);
294
+ const r = await oe(this.props);
294
295
  this.uniqueValues = r, r?.uniqueValueInfos?.length ? this.uniqueValuesStatus = "success" : this.uniqueValuesStatus = "failed";
295
296
  } catch {
296
297
  this.uniqueValuesStatus = "failed";
@@ -301,13 +302,13 @@ class Y extends x {
301
302
  else {
302
303
  this.statisticsStatus = "in-progress";
303
304
  try {
304
- const r = await Q(this.props);
305
- if (!p(r.totalCount) && p(r.count) && this.uniqueValuesStatus === "success") {
305
+ const r = await ne(this.props);
306
+ if (!f(r.totalCount) && f(r.count) && this.uniqueValuesStatus === "success") {
306
307
  const m = this.uniqueValues?.uniqueValueInfos ?? [];
307
308
  for (let u = 0; u < m.length; u++) {
308
- const l = m[u];
309
- if (l.value === null) {
310
- r.totalCount = l.count + r.count;
309
+ const o = m[u];
310
+ if (o.value === null) {
311
+ r.totalCount = o.count + r.count;
311
312
  break;
312
313
  }
313
314
  }
@@ -323,7 +324,7 @@ class Y extends x {
323
324
  setUpTimeZoneHandle() {
324
325
  this.timeZoneHandle?.remove();
325
326
  const { props: e } = this, { view: t, fieldInfo: i } = e;
326
- ["date", "timestamp-offset"].includes(this._getStatisticsType(i)) && (this.timeZoneHandle = _.watch(() => t?.timeZone, () => {
327
+ ["date", "timestamp-offset"].includes(this._getStatisticsType(i)) && (this.timeZoneHandle = k.watch(() => t?.timeZone, () => {
327
328
  this.requestUpdate();
328
329
  }));
329
330
  }
@@ -444,29 +445,29 @@ class Y extends x {
444
445
  }
445
446
  _getDateString(e, t) {
446
447
  const { view: i } = this.props;
447
- return i && i.timeZone === "unknown" ? y.formatDate(e, {
448
+ return i && i.timeZone === "unknown" ? h.formatDate(e, {
448
449
  ...this.getIntlDateTimeFormattingOptions("short-date-short-time", t),
449
450
  timeZone: "utc"
450
- }) : y.formatDate(e, {
451
+ }) : h.formatDate(e, {
451
452
  ...this.getIntlDateTimeFormattingOptions("short-date-short-time", t),
452
453
  timeZone: i?.timeZone || "system"
453
454
  });
454
455
  }
455
456
  _getTimestampOffsetString(e, t) {
456
457
  const { view: i } = this.props;
457
- return typeof e == "string" ? i && i.timeZone === "unknown" ? y.formatTimestamp(e, {
458
+ return typeof e == "string" ? i && i.timeZone === "unknown" ? h.formatTimestamp(e, {
458
459
  ...this.getIntlDateTimeFormattingOptions("short-date-short-time", t),
459
460
  timeZone: "utc"
460
- }) : y.formatTimestamp(e, {
461
+ }) : h.formatTimestamp(e, {
461
462
  ...this.getIntlDateTimeFormattingOptions("short-date-short-time", t),
462
463
  timeZone: i?.timeZone || "system"
463
464
  }) : this._getDateString(e, t);
464
465
  }
465
466
  _getDateOnlyString(e, t) {
466
- return y.formatDateOnly(e, this.getIntlDateTimeFormattingOptions("short-date", t));
467
+ return h.formatDateOnly(e, this.getIntlDateTimeFormattingOptions("short-date", t));
467
468
  }
468
469
  _getTimeOnlyString(e, t) {
469
- return typeof e == "string" ? y.formatTimeOnly(e, this.getIntlDateTimeFormattingOptions("short-date-long-time", t)) : y.formatDate(e, {
470
+ return typeof e == "string" ? h.formatTimeOnly(e, this.getIntlDateTimeFormattingOptions("short-date-long-time", t)) : h.formatDate(e, {
470
471
  ...this.getIntlDateTimeFormattingOptions("long-time", {
471
472
  ...t,
472
473
  isTimeOnly: !0
@@ -479,10 +480,10 @@ class Y extends x {
479
480
  }
480
481
  _getNumberString(e, t) {
481
482
  const i = t?.useFieldFormatting ? e : Math.round(e * 100) / 100;
482
- return y.formatNumber(i, this.getIntlNumberFormattingOptions(t));
483
+ return h.formatNumber(i, this.getIntlNumberFormattingOptions(t));
483
484
  }
484
485
  _printNumValue(e, t) {
485
- return p(e) ? this._getNumberString(e, t) : "--";
486
+ return f(e) ? this._getNumberString(e, t) : "--";
486
487
  }
487
488
  _setCompleteRef() {
488
489
  this.arcgisComplete.emit(), this.arcgisFieldInfoComplete.emit();
@@ -496,7 +497,7 @@ class Y extends x {
496
497
  if (!e?.useFieldFormatting)
497
498
  return t ? {
498
499
  useGrouping: ["always", "auto"].includes(t.useGrouping)
499
- } : y.convertNumberFormatToIntlOptions({
500
+ } : h.convertNumberFormatToIntlOptions({
500
501
  digitSeparator: this.getPopupTemplateFieldInfo()?.format?.digitSeparator ?? !0
501
502
  });
502
503
  const i = t ? {
@@ -507,7 +508,7 @@ class Y extends x {
507
508
  if (i)
508
509
  return i;
509
510
  const n = this.getPopupTemplateFieldInfo();
510
- return y.convertNumberFormatToIntlOptions({
511
+ return h.convertNumberFormatToIntlOptions({
511
512
  digitSeparator: n?.format?.digitSeparator ?? !0,
512
513
  places: n?.format?.places ?? 2
513
514
  });
@@ -515,7 +516,7 @@ class Y extends x {
515
516
  getIntlDateTimeFormattingOptions(e, t) {
516
517
  const i = this.getCurrentFieldFormat();
517
518
  if (!t?.useFieldFormatting)
518
- return i ? t?.isTimeOnly ? U : M : y.convertDateFormatToIntlOptions(e);
519
+ return i ? t?.isTimeOnly ? ae : se : h.convertDateFormatToIntlOptions(e);
519
520
  const n = i ? {
520
521
  dateStyle: t?.isTimeOnly ? void 0 : i.dateStyle ?? void 0,
521
522
  // year/month is overridden if dateStyle is set
@@ -527,11 +528,11 @@ class Y extends x {
527
528
  if (n)
528
529
  return n;
529
530
  const s = this.getPopupTemplateFieldInfo();
530
- return y.convertDateFormatToIntlOptions(s?.format?.dateFormat ?? e);
531
+ return h.convertDateFormatToIntlOptions(s?.format?.dateFormat ?? e);
531
532
  }
532
533
  originalLayerSupportsFieldConfigs() {
533
534
  const { layer: e } = this;
534
- return N.supportsFieldConfiguration(e);
535
+ return R.supportsFieldConfiguration(e);
535
536
  }
536
537
  getPopupTemplateFieldInfo() {
537
538
  const { props: e } = this, { layer: t, fieldName: i } = e;
@@ -541,45 +542,45 @@ class Y extends x {
541
542
  return this._propWatcherTask.render({
542
543
  complete: () => {
543
544
  const { props: e } = this, { fieldInfo: t } = e;
544
- return t ? d`<div class="container">${this.renderFieldType()}${this.renderFieldAlias()}${this.renderFieldDescription()}${this.renderFieldValueType()}${this.renderFieldSampleValue()}${this.renderFieldNumericFormat()}${this.renderFieldStatistics()}</div>` : "";
545
+ return t ? c`<div class="container">${this.renderFieldType()}${this.renderFieldAlias()}${this.renderFieldDescription()}${this.renderFieldValueType()}${this.renderFieldSampleValue()}${this.renderFieldNumericFormat()}${this.renderFieldStatistics()}</div>` : "";
545
546
  },
546
547
  error: () => ""
547
548
  });
548
549
  }
549
550
  renderFieldType() {
550
551
  const { _messages: e, props: t } = this, { fieldInfo: i } = t, n = this._getFieldTypeLabel(i.layerField.type);
551
- return d`<div class="section"><div class="title">${e.fieldType}</div><div>${n}</div></div>`;
552
+ return c`<div class="section"><div class="title">${e.fieldType}</div><div>${n}</div></div>`;
552
553
  }
553
554
  renderFieldAlias() {
554
555
  const { _messages: e, props: t, hideAlias: i } = this, { fieldInfo: n } = t;
555
- return i ? "" : d`<div class="section"><div class="title">${e.fieldAlias}</div><div>${n.label}</div></div>`;
556
+ return i ? "" : c`<div class="section"><div class="title">${e.fieldAlias}</div><div>${n.label}</div></div>`;
556
557
  }
557
558
  renderFieldDescription() {
558
559
  const { _messages: e, props: t } = this, { layer: i } = t;
559
- if (i.type !== "feature")
560
+ if (!v(i))
560
561
  return "";
561
562
  const { fieldInfo: n } = t, s = n.layerField.description;
562
- return d`<div class="section"><div class="title">${e.fieldDescription}</div><div class=${F({
563
+ return c`<div class="section"><div class="title">${e.fieldDescription}</div><div class=${V({
563
564
  missing: !s
564
565
  })}>${s || e.fieldDescriptionNotSet}</div></div>`;
565
566
  }
566
567
  renderFieldValueType() {
567
568
  const { _messages: e, props: t } = this, { layer: i } = t;
568
- if (i.type !== "feature")
569
+ if (!v(i))
569
570
  return "";
570
571
  const { fieldInfo: n } = t, s = this._getFieldValueTypeCamelCase(n);
571
- return d`<div class="section"><div class="title">${e.fieldValueType}</div><div class=${F(s ? "" : "missing")}>${s ? e.fieldValueTypes[s] : e.fieldValueTypeNotSet}</div></div>`;
572
+ return c`<div class="section"><div class="title">${e.fieldValueType}</div><div class=${V(s ? "" : "missing")}>${s ? e.fieldValueTypes[s] : e.fieldValueTypeNotSet}</div></div>`;
572
573
  }
573
574
  renderFieldSampleValue() {
574
- const { oneFeatureResponse: e, oneFeatureResponseStatus: t, statisticsStatus: i, statistics: n, uniqueValuesStatus: s, uniqueValues: r, _messages: m, props: u } = this, { layer: l, fieldName: o, fieldInfo: c } = u, { statistics: g } = m;
575
- let f;
576
- if (["imagery-tile", "voxel"].includes(l.type) || l.type !== "stream" && ["string", "oid", "guid"].includes(this._getStatisticsType(c)) && s !== "failed")
575
+ const { oneFeatureResponse: e, oneFeatureResponseStatus: t, statisticsStatus: i, statistics: n, uniqueValuesStatus: s, uniqueValues: r, _messages: m, props: u } = this, { layer: o, fieldName: l, fieldInfo: d } = u, { statistics: g } = m;
576
+ let p;
577
+ if (y(o) || $(o) || !F(o) && ["string", "oid", "guid"].includes(this._getStatisticsType(d)) && s !== "failed")
577
578
  return "";
578
- t === "success" ? e.features.forEach((h) => {
579
- (f === void 0 || f === null && h.attributes[o] !== null) && (f = h.attributes[o]);
580
- }) : i === "success" ? f = n?.min ?? void 0 : s === "success" && (f = r?.uniqueValueInfos?.[0]?.value ?? r?.uniqueValueInfos?.[1]?.value ?? void 0);
581
- const $ = c.codedValues;
582
- return p(f) && ($ ? f = $.find((h) => f === h.code)?.name || f : f = this._getDisplayString(f, { useFieldFormatting: !0 })), d`<div class="section"><div class="title">${m.fieldSampleValue}</div><div class=${F(t === "failed" && i === "failed" && s === "failed" || !p(f) ? "missing" : "")}>${t === "success" || i === "success" || s === "success" ? f?.toString() ?? g.allNulls : t === "failed" && i === "failed" && s === "failed" ? m.fieldSampleNotAvailable : m.fieldSampleRetrieving}</div></div>`;
579
+ t === "success" ? e.features.forEach((w) => {
580
+ (p === void 0 || p === null && w.attributes[l] !== null) && (p = w.attributes[l]);
581
+ }) : i === "success" ? p = n?.min ?? void 0 : s === "success" && (p = r?.uniqueValueInfos?.[0]?.value ?? r?.uniqueValueInfos?.[1]?.value ?? void 0);
582
+ const O = d.codedValues;
583
+ return f(p) && (O ? p = O.find((w) => p === w.code)?.name || p : p = this._getDisplayString(p, { useFieldFormatting: !0 })), c`<div class="section"><div class="title">${m.fieldSampleValue}</div><div class=${V(t === "failed" && i === "failed" && s === "failed" || !f(p) ? "missing" : "")}>${t === "success" || i === "success" || s === "success" ? p?.toString() ?? g.allNulls : t === "failed" && i === "failed" && s === "failed" ? m.fieldSampleNotAvailable : m.fieldSampleRetrieving}</div></div>`;
583
584
  }
584
585
  renderFieldNumericFormat() {
585
586
  const { _messages: e, props: t, hideNumericFormat: i } = this, { fieldName: n, fieldInfo: s, layer: r } = t;
@@ -587,29 +588,29 @@ class Y extends x {
587
588
  return "";
588
589
  const m = this.originalLayerSupportsFieldConfigs() ? r.getFieldConfiguration(n) : void 0;
589
590
  if (m?.fieldFormat) {
590
- const { minimumFractionDigits: l, maximumFractionDigits: o } = m.fieldFormat;
591
- return d`<div class="section"><div class="title">${e.fieldDecimalPlaces}</div><div>${e.fieldMinimumFractionDigits.replace("${number}", l.toString())}</div><div>${e.fieldMaximumFractionDigits.replace("${number}", o.toString())}</div></div>`;
591
+ const { minimumFractionDigits: o, maximumFractionDigits: l } = m.fieldFormat;
592
+ return c`<div class="section"><div class="title">${e.fieldDecimalPlaces}</div><div>${e.fieldMinimumFractionDigits.replace("${number}", o.toString())}</div><div>${e.fieldMaximumFractionDigits.replace("${number}", l.toString())}</div></div>`;
592
593
  }
593
594
  const u = "popupTemplate" in r ? r.popupTemplate : void 0;
594
595
  if (u?.fieldInfos) {
595
- const l = u.fieldInfos?.filter((o) => o.fieldName === n);
596
- if (l?.length) {
597
- const o = l[0];
598
- if (p(o?.format?.places)) {
599
- const c = o.format.places;
600
- return d`<div class="section"><div class="title">${e.fieldDecimalPlaces}</div><div>${e.fieldNumDecimalPlaces.replace("${number}", c.toString())}</div></div>`;
596
+ const o = u.fieldInfos?.filter((l) => l.fieldName === n);
597
+ if (o?.length) {
598
+ const l = o[0];
599
+ if (f(l?.format?.places)) {
600
+ const d = l.format.places;
601
+ return c`<div class="section"><div class="title">${e.fieldDecimalPlaces}</div><div>${e.fieldNumDecimalPlaces.replace("${number}", d.toString())}</div></div>`;
601
602
  }
602
603
  }
603
604
  }
604
- return d`<div class="section"><div class="title">${e.fieldDecimalPlaces}</div><div class="missing">${e.fieldDecimalPlacesNotAvailable}</div></div>`;
605
+ return c`<div class="section"><div class="title">${e.fieldDecimalPlaces}</div><div class="missing">${e.fieldDecimalPlacesNotAvailable}</div></div>`;
605
606
  }
606
607
  renderFieldStatistics() {
607
608
  const { statisticsStatus: e, uniqueValuesStatus: t, hideStatistics: i, _messages: n, props: s } = this, { layer: r, fieldInfo: m } = s;
608
- return i ? (this.arcgisComplete.emit(), this.arcgisFieldInfoComplete.emit(), "") : ["stream", "imagery-tile", "voxel"].includes(r.type) || ["long"].includes(m.layerField.type) ? (this.arcgisComplete.emit(), this.arcgisFieldInfoComplete.emit(), "") : d`<div class="section"><div class="title">${n.fieldStatistics}</div>${!e || e === "missing" || e === "in-progress" ? v("field-info-statistics-content", d`<div class="missing">${n.fieldStatisticsRetrieving}</div>`) : e === "failed" && t !== "success" ? this.renderNoStatistics() : v("field-info-statistics-content", d`<div ${T(this._setCompleteRef)}>${this.renderStatistics()}</div>`)}</div>`;
609
+ return i ? (this.arcgisComplete.emit(), this.arcgisFieldInfoComplete.emit(), "") : ["stream", "imagery-tile", "voxel"].includes(r.type) || ["long"].includes(m.layerField.type) ? (this.arcgisComplete.emit(), this.arcgisFieldInfoComplete.emit(), "") : c`<div class="section"><div class="title">${n.fieldStatistics}</div>${!e || e === "missing" || e === "in-progress" ? b("field-info-statistics-content", c`<div class="missing">${n.fieldStatisticsRetrieving}</div>`) : e === "failed" && t !== "success" ? this.renderNoStatistics() : b("field-info-statistics-content", c`<div ${D(this._setCompleteRef)}>${this.renderStatistics()}</div>`)}</div>`;
609
610
  }
610
611
  renderNoStatistics() {
611
612
  const { _messages: e } = this;
612
- return v("field-info-statistics-content", d`<div class="missing" ${T(this._setCompleteRef)}>${e.fieldStatisticsNotAvailable}</div>`);
613
+ return b("field-info-statistics-content", c`<div class="missing" ${D(this._setCompleteRef)}>${e.fieldStatisticsNotAvailable}</div>`);
613
614
  }
614
615
  renderStatistics() {
615
616
  const { props: e } = this, { fieldInfo: t } = e;
@@ -634,43 +635,43 @@ class Y extends x {
634
635
  if (!e)
635
636
  return this.renderNoStatistics();
636
637
  const { statistics: i } = t;
637
- return d`<div><div class="statistics-row"><div>${i.numberOfValues}</div><div class="data">${this._printNumValue(e.totalCount)}</div></div>${p(e.sum) ? d`<div class="statistics-row"><div>${i.sumOfValues}</div><div class="data">${this._printNumValue(e.sum)}</div></div>` : null}${p(e.min) ? d`<div class="statistics-row"><div>${i.minimum}</div><div class="data">${this._printNumValue(e.min)}</div></div>` : null}${p(e.max) ? d`<div class="statistics-row"><div>${i.maximum}</div><div class="data">${this._printNumValue(e.max)}</div></div>` : null}${p(e.avg) ? d`<div class="statistics-row"><div>${i.average}</div><div class="data">${this._printNumValue(e.avg)}</div></div>` : null}${p(e.stddev) ? d`<div class="statistics-row"><div>${i.standardDeviation}</div><div class="data">${this._printNumValue(e.stddev)}</div></div>` : null}${this.renderNullValues()}</div>`;
638
+ return c`<div><div class="statistics-row"><div>${i.numberOfValues}</div><div class="data">${this._printNumValue(e.totalCount)}</div></div>${f(e.sum) ? c`<div class="statistics-row"><div>${i.sumOfValues}</div><div class="data">${this._printNumValue(e.sum)}</div></div>` : null}${f(e.min) ? c`<div class="statistics-row"><div>${i.minimum}</div><div class="data">${this._printNumValue(e.min)}</div></div>` : null}${f(e.max) ? c`<div class="statistics-row"><div>${i.maximum}</div><div class="data">${this._printNumValue(e.max)}</div></div>` : null}${f(e.avg) ? c`<div class="statistics-row"><div>${i.average}</div><div class="data">${this._printNumValue(e.avg)}</div></div>` : null}${f(e.stddev) ? c`<div class="statistics-row"><div>${i.standardDeviation}</div><div class="data">${this._printNumValue(e.stddev)}</div></div>` : null}${this.renderNullValues()}</div>`;
638
639
  }
639
640
  renderStringStatistics() {
640
641
  const { statistics: e, uniqueValuesStatus: t, _messages: i } = this, { statistics: n } = i;
641
- return d`<div><div class="statistics-row"><div>${n.numberOfValues}</div>${t !== "success" ? d`<div class="missing">--</div>` : d`<div class="data">${this._printNumValue(e?.totalCount)}</div>`}</div>${this.renderNullValues()}${this.renderTopValues()}</div>`;
642
+ return c`<div><div class="statistics-row"><div>${n.numberOfValues}</div>${t !== "success" ? c`<div class="missing">--</div>` : c`<div class="data">${this._printNumValue(e?.totalCount)}</div>`}</div>${this.renderNullValues()}${this.renderTopValues()}</div>`;
642
643
  }
643
644
  renderDateStatistics() {
644
645
  const { statistics: e, view: t, props: i, _messages: n } = this, { fieldInfo: s } = i;
645
- if (!e || !p(e.max) || !p(e.min))
646
+ if (!e || !f(e.max) || !f(e.min))
646
647
  return this.renderNoStatistics();
647
648
  const { statistics: r } = n, m = e.max - e.min, u = Math.floor(m / 31536e6);
648
- let l = Math.floor((m - u * 31536e6) / 2628e6), o = Math.ceil((m - l * 2628e6) / 864e5);
649
- o >= 30 && (l += 1, o = 0);
650
- let c = u === 1 ? r.timeSpanOptions.year : u > 1 ? r.timeSpanOptions.years.replace("${years}", u.toString()) : "";
651
- c += u > 0 && (l > 0 || o > 0) ? ", " : "", c += l === 1 ? r.timeSpanOptions.month : l > 1 ? r.timeSpanOptions.months.replace("${months}", l.toString()) : "", c += l > 0 && o > 0 ? ", " : "", c += o === 1 ? r.timeSpanOptions.day : o > 1 ? r.timeSpanOptions.days.replace("${days}", o.toString()) : "";
652
- const g = s.simpleFieldType !== "timestamp-offset" || !t || t.timeZone !== "unknown", f = s.simpleFieldType === "time-only";
653
- return d`<div><div class="statistics-row"><div>${r.numberOfValues}</div><div class="data">${this._printNumValue(e?.totalCount)}</div></div>${g && p(e.min) ? d`<div class="statistics-row"><div>${f ? r.minimumTime : r.minimumDate}</div><div class="data">${this._getDisplayString(e.min)}</div></div>` : null}${g && p(e.max) ? d`<div class="statistics-row"><div>${f ? r.maximumTime : r.maximumDate}</div><div class="data">${this._getDisplayString(e.max)}</div></div>` : null}${g && p(e.avg) ? d`<div class="statistics-row"><div>${f ? r.averageTime : r.averageDate}</div><div class="data">${this._getDisplayString(e.avg)}</div></div>` : null}${g && !f && p(e.min) && p(e.max) && m > 0 ? d`<div class="statistics-row"><div>${r.timespan}</div><div class="data">${c}</div></div>` : null}${this.renderNullValues()}</div>`;
649
+ let o = Math.floor((m - u * 31536e6) / 2628e6), l = Math.ceil((m - o * 2628e6) / 864e5);
650
+ l >= 30 && (o += 1, l = 0);
651
+ let d = u === 1 ? r.timeSpanOptions.year : u > 1 ? r.timeSpanOptions.years.replace("${years}", u.toString()) : "";
652
+ d += u > 0 && (o > 0 || l > 0) ? ", " : "", d += o === 1 ? r.timeSpanOptions.month : o > 1 ? r.timeSpanOptions.months.replace("${months}", o.toString()) : "", d += o > 0 && l > 0 ? ", " : "", d += l === 1 ? r.timeSpanOptions.day : l > 1 ? r.timeSpanOptions.days.replace("${days}", l.toString()) : "";
653
+ const g = s.simpleFieldType !== "timestamp-offset" || !t || t.timeZone !== "unknown", p = s.simpleFieldType === "time-only";
654
+ return c`<div><div class="statistics-row"><div>${r.numberOfValues}</div><div class="data">${this._printNumValue(e?.totalCount)}</div></div>${g && f(e.min) ? c`<div class="statistics-row"><div>${p ? r.minimumTime : r.minimumDate}</div><div class="data">${this._getDisplayString(e.min)}</div></div>` : null}${g && f(e.max) ? c`<div class="statistics-row"><div>${p ? r.maximumTime : r.maximumDate}</div><div class="data">${this._getDisplayString(e.max)}</div></div>` : null}${g && f(e.avg) ? c`<div class="statistics-row"><div>${p ? r.averageTime : r.averageDate}</div><div class="data">${this._getDisplayString(e.avg)}</div></div>` : null}${g && !p && f(e.min) && f(e.max) && m > 0 ? c`<div class="statistics-row"><div>${r.timespan}</div><div class="data">${d}</div></div>` : null}${this.renderNullValues()}</div>`;
654
655
  }
655
656
  renderTopValues() {
656
657
  const { uniqueValues: e, uniqueValuesStatus: t, _messages: i, props: n } = this, { fieldInfo: s } = n, { statistics: r } = i;
657
658
  if (e?.uniqueValueInfos?.length) {
658
659
  const m = e.uniqueValueInfos;
659
- m.sort((o, c) => o.count < c.count ? 1 : o.count > c.count ? -1 : 0);
660
- const u = s.codedValues, l = m.filter((o) => o.value !== null).filter((o, c) => o && c < 10).map((o) => {
661
- let c = o.value;
660
+ m.sort((l, d) => l.count < d.count ? 1 : l.count > d.count ? -1 : 0);
661
+ const u = s.codedValues, o = m.filter((l) => l.value !== null).filter((l, d) => l && d < 10).map((l) => {
662
+ let d = l.value;
662
663
  return u ? u.forEach((g) => {
663
- c === g.code && (c = g.name);
664
- }) : c = this._getDisplayString(c), d`<div class="statistics-row"><div class="data">${`${c}`}</div><div class="count">${this._printNumValue(o.count)}</div></div>`;
664
+ d === g.code && (d = g.name);
665
+ }) : d = this._getDisplayString(d), c`<div class="statistics-row"><div class="data">${`${d}`}</div><div class="count">${this._printNumValue(l.count)}</div></div>`;
665
666
  });
666
- return l.length ? d`<div><div class="statistics-row-top-values"><div>${m.length > 10 ? r.topTenValues : r.topValues}</div><div>${r.count}</div></div>${l}</div>` : "";
667
+ return o.length ? c`<div><div class="statistics-row-top-values"><div>${m.length > 10 ? r.topTenValues : r.topValues}</div><div>${r.count}</div></div>${o}</div>` : "";
667
668
  } else
668
- return d`<div><div class="statistics-row-top-values"><div>${r.topValues}</div><div>${r.count}</div></div><div class="statistics-row"><div class="missing">${t === "failed" ? i.fieldUniqueValuesNotAvailable : i.fieldSampleRetrieving}</div></div></div>`;
669
+ return c`<div><div class="statistics-row-top-values"><div>${r.topValues}</div><div>${r.count}</div></div><div class="statistics-row"><div class="missing">${t === "failed" ? i.fieldUniqueValuesNotAvailable : i.fieldSampleRetrieving}</div></div></div>`;
669
670
  }
670
671
  renderNullValues() {
671
672
  const { statistics: e, uniqueValues: t, _messages: i } = this, { statistics: n } = i;
672
673
  let s = e?.nullcount;
673
- if (!p(s) && t) {
674
+ if (!f(s) && t) {
674
675
  const r = t.uniqueValueInfos;
675
676
  for (let m = 0; m < r.length; m++) {
676
677
  const u = r[m];
@@ -680,10 +681,10 @@ class Y extends x {
680
681
  }
681
682
  }
682
683
  }
683
- return d`<div class="statistics-row"><div>${n.numberOfNulls}</div>${p(s) ? d`<div class="data">${this._printNumValue(s)}</div>` : d`<div class="missing">--</div>`}</div>`;
684
+ return c`<div class="statistics-row"><div>${n.numberOfNulls}</div>${f(s) ? c`<div class="data">${this._printNumValue(s)}</div>` : c`<div class="missing">--</div>`}</div>`;
684
685
  }
685
686
  }
686
- D("arcgis-field-info", Y);
687
+ G("arcgis-field-info", ge);
687
688
  export {
688
- Y as ArcgisFieldInfo
689
+ ge as ArcgisFieldInfo
689
690
  };