@arcgis/coding-components 4.31.0-next.3 → 4.31.0-next.30

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 (205) hide show
  1. package/README.md +22 -3
  2. package/dist/arcgis-coding-components/arcgis-coding-components.esm.js +2 -2
  3. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.ar.json +1 -1
  4. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.bg.json +1 -1
  5. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.bs.json +1 -1
  6. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.ca.json +6 -6
  7. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.cs.json +1 -1
  8. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.da.json +1 -1
  9. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.de.json +1 -1
  10. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.el.json +1 -1
  11. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.es.json +1 -1
  12. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.et.json +1 -1
  13. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.fi.json +1 -1
  14. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.fr.json +1 -1
  15. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.he.json +1 -1
  16. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.hr.json +1 -1
  17. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.id.json +1 -1
  18. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.it.json +1 -1
  19. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.ko.json +1 -1
  20. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.nb.json +1 -1
  21. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.nl.json +1 -1
  22. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.pl.json +1 -1
  23. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.pt-BR.json +1 -1
  24. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.pt-PT.json +1 -1
  25. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.ru.json +1 -1
  26. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.sk.json +1 -1
  27. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.sl.json +1 -1
  28. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.sr.json +1 -1
  29. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.sv.json +1 -1
  30. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.th.json +1 -1
  31. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.tr.json +1 -1
  32. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.uk.json +5 -5
  33. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.vi.json +1 -1
  34. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.zh-CN.json +1 -1
  35. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.zh-HK.json +1 -1
  36. package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.zh-TW.json +1 -1
  37. package/dist/arcgis-coding-components/assets/arcade-results/t9n/arcade-results.t9n.ca.json +2 -2
  38. package/dist/arcgis-coding-components/assets/arcade-results/t9n/arcade-results.t9n.de.json +1 -1
  39. package/dist/arcgis-coding-components/assets/arcade-results/t9n/arcade-results.t9n.he.json +1 -1
  40. package/dist/arcgis-coding-components/assets/arcade-variables/t9n/arcade-variables.t9n.ca.json +1 -1
  41. package/dist/arcgis-coding-components/assets/arcade-variables/t9n/arcade-variables.t9n.it.json +1 -1
  42. package/dist/arcgis-coding-components/assets/code-editor/sql-expr.worker.js +447 -7
  43. package/dist/arcgis-coding-components/assets/language-api-panel/t9n/language-api-panel.t9n.ca.json +1 -1
  44. package/dist/arcgis-coding-components/index.esm.js +2 -2
  45. package/dist/arcgis-coding-components/{p-42c8b545.js → p-1cec2132.js} +3 -3
  46. package/dist/arcgis-coding-components/{p-3ca5ba95.entry.js → p-2186676a.entry.js} +2 -2
  47. package/dist/arcgis-coding-components/{p-86106a9a.js → p-26f5a06d.js} +1 -1
  48. package/dist/arcgis-coding-components/p-3645c71d.entry.js +6 -0
  49. package/dist/arcgis-coding-components/{p-8b4298d5.js → p-4ce2a213.js} +2 -2
  50. package/dist/arcgis-coding-components/{p-111ba641.js → p-57bde3ee.js} +2 -2
  51. package/dist/arcgis-coding-components/p-57dbf777.js +7 -0
  52. package/dist/arcgis-coding-components/{p-9132bc9c.entry.js → p-639adfca.entry.js} +2 -2
  53. package/dist/arcgis-coding-components/p-71d639a6.js +6 -0
  54. package/dist/arcgis-coding-components/{p-6554a853.js → p-72266079.js} +1 -1
  55. package/dist/arcgis-coding-components/p-7e2ae261.js +6 -0
  56. package/dist/arcgis-coding-components/{p-5eb82abf.js → p-8897f806.js} +2 -2
  57. package/dist/arcgis-coding-components/p-91bb956b.js +6 -0
  58. package/dist/arcgis-coding-components/p-9b2002c3.js +6 -0
  59. package/dist/arcgis-coding-components/{p-7c6b3d40.js → p-9c411f13.js} +2 -2
  60. package/dist/arcgis-coding-components/{p-c4a5150e.js → p-bd309794.js} +3 -3
  61. package/dist/arcgis-coding-components/{p-4986aaf2.js → p-cc0edd81.js} +3 -3
  62. package/dist/arcgis-coding-components/{p-93d0e0cc.js → p-e295aee1.js} +12 -12
  63. package/dist/arcgis-coding-components/p-fe4ee070.js +6 -0
  64. package/dist/cjs/{app-globals-92c5b499.js → app-globals-e98febdb.js} +1 -1
  65. package/dist/cjs/arcade-defaults-c6ecbcbe.js +349 -0
  66. package/dist/cjs/arcade-language-features-eeb1f261.js +274 -0
  67. package/dist/cjs/{arcade-mode-dfd66b4b.js → arcade-mode-a2d05415.js} +6 -266
  68. package/dist/cjs/arcgis-arcade-editor_6.cjs.entry.js +20 -26
  69. package/dist/cjs/arcgis-coding-components.cjs.js +5 -5
  70. package/dist/cjs/arcgis-sql-expression-editor.cjs.entry.js +4 -4
  71. package/dist/cjs/arcgis-sql-expression-fields.cjs.entry.js +4 -4
  72. package/dist/cjs/{css-9b0053c3.js → css-1b37a5a3.js} +1 -1
  73. package/dist/cjs/{cssMode-62e53008.js → cssMode-e08a9e80.js} +2 -3
  74. package/dist/cjs/{html-3036e89e.js → html-b55754c8.js} +2 -3
  75. package/dist/cjs/{htmlMode-c37eee42.js → htmlMode-e335e2e0.js} +2 -3
  76. package/dist/cjs/{index-be6b2520.js → index-1e6c6daf.js} +43 -15
  77. package/dist/cjs/index.cjs.js +4 -4
  78. package/dist/cjs/{javascript-7276c023.js → javascript-5d6e0e2f.js} +3 -4
  79. package/dist/cjs/{jsonMode-baa295f0.js → jsonMode-5aeae11c.js} +2 -3
  80. package/dist/cjs/{language-defaults-base-5817af52.js → language-defaults-base-b33c98c5.js} +842 -1062
  81. package/dist/cjs/loader.cjs.js +4 -4
  82. package/dist/cjs/{sql-expr-defaults-746bbc5f.js → sql-expr-defaults-2fcbfae4.js} +101 -39
  83. package/dist/cjs/sql-expr-mode-72880fff.js +1171 -0
  84. package/dist/cjs/{tsMode-36398912.js → tsMode-5559948f.js} +2 -3
  85. package/dist/cjs/{typescript-608a420b.js → typescript-6dfdd308.js} +2 -3
  86. package/dist/components/arcade-defaults.js +238 -4
  87. package/dist/components/arcade-language-features.js +271 -0
  88. package/dist/components/arcade-mode.js +4 -264
  89. package/dist/components/arcade-results.js +3 -3
  90. package/dist/components/arcade-suggestions.js +2 -2
  91. package/dist/components/arcade-variables.js +2 -2
  92. package/dist/components/arcgis-arcade-editor.js +7 -6
  93. package/dist/components/arcgis-arcade-results.js +1 -1
  94. package/dist/components/arcgis-arcade-suggestions.js +1 -1
  95. package/dist/components/arcgis-arcade-variables.js +1 -1
  96. package/dist/components/arcgis-assets.d.ts +1 -1
  97. package/dist/components/arcgis-assets.js +1 -1
  98. package/dist/components/arcgis-code-editor.js +1 -1
  99. package/dist/components/arcgis-language-api-panel.js +1 -1
  100. package/dist/components/arcgis-sql-expression-editor.js +2 -2
  101. package/dist/components/arcgis-sql-expression-fields.js +1 -1
  102. package/dist/components/{chunk-6TARY3NN.js → chunk-EOMOY2EF.js} +12 -17
  103. package/dist/components/code-editor.js +16 -23
  104. package/dist/components/fields.js +22 -4
  105. package/dist/components/index.d.ts +18 -3
  106. package/dist/components/index.js +1 -1
  107. package/dist/components/index2.js +2 -2
  108. package/dist/components/language-api-panel.js +2 -2
  109. package/dist/components/language-defaults-base.js +81 -323
  110. package/dist/components/markdown.js +1 -1
  111. package/dist/components/sql-expr-defaults.js +89 -24
  112. package/dist/components/sql-expr-mode.js +1009 -24971
  113. package/dist/components/sql-expression-fields.js +2 -2
  114. package/dist/components/useT9n.js +2 -2
  115. package/dist/components/utilities.js +1 -1
  116. package/dist/esm/{app-globals-5e178541.js → app-globals-906d2920.js} +1 -1
  117. package/dist/esm/arcade-defaults-01c1778e.js +344 -0
  118. package/dist/esm/arcade-language-features-5d86df55.js +269 -0
  119. package/dist/esm/{arcade-mode-02336ce9.js → arcade-mode-ffa50b73.js} +3 -263
  120. package/dist/esm/arcgis-arcade-editor_6.entry.js +21 -27
  121. package/dist/esm/arcgis-coding-components.js +6 -6
  122. package/dist/esm/arcgis-sql-expression-editor.entry.js +4 -4
  123. package/dist/esm/arcgis-sql-expression-fields.entry.js +4 -4
  124. package/dist/esm/{css-e79f1ed1.js → css-e6d12b19.js} +1 -1
  125. package/dist/esm/{cssMode-cd007d02.js → cssMode-eda5bf61.js} +2 -3
  126. package/dist/esm/{html-d079d00d.js → html-b5f697d7.js} +2 -3
  127. package/dist/esm/{htmlMode-ff14e035.js → htmlMode-1b54015e.js} +2 -3
  128. package/dist/esm/{index-88fc341d.js → index-0ec9c3f1.js} +43 -15
  129. package/dist/esm/index.js +4 -4
  130. package/dist/esm/{javascript-69f7c282.js → javascript-f1c7843a.js} +3 -4
  131. package/dist/esm/{jsonMode-18ddadde.js → jsonMode-2277640b.js} +2 -3
  132. package/dist/esm/{language-defaults-base-6687d11a.js → language-defaults-base-b508c08f.js} +837 -1062
  133. package/dist/esm/loader.js +5 -5
  134. package/dist/esm/{sql-expr-defaults-2cdfe08a.js → sql-expr-defaults-715f6bad.js} +100 -40
  135. package/dist/esm/sql-expr-mode-3cd5df90.js +1167 -0
  136. package/dist/esm/{tsMode-c2e5d33a.js → tsMode-075abf4a.js} +2 -3
  137. package/dist/esm/{typescript-a0fbebf0.js → typescript-22cfacaa.js} +2 -3
  138. package/dist/loader/cdn.js +2 -3
  139. package/dist/loader/index.cjs.js +2 -3
  140. package/dist/loader/index.es2017.js +2 -3
  141. package/dist/loader/index.js +2 -3
  142. package/dist/types/components/arcade-editor/arcade-editor.d.ts +13 -3
  143. package/dist/types/components/arcade-results/arcade-results.d.ts +1 -1
  144. package/dist/types/components/arcade-suggestions/arcade-suggestions.d.ts +1 -1
  145. package/dist/types/components/arcade-variables/arcade-variables.d.ts +1 -1
  146. package/dist/types/components/code-editor/code-editor.d.ts +14 -4
  147. package/dist/types/components/language-api-panel/language-api-panel.d.ts +1 -1
  148. package/dist/types/components.d.ts +13 -13
  149. package/dist/types/data/actions-runner-1/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/stories/internal/arcade-editor/arcade-editor.stories.d.ts +8 -1
  150. package/dist/types/data/actions-runner-1/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/stories/internal/arcade-editor/editorContext.d.ts +5 -1
  151. package/dist/types/stencil-public-runtime.d.ts +3 -8
  152. package/dist/types/utils/arcade-monaco/arcade-language-features.d.ts +1 -0
  153. package/dist/types/utils/arcade-monaco/arcade-profile-strategy.d.ts +9 -0
  154. package/dist/types/utils/fields.d.ts +2 -2
  155. package/dist/types/utils/profile/editor-profile.d.ts +7 -6
  156. package/dist/types/utils/profile/types.d.ts +53 -65
  157. package/dist/types/utils/profile/utils.d.ts +9 -8
  158. package/dist/types/utils/sql-expr-monaco/sql-expr-completion.d.ts +3 -2
  159. package/dist/types/utils/sql-expr-monaco/sql-expr-constants.d.ts +45 -0
  160. package/dist/types/utils/sql-expr-monaco/sql-expr-contribution.d.ts +1 -11
  161. package/dist/types/utils/sql-expr-monaco/sql-expr-defaults.d.ts +0 -1
  162. package/dist/types/utils/sql-expr-monaco/sql-expr-language-features.d.ts +19 -520
  163. package/dist/types/utils/sql-expr-monaco/sql-expr-mode.d.ts +34 -1
  164. package/dist/types/utils/sql-expr-monaco/sql-expr-service-accessors.d.ts +19 -0
  165. package/dist/types/utils/sql-expr-monaco/sql-expr-validation-diagnostic-adapter.d.ts +0 -7
  166. package/dist/types/utils/sql-expr-monaco/sql-expr-validation-utils.d.ts +75 -77
  167. package/dist/types/utils/sql-expr-monaco/sql-expr-validation.d.ts +5 -6
  168. package/dist/types/utils/sql-expr-monaco/sql-expr-worker-manager.d.ts +2 -0
  169. package/dist/types/utils/sql-expr-monaco/sql-expr.worker.d.ts +9 -6
  170. package/dist/types/utils/sql-expr-monaco/sql-expression-profile-strategy.d.ts +13 -0
  171. package/dist/types/utils/sql-expr-monaco/types.d.ts +6 -12
  172. package/package.json +19 -19
  173. package/dist/arcgis-coding-components/p-0105cc95.js +0 -6
  174. package/dist/arcgis-coding-components/p-5e26a360.js +0 -6
  175. package/dist/arcgis-coding-components/p-9c7e0089.js +0 -7
  176. package/dist/arcgis-coding-components/p-b82e98f0.js +0 -6
  177. package/dist/arcgis-coding-components/p-d353f1ba.entry.js +0 -6
  178. package/dist/arcgis-coding-components/p-fe6ccfe0.js +0 -6
  179. package/dist/cjs/arcade-defaults-34e82ff5.js +0 -116
  180. package/dist/cjs/sql-expr-mode-a9f1b697.js +0 -25135
  181. package/dist/esm/arcade-defaults-6dac6b30.js +0 -111
  182. package/dist/esm/polyfills/core-js.js +0 -11
  183. package/dist/esm/polyfills/dom.js +0 -79
  184. package/dist/esm/polyfills/es5-html-element.js +0 -1
  185. package/dist/esm/polyfills/index.js +0 -34
  186. package/dist/esm/polyfills/system.js +0 -6
  187. package/dist/esm/sql-expr-mode-f10e5a43.js +0 -25132
  188. package/dist/types/utils/profile/predefined-profile.d.ts +0 -4
  189. package/dist/types/utils/sql-expr-monaco/DependentFiles/DateOnly.d.ts +0 -41
  190. package/dist/types/utils/sql-expr-monaco/DependentFiles/SqlInterval.d.ts +0 -16
  191. package/dist/types/utils/sql-expr-monaco/DependentFiles/SqlTimestampOffset.d.ts +0 -26
  192. package/dist/types/utils/sql-expr-monaco/DependentFiles/TimeOnly.d.ts +0 -37
  193. package/dist/types/utils/sql-expr-monaco/DependentFiles/UnknownTimeZone.d.ts +0 -11
  194. package/dist/types/utils/sql-expr-monaco/DependentFiles/WhereGrammar.d.ts +0 -122
  195. package/dist/types/utils/sql-expr-monaco/DependentFiles/sqlCompareUtils.d.ts +0 -5
  196. package/dist/types/utils/sql-expr-monaco/DependentFiles/sqlDateParsingUtils.d.ts +0 -18
  197. package/dist/types/utils/sql-expr-monaco/DependentFiles/sqlUtils.d.ts +0 -6
  198. package/dist/types/utils/sql-expr-monaco/DependentFiles/standardizedFunctions.d.ts +0 -156
  199. package/dist/types/utils/sql-expr-monaco/DependentFiles/support.d.ts +0 -150
  200. package/dist/types/utils/sql-expr-monaco/PeggyGrammar/sql92grammar.d.ts +0 -1397
  201. package/dist/types/utils/sql-expr-monaco/libraries/date/properties/index.d.ts +0 -59
  202. package/dist/types/utils/sql-expr-monaco/libraries/numeric/properties/index.d.ts +0 -295
  203. package/dist/types/utils/sql-expr-monaco/libraries/string/properties/index.d.ts +0 -135
  204. package/dist/types/utils/sql-expr-monaco/sql-expr-validation-adapter.d.ts +0 -3
  205. package/dist/types/utils/sql-expr-profile/predefined-profile.d.ts +0 -2
@@ -1,12 +1,10 @@
1
1
  /*!
2
2
  * All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  * See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
- * v4.31.0-next.3
4
+ * v4.31.0-next.30
5
5
  */
6
6
  'use strict';
7
7
 
8
- const index = require('./index-be6b2520.js');
9
-
10
8
  function _interopNamespace(e) {
11
9
  if (e && e.__esModule) return e;
12
10
  var n = Object.create(null);
@@ -120616,7 +120614,7 @@ registerLanguage({
120616
120614
  mimetypes: ["text/css"],
120617
120615
  loader: () => {
120618
120616
  {
120619
- return Promise.resolve().then(function () { return require('./css-9b0053c3.js'); });
120617
+ return Promise.resolve().then(function () { return require('./css-1b37a5a3.js'); });
120620
120618
  }
120621
120619
  }
120622
120620
  });
@@ -120634,7 +120632,7 @@ registerLanguage({
120634
120632
  mimetypes: ["text/html", "text/x-jshtm", "text/template", "text/ng-template"],
120635
120633
  loader: () => {
120636
120634
  {
120637
- return Promise.resolve().then(function () { return require('./html-3036e89e.js'); });
120635
+ return Promise.resolve().then(function () { return require('./html-b55754c8.js'); });
120638
120636
  }
120639
120637
  }
120640
120638
  });
@@ -120654,7 +120652,7 @@ registerLanguage({
120654
120652
  mimetypes: ["text/javascript"],
120655
120653
  loader: () => {
120656
120654
  {
120657
- return Promise.resolve().then(function () { return require('./javascript-7276c023.js'); });
120655
+ return Promise.resolve().then(function () { return require('./javascript-5d6e0e2f.js'); });
120658
120656
  }
120659
120657
  }
120660
120658
  });
@@ -120672,7 +120670,7 @@ registerLanguage({
120672
120670
  mimetypes: ["text/typescript"],
120673
120671
  loader: () => {
120674
120672
  {
120675
- return Promise.resolve().then(function () { return require('./typescript-608a420b.js'); });
120673
+ return Promise.resolve().then(function () { return require('./typescript-6dfdd308.js'); });
120676
120674
  }
120677
120675
  }
120678
120676
  });
@@ -120793,7 +120791,7 @@ var lessDefaults = new LanguageServiceDefaultsImpl$3("less", optionsDefault$1, m
120793
120791
  monaco_editor_core_exports$3.languages.css = { cssDefaults, lessDefaults, scssDefaults };
120794
120792
  function getMode$3() {
120795
120793
  {
120796
- return Promise.resolve().then(function () { return require('./cssMode-62e53008.js'); });
120794
+ return Promise.resolve().then(function () { return require('./cssMode-e08a9e80.js'); });
120797
120795
  }
120798
120796
  }
120799
120797
  monaco_editor_core_exports$3.languages.onLanguage("less", () => {
@@ -120918,7 +120916,7 @@ monaco_editor_core_exports$2.languages.html = {
120918
120916
  };
120919
120917
  function getMode$2() {
120920
120918
  {
120921
- return Promise.resolve().then(function () { return require('./htmlMode-c37eee42.js'); });
120919
+ return Promise.resolve().then(function () { return require('./htmlMode-e335e2e0.js'); });
120922
120920
  }
120923
120921
  }
120924
120922
  function registerHTMLLanguageService(languageId, options = optionsDefault, modeConfiguration = getConfigurationDefault(languageId)) {
@@ -121020,7 +121018,7 @@ var jsonDefaults = new LanguageServiceDefaultsImpl$1("json", diagnosticDefault,
121020
121018
  monaco_editor_core_exports$1.languages.json = { jsonDefaults };
121021
121019
  function getMode$1() {
121022
121020
  {
121023
- return Promise.resolve().then(function () { return require('./jsonMode-baa295f0.js'); });
121021
+ return Promise.resolve().then(function () { return require('./jsonMode-5aeae11c.js'); });
121024
121022
  }
121025
121023
  }
121026
121024
  monaco_editor_core_exports$1.languages.register({
@@ -121289,7 +121287,7 @@ monaco_editor_core_exports.languages.typescript = {
121289
121287
  };
121290
121288
  function getMode() {
121291
121289
  {
121292
- return Promise.resolve().then(function () { return require('./tsMode-36398912.js'); });
121290
+ return Promise.resolve().then(function () { return require('./tsMode-5559948f.js'); });
121293
121291
  }
121294
121292
  }
121295
121293
  monaco_editor_core_exports.languages.onLanguage("typescript", () => {
@@ -166736,6 +166734,778 @@ class ToggleHighContrast extends EditorAction {
166736
166734
  }
166737
166735
  registerEditorAction(ToggleHighContrast);
166738
166736
 
166737
+ // src/index.ts
166738
+ var isAMD = typeof window !== "undefined" && "$arcgis" in window && typeof window.$arcgis === "object" && "import" in window.$arcgis && !("forceESM" in window.$arcgis);
166739
+ function isDefaultModule(module) {
166740
+ return module.default !== void 0;
166741
+ }
166742
+ async function importLayersFeatureLayer() {
166743
+ if (isAMD) {
166744
+ return await window.$arcgis.import("esri/layers/FeatureLayer");
166745
+ }
166746
+ const module = await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('@arcgis/core/layers/FeatureLayer.js')); });
166747
+ return isDefaultModule(module) ? module.default : module;
166748
+ }
166749
+ async function newLayersFeatureLayer(properties) {
166750
+ const ModConstructor = await importLayersFeatureLayer();
166751
+ return new ModConstructor(properties);
166752
+ }
166753
+ async function importLayersSupportFieldsIndex() {
166754
+ if (isAMD) {
166755
+ return await window.$arcgis.import("esri/layers/support/FieldsIndex");
166756
+ }
166757
+ const module = await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('@arcgis/core/layers/support/FieldsIndex.js')); });
166758
+ return isDefaultModule(module) ? module.default : module;
166759
+ }
166760
+ async function newLayersSupportFieldsIndex(properties) {
166761
+ const ModConstructor = await importLayersSupportFieldsIndex();
166762
+ return new ModConstructor(properties);
166763
+ }
166764
+ async function importPortalPortalItem() {
166765
+ if (isAMD) {
166766
+ return await window.$arcgis.import("esri/portal/PortalItem");
166767
+ }
166768
+ const module = await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('@arcgis/core/portal/PortalItem.js')); });
166769
+ return isDefaultModule(module) ? module.default : module;
166770
+ }
166771
+ async function newPortalPortalItem(properties) {
166772
+ const ModConstructor = await importPortalPortalItem();
166773
+ return new ModConstructor(properties);
166774
+ }
166775
+ async function importWebMap() {
166776
+ if (isAMD) {
166777
+ return await window.$arcgis.import("esri/WebMap");
166778
+ }
166779
+ const module = await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('@arcgis/core/WebMap.js')); });
166780
+ return isDefaultModule(module) ? module.default : module;
166781
+ }
166782
+ async function newWebMap(properties) {
166783
+ const ModConstructor = await importWebMap();
166784
+ return new ModConstructor(properties);
166785
+ }
166786
+ async function importWebScene() {
166787
+ if (isAMD) {
166788
+ return await window.$arcgis.import("esri/WebScene");
166789
+ }
166790
+ const module = await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('@arcgis/core/WebScene.js')); });
166791
+ return isDefaultModule(module) ? module.default : module;
166792
+ }
166793
+ async function newWebScene(properties) {
166794
+ const ModConstructor = await importWebScene();
166795
+ return new ModConstructor(properties);
166796
+ }
166797
+ async function importArcade() {
166798
+ if (isAMD) {
166799
+ return await window.$arcgis.import("esri/arcade");
166800
+ }
166801
+ const module = await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('@arcgis/core/arcade.js')); });
166802
+ return isDefaultModule(module) ? module.default : module;
166803
+ }
166804
+ async function importCoreSql() {
166805
+ if (isAMD) {
166806
+ return await window.$arcgis.import("esri/core/sql");
166807
+ }
166808
+ const module = await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('@arcgis/core/core/sql.js')); });
166809
+ return isDefaultModule(module) ? module.default : module;
166810
+ }
166811
+ async function importRequest() {
166812
+ if (isAMD) {
166813
+ return await window.$arcgis.import("esri/request");
166814
+ }
166815
+ const module = await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('@arcgis/core/request.js')); });
166816
+ return isDefaultModule(module) ? module.default : module;
166817
+ }
166818
+
166819
+ //#region Type Guards
166820
+ function isFeatureLayerLikeInstance(item) {
166821
+ return (!!item &&
166822
+ typeof item === "object" &&
166823
+ "declaredClass" in item &&
166824
+ typeof item.declaredClass === "string" &&
166825
+ item.declaredClass.startsWith("esri.layers.") &&
166826
+ isFieldsDefinition(item) &&
166827
+ "queryFeatures" in item &&
166828
+ typeof item.queryFeatures === "function");
166829
+ }
166830
+ function isGroupLayerCapable(item) {
166831
+ return (!!item &&
166832
+ typeof item === "object" &&
166833
+ "allLayers" in item &&
166834
+ "allTables" in item &&
166835
+ typeof item.allLayers === "object" &&
166836
+ typeof item.allTables === "object");
166837
+ }
166838
+ function isMapInstance(item) {
166839
+ return (!!item &&
166840
+ typeof item === "object" &&
166841
+ "declaredClass" in item &&
166842
+ typeof item.declaredClass === "string" &&
166843
+ (item.declaredClass === "esri.Map" ||
166844
+ item.declaredClass === "esri.WebMap" ||
166845
+ item.declaredClass === "esri.WebScene"));
166846
+ }
166847
+ function isLoadAllCapable(item) {
166848
+ return !!item && typeof item === "object" && "loadAll" in item && typeof item.loadAll === "function";
166849
+ }
166850
+ function isPortalItemDefinition(item) {
166851
+ return !!item && typeof item === "object" && "portalItem" in item && item.portalItem != null;
166852
+ }
166853
+ function isFeatureLayerItemDefinition(item) {
166854
+ return !!item && typeof item === "object" && "portalItem" in item && item.portalItem != null;
166855
+ }
166856
+ function isFieldsDefinition(item) {
166857
+ return !!item && typeof item === "object" && "fields" in item && Array.isArray(item.fields);
166858
+ }
166859
+ function isUrlDefinition(item) {
166860
+ return !!item && typeof item === "object" && "url" in item && typeof item.url === "string";
166861
+ }
166862
+ function isSupportedServiceUrlDefinition(item) {
166863
+ return isUrlDefinition(item) && /\/(?:featureserver|mapserver)(?:\/|$)/iu.test(item.url);
166864
+ }
166865
+ function isFeatureDefinition(item) {
166866
+ return isUrlDefinition(item) || isFieldsDefinition(item) || isFeatureLayerItemDefinition(item);
166867
+ }
166868
+ function isFeatureSetDefinition(item) {
166869
+ return isUrlDefinition(item) || isFieldsDefinition(item) || isFeatureLayerItemDefinition(item);
166870
+ }
166871
+ function isFeatureSetCollectionDefinition(item) {
166872
+ return isPortalItemDefinition(item) || isMapInstance(item) || isSupportedServiceUrlDefinition(item);
166873
+ }
166874
+ function isSubtypeInstance(item) {
166875
+ return (!!item &&
166876
+ typeof item === "object" &&
166877
+ "declaredClass" in item &&
166878
+ item.declaredClass === "esri.layers.support.Subtype");
166879
+ }
166880
+ function isCodedValueDomainInstance(item) {
166881
+ return (!!item &&
166882
+ typeof item === "object" &&
166883
+ "declaredClass" in item &&
166884
+ item.declaredClass === "esri.layers.support.CodedValueDomain");
166885
+ }
166886
+ function isInheritedDomainInstance(item) {
166887
+ return (!!item &&
166888
+ typeof item === "object" &&
166889
+ "declaredClass" in item &&
166890
+ item.declaredClass === "esri.layers.support.InheritedDomain");
166891
+ }
166892
+ function isPredefinedProfile(item) {
166893
+ return (!!item &&
166894
+ typeof item === "object" &&
166895
+ "id" in item &&
166896
+ typeof item.id === "string" &&
166897
+ "definitions" in item &&
166898
+ typeof item.definitions === "object" &&
166899
+ !Array.isArray(item.definitions));
166900
+ }
166901
+ function isTitleCapableSource(item) {
166902
+ return !!item && typeof item === "object" && "title" in item && typeof item.title === "string";
166903
+ }
166904
+ function isUrlCapableSource(item) {
166905
+ return !!item && typeof item === "object" && "url" in item && typeof item.url === "string";
166906
+ }
166907
+ function isLayerIdCapableSource(item) {
166908
+ return !!item && typeof item === "object" && "layerId" in item && typeof item.layerId === "number";
166909
+ }
166910
+ function isFeatureTypesCapableLayer(item) {
166911
+ return !!item && typeof item === "object" && "typeIdField" in item && "types" in item;
166912
+ }
166913
+ function isDomainsCapableLayer(item) {
166914
+ return !!item && typeof item === "object" && "getFieldDomain" in item && typeof item.getFieldDomain === "function";
166915
+ }
166916
+ function isSubtypeFieldCapableLayer(item) {
166917
+ return !!item && typeof item === "object" && "subtypeField" in item;
166918
+ }
166919
+ function isSubtypesCapableLayer(item) {
166920
+ return isSubtypeFieldCapableLayer(item) && "subtypes" in item;
166921
+ }
166922
+ function isPortalItemCapable(item) {
166923
+ return !!item && typeof item === "object" && "portalItem" in item;
166924
+ }
166925
+ function isRelationshipsCapableLayer(item) {
166926
+ return (isLayerIdCapableSource(item) &&
166927
+ "relationships" in item &&
166928
+ "url" in item &&
166929
+ Array.isArray(item.relationships) &&
166930
+ typeof item.url === "string");
166931
+ }
166932
+ function isTableCapableLayer(item) {
166933
+ return !!item && typeof item === "object" && "isTable" in item && typeof item.isTable === "boolean";
166934
+ }
166935
+ function isLoadableSource(item) {
166936
+ return !!item && typeof item === "object" && "load" in item && typeof item.load === "function";
166937
+ }
166938
+ //#endregion
166939
+ //#region Service Metadata
166940
+ async function supportedSourceFromDefinition(definition) {
166941
+ if (!definition) {
166942
+ return null;
166943
+ }
166944
+ let source = null;
166945
+ if (isFieldsDefinition(definition)) {
166946
+ source = definition;
166947
+ }
166948
+ else {
166949
+ source = await newLayersFeatureLayer(definition);
166950
+ }
166951
+ if (isLoadableSource(source)) {
166952
+ await source.load();
166953
+ }
166954
+ return source;
166955
+ }
166956
+ async function serviceMetaData(url) {
166957
+ url += "/layers";
166958
+ const request = await importRequest();
166959
+ const response = await request(url, { responseType: "json", query: { f: "json" } });
166960
+ const queryCapability = url.endsWith("MapServer/layers") ? "data" : "query";
166961
+ const layers = getSupportedLayerInfos(response.data?.layers, queryCapability);
166962
+ const tables = getSupportedLayerInfos(response.data?.tables, queryCapability);
166963
+ return { layers, tables };
166964
+ }
166965
+ function getSupportedLayerInfos(layers, queryCapability) {
166966
+ if (!layers) {
166967
+ return [];
166968
+ }
166969
+ return layers.filter((layer) => {
166970
+ switch (layer.type) {
166971
+ case "Feature Layer":
166972
+ case "Oriented Imagery Layer":
166973
+ case "Catalog Layer":
166974
+ case "Table": {
166975
+ const capabilities = layer.capabilities
166976
+ ? layer.capabilities
166977
+ .toLowerCase()
166978
+ .split(",")
166979
+ .map((value) => value.trim())
166980
+ : [];
166981
+ return capabilities.includes(queryCapability);
166982
+ }
166983
+ default:
166984
+ return false;
166985
+ }
166986
+ });
166987
+ }
166988
+ //#endregion
166989
+
166990
+ // src/array-utils.ts
166991
+
166992
+ // src/deferred.ts
166993
+ var Deferred = class {
166994
+ /**
166995
+ * Resolves the promise.
166996
+ * @param value The value to resolve the promise with.
166997
+ */
166998
+ resolve(_value) {
166999
+ }
167000
+ /**
167001
+ * Rejects the promise.
167002
+ */
167003
+ reject(_error) {
167004
+ }
167005
+ /**
167006
+ * Creates a new deferred promise.
167007
+ */
167008
+ constructor() {
167009
+ this.promise = new Promise((resolve, reject) => {
167010
+ this.resolve = resolve;
167011
+ this.reject = reject;
167012
+ });
167013
+ }
167014
+ };
167015
+
167016
+ // src/dom.ts
167017
+ function inTargetElement(element, targetElement) {
167018
+ let currentElement = element;
167019
+ while (currentElement) {
167020
+ if (currentElement === targetElement) {
167021
+ return true;
167022
+ }
167023
+ if (!currentElement.parentNode) {
167024
+ return false;
167025
+ }
167026
+ if (currentElement.parentNode instanceof ShadowRoot) {
167027
+ currentElement = currentElement.parentNode.host;
167028
+ } else {
167029
+ currentElement = currentElement.parentNode;
167030
+ }
167031
+ }
167032
+ return false;
167033
+ }
167034
+ function observeAncestorsMutation(element, attributeFilter, callback) {
167035
+ const { subscribe } = observe(attributeFilter);
167036
+ return subscribe((mutations) => {
167037
+ const matched = mutations.some((mutation) => inTargetElement(element, mutation.target));
167038
+ if (matched) {
167039
+ callback();
167040
+ }
167041
+ });
167042
+ }
167043
+ var observers = {};
167044
+ function observe(attributeFilter) {
167045
+ const attributes = attributeFilter.join(",");
167046
+ const previousObserver = observers[attributes];
167047
+ if (previousObserver !== void 0) {
167048
+ return previousObserver;
167049
+ }
167050
+ const subscribers = /* @__PURE__ */ new Set();
167051
+ const mutationObserver = new MutationObserver((mutations) => subscribers.forEach((callback) => callback(mutations)));
167052
+ mutationObserver.observe(document.documentElement, {
167053
+ attributes: true,
167054
+ attributeFilter,
167055
+ subtree: true
167056
+ });
167057
+ const observer = {
167058
+ subscribe(callback) {
167059
+ subscribers.add(callback);
167060
+ return {
167061
+ remove: () => {
167062
+ subscribers.delete(callback);
167063
+ if (subscribers.size === 0) {
167064
+ mutationObserver.disconnect();
167065
+ observers[attributes] = void 0;
167066
+ }
167067
+ }
167068
+ };
167069
+ }
167070
+ };
167071
+ observers[attributes] = observer;
167072
+ return observer;
167073
+ }
167074
+ function closestElement(base, selector) {
167075
+ let currentElement = base;
167076
+ while (currentElement) {
167077
+ const element = currentElement.closest(selector);
167078
+ if (element) {
167079
+ return element;
167080
+ }
167081
+ const rootElement = currentElement.getRootNode();
167082
+ if (rootElement === document) {
167083
+ return null;
167084
+ }
167085
+ currentElement = rootElement.host;
167086
+ }
167087
+ return null;
167088
+ }
167089
+ function getElementTheme(base) {
167090
+ const themeElt = closestElement(base, ":is(.calcite-mode-light, .calcite-mode-dark)");
167091
+ return themeElt && themeElt.classList.contains("calcite-mode-dark") ? "dark" : "light";
167092
+ }
167093
+ function getElementAttribute(el, prop, fallbackValue) {
167094
+ const closest = closestElement(el, `[${prop}]`);
167095
+ return closest?.getAttribute(prop) ?? fallbackValue;
167096
+ }
167097
+ function isElement(ref) {
167098
+ return ref.nodeType === Node.ELEMENT_NODE;
167099
+ }
167100
+ function isHTMLWithSetFocus(ref) {
167101
+ return "setFocus" in ref && typeof ref.setFocus === "function";
167102
+ }
167103
+ function setFocus(ref, selector = "") {
167104
+ if (!isElement(ref)) {
167105
+ return false;
167106
+ }
167107
+ if (ref.matches(selector)) {
167108
+ if (isHTMLWithSetFocus(ref)) {
167109
+ setTimeout(() => ref.setFocus(), 0);
167110
+ }
167111
+ return true;
167112
+ }
167113
+ for (const child of ref.children) {
167114
+ if (setFocus(child, selector)) {
167115
+ return true;
167116
+ }
167117
+ }
167118
+ const shadowRoot = ref.shadowRoot;
167119
+ if (shadowRoot) {
167120
+ for (const child of shadowRoot.children) {
167121
+ if (setFocus(child, selector)) {
167122
+ return true;
167123
+ }
167124
+ }
167125
+ }
167126
+ return false;
167127
+ }
167128
+ function setFocusOnElement(ref, selector) {
167129
+ if (!ref?.shadowRoot) {
167130
+ return;
167131
+ }
167132
+ if (ref.hasAttribute("hydrated") || ref.hasAttribute("calcite-hydrated")) {
167133
+ setFocus(ref, selector);
167134
+ return;
167135
+ }
167136
+ const mutationObserver = new MutationObserver(() => {
167137
+ mutationObserver.disconnect();
167138
+ setFocus(ref, selector);
167139
+ });
167140
+ mutationObserver.observe(ref, {
167141
+ attributes: true,
167142
+ attributeFilter: ["hydrated", "calcite-hydrated"]
167143
+ });
167144
+ }
167145
+
167146
+ // src/errors.ts
167147
+ function safeCall(callback, thisContext, ...rest) {
167148
+ try {
167149
+ return callback?.call(thisContext, ...rest);
167150
+ } catch (error) {
167151
+ console.error(error, callback);
167152
+ }
167153
+ return void 0;
167154
+ }
167155
+ async function safeAsyncCall(callback, thisContext, ...rest) {
167156
+ try {
167157
+ const result = callback?.call(thisContext, ...rest);
167158
+ return result instanceof Promise ? await result : result;
167159
+ } catch (error) {
167160
+ console.error(error, callback);
167161
+ }
167162
+ return void 0;
167163
+ }
167164
+
167165
+ // src/guid.ts
167166
+ function gen(count) {
167167
+ let out = "";
167168
+ for (let i = 0; i < count; i++) {
167169
+ out += ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);
167170
+ }
167171
+ return out;
167172
+ }
167173
+ function generateGuid() {
167174
+ return [gen(2), gen(1), gen(1), gen(1), gen(3)].join("-");
167175
+ }
167176
+
167177
+ // src/intl.ts
167178
+ var supportedLocalesArray = [
167179
+ "ar",
167180
+ "bg",
167181
+ "bs",
167182
+ "ca",
167183
+ "cs",
167184
+ "da",
167185
+ "de",
167186
+ "el",
167187
+ "en",
167188
+ "es",
167189
+ "et",
167190
+ "fi",
167191
+ "fr",
167192
+ "he",
167193
+ "hr",
167194
+ "hu",
167195
+ "id",
167196
+ "it",
167197
+ "ja",
167198
+ "ko",
167199
+ "lt",
167200
+ "lv",
167201
+ "nl",
167202
+ "nb",
167203
+ "pl",
167204
+ "pt-BR",
167205
+ "pt-PT",
167206
+ "ro",
167207
+ "ru",
167208
+ "sk",
167209
+ "sl",
167210
+ "sr",
167211
+ "sv",
167212
+ "th",
167213
+ "tr",
167214
+ "uk",
167215
+ "vi",
167216
+ "zh-CN",
167217
+ "zh-HK",
167218
+ "zh-TW"
167219
+ ];
167220
+ var supportedLocales = new Set(supportedLocalesArray);
167221
+ var defaultLocale = "en";
167222
+ var localeEquivalencies = {
167223
+ // We use `pt-BR` as it will have the same translations as `pt`, which has no corresponding bundle
167224
+ pt: "pt-PT",
167225
+ // We support both 'nb' and 'no' (BCP 47) for Norwegian but only `nb` has corresponding bundle
167226
+ no: "nb",
167227
+ // We can `zh-CN` as base translation for chinese locales which has no corresponding bundle.
167228
+ zh: "zh-CN"
167229
+ };
167230
+ async function fetchT9nStringsBundle(locale, assetsPath, prefix = "") {
167231
+ const path = `${assetsPath}/${prefix}`;
167232
+ const filePath = `${path}${locale}.json`;
167233
+ t9nStringsCache[filePath] ?? (t9nStringsCache[filePath] = fetchBundle(locale, path));
167234
+ return await t9nStringsCache[filePath];
167235
+ }
167236
+ var t9nStringsCache = {};
167237
+ async function fetchBundle(locale, path) {
167238
+ const filePath = `${path}${locale}.json`;
167239
+ try {
167240
+ const response = await fetch(filePath);
167241
+ if (response.ok) {
167242
+ return await response.json();
167243
+ }
167244
+ } catch (error) {
167245
+ console.error(error);
167246
+ return {};
167247
+ }
167248
+ if (locale === defaultLocale) {
167249
+ return {};
167250
+ }
167251
+ return await fetchBundle(defaultLocale, path);
167252
+ }
167253
+ function getElementLocales(element) {
167254
+ const lang = getElementAttribute(element, "lang", navigator.language || defaultLocale);
167255
+ return { lang, t9nLocale: langToLocale(lang) };
167256
+ }
167257
+ function langToLocale(lang) {
167258
+ const parts = lang.split("-");
167259
+ const normalized = `${parts[0].toLowerCase()}${parts.slice(1).join("-").toUpperCase()}`;
167260
+ if (supportedLocales.has(normalized)) {
167261
+ return normalized;
167262
+ }
167263
+ const languageCode = normalized.slice(0, 2).toLowerCase();
167264
+ const locale = localeEquivalencies[languageCode] ?? languageCode;
167265
+ if (supportedLocales.has(locale)) {
167266
+ return locale;
167267
+ }
167268
+ return defaultLocale;
167269
+ }
167270
+ function startLocaleObserver(element, assetsPath, onUpdated, assetName) {
167271
+ let result = void 0;
167272
+ const callback = () => void updateComponentLocateState(element, assetsPath, assetName).then((newResult) => {
167273
+ if (result?.lang !== newResult.lang || result.t9nLocale !== newResult.t9nLocale || result.t9nStrings !== newResult.t9nStrings) {
167274
+ onUpdated(newResult);
167275
+ }
167276
+ result = newResult;
167277
+ }).catch(console.error);
167278
+ callback();
167279
+ return observeAncestorsMutation(element, ["lang"], callback);
167280
+ }
167281
+ async function updateComponentLocateState(element, assetsPath, assetName = element.tagName.toLowerCase().replace("arcgis-", "")) {
167282
+ const { lang, t9nLocale } = getElementLocales(element);
167283
+ const t9nAssetsPath = `${assetsPath}/${assetName}/t9n`;
167284
+ const prefix = `${assetName}.t9n.`;
167285
+ const t9nStrings = await fetchT9nStringsBundle(t9nLocale, t9nAssetsPath, prefix);
167286
+ return { lang, t9nLocale, t9nStrings };
167287
+ }
167288
+
167289
+ // src/strings.ts
167290
+ var doubleQuote = '"';
167291
+ var singleQuote = "'";
167292
+ function repeatString(value, n) {
167293
+ return new Array(n + 1).join(value);
167294
+ }
167295
+ function quoteString(value) {
167296
+ let quote = doubleQuote;
167297
+ let alternateQuote = singleQuote;
167298
+ const avoidEscape = value.includes(quote) && !value.includes(alternateQuote);
167299
+ if (avoidEscape) {
167300
+ alternateQuote = doubleQuote;
167301
+ quote = singleQuote;
167302
+ }
167303
+ const alternateEscape = new RegExp(`(^|[^\\\\])((?:\\\\{2})*)((?:\\\\${alternateQuote})+)`, "gu");
167304
+ value = value.replace(
167305
+ alternateEscape,
167306
+ (_, boundaryChar, leadingEscapedSlashes, escapedQuoteChars) => (
167307
+ // We divide the escapedQuoteChars by 2 since there are 2 characters in each escaped part ('\\"'.length === 2)
167308
+ boundaryChar + leadingEscapedSlashes + repeatString(alternateQuote, escapedQuoteChars.length / 2)
167309
+ )
167310
+ );
167311
+ const quoteEscape = new RegExp(`(^|[^\\\\])((?:\\\\{2})*)(${quote}+)`, "gu");
167312
+ value = value.replace(
167313
+ quoteEscape,
167314
+ (_, boundaryChar, leadingEscapedSlashes, quoteChars) => boundaryChar + leadingEscapedSlashes + repeatString(`\\${quote}`, quoteChars.length)
167315
+ );
167316
+ return quote + value + quote;
167317
+ }
167318
+ function createFilterExpression(filterWord) {
167319
+ const sanitizedWord = filterWord ? filterWord.replaceAll(/[-[\]/{}()*+?.\\^$|]/gu, "\\$&") : "^.*$";
167320
+ return new RegExp(sanitizedWord, "i");
167321
+ }
167322
+ function setValuesInString(message, values = {}) {
167323
+ return (message ?? "").replace(/\{(?<valueName>.*?)\}/gu, (match, valueName) => values[valueName] ?? match);
167324
+ }
167325
+ function addLTRMark(value) {
167326
+ return `\u200E${value ?? ""}\u200E`;
167327
+ }
167328
+
167329
+ // src/timeouts.ts
167330
+ function devToolsAwareTimeout(callback, timeout) {
167331
+ const interval = timeout > longTimeoutThreshold ? longTimeoutInterval : timeout / shortTimeoutIntervals;
167332
+ let elapsed = 0;
167333
+ const reference = setInterval(() => {
167334
+ elapsed += interval;
167335
+ if (elapsed >= timeout) {
167336
+ clearInterval(reference);
167337
+ callback();
167338
+ }
167339
+ }, interval);
167340
+ return reference;
167341
+ }
167342
+ var longTimeoutThreshold = 4e3;
167343
+ var longTimeoutInterval = 2e3;
167344
+ var shortTimeoutIntervals = 4;
167345
+
167346
+ // src/type-guards.ts
167347
+ function isNotNull(item) {
167348
+ return item !== null;
167349
+ }
167350
+ function isNotUndefined(item) {
167351
+ return item !== void 0;
167352
+ }
167353
+
167354
+ // src/ui.ts
167355
+ function debounce(func, waitFor = 100) {
167356
+ let timeout;
167357
+ return (...args) => {
167358
+ const later = () => {
167359
+ clearTimeout(timeout);
167360
+ func(...args);
167361
+ };
167362
+ clearTimeout(timeout);
167363
+ timeout = setTimeout(later, waitFor);
167364
+ };
167365
+ }
167366
+
167367
+ // src/url.ts
167368
+ function hasSameOrigin(url1, url2, ignoreProtocol = false) {
167369
+ if (!url1 || !url2) {
167370
+ return false;
167371
+ }
167372
+ const url1Obj = new URL(url1);
167373
+ const url2Obj = new URL(url2);
167374
+ if (!ignoreProtocol && url1Obj.protocol !== url2Obj.protocol) {
167375
+ return false;
167376
+ }
167377
+ if (url1Obj.host == null || url2Obj.host == null) {
167378
+ return false;
167379
+ }
167380
+ return url1Obj.host.toLowerCase() === url2Obj.host.toLowerCase() && url1Obj.port === url2Obj.port;
167381
+ }
167382
+ function isURL(url) {
167383
+ try {
167384
+ new URL(url);
167385
+ return true;
167386
+ } catch (e) {
167387
+ return false;
167388
+ }
167389
+ }
167390
+
167391
+ /**
167392
+ * Filters a collection of items by the given keys and filter word.
167393
+ */
167394
+ function filterCollection(collection, keys, filterWord, beforeFilteringFn) {
167395
+ if (!keys) {
167396
+ return [];
167397
+ }
167398
+ const _keys = !Array.isArray(keys) ? [keys] : keys;
167399
+ if (!_keys.length) {
167400
+ return [];
167401
+ }
167402
+ const filterExpression = createFilterExpression(filterWord);
167403
+ return collection.filter((item) => {
167404
+ if (beforeFilteringFn) {
167405
+ const res = beforeFilteringFn(item);
167406
+ if (res !== null || res !== undefined) {
167407
+ return res;
167408
+ }
167409
+ }
167410
+ return _keys.some((key) => filterExpression.test(String(item[key] ?? "")));
167411
+ });
167412
+ }
167413
+ /**
167414
+ * Returns the url to the portal item.
167415
+ */
167416
+ function portalItemPageUrl(portalItem) {
167417
+ if (!portalItem) {
167418
+ return "";
167419
+ }
167420
+ return `${portalItem.portal.url}/home/item.html?id=${portalItem.id}`;
167421
+ }
167422
+ //#endregion
167423
+
167424
+ /**
167425
+ * Returns an icon name for the field type
167426
+ */
167427
+ function fieldTypeToIconName(field) {
167428
+ switch (field.type) {
167429
+ case "oid":
167430
+ return "key";
167431
+ case "small-integer":
167432
+ case "big-integer":
167433
+ case "integer":
167434
+ case "single":
167435
+ case "double":
167436
+ case "long":
167437
+ return "number";
167438
+ case "global-id":
167439
+ case "guid":
167440
+ return "key";
167441
+ case "string":
167442
+ return "string";
167443
+ case "date":
167444
+ return "date-time";
167445
+ case "date-only":
167446
+ return "calendar";
167447
+ case "time-only":
167448
+ return "clock";
167449
+ case "timestamp-offset":
167450
+ return "time-zone";
167451
+ default:
167452
+ return "cube";
167453
+ }
167454
+ }
167455
+ /**
167456
+ * Returns the ApiValueVariable type for the given field.
167457
+ */
167458
+ function fieldTypeToApiValueVarType(field) {
167459
+ switch (field.type) {
167460
+ case "small-integer":
167461
+ case "integer":
167462
+ case "big-integer":
167463
+ case "single":
167464
+ case "double":
167465
+ case "long":
167466
+ case "oid":
167467
+ return "number";
167468
+ case "global-id":
167469
+ case "guid":
167470
+ case "string":
167471
+ return "text";
167472
+ case "date":
167473
+ return "date";
167474
+ case "date-only":
167475
+ return "dateOnly";
167476
+ case "time-only":
167477
+ return "time";
167478
+ default:
167479
+ return "text";
167480
+ }
167481
+ }
167482
+ function supportedFields(fields) {
167483
+ return (fields ?? []).filter((field) => {
167484
+ switch (field.type) {
167485
+ case "string":
167486
+ case "small-integer":
167487
+ case "integer":
167488
+ case "big-integer":
167489
+ case "single":
167490
+ case "double":
167491
+ case "long":
167492
+ case "date":
167493
+ case "date-only":
167494
+ case "time-only":
167495
+ case "timestamp-offset":
167496
+ case "oid":
167497
+ case "guid":
167498
+ case "global-id":
167499
+ return true;
167500
+ default:
167501
+ return false;
167502
+ }
167503
+ });
167504
+ }
167505
+ function fieldAlias(field) {
167506
+ return field.alias || field.name;
167507
+ }
167508
+
166739
167509
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
166740
167510
 
166741
167511
  function commonjsRequire (path) {
@@ -169011,760 +169781,6 @@ var main = {exports: {}};
169011
169781
  });
169012
169782
  }(main, main.exports));
169013
169783
 
169014
- // src/index.ts
169015
- var isAMD = typeof window !== "undefined" && "$arcgis" in window && typeof window.$arcgis === "object" && "import" in window.$arcgis && !("forceESM" in window.$arcgis);
169016
- function isDefaultModule(module) {
169017
- return module.default !== void 0;
169018
- }
169019
- async function importLayersFeatureLayer() {
169020
- if (isAMD) {
169021
- return await window.$arcgis.import("esri/layers/FeatureLayer");
169022
- }
169023
- const module = await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('@arcgis/core/layers/FeatureLayer.js')); });
169024
- return isDefaultModule(module) ? module.default : module;
169025
- }
169026
- async function newLayersFeatureLayer(properties) {
169027
- const ModConstructor = await importLayersFeatureLayer();
169028
- return new ModConstructor(properties);
169029
- }
169030
- async function importPortalPortalItem() {
169031
- if (isAMD) {
169032
- return await window.$arcgis.import("esri/portal/PortalItem");
169033
- }
169034
- const module = await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('@arcgis/core/portal/PortalItem.js')); });
169035
- return isDefaultModule(module) ? module.default : module;
169036
- }
169037
- async function newPortalPortalItem(properties) {
169038
- const ModConstructor = await importPortalPortalItem();
169039
- return new ModConstructor(properties);
169040
- }
169041
- async function importWebMap() {
169042
- if (isAMD) {
169043
- return await window.$arcgis.import("esri/WebMap");
169044
- }
169045
- const module = await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('@arcgis/core/WebMap.js')); });
169046
- return isDefaultModule(module) ? module.default : module;
169047
- }
169048
- async function newWebMap(properties) {
169049
- const ModConstructor = await importWebMap();
169050
- return new ModConstructor(properties);
169051
- }
169052
- async function importWebScene() {
169053
- if (isAMD) {
169054
- return await window.$arcgis.import("esri/WebScene");
169055
- }
169056
- const module = await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('@arcgis/core/WebScene.js')); });
169057
- return isDefaultModule(module) ? module.default : module;
169058
- }
169059
- async function newWebScene(properties) {
169060
- const ModConstructor = await importWebScene();
169061
- return new ModConstructor(properties);
169062
- }
169063
- async function importArcade() {
169064
- if (isAMD) {
169065
- return await window.$arcgis.import("esri/arcade");
169066
- }
169067
- const module = await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('@arcgis/core/arcade.js')); });
169068
- return isDefaultModule(module) ? module.default : module;
169069
- }
169070
- async function importRequest() {
169071
- if (isAMD) {
169072
- return await window.$arcgis.import("esri/request");
169073
- }
169074
- const module = await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('@arcgis/core/request.js')); });
169075
- return isDefaultModule(module) ? module.default : module;
169076
- }
169077
-
169078
- //#region Type Guards
169079
- function isQueryableLayerInstance(item) {
169080
- return (!!item &&
169081
- typeof item === "object" &&
169082
- "declaredClass" in item &&
169083
- typeof item.declaredClass === "string" &&
169084
- item.declaredClass.startsWith("esri.layers.") &&
169085
- "fields" in item &&
169086
- "queryFeatures" in item &&
169087
- typeof item.queryFeatures === "function");
169088
- }
169089
- function isSubtypeSublayerInstance(item) {
169090
- return (!!item &&
169091
- typeof item === "object" &&
169092
- "declaredClass" in item &&
169093
- typeof item.declaredClass === "string" &&
169094
- item.declaredClass === "esri.layers.support.SubtypeSublayer");
169095
- }
169096
- function isGroupLayerInstance(item) {
169097
- return (!!item &&
169098
- typeof item === "object" &&
169099
- "declaredClass" in item &&
169100
- typeof item.declaredClass === "string" &&
169101
- item.declaredClass === "esri.layers.GroupLayer");
169102
- }
169103
- function isMapInstance(item) {
169104
- return (!!item &&
169105
- typeof item === "object" &&
169106
- "declaredClass" in item &&
169107
- typeof item.declaredClass === "string" &&
169108
- (item.declaredClass === "esri.Map" ||
169109
- item.declaredClass === "esri.WebMap" ||
169110
- item.declaredClass === "esri.WebScene"));
169111
- }
169112
- function isWebMapInstance(item) {
169113
- return item.declaredClass === "esri.WebMap";
169114
- }
169115
- function isWebSceneInstance(item) {
169116
- return item.declaredClass === "esri.WebScene";
169117
- }
169118
- function isLoadableMapInstance(item) {
169119
- return item.declaredClass === "esri.WebMap" || item.declaredClass === "esri.WebScene";
169120
- }
169121
- function isPortalItemDefinition(item) {
169122
- return !!item && typeof item === "object" && "portalItem" in item && item.portalItem != null;
169123
- }
169124
- function isFeatureLayerItemDefinition(item) {
169125
- return !!item && typeof item === "object" && "portalItem" in item && item.portalItem != null;
169126
- }
169127
- function isFieldsDefinition(item) {
169128
- return !!item && typeof item === "object" && "fields" in item && Array.isArray(item.fields);
169129
- }
169130
- function isUrlDefinition(item) {
169131
- return !!item && typeof item === "object" && "url" in item && typeof item.url === "string";
169132
- }
169133
- function isSupportedServiceUrlDefinition(item) {
169134
- return isUrlDefinition(item) && /\/(?:featureserver|mapserver)(?:\/|$)/iu.test(item.url);
169135
- }
169136
- function isSubtypeInstance(item) {
169137
- return (!!item &&
169138
- typeof item === "object" &&
169139
- "declaredClass" in item &&
169140
- item.declaredClass === "esri.layers.support.Subtype");
169141
- }
169142
- function isCodedValueDomainInstance(item) {
169143
- return (!!item &&
169144
- typeof item === "object" &&
169145
- "declaredClass" in item &&
169146
- item.declaredClass === "esri.layers.support.CodedValueDomain");
169147
- }
169148
- function isInheritedDomainInstance(item) {
169149
- return (!!item &&
169150
- typeof item === "object" &&
169151
- "declaredClass" in item &&
169152
- item.declaredClass === "esri.layers.support.InheritedDomain");
169153
- }
169154
- function isPredefinedProfile(item) {
169155
- return (!!item &&
169156
- typeof item === "object" &&
169157
- "id" in item &&
169158
- typeof item.id === "string" &&
169159
- "definitions" in item &&
169160
- typeof item.definitions === "object" &&
169161
- !Array.isArray(item.definitions));
169162
- }
169163
- function isTitleCapableSource(item) {
169164
- return !!item && typeof item === "object" && "title" in item && typeof item.title === "string";
169165
- }
169166
- function isUrlCapableSource(item) {
169167
- return !!item && typeof item === "object" && "url" in item && typeof item.url === "string";
169168
- }
169169
- function isLayerIdCapableSource(item) {
169170
- return !!item && typeof item === "object" && "layerId" in item && typeof item.layerId === "number";
169171
- }
169172
- function isFeatureTypesCapableLayer(item) {
169173
- return !!item && typeof item === "object" && "typeIdField" in item && "types" in item;
169174
- }
169175
- function isDomainsCapableLayer(item) {
169176
- return !!item && typeof item === "object" && "getFieldDomain" in item && typeof item.getFieldDomain === "function";
169177
- }
169178
- function isSubtypeFieldCapableLayer(item) {
169179
- return !!item && typeof item === "object" && "subtypeField" in item;
169180
- }
169181
- function isSubtypesCapableLayer(item) {
169182
- return isSubtypeFieldCapableLayer(item) && "subtypes" in item;
169183
- }
169184
- function isRelationshipsCapableLayer(item) {
169185
- return (isLayerIdCapableSource(item) &&
169186
- "relationships" in item &&
169187
- "url" in item &&
169188
- Array.isArray(item.relationships) &&
169189
- typeof item.url === "string");
169190
- }
169191
- function isTableCapableLayer(item) {
169192
- return !!item && typeof item === "object" && "isTable" in item && typeof item.isTable === "boolean";
169193
- }
169194
- function isLoadableSource(item) {
169195
- return !!item && typeof item === "object" && "load" in item && typeof item.load === "function";
169196
- }
169197
- //#endregion
169198
- //#region Service Metadata
169199
- async function supportedSourceFromDefinition(definition) {
169200
- if (!definition) {
169201
- return null;
169202
- }
169203
- let source = null;
169204
- if (isFieldsDefinition(definition)) {
169205
- source = definition;
169206
- }
169207
- else {
169208
- source = await newLayersFeatureLayer(definition);
169209
- }
169210
- if (isLoadableSource(source)) {
169211
- await source.load();
169212
- }
169213
- return source;
169214
- }
169215
- async function serviceMetaData(url) {
169216
- url += "/layers";
169217
- const request = await importRequest();
169218
- const response = await request(url, { responseType: "json", query: { f: "json" } });
169219
- const queryCapability = url.endsWith("MapServer/layers") ? "data" : "query";
169220
- const layers = getSupportedLayerInfos(response.data?.layers, queryCapability);
169221
- const tables = getSupportedLayerInfos(response.data?.tables, queryCapability);
169222
- return { layers, tables };
169223
- }
169224
- function getSupportedLayerInfos(layers, queryCapability) {
169225
- if (!layers) {
169226
- return [];
169227
- }
169228
- return layers.filter((layer) => {
169229
- switch (layer.type) {
169230
- case "Feature Layer":
169231
- case "Oriented Imagery Layer":
169232
- case "Catalog Layer":
169233
- case "Table": {
169234
- const capabilities = layer.capabilities
169235
- ? layer.capabilities
169236
- .toLowerCase()
169237
- .split(",")
169238
- .map((value) => value.trim())
169239
- : [];
169240
- return capabilities.includes(queryCapability);
169241
- }
169242
- default:
169243
- return false;
169244
- }
169245
- });
169246
- }
169247
- //#endregion
169248
-
169249
- // src/array-utils.ts
169250
-
169251
- // src/deferred.ts
169252
- var Deferred = class {
169253
- /**
169254
- * Resolves the promise.
169255
- * @param value The value to resolve the promise with.
169256
- */
169257
- resolve(_value) {
169258
- }
169259
- /**
169260
- * Rejects the promise.
169261
- */
169262
- reject(_error) {
169263
- }
169264
- /**
169265
- * Creates a new deferred promise.
169266
- */
169267
- constructor() {
169268
- this.promise = new Promise((resolve, reject) => {
169269
- this.resolve = resolve;
169270
- this.reject = reject;
169271
- });
169272
- }
169273
- };
169274
-
169275
- // src/dom.ts
169276
- function inTargetElement(element, targetElement) {
169277
- let currentElement = element;
169278
- while (currentElement) {
169279
- if (currentElement === targetElement) {
169280
- return true;
169281
- }
169282
- if (!currentElement.parentNode) {
169283
- return false;
169284
- }
169285
- if (currentElement.parentNode instanceof ShadowRoot) {
169286
- currentElement = currentElement.parentNode.host;
169287
- } else {
169288
- currentElement = currentElement.parentNode;
169289
- }
169290
- }
169291
- return false;
169292
- }
169293
- function observeAncestorsMutation(element, attributeFilter, callback) {
169294
- const { subscribe } = observe(attributeFilter);
169295
- return subscribe((mutations) => {
169296
- const matched = mutations.some((mutation) => inTargetElement(element, mutation.target));
169297
- if (matched) {
169298
- callback();
169299
- }
169300
- });
169301
- }
169302
- var observers = {};
169303
- function observe(attributeFilter) {
169304
- const attributes = attributeFilter.join(",");
169305
- const previousObserver = observers[attributes];
169306
- if (previousObserver !== void 0) {
169307
- return previousObserver;
169308
- }
169309
- const subscribers = /* @__PURE__ */ new Set();
169310
- const mutationObserver = new MutationObserver((mutations) => subscribers.forEach((callback) => callback(mutations)));
169311
- mutationObserver.observe(document.documentElement, {
169312
- attributes: true,
169313
- attributeFilter,
169314
- subtree: true
169315
- });
169316
- const observer = {
169317
- subscribe(callback) {
169318
- subscribers.add(callback);
169319
- return {
169320
- remove: () => {
169321
- subscribers.delete(callback);
169322
- if (subscribers.size === 0) {
169323
- mutationObserver.disconnect();
169324
- observers[attributes] = void 0;
169325
- }
169326
- }
169327
- };
169328
- }
169329
- };
169330
- observers[attributes] = observer;
169331
- return observer;
169332
- }
169333
- function closestElement(base, selector) {
169334
- let currentElement = base;
169335
- while (currentElement) {
169336
- const element = currentElement.closest(selector);
169337
- if (element) {
169338
- return element;
169339
- }
169340
- const rootElement = currentElement.getRootNode();
169341
- if (rootElement === document) {
169342
- return null;
169343
- }
169344
- currentElement = rootElement.host;
169345
- }
169346
- return null;
169347
- }
169348
- function getElementTheme(base) {
169349
- const themeElt = closestElement(base, ":is(.calcite-mode-light, .calcite-mode-dark)");
169350
- return themeElt && themeElt.classList.contains("calcite-mode-dark") ? "dark" : "light";
169351
- }
169352
- function getElementAttribute(el, prop, fallbackValue) {
169353
- const closest = closestElement(el, `[${prop}]`);
169354
- return closest?.getAttribute(prop) ?? fallbackValue;
169355
- }
169356
- function isElement(ref) {
169357
- return ref.nodeType === Node.ELEMENT_NODE;
169358
- }
169359
- function isHTMLWithSetFocus(ref) {
169360
- return "setFocus" in ref && typeof ref.setFocus === "function";
169361
- }
169362
- function setFocus(ref, selector = "") {
169363
- if (!isElement(ref)) {
169364
- return false;
169365
- }
169366
- if (ref.matches(selector)) {
169367
- if (isHTMLWithSetFocus(ref)) {
169368
- setTimeout(() => ref.setFocus(), 0);
169369
- }
169370
- return true;
169371
- }
169372
- for (const child of ref.children) {
169373
- if (setFocus(child, selector)) {
169374
- return true;
169375
- }
169376
- }
169377
- const shadowRoot = ref.shadowRoot;
169378
- if (shadowRoot) {
169379
- for (const child of shadowRoot.children) {
169380
- if (setFocus(child, selector)) {
169381
- return true;
169382
- }
169383
- }
169384
- }
169385
- return false;
169386
- }
169387
- function setFocusOnElement(ref, selector) {
169388
- if (!ref?.shadowRoot) {
169389
- return;
169390
- }
169391
- if (ref.hasAttribute("hydrated") || ref.hasAttribute("calcite-hydrated")) {
169392
- setFocus(ref, selector);
169393
- return;
169394
- }
169395
- const mutationObserver = new MutationObserver(() => {
169396
- mutationObserver.disconnect();
169397
- setFocus(ref, selector);
169398
- });
169399
- mutationObserver.observe(ref, {
169400
- attributes: true,
169401
- attributeFilter: ["hydrated", "calcite-hydrated"]
169402
- });
169403
- }
169404
-
169405
- // src/errors.ts
169406
- function safeCall(callback, thisContext, ...rest) {
169407
- try {
169408
- return callback?.call(thisContext, ...rest);
169409
- } catch (error) {
169410
- console.error(error, callback);
169411
- }
169412
- return void 0;
169413
- }
169414
- async function safeAsyncCall(callback, thisContext, ...rest) {
169415
- try {
169416
- const result = callback?.call(thisContext, ...rest);
169417
- return result instanceof Promise ? await result : result;
169418
- } catch (error) {
169419
- console.error(error, callback);
169420
- }
169421
- return void 0;
169422
- }
169423
-
169424
- // src/guid.ts
169425
- function gen(count) {
169426
- let out = "";
169427
- for (let i = 0; i < count; i++) {
169428
- out += ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);
169429
- }
169430
- return out;
169431
- }
169432
- function generateGuid() {
169433
- return [gen(2), gen(1), gen(1), gen(1), gen(3)].join("-");
169434
- }
169435
-
169436
- // src/intl.ts
169437
- var supportedLocalesArray = [
169438
- "ar",
169439
- "bg",
169440
- "bs",
169441
- "ca",
169442
- "cs",
169443
- "da",
169444
- "de",
169445
- "el",
169446
- "en",
169447
- "es",
169448
- "et",
169449
- "fi",
169450
- "fr",
169451
- "he",
169452
- "hr",
169453
- "hu",
169454
- "id",
169455
- "it",
169456
- "ja",
169457
- "ko",
169458
- "lt",
169459
- "lv",
169460
- "nl",
169461
- "nb",
169462
- "pl",
169463
- "pt-BR",
169464
- "pt-PT",
169465
- "ro",
169466
- "ru",
169467
- "sk",
169468
- "sl",
169469
- "sr",
169470
- "sv",
169471
- "th",
169472
- "tr",
169473
- "uk",
169474
- "vi",
169475
- "zh-CN",
169476
- "zh-HK",
169477
- "zh-TW"
169478
- ];
169479
- var supportedLocales = new Set(supportedLocalesArray);
169480
- var defaultLocale = "en";
169481
- var localeEquivalencies = {
169482
- // We use `pt-BR` as it will have the same translations as `pt`, which has no corresponding bundle
169483
- pt: "pt-PT",
169484
- // We support both 'nb' and 'no' (BCP 47) for Norwegian but only `nb` has corresponding bundle
169485
- no: "nb",
169486
- // We can `zh-CN` as base translation for chinese locales which has no corresponding bundle.
169487
- zh: "zh-CN"
169488
- };
169489
- async function fetchT9nStringsBundle(locale, assetsPath, prefix = "") {
169490
- const path = `${assetsPath}/${prefix}`;
169491
- const filePath = `${path}${locale}.json`;
169492
- t9nStringsCache[filePath] ?? (t9nStringsCache[filePath] = fetchBundle(locale, path));
169493
- return await t9nStringsCache[filePath];
169494
- }
169495
- var t9nStringsCache = {};
169496
- async function fetchBundle(locale, path) {
169497
- const filePath = `${path}${locale}.json`;
169498
- try {
169499
- const response = await fetch(filePath);
169500
- if (response.ok) {
169501
- return await response.json();
169502
- }
169503
- } catch (error) {
169504
- console.error(error);
169505
- return {};
169506
- }
169507
- if (locale === defaultLocale) {
169508
- return {};
169509
- }
169510
- return await fetchBundle(defaultLocale, path);
169511
- }
169512
- function getElementLocales(element) {
169513
- const lang = getElementAttribute(element, "lang", navigator.language || defaultLocale);
169514
- return { lang, t9nLocale: langToLocale(lang) };
169515
- }
169516
- function langToLocale(lang) {
169517
- const parts = lang.split("-");
169518
- const normalized = `${parts[0].toLowerCase()}${parts.slice(1).join("-").toUpperCase()}`;
169519
- if (supportedLocales.has(normalized)) {
169520
- return normalized;
169521
- }
169522
- const languageCode = normalized.slice(0, 2).toLowerCase();
169523
- const locale = localeEquivalencies[languageCode] ?? languageCode;
169524
- if (supportedLocales.has(locale)) {
169525
- return locale;
169526
- }
169527
- return defaultLocale;
169528
- }
169529
- function startLocaleObserver(element, assetsPath, onUpdated, assetName) {
169530
- let result = void 0;
169531
- const callback = () => void updateComponentLocateState(element, assetsPath, assetName).then((newResult) => {
169532
- if (result?.lang !== newResult.lang || result.t9nLocale !== newResult.t9nLocale || result.t9nStrings !== newResult.t9nStrings) {
169533
- onUpdated(newResult);
169534
- }
169535
- result = newResult;
169536
- }).catch(console.error);
169537
- callback();
169538
- return observeAncestorsMutation(element, ["lang"], callback);
169539
- }
169540
- async function updateComponentLocateState(element, assetsPath, assetName = element.tagName.toLowerCase().replace("arcgis-", "")) {
169541
- const { lang, t9nLocale } = getElementLocales(element);
169542
- const t9nAssetsPath = `${assetsPath}/${assetName}/t9n`;
169543
- const prefix = `${assetName}.t9n.`;
169544
- const t9nStrings = await fetchT9nStringsBundle(t9nLocale, t9nAssetsPath, prefix);
169545
- return { lang, t9nLocale, t9nStrings };
169546
- }
169547
-
169548
- // src/strings.ts
169549
- var doubleQuote = '"';
169550
- var singleQuote = "'";
169551
- function repeatString(value, n) {
169552
- return new Array(n + 1).join(value);
169553
- }
169554
- function quoteString(value) {
169555
- let quote = doubleQuote;
169556
- let alternateQuote = singleQuote;
169557
- const avoidEscape = value.includes(quote) && !value.includes(alternateQuote);
169558
- if (avoidEscape) {
169559
- alternateQuote = doubleQuote;
169560
- quote = singleQuote;
169561
- }
169562
- const alternateEscape = new RegExp(`(^|[^\\\\])((?:\\\\{2})*)((?:\\\\${alternateQuote})+)`, "gu");
169563
- value = value.replace(
169564
- alternateEscape,
169565
- (_, boundaryChar, leadingEscapedSlashes, escapedQuoteChars) => (
169566
- // We divide the escapedQuoteChars by 2 since there are 2 characters in each escaped part ('\\"'.length === 2)
169567
- boundaryChar + leadingEscapedSlashes + repeatString(alternateQuote, escapedQuoteChars.length / 2)
169568
- )
169569
- );
169570
- const quoteEscape = new RegExp(`(^|[^\\\\])((?:\\\\{2})*)(${quote}+)`, "gu");
169571
- value = value.replace(
169572
- quoteEscape,
169573
- (_, boundaryChar, leadingEscapedSlashes, quoteChars) => boundaryChar + leadingEscapedSlashes + repeatString(`\\${quote}`, quoteChars.length)
169574
- );
169575
- return quote + value + quote;
169576
- }
169577
- function createFilterExpression(filterWord) {
169578
- const sanitizedWord = filterWord ? filterWord.replaceAll(/[-[\]/{}()*+?.\\^$|]/gu, "\\$&") : "^.*$";
169579
- return new RegExp(sanitizedWord, "i");
169580
- }
169581
- function setValuesInString(message, values = {}) {
169582
- return (message ?? "").replace(/\{(?<valueName>.*?)\}/gu, (match, valueName) => values[valueName] ?? match);
169583
- }
169584
- function addLTRMark(value) {
169585
- return `\u200E${value ?? ""}\u200E`;
169586
- }
169587
-
169588
- // src/timeouts.ts
169589
- function devToolsAwareTimeout(callback, timeout) {
169590
- const interval = timeout > longTimeoutThreshold ? longTimeoutInterval : timeout / shortTimeoutIntervals;
169591
- let elapsed = 0;
169592
- const reference = setInterval(() => {
169593
- elapsed += interval;
169594
- if (elapsed >= timeout) {
169595
- clearInterval(reference);
169596
- callback();
169597
- }
169598
- }, interval);
169599
- return reference;
169600
- }
169601
- var longTimeoutThreshold = 4e3;
169602
- var longTimeoutInterval = 2e3;
169603
- var shortTimeoutIntervals = 4;
169604
-
169605
- // src/type-guards.ts
169606
- function isNotNull(item) {
169607
- return item !== null;
169608
- }
169609
- function isNotUndefined(item) {
169610
- return item !== void 0;
169611
- }
169612
-
169613
- // src/ui.ts
169614
- function debounce(func, waitFor = 100) {
169615
- let timeout;
169616
- return (...args) => {
169617
- const later = () => {
169618
- clearTimeout(timeout);
169619
- func(...args);
169620
- };
169621
- clearTimeout(timeout);
169622
- timeout = setTimeout(later, waitFor);
169623
- };
169624
- }
169625
-
169626
- // src/url.ts
169627
- function hasSameOrigin(url1, url2, ignoreProtocol = false) {
169628
- if (!url1 || !url2) {
169629
- return false;
169630
- }
169631
- const url1Obj = new URL(url1);
169632
- const url2Obj = new URL(url2);
169633
- if (!ignoreProtocol && url1Obj.protocol !== url2Obj.protocol) {
169634
- return false;
169635
- }
169636
- if (url1Obj.host == null || url2Obj.host == null) {
169637
- return false;
169638
- }
169639
- return url1Obj.host.toLowerCase() === url2Obj.host.toLowerCase() && url1Obj.port === url2Obj.port;
169640
- }
169641
- function isURL(url) {
169642
- try {
169643
- new URL(url);
169644
- return true;
169645
- } catch (e) {
169646
- return false;
169647
- }
169648
- }
169649
-
169650
- /**
169651
- * Filters a collection of items by the given keys and filter word.
169652
- */
169653
- function filterCollection(collection, keys, filterWord, beforeFilteringFn) {
169654
- if (!keys) {
169655
- return [];
169656
- }
169657
- const _keys = !Array.isArray(keys) ? [keys] : keys;
169658
- if (!_keys.length) {
169659
- return [];
169660
- }
169661
- const filterExpression = createFilterExpression(filterWord);
169662
- return collection.filter((item) => {
169663
- if (beforeFilteringFn) {
169664
- const res = beforeFilteringFn(item);
169665
- if (res !== null || res !== undefined) {
169666
- return res;
169667
- }
169668
- }
169669
- return _keys.some((key) => filterExpression.test(String(item[key] ?? "")));
169670
- });
169671
- }
169672
- /**
169673
- * Returns the url to the portal item.
169674
- */
169675
- function portalItemPageUrl(portalItem) {
169676
- if (!portalItem) {
169677
- return "";
169678
- }
169679
- return `${portalItem.portal.url}/home/item.html?id=${portalItem.id}`;
169680
- }
169681
- //#endregion
169682
-
169683
- /**
169684
- * Returns an icon name for the field type
169685
- */
169686
- function fieldTypeToIconName(field) {
169687
- switch (field.type) {
169688
- case "oid":
169689
- return "key";
169690
- case "small-integer":
169691
- case "big-integer":
169692
- case "integer":
169693
- case "single":
169694
- case "double":
169695
- case "long":
169696
- return "number";
169697
- case "global-id":
169698
- case "guid":
169699
- return "key";
169700
- case "string":
169701
- return "string";
169702
- case "date":
169703
- return "date-time";
169704
- case "date-only":
169705
- return "calendar";
169706
- case "time-only":
169707
- return "clock";
169708
- case "timestamp-offset":
169709
- return "time-zone";
169710
- default:
169711
- return "cube";
169712
- }
169713
- }
169714
- /**
169715
- * Returns the Arcade type for the given field.
169716
- */
169717
- function fieldTypeToArcadeType(field) {
169718
- switch (field.type) {
169719
- case "small-integer":
169720
- case "integer":
169721
- case "big-integer":
169722
- case "single":
169723
- case "double":
169724
- case "long":
169725
- case "oid":
169726
- return "number";
169727
- case "global-id":
169728
- case "guid":
169729
- case "string":
169730
- return "text";
169731
- case "date":
169732
- return "date";
169733
- case "date-only":
169734
- return "dateOnly";
169735
- case "time-only":
169736
- return "time";
169737
- default:
169738
- return "text";
169739
- }
169740
- }
169741
- function supportedFields(fields) {
169742
- return (fields ?? []).filter((field) => {
169743
- switch (field.type) {
169744
- case "string":
169745
- case "small-integer":
169746
- case "integer":
169747
- case "big-integer":
169748
- case "single":
169749
- case "double":
169750
- case "long":
169751
- case "date":
169752
- case "date-only":
169753
- case "time-only":
169754
- case "timestamp-offset":
169755
- case "oid":
169756
- case "guid":
169757
- case "global-id":
169758
- return true;
169759
- default:
169760
- return false;
169761
- }
169762
- });
169763
- }
169764
- function fieldAlias(field) {
169765
- return field.alias || field.name;
169766
- }
169767
-
169768
169784
  //#endregion
169769
169785
  //#region Support functions
169770
169786
  async function getRelatedFeatureLayer(layer, relationship) {
@@ -169780,14 +169796,6 @@ function sortFields(layer) {
169780
169796
  if (secondField.type === "oid") {
169781
169797
  return 1;
169782
169798
  }
169783
- if (isSubtypeSublayerInstance(layer)) {
169784
- if (firstField.name === layer.parent.subtypeField) {
169785
- return -1;
169786
- }
169787
- if (secondField.name === layer.parent.subtypeField) {
169788
- return 1;
169789
- }
169790
- }
169791
169799
  if (isSubtypeFieldCapableLayer(layer)) {
169792
169800
  if (firstField.name === layer.subtypeField) {
169793
169801
  return -1;
@@ -169825,86 +169833,28 @@ function assembleMemberExpression(obj, prop) {
169825
169833
  return `${obj}${getMemberExpressionProperty(prop)}`;
169826
169834
  }
169827
169835
  function getMapPortalItem(map) {
169828
- if (isWebMapInstance(map) || isWebSceneInstance(map)) {
169836
+ if (isPortalItemCapable(map)) {
169829
169837
  return map.portalItem;
169830
169838
  }
169831
169839
  return null;
169832
169840
  }
169833
- //#endregion
169834
- //#region Editor Profile to Language Service Profile functions
169835
- async function variablesToLSVariable(editorVariables, kind = main.exports.CompletionItemKind.Variable) {
169836
- return await Promise.all(editorVariables.map(async (editorVariable) => {
169837
- switch (editorVariable.type) {
169838
- case "dictionary":
169839
- return await dictionaryToLSDictionary(editorVariable, kind);
169840
- case "feature":
169841
- return await featureToLSFeature(editorVariable, kind);
169842
- default:
169843
- return variableToLSVariable(editorVariable, kind);
169844
- }
169845
- }));
169846
- }
169847
- function variableToLSVariable(editorVariable, kind) {
169848
- const { name, type } = editorVariable;
169849
- const description = editorVariable.getDescription();
169850
- return {
169851
- name,
169852
- description,
169853
- type,
169854
- completion: {
169855
- label: name,
169856
- detail: name,
169857
- insertText: name,
169858
- insertTextMode: main.exports.InsertTextMode.asIs,
169859
- insertTextFormat: main.exports.InsertTextFormat.PlainText,
169860
- kind,
169861
- documentation: { kind: "markdown", value: description },
169862
- },
169863
- };
169864
- }
169865
- async function featureToLSFeature(editorFeature, kind) {
169866
- // Get the source for the definition
169867
- const source = await editorFeature.loadSource();
169868
- const { name } = editorFeature;
169869
- const description = editorFeature.getDescription();
169870
- const resultCompletion = {
169871
- label: name,
169872
- detail: name,
169873
- insertText: name,
169874
- insertTextMode: main.exports.InsertTextMode.asIs,
169875
- insertTextFormat: main.exports.InsertTextFormat.PlainText,
169876
- kind,
169877
- };
169878
- const result = {
169879
- name,
169880
- description,
169881
- type: "dictionary",
169882
- properties: [],
169883
- completion: resultCompletion,
169884
- };
169885
- // No source definition, then it will be a feature without any known fields
169886
- if (!source) {
169887
- return result;
169888
- }
169889
- // Create properties for the fields and the aliases
169890
- // Also improve the feature completion documentation
169891
- let featureCompletionDescription = description;
169841
+ /**
169842
+ * converts fields to profile values and calculates the feature completion description all in one iteration
169843
+ */
169844
+ function fieldsToProfileValues(fields, initialFeatureCompletionDescription, includeAliases = false) {
169845
+ let featureCompletionDescription = initialFeatureCompletionDescription;
169892
169846
  const fieldProfileValues = [];
169893
169847
  const aliasProfileValues = [];
169894
- supportedFields(source.fields).forEach((field) => {
169895
- let fieldCompletionDescription = `**${field.name}** \n${field.type}`;
169896
- if (field.description) {
169897
- fieldCompletionDescription += ` \n'${field.description}`;
169898
- }
169848
+ supportedFields(fields).forEach((field) => {
169899
169849
  if (featureCompletionDescription) {
169900
169850
  featureCompletionDescription += " \n \n";
169901
169851
  }
169902
- featureCompletionDescription += `**${field.name}** (${fieldAlias(field)}) \n${field.type}`;
169852
+ featureCompletionDescription += `**${field.name}** (${field.alias}) \n${field.type}`;
169903
169853
  if (field.description) {
169904
169854
  featureCompletionDescription += ` \n'${field.description}`;
169905
169855
  }
169906
169856
  // The property for the field
169907
- const type = fieldTypeToArcadeType(field);
169857
+ const type = fieldTypeToApiValueVarType(field);
169908
169858
  const insertText = getMemberExpressionProperty(field.name, false);
169909
169859
  const description = fieldAlias(field);
169910
169860
  fieldProfileValues.push({
@@ -169918,65 +169868,35 @@ async function featureToLSFeature(editorFeature, kind) {
169918
169868
  insertTextMode: main.exports.InsertTextMode.asIs,
169919
169869
  insertTextFormat: main.exports.InsertTextFormat.PlainText,
169920
169870
  kind: main.exports.CompletionItemKind.Field,
169921
- documentation: { kind: "markdown", value: fieldCompletionDescription },
169922
169871
  },
169923
169872
  });
169924
- if (!field.alias || field.alias.toLowerCase() === field.name.toLowerCase()) {
169925
- return;
169926
- }
169927
- // The property for the alias if different than the field name
169928
- let aliasCompletionDescription = `**${field.alias}** \n${field.type}`;
169929
- if (field.description) {
169930
- aliasCompletionDescription += ` \n'${field.description}`;
169873
+ if (includeAliases) {
169874
+ if (!field.alias || field.alias.toLowerCase() === field.name.toLowerCase()) {
169875
+ return;
169876
+ }
169877
+ // The property for the alias if different than the field name
169878
+ let aliasCompletionDescription = `**${field.alias}** \n${field.type}`;
169879
+ if (field.description) {
169880
+ aliasCompletionDescription += ` \n'${field.description}`;
169881
+ }
169882
+ aliasProfileValues.push({
169883
+ name: field.alias,
169884
+ description: field.name,
169885
+ type,
169886
+ completion: {
169887
+ label: field.alias,
169888
+ detail: field.name,
169889
+ insertText,
169890
+ insertTextMode: main.exports.InsertTextMode.asIs,
169891
+ insertTextFormat: main.exports.InsertTextFormat.PlainText,
169892
+ kind: main.exports.CompletionItemKind.Field,
169893
+ documentation: { kind: "markdown", value: aliasCompletionDescription },
169894
+ },
169895
+ });
169931
169896
  }
169932
- aliasProfileValues.push({
169933
- name: field.alias,
169934
- description: field.name,
169935
- type,
169936
- completion: {
169937
- label: field.alias,
169938
- detail: field.name,
169939
- insertText,
169940
- insertTextMode: main.exports.InsertTextMode.asIs,
169941
- insertTextFormat: main.exports.InsertTextFormat.PlainText,
169942
- kind: main.exports.CompletionItemKind.Field,
169943
- documentation: { kind: "markdown", value: aliasCompletionDescription },
169944
- },
169945
- });
169946
169897
  });
169947
- result.properties = [...fieldProfileValues, ...aliasProfileValues];
169948
- resultCompletion.documentation = { kind: "markdown", value: featureCompletionDescription };
169949
- return result;
169950
- }
169951
- async function dictionaryToLSDictionary(editorDictionary, kind) {
169952
- const { name, dictionaryVariables: variables } = editorDictionary;
169953
- const description = editorDictionary.getDescription();
169954
- const completionDescription = variables.reduce((previous, p) => {
169955
- if (previous !== "") {
169956
- previous += " \n \n";
169957
- }
169958
- previous += `**${p.name}** \n${p.type}`;
169959
- const description = p.getDescription();
169960
- if (description) {
169961
- previous += ` \n${description}`;
169962
- }
169963
- return previous;
169964
- }, description);
169965
- return {
169966
- name,
169967
- description,
169968
- type: "dictionary",
169969
- properties: await variablesToLSVariable(variables, main.exports.CompletionItemKind.Field),
169970
- completion: {
169971
- label: name,
169972
- detail: name,
169973
- insertText: name,
169974
- insertTextMode: main.exports.InsertTextMode.asIs,
169975
- insertTextFormat: main.exports.InsertTextFormat.PlainText,
169976
- kind,
169977
- documentation: { kind: "markdown", value: completionDescription },
169978
- },
169979
- };
169898
+ const properties = [...fieldProfileValues, ...aliasProfileValues];
169899
+ return [properties, featureCompletionDescription];
169980
169900
  }
169981
169901
  /**
169982
169902
  * Represents a item in the EditorProfile. The profile is converted into an optimized way for
@@ -170510,7 +170430,7 @@ class SourceBasedVariable extends CollectionBasedVariable {
170510
170430
  const relationshipsGroup = new GroupOfVariables(this._profile, { code: "relationships" });
170511
170431
  const relationshipItems = await Promise.all(source.relationships.map(async (relationship) => {
170512
170432
  const relatedLayer = await getRelatedFeatureLayer(source, relationship);
170513
- if (!isQueryableLayerInstance(relatedLayer)) {
170433
+ if (!isFeatureLayerLikeInstance(relatedLayer)) {
170514
170434
  return null;
170515
170435
  }
170516
170436
  if (relationship.relatedTableId === this.relationshipsProperties?.sourceTableId) {
@@ -170554,7 +170474,7 @@ class FeatureVariable extends SourceBasedVariable {
170554
170474
  throw new Error("Invalid definition");
170555
170475
  }
170556
170476
  // The title group and snippet
170557
- const title = isTitleCapableSource(this._source) ? this._source.title ?? "" : "";
170477
+ const title = isTitleCapableSource(this._source) ? (this._source.title ?? "") : "";
170558
170478
  this.variables.push(new GroupOfVariables(this._profile, title, [
170559
170479
  new ValueVariable({
170560
170480
  profile: this._profile,
@@ -170681,13 +170601,14 @@ class FeatureSetCollectionVariable extends CollectionBasedVariable {
170681
170601
  if (typeof this._featureSetCollections.source === "string") {
170682
170602
  return this._profile?.intlStrings.featureservice ?? "featureservice";
170683
170603
  }
170684
- if (isWebSceneInstance(this._featureSetCollections.source)) {
170685
- return this._profile?.intlStrings.webscene ?? "webscene";
170686
- }
170687
- if (isWebMapInstance(this._featureSetCollections.source)) {
170688
- return this._profile?.intlStrings.webmap ?? "webmap";
170604
+ switch (this._featureSetCollections.source.declaredClass) {
170605
+ case "esri.WebMap":
170606
+ return this._profile?.intlStrings.webmap ?? "webmap";
170607
+ case "esri.WebScene":
170608
+ return this._profile?.intlStrings.webscene ?? "webscene";
170609
+ default:
170610
+ return this._profile?.intlStrings.map ?? "map";
170689
170611
  }
170690
- return this._profile?.intlStrings.map ?? "map";
170691
170612
  }
170692
170613
  async loadSource() {
170693
170614
  if (isNotNull(this._loadPromise) && isNotUndefined(this._loadPromise)) {
@@ -170754,7 +170675,7 @@ class FeatureSetCollectionVariable extends CollectionBasedVariable {
170754
170675
  return null;
170755
170676
  }
170756
170677
  async _featureSetCollectionFromMap(map) {
170757
- if (isLoadableMapInstance(map)) {
170678
+ if (isLoadAllCapable(map)) {
170758
170679
  // Make sure the map is loaded
170759
170680
  await map.loadAll();
170760
170681
  }
@@ -170812,11 +170733,11 @@ class FeatureSetCollectionVariable extends CollectionBasedVariable {
170812
170733
  .toArray()
170813
170734
  .reverse()
170814
170735
  .forEach((layer) => {
170815
- if (isQueryableLayerInstance(layer)) {
170736
+ if (isFeatureLayerLikeInstance(layer)) {
170816
170737
  layerVariables.push(this._createFeatureSetVariable(layer, true));
170817
170738
  return;
170818
170739
  }
170819
- if (isGroupLayerInstance(layer)) {
170740
+ if (isGroupLayerCapable(layer)) {
170820
170741
  const groupLayerVariables = filteringTables
170821
170742
  ? this._convertWebMapLayersToVariables(layer.allTables, true)
170822
170743
  : this._convertWebMapLayersToVariables(layer.allLayers);
@@ -170825,31 +170746,31 @@ class FeatureSetCollectionVariable extends CollectionBasedVariable {
170825
170746
  });
170826
170747
  return layerVariables;
170827
170748
  }
170828
- _createFeatureSetVariable(featureLayer, isFromWebMap = false) {
170749
+ _createFeatureSetVariable(featureLayerLike, isFromWebMap = false) {
170829
170750
  return new FeatureSetVariable(this, {
170830
170751
  profile: this._profile,
170831
- declaration: { name: featureLayer.title, definition: featureLayer },
170752
+ declaration: { name: featureLayerLike.title, definition: featureLayerLike },
170832
170753
  label: isFromWebMap
170833
- ? featureLayer.title
170834
- : featureLayer.sourceJSON.name ?? featureLayer.title,
170754
+ ? featureLayerLike.title
170755
+ : (featureLayerLike.sourceJSON.name ?? featureLayerLike.title),
170835
170756
  description: "",
170836
170757
  nonInteractive: true,
170837
- }, this._makeFeatureSetSnippets(featureLayer, isFromWebMap));
170758
+ }, this._makeFeatureSetSnippets(featureLayerLike, isFromWebMap));
170838
170759
  }
170839
- _makeFeatureSetSnippets(featureLayer, isFromWebMap = false) {
170760
+ _makeFeatureSetSnippets(featureLayerLike, isFromWebMap = false) {
170840
170761
  if (!this._profile?.supportFeatureSetFunctions) {
170841
170762
  return [];
170842
170763
  }
170843
170764
  if (isFromWebMap) {
170844
- const snippetById = `FeatureSetById(${this.snippet}, "${featureLayer.id}")`;
170845
- const snippetByName = `FeatureSetByName(${this.snippet}, "${featureLayer.title}")`;
170765
+ const snippetById = `FeatureSetById(${this.snippet}, "${featureLayerLike.id}")`;
170766
+ const snippetByName = `FeatureSetByName(${this.snippet}, "${featureLayerLike.title}")`;
170846
170767
  return [
170847
170768
  new ValueVariable({ profile: this._profile, label: snippetById, description: "", snippet: snippetById }),
170848
170769
  new ValueVariable({ profile: this._profile, label: snippetByName, description: "", snippet: snippetByName }),
170849
170770
  ];
170850
170771
  }
170851
170772
  else {
170852
- const snippetById = `FeatureSetById(${this.snippet}, "${featureLayer.layerId}")`;
170773
+ const snippetById = `FeatureSetById(${this.snippet}, "${featureLayerLike.layerId}")`;
170853
170774
  return [new ValueVariable({ profile: this._profile, label: snippetById, description: "", snippet: snippetById })];
170854
170775
  }
170855
170776
  }
@@ -170887,14 +170808,6 @@ class EditorProfile extends DictionaryVariable {
170887
170808
  get supportFeatureSetFunctions() {
170888
170809
  return this.definition?.bundles?.includes("data-access") ?? false;
170889
170810
  }
170890
- /**
170891
- * Returns the language service profile. It is different than the editor profile as it is optimized for Monaco.
170892
- */
170893
- async toLSProfile() {
170894
- const { apiVersion, bundles, hiddenApiItems } = this.definition ?? {};
170895
- const variables = await variablesToLSVariable(this.dictionaryVariables);
170896
- return { apiVersion, bundles, variables, hiddenApiItems: hiddenApiItems?.map((s) => s.toLowerCase()) };
170897
- }
170898
170811
  /**
170899
170812
  * Returns the EditorProfile as a json. The EditorProfile may have been updated. This function allows to
170900
170813
  * get the new json representing mutations.
@@ -170908,144 +170821,6 @@ class EditorProfile extends DictionaryVariable {
170908
170821
  }
170909
170822
  //#endregion
170910
170823
 
170911
- function isFeatureDefinition(item) {
170912
- return isUrlDefinition(item) || isFieldsDefinition(item) || isFeatureLayerItemDefinition(item);
170913
- }
170914
- function isFeatureSetDefinition(item) {
170915
- return isUrlDefinition(item) || isFieldsDefinition(item) || isFeatureLayerItemDefinition(item);
170916
- }
170917
- function isFeatureSetCollectionDefinition(item) {
170918
- return isPortalItemDefinition(item) || isMapInstance(item) || isSupportedServiceUrlDefinition(item);
170919
- }
170920
- /**
170921
- * Get a PredefinedProfile for a locale. If not already loaded then fetch it.
170922
- * If the locale doesn't exist or the locale profile file doesn't exist then returns
170923
- * the english version of the profile.
170924
- */
170925
- async function getSdkPredefinedProfiles(locale = "en") {
170926
- const profiles = sdkPredefinedProfilesMap.get(locale);
170927
- if (profiles) {
170928
- return profiles;
170929
- }
170930
- if (!supportedLocales.has(locale)) {
170931
- return await getSdkPredefinedProfiles("en");
170932
- }
170933
- try {
170934
- const response = await fetch(index.getAssetPath(`./assets/arcade-language/profiles/arcade-profiles.t9n.${locale}.json`));
170935
- if (response.ok) {
170936
- return cacheSdkPredefinedProfiles(locale, (await response.json()));
170937
- }
170938
- if (locale === "en") {
170939
- return null;
170940
- }
170941
- return await getSdkPredefinedProfiles("en");
170942
- }
170943
- catch {
170944
- return null;
170945
- }
170946
- }
170947
- const sdkPredefinedProfilesMap = new Map();
170948
- /**
170949
- * Convert a stored profile into a PredefinedProfile and add it to the in-memory
170950
- * Map of profiles per locale.
170951
- */
170952
- function cacheSdkPredefinedProfiles(locale, profiles) {
170953
- const map = new Map();
170954
- profiles.forEach((profile) => {
170955
- map.set(profile.id, profile);
170956
- });
170957
- sdkPredefinedProfilesMap.set(locale, map);
170958
- return map;
170959
- }
170960
- async function getSdkPredefinedProfile(id, locale = "en") {
170961
- const profiles = await getSdkPredefinedProfiles(locale);
170962
- return profiles?.get(id) ?? null;
170963
- }
170964
- function isExtendedPredefinedProfileDefinition(item) {
170965
- return !!item && typeof item === "object" && "additionalVariables" in item && Array.isArray(item.additionalVariables);
170966
- }
170967
- function convertApiVariables(variables) {
170968
- return variables?.map(convertApiVariable);
170969
- }
170970
- function convertApiVariable(variable) {
170971
- switch (variable.type) {
170972
- case "dictionary":
170973
- return {
170974
- ...variable,
170975
- type: variable.type,
170976
- properties: convertApiVariables(variable.properties),
170977
- };
170978
- case "array": {
170979
- return {
170980
- ...variable,
170981
- type: variable.type,
170982
- elementType: { type: "number", name: "number" },
170983
- };
170984
- }
170985
- default:
170986
- return { ...variable, type: variable.type };
170987
- }
170988
- }
170989
- async function convertToEditorProfileDefinition(predefinedProfile, locale = "en") {
170990
- if (!isPredefinedProfile(predefinedProfile)) {
170991
- return undefined;
170992
- }
170993
- const sdkPredefinedProfile = await getSdkPredefinedProfile(predefinedProfile.id, locale);
170994
- if (!sdkPredefinedProfile) {
170995
- return undefined;
170996
- }
170997
- const editorProfile = {
170998
- bundles: [...sdkPredefinedProfile.bundles],
170999
- variables: [],
171000
- hiddenApiItems: predefinedProfile.hiddenApiItems?.map((s) => s.toLowerCase()),
171001
- };
171002
- // Merge the SDK variables' definitions/properties with the predefined profile definitions.
171003
- sdkPredefinedProfile.variables.forEach((predefinedVariable) => {
171004
- // Don't include disabled variables
171005
- if (predefinedProfile.disabledVariables?.includes(predefinedVariable.name)) {
171006
- return;
171007
- }
171008
- // Try to get a definition from the predefined profile, for the variable that needs one.
171009
- const definition = predefinedProfile.definitions[predefinedVariable.name];
171010
- // Note: Something is weird with TS. The sdkVariables are being casted to the wrong type
171011
- // despite the type checking from the switch statement.
171012
- switch (predefinedVariable.type) {
171013
- case "dictionary": {
171014
- // For dictionary, we support properties overrride
171015
- return editorProfile.variables.push(convertApiVariable({
171016
- ...predefinedVariable,
171017
- type: predefinedVariable.type,
171018
- properties: Array.isArray(definition) ? [...definition] : predefinedVariable.properties,
171019
- }));
171020
- }
171021
- case "feature":
171022
- // If the definition is not valid, then we don't include it.
171023
- if (!isFeatureDefinition(definition)) {
171024
- return;
171025
- }
171026
- return editorProfile.variables.push({ ...predefinedVariable, type: predefinedVariable.type, definition });
171027
- case "featureSet":
171028
- // If the definition is not valid, then we don't include it.
171029
- if (!isFeatureSetDefinition(definition)) {
171030
- return;
171031
- }
171032
- return editorProfile.variables.push({ ...predefinedVariable, type: predefinedVariable.type, definition });
171033
- case "featureSetCollection":
171034
- // If the definition is not valid, then we don't include it.
171035
- if (!isFeatureSetCollectionDefinition(definition)) {
171036
- return;
171037
- }
171038
- return editorProfile.variables.push({ ...predefinedVariable, type: predefinedVariable.type, definition });
171039
- default:
171040
- return editorProfile.variables.push(convertApiVariable(predefinedVariable));
171041
- }
171042
- });
171043
- if (isExtendedPredefinedProfileDefinition(predefinedProfile)) {
171044
- editorProfile.variables.push(...(predefinedProfile.additionalVariables ?? []));
171045
- }
171046
- return editorProfile;
171047
- }
171048
-
171049
170824
  // this file contains the building blocks for a language default provider
171050
170825
  const defaultContext = {
171051
170826
  locale: "en",
@@ -171144,12 +170919,12 @@ exports.Range = Range;
171144
170919
  exports.Uri = Uri;
171145
170920
  exports.addLTRMark = addLTRMark;
171146
170921
  exports.commonjsGlobal = commonjsGlobal;
171147
- exports.convertToEditorProfileDefinition = convertToEditorProfileDefinition;
171148
170922
  exports.createFilterExpression = createFilterExpression;
171149
170923
  exports.debounce = debounce;
171150
170924
  exports.devToolsAwareTimeout = devToolsAwareTimeout;
171151
170925
  exports.editor = editor;
171152
170926
  exports.fetchT9nStringsBundle = fetchT9nStringsBundle;
170927
+ exports.fieldsToProfileValues = fieldsToProfileValues;
171153
170928
  exports.filterCollection = filterCollection;
171154
170929
  exports.generateGuid = generateGuid;
171155
170930
  exports.generateTokensCSSForColorMap = generateTokensCSSForColorMap;
@@ -171157,7 +170932,10 @@ exports.getElementLocales = getElementLocales;
171157
170932
  exports.getElementTheme = getElementTheme;
171158
170933
  exports.hasSameOrigin = hasSameOrigin;
171159
170934
  exports.importArcade = importArcade;
170935
+ exports.importCoreSql = importCoreSql;
171160
170936
  exports.importRequest = importRequest;
170937
+ exports.isFeatureDefinition = isFeatureDefinition;
170938
+ exports.isFeatureSetCollectionDefinition = isFeatureSetCollectionDefinition;
171161
170939
  exports.isFeatureSetDefinition = isFeatureSetDefinition;
171162
170940
  exports.isNotUndefined = isNotUndefined;
171163
170941
  exports.isPredefinedProfile = isPredefinedProfile;
@@ -171165,6 +170943,7 @@ exports.isURL = isURL;
171165
170943
  exports.languages = languages;
171166
170944
  exports.main = main;
171167
170945
  exports.monaco_editor_core_star = monaco_editor_core_star;
170946
+ exports.newLayersSupportFieldsIndex = newLayersSupportFieldsIndex;
171168
170947
  exports.observeAncestorsMutation = observeAncestorsMutation;
171169
170948
  exports.quoteString = quoteString;
171170
170949
  exports.safeAsyncCall = safeAsyncCall;
@@ -171173,4 +170952,5 @@ exports.setFocusOnElement = setFocusOnElement;
171173
170952
  exports.setValuesInString = setValuesInString;
171174
170953
  exports.startLocaleObserver = startLocaleObserver;
171175
170954
  exports.supportedFields = supportedFields;
170955
+ exports.supportedLocales = supportedLocales;
171176
170956
  exports.typescriptDefaults = typescriptDefaults;