@arcgis/lumina 4.33.0-next.94 → 4.33.0-next.95

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 (43) hide show
  1. package/dist/ControllerManager-B2comd8J.js +310 -0
  2. package/dist/LitElement.d.ts +3 -3
  3. package/dist/context.d.ts +1 -1
  4. package/dist/controllers/ComponentInternals.d.ts +92 -0
  5. package/dist/controllers/Controller.d.ts +152 -0
  6. package/dist/controllers/ControllerInternals.d.ts +52 -0
  7. package/dist/controllers/ControllerManager.d.ts +63 -0
  8. package/dist/controllers/accessor/index.d.ts +2 -0
  9. package/dist/controllers/accessor/index.js +1045 -0
  10. package/dist/controllers/accessor/reEmitEvent.d.ts +14 -0
  11. package/dist/controllers/accessor/useAccessor.d.ts +75 -0
  12. package/dist/controllers/framework.d.ts +45 -0
  13. package/dist/controllers/functional.d.ts +19 -0
  14. package/dist/controllers/getSet.d.ts +116 -0
  15. package/dist/controllers/index.d.ts +23 -0
  16. package/dist/controllers/index.js +283 -0
  17. package/dist/controllers/load.d.ts +6 -0
  18. package/dist/controllers/proxyExports.d.ts +27 -0
  19. package/dist/controllers/readonly.d.ts +29 -0
  20. package/dist/controllers/tests/autoDestroyMock.d.ts +5 -0
  21. package/dist/controllers/tests/utils.d.ts +1 -0
  22. package/dist/controllers/toFunction.d.ts +8 -0
  23. package/dist/controllers/trackKey.d.ts +8 -0
  24. package/dist/controllers/trackPropKey.d.ts +21 -0
  25. package/dist/controllers/trackPropertyKey.d.ts +28 -0
  26. package/dist/controllers/types.d.ts +182 -0
  27. package/dist/controllers/useDirection.d.ts +11 -0
  28. package/dist/controllers/useMedia.d.ts +8 -0
  29. package/dist/controllers/usePropertyChange.d.ts +11 -0
  30. package/dist/controllers/useT9n.d.ts +48 -0
  31. package/dist/controllers/useWatch.d.ts +27 -0
  32. package/dist/controllers/useWatchAttributes.d.ts +7 -0
  33. package/dist/controllers/utils.d.ts +15 -0
  34. package/dist/createEvent.d.ts +1 -1
  35. package/dist/decorators.d.ts +1 -1
  36. package/dist/index.d.ts +2 -2
  37. package/dist/index.js +5 -42
  38. package/dist/lazyLoad.d.ts +2 -2
  39. package/dist/makeRuntime.d.ts +109 -0
  40. package/dist/proxyExports-Dl5CHmHQ.js +150 -0
  41. package/dist/runtime.d.ts +4 -107
  42. package/dist/useWatch-CFtSpNnN.js +925 -0
  43. package/package.json +4 -3
@@ -0,0 +1,1045 @@
1
+ import { n as devOnlySetPersistentControllerData, o as devOnlyGetPersistentControllerData, G as GenericController, f as trackPropKey, t as trackKey, r as retrieveComponent, d as createEventFactory } from "../../useWatch-CFtSpNnN.js";
2
+ import { p as proxyExports, a as bypassGetter, c as bypassSetter } from "../../proxyExports-Dl5CHmHQ.js";
3
+ import { isEsriInternalEnv, camelToKebab, isNotUndefined } from "@arcgis/components-utils";
4
+ const n$3 = { remove: () => {
5
+ } };
6
+ function e$6(e3) {
7
+ return e3 ? { remove() {
8
+ e3 && (e3(), e3 = void 0);
9
+ } } : n$3;
10
+ }
11
+ function n$2(e3) {
12
+ return t$6(e3) || r$4(e3);
13
+ }
14
+ function t$6(e3) {
15
+ return null != e3 && "object" == typeof e3 && "on" in e3 && "function" == typeof e3.on;
16
+ }
17
+ function r$4(e3) {
18
+ return null != e3 && "object" == typeof e3 && "addEventListener" in e3 && "function" == typeof e3.addEventListener;
19
+ }
20
+ function o$6(e3, t4, o2) {
21
+ if (!n$2(e3)) throw new TypeError("target is not a Evented or EventTarget object");
22
+ return r$4(e3) ? i$4(e3, t4, o2) : e3.on(t4, o2);
23
+ }
24
+ function i$4(n2, t4, r2, o2) {
25
+ if (Array.isArray(t4)) {
26
+ const i3 = t4.slice();
27
+ for (const e3 of i3) n2.addEventListener(e3, r2, o2);
28
+ return e$6(() => {
29
+ for (const e3 of i3) n2.removeEventListener(e3, r2, o2);
30
+ });
31
+ }
32
+ return n2.addEventListener(t4, r2, o2), e$6(() => n2.removeEventListener(t4, r2, o2));
33
+ }
34
+ function l$3(n2) {
35
+ return n2?.remove(), null;
36
+ }
37
+ let e$5;
38
+ function has(a2) {
39
+ return "function" == typeof e$5[a2] ? e$5[a2] = e$5[a2](globalThis) : e$5[a2];
40
+ }
41
+ e$5 = globalThis.dojoConfig?.has || globalThis.esriConfig?.has ? { ...globalThis.dojoConfig?.has, ...globalThis.esriConfig?.has } : {}, has.add = (a2, d, i3, o2) => {
42
+ (o2 || void 0 === e$5[a2]) && (e$5[a2] = d), i3 && has(a2);
43
+ }, has.cache = e$5, has.add("big-integer-warning-enabled", true), has.add("esri-deprecation-warnings", true), has.add("esri-tests-disable-screenshots", false), has.add("esri-tests-use-full-window", false), has.add("esri-tests-post-to-influx", true), has.add("esri-cim-animations-enable-status", "enabled"), has.add("esri-cim-animations-spotlight", false), has.add("esri-cim-animations-freeze-time", false), (() => {
44
+ has.add("host-webworker", void 0 !== globalThis.WorkerGlobalScope && self instanceof globalThis.WorkerGlobalScope);
45
+ const e3 = "undefined" != typeof window && "undefined" != typeof location && "undefined" != typeof document && window.location === location && window.document === document;
46
+ if (has.add("host-browser", e3), has.add("host-node", "object" == typeof globalThis.process && globalThis.process.versions?.node && globalThis.process.versions.v8), has.add("dom", e3), has("host-browser")) {
47
+ const e4 = navigator, a2 = e4.userAgent, d = e4.appVersion, i3 = parseFloat(d);
48
+ if (has.add("wp", parseFloat(a2.split("Windows Phone")[1]) || void 0), has.add("msapp", parseFloat(a2.split("MSAppHost/")[1]) || void 0), has.add("khtml", d.includes("Konqueror") ? i3 : void 0), has.add("edge", parseFloat(a2.split("Edge/")[1]) || void 0), has.add("opr", parseFloat(a2.split("OPR/")[1]) || void 0), has.add("webkit", !has("wp") && !has("edge") && parseFloat(a2.split("WebKit/")[1]) || void 0), has.add("chrome", !has("edge") && !has("opr") && parseFloat(a2.split("Chrome/")[1]) || void 0), has.add("android", !has("wp") && parseFloat(a2.split("Android ")[1]) || void 0), has.add("safari", !d.includes("Safari") || has("wp") || has("chrome") || has("android") || has("edge") || has("opr") ? void 0 : parseFloat(d.split("Version/")[1])), has.add("mac", d.includes("Macintosh")), !has("wp") && /(iPhone|iPod|iPad)/.test(a2)) {
49
+ const e5 = RegExp.$1.replace(/P/, "p"), d2 = /OS ([\d_]+)/.test(a2) ? RegExp.$1 : "1", i4 = parseFloat(d2.replace(/_/, ".").replaceAll("_", ""));
50
+ has.add(e5, i4), has.add("ios", i4);
51
+ }
52
+ has("webkit") || (!a2.includes("Gecko") || has("wp") || has("khtml") || has("edge") || has.add("mozilla", i3), has("mozilla") && has.add("ff", parseFloat(a2.split("Firefox/")[1] || a2.split("Minefield/")[1]) || void 0));
53
+ }
54
+ })(), (() => {
55
+ if (globalThis.navigator) {
56
+ const e3 = navigator.userAgent, a2 = /Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini|IEMobile/i.test(e3), d = /iPhone/i.test(e3);
57
+ a2 && has.add("esri-mobile", a2), d && has.add("esri-iPhone", d), has.add("esri-geolocation", !!navigator.geolocation);
58
+ }
59
+ has.add("esri-wasm", "WebAssembly" in globalThis), has.add("esri-performance-mode-frames-between-render", 20), has.add("esri-force-performance-mode", false), has.add("esri-shared-array-buffer", () => {
60
+ const e3 = "SharedArrayBuffer" in globalThis, a2 = false === globalThis.crossOriginIsolated;
61
+ return e3 && !a2;
62
+ }), has.add("wasm-simd", () => {
63
+ const e3 = [0, 97, 115, 109, 1, 0, 0, 0, 1, 5, 1, 96, 0, 1, 123, 3, 2, 1, 0, 10, 10, 1, 8, 0, 65, 0, 253, 15, 253, 98, 11];
64
+ return WebAssembly.validate(new Uint8Array(e3));
65
+ }), has.add("esri-atomics", "Atomics" in globalThis), has.add("esri-workers", "Worker" in globalThis), has.add("web-feat:cache", "caches" in globalThis), has.add("esri-workers-arraybuffer-transfer", !has("safari") || Number(has("safari")) >= 12), has.add("workers-pool-size", 8), has.add("featurelayer-simplify-thresholds", [0.5, 0.5, 0.5, 0.5]), has.add("featurelayer-simplify-payload-size-factors", [1, 1, 4]), has.add("featurelayer-fast-triangulation-enabled", true), has.add("featurelayer-animation-enabled", true), has.add("featurelayer-snapshot-enabled", true), has.add("featurelayer-snapshot-point-min-threshold", 8e4), has.add("featurelayer-snapshot-point-max-threshold", 4e5), has.add("featurelayer-snapshot-point-coverage", 0.1), has.add("featurelayer-query-max-depth", 4), has.add("featurelayer-query-pausing-enabled", false), has.add("featurelayer-advanced-symbols", false), has.add("featurelayer-pbf", true), has.add("featurelayer-pbf-statistics", false), has.add("feature-layers-workers", true), has.add("feature-polyline-generalization-factor", 1), has.add("mapview-transitions-duration", 200), has.add("mapview-essential-goto-duration", 200), has.add("mapview-srswitch-adjust-rotation-scale-threshold", 24e6), has.add("mapserver-pbf-version-support", 10.81), has.add("mapservice-popup-identify-max-tolerance", 20), has.add("request-queue-concurrency-hosted", 16), has.add("request-queue-concurrency-non-hosted", 4), has.add("curve-densification-coarse-segments", 128), has.add("curve-densification-max-segments", 2e3), has.add("curve-densification-min-segments", 3), has.add("curve-densification-pixel-deviation", 0.5), has.add("view-readyState-waiting-delay", 1e3), has.add("gradient-depth-bias", 0.01), has.add("gradient-depth-epsilon", 1e-8), has.add("enable-feature:esri-compress-textures", true), has("host-webworker") || has("host-browser") && (has.add("esri-csp-restrictions", () => {
66
+ try {
67
+ new Function();
68
+ } catch {
69
+ return true;
70
+ }
71
+ return false;
72
+ }), has.add("esri-image-decode", () => {
73
+ if ("decode" in new Image()) {
74
+ const e3 = new Image();
75
+ return e3.src = 'data:image/svg+xml;charset=UTF-8,<svg version="1.1" xmlns="http://www.w3.org/2000/svg"></svg>', void e3.decode().then(() => {
76
+ has.add("esri-image-decode", true, true, true);
77
+ }).catch(() => {
78
+ has.add("esri-image-decode", false, true, true);
79
+ });
80
+ }
81
+ return false;
82
+ }), has.add("esri-url-encodes-apostrophe", () => {
83
+ const e3 = window.document.createElement("a");
84
+ return e3.href = "?'", e3.href.includes("?%27");
85
+ }));
86
+ })();
87
+ let t$5 = class t {
88
+ static {
89
+ this._m = 2147483647;
90
+ }
91
+ static {
92
+ this._a = 48271;
93
+ }
94
+ static {
95
+ this._c = 0;
96
+ }
97
+ constructor(t4 = 1) {
98
+ this._seed = t4;
99
+ }
100
+ set seed(e3) {
101
+ this._seed = e3 ?? Math.random() * t._m;
102
+ }
103
+ getInt() {
104
+ return this._seed = (t._a * this._seed + t._c) % t._m, this._seed;
105
+ }
106
+ getFloat() {
107
+ return this.getInt() / (t._m - 1);
108
+ }
109
+ getIntRange(t4, e3) {
110
+ return Math.round(this.getFloatRange(t4, e3));
111
+ }
112
+ getFloatRange(e3, s5) {
113
+ const a2 = s5 - e3;
114
+ return e3 + this.getInt() / t._m * a2;
115
+ }
116
+ };
117
+ function s$6(n2, t4, e3) {
118
+ if (null == n2 && null == t4) return true;
119
+ if (null == n2 || null == t4 || n2.length !== t4.length) return false;
120
+ for (let r2 = 0; r2 < n2.length; r2++) if (n2[r2] !== t4[r2]) return false;
121
+ return true;
122
+ }
123
+ function r$3(n2) {
124
+ return "Int8Array" === n2?.constructor?.name;
125
+ }
126
+ function t$4(n2) {
127
+ return "Uint8Array" === n2?.constructor?.name;
128
+ }
129
+ function o$5(n2) {
130
+ return "Uint8ClampedArray" === n2?.constructor?.name;
131
+ }
132
+ function u$1(n2) {
133
+ return "Int16Array" === n2?.constructor?.name;
134
+ }
135
+ function c$3(n2) {
136
+ return "Uint16Array" === n2?.constructor?.name;
137
+ }
138
+ function e$4(n2) {
139
+ return "Int32Array" === n2?.constructor?.name;
140
+ }
141
+ function a$3(n2) {
142
+ return "Uint32Array" === n2?.constructor?.name;
143
+ }
144
+ function f$4(n2) {
145
+ return "Float32Array" === n2?.constructor?.name;
146
+ }
147
+ function s$5(n2) {
148
+ return "Float64Array" === n2?.constructor?.name;
149
+ }
150
+ function a$2(t4) {
151
+ if (!t4 || "object" != typeof t4 || "function" == typeof t4) return t4;
152
+ const n2 = O(t4);
153
+ if (null != n2) return n2;
154
+ if (y$2(t4)) return t4.clone();
155
+ if (b(t4)) return t4.map(a$2);
156
+ if (m$3(t4)) throw new Error("Trying to clone an unclonable Accessor instance");
157
+ const e3 = {};
158
+ for (const r2 of Object.getOwnPropertyNames(t4)) e3[r2] = a$2(t4[r2]);
159
+ return e3;
160
+ }
161
+ function y$2(t4) {
162
+ return "function" == typeof t4.clone;
163
+ }
164
+ function b(t4) {
165
+ return "function" == typeof t4.map && "function" == typeof t4.forEach;
166
+ }
167
+ function m$3(t4) {
168
+ return "function" == typeof t4.notifyChange && "function" == typeof t4.watch;
169
+ }
170
+ function g$2(t4) {
171
+ if ("[object Object]" !== Object.prototype.toString.call(t4)) return false;
172
+ const n2 = Object.getPrototypeOf(t4);
173
+ return null === n2 || n2 === Object.prototype;
174
+ }
175
+ function O(t4) {
176
+ if (r$3(t4) || t$4(t4) || o$5(t4) || u$1(t4) || c$3(t4) || e$4(t4) || a$3(t4) || f$4(t4) || s$5(t4)) return t4.slice();
177
+ if (t4 instanceof Date) return new Date(t4.getTime());
178
+ if (t4 instanceof ArrayBuffer) {
179
+ return t4.slice(0, t4.byteLength);
180
+ }
181
+ if (t4 instanceof Map) {
182
+ const n2 = /* @__PURE__ */ new Map();
183
+ for (const [e3, r2] of t4) n2.set(e3, a$2(r2));
184
+ return n2;
185
+ }
186
+ if (t4 instanceof Set) {
187
+ const n2 = /* @__PURE__ */ new Set();
188
+ for (const e3 of t4) n2.add(a$2(e3));
189
+ return n2;
190
+ }
191
+ return null;
192
+ }
193
+ function j(t4, n2) {
194
+ return t4 === n2 || "number" == typeof t4 && isNaN(t4) && "number" == typeof n2 && isNaN(n2) || "function" == typeof t4?.getTime && "function" == typeof n2?.getTime && t4.getTime() === n2.getTime() || false;
195
+ }
196
+ function h$1(n2, e3) {
197
+ return n2 === e3 || (null == n2 || "string" == typeof n2 ? n2 === e3 : "number" == typeof n2 ? n2 === e3 || "number" == typeof e3 && isNaN(n2) && isNaN(e3) : n2 instanceof Date ? e3 instanceof Date && n2.getTime() === e3.getTime() : Array.isArray(n2) ? Array.isArray(e3) && s$6(n2, e3) : n2 instanceof Set ? e3 instanceof Set && T(n2, e3) : n2 instanceof Map ? e3 instanceof Map && N(n2, e3) : !!g$2(n2) && (g$2(e3) && w$1(n2, e3)));
198
+ }
199
+ function w$1(t4, n2) {
200
+ if (null === t4 || null === n2) return false;
201
+ const e3 = Object.keys(t4);
202
+ if (null === n2 || Object.keys(n2).length !== e3.length) return false;
203
+ for (const r2 of e3) if (t4[r2] !== n2[r2] || !Object.prototype.hasOwnProperty.call(n2, r2)) return false;
204
+ return true;
205
+ }
206
+ function T(t4, n2) {
207
+ if (t4.size !== n2.size) return false;
208
+ for (const e3 of t4) if (!n2.has(e3)) return false;
209
+ return true;
210
+ }
211
+ function N(t4, n2) {
212
+ if (t4.size !== n2.size) return false;
213
+ for (const [e3, r2] of t4) {
214
+ const t5 = n2.get(e3);
215
+ if (t5 !== r2 || void 0 === t5 && !n2.has(e3)) return false;
216
+ }
217
+ return true;
218
+ }
219
+ function n$1(r2, n2, t4 = false) {
220
+ return f$3(r2, n2, t4);
221
+ }
222
+ function f$3(n2, t4, e3) {
223
+ return t4 ? Object.keys(t4).reduce((n3, i3) => {
224
+ let u2 = n3[i3], l2 = t4[i3];
225
+ return u2 === l2 ? n3 : void 0 === u2 ? (n3[i3] = a$2(l2), n3) : (Array.isArray(l2) || Array.isArray(n3) ? (u2 = u2 ? Array.isArray(u2) ? n3[i3] = u2.slice() : n3[i3] = [u2] : n3[i3] = [], l2 && (Array.isArray(l2) || (l2 = [l2]), e3 ? l2.forEach((r2) => {
226
+ u2.includes(r2) || u2.push(r2);
227
+ }) : n3[i3] = l2.slice())) : l2 && "object" == typeof l2 ? n3[i3] = f$3(u2, l2, e3) : n3.hasOwnProperty(i3) && !t4.hasOwnProperty(i3) || (n3[i3] = l2), n3);
228
+ }, n2 || {}) : n2;
229
+ }
230
+ const a$1 = "20250423";
231
+ const s$4 = { apiKey: void 0, applicationName: "", applicationUrl: globalThis.location?.href, assetsPath: "", fontsUrl: "https://static.arcgis.com/fonts", geometryServiceUrl: "https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer", geoRSSServiceUrl: "https://utility.arcgis.com/sharing/rss", kmlServiceUrl: "https://utility.arcgis.com/sharing/kml", userPrivilegesApplied: true, portalUrl: "https://www.arcgis.com", respectPrefersReducedMotion: true, routeServiceUrl: "https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World", workers: { loaderConfig: { has: {}, paths: {}, map: {}, packages: [] } }, request: { crossOriginNoCorsDomains: null, httpsDomains: ["arcgis.com", "arcgisonline.com", "esrikr.com", "premiumservices.blackbridge.com", "esripremium.accuweather.com", "gbm.digitalglobe.com", "firstlook.digitalglobe.com", "msi.digitalglobe.com"], interceptors: [], internalInterceptors: [], maxUrlLength: 2e3, priority: "high", proxyRules: [], proxyUrl: null, timeout: 62e3, trustedServers: [], useIdentity: true }, log: { interceptors: [], level: null } };
232
+ if (globalThis.esriConfig && (n$1(s$4, globalThis.esriConfig, true), delete s$4.has), !s$4.assetsPath) {
233
+ {
234
+ const e3 = "4.33.0";
235
+ s$4.assetsPath = `https://cdn.jsdelivr.net/npm/@arcgis/core@${e3}-next.${a$1}/assets`;
236
+ }
237
+ s$4.defaultAssetsPath = s$4.assetsPath;
238
+ }
239
+ function l$2(t4) {
240
+ let e3 = 0;
241
+ for (let n2 = 0; n2 < t4.length; n2++) e3 = (e3 << 5) - e3 + t4.charCodeAt(n2), e3 |= 0;
242
+ return e3;
243
+ }
244
+ const r$2 = { info: 0, warn: 1, error: 2, none: 3 };
245
+ let i$3 = class i {
246
+ constructor(e3) {
247
+ this.level = null, this._module = "", this._parent = null, this.writer = null, this._loggedMessages = { error: /* @__PURE__ */ new Map(), warn: /* @__PURE__ */ new Map(), info: /* @__PURE__ */ new Map() }, null != e3.level && (this.level = e3.level), null != e3.writer && (this.writer = e3.writer), this._module = e3.module, i._loggers.set(this.module, this);
248
+ const t4 = this.module.lastIndexOf(".");
249
+ -1 !== t4 && (this._parent = i.getLogger(this.module.slice(0, t4)));
250
+ }
251
+ get module() {
252
+ return this._module;
253
+ }
254
+ get parent() {
255
+ return this._parent;
256
+ }
257
+ error(...e3) {
258
+ this._log("error", "always", ...e3);
259
+ }
260
+ warn(...e3) {
261
+ this._log("warn", "always", ...e3);
262
+ }
263
+ info(...e3) {
264
+ this._log("info", "always", ...e3);
265
+ }
266
+ errorOnce(...e3) {
267
+ this._log("error", "once", ...e3);
268
+ }
269
+ warnOnce(...e3) {
270
+ this._log("warn", "once", ...e3);
271
+ }
272
+ infoOnce(...e3) {
273
+ this._log("info", "once", ...e3);
274
+ }
275
+ errorOncePerTick(...e3) {
276
+ this._log("error", "oncePerTick", ...e3);
277
+ }
278
+ warnOncePerTick(...e3) {
279
+ this._log("warn", "oncePerTick", ...e3);
280
+ }
281
+ infoOncePerTick(...e3) {
282
+ this._log("info", "oncePerTick", ...e3);
283
+ }
284
+ get test() {
285
+ }
286
+ static get test() {
287
+ }
288
+ static getLogger(e3) {
289
+ return e3 = "string" != typeof e3 ? e3.declaredClass : e3, i._loggers.get(e3) || new i({ module: e3 });
290
+ }
291
+ static {
292
+ this._loggers = /* @__PURE__ */ new Map();
293
+ }
294
+ static {
295
+ this._tickCounter = 0;
296
+ }
297
+ static {
298
+ this._tickCounterScheduled = false;
299
+ }
300
+ static {
301
+ this._throttlingDisabled = false;
302
+ }
303
+ _log(t4, r2, ...n2) {
304
+ if (!this._matchLevel(t4)) return;
305
+ if ("always" !== r2 && !i._throttlingDisabled) {
306
+ const e3 = o$4(n2), s5 = this._loggedMessages[t4].get(e3);
307
+ if ("once" === r2 && null != s5 || "oncePerTick" === r2 && s5 && s5 >= i._tickCounter) return;
308
+ this._loggedMessages[t4].set(e3, i._tickCounter), i._scheduleTickCounterIncrement();
309
+ }
310
+ for (const i3 of s$4.log.interceptors) if (i3(t4, this.module, ...n2)) return;
311
+ this._inheritedWriter()(t4, this.module, ...n2);
312
+ }
313
+ _parentWithMember(e3, t4) {
314
+ let r2 = this;
315
+ for (; null != r2; ) {
316
+ const t5 = r2[e3];
317
+ if (null != t5) return t5;
318
+ r2 = r2.parent;
319
+ }
320
+ return t4;
321
+ }
322
+ _inheritedWriter() {
323
+ return this._parentWithMember("writer", n);
324
+ }
325
+ _matchLevel(t4) {
326
+ const i3 = s$4.log.level || "warn";
327
+ return r$2[this._parentWithMember("level", i3)] <= r$2[t4];
328
+ }
329
+ static _scheduleTickCounterIncrement() {
330
+ i._tickCounterScheduled || (i._tickCounterScheduled = true, Promise.resolve().then(() => {
331
+ i._tickCounter++, i._tickCounterScheduled = false;
332
+ }));
333
+ }
334
+ };
335
+ function n(e3, t4, ...r2) {
336
+ console[e3](`[${t4}]`, ...r2);
337
+ }
338
+ function o$4(...e3) {
339
+ const r2 = (e4, t4) => "object" != typeof t4 || Array.isArray(t4) ? t4 : "[Object]";
340
+ return l$2(JSON.stringify(e3, r2));
341
+ }
342
+ function t$3(t4) {
343
+ return t4?.release && "function" == typeof t4.release;
344
+ }
345
+ function i$2(t4) {
346
+ return t4?.acquire && "function" == typeof t4.acquire;
347
+ }
348
+ let e$3 = class e {
349
+ constructor(t4, i3, e3, s5 = 1, o2 = 0) {
350
+ this._ctor = t4, this._acquireFunction = i3, this._releaseFunction = e3, this.allocationSize = s5, this._pool = new Array(o2), this._initialSize = o2;
351
+ for (let n2 = 0; n2 < o2; n2++) this._pool[n2] = new this._ctor();
352
+ this.allocationSize = Math.max(s5, 1);
353
+ }
354
+ destroy() {
355
+ this.prune(0);
356
+ }
357
+ acquire(...t4) {
358
+ let s5;
359
+ if (e.test.disabled) s5 = new this._ctor();
360
+ else {
361
+ if (0 === this._pool.length) {
362
+ const t5 = this.allocationSize;
363
+ for (let i3 = 0; i3 < t5; i3++) this._pool[i3] = new this._ctor();
364
+ }
365
+ s5 = this._pool.pop();
366
+ }
367
+ return this._acquireFunction ? this._acquireFunction(s5, ...t4) : i$2(s5) && s5.acquire(...t4), s5;
368
+ }
369
+ release(i3) {
370
+ i3 && !e.test.disabled && (this._releaseFunction ? this._releaseFunction(i3) : t$3(i3) && i3.release(), this._pool.push(i3));
371
+ }
372
+ prune(t4 = this._initialSize) {
373
+ if (!(t4 >= this._pool.length)) {
374
+ for (let i3 = t4; i3 < this._pool.length; ++i3) {
375
+ const t5 = this._pool[i3];
376
+ this._dispose(t5);
377
+ }
378
+ this._pool.length = t4;
379
+ }
380
+ }
381
+ _dispose(t4) {
382
+ t4.dispose && "function" == typeof t4.dispose && t4.dispose();
383
+ }
384
+ static {
385
+ this.test = { disabled: false };
386
+ }
387
+ };
388
+ function r$1(e3) {
389
+ e3.length = 0;
390
+ }
391
+ let t$2 = class t2 {
392
+ constructor(t4 = 50, o2 = 50) {
393
+ this._pool = new e$3(Array, void 0, r$1, o2, t4);
394
+ }
395
+ acquire() {
396
+ return this._pool.acquire();
397
+ }
398
+ release(e3) {
399
+ this._pool.release(e3);
400
+ }
401
+ prune() {
402
+ this._pool.prune(0);
403
+ }
404
+ static acquire() {
405
+ return o$3.acquire();
406
+ }
407
+ static release(e3) {
408
+ return o$3.release(e3);
409
+ }
410
+ static prune() {
411
+ o$3.prune();
412
+ }
413
+ };
414
+ const o$3 = new t$2(100);
415
+ let s$3 = class s extends e$3 {
416
+ constructor() {
417
+ super(...arguments), this._set = /* @__PURE__ */ new Set();
418
+ }
419
+ destroy() {
420
+ super.destroy(), this._set = null;
421
+ }
422
+ acquire(...e3) {
423
+ const s5 = super.acquire(...e3);
424
+ return this._set.delete(s5), s5;
425
+ }
426
+ release(e3) {
427
+ e3 && !this._set.has(e3) && (super.release(e3), this._set.add(e3));
428
+ }
429
+ _dispose(e3) {
430
+ this._set.delete(e3), super._dispose(e3);
431
+ }
432
+ };
433
+ const o$2 = [];
434
+ function t$1(t4) {
435
+ o$2.push(t4), 1 === o$2.length && queueMicrotask(() => {
436
+ const t5 = o$2.slice();
437
+ o$2.length = 0;
438
+ for (const o2 of t5) o2();
439
+ });
440
+ }
441
+ let s$2 = class s2 {
442
+ constructor(s5, t4 = 30) {
443
+ this.name = s5, this._counter = 0, this._samples = new Array(t4);
444
+ }
445
+ push(s5) {
446
+ null != s5 && (this._samples[++this._counter % this._samples.length] = s5);
447
+ }
448
+ set(s5) {
449
+ null != s5 && (this._samples[this._counter % this._samples.length] = s5);
450
+ }
451
+ get median() {
452
+ return this._samples.slice().sort((s5, t4) => s5 - t4)[Math.floor(this._samples.length / 2)];
453
+ }
454
+ get average() {
455
+ return this._samples.reduce((s5, t4) => s5 + t4, 0) / this._samples.length;
456
+ }
457
+ get last() {
458
+ return this._samples[this._counter % this._samples.length];
459
+ }
460
+ };
461
+ var o$1;
462
+ !function(o2) {
463
+ const t4 = (o3, t5, n3, e4) => {
464
+ let i4 = t5, c3 = t5;
465
+ const l2 = n3 >>> 1, r2 = o3[i4 - 1];
466
+ for (; c3 <= l2; ) {
467
+ c3 = i4 << 1, c3 < n3 && e4(o3[c3 - 1], o3[c3]) < 0 && ++c3;
468
+ const t6 = o3[c3 - 1];
469
+ if (e4(t6, r2) <= 0) break;
470
+ o3[i4 - 1] = t6, i4 = c3;
471
+ }
472
+ o3[i4 - 1] = r2;
473
+ }, n2 = (o3, t5) => o3 < t5 ? -1 : o3 > t5 ? 1 : 0;
474
+ function e3(o3, e4, i4, c3) {
475
+ void 0 === e4 && (e4 = 0), void 0 === i4 && (i4 = o3.length), void 0 === c3 && (c3 = n2);
476
+ for (let n3 = i4 >>> 1; n3 > e4; n3--) t4(o3, n3, i4, c3);
477
+ const l2 = e4 + 1;
478
+ for (let n3 = i4 - 1; n3 > e4; n3--) {
479
+ const i5 = o3[e4];
480
+ o3[e4] = o3[n3], o3[n3] = i5, t4(o3, l2, n3, c3);
481
+ }
482
+ }
483
+ function* i3(o3, e4, i4, c3) {
484
+ void 0 === e4 && (e4 = 0), void 0 === i4 && (i4 = o3.length), void 0 === c3 && (c3 = n2);
485
+ for (let n3 = i4 >>> 1; n3 > e4; n3--) t4(o3, n3, i4, c3), yield;
486
+ const l2 = e4 + 1;
487
+ for (let n3 = i4 - 1; n3 > e4; n3--) {
488
+ const i5 = o3[e4];
489
+ o3[e4] = o3[n3], o3[n3] = i5, t4(o3, l2, n3, c3), yield;
490
+ }
491
+ }
492
+ o2.sort = e3, o2.iterableSort = i3;
493
+ }(o$1 || (o$1 = {}));
494
+ let c$2 = class c {
495
+ constructor(e3) {
496
+ this.callback = e3, this.isActive = true;
497
+ }
498
+ remove() {
499
+ this.isActive = false;
500
+ }
501
+ };
502
+ const p$1 = ["prepare", "preRender", "render", "postRender", "update", "finish"], f$2 = [];
503
+ const v$1 = { willDispatch: false };
504
+ function A(t4) {
505
+ const n2 = new c$2(t4);
506
+ return f$2.push(n2), v$1.willDispatch || (v$1.willDispatch = true, t$1(g$1)), n2;
507
+ }
508
+ function g$1() {
509
+ for (; f$2.length; ) {
510
+ const e3 = f$2.shift();
511
+ e3.isActive && e3.callback();
512
+ }
513
+ v$1.willDispatch = false;
514
+ }
515
+ p$1.map((e3) => new s$2(e3));
516
+ new s$2("total");
517
+ let t3 = 0;
518
+ function e$2() {
519
+ return ++t3;
520
+ }
521
+ var I;
522
+ !function(I2) {
523
+ I2[I2.INITIALIZING = 0] = "INITIALIZING", I2[I2.CONSTRUCTING = 1] = "CONSTRUCTING", I2[I2.CONSTRUCTED = 2] = "CONSTRUCTED", I2[I2.DESTROYING = 3] = "DESTROYING", I2[I2.DESTROYED = 4] = "DESTROYED";
524
+ }(I || (I = {}));
525
+ var i$1;
526
+ !function(i3) {
527
+ i3[i3.Dirty = 1] = "Dirty", i3[i3.Overridden = 2] = "Overridden", i3[i3.Computing = 4] = "Computing", i3[i3.NonNullable = 8] = "NonNullable", i3[i3.HasDefaultValue = 16] = "HasDefaultValue", i3[i3.DepTrackingInitialized = 32] = "DepTrackingInitialized", i3[i3.AutoTracked = 64] = "AutoTracked", i3[i3.ExplicitlyTracking = 128] = "ExplicitlyTracking";
528
+ }(i$1 || (i$1 = {}));
529
+ let s$1 = class s3 {
530
+ constructor(s5) {
531
+ this.accessed = void 0, this._handles = void 0, this._observer = s5;
532
+ }
533
+ destroy() {
534
+ this.accessed?.clear(), this.clear();
535
+ }
536
+ onAccessed(s5) {
537
+ null != this._observer && s5 !== this._observer && (null == this.accessed && (this.accessed = /* @__PURE__ */ new Set()), this.accessed.add(s5));
538
+ }
539
+ onTrackingEnd() {
540
+ null != this._observer && (this.clear(), null != this.accessed && (null == this._handles && (this._handles = []), this.accessed.forEach((s5) => {
541
+ this._handles.push(s5.observe(this._observer));
542
+ }), this.accessed.clear()));
543
+ }
544
+ clear() {
545
+ if (null != this._handles) {
546
+ for (let s5 = 0; s5 < this._handles.length; ++s5) this._handles[s5].remove();
547
+ this._handles.length = 0;
548
+ }
549
+ }
550
+ };
551
+ const c$1 = [];
552
+ function f$1(t4, n2, r2) {
553
+ let e3 = null;
554
+ return k$1(t4), e3 = n2.call(r2), m$2(), e3;
555
+ }
556
+ function k$1(t4) {
557
+ c$1.push(t4);
558
+ }
559
+ function m$2() {
560
+ const t4 = c$1.length;
561
+ if (t4 > 1) {
562
+ const n2 = c$1.pop();
563
+ n2.onTrackingEnd();
564
+ } else if (1 === t4) {
565
+ const t5 = c$1.pop();
566
+ t5.onTrackingEnd();
567
+ } else ;
568
+ }
569
+ class s4 extends s$1 {
570
+ constructor(t4) {
571
+ super(new i2(t4)), this._observer && e$1.register(this, new WeakRef(this._observer), this);
572
+ }
573
+ destroy() {
574
+ this._observer && e$1.unregister(this._observer), this.accessed?.clear(), this.clear(), this._observer?.destroy();
575
+ }
576
+ }
577
+ class i2 {
578
+ constructor(t4) {
579
+ this._notify = t4, this._invalidCount = 0, this.destroyed = false;
580
+ }
581
+ onInvalidated() {
582
+ this._invalidCount++;
583
+ }
584
+ onCommitted() {
585
+ if (this.destroyed) return;
586
+ const t4 = this._invalidCount;
587
+ if (1 === t4) return this._invalidCount = 0, void this._notify();
588
+ this._invalidCount = t4 > 0 ? t4 - 1 : 0;
589
+ }
590
+ destroy() {
591
+ this.destroyed = true, this._notify = r;
592
+ }
593
+ }
594
+ const e$1 = new FinalizationRegistry((t4) => {
595
+ t4.deref()?.destroy();
596
+ });
597
+ function r() {
598
+ }
599
+ let u = false;
600
+ const l$1 = [];
601
+ function o(l2, o2) {
602
+ let e3 = new s4(a2), i3 = null, s$12 = false;
603
+ function a2() {
604
+ if (!e3 || s$12) return;
605
+ if (u) return void c2(a2);
606
+ const n2 = i3;
607
+ e3.clear(), u = true, s$12 = true, i3 = f$1(e3, l2), s$12 = false, u = false, o2(i3, n2), f();
608
+ }
609
+ function m3() {
610
+ e3 && (e3.destroy(), e3 = null, i3 = null);
611
+ }
612
+ return s$12 = true, i3 = f$1(e3, l2), s$12 = false, e$6(m3);
613
+ }
614
+ function e2(u2, l2) {
615
+ let o2 = new s4(i3), e3 = null;
616
+ function i3() {
617
+ l2(e3, f2);
618
+ }
619
+ function c3() {
620
+ o2 && (o2.destroy(), o2 = null), e3 = null;
621
+ }
622
+ function f2() {
623
+ return o2 ? (o2.clear(), e3 = f$1(o2, u2), e3) : null;
624
+ }
625
+ return f2(), e$6(c3);
626
+ }
627
+ function c2(n2) {
628
+ l$1.includes(n2) || l$1.unshift(n2);
629
+ }
630
+ function f() {
631
+ for (; l$1.length; ) l$1.pop()();
632
+ }
633
+ var h;
634
+ !function(e3) {
635
+ e3[e3.Untracked = 0] = "Untracked", e3[e3.Tracked = 1] = "Tracked";
636
+ }(h || (h = {}));
637
+ let m$1 = class m {
638
+ constructor() {
639
+ this.uid = e$2(), this.removed = false, this.type = null, this.oldValue = null, this.callback = null, this.getValue = null, this.target = null, this.path = null, this.equals = null;
640
+ }
641
+ static {
642
+ this.pool = new s$3(m);
643
+ }
644
+ static acquireUntracked(e3, t4, l2, o2, i3) {
645
+ return this.pool.acquire(h.Untracked, e3, t4, l2, o2, i3, j);
646
+ }
647
+ static acquireTracked(e3, t4, r2, l2) {
648
+ return this.pool.acquire(h.Tracked, e3, t4, r2, null, null, l2);
649
+ }
650
+ notify(e3, t4) {
651
+ this.type === h.Untracked ? this.callback.call(this.target, e3, t4, this.path, this.target) : this.callback.call(null, e3, t4, void 0, void 0);
652
+ }
653
+ acquire(e3, t4, r2, l2, o2, i3, n2) {
654
+ this.uid = e$2(), this.removed = false, this.type = e3, this.oldValue = t4, this.callback = r2, this.getValue = l2, this.target = o2, this.path = i3, this.equals = n2;
655
+ }
656
+ release() {
657
+ this.target = this.path = this.oldValue = this.callback = this.getValue = null, this.uid = e$2(), this.removed = true;
658
+ }
659
+ };
660
+ const p = new t$2(), v = /* @__PURE__ */ new Set();
661
+ let k;
662
+ function _(e3) {
663
+ v.delete(e3), v.add(e3), k || (k = A(q));
664
+ }
665
+ function g(e3) {
666
+ if (e3.removed) return;
667
+ const t4 = e3.oldValue, r2 = e3.getValue();
668
+ e3.equals(t4, r2) || (e3.oldValue = r2, e3.notify(r2, t4));
669
+ }
670
+ function q() {
671
+ let e3 = 10;
672
+ for (; k && e3--; ) {
673
+ k = null;
674
+ const e4 = V(), t4 = p.acquire();
675
+ for (const r2 of e4) {
676
+ const e5 = r2.uid;
677
+ g(r2), e5 === r2.uid && r2.removed && t4.push(r2);
678
+ }
679
+ for (const r2 of v) r2.removed && (t4.push(r2), v.delete(r2));
680
+ for (const r2 of t4) m$1.pool.release(r2);
681
+ p.release(t4), p.release(e4), y$1.forEach((e5) => e5());
682
+ }
683
+ }
684
+ function V() {
685
+ const e3 = p.acquire();
686
+ e3.length = v.size;
687
+ let t4 = 0;
688
+ for (const r2 of v) e3[t4] = r2, ++t4;
689
+ return v.clear(), e3;
690
+ }
691
+ const y$1 = /* @__PURE__ */ new Set();
692
+ function D(e$12, r2, l2) {
693
+ let o2, i3, n2 = e2(e$12, (e3, t4) => {
694
+ o2 && o2.uid !== i3 ? n2.remove() : (o2 || (o2 = m$1.acquireTracked(e3, r2, t4, l2), i3 = o2.uid), _(o2));
695
+ });
696
+ return e$6(() => {
697
+ n2.remove(), o2 && (o2.uid !== i3 || o2.removed || (o2.removed = true, _(o2)), o2 = null), n2 = null;
698
+ });
699
+ }
700
+ function S(e3, t4, r2) {
701
+ let l2 = false;
702
+ return o(e3, (e4, o2) => {
703
+ l2 || (l2 = true, r2(o2, e4) || t4(e4, o2), l2 = false);
704
+ });
705
+ }
706
+ function w(e3, t4, r2 = false, o2 = h$1) {
707
+ return r2 ? S(e3, t4, o2) : D(e3, t4, o2);
708
+ }
709
+ function l(n2, t4, r2 = {}) {
710
+ return m2(n2, t4, r2, y);
711
+ }
712
+ function m2(n2, t4, r2 = {}, e3) {
713
+ let i3 = null;
714
+ const u2 = r2.once ? (n3, r3) => {
715
+ e3(n3) && (l$3(i3), t4(n3, r3));
716
+ } : (n3, r3) => {
717
+ e3(n3) && t4(n3, r3);
718
+ };
719
+ if (i3 = w(n2, u2, r2.sync, r2.equals), r2.initial) {
720
+ const t5 = n2();
721
+ u2(t5, t5);
722
+ }
723
+ return i3;
724
+ }
725
+ function a(r2, i3, u2, s5 = {}) {
726
+ let c3 = null, f2 = null, m3 = null;
727
+ function a2() {
728
+ c3 && f2 && (f2.remove(), s5.onListenerRemove?.(c3), c3 = null, f2 = null);
729
+ }
730
+ function p2(n2) {
731
+ s5.once && s5.once && l$3(m3), u2(n2);
732
+ }
733
+ const j2 = l(r2, (r3, e3) => {
734
+ a2(), n$2(r3) && (c3 = r3, f2 = o$6(r3, i3, p2), s5.onListenerAdd?.(r3));
735
+ }, { sync: s5.sync, initial: true });
736
+ return m3 = e$6(() => {
737
+ j2.remove(), a2();
738
+ }), m3;
739
+ }
740
+ function y(n2) {
741
+ return true;
742
+ }
743
+ const makeAccessorController = (loadAccessor, _options) => (component, options) => proxy(component, loadAccessor, options);
744
+ class AccessorController extends GenericController {
745
+ constructor(component, _loadAccessor, _options) {
746
+ super(component);
747
+ this._loadAccessor = _loadAccessor;
748
+ this._options = _options;
749
+ this._watchedProperties = /* @__PURE__ */ new Map();
750
+ this._isBinding = { value: true };
751
+ this.setProvisionalExports(
752
+ accessorSupport.makeGetterProxy(
753
+ component,
754
+ this._watchedProperties,
755
+ this._isBinding,
756
+ this.constructor.allowedPropNameMismatches
757
+ )
758
+ );
759
+ trackPropKey(
760
+ component,
761
+ (resolved) => {
762
+ if (resolved) {
763
+ this._instancePropName = resolved;
764
+ }
765
+ },
766
+ this.exports
767
+ );
768
+ }
769
+ hostConnected() {
770
+ this._isBinding.value = false;
771
+ }
772
+ async hostLoad() {
773
+ const component = this.component;
774
+ const parameters = this._gatherParameters();
775
+ const finalParameters = this._options?.editConstructorProperties?.call(component, parameters) ?? parameters;
776
+ const awaitedParameters = finalParameters instanceof Promise ? await finalParameters : finalParameters;
777
+ const genericComponent = component;
778
+ const existingInstance = typeof this._instancePropName === "string" ? genericComponent[this._instancePropName] : void 0;
779
+ const hasInstance = existingInstance != null && existingInstance !== this.exports;
780
+ if (hasInstance) {
781
+ this._instance = existingInstance;
782
+ existingInstance.set(awaitedParameters);
783
+ } else {
784
+ this._instance = await this._createInstance(awaitedParameters);
785
+ }
786
+ if (component.manager.destroyed) {
787
+ return;
788
+ }
789
+ accessorSupport.watchComponentUpdates(this, this._instance, this._watchedProperties);
790
+ accessorSupport.watchAccessorUpdates(this, this._instance, this._watchedProperties);
791
+ this.exports = this._instance;
792
+ }
793
+ _gatherParameters() {
794
+ const data = Object.fromEntries(
795
+ Array.from(
796
+ this._watchedProperties,
797
+ ([prop, property]) => [property, this.component[prop]]
798
+ ).filter(([, value]) => value !== void 0)
799
+ );
800
+ const props = process.env.NODE_ENV !== "production" && isEsriInternalEnv() ? filterWatchedProperties?.(this, data) ?? data : data;
801
+ return props;
802
+ }
803
+ async _createInstance(parameters) {
804
+ if (this._isAccessorConstructor(this._loadAccessor)) {
805
+ return new this._loadAccessor(parameters);
806
+ } else {
807
+ return await this._loadAccessor(parameters);
808
+ }
809
+ }
810
+ _isAccessorConstructor(loader) {
811
+ return "prototype" in loader && "declaredClass" in loader.prototype;
812
+ }
813
+ hostDestroy() {
814
+ if (this._instance) {
815
+ this._instance.destroy();
816
+ }
817
+ }
818
+ async reCreate() {
819
+ this.hostDestroy();
820
+ await this.hostLoad();
821
+ }
822
+ }
823
+ const proxy = proxyExports(AccessorController);
824
+ const accessorSupport = {
825
+ makeGetterProxy: (component, watchedProperties, isBinding, allowedPropNameMismatches) => new Proxy(
826
+ {},
827
+ {
828
+ /*
829
+ * Without this, makeProvisionalValue() will throw on accessing
830
+ * non-existent prop
831
+ */
832
+ has: (target, prop) => typeof prop === "string" || prop in target,
833
+ get: (target, prop) => {
834
+ const value = Reflect.get(target, prop);
835
+ if (typeof prop === "symbol" || prop in Promise.prototype) {
836
+ return value;
837
+ }
838
+ const hasProp = prop in target;
839
+ const doBinding = isBinding?.value ?? true;
840
+ if (hasProp || !doBinding) {
841
+ return value;
842
+ }
843
+ if (watchedProperties.has(prop)) {
844
+ if (process.env.NODE_ENV !== "production" && isEsriInternalEnv() && !component.manager.isLit) {
845
+ throw new Error(
846
+ `Tried to bind "${prop.toString()}" prop twice. This might also happen if you are trying to access the accessor instance before ${component.manager.isLit ? "load" : "componentWillLoad"}()`
847
+ );
848
+ }
849
+ return;
850
+ }
851
+ return trackKey(
852
+ component,
853
+ (resolved) => {
854
+ if (process.env.NODE_ENV !== "production" && isEsriInternalEnv()) {
855
+ if (resolved === void 0) {
856
+ if (component.manager.isLit) {
857
+ return;
858
+ }
859
+ throw new Error(
860
+ `Unable to resolve what property is "${prop.toString()}" being bound too. Check documentation for useAccessor to ensure proper usage. Make sure you are not trying to access the accessor instance before ${component.manager.isLit ? "load" : "componentWillLoad"}()`
861
+ );
862
+ }
863
+ const isFlippingBoolean = resolved.key.toLowerCase().includes("disable");
864
+ const collidesWithNativeProp = prop in HTMLElement.prototype;
865
+ const collidesWithCustomProp = allowedPropNameMismatches?.has(prop) === true;
866
+ if (resolved.key !== prop && !collidesWithNativeProp && !collidesWithCustomProp && !isFlippingBoolean) {
867
+ throw new Error(
868
+ `Tried to bind "${resolved?.key}" property to "${prop.toString()}" - property names must match`
869
+ );
870
+ }
871
+ if (!resolved.isReactive) {
872
+ throw new Error(
873
+ component.manager.isLit ? `For two-way binding with Accessor to work, the property on your component must have @property() or @state() decorator. "${prop.toString()}" has neither` : `For two-way binding with Accessor to work, the property on your component must have @Prop() or @State() decorator. "${prop.toString()}" has neither`
874
+ );
875
+ }
876
+ }
877
+ if (resolved !== void 0) {
878
+ watchedProperties.set(resolved.key, prop);
879
+ }
880
+ },
881
+ value
882
+ );
883
+ }
884
+ }
885
+ ),
886
+ // Update Accessor on component prop change
887
+ watchComponentUpdates(controller, instance, watchedProperties) {
888
+ function getter(_value, propName) {
889
+ const propertyName = watchedProperties.get(propName);
890
+ const value = instance[propertyName];
891
+ const flipBoolean = typeof value === "boolean" && propertyName !== propName && propName.toLowerCase().includes("disable");
892
+ return flipBoolean ? !value : value;
893
+ }
894
+ const setter = (newValue, _oldValue, propName) => {
895
+ const propertyName = watchedProperties.get(propName);
896
+ const value = instance[propertyName];
897
+ const flipBoolean = typeof value === "boolean" && propertyName !== propName && propName.toLowerCase().includes("disable");
898
+ const currentValue = flipBoolean ? !value : component.manager.isLit ? value ?? void 0 : value;
899
+ if (currentValue === newValue) {
900
+ return newValue;
901
+ }
902
+ instance[propertyName] = flipBoolean ? !newValue : newValue;
903
+ const finalValue = instance[propertyName];
904
+ return flipBoolean ? !finalValue : finalValue;
905
+ };
906
+ const component = controller.component;
907
+ const internals = component.manager.internals;
908
+ watchedProperties.forEach((_propName, propertyName) => {
909
+ internals.accessorGetter[propertyName] = getter;
910
+ internals.accessorSetter[propertyName] = setter;
911
+ });
912
+ },
913
+ // Update component on Accessor prop change
914
+ watchAccessorUpdates(controller, instance, watchedProperties) {
915
+ const { component } = controller;
916
+ const genericComponent = component;
917
+ const genericInstance = instance;
918
+ const readonlyProps = findReadOnlyAccessorProps(instance);
919
+ if (process.env.NODE_ENV !== "production" && isEsriInternalEnv()) {
920
+ setReadonlyProps?.(controller, readonlyProps);
921
+ }
922
+ bypassGetter(
923
+ () => (
924
+ // Careful: Map's forEach callback arguments are (value, key), not (key, value)
925
+ watchedProperties.forEach((propertyName, propName) => {
926
+ if (process.env.NODE_ENV !== "production" && isEsriInternalEnv() && !(propertyName in instance)) {
927
+ throw new Error(`"${propertyName}" does not exist on the accessor instance`);
928
+ }
929
+ if (readonlyProps.has(propertyName)) {
930
+ return;
931
+ }
932
+ const domValue = genericComponent[propName];
933
+ let modelValue = genericInstance[propertyName];
934
+ if (component.manager.isLit) {
935
+ modelValue ??= void 0;
936
+ }
937
+ const flipBoolean = typeof domValue === "boolean" && propertyName !== propName && propName.toLowerCase().includes("disable");
938
+ const resolvedDomValue = flipBoolean ? !domValue : domValue;
939
+ if (resolvedDomValue != null && modelValue !== resolvedDomValue) {
940
+ genericInstance[propertyName] = resolvedDomValue;
941
+ }
942
+ })
943
+ )
944
+ );
945
+ controller.onLifecycle(() => {
946
+ if (instance.destroyed) {
947
+ return;
948
+ }
949
+ return Array.from(
950
+ watchedProperties,
951
+ ([propName, propertyName]) => l(
952
+ () => genericInstance[propertyName],
953
+ () => {
954
+ const newValue = genericInstance[propertyName];
955
+ const flipBoolean = typeof newValue === "boolean" && propertyName !== propName && propName.toLowerCase().includes("disable");
956
+ const resolvedNewValue = flipBoolean ? !newValue : newValue;
957
+ bypassSetter(() => {
958
+ genericComponent[propName] = resolvedNewValue;
959
+ });
960
+ },
961
+ { initial: true }
962
+ )
963
+ );
964
+ });
965
+ },
966
+ // REFACTOR: remove this once Stencil is no longer supported
967
+ reEmitAccessorEvents(controller, instance, prefix) {
968
+ const isEvented = "on" in instance && typeof instance.on === "function";
969
+ if (!isEvented) {
970
+ return;
971
+ }
972
+ const toListen = Object.entries(controller.component).map(([key, unknown]) => {
973
+ const value = unknown;
974
+ if (!key.startsWith(prefix) || key === prefix || typeof value !== "object" || value === null || !("emit" in value) || typeof value.emit !== "function") {
975
+ return void 0;
976
+ }
977
+ const emit = value.emit;
978
+ const trimmedEventName = key.slice(prefix.length);
979
+ const camelCaseEventName = camelToKebab(trimmedEventName);
980
+ const eventName = camelCaseEventName.toLowerCase();
981
+ return [eventName, emit];
982
+ }).filter(isNotUndefined);
983
+ if (toListen.length === 0) {
984
+ return;
985
+ }
986
+ const eventTarget = instance;
987
+ const getEventTarget = () => eventTarget;
988
+ controller.onLifecycle(() => {
989
+ if (instance.destroyed) {
990
+ return;
991
+ }
992
+ return toListen.map(([eventName, emit]) => a(getEventTarget, eventName, emit));
993
+ });
994
+ },
995
+ async reCreate(instance, component) {
996
+ const accessorController = component.manager.useRefSync(instance);
997
+ if (accessorController === void 0) {
998
+ if (process.env.NODE_ENV !== "production") {
999
+ console.error("Unable to resolve the useAccessor controller from the provided value");
1000
+ }
1001
+ return;
1002
+ }
1003
+ await accessorController.reCreate();
1004
+ }
1005
+ };
1006
+ function findReadOnlyAccessorProps(instance) {
1007
+ const accessor = instance;
1008
+ const properties = Object.entries(accessor.__accessor__?.metadata ?? {});
1009
+ return new Set(
1010
+ properties.filter(([_property, descriptor]) => descriptor?.readOnly === true).map(([property]) => property)
1011
+ );
1012
+ }
1013
+ const setReadonlyProps = process.env.NODE_ENV !== "production" && isEsriInternalEnv() ? (controller, properties) => {
1014
+ devOnlySetPersistentControllerData?.(controller, properties);
1015
+ } : void 0;
1016
+ const filterWatchedProperties = process.env.NODE_ENV !== "production" && isEsriInternalEnv() ? (controller, data) => {
1017
+ const readonlyProperties = devOnlyGetPersistentControllerData?.(controller);
1018
+ if (readonlyProperties instanceof Set) {
1019
+ return Object.fromEntries(Object.entries(data).filter(([key]) => !readonlyProperties.has(key)));
1020
+ }
1021
+ return data;
1022
+ } : void 0;
1023
+ function reEmitEvent(getEventedAccessor, eventName) {
1024
+ const component = retrieveComponent();
1025
+ if (process.env.NODE_ENV !== "production" && isEsriInternalEnv() && !component.manager.isLit) {
1026
+ throw new Error(
1027
+ "reEmitEvent is only supported in Lumina components. Consult documentation for equivalent Stencil pattern."
1028
+ );
1029
+ }
1030
+ const manager = component.manager;
1031
+ manager.onLoaded(() => manager.onLifecycle(() => a(getEventedAccessor, eventName, emitter.emit)));
1032
+ const emitter = createEventFactory();
1033
+ if (process.env.NODE_ENV !== "production" && isEsriInternalEnv()) {
1034
+ if (typeof emitter !== "object" || emitter === null || !("emit" in emitter) || typeof emitter.emit !== "function") {
1035
+ throw new Error(`Expected to find $createEvent static property on Lumina's LitElement`);
1036
+ }
1037
+ }
1038
+ return emitter;
1039
+ }
1040
+ export {
1041
+ AccessorController,
1042
+ accessorSupport,
1043
+ makeAccessorController,
1044
+ reEmitEvent
1045
+ };