@telia-ace/alliance-utilities 1.0.12-next.0 → 1.0.12-next.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # @telia-ace/alliance-utilities
2
2
 
3
+ ## 1.0.12-next.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [9191022]
8
+ - @telia-ace/alliance-framework@1.0.12-next.2
9
+
10
+ ## 1.0.12-next.1
11
+
12
+ ### Patch Changes
13
+
14
+ - 59f0d3f: Move `getTranslator()` to `@telia-ace/alliance-utilities`.
15
+ - 59f0d3f: Remove unnecessary scripts.
16
+ - 59f0d3f: Add `getCurrentUser`, move `hasPermission` and `isSystemAdmin` into current user object.
17
+ - Updated dependencies [59f0d3f]
18
+ - Updated dependencies [59f0d3f]
19
+ - @telia-ace/alliance-framework@1.0.12-next.1
20
+ - @telia-ace/alliance-internal-client-utilities@1.0.2-next.0
21
+
3
22
  ## 1.0.12-next.0
4
23
 
5
24
  ### Patch Changes
@@ -1,4 +1,8 @@
1
1
  type CurrentUser = {
2
+ displayName: string;
3
+ email: string;
4
+ type: 'system-admin' | 'user';
5
+ objectId: string;
2
6
  permissions: {
3
7
  permission: {
4
8
  name: string;
@@ -7,10 +11,8 @@ type CurrentUser = {
7
11
  };
8
12
  };
9
13
  }[];
10
- email: string;
11
- type: 'system-admin' | 'user';
14
+ hasPermission: (appName: string, permissionName: string) => boolean;
15
+ isSystemAdmin: () => boolean;
12
16
  };
13
17
  export declare function getCurrentUser(): Promise<CurrentUser>;
14
- export declare function isSystemAdmin(): Promise<boolean>;
15
- export declare function hasPermission(appName: string, permissionName: string): Promise<boolean>;
16
18
  export {};
@@ -0,0 +1,6 @@
1
+ import { type AppManifest } from '@telia-ace/alliance-framework';
2
+ type RecordEntries = Record<string, string>;
3
+ export type TranslatorFunction = (key: string, params?: RecordEntries) => string;
4
+ export declare function getDefaultLocalization(manifest?: AppManifest): RecordEntries;
5
+ export declare function getTranslator(): Promise<TranslatorFunction>;
6
+ export {};
package/dist/index.d.ts CHANGED
@@ -1 +1,2 @@
1
- export { getCurrentUser, hasPermission, isSystemAdmin } from './current-user';
1
+ export { getCurrentUser } from './get-current-user';
2
+ export { getTranslator, type TranslatorFunction } from './get-translator';
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*! js-cookie v3.0.5 | MIT */
2
- function k(e) {
2
+ function F(e) {
3
3
  for (var t = 1; t < arguments.length; t++) {
4
4
  var r = arguments[t];
5
5
  for (var a in r)
@@ -7,7 +7,7 @@ function k(e) {
7
7
  }
8
8
  return e;
9
9
  }
10
- var H = {
10
+ var X = {
11
11
  read: function(e) {
12
12
  return e[0] === '"' && (e = e.slice(1, -1)), e.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
13
13
  },
@@ -18,48 +18,48 @@ var H = {
18
18
  );
19
19
  }
20
20
  };
21
- function j(e, t) {
22
- function r(i, d, p) {
21
+ function P(e, t) {
22
+ function r(i, p, l) {
23
23
  if (!(typeof document > "u")) {
24
- p = k({}, t, p), typeof p.expires == "number" && (p.expires = new Date(Date.now() + p.expires * 864e5)), p.expires && (p.expires = p.expires.toUTCString()), i = encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
25
- var l = "";
26
- for (var c in p)
27
- p[c] && (l += "; " + c, p[c] !== !0 && (l += "=" + p[c].split(";")[0]));
28
- return document.cookie = i + "=" + e.write(d, i) + l;
24
+ l = F({}, t, l), typeof l.expires == "number" && (l.expires = new Date(Date.now() + l.expires * 864e5)), l.expires && (l.expires = l.expires.toUTCString()), i = encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
25
+ var d = "";
26
+ for (var c in l)
27
+ l[c] && (d += "; " + c, l[c] !== !0 && (d += "=" + l[c].split(";")[0]));
28
+ return document.cookie = i + "=" + e.write(p, i) + d;
29
29
  }
30
30
  }
31
31
  function a(i) {
32
32
  if (!(typeof document > "u" || arguments.length && !i)) {
33
- for (var d = document.cookie ? document.cookie.split("; ") : [], p = {}, l = 0; l < d.length; l++) {
34
- var c = d[l].split("="), u = c.slice(1).join("=");
33
+ for (var p = document.cookie ? document.cookie.split("; ") : [], l = {}, d = 0; d < p.length; d++) {
34
+ var c = p[d].split("="), u = c.slice(1).join("=");
35
35
  try {
36
36
  var o = decodeURIComponent(c[0]);
37
- if (p[o] = e.read(u, o), i === o)
37
+ if (l[o] = e.read(u, o), i === o)
38
38
  break;
39
39
  } catch {
40
40
  }
41
41
  }
42
- return i ? p[i] : p;
42
+ return i ? l[i] : l;
43
43
  }
44
44
  }
45
45
  return Object.create(
46
46
  {
47
47
  set: r,
48
48
  get: a,
49
- remove: function(i, d) {
49
+ remove: function(i, p) {
50
50
  r(
51
51
  i,
52
52
  "",
53
- k({}, d, {
53
+ F({}, p, {
54
54
  expires: -1
55
55
  })
56
56
  );
57
57
  },
58
58
  withAttributes: function(i) {
59
- return j(this.converter, k({}, this.attributes, i));
59
+ return P(this.converter, F({}, this.attributes, i));
60
60
  },
61
61
  withConverter: function(i) {
62
- return j(k({}, this.converter, i), this.attributes);
62
+ return P(F({}, this.converter, i), this.attributes);
63
63
  }
64
64
  },
65
65
  {
@@ -68,11 +68,11 @@ function j(e, t) {
68
68
  }
69
69
  );
70
70
  }
71
- var X = j(H, { path: "/" }), Y = Object.defineProperty, ee = (e, t, r) => t in e ? Y(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, I = (e, t, r) => (ee(e, typeof t != "symbol" ? t + "" : t, r), r), q = /* @__PURE__ */ ((e) => (e[e.AlreadyInitialized = 1e3] = "AlreadyInitialized", e[e.NoAppNameOrKey = 1001] = "NoAppNameOrKey", e[e.MissingAppController = 1002] = "MissingAppController", e[e.MissingCapabilityOnApp = 1003] = "MissingCapabilityOnApp", e[e.MissingManagedObjectProvider = 1004] = "MissingManagedObjectProvider", e[e.NoManifest = 1005] = "NoManifest", e[e.NoRootElement = 1006] = "NoRootElement", e[e.NoView = 1007] = "NoView", e[e.CookieKeyNotDefined = 1008] = "CookieKeyNotDefined", e[e.CookieCategoryNotAllowed = 1009] = "CookieCategoryNotAllowed", e[e.StorageKeyNotDefined = 1010] = "StorageKeyNotDefined", e[e.StorageCategoryNotAllowed = 1011] = "StorageCategoryNotAllowed", e[e.LocalizationTemplateNotDefined = 1012] = "LocalizationTemplateNotDefined", e))(q || {});
72
- function re(e, t) {
71
+ var Y = P(X, { path: "/" }), ee = Object.defineProperty, re = (e, t, r) => t in e ? ee(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, I = (e, t, r) => (re(e, typeof t != "symbol" ? t + "" : t, r), r), R = /* @__PURE__ */ ((e) => (e[e.AlreadyInitialized = 1e3] = "AlreadyInitialized", e[e.NoAppNameOrKey = 1001] = "NoAppNameOrKey", e[e.MissingAppController = 1002] = "MissingAppController", e[e.MissingCapabilityOnApp = 1003] = "MissingCapabilityOnApp", e[e.MissingManagedObjectProvider = 1004] = "MissingManagedObjectProvider", e[e.NoManifest = 1005] = "NoManifest", e[e.NoRootElement = 1006] = "NoRootElement", e[e.NoView = 1007] = "NoView", e[e.CookieKeyNotDefined = 1008] = "CookieKeyNotDefined", e[e.CookieCategoryNotAllowed = 1009] = "CookieCategoryNotAllowed", e[e.StorageKeyNotDefined = 1010] = "StorageKeyNotDefined", e[e.StorageCategoryNotAllowed = 1011] = "StorageCategoryNotAllowed", e[e.LocalizationTemplateNotDefined = 1012] = "LocalizationTemplateNotDefined", e))(R || {});
72
+ function te(e, t) {
73
73
  return Object.entries(t).reduce((r, [a, i]) => r.replaceAll(`{{${a}}}`, i), e);
74
74
  }
75
- const te = {
75
+ const oe = {
76
76
  // framework
77
77
  1e3: "The runtime has already been initialized",
78
78
  1001: "App name and/or app key is not defined on global scope",
@@ -92,15 +92,15 @@ const te = {
92
92
  2001: "Could not access the gateway when querying 'currentUser'",
93
93
  2002: "Could not access the required backend when querying 'currentUser'",
94
94
  2003: "Could not locate the authenticated user in the Alliance database"
95
- }, oe = "AllianceError";
96
- class ne extends Error {
95
+ }, ne = "AllianceError";
96
+ class ie extends Error {
97
97
  constructor(t, r = {}) {
98
- const a = re(te[t], r), i = `https://github.com/telia-company/ace-alliance-sdk/wiki/error-codes#${t}`;
99
- super(a), this.code = t, this.name = oe, this.stack = `[${t}] - ${a}
98
+ const a = te(oe[t], r), i = `https://github.com/telia-company/ace-alliance-sdk/wiki/error-codes#${t}`;
99
+ super(a), this.code = t, this.name = ne, this.stack = `[${t}] - ${a}
100
100
  ` + i;
101
101
  }
102
102
  }
103
- var $ = /* @__PURE__ */ ((e) => (e[e.AlreadyExists = 0] = "AlreadyExists", e[e.ApiGatewayPortDescription = 1] = "ApiGatewayPortDescription", e[e.ApiServerModeDescription = 2] = "ApiServerModeDescription", e[e.AppConfigurationPath = 3] = "AppConfigurationPath", e[e.AppCreated = 4] = "AppCreated", e[e.AppEntryBuildOptionDescription = 5] = "AppEntryBuildOptionDescription", e[e.AppNameInquiry = 6] = "AppNameInquiry", e[e.BuildDescription = 7] = "BuildDescription", e[e.BuildModeOptionDescription = 8] = "BuildModeOptionDescription", e[e.BuildWatchDescription = 9] = "BuildWatchDescription", e[e.CreateAppDescription = 10] = "CreateAppDescription", e[e.CreateWorkspaceDescription = 11] = "CreateWorkspaceDescription", e[e.DevServerOpenDescription = 12] = "DevServerOpenDescription", e[e.DevServerPortDescription = 13] = "DevServerPortDescription", e[e.DevServerLoggingDescription = 14] = "DevServerLoggingDescription", e[e.Done = 15] = "Done", e[e.FetchPackageVersionError = 16] = "FetchPackageVersionError", e[e.ManifestEntryBuildOptionDescription = 17] = "ManifestEntryBuildOptionDescription", e[e.MissingTranslationKey = 18] = "MissingTranslationKey", e[e.NoAppName = 19] = "NoAppName", e[e.NoAppNameFound = 20] = "NoAppNameFound", e[e.NoAppOrWorkspaceInCurrentDirectory = 21] = "NoAppOrWorkspaceInCurrentDirectory", e[e.NoWorkspaceName = 22] = "NoWorkspaceName", e[e.OperationCancelled = 23] = "OperationCancelled", e[e.ServeDescription = 24] = "ServeDescription", e[e.ServedStopped = 25] = "ServedStopped", e[e.ServerGatewayMode = 26] = "ServerGatewayMode", e[e.ServerMode = 27] = "ServerMode", e[e.ServerModeInquiry = 28] = "ServerModeInquiry", e[e.ServerProxyMode = 29] = "ServerProxyMode", e[e.StopServerInstructions = 30] = "StopServerInstructions", e[e.TemplateFrameworkInquiry = 31] = "TemplateFrameworkInquiry", e[e.TemplateLanguageInquiry = 32] = "TemplateLanguageInquiry", e[e.UnrecognizedCommand = 33] = "UnrecognizedCommand", e[e.WorkspaceCreated = 34] = "WorkspaceCreated", e[e.WorkspaceNameInquiry = 35] = "WorkspaceNameInquiry", e))($ || {});
103
+ var K = /* @__PURE__ */ ((e) => (e[e.AlreadyExists = 0] = "AlreadyExists", e[e.ApiGatewayPortDescription = 1] = "ApiGatewayPortDescription", e[e.ApiServerModeDescription = 2] = "ApiServerModeDescription", e[e.AppConfigurationPath = 3] = "AppConfigurationPath", e[e.AppCreated = 4] = "AppCreated", e[e.AppEntryBuildOptionDescription = 5] = "AppEntryBuildOptionDescription", e[e.AppNameInquiry = 6] = "AppNameInquiry", e[e.BuildDescription = 7] = "BuildDescription", e[e.BuildModeOptionDescription = 8] = "BuildModeOptionDescription", e[e.BuildWatchDescription = 9] = "BuildWatchDescription", e[e.CreateAppDescription = 10] = "CreateAppDescription", e[e.CreateWorkspaceDescription = 11] = "CreateWorkspaceDescription", e[e.DevServerOpenDescription = 12] = "DevServerOpenDescription", e[e.DevServerPortDescription = 13] = "DevServerPortDescription", e[e.DevServerLoggingDescription = 14] = "DevServerLoggingDescription", e[e.Done = 15] = "Done", e[e.FetchPackageVersionError = 16] = "FetchPackageVersionError", e[e.ManifestEntryBuildOptionDescription = 17] = "ManifestEntryBuildOptionDescription", e[e.MissingTranslationKey = 18] = "MissingTranslationKey", e[e.NoAppName = 19] = "NoAppName", e[e.NoAppNameFound = 20] = "NoAppNameFound", e[e.NoAppOrWorkspaceInCurrentDirectory = 21] = "NoAppOrWorkspaceInCurrentDirectory", e[e.NoWorkspaceName = 22] = "NoWorkspaceName", e[e.OperationCancelled = 23] = "OperationCancelled", e[e.ServeDescription = 24] = "ServeDescription", e[e.ServedStopped = 25] = "ServedStopped", e[e.ServerGatewayMode = 26] = "ServerGatewayMode", e[e.ServerMode = 27] = "ServerMode", e[e.ServerModeInquiry = 28] = "ServerModeInquiry", e[e.ServerProxyMode = 29] = "ServerProxyMode", e[e.StopServerInstructions = 30] = "StopServerInstructions", e[e.TemplateFrameworkInquiry = 31] = "TemplateFrameworkInquiry", e[e.TemplateLanguageInquiry = 32] = "TemplateLanguageInquiry", e[e.UnrecognizedCommand = 33] = "UnrecognizedCommand", e[e.WorkspaceCreated = 34] = "WorkspaceCreated", e[e.WorkspaceNameInquiry = 35] = "WorkspaceNameInquiry", e))(K || {});
104
104
  const ae = {
105
105
  15: "Done",
106
106
  22: "No workspace name provided!",
@@ -139,51 +139,51 @@ const ae = {
139
139
  27: "Server",
140
140
  29: "Server with proxy",
141
141
  26: "Server with gateway"
142
- }, m = class {
142
+ }, v = class {
143
143
  };
144
- I(m, "getTranslations", () => ae), I(m, "getTranslation", (e, ...t) => {
145
- const r = m.getTranslations()[e];
144
+ I(v, "getTranslations", () => ae), I(v, "getTranslation", (e, ...t) => {
145
+ const r = v.getTranslations()[e];
146
146
  if (!r)
147
147
  throw new Error(`Could not find text with given key '${e}'.`);
148
148
  return t.reduce(
149
- (a, i, d) => a.toString().replace(`{${d}}`, i.toString()),
149
+ (a, i, p) => a.toString().replace(`{${p}}`, i.toString()),
150
150
  r
151
151
  ).toString();
152
- }), I(m, "get", (e = $.MissingTranslationKey, ...t) => m.getTranslation(e, ...t));
153
- function ie(e) {
152
+ }), I(v, "get", (e = K.MissingTranslationKey, ...t) => v.getTranslation(e, ...t));
153
+ function se(e) {
154
154
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
155
155
  }
156
- var P = { exports: {} }, O, W;
157
- function se() {
158
- if (W)
156
+ var x = { exports: {} }, O, L;
157
+ function ce() {
158
+ if (L)
159
159
  return O;
160
- W = 1;
161
- var e = 1e3, t = e * 60, r = t * 60, a = r * 24, i = a * 7, d = a * 365.25;
160
+ L = 1;
161
+ var e = 1e3, t = e * 60, r = t * 60, a = r * 24, i = a * 7, p = a * 365.25;
162
162
  O = function(o, n) {
163
163
  n = n || {};
164
164
  var s = typeof o;
165
165
  if (s === "string" && o.length > 0)
166
- return p(o);
166
+ return l(o);
167
167
  if (s === "number" && isFinite(o))
168
- return n.long ? c(o) : l(o);
168
+ return n.long ? c(o) : d(o);
169
169
  throw new Error(
170
170
  "val is not a non-empty string or a valid number. val=" + JSON.stringify(o)
171
171
  );
172
172
  };
173
- function p(o) {
173
+ function l(o) {
174
174
  if (o = String(o), !(o.length > 100)) {
175
175
  var n = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
176
176
  o
177
177
  );
178
178
  if (n) {
179
- var s = parseFloat(n[1]), y = (n[2] || "ms").toLowerCase();
180
- switch (y) {
179
+ var s = parseFloat(n[1]), f = (n[2] || "ms").toLowerCase();
180
+ switch (f) {
181
181
  case "years":
182
182
  case "year":
183
183
  case "yrs":
184
184
  case "yr":
185
185
  case "y":
186
- return s * d;
186
+ return s * p;
187
187
  case "weeks":
188
188
  case "week":
189
189
  case "w":
@@ -222,7 +222,7 @@ function se() {
222
222
  }
223
223
  }
224
224
  }
225
- function l(o) {
225
+ function d(o) {
226
226
  var n = Math.abs(o);
227
227
  return n >= a ? Math.round(o / a) + "d" : n >= r ? Math.round(o / r) + "h" : n >= t ? Math.round(o / t) + "m" : n >= e ? Math.round(o / e) + "s" : o + "ms";
228
228
  }
@@ -230,14 +230,14 @@ function se() {
230
230
  var n = Math.abs(o);
231
231
  return n >= a ? u(o, n, a, "day") : n >= r ? u(o, n, r, "hour") : n >= t ? u(o, n, t, "minute") : n >= e ? u(o, n, e, "second") : o + " ms";
232
232
  }
233
- function u(o, n, s, y) {
234
- var b = n >= s * 1.5;
235
- return Math.round(o / s) + " " + y + (b ? "s" : "");
233
+ function u(o, n, s, f) {
234
+ var k = n >= s * 1.5;
235
+ return Math.round(o / s) + " " + f + (k ? "s" : "");
236
236
  }
237
237
  return O;
238
238
  }
239
- function ce(e) {
240
- r.debug = r, r.default = r, r.coerce = c, r.disable = d, r.enable = i, r.enabled = p, r.humanize = se(), r.destroy = u, Object.keys(e).forEach((o) => {
239
+ function pe(e) {
240
+ r.debug = r, r.default = r, r.coerce = c, r.disable = p, r.enable = i, r.enabled = l, r.humanize = ce(), r.destroy = u, Object.keys(e).forEach((o) => {
241
241
  r[o] = e[o];
242
242
  }), r.names = [], r.skips = [], r.formatters = {};
243
243
  function t(o) {
@@ -248,29 +248,29 @@ function ce(e) {
248
248
  }
249
249
  r.selectColor = t;
250
250
  function r(o) {
251
- let n, s = null, y, b;
251
+ let n, s = null, f, k;
252
252
  function h(...g) {
253
253
  if (!h.enabled)
254
254
  return;
255
- const f = h, A = Number(/* @__PURE__ */ new Date()), Z = A - (n || A);
256
- f.diff = Z, f.prev = n, f.curr = A, n = A, g[0] = r.coerce(g[0]), typeof g[0] != "string" && g.unshift("%O");
257
- let N = 0;
258
- g[0] = g[0].replace(/%([a-zA-Z%])/g, (M, J) => {
255
+ const C = h, D = Number(/* @__PURE__ */ new Date()), J = D - (n || D);
256
+ C.diff = J, C.prev = n, C.curr = D, n = D, g[0] = r.coerce(g[0]), typeof g[0] != "string" && g.unshift("%O");
257
+ let S = 0;
258
+ g[0] = g[0].replace(/%([a-zA-Z%])/g, (M, Z) => {
259
259
  if (M === "%%")
260
260
  return "%";
261
- N++;
262
- const x = r.formatters[J];
263
- if (typeof x == "function") {
264
- const Q = g[N];
265
- M = x.call(f, Q), g.splice(N, 1), N--;
261
+ S++;
262
+ const U = r.formatters[Z];
263
+ if (typeof U == "function") {
264
+ const H = g[S];
265
+ M = U.call(C, H), g.splice(S, 1), S--;
266
266
  }
267
267
  return M;
268
- }), r.formatArgs.call(f, g), (f.log || r.log).apply(f, g);
268
+ }), r.formatArgs.call(C, g), (C.log || r.log).apply(C, g);
269
269
  }
270
270
  return h.namespace = o, h.useColors = r.useColors(), h.color = r.selectColor(o), h.extend = a, h.destroy = r.destroy, Object.defineProperty(h, "enabled", {
271
271
  enumerable: !0,
272
272
  configurable: !1,
273
- get: () => s !== null ? s : (y !== r.namespaces && (y = r.namespaces, b = r.enabled(o)), b),
273
+ get: () => s !== null ? s : (f !== r.namespaces && (f = r.namespaces, k = r.enabled(o)), k),
274
274
  set: (g) => {
275
275
  s = g;
276
276
  }
@@ -283,18 +283,18 @@ function ce(e) {
283
283
  function i(o) {
284
284
  r.save(o), r.namespaces = o, r.names = [], r.skips = [];
285
285
  let n;
286
- const s = (typeof o == "string" ? o : "").split(/[\s,]+/), y = s.length;
287
- for (n = 0; n < y; n++)
286
+ const s = (typeof o == "string" ? o : "").split(/[\s,]+/), f = s.length;
287
+ for (n = 0; n < f; n++)
288
288
  s[n] && (o = s[n].replace(/\*/g, ".*?"), o[0] === "-" ? r.skips.push(new RegExp("^" + o.slice(1) + "$")) : r.names.push(new RegExp("^" + o + "$")));
289
289
  }
290
- function d() {
290
+ function p() {
291
291
  const o = [
292
- ...r.names.map(l),
293
- ...r.skips.map(l).map((n) => "-" + n)
292
+ ...r.names.map(d),
293
+ ...r.skips.map(d).map((n) => "-" + n)
294
294
  ].join(",");
295
295
  return r.enable(""), o;
296
296
  }
297
- function p(o) {
297
+ function l(o) {
298
298
  if (o[o.length - 1] === "*")
299
299
  return !0;
300
300
  let n, s;
@@ -306,7 +306,7 @@ function ce(e) {
306
306
  return !0;
307
307
  return !1;
308
308
  }
309
- function l(o) {
309
+ function d(o) {
310
310
  return o.toString().substring(2, o.toString().length - 2).replace(/\.\*\?$/, "*");
311
311
  }
312
312
  function c(o) {
@@ -317,9 +317,9 @@ function ce(e) {
317
317
  }
318
318
  return r.enable(r.load()), r;
319
319
  }
320
- var pe = ce;
320
+ var le = pe;
321
321
  (function(e, t) {
322
- t.formatArgs = a, t.save = i, t.load = d, t.useColors = r, t.storage = p(), t.destroy = (() => {
322
+ t.formatArgs = a, t.save = i, t.load = p, t.useColors = r, t.storage = l(), t.destroy = (() => {
323
323
  let c = !1;
324
324
  return () => {
325
325
  c || (c = !0, console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."));
@@ -427,7 +427,7 @@ var pe = ce;
427
427
  } catch {
428
428
  }
429
429
  }
430
- function d() {
430
+ function p() {
431
431
  let c;
432
432
  try {
433
433
  c = t.storage.getItem("debug");
@@ -435,31 +435,31 @@ var pe = ce;
435
435
  }
436
436
  return !c && typeof process < "u" && "env" in process && (c = process.env.DEBUG), c;
437
437
  }
438
- function p() {
438
+ function l() {
439
439
  try {
440
440
  return localStorage;
441
441
  } catch {
442
442
  }
443
443
  }
444
- e.exports = pe(t);
445
- const { formatters: l } = e.exports;
446
- l.j = function(c) {
444
+ e.exports = le(t);
445
+ const { formatters: d } = e.exports;
446
+ d.j = function(c) {
447
447
  try {
448
448
  return JSON.stringify(c);
449
449
  } catch (u) {
450
450
  return "[UnexpectedJSONParseError]: " + u.message;
451
451
  }
452
452
  };
453
- })(P, P.exports);
454
- var de = P.exports;
455
- const le = /* @__PURE__ */ ie(de);
456
- function ue() {
453
+ })(x, x.exports);
454
+ var de = x.exports;
455
+ const ue = /* @__PURE__ */ se(de);
456
+ function ge() {
457
457
  try {
458
458
  return ALLIANCE_APP_NAME;
459
459
  } catch {
460
460
  }
461
461
  }
462
- function ge() {
462
+ function he() {
463
463
  const e = {
464
464
  environment: "production",
465
465
  logging: !1
@@ -470,37 +470,37 @@ function ge() {
470
470
  return e;
471
471
  }
472
472
  }
473
- function z() {
474
- if (U())
473
+ function _() {
474
+ if ($())
475
475
  return Promise.resolve();
476
476
  const e = 2e4, t = 5;
477
477
  return new Promise((r, a) => {
478
478
  const i = () => {
479
- clearInterval(p), clearTimeout(d);
480
- }, d = setTimeout(() => {
479
+ clearInterval(l), clearTimeout(p);
480
+ }, p = setTimeout(() => {
481
481
  i(), a(new Error(`Runtime not initialized after ${e}ms`));
482
- }, e), p = setInterval(() => {
483
- U() && (i(), r());
482
+ }, e), l = setInterval(() => {
483
+ $() && (i(), r());
484
484
  }, t);
485
485
  });
486
486
  }
487
- function U() {
488
- return F(
487
+ function $() {
488
+ return N(
489
489
  "RUNTIME_INITIALIZED"
490
490
  /* RuntimeInitialized */
491
491
  );
492
492
  }
493
- function F(e = "") {
494
- return globalThis[he(e)];
493
+ function N(e = "") {
494
+ return globalThis[fe(e)];
495
495
  }
496
- function he(e) {
496
+ function fe(e) {
497
497
  return `__ALLIANCE_${e}`;
498
498
  }
499
499
  function ye(e) {
500
500
  return `APP_CONTROLLER_KEY_${e}`;
501
501
  }
502
- var R = /* @__PURE__ */ ((e) => (e.RuntimeInitialized = "RUNTIME_INITIALIZED", e.RuntimeApps = "RUNTIME_APPS", e.RuntimeManifests = "RUNTIME_MANIFESTS", e))(R || {});
503
- function fe(e) {
502
+ var W = /* @__PURE__ */ ((e) => (e.RuntimeInitialized = "RUNTIME_INITIALIZED", e.RuntimeApps = "RUNTIME_APPS", e.RuntimeManifests = "RUNTIME_MANIFESTS", e))(W || {});
503
+ function Ce(e) {
504
504
  return {
505
505
  capabilities: "#25BCDD",
506
506
  "managed-objects": "#FC7A12",
@@ -511,57 +511,66 @@ function fe(e) {
511
511
  }[e];
512
512
  }
513
513
  const B = /* @__PURE__ */ new Map();
514
- function C(e) {
514
+ function m(e) {
515
515
  let t = B.get(e);
516
- return t || (t = le(e === "system" ? "[system]" : `[${ue()}] ${e}`), t.color = fe(e), t.enabled = Ce(), B.set(e, t), t);
516
+ return t || (t = ue(e === "system" ? "[system]" : `[${ge()}] ${e}`), t.color = Ce(e), t.enabled = me(), B.set(e, t), t);
517
517
  }
518
- function Ce() {
519
- const e = ge(), t = X.get("logging");
518
+ function me() {
519
+ const e = he(), t = Y.get("logging");
520
520
  return e.environment === "development" && !!e.logging || t === "true";
521
521
  }
522
- C("controller");
523
- async function me(e) {
524
- await z();
525
- const t = ye(e), r = F(t);
522
+ m("controller");
523
+ async function ve(e) {
524
+ await _();
525
+ const t = ye(e), r = N(t);
526
526
  if (!r)
527
527
  return;
528
- const a = F(r);
528
+ const a = N(r);
529
529
  if (a)
530
530
  return a;
531
531
  }
532
- async function ve() {
533
- return await z(), (await Promise.all(
534
- F(R.RuntimeApps).map((e) => me(e))
532
+ async function we() {
533
+ return await _(), (await Promise.all(
534
+ N(W.RuntimeApps).map((e) => ve(e))
535
535
  )).filter((e) => !!e);
536
536
  }
537
- C("views");
538
- C("system");
539
- C("capabilities");
540
- const E = C("managed-objects");
541
- function we(e, t) {
537
+ m("views");
538
+ function be() {
539
+ return structuredClone(N(W.RuntimeManifests));
540
+ }
541
+ function Ae() {
542
+ try {
543
+ return ALLIANCE_APP_MANIFEST;
544
+ } catch {
545
+ }
546
+ }
547
+ m("system");
548
+ m("capabilities");
549
+ const E = m("managed-objects");
550
+ function G(e, t) {
542
551
  return E("querying objects - object: %o, args: %O", e, t), {
543
552
  async resolve() {
544
- return E("resolving query - object: %o, args: %O", e, t), await (await L(e)).managedObjects.providers.get(e)(t);
553
+ return E("resolving query - object: %o, args: %O", e, t), await (await q(e)).managedObjects.providers.get(e)(t);
545
554
  },
546
555
  async watch(r) {
547
- E("adding watcher - object: %o, args: %O", e, t), (await L(e)).managedObjects.watchers.get(e).push(r);
556
+ E("adding watcher - object: %o, args: %O", e, t), (await q(e)).managedObjects.watchers.get(e).push(r);
548
557
  }
549
558
  };
550
559
  }
551
- async function L(e) {
552
- const t = (await ve()).find(
560
+ async function q(e) {
561
+ const t = (await we()).find(
553
562
  (r) => r.managedObjects.providers.has(e) && r.managedObjects.watchers.has(e)
554
563
  );
555
564
  if (!t)
556
- throw new ne(q.MissingManagedObjectProvider, { object: e });
565
+ throw new ie(R.MissingManagedObjectProvider, { object: e });
557
566
  return t;
558
567
  }
559
- C("proxy");
560
- var be = Object.defineProperty, Ae = (e, t, r) => t in e ? be(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, T = (e, t, r) => (Ae(e, typeof t != "symbol" ? t + "" : t, r), r), K = /* @__PURE__ */ ((e) => (e[e.AlreadyInitialized = 1e3] = "AlreadyInitialized", e[e.NoAppNameOrKey = 1001] = "NoAppNameOrKey", e[e.MissingAppController = 1002] = "MissingAppController", e[e.MissingCapabilityOnApp = 1003] = "MissingCapabilityOnApp", e[e.MissingManagedObjectProvider = 1004] = "MissingManagedObjectProvider", e[e.NoManifest = 1005] = "NoManifest", e[e.NoRootElement = 1006] = "NoRootElement", e[e.NoView = 1007] = "NoView", e[e.CookieKeyNotDefined = 1008] = "CookieKeyNotDefined", e[e.CookieCategoryNotAllowed = 1009] = "CookieCategoryNotAllowed", e[e.StorageKeyNotDefined = 1010] = "StorageKeyNotDefined", e[e.StorageCategoryNotAllowed = 1011] = "StorageCategoryNotAllowed", e[e.LocalizationTemplateNotDefined = 1012] = "LocalizationTemplateNotDefined", e))(K || {}), w = /* @__PURE__ */ ((e) => (e[e.CurrentUserMissingProvider = 2e3] = "CurrentUserMissingProvider", e[e.CurrentUserGatewayNotStarted = 2001] = "CurrentUserGatewayNotStarted", e[e.CurrentUserMissingBackend = 2002] = "CurrentUserMissingBackend", e[e.CurrentUserMissingInDatabase = 2003] = "CurrentUserMissingInDatabase", e))(w || {});
561
- function Ne(e, t) {
568
+ m("proxy");
569
+ var Ne = Object.defineProperty, ke = (e, t, r) => t in e ? Ne(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, T = (e, t, r) => (ke(e, typeof t != "symbol" ? t + "" : t, r), r), z = /* @__PURE__ */ ((e) => (e[e.AlreadyInitialized = 1e3] = "AlreadyInitialized", e[e.NoAppNameOrKey = 1001] = "NoAppNameOrKey", e[e.MissingAppController = 1002] = "MissingAppController", e[e.MissingCapabilityOnApp = 1003] = "MissingCapabilityOnApp", e[e.MissingManagedObjectProvider = 1004] = "MissingManagedObjectProvider", e[e.NoManifest = 1005] = "NoManifest", e[e.NoRootElement = 1006] = "NoRootElement", e[e.NoView = 1007] = "NoView", e[e.CookieKeyNotDefined = 1008] = "CookieKeyNotDefined", e[e.CookieCategoryNotAllowed = 1009] = "CookieCategoryNotAllowed", e[e.StorageKeyNotDefined = 1010] = "StorageKeyNotDefined", e[e.StorageCategoryNotAllowed = 1011] = "StorageCategoryNotAllowed", e[e.LocalizationTemplateNotDefined = 1012] = "LocalizationTemplateNotDefined", e))(z || {}), b = /* @__PURE__ */ ((e) => (e[e.CurrentUserMissingProvider = 2e3] = "CurrentUserMissingProvider", e[e.CurrentUserGatewayNotStarted = 2001] = "CurrentUserGatewayNotStarted", e[e.CurrentUserMissingBackend = 2002] = "CurrentUserMissingBackend", e[e.CurrentUserMissingInDatabase = 2003] = "CurrentUserMissingInDatabase", e))(b || {});
570
+ function De(e, t) {
562
571
  return Object.entries(t).reduce((r, [a, i]) => r.replaceAll(`{{${a}}}`, i), e);
563
572
  }
564
- const ke = {
573
+ const Se = {
565
574
  // framework
566
575
  1e3: "The runtime has already been initialized",
567
576
  1001: "App name and/or app key is not defined on global scope",
@@ -581,19 +590,19 @@ const ke = {
581
590
  2001: "Could not access the gateway when querying 'currentUser'",
582
591
  2002: "Could not access the required backend when querying 'currentUser'",
583
592
  2003: "Could not locate the authenticated user in the Alliance database"
584
- }, _ = "AllianceError";
585
- class D extends Error {
593
+ }, V = "AllianceError";
594
+ class A extends Error {
586
595
  constructor(t, r = {}) {
587
- const a = Ne(ke[t], r), i = `https://github.com/telia-company/ace-alliance-sdk/wiki/error-codes#${t}`;
588
- super(a), this.code = t, this.name = _, this.stack = `[${t}] - ${a}
596
+ const a = De(Se[t], r), i = `https://github.com/telia-company/ace-alliance-sdk/wiki/error-codes#${t}`;
597
+ super(a), this.code = t, this.name = V, this.stack = `[${t}] - ${a}
589
598
  ` + i;
590
599
  }
591
600
  }
592
- function De(e) {
593
- return !!e.code && e.name === _;
601
+ function Fe(e) {
602
+ return !!e.code && e.name === V;
594
603
  }
595
- var G = /* @__PURE__ */ ((e) => (e[e.AlreadyExists = 0] = "AlreadyExists", e[e.ApiGatewayPortDescription = 1] = "ApiGatewayPortDescription", e[e.ApiServerModeDescription = 2] = "ApiServerModeDescription", e[e.AppConfigurationPath = 3] = "AppConfigurationPath", e[e.AppCreated = 4] = "AppCreated", e[e.AppEntryBuildOptionDescription = 5] = "AppEntryBuildOptionDescription", e[e.AppNameInquiry = 6] = "AppNameInquiry", e[e.BuildDescription = 7] = "BuildDescription", e[e.BuildModeOptionDescription = 8] = "BuildModeOptionDescription", e[e.BuildWatchDescription = 9] = "BuildWatchDescription", e[e.CreateAppDescription = 10] = "CreateAppDescription", e[e.CreateWorkspaceDescription = 11] = "CreateWorkspaceDescription", e[e.DevServerOpenDescription = 12] = "DevServerOpenDescription", e[e.DevServerPortDescription = 13] = "DevServerPortDescription", e[e.DevServerLoggingDescription = 14] = "DevServerLoggingDescription", e[e.Done = 15] = "Done", e[e.FetchPackageVersionError = 16] = "FetchPackageVersionError", e[e.ManifestEntryBuildOptionDescription = 17] = "ManifestEntryBuildOptionDescription", e[e.MissingTranslationKey = 18] = "MissingTranslationKey", e[e.NoAppName = 19] = "NoAppName", e[e.NoAppNameFound = 20] = "NoAppNameFound", e[e.NoAppOrWorkspaceInCurrentDirectory = 21] = "NoAppOrWorkspaceInCurrentDirectory", e[e.NoWorkspaceName = 22] = "NoWorkspaceName", e[e.OperationCancelled = 23] = "OperationCancelled", e[e.ServeDescription = 24] = "ServeDescription", e[e.ServedStopped = 25] = "ServedStopped", e[e.ServerGatewayMode = 26] = "ServerGatewayMode", e[e.ServerMode = 27] = "ServerMode", e[e.ServerModeInquiry = 28] = "ServerModeInquiry", e[e.ServerProxyMode = 29] = "ServerProxyMode", e[e.StopServerInstructions = 30] = "StopServerInstructions", e[e.TemplateFrameworkInquiry = 31] = "TemplateFrameworkInquiry", e[e.TemplateLanguageInquiry = 32] = "TemplateLanguageInquiry", e[e.UnrecognizedCommand = 33] = "UnrecognizedCommand", e[e.WorkspaceCreated = 34] = "WorkspaceCreated", e[e.WorkspaceNameInquiry = 35] = "WorkspaceNameInquiry", e))(G || {});
596
- const Se = {
604
+ var Q = /* @__PURE__ */ ((e) => (e[e.AlreadyExists = 0] = "AlreadyExists", e[e.ApiGatewayPortDescription = 1] = "ApiGatewayPortDescription", e[e.ApiServerModeDescription = 2] = "ApiServerModeDescription", e[e.AppConfigurationPath = 3] = "AppConfigurationPath", e[e.AppCreated = 4] = "AppCreated", e[e.AppEntryBuildOptionDescription = 5] = "AppEntryBuildOptionDescription", e[e.AppNameInquiry = 6] = "AppNameInquiry", e[e.BuildDescription = 7] = "BuildDescription", e[e.BuildModeOptionDescription = 8] = "BuildModeOptionDescription", e[e.BuildWatchDescription = 9] = "BuildWatchDescription", e[e.CreateAppDescription = 10] = "CreateAppDescription", e[e.CreateWorkspaceDescription = 11] = "CreateWorkspaceDescription", e[e.DevServerOpenDescription = 12] = "DevServerOpenDescription", e[e.DevServerPortDescription = 13] = "DevServerPortDescription", e[e.DevServerLoggingDescription = 14] = "DevServerLoggingDescription", e[e.Done = 15] = "Done", e[e.FetchPackageVersionError = 16] = "FetchPackageVersionError", e[e.ManifestEntryBuildOptionDescription = 17] = "ManifestEntryBuildOptionDescription", e[e.MissingTranslationKey = 18] = "MissingTranslationKey", e[e.NoAppName = 19] = "NoAppName", e[e.NoAppNameFound = 20] = "NoAppNameFound", e[e.NoAppOrWorkspaceInCurrentDirectory = 21] = "NoAppOrWorkspaceInCurrentDirectory", e[e.NoWorkspaceName = 22] = "NoWorkspaceName", e[e.OperationCancelled = 23] = "OperationCancelled", e[e.ServeDescription = 24] = "ServeDescription", e[e.ServedStopped = 25] = "ServedStopped", e[e.ServerGatewayMode = 26] = "ServerGatewayMode", e[e.ServerMode = 27] = "ServerMode", e[e.ServerModeInquiry = 28] = "ServerModeInquiry", e[e.ServerProxyMode = 29] = "ServerProxyMode", e[e.StopServerInstructions = 30] = "StopServerInstructions", e[e.TemplateFrameworkInquiry = 31] = "TemplateFrameworkInquiry", e[e.TemplateLanguageInquiry = 32] = "TemplateLanguageInquiry", e[e.UnrecognizedCommand = 33] = "UnrecognizedCommand", e[e.WorkspaceCreated = 34] = "WorkspaceCreated", e[e.WorkspaceNameInquiry = 35] = "WorkspaceNameInquiry", e))(Q || {});
605
+ const Me = {
597
606
  15: "Done",
598
607
  22: "No workspace name provided!",
599
608
  19: "No app name provided!",
@@ -631,38 +640,58 @@ const Se = {
631
640
  27: "Server",
632
641
  29: "Server with proxy",
633
642
  26: "Server with gateway"
634
- }, v = class {
643
+ }, w = class {
635
644
  };
636
- T(v, "getTranslations", () => Se), T(v, "getTranslation", (e, ...t) => {
637
- const r = v.getTranslations()[e];
645
+ T(w, "getTranslations", () => Me), T(w, "getTranslation", (e, ...t) => {
646
+ const r = w.getTranslations()[e];
638
647
  if (!r)
639
648
  throw new Error(`Could not find text with given key '${e}'.`);
640
649
  return t.reduce(
641
- (a, i, d) => a.toString().replace(`{${d}}`, i.toString()),
650
+ (a, i, p) => a.toString().replace(`{${p}}`, i.toString()),
642
651
  r
643
652
  ).toString();
644
- }), T(v, "get", (e = G.MissingTranslationKey, ...t) => v.getTranslation(e, ...t));
645
- let S;
646
- async function V() {
653
+ }), T(w, "get", (e = Q.MissingTranslationKey, ...t) => w.getTranslation(e, ...t));
654
+ let y;
655
+ async function Pe() {
647
656
  try {
648
- return S || (S = await we("currentUser").resolve(), S);
657
+ return y || (y = await G("currentUser").resolve()), {
658
+ ...y,
659
+ hasPermission(e, t) {
660
+ return !!(y != null && y.permissions.find(
661
+ ({ permission: r }) => r.app.name === e && r.name === t
662
+ ));
663
+ },
664
+ isSystemAdmin() {
665
+ return !!y && y.type === "system-admin";
666
+ }
667
+ };
649
668
  } catch (e) {
650
- throw De(e) && e.code === K.MissingManagedObjectProvider ? new D(w.CurrentUserMissingProvider) : e.message.includes("GraphQL Error (Code: 404)") ? new D(w.CurrentUserGatewayNotStarted) : e.message.includes("GraphQL Error (Code: 500)") ? new D(w.CurrentUserMissingBackend) : e.message.includes("GraphQL Error (Code: 200)") && e.message.includes("Cannot return null for non-nullable field") ? new D(w.CurrentUserMissingInDatabase) : e;
669
+ throw Fe(e) && e.code === z.MissingManagedObjectProvider ? new A(b.CurrentUserMissingProvider) : e.message.includes("GraphQL Error (Code: 404)") ? new A(b.CurrentUserGatewayNotStarted) : e.message.includes("GraphQL Error (Code: 500)") ? new A(b.CurrentUserMissingBackend) : e.message.includes("GraphQL Error (Code: 200)") && e.message.includes("Cannot return null for non-nullable field") ? new A(b.CurrentUserMissingInDatabase) : e;
651
670
  }
652
671
  }
653
- async function Ie() {
654
- const e = await V();
655
- return !!e && e.type === "system-admin";
672
+ function Ie(e) {
673
+ var a;
674
+ return !e || !((a = e.resources) != null && a.localization) ? {} : Object.keys(e.resources.localization).reduce((i, p) => (i[p] = e.resources.localization[p].value, i), {});
656
675
  }
657
- async function Oe(e, t) {
658
- const r = await V();
659
- return !!(r != null && r.permissions.find(
660
- ({ permission: a }) => a.app.name === e && a.name === t
661
- ));
676
+ function Oe(e = "", t) {
677
+ return Object.entries(t).reduce((r, [a, i]) => r.replaceAll(`{{${a}}}`, i), e);
678
+ }
679
+ async function Ee() {
680
+ const e = Ae(), t = be(), r = Ie(e);
681
+ let a = {};
682
+ return t != null && t.find(({ name: i }) => i === "resource-management") && (a = await G("resourceTexts", { app: e == null ? void 0 : e.name }).resolve()), Object.keys(r).reduce((i, p) => (a[p] && (i[p] = a[p]), i), r);
683
+ }
684
+ let j = {};
685
+ async function xe() {
686
+ return Object.keys(j).length === 0 && (j = await Ee()), (e, t) => {
687
+ const r = j[e];
688
+ if (r === void 0)
689
+ throw new A(z.LocalizationTemplateNotDefined, { key: e });
690
+ return !t || typeof t != "object" || Object.keys(t).length === 0 ? r : Oe(r, t);
691
+ };
662
692
  }
663
693
  export {
664
- V as getCurrentUser,
665
- Oe as hasPermission,
666
- Ie as isSystemAdmin
694
+ Pe as getCurrentUser,
695
+ xe as getTranslator
667
696
  };
668
697
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../framework/dist/chunks/capabilities-c3af0137.js","../../framework/dist/index.js","../../../internal/client-utilities/dist/index.js","../src/current-user.ts"],"sourcesContent":["var ae = Object.defineProperty;\nvar se = (e, o, t) => o in e ? ae(e, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[o] = t;\nvar k = (e, o, t) => (se(e, typeof o != \"symbol\" ? o + \"\" : o, t), t);\n/*! js-cookie v3.0.5 | MIT */\nfunction S(e) {\n for (var o = 1; o < arguments.length; o++) {\n var t = arguments[o];\n for (var r in t)\n e[r] = t[r];\n }\n return e;\n}\nvar ce = {\n read: function(e) {\n return e[0] === '\"' && (e = e.slice(1, -1)), e.replace(/(%[\\dA-F]{2})+/gi, decodeURIComponent);\n },\n write: function(e) {\n return encodeURIComponent(e).replace(\n /%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,\n decodeURIComponent\n );\n }\n};\nfunction j(e, o) {\n function t(i, s, u) {\n if (!(typeof document > \"u\")) {\n u = S({}, o, u), typeof u.expires == \"number\" && (u.expires = new Date(Date.now() + u.expires * 864e5)), u.expires && (u.expires = u.expires.toUTCString()), i = encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);\n var p = \"\";\n for (var l in u)\n u[l] && (p += \"; \" + l, u[l] !== !0 && (p += \"=\" + u[l].split(\";\")[0]));\n return document.cookie = i + \"=\" + e.write(s, i) + p;\n }\n }\n function r(i) {\n if (!(typeof document > \"u\" || arguments.length && !i)) {\n for (var s = document.cookie ? document.cookie.split(\"; \") : [], u = {}, p = 0; p < s.length; p++) {\n var l = s[p].split(\"=\"), d = l.slice(1).join(\"=\");\n try {\n var n = decodeURIComponent(l[0]);\n if (u[n] = e.read(d, n), i === n)\n break;\n } catch {\n }\n }\n return i ? u[i] : u;\n }\n }\n return Object.create(\n {\n set: t,\n get: r,\n remove: function(i, s) {\n t(\n i,\n \"\",\n S({}, s, {\n expires: -1\n })\n );\n },\n withAttributes: function(i) {\n return j(this.converter, S({}, this.attributes, i));\n },\n withConverter: function(i) {\n return j(S({}, this.converter, i), this.attributes);\n }\n },\n {\n attributes: { value: Object.freeze(o) },\n converter: { value: Object.freeze(e) }\n }\n );\n}\nvar W = j(ce, { path: \"/\" }), le = Object.defineProperty, ue = (e, o, t) => o in e ? le(e, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[o] = t, x = (e, o, t) => (ue(e, typeof o != \"symbol\" ? o + \"\" : o, t), t), h = /* @__PURE__ */ ((e) => (e[e.AlreadyInitialized = 1e3] = \"AlreadyInitialized\", e[e.NoAppNameOrKey = 1001] = \"NoAppNameOrKey\", e[e.MissingAppController = 1002] = \"MissingAppController\", e[e.MissingCapabilityOnApp = 1003] = \"MissingCapabilityOnApp\", e[e.MissingManagedObjectProvider = 1004] = \"MissingManagedObjectProvider\", e[e.NoManifest = 1005] = \"NoManifest\", e[e.NoRootElement = 1006] = \"NoRootElement\", e[e.NoView = 1007] = \"NoView\", e[e.CookieKeyNotDefined = 1008] = \"CookieKeyNotDefined\", e[e.CookieCategoryNotAllowed = 1009] = \"CookieCategoryNotAllowed\", e[e.StorageKeyNotDefined = 1010] = \"StorageKeyNotDefined\", e[e.StorageCategoryNotAllowed = 1011] = \"StorageCategoryNotAllowed\", e[e.LocalizationTemplateNotDefined = 1012] = \"LocalizationTemplateNotDefined\", e))(h || {});\nfunction pe(e, o) {\n return Object.entries(o).reduce((t, [r, i]) => t.replaceAll(`{{${r}}}`, i), e);\n}\nconst de = {\n // framework\n 1e3: \"The runtime has already been initialized\",\n 1001: \"App name and/or app key is not defined on global scope\",\n 1002: \"No app controller registered for app '{{app}}'\",\n 1003: \"No capability '{{capability}}' enabled for app '{{app}}'\",\n 1004: \"No managed object provider registered for object '{{object}}'\",\n 1005: \"The current apps manifest is not defined on global scope\",\n 1006: \"Could not find the root element in the DOM\",\n 1007: \"Could not find view with id '{{id}}' on view controller for app '{{app}}'\",\n 1008: \"Cookie key '{{key}}' not present in manifest, cookie has not been set\",\n 1009: \"Cookies categorized as '{{category}}' are not allowed by the user, cookie '{{key}}' has not been set\",\n 1010: \"Storage key '{{key}}' not present in manifest, item has not been stored\",\n 1011: \"Storage categorized as '{{category}}' is not allowed by the user, item '{{key}}' has not been stored\",\n 1012: \"The translation template, referred by the key '{{key}}' is being used in app, but is not defined in the manifest.\",\n // utilities\n 2e3: \"No managed object provider registered for object 'currentUser'\",\n 2001: \"Could not access the gateway when querying 'currentUser'\",\n 2002: \"Could not access the required backend when querying 'currentUser'\",\n 2003: \"Could not locate the authenticated user in the Alliance database\"\n}, fe = \"AllianceError\";\nclass w extends Error {\n constructor(o, t = {}) {\n const r = pe(de[o], t), i = `https://github.com/telia-company/ace-alliance-sdk/wiki/error-codes#${o}`;\n super(r), this.code = o, this.name = fe, this.stack = `[${o}] - ${r}\n` + i;\n }\n}\nfunction he(e) {\n const o = Object.entries(e).reduce((t, r) => {\n const [i, s] = r;\n return typeof s > \"u\" || (typeof s == \"object\" && s !== null ? t[i] = JSON.stringify(s) : t[i] = s), t;\n }, {});\n return Object.keys(o).length ? `?${new URLSearchParams(o)}` : \"\";\n}\nfunction ye() {\n const e = Y(), { href: o, search: t } = window.location;\n return o.replace(e, \"\").replace(t, \"\");\n}\nfunction me(e = \"\", o = \"\", t = {}) {\n const r = Y().replace(location.origin, \"\"), i = he(t);\n return e ? o ? `${r}/${e}/${o}${i}` : `${r}/${e}${i}` : `${r}${i}`;\n}\nfunction _e() {\n const e = ye(), [o = \"\", t = \"\"] = e.split(\"/\").filter((r) => !!r);\n return {\n app: o,\n capability: t\n };\n}\nfunction Ge(e) {\n const { origin: o, pathname: t } = window.location;\n if (e === \"production\") {\n const [r] = t.split(\"/\").filter((i) => !!i);\n return globalThis.__ALLIANCE_RUNTIME_ROOT_URL = `${o}/${r}`;\n }\n return globalThis.__ALLIANCE_RUNTIME_ROOT_URL = o;\n}\nfunction Y() {\n return globalThis.__ALLIANCE_RUNTIME_ROOT_URL;\n}\nvar H = /* @__PURE__ */ ((e) => (e[e.AlreadyExists = 0] = \"AlreadyExists\", e[e.ApiGatewayPortDescription = 1] = \"ApiGatewayPortDescription\", e[e.ApiServerModeDescription = 2] = \"ApiServerModeDescription\", e[e.AppConfigurationPath = 3] = \"AppConfigurationPath\", e[e.AppCreated = 4] = \"AppCreated\", e[e.AppEntryBuildOptionDescription = 5] = \"AppEntryBuildOptionDescription\", e[e.AppNameInquiry = 6] = \"AppNameInquiry\", e[e.BuildDescription = 7] = \"BuildDescription\", e[e.BuildModeOptionDescription = 8] = \"BuildModeOptionDescription\", e[e.BuildWatchDescription = 9] = \"BuildWatchDescription\", e[e.CreateAppDescription = 10] = \"CreateAppDescription\", e[e.CreateWorkspaceDescription = 11] = \"CreateWorkspaceDescription\", e[e.DevServerOpenDescription = 12] = \"DevServerOpenDescription\", e[e.DevServerPortDescription = 13] = \"DevServerPortDescription\", e[e.DevServerLoggingDescription = 14] = \"DevServerLoggingDescription\", e[e.Done = 15] = \"Done\", e[e.FetchPackageVersionError = 16] = \"FetchPackageVersionError\", e[e.ManifestEntryBuildOptionDescription = 17] = \"ManifestEntryBuildOptionDescription\", e[e.MissingTranslationKey = 18] = \"MissingTranslationKey\", e[e.NoAppName = 19] = \"NoAppName\", e[e.NoAppNameFound = 20] = \"NoAppNameFound\", e[e.NoAppOrWorkspaceInCurrentDirectory = 21] = \"NoAppOrWorkspaceInCurrentDirectory\", e[e.NoWorkspaceName = 22] = \"NoWorkspaceName\", e[e.OperationCancelled = 23] = \"OperationCancelled\", e[e.ServeDescription = 24] = \"ServeDescription\", e[e.ServedStopped = 25] = \"ServedStopped\", e[e.ServerGatewayMode = 26] = \"ServerGatewayMode\", e[e.ServerMode = 27] = \"ServerMode\", e[e.ServerModeInquiry = 28] = \"ServerModeInquiry\", e[e.ServerProxyMode = 29] = \"ServerProxyMode\", e[e.StopServerInstructions = 30] = \"StopServerInstructions\", e[e.TemplateFrameworkInquiry = 31] = \"TemplateFrameworkInquiry\", e[e.TemplateLanguageInquiry = 32] = \"TemplateLanguageInquiry\", e[e.UnrecognizedCommand = 33] = \"UnrecognizedCommand\", e[e.WorkspaceCreated = 34] = \"WorkspaceCreated\", e[e.WorkspaceNameInquiry = 35] = \"WorkspaceNameInquiry\", e))(H || {});\nconst ge = {\n 15: \"Done\",\n 22: \"No workspace name provided!\",\n 19: \"No app name provided!\",\n 0: \"File or directory '{0}' already exists!\",\n 21: \"Could not find any app entry file at '{0}'!\",\n 33: \"Unrecognized command(s) {0}!\",\n 34: \"Workspace was created at path '{0}'!\",\n 4: \"App was created at path '{0}'!\",\n 25: \"Server stopped.\",\n 11: \"Creates an Alliance Workspace in the current directory.\",\n 10: \"Creates an Alliance Application in the current directory or Alliance Workspace.\",\n 24: \"Starts a Alliance development server using the current directory package.json.\",\n 7: \"Builds an Alliance Application using Vite.\",\n 35: \"Enter the name of your workspace\",\n 28: \"Which server mode do you want to use?\",\n 6: \"Enter the name of your app\",\n 18: \"No translation key provided!\",\n 23: \"Operation cancelled.\",\n 30: `Press CTRL + C to stop the server.\n`,\n 32: \"Select preferred language\",\n 31: \"Select preferred framework template\",\n 13: \"The port that the dev server should use.\",\n 14: \"Whether the dev server and browser console should output more log information or not (false).\",\n 1: \"The port that the api gateway should use.\",\n 2: \"Which components to start. [server|server-proxy|server-gateway].\",\n 12: \"Whether the dev server should automatically open in your browser or not.\",\n 9: \"Whether the build should start watching and rebuild when files change or not.\",\n 5: \"The entry file for the app (./src/app).\",\n 17: \"The entry file for the app manifest (./src/manifest).\",\n 8: \"Which mode to use when building the app.\",\n 16: \"Failed to fetch package info from the NPM registry for package '${0}'!\",\n 20: \"Could not find app name in manifest.\",\n 3: \"The path to the app configuration file.\",\n 27: \"Server\",\n 29: \"Server with proxy\",\n 26: \"Server with gateway\"\n}, A = class {\n};\nx(A, \"getTranslations\", () => ge), x(A, \"getTranslation\", (e, ...o) => {\n const t = A.getTranslations()[e];\n if (!t)\n throw new Error(`Could not find text with given key '${e}'.`);\n return o.reduce(\n (r, i, s) => r.toString().replace(`{${s}}`, i.toString()),\n t\n ).toString();\n}), x(A, \"get\", (e = H.MissingTranslationKey, ...o) => A.getTranslation(e, ...o));\nfunction we(e) {\n return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, \"default\") ? e.default : e;\n}\nvar U = { exports: {} }, R, _;\nfunction Ce() {\n if (_)\n return R;\n _ = 1;\n var e = 1e3, o = e * 60, t = o * 60, r = t * 24, i = r * 7, s = r * 365.25;\n R = function(n, a) {\n a = a || {};\n var c = typeof n;\n if (c === \"string\" && n.length > 0)\n return u(n);\n if (c === \"number\" && isFinite(n))\n return a.long ? l(n) : p(n);\n throw new Error(\n \"val is not a non-empty string or a valid number. val=\" + JSON.stringify(n)\n );\n };\n function u(n) {\n if (n = String(n), !(n.length > 100)) {\n var a = /^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(\n n\n );\n if (a) {\n var c = parseFloat(a[1]), y = (a[2] || \"ms\").toLowerCase();\n switch (y) {\n case \"years\":\n case \"year\":\n case \"yrs\":\n case \"yr\":\n case \"y\":\n return c * s;\n case \"weeks\":\n case \"week\":\n case \"w\":\n return c * i;\n case \"days\":\n case \"day\":\n case \"d\":\n return c * r;\n case \"hours\":\n case \"hour\":\n case \"hrs\":\n case \"hr\":\n case \"h\":\n return c * t;\n case \"minutes\":\n case \"minute\":\n case \"mins\":\n case \"min\":\n case \"m\":\n return c * o;\n case \"seconds\":\n case \"second\":\n case \"secs\":\n case \"sec\":\n case \"s\":\n return c * e;\n case \"milliseconds\":\n case \"millisecond\":\n case \"msecs\":\n case \"msec\":\n case \"ms\":\n return c;\n default:\n return;\n }\n }\n }\n }\n function p(n) {\n var a = Math.abs(n);\n return a >= r ? Math.round(n / r) + \"d\" : a >= t ? Math.round(n / t) + \"h\" : a >= o ? Math.round(n / o) + \"m\" : a >= e ? Math.round(n / e) + \"s\" : n + \"ms\";\n }\n function l(n) {\n var a = Math.abs(n);\n return a >= r ? d(n, a, r, \"day\") : a >= t ? d(n, a, t, \"hour\") : a >= o ? d(n, a, o, \"minute\") : a >= e ? d(n, a, e, \"second\") : n + \" ms\";\n }\n function d(n, a, c, y) {\n var C = a >= c * 1.5;\n return Math.round(n / c) + \" \" + y + (C ? \"s\" : \"\");\n }\n return R;\n}\nfunction be(e) {\n t.debug = t, t.default = t, t.coerce = l, t.disable = s, t.enable = i, t.enabled = u, t.humanize = Ce(), t.destroy = d, Object.keys(e).forEach((n) => {\n t[n] = e[n];\n }), t.names = [], t.skips = [], t.formatters = {};\n function o(n) {\n let a = 0;\n for (let c = 0; c < n.length; c++)\n a = (a << 5) - a + n.charCodeAt(c), a |= 0;\n return t.colors[Math.abs(a) % t.colors.length];\n }\n t.selectColor = o;\n function t(n) {\n let a, c = null, y, C;\n function f(...m) {\n if (!f.enabled)\n return;\n const b = f, F = Number(/* @__PURE__ */ new Date()), re = F - (a || F);\n b.diff = re, b.prev = a, b.curr = F, a = F, m[0] = t.coerce(m[0]), typeof m[0] != \"string\" && m.unshift(\"%O\");\n let N = 0;\n m[0] = m[0].replace(/%([a-zA-Z%])/g, (P, ne) => {\n if (P === \"%%\")\n return \"%\";\n N++;\n const K = t.formatters[ne];\n if (typeof K == \"function\") {\n const ie = m[N];\n P = K.call(b, ie), m.splice(N, 1), N--;\n }\n return P;\n }), t.formatArgs.call(b, m), (b.log || t.log).apply(b, m);\n }\n return f.namespace = n, f.useColors = t.useColors(), f.color = t.selectColor(n), f.extend = r, f.destroy = t.destroy, Object.defineProperty(f, \"enabled\", {\n enumerable: !0,\n configurable: !1,\n get: () => c !== null ? c : (y !== t.namespaces && (y = t.namespaces, C = t.enabled(n)), C),\n set: (m) => {\n c = m;\n }\n }), typeof t.init == \"function\" && t.init(f), f;\n }\n function r(n, a) {\n const c = t(this.namespace + (typeof a > \"u\" ? \":\" : a) + n);\n return c.log = this.log, c;\n }\n function i(n) {\n t.save(n), t.namespaces = n, t.names = [], t.skips = [];\n let a;\n const c = (typeof n == \"string\" ? n : \"\").split(/[\\s,]+/), y = c.length;\n for (a = 0; a < y; a++)\n c[a] && (n = c[a].replace(/\\*/g, \".*?\"), n[0] === \"-\" ? t.skips.push(new RegExp(\"^\" + n.slice(1) + \"$\")) : t.names.push(new RegExp(\"^\" + n + \"$\")));\n }\n function s() {\n const n = [\n ...t.names.map(p),\n ...t.skips.map(p).map((a) => \"-\" + a)\n ].join(\",\");\n return t.enable(\"\"), n;\n }\n function u(n) {\n if (n[n.length - 1] === \"*\")\n return !0;\n let a, c;\n for (a = 0, c = t.skips.length; a < c; a++)\n if (t.skips[a].test(n))\n return !1;\n for (a = 0, c = t.names.length; a < c; a++)\n if (t.names[a].test(n))\n return !0;\n return !1;\n }\n function p(n) {\n return n.toString().substring(2, n.toString().length - 2).replace(/\\.\\*\\?$/, \"*\");\n }\n function l(n) {\n return n instanceof Error ? n.stack || n.message : n;\n }\n function d() {\n console.warn(\"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.\");\n }\n return t.enable(t.load()), t;\n}\nvar ve = be;\n(function(e, o) {\n o.formatArgs = r, o.save = i, o.load = s, o.useColors = t, o.storage = u(), o.destroy = (() => {\n let l = !1;\n return () => {\n l || (l = !0, console.warn(\"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.\"));\n };\n })(), o.colors = [\n \"#0000CC\",\n \"#0000FF\",\n \"#0033CC\",\n \"#0033FF\",\n \"#0066CC\",\n \"#0066FF\",\n \"#0099CC\",\n \"#0099FF\",\n \"#00CC00\",\n \"#00CC33\",\n \"#00CC66\",\n \"#00CC99\",\n \"#00CCCC\",\n \"#00CCFF\",\n \"#3300CC\",\n \"#3300FF\",\n \"#3333CC\",\n \"#3333FF\",\n \"#3366CC\",\n \"#3366FF\",\n \"#3399CC\",\n \"#3399FF\",\n \"#33CC00\",\n \"#33CC33\",\n \"#33CC66\",\n \"#33CC99\",\n \"#33CCCC\",\n \"#33CCFF\",\n \"#6600CC\",\n \"#6600FF\",\n \"#6633CC\",\n \"#6633FF\",\n \"#66CC00\",\n \"#66CC33\",\n \"#9900CC\",\n \"#9900FF\",\n \"#9933CC\",\n \"#9933FF\",\n \"#99CC00\",\n \"#99CC33\",\n \"#CC0000\",\n \"#CC0033\",\n \"#CC0066\",\n \"#CC0099\",\n \"#CC00CC\",\n \"#CC00FF\",\n \"#CC3300\",\n \"#CC3333\",\n \"#CC3366\",\n \"#CC3399\",\n \"#CC33CC\",\n \"#CC33FF\",\n \"#CC6600\",\n \"#CC6633\",\n \"#CC9900\",\n \"#CC9933\",\n \"#CCCC00\",\n \"#CCCC33\",\n \"#FF0000\",\n \"#FF0033\",\n \"#FF0066\",\n \"#FF0099\",\n \"#FF00CC\",\n \"#FF00FF\",\n \"#FF3300\",\n \"#FF3333\",\n \"#FF3366\",\n \"#FF3399\",\n \"#FF33CC\",\n \"#FF33FF\",\n \"#FF6600\",\n \"#FF6633\",\n \"#FF9900\",\n \"#FF9933\",\n \"#FFCC00\",\n \"#FFCC33\"\n ];\n function t() {\n return typeof window < \"u\" && window.process && (window.process.type === \"renderer\" || window.process.__nwjs) ? !0 : typeof navigator < \"u\" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/) ? !1 : typeof document < \"u\" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773\n typeof window < \"u\" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n typeof navigator < \"u\" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker\n typeof navigator < \"u\" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/);\n }\n function r(l) {\n if (l[0] = (this.useColors ? \"%c\" : \"\") + this.namespace + (this.useColors ? \" %c\" : \" \") + l[0] + (this.useColors ? \"%c \" : \" \") + \"+\" + e.exports.humanize(this.diff), !this.useColors)\n return;\n const d = \"color: \" + this.color;\n l.splice(1, 0, d, \"color: inherit\");\n let n = 0, a = 0;\n l[0].replace(/%[a-zA-Z%]/g, (c) => {\n c !== \"%%\" && (n++, c === \"%c\" && (a = n));\n }), l.splice(a, 0, d);\n }\n o.log = console.debug || console.log || (() => {\n });\n function i(l) {\n try {\n l ? o.storage.setItem(\"debug\", l) : o.storage.removeItem(\"debug\");\n } catch {\n }\n }\n function s() {\n let l;\n try {\n l = o.storage.getItem(\"debug\");\n } catch {\n }\n return !l && typeof process < \"u\" && \"env\" in process && (l = process.env.DEBUG), l;\n }\n function u() {\n try {\n return localStorage;\n } catch {\n }\n }\n e.exports = ve(o);\n const { formatters: p } = e.exports;\n p.j = function(l) {\n try {\n return JSON.stringify(l);\n } catch (d) {\n return \"[UnexpectedJSONParseError]: \" + d.message;\n }\n };\n})(U, U.exports);\nvar ke = U.exports;\nconst Ae = /* @__PURE__ */ we(ke);\nfunction Z(e) {\n return e.type === \"Logic\";\n}\nvar B = /* @__PURE__ */ ((e) => (e.View = \"View\", e.Logic = \"Logic\", e))(B || {});\nclass Fe {\n constructor(o) {\n k(this, \"type\", \"Logic\");\n k(this, \"execute\");\n this.execute = o;\n }\n}\nfunction Ye() {\n try {\n return ALLIANCE_APP_MANIFEST;\n } catch {\n }\n}\nfunction T() {\n try {\n return ALLIANCE_APP_NAME;\n } catch {\n }\n}\nfunction Ne() {\n try {\n return ALLIANCE_APP_KEY;\n } catch {\n }\n}\nfunction Se() {\n const e = {\n environment: \"production\",\n logging: !1\n };\n try {\n return ALLIANCE_ENVIRONMENT || e;\n } catch {\n return e;\n }\n}\nfunction J() {\n if (E())\n return Promise.resolve();\n const e = 2e4, o = 5;\n return new Promise((t, r) => {\n const i = () => {\n clearInterval(u), clearTimeout(s);\n }, s = setTimeout(() => {\n i(), r(new Error(`Runtime not initialized after ${e}ms`));\n }, e), u = setInterval(() => {\n E() && (i(), t());\n }, o);\n });\n}\nfunction E() {\n return g(\n \"RUNTIME_INITIALIZED\"\n /* RuntimeInitialized */\n );\n}\nfunction g(e = \"\") {\n return globalThis[X(e)];\n}\nfunction $(e, o) {\n return globalThis[X(e)] = o;\n}\nfunction X(e) {\n return `__ALLIANCE_${e}`;\n}\nfunction Q(e) {\n return `APP_CONTROLLER_KEY_${e}`;\n}\nvar I = /* @__PURE__ */ ((e) => (e.RuntimeInitialized = \"RUNTIME_INITIALIZED\", e.RuntimeApps = \"RUNTIME_APPS\", e.RuntimeManifests = \"RUNTIME_MANIFESTS\", e))(I || {});\nfunction He() {\n const e = document.createElement(\"div\");\n return e.id = \"root\", document.body.append(e), e;\n}\nfunction Ee() {\n const e = document.getElementById(\"root\");\n if (!e)\n throw new w(h.NoRootElement);\n return e;\n}\nfunction Te(e) {\n return {\n capabilities: \"#25BCDD\",\n \"managed-objects\": \"#FC7A12\",\n controller: \"#F635C6\",\n proxy: \"#48E70B\",\n views: \"#F6D72E\",\n system: \"#D52C2E\"\n }[e];\n}\nconst G = /* @__PURE__ */ new Map();\nfunction M(e) {\n let o = G.get(e);\n return o || (o = Ae(e === \"system\" ? \"[system]\" : `[${T()}] ${e}`), o.color = Te(e), o.enabled = Ie(), G.set(e, o), o);\n}\nfunction Ie() {\n const e = Se(), o = W.get(\"logging\");\n return e.environment === \"development\" && !!e.logging || o === \"true\";\n}\nlet z = (e = 21) => crypto.getRandomValues(new Uint8Array(e)).reduce((o, t) => (t &= 63, t < 36 ? o += t.toString(36) : t < 62 ? o += (t - 26).toString(36).toUpperCase() : t > 62 ? o += \"-\" : o += \"_\", o), \"\");\nconst Me = M(\"controller\");\nfunction De() {\n const e = T(), o = Ne();\n if (!e || !o)\n throw new w(h.NoAppNameOrKey);\n const t = Q(e);\n return g(t) ? g(t) : ($(t, o), o);\n}\nfunction ee() {\n const e = De();\n if (g(e))\n return g(e);\n const o = T();\n Me(\"creating app controller\");\n const t = {\n name: o,\n capabilities: {\n app: /* @__PURE__ */ new Map(),\n system: /* @__PURE__ */ new Map()\n },\n managedObjects: {\n providers: /* @__PURE__ */ new Map(),\n watchers: /* @__PURE__ */ new Map()\n },\n views: Oe()\n };\n return $(e, t), t;\n}\nasync function q(e) {\n await J();\n const o = Q(e), t = g(o);\n if (!t)\n return;\n const r = g(t);\n if (r)\n return r;\n}\nasync function Ze() {\n return await J(), (await Promise.all(\n g(I.RuntimeApps).map((o) => q(o))\n )).filter((o) => !!o);\n}\nconst L = M(\"views\");\nfunction te(e) {\n return e.type === B.View;\n}\nvar D = /* @__PURE__ */ ((e) => (e.Main = \"main\", e.Aside = \"aside\", e.Body = \"body\", e))(D || {});\nclass V {\n constructor(o, t) {\n k(this, \"type\", B.View);\n k(this, \"execute\");\n this.container = t, this.execute = o;\n }\n}\nfunction Oe() {\n const e = T(), o = /* @__PURE__ */ new Map(), t = async (i) => {\n const s = o.get(i);\n if (L(\"unmounting view - view: %O\", s), !s)\n throw new w(h.NoView, { id: i, app: e });\n s.unmount && await s.unmount(), s.element.replaceChildren(), s.element.removeAttribute(\"app\"), s.element.removeAttribute(\"view-id\"), o.delete(i), s.element.remove();\n };\n return {\n unmount: t,\n mount: async (i, s, u, p) => {\n if (L(\"mounting view - operation: %O, capability: %o, args: %O\", i, u, p), i.container === \"main\") {\n const c = me(e, u, p), y = location.href.replace(location.origin, \"\");\n c !== y && (L(\"syncing url - data: %O, url: %o\", p, c), history.pushState(p, \"\", c));\n }\n if (i.container === \"aside\" || i.container === \"main\") {\n const [c] = Array.from(document.getElementsByTagName(i.container)), y = c == null ? void 0 : c.getAttribute(\"app\"), C = c == null ? void 0 : c.getAttribute(\"view-id\");\n if (y && C) {\n const f = await q(y);\n await (f == null ? void 0 : f.views.unmount(C));\n }\n }\n let l;\n const d = Ee();\n i.container === \"aside\" ? (l = document.createElement(\n \"aside\"\n /* Aside */\n ), d.prepend(l)) : i.container === \"body\" ? (l = document.createElement(\"div\"), d.append(l)) : (l = document.createElement(\n \"main\"\n /* Main */\n ), d.append(l));\n const n = z(8);\n l.setAttribute(\"app\", e), l.setAttribute(\"view-id\", n);\n const a = {\n element: l,\n unmount: await i.execute(l, (c) => {\n s(c), t(n);\n })\n };\n o.set(n, a);\n }\n };\n}\nfunction Je(e) {\n return new V(e, D.Main);\n}\nfunction $e(e) {\n return new V(e, D.Body);\n}\nfunction Xe(e) {\n return new V(e, D.Aside);\n}\nfunction Qe(e) {\n return new Fe(e);\n}\nfunction Pe() {\n return structuredClone(g(I.RuntimeManifests));\n}\nconst v = M(\"system\");\nfunction xe(e) {\n const o = e.split(\";\")[0];\n return decodeURIComponent(o.split(\"=\")[0].trim());\n}\nconst Re = \"alliance-cookie-consent\";\nfunction Le() {\n let e = [\"necessary\"];\n const o = W.get(Re);\n if (o) {\n const t = o.split(\",\"), r = /* @__PURE__ */ new Set([...e, ...t]);\n e = Array.from(r);\n }\n return e;\n}\nfunction je() {\n return Pe().reduce((o, t) => {\n if (!t.storage)\n return o;\n for (const [r, i] of Object.entries(t.storage))\n o[r] = i;\n return o;\n }, {});\n}\nfunction et() {\n const e = je();\n function o(t, r, i) {\n const s = e[t];\n if (!s)\n throw new w(r, {\n key: t\n });\n if (!Le().includes(s.category))\n throw new w(i, {\n key: t,\n category: s.category\n });\n return !0;\n }\n try {\n const t = Object.getOwnPropertyDescriptor(Document.prototype, \"cookie\") || Object.getOwnPropertyDescriptor(HTMLDocument.prototype, \"cookie\");\n t && t.configurable && (v(\"registering override for document.cookie setter\"), Object.defineProperty(document, \"cookie\", {\n get: function() {\n var r;\n return (r = t == null ? void 0 : t.get) == null ? void 0 : r.call(document);\n },\n set: function(r) {\n var i;\n if (r) {\n const s = xe(r);\n try {\n o(\n s,\n h.CookieKeyNotDefined,\n h.CookieCategoryNotAllowed\n );\n } catch (u) {\n console.error(u);\n return;\n }\n }\n return (i = t == null ? void 0 : t.set) == null ? void 0 : i.call(document, r);\n }\n }));\n } catch (t) {\n v(\"error occurred when attempting to override document.cookie setter - error: %O\", t);\n }\n try {\n const t = window.CookieStore.prototype.set;\n t && (v(\"registering override for cookieStore.set function\"), window.CookieStore.prototype.set = async function(r) {\n const i = typeof r == \"object\" ? r.name : r;\n try {\n o(\n i,\n h.CookieKeyNotDefined,\n h.CookieCategoryNotAllowed\n );\n } catch (s) {\n console.error(s);\n return;\n }\n return t.apply(this, arguments);\n });\n } catch (t) {\n v(\"error occurred when attempting to cookieStore.set - error: %O\", t);\n }\n try {\n const t = window.Storage.prototype.setItem;\n v(\"registering override for sessionStorage.setItem and localStorage.setItem\"), window.Storage.prototype.setItem = function(r, i) {\n try {\n o(\n r,\n h.StorageKeyNotDefined,\n h.StorageCategoryNotAllowed\n );\n } catch (s) {\n console.error(s);\n return;\n }\n return t.apply(this, arguments);\n };\n } catch (t) {\n v(\n \"error occurred when attempting to sessionStorage.setItem and localStorage.setItem - error: %O\",\n t\n );\n }\n}\nconst Ue = `\n<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n <title>ACE Alliance - Cookie Policy</title>\n <link\n rel=\"icon\"\n href=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAGcElEQVRYha2Xe4xUVx3HP7/fPTOzDLO7sw8RlzWlZEtp2dCy0qIVWltKU/UPDZH6ijXWEK2odPcPa2qbhpi2kSa7blSStsFUjNq0lWCMaVMx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/fonts/TeliaSansV10/TeliaSans.css';\n @import 'https://fonts.googleapis.com/css?family=Reenie+Beanie';\n\n body {\n font-family: TeliaSans, Helvetica, Arial, Lucida Grande, sans-serif;\n }\n\n body > div {\n max-width: 1000px;\n margin: 0 auto;\n padding: 0 40px 40px;\n }\n </style>\n </head>\n\n <body>\n <div>\n <h1>Cookie Policy</h1>\n <p>\n On our websites, we use cookies and other similar technologies. You can choose\n whether you want to allow our websites to store cookies on your computer or not. You\n can change your choices at any time.\n </p>\n\n <h2>Your consent is required</h2>\n <p>\n You choose whether you want to accept cookies on your device or not. Your consent is\n required for the use of cookies, but not for such cookies that are necessary to\n enable the service that you as a user have requested. If you do not accept our use\n of cookies, or if you have previously approved our use and have changed your mind,\n you can return to your cookie settings at any time and change your choices. You do\n this by clicking on the cookie button/link. You may also need to change the settings\n in your browser and manually delete cookies to clear your device of previously\n stored cookies.\n </p>\n\n <h2>What are cookies?</h2>\n <p>\n A cookie is a small text file that is stored on your computer by the web browser\n while browsing a website. When we refer to cookies (“cookies”) in this policy, other\n similar technologies and tools that retrieve and store information in your browser,\n and in some cases forward such information to third parties, in a manner similar to\n cookies. Examples are pixels, local storage, session storage and fingerprinting.\n </p>\n <p>\n The websites will “remember” and “recognize” you. This can be done by placing\n cookies in three different ways;\n </p>\n <ul>\n <li>The session ends, ie until you close the window in your browser.</li>\n <li>\n Time-limited, ie the cookie has a predetermined lifespan. The time may vary\n between different cookies.\n </li>\n <li>\n Until further notice, ie the information remains until you choose to delete it\n yourself. This applies to local storage.\n </li>\n </ul>\n <p>You can always go into your browser and delete already stored cookies yourself.</p>\n\n <h3>Third Party Cookies</h3>\n <p>\n We use third-party cookies on our websites. Third-party cookies are stored by\n someone other than the person responsible for the website, in this case by a company\n other than Telia.\n </p>\n <p>\n Telia uses external platforms to communicate digitally, these include the Google\n Marketing Platform and others. The platforms use both first- and third-party cookies\n as well as similar techniques to advertise and follow up the results of the\n advertising.\n </p>\n <p>\n A third-party cookie can be used by several websites to understand and track how you\n browse between different websites. Telia receives information from these cookies,\n but the information can also be used for other purposes determined by third parties.\n Third-party cookies found on our website are covered by each third-party privacy\n policy. Feel free to read these to understand what other purposes the information\n can be used for. Links are in our Cookie Table.\n </p>\n <p>\n For information about which third-party cookies are used on our websites, see our\n Cookie Table. For more information on how Telia handles personal data in connection\n with transfers to third parties, read our Privacy Policy.\n </p>\n\n <h2>Cookies on our websites</h2>\n <p>\n In order for you to have better control over which cookies are used on the websites,\n and thus be able to more easily decide how cookies should be used when you visit our\n websites, we have identified four different categories of cookies. These categories\n are defined based on the purposes for the use of the cookies.\n </p>\n <p>\n In our Cookie Table, you can also see which category each cookie belongs to, for\n what purposes it is used and for how long it is active.\n </p>\n <p>\n We have identified the following four categories of cookies. All categories contain\n cookies which means that data is shared with third parties.\n </p>\n\n <h3>Necessary</h3>\n <p>\n These cookies are needed for our app to work in a secure and correct way. Necessary\n cookies enable you to use our app and us to provide the service you request.\n Necessary cookies make basic functions of the app possible, for example, identifying\n you when you log into My Telia, detecting repeated failed login attempts,\n identifying where you are in the buying process and remembering the items put into\n your shopping basket.\n </p>\n\n <h3>Functionality</h3>\n <p>\n These cookies let us to enable some useful functionalities to make the user\n experience better, for example, to remember your login details and settings.\n </p>\n\n <h3>Analytics</h3>\n <p>\n These cookies give us information about how you use our app and allow us to improve\n the user experience.\n </p>\n\n <h3>Marketing</h3>\n <p>\n These cookies help us and our partners to display personalized and relevant ads\n based on your browsing behavior on our website and in our app, even when you later\n visit other (third parties’) websites. These cookies are used to evaluate the\n effectiveness of our marketingcampaigns, as well as for targeted marketing and\n profiling, regardless of which device(s) you have used. Information collected for\n this purpose may also be combined with other customer and traffic data we have about\n you, if you have given your consent that we may use your traffic data for marketing\n purpose and have not objected to the use of your customer data for marketing\n purposes.\n </p>\n\n <h2>Manage settings</h2>\n <p>\n We save your cookie consent for 12 months. Then we will ask you again. Please note\n that some cookies have a lifespan that exceeds these 12 months. You may therefore\n need to change the settings in your browser and manually delete all cookies.\n </p>\n <p>\n More information on how to turn off cookies can be found in the instructions for\n your browser.\n </p>\n <ul>\n <li>\n <a\n href=\"https://support.google.com/accounts/answer/61416?co=GENIE.Platform%3DDesktop&amp;hl=en\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >Google Chrome</a\n >\n </li>\n <li>\n <a\n href=\"https://privacy.microsoft.com/en-us/windows-10-microsoft-edge-and-privacy\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >Microsoft Edge</a\n >\n </li>\n <li>\n <a\n href=\"https://support.mozilla.org/en-US/kb/enable-and-disable-cookies-website-preferences\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >Mozilla Firefox</a\n >\n </li>\n <li>\n <a\n href=\"https://support.microsoft.com/en-gb/help/17442/windows-internet-explorer-delete-manage-cookies\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >Microsoft Internet Explorer</a\n >\n </li>\n <li>\n <a\n href=\"https://www.opera.com/help/tutorials/security/privacy/\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >Opera</a\n >\n </li>\n <li>\n <a\n href=\"https://support.apple.com/guide/safari/manage-cookies-and-website-data-sfri11471/mac\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >Apple Safari</a\n >\n </li>\n </ul>\n\n <h3>Do Not Track-signals</h3>\n <p>\n If you have chosen to turn on the Do Not Track function in your browser, we will not\n automatically place cookies for marketing on your device. You make other choices in\n your cookie settings.\n </p>\n\n <h3>If you block cookies</h3>\n <p>\n If you choose not to accept our use of cookies, the functionality and performance of\n our websites may deteriorate as certain functions are dependent on cookies. A\n blocking of cookies can therefore mean that the websites’ services do not work as\n they should.\n </p>\n\n <h3>Your security with us</h3>\n <p>\n If you want to read more about your rights and how we protect your privacy, go to\n our privacy policy for\n <a\n href=\"https://www.telia.se/dam/jcr:df2eeb83-50ce-4383-89fc-0613f7615796/Integritetspolicy-privatkunder.pdf\"\n >private customers</a\n >\n (C2B) or\n <a\n href=\"https://www.telia.se/dam/jcr:95b2b4a5-82ca-436b-90e0-873e0a864118/Telia-integritetspolicy-foretag.pdf\"\n >corporate customers</a\n >\n (B2B). You are always welcome to contact us at\n <a href=\"mailto:dpo-se@teliacompany.com\">dpo-se@teliacompany.com</a> if you have any\n questions.\n </p>\n <p>Our cookie policy may change in the future.</p>\n <p>\n More information about cookies can be found at the Swedish Post and Telecom\n Authority (PTS).\n </p>\n\n <h2>Our Cookie Table</h2>\n <p>\n Below, you will find a list of the cookies and similar technologies that we use on\n this website. These cookies are stored on your device by us.\n </p>\n <table>\n <thead>\n <tr>\n <th>Cookie</th>\n <th>Category</th>\n <th>Purpose</th>\n <th>Lifespan</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>alliance-session-v1</td>\n <td>necessary</td>\n <td>Contains the authenticated user.</td>\n <td>1 day</td>\n </tr>\n {APP_COOKIES}\n </tbody>\n </table>\n <style>\n table {\n width: 100%;\n border: 1px solid rgba(0, 0, 0, 0.15);\n }\n th, td {\n text-align: left;\n padding: 3px;\n }\n </style>\n </div>\n </body>\n</html>\n`;\nfunction tt(e) {\n const o = [];\n for (const t of e)\n if (t.storage)\n for (const [r, i] of Object.entries(t.storage)) {\n const s = Be(r, i);\n o.push(s);\n }\n return Ue.replace(\"{APP_COOKIES}\", o.join(\"\"));\n}\nfunction Be(e, o) {\n const t = [\"<tr>\"], { category: r, purpose: i, lifespan: s } = o;\n return t.push(`<td>${e}</td>`), t.push(`<td>${r}</td>`), t.push(`<td>${i}</td>`), t.push(`<td>${s}</td>`), t.push(\"</tr>\"), t.join(\"\");\n}\nconst O = M(\"capabilities\");\nasync function oe(e, o, t) {\n const r = await q(e);\n if (!r)\n throw new w(h.MissingAppController, { app: e });\n const s = (t === \"app\" ? r.capabilities.app : r.capabilities.system).get(o);\n if (!s)\n throw new w(h.MissingCapabilityOnApp, {\n capability: o,\n app: e\n });\n return { controller: r, handler: s };\n}\nfunction ze(e) {\n return (o, t, r) => (e(\"requesting capability - app: %o, capability: %o, args: %O\", o, t, r), {\n id: z(8),\n result: new Promise(async (i) => {\n const { controller: s, handler: u } = await oe(\n o,\n t,\n \"app\"\n ), p = await u(r);\n Z(p) ? await p.execute(i) : te(p) && await s.views.mount(p, i, t, r), e(\n \"resolved capability - app: %o, capability: %o, args: %O\",\n o,\n t,\n r\n );\n })\n });\n}\nfunction ot(e, o) {\n if (E())\n throw new w(h.AlreadyInitialized);\n const t = ee();\n O(\"enabling capability - capability: %o, handler: %O\", e, o), t.capabilities.app.set(e, o);\n}\nfunction rt(e, o) {\n if (E())\n throw new w(h.AlreadyInitialized);\n const t = ee();\n O(\"enabling system capability - capability: %o, handler: %O\", e, o), t.capabilities.system.set(e, o);\n}\nfunction qe(e) {\n return (o, t, r) => {\n e(\n \"requesting system capability - capability: %o, args: %O, targetApp: %o\",\n o,\n t,\n r\n );\n const i = [], s = g(I.RuntimeApps);\n for (const u of s) {\n if (r && u !== r)\n continue;\n const p = new Promise(async (l) => {\n const { controller: d, handler: n } = await oe(\n u,\n o,\n \"system\"\n ), a = await n(t);\n Z(a) ? await a.execute(l) : te(a) && await d.views.mount(a, l, o, t), e(\n \"resolved system capability - capability: %o, args: %O, targetApp: %o\",\n o,\n t,\n r\n );\n });\n i.push({\n id: z(8),\n result: p\n });\n }\n return i;\n };\n}\nconst nt = qe(O), it = ze(O);\nexport {\n Re as A,\n w as I,\n h as N,\n Ge as P,\n I as S,\n _e as W,\n Ze as a,\n q as b,\n M as c,\n T as d,\n Ye as e,\n Se as f,\n ee as g,\n tt as h,\n E as i,\n ot as j,\n rt as k,\n nt as l,\n Xe as m,\n $e as n,\n Qe as o,\n Je as p,\n Pe as q,\n it as r,\n He as s,\n et as t,\n qe as u,\n ze as v,\n $ as w,\n g as x\n};\n//# sourceMappingURL=capabilities-c3af0137.js.map\n","import { c as T, i as P, I as l, N as p, g as j, a as v, b as N, d as S, e as O, f as z } from \"./chunks/capabilities-c3af0137.js\";\nimport { A as F, m as M, n as X, o as Y, p as Z, j as H, k as ee, h as te, q as ne, r as re, l as ae } from \"./chunks/capabilities-c3af0137.js\";\nfunction _(e) {\n return e;\n}\nconst c = T(\"managed-objects\");\nfunction L(e, t) {\n return c(\"querying objects - object: %o, args: %O\", e, t), {\n async resolve() {\n return c(\"resolving query - object: %o, args: %O\", e, t), await (await C(e)).managedObjects.providers.get(e)(t);\n },\n async watch(r) {\n c(\"adding watcher - object: %o, args: %O\", e, t), (await C(e)).managedObjects.watchers.get(e).push(r);\n }\n };\n}\nfunction V(e, t) {\n if (P())\n throw new l(p.AlreadyInitialized);\n c(\"registering provider - object: %o, handler: %O\", e, t);\n const r = j();\n return r.managedObjects.providers.set(e, t), r.managedObjects.watchers.set(e, []), function() {\n c(\"triggering watchers - object: %o, handler: %O\", e, t);\n const n = r.managedObjects.watchers.get(e) || [];\n for (const a of n)\n a();\n };\n}\nasync function C(e) {\n const r = (await v()).find(\n (n) => n.managedObjects.providers.has(e) && n.managedObjects.watchers.has(e)\n );\n if (!r)\n throw new l(p.MissingManagedObjectProvider, { object: e });\n return r;\n}\nfunction R() {\n var n;\n const e = O();\n return !e || !((n = e.resources) != null && n.localization) ? {} : Object.keys(e.resources.localization).reduce((a, o) => (a[o] = e.resources.localization[o].value, a), {});\n}\nfunction q(e = \"\", t) {\n return Object.entries(t).reduce((r, [n, a]) => r.replaceAll(`{{${n}}}`, a), e);\n}\nfunction x(e, t) {\n const r = { ...e };\n for (const n in r)\n t.hasOwnProperty(n) && (r[n] = t[n]);\n return r;\n}\nasync function $() {\n const e = R();\n let t = {};\n return await N(\"resource-management\") && (t = await L(\"resourceTexts\", { app: S() }).resolve()), x(e, t);\n}\nlet d = {};\nasync function Q() {\n return Object.keys(d).length === 0 && (d = await $()), (e, t) => {\n const r = d[e];\n if (r === void 0)\n throw new l(p.LocalizationTemplateNotDefined, { key: e });\n return !t || typeof t != \"object\" || Object.keys(t).length === 0 ? r : q(r, t);\n };\n}\nconst A = T(\"proxy\");\nvar k = /* @__PURE__ */ ((e) => (e.Get = \"GET\", e.Head = \"HEAD\", e.Post = \"POST\", e.Put = \"PUT\", e.Delete = \"DELETE\", e.Connect = \"CONNECT\", e.Options = \"OPTIONS\", e.Trace = \"TRACE\", e.Patch = \"PATCH\", e))(k || {});\nfunction b(e, t, r = []) {\n const n = new URL(e, location.origin);\n if (r.find((o) => D(o, e))) {\n const s = \"/-/gateway\" + (n.pathname !== \"/\" ? n.pathname : \"/\") + (t ? n.search : \"\");\n return new URL(s, location.origin);\n }\n return n;\n}\nfunction I(e = {}) {\n if (Object.keys(e).length === 0)\n return \"\";\n const t = Object.entries(e).reduce(\n (n, [a, o]) => (typeof o > \"u\" || o === null || (n[a] = o.toString()), n),\n {}\n );\n return `?${new URLSearchParams(t).toString()}`;\n}\nfunction U(e) {\n return e.replaceAll(/[-\\/\\\\^$*+?.()|[\\]{}]/g, \"\\\\$&\");\n}\nfunction D(e, t) {\n const r = U(e);\n return new RegExp(`^${r.replaceAll(\"\\\\?\", \".?\").replaceAll(\"\\\\*\", \".*\")}`, \"i\").test(t);\n}\nfunction G(e, t) {\n const r = O();\n if (!r)\n throw new l(p.NoManifest);\n const { name: n, endpoints: a = [] } = r;\n A(\"creating request - input: %o, options: %O\", e, { lots: 1, of: { properties: 123 } });\n const o = b(e.toString(), !0, a), s = new Request(o, t), { environment: u } = z();\n if (u === \"production\") {\n const g = location.pathname.split(\"/\").filter((f) => !!f);\n s.headers.set(\"Alliance-Target-Workspace\", g[0]);\n }\n return s.headers.set(\"Alliance-Target-Url\", e.toString()), s.headers.set(\"Alliance-Target-App\", n), A(\"created request - request: %O\", s), s;\n}\nfunction W() {\n const e = O();\n if (!e)\n throw new l(p.NoManifest);\n const { name: t, endpoints: r = [] } = e;\n async function n(a, o, s = {}) {\n const { body: u, query: g, headers: f } = s, E = b(a, !1, r), w = I(g), y = {\n \"Alliance-Target-Url\": `${a}${w}`,\n // FUTURE TODO: Is there a better name for this?\n \"Alliance-Target-App\": t\n }, h = location.pathname.split(\"/\").filter((i) => !!i);\n h.length > 1 && (y[\n \"Alliance-Target-Workspace\"\n /* TargetWorkspace */\n ] = h[0]);\n const m = {\n method: o,\n headers: {\n \"Content-Type\": \"application/json\",\n ...f,\n ...y\n }\n };\n return u && (m.body = JSON.stringify(u)), fetch(`${E}${w}`, m).then((i) => i.json()).catch((i) => {\n throw i;\n });\n }\n return {\n post: (a, o) => n(a, \"POST\", o),\n put: (a, o) => n(a, \"PUT\", o),\n delete: (a, o) => n(a, \"DELETE\", o),\n get: (a, o) => n(a, \"GET\", o),\n create: G\n };\n}\nexport {\n F as ALLIANCE_COOKIE_CONSENT_COOKIE_NAME,\n k as HttpMethods,\n M as createAsideViewOperation,\n X as createBodyViewOperation,\n Y as createOperation,\n W as createProxy,\n G as createRequest,\n Z as createViewOperation,\n _ as defineConfig,\n H as enableCapability,\n ee as enableSystemCapability,\n te as generateCookiePolicyHtml,\n ne as getAppManifests,\n Q as getTranslator,\n V as provideObjects,\n L as queryObjects,\n re as runCapability,\n ae as runSystemCapability\n};\n//# sourceMappingURL=index.js.map\n","var f = Object.defineProperty;\nvar v = (e, t, i) => t in e ? f(e, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[t] = i;\nvar a = (e, t, i) => (v(e, typeof t != \"symbol\" ? t + \"\" : t, i), i);\nvar N = /* @__PURE__ */ ((e) => (e[e.AlreadyInitialized = 1e3] = \"AlreadyInitialized\", e[e.NoAppNameOrKey = 1001] = \"NoAppNameOrKey\", e[e.MissingAppController = 1002] = \"MissingAppController\", e[e.MissingCapabilityOnApp = 1003] = \"MissingCapabilityOnApp\", e[e.MissingManagedObjectProvider = 1004] = \"MissingManagedObjectProvider\", e[e.NoManifest = 1005] = \"NoManifest\", e[e.NoRootElement = 1006] = \"NoRootElement\", e[e.NoView = 1007] = \"NoView\", e[e.CookieKeyNotDefined = 1008] = \"CookieKeyNotDefined\", e[e.CookieCategoryNotAllowed = 1009] = \"CookieCategoryNotAllowed\", e[e.StorageKeyNotDefined = 1010] = \"StorageKeyNotDefined\", e[e.StorageCategoryNotAllowed = 1011] = \"StorageCategoryNotAllowed\", e[e.LocalizationTemplateNotDefined = 1012] = \"LocalizationTemplateNotDefined\", e))(N || {}), A = /* @__PURE__ */ ((e) => (e[e.CurrentUserMissingProvider = 2e3] = \"CurrentUserMissingProvider\", e[e.CurrentUserGatewayNotStarted = 2001] = \"CurrentUserGatewayNotStarted\", e[e.CurrentUserMissingBackend = 2002] = \"CurrentUserMissingBackend\", e[e.CurrentUserMissingInDatabase = 2003] = \"CurrentUserMissingInDatabase\", e))(A || {});\nfunction m(e, t) {\n return Object.entries(t).reduce((i, [r, n]) => i.replaceAll(`{{${r}}}`, n), e);\n}\nconst S = {\n // framework\n 1e3: \"The runtime has already been initialized\",\n 1001: \"App name and/or app key is not defined on global scope\",\n 1002: \"No app controller registered for app '{{app}}'\",\n 1003: \"No capability '{{capability}}' enabled for app '{{app}}'\",\n 1004: \"No managed object provider registered for object '{{object}}'\",\n 1005: \"The current apps manifest is not defined on global scope\",\n 1006: \"Could not find the root element in the DOM\",\n 1007: \"Could not find view with id '{{id}}' on view controller for app '{{app}}'\",\n 1008: \"Cookie key '{{key}}' not present in manifest, cookie has not been set\",\n 1009: \"Cookies categorized as '{{category}}' are not allowed by the user, cookie '{{key}}' has not been set\",\n 1010: \"Storage key '{{key}}' not present in manifest, item has not been stored\",\n 1011: \"Storage categorized as '{{category}}' is not allowed by the user, item '{{key}}' has not been stored\",\n 1012: \"The translation template, referred by the key '{{key}}' is being used in app, but is not defined in the manifest.\",\n // utilities\n 2e3: \"No managed object provider registered for object 'currentUser'\",\n 2001: \"Could not access the gateway when querying 'currentUser'\",\n 2002: \"Could not access the required backend when querying 'currentUser'\",\n 2003: \"Could not locate the authenticated user in the Alliance database\"\n}, d = \"AllianceError\";\nclass I extends Error {\n constructor(t, i = {}) {\n const r = m(S[t], i), n = `https://github.com/telia-company/ace-alliance-sdk/wiki/error-codes#${t}`;\n super(r), this.code = t, this.name = d, this.stack = `[${t}] - ${r}\n` + n;\n }\n}\nfunction k(e) {\n return !!e.code && e.name === d;\n}\nfunction D(e) {\n const i = Object.entries(e).reduce((r, n) => {\n const [o, p] = n;\n return typeof p > \"u\" || (typeof p == \"object\" && p !== null ? r[o] = JSON.stringify(p) : r[o] = p), r;\n }, {});\n return Object.keys(i).length ? `?${new URLSearchParams(i)}` : \"\";\n}\nfunction b() {\n const e = l(), { href: t, search: i } = window.location;\n return t.replace(e, \"\").replace(i, \"\");\n}\nfunction C(e = \"\", t = \"\", i = {}) {\n const r = l().replace(location.origin, \"\"), n = D(i);\n return e ? t ? `${r}/${e}/${t}${n}` : `${r}/${e}${n}` : `${r}${n}`;\n}\nfunction W() {\n const e = b(), [t = \"\", i = \"\"] = e.split(\"/\").filter((r) => !!r);\n return {\n app: t,\n capability: i\n };\n}\nfunction P(e) {\n const { origin: t, pathname: i } = window.location;\n if (e === \"production\") {\n const [r] = i.split(\"/\").filter((n) => !!n);\n return globalThis.__ALLIANCE_RUNTIME_ROOT_URL = `${t}/${r}`;\n }\n return globalThis.__ALLIANCE_RUNTIME_ROOT_URL = t;\n}\nfunction l() {\n return globalThis.__ALLIANCE_RUNTIME_ROOT_URL;\n}\nvar s = /* @__PURE__ */ ((e) => (e[e.AlreadyExists = 0] = \"AlreadyExists\", e[e.ApiGatewayPortDescription = 1] = \"ApiGatewayPortDescription\", e[e.ApiServerModeDescription = 2] = \"ApiServerModeDescription\", e[e.AppConfigurationPath = 3] = \"AppConfigurationPath\", e[e.AppCreated = 4] = \"AppCreated\", e[e.AppEntryBuildOptionDescription = 5] = \"AppEntryBuildOptionDescription\", e[e.AppNameInquiry = 6] = \"AppNameInquiry\", e[e.BuildDescription = 7] = \"BuildDescription\", e[e.BuildModeOptionDescription = 8] = \"BuildModeOptionDescription\", e[e.BuildWatchDescription = 9] = \"BuildWatchDescription\", e[e.CreateAppDescription = 10] = \"CreateAppDescription\", e[e.CreateWorkspaceDescription = 11] = \"CreateWorkspaceDescription\", e[e.DevServerOpenDescription = 12] = \"DevServerOpenDescription\", e[e.DevServerPortDescription = 13] = \"DevServerPortDescription\", e[e.DevServerLoggingDescription = 14] = \"DevServerLoggingDescription\", e[e.Done = 15] = \"Done\", e[e.FetchPackageVersionError = 16] = \"FetchPackageVersionError\", e[e.ManifestEntryBuildOptionDescription = 17] = \"ManifestEntryBuildOptionDescription\", e[e.MissingTranslationKey = 18] = \"MissingTranslationKey\", e[e.NoAppName = 19] = \"NoAppName\", e[e.NoAppNameFound = 20] = \"NoAppNameFound\", e[e.NoAppOrWorkspaceInCurrentDirectory = 21] = \"NoAppOrWorkspaceInCurrentDirectory\", e[e.NoWorkspaceName = 22] = \"NoWorkspaceName\", e[e.OperationCancelled = 23] = \"OperationCancelled\", e[e.ServeDescription = 24] = \"ServeDescription\", e[e.ServedStopped = 25] = \"ServedStopped\", e[e.ServerGatewayMode = 26] = \"ServerGatewayMode\", e[e.ServerMode = 27] = \"ServerMode\", e[e.ServerModeInquiry = 28] = \"ServerModeInquiry\", e[e.ServerProxyMode = 29] = \"ServerProxyMode\", e[e.StopServerInstructions = 30] = \"StopServerInstructions\", e[e.TemplateFrameworkInquiry = 31] = \"TemplateFrameworkInquiry\", e[e.TemplateLanguageInquiry = 32] = \"TemplateLanguageInquiry\", e[e.UnrecognizedCommand = 33] = \"UnrecognizedCommand\", e[e.WorkspaceCreated = 34] = \"WorkspaceCreated\", e[e.WorkspaceNameInquiry = 35] = \"WorkspaceNameInquiry\", e))(s || {});\nconst M = {\n 15: \"Done\",\n 22: \"No workspace name provided!\",\n 19: \"No app name provided!\",\n 0: \"File or directory '{0}' already exists!\",\n 21: \"Could not find any app entry file at '{0}'!\",\n 33: \"Unrecognized command(s) {0}!\",\n 34: \"Workspace was created at path '{0}'!\",\n 4: \"App was created at path '{0}'!\",\n 25: \"Server stopped.\",\n 11: \"Creates an Alliance Workspace in the current directory.\",\n 10: \"Creates an Alliance Application in the current directory or Alliance Workspace.\",\n 24: \"Starts a Alliance development server using the current directory package.json.\",\n 7: \"Builds an Alliance Application using Vite.\",\n 35: \"Enter the name of your workspace\",\n 28: \"Which server mode do you want to use?\",\n 6: \"Enter the name of your app\",\n 18: \"No translation key provided!\",\n 23: \"Operation cancelled.\",\n 30: `Press CTRL + C to stop the server.\n`,\n 32: \"Select preferred language\",\n 31: \"Select preferred framework template\",\n 13: \"The port that the dev server should use.\",\n 14: \"Whether the dev server and browser console should output more log information or not (false).\",\n 1: \"The port that the api gateway should use.\",\n 2: \"Which components to start. [server|server-proxy|server-gateway].\",\n 12: \"Whether the dev server should automatically open in your browser or not.\",\n 9: \"Whether the build should start watching and rebuild when files change or not.\",\n 5: \"The entry file for the app (./src/app).\",\n 17: \"The entry file for the app manifest (./src/manifest).\",\n 8: \"Which mode to use when building the app.\",\n 16: \"Failed to fetch package info from the NPM registry for package '${0}'!\",\n 20: \"Could not find app name in manifest.\",\n 3: \"The path to the app configuration file.\",\n 27: \"Server\",\n 29: \"Server with proxy\",\n 26: \"Server with gateway\"\n}, c = class c {\n};\na(c, \"getTranslations\", () => M), a(c, \"getTranslation\", (t, ...i) => {\n const n = c.getTranslations()[t];\n if (!n)\n throw new Error(`Could not find text with given key '${t}'.`);\n return i.reduce(\n (p, h, g) => p.toString().replace(`{${g}}`, h.toString()),\n n\n ).toString();\n}), a(c, \"get\", (t = s.MissingTranslationKey, ...i) => c.getTranslation(t, ...i));\nlet u = c;\nfunction R(e, t) {\n return O(Object.values(e), ({ name: i }) => ({\n label: i,\n value: i,\n selected: t === i\n }));\n}\nvar y = /* @__PURE__ */ ((e) => (e.Primary = \"primary\", e.Secondary = \"secondary\", e.Expressive = \"expressive\", e.Destructive = \"destructive\", e.Text = \"text\", e.PrimaryWhite = \"primary-white\", e.SecondaryWhite = \"secondary-white\", e.ExpressiveWhite = \"expressive-white\", e.TertiaryPurple = \"tertiary-purple\", e))(y || {});\nfunction $(e, t) {\n return Object.values(e).find((r) => r.name === t);\n}\nfunction O(e, t, i = \"Choose...\") {\n return e.reduce(\n (r, n) => (r.push({\n disabled: !1,\n selected: !1,\n ...t(n)\n }), r),\n [\n {\n label: i,\n value: \"\",\n disabled: !0,\n selected: !0\n }\n ]\n );\n}\nfunction L(e) {\n return (t) => {\n t.key === \"Enter\" && e(t);\n };\n}\nfunction U(e, t = \"all\") {\n const { email: i, displayName: r } = e, n = r && r !== \"unknown\", o = !!i;\n switch (t) {\n case \"all\": {\n if (n && o)\n return `${r} (${i})`;\n if (n)\n return r;\n if (o)\n return i;\n }\n case \"single\": {\n if (n)\n return r;\n if (o)\n return i;\n }\n }\n return \"<UNKNOWN USER>\";\n}\nfunction j(...e) {\n return e.filter((t) => !!t).join(\" \");\n}\nexport {\n I as AllianceError,\n N as FrameworkErrorCodes,\n u as Texts,\n s as TranslationsKey,\n A as UtilitiesErrorCodes,\n y as VocaButtonVariant,\n j as classNames,\n C as createCapabilityPath,\n U as friendlyUserName,\n W as getCurrentLocationInfo,\n l as getRuntimeRootUrl,\n $ as getVocaIcon,\n k as isAllianceError,\n O as mapToVocaOptions,\n L as onEnter,\n P as setRuntimeRootUrl,\n R as vocaIconsToOptions\n};\n//# sourceMappingURL=index.js.map\n","import { queryObjects } from '@telia-ace/alliance-framework';\nimport {\n AllianceError,\n FrameworkErrorCodes,\n UtilitiesErrorCodes,\n isAllianceError,\n} from '@telia-ace/alliance-internal-client-utilities';\n\ntype CurrentUser = {\n permissions: { permission: { name: string; app: { name: string } } }[];\n email: string;\n type: 'system-admin' | 'user';\n};\n\nlet currentUser: CurrentUser;\n\nexport async function getCurrentUser() {\n try {\n if (currentUser) {\n return currentUser;\n }\n\n const query = queryObjects<CurrentUser>('currentUser');\n currentUser = await query.resolve();\n\n return currentUser;\n } catch (err: any) {\n if (isAllianceError(err) && err.code === FrameworkErrorCodes.MissingManagedObjectProvider) {\n throw new AllianceError(UtilitiesErrorCodes.CurrentUserMissingProvider);\n } else if (err.message.includes('GraphQL Error (Code: 404)')) {\n throw new AllianceError(UtilitiesErrorCodes.CurrentUserGatewayNotStarted);\n } else if (err.message.includes('GraphQL Error (Code: 500)')) {\n throw new AllianceError(UtilitiesErrorCodes.CurrentUserMissingBackend);\n } else if (\n err.message.includes('GraphQL Error (Code: 200)') &&\n err.message.includes('Cannot return null for non-nullable field')\n ) {\n throw new AllianceError(UtilitiesErrorCodes.CurrentUserMissingInDatabase);\n } else {\n throw err;\n }\n }\n}\n\nexport async function isSystemAdmin() {\n const currentUser = await getCurrentUser();\n return !!currentUser && currentUser.type === 'system-admin';\n}\n\nexport async function hasPermission(appName: string, permissionName: string): Promise<boolean> {\n const currentUser = await getCurrentUser();\n return !!currentUser?.permissions.find(\n ({ permission }) => permission.app.name === appName && permission.name === permissionName\n );\n}\n"],"names":["S","o","t","r","ce","s","u","p","l","d","n","W","le","ue","x","h","pe","de","fe","w","H","ge","A","we","U","R","_","Ce","a","c","C","be","f","m","b","F","re","P","ne","K","ie","ve","ke","Ae","T","Se","J","E","g","X","Q","I","Te","G","M","Ie","q","Ze","L","v","i","N","k","currentUser","getCurrentUser","queryObjects","err","isAllianceError","FrameworkErrorCodes","AllianceError","UtilitiesErrorCodes","isSystemAdmin","hasPermission","appName","permissionName","permission"],"mappings":"AAGA;AACA,SAASA,EAAE,GAAG;AACZ,WAASC,IAAI,GAAGA,IAAI,UAAU,QAAQA,KAAK;AACzC,QAAIC,IAAI,UAAUD,CAAC;AACnB,aAASE,KAAKD;AACZ,QAAEC,CAAC,IAAID,EAAEC,CAAC;AAAA,EACb;AACD,SAAO;AACT;AACA,IAAIC,IAAK;AAAA,EACP,MAAM,SAAS,GAAG;AAChB,WAAO,EAAE,CAAC,MAAM,QAAQ,IAAI,EAAE,MAAM,GAAG,EAAE,IAAI,EAAE,QAAQ,oBAAoB,kBAAkB;AAAA,EAC9F;AAAA,EACD,OAAO,SAAS,GAAG;AACjB,WAAO,mBAAmB,CAAC,EAAE;AAAA,MAC3B;AAAA,MACA;AAAA,IACN;AAAA,EACG;AACH;AACA,SAAS,EAAE,GAAGH,GAAG;AACf,WAASC,EAAE,GAAGG,GAAGC,G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,2BAA2B,KAChDA,EAAI,QAAQ,SAAS,2CAA2C,IAE1D,IAAIG,EAAcC,EAAoB,4BAA4B,IAElEJ;AAAA,EAEd;AACJ;AAEA,eAAsBK,KAAgB;AAC5BR,QAAAA,IAAc,MAAMC;AAC1B,SAAO,CAAC,CAACD,KAAeA,EAAY,SAAS;AACjD;AAEsB,eAAAS,GAAcC,GAAiBC,GAA0C;AACrFX,QAAAA,IAAc,MAAMC;AACnB,SAAA,CAAC,EAACD,KAAAA,QAAAA,EAAa,YAAY;AAAA,IAC9B,CAAC,EAAE,YAAAY,EAAW,MAAMA,EAAW,IAAI,SAASF,KAAWE,EAAW,SAASD;AAAA;AAEnF;"}
1
+ {"version":3,"file":"index.js","sources":["../../framework/dist/chunks/capabilities-01b818cf.js","../../framework/dist/index.js","../../../internal/client-utilities/dist/index.js","../src/get-current-user.ts","../src/get-translator.ts"],"sourcesContent":["var ae = Object.defineProperty;\nvar se = (e, o, t) => o in e ? ae(e, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[o] = t;\nvar k = (e, o, t) => (se(e, typeof o != \"symbol\" ? o + \"\" : o, t), t);\n/*! js-cookie v3.0.5 | MIT */\nfunction S(e) {\n for (var o = 1; o < arguments.length; o++) {\n var t = arguments[o];\n for (var r in t)\n e[r] = t[r];\n }\n return e;\n}\nvar ce = {\n read: function(e) {\n return e[0] === '\"' && (e = e.slice(1, -1)), e.replace(/(%[\\dA-F]{2})+/gi, decodeURIComponent);\n },\n write: function(e) {\n return encodeURIComponent(e).replace(\n /%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,\n decodeURIComponent\n );\n }\n};\nfunction j(e, o) {\n function t(i, s, u) {\n if (!(typeof document > \"u\")) {\n u = S({}, o, u), typeof u.expires == \"number\" && (u.expires = new Date(Date.now() + u.expires * 864e5)), u.expires && (u.expires = u.expires.toUTCString()), i = encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);\n var p = \"\";\n for (var l in u)\n u[l] && (p += \"; \" + l, u[l] !== !0 && (p += \"=\" + u[l].split(\";\")[0]));\n return document.cookie = i + \"=\" + e.write(s, i) + p;\n }\n }\n function r(i) {\n if (!(typeof document > \"u\" || arguments.length && !i)) {\n for (var s = document.cookie ? document.cookie.split(\"; \") : [], u = {}, p = 0; p < s.length; p++) {\n var l = s[p].split(\"=\"), d = l.slice(1).join(\"=\");\n try {\n var n = decodeURIComponent(l[0]);\n if (u[n] = e.read(d, n), i === n)\n break;\n } catch {\n }\n }\n return i ? u[i] : u;\n }\n }\n return Object.create(\n {\n set: t,\n get: r,\n remove: function(i, s) {\n t(\n i,\n \"\",\n S({}, s, {\n expires: -1\n })\n );\n },\n withAttributes: function(i) {\n return j(this.converter, S({}, this.attributes, i));\n },\n withConverter: function(i) {\n return j(S({}, this.converter, i), this.attributes);\n }\n },\n {\n attributes: { value: Object.freeze(o) },\n converter: { value: Object.freeze(e) }\n }\n );\n}\nvar W = j(ce, { path: \"/\" }), le = Object.defineProperty, ue = (e, o, t) => o in e ? le(e, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[o] = t, x = (e, o, t) => (ue(e, typeof o != \"symbol\" ? o + \"\" : o, t), t), h = /* @__PURE__ */ ((e) => (e[e.AlreadyInitialized = 1e3] = \"AlreadyInitialized\", e[e.NoAppNameOrKey = 1001] = \"NoAppNameOrKey\", e[e.MissingAppController = 1002] = \"MissingAppController\", e[e.MissingCapabilityOnApp = 1003] = \"MissingCapabilityOnApp\", e[e.MissingManagedObjectProvider = 1004] = \"MissingManagedObjectProvider\", e[e.NoManifest = 1005] = \"NoManifest\", e[e.NoRootElement = 1006] = \"NoRootElement\", e[e.NoView = 1007] = \"NoView\", e[e.CookieKeyNotDefined = 1008] = \"CookieKeyNotDefined\", e[e.CookieCategoryNotAllowed = 1009] = \"CookieCategoryNotAllowed\", e[e.StorageKeyNotDefined = 1010] = \"StorageKeyNotDefined\", e[e.StorageCategoryNotAllowed = 1011] = \"StorageCategoryNotAllowed\", e[e.LocalizationTemplateNotDefined = 1012] = \"LocalizationTemplateNotDefined\", e))(h || {});\nfunction pe(e, o) {\n return Object.entries(o).reduce((t, [r, i]) => t.replaceAll(`{{${r}}}`, i), e);\n}\nconst de = {\n // framework\n 1e3: \"The runtime has already been initialized\",\n 1001: \"App name and/or app key is not defined on global scope\",\n 1002: \"No app controller registered for app '{{app}}'\",\n 1003: \"No capability '{{capability}}' enabled for app '{{app}}'\",\n 1004: \"No managed object provider registered for object '{{object}}'\",\n 1005: \"The current apps manifest is not defined on global scope\",\n 1006: \"Could not find the root element in the DOM\",\n 1007: \"Could not find view with id '{{id}}' on view controller for app '{{app}}'\",\n 1008: \"Cookie key '{{key}}' not present in manifest, cookie has not been set\",\n 1009: \"Cookies categorized as '{{category}}' are not allowed by the user, cookie '{{key}}' has not been set\",\n 1010: \"Storage key '{{key}}' not present in manifest, item has not been stored\",\n 1011: \"Storage categorized as '{{category}}' is not allowed by the user, item '{{key}}' has not been stored\",\n 1012: \"The translation template, referred by the key '{{key}}' is being used in app, but is not defined in the manifest.\",\n // utilities\n 2e3: \"No managed object provider registered for object 'currentUser'\",\n 2001: \"Could not access the gateway when querying 'currentUser'\",\n 2002: \"Could not access the required backend when querying 'currentUser'\",\n 2003: \"Could not locate the authenticated user in the Alliance database\"\n}, fe = \"AllianceError\";\nclass w extends Error {\n constructor(o, t = {}) {\n const r = pe(de[o], t), i = `https://github.com/telia-company/ace-alliance-sdk/wiki/error-codes#${o}`;\n super(r), this.code = o, this.name = fe, this.stack = `[${o}] - ${r}\n` + i;\n }\n}\nfunction he(e) {\n const o = Object.entries(e).reduce((t, r) => {\n const [i, s] = r;\n return typeof s > \"u\" || (typeof s == \"object\" && s !== null ? t[i] = JSON.stringify(s) : t[i] = s), t;\n }, {});\n return Object.keys(o).length ? `?${new URLSearchParams(o)}` : \"\";\n}\nfunction ye() {\n const e = Y(), { href: o, search: t } = window.location;\n return o.replace(e, \"\").replace(t, \"\");\n}\nfunction me(e = \"\", o = \"\", t = {}) {\n const r = Y().replace(location.origin, \"\"), i = he(t);\n return e ? o ? `${r}/${e}/${o}${i}` : `${r}/${e}${i}` : `${r}${i}`;\n}\nfunction _e() {\n const e = ye(), [o = \"\", t = \"\"] = e.split(\"/\").filter((r) => !!r);\n return {\n app: o,\n capability: t\n };\n}\nfunction Ge(e) {\n const { origin: o, pathname: t } = window.location;\n if (e === \"production\") {\n const [r] = t.split(\"/\").filter((i) => !!i);\n return globalThis.__ALLIANCE_RUNTIME_ROOT_URL = `${o}/${r}`;\n }\n return globalThis.__ALLIANCE_RUNTIME_ROOT_URL = o;\n}\nfunction Y() {\n return globalThis.__ALLIANCE_RUNTIME_ROOT_URL;\n}\nvar H = /* @__PURE__ */ ((e) => (e[e.AlreadyExists = 0] = \"AlreadyExists\", e[e.ApiGatewayPortDescription = 1] = \"ApiGatewayPortDescription\", e[e.ApiServerModeDescription = 2] = \"ApiServerModeDescription\", e[e.AppConfigurationPath = 3] = \"AppConfigurationPath\", e[e.AppCreated = 4] = \"AppCreated\", e[e.AppEntryBuildOptionDescription = 5] = \"AppEntryBuildOptionDescription\", e[e.AppNameInquiry = 6] = \"AppNameInquiry\", e[e.BuildDescription = 7] = \"BuildDescription\", e[e.BuildModeOptionDescription = 8] = \"BuildModeOptionDescription\", e[e.BuildWatchDescription = 9] = \"BuildWatchDescription\", e[e.CreateAppDescription = 10] = \"CreateAppDescription\", e[e.CreateWorkspaceDescription = 11] = \"CreateWorkspaceDescription\", e[e.DevServerOpenDescription = 12] = \"DevServerOpenDescription\", e[e.DevServerPortDescription = 13] = \"DevServerPortDescription\", e[e.DevServerLoggingDescription = 14] = \"DevServerLoggingDescription\", e[e.Done = 15] = \"Done\", e[e.FetchPackageVersionError = 16] = \"FetchPackageVersionError\", e[e.ManifestEntryBuildOptionDescription = 17] = \"ManifestEntryBuildOptionDescription\", e[e.MissingTranslationKey = 18] = \"MissingTranslationKey\", e[e.NoAppName = 19] = \"NoAppName\", e[e.NoAppNameFound = 20] = \"NoAppNameFound\", e[e.NoAppOrWorkspaceInCurrentDirectory = 21] = \"NoAppOrWorkspaceInCurrentDirectory\", e[e.NoWorkspaceName = 22] = \"NoWorkspaceName\", e[e.OperationCancelled = 23] = \"OperationCancelled\", e[e.ServeDescription = 24] = \"ServeDescription\", e[e.ServedStopped = 25] = \"ServedStopped\", e[e.ServerGatewayMode = 26] = \"ServerGatewayMode\", e[e.ServerMode = 27] = \"ServerMode\", e[e.ServerModeInquiry = 28] = \"ServerModeInquiry\", e[e.ServerProxyMode = 29] = \"ServerProxyMode\", e[e.StopServerInstructions = 30] = \"StopServerInstructions\", e[e.TemplateFrameworkInquiry = 31] = \"TemplateFrameworkInquiry\", e[e.TemplateLanguageInquiry = 32] = \"TemplateLanguageInquiry\", e[e.UnrecognizedCommand = 33] = \"UnrecognizedCommand\", e[e.WorkspaceCreated = 34] = \"WorkspaceCreated\", e[e.WorkspaceNameInquiry = 35] = \"WorkspaceNameInquiry\", e))(H || {});\nconst ge = {\n 15: \"Done\",\n 22: \"No workspace name provided!\",\n 19: \"No app name provided!\",\n 0: \"File or directory '{0}' already exists!\",\n 21: \"Could not find any app entry file at '{0}'!\",\n 33: \"Unrecognized command(s) {0}!\",\n 34: \"Workspace was created at path '{0}'!\",\n 4: \"App was created at path '{0}'!\",\n 25: \"Server stopped.\",\n 11: \"Creates an Alliance Workspace in the current directory.\",\n 10: \"Creates an Alliance Application in the current directory or Alliance Workspace.\",\n 24: \"Starts a Alliance development server using the current directory package.json.\",\n 7: \"Builds an Alliance Application using Vite.\",\n 35: \"Enter the name of your workspace\",\n 28: \"Which server mode do you want to use?\",\n 6: \"Enter the name of your app\",\n 18: \"No translation key provided!\",\n 23: \"Operation cancelled.\",\n 30: `Press CTRL + C to stop the server.\n`,\n 32: \"Select preferred language\",\n 31: \"Select preferred framework template\",\n 13: \"The port that the dev server should use.\",\n 14: \"Whether the dev server and browser console should output more log information or not (false).\",\n 1: \"The port that the api gateway should use.\",\n 2: \"Which components to start. [server|server-proxy|server-gateway].\",\n 12: \"Whether the dev server should automatically open in your browser or not.\",\n 9: \"Whether the build should start watching and rebuild when files change or not.\",\n 5: \"The entry file for the app (./src/app).\",\n 17: \"The entry file for the app manifest (./src/manifest).\",\n 8: \"Which mode to use when building the app.\",\n 16: \"Failed to fetch package info from the NPM registry for package '${0}'!\",\n 20: \"Could not find app name in manifest.\",\n 3: \"The path to the app configuration file.\",\n 27: \"Server\",\n 29: \"Server with proxy\",\n 26: \"Server with gateway\"\n}, A = class {\n};\nx(A, \"getTranslations\", () => ge), x(A, \"getTranslation\", (e, ...o) => {\n const t = A.getTranslations()[e];\n if (!t)\n throw new Error(`Could not find text with given key '${e}'.`);\n return o.reduce(\n (r, i, s) => r.toString().replace(`{${s}}`, i.toString()),\n t\n ).toString();\n}), x(A, \"get\", (e = H.MissingTranslationKey, ...o) => A.getTranslation(e, ...o));\nfunction we(e) {\n return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, \"default\") ? e.default : e;\n}\nvar U = { exports: {} }, R, _;\nfunction Ce() {\n if (_)\n return R;\n _ = 1;\n var e = 1e3, o = e * 60, t = o * 60, r = t * 24, i = r * 7, s = r * 365.25;\n R = function(n, a) {\n a = a || {};\n var c = typeof n;\n if (c === \"string\" && n.length > 0)\n return u(n);\n if (c === \"number\" && isFinite(n))\n return a.long ? l(n) : p(n);\n throw new Error(\n \"val is not a non-empty string or a valid number. val=\" + JSON.stringify(n)\n );\n };\n function u(n) {\n if (n = String(n), !(n.length > 100)) {\n var a = /^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(\n n\n );\n if (a) {\n var c = parseFloat(a[1]), y = (a[2] || \"ms\").toLowerCase();\n switch (y) {\n case \"years\":\n case \"year\":\n case \"yrs\":\n case \"yr\":\n case \"y\":\n return c * s;\n case \"weeks\":\n case \"week\":\n case \"w\":\n return c * i;\n case \"days\":\n case \"day\":\n case \"d\":\n return c * r;\n case \"hours\":\n case \"hour\":\n case \"hrs\":\n case \"hr\":\n case \"h\":\n return c * t;\n case \"minutes\":\n case \"minute\":\n case \"mins\":\n case \"min\":\n case \"m\":\n return c * o;\n case \"seconds\":\n case \"second\":\n case \"secs\":\n case \"sec\":\n case \"s\":\n return c * e;\n case \"milliseconds\":\n case \"millisecond\":\n case \"msecs\":\n case \"msec\":\n case \"ms\":\n return c;\n default:\n return;\n }\n }\n }\n }\n function p(n) {\n var a = Math.abs(n);\n return a >= r ? Math.round(n / r) + \"d\" : a >= t ? Math.round(n / t) + \"h\" : a >= o ? Math.round(n / o) + \"m\" : a >= e ? Math.round(n / e) + \"s\" : n + \"ms\";\n }\n function l(n) {\n var a = Math.abs(n);\n return a >= r ? d(n, a, r, \"day\") : a >= t ? d(n, a, t, \"hour\") : a >= o ? d(n, a, o, \"minute\") : a >= e ? d(n, a, e, \"second\") : n + \" ms\";\n }\n function d(n, a, c, y) {\n var C = a >= c * 1.5;\n return Math.round(n / c) + \" \" + y + (C ? \"s\" : \"\");\n }\n return R;\n}\nfunction be(e) {\n t.debug = t, t.default = t, t.coerce = l, t.disable = s, t.enable = i, t.enabled = u, t.humanize = Ce(), t.destroy = d, Object.keys(e).forEach((n) => {\n t[n] = e[n];\n }), t.names = [], t.skips = [], t.formatters = {};\n function o(n) {\n let a = 0;\n for (let c = 0; c < n.length; c++)\n a = (a << 5) - a + n.charCodeAt(c), a |= 0;\n return t.colors[Math.abs(a) % t.colors.length];\n }\n t.selectColor = o;\n function t(n) {\n let a, c = null, y, C;\n function f(...m) {\n if (!f.enabled)\n return;\n const b = f, F = Number(/* @__PURE__ */ new Date()), re = F - (a || F);\n b.diff = re, b.prev = a, b.curr = F, a = F, m[0] = t.coerce(m[0]), typeof m[0] != \"string\" && m.unshift(\"%O\");\n let N = 0;\n m[0] = m[0].replace(/%([a-zA-Z%])/g, (P, ne) => {\n if (P === \"%%\")\n return \"%\";\n N++;\n const K = t.formatters[ne];\n if (typeof K == \"function\") {\n const ie = m[N];\n P = K.call(b, ie), m.splice(N, 1), N--;\n }\n return P;\n }), t.formatArgs.call(b, m), (b.log || t.log).apply(b, m);\n }\n return f.namespace = n, f.useColors = t.useColors(), f.color = t.selectColor(n), f.extend = r, f.destroy = t.destroy, Object.defineProperty(f, \"enabled\", {\n enumerable: !0,\n configurable: !1,\n get: () => c !== null ? c : (y !== t.namespaces && (y = t.namespaces, C = t.enabled(n)), C),\n set: (m) => {\n c = m;\n }\n }), typeof t.init == \"function\" && t.init(f), f;\n }\n function r(n, a) {\n const c = t(this.namespace + (typeof a > \"u\" ? \":\" : a) + n);\n return c.log = this.log, c;\n }\n function i(n) {\n t.save(n), t.namespaces = n, t.names = [], t.skips = [];\n let a;\n const c = (typeof n == \"string\" ? n : \"\").split(/[\\s,]+/), y = c.length;\n for (a = 0; a < y; a++)\n c[a] && (n = c[a].replace(/\\*/g, \".*?\"), n[0] === \"-\" ? t.skips.push(new RegExp(\"^\" + n.slice(1) + \"$\")) : t.names.push(new RegExp(\"^\" + n + \"$\")));\n }\n function s() {\n const n = [\n ...t.names.map(p),\n ...t.skips.map(p).map((a) => \"-\" + a)\n ].join(\",\");\n return t.enable(\"\"), n;\n }\n function u(n) {\n if (n[n.length - 1] === \"*\")\n return !0;\n let a, c;\n for (a = 0, c = t.skips.length; a < c; a++)\n if (t.skips[a].test(n))\n return !1;\n for (a = 0, c = t.names.length; a < c; a++)\n if (t.names[a].test(n))\n return !0;\n return !1;\n }\n function p(n) {\n return n.toString().substring(2, n.toString().length - 2).replace(/\\.\\*\\?$/, \"*\");\n }\n function l(n) {\n return n instanceof Error ? n.stack || n.message : n;\n }\n function d() {\n console.warn(\"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.\");\n }\n return t.enable(t.load()), t;\n}\nvar ve = be;\n(function(e, o) {\n o.formatArgs = r, o.save = i, o.load = s, o.useColors = t, o.storage = u(), o.destroy = (() => {\n let l = !1;\n return () => {\n l || (l = !0, console.warn(\"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.\"));\n };\n })(), o.colors = [\n \"#0000CC\",\n \"#0000FF\",\n \"#0033CC\",\n \"#0033FF\",\n \"#0066CC\",\n \"#0066FF\",\n \"#0099CC\",\n \"#0099FF\",\n \"#00CC00\",\n \"#00CC33\",\n \"#00CC66\",\n \"#00CC99\",\n \"#00CCCC\",\n \"#00CCFF\",\n \"#3300CC\",\n \"#3300FF\",\n \"#3333CC\",\n \"#3333FF\",\n \"#3366CC\",\n \"#3366FF\",\n \"#3399CC\",\n \"#3399FF\",\n \"#33CC00\",\n \"#33CC33\",\n \"#33CC66\",\n \"#33CC99\",\n \"#33CCCC\",\n \"#33CCFF\",\n \"#6600CC\",\n \"#6600FF\",\n \"#6633CC\",\n \"#6633FF\",\n \"#66CC00\",\n \"#66CC33\",\n \"#9900CC\",\n \"#9900FF\",\n \"#9933CC\",\n \"#9933FF\",\n \"#99CC00\",\n \"#99CC33\",\n \"#CC0000\",\n \"#CC0033\",\n \"#CC0066\",\n \"#CC0099\",\n \"#CC00CC\",\n \"#CC00FF\",\n \"#CC3300\",\n \"#CC3333\",\n \"#CC3366\",\n \"#CC3399\",\n \"#CC33CC\",\n \"#CC33FF\",\n \"#CC6600\",\n \"#CC6633\",\n \"#CC9900\",\n \"#CC9933\",\n \"#CCCC00\",\n \"#CCCC33\",\n \"#FF0000\",\n \"#FF0033\",\n \"#FF0066\",\n \"#FF0099\",\n \"#FF00CC\",\n \"#FF00FF\",\n \"#FF3300\",\n \"#FF3333\",\n \"#FF3366\",\n \"#FF3399\",\n \"#FF33CC\",\n \"#FF33FF\",\n \"#FF6600\",\n \"#FF6633\",\n \"#FF9900\",\n \"#FF9933\",\n \"#FFCC00\",\n \"#FFCC33\"\n ];\n function t() {\n return typeof window < \"u\" && window.process && (window.process.type === \"renderer\" || window.process.__nwjs) ? !0 : typeof navigator < \"u\" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/) ? !1 : typeof document < \"u\" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773\n typeof window < \"u\" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n typeof navigator < \"u\" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker\n typeof navigator < \"u\" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/);\n }\n function r(l) {\n if (l[0] = (this.useColors ? \"%c\" : \"\") + this.namespace + (this.useColors ? \" %c\" : \" \") + l[0] + (this.useColors ? \"%c \" : \" \") + \"+\" + e.exports.humanize(this.diff), !this.useColors)\n return;\n const d = \"color: \" + this.color;\n l.splice(1, 0, d, \"color: inherit\");\n let n = 0, a = 0;\n l[0].replace(/%[a-zA-Z%]/g, (c) => {\n c !== \"%%\" && (n++, c === \"%c\" && (a = n));\n }), l.splice(a, 0, d);\n }\n o.log = console.debug || console.log || (() => {\n });\n function i(l) {\n try {\n l ? o.storage.setItem(\"debug\", l) : o.storage.removeItem(\"debug\");\n } catch {\n }\n }\n function s() {\n let l;\n try {\n l = o.storage.getItem(\"debug\");\n } catch {\n }\n return !l && typeof process < \"u\" && \"env\" in process && (l = process.env.DEBUG), l;\n }\n function u() {\n try {\n return localStorage;\n } catch {\n }\n }\n e.exports = ve(o);\n const { formatters: p } = e.exports;\n p.j = function(l) {\n try {\n return JSON.stringify(l);\n } catch (d) {\n return \"[UnexpectedJSONParseError]: \" + d.message;\n }\n };\n})(U, U.exports);\nvar ke = U.exports;\nconst Ae = /* @__PURE__ */ we(ke);\nfunction Z(e) {\n return e.type === \"Logic\";\n}\nvar B = /* @__PURE__ */ ((e) => (e.View = \"View\", e.Logic = \"Logic\", e))(B || {});\nclass Fe {\n constructor(o) {\n k(this, \"type\", \"Logic\");\n k(this, \"execute\");\n this.execute = o;\n }\n}\nfunction T() {\n try {\n return ALLIANCE_APP_NAME;\n } catch {\n }\n}\nfunction Ne() {\n try {\n return ALLIANCE_APP_KEY;\n } catch {\n }\n}\nfunction Se() {\n const e = {\n environment: \"production\",\n logging: !1\n };\n try {\n return ALLIANCE_ENVIRONMENT || e;\n } catch {\n return e;\n }\n}\nfunction J() {\n if (E())\n return Promise.resolve();\n const e = 2e4, o = 5;\n return new Promise((t, r) => {\n const i = () => {\n clearInterval(u), clearTimeout(s);\n }, s = setTimeout(() => {\n i(), r(new Error(`Runtime not initialized after ${e}ms`));\n }, e), u = setInterval(() => {\n E() && (i(), t());\n }, o);\n });\n}\nfunction E() {\n return g(\n \"RUNTIME_INITIALIZED\"\n /* RuntimeInitialized */\n );\n}\nfunction g(e = \"\") {\n return globalThis[X(e)];\n}\nfunction $(e, o) {\n return globalThis[X(e)] = o;\n}\nfunction X(e) {\n return `__ALLIANCE_${e}`;\n}\nfunction Q(e) {\n return `APP_CONTROLLER_KEY_${e}`;\n}\nvar I = /* @__PURE__ */ ((e) => (e.RuntimeInitialized = \"RUNTIME_INITIALIZED\", e.RuntimeApps = \"RUNTIME_APPS\", e.RuntimeManifests = \"RUNTIME_MANIFESTS\", e))(I || {});\nfunction Ye() {\n const e = document.createElement(\"div\");\n return e.id = \"root\", document.body.append(e), e;\n}\nfunction Ee() {\n const e = document.getElementById(\"root\");\n if (!e)\n throw new w(h.NoRootElement);\n return e;\n}\nfunction Te(e) {\n return {\n capabilities: \"#25BCDD\",\n \"managed-objects\": \"#FC7A12\",\n controller: \"#F635C6\",\n proxy: \"#48E70B\",\n views: \"#F6D72E\",\n system: \"#D52C2E\"\n }[e];\n}\nconst G = /* @__PURE__ */ new Map();\nfunction M(e) {\n let o = G.get(e);\n return o || (o = Ae(e === \"system\" ? \"[system]\" : `[${T()}] ${e}`), o.color = Te(e), o.enabled = Ie(), G.set(e, o), o);\n}\nfunction Ie() {\n const e = Se(), o = W.get(\"logging\");\n return e.environment === \"development\" && !!e.logging || o === \"true\";\n}\nlet z = (e = 21) => crypto.getRandomValues(new Uint8Array(e)).reduce((o, t) => (t &= 63, t < 36 ? o += t.toString(36) : t < 62 ? o += (t - 26).toString(36).toUpperCase() : t > 62 ? o += \"-\" : o += \"_\", o), \"\");\nconst Me = M(\"controller\");\nfunction De() {\n const e = T(), o = Ne();\n if (!e || !o)\n throw new w(h.NoAppNameOrKey);\n const t = Q(e);\n return g(t) ? g(t) : ($(t, o), o);\n}\nfunction ee() {\n const e = De();\n if (g(e))\n return g(e);\n const o = T();\n Me(\"creating app controller\");\n const t = {\n name: o,\n capabilities: {\n app: /* @__PURE__ */ new Map(),\n system: /* @__PURE__ */ new Map()\n },\n managedObjects: {\n providers: /* @__PURE__ */ new Map(),\n watchers: /* @__PURE__ */ new Map()\n },\n views: Oe()\n };\n return $(e, t), t;\n}\nasync function q(e) {\n await J();\n const o = Q(e), t = g(o);\n if (!t)\n return;\n const r = g(t);\n if (r)\n return r;\n}\nasync function He() {\n return await J(), (await Promise.all(\n g(I.RuntimeApps).map((o) => q(o))\n )).filter((o) => !!o);\n}\nconst L = M(\"views\");\nfunction te(e) {\n return e.type === B.View;\n}\nvar D = /* @__PURE__ */ ((e) => (e.Main = \"main\", e.Aside = \"aside\", e.Body = \"body\", e))(D || {});\nclass V {\n constructor(o, t) {\n k(this, \"type\", B.View);\n k(this, \"execute\");\n this.container = t, this.execute = o;\n }\n}\nfunction Oe() {\n const e = T(), o = /* @__PURE__ */ new Map(), t = async (i) => {\n const s = o.get(i);\n if (L(\"unmounting view - view: %O\", s), !s)\n throw new w(h.NoView, { id: i, app: e });\n s.unmount && await s.unmount(), s.element.replaceChildren(), s.element.removeAttribute(\"app\"), s.element.removeAttribute(\"view-id\"), o.delete(i), s.element.remove();\n };\n return {\n unmount: t,\n mount: async (i, s, u, p) => {\n if (L(\"mounting view - operation: %O, capability: %o, args: %O\", i, u, p), i.container === \"main\") {\n const c = me(e, u, p), y = location.href.replace(location.origin, \"\");\n c !== y && (L(\"syncing url - data: %O, url: %o\", p, c), history.pushState(p, \"\", c));\n }\n if (i.container === \"aside\" || i.container === \"main\") {\n const [c] = Array.from(document.getElementsByTagName(i.container)), y = c == null ? void 0 : c.getAttribute(\"app\"), C = c == null ? void 0 : c.getAttribute(\"view-id\");\n if (y && C) {\n const f = await q(y);\n await (f == null ? void 0 : f.views.unmount(C));\n }\n }\n let l;\n const d = Ee();\n i.container === \"aside\" ? (l = document.createElement(\n \"aside\"\n /* Aside */\n ), d.prepend(l)) : i.container === \"body\" ? (l = document.createElement(\"div\"), d.append(l)) : (l = document.createElement(\n \"main\"\n /* Main */\n ), d.append(l));\n const n = z(8);\n l.setAttribute(\"app\", e), l.setAttribute(\"view-id\", n);\n const a = {\n element: l,\n unmount: await i.execute(l, (c) => {\n s(c), t(n);\n })\n };\n o.set(n, a);\n }\n };\n}\nfunction Ze(e) {\n return new V(e, D.Main);\n}\nfunction Je(e) {\n return new V(e, D.Body);\n}\nfunction $e(e) {\n return new V(e, D.Aside);\n}\nfunction Xe(e) {\n return new Fe(e);\n}\nfunction Pe() {\n return structuredClone(g(I.RuntimeManifests));\n}\nfunction Qe() {\n try {\n return ALLIANCE_APP_MANIFEST;\n } catch {\n }\n}\nconst v = M(\"system\");\nfunction xe(e) {\n const o = e.split(\";\")[0];\n return decodeURIComponent(o.split(\"=\")[0].trim());\n}\nconst Re = \"alliance-cookie-consent\";\nfunction Le() {\n let e = [\"necessary\"];\n const o = W.get(Re);\n if (o) {\n const t = o.split(\",\"), r = /* @__PURE__ */ new Set([...e, ...t]);\n e = Array.from(r);\n }\n return e;\n}\nfunction je() {\n return Pe().reduce((o, t) => {\n if (!t.storage)\n return o;\n for (const [r, i] of Object.entries(t.storage))\n o[r] = i;\n return o;\n }, {});\n}\nfunction et() {\n const e = je();\n function o(t, r, i) {\n const s = e[t];\n if (!s)\n throw new w(r, {\n key: t\n });\n if (!Le().includes(s.category))\n throw new w(i, {\n key: t,\n category: s.category\n });\n return !0;\n }\n try {\n const t = Object.getOwnPropertyDescriptor(Document.prototype, \"cookie\") || Object.getOwnPropertyDescriptor(HTMLDocument.prototype, \"cookie\");\n t && t.configurable && (v(\"registering override for document.cookie setter\"), Object.defineProperty(document, \"cookie\", {\n get: function() {\n var r;\n return (r = t == null ? void 0 : t.get) == null ? void 0 : r.call(document);\n },\n set: function(r) {\n var i;\n if (r) {\n const s = xe(r);\n try {\n o(\n s,\n h.CookieKeyNotDefined,\n h.CookieCategoryNotAllowed\n );\n } catch (u) {\n console.error(u);\n return;\n }\n }\n return (i = t == null ? void 0 : t.set) == null ? void 0 : i.call(document, r);\n }\n }));\n } catch (t) {\n v(\"error occurred when attempting to override document.cookie setter - error: %O\", t);\n }\n try {\n const t = window.CookieStore.prototype.set;\n t && (v(\"registering override for cookieStore.set function\"), window.CookieStore.prototype.set = async function(r) {\n const i = typeof r == \"object\" ? r.name : r;\n try {\n o(\n i,\n h.CookieKeyNotDefined,\n h.CookieCategoryNotAllowed\n );\n } catch (s) {\n console.error(s);\n return;\n }\n return t.apply(this, arguments);\n });\n } catch (t) {\n v(\"error occurred when attempting to cookieStore.set - error: %O\", t);\n }\n try {\n const t = window.Storage.prototype.setItem;\n v(\"registering override for sessionStorage.setItem and localStorage.setItem\"), window.Storage.prototype.setItem = function(r, i) {\n try {\n o(\n r,\n h.StorageKeyNotDefined,\n h.StorageCategoryNotAllowed\n );\n } catch (s) {\n console.error(s);\n return;\n }\n return t.apply(this, arguments);\n };\n } catch (t) {\n v(\n \"error occurred when attempting to sessionStorage.setItem and localStorage.setItem - error: %O\",\n t\n );\n }\n}\nconst Ue = `\n<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n <title>ACE Alliance - Cookie Policy</title>\n <link\n rel=\"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BXlK5gJGJWr11GDb3fkW7dPJfaUi3539iARxSUCz4AsERMVpHwDxMTyhq0HftGRbz071bhXfeooXVJvBR4EbgSGgR6Bt9qvArjc/gfZzPoCTDB+AgAAAABJRU5ErkJggg==\"\n />\n <style>\n @charset \"UTF-8\";\n @import 'https://cdn.voca.teliacompany.com/fonts/TeliaSansV10/TeliaSans.css';\n @import 'https://fonts.googleapis.com/css?family=Reenie+Beanie';\n\n body {\n font-family: TeliaSans, Helvetica, Arial, Lucida Grande, sans-serif;\n }\n\n body > div {\n max-width: 1000px;\n margin: 0 auto;\n padding: 0 40px 40px;\n }\n </style>\n </head>\n\n <body>\n <div>\n <h1>Cookie Policy</h1>\n <p>\n On our websites, we use cookies and other similar technologies. You can choose\n whether you want to allow our websites to store cookies on your computer or not. You\n can change your choices at any time.\n </p>\n\n <h2>Your consent is required</h2>\n <p>\n You choose whether you want to accept cookies on your device or not. Your consent is\n required for the use of cookies, but not for such cookies that are necessary to\n enable the service that you as a user have requested. If you do not accept our use\n of cookies, or if you have previously approved our use and have changed your mind,\n you can return to your cookie settings at any time and change your choices. You do\n this by clicking on the cookie button/link. You may also need to change the settings\n in your browser and manually delete cookies to clear your device of previously\n stored cookies.\n </p>\n\n <h2>What are cookies?</h2>\n <p>\n A cookie is a small text file that is stored on your computer by the web browser\n while browsing a website. When we refer to cookies (“cookies”) in this policy, other\n similar technologies and tools that retrieve and store information in your browser,\n and in some cases forward such information to third parties, in a manner similar to\n cookies. Examples are pixels, local storage, session storage and fingerprinting.\n </p>\n <p>\n The websites will “remember” and “recognize” you. This can be done by placing\n cookies in three different ways;\n </p>\n <ul>\n <li>The session ends, ie until you close the window in your browser.</li>\n <li>\n Time-limited, ie the cookie has a predetermined lifespan. The time may vary\n between different cookies.\n </li>\n <li>\n Until further notice, ie the information remains until you choose to delete it\n yourself. This applies to local storage.\n </li>\n </ul>\n <p>You can always go into your browser and delete already stored cookies yourself.</p>\n\n <h3>Third Party Cookies</h3>\n <p>\n We use third-party cookies on our websites. Third-party cookies are stored by\n someone other than the person responsible for the website, in this case by a company\n other than Telia.\n </p>\n <p>\n Telia uses external platforms to communicate digitally, these include the Google\n Marketing Platform and others. The platforms use both first- and third-party cookies\n as well as similar techniques to advertise and follow up the results of the\n advertising.\n </p>\n <p>\n A third-party cookie can be used by several websites to understand and track how you\n browse between different websites. Telia receives information from these cookies,\n but the information can also be used for other purposes determined by third parties.\n Third-party cookies found on our website are covered by each third-party privacy\n policy. Feel free to read these to understand what other purposes the information\n can be used for. Links are in our Cookie Table.\n </p>\n <p>\n For information about which third-party cookies are used on our websites, see our\n Cookie Table. For more information on how Telia handles personal data in connection\n with transfers to third parties, read our Privacy Policy.\n </p>\n\n <h2>Cookies on our websites</h2>\n <p>\n In order for you to have better control over which cookies are used on the websites,\n and thus be able to more easily decide how cookies should be used when you visit our\n websites, we have identified four different categories of cookies. These categories\n are defined based on the purposes for the use of the cookies.\n </p>\n <p>\n In our Cookie Table, you can also see which category each cookie belongs to, for\n what purposes it is used and for how long it is active.\n </p>\n <p>\n We have identified the following four categories of cookies. All categories contain\n cookies which means that data is shared with third parties.\n </p>\n\n <h3>Necessary</h3>\n <p>\n These cookies are needed for our app to work in a secure and correct way. Necessary\n cookies enable you to use our app and us to provide the service you request.\n Necessary cookies make basic functions of the app possible, for example, identifying\n you when you log into My Telia, detecting repeated failed login attempts,\n identifying where you are in the buying process and remembering the items put into\n your shopping basket.\n </p>\n\n <h3>Functionality</h3>\n <p>\n These cookies let us to enable some useful functionalities to make the user\n experience better, for example, to remember your login details and settings.\n </p>\n\n <h3>Analytics</h3>\n <p>\n These cookies give us information about how you use our app and allow us to improve\n the user experience.\n </p>\n\n <h3>Marketing</h3>\n <p>\n These cookies help us and our partners to display personalized and relevant ads\n based on your browsing behavior on our website and in our app, even when you later\n visit other (third parties’) websites. These cookies are used to evaluate the\n effectiveness of our marketingcampaigns, as well as for targeted marketing and\n profiling, regardless of which device(s) you have used. Information collected for\n this purpose may also be combined with other customer and traffic data we have about\n you, if you have given your consent that we may use your traffic data for marketing\n purpose and have not objected to the use of your customer data for marketing\n purposes.\n </p>\n\n <h2>Manage settings</h2>\n <p>\n We save your cookie consent for 12 months. Then we will ask you again. Please note\n that some cookies have a lifespan that exceeds these 12 months. You may therefore\n need to change the settings in your browser and manually delete all cookies.\n </p>\n <p>\n More information on how to turn off cookies can be found in the instructions for\n your browser.\n </p>\n <ul>\n <li>\n <a\n href=\"https://support.google.com/accounts/answer/61416?co=GENIE.Platform%3DDesktop&amp;hl=en\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >Google Chrome</a\n >\n </li>\n <li>\n <a\n href=\"https://privacy.microsoft.com/en-us/windows-10-microsoft-edge-and-privacy\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >Microsoft Edge</a\n >\n </li>\n <li>\n <a\n href=\"https://support.mozilla.org/en-US/kb/enable-and-disable-cookies-website-preferences\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >Mozilla Firefox</a\n >\n </li>\n <li>\n <a\n href=\"https://support.microsoft.com/en-gb/help/17442/windows-internet-explorer-delete-manage-cookies\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >Microsoft Internet Explorer</a\n >\n </li>\n <li>\n <a\n href=\"https://www.opera.com/help/tutorials/security/privacy/\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >Opera</a\n >\n </li>\n <li>\n <a\n href=\"https://support.apple.com/guide/safari/manage-cookies-and-website-data-sfri11471/mac\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >Apple Safari</a\n >\n </li>\n </ul>\n\n <h3>Do Not Track-signals</h3>\n <p>\n If you have chosen to turn on the Do Not Track function in your browser, we will not\n automatically place cookies for marketing on your device. You make other choices in\n your cookie settings.\n </p>\n\n <h3>If you block cookies</h3>\n <p>\n If you choose not to accept our use of cookies, the functionality and performance of\n our websites may deteriorate as certain functions are dependent on cookies. A\n blocking of cookies can therefore mean that the websites’ services do not work as\n they should.\n </p>\n\n <h3>Your security with us</h3>\n <p>\n If you want to read more about your rights and how we protect your privacy, go to\n our privacy policy for\n <a\n href=\"https://www.telia.se/dam/jcr:df2eeb83-50ce-4383-89fc-0613f7615796/Integritetspolicy-privatkunder.pdf\"\n >private customers</a\n >\n (C2B) or\n <a\n href=\"https://www.telia.se/dam/jcr:95b2b4a5-82ca-436b-90e0-873e0a864118/Telia-integritetspolicy-foretag.pdf\"\n >corporate customers</a\n >\n (B2B). You are always welcome to contact us at\n <a href=\"mailto:dpo-se@teliacompany.com\">dpo-se@teliacompany.com</a> if you have any\n questions.\n </p>\n <p>Our cookie policy may change in the future.</p>\n <p>\n More information about cookies can be found at the Swedish Post and Telecom\n Authority (PTS).\n </p>\n\n <h2>Our Cookie Table</h2>\n <p>\n Below, you will find a list of the cookies and similar technologies that we use on\n this website. These cookies are stored on your device by us.\n </p>\n <table>\n <thead>\n <tr>\n <th>Cookie</th>\n <th>Category</th>\n <th>Purpose</th>\n <th>Lifespan</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>alliance-session-v1</td>\n <td>necessary</td>\n <td>Contains the authenticated user.</td>\n <td>1 day</td>\n </tr>\n {APP_COOKIES}\n </tbody>\n </table>\n <style>\n table {\n width: 100%;\n border: 1px solid rgba(0, 0, 0, 0.15);\n }\n th, td {\n text-align: left;\n padding: 3px;\n }\n </style>\n </div>\n </body>\n</html>\n`;\nfunction tt(e) {\n const o = [];\n for (const t of e)\n if (t.storage)\n for (const [r, i] of Object.entries(t.storage)) {\n const s = Be(r, i);\n o.push(s);\n }\n return Ue.replace(\"{APP_COOKIES}\", o.join(\"\"));\n}\nfunction Be(e, o) {\n const t = [\"<tr>\"], { category: r, purpose: i, lifespan: s } = o;\n return t.push(`<td>${e}</td>`), t.push(`<td>${r}</td>`), t.push(`<td>${i}</td>`), t.push(`<td>${s}</td>`), t.push(\"</tr>\"), t.join(\"\");\n}\nconst O = M(\"capabilities\");\nasync function oe(e, o, t) {\n const r = await q(e);\n if (!r)\n throw new w(h.MissingAppController, { app: e });\n const s = (t === \"app\" ? r.capabilities.app : r.capabilities.system).get(o);\n if (!s)\n throw new w(h.MissingCapabilityOnApp, {\n capability: o,\n app: e\n });\n return { controller: r, handler: s };\n}\nfunction ze(e) {\n return (o, t, r) => (e(\"requesting capability - app: %o, capability: %o, args: %O\", o, t, r), {\n id: z(8),\n result: new Promise(async (i) => {\n const { controller: s, handler: u } = await oe(\n o,\n t,\n \"app\"\n ), p = await u(r);\n Z(p) ? await p.execute(i) : te(p) && await s.views.mount(p, i, t, r), e(\n \"resolved capability - app: %o, capability: %o, args: %O\",\n o,\n t,\n r\n );\n })\n });\n}\nfunction ot(e, o) {\n if (E())\n throw new w(h.AlreadyInitialized);\n const t = ee();\n O(\"enabling capability - capability: %o, handler: %O\", e, o), t.capabilities.app.set(e, o);\n}\nfunction rt(e, o) {\n if (E())\n throw new w(h.AlreadyInitialized);\n const t = ee();\n O(\"enabling system capability - capability: %o, handler: %O\", e, o), t.capabilities.system.set(e, o);\n}\nfunction qe(e) {\n return (o, t, r) => {\n e(\n \"requesting system capability - capability: %o, args: %O, targetApp: %o\",\n o,\n t,\n r\n );\n const i = [], s = g(I.RuntimeApps);\n for (const u of s) {\n if (r && u !== r)\n continue;\n const p = new Promise(async (l) => {\n const { controller: d, handler: n } = await oe(\n u,\n o,\n \"system\"\n ), a = await n(t);\n Z(a) ? await a.execute(l) : te(a) && await d.views.mount(a, l, o, t), e(\n \"resolved system capability - capability: %o, args: %O, targetApp: %o\",\n o,\n t,\n r\n );\n });\n i.push({\n id: z(8),\n result: p\n });\n }\n return i;\n };\n}\nconst nt = qe(O), it = ze(O);\nexport {\n Re as A,\n w as I,\n h as N,\n Ge as P,\n I as S,\n _e as W,\n He as a,\n Qe as b,\n M as c,\n Se as d,\n tt as e,\n ot as f,\n ee as g,\n rt as h,\n E as i,\n nt as j,\n $e as k,\n Je as l,\n Xe as m,\n Ze as n,\n Pe as o,\n Ye as p,\n qe as q,\n it as r,\n q as s,\n et as t,\n ze as u,\n g as v,\n $ as w\n};\n//# sourceMappingURL=capabilities-01b818cf.js.map\n","import { c as C, i as b, I as p, N as g, g as P, a as S, b as A, d as N } from \"./chunks/capabilities-01b818cf.js\";\nimport { A as _, k as V, l as z, m as K, n as Q, f as W, h as B, e as J, o as F, r as M, j as X } from \"./chunks/capabilities-01b818cf.js\";\nfunction $(e) {\n return e;\n}\nconst c = C(\"managed-objects\");\nfunction I(e, n) {\n return c(\"querying objects - object: %o, args: %O\", e, n), {\n async resolve() {\n return c(\"resolving query - object: %o, args: %O\", e, n), await (await m(e)).managedObjects.providers.get(e)(n);\n },\n async watch(r) {\n c(\"adding watcher - object: %o, args: %O\", e, n), (await m(e)).managedObjects.watchers.get(e).push(r);\n }\n };\n}\nfunction U(e, n) {\n if (b())\n throw new p(g.AlreadyInitialized);\n c(\"registering provider - object: %o, handler: %O\", e, n);\n const r = P();\n return r.managedObjects.providers.set(e, n), r.managedObjects.watchers.set(e, []), function() {\n c(\"triggering watchers - object: %o, handler: %O\", e, n);\n const t = r.managedObjects.watchers.get(e) || [];\n for (const a of t)\n a();\n };\n}\nasync function m(e) {\n const r = (await S()).find(\n (t) => t.managedObjects.providers.has(e) && t.managedObjects.watchers.has(e)\n );\n if (!r)\n throw new p(g.MissingManagedObjectProvider, { object: e });\n return r;\n}\nconst y = C(\"proxy\");\nvar v = /* @__PURE__ */ ((e) => (e.Get = \"GET\", e.Head = \"HEAD\", e.Post = \"POST\", e.Put = \"PUT\", e.Delete = \"DELETE\", e.Connect = \"CONNECT\", e.Options = \"OPTIONS\", e.Trace = \"TRACE\", e.Patch = \"PATCH\", e))(v || {});\nfunction E(e, n, r = []) {\n const t = new URL(e, location.origin);\n if (r.find((o) => q(o, e))) {\n const s = \"/-/gateway\" + (t.pathname !== \"/\" ? t.pathname : \"/\") + (n ? t.search : \"\");\n return new URL(s, location.origin);\n }\n return t;\n}\nfunction R(e = {}) {\n if (Object.keys(e).length === 0)\n return \"\";\n const n = Object.entries(e).reduce(\n (t, [a, o]) => (typeof o > \"u\" || o === null || (t[a] = o.toString()), t),\n {}\n );\n return `?${new URLSearchParams(n).toString()}`;\n}\nfunction j(e) {\n return e.replaceAll(/[-\\/\\\\^$*+?.()|[\\]{}]/g, \"\\\\$&\");\n}\nfunction q(e, n) {\n const r = j(e);\n return new RegExp(`^${r.replaceAll(\"\\\\?\", \".?\").replaceAll(\"\\\\*\", \".*\")}`, \"i\").test(n);\n}\nfunction x(e, n) {\n const r = A();\n if (!r)\n throw new p(g.NoManifest);\n const { name: t, endpoints: a = [] } = r;\n y(\"creating request - input: %o, options: %O\", e, { lots: 1, of: { properties: 123 } });\n const o = E(e.toString(), !0, a), s = new Request(o, n), { environment: l } = N();\n if (l === \"production\") {\n const u = location.pathname.split(\"/\").filter((f) => !!f);\n s.headers.set(\"Alliance-Target-Workspace\", u[0]);\n }\n return s.headers.set(\"Alliance-Target-Url\", e.toString()), s.headers.set(\"Alliance-Target-App\", t), y(\"created request - request: %O\", s), s;\n}\nfunction k() {\n const e = A();\n if (!e)\n throw new p(g.NoManifest);\n const { name: n, endpoints: r = [] } = e;\n async function t(a, o, s = {}) {\n const { body: l, query: u, headers: f } = s, T = E(a, !1, r), d = R(u), O = {\n \"Alliance-Target-Url\": `${a}${d}`,\n // FUTURE TODO: Is there a better name for this?\n \"Alliance-Target-App\": n\n }, w = location.pathname.split(\"/\").filter((i) => !!i);\n w.length > 1 && (O[\n \"Alliance-Target-Workspace\"\n /* TargetWorkspace */\n ] = w[0]);\n const h = {\n method: o,\n headers: {\n \"Content-Type\": \"application/json\",\n ...f,\n ...O\n }\n };\n return l && (h.body = JSON.stringify(l)), fetch(`${T}${d}`, h).then((i) => i.json()).catch((i) => {\n throw i;\n });\n }\n return {\n post: (a, o) => t(a, \"POST\", o),\n put: (a, o) => t(a, \"PUT\", o),\n delete: (a, o) => t(a, \"DELETE\", o),\n get: (a, o) => t(a, \"GET\", o),\n create: x\n };\n}\nexport {\n _ as ALLIANCE_COOKIE_CONSENT_COOKIE_NAME,\n v as HttpMethods,\n V as createAsideViewOperation,\n z as createBodyViewOperation,\n K as createOperation,\n k as createProxy,\n x as createRequest,\n Q as createViewOperation,\n $ as defineConfig,\n W as enableCapability,\n B as enableSystemCapability,\n J as generateCookiePolicyHtml,\n A as getAppManifest,\n F as getAppManifests,\n U as provideObjects,\n I as queryObjects,\n M as runCapability,\n X as runSystemCapability\n};\n//# sourceMappingURL=index.js.map\n","var g = Object.defineProperty;\nvar v = (e, t, r) => t in e ? g(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;\nvar a = (e, t, r) => (v(e, typeof t != \"symbol\" ? t + \"\" : t, r), r);\nvar N = /* @__PURE__ */ ((e) => (e[e.AlreadyInitialized = 1e3] = \"AlreadyInitialized\", e[e.NoAppNameOrKey = 1001] = \"NoAppNameOrKey\", e[e.MissingAppController = 1002] = \"MissingAppController\", e[e.MissingCapabilityOnApp = 1003] = \"MissingCapabilityOnApp\", e[e.MissingManagedObjectProvider = 1004] = \"MissingManagedObjectProvider\", e[e.NoManifest = 1005] = \"NoManifest\", e[e.NoRootElement = 1006] = \"NoRootElement\", e[e.NoView = 1007] = \"NoView\", e[e.CookieKeyNotDefined = 1008] = \"CookieKeyNotDefined\", e[e.CookieCategoryNotAllowed = 1009] = \"CookieCategoryNotAllowed\", e[e.StorageKeyNotDefined = 1010] = \"StorageKeyNotDefined\", e[e.StorageCategoryNotAllowed = 1011] = \"StorageCategoryNotAllowed\", e[e.LocalizationTemplateNotDefined = 1012] = \"LocalizationTemplateNotDefined\", e))(N || {}), A = /* @__PURE__ */ ((e) => (e[e.CurrentUserMissingProvider = 2e3] = \"CurrentUserMissingProvider\", e[e.CurrentUserGatewayNotStarted = 2001] = \"CurrentUserGatewayNotStarted\", e[e.CurrentUserMissingBackend = 2002] = \"CurrentUserMissingBackend\", e[e.CurrentUserMissingInDatabase = 2003] = \"CurrentUserMissingInDatabase\", e))(A || {});\nfunction m(e, t) {\n return Object.entries(t).reduce((r, [i, n]) => r.replaceAll(`{{${i}}}`, n), e);\n}\nconst S = {\n // framework\n 1e3: \"The runtime has already been initialized\",\n 1001: \"App name and/or app key is not defined on global scope\",\n 1002: \"No app controller registered for app '{{app}}'\",\n 1003: \"No capability '{{capability}}' enabled for app '{{app}}'\",\n 1004: \"No managed object provider registered for object '{{object}}'\",\n 1005: \"The current apps manifest is not defined on global scope\",\n 1006: \"Could not find the root element in the DOM\",\n 1007: \"Could not find view with id '{{id}}' on view controller for app '{{app}}'\",\n 1008: \"Cookie key '{{key}}' not present in manifest, cookie has not been set\",\n 1009: \"Cookies categorized as '{{category}}' are not allowed by the user, cookie '{{key}}' has not been set\",\n 1010: \"Storage key '{{key}}' not present in manifest, item has not been stored\",\n 1011: \"Storage categorized as '{{category}}' is not allowed by the user, item '{{key}}' has not been stored\",\n 1012: \"The translation template, referred by the key '{{key}}' is being used in app, but is not defined in the manifest.\",\n // utilities\n 2e3: \"No managed object provider registered for object 'currentUser'\",\n 2001: \"Could not access the gateway when querying 'currentUser'\",\n 2002: \"Could not access the required backend when querying 'currentUser'\",\n 2003: \"Could not locate the authenticated user in the Alliance database\"\n}, d = \"AllianceError\";\nclass I extends Error {\n constructor(t, r = {}) {\n const i = m(S[t], r), n = `https://github.com/telia-company/ace-alliance-sdk/wiki/error-codes#${t}`;\n super(i), this.code = t, this.name = d, this.stack = `[${t}] - ${i}\n` + n;\n }\n}\nfunction k(e) {\n return !!e.code && e.name === d;\n}\nfunction b(e) {\n const r = Object.entries(e).reduce((i, n) => {\n const [o, p] = n;\n return typeof p > \"u\" || (typeof p == \"object\" && p !== null ? i[o] = JSON.stringify(p) : i[o] = p), i;\n }, {});\n return Object.keys(r).length ? `?${new URLSearchParams(r)}` : \"\";\n}\nfunction D() {\n const e = l(), { href: t, search: r } = window.location;\n return t.replace(e, \"\").replace(r, \"\");\n}\nfunction C(e = \"\", t = \"\", r = {}) {\n const i = l().replace(location.origin, \"\"), n = b(r);\n return e ? t ? `${i}/${e}/${t}${n}` : `${i}/${e}${n}` : `${i}${n}`;\n}\nfunction W() {\n const e = D(), [t = \"\", r = \"\"] = e.split(\"/\").filter((i) => !!i);\n return {\n app: t,\n capability: r\n };\n}\nfunction P(e) {\n const { origin: t, pathname: r } = window.location;\n if (e === \"production\") {\n const [i] = r.split(\"/\").filter((n) => !!n);\n return globalThis.__ALLIANCE_RUNTIME_ROOT_URL = `${t}/${i}`;\n }\n return globalThis.__ALLIANCE_RUNTIME_ROOT_URL = t;\n}\nfunction l() {\n return globalThis.__ALLIANCE_RUNTIME_ROOT_URL;\n}\nvar s = /* @__PURE__ */ ((e) => (e[e.AlreadyExists = 0] = \"AlreadyExists\", e[e.ApiGatewayPortDescription = 1] = \"ApiGatewayPortDescription\", e[e.ApiServerModeDescription = 2] = \"ApiServerModeDescription\", e[e.AppConfigurationPath = 3] = \"AppConfigurationPath\", e[e.AppCreated = 4] = \"AppCreated\", e[e.AppEntryBuildOptionDescription = 5] = \"AppEntryBuildOptionDescription\", e[e.AppNameInquiry = 6] = \"AppNameInquiry\", e[e.BuildDescription = 7] = \"BuildDescription\", e[e.BuildModeOptionDescription = 8] = \"BuildModeOptionDescription\", e[e.BuildWatchDescription = 9] = \"BuildWatchDescription\", e[e.CreateAppDescription = 10] = \"CreateAppDescription\", e[e.CreateWorkspaceDescription = 11] = \"CreateWorkspaceDescription\", e[e.DevServerOpenDescription = 12] = \"DevServerOpenDescription\", e[e.DevServerPortDescription = 13] = \"DevServerPortDescription\", e[e.DevServerLoggingDescription = 14] = \"DevServerLoggingDescription\", e[e.Done = 15] = \"Done\", e[e.FetchPackageVersionError = 16] = \"FetchPackageVersionError\", e[e.ManifestEntryBuildOptionDescription = 17] = \"ManifestEntryBuildOptionDescription\", e[e.MissingTranslationKey = 18] = \"MissingTranslationKey\", e[e.NoAppName = 19] = \"NoAppName\", e[e.NoAppNameFound = 20] = \"NoAppNameFound\", e[e.NoAppOrWorkspaceInCurrentDirectory = 21] = \"NoAppOrWorkspaceInCurrentDirectory\", e[e.NoWorkspaceName = 22] = \"NoWorkspaceName\", e[e.OperationCancelled = 23] = \"OperationCancelled\", e[e.ServeDescription = 24] = \"ServeDescription\", e[e.ServedStopped = 25] = \"ServedStopped\", e[e.ServerGatewayMode = 26] = \"ServerGatewayMode\", e[e.ServerMode = 27] = \"ServerMode\", e[e.ServerModeInquiry = 28] = \"ServerModeInquiry\", e[e.ServerProxyMode = 29] = \"ServerProxyMode\", e[e.StopServerInstructions = 30] = \"StopServerInstructions\", e[e.TemplateFrameworkInquiry = 31] = \"TemplateFrameworkInquiry\", e[e.TemplateLanguageInquiry = 32] = \"TemplateLanguageInquiry\", e[e.UnrecognizedCommand = 33] = \"UnrecognizedCommand\", e[e.WorkspaceCreated = 34] = \"WorkspaceCreated\", e[e.WorkspaceNameInquiry = 35] = \"WorkspaceNameInquiry\", e))(s || {});\nconst M = {\n 15: \"Done\",\n 22: \"No workspace name provided!\",\n 19: \"No app name provided!\",\n 0: \"File or directory '{0}' already exists!\",\n 21: \"Could not find any app entry file at '{0}'!\",\n 33: \"Unrecognized command(s) {0}!\",\n 34: \"Workspace was created at path '{0}'!\",\n 4: \"App was created at path '{0}'!\",\n 25: \"Server stopped.\",\n 11: \"Creates an Alliance Workspace in the current directory.\",\n 10: \"Creates an Alliance Application in the current directory or Alliance Workspace.\",\n 24: \"Starts a Alliance development server using the current directory package.json.\",\n 7: \"Builds an Alliance Application using Vite.\",\n 35: \"Enter the name of your workspace\",\n 28: \"Which server mode do you want to use?\",\n 6: \"Enter the name of your app\",\n 18: \"No translation key provided!\",\n 23: \"Operation cancelled.\",\n 30: `Press CTRL + C to stop the server.\n`,\n 32: \"Select preferred language\",\n 31: \"Select preferred framework template\",\n 13: \"The port that the dev server should use.\",\n 14: \"Whether the dev server and browser console should output more log information or not (false).\",\n 1: \"The port that the api gateway should use.\",\n 2: \"Which components to start. [server|server-proxy|server-gateway].\",\n 12: \"Whether the dev server should automatically open in your browser or not.\",\n 9: \"Whether the build should start watching and rebuild when files change or not.\",\n 5: \"The entry file for the app (./src/app).\",\n 17: \"The entry file for the app manifest (./src/manifest).\",\n 8: \"Which mode to use when building the app.\",\n 16: \"Failed to fetch package info from the NPM registry for package '${0}'!\",\n 20: \"Could not find app name in manifest.\",\n 3: \"The path to the app configuration file.\",\n 27: \"Server\",\n 29: \"Server with proxy\",\n 26: \"Server with gateway\"\n}, c = class c {\n};\na(c, \"getTranslations\", () => M), a(c, \"getTranslation\", (t, ...r) => {\n const n = c.getTranslations()[t];\n if (!n)\n throw new Error(`Could not find text with given key '${t}'.`);\n return r.reduce(\n (p, h, f) => p.toString().replace(`{${f}}`, h.toString()),\n n\n ).toString();\n}), a(c, \"get\", (t = s.MissingTranslationKey, ...r) => c.getTranslation(t, ...r));\nlet u = c;\nfunction R(e, t) {\n return O(Object.values(e), ({ name: r }) => ({\n label: r,\n value: r,\n selected: t === r\n }));\n}\nvar y = /* @__PURE__ */ ((e) => (e.Primary = \"primary\", e.Secondary = \"secondary\", e.Expressive = \"expressive\", e.Destructive = \"destructive\", e.Text = \"text\", e.PrimaryWhite = \"primary-white\", e.SecondaryWhite = \"secondary-white\", e.ExpressiveWhite = \"expressive-white\", e.TertiaryPurple = \"tertiary-purple\", e))(y || {});\nfunction $(e, t) {\n return Object.values(e).find((i) => i.name === t);\n}\nfunction O(e, t, r = \"Choose...\") {\n return e.reduce(\n (i, n) => (i.push({\n disabled: !1,\n selected: !1,\n ...t(n)\n }), i),\n [\n {\n label: r,\n value: \"\",\n disabled: !0,\n selected: !0\n }\n ]\n );\n}\nfunction L(e) {\n return (t) => {\n t.key === \"Enter\" && e(t);\n };\n}\nfunction U(e, t = \"all\") {\n const { email: r, displayName: i } = e, n = i && i !== \"unknown\", o = !!r;\n switch (t) {\n case \"all\": {\n if (n && o)\n return `${i} (${r})`;\n if (n)\n return i;\n if (o)\n return r;\n }\n case \"single\": {\n if (n)\n return i;\n if (o)\n return r;\n }\n }\n return \"<UNKNOWN USER>\";\n}\nfunction j(...e) {\n return e.filter((t) => !!t).join(\" \");\n}\nfunction q(e) {\n return Object.entries(e).reduce(\n (t, [r, i]) => (typeof i != \"object\" && typeof i != \"function\" && (t[r] = i), t),\n {}\n );\n}\nexport {\n I as AllianceError,\n N as FrameworkErrorCodes,\n u as Texts,\n s as TranslationsKey,\n A as UtilitiesErrorCodes,\n y as VocaButtonVariant,\n j as classNames,\n C as createCapabilityPath,\n U as friendlyUserName,\n W as getCurrentLocationInfo,\n l as getRuntimeRootUrl,\n $ as getVocaIcon,\n k as isAllianceError,\n O as mapToVocaOptions,\n L as onEnter,\n q as props,\n P as setRuntimeRootUrl,\n R as vocaIconsToOptions\n};\n//# sourceMappingURL=index.js.map\n","import { queryObjects } from '@telia-ace/alliance-framework';\nimport {\n AllianceError,\n FrameworkErrorCodes,\n UtilitiesErrorCodes,\n isAllianceError,\n} from '@telia-ace/alliance-internal-client-utilities';\n\ntype CurrentUser = {\n displayName: string;\n email: string;\n type: 'system-admin' | 'user';\n objectId: string;\n permissions: { permission: { name: string; app: { name: string } } }[];\n hasPermission: (appName: string, permissionName: string) => boolean;\n isSystemAdmin: () => boolean;\n};\n\nlet currentUser: CurrentUser;\n\nexport async function getCurrentUser(): Promise<CurrentUser> {\n try {\n if (!currentUser) {\n const query = queryObjects<CurrentUser>('currentUser');\n currentUser = await query.resolve();\n }\n\n return {\n ...currentUser,\n hasPermission(appName, permissionName) {\n return !!currentUser?.permissions.find(\n ({ permission }) =>\n permission.app.name === appName && permission.name === permissionName\n );\n },\n isSystemAdmin() {\n return !!currentUser && currentUser.type === 'system-admin';\n },\n };\n } catch (err: any) {\n if (isAllianceError(err) && err.code === FrameworkErrorCodes.MissingManagedObjectProvider) {\n throw new AllianceError(UtilitiesErrorCodes.CurrentUserMissingProvider);\n } else if (err.message.includes('GraphQL Error (Code: 404)')) {\n throw new AllianceError(UtilitiesErrorCodes.CurrentUserGatewayNotStarted);\n } else if (err.message.includes('GraphQL Error (Code: 500)')) {\n throw new AllianceError(UtilitiesErrorCodes.CurrentUserMissingBackend);\n } else if (\n err.message.includes('GraphQL Error (Code: 200)') &&\n err.message.includes('Cannot return null for non-nullable field')\n ) {\n throw new AllianceError(UtilitiesErrorCodes.CurrentUserMissingInDatabase);\n } else {\n throw err;\n }\n }\n}\n","import {\n getAppManifest,\n getAppManifests,\n queryObjects,\n type AppManifest,\n} from '@telia-ace/alliance-framework';\nimport { AllianceError, FrameworkErrorCodes } from '@telia-ace/alliance-internal-client-utilities';\n\ntype RecordEntries = Record<string, string>;\nexport type TranslatorFunction = (key: string, params?: RecordEntries) => string;\n\nexport function getDefaultLocalization(manifest?: AppManifest): RecordEntries {\n if (!manifest || !manifest.resources?.localization) {\n return {};\n }\n\n const localizationKeys = Object.keys(manifest.resources.localization);\n const defaults = localizationKeys.reduce((obj: RecordEntries, item: string) => {\n obj[item] = manifest.resources!.localization![item].value;\n\n return obj;\n }, {});\n\n return defaults;\n}\n\nfunction parseTemplates(message: string = '', variables: RecordEntries) {\n return Object.entries(variables).reduce((acc, [key, value]) => {\n return acc.replaceAll(`{{${key}}}`, value);\n }, message);\n}\n\nasync function getAppLocalization(): Promise<RecordEntries> {\n const manifest = getAppManifest();\n const appManifests = getAppManifests();\n\n const defaultLocalization = getDefaultLocalization(manifest);\n let localization: Record<string, string> = {};\n\n // Dont try to query objects if the resource management app is not installed\n if (appManifests?.find(({ name }) => name === 'resource-management')) {\n localization = await queryObjects('resourceTexts', { app: manifest?.name }).resolve();\n }\n\n return Object.keys(defaultLocalization).reduce<Record<string, string>>((acc, key) => {\n if (localization[key]) {\n acc[key] = localization[key];\n }\n\n return acc;\n }, defaultLocalization);\n}\n\nlet localizationStore: RecordEntries = {};\n\nexport async function getTranslator(): Promise<TranslatorFunction> {\n if (Object.keys(localizationStore).length === 0) {\n localizationStore = await getAppLocalization();\n }\n\n return (key: string, params?: RecordEntries): string => {\n const template = localizationStore[key];\n\n if (template === undefined) {\n throw new AllianceError(FrameworkErrorCodes.LocalizationTemplateNotDefined, { key });\n }\n\n if (!params || typeof params !== 'object' || Object.keys(params).length === 0) {\n return template;\n }\n\n return parseTemplates(template, params);\n };\n}\n"],"names":["S","o","t","r","ce","j","s","u","p","l","d","n","W","le","ue","x","h","pe","de","fe","w","H","ge","A","we","U","R","_","Ce","a","c","y","C","be","f","m","b","F","re","N","P","ne","K","ie","ve","ke","Ae","T","Se","J","E","g","X","Q","I","Te","G","M","Ie","q","He","Pe","Qe","v","i","k","currentUser","getCurrentUser","queryObjects","appName","permissionName","permission","err","isAllianceError","FrameworkErrorCodes","AllianceError","UtilitiesErrorCodes","getDefaultLocalization","manifest","_a","obj","item","parseTemplates","message","variables","acc","key","value","getAppLocalization","getAppManifest","appManifests","getAppManifests","defaultLocalization","localization","name","localizationStore","getTranslator","params","template"],"mappings":"AAGA;AACA,SAASA,EAAE,GAAG;AACZ,WAASC,IAAI,GAAGA,IAAI,UAAU,QAAQA,KAAK;AACzC,QAAIC,IAAI,UAAUD,CAAC;AACnB,aAASE,KAAKD;AACZ,QAAEC,CAAC,IAAID,EAAEC,CAAC;AAAA,EACb;AACD,SAAO;AACT;AACA,IAAIC,IAAK;AAAA,EACP,MAAM,SAAS,GAAG;AAChB,WAAO,EAAE,CAAC,MAAM,QAAQ,IAAI,EAAE,MAAM,GAAG,EAAE,IAAI,EAAE,QAAQ,oBAAoB,kBAAkB;AAAA,EAC9F;AAAA,EACD,OAAO,SAAS,GAAG;AACjB,WAAO,mBAAmB,CAAC,EAAE;AAAA,MAC3B;AAAA,MACA;AAAA,IACN;AAAA,EACG;AACH;AACA,SAASC,EAAE,GAAGJ,GAAG;AACf,WAASC,EAAE,GAAGI,GAAGC,GAAG;AAClB,QAAI,EAAE,OAAO,WAAW,MAAM;AAC5B,MAAAA,IAAIP,EAAE,IAAIC,GAAGM,CAAC,GAAG,OAAOA,EAAE,WAAW,aAAaA,EAAE,UAAU,IAAI,KAAK,KAAK,IAAG,IAAKA,EAAE,UAAU,KAAK,IAAIA,EAAE,YAAYA,EAAE,UAAUA,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AAmC,CAAA;AAEvC,eAAsBC,KAA6C;AAC/D,SAAI,OAAO,KAAKD,CAAiB,EAAE,WAAW,MAC1CA,IAAoB,MAAMP,OAGvB,CAACF,GAAaW,MAAmC;AAC9C,UAAAC,IAAWH,EAAkBT,CAAG;AAEtC,QAAIY,MAAa;AACb,YAAM,IAAIvB,EAAcD,EAAoB,gCAAgC,EAAE,KAAAY,EAAK,CAAA;AAGnF,WAAA,CAACW,KAAU,OAAOA,KAAW,YAAY,OAAO,KAAKA,CAAM,EAAE,WAAW,IACjEC,IAGJhB,GAAegB,GAAUD,CAAM;AAAA,EAAA;AAE9C;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telia-ace/alliance-utilities",
3
- "version": "1.0.12-next.0",
3
+ "version": "1.0.12-next.2",
4
4
  "description": "Utilities used by ACE Alliance apps.",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "author": "Telia Company AB",
@@ -14,20 +14,20 @@
14
14
  "dist"
15
15
  ],
16
16
  "dependencies": {
17
- "@telia-ace/alliance-framework": "1.0.12-next.0",
18
- "@telia-ace/alliance-internal-client-utilities": "1.0.1"
17
+ "@telia-ace/alliance-framework": "1.0.12-next.2",
18
+ "@telia-ace/alliance-internal-client-utilities": "1.0.2-next.0"
19
19
  },
20
20
  "devDependencies": {
21
- "vite": "^4.4.6"
21
+ "vite": "^4.4.6",
22
+ "vitest": "^0.33.0"
22
23
  },
23
24
  "publishConfig": {
24
25
  "access": "public"
25
26
  },
26
27
  "scripts": {
27
28
  "build:dev": "tsc && vite build --mode development",
28
- "build:prod": "rimraf dist && tsc && vite build --mode prod",
29
- "build:test": "rimraf dist && tsc && vite build --mode test",
30
- "build:docker": "vite build",
29
+ "build:prod": "rimraf dist && tsc && vite build",
30
+ "test": "vitest",
31
31
  "dev": "tsc && vite build --mode development --watch"
32
32
  }
33
33
  }