@arcgis/portal-components 5.2.0-next.124 → 5.2.0-next.125

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (177) hide show
  1. package/dist/cdn/{XVXUI2NM.js → 2B2T3CO3.js} +1 -1
  2. package/dist/cdn/2EV6F7V6.js +2 -0
  3. package/dist/cdn/{PO7ZCHRK.js → 2U2SESKW.js} +69 -69
  4. package/dist/cdn/{ZRPU3E6I.js → 3TMF6URM.js} +1 -1
  5. package/dist/cdn/3YJUQ54F.js +2 -0
  6. package/dist/cdn/{X2YH4HME.js → 5B76NS25.js} +1 -1
  7. package/dist/cdn/5CFTWDD6.js +2 -0
  8. package/dist/cdn/5CQ3B6ZW.js +2 -0
  9. package/dist/cdn/5EFYJYWM.js +2 -0
  10. package/dist/cdn/5GLUIQ7R.js +2 -0
  11. package/dist/cdn/{P5T4PK6A.js → 5HP5TLLV.js} +1 -1
  12. package/dist/cdn/5ZSZI7KG.js +2 -0
  13. package/dist/cdn/{5SRRBZNT.js → 6JJUORUU.js} +1 -1
  14. package/dist/cdn/6PTPTTSS.js +2 -0
  15. package/dist/cdn/6XRVLKAZ.js +2 -0
  16. package/dist/cdn/{IE57HB42.js → 7QCQNOXB.js} +1 -1
  17. package/dist/cdn/{FXGAQXNR.js → 7UNUBFFC.js} +1 -1
  18. package/dist/cdn/{ZHJMS2LV.js → 7WFLPRTI.js} +1 -1
  19. package/dist/cdn/{YA32NOJY.js → ABIXHCPF.js} +1 -1
  20. package/dist/cdn/{HKJ5QP62.js → AYOR6D2Z.js} +1 -1
  21. package/dist/cdn/{6Z2AEG54.js → BPQ6ZBLE.js} +1 -1
  22. package/dist/cdn/{5R5O2X3M.js → BQKUF5EQ.js} +1 -1
  23. package/dist/cdn/BYYQOYJS.js +2 -0
  24. package/dist/cdn/{TD6BN5LE.js → CVUMYWBS.js} +1 -1
  25. package/dist/cdn/{JADQNA27.js → D4MCG57T.js} +1 -1
  26. package/dist/cdn/DIOGMUOB.js +2 -0
  27. package/dist/cdn/{52EHJXE4.js → DZWCWV3A.js} +1 -1
  28. package/dist/cdn/{35MI6GEH.js → E3XDGNPB.js} +1 -1
  29. package/dist/cdn/EPURPU4Q.js +2 -0
  30. package/dist/cdn/{JZID64Z6.js → EXPBHQ4I.js} +1 -1
  31. package/dist/cdn/{MTJN3KRM.js → FHXIGKK4.js} +1 -1
  32. package/dist/cdn/{X3WXFI25.js → FJ3PFFCN.js} +1 -1
  33. package/dist/cdn/{GXOORXRU.js → FKFSGSBA.js} +1 -1
  34. package/dist/cdn/FPKKNRZY.js +2 -0
  35. package/dist/cdn/{COXMHAJA.js → GCB5BYDM.js} +1 -1
  36. package/dist/cdn/{7EM25L56.js → GES5WKJA.js} +1 -1
  37. package/dist/cdn/{Z44L4BKR.js → GGG3IIFK.js} +1 -1
  38. package/dist/cdn/{QJCOQ6FY.js → GZU4XZUI.js} +1 -1
  39. package/dist/cdn/{JEOHKIHK.js → H3CCKTNL.js} +1 -1
  40. package/dist/cdn/{BZZQOEUP.js → H3PPP7A7.js} +1 -1
  41. package/dist/cdn/{BYV7M63H.js → HATTAFCL.js} +1 -1
  42. package/dist/cdn/{5HVUPXCG.js → HPDQHQVC.js} +1 -1
  43. package/dist/cdn/{L4YVQHX3.js → HWYJF6DJ.js} +1 -1
  44. package/dist/cdn/{OAVKM5RX.js → I5C4SV6N.js} +1 -1
  45. package/dist/cdn/{4RPD44KC.js → I64ZE3TR.js} +1 -1
  46. package/dist/cdn/{7EPXWK4L.js → ICUDZDC6.js} +1 -1
  47. package/dist/cdn/{625YOS7Q.js → IMIQY3MT.js} +1 -1
  48. package/dist/cdn/{GC7KNL7Y.js → IWARFJ4I.js} +1 -1
  49. package/dist/cdn/JB2P4KY4.js +2 -0
  50. package/dist/cdn/{YASUXORH.js → JGCCJ5PX.js} +1 -1
  51. package/dist/cdn/JIOUF6RV.js +2 -0
  52. package/dist/cdn/{6QTLQAJL.js → K25K7FCI.js} +1 -1
  53. package/dist/cdn/{37HLLREH.js → K4LXMVNH.js} +1 -1
  54. package/dist/cdn/{6H7CWMFE.js → K64QFEX2.js} +1 -1
  55. package/dist/cdn/{CFLKHGTI.js → KALKWPUR.js} +1 -1
  56. package/dist/cdn/KEM54FSC.js +2 -0
  57. package/dist/cdn/{RCL4QILW.js → KFGCJN3T.js} +1 -1
  58. package/dist/cdn/{3RGCV53N.js → L46EVYBC.js} +1 -1
  59. package/dist/cdn/{E3Y3LIHI.js → LFRTGSGI.js} +1 -1
  60. package/dist/cdn/MA7TVM56.js +2 -0
  61. package/dist/cdn/MBOTEUCN.js +2 -0
  62. package/dist/cdn/MC3V6J4M.js +2 -0
  63. package/dist/cdn/{JGH37RQB.js → MFKSJMJS.js} +1 -1
  64. package/dist/cdn/{EZIZLWHA.js → MXVFCMBR.js} +1 -1
  65. package/dist/cdn/{5H6OROJK.js → N4UNPHFQ.js} +1 -1
  66. package/dist/cdn/{XCFRL5XT.js → NBLJQFA7.js} +1 -1
  67. package/dist/cdn/{7ZCKR7TW.js → NBU2KMJP.js} +1 -1
  68. package/dist/cdn/NBX2RCQR.js +2 -0
  69. package/dist/cdn/NQMXSOYA.js +2 -0
  70. package/dist/cdn/{DKWAWI4G.js → NXJTHWZ6.js} +1 -1
  71. package/dist/cdn/{AUBBEYJL.js → OGAJ4WJ7.js} +1 -1
  72. package/dist/cdn/{M5VLXVNQ.js → OXKHPA3Q.js} +1 -1
  73. package/dist/cdn/{DWHJ45FR.js → PCFYL72V.js} +1 -1
  74. package/dist/cdn/{BKACWDST.js → PK7EJW27.js} +1 -1
  75. package/dist/cdn/{C5SWAPH7.js → PM3ZMOIJ.js} +1 -1
  76. package/dist/cdn/{H4TRF2G7.js → PWHUWOQ3.js} +1 -1
  77. package/dist/cdn/PZGMF6VO.js +2 -0
  78. package/dist/cdn/QNWDRDCX.js +2 -0
  79. package/dist/cdn/{BQLZPSWJ.js → QPYGIJHQ.js} +1 -1
  80. package/dist/cdn/{NDHD5H3P.js → QQMRZ2WI.js} +1 -1
  81. package/dist/cdn/{BV5TOHYG.js → QSWSIFAH.js} +1 -1
  82. package/dist/cdn/{6XW2ZF24.js → RII2VGVJ.js} +1 -1
  83. package/dist/cdn/{FQCG2EFI.js → RX7UZ7F5.js} +1 -1
  84. package/dist/cdn/S772GWA3.js +2 -0
  85. package/dist/cdn/SGI3WLNF.js +2 -0
  86. package/dist/cdn/SXQ2TVKW.js +2 -0
  87. package/dist/cdn/SXSWBX5T.js +2 -0
  88. package/dist/cdn/TEYNP76W.js +2 -0
  89. package/dist/cdn/TH6XSIAF.js +2 -0
  90. package/dist/cdn/{TF3F2YJ6.js → THNBXEBO.js} +1 -1
  91. package/dist/cdn/{AO7QKC5R.js → TMGE65IV.js} +1 -1
  92. package/dist/cdn/U6MJCS5P.js +2 -0
  93. package/dist/cdn/{6F74ZAGM.js → UI3WY3TF.js} +1 -1
  94. package/dist/cdn/{7NZ3RJFV.js → UXAGLEJM.js} +1 -1
  95. package/dist/cdn/{64NRJZKN.js → V2WAYK5G.js} +1 -1
  96. package/dist/cdn/{BLCWXWUR.js → V5BCQN5U.js} +1 -1
  97. package/dist/cdn/{CGX6YKBP.js → V75YULVA.js} +1 -1
  98. package/dist/cdn/{5UU2W2M6.js → VKS44KV4.js} +1 -1
  99. package/dist/cdn/{SHWP2FT2.js → VUBYPGZG.js} +1 -1
  100. package/dist/cdn/VYGJEX36.js +2 -0
  101. package/dist/cdn/{VU5VTC5L.js → WKQGRP5P.js} +1 -1
  102. package/dist/cdn/{FWRSYP3I.js → X4GCKBT2.js} +1 -1
  103. package/dist/cdn/{7T744GFJ.js → XATZUXUP.js} +1 -1
  104. package/dist/cdn/XDKRJYZ2.js +2 -0
  105. package/dist/cdn/YDA23ZS6.js +2 -0
  106. package/dist/cdn/{5IEUHTZ7.js → YFU47LWN.js} +1 -1
  107. package/dist/cdn/{GMLGEIYS.js → YXWMVZUC.js} +1 -1
  108. package/dist/cdn/YYHDUC6G.js +2 -0
  109. package/dist/cdn/Z7OHVQMR.js +2 -0
  110. package/dist/cdn/{6L5QFCR6.js → ZY5BJB25.js} +1 -1
  111. package/dist/cdn/{NF5AJJQU.js → ZZBKWWAW.js} +1 -1
  112. package/dist/cdn/assets/portal-delete-items/t9n/messages.en.json +1 -0
  113. package/dist/cdn/assets/portal-review-related-items/t9n/messages.en.json +1 -0
  114. package/dist/cdn/index.js +1 -1
  115. package/dist/cdn/main.css +1 -1
  116. package/dist/chunks/functional.js +9 -0
  117. package/dist/components/arcgis-portal-account-switcher/customElement.d.ts +1 -0
  118. package/dist/components/arcgis-portal-account-switcher/customElement.js +117 -116
  119. package/dist/components/arcgis-portal-delete-items/customElement.d.ts +128 -0
  120. package/dist/components/arcgis-portal-delete-items/customElement.js +452 -0
  121. package/dist/components/arcgis-portal-delete-items/index.d.ts +1 -0
  122. package/dist/components/arcgis-portal-delete-items/index.js +13 -0
  123. package/dist/components/arcgis-portal-delete-items/services.d.ts +7 -0
  124. package/dist/components/arcgis-portal-extent-picker/customElement.js +285 -243
  125. package/dist/components/arcgis-portal-extent-picker/index.js +3 -0
  126. package/dist/components/arcgis-portal-extent-picker-coord-field/customElement.js +8 -8
  127. package/dist/components/arcgis-portal-navigation/customElement.js +35 -37
  128. package/dist/components/arcgis-portal-navigation/index.js +4 -4
  129. package/dist/components/arcgis-portal-review-related-items/customElement.d.ts +27 -0
  130. package/dist/components/arcgis-portal-review-related-items/customElement.js +42 -0
  131. package/dist/components/arcgis-portal-review-related-items/index.d.ts +1 -0
  132. package/dist/components/arcgis-portal-review-related-items/index.js +5 -0
  133. package/dist/docs/api.json +1 -1
  134. package/dist/docs/docs.json +1 -1
  135. package/dist/docs/vscode.html-custom-data.json +1 -1
  136. package/dist/docs/web-types.json +1 -1
  137. package/dist/index.d.ts +14 -0
  138. package/dist/loader.js +3 -1
  139. package/dist/types/lumina.d.ts +14 -1
  140. package/dist/types/preact.d.ts +16 -1
  141. package/dist/types/react.d.ts +18 -1
  142. package/dist/types/services.d.ts +9 -0
  143. package/dist/types/stencil.d.ts +14 -1
  144. package/package.json +7 -6
  145. package/dist/cdn/2HI6C3VG.js +0 -2
  146. package/dist/cdn/3R4I7T7Y.js +0 -2
  147. package/dist/cdn/465E43FF.js +0 -2
  148. package/dist/cdn/6PRXL6A7.js +0 -2
  149. package/dist/cdn/7LIVNXCJ.js +0 -2
  150. package/dist/cdn/A2OPVUV2.js +0 -2
  151. package/dist/cdn/BTGSJRJK.js +0 -2
  152. package/dist/cdn/C7FIYNJZ.js +0 -2
  153. package/dist/cdn/CK2D7FWY.js +0 -2
  154. package/dist/cdn/CQYLVRUF.js +0 -2
  155. package/dist/cdn/GXQMTKYF.js +0 -2
  156. package/dist/cdn/H2BBKRIY.js +0 -2
  157. package/dist/cdn/HGKH2F4Y.js +0 -2
  158. package/dist/cdn/KXSBIXYI.js +0 -2
  159. package/dist/cdn/L3UUTA7H.js +0 -2
  160. package/dist/cdn/LD2SO7MK.js +0 -2
  161. package/dist/cdn/LDY4QCZH.js +0 -2
  162. package/dist/cdn/LR6IOINV.js +0 -2
  163. package/dist/cdn/M3PJPM3Q.js +0 -2
  164. package/dist/cdn/ML2ETZQ5.js +0 -2
  165. package/dist/cdn/NMMQRFHX.js +0 -2
  166. package/dist/cdn/OO2IP4WZ.js +0 -2
  167. package/dist/cdn/PBWAZUZ4.js +0 -2
  168. package/dist/cdn/QTDRRCS2.js +0 -2
  169. package/dist/cdn/SXE3WUK6.js +0 -2
  170. package/dist/cdn/UFEBKEX7.js +0 -2
  171. package/dist/cdn/VLLPYVQB.js +0 -2
  172. package/dist/cdn/W47ZH7KA.js +0 -2
  173. package/dist/cdn/WFTFIAEX.js +0 -2
  174. package/dist/cdn/WIU3MYUE.js +0 -2
  175. package/dist/cdn/WKFQOWXJ.js +0 -2
  176. /package/dist/cdn/{DG6DAKQ2.js → ASDS73QU.js} +0 -0
  177. /package/dist/cdn/{N5KMTTYL.js → OTMC7MVD.js} +0 -0
@@ -1,23 +1,23 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
2
  import { c as L } from "../../chunks/runtime.js";
3
- import { keyed as _ } from "lit/directives/keyed.js";
4
- import { LitElement as C, createEvent as k, safeClassMap as v, nothing as x } from "@arcgis/lumina";
5
- import { html as d, svg as T } from "lit";
6
- import { s as M } from "../../chunks/portal-account-switcher.js";
7
- import { g as K, a as N, l as E, u as H } from "../../chunks/user.js";
3
+ import { keyed as C } from "lit/directives/keyed.js";
4
+ import { LitElement as v, createEvent as k, safeClassMap as x, nothing as T } from "@arcgis/lumina";
5
+ import { html as d, svg as M } from "lit";
6
+ import { s as K } from "../../chunks/portal-account-switcher.js";
7
+ import { g as N, a as E, l as H, u as P } from "../../chunks/user.js";
8
8
  import f from "@arcgis/core/identity/IdentityManager.js";
9
- import { t as P } from "../../chunks/functionalities.js";
10
- import { u as W } from "../../chunks/useT9n.js";
11
- import { m as B } from "../../chunks/icons.js";
9
+ import { t as W } from "../../chunks/functionalities.js";
10
+ import { u as B } from "../../chunks/useT9n.js";
11
+ import { m as R } from "../../chunks/icons.js";
12
12
  import { substitute as m } from "@arcgis/core/intl.js";
13
- import { g as R } from "../../chunks/services.js";
14
- const U = 1260 * 1e3, J = 2500;
15
- function I(r, e = "_blank", s = 582, t = 670) {
16
- const n = window.screenLeft ?? 0, i = window.screenTop ?? 0, a = window.innerWidth || document.documentElement.clientWidth || window.screen.width, o = window.innerHeight || document.documentElement.clientHeight || window.screen.height, c = a / 2 - s / 2 + n, u = o / 2 - t / 2 + i, l = window.open(r, e, `scrollbars=no, width=${s}, height=${t}, top=${u}, left=${c}`);
13
+ import { g as J } from "../../chunks/services.js";
14
+ const U = 1260 * 1e3, D = 2500;
15
+ function O(r, e = "_blank", s = 582, t = 670) {
16
+ const i = window.screenLeft ?? 0, n = window.screenTop ?? 0, a = window.innerWidth || document.documentElement.clientWidth || window.screen.width, o = window.innerHeight || document.documentElement.clientHeight || window.screen.height, c = a / 2 - s / 2 + i, u = o / 2 - t / 2 + n, l = window.open(r, e, `scrollbars=no, width=${s}, height=${t}, top=${u}, left=${c}`);
17
17
  return l?.focus(), l;
18
18
  }
19
- function D(r) {
20
- const e = f.findOAuthInfo(r.url), { locale: s = "en", expiration: t = U } = e ?? {}, n = new URLSearchParams({
19
+ function j(r) {
20
+ const e = f.findOAuthInfo(r.url), { locale: s = "en", expiration: t = U } = e ?? {}, i = new URLSearchParams({
21
21
  locale: s,
22
22
  // Linking accounts ALWAYS uses the "arcgisonline" client id
23
23
  client_id: "arcgisonline",
@@ -30,35 +30,35 @@ function D(r) {
30
30
  parent: window.location.origin,
31
31
  redirect_uri: `https://${r.portalHostname}/home/link_account_callback.html`,
32
32
  state: JSON.stringify({ useMessage: !0 })
33
- }), i = `https://${r.portalHostname}/sharing/oauth2/authorize?${n.toString()}`;
34
- I(i);
33
+ }), n = `https://${r.portalHostname}/sharing/oauth2/authorize?${i.toString()}`;
34
+ O(n);
35
35
  }
36
36
  function A(r) {
37
37
  const {
38
38
  config: e,
39
39
  token: s,
40
40
  clientId: t = "arcgisonline",
41
- redirectToClientUri: n = !1,
42
- displaySignoutComplete: i = !1
41
+ redirectToClientUri: i = !1,
42
+ displaySignoutComplete: n = !1
43
43
  } = r, a = new URLSearchParams({
44
44
  display: "iframe",
45
45
  client_id: t,
46
46
  ...s && { token: s },
47
47
  parent: window.location.origin,
48
- redirect_uri: `${e.baseUrl}signout_callback.html`,
48
+ redirect_uri: `${e.baseUrl}/check_sign_in_status.html`,
49
49
  state: JSON.stringify({
50
50
  signout: !0,
51
51
  origin: window.location.origin,
52
- redirectToClientUri: n,
53
- displaySignoutComplete: i
52
+ redirectToClientUri: i,
53
+ displaySignoutComplete: n
54
54
  })
55
55
  }), o = `${e.restBaseUrl}oauth2/signout?${a.toString()}`, c = document.createElement("iframe");
56
56
  c.src = o, c.style.display = "none", document.body.appendChild(c);
57
57
  }
58
- function j(r, e, s) {
59
- const t = g(r.orgUrlKey, e), n = f.findOAuthInfo(t), { appId: i, locale: a = "en", expiration: o = U } = n ?? {}, c = S(r.provider), u = new URLSearchParams({
58
+ function q(r, e, s) {
59
+ const t = h(r.orgUrlKey, e), i = f.findOAuthInfo(t), { appId: n, locale: a = "en", expiration: o = U } = i ?? {}, c = S(r.provider), u = new URLSearchParams({
60
60
  locale: a,
61
- client_id: s ?? i ?? "arcgisonline",
61
+ client_id: s ?? n ?? "arcgisonline",
62
62
  response_type: "token",
63
63
  expiration: `${o}`,
64
64
  parent: window.location.origin,
@@ -73,32 +73,33 @@ function j(r, e, s) {
73
73
  origin: window.location.origin
74
74
  })
75
75
  }), l = `${y(r, e)}?${u.toString()}`;
76
- I(l);
76
+ O(l);
77
77
  }
78
- function q({
78
+ function z({
79
79
  accounts: r,
80
80
  clientId: e = "arcgisonline",
81
81
  usersToFilter: s = [],
82
82
  accountsToFilter: t = ""
83
83
  }) {
84
- const n = {};
85
- return r.reduce((i, a) => {
84
+ const i = {};
85
+ return r.reduce((n, a) => {
86
86
  const o = {
87
87
  disabled: a.disabled ?? !1,
88
88
  allowed: a.clientAppAccessAllowed ?? !0
89
89
  };
90
- return i[a.username] = o, (s.includes(a.username) || s.includes(a.username.toLowerCase()) || t === "org" && a.orgUrlKey || e === "esriapps" && a.userType !== "both") && (o.allowed = !1), i;
91
- }, n), n;
90
+ return n[a.username] = o, (s.includes(a.username) || s.includes(a.username.toLowerCase()) || t === "org" && a.orgUrlKey || e === "esriapps" && a.userType !== "both") && (o.allowed = !1), n;
91
+ }, i), i;
92
92
  }
93
- function z({
93
+ function F({
94
94
  account: r,
95
95
  credential: e,
96
- client_id: s,
97
- portal: t
96
+ clientId: s,
97
+ portal: t,
98
+ redirectUri: i
98
99
  }) {
99
- const n = S(r.provider), i = y(r, t), a = O(r, t), o = new URLSearchParams({
100
+ const n = S(r.provider), a = y(r, t), o = i || _(r, t), c = new URLSearchParams({
100
101
  client_id: s,
101
- redirect_uri: a,
102
+ redirect_uri: o,
102
103
  parent: window.location.origin,
103
104
  response_type: "token",
104
105
  force_login: "false",
@@ -106,67 +107,67 @@ function z({
106
107
  ...n === "social" && { socialLoginProviderName: r.provider },
107
108
  expiration: `${(e?.expires ?? Date.now() + U) - Date.now()}`
108
109
  });
109
- return `${i}?${o.toString()}`;
110
+ return `${a}?${c.toString()}`;
110
111
  }
111
112
  function S(r) {
112
- return F(r) ? "social" : r === "enterprise" ? "enterprise" : r.includes("oidc") ? "oidc" : "default";
113
+ return G(r) ? "social" : r === "enterprise" ? "enterprise" : r.includes("oidc") ? "oidc" : "default";
113
114
  }
114
- function F(r) {
115
+ function G(r) {
115
116
  return ["apple", "facebook", "github", "google"].includes(r);
116
117
  }
117
118
  function y(r, e) {
118
- const s = g(r.orgUrlKey, e).toLowerCase(), t = S(r.provider);
119
- let n = "";
119
+ const s = h(r.orgUrlKey, e).toLowerCase(), t = S(r.provider);
120
+ let i = "";
120
121
  switch (t) {
121
122
  case "social":
122
- n = "social/";
123
+ i = "social/";
123
124
  break;
124
125
  case "enterprise":
125
- n = "saml/";
126
+ i = "saml/";
126
127
  break;
127
128
  case "oidc":
128
- n = `oidc/${r.provider.split("_")[1]}/`;
129
+ i = `oidc/${r.provider.split("_")[1]}/`;
129
130
  break;
130
131
  }
131
- return `${s}/sharing/rest/oauth2/${n}authorize`;
132
+ return `${s}/sharing/rest/oauth2/${i}authorize`;
132
133
  }
133
- function g(r, e) {
134
+ function h(r, e) {
134
135
  return r?.startsWith("https://") ? r : r && e.customBaseUrl ? `https://${r}.${e.customBaseUrl}` : `https://${e.portalHostname}`;
135
136
  }
136
- function O(r, e) {
137
- return `${g(r.orgUrlKey, e)}/home/accountswitcher-callback.html`;
138
- }
139
- function G(r, e) {
140
- return f.findCredential(g(r.orgUrlKey, e), r.username);
137
+ function _(r, e) {
138
+ return `${h(r.orgUrlKey, e)}/home/accountswitcher-callback.html`;
141
139
  }
142
140
  function Q(r, e) {
143
- const s = G(r, e);
141
+ return f.findCredential(h(r.orgUrlKey, e), r.username);
142
+ }
143
+ function V(r, e) {
144
+ const s = Q(r, e);
144
145
  if (s)
145
146
  return s;
146
- const t = g(r.orgUrlKey, e), n = `${t}/home/check_sign_in_status.html#state=${JSON.stringify({
147
+ const t = h(r.orgUrlKey, e), i = `${t}/home/check_sign_in_status.html#state=${JSON.stringify({
147
148
  origin: window.location.origin,
148
149
  server: t,
149
150
  orgKey: t
150
151
  })}`;
151
- V(n, `iframe__for-${t}`);
152
+ X(i, `iframe__for-${t}`);
152
153
  }
153
- function V(r, e) {
154
+ function X(r, e) {
154
155
  const s = document.createElement("iframe");
155
156
  s.src = r, s.id = e, s.style.display = "none", document.body.appendChild(s);
156
157
  }
157
158
  const $ = 100;
158
- class X extends C {
159
+ class Y extends v {
159
160
  constructor() {
160
- super(), this.messages = W({ blocking: !0 }), this.targetUser = "", this.targetToken = "", this.accountAccess = {}, this.remainingSignouts = 0, this.signoutHandle = 0, this.linkedAccounts = [], this.loading = !1, this.signedInStatus = {}, this.showAssociatedAccountsWarning = !1, this.signedInAccounts = [], this.clientId = "arcgisonline", this.signout = !1, this.signoutOptions = {
161
+ super(), this.messages = B({ blocking: !0 }), this.targetUser = "", this.targetToken = "", this.accountAccess = {}, this.remainingSignouts = 0, this.signoutHandle = 0, this.linkedAccounts = [], this.loading = !1, this.signedInStatus = {}, this.showAssociatedAccountsWarning = !1, this.signedInAccounts = [], this.clientId = "arcgisonline", this.signout = !1, this.signoutOptions = {
161
162
  redirectToClientUri: !1,
162
163
  displaySignoutComplete: !1
163
164
  }, this.arcgisAccountSwitch = k(), this.arcgisClose = k(), this.arcgisSignoutComplete = k(), this.listenOn(window, "message", this.handleMessageEvent);
164
165
  }
165
166
  static {
166
- this.properties = { linkedAccounts: 16, userAccounts: 16, user: 16, credential: 16, alertOptions: 16, loading: 16, signedInStatus: 16, showAssociatedAccountsWarning: 16, signedInAccounts: 16, portal: 0, clientId: 1, signout: 5, signoutOptions: 0 };
167
+ this.properties = { linkedAccounts: 16, userAccounts: 16, user: 16, credential: 16, alertOptions: 16, loading: 16, signedInStatus: 16, showAssociatedAccountsWarning: 16, signedInAccounts: 16, portal: 0, clientId: 1, redirectUri: 1, signout: 5, signoutOptions: 0 };
167
168
  }
168
169
  static {
169
- this.styles = M;
170
+ this.styles = K;
170
171
  }
171
172
  willUpdate(e) {
172
173
  if (e.has("portal") && (this.user = this.portal?.user), (e.has("portal") || e.has("user")) && this.portal && this.user) {
@@ -175,13 +176,13 @@ class X extends C {
175
176
  }
176
177
  if (e.has("linkedAccounts") || e.has("signedInStatus")) {
177
178
  if (this.signout) {
178
- const { signedInStatus: s, linkedAccounts: t, portal: n, signoutOptions: i, clientId: a } = this, o = Object.keys(s).filter((p) => s[p] !== null).map((p) => t.find((w) => w.username === p));
179
+ const { signedInStatus: s, linkedAccounts: t, portal: i, signoutOptions: n, clientId: a } = this, o = Object.keys(s).filter((p) => s[p] !== null).map((p) => t.find((w) => w.username === p));
179
180
  this.remainingSignouts = o.length + 1;
180
- const c = g(n.urlKey ?? "", n), u = `${c}/sharing/rest`;
181
- let { displaySignoutComplete: l = !0, redirectToClientUri: h = !0 } = i;
182
- o.length > 0 && (l = !1, h = !1), this.loading = !0, A({ displaySignoutComplete: l, redirectToClientUri: h, clientId: a, config: { baseUrl: c, restBaseUrl: u } }), this.signoutHandle = window.setTimeout(() => {
183
- this.remainingSignouts -= 1, this.finishSignout({ accountOrigin: c, redirectToClientUri: h, displaySignoutComplete: l });
184
- }, J);
181
+ const c = h(i.urlKey ?? "", i), u = `${c}/sharing/rest`;
182
+ let { displaySignoutComplete: l = !0, redirectToClientUri: g = !0 } = n;
183
+ o.length > 0 && (l = !1, g = !1), this.loading = !0, A({ displaySignoutComplete: l, redirectToClientUri: g, clientId: a, config: { baseUrl: c, restBaseUrl: u } }), this.signoutHandle = window.setTimeout(() => {
184
+ this.remainingSignouts -= 1, this.finishSignout({ accountOrigin: c, redirectToClientUri: g, displaySignoutComplete: l });
185
+ }, D);
185
186
  }
186
187
  return;
187
188
  }
@@ -215,46 +216,46 @@ class X extends C {
215
216
  }
216
217
  }
217
218
  handleSignoutMessage(e) {
218
- const { error: s, signout: t, accountOrigin: n, redirectToClientUri: i, displaySignoutComplete: a } = e.data;
219
+ const { error: s, signout: t, accountOrigin: i, redirectToClientUri: n, displaySignoutComplete: a } = e.data;
219
220
  if (this.remainingSignouts -= 1, s && s !== "unknown") {
220
221
  console.error(s), this.showAlert("danger", this.messages.errors.signout);
221
222
  return;
222
223
  }
223
- t && (this.user = void 0, this.credential = void 0, this.finishSignout({ accountOrigin: n, redirectToClientUri: i, displaySignoutComplete: a }));
224
+ t && (this.user = void 0, this.credential = void 0, this.finishSignout({ accountOrigin: i, redirectToClientUri: n, displaySignoutComplete: a }));
224
225
  }
225
226
  handleSigninMessage(e) {
226
- const { messages: s, clientId: t } = this, { error: n, status: i, state: a, access_token: o, ssl: c } = e.data;
227
- if (n) {
228
- console.error(n), this.showAlert("danger", s.errors.signin);
227
+ const { messages: s, clientId: t } = this, { error: i, status: n, state: a, access_token: o, ssl: c } = e.data;
228
+ if (i) {
229
+ console.error(i), this.showAlert("danger", s.errors.signin);
229
230
  return;
230
231
  }
231
- if (i === "success") {
232
- const { portal: u, user: l } = this, h = this.linkedAccounts.find((b) => b.username === a.user);
233
- h?.orgUrlKey === this.portal.urlKey && f.findCredential(`https://${u.portalHostname}`, l?.username)?.destroy();
234
- const p = {
232
+ if (n === "success") {
233
+ const { portal: u, user: l, redirectUri: g } = this, p = this.linkedAccounts.find((I) => I.username === a.user);
234
+ p?.orgUrlKey === this.portal.urlKey && f.findCredential(`https://${u.portalHostname}`, l?.username)?.destroy();
235
+ const w = {
235
236
  server: a.portalUrl,
236
237
  userId: a.user,
237
238
  token: o,
238
239
  expires: Number(e.data.expires_in) + Date.now(),
239
240
  ssl: c === void 0 || c !== "false"
240
241
  };
241
- f.registerToken(p);
242
- const w = z({
243
- account: h,
244
- credential: p,
245
- // eslint-disable-next-line @typescript-eslint/naming-convention
246
- client_id: t,
247
- portal: u
242
+ f.registerToken(w);
243
+ const b = F({
244
+ account: p,
245
+ credential: w,
246
+ clientId: t,
247
+ portal: u,
248
+ redirectUri: g
248
249
  });
249
- window.self !== window.top ? window.top?.postMessage({ type: "navigate", url: w }) : window.location.href = w;
250
+ window.self !== window.top ? window.top?.postMessage({ type: "navigate", url: b }) : window.location.href = b;
250
251
  }
251
252
  }
252
253
  handleCheckSignInStatusMessage(e) {
253
- const { success: s, orgKey: t, server: n, userId: i, token: a, expires: o, ssl: c } = e.data;
254
- t && n && s && i && a && o && c !== void 0 && (this.signedInStatus[i] = { token: a, expires: o, ssl: c });
254
+ const { success: s, orgKey: t, server: i, userId: n, token: a, expires: o, ssl: c } = e.data;
255
+ t && i && s && n && a && o && c !== void 0 && (this.signedInStatus[n] = { token: a, expires: o, ssl: c });
255
256
  }
256
257
  async handleLinkUserMessage(e) {
257
- const { error: s, username: t, access_token: n } = e.data, { portal: i, user: a, linkedAccounts: o, messages: c } = this;
258
+ const { error: s, username: t, access_token: i } = e.data, { portal: n, user: a, linkedAccounts: o, messages: c } = this;
258
259
  if (s) {
259
260
  if (s.toString().toLowerCase().includes("user denied your request"))
260
261
  return;
@@ -269,12 +270,12 @@ class X extends C {
269
270
  this.showAlert("danger", m(c.errors.alreadyLinked, { username: t }));
270
271
  return;
271
272
  }
272
- const u = await K(i, t, n);
273
+ const u = await N(n, t, i);
273
274
  if (u?.length) {
274
- this.userAccounts = u, this.targetUser = t ?? "", this.targetToken = n ?? "", this.showAssociatedAccountsWarning = !0;
275
+ this.userAccounts = u, this.targetUser = t ?? "", this.targetToken = i ?? "", this.showAssociatedAccountsWarning = !0;
275
276
  return;
276
277
  }
277
- this.linkAccount(t, n);
278
+ this.linkAccount(t, i);
278
279
  }
279
280
  handleExchangeTokenMessage(e) {
280
281
  const s = typeof e.data == "string" ? JSON.parse(e.data) : e.data;
@@ -282,10 +283,10 @@ class X extends C {
282
283
  if (s.error)
283
284
  console.error(s);
284
285
  else if (s.status === "success" && this.targetUser) {
285
- const { portal: t, linkedAccounts: n, targetUser: i, clientId: a } = this, o = n.find((p) => p.username === i);
286
+ const { portal: t, linkedAccounts: i, targetUser: n, clientId: a } = this, o = i.find((p) => p.username === n);
286
287
  if (!o)
287
288
  return;
288
- const c = O(o, t), u = g(o.orgUrlKey, t), l = new URLSearchParams({
289
+ const c = _(o, t), u = h(o.orgUrlKey, t), l = new URLSearchParams({
289
290
  // eslint-disable-next-line @typescript-eslint/naming-convention
290
291
  response_type: "token",
291
292
  // eslint-disable-next-line @typescript-eslint/naming-convention
@@ -293,8 +294,8 @@ class X extends C {
293
294
  // eslint-disable-next-line @typescript-eslint/naming-convention
294
295
  redirect_uri: c,
295
296
  state: JSON.stringify({ user: o.username, portalUrl: u })
296
- }), h = `${y(o, t)}?${l.toString()}`;
297
- window.opener ? (window.opener.location.href = h, window.close()) : window.location.href = h;
297
+ }), g = `${y(o, t)}?${l.toString()}`;
298
+ window.opener ? (window.opener.location.href = g, window.close()) : window.location.href = g;
298
299
  }
299
300
  }
300
301
  }
@@ -306,41 +307,41 @@ class X extends C {
306
307
  this.linkedAccounts = [], this.loading = !1;
307
308
  return;
308
309
  }
309
- this.linkedAccounts = await N(this.portal, this.user), this.linkedAccounts.length && (this.signedInStatus = this.linkedAccounts.filter((e) => e.orgUrlKey !== this.portal.urlKey).reduce((e, s) => (e[s.username] = Q(s, this.portal) ?? null, e), {}), this.accountAccess = q({ accounts: this.linkedAccounts, clientId: this.clientId })), this.loading = !1;
310
+ this.linkedAccounts = await E(this.portal, this.user), this.linkedAccounts.length && (this.signedInStatus = this.linkedAccounts.filter((e) => e.orgUrlKey !== this.portal.urlKey).reduce((e, s) => (e[s.username] = V(s, this.portal) ?? null, e), {}), this.accountAccess = z({ accounts: this.linkedAccounts, clientId: this.clientId })), this.loading = !1;
310
311
  }
311
312
  async linkAccount(e, s) {
312
- const { portal: t, user: n } = this;
313
- if (!t || !n)
313
+ const { portal: t, user: i } = this;
314
+ if (!t || !i)
314
315
  return;
315
- const i = await E({ portal: t, user: n, targetUser: e, targetToken: s }), { messages: a } = this;
316
- if (i.error) {
316
+ const n = await H({ portal: t, user: i, targetUser: e, targetToken: s }), { messages: a } = this;
317
+ if (n.error) {
317
318
  this.showAlert("danger", m(a.errors.linkAccount, { username: e })), this.targetUser = "", this.userAccounts = [];
318
319
  return;
319
320
  }
320
321
  const o = this.userAccounts?.length ? a.success.linkAccountMultiple : a.success.linkAccount;
321
- this.showAlert("success", m(o, { username: e })), this.targetUser = "", this.userAccounts = [], await P(350), this.findLinkedUsers();
322
+ this.showAlert("success", m(o, { username: e })), this.targetUser = "", this.userAccounts = [], await W(350), this.findLinkedUsers();
322
323
  }
323
324
  async unlinkAccount(e) {
324
325
  if (!this.portal || !this.user)
325
326
  return;
326
- const { messages: s, portal: t, user: n } = this, { success: i } = await H({ portal: t, user: n, linkedUsername: e.username });
327
- i ? this.showAlert("success", m(s.success.unlinkAccount, { username: e.username })) : this.showAlert("danger", m(s.errors.unlinkAccount, { username: e.username })), await this.findLinkedUsers();
327
+ const { messages: s, portal: t, user: i } = this, { success: n } = await P({ portal: t, user: i, linkedUsername: e.username });
328
+ n ? this.showAlert("success", m(s.success.unlinkAccount, { username: e.username })) : this.showAlert("danger", m(s.errors.unlinkAccount, { username: e.username })), await this.findLinkedUsers();
328
329
  }
329
330
  startAccountLink() {
330
- D(this.portal);
331
+ j(this.portal);
331
332
  }
332
333
  switchAccount(e) {
333
- const { portal: s, user: t, clientId: n } = this;
334
+ const { portal: s, user: t, clientId: i } = this;
334
335
  if (!s || !t || !e)
335
336
  return;
336
- const i = g(t.sourceJSON.orgUrlKey ?? "", s), a = f.findCredential(i, t.id || t.username);
337
- a && A({ config: { baseUrl: i, restBaseUrl: `${i}/sharing/rest` }, token: a?.token, clientId: n }), j(e, s, n);
337
+ const n = h(t.sourceJSON.orgUrlKey ?? "", s), a = f.findCredential(n, t.id || t.username);
338
+ a && A({ config: { baseUrl: n, restBaseUrl: `${n}/sharing/rest` }, token: a?.token, clientId: i }), q(e, s, i);
338
339
  }
339
340
  signoutAll(e) {
340
- const { portal: s, signedInStatus: t, clientId: n } = this;
341
- e.forEach((i) => {
342
- const a = g(i.orgUrlKey, s), o = `${a}/sharing/rest`, c = t[i.username];
343
- A({ config: { baseUrl: a, restBaseUrl: o }, token: c?.token, clientId: n });
341
+ const { portal: s, signedInStatus: t, clientId: i } = this;
342
+ e.forEach((n) => {
343
+ const a = h(n.orgUrlKey, s), o = `${a}/sharing/rest`, c = t[n.username];
344
+ A({ config: { baseUrl: a, restBaseUrl: o }, token: c?.token, clientId: i });
344
345
  });
345
346
  }
346
347
  showAlert(e, s, t) {
@@ -369,33 +370,33 @@ class X extends C {
369
370
  };
370
371
  }
371
372
  render() {
372
- const { linkedAccounts: e, accountAccess: s, user: t, portal: n, messages: i, signout: a } = this;
373
- if (!n || !t)
373
+ const { linkedAccounts: e, accountAccess: s, user: t, portal: i, messages: n, signout: a } = this;
374
+ if (!i || !t)
374
375
  return null;
375
376
  if (a) {
376
377
  const { signedInAccounts: o } = this;
377
- return o.length === 0 ? d`<calcite-loader .label=${i.signingOut} .text=${i.signingOut}></calcite-loader>` : d`<arcgis-portal-account-switcher-signout .portal=${n} .signedInAccounts=${o} @arcgisSwitchAccount=${(c) => {
378
+ return o.length === 0 ? d`<calcite-loader .label=${n.signingOut} .text=${n.signingOut}></calcite-loader>` : d`<arcgis-portal-account-switcher-signout .portal=${i} .signedInAccounts=${o} @arcgisSwitchAccount=${(c) => {
378
379
  this.switchAccount(c.detail.account);
379
380
  }} @arcgisSignOutAll=${() => {
380
381
  this.signoutAll(o);
381
382
  }}></arcgis-portal-account-switcher-signout>`;
382
383
  }
383
- return d`<calcite-dialog .heading=${i.switchAccounts} heading-level=2 scale=m width=s open modal .loading=${this.loading} outside-close-disabled @calciteDialogClose=${() => {
384
+ return d`<calcite-dialog .heading=${n.switchAccounts} heading-level=2 scale=m width=s open modal .loading=${this.loading} outside-close-disabled @calciteDialogClose=${() => {
384
385
  this.arcgisClose.emit();
385
- }}><calcite-block .heading=${i.currentAccount} heading-level=3 .description=${i.signedInAs} expanded class="current-account-block" tabindex=-1>${_(t.id ?? t.username, d`<calcite-block class="current-account" .label=${n.urlKey ? `${t.username}, ${n.name}` : t.username} heading-level=4 .heading=${t.username} .description=${n.urlKey ? `${t.fullName ?? t.username}, ${n.name}` : t.fullName ?? t.username}><calcite-avatar slot=content-start inert .fullName=${t.fullName ?? void 0} .username=${t.username} .userId=${t.id} .thumbnail=${R(t, n) ?? void 0}></calcite-avatar></calcite-block>`)}</calcite-block>${e.length > 0 ? d`<calcite-block .heading=${i.linkedAccounts} heading-level=3 .description=${i.linkedAccountActions} expanded class="linked-accounts-block"><calcite-button slot=content-end icon-start=plus class="link-account-button" @click=${() => this.startAccountLink()} .disabled=${e.length >= $}>${i.addAccount}</calcite-button><arcgis-portal-account-switcher-list .portal=${n} .linkedAccounts=${e} .accountAccess=${s} .signedInUsers=${Object.keys(this.signedInStatus).filter((o) => this.signedInStatus[o] !== null)} interactive @arcgisAccountSwitch=${(o) => {
386
+ }}><calcite-block .heading=${n.currentAccount} heading-level=3 .description=${n.signedInAs} expanded class="current-account-block" tabindex=-1>${C(t.id ?? t.username, d`<calcite-block class="current-account" .label=${i.urlKey ? `${t.username}, ${i.name}` : t.username} heading-level=4 .heading=${t.username} .description=${i.urlKey ? `${t.fullName ?? t.username}, ${i.name}` : t.fullName ?? t.username}><calcite-avatar slot=content-start inert .fullName=${t.fullName ?? void 0} .username=${t.username} .userId=${t.id} .thumbnail=${J(t, i) ?? void 0}></calcite-avatar></calcite-block>`)}</calcite-block>${e.length > 0 ? d`<calcite-block .heading=${n.linkedAccounts} heading-level=3 .description=${n.linkedAccountActions} expanded class="linked-accounts-block"><calcite-button slot=content-end icon-start=plus class="link-account-button" @click=${() => this.startAccountLink()} .disabled=${e.length >= $}>${n.addAccount}</calcite-button><arcgis-portal-account-switcher-list .portal=${i} .linkedAccounts=${e} .accountAccess=${s} .signedInUsers=${Object.keys(this.signedInStatus).filter((o) => this.signedInStatus[o] !== null)} interactive @arcgisAccountSwitch=${(o) => {
386
387
  this.switchAccount(o.detail.account);
387
388
  }} @arcgisAccountUnlink=${(o) => {
388
389
  this.showUnlinkConfirmation(o.detail.account);
389
- }}></arcgis-portal-account-switcher-list></calcite-block>` : d`<calcite-block .heading=${i.linkedAccounts} heading-level=3 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>${T`<path d=${B.couple ?? x} fill=currentColor />`}</svg><h4>${i.emptyListTitle}</h4><p>${i.emptyList}</p><calcite-button icon-start=plus class="link-account-button" @click=${() => this.startAccountLink()} .disabled=${e.length >= $}>${i.linkAccount}</calcite-button></div></calcite-block>`}<calcite-notice kind=info .open=${e.length >= $}><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=${() => {
390
+ }}></arcgis-portal-account-switcher-list></calcite-block>` : d`<calcite-block .heading=${n.linkedAccounts} heading-level=3 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>${M`<path d=${R.couple ?? T} fill=currentColor />`}</svg><h4>${n.emptyListTitle}</h4><p>${n.emptyList}</p><calcite-button icon-start=plus class="link-account-button" @click=${() => this.startAccountLink()} .disabled=${e.length >= $}>${n.linkAccount}</calcite-button></div></calcite-block>`}<calcite-notice kind=info .open=${e.length >= $}><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=${() => {
390
391
  this.alertOptions = void 0;
391
- }}>${this.alertOptions?.title && d`<h4 slot=title class="alert-title">${this.alertOptions.title}</h4>` || ""}${this.alertOptions?.message && d`<p slot=message class=${v({ "alert-message": !0, "short-message": !!this.alertOptions?.actions?.length })}>${this.alertOptions.message}</p>` || ""}${this.alertOptions?.actions?.map((o) => d`<calcite-button slot=actions-end .kind=${o.kind} .appearance=${o.appearance} @click=${o.clickHandler}>${o.text}</calcite-button>`)}</calcite-alert></calcite-dialog>${this.showAssociatedAccountsWarning && d`<arcgis-portal-account-switcher-accounts .portal=${n} .targetUser=${this.targetUser} .accounts=${this.userAccounts ?? []} @arcgisLinkAll=${() => {
392
+ }}>${this.alertOptions?.title && d`<h4 slot=title class="alert-title">${this.alertOptions.title}</h4>` || ""}${this.alertOptions?.message && d`<p slot=message class=${x({ "alert-message": !0, "short-message": !!this.alertOptions?.actions?.length })}>${this.alertOptions.message}</p>` || ""}${this.alertOptions?.actions?.map((o) => d`<calcite-button slot=actions-end .kind=${o.kind} .appearance=${o.appearance} @click=${o.clickHandler}>${o.text}</calcite-button>`)}</calcite-alert></calcite-dialog>${this.showAssociatedAccountsWarning && d`<arcgis-portal-account-switcher-accounts .portal=${i} .targetUser=${this.targetUser} .accounts=${this.userAccounts ?? []} @arcgisLinkAll=${() => {
392
393
  this.linkAccount(this.targetUser, this.targetToken);
393
394
  }} @arcgisCloseDialog=${() => {
394
395
  this.showAssociatedAccountsWarning = !1;
395
396
  }}></arcgis-portal-account-switcher-accounts>` || ""}`;
396
397
  }
397
398
  }
398
- L("arcgis-portal-account-switcher", X);
399
+ L("arcgis-portal-account-switcher", Y);
399
400
  export {
400
- X as ArcgisPortalAccountSwitcher
401
+ Y as ArcgisPortalAccountSwitcher
401
402
  };
@@ -0,0 +1,128 @@
1
+ /// <reference path="../../index.d.ts" />
2
+ import type PortalItem from "@arcgis/core/portal/PortalItem.js";
3
+ import type Portal from "@arcgis/core/portal/Portal.js";
4
+ import type PortalUser from "@arcgis/core/portal/PortalUser.js";
5
+ import type { PublicLitElement as LitElement } from "@arcgis/lumina";
6
+ import type { DeleteItemResponse } from "./services.js";
7
+ import type { T9nMeta } from "@arcgis/lumina/controllers";
8
+
9
+ /**
10
+ * Displays a confirmation dialog for deleting portal items.
11
+ *
12
+ * @internal
13
+ */
14
+ export abstract class ArcgisPortalDeleteItems extends LitElement {
15
+ /**
16
+ * Whether or not the delete items modal is open.
17
+ *
18
+ * @default true
19
+ */
20
+ accessor active: boolean;
21
+ /**
22
+ * If true, the selected items do not contain links to item details.
23
+ * Generally used when already on item details, or if it's already known
24
+ * that an item does not exist.
25
+ *
26
+ * @default false
27
+ */
28
+ accessor disableLinks: boolean;
29
+ /** The portal items to delete. */
30
+ accessor items: PortalItem[];
31
+ /** @internal */
32
+ protected messages: {
33
+ deleteItem: string;
34
+ deleteItems: string;
35
+ delete: string;
36
+ cancel: string;
37
+ moreInfo: string;
38
+ bucketItems: string;
39
+ directlyUsedBy: string;
40
+ usedByOtherItems: {
41
+ single: string;
42
+ multiple: string;
43
+ unknown: string;
44
+ };
45
+ usedByPopover: string;
46
+ deleteDiscouraged: string;
47
+ learnMoreAboutDeletingSourceItems: string;
48
+ reviewRelatedItems: {
49
+ single: string;
50
+ multiple: string;
51
+ };
52
+ reviewItems: string;
53
+ reviewImpactedItems: string;
54
+ summary: {
55
+ willBeRecycled: string;
56
+ cannotDelete: string;
57
+ permanentlyDelete: string;
58
+ canBeRecovered: { single: string; };
59
+ permanentDelete: { notSupported: { single: string; }; };
60
+ protectedGroup: {
61
+ deleteProtectedDescription: string;
62
+ hasDependentItemsDescription: { singleOneDependentItem: string; };
63
+ };
64
+ };
65
+ areYouSure: { multiple: string; };
66
+ } & T9nMeta<{
67
+ deleteItem: string;
68
+ deleteItems: string;
69
+ delete: string;
70
+ cancel: string;
71
+ moreInfo: string;
72
+ bucketItems: string;
73
+ directlyUsedBy: string;
74
+ usedByOtherItems: {
75
+ single: string;
76
+ multiple: string;
77
+ unknown: string;
78
+ };
79
+ usedByPopover: string;
80
+ deleteDiscouraged: string;
81
+ learnMoreAboutDeletingSourceItems: string;
82
+ reviewRelatedItems: {
83
+ single: string;
84
+ multiple: string;
85
+ };
86
+ reviewItems: string;
87
+ reviewImpactedItems: string;
88
+ summary: {
89
+ willBeRecycled: string;
90
+ cannotDelete: string;
91
+ permanentlyDelete: string;
92
+ canBeRecovered: { single: string; };
93
+ permanentDelete: { notSupported: { single: string; }; };
94
+ protectedGroup: {
95
+ deleteProtectedDescription: string;
96
+ hasDependentItemsDescription: { singleOneDependentItem: string; };
97
+ };
98
+ };
99
+ areYouSure: { multiple: string; };
100
+ }>;
101
+ /** The portal instance. */
102
+ accessor portal: Portal;
103
+ /** The user performing deletion. */
104
+ accessor user: PortalUser | null | undefined;
105
+ /** Emitted when the user cancels the deletion. */
106
+ readonly arcgisCancel: import("@arcgis/lumina").TargetedEvent<this, void>;
107
+ /** Emitted when the user confirms the deletion. */
108
+ readonly arcgisConfirm: import("@arcgis/lumina").TargetedEvent<this, DeleteItemsPayload>;
109
+ /** Emitted when an error occurs during deletion. */
110
+ readonly arcgisError: import("@arcgis/lumina").TargetedEvent<this, DeleteItemsPayload>;
111
+ readonly "@eventTypes": {
112
+ arcgisCancel: ArcgisPortalDeleteItems["arcgisCancel"]["detail"];
113
+ arcgisConfirm: ArcgisPortalDeleteItems["arcgisConfirm"]["detail"];
114
+ arcgisError: ArcgisPortalDeleteItems["arcgisError"]["detail"];
115
+ };
116
+ }
117
+
118
+ /** @internal */
119
+ export interface DeleteItemsPayload {
120
+ deletedItems: DeleteItemResponse[] | null;
121
+ permanentlyDeletedItems: DeleteItemResponse[] | null;
122
+ /**
123
+ * Optional overrides for the number of items deleted.
124
+ * Needed if composite items are included for delete, because they are not part of the `/deleteItems` response
125
+ */
126
+ deletedItemsCount?: number;
127
+ permanentlyDeletedItemsCount?: number;
128
+ }