@ebrains/vue 0.5.0-alpha.0 → 0.7.0-alpha.0
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/{analytics-1cde8e4a-BDRcCMlV.mjs → analytics-44b1416b-3vYuu4Xs.mjs} +10 -6
- package/analytics-44b1416b-ol77SdQE.js +1 -0
- package/{color-primary-palette_6.entry-CgeStD0V.mjs → color-primary-palette_6.entry-BDyyrFB5.mjs} +17 -17
- package/color-primary-palette_6.entry-BhxgE7ff.js +1 -0
- package/correct-use-of-colors.entry-DXASqwFp.js +1 -0
- package/correct-use-of-colors.entry-z7k3YWpg.mjs +59 -0
- package/{eds-alert_17.entry-BfpBSBVW.js → eds-accordion_22.entry-LksMmZ4o.js} +16031 -2217
- package/{eds-alert_17.entry-IJq6baZd.mjs → eds-accordion_22.entry-Lqf1NKBk.mjs} +17319 -3219
- package/eds-alert.entry-BqjTTCgj.mjs +688 -0
- package/eds-alert.entry-DZcz_4Dj.js +608 -0
- package/eds-app-root.entry-Cz-9z7Za.js +1 -0
- package/eds-app-root.entry-DobAtes_.mjs +25 -0
- package/{eds-avatar_4.entry-B7CV7v_n.mjs → eds-avatar_4.entry-BYrgwmj2.mjs} +21 -26
- package/{eds-avatar_4.entry-D1CDRW_R.js → eds-avatar_4.entry-Bqr0d5Cj.js} +2 -2
- package/eds-breadcrumb.entry-N3NSBwJL.mjs +104 -0
- package/eds-breadcrumb.entry-elqbS74P.js +1 -0
- package/eds-card-generic.entry-D5pTUUco.js +1 -0
- package/{eds-card-generic.entry-DIHPUjbI.mjs → eds-card-generic.entry-zKJ2hHOe.mjs} +9 -16
- package/{eds-card-project.entry-C2dWgXXW.mjs → eds-card-project.entry-DDo4ZJs8.mjs} +2 -2
- package/{eds-card-project.entry-CunHqbYK.js → eds-card-project.entry-e4n5lQbW.js} +1 -1
- package/eds-card-section.entry-C8nt6j3h.mjs +30 -0
- package/eds-card-section.entry-CeznIbCo.js +1 -0
- package/{eds-card-tags.entry-CQS5AtAg.js → eds-card-tags.entry-Bl3YXNtv.js} +1 -1
- package/{eds-card-tags.entry-C6jjLiGA.mjs → eds-card-tags.entry-Do9kx7rP.mjs} +1 -1
- package/{eds-card-tool.entry-Bi8w0xds.mjs → eds-card-tool.entry-BewNCjRU.mjs} +2 -2
- package/{eds-card-tool.entry-DJA23zJf.js → eds-card-tool.entry-DnVIn9BX.js} +1 -1
- package/{eds-card-wrapper.entry-BKPCc7ci.js → eds-card-wrapper.entry-BzKcrwEf.js} +1 -1
- package/{eds-card-wrapper.entry-UPnkq2JI.mjs → eds-card-wrapper.entry-DMj1bZ4i.mjs} +1 -1
- package/{eds-code-block.entry-Ckb3jisn.js → eds-code-block.entry-DUeN87Fw.js} +1 -1
- package/{eds-code-block.entry-BZTLGjqq.mjs → eds-code-block.entry-fqrA-Frf.mjs} +1 -1
- package/{eds-components-section.entry-D1ovrn93.mjs → eds-components-section.entry-BgfCSxk1.mjs} +2 -2
- package/{eds-components-section.entry-B3WrdIfL.js → eds-components-section.entry-CLJMns6h.js} +2 -2
- package/eds-cookies-preference.entry-B1a8qild.mjs +20 -0
- package/eds-cookies-preference.entry-BGx0tglE.js +1 -0
- package/{eds-docs-palettes.entry-Bk77Xn04.js → eds-docs-palettes.entry-C1EcBwSy.js} +1 -1
- package/{eds-docs-palettes.entry-lpT0ypSs.mjs → eds-docs-palettes.entry-TXbXKJJN.mjs} +2 -2
- package/{eds-docs-tokens.entry-Bi35zxEM.mjs → eds-docs-tokens.entry-B1xc8BFa.mjs} +2 -2
- package/{eds-docs-tokens.entry-DCHw-jrS.js → eds-docs-tokens.entry-BJVBVsOy.js} +1 -1
- package/eds-dropdown.entry-CMK8E_J2.mjs +83 -0
- package/eds-dropdown.entry-FqX7fOIb.js +1 -0
- package/eds-feedback.entry-B-Lue8P0.js +1 -0
- package/eds-feedback.entry-fz73-syB.mjs +53 -0
- package/{eds-form.entry-a52cYx3b.js → eds-form.entry-0saB-Hm9.js} +2 -2
- package/{eds-form.entry-xm937wbh.mjs → eds-form.entry-BB1gfXVy.mjs} +174 -159
- package/eds-frame.entry-BvJCKWMT.mjs +73 -0
- package/eds-frame.entry-dX3nZxD0.js +1 -0
- package/{eds-icon-arrow-diagonal.entry-kClkB8LF.mjs → eds-icon-arrow-diagonal.entry-BD3xdvR4.mjs} +2 -2
- package/{eds-icon-arrow-diagonal.entry-fzsCJiPP.js → eds-icon-arrow-diagonal.entry-DkQFuVkT.js} +1 -1
- package/eds-icon-arrow-right.entry-BH0zDB1H.js +1 -0
- package/eds-icon-arrow-right.entry-Diax6KZB.mjs +13 -0
- package/{eds-icon-bluesky.entry-7tzCZSoL.js → eds-icon-bluesky.entry-CDZCjWCh.js} +1 -1
- package/eds-icon-bluesky.entry-DwvxMR1q.mjs +13 -0
- package/{eds-icon-chevron-down.entry-BUG6E9eR.js → eds-icon-chevron-down.entry-CGsA1rJ0.js} +1 -1
- package/eds-icon-chevron-down.entry-CiJcqZuh.mjs +13 -0
- package/{eds-icon-chevron-left.entry-Vq-R3b59.mjs → eds-icon-chevron-left.entry-Dt2WsKob.mjs} +2 -2
- package/{eds-icon-chevron-left.entry-BT-KYjSo.js → eds-icon-chevron-left.entry-nBBudzCb.js} +1 -1
- package/{eds-icon-chevron-right.entry-B1qzmGrD.mjs → eds-icon-chevron-right.entry-BG7_qznz.mjs} +2 -2
- package/{eds-icon-chevron-right.entry-BmU_I0Y1.js → eds-icon-chevron-right.entry-CjhJFKog.js} +1 -1
- package/eds-icon-chevron-up.entry-DfsbHKk1.mjs +13 -0
- package/eds-icon-chevron-up.entry-Dy81hGw-.js +1 -0
- package/eds-icon-close.entry-CpGzc34L.mjs +13 -0
- package/{eds-icon-close.entry-DS7BLTzl.js → eds-icon-close.entry-DNhXNl8O.js} +1 -1
- package/eds-icon-copy.entry-CsD2FpUS.mjs +13 -0
- package/eds-icon-copy.entry-DD2HXgFK.js +1 -0
- package/eds-icon-eu.entry-BRuCbl7O.mjs +13 -0
- package/eds-icon-eu.entry-ChKv8iZB.js +1 -0
- package/{eds-icon-facebook.entry-B9szoikj.mjs → eds-icon-facebook.entry--ctHhWkj.mjs} +2 -2
- package/{eds-icon-facebook.entry-knUdck2t.js → eds-icon-facebook.entry-Bjkse_bn.js} +1 -1
- package/{eds-icon-gitlab.entry-IO7f4hgL.mjs → eds-icon-gitlab.entry-BDqNL5zl.mjs} +2 -2
- package/{eds-icon-gitlab.entry-pKxaKA0B.js → eds-icon-gitlab.entry-DUQcgTMM.js} +1 -1
- package/eds-icon-linkedin.entry-Cq13-Zdb.mjs +13 -0
- package/{eds-icon-linkedin.entry-BD__kbDV.js → eds-icon-linkedin.entry-D-D3hmxE.js} +1 -1
- package/eds-icon-loader.entry-DgpUjCng.mjs +13 -0
- package/eds-icon-loader.entry-rKBBXz_C.js +1 -0
- package/{eds-icon-mastodon.entry-7152lwgd.js → eds-icon-mastodon.entry-CCn_r682.js} +1 -1
- package/eds-icon-mastodon.entry-OpdPcGQ7.mjs +13 -0
- package/eds-icon-menu.entry-B3mQ8ma1.mjs +13 -0
- package/{eds-icon-menu.entry-BVU8htgo.js → eds-icon-menu.entry-DUxzhro5.js} +1 -1
- package/{eds-icon-more.entry-lossstHZ.js → eds-icon-more.entry-CBDi0LJC.js} +1 -1
- package/{eds-icon-more.entry-KE6_EsAg.mjs → eds-icon-more.entry-CDDxBiBM.mjs} +2 -2
- package/eds-icon-search.entry-Bok3Oo0Q.js +1 -0
- package/eds-icon-search.entry-CvnFqzlk.mjs +13 -0
- package/eds-icon-star.entry-BRQ07hMQ.mjs +13 -0
- package/eds-icon-star.entry-CkeEbwgJ.js +1 -0
- package/{eds-icon-success.entry-CRu9Ssdi.js → eds-icon-success.entry-DA4C5Hwg.js} +1 -1
- package/eds-icon-success.entry-nWUVTFzX.mjs +13 -0
- package/eds-icon-thumbs-down.entry-BqEOrmiW.js +1 -0
- package/eds-icon-thumbs-down.entry-Dme-Ippn.mjs +13 -0
- package/eds-icon-thumbs-up.entry-Dkqv6r_x.js +1 -0
- package/eds-icon-thumbs-up.entry-Dp-eslmx.mjs +13 -0
- package/eds-icon-twitter.entry-BcZ2atce.js +1 -0
- package/eds-icon-twitter.entry-CqalD8Wf.mjs +13 -0
- package/eds-icon-user.entry-DU8EF-lQ.mjs +13 -0
- package/{eds-icon-user.entry-DkRLDrdp.js → eds-icon-user.entry-DpvoOnVA.js} +1 -1
- package/{eds-icon-youtube.entry-DL5fWU8k.js → eds-icon-youtube.entry-DbPAn4pN.js} +1 -1
- package/{eds-icon-youtube.entry-CRRGbDsw.mjs → eds-icon-youtube.entry-vFg7QtYg.mjs} +2 -2
- package/eds-login_2.entry-6Hxmqih9.js +9 -0
- package/{keycloak-d502ec16-Ce0iGqyk.mjs → eds-login_2.entry-DD8g9nqu.mjs} +288 -210
- package/eds-logo-variations.entry-CDTTH-iG.mjs +22 -0
- package/{eds-logo-variations.entry-BnB25dDH.js → eds-logo-variations.entry-dLBnZPi7.js} +1 -1
- package/{eds-modal.entry-CCy9SRVR.mjs → eds-modal.entry-CV3bf08X.mjs} +17 -5
- package/{eds-modal.entry-B9gXEOjT.js → eds-modal.entry-DJybVbNk.js} +1 -1
- package/{eds-progress-bar.entry-D56TNSGj.js → eds-progress-bar.entry-23-I0rSz.js} +1 -1
- package/{eds-progress-bar.entry-BtI2_94Z.mjs → eds-progress-bar.entry-BP6AqtI7.mjs} +2 -2
- package/eds-rating.entry-CHo7h3Y4.mjs +61 -0
- package/eds-rating.entry-dDYfYR7o.js +1 -0
- package/{eds-section-core_2.entry-BmbK_RfT.js → eds-section-core_2.entry-BdnBCBit.js} +1 -1
- package/{eds-section-core_2.entry-pmUkAIz7.mjs → eds-section-core_2.entry-DTItYLUC.mjs} +4 -4
- package/eds-spinner.entry-BwTZAz8I.mjs +36 -0
- package/eds-spinner.entry-CXLe8IAk.js +1 -0
- package/eds-steps.entry-Nz_XqcUl.mjs +28 -0
- package/eds-steps.entry-ceVyrSe-.js +1 -0
- package/{eds-svg-repository.entry-DZ1FMRrQ.js → eds-svg-repository.entry-CKQ6S13R.js} +13 -13
- package/{eds-svg-repository.entry-B3xCCFOp.mjs → eds-svg-repository.entry-DoYT85te.mjs} +54 -48
- package/eds-switch.entry-4a3DLV-c.js +1 -0
- package/eds-switch.entry-DjT9dev_.mjs +20 -0
- package/{eds-input_7.entry-BZ9afXqe.js → eds-tabs.entry-BYxiMlkR.mjs} +752 -41
- package/{eds-input_7.entry-WvoE_Mue.mjs → eds-tabs.entry-DJKEg0Gs.js} +649 -247
- package/eds-timeline.entry-DKx-pd67.js +1 -0
- package/eds-timeline.entry-DOSKCjPH.mjs +45 -0
- package/eds-toast-manager.entry-BV-sP7cR.mjs +36 -0
- package/eds-toast-manager.entry-BopxpC3o.js +1 -0
- package/eds-toast.entry-DDBTRdmP.mjs +61 -0
- package/eds-toast.entry-DPibhM-Z.js +3 -0
- package/{eds-tooltip.entry-CTCdKTKM.mjs → eds-tooltip.entry-B53fpM9t.mjs} +8 -8
- package/{eds-tooltip.entry-eiFlYpfl.js → eds-tooltip.entry-Cf6bse_x.js} +1 -1
- package/eds-trl.entry-C0cSVG_Q.mjs +34 -0
- package/eds-trl.entry-fYVgYPts.js +1 -0
- package/eds-user.entry-hUkYJDp4.js +1 -0
- package/eds-user.entry-qM0swzIt.mjs +26 -0
- package/{eds-vertical-stepper.entry-DpcwvOst.mjs → eds-vertical-stepper.entry-Bb6dUinj.mjs} +5 -5
- package/{eds-vertical-stepper.entry-O_GJNo8B.js → eds-vertical-stepper.entry-CvadBA1x.js} +1 -1
- package/formUtils-ac68474d-BDuxB0K8.js +1 -0
- package/formUtils-ac68474d-D2e59S7S.mjs +122 -0
- package/generated/components.d.ts +4 -1
- package/incorrect-use-of-colors.entry-B6fKAvAx.mjs +42 -0
- package/incorrect-use-of-colors.entry-DZ_SBoa8.js +1 -0
- package/index-D4alMZtT.js +21 -0
- package/{index-C-Gy1Lax.mjs → index-E1PpO1J3.mjs} +450 -386
- package/index.js +1 -1
- package/index.mjs +32 -29
- package/{logo-space.entry-D56IaLNE.js → logo-space.entry-BOh7Odfh.js} +1 -1
- package/{logo-space.entry-DERJLkyL.mjs → logo-space.entry-xGhYUj5r.mjs} +7 -7
- package/logo-variations-horizontal_2.entry-BWlXcmRe.js +7 -0
- package/logo-variations-horizontal_2.entry-CIUDEw3Y.mjs +29 -0
- package/logo-wrong-usage.entry-CtPXf-5h.js +1 -0
- package/logo-wrong-usage.entry-D4aBJ6Wk.mjs +14 -0
- package/package.json +1 -1
- package/sharedUtils-a550989c-Ci3Tx3jc.mjs +15 -0
- package/sharedUtils-a550989c-m4pF1Vqy.js +1 -0
- package/star-0da9b5e9-B3-jr0yE.js +3 -0
- package/star-0da9b5e9-DX8_iFmu.mjs +6 -0
- package/thumbs-down-a18fd049-CzuBAj99.mjs +6 -0
- package/thumbs-down-a18fd049-DTNIbYbm.js +3 -0
- package/thumbs-up-c19a71bc-CjLv5Wgw.mjs +7 -0
- package/thumbs-up-c19a71bc-w8Z8gegt.js +4 -0
- package/{token-list_3.entry-Zgzwbhio.mjs → token-list_3.entry-DJ-cqa3_.mjs} +4 -4
- package/{token-list_3.entry-C0Tohj1W.js → token-list_3.entry-DVoMZtdK.js} +1 -1
- package/{token-ratios.entry-B7ZwRluK.mjs → token-ratios.entry-FKky7w4Z.mjs} +2 -2
- package/token-ratios.entry-JS-ffZPx.js +1 -0
- package/token-spacing.entry-Cf5LP8jh.mjs +12 -0
- package/token-spacing.entry-YJWgDaTr.js +1 -0
- package/{token-typography.entry-D4bxbB2m.mjs → token-typography.entry-CKyKPdVF.mjs} +2 -2
- package/{token-typography.entry-D-PPtDvs.js → token-typography.entry-CuHfxHRU.js} +1 -1
- package/analytics-1cde8e4a-B_MD-9qW.js +0 -1
- package/color-primary-palette_6.entry-c_K7930i.js +0 -1
- package/correct-use-of-colors.entry-De5Tcxdm.mjs +0 -59
- package/correct-use-of-colors.entry-DpmXW_CD.js +0 -1
- package/eds-accordion.entry-B8TjhnWX.mjs +0 -49
- package/eds-accordion.entry-BySfMYU2.js +0 -4
- package/eds-card-generic.entry-BhLK-nyp.js +0 -1
- package/eds-card-section.entry-0n2V-MH6.js +0 -1
- package/eds-card-section.entry-Ccjil38X.mjs +0 -39
- package/eds-dropdown_2.entry-Bamjbo1o.mjs +0 -115
- package/eds-dropdown_2.entry-YEBzyKJu.js +0 -1
- package/eds-frame.entry-BnT9nQwa.js +0 -1
- package/eds-frame.entry-CU7GoLj6.mjs +0 -74
- package/eds-icon-arrow-right.entry-B75Ra6OD.js +0 -1
- package/eds-icon-arrow-right.entry-DX6A-VKL.mjs +0 -13
- package/eds-icon-bluesky.entry-BNSdVu2K.mjs +0 -13
- package/eds-icon-chevron-down.entry-BLvZ3e_N.mjs +0 -13
- package/eds-icon-chevron-up.entry-DXXRgw1V.js +0 -1
- package/eds-icon-chevron-up.entry-DuySJU_i.mjs +0 -13
- package/eds-icon-close.entry-DDxUAr21.mjs +0 -13
- package/eds-icon-copy.entry-DNa1wI4F.mjs +0 -13
- package/eds-icon-copy.entry-Nz_P5A7p.js +0 -1
- package/eds-icon-eu.entry-CLQcoimB.js +0 -1
- package/eds-icon-eu.entry-DTdf6Skc.mjs +0 -13
- package/eds-icon-linkedin.entry-CryUW1Er.mjs +0 -13
- package/eds-icon-loader.entry-B_3Sd6PB.js +0 -1
- package/eds-icon-loader.entry-CxizdRT8.mjs +0 -13
- package/eds-icon-mastodon.entry-MyM74vvm.mjs +0 -13
- package/eds-icon-menu.entry-5RRmRTxa.mjs +0 -13
- package/eds-icon-search.entry-Dg0wabdP.mjs +0 -13
- package/eds-icon-search.entry-DiYaxnYX.js +0 -1
- package/eds-icon-success.entry-_fWfddhX.mjs +0 -13
- package/eds-icon-twitter.entry-B4xPE3Vz.js +0 -1
- package/eds-icon-twitter.entry-DHFpeStb.mjs +0 -13
- package/eds-icon-user.entry-BOv2lInW.mjs +0 -13
- package/eds-login.entry-BRWK6otG.js +0 -1
- package/eds-login.entry-C0eOhlEq.mjs +0 -58
- package/eds-logo-variations.entry-Cw44vuQE.mjs +0 -22
- package/eds-matomo-notice.entry-BpwE1vQ3.js +0 -1
- package/eds-matomo-notice.entry-DsLbzeqQ.mjs +0 -91
- package/eds-navigator.entry-B9scz8p_.js +0 -1
- package/eds-navigator.entry-Dk-4UW_d.mjs +0 -33
- package/eds-pagination_2.entry-D_sngThL.js +0 -1
- package/eds-pagination_2.entry-M3CLFGN_.mjs +0 -249
- package/eds-tab.entry-Bpv6R_M0.mjs +0 -31
- package/eds-tab.entry-DjpVgaDN.js +0 -1
- package/eds-tabs-content.entry-Bj5wNmkr.js +0 -1
- package/eds-tabs-content.entry-CzwoLZzR.mjs +0 -106
- package/eds-tabs.entry-BYBPkYRs.mjs +0 -112
- package/eds-tabs.entry-Cbc9yhHL.js +0 -1
- package/eds-timeline.entry-Bq-eo4Og.js +0 -1
- package/eds-timeline.entry-DJYcN7rN.mjs +0 -51
- package/eds-trl.entry-8BXrp9SK.mjs +0 -34
- package/eds-trl.entry-DtffM-e5.js +0 -1
- package/eds-user.entry-DfBE6LuF.js +0 -1
- package/eds-user.entry-ybggwcts.mjs +0 -66
- package/incorrect-use-of-colors.entry-CDHLoNBa.js +0 -1
- package/incorrect-use-of-colors.entry-DbwiJCH0.mjs +0 -42
- package/index-D_kZU_4I.js +0 -21
- package/keycloak-d502ec16-m7LwS-Gh.js +0 -9
- package/logo-variations-horizontal_2.entry-OY3Zka_7.js +0 -7
- package/logo-variations-horizontal_2.entry-wp9D1MMl.mjs +0 -29
- package/logo-wrong-usage.entry-BniBpQrN.js +0 -1
- package/logo-wrong-usage.entry-RgKFDObE.mjs +0 -14
- package/token-ratios.entry-bO5CkZ9D.js +0 -1
- package/token-spacing.entry-BTYazF9c.js +0 -1
- package/token-spacing.entry-_yyMlwbO.mjs +0 -12
|
@@ -1,22 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { r as X, c as J, h as U, H as se } from "./index-E1PpO1J3.mjs";
|
|
2
|
+
import { t as R } from "./toastManager-d9eee791-CEYNwx25.mjs";
|
|
3
|
+
function q(d) {
|
|
4
|
+
if (!(this instanceof q))
|
|
3
5
|
throw new Error("The 'Keycloak' constructor must be invoked with 'new'.");
|
|
4
|
-
if (typeof
|
|
6
|
+
if (typeof d != "string" && !O(d))
|
|
5
7
|
throw new Error("The 'Keycloak' constructor must be provided with a configuration object, or a URL to a JSON configuration file.");
|
|
6
|
-
if (
|
|
7
|
-
const r = "oidcProvider" in
|
|
8
|
+
if (O(d)) {
|
|
9
|
+
const r = "oidcProvider" in d ? ["clientId"] : ["url", "realm", "clientId"];
|
|
8
10
|
for (const t of r)
|
|
9
|
-
if (!
|
|
11
|
+
if (!d[t])
|
|
10
12
|
throw new Error(`The configuration object is missing the required '${t}' property.`);
|
|
11
13
|
}
|
|
12
|
-
var e = this,
|
|
14
|
+
var e = this, p, v = [], _, h = {
|
|
13
15
|
enable: !0,
|
|
14
16
|
callbackList: [],
|
|
15
17
|
interval: 5
|
|
16
18
|
};
|
|
17
19
|
e.didInitialize = !1;
|
|
18
|
-
var
|
|
19
|
-
globalThis.isSecureContext ||
|
|
20
|
+
var P = !0, I = W(console.info), M = W(console.warn);
|
|
21
|
+
globalThis.isSecureContext || M(
|
|
20
22
|
`[KEYCLOAK] Keycloak JS must be used in a 'secure context' to function properly as it relies on browser APIs that are otherwise not available.
|
|
21
23
|
Continuing to run your application insecurely will lead to unexpected behavior and breakage.
|
|
22
24
|
|
|
@@ -24,9 +26,9 @@ For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/
|
|
|
24
26
|
), e.init = function(r = {}) {
|
|
25
27
|
if (e.didInitialize)
|
|
26
28
|
throw new Error("A 'Keycloak' instance can only be initialized once.");
|
|
27
|
-
e.didInitialize = !0, e.authenticated = !1,
|
|
29
|
+
e.didInitialize = !0, e.authenticated = !1, _ = ie();
|
|
28
30
|
var t = ["default", "cordova", "cordova-native"];
|
|
29
|
-
if (t.indexOf(r.adapter) > -1 ?
|
|
31
|
+
if (t.indexOf(r.adapter) > -1 ? p = N(r.adapter) : typeof r.adapter == "object" ? p = r.adapter : window.Cordova || window.cordova ? p = N("cordova") : p = N(), typeof r.useNonce < "u" && (P = r.useNonce), typeof r.checkLoginIframe < "u" && (h.enable = r.checkLoginIframe), r.checkLoginIframeInterval && (h.interval = r.checkLoginIframeInterval), r.onLoad === "login-required" && (e.loginRequired = !0), r.responseMode)
|
|
30
32
|
if (r.responseMode === "query" || r.responseMode === "fragment")
|
|
31
33
|
e.responseMode = r.responseMode;
|
|
32
34
|
else
|
|
@@ -60,10 +62,10 @@ For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/
|
|
|
60
62
|
}).catch(function(o) {
|
|
61
63
|
s.setError(o);
|
|
62
64
|
});
|
|
63
|
-
var a =
|
|
65
|
+
var a = te();
|
|
64
66
|
function c() {
|
|
65
67
|
var o = function(u) {
|
|
66
|
-
u || (
|
|
68
|
+
u || (f.prompt = "none"), r.locale && (f.locale = r.locale), e.login(f).then(function() {
|
|
67
69
|
i.setSuccess();
|
|
68
70
|
}).catch(function(m) {
|
|
69
71
|
i.setError(m);
|
|
@@ -73,16 +75,16 @@ For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/
|
|
|
73
75
|
u.setAttribute("src", m), u.setAttribute("sandbox", "allow-storage-access-by-user-activation allow-scripts allow-same-origin"), u.setAttribute("title", "keycloak-silent-check-sso"), u.style.display = "none", document.body.appendChild(u);
|
|
74
76
|
var w = function(S) {
|
|
75
77
|
if (!(S.origin !== window.location.origin || u.contentWindow !== S.source)) {
|
|
76
|
-
var
|
|
77
|
-
|
|
78
|
+
var y = E(S.data);
|
|
79
|
+
T(y, i), document.body.removeChild(u), window.removeEventListener("message", w);
|
|
78
80
|
}
|
|
79
81
|
};
|
|
80
82
|
window.addEventListener("message", w);
|
|
81
|
-
},
|
|
83
|
+
}, f = {};
|
|
82
84
|
switch (r.onLoad) {
|
|
83
85
|
case "check-sso":
|
|
84
|
-
|
|
85
|
-
|
|
86
|
+
h.enable ? K().then(function() {
|
|
87
|
+
L().then(function(u) {
|
|
86
88
|
u ? i.setSuccess() : e.silentCheckSsoRedirectUri ? l() : o(!1);
|
|
87
89
|
}).catch(function(u) {
|
|
88
90
|
i.setError(u);
|
|
@@ -97,16 +99,16 @@ For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/
|
|
|
97
99
|
}
|
|
98
100
|
}
|
|
99
101
|
function n() {
|
|
100
|
-
var o =
|
|
102
|
+
var o = E(window.location.href);
|
|
101
103
|
if (o && window.history.replaceState(window.history.state, null, o.newUrl), o && o.valid)
|
|
102
|
-
return
|
|
103
|
-
|
|
104
|
+
return K().then(function() {
|
|
105
|
+
T(o, i);
|
|
104
106
|
}).catch(function(l) {
|
|
105
107
|
i.setError(l);
|
|
106
108
|
});
|
|
107
|
-
r.token && r.refreshToken ? (
|
|
108
|
-
|
|
109
|
-
l ? (e.onAuthSuccess && e.onAuthSuccess(), i.setSuccess(),
|
|
109
|
+
r.token && r.refreshToken ? (C(r.token, r.refreshToken, r.idToken), h.enable ? K().then(function() {
|
|
110
|
+
L().then(function(l) {
|
|
111
|
+
l ? (e.onAuthSuccess && e.onAuthSuccess(), i.setSuccess(), H()) : i.setSuccess();
|
|
110
112
|
}).catch(function(l) {
|
|
111
113
|
i.setError(l);
|
|
112
114
|
});
|
|
@@ -117,35 +119,35 @@ For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/
|
|
|
117
119
|
})) : r.onLoad ? c() : i.setSuccess();
|
|
118
120
|
}
|
|
119
121
|
return a.then(function() {
|
|
120
|
-
|
|
122
|
+
ae().then(n).catch(function(o) {
|
|
121
123
|
s.setError(o);
|
|
122
124
|
});
|
|
123
125
|
}), a.catch(function(o) {
|
|
124
126
|
s.setError(o);
|
|
125
127
|
}), s.promise;
|
|
126
128
|
}, e.login = function(r) {
|
|
127
|
-
return
|
|
129
|
+
return p.login(r);
|
|
128
130
|
};
|
|
129
|
-
function
|
|
131
|
+
function B(r) {
|
|
130
132
|
if (typeof crypto > "u" || typeof crypto.getRandomValues > "u")
|
|
131
133
|
throw new Error("Web Crypto API is not available.");
|
|
132
134
|
return crypto.getRandomValues(new Uint8Array(r));
|
|
133
135
|
}
|
|
134
|
-
function
|
|
135
|
-
return
|
|
136
|
+
function $(r) {
|
|
137
|
+
return Q(r, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");
|
|
136
138
|
}
|
|
137
|
-
function
|
|
138
|
-
for (var s =
|
|
139
|
+
function Q(r, t) {
|
|
140
|
+
for (var s = B(r), i = new Array(r), a = 0; a < r; a++)
|
|
139
141
|
i[a] = t.charCodeAt(s[a] % t.length);
|
|
140
142
|
return String.fromCharCode.apply(null, i);
|
|
141
143
|
}
|
|
142
|
-
async function
|
|
144
|
+
async function Z(r, t) {
|
|
143
145
|
if (r !== "S256")
|
|
144
146
|
throw new TypeError(`Invalid value for 'pkceMethod', expected 'S256' but got '${r}'.`);
|
|
145
|
-
const s = new Uint8Array(await
|
|
146
|
-
return
|
|
147
|
+
const s = new Uint8Array(await le(t));
|
|
148
|
+
return ce(s).replace(/\+/g, "-").replace(/\//g, "_").replace(/\=/g, "");
|
|
147
149
|
}
|
|
148
|
-
function
|
|
150
|
+
function ee(r) {
|
|
149
151
|
var t = {
|
|
150
152
|
id_token: {
|
|
151
153
|
acr: r
|
|
@@ -154,7 +156,7 @@ For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/
|
|
|
154
156
|
return JSON.stringify(t);
|
|
155
157
|
}
|
|
156
158
|
e.createLoginUrl = async function(r) {
|
|
157
|
-
var t =
|
|
159
|
+
var t = Y(), s = Y(), i = p.redirectUri(r), a = {
|
|
158
160
|
state: t,
|
|
159
161
|
nonce: s,
|
|
160
162
|
redirectUri: encodeURIComponent(i),
|
|
@@ -166,34 +168,34 @@ For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/
|
|
|
166
168
|
var n = r && r.scope || e.scope;
|
|
167
169
|
n ? n.indexOf("openid") === -1 && (n = "openid " + n) : n = "openid";
|
|
168
170
|
var o = c + "?client_id=" + encodeURIComponent(e.clientId) + "&redirect_uri=" + encodeURIComponent(i) + "&state=" + encodeURIComponent(t) + "&response_mode=" + encodeURIComponent(e.responseMode) + "&response_type=" + encodeURIComponent(e.responseType) + "&scope=" + encodeURIComponent(n);
|
|
169
|
-
if (
|
|
170
|
-
var l =
|
|
171
|
+
if (P && (o = o + "&nonce=" + encodeURIComponent(s)), r && r.prompt && (o += "&prompt=" + encodeURIComponent(r.prompt)), r && typeof r.maxAge == "number" && (o += "&max_age=" + encodeURIComponent(r.maxAge)), r && r.loginHint && (o += "&login_hint=" + encodeURIComponent(r.loginHint)), r && r.idpHint && (o += "&kc_idp_hint=" + encodeURIComponent(r.idpHint)), r && r.action && r.action != "register" && (o += "&kc_action=" + encodeURIComponent(r.action)), r && r.locale && (o += "&ui_locales=" + encodeURIComponent(r.locale)), r && r.acr) {
|
|
172
|
+
var l = ee(r.acr);
|
|
171
173
|
o += "&claims=" + encodeURIComponent(l);
|
|
172
174
|
}
|
|
173
175
|
if ((r && r.acrValues || e.acrValues) && (o += "&acr_values=" + encodeURIComponent(r.acrValues || e.acrValues)), e.pkceMethod)
|
|
174
176
|
try {
|
|
175
|
-
const
|
|
176
|
-
a.pkceCodeVerifier =
|
|
177
|
-
} catch (
|
|
178
|
-
throw new Error("Failed to generate PKCE challenge.", { cause:
|
|
177
|
+
const f = $(96), u = await Z(e.pkceMethod, f);
|
|
178
|
+
a.pkceCodeVerifier = f, o += "&code_challenge=" + u, o += "&code_challenge_method=" + e.pkceMethod;
|
|
179
|
+
} catch (f) {
|
|
180
|
+
throw new Error("Failed to generate PKCE challenge.", { cause: f });
|
|
179
181
|
}
|
|
180
|
-
return
|
|
182
|
+
return _.add(a), o;
|
|
181
183
|
}, e.logout = function(r) {
|
|
182
|
-
return
|
|
184
|
+
return p.logout(r);
|
|
183
185
|
}, e.createLogoutUrl = function(r) {
|
|
184
186
|
if (((r == null ? void 0 : r.logoutMethod) ?? e.logoutMethod) === "POST")
|
|
185
187
|
return e.endpoints.logout();
|
|
186
|
-
var s = e.endpoints.logout() + "?client_id=" + encodeURIComponent(e.clientId) + "&post_logout_redirect_uri=" + encodeURIComponent(
|
|
188
|
+
var s = e.endpoints.logout() + "?client_id=" + encodeURIComponent(e.clientId) + "&post_logout_redirect_uri=" + encodeURIComponent(p.redirectUri(r, !1));
|
|
187
189
|
return e.idToken && (s += "&id_token_hint=" + encodeURIComponent(e.idToken)), s;
|
|
188
190
|
}, e.register = function(r) {
|
|
189
|
-
return
|
|
191
|
+
return p.register(r);
|
|
190
192
|
}, e.createRegisterUrl = async function(r) {
|
|
191
193
|
return r || (r = {}), r.action = "register", await e.createLoginUrl(r);
|
|
192
194
|
}, e.createAccountUrl = function(r) {
|
|
193
|
-
var t =
|
|
194
|
-
return typeof t < "u" && (s = t + "/account?referrer=" + encodeURIComponent(e.clientId) + "&referrer_uri=" + encodeURIComponent(
|
|
195
|
+
var t = b(), s = void 0;
|
|
196
|
+
return typeof t < "u" && (s = t + "/account?referrer=" + encodeURIComponent(e.clientId) + "&referrer_uri=" + encodeURIComponent(p.redirectUri(r))), s;
|
|
195
197
|
}, e.accountManagement = function() {
|
|
196
|
-
return
|
|
198
|
+
return p.accountManagement();
|
|
197
199
|
}, e.hasRealmRole = function(r) {
|
|
198
200
|
var t = e.realmAccess;
|
|
199
201
|
return !!t && t.roles.indexOf(r) >= 0;
|
|
@@ -203,7 +205,7 @@ For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/
|
|
|
203
205
|
var s = e.resourceAccess[t || e.clientId];
|
|
204
206
|
return !!s && s.roles.indexOf(r) >= 0;
|
|
205
207
|
}, e.loadUserProfile = function() {
|
|
206
|
-
var r =
|
|
208
|
+
var r = b() + "/account", t = new XMLHttpRequest();
|
|
207
209
|
t.open("GET", r, !0), t.setRequestHeader("Accept", "application/json"), t.setRequestHeader("Authorization", "bearer " + e.token);
|
|
208
210
|
var s = g();
|
|
209
211
|
return t.onreadystatechange = function() {
|
|
@@ -220,7 +222,7 @@ For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/
|
|
|
220
222
|
if (!e.tokenParsed || !e.refreshToken && e.flow != "implicit")
|
|
221
223
|
throw "Not authenticated";
|
|
222
224
|
if (e.timeSkew == null)
|
|
223
|
-
return
|
|
225
|
+
return I("[KEYCLOAK] Unable to determine if token is expired as timeskew is not set"), !0;
|
|
224
226
|
var t = e.tokenParsed.exp - Math.ceil((/* @__PURE__ */ new Date()).getTime() / 1e3) + e.timeSkew;
|
|
225
227
|
if (r) {
|
|
226
228
|
if (isNaN(r))
|
|
@@ -235,7 +237,7 @@ For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/
|
|
|
235
237
|
r = r || 5;
|
|
236
238
|
var s = function() {
|
|
237
239
|
var a = !1;
|
|
238
|
-
if (r == -1 ? (a = !0,
|
|
240
|
+
if (r == -1 ? (a = !0, I("[KEYCLOAK] Refreshing token: forced refresh")) : (!e.tokenParsed || e.isTokenExpired(r)) && (a = !0, I("[KEYCLOAK] Refreshing token: token expired")), !a)
|
|
239
241
|
t.setSuccess(!1);
|
|
240
242
|
else {
|
|
241
243
|
var c = "grant_type=refresh_token&refresh_token=" + e.refreshToken, n = e.endpoints.token();
|
|
@@ -246,13 +248,13 @@ For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/
|
|
|
246
248
|
o.onreadystatechange = function() {
|
|
247
249
|
if (o.readyState == 4)
|
|
248
250
|
if (o.status == 200) {
|
|
249
|
-
|
|
250
|
-
var
|
|
251
|
-
|
|
251
|
+
I("[KEYCLOAK] Token refreshed"), l = (l + (/* @__PURE__ */ new Date()).getTime()) / 2;
|
|
252
|
+
var f = JSON.parse(o.responseText);
|
|
253
|
+
C(f.access_token, f.refresh_token, f.id_token, l), e.onAuthRefreshSuccess && e.onAuthRefreshSuccess();
|
|
252
254
|
for (var u = v.pop(); u != null; u = v.pop())
|
|
253
255
|
u.setSuccess(!0);
|
|
254
256
|
} else {
|
|
255
|
-
|
|
257
|
+
M("[KEYCLOAK] Failed to refresh token"), o.status == 400 && e.clearToken(), e.onAuthRefreshError && e.onAuthRefreshError();
|
|
256
258
|
for (var u = v.pop(); u != null; u = v.pop())
|
|
257
259
|
u.setError("Failed to refresh token: An unexpected HTTP error occurred while attempting to refresh the token.");
|
|
258
260
|
}
|
|
@@ -260,8 +262,8 @@ For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/
|
|
|
260
262
|
}
|
|
261
263
|
}
|
|
262
264
|
};
|
|
263
|
-
if (
|
|
264
|
-
var i =
|
|
265
|
+
if (h.enable) {
|
|
266
|
+
var i = L();
|
|
265
267
|
i.then(function() {
|
|
266
268
|
s();
|
|
267
269
|
}).catch(function(a) {
|
|
@@ -271,16 +273,16 @@ For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/
|
|
|
271
273
|
s();
|
|
272
274
|
return t.promise;
|
|
273
275
|
}, e.clearToken = function() {
|
|
274
|
-
e.token && (
|
|
276
|
+
e.token && (C(null, null, null), e.onAuthLogout && e.onAuthLogout(), e.loginRequired && e.login());
|
|
275
277
|
};
|
|
276
|
-
function
|
|
278
|
+
function b() {
|
|
277
279
|
if (typeof e.authServerUrl < "u")
|
|
278
280
|
return e.authServerUrl.charAt(e.authServerUrl.length - 1) == "/" ? e.authServerUrl + "realms/" + encodeURIComponent(e.realm) : e.authServerUrl + "/realms/" + encodeURIComponent(e.realm);
|
|
279
281
|
}
|
|
280
|
-
function
|
|
282
|
+
function re() {
|
|
281
283
|
return window.location.origin ? window.location.origin : window.location.protocol + "//" + window.location.hostname + (window.location.port ? ":" + window.location.port : "");
|
|
282
284
|
}
|
|
283
|
-
function
|
|
285
|
+
function T(r, t) {
|
|
284
286
|
var s = r.code, i = r.error, a = r.prompt, c = (/* @__PURE__ */ new Date()).getTime();
|
|
285
287
|
if (r.kc_action_status && e.onActionUpdate && e.onActionUpdate(r.kc_action_status, r.kc_action), i) {
|
|
286
288
|
if (a != "none")
|
|
@@ -295,23 +297,23 @@ For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/
|
|
|
295
297
|
return;
|
|
296
298
|
} else e.flow != "standard" && (r.access_token || r.id_token) && u(r.access_token, null, r.id_token, !0);
|
|
297
299
|
if (e.flow != "implicit" && s) {
|
|
298
|
-
var o = "code=" + s + "&grant_type=authorization_code", l = e.endpoints.token(),
|
|
299
|
-
|
|
300
|
-
if (
|
|
301
|
-
if (
|
|
302
|
-
var m = JSON.parse(
|
|
303
|
-
u(m.access_token, m.refresh_token, m.id_token, e.flow === "standard"),
|
|
300
|
+
var o = "code=" + s + "&grant_type=authorization_code", l = e.endpoints.token(), f = new XMLHttpRequest();
|
|
301
|
+
f.open("POST", l, !0), f.setRequestHeader("Content-type", "application/x-www-form-urlencoded"), o += "&client_id=" + encodeURIComponent(e.clientId), o += "&redirect_uri=" + r.redirectUri, r.pkceCodeVerifier && (o += "&code_verifier=" + r.pkceCodeVerifier), f.withCredentials = !0, f.onreadystatechange = function() {
|
|
302
|
+
if (f.readyState == 4)
|
|
303
|
+
if (f.status == 200) {
|
|
304
|
+
var m = JSON.parse(f.responseText);
|
|
305
|
+
u(m.access_token, m.refresh_token, m.id_token, e.flow === "standard"), H();
|
|
304
306
|
} else
|
|
305
307
|
e.onAuthError && e.onAuthError(), t && t.setError();
|
|
306
|
-
},
|
|
308
|
+
}, f.send(o);
|
|
307
309
|
}
|
|
308
|
-
function u(m, w, S,
|
|
309
|
-
c = (c + (/* @__PURE__ */ new Date()).getTime()) / 2,
|
|
310
|
+
function u(m, w, S, y) {
|
|
311
|
+
c = (c + (/* @__PURE__ */ new Date()).getTime()) / 2, C(m, w, S, c), P && e.idTokenParsed && e.idTokenParsed.nonce != r.storedNonce ? (I("[KEYCLOAK] Invalid nonce, clearing token"), e.clearToken(), t && t.setError()) : y && (e.onAuthSuccess && e.onAuthSuccess(), t && t.setSuccess());
|
|
310
312
|
}
|
|
311
313
|
}
|
|
312
|
-
function
|
|
314
|
+
function te() {
|
|
313
315
|
var r = g(), t;
|
|
314
|
-
typeof
|
|
316
|
+
typeof d == "string" && (t = d);
|
|
315
317
|
function s(n) {
|
|
316
318
|
n ? e.endpoints = {
|
|
317
319
|
authorize: function() {
|
|
@@ -340,25 +342,25 @@ For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/
|
|
|
340
342
|
}
|
|
341
343
|
} : e.endpoints = {
|
|
342
344
|
authorize: function() {
|
|
343
|
-
return
|
|
345
|
+
return b() + "/protocol/openid-connect/auth";
|
|
344
346
|
},
|
|
345
347
|
token: function() {
|
|
346
|
-
return
|
|
348
|
+
return b() + "/protocol/openid-connect/token";
|
|
347
349
|
},
|
|
348
350
|
logout: function() {
|
|
349
|
-
return
|
|
351
|
+
return b() + "/protocol/openid-connect/logout";
|
|
350
352
|
},
|
|
351
353
|
checkSessionIframe: function() {
|
|
352
|
-
return
|
|
354
|
+
return b() + "/protocol/openid-connect/login-status-iframe.html";
|
|
353
355
|
},
|
|
354
356
|
thirdPartyCookiesIframe: function() {
|
|
355
|
-
return
|
|
357
|
+
return b() + "/protocol/openid-connect/3p-cookies/step1.html";
|
|
356
358
|
},
|
|
357
359
|
register: function() {
|
|
358
|
-
return
|
|
360
|
+
return b() + "/protocol/openid-connect/registrations";
|
|
359
361
|
},
|
|
360
362
|
userinfo: function() {
|
|
361
|
-
return
|
|
363
|
+
return b() + "/protocol/openid-connect/userinfo";
|
|
362
364
|
}
|
|
363
365
|
};
|
|
364
366
|
}
|
|
@@ -366,24 +368,24 @@ For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/
|
|
|
366
368
|
var i = new XMLHttpRequest();
|
|
367
369
|
i.open("GET", t, !0), i.setRequestHeader("Accept", "application/json"), i.onreadystatechange = function() {
|
|
368
370
|
if (i.readyState == 4)
|
|
369
|
-
if (i.status == 200 ||
|
|
371
|
+
if (i.status == 200 || F(i)) {
|
|
370
372
|
var n = JSON.parse(i.responseText);
|
|
371
373
|
e.authServerUrl = n["auth-server-url"], e.realm = n.realm, e.clientId = n.resource, s(null), r.setSuccess();
|
|
372
374
|
} else
|
|
373
375
|
r.setError();
|
|
374
376
|
}, i.send();
|
|
375
377
|
} else {
|
|
376
|
-
e.clientId =
|
|
377
|
-
var a =
|
|
378
|
+
e.clientId = d.clientId;
|
|
379
|
+
var a = d.oidcProvider;
|
|
378
380
|
if (!a)
|
|
379
|
-
e.authServerUrl =
|
|
381
|
+
e.authServerUrl = d.url, e.realm = d.realm, s(null), r.setSuccess();
|
|
380
382
|
else if (typeof a == "string") {
|
|
381
383
|
var c;
|
|
382
384
|
a.charAt(a.length - 1) == "/" ? c = a + ".well-known/openid-configuration" : c = a + "/.well-known/openid-configuration";
|
|
383
385
|
var i = new XMLHttpRequest();
|
|
384
386
|
i.open("GET", c, !0), i.setRequestHeader("Accept", "application/json"), i.onreadystatechange = function() {
|
|
385
387
|
if (i.readyState == 4)
|
|
386
|
-
if (i.status == 200 ||
|
|
388
|
+
if (i.status == 200 || F(i)) {
|
|
387
389
|
var o = JSON.parse(i.responseText);
|
|
388
390
|
s(o), r.setSuccess();
|
|
389
391
|
} else
|
|
@@ -394,31 +396,31 @@ For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/
|
|
|
394
396
|
}
|
|
395
397
|
return r.promise;
|
|
396
398
|
}
|
|
397
|
-
function
|
|
399
|
+
function F(r) {
|
|
398
400
|
return r.status == 0 && r.responseText && r.responseURL.startsWith("file:");
|
|
399
401
|
}
|
|
400
|
-
function
|
|
401
|
-
if (e.tokenTimeoutHandle && (clearTimeout(e.tokenTimeoutHandle), e.tokenTimeoutHandle = null), t ? (e.refreshToken = t, e.refreshTokenParsed =
|
|
402
|
-
if (e.token = r, e.tokenParsed =
|
|
402
|
+
function C(r, t, s, i) {
|
|
403
|
+
if (e.tokenTimeoutHandle && (clearTimeout(e.tokenTimeoutHandle), e.tokenTimeoutHandle = null), t ? (e.refreshToken = t, e.refreshTokenParsed = V(t)) : (delete e.refreshToken, delete e.refreshTokenParsed), s ? (e.idToken = s, e.idTokenParsed = V(s)) : (delete e.idToken, delete e.idTokenParsed), r) {
|
|
404
|
+
if (e.token = r, e.tokenParsed = V(r), e.sessionId = e.tokenParsed.sid, e.authenticated = !0, e.subject = e.tokenParsed.sub, e.realmAccess = e.tokenParsed.realm_access, e.resourceAccess = e.tokenParsed.resource_access, i && (e.timeSkew = Math.floor(i / 1e3) - e.tokenParsed.iat), e.timeSkew != null && (I("[KEYCLOAK] Estimated time difference between browser and server is " + e.timeSkew + " seconds"), e.onTokenExpired)) {
|
|
403
405
|
var a = (e.tokenParsed.exp - (/* @__PURE__ */ new Date()).getTime() / 1e3 + e.timeSkew) * 1e3;
|
|
404
|
-
|
|
406
|
+
I("[KEYCLOAK] Token expires in " + Math.round(a / 1e3) + " s"), a <= 0 ? e.onTokenExpired() : e.tokenTimeoutHandle = setTimeout(e.onTokenExpired, a);
|
|
405
407
|
}
|
|
406
408
|
} else
|
|
407
409
|
delete e.token, delete e.tokenParsed, delete e.subject, delete e.realmAccess, delete e.resourceAccess, e.authenticated = !1;
|
|
408
410
|
}
|
|
409
|
-
function
|
|
411
|
+
function Y() {
|
|
410
412
|
if (typeof crypto > "u" || typeof crypto.randomUUID > "u")
|
|
411
413
|
throw new Error("Web Crypto API is not available.");
|
|
412
414
|
return crypto.randomUUID();
|
|
413
415
|
}
|
|
414
|
-
function
|
|
415
|
-
var t =
|
|
416
|
+
function E(r) {
|
|
417
|
+
var t = ne(r);
|
|
416
418
|
if (t) {
|
|
417
|
-
var s =
|
|
419
|
+
var s = _.get(t.state);
|
|
418
420
|
return s && (t.valid = !0, t.redirectUri = s.redirectUri, t.storedNonce = s.nonce, t.prompt = s.prompt, t.pkceCodeVerifier = s.pkceCodeVerifier, t.loginOptions = s.loginOptions), t;
|
|
419
421
|
}
|
|
420
422
|
}
|
|
421
|
-
function
|
|
423
|
+
function ne(r) {
|
|
422
424
|
var t;
|
|
423
425
|
switch (e.flow) {
|
|
424
426
|
case "standard":
|
|
@@ -433,7 +435,7 @@ For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/
|
|
|
433
435
|
}
|
|
434
436
|
t.push("error"), t.push("error_description"), t.push("error_uri");
|
|
435
437
|
var s = r.indexOf("?"), i = r.indexOf("#"), a, c;
|
|
436
|
-
if (e.responseMode === "query" && s !== -1 ? (a = r.substring(0, s), c =
|
|
438
|
+
if (e.responseMode === "query" && s !== -1 ? (a = r.substring(0, s), c = G(r.substring(s + 1, i !== -1 ? i : r.length), t), c.paramsString !== "" && (a += "?" + c.paramsString), i !== -1 && (a += r.substring(i))) : e.responseMode === "fragment" && i !== -1 && (a = r.substring(0, i), c = G(r.substring(i + 1), t), c.paramsString !== "" && (a += "#" + c.paramsString)), c && c.oauthParams) {
|
|
437
439
|
if (e.flow === "standard" || e.flow === "hybrid") {
|
|
438
440
|
if ((c.oauthParams.code || c.oauthParams.error) && c.oauthParams.state)
|
|
439
441
|
return c.oauthParams.newUrl = a, c.oauthParams;
|
|
@@ -441,7 +443,7 @@ For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/
|
|
|
441
443
|
return c.oauthParams.newUrl = a, c.oauthParams;
|
|
442
444
|
}
|
|
443
445
|
}
|
|
444
|
-
function
|
|
446
|
+
function G(r, t) {
|
|
445
447
|
for (var s = r.split("&"), i = {
|
|
446
448
|
paramsString: "",
|
|
447
449
|
oauthParams: {}
|
|
@@ -464,7 +466,7 @@ For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/
|
|
|
464
466
|
r.resolve = t, r.reject = s;
|
|
465
467
|
}), r;
|
|
466
468
|
}
|
|
467
|
-
function
|
|
469
|
+
function oe(r, t, s) {
|
|
468
470
|
var i = null, a = new Promise(function(c, n) {
|
|
469
471
|
i = setTimeout(function() {
|
|
470
472
|
n({ error: s });
|
|
@@ -474,21 +476,21 @@ For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/
|
|
|
474
476
|
clearTimeout(i);
|
|
475
477
|
});
|
|
476
478
|
}
|
|
477
|
-
function
|
|
479
|
+
function K() {
|
|
478
480
|
var r = g();
|
|
479
|
-
if (!
|
|
481
|
+
if (!h.enable || h.iframe)
|
|
480
482
|
return r.setSuccess(), r.promise;
|
|
481
483
|
var t = document.createElement("iframe");
|
|
482
|
-
|
|
484
|
+
h.iframe = t, t.onload = function() {
|
|
483
485
|
var a = e.endpoints.authorize();
|
|
484
|
-
a.charAt(0) === "/" ?
|
|
486
|
+
a.charAt(0) === "/" ? h.iframeOrigin = re() : h.iframeOrigin = a.substring(0, a.indexOf("/", 8)), r.setSuccess();
|
|
485
487
|
};
|
|
486
488
|
var s = e.endpoints.checkSessionIframe();
|
|
487
489
|
t.setAttribute("src", s), t.setAttribute("sandbox", "allow-storage-access-by-user-activation allow-scripts allow-same-origin"), t.setAttribute("title", "keycloak-session-iframe"), t.style.display = "none", document.body.appendChild(t);
|
|
488
490
|
var i = function(a) {
|
|
489
|
-
if (!(a.origin !==
|
|
491
|
+
if (!(a.origin !== h.iframeOrigin || h.iframe.contentWindow !== a.source) && (a.data == "unchanged" || a.data == "changed" || a.data == "error")) {
|
|
490
492
|
a.data != "unchanged" && e.clearToken();
|
|
491
|
-
for (var c =
|
|
493
|
+
for (var c = h.callbackList.splice(0, h.callbackList.length), n = c.length - 1; n >= 0; --n) {
|
|
492
494
|
var o = c[n];
|
|
493
495
|
a.data == "error" ? o.setError() : o.setSuccess(a.data == "unchanged");
|
|
494
496
|
}
|
|
@@ -496,45 +498,45 @@ For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/
|
|
|
496
498
|
};
|
|
497
499
|
return window.addEventListener("message", i, !1), r.promise;
|
|
498
500
|
}
|
|
499
|
-
function
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
r &&
|
|
501
|
+
function H() {
|
|
502
|
+
h.enable && e.token && setTimeout(function() {
|
|
503
|
+
L().then(function(r) {
|
|
504
|
+
r && H();
|
|
503
505
|
});
|
|
504
|
-
},
|
|
506
|
+
}, h.interval * 1e3);
|
|
505
507
|
}
|
|
506
|
-
function
|
|
508
|
+
function L() {
|
|
507
509
|
var r = g();
|
|
508
|
-
if (
|
|
510
|
+
if (h.iframe && h.iframeOrigin) {
|
|
509
511
|
var t = e.clientId + " " + (e.sessionId ? e.sessionId : "");
|
|
510
|
-
|
|
511
|
-
var s =
|
|
512
|
-
|
|
512
|
+
h.callbackList.push(r);
|
|
513
|
+
var s = h.iframeOrigin;
|
|
514
|
+
h.callbackList.length == 1 && h.iframe.contentWindow.postMessage(t, s);
|
|
513
515
|
} else
|
|
514
516
|
r.setSuccess();
|
|
515
517
|
return r.promise;
|
|
516
518
|
}
|
|
517
|
-
function
|
|
519
|
+
function ae() {
|
|
518
520
|
var r = g();
|
|
519
|
-
if ((
|
|
521
|
+
if ((h.enable || e.silentCheckSsoRedirectUri) && typeof e.endpoints.thirdPartyCookiesIframe == "function") {
|
|
520
522
|
var t = document.createElement("iframe");
|
|
521
523
|
t.setAttribute("src", e.endpoints.thirdPartyCookiesIframe()), t.setAttribute("sandbox", "allow-storage-access-by-user-activation allow-scripts allow-same-origin"), t.setAttribute("title", "keycloak-3p-check-iframe"), t.style.display = "none", document.body.appendChild(t);
|
|
522
524
|
var s = function(i) {
|
|
523
|
-
t.contentWindow === i.source && (i.data !== "supported" && i.data !== "unsupported" || (i.data === "unsupported" && (
|
|
525
|
+
t.contentWindow === i.source && (i.data !== "supported" && i.data !== "unsupported" || (i.data === "unsupported" && (M(
|
|
524
526
|
`[KEYCLOAK] Your browser is blocking access to 3rd-party cookies, this means:
|
|
525
527
|
|
|
526
528
|
- It is not possible to retrieve tokens without redirecting to the Keycloak server (a.k.a. no support for silent authentication).
|
|
527
529
|
- It is not possible to automatically detect changes to the session status (such as the user logging out in another tab).
|
|
528
530
|
|
|
529
531
|
For more information see: https://www.keycloak.org/securing-apps/javascript-adapter#_modern_browsers`
|
|
530
|
-
),
|
|
532
|
+
), h.enable = !1, e.silentCheckSsoFallback && (e.silentCheckSsoRedirectUri = !1)), document.body.removeChild(t), window.removeEventListener("message", s), r.setSuccess()));
|
|
531
533
|
};
|
|
532
534
|
window.addEventListener("message", s, !1);
|
|
533
535
|
} else
|
|
534
536
|
r.setSuccess();
|
|
535
|
-
return
|
|
537
|
+
return oe(r.promise, e.messageReceiveTimeout, "Timeout when waiting for 3rd party check iframe message.");
|
|
536
538
|
}
|
|
537
|
-
function
|
|
539
|
+
function N(r) {
|
|
538
540
|
if (!r || r == "default")
|
|
539
541
|
return {
|
|
540
542
|
login: async function(n) {
|
|
@@ -547,12 +549,12 @@ For more information see: https://www.keycloak.org/securing-apps/javascript-adap
|
|
|
547
549
|
}
|
|
548
550
|
const l = document.createElement("form");
|
|
549
551
|
l.setAttribute("method", "POST"), l.setAttribute("action", e.createLogoutUrl(n)), l.style.display = "none";
|
|
550
|
-
const
|
|
552
|
+
const f = {
|
|
551
553
|
id_token_hint: e.idToken,
|
|
552
554
|
client_id: e.clientId,
|
|
553
|
-
post_logout_redirect_uri:
|
|
555
|
+
post_logout_redirect_uri: p.redirectUri(n, !1)
|
|
554
556
|
};
|
|
555
|
-
for (const [u, m] of Object.entries(
|
|
557
|
+
for (const [u, m] of Object.entries(f)) {
|
|
556
558
|
const w = document.createElement("input");
|
|
557
559
|
w.setAttribute("type", "hidden"), w.setAttribute("name", u), w.setAttribute("value", m), l.appendChild(w);
|
|
558
560
|
}
|
|
@@ -574,7 +576,7 @@ For more information see: https://www.keycloak.org/securing-apps/javascript-adap
|
|
|
574
576
|
}
|
|
575
577
|
};
|
|
576
578
|
if (r == "cordova") {
|
|
577
|
-
|
|
579
|
+
h.enable = !1;
|
|
578
580
|
var t = function(n, o, l) {
|
|
579
581
|
return window.cordova && window.cordova.InAppBrowser ? window.cordova.InAppBrowser.open(n, o, l) : window.open(n, o, l);
|
|
580
582
|
}, s = function(n) {
|
|
@@ -593,44 +595,44 @@ For more information see: https://www.keycloak.org/securing-apps/javascript-adap
|
|
|
593
595
|
};
|
|
594
596
|
return {
|
|
595
597
|
login: async function(n) {
|
|
596
|
-
var o = g(), l = a(n),
|
|
598
|
+
var o = g(), l = a(n), f = await e.createLoginUrl(n), u = t(f, "_blank", l), m = !1, w = !1, S = function() {
|
|
597
599
|
w = !0, u.close();
|
|
598
600
|
};
|
|
599
|
-
return u.addEventListener("loadstart", function(
|
|
600
|
-
if (
|
|
601
|
-
var
|
|
602
|
-
|
|
601
|
+
return u.addEventListener("loadstart", function(y) {
|
|
602
|
+
if (y.url.indexOf(c()) == 0) {
|
|
603
|
+
var z = E(y.url);
|
|
604
|
+
T(z, o), S(), m = !0;
|
|
603
605
|
}
|
|
604
|
-
}), u.addEventListener("loaderror", function(
|
|
606
|
+
}), u.addEventListener("loaderror", function(y) {
|
|
605
607
|
if (!m)
|
|
606
|
-
if (
|
|
607
|
-
var
|
|
608
|
-
|
|
608
|
+
if (y.url.indexOf(c()) == 0) {
|
|
609
|
+
var z = E(y.url);
|
|
610
|
+
T(z, o), S(), m = !0;
|
|
609
611
|
} else
|
|
610
612
|
o.setError(), S();
|
|
611
|
-
}), u.addEventListener("exit", function(
|
|
613
|
+
}), u.addEventListener("exit", function(y) {
|
|
612
614
|
w || o.setError({
|
|
613
615
|
reason: "closed_by_user"
|
|
614
616
|
});
|
|
615
617
|
}), o.promise;
|
|
616
618
|
},
|
|
617
619
|
logout: function(n) {
|
|
618
|
-
var o = g(), l = e.createLogoutUrl(n),
|
|
619
|
-
return
|
|
620
|
-
m.url.indexOf(c()) == 0 &&
|
|
621
|
-
}),
|
|
622
|
-
m.url.indexOf(c()) == 0 || (u = !0),
|
|
623
|
-
}),
|
|
620
|
+
var o = g(), l = e.createLogoutUrl(n), f = t(l, "_blank", "location=no,hidden=yes,clearcache=yes"), u;
|
|
621
|
+
return f.addEventListener("loadstart", function(m) {
|
|
622
|
+
m.url.indexOf(c()) == 0 && f.close();
|
|
623
|
+
}), f.addEventListener("loaderror", function(m) {
|
|
624
|
+
m.url.indexOf(c()) == 0 || (u = !0), f.close();
|
|
625
|
+
}), f.addEventListener("exit", function(m) {
|
|
624
626
|
u ? o.setError() : (e.clearToken(), o.setSuccess());
|
|
625
627
|
}), o.promise;
|
|
626
628
|
},
|
|
627
629
|
register: async function(n) {
|
|
628
|
-
var o = g(), l = await e.createRegisterUrl(),
|
|
630
|
+
var o = g(), l = await e.createRegisterUrl(), f = a(n), u = t(l, "_blank", f);
|
|
629
631
|
return u.addEventListener("loadstart", function(m) {
|
|
630
632
|
if (m.url.indexOf(c()) == 0) {
|
|
631
633
|
u.close();
|
|
632
|
-
var w =
|
|
633
|
-
|
|
634
|
+
var w = E(m.url);
|
|
635
|
+
T(w, o);
|
|
634
636
|
}
|
|
635
637
|
}), o.promise;
|
|
636
638
|
},
|
|
@@ -650,27 +652,27 @@ For more information see: https://www.keycloak.org/securing-apps/javascript-adap
|
|
|
650
652
|
};
|
|
651
653
|
}
|
|
652
654
|
if (r == "cordova-native")
|
|
653
|
-
return
|
|
655
|
+
return h.enable = !1, {
|
|
654
656
|
login: async function(n) {
|
|
655
657
|
var o = g(), l = await e.createLoginUrl(n);
|
|
656
|
-
return universalLinks.subscribe("keycloak", function(
|
|
658
|
+
return universalLinks.subscribe("keycloak", function(f) {
|
|
657
659
|
universalLinks.unsubscribe("keycloak"), window.cordova.plugins.browsertab.close();
|
|
658
|
-
var u =
|
|
659
|
-
|
|
660
|
+
var u = E(f.url);
|
|
661
|
+
T(u, o);
|
|
660
662
|
}), window.cordova.plugins.browsertab.openUrl(l), o.promise;
|
|
661
663
|
},
|
|
662
664
|
logout: function(n) {
|
|
663
665
|
var o = g(), l = e.createLogoutUrl(n);
|
|
664
|
-
return universalLinks.subscribe("keycloak", function(
|
|
666
|
+
return universalLinks.subscribe("keycloak", function(f) {
|
|
665
667
|
universalLinks.unsubscribe("keycloak"), window.cordova.plugins.browsertab.close(), e.clearToken(), o.setSuccess();
|
|
666
668
|
}), window.cordova.plugins.browsertab.openUrl(l), o.promise;
|
|
667
669
|
},
|
|
668
670
|
register: async function(n) {
|
|
669
671
|
var o = g(), l = await e.createRegisterUrl(n);
|
|
670
|
-
return universalLinks.subscribe("keycloak", function(
|
|
672
|
+
return universalLinks.subscribe("keycloak", function(f) {
|
|
671
673
|
universalLinks.unsubscribe("keycloak"), window.cordova.plugins.browsertab.close();
|
|
672
|
-
var u =
|
|
673
|
-
|
|
674
|
+
var u = E(f.url);
|
|
675
|
+
T(u, o);
|
|
674
676
|
}), window.cordova.plugins.browsertab.openUrl(l), o.promise;
|
|
675
677
|
},
|
|
676
678
|
accountManagement: function() {
|
|
@@ -686,10 +688,10 @@ For more information see: https://www.keycloak.org/securing-apps/javascript-adap
|
|
|
686
688
|
};
|
|
687
689
|
throw "invalid adapter type: " + r;
|
|
688
690
|
}
|
|
689
|
-
const
|
|
690
|
-
var
|
|
691
|
-
if (!(this instanceof
|
|
692
|
-
return new
|
|
691
|
+
const A = "kc-callback-";
|
|
692
|
+
var D = function() {
|
|
693
|
+
if (!(this instanceof D))
|
|
694
|
+
return new D();
|
|
693
695
|
localStorage.setItem("kc-test", "test"), localStorage.removeItem("kc-test");
|
|
694
696
|
var r = this;
|
|
695
697
|
function t() {
|
|
@@ -704,7 +706,7 @@ For more information see: https://www.keycloak.org/securing-apps/javascript-adap
|
|
|
704
706
|
localStorage.removeItem(c);
|
|
705
707
|
}
|
|
706
708
|
function i() {
|
|
707
|
-
return Object.entries(localStorage).filter(([c]) => c.startsWith(
|
|
709
|
+
return Object.entries(localStorage).filter(([c]) => c.startsWith(A));
|
|
708
710
|
}
|
|
709
711
|
function a(c) {
|
|
710
712
|
let n;
|
|
@@ -713,16 +715,16 @@ For more information see: https://www.keycloak.org/securing-apps/javascript-adap
|
|
|
713
715
|
} catch {
|
|
714
716
|
return null;
|
|
715
717
|
}
|
|
716
|
-
return
|
|
718
|
+
return O(n) && "expires" in n && typeof n.expires == "number" ? n.expires : null;
|
|
717
719
|
}
|
|
718
720
|
r.get = function(c) {
|
|
719
721
|
if (c) {
|
|
720
|
-
var n =
|
|
722
|
+
var n = A + c, o = localStorage.getItem(n);
|
|
721
723
|
return o && (localStorage.removeItem(n), o = JSON.parse(o)), t(), o;
|
|
722
724
|
}
|
|
723
725
|
}, r.add = function(c) {
|
|
724
726
|
t();
|
|
725
|
-
const n =
|
|
727
|
+
const n = A + c.state, o = JSON.stringify({
|
|
726
728
|
...c,
|
|
727
729
|
// Set the expiry time to 1 hour from now.
|
|
728
730
|
expires: Date.now() + 60 * 60 * 1e3
|
|
@@ -733,18 +735,18 @@ For more information see: https://www.keycloak.org/securing-apps/javascript-adap
|
|
|
733
735
|
s(), localStorage.setItem(n, o);
|
|
734
736
|
}
|
|
735
737
|
};
|
|
736
|
-
},
|
|
737
|
-
if (!(this instanceof
|
|
738
|
-
return new
|
|
738
|
+
}, j = function() {
|
|
739
|
+
if (!(this instanceof j))
|
|
740
|
+
return new j();
|
|
739
741
|
var r = this;
|
|
740
742
|
r.get = function(a) {
|
|
741
743
|
if (a) {
|
|
742
|
-
var c = s(
|
|
743
|
-
if (i(
|
|
744
|
+
var c = s(A + a);
|
|
745
|
+
if (i(A + a, "", t(-100)), c)
|
|
744
746
|
return JSON.parse(c);
|
|
745
747
|
}
|
|
746
748
|
}, r.add = function(a) {
|
|
747
|
-
i(
|
|
749
|
+
i(A + a.state, JSON.stringify(a), t(60));
|
|
748
750
|
}, r.removeItem = function(a) {
|
|
749
751
|
i(a, "", t(-100));
|
|
750
752
|
};
|
|
@@ -764,47 +766,47 @@ For more information see: https://www.keycloak.org/securing-apps/javascript-adap
|
|
|
764
766
|
document.cookie = o;
|
|
765
767
|
};
|
|
766
768
|
};
|
|
767
|
-
function
|
|
769
|
+
function ie() {
|
|
768
770
|
try {
|
|
769
|
-
return new
|
|
771
|
+
return new D();
|
|
770
772
|
} catch {
|
|
771
773
|
}
|
|
772
|
-
return new
|
|
774
|
+
return new j();
|
|
773
775
|
}
|
|
774
|
-
function
|
|
776
|
+
function W(r) {
|
|
775
777
|
return function() {
|
|
776
778
|
e.enableLogging && r.apply(console, Array.prototype.slice.call(arguments));
|
|
777
779
|
};
|
|
778
780
|
}
|
|
779
781
|
}
|
|
780
|
-
function
|
|
781
|
-
const e = String.fromCodePoint(...
|
|
782
|
+
function ce(d) {
|
|
783
|
+
const e = String.fromCodePoint(...d);
|
|
782
784
|
return btoa(e);
|
|
783
785
|
}
|
|
784
|
-
async function
|
|
785
|
-
const
|
|
786
|
+
async function le(d) {
|
|
787
|
+
const p = new TextEncoder().encode(d);
|
|
786
788
|
if (typeof crypto > "u" || typeof crypto.subtle > "u")
|
|
787
789
|
throw new Error("Web Crypto API is not available.");
|
|
788
|
-
return await crypto.subtle.digest("SHA-256",
|
|
790
|
+
return await crypto.subtle.digest("SHA-256", p);
|
|
789
791
|
}
|
|
790
|
-
function
|
|
791
|
-
const [e,
|
|
792
|
-
if (typeof
|
|
792
|
+
function V(d) {
|
|
793
|
+
const [e, p] = d.split(".");
|
|
794
|
+
if (typeof p != "string")
|
|
793
795
|
throw new Error("Unable to decode token, payload not found.");
|
|
794
796
|
let v;
|
|
795
797
|
try {
|
|
796
|
-
v =
|
|
797
|
-
} catch (
|
|
798
|
-
throw new Error("Unable to decode token, payload is not a valid Base64URL value.", { cause:
|
|
798
|
+
v = ue(p);
|
|
799
|
+
} catch (_) {
|
|
800
|
+
throw new Error("Unable to decode token, payload is not a valid Base64URL value.", { cause: _ });
|
|
799
801
|
}
|
|
800
802
|
try {
|
|
801
803
|
return JSON.parse(v);
|
|
802
|
-
} catch (
|
|
803
|
-
throw new Error("Unable to decode token, payload is not a valid JSON value.", { cause:
|
|
804
|
+
} catch (_) {
|
|
805
|
+
throw new Error("Unable to decode token, payload is not a valid JSON value.", { cause: _ });
|
|
804
806
|
}
|
|
805
807
|
}
|
|
806
|
-
function
|
|
807
|
-
let e =
|
|
808
|
+
function ue(d) {
|
|
809
|
+
let e = d.replaceAll("-", "+").replaceAll("_", "/");
|
|
808
810
|
switch (e.length % 4) {
|
|
809
811
|
case 0:
|
|
810
812
|
break;
|
|
@@ -818,33 +820,33 @@ function ae(f) {
|
|
|
818
820
|
throw new Error("Input is not of the correct length.");
|
|
819
821
|
}
|
|
820
822
|
try {
|
|
821
|
-
return
|
|
823
|
+
return de(e);
|
|
822
824
|
} catch {
|
|
823
825
|
return atob(e);
|
|
824
826
|
}
|
|
825
827
|
}
|
|
826
|
-
function
|
|
827
|
-
return decodeURIComponent(atob(
|
|
828
|
-
let v =
|
|
828
|
+
function de(d) {
|
|
829
|
+
return decodeURIComponent(atob(d).replace(/(.)/g, (e, p) => {
|
|
830
|
+
let v = p.charCodeAt(0).toString(16).toUpperCase();
|
|
829
831
|
return v.length < 2 && (v = "0" + v), "%" + v;
|
|
830
832
|
}));
|
|
831
833
|
}
|
|
832
|
-
function
|
|
833
|
-
return typeof
|
|
834
|
+
function O(d) {
|
|
835
|
+
return typeof d == "object" && d !== null;
|
|
834
836
|
}
|
|
835
|
-
let k = null,
|
|
836
|
-
function
|
|
837
|
-
return
|
|
838
|
-
url:
|
|
839
|
-
realm:
|
|
840
|
-
clientId:
|
|
841
|
-
})),
|
|
837
|
+
let k = null, x = null;
|
|
838
|
+
function fe(d, e = !0) {
|
|
839
|
+
return x ? (console.log("Keycloak already initialized, returning from cache"), x) : (k || (k = new q({
|
|
840
|
+
url: d.url,
|
|
841
|
+
realm: d.realm,
|
|
842
|
+
clientId: d.clientId
|
|
843
|
+
})), x = k.init({
|
|
842
844
|
onLoad: e ? "check-sso" : "login-required",
|
|
843
845
|
checkLoginIframe: !1
|
|
844
846
|
//silentCheckSsoRedirectUri: `${window.location.origin}/silent-check-sso.html`, // Ensure this file is set up
|
|
845
|
-
}).then((
|
|
847
|
+
}).then((p) => p).catch((p) => (console.error("Failed to initialize Keycloak:", p), !1)), x);
|
|
846
848
|
}
|
|
847
|
-
function
|
|
849
|
+
function he() {
|
|
848
850
|
return k != null && k.authenticated && (k != null && k.idTokenParsed) ? {
|
|
849
851
|
fullname: k.idTokenParsed.name,
|
|
850
852
|
email: k.idTokenParsed.email,
|
|
@@ -857,34 +859,110 @@ function ce() {
|
|
|
857
859
|
sub: k.idTokenParsed.sub
|
|
858
860
|
} : {};
|
|
859
861
|
}
|
|
860
|
-
function
|
|
862
|
+
function pe() {
|
|
861
863
|
if (k)
|
|
862
864
|
k.login();
|
|
863
865
|
else
|
|
864
866
|
throw new Error("Keycloak is not initialized.");
|
|
865
867
|
}
|
|
866
|
-
function
|
|
868
|
+
function me() {
|
|
867
869
|
if (k)
|
|
868
870
|
k.logout();
|
|
869
871
|
else
|
|
870
872
|
throw new Error("Keycloak is not initialized.");
|
|
871
873
|
}
|
|
872
|
-
function
|
|
874
|
+
function ke() {
|
|
873
875
|
return !!(k != null && k.authenticated);
|
|
874
876
|
}
|
|
875
|
-
async function
|
|
877
|
+
async function ge(d) {
|
|
876
878
|
try {
|
|
877
|
-
const e = await fetch(
|
|
879
|
+
const e = await fetch(d, { method: "HEAD", mode: "no-cors" });
|
|
878
880
|
return e.ok || e.type === "opaque";
|
|
879
881
|
} catch {
|
|
880
882
|
return !1;
|
|
881
883
|
}
|
|
882
884
|
}
|
|
885
|
+
const Ue = class {
|
|
886
|
+
constructor(d) {
|
|
887
|
+
X(this, d), this.keycloak = J(this, "keycloak", 7), this.auth = J(this, "auth", 7), this.handleLogin = async () => {
|
|
888
|
+
if (!this.authenticated)
|
|
889
|
+
try {
|
|
890
|
+
await pe();
|
|
891
|
+
} catch (e) {
|
|
892
|
+
R.show(e.message, "error");
|
|
893
|
+
}
|
|
894
|
+
}, this.handleLogout = async () => {
|
|
895
|
+
try {
|
|
896
|
+
await me();
|
|
897
|
+
} catch (e) {
|
|
898
|
+
R.show(e.message, "error");
|
|
899
|
+
}
|
|
900
|
+
this.authenticated = !1, this.user = null;
|
|
901
|
+
}, this.keycloakUrl = void 0, this.keycloakRealm = void 0, this.keycloakClientId = void 0, this.authenticated = !1, this.user = null, this.serverAvailable = !1;
|
|
902
|
+
}
|
|
903
|
+
/**
|
|
904
|
+
* Lifecycle method that runs when the component is about to load.
|
|
905
|
+
* It initializes authentication by calling the `initAuth` method.
|
|
906
|
+
*/
|
|
907
|
+
async componentWillLoad() {
|
|
908
|
+
if (!this.keycloakUrl || !this.keycloakRealm || !this.keycloakClientId) {
|
|
909
|
+
console.error("Keycloak configuration props are missing.");
|
|
910
|
+
return;
|
|
911
|
+
}
|
|
912
|
+
if (this.serverAvailable = await ge(`${this.keycloakUrl}/realms/${this.keycloakRealm}`), !this.serverAvailable) {
|
|
913
|
+
R.show("Keycloak server is unavailable.", "error");
|
|
914
|
+
return;
|
|
915
|
+
}
|
|
916
|
+
await this.initAuth();
|
|
917
|
+
}
|
|
918
|
+
/**
|
|
919
|
+
* Initializes the Keycloak authentication by configuring Keycloak with the provided props.
|
|
920
|
+
* Sets the `authenticated` state and `user` data if the user is authenticated.
|
|
921
|
+
* Emits `authStatusChanged` event with the authentication status.
|
|
922
|
+
*/
|
|
923
|
+
async initAuth() {
|
|
924
|
+
try {
|
|
925
|
+
const d = await fe({
|
|
926
|
+
url: this.keycloakUrl,
|
|
927
|
+
realm: this.keycloakRealm,
|
|
928
|
+
clientId: this.keycloakClientId
|
|
929
|
+
}, !0);
|
|
930
|
+
this.keycloak.emit({
|
|
931
|
+
init: d
|
|
932
|
+
}), ke() && (this.user = he(), this.authenticated = !0, this.auth.emit({
|
|
933
|
+
authenticated: this.authenticated,
|
|
934
|
+
user: this.user
|
|
935
|
+
}));
|
|
936
|
+
} catch (d) {
|
|
937
|
+
R.show(d.message, "error");
|
|
938
|
+
}
|
|
939
|
+
}
|
|
940
|
+
render() {
|
|
941
|
+
return U("div", { key: "074566b791eeb9ea4a0558b4ed83a96e4b673356", class: "block" }, !this.authenticated && U("eds-button", { key: "3a05ff97a90d73204eb77c5dad0d328294d72d3e", label: "Login", intent: "primary", "extra-class": "text-default", "aria-label": "Login", triggerClick: this.handleLogin.bind(this) }));
|
|
942
|
+
}
|
|
943
|
+
}, ve = ".splash-overlay{position:fixed;top:0;left:0;width:100vw;height:100vh;z-index:9999999;background-color:var(--grey-200);display:flex;flex-direction:column;align-items:center;justify-content:center}.logo-container{width:200px;height:200px;margin-bottom:1rem}.content-container{position:relative;width:5rem;height:5rem;display:flex;align-items:center;justify-content:center}", we = ve, ye = class {
|
|
944
|
+
constructor(d) {
|
|
945
|
+
X(this, d), this.splash = J(this, "splash", 7), this.inverse = !1, this.initPromise = void 0, this.isVisible = !0;
|
|
946
|
+
}
|
|
947
|
+
componentWillLoad() {
|
|
948
|
+
this.initPromise && this.initPromise.then(() => {
|
|
949
|
+
console.log("Promises resolved"), this.hideSplash();
|
|
950
|
+
}).catch((d) => {
|
|
951
|
+
console.error("Initialization error:", d), this.splash.emit({ type: "error", message: d.message || "Unknown error" });
|
|
952
|
+
});
|
|
953
|
+
}
|
|
954
|
+
handleHideSplash() {
|
|
955
|
+
this.hideSplash();
|
|
956
|
+
}
|
|
957
|
+
hideSplash() {
|
|
958
|
+
this.isVisible = !1, this.splash.emit({ type: "hidden", message: "Splash screen hidden successfully" });
|
|
959
|
+
}
|
|
960
|
+
render() {
|
|
961
|
+
return this.isVisible ? U(se, null, U("div", { class: "splash-overlay", style: { background: this.inverse ? "black" : "var(--grey-200)" } }, U("div", { class: "logo-container" }, this.inverse ? U("eds-logo", { orientation: "vertical", type: "color-white" }) : U("eds-logo", { orientation: "vertical", type: "color" })), U("div", { class: "content-container" }, U("eds-spinner", { size: "1rem", thickness: "3px", "border-color": "var(--grey-400)", "bottom-color": "var(--grey-900)", background: "none", fullscreen: !1 })))) : null;
|
|
962
|
+
}
|
|
963
|
+
};
|
|
964
|
+
ye.style = we;
|
|
883
965
|
export {
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
fe as c,
|
|
887
|
-
ce as g,
|
|
888
|
-
se as i,
|
|
889
|
-
le as l
|
|
966
|
+
Ue as eds_login,
|
|
967
|
+
ye as eds_splash_screen
|
|
890
968
|
};
|