@arcgis/map-components 5.1.0-next.90 → 5.1.0-next.91

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.
Files changed (138) hide show
  1. package/dist/cdn/2XVIUHZR.js +2 -0
  2. package/dist/cdn/3KMSE2II.js +2 -0
  3. package/dist/cdn/3TNGLWSM.js +2 -0
  4. package/dist/cdn/47GZDSBT.js +2 -0
  5. package/dist/cdn/{NIRIMR5R.js → 4HIVPFCR.js} +1 -1
  6. package/dist/cdn/4TLYAVND.js +2 -0
  7. package/dist/cdn/{IWGEVWTS.js → 57WQVTC2.js} +1 -1
  8. package/dist/cdn/636SD5YI.js +2 -0
  9. package/dist/cdn/63PP72KA.js +2 -0
  10. package/dist/cdn/77GYZHXQ.js +2 -0
  11. package/dist/cdn/{MMBRI6HV.js → B647LFEA.js} +1 -1
  12. package/dist/cdn/DMYT2NGU.js +2 -0
  13. package/dist/cdn/EMYF3NHI.js +2 -0
  14. package/dist/cdn/EQEMVJRY.js +2 -0
  15. package/dist/cdn/FHPU53JE.js +2 -0
  16. package/dist/cdn/G5JRWW4N.js +2 -0
  17. package/dist/cdn/GSIO2ZPC.js +2 -0
  18. package/dist/cdn/H54OQ5CH.js +2 -0
  19. package/dist/cdn/{NSZXPPXS.js → J6K64FAM.js} +1 -1
  20. package/dist/cdn/K26WS5WS.js +2 -0
  21. package/dist/cdn/K2DPIVNY.js +2 -0
  22. package/dist/cdn/LNKHXXYR.js +2 -0
  23. package/dist/cdn/LS5SUX5K.js +2 -0
  24. package/dist/cdn/{YOLLEFX2.js → QG5A5CAV.js} +1 -1
  25. package/dist/cdn/{TME6NCLA.js → QTDWVVZ3.js} +1 -1
  26. package/dist/cdn/{2LNLB4XY.js → RBZSSI26.js} +1 -1
  27. package/dist/cdn/RQ5AH3UV.js +2 -0
  28. package/dist/cdn/SOMOHX4W.js +2 -0
  29. package/dist/cdn/SVK455WD.js +2 -0
  30. package/dist/cdn/T5CHGHFY.js +2 -0
  31. package/dist/cdn/TBGGJL5S.js +2 -0
  32. package/dist/cdn/UEAC3ZX7.js +2 -0
  33. package/dist/cdn/{UFBJWJZO.js → UYUEVVYI.js} +1 -1
  34. package/dist/cdn/VWOPI2DX.js +2 -0
  35. package/dist/cdn/WMQ4C7GL.js +2 -0
  36. package/dist/cdn/XEZGNV3L.js +2 -0
  37. package/dist/cdn/XNZFVKZY.js +2 -0
  38. package/dist/cdn/XUKTPPFV.js +2 -0
  39. package/dist/cdn/ZYPAW3ZI.js +2 -0
  40. package/dist/cdn/assets/oriented-imagery-viewer-image-viewer/t9n/messages.ar.json +1 -0
  41. package/dist/cdn/assets/oriented-imagery-viewer-image-viewer/t9n/messages.bg.json +1 -0
  42. package/dist/cdn/assets/oriented-imagery-viewer-image-viewer/t9n/messages.bs.json +1 -0
  43. package/dist/cdn/assets/oriented-imagery-viewer-image-viewer/t9n/messages.ca.json +1 -0
  44. package/dist/cdn/assets/oriented-imagery-viewer-image-viewer/t9n/messages.cs.json +1 -0
  45. package/dist/cdn/assets/oriented-imagery-viewer-image-viewer/t9n/messages.da.json +1 -0
  46. package/dist/cdn/assets/oriented-imagery-viewer-image-viewer/t9n/messages.de.json +1 -0
  47. package/dist/cdn/assets/oriented-imagery-viewer-image-viewer/t9n/messages.el.json +1 -0
  48. package/dist/cdn/assets/oriented-imagery-viewer-image-viewer/t9n/messages.es.json +1 -0
  49. package/dist/cdn/assets/oriented-imagery-viewer-image-viewer/t9n/messages.et.json +1 -0
  50. package/dist/cdn/assets/oriented-imagery-viewer-image-viewer/t9n/messages.fi.json +1 -0
  51. package/dist/cdn/assets/oriented-imagery-viewer-image-viewer/t9n/messages.fr.json +1 -0
  52. package/dist/cdn/assets/oriented-imagery-viewer-image-viewer/t9n/messages.he.json +1 -0
  53. package/dist/cdn/assets/oriented-imagery-viewer-image-viewer/t9n/messages.hr.json +1 -0
  54. package/dist/cdn/assets/oriented-imagery-viewer-image-viewer/t9n/messages.hu.json +1 -0
  55. package/dist/cdn/assets/oriented-imagery-viewer-image-viewer/t9n/messages.id.json +1 -0
  56. package/dist/cdn/assets/oriented-imagery-viewer-image-viewer/t9n/messages.it.json +1 -0
  57. package/dist/cdn/assets/oriented-imagery-viewer-image-viewer/t9n/messages.ja.json +1 -0
  58. package/dist/cdn/assets/oriented-imagery-viewer-image-viewer/t9n/messages.ko.json +1 -0
  59. package/dist/cdn/assets/oriented-imagery-viewer-image-viewer/t9n/messages.lt.json +1 -0
  60. package/dist/cdn/assets/oriented-imagery-viewer-image-viewer/t9n/messages.lv.json +1 -0
  61. package/dist/cdn/assets/oriented-imagery-viewer-image-viewer/t9n/messages.nl.json +1 -0
  62. package/dist/cdn/assets/oriented-imagery-viewer-image-viewer/t9n/messages.no.json +1 -0
  63. package/dist/cdn/assets/oriented-imagery-viewer-image-viewer/t9n/messages.pl.json +1 -0
  64. package/dist/cdn/assets/oriented-imagery-viewer-image-viewer/t9n/messages.pt-BR.json +1 -0
  65. package/dist/cdn/assets/oriented-imagery-viewer-image-viewer/t9n/messages.pt-PT.json +1 -0
  66. package/dist/cdn/assets/oriented-imagery-viewer-image-viewer/t9n/messages.ro.json +1 -0
  67. package/dist/cdn/assets/oriented-imagery-viewer-image-viewer/t9n/messages.ru.json +1 -0
  68. package/dist/cdn/assets/oriented-imagery-viewer-image-viewer/t9n/messages.sk.json +1 -0
  69. package/dist/cdn/assets/oriented-imagery-viewer-image-viewer/t9n/messages.sl.json +1 -0
  70. package/dist/cdn/assets/oriented-imagery-viewer-image-viewer/t9n/messages.sr.json +1 -0
  71. package/dist/cdn/assets/oriented-imagery-viewer-image-viewer/t9n/messages.sv.json +1 -0
  72. package/dist/cdn/assets/oriented-imagery-viewer-image-viewer/t9n/messages.th.json +1 -0
  73. package/dist/cdn/assets/oriented-imagery-viewer-image-viewer/t9n/messages.tr.json +1 -0
  74. package/dist/cdn/assets/oriented-imagery-viewer-image-viewer/t9n/messages.uk.json +1 -0
  75. package/dist/cdn/assets/oriented-imagery-viewer-image-viewer/t9n/messages.vi.json +1 -0
  76. package/dist/cdn/assets/oriented-imagery-viewer-image-viewer/t9n/messages.zh-CN.json +1 -0
  77. package/dist/cdn/assets/oriented-imagery-viewer-image-viewer/t9n/messages.zh-HK.json +1 -0
  78. package/dist/cdn/assets/oriented-imagery-viewer-image-viewer/t9n/messages.zh-TW.json +1 -0
  79. package/dist/cdn/index.js +1 -1
  80. package/dist/chunks/GeolocationPositioning.js +397 -0
  81. package/dist/chunks/action-utils.js +6 -9
  82. package/dist/chunks/resources.js +18 -5
  83. package/dist/chunks/slots.js +11 -9
  84. package/dist/components/arcgis-compass/customElement.js +5 -5
  85. package/dist/components/arcgis-feature-table/customElement.d.ts +68 -11
  86. package/dist/components/arcgis-feature-table/customElement.js +6 -6
  87. package/dist/components/arcgis-fullscreen/customElement.js +9 -9
  88. package/dist/components/arcgis-home/customElement.js +10 -10
  89. package/dist/components/arcgis-locate/customElement.js +97 -484
  90. package/dist/components/arcgis-navigation-toggle/customElement.js +7 -7
  91. package/dist/components/arcgis-presentation/customElement.js +63 -57
  92. package/dist/components/arcgis-track/customElement.d.ts +18 -11
  93. package/dist/components/arcgis-track/customElement.js +139 -19
  94. package/dist/components/arcgis-track/types.d.ts +15 -0
  95. package/dist/components/arcgis-utility-network-trace-analysis/customElement.js +25 -24
  96. package/dist/components/arcgis-utility-network-trace-inputs/customElement.js +29 -33
  97. package/dist/components/arcgis-zoom/customElement.js +1 -1
  98. package/dist/docs/api.json +1 -1
  99. package/dist/docs/docs.json +1 -1
  100. package/dist/docs/vscode.html-custom-data.json +1 -1
  101. package/dist/docs/web-types.json +1 -1
  102. package/dist/loader.js +2 -2
  103. package/dist/support/resources.d.ts +2 -0
  104. package/dist/types/lumina.d.ts +2 -2
  105. package/dist/types/preact.d.ts +2 -2
  106. package/dist/types/react.d.ts +2 -2
  107. package/dist/types/stencil.d.ts +2 -2
  108. package/package.json +4 -4
  109. package/dist/cdn/2OMOYS3B.js +0 -2
  110. package/dist/cdn/3Y5E26OU.js +0 -2
  111. package/dist/cdn/3YHIONOM.js +0 -2
  112. package/dist/cdn/3YVU66DR.js +0 -2
  113. package/dist/cdn/5BKXAZGJ.js +0 -2
  114. package/dist/cdn/6BESCJK6.js +0 -2
  115. package/dist/cdn/AOKQLNNK.js +0 -2
  116. package/dist/cdn/BBIOP3C4.js +0 -2
  117. package/dist/cdn/BLH76V4B.js +0 -2
  118. package/dist/cdn/BQPSXTIF.js +0 -2
  119. package/dist/cdn/CUYGLJRU.js +0 -2
  120. package/dist/cdn/FIOFLICP.js +0 -2
  121. package/dist/cdn/GKVKQU57.js +0 -2
  122. package/dist/cdn/GPMDFKYC.js +0 -2
  123. package/dist/cdn/IFMQCWXY.js +0 -2
  124. package/dist/cdn/IRXWDEBR.js +0 -2
  125. package/dist/cdn/JHRFJTE4.js +0 -2
  126. package/dist/cdn/JWYAOQXS.js +0 -2
  127. package/dist/cdn/KIFOQG3B.js +0 -2
  128. package/dist/cdn/MTIB3TBG.js +0 -2
  129. package/dist/cdn/NFRJBN5U.js +0 -2
  130. package/dist/cdn/NUNGBEW4.js +0 -2
  131. package/dist/cdn/NVRFQSZB.js +0 -2
  132. package/dist/cdn/PNS6E574.js +0 -2
  133. package/dist/cdn/PSIEACM5.js +0 -2
  134. package/dist/cdn/QLTX4J5N.js +0 -2
  135. package/dist/cdn/SPGWCKQB.js +0 -2
  136. package/dist/cdn/THXCDBHG.js +0 -2
  137. package/dist/cdn/XF7T7NTL.js +0 -2
  138. package/dist/cdn/ZDGTAZF7.js +0 -2
@@ -1,19 +1,19 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
2
  import { c as d } from "../../chunks/runtime.js";
3
- import { when as c } from "@arcgis/core/core/reactiveUtils.js";
3
+ import { when as s } from "@arcgis/core/core/reactiveUtils.js";
4
4
  import { LitElement as g, createEvent as h, nothing as r, safeClassMap as p } from "@arcgis/lumina";
5
5
  import { usePropertyChange as u } from "@arcgis/lumina/controllers";
6
6
  import { css as v, html as m } from "lit";
7
7
  import { u as f } from "../../chunks/useT9n.js";
8
8
  import { u as b } from "../../chunks/useView.js";
9
9
  import { g as y } from "../../chunks/globalCss.js";
10
- const M = v`.arcgis-button{--calcite-icon-color: var(--calcite-color-text-3);--calcite-button-background-color: var(--calcite-color-foreground-1);color:var(--calcite-color-text-3);line-height:var(--calcite-font-line-height-relative-tight);display:flex;flex-flow:column;cursor:pointer;background-color:var(--calcite-color-foreground-1);font-size:var(--calcite-font-size);:hover{--calcite-icon-color: var(--calcite-color-text-1);--calcite-button-background-color: var(--calcite-color-transparent-hover)}}:host{display:flex;inline-size:fit-content;block-size:fit-content}.root{--calcite-internal-action-bar-padding: 0;--calcite-internal-action-bar-gap: 0;--calcite-action-corner-radius: 0}`, e = {
10
+ const M = v`.arcgis-button{--calcite-icon-color: var(--calcite-color-text-3);--calcite-button-background-color: var(--calcite-color-foreground-1);color:var(--calcite-color-text-3);line-height:var(--calcite-font-line-height-relative-tight);calcite-button{--calcite-offset-invert-focus: 1}display:flex;flex-flow:column;cursor:pointer;background-color:var(--calcite-color-foreground-1);font-size:var(--calcite-font-size);:hover{--calcite-icon-color: var(--calcite-color-text-1);--calcite-button-background-color: var(--calcite-color-transparent-hover)}}:host{display:flex;inline-size:fit-content;block-size:fit-content}.root{--calcite-internal-action-bar-padding: 0;--calcite-internal-action-bar-gap: 0;--calcite-action-corner-radius: 0}`, i = {
11
11
  pan: "move",
12
12
  rotate: "rotate"
13
13
  };
14
14
  class $ extends g {
15
15
  constructor() {
16
- super(...arguments), this._messages = f(), this._state = "disabled", this.autoDestroyDisabled = !1, this.view = b(this), this.icon = e.pan, this.layout = "vertical", this.navigationMode = "pan", this.visualScale = "m", this.arcgisPropertyChange = u()("layout", "state"), this.arcgisReady = h();
16
+ super(...arguments), this._messages = f(), this._state = "disabled", this.autoDestroyDisabled = !1, this.view = b(this), this.icon = i.pan, this.layout = "vertical", this.navigationMode = "pan", this.visualScale = "m", this.arcgisPropertyChange = u()("layout", "state"), this.arcgisReady = h();
17
17
  }
18
18
  static {
19
19
  this.properties = { _state: 16, autoDestroyDisabled: 5, view: 0, icon: 1, label: 1, layout: 3, messageOverrides: 0, navigationMode: 3, referenceElement: 1, state: 35, visualScale: 1 };
@@ -32,8 +32,8 @@ class $ extends g {
32
32
  }
33
33
  load() {
34
34
  this.manager.onLifecycle(() => [
35
- c(() => this.view?.navigation?.actionMap, () => this._updateNavigationActionMap()),
36
- c(() => {
35
+ s(() => this.view?.navigation?.actionMap, () => this._updateNavigationActionMap()),
36
+ s(() => {
37
37
  const { view: t } = this;
38
38
  return t?.ready && t?.type === "3d" ? "ready" : "disabled";
39
39
  }, (t) => {
@@ -58,8 +58,8 @@ class $ extends g {
58
58
  t.dragPrimary = a ? "pan" : "rotate", t.dragSecondary = a ? "rotate" : "pan";
59
59
  }
60
60
  render() {
61
- const { _messages: t, navigationMode: a, state: l } = this, o = t.pan ?? "", n = t.rotate ?? "", i = l === "disabled", s = a === "pan";
62
- return m`<calcite-action-bar class=${p({ root: !0, [y.disabled]: i })} expand-disabled .layout=${this.layout}><calcite-action .active=${s} .disabled=${i} .icon=${e.pan} @click=${this._onPanClick} .scale=${this.visualScale} .text=${o} title=${o ?? r}></calcite-action><calcite-action .active=${!s} .disabled=${i} .icon=${e.rotate} @click=${this._onRotateClick} .scale=${this.visualScale} .text=${n} title=${n ?? r}></calcite-action></calcite-action-bar>`;
61
+ const { _messages: t, navigationMode: a, state: l } = this, o = t.pan ?? "", n = t.rotate ?? "", e = l === "disabled", c = a === "pan";
62
+ return m`<calcite-action-bar class=${p({ root: !0, [y.disabled]: e })} expand-disabled .layout=${this.layout}><calcite-action .active=${c} .disabled=${e} .icon=${i.pan} @click=${this._onPanClick} .scale=${this.visualScale} .text=${o} title=${o ?? r}></calcite-action><calcite-action .active=${!c} .disabled=${e} .icon=${i.rotate} @click=${this._onRotateClick} .scale=${this.visualScale} .text=${n} title=${n ?? r}></calcite-action></calcite-action-bar>`;
63
63
  }
64
64
  }
65
65
  d("arcgis-navigation-toggle", $);
@@ -1,15 +1,15 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import { c as z } from "../../chunks/runtime.js";
3
- import { css as O, html as u } from "lit";
4
- import { GenericController as L, proxyExports as $, useDirection as M } from "@arcgis/lumina/controllers";
5
- import { LitElement as R, createEvent as I, nothing as v } from "@arcgis/lumina";
2
+ import { c as O } from "../../chunks/runtime.js";
3
+ import { css as z, html as u } from "lit";
4
+ import { GenericController as A, proxyExports as $, useDirection as M } from "@arcgis/lumina/controllers";
5
+ import { LitElement as R, createEvent as I, nothing as S } from "@arcgis/lumina";
6
6
  import { u as G } from "../../chunks/useT9n.js";
7
7
  import { m as N } from "../../chunks/useViewModel.js";
8
8
  import { property as d, subclass as B } from "@arcgis/core/core/accessorSupport/decorators.js";
9
9
  import E from "@arcgis/core/core/Accessor.js";
10
- import y from "@arcgis/core/core/Collection.js";
10
+ import w from "@arcgis/core/core/Collection.js";
11
11
  import { ignoreAbortErrors as T } from "@arcgis/core/core/promiseUtils.js";
12
- import { watch as g, on as D, whenOnce as S } from "@arcgis/core/core/reactiveUtils.js";
12
+ import { watch as v, on as D, whenOnce as m } from "@arcgis/core/core/reactiveUtils.js";
13
13
  import H from "@arcgis/core/Graphic.js";
14
14
  import V from "@arcgis/core/layers/Layer.js";
15
15
  import k from "@arcgis/core/graphic/CSVGraphicOrigin.js";
@@ -18,9 +18,9 @@ import W from "@arcgis/core/graphic/SceneGraphicOrigin.js";
18
18
  import K from "@arcgis/core/graphic/WFSGraphicOrigin.js";
19
19
  import U from "@arcgis/core/graphic/BuildingGraphicOrigin.js";
20
20
  import Q from "@arcgis/core/graphic/FeatureGraphicOrigin.js";
21
- import { fetchPopupFeaturesFromGraphics as A } from "@arcgis/core/applications/SceneViewer/sceneViewerUtils.js";
21
+ import { fetchPopupFeaturesFromGraphics as C } from "@arcgis/core/applications/SceneViewer/sceneViewerUtils.js";
22
22
  import { s as _ } from "../../chunks/resources.js";
23
- const q = O`:host{width:100%;height:100%;padding:var(--calcite-spacing-none);margin:var(--calcite-spacing-none);display:flex;--internal-attribution-height: 16px;--arcgis-internal-presentation-padding-start: unset;--arcgis-internal-presentation-padding-end: unset;--arcgis-internal-presentation-cover-padding-top: unset;--arcgis-internal-presentation-cover-padding-bottom: unset;--arcgis-internal-presentation-cover-padding-start: unset;--arcgis-internal-presentation-cover-padding-end: unset}p{padding:0;margin:0}.root{display:flex;flex-direction:column;justify-content:space-between;width:100%;height:100%}.presentation-content{display:flex;width:100%;justify-content:flex-end;padding-top:var(--calcite-spacing-lg);padding-inline-start:calc(var(--calcite-spacing-lg)+ var(--arcgis-internal-presentation-padding-start));padding-inline-end:calc(var(--calcite-spacing-lg) + var(--arcgis-internal-presentation-padding-end))}.navigation{width:fit-content;pointer-events:auto;display:flex;align-items:center;gap:var(--calcite-spacing-sm);background-color:var(--calcite-color-foreground-1);box-shadow:var(--arcgis-internal-box-shadow);margin-block:auto calc(var(--calcite-spacing-lg) + var(--internal-attribution-height));margin-inline-start:var(--calcite-spacing-lg)}.slide-counter-text{display:flex;align-items:center;justify-content:center;gap:var(--calcite-spacing-base);min-width:64px}.slide-counter-text-element{box-sizing:border-box;max-width:28px;margin:0;padding:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-variant-numeric:tabular-nums}.legend{pointer-events:all;box-shadow:var(--calcite-shadow-sm);max-width:300px;height:auto;max-height:calc(100vh - 136px);overflow:hidden auto}`;
23
+ const q = z`:host{width:100%;height:100%;padding:var(--calcite-spacing-none);margin:var(--calcite-spacing-none);display:flex;--internal-attribution-height: 16px;--arcgis-internal-presentation-padding-start: unset;--arcgis-internal-presentation-padding-end: unset;--arcgis-internal-presentation-cover-padding-top: unset;--arcgis-internal-presentation-cover-padding-bottom: unset;--arcgis-internal-presentation-cover-padding-start: unset;--arcgis-internal-presentation-cover-padding-end: unset}p{padding:0;margin:0}.root{display:flex;flex-direction:column;justify-content:space-between;width:100%;height:100%}.presentation-content{display:flex;width:100%;justify-content:flex-end;padding-top:var(--calcite-spacing-lg);padding-inline-start:calc(var(--calcite-spacing-lg) + var(--arcgis-internal-presentation-padding-start));padding-inline-end:calc(var(--calcite-spacing-lg) + var(--arcgis-internal-presentation-padding-end))}.navigation{width:fit-content;pointer-events:auto;display:flex;align-items:center;gap:var(--calcite-spacing-sm);background-color:var(--calcite-color-foreground-1);box-shadow:var(--arcgis-internal-box-shadow);margin-block:auto calc(var(--calcite-spacing-lg) + var(--internal-attribution-height));margin-inline-start:var(--calcite-spacing-lg)}.slide-counter-text{display:flex;align-items:center;justify-content:center;gap:var(--calcite-spacing-base);min-width:64px}.slide-counter-text-element{box-sizing:border-box;max-width:28px;margin:0;padding:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-variant-numeric:tabular-nums}.legend{pointer-events:all;box-shadow:var(--calcite-shadow-sm);max-width:300px;height:auto;max-height:calc(100vh - 136px);overflow:hidden auto}`;
24
24
  var J = Object.defineProperty, X = Object.getOwnPropertyDescriptor, l = (i, e, t, s) => {
25
25
  for (var n = s > 1 ? void 0 : s ? X(e, t) : e, r = i.length - 1, o; r >= 0; r--)
26
26
  (o = i[r]) && (n = (s ? o(e, t, n) : o(n)) || n);
@@ -43,7 +43,7 @@ let a = class extends E {
43
43
  }
44
44
  initialize() {
45
45
  this.addHandles(
46
- g(
46
+ v(
47
47
  () => this.view?.map,
48
48
  (i, e) => {
49
49
  if (this.hasHandles("sceneLoaded") && this.removeHandles("sceneLoaded"), e) {
@@ -51,7 +51,7 @@ let a = class extends E {
51
51
  t && t.length > 0 && this._unsubscribeToSlideEvents(t);
52
52
  }
53
53
  i && this.addHandles(
54
- g(
54
+ v(
55
55
  () => i.loaded,
56
56
  (t) => {
57
57
  t && (this.removeHandles("sceneLoaded"), this._startWatchSlides(), this._slideId && this._applySlideById(this._slideId));
@@ -75,10 +75,10 @@ let a = class extends E {
75
75
  i === void 0 || !this.view?.map?.loaded ? this._slideId = i : this._applySlideById(i);
76
76
  }
77
77
  get visibleSlides() {
78
- return this.view?.map?.presentation?.slides?.filter((i) => !i.hidden) ?? new y();
78
+ return this.view?.map?.presentation?.slides?.filter((i) => !i.hidden) ?? new w();
79
79
  }
80
80
  get slides() {
81
- return this.view?.map?.presentation?.slides ?? new y();
81
+ return this.view?.map?.presentation?.slides ?? new w();
82
82
  }
83
83
  get lastSlideSelected() {
84
84
  return this.getSlideIndexBySlideId(this.slideId) === this.visibleSlides.length - 1;
@@ -133,7 +133,7 @@ let a = class extends E {
133
133
  () => this.slides,
134
134
  "change",
135
135
  (i) => {
136
- this._subscribeToSlideEvents(new y(i.added)), this._unsubscribeToSlideEvents(new y(i.removed));
136
+ this._subscribeToSlideEvents(new w(i.added)), this._unsubscribeToSlideEvents(new w(i.removed));
137
137
  },
138
138
  {
139
139
  onListenerAdd: this._subscribeToSlideEvents,
@@ -204,14 +204,14 @@ l([
204
204
  a = l([
205
205
  B("components.presentation.PresentationViewModel")
206
206
  ], a);
207
- class Y extends L {
207
+ class Y extends A {
208
208
  constructor(e) {
209
209
  super(e);
210
210
  }
211
211
  hostLoaded() {
212
212
  this.component.manager.onLifecycle(() => {
213
213
  const e = this.component;
214
- S(() => e.referenceElement).then((t) => {
214
+ m(() => e.referenceElement).then((t) => {
215
215
  this._isArcgisScene(t) && (this._sceneRef = t);
216
216
  });
217
217
  });
@@ -274,12 +274,12 @@ class Y extends L {
274
274
  if (o?.id == null)
275
275
  return await Promise.resolve([]);
276
276
  const c = await e.whenLayerView(s);
277
- await S(() => !c.updating);
277
+ await m(() => !c.updating);
278
278
  const h = this._tryGetBuildingComponentSublayerView(s, n, c) ?? c;
279
- await S(() => !h.updating);
280
- const f = this._createFeatureGraphic(s, n, r, o.id);
281
- let x = await A(h, [f]);
282
- return this._featureHasBeenFilledWithAttributes(x) || (await S(() => !e.updating), x = await A(h, [f])), x;
279
+ await m(() => !h.updating);
280
+ const y = this._createFeatureGraphic(s, n, r, o.id);
281
+ let x = await C(h, [y]);
282
+ return this._featureHasBeenFilledWithAttributes(x) || (await m(() => !e.updating), x = await C(h, [y])), x;
283
283
  }
284
284
  _tryGetBuildingComponentSublayerView(e, t, s) {
285
285
  let n;
@@ -337,48 +337,54 @@ class Y extends L {
337
337
  }
338
338
  //#endregion
339
339
  }
340
- const Z = (i) => new Y(i), w = Object.freeze({ width: 0, height: 0 }), b = /* @__PURE__ */ new WeakMap(), m = () => ({
341
- topLeft: { ...w },
342
- topRight: { ...w },
343
- bottomLeft: { ...w },
344
- bottomRight: { ...w }
345
- }), F = (i) => ({
340
+ const Z = (i) => new Y(i), g = Object.freeze({ width: 0, height: 0 }), f = /* @__PURE__ */ new WeakMap(), b = () => ({
341
+ topCenter: { ...g },
342
+ topLeft: { ...g },
343
+ topRight: { ...g },
344
+ bottomCenter: { ...g },
345
+ bottomLeft: { ...g },
346
+ bottomRight: { ...g }
347
+ }), L = (i) => ({
348
+ topCenter: { ...i.topCenter },
346
349
  topLeft: { ...i.topLeft },
347
350
  topRight: { ...i.topRight },
351
+ bottomCenter: { ...i.bottomCenter },
348
352
  bottomLeft: { ...i.bottomLeft },
349
353
  bottomRight: { ...i.bottomRight }
350
- }), C = (i) => {
351
- let e = b.get(i);
354
+ }), F = (i) => {
355
+ let e = f.get(i);
352
356
  return e || (e = {
353
357
  observedGroups: /* @__PURE__ */ new Map(),
354
- observedSizes: m(),
358
+ observedSizes: b(),
355
359
  subscribers: /* @__PURE__ */ new Set()
356
- }, b.set(i, e)), e;
360
+ }, f.set(i, e)), e;
357
361
  }, ee = (i) => {
358
- const e = i?.topLeft.value, t = i?.topRight.value, s = i?.bottomLeft.value, n = i?.bottomRight.value;
359
- return e && t && s && n ? {
360
- topLeft: e,
361
- topRight: t,
362
- bottomLeft: s,
363
- bottomRight: n
362
+ const e = i?.topCenter.value, t = i?.topLeft.value, s = i?.topRight.value, n = i?.bottomCenter.value, r = i?.bottomLeft.value, o = i?.bottomRight.value;
363
+ return e && t && s && n && r && o ? {
364
+ topCenter: e,
365
+ topLeft: t,
366
+ topRight: s,
367
+ bottomCenter: n,
368
+ bottomLeft: r,
369
+ bottomRight: o
364
370
  } : null;
365
371
  }, te = (i, e) => _.every((t) => i.get(t) === e[t]), ie = (i) => {
366
- const e = F(i.observedSizes);
372
+ const e = L(i.observedSizes);
367
373
  i.subscribers.forEach((t) => t(e));
368
374
  }, se = (i, e) => {
369
- const t = b.get(i);
375
+ const t = f.get(i);
370
376
  if (!t)
371
377
  return;
372
378
  let s = !1;
373
379
  e.forEach((n) => {
374
- const r = _.find((f) => t.observedGroups.get(f) === n.target);
380
+ const r = _.find((y) => t.observedGroups.get(y) === n.target);
375
381
  if (!r)
376
382
  return;
377
383
  const { width: o, height: c } = n.contentRect, p = { width: o, height: c }, h = t.observedSizes[r];
378
384
  h.width === p.width && h.height === p.height || (t.observedSizes[r] = p, s = !0);
379
385
  }), s && ie(t);
380
386
  }, P = (i, e) => {
381
- const t = C(i);
387
+ const t = F(i);
382
388
  t.resizeObserver || (t.resizeObserver = new ResizeObserver((n) => {
383
389
  se(i, n);
384
390
  }));
@@ -392,13 +398,13 @@ const Z = (i) => new Y(i), w = Object.freeze({ width: 0, height: 0 }), b = /* @_
392
398
  t.observedGroups.set(n, r), t.resizeObserver?.observe(r);
393
399
  }));
394
400
  }, ne = (i, e) => {
395
- const t = C(i);
396
- return t.subscribers.add(e), e(F(t.observedSizes)), () => {
397
- const s = b.get(i);
398
- s && (s.subscribers.delete(e), s.subscribers.size === 0 && (s.resizeObserver?.disconnect(), s.observedGroups.clear(), b.delete(i)));
401
+ const t = F(i);
402
+ return t.subscribers.add(e), e(L(t.observedSizes)), () => {
403
+ const s = f.get(i);
404
+ s && (s.subscribers.delete(e), s.subscribers.size === 0 && (s.resizeObserver?.disconnect(), s.observedGroups.clear(), f.delete(i)));
399
405
  };
400
406
  };
401
- class re extends L {
407
+ class re extends A {
402
408
  // References to the slot group elements owned by the host component.
403
409
  #t;
404
410
  #e;
@@ -409,19 +415,19 @@ class re extends L {
409
415
  * @param component The host component that owns the slot group elements.
410
416
  */
411
417
  constructor(e) {
412
- super(e), this.exports = m();
418
+ super(e), this.exports = b();
413
419
  }
414
420
  hostDisconnected() {
415
- this.#i?.(), this.#i = void 0, this.#e = void 0, this.#t = void 0, this.exports = m();
421
+ this.#i?.(), this.#i = void 0, this.#e = void 0, this.#t = void 0, this.exports = b();
416
422
  }
417
423
  hostLifecycle() {
418
424
  return [
419
- g(
425
+ v(
420
426
  () => this.#s(),
421
427
  (t) => {
422
428
  if (this.#e !== t) {
423
429
  if (this.#i?.(), this.#i = void 0, this.#e = t, this.#t = t?.slotGroupRefs, !t) {
424
- this.exports = m();
430
+ this.exports = b();
425
431
  return;
426
432
  }
427
433
  this.#i = ne(t, (s) => {
@@ -431,7 +437,7 @@ class re extends L {
431
437
  },
432
438
  { sync: !0, initial: !0 }
433
439
  ),
434
- g(
440
+ v(
435
441
  () => this.#s()?.slotGroupRefs,
436
442
  (t) => {
437
443
  this.#t = t, this.#e && t && P(this.#e, t);
@@ -449,7 +455,7 @@ class re extends L {
449
455
  }
450
456
  // Compares the newly measured sizes against the currently exported values.
451
457
  #n(e) {
452
- const t = this.exports ?? m();
458
+ const t = this.exports ?? b();
453
459
  return _.every((s) => {
454
460
  const n = t[s], r = e[s];
455
461
  return n.width === r.width && n.height === r.height;
@@ -484,11 +490,11 @@ class le extends R {
484
490
  }
485
491
  loaded() {
486
492
  this.manager.onLifecycle(() => {
487
- this.viewModel.onApplySlideStart = this._handleApplySlideStart, this.viewModel.onApplySlideComplete = this._handleApplySlideComplete, this._keyboardHandle = g(() => this.keyboardNavigationEnabled, (t) => {
493
+ this.viewModel.onApplySlideStart = this._handleApplySlideStart, this.viewModel.onApplySlideComplete = this._handleApplySlideComplete, this._keyboardHandle = v(() => this.keyboardNavigationEnabled, (t) => {
488
494
  document.removeEventListener("keydown", this._captureArrowKeysForNavigation), t && document.addEventListener("keydown", this._captureArrowKeysForNavigation);
489
495
  }, { initial: !0 });
490
496
  const e = this;
491
- S(() => e.referenceElement).then((t) => {
497
+ m(() => e.referenceElement).then((t) => {
492
498
  this._isArcgisScene(t) && (this._slotSizesController = oe(this), this._watchSceneViewSlotSizes());
493
499
  }), this.manager.onDisconnected(() => {
494
500
  document.removeEventListener("keydown", this._captureArrowKeysForNavigation), this._keyboardHandle?.remove();
@@ -499,7 +505,7 @@ class le extends R {
499
505
  return e === void 0 || typeof e == "string" ? !1 : "tagName" in e && e.tagName === "ARCGIS-SCENE";
500
506
  }
501
507
  _watchSceneViewSlotSizes() {
502
- return g(() => this._slotSizesController, (e) => this._updatePresentationCaptionsPadding(e?.topLeft, e?.topRight, e?.bottomLeft, e?.bottomRight), { initial: !0 });
508
+ return v(() => this._slotSizesController, (e) => this._updatePresentationCaptionsPadding(e?.topLeft, e?.topRight, e?.bottomLeft, e?.bottomRight), { initial: !0 });
503
509
  }
504
510
  _updatePresentationCaptionsPadding(e, t, s, n) {
505
511
  const r = this._direction === "ltr" ? e?.width ?? 0 : t?.width ?? 0, o = this._direction === "ltr" ? t?.width ?? 0 : e?.width ?? 0, c = Math.max(e?.height ?? 0, t?.height ?? 0), p = Math.max(s?.height ?? 0, n?.height ?? 0);
@@ -515,11 +521,11 @@ class le extends R {
515
521
  }
516
522
  _renderNavigation() {
517
523
  const e = this.viewModel.lastSlideSelected && !this.viewModel.hasOnlyOneSlide, t = this._direction === "rtl", s = t ? "chevron-right" : "chevron-left", n = t ? "chevron-left" : "chevron-right";
518
- return u`<div class="navigation"><calcite-button appearance=transparent icon-start=${s ?? v} kind=neutral .scale=${this.scale} .disabled=${this.viewModel.firstSlideSelected || !this.viewModel.slideSelected} .label=${this._messages.previous} title=${this._messages.previous ?? v} @click=${() => this.viewModel.navigateInPresentation(-1)}></calcite-button><div class="slide-counter-text">${this._renderSlideCounter()}</div><calcite-button appearance=transparent icon-start=${(e ? "reset" : n) ?? v} kind=neutral .scale=${this.scale} .label=${e ? this._messages.restart : this._messages.next} title=${(e ? this._messages.restart : this._messages.next) ?? v} @click=${() => this.viewModel.navigateInPresentation(1)}></calcite-button></div>`;
524
+ return u`<div class="navigation"><calcite-button appearance=transparent icon-start=${s ?? S} kind=neutral .scale=${this.scale} .disabled=${this.viewModel.firstSlideSelected || !this.viewModel.slideSelected} .label=${this._messages.previous} title=${this._messages.previous ?? S} @click=${() => this.viewModel.navigateInPresentation(-1)}></calcite-button><div class="slide-counter-text">${this._renderSlideCounter()}</div><calcite-button appearance=transparent icon-start=${(e ? "reset" : n) ?? S} kind=neutral .scale=${this.scale} .label=${e ? this._messages.restart : this._messages.next} title=${(e ? this._messages.restart : this._messages.next) ?? S} @click=${() => this.viewModel.navigateInPresentation(1)}></calcite-button></div>`;
519
525
  }
520
526
  _renderSlideCounter() {
521
527
  const e = this.viewModel.slideIndex + 1, t = this._messages?.slideNavAriaText?.replace("${index}", e.toString()).replace("${numberOfSlides}", this.viewModel.visibleSlides.length.toString());
522
- return this.viewModel.slideSelected ? u`<p role=banner aria-label=${t ?? v} aria-live=polite><div class="slide-counter-text-element" data-testId=arcgis-map-presentation-slideIndex>${e}</div><div class="slide-counter-text-element">/</div><p class="slide-counter-text-element" data-testId=arcgis-map-presentation-numberOfSlides>${this.viewModel.visibleSlides.length}</p></p>` : u`<p role=banner data-testId=arcgis-map-presentation-numberOfSlides>${this.viewModel.visibleSlides?.length} ${this._messages?.slides}</p>`;
528
+ return this.viewModel.slideSelected ? u`<p role=banner aria-label=${t ?? S} aria-live=polite><div class="slide-counter-text-element" data-testId=arcgis-map-presentation-slideIndex>${e}</div><div class="slide-counter-text-element">/</div><p class="slide-counter-text-element" data-testId=arcgis-map-presentation-numberOfSlides>${this.viewModel.visibleSlides.length}</p></p>` : u`<p role=banner data-testId=arcgis-map-presentation-numberOfSlides>${this.viewModel.visibleSlides?.length} ${this._messages?.slides}</p>`;
523
529
  }
524
530
  _renderCaptions(e) {
525
531
  return this.slideCaptionsDisabled ? null : u`<arcgis-presentation-captions .slide=${e} .transitionActive=${this.viewModel.transitionActive}></arcgis-presentation-captions>`;
@@ -528,7 +534,7 @@ class le extends R {
528
534
  return this.slideLegendDisabled || !this.viewModel.showLegend ? null : u`<calcite-panel data-testid=presentation-legend class="legend" .heading=${this._messages.legend} closable @calcitePanelClose=${() => this.viewModel.showLegend = !1}><arcgis-legend .view=${this.view} @arcgisReady=${(e) => e.stopPropagation()}></arcgis-legend></calcite-panel>`;
529
535
  }
530
536
  }
531
- z("arcgis-presentation", le);
537
+ O("arcgis-presentation", le);
532
538
  export {
533
539
  le as ArcgisPresentation
534
540
  };
@@ -1,12 +1,12 @@
1
1
  /// <reference path="../../index.d.ts" />
2
+ import type MapView from "@arcgis/core/views/MapView.js";
3
+ import type SceneView from "@arcgis/core/views/SceneView.js";
2
4
  import type Graphic from "@arcgis/core/Graphic.js";
3
- import type { TrackViewModelTrackErrorEvent, TrackViewModelTrackEvent, TrackViewModelState } from "@arcgis/core/widgets/Track/TrackViewModel.js";
4
5
  import type { PublicLitElement as LitElement } from "@arcgis/lumina";
5
6
  import type { ArcgisReferenceElement, IconName } from "../types.js";
6
7
  import type { T9nMeta } from "@arcgis/lumina/controllers";
7
- import type { MapViewOrSceneView } from "@arcgis/core/views/MapViewOrSceneView.js";
8
8
  import type { GoToOverride } from "@arcgis/core/widgets/support/types.js";
9
- import type { PositionFilterFunction } from "@arcgis/core/widgets/Track/types.js";
9
+ import type { PositionFilterFunction, TrackViewModelState } from "./types.js";
10
10
  import type { Button as Button } from "@esri/calcite-components/components/calcite-button";
11
11
 
12
12
  /**
@@ -44,6 +44,13 @@ export abstract class ArcgisTrack extends LitElement {
44
44
  * @default false
45
45
  */
46
46
  accessor autoDestroyDisabled: boolean;
47
+ /**
48
+ * Indicates the current position of the geolocation result returned by the browser's Geolocation API.
49
+ * This property is updated when a new position is returned by the API, and is used to update the graphic and navigate to that location.
50
+ *
51
+ * @since 5.1
52
+ */
53
+ accessor currentPosition: GeolocationPosition | undefined;
47
54
  /**
48
55
  * Error that caused the last [track-error](https://developers.arcgis.com/javascript/latest/references/core/widgets/Track/TrackViewModel/#event:track-error) event to fire.
49
56
  *
@@ -52,7 +59,7 @@ export abstract class ArcgisTrack extends LitElement {
52
59
  * if(track.viewModel.state === 'error')
53
60
  * console.error(track.viewModel.error);
54
61
  */
55
- accessor error: Error | GeolocationPositionError | null | undefined;
62
+ accessor error: Error | GeolocationPositionError | undefined;
56
63
  /**
57
64
  * An object used for setting optional position parameters. Refer to the
58
65
  * [Geolocation API Specification](https://www.w3.org/TR/geolocation/#position_options_interface)
@@ -69,7 +76,7 @@ export abstract class ArcgisTrack extends LitElement {
69
76
  * }
70
77
  * });
71
78
  */
72
- accessor geolocationOptions: PositionOptions | null | undefined;
79
+ accessor geolocationOptions: PositionOptions | undefined;
73
80
  /**
74
81
  * Indicates whether to navigate the view to the position and scale of the geolocated result.
75
82
  *
@@ -90,7 +97,7 @@ export abstract class ArcgisTrack extends LitElement {
90
97
  * };
91
98
  * ```
92
99
  */
93
- accessor goToOverride: GoToOverride | null | undefined;
100
+ accessor goToOverride: GoToOverride | undefined;
94
101
  /**
95
102
  * The graphic used to show the user's location on the map.
96
103
  *
@@ -170,7 +177,7 @@ export abstract class ArcgisTrack extends LitElement {
170
177
  * return geometryEngine.within(myLocation, geofenceExtent);
171
178
  * };
172
179
  */
173
- accessor positionFilterFunction: PositionFilterFunction | null | undefined;
180
+ accessor positionFilterFunction: PositionFilterFunction | undefined;
174
181
  /**
175
182
  * By assigning the `id` attribute of the Map or Scene component to this property, you can position a child component anywhere in the DOM while still maintaining a connection to the Map or Scene.
176
183
  *
@@ -198,7 +205,7 @@ export abstract class ArcgisTrack extends LitElement {
198
205
  *
199
206
  * @since 4.7
200
207
  */
201
- accessor scale: number | null | undefined;
208
+ accessor scale: number | undefined;
202
209
  /**
203
210
  * The current state of the component.
204
211
  *
@@ -215,7 +222,7 @@ export abstract class ArcgisTrack extends LitElement {
215
222
  * The view associated with the component.
216
223
  * > **Note:** The recommended approach is to fully migrate applications to use map and scene components and avoid using MapView and SceneView directly. However, if you are migrating a large application from widgets to components, you might prefer a more gradual transition. To support this use case, the SDK includes this `view` property which connects a component to a MapView or SceneView. Ultimately, once migration is complete, the arcgis-track component will be associated with a map or scene component rather than using the `view` property.
217
224
  */
218
- accessor view: MapViewOrSceneView | null | undefined;
225
+ accessor view: MapView | SceneView | undefined;
219
226
  /**
220
227
  * Specifies the size of the component.
221
228
  *
@@ -229,8 +236,8 @@ export abstract class ArcgisTrack extends LitElement {
229
236
  start(): Promise<void>;
230
237
  /** Stop tracking the user's location. */
231
238
  stop(): Promise<void>;
232
- readonly arcgisComplete: import("@arcgis/lumina").TargetedEvent<this, TrackViewModelTrackEvent>;
233
- readonly arcgisError: import("@arcgis/lumina").TargetedEvent<this, TrackViewModelTrackErrorEvent>;
239
+ readonly arcgisComplete: import("@arcgis/lumina").TargetedEvent<this, { position: GeolocationPosition; }>;
240
+ readonly arcgisError: import("@arcgis/lumina").TargetedEvent<this, { error: GeolocationPositionError; }>;
234
241
  /** Emitted when the value of a property is changed. Use this to listen to changes to properties. */
235
242
  readonly arcgisPropertyChange: import("@arcgis/lumina").TargetedEvent<this, { name: "state"; }>;
236
243
  /** Emitted when the component associated with a map or scene view is ready to be interacted with. */
@@ -1,24 +1,134 @@
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 g, html as e } from "lit";
4
- import { usePropertyChange as v } from "@arcgis/lumina/controllers";
5
- import { reEmitEvent as a } from "@arcgis/lumina/controllers/accessor";
6
- import { classes as u } from "@arcgis/toolkit/dom";
7
- import p from "@arcgis/core/widgets/Track/TrackViewModel.js";
8
- import { LitElement as m, createEvent as f, safeClassMap as w, nothing as M } from "@arcgis/lumina";
9
- import { u as b } from "../../chunks/useT9n.js";
10
- import { m as k } from "../../chunks/useViewModel.js";
11
- import { g as E } from "../../chunks/globalCss.js";
12
- const T = g`.arcgis-button{--calcite-icon-color: var(--calcite-color-text-3);--calcite-button-background-color: var(--calcite-color-foreground-1);color:var(--calcite-color-text-3);line-height:var(--calcite-font-line-height-relative-tight);display:flex;flex-flow:column;cursor:pointer;background-color:var(--calcite-color-foreground-1);font-size:var(--calcite-font-size);:hover{--calcite-icon-color: var(--calcite-color-text-1);--calcite-button-background-color: var(--calcite-color-transparent-hover)}}:host{width:fit-content;height:fit-content}`, y = k(p);
13
- class $ extends m {
2
+ import { c as m } from "../../chunks/runtime.js";
3
+ import { css as f, html as d } from "lit";
4
+ import { watch as p } from "@arcgis/core/core/reactiveUtils.js";
5
+ import { LitElement as _, createEvent as g, safeClassMap as w, nothing as k } from "@arcgis/lumina";
6
+ import { usePropertyChange as b } from "@arcgis/lumina/controllers";
7
+ import { classes as T } from "@arcgis/toolkit/dom";
8
+ import { u as y } from "../../chunks/useT9n.js";
9
+ import { m as M } from "../../chunks/useViewModel.js";
10
+ import { g as P } from "../../chunks/globalCss.js";
11
+ import { property as a, subclass as E } from "@arcgis/core/core/accessorSupport/decorators.js";
12
+ import { i as I, b as O } from "../../chunks/async-utils.js";
13
+ import { debounce as C } from "lodash-es";
14
+ import { G as S } from "../../chunks/GeolocationPositioning.js";
15
+ const D = f`.arcgis-button{--calcite-icon-color: var(--calcite-color-text-3);--calcite-button-background-color: var(--calcite-color-foreground-1);color:var(--calcite-color-text-3);line-height:var(--calcite-font-line-height-relative-tight);calcite-button{--calcite-offset-invert-focus: 1}display:flex;flex-flow:column;cursor:pointer;background-color:var(--calcite-color-foreground-1);font-size:var(--calcite-font-size);:hover{--calcite-icon-color: var(--calcite-color-text-1);--calcite-button-background-color: var(--calcite-color-transparent-hover)}}:host{width:fit-content;height:fit-content}`;
16
+ var F = Object.defineProperty, $ = Object.getOwnPropertyDescriptor, r = (e, t, s, c) => {
17
+ for (var i = c > 1 ? void 0 : c ? $(t, s) : t, h = e.length - 1, l; h >= 0; h--)
18
+ (l = e[h]) && (i = (c ? l(t, s, i) : l(i)) || i);
19
+ return c && i && F(t, s, i), i;
20
+ };
21
+ const x = 15e3;
22
+ let o = class extends S {
23
+ constructor(e) {
24
+ super(e);
25
+ }
26
+ destroy() {
27
+ this._stopTracking();
28
+ }
29
+ get state() {
30
+ return this._geolocationUsable ? this.view && !this.view.ready ? "disabled" : this._settingPosition || this._trackStartingTimeoutId !== void 0 ? "waiting" : this.tracking ? "tracking" : this.error != null ? "error" : "ready" : "feature-unsupported";
31
+ }
32
+ get tracking() {
33
+ return this._watchId !== void 0;
34
+ }
35
+ start() {
36
+ this.state === "disabled" || this.state === "feature-unsupported" || this._startTracking();
37
+ }
38
+ stop() {
39
+ this.state === "disabled" || this.state === "feature-unsupported" || this._stopTracking();
40
+ }
41
+ _stopWatchingPosition() {
42
+ this._watchId !== void 0 && (navigator.geolocation.clearWatch(this._watchId), this._watchId = void 0);
43
+ }
44
+ _stopTracking() {
45
+ this._abortTrack(), this._clearWaitingTimer(), this._stopWatchingPosition(), this._clearGraphic();
46
+ }
47
+ _startTracking() {
48
+ this._stopTracking();
49
+ const e = C(async (t) => {
50
+ this._abortTrack();
51
+ const s = new AbortController();
52
+ this._trackController = s;
53
+ const { timestamp: c, coords: i } = t, h = i.toJSON(), l = {
54
+ timestamp: c,
55
+ coords: h
56
+ };
57
+ this.error = void 0;
58
+ try {
59
+ const n = this.positionFilterFunction;
60
+ if (typeof n == "function" && !n({ position: l }) || (await this.updatePosition(t, s), this._trackController !== s))
61
+ return;
62
+ this._clearWaitingTimer(), this._addGraphic(), this.currentPosition = t, this._trackController = void 0;
63
+ } catch (n) {
64
+ if (I(n))
65
+ return;
66
+ throw this._trackController = void 0, this.error = n, this._clearWaitingTimer(), n;
67
+ }
68
+ }, 0);
69
+ this._watchId = navigator.geolocation.watchPosition(
70
+ (t) => {
71
+ this._settingPosition = e(t)?.catch(O);
72
+ },
73
+ this._handleWatchPositionError.bind(this),
74
+ this.geolocationOptions ?? void 0
75
+ ), this._trackStartingTimeoutId = setTimeout(() => {
76
+ this._trackStartingTimeoutId = void 0;
77
+ }, x);
78
+ }
79
+ _handleWatchPositionError(e) {
80
+ e.code === e.PERMISSION_DENIED && this._stopTracking(), this.error = e;
81
+ }
82
+ _abortTrack() {
83
+ this._trackController?.abort(), this._trackController = void 0;
84
+ }
85
+ _clearWaitingTimer() {
86
+ clearTimeout(this._trackStartingTimeoutId), this._trackStartingTimeoutId = void 0, this._settingPosition = void 0;
87
+ }
88
+ };
89
+ r([
90
+ a()
91
+ ], o.prototype, "_watchId", 2);
92
+ r([
93
+ a()
94
+ ], o.prototype, "_trackStartingTimeoutId", 2);
95
+ r([
96
+ a()
97
+ ], o.prototype, "_settingPosition", 2);
98
+ r([
99
+ a()
100
+ ], o.prototype, "currentPosition", 2);
101
+ r([
102
+ a()
103
+ ], o.prototype, "error", 2);
104
+ r([
105
+ a()
106
+ ], o.prototype, "positionFilterFunction", 2);
107
+ r([
108
+ a({ readOnly: !0 })
109
+ ], o.prototype, "state", 1);
110
+ r([
111
+ a({ readOnly: !0 })
112
+ ], o.prototype, "tracking", 1);
113
+ r([
114
+ a()
115
+ ], o.prototype, "start", 1);
116
+ r([
117
+ a()
118
+ ], o.prototype, "stop", 1);
119
+ o = r([
120
+ E("map-components.track.TrackViewModel")
121
+ ], o);
122
+ const W = M(o);
123
+ class G extends _ {
14
124
  constructor() {
15
- super(...arguments), this.messages = b(), this.viewModel = y(this), this.view = this.viewModel.view, this.autoDestroyDisabled = !1, this.error = this.viewModel.error, this.geolocationOptions = this.viewModel.geolocationOptions, this.goToOverride = this.viewModel.goToOverride, this.goToLocationDisabled = this.viewModel.goToLocationEnabled, this.graphic = this.viewModel.graphic, this.icon = "compass-north-circle", this.positionFilterFunction = this.viewModel.positionFilterFunction, this.rotationDisabled = this.viewModel.rotationEnabled, this.scale = this.viewModel.scale, this.state = this.viewModel.state, this.tracking = this.viewModel.tracking, this.visualScale = "m", this.arcgisComplete = a(() => this.viewModel, "track"), this.arcgisError = a(() => this.viewModel, "track-error"), this.arcgisPropertyChange = v()("state"), this.arcgisReady = f();
125
+ super(...arguments), this.messages = y(), this.viewModel = W(this), this.view = this.viewModel.view, this.autoDestroyDisabled = !1, this.currentPosition = this.viewModel.currentPosition, this.error = this.viewModel.error, this.geolocationOptions = this.viewModel.geolocationOptions, this.goToOverride = this.viewModel.goToOverride, this.goToLocationDisabled = this.viewModel.goToLocationEnabled, this.graphic = this.viewModel.graphic, this.icon = "compass-north-circle", this.positionFilterFunction = this.viewModel.positionFilterFunction, this.rotationDisabled = this.viewModel.rotationEnabled, this.scale = this.viewModel.scale, this.state = this.viewModel.state, this.tracking = this.viewModel.tracking, this.visualScale = "m", this.arcgisComplete = g(), this.arcgisError = g(), this.arcgisPropertyChange = b()("state"), this.arcgisReady = g();
16
126
  }
17
127
  static {
18
- this.properties = { view: 0, autoDestroyDisabled: 5, error: 0, geolocationOptions: 0, goToOverride: 0, goToLocationDisabled: 7, graphic: 0, icon: 1, label: 1, messageOverrides: 0, positionFilterFunction: 0, referenceElement: 1, rotationDisabled: 5, scale: 9, state: 0, tracking: 36, visualScale: 1 };
128
+ this.properties = { view: 0, autoDestroyDisabled: 5, currentPosition: 0, error: 0, geolocationOptions: 0, goToOverride: 0, goToLocationDisabled: 7, graphic: 0, icon: 1, label: 1, messageOverrides: 0, positionFilterFunction: 0, referenceElement: 1, rotationDisabled: 5, scale: 9, state: 0, tracking: 36, visualScale: 1 };
19
129
  }
20
130
  static {
21
- this.styles = T;
131
+ this.styles = D;
22
132
  }
23
133
  async destroy() {
24
134
  await this.manager.destroy();
@@ -29,6 +139,16 @@ class $ extends m {
29
139
  async stop() {
30
140
  this.viewModel.stop();
31
141
  }
142
+ loaded() {
143
+ this.manager.onLifecycle(() => [
144
+ p(() => this.viewModel.error, (t) => {
145
+ this.arcgisError.emit({ error: t });
146
+ }),
147
+ p(() => this.viewModel.currentPosition, (t) => {
148
+ this.arcgisComplete.emit({ position: t });
149
+ })
150
+ ]);
151
+ }
32
152
  _localizeError(t) {
33
153
  if (t instanceof GeolocationPositionError)
34
154
  return t.code === GeolocationPositionError.PERMISSION_DENIED ? this.messages?.permissionError : t.code === GeolocationPositionError.TIMEOUT ? this.messages?.timeoutError : this.messages?.positionUnavailable;
@@ -48,11 +168,11 @@ class $ extends m {
48
168
  }
49
169
  }
50
170
  render() {
51
- const { viewModel: t, messages: o, icon: c } = this, i = t?.state, l = i === "tracking", r = this._localizeError(this.viewModel?.error), s = (l ? o?.stopTracking : o?.startTracking) ?? "", n = i === "feature-unsupported", h = (i === "tracking" ? "pause" : void 0) ?? c ?? void 0;
52
- return e`<div class=${w(u("root", E.arcgisButton))}>${!n && e`<calcite-button .disabled=${i === "disabled"} .iconStart=${h} kind=neutral .label=${s} .loading=${i === "waiting"} @click=${this._toggleTracking} .scale=${this.visualScale} title=${s ?? M}></calcite-button>` || ""}${r ? e`<calcite-tooltip open overlay-positioning=fixed .referenceElement=${this.el}>${r}</calcite-tooltip>` : null}</div>`;
171
+ const { viewModel: t, messages: s, icon: c } = this, i = t?.state, h = i === "tracking", l = this._localizeError(this.viewModel?.error), n = (h ? s?.stopTracking : s?.startTracking) ?? "", u = i === "feature-unsupported", v = (i === "tracking" ? "pause" : void 0) ?? c ?? void 0;
172
+ return d`<div class=${w(T("root", P.arcgisButton))}>${!u && d`<calcite-button .disabled=${i === "disabled"} .iconStart=${v} kind=neutral .label=${n} .loading=${i === "waiting"} @click=${this._toggleTracking} .scale=${this.visualScale} title=${n ?? k}></calcite-button>` || ""}${l ? d`<calcite-tooltip open overlay-positioning=fixed .referenceElement=${this.el}>${l}</calcite-tooltip>` : null}</div>`;
53
173
  }
54
174
  }
55
- d("arcgis-track", $);
175
+ m("arcgis-track", G);
56
176
  export {
57
- $ as ArcgisTrack
177
+ G as ArcgisTrack
58
178
  };
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @param args - An object containing the position to be filtered.
3
+ * @since 5.0
4
+ */
5
+ export type PositionFilterFunction = (args: { position: FilterPosition; }) => boolean;
6
+
7
+ export type TrackViewModelState = "disabled" | "error" | "feature-unsupported" | "ready" | "tracking" | "waiting";
8
+
9
+ export interface FilterPosition {
10
+ timestamp: number;
11
+ coords: {
12
+ latitude: number;
13
+ longitude: number;
14
+ };
15
+ }