@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.
- package/dist/cdn/7PPA7V23.js +2 -0
- package/dist/cdn/{KZVNGOD4.js → 7YQTBSDS.js} +56 -56
- package/dist/cdn/RKWOBE3M.js +2 -0
- package/dist/cdn/index.js +1 -1
- package/dist/components/arcgis-portal-account-switcher/customElement.js +124 -115
- package/dist/components/arcgis-portal-ai-assistant/agents/types.d.ts +3 -1
- package/dist/components/arcgis-portal-ai-assistant/customElement.d.ts +2 -0
- package/dist/components/arcgis-portal-ai-assistant/customElement.js +144 -149
- package/dist/components/arcgis-portal-ai-assistant/data/capability-registries/types.d.ts +34 -0
- package/dist/components/arcgis-portal-navigation/customElement.js +2 -2
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/loader.js +1 -1
- package/dist/types/lumina.d.ts +1 -1
- package/dist/types/preact.d.ts +1 -1
- package/dist/types/react.d.ts +1 -1
- package/dist/types/stencil.d.ts +1 -1
- package/package.json +4 -4
- package/dist/cdn/2YI5PHJ6.js +0 -2
- package/dist/cdn/QCJQXOSH.js +0 -2
|
@@ -1,51 +1,52 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import { c as
|
|
3
|
-
import { LitElement as
|
|
4
|
-
import { html as h, svg as
|
|
5
|
-
import { s as
|
|
6
|
-
import { g as
|
|
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
|
|
9
|
-
import { u as
|
|
10
|
-
import { m as
|
|
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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
|
17
|
-
const e = (
|
|
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
|
|
21
|
-
const e = p.findOAuthInfo(
|
|
21
|
+
function N(i, t) {
|
|
22
|
+
const e = p.findOAuthInfo(i.url), {
|
|
22
23
|
/* appId = "arcgisonline", */
|
|
23
24
|
locale: s = "en",
|
|
24
|
-
expiration:
|
|
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: `${
|
|
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://${
|
|
37
|
+
redirect_uri: `https://${i.portalHostname}/home/link_account_callback.html`,
|
|
37
38
|
state: JSON.stringify({ useMessage: !0 })
|
|
38
|
-
}), o = `${
|
|
39
|
-
|
|
39
|
+
}), o = `${W(t)}oauth2/authorize?${r.toString()}`;
|
|
40
|
+
S(o);
|
|
40
41
|
}
|
|
41
|
-
function
|
|
42
|
+
function R(i) {
|
|
42
43
|
const {
|
|
43
44
|
config: t,
|
|
44
45
|
credential: e,
|
|
45
46
|
clientId: s = "arcgisonline",
|
|
46
|
-
redirectToClientUri:
|
|
47
|
+
redirectToClientUri: n = !1,
|
|
47
48
|
displaySignoutComplete: r = !1
|
|
48
|
-
} =
|
|
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:
|
|
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
|
|
64
|
-
const e =
|
|
64
|
+
function B(i, t) {
|
|
65
|
+
const e = d(i.orgUrlKey, t), s = p.findOAuthInfo(e), {
|
|
65
66
|
/* appId = "arcgisonline", */
|
|
66
|
-
locale:
|
|
67
|
-
expiration: r =
|
|
68
|
-
} = s ?? {}, o =
|
|
69
|
-
locale:
|
|
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:
|
|
76
|
-
...o === "default" && { prepopulatedusername:
|
|
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:
|
|
81
|
+
user: i.username,
|
|
81
82
|
server: e,
|
|
82
83
|
portalUrl: e,
|
|
83
84
|
origin: window.location.origin
|
|
84
85
|
})
|
|
85
|
-
}), c = `${
|
|
86
|
-
|
|
86
|
+
}), c = `${A(i, t)}?${a.toString()}`;
|
|
87
|
+
S(c);
|
|
87
88
|
}
|
|
88
|
-
function
|
|
89
|
-
account:
|
|
89
|
+
function H({
|
|
90
|
+
account: i,
|
|
90
91
|
credential: t,
|
|
91
92
|
//client_id,
|
|
92
93
|
portal: e
|
|
93
94
|
}) {
|
|
94
|
-
const s =
|
|
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
|
-
...
|
|
102
|
-
|
|
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 `${
|
|
105
|
+
return `${n}?${o.toString()}`;
|
|
105
106
|
}
|
|
106
|
-
function
|
|
107
|
-
return
|
|
107
|
+
function $(i) {
|
|
108
|
+
return J(i) ? "social" : i === "enterprise" ? "enterprise" : i.includes("oidc") ? "oidc" : "default";
|
|
108
109
|
}
|
|
109
|
-
function
|
|
110
|
-
return ["apple", "facebook", "github", "google"].includes(
|
|
110
|
+
function J(i) {
|
|
111
|
+
return ["apple", "facebook", "github", "google"].includes(i);
|
|
111
112
|
}
|
|
112
|
-
function
|
|
113
|
-
const e =
|
|
114
|
-
let
|
|
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
|
-
|
|
118
|
+
n = "social/";
|
|
118
119
|
break;
|
|
119
120
|
case "enterprise":
|
|
120
|
-
|
|
121
|
+
n = "saml/";
|
|
121
122
|
break;
|
|
122
123
|
case "oidc":
|
|
123
|
-
|
|
124
|
+
n = `oidc/${i.provider.split("_")[1]}/`;
|
|
124
125
|
break;
|
|
125
126
|
}
|
|
126
|
-
return `${e}/sharing/rest/oauth2/${
|
|
127
|
+
return `${e}/sharing/rest/oauth2/${n}authorize`;
|
|
127
128
|
}
|
|
128
|
-
function
|
|
129
|
-
return
|
|
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
|
|
132
|
-
return `${
|
|
132
|
+
function b(i, t) {
|
|
133
|
+
return `${d(i.orgUrlKey, t)}/home/accountswitcher-callback.html`;
|
|
133
134
|
}
|
|
134
|
-
function
|
|
135
|
-
origin:
|
|
135
|
+
function D({
|
|
136
|
+
origin: i,
|
|
136
137
|
redirectToClientUri: t,
|
|
137
138
|
displaySignoutComplete: e
|
|
138
139
|
}) {
|
|
139
|
-
console.log("Signout complete",
|
|
140
|
+
console.log("Signout complete", i, t, e);
|
|
140
141
|
}
|
|
141
|
-
function
|
|
142
|
-
return p.findCredential(
|
|
142
|
+
function q(i, t) {
|
|
143
|
+
return p.findCredential(d(i.orgUrlKey, t), i.username);
|
|
143
144
|
}
|
|
144
|
-
function
|
|
145
|
-
const e =
|
|
145
|
+
function j(i, t) {
|
|
146
|
+
const e = q(i, t);
|
|
146
147
|
if (e)
|
|
147
148
|
return e;
|
|
148
|
-
const s =
|
|
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
|
-
|
|
154
|
+
z(n, `iframe__for-${s}`);
|
|
154
155
|
}
|
|
155
|
-
function
|
|
156
|
+
function z(i, t) {
|
|
156
157
|
const e = document.createElement("iframe");
|
|
157
|
-
e.src =
|
|
158
|
+
e.src = i, e.id = t, e.style.display = "none", document.body.appendChild(e);
|
|
158
159
|
}
|
|
159
|
-
const
|
|
160
|
-
class
|
|
160
|
+
const k = 100;
|
|
161
|
+
class F extends _ {
|
|
161
162
|
constructor() {
|
|
162
|
-
super(), this.messages =
|
|
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 =
|
|
169
|
+
this.styles = I;
|
|
169
170
|
}
|
|
170
171
|
connectedCallback() {
|
|
171
|
-
super.connectedCallback(), this.baseUrl =
|
|
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:
|
|
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,
|
|
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:
|
|
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 (
|
|
219
|
+
if (n === "success") {
|
|
219
220
|
const {
|
|
220
|
-
portal:
|
|
221
|
-
user:
|
|
221
|
+
portal: c,
|
|
222
|
+
user: u
|
|
222
223
|
/* , clientId */
|
|
223
|
-
} = this,
|
|
224
|
-
|
|
225
|
-
const
|
|
226
|
-
|
|
227
|
-
|
|
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:
|
|
238
|
+
portal: c
|
|
230
239
|
});
|
|
231
|
-
window.self !== window.top ? window.top?.postMessage({ type: "navigate", url:
|
|
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:
|
|
236
|
-
s &&
|
|
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:
|
|
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((
|
|
259
|
+
if (a.find((l) => l.username === s)) {
|
|
251
260
|
reportError(g(c.errors.alreadyLinked, { username: s }));
|
|
252
261
|
return;
|
|
253
262
|
}
|
|
254
|
-
const
|
|
255
|
-
if (
|
|
256
|
-
this.userAccounts =
|
|
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,
|
|
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:
|
|
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 =
|
|
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:
|
|
278
|
-
}), m = `${
|
|
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
|
|
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:
|
|
292
|
-
if (!s || !
|
|
300
|
+
const { portal: s, user: n } = this;
|
|
301
|
+
if (!s || !n)
|
|
293
302
|
return;
|
|
294
|
-
const r = await
|
|
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
|
|
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:
|
|
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
|
-
|
|
318
|
+
N(this.portal, this.baseUrl);
|
|
310
319
|
}
|
|
311
320
|
switchAccount(t) {
|
|
312
|
-
const { portal: e, user: s, clientId:
|
|
321
|
+
const { portal: e, user: s, clientId: n } = this;
|
|
313
322
|
if (!e || !s || !t)
|
|
314
323
|
return;
|
|
315
|
-
const r =
|
|
316
|
-
o &&
|
|
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:
|
|
352
|
-
return !s || !e ? null : h`<calcite-dialog .heading=${
|
|
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=${
|
|
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=${
|
|
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
|
-
|
|
376
|
+
L("arcgis-portal-account-switcher", F);
|
|
368
377
|
export {
|
|
369
|
-
|
|
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;
|