@arcgis/portal-components 5.2.0-next.62 → 5.2.0-next.63

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.
@@ -1,51 +1,52 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import { c as S } from "../../chunks/runtime.js";
3
- import { LitElement as b, createEvent as $, nothing as L } from "@arcgis/lumina";
4
- import { html as h, svg as _ } from "lit";
5
- import { s as O } from "../../chunks/portal-account-switcher.js";
6
- import { g as x, a as C, l as I, u as v } from "../../chunks/user.js";
2
+ import { c as L } from "../../chunks/runtime.js";
3
+ import { LitElement as _, createEvent as y, nothing as O } from "@arcgis/lumina";
4
+ import { html as h, svg as x } from "lit";
5
+ import { s as I } from "../../chunks/portal-account-switcher.js";
6
+ import { g as C, a as v, l as E, u as T } from "../../chunks/user.js";
7
7
  import p from "@arcgis/core/identity/IdentityManager.js";
8
- import { t as E } from "../../chunks/functionalities.js";
9
- import { u as M } from "../../chunks/useT9n.js";
10
- import { m as T } from "../../chunks/icons.js";
8
+ import { t as M } from "../../chunks/functionalities.js";
9
+ import { u as K } from "../../chunks/useT9n.js";
10
+ import { m as P } from "../../chunks/icons.js";
11
11
  import { substitute as g } from "@arcgis/core/intl.js";
12
- function A(n, t = "_blank", e = 582, s = 670) {
13
- const i = window.screenLeft ?? 0, r = window.screenTop ?? 0, o = window.innerWidth || document.documentElement.clientWidth || window.screen.width, a = window.innerHeight || document.documentElement.clientHeight || window.screen.height, c = o / 2 - e / 2 + i, l = a / 2 - s / 2 + r, d = window.open(n, t, `scrollbars=no, width=${e}, height=${s}, top=${l}, left=${c}`);
14
- return d?.focus(), d;
12
+ const w = 1260 * 1e3;
13
+ function S(i, t = "_blank", e = 582, s = 670) {
14
+ const n = window.screenLeft ?? 0, r = window.screenTop ?? 0, o = window.innerWidth || document.documentElement.clientWidth || window.screen.width, a = window.innerHeight || document.documentElement.clientHeight || window.screen.height, c = o / 2 - e / 2 + n, u = a / 2 - s / 2 + r, l = window.open(i, t, `scrollbars=no, width=${e}, height=${s}, top=${u}, left=${c}`);
15
+ return l?.focus(), l;
15
16
  }
16
- function K(n) {
17
- const e = (n || window.location.origin).split(".")[1].replace("maps", "");
17
+ function W(i) {
18
+ const e = (i || window.location.origin).split(".")[1].replace("maps", "");
18
19
  return `https://${e ? `${e}${e === "qa" ? "ext" : ""}.` : ""}arcgis.com/sharing/rest/`;
19
20
  }
20
- function P(n, t) {
21
- const e = p.findOAuthInfo(n.url), {
21
+ function N(i, t) {
22
+ const e = p.findOAuthInfo(i.url), {
22
23
  /* appId = "arcgisonline", */
23
24
  locale: s = "en",
24
- expiration: i = 3600 * 1e3
25
+ expiration: n = w
25
26
  } = e ?? {}, r = new URLSearchParams({
26
27
  locale: s,
27
28
  client_id: "arcgisonline",
28
29
  //appId!,
29
30
  response_type: "token",
30
- expiration: `${i}`,
31
+ expiration: `${n}`,
31
32
  linkUserRequest: "true",
32
33
  showSocialLogins: "true",
33
34
  hideEnterpriseLogins: "false",
34
35
  force_login: "true",
35
36
  parent: window.location.origin,
36
- redirect_uri: `https://${n.portalHostname}/home/link_account_callback.html`,
37
+ redirect_uri: `https://${i.portalHostname}/home/link_account_callback.html`,
37
38
  state: JSON.stringify({ useMessage: !0 })
38
- }), o = `${K(t)}oauth2/authorize?${r.toString()}`;
39
- A(o);
39
+ }), o = `${W(t)}oauth2/authorize?${r.toString()}`;
40
+ S(o);
40
41
  }
41
- function W(n) {
42
+ function R(i) {
42
43
  const {
43
44
  config: t,
44
45
  credential: e,
45
46
  clientId: s = "arcgisonline",
46
- redirectToClientUri: i = !1,
47
+ redirectToClientUri: n = !1,
47
48
  displaySignoutComplete: r = !1
48
- } = n, o = new URLSearchParams({
49
+ } = i, o = new URLSearchParams({
49
50
  display: "iframe",
50
51
  client_id: s,
51
52
  ...e.token && { token: e.token },
@@ -54,121 +55,121 @@ function W(n) {
54
55
  state: JSON.stringify({
55
56
  signout: !0,
56
57
  origin: window.location.origin,
57
- redirectToClientUri: i,
58
+ redirectToClientUri: n,
58
59
  displaySignoutComplete: r
59
60
  })
60
61
  }), a = `${t.restBaseUrl}oauth2/signout?${o.toString()}`, c = document.createElement("iframe");
61
62
  c.src = a, c.style.display = "none", document.body.appendChild(c);
62
63
  }
63
- function N(n, t) {
64
- const e = u(n.orgUrlKey, t), s = p.findOAuthInfo(e), {
64
+ function B(i, t) {
65
+ const e = d(i.orgUrlKey, t), s = p.findOAuthInfo(e), {
65
66
  /* appId = "arcgisonline", */
66
- locale: i = "en",
67
- expiration: r = 3600 * 1e3
68
- } = s ?? {}, o = k(n.provider), a = new URLSearchParams({
69
- locale: i,
67
+ locale: n = "en",
68
+ expiration: r = w
69
+ } = s ?? {}, o = $(i.provider), a = new URLSearchParams({
70
+ locale: n,
70
71
  client_id: "arcgisonline",
71
72
  //appId,
72
73
  response_type: "token",
73
74
  expiration: `${r}`,
74
75
  parent: window.location.origin,
75
- ...o === "social" && { socialLoginProviderName: n.provider },
76
- ...o === "default" && { prepopulatedusername: n.username },
76
+ ...o === "social" && { socialLoginProviderName: i.provider },
77
+ ...o === "default" && { prepopulatedusername: i.username },
77
78
  force_login: "true",
78
79
  redirect_uri: `${e}/home/sign_in_callback.html`,
79
80
  state: JSON.stringify({
80
- user: n.username,
81
+ user: i.username,
81
82
  server: e,
82
83
  portalUrl: e,
83
84
  origin: window.location.origin
84
85
  })
85
- }), c = `${w(n, t)}?${a.toString()}`;
86
- A(c);
86
+ }), c = `${A(i, t)}?${a.toString()}`;
87
+ S(c);
87
88
  }
88
- function R({
89
- account: n,
89
+ function H({
90
+ account: i,
90
91
  credential: t,
91
92
  //client_id,
92
93
  portal: e
93
94
  }) {
94
- const s = k(n.provider), i = w(n, e), r = U(n, e), o = new URLSearchParams({
95
+ const s = $(i.provider), n = A(i, e), r = b(i, e), o = new URLSearchParams({
95
96
  client_id: "arcgisonline",
96
97
  redirect_uri: r,
97
98
  parent: window.location.origin,
98
99
  response_type: "token",
99
- prepopulatedusername: t.userId,
100
100
  force_login: "false",
101
- ...s === "social" && { socialLoginProviderName: n.provider },
102
- expiration: `${(t?.expires ?? Date.now() + 60 * 1e3) - Date.now()}`
101
+ ...t.userId && { prepopulatedusername: t.userId },
102
+ ...s === "social" && { socialLoginProviderName: i.provider },
103
+ expiration: `${(t?.expires ?? Date.now() + w) - Date.now()}`
103
104
  });
104
- return `${i}?${o.toString()}`;
105
+ return `${n}?${o.toString()}`;
105
106
  }
106
- function k(n) {
107
- return B(n) ? "social" : n === "enterprise" ? "enterprise" : n.includes("oidc") ? "oidc" : "default";
107
+ function $(i) {
108
+ return J(i) ? "social" : i === "enterprise" ? "enterprise" : i.includes("oidc") ? "oidc" : "default";
108
109
  }
109
- function B(n) {
110
- return ["apple", "facebook", "github", "google"].includes(n);
110
+ function J(i) {
111
+ return ["apple", "facebook", "github", "google"].includes(i);
111
112
  }
112
- function w(n, t) {
113
- const e = u(n.orgUrlKey, t).toLowerCase(), s = k(n.provider);
114
- let i = "";
113
+ function A(i, t) {
114
+ const e = d(i.orgUrlKey, t).toLowerCase(), s = $(i.provider);
115
+ let n = "";
115
116
  switch (s) {
116
117
  case "social":
117
- i = "social/";
118
+ n = "social/";
118
119
  break;
119
120
  case "enterprise":
120
- i = "saml/";
121
+ n = "saml/";
121
122
  break;
122
123
  case "oidc":
123
- i = `oidc/${n.provider.split("_")[1]}/`;
124
+ n = `oidc/${i.provider.split("_")[1]}/`;
124
125
  break;
125
126
  }
126
- return `${e}/sharing/rest/oauth2/${i}authorize`;
127
+ return `${e}/sharing/rest/oauth2/${n}authorize`;
127
128
  }
128
- function u(n, t) {
129
- return n?.startsWith("https://") ? n : n && t.customBaseUrl ? `https://${n}.${t.customBaseUrl}` : `https://${t.portalHostname}`;
129
+ function d(i, t) {
130
+ return i?.startsWith("https://") ? i : i && t.customBaseUrl ? `https://${i}.${t.customBaseUrl}` : `https://${t.portalHostname}`;
130
131
  }
131
- function U(n, t) {
132
- return `${u(n.orgUrlKey, t)}/home/accountswitcher-callback.html`;
132
+ function b(i, t) {
133
+ return `${d(i.orgUrlKey, t)}/home/accountswitcher-callback.html`;
133
134
  }
134
- function H({
135
- origin: n,
135
+ function D({
136
+ origin: i,
136
137
  redirectToClientUri: t,
137
138
  displaySignoutComplete: e
138
139
  }) {
139
- console.log("Signout complete", n, t, e);
140
+ console.log("Signout complete", i, t, e);
140
141
  }
141
- function J(n, t) {
142
- return p.findCredential(u(n.orgUrlKey, t), n.username);
142
+ function q(i, t) {
143
+ return p.findCredential(d(i.orgUrlKey, t), i.username);
143
144
  }
144
- function D(n, t) {
145
- const e = J(n, t);
145
+ function j(i, t) {
146
+ const e = q(i, t);
146
147
  if (e)
147
148
  return e;
148
- const s = u(n.orgUrlKey, t), i = `${s}/home/check_sign_in_status.html#state=${JSON.stringify({
149
+ const s = d(i.orgUrlKey, t), n = `${s}/home/check_sign_in_status.html#state=${JSON.stringify({
149
150
  origin: window.location.origin,
150
151
  server: s,
151
152
  orgKey: s
152
153
  })}`;
153
- q(i, `iframe__for-${s}`);
154
+ z(n, `iframe__for-${s}`);
154
155
  }
155
- function q(n, t) {
156
+ function z(i, t) {
156
157
  const e = document.createElement("iframe");
157
- e.src = n, e.id = t, e.style.display = "none", document.body.appendChild(e);
158
+ e.src = i, e.id = t, e.style.display = "none", document.body.appendChild(e);
158
159
  }
159
- const f = 100;
160
- class z extends b {
160
+ const k = 100;
161
+ class F extends _ {
161
162
  constructor() {
162
- super(), this.messages = M({ blocking: !0 }), this.clientId = "arcgisonline", this.targetUser = "", this.baseUrl = "", this.linkedAccounts = [], this.loading = !1, this.signedInStatus = {}, this.showAssociatedAccountsWarning = !1, this.arcgisAccountSwitch = $(), this.arcgisClose = $(), this.listenOn(window, "message", this.handleMessageEvent);
163
+ super(), this.messages = K({ blocking: !0 }), this.clientId = "arcgisonline", this.targetUser = "", this.targetToken = "", this.baseUrl = "", this.linkedAccounts = [], this.loading = !1, this.signedInStatus = {}, this.showAssociatedAccountsWarning = !1, this.arcgisAccountSwitch = y(), this.arcgisClose = y(), this.listenOn(window, "message", this.handleMessageEvent);
163
164
  }
164
165
  static {
165
166
  this.properties = { linkedAccounts: 16, userAccounts: 16, user: 16, credential: 16, alertOptions: 16, loading: 16, signedInStatus: 16, showAssociatedAccountsWarning: 16, portal: 0 };
166
167
  }
167
168
  static {
168
- this.styles = O;
169
+ this.styles = I;
169
170
  }
170
171
  connectedCallback() {
171
- super.connectedCallback(), this.baseUrl = u(this.portal?.urlKey ?? "", this.portal);
172
+ super.connectedCallback(), this.baseUrl = d(this.portal?.urlKey ?? "", this.portal);
172
173
  }
173
174
  willUpdate(t) {
174
175
  t.has("portal") && (this.user = this.portal?.user), (t.has("portal") || t.has("user")) && this.portal && this.user && this.findLinkedUsers();
@@ -202,41 +203,49 @@ class z extends b {
202
203
  }
203
204
  }
204
205
  handleSignoutMessage(t) {
205
- const { error: e, signout: s, accountOrigin: i, redirectToClientUri: r, displaySignoutComplete: o } = t.data;
206
+ const { error: e, signout: s, accountOrigin: n, redirectToClientUri: r, displaySignoutComplete: o } = t.data;
206
207
  if (e && e !== "unknown") {
207
208
  console.error(e), reportError(this.messages.errors.signout);
208
209
  return;
209
210
  }
210
- s && (this.user = void 0, this.credential = void 0, H({ origin: i, redirectToClientUri: r, displaySignoutComplete: o }));
211
+ s && (this.user = void 0, this.credential = void 0, D({ origin: n, redirectToClientUri: r, displaySignoutComplete: o }));
211
212
  }
212
213
  handleSigninMessage(t) {
213
- const { messages: e } = this, { error: s, status: i, credential: r } = t.data;
214
+ const { messages: e } = this, { error: s, status: n, state: r, access_token: o, ssl: a } = t.data;
214
215
  if (s) {
215
216
  console.error(s), reportError(e.errors.signin);
216
217
  return;
217
218
  }
218
- if (i === "success") {
219
+ if (n === "success") {
219
220
  const {
220
- portal: o,
221
- user: a
221
+ portal: c,
222
+ user: u
222
223
  /* , clientId */
223
- } = this, c = this.linkedAccounts.find((m) => m.username === r.userId);
224
- c?.orgUrlKey === this.portal.urlKey && p.findCredential(`https://${o.portalHostname}`, a?.username)?.destroy(), p.registerToken(r);
225
- const l = R({
226
- account: c,
227
- credential: r,
224
+ } = this, l = this.linkedAccounts.find((U) => U.username === r.user);
225
+ l?.orgUrlKey === this.portal.urlKey && p.findCredential(`https://${c.portalHostname}`, u?.username)?.destroy();
226
+ const m = {
227
+ server: r.portalUrl,
228
+ userId: r.user,
229
+ token: o,
230
+ expires: Number(t.data.expires_in) + Date.now(),
231
+ ssl: a === void 0 || a !== "false"
232
+ };
233
+ p.registerToken(m);
234
+ const f = H({
235
+ account: l,
236
+ credential: m,
228
237
  /* client_id: clientId, */
229
- portal: o
238
+ portal: c
230
239
  });
231
- window.self !== window.top ? window.top?.postMessage({ type: "navigate", url: l }) : window.location.href = l;
240
+ window.self !== window.top ? window.top?.postMessage({ type: "navigate", url: f }) : window.location.href = f;
232
241
  }
233
242
  }
234
243
  handleCheckSignInStatusMessage(t) {
235
- const { success: e, orgKey: s, server: i, userId: r, token: o, expires: a, ssl: c } = t.data;
236
- s && i && e && r && o && a && c !== void 0 && (this.signedInStatus[r] = { token: o, expires: a, ssl: c });
244
+ const { success: e, orgKey: s, server: n, userId: r, token: o, expires: a, ssl: c } = t.data;
245
+ s && n && e && r && o && a && c !== void 0 && (this.signedInStatus[r] = { token: o, expires: a, ssl: c });
237
246
  }
238
247
  async handleLinkUserMessage(t) {
239
- const { error: e, username: s, access_token: i } = t.data, { portal: r, user: o, linkedAccounts: a, messages: c } = this;
248
+ const { error: e, username: s, access_token: n } = t.data, { portal: r, user: o, linkedAccounts: a, messages: c } = this;
240
249
  if (e) {
241
250
  if (e.toString().toLowerCase().includes("user denied your request"))
242
251
  return;
@@ -247,16 +256,16 @@ class z extends b {
247
256
  reportError(c.errors.selfLink);
248
257
  return;
249
258
  }
250
- if (a.find((d) => d.username === s)) {
259
+ if (a.find((l) => l.username === s)) {
251
260
  reportError(g(c.errors.alreadyLinked, { username: s }));
252
261
  return;
253
262
  }
254
- const l = await x(r, s, i);
255
- if (l?.length) {
256
- this.userAccounts = l, this.targetUser = s ?? "", this.showAssociatedAccountsWarning = !0;
263
+ const u = await C(r, s, n);
264
+ if (u?.length) {
265
+ this.userAccounts = u, this.targetUser = s ?? "", this.targetToken = n ?? "", this.showAssociatedAccountsWarning = !0;
257
266
  return;
258
267
  }
259
- this.linkAccount(s, i);
268
+ this.linkAccount(s, n);
260
269
  }
261
270
  handleExchangeTokenMessage(t) {
262
271
  const e = typeof t.data == "string" ? JSON.parse(t.data) : t.data;
@@ -264,18 +273,18 @@ class z extends b {
264
273
  if (e.error)
265
274
  console.error(e);
266
275
  else if (e.status === "success" && this.targetUser) {
267
- const { portal: s, linkedAccounts: i, targetUser: r, clientId: o } = this, a = i.find((y) => y.username === r);
276
+ const { portal: s, linkedAccounts: n, targetUser: r, clientId: o } = this, a = n.find((f) => f.username === r);
268
277
  if (!a)
269
278
  return;
270
- const c = U(a, s), l = u(a.orgUrlKey, s), d = new URLSearchParams({
279
+ const c = b(a, s), u = d(a.orgUrlKey, s), l = new URLSearchParams({
271
280
  // eslint-disable-next-line @typescript-eslint/naming-convention
272
281
  response_type: "token",
273
282
  // eslint-disable-next-line @typescript-eslint/naming-convention
274
283
  client_id: o,
275
284
  // eslint-disable-next-line @typescript-eslint/naming-convention
276
285
  redirect_uri: c,
277
- state: JSON.stringify({ user: a.username, portalUrl: l })
278
- }), m = `${w(a, s)}?${d.toString()}`;
286
+ state: JSON.stringify({ user: a.username, portalUrl: u })
287
+ }), m = `${A(a, s)}?${l.toString()}`;
279
288
  window.opener ? (window.opener.location.href = m, window.close()) : window.location.href = m;
280
289
  }
281
290
  }
@@ -285,35 +294,35 @@ class z extends b {
285
294
  this.linkedAccounts = [];
286
295
  return;
287
296
  }
288
- this.loading = !0, this.linkedAccounts = await C(this.portal, this.user), this.linkedAccounts.length && (this.signedInStatus = this.linkedAccounts.filter((t) => t.orgUrlKey !== this.portal.urlKey).reduce((t, e) => (t[e.username] = D(e, this.portal) ?? null, t), {})), this.loading = !1;
297
+ this.loading = !0, this.linkedAccounts = await v(this.portal, this.user), this.linkedAccounts.length && (this.signedInStatus = this.linkedAccounts.filter((t) => t.orgUrlKey !== this.portal.urlKey).reduce((t, e) => (t[e.username] = j(e, this.portal) ?? null, t), {})), this.loading = !1;
289
298
  }
290
299
  async linkAccount(t, e) {
291
- const { portal: s, user: i } = this;
292
- if (!s || !i)
300
+ const { portal: s, user: n } = this;
301
+ if (!s || !n)
293
302
  return;
294
- const r = await I({ portal: s, user: i, targetUser: t, targetToken: e }), { messages: o } = this;
303
+ const r = await E({ portal: s, user: n, targetUser: t, targetToken: e }), { messages: o } = this;
295
304
  if (r.error) {
296
305
  this.reportError(g(o.errors.linkAccount, { username: t })), this.targetUser = "", this.userAccounts = [];
297
306
  return;
298
307
  }
299
308
  const a = this.userAccounts?.length ? o.success.linkAccountMultiple : o.success.linkAccount;
300
- this.reportSuccess(g(a, { username: t })), this.targetUser = "", this.userAccounts = [], await E(350), this.findLinkedUsers();
309
+ this.reportSuccess(g(a, { username: t })), this.targetUser = "", this.userAccounts = [], await M(350), this.findLinkedUsers();
301
310
  }
302
311
  async unlinkAccount(t) {
303
312
  if (!this.portal || !this.user)
304
313
  return;
305
- const { messages: e, portal: s, user: i } = this, { success: r } = await v({ portal: s, user: i, linkedUsername: t.username });
314
+ const { messages: e, portal: s, user: n } = this, { success: r } = await T({ portal: s, user: n, linkedUsername: t.username });
306
315
  r ? this.reportSuccess(g(e.success.unlinkAccount, { username: t.username })) : this.reportError(g(e.errors.unlinkAccount, { username: t.username })), await this.findLinkedUsers();
307
316
  }
308
317
  startAccountLink() {
309
- P(this.portal, this.baseUrl);
318
+ N(this.portal, this.baseUrl);
310
319
  }
311
320
  switchAccount(t) {
312
- const { portal: e, user: s, clientId: i } = this;
321
+ const { portal: e, user: s, clientId: n } = this;
313
322
  if (!e || !s || !t)
314
323
  return;
315
- const r = u(s.sourceJSON.orgUrlKey ?? "", e), o = p.findCredential(r, s.id || s.username);
316
- o && W({ config: { baseUrl: r, restBaseUrl: `${r}/sharing/rest` }, credential: o, clientId: i }), N(t, e);
324
+ const r = d(s.sourceJSON.orgUrlKey ?? "", e), o = p.findCredential(r, s.id || s.username);
325
+ o && R({ config: { baseUrl: r, restBaseUrl: `${r}/sharing/rest` }, credential: o, clientId: n }), B(t, e);
317
326
  }
318
327
  reportError(t, e, s = !1) {
319
328
  this.alertOptions = {
@@ -348,23 +357,23 @@ class z extends b {
348
357
  };
349
358
  }
350
359
  render() {
351
- const { linkedAccounts: t, user: e, portal: s, messages: i } = this;
352
- return !s || !e ? null : h`<calcite-dialog .heading=${i.switchAccounts} scale=m width=s open modal .loading=${this.loading} outside-close-disabled @calciteDialogClose=${() => {
360
+ const { linkedAccounts: t, user: e, portal: s, messages: n } = this;
361
+ return !s || !e ? null : h`<calcite-dialog .heading=${n.switchAccounts} scale=m width=s open modal .loading=${this.loading} outside-close-disabled @calciteDialogClose=${() => {
353
362
  this.arcgisClose.emit();
354
- }}><calcite-block .heading=${i.currentAccount} expanded class="current-account-block"><calcite-list .label=${g(i.currentAccountLabel, { username: e.username })} interaction-mode=static selection-mode=none class="current-account-list"><calcite-list-item><arcgis-portal-user-avatar .user=${e} .portal=${s} show-name .heading=${e.username} .description=${s.name || ""} slot=content-start></arcgis-portal-user-avatar></calcite-list-item></calcite-list></calcite-block>${t.length > 0 ? h`<calcite-block .heading=${i.chooseAccount} expanded class="linked-accounts-block"><calcite-button slot=content-end icon-start=plus class="link-account-button" @click=${() => this.startAccountLink()} .disabled=${t.length >= f}>${i.linkAccount}</calcite-button><arcgis-portal-account-switcher-list .portal=${s} .linkedAccounts=${t} .signedInUsers=${Object.keys(this.signedInStatus).filter((r) => this.signedInStatus[r] !== null)} .label=${i.usersList} interactive @arcgisAccountSwitch=${(r) => {
363
+ }}><calcite-block .heading=${n.currentAccount} expanded class="current-account-block"><calcite-list .label=${g(n.currentAccountLabel, { username: e.username })} interaction-mode=static selection-mode=none class="current-account-list"><calcite-list-item><arcgis-portal-user-avatar .user=${e} .portal=${s} show-name .heading=${e.username} .description=${s.name || ""} slot=content-start></arcgis-portal-user-avatar></calcite-list-item></calcite-list></calcite-block>${t.length > 0 ? h`<calcite-block .heading=${n.chooseAccount} expanded class="linked-accounts-block"><calcite-button slot=content-end icon-start=plus class="link-account-button" @click=${() => this.startAccountLink()} .disabled=${t.length >= k}>${n.linkAccount}</calcite-button><arcgis-portal-account-switcher-list .portal=${s} .linkedAccounts=${t} .signedInUsers=${Object.keys(this.signedInStatus).filter((r) => this.signedInStatus[r] !== null)} .label=${n.usersList} interactive @arcgisAccountSwitch=${(r) => {
355
364
  this.switchAccount(r.detail.account);
356
365
  }} @arcgisAccountUnlink=${(r) => {
357
366
  this.showUnlinkConfirmation(r.detail.account);
358
- }}></arcgis-portal-account-switcher-list></calcite-block>` : h`<calcite-block .heading=${i.chooseAccount} expanded class="empty-accounts-block"><div class="empty-accounts-info"><svg class="empty-accounts-icon" width=48 height=48 viewBox="0 0 48 48" fill=none xmlns=http://www.w3.org/2000/svg>${_`<path d=${T.couple ?? L} fill=currentColor />`}</svg><h4>${i.emptyListTitle}</h4><p>${i.emptyList}</p><calcite-button icon-start=plus class="link-account-button" @click=${() => this.startAccountLink()} .disabled=${t.length >= f}>${i.linkAccount}</calcite-button></div></calcite-block>`}<calcite-notice kind=info .open=${t.length >= f}><div slot=message>${i.maxAccounts}</div></calcite-notice><calcite-alert .label=${i.alertLabel} slot=alerts .autoClose=${this.alertOptions?.kind !== "danger"} auto-close-duration=fast placement=bottom .kind=${this.alertOptions?.kind} .icon=${this.alertOptions?.icon} .open=${!!this.alertOptions} @calciteAlertClose=${() => {
367
+ }}></arcgis-portal-account-switcher-list></calcite-block>` : h`<calcite-block .heading=${n.chooseAccount} expanded class="empty-accounts-block"><div class="empty-accounts-info"><svg class="empty-accounts-icon" width=48 height=48 viewBox="0 0 48 48" fill=none xmlns=http://www.w3.org/2000/svg>${x`<path d=${P.couple ?? O} fill=currentColor />`}</svg><h4>${n.emptyListTitle}</h4><p>${n.emptyList}</p><calcite-button icon-start=plus class="link-account-button" @click=${() => this.startAccountLink()} .disabled=${t.length >= k}>${n.linkAccount}</calcite-button></div></calcite-block>`}<calcite-notice kind=info .open=${t.length >= k}><div slot=message>${n.maxAccounts}</div></calcite-notice><calcite-alert .label=${n.alertLabel} slot=alerts .autoClose=${this.alertOptions?.kind !== "danger"} auto-close-duration=fast placement=bottom .kind=${this.alertOptions?.kind} .icon=${this.alertOptions?.icon} .open=${!!this.alertOptions} @calciteAlertClose=${() => {
359
368
  this.alertOptions = void 0;
360
369
  }}>${this.alertOptions?.title && h`<h4 slot=title class="alert-title">${this.alertOptions.title}</h4>` || ""}${this.alertOptions?.message && h`<p slot=message class="alert-message">${this.alertOptions.message}</p>` || ""}${this.alertOptions?.actions?.map((r) => h`<calcite-button slot=actions-end .kind=${r.kind} .appearance=${r.appearance} @click=${r.clickHandler}>${r.text}</calcite-button>`)}</calcite-alert></calcite-dialog>${this.showAssociatedAccountsWarning && h`<arcgis-portal-account-switcher-accounts .portal=${s} .targetUser=${this.targetUser} .accounts=${this.userAccounts ?? []} @arcgisLinkAll=${() => {
361
- this.linkAccount(this.targetUser, "");
370
+ this.linkAccount(this.targetUser, this.targetToken);
362
371
  }} @arcgisCloseDialog=${() => {
363
372
  this.showAssociatedAccountsWarning = !1;
364
373
  }}></arcgis-portal-account-switcher-accounts>` || ""}`;
365
374
  }
366
375
  }
367
- S("arcgis-portal-account-switcher", z);
376
+ L("arcgis-portal-account-switcher", F);
368
377
  export {
369
- z as ArcgisPortalAccountSwitcher
378
+ F as ArcgisPortalAccountSwitcher
370
379
  };
@@ -2,6 +2,8 @@
2
2
  export type PortalNavigationTarget = PortalNavigationDestination
3
3
  & {
4
4
  t9nKey?: string;
5
+ queryParams?: Record<string, string>;
6
+ buttonLabel?: string;
5
7
  };
6
8
 
7
9
  export type PartialPortalNavigationTargetMap = Partial<PortalNavigationTargetMap>;
@@ -31,7 +33,7 @@ export interface PortalNavigationTargetMap {
31
33
  "portal-group": (groupId: string) => string;
32
34
  "portal-map-viewer": string;
33
35
  "portal-notebooks": string;
34
- "portal-org": (hash?: PortalOrgNavigationHash) => string;
36
+ "portal-org": (hash?: PortalOrgNavigationHash, queryParams?: Record<string, string>) => string;
35
37
  "portal-scene-viewer": string;
36
38
  }
37
39
 
@@ -4,6 +4,7 @@ import type PortalUser from "@arcgis/core/portal/PortalUser.js";
4
4
  import type { Config } from "@arcgis/core/config.js";
5
5
  import type { PublicLitElement as LitElement } from "@arcgis/lumina";
6
6
  import type { PartialPortalNavigationTargetMap, PortalNavigationTarget } from "./agents/types.js";
7
+ import type { CapabilityRegistry } from "./data/capability-registries/types.js";
7
8
  import type { T9nMeta } from "@arcgis/lumina/controllers";
8
9
 
9
10
  /** @internal */
@@ -19,6 +20,7 @@ export abstract class ArcgisPortalAiAssistant extends LitElement {
19
20
  * @default true
20
21
  */
21
22
  accessor navigationAgentEnabled: boolean;
23
+ accessor navigationCapabilities: CapabilityRegistry | undefined;
22
24
  /** Optional map of navigation target overrides for generating navigation hrefs from portal navigation suggestions. */
23
25
  accessor navigationTargetMap: PartialPortalNavigationTargetMap | undefined;
24
26
  accessor portal: Portal;