een-api-toolkit 0.3.51 → 0.3.55

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.
package/dist/index.js CHANGED
@@ -1,21 +1,21 @@
1
- import { defineStore as ge } from "pinia";
2
- import { ref as A, computed as F } from "vue";
3
- const pe = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1 }, Ee = () => {
1
+ import { defineStore as ve } from "pinia";
2
+ import { ref as E, computed as N } from "vue";
3
+ const Ee = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1 }, Ae = () => {
4
4
  try {
5
- return pe?.VITE_DEBUG === "true";
5
+ return Ee?.VITE_DEBUG === "true";
6
6
  } catch {
7
7
  return !1;
8
8
  }
9
9
  };
10
10
  function s(...e) {
11
- Ee() && console.log("[een-api-toolkit]", ...e);
11
+ Ae() && console.log("[een-api-toolkit]", ...e);
12
12
  }
13
- const me = {
13
+ const Pe = {
14
14
  localStorage: "persists across sessions",
15
15
  sessionStorage: "per-tab, cleared on tab close",
16
16
  memory: "tokens lost on page refresh"
17
17
  };
18
- class Ae {
18
+ class Ie {
19
19
  store = /* @__PURE__ */ new Map();
20
20
  getItem(n) {
21
21
  return this.store.get(n) ?? null;
@@ -27,7 +27,7 @@ class Ae {
27
27
  this.store.delete(n);
28
28
  }
29
29
  }
30
- class te {
30
+ class ne {
31
31
  constructor(n) {
32
32
  this.storage = n;
33
33
  }
@@ -41,51 +41,51 @@ class te {
41
41
  this.storage.removeItem(n);
42
42
  }
43
43
  }
44
- let K = "localStorage", C = null;
45
- function x() {
46
- return C || (C = new Ae()), C;
44
+ let K = "localStorage", x = null;
45
+ function W() {
46
+ return x || (x = new Ie()), x;
47
47
  }
48
48
  function Te(e) {
49
49
  K = e;
50
50
  }
51
- function Be() {
51
+ function Ce() {
52
52
  return K;
53
53
  }
54
54
  function V() {
55
55
  switch (K) {
56
56
  case "memory":
57
- return x();
57
+ return W();
58
58
  case "sessionStorage":
59
- return typeof sessionStorage < "u" ? new te(sessionStorage) : (s("sessionStorage unavailable, falling back to memory storage"), x());
59
+ return typeof sessionStorage < "u" ? new ne(sessionStorage) : (s("sessionStorage unavailable, falling back to memory storage"), W());
60
60
  default:
61
- return typeof localStorage < "u" ? new te(localStorage) : (s("localStorage unavailable, falling back to memory storage"), x());
61
+ return typeof localStorage < "u" ? new ne(localStorage) : (s("localStorage unavailable, falling back to memory storage"), W());
62
62
  }
63
63
  }
64
- const v = {};
65
- let b = {};
66
- function Pe(e = {}) {
64
+ const D = {};
65
+ let $ = {};
66
+ function He(e = {}) {
67
67
  const n = e.storageStrategy ?? "localStorage";
68
- Te(n), b = {
69
- proxyUrl: e.proxyUrl ?? v?.VITE_PROXY_URL,
70
- clientId: e.clientId ?? v?.VITE_EEN_CLIENT_ID,
71
- redirectUri: e.redirectUri ?? v?.VITE_REDIRECT_URI,
68
+ Te(n), $ = {
69
+ proxyUrl: e.proxyUrl ?? D?.VITE_PROXY_URL,
70
+ clientId: e.clientId ?? D?.VITE_EEN_CLIENT_ID,
71
+ redirectUri: e.redirectUri ?? D?.VITE_REDIRECT_URI,
72
72
  storageStrategy: n,
73
- debug: e.debug ?? v?.VITE_DEBUG === "true"
73
+ debug: e.debug ?? D?.VITE_DEBUG === "true"
74
74
  };
75
75
  }
76
- function He() {
77
- return b;
76
+ function ze() {
77
+ return $;
78
78
  }
79
- function M() {
80
- return b.proxyUrl ?? v?.VITE_PROXY_URL;
79
+ function G() {
80
+ return $.proxyUrl ?? D?.VITE_PROXY_URL;
81
81
  }
82
- function Ie() {
83
- return b.clientId ?? v?.VITE_EEN_CLIENT_ID;
82
+ function Ue() {
83
+ return $.clientId ?? D?.VITE_EEN_CLIENT_ID;
84
84
  }
85
- function ne() {
86
- return b.redirectUri ?? v?.VITE_REDIRECT_URI ?? "http://127.0.0.1:3333";
85
+ function ie() {
86
+ return $.redirectUri ?? D?.VITE_REDIRECT_URI ?? "http://127.0.0.1:3333";
87
87
  }
88
- function l(e) {
88
+ function d(e) {
89
89
  return { data: e, error: null };
90
90
  }
91
91
  function i(e, n, t, r) {
@@ -94,95 +94,95 @@ function i(e, n, t, r) {
94
94
  function I(e) {
95
95
  return e.endsWith("+00:00") ? e : e.endsWith("Z") ? e.replace("Z", "+00:00") : e;
96
96
  }
97
- let W = null;
98
- function Ue() {
99
- return W || (W = Promise.resolve().then(() => ke).then((e) => e.refreshToken)), W;
97
+ let M = null;
98
+ function ye() {
99
+ return M || (M = Promise.resolve().then(() => ke).then((e) => e.refreshToken)), M;
100
100
  }
101
- const f = ge("een-auth", () => {
102
- const e = A(null), n = A(null), t = A(null), r = A(null), a = A(null), o = A(443), c = A(null), u = A(null), R = A(!1);
103
- let h = null;
104
- const E = A(!1), _ = A(null), S = F(() => !!e.value), $ = F(() => a.value ? o.value === 443 ? `https://${a.value}` : `https://${a.value}:${o.value}` : null), p = F(() => n.value ? Date.now() >= n.value : !0), H = F(() => n.value ? Math.max(0, n.value - Date.now()) : 0);
105
- function z(d, g) {
106
- e.value = d, n.value = Date.now() + g * 1e3, O(), Q(), s("Token set, expires in", g, "seconds");
101
+ const f = ve("een-auth", () => {
102
+ const e = E(null), n = E(null), t = E(null), r = E(null), a = E(null), o = E(443), c = E(null), u = E(null), h = E(!1);
103
+ let _ = null;
104
+ const v = E(!1), g = E(null), y = N(() => !!e.value), S = N(() => a.value ? o.value === 443 ? `https://${a.value}` : `https://${a.value}:${o.value}` : null), p = N(() => n.value ? Date.now() >= n.value : !0), H = N(() => n.value ? Math.max(0, n.value - Date.now()) : 0);
105
+ function z(l, R) {
106
+ e.value = l, n.value = Date.now() + R * 1e3, b(), Q(), s("Token set, expires in", R, "seconds");
107
107
  }
108
- function N(d) {
109
- t.value = d, O();
108
+ function F(l) {
109
+ t.value = l, b();
110
110
  }
111
- function y(d) {
112
- r.value = d, O();
111
+ function U(l) {
112
+ r.value = l, b();
113
113
  }
114
- function D(d) {
115
- if (typeof d == "string")
114
+ function O(l) {
115
+ if (typeof l == "string")
116
116
  try {
117
- const g = new URL(d.startsWith("http") ? d : `https://${d}`);
118
- a.value = g.hostname, o.value = g.port ? parseInt(g.port, 10) : 443;
119
- } catch (g) {
120
- s("Failed to parse URL, using as hostname:", g instanceof Error ? g.message : String(g)), a.value = d, o.value = 443;
117
+ const R = new URL(l.startsWith("http") ? l : `https://${l}`);
118
+ a.value = R.hostname, o.value = R.port ? parseInt(R.port, 10) : 443;
119
+ } catch (R) {
120
+ s("Failed to parse URL, using as hostname:", R instanceof Error ? R.message : String(R)), a.value = l, o.value = 443;
121
121
  }
122
122
  else
123
- a.value = d.hostname, o.value = d.port ?? 443;
124
- O(), s("Base URL set:", $.value);
123
+ a.value = l.hostname, o.value = l.port ?? 443;
124
+ b(), s("Base URL set:", S.value);
125
125
  }
126
- function T(d) {
127
- c.value = d, O();
126
+ function A(l) {
127
+ c.value = l, b();
128
128
  }
129
129
  function Q() {
130
130
  if (u.value && (clearTimeout(u.value), u.value = null), !n.value || !e.value)
131
131
  return;
132
- const d = Date.now(), k = n.value - d, q = 300 * 1e3, _e = k / 2, Re = Math.min(q, _e), he = Math.max(k - Re, 60 * 1e3), ee = Math.max(he, 5e3);
133
- s("Auto-refresh scheduled in", Math.round(ee / 1e3), "seconds"), u.value = setTimeout(async () => {
134
- await se();
135
- }, ee);
132
+ const l = Date.now(), m = n.value - l, L = 300 * 1e3, _e = m / 2, Re = Math.min(L, _e), pe = Math.max(m - Re, 60 * 1e3), te = Math.max(pe, 5e3);
133
+ s("Auto-refresh scheduled in", Math.round(te / 1e3), "seconds"), u.value = setTimeout(async () => {
134
+ await le();
135
+ }, te);
136
136
  }
137
- async function se() {
138
- return h ? (s("Refresh already in progress, waiting for existing refresh"), h) : (R.value = !0, s("Performing auto-refresh"), h = (async () => {
137
+ async function le() {
138
+ return _ ? (s("Refresh already in progress, waiting for existing refresh"), _) : (h.value = !0, s("Performing auto-refresh"), _ = (async () => {
139
139
  try {
140
- const g = await (await Ue())();
141
- g.error ? (E.value = !0, _.value = g.error.message, s("Auto-refresh failed:", g.error.message)) : (E.value = !1, _.value = null, s("Auto-refresh successful"));
142
- } catch (d) {
143
- E.value = !0, _.value = d instanceof Error ? d.message : String(d), s("Auto-refresh error:", d);
140
+ const R = await (await ye())();
141
+ R.error ? (v.value = !0, g.value = R.error.message, s("Auto-refresh failed:", R.error.message)) : (v.value = !1, g.value = null, s("Auto-refresh successful"));
142
+ } catch (l) {
143
+ v.value = !0, g.value = l instanceof Error ? l.message : String(l), s("Auto-refresh error:", l);
144
144
  } finally {
145
- R.value = !1, h = null;
145
+ h.value = !1, _ = null;
146
146
  }
147
- })(), h);
147
+ })(), _);
148
148
  }
149
- function ue() {
150
- E.value = !1, _.value = null;
149
+ function de() {
150
+ v.value = !1, g.value = null;
151
151
  }
152
- function Z() {
153
- u.value && (clearTimeout(u.value), u.value = null), e.value = null, n.value = null, t.value = null, r.value = null, a.value = null, o.value = 443, c.value = null, E.value = !1, _.value = null, fe(), s("Logged out");
152
+ function ee() {
153
+ u.value && (clearTimeout(u.value), u.value = null), e.value = null, n.value = null, t.value = null, r.value = null, a.value = null, o.value = 443, c.value = null, v.value = !1, g.value = null, he(), s("Logged out");
154
154
  }
155
- function de() {
156
- le(), e.value && !p.value ? (Q(), s("Initialized from storage")) : e.value && p.value && (s("Stored token expired, clearing"), Z());
155
+ function fe() {
156
+ ge(), e.value && !p.value ? (Q(), s("Initialized from storage")) : e.value && p.value && (s("Stored token expired, clearing"), ee());
157
157
  }
158
- function O() {
158
+ function b() {
159
159
  try {
160
- const d = V();
161
- e.value && d.setItem("een_token", e.value), n.value && d.setItem("een_tokenExpiration", String(n.value)), t.value && d.setItem("een_refreshTokenMarker", t.value), r.value && d.setItem("een_sessionId", r.value), a.value && d.setItem("een_hostname", a.value), o.value !== 443 && d.setItem("een_port", String(o.value)), c.value && d.setItem("een_userProfile", JSON.stringify(c.value));
162
- } catch (d) {
163
- s("Failed to save to storage:", d instanceof Error ? d.message : String(d));
160
+ const l = V();
161
+ e.value && l.setItem("een_token", e.value), n.value && l.setItem("een_tokenExpiration", String(n.value)), t.value && l.setItem("een_refreshTokenMarker", t.value), r.value && l.setItem("een_sessionId", r.value), a.value && l.setItem("een_hostname", a.value), o.value !== 443 && l.setItem("een_port", String(o.value)), c.value && l.setItem("een_userProfile", JSON.stringify(c.value));
162
+ } catch (l) {
163
+ s("Failed to save to storage:", l instanceof Error ? l.message : String(l));
164
164
  }
165
165
  }
166
- function le() {
166
+ function ge() {
167
167
  try {
168
- const d = V();
169
- e.value = d.getItem("een_token");
170
- const g = d.getItem("een_tokenExpiration");
171
- n.value = g ? parseInt(g, 10) : null, t.value = d.getItem("een_refreshTokenMarker"), r.value = d.getItem("een_sessionId"), a.value = d.getItem("een_hostname");
172
- const k = d.getItem("een_port");
173
- o.value = k ? parseInt(k, 10) : 443;
174
- const q = d.getItem("een_userProfile");
175
- c.value = q ? JSON.parse(q) : null;
176
- } catch (d) {
177
- s("Failed to load from storage:", d instanceof Error ? d.message : String(d));
168
+ const l = V();
169
+ e.value = l.getItem("een_token");
170
+ const R = l.getItem("een_tokenExpiration");
171
+ n.value = R ? parseInt(R, 10) : null, t.value = l.getItem("een_refreshTokenMarker"), r.value = l.getItem("een_sessionId"), a.value = l.getItem("een_hostname");
172
+ const m = l.getItem("een_port");
173
+ o.value = m ? parseInt(m, 10) : 443;
174
+ const L = l.getItem("een_userProfile");
175
+ c.value = L ? JSON.parse(L) : null;
176
+ } catch (l) {
177
+ s("Failed to load from storage:", l instanceof Error ? l.message : String(l));
178
178
  }
179
179
  }
180
- function fe() {
180
+ function he() {
181
181
  try {
182
- const d = V();
183
- d.removeItem("een_token"), d.removeItem("een_tokenExpiration"), d.removeItem("een_refreshTokenMarker"), d.removeItem("een_sessionId"), d.removeItem("een_hostname"), d.removeItem("een_port"), d.removeItem("een_userProfile");
184
- } catch (d) {
185
- s("Failed to clear storage:", d instanceof Error ? d.message : String(d));
182
+ const l = V();
183
+ l.removeItem("een_token"), l.removeItem("een_tokenExpiration"), l.removeItem("een_refreshTokenMarker"), l.removeItem("een_sessionId"), l.removeItem("een_hostname"), l.removeItem("een_port"), l.removeItem("een_userProfile");
184
+ } catch (l) {
185
+ s("Failed to clear storage:", l instanceof Error ? l.message : String(l));
186
186
  }
187
187
  }
188
188
  return {
@@ -194,28 +194,28 @@ const f = ge("een-auth", () => {
194
194
  hostname: a,
195
195
  port: o,
196
196
  userProfile: c,
197
- isRefreshing: R,
198
- refreshFailed: E,
199
- refreshFailedMessage: _,
197
+ isRefreshing: h,
198
+ refreshFailed: v,
199
+ refreshFailedMessage: g,
200
200
  // Computed
201
- isAuthenticated: S,
202
- baseUrl: $,
201
+ isAuthenticated: y,
202
+ baseUrl: S,
203
203
  isTokenExpired: p,
204
204
  tokenExpiresIn: H,
205
205
  // Actions
206
206
  setToken: z,
207
- setRefreshTokenMarker: N,
208
- setSessionId: y,
209
- setBaseUrl: D,
210
- setUserProfile: T,
207
+ setRefreshTokenMarker: F,
208
+ setSessionId: U,
209
+ setBaseUrl: O,
210
+ setUserProfile: A,
211
211
  setupAutoRefresh: Q,
212
- clearRefreshFailed: ue,
213
- logout: Z,
214
- initialize: de
212
+ clearRefreshFailed: de,
213
+ logout: ee,
214
+ initialize: fe
215
215
  };
216
- }), ye = "https://auth.eagleeyenetworks.com/oauth2/authorize";
217
- function Se() {
218
- const e = Ie();
216
+ }), Se = "https://auth.eagleeyenetworks.com/oauth2/authorize";
217
+ function De() {
218
+ const e = Ue();
219
219
  if (!e)
220
220
  throw new Error("Client ID not configured. Call initEenToolkit() or set VITE_EEN_CLIENT_ID");
221
221
  const n = crypto.randomUUID();
@@ -227,18 +227,18 @@ function Se() {
227
227
  client_id: e,
228
228
  response_type: "code",
229
229
  scope: "vms.all",
230
- redirect_uri: ne(),
230
+ redirect_uri: ie(),
231
231
  state: n
232
232
  });
233
- return s("Generated auth URL with state:", n), `${ye}?${t.toString()}`;
233
+ return s("Generated auth URL with state:", n), `${Se}?${t.toString()}`;
234
234
  }
235
- async function ie(e) {
236
- const n = M();
235
+ async function re(e) {
236
+ const n = G();
237
237
  if (!n)
238
238
  return i("AUTH_FAILED", "Proxy URL not configured. Call initEenToolkit() or set VITE_PROXY_URL");
239
239
  const t = new URLSearchParams({
240
240
  code: e,
241
- redirect_uri: ne()
241
+ redirect_uri: ie()
242
242
  });
243
243
  try {
244
244
  const r = await fetch(`${n}/proxy/getAccessToken?${t.toString()}`, {
@@ -253,13 +253,13 @@ async function ie(e) {
253
253
  return i("AUTH_FAILED", `Token exchange failed: ${o}`, r.status);
254
254
  }
255
255
  const a = await r.json();
256
- return s("Token received, expires in:", a.expiresIn), l(a);
256
+ return s("Token received, expires in:", a.expiresIn), d(a);
257
257
  } catch (r) {
258
258
  return i("NETWORK_ERROR", `Failed to exchange code: ${String(r)}`);
259
259
  }
260
260
  }
261
- async function $e() {
262
- const e = M();
261
+ async function Oe() {
262
+ const e = G();
263
263
  if (!e)
264
264
  return i("AUTH_FAILED", "Proxy URL not configured");
265
265
  const n = f();
@@ -278,13 +278,13 @@ async function $e() {
278
278
  return i("AUTH_FAILED", `Token refresh failed: ${o}`, r.status);
279
279
  }
280
280
  const a = await r.json();
281
- return n.setToken(a.accessToken, a.expiresIn), s("Token refreshed, expires in:", a.expiresIn), l(a);
281
+ return n.setToken(a.accessToken, a.expiresIn), s("Token refreshed, expires in:", a.expiresIn), d(a);
282
282
  } catch (t) {
283
283
  return i("NETWORK_ERROR", `Failed to refresh token: ${String(t)}`);
284
284
  }
285
285
  }
286
- async function ve() {
287
- const e = M();
286
+ async function be() {
287
+ const e = G();
288
288
  if (!e)
289
289
  return i("AUTH_FAILED", "Proxy URL not configured");
290
290
  const n = f();
@@ -302,12 +302,12 @@ async function ve() {
302
302
  const a = await r.text().catch(() => "Unknown error");
303
303
  return i("AUTH_FAILED", `Token revocation failed: ${a}`, r.status);
304
304
  }
305
- return s("Token revoked"), l(void 0);
305
+ return s("Token revoked"), d(void 0);
306
306
  } catch (t) {
307
307
  return n.logout(), i("NETWORK_ERROR", `Failed to revoke token: ${String(t)}`);
308
308
  }
309
309
  }
310
- async function De(e, n) {
310
+ async function me(e, n) {
311
311
  let t = null;
312
312
  try {
313
313
  t = sessionStorage.getItem("een_oauth_state"), sessionStorage.removeItem("een_oauth_state");
@@ -315,16 +315,16 @@ async function De(e, n) {
315
315
  }
316
316
  if (!t)
317
317
  return i("AUTH_FAILED", "No OAuth state found. Please restart the login process.");
318
- if (!Oe(n, t))
318
+ if (!$e(n, t))
319
319
  return i("AUTH_FAILED", "Invalid OAuth state. Possible CSRF attack.");
320
320
  s("State validated, exchanging code for token");
321
- const r = await ie(e);
321
+ const r = await re(e);
322
322
  if (r.error)
323
323
  return r;
324
324
  const a = f(), o = r.data;
325
- return a.setToken(o.accessToken, o.expiresIn), a.setRefreshTokenMarker("present"), a.setSessionId(o.sessionId), a.setBaseUrl(o.httpsBaseUrl), s("Auth callback complete, user:", o.userEmail), l(o);
325
+ return a.setToken(o.accessToken, o.expiresIn), a.setRefreshTokenMarker("present"), a.setSessionId(o.sessionId), a.setBaseUrl(o.httpsBaseUrl), s("Auth callback complete, user:", o.userEmail), d(o);
326
326
  }
327
- function Oe(e, n) {
327
+ function $e(e, n) {
328
328
  if (e.length !== n.length)
329
329
  return !1;
330
330
  let t = 0;
@@ -334,13 +334,13 @@ function Oe(e, n) {
334
334
  }
335
335
  const ke = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
336
336
  __proto__: null,
337
- getAccessToken: ie,
338
- getAuthUrl: Se,
339
- handleAuthCallback: De,
340
- refreshToken: $e,
341
- revokeToken: ve
337
+ getAccessToken: re,
338
+ getAuthUrl: De,
339
+ handleAuthCallback: me,
340
+ refreshToken: Oe,
341
+ revokeToken: be
342
342
  }, Symbol.toStringTag, { value: "Module" }));
343
- async function ze() {
343
+ async function Qe() {
344
344
  const e = f();
345
345
  if (!e.isAuthenticated)
346
346
  return i("AUTH_REQUIRED", "Authentication required");
@@ -357,14 +357,14 @@ async function ze() {
357
357
  }
358
358
  });
359
359
  if (!t.ok)
360
- return G(t);
360
+ return J(t);
361
361
  const r = await t.json();
362
- return s("Current user fetched:", r.email), e.setUserProfile(r), l(r);
362
+ return s("Current user fetched:", r.email), e.setUserProfile(r), d(r);
363
363
  } catch (t) {
364
364
  return i("NETWORK_ERROR", `Failed to fetch current user: ${String(t)}`);
365
365
  }
366
366
  }
367
- async function Qe(e) {
367
+ async function xe(e) {
368
368
  const n = f();
369
369
  if (!n.isAuthenticated)
370
370
  return i("AUTH_REQUIRED", "Authentication required");
@@ -383,14 +383,14 @@ async function Qe(e) {
383
383
  }
384
384
  });
385
385
  if (!o.ok)
386
- return G(o);
386
+ return J(o);
387
387
  const c = await o.json();
388
- return s("Users fetched:", c.results?.length ?? 0, "users"), l(c);
388
+ return s("Users fetched:", c.results?.length ?? 0, "users"), d(c);
389
389
  } catch (o) {
390
390
  return i("NETWORK_ERROR", `Failed to fetch users: ${String(o)}`);
391
391
  }
392
392
  }
393
- async function Ce(e, n) {
393
+ async function We(e, n) {
394
394
  const t = f();
395
395
  if (!t.isAuthenticated)
396
396
  return i("AUTH_REQUIRED", "Authentication required");
@@ -411,14 +411,14 @@ async function Ce(e, n) {
411
411
  }
412
412
  });
413
413
  if (!c.ok)
414
- return G(c);
414
+ return J(c);
415
415
  const u = await c.json();
416
- return s("User fetched:", u.email), l(u);
416
+ return s("User fetched:", u.email), d(u);
417
417
  } catch (c) {
418
418
  return i("NETWORK_ERROR", `Failed to fetch user: ${String(c)}`);
419
419
  }
420
420
  }
421
- async function G(e) {
421
+ async function J(e) {
422
422
  const n = e.status;
423
423
  let t;
424
424
  try {
@@ -440,7 +440,7 @@ async function G(e) {
440
440
  return i("API_ERROR", `API error: ${t}`, n);
441
441
  }
442
442
  }
443
- async function xe(e) {
443
+ async function Ve(e) {
444
444
  const n = f();
445
445
  if (!n.isAuthenticated)
446
446
  return i("AUTH_REQUIRED", "Authentication required");
@@ -459,14 +459,14 @@ async function xe(e) {
459
459
  }
460
460
  });
461
461
  if (!o.ok)
462
- return re(o);
462
+ return oe(o);
463
463
  const c = await o.json();
464
- return s("Cameras fetched:", c.results?.length ?? 0, "cameras"), l(c);
464
+ return s("Cameras fetched:", c.results?.length ?? 0, "cameras"), d(c);
465
465
  } catch (o) {
466
466
  return i("NETWORK_ERROR", `Failed to fetch cameras: ${String(o)}`);
467
467
  }
468
468
  }
469
- async function Ve(e, n) {
469
+ async function Me(e, n) {
470
470
  const t = f();
471
471
  if (!t.isAuthenticated)
472
472
  return i("AUTH_REQUIRED", "Authentication required");
@@ -487,14 +487,14 @@ async function Ve(e, n) {
487
487
  }
488
488
  });
489
489
  if (!c.ok)
490
- return re(c);
490
+ return oe(c);
491
491
  const u = await c.json();
492
- return s("Camera fetched:", u.name), l(u);
492
+ return s("Camera fetched:", u.name), d(u);
493
493
  } catch (c) {
494
494
  return i("NETWORK_ERROR", `Failed to fetch camera: ${String(c)}`);
495
495
  }
496
496
  }
497
- async function re(e) {
497
+ async function oe(e) {
498
498
  const n = e.status;
499
499
  let t;
500
500
  try {
@@ -516,7 +516,7 @@ async function re(e) {
516
516
  return i("API_ERROR", `API error: ${t}`, n);
517
517
  }
518
518
  }
519
- async function We(e) {
519
+ async function Ke(e) {
520
520
  const n = f();
521
521
  if (!n.isAuthenticated)
522
522
  return i("AUTH_REQUIRED", "Authentication required");
@@ -535,14 +535,14 @@ async function We(e) {
535
535
  }
536
536
  });
537
537
  if (!o.ok)
538
- return oe(o);
538
+ return ae(o);
539
539
  const c = await o.json();
540
- return s("Bridges fetched:", c.results?.length ?? 0, "bridges"), l(c);
540
+ return s("Bridges fetched:", c.results?.length ?? 0, "bridges"), d(c);
541
541
  } catch (o) {
542
542
  return i("NETWORK_ERROR", `Failed to fetch bridges: ${String(o)}`);
543
543
  }
544
544
  }
545
- async function Ke(e, n) {
545
+ async function Ge(e, n) {
546
546
  const t = f();
547
547
  if (!t.isAuthenticated)
548
548
  return i("AUTH_REQUIRED", "Authentication required");
@@ -563,14 +563,14 @@ async function Ke(e, n) {
563
563
  }
564
564
  });
565
565
  if (!c.ok)
566
- return oe(c);
566
+ return ae(c);
567
567
  const u = await c.json();
568
- return s("Bridge fetched:", u.name), l(u);
568
+ return s("Bridge fetched:", u.name), d(u);
569
569
  } catch (c) {
570
570
  return i("NETWORK_ERROR", `Failed to fetch bridge: ${String(c)}`);
571
571
  }
572
572
  }
573
- async function oe(e) {
573
+ async function ae(e) {
574
574
  const n = e.status;
575
575
  let t;
576
576
  try {
@@ -592,7 +592,7 @@ async function oe(e) {
592
592
  return i("API_ERROR", `API error: ${t}`, n);
593
593
  }
594
594
  }
595
- async function Me(e) {
595
+ async function Je(e) {
596
596
  const n = f();
597
597
  if (!n.isAuthenticated)
598
598
  return i("AUTH_REQUIRED", "Authentication required");
@@ -611,14 +611,14 @@ async function Me(e) {
611
611
  }
612
612
  });
613
613
  if (!o.ok)
614
- return w(o);
614
+ return k(o);
615
615
  const c = await o.json();
616
- return s("Layouts fetched:", c.results?.length ?? 0, "layouts"), l(c);
616
+ return s("Layouts fetched:", c.results?.length ?? 0, "layouts"), d(c);
617
617
  } catch (o) {
618
618
  return i("NETWORK_ERROR", `Failed to fetch layouts: ${String(o)}`);
619
619
  }
620
620
  }
621
- async function Ge(e, n) {
621
+ async function Xe(e, n) {
622
622
  const t = f();
623
623
  if (!t.isAuthenticated)
624
624
  return i("AUTH_REQUIRED", "Authentication required");
@@ -639,14 +639,14 @@ async function Ge(e, n) {
639
639
  }
640
640
  });
641
641
  if (!c.ok)
642
- return w(c);
642
+ return k(c);
643
643
  const u = await c.json();
644
- return s("Layout fetched:", u.name), l(u);
644
+ return s("Layout fetched:", u.name), d(u);
645
645
  } catch (c) {
646
646
  return i("NETWORK_ERROR", `Failed to fetch layout: ${String(c)}`);
647
647
  }
648
648
  }
649
- async function Je(e) {
649
+ async function Ye(e) {
650
650
  const n = f();
651
651
  if (!n.isAuthenticated)
652
652
  return i("AUTH_REQUIRED", "Authentication required");
@@ -674,14 +674,14 @@ async function Je(e) {
674
674
  body: JSON.stringify(r)
675
675
  });
676
676
  if (!a.ok)
677
- return w(a);
677
+ return k(a);
678
678
  const o = await a.json();
679
- return s("Layout created:", o.id, o.name), l(o);
679
+ return s("Layout created:", o.id, o.name), d(o);
680
680
  } catch (a) {
681
681
  return i("NETWORK_ERROR", `Failed to create layout: ${String(a)}`);
682
682
  }
683
683
  }
684
- async function Xe(e, n) {
684
+ async function Ze(e, n) {
685
685
  const t = f();
686
686
  if (!t.isAuthenticated)
687
687
  return i("AUTH_REQUIRED", "Authentication required");
@@ -705,12 +705,12 @@ async function Xe(e, n) {
705
705
  },
706
706
  body: JSON.stringify(a)
707
707
  });
708
- return o.ok ? (s("Layout updated:", e), l(void 0)) : w(o);
708
+ return o.ok ? (s("Layout updated:", e), d(void 0)) : k(o);
709
709
  } catch (o) {
710
710
  return i("NETWORK_ERROR", `Failed to update layout: ${String(o)}`);
711
711
  }
712
712
  }
713
- async function Ye(e) {
713
+ async function et(e) {
714
714
  const n = f();
715
715
  if (!n.isAuthenticated)
716
716
  return i("AUTH_REQUIRED", "Authentication required");
@@ -728,12 +728,12 @@ async function Ye(e) {
728
728
  Authorization: `Bearer ${n.token}`
729
729
  }
730
730
  });
731
- return r.ok ? (s("Layout deleted:", e), l(void 0)) : w(r);
731
+ return r.ok ? (s("Layout deleted:", e), d(void 0)) : k(r);
732
732
  } catch (r) {
733
733
  return i("NETWORK_ERROR", `Failed to delete layout: ${String(r)}`);
734
734
  }
735
735
  }
736
- async function w(e) {
736
+ async function k(e) {
737
737
  const n = e.status;
738
738
  let t;
739
739
  try {
@@ -757,24 +757,24 @@ async function w(e) {
757
757
  return i("API_ERROR", `API error: ${t}`, n);
758
758
  }
759
759
  }
760
- const be = 3e4;
761
- function j(e = be) {
760
+ const we = 3e4;
761
+ function w(e = we) {
762
762
  const n = new AbortController(), t = setTimeout(() => n.abort(), e);
763
763
  return { controller: n, timeoutId: t };
764
764
  }
765
- function ae(e) {
765
+ function ce(e) {
766
766
  const n = new Uint8Array(e), t = 8192, r = [];
767
767
  for (let o = 0; o < n.byteLength; o += t) {
768
768
  const c = n.subarray(o, Math.min(o + t, n.byteLength));
769
769
  let u = "";
770
- for (let R = 0; R < c.length; R++)
771
- u += String.fromCharCode(c[R]);
770
+ for (let h = 0; h < c.length; h++)
771
+ u += String.fromCharCode(c[h]);
772
772
  r.push(u);
773
773
  }
774
774
  const a = r.join("");
775
775
  return typeof btoa == "function" ? btoa(a) : Buffer.from(a, "binary").toString("base64");
776
776
  }
777
- async function Ze(e) {
777
+ async function tt(e) {
778
778
  const n = f();
779
779
  if (!n.isAuthenticated)
780
780
  return i("AUTH_REQUIRED", "Authentication required");
@@ -792,7 +792,7 @@ async function Ze(e) {
792
792
  t.append("deviceId", e.deviceId), t.append("type", e.type), t.append("mediaType", e.mediaType), t.append("startTimestamp__gte", e.startTimestamp), e.endTimestamp && t.append("endTimestamp__lte", e.endTimestamp), typeof e.coalesce == "boolean" && t.append("coalesce", String(e.coalesce)), e.include && e.include.length > 0 && t.append("include", e.include.join(",")), e.pageToken && t.append("pageToken", e.pageToken), typeof e.pageSize == "number" && t.append("pageSize", String(e.pageSize));
793
793
  const r = `${n.baseUrl}/api/v3.0/media?${t.toString()}`;
794
794
  s("Fetching media intervals:", r);
795
- const { controller: a, timeoutId: o } = j();
795
+ const { controller: a, timeoutId: o } = w();
796
796
  try {
797
797
  const c = await fetch(r, {
798
798
  method: "GET",
@@ -803,16 +803,16 @@ async function Ze(e) {
803
803
  signal: a.signal
804
804
  });
805
805
  if (!c.ok)
806
- return m(c);
806
+ return q(c);
807
807
  const u = await c.json();
808
- return s("Media intervals fetched:", u.results?.length ?? 0, "intervals"), l(u);
808
+ return s("Media intervals fetched:", u.results?.length ?? 0, "intervals"), d(u);
809
809
  } catch (c) {
810
810
  return c instanceof Error && c.name === "AbortError" ? i("NETWORK_ERROR", "Request timed out") : i("NETWORK_ERROR", `Failed to fetch media intervals: ${String(c)}`);
811
811
  } finally {
812
812
  clearTimeout(o);
813
813
  }
814
814
  }
815
- async function et(e) {
815
+ async function nt(e) {
816
816
  const n = f();
817
817
  if (!n.isAuthenticated)
818
818
  return i("AUTH_REQUIRED", "Authentication required");
@@ -824,7 +824,7 @@ async function et(e) {
824
824
  r.append("deviceId", e.deviceId), r.append("type", t);
825
825
  const a = `${n.baseUrl}/api/v3.0/media/liveImage.jpeg?${r.toString()}`;
826
826
  s("Fetching live image:", a);
827
- const { controller: o, timeoutId: c } = j();
827
+ const { controller: o, timeoutId: c } = w();
828
828
  try {
829
829
  const u = await fetch(a, {
830
830
  method: "GET",
@@ -833,14 +833,14 @@ async function et(e) {
833
833
  Authorization: `Bearer ${n.token}`
834
834
  },
835
835
  signal: o.signal
836
- }), R = u.headers.get("X-Een-Timestamp"), h = u.headers.get("X-Een-PrevToken");
836
+ }), h = u.headers.get("X-Een-Timestamp"), _ = u.headers.get("X-Een-PrevToken");
837
837
  if (!u.ok)
838
- return m(u);
839
- const E = await u.arrayBuffer(), S = `data:image/jpeg;base64,${ae(E)}`;
840
- return s("Live image fetched, timestamp:", R), l({
841
- imageData: S,
842
- timestamp: R,
843
- prevToken: h
838
+ return q(u);
839
+ const v = await u.arrayBuffer(), y = `data:image/jpeg;base64,${ce(v)}`;
840
+ return s("Live image fetched, timestamp:", h), d({
841
+ imageData: y,
842
+ timestamp: h,
843
+ prevToken: _
844
844
  });
845
845
  } catch (u) {
846
846
  return u instanceof Error && u.name === "AbortError" ? i("NETWORK_ERROR", "Request timed out") : i("NETWORK_ERROR", `Failed to fetch live image: ${String(u)}`);
@@ -848,7 +848,7 @@ async function et(e) {
848
848
  clearTimeout(c);
849
849
  }
850
850
  }
851
- async function tt(e) {
851
+ async function it(e) {
852
852
  const n = f();
853
853
  if (!n.isAuthenticated)
854
854
  return i("AUTH_REQUIRED", "Authentication required");
@@ -864,7 +864,7 @@ async function tt(e) {
864
864
  e.deviceId && t.append("deviceId", e.deviceId), e.pageToken && t.append("pageToken", e.pageToken), e.type && t.append("type", e.type), e.timestamp__lt && t.append("timestamp__lt", e.timestamp__lt), e.timestamp__lte && t.append("timestamp__lte", e.timestamp__lte), e.timestamp && t.append("timestamp", e.timestamp), e.timestamp__gte && t.append("timestamp__gte", e.timestamp__gte), e.timestamp__gt && t.append("timestamp__gt", e.timestamp__gt), e.overlayId__in && e.overlayId__in.length > 0 && t.append("overlayId__in", e.overlayId__in.join(",")), e.include && e.include.length > 0 && t.append("include", e.include.join(",")), typeof e.targetWidth == "number" && t.append("targetWidth", String(e.targetWidth)), typeof e.targetHeight == "number" && t.append("targetHeight", String(e.targetHeight));
865
865
  const r = `${n.baseUrl}/api/v3.0/media/recordedImage.jpeg?${t.toString()}`;
866
866
  s("Fetching recorded image:", r);
867
- const { controller: a, timeoutId: o } = j();
867
+ const { controller: a, timeoutId: o } = w();
868
868
  try {
869
869
  const c = await fetch(r, {
870
870
  method: "GET",
@@ -873,16 +873,16 @@ async function tt(e) {
873
873
  Authorization: `Bearer ${n.token}`
874
874
  },
875
875
  signal: a.signal
876
- }), u = c.headers.get("X-Een-Timestamp"), R = c.headers.get("X-Een-NextToken"), h = c.headers.get("X-Een-PrevToken"), E = c.headers.get("X-Een-OverlaySvg");
876
+ }), u = c.headers.get("X-Een-Timestamp"), h = c.headers.get("X-Een-NextToken"), _ = c.headers.get("X-Een-PrevToken"), v = c.headers.get("X-Een-OverlaySvg");
877
877
  if (!c.ok)
878
- return m(c);
879
- const _ = await c.arrayBuffer(), $ = `data:image/jpeg;base64,${ae(_)}`;
880
- return s("Recorded image fetched, timestamp:", u), l({
881
- imageData: $,
878
+ return q(c);
879
+ const g = await c.arrayBuffer(), S = `data:image/jpeg;base64,${ce(g)}`;
880
+ return s("Recorded image fetched, timestamp:", u), d({
881
+ imageData: S,
882
882
  timestamp: u,
883
- nextToken: R,
884
- prevToken: h,
885
- overlaySvg: E
883
+ nextToken: h,
884
+ prevToken: _,
885
+ overlaySvg: v
886
886
  });
887
887
  } catch (c) {
888
888
  return c instanceof Error && c.name === "AbortError" ? i("NETWORK_ERROR", "Request timed out") : i("NETWORK_ERROR", `Failed to fetch recorded image: ${String(c)}`);
@@ -890,7 +890,7 @@ async function tt(e) {
890
890
  clearTimeout(o);
891
891
  }
892
892
  }
893
- async function m(e) {
893
+ async function q(e) {
894
894
  const n = e.status;
895
895
  let t;
896
896
  try {
@@ -914,7 +914,7 @@ async function m(e) {
914
914
  return i("API_ERROR", `API error: ${t}`, n);
915
915
  }
916
916
  }
917
- async function we() {
917
+ async function je() {
918
918
  const e = f();
919
919
  if (!e.isAuthenticated)
920
920
  return i("AUTH_REQUIRED", "Authentication required");
@@ -922,7 +922,7 @@ async function we() {
922
922
  return i("AUTH_REQUIRED", "Base URL not configured");
923
923
  const n = `${e.baseUrl}/api/v3.0/media/session`;
924
924
  s("Fetching media session:", n);
925
- const { controller: t, timeoutId: r } = j();
925
+ const { controller: t, timeoutId: r } = w();
926
926
  try {
927
927
  const a = await fetch(n, {
928
928
  method: "GET",
@@ -933,20 +933,20 @@ async function we() {
933
933
  signal: t.signal
934
934
  });
935
935
  if (!a.ok)
936
- return m(a);
936
+ return q(a);
937
937
  const o = await a.json();
938
- return s("Media session URL received:", o.url), l(o);
938
+ return s("Media session URL received:", o.url), d(o);
939
939
  } catch (a) {
940
940
  return a instanceof Error && a.name === "AbortError" ? i("NETWORK_ERROR", "Request timed out") : i("NETWORK_ERROR", `Failed to fetch media session: ${String(a)}`);
941
941
  } finally {
942
942
  clearTimeout(r);
943
943
  }
944
944
  }
945
- async function nt() {
945
+ async function rt() {
946
946
  const e = f();
947
947
  if (!e.isAuthenticated)
948
948
  return i("AUTH_REQUIRED", "Authentication required");
949
- const n = await we();
949
+ const n = await je();
950
950
  if (n.error)
951
951
  return i(
952
952
  n.error.code,
@@ -957,7 +957,7 @@ async function nt() {
957
957
  return i("API_ERROR", "No session URL returned from media session endpoint");
958
958
  const t = n.data.url;
959
959
  s("Calling session URL to set cookie:", t);
960
- const { controller: r, timeoutId: a } = j();
960
+ const { controller: r, timeoutId: a } = w();
961
961
  try {
962
962
  const o = await fetch(t, {
963
963
  method: "GET",
@@ -973,14 +973,14 @@ async function nt() {
973
973
  const c = o.status;
974
974
  let u;
975
975
  try {
976
- const R = await o.json();
977
- u = R.message ?? R.error ?? o.statusText;
976
+ const h = await o.json();
977
+ u = h.message ?? h.error ?? o.statusText;
978
978
  } catch {
979
979
  u = o.statusText || "Unknown error";
980
980
  }
981
981
  return i("API_ERROR", `Failed to set media session cookie: ${u}`, c);
982
982
  }
983
- return s("Media session cookie set successfully"), l({
983
+ return s("Media session cookie set successfully"), d({
984
984
  success: !0,
985
985
  sessionUrl: t
986
986
  });
@@ -990,7 +990,7 @@ async function nt() {
990
990
  clearTimeout(a);
991
991
  }
992
992
  }
993
- async function it(e) {
993
+ async function ot(e) {
994
994
  const n = f();
995
995
  if (!n.isAuthenticated)
996
996
  return i("AUTH_REQUIRED", "Authentication required");
@@ -1010,14 +1010,14 @@ async function it(e) {
1010
1010
  signal: e?.signal
1011
1011
  });
1012
1012
  if (!o.ok)
1013
- return je(o);
1013
+ return Fe(o);
1014
1014
  const c = await o.json();
1015
- return s("Feeds fetched:", c.results?.length ?? 0, "feeds"), l(c);
1015
+ return s("Feeds fetched:", c.results?.length ?? 0, "feeds"), d(c);
1016
1016
  } catch (o) {
1017
1017
  return i("NETWORK_ERROR", `Failed to fetch feeds: ${String(o)}`);
1018
1018
  }
1019
1019
  }
1020
- async function je(e) {
1020
+ async function Fe(e) {
1021
1021
  const n = e.status;
1022
1022
  let t;
1023
1023
  try {
@@ -1041,7 +1041,7 @@ async function je(e) {
1041
1041
  return i("API_ERROR", t || e.statusText || "API error", n);
1042
1042
  }
1043
1043
  }
1044
- async function rt(e) {
1044
+ async function at(e) {
1045
1045
  const n = f();
1046
1046
  if (!n.isAuthenticated)
1047
1047
  return i("AUTH_REQUIRED", "Authentication required");
@@ -1068,12 +1068,12 @@ async function rt(e) {
1068
1068
  if (!o.ok)
1069
1069
  return B(o);
1070
1070
  const c = await o.json();
1071
- return s("Events fetched:", c.results?.length ?? 0, "events"), l(c);
1071
+ return s("Events fetched:", c.results?.length ?? 0, "events"), d(c);
1072
1072
  } catch (o) {
1073
1073
  return i("NETWORK_ERROR", `Failed to fetch events: ${String(o)}`);
1074
1074
  }
1075
1075
  }
1076
- async function ot(e, n) {
1076
+ async function ct(e, n) {
1077
1077
  const t = f();
1078
1078
  if (!t.isAuthenticated)
1079
1079
  return i("AUTH_REQUIRED", "Authentication required");
@@ -1096,12 +1096,12 @@ async function ot(e, n) {
1096
1096
  if (!c.ok)
1097
1097
  return B(c);
1098
1098
  const u = await c.json();
1099
- return s("Event fetched:", u.id), l(u);
1099
+ return s("Event fetched:", u.id), d(u);
1100
1100
  } catch (c) {
1101
1101
  return i("NETWORK_ERROR", `Failed to fetch event: ${String(c)}`);
1102
1102
  }
1103
1103
  }
1104
- async function at(e) {
1104
+ async function st(e) {
1105
1105
  const n = f();
1106
1106
  if (!n.isAuthenticated)
1107
1107
  return i("AUTH_REQUIRED", "Authentication required");
@@ -1122,12 +1122,12 @@ async function at(e) {
1122
1122
  if (!o.ok)
1123
1123
  return B(o);
1124
1124
  const c = await o.json();
1125
- return s("Event types fetched:", c.results?.length ?? 0, "types"), l(c);
1125
+ return s("Event types fetched:", c.results?.length ?? 0, "types"), d(c);
1126
1126
  } catch (o) {
1127
1127
  return i("NETWORK_ERROR", `Failed to fetch event types: ${String(o)}`);
1128
1128
  }
1129
1129
  }
1130
- async function ct(e) {
1130
+ async function ut(e) {
1131
1131
  const n = f();
1132
1132
  if (!n.isAuthenticated)
1133
1133
  return i("AUTH_REQUIRED", "Authentication required");
@@ -1150,7 +1150,7 @@ async function ct(e) {
1150
1150
  if (!o.ok)
1151
1151
  return B(o);
1152
1152
  const c = await o.json();
1153
- return s("Event field values fetched:", c.type?.length ?? 0, "types"), l(c);
1153
+ return s("Event field values fetched:", c.type?.length ?? 0, "types"), d(c);
1154
1154
  } catch (o) {
1155
1155
  return i("NETWORK_ERROR", `Failed to fetch event field values: ${String(o)}`);
1156
1156
  }
@@ -1177,7 +1177,372 @@ async function B(e) {
1177
1177
  return i("API_ERROR", `API error: ${t}`, n);
1178
1178
  }
1179
1179
  }
1180
- async function st(e) {
1180
+ const P = {
1181
+ // Detection events
1182
+ "een.motionDetectionEvent.v1": [
1183
+ "een.objectDetection.v1",
1184
+ "een.fullFrameImageUrl.v1",
1185
+ "een.croppedFrameImageUrl.v1",
1186
+ "een.displayOverlay.boundingBox.v1",
1187
+ "een.fullFrameImageUrlWithOverlay.v1"
1188
+ ],
1189
+ "een.motionInRegionDetectionEvent.v1": [
1190
+ "een.motionRegion.v1",
1191
+ "een.objectDetection.v1",
1192
+ "een.fullFrameImageUrl.v1",
1193
+ "een.croppedFrameImageUrl.v1",
1194
+ "een.displayOverlay.boundingBox.v1",
1195
+ "een.fullFrameImageUrlWithOverlay.v1"
1196
+ ],
1197
+ "een.personDetectionEvent.v1": [
1198
+ "een.objectDetection.v1",
1199
+ "een.personAttributes.v1",
1200
+ "een.fullFrameImageUrl.v1",
1201
+ "een.croppedFrameImageUrl.v1",
1202
+ "een.objectClassification.v1",
1203
+ "een.objectRegionMapping.v1",
1204
+ "een.displayOverlay.boundingBox.v1",
1205
+ "een.fullFrameImageUrlWithOverlay.v1",
1206
+ "een.geoLocation.v1"
1207
+ ],
1208
+ "een.personMotionDetectionEvent.v1": [
1209
+ "een.objectDetection.v1",
1210
+ "een.fullFrameImageUrl.v1",
1211
+ "een.croppedFrameImageUrl.v1",
1212
+ "een.objectClassification.v1"
1213
+ ],
1214
+ "een.animalDetectionEvent.v1": [
1215
+ "een.objectDetection.v1",
1216
+ "een.animalAttributes.v1",
1217
+ "een.fullFrameImageUrl.v1",
1218
+ "een.croppedFrameImageUrl.v1",
1219
+ "een.objectClassification.v1",
1220
+ "een.objectRegionMapping.v1",
1221
+ "een.displayOverlay.boundingBox.v1",
1222
+ "een.fullFrameImageUrlWithOverlay.v1"
1223
+ ],
1224
+ "een.faceDetectionEvent.v1": [
1225
+ "een.objectDetection.v1",
1226
+ "een.personAttributes.v1",
1227
+ "een.fullFrameImageUrl.v1",
1228
+ "een.croppedFrameImageUrl.v1",
1229
+ "een.objectClassification.v1",
1230
+ "een.objectRegionMapping.v1",
1231
+ "een.displayOverlay.boundingBox.v1",
1232
+ "een.fullFrameImageUrlWithOverlay.v1"
1233
+ ],
1234
+ "een.vehicleDetectionEvent.v1": [
1235
+ "een.objectDetection.v1",
1236
+ "een.fullFrameImageUrl.v1",
1237
+ "een.croppedFrameImageUrl.v1",
1238
+ "een.objectClassification.v1",
1239
+ "een.vehicleAttributes.v1",
1240
+ "een.objectRegionMapping.v1",
1241
+ "een.displayOverlay.boundingBox.v1",
1242
+ "een.fullFrameImageUrlWithOverlay.v1"
1243
+ ],
1244
+ "een.vehicleMotionDetectionEvent.v1": [
1245
+ "een.objectDetection.v1",
1246
+ "een.fullFrameImageUrl.v1",
1247
+ "een.croppedFrameImageUrl.v1",
1248
+ "een.objectClassification.v1",
1249
+ "een.vehicleAttributes.v1"
1250
+ ],
1251
+ "een.gunDetectionEvent.v1": [
1252
+ "een.fullFrameImageUrl.v1",
1253
+ "een.croppedFrameImageUrl.v1",
1254
+ "een.objectDetection.v1",
1255
+ "een.motionRegion.v1",
1256
+ "een.objectClassification.v1",
1257
+ "een.displayOverlay.boundingBox.v1",
1258
+ "een.fullFrameImageUrlWithOverlay.v1",
1259
+ "een.weaponAttributes.v1",
1260
+ "een.personAttributes.v1",
1261
+ "een.humanValidationDetails.v1"
1262
+ ],
1263
+ "een.weaponDetectionEvent.v1": [
1264
+ "een.fullFrameImageUrl.v1",
1265
+ "een.croppedFrameImageUrl.v1",
1266
+ "een.objectDetection.v1",
1267
+ "een.motionRegion.v1",
1268
+ "een.displayOverlay.boundingBox.v1",
1269
+ "een.fullFrameImageUrlWithOverlay.v1"
1270
+ ],
1271
+ "een.fallDetectionEvent.v1": [
1272
+ "een.objectDetection.v1",
1273
+ "een.fullFrameImageUrl.v1",
1274
+ "een.croppedFrameImageUrl.v1",
1275
+ "een.displayOverlay.boundingBox.v1",
1276
+ "een.fullFrameImageUrlWithOverlay.v1"
1277
+ ],
1278
+ "een.fireDetectionEvent.v1": [
1279
+ "een.objectDetection.v1",
1280
+ "een.objectClassification.v1",
1281
+ "een.croppedFrameImageUrl.v1",
1282
+ "een.fullFrameImageUrl.v1",
1283
+ "een.displayOverlay.boundingBox.v1",
1284
+ "een.fullFrameImageUrlWithOverlay.v1"
1285
+ ],
1286
+ "een.spillDetectionEvent.v1": [
1287
+ "een.objectDetection.v1",
1288
+ "een.objectClassification.v1",
1289
+ "een.croppedFrameImageUrl.v1",
1290
+ "een.fullFrameImageUrl.v1",
1291
+ "een.displayOverlay.boundingBox.v1",
1292
+ "een.fullFrameImageUrlWithOverlay.v1"
1293
+ ],
1294
+ "een.crowdFormationDetectionEvent.v1": [
1295
+ "een.objectDetection.v1",
1296
+ "een.objectClassification.v1",
1297
+ "een.croppedFrameImageUrl.v1",
1298
+ "een.fullFrameImageUrl.v1",
1299
+ "een.displayOverlay.boundingBox.v1",
1300
+ "een.fullFrameImageUrlWithOverlay.v1"
1301
+ ],
1302
+ // Camera analytics events
1303
+ "een.tamperDetectionEvent.v1": [
1304
+ "een.fullFrameImageUrl.v1"
1305
+ ],
1306
+ "een.loiterDetectionEvent.v1": [
1307
+ "een.loiterArea.v1",
1308
+ "een.objectDetection.v1",
1309
+ "een.fullFrameImageUrl.v1",
1310
+ "een.croppedFrameImageUrl.v1",
1311
+ "een.displayOverlay.boundingBox.v1",
1312
+ "een.fullFrameImageUrlWithOverlay.v1"
1313
+ ],
1314
+ "een.objectLineCrossEvent.v1": [
1315
+ "een.lineCrossLine.v1",
1316
+ "een.objectDetection.v1",
1317
+ "een.fullFrameImageUrl.v1",
1318
+ "een.croppedFrameImageUrl.v1",
1319
+ "een.entryDirection.v1",
1320
+ "een.displayOverlay.boundingBox.v1",
1321
+ "een.fullFrameImageUrlWithOverlay.v1"
1322
+ ],
1323
+ "een.objectLineCrossCountEvent.v1": [
1324
+ "een.lineCrossLine.v1",
1325
+ "een.objectDetection.v1",
1326
+ "een.fullFrameImageUrl.v1",
1327
+ "een.croppedFrameImageUrl.v1",
1328
+ "een.entryDirection.v1",
1329
+ "een.displayOverlay.boundingBox.v1",
1330
+ "een.fullFrameImageUrlWithOverlay.v1"
1331
+ ],
1332
+ "een.countedObjectLineCrossEvent.v1": [
1333
+ "een.countedLineCross.v1"
1334
+ ],
1335
+ "een.objectIntrusionEvent.v1": [
1336
+ "een.intrusionArea.v1",
1337
+ "een.objectDetection.v1",
1338
+ "een.fullFrameImageUrl.v1",
1339
+ "een.croppedFrameImageUrl.v1",
1340
+ "een.entryDirection.v1",
1341
+ "een.displayOverlay.boundingBox.v1",
1342
+ "een.fullFrameImageUrlWithOverlay.v1"
1343
+ ],
1344
+ "een.objectRemovalEvent.v1": [
1345
+ "een.monitoredArea.v1",
1346
+ "een.objectDetection.v1",
1347
+ "een.fullFrameImageUrl.v1",
1348
+ "een.croppedFrameImageUrl.v1",
1349
+ "een.displayOverlay.boundingBox.v1",
1350
+ "een.fullFrameImageUrlWithOverlay.v1"
1351
+ ],
1352
+ "een.personTailgateEvent.v1": [
1353
+ "een.objectDetection.v1",
1354
+ "een.fullFrameImageUrl.v1",
1355
+ "een.croppedFrameImageUrl.v1",
1356
+ "een.displayOverlay.boundingBox.v1",
1357
+ "een.fullFrameImageUrlWithOverlay.v1"
1358
+ ],
1359
+ "een.ppeViolationEvent.v1": [
1360
+ "een.objectDetection.v1",
1361
+ "een.personAttributes.v1",
1362
+ "een.fullFrameImageUrl.v1",
1363
+ "een.croppedFrameImageUrl.v1",
1364
+ "een.objectClassification.v1",
1365
+ "een.objectRegionMapping.v1",
1366
+ "een.displayOverlay.boundingBox.v1",
1367
+ "een.fullFrameImageUrlWithOverlay.v1"
1368
+ ],
1369
+ // AI/Scene events
1370
+ "een.sceneLabelEvent.v1": [
1371
+ "een.objectDetection.v1",
1372
+ "een.objectClassification.v1",
1373
+ "een.vehicleAttributes.v1",
1374
+ "een.personAttributes.v1",
1375
+ "een.animalAttributes.v1",
1376
+ "een.croppedFrameImageUrl.v1",
1377
+ "een.fullFrameImageUrl.v1",
1378
+ "een.objectRegionMapping.v1",
1379
+ "een.displayOverlay.boundingBox.v1",
1380
+ "een.customLabels.v1",
1381
+ "een.eevaAttributes.v1",
1382
+ "een.fullFrameImageUrlWithOverlay.v1"
1383
+ ],
1384
+ "een.eevaQueryEvent.v1": [
1385
+ "een.customLabels.v1",
1386
+ "een.eevaAttributes.v1",
1387
+ "een.objectDetection.v1",
1388
+ "een.fullFrameImageUrl.v1",
1389
+ "een.fullFrameImageUrlWithOverlay.v1",
1390
+ "een.displayOverlay.boundingBox.v1"
1391
+ ],
1392
+ // License plate and fleet recognition
1393
+ "een.lprPlateReadEvent.v1": [
1394
+ "een.objectDetection.v1",
1395
+ "een.lprDetection.v1",
1396
+ "een.vehicleAttributes.v1",
1397
+ "een.lprAccessType.v1",
1398
+ "een.userData.v1",
1399
+ "een.userTags.v1",
1400
+ "een.croppedFrameImageUrl.v1",
1401
+ "een.fullFrameImageUrl.v1",
1402
+ "een.displayOverlay.boundingBox.v1",
1403
+ "een.fullFrameImageUrlWithOverlay.v1",
1404
+ "een.vehicleListInfo.v1",
1405
+ "een.resourceDetails.v1",
1406
+ "een.vspInsightsSummary.v1"
1407
+ ],
1408
+ "een.fleetCodeRecognitionEvent.v1": [
1409
+ "een.objectDetection.v1",
1410
+ "een.dotNumberRecognition.v1",
1411
+ "een.truckNumberRecognition.v1",
1412
+ "een.trailerNumberRecognition.v1",
1413
+ "een.croppedFrameImageUrl.v1",
1414
+ "een.fullFrameImageUrl.v1",
1415
+ "een.recognizedText.v1",
1416
+ "een.resourceDetails.v1"
1417
+ ],
1418
+ // Audio detection
1419
+ "een.gunShotAudioDetectionEvent.v1": [
1420
+ "een.audioDetection.v1",
1421
+ "een.geoLocation.v1"
1422
+ ],
1423
+ "een.t3AlarmAudioDetectionEvent.v1": [
1424
+ "een.audioDetection.v1"
1425
+ ],
1426
+ "een.t4AlarmAudioDetectionEvent.v1": [
1427
+ "een.audioDetection.v1"
1428
+ ],
1429
+ // POS events
1430
+ "een.posTransactionEvent.v1": [
1431
+ "een.posTransactionStart.v1",
1432
+ "een.posTransactionEnd.v1",
1433
+ "een.posTransactionItem.v1",
1434
+ "een.posTransactionPayment.v1",
1435
+ "een.posTransactionCartChangeTrail.v1",
1436
+ "een.posTransactionCardLoadSummary.v1",
1437
+ "een.posTransactionFlag.v1",
1438
+ "een.posTransactionLabel.v1",
1439
+ "een.rawData.v1",
1440
+ "een.displayLocationSummary.v1",
1441
+ "een.fullFrameImageUrl.v1"
1442
+ ],
1443
+ // Device and system events
1444
+ "een.deviceCloudStatusUpdateEvent.v1": [
1445
+ "een.deviceCloudStatusUpdate.v1",
1446
+ "een.deviceCloudPreviousStatus.v1"
1447
+ ],
1448
+ "een.deviceCloudConnectionStatusUpdateEvent.v1": [
1449
+ "een.deviceCloudConnectionStatusUpdate.v1",
1450
+ "een.deviceCloudConnectionPreviousStatus.v1"
1451
+ ],
1452
+ "een.edgeReportedDeviceStatusEvent.v1": [
1453
+ "een.deviceCommonStatusUpdate.v1",
1454
+ "een.deviceErrorStatusUpdate.v1"
1455
+ ],
1456
+ "een.deviceIOEvent.v1": [
1457
+ "een.deviceIO.v1"
1458
+ ],
1459
+ "een.deviceOperationEvent.v1": [
1460
+ "een.resourceDetails.v1",
1461
+ "een.deviceOperationDetails.v1",
1462
+ "een.deviceOperationSubStep.v1",
1463
+ "een.deviceOperationUpdate.v1"
1464
+ ],
1465
+ "een.ptzPositionUpdateEvent.v1": [
1466
+ "een.ptzPositionUpdate.v1"
1467
+ ],
1468
+ // Sensor events
1469
+ "een.doorStatusEvent.v1": [
1470
+ "een.measurementStringValueUpdate.v1"
1471
+ ],
1472
+ "een.batteryLevelUpdateEvent.v1": [
1473
+ "een.batteryLevelUpdate.v1"
1474
+ ],
1475
+ "een.measurementThresholdStatusEvent.v1": [
1476
+ "een.measurementThresholdStatus.v1",
1477
+ "een.measurementValueUpdate.v1",
1478
+ "een.measurementStringValueUpdate.v1"
1479
+ ],
1480
+ "een.thermalCameraThresholdStatusEvent.v1": [
1481
+ "een.thermalCameraValueUpdate.v1",
1482
+ "een.thermalMonitoredArea.v1"
1483
+ ],
1484
+ // Resource management events
1485
+ "een.layoutCreationEvent.v1": ["een.resourceDetails.v1"],
1486
+ "een.layoutUpdateEvent.v1": ["een.resourceDetails.v1"],
1487
+ "een.layoutDeletionEvent.v1": ["een.resourceDetails.v1"],
1488
+ "een.deviceCreationEvent.v1": ["een.resourceDetails.v1"],
1489
+ "een.deviceUpdateEvent.v1": ["een.resourceDetails.v1"],
1490
+ "een.deviceDeletionEvent.v1": ["een.resourceDetails.v1"],
1491
+ "een.userCreationEvent.v1": ["een.resourceDetails.v1"],
1492
+ "een.userUpdateEvent.v1": ["een.resourceDetails.v1"],
1493
+ "een.userDeletionEvent.v1": ["een.resourceDetails.v1"],
1494
+ "een.accountCreationEvent.v1": ["een.resourceDetails.v1"],
1495
+ "een.accountUpdateEvent.v1": ["een.resourceDetails.v1"],
1496
+ "een.accountDeletionEvent.v1": ["een.resourceDetails.v1"],
1497
+ // Job events
1498
+ "een.jobCreationEvent.v1": ["een.jobDetails.v1", "een.ownerDetails.v1"],
1499
+ "een.jobUpdateEvent.v1": ["een.jobDetails.v1", "een.ownerDetails.v1"],
1500
+ "een.jobDeletionEvent.v1": ["een.ownerDetails.v1"],
1501
+ // Safety and protocol events (no data schemas)
1502
+ "een.panicButtonEvent.v1": ["een.geoLocation.v1"],
1503
+ "een.evacuateProtocolEvent.v1": [],
1504
+ "een.holdProtocolEvent.v1": [],
1505
+ "een.lockdownProtocolEvent.v1": [],
1506
+ "een.secureProtocolEvent.v1": [],
1507
+ "een.shelterProtocolEvent.v1": [],
1508
+ // Behavioral events (no data schemas)
1509
+ "een.violenceDetectionEvent.v1": [],
1510
+ "een.fightDetectionEvent.v1": [],
1511
+ "een.handsUpDetectionEvent.v1": [],
1512
+ "een.vapeDetectionEvent.v1": []
1513
+ };
1514
+ function se(e) {
1515
+ return P[e] ?? [];
1516
+ }
1517
+ function lt(e) {
1518
+ const n = /* @__PURE__ */ new Set();
1519
+ for (const t of e) {
1520
+ const r = se(t);
1521
+ for (const a of r)
1522
+ n.add(`data.${a}`);
1523
+ }
1524
+ return Array.from(n);
1525
+ }
1526
+ function dt(e) {
1527
+ return se(e).length > 0;
1528
+ }
1529
+ function ft(e) {
1530
+ const n = [];
1531
+ for (const [t, r] of Object.entries(P))
1532
+ r.includes(e) && n.push(t);
1533
+ return n;
1534
+ }
1535
+ function gt() {
1536
+ const e = /* @__PURE__ */ new Set();
1537
+ for (const n of Object.values(P))
1538
+ for (const t of n)
1539
+ e.add(t);
1540
+ return Array.from(e);
1541
+ }
1542
+ function ht() {
1543
+ return Object.keys(P);
1544
+ }
1545
+ async function _t(e) {
1181
1546
  const n = f();
1182
1547
  if (!n.isAuthenticated)
1183
1548
  return i("AUTH_REQUIRED", "Authentication required");
@@ -1202,7 +1567,7 @@ async function st(e) {
1202
1567
  if (!o.ok)
1203
1568
  return Le(o);
1204
1569
  const c = await o.json();
1205
- return s("Event metrics fetched:", c.length, "metrics"), l(c);
1570
+ return s("Event metrics fetched:", c.length, "metrics"), d(c);
1206
1571
  } catch (o) {
1207
1572
  return i("NETWORK_ERROR", `Failed to fetch event metrics: ${String(o)}`);
1208
1573
  }
@@ -1229,7 +1594,7 @@ async function Le(e) {
1229
1594
  return i("API_ERROR", `API error: ${t}`, n);
1230
1595
  }
1231
1596
  }
1232
- async function ut(e) {
1597
+ async function Rt(e) {
1233
1598
  const n = f();
1234
1599
  if (!n.isAuthenticated)
1235
1600
  return i("AUTH_REQUIRED", "Authentication required");
@@ -1248,14 +1613,14 @@ async function ut(e) {
1248
1613
  }
1249
1614
  });
1250
1615
  if (!o.ok)
1251
- return J(o);
1616
+ return X(o);
1252
1617
  const c = await o.json();
1253
- return s("Alerts fetched:", c.results?.length ?? 0, "alerts"), l(c);
1618
+ return s("Alerts fetched:", c.results?.length ?? 0, "alerts"), d(c);
1254
1619
  } catch (o) {
1255
1620
  return i("NETWORK_ERROR", `Failed to fetch alerts: ${String(o)}`);
1256
1621
  }
1257
1622
  }
1258
- async function dt(e, n) {
1623
+ async function pt(e, n) {
1259
1624
  const t = f();
1260
1625
  if (!t.isAuthenticated)
1261
1626
  return i("AUTH_REQUIRED", "Authentication required");
@@ -1276,14 +1641,14 @@ async function dt(e, n) {
1276
1641
  }
1277
1642
  });
1278
1643
  if (!c.ok)
1279
- return J(c);
1644
+ return X(c);
1280
1645
  const u = await c.json();
1281
- return s("Alert fetched:", u.id), l(u);
1646
+ return s("Alert fetched:", u.id), d(u);
1282
1647
  } catch (c) {
1283
1648
  return i("NETWORK_ERROR", `Failed to fetch alert: ${String(c)}`);
1284
1649
  }
1285
1650
  }
1286
- async function lt(e) {
1651
+ async function vt(e) {
1287
1652
  const n = f();
1288
1653
  if (!n.isAuthenticated)
1289
1654
  return i("AUTH_REQUIRED", "Authentication required");
@@ -1302,14 +1667,14 @@ async function lt(e) {
1302
1667
  }
1303
1668
  });
1304
1669
  if (!o.ok)
1305
- return J(o);
1670
+ return X(o);
1306
1671
  const c = await o.json();
1307
- return s("Alert types fetched:", c.results?.length ?? 0, "types"), l(c);
1672
+ return s("Alert types fetched:", c.results?.length ?? 0, "types"), d(c);
1308
1673
  } catch (o) {
1309
1674
  return i("NETWORK_ERROR", `Failed to fetch alert types: ${String(o)}`);
1310
1675
  }
1311
1676
  }
1312
- async function J(e) {
1677
+ async function X(e) {
1313
1678
  const n = e.status;
1314
1679
  let t;
1315
1680
  try {
@@ -1331,7 +1696,7 @@ async function J(e) {
1331
1696
  return i("API_ERROR", `API error: ${t}`, n);
1332
1697
  }
1333
1698
  }
1334
- async function ft(e) {
1699
+ async function Et(e) {
1335
1700
  const n = f();
1336
1701
  if (!n.isAuthenticated)
1337
1702
  return i("AUTH_REQUIRED", "Authentication required");
@@ -1350,14 +1715,14 @@ async function ft(e) {
1350
1715
  }
1351
1716
  });
1352
1717
  if (!o.ok)
1353
- return ce(o);
1718
+ return ue(o);
1354
1719
  const c = await o.json();
1355
- return s("Notifications fetched:", c.results?.length ?? 0, "notifications"), l(c);
1720
+ return s("Notifications fetched:", c.results?.length ?? 0, "notifications"), d(c);
1356
1721
  } catch (o) {
1357
1722
  return i("NETWORK_ERROR", `Failed to fetch notifications: ${String(o)}`);
1358
1723
  }
1359
1724
  }
1360
- async function _t(e) {
1725
+ async function At(e) {
1361
1726
  const n = f();
1362
1727
  if (!n.isAuthenticated)
1363
1728
  return i("AUTH_REQUIRED", "Authentication required");
@@ -1376,14 +1741,14 @@ async function _t(e) {
1376
1741
  }
1377
1742
  });
1378
1743
  if (!r.ok)
1379
- return ce(r);
1744
+ return ue(r);
1380
1745
  const a = await r.json();
1381
- return s("Notification fetched:", a.id), l(a);
1746
+ return s("Notification fetched:", a.id), d(a);
1382
1747
  } catch (r) {
1383
1748
  return i("NETWORK_ERROR", `Failed to fetch notification: ${String(r)}`);
1384
1749
  }
1385
1750
  }
1386
- async function ce(e) {
1751
+ async function ue(e) {
1387
1752
  const n = e.status;
1388
1753
  let t;
1389
1754
  try {
@@ -1405,7 +1770,7 @@ async function ce(e) {
1405
1770
  return i("API_ERROR", `API error: ${t}`, n);
1406
1771
  }
1407
1772
  }
1408
- async function Rt(e) {
1773
+ async function It(e) {
1409
1774
  const n = f();
1410
1775
  if (!n.isAuthenticated)
1411
1776
  return i("AUTH_REQUIRED", "Authentication required");
@@ -1424,14 +1789,14 @@ async function Rt(e) {
1424
1789
  }
1425
1790
  });
1426
1791
  if (!o.ok)
1427
- return P(o);
1792
+ return C(o);
1428
1793
  const c = await o.json();
1429
- return s("Event subscriptions fetched:", c.results?.length ?? 0, "subscriptions"), l(c);
1794
+ return s("Event subscriptions fetched:", c.results?.length ?? 0, "subscriptions"), d(c);
1430
1795
  } catch (o) {
1431
1796
  return i("NETWORK_ERROR", `Failed to fetch event subscriptions: ${String(o)}`);
1432
1797
  }
1433
1798
  }
1434
- async function ht(e) {
1799
+ async function Tt(e) {
1435
1800
  const n = f();
1436
1801
  if (!n.isAuthenticated)
1437
1802
  return i("AUTH_REQUIRED", "Authentication required");
@@ -1450,14 +1815,14 @@ async function ht(e) {
1450
1815
  }
1451
1816
  });
1452
1817
  if (!r.ok)
1453
- return P(r);
1818
+ return C(r);
1454
1819
  const a = await r.json();
1455
- return s("Event subscription fetched:", a.id), l(a);
1820
+ return s("Event subscription fetched:", a.id), d(a);
1456
1821
  } catch (r) {
1457
1822
  return i("NETWORK_ERROR", `Failed to fetch event subscription: ${String(r)}`);
1458
1823
  }
1459
1824
  }
1460
- async function gt(e) {
1825
+ async function Ut(e) {
1461
1826
  const n = f();
1462
1827
  if (!n.isAuthenticated)
1463
1828
  return i("AUTH_REQUIRED", "Authentication required");
@@ -1486,14 +1851,14 @@ async function gt(e) {
1486
1851
  body: JSON.stringify(e)
1487
1852
  });
1488
1853
  if (!r.ok)
1489
- return P(r);
1854
+ return C(r);
1490
1855
  const a = await r.json();
1491
- return s("Event subscription created:", a.id), l(a);
1856
+ return s("Event subscription created:", a.id), d(a);
1492
1857
  } catch (r) {
1493
1858
  return i("NETWORK_ERROR", `Failed to create event subscription: ${String(r)}`);
1494
1859
  }
1495
1860
  }
1496
- async function pt(e) {
1861
+ async function yt(e) {
1497
1862
  const n = f();
1498
1863
  if (!n.isAuthenticated)
1499
1864
  return i("AUTH_REQUIRED", "Authentication required");
@@ -1511,12 +1876,12 @@ async function pt(e) {
1511
1876
  Authorization: `Bearer ${n.token}`
1512
1877
  }
1513
1878
  });
1514
- return r.ok ? (s("Event subscription deleted:", e), l(void 0)) : P(r);
1879
+ return r.ok ? (s("Event subscription deleted:", e), d(void 0)) : C(r);
1515
1880
  } catch (r) {
1516
1881
  return i("NETWORK_ERROR", `Failed to delete event subscription: ${String(r)}`);
1517
1882
  }
1518
1883
  }
1519
- function Et(e, n) {
1884
+ function St(e, n) {
1520
1885
  const t = f();
1521
1886
  if (!t.isAuthenticated)
1522
1887
  return i("AUTH_REQUIRED", "Authentication required");
@@ -1525,26 +1890,26 @@ function Et(e, n) {
1525
1890
  if (!e)
1526
1891
  return i("VALIDATION_ERROR", "SSE URL is required");
1527
1892
  try {
1528
- const _ = new URL(e);
1893
+ const g = new URL(e);
1529
1894
  if (![".eagleeyenetworks.com", ".een.cloud"].some(
1530
- (p) => _.hostname === p.substring(1) || _.hostname.endsWith(p)
1895
+ (p) => g.hostname === p.substring(1) || g.hostname.endsWith(p)
1531
1896
  ))
1532
- return i("VALIDATION_ERROR", `SSE URL domain not allowed: ${_.hostname}`);
1897
+ return i("VALIDATION_ERROR", `SSE URL domain not allowed: ${g.hostname}`);
1533
1898
  } catch {
1534
1899
  return i("VALIDATION_ERROR", "Invalid SSE URL format");
1535
1900
  }
1536
1901
  const r = 1024 * 1024;
1537
1902
  let a = "connecting", o = new AbortController(), c = !1;
1538
- const u = (_) => {
1539
- a = _, n.onStatusChange?.(a);
1540
- }, R = () => {
1903
+ const u = (g) => {
1904
+ a = g, n.onStatusChange?.(a);
1905
+ }, h = () => {
1541
1906
  c || (c = !0, s("Closing SSE connection"), o?.abort(), o = null, u("disconnected"));
1542
1907
  };
1543
1908
  return (async () => {
1544
1909
  if (!(c || !o)) {
1545
1910
  u("connecting"), s("Connecting to SSE:", e);
1546
1911
  try {
1547
- const _ = await fetch(e, {
1912
+ const g = await fetch(e, {
1548
1913
  method: "GET",
1549
1914
  headers: {
1550
1915
  Accept: "text/event-stream",
@@ -1552,56 +1917,56 @@ function Et(e, n) {
1552
1917
  },
1553
1918
  signal: o.signal
1554
1919
  });
1555
- if (!_.ok)
1556
- throw new Error(`HTTP ${_.status}: ${_.statusText}`);
1557
- if (!_.body)
1920
+ if (!g.ok)
1921
+ throw new Error(`HTTP ${g.status}: ${g.statusText}`);
1922
+ if (!g.body)
1558
1923
  throw new Error("Response body is not available");
1559
1924
  u("connected"), s("SSE connected");
1560
- const S = _.body.getReader(), $ = new TextDecoder();
1925
+ const y = g.body.getReader(), S = new TextDecoder();
1561
1926
  let p = "";
1562
1927
  for (; !c; ) {
1563
- const { done: H, value: z } = await S.read();
1928
+ const { done: H, value: z } = await y.read();
1564
1929
  if (H) {
1565
1930
  s("SSE stream ended");
1566
1931
  break;
1567
1932
  }
1568
- if (p += $.decode(z, { stream: !0 }), p.length > r) {
1933
+ if (p += S.decode(z, { stream: !0 }), p.length > r) {
1569
1934
  s("SSE buffer exceeded maximum size, resetting"), p = "";
1570
1935
  continue;
1571
1936
  }
1572
- const N = p.split(`
1937
+ const F = p.split(`
1573
1938
  `);
1574
- p = N.pop() || "";
1575
- let y = "";
1576
- for (const D of N)
1577
- if (D.startsWith("data:")) {
1578
- const T = D.substring(5).trimStart();
1579
- y = y ? `${y}
1580
- ${T}` : T;
1581
- } else if (D === "" && y) {
1939
+ p = F.pop() || "";
1940
+ let U = "";
1941
+ for (const O of F)
1942
+ if (O.startsWith("data:")) {
1943
+ const A = O.substring(5).trimStart();
1944
+ U = U ? `${U}
1945
+ ${A}` : A;
1946
+ } else if (O === "" && U) {
1582
1947
  try {
1583
- const T = JSON.parse(y);
1584
- s("SSE event received:", T.type, T.actorId), n.onEvent(T);
1585
- } catch (T) {
1586
- s("Failed to parse SSE event:", T);
1948
+ const A = JSON.parse(U);
1949
+ s("SSE event received:", A.type, A.actorId), n.onEvent(A);
1950
+ } catch (A) {
1951
+ s("Failed to parse SSE event:", A);
1587
1952
  }
1588
- y = "";
1953
+ U = "";
1589
1954
  }
1590
1955
  }
1591
- } catch (_) {
1592
- if (c || _ instanceof Error && _.name === "AbortError")
1956
+ } catch (g) {
1957
+ if (c || g instanceof Error && g.name === "AbortError")
1593
1958
  return;
1594
- s("SSE error:", _), u("error"), n.onError?.(_ instanceof Error ? _ : new Error(String(_)));
1959
+ s("SSE error:", g), u("error"), n.onError?.(g instanceof Error ? g : new Error(String(g)));
1595
1960
  }
1596
1961
  }
1597
- })(), l({
1598
- close: R,
1962
+ })(), d({
1963
+ close: h,
1599
1964
  get status() {
1600
1965
  return a;
1601
1966
  }
1602
1967
  });
1603
1968
  }
1604
- async function P(e) {
1969
+ async function C(e) {
1605
1970
  const n = e.status;
1606
1971
  let t;
1607
1972
  try {
@@ -1623,7 +1988,7 @@ async function P(e) {
1623
1988
  return i("API_ERROR", t, n);
1624
1989
  }
1625
1990
  }
1626
- async function At(e) {
1991
+ async function Dt(e) {
1627
1992
  const n = f();
1628
1993
  if (!n.isAuthenticated)
1629
1994
  return i("AUTH_REQUIRED", "Authentication required");
@@ -1642,14 +2007,14 @@ async function At(e) {
1642
2007
  }
1643
2008
  });
1644
2009
  if (!o.ok)
1645
- return U(o);
2010
+ return T(o);
1646
2011
  const c = await o.json();
1647
- return s("Event alert condition rules fetched:", c.results?.length ?? 0, "rules"), l(c);
2012
+ return s("Event alert condition rules fetched:", c.results?.length ?? 0, "rules"), d(c);
1648
2013
  } catch (o) {
1649
2014
  return i("NETWORK_ERROR", `Failed to fetch event alert condition rules: ${String(o)}`);
1650
2015
  }
1651
2016
  }
1652
- async function Tt(e) {
2017
+ async function Ot(e) {
1653
2018
  const n = f();
1654
2019
  if (!n.isAuthenticated)
1655
2020
  return i("AUTH_REQUIRED", "Authentication required");
@@ -1668,14 +2033,14 @@ async function Tt(e) {
1668
2033
  }
1669
2034
  });
1670
2035
  if (!o.ok)
1671
- return U(o);
2036
+ return T(o);
1672
2037
  const c = await o.json();
1673
- return s("Event alert condition rule field values fetched"), l(c);
2038
+ return s("Event alert condition rule field values fetched"), d(c);
1674
2039
  } catch (o) {
1675
2040
  return i("NETWORK_ERROR", `Failed to fetch field values: ${String(o)}`);
1676
2041
  }
1677
2042
  }
1678
- async function It(e) {
2043
+ async function bt(e) {
1679
2044
  const n = f();
1680
2045
  if (!n.isAuthenticated)
1681
2046
  return i("AUTH_REQUIRED", "Authentication required");
@@ -1694,14 +2059,14 @@ async function It(e) {
1694
2059
  }
1695
2060
  });
1696
2061
  if (!r.ok)
1697
- return U(r);
2062
+ return T(r);
1698
2063
  const a = await r.json();
1699
- return s("Event alert condition rule fetched:", a.id), l(a);
2064
+ return s("Event alert condition rule fetched:", a.id), d(a);
1700
2065
  } catch (r) {
1701
2066
  return i("NETWORK_ERROR", `Failed to fetch event alert condition rule: ${String(r)}`);
1702
2067
  }
1703
2068
  }
1704
- async function Ut(e) {
2069
+ async function mt(e) {
1705
2070
  const n = f();
1706
2071
  if (!n.isAuthenticated)
1707
2072
  return i("AUTH_REQUIRED", "Authentication required");
@@ -1720,14 +2085,14 @@ async function Ut(e) {
1720
2085
  }
1721
2086
  });
1722
2087
  if (!o.ok)
1723
- return U(o);
2088
+ return T(o);
1724
2089
  const c = await o.json();
1725
- return s("Alert condition rules fetched:", c.results?.length ?? 0, "rules"), l(c);
2090
+ return s("Alert condition rules fetched:", c.results?.length ?? 0, "rules"), d(c);
1726
2091
  } catch (o) {
1727
2092
  return i("NETWORK_ERROR", `Failed to fetch alert condition rules: ${String(o)}`);
1728
2093
  }
1729
2094
  }
1730
- async function yt(e, n) {
2095
+ async function $t(e, n) {
1731
2096
  const t = f();
1732
2097
  if (!t.isAuthenticated)
1733
2098
  return i("AUTH_REQUIRED", "Authentication required");
@@ -1748,14 +2113,14 @@ async function yt(e, n) {
1748
2113
  }
1749
2114
  });
1750
2115
  if (!c.ok)
1751
- return U(c);
2116
+ return T(c);
1752
2117
  const u = await c.json();
1753
- return s("Alert condition rule fetched:", u.id), l(u);
2118
+ return s("Alert condition rule fetched:", u.id), d(u);
1754
2119
  } catch (c) {
1755
2120
  return i("NETWORK_ERROR", `Failed to fetch alert condition rule: ${String(c)}`);
1756
2121
  }
1757
2122
  }
1758
- async function St(e) {
2123
+ async function kt(e) {
1759
2124
  const n = f();
1760
2125
  if (!n.isAuthenticated)
1761
2126
  return i("AUTH_REQUIRED", "Authentication required");
@@ -1774,14 +2139,14 @@ async function St(e) {
1774
2139
  }
1775
2140
  });
1776
2141
  if (!o.ok)
1777
- return U(o);
2142
+ return T(o);
1778
2143
  const c = await o.json();
1779
- return s("Alert action rules fetched:", c.results?.length ?? 0, "rules"), l(c);
2144
+ return s("Alert action rules fetched:", c.results?.length ?? 0, "rules"), d(c);
1780
2145
  } catch (o) {
1781
2146
  return i("NETWORK_ERROR", `Failed to fetch alert action rules: ${String(o)}`);
1782
2147
  }
1783
2148
  }
1784
- async function $t(e) {
2149
+ async function wt(e) {
1785
2150
  const n = f();
1786
2151
  if (!n.isAuthenticated)
1787
2152
  return i("AUTH_REQUIRED", "Authentication required");
@@ -1800,14 +2165,14 @@ async function $t(e) {
1800
2165
  }
1801
2166
  });
1802
2167
  if (!r.ok)
1803
- return U(r);
2168
+ return T(r);
1804
2169
  const a = await r.json();
1805
- return s("Alert action rule fetched:", a.id), l(a);
2170
+ return s("Alert action rule fetched:", a.id), d(a);
1806
2171
  } catch (r) {
1807
2172
  return i("NETWORK_ERROR", `Failed to fetch alert action rule: ${String(r)}`);
1808
2173
  }
1809
2174
  }
1810
- async function vt(e) {
2175
+ async function jt(e) {
1811
2176
  const n = f();
1812
2177
  if (!n.isAuthenticated)
1813
2178
  return i("AUTH_REQUIRED", "Authentication required");
@@ -1826,14 +2191,14 @@ async function vt(e) {
1826
2191
  }
1827
2192
  });
1828
2193
  if (!o.ok)
1829
- return U(o);
2194
+ return T(o);
1830
2195
  const c = await o.json();
1831
- return s("Alert actions fetched:", c.results?.length ?? 0, "actions"), l(c);
2196
+ return s("Alert actions fetched:", c.results?.length ?? 0, "actions"), d(c);
1832
2197
  } catch (o) {
1833
2198
  return i("NETWORK_ERROR", `Failed to fetch alert actions: ${String(o)}`);
1834
2199
  }
1835
2200
  }
1836
- async function Dt(e) {
2201
+ async function Ft(e) {
1837
2202
  const n = f();
1838
2203
  if (!n.isAuthenticated)
1839
2204
  return i("AUTH_REQUIRED", "Authentication required");
@@ -1852,14 +2217,14 @@ async function Dt(e) {
1852
2217
  }
1853
2218
  });
1854
2219
  if (!r.ok)
1855
- return U(r);
2220
+ return T(r);
1856
2221
  const a = await r.json();
1857
- return s("Alert action fetched:", a.id), l(a);
2222
+ return s("Alert action fetched:", a.id), d(a);
1858
2223
  } catch (r) {
1859
2224
  return i("NETWORK_ERROR", `Failed to fetch alert action: ${String(r)}`);
1860
2225
  }
1861
2226
  }
1862
- async function U(e) {
2227
+ async function T(e) {
1863
2228
  const n = e.status;
1864
2229
  let t;
1865
2230
  try {
@@ -1881,7 +2246,7 @@ async function U(e) {
1881
2246
  return i("API_ERROR", `API error: ${t}`, n);
1882
2247
  }
1883
2248
  }
1884
- async function Ot(e) {
2249
+ async function Lt(e) {
1885
2250
  const n = f();
1886
2251
  if (!n.isAuthenticated)
1887
2252
  return i("AUTH_REQUIRED", "Authentication required");
@@ -1929,7 +2294,7 @@ async function Ot(e) {
1929
2294
  if (!c.ok)
1930
2295
  return Ne(c);
1931
2296
  const u = await c.json();
1932
- return s("Export job created:", u.id), l(u);
2297
+ return s("Export job created:", u.id), d(u);
1933
2298
  } catch (c) {
1934
2299
  return i("NETWORK_ERROR", `Failed to create export job: ${String(c)}`);
1935
2300
  }
@@ -1956,7 +2321,7 @@ async function Ne(e) {
1956
2321
  return i("API_ERROR", `API error: ${t}`, n);
1957
2322
  }
1958
2323
  }
1959
- async function kt(e) {
2324
+ async function Nt(e) {
1960
2325
  const n = f();
1961
2326
  if (!n.isAuthenticated)
1962
2327
  return i("AUTH_REQUIRED", "Authentication required");
@@ -1975,14 +2340,14 @@ async function kt(e) {
1975
2340
  }
1976
2341
  });
1977
2342
  if (!o.ok)
1978
- return X(o);
2343
+ return Y(o);
1979
2344
  const c = await o.json();
1980
- return s("Jobs fetched:", c.results?.length ?? 0, "jobs"), l(c);
2345
+ return s("Jobs fetched:", c.results?.length ?? 0, "jobs"), d(c);
1981
2346
  } catch (o) {
1982
2347
  return i("NETWORK_ERROR", `Failed to fetch jobs: ${String(o)}`);
1983
2348
  }
1984
2349
  }
1985
- async function bt(e, n) {
2350
+ async function qt(e, n) {
1986
2351
  const t = f();
1987
2352
  if (!t.isAuthenticated)
1988
2353
  return i("AUTH_REQUIRED", "Authentication required");
@@ -2003,14 +2368,14 @@ async function bt(e, n) {
2003
2368
  }
2004
2369
  });
2005
2370
  if (!c.ok)
2006
- return X(c);
2371
+ return Y(c);
2007
2372
  const u = await c.json();
2008
- return s("Job fetched:", u.arguments?.originalRequest?.name || u.id, "state:", u.state), l(u);
2373
+ return s("Job fetched:", u.arguments?.originalRequest?.name || u.id, "state:", u.state), d(u);
2009
2374
  } catch (c) {
2010
2375
  return i("NETWORK_ERROR", `Failed to fetch job: ${String(c)}`);
2011
2376
  }
2012
2377
  }
2013
- async function wt(e) {
2378
+ async function Bt(e) {
2014
2379
  const n = f();
2015
2380
  if (!n.isAuthenticated)
2016
2381
  return i("AUTH_REQUIRED", "Authentication required");
@@ -2027,12 +2392,12 @@ async function wt(e) {
2027
2392
  Authorization: `Bearer ${n.token}`
2028
2393
  }
2029
2394
  });
2030
- return r.ok ? (s("Job deleted:", e), l(void 0)) : X(r);
2395
+ return r.ok ? (s("Job deleted:", e), d(void 0)) : Y(r);
2031
2396
  } catch (r) {
2032
2397
  return i("NETWORK_ERROR", `Failed to delete job: ${String(r)}`);
2033
2398
  }
2034
2399
  }
2035
- async function X(e) {
2400
+ async function Y(e) {
2036
2401
  const n = e.status;
2037
2402
  let t;
2038
2403
  try {
@@ -2054,7 +2419,7 @@ async function X(e) {
2054
2419
  return i("API_ERROR", `API error: ${t}`, n);
2055
2420
  }
2056
2421
  }
2057
- async function jt(e) {
2422
+ async function Pt(e) {
2058
2423
  const n = f();
2059
2424
  if (!n.isAuthenticated)
2060
2425
  return i("AUTH_REQUIRED", "Authentication required");
@@ -2073,14 +2438,14 @@ async function jt(e) {
2073
2438
  }
2074
2439
  });
2075
2440
  if (!o.ok)
2076
- return L(o);
2441
+ return j(o);
2077
2442
  const c = await o.json();
2078
- return s("Files fetched:", c.results?.length ?? 0, "files"), l(c);
2443
+ return s("Files fetched:", c.results?.length ?? 0, "files"), d(c);
2079
2444
  } catch (o) {
2080
2445
  return i("NETWORK_ERROR", `Failed to fetch files: ${String(o)}`);
2081
2446
  }
2082
2447
  }
2083
- async function Lt(e, n) {
2448
+ async function Ct(e, n) {
2084
2449
  const t = f();
2085
2450
  if (!t.isAuthenticated)
2086
2451
  return i("AUTH_REQUIRED", "Authentication required");
@@ -2101,14 +2466,14 @@ async function Lt(e, n) {
2101
2466
  }
2102
2467
  });
2103
2468
  if (!c.ok)
2104
- return L(c);
2469
+ return j(c);
2105
2470
  const u = await c.json();
2106
- return s("File fetched:", u.name), l(u);
2471
+ return s("File fetched:", u.name), d(u);
2107
2472
  } catch (c) {
2108
2473
  return i("NETWORK_ERROR", `Failed to fetch file: ${String(c)}`);
2109
2474
  }
2110
2475
  }
2111
- async function Nt(e) {
2476
+ async function Ht(e) {
2112
2477
  const n = f();
2113
2478
  if (!n.isAuthenticated)
2114
2479
  return i("AUTH_REQUIRED", "Authentication required");
@@ -2133,14 +2498,14 @@ async function Nt(e) {
2133
2498
  body: JSON.stringify(r)
2134
2499
  });
2135
2500
  if (!a.ok)
2136
- return L(a);
2501
+ return j(a);
2137
2502
  const o = await a.json();
2138
- return s("File created:", o.id), l(o);
2503
+ return s("File created:", o.id), d(o);
2139
2504
  } catch (a) {
2140
2505
  return i("NETWORK_ERROR", `Failed to create file: ${String(a)}`);
2141
2506
  }
2142
2507
  }
2143
- async function qt(e) {
2508
+ async function zt(e) {
2144
2509
  const n = f();
2145
2510
  if (!n.isAuthenticated)
2146
2511
  return i("AUTH_REQUIRED", "Authentication required");
@@ -2158,25 +2523,25 @@ async function qt(e) {
2158
2523
  }
2159
2524
  });
2160
2525
  if (!r.ok)
2161
- return L(r);
2526
+ return j(r);
2162
2527
  const a = await r.blob(), o = r.headers.get("Content-Disposition");
2163
2528
  let c = "download";
2164
2529
  if (o) {
2165
- const h = o.match(/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/);
2166
- h && h[1] && (c = h[1].replace(/['"]/g, ""));
2530
+ const _ = o.match(/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/);
2531
+ _ && _[1] && (c = _[1].replace(/['"]/g, ""));
2167
2532
  }
2168
- const u = r.headers.get("Content-Type") || "application/octet-stream", R = {
2533
+ const u = r.headers.get("Content-Type") || "application/octet-stream", h = {
2169
2534
  blob: a,
2170
2535
  filename: c,
2171
2536
  contentType: u,
2172
2537
  size: a.size
2173
2538
  };
2174
- return s("File downloaded:", c, a.size, "bytes"), l(R);
2539
+ return s("File downloaded:", c, a.size, "bytes"), d(h);
2175
2540
  } catch (r) {
2176
2541
  return i("NETWORK_ERROR", `Failed to download file: ${String(r)}`);
2177
2542
  }
2178
2543
  }
2179
- async function Ft(e) {
2544
+ async function Qt(e) {
2180
2545
  const n = f();
2181
2546
  if (!n.isAuthenticated)
2182
2547
  return i("AUTH_REQUIRED", "Authentication required");
@@ -2193,12 +2558,12 @@ async function Ft(e) {
2193
2558
  Authorization: `Bearer ${n.token}`
2194
2559
  }
2195
2560
  });
2196
- return r.ok ? (s("File deleted (recycled):", e), l(void 0)) : L(r);
2561
+ return r.ok ? (s("File deleted (recycled):", e), d(void 0)) : j(r);
2197
2562
  } catch (r) {
2198
2563
  return i("NETWORK_ERROR", `Failed to delete file: ${String(r)}`);
2199
2564
  }
2200
2565
  }
2201
- async function L(e) {
2566
+ async function j(e) {
2202
2567
  const n = e.status;
2203
2568
  let t;
2204
2569
  try {
@@ -2220,7 +2585,7 @@ async function L(e) {
2220
2585
  return i("API_ERROR", `API error: ${t}`, n);
2221
2586
  }
2222
2587
  }
2223
- async function mt(e) {
2588
+ async function xt(e) {
2224
2589
  const n = f();
2225
2590
  if (!n.isAuthenticated)
2226
2591
  return i("AUTH_REQUIRED", "Authentication required");
@@ -2239,14 +2604,14 @@ async function mt(e) {
2239
2604
  }
2240
2605
  });
2241
2606
  if (!o.ok)
2242
- return Y(o);
2607
+ return Z(o);
2243
2608
  const c = await o.json();
2244
- return s("Downloads fetched:", c.results?.length ?? 0, "downloads"), l(c);
2609
+ return s("Downloads fetched:", c.results?.length ?? 0, "downloads"), d(c);
2245
2610
  } catch (o) {
2246
2611
  return i("NETWORK_ERROR", `Failed to fetch downloads: ${String(o)}`);
2247
2612
  }
2248
2613
  }
2249
- async function Bt(e, n) {
2614
+ async function Wt(e, n) {
2250
2615
  const t = f();
2251
2616
  if (!t.isAuthenticated)
2252
2617
  return i("AUTH_REQUIRED", "Authentication required");
@@ -2267,14 +2632,14 @@ async function Bt(e, n) {
2267
2632
  }
2268
2633
  });
2269
2634
  if (!c.ok)
2270
- return Y(c);
2635
+ return Z(c);
2271
2636
  const u = await c.json();
2272
- return s("Download fetched:", u.name, "status:", u.status), l(u);
2637
+ return s("Download fetched:", u.name, "status:", u.status), d(u);
2273
2638
  } catch (c) {
2274
2639
  return i("NETWORK_ERROR", `Failed to fetch download: ${String(c)}`);
2275
2640
  }
2276
2641
  }
2277
- async function Pt(e) {
2642
+ async function Vt(e) {
2278
2643
  const n = f();
2279
2644
  if (!n.isAuthenticated)
2280
2645
  return i("AUTH_REQUIRED", "Authentication required");
@@ -2292,25 +2657,25 @@ async function Pt(e) {
2292
2657
  }
2293
2658
  });
2294
2659
  if (!r.ok)
2295
- return Y(r);
2660
+ return Z(r);
2296
2661
  const a = await r.blob(), o = r.headers.get("Content-Disposition");
2297
2662
  let c = "download";
2298
2663
  if (o) {
2299
- const h = o.match(/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/);
2300
- h && h[1] && (c = h[1].replace(/['"]/g, ""));
2664
+ const _ = o.match(/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/);
2665
+ _ && _[1] && (c = _[1].replace(/['"]/g, ""));
2301
2666
  }
2302
- const u = r.headers.get("Content-Type") || "application/octet-stream", R = {
2667
+ const u = r.headers.get("Content-Type") || "application/octet-stream", h = {
2303
2668
  blob: a,
2304
2669
  filename: c,
2305
2670
  contentType: u,
2306
2671
  size: a.size
2307
2672
  };
2308
- return s("Downloaded:", c, a.size, "bytes"), l(R);
2673
+ return s("Downloaded:", c, a.size, "bytes"), d(h);
2309
2674
  } catch (r) {
2310
2675
  return i("NETWORK_ERROR", `Failed to download: ${String(r)}`);
2311
2676
  }
2312
2677
  }
2313
- async function Y(e) {
2678
+ async function Z(e) {
2314
2679
  const n = e.status;
2315
2680
  let t;
2316
2681
  try {
@@ -2333,75 +2698,82 @@ async function Y(e) {
2333
2698
  }
2334
2699
  }
2335
2700
  export {
2336
- me as STORAGE_STRATEGY_DESCRIPTIONS,
2337
- Nt as addFile,
2338
- Et as connectToEventSubscription,
2339
- gt as createEventSubscription,
2340
- Ot as createExportJob,
2341
- Je as createLayout,
2342
- pt as deleteEventSubscription,
2343
- Ft as deleteFile,
2344
- wt as deleteJob,
2345
- Ye as deleteLayout,
2346
- Pt as downloadDownload,
2347
- qt as downloadFile,
2701
+ P as EVENT_TYPE_DATA_SCHEMAS,
2702
+ Pe as STORAGE_STRATEGY_DESCRIPTIONS,
2703
+ Ht as addFile,
2704
+ St as connectToEventSubscription,
2705
+ Ut as createEventSubscription,
2706
+ Lt as createExportJob,
2707
+ Ye as createLayout,
2708
+ yt as deleteEventSubscription,
2709
+ Qt as deleteFile,
2710
+ Bt as deleteJob,
2711
+ et as deleteLayout,
2712
+ Vt as downloadDownload,
2713
+ zt as downloadFile,
2714
+ dt as eventTypeHasDataSchemas,
2348
2715
  i as failure,
2349
2716
  I as formatTimestamp,
2350
- ie as getAccessToken,
2351
- dt as getAlert,
2352
- Dt as getAlertAction,
2353
- $t as getAlertActionRule,
2354
- yt as getAlertConditionRule,
2355
- Se as getAuthUrl,
2356
- Ke as getBridge,
2357
- We as getBridges,
2358
- Ve as getCamera,
2359
- xe as getCameras,
2360
- Ie as getClientId,
2361
- He as getConfig,
2362
- ze as getCurrentUser,
2363
- Bt as getDownload,
2364
- ot as getEvent,
2365
- It as getEventAlertConditionRule,
2366
- Tt as getEventAlertConditionRuleFieldValues,
2367
- st as getEventMetrics,
2368
- ht as getEventSubscription,
2369
- Lt as getFile,
2370
- bt as getJob,
2371
- Ge as getLayout,
2372
- Me as getLayouts,
2373
- et as getLiveImage,
2374
- we as getMediaSession,
2375
- _t as getNotification,
2376
- M as getProxyUrl,
2377
- tt as getRecordedImage,
2378
- ne as getRedirectUri,
2379
- Be as getStorageStrategy,
2380
- Ce as getUser,
2381
- Qe as getUsers,
2382
- De as handleAuthCallback,
2383
- Pe as initEenToolkit,
2384
- nt as initMediaSession,
2385
- St as listAlertActionRules,
2386
- vt as listAlertActions,
2387
- Ut as listAlertConditionRules,
2388
- lt as listAlertTypes,
2389
- ut as listAlerts,
2390
- mt as listDownloads,
2391
- At as listEventAlertConditionRules,
2392
- ct as listEventFieldValues,
2393
- Rt as listEventSubscriptions,
2394
- at as listEventTypes,
2395
- rt as listEvents,
2396
- it as listFeeds,
2397
- jt as listFiles,
2398
- kt as listJobs,
2399
- Ze as listMedia,
2400
- ft as listNotifications,
2401
- $e as refreshToken,
2402
- ve as revokeToken,
2403
- l as success,
2404
- Xe as updateLayout,
2717
+ re as getAccessToken,
2718
+ pt as getAlert,
2719
+ Ft as getAlertAction,
2720
+ wt as getAlertActionRule,
2721
+ $t as getAlertConditionRule,
2722
+ gt as getAllDataSchemas,
2723
+ ht as getAllKnownEventTypes,
2724
+ De as getAuthUrl,
2725
+ Ge as getBridge,
2726
+ Ke as getBridges,
2727
+ Me as getCamera,
2728
+ Ve as getCameras,
2729
+ Ue as getClientId,
2730
+ ze as getConfig,
2731
+ Qe as getCurrentUser,
2732
+ se as getDataSchemasForEventType,
2733
+ Wt as getDownload,
2734
+ ct as getEvent,
2735
+ bt as getEventAlertConditionRule,
2736
+ Ot as getEventAlertConditionRuleFieldValues,
2737
+ _t as getEventMetrics,
2738
+ Tt as getEventSubscription,
2739
+ ft as getEventTypesForDataSchema,
2740
+ Ct as getFile,
2741
+ lt as getIncludeParameterForEventTypes,
2742
+ qt as getJob,
2743
+ Xe as getLayout,
2744
+ Je as getLayouts,
2745
+ nt as getLiveImage,
2746
+ je as getMediaSession,
2747
+ At as getNotification,
2748
+ G as getProxyUrl,
2749
+ it as getRecordedImage,
2750
+ ie as getRedirectUri,
2751
+ Ce as getStorageStrategy,
2752
+ We as getUser,
2753
+ xe as getUsers,
2754
+ me as handleAuthCallback,
2755
+ He as initEenToolkit,
2756
+ rt as initMediaSession,
2757
+ kt as listAlertActionRules,
2758
+ jt as listAlertActions,
2759
+ mt as listAlertConditionRules,
2760
+ vt as listAlertTypes,
2761
+ Rt as listAlerts,
2762
+ xt as listDownloads,
2763
+ Dt as listEventAlertConditionRules,
2764
+ ut as listEventFieldValues,
2765
+ It as listEventSubscriptions,
2766
+ st as listEventTypes,
2767
+ at as listEvents,
2768
+ ot as listFeeds,
2769
+ Pt as listFiles,
2770
+ Nt as listJobs,
2771
+ tt as listMedia,
2772
+ Et as listNotifications,
2773
+ Oe as refreshToken,
2774
+ be as revokeToken,
2775
+ d as success,
2776
+ Ze as updateLayout,
2405
2777
  f as useAuthStore
2406
2778
  };
2407
2779
  //# sourceMappingURL=index.js.map