@asgardeo/react 0.14.1 → 0.14.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +1107 -809
- package/dist/cjs/index.js.map +4 -4
- package/dist/components/adapters/Consent.d.ts +90 -0
- package/dist/components/adapters/ConsentCheckboxList.d.ts +94 -0
- package/dist/components/adapters/FlowTimer.d.ts +62 -0
- package/dist/components/presentation/auth/AuthOptionFactory.d.ts +8 -0
- package/dist/components/presentation/auth/SignIn/v2/BaseSignIn.d.ts +12 -0
- package/dist/components/presentation/auth/SignIn/v2/SignIn.d.ts +10 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +955 -657
- package/dist/index.js.map +4 -4
- package/dist/utils/v2/flowTransformer.d.ts +1 -0
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -7663,7 +7663,7 @@ import {
|
|
|
7663
7663
|
resolveVars as resolveVars3
|
|
7664
7664
|
} from "@asgardeo/browser";
|
|
7665
7665
|
import { cx as cx20 } from "@emotion/css";
|
|
7666
|
-
import { useState as
|
|
7666
|
+
import { useState as useState17, useCallback as useCallback11 } from "react";
|
|
7667
7667
|
|
|
7668
7668
|
// src/utils/v2/resolveTranslationsInObject.ts
|
|
7669
7669
|
import { resolveVars } from "@asgardeo/browser";
|
|
@@ -7775,7 +7775,16 @@ var normalizeFlowResponse = (response, t, options = {}, meta) => {
|
|
|
7775
7775
|
if (errorMessage && throwOnError) {
|
|
7776
7776
|
throw response;
|
|
7777
7777
|
}
|
|
7778
|
+
const additionalData = response?.data?.additionalData ?? {};
|
|
7779
|
+
if (typeof additionalData["consentPrompt"] === "string") {
|
|
7780
|
+
try {
|
|
7781
|
+
const parsed = JSON.parse(additionalData["consentPrompt"]);
|
|
7782
|
+
additionalData["consentPrompt"] = { purposes: Array.isArray(parsed) ? parsed : [] };
|
|
7783
|
+
} catch {
|
|
7784
|
+
}
|
|
7785
|
+
}
|
|
7778
7786
|
return {
|
|
7787
|
+
additionalData,
|
|
7779
7788
|
components: transformComponents(response, t, resolveTranslations, meta),
|
|
7780
7789
|
flowId: response.flowId
|
|
7781
7790
|
};
|
|
@@ -7853,8 +7862,156 @@ import { css as css17 } from "@emotion/css";
|
|
|
7853
7862
|
import DOMPurify from "dompurify";
|
|
7854
7863
|
import { cloneElement } from "react";
|
|
7855
7864
|
|
|
7865
|
+
// src/components/adapters/ConsentCheckboxList.tsx
|
|
7866
|
+
import { Fragment as Fragment13, jsx as jsx59 } from "react/jsx-runtime";
|
|
7867
|
+
var getConsentOptionalKey = (purposeId, attrName) => `__consent_opt__${purposeId}__${attrName}`;
|
|
7868
|
+
var ConsentCheckboxList = ({
|
|
7869
|
+
variant,
|
|
7870
|
+
purpose,
|
|
7871
|
+
formValues,
|
|
7872
|
+
onInputChange,
|
|
7873
|
+
children
|
|
7874
|
+
}) => {
|
|
7875
|
+
const attributes = variant === "ESSENTIAL" ? purpose.essential : purpose.optional;
|
|
7876
|
+
if (!attributes || attributes.length === 0) {
|
|
7877
|
+
return null;
|
|
7878
|
+
}
|
|
7879
|
+
const isEssential = variant === "ESSENTIAL";
|
|
7880
|
+
const isChecked = (attrName) => {
|
|
7881
|
+
if (isEssential) {
|
|
7882
|
+
return true;
|
|
7883
|
+
}
|
|
7884
|
+
const key = getConsentOptionalKey(purpose.purpose_id, attrName);
|
|
7885
|
+
return formValues[key] !== "false";
|
|
7886
|
+
};
|
|
7887
|
+
const handleChange = (attrName, checked) => {
|
|
7888
|
+
const key = getConsentOptionalKey(purpose.purpose_id, attrName);
|
|
7889
|
+
onInputChange(key, checked ? "true" : "false");
|
|
7890
|
+
};
|
|
7891
|
+
if (children) {
|
|
7892
|
+
return /* @__PURE__ */ jsx59(Fragment13, { children: children({ attributes, handleChange, isChecked, variant }) });
|
|
7893
|
+
}
|
|
7894
|
+
return /* @__PURE__ */ jsx59(
|
|
7895
|
+
"div",
|
|
7896
|
+
{
|
|
7897
|
+
style: {
|
|
7898
|
+
display: "flex",
|
|
7899
|
+
flexDirection: "column",
|
|
7900
|
+
gap: "0.25rem",
|
|
7901
|
+
margin: "0.25rem 0 0.5rem"
|
|
7902
|
+
},
|
|
7903
|
+
children: attributes.map((attr) => {
|
|
7904
|
+
const inputId = `consent_${isEssential ? "ess" : "opt"}_${purpose.purpose_id}_${attr}`;
|
|
7905
|
+
const checked = isChecked(attr);
|
|
7906
|
+
return /* @__PURE__ */ jsx59(
|
|
7907
|
+
Checkbox_default,
|
|
7908
|
+
{
|
|
7909
|
+
id: inputId,
|
|
7910
|
+
checked,
|
|
7911
|
+
disabled: isEssential,
|
|
7912
|
+
label: attr,
|
|
7913
|
+
onChange: isEssential ? void 0 : (e) => handleChange(attr, e.target.checked)
|
|
7914
|
+
},
|
|
7915
|
+
attr
|
|
7916
|
+
);
|
|
7917
|
+
})
|
|
7918
|
+
}
|
|
7919
|
+
);
|
|
7920
|
+
};
|
|
7921
|
+
var ConsentCheckboxList_default = ConsentCheckboxList;
|
|
7922
|
+
|
|
7923
|
+
// src/components/adapters/Consent.tsx
|
|
7924
|
+
import { Fragment as Fragment14, jsx as jsx60, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
7925
|
+
var Consent = ({ consentData, formValues, onInputChange, children }) => {
|
|
7926
|
+
if (!consentData) return null;
|
|
7927
|
+
let purposes = [];
|
|
7928
|
+
try {
|
|
7929
|
+
const parsed = typeof consentData === "string" ? JSON.parse(consentData) : consentData;
|
|
7930
|
+
purposes = Array.isArray(parsed) ? parsed : parsed.purposes || [];
|
|
7931
|
+
} catch (e) {
|
|
7932
|
+
return null;
|
|
7933
|
+
}
|
|
7934
|
+
if (purposes.length === 0) return null;
|
|
7935
|
+
if (children) {
|
|
7936
|
+
return /* @__PURE__ */ jsx60(Fragment14, { children: children({ formValues, onInputChange, purposes }) });
|
|
7937
|
+
}
|
|
7938
|
+
return /* @__PURE__ */ jsx60("div", { style: { display: "flex", flexDirection: "column", gap: "1rem", marginTop: "0.25rem" }, children: purposes.map((purpose, purposeIndex) => /* @__PURE__ */ jsxs27("div", { style: { paddingBottom: "1rem" }, children: [
|
|
7939
|
+
purpose.essential && purpose.essential.length > 0 && /* @__PURE__ */ jsxs27("div", { style: { marginTop: "0.5rem" }, children: [
|
|
7940
|
+
/* @__PURE__ */ jsx60(Typography_default, { variant: "subtitle2", fontWeight: "bold", children: "Essential Attributes" }),
|
|
7941
|
+
/* @__PURE__ */ jsx60(
|
|
7942
|
+
ConsentCheckboxList_default,
|
|
7943
|
+
{
|
|
7944
|
+
variant: "ESSENTIAL",
|
|
7945
|
+
purpose,
|
|
7946
|
+
formValues,
|
|
7947
|
+
onInputChange
|
|
7948
|
+
}
|
|
7949
|
+
)
|
|
7950
|
+
] }),
|
|
7951
|
+
purpose.optional && purpose.optional.length > 0 && /* @__PURE__ */ jsxs27("div", { style: { marginTop: "0.5rem" }, children: [
|
|
7952
|
+
/* @__PURE__ */ jsx60(Typography_default, { variant: "subtitle2", fontWeight: "bold", children: "Optional Attributes" }),
|
|
7953
|
+
/* @__PURE__ */ jsx60(
|
|
7954
|
+
ConsentCheckboxList_default,
|
|
7955
|
+
{
|
|
7956
|
+
variant: "OPTIONAL",
|
|
7957
|
+
purpose,
|
|
7958
|
+
formValues,
|
|
7959
|
+
onInputChange
|
|
7960
|
+
}
|
|
7961
|
+
)
|
|
7962
|
+
] })
|
|
7963
|
+
] }, purpose.purpose_id || purposeIndex)) });
|
|
7964
|
+
};
|
|
7965
|
+
var Consent_default = Consent;
|
|
7966
|
+
|
|
7967
|
+
// src/components/adapters/FlowTimer.tsx
|
|
7968
|
+
import { useEffect as useEffect15, useState as useState16 } from "react";
|
|
7969
|
+
import { Fragment as Fragment15, jsx as jsx61 } from "react/jsx-runtime";
|
|
7970
|
+
var FlowTimer = ({
|
|
7971
|
+
expiresIn = 0,
|
|
7972
|
+
textTemplate = "Time remaining: {time}",
|
|
7973
|
+
children
|
|
7974
|
+
}) => {
|
|
7975
|
+
const [remaining, setRemaining] = useState16(expiresIn > 0 ? expiresIn : 0);
|
|
7976
|
+
useEffect15(() => {
|
|
7977
|
+
if (expiresIn <= 0) {
|
|
7978
|
+
return void 0;
|
|
7979
|
+
}
|
|
7980
|
+
setRemaining(expiresIn);
|
|
7981
|
+
const interval = setInterval(() => {
|
|
7982
|
+
setRemaining((prev) => {
|
|
7983
|
+
if (prev <= 1) {
|
|
7984
|
+
clearInterval(interval);
|
|
7985
|
+
return 0;
|
|
7986
|
+
}
|
|
7987
|
+
return prev - 1;
|
|
7988
|
+
});
|
|
7989
|
+
}, 1e3);
|
|
7990
|
+
return () => clearInterval(interval);
|
|
7991
|
+
}, [expiresIn]);
|
|
7992
|
+
if (expiresIn <= 0) {
|
|
7993
|
+
return null;
|
|
7994
|
+
}
|
|
7995
|
+
const formatTime = (seconds) => {
|
|
7996
|
+
if (seconds <= 0) {
|
|
7997
|
+
return "Timed out";
|
|
7998
|
+
}
|
|
7999
|
+
const m = Math.floor(seconds / 60);
|
|
8000
|
+
const s = seconds % 60;
|
|
8001
|
+
return `${m}:${s.toString().padStart(2, "0")}`;
|
|
8002
|
+
};
|
|
8003
|
+
const isExpired = remaining <= 0;
|
|
8004
|
+
const formattedTime = formatTime(remaining);
|
|
8005
|
+
if (children) {
|
|
8006
|
+
return /* @__PURE__ */ jsx61(Fragment15, { children: children({ formattedTime, isExpired, remaining }) });
|
|
8007
|
+
}
|
|
8008
|
+
const displayText = isExpired ? "Timed out" : textTemplate.replace("{time}", formattedTime);
|
|
8009
|
+
return /* @__PURE__ */ jsx61(Typography_default, { variant: "body2", children: displayText });
|
|
8010
|
+
};
|
|
8011
|
+
var FlowTimer_default = FlowTimer;
|
|
8012
|
+
|
|
7856
8013
|
// src/components/adapters/ImageComponent.tsx
|
|
7857
|
-
import { jsx as
|
|
8014
|
+
import { jsx as jsx62 } from "react/jsx-runtime";
|
|
7858
8015
|
var ImageComponent = ({ component }) => {
|
|
7859
8016
|
const { theme } = useTheme_default();
|
|
7860
8017
|
const config = component.config || {};
|
|
@@ -7871,7 +8028,7 @@ var ImageComponent = ({ component }) => {
|
|
|
7871
8028
|
if (!src) {
|
|
7872
8029
|
return null;
|
|
7873
8030
|
}
|
|
7874
|
-
return /* @__PURE__ */
|
|
8031
|
+
return /* @__PURE__ */ jsx62("div", { style: { textAlign: "center" }, children: /* @__PURE__ */ jsx62(
|
|
7875
8032
|
"img",
|
|
7876
8033
|
{
|
|
7877
8034
|
src,
|
|
@@ -7888,7 +8045,7 @@ var ImageComponent = ({ component }) => {
|
|
|
7888
8045
|
var ImageComponent_default = ImageComponent;
|
|
7889
8046
|
|
|
7890
8047
|
// src/components/adapters/SmsOtpButton.tsx
|
|
7891
|
-
import { jsx as
|
|
8048
|
+
import { jsx as jsx63 } from "react/jsx-runtime";
|
|
7892
8049
|
var SmsOtpButton = ({
|
|
7893
8050
|
isLoading,
|
|
7894
8051
|
preferences,
|
|
@@ -7896,7 +8053,7 @@ var SmsOtpButton = ({
|
|
|
7896
8053
|
...rest
|
|
7897
8054
|
}) => {
|
|
7898
8055
|
const { t } = useTranslation_default(preferences?.i18n);
|
|
7899
|
-
return /* @__PURE__ */
|
|
8056
|
+
return /* @__PURE__ */ jsx63(
|
|
7900
8057
|
Button_default,
|
|
7901
8058
|
{
|
|
7902
8059
|
...rest,
|
|
@@ -7905,7 +8062,7 @@ var SmsOtpButton = ({
|
|
|
7905
8062
|
color: "secondary",
|
|
7906
8063
|
variant: "solid",
|
|
7907
8064
|
disabled: isLoading,
|
|
7908
|
-
startIcon: /* @__PURE__ */
|
|
8065
|
+
startIcon: /* @__PURE__ */ jsx63("svg", { width: "18", height: "18", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx63(
|
|
7909
8066
|
"path",
|
|
7910
8067
|
{
|
|
7911
8068
|
fill: "currentColor",
|
|
@@ -7919,8 +8076,8 @@ var SmsOtpButton = ({
|
|
|
7919
8076
|
var SmsOtpButton_default = SmsOtpButton;
|
|
7920
8077
|
|
|
7921
8078
|
// src/components/primitives/Icons/ArrowLeftRight.tsx
|
|
7922
|
-
import { jsx as
|
|
7923
|
-
var ArrowLeftRight = ({ color = "currentColor", size = 24 }) => /* @__PURE__ */
|
|
8079
|
+
import { jsx as jsx64, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
8080
|
+
var ArrowLeftRight = ({ color = "currentColor", size = 24 }) => /* @__PURE__ */ jsxs28(
|
|
7924
8081
|
"svg",
|
|
7925
8082
|
{
|
|
7926
8083
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -7933,10 +8090,10 @@ var ArrowLeftRight = ({ color = "currentColor", size = 24 }) => /* @__PURE__ */
|
|
|
7933
8090
|
strokeLinecap: "round",
|
|
7934
8091
|
strokeLinejoin: "round",
|
|
7935
8092
|
children: [
|
|
7936
|
-
/* @__PURE__ */
|
|
7937
|
-
/* @__PURE__ */
|
|
7938
|
-
/* @__PURE__ */
|
|
7939
|
-
/* @__PURE__ */
|
|
8093
|
+
/* @__PURE__ */ jsx64("path", { d: "M8 3 4 7l4 4" }),
|
|
8094
|
+
/* @__PURE__ */ jsx64("path", { d: "M4 7h16" }),
|
|
8095
|
+
/* @__PURE__ */ jsx64("path", { d: "m16 21 4-4-4-4" }),
|
|
8096
|
+
/* @__PURE__ */ jsx64("path", { d: "M20 17H4" })
|
|
7940
8097
|
]
|
|
7941
8098
|
}
|
|
7942
8099
|
);
|
|
@@ -7944,8 +8101,8 @@ ArrowLeftRight.displayName = "ArrowLeftRight";
|
|
|
7944
8101
|
var ArrowLeftRight_default = ArrowLeftRight;
|
|
7945
8102
|
|
|
7946
8103
|
// src/components/primitives/Icons/ArrowRightLeft.tsx
|
|
7947
|
-
import { jsx as
|
|
7948
|
-
var ArrowRightLeft = ({ color = "currentColor", size = 24 }) => /* @__PURE__ */
|
|
8104
|
+
import { jsx as jsx65, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
8105
|
+
var ArrowRightLeft = ({ color = "currentColor", size = 24 }) => /* @__PURE__ */ jsxs29(
|
|
7949
8106
|
"svg",
|
|
7950
8107
|
{
|
|
7951
8108
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -7958,10 +8115,10 @@ var ArrowRightLeft = ({ color = "currentColor", size = 24 }) => /* @__PURE__ */
|
|
|
7958
8115
|
strokeLinecap: "round",
|
|
7959
8116
|
strokeLinejoin: "round",
|
|
7960
8117
|
children: [
|
|
7961
|
-
/* @__PURE__ */
|
|
7962
|
-
/* @__PURE__ */
|
|
7963
|
-
/* @__PURE__ */
|
|
7964
|
-
/* @__PURE__ */
|
|
8118
|
+
/* @__PURE__ */ jsx65("path", { d: "m16 3 4 4-4 4" }),
|
|
8119
|
+
/* @__PURE__ */ jsx65("path", { d: "M20 7H4" }),
|
|
8120
|
+
/* @__PURE__ */ jsx65("path", { d: "m8 21-4-4 4-4" }),
|
|
8121
|
+
/* @__PURE__ */ jsx65("path", { d: "M4 17h16" })
|
|
7965
8122
|
]
|
|
7966
8123
|
}
|
|
7967
8124
|
);
|
|
@@ -7976,7 +8133,7 @@ var flowIconRegistry = {
|
|
|
7976
8133
|
var flowIconRegistry_default = flowIconRegistry;
|
|
7977
8134
|
|
|
7978
8135
|
// src/components/presentation/auth/AuthOptionFactory.tsx
|
|
7979
|
-
import { jsx as
|
|
8136
|
+
import { jsx as jsx66 } from "react/jsx-runtime";
|
|
7980
8137
|
var logger5 = createPackageComponentLogger5(
|
|
7981
8138
|
"@asgardeo/react",
|
|
7982
8139
|
"AuthOptionFactory"
|
|
@@ -8071,31 +8228,53 @@ var createAuthComponentFromFlow = (component, formValues, touchedFields, formErr
|
|
|
8071
8228
|
Object.keys(formValues).forEach((field) => {
|
|
8072
8229
|
formData[field] = formValues[field];
|
|
8073
8230
|
});
|
|
8231
|
+
const consentPrompt = options.additionalData?.["consentPrompt"];
|
|
8232
|
+
if (consentPrompt && eventType.toUpperCase() === EmbeddedFlowEventType.Submit) {
|
|
8233
|
+
const isDeny = componentVariant.toLowerCase() !== "primary";
|
|
8234
|
+
const decisions = {
|
|
8235
|
+
purposes: consentPrompt.purposes.map(
|
|
8236
|
+
(p) => ({
|
|
8237
|
+
approved: !isDeny,
|
|
8238
|
+
elements: [
|
|
8239
|
+
...p.essential.map((attr) => ({ approved: !isDeny, name: attr })),
|
|
8240
|
+
...p.optional.map(
|
|
8241
|
+
(attr) => ({
|
|
8242
|
+
approved: isDeny ? false : formValues[getConsentOptionalKey(p.purpose_id, attr)] !== "false",
|
|
8243
|
+
name: attr
|
|
8244
|
+
})
|
|
8245
|
+
)
|
|
8246
|
+
],
|
|
8247
|
+
purpose_name: p.purpose_name
|
|
8248
|
+
})
|
|
8249
|
+
)
|
|
8250
|
+
};
|
|
8251
|
+
formData["consent_decisions"] = JSON.stringify(decisions);
|
|
8252
|
+
}
|
|
8074
8253
|
options.onSubmit(component, formData, shouldSkipValidation);
|
|
8075
8254
|
}
|
|
8076
8255
|
};
|
|
8077
8256
|
if (matchesSocialProvider(actionId, eventType, buttonText, "google", authType, componentVariant)) {
|
|
8078
|
-
return /* @__PURE__ */
|
|
8257
|
+
return /* @__PURE__ */ jsx66(GoogleButton_default, { onClick: handleClick, className: options.buttonClassName }, key);
|
|
8079
8258
|
}
|
|
8080
8259
|
if (matchesSocialProvider(actionId, eventType, buttonText, "github", authType, componentVariant)) {
|
|
8081
|
-
return /* @__PURE__ */
|
|
8260
|
+
return /* @__PURE__ */ jsx66(GitHubButton_default, { onClick: handleClick, className: options.buttonClassName }, key);
|
|
8082
8261
|
}
|
|
8083
8262
|
if (matchesSocialProvider(actionId, eventType, buttonText, "facebook", authType, componentVariant)) {
|
|
8084
|
-
return /* @__PURE__ */
|
|
8263
|
+
return /* @__PURE__ */ jsx66(FacebookButton_default, { onClick: handleClick, className: options.buttonClassName }, key);
|
|
8085
8264
|
}
|
|
8086
8265
|
if (matchesSocialProvider(actionId, eventType, buttonText, "microsoft", authType, componentVariant)) {
|
|
8087
|
-
return /* @__PURE__ */
|
|
8266
|
+
return /* @__PURE__ */ jsx66(MicrosoftButton_default, { onClick: handleClick, className: options.buttonClassName }, key);
|
|
8088
8267
|
}
|
|
8089
8268
|
if (matchesSocialProvider(actionId, eventType, buttonText, "linkedin", authType, componentVariant)) {
|
|
8090
|
-
return /* @__PURE__ */
|
|
8269
|
+
return /* @__PURE__ */ jsx66(LinkedInButton_default, { onClick: handleClick, className: options.buttonClassName }, key);
|
|
8091
8270
|
}
|
|
8092
8271
|
if (matchesSocialProvider(actionId, eventType, buttonText, "ethereum", authType, componentVariant)) {
|
|
8093
|
-
return /* @__PURE__ */
|
|
8272
|
+
return /* @__PURE__ */ jsx66(SignInWithEthereumButton_default, { onClick: handleClick, className: options.buttonClassName }, key);
|
|
8094
8273
|
}
|
|
8095
8274
|
if (actionId === "prompt_mobile" || eventType === "prompt_mobile") {
|
|
8096
|
-
return /* @__PURE__ */
|
|
8275
|
+
return /* @__PURE__ */ jsx66(SmsOtpButton_default, { onClick: handleClick, className: options.buttonClassName }, key);
|
|
8097
8276
|
}
|
|
8098
|
-
const startIconEl = component.startIcon ? /* @__PURE__ */
|
|
8277
|
+
const startIconEl = component.startIcon ? /* @__PURE__ */ jsx66(
|
|
8099
8278
|
"img",
|
|
8100
8279
|
{
|
|
8101
8280
|
src: component.startIcon,
|
|
@@ -8104,7 +8283,7 @@ var createAuthComponentFromFlow = (component, formValues, touchedFields, formErr
|
|
|
8104
8283
|
style: { height: "1.25em", objectFit: "contain", width: "1.25em" }
|
|
8105
8284
|
}
|
|
8106
8285
|
) : null;
|
|
8107
|
-
const endIconEl = component.endIcon ? /* @__PURE__ */
|
|
8286
|
+
const endIconEl = component.endIcon ? /* @__PURE__ */ jsx66(
|
|
8108
8287
|
"img",
|
|
8109
8288
|
{
|
|
8110
8289
|
src: component.endIcon,
|
|
@@ -8113,12 +8292,12 @@ var createAuthComponentFromFlow = (component, formValues, touchedFields, formErr
|
|
|
8113
8292
|
style: { height: "1.25em", objectFit: "contain", width: "1.25em" }
|
|
8114
8293
|
}
|
|
8115
8294
|
) : null;
|
|
8116
|
-
return /* @__PURE__ */
|
|
8295
|
+
return /* @__PURE__ */ jsx66(
|
|
8117
8296
|
Button_default,
|
|
8118
8297
|
{
|
|
8119
8298
|
fullWidth: true,
|
|
8120
8299
|
onClick: handleClick,
|
|
8121
|
-
disabled: isLoading || !isFormValid,
|
|
8300
|
+
disabled: isLoading || !isFormValid && !shouldSkipValidation || options.isTimeoutDisabled || component.config?.disabled,
|
|
8122
8301
|
className: options.buttonClassName,
|
|
8123
8302
|
"data-testid": "asgardeo-signin-submit",
|
|
8124
8303
|
variant: component.variant?.toLowerCase() === "primary" ? "solid" : "outline",
|
|
@@ -8132,10 +8311,10 @@ var createAuthComponentFromFlow = (component, formValues, touchedFields, formErr
|
|
|
8132
8311
|
}
|
|
8133
8312
|
case EmbeddedFlowComponentType.Text: {
|
|
8134
8313
|
const variant = getTypographyVariant(component.variant);
|
|
8135
|
-
return /* @__PURE__ */
|
|
8314
|
+
return /* @__PURE__ */ jsx66(Typography_default, { variant, children: resolve(component.label) }, key);
|
|
8136
8315
|
}
|
|
8137
8316
|
case EmbeddedFlowComponentType.Divider: {
|
|
8138
|
-
return /* @__PURE__ */
|
|
8317
|
+
return /* @__PURE__ */ jsx66(Divider_default, { children: resolve(component.label) || "" }, key);
|
|
8139
8318
|
}
|
|
8140
8319
|
case EmbeddedFlowComponentType.Select: {
|
|
8141
8320
|
const identifier = component.ref;
|
|
@@ -8146,7 +8325,7 @@ var createAuthComponentFromFlow = (component, formValues, touchedFields, formErr
|
|
|
8146
8325
|
label: typeof opt === "string" ? opt : String(opt.label ?? opt.value ?? ""),
|
|
8147
8326
|
value: typeof opt === "string" ? opt : String(opt.value ?? "")
|
|
8148
8327
|
}));
|
|
8149
|
-
return /* @__PURE__ */
|
|
8328
|
+
return /* @__PURE__ */ jsx66(
|
|
8150
8329
|
Select_default,
|
|
8151
8330
|
{
|
|
8152
8331
|
name: identifier,
|
|
@@ -8181,12 +8360,12 @@ var createAuthComponentFromFlow = (component, formValues, touchedFields, formErr
|
|
|
8181
8360
|
}
|
|
8182
8361
|
)
|
|
8183
8362
|
).filter(Boolean);
|
|
8184
|
-
return /* @__PURE__ */
|
|
8363
|
+
return /* @__PURE__ */ jsx66("form", { id: component.id, children: blockComponents }, key);
|
|
8185
8364
|
}
|
|
8186
8365
|
return null;
|
|
8187
8366
|
}
|
|
8188
8367
|
case EmbeddedFlowComponentType.RichText: {
|
|
8189
|
-
return /* @__PURE__ */
|
|
8368
|
+
return /* @__PURE__ */ jsx66(
|
|
8190
8369
|
"div",
|
|
8191
8370
|
{
|
|
8192
8371
|
className: richTextClass,
|
|
@@ -8198,7 +8377,7 @@ var createAuthComponentFromFlow = (component, formValues, touchedFields, formErr
|
|
|
8198
8377
|
case EmbeddedFlowComponentType.Image: {
|
|
8199
8378
|
const explicitHeight = resolve(component.height?.toString());
|
|
8200
8379
|
const explicitWidth = resolve(component.width?.toString());
|
|
8201
|
-
return /* @__PURE__ */
|
|
8380
|
+
return /* @__PURE__ */ jsx66(
|
|
8202
8381
|
ImageComponent_default,
|
|
8203
8382
|
{
|
|
8204
8383
|
component: {
|
|
@@ -8228,7 +8407,7 @@ var createAuthComponentFromFlow = (component, formValues, touchedFields, formErr
|
|
|
8228
8407
|
logger5.warn(`Unknown icon name: "${iconName}". Skipping render.`);
|
|
8229
8408
|
return null;
|
|
8230
8409
|
}
|
|
8231
|
-
return /* @__PURE__ */
|
|
8410
|
+
return /* @__PURE__ */ jsx66(IconComponent, { size: component.size || 24, color: component.color || "currentColor" }, key);
|
|
8232
8411
|
}
|
|
8233
8412
|
case EmbeddedFlowComponentType.Stack: {
|
|
8234
8413
|
const direction = component.direction || "row";
|
|
@@ -8260,7 +8439,25 @@ var createAuthComponentFromFlow = (component, formValues, touchedFields, formErr
|
|
|
8260
8439
|
}
|
|
8261
8440
|
)
|
|
8262
8441
|
) : [];
|
|
8263
|
-
return /* @__PURE__ */
|
|
8442
|
+
return /* @__PURE__ */ jsx66("div", { style: stackStyle, children: stackChildren }, key);
|
|
8443
|
+
}
|
|
8444
|
+
case EmbeddedFlowComponentType.Consent: {
|
|
8445
|
+
const consentPromptRawData = options.additionalData?.["consentPrompt"];
|
|
8446
|
+
return /* @__PURE__ */ jsx66(
|
|
8447
|
+
Consent_default,
|
|
8448
|
+
{
|
|
8449
|
+
consentData: consentPromptRawData,
|
|
8450
|
+
formValues,
|
|
8451
|
+
onInputChange
|
|
8452
|
+
},
|
|
8453
|
+
key
|
|
8454
|
+
);
|
|
8455
|
+
}
|
|
8456
|
+
case EmbeddedFlowComponentType.Timer: {
|
|
8457
|
+
const textTemplate = resolve(component.label) || "Time remaining: {time}";
|
|
8458
|
+
const timeoutMs = Number(options.additionalData?.["stepTimeout"]) || 0;
|
|
8459
|
+
const expiresIn = timeoutMs > 0 ? Math.max(0, Math.floor((timeoutMs - Date.now()) / 1e3)) : 0;
|
|
8460
|
+
return /* @__PURE__ */ jsx66(FlowTimer_default, { expiresIn, textTemplate }, key);
|
|
8264
8461
|
}
|
|
8265
8462
|
default:
|
|
8266
8463
|
logger5.warn(`Unsupported component type: ${component.type}. Skipping render.`);
|
|
@@ -8317,7 +8514,7 @@ var renderInviteUserComponents = (components, formValues, touchedFields, formErr
|
|
|
8317
8514
|
).filter(Boolean);
|
|
8318
8515
|
|
|
8319
8516
|
// src/components/presentation/auth/SignIn/v2/BaseSignIn.tsx
|
|
8320
|
-
import { jsx as
|
|
8517
|
+
import { jsx as jsx67, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
8321
8518
|
var BaseSignInContent2 = ({
|
|
8322
8519
|
components = [],
|
|
8323
8520
|
onSubmit,
|
|
@@ -8332,15 +8529,17 @@ var BaseSignInContent2 = ({
|
|
|
8332
8529
|
isLoading: externalIsLoading,
|
|
8333
8530
|
children,
|
|
8334
8531
|
showTitle = true,
|
|
8335
|
-
showSubtitle = true
|
|
8532
|
+
showSubtitle = true,
|
|
8533
|
+
additionalData = {},
|
|
8534
|
+
isTimeoutDisabled = false
|
|
8336
8535
|
}) => {
|
|
8337
8536
|
const { meta } = useAsgardeo_default();
|
|
8338
8537
|
const { theme } = useTheme_default();
|
|
8339
8538
|
const { t } = useTranslation_default();
|
|
8340
8539
|
const { subtitle: flowSubtitle, title: flowTitle, messages: flowMessages, addMessage, clearMessages } = useFlow_default();
|
|
8341
8540
|
const styles = BaseSignIn_styles_default(theme, theme.vars.colors.text.primary);
|
|
8342
|
-
const [isSubmitting, setIsSubmitting] =
|
|
8343
|
-
const [apiError, setApiError] =
|
|
8541
|
+
const [isSubmitting, setIsSubmitting] = useState17(false);
|
|
8542
|
+
const [apiError, setApiError] = useState17(null);
|
|
8344
8543
|
const isLoading = externalIsLoading || isSubmitting;
|
|
8345
8544
|
const handleError = useCallback11(
|
|
8346
8545
|
(error) => {
|
|
@@ -8479,8 +8678,10 @@ var BaseSignInContent2 = ({
|
|
|
8479
8678
|
isFormValid,
|
|
8480
8679
|
handleInputChange,
|
|
8481
8680
|
{
|
|
8681
|
+
additionalData,
|
|
8482
8682
|
buttonClassName: buttonClasses,
|
|
8483
8683
|
inputClassName: inputClasses,
|
|
8684
|
+
isTimeoutDisabled,
|
|
8484
8685
|
meta,
|
|
8485
8686
|
onInputBlur: handleInputBlur,
|
|
8486
8687
|
onSubmit: handleSubmit,
|
|
@@ -8490,6 +8691,7 @@ var BaseSignInContent2 = ({
|
|
|
8490
8691
|
}
|
|
8491
8692
|
),
|
|
8492
8693
|
[
|
|
8694
|
+
additionalData,
|
|
8493
8695
|
formValues,
|
|
8494
8696
|
touchedFields,
|
|
8495
8697
|
formErrors,
|
|
@@ -8502,7 +8704,8 @@ var BaseSignInContent2 = ({
|
|
|
8502
8704
|
inputClasses,
|
|
8503
8705
|
buttonClasses,
|
|
8504
8706
|
handleInputBlur,
|
|
8505
|
-
handleSubmit
|
|
8707
|
+
handleSubmit,
|
|
8708
|
+
isTimeoutDisabled
|
|
8506
8709
|
]
|
|
8507
8710
|
);
|
|
8508
8711
|
if (children) {
|
|
@@ -8513,6 +8716,7 @@ var BaseSignInContent2 = ({
|
|
|
8513
8716
|
handleInputChange,
|
|
8514
8717
|
handleSubmit,
|
|
8515
8718
|
isLoading,
|
|
8719
|
+
isTimeoutDisabled,
|
|
8516
8720
|
isValid: isFormValid,
|
|
8517
8721
|
messages: flowMessages || [],
|
|
8518
8722
|
meta,
|
|
@@ -8525,13 +8729,13 @@ var BaseSignInContent2 = ({
|
|
|
8525
8729
|
},
|
|
8526
8730
|
values: formValues
|
|
8527
8731
|
};
|
|
8528
|
-
return /* @__PURE__ */
|
|
8732
|
+
return /* @__PURE__ */ jsx67("div", { className: containerClasses, "data-testid": "asgardeo-signin", children: children(renderProps) });
|
|
8529
8733
|
}
|
|
8530
8734
|
if (isLoading) {
|
|
8531
|
-
return /* @__PURE__ */
|
|
8735
|
+
return /* @__PURE__ */ jsx67(Card_default, { className: cx20(containerClasses, styles.card), "data-testid": "asgardeo-signin", variant, children: /* @__PURE__ */ jsx67(Card_default.Content, { children: /* @__PURE__ */ jsx67("div", { style: { display: "flex", justifyContent: "center", padding: "2rem" }, children: /* @__PURE__ */ jsx67(Spinner_default, {}) }) }) });
|
|
8532
8736
|
}
|
|
8533
8737
|
if (!components || components.length === 0) {
|
|
8534
|
-
return /* @__PURE__ */
|
|
8738
|
+
return /* @__PURE__ */ jsx67(Card_default, { className: cx20(containerClasses, styles.card), "data-testid": "asgardeo-signin", variant, children: /* @__PURE__ */ jsx67(Card_default.Content, { children: /* @__PURE__ */ jsx67(Alert_default, { variant: "warning", children: /* @__PURE__ */ jsx67(Typography_default, { variant: "body1", children: t("errors.signin.components.not.available") }) }) }) });
|
|
8535
8739
|
}
|
|
8536
8740
|
const {
|
|
8537
8741
|
title: rawTitle,
|
|
@@ -8540,46 +8744,46 @@ var BaseSignInContent2 = ({
|
|
|
8540
8744
|
} = getAuthComponentHeadings_default(components, flowTitle, flowSubtitle, void 0, void 0);
|
|
8541
8745
|
const title = resolveVars3(rawTitle, { meta, t });
|
|
8542
8746
|
const subtitle = resolveVars3(rawSubtitle, { meta, t });
|
|
8543
|
-
return /* @__PURE__ */
|
|
8544
|
-
(showTitle || showSubtitle) && /* @__PURE__ */
|
|
8545
|
-
showTitle && /* @__PURE__ */
|
|
8546
|
-
showSubtitle && /* @__PURE__ */
|
|
8747
|
+
return /* @__PURE__ */ jsxs30(Card_default, { className: cx20(containerClasses, styles.card), "data-testid": "asgardeo-signin", variant, children: [
|
|
8748
|
+
(showTitle || showSubtitle) && /* @__PURE__ */ jsxs30(Card_default.Header, { className: styles.header, children: [
|
|
8749
|
+
showTitle && /* @__PURE__ */ jsx67(Card_default.Title, { level: 2, className: styles.title, children: title }),
|
|
8750
|
+
showSubtitle && /* @__PURE__ */ jsx67(Typography_default, { variant: "body1", className: styles.subtitle, children: subtitle })
|
|
8547
8751
|
] }),
|
|
8548
|
-
/* @__PURE__ */
|
|
8549
|
-
externalError && /* @__PURE__ */
|
|
8550
|
-
flowMessages && flowMessages.length > 0 && /* @__PURE__ */
|
|
8752
|
+
/* @__PURE__ */ jsxs30(Card_default.Content, { children: [
|
|
8753
|
+
externalError && /* @__PURE__ */ jsx67("div", { className: styles.flowMessagesContainer, children: /* @__PURE__ */ jsx67(Alert_default, { variant: "error", className: cx20(styles.flowMessageItem, messageClasses), children: /* @__PURE__ */ jsx67(Alert_default.Description, { children: externalError.message }) }) }),
|
|
8754
|
+
flowMessages && flowMessages.length > 0 && /* @__PURE__ */ jsx67("div", { className: styles.flowMessagesContainer, children: flowMessages.map((message, index) => /* @__PURE__ */ jsx67(
|
|
8551
8755
|
Alert_default,
|
|
8552
8756
|
{
|
|
8553
8757
|
variant: message.type === "error" ? "error" : "info",
|
|
8554
8758
|
className: cx20(styles.flowMessageItem, messageClasses),
|
|
8555
|
-
children: /* @__PURE__ */
|
|
8759
|
+
children: /* @__PURE__ */ jsx67(Alert_default.Description, { children: message.message })
|
|
8556
8760
|
},
|
|
8557
8761
|
index
|
|
8558
8762
|
)) }),
|
|
8559
|
-
/* @__PURE__ */
|
|
8763
|
+
/* @__PURE__ */ jsx67("div", { className: styles.contentContainer, children: componentsWithoutHeadings && renderComponents(componentsWithoutHeadings) })
|
|
8560
8764
|
] })
|
|
8561
8765
|
] });
|
|
8562
8766
|
};
|
|
8563
8767
|
var BaseSignIn2 = ({ preferences, showLogo = true, ...rest }) => {
|
|
8564
8768
|
const { theme } = useTheme_default();
|
|
8565
8769
|
const styles = BaseSignIn_styles_default(theme, theme.vars.colors.text.primary);
|
|
8566
|
-
const content = /* @__PURE__ */
|
|
8567
|
-
showLogo && /* @__PURE__ */
|
|
8568
|
-
/* @__PURE__ */
|
|
8770
|
+
const content = /* @__PURE__ */ jsxs30("div", { children: [
|
|
8771
|
+
showLogo && /* @__PURE__ */ jsx67("div", { className: styles.logoContainer, children: /* @__PURE__ */ jsx67(Logo_default, { size: "large" }) }),
|
|
8772
|
+
/* @__PURE__ */ jsx67(FlowProvider_default, { children: /* @__PURE__ */ jsx67(BaseSignInContent2, { showLogo, ...rest }) })
|
|
8569
8773
|
] });
|
|
8570
8774
|
if (!preferences) return content;
|
|
8571
|
-
return /* @__PURE__ */
|
|
8775
|
+
return /* @__PURE__ */ jsx67(ComponentPreferencesContext_default.Provider, { value: preferences, children: content });
|
|
8572
8776
|
};
|
|
8573
8777
|
var BaseSignIn_default2 = BaseSignIn2;
|
|
8574
8778
|
|
|
8575
8779
|
// src/components/presentation/auth/SignIn/BaseSignIn.tsx
|
|
8576
|
-
import { jsx as
|
|
8780
|
+
import { jsx as jsx68 } from "react/jsx-runtime";
|
|
8577
8781
|
var BaseSignIn3 = (props) => {
|
|
8578
8782
|
const { platform } = useAsgardeo_default();
|
|
8579
8783
|
if (platform === Platform4.AsgardeoV2) {
|
|
8580
|
-
return /* @__PURE__ */
|
|
8784
|
+
return /* @__PURE__ */ jsx68(BaseSignIn_default2, { ...props });
|
|
8581
8785
|
}
|
|
8582
|
-
return /* @__PURE__ */
|
|
8786
|
+
return /* @__PURE__ */ jsx68(BaseSignIn_default, { ...props });
|
|
8583
8787
|
};
|
|
8584
8788
|
var BaseSignIn_default3 = BaseSignIn3;
|
|
8585
8789
|
|
|
@@ -8595,10 +8799,10 @@ import {
|
|
|
8595
8799
|
EmbeddedSignInFlowStatusV2 as EmbeddedSignInFlowStatusV22,
|
|
8596
8800
|
EmbeddedSignInFlowTypeV2
|
|
8597
8801
|
} from "@asgardeo/browser";
|
|
8598
|
-
import { useState as
|
|
8802
|
+
import { useState as useState18, useEffect as useEffect17, useRef as useRef7 } from "react";
|
|
8599
8803
|
|
|
8600
8804
|
// src/hooks/v2/useOAuthCallback.ts
|
|
8601
|
-
import { useEffect as
|
|
8805
|
+
import { useEffect as useEffect16, useRef as useRef6 } from "react";
|
|
8602
8806
|
function cleanupUrlParams() {
|
|
8603
8807
|
if (typeof window === "undefined") return;
|
|
8604
8808
|
const url = new URL(window.location.href);
|
|
@@ -8625,7 +8829,7 @@ function useOAuthCallback({
|
|
|
8625
8829
|
}) {
|
|
8626
8830
|
const internalRef = useRef6(false);
|
|
8627
8831
|
const oauthCodeProcessedRef = processedRef ?? internalRef;
|
|
8628
|
-
|
|
8832
|
+
useEffect16(() => {
|
|
8629
8833
|
if (!isInitialized || isSubmitting) {
|
|
8630
8834
|
return;
|
|
8631
8835
|
}
|
|
@@ -8871,7 +9075,7 @@ var handlePasskeyAuthentication = async (challengeData) => {
|
|
|
8871
9075
|
};
|
|
8872
9076
|
|
|
8873
9077
|
// src/components/presentation/auth/SignIn/v2/SignIn.tsx
|
|
8874
|
-
import { Fragment as
|
|
9078
|
+
import { Fragment as Fragment16, jsx as jsx69 } from "react/jsx-runtime";
|
|
8875
9079
|
var SignIn = ({
|
|
8876
9080
|
className,
|
|
8877
9081
|
preferences,
|
|
@@ -8883,12 +9087,14 @@ var SignIn = ({
|
|
|
8883
9087
|
}) => {
|
|
8884
9088
|
const { applicationId, afterSignInUrl, signIn, isInitialized, isLoading, meta } = useAsgardeo_default();
|
|
8885
9089
|
const { t } = useTranslation_default(preferences?.i18n);
|
|
8886
|
-
const [components, setComponents] =
|
|
8887
|
-
const [
|
|
8888
|
-
const [
|
|
8889
|
-
const [
|
|
8890
|
-
const [
|
|
8891
|
-
const [
|
|
9090
|
+
const [components, setComponents] = useState18([]);
|
|
9091
|
+
const [additionalData, setAdditionalData] = useState18({});
|
|
9092
|
+
const [currentFlowId, setCurrentFlowId] = useState18(null);
|
|
9093
|
+
const [isFlowInitialized, setIsFlowInitialized] = useState18(false);
|
|
9094
|
+
const [flowError, setFlowError] = useState18(null);
|
|
9095
|
+
const [isSubmitting, setIsSubmitting] = useState18(false);
|
|
9096
|
+
const [isTimeoutDisabled, setIsTimeoutDisabled] = useState18(false);
|
|
9097
|
+
const [passkeyState, setPasskeyState] = useState18({
|
|
8892
9098
|
actionId: null,
|
|
8893
9099
|
challenge: null,
|
|
8894
9100
|
creationOptions: null,
|
|
@@ -8911,6 +9117,7 @@ var SignIn = ({
|
|
|
8911
9117
|
setFlowId(null);
|
|
8912
9118
|
setIsFlowInitialized(false);
|
|
8913
9119
|
sessionStorage.removeItem("asgardeo_auth_id");
|
|
9120
|
+
setIsTimeoutDisabled(false);
|
|
8914
9121
|
oauthCodeProcessedRef.current = false;
|
|
8915
9122
|
};
|
|
8916
9123
|
const getUrlParams2 = () => {
|
|
@@ -9008,7 +9215,11 @@ var SignIn = ({
|
|
|
9008
9215
|
if (handleRedirection(response)) {
|
|
9009
9216
|
return;
|
|
9010
9217
|
}
|
|
9011
|
-
const {
|
|
9218
|
+
const {
|
|
9219
|
+
flowId: normalizedFlowId,
|
|
9220
|
+
components: normalizedComponents,
|
|
9221
|
+
additionalData: normalizedAdditionalData
|
|
9222
|
+
} = normalizeFlowResponse(
|
|
9012
9223
|
response,
|
|
9013
9224
|
t,
|
|
9014
9225
|
{
|
|
@@ -9019,7 +9230,9 @@ var SignIn = ({
|
|
|
9019
9230
|
if (normalizedFlowId && normalizedComponents) {
|
|
9020
9231
|
setFlowId(normalizedFlowId);
|
|
9021
9232
|
setComponents(normalizedComponents);
|
|
9233
|
+
setAdditionalData(normalizedAdditionalData ?? {});
|
|
9022
9234
|
setIsFlowInitialized(true);
|
|
9235
|
+
setIsTimeoutDisabled(false);
|
|
9023
9236
|
cleanupFlowUrlParams();
|
|
9024
9237
|
}
|
|
9025
9238
|
} catch (error) {
|
|
@@ -9030,33 +9243,104 @@ var SignIn = ({
|
|
|
9030
9243
|
initializationAttemptedRef.current = false;
|
|
9031
9244
|
}
|
|
9032
9245
|
};
|
|
9033
|
-
|
|
9246
|
+
useEffect17(() => {
|
|
9034
9247
|
const urlParams = getUrlParams2();
|
|
9035
9248
|
if (urlParams.error) {
|
|
9036
9249
|
handleOAuthError(urlParams.error, urlParams.errorDescription);
|
|
9037
9250
|
return;
|
|
9038
9251
|
}
|
|
9039
9252
|
handleAuthId(urlParams.authId);
|
|
9040
|
-
|
|
9041
|
-
|
|
9042
|
-
}
|
|
9253
|
+
}, []);
|
|
9254
|
+
useEffect17(() => {
|
|
9043
9255
|
const currentUrlParams = getUrlParams2();
|
|
9044
9256
|
if (isInitialized && !isLoading && !isFlowInitialized && !initializationAttemptedRef.current && !currentFlowId && !currentUrlParams.code && !currentUrlParams.state && !isSubmitting && !oauthCodeProcessedRef.current) {
|
|
9045
9257
|
initializationAttemptedRef.current = true;
|
|
9046
9258
|
initializeFlow();
|
|
9047
9259
|
}
|
|
9048
9260
|
}, [isInitialized, isLoading, isFlowInitialized, currentFlowId]);
|
|
9261
|
+
useEffect17(() => {
|
|
9262
|
+
const timeoutMs = Number(additionalData?.["stepTimeout"]) || 0;
|
|
9263
|
+
if (timeoutMs <= 0 || !isFlowInitialized) {
|
|
9264
|
+
setIsTimeoutDisabled(false);
|
|
9265
|
+
return void 0;
|
|
9266
|
+
}
|
|
9267
|
+
const remaining = Math.max(0, Math.floor((timeoutMs - Date.now()) / 1e3));
|
|
9268
|
+
const handleTimeout = () => {
|
|
9269
|
+
const errorMessage = t("errors.signin.timeout") || "Time allowed to complete the step has expired.";
|
|
9270
|
+
setError(new Error(errorMessage));
|
|
9271
|
+
setIsTimeoutDisabled(true);
|
|
9272
|
+
};
|
|
9273
|
+
if (remaining <= 0) {
|
|
9274
|
+
handleTimeout();
|
|
9275
|
+
return void 0;
|
|
9276
|
+
}
|
|
9277
|
+
const timerId = setTimeout(() => {
|
|
9278
|
+
handleTimeout();
|
|
9279
|
+
}, remaining * 1e3);
|
|
9280
|
+
return () => clearTimeout(timerId);
|
|
9281
|
+
}, [additionalData?.["stepTimeout"], isFlowInitialized, t]);
|
|
9049
9282
|
const handleSubmit = async (payload) => {
|
|
9050
9283
|
const effectiveFlowId = payload.flowId || currentFlowId;
|
|
9051
9284
|
if (!effectiveFlowId) {
|
|
9052
9285
|
throw new Error("No active flow ID");
|
|
9053
9286
|
}
|
|
9287
|
+
const processedInputs = { ...payload.inputs };
|
|
9288
|
+
if (additionalData?.["consentPrompt"]) {
|
|
9289
|
+
try {
|
|
9290
|
+
const consentPromptRawData = additionalData["consentPrompt"];
|
|
9291
|
+
const purposes = typeof consentPromptRawData === "string" ? JSON.parse(consentPromptRawData) : consentPromptRawData.purposes || consentPromptRawData;
|
|
9292
|
+
let isDeny = false;
|
|
9293
|
+
if (payload.action) {
|
|
9294
|
+
const findAction = (comps) => {
|
|
9295
|
+
if (!comps || comps.length === 0) return null;
|
|
9296
|
+
const found = comps.find((c) => c.id === payload.action);
|
|
9297
|
+
if (found) return found;
|
|
9298
|
+
return comps.reduce((acc, c) => {
|
|
9299
|
+
if (acc) return acc;
|
|
9300
|
+
if (c.components) return findAction(c.components);
|
|
9301
|
+
return null;
|
|
9302
|
+
}, null);
|
|
9303
|
+
};
|
|
9304
|
+
const submitAction = findAction(components);
|
|
9305
|
+
if (submitAction && submitAction.variant?.toLowerCase() !== "primary") {
|
|
9306
|
+
isDeny = true;
|
|
9307
|
+
}
|
|
9308
|
+
}
|
|
9309
|
+
const decisions = {
|
|
9310
|
+
purposes: purposes.map((p) => ({
|
|
9311
|
+
approved: !isDeny,
|
|
9312
|
+
elements: [
|
|
9313
|
+
...(p.essential || []).map((attr) => ({
|
|
9314
|
+
approved: !isDeny,
|
|
9315
|
+
name: attr
|
|
9316
|
+
})),
|
|
9317
|
+
...(p.optional || []).map((attr) => {
|
|
9318
|
+
const key = `__consent_opt__${p.purpose_id}__${attr}`;
|
|
9319
|
+
return {
|
|
9320
|
+
approved: isDeny ? false : processedInputs[key] !== "false",
|
|
9321
|
+
name: attr
|
|
9322
|
+
};
|
|
9323
|
+
})
|
|
9324
|
+
],
|
|
9325
|
+
purpose_name: p.purpose_name
|
|
9326
|
+
}))
|
|
9327
|
+
};
|
|
9328
|
+
processedInputs["consent_decisions"] = JSON.stringify(decisions);
|
|
9329
|
+
Object.keys(processedInputs).forEach((key) => {
|
|
9330
|
+
if (key.startsWith("__consent_opt__")) {
|
|
9331
|
+
delete processedInputs[key];
|
|
9332
|
+
}
|
|
9333
|
+
});
|
|
9334
|
+
} catch (e) {
|
|
9335
|
+
}
|
|
9336
|
+
}
|
|
9054
9337
|
try {
|
|
9055
9338
|
setIsSubmitting(true);
|
|
9056
9339
|
setFlowError(null);
|
|
9057
9340
|
const response = await signIn({
|
|
9058
9341
|
flowId: effectiveFlowId,
|
|
9059
|
-
...payload
|
|
9342
|
+
...payload,
|
|
9343
|
+
inputs: processedInputs
|
|
9060
9344
|
});
|
|
9061
9345
|
if (handleRedirection(response)) {
|
|
9062
9346
|
return;
|
|
@@ -9076,7 +9360,11 @@ var SignIn = ({
|
|
|
9076
9360
|
setIsSubmitting(false);
|
|
9077
9361
|
return;
|
|
9078
9362
|
}
|
|
9079
|
-
const {
|
|
9363
|
+
const {
|
|
9364
|
+
flowId: normalizedFlowId,
|
|
9365
|
+
components: normalizedComponents,
|
|
9366
|
+
additionalData: normalizedAdditionalData
|
|
9367
|
+
} = normalizeFlowResponse(
|
|
9080
9368
|
response,
|
|
9081
9369
|
t,
|
|
9082
9370
|
{
|
|
@@ -9116,6 +9404,8 @@ var SignIn = ({
|
|
|
9116
9404
|
if (normalizedFlowId && normalizedComponents) {
|
|
9117
9405
|
setFlowId(normalizedFlowId);
|
|
9118
9406
|
setComponents(normalizedComponents);
|
|
9407
|
+
setAdditionalData(normalizedAdditionalData ?? {});
|
|
9408
|
+
setIsTimeoutDisabled(false);
|
|
9119
9409
|
setIsFlowInitialized(true);
|
|
9120
9410
|
cleanupFlowUrlParams();
|
|
9121
9411
|
if (response?.failureReason) {
|
|
@@ -9147,7 +9437,7 @@ var SignIn = ({
|
|
|
9147
9437
|
processedRef: oauthCodeProcessedRef,
|
|
9148
9438
|
setFlowId
|
|
9149
9439
|
});
|
|
9150
|
-
|
|
9440
|
+
useEffect17(() => {
|
|
9151
9441
|
if (!passkeyState.isActive || !passkeyState.challenge && !passkeyState.creationOptions || !passkeyState.flowId) {
|
|
9152
9442
|
return;
|
|
9153
9443
|
}
|
|
@@ -9200,21 +9490,25 @@ var SignIn = ({
|
|
|
9200
9490
|
}, [passkeyState.isActive, passkeyState.challenge, passkeyState.creationOptions, passkeyState.flowId]);
|
|
9201
9491
|
if (children) {
|
|
9202
9492
|
const renderProps = {
|
|
9493
|
+
additionalData,
|
|
9203
9494
|
components,
|
|
9204
9495
|
error: flowError,
|
|
9205
9496
|
initialize: initializeFlow,
|
|
9206
9497
|
isInitialized: isFlowInitialized,
|
|
9207
9498
|
isLoading: isLoading || isSubmitting || !isInitialized,
|
|
9499
|
+
isTimeoutDisabled,
|
|
9208
9500
|
meta,
|
|
9209
9501
|
onSubmit: handleSubmit
|
|
9210
9502
|
};
|
|
9211
|
-
return /* @__PURE__ */
|
|
9503
|
+
return /* @__PURE__ */ jsx69(Fragment16, { children: children(renderProps) });
|
|
9212
9504
|
}
|
|
9213
|
-
return /* @__PURE__ */
|
|
9505
|
+
return /* @__PURE__ */ jsx69(
|
|
9214
9506
|
BaseSignIn_default2,
|
|
9215
9507
|
{
|
|
9508
|
+
additionalData,
|
|
9216
9509
|
components,
|
|
9217
9510
|
isLoading: isLoading || !isInitialized || !isFlowInitialized,
|
|
9511
|
+
isTimeoutDisabled,
|
|
9218
9512
|
onSubmit: handleSubmit,
|
|
9219
9513
|
onError: handleError,
|
|
9220
9514
|
error: flowError,
|
|
@@ -9228,7 +9522,7 @@ var SignIn = ({
|
|
|
9228
9522
|
var SignIn_default = SignIn;
|
|
9229
9523
|
|
|
9230
9524
|
// src/components/presentation/auth/SignIn/SignIn.tsx
|
|
9231
|
-
import { jsx as
|
|
9525
|
+
import { jsx as jsx70 } from "react/jsx-runtime";
|
|
9232
9526
|
var SignIn2 = ({ className, size = "medium", children, preferences, ...rest }) => {
|
|
9233
9527
|
const { signIn, afterSignInUrl, isInitialized, isLoading, platform } = useAsgardeo_default();
|
|
9234
9528
|
const handleInitialize = async () => await signIn({ response_mode: "direct" });
|
|
@@ -9245,7 +9539,7 @@ var SignIn2 = ({ className, size = "medium", children, preferences, ...rest }) =
|
|
|
9245
9539
|
}
|
|
9246
9540
|
};
|
|
9247
9541
|
if (platform === Platform5.AsgardeoV2) {
|
|
9248
|
-
return /* @__PURE__ */
|
|
9542
|
+
return /* @__PURE__ */ jsx70(
|
|
9249
9543
|
SignIn_default,
|
|
9250
9544
|
{
|
|
9251
9545
|
className,
|
|
@@ -9258,7 +9552,7 @@ var SignIn2 = ({ className, size = "medium", children, preferences, ...rest }) =
|
|
|
9258
9552
|
}
|
|
9259
9553
|
);
|
|
9260
9554
|
}
|
|
9261
|
-
return /* @__PURE__ */
|
|
9555
|
+
return /* @__PURE__ */ jsx70(
|
|
9262
9556
|
BaseSignIn_default3,
|
|
9263
9557
|
{
|
|
9264
9558
|
isLoading: isLoading || !isInitialized,
|
|
@@ -9290,7 +9584,7 @@ import {
|
|
|
9290
9584
|
createPackageComponentLogger as createPackageComponentLogger6
|
|
9291
9585
|
} from "@asgardeo/browser";
|
|
9292
9586
|
import { cx as cx21 } from "@emotion/css";
|
|
9293
|
-
import { useEffect as
|
|
9587
|
+
import { useEffect as useEffect18, useState as useState19, useCallback as useCallback12, useRef as useRef8 } from "react";
|
|
9294
9588
|
|
|
9295
9589
|
// src/components/presentation/auth/SignUp/v1/SignUpOptionFactory.tsx
|
|
9296
9590
|
import { EmbeddedFlowComponentType as EmbeddedFlowComponentType2 } from "@asgardeo/browser";
|
|
@@ -9352,13 +9646,13 @@ var DateInput = ({
|
|
|
9352
9646
|
var DateInput_default = DateInput;
|
|
9353
9647
|
|
|
9354
9648
|
// src/components/adapters/DividerComponent.tsx
|
|
9355
|
-
import { jsx as
|
|
9649
|
+
import { jsx as jsx71 } from "react/jsx-runtime";
|
|
9356
9650
|
var DividerComponent = ({ component }) => {
|
|
9357
9651
|
const { theme } = useTheme_default();
|
|
9358
9652
|
const config = component.config || {};
|
|
9359
9653
|
const text = config["text"] || "";
|
|
9360
9654
|
const variant = component.variant?.toLowerCase() || "horizontal";
|
|
9361
|
-
return /* @__PURE__ */
|
|
9655
|
+
return /* @__PURE__ */ jsx71(
|
|
9362
9656
|
Divider_default,
|
|
9363
9657
|
{
|
|
9364
9658
|
orientation: variant === "vertical" ? "vertical" : "horizontal",
|
|
@@ -9399,7 +9693,7 @@ var EmailInput = ({
|
|
|
9399
9693
|
var EmailInput_default = EmailInput;
|
|
9400
9694
|
|
|
9401
9695
|
// src/components/adapters/FormContainer.tsx
|
|
9402
|
-
import { jsx as
|
|
9696
|
+
import { jsx as jsx72 } from "react/jsx-runtime";
|
|
9403
9697
|
var FormContainer = (props) => {
|
|
9404
9698
|
const { component } = props;
|
|
9405
9699
|
if (component.components && component.components.length > 0) {
|
|
@@ -9412,14 +9706,14 @@ var FormContainer = (props) => {
|
|
|
9412
9706
|
props.onSubmit(submitButton, props.formValues);
|
|
9413
9707
|
}
|
|
9414
9708
|
};
|
|
9415
|
-
return /* @__PURE__ */
|
|
9709
|
+
return /* @__PURE__ */ jsx72("form", { onSubmit: handleFormSubmit, style: { display: "flex", flexDirection: "column" }, children: component.components.map(
|
|
9416
9710
|
(childComponent) => createSignUpComponent({
|
|
9417
9711
|
...props,
|
|
9418
9712
|
component: childComponent
|
|
9419
9713
|
})
|
|
9420
9714
|
) }, component.id);
|
|
9421
9715
|
}
|
|
9422
|
-
return /* @__PURE__ */
|
|
9716
|
+
return /* @__PURE__ */ jsx72("div", {}, component.id);
|
|
9423
9717
|
};
|
|
9424
9718
|
var FormContainer_default = FormContainer;
|
|
9425
9719
|
|
|
@@ -9545,7 +9839,7 @@ var SelectInput = ({
|
|
|
9545
9839
|
var SelectInput_default = SelectInput;
|
|
9546
9840
|
|
|
9547
9841
|
// src/components/adapters/SubmitButton.tsx
|
|
9548
|
-
import { jsx as
|
|
9842
|
+
import { jsx as jsx73 } from "react/jsx-runtime";
|
|
9549
9843
|
var ButtonComponent = ({
|
|
9550
9844
|
component,
|
|
9551
9845
|
isLoading,
|
|
@@ -9579,7 +9873,7 @@ var ButtonComponent = ({
|
|
|
9579
9873
|
onSubmit(component);
|
|
9580
9874
|
}
|
|
9581
9875
|
};
|
|
9582
|
-
return /* @__PURE__ */
|
|
9876
|
+
return /* @__PURE__ */ jsx73(
|
|
9583
9877
|
Button_default,
|
|
9584
9878
|
{
|
|
9585
9879
|
type: buttonType === "submit" ? "submit" : "button",
|
|
@@ -9590,7 +9884,7 @@ var ButtonComponent = ({
|
|
|
9590
9884
|
onClick: buttonType !== "submit" ? handleClick : void 0,
|
|
9591
9885
|
className: buttonClassName,
|
|
9592
9886
|
style: { width: "100%" },
|
|
9593
|
-
children: isLoading ? /* @__PURE__ */
|
|
9887
|
+
children: isLoading ? /* @__PURE__ */ jsx73(Spinner_default, { size: "small" }) : buttonText
|
|
9594
9888
|
},
|
|
9595
9889
|
component.id
|
|
9596
9890
|
);
|
|
@@ -9598,7 +9892,7 @@ var ButtonComponent = ({
|
|
|
9598
9892
|
var SubmitButton_default = ButtonComponent;
|
|
9599
9893
|
|
|
9600
9894
|
// src/components/adapters/TelephoneInput.tsx
|
|
9601
|
-
import { jsx as
|
|
9895
|
+
import { jsx as jsx74 } from "react/jsx-runtime";
|
|
9602
9896
|
var TelephoneInput = ({
|
|
9603
9897
|
component,
|
|
9604
9898
|
formValues,
|
|
@@ -9611,7 +9905,7 @@ var TelephoneInput = ({
|
|
|
9611
9905
|
const fieldName = config["identifier"] || config["name"] || component.id;
|
|
9612
9906
|
const value = formValues[fieldName] || "";
|
|
9613
9907
|
const error = touchedFields[fieldName] ? formErrors[fieldName] : void 0;
|
|
9614
|
-
return /* @__PURE__ */
|
|
9908
|
+
return /* @__PURE__ */ jsx74(
|
|
9615
9909
|
TextField_default,
|
|
9616
9910
|
{
|
|
9617
9911
|
name: fieldName,
|
|
@@ -9659,7 +9953,7 @@ var TextInput = ({
|
|
|
9659
9953
|
var TextInput_default = TextInput;
|
|
9660
9954
|
|
|
9661
9955
|
// src/components/adapters/Typography.tsx
|
|
9662
|
-
import { jsx as
|
|
9956
|
+
import { jsx as jsx75 } from "react/jsx-runtime";
|
|
9663
9957
|
var TypographyComponent = ({ component }) => {
|
|
9664
9958
|
const { theme } = useTheme_default();
|
|
9665
9959
|
const config = component.config || {};
|
|
@@ -9700,7 +9994,7 @@ var TypographyComponent = ({ component }) => {
|
|
|
9700
9994
|
default:
|
|
9701
9995
|
typographyVariant = "body1";
|
|
9702
9996
|
}
|
|
9703
|
-
return /* @__PURE__ */
|
|
9997
|
+
return /* @__PURE__ */ jsx75(
|
|
9704
9998
|
Typography_default,
|
|
9705
9999
|
{
|
|
9706
10000
|
variant: typographyVariant,
|
|
@@ -9713,69 +10007,69 @@ var TypographyComponent = ({ component }) => {
|
|
|
9713
10007
|
var Typography_default2 = TypographyComponent;
|
|
9714
10008
|
|
|
9715
10009
|
// src/components/presentation/auth/SignUp/v1/SignUpOptionFactory.tsx
|
|
9716
|
-
import { jsx as
|
|
10010
|
+
import { jsx as jsx76 } from "react/jsx-runtime";
|
|
9717
10011
|
var createSignUpComponent = ({ component, onSubmit, ...rest }) => {
|
|
9718
10012
|
switch (component.type) {
|
|
9719
10013
|
case EmbeddedFlowComponentType2.Typography:
|
|
9720
|
-
return /* @__PURE__ */
|
|
10014
|
+
return /* @__PURE__ */ jsx76(Typography_default2, { component, onSubmit, ...rest });
|
|
9721
10015
|
case EmbeddedFlowComponentType2.Input: {
|
|
9722
10016
|
const inputVariant = component.variant?.toUpperCase();
|
|
9723
10017
|
const inputType = component.config["type"]?.toLowerCase();
|
|
9724
10018
|
if (inputVariant === "EMAIL" || inputType === "email") {
|
|
9725
|
-
return /* @__PURE__ */
|
|
10019
|
+
return /* @__PURE__ */ jsx76(EmailInput_default, { component, onSubmit, ...rest });
|
|
9726
10020
|
}
|
|
9727
10021
|
if (inputVariant === "PASSWORD" || inputType === "password") {
|
|
9728
|
-
return /* @__PURE__ */
|
|
10022
|
+
return /* @__PURE__ */ jsx76(PasswordInput_default, { component, onSubmit, ...rest });
|
|
9729
10023
|
}
|
|
9730
10024
|
if (inputVariant === "TELEPHONE" || inputType === "tel") {
|
|
9731
|
-
return /* @__PURE__ */
|
|
10025
|
+
return /* @__PURE__ */ jsx76(TelephoneInput_default, { component, onSubmit, ...rest });
|
|
9732
10026
|
}
|
|
9733
10027
|
if (inputVariant === "NUMBER" || inputType === "number") {
|
|
9734
|
-
return /* @__PURE__ */
|
|
10028
|
+
return /* @__PURE__ */ jsx76(NumberInput_default, { component, onSubmit, ...rest });
|
|
9735
10029
|
}
|
|
9736
10030
|
if (inputVariant === "DATE" || inputType === "date") {
|
|
9737
|
-
return /* @__PURE__ */
|
|
10031
|
+
return /* @__PURE__ */ jsx76(DateInput_default, { component, onSubmit, ...rest });
|
|
9738
10032
|
}
|
|
9739
10033
|
if (inputVariant === "CHECKBOX" || inputType === "checkbox") {
|
|
9740
|
-
return /* @__PURE__ */
|
|
10034
|
+
return /* @__PURE__ */ jsx76(CheckboxInput_default, { component, onSubmit, ...rest });
|
|
9741
10035
|
}
|
|
9742
|
-
return /* @__PURE__ */
|
|
10036
|
+
return /* @__PURE__ */ jsx76(TextInput_default, { component, onSubmit, ...rest });
|
|
9743
10037
|
}
|
|
9744
10038
|
case EmbeddedFlowComponentType2.Button: {
|
|
9745
10039
|
const buttonVariant = component.variant?.toUpperCase();
|
|
9746
10040
|
const buttonText = component.config["text"] || component.config["label"] || "";
|
|
9747
10041
|
if (buttonVariant === "SOCIAL") {
|
|
9748
10042
|
if (buttonText.toLowerCase().includes("google")) {
|
|
9749
|
-
return /* @__PURE__ */
|
|
10043
|
+
return /* @__PURE__ */ jsx76(GoogleButton_default, { onClick: () => onSubmit(component, {}), ...rest, children: buttonText });
|
|
9750
10044
|
}
|
|
9751
10045
|
if (buttonText.toLowerCase().includes("github")) {
|
|
9752
|
-
return /* @__PURE__ */
|
|
10046
|
+
return /* @__PURE__ */ jsx76(GitHubButton_default, { onClick: () => onSubmit(component, {}), ...rest, children: buttonText });
|
|
9753
10047
|
}
|
|
9754
10048
|
if (buttonText.toLowerCase().includes("microsoft")) {
|
|
9755
|
-
return /* @__PURE__ */
|
|
10049
|
+
return /* @__PURE__ */ jsx76(MicrosoftButton_default, { onClick: () => onSubmit(component, {}), ...rest, children: buttonText });
|
|
9756
10050
|
}
|
|
9757
10051
|
if (buttonText.toLowerCase().includes("facebook")) {
|
|
9758
|
-
return /* @__PURE__ */
|
|
10052
|
+
return /* @__PURE__ */ jsx76(FacebookButton_default, { onClick: () => onSubmit(component, {}), ...rest, children: buttonText });
|
|
9759
10053
|
}
|
|
9760
10054
|
if (buttonText.toLowerCase().includes("linkedin")) {
|
|
9761
|
-
return /* @__PURE__ */
|
|
10055
|
+
return /* @__PURE__ */ jsx76(LinkedInButton_default, { onClick: () => onSubmit(component, {}), ...rest, children: buttonText });
|
|
9762
10056
|
}
|
|
9763
10057
|
if (buttonText.toLowerCase().includes("ethereum")) {
|
|
9764
|
-
return /* @__PURE__ */
|
|
10058
|
+
return /* @__PURE__ */ jsx76(SignInWithEthereumButton_default, { onClick: () => onSubmit(component, {}), ...rest, children: buttonText });
|
|
9765
10059
|
}
|
|
9766
10060
|
}
|
|
9767
|
-
return /* @__PURE__ */
|
|
10061
|
+
return /* @__PURE__ */ jsx76(SubmitButton_default, { component, onSubmit, ...rest });
|
|
9768
10062
|
}
|
|
9769
10063
|
case EmbeddedFlowComponentType2.Form:
|
|
9770
|
-
return /* @__PURE__ */
|
|
10064
|
+
return /* @__PURE__ */ jsx76(FormContainer_default, { component, onSubmit, ...rest });
|
|
9771
10065
|
case EmbeddedFlowComponentType2.Select:
|
|
9772
|
-
return /* @__PURE__ */
|
|
10066
|
+
return /* @__PURE__ */ jsx76(SelectInput_default, { component, onSubmit, ...rest });
|
|
9773
10067
|
case EmbeddedFlowComponentType2.Divider:
|
|
9774
|
-
return /* @__PURE__ */
|
|
10068
|
+
return /* @__PURE__ */ jsx76(DividerComponent_default, { component, onSubmit, ...rest });
|
|
9775
10069
|
case EmbeddedFlowComponentType2.Image:
|
|
9776
|
-
return /* @__PURE__ */
|
|
10070
|
+
return /* @__PURE__ */ jsx76(ImageComponent_default, { component, onSubmit, ...rest });
|
|
9777
10071
|
default:
|
|
9778
|
-
return /* @__PURE__ */
|
|
10072
|
+
return /* @__PURE__ */ jsx76("div", {});
|
|
9779
10073
|
}
|
|
9780
10074
|
};
|
|
9781
10075
|
var createSignUpOptionFromComponent = (component, formValues, touchedFields, formErrors, isLoading, isFormValid, onInputChange, options) => createSignUpComponent({
|
|
@@ -9944,7 +10238,7 @@ var useStyles17 = (theme, colorScheme) => useMemo25(() => {
|
|
|
9944
10238
|
var BaseSignUp_styles_default = useStyles17;
|
|
9945
10239
|
|
|
9946
10240
|
// src/components/presentation/auth/SignUp/v1/BaseSignUp.tsx
|
|
9947
|
-
import { jsx as
|
|
10241
|
+
import { jsx as jsx77, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
9948
10242
|
var logger6 = createPackageComponentLogger6(
|
|
9949
10243
|
"@asgardeo/react",
|
|
9950
10244
|
"BaseSignUp"
|
|
@@ -10006,9 +10300,9 @@ var BaseSignUpContent = ({
|
|
|
10006
10300
|
},
|
|
10007
10301
|
[t, addMessage, clearMessages]
|
|
10008
10302
|
);
|
|
10009
|
-
const [isLoading, setIsLoading] =
|
|
10010
|
-
const [isFlowInitialized, setIsFlowInitialized] =
|
|
10011
|
-
const [currentFlow, setCurrentFlow] =
|
|
10303
|
+
const [isLoading, setIsLoading] = useState19(false);
|
|
10304
|
+
const [isFlowInitialized, setIsFlowInitialized] = useState19(false);
|
|
10305
|
+
const [currentFlow, setCurrentFlow] = useState19(null);
|
|
10012
10306
|
const initializationAttemptedRef = useRef8(false);
|
|
10013
10307
|
const extractFormFields = useCallback12(
|
|
10014
10308
|
(components) => {
|
|
@@ -10295,7 +10589,7 @@ var BaseSignUpContent = ({
|
|
|
10295
10589
|
handleSubmit
|
|
10296
10590
|
]
|
|
10297
10591
|
);
|
|
10298
|
-
|
|
10592
|
+
useEffect18(() => {
|
|
10299
10593
|
if (isInitialized && !isFlowInitialized && !initializationAttemptedRef.current) {
|
|
10300
10594
|
initializationAttemptedRef.current = true;
|
|
10301
10595
|
(async () => {
|
|
@@ -10347,42 +10641,42 @@ var BaseSignUpContent = ({
|
|
|
10347
10641
|
validateForm,
|
|
10348
10642
|
values: formValues
|
|
10349
10643
|
};
|
|
10350
|
-
return /* @__PURE__ */
|
|
10644
|
+
return /* @__PURE__ */ jsx77("div", { className: containerClasses, children: children(renderProps) });
|
|
10351
10645
|
}
|
|
10352
10646
|
if (!isFlowInitialized && isLoading) {
|
|
10353
|
-
return /* @__PURE__ */
|
|
10647
|
+
return /* @__PURE__ */ jsx77(Card_default, { className: cx21(containerClasses, styles.card), variant, children: /* @__PURE__ */ jsx77(Card_default.Content, { children: /* @__PURE__ */ jsx77("div", { className: styles.loadingContainer, children: /* @__PURE__ */ jsx77(Spinner_default, { size: "medium" }) }) }) });
|
|
10354
10648
|
}
|
|
10355
10649
|
if (!currentFlow) {
|
|
10356
|
-
return /* @__PURE__ */
|
|
10357
|
-
/* @__PURE__ */
|
|
10358
|
-
/* @__PURE__ */
|
|
10650
|
+
return /* @__PURE__ */ jsx77(Card_default, { className: cx21(containerClasses, styles.card), variant, children: /* @__PURE__ */ jsx77(Card_default.Content, { children: /* @__PURE__ */ jsxs31(Alert_default, { variant: "error", className: errorClasses, children: [
|
|
10651
|
+
/* @__PURE__ */ jsx77(Alert_default.Title, { children: t("errors.heading") }),
|
|
10652
|
+
/* @__PURE__ */ jsx77(Alert_default.Description, { children: t("errors.signup.flow.initialization.failure") })
|
|
10359
10653
|
] }) }) });
|
|
10360
10654
|
}
|
|
10361
|
-
return /* @__PURE__ */
|
|
10362
|
-
(showTitle || showSubtitle) && /* @__PURE__ */
|
|
10363
|
-
showTitle && /* @__PURE__ */
|
|
10364
|
-
showSubtitle && /* @__PURE__ */
|
|
10655
|
+
return /* @__PURE__ */ jsxs31(Card_default, { className: cx21(containerClasses, styles.card), variant, children: [
|
|
10656
|
+
(showTitle || showSubtitle) && /* @__PURE__ */ jsxs31(Card_default.Header, { className: styles.header, children: [
|
|
10657
|
+
showTitle && /* @__PURE__ */ jsx77(Card_default.Title, { level: 2, className: styles.title, children: flowTitle || t("signup.heading") }),
|
|
10658
|
+
showSubtitle && /* @__PURE__ */ jsx77(Typography_default, { variant: "body1", className: styles.subtitle, children: flowSubtitle || t("signup.subheading") })
|
|
10365
10659
|
] }),
|
|
10366
|
-
/* @__PURE__ */
|
|
10367
|
-
flowMessages && flowMessages.length > 0 && /* @__PURE__ */
|
|
10660
|
+
/* @__PURE__ */ jsxs31(Card_default.Content, { children: [
|
|
10661
|
+
flowMessages && flowMessages.length > 0 && /* @__PURE__ */ jsx77("div", { className: styles.flowMessagesContainer, children: flowMessages.map((message, index) => /* @__PURE__ */ jsx77(
|
|
10368
10662
|
Alert_default,
|
|
10369
10663
|
{
|
|
10370
10664
|
variant: message.type?.toLowerCase() === "error" ? "error" : "info",
|
|
10371
10665
|
className: cx21(styles.flowMessageItem, messageClasses),
|
|
10372
|
-
children: /* @__PURE__ */
|
|
10666
|
+
children: /* @__PURE__ */ jsx77(Alert_default.Description, { children: message.message })
|
|
10373
10667
|
},
|
|
10374
10668
|
message.id || index
|
|
10375
10669
|
)) }),
|
|
10376
|
-
/* @__PURE__ */
|
|
10670
|
+
/* @__PURE__ */ jsx77("div", { className: styles.contentContainer, children: currentFlow.data?.components && currentFlow.data.components.length > 0 ? renderComponents(currentFlow.data.components) : /* @__PURE__ */ jsx77(Alert_default, { variant: "warning", children: /* @__PURE__ */ jsx77(Typography_default, { variant: "body1", children: t("errors.signup.components.not.available") }) }) })
|
|
10377
10671
|
] })
|
|
10378
10672
|
] });
|
|
10379
10673
|
};
|
|
10380
10674
|
var BaseSignUp = ({ showLogo = true, ...rest }) => {
|
|
10381
10675
|
const { theme, colorScheme } = useTheme_default();
|
|
10382
10676
|
const styles = BaseSignUp_styles_default(theme, colorScheme);
|
|
10383
|
-
return /* @__PURE__ */
|
|
10384
|
-
showLogo && /* @__PURE__ */
|
|
10385
|
-
/* @__PURE__ */
|
|
10677
|
+
return /* @__PURE__ */ jsxs31("div", { children: [
|
|
10678
|
+
showLogo && /* @__PURE__ */ jsx77("div", { className: styles.logoContainer, children: /* @__PURE__ */ jsx77(Logo_default, { size: "large" }) }),
|
|
10679
|
+
/* @__PURE__ */ jsx77(FlowProvider_default, { children: /* @__PURE__ */ jsx77(BaseSignUpContent, { showLogo, ...rest }) })
|
|
10386
10680
|
] });
|
|
10387
10681
|
};
|
|
10388
10682
|
var BaseSignUp_default = BaseSignUp;
|
|
@@ -10396,8 +10690,8 @@ import {
|
|
|
10396
10690
|
createPackageComponentLogger as createPackageComponentLogger7
|
|
10397
10691
|
} from "@asgardeo/browser";
|
|
10398
10692
|
import { cx as cx22 } from "@emotion/css";
|
|
10399
|
-
import { useEffect as
|
|
10400
|
-
import { jsx as
|
|
10693
|
+
import { useEffect as useEffect19, useState as useState20, useCallback as useCallback13, useRef as useRef9 } from "react";
|
|
10694
|
+
import { jsx as jsx78, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
10401
10695
|
var logger7 = createPackageComponentLogger7(
|
|
10402
10696
|
"@asgardeo/react",
|
|
10403
10697
|
"BaseSignUp"
|
|
@@ -10427,11 +10721,11 @@ var BaseSignUpContent2 = ({
|
|
|
10427
10721
|
const { subtitle: flowSubtitle, title: flowTitle, messages: flowMessages, addMessage, clearMessages } = useFlow_default();
|
|
10428
10722
|
const { meta } = useAsgardeo_default();
|
|
10429
10723
|
const styles = BaseSignUp_styles_default(theme, colorScheme);
|
|
10430
|
-
const [isLoading, setIsLoading] =
|
|
10431
|
-
const [isFlowInitialized, setIsFlowInitialized] =
|
|
10432
|
-
const [currentFlow, setCurrentFlow] =
|
|
10433
|
-
const [apiError, setApiError] =
|
|
10434
|
-
const [passkeyState, setPasskeyState] =
|
|
10724
|
+
const [isLoading, setIsLoading] = useState20(false);
|
|
10725
|
+
const [isFlowInitialized, setIsFlowInitialized] = useState20(false);
|
|
10726
|
+
const [currentFlow, setCurrentFlow] = useState20(null);
|
|
10727
|
+
const [apiError, setApiError] = useState20(null);
|
|
10728
|
+
const [passkeyState, setPasskeyState] = useState20({
|
|
10435
10729
|
actionId: null,
|
|
10436
10730
|
creationOptions: null,
|
|
10437
10731
|
error: null,
|
|
@@ -10732,7 +11026,7 @@ var BaseSignUpContent2 = ({
|
|
|
10732
11026
|
setIsLoading(false);
|
|
10733
11027
|
}
|
|
10734
11028
|
};
|
|
10735
|
-
|
|
11029
|
+
useEffect19(() => {
|
|
10736
11030
|
if (!passkeyState.isActive || !passkeyState.creationOptions || !passkeyState.flowId) {
|
|
10737
11031
|
return;
|
|
10738
11032
|
}
|
|
@@ -10838,7 +11132,7 @@ var BaseSignUpContent2 = ({
|
|
|
10838
11132
|
state: urlParams.get("state")
|
|
10839
11133
|
};
|
|
10840
11134
|
};
|
|
10841
|
-
|
|
11135
|
+
useEffect19(() => {
|
|
10842
11136
|
const urlParams = getUrlParams2();
|
|
10843
11137
|
if (urlParams.code || urlParams.state) {
|
|
10844
11138
|
return;
|
|
@@ -10901,15 +11195,15 @@ var BaseSignUpContent2 = ({
|
|
|
10901
11195
|
},
|
|
10902
11196
|
values: formValues
|
|
10903
11197
|
};
|
|
10904
|
-
return /* @__PURE__ */
|
|
11198
|
+
return /* @__PURE__ */ jsx78("div", { className: containerClasses, children: children(renderProps) });
|
|
10905
11199
|
}
|
|
10906
11200
|
if (!isFlowInitialized && isLoading) {
|
|
10907
|
-
return /* @__PURE__ */
|
|
11201
|
+
return /* @__PURE__ */ jsx78(Card_default, { className: cx22(containerClasses, styles.card), variant, children: /* @__PURE__ */ jsx78(Card_default.Content, { children: /* @__PURE__ */ jsx78("div", { className: styles.loadingContainer, children: /* @__PURE__ */ jsx78(Spinner_default, { size: "medium" }) }) }) });
|
|
10908
11202
|
}
|
|
10909
11203
|
if (!currentFlow) {
|
|
10910
|
-
return /* @__PURE__ */
|
|
10911
|
-
/* @__PURE__ */
|
|
10912
|
-
/* @__PURE__ */
|
|
11204
|
+
return /* @__PURE__ */ jsx78(Card_default, { className: cx22(containerClasses, styles.card), variant, children: /* @__PURE__ */ jsx78(Card_default.Content, { children: /* @__PURE__ */ jsxs32(Alert_default, { variant: "error", className: errorClasses, children: [
|
|
11205
|
+
/* @__PURE__ */ jsx78(Alert_default.Title, { children: t("errors.heading") }),
|
|
11206
|
+
/* @__PURE__ */ jsx78(Alert_default.Description, { children: t("errors.signup.flow.initialization.failure") })
|
|
10913
11207
|
] }) }) });
|
|
10914
11208
|
}
|
|
10915
11209
|
const componentsToRender = currentFlow.data?.components || [];
|
|
@@ -10920,46 +11214,46 @@ var BaseSignUpContent2 = ({
|
|
|
10920
11214
|
t("signup.heading"),
|
|
10921
11215
|
t("signup.subheading")
|
|
10922
11216
|
);
|
|
10923
|
-
return /* @__PURE__ */
|
|
10924
|
-
(showTitle || showSubtitle) && /* @__PURE__ */
|
|
10925
|
-
showTitle && /* @__PURE__ */
|
|
10926
|
-
showSubtitle && /* @__PURE__ */
|
|
11217
|
+
return /* @__PURE__ */ jsxs32(Card_default, { className: cx22(containerClasses, styles.card), variant, children: [
|
|
11218
|
+
(showTitle || showSubtitle) && /* @__PURE__ */ jsxs32(Card_default.Header, { className: styles.header, children: [
|
|
11219
|
+
showTitle && /* @__PURE__ */ jsx78(Card_default.Title, { level: 2, className: styles.title, children: title }),
|
|
11220
|
+
showSubtitle && /* @__PURE__ */ jsx78(Typography_default, { variant: "body1", className: styles.subtitle, children: subtitle })
|
|
10927
11221
|
] }),
|
|
10928
|
-
/* @__PURE__ */
|
|
10929
|
-
externalError && /* @__PURE__ */
|
|
10930
|
-
flowMessages && flowMessages.length > 0 && /* @__PURE__ */
|
|
11222
|
+
/* @__PURE__ */ jsxs32(Card_default.Content, { children: [
|
|
11223
|
+
externalError && /* @__PURE__ */ jsx78("div", { className: styles.flowMessagesContainer, children: /* @__PURE__ */ jsx78(Alert_default, { variant: "error", className: cx22(styles.flowMessageItem, messageClasses), children: /* @__PURE__ */ jsx78(Alert_default.Description, { children: externalError.message }) }) }),
|
|
11224
|
+
flowMessages && flowMessages.length > 0 && /* @__PURE__ */ jsx78("div", { className: styles.flowMessagesContainer, children: flowMessages.map((message, index) => /* @__PURE__ */ jsx78(
|
|
10931
11225
|
Alert_default,
|
|
10932
11226
|
{
|
|
10933
11227
|
variant: message.type?.toLowerCase() === "error" ? "error" : "info",
|
|
10934
11228
|
className: cx22(styles.flowMessageItem, messageClasses),
|
|
10935
|
-
children: /* @__PURE__ */
|
|
11229
|
+
children: /* @__PURE__ */ jsx78(Alert_default.Description, { children: message.message })
|
|
10936
11230
|
},
|
|
10937
11231
|
message.id || index
|
|
10938
11232
|
)) }),
|
|
10939
|
-
/* @__PURE__ */
|
|
11233
|
+
/* @__PURE__ */ jsx78("div", { className: styles.contentContainer, children: componentsWithoutHeadings && componentsWithoutHeadings.length > 0 ? renderComponents(componentsWithoutHeadings) : /* @__PURE__ */ jsx78(Alert_default, { variant: "warning", children: /* @__PURE__ */ jsx78(Typography_default, { variant: "body1", children: t("errors.signup.components.not.available") }) }) })
|
|
10940
11234
|
] })
|
|
10941
11235
|
] });
|
|
10942
11236
|
};
|
|
10943
11237
|
var BaseSignUp2 = ({ preferences, showLogo = true, ...rest }) => {
|
|
10944
11238
|
const { theme, colorScheme } = useTheme_default();
|
|
10945
11239
|
const styles = BaseSignUp_styles_default(theme, colorScheme);
|
|
10946
|
-
const content = /* @__PURE__ */
|
|
10947
|
-
showLogo && /* @__PURE__ */
|
|
10948
|
-
/* @__PURE__ */
|
|
11240
|
+
const content = /* @__PURE__ */ jsxs32("div", { children: [
|
|
11241
|
+
showLogo && /* @__PURE__ */ jsx78("div", { className: styles.logoContainer, children: /* @__PURE__ */ jsx78(Logo_default, { size: "large" }) }),
|
|
11242
|
+
/* @__PURE__ */ jsx78(FlowProvider_default, { children: /* @__PURE__ */ jsx78(BaseSignUpContent2, { showLogo, ...rest }) })
|
|
10949
11243
|
] });
|
|
10950
11244
|
if (!preferences) return content;
|
|
10951
|
-
return /* @__PURE__ */
|
|
11245
|
+
return /* @__PURE__ */ jsx78(ComponentPreferencesContext_default.Provider, { value: preferences, children: content });
|
|
10952
11246
|
};
|
|
10953
11247
|
var BaseSignUp_default2 = BaseSignUp2;
|
|
10954
11248
|
|
|
10955
11249
|
// src/components/presentation/auth/SignUp/BaseSignUp.tsx
|
|
10956
|
-
import { jsx as
|
|
11250
|
+
import { jsx as jsx79 } from "react/jsx-runtime";
|
|
10957
11251
|
var BaseSignUp3 = (props) => {
|
|
10958
11252
|
const { platform } = useAsgardeo_default();
|
|
10959
11253
|
if (platform === Platform6.AsgardeoV2) {
|
|
10960
|
-
return /* @__PURE__ */
|
|
11254
|
+
return /* @__PURE__ */ jsx79(BaseSignUp_default2, { ...props });
|
|
10961
11255
|
}
|
|
10962
|
-
return /* @__PURE__ */
|
|
11256
|
+
return /* @__PURE__ */ jsx79(BaseSignUp_default, { ...props });
|
|
10963
11257
|
};
|
|
10964
11258
|
var BaseSignUp_default3 = BaseSignUp3;
|
|
10965
11259
|
|
|
@@ -10971,7 +11265,7 @@ import {
|
|
|
10971
11265
|
EmbeddedFlowResponseType as EmbeddedFlowResponseType3,
|
|
10972
11266
|
EmbeddedFlowType as EmbeddedFlowType2
|
|
10973
11267
|
} from "@asgardeo/browser";
|
|
10974
|
-
import { jsx as
|
|
11268
|
+
import { jsx as jsx80 } from "react/jsx-runtime";
|
|
10975
11269
|
var SignUp = ({
|
|
10976
11270
|
className,
|
|
10977
11271
|
size = "medium",
|
|
@@ -11000,7 +11294,7 @@ var SignUp = ({
|
|
|
11000
11294
|
window.location.href = response.data.redirectURL;
|
|
11001
11295
|
}
|
|
11002
11296
|
};
|
|
11003
|
-
return /* @__PURE__ */
|
|
11297
|
+
return /* @__PURE__ */ jsx80(
|
|
11004
11298
|
BaseSignUp_default,
|
|
11005
11299
|
{
|
|
11006
11300
|
afterSignUpUrl,
|
|
@@ -11026,7 +11320,7 @@ import {
|
|
|
11026
11320
|
EmbeddedFlowResponseType as EmbeddedFlowResponseType4,
|
|
11027
11321
|
EmbeddedFlowType as EmbeddedFlowType3
|
|
11028
11322
|
} from "@asgardeo/browser";
|
|
11029
|
-
import { jsx as
|
|
11323
|
+
import { jsx as jsx81 } from "react/jsx-runtime";
|
|
11030
11324
|
var SignUp2 = ({
|
|
11031
11325
|
className,
|
|
11032
11326
|
size = "medium",
|
|
@@ -11064,7 +11358,7 @@ var SignUp2 = ({
|
|
|
11064
11358
|
window.location.href = response.data.redirectURL;
|
|
11065
11359
|
}
|
|
11066
11360
|
};
|
|
11067
|
-
return /* @__PURE__ */
|
|
11361
|
+
return /* @__PURE__ */ jsx81(
|
|
11068
11362
|
BaseSignUp_default2,
|
|
11069
11363
|
{
|
|
11070
11364
|
afterSignUpUrl,
|
|
@@ -11086,13 +11380,13 @@ var SignUp2 = ({
|
|
|
11086
11380
|
var SignUp_default2 = SignUp2;
|
|
11087
11381
|
|
|
11088
11382
|
// src/components/presentation/auth/SignUp/SignUp.tsx
|
|
11089
|
-
import { jsx as
|
|
11383
|
+
import { jsx as jsx82 } from "react/jsx-runtime";
|
|
11090
11384
|
var SignUp3 = (props) => {
|
|
11091
11385
|
const { platform } = useAsgardeo_default();
|
|
11092
11386
|
if (platform === Platform7.AsgardeoV2) {
|
|
11093
|
-
return /* @__PURE__ */
|
|
11387
|
+
return /* @__PURE__ */ jsx82(SignUp_default2, { ...props });
|
|
11094
11388
|
}
|
|
11095
|
-
return /* @__PURE__ */
|
|
11389
|
+
return /* @__PURE__ */ jsx82(SignUp_default, { ...props });
|
|
11096
11390
|
};
|
|
11097
11391
|
var SignUp_default3 = SignUp3;
|
|
11098
11392
|
|
|
@@ -11102,7 +11396,7 @@ import { EmbeddedFlowType as EmbeddedFlowType5 } from "@asgardeo/browser";
|
|
|
11102
11396
|
// src/components/presentation/auth/InviteUser/v2/BaseInviteUser.tsx
|
|
11103
11397
|
import { EmbeddedFlowType as EmbeddedFlowType4 } from "@asgardeo/browser";
|
|
11104
11398
|
import { cx as cx23 } from "@emotion/css";
|
|
11105
|
-
import { useCallback as useCallback14, useEffect as
|
|
11399
|
+
import { useCallback as useCallback14, useEffect as useEffect20, useRef as useRef10, useState as useState21 } from "react";
|
|
11106
11400
|
|
|
11107
11401
|
// src/components/presentation/auth/InviteUser/v2/BaseInviteUser.styles.ts
|
|
11108
11402
|
import { css as css19 } from "@emotion/css";
|
|
@@ -11145,7 +11439,7 @@ var useStyles18 = (theme, colorScheme) => useMemo26(() => {
|
|
|
11145
11439
|
var BaseInviteUser_styles_default = useStyles18;
|
|
11146
11440
|
|
|
11147
11441
|
// src/components/presentation/auth/InviteUser/v2/BaseInviteUser.tsx
|
|
11148
|
-
import { jsx as
|
|
11442
|
+
import { jsx as jsx83, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
11149
11443
|
var BaseInviteUser = ({
|
|
11150
11444
|
onInitialize,
|
|
11151
11445
|
onSubmit,
|
|
@@ -11165,16 +11459,16 @@ var BaseInviteUser = ({
|
|
|
11165
11459
|
const { t } = useTranslation_default(preferences?.i18n);
|
|
11166
11460
|
const { theme } = useTheme_default();
|
|
11167
11461
|
const styles = BaseInviteUser_styles_default(theme, theme.vars.colors.text.primary);
|
|
11168
|
-
const [isLoading, setIsLoading] =
|
|
11169
|
-
const [isFlowInitialized, setIsFlowInitialized] =
|
|
11170
|
-
const [currentFlow, setCurrentFlow] =
|
|
11171
|
-
const [apiError, setApiError] =
|
|
11172
|
-
const [formValues, setFormValues] =
|
|
11173
|
-
const [formErrors, setFormErrors] =
|
|
11174
|
-
const [touchedFields, setTouchedFields] =
|
|
11175
|
-
const [inviteLink, setInviteLink] =
|
|
11176
|
-
const [inviteLinkCopied, setInviteLinkCopied] =
|
|
11177
|
-
const [isFormValid, setIsFormValid] =
|
|
11462
|
+
const [isLoading, setIsLoading] = useState21(false);
|
|
11463
|
+
const [isFlowInitialized, setIsFlowInitialized] = useState21(false);
|
|
11464
|
+
const [currentFlow, setCurrentFlow] = useState21(null);
|
|
11465
|
+
const [apiError, setApiError] = useState21(null);
|
|
11466
|
+
const [formValues, setFormValues] = useState21({});
|
|
11467
|
+
const [formErrors, setFormErrors] = useState21({});
|
|
11468
|
+
const [touchedFields, setTouchedFields] = useState21({});
|
|
11469
|
+
const [inviteLink, setInviteLink] = useState21();
|
|
11470
|
+
const [inviteLinkCopied, setInviteLinkCopied] = useState21(false);
|
|
11471
|
+
const [isFormValid, setIsFormValid] = useState21(true);
|
|
11178
11472
|
const initializationAttemptedRef = useRef10(false);
|
|
11179
11473
|
const handleError = useCallback14(
|
|
11180
11474
|
(error) => {
|
|
@@ -11338,7 +11632,7 @@ var BaseInviteUser = ({
|
|
|
11338
11632
|
setInviteLinkCopied(false);
|
|
11339
11633
|
initializationAttemptedRef.current = false;
|
|
11340
11634
|
}, []);
|
|
11341
|
-
|
|
11635
|
+
useEffect20(() => {
|
|
11342
11636
|
if (isInitialized && !isFlowInitialized && !initializationAttemptedRef.current) {
|
|
11343
11637
|
initializationAttemptedRef.current = true;
|
|
11344
11638
|
(async () => {
|
|
@@ -11365,7 +11659,7 @@ var BaseInviteUser = ({
|
|
|
11365
11659
|
})();
|
|
11366
11660
|
}
|
|
11367
11661
|
}, [isInitialized, isFlowInitialized, onInitialize, onFlowChange, handleError, normalizeFlowResponseLocal]);
|
|
11368
|
-
|
|
11662
|
+
useEffect20(() => {
|
|
11369
11663
|
if (currentFlow && isFlowInitialized) {
|
|
11370
11664
|
const components2 = currentFlow.data?.components || [];
|
|
11371
11665
|
if (components2.length > 0) {
|
|
@@ -11449,28 +11743,28 @@ var BaseInviteUser = ({
|
|
|
11449
11743
|
values: formValues
|
|
11450
11744
|
};
|
|
11451
11745
|
if (children) {
|
|
11452
|
-
return /* @__PURE__ */
|
|
11746
|
+
return /* @__PURE__ */ jsx83("div", { className, children: children(renderProps) });
|
|
11453
11747
|
}
|
|
11454
11748
|
if (!isInitialized) {
|
|
11455
|
-
return /* @__PURE__ */
|
|
11749
|
+
return /* @__PURE__ */ jsx83(Card_default, { className: cx23(className, styles.card), variant, children: /* @__PURE__ */ jsx83(Card_default.Content, { children: /* @__PURE__ */ jsx83("div", { style: { display: "flex", justifyContent: "center", padding: "2rem" }, children: /* @__PURE__ */ jsx83(Spinner_default, { size: "medium" }) }) }) });
|
|
11456
11750
|
}
|
|
11457
11751
|
if (!isFlowInitialized && isLoading) {
|
|
11458
|
-
return /* @__PURE__ */
|
|
11752
|
+
return /* @__PURE__ */ jsx83(Card_default, { className: cx23(className, styles.card), variant, children: /* @__PURE__ */ jsx83(Card_default.Content, { children: /* @__PURE__ */ jsx83("div", { style: { display: "flex", justifyContent: "center", padding: "2rem" }, children: /* @__PURE__ */ jsx83(Spinner_default, { size: "medium" }) }) }) });
|
|
11459
11753
|
}
|
|
11460
11754
|
if (!currentFlow && apiError) {
|
|
11461
|
-
return /* @__PURE__ */
|
|
11462
|
-
/* @__PURE__ */
|
|
11463
|
-
/* @__PURE__ */
|
|
11755
|
+
return /* @__PURE__ */ jsx83(Card_default, { className: cx23(className, styles.card), variant, children: /* @__PURE__ */ jsx83(Card_default.Content, { children: /* @__PURE__ */ jsxs33(Alert_default, { variant: "error", children: [
|
|
11756
|
+
/* @__PURE__ */ jsx83(Alert_default.Title, { children: "Error" }),
|
|
11757
|
+
/* @__PURE__ */ jsx83(Alert_default.Description, { children: apiError.message })
|
|
11464
11758
|
] }) }) });
|
|
11465
11759
|
}
|
|
11466
11760
|
if (isInviteGenerated && inviteLink) {
|
|
11467
|
-
return /* @__PURE__ */
|
|
11468
|
-
/* @__PURE__ */
|
|
11469
|
-
/* @__PURE__ */
|
|
11470
|
-
/* @__PURE__ */
|
|
11471
|
-
/* @__PURE__ */
|
|
11472
|
-
/* @__PURE__ */
|
|
11473
|
-
/* @__PURE__ */
|
|
11761
|
+
return /* @__PURE__ */ jsxs33(Card_default, { className: cx23(className, styles.card), variant, children: [
|
|
11762
|
+
/* @__PURE__ */ jsx83(Card_default.Header, { className: styles.header, children: /* @__PURE__ */ jsx83(Card_default.Title, { level: 2, className: styles.title, children: "Invite Link Generated!" }) }),
|
|
11763
|
+
/* @__PURE__ */ jsxs33(Card_default.Content, { children: [
|
|
11764
|
+
/* @__PURE__ */ jsx83(Alert_default, { variant: "success", children: /* @__PURE__ */ jsx83(Alert_default.Description, { children: "Share this link with the user to complete their registration." }) }),
|
|
11765
|
+
/* @__PURE__ */ jsxs33("div", { style: { marginTop: "1rem" }, children: [
|
|
11766
|
+
/* @__PURE__ */ jsx83(Typography_default, { variant: "body2", style: { marginBottom: "0.5rem" }, children: "Invite Link" }),
|
|
11767
|
+
/* @__PURE__ */ jsxs33(
|
|
11474
11768
|
"div",
|
|
11475
11769
|
{
|
|
11476
11770
|
style: {
|
|
@@ -11483,26 +11777,26 @@ var BaseInviteUser = ({
|
|
|
11483
11777
|
wordBreak: "break-all"
|
|
11484
11778
|
},
|
|
11485
11779
|
children: [
|
|
11486
|
-
/* @__PURE__ */
|
|
11487
|
-
/* @__PURE__ */
|
|
11780
|
+
/* @__PURE__ */ jsx83(Typography_default, { variant: "body2", style: { flex: 1 }, children: inviteLink }),
|
|
11781
|
+
/* @__PURE__ */ jsx83(Button_default, { variant: "outline", size: "small", onClick: copyInviteLink, children: inviteLinkCopied ? "Copied!" : "Copy" })
|
|
11488
11782
|
]
|
|
11489
11783
|
}
|
|
11490
11784
|
)
|
|
11491
11785
|
] }),
|
|
11492
|
-
/* @__PURE__ */
|
|
11786
|
+
/* @__PURE__ */ jsx83("div", { style: { display: "flex", gap: "0.5rem", marginTop: "1.5rem" }, children: /* @__PURE__ */ jsx83(Button_default, { variant: "outline", onClick: resetFlow, children: "Invite Another User" }) })
|
|
11493
11787
|
] })
|
|
11494
11788
|
] });
|
|
11495
11789
|
}
|
|
11496
|
-
return /* @__PURE__ */
|
|
11497
|
-
(showTitle || showSubtitle) && (title || subtitle) && /* @__PURE__ */
|
|
11498
|
-
showTitle && title && /* @__PURE__ */
|
|
11499
|
-
showSubtitle && subtitle && /* @__PURE__ */
|
|
11790
|
+
return /* @__PURE__ */ jsxs33(Card_default, { className: cx23(className, styles.card), variant, children: [
|
|
11791
|
+
(showTitle || showSubtitle) && (title || subtitle) && /* @__PURE__ */ jsxs33(Card_default.Header, { className: styles.header, children: [
|
|
11792
|
+
showTitle && title && /* @__PURE__ */ jsx83(Card_default.Title, { level: 2, className: styles.title, children: title }),
|
|
11793
|
+
showSubtitle && subtitle && /* @__PURE__ */ jsx83(Typography_default, { variant: "body1", className: styles.subtitle, children: subtitle })
|
|
11500
11794
|
] }),
|
|
11501
|
-
/* @__PURE__ */
|
|
11502
|
-
apiError && /* @__PURE__ */
|
|
11503
|
-
/* @__PURE__ */
|
|
11504
|
-
componentsWithoutHeadings && componentsWithoutHeadings.length > 0 ? renderComponents(componentsWithoutHeadings) : !isLoading && /* @__PURE__ */
|
|
11505
|
-
isLoading && /* @__PURE__ */
|
|
11795
|
+
/* @__PURE__ */ jsxs33(Card_default.Content, { children: [
|
|
11796
|
+
apiError && /* @__PURE__ */ jsx83("div", { style: { marginBottom: "1rem" }, children: /* @__PURE__ */ jsx83(Alert_default, { variant: "error", children: /* @__PURE__ */ jsx83(Alert_default.Description, { children: apiError.message }) }) }),
|
|
11797
|
+
/* @__PURE__ */ jsxs33("div", { children: [
|
|
11798
|
+
componentsWithoutHeadings && componentsWithoutHeadings.length > 0 ? renderComponents(componentsWithoutHeadings) : !isLoading && /* @__PURE__ */ jsx83(Alert_default, { variant: "warning", children: /* @__PURE__ */ jsx83(Typography_default, { variant: "body1", children: "No form components available" }) }),
|
|
11799
|
+
isLoading && /* @__PURE__ */ jsx83("div", { style: { display: "flex", justifyContent: "center", padding: "1rem" }, children: /* @__PURE__ */ jsx83(Spinner_default, { size: "small" }) })
|
|
11506
11800
|
] })
|
|
11507
11801
|
] })
|
|
11508
11802
|
] });
|
|
@@ -11510,7 +11804,7 @@ var BaseInviteUser = ({
|
|
|
11510
11804
|
var BaseInviteUser_default = BaseInviteUser;
|
|
11511
11805
|
|
|
11512
11806
|
// src/components/presentation/auth/InviteUser/v2/InviteUser.tsx
|
|
11513
|
-
import { jsx as
|
|
11807
|
+
import { jsx as jsx84 } from "react/jsx-runtime";
|
|
11514
11808
|
var InviteUser = ({
|
|
11515
11809
|
onInviteLinkGenerated,
|
|
11516
11810
|
onError,
|
|
@@ -11554,7 +11848,7 @@ var InviteUser = ({
|
|
|
11554
11848
|
});
|
|
11555
11849
|
return response.data;
|
|
11556
11850
|
};
|
|
11557
|
-
return /* @__PURE__ */
|
|
11851
|
+
return /* @__PURE__ */ jsx84(
|
|
11558
11852
|
BaseInviteUser_default,
|
|
11559
11853
|
{
|
|
11560
11854
|
onInitialize: handleInitialize,
|
|
@@ -11579,7 +11873,7 @@ import { useMemo as useMemo28 } from "react";
|
|
|
11579
11873
|
|
|
11580
11874
|
// src/components/presentation/auth/AcceptInvite/v2/BaseAcceptInvite.tsx
|
|
11581
11875
|
import { cx as cx24 } from "@emotion/css";
|
|
11582
|
-
import { useCallback as useCallback15, useEffect as
|
|
11876
|
+
import { useCallback as useCallback15, useEffect as useEffect21, useRef as useRef11, useState as useState22 } from "react";
|
|
11583
11877
|
|
|
11584
11878
|
// src/components/presentation/auth/AcceptInvite/v2/BaseAcceptInvite.styles.ts
|
|
11585
11879
|
import { css as css20 } from "@emotion/css";
|
|
@@ -11622,7 +11916,7 @@ var useStyles19 = (theme, colorScheme) => useMemo27(() => {
|
|
|
11622
11916
|
var BaseAcceptInvite_styles_default = useStyles19;
|
|
11623
11917
|
|
|
11624
11918
|
// src/components/presentation/auth/AcceptInvite/v2/BaseAcceptInvite.tsx
|
|
11625
|
-
import { jsx as
|
|
11919
|
+
import { jsx as jsx85, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
11626
11920
|
var BaseAcceptInvite = ({
|
|
11627
11921
|
flowId,
|
|
11628
11922
|
inviteToken,
|
|
@@ -11643,17 +11937,17 @@ var BaseAcceptInvite = ({
|
|
|
11643
11937
|
const { t } = useTranslation_default(preferences?.i18n);
|
|
11644
11938
|
const { theme } = useTheme_default();
|
|
11645
11939
|
const styles = BaseAcceptInvite_styles_default(theme, theme.vars.colors.text.primary);
|
|
11646
|
-
const [isLoading, setIsLoading] =
|
|
11647
|
-
const [isValidatingToken, setIsValidatingToken] =
|
|
11648
|
-
const [isTokenInvalid, setIsTokenInvalid] =
|
|
11649
|
-
const [isComplete, setIsComplete] =
|
|
11650
|
-
const [currentFlow, setCurrentFlow] =
|
|
11651
|
-
const [apiError, setApiError] =
|
|
11652
|
-
const [formValues, setFormValues] =
|
|
11653
|
-
const [formErrors, setFormErrors] =
|
|
11654
|
-
const [touchedFields, setTouchedFields] =
|
|
11655
|
-
const [isFormValid, setIsFormValid] =
|
|
11656
|
-
const [completionTitle, setCompletionTitle] =
|
|
11940
|
+
const [isLoading, setIsLoading] = useState22(false);
|
|
11941
|
+
const [isValidatingToken, setIsValidatingToken] = useState22(true);
|
|
11942
|
+
const [isTokenInvalid, setIsTokenInvalid] = useState22(false);
|
|
11943
|
+
const [isComplete, setIsComplete] = useState22(false);
|
|
11944
|
+
const [currentFlow, setCurrentFlow] = useState22(null);
|
|
11945
|
+
const [apiError, setApiError] = useState22(null);
|
|
11946
|
+
const [formValues, setFormValues] = useState22({});
|
|
11947
|
+
const [formErrors, setFormErrors] = useState22({});
|
|
11948
|
+
const [touchedFields, setTouchedFields] = useState22({});
|
|
11949
|
+
const [isFormValid, setIsFormValid] = useState22(true);
|
|
11950
|
+
const [completionTitle, setCompletionTitle] = useState22(void 0);
|
|
11657
11951
|
const tokenValidationAttemptedRef = useRef11(false);
|
|
11658
11952
|
const handleError = useCallback15(
|
|
11659
11953
|
(error) => {
|
|
@@ -11834,7 +12128,7 @@ var BaseAcceptInvite = ({
|
|
|
11834
12128
|
normalizeFlowResponseLocal
|
|
11835
12129
|
]
|
|
11836
12130
|
);
|
|
11837
|
-
|
|
12131
|
+
useEffect21(() => {
|
|
11838
12132
|
if (tokenValidationAttemptedRef.current) {
|
|
11839
12133
|
return;
|
|
11840
12134
|
}
|
|
@@ -11951,50 +12245,50 @@ var BaseAcceptInvite = ({
|
|
|
11951
12245
|
values: formValues
|
|
11952
12246
|
};
|
|
11953
12247
|
if (children) {
|
|
11954
|
-
return /* @__PURE__ */
|
|
12248
|
+
return /* @__PURE__ */ jsx85("div", { className, children: children(renderProps) });
|
|
11955
12249
|
}
|
|
11956
12250
|
if (isValidatingToken) {
|
|
11957
|
-
return /* @__PURE__ */
|
|
11958
|
-
/* @__PURE__ */
|
|
11959
|
-
/* @__PURE__ */
|
|
12251
|
+
return /* @__PURE__ */ jsx85(Card_default, { className: cx24(className, styles.card), variant, children: /* @__PURE__ */ jsx85(Card_default.Content, { children: /* @__PURE__ */ jsxs34("div", { style: { alignItems: "center", display: "flex", flexDirection: "column", gap: "1rem", padding: "2rem" }, children: [
|
|
12252
|
+
/* @__PURE__ */ jsx85(Spinner_default, { size: "medium" }),
|
|
12253
|
+
/* @__PURE__ */ jsx85(Typography_default, { variant: "body1", children: "Validating your invite link..." })
|
|
11960
12254
|
] }) }) });
|
|
11961
12255
|
}
|
|
11962
12256
|
if (isTokenInvalid) {
|
|
11963
|
-
return /* @__PURE__ */
|
|
11964
|
-
/* @__PURE__ */
|
|
11965
|
-
/* @__PURE__ */
|
|
11966
|
-
/* @__PURE__ */
|
|
11967
|
-
/* @__PURE__ */
|
|
11968
|
-
/* @__PURE__ */
|
|
12257
|
+
return /* @__PURE__ */ jsxs34(Card_default, { className: cx24(className, styles.card), variant, children: [
|
|
12258
|
+
/* @__PURE__ */ jsx85(Card_default.Header, { className: styles.header, children: /* @__PURE__ */ jsx85(Card_default.Title, { level: 2, className: styles.title, children: "Invalid Invite Link" }) }),
|
|
12259
|
+
/* @__PURE__ */ jsxs34(Card_default.Content, { children: [
|
|
12260
|
+
/* @__PURE__ */ jsxs34(Alert_default, { variant: "error", children: [
|
|
12261
|
+
/* @__PURE__ */ jsx85(Alert_default.Title, { children: "Unable to verify invite" }),
|
|
12262
|
+
/* @__PURE__ */ jsx85(Alert_default.Description, { children: apiError?.message || "This invite link is invalid or has expired. Please contact your administrator for a new invite." })
|
|
11969
12263
|
] }),
|
|
11970
|
-
onGoToSignIn && /* @__PURE__ */
|
|
12264
|
+
onGoToSignIn && /* @__PURE__ */ jsx85("div", { style: { display: "flex", justifyContent: "center", marginTop: "1.5rem" }, children: /* @__PURE__ */ jsx85(Button_default, { variant: "outline", onClick: onGoToSignIn, children: "Go to Sign In" }) })
|
|
11971
12265
|
] })
|
|
11972
12266
|
] });
|
|
11973
12267
|
}
|
|
11974
12268
|
if (isComplete) {
|
|
11975
|
-
return /* @__PURE__ */
|
|
11976
|
-
/* @__PURE__ */
|
|
11977
|
-
/* @__PURE__ */
|
|
11978
|
-
/* @__PURE__ */
|
|
11979
|
-
onGoToSignIn && /* @__PURE__ */
|
|
12269
|
+
return /* @__PURE__ */ jsxs34(Card_default, { className: cx24(className, styles.card), variant, children: [
|
|
12270
|
+
/* @__PURE__ */ jsx85(Card_default.Header, { className: styles.header, children: /* @__PURE__ */ jsx85(Card_default.Title, { level: 2, className: styles.title, children: "Account Setup Complete!" }) }),
|
|
12271
|
+
/* @__PURE__ */ jsxs34(Card_default.Content, { children: [
|
|
12272
|
+
/* @__PURE__ */ jsx85(Alert_default, { variant: "success", children: /* @__PURE__ */ jsx85(Alert_default.Description, { children: "Your account has been successfully set up. You can now sign in with your credentials." }) }),
|
|
12273
|
+
onGoToSignIn && /* @__PURE__ */ jsx85("div", { style: { display: "flex", justifyContent: "center", marginTop: "1.5rem" }, children: /* @__PURE__ */ jsx85(Button_default, { variant: "solid", color: "primary", onClick: onGoToSignIn, children: "Sign In" }) })
|
|
11980
12274
|
] })
|
|
11981
12275
|
] });
|
|
11982
12276
|
}
|
|
11983
|
-
return /* @__PURE__ */
|
|
11984
|
-
(showTitle || showSubtitle) && (title || subtitle) && /* @__PURE__ */
|
|
11985
|
-
showTitle && title && /* @__PURE__ */
|
|
11986
|
-
showSubtitle && subtitle && /* @__PURE__ */
|
|
12277
|
+
return /* @__PURE__ */ jsxs34(Card_default, { className: cx24(className, styles.card), variant, children: [
|
|
12278
|
+
(showTitle || showSubtitle) && (title || subtitle) && /* @__PURE__ */ jsxs34(Card_default.Header, { className: styles.header, children: [
|
|
12279
|
+
showTitle && title && /* @__PURE__ */ jsx85(Card_default.Title, { level: 2, className: styles.title, children: title }),
|
|
12280
|
+
showSubtitle && subtitle && /* @__PURE__ */ jsx85(Typography_default, { variant: "body1", className: styles.subtitle, children: subtitle })
|
|
11987
12281
|
] }),
|
|
11988
|
-
/* @__PURE__ */
|
|
11989
|
-
apiError && /* @__PURE__ */
|
|
11990
|
-
/* @__PURE__ */
|
|
11991
|
-
componentsWithoutHeadings && componentsWithoutHeadings.length > 0 ? renderComponents(componentsWithoutHeadings) : !isLoading && /* @__PURE__ */
|
|
11992
|
-
isLoading && /* @__PURE__ */
|
|
12282
|
+
/* @__PURE__ */ jsxs34(Card_default.Content, { children: [
|
|
12283
|
+
apiError && /* @__PURE__ */ jsx85("div", { style: { marginBottom: "1rem" }, children: /* @__PURE__ */ jsx85(Alert_default, { variant: "error", children: /* @__PURE__ */ jsx85(Alert_default.Description, { children: apiError.message }) }) }),
|
|
12284
|
+
/* @__PURE__ */ jsxs34("div", { children: [
|
|
12285
|
+
componentsWithoutHeadings && componentsWithoutHeadings.length > 0 ? renderComponents(componentsWithoutHeadings) : !isLoading && /* @__PURE__ */ jsx85(Alert_default, { variant: "warning", children: /* @__PURE__ */ jsx85(Typography_default, { variant: "body1", children: "No form components available" }) }),
|
|
12286
|
+
isLoading && /* @__PURE__ */ jsx85("div", { style: { display: "flex", justifyContent: "center", padding: "1rem" }, children: /* @__PURE__ */ jsx85(Spinner_default, { size: "small" }) })
|
|
11993
12287
|
] }),
|
|
11994
|
-
onGoToSignIn && /* @__PURE__ */
|
|
12288
|
+
onGoToSignIn && /* @__PURE__ */ jsx85("div", { style: { marginTop: "1.5rem", textAlign: "center" }, children: /* @__PURE__ */ jsxs34(Typography_default, { variant: "body2", children: [
|
|
11995
12289
|
"Already have an account?",
|
|
11996
12290
|
" ",
|
|
11997
|
-
/* @__PURE__ */
|
|
12291
|
+
/* @__PURE__ */ jsx85(Button_default, { variant: "text", onClick: onGoToSignIn, style: { minWidth: "auto", padding: 0 }, children: "Sign In" })
|
|
11998
12292
|
] }) })
|
|
11999
12293
|
] })
|
|
12000
12294
|
] });
|
|
@@ -12002,7 +12296,7 @@ var BaseAcceptInvite = ({
|
|
|
12002
12296
|
var BaseAcceptInvite_default = BaseAcceptInvite;
|
|
12003
12297
|
|
|
12004
12298
|
// src/components/presentation/auth/AcceptInvite/v2/AcceptInvite.tsx
|
|
12005
|
-
import { jsx as
|
|
12299
|
+
import { jsx as jsx86 } from "react/jsx-runtime";
|
|
12006
12300
|
var getUrlParams = () => {
|
|
12007
12301
|
if (typeof window === "undefined") {
|
|
12008
12302
|
return {};
|
|
@@ -12058,7 +12352,7 @@ var AcceptInvite = ({
|
|
|
12058
12352
|
}
|
|
12059
12353
|
return response.json();
|
|
12060
12354
|
};
|
|
12061
|
-
return /* @__PURE__ */
|
|
12355
|
+
return /* @__PURE__ */ jsx86(
|
|
12062
12356
|
BaseAcceptInvite_default,
|
|
12063
12357
|
{
|
|
12064
12358
|
flowId,
|
|
@@ -12081,7 +12375,7 @@ var AcceptInvite_default = AcceptInvite;
|
|
|
12081
12375
|
|
|
12082
12376
|
// src/components/auth/Callback/Callback.tsx
|
|
12083
12377
|
import { navigate as browserNavigate } from "@asgardeo/browser";
|
|
12084
|
-
import { useEffect as
|
|
12378
|
+
import { useEffect as useEffect22, useRef as useRef12 } from "react";
|
|
12085
12379
|
var Callback = ({ onNavigate, onError }) => {
|
|
12086
12380
|
const processingRef = useRef12(false);
|
|
12087
12381
|
const navigate6 = (path) => {
|
|
@@ -12091,7 +12385,7 @@ var Callback = ({ onNavigate, onError }) => {
|
|
|
12091
12385
|
browserNavigate(path);
|
|
12092
12386
|
}
|
|
12093
12387
|
};
|
|
12094
|
-
|
|
12388
|
+
useEffect22(() => {
|
|
12095
12389
|
const processOAuthCallback = () => {
|
|
12096
12390
|
if (processingRef.current) {
|
|
12097
12391
|
return;
|
|
@@ -12169,45 +12463,45 @@ var Callback = ({ onNavigate, onError }) => {
|
|
|
12169
12463
|
};
|
|
12170
12464
|
|
|
12171
12465
|
// src/components/presentation/User/BaseUser.tsx
|
|
12172
|
-
import { Fragment as
|
|
12466
|
+
import { Fragment as Fragment17, jsx as jsx87 } from "react/jsx-runtime";
|
|
12173
12467
|
var BaseUser = ({ user, children, fallback = null }) => {
|
|
12174
12468
|
if (!user) {
|
|
12175
|
-
return /* @__PURE__ */
|
|
12469
|
+
return /* @__PURE__ */ jsx87(Fragment17, { children: fallback });
|
|
12176
12470
|
}
|
|
12177
|
-
return /* @__PURE__ */
|
|
12471
|
+
return /* @__PURE__ */ jsx87(Fragment17, { children: children(user) });
|
|
12178
12472
|
};
|
|
12179
12473
|
BaseUser.displayName = "BaseUser";
|
|
12180
12474
|
var BaseUser_default = BaseUser;
|
|
12181
12475
|
|
|
12182
12476
|
// src/components/presentation/User/User.tsx
|
|
12183
|
-
import { jsx as
|
|
12477
|
+
import { jsx as jsx88 } from "react/jsx-runtime";
|
|
12184
12478
|
var User5 = ({ children, fallback = null }) => {
|
|
12185
12479
|
const { user } = useAsgardeo_default();
|
|
12186
|
-
return /* @__PURE__ */
|
|
12480
|
+
return /* @__PURE__ */ jsx88(BaseUser_default, { user, fallback, children });
|
|
12187
12481
|
};
|
|
12188
12482
|
User5.displayName = "User";
|
|
12189
12483
|
var User_default = User5;
|
|
12190
12484
|
|
|
12191
12485
|
// src/components/presentation/Organization/BaseOrganization.tsx
|
|
12192
|
-
import { Fragment as
|
|
12486
|
+
import { Fragment as Fragment18, jsx as jsx89 } from "react/jsx-runtime";
|
|
12193
12487
|
var BaseOrganization = ({
|
|
12194
12488
|
children,
|
|
12195
12489
|
fallback = null,
|
|
12196
12490
|
organization
|
|
12197
12491
|
}) => {
|
|
12198
12492
|
if (!organization) {
|
|
12199
|
-
return /* @__PURE__ */
|
|
12493
|
+
return /* @__PURE__ */ jsx89(Fragment18, { children: fallback });
|
|
12200
12494
|
}
|
|
12201
|
-
return /* @__PURE__ */
|
|
12495
|
+
return /* @__PURE__ */ jsx89(Fragment18, { children: children(organization) });
|
|
12202
12496
|
};
|
|
12203
12497
|
BaseOrganization.displayName = "BaseOrganization";
|
|
12204
12498
|
var BaseOrganization_default = BaseOrganization;
|
|
12205
12499
|
|
|
12206
12500
|
// src/components/presentation/Organization/Organization.tsx
|
|
12207
|
-
import { jsx as
|
|
12501
|
+
import { jsx as jsx90 } from "react/jsx-runtime";
|
|
12208
12502
|
var Organization5 = ({ children, fallback = null }) => {
|
|
12209
12503
|
const { currentOrganization } = useOrganization_default();
|
|
12210
|
-
return /* @__PURE__ */
|
|
12504
|
+
return /* @__PURE__ */ jsx90(BaseOrganization_default, { organization: currentOrganization, fallback, children });
|
|
12211
12505
|
};
|
|
12212
12506
|
Organization5.displayName = "Organization";
|
|
12213
12507
|
var Organization_default = Organization5;
|
|
@@ -12215,7 +12509,7 @@ var Organization_default = Organization5;
|
|
|
12215
12509
|
// src/components/presentation/UserProfile/BaseUserProfile.tsx
|
|
12216
12510
|
import { withVendorCSSClassPrefix as withVendorCSSClassPrefix27, WellKnownSchemaIds, bem as bem19 } from "@asgardeo/browser";
|
|
12217
12511
|
import { cx as cx28 } from "@emotion/css";
|
|
12218
|
-
import { useState as
|
|
12512
|
+
import { useState as useState25, useCallback as useCallback17 } from "react";
|
|
12219
12513
|
|
|
12220
12514
|
// src/components/presentation/UserProfile/BaseUserProfile.styles.ts
|
|
12221
12515
|
import { withVendorCSSClassPrefix as withVendorCSSClassPrefix23 } from "@asgardeo/browser";
|
|
@@ -12546,7 +12840,7 @@ var useStyles21 = (theme, colorScheme, size, variant, backgroundColor) => useMem
|
|
|
12546
12840
|
var Avatar_styles_default = useStyles21;
|
|
12547
12841
|
|
|
12548
12842
|
// src/components/primitives/Avatar/Avatar.tsx
|
|
12549
|
-
import { jsx as
|
|
12843
|
+
import { jsx as jsx91 } from "react/jsx-runtime";
|
|
12550
12844
|
var Avatar = ({
|
|
12551
12845
|
alt = "User avatar",
|
|
12552
12846
|
background = "random",
|
|
@@ -12593,7 +12887,7 @@ var Avatar = ({
|
|
|
12593
12887
|
const getInitials = (fullName) => fullName.split(" ").map((part) => part[0]).slice(0, 2).join("").toUpperCase();
|
|
12594
12888
|
const renderContent = () => {
|
|
12595
12889
|
if (imageUrl) {
|
|
12596
|
-
return /* @__PURE__ */
|
|
12890
|
+
return /* @__PURE__ */ jsx91(
|
|
12597
12891
|
"img",
|
|
12598
12892
|
{
|
|
12599
12893
|
src: imageUrl,
|
|
@@ -12606,19 +12900,19 @@ var Avatar = ({
|
|
|
12606
12900
|
return getInitials(name);
|
|
12607
12901
|
}
|
|
12608
12902
|
if (isLoading) {
|
|
12609
|
-
return /* @__PURE__ */
|
|
12903
|
+
return /* @__PURE__ */ jsx91("div", { className: cx25(withVendorCSSClassPrefix24(bem16("avatar", "skeleton")), styles["skeleton"]) });
|
|
12610
12904
|
}
|
|
12611
|
-
return /* @__PURE__ */
|
|
12905
|
+
return /* @__PURE__ */ jsx91(
|
|
12612
12906
|
"svg",
|
|
12613
12907
|
{
|
|
12614
12908
|
xmlns: "http://www.w3.org/2000/svg",
|
|
12615
12909
|
viewBox: "0 0 640 640",
|
|
12616
12910
|
className: cx25(withVendorCSSClassPrefix24(bem16("avatar", "icon")), styles["icon"]),
|
|
12617
|
-
children: /* @__PURE__ */
|
|
12911
|
+
children: /* @__PURE__ */ jsx91("path", { d: "M240 192C240 147.8 275.8 112 320 112C364.2 112 400 147.8 400 192C400 236.2 364.2 272 320 272C275.8 272 240 236.2 240 192zM448 192C448 121.3 390.7 64 320 64C249.3 64 192 121.3 192 192C192 262.7 249.3 320 320 320C390.7 320 448 262.7 448 192zM144 544C144 473.3 201.3 416 272 416L368 416C438.7 416 496 473.3 496 544L496 552C496 565.3 506.7 576 520 576C533.3 576 544 565.3 544 552L544 544C544 446.8 465.2 368 368 368L272 368C174.8 368 96 446.8 96 544L96 552C96 565.3 106.7 576 120 576C133.3 576 144 565.3 144 552L144 544z" })
|
|
12618
12912
|
}
|
|
12619
12913
|
);
|
|
12620
12914
|
};
|
|
12621
|
-
return /* @__PURE__ */
|
|
12915
|
+
return /* @__PURE__ */ jsx91(
|
|
12622
12916
|
"div",
|
|
12623
12917
|
{
|
|
12624
12918
|
className: cx25(
|
|
@@ -12657,7 +12951,7 @@ import {
|
|
|
12657
12951
|
useContext as useContext12,
|
|
12658
12952
|
useLayoutEffect,
|
|
12659
12953
|
useMemo as useMemo33,
|
|
12660
|
-
useState as
|
|
12954
|
+
useState as useState23
|
|
12661
12955
|
} from "react";
|
|
12662
12956
|
|
|
12663
12957
|
// src/components/primitives/Dialog/Dialog.styles.ts
|
|
@@ -12725,8 +13019,8 @@ var useStyles22 = (theme, colorScheme) => useMemo32(() => {
|
|
|
12725
13019
|
var Dialog_styles_default = useStyles22;
|
|
12726
13020
|
|
|
12727
13021
|
// src/components/primitives/Icons/LogOut.tsx
|
|
12728
|
-
import { jsx as
|
|
12729
|
-
var LogOut = (props) => /* @__PURE__ */
|
|
13022
|
+
import { jsx as jsx92, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
13023
|
+
var LogOut = (props) => /* @__PURE__ */ jsxs35(
|
|
12730
13024
|
"svg",
|
|
12731
13025
|
{
|
|
12732
13026
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -12740,17 +13034,17 @@ var LogOut = (props) => /* @__PURE__ */ jsxs34(
|
|
|
12740
13034
|
strokeLinejoin: "round",
|
|
12741
13035
|
...props,
|
|
12742
13036
|
children: [
|
|
12743
|
-
/* @__PURE__ */
|
|
12744
|
-
/* @__PURE__ */
|
|
12745
|
-
/* @__PURE__ */
|
|
13037
|
+
/* @__PURE__ */ jsx92("path", { d: "m16 17 5-5-5-5" }),
|
|
13038
|
+
/* @__PURE__ */ jsx92("path", { d: "M21 12H9" }),
|
|
13039
|
+
/* @__PURE__ */ jsx92("path", { d: "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" })
|
|
12746
13040
|
]
|
|
12747
13041
|
}
|
|
12748
13042
|
);
|
|
12749
13043
|
var LogOut_default = LogOut;
|
|
12750
13044
|
|
|
12751
13045
|
// src/components/primitives/Icons/Plus.tsx
|
|
12752
|
-
import { jsx as
|
|
12753
|
-
var Plus = (props) => /* @__PURE__ */
|
|
13046
|
+
import { jsx as jsx93, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
13047
|
+
var Plus = (props) => /* @__PURE__ */ jsxs36(
|
|
12754
13048
|
"svg",
|
|
12755
13049
|
{
|
|
12756
13050
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -12764,16 +13058,16 @@ var Plus = (props) => /* @__PURE__ */ jsxs35(
|
|
|
12764
13058
|
strokeLinejoin: "round",
|
|
12765
13059
|
...props,
|
|
12766
13060
|
children: [
|
|
12767
|
-
/* @__PURE__ */
|
|
12768
|
-
/* @__PURE__ */
|
|
13061
|
+
/* @__PURE__ */ jsx93("path", { d: "M5 12h14" }),
|
|
13062
|
+
/* @__PURE__ */ jsx93("path", { d: "M12 5v14" })
|
|
12769
13063
|
]
|
|
12770
13064
|
}
|
|
12771
13065
|
);
|
|
12772
13066
|
var Plus_default = Plus;
|
|
12773
13067
|
|
|
12774
13068
|
// src/components/primitives/Icons/User.tsx
|
|
12775
|
-
import { jsx as
|
|
12776
|
-
var User7 = (props) => /* @__PURE__ */
|
|
13069
|
+
import { jsx as jsx94, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
13070
|
+
var User7 = (props) => /* @__PURE__ */ jsxs37(
|
|
12777
13071
|
"svg",
|
|
12778
13072
|
{
|
|
12779
13073
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -12787,16 +13081,16 @@ var User7 = (props) => /* @__PURE__ */ jsxs36(
|
|
|
12787
13081
|
strokeLinejoin: "round",
|
|
12788
13082
|
...props,
|
|
12789
13083
|
children: [
|
|
12790
|
-
/* @__PURE__ */
|
|
12791
|
-
/* @__PURE__ */
|
|
13084
|
+
/* @__PURE__ */ jsx94("path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" }),
|
|
13085
|
+
/* @__PURE__ */ jsx94("circle", { cx: "12", cy: "7", r: "4" })
|
|
12792
13086
|
]
|
|
12793
13087
|
}
|
|
12794
13088
|
);
|
|
12795
13089
|
var User_default2 = User7;
|
|
12796
13090
|
|
|
12797
13091
|
// src/components/primitives/Icons/X.tsx
|
|
12798
|
-
import { jsx as
|
|
12799
|
-
var X = (props) => /* @__PURE__ */
|
|
13092
|
+
import { jsx as jsx95, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
13093
|
+
var X = (props) => /* @__PURE__ */ jsxs38(
|
|
12800
13094
|
"svg",
|
|
12801
13095
|
{
|
|
12802
13096
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -12810,23 +13104,23 @@ var X = (props) => /* @__PURE__ */ jsxs37(
|
|
|
12810
13104
|
strokeLinejoin: "round",
|
|
12811
13105
|
...props,
|
|
12812
13106
|
children: [
|
|
12813
|
-
/* @__PURE__ */
|
|
12814
|
-
/* @__PURE__ */
|
|
13107
|
+
/* @__PURE__ */ jsx95("path", { d: "M18 6 6 18" }),
|
|
13108
|
+
/* @__PURE__ */ jsx95("path", { d: "m6 6 12 12" })
|
|
12815
13109
|
]
|
|
12816
13110
|
}
|
|
12817
13111
|
);
|
|
12818
13112
|
var X_default = X;
|
|
12819
13113
|
|
|
12820
13114
|
// src/components/primitives/Dialog/Dialog.tsx
|
|
12821
|
-
import { jsx as
|
|
13115
|
+
import { jsx as jsx96, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
12822
13116
|
function useDialog({
|
|
12823
13117
|
initialOpen = false,
|
|
12824
13118
|
open: controlledOpen,
|
|
12825
13119
|
onOpenChange: setControlledOpen
|
|
12826
13120
|
} = {}) {
|
|
12827
|
-
const [uncontrolledOpen, setUncontrolledOpen] =
|
|
12828
|
-
const [labelId, setLabelId] =
|
|
12829
|
-
const [descriptionId, setDescriptionId] =
|
|
13121
|
+
const [uncontrolledOpen, setUncontrolledOpen] = useState23(initialOpen);
|
|
13122
|
+
const [labelId, setLabelId] = useState23();
|
|
13123
|
+
const [descriptionId, setDescriptionId] = useState23();
|
|
12830
13124
|
const open = controlledOpen ?? uncontrolledOpen;
|
|
12831
13125
|
const setOpen = setControlledOpen ?? setUncontrolledOpen;
|
|
12832
13126
|
const data = useFloating({
|
|
@@ -12864,7 +13158,7 @@ var useDialogContext = () => {
|
|
|
12864
13158
|
};
|
|
12865
13159
|
function Dialog({ children, ...options }) {
|
|
12866
13160
|
const dialog = useDialog(options);
|
|
12867
|
-
return /* @__PURE__ */
|
|
13161
|
+
return /* @__PURE__ */ jsx96(DialogContext.Provider, { value: dialog, children });
|
|
12868
13162
|
}
|
|
12869
13163
|
var DialogTrigger = forwardRef10(
|
|
12870
13164
|
({ children, asChild = false, ...props }, propRef) => {
|
|
@@ -12882,7 +13176,7 @@ var DialogTrigger = forwardRef10(
|
|
|
12882
13176
|
})
|
|
12883
13177
|
);
|
|
12884
13178
|
}
|
|
12885
|
-
return /* @__PURE__ */
|
|
13179
|
+
return /* @__PURE__ */ jsx96("button", { ref, "data-state": context.open ? "open" : "closed", ...context.getReferenceProps(props), children });
|
|
12886
13180
|
}
|
|
12887
13181
|
);
|
|
12888
13182
|
var DialogContent = forwardRef10(
|
|
@@ -12892,12 +13186,12 @@ var DialogContent = forwardRef10(
|
|
|
12892
13186
|
const styles = Dialog_styles_default(theme, colorScheme);
|
|
12893
13187
|
const ref = useMergeRefs([context.refs.setFloating, propRef]);
|
|
12894
13188
|
if (!floatingContext.open) return null;
|
|
12895
|
-
return /* @__PURE__ */
|
|
13189
|
+
return /* @__PURE__ */ jsx96(FloatingPortal, { children: /* @__PURE__ */ jsx96(
|
|
12896
13190
|
FloatingOverlay,
|
|
12897
13191
|
{
|
|
12898
13192
|
className: cx26(withVendorCSSClassPrefix25(bem17("dialog", "overlay")), styles["overlay"]),
|
|
12899
13193
|
lockScroll: true,
|
|
12900
|
-
children: /* @__PURE__ */
|
|
13194
|
+
children: /* @__PURE__ */ jsx96(FloatingFocusManager, { context: floatingContext, initialFocus: -1, children: /* @__PURE__ */ jsx96(
|
|
12901
13195
|
"div",
|
|
12902
13196
|
{
|
|
12903
13197
|
ref,
|
|
@@ -12924,8 +13218,8 @@ var DialogHeading = forwardRef10(
|
|
|
12924
13218
|
context.setLabelId(void 0);
|
|
12925
13219
|
};
|
|
12926
13220
|
}, [id, context.setLabelId]);
|
|
12927
|
-
return /* @__PURE__ */
|
|
12928
|
-
/* @__PURE__ */
|
|
13221
|
+
return /* @__PURE__ */ jsxs39("div", { className: cx26(withVendorCSSClassPrefix25(bem17("dialog", "header")), styles["header"]), children: [
|
|
13222
|
+
/* @__PURE__ */ jsx96(
|
|
12929
13223
|
"h2",
|
|
12930
13224
|
{
|
|
12931
13225
|
...props,
|
|
@@ -12935,7 +13229,7 @@ var DialogHeading = forwardRef10(
|
|
|
12935
13229
|
children
|
|
12936
13230
|
}
|
|
12937
13231
|
),
|
|
12938
|
-
/* @__PURE__ */
|
|
13232
|
+
/* @__PURE__ */ jsx96(
|
|
12939
13233
|
Button_default,
|
|
12940
13234
|
{
|
|
12941
13235
|
color: "tertiary",
|
|
@@ -12946,7 +13240,7 @@ var DialogHeading = forwardRef10(
|
|
|
12946
13240
|
context.setOpen(false);
|
|
12947
13241
|
},
|
|
12948
13242
|
"aria-label": "Close",
|
|
12949
|
-
children: /* @__PURE__ */
|
|
13243
|
+
children: /* @__PURE__ */ jsx96(X_default, { width: 16, height: 16 })
|
|
12950
13244
|
}
|
|
12951
13245
|
)
|
|
12952
13246
|
] });
|
|
@@ -12964,7 +13258,7 @@ var DialogDescription = forwardRef10(
|
|
|
12964
13258
|
context.setDescriptionId(void 0);
|
|
12965
13259
|
};
|
|
12966
13260
|
}, [id, context.setDescriptionId]);
|
|
12967
|
-
return /* @__PURE__ */
|
|
13261
|
+
return /* @__PURE__ */ jsx96(
|
|
12968
13262
|
"p",
|
|
12969
13263
|
{
|
|
12970
13264
|
...props,
|
|
@@ -12993,7 +13287,7 @@ var DialogClose = forwardRef10(
|
|
|
12993
13287
|
onClick: handleClick
|
|
12994
13288
|
});
|
|
12995
13289
|
}
|
|
12996
|
-
return /* @__PURE__ */
|
|
13290
|
+
return /* @__PURE__ */ jsx96(
|
|
12997
13291
|
Button_default,
|
|
12998
13292
|
{
|
|
12999
13293
|
...props,
|
|
@@ -13021,7 +13315,7 @@ var Dialog_default = Dialog;
|
|
|
13021
13315
|
// src/components/primitives/MultiInput/MultiInput.tsx
|
|
13022
13316
|
import { withVendorCSSClassPrefix as withVendorCSSClassPrefix26, bem as bem18 } from "@asgardeo/browser";
|
|
13023
13317
|
import { cx as cx27 } from "@emotion/css";
|
|
13024
|
-
import { useCallback as useCallback16, useState as
|
|
13318
|
+
import { useCallback as useCallback16, useState as useState24 } from "react";
|
|
13025
13319
|
|
|
13026
13320
|
// src/components/primitives/MultiInput/MultiInput.styles.ts
|
|
13027
13321
|
import { css as css24 } from "@emotion/css";
|
|
@@ -13116,7 +13410,7 @@ var useStyles23 = (theme, colorScheme, disabled, hasError, canAddMore, canRemove
|
|
|
13116
13410
|
var MultiInput_styles_default = useStyles23;
|
|
13117
13411
|
|
|
13118
13412
|
// src/components/primitives/MultiInput/MultiInput.tsx
|
|
13119
|
-
import { jsx as
|
|
13413
|
+
import { jsx as jsx97, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
13120
13414
|
var MultiInput = ({
|
|
13121
13415
|
label,
|
|
13122
13416
|
error,
|
|
@@ -13139,8 +13433,8 @@ var MultiInput = ({
|
|
|
13139
13433
|
const canAddMore = !maxFields || values.length < maxFields;
|
|
13140
13434
|
const canRemove = values.length > minFields;
|
|
13141
13435
|
const styles = MultiInput_styles_default(theme, colorScheme, !!disabled, !!error, canAddMore, canRemove);
|
|
13142
|
-
const PlusIcon = ({ iconClassName }) => /* @__PURE__ */
|
|
13143
|
-
const BinIcon = ({ iconClassName }) => /* @__PURE__ */
|
|
13436
|
+
const PlusIcon = ({ iconClassName }) => /* @__PURE__ */ jsx97("svg", { width: "16", height: "16", viewBox: "0 0 24 24", className: cx27(styles["icon"], iconClassName), children: /* @__PURE__ */ jsx97("path", { d: "M12 5v14M5 12h14" }) });
|
|
13437
|
+
const BinIcon = ({ iconClassName }) => /* @__PURE__ */ jsx97("svg", { width: "16", height: "16", viewBox: "0 0 24 24", className: cx27(styles["icon"], iconClassName), children: /* @__PURE__ */ jsx97("path", { d: "M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2m3 0v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6h14ZM10 11v6M14 11v6" }) });
|
|
13144
13438
|
const handleAddValue = useCallback16(
|
|
13145
13439
|
(newValue) => {
|
|
13146
13440
|
if (newValue.trim() !== "" && (!maxFields || values.length < maxFields)) {
|
|
@@ -13184,9 +13478,9 @@ var MultiInput = ({
|
|
|
13184
13478
|
};
|
|
13185
13479
|
switch (fieldType) {
|
|
13186
13480
|
case "DATE_TIME":
|
|
13187
|
-
return /* @__PURE__ */
|
|
13481
|
+
return /* @__PURE__ */ jsx97(DatePicker_default, { ...commonProps });
|
|
13188
13482
|
case "BOOLEAN":
|
|
13189
|
-
return /* @__PURE__ */
|
|
13483
|
+
return /* @__PURE__ */ jsx97(
|
|
13190
13484
|
Checkbox_default,
|
|
13191
13485
|
{
|
|
13192
13486
|
...commonProps,
|
|
@@ -13195,19 +13489,19 @@ var MultiInput = ({
|
|
|
13195
13489
|
}
|
|
13196
13490
|
);
|
|
13197
13491
|
default:
|
|
13198
|
-
return /* @__PURE__ */
|
|
13492
|
+
return /* @__PURE__ */ jsx97(TextField_default, { ...commonProps, type });
|
|
13199
13493
|
}
|
|
13200
13494
|
},
|
|
13201
13495
|
[placeholder, disabled, startIcon, endIcon, error, fieldType, type]
|
|
13202
13496
|
);
|
|
13203
|
-
const [currentInputValue, setCurrentInputValue] =
|
|
13497
|
+
const [currentInputValue, setCurrentInputValue] = useState24("");
|
|
13204
13498
|
const handleInputSubmit = useCallback16(() => {
|
|
13205
13499
|
if (currentInputValue.trim() !== "") {
|
|
13206
13500
|
handleAddValue(currentInputValue);
|
|
13207
13501
|
setCurrentInputValue("");
|
|
13208
13502
|
}
|
|
13209
13503
|
}, [currentInputValue, handleAddValue]);
|
|
13210
|
-
return /* @__PURE__ */
|
|
13504
|
+
return /* @__PURE__ */ jsxs40(
|
|
13211
13505
|
FormControl_default,
|
|
13212
13506
|
{
|
|
13213
13507
|
error,
|
|
@@ -13215,27 +13509,27 @@ var MultiInput = ({
|
|
|
13215
13509
|
className: cx27(withVendorCSSClassPrefix26(bem18("multi-input")), className),
|
|
13216
13510
|
style,
|
|
13217
13511
|
children: [
|
|
13218
|
-
label && /* @__PURE__ */
|
|
13219
|
-
/* @__PURE__ */
|
|
13220
|
-
/* @__PURE__ */
|
|
13512
|
+
label && /* @__PURE__ */ jsx97(InputLabel_default, { required, error: !!error, children: label }),
|
|
13513
|
+
/* @__PURE__ */ jsxs40("div", { className: cx27(withVendorCSSClassPrefix26(bem18("multi-input", "container")), styles["container"]), children: [
|
|
13514
|
+
/* @__PURE__ */ jsx97("div", { className: cx27(withVendorCSSClassPrefix26(bem18("multi-input", "input-row")), styles["inputRow"]), children: /* @__PURE__ */ jsx97("div", { className: cx27(withVendorCSSClassPrefix26(bem18("multi-input", "input-wrapper")), styles["inputWrapper"]), children: renderInputField(
|
|
13221
13515
|
currentInputValue,
|
|
13222
13516
|
setCurrentInputValue,
|
|
13223
|
-
canAddMore ? /* @__PURE__ */
|
|
13517
|
+
canAddMore ? /* @__PURE__ */ jsx97(PlusIcon, { iconClassName: styles["plusIcon"] }) : void 0,
|
|
13224
13518
|
canAddMore ? handleInputSubmit : void 0
|
|
13225
13519
|
) }) }),
|
|
13226
|
-
values.length > 0 && /* @__PURE__ */
|
|
13520
|
+
values.length > 0 && /* @__PURE__ */ jsx97("div", { className: cx27(withVendorCSSClassPrefix26(bem18("multi-input", "list-container")), styles["listContainer"]), children: values.map((value, index) => /* @__PURE__ */ jsxs40(
|
|
13227
13521
|
"div",
|
|
13228
13522
|
{
|
|
13229
13523
|
className: cx27(withVendorCSSClassPrefix26(bem18("multi-input", "list-item")), styles["listItem"]),
|
|
13230
13524
|
children: [
|
|
13231
|
-
/* @__PURE__ */
|
|
13525
|
+
/* @__PURE__ */ jsx97(
|
|
13232
13526
|
"span",
|
|
13233
13527
|
{
|
|
13234
13528
|
className: cx27(withVendorCSSClassPrefix26(bem18("multi-input", "list-item-text")), styles["listItemText"]),
|
|
13235
13529
|
children: value
|
|
13236
13530
|
}
|
|
13237
13531
|
),
|
|
13238
|
-
canRemove && /* @__PURE__ */
|
|
13532
|
+
canRemove && /* @__PURE__ */ jsx97(
|
|
13239
13533
|
"button",
|
|
13240
13534
|
{
|
|
13241
13535
|
type: "button",
|
|
@@ -13246,7 +13540,7 @@ var MultiInput = ({
|
|
|
13246
13540
|
styles["removeButton"]
|
|
13247
13541
|
),
|
|
13248
13542
|
title: "Remove value",
|
|
13249
|
-
children: /* @__PURE__ */
|
|
13543
|
+
children: /* @__PURE__ */ jsx97(BinIcon, { iconClassName: styles["icon"] })
|
|
13250
13544
|
}
|
|
13251
13545
|
)
|
|
13252
13546
|
]
|
|
@@ -13261,7 +13555,7 @@ var MultiInput = ({
|
|
|
13261
13555
|
var MultiInput_default = MultiInput;
|
|
13262
13556
|
|
|
13263
13557
|
// src/components/presentation/UserProfile/BaseUserProfile.tsx
|
|
13264
|
-
import { Fragment as
|
|
13558
|
+
import { Fragment as Fragment19, jsx as jsx98, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
13265
13559
|
var fieldsToSkip = [
|
|
13266
13560
|
"roles.default",
|
|
13267
13561
|
"active",
|
|
@@ -13305,8 +13599,8 @@ var BaseUserProfile = ({
|
|
|
13305
13599
|
displayNameAttributes = []
|
|
13306
13600
|
}) => {
|
|
13307
13601
|
const { theme, colorScheme } = useTheme_default();
|
|
13308
|
-
const [editedUser, setEditedUser] =
|
|
13309
|
-
const [editingFields, setEditingFields] =
|
|
13602
|
+
const [editedUser, setEditedUser] = useState25(flattenedProfile || profile);
|
|
13603
|
+
const [editingFields, setEditingFields] = useState25({});
|
|
13310
13604
|
const { t } = useTranslation_default(preferences?.i18n);
|
|
13311
13605
|
const shouldShowField = useCallback17(
|
|
13312
13606
|
(fieldName) => {
|
|
@@ -13323,7 +13617,7 @@ var BaseUserProfile = ({
|
|
|
13323
13617
|
},
|
|
13324
13618
|
[showFields, hideFields]
|
|
13325
13619
|
);
|
|
13326
|
-
const PencilIcon = () => /* @__PURE__ */
|
|
13620
|
+
const PencilIcon = () => /* @__PURE__ */ jsx98(
|
|
13327
13621
|
"svg",
|
|
13328
13622
|
{
|
|
13329
13623
|
width: "16",
|
|
@@ -13334,7 +13628,7 @@ var BaseUserProfile = ({
|
|
|
13334
13628
|
strokeWidth: "2",
|
|
13335
13629
|
strokeLinecap: "round",
|
|
13336
13630
|
strokeLinejoin: "round",
|
|
13337
|
-
children: /* @__PURE__ */
|
|
13631
|
+
children: /* @__PURE__ */ jsx98("path", { d: "M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z" })
|
|
13338
13632
|
}
|
|
13339
13633
|
);
|
|
13340
13634
|
const toggleFieldEdit = useCallback17((fieldName) => {
|
|
@@ -13364,12 +13658,12 @@ var BaseUserProfile = ({
|
|
|
13364
13658
|
const styles = BaseUserProfile_styles_default(theme, colorScheme);
|
|
13365
13659
|
const ObjectDisplay = ({ data }) => {
|
|
13366
13660
|
if (!data || typeof data !== "object") return null;
|
|
13367
|
-
return /* @__PURE__ */
|
|
13368
|
-
/* @__PURE__ */
|
|
13661
|
+
return /* @__PURE__ */ jsx98("table", { className: styles.value, children: /* @__PURE__ */ jsx98("tbody", { children: Object.entries(data).map(([key, value]) => /* @__PURE__ */ jsxs41("tr", { children: [
|
|
13662
|
+
/* @__PURE__ */ jsx98("td", { className: styles.objectKey, children: /* @__PURE__ */ jsxs41("strong", { children: [
|
|
13369
13663
|
formatLabel(key),
|
|
13370
13664
|
":"
|
|
13371
13665
|
] }) }),
|
|
13372
|
-
/* @__PURE__ */
|
|
13666
|
+
/* @__PURE__ */ jsx98("td", { className: styles.objectValue, children: typeof value === "object" ? /* @__PURE__ */ jsx98(ObjectDisplay, { data: value }) : String(value) })
|
|
13373
13667
|
] }, key)) }) });
|
|
13374
13668
|
};
|
|
13375
13669
|
function set(obj, path, value) {
|
|
@@ -13444,7 +13738,7 @@ var BaseUserProfile = ({
|
|
|
13444
13738
|
const { value, displayName, description, name, type, required, mutability, subAttributes, multiValued } = schema;
|
|
13445
13739
|
const label = displayName || description || name || "";
|
|
13446
13740
|
if (subAttributes && Array.isArray(subAttributes)) {
|
|
13447
|
-
return /* @__PURE__ */
|
|
13741
|
+
return /* @__PURE__ */ jsx98(Fragment19, { children: subAttributes.map((subAttr, index) => {
|
|
13448
13742
|
let displayValue2;
|
|
13449
13743
|
if (Array.isArray(subAttr.value)) {
|
|
13450
13744
|
displayValue2 = subAttr.value.map((item) => typeof item === "object" ? JSON.stringify(item) : String(item)).join(", ");
|
|
@@ -13453,9 +13747,9 @@ var BaseUserProfile = ({
|
|
|
13453
13747
|
} else {
|
|
13454
13748
|
displayValue2 = String(subAttr.value);
|
|
13455
13749
|
}
|
|
13456
|
-
return /* @__PURE__ */
|
|
13457
|
-
/* @__PURE__ */
|
|
13458
|
-
/* @__PURE__ */
|
|
13750
|
+
return /* @__PURE__ */ jsxs41("div", { className: styles.field, children: [
|
|
13751
|
+
/* @__PURE__ */ jsx98("span", { className: styles.label, children: subAttr.displayName || subAttr.description || "" }),
|
|
13752
|
+
/* @__PURE__ */ jsx98("div", { className: styles.value, children: displayValue2 })
|
|
13459
13753
|
] }, index);
|
|
13460
13754
|
}) });
|
|
13461
13755
|
}
|
|
@@ -13479,9 +13773,9 @@ var BaseUserProfile = ({
|
|
|
13479
13773
|
} else {
|
|
13480
13774
|
fieldValues = [];
|
|
13481
13775
|
}
|
|
13482
|
-
return /* @__PURE__ */
|
|
13483
|
-
/* @__PURE__ */
|
|
13484
|
-
/* @__PURE__ */
|
|
13776
|
+
return /* @__PURE__ */ jsxs41(Fragment19, { children: [
|
|
13777
|
+
/* @__PURE__ */ jsx98("span", { className: styles.label, children: label }),
|
|
13778
|
+
/* @__PURE__ */ jsx98("div", { className: styles.value, children: /* @__PURE__ */ jsx98(
|
|
13485
13779
|
MultiInput_default,
|
|
13486
13780
|
{
|
|
13487
13781
|
values: fieldValues,
|
|
@@ -13512,9 +13806,9 @@ var BaseUserProfile = ({
|
|
|
13512
13806
|
} else {
|
|
13513
13807
|
displayValue2 = "-";
|
|
13514
13808
|
}
|
|
13515
|
-
return /* @__PURE__ */
|
|
13516
|
-
/* @__PURE__ */
|
|
13517
|
-
/* @__PURE__ */
|
|
13809
|
+
return /* @__PURE__ */ jsxs41(Fragment19, { children: [
|
|
13810
|
+
/* @__PURE__ */ jsx98("span", { className: styles.label, children: label }),
|
|
13811
|
+
/* @__PURE__ */ jsx98("div", { className: cx28(styles.value, !hasValues ? styles.valuePlaceholder : ""), children: !hasValues && isEditable2 && onStartEdit ? /* @__PURE__ */ jsx98(
|
|
13518
13812
|
Button_default,
|
|
13519
13813
|
{
|
|
13520
13814
|
onClick: onStartEdit,
|
|
@@ -13529,7 +13823,7 @@ var BaseUserProfile = ({
|
|
|
13529
13823
|
] });
|
|
13530
13824
|
}
|
|
13531
13825
|
if (type === "COMPLEX" && typeof value === "object") {
|
|
13532
|
-
return /* @__PURE__ */
|
|
13826
|
+
return /* @__PURE__ */ jsx98(ObjectDisplay, { data: value });
|
|
13533
13827
|
}
|
|
13534
13828
|
if (isEditing && onEditValue && mutability !== "READ_ONLY" && !readonlyFields.includes(name || "")) {
|
|
13535
13829
|
let fieldValue;
|
|
@@ -13551,13 +13845,13 @@ var BaseUserProfile = ({
|
|
|
13551
13845
|
let field;
|
|
13552
13846
|
switch (type) {
|
|
13553
13847
|
case "STRING":
|
|
13554
|
-
field = /* @__PURE__ */
|
|
13848
|
+
field = /* @__PURE__ */ jsx98(TextField_default, { ...commonProps });
|
|
13555
13849
|
break;
|
|
13556
13850
|
case "DATE_TIME":
|
|
13557
|
-
field = /* @__PURE__ */
|
|
13851
|
+
field = /* @__PURE__ */ jsx98(DatePicker_default, { ...commonProps });
|
|
13558
13852
|
break;
|
|
13559
13853
|
case "BOOLEAN":
|
|
13560
|
-
field = /* @__PURE__ */
|
|
13854
|
+
field = /* @__PURE__ */ jsx98(
|
|
13561
13855
|
Checkbox_default,
|
|
13562
13856
|
{
|
|
13563
13857
|
...commonProps,
|
|
@@ -13569,7 +13863,7 @@ var BaseUserProfile = ({
|
|
|
13569
13863
|
);
|
|
13570
13864
|
break;
|
|
13571
13865
|
case "COMPLEX":
|
|
13572
|
-
field = /* @__PURE__ */
|
|
13866
|
+
field = /* @__PURE__ */ jsx98(
|
|
13573
13867
|
"textarea",
|
|
13574
13868
|
{
|
|
13575
13869
|
value: fieldValue,
|
|
@@ -13581,11 +13875,11 @@ var BaseUserProfile = ({
|
|
|
13581
13875
|
);
|
|
13582
13876
|
break;
|
|
13583
13877
|
default:
|
|
13584
|
-
field = /* @__PURE__ */
|
|
13878
|
+
field = /* @__PURE__ */ jsx98(TextField_default, { ...commonProps });
|
|
13585
13879
|
}
|
|
13586
|
-
return /* @__PURE__ */
|
|
13587
|
-
/* @__PURE__ */
|
|
13588
|
-
/* @__PURE__ */
|
|
13880
|
+
return /* @__PURE__ */ jsxs41(Fragment19, { children: [
|
|
13881
|
+
/* @__PURE__ */ jsx98("span", { className: styles.label, children: label }),
|
|
13882
|
+
/* @__PURE__ */ jsx98("div", { className: styles.value, children: field })
|
|
13589
13883
|
] });
|
|
13590
13884
|
}
|
|
13591
13885
|
const hasValue = value !== void 0 && value !== null && value !== "";
|
|
@@ -13598,9 +13892,9 @@ var BaseUserProfile = ({
|
|
|
13598
13892
|
} else {
|
|
13599
13893
|
displayValue = "-";
|
|
13600
13894
|
}
|
|
13601
|
-
return /* @__PURE__ */
|
|
13602
|
-
/* @__PURE__ */
|
|
13603
|
-
/* @__PURE__ */
|
|
13895
|
+
return /* @__PURE__ */ jsxs41(Fragment19, { children: [
|
|
13896
|
+
/* @__PURE__ */ jsx98("span", { className: styles.label, children: label }),
|
|
13897
|
+
/* @__PURE__ */ jsx98("div", { className: cx28(styles.value, !hasValue ? styles.valuePlaceholder : ""), children: !hasValue && isEditable && onStartEdit ? /* @__PURE__ */ jsx98(
|
|
13604
13898
|
Button_default,
|
|
13605
13899
|
{
|
|
13606
13900
|
onClick: onStartEdit,
|
|
@@ -13623,8 +13917,8 @@ var BaseUserProfile = ({
|
|
|
13623
13917
|
if (!shouldShow) {
|
|
13624
13918
|
return null;
|
|
13625
13919
|
}
|
|
13626
|
-
return /* @__PURE__ */
|
|
13627
|
-
/* @__PURE__ */
|
|
13920
|
+
return /* @__PURE__ */ jsxs41("div", { className: styles.field, children: [
|
|
13921
|
+
/* @__PURE__ */ jsx98("div", { className: styles.fieldInner, children: renderSchemaField(
|
|
13628
13922
|
schema,
|
|
13629
13923
|
isFieldEditing,
|
|
13630
13924
|
(value) => {
|
|
@@ -13634,10 +13928,10 @@ var BaseUserProfile = ({
|
|
|
13634
13928
|
},
|
|
13635
13929
|
() => toggleFieldEdit(schema.name)
|
|
13636
13930
|
) }),
|
|
13637
|
-
editable && schema.mutability !== "READ_ONLY" && !isReadonlyField && /* @__PURE__ */
|
|
13638
|
-
isFieldEditing && /* @__PURE__ */
|
|
13639
|
-
/* @__PURE__ */
|
|
13640
|
-
/* @__PURE__ */
|
|
13931
|
+
editable && schema.mutability !== "READ_ONLY" && !isReadonlyField && /* @__PURE__ */ jsxs41("div", { className: styles.fieldActions, children: [
|
|
13932
|
+
isFieldEditing && /* @__PURE__ */ jsxs41(Fragment19, { children: [
|
|
13933
|
+
/* @__PURE__ */ jsx98(Button_default, { size: "small", color: "primary", variant: "solid", onClick: () => handleFieldSave(schema), children: "Save" }),
|
|
13934
|
+
/* @__PURE__ */ jsx98(
|
|
13641
13935
|
Button_default,
|
|
13642
13936
|
{
|
|
13643
13937
|
size: "small",
|
|
@@ -13648,7 +13942,7 @@ var BaseUserProfile = ({
|
|
|
13648
13942
|
}
|
|
13649
13943
|
)
|
|
13650
13944
|
] }),
|
|
13651
|
-
!isFieldEditing && hasValue && /* @__PURE__ */
|
|
13945
|
+
!isFieldEditing && hasValue && /* @__PURE__ */ jsx98(
|
|
13652
13946
|
Button_default,
|
|
13653
13947
|
{
|
|
13654
13948
|
size: "small",
|
|
@@ -13657,7 +13951,7 @@ var BaseUserProfile = ({
|
|
|
13657
13951
|
onClick: () => toggleFieldEdit(schema.name),
|
|
13658
13952
|
title: "Edit",
|
|
13659
13953
|
className: styles.editButton,
|
|
13660
|
-
children: /* @__PURE__ */
|
|
13954
|
+
children: /* @__PURE__ */ jsx98(PencilIcon, {})
|
|
13661
13955
|
}
|
|
13662
13956
|
)
|
|
13663
13957
|
] })
|
|
@@ -13680,9 +13974,9 @@ var BaseUserProfile = ({
|
|
|
13680
13974
|
if (!shouldShowField(key)) return false;
|
|
13681
13975
|
return value !== void 0 && value !== "" && value !== null;
|
|
13682
13976
|
}).sort(([a], [b]) => a.localeCompare(b));
|
|
13683
|
-
return /* @__PURE__ */
|
|
13684
|
-
/* @__PURE__ */
|
|
13685
|
-
/* @__PURE__ */
|
|
13977
|
+
return /* @__PURE__ */ jsxs41(Fragment19, { children: [
|
|
13978
|
+
/* @__PURE__ */ jsxs41("div", { className: styles.profileSummary, children: [
|
|
13979
|
+
/* @__PURE__ */ jsx98(
|
|
13686
13980
|
Avatar,
|
|
13687
13981
|
{
|
|
13688
13982
|
imageUrl: getMappedUserProfileValue_default("picture", mergedMappings, currentUser),
|
|
@@ -13692,32 +13986,32 @@ var BaseUserProfile = ({
|
|
|
13692
13986
|
isLoading
|
|
13693
13987
|
}
|
|
13694
13988
|
),
|
|
13695
|
-
/* @__PURE__ */
|
|
13696
|
-
getMappedUserProfileValue_default("email", mergedMappings, currentUser) && /* @__PURE__ */
|
|
13989
|
+
/* @__PURE__ */ jsx98(Typography_default, { variant: "h3", fontWeight: "medium", children: displayName }),
|
|
13990
|
+
getMappedUserProfileValue_default("email", mergedMappings, currentUser) && /* @__PURE__ */ jsx98(Typography_default, { variant: "body2", color: "textSecondary", children: getMappedUserProfileValue_default("email", mergedMappings, currentUser) })
|
|
13697
13991
|
] }),
|
|
13698
|
-
/* @__PURE__ */
|
|
13699
|
-
profileEntries.map(([key, value], index) => /* @__PURE__ */
|
|
13700
|
-
/* @__PURE__ */
|
|
13701
|
-
/* @__PURE__ */
|
|
13702
|
-
/* @__PURE__ */
|
|
13992
|
+
/* @__PURE__ */ jsx98(Divider_default, {}),
|
|
13993
|
+
profileEntries.map(([key, value], index) => /* @__PURE__ */ jsxs41("div", { children: [
|
|
13994
|
+
/* @__PURE__ */ jsxs41("div", { className: styles.sectionRow, children: [
|
|
13995
|
+
/* @__PURE__ */ jsx98("div", { className: styles.sectionLabel, children: formatLabel(key) }),
|
|
13996
|
+
/* @__PURE__ */ jsx98("div", { className: styles.sectionValue, children: typeof value === "object" ? /* @__PURE__ */ jsx98(ObjectDisplay, { data: value }) : String(value) })
|
|
13703
13997
|
] }),
|
|
13704
|
-
index < profileEntries.length - 1 && /* @__PURE__ */
|
|
13998
|
+
index < profileEntries.length - 1 && /* @__PURE__ */ jsx98(Divider_default, {})
|
|
13705
13999
|
] }, key))
|
|
13706
14000
|
] });
|
|
13707
14001
|
};
|
|
13708
|
-
const profileContent = /* @__PURE__ */
|
|
13709
|
-
error && /* @__PURE__ */
|
|
14002
|
+
const profileContent = /* @__PURE__ */ jsxs41(Card_default, { className: containerClasses, children: [
|
|
14003
|
+
error && /* @__PURE__ */ jsxs41(
|
|
13710
14004
|
Alert_default,
|
|
13711
14005
|
{
|
|
13712
14006
|
variant: "error",
|
|
13713
14007
|
className: cx28(withVendorCSSClassPrefix27(bem19("user-profile", "alert")), styles.alert),
|
|
13714
14008
|
children: [
|
|
13715
|
-
/* @__PURE__ */
|
|
13716
|
-
/* @__PURE__ */
|
|
14009
|
+
/* @__PURE__ */ jsx98(Alert_default.Title, { children: t("errors.heading") || "Error" }),
|
|
14010
|
+
/* @__PURE__ */ jsx98(Alert_default.Description, { children: error })
|
|
13717
14011
|
]
|
|
13718
14012
|
}
|
|
13719
14013
|
),
|
|
13720
|
-
schemas && schemas.length > 0 && /* @__PURE__ */
|
|
14014
|
+
schemas && schemas.length > 0 && /* @__PURE__ */ jsx98("div", { className: styles.header, children: /* @__PURE__ */ jsx98(
|
|
13721
14015
|
Avatar,
|
|
13722
14016
|
{
|
|
13723
14017
|
imageUrl: getMappedUserProfileValue_default("picture", mergedMappings, currentUser),
|
|
@@ -13727,7 +14021,7 @@ var BaseUserProfile = ({
|
|
|
13727
14021
|
isLoading
|
|
13728
14022
|
}
|
|
13729
14023
|
) }),
|
|
13730
|
-
/* @__PURE__ */
|
|
14024
|
+
/* @__PURE__ */ jsx98("div", { className: styles.infoContainer, children: schemas && schemas.length > 0 ? schemas.filter((schema) => {
|
|
13731
14025
|
if (!schema.name || !shouldShowField(schema.name)) return false;
|
|
13732
14026
|
if (!editable) {
|
|
13733
14027
|
const value = flattenedProfile && schema.name ? flattenedProfile[schema.name] : void 0;
|
|
@@ -13744,13 +14038,13 @@ var BaseUserProfile = ({
|
|
|
13744
14038
|
...schema,
|
|
13745
14039
|
value
|
|
13746
14040
|
};
|
|
13747
|
-
return /* @__PURE__ */
|
|
14041
|
+
return /* @__PURE__ */ jsx98("div", { className: styles.info, children: renderUserInfo(schemaWithValue) }, schema.name || index);
|
|
13748
14042
|
}) : renderProfileWithoutSchemas() })
|
|
13749
14043
|
] });
|
|
13750
14044
|
if (mode === "popup") {
|
|
13751
|
-
return /* @__PURE__ */
|
|
13752
|
-
/* @__PURE__ */
|
|
13753
|
-
/* @__PURE__ */
|
|
14045
|
+
return /* @__PURE__ */ jsx98(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ jsxs41(Dialog_default.Content, { children: [
|
|
14046
|
+
/* @__PURE__ */ jsx98(Dialog_default.Heading, { children: title ?? t("user.profile.heading") }),
|
|
14047
|
+
/* @__PURE__ */ jsx98("div", { className: styles.popup, children: profileContent })
|
|
13754
14048
|
] }) });
|
|
13755
14049
|
}
|
|
13756
14050
|
return profileContent;
|
|
@@ -13759,7 +14053,7 @@ var BaseUserProfile_default = BaseUserProfile;
|
|
|
13759
14053
|
|
|
13760
14054
|
// src/components/presentation/UserProfile/UserProfile.tsx
|
|
13761
14055
|
import { AsgardeoError } from "@asgardeo/browser";
|
|
13762
|
-
import { useState as
|
|
14056
|
+
import { useState as useState26 } from "react";
|
|
13763
14057
|
|
|
13764
14058
|
// src/api/updateMeProfile.ts
|
|
13765
14059
|
import {
|
|
@@ -13792,12 +14086,12 @@ var updateMeProfile = async ({ fetcher, instanceId = 0, ...requestConfig }) => {
|
|
|
13792
14086
|
var updateMeProfile_default = updateMeProfile;
|
|
13793
14087
|
|
|
13794
14088
|
// src/components/presentation/UserProfile/UserProfile.tsx
|
|
13795
|
-
import { jsx as
|
|
14089
|
+
import { jsx as jsx99 } from "react/jsx-runtime";
|
|
13796
14090
|
var UserProfile3 = ({ preferences, ...rest }) => {
|
|
13797
14091
|
const { baseUrl, instanceId } = useAsgardeo_default();
|
|
13798
14092
|
const { profile, flattenedProfile, schemas, onUpdateProfile } = useUser_default();
|
|
13799
14093
|
const { t } = useTranslation_default(preferences?.i18n);
|
|
13800
|
-
const [error, setError] =
|
|
14094
|
+
const [error, setError] = useState26(null);
|
|
13801
14095
|
const handleProfileUpdate = async (payload) => {
|
|
13802
14096
|
setError(null);
|
|
13803
14097
|
try {
|
|
@@ -13811,7 +14105,7 @@ var UserProfile3 = ({ preferences, ...rest }) => {
|
|
|
13811
14105
|
setError(message);
|
|
13812
14106
|
}
|
|
13813
14107
|
};
|
|
13814
|
-
return /* @__PURE__ */
|
|
14108
|
+
return /* @__PURE__ */ jsx99(
|
|
13815
14109
|
BaseUserProfile_default,
|
|
13816
14110
|
{
|
|
13817
14111
|
profile,
|
|
@@ -13842,7 +14136,7 @@ import {
|
|
|
13842
14136
|
FloatingFocusManager as FloatingFocusManager2,
|
|
13843
14137
|
FloatingPortal as FloatingPortal2
|
|
13844
14138
|
} from "@floating-ui/react";
|
|
13845
|
-
import { useState as
|
|
14139
|
+
import { useState as useState27 } from "react";
|
|
13846
14140
|
|
|
13847
14141
|
// src/components/presentation/UserDropdown/BaseUserDropdown.styles.ts
|
|
13848
14142
|
import { css as css25 } from "@emotion/css";
|
|
@@ -14034,7 +14328,7 @@ var useStyles24 = (theme, colorScheme) => useMemo35(() => {
|
|
|
14034
14328
|
var BaseUserDropdown_styles_default = useStyles24;
|
|
14035
14329
|
|
|
14036
14330
|
// src/components/presentation/UserDropdown/BaseUserDropdown.tsx
|
|
14037
|
-
import { jsx as
|
|
14331
|
+
import { jsx as jsx100, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
14038
14332
|
var BaseUserDropdown = ({
|
|
14039
14333
|
fallback = null,
|
|
14040
14334
|
className = "",
|
|
@@ -14050,8 +14344,8 @@ var BaseUserDropdown = ({
|
|
|
14050
14344
|
}) => {
|
|
14051
14345
|
const { theme, colorScheme } = useTheme_default();
|
|
14052
14346
|
const styles = BaseUserDropdown_styles_default(theme, colorScheme);
|
|
14053
|
-
const [isOpen, setIsOpen] =
|
|
14054
|
-
const [hoveredItemIndex, setHoveredItemIndex] =
|
|
14347
|
+
const [isOpen, setIsOpen] = useState27(false);
|
|
14348
|
+
const [hoveredItemIndex, setHoveredItemIndex] = useState27(null);
|
|
14055
14349
|
const { refs, floatingStyles, context } = useFloating2({
|
|
14056
14350
|
middleware: [offset(5), flip({ fallbackAxisSideDirection: "end" }), shift({ padding: 5 })],
|
|
14057
14351
|
onOpenChange: setIsOpen,
|
|
@@ -14086,14 +14380,14 @@ var BaseUserDropdown = ({
|
|
|
14086
14380
|
const defaultMenuItems = [];
|
|
14087
14381
|
if (onManageProfile) {
|
|
14088
14382
|
defaultMenuItems.push({
|
|
14089
|
-
icon: /* @__PURE__ */
|
|
14383
|
+
icon: /* @__PURE__ */ jsx100(User_default2, { width: "16", height: "16" }),
|
|
14090
14384
|
label: "Manage Profile",
|
|
14091
14385
|
onClick: onManageProfile
|
|
14092
14386
|
});
|
|
14093
14387
|
}
|
|
14094
14388
|
if (onSignOut) {
|
|
14095
14389
|
defaultMenuItems.push({
|
|
14096
|
-
icon: /* @__PURE__ */
|
|
14390
|
+
icon: /* @__PURE__ */ jsx100(LogOut_default, { width: "16", height: "16" }),
|
|
14097
14391
|
label: "Sign Out",
|
|
14098
14392
|
onClick: onSignOut
|
|
14099
14393
|
});
|
|
@@ -14105,8 +14399,8 @@ var BaseUserDropdown = ({
|
|
|
14105
14399
|
}
|
|
14106
14400
|
allMenuItems.push(...defaultMenuItems);
|
|
14107
14401
|
}
|
|
14108
|
-
return /* @__PURE__ */
|
|
14109
|
-
/* @__PURE__ */
|
|
14402
|
+
return /* @__PURE__ */ jsxs42("div", { className: cx29(withVendorCSSClassPrefix28("user-dropdown"), className), children: [
|
|
14403
|
+
/* @__PURE__ */ jsxs42(
|
|
14110
14404
|
Button_default,
|
|
14111
14405
|
{
|
|
14112
14406
|
ref: refs.setReference,
|
|
@@ -14117,7 +14411,7 @@ var BaseUserDropdown = ({
|
|
|
14117
14411
|
"data-testid": "asgardeo-user-dropdown-trigger",
|
|
14118
14412
|
...getReferenceProps(),
|
|
14119
14413
|
children: [
|
|
14120
|
-
/* @__PURE__ */
|
|
14414
|
+
/* @__PURE__ */ jsx100(
|
|
14121
14415
|
Avatar,
|
|
14122
14416
|
{
|
|
14123
14417
|
imageUrl: getMappedUserProfileValue_default("picture", mergedMappings, user),
|
|
@@ -14126,7 +14420,7 @@ var BaseUserDropdown = ({
|
|
|
14126
14420
|
alt: `${getDisplayName_default(mergedMappings, user)}'s avatar`
|
|
14127
14421
|
}
|
|
14128
14422
|
),
|
|
14129
|
-
showTriggerLabel && /* @__PURE__ */
|
|
14423
|
+
showTriggerLabel && /* @__PURE__ */ jsx100(
|
|
14130
14424
|
Typography_default,
|
|
14131
14425
|
{
|
|
14132
14426
|
variant: "body2",
|
|
@@ -14137,7 +14431,7 @@ var BaseUserDropdown = ({
|
|
|
14137
14431
|
]
|
|
14138
14432
|
}
|
|
14139
14433
|
),
|
|
14140
|
-
isOpen && /* @__PURE__ */
|
|
14434
|
+
isOpen && /* @__PURE__ */ jsx100(FloatingPortal2, { id: portalId, children: /* @__PURE__ */ jsx100(FloatingFocusManager2, { context, modal: false, initialFocus: -1, children: /* @__PURE__ */ jsxs42(
|
|
14141
14435
|
"div",
|
|
14142
14436
|
{
|
|
14143
14437
|
ref: refs.setFloating,
|
|
@@ -14150,8 +14444,8 @@ var BaseUserDropdown = ({
|
|
|
14150
14444
|
},
|
|
14151
14445
|
...getFloatingProps(),
|
|
14152
14446
|
children: [
|
|
14153
|
-
/* @__PURE__ */
|
|
14154
|
-
/* @__PURE__ */
|
|
14447
|
+
/* @__PURE__ */ jsxs42("div", { className: cx29(withVendorCSSClassPrefix28("user-dropdown__header"), styles["dropdownHeader"]), children: [
|
|
14448
|
+
/* @__PURE__ */ jsx100(
|
|
14155
14449
|
Avatar,
|
|
14156
14450
|
{
|
|
14157
14451
|
imageUrl: getMappedUserProfileValue_default("picture", mergedMappings, user),
|
|
@@ -14160,8 +14454,8 @@ var BaseUserDropdown = ({
|
|
|
14160
14454
|
alt: `${getDisplayName_default(mergedMappings, user)}'s avatar`
|
|
14161
14455
|
}
|
|
14162
14456
|
),
|
|
14163
|
-
/* @__PURE__ */
|
|
14164
|
-
/* @__PURE__ */
|
|
14457
|
+
/* @__PURE__ */ jsxs42("div", { className: cx29(withVendorCSSClassPrefix28("user-dropdown__header-info"), styles["headerInfo"]), children: [
|
|
14458
|
+
/* @__PURE__ */ jsx100(
|
|
14165
14459
|
Typography_default,
|
|
14166
14460
|
{
|
|
14167
14461
|
noWrap: true,
|
|
@@ -14171,7 +14465,7 @@ var BaseUserDropdown = ({
|
|
|
14171
14465
|
children: getDisplayName_default(mergedMappings, user)
|
|
14172
14466
|
}
|
|
14173
14467
|
),
|
|
14174
|
-
/* @__PURE__ */
|
|
14468
|
+
/* @__PURE__ */ jsx100(
|
|
14175
14469
|
Typography_default,
|
|
14176
14470
|
{
|
|
14177
14471
|
noWrap: true,
|
|
@@ -14183,9 +14477,9 @@ var BaseUserDropdown = ({
|
|
|
14183
14477
|
)
|
|
14184
14478
|
] })
|
|
14185
14479
|
] }),
|
|
14186
|
-
/* @__PURE__ */
|
|
14480
|
+
/* @__PURE__ */ jsx100("div", { className: cx29(withVendorCSSClassPrefix28("user-dropdown__menu"), styles["dropdownMenu"]), children: allMenuItems.map((item, index) => /* @__PURE__ */ jsx100("div", { children: (() => {
|
|
14187
14481
|
if (item.label === "") {
|
|
14188
|
-
return /* @__PURE__ */
|
|
14482
|
+
return /* @__PURE__ */ jsx100(
|
|
14189
14483
|
"div",
|
|
14190
14484
|
{
|
|
14191
14485
|
className: cx29(withVendorCSSClassPrefix28("user-dropdown__menu-divider"), styles["divider"])
|
|
@@ -14193,7 +14487,7 @@ var BaseUserDropdown = ({
|
|
|
14193
14487
|
);
|
|
14194
14488
|
}
|
|
14195
14489
|
if (item.href) {
|
|
14196
|
-
return /* @__PURE__ */
|
|
14490
|
+
return /* @__PURE__ */ jsxs42(
|
|
14197
14491
|
"a",
|
|
14198
14492
|
{
|
|
14199
14493
|
href: item.href,
|
|
@@ -14210,12 +14504,12 @@ var BaseUserDropdown = ({
|
|
|
14210
14504
|
onBlur: () => setHoveredItemIndex(null),
|
|
14211
14505
|
children: [
|
|
14212
14506
|
item.icon,
|
|
14213
|
-
/* @__PURE__ */
|
|
14507
|
+
/* @__PURE__ */ jsx100("span", { children: item.label })
|
|
14214
14508
|
]
|
|
14215
14509
|
}
|
|
14216
14510
|
);
|
|
14217
14511
|
}
|
|
14218
|
-
return /* @__PURE__ */
|
|
14512
|
+
return /* @__PURE__ */ jsx100(
|
|
14219
14513
|
Button_default,
|
|
14220
14514
|
{
|
|
14221
14515
|
onClick: () => handleMenuItemClick(item),
|
|
@@ -14241,8 +14535,8 @@ var BaseUserDropdown = ({
|
|
|
14241
14535
|
var BaseUserDropdown_default = BaseUserDropdown;
|
|
14242
14536
|
|
|
14243
14537
|
// src/components/presentation/UserDropdown/UserDropdown.tsx
|
|
14244
|
-
import { useState as
|
|
14245
|
-
import { Fragment as
|
|
14538
|
+
import { useState as useState28 } from "react";
|
|
14539
|
+
import { Fragment as Fragment20, jsx as jsx101, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
14246
14540
|
var UserDropdown = ({
|
|
14247
14541
|
children,
|
|
14248
14542
|
renderTrigger,
|
|
@@ -14251,7 +14545,7 @@ var UserDropdown = ({
|
|
|
14251
14545
|
...rest
|
|
14252
14546
|
}) => {
|
|
14253
14547
|
const { user, isLoading, signOut, meta } = useAsgardeo_default();
|
|
14254
|
-
const [isProfileOpen, setIsProfileOpen] =
|
|
14548
|
+
const [isProfileOpen, setIsProfileOpen] = useState28(false);
|
|
14255
14549
|
const handleManageProfile = () => {
|
|
14256
14550
|
setIsProfileOpen(true);
|
|
14257
14551
|
};
|
|
@@ -14274,14 +14568,14 @@ var UserDropdown = ({
|
|
|
14274
14568
|
user
|
|
14275
14569
|
};
|
|
14276
14570
|
if (children) {
|
|
14277
|
-
return /* @__PURE__ */
|
|
14571
|
+
return /* @__PURE__ */ jsxs43(Fragment20, { children: [
|
|
14278
14572
|
children(renderProps),
|
|
14279
|
-
/* @__PURE__ */
|
|
14573
|
+
/* @__PURE__ */ jsx101(UserProfile_default, { mode: "popup", open: isProfileOpen, onOpenChange: setIsProfileOpen })
|
|
14280
14574
|
] });
|
|
14281
14575
|
}
|
|
14282
14576
|
if (renderTrigger || renderDropdown) {
|
|
14283
|
-
return /* @__PURE__ */
|
|
14284
|
-
renderTrigger ? renderTrigger(renderProps) : /* @__PURE__ */
|
|
14577
|
+
return /* @__PURE__ */ jsxs43(Fragment20, { children: [
|
|
14578
|
+
renderTrigger ? renderTrigger(renderProps) : /* @__PURE__ */ jsx101(
|
|
14285
14579
|
BaseUserDropdown,
|
|
14286
14580
|
{
|
|
14287
14581
|
user,
|
|
@@ -14291,11 +14585,11 @@ var UserDropdown = ({
|
|
|
14291
14585
|
...rest
|
|
14292
14586
|
}
|
|
14293
14587
|
),
|
|
14294
|
-
/* @__PURE__ */
|
|
14588
|
+
/* @__PURE__ */ jsx101(UserProfile_default, { mode: "popup", open: isProfileOpen, onOpenChange: setIsProfileOpen })
|
|
14295
14589
|
] });
|
|
14296
14590
|
}
|
|
14297
|
-
return /* @__PURE__ */
|
|
14298
|
-
/* @__PURE__ */
|
|
14591
|
+
return /* @__PURE__ */ jsxs43(Fragment20, { children: [
|
|
14592
|
+
/* @__PURE__ */ jsx101(
|
|
14299
14593
|
BaseUserDropdown,
|
|
14300
14594
|
{
|
|
14301
14595
|
user,
|
|
@@ -14305,7 +14599,7 @@ var UserDropdown = ({
|
|
|
14305
14599
|
...rest
|
|
14306
14600
|
}
|
|
14307
14601
|
),
|
|
14308
|
-
isProfileOpen && /* @__PURE__ */
|
|
14602
|
+
isProfileOpen && /* @__PURE__ */ jsx101(UserProfile_default, { mode: "popup", open: isProfileOpen, onOpenChange: setIsProfileOpen })
|
|
14309
14603
|
] });
|
|
14310
14604
|
};
|
|
14311
14605
|
var UserDropdown_default = UserDropdown;
|
|
@@ -14325,7 +14619,7 @@ import {
|
|
|
14325
14619
|
FloatingFocusManager as FloatingFocusManager3,
|
|
14326
14620
|
FloatingPortal as FloatingPortal3
|
|
14327
14621
|
} from "@floating-ui/react";
|
|
14328
|
-
import { useState as
|
|
14622
|
+
import { useState as useState29 } from "react";
|
|
14329
14623
|
|
|
14330
14624
|
// src/components/presentation/OrganizationSwitcher/BaseOrganizationSwitcher.styles.ts
|
|
14331
14625
|
import { css as css26 } from "@emotion/css";
|
|
@@ -14553,9 +14847,9 @@ var useStyles25 = (theme, colorScheme) => useMemo36(() => {
|
|
|
14553
14847
|
var BaseOrganizationSwitcher_styles_default = useStyles25;
|
|
14554
14848
|
|
|
14555
14849
|
// src/components/primitives/Icons/Building.tsx
|
|
14556
|
-
import { jsx as
|
|
14557
|
-
var Building = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */
|
|
14558
|
-
/* @__PURE__ */
|
|
14850
|
+
import { jsx as jsx102, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
14851
|
+
var Building = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */ jsxs44("svg", { width, height, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
14852
|
+
/* @__PURE__ */ jsx102(
|
|
14559
14853
|
"path",
|
|
14560
14854
|
{
|
|
14561
14855
|
d: "M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",
|
|
@@ -14565,30 +14859,30 @@ var Building = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PU
|
|
|
14565
14859
|
strokeLinejoin: "round"
|
|
14566
14860
|
}
|
|
14567
14861
|
),
|
|
14568
|
-
/* @__PURE__ */
|
|
14569
|
-
/* @__PURE__ */
|
|
14570
|
-
/* @__PURE__ */
|
|
14571
|
-
/* @__PURE__ */
|
|
14572
|
-
/* @__PURE__ */
|
|
14573
|
-
/* @__PURE__ */
|
|
14862
|
+
/* @__PURE__ */ jsx102("path", { d: "M6 12h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
14863
|
+
/* @__PURE__ */ jsx102("path", { d: "M6 8h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
14864
|
+
/* @__PURE__ */ jsx102("path", { d: "M14 8h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
14865
|
+
/* @__PURE__ */ jsx102("path", { d: "M14 12h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
14866
|
+
/* @__PURE__ */ jsx102("path", { d: "M6 18h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
14867
|
+
/* @__PURE__ */ jsx102("path", { d: "M14 18h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
14574
14868
|
] });
|
|
14575
14869
|
Building.displayName = "Building";
|
|
14576
14870
|
var Building_default = Building;
|
|
14577
14871
|
|
|
14578
14872
|
// src/components/primitives/Icons/Check.tsx
|
|
14579
|
-
import { jsx as
|
|
14580
|
-
var Check = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */
|
|
14873
|
+
import { jsx as jsx103 } from "react/jsx-runtime";
|
|
14874
|
+
var Check = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */ jsx103("svg", { width, height, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx103("path", { d: "M20 6 9 17l-5-5", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
14581
14875
|
Check.displayName = "Check";
|
|
14582
14876
|
var Check_default = Check;
|
|
14583
14877
|
|
|
14584
14878
|
// src/components/primitives/Icons/ChevronDown.tsx
|
|
14585
|
-
import { jsx as
|
|
14586
|
-
var ChevronDown = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */
|
|
14879
|
+
import { jsx as jsx104 } from "react/jsx-runtime";
|
|
14880
|
+
var ChevronDown = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */ jsx104("svg", { width, height, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx104("path", { d: "m6 9 6 6 6-6", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
14587
14881
|
ChevronDown.displayName = "ChevronDown";
|
|
14588
14882
|
var ChevronDown_default = ChevronDown;
|
|
14589
14883
|
|
|
14590
14884
|
// src/components/presentation/OrganizationSwitcher/BaseOrganizationSwitcher.tsx
|
|
14591
|
-
import { Fragment as
|
|
14885
|
+
import { Fragment as Fragment21, jsx as jsx105, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
14592
14886
|
var BaseOrganizationSwitcher = ({
|
|
14593
14887
|
organizations,
|
|
14594
14888
|
currentOrganization,
|
|
@@ -14612,8 +14906,8 @@ var BaseOrganizationSwitcher = ({
|
|
|
14612
14906
|
}) => {
|
|
14613
14907
|
const { theme, colorScheme, direction } = useTheme_default();
|
|
14614
14908
|
const styles = BaseOrganizationSwitcher_styles_default(theme, colorScheme);
|
|
14615
|
-
const [isOpen, setIsOpen] =
|
|
14616
|
-
const [hoveredItemIndex, setHoveredItemIndex] =
|
|
14909
|
+
const [isOpen, setIsOpen] = useState29(false);
|
|
14910
|
+
const [hoveredItemIndex, setHoveredItemIndex] = useState29(null);
|
|
14617
14911
|
const { t } = useTranslation_default(preferences?.i18n);
|
|
14618
14912
|
const isRTL = direction === "rtl";
|
|
14619
14913
|
const { refs, floatingStyles, context } = useFloating3({
|
|
@@ -14643,8 +14937,8 @@ var BaseOrganizationSwitcher = ({
|
|
|
14643
14937
|
const switchableOrganizations = organizations.filter(
|
|
14644
14938
|
(org) => org.id !== currentOrganization?.id
|
|
14645
14939
|
);
|
|
14646
|
-
const defaultRenderOrganization2 = (organization, isSelected) => /* @__PURE__ */
|
|
14647
|
-
/* @__PURE__ */
|
|
14940
|
+
const defaultRenderOrganization2 = (organization, isSelected) => /* @__PURE__ */ jsxs45(Fragment21, { children: [
|
|
14941
|
+
/* @__PURE__ */ jsx105(
|
|
14648
14942
|
Avatar,
|
|
14649
14943
|
{
|
|
14650
14944
|
variant: "square",
|
|
@@ -14654,24 +14948,24 @@ var BaseOrganizationSwitcher = ({
|
|
|
14654
14948
|
alt: `${organization.name} avatar`
|
|
14655
14949
|
}
|
|
14656
14950
|
),
|
|
14657
|
-
/* @__PURE__ */
|
|
14658
|
-
/* @__PURE__ */
|
|
14659
|
-
/* @__PURE__ */
|
|
14660
|
-
showMemberCount && organization.memberCount !== void 0 && /* @__PURE__ */
|
|
14951
|
+
/* @__PURE__ */ jsxs45("div", { className: cx30(styles["organizationInfo"]), children: [
|
|
14952
|
+
/* @__PURE__ */ jsx105(Typography_default, { variant: "body2", fontWeight: "medium", className: cx30(styles["organizationName"]), children: organization.name }),
|
|
14953
|
+
/* @__PURE__ */ jsxs45("div", { className: cx30(styles["organizationMeta"]), children: [
|
|
14954
|
+
showMemberCount && organization.memberCount !== void 0 && /* @__PURE__ */ jsxs45("span", { children: [
|
|
14661
14955
|
organization.memberCount,
|
|
14662
14956
|
" ",
|
|
14663
14957
|
organization.memberCount === 1 ? t("organization.switcher.member") : t("organization.switcher.members")
|
|
14664
14958
|
] }),
|
|
14665
|
-
showRole && organization.role && showMemberCount && organization.memberCount !== void 0 && /* @__PURE__ */
|
|
14666
|
-
showRole && organization.role && /* @__PURE__ */
|
|
14959
|
+
showRole && organization.role && showMemberCount && organization.memberCount !== void 0 && /* @__PURE__ */ jsx105("span", { children: " \u2022 " }),
|
|
14960
|
+
showRole && organization.role && /* @__PURE__ */ jsx105("span", { className: cx30(styles["roleCapitalized"]), children: organization.role })
|
|
14667
14961
|
] })
|
|
14668
14962
|
] }),
|
|
14669
|
-
isSelected && /* @__PURE__ */
|
|
14963
|
+
isSelected && /* @__PURE__ */ jsx105(Check_default, { width: "16", height: "16", color: theme.vars.colors.text.primary })
|
|
14670
14964
|
] });
|
|
14671
|
-
const defaultRenderLoading2 = () => /* @__PURE__ */
|
|
14672
|
-
const defaultRenderError2 = (errorMessage) => /* @__PURE__ */
|
|
14673
|
-
return /* @__PURE__ */
|
|
14674
|
-
/* @__PURE__ */
|
|
14965
|
+
const defaultRenderLoading2 = () => /* @__PURE__ */ jsx105("div", { className: cx30(styles["loadingContainer"]), children: /* @__PURE__ */ jsx105(Typography_default, { variant: "caption", className: cx30(styles["loadingText"]), children: t("organization.switcher.loading.placeholder.organizations") }) });
|
|
14966
|
+
const defaultRenderError2 = (errorMessage) => /* @__PURE__ */ jsx105("div", { className: cx30(styles["errorContainer"]), children: /* @__PURE__ */ jsx105(Typography_default, { variant: "caption", className: cx30(styles["errorText"]), children: errorMessage }) });
|
|
14967
|
+
return /* @__PURE__ */ jsxs45("div", { className: cx30(styles["root"], className), style, children: [
|
|
14968
|
+
/* @__PURE__ */ jsxs45(
|
|
14675
14969
|
Button_default,
|
|
14676
14970
|
{
|
|
14677
14971
|
ref: refs.setReference,
|
|
@@ -14681,8 +14975,8 @@ var BaseOrganizationSwitcher = ({
|
|
|
14681
14975
|
size: "medium",
|
|
14682
14976
|
...getReferenceProps(),
|
|
14683
14977
|
children: [
|
|
14684
|
-
currentOrganization ? /* @__PURE__ */
|
|
14685
|
-
/* @__PURE__ */
|
|
14978
|
+
currentOrganization ? /* @__PURE__ */ jsxs45(Fragment21, { children: [
|
|
14979
|
+
/* @__PURE__ */ jsx105(
|
|
14686
14980
|
Avatar,
|
|
14687
14981
|
{
|
|
14688
14982
|
variant: "square",
|
|
@@ -14692,16 +14986,16 @@ var BaseOrganizationSwitcher = ({
|
|
|
14692
14986
|
alt: `${currentOrganization.name} avatar`
|
|
14693
14987
|
}
|
|
14694
14988
|
),
|
|
14695
|
-
showTriggerLabel && /* @__PURE__ */
|
|
14696
|
-
] }) : /* @__PURE__ */
|
|
14697
|
-
/* @__PURE__ */
|
|
14698
|
-
showTriggerLabel && /* @__PURE__ */
|
|
14989
|
+
showTriggerLabel && /* @__PURE__ */ jsx105(Typography_default, { variant: "body2", className: cx30(styles["triggerLabel"]), children: currentOrganization.name })
|
|
14990
|
+
] }) : /* @__PURE__ */ jsxs45(Fragment21, { children: [
|
|
14991
|
+
/* @__PURE__ */ jsx105(Building_default, { width: avatarSize, height: avatarSize }),
|
|
14992
|
+
showTriggerLabel && /* @__PURE__ */ jsx105(Typography_default, { variant: "body2", className: cx30(styles["triggerLabel"]), children: t("elements.fields.organization.select.label") })
|
|
14699
14993
|
] }),
|
|
14700
|
-
/* @__PURE__ */
|
|
14994
|
+
/* @__PURE__ */ jsx105("span", { style: { display: "inline-flex", transform: isRTL ? "scaleX(-1)" : "none" }, children: /* @__PURE__ */ jsx105(ChevronDown_default, { width: "16", height: "16" }) })
|
|
14701
14995
|
]
|
|
14702
14996
|
}
|
|
14703
14997
|
),
|
|
14704
|
-
isOpen && /* @__PURE__ */
|
|
14998
|
+
isOpen && /* @__PURE__ */ jsx105(FloatingPortal3, { id: portalId, children: /* @__PURE__ */ jsx105(FloatingFocusManager3, { context, modal: false, initialFocus: -1, children: /* @__PURE__ */ jsxs45(
|
|
14705
14999
|
"div",
|
|
14706
15000
|
{
|
|
14707
15001
|
ref: refs.setFloating,
|
|
@@ -14709,8 +15003,8 @@ var BaseOrganizationSwitcher = ({
|
|
|
14709
15003
|
style: floatingStyles,
|
|
14710
15004
|
...getFloatingProps(),
|
|
14711
15005
|
children: [
|
|
14712
|
-
currentOrganization && /* @__PURE__ */
|
|
14713
|
-
/* @__PURE__ */
|
|
15006
|
+
currentOrganization && /* @__PURE__ */ jsxs45("div", { className: cx30(styles["header"]), children: [
|
|
15007
|
+
/* @__PURE__ */ jsx105(
|
|
14714
15008
|
Avatar,
|
|
14715
15009
|
{
|
|
14716
15010
|
variant: "square",
|
|
@@ -14720,10 +15014,10 @@ var BaseOrganizationSwitcher = ({
|
|
|
14720
15014
|
alt: `${currentOrganization.name} avatar`
|
|
14721
15015
|
}
|
|
14722
15016
|
),
|
|
14723
|
-
/* @__PURE__ */
|
|
14724
|
-
/* @__PURE__ */
|
|
14725
|
-
/* @__PURE__ */
|
|
14726
|
-
showMemberCount && currentOrganization.memberCount !== void 0 && /* @__PURE__ */
|
|
15017
|
+
/* @__PURE__ */ jsxs45("div", { className: cx30(styles["headerInfo"]), children: [
|
|
15018
|
+
/* @__PURE__ */ jsx105(Typography_default, { noWrap: true, className: cx30(styles["headerName"]), variant: "body1", fontWeight: "medium", children: currentOrganization.name }),
|
|
15019
|
+
/* @__PURE__ */ jsxs45("div", { className: cx30(styles["headerMeta"]), children: [
|
|
15020
|
+
showMemberCount && currentOrganization.memberCount !== void 0 && /* @__PURE__ */ jsxs45(
|
|
14727
15021
|
Typography_default,
|
|
14728
15022
|
{
|
|
14729
15023
|
noWrap: true,
|
|
@@ -14733,17 +15027,17 @@ var BaseOrganizationSwitcher = ({
|
|
|
14733
15027
|
currentOrganization.memberCount,
|
|
14734
15028
|
" ",
|
|
14735
15029
|
currentOrganization.memberCount === 1 ? t("organization.switcher.member") : t("organization.switcher.members"),
|
|
14736
|
-
showRole && currentOrganization.role && /* @__PURE__ */
|
|
15030
|
+
showRole && currentOrganization.role && /* @__PURE__ */ jsxs45("span", { children: [
|
|
14737
15031
|
" \u2022 ",
|
|
14738
15032
|
currentOrganization.role
|
|
14739
15033
|
] })
|
|
14740
15034
|
]
|
|
14741
15035
|
}
|
|
14742
15036
|
),
|
|
14743
|
-
showRole && currentOrganization.role && (!showMemberCount || currentOrganization.memberCount === void 0) && /* @__PURE__ */
|
|
15037
|
+
showRole && currentOrganization.role && (!showMemberCount || currentOrganization.memberCount === void 0) && /* @__PURE__ */ jsx105(Typography_default, { noWrap: true, className: cx30(styles["headerRole"]), variant: "caption", color: "secondary", children: currentOrganization.role })
|
|
14744
15038
|
] })
|
|
14745
15039
|
] }),
|
|
14746
|
-
onManageProfile && /* @__PURE__ */
|
|
15040
|
+
onManageProfile && /* @__PURE__ */ jsx105(
|
|
14747
15041
|
Button_default,
|
|
14748
15042
|
{
|
|
14749
15043
|
onClick: onManageProfile,
|
|
@@ -14752,7 +15046,7 @@ var BaseOrganizationSwitcher = ({
|
|
|
14752
15046
|
size: "small",
|
|
14753
15047
|
"aria-label": "Manage Organization Profile",
|
|
14754
15048
|
className: cx30(styles["manageButton"]),
|
|
14755
|
-
endIcon: /* @__PURE__ */
|
|
15049
|
+
endIcon: /* @__PURE__ */ jsxs45(
|
|
14756
15050
|
"svg",
|
|
14757
15051
|
{
|
|
14758
15052
|
width: "16",
|
|
@@ -14764,8 +15058,8 @@ var BaseOrganizationSwitcher = ({
|
|
|
14764
15058
|
strokeLinecap: "round",
|
|
14765
15059
|
strokeLinejoin: "round",
|
|
14766
15060
|
children: [
|
|
14767
|
-
/* @__PURE__ */
|
|
14768
|
-
/* @__PURE__ */
|
|
15061
|
+
/* @__PURE__ */ jsx105("circle", { cx: "12", cy: "12", r: "3" }),
|
|
15062
|
+
/* @__PURE__ */ jsx105("path", { d: "M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1 1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z" })
|
|
14769
15063
|
]
|
|
14770
15064
|
}
|
|
14771
15065
|
),
|
|
@@ -14773,27 +15067,27 @@ var BaseOrganizationSwitcher = ({
|
|
|
14773
15067
|
}
|
|
14774
15068
|
)
|
|
14775
15069
|
] }),
|
|
14776
|
-
organizations.length > 1 && /* @__PURE__ */
|
|
15070
|
+
organizations.length > 1 && /* @__PURE__ */ jsx105(
|
|
14777
15071
|
"div",
|
|
14778
15072
|
{
|
|
14779
15073
|
className: cx30(styles["header"], styles["sectionHeaderContainer"]),
|
|
14780
15074
|
style: {
|
|
14781
15075
|
borderTop: currentOrganization ? `1px solid ${theme.vars.colors.border}` : "none"
|
|
14782
15076
|
},
|
|
14783
|
-
children: /* @__PURE__ */
|
|
15077
|
+
children: /* @__PURE__ */ jsx105(Typography_default, { variant: "caption", fontWeight: 600, className: cx30(styles["sectionHeader"]), children: t("organization.switcher.switch.organization") })
|
|
14784
15078
|
}
|
|
14785
15079
|
),
|
|
14786
|
-
/* @__PURE__ */
|
|
15080
|
+
/* @__PURE__ */ jsx105("div", { className: cx30(styles["menu"]), children: (() => {
|
|
14787
15081
|
if (loading) {
|
|
14788
15082
|
return renderLoading ? renderLoading() : defaultRenderLoading2();
|
|
14789
15083
|
}
|
|
14790
15084
|
if (error) {
|
|
14791
15085
|
return renderError ? renderError(error) : defaultRenderError2(error);
|
|
14792
15086
|
}
|
|
14793
|
-
return /* @__PURE__ */
|
|
15087
|
+
return /* @__PURE__ */ jsxs45(Fragment21, { children: [
|
|
14794
15088
|
switchableOrganizations.map((organization) => {
|
|
14795
15089
|
const isSelected = false;
|
|
14796
|
-
return /* @__PURE__ */
|
|
15090
|
+
return /* @__PURE__ */ jsx105(
|
|
14797
15091
|
Button_default,
|
|
14798
15092
|
{
|
|
14799
15093
|
onClick: () => handleOrganizationSwitch(organization),
|
|
@@ -14811,10 +15105,10 @@ var BaseOrganizationSwitcher = ({
|
|
|
14811
15105
|
organization.id
|
|
14812
15106
|
);
|
|
14813
15107
|
}),
|
|
14814
|
-
menuItems.length > 0 && /* @__PURE__ */
|
|
14815
|
-
/* @__PURE__ */
|
|
15108
|
+
menuItems.length > 0 && /* @__PURE__ */ jsxs45(Fragment21, { children: [
|
|
15109
|
+
/* @__PURE__ */ jsx105("div", { className: cx30(styles["menuDivider"]) }),
|
|
14816
15110
|
menuItems.map(
|
|
14817
|
-
(item, index) => /* @__PURE__ */
|
|
15111
|
+
(item, index) => /* @__PURE__ */ jsx105("div", { children: item.href ? /* @__PURE__ */ jsxs45(
|
|
14818
15112
|
"a",
|
|
14819
15113
|
{
|
|
14820
15114
|
href: item.href,
|
|
@@ -14828,10 +15122,10 @@ var BaseOrganizationSwitcher = ({
|
|
|
14828
15122
|
onBlur: () => setHoveredItemIndex(null),
|
|
14829
15123
|
children: [
|
|
14830
15124
|
item.icon,
|
|
14831
|
-
/* @__PURE__ */
|
|
15125
|
+
/* @__PURE__ */ jsx105("span", { children: item.label })
|
|
14832
15126
|
]
|
|
14833
15127
|
}
|
|
14834
|
-
) : /* @__PURE__ */
|
|
15128
|
+
) : /* @__PURE__ */ jsx105(
|
|
14835
15129
|
Button_default,
|
|
14836
15130
|
{
|
|
14837
15131
|
onClick: () => handleMenuItemClick(item),
|
|
@@ -14860,11 +15154,11 @@ var BaseOrganizationSwitcher = ({
|
|
|
14860
15154
|
var BaseOrganizationSwitcher_default = BaseOrganizationSwitcher;
|
|
14861
15155
|
|
|
14862
15156
|
// src/components/presentation/OrganizationSwitcher/OrganizationSwitcher.tsx
|
|
14863
|
-
import { useState as
|
|
15157
|
+
import { useState as useState36 } from "react";
|
|
14864
15158
|
|
|
14865
15159
|
// src/components/primitives/Icons/BuildingAlt.tsx
|
|
14866
|
-
import { jsx as
|
|
14867
|
-
var BuildingAlt = ({ height = 24, width = 24 }) => /* @__PURE__ */
|
|
15160
|
+
import { jsx as jsx106, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
15161
|
+
var BuildingAlt = ({ height = 24, width = 24 }) => /* @__PURE__ */ jsxs46(
|
|
14868
15162
|
"svg",
|
|
14869
15163
|
{
|
|
14870
15164
|
width,
|
|
@@ -14877,13 +15171,13 @@ var BuildingAlt = ({ height = 24, width = 24 }) => /* @__PURE__ */ jsxs45(
|
|
|
14877
15171
|
strokeLinecap: "round",
|
|
14878
15172
|
strokeLinejoin: "round",
|
|
14879
15173
|
children: [
|
|
14880
|
-
/* @__PURE__ */
|
|
14881
|
-
/* @__PURE__ */
|
|
14882
|
-
/* @__PURE__ */
|
|
14883
|
-
/* @__PURE__ */
|
|
14884
|
-
/* @__PURE__ */
|
|
14885
|
-
/* @__PURE__ */
|
|
14886
|
-
/* @__PURE__ */
|
|
15174
|
+
/* @__PURE__ */ jsx106("path", { d: "M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z" }),
|
|
15175
|
+
/* @__PURE__ */ jsx106("path", { d: "M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2" }),
|
|
15176
|
+
/* @__PURE__ */ jsx106("path", { d: "M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2" }),
|
|
15177
|
+
/* @__PURE__ */ jsx106("path", { d: "M10 6h4" }),
|
|
15178
|
+
/* @__PURE__ */ jsx106("path", { d: "M10 10h4" }),
|
|
15179
|
+
/* @__PURE__ */ jsx106("path", { d: "M10 14h4" }),
|
|
15180
|
+
/* @__PURE__ */ jsx106("path", { d: "M10 18h4" })
|
|
14887
15181
|
]
|
|
14888
15182
|
}
|
|
14889
15183
|
);
|
|
@@ -14891,12 +15185,12 @@ BuildingAlt.displayName = "BuildingAlt";
|
|
|
14891
15185
|
var BuildingAlt_default = BuildingAlt;
|
|
14892
15186
|
|
|
14893
15187
|
// src/components/presentation/CreateOrganization/CreateOrganization.tsx
|
|
14894
|
-
import { useState as
|
|
15188
|
+
import { useState as useState31 } from "react";
|
|
14895
15189
|
|
|
14896
15190
|
// src/components/presentation/CreateOrganization/BaseCreateOrganization.tsx
|
|
14897
15191
|
import { createPackageComponentLogger as createPackageComponentLogger8 } from "@asgardeo/browser";
|
|
14898
15192
|
import { cx as cx31 } from "@emotion/css";
|
|
14899
|
-
import { useState as
|
|
15193
|
+
import { useState as useState30 } from "react";
|
|
14900
15194
|
|
|
14901
15195
|
// src/components/presentation/CreateOrganization/BaseCreateOrganization.styles.ts
|
|
14902
15196
|
import { css as css27 } from "@emotion/css";
|
|
@@ -15037,7 +15331,7 @@ var useStyles26 = (theme, colorScheme) => useMemo37(() => {
|
|
|
15037
15331
|
var BaseCreateOrganization_styles_default = useStyles26;
|
|
15038
15332
|
|
|
15039
15333
|
// src/components/presentation/CreateOrganization/BaseCreateOrganization.tsx
|
|
15040
|
-
import { jsx as
|
|
15334
|
+
import { jsx as jsx107, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
15041
15335
|
var logger8 = createPackageComponentLogger8(
|
|
15042
15336
|
"@asgardeo/react",
|
|
15043
15337
|
"BaseCreateOrganization"
|
|
@@ -15064,13 +15358,13 @@ var BaseCreateOrganization = ({
|
|
|
15064
15358
|
const { theme, colorScheme } = useTheme_default();
|
|
15065
15359
|
const styles = BaseCreateOrganization_styles_default(theme, colorScheme);
|
|
15066
15360
|
const { t } = useTranslation_default(preferences?.i18n);
|
|
15067
|
-
const [formData, setFormData] =
|
|
15361
|
+
const [formData, setFormData] = useState30({
|
|
15068
15362
|
description: "",
|
|
15069
15363
|
handle: "",
|
|
15070
15364
|
name: "",
|
|
15071
15365
|
...initialValues
|
|
15072
15366
|
});
|
|
15073
|
-
const [formErrors, setFormErrors] =
|
|
15367
|
+
const [formErrors, setFormErrors] = useState30({});
|
|
15074
15368
|
const validateForm = () => {
|
|
15075
15369
|
const errors = {};
|
|
15076
15370
|
if (!formData.name.trim()) {
|
|
@@ -15127,13 +15421,13 @@ var BaseCreateOrganization = ({
|
|
|
15127
15421
|
logger8.error("Form submission error:");
|
|
15128
15422
|
}
|
|
15129
15423
|
};
|
|
15130
|
-
const createOrganizationContent = /* @__PURE__ */
|
|
15131
|
-
/* @__PURE__ */
|
|
15132
|
-
error && /* @__PURE__ */
|
|
15133
|
-
/* @__PURE__ */
|
|
15134
|
-
/* @__PURE__ */
|
|
15424
|
+
const createOrganizationContent = /* @__PURE__ */ jsx107("div", { className: cx31(styles["root"], cardLayout && styles["card"], className), style, children: /* @__PURE__ */ jsxs47("div", { className: cx31(styles["content"]), children: [
|
|
15425
|
+
/* @__PURE__ */ jsxs47("form", { id: "create-organization-form", className: cx31(styles["form"]), onSubmit: handleSubmit, children: [
|
|
15426
|
+
error && /* @__PURE__ */ jsxs47(Alert_default, { variant: "error", className: styles["errorAlert"], children: [
|
|
15427
|
+
/* @__PURE__ */ jsx107(Alert_default.Title, { children: "Error" }),
|
|
15428
|
+
/* @__PURE__ */ jsx107(Alert_default.Description, { children: error })
|
|
15135
15429
|
] }),
|
|
15136
|
-
/* @__PURE__ */
|
|
15430
|
+
/* @__PURE__ */ jsx107("div", { className: cx31(styles["fieldGroup"]), children: /* @__PURE__ */ jsx107(
|
|
15137
15431
|
TextField_default,
|
|
15138
15432
|
{
|
|
15139
15433
|
label: `${t("elements.fields.organization.name.label")}`,
|
|
@@ -15146,7 +15440,7 @@ var BaseCreateOrganization = ({
|
|
|
15146
15440
|
className: cx31(styles["input"])
|
|
15147
15441
|
}
|
|
15148
15442
|
) }),
|
|
15149
|
-
/* @__PURE__ */
|
|
15443
|
+
/* @__PURE__ */ jsx107("div", { className: cx31(styles["fieldGroup"]), children: /* @__PURE__ */ jsx107(
|
|
15150
15444
|
TextField_default,
|
|
15151
15445
|
{
|
|
15152
15446
|
label: `${t("elements.fields.organization.handle.label") || "Organization Handle"}`,
|
|
@@ -15160,9 +15454,9 @@ var BaseCreateOrganization = ({
|
|
|
15160
15454
|
className: cx31(styles["input"])
|
|
15161
15455
|
}
|
|
15162
15456
|
) }),
|
|
15163
|
-
/* @__PURE__ */
|
|
15164
|
-
/* @__PURE__ */
|
|
15165
|
-
/* @__PURE__ */
|
|
15457
|
+
/* @__PURE__ */ jsx107("div", { className: cx31(styles["fieldGroup"]), children: /* @__PURE__ */ jsxs47(FormControl_default, { error: formErrors.description, children: [
|
|
15458
|
+
/* @__PURE__ */ jsx107(InputLabel_default, { required: true, children: t("elements.fields.organization.description.label") }),
|
|
15459
|
+
/* @__PURE__ */ jsx107(
|
|
15166
15460
|
"textarea",
|
|
15167
15461
|
{
|
|
15168
15462
|
className: cx31(styles["textarea"], formErrors.description && styles["textareaError"]),
|
|
@@ -15176,15 +15470,15 @@ var BaseCreateOrganization = ({
|
|
|
15176
15470
|
] }) }),
|
|
15177
15471
|
renderAdditionalFields && renderAdditionalFields()
|
|
15178
15472
|
] }),
|
|
15179
|
-
/* @__PURE__ */
|
|
15180
|
-
onCancel && /* @__PURE__ */
|
|
15181
|
-
/* @__PURE__ */
|
|
15473
|
+
/* @__PURE__ */ jsxs47("div", { className: cx31(styles["actions"]), children: [
|
|
15474
|
+
onCancel && /* @__PURE__ */ jsx107(Button_default, { type: "button", variant: "outline", onClick: onCancel, disabled: loading, children: t("organization.create.buttons.cancel.text") }),
|
|
15475
|
+
/* @__PURE__ */ jsx107(Button_default, { type: "submit", variant: "solid", color: "primary", disabled: loading, form: "create-organization-form", children: loading ? t("organization.create.buttons.create_organization.loading.text") : t("organization.create.buttons.create_organization.text") })
|
|
15182
15476
|
] })
|
|
15183
15477
|
] }) });
|
|
15184
15478
|
if (mode === "popup") {
|
|
15185
|
-
return /* @__PURE__ */
|
|
15186
|
-
/* @__PURE__ */
|
|
15187
|
-
/* @__PURE__ */
|
|
15479
|
+
return /* @__PURE__ */ jsx107(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ jsxs47(Dialog_default.Content, { children: [
|
|
15480
|
+
/* @__PURE__ */ jsx107(Dialog_default.Heading, { children: title }),
|
|
15481
|
+
/* @__PURE__ */ jsx107("div", { className: styles["popup"], children: createOrganizationContent })
|
|
15188
15482
|
] }) });
|
|
15189
15483
|
}
|
|
15190
15484
|
return createOrganizationContent;
|
|
@@ -15225,7 +15519,7 @@ var createOrganization = async ({
|
|
|
15225
15519
|
var createOrganization_default = createOrganization;
|
|
15226
15520
|
|
|
15227
15521
|
// src/components/presentation/CreateOrganization/CreateOrganization.tsx
|
|
15228
|
-
import { Fragment as
|
|
15522
|
+
import { Fragment as Fragment22, jsx as jsx108 } from "react/jsx-runtime";
|
|
15229
15523
|
var CreateOrganization = ({
|
|
15230
15524
|
onCreateOrganization,
|
|
15231
15525
|
fallback = null,
|
|
@@ -15235,13 +15529,13 @@ var CreateOrganization = ({
|
|
|
15235
15529
|
}) => {
|
|
15236
15530
|
const { isSignedIn, baseUrl, instanceId } = useAsgardeo_default();
|
|
15237
15531
|
const { currentOrganization, revalidateMyOrganizations } = useOrganization_default();
|
|
15238
|
-
const [loading, setLoading] =
|
|
15239
|
-
const [error, setError] =
|
|
15532
|
+
const [loading, setLoading] = useState31(false);
|
|
15533
|
+
const [error, setError] = useState31(null);
|
|
15240
15534
|
if (!isSignedIn && fallback) {
|
|
15241
15535
|
return fallback;
|
|
15242
15536
|
}
|
|
15243
15537
|
if (!isSignedIn) {
|
|
15244
|
-
return /* @__PURE__ */
|
|
15538
|
+
return /* @__PURE__ */ jsx108(Fragment22, {});
|
|
15245
15539
|
}
|
|
15246
15540
|
const parentId = defaultParentId || currentOrganization?.id || "";
|
|
15247
15541
|
const handleSubmit = async (payload) => {
|
|
@@ -15276,7 +15570,7 @@ var CreateOrganization = ({
|
|
|
15276
15570
|
setLoading(false);
|
|
15277
15571
|
}
|
|
15278
15572
|
};
|
|
15279
|
-
return /* @__PURE__ */
|
|
15573
|
+
return /* @__PURE__ */ jsx108(
|
|
15280
15574
|
BaseCreateOrganization,
|
|
15281
15575
|
{
|
|
15282
15576
|
onSubmit: handleSubmit,
|
|
@@ -15291,7 +15585,7 @@ var CreateOrganization = ({
|
|
|
15291
15585
|
|
|
15292
15586
|
// src/components/presentation/OrganizationList/OrganizationList.tsx
|
|
15293
15587
|
import { cx as cx33 } from "@emotion/css";
|
|
15294
|
-
import { useEffect as
|
|
15588
|
+
import { useEffect as useEffect23, useState as useState32 } from "react";
|
|
15295
15589
|
|
|
15296
15590
|
// src/components/presentation/OrganizationList/BaseOrganizationList.tsx
|
|
15297
15591
|
import { cx as cx32 } from "@emotion/css";
|
|
@@ -15524,20 +15818,20 @@ var useStyles27 = (theme, colorScheme) => useMemo38(() => {
|
|
|
15524
15818
|
var BaseOrganizationList_styles_default = useStyles27;
|
|
15525
15819
|
|
|
15526
15820
|
// src/components/presentation/OrganizationList/BaseOrganizationList.tsx
|
|
15527
|
-
import { jsx as
|
|
15528
|
-
var defaultRenderOrganization = (organization, styles, t, onOrganizationSelect, showStatus) => /* @__PURE__ */
|
|
15529
|
-
/* @__PURE__ */
|
|
15530
|
-
/* @__PURE__ */
|
|
15531
|
-
/* @__PURE__ */
|
|
15532
|
-
/* @__PURE__ */
|
|
15533
|
-
/* @__PURE__ */
|
|
15821
|
+
import { jsx as jsx109, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
15822
|
+
var defaultRenderOrganization = (organization, styles, t, onOrganizationSelect, showStatus) => /* @__PURE__ */ jsxs48("div", { className: cx32(styles.organizationItem), children: [
|
|
15823
|
+
/* @__PURE__ */ jsxs48("div", { className: cx32(styles.organizationContent), children: [
|
|
15824
|
+
/* @__PURE__ */ jsx109(Avatar, { variant: "square", name: organization.name, size: 48, alt: `${organization.name} logo` }),
|
|
15825
|
+
/* @__PURE__ */ jsxs48("div", { className: cx32(styles.organizationInfo), children: [
|
|
15826
|
+
/* @__PURE__ */ jsx109(Typography_default, { variant: "h6", className: cx32(styles.organizationName), children: organization.name }),
|
|
15827
|
+
/* @__PURE__ */ jsxs48(Typography_default, { variant: "body2", color: "textSecondary", className: cx32(styles.organizationHandle), children: [
|
|
15534
15828
|
"@",
|
|
15535
15829
|
organization.orgHandle
|
|
15536
15830
|
] }),
|
|
15537
|
-
showStatus && /* @__PURE__ */
|
|
15831
|
+
showStatus && /* @__PURE__ */ jsxs48(Typography_default, { variant: "body2", color: "textSecondary", className: cx32(styles.organizationStatus), children: [
|
|
15538
15832
|
t("organization.switcher.status.label"),
|
|
15539
15833
|
" ",
|
|
15540
|
-
/* @__PURE__ */
|
|
15834
|
+
/* @__PURE__ */ jsx109(
|
|
15541
15835
|
"span",
|
|
15542
15836
|
{
|
|
15543
15837
|
className: cx32(
|
|
@@ -15550,7 +15844,7 @@ var defaultRenderOrganization = (organization, styles, t, onOrganizationSelect,
|
|
|
15550
15844
|
] })
|
|
15551
15845
|
] })
|
|
15552
15846
|
] }),
|
|
15553
|
-
organization.canSwitch && /* @__PURE__ */
|
|
15847
|
+
organization.canSwitch && /* @__PURE__ */ jsx109("div", { className: cx32(styles.organizationActions), children: /* @__PURE__ */ jsx109(
|
|
15554
15848
|
Button_default,
|
|
15555
15849
|
{
|
|
15556
15850
|
onClick: (e) => {
|
|
@@ -15563,17 +15857,17 @@ var defaultRenderOrganization = (organization, styles, t, onOrganizationSelect,
|
|
|
15563
15857
|
}
|
|
15564
15858
|
) })
|
|
15565
15859
|
] }, organization.id);
|
|
15566
|
-
var defaultRenderLoading = (t, styles) => /* @__PURE__ */
|
|
15567
|
-
/* @__PURE__ */
|
|
15568
|
-
/* @__PURE__ */
|
|
15860
|
+
var defaultRenderLoading = (t, styles) => /* @__PURE__ */ jsxs48("div", { className: cx32(styles.loadingContainer), children: [
|
|
15861
|
+
/* @__PURE__ */ jsx109(Spinner_default, { size: "medium" }),
|
|
15862
|
+
/* @__PURE__ */ jsx109(Typography_default, { variant: "body1", color: "textSecondary", className: cx32(styles.loadingText), children: t("organization.switcher.loading.placeholder.organizations") })
|
|
15569
15863
|
] });
|
|
15570
|
-
var defaultRenderError = (errorMessage, t, styles) => /* @__PURE__ */
|
|
15571
|
-
/* @__PURE__ */
|
|
15864
|
+
var defaultRenderError = (errorMessage, t, styles) => /* @__PURE__ */ jsx109("div", { className: cx32(styles.errorContainer), children: /* @__PURE__ */ jsxs48(Typography_default, { variant: "body1", color: "error", children: [
|
|
15865
|
+
/* @__PURE__ */ jsx109("strong", { children: t("organization.switcher.error.prefix") }),
|
|
15572
15866
|
" ",
|
|
15573
15867
|
errorMessage
|
|
15574
15868
|
] }) });
|
|
15575
|
-
var defaultRenderLoadMore = (onLoadMore, isLoadingMore, t, styles) => /* @__PURE__ */
|
|
15576
|
-
var defaultRenderEmpty = (t, styles) => /* @__PURE__ */
|
|
15869
|
+
var defaultRenderLoadMore = (onLoadMore, isLoadingMore, t, styles) => /* @__PURE__ */ jsx109(Button_default, { onClick: onLoadMore, disabled: isLoadingMore, className: cx32(styles.loadMoreButton), type: "button", fullWidth: true, children: isLoadingMore ? t("organization.switcher.loading.more") : t("organization.switcher.buttons.load_more.text") });
|
|
15870
|
+
var defaultRenderEmpty = (t, styles) => /* @__PURE__ */ jsx109("div", { className: cx32(styles.emptyContainer), children: /* @__PURE__ */ jsx109(Typography_default, { variant: "body1", color: "textSecondary", className: cx32(styles.emptyText), children: t("organization.switcher.no.organizations") }) });
|
|
15577
15871
|
var BaseOrganizationList = ({
|
|
15578
15872
|
className = "",
|
|
15579
15873
|
allOrganizations,
|
|
@@ -15617,42 +15911,42 @@ var BaseOrganizationList = ({
|
|
|
15617
15911
|
const renderLoadMoreWithStyles = renderLoadMore || ((onLoadMore, loadingMore) => defaultRenderLoadMore(onLoadMore, loadingMore, t, styles));
|
|
15618
15912
|
const renderOrganizationWithStyles = renderOrganization || ((org) => defaultRenderOrganization(org, styles, t, onOrganizationSelect, showStatus));
|
|
15619
15913
|
if (isLoading && organizationsWithSwitchAccess?.length === 0) {
|
|
15620
|
-
const loadingContent = /* @__PURE__ */
|
|
15914
|
+
const loadingContent = /* @__PURE__ */ jsx109("div", { className: cx32(styles["root"], className), style, children: renderLoadingWithStyles() });
|
|
15621
15915
|
if (mode === "popup") {
|
|
15622
|
-
return /* @__PURE__ */
|
|
15623
|
-
/* @__PURE__ */
|
|
15624
|
-
/* @__PURE__ */
|
|
15916
|
+
return /* @__PURE__ */ jsx109(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ jsxs48(Dialog_default.Content, { children: [
|
|
15917
|
+
/* @__PURE__ */ jsx109(Dialog_default.Heading, { children: title }),
|
|
15918
|
+
/* @__PURE__ */ jsx109("div", { className: cx32(styles["popupContent"]), children: loadingContent })
|
|
15625
15919
|
] }) });
|
|
15626
15920
|
}
|
|
15627
15921
|
return loadingContent;
|
|
15628
15922
|
}
|
|
15629
15923
|
if (error && organizationsWithSwitchAccess?.length === 0) {
|
|
15630
|
-
const errorContent = /* @__PURE__ */
|
|
15924
|
+
const errorContent = /* @__PURE__ */ jsx109("div", { className: cx32(styles["root"], className), style, children: renderErrorWithStyles(error) });
|
|
15631
15925
|
if (mode === "popup") {
|
|
15632
|
-
return /* @__PURE__ */
|
|
15633
|
-
/* @__PURE__ */
|
|
15634
|
-
/* @__PURE__ */
|
|
15926
|
+
return /* @__PURE__ */ jsx109(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ jsxs48(Dialog_default.Content, { children: [
|
|
15927
|
+
/* @__PURE__ */ jsx109(Dialog_default.Heading, { children: title }),
|
|
15928
|
+
/* @__PURE__ */ jsx109("div", { className: cx32(styles["popupContent"]), children: errorContent })
|
|
15635
15929
|
] }) });
|
|
15636
15930
|
}
|
|
15637
15931
|
return errorContent;
|
|
15638
15932
|
}
|
|
15639
15933
|
if (!isLoading && organizationsWithSwitchAccess?.length === 0) {
|
|
15640
|
-
const emptyContent = /* @__PURE__ */
|
|
15934
|
+
const emptyContent = /* @__PURE__ */ jsx109("div", { className: cx32(styles["root"], className), style, children: renderEmptyWithStyles() });
|
|
15641
15935
|
if (mode === "popup") {
|
|
15642
|
-
return /* @__PURE__ */
|
|
15643
|
-
/* @__PURE__ */
|
|
15644
|
-
/* @__PURE__ */
|
|
15936
|
+
return /* @__PURE__ */ jsx109(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ jsxs48(Dialog_default.Content, { children: [
|
|
15937
|
+
/* @__PURE__ */ jsx109(Dialog_default.Heading, { children: title }),
|
|
15938
|
+
/* @__PURE__ */ jsx109("div", { className: cx32(styles["popupContent"]), children: emptyContent })
|
|
15645
15939
|
] }) });
|
|
15646
15940
|
}
|
|
15647
15941
|
return emptyContent;
|
|
15648
15942
|
}
|
|
15649
|
-
const organizationListContent = /* @__PURE__ */
|
|
15650
|
-
/* @__PURE__ */
|
|
15651
|
-
/* @__PURE__ */
|
|
15943
|
+
const organizationListContent = /* @__PURE__ */ jsxs48("div", { className: cx32(styles["root"], className), style, children: [
|
|
15944
|
+
/* @__PURE__ */ jsxs48("div", { className: cx32(styles["header"]), children: [
|
|
15945
|
+
/* @__PURE__ */ jsx109("div", { className: cx32(styles["headerInfo"]), children: /* @__PURE__ */ jsx109(Typography_default, { variant: "body2", color: "textSecondary", className: cx32(styles["subtitle"]), children: t("organization.switcher.showing.count", {
|
|
15652
15946
|
showing: organizationsWithSwitchAccess?.length,
|
|
15653
15947
|
total: allOrganizations?.organizations?.length || 0
|
|
15654
15948
|
}) }) }),
|
|
15655
|
-
onRefresh && /* @__PURE__ */
|
|
15949
|
+
onRefresh && /* @__PURE__ */ jsx109(
|
|
15656
15950
|
Button_default,
|
|
15657
15951
|
{
|
|
15658
15952
|
onClick: onRefresh,
|
|
@@ -15664,16 +15958,16 @@ var BaseOrganizationList = ({
|
|
|
15664
15958
|
}
|
|
15665
15959
|
)
|
|
15666
15960
|
] }),
|
|
15667
|
-
/* @__PURE__ */
|
|
15961
|
+
/* @__PURE__ */ jsx109("div", { className: cx32(styles["listContainer"]), children: organizationsWithSwitchAccess?.map(
|
|
15668
15962
|
(organization, index) => renderOrganizationWithStyles(organization, index)
|
|
15669
15963
|
) }),
|
|
15670
|
-
error && organizationsWithSwitchAccess?.length > 0 && /* @__PURE__ */
|
|
15671
|
-
hasMore && fetchMore && /* @__PURE__ */
|
|
15964
|
+
error && organizationsWithSwitchAccess?.length > 0 && /* @__PURE__ */ jsx109("div", { className: cx32(styles["errorMargin"]), children: renderErrorWithStyles(error) }),
|
|
15965
|
+
hasMore && fetchMore && /* @__PURE__ */ jsx109("div", { className: cx32(styles["loadMoreMargin"]), children: renderLoadMoreWithStyles(fetchMore, isLoadingMore) })
|
|
15672
15966
|
] });
|
|
15673
15967
|
if (mode === "popup") {
|
|
15674
|
-
return /* @__PURE__ */
|
|
15675
|
-
/* @__PURE__ */
|
|
15676
|
-
/* @__PURE__ */
|
|
15968
|
+
return /* @__PURE__ */ jsx109(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ jsxs48(Dialog_default.Content, { children: [
|
|
15969
|
+
/* @__PURE__ */ jsx109(Dialog_default.Heading, { children: title }),
|
|
15970
|
+
/* @__PURE__ */ jsx109("div", { className: cx32(styles["popupContent"]), children: organizationListContent })
|
|
15677
15971
|
] }) });
|
|
15678
15972
|
}
|
|
15679
15973
|
return organizationListContent;
|
|
@@ -15743,22 +16037,22 @@ var useStyles28 = (theme, colorScheme) => useMemo40(() => {
|
|
|
15743
16037
|
var OrganizationList_styles_default = useStyles28;
|
|
15744
16038
|
|
|
15745
16039
|
// src/components/presentation/OrganizationList/OrganizationList.tsx
|
|
15746
|
-
import { jsx as
|
|
16040
|
+
import { jsx as jsx110 } from "react/jsx-runtime";
|
|
15747
16041
|
var OrganizationList = (props) => {
|
|
15748
16042
|
const { onOrganizationSelect, className = "", style, ...baseProps } = props;
|
|
15749
16043
|
const { autoFetch, filter, limit, recursive, ...filteredBaseProps } = baseProps;
|
|
15750
16044
|
const { theme, colorScheme } = useTheme_default();
|
|
15751
16045
|
const styles = OrganizationList_styles_default(theme, colorScheme);
|
|
15752
16046
|
const { getAllOrganizations: getAllOrganizations2, error, isLoading, myOrganizations } = useOrganization_default();
|
|
15753
|
-
const [allOrganizations, setAllOrganizations] =
|
|
16047
|
+
const [allOrganizations, setAllOrganizations] = useState32({
|
|
15754
16048
|
organizations: []
|
|
15755
16049
|
});
|
|
15756
|
-
|
|
16050
|
+
useEffect23(() => {
|
|
15757
16051
|
(async () => {
|
|
15758
16052
|
setAllOrganizations(await getAllOrganizations2());
|
|
15759
16053
|
})();
|
|
15760
16054
|
}, []);
|
|
15761
|
-
return /* @__PURE__ */
|
|
16055
|
+
return /* @__PURE__ */ jsx110("div", { className: cx33(styles["root"], className), style, children: /* @__PURE__ */ jsx110("div", { className: cx33(styles["container"]), children: /* @__PURE__ */ jsx110(
|
|
15762
16056
|
BaseOrganizationList,
|
|
15763
16057
|
{
|
|
15764
16058
|
allOrganizations,
|
|
@@ -15774,12 +16068,12 @@ var OrganizationList_default = OrganizationList;
|
|
|
15774
16068
|
|
|
15775
16069
|
// src/components/presentation/OrganizationProfile/OrganizationProfile.tsx
|
|
15776
16070
|
import { createPackageComponentLogger as createPackageComponentLogger9 } from "@asgardeo/browser";
|
|
15777
|
-
import { useEffect as
|
|
16071
|
+
import { useEffect as useEffect24, useState as useState35 } from "react";
|
|
15778
16072
|
|
|
15779
16073
|
// src/components/presentation/OrganizationProfile/BaseOrganizationProfile.tsx
|
|
15780
16074
|
import { formatDate } from "@asgardeo/browser";
|
|
15781
16075
|
import { cx as cx35 } from "@emotion/css";
|
|
15782
|
-
import { useState as
|
|
16076
|
+
import { useState as useState34, useCallback as useCallback19 } from "react";
|
|
15783
16077
|
|
|
15784
16078
|
// src/components/presentation/OrganizationProfile/BaseOrganizationProfile.styles.ts
|
|
15785
16079
|
import { css as css30 } from "@emotion/css";
|
|
@@ -15940,7 +16234,7 @@ var BaseOrganizationProfile_styles_default = useStyles29;
|
|
|
15940
16234
|
// src/components/primitives/KeyValueInput/KeyValueInput.tsx
|
|
15941
16235
|
import { withVendorCSSClassPrefix as withVendorCSSClassPrefix29, bem as bem20 } from "@asgardeo/browser";
|
|
15942
16236
|
import { cx as cx34 } from "@emotion/css";
|
|
15943
|
-
import { useState as
|
|
16237
|
+
import { useState as useState33, useCallback as useCallback18 } from "react";
|
|
15944
16238
|
|
|
15945
16239
|
// src/components/primitives/KeyValueInput/KeyValueInput.styles.ts
|
|
15946
16240
|
import { css as css31 } from "@emotion/css";
|
|
@@ -16097,7 +16391,7 @@ var useStyles30 = (theme, colorScheme, disabled, readOnly, hasError) => useMemo4
|
|
|
16097
16391
|
var KeyValueInput_styles_default = useStyles30;
|
|
16098
16392
|
|
|
16099
16393
|
// src/components/primitives/KeyValueInput/KeyValueInput.tsx
|
|
16100
|
-
import { jsx as
|
|
16394
|
+
import { jsx as jsx111, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
16101
16395
|
var KeyValueInput = ({
|
|
16102
16396
|
className = "",
|
|
16103
16397
|
disabled = false,
|
|
@@ -16120,9 +16414,9 @@ var KeyValueInput = ({
|
|
|
16120
16414
|
const { theme, colorScheme } = useTheme_default();
|
|
16121
16415
|
const styles = KeyValueInput_styles_default(theme, colorScheme, disabled, readOnly, !!error);
|
|
16122
16416
|
const initialPairs = Array.isArray(value) ? value : Object.entries(value).map(([key, val]) => ({ key, value: String(val) }));
|
|
16123
|
-
const [pairs, setPairs] =
|
|
16124
|
-
const [newKey, setNewKey] =
|
|
16125
|
-
const [newValue, setNewValue] =
|
|
16417
|
+
const [pairs, setPairs] = useState33(initialPairs);
|
|
16418
|
+
const [newKey, setNewKey] = useState33("");
|
|
16419
|
+
const [newValue, setNewValue] = useState33("");
|
|
16126
16420
|
const handleAddPair = useCallback18(() => {
|
|
16127
16421
|
if (!newKey.trim() || !newValue.trim()) return;
|
|
16128
16422
|
if (maxPairs && pairs.length >= maxPairs) return;
|
|
@@ -16174,18 +16468,18 @@ var KeyValueInput = ({
|
|
|
16174
16468
|
const isAddDisabled = disabled || readOnly || !canAddMore || !newKey.trim() || !newValue.trim();
|
|
16175
16469
|
const renderReadOnlyContent = () => {
|
|
16176
16470
|
if (pairs.length === 0) {
|
|
16177
|
-
return /* @__PURE__ */
|
|
16471
|
+
return /* @__PURE__ */ jsx111("div", { className: cx34(withVendorCSSClassPrefix29(bem20("key-value-input", "empty-state")), styles["emptyState"]), children: "No attributes defined" });
|
|
16178
16472
|
}
|
|
16179
|
-
return pairs.map((pair, index) => /* @__PURE__ */
|
|
16473
|
+
return pairs.map((pair, index) => /* @__PURE__ */ jsxs49(
|
|
16180
16474
|
"div",
|
|
16181
16475
|
{
|
|
16182
16476
|
className: cx34(withVendorCSSClassPrefix29(bem20("key-value-input", "readonly-pair")), styles["readOnlyPair"]),
|
|
16183
16477
|
children: [
|
|
16184
|
-
/* @__PURE__ */
|
|
16478
|
+
/* @__PURE__ */ jsxs49("span", { className: cx34(withVendorCSSClassPrefix29(bem20("key-value-input", "readonly-key")), styles["readOnlyKey"]), children: [
|
|
16185
16479
|
pair.key,
|
|
16186
16480
|
":"
|
|
16187
16481
|
] }),
|
|
16188
|
-
/* @__PURE__ */
|
|
16482
|
+
/* @__PURE__ */ jsx111(
|
|
16189
16483
|
"span",
|
|
16190
16484
|
{
|
|
16191
16485
|
className: cx34(withVendorCSSClassPrefix29(bem20("key-value-input", "readonly-value")), styles["readOnlyValue"]),
|
|
@@ -16197,10 +16491,10 @@ var KeyValueInput = ({
|
|
|
16197
16491
|
`${pair.key}-${index}`
|
|
16198
16492
|
));
|
|
16199
16493
|
};
|
|
16200
|
-
return /* @__PURE__ */
|
|
16201
|
-
label && /* @__PURE__ */
|
|
16494
|
+
return /* @__PURE__ */ jsxs49("div", { className: cx34(withVendorCSSClassPrefix29(bem20("key-value-input")), styles["container"], className), children: [
|
|
16495
|
+
label && /* @__PURE__ */ jsxs49("label", { className: cx34(withVendorCSSClassPrefix29(bem20("key-value-input", "label")), styles["label"]), children: [
|
|
16202
16496
|
label,
|
|
16203
|
-
required && /* @__PURE__ */
|
|
16497
|
+
required && /* @__PURE__ */ jsx111(
|
|
16204
16498
|
"span",
|
|
16205
16499
|
{
|
|
16206
16500
|
className: cx34(withVendorCSSClassPrefix29(bem20("key-value-input", "required")), styles["requiredIndicator"]),
|
|
@@ -16208,13 +16502,13 @@ var KeyValueInput = ({
|
|
|
16208
16502
|
}
|
|
16209
16503
|
)
|
|
16210
16504
|
] }),
|
|
16211
|
-
/* @__PURE__ */
|
|
16212
|
-
readOnly ? renderReadOnlyContent() : pairs.map((pair, index) => /* @__PURE__ */
|
|
16505
|
+
/* @__PURE__ */ jsxs49("div", { className: cx34(withVendorCSSClassPrefix29(bem20("key-value-input", "pairs-list")), styles["pairsList"]), children: [
|
|
16506
|
+
readOnly ? renderReadOnlyContent() : pairs.map((pair, index) => /* @__PURE__ */ jsxs49(
|
|
16213
16507
|
"div",
|
|
16214
16508
|
{
|
|
16215
16509
|
className: cx34(withVendorCSSClassPrefix29(bem20("key-value-input", "pair-row")), styles["pairRow"]),
|
|
16216
16510
|
children: [
|
|
16217
|
-
/* @__PURE__ */
|
|
16511
|
+
/* @__PURE__ */ jsx111(
|
|
16218
16512
|
TextField_default,
|
|
16219
16513
|
{
|
|
16220
16514
|
placeholder: keyPlaceholder,
|
|
@@ -16225,7 +16519,7 @@ var KeyValueInput = ({
|
|
|
16225
16519
|
"aria-label": `${keyLabel} ${index + 1}`
|
|
16226
16520
|
}
|
|
16227
16521
|
),
|
|
16228
|
-
/* @__PURE__ */
|
|
16522
|
+
/* @__PURE__ */ jsx111(
|
|
16229
16523
|
TextField_default,
|
|
16230
16524
|
{
|
|
16231
16525
|
placeholder: valuePlaceholder,
|
|
@@ -16236,7 +16530,7 @@ var KeyValueInput = ({
|
|
|
16236
16530
|
"aria-label": `${valueLabel} ${index + 1}`
|
|
16237
16531
|
}
|
|
16238
16532
|
),
|
|
16239
|
-
!readOnly && /* @__PURE__ */
|
|
16533
|
+
!readOnly && /* @__PURE__ */ jsx111(
|
|
16240
16534
|
"button",
|
|
16241
16535
|
{
|
|
16242
16536
|
type: "button",
|
|
@@ -16247,15 +16541,15 @@ var KeyValueInput = ({
|
|
|
16247
16541
|
styles["removeButton"]
|
|
16248
16542
|
),
|
|
16249
16543
|
"aria-label": `${removeButtonText} ${pair.key}`,
|
|
16250
|
-
children: /* @__PURE__ */
|
|
16544
|
+
children: /* @__PURE__ */ jsx111(X_default, { width: 16, height: 16 })
|
|
16251
16545
|
}
|
|
16252
16546
|
)
|
|
16253
16547
|
]
|
|
16254
16548
|
},
|
|
16255
16549
|
`${pair.key}-${index}`
|
|
16256
16550
|
)),
|
|
16257
|
-
!readOnly && /* @__PURE__ */
|
|
16258
|
-
/* @__PURE__ */
|
|
16551
|
+
!readOnly && /* @__PURE__ */ jsxs49("div", { className: cx34(withVendorCSSClassPrefix29(bem20("key-value-input", "add-row")), styles["addRow"]), children: [
|
|
16552
|
+
/* @__PURE__ */ jsx111(
|
|
16259
16553
|
TextField_default,
|
|
16260
16554
|
{
|
|
16261
16555
|
placeholder: keyPlaceholder,
|
|
@@ -16266,7 +16560,7 @@ var KeyValueInput = ({
|
|
|
16266
16560
|
"aria-label": "New key"
|
|
16267
16561
|
}
|
|
16268
16562
|
),
|
|
16269
|
-
/* @__PURE__ */
|
|
16563
|
+
/* @__PURE__ */ jsx111(
|
|
16270
16564
|
TextField_default,
|
|
16271
16565
|
{
|
|
16272
16566
|
placeholder: valuePlaceholder,
|
|
@@ -16282,7 +16576,7 @@ var KeyValueInput = ({
|
|
|
16282
16576
|
}
|
|
16283
16577
|
}
|
|
16284
16578
|
),
|
|
16285
|
-
/* @__PURE__ */
|
|
16579
|
+
/* @__PURE__ */ jsx111(
|
|
16286
16580
|
"button",
|
|
16287
16581
|
{
|
|
16288
16582
|
type: "button",
|
|
@@ -16290,13 +16584,13 @@ var KeyValueInput = ({
|
|
|
16290
16584
|
disabled: isAddDisabled,
|
|
16291
16585
|
className: cx34(withVendorCSSClassPrefix29(bem20("key-value-input", "add-button")), styles["addButton"]),
|
|
16292
16586
|
"aria-label": "Add new key-value pair",
|
|
16293
|
-
children: /* @__PURE__ */
|
|
16587
|
+
children: /* @__PURE__ */ jsx111(Plus_default, { width: 16, height: 16 })
|
|
16294
16588
|
}
|
|
16295
16589
|
)
|
|
16296
16590
|
] })
|
|
16297
16591
|
] }),
|
|
16298
|
-
(helperText || error) && /* @__PURE__ */
|
|
16299
|
-
maxPairs && /* @__PURE__ */
|
|
16592
|
+
(helperText || error) && /* @__PURE__ */ jsx111("div", { className: cx34(withVendorCSSClassPrefix29(bem20("key-value-input", "helper-text")), styles["helperText"]), children: error || helperText }),
|
|
16593
|
+
maxPairs && /* @__PURE__ */ jsxs49("div", { className: cx34(withVendorCSSClassPrefix29(bem20("key-value-input", "counter")), styles["counterText"]), children: [
|
|
16300
16594
|
pairs.length,
|
|
16301
16595
|
" of ",
|
|
16302
16596
|
maxPairs,
|
|
@@ -16307,7 +16601,7 @@ var KeyValueInput = ({
|
|
|
16307
16601
|
var KeyValueInput_default = KeyValueInput;
|
|
16308
16602
|
|
|
16309
16603
|
// src/components/presentation/OrganizationProfile/BaseOrganizationProfile.tsx
|
|
16310
|
-
import { Fragment as
|
|
16604
|
+
import { Fragment as Fragment23, jsx as jsx112, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
16311
16605
|
var BaseOrganizationProfile = ({
|
|
16312
16606
|
fallback = null,
|
|
16313
16607
|
className = "",
|
|
@@ -16354,9 +16648,9 @@ var BaseOrganizationProfile = ({
|
|
|
16354
16648
|
}) => {
|
|
16355
16649
|
const { theme, colorScheme } = useTheme_default();
|
|
16356
16650
|
const styles = BaseOrganizationProfile_styles_default(theme, colorScheme);
|
|
16357
|
-
const [editedOrganization, setEditedOrganization] =
|
|
16358
|
-
const [editingFields, setEditingFields] =
|
|
16359
|
-
const PencilIcon = () => /* @__PURE__ */
|
|
16651
|
+
const [editedOrganization, setEditedOrganization] = useState34(organization);
|
|
16652
|
+
const [editingFields, setEditingFields] = useState34({});
|
|
16653
|
+
const PencilIcon = () => /* @__PURE__ */ jsx112(
|
|
16360
16654
|
"svg",
|
|
16361
16655
|
{
|
|
16362
16656
|
width: "16",
|
|
@@ -16367,7 +16661,7 @@ var BaseOrganizationProfile = ({
|
|
|
16367
16661
|
strokeWidth: "2",
|
|
16368
16662
|
strokeLinecap: "round",
|
|
16369
16663
|
strokeLinejoin: "round",
|
|
16370
|
-
children: /* @__PURE__ */
|
|
16664
|
+
children: /* @__PURE__ */ jsx112("path", { d: "M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z" })
|
|
16371
16665
|
}
|
|
16372
16666
|
);
|
|
16373
16667
|
const toggleFieldEdit = useCallback19((fieldName) => {
|
|
@@ -16437,7 +16731,7 @@ var BaseOrganizationProfile = ({
|
|
|
16437
16731
|
let fieldInput;
|
|
16438
16732
|
if (key === "attributes") {
|
|
16439
16733
|
const attributesValue = typeof fieldValue === "object" && fieldValue !== null ? fieldValue : {};
|
|
16440
|
-
fieldInput = /* @__PURE__ */
|
|
16734
|
+
fieldInput = /* @__PURE__ */ jsx112(
|
|
16441
16735
|
KeyValueInput_default,
|
|
16442
16736
|
{
|
|
16443
16737
|
value: attributesValue,
|
|
@@ -16475,26 +16769,26 @@ var BaseOrganizationProfile = ({
|
|
|
16475
16769
|
}
|
|
16476
16770
|
);
|
|
16477
16771
|
} else {
|
|
16478
|
-
fieldInput = /* @__PURE__ */
|
|
16772
|
+
fieldInput = /* @__PURE__ */ jsx112(TextField_default, { ...commonProps });
|
|
16479
16773
|
}
|
|
16480
|
-
return /* @__PURE__ */
|
|
16481
|
-
/* @__PURE__ */
|
|
16482
|
-
/* @__PURE__ */
|
|
16774
|
+
return /* @__PURE__ */ jsxs50(Fragment23, { children: [
|
|
16775
|
+
/* @__PURE__ */ jsx112("span", { className: cx35(styles["label"]), children: label }),
|
|
16776
|
+
/* @__PURE__ */ jsx112("div", { className: cx35(styles["value"]), children: fieldInput })
|
|
16483
16777
|
] });
|
|
16484
16778
|
}
|
|
16485
16779
|
const hasValue = value !== void 0 && value !== null && value !== "";
|
|
16486
16780
|
const isFieldEditable = editable && fieldEditable;
|
|
16487
16781
|
let displayValue;
|
|
16488
16782
|
if (hasValue) {
|
|
16489
|
-
displayValue = key === "attributes" && typeof value === "object" && value !== null ? /* @__PURE__ */
|
|
16783
|
+
displayValue = key === "attributes" && typeof value === "object" && value !== null ? /* @__PURE__ */ jsx112(KeyValueInput_default, { value, readOnly: true, label: "" }) : String(renderedValue);
|
|
16490
16784
|
} else if (isFieldEditable) {
|
|
16491
16785
|
displayValue = getFieldPlaceholder(key);
|
|
16492
16786
|
} else {
|
|
16493
16787
|
displayValue = "-";
|
|
16494
16788
|
}
|
|
16495
|
-
return /* @__PURE__ */
|
|
16496
|
-
/* @__PURE__ */
|
|
16497
|
-
/* @__PURE__ */
|
|
16789
|
+
return /* @__PURE__ */ jsxs50(Fragment23, { children: [
|
|
16790
|
+
/* @__PURE__ */ jsx112("span", { className: cx35(styles["label"]), children: label }),
|
|
16791
|
+
/* @__PURE__ */ jsx112("div", { className: cx35(styles["value"], !hasValue && styles["valueEmpty"]), children: !hasValue && isFieldEditable && onStartEdit ? /* @__PURE__ */ jsx112(
|
|
16498
16792
|
Button_default,
|
|
16499
16793
|
{
|
|
16500
16794
|
onClick: onStartEdit,
|
|
@@ -16517,8 +16811,8 @@ var BaseOrganizationProfile = ({
|
|
|
16517
16811
|
if (!shouldShow) {
|
|
16518
16812
|
return null;
|
|
16519
16813
|
}
|
|
16520
|
-
return /* @__PURE__ */
|
|
16521
|
-
/* @__PURE__ */
|
|
16814
|
+
return /* @__PURE__ */ jsxs50("div", { className: cx35(styles["field"]), children: [
|
|
16815
|
+
/* @__PURE__ */ jsx112("div", { className: cx35(styles["fieldContent"]), children: renderField(
|
|
16522
16816
|
field,
|
|
16523
16817
|
isFieldEditing,
|
|
16524
16818
|
(value) => {
|
|
@@ -16528,8 +16822,8 @@ var BaseOrganizationProfile = ({
|
|
|
16528
16822
|
},
|
|
16529
16823
|
() => toggleFieldEdit(field.key)
|
|
16530
16824
|
) }),
|
|
16531
|
-
isFieldEditable && /* @__PURE__ */
|
|
16532
|
-
/* @__PURE__ */
|
|
16825
|
+
isFieldEditable && /* @__PURE__ */ jsx112("div", { className: cx35(styles["fieldActions"]), children: isFieldEditing ? /* @__PURE__ */ jsxs50(Fragment23, { children: [
|
|
16826
|
+
/* @__PURE__ */ jsx112(
|
|
16533
16827
|
Button_default,
|
|
16534
16828
|
{
|
|
16535
16829
|
onClick: () => handleFieldSave(field.key),
|
|
@@ -16540,7 +16834,7 @@ var BaseOrganizationProfile = ({
|
|
|
16540
16834
|
children: saveButtonText
|
|
16541
16835
|
}
|
|
16542
16836
|
),
|
|
16543
|
-
/* @__PURE__ */
|
|
16837
|
+
/* @__PURE__ */ jsx112(
|
|
16544
16838
|
Button_default,
|
|
16545
16839
|
{
|
|
16546
16840
|
onClick: () => handleFieldCancel(field.key),
|
|
@@ -16551,7 +16845,7 @@ var BaseOrganizationProfile = ({
|
|
|
16551
16845
|
children: cancelButtonText
|
|
16552
16846
|
}
|
|
16553
16847
|
)
|
|
16554
|
-
] }) : hasValue && /* @__PURE__ */
|
|
16848
|
+
] }) : hasValue && /* @__PURE__ */ jsx112(
|
|
16555
16849
|
Button_default,
|
|
16556
16850
|
{
|
|
16557
16851
|
onClick: () => toggleFieldEdit(field.key),
|
|
@@ -16560,7 +16854,7 @@ var BaseOrganizationProfile = ({
|
|
|
16560
16854
|
size: "small",
|
|
16561
16855
|
title: "Edit field",
|
|
16562
16856
|
className: cx35(styles["editButton"]),
|
|
16563
|
-
children: /* @__PURE__ */
|
|
16857
|
+
children: /* @__PURE__ */ jsx112(PencilIcon, {})
|
|
16564
16858
|
}
|
|
16565
16859
|
) })
|
|
16566
16860
|
] }, field.key);
|
|
@@ -16568,23 +16862,23 @@ var BaseOrganizationProfile = ({
|
|
|
16568
16862
|
if (!organization) {
|
|
16569
16863
|
return fallback;
|
|
16570
16864
|
}
|
|
16571
|
-
const profileContent = /* @__PURE__ */
|
|
16572
|
-
/* @__PURE__ */
|
|
16573
|
-
/* @__PURE__ */
|
|
16574
|
-
/* @__PURE__ */
|
|
16575
|
-
/* @__PURE__ */
|
|
16576
|
-
organization.orgHandle && /* @__PURE__ */
|
|
16865
|
+
const profileContent = /* @__PURE__ */ jsxs50(Card_default, { className: cx35(styles["root"], cardLayout && styles["card"], className), children: [
|
|
16866
|
+
/* @__PURE__ */ jsxs50("div", { className: cx35(styles["header"]), children: [
|
|
16867
|
+
/* @__PURE__ */ jsx112(Avatar, { name: getOrgInitials(organization.name), size: 80, alt: `${organization.name} logo` }),
|
|
16868
|
+
/* @__PURE__ */ jsxs50("div", { className: cx35(styles["orgInfo"]), children: [
|
|
16869
|
+
/* @__PURE__ */ jsx112("h2", { className: cx35(styles["name"]), children: organization.name }),
|
|
16870
|
+
organization.orgHandle && /* @__PURE__ */ jsxs50("p", { className: cx35(styles["handle"]), children: [
|
|
16577
16871
|
"@",
|
|
16578
16872
|
organization.orgHandle
|
|
16579
16873
|
] })
|
|
16580
16874
|
] })
|
|
16581
16875
|
] }),
|
|
16582
|
-
/* @__PURE__ */
|
|
16876
|
+
/* @__PURE__ */ jsx112("div", { className: cx35(styles["infoContainer"]), children: fields.map((field) => renderOrganizationField(field)) })
|
|
16583
16877
|
] });
|
|
16584
16878
|
if (mode === "popup") {
|
|
16585
|
-
return /* @__PURE__ */
|
|
16586
|
-
/* @__PURE__ */
|
|
16587
|
-
/* @__PURE__ */
|
|
16879
|
+
return /* @__PURE__ */ jsx112(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ jsxs50(Dialog_default.Content, { children: [
|
|
16880
|
+
/* @__PURE__ */ jsx112(Dialog_default.Heading, { children: title }),
|
|
16881
|
+
/* @__PURE__ */ jsx112("div", { className: cx35(styles["popup"]), children: profileContent })
|
|
16588
16882
|
] }) });
|
|
16589
16883
|
}
|
|
16590
16884
|
return profileContent;
|
|
@@ -16660,7 +16954,7 @@ var updateOrganization = async ({
|
|
|
16660
16954
|
var updateOrganization_default = updateOrganization;
|
|
16661
16955
|
|
|
16662
16956
|
// src/components/presentation/OrganizationProfile/OrganizationProfile.tsx
|
|
16663
|
-
import { jsx as
|
|
16957
|
+
import { jsx as jsx113 } from "react/jsx-runtime";
|
|
16664
16958
|
var logger9 = createPackageComponentLogger9(
|
|
16665
16959
|
"@asgardeo/react",
|
|
16666
16960
|
"OrganizationProfile"
|
|
@@ -16679,7 +16973,7 @@ var OrganizationProfile = ({
|
|
|
16679
16973
|
}) => {
|
|
16680
16974
|
const { baseUrl, instanceId } = useAsgardeo_default();
|
|
16681
16975
|
const { t } = useTranslation_default(preferences?.i18n);
|
|
16682
|
-
const [organization, setOrganization] =
|
|
16976
|
+
const [organization, setOrganization] = useState35(null);
|
|
16683
16977
|
const fetchOrganization = async () => {
|
|
16684
16978
|
if (!baseUrl || !organizationId) {
|
|
16685
16979
|
return;
|
|
@@ -16696,7 +16990,7 @@ var OrganizationProfile = ({
|
|
|
16696
16990
|
setOrganization(null);
|
|
16697
16991
|
}
|
|
16698
16992
|
};
|
|
16699
|
-
|
|
16993
|
+
useEffect24(() => {
|
|
16700
16994
|
fetchOrganization();
|
|
16701
16995
|
}, [baseUrl, organizationId]);
|
|
16702
16996
|
const handleOrganizationUpdate = async (payload) => {
|
|
@@ -16718,7 +17012,7 @@ var OrganizationProfile = ({
|
|
|
16718
17012
|
throw err;
|
|
16719
17013
|
}
|
|
16720
17014
|
};
|
|
16721
|
-
return /* @__PURE__ */
|
|
17015
|
+
return /* @__PURE__ */ jsx113(
|
|
16722
17016
|
BaseOrganizationProfile_default,
|
|
16723
17017
|
{
|
|
16724
17018
|
organization,
|
|
@@ -16735,7 +17029,7 @@ var OrganizationProfile = ({
|
|
|
16735
17029
|
var OrganizationProfile_default = OrganizationProfile;
|
|
16736
17030
|
|
|
16737
17031
|
// src/components/presentation/OrganizationSwitcher/OrganizationSwitcher.tsx
|
|
16738
|
-
import { Fragment as
|
|
17032
|
+
import { Fragment as Fragment24, jsx as jsx114, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
16739
17033
|
var OrganizationSwitcher = ({
|
|
16740
17034
|
currentOrganization: propCurrentOrganization,
|
|
16741
17035
|
fallback = null,
|
|
@@ -16752,15 +17046,15 @@ var OrganizationSwitcher = ({
|
|
|
16752
17046
|
isLoading,
|
|
16753
17047
|
error
|
|
16754
17048
|
} = useOrganization_default();
|
|
16755
|
-
const [isCreateOrgOpen, setIsCreateOrgOpen] =
|
|
16756
|
-
const [isProfileOpen, setIsProfileOpen] =
|
|
16757
|
-
const [isOrganizationListOpen, setIsOrganizationListOpen] =
|
|
17049
|
+
const [isCreateOrgOpen, setIsCreateOrgOpen] = useState36(false);
|
|
17050
|
+
const [isProfileOpen, setIsProfileOpen] = useState36(false);
|
|
17051
|
+
const [isOrganizationListOpen, setIsOrganizationListOpen] = useState36(false);
|
|
16758
17052
|
const { t } = useTranslation_default(preferences?.i18n);
|
|
16759
17053
|
if (!isSignedIn && fallback) {
|
|
16760
17054
|
return fallback;
|
|
16761
17055
|
}
|
|
16762
17056
|
if (!isSignedIn) {
|
|
16763
|
-
return /* @__PURE__ */
|
|
17057
|
+
return /* @__PURE__ */ jsx114(Fragment24, {});
|
|
16764
17058
|
}
|
|
16765
17059
|
const organizations = propOrganizations || contextOrganizations || [];
|
|
16766
17060
|
const currentOrganization = propCurrentOrganization || contextCurrentOrganization;
|
|
@@ -16774,19 +17068,19 @@ var OrganizationSwitcher = ({
|
|
|
16774
17068
|
const defaultMenuItems = [];
|
|
16775
17069
|
if (currentOrganization) {
|
|
16776
17070
|
defaultMenuItems.push({
|
|
16777
|
-
icon: /* @__PURE__ */
|
|
17071
|
+
icon: /* @__PURE__ */ jsx114(BuildingAlt_default, {}),
|
|
16778
17072
|
label: t("organization.switcher.manage.organizations"),
|
|
16779
17073
|
onClick: handleManageOrganizations
|
|
16780
17074
|
});
|
|
16781
17075
|
}
|
|
16782
17076
|
defaultMenuItems.push({
|
|
16783
|
-
icon: /* @__PURE__ */
|
|
17077
|
+
icon: /* @__PURE__ */ jsx114("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx114("path", { d: "M12 5v14m-7-7h14" }) }),
|
|
16784
17078
|
label: t("organization.switcher.create.organization"),
|
|
16785
17079
|
onClick: () => setIsCreateOrgOpen(true)
|
|
16786
17080
|
});
|
|
16787
17081
|
const menuItems = props.menuItems ? [...defaultMenuItems, ...props.menuItems] : defaultMenuItems;
|
|
16788
|
-
return /* @__PURE__ */
|
|
16789
|
-
/* @__PURE__ */
|
|
17082
|
+
return /* @__PURE__ */ jsxs51(Fragment24, { children: [
|
|
17083
|
+
/* @__PURE__ */ jsx114(
|
|
16790
17084
|
BaseOrganizationSwitcher,
|
|
16791
17085
|
{
|
|
16792
17086
|
organizations,
|
|
@@ -16800,7 +17094,7 @@ var OrganizationSwitcher = ({
|
|
|
16800
17094
|
...props
|
|
16801
17095
|
}
|
|
16802
17096
|
),
|
|
16803
|
-
/* @__PURE__ */
|
|
17097
|
+
/* @__PURE__ */ jsx114(
|
|
16804
17098
|
CreateOrganization,
|
|
16805
17099
|
{
|
|
16806
17100
|
mode: "popup",
|
|
@@ -16814,7 +17108,7 @@ var OrganizationSwitcher = ({
|
|
|
16814
17108
|
}
|
|
16815
17109
|
}
|
|
16816
17110
|
),
|
|
16817
|
-
currentOrganization && /* @__PURE__ */
|
|
17111
|
+
currentOrganization && /* @__PURE__ */ jsx114(
|
|
16818
17112
|
OrganizationProfile_default,
|
|
16819
17113
|
{
|
|
16820
17114
|
organizationId: currentOrganization.id,
|
|
@@ -16822,11 +17116,11 @@ var OrganizationSwitcher = ({
|
|
|
16822
17116
|
open: isProfileOpen,
|
|
16823
17117
|
onOpenChange: setIsProfileOpen,
|
|
16824
17118
|
cardLayout: true,
|
|
16825
|
-
loadingFallback: /* @__PURE__ */
|
|
16826
|
-
errorFallback: /* @__PURE__ */
|
|
17119
|
+
loadingFallback: /* @__PURE__ */ jsx114("div", { children: t("organization.profile.loading") }),
|
|
17120
|
+
errorFallback: /* @__PURE__ */ jsx114("div", { children: t("organization.profile.error") })
|
|
16827
17121
|
}
|
|
16828
17122
|
),
|
|
16829
|
-
/* @__PURE__ */
|
|
17123
|
+
/* @__PURE__ */ jsx114(
|
|
16830
17124
|
OrganizationList_default,
|
|
16831
17125
|
{
|
|
16832
17126
|
mode: "popup",
|
|
@@ -16860,7 +17154,7 @@ import {
|
|
|
16860
17154
|
useInteractions as useInteractions4,
|
|
16861
17155
|
useRole as useRole4
|
|
16862
17156
|
} from "@floating-ui/react";
|
|
16863
|
-
import { useEffect as
|
|
17157
|
+
import { useEffect as useEffect25, useState as useState37 } from "react";
|
|
16864
17158
|
|
|
16865
17159
|
// src/components/presentation/LanguageSwitcher/BaseLanguageSwitcher.styles.ts
|
|
16866
17160
|
import { css as css32 } from "@emotion/css";
|
|
@@ -16975,7 +17269,7 @@ var useStyles31 = (theme, colorScheme) => useMemo43(() => {
|
|
|
16975
17269
|
var BaseLanguageSwitcher_styles_default = useStyles31;
|
|
16976
17270
|
|
|
16977
17271
|
// src/components/presentation/LanguageSwitcher/BaseLanguageSwitcher.tsx
|
|
16978
|
-
import { Fragment as
|
|
17272
|
+
import { Fragment as Fragment25, jsx as jsx115, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
16979
17273
|
var BaseLanguageSwitcher = ({
|
|
16980
17274
|
children,
|
|
16981
17275
|
className,
|
|
@@ -16986,9 +17280,9 @@ var BaseLanguageSwitcher = ({
|
|
|
16986
17280
|
}) => {
|
|
16987
17281
|
const { theme, colorScheme } = useTheme_default();
|
|
16988
17282
|
const styles = BaseLanguageSwitcher_styles_default(theme, colorScheme);
|
|
16989
|
-
const [isOpen, setIsOpen] =
|
|
17283
|
+
const [isOpen, setIsOpen] = useState37(false);
|
|
16990
17284
|
const hasMultipleLanguages = languages.length > 1;
|
|
16991
|
-
|
|
17285
|
+
useEffect25(() => {
|
|
16992
17286
|
if (!hasMultipleLanguages && isOpen) {
|
|
16993
17287
|
setIsOpen(false);
|
|
16994
17288
|
}
|
|
@@ -17005,15 +17299,15 @@ var BaseLanguageSwitcher = ({
|
|
|
17005
17299
|
const { getReferenceProps, getFloatingProps } = useInteractions4([click, dismiss, role]);
|
|
17006
17300
|
const currentOption = languages.find((l) => l.code === currentLanguage);
|
|
17007
17301
|
if (children) {
|
|
17008
|
-
return /* @__PURE__ */
|
|
17302
|
+
return /* @__PURE__ */ jsx115(Fragment25, { children: children({
|
|
17009
17303
|
currentLanguage,
|
|
17010
17304
|
isLoading,
|
|
17011
17305
|
languages,
|
|
17012
17306
|
onLanguageChange
|
|
17013
17307
|
}) });
|
|
17014
17308
|
}
|
|
17015
|
-
return /* @__PURE__ */
|
|
17016
|
-
/* @__PURE__ */
|
|
17309
|
+
return /* @__PURE__ */ jsxs52("div", { className: cx36(styles["root"], className), children: [
|
|
17310
|
+
/* @__PURE__ */ jsxs52(
|
|
17017
17311
|
"button",
|
|
17018
17312
|
{
|
|
17019
17313
|
ref: refs.setReference,
|
|
@@ -17023,13 +17317,13 @@ var BaseLanguageSwitcher = ({
|
|
|
17023
17317
|
...getReferenceProps(),
|
|
17024
17318
|
className: styles["trigger"],
|
|
17025
17319
|
children: [
|
|
17026
|
-
currentOption && /* @__PURE__ */
|
|
17027
|
-
/* @__PURE__ */
|
|
17028
|
-
hasMultipleLanguages && /* @__PURE__ */
|
|
17320
|
+
currentOption && /* @__PURE__ */ jsx115("span", { className: styles["triggerEmoji"], children: currentOption.emoji }),
|
|
17321
|
+
/* @__PURE__ */ jsx115("span", { className: styles["triggerLabel"], children: currentOption?.displayName ?? currentLanguage }),
|
|
17322
|
+
hasMultipleLanguages && /* @__PURE__ */ jsx115(ChevronDown_default, {})
|
|
17029
17323
|
]
|
|
17030
17324
|
}
|
|
17031
17325
|
),
|
|
17032
|
-
isOpen && hasMultipleLanguages && /* @__PURE__ */
|
|
17326
|
+
isOpen && hasMultipleLanguages && /* @__PURE__ */ jsx115(FloatingPortal4, { children: /* @__PURE__ */ jsx115(FloatingFocusManager4, { context, modal: false, children: /* @__PURE__ */ jsx115(
|
|
17033
17327
|
"div",
|
|
17034
17328
|
{
|
|
17035
17329
|
ref: refs.setFloating,
|
|
@@ -17038,7 +17332,7 @@ var BaseLanguageSwitcher = ({
|
|
|
17038
17332
|
className: styles["content"],
|
|
17039
17333
|
role: "listbox",
|
|
17040
17334
|
"aria-label": "Select language",
|
|
17041
|
-
children: languages.map((lang) => /* @__PURE__ */
|
|
17335
|
+
children: languages.map((lang) => /* @__PURE__ */ jsxs52(
|
|
17042
17336
|
"button",
|
|
17043
17337
|
{
|
|
17044
17338
|
type: "button",
|
|
@@ -17050,9 +17344,9 @@ var BaseLanguageSwitcher = ({
|
|
|
17050
17344
|
setIsOpen(false);
|
|
17051
17345
|
},
|
|
17052
17346
|
children: [
|
|
17053
|
-
/* @__PURE__ */
|
|
17054
|
-
/* @__PURE__ */
|
|
17055
|
-
lang.code === currentLanguage && /* @__PURE__ */
|
|
17347
|
+
/* @__PURE__ */ jsx115("span", { className: styles["optionEmoji"], children: lang.emoji }),
|
|
17348
|
+
/* @__PURE__ */ jsx115("span", { className: styles["optionLabel"], children: lang.displayName }),
|
|
17349
|
+
lang.code === currentLanguage && /* @__PURE__ */ jsx115("span", { className: styles["checkIcon"], children: /* @__PURE__ */ jsx115(Check_default, {}) })
|
|
17056
17350
|
]
|
|
17057
17351
|
},
|
|
17058
17352
|
lang.code
|
|
@@ -17079,7 +17373,7 @@ var useFlowMeta = () => {
|
|
|
17079
17373
|
var useFlowMeta_default = useFlowMeta;
|
|
17080
17374
|
|
|
17081
17375
|
// src/components/presentation/LanguageSwitcher/LanguageSwitcher.tsx
|
|
17082
|
-
import { jsx as
|
|
17376
|
+
import { jsx as jsx116 } from "react/jsx-runtime";
|
|
17083
17377
|
var LanguageSwitcher = ({ children, className }) => {
|
|
17084
17378
|
const { meta, switchLanguage, isLoading } = useFlowMeta_default();
|
|
17085
17379
|
const { currentLanguage } = useTranslation_default();
|
|
@@ -17102,7 +17396,7 @@ var LanguageSwitcher = ({ children, className }) => {
|
|
|
17102
17396
|
switchLanguage(language);
|
|
17103
17397
|
}
|
|
17104
17398
|
};
|
|
17105
|
-
return /* @__PURE__ */
|
|
17399
|
+
return /* @__PURE__ */ jsx116(
|
|
17106
17400
|
BaseLanguageSwitcher_default,
|
|
17107
17401
|
{
|
|
17108
17402
|
currentLanguage,
|
|
@@ -17160,6 +17454,8 @@ export {
|
|
|
17160
17454
|
Checkbox_default as Checkbox,
|
|
17161
17455
|
CircleAlert_default as CircleAlert,
|
|
17162
17456
|
CircleCheck_default as CircleCheck,
|
|
17457
|
+
Consent_default as Consent,
|
|
17458
|
+
ConsentCheckboxList_default as ConsentCheckboxList,
|
|
17163
17459
|
CreateOrganization,
|
|
17164
17460
|
DatePicker_default as DatePicker,
|
|
17165
17461
|
Divider_default as Divider,
|
|
@@ -17176,6 +17472,7 @@ export {
|
|
|
17176
17472
|
FieldFactory,
|
|
17177
17473
|
FlowContext_default as FlowContext,
|
|
17178
17474
|
FlowProvider_default as FlowProvider,
|
|
17475
|
+
FlowTimer_default as FlowTimer,
|
|
17179
17476
|
FormControl_default as FormControl,
|
|
17180
17477
|
GitHubButton_default as GitHubButton,
|
|
17181
17478
|
GoogleButton_default as GoogleButton,
|
|
@@ -17234,6 +17531,7 @@ export {
|
|
|
17234
17531
|
createSignInOptionFromAuthenticator,
|
|
17235
17532
|
getActiveTheme2 as getActiveTheme,
|
|
17236
17533
|
getAllOrganizations_default as getAllOrganizations,
|
|
17534
|
+
getConsentOptionalKey,
|
|
17237
17535
|
getMeOrganizations_default as getMeOrganizations,
|
|
17238
17536
|
getScim2Me_default as getMeProfile,
|
|
17239
17537
|
getOrganization_default as getOrganization,
|