@asgardeo/react 0.23.6 → 0.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AsgardeoReactClient.d.ts +1 -0
- package/dist/AsgardeoReactClient.d.ts.map +1 -1
- package/dist/cjs/index.js +2014 -1059
- package/dist/cjs/index.js.map +4 -4
- package/dist/components/presentation/auth/AuthOptionFactory.d.ts +24 -1
- package/dist/components/presentation/auth/AuthOptionFactory.d.ts.map +1 -1
- package/dist/components/presentation/auth/Recovery/BaseRecovery.d.ts +24 -0
- package/dist/components/presentation/auth/Recovery/BaseRecovery.d.ts.map +1 -0
- package/dist/components/presentation/auth/Recovery/Recovery.d.ts +57 -0
- package/dist/components/presentation/auth/Recovery/Recovery.d.ts.map +1 -0
- package/dist/components/presentation/auth/Recovery/v1/BaseRecovery.d.ts +74 -0
- package/dist/components/presentation/auth/Recovery/v1/BaseRecovery.d.ts.map +1 -0
- package/dist/components/presentation/auth/Recovery/v1/Recovery.d.ts +26 -0
- package/dist/components/presentation/auth/Recovery/v1/Recovery.d.ts.map +1 -0
- package/dist/components/presentation/auth/Recovery/v1/RecoveryOptionFactory.d.ts +46 -0
- package/dist/components/presentation/auth/Recovery/v1/RecoveryOptionFactory.d.ts.map +1 -0
- package/dist/components/presentation/auth/Recovery/v2/BaseRecovery.d.ts +83 -0
- package/dist/components/presentation/auth/Recovery/v2/BaseRecovery.d.ts.map +1 -0
- package/dist/components/presentation/auth/Recovery/v2/Recovery.d.ts +56 -0
- package/dist/components/presentation/auth/Recovery/v2/Recovery.d.ts.map +1 -0
- package/dist/contexts/Asgardeo/AsgardeoContext.d.ts +4 -0
- package/dist/contexts/Asgardeo/AsgardeoContext.d.ts.map +1 -1
- package/dist/contexts/Asgardeo/AsgardeoProvider.d.ts.map +1 -1
- package/dist/contexts/ComponentRenderer/ComponentRendererContext.d.ts +1 -1
- package/dist/contexts/ComponentRenderer/ComponentRendererContext.d.ts.map +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1698 -732
- package/dist/index.js.map +4 -4
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -45,6 +45,7 @@ var AsgardeoContext = createContext({
|
|
|
45
45
|
organizationHandle: void 0,
|
|
46
46
|
platform: void 0,
|
|
47
47
|
reInitialize: null,
|
|
48
|
+
recover: () => Promise.resolve({}),
|
|
48
49
|
resolveFlowTemplateLiterals: (text) => text ?? "",
|
|
49
50
|
signIn: () => Promise.resolve({}),
|
|
50
51
|
signInOptions: {},
|
|
@@ -77,6 +78,7 @@ import {
|
|
|
77
78
|
Platform,
|
|
78
79
|
isEmpty,
|
|
79
80
|
executeEmbeddedSignUpFlowV2,
|
|
81
|
+
executeEmbeddedRecoveryFlowV2,
|
|
80
82
|
EmbeddedSignInFlowStatusV2
|
|
81
83
|
} from "@asgardeo/browser";
|
|
82
84
|
|
|
@@ -903,6 +905,18 @@ var AsgardeoReactClient = class extends AsgardeoBrowserClient {
|
|
|
903
905
|
navigate(getRedirectBasedSignUpUrl(config));
|
|
904
906
|
return void 0;
|
|
905
907
|
}
|
|
908
|
+
async recover(payload) {
|
|
909
|
+
const config = await this.asgardeo.getConfigData();
|
|
910
|
+
const baseUrl = config?.baseUrl;
|
|
911
|
+
const isV2Platform = config && config.platform === Platform.AsgardeoV2;
|
|
912
|
+
if (isV2Platform) {
|
|
913
|
+
return executeEmbeddedRecoveryFlowV2({
|
|
914
|
+
baseUrl,
|
|
915
|
+
payload: { ...payload, verbose: true }
|
|
916
|
+
});
|
|
917
|
+
}
|
|
918
|
+
return void 0;
|
|
919
|
+
}
|
|
906
920
|
async getDiscoveryResponse() {
|
|
907
921
|
const storageManager = await this.asgardeo.getStorageManager();
|
|
908
922
|
return storageManager.loadOpenIDProviderConfiguration();
|
|
@@ -2428,6 +2442,10 @@ var AsgardeoProvider = ({
|
|
|
2428
2442
|
async (...args) => asgardeo.signOut(...args),
|
|
2429
2443
|
[asgardeo]
|
|
2430
2444
|
);
|
|
2445
|
+
const recover = useCallback8(
|
|
2446
|
+
async (payload) => asgardeo.recover(payload),
|
|
2447
|
+
[asgardeo]
|
|
2448
|
+
);
|
|
2431
2449
|
const signUp = useCallback8(
|
|
2432
2450
|
async (...args) => asgardeo.signUp(...args),
|
|
2433
2451
|
[asgardeo]
|
|
@@ -2468,6 +2486,7 @@ var AsgardeoProvider = ({
|
|
|
2468
2486
|
organizationHandle: config?.organizationHandle,
|
|
2469
2487
|
platform: config?.platform,
|
|
2470
2488
|
reInitialize,
|
|
2489
|
+
recover,
|
|
2471
2490
|
signIn,
|
|
2472
2491
|
signInOptions,
|
|
2473
2492
|
signInSilently,
|
|
@@ -2500,17 +2519,18 @@ var AsgardeoProvider = ({
|
|
|
2500
2519
|
syncSession,
|
|
2501
2520
|
switchOrganization,
|
|
2502
2521
|
getDecodedIdToken,
|
|
2522
|
+
clearSession,
|
|
2523
|
+
exchangeToken,
|
|
2503
2524
|
getAccessToken,
|
|
2504
2525
|
getStorageManager,
|
|
2526
|
+
instanceId,
|
|
2527
|
+
organizationChain,
|
|
2528
|
+
recover,
|
|
2529
|
+
reInitialize,
|
|
2505
2530
|
request,
|
|
2506
2531
|
requestAll,
|
|
2507
|
-
exchangeToken,
|
|
2508
2532
|
signOut,
|
|
2509
|
-
signUp
|
|
2510
|
-
clearSession,
|
|
2511
|
-
reInitialize,
|
|
2512
|
-
instanceId,
|
|
2513
|
-
organizationChain
|
|
2533
|
+
signUp
|
|
2514
2534
|
]
|
|
2515
2535
|
);
|
|
2516
2536
|
return /* @__PURE__ */ jsx11(AsgardeoContext_default.Provider, { value, children: /* @__PURE__ */ jsx11(I18nProvider_default, { preferences: preferences?.i18n, children: /* @__PURE__ */ jsx11(FlowMetaProvider_default, { enabled: preferences?.resolveFromMeta !== false, children: /* @__PURE__ */ jsx11(
|
|
@@ -9263,6 +9283,22 @@ var renderSignUpComponents = (components, formValues, touchedFields, formErrors,
|
|
|
9263
9283
|
}
|
|
9264
9284
|
)
|
|
9265
9285
|
).filter(Boolean);
|
|
9286
|
+
var renderRecoveryComponents = (components, formValues, touchedFields, formErrors, isLoading, isFormValid, onInputChange, options) => components.map(
|
|
9287
|
+
(component, index) => createAuthComponentFromFlow(
|
|
9288
|
+
component,
|
|
9289
|
+
formValues,
|
|
9290
|
+
touchedFields,
|
|
9291
|
+
formErrors,
|
|
9292
|
+
isLoading,
|
|
9293
|
+
isFormValid,
|
|
9294
|
+
onInputChange,
|
|
9295
|
+
"recovery",
|
|
9296
|
+
{
|
|
9297
|
+
...options,
|
|
9298
|
+
key: component.id || index
|
|
9299
|
+
}
|
|
9300
|
+
)
|
|
9301
|
+
).filter(Boolean);
|
|
9266
9302
|
var renderInviteUserComponents = (components, formValues, touchedFields, formErrors, isLoading, isFormValid, onInputChange, options) => components.map(
|
|
9267
9303
|
(component, index) => createAuthComponentFromFlow(
|
|
9268
9304
|
component,
|
|
@@ -12283,180 +12319,1104 @@ var SignUp3 = (props) => {
|
|
|
12283
12319
|
};
|
|
12284
12320
|
var SignUp_default3 = SignUp3;
|
|
12285
12321
|
|
|
12286
|
-
// src/components/presentation/auth/
|
|
12287
|
-
import {
|
|
12288
|
-
import { useCallback as useCallback17 } from "react";
|
|
12322
|
+
// src/components/presentation/auth/Recovery/BaseRecovery.tsx
|
|
12323
|
+
import { Platform as Platform9 } from "@asgardeo/browser";
|
|
12289
12324
|
|
|
12290
|
-
// src/components/presentation/auth/
|
|
12325
|
+
// src/components/presentation/auth/Recovery/v1/BaseRecovery.tsx
|
|
12291
12326
|
import {
|
|
12292
|
-
|
|
12293
|
-
|
|
12327
|
+
EmbeddedFlowStatus as EmbeddedFlowStatus3,
|
|
12328
|
+
EmbeddedFlowComponentType as EmbeddedFlowComponentType6,
|
|
12329
|
+
withVendorCSSClassPrefix as withVendorCSSClassPrefix25
|
|
12294
12330
|
} from "@asgardeo/browser";
|
|
12295
12331
|
import { cx as cx26 } from "@emotion/css";
|
|
12296
|
-
import {
|
|
12332
|
+
import { useEffect as useEffect21, useState as useState23, useCallback as useCallback16, useRef as useRef10 } from "react";
|
|
12297
12333
|
|
|
12298
|
-
// src/components/presentation/auth/
|
|
12299
|
-
import {
|
|
12300
|
-
import {
|
|
12301
|
-
var
|
|
12302
|
-
|
|
12303
|
-
|
|
12304
|
-
|
|
12305
|
-
|
|
12306
|
-
|
|
12307
|
-
|
|
12308
|
-
|
|
12309
|
-
|
|
12310
|
-
|
|
12311
|
-
|
|
12312
|
-
|
|
12313
|
-
|
|
12314
|
-
|
|
12315
|
-
|
|
12316
|
-
|
|
12317
|
-
|
|
12318
|
-
|
|
12319
|
-
|
|
12320
|
-
|
|
12321
|
-
|
|
12322
|
-
|
|
12323
|
-
|
|
12324
|
-
|
|
12325
|
-
|
|
12326
|
-
|
|
12327
|
-
}
|
|
12328
|
-
|
|
12329
|
-
|
|
12330
|
-
|
|
12331
|
-
|
|
12332
|
-
|
|
12333
|
-
|
|
12334
|
-
|
|
12335
|
-
|
|
12336
|
-
|
|
12334
|
+
// src/components/presentation/auth/Recovery/v1/RecoveryOptionFactory.tsx
|
|
12335
|
+
import { EmbeddedFlowComponentType as EmbeddedFlowComponentType5 } from "@asgardeo/browser";
|
|
12336
|
+
import { jsx as jsx87 } from "react/jsx-runtime";
|
|
12337
|
+
var createRecoveryComponent = ({ component, onSubmit, ...rest }) => {
|
|
12338
|
+
switch (component.type) {
|
|
12339
|
+
case EmbeddedFlowComponentType5.Typography:
|
|
12340
|
+
return /* @__PURE__ */ jsx87(Typography_default2, { component, onSubmit, ...rest });
|
|
12341
|
+
case EmbeddedFlowComponentType5.Input: {
|
|
12342
|
+
const inputVariant = component.variant?.toUpperCase();
|
|
12343
|
+
const inputType = component.config["type"]?.toLowerCase();
|
|
12344
|
+
if (inputVariant === "EMAIL" || inputType === "email") {
|
|
12345
|
+
return /* @__PURE__ */ jsx87(EmailInput_default, { component, onSubmit, ...rest });
|
|
12346
|
+
}
|
|
12347
|
+
if (inputVariant === "PASSWORD" || inputType === "password") {
|
|
12348
|
+
return /* @__PURE__ */ jsx87(PasswordInput_default, { component, onSubmit, ...rest });
|
|
12349
|
+
}
|
|
12350
|
+
if (inputVariant === "TELEPHONE" || inputType === "tel") {
|
|
12351
|
+
return /* @__PURE__ */ jsx87(TelephoneInput_default, { component, onSubmit, ...rest });
|
|
12352
|
+
}
|
|
12353
|
+
if (inputVariant === "NUMBER" || inputType === "number") {
|
|
12354
|
+
return /* @__PURE__ */ jsx87(NumberInput_default, { component, onSubmit, ...rest });
|
|
12355
|
+
}
|
|
12356
|
+
if (inputVariant === "DATE" || inputType === "date") {
|
|
12357
|
+
return /* @__PURE__ */ jsx87(DateInput_default, { component, onSubmit, ...rest });
|
|
12358
|
+
}
|
|
12359
|
+
if (inputVariant === "CHECKBOX" || inputType === "checkbox") {
|
|
12360
|
+
return /* @__PURE__ */ jsx87(CheckboxInput_default, { component, onSubmit, ...rest });
|
|
12361
|
+
}
|
|
12362
|
+
return /* @__PURE__ */ jsx87(TextInput_default, { component, onSubmit, ...rest });
|
|
12363
|
+
}
|
|
12364
|
+
case EmbeddedFlowComponentType5.Button: {
|
|
12365
|
+
const buttonVariant = component.variant?.toUpperCase();
|
|
12366
|
+
const buttonText = component.config["text"] || component.config["label"] || "";
|
|
12367
|
+
if (buttonVariant === "SOCIAL") {
|
|
12368
|
+
if (buttonText.toLowerCase().includes("google")) {
|
|
12369
|
+
return /* @__PURE__ */ jsx87(GoogleButton_default, { onClick: () => onSubmit(component, {}), ...rest, children: buttonText });
|
|
12370
|
+
}
|
|
12371
|
+
if (buttonText.toLowerCase().includes("github")) {
|
|
12372
|
+
return /* @__PURE__ */ jsx87(GitHubButton_default, { onClick: () => onSubmit(component, {}), ...rest, children: buttonText });
|
|
12373
|
+
}
|
|
12374
|
+
if (buttonText.toLowerCase().includes("microsoft")) {
|
|
12375
|
+
return /* @__PURE__ */ jsx87(MicrosoftButton_default, { onClick: () => onSubmit(component, {}), ...rest, children: buttonText });
|
|
12376
|
+
}
|
|
12377
|
+
if (buttonText.toLowerCase().includes("facebook")) {
|
|
12378
|
+
return /* @__PURE__ */ jsx87(FacebookButton_default, { onClick: () => onSubmit(component, {}), ...rest, children: buttonText });
|
|
12379
|
+
}
|
|
12380
|
+
if (buttonText.toLowerCase().includes("linkedin")) {
|
|
12381
|
+
return /* @__PURE__ */ jsx87(LinkedInButton_default, { onClick: () => onSubmit(component, {}), ...rest, children: buttonText });
|
|
12382
|
+
}
|
|
12383
|
+
if (buttonText.toLowerCase().includes("ethereum")) {
|
|
12384
|
+
return /* @__PURE__ */ jsx87(SignInWithEthereumButton_default, { onClick: () => onSubmit(component, {}), ...rest, children: buttonText });
|
|
12385
|
+
}
|
|
12386
|
+
}
|
|
12387
|
+
return /* @__PURE__ */ jsx87(SubmitButton_default, { component, onSubmit, ...rest });
|
|
12388
|
+
}
|
|
12389
|
+
case EmbeddedFlowComponentType5.Form:
|
|
12390
|
+
return /* @__PURE__ */ jsx87(FormContainer_default, { component, onSubmit, ...rest });
|
|
12391
|
+
case EmbeddedFlowComponentType5.Select:
|
|
12392
|
+
return /* @__PURE__ */ jsx87(SelectInput_default, { component, onSubmit, ...rest });
|
|
12393
|
+
case EmbeddedFlowComponentType5.Divider:
|
|
12394
|
+
return /* @__PURE__ */ jsx87(DividerComponent_default, { component, onSubmit, ...rest });
|
|
12395
|
+
case EmbeddedFlowComponentType5.Image:
|
|
12396
|
+
return /* @__PURE__ */ jsx87(ImageComponent_default, { component, onSubmit, ...rest });
|
|
12397
|
+
default:
|
|
12398
|
+
return /* @__PURE__ */ jsx87("div", {});
|
|
12399
|
+
}
|
|
12400
|
+
};
|
|
12401
|
+
var createRecoveryOptionFromComponent = (component, formValues, touchedFields, formErrors, isLoading, isFormValid, onInputChange, options) => createRecoveryComponent({
|
|
12402
|
+
component,
|
|
12403
|
+
formErrors,
|
|
12404
|
+
formValues,
|
|
12405
|
+
isFormValid,
|
|
12406
|
+
isLoading,
|
|
12407
|
+
onInputChange,
|
|
12408
|
+
touchedFields,
|
|
12409
|
+
...options
|
|
12410
|
+
});
|
|
12411
|
+
var renderRecoveryComponents2 = (components, formValues, touchedFields, formErrors, isLoading, isFormValid, onInputChange, options) => components.map(
|
|
12412
|
+
(component, index) => createRecoveryOptionFromComponent(
|
|
12413
|
+
component,
|
|
12414
|
+
formValues,
|
|
12415
|
+
touchedFields,
|
|
12416
|
+
formErrors,
|
|
12417
|
+
isLoading,
|
|
12418
|
+
isFormValid,
|
|
12419
|
+
onInputChange,
|
|
12420
|
+
{
|
|
12421
|
+
...options,
|
|
12422
|
+
// Use component id as key, fallback to index
|
|
12423
|
+
key: component.id || index
|
|
12424
|
+
}
|
|
12425
|
+
)
|
|
12426
|
+
).filter(Boolean);
|
|
12337
12427
|
|
|
12338
|
-
// src/components/presentation/auth/
|
|
12339
|
-
import { jsx as
|
|
12340
|
-
var
|
|
12428
|
+
// src/components/presentation/auth/Recovery/v1/BaseRecovery.tsx
|
|
12429
|
+
import { jsx as jsx88, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
12430
|
+
var BaseRecoveryContent = ({
|
|
12341
12431
|
onInitialize,
|
|
12342
12432
|
onSubmit,
|
|
12343
12433
|
onError,
|
|
12344
12434
|
onFlowChange,
|
|
12435
|
+
onComplete,
|
|
12345
12436
|
className = "",
|
|
12346
|
-
|
|
12347
|
-
|
|
12348
|
-
|
|
12349
|
-
|
|
12437
|
+
inputClassName = "",
|
|
12438
|
+
buttonClassName = "",
|
|
12439
|
+
errorClassName = "",
|
|
12440
|
+
messageClassName = "",
|
|
12350
12441
|
size = "medium",
|
|
12351
12442
|
variant = "outlined",
|
|
12443
|
+
isInitialized,
|
|
12444
|
+
children,
|
|
12352
12445
|
showTitle = true,
|
|
12353
12446
|
showSubtitle = true
|
|
12354
12447
|
}) => {
|
|
12355
|
-
const {
|
|
12356
|
-
const { t } = useTranslation_default(
|
|
12357
|
-
const {
|
|
12358
|
-
|
|
12359
|
-
const styles =
|
|
12360
|
-
const [isLoading, setIsLoading] = useState23(false);
|
|
12361
|
-
const [isFlowInitialized, setIsFlowInitialized] = useState23(false);
|
|
12362
|
-
const [currentFlow, setCurrentFlow] = useState23(null);
|
|
12363
|
-
const [apiError, setApiError] = useState23(null);
|
|
12364
|
-
const [formValues, setFormValues] = useState23({});
|
|
12365
|
-
const [formErrors, setFormErrors] = useState23({});
|
|
12366
|
-
const [touchedFields, setTouchedFields] = useState23({});
|
|
12367
|
-
const [isFormValid, setIsFormValid] = useState23(true);
|
|
12368
|
-
const challengeTokenRef = useRef10(null);
|
|
12369
|
-
const initializationAttemptedRef = useRef10(false);
|
|
12370
|
-
useEffect21(() => {
|
|
12371
|
-
if (!isSdkInitialized) return;
|
|
12372
|
-
(async () => {
|
|
12373
|
-
try {
|
|
12374
|
-
const storageManager = await getStorageManager();
|
|
12375
|
-
const tempData = await storageManager?.getTemporaryData();
|
|
12376
|
-
if (tempData?.challengeToken) {
|
|
12377
|
-
challengeTokenRef.current = tempData.challengeToken;
|
|
12378
|
-
}
|
|
12379
|
-
} catch {
|
|
12380
|
-
}
|
|
12381
|
-
})();
|
|
12382
|
-
}, [isSdkInitialized]);
|
|
12383
|
-
const setChallengeToken = async (challengeToken) => {
|
|
12384
|
-
challengeTokenRef.current = challengeToken;
|
|
12385
|
-
try {
|
|
12386
|
-
const storageManager = await getStorageManager();
|
|
12387
|
-
if (storageManager) {
|
|
12388
|
-
if (challengeToken) {
|
|
12389
|
-
await storageManager.setTemporaryDataParameter("challengeToken", challengeToken);
|
|
12390
|
-
} else {
|
|
12391
|
-
await storageManager.removeTemporaryDataParameter("challengeToken");
|
|
12392
|
-
}
|
|
12393
|
-
}
|
|
12394
|
-
} catch {
|
|
12395
|
-
logger10.warn("Failed to persist challenge token in storage.");
|
|
12396
|
-
}
|
|
12397
|
-
};
|
|
12448
|
+
const { theme, colorScheme } = useTheme_default();
|
|
12449
|
+
const { t } = useTranslation_default();
|
|
12450
|
+
const { subtitle: flowSubtitle, title: flowTitle, messages: flowMessages, addMessage, clearMessages } = useFlow_default();
|
|
12451
|
+
useAsgardeo_default();
|
|
12452
|
+
const styles = BaseSignUp_styles_default(theme, colorScheme);
|
|
12398
12453
|
const handleError = useCallback16(
|
|
12399
12454
|
(error) => {
|
|
12400
|
-
|
|
12401
|
-
|
|
12402
|
-
|
|
12403
|
-
|
|
12404
|
-
|
|
12405
|
-
|
|
12406
|
-
|
|
12407
|
-
|
|
12408
|
-
|
|
12409
|
-
|
|
12410
|
-
}
|
|
12411
|
-
try {
|
|
12412
|
-
const { components: components2 } = normalizeFlowResponse(
|
|
12413
|
-
response,
|
|
12414
|
-
t,
|
|
12415
|
-
{
|
|
12416
|
-
defaultErrorKey: "components.inviteUser.errors.generic",
|
|
12417
|
-
resolveTranslations: false
|
|
12418
|
-
},
|
|
12419
|
-
meta
|
|
12420
|
-
);
|
|
12421
|
-
return {
|
|
12422
|
-
...response,
|
|
12423
|
-
data: {
|
|
12424
|
-
...response.data,
|
|
12425
|
-
components: components2
|
|
12455
|
+
let errorMessage = t("errors.recovery.flow.failure");
|
|
12456
|
+
if (error && typeof error === "object") {
|
|
12457
|
+
if (error.code && (error.message || error.description)) {
|
|
12458
|
+
errorMessage = error.description || error.message;
|
|
12459
|
+
} else if (error instanceof Error && error.name === "AsgardeoAPIError") {
|
|
12460
|
+
try {
|
|
12461
|
+
const errorResponse = JSON.parse(error.message);
|
|
12462
|
+
errorMessage = errorResponse.description || errorResponse.message || error.message;
|
|
12463
|
+
} catch {
|
|
12464
|
+
errorMessage = error.message;
|
|
12426
12465
|
}
|
|
12427
|
-
}
|
|
12428
|
-
|
|
12429
|
-
|
|
12466
|
+
} else if (error.message) {
|
|
12467
|
+
errorMessage = error.message;
|
|
12468
|
+
}
|
|
12469
|
+
} else if (typeof error === "string") {
|
|
12470
|
+
errorMessage = error;
|
|
12430
12471
|
}
|
|
12472
|
+
clearMessages();
|
|
12473
|
+
addMessage({ message: errorMessage, type: "error" });
|
|
12431
12474
|
},
|
|
12432
|
-
[t,
|
|
12475
|
+
[t, addMessage, clearMessages]
|
|
12433
12476
|
);
|
|
12434
|
-
const
|
|
12435
|
-
|
|
12436
|
-
|
|
12437
|
-
|
|
12438
|
-
|
|
12439
|
-
|
|
12440
|
-
|
|
12441
|
-
|
|
12442
|
-
|
|
12443
|
-
|
|
12444
|
-
|
|
12445
|
-
|
|
12446
|
-
|
|
12447
|
-
|
|
12448
|
-
|
|
12449
|
-
|
|
12450
|
-
|
|
12451
|
-
|
|
12452
|
-
|
|
12453
|
-
|
|
12454
|
-
|
|
12455
|
-
|
|
12456
|
-
|
|
12457
|
-
|
|
12458
|
-
|
|
12459
|
-
|
|
12477
|
+
const [isLoading, setIsLoading] = useState23(false);
|
|
12478
|
+
const [isFlowInitialized, setIsFlowInitialized] = useState23(false);
|
|
12479
|
+
const [currentFlow, setCurrentFlow] = useState23(null);
|
|
12480
|
+
const initializationAttemptedRef = useRef10(false);
|
|
12481
|
+
const extractFormFields = useCallback16(
|
|
12482
|
+
(components) => {
|
|
12483
|
+
const fields = [];
|
|
12484
|
+
const processComponents = (comps) => {
|
|
12485
|
+
comps.forEach((component) => {
|
|
12486
|
+
if (component.type === EmbeddedFlowComponentType6.Input) {
|
|
12487
|
+
const config = component.config || {};
|
|
12488
|
+
fields.push({
|
|
12489
|
+
initialValue: config.defaultValue || "",
|
|
12490
|
+
name: config.name || component.id,
|
|
12491
|
+
required: config.required || false,
|
|
12492
|
+
validator: (value) => {
|
|
12493
|
+
if (config.required && (!value || value.trim() === "")) {
|
|
12494
|
+
return t("validations.required.field.error");
|
|
12495
|
+
}
|
|
12496
|
+
if (config.type === "email" && value && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value)) {
|
|
12497
|
+
return t("field.email.invalid");
|
|
12498
|
+
}
|
|
12499
|
+
if (config.type === "password" && value && value.length < 8) {
|
|
12500
|
+
return t("field.password.weak");
|
|
12501
|
+
}
|
|
12502
|
+
return null;
|
|
12503
|
+
}
|
|
12504
|
+
});
|
|
12505
|
+
}
|
|
12506
|
+
if (component.components && Array.isArray(component.components)) {
|
|
12507
|
+
processComponents(component.components);
|
|
12508
|
+
}
|
|
12509
|
+
});
|
|
12510
|
+
};
|
|
12511
|
+
processComponents(components);
|
|
12512
|
+
return fields;
|
|
12513
|
+
},
|
|
12514
|
+
[t]
|
|
12515
|
+
);
|
|
12516
|
+
const formFields = currentFlow?.data?.components ? extractFormFields(currentFlow.data.components) : [];
|
|
12517
|
+
const form = useForm({
|
|
12518
|
+
fields: formFields,
|
|
12519
|
+
initialValues: {},
|
|
12520
|
+
requiredMessage: t("validations.required.field.error"),
|
|
12521
|
+
validateOnBlur: true,
|
|
12522
|
+
validateOnChange: true
|
|
12523
|
+
});
|
|
12524
|
+
const {
|
|
12525
|
+
values: formValues,
|
|
12526
|
+
touched: touchedFields,
|
|
12527
|
+
errors: formErrors,
|
|
12528
|
+
isValid: isFormValid,
|
|
12529
|
+
setValue: setFormValue,
|
|
12530
|
+
setTouched: setFormTouched,
|
|
12531
|
+
validateForm,
|
|
12532
|
+
touchAllFields,
|
|
12533
|
+
reset: resetForm
|
|
12534
|
+
} = form;
|
|
12535
|
+
const setupFormFields = useCallback16(
|
|
12536
|
+
(flowResponse) => {
|
|
12537
|
+
const fields = extractFormFields(flowResponse.data?.components || []);
|
|
12538
|
+
const initialValues = {};
|
|
12539
|
+
fields.forEach((field) => {
|
|
12540
|
+
initialValues[field.name] = field.initialValue || "";
|
|
12541
|
+
});
|
|
12542
|
+
resetForm();
|
|
12543
|
+
Object.keys(initialValues).forEach((key) => setFormValue(key, initialValues[key]));
|
|
12544
|
+
},
|
|
12545
|
+
[extractFormFields, resetForm, setFormValue]
|
|
12546
|
+
);
|
|
12547
|
+
const handleInputChange = useCallback16(
|
|
12548
|
+
(name, value) => {
|
|
12549
|
+
setFormValue(name, value);
|
|
12550
|
+
setFormTouched(name, true);
|
|
12551
|
+
},
|
|
12552
|
+
[setFormValue, setFormTouched]
|
|
12553
|
+
);
|
|
12554
|
+
const handleSubmit = async (component, data, skipValidation) => {
|
|
12555
|
+
if (!currentFlow) return;
|
|
12556
|
+
if (!skipValidation) {
|
|
12557
|
+
touchAllFields();
|
|
12558
|
+
const validation = validateForm();
|
|
12559
|
+
if (!validation.isValid) return;
|
|
12560
|
+
}
|
|
12561
|
+
setIsLoading(true);
|
|
12562
|
+
clearMessages();
|
|
12563
|
+
try {
|
|
12564
|
+
const filteredInputs = {};
|
|
12565
|
+
if (data) {
|
|
12566
|
+
Object.entries(data).forEach(([key, value]) => {
|
|
12567
|
+
if (value !== null && value !== void 0 && value !== "") {
|
|
12568
|
+
filteredInputs[key] = value;
|
|
12569
|
+
}
|
|
12570
|
+
});
|
|
12571
|
+
}
|
|
12572
|
+
const payload = {
|
|
12573
|
+
...currentFlow.flowId && { flowId: currentFlow.flowId },
|
|
12574
|
+
flowType: currentFlow.flowType || "RECOVERY",
|
|
12575
|
+
inputs: filteredInputs,
|
|
12576
|
+
...component.id && { actionId: component.id }
|
|
12577
|
+
};
|
|
12578
|
+
const response = await onSubmit?.(payload);
|
|
12579
|
+
if (!response) return;
|
|
12580
|
+
onFlowChange?.(response);
|
|
12581
|
+
if (response.flowStatus === EmbeddedFlowStatus3.Complete) {
|
|
12582
|
+
onComplete?.(response);
|
|
12583
|
+
return;
|
|
12584
|
+
}
|
|
12585
|
+
if (response.flowStatus === EmbeddedFlowStatus3.Incomplete) {
|
|
12586
|
+
setCurrentFlow(response);
|
|
12587
|
+
setupFormFields(response);
|
|
12588
|
+
}
|
|
12589
|
+
} catch (err) {
|
|
12590
|
+
handleError(err);
|
|
12591
|
+
onError?.(err);
|
|
12592
|
+
} finally {
|
|
12593
|
+
setIsLoading(false);
|
|
12594
|
+
}
|
|
12595
|
+
};
|
|
12596
|
+
const containerClasses = cx26(
|
|
12597
|
+
[
|
|
12598
|
+
withVendorCSSClassPrefix25("recovery"),
|
|
12599
|
+
withVendorCSSClassPrefix25(`recovery--${size}`),
|
|
12600
|
+
withVendorCSSClassPrefix25(`recovery--${variant}`)
|
|
12601
|
+
],
|
|
12602
|
+
className
|
|
12603
|
+
);
|
|
12604
|
+
const inputClasses = cx26(
|
|
12605
|
+
[
|
|
12606
|
+
withVendorCSSClassPrefix25("recovery__input"),
|
|
12607
|
+
size === "small" && withVendorCSSClassPrefix25("recovery__input--small"),
|
|
12608
|
+
size === "large" && withVendorCSSClassPrefix25("recovery__input--large")
|
|
12609
|
+
],
|
|
12610
|
+
inputClassName
|
|
12611
|
+
);
|
|
12612
|
+
const buttonClasses = cx26(
|
|
12613
|
+
[
|
|
12614
|
+
withVendorCSSClassPrefix25("recovery__button"),
|
|
12615
|
+
size === "small" && withVendorCSSClassPrefix25("recovery__button--small"),
|
|
12616
|
+
size === "large" && withVendorCSSClassPrefix25("recovery__button--large")
|
|
12617
|
+
],
|
|
12618
|
+
buttonClassName
|
|
12619
|
+
);
|
|
12620
|
+
const errorClasses = cx26([withVendorCSSClassPrefix25("recovery__error")], errorClassName);
|
|
12621
|
+
const messageClasses = cx26([withVendorCSSClassPrefix25("recovery__messages")], messageClassName);
|
|
12622
|
+
const renderComponents = useCallback16(
|
|
12623
|
+
(components) => renderRecoveryComponents2(
|
|
12624
|
+
components,
|
|
12625
|
+
formValues,
|
|
12626
|
+
touchedFields,
|
|
12627
|
+
formErrors,
|
|
12628
|
+
isLoading,
|
|
12629
|
+
isFormValid,
|
|
12630
|
+
handleInputChange,
|
|
12631
|
+
{
|
|
12632
|
+
buttonClassName: buttonClasses,
|
|
12633
|
+
inputClassName: inputClasses,
|
|
12634
|
+
onSubmit: handleSubmit,
|
|
12635
|
+
size,
|
|
12636
|
+
variant
|
|
12637
|
+
}
|
|
12638
|
+
),
|
|
12639
|
+
[
|
|
12640
|
+
buttonClasses,
|
|
12641
|
+
formErrors,
|
|
12642
|
+
formValues,
|
|
12643
|
+
handleInputChange,
|
|
12644
|
+
handleSubmit,
|
|
12645
|
+
inputClasses,
|
|
12646
|
+
isFormValid,
|
|
12647
|
+
isLoading,
|
|
12648
|
+
size,
|
|
12649
|
+
touchedFields,
|
|
12650
|
+
variant
|
|
12651
|
+
]
|
|
12652
|
+
);
|
|
12653
|
+
useEffect21(() => {
|
|
12654
|
+
if (isInitialized && !isFlowInitialized && !initializationAttemptedRef.current) {
|
|
12655
|
+
initializationAttemptedRef.current = true;
|
|
12656
|
+
(async () => {
|
|
12657
|
+
setIsLoading(true);
|
|
12658
|
+
clearMessages();
|
|
12659
|
+
try {
|
|
12660
|
+
const response = await onInitialize();
|
|
12661
|
+
setCurrentFlow(response);
|
|
12662
|
+
setIsFlowInitialized(true);
|
|
12663
|
+
onFlowChange?.(response);
|
|
12664
|
+
if (response.flowStatus === EmbeddedFlowStatus3.Complete) {
|
|
12665
|
+
onComplete?.(response);
|
|
12666
|
+
return;
|
|
12667
|
+
}
|
|
12668
|
+
if (response.flowStatus === EmbeddedFlowStatus3.Incomplete) {
|
|
12669
|
+
setupFormFields(response);
|
|
12670
|
+
}
|
|
12671
|
+
} catch (err) {
|
|
12672
|
+
handleError(err);
|
|
12673
|
+
onError?.(err);
|
|
12674
|
+
} finally {
|
|
12675
|
+
setIsLoading(false);
|
|
12676
|
+
}
|
|
12677
|
+
})();
|
|
12678
|
+
}
|
|
12679
|
+
}, [
|
|
12680
|
+
clearMessages,
|
|
12681
|
+
handleError,
|
|
12682
|
+
isFlowInitialized,
|
|
12683
|
+
isInitialized,
|
|
12684
|
+
onComplete,
|
|
12685
|
+
onError,
|
|
12686
|
+
onFlowChange,
|
|
12687
|
+
onInitialize,
|
|
12688
|
+
setupFormFields
|
|
12689
|
+
]);
|
|
12690
|
+
if (children) {
|
|
12691
|
+
return /* @__PURE__ */ jsx88("div", { className: containerClasses, children });
|
|
12692
|
+
}
|
|
12693
|
+
if (!isFlowInitialized && isLoading) {
|
|
12694
|
+
return /* @__PURE__ */ jsx88(Card_default, { className: cx26(containerClasses, styles.card), variant, children: /* @__PURE__ */ jsx88(Card_default.Content, { children: /* @__PURE__ */ jsx88("div", { className: styles.loadingContainer, children: /* @__PURE__ */ jsx88(Spinner_default, { size: "medium" }) }) }) });
|
|
12695
|
+
}
|
|
12696
|
+
if (!currentFlow) {
|
|
12697
|
+
return /* @__PURE__ */ jsx88(Card_default, { className: cx26(containerClasses, styles.card), variant, children: /* @__PURE__ */ jsx88(Card_default.Content, { children: /* @__PURE__ */ jsxs37(Alert_default, { variant: "error", className: errorClasses, children: [
|
|
12698
|
+
/* @__PURE__ */ jsx88(Alert_default.Title, { children: t("errors.heading") }),
|
|
12699
|
+
/* @__PURE__ */ jsx88(Alert_default.Description, { children: t("errors.recovery.flow.initialization.failure") })
|
|
12700
|
+
] }) }) });
|
|
12701
|
+
}
|
|
12702
|
+
return /* @__PURE__ */ jsxs37(Card_default, { className: cx26(containerClasses, styles.card), variant, children: [
|
|
12703
|
+
(showTitle || showSubtitle) && /* @__PURE__ */ jsxs37(Card_default.Header, { className: styles.header, children: [
|
|
12704
|
+
showTitle && /* @__PURE__ */ jsx88(Card_default.Title, { level: 2, className: styles.title, children: flowTitle || t("recovery.heading") }),
|
|
12705
|
+
showSubtitle && /* @__PURE__ */ jsx88(Typography_default, { variant: "body1", className: styles.subtitle, children: flowSubtitle || t("recovery.subheading") })
|
|
12706
|
+
] }),
|
|
12707
|
+
/* @__PURE__ */ jsxs37(Card_default.Content, { children: [
|
|
12708
|
+
flowMessages && flowMessages.length > 0 && /* @__PURE__ */ jsx88("div", { className: styles.flowMessagesContainer, children: flowMessages.map((message, index) => /* @__PURE__ */ jsx88(
|
|
12709
|
+
Alert_default,
|
|
12710
|
+
{
|
|
12711
|
+
variant: message.type?.toLowerCase() === "error" ? "error" : "info",
|
|
12712
|
+
className: cx26(styles.flowMessageItem, messageClasses),
|
|
12713
|
+
children: /* @__PURE__ */ jsx88(Alert_default.Description, { children: message.message })
|
|
12714
|
+
},
|
|
12715
|
+
message.id || index
|
|
12716
|
+
)) }),
|
|
12717
|
+
/* @__PURE__ */ jsx88("div", { className: styles.contentContainer, children: currentFlow.data?.components && currentFlow.data.components.length > 0 ? renderComponents(currentFlow.data.components) : /* @__PURE__ */ jsx88(Alert_default, { variant: "warning", children: /* @__PURE__ */ jsx88(Typography_default, { variant: "body1", children: t("errors.recovery.components.not.available") }) }) })
|
|
12718
|
+
] })
|
|
12719
|
+
] });
|
|
12720
|
+
};
|
|
12721
|
+
var BaseRecovery = ({
|
|
12722
|
+
showLogo = true,
|
|
12723
|
+
...rest
|
|
12724
|
+
}) => {
|
|
12725
|
+
const { theme, colorScheme } = useTheme_default();
|
|
12726
|
+
const styles = BaseSignUp_styles_default(theme, colorScheme);
|
|
12727
|
+
return /* @__PURE__ */ jsxs37("div", { children: [
|
|
12728
|
+
showLogo && /* @__PURE__ */ jsx88("div", { className: styles.logoContainer, children: /* @__PURE__ */ jsx88(Logo_default, { size: "large" }) }),
|
|
12729
|
+
/* @__PURE__ */ jsx88(FlowProvider_default, { children: /* @__PURE__ */ jsx88(BaseRecoveryContent, { showLogo, ...rest }) })
|
|
12730
|
+
] });
|
|
12731
|
+
};
|
|
12732
|
+
var BaseRecovery_default = BaseRecovery;
|
|
12733
|
+
|
|
12734
|
+
// src/components/presentation/auth/Recovery/v2/BaseRecovery.tsx
|
|
12735
|
+
import {
|
|
12736
|
+
EmbeddedFlowStatus as EmbeddedFlowStatus4,
|
|
12737
|
+
EmbeddedFlowComponentTypeV2 as EmbeddedFlowComponentType7,
|
|
12738
|
+
withVendorCSSClassPrefix as withVendorCSSClassPrefix26
|
|
12739
|
+
} from "@asgardeo/browser";
|
|
12740
|
+
import { cx as cx27 } from "@emotion/css";
|
|
12741
|
+
import { useContext as useContext13, useEffect as useEffect22, useState as useState24, useCallback as useCallback17, useRef as useRef11 } from "react";
|
|
12742
|
+
import { jsx as jsx89, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
12743
|
+
var BaseRecoveryContent2 = ({
|
|
12744
|
+
onInitialize,
|
|
12745
|
+
onSubmit,
|
|
12746
|
+
onError,
|
|
12747
|
+
onFlowChange,
|
|
12748
|
+
onComplete,
|
|
12749
|
+
error: externalError,
|
|
12750
|
+
className = "",
|
|
12751
|
+
inputClassName = "",
|
|
12752
|
+
buttonClassName = "",
|
|
12753
|
+
errorClassName = "",
|
|
12754
|
+
messageClassName = "",
|
|
12755
|
+
size = "medium",
|
|
12756
|
+
variant = "outlined",
|
|
12757
|
+
isInitialized,
|
|
12758
|
+
children,
|
|
12759
|
+
showTitle = true,
|
|
12760
|
+
showSubtitle = true
|
|
12761
|
+
}) => {
|
|
12762
|
+
const { theme, colorScheme } = useTheme_default();
|
|
12763
|
+
const customRenderers = useContext13(ComponentRendererContext_default);
|
|
12764
|
+
const { t } = useTranslation_default();
|
|
12765
|
+
const { subtitle: flowSubtitle, title: flowTitle, messages: flowMessages, addMessage, clearMessages } = useFlow_default();
|
|
12766
|
+
const { meta } = useAsgardeo_default();
|
|
12767
|
+
const styles = BaseSignUp_styles_default(theme, colorScheme);
|
|
12768
|
+
const [isLoading, setIsLoading] = useState24(false);
|
|
12769
|
+
const [isFlowInitialized, setIsFlowInitialized] = useState24(false);
|
|
12770
|
+
const [currentFlow, setCurrentFlow] = useState24(null);
|
|
12771
|
+
const [apiError, setApiError] = useState24(null);
|
|
12772
|
+
const initializationAttemptedRef = useRef11(false);
|
|
12773
|
+
const challengeTokenRef = useRef11(null);
|
|
12774
|
+
const handleError = useCallback17(
|
|
12775
|
+
(error) => {
|
|
12776
|
+
const errorMessage = error?.failureReason || extractErrorMessage(error, t);
|
|
12777
|
+
setApiError(error instanceof Error ? error : new Error(errorMessage));
|
|
12778
|
+
clearMessages();
|
|
12779
|
+
addMessage({ message: errorMessage, type: "error" });
|
|
12780
|
+
},
|
|
12781
|
+
[t, addMessage, clearMessages]
|
|
12782
|
+
);
|
|
12783
|
+
const normalizeFlowResponseLocal = useCallback17(
|
|
12784
|
+
(response) => {
|
|
12785
|
+
if (response?.data?.components && Array.isArray(response.data.components)) {
|
|
12786
|
+
return response;
|
|
12787
|
+
}
|
|
12788
|
+
if (response?.data) {
|
|
12789
|
+
const { components } = normalizeFlowResponse(
|
|
12790
|
+
response,
|
|
12791
|
+
t,
|
|
12792
|
+
{ defaultErrorKey: "components.recovery.errors.generic", resolveTranslations: false },
|
|
12793
|
+
meta
|
|
12794
|
+
);
|
|
12795
|
+
return { ...response, data: { ...response.data, components } };
|
|
12796
|
+
}
|
|
12797
|
+
return response;
|
|
12798
|
+
},
|
|
12799
|
+
[t, meta]
|
|
12800
|
+
);
|
|
12801
|
+
const extractFormFields = useCallback17(
|
|
12802
|
+
(components) => {
|
|
12803
|
+
const fields = [];
|
|
12804
|
+
const processComponents = (comps) => {
|
|
12805
|
+
comps.forEach((component) => {
|
|
12806
|
+
if (component.type === EmbeddedFlowComponentType7.TextInput || component.type === EmbeddedFlowComponentType7.PasswordInput || component.type === EmbeddedFlowComponentType7.EmailInput || component.type === EmbeddedFlowComponentType7.Select) {
|
|
12807
|
+
const fieldName = component.ref || component.id;
|
|
12808
|
+
fields.push({
|
|
12809
|
+
initialValue: "",
|
|
12810
|
+
name: fieldName,
|
|
12811
|
+
required: component.required || false,
|
|
12812
|
+
validator: (value) => {
|
|
12813
|
+
if (component.required && (!value || value.trim() === "")) {
|
|
12814
|
+
return t("validations.required.field.error");
|
|
12815
|
+
}
|
|
12816
|
+
if ((component.type === EmbeddedFlowComponentType7.EmailInput || component.variant === "EMAIL") && value && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value)) {
|
|
12817
|
+
return t("field.email.invalid");
|
|
12818
|
+
}
|
|
12819
|
+
return null;
|
|
12820
|
+
}
|
|
12821
|
+
});
|
|
12822
|
+
}
|
|
12823
|
+
if (component.components && Array.isArray(component.components)) {
|
|
12824
|
+
processComponents(component.components);
|
|
12825
|
+
}
|
|
12826
|
+
});
|
|
12827
|
+
};
|
|
12828
|
+
processComponents(components);
|
|
12829
|
+
return fields;
|
|
12830
|
+
},
|
|
12831
|
+
[t]
|
|
12832
|
+
);
|
|
12833
|
+
const formFields = currentFlow?.data?.components ? extractFormFields(currentFlow.data.components) : [];
|
|
12834
|
+
const form = useForm({
|
|
12835
|
+
fields: formFields,
|
|
12836
|
+
initialValues: {},
|
|
12837
|
+
requiredMessage: t("validations.required.field.error"),
|
|
12838
|
+
validateOnBlur: true,
|
|
12839
|
+
validateOnChange: false
|
|
12840
|
+
});
|
|
12841
|
+
const {
|
|
12842
|
+
values: formValues,
|
|
12843
|
+
touched: touchedFields,
|
|
12844
|
+
errors: formErrors,
|
|
12845
|
+
isValid: isFormValid,
|
|
12846
|
+
setValue: setFormValue,
|
|
12847
|
+
setTouched: setFormTouched,
|
|
12848
|
+
validateForm,
|
|
12849
|
+
touchAllFields,
|
|
12850
|
+
reset: resetForm
|
|
12851
|
+
} = form;
|
|
12852
|
+
const setupFormFields = useCallback17(
|
|
12853
|
+
(flowResponse) => {
|
|
12854
|
+
const fields = extractFormFields(flowResponse.data?.components || []);
|
|
12855
|
+
const initialValues = {};
|
|
12856
|
+
fields.forEach((field) => {
|
|
12857
|
+
initialValues[field.name] = field.initialValue || "";
|
|
12858
|
+
});
|
|
12859
|
+
resetForm();
|
|
12860
|
+
Object.keys(initialValues).forEach((key) => setFormValue(key, initialValues[key]));
|
|
12861
|
+
},
|
|
12862
|
+
[extractFormFields, resetForm, setFormValue]
|
|
12863
|
+
);
|
|
12864
|
+
const handleInputChange = (name, value) => {
|
|
12865
|
+
setFormValue(name, value);
|
|
12866
|
+
};
|
|
12867
|
+
const handleInputBlur = (name) => {
|
|
12868
|
+
setFormTouched(name, true);
|
|
12869
|
+
};
|
|
12870
|
+
const handleSubmit = async (component, data, skipValidation) => {
|
|
12871
|
+
if (!currentFlow) return;
|
|
12872
|
+
if (!skipValidation) {
|
|
12873
|
+
touchAllFields();
|
|
12874
|
+
const validation = validateForm();
|
|
12875
|
+
if (!validation.isValid) return;
|
|
12876
|
+
}
|
|
12877
|
+
setIsLoading(true);
|
|
12878
|
+
setApiError(null);
|
|
12879
|
+
clearMessages();
|
|
12880
|
+
try {
|
|
12881
|
+
const filteredInputs = {};
|
|
12882
|
+
if (data) {
|
|
12883
|
+
Object.entries(data).forEach(([key, value]) => {
|
|
12884
|
+
if (value !== null && value !== void 0 && value !== "") {
|
|
12885
|
+
filteredInputs[key] = value;
|
|
12886
|
+
}
|
|
12887
|
+
});
|
|
12888
|
+
}
|
|
12889
|
+
const payload = {
|
|
12890
|
+
...currentFlow.executionId && { executionId: currentFlow.executionId },
|
|
12891
|
+
flowType: currentFlow.flowType || "RECOVERY",
|
|
12892
|
+
...component.id && { action: component.id },
|
|
12893
|
+
...challengeTokenRef.current ? { challengeToken: challengeTokenRef.current } : {},
|
|
12894
|
+
inputs: filteredInputs
|
|
12895
|
+
};
|
|
12896
|
+
const rawResponse = await onSubmit?.(payload);
|
|
12897
|
+
if (!rawResponse) return;
|
|
12898
|
+
const response = normalizeFlowResponseLocal(rawResponse);
|
|
12899
|
+
onFlowChange?.(response);
|
|
12900
|
+
if (response.challengeToken !== void 0) {
|
|
12901
|
+
challengeTokenRef.current = response.challengeToken ?? null;
|
|
12902
|
+
}
|
|
12903
|
+
if (response.flowStatus === EmbeddedFlowStatus4.Complete) {
|
|
12904
|
+
onComplete?.(response);
|
|
12905
|
+
return;
|
|
12906
|
+
}
|
|
12907
|
+
if (response.flowStatus === EmbeddedFlowStatus4.Incomplete) {
|
|
12908
|
+
setCurrentFlow(response);
|
|
12909
|
+
setupFormFields(response);
|
|
12910
|
+
}
|
|
12911
|
+
} catch (err) {
|
|
12912
|
+
handleError(err);
|
|
12913
|
+
onError?.(err);
|
|
12914
|
+
} finally {
|
|
12915
|
+
setIsLoading(false);
|
|
12916
|
+
}
|
|
12917
|
+
};
|
|
12918
|
+
const containerClasses = cx27(
|
|
12919
|
+
[
|
|
12920
|
+
withVendorCSSClassPrefix26("recovery"),
|
|
12921
|
+
withVendorCSSClassPrefix26(`recovery--${size}`),
|
|
12922
|
+
withVendorCSSClassPrefix26(`recovery--${variant}`)
|
|
12923
|
+
],
|
|
12924
|
+
className
|
|
12925
|
+
);
|
|
12926
|
+
const inputClasses = cx27(
|
|
12927
|
+
[
|
|
12928
|
+
withVendorCSSClassPrefix26("recovery__input"),
|
|
12929
|
+
size === "small" && withVendorCSSClassPrefix26("recovery__input--small"),
|
|
12930
|
+
size === "large" && withVendorCSSClassPrefix26("recovery__input--large")
|
|
12931
|
+
],
|
|
12932
|
+
inputClassName
|
|
12933
|
+
);
|
|
12934
|
+
const buttonClasses = cx27(
|
|
12935
|
+
[
|
|
12936
|
+
withVendorCSSClassPrefix26("recovery__button"),
|
|
12937
|
+
size === "small" && withVendorCSSClassPrefix26("recovery__button--small"),
|
|
12938
|
+
size === "large" && withVendorCSSClassPrefix26("recovery__button--large")
|
|
12939
|
+
],
|
|
12940
|
+
buttonClassName
|
|
12941
|
+
);
|
|
12942
|
+
const errorClasses = cx27([withVendorCSSClassPrefix26("recovery__error")], errorClassName);
|
|
12943
|
+
const messageClasses = cx27([withVendorCSSClassPrefix26("recovery__messages")], messageClassName);
|
|
12944
|
+
const renderComponents = useCallback17(
|
|
12945
|
+
(components) => renderRecoveryComponents(
|
|
12946
|
+
components,
|
|
12947
|
+
formValues,
|
|
12948
|
+
touchedFields,
|
|
12949
|
+
formErrors,
|
|
12950
|
+
isLoading,
|
|
12951
|
+
isFormValid,
|
|
12952
|
+
handleInputChange,
|
|
12953
|
+
{
|
|
12954
|
+
_customRenderers: customRenderers,
|
|
12955
|
+
_theme: theme,
|
|
12956
|
+
buttonClassName: buttonClasses,
|
|
12957
|
+
inputClassName: inputClasses,
|
|
12958
|
+
meta,
|
|
12959
|
+
onInputBlur: handleInputBlur,
|
|
12960
|
+
onSubmit: handleSubmit,
|
|
12961
|
+
size,
|
|
12962
|
+
variant
|
|
12963
|
+
}
|
|
12964
|
+
),
|
|
12965
|
+
[
|
|
12966
|
+
customRenderers,
|
|
12967
|
+
buttonClasses,
|
|
12968
|
+
formErrors,
|
|
12969
|
+
formValues,
|
|
12970
|
+
handleInputBlur,
|
|
12971
|
+
handleSubmit,
|
|
12972
|
+
inputClasses,
|
|
12973
|
+
isFormValid,
|
|
12974
|
+
meta,
|
|
12975
|
+
isLoading,
|
|
12976
|
+
size,
|
|
12977
|
+
theme,
|
|
12978
|
+
touchedFields,
|
|
12979
|
+
variant
|
|
12980
|
+
]
|
|
12981
|
+
);
|
|
12982
|
+
useEffect22(() => {
|
|
12983
|
+
if (isInitialized && !isFlowInitialized && !initializationAttemptedRef.current) {
|
|
12984
|
+
initializationAttemptedRef.current = true;
|
|
12985
|
+
(async () => {
|
|
12986
|
+
setIsLoading(true);
|
|
12987
|
+
setApiError(null);
|
|
12988
|
+
clearMessages();
|
|
12989
|
+
try {
|
|
12990
|
+
const rawResponse = await onInitialize?.();
|
|
12991
|
+
if (!rawResponse) return;
|
|
12992
|
+
const response = normalizeFlowResponseLocal(rawResponse);
|
|
12993
|
+
if (response.challengeToken !== void 0) {
|
|
12994
|
+
challengeTokenRef.current = response.challengeToken ?? null;
|
|
12995
|
+
}
|
|
12996
|
+
setCurrentFlow(response);
|
|
12997
|
+
setIsFlowInitialized(true);
|
|
12998
|
+
onFlowChange?.(response);
|
|
12999
|
+
if (response.flowStatus === EmbeddedFlowStatus4.Complete) {
|
|
13000
|
+
onComplete?.(response);
|
|
13001
|
+
return;
|
|
13002
|
+
}
|
|
13003
|
+
if (response.flowStatus === EmbeddedFlowStatus4.Incomplete) {
|
|
13004
|
+
setupFormFields(response);
|
|
13005
|
+
}
|
|
13006
|
+
} catch (err) {
|
|
13007
|
+
handleError(err);
|
|
13008
|
+
onError?.(err);
|
|
13009
|
+
} finally {
|
|
13010
|
+
setIsLoading(false);
|
|
13011
|
+
}
|
|
13012
|
+
})();
|
|
13013
|
+
}
|
|
13014
|
+
}, [
|
|
13015
|
+
isFlowInitialized,
|
|
13016
|
+
isInitialized,
|
|
13017
|
+
normalizeFlowResponseLocal,
|
|
13018
|
+
onComplete,
|
|
13019
|
+
onError,
|
|
13020
|
+
onFlowChange,
|
|
13021
|
+
onInitialize,
|
|
13022
|
+
setupFormFields,
|
|
13023
|
+
t
|
|
13024
|
+
]);
|
|
13025
|
+
if (children) {
|
|
13026
|
+
if (typeof children === "function") {
|
|
13027
|
+
const renderProps = {
|
|
13028
|
+
components: currentFlow?.data?.components || [],
|
|
13029
|
+
error: apiError,
|
|
13030
|
+
fieldErrors: formErrors,
|
|
13031
|
+
handleInputChange,
|
|
13032
|
+
handleSubmit,
|
|
13033
|
+
isLoading,
|
|
13034
|
+
isValid: isFormValid,
|
|
13035
|
+
messages: flowMessages || [],
|
|
13036
|
+
meta,
|
|
13037
|
+
subtitle: flowSubtitle || t("recovery.subheading"),
|
|
13038
|
+
title: flowTitle || t("recovery.heading"),
|
|
13039
|
+
touched: touchedFields,
|
|
13040
|
+
validateForm: () => {
|
|
13041
|
+
const result = validateForm();
|
|
13042
|
+
return { fieldErrors: result.errors, isValid: result.isValid };
|
|
13043
|
+
},
|
|
13044
|
+
values: formValues
|
|
13045
|
+
};
|
|
13046
|
+
return /* @__PURE__ */ jsx89("div", { className: containerClasses, children: children(renderProps) });
|
|
13047
|
+
}
|
|
13048
|
+
return /* @__PURE__ */ jsx89("div", { className: containerClasses, children });
|
|
13049
|
+
}
|
|
13050
|
+
if (!isFlowInitialized && isLoading) {
|
|
13051
|
+
return /* @__PURE__ */ jsx89(Card_default, { className: cx27(containerClasses, styles.card), variant, children: /* @__PURE__ */ jsx89(Card_default.Content, { children: /* @__PURE__ */ jsx89("div", { className: styles.loadingContainer, children: /* @__PURE__ */ jsx89(Spinner_default, { size: "medium" }) }) }) });
|
|
13052
|
+
}
|
|
13053
|
+
if (!currentFlow) {
|
|
13054
|
+
return /* @__PURE__ */ jsx89(Card_default, { className: cx27(containerClasses, styles.card), variant, children: /* @__PURE__ */ jsx89(Card_default.Content, { children: /* @__PURE__ */ jsxs38(Alert_default, { variant: "error", className: errorClasses, children: [
|
|
13055
|
+
/* @__PURE__ */ jsx89(Alert_default.Title, { children: t("errors.heading") }),
|
|
13056
|
+
/* @__PURE__ */ jsx89(Alert_default.Description, { children: t("errors.recovery.flow.initialization.failure") })
|
|
13057
|
+
] }) }) });
|
|
13058
|
+
}
|
|
13059
|
+
const componentsToRender = currentFlow.data?.components || [];
|
|
13060
|
+
const { title, subtitle, componentsWithoutHeadings } = getAuthComponentHeadings_default(
|
|
13061
|
+
componentsToRender,
|
|
13062
|
+
flowTitle,
|
|
13063
|
+
flowSubtitle,
|
|
13064
|
+
t("recovery.heading"),
|
|
13065
|
+
t("recovery.subheading")
|
|
13066
|
+
);
|
|
13067
|
+
return /* @__PURE__ */ jsxs38(Card_default, { className: cx27(containerClasses, styles.card), variant, children: [
|
|
13068
|
+
(showTitle || showSubtitle) && /* @__PURE__ */ jsxs38(Card_default.Header, { className: styles.header, children: [
|
|
13069
|
+
showTitle && /* @__PURE__ */ jsx89(Card_default.Title, { level: 2, className: styles.title, children: title }),
|
|
13070
|
+
showSubtitle && /* @__PURE__ */ jsx89(Typography_default, { variant: "body1", className: styles.subtitle, children: subtitle })
|
|
13071
|
+
] }),
|
|
13072
|
+
/* @__PURE__ */ jsxs38(Card_default.Content, { children: [
|
|
13073
|
+
externalError && /* @__PURE__ */ jsx89("div", { className: styles.flowMessagesContainer, children: /* @__PURE__ */ jsx89(Alert_default, { variant: "error", className: cx27(styles.flowMessageItem, messageClasses), children: /* @__PURE__ */ jsx89(Alert_default.Description, { children: externalError.message }) }) }),
|
|
13074
|
+
flowMessages && flowMessages.length > 0 && /* @__PURE__ */ jsx89("div", { className: styles.flowMessagesContainer, children: flowMessages.map((message, index) => /* @__PURE__ */ jsx89(
|
|
13075
|
+
Alert_default,
|
|
13076
|
+
{
|
|
13077
|
+
variant: message.type?.toLowerCase() === "error" ? "error" : "info",
|
|
13078
|
+
className: cx27(styles.flowMessageItem, messageClasses),
|
|
13079
|
+
children: /* @__PURE__ */ jsx89(Alert_default.Description, { children: message.message })
|
|
13080
|
+
},
|
|
13081
|
+
message.id || index
|
|
13082
|
+
)) }),
|
|
13083
|
+
/* @__PURE__ */ jsx89("div", { className: styles.contentContainer, children: componentsWithoutHeadings && componentsWithoutHeadings.length > 0 ? renderComponents(componentsWithoutHeadings) : /* @__PURE__ */ jsx89(Alert_default, { variant: "warning", children: /* @__PURE__ */ jsx89(Typography_default, { variant: "body1", children: t("errors.recovery.components.not.available") }) }) })
|
|
13084
|
+
] })
|
|
13085
|
+
] });
|
|
13086
|
+
};
|
|
13087
|
+
var BaseRecovery2 = ({
|
|
13088
|
+
preferences,
|
|
13089
|
+
showLogo = true,
|
|
13090
|
+
...rest
|
|
13091
|
+
}) => {
|
|
13092
|
+
const { theme, colorScheme } = useTheme_default();
|
|
13093
|
+
const styles = BaseSignUp_styles_default(theme, colorScheme);
|
|
13094
|
+
const content = /* @__PURE__ */ jsxs38("div", { children: [
|
|
13095
|
+
showLogo && /* @__PURE__ */ jsx89("div", { className: styles.logoContainer, children: /* @__PURE__ */ jsx89(Logo_default, { size: "large" }) }),
|
|
13096
|
+
/* @__PURE__ */ jsx89(FlowProvider_default, { children: /* @__PURE__ */ jsx89(BaseRecoveryContent2, { showLogo, ...rest }) })
|
|
13097
|
+
] });
|
|
13098
|
+
if (!preferences) return content;
|
|
13099
|
+
return /* @__PURE__ */ jsx89(ComponentPreferencesContext_default.Provider, { value: preferences, children: content });
|
|
13100
|
+
};
|
|
13101
|
+
var BaseRecovery_default2 = BaseRecovery2;
|
|
13102
|
+
|
|
13103
|
+
// src/components/presentation/auth/Recovery/BaseRecovery.tsx
|
|
13104
|
+
import { jsx as jsx90 } from "react/jsx-runtime";
|
|
13105
|
+
var BaseRecovery3 = (props) => {
|
|
13106
|
+
const { platform } = useAsgardeo_default();
|
|
13107
|
+
if (platform === Platform9.AsgardeoV2) {
|
|
13108
|
+
return /* @__PURE__ */ jsx90(BaseRecovery_default2, { ...props });
|
|
13109
|
+
}
|
|
13110
|
+
return /* @__PURE__ */ jsx90(BaseRecovery_default, { ...props });
|
|
13111
|
+
};
|
|
13112
|
+
var BaseRecovery_default3 = BaseRecovery3;
|
|
13113
|
+
|
|
13114
|
+
// src/components/presentation/auth/Recovery/Recovery.tsx
|
|
13115
|
+
import { Platform as Platform10 } from "@asgardeo/browser";
|
|
13116
|
+
|
|
13117
|
+
// src/components/presentation/auth/Recovery/v1/Recovery.tsx
|
|
13118
|
+
import { EmbeddedFlowType as EmbeddedFlowType4 } from "@asgardeo/browser";
|
|
13119
|
+
import { jsx as jsx91 } from "react/jsx-runtime";
|
|
13120
|
+
var Recovery = ({
|
|
13121
|
+
className,
|
|
13122
|
+
size = "medium",
|
|
13123
|
+
afterRecoveryUrl,
|
|
13124
|
+
onError,
|
|
13125
|
+
onComplete,
|
|
13126
|
+
children,
|
|
13127
|
+
...rest
|
|
13128
|
+
}) => {
|
|
13129
|
+
const { recover, isInitialized } = useAsgardeo_default();
|
|
13130
|
+
const handleInitialize = async (payload) => {
|
|
13131
|
+
const initialPayload = payload || { flowType: EmbeddedFlowType4.Recovery };
|
|
13132
|
+
return await recover(initialPayload);
|
|
13133
|
+
};
|
|
13134
|
+
const handleOnSubmit = async (payload) => await recover(payload);
|
|
13135
|
+
const handleComplete = (response) => {
|
|
13136
|
+
onComplete?.(response);
|
|
13137
|
+
if (afterRecoveryUrl) {
|
|
13138
|
+
window.location.href = afterRecoveryUrl;
|
|
13139
|
+
}
|
|
13140
|
+
};
|
|
13141
|
+
return /* @__PURE__ */ jsx91(
|
|
13142
|
+
BaseRecovery_default,
|
|
13143
|
+
{
|
|
13144
|
+
afterRecoveryUrl,
|
|
13145
|
+
onInitialize: handleInitialize,
|
|
13146
|
+
onSubmit: handleOnSubmit,
|
|
13147
|
+
onError,
|
|
13148
|
+
onComplete: handleComplete,
|
|
13149
|
+
className,
|
|
13150
|
+
size,
|
|
13151
|
+
isInitialized,
|
|
13152
|
+
showLogo: true,
|
|
13153
|
+
showTitle: false,
|
|
13154
|
+
showSubtitle: false,
|
|
13155
|
+
children,
|
|
13156
|
+
...rest
|
|
13157
|
+
}
|
|
13158
|
+
);
|
|
13159
|
+
};
|
|
13160
|
+
var Recovery_default = Recovery;
|
|
13161
|
+
|
|
13162
|
+
// src/components/presentation/auth/Recovery/v2/Recovery.tsx
|
|
13163
|
+
import { EmbeddedFlowType as EmbeddedFlowType5 } from "@asgardeo/browser";
|
|
13164
|
+
import { useCallback as useCallback18 } from "react";
|
|
13165
|
+
import { jsx as jsx92 } from "react/jsx-runtime";
|
|
13166
|
+
var Recovery2 = ({
|
|
13167
|
+
className,
|
|
13168
|
+
size = "medium",
|
|
13169
|
+
afterRecoveryUrl,
|
|
13170
|
+
onError,
|
|
13171
|
+
onComplete,
|
|
13172
|
+
tokenUrlParam,
|
|
13173
|
+
children,
|
|
13174
|
+
...rest
|
|
13175
|
+
}) => {
|
|
13176
|
+
const { recover, isInitialized, applicationId } = useAsgardeo_default();
|
|
13177
|
+
const handleInitialize = useCallback18(
|
|
13178
|
+
async (payload) => {
|
|
13179
|
+
const urlParams = new URL(window.location.href).searchParams;
|
|
13180
|
+
const applicationIdFromUrl = urlParams.get("applicationId");
|
|
13181
|
+
const effectiveApplicationId = applicationId ?? applicationIdFromUrl;
|
|
13182
|
+
if (tokenUrlParam) {
|
|
13183
|
+
const executionId = urlParams.get("executionId");
|
|
13184
|
+
const tokenValue = urlParams.get(tokenUrlParam);
|
|
13185
|
+
if (executionId && tokenValue) {
|
|
13186
|
+
const resumePayload = {
|
|
13187
|
+
executionId,
|
|
13188
|
+
inputs: { [tokenUrlParam]: tokenValue },
|
|
13189
|
+
verbose: true
|
|
13190
|
+
};
|
|
13191
|
+
return await recover(resumePayload);
|
|
13192
|
+
}
|
|
13193
|
+
}
|
|
13194
|
+
const initialPayload = payload || {
|
|
13195
|
+
flowType: EmbeddedFlowType5.Recovery,
|
|
13196
|
+
...effectiveApplicationId && { applicationId: effectiveApplicationId }
|
|
13197
|
+
};
|
|
13198
|
+
return await recover(initialPayload);
|
|
13199
|
+
},
|
|
13200
|
+
[applicationId, tokenUrlParam, recover]
|
|
13201
|
+
);
|
|
13202
|
+
const handleOnSubmit = useCallback18(
|
|
13203
|
+
async (payload) => await recover(payload),
|
|
13204
|
+
[recover]
|
|
13205
|
+
);
|
|
13206
|
+
const handleComplete = useCallback18(
|
|
13207
|
+
(response) => {
|
|
13208
|
+
onComplete?.(response);
|
|
13209
|
+
if (afterRecoveryUrl) {
|
|
13210
|
+
window.location.href = afterRecoveryUrl;
|
|
13211
|
+
}
|
|
13212
|
+
},
|
|
13213
|
+
[onComplete, afterRecoveryUrl]
|
|
13214
|
+
);
|
|
13215
|
+
return /* @__PURE__ */ jsx92(
|
|
13216
|
+
BaseRecovery_default2,
|
|
13217
|
+
{
|
|
13218
|
+
afterRecoveryUrl,
|
|
13219
|
+
onInitialize: handleInitialize,
|
|
13220
|
+
onSubmit: handleOnSubmit,
|
|
13221
|
+
onError,
|
|
13222
|
+
onComplete: handleComplete,
|
|
13223
|
+
className,
|
|
13224
|
+
size,
|
|
13225
|
+
isInitialized,
|
|
13226
|
+
showTitle: true,
|
|
13227
|
+
showSubtitle: true,
|
|
13228
|
+
children,
|
|
13229
|
+
...rest
|
|
13230
|
+
}
|
|
13231
|
+
);
|
|
13232
|
+
};
|
|
13233
|
+
var Recovery_default2 = Recovery2;
|
|
13234
|
+
|
|
13235
|
+
// src/components/presentation/auth/Recovery/Recovery.tsx
|
|
13236
|
+
import { jsx as jsx93 } from "react/jsx-runtime";
|
|
13237
|
+
var Recovery3 = (props) => {
|
|
13238
|
+
const { platform } = useAsgardeo_default();
|
|
13239
|
+
if (platform === Platform10.AsgardeoV2) {
|
|
13240
|
+
return /* @__PURE__ */ jsx93(Recovery_default2, { ...props });
|
|
13241
|
+
}
|
|
13242
|
+
return /* @__PURE__ */ jsx93(Recovery_default, { ...props });
|
|
13243
|
+
};
|
|
13244
|
+
var Recovery_default3 = Recovery3;
|
|
13245
|
+
|
|
13246
|
+
// src/components/presentation/auth/InviteUser/v2/InviteUser.tsx
|
|
13247
|
+
import { EmbeddedFlowType as EmbeddedFlowType7, getOrganizationUnitChildren } from "@asgardeo/browser";
|
|
13248
|
+
import { useCallback as useCallback20 } from "react";
|
|
13249
|
+
|
|
13250
|
+
// src/components/presentation/auth/InviteUser/v2/BaseInviteUser.tsx
|
|
13251
|
+
import {
|
|
13252
|
+
EmbeddedFlowType as EmbeddedFlowType6,
|
|
13253
|
+
logger as logger10
|
|
13254
|
+
} from "@asgardeo/browser";
|
|
13255
|
+
import { cx as cx28 } from "@emotion/css";
|
|
13256
|
+
import { useCallback as useCallback19, useContext as useContext14, useEffect as useEffect23, useRef as useRef12, useState as useState25 } from "react";
|
|
13257
|
+
|
|
13258
|
+
// src/components/presentation/auth/InviteUser/v2/BaseInviteUser.styles.ts
|
|
13259
|
+
import { css as css23 } from "@emotion/css";
|
|
13260
|
+
import { useMemo as useMemo30 } from "react";
|
|
13261
|
+
var useStyles22 = (theme, colorScheme) => useMemo30(() => {
|
|
13262
|
+
const card = css23`
|
|
13263
|
+
background: ${theme.vars.colors.background.surface};
|
|
13264
|
+
border-radius: ${theme.vars.borderRadius.large};
|
|
13265
|
+
gap: calc(${theme.vars.spacing.unit} * 2);
|
|
13266
|
+
min-width: 420px;
|
|
13267
|
+
font-family: ${theme.vars.typography.fontFamily};
|
|
13268
|
+
`;
|
|
13269
|
+
const header = css23`
|
|
13270
|
+
gap: 0;
|
|
13271
|
+
align-items: center;
|
|
13272
|
+
`;
|
|
13273
|
+
const title = css23`
|
|
13274
|
+
margin: 0 0 calc(${theme.vars.spacing.unit} * 1) 0;
|
|
13275
|
+
color: ${theme.vars.colors.text.primary};
|
|
13276
|
+
`;
|
|
13277
|
+
const subtitle = css23`
|
|
13278
|
+
margin-bottom: calc(${theme.vars.spacing.unit} * 1);
|
|
13279
|
+
color: ${theme.vars.colors.text.secondary};
|
|
13280
|
+
`;
|
|
13281
|
+
return {
|
|
13282
|
+
card,
|
|
13283
|
+
header,
|
|
13284
|
+
subtitle,
|
|
13285
|
+
title
|
|
13286
|
+
};
|
|
13287
|
+
}, [
|
|
13288
|
+
theme.vars.colors.background.surface,
|
|
13289
|
+
theme.vars.colors.text.primary,
|
|
13290
|
+
theme.vars.colors.text.secondary,
|
|
13291
|
+
theme.vars.borderRadius.large,
|
|
13292
|
+
theme.vars.spacing.unit,
|
|
13293
|
+
theme.vars.typography.fontFamily,
|
|
13294
|
+
colorScheme
|
|
13295
|
+
]);
|
|
13296
|
+
var BaseInviteUser_styles_default = useStyles22;
|
|
13297
|
+
|
|
13298
|
+
// src/components/presentation/auth/InviteUser/v2/BaseInviteUser.tsx
|
|
13299
|
+
import { jsx as jsx94, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
13300
|
+
var BaseInviteUser = ({
|
|
13301
|
+
onInitialize,
|
|
13302
|
+
onSubmit,
|
|
13303
|
+
onError,
|
|
13304
|
+
onFlowChange,
|
|
13305
|
+
className = "",
|
|
13306
|
+
children,
|
|
13307
|
+
fetchOrganizationUnitChildren,
|
|
13308
|
+
isInitialized = true,
|
|
13309
|
+
preferences,
|
|
13310
|
+
size = "medium",
|
|
13311
|
+
variant = "outlined",
|
|
13312
|
+
showTitle = true,
|
|
13313
|
+
showSubtitle = true
|
|
13314
|
+
}) => {
|
|
13315
|
+
const { meta, isInitialized: isSdkInitialized, getStorageManager } = useAsgardeo_default();
|
|
13316
|
+
const { t } = useTranslation_default(preferences?.i18n);
|
|
13317
|
+
const { theme } = useTheme_default();
|
|
13318
|
+
const customRenderers = useContext14(ComponentRendererContext_default);
|
|
13319
|
+
const styles = BaseInviteUser_styles_default(theme, theme.vars.colors.text.primary);
|
|
13320
|
+
const [isLoading, setIsLoading] = useState25(false);
|
|
13321
|
+
const [isFlowInitialized, setIsFlowInitialized] = useState25(false);
|
|
13322
|
+
const [currentFlow, setCurrentFlow] = useState25(null);
|
|
13323
|
+
const [apiError, setApiError] = useState25(null);
|
|
13324
|
+
const [formValues, setFormValues] = useState25({});
|
|
13325
|
+
const [formErrors, setFormErrors] = useState25({});
|
|
13326
|
+
const [touchedFields, setTouchedFields] = useState25({});
|
|
13327
|
+
const [isFormValid, setIsFormValid] = useState25(true);
|
|
13328
|
+
const challengeTokenRef = useRef12(null);
|
|
13329
|
+
const initializationAttemptedRef = useRef12(false);
|
|
13330
|
+
useEffect23(() => {
|
|
13331
|
+
if (!isSdkInitialized) return;
|
|
13332
|
+
(async () => {
|
|
13333
|
+
try {
|
|
13334
|
+
const storageManager = await getStorageManager();
|
|
13335
|
+
const tempData = await storageManager?.getTemporaryData();
|
|
13336
|
+
if (tempData?.challengeToken) {
|
|
13337
|
+
challengeTokenRef.current = tempData.challengeToken;
|
|
13338
|
+
}
|
|
13339
|
+
} catch {
|
|
13340
|
+
}
|
|
13341
|
+
})();
|
|
13342
|
+
}, [isSdkInitialized]);
|
|
13343
|
+
const setChallengeToken = async (challengeToken) => {
|
|
13344
|
+
challengeTokenRef.current = challengeToken;
|
|
13345
|
+
try {
|
|
13346
|
+
const storageManager = await getStorageManager();
|
|
13347
|
+
if (storageManager) {
|
|
13348
|
+
if (challengeToken) {
|
|
13349
|
+
await storageManager.setTemporaryDataParameter("challengeToken", challengeToken);
|
|
13350
|
+
} else {
|
|
13351
|
+
await storageManager.removeTemporaryDataParameter("challengeToken");
|
|
13352
|
+
}
|
|
13353
|
+
}
|
|
13354
|
+
} catch {
|
|
13355
|
+
logger10.warn("Failed to persist challenge token in storage.");
|
|
13356
|
+
}
|
|
13357
|
+
};
|
|
13358
|
+
const handleError = useCallback19(
|
|
13359
|
+
(error) => {
|
|
13360
|
+
const errorMessage = error?.failureReason || extractErrorMessage(error, t, "components.inviteUser.errors.generic");
|
|
13361
|
+
setApiError(error instanceof Error ? error : new Error(errorMessage));
|
|
13362
|
+
onError?.(error instanceof Error ? error : new Error(errorMessage));
|
|
13363
|
+
},
|
|
13364
|
+
[t, onError]
|
|
13365
|
+
);
|
|
13366
|
+
const normalizeFlowResponseLocal = useCallback19(
|
|
13367
|
+
(response) => {
|
|
13368
|
+
if (!response?.data?.meta?.components) {
|
|
13369
|
+
return response;
|
|
13370
|
+
}
|
|
13371
|
+
try {
|
|
13372
|
+
const { components: components2 } = normalizeFlowResponse(
|
|
13373
|
+
response,
|
|
13374
|
+
t,
|
|
13375
|
+
{
|
|
13376
|
+
defaultErrorKey: "components.inviteUser.errors.generic",
|
|
13377
|
+
resolveTranslations: false
|
|
13378
|
+
},
|
|
13379
|
+
meta
|
|
13380
|
+
);
|
|
13381
|
+
return {
|
|
13382
|
+
...response,
|
|
13383
|
+
data: {
|
|
13384
|
+
...response.data,
|
|
13385
|
+
components: components2
|
|
13386
|
+
}
|
|
13387
|
+
};
|
|
13388
|
+
} catch {
|
|
13389
|
+
return response;
|
|
13390
|
+
}
|
|
13391
|
+
},
|
|
13392
|
+
[t, children]
|
|
13393
|
+
);
|
|
13394
|
+
const handleInputChange = useCallback19((name, value) => {
|
|
13395
|
+
setFormValues((prev) => ({ ...prev, [name]: value }));
|
|
13396
|
+
setFormErrors((prev) => {
|
|
13397
|
+
const newErrors = { ...prev };
|
|
13398
|
+
delete newErrors[name];
|
|
13399
|
+
return newErrors;
|
|
13400
|
+
});
|
|
13401
|
+
}, []);
|
|
13402
|
+
const handleInputBlur = useCallback19((name) => {
|
|
13403
|
+
setTouchedFields((prev) => ({ ...prev, [name]: true }));
|
|
13404
|
+
}, []);
|
|
13405
|
+
const validateForm = useCallback19(
|
|
13406
|
+
(components2) => {
|
|
13407
|
+
const errors = {};
|
|
13408
|
+
const validateComponents = (comps) => {
|
|
13409
|
+
comps.forEach((comp) => {
|
|
13410
|
+
if ((comp.type === "TEXT_INPUT" || comp.type === "EMAIL_INPUT" || comp.type === "SELECT" || comp.type === "PHONE_INPUT" || comp.type === "OTP_INPUT") && comp.required && comp.ref) {
|
|
13411
|
+
const value = formValues[comp.ref];
|
|
13412
|
+
if (!value || value.trim() === "") {
|
|
13413
|
+
errors[comp.ref] = `${comp.label || comp.ref} is required`;
|
|
13414
|
+
}
|
|
13415
|
+
if (comp.type === "EMAIL_INPUT" && value && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value)) {
|
|
13416
|
+
errors[comp.ref] = "Please enter a valid email address";
|
|
13417
|
+
}
|
|
13418
|
+
}
|
|
13419
|
+
if (comp.components && Array.isArray(comp.components)) {
|
|
12460
13420
|
validateComponents(comp.components);
|
|
12461
13421
|
}
|
|
12462
13422
|
});
|
|
@@ -12466,7 +13426,7 @@ var BaseInviteUser = ({
|
|
|
12466
13426
|
},
|
|
12467
13427
|
[formValues]
|
|
12468
13428
|
);
|
|
12469
|
-
const handleSubmit =
|
|
13429
|
+
const handleSubmit = useCallback19(
|
|
12470
13430
|
async (component, data) => {
|
|
12471
13431
|
if (!currentFlow) {
|
|
12472
13432
|
return;
|
|
@@ -12517,7 +13477,7 @@ var BaseInviteUser = ({
|
|
|
12517
13477
|
},
|
|
12518
13478
|
[currentFlow, formValues, validateForm, onSubmit, onFlowChange, handleError, normalizeFlowResponseLocal]
|
|
12519
13479
|
);
|
|
12520
|
-
const resetFlow =
|
|
13480
|
+
const resetFlow = useCallback19(() => {
|
|
12521
13481
|
setIsFlowInitialized(false);
|
|
12522
13482
|
setCurrentFlow(null);
|
|
12523
13483
|
setApiError(null);
|
|
@@ -12526,7 +13486,7 @@ var BaseInviteUser = ({
|
|
|
12526
13486
|
setTouchedFields({});
|
|
12527
13487
|
initializationAttemptedRef.current = false;
|
|
12528
13488
|
}, []);
|
|
12529
|
-
|
|
13489
|
+
useEffect23(() => {
|
|
12530
13490
|
if (isInitialized && !isFlowInitialized && !initializationAttemptedRef.current) {
|
|
12531
13491
|
initializationAttemptedRef.current = true;
|
|
12532
13492
|
(async () => {
|
|
@@ -12534,7 +13494,7 @@ var BaseInviteUser = ({
|
|
|
12534
13494
|
setApiError(null);
|
|
12535
13495
|
try {
|
|
12536
13496
|
const payload = {
|
|
12537
|
-
flowType:
|
|
13497
|
+
flowType: EmbeddedFlowType6.UserOnboarding,
|
|
12538
13498
|
verbose: true
|
|
12539
13499
|
};
|
|
12540
13500
|
const rawResponse = await onInitialize(payload);
|
|
@@ -12554,7 +13514,7 @@ var BaseInviteUser = ({
|
|
|
12554
13514
|
})();
|
|
12555
13515
|
}
|
|
12556
13516
|
}, [isInitialized, isFlowInitialized, onInitialize, onFlowChange, handleError, normalizeFlowResponseLocal]);
|
|
12557
|
-
|
|
13517
|
+
useEffect23(() => {
|
|
12558
13518
|
if (currentFlow && isFlowInitialized) {
|
|
12559
13519
|
const components2 = currentFlow.data?.components || [];
|
|
12560
13520
|
if (components2.length > 0) {
|
|
@@ -12563,7 +13523,7 @@ var BaseInviteUser = ({
|
|
|
12563
13523
|
}
|
|
12564
13524
|
}
|
|
12565
13525
|
}, [formValues, currentFlow, isFlowInitialized, validateForm]);
|
|
12566
|
-
const extractHeadings =
|
|
13526
|
+
const extractHeadings = useCallback19((components2) => {
|
|
12567
13527
|
let title2;
|
|
12568
13528
|
let subtitle2;
|
|
12569
13529
|
components2.forEach((comp) => {
|
|
@@ -12577,13 +13537,13 @@ var BaseInviteUser = ({
|
|
|
12577
13537
|
});
|
|
12578
13538
|
return { subtitle: subtitle2, title: title2 };
|
|
12579
13539
|
}, []);
|
|
12580
|
-
const filterHeadings =
|
|
13540
|
+
const filterHeadings = useCallback19(
|
|
12581
13541
|
(components2) => components2.filter(
|
|
12582
13542
|
(comp) => !(comp.type === "TEXT" && (comp.variant === "HEADING_1" || comp.variant === "HEADING_2"))
|
|
12583
13543
|
),
|
|
12584
13544
|
[]
|
|
12585
13545
|
);
|
|
12586
|
-
const renderComponents =
|
|
13546
|
+
const renderComponents = useCallback19(
|
|
12587
13547
|
(components2) => renderInviteUserComponents(
|
|
12588
13548
|
components2,
|
|
12589
13549
|
formValues,
|
|
@@ -12642,30 +13602,30 @@ var BaseInviteUser = ({
|
|
|
12642
13602
|
values: formValues
|
|
12643
13603
|
};
|
|
12644
13604
|
if (children) {
|
|
12645
|
-
return /* @__PURE__ */
|
|
13605
|
+
return /* @__PURE__ */ jsx94("div", { className, children: children(renderProps) });
|
|
12646
13606
|
}
|
|
12647
13607
|
if (!isInitialized) {
|
|
12648
|
-
return /* @__PURE__ */
|
|
13608
|
+
return /* @__PURE__ */ jsx94(Card_default, { className: cx28(className, styles.card), variant, children: /* @__PURE__ */ jsx94(Card_default.Content, { children: /* @__PURE__ */ jsx94("div", { style: { display: "flex", justifyContent: "center", padding: "2rem" }, children: /* @__PURE__ */ jsx94(Spinner_default, { size: "medium" }) }) }) });
|
|
12649
13609
|
}
|
|
12650
13610
|
if (!isFlowInitialized && isLoading) {
|
|
12651
|
-
return /* @__PURE__ */
|
|
13611
|
+
return /* @__PURE__ */ jsx94(Card_default, { className: cx28(className, styles.card), variant, children: /* @__PURE__ */ jsx94(Card_default.Content, { children: /* @__PURE__ */ jsx94("div", { style: { display: "flex", justifyContent: "center", padding: "2rem" }, children: /* @__PURE__ */ jsx94(Spinner_default, { size: "medium" }) }) }) });
|
|
12652
13612
|
}
|
|
12653
13613
|
if (!currentFlow && apiError) {
|
|
12654
|
-
return /* @__PURE__ */
|
|
12655
|
-
/* @__PURE__ */
|
|
12656
|
-
/* @__PURE__ */
|
|
13614
|
+
return /* @__PURE__ */ jsx94(Card_default, { className: cx28(className, styles.card), variant, children: /* @__PURE__ */ jsx94(Card_default.Content, { children: /* @__PURE__ */ jsxs39(Alert_default, { variant: "error", children: [
|
|
13615
|
+
/* @__PURE__ */ jsx94(Alert_default.Title, { children: "Error" }),
|
|
13616
|
+
/* @__PURE__ */ jsx94(Alert_default.Description, { children: apiError.message })
|
|
12657
13617
|
] }) }) });
|
|
12658
13618
|
}
|
|
12659
|
-
return /* @__PURE__ */
|
|
12660
|
-
(showTitle || showSubtitle) && (title || subtitle) && /* @__PURE__ */
|
|
12661
|
-
showTitle && title && /* @__PURE__ */
|
|
12662
|
-
showSubtitle && subtitle && /* @__PURE__ */
|
|
13619
|
+
return /* @__PURE__ */ jsxs39(Card_default, { className: cx28(className, styles.card), variant, children: [
|
|
13620
|
+
(showTitle || showSubtitle) && (title || subtitle) && /* @__PURE__ */ jsxs39(Card_default.Header, { className: styles.header, children: [
|
|
13621
|
+
showTitle && title && /* @__PURE__ */ jsx94(Card_default.Title, { level: 2, className: styles.title, children: title }),
|
|
13622
|
+
showSubtitle && subtitle && /* @__PURE__ */ jsx94(Typography_default, { variant: "body1", className: styles.subtitle, children: subtitle })
|
|
12663
13623
|
] }),
|
|
12664
|
-
/* @__PURE__ */
|
|
12665
|
-
apiError && /* @__PURE__ */
|
|
12666
|
-
/* @__PURE__ */
|
|
12667
|
-
componentsWithoutHeadings && componentsWithoutHeadings.length > 0 ? renderComponents(componentsWithoutHeadings) : !isLoading && /* @__PURE__ */
|
|
12668
|
-
isLoading && /* @__PURE__ */
|
|
13624
|
+
/* @__PURE__ */ jsxs39(Card_default.Content, { children: [
|
|
13625
|
+
apiError && /* @__PURE__ */ jsx94("div", { style: { marginBottom: "1rem" }, children: /* @__PURE__ */ jsx94(Alert_default, { variant: "error", children: /* @__PURE__ */ jsx94(Alert_default.Description, { children: apiError.message }) }) }),
|
|
13626
|
+
/* @__PURE__ */ jsxs39("div", { children: [
|
|
13627
|
+
componentsWithoutHeadings && componentsWithoutHeadings.length > 0 ? renderComponents(componentsWithoutHeadings) : !isLoading && /* @__PURE__ */ jsx94(Alert_default, { variant: "warning", children: /* @__PURE__ */ jsx94(Typography_default, { variant: "body1", children: "No form components available" }) }),
|
|
13628
|
+
isLoading && /* @__PURE__ */ jsx94("div", { style: { display: "flex", justifyContent: "center", padding: "1rem" }, children: /* @__PURE__ */ jsx94(Spinner_default, { size: "small" }) })
|
|
12669
13629
|
] })
|
|
12670
13630
|
] })
|
|
12671
13631
|
] });
|
|
@@ -12673,7 +13633,7 @@ var BaseInviteUser = ({
|
|
|
12673
13633
|
var BaseInviteUser_default = BaseInviteUser;
|
|
12674
13634
|
|
|
12675
13635
|
// src/components/presentation/auth/InviteUser/v2/InviteUser.tsx
|
|
12676
|
-
import { jsx as
|
|
13636
|
+
import { jsx as jsx95 } from "react/jsx-runtime";
|
|
12677
13637
|
var InviteUser = ({
|
|
12678
13638
|
onError,
|
|
12679
13639
|
onFlowChange,
|
|
@@ -12689,7 +13649,7 @@ var InviteUser = ({
|
|
|
12689
13649
|
const response = await http2.request({
|
|
12690
13650
|
data: {
|
|
12691
13651
|
...payload,
|
|
12692
|
-
flowType:
|
|
13652
|
+
flowType: EmbeddedFlowType7.UserOnboarding,
|
|
12693
13653
|
verbose: true
|
|
12694
13654
|
},
|
|
12695
13655
|
headers: {
|
|
@@ -12716,7 +13676,7 @@ var InviteUser = ({
|
|
|
12716
13676
|
});
|
|
12717
13677
|
return response.data;
|
|
12718
13678
|
};
|
|
12719
|
-
const fetchOrganizationUnitChildren =
|
|
13679
|
+
const fetchOrganizationUnitChildren = useCallback20(
|
|
12720
13680
|
async (parentId, limit, offset4) => {
|
|
12721
13681
|
const accessToken = await getAccessToken();
|
|
12722
13682
|
return getOrganizationUnitChildren({
|
|
@@ -12729,7 +13689,7 @@ var InviteUser = ({
|
|
|
12729
13689
|
},
|
|
12730
13690
|
[baseUrl, getAccessToken]
|
|
12731
13691
|
);
|
|
12732
|
-
return /* @__PURE__ */
|
|
13692
|
+
return /* @__PURE__ */ jsx95(
|
|
12733
13693
|
BaseInviteUser_default,
|
|
12734
13694
|
{
|
|
12735
13695
|
onInitialize: handleInitialize,
|
|
@@ -12753,8 +13713,8 @@ var InviteUser_default = InviteUser;
|
|
|
12753
13713
|
import { useMemo as useMemo32 } from "react";
|
|
12754
13714
|
|
|
12755
13715
|
// src/components/presentation/auth/AcceptInvite/v2/BaseAcceptInvite.tsx
|
|
12756
|
-
import { cx as
|
|
12757
|
-
import { useCallback as
|
|
13716
|
+
import { cx as cx29 } from "@emotion/css";
|
|
13717
|
+
import { useCallback as useCallback21, useContext as useContext15, useEffect as useEffect24, useRef as useRef13, useState as useState26 } from "react";
|
|
12758
13718
|
|
|
12759
13719
|
// src/components/presentation/auth/AcceptInvite/v2/BaseAcceptInvite.styles.ts
|
|
12760
13720
|
import { css as css24 } from "@emotion/css";
|
|
@@ -12797,7 +13757,7 @@ var useStyles23 = (theme, colorScheme) => useMemo31(() => {
|
|
|
12797
13757
|
var BaseAcceptInvite_styles_default = useStyles23;
|
|
12798
13758
|
|
|
12799
13759
|
// src/components/presentation/auth/AcceptInvite/v2/BaseAcceptInvite.tsx
|
|
12800
|
-
import { jsx as
|
|
13760
|
+
import { jsx as jsx96, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
12801
13761
|
var BaseAcceptInvite = ({
|
|
12802
13762
|
executionId,
|
|
12803
13763
|
inviteToken,
|
|
@@ -12817,22 +13777,22 @@ var BaseAcceptInvite = ({
|
|
|
12817
13777
|
const { meta, isInitialized, getStorageManager } = useAsgardeo_default();
|
|
12818
13778
|
const { t } = useTranslation_default(preferences?.i18n);
|
|
12819
13779
|
const { theme } = useTheme_default();
|
|
12820
|
-
const customRenderers =
|
|
13780
|
+
const customRenderers = useContext15(ComponentRendererContext_default);
|
|
12821
13781
|
const styles = BaseAcceptInvite_styles_default(theme, theme.vars.colors.text.primary);
|
|
12822
|
-
const [isLoading, setIsLoading] =
|
|
12823
|
-
const [isValidatingToken, setIsValidatingToken] =
|
|
12824
|
-
const [isTokenInvalid, setIsTokenInvalid] =
|
|
12825
|
-
const [isComplete, setIsComplete] =
|
|
12826
|
-
const [currentFlow, setCurrentFlow] =
|
|
12827
|
-
const [apiError, setApiError] =
|
|
12828
|
-
const [formValues, setFormValues] =
|
|
12829
|
-
const [formErrors, setFormErrors] =
|
|
12830
|
-
const [touchedFields, setTouchedFields] =
|
|
12831
|
-
const [isFormValid, setIsFormValid] =
|
|
12832
|
-
const [isStorageReady, setIsStorageReady] =
|
|
12833
|
-
const challengeTokenRef =
|
|
12834
|
-
const tokenValidationAttemptedRef =
|
|
12835
|
-
|
|
13782
|
+
const [isLoading, setIsLoading] = useState26(false);
|
|
13783
|
+
const [isValidatingToken, setIsValidatingToken] = useState26(true);
|
|
13784
|
+
const [isTokenInvalid, setIsTokenInvalid] = useState26(false);
|
|
13785
|
+
const [isComplete, setIsComplete] = useState26(false);
|
|
13786
|
+
const [currentFlow, setCurrentFlow] = useState26(null);
|
|
13787
|
+
const [apiError, setApiError] = useState26(null);
|
|
13788
|
+
const [formValues, setFormValues] = useState26({});
|
|
13789
|
+
const [formErrors, setFormErrors] = useState26({});
|
|
13790
|
+
const [touchedFields, setTouchedFields] = useState26({});
|
|
13791
|
+
const [isFormValid, setIsFormValid] = useState26(true);
|
|
13792
|
+
const [isStorageReady, setIsStorageReady] = useState26(false);
|
|
13793
|
+
const challengeTokenRef = useRef13(null);
|
|
13794
|
+
const tokenValidationAttemptedRef = useRef13(false);
|
|
13795
|
+
useEffect24(() => {
|
|
12836
13796
|
if (!isInitialized) return;
|
|
12837
13797
|
(async () => {
|
|
12838
13798
|
try {
|
|
@@ -12857,7 +13817,7 @@ var BaseAcceptInvite = ({
|
|
|
12857
13817
|
}
|
|
12858
13818
|
}
|
|
12859
13819
|
};
|
|
12860
|
-
const handleError =
|
|
13820
|
+
const handleError = useCallback21(
|
|
12861
13821
|
(error) => {
|
|
12862
13822
|
const errorMessage = error?.failureReason || extractErrorMessage(error, t, "components.acceptInvite.errors.generic");
|
|
12863
13823
|
setApiError(error instanceof Error ? error : new Error(errorMessage));
|
|
@@ -12865,7 +13825,7 @@ var BaseAcceptInvite = ({
|
|
|
12865
13825
|
},
|
|
12866
13826
|
[t, onError]
|
|
12867
13827
|
);
|
|
12868
|
-
const normalizeFlowResponseLocal =
|
|
13828
|
+
const normalizeFlowResponseLocal = useCallback21(
|
|
12869
13829
|
(response) => {
|
|
12870
13830
|
if (!response?.data?.meta?.components) {
|
|
12871
13831
|
return response;
|
|
@@ -12928,7 +13888,7 @@ var BaseAcceptInvite = ({
|
|
|
12928
13888
|
},
|
|
12929
13889
|
tokenValidationAttemptedRef
|
|
12930
13890
|
});
|
|
12931
|
-
const handleInputChange =
|
|
13891
|
+
const handleInputChange = useCallback21((name, value) => {
|
|
12932
13892
|
setFormValues((prev) => ({ ...prev, [name]: value }));
|
|
12933
13893
|
setFormErrors((prev) => {
|
|
12934
13894
|
const newErrors = { ...prev };
|
|
@@ -12937,10 +13897,10 @@ var BaseAcceptInvite = ({
|
|
|
12937
13897
|
});
|
|
12938
13898
|
setIsFormValid(true);
|
|
12939
13899
|
}, []);
|
|
12940
|
-
const handleInputBlur =
|
|
13900
|
+
const handleInputBlur = useCallback21((name) => {
|
|
12941
13901
|
setTouchedFields((prev) => ({ ...prev, [name]: true }));
|
|
12942
13902
|
}, []);
|
|
12943
|
-
const validateForm =
|
|
13903
|
+
const validateForm = useCallback21(
|
|
12944
13904
|
(components2) => {
|
|
12945
13905
|
const errors = {};
|
|
12946
13906
|
const validateComponents = (comps) => {
|
|
@@ -12961,7 +13921,7 @@ var BaseAcceptInvite = ({
|
|
|
12961
13921
|
},
|
|
12962
13922
|
[formValues, t]
|
|
12963
13923
|
);
|
|
12964
|
-
const handleSubmit =
|
|
13924
|
+
const handleSubmit = useCallback21(
|
|
12965
13925
|
async (component, data) => {
|
|
12966
13926
|
if (!currentFlow) {
|
|
12967
13927
|
return;
|
|
@@ -13036,7 +13996,7 @@ var BaseAcceptInvite = ({
|
|
|
13036
13996
|
normalizeFlowResponseLocal
|
|
13037
13997
|
]
|
|
13038
13998
|
);
|
|
13039
|
-
|
|
13999
|
+
useEffect24(() => {
|
|
13040
14000
|
if (tokenValidationAttemptedRef.current) {
|
|
13041
14001
|
return;
|
|
13042
14002
|
}
|
|
@@ -13079,7 +14039,7 @@ var BaseAcceptInvite = ({
|
|
|
13079
14039
|
}
|
|
13080
14040
|
})();
|
|
13081
14041
|
}, [executionId, inviteToken, onSubmit, onFlowChange, handleError, normalizeFlowResponseLocal]);
|
|
13082
|
-
const extractHeadings =
|
|
14042
|
+
const extractHeadings = useCallback21((components2) => {
|
|
13083
14043
|
let title2;
|
|
13084
14044
|
let subtitle2;
|
|
13085
14045
|
components2.forEach((comp) => {
|
|
@@ -13093,7 +14053,7 @@ var BaseAcceptInvite = ({
|
|
|
13093
14053
|
});
|
|
13094
14054
|
return { subtitle: subtitle2, title: title2 };
|
|
13095
14055
|
}, []);
|
|
13096
|
-
const filterHeadings =
|
|
14056
|
+
const filterHeadings = useCallback21(
|
|
13097
14057
|
(components2) => components2.filter(
|
|
13098
14058
|
(comp) => !(comp.type === "TEXT" && (comp.variant === "HEADING_1" || comp.variant === "HEADING_2"))
|
|
13099
14059
|
),
|
|
@@ -13124,34 +14084,34 @@ var BaseAcceptInvite = ({
|
|
|
13124
14084
|
values: formValues
|
|
13125
14085
|
};
|
|
13126
14086
|
if (children) {
|
|
13127
|
-
return /* @__PURE__ */
|
|
14087
|
+
return /* @__PURE__ */ jsx96("div", { className, children: children(renderProps) });
|
|
13128
14088
|
}
|
|
13129
14089
|
if (isValidatingToken) {
|
|
13130
|
-
return /* @__PURE__ */
|
|
13131
|
-
/* @__PURE__ */
|
|
13132
|
-
/* @__PURE__ */
|
|
14090
|
+
return /* @__PURE__ */ jsx96(Card_default, { className: cx29(className, styles.card), variant, children: /* @__PURE__ */ jsx96(Card_default.Content, { children: /* @__PURE__ */ jsxs40("div", { style: { alignItems: "center", display: "flex", flexDirection: "column", gap: "1rem", padding: "2rem" }, children: [
|
|
14091
|
+
/* @__PURE__ */ jsx96(Spinner_default, { size: "medium" }),
|
|
14092
|
+
/* @__PURE__ */ jsx96(Typography_default, { variant: "body1", children: "Validating your invite link..." })
|
|
13133
14093
|
] }) }) });
|
|
13134
14094
|
}
|
|
13135
14095
|
if (isTokenInvalid) {
|
|
13136
|
-
return /* @__PURE__ */
|
|
13137
|
-
/* @__PURE__ */
|
|
13138
|
-
/* @__PURE__ */
|
|
13139
|
-
/* @__PURE__ */
|
|
13140
|
-
/* @__PURE__ */
|
|
13141
|
-
/* @__PURE__ */
|
|
14096
|
+
return /* @__PURE__ */ jsxs40(Card_default, { className: cx29(className, styles.card), variant, children: [
|
|
14097
|
+
/* @__PURE__ */ jsx96(Card_default.Header, { className: styles.header, children: /* @__PURE__ */ jsx96(Card_default.Title, { level: 2, className: styles.title, children: "Invalid Invite Link" }) }),
|
|
14098
|
+
/* @__PURE__ */ jsxs40(Card_default.Content, { children: [
|
|
14099
|
+
/* @__PURE__ */ jsxs40(Alert_default, { variant: "error", children: [
|
|
14100
|
+
/* @__PURE__ */ jsx96(Alert_default.Title, { children: "Unable to verify invite" }),
|
|
14101
|
+
/* @__PURE__ */ jsx96(Alert_default.Description, { children: apiError?.message || "This invite link is invalid or has expired. Please contact your administrator for a new invite." })
|
|
13142
14102
|
] }),
|
|
13143
|
-
onGoToSignIn && /* @__PURE__ */
|
|
14103
|
+
onGoToSignIn && /* @__PURE__ */ jsx96("div", { style: { display: "flex", justifyContent: "center", marginTop: "1.5rem" }, children: /* @__PURE__ */ jsx96(Button_default, { variant: "outline", onClick: onGoToSignIn, children: "Go to Sign In" }) })
|
|
13144
14104
|
] })
|
|
13145
14105
|
] });
|
|
13146
14106
|
}
|
|
13147
|
-
return /* @__PURE__ */
|
|
13148
|
-
(showTitle || showSubtitle) && (title || subtitle) && /* @__PURE__ */
|
|
13149
|
-
showTitle && title && /* @__PURE__ */
|
|
13150
|
-
showSubtitle && subtitle && /* @__PURE__ */
|
|
14107
|
+
return /* @__PURE__ */ jsxs40(Card_default, { className: cx29(className, styles.card), variant, children: [
|
|
14108
|
+
(showTitle || showSubtitle) && (title || subtitle) && /* @__PURE__ */ jsxs40(Card_default.Header, { className: styles.header, children: [
|
|
14109
|
+
showTitle && title && /* @__PURE__ */ jsx96(Card_default.Title, { level: 2, className: styles.title, children: title }),
|
|
14110
|
+
showSubtitle && subtitle && /* @__PURE__ */ jsx96(Typography_default, { variant: "body1", className: styles.subtitle, children: subtitle })
|
|
13151
14111
|
] }),
|
|
13152
|
-
/* @__PURE__ */
|
|
13153
|
-
apiError && /* @__PURE__ */
|
|
13154
|
-
/* @__PURE__ */
|
|
14112
|
+
/* @__PURE__ */ jsxs40(Card_default.Content, { children: [
|
|
14113
|
+
apiError && /* @__PURE__ */ jsx96("div", { style: { marginBottom: "1rem" }, children: /* @__PURE__ */ jsx96(Alert_default, { variant: "error", children: /* @__PURE__ */ jsx96(Alert_default.Description, { children: apiError.message }) }) }),
|
|
14114
|
+
/* @__PURE__ */ jsxs40("div", { children: [
|
|
13155
14115
|
componentsWithoutHeadings && componentsWithoutHeadings.length > 0 ? renderInviteUserComponents(
|
|
13156
14116
|
componentsWithoutHeadings,
|
|
13157
14117
|
formValues,
|
|
@@ -13168,13 +14128,13 @@ var BaseAcceptInvite = ({
|
|
|
13168
14128
|
size,
|
|
13169
14129
|
variant
|
|
13170
14130
|
}
|
|
13171
|
-
) : !isLoading && /* @__PURE__ */
|
|
13172
|
-
isLoading && /* @__PURE__ */
|
|
14131
|
+
) : !isLoading && /* @__PURE__ */ jsx96(Alert_default, { variant: "warning", children: /* @__PURE__ */ jsx96(Typography_default, { variant: "body1", children: "No form components available" }) }),
|
|
14132
|
+
isLoading && /* @__PURE__ */ jsx96("div", { style: { display: "flex", justifyContent: "center", padding: "1rem" }, children: /* @__PURE__ */ jsx96(Spinner_default, { size: "small" }) })
|
|
13173
14133
|
] }),
|
|
13174
|
-
onGoToSignIn && /* @__PURE__ */
|
|
14134
|
+
onGoToSignIn && /* @__PURE__ */ jsx96("div", { style: { marginTop: "1.5rem", textAlign: "center" }, children: /* @__PURE__ */ jsxs40(Typography_default, { variant: "body2", children: [
|
|
13175
14135
|
"Already have an account?",
|
|
13176
14136
|
" ",
|
|
13177
|
-
/* @__PURE__ */
|
|
14137
|
+
/* @__PURE__ */ jsx96(Button_default, { variant: "text", onClick: onGoToSignIn, style: { minWidth: "auto", padding: 0 }, children: "Sign In" })
|
|
13178
14138
|
] }) })
|
|
13179
14139
|
] })
|
|
13180
14140
|
] });
|
|
@@ -13182,7 +14142,7 @@ var BaseAcceptInvite = ({
|
|
|
13182
14142
|
var BaseAcceptInvite_default = BaseAcceptInvite;
|
|
13183
14143
|
|
|
13184
14144
|
// src/components/presentation/auth/AcceptInvite/v2/AcceptInvite.tsx
|
|
13185
|
-
import { jsx as
|
|
14145
|
+
import { jsx as jsx97 } from "react/jsx-runtime";
|
|
13186
14146
|
var getUrlParams = () => {
|
|
13187
14147
|
if (typeof window === "undefined") {
|
|
13188
14148
|
return {};
|
|
@@ -13238,7 +14198,7 @@ var AcceptInvite = ({
|
|
|
13238
14198
|
}
|
|
13239
14199
|
return response.json();
|
|
13240
14200
|
};
|
|
13241
|
-
return /* @__PURE__ */
|
|
14201
|
+
return /* @__PURE__ */ jsx97(
|
|
13242
14202
|
BaseAcceptInvite_default,
|
|
13243
14203
|
{
|
|
13244
14204
|
executionId,
|
|
@@ -13261,9 +14221,9 @@ var AcceptInvite_default = AcceptInvite;
|
|
|
13261
14221
|
|
|
13262
14222
|
// src/components/auth/Callback/Callback.tsx
|
|
13263
14223
|
import { navigate as browserNavigate } from "@asgardeo/browser";
|
|
13264
|
-
import { useEffect as
|
|
14224
|
+
import { useEffect as useEffect25, useRef as useRef14 } from "react";
|
|
13265
14225
|
var Callback = ({ onNavigate, onError }) => {
|
|
13266
|
-
const processingRef =
|
|
14226
|
+
const processingRef = useRef14(false);
|
|
13267
14227
|
const navigate6 = (path) => {
|
|
13268
14228
|
if (onNavigate) {
|
|
13269
14229
|
onNavigate(path);
|
|
@@ -13271,7 +14231,7 @@ var Callback = ({ onNavigate, onError }) => {
|
|
|
13271
14231
|
browserNavigate(path);
|
|
13272
14232
|
}
|
|
13273
14233
|
};
|
|
13274
|
-
|
|
14234
|
+
useEffect25(() => {
|
|
13275
14235
|
const processOAuthCallback = () => {
|
|
13276
14236
|
if (processingRef.current) {
|
|
13277
14237
|
return;
|
|
@@ -13353,56 +14313,56 @@ var Callback = ({ onNavigate, onError }) => {
|
|
|
13353
14313
|
};
|
|
13354
14314
|
|
|
13355
14315
|
// src/components/presentation/User/BaseUser.tsx
|
|
13356
|
-
import { Fragment as Fragment18, jsx as
|
|
14316
|
+
import { Fragment as Fragment18, jsx as jsx98 } from "react/jsx-runtime";
|
|
13357
14317
|
var BaseUser = ({ user, children, fallback = null }) => {
|
|
13358
14318
|
if (!user) {
|
|
13359
|
-
return /* @__PURE__ */
|
|
14319
|
+
return /* @__PURE__ */ jsx98(Fragment18, { children: fallback });
|
|
13360
14320
|
}
|
|
13361
|
-
return /* @__PURE__ */
|
|
14321
|
+
return /* @__PURE__ */ jsx98(Fragment18, { children: children(user) });
|
|
13362
14322
|
};
|
|
13363
14323
|
BaseUser.displayName = "BaseUser";
|
|
13364
14324
|
var BaseUser_default = BaseUser;
|
|
13365
14325
|
|
|
13366
14326
|
// src/components/presentation/User/User.tsx
|
|
13367
|
-
import { jsx as
|
|
14327
|
+
import { jsx as jsx99 } from "react/jsx-runtime";
|
|
13368
14328
|
var User5 = ({ children, fallback = null }) => {
|
|
13369
14329
|
const { user } = useAsgardeo_default();
|
|
13370
|
-
return /* @__PURE__ */
|
|
14330
|
+
return /* @__PURE__ */ jsx99(BaseUser_default, { user, fallback, children });
|
|
13371
14331
|
};
|
|
13372
14332
|
User5.displayName = "User";
|
|
13373
14333
|
var User_default = User5;
|
|
13374
14334
|
|
|
13375
14335
|
// src/components/presentation/Organization/BaseOrganization.tsx
|
|
13376
|
-
import { Fragment as Fragment19, jsx as
|
|
14336
|
+
import { Fragment as Fragment19, jsx as jsx100 } from "react/jsx-runtime";
|
|
13377
14337
|
var BaseOrganization = ({
|
|
13378
14338
|
children,
|
|
13379
14339
|
fallback = null,
|
|
13380
14340
|
organization
|
|
13381
14341
|
}) => {
|
|
13382
14342
|
if (!organization) {
|
|
13383
|
-
return /* @__PURE__ */
|
|
14343
|
+
return /* @__PURE__ */ jsx100(Fragment19, { children: fallback });
|
|
13384
14344
|
}
|
|
13385
|
-
return /* @__PURE__ */
|
|
14345
|
+
return /* @__PURE__ */ jsx100(Fragment19, { children: children(organization) });
|
|
13386
14346
|
};
|
|
13387
14347
|
BaseOrganization.displayName = "BaseOrganization";
|
|
13388
14348
|
var BaseOrganization_default = BaseOrganization;
|
|
13389
14349
|
|
|
13390
14350
|
// src/components/presentation/Organization/Organization.tsx
|
|
13391
|
-
import { jsx as
|
|
14351
|
+
import { jsx as jsx101 } from "react/jsx-runtime";
|
|
13392
14352
|
var Organization5 = ({ children, fallback = null }) => {
|
|
13393
14353
|
const { currentOrganization } = useOrganization_default();
|
|
13394
|
-
return /* @__PURE__ */
|
|
14354
|
+
return /* @__PURE__ */ jsx101(BaseOrganization_default, { organization: currentOrganization, fallback, children });
|
|
13395
14355
|
};
|
|
13396
14356
|
Organization5.displayName = "Organization";
|
|
13397
14357
|
var Organization_default = Organization5;
|
|
13398
14358
|
|
|
13399
14359
|
// src/components/presentation/UserProfile/BaseUserProfile.tsx
|
|
13400
|
-
import { withVendorCSSClassPrefix as
|
|
13401
|
-
import { cx as
|
|
13402
|
-
import { useState as
|
|
14360
|
+
import { withVendorCSSClassPrefix as withVendorCSSClassPrefix31, WellKnownSchemaIds, bem as bem21 } from "@asgardeo/browser";
|
|
14361
|
+
import { cx as cx33 } from "@emotion/css";
|
|
14362
|
+
import { useState as useState29, useCallback as useCallback23 } from "react";
|
|
13403
14363
|
|
|
13404
14364
|
// src/components/presentation/UserProfile/BaseUserProfile.styles.ts
|
|
13405
|
-
import { withVendorCSSClassPrefix as
|
|
14365
|
+
import { withVendorCSSClassPrefix as withVendorCSSClassPrefix27 } from "@asgardeo/browser";
|
|
13406
14366
|
import { css as css25 } from "@emotion/css";
|
|
13407
14367
|
import { useMemo as useMemo33 } from "react";
|
|
13408
14368
|
var useStyles24 = (theme, colorScheme) => {
|
|
@@ -13541,7 +14501,7 @@ var useStyles24 = (theme, colorScheme) => {
|
|
|
13541
14501
|
max-width: 350px;
|
|
13542
14502
|
text-align: start;
|
|
13543
14503
|
|
|
13544
|
-
.${
|
|
14504
|
+
.${withVendorCSSClassPrefix27("form-control")} {
|
|
13545
14505
|
margin-bottom: 0;
|
|
13546
14506
|
}
|
|
13547
14507
|
|
|
@@ -13659,8 +14619,8 @@ var getDisplayName = (mergedMappings, user, displayAttributes) => {
|
|
|
13659
14619
|
var getDisplayName_default = getDisplayName;
|
|
13660
14620
|
|
|
13661
14621
|
// src/components/primitives/Avatar/Avatar.tsx
|
|
13662
|
-
import { withVendorCSSClassPrefix as
|
|
13663
|
-
import { cx as
|
|
14622
|
+
import { withVendorCSSClassPrefix as withVendorCSSClassPrefix28, bem as bem18 } from "@asgardeo/browser";
|
|
14623
|
+
import { cx as cx30 } from "@emotion/css";
|
|
13664
14624
|
import { useMemo as useMemo35 } from "react";
|
|
13665
14625
|
|
|
13666
14626
|
// src/components/primitives/Avatar/Avatar.styles.ts
|
|
@@ -13730,7 +14690,7 @@ var useStyles25 = (theme, colorScheme, size, variant, backgroundColor) => useMem
|
|
|
13730
14690
|
var Avatar_styles_default = useStyles25;
|
|
13731
14691
|
|
|
13732
14692
|
// src/components/primitives/Avatar/Avatar.tsx
|
|
13733
|
-
import { jsx as
|
|
14693
|
+
import { jsx as jsx102 } from "react/jsx-runtime";
|
|
13734
14694
|
var Avatar = ({
|
|
13735
14695
|
alt = "User avatar",
|
|
13736
14696
|
background = "random",
|
|
@@ -13777,12 +14737,12 @@ var Avatar = ({
|
|
|
13777
14737
|
const getInitials = (fullName) => fullName.split(" ").map((part) => part[0]).slice(0, 2).join("").toUpperCase();
|
|
13778
14738
|
const renderContent = () => {
|
|
13779
14739
|
if (imageUrl) {
|
|
13780
|
-
return /* @__PURE__ */
|
|
14740
|
+
return /* @__PURE__ */ jsx102(
|
|
13781
14741
|
"img",
|
|
13782
14742
|
{
|
|
13783
14743
|
src: imageUrl,
|
|
13784
14744
|
alt,
|
|
13785
|
-
className:
|
|
14745
|
+
className: cx30(withVendorCSSClassPrefix28(bem18("avatar", "image")), styles["image"])
|
|
13786
14746
|
}
|
|
13787
14747
|
);
|
|
13788
14748
|
}
|
|
@@ -13790,27 +14750,27 @@ var Avatar = ({
|
|
|
13790
14750
|
return getInitials(name);
|
|
13791
14751
|
}
|
|
13792
14752
|
if (isLoading) {
|
|
13793
|
-
return /* @__PURE__ */
|
|
14753
|
+
return /* @__PURE__ */ jsx102("div", { className: cx30(withVendorCSSClassPrefix28(bem18("avatar", "skeleton")), styles["skeleton"]) });
|
|
13794
14754
|
}
|
|
13795
|
-
return /* @__PURE__ */
|
|
14755
|
+
return /* @__PURE__ */ jsx102(
|
|
13796
14756
|
"svg",
|
|
13797
14757
|
{
|
|
13798
14758
|
xmlns: "http://www.w3.org/2000/svg",
|
|
13799
14759
|
viewBox: "0 0 640 640",
|
|
13800
|
-
className:
|
|
13801
|
-
children: /* @__PURE__ */
|
|
14760
|
+
className: cx30(withVendorCSSClassPrefix28(bem18("avatar", "icon")), styles["icon"]),
|
|
14761
|
+
children: /* @__PURE__ */ jsx102("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" })
|
|
13802
14762
|
}
|
|
13803
14763
|
);
|
|
13804
14764
|
};
|
|
13805
|
-
return /* @__PURE__ */
|
|
14765
|
+
return /* @__PURE__ */ jsx102(
|
|
13806
14766
|
"div",
|
|
13807
14767
|
{
|
|
13808
|
-
className:
|
|
13809
|
-
|
|
14768
|
+
className: cx30(
|
|
14769
|
+
withVendorCSSClassPrefix28(bem18("avatar")),
|
|
13810
14770
|
styles["avatar"],
|
|
13811
14771
|
styles["variant"],
|
|
13812
|
-
|
|
13813
|
-
isDefaultState &&
|
|
14772
|
+
withVendorCSSClassPrefix28(bem18("avatar", null, variant)),
|
|
14773
|
+
isDefaultState && withVendorCSSClassPrefix28(bem18("avatar", "default")),
|
|
13814
14774
|
className
|
|
13815
14775
|
),
|
|
13816
14776
|
children: renderContent()
|
|
@@ -13819,8 +14779,8 @@ var Avatar = ({
|
|
|
13819
14779
|
};
|
|
13820
14780
|
|
|
13821
14781
|
// src/components/primitives/Dialog/Dialog.tsx
|
|
13822
|
-
import { withVendorCSSClassPrefix as
|
|
13823
|
-
import { cx as
|
|
14782
|
+
import { withVendorCSSClassPrefix as withVendorCSSClassPrefix29, bem as bem19 } from "@asgardeo/browser";
|
|
14783
|
+
import { cx as cx31 } from "@emotion/css";
|
|
13824
14784
|
import {
|
|
13825
14785
|
useFloating,
|
|
13826
14786
|
useClick,
|
|
@@ -13838,10 +14798,10 @@ import {
|
|
|
13838
14798
|
createContext as createContext12,
|
|
13839
14799
|
forwardRef as forwardRef10,
|
|
13840
14800
|
isValidElement,
|
|
13841
|
-
useContext as
|
|
14801
|
+
useContext as useContext16,
|
|
13842
14802
|
useLayoutEffect,
|
|
13843
14803
|
useMemo as useMemo37,
|
|
13844
|
-
useState as
|
|
14804
|
+
useState as useState27
|
|
13845
14805
|
} from "react";
|
|
13846
14806
|
|
|
13847
14807
|
// src/components/primitives/Dialog/Dialog.styles.ts
|
|
@@ -13909,8 +14869,8 @@ var useStyles26 = (theme, colorScheme) => useMemo36(() => {
|
|
|
13909
14869
|
var Dialog_styles_default = useStyles26;
|
|
13910
14870
|
|
|
13911
14871
|
// src/components/primitives/Icons/LogOut.tsx
|
|
13912
|
-
import { jsx as
|
|
13913
|
-
var LogOut = (props) => /* @__PURE__ */
|
|
14872
|
+
import { jsx as jsx103, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
14873
|
+
var LogOut = (props) => /* @__PURE__ */ jsxs41(
|
|
13914
14874
|
"svg",
|
|
13915
14875
|
{
|
|
13916
14876
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -13924,17 +14884,17 @@ var LogOut = (props) => /* @__PURE__ */ jsxs39(
|
|
|
13924
14884
|
strokeLinejoin: "round",
|
|
13925
14885
|
...props,
|
|
13926
14886
|
children: [
|
|
13927
|
-
/* @__PURE__ */
|
|
13928
|
-
/* @__PURE__ */
|
|
13929
|
-
/* @__PURE__ */
|
|
14887
|
+
/* @__PURE__ */ jsx103("path", { d: "m16 17 5-5-5-5" }),
|
|
14888
|
+
/* @__PURE__ */ jsx103("path", { d: "M21 12H9" }),
|
|
14889
|
+
/* @__PURE__ */ jsx103("path", { d: "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" })
|
|
13930
14890
|
]
|
|
13931
14891
|
}
|
|
13932
14892
|
);
|
|
13933
14893
|
var LogOut_default = LogOut;
|
|
13934
14894
|
|
|
13935
14895
|
// src/components/primitives/Icons/Plus.tsx
|
|
13936
|
-
import { jsx as
|
|
13937
|
-
var Plus = (props) => /* @__PURE__ */
|
|
14896
|
+
import { jsx as jsx104, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
14897
|
+
var Plus = (props) => /* @__PURE__ */ jsxs42(
|
|
13938
14898
|
"svg",
|
|
13939
14899
|
{
|
|
13940
14900
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -13948,16 +14908,16 @@ var Plus = (props) => /* @__PURE__ */ jsxs40(
|
|
|
13948
14908
|
strokeLinejoin: "round",
|
|
13949
14909
|
...props,
|
|
13950
14910
|
children: [
|
|
13951
|
-
/* @__PURE__ */
|
|
13952
|
-
/* @__PURE__ */
|
|
14911
|
+
/* @__PURE__ */ jsx104("path", { d: "M5 12h14" }),
|
|
14912
|
+
/* @__PURE__ */ jsx104("path", { d: "M12 5v14" })
|
|
13953
14913
|
]
|
|
13954
14914
|
}
|
|
13955
14915
|
);
|
|
13956
14916
|
var Plus_default = Plus;
|
|
13957
14917
|
|
|
13958
14918
|
// src/components/primitives/Icons/User.tsx
|
|
13959
|
-
import { jsx as
|
|
13960
|
-
var User7 = (props) => /* @__PURE__ */
|
|
14919
|
+
import { jsx as jsx105, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
14920
|
+
var User7 = (props) => /* @__PURE__ */ jsxs43(
|
|
13961
14921
|
"svg",
|
|
13962
14922
|
{
|
|
13963
14923
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -13971,16 +14931,16 @@ var User7 = (props) => /* @__PURE__ */ jsxs41(
|
|
|
13971
14931
|
strokeLinejoin: "round",
|
|
13972
14932
|
...props,
|
|
13973
14933
|
children: [
|
|
13974
|
-
/* @__PURE__ */
|
|
13975
|
-
/* @__PURE__ */
|
|
14934
|
+
/* @__PURE__ */ jsx105("path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" }),
|
|
14935
|
+
/* @__PURE__ */ jsx105("circle", { cx: "12", cy: "7", r: "4" })
|
|
13976
14936
|
]
|
|
13977
14937
|
}
|
|
13978
14938
|
);
|
|
13979
14939
|
var User_default2 = User7;
|
|
13980
14940
|
|
|
13981
14941
|
// src/components/primitives/Icons/X.tsx
|
|
13982
|
-
import { jsx as
|
|
13983
|
-
var X = (props) => /* @__PURE__ */
|
|
14942
|
+
import { jsx as jsx106, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
14943
|
+
var X = (props) => /* @__PURE__ */ jsxs44(
|
|
13984
14944
|
"svg",
|
|
13985
14945
|
{
|
|
13986
14946
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -13994,23 +14954,23 @@ var X = (props) => /* @__PURE__ */ jsxs42(
|
|
|
13994
14954
|
strokeLinejoin: "round",
|
|
13995
14955
|
...props,
|
|
13996
14956
|
children: [
|
|
13997
|
-
/* @__PURE__ */
|
|
13998
|
-
/* @__PURE__ */
|
|
14957
|
+
/* @__PURE__ */ jsx106("path", { d: "M18 6 6 18" }),
|
|
14958
|
+
/* @__PURE__ */ jsx106("path", { d: "m6 6 12 12" })
|
|
13999
14959
|
]
|
|
14000
14960
|
}
|
|
14001
14961
|
);
|
|
14002
14962
|
var X_default = X;
|
|
14003
14963
|
|
|
14004
14964
|
// src/components/primitives/Dialog/Dialog.tsx
|
|
14005
|
-
import { jsx as
|
|
14965
|
+
import { jsx as jsx107, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
14006
14966
|
function useDialog({
|
|
14007
14967
|
initialOpen = false,
|
|
14008
14968
|
open: controlledOpen,
|
|
14009
14969
|
onOpenChange: setControlledOpen
|
|
14010
14970
|
} = {}) {
|
|
14011
|
-
const [uncontrolledOpen, setUncontrolledOpen] =
|
|
14012
|
-
const [labelId, setLabelId] =
|
|
14013
|
-
const [descriptionId, setDescriptionId] =
|
|
14971
|
+
const [uncontrolledOpen, setUncontrolledOpen] = useState27(initialOpen);
|
|
14972
|
+
const [labelId, setLabelId] = useState27();
|
|
14973
|
+
const [descriptionId, setDescriptionId] = useState27();
|
|
14014
14974
|
const open = controlledOpen ?? uncontrolledOpen;
|
|
14015
14975
|
const setOpen = setControlledOpen ?? setUncontrolledOpen;
|
|
14016
14976
|
const data = useFloating({
|
|
@@ -14040,7 +15000,7 @@ function useDialog({
|
|
|
14040
15000
|
}
|
|
14041
15001
|
var DialogContext = createContext12(null);
|
|
14042
15002
|
var useDialogContext = () => {
|
|
14043
|
-
const context =
|
|
15003
|
+
const context = useContext16(DialogContext);
|
|
14044
15004
|
if (context == null) {
|
|
14045
15005
|
throw new Error("Dialog components must be wrapped in <Dialog />");
|
|
14046
15006
|
}
|
|
@@ -14048,7 +15008,7 @@ var useDialogContext = () => {
|
|
|
14048
15008
|
};
|
|
14049
15009
|
function Dialog({ children, ...options }) {
|
|
14050
15010
|
const dialog = useDialog(options);
|
|
14051
|
-
return /* @__PURE__ */
|
|
15011
|
+
return /* @__PURE__ */ jsx107(DialogContext.Provider, { value: dialog, children });
|
|
14052
15012
|
}
|
|
14053
15013
|
var DialogTrigger = forwardRef10(
|
|
14054
15014
|
({ children, asChild = false, ...props }, propRef) => {
|
|
@@ -14066,7 +15026,7 @@ var DialogTrigger = forwardRef10(
|
|
|
14066
15026
|
})
|
|
14067
15027
|
);
|
|
14068
15028
|
}
|
|
14069
|
-
return /* @__PURE__ */
|
|
15029
|
+
return /* @__PURE__ */ jsx107("button", { ref, "data-state": context.open ? "open" : "closed", ...context.getReferenceProps(props), children });
|
|
14070
15030
|
}
|
|
14071
15031
|
);
|
|
14072
15032
|
var DialogContent = forwardRef10(
|
|
@@ -14076,16 +15036,16 @@ var DialogContent = forwardRef10(
|
|
|
14076
15036
|
const styles = Dialog_styles_default(theme, colorScheme);
|
|
14077
15037
|
const ref = useMergeRefs([context.refs.setFloating, propRef]);
|
|
14078
15038
|
if (!floatingContext.open) return null;
|
|
14079
|
-
return /* @__PURE__ */
|
|
15039
|
+
return /* @__PURE__ */ jsx107(FloatingPortal, { children: /* @__PURE__ */ jsx107(
|
|
14080
15040
|
FloatingOverlay,
|
|
14081
15041
|
{
|
|
14082
|
-
className:
|
|
15042
|
+
className: cx31(withVendorCSSClassPrefix29(bem19("dialog", "overlay")), styles["overlay"]),
|
|
14083
15043
|
lockScroll: true,
|
|
14084
|
-
children: /* @__PURE__ */
|
|
15044
|
+
children: /* @__PURE__ */ jsx107(FloatingFocusManager, { context: floatingContext, initialFocus: -1, children: /* @__PURE__ */ jsx107(
|
|
14085
15045
|
"div",
|
|
14086
15046
|
{
|
|
14087
15047
|
ref,
|
|
14088
|
-
className:
|
|
15048
|
+
className: cx31(withVendorCSSClassPrefix29(bem19("dialog", "content")), styles["content"], props.className),
|
|
14089
15049
|
"aria-labelledby": context.labelId,
|
|
14090
15050
|
"aria-describedby": context.descriptionId,
|
|
14091
15051
|
...context.getFloatingProps(props),
|
|
@@ -14108,18 +15068,18 @@ var DialogHeading = forwardRef10(
|
|
|
14108
15068
|
context.setLabelId(void 0);
|
|
14109
15069
|
};
|
|
14110
15070
|
}, [id, context.setLabelId]);
|
|
14111
|
-
return /* @__PURE__ */
|
|
14112
|
-
/* @__PURE__ */
|
|
15071
|
+
return /* @__PURE__ */ jsxs45("div", { className: cx31(withVendorCSSClassPrefix29(bem19("dialog", "header")), styles["header"]), children: [
|
|
15072
|
+
/* @__PURE__ */ jsx107(
|
|
14113
15073
|
"h2",
|
|
14114
15074
|
{
|
|
14115
15075
|
...props,
|
|
14116
15076
|
ref,
|
|
14117
15077
|
id,
|
|
14118
|
-
className:
|
|
15078
|
+
className: cx31(withVendorCSSClassPrefix29(bem19("dialog", "title")), styles["headerTitle"]),
|
|
14119
15079
|
children
|
|
14120
15080
|
}
|
|
14121
15081
|
),
|
|
14122
|
-
/* @__PURE__ */
|
|
15082
|
+
/* @__PURE__ */ jsx107(
|
|
14123
15083
|
Button_default,
|
|
14124
15084
|
{
|
|
14125
15085
|
color: "tertiary",
|
|
@@ -14130,7 +15090,7 @@ var DialogHeading = forwardRef10(
|
|
|
14130
15090
|
context.setOpen(false);
|
|
14131
15091
|
},
|
|
14132
15092
|
"aria-label": "Close",
|
|
14133
|
-
children: /* @__PURE__ */
|
|
15093
|
+
children: /* @__PURE__ */ jsx107(X_default, { width: 16, height: 16 })
|
|
14134
15094
|
}
|
|
14135
15095
|
)
|
|
14136
15096
|
] });
|
|
@@ -14148,13 +15108,13 @@ var DialogDescription = forwardRef10(
|
|
|
14148
15108
|
context.setDescriptionId(void 0);
|
|
14149
15109
|
};
|
|
14150
15110
|
}, [id, context.setDescriptionId]);
|
|
14151
|
-
return /* @__PURE__ */
|
|
15111
|
+
return /* @__PURE__ */ jsx107(
|
|
14152
15112
|
"p",
|
|
14153
15113
|
{
|
|
14154
15114
|
...props,
|
|
14155
15115
|
ref,
|
|
14156
15116
|
id,
|
|
14157
|
-
className:
|
|
15117
|
+
className: cx31(withVendorCSSClassPrefix29(bem19("dialog", "description")), styles["description"], props.className),
|
|
14158
15118
|
children
|
|
14159
15119
|
}
|
|
14160
15120
|
);
|
|
@@ -14177,13 +15137,13 @@ var DialogClose = forwardRef10(
|
|
|
14177
15137
|
onClick: handleClick
|
|
14178
15138
|
});
|
|
14179
15139
|
}
|
|
14180
|
-
return /* @__PURE__ */
|
|
15140
|
+
return /* @__PURE__ */ jsx107(
|
|
14181
15141
|
Button_default,
|
|
14182
15142
|
{
|
|
14183
15143
|
...props,
|
|
14184
15144
|
ref,
|
|
14185
15145
|
onClick: handleClick,
|
|
14186
|
-
className:
|
|
15146
|
+
className: cx31(withVendorCSSClassPrefix29(bem19("dialog", "close")), props.className),
|
|
14187
15147
|
variant: "text",
|
|
14188
15148
|
children
|
|
14189
15149
|
}
|
|
@@ -14203,9 +15163,9 @@ Dialog.Close = DialogClose;
|
|
|
14203
15163
|
var Dialog_default = Dialog;
|
|
14204
15164
|
|
|
14205
15165
|
// src/components/primitives/MultiInput/MultiInput.tsx
|
|
14206
|
-
import { withVendorCSSClassPrefix as
|
|
14207
|
-
import { cx as
|
|
14208
|
-
import { useCallback as
|
|
15166
|
+
import { withVendorCSSClassPrefix as withVendorCSSClassPrefix30, bem as bem20 } from "@asgardeo/browser";
|
|
15167
|
+
import { cx as cx32 } from "@emotion/css";
|
|
15168
|
+
import { useCallback as useCallback22, useState as useState28 } from "react";
|
|
14209
15169
|
|
|
14210
15170
|
// src/components/primitives/MultiInput/MultiInput.styles.ts
|
|
14211
15171
|
import { css as css28 } from "@emotion/css";
|
|
@@ -14300,7 +15260,7 @@ var useStyles27 = (theme, colorScheme, disabled, hasError, canAddMore, canRemove
|
|
|
14300
15260
|
var MultiInput_styles_default = useStyles27;
|
|
14301
15261
|
|
|
14302
15262
|
// src/components/primitives/MultiInput/MultiInput.tsx
|
|
14303
|
-
import { jsx as
|
|
15263
|
+
import { jsx as jsx108, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
14304
15264
|
var MultiInput = ({
|
|
14305
15265
|
label,
|
|
14306
15266
|
error,
|
|
@@ -14323,9 +15283,9 @@ var MultiInput = ({
|
|
|
14323
15283
|
const canAddMore = !maxFields || values.length < maxFields;
|
|
14324
15284
|
const canRemove = values.length > minFields;
|
|
14325
15285
|
const styles = MultiInput_styles_default(theme, colorScheme, !!disabled, !!error, canAddMore, canRemove);
|
|
14326
|
-
const PlusIcon = ({ iconClassName }) => /* @__PURE__ */
|
|
14327
|
-
const BinIcon = ({ iconClassName }) => /* @__PURE__ */
|
|
14328
|
-
const handleAddValue =
|
|
15286
|
+
const PlusIcon = ({ iconClassName }) => /* @__PURE__ */ jsx108("svg", { width: "16", height: "16", viewBox: "0 0 24 24", className: cx32(styles["icon"], iconClassName), children: /* @__PURE__ */ jsx108("path", { d: "M12 5v14M5 12h14" }) });
|
|
15287
|
+
const BinIcon = ({ iconClassName }) => /* @__PURE__ */ jsx108("svg", { width: "16", height: "16", viewBox: "0 0 24 24", className: cx32(styles["icon"], iconClassName), children: /* @__PURE__ */ jsx108("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" }) });
|
|
15288
|
+
const handleAddValue = useCallback22(
|
|
14329
15289
|
(newValue) => {
|
|
14330
15290
|
if (newValue.trim() !== "" && (!maxFields || values.length < maxFields)) {
|
|
14331
15291
|
onChange([...values, newValue.trim()]);
|
|
@@ -14333,7 +15293,7 @@ var MultiInput = ({
|
|
|
14333
15293
|
},
|
|
14334
15294
|
[values, onChange, maxFields]
|
|
14335
15295
|
);
|
|
14336
|
-
const handleRemoveValue =
|
|
15296
|
+
const handleRemoveValue = useCallback22(
|
|
14337
15297
|
(index) => {
|
|
14338
15298
|
if (values.length > minFields) {
|
|
14339
15299
|
const updatedValues = values.filter((_, i) => i !== index);
|
|
@@ -14342,7 +15302,7 @@ var MultiInput = ({
|
|
|
14342
15302
|
},
|
|
14343
15303
|
[values, onChange, minFields]
|
|
14344
15304
|
);
|
|
14345
|
-
const renderInputField =
|
|
15305
|
+
const renderInputField = useCallback22(
|
|
14346
15306
|
(value, onValueChange, attachedEndIcon, onEndIconClick) => {
|
|
14347
15307
|
const handleInputChange = (e) => {
|
|
14348
15308
|
const newValue = e.target ? e.target.value : e;
|
|
@@ -14368,9 +15328,9 @@ var MultiInput = ({
|
|
|
14368
15328
|
};
|
|
14369
15329
|
switch (fieldType) {
|
|
14370
15330
|
case "DATE_TIME":
|
|
14371
|
-
return /* @__PURE__ */
|
|
15331
|
+
return /* @__PURE__ */ jsx108(DatePicker_default, { ...commonProps });
|
|
14372
15332
|
case "BOOLEAN":
|
|
14373
|
-
return /* @__PURE__ */
|
|
15333
|
+
return /* @__PURE__ */ jsx108(
|
|
14374
15334
|
Checkbox_default,
|
|
14375
15335
|
{
|
|
14376
15336
|
...commonProps,
|
|
@@ -14379,58 +15339,58 @@ var MultiInput = ({
|
|
|
14379
15339
|
}
|
|
14380
15340
|
);
|
|
14381
15341
|
default:
|
|
14382
|
-
return /* @__PURE__ */
|
|
15342
|
+
return /* @__PURE__ */ jsx108(TextField_default, { ...commonProps, type });
|
|
14383
15343
|
}
|
|
14384
15344
|
},
|
|
14385
15345
|
[placeholder, disabled, startIcon, endIcon, error, fieldType, type]
|
|
14386
15346
|
);
|
|
14387
|
-
const [currentInputValue, setCurrentInputValue] =
|
|
14388
|
-
const handleInputSubmit =
|
|
15347
|
+
const [currentInputValue, setCurrentInputValue] = useState28("");
|
|
15348
|
+
const handleInputSubmit = useCallback22(() => {
|
|
14389
15349
|
if (currentInputValue.trim() !== "") {
|
|
14390
15350
|
handleAddValue(currentInputValue);
|
|
14391
15351
|
setCurrentInputValue("");
|
|
14392
15352
|
}
|
|
14393
15353
|
}, [currentInputValue, handleAddValue]);
|
|
14394
|
-
return /* @__PURE__ */
|
|
15354
|
+
return /* @__PURE__ */ jsxs46(
|
|
14395
15355
|
FormControl_default,
|
|
14396
15356
|
{
|
|
14397
15357
|
error,
|
|
14398
15358
|
helperText,
|
|
14399
|
-
className:
|
|
15359
|
+
className: cx32(withVendorCSSClassPrefix30(bem20("multi-input")), className),
|
|
14400
15360
|
style,
|
|
14401
15361
|
children: [
|
|
14402
|
-
label && /* @__PURE__ */
|
|
14403
|
-
/* @__PURE__ */
|
|
14404
|
-
/* @__PURE__ */
|
|
15362
|
+
label && /* @__PURE__ */ jsx108(InputLabel_default, { required, error: !!error, children: label }),
|
|
15363
|
+
/* @__PURE__ */ jsxs46("div", { className: cx32(withVendorCSSClassPrefix30(bem20("multi-input", "container")), styles["container"]), children: [
|
|
15364
|
+
/* @__PURE__ */ jsx108("div", { className: cx32(withVendorCSSClassPrefix30(bem20("multi-input", "input-row")), styles["inputRow"]), children: /* @__PURE__ */ jsx108("div", { className: cx32(withVendorCSSClassPrefix30(bem20("multi-input", "input-wrapper")), styles["inputWrapper"]), children: renderInputField(
|
|
14405
15365
|
currentInputValue,
|
|
14406
15366
|
setCurrentInputValue,
|
|
14407
|
-
canAddMore ? /* @__PURE__ */
|
|
15367
|
+
canAddMore ? /* @__PURE__ */ jsx108(PlusIcon, { iconClassName: styles["plusIcon"] }) : void 0,
|
|
14408
15368
|
canAddMore ? handleInputSubmit : void 0
|
|
14409
15369
|
) }) }),
|
|
14410
|
-
values.length > 0 && /* @__PURE__ */
|
|
15370
|
+
values.length > 0 && /* @__PURE__ */ jsx108("div", { className: cx32(withVendorCSSClassPrefix30(bem20("multi-input", "list-container")), styles["listContainer"]), children: values.map((value, index) => /* @__PURE__ */ jsxs46(
|
|
14411
15371
|
"div",
|
|
14412
15372
|
{
|
|
14413
|
-
className:
|
|
15373
|
+
className: cx32(withVendorCSSClassPrefix30(bem20("multi-input", "list-item")), styles["listItem"]),
|
|
14414
15374
|
children: [
|
|
14415
|
-
/* @__PURE__ */
|
|
15375
|
+
/* @__PURE__ */ jsx108(
|
|
14416
15376
|
"span",
|
|
14417
15377
|
{
|
|
14418
|
-
className:
|
|
15378
|
+
className: cx32(withVendorCSSClassPrefix30(bem20("multi-input", "list-item-text")), styles["listItemText"]),
|
|
14419
15379
|
children: value
|
|
14420
15380
|
}
|
|
14421
15381
|
),
|
|
14422
|
-
canRemove && /* @__PURE__ */
|
|
15382
|
+
canRemove && /* @__PURE__ */ jsx108(
|
|
14423
15383
|
"button",
|
|
14424
15384
|
{
|
|
14425
15385
|
type: "button",
|
|
14426
15386
|
onClick: () => handleRemoveValue(index),
|
|
14427
15387
|
disabled,
|
|
14428
|
-
className:
|
|
14429
|
-
|
|
15388
|
+
className: cx32(
|
|
15389
|
+
withVendorCSSClassPrefix30(bem20("multi-input", "remove-button")),
|
|
14430
15390
|
styles["removeButton"]
|
|
14431
15391
|
),
|
|
14432
15392
|
title: "Remove value",
|
|
14433
|
-
children: /* @__PURE__ */
|
|
15393
|
+
children: /* @__PURE__ */ jsx108(BinIcon, { iconClassName: styles["icon"] })
|
|
14434
15394
|
}
|
|
14435
15395
|
)
|
|
14436
15396
|
]
|
|
@@ -14445,7 +15405,7 @@ var MultiInput = ({
|
|
|
14445
15405
|
var MultiInput_default = MultiInput;
|
|
14446
15406
|
|
|
14447
15407
|
// src/components/presentation/UserProfile/BaseUserProfile.tsx
|
|
14448
|
-
import { Fragment as Fragment20, jsx as
|
|
15408
|
+
import { Fragment as Fragment20, jsx as jsx109, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
14449
15409
|
var fieldsToSkip = [
|
|
14450
15410
|
"roles.default",
|
|
14451
15411
|
"active",
|
|
@@ -14489,10 +15449,10 @@ var BaseUserProfile = ({
|
|
|
14489
15449
|
displayNameAttributes = []
|
|
14490
15450
|
}) => {
|
|
14491
15451
|
const { theme, colorScheme } = useTheme_default();
|
|
14492
|
-
const [editedUser, setEditedUser] =
|
|
14493
|
-
const [editingFields, setEditingFields] =
|
|
15452
|
+
const [editedUser, setEditedUser] = useState29(flattenedProfile || profile);
|
|
15453
|
+
const [editingFields, setEditingFields] = useState29({});
|
|
14494
15454
|
const { t } = useTranslation_default(preferences?.i18n);
|
|
14495
|
-
const shouldShowField =
|
|
15455
|
+
const shouldShowField = useCallback23(
|
|
14496
15456
|
(fieldName) => {
|
|
14497
15457
|
if (fieldsToSkip.includes(fieldName)) {
|
|
14498
15458
|
return false;
|
|
@@ -14507,7 +15467,7 @@ var BaseUserProfile = ({
|
|
|
14507
15467
|
},
|
|
14508
15468
|
[showFields, hideFields]
|
|
14509
15469
|
);
|
|
14510
|
-
const PencilIcon = () => /* @__PURE__ */
|
|
15470
|
+
const PencilIcon = () => /* @__PURE__ */ jsx109(
|
|
14511
15471
|
"svg",
|
|
14512
15472
|
{
|
|
14513
15473
|
width: "16",
|
|
@@ -14518,16 +15478,16 @@ var BaseUserProfile = ({
|
|
|
14518
15478
|
strokeWidth: "2",
|
|
14519
15479
|
strokeLinecap: "round",
|
|
14520
15480
|
strokeLinejoin: "round",
|
|
14521
|
-
children: /* @__PURE__ */
|
|
15481
|
+
children: /* @__PURE__ */ jsx109("path", { d: "M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z" })
|
|
14522
15482
|
}
|
|
14523
15483
|
);
|
|
14524
|
-
const toggleFieldEdit =
|
|
15484
|
+
const toggleFieldEdit = useCallback23((fieldName) => {
|
|
14525
15485
|
setEditingFields((prev) => ({
|
|
14526
15486
|
...prev,
|
|
14527
15487
|
[fieldName]: !prev[fieldName]
|
|
14528
15488
|
}));
|
|
14529
15489
|
}, []);
|
|
14530
|
-
const getFieldPlaceholder =
|
|
15490
|
+
const getFieldPlaceholder = useCallback23((schema) => {
|
|
14531
15491
|
const { type, displayName, description, name } = schema;
|
|
14532
15492
|
const fieldLabel = displayName || description || name || "value";
|
|
14533
15493
|
switch (type) {
|
|
@@ -14541,19 +15501,19 @@ var BaseUserProfile = ({
|
|
|
14541
15501
|
return `Enter your ${fieldLabel.toLowerCase()}`;
|
|
14542
15502
|
}
|
|
14543
15503
|
}, []);
|
|
14544
|
-
const formatLabel =
|
|
15504
|
+
const formatLabel = useCallback23(
|
|
14545
15505
|
(key) => key.split(/(?=[A-Z])|_/).map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join(" "),
|
|
14546
15506
|
[]
|
|
14547
15507
|
);
|
|
14548
15508
|
const styles = BaseUserProfile_styles_default(theme, colorScheme);
|
|
14549
15509
|
const ObjectDisplay = ({ data }) => {
|
|
14550
15510
|
if (!data || typeof data !== "object") return null;
|
|
14551
|
-
return /* @__PURE__ */
|
|
14552
|
-
/* @__PURE__ */
|
|
15511
|
+
return /* @__PURE__ */ jsx109("table", { className: styles.value, children: /* @__PURE__ */ jsx109("tbody", { children: Object.entries(data).map(([key, value]) => /* @__PURE__ */ jsxs47("tr", { children: [
|
|
15512
|
+
/* @__PURE__ */ jsx109("td", { className: styles.objectKey, children: /* @__PURE__ */ jsxs47("strong", { children: [
|
|
14553
15513
|
formatLabel(key),
|
|
14554
15514
|
":"
|
|
14555
15515
|
] }) }),
|
|
14556
|
-
/* @__PURE__ */
|
|
15516
|
+
/* @__PURE__ */ jsx109("td", { className: styles.objectValue, children: typeof value === "object" ? /* @__PURE__ */ jsx109(ObjectDisplay, { data: value }) : String(value) })
|
|
14557
15517
|
] }, key)) }) });
|
|
14558
15518
|
};
|
|
14559
15519
|
function set(obj, path, value) {
|
|
@@ -14571,7 +15531,7 @@ var BaseUserProfile = ({
|
|
|
14571
15531
|
}
|
|
14572
15532
|
}
|
|
14573
15533
|
}
|
|
14574
|
-
const handleFieldSave =
|
|
15534
|
+
const handleFieldSave = useCallback23(
|
|
14575
15535
|
(schema) => {
|
|
14576
15536
|
if (!onUpdate || !schema.name) return;
|
|
14577
15537
|
const fieldName = schema.name;
|
|
@@ -14601,7 +15561,7 @@ var BaseUserProfile = ({
|
|
|
14601
15561
|
},
|
|
14602
15562
|
[editedUser, flattenedProfile, onUpdate, toggleFieldEdit]
|
|
14603
15563
|
);
|
|
14604
|
-
const handleFieldCancel =
|
|
15564
|
+
const handleFieldCancel = useCallback23(
|
|
14605
15565
|
(fieldName) => {
|
|
14606
15566
|
const currentUser2 = flattenedProfile || profile;
|
|
14607
15567
|
setEditedUser((prev) => ({
|
|
@@ -14628,7 +15588,7 @@ var BaseUserProfile = ({
|
|
|
14628
15588
|
const { value, displayName, description, name, type, required, mutability, subAttributes, multiValued } = schema;
|
|
14629
15589
|
const label = displayName || description || name || "";
|
|
14630
15590
|
if (subAttributes && Array.isArray(subAttributes)) {
|
|
14631
|
-
return /* @__PURE__ */
|
|
15591
|
+
return /* @__PURE__ */ jsx109(Fragment20, { children: subAttributes.map((subAttr, index) => {
|
|
14632
15592
|
let displayValue2;
|
|
14633
15593
|
if (Array.isArray(subAttr.value)) {
|
|
14634
15594
|
displayValue2 = subAttr.value.map((item) => typeof item === "object" ? JSON.stringify(item) : String(item)).join(", ");
|
|
@@ -14637,9 +15597,9 @@ var BaseUserProfile = ({
|
|
|
14637
15597
|
} else {
|
|
14638
15598
|
displayValue2 = String(subAttr.value);
|
|
14639
15599
|
}
|
|
14640
|
-
return /* @__PURE__ */
|
|
14641
|
-
/* @__PURE__ */
|
|
14642
|
-
/* @__PURE__ */
|
|
15600
|
+
return /* @__PURE__ */ jsxs47("div", { className: styles.field, children: [
|
|
15601
|
+
/* @__PURE__ */ jsx109("span", { className: styles.label, children: subAttr.displayName || subAttr.description || "" }),
|
|
15602
|
+
/* @__PURE__ */ jsx109("div", { className: styles.value, children: displayValue2 })
|
|
14643
15603
|
] }, index);
|
|
14644
15604
|
}) });
|
|
14645
15605
|
}
|
|
@@ -14663,9 +15623,9 @@ var BaseUserProfile = ({
|
|
|
14663
15623
|
} else {
|
|
14664
15624
|
fieldValues = [];
|
|
14665
15625
|
}
|
|
14666
|
-
return /* @__PURE__ */
|
|
14667
|
-
/* @__PURE__ */
|
|
14668
|
-
/* @__PURE__ */
|
|
15626
|
+
return /* @__PURE__ */ jsxs47(Fragment20, { children: [
|
|
15627
|
+
/* @__PURE__ */ jsx109("span", { className: styles.label, children: label }),
|
|
15628
|
+
/* @__PURE__ */ jsx109("div", { className: styles.value, children: /* @__PURE__ */ jsx109(
|
|
14669
15629
|
MultiInput_default,
|
|
14670
15630
|
{
|
|
14671
15631
|
values: fieldValues,
|
|
@@ -14696,9 +15656,9 @@ var BaseUserProfile = ({
|
|
|
14696
15656
|
} else {
|
|
14697
15657
|
displayValue2 = "-";
|
|
14698
15658
|
}
|
|
14699
|
-
return /* @__PURE__ */
|
|
14700
|
-
/* @__PURE__ */
|
|
14701
|
-
/* @__PURE__ */
|
|
15659
|
+
return /* @__PURE__ */ jsxs47(Fragment20, { children: [
|
|
15660
|
+
/* @__PURE__ */ jsx109("span", { className: styles.label, children: label }),
|
|
15661
|
+
/* @__PURE__ */ jsx109("div", { className: cx33(styles.value, !hasValues ? styles.valuePlaceholder : ""), children: !hasValues && isEditable2 && onStartEdit ? /* @__PURE__ */ jsx109(
|
|
14702
15662
|
Button_default,
|
|
14703
15663
|
{
|
|
14704
15664
|
onClick: onStartEdit,
|
|
@@ -14713,7 +15673,7 @@ var BaseUserProfile = ({
|
|
|
14713
15673
|
] });
|
|
14714
15674
|
}
|
|
14715
15675
|
if (type === "COMPLEX" && typeof value === "object") {
|
|
14716
|
-
return /* @__PURE__ */
|
|
15676
|
+
return /* @__PURE__ */ jsx109(ObjectDisplay, { data: value });
|
|
14717
15677
|
}
|
|
14718
15678
|
if (isEditing && onEditValue && mutability !== "READ_ONLY" && !readonlyFields.includes(name || "")) {
|
|
14719
15679
|
let fieldValue;
|
|
@@ -14735,13 +15695,13 @@ var BaseUserProfile = ({
|
|
|
14735
15695
|
let field;
|
|
14736
15696
|
switch (type) {
|
|
14737
15697
|
case "STRING":
|
|
14738
|
-
field = /* @__PURE__ */
|
|
15698
|
+
field = /* @__PURE__ */ jsx109(TextField_default, { ...commonProps });
|
|
14739
15699
|
break;
|
|
14740
15700
|
case "DATE_TIME":
|
|
14741
|
-
field = /* @__PURE__ */
|
|
15701
|
+
field = /* @__PURE__ */ jsx109(DatePicker_default, { ...commonProps });
|
|
14742
15702
|
break;
|
|
14743
15703
|
case "BOOLEAN":
|
|
14744
|
-
field = /* @__PURE__ */
|
|
15704
|
+
field = /* @__PURE__ */ jsx109(
|
|
14745
15705
|
Checkbox_default,
|
|
14746
15706
|
{
|
|
14747
15707
|
...commonProps,
|
|
@@ -14753,7 +15713,7 @@ var BaseUserProfile = ({
|
|
|
14753
15713
|
);
|
|
14754
15714
|
break;
|
|
14755
15715
|
case "COMPLEX":
|
|
14756
|
-
field = /* @__PURE__ */
|
|
15716
|
+
field = /* @__PURE__ */ jsx109(
|
|
14757
15717
|
"textarea",
|
|
14758
15718
|
{
|
|
14759
15719
|
value: fieldValue,
|
|
@@ -14765,11 +15725,11 @@ var BaseUserProfile = ({
|
|
|
14765
15725
|
);
|
|
14766
15726
|
break;
|
|
14767
15727
|
default:
|
|
14768
|
-
field = /* @__PURE__ */
|
|
15728
|
+
field = /* @__PURE__ */ jsx109(TextField_default, { ...commonProps });
|
|
14769
15729
|
}
|
|
14770
|
-
return /* @__PURE__ */
|
|
14771
|
-
/* @__PURE__ */
|
|
14772
|
-
/* @__PURE__ */
|
|
15730
|
+
return /* @__PURE__ */ jsxs47(Fragment20, { children: [
|
|
15731
|
+
/* @__PURE__ */ jsx109("span", { className: styles.label, children: label }),
|
|
15732
|
+
/* @__PURE__ */ jsx109("div", { className: styles.value, children: field })
|
|
14773
15733
|
] });
|
|
14774
15734
|
}
|
|
14775
15735
|
const hasValue = value !== void 0 && value !== null && value !== "";
|
|
@@ -14782,9 +15742,9 @@ var BaseUserProfile = ({
|
|
|
14782
15742
|
} else {
|
|
14783
15743
|
displayValue = "-";
|
|
14784
15744
|
}
|
|
14785
|
-
return /* @__PURE__ */
|
|
14786
|
-
/* @__PURE__ */
|
|
14787
|
-
/* @__PURE__ */
|
|
15745
|
+
return /* @__PURE__ */ jsxs47(Fragment20, { children: [
|
|
15746
|
+
/* @__PURE__ */ jsx109("span", { className: styles.label, children: label }),
|
|
15747
|
+
/* @__PURE__ */ jsx109("div", { className: cx33(styles.value, !hasValue ? styles.valuePlaceholder : ""), children: !hasValue && isEditable && onStartEdit ? /* @__PURE__ */ jsx109(
|
|
14788
15748
|
Button_default,
|
|
14789
15749
|
{
|
|
14790
15750
|
onClick: onStartEdit,
|
|
@@ -14807,8 +15767,8 @@ var BaseUserProfile = ({
|
|
|
14807
15767
|
if (!shouldShow) {
|
|
14808
15768
|
return null;
|
|
14809
15769
|
}
|
|
14810
|
-
return /* @__PURE__ */
|
|
14811
|
-
/* @__PURE__ */
|
|
15770
|
+
return /* @__PURE__ */ jsxs47("div", { className: styles.field, children: [
|
|
15771
|
+
/* @__PURE__ */ jsx109("div", { className: styles.fieldInner, children: renderSchemaField(
|
|
14812
15772
|
schema,
|
|
14813
15773
|
isFieldEditing,
|
|
14814
15774
|
(value) => {
|
|
@@ -14818,10 +15778,10 @@ var BaseUserProfile = ({
|
|
|
14818
15778
|
},
|
|
14819
15779
|
() => toggleFieldEdit(schema.name)
|
|
14820
15780
|
) }),
|
|
14821
|
-
editable && schema.mutability !== "READ_ONLY" && !isReadonlyField && /* @__PURE__ */
|
|
14822
|
-
isFieldEditing && /* @__PURE__ */
|
|
14823
|
-
/* @__PURE__ */
|
|
14824
|
-
/* @__PURE__ */
|
|
15781
|
+
editable && schema.mutability !== "READ_ONLY" && !isReadonlyField && /* @__PURE__ */ jsxs47("div", { className: styles.fieldActions, children: [
|
|
15782
|
+
isFieldEditing && /* @__PURE__ */ jsxs47(Fragment20, { children: [
|
|
15783
|
+
/* @__PURE__ */ jsx109(Button_default, { size: "small", color: "primary", variant: "solid", onClick: () => handleFieldSave(schema), children: "Save" }),
|
|
15784
|
+
/* @__PURE__ */ jsx109(
|
|
14825
15785
|
Button_default,
|
|
14826
15786
|
{
|
|
14827
15787
|
size: "small",
|
|
@@ -14832,7 +15792,7 @@ var BaseUserProfile = ({
|
|
|
14832
15792
|
}
|
|
14833
15793
|
)
|
|
14834
15794
|
] }),
|
|
14835
|
-
!isFieldEditing && hasValue && /* @__PURE__ */
|
|
15795
|
+
!isFieldEditing && hasValue && /* @__PURE__ */ jsx109(
|
|
14836
15796
|
Button_default,
|
|
14837
15797
|
{
|
|
14838
15798
|
size: "small",
|
|
@@ -14841,7 +15801,7 @@ var BaseUserProfile = ({
|
|
|
14841
15801
|
onClick: () => toggleFieldEdit(schema.name),
|
|
14842
15802
|
title: "Edit",
|
|
14843
15803
|
className: styles.editButton,
|
|
14844
|
-
children: /* @__PURE__ */
|
|
15804
|
+
children: /* @__PURE__ */ jsx109(PencilIcon, {})
|
|
14845
15805
|
}
|
|
14846
15806
|
)
|
|
14847
15807
|
] })
|
|
@@ -14850,10 +15810,10 @@ var BaseUserProfile = ({
|
|
|
14850
15810
|
if (!profile && !flattenedProfile) {
|
|
14851
15811
|
return fallback;
|
|
14852
15812
|
}
|
|
14853
|
-
const containerClasses =
|
|
15813
|
+
const containerClasses = cx33(
|
|
14854
15814
|
styles.root,
|
|
14855
15815
|
cardLayout ? styles.card : "",
|
|
14856
|
-
|
|
15816
|
+
withVendorCSSClassPrefix31("user-profile"),
|
|
14857
15817
|
className
|
|
14858
15818
|
);
|
|
14859
15819
|
const currentUser = flattenedProfile || profile;
|
|
@@ -14864,9 +15824,9 @@ var BaseUserProfile = ({
|
|
|
14864
15824
|
if (!shouldShowField(key)) return false;
|
|
14865
15825
|
return value !== void 0 && value !== "" && value !== null;
|
|
14866
15826
|
}).sort(([a], [b]) => a.localeCompare(b));
|
|
14867
|
-
return /* @__PURE__ */
|
|
14868
|
-
/* @__PURE__ */
|
|
14869
|
-
/* @__PURE__ */
|
|
15827
|
+
return /* @__PURE__ */ jsxs47(Fragment20, { children: [
|
|
15828
|
+
/* @__PURE__ */ jsxs47("div", { className: styles.profileSummary, children: [
|
|
15829
|
+
/* @__PURE__ */ jsx109(
|
|
14870
15830
|
Avatar,
|
|
14871
15831
|
{
|
|
14872
15832
|
imageUrl: getMappedUserProfileValue_default("picture", mergedMappings, currentUser),
|
|
@@ -14876,32 +15836,32 @@ var BaseUserProfile = ({
|
|
|
14876
15836
|
isLoading
|
|
14877
15837
|
}
|
|
14878
15838
|
),
|
|
14879
|
-
/* @__PURE__ */
|
|
14880
|
-
getMappedUserProfileValue_default("email", mergedMappings, currentUser) && /* @__PURE__ */
|
|
15839
|
+
/* @__PURE__ */ jsx109(Typography_default, { variant: "h3", fontWeight: "medium", children: displayName }),
|
|
15840
|
+
getMappedUserProfileValue_default("email", mergedMappings, currentUser) && /* @__PURE__ */ jsx109(Typography_default, { variant: "body2", color: "textSecondary", children: getMappedUserProfileValue_default("email", mergedMappings, currentUser) })
|
|
14881
15841
|
] }),
|
|
14882
|
-
/* @__PURE__ */
|
|
14883
|
-
profileEntries.map(([key, value], index) => /* @__PURE__ */
|
|
14884
|
-
/* @__PURE__ */
|
|
14885
|
-
/* @__PURE__ */
|
|
14886
|
-
/* @__PURE__ */
|
|
15842
|
+
/* @__PURE__ */ jsx109(Divider_default, {}),
|
|
15843
|
+
profileEntries.map(([key, value], index) => /* @__PURE__ */ jsxs47("div", { children: [
|
|
15844
|
+
/* @__PURE__ */ jsxs47("div", { className: styles.sectionRow, children: [
|
|
15845
|
+
/* @__PURE__ */ jsx109("div", { className: styles.sectionLabel, children: formatLabel(key) }),
|
|
15846
|
+
/* @__PURE__ */ jsx109("div", { className: styles.sectionValue, children: typeof value === "object" ? /* @__PURE__ */ jsx109(ObjectDisplay, { data: value }) : String(value) })
|
|
14887
15847
|
] }),
|
|
14888
|
-
index < profileEntries.length - 1 && /* @__PURE__ */
|
|
15848
|
+
index < profileEntries.length - 1 && /* @__PURE__ */ jsx109(Divider_default, {})
|
|
14889
15849
|
] }, key))
|
|
14890
15850
|
] });
|
|
14891
15851
|
};
|
|
14892
|
-
const profileContent = /* @__PURE__ */
|
|
14893
|
-
error && /* @__PURE__ */
|
|
15852
|
+
const profileContent = /* @__PURE__ */ jsxs47(Card_default, { className: containerClasses, children: [
|
|
15853
|
+
error && /* @__PURE__ */ jsxs47(
|
|
14894
15854
|
Alert_default,
|
|
14895
15855
|
{
|
|
14896
15856
|
variant: "error",
|
|
14897
|
-
className:
|
|
15857
|
+
className: cx33(withVendorCSSClassPrefix31(bem21("user-profile", "alert")), styles.alert),
|
|
14898
15858
|
children: [
|
|
14899
|
-
/* @__PURE__ */
|
|
14900
|
-
/* @__PURE__ */
|
|
15859
|
+
/* @__PURE__ */ jsx109(Alert_default.Title, { children: t("errors.heading") || "Error" }),
|
|
15860
|
+
/* @__PURE__ */ jsx109(Alert_default.Description, { children: error })
|
|
14901
15861
|
]
|
|
14902
15862
|
}
|
|
14903
15863
|
),
|
|
14904
|
-
schemas && schemas.length > 0 && /* @__PURE__ */
|
|
15864
|
+
schemas && schemas.length > 0 && /* @__PURE__ */ jsx109("div", { className: styles.header, children: /* @__PURE__ */ jsx109(
|
|
14905
15865
|
Avatar,
|
|
14906
15866
|
{
|
|
14907
15867
|
imageUrl: getMappedUserProfileValue_default("picture", mergedMappings, currentUser),
|
|
@@ -14911,7 +15871,7 @@ var BaseUserProfile = ({
|
|
|
14911
15871
|
isLoading
|
|
14912
15872
|
}
|
|
14913
15873
|
) }),
|
|
14914
|
-
/* @__PURE__ */
|
|
15874
|
+
/* @__PURE__ */ jsx109("div", { className: styles.infoContainer, children: schemas && schemas.length > 0 ? schemas.filter((schema) => {
|
|
14915
15875
|
if (!schema.name || !shouldShowField(schema.name)) return false;
|
|
14916
15876
|
if (!editable) {
|
|
14917
15877
|
const value = flattenedProfile && schema.name ? flattenedProfile[schema.name] : void 0;
|
|
@@ -14928,13 +15888,13 @@ var BaseUserProfile = ({
|
|
|
14928
15888
|
...schema,
|
|
14929
15889
|
value
|
|
14930
15890
|
};
|
|
14931
|
-
return /* @__PURE__ */
|
|
15891
|
+
return /* @__PURE__ */ jsx109("div", { className: styles.info, children: renderUserInfo(schemaWithValue) }, schema.name || index);
|
|
14932
15892
|
}) : renderProfileWithoutSchemas() })
|
|
14933
15893
|
] });
|
|
14934
15894
|
if (mode === "popup") {
|
|
14935
|
-
return /* @__PURE__ */
|
|
14936
|
-
/* @__PURE__ */
|
|
14937
|
-
/* @__PURE__ */
|
|
15895
|
+
return /* @__PURE__ */ jsx109(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ jsxs47(Dialog_default.Content, { children: [
|
|
15896
|
+
/* @__PURE__ */ jsx109(Dialog_default.Heading, { children: title ?? t("user.profile.heading") }),
|
|
15897
|
+
/* @__PURE__ */ jsx109("div", { className: styles.popup, children: profileContent })
|
|
14938
15898
|
] }) });
|
|
14939
15899
|
}
|
|
14940
15900
|
return profileContent;
|
|
@@ -14943,7 +15903,7 @@ var BaseUserProfile_default = BaseUserProfile;
|
|
|
14943
15903
|
|
|
14944
15904
|
// src/components/presentation/UserProfile/UserProfile.tsx
|
|
14945
15905
|
import { AsgardeoError } from "@asgardeo/browser";
|
|
14946
|
-
import { useState as
|
|
15906
|
+
import { useState as useState30 } from "react";
|
|
14947
15907
|
|
|
14948
15908
|
// src/api/updateMeProfile.ts
|
|
14949
15909
|
import {
|
|
@@ -14976,12 +15936,12 @@ var updateMeProfile = async ({ fetcher, instanceId = 0, ...requestConfig }) => {
|
|
|
14976
15936
|
var updateMeProfile_default = updateMeProfile;
|
|
14977
15937
|
|
|
14978
15938
|
// src/components/presentation/UserProfile/UserProfile.tsx
|
|
14979
|
-
import { jsx as
|
|
15939
|
+
import { jsx as jsx110 } from "react/jsx-runtime";
|
|
14980
15940
|
var UserProfile3 = ({ preferences, ...rest }) => {
|
|
14981
15941
|
const { baseUrl, instanceId } = useAsgardeo_default();
|
|
14982
15942
|
const { profile, flattenedProfile, schemas, onUpdateProfile } = useUser_default();
|
|
14983
15943
|
const { t } = useTranslation_default(preferences?.i18n);
|
|
14984
|
-
const [error, setError] =
|
|
15944
|
+
const [error, setError] = useState30(null);
|
|
14985
15945
|
const handleProfileUpdate = async (payload) => {
|
|
14986
15946
|
setError(null);
|
|
14987
15947
|
try {
|
|
@@ -14995,7 +15955,7 @@ var UserProfile3 = ({ preferences, ...rest }) => {
|
|
|
14995
15955
|
setError(message);
|
|
14996
15956
|
}
|
|
14997
15957
|
};
|
|
14998
|
-
return /* @__PURE__ */
|
|
15958
|
+
return /* @__PURE__ */ jsx110(
|
|
14999
15959
|
BaseUserProfile_default,
|
|
15000
15960
|
{
|
|
15001
15961
|
profile,
|
|
@@ -15011,8 +15971,8 @@ var UserProfile3 = ({ preferences, ...rest }) => {
|
|
|
15011
15971
|
var UserProfile_default = UserProfile3;
|
|
15012
15972
|
|
|
15013
15973
|
// src/components/presentation/UserDropdown/BaseUserDropdown.tsx
|
|
15014
|
-
import { withVendorCSSClassPrefix as
|
|
15015
|
-
import { cx as
|
|
15974
|
+
import { withVendorCSSClassPrefix as withVendorCSSClassPrefix32 } from "@asgardeo/browser";
|
|
15975
|
+
import { cx as cx34 } from "@emotion/css";
|
|
15016
15976
|
import {
|
|
15017
15977
|
useFloating as useFloating2,
|
|
15018
15978
|
autoUpdate,
|
|
@@ -15026,7 +15986,7 @@ import {
|
|
|
15026
15986
|
FloatingFocusManager as FloatingFocusManager2,
|
|
15027
15987
|
FloatingPortal as FloatingPortal2
|
|
15028
15988
|
} from "@floating-ui/react";
|
|
15029
|
-
import { useState as
|
|
15989
|
+
import { useState as useState31 } from "react";
|
|
15030
15990
|
|
|
15031
15991
|
// src/components/presentation/UserDropdown/BaseUserDropdown.styles.ts
|
|
15032
15992
|
import { css as css29 } from "@emotion/css";
|
|
@@ -15218,7 +16178,7 @@ var useStyles28 = (theme, colorScheme) => useMemo39(() => {
|
|
|
15218
16178
|
var BaseUserDropdown_styles_default = useStyles28;
|
|
15219
16179
|
|
|
15220
16180
|
// src/components/presentation/UserDropdown/BaseUserDropdown.tsx
|
|
15221
|
-
import { jsx as
|
|
16181
|
+
import { jsx as jsx111, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
15222
16182
|
var BaseUserDropdown = ({
|
|
15223
16183
|
fallback = null,
|
|
15224
16184
|
className = "",
|
|
@@ -15234,8 +16194,8 @@ var BaseUserDropdown = ({
|
|
|
15234
16194
|
}) => {
|
|
15235
16195
|
const { theme, colorScheme } = useTheme_default();
|
|
15236
16196
|
const styles = BaseUserDropdown_styles_default(theme, colorScheme);
|
|
15237
|
-
const [isOpen, setIsOpen] =
|
|
15238
|
-
const [hoveredItemIndex, setHoveredItemIndex] =
|
|
16197
|
+
const [isOpen, setIsOpen] = useState31(false);
|
|
16198
|
+
const [hoveredItemIndex, setHoveredItemIndex] = useState31(null);
|
|
15239
16199
|
const { refs, floatingStyles, context } = useFloating2({
|
|
15240
16200
|
middleware: [offset(5), flip({ fallbackAxisSideDirection: "end" }), shift({ padding: 5 })],
|
|
15241
16201
|
onOpenChange: setIsOpen,
|
|
@@ -15270,14 +16230,14 @@ var BaseUserDropdown = ({
|
|
|
15270
16230
|
const defaultMenuItems = [];
|
|
15271
16231
|
if (onManageProfile) {
|
|
15272
16232
|
defaultMenuItems.push({
|
|
15273
|
-
icon: /* @__PURE__ */
|
|
16233
|
+
icon: /* @__PURE__ */ jsx111(User_default2, { width: "16", height: "16" }),
|
|
15274
16234
|
label: "Manage Profile",
|
|
15275
16235
|
onClick: onManageProfile
|
|
15276
16236
|
});
|
|
15277
16237
|
}
|
|
15278
16238
|
if (onSignOut) {
|
|
15279
16239
|
defaultMenuItems.push({
|
|
15280
|
-
icon: /* @__PURE__ */
|
|
16240
|
+
icon: /* @__PURE__ */ jsx111(LogOut_default, { width: "16", height: "16" }),
|
|
15281
16241
|
label: "Sign Out",
|
|
15282
16242
|
onClick: onSignOut
|
|
15283
16243
|
});
|
|
@@ -15289,19 +16249,19 @@ var BaseUserDropdown = ({
|
|
|
15289
16249
|
}
|
|
15290
16250
|
allMenuItems.push(...defaultMenuItems);
|
|
15291
16251
|
}
|
|
15292
|
-
return /* @__PURE__ */
|
|
15293
|
-
/* @__PURE__ */
|
|
16252
|
+
return /* @__PURE__ */ jsxs48("div", { className: cx34(withVendorCSSClassPrefix32("user-dropdown"), className), children: [
|
|
16253
|
+
/* @__PURE__ */ jsxs48(
|
|
15294
16254
|
Button_default,
|
|
15295
16255
|
{
|
|
15296
16256
|
ref: refs.setReference,
|
|
15297
|
-
className:
|
|
16257
|
+
className: cx34(withVendorCSSClassPrefix32("user-dropdown__trigger"), styles["trigger"]),
|
|
15298
16258
|
color: "tertiary",
|
|
15299
16259
|
variant: "text",
|
|
15300
16260
|
size: "medium",
|
|
15301
16261
|
"data-testid": "asgardeo-user-dropdown-trigger",
|
|
15302
16262
|
...getReferenceProps(),
|
|
15303
16263
|
children: [
|
|
15304
|
-
/* @__PURE__ */
|
|
16264
|
+
/* @__PURE__ */ jsx111(
|
|
15305
16265
|
Avatar,
|
|
15306
16266
|
{
|
|
15307
16267
|
imageUrl: getMappedUserProfileValue_default("picture", mergedMappings, user),
|
|
@@ -15310,22 +16270,22 @@ var BaseUserDropdown = ({
|
|
|
15310
16270
|
alt: `${getDisplayName_default(mergedMappings, user)}'s avatar`
|
|
15311
16271
|
}
|
|
15312
16272
|
),
|
|
15313
|
-
showTriggerLabel && /* @__PURE__ */
|
|
16273
|
+
showTriggerLabel && /* @__PURE__ */ jsx111(
|
|
15314
16274
|
Typography_default,
|
|
15315
16275
|
{
|
|
15316
16276
|
variant: "body2",
|
|
15317
|
-
className:
|
|
16277
|
+
className: cx34(withVendorCSSClassPrefix32("user-dropdown__trigger-label"), styles["userName"]),
|
|
15318
16278
|
children: getDisplayName_default(mergedMappings, user)
|
|
15319
16279
|
}
|
|
15320
16280
|
)
|
|
15321
16281
|
]
|
|
15322
16282
|
}
|
|
15323
16283
|
),
|
|
15324
|
-
isOpen && /* @__PURE__ */
|
|
16284
|
+
isOpen && /* @__PURE__ */ jsx111(FloatingPortal2, { id: portalId, children: /* @__PURE__ */ jsx111(FloatingFocusManager2, { context, modal: false, initialFocus: -1, children: /* @__PURE__ */ jsxs48(
|
|
15325
16285
|
"div",
|
|
15326
16286
|
{
|
|
15327
16287
|
ref: refs.setFloating,
|
|
15328
|
-
className:
|
|
16288
|
+
className: cx34(withVendorCSSClassPrefix32("user-dropdown__content"), styles["dropdownContent"]),
|
|
15329
16289
|
style: {
|
|
15330
16290
|
...floatingStyles,
|
|
15331
16291
|
// Floating UI doesn't set a z-index by default, so we set a high value to ensure the dropdown appears above other elements.
|
|
@@ -15334,8 +16294,8 @@ var BaseUserDropdown = ({
|
|
|
15334
16294
|
},
|
|
15335
16295
|
...getFloatingProps(),
|
|
15336
16296
|
children: [
|
|
15337
|
-
/* @__PURE__ */
|
|
15338
|
-
/* @__PURE__ */
|
|
16297
|
+
/* @__PURE__ */ jsxs48("div", { className: cx34(withVendorCSSClassPrefix32("user-dropdown__header"), styles["dropdownHeader"]), children: [
|
|
16298
|
+
/* @__PURE__ */ jsx111(
|
|
15339
16299
|
Avatar,
|
|
15340
16300
|
{
|
|
15341
16301
|
imageUrl: getMappedUserProfileValue_default("picture", mergedMappings, user),
|
|
@@ -15344,22 +16304,22 @@ var BaseUserDropdown = ({
|
|
|
15344
16304
|
alt: `${getDisplayName_default(mergedMappings, user)}'s avatar`
|
|
15345
16305
|
}
|
|
15346
16306
|
),
|
|
15347
|
-
/* @__PURE__ */
|
|
15348
|
-
/* @__PURE__ */
|
|
16307
|
+
/* @__PURE__ */ jsxs48("div", { className: cx34(withVendorCSSClassPrefix32("user-dropdown__header-info"), styles["headerInfo"]), children: [
|
|
16308
|
+
/* @__PURE__ */ jsx111(
|
|
15349
16309
|
Typography_default,
|
|
15350
16310
|
{
|
|
15351
16311
|
noWrap: true,
|
|
15352
|
-
className:
|
|
16312
|
+
className: withVendorCSSClassPrefix32("user-dropdown__header-name"),
|
|
15353
16313
|
variant: "body1",
|
|
15354
16314
|
fontWeight: "medium",
|
|
15355
16315
|
children: getDisplayName_default(mergedMappings, user)
|
|
15356
16316
|
}
|
|
15357
16317
|
),
|
|
15358
|
-
/* @__PURE__ */
|
|
16318
|
+
/* @__PURE__ */ jsx111(
|
|
15359
16319
|
Typography_default,
|
|
15360
16320
|
{
|
|
15361
16321
|
noWrap: true,
|
|
15362
|
-
className:
|
|
16322
|
+
className: withVendorCSSClassPrefix32("user-dropdown__header-email"),
|
|
15363
16323
|
variant: "caption",
|
|
15364
16324
|
color: "secondary",
|
|
15365
16325
|
children: getMappedUserProfileValue_default("username", mergedMappings, user) || getMappedUserProfileValue_default("email", mergedMappings, user)
|
|
@@ -15367,25 +16327,25 @@ var BaseUserDropdown = ({
|
|
|
15367
16327
|
)
|
|
15368
16328
|
] })
|
|
15369
16329
|
] }),
|
|
15370
|
-
/* @__PURE__ */
|
|
16330
|
+
/* @__PURE__ */ jsx111("div", { className: cx34(withVendorCSSClassPrefix32("user-dropdown__menu"), styles["dropdownMenu"]), children: allMenuItems.map((item, index) => /* @__PURE__ */ jsx111("div", { children: (() => {
|
|
15371
16331
|
if (item.label === "") {
|
|
15372
|
-
return /* @__PURE__ */
|
|
16332
|
+
return /* @__PURE__ */ jsx111(
|
|
15373
16333
|
"div",
|
|
15374
16334
|
{
|
|
15375
|
-
className:
|
|
16335
|
+
className: cx34(withVendorCSSClassPrefix32("user-dropdown__menu-divider"), styles["divider"])
|
|
15376
16336
|
}
|
|
15377
16337
|
);
|
|
15378
16338
|
}
|
|
15379
16339
|
if (item.href) {
|
|
15380
|
-
return /* @__PURE__ */
|
|
16340
|
+
return /* @__PURE__ */ jsxs48(
|
|
15381
16341
|
"a",
|
|
15382
16342
|
{
|
|
15383
16343
|
href: item.href,
|
|
15384
16344
|
style: {
|
|
15385
16345
|
backgroundColor: hoveredItemIndex === index ? theme.vars.colors.action?.hover : "transparent"
|
|
15386
16346
|
},
|
|
15387
|
-
className:
|
|
15388
|
-
|
|
16347
|
+
className: cx34(
|
|
16348
|
+
withVendorCSSClassPrefix32("user-dropdown__menu-item"),
|
|
15389
16349
|
styles["menuItemAnchor"]
|
|
15390
16350
|
),
|
|
15391
16351
|
onMouseEnter: () => setHoveredItemIndex(index),
|
|
@@ -15394,19 +16354,19 @@ var BaseUserDropdown = ({
|
|
|
15394
16354
|
onBlur: () => setHoveredItemIndex(null),
|
|
15395
16355
|
children: [
|
|
15396
16356
|
item.icon,
|
|
15397
|
-
/* @__PURE__ */
|
|
16357
|
+
/* @__PURE__ */ jsx111("span", { children: item.label })
|
|
15398
16358
|
]
|
|
15399
16359
|
}
|
|
15400
16360
|
);
|
|
15401
16361
|
}
|
|
15402
|
-
return /* @__PURE__ */
|
|
16362
|
+
return /* @__PURE__ */ jsx111(
|
|
15403
16363
|
Button_default,
|
|
15404
16364
|
{
|
|
15405
16365
|
onClick: () => handleMenuItemClick(item),
|
|
15406
16366
|
style: {
|
|
15407
16367
|
backgroundColor: hoveredItemIndex === index ? theme.vars.colors.action?.hover : "transparent"
|
|
15408
16368
|
},
|
|
15409
|
-
className:
|
|
16369
|
+
className: cx34(withVendorCSSClassPrefix32("user-dropdown__menu-item"), styles["menuItem"]),
|
|
15410
16370
|
color: "tertiary",
|
|
15411
16371
|
variant: "text",
|
|
15412
16372
|
size: "small",
|
|
@@ -15425,8 +16385,8 @@ var BaseUserDropdown = ({
|
|
|
15425
16385
|
var BaseUserDropdown_default = BaseUserDropdown;
|
|
15426
16386
|
|
|
15427
16387
|
// src/components/presentation/UserDropdown/UserDropdown.tsx
|
|
15428
|
-
import { useState as
|
|
15429
|
-
import { Fragment as Fragment21, jsx as
|
|
16388
|
+
import { useState as useState32 } from "react";
|
|
16389
|
+
import { Fragment as Fragment21, jsx as jsx112, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
15430
16390
|
var UserDropdown = ({
|
|
15431
16391
|
children,
|
|
15432
16392
|
renderTrigger,
|
|
@@ -15435,7 +16395,7 @@ var UserDropdown = ({
|
|
|
15435
16395
|
...rest
|
|
15436
16396
|
}) => {
|
|
15437
16397
|
const { user, isLoading, signOut, meta } = useAsgardeo_default();
|
|
15438
|
-
const [isProfileOpen, setIsProfileOpen] =
|
|
16398
|
+
const [isProfileOpen, setIsProfileOpen] = useState32(false);
|
|
15439
16399
|
const handleManageProfile = () => {
|
|
15440
16400
|
setIsProfileOpen(true);
|
|
15441
16401
|
};
|
|
@@ -15458,14 +16418,14 @@ var UserDropdown = ({
|
|
|
15458
16418
|
user
|
|
15459
16419
|
};
|
|
15460
16420
|
if (children) {
|
|
15461
|
-
return /* @__PURE__ */
|
|
16421
|
+
return /* @__PURE__ */ jsxs49(Fragment21, { children: [
|
|
15462
16422
|
children(renderProps),
|
|
15463
|
-
/* @__PURE__ */
|
|
16423
|
+
/* @__PURE__ */ jsx112(UserProfile_default, { mode: "popup", open: isProfileOpen, onOpenChange: setIsProfileOpen })
|
|
15464
16424
|
] });
|
|
15465
16425
|
}
|
|
15466
16426
|
if (renderTrigger || renderDropdown) {
|
|
15467
|
-
return /* @__PURE__ */
|
|
15468
|
-
renderTrigger ? renderTrigger(renderProps) : /* @__PURE__ */
|
|
16427
|
+
return /* @__PURE__ */ jsxs49(Fragment21, { children: [
|
|
16428
|
+
renderTrigger ? renderTrigger(renderProps) : /* @__PURE__ */ jsx112(
|
|
15469
16429
|
BaseUserDropdown,
|
|
15470
16430
|
{
|
|
15471
16431
|
user,
|
|
@@ -15475,11 +16435,11 @@ var UserDropdown = ({
|
|
|
15475
16435
|
...rest
|
|
15476
16436
|
}
|
|
15477
16437
|
),
|
|
15478
|
-
/* @__PURE__ */
|
|
16438
|
+
/* @__PURE__ */ jsx112(UserProfile_default, { mode: "popup", open: isProfileOpen, onOpenChange: setIsProfileOpen })
|
|
15479
16439
|
] });
|
|
15480
16440
|
}
|
|
15481
|
-
return /* @__PURE__ */
|
|
15482
|
-
/* @__PURE__ */
|
|
16441
|
+
return /* @__PURE__ */ jsxs49(Fragment21, { children: [
|
|
16442
|
+
/* @__PURE__ */ jsx112(
|
|
15483
16443
|
BaseUserDropdown,
|
|
15484
16444
|
{
|
|
15485
16445
|
user,
|
|
@@ -15489,13 +16449,13 @@ var UserDropdown = ({
|
|
|
15489
16449
|
...rest
|
|
15490
16450
|
}
|
|
15491
16451
|
),
|
|
15492
|
-
isProfileOpen && /* @__PURE__ */
|
|
16452
|
+
isProfileOpen && /* @__PURE__ */ jsx112(UserProfile_default, { mode: "popup", open: isProfileOpen, onOpenChange: setIsProfileOpen })
|
|
15493
16453
|
] });
|
|
15494
16454
|
};
|
|
15495
16455
|
var UserDropdown_default = UserDropdown;
|
|
15496
16456
|
|
|
15497
16457
|
// src/components/presentation/OrganizationSwitcher/BaseOrganizationSwitcher.tsx
|
|
15498
|
-
import { cx as
|
|
16458
|
+
import { cx as cx35 } from "@emotion/css";
|
|
15499
16459
|
import {
|
|
15500
16460
|
useFloating as useFloating3,
|
|
15501
16461
|
autoUpdate as autoUpdate2,
|
|
@@ -15509,7 +16469,7 @@ import {
|
|
|
15509
16469
|
FloatingFocusManager as FloatingFocusManager3,
|
|
15510
16470
|
FloatingPortal as FloatingPortal3
|
|
15511
16471
|
} from "@floating-ui/react";
|
|
15512
|
-
import { useState as
|
|
16472
|
+
import { useState as useState33 } from "react";
|
|
15513
16473
|
|
|
15514
16474
|
// src/components/presentation/OrganizationSwitcher/BaseOrganizationSwitcher.styles.ts
|
|
15515
16475
|
import { css as css30 } from "@emotion/css";
|
|
@@ -15737,9 +16697,9 @@ var useStyles29 = (theme, colorScheme) => useMemo40(() => {
|
|
|
15737
16697
|
var BaseOrganizationSwitcher_styles_default = useStyles29;
|
|
15738
16698
|
|
|
15739
16699
|
// src/components/primitives/Icons/Building.tsx
|
|
15740
|
-
import { jsx as
|
|
15741
|
-
var Building = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */
|
|
15742
|
-
/* @__PURE__ */
|
|
16700
|
+
import { jsx as jsx113, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
16701
|
+
var Building = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */ jsxs50("svg", { width, height, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
16702
|
+
/* @__PURE__ */ jsx113(
|
|
15743
16703
|
"path",
|
|
15744
16704
|
{
|
|
15745
16705
|
d: "M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",
|
|
@@ -15749,30 +16709,30 @@ var Building = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PU
|
|
|
15749
16709
|
strokeLinejoin: "round"
|
|
15750
16710
|
}
|
|
15751
16711
|
),
|
|
15752
|
-
/* @__PURE__ */
|
|
15753
|
-
/* @__PURE__ */
|
|
15754
|
-
/* @__PURE__ */
|
|
15755
|
-
/* @__PURE__ */
|
|
15756
|
-
/* @__PURE__ */
|
|
15757
|
-
/* @__PURE__ */
|
|
16712
|
+
/* @__PURE__ */ jsx113("path", { d: "M6 12h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
16713
|
+
/* @__PURE__ */ jsx113("path", { d: "M6 8h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
16714
|
+
/* @__PURE__ */ jsx113("path", { d: "M14 8h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
16715
|
+
/* @__PURE__ */ jsx113("path", { d: "M14 12h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
16716
|
+
/* @__PURE__ */ jsx113("path", { d: "M6 18h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
16717
|
+
/* @__PURE__ */ jsx113("path", { d: "M14 18h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
15758
16718
|
] });
|
|
15759
16719
|
Building.displayName = "Building";
|
|
15760
16720
|
var Building_default = Building;
|
|
15761
16721
|
|
|
15762
16722
|
// src/components/primitives/Icons/Check.tsx
|
|
15763
|
-
import { jsx as
|
|
15764
|
-
var Check = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */
|
|
16723
|
+
import { jsx as jsx114 } from "react/jsx-runtime";
|
|
16724
|
+
var Check = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */ jsx114("svg", { width, height, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx114("path", { d: "M20 6 9 17l-5-5", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
15765
16725
|
Check.displayName = "Check";
|
|
15766
16726
|
var Check_default = Check;
|
|
15767
16727
|
|
|
15768
16728
|
// src/components/primitives/Icons/ChevronDown.tsx
|
|
15769
|
-
import { jsx as
|
|
15770
|
-
var ChevronDown = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */
|
|
16729
|
+
import { jsx as jsx115 } from "react/jsx-runtime";
|
|
16730
|
+
var ChevronDown = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */ jsx115("svg", { width, height, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx115("path", { d: "m6 9 6 6 6-6", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
15771
16731
|
ChevronDown.displayName = "ChevronDown";
|
|
15772
16732
|
var ChevronDown_default = ChevronDown;
|
|
15773
16733
|
|
|
15774
16734
|
// src/components/presentation/OrganizationSwitcher/BaseOrganizationSwitcher.tsx
|
|
15775
|
-
import { Fragment as Fragment22, jsx as
|
|
16735
|
+
import { Fragment as Fragment22, jsx as jsx116, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
15776
16736
|
var BaseOrganizationSwitcher = ({
|
|
15777
16737
|
organizations,
|
|
15778
16738
|
currentOrganization,
|
|
@@ -15796,8 +16756,8 @@ var BaseOrganizationSwitcher = ({
|
|
|
15796
16756
|
}) => {
|
|
15797
16757
|
const { theme, colorScheme, direction } = useTheme_default();
|
|
15798
16758
|
const styles = BaseOrganizationSwitcher_styles_default(theme, colorScheme);
|
|
15799
|
-
const [isOpen, setIsOpen] =
|
|
15800
|
-
const [hoveredItemIndex, setHoveredItemIndex] =
|
|
16759
|
+
const [isOpen, setIsOpen] = useState33(false);
|
|
16760
|
+
const [hoveredItemIndex, setHoveredItemIndex] = useState33(null);
|
|
15801
16761
|
const { t } = useTranslation_default(preferences?.i18n);
|
|
15802
16762
|
const isRTL = direction === "rtl";
|
|
15803
16763
|
const { refs, floatingStyles, context } = useFloating3({
|
|
@@ -15827,8 +16787,8 @@ var BaseOrganizationSwitcher = ({
|
|
|
15827
16787
|
const switchableOrganizations = organizations.filter(
|
|
15828
16788
|
(org) => org.id !== currentOrganization?.id
|
|
15829
16789
|
);
|
|
15830
|
-
const defaultRenderOrganization2 = (organization, isSelected) => /* @__PURE__ */
|
|
15831
|
-
/* @__PURE__ */
|
|
16790
|
+
const defaultRenderOrganization2 = (organization, isSelected) => /* @__PURE__ */ jsxs51(Fragment22, { children: [
|
|
16791
|
+
/* @__PURE__ */ jsx116(
|
|
15832
16792
|
Avatar,
|
|
15833
16793
|
{
|
|
15834
16794
|
variant: "square",
|
|
@@ -15838,35 +16798,35 @@ var BaseOrganizationSwitcher = ({
|
|
|
15838
16798
|
alt: `${organization.name} avatar`
|
|
15839
16799
|
}
|
|
15840
16800
|
),
|
|
15841
|
-
/* @__PURE__ */
|
|
15842
|
-
/* @__PURE__ */
|
|
15843
|
-
/* @__PURE__ */
|
|
15844
|
-
showMemberCount && organization.memberCount !== void 0 && /* @__PURE__ */
|
|
16801
|
+
/* @__PURE__ */ jsxs51("div", { className: cx35(styles["organizationInfo"]), children: [
|
|
16802
|
+
/* @__PURE__ */ jsx116(Typography_default, { variant: "body2", fontWeight: "medium", className: cx35(styles["organizationName"]), children: organization.name }),
|
|
16803
|
+
/* @__PURE__ */ jsxs51("div", { className: cx35(styles["organizationMeta"]), children: [
|
|
16804
|
+
showMemberCount && organization.memberCount !== void 0 && /* @__PURE__ */ jsxs51("span", { children: [
|
|
15845
16805
|
organization.memberCount,
|
|
15846
16806
|
" ",
|
|
15847
16807
|
organization.memberCount === 1 ? t("organization.switcher.member") : t("organization.switcher.members")
|
|
15848
16808
|
] }),
|
|
15849
|
-
showRole && organization.role && showMemberCount && organization.memberCount !== void 0 && /* @__PURE__ */
|
|
15850
|
-
showRole && organization.role && /* @__PURE__ */
|
|
16809
|
+
showRole && organization.role && showMemberCount && organization.memberCount !== void 0 && /* @__PURE__ */ jsx116("span", { children: " \u2022 " }),
|
|
16810
|
+
showRole && organization.role && /* @__PURE__ */ jsx116("span", { className: cx35(styles["roleCapitalized"]), children: organization.role })
|
|
15851
16811
|
] })
|
|
15852
16812
|
] }),
|
|
15853
|
-
isSelected && /* @__PURE__ */
|
|
16813
|
+
isSelected && /* @__PURE__ */ jsx116(Check_default, { width: "16", height: "16", color: theme.vars.colors.text.primary })
|
|
15854
16814
|
] });
|
|
15855
|
-
const defaultRenderLoading2 = () => /* @__PURE__ */
|
|
15856
|
-
const defaultRenderError2 = (errorMessage) => /* @__PURE__ */
|
|
15857
|
-
return /* @__PURE__ */
|
|
15858
|
-
/* @__PURE__ */
|
|
16815
|
+
const defaultRenderLoading2 = () => /* @__PURE__ */ jsx116("div", { className: cx35(styles["loadingContainer"]), children: /* @__PURE__ */ jsx116(Typography_default, { variant: "caption", className: cx35(styles["loadingText"]), children: t("organization.switcher.loading.placeholder.organizations") }) });
|
|
16816
|
+
const defaultRenderError2 = (errorMessage) => /* @__PURE__ */ jsx116("div", { className: cx35(styles["errorContainer"]), children: /* @__PURE__ */ jsx116(Typography_default, { variant: "caption", className: cx35(styles["errorText"]), children: errorMessage }) });
|
|
16817
|
+
return /* @__PURE__ */ jsxs51("div", { className: cx35(styles["root"], className), style, children: [
|
|
16818
|
+
/* @__PURE__ */ jsxs51(
|
|
15859
16819
|
Button_default,
|
|
15860
16820
|
{
|
|
15861
16821
|
ref: refs.setReference,
|
|
15862
|
-
className:
|
|
16822
|
+
className: cx35(styles["trigger"]),
|
|
15863
16823
|
color: "tertiary",
|
|
15864
16824
|
variant: "outline",
|
|
15865
16825
|
size: "medium",
|
|
15866
16826
|
...getReferenceProps(),
|
|
15867
16827
|
children: [
|
|
15868
|
-
currentOrganization ? /* @__PURE__ */
|
|
15869
|
-
/* @__PURE__ */
|
|
16828
|
+
currentOrganization ? /* @__PURE__ */ jsxs51(Fragment22, { children: [
|
|
16829
|
+
/* @__PURE__ */ jsx116(
|
|
15870
16830
|
Avatar,
|
|
15871
16831
|
{
|
|
15872
16832
|
variant: "square",
|
|
@@ -15876,25 +16836,25 @@ var BaseOrganizationSwitcher = ({
|
|
|
15876
16836
|
alt: `${currentOrganization.name} avatar`
|
|
15877
16837
|
}
|
|
15878
16838
|
),
|
|
15879
|
-
showTriggerLabel && /* @__PURE__ */
|
|
15880
|
-
] }) : /* @__PURE__ */
|
|
15881
|
-
/* @__PURE__ */
|
|
15882
|
-
showTriggerLabel && /* @__PURE__ */
|
|
16839
|
+
showTriggerLabel && /* @__PURE__ */ jsx116(Typography_default, { variant: "body2", className: cx35(styles["triggerLabel"]), children: currentOrganization.name })
|
|
16840
|
+
] }) : /* @__PURE__ */ jsxs51(Fragment22, { children: [
|
|
16841
|
+
/* @__PURE__ */ jsx116(Building_default, { width: avatarSize, height: avatarSize }),
|
|
16842
|
+
showTriggerLabel && /* @__PURE__ */ jsx116(Typography_default, { variant: "body2", className: cx35(styles["triggerLabel"]), children: t("elements.fields.organization.select.label") })
|
|
15883
16843
|
] }),
|
|
15884
|
-
/* @__PURE__ */
|
|
16844
|
+
/* @__PURE__ */ jsx116("span", { style: { display: "inline-flex", transform: isRTL ? "scaleX(-1)" : "none" }, children: /* @__PURE__ */ jsx116(ChevronDown_default, { width: "16", height: "16" }) })
|
|
15885
16845
|
]
|
|
15886
16846
|
}
|
|
15887
16847
|
),
|
|
15888
|
-
isOpen && /* @__PURE__ */
|
|
16848
|
+
isOpen && /* @__PURE__ */ jsx116(FloatingPortal3, { id: portalId, children: /* @__PURE__ */ jsx116(FloatingFocusManager3, { context, modal: false, initialFocus: -1, children: /* @__PURE__ */ jsxs51(
|
|
15889
16849
|
"div",
|
|
15890
16850
|
{
|
|
15891
16851
|
ref: refs.setFloating,
|
|
15892
|
-
className:
|
|
16852
|
+
className: cx35(styles["content"]),
|
|
15893
16853
|
style: floatingStyles,
|
|
15894
16854
|
...getFloatingProps(),
|
|
15895
16855
|
children: [
|
|
15896
|
-
currentOrganization && /* @__PURE__ */
|
|
15897
|
-
/* @__PURE__ */
|
|
16856
|
+
currentOrganization && /* @__PURE__ */ jsxs51("div", { className: cx35(styles["header"]), children: [
|
|
16857
|
+
/* @__PURE__ */ jsx116(
|
|
15898
16858
|
Avatar,
|
|
15899
16859
|
{
|
|
15900
16860
|
variant: "square",
|
|
@@ -15904,10 +16864,10 @@ var BaseOrganizationSwitcher = ({
|
|
|
15904
16864
|
alt: `${currentOrganization.name} avatar`
|
|
15905
16865
|
}
|
|
15906
16866
|
),
|
|
15907
|
-
/* @__PURE__ */
|
|
15908
|
-
/* @__PURE__ */
|
|
15909
|
-
/* @__PURE__ */
|
|
15910
|
-
showMemberCount && currentOrganization.memberCount !== void 0 && /* @__PURE__ */
|
|
16867
|
+
/* @__PURE__ */ jsxs51("div", { className: cx35(styles["headerInfo"]), children: [
|
|
16868
|
+
/* @__PURE__ */ jsx116(Typography_default, { noWrap: true, className: cx35(styles["headerName"]), variant: "body1", fontWeight: "medium", children: currentOrganization.name }),
|
|
16869
|
+
/* @__PURE__ */ jsxs51("div", { className: cx35(styles["headerMeta"]), children: [
|
|
16870
|
+
showMemberCount && currentOrganization.memberCount !== void 0 && /* @__PURE__ */ jsxs51(
|
|
15911
16871
|
Typography_default,
|
|
15912
16872
|
{
|
|
15913
16873
|
noWrap: true,
|
|
@@ -15917,17 +16877,17 @@ var BaseOrganizationSwitcher = ({
|
|
|
15917
16877
|
currentOrganization.memberCount,
|
|
15918
16878
|
" ",
|
|
15919
16879
|
currentOrganization.memberCount === 1 ? t("organization.switcher.member") : t("organization.switcher.members"),
|
|
15920
|
-
showRole && currentOrganization.role && /* @__PURE__ */
|
|
16880
|
+
showRole && currentOrganization.role && /* @__PURE__ */ jsxs51("span", { children: [
|
|
15921
16881
|
" \u2022 ",
|
|
15922
16882
|
currentOrganization.role
|
|
15923
16883
|
] })
|
|
15924
16884
|
]
|
|
15925
16885
|
}
|
|
15926
16886
|
),
|
|
15927
|
-
showRole && currentOrganization.role && (!showMemberCount || currentOrganization.memberCount === void 0) && /* @__PURE__ */
|
|
16887
|
+
showRole && currentOrganization.role && (!showMemberCount || currentOrganization.memberCount === void 0) && /* @__PURE__ */ jsx116(Typography_default, { noWrap: true, className: cx35(styles["headerRole"]), variant: "caption", color: "secondary", children: currentOrganization.role })
|
|
15928
16888
|
] })
|
|
15929
16889
|
] }),
|
|
15930
|
-
onManageProfile && /* @__PURE__ */
|
|
16890
|
+
onManageProfile && /* @__PURE__ */ jsx116(
|
|
15931
16891
|
Button_default,
|
|
15932
16892
|
{
|
|
15933
16893
|
onClick: onManageProfile,
|
|
@@ -15935,8 +16895,8 @@ var BaseOrganizationSwitcher = ({
|
|
|
15935
16895
|
variant: "outline",
|
|
15936
16896
|
size: "small",
|
|
15937
16897
|
"aria-label": "Manage Organization Profile",
|
|
15938
|
-
className:
|
|
15939
|
-
endIcon: /* @__PURE__ */
|
|
16898
|
+
className: cx35(styles["manageButton"]),
|
|
16899
|
+
endIcon: /* @__PURE__ */ jsxs51(
|
|
15940
16900
|
"svg",
|
|
15941
16901
|
{
|
|
15942
16902
|
width: "16",
|
|
@@ -15948,8 +16908,8 @@ var BaseOrganizationSwitcher = ({
|
|
|
15948
16908
|
strokeLinecap: "round",
|
|
15949
16909
|
strokeLinejoin: "round",
|
|
15950
16910
|
children: [
|
|
15951
|
-
/* @__PURE__ */
|
|
15952
|
-
/* @__PURE__ */
|
|
16911
|
+
/* @__PURE__ */ jsx116("circle", { cx: "12", cy: "12", r: "3" }),
|
|
16912
|
+
/* @__PURE__ */ jsx116("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" })
|
|
15953
16913
|
]
|
|
15954
16914
|
}
|
|
15955
16915
|
),
|
|
@@ -15957,31 +16917,31 @@ var BaseOrganizationSwitcher = ({
|
|
|
15957
16917
|
}
|
|
15958
16918
|
)
|
|
15959
16919
|
] }),
|
|
15960
|
-
organizations.length > 1 && /* @__PURE__ */
|
|
16920
|
+
organizations.length > 1 && /* @__PURE__ */ jsx116(
|
|
15961
16921
|
"div",
|
|
15962
16922
|
{
|
|
15963
|
-
className:
|
|
16923
|
+
className: cx35(styles["header"], styles["sectionHeaderContainer"]),
|
|
15964
16924
|
style: {
|
|
15965
16925
|
borderTop: currentOrganization ? `1px solid ${theme.vars.colors.border}` : "none"
|
|
15966
16926
|
},
|
|
15967
|
-
children: /* @__PURE__ */
|
|
16927
|
+
children: /* @__PURE__ */ jsx116(Typography_default, { variant: "caption", fontWeight: 600, className: cx35(styles["sectionHeader"]), children: t("organization.switcher.switch.organization") })
|
|
15968
16928
|
}
|
|
15969
16929
|
),
|
|
15970
|
-
/* @__PURE__ */
|
|
16930
|
+
/* @__PURE__ */ jsx116("div", { className: cx35(styles["menu"]), children: (() => {
|
|
15971
16931
|
if (loading) {
|
|
15972
16932
|
return renderLoading ? renderLoading() : defaultRenderLoading2();
|
|
15973
16933
|
}
|
|
15974
16934
|
if (error) {
|
|
15975
16935
|
return renderError ? renderError(error) : defaultRenderError2(error);
|
|
15976
16936
|
}
|
|
15977
|
-
return /* @__PURE__ */
|
|
16937
|
+
return /* @__PURE__ */ jsxs51(Fragment22, { children: [
|
|
15978
16938
|
switchableOrganizations.map((organization) => {
|
|
15979
16939
|
const isSelected = false;
|
|
15980
|
-
return /* @__PURE__ */
|
|
16940
|
+
return /* @__PURE__ */ jsx116(
|
|
15981
16941
|
Button_default,
|
|
15982
16942
|
{
|
|
15983
16943
|
onClick: () => handleOrganizationSwitch(organization),
|
|
15984
|
-
className:
|
|
16944
|
+
className: cx35(styles["menuItem"]),
|
|
15985
16945
|
color: "tertiary",
|
|
15986
16946
|
variant: "text",
|
|
15987
16947
|
size: "small",
|
|
@@ -15995,34 +16955,34 @@ var BaseOrganizationSwitcher = ({
|
|
|
15995
16955
|
organization.id
|
|
15996
16956
|
);
|
|
15997
16957
|
}),
|
|
15998
|
-
menuItems.length > 0 && /* @__PURE__ */
|
|
15999
|
-
/* @__PURE__ */
|
|
16958
|
+
menuItems.length > 0 && /* @__PURE__ */ jsxs51(Fragment22, { children: [
|
|
16959
|
+
/* @__PURE__ */ jsx116("div", { className: cx35(styles["menuDivider"]) }),
|
|
16000
16960
|
menuItems.map(
|
|
16001
|
-
(item, index) => /* @__PURE__ */
|
|
16961
|
+
(item, index) => /* @__PURE__ */ jsx116("div", { children: item.href ? /* @__PURE__ */ jsxs51(
|
|
16002
16962
|
"a",
|
|
16003
16963
|
{
|
|
16004
16964
|
href: item.href,
|
|
16005
16965
|
style: {
|
|
16006
16966
|
backgroundColor: hoveredItemIndex === switchableOrganizations.length + index ? theme.vars.colors.action?.hover : "transparent"
|
|
16007
16967
|
},
|
|
16008
|
-
className:
|
|
16968
|
+
className: cx35(styles["menuItem"]),
|
|
16009
16969
|
onMouseEnter: () => setHoveredItemIndex(switchableOrganizations.length + index),
|
|
16010
16970
|
onMouseLeave: () => setHoveredItemIndex(null),
|
|
16011
16971
|
onFocus: () => setHoveredItemIndex(switchableOrganizations.length + index),
|
|
16012
16972
|
onBlur: () => setHoveredItemIndex(null),
|
|
16013
16973
|
children: [
|
|
16014
16974
|
item.icon,
|
|
16015
|
-
/* @__PURE__ */
|
|
16975
|
+
/* @__PURE__ */ jsx116("span", { children: item.label })
|
|
16016
16976
|
]
|
|
16017
16977
|
}
|
|
16018
|
-
) : /* @__PURE__ */
|
|
16978
|
+
) : /* @__PURE__ */ jsx116(
|
|
16019
16979
|
Button_default,
|
|
16020
16980
|
{
|
|
16021
16981
|
onClick: () => handleMenuItemClick(item),
|
|
16022
16982
|
style: {
|
|
16023
16983
|
backgroundColor: hoveredItemIndex === switchableOrganizations.length + index ? theme.vars.colors.action?.hover : "transparent"
|
|
16024
16984
|
},
|
|
16025
|
-
className:
|
|
16985
|
+
className: cx35(styles["menuItem"]),
|
|
16026
16986
|
color: "tertiary",
|
|
16027
16987
|
variant: "text",
|
|
16028
16988
|
size: "small",
|
|
@@ -16044,11 +17004,11 @@ var BaseOrganizationSwitcher = ({
|
|
|
16044
17004
|
var BaseOrganizationSwitcher_default = BaseOrganizationSwitcher;
|
|
16045
17005
|
|
|
16046
17006
|
// src/components/presentation/OrganizationSwitcher/OrganizationSwitcher.tsx
|
|
16047
|
-
import { useState as
|
|
17007
|
+
import { useState as useState40 } from "react";
|
|
16048
17008
|
|
|
16049
17009
|
// src/components/primitives/Icons/BuildingAlt.tsx
|
|
16050
|
-
import { jsx as
|
|
16051
|
-
var BuildingAlt = ({ height = 24, width = 24 }) => /* @__PURE__ */
|
|
17010
|
+
import { jsx as jsx117, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
17011
|
+
var BuildingAlt = ({ height = 24, width = 24 }) => /* @__PURE__ */ jsxs52(
|
|
16052
17012
|
"svg",
|
|
16053
17013
|
{
|
|
16054
17014
|
width,
|
|
@@ -16061,13 +17021,13 @@ var BuildingAlt = ({ height = 24, width = 24 }) => /* @__PURE__ */ jsxs50(
|
|
|
16061
17021
|
strokeLinecap: "round",
|
|
16062
17022
|
strokeLinejoin: "round",
|
|
16063
17023
|
children: [
|
|
16064
|
-
/* @__PURE__ */
|
|
16065
|
-
/* @__PURE__ */
|
|
16066
|
-
/* @__PURE__ */
|
|
16067
|
-
/* @__PURE__ */
|
|
16068
|
-
/* @__PURE__ */
|
|
16069
|
-
/* @__PURE__ */
|
|
16070
|
-
/* @__PURE__ */
|
|
17024
|
+
/* @__PURE__ */ jsx117("path", { d: "M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z" }),
|
|
17025
|
+
/* @__PURE__ */ jsx117("path", { d: "M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2" }),
|
|
17026
|
+
/* @__PURE__ */ jsx117("path", { d: "M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2" }),
|
|
17027
|
+
/* @__PURE__ */ jsx117("path", { d: "M10 6h4" }),
|
|
17028
|
+
/* @__PURE__ */ jsx117("path", { d: "M10 10h4" }),
|
|
17029
|
+
/* @__PURE__ */ jsx117("path", { d: "M10 14h4" }),
|
|
17030
|
+
/* @__PURE__ */ jsx117("path", { d: "M10 18h4" })
|
|
16071
17031
|
]
|
|
16072
17032
|
}
|
|
16073
17033
|
);
|
|
@@ -16075,12 +17035,12 @@ BuildingAlt.displayName = "BuildingAlt";
|
|
|
16075
17035
|
var BuildingAlt_default = BuildingAlt;
|
|
16076
17036
|
|
|
16077
17037
|
// src/components/presentation/CreateOrganization/CreateOrganization.tsx
|
|
16078
|
-
import { useState as
|
|
17038
|
+
import { useState as useState35 } from "react";
|
|
16079
17039
|
|
|
16080
17040
|
// src/components/presentation/CreateOrganization/BaseCreateOrganization.tsx
|
|
16081
17041
|
import { createPackageComponentLogger as createPackageComponentLogger9 } from "@asgardeo/browser";
|
|
16082
|
-
import { cx as
|
|
16083
|
-
import { useState as
|
|
17042
|
+
import { cx as cx36 } from "@emotion/css";
|
|
17043
|
+
import { useState as useState34 } from "react";
|
|
16084
17044
|
|
|
16085
17045
|
// src/components/presentation/CreateOrganization/BaseCreateOrganization.styles.ts
|
|
16086
17046
|
import { css as css31 } from "@emotion/css";
|
|
@@ -16221,7 +17181,7 @@ var useStyles30 = (theme, colorScheme) => useMemo41(() => {
|
|
|
16221
17181
|
var BaseCreateOrganization_styles_default = useStyles30;
|
|
16222
17182
|
|
|
16223
17183
|
// src/components/presentation/CreateOrganization/BaseCreateOrganization.tsx
|
|
16224
|
-
import { jsx as
|
|
17184
|
+
import { jsx as jsx118, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
16225
17185
|
var logger11 = createPackageComponentLogger9(
|
|
16226
17186
|
"@asgardeo/react",
|
|
16227
17187
|
"BaseCreateOrganization"
|
|
@@ -16248,13 +17208,13 @@ var BaseCreateOrganization = ({
|
|
|
16248
17208
|
const { theme, colorScheme } = useTheme_default();
|
|
16249
17209
|
const styles = BaseCreateOrganization_styles_default(theme, colorScheme);
|
|
16250
17210
|
const { t } = useTranslation_default(preferences?.i18n);
|
|
16251
|
-
const [formData, setFormData] =
|
|
17211
|
+
const [formData, setFormData] = useState34({
|
|
16252
17212
|
description: "",
|
|
16253
17213
|
handle: "",
|
|
16254
17214
|
name: "",
|
|
16255
17215
|
...initialValues
|
|
16256
17216
|
});
|
|
16257
|
-
const [formErrors, setFormErrors] =
|
|
17217
|
+
const [formErrors, setFormErrors] = useState34({});
|
|
16258
17218
|
const validateForm = () => {
|
|
16259
17219
|
const errors = {};
|
|
16260
17220
|
if (!formData.name.trim()) {
|
|
@@ -16311,13 +17271,13 @@ var BaseCreateOrganization = ({
|
|
|
16311
17271
|
logger11.error("Form submission error:");
|
|
16312
17272
|
}
|
|
16313
17273
|
};
|
|
16314
|
-
const createOrganizationContent = /* @__PURE__ */
|
|
16315
|
-
/* @__PURE__ */
|
|
16316
|
-
error && /* @__PURE__ */
|
|
16317
|
-
/* @__PURE__ */
|
|
16318
|
-
/* @__PURE__ */
|
|
17274
|
+
const createOrganizationContent = /* @__PURE__ */ jsx118("div", { className: cx36(styles["root"], cardLayout && styles["card"], className), style, children: /* @__PURE__ */ jsxs53("div", { className: cx36(styles["content"]), children: [
|
|
17275
|
+
/* @__PURE__ */ jsxs53("form", { id: "create-organization-form", className: cx36(styles["form"]), onSubmit: handleSubmit, children: [
|
|
17276
|
+
error && /* @__PURE__ */ jsxs53(Alert_default, { variant: "error", className: styles["errorAlert"], children: [
|
|
17277
|
+
/* @__PURE__ */ jsx118(Alert_default.Title, { children: "Error" }),
|
|
17278
|
+
/* @__PURE__ */ jsx118(Alert_default.Description, { children: error })
|
|
16319
17279
|
] }),
|
|
16320
|
-
/* @__PURE__ */
|
|
17280
|
+
/* @__PURE__ */ jsx118("div", { className: cx36(styles["fieldGroup"]), children: /* @__PURE__ */ jsx118(
|
|
16321
17281
|
TextField_default,
|
|
16322
17282
|
{
|
|
16323
17283
|
label: `${t("elements.fields.organization.name.label")}`,
|
|
@@ -16327,10 +17287,10 @@ var BaseCreateOrganization = ({
|
|
|
16327
17287
|
disabled: loading,
|
|
16328
17288
|
required: true,
|
|
16329
17289
|
error: formErrors.name,
|
|
16330
|
-
className:
|
|
17290
|
+
className: cx36(styles["input"])
|
|
16331
17291
|
}
|
|
16332
17292
|
) }),
|
|
16333
|
-
/* @__PURE__ */
|
|
17293
|
+
/* @__PURE__ */ jsx118("div", { className: cx36(styles["fieldGroup"]), children: /* @__PURE__ */ jsx118(
|
|
16334
17294
|
TextField_default,
|
|
16335
17295
|
{
|
|
16336
17296
|
label: `${t("elements.fields.organization.handle.label") || "Organization Handle"}`,
|
|
@@ -16341,15 +17301,15 @@ var BaseCreateOrganization = ({
|
|
|
16341
17301
|
required: true,
|
|
16342
17302
|
error: formErrors.handle,
|
|
16343
17303
|
helperText: "This will be your organization's unique identifier. Only lowercase letters, numbers, and hyphens are allowed.",
|
|
16344
|
-
className:
|
|
17304
|
+
className: cx36(styles["input"])
|
|
16345
17305
|
}
|
|
16346
17306
|
) }),
|
|
16347
|
-
/* @__PURE__ */
|
|
16348
|
-
/* @__PURE__ */
|
|
16349
|
-
/* @__PURE__ */
|
|
17307
|
+
/* @__PURE__ */ jsx118("div", { className: cx36(styles["fieldGroup"]), children: /* @__PURE__ */ jsxs53(FormControl_default, { error: formErrors.description, children: [
|
|
17308
|
+
/* @__PURE__ */ jsx118(InputLabel_default, { required: true, children: t("elements.fields.organization.description.label") }),
|
|
17309
|
+
/* @__PURE__ */ jsx118(
|
|
16350
17310
|
"textarea",
|
|
16351
17311
|
{
|
|
16352
|
-
className:
|
|
17312
|
+
className: cx36(styles["textarea"], formErrors.description && styles["textareaError"]),
|
|
16353
17313
|
placeholder: t("organization.create.description.placeholder"),
|
|
16354
17314
|
value: formData.description,
|
|
16355
17315
|
onChange: (e) => handleInputChange("description", e.target.value),
|
|
@@ -16360,15 +17320,15 @@ var BaseCreateOrganization = ({
|
|
|
16360
17320
|
] }) }),
|
|
16361
17321
|
renderAdditionalFields && renderAdditionalFields()
|
|
16362
17322
|
] }),
|
|
16363
|
-
/* @__PURE__ */
|
|
16364
|
-
onCancel && /* @__PURE__ */
|
|
16365
|
-
/* @__PURE__ */
|
|
17323
|
+
/* @__PURE__ */ jsxs53("div", { className: cx36(styles["actions"]), children: [
|
|
17324
|
+
onCancel && /* @__PURE__ */ jsx118(Button_default, { type: "button", variant: "outline", onClick: onCancel, disabled: loading, children: t("organization.create.buttons.cancel.text") }),
|
|
17325
|
+
/* @__PURE__ */ jsx118(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") })
|
|
16366
17326
|
] })
|
|
16367
17327
|
] }) });
|
|
16368
17328
|
if (mode === "popup") {
|
|
16369
|
-
return /* @__PURE__ */
|
|
16370
|
-
/* @__PURE__ */
|
|
16371
|
-
/* @__PURE__ */
|
|
17329
|
+
return /* @__PURE__ */ jsx118(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ jsxs53(Dialog_default.Content, { children: [
|
|
17330
|
+
/* @__PURE__ */ jsx118(Dialog_default.Heading, { children: title }),
|
|
17331
|
+
/* @__PURE__ */ jsx118("div", { className: styles["popup"], children: createOrganizationContent })
|
|
16372
17332
|
] }) });
|
|
16373
17333
|
}
|
|
16374
17334
|
return createOrganizationContent;
|
|
@@ -16409,7 +17369,7 @@ var createOrganization = async ({
|
|
|
16409
17369
|
var createOrganization_default = createOrganization;
|
|
16410
17370
|
|
|
16411
17371
|
// src/components/presentation/CreateOrganization/CreateOrganization.tsx
|
|
16412
|
-
import { Fragment as Fragment23, jsx as
|
|
17372
|
+
import { Fragment as Fragment23, jsx as jsx119 } from "react/jsx-runtime";
|
|
16413
17373
|
var CreateOrganization = ({
|
|
16414
17374
|
onCreateOrganization,
|
|
16415
17375
|
fallback = null,
|
|
@@ -16419,13 +17379,13 @@ var CreateOrganization = ({
|
|
|
16419
17379
|
}) => {
|
|
16420
17380
|
const { isSignedIn, baseUrl, instanceId } = useAsgardeo_default();
|
|
16421
17381
|
const { currentOrganization, revalidateMyOrganizations } = useOrganization_default();
|
|
16422
|
-
const [loading, setLoading] =
|
|
16423
|
-
const [error, setError] =
|
|
17382
|
+
const [loading, setLoading] = useState35(false);
|
|
17383
|
+
const [error, setError] = useState35(null);
|
|
16424
17384
|
if (!isSignedIn && fallback) {
|
|
16425
17385
|
return fallback;
|
|
16426
17386
|
}
|
|
16427
17387
|
if (!isSignedIn) {
|
|
16428
|
-
return /* @__PURE__ */
|
|
17388
|
+
return /* @__PURE__ */ jsx119(Fragment23, {});
|
|
16429
17389
|
}
|
|
16430
17390
|
const parentId = defaultParentId || currentOrganization?.id || "";
|
|
16431
17391
|
const handleSubmit = async (payload) => {
|
|
@@ -16460,7 +17420,7 @@ var CreateOrganization = ({
|
|
|
16460
17420
|
setLoading(false);
|
|
16461
17421
|
}
|
|
16462
17422
|
};
|
|
16463
|
-
return /* @__PURE__ */
|
|
17423
|
+
return /* @__PURE__ */ jsx119(
|
|
16464
17424
|
BaseCreateOrganization,
|
|
16465
17425
|
{
|
|
16466
17426
|
onSubmit: handleSubmit,
|
|
@@ -16474,11 +17434,11 @@ var CreateOrganization = ({
|
|
|
16474
17434
|
};
|
|
16475
17435
|
|
|
16476
17436
|
// src/components/presentation/OrganizationList/OrganizationList.tsx
|
|
16477
|
-
import { cx as
|
|
16478
|
-
import { useEffect as
|
|
17437
|
+
import { cx as cx38 } from "@emotion/css";
|
|
17438
|
+
import { useEffect as useEffect26, useState as useState36 } from "react";
|
|
16479
17439
|
|
|
16480
17440
|
// src/components/presentation/OrganizationList/BaseOrganizationList.tsx
|
|
16481
|
-
import { cx as
|
|
17441
|
+
import { cx as cx37 } from "@emotion/css";
|
|
16482
17442
|
import { useMemo as useMemo43 } from "react";
|
|
16483
17443
|
|
|
16484
17444
|
// src/components/presentation/OrganizationList/BaseOrganizationList.styles.ts
|
|
@@ -16708,23 +17668,23 @@ var useStyles31 = (theme, colorScheme) => useMemo42(() => {
|
|
|
16708
17668
|
var BaseOrganizationList_styles_default = useStyles31;
|
|
16709
17669
|
|
|
16710
17670
|
// src/components/presentation/OrganizationList/BaseOrganizationList.tsx
|
|
16711
|
-
import { jsx as
|
|
16712
|
-
var defaultRenderOrganization = (organization, styles, t, onOrganizationSelect, showStatus) => /* @__PURE__ */
|
|
16713
|
-
/* @__PURE__ */
|
|
16714
|
-
/* @__PURE__ */
|
|
16715
|
-
/* @__PURE__ */
|
|
16716
|
-
/* @__PURE__ */
|
|
16717
|
-
/* @__PURE__ */
|
|
17671
|
+
import { jsx as jsx120, jsxs as jsxs54 } from "react/jsx-runtime";
|
|
17672
|
+
var defaultRenderOrganization = (organization, styles, t, onOrganizationSelect, showStatus) => /* @__PURE__ */ jsxs54("div", { className: cx37(styles.organizationItem), children: [
|
|
17673
|
+
/* @__PURE__ */ jsxs54("div", { className: cx37(styles.organizationContent), children: [
|
|
17674
|
+
/* @__PURE__ */ jsx120(Avatar, { variant: "square", name: organization.name, size: 48, alt: `${organization.name} logo` }),
|
|
17675
|
+
/* @__PURE__ */ jsxs54("div", { className: cx37(styles.organizationInfo), children: [
|
|
17676
|
+
/* @__PURE__ */ jsx120(Typography_default, { variant: "h6", className: cx37(styles.organizationName), children: organization.name }),
|
|
17677
|
+
/* @__PURE__ */ jsxs54(Typography_default, { variant: "body2", color: "textSecondary", className: cx37(styles.organizationHandle), children: [
|
|
16718
17678
|
"@",
|
|
16719
17679
|
organization.orgHandle
|
|
16720
17680
|
] }),
|
|
16721
|
-
showStatus && /* @__PURE__ */
|
|
17681
|
+
showStatus && /* @__PURE__ */ jsxs54(Typography_default, { variant: "body2", color: "textSecondary", className: cx37(styles.organizationStatus), children: [
|
|
16722
17682
|
t("organization.switcher.status.label"),
|
|
16723
17683
|
" ",
|
|
16724
|
-
/* @__PURE__ */
|
|
17684
|
+
/* @__PURE__ */ jsx120(
|
|
16725
17685
|
"span",
|
|
16726
17686
|
{
|
|
16727
|
-
className:
|
|
17687
|
+
className: cx37(
|
|
16728
17688
|
styles.statusText,
|
|
16729
17689
|
organization.status === "ACTIVE" ? styles.statusTextActive : styles.statusTextInactive
|
|
16730
17690
|
),
|
|
@@ -16734,7 +17694,7 @@ var defaultRenderOrganization = (organization, styles, t, onOrganizationSelect,
|
|
|
16734
17694
|
] })
|
|
16735
17695
|
] })
|
|
16736
17696
|
] }),
|
|
16737
|
-
organization.canSwitch && /* @__PURE__ */
|
|
17697
|
+
organization.canSwitch && /* @__PURE__ */ jsx120("div", { className: cx37(styles.organizationActions), children: /* @__PURE__ */ jsx120(
|
|
16738
17698
|
Button_default,
|
|
16739
17699
|
{
|
|
16740
17700
|
onClick: (e) => {
|
|
@@ -16747,17 +17707,17 @@ var defaultRenderOrganization = (organization, styles, t, onOrganizationSelect,
|
|
|
16747
17707
|
}
|
|
16748
17708
|
) })
|
|
16749
17709
|
] }, organization.id);
|
|
16750
|
-
var defaultRenderLoading = (t, styles) => /* @__PURE__ */
|
|
16751
|
-
/* @__PURE__ */
|
|
16752
|
-
/* @__PURE__ */
|
|
17710
|
+
var defaultRenderLoading = (t, styles) => /* @__PURE__ */ jsxs54("div", { className: cx37(styles.loadingContainer), children: [
|
|
17711
|
+
/* @__PURE__ */ jsx120(Spinner_default, { size: "medium" }),
|
|
17712
|
+
/* @__PURE__ */ jsx120(Typography_default, { variant: "body1", color: "textSecondary", className: cx37(styles.loadingText), children: t("organization.switcher.loading.placeholder.organizations") })
|
|
16753
17713
|
] });
|
|
16754
|
-
var defaultRenderError = (errorMessage, t, styles) => /* @__PURE__ */
|
|
16755
|
-
/* @__PURE__ */
|
|
17714
|
+
var defaultRenderError = (errorMessage, t, styles) => /* @__PURE__ */ jsx120("div", { className: cx37(styles.errorContainer), children: /* @__PURE__ */ jsxs54(Typography_default, { variant: "body1", color: "error", children: [
|
|
17715
|
+
/* @__PURE__ */ jsx120("strong", { children: t("organization.switcher.error.prefix") }),
|
|
16756
17716
|
" ",
|
|
16757
17717
|
errorMessage
|
|
16758
17718
|
] }) });
|
|
16759
|
-
var defaultRenderLoadMore = (onLoadMore, isLoadingMore, t, styles) => /* @__PURE__ */
|
|
16760
|
-
var defaultRenderEmpty = (t, styles) => /* @__PURE__ */
|
|
17719
|
+
var defaultRenderLoadMore = (onLoadMore, isLoadingMore, t, styles) => /* @__PURE__ */ jsx120(Button_default, { onClick: onLoadMore, disabled: isLoadingMore, className: cx37(styles.loadMoreButton), type: "button", fullWidth: true, children: isLoadingMore ? t("organization.switcher.loading.more") : t("organization.switcher.buttons.load_more.text") });
|
|
17720
|
+
var defaultRenderEmpty = (t, styles) => /* @__PURE__ */ jsx120("div", { className: cx37(styles.emptyContainer), children: /* @__PURE__ */ jsx120(Typography_default, { variant: "body1", color: "textSecondary", className: cx37(styles.emptyText), children: t("organization.switcher.no.organizations") }) });
|
|
16761
17721
|
var BaseOrganizationList = ({
|
|
16762
17722
|
className = "",
|
|
16763
17723
|
allOrganizations,
|
|
@@ -16801,46 +17761,46 @@ var BaseOrganizationList = ({
|
|
|
16801
17761
|
const renderLoadMoreWithStyles = renderLoadMore || ((onLoadMore, loadingMore) => defaultRenderLoadMore(onLoadMore, loadingMore, t, styles));
|
|
16802
17762
|
const renderOrganizationWithStyles = renderOrganization || ((org) => defaultRenderOrganization(org, styles, t, onOrganizationSelect, showStatus));
|
|
16803
17763
|
if (isLoading && organizationsWithSwitchAccess?.length === 0) {
|
|
16804
|
-
const loadingContent = /* @__PURE__ */
|
|
17764
|
+
const loadingContent = /* @__PURE__ */ jsx120("div", { className: cx37(styles["root"], className), style, children: renderLoadingWithStyles() });
|
|
16805
17765
|
if (mode === "popup") {
|
|
16806
|
-
return /* @__PURE__ */
|
|
16807
|
-
/* @__PURE__ */
|
|
16808
|
-
/* @__PURE__ */
|
|
17766
|
+
return /* @__PURE__ */ jsx120(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ jsxs54(Dialog_default.Content, { children: [
|
|
17767
|
+
/* @__PURE__ */ jsx120(Dialog_default.Heading, { children: title }),
|
|
17768
|
+
/* @__PURE__ */ jsx120("div", { className: cx37(styles["popupContent"]), children: loadingContent })
|
|
16809
17769
|
] }) });
|
|
16810
17770
|
}
|
|
16811
17771
|
return loadingContent;
|
|
16812
17772
|
}
|
|
16813
17773
|
if (error && organizationsWithSwitchAccess?.length === 0) {
|
|
16814
|
-
const errorContent = /* @__PURE__ */
|
|
17774
|
+
const errorContent = /* @__PURE__ */ jsx120("div", { className: cx37(styles["root"], className), style, children: renderErrorWithStyles(error) });
|
|
16815
17775
|
if (mode === "popup") {
|
|
16816
|
-
return /* @__PURE__ */
|
|
16817
|
-
/* @__PURE__ */
|
|
16818
|
-
/* @__PURE__ */
|
|
17776
|
+
return /* @__PURE__ */ jsx120(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ jsxs54(Dialog_default.Content, { children: [
|
|
17777
|
+
/* @__PURE__ */ jsx120(Dialog_default.Heading, { children: title }),
|
|
17778
|
+
/* @__PURE__ */ jsx120("div", { className: cx37(styles["popupContent"]), children: errorContent })
|
|
16819
17779
|
] }) });
|
|
16820
17780
|
}
|
|
16821
17781
|
return errorContent;
|
|
16822
17782
|
}
|
|
16823
17783
|
if (!isLoading && organizationsWithSwitchAccess?.length === 0) {
|
|
16824
|
-
const emptyContent = /* @__PURE__ */
|
|
17784
|
+
const emptyContent = /* @__PURE__ */ jsx120("div", { className: cx37(styles["root"], className), style, children: renderEmptyWithStyles() });
|
|
16825
17785
|
if (mode === "popup") {
|
|
16826
|
-
return /* @__PURE__ */
|
|
16827
|
-
/* @__PURE__ */
|
|
16828
|
-
/* @__PURE__ */
|
|
17786
|
+
return /* @__PURE__ */ jsx120(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ jsxs54(Dialog_default.Content, { children: [
|
|
17787
|
+
/* @__PURE__ */ jsx120(Dialog_default.Heading, { children: title }),
|
|
17788
|
+
/* @__PURE__ */ jsx120("div", { className: cx37(styles["popupContent"]), children: emptyContent })
|
|
16829
17789
|
] }) });
|
|
16830
17790
|
}
|
|
16831
17791
|
return emptyContent;
|
|
16832
17792
|
}
|
|
16833
|
-
const organizationListContent = /* @__PURE__ */
|
|
16834
|
-
/* @__PURE__ */
|
|
16835
|
-
/* @__PURE__ */
|
|
17793
|
+
const organizationListContent = /* @__PURE__ */ jsxs54("div", { className: cx37(styles["root"], className), style, children: [
|
|
17794
|
+
/* @__PURE__ */ jsxs54("div", { className: cx37(styles["header"]), children: [
|
|
17795
|
+
/* @__PURE__ */ jsx120("div", { className: cx37(styles["headerInfo"]), children: /* @__PURE__ */ jsx120(Typography_default, { variant: "body2", color: "textSecondary", className: cx37(styles["subtitle"]), children: t("organization.switcher.showing.count", {
|
|
16836
17796
|
showing: organizationsWithSwitchAccess?.length,
|
|
16837
17797
|
total: allOrganizations?.organizations?.length || 0
|
|
16838
17798
|
}) }) }),
|
|
16839
|
-
onRefresh && /* @__PURE__ */
|
|
17799
|
+
onRefresh && /* @__PURE__ */ jsx120(
|
|
16840
17800
|
Button_default,
|
|
16841
17801
|
{
|
|
16842
17802
|
onClick: onRefresh,
|
|
16843
|
-
className:
|
|
17803
|
+
className: cx37(styles["refreshButton"]),
|
|
16844
17804
|
type: "button",
|
|
16845
17805
|
variant: "outline",
|
|
16846
17806
|
size: "small",
|
|
@@ -16848,16 +17808,16 @@ var BaseOrganizationList = ({
|
|
|
16848
17808
|
}
|
|
16849
17809
|
)
|
|
16850
17810
|
] }),
|
|
16851
|
-
/* @__PURE__ */
|
|
17811
|
+
/* @__PURE__ */ jsx120("div", { className: cx37(styles["listContainer"]), children: organizationsWithSwitchAccess?.map(
|
|
16852
17812
|
(organization, index) => renderOrganizationWithStyles(organization, index)
|
|
16853
17813
|
) }),
|
|
16854
|
-
error && organizationsWithSwitchAccess?.length > 0 && /* @__PURE__ */
|
|
16855
|
-
hasMore && fetchMore && /* @__PURE__ */
|
|
17814
|
+
error && organizationsWithSwitchAccess?.length > 0 && /* @__PURE__ */ jsx120("div", { className: cx37(styles["errorMargin"]), children: renderErrorWithStyles(error) }),
|
|
17815
|
+
hasMore && fetchMore && /* @__PURE__ */ jsx120("div", { className: cx37(styles["loadMoreMargin"]), children: renderLoadMoreWithStyles(fetchMore, isLoadingMore) })
|
|
16856
17816
|
] });
|
|
16857
17817
|
if (mode === "popup") {
|
|
16858
|
-
return /* @__PURE__ */
|
|
16859
|
-
/* @__PURE__ */
|
|
16860
|
-
/* @__PURE__ */
|
|
17818
|
+
return /* @__PURE__ */ jsx120(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ jsxs54(Dialog_default.Content, { children: [
|
|
17819
|
+
/* @__PURE__ */ jsx120(Dialog_default.Heading, { children: title }),
|
|
17820
|
+
/* @__PURE__ */ jsx120("div", { className: cx37(styles["popupContent"]), children: organizationListContent })
|
|
16861
17821
|
] }) });
|
|
16862
17822
|
}
|
|
16863
17823
|
return organizationListContent;
|
|
@@ -16927,22 +17887,22 @@ var useStyles32 = (theme, colorScheme) => useMemo44(() => {
|
|
|
16927
17887
|
var OrganizationList_styles_default = useStyles32;
|
|
16928
17888
|
|
|
16929
17889
|
// src/components/presentation/OrganizationList/OrganizationList.tsx
|
|
16930
|
-
import { jsx as
|
|
17890
|
+
import { jsx as jsx121 } from "react/jsx-runtime";
|
|
16931
17891
|
var OrganizationList = (props) => {
|
|
16932
17892
|
const { onOrganizationSelect, className = "", style, ...baseProps } = props;
|
|
16933
17893
|
const { autoFetch, filter, limit, recursive, ...filteredBaseProps } = baseProps;
|
|
16934
17894
|
const { theme, colorScheme } = useTheme_default();
|
|
16935
17895
|
const styles = OrganizationList_styles_default(theme, colorScheme);
|
|
16936
17896
|
const { getAllOrganizations: getAllOrganizations2, error, isLoading, myOrganizations } = useOrganization_default();
|
|
16937
|
-
const [allOrganizations, setAllOrganizations] =
|
|
17897
|
+
const [allOrganizations, setAllOrganizations] = useState36({
|
|
16938
17898
|
organizations: []
|
|
16939
17899
|
});
|
|
16940
|
-
|
|
17900
|
+
useEffect26(() => {
|
|
16941
17901
|
(async () => {
|
|
16942
17902
|
setAllOrganizations(await getAllOrganizations2());
|
|
16943
17903
|
})();
|
|
16944
17904
|
}, []);
|
|
16945
|
-
return /* @__PURE__ */
|
|
17905
|
+
return /* @__PURE__ */ jsx121("div", { className: cx38(styles["root"], className), style, children: /* @__PURE__ */ jsx121("div", { className: cx38(styles["container"]), children: /* @__PURE__ */ jsx121(
|
|
16946
17906
|
BaseOrganizationList,
|
|
16947
17907
|
{
|
|
16948
17908
|
allOrganizations,
|
|
@@ -16958,12 +17918,12 @@ var OrganizationList_default = OrganizationList;
|
|
|
16958
17918
|
|
|
16959
17919
|
// src/components/presentation/OrganizationProfile/OrganizationProfile.tsx
|
|
16960
17920
|
import { createPackageComponentLogger as createPackageComponentLogger10 } from "@asgardeo/browser";
|
|
16961
|
-
import { useEffect as
|
|
17921
|
+
import { useEffect as useEffect27, useState as useState39 } from "react";
|
|
16962
17922
|
|
|
16963
17923
|
// src/components/presentation/OrganizationProfile/BaseOrganizationProfile.tsx
|
|
16964
17924
|
import { formatDate } from "@asgardeo/browser";
|
|
16965
|
-
import { cx as
|
|
16966
|
-
import { useState as
|
|
17925
|
+
import { cx as cx40 } from "@emotion/css";
|
|
17926
|
+
import { useState as useState38, useCallback as useCallback25 } from "react";
|
|
16967
17927
|
|
|
16968
17928
|
// src/components/presentation/OrganizationProfile/BaseOrganizationProfile.styles.ts
|
|
16969
17929
|
import { css as css34 } from "@emotion/css";
|
|
@@ -17122,9 +18082,9 @@ var useStyles33 = (theme, colorScheme) => useMemo45(
|
|
|
17122
18082
|
var BaseOrganizationProfile_styles_default = useStyles33;
|
|
17123
18083
|
|
|
17124
18084
|
// src/components/primitives/KeyValueInput/KeyValueInput.tsx
|
|
17125
|
-
import { withVendorCSSClassPrefix as
|
|
17126
|
-
import { cx as
|
|
17127
|
-
import { useState as
|
|
18085
|
+
import { withVendorCSSClassPrefix as withVendorCSSClassPrefix33, bem as bem22 } from "@asgardeo/browser";
|
|
18086
|
+
import { cx as cx39 } from "@emotion/css";
|
|
18087
|
+
import { useState as useState37, useCallback as useCallback24 } from "react";
|
|
17128
18088
|
|
|
17129
18089
|
// src/components/primitives/KeyValueInput/KeyValueInput.styles.ts
|
|
17130
18090
|
import { css as css35 } from "@emotion/css";
|
|
@@ -17281,7 +18241,7 @@ var useStyles34 = (theme, colorScheme, disabled, readOnly, hasError) => useMemo4
|
|
|
17281
18241
|
var KeyValueInput_styles_default = useStyles34;
|
|
17282
18242
|
|
|
17283
18243
|
// src/components/primitives/KeyValueInput/KeyValueInput.tsx
|
|
17284
|
-
import { jsx as
|
|
18244
|
+
import { jsx as jsx122, jsxs as jsxs55 } from "react/jsx-runtime";
|
|
17285
18245
|
var KeyValueInput = ({
|
|
17286
18246
|
className = "",
|
|
17287
18247
|
disabled = false,
|
|
@@ -17304,10 +18264,10 @@ var KeyValueInput = ({
|
|
|
17304
18264
|
const { theme, colorScheme } = useTheme_default();
|
|
17305
18265
|
const styles = KeyValueInput_styles_default(theme, colorScheme, disabled, readOnly, !!error);
|
|
17306
18266
|
const initialPairs = Array.isArray(value) ? value : Object.entries(value).map(([key, val]) => ({ key, value: String(val) }));
|
|
17307
|
-
const [pairs, setPairs] =
|
|
17308
|
-
const [newKey, setNewKey] =
|
|
17309
|
-
const [newValue, setNewValue] =
|
|
17310
|
-
const handleAddPair =
|
|
18267
|
+
const [pairs, setPairs] = useState37(initialPairs);
|
|
18268
|
+
const [newKey, setNewKey] = useState37("");
|
|
18269
|
+
const [newValue, setNewValue] = useState37("");
|
|
18270
|
+
const handleAddPair = useCallback24(() => {
|
|
17311
18271
|
if (!newKey.trim() || !newValue.trim()) return;
|
|
17312
18272
|
if (maxPairs && pairs.length >= maxPairs) return;
|
|
17313
18273
|
const newPair = {
|
|
@@ -17325,7 +18285,7 @@ var KeyValueInput = ({
|
|
|
17325
18285
|
onAdd(newPair);
|
|
17326
18286
|
}
|
|
17327
18287
|
}, [newKey, newValue, pairs, maxPairs, onChange, onAdd]);
|
|
17328
|
-
const handleRemovePair =
|
|
18288
|
+
const handleRemovePair = useCallback24(
|
|
17329
18289
|
(index) => {
|
|
17330
18290
|
const pairToRemove = pairs[index];
|
|
17331
18291
|
const updatedPairs = pairs.filter((_, i) => i !== index);
|
|
@@ -17339,7 +18299,7 @@ var KeyValueInput = ({
|
|
|
17339
18299
|
},
|
|
17340
18300
|
[pairs, onChange, onRemove]
|
|
17341
18301
|
);
|
|
17342
|
-
const handleUpdatePair =
|
|
18302
|
+
const handleUpdatePair = useCallback24(
|
|
17343
18303
|
(index, field, newVal) => {
|
|
17344
18304
|
const updatedPairs = pairs.map((pair, i) => {
|
|
17345
18305
|
if (i === index) {
|
|
@@ -17358,21 +18318,21 @@ var KeyValueInput = ({
|
|
|
17358
18318
|
const isAddDisabled = disabled || readOnly || !canAddMore || !newKey.trim() || !newValue.trim();
|
|
17359
18319
|
const renderReadOnlyContent = () => {
|
|
17360
18320
|
if (pairs.length === 0) {
|
|
17361
|
-
return /* @__PURE__ */
|
|
18321
|
+
return /* @__PURE__ */ jsx122("div", { className: cx39(withVendorCSSClassPrefix33(bem22("key-value-input", "empty-state")), styles["emptyState"]), children: "No attributes defined" });
|
|
17362
18322
|
}
|
|
17363
|
-
return pairs.map((pair, index) => /* @__PURE__ */
|
|
18323
|
+
return pairs.map((pair, index) => /* @__PURE__ */ jsxs55(
|
|
17364
18324
|
"div",
|
|
17365
18325
|
{
|
|
17366
|
-
className:
|
|
18326
|
+
className: cx39(withVendorCSSClassPrefix33(bem22("key-value-input", "readonly-pair")), styles["readOnlyPair"]),
|
|
17367
18327
|
children: [
|
|
17368
|
-
/* @__PURE__ */
|
|
18328
|
+
/* @__PURE__ */ jsxs55("span", { className: cx39(withVendorCSSClassPrefix33(bem22("key-value-input", "readonly-key")), styles["readOnlyKey"]), children: [
|
|
17369
18329
|
pair.key,
|
|
17370
18330
|
":"
|
|
17371
18331
|
] }),
|
|
17372
|
-
/* @__PURE__ */
|
|
18332
|
+
/* @__PURE__ */ jsx122(
|
|
17373
18333
|
"span",
|
|
17374
18334
|
{
|
|
17375
|
-
className:
|
|
18335
|
+
className: cx39(withVendorCSSClassPrefix33(bem22("key-value-input", "readonly-value")), styles["readOnlyValue"]),
|
|
17376
18336
|
children: pair.value
|
|
17377
18337
|
}
|
|
17378
18338
|
)
|
|
@@ -17381,83 +18341,83 @@ var KeyValueInput = ({
|
|
|
17381
18341
|
`${pair.key}-${index}`
|
|
17382
18342
|
));
|
|
17383
18343
|
};
|
|
17384
|
-
return /* @__PURE__ */
|
|
17385
|
-
label && /* @__PURE__ */
|
|
18344
|
+
return /* @__PURE__ */ jsxs55("div", { className: cx39(withVendorCSSClassPrefix33(bem22("key-value-input")), styles["container"], className), children: [
|
|
18345
|
+
label && /* @__PURE__ */ jsxs55("label", { className: cx39(withVendorCSSClassPrefix33(bem22("key-value-input", "label")), styles["label"]), children: [
|
|
17386
18346
|
label,
|
|
17387
|
-
required && /* @__PURE__ */
|
|
18347
|
+
required && /* @__PURE__ */ jsx122(
|
|
17388
18348
|
"span",
|
|
17389
18349
|
{
|
|
17390
|
-
className:
|
|
18350
|
+
className: cx39(withVendorCSSClassPrefix33(bem22("key-value-input", "required")), styles["requiredIndicator"]),
|
|
17391
18351
|
children: " *"
|
|
17392
18352
|
}
|
|
17393
18353
|
)
|
|
17394
18354
|
] }),
|
|
17395
|
-
/* @__PURE__ */
|
|
17396
|
-
readOnly ? renderReadOnlyContent() : pairs.map((pair, index) => /* @__PURE__ */
|
|
18355
|
+
/* @__PURE__ */ jsxs55("div", { className: cx39(withVendorCSSClassPrefix33(bem22("key-value-input", "pairs-list")), styles["pairsList"]), children: [
|
|
18356
|
+
readOnly ? renderReadOnlyContent() : pairs.map((pair, index) => /* @__PURE__ */ jsxs55(
|
|
17397
18357
|
"div",
|
|
17398
18358
|
{
|
|
17399
|
-
className:
|
|
18359
|
+
className: cx39(withVendorCSSClassPrefix33(bem22("key-value-input", "pair-row")), styles["pairRow"]),
|
|
17400
18360
|
children: [
|
|
17401
|
-
/* @__PURE__ */
|
|
18361
|
+
/* @__PURE__ */ jsx122(
|
|
17402
18362
|
TextField_default,
|
|
17403
18363
|
{
|
|
17404
18364
|
placeholder: keyPlaceholder,
|
|
17405
18365
|
value: pair.key,
|
|
17406
18366
|
onChange: (e) => handleUpdatePair(index, "key", e.target.value),
|
|
17407
18367
|
disabled: disabled || readOnly,
|
|
17408
|
-
className:
|
|
18368
|
+
className: cx39(withVendorCSSClassPrefix33(bem22("key-value-input", "pair-input")), styles["pairInput"]),
|
|
17409
18369
|
"aria-label": `${keyLabel} ${index + 1}`
|
|
17410
18370
|
}
|
|
17411
18371
|
),
|
|
17412
|
-
/* @__PURE__ */
|
|
18372
|
+
/* @__PURE__ */ jsx122(
|
|
17413
18373
|
TextField_default,
|
|
17414
18374
|
{
|
|
17415
18375
|
placeholder: valuePlaceholder,
|
|
17416
18376
|
value: pair.value,
|
|
17417
18377
|
onChange: (e) => handleUpdatePair(index, "value", e.target.value),
|
|
17418
18378
|
disabled: disabled || readOnly,
|
|
17419
|
-
className:
|
|
18379
|
+
className: cx39(withVendorCSSClassPrefix33(bem22("key-value-input", "pair-input")), styles["pairInput"]),
|
|
17420
18380
|
"aria-label": `${valueLabel} ${index + 1}`
|
|
17421
18381
|
}
|
|
17422
18382
|
),
|
|
17423
|
-
!readOnly && /* @__PURE__ */
|
|
18383
|
+
!readOnly && /* @__PURE__ */ jsx122(
|
|
17424
18384
|
"button",
|
|
17425
18385
|
{
|
|
17426
18386
|
type: "button",
|
|
17427
18387
|
onClick: () => handleRemovePair(index),
|
|
17428
18388
|
disabled,
|
|
17429
|
-
className:
|
|
17430
|
-
|
|
18389
|
+
className: cx39(
|
|
18390
|
+
withVendorCSSClassPrefix33(bem22("key-value-input", "remove-button")),
|
|
17431
18391
|
styles["removeButton"]
|
|
17432
18392
|
),
|
|
17433
18393
|
"aria-label": `${removeButtonText} ${pair.key}`,
|
|
17434
|
-
children: /* @__PURE__ */
|
|
18394
|
+
children: /* @__PURE__ */ jsx122(X_default, { width: 16, height: 16 })
|
|
17435
18395
|
}
|
|
17436
18396
|
)
|
|
17437
18397
|
]
|
|
17438
18398
|
},
|
|
17439
18399
|
`${pair.key}-${index}`
|
|
17440
18400
|
)),
|
|
17441
|
-
!readOnly && /* @__PURE__ */
|
|
17442
|
-
/* @__PURE__ */
|
|
18401
|
+
!readOnly && /* @__PURE__ */ jsxs55("div", { className: cx39(withVendorCSSClassPrefix33(bem22("key-value-input", "add-row")), styles["addRow"]), children: [
|
|
18402
|
+
/* @__PURE__ */ jsx122(
|
|
17443
18403
|
TextField_default,
|
|
17444
18404
|
{
|
|
17445
18405
|
placeholder: keyPlaceholder,
|
|
17446
18406
|
value: newKey,
|
|
17447
18407
|
onChange: (e) => setNewKey(e.target.value),
|
|
17448
18408
|
disabled,
|
|
17449
|
-
className:
|
|
18409
|
+
className: cx39(withVendorCSSClassPrefix33(bem22("key-value-input", "pair-input")), styles["pairInput"]),
|
|
17450
18410
|
"aria-label": "New key"
|
|
17451
18411
|
}
|
|
17452
18412
|
),
|
|
17453
|
-
/* @__PURE__ */
|
|
18413
|
+
/* @__PURE__ */ jsx122(
|
|
17454
18414
|
TextField_default,
|
|
17455
18415
|
{
|
|
17456
18416
|
placeholder: valuePlaceholder,
|
|
17457
18417
|
value: newValue,
|
|
17458
18418
|
onChange: (e) => setNewValue(e.target.value),
|
|
17459
18419
|
disabled,
|
|
17460
|
-
className:
|
|
18420
|
+
className: cx39(withVendorCSSClassPrefix33(bem22("key-value-input", "pair-input")), styles["pairInput"]),
|
|
17461
18421
|
"aria-label": "New value",
|
|
17462
18422
|
onKeyPress: (e) => {
|
|
17463
18423
|
if (e.key === "Enter" && !isAddDisabled) {
|
|
@@ -17466,21 +18426,21 @@ var KeyValueInput = ({
|
|
|
17466
18426
|
}
|
|
17467
18427
|
}
|
|
17468
18428
|
),
|
|
17469
|
-
/* @__PURE__ */
|
|
18429
|
+
/* @__PURE__ */ jsx122(
|
|
17470
18430
|
"button",
|
|
17471
18431
|
{
|
|
17472
18432
|
type: "button",
|
|
17473
18433
|
onClick: handleAddPair,
|
|
17474
18434
|
disabled: isAddDisabled,
|
|
17475
|
-
className:
|
|
18435
|
+
className: cx39(withVendorCSSClassPrefix33(bem22("key-value-input", "add-button")), styles["addButton"]),
|
|
17476
18436
|
"aria-label": "Add new key-value pair",
|
|
17477
|
-
children: /* @__PURE__ */
|
|
18437
|
+
children: /* @__PURE__ */ jsx122(Plus_default, { width: 16, height: 16 })
|
|
17478
18438
|
}
|
|
17479
18439
|
)
|
|
17480
18440
|
] })
|
|
17481
18441
|
] }),
|
|
17482
|
-
(helperText || error) && /* @__PURE__ */
|
|
17483
|
-
maxPairs && /* @__PURE__ */
|
|
18442
|
+
(helperText || error) && /* @__PURE__ */ jsx122("div", { className: cx39(withVendorCSSClassPrefix33(bem22("key-value-input", "helper-text")), styles["helperText"]), children: error || helperText }),
|
|
18443
|
+
maxPairs && /* @__PURE__ */ jsxs55("div", { className: cx39(withVendorCSSClassPrefix33(bem22("key-value-input", "counter")), styles["counterText"]), children: [
|
|
17484
18444
|
pairs.length,
|
|
17485
18445
|
" of ",
|
|
17486
18446
|
maxPairs,
|
|
@@ -17491,7 +18451,7 @@ var KeyValueInput = ({
|
|
|
17491
18451
|
var KeyValueInput_default = KeyValueInput;
|
|
17492
18452
|
|
|
17493
18453
|
// src/components/presentation/OrganizationProfile/BaseOrganizationProfile.tsx
|
|
17494
|
-
import { Fragment as Fragment24, jsx as
|
|
18454
|
+
import { Fragment as Fragment24, jsx as jsx123, jsxs as jsxs56 } from "react/jsx-runtime";
|
|
17495
18455
|
var BaseOrganizationProfile = ({
|
|
17496
18456
|
fallback = null,
|
|
17497
18457
|
className = "",
|
|
@@ -17538,9 +18498,9 @@ var BaseOrganizationProfile = ({
|
|
|
17538
18498
|
}) => {
|
|
17539
18499
|
const { theme, colorScheme } = useTheme_default();
|
|
17540
18500
|
const styles = BaseOrganizationProfile_styles_default(theme, colorScheme);
|
|
17541
|
-
const [editedOrganization, setEditedOrganization] =
|
|
17542
|
-
const [editingFields, setEditingFields] =
|
|
17543
|
-
const PencilIcon = () => /* @__PURE__ */
|
|
18501
|
+
const [editedOrganization, setEditedOrganization] = useState38(organization);
|
|
18502
|
+
const [editingFields, setEditingFields] = useState38({});
|
|
18503
|
+
const PencilIcon = () => /* @__PURE__ */ jsx123(
|
|
17544
18504
|
"svg",
|
|
17545
18505
|
{
|
|
17546
18506
|
width: "16",
|
|
@@ -17551,16 +18511,16 @@ var BaseOrganizationProfile = ({
|
|
|
17551
18511
|
strokeWidth: "2",
|
|
17552
18512
|
strokeLinecap: "round",
|
|
17553
18513
|
strokeLinejoin: "round",
|
|
17554
|
-
children: /* @__PURE__ */
|
|
18514
|
+
children: /* @__PURE__ */ jsx123("path", { d: "M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z" })
|
|
17555
18515
|
}
|
|
17556
18516
|
);
|
|
17557
|
-
const toggleFieldEdit =
|
|
18517
|
+
const toggleFieldEdit = useCallback25((fieldName) => {
|
|
17558
18518
|
setEditingFields((prev) => ({
|
|
17559
18519
|
...prev,
|
|
17560
18520
|
[fieldName]: !prev[fieldName]
|
|
17561
18521
|
}));
|
|
17562
18522
|
}, []);
|
|
17563
|
-
const getFieldPlaceholder =
|
|
18523
|
+
const getFieldPlaceholder = useCallback25((fieldKey) => {
|
|
17564
18524
|
const fieldLabels = {
|
|
17565
18525
|
description: "organization description",
|
|
17566
18526
|
name: "organization name",
|
|
@@ -17571,7 +18531,7 @@ var BaseOrganizationProfile = ({
|
|
|
17571
18531
|
const fieldLabel = fieldLabels[fieldKey] || fieldKey.toLowerCase();
|
|
17572
18532
|
return `Enter ${fieldLabel}`;
|
|
17573
18533
|
}, []);
|
|
17574
|
-
const handleFieldSave =
|
|
18534
|
+
const handleFieldSave = useCallback25(
|
|
17575
18535
|
(fieldKey) => {
|
|
17576
18536
|
if (!onUpdate || !fieldKey) return;
|
|
17577
18537
|
let fieldValue;
|
|
@@ -17590,7 +18550,7 @@ var BaseOrganizationProfile = ({
|
|
|
17590
18550
|
},
|
|
17591
18551
|
[editedOrganization, organization, onUpdate, toggleFieldEdit]
|
|
17592
18552
|
);
|
|
17593
|
-
const handleFieldCancel =
|
|
18553
|
+
const handleFieldCancel = useCallback25(
|
|
17594
18554
|
(fieldKey) => {
|
|
17595
18555
|
setEditedOrganization((prev) => ({
|
|
17596
18556
|
...prev,
|
|
@@ -17612,7 +18572,7 @@ var BaseOrganizationProfile = ({
|
|
|
17612
18572
|
if (isEditing && onEditValue && fieldEditable && editable) {
|
|
17613
18573
|
const fieldValue = editedOrganization && key && editedOrganization[key] !== void 0 ? editedOrganization[key] : value || "";
|
|
17614
18574
|
const commonProps = {
|
|
17615
|
-
className:
|
|
18575
|
+
className: cx40(styles["fieldInput"]),
|
|
17616
18576
|
label: void 0,
|
|
17617
18577
|
onChange: (e) => onEditValue(e.target ? e.target.value : e),
|
|
17618
18578
|
placeholder: getFieldPlaceholder(key),
|
|
@@ -17621,7 +18581,7 @@ var BaseOrganizationProfile = ({
|
|
|
17621
18581
|
let fieldInput;
|
|
17622
18582
|
if (key === "attributes") {
|
|
17623
18583
|
const attributesValue = typeof fieldValue === "object" && fieldValue !== null ? fieldValue : {};
|
|
17624
|
-
fieldInput = /* @__PURE__ */
|
|
18584
|
+
fieldInput = /* @__PURE__ */ jsx123(
|
|
17625
18585
|
KeyValueInput_default,
|
|
17626
18586
|
{
|
|
17627
18587
|
value: attributesValue,
|
|
@@ -17659,26 +18619,26 @@ var BaseOrganizationProfile = ({
|
|
|
17659
18619
|
}
|
|
17660
18620
|
);
|
|
17661
18621
|
} else {
|
|
17662
|
-
fieldInput = /* @__PURE__ */
|
|
18622
|
+
fieldInput = /* @__PURE__ */ jsx123(TextField_default, { ...commonProps });
|
|
17663
18623
|
}
|
|
17664
|
-
return /* @__PURE__ */
|
|
17665
|
-
/* @__PURE__ */
|
|
17666
|
-
/* @__PURE__ */
|
|
18624
|
+
return /* @__PURE__ */ jsxs56(Fragment24, { children: [
|
|
18625
|
+
/* @__PURE__ */ jsx123("span", { className: cx40(styles["label"]), children: label }),
|
|
18626
|
+
/* @__PURE__ */ jsx123("div", { className: cx40(styles["value"]), children: fieldInput })
|
|
17667
18627
|
] });
|
|
17668
18628
|
}
|
|
17669
18629
|
const hasValue = value !== void 0 && value !== null && value !== "";
|
|
17670
18630
|
const isFieldEditable = editable && fieldEditable;
|
|
17671
18631
|
let displayValue;
|
|
17672
18632
|
if (hasValue) {
|
|
17673
|
-
displayValue = key === "attributes" && typeof value === "object" && value !== null ? /* @__PURE__ */
|
|
18633
|
+
displayValue = key === "attributes" && typeof value === "object" && value !== null ? /* @__PURE__ */ jsx123(KeyValueInput_default, { value, readOnly: true, label: "" }) : String(renderedValue);
|
|
17674
18634
|
} else if (isFieldEditable) {
|
|
17675
18635
|
displayValue = getFieldPlaceholder(key);
|
|
17676
18636
|
} else {
|
|
17677
18637
|
displayValue = "-";
|
|
17678
18638
|
}
|
|
17679
|
-
return /* @__PURE__ */
|
|
17680
|
-
/* @__PURE__ */
|
|
17681
|
-
/* @__PURE__ */
|
|
18639
|
+
return /* @__PURE__ */ jsxs56(Fragment24, { children: [
|
|
18640
|
+
/* @__PURE__ */ jsx123("span", { className: cx40(styles["label"]), children: label }),
|
|
18641
|
+
/* @__PURE__ */ jsx123("div", { className: cx40(styles["value"], !hasValue && styles["valueEmpty"]), children: !hasValue && isFieldEditable && onStartEdit ? /* @__PURE__ */ jsx123(
|
|
17682
18642
|
Button_default,
|
|
17683
18643
|
{
|
|
17684
18644
|
onClick: onStartEdit,
|
|
@@ -17686,7 +18646,7 @@ var BaseOrganizationProfile = ({
|
|
|
17686
18646
|
color: "secondary",
|
|
17687
18647
|
size: "small",
|
|
17688
18648
|
title: "Click to edit",
|
|
17689
|
-
className:
|
|
18649
|
+
className: cx40(styles["placeholderButton"]),
|
|
17690
18650
|
children: displayValue
|
|
17691
18651
|
}
|
|
17692
18652
|
) : displayValue })
|
|
@@ -17701,8 +18661,8 @@ var BaseOrganizationProfile = ({
|
|
|
17701
18661
|
if (!shouldShow) {
|
|
17702
18662
|
return null;
|
|
17703
18663
|
}
|
|
17704
|
-
return /* @__PURE__ */
|
|
17705
|
-
/* @__PURE__ */
|
|
18664
|
+
return /* @__PURE__ */ jsxs56("div", { className: cx40(styles["field"]), children: [
|
|
18665
|
+
/* @__PURE__ */ jsx123("div", { className: cx40(styles["fieldContent"]), children: renderField(
|
|
17706
18666
|
field,
|
|
17707
18667
|
isFieldEditing,
|
|
17708
18668
|
(value) => {
|
|
@@ -17712,8 +18672,8 @@ var BaseOrganizationProfile = ({
|
|
|
17712
18672
|
},
|
|
17713
18673
|
() => toggleFieldEdit(field.key)
|
|
17714
18674
|
) }),
|
|
17715
|
-
isFieldEditable && /* @__PURE__ */
|
|
17716
|
-
/* @__PURE__ */
|
|
18675
|
+
isFieldEditable && /* @__PURE__ */ jsx123("div", { className: cx40(styles["fieldActions"]), children: isFieldEditing ? /* @__PURE__ */ jsxs56(Fragment24, { children: [
|
|
18676
|
+
/* @__PURE__ */ jsx123(
|
|
17717
18677
|
Button_default,
|
|
17718
18678
|
{
|
|
17719
18679
|
onClick: () => handleFieldSave(field.key),
|
|
@@ -17724,7 +18684,7 @@ var BaseOrganizationProfile = ({
|
|
|
17724
18684
|
children: saveButtonText
|
|
17725
18685
|
}
|
|
17726
18686
|
),
|
|
17727
|
-
/* @__PURE__ */
|
|
18687
|
+
/* @__PURE__ */ jsx123(
|
|
17728
18688
|
Button_default,
|
|
17729
18689
|
{
|
|
17730
18690
|
onClick: () => handleFieldCancel(field.key),
|
|
@@ -17735,7 +18695,7 @@ var BaseOrganizationProfile = ({
|
|
|
17735
18695
|
children: cancelButtonText
|
|
17736
18696
|
}
|
|
17737
18697
|
)
|
|
17738
|
-
] }) : hasValue && /* @__PURE__ */
|
|
18698
|
+
] }) : hasValue && /* @__PURE__ */ jsx123(
|
|
17739
18699
|
Button_default,
|
|
17740
18700
|
{
|
|
17741
18701
|
onClick: () => toggleFieldEdit(field.key),
|
|
@@ -17743,8 +18703,8 @@ var BaseOrganizationProfile = ({
|
|
|
17743
18703
|
color: "secondary",
|
|
17744
18704
|
size: "small",
|
|
17745
18705
|
title: "Edit field",
|
|
17746
|
-
className:
|
|
17747
|
-
children: /* @__PURE__ */
|
|
18706
|
+
className: cx40(styles["editButton"]),
|
|
18707
|
+
children: /* @__PURE__ */ jsx123(PencilIcon, {})
|
|
17748
18708
|
}
|
|
17749
18709
|
) })
|
|
17750
18710
|
] }, field.key);
|
|
@@ -17752,23 +18712,23 @@ var BaseOrganizationProfile = ({
|
|
|
17752
18712
|
if (!organization) {
|
|
17753
18713
|
return fallback;
|
|
17754
18714
|
}
|
|
17755
|
-
const profileContent = /* @__PURE__ */
|
|
17756
|
-
/* @__PURE__ */
|
|
17757
|
-
/* @__PURE__ */
|
|
17758
|
-
/* @__PURE__ */
|
|
17759
|
-
/* @__PURE__ */
|
|
17760
|
-
organization.orgHandle && /* @__PURE__ */
|
|
18715
|
+
const profileContent = /* @__PURE__ */ jsxs56(Card_default, { className: cx40(styles["root"], cardLayout && styles["card"], className), children: [
|
|
18716
|
+
/* @__PURE__ */ jsxs56("div", { className: cx40(styles["header"]), children: [
|
|
18717
|
+
/* @__PURE__ */ jsx123(Avatar, { name: getOrgInitials(organization.name), size: 80, alt: `${organization.name} logo` }),
|
|
18718
|
+
/* @__PURE__ */ jsxs56("div", { className: cx40(styles["orgInfo"]), children: [
|
|
18719
|
+
/* @__PURE__ */ jsx123("h2", { className: cx40(styles["name"]), children: organization.name }),
|
|
18720
|
+
organization.orgHandle && /* @__PURE__ */ jsxs56("p", { className: cx40(styles["handle"]), children: [
|
|
17761
18721
|
"@",
|
|
17762
18722
|
organization.orgHandle
|
|
17763
18723
|
] })
|
|
17764
18724
|
] })
|
|
17765
18725
|
] }),
|
|
17766
|
-
/* @__PURE__ */
|
|
18726
|
+
/* @__PURE__ */ jsx123("div", { className: cx40(styles["infoContainer"]), children: fields.map((field) => renderOrganizationField(field)) })
|
|
17767
18727
|
] });
|
|
17768
18728
|
if (mode === "popup") {
|
|
17769
|
-
return /* @__PURE__ */
|
|
17770
|
-
/* @__PURE__ */
|
|
17771
|
-
/* @__PURE__ */
|
|
18729
|
+
return /* @__PURE__ */ jsx123(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ jsxs56(Dialog_default.Content, { children: [
|
|
18730
|
+
/* @__PURE__ */ jsx123(Dialog_default.Heading, { children: title }),
|
|
18731
|
+
/* @__PURE__ */ jsx123("div", { className: cx40(styles["popup"]), children: profileContent })
|
|
17772
18732
|
] }) });
|
|
17773
18733
|
}
|
|
17774
18734
|
return profileContent;
|
|
@@ -17844,7 +18804,7 @@ var updateOrganization = async ({
|
|
|
17844
18804
|
var updateOrganization_default = updateOrganization;
|
|
17845
18805
|
|
|
17846
18806
|
// src/components/presentation/OrganizationProfile/OrganizationProfile.tsx
|
|
17847
|
-
import { jsx as
|
|
18807
|
+
import { jsx as jsx124 } from "react/jsx-runtime";
|
|
17848
18808
|
var logger12 = createPackageComponentLogger10(
|
|
17849
18809
|
"@asgardeo/react",
|
|
17850
18810
|
"OrganizationProfile"
|
|
@@ -17863,7 +18823,7 @@ var OrganizationProfile = ({
|
|
|
17863
18823
|
}) => {
|
|
17864
18824
|
const { baseUrl, instanceId } = useAsgardeo_default();
|
|
17865
18825
|
const { t } = useTranslation_default(preferences?.i18n);
|
|
17866
|
-
const [organization, setOrganization] =
|
|
18826
|
+
const [organization, setOrganization] = useState39(null);
|
|
17867
18827
|
const fetchOrganization = async () => {
|
|
17868
18828
|
if (!baseUrl || !organizationId) {
|
|
17869
18829
|
return;
|
|
@@ -17880,7 +18840,7 @@ var OrganizationProfile = ({
|
|
|
17880
18840
|
setOrganization(null);
|
|
17881
18841
|
}
|
|
17882
18842
|
};
|
|
17883
|
-
|
|
18843
|
+
useEffect27(() => {
|
|
17884
18844
|
fetchOrganization();
|
|
17885
18845
|
}, [baseUrl, organizationId]);
|
|
17886
18846
|
const handleOrganizationUpdate = async (payload) => {
|
|
@@ -17902,7 +18862,7 @@ var OrganizationProfile = ({
|
|
|
17902
18862
|
throw err;
|
|
17903
18863
|
}
|
|
17904
18864
|
};
|
|
17905
|
-
return /* @__PURE__ */
|
|
18865
|
+
return /* @__PURE__ */ jsx124(
|
|
17906
18866
|
BaseOrganizationProfile_default,
|
|
17907
18867
|
{
|
|
17908
18868
|
organization,
|
|
@@ -17919,7 +18879,7 @@ var OrganizationProfile = ({
|
|
|
17919
18879
|
var OrganizationProfile_default = OrganizationProfile;
|
|
17920
18880
|
|
|
17921
18881
|
// src/components/presentation/OrganizationSwitcher/OrganizationSwitcher.tsx
|
|
17922
|
-
import { Fragment as Fragment25, jsx as
|
|
18882
|
+
import { Fragment as Fragment25, jsx as jsx125, jsxs as jsxs57 } from "react/jsx-runtime";
|
|
17923
18883
|
var OrganizationSwitcher = ({
|
|
17924
18884
|
currentOrganization: propCurrentOrganization,
|
|
17925
18885
|
fallback = null,
|
|
@@ -17936,15 +18896,15 @@ var OrganizationSwitcher = ({
|
|
|
17936
18896
|
isLoading,
|
|
17937
18897
|
error
|
|
17938
18898
|
} = useOrganization_default();
|
|
17939
|
-
const [isCreateOrgOpen, setIsCreateOrgOpen] =
|
|
17940
|
-
const [isProfileOpen, setIsProfileOpen] =
|
|
17941
|
-
const [isOrganizationListOpen, setIsOrganizationListOpen] =
|
|
18899
|
+
const [isCreateOrgOpen, setIsCreateOrgOpen] = useState40(false);
|
|
18900
|
+
const [isProfileOpen, setIsProfileOpen] = useState40(false);
|
|
18901
|
+
const [isOrganizationListOpen, setIsOrganizationListOpen] = useState40(false);
|
|
17942
18902
|
const { t } = useTranslation_default(preferences?.i18n);
|
|
17943
18903
|
if (!isSignedIn && fallback) {
|
|
17944
18904
|
return fallback;
|
|
17945
18905
|
}
|
|
17946
18906
|
if (!isSignedIn) {
|
|
17947
|
-
return /* @__PURE__ */
|
|
18907
|
+
return /* @__PURE__ */ jsx125(Fragment25, {});
|
|
17948
18908
|
}
|
|
17949
18909
|
const organizations = propOrganizations || contextOrganizations || [];
|
|
17950
18910
|
const currentOrganization = propCurrentOrganization || contextCurrentOrganization;
|
|
@@ -17958,19 +18918,19 @@ var OrganizationSwitcher = ({
|
|
|
17958
18918
|
const defaultMenuItems = [];
|
|
17959
18919
|
if (currentOrganization) {
|
|
17960
18920
|
defaultMenuItems.push({
|
|
17961
|
-
icon: /* @__PURE__ */
|
|
18921
|
+
icon: /* @__PURE__ */ jsx125(BuildingAlt_default, {}),
|
|
17962
18922
|
label: t("organization.switcher.manage.organizations"),
|
|
17963
18923
|
onClick: handleManageOrganizations
|
|
17964
18924
|
});
|
|
17965
18925
|
}
|
|
17966
18926
|
defaultMenuItems.push({
|
|
17967
|
-
icon: /* @__PURE__ */
|
|
18927
|
+
icon: /* @__PURE__ */ jsx125("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx125("path", { d: "M12 5v14m-7-7h14" }) }),
|
|
17968
18928
|
label: t("organization.switcher.create.organization"),
|
|
17969
18929
|
onClick: () => setIsCreateOrgOpen(true)
|
|
17970
18930
|
});
|
|
17971
18931
|
const menuItems = props.menuItems ? [...defaultMenuItems, ...props.menuItems] : defaultMenuItems;
|
|
17972
|
-
return /* @__PURE__ */
|
|
17973
|
-
/* @__PURE__ */
|
|
18932
|
+
return /* @__PURE__ */ jsxs57(Fragment25, { children: [
|
|
18933
|
+
/* @__PURE__ */ jsx125(
|
|
17974
18934
|
BaseOrganizationSwitcher,
|
|
17975
18935
|
{
|
|
17976
18936
|
organizations,
|
|
@@ -17984,7 +18944,7 @@ var OrganizationSwitcher = ({
|
|
|
17984
18944
|
...props
|
|
17985
18945
|
}
|
|
17986
18946
|
),
|
|
17987
|
-
/* @__PURE__ */
|
|
18947
|
+
/* @__PURE__ */ jsx125(
|
|
17988
18948
|
CreateOrganization,
|
|
17989
18949
|
{
|
|
17990
18950
|
mode: "popup",
|
|
@@ -17998,7 +18958,7 @@ var OrganizationSwitcher = ({
|
|
|
17998
18958
|
}
|
|
17999
18959
|
}
|
|
18000
18960
|
),
|
|
18001
|
-
currentOrganization && /* @__PURE__ */
|
|
18961
|
+
currentOrganization && /* @__PURE__ */ jsx125(
|
|
18002
18962
|
OrganizationProfile_default,
|
|
18003
18963
|
{
|
|
18004
18964
|
organizationId: currentOrganization.id,
|
|
@@ -18006,11 +18966,11 @@ var OrganizationSwitcher = ({
|
|
|
18006
18966
|
open: isProfileOpen,
|
|
18007
18967
|
onOpenChange: setIsProfileOpen,
|
|
18008
18968
|
cardLayout: true,
|
|
18009
|
-
loadingFallback: /* @__PURE__ */
|
|
18010
|
-
errorFallback: /* @__PURE__ */
|
|
18969
|
+
loadingFallback: /* @__PURE__ */ jsx125("div", { children: t("organization.profile.loading") }),
|
|
18970
|
+
errorFallback: /* @__PURE__ */ jsx125("div", { children: t("organization.profile.error") })
|
|
18011
18971
|
}
|
|
18012
18972
|
),
|
|
18013
|
-
/* @__PURE__ */
|
|
18973
|
+
/* @__PURE__ */ jsx125(
|
|
18014
18974
|
OrganizationList_default,
|
|
18015
18975
|
{
|
|
18016
18976
|
mode: "popup",
|
|
@@ -18030,7 +18990,7 @@ var OrganizationSwitcher = ({
|
|
|
18030
18990
|
var OrganizationSwitcher_default = OrganizationSwitcher;
|
|
18031
18991
|
|
|
18032
18992
|
// src/components/presentation/LanguageSwitcher/BaseLanguageSwitcher.tsx
|
|
18033
|
-
import { cx as
|
|
18993
|
+
import { cx as cx41 } from "@emotion/css";
|
|
18034
18994
|
import {
|
|
18035
18995
|
autoUpdate as autoUpdate3,
|
|
18036
18996
|
flip as flip3,
|
|
@@ -18044,7 +19004,7 @@ import {
|
|
|
18044
19004
|
useInteractions as useInteractions4,
|
|
18045
19005
|
useRole as useRole4
|
|
18046
19006
|
} from "@floating-ui/react";
|
|
18047
|
-
import { useEffect as
|
|
19007
|
+
import { useEffect as useEffect28, useState as useState41 } from "react";
|
|
18048
19008
|
|
|
18049
19009
|
// src/components/presentation/LanguageSwitcher/BaseLanguageSwitcher.styles.ts
|
|
18050
19010
|
import { css as css36 } from "@emotion/css";
|
|
@@ -18159,7 +19119,7 @@ var useStyles35 = (theme, colorScheme) => useMemo47(() => {
|
|
|
18159
19119
|
var BaseLanguageSwitcher_styles_default = useStyles35;
|
|
18160
19120
|
|
|
18161
19121
|
// src/components/presentation/LanguageSwitcher/BaseLanguageSwitcher.tsx
|
|
18162
|
-
import { Fragment as Fragment26, jsx as
|
|
19122
|
+
import { Fragment as Fragment26, jsx as jsx126, jsxs as jsxs58 } from "react/jsx-runtime";
|
|
18163
19123
|
var BaseLanguageSwitcher = ({
|
|
18164
19124
|
children,
|
|
18165
19125
|
className,
|
|
@@ -18170,9 +19130,9 @@ var BaseLanguageSwitcher = ({
|
|
|
18170
19130
|
}) => {
|
|
18171
19131
|
const { theme, colorScheme } = useTheme_default();
|
|
18172
19132
|
const styles = BaseLanguageSwitcher_styles_default(theme, colorScheme);
|
|
18173
|
-
const [isOpen, setIsOpen] =
|
|
19133
|
+
const [isOpen, setIsOpen] = useState41(false);
|
|
18174
19134
|
const hasMultipleLanguages = languages.length > 1;
|
|
18175
|
-
|
|
19135
|
+
useEffect28(() => {
|
|
18176
19136
|
if (!hasMultipleLanguages && isOpen) {
|
|
18177
19137
|
setIsOpen(false);
|
|
18178
19138
|
}
|
|
@@ -18189,15 +19149,15 @@ var BaseLanguageSwitcher = ({
|
|
|
18189
19149
|
const { getReferenceProps, getFloatingProps } = useInteractions4([click, dismiss, role]);
|
|
18190
19150
|
const currentOption = languages.find((l) => l.code === currentLanguage);
|
|
18191
19151
|
if (children) {
|
|
18192
|
-
return /* @__PURE__ */
|
|
19152
|
+
return /* @__PURE__ */ jsx126(Fragment26, { children: children({
|
|
18193
19153
|
currentLanguage,
|
|
18194
19154
|
isLoading,
|
|
18195
19155
|
languages,
|
|
18196
19156
|
onLanguageChange
|
|
18197
19157
|
}) });
|
|
18198
19158
|
}
|
|
18199
|
-
return /* @__PURE__ */
|
|
18200
|
-
/* @__PURE__ */
|
|
19159
|
+
return /* @__PURE__ */ jsxs58("div", { className: cx41(styles["root"], className), children: [
|
|
19160
|
+
/* @__PURE__ */ jsxs58(
|
|
18201
19161
|
"button",
|
|
18202
19162
|
{
|
|
18203
19163
|
ref: refs.setReference,
|
|
@@ -18207,13 +19167,13 @@ var BaseLanguageSwitcher = ({
|
|
|
18207
19167
|
...getReferenceProps(),
|
|
18208
19168
|
className: styles["trigger"],
|
|
18209
19169
|
children: [
|
|
18210
|
-
currentOption && /* @__PURE__ */
|
|
18211
|
-
/* @__PURE__ */
|
|
18212
|
-
hasMultipleLanguages && /* @__PURE__ */
|
|
19170
|
+
currentOption && /* @__PURE__ */ jsx126("span", { className: styles["triggerEmoji"], children: currentOption.emoji }),
|
|
19171
|
+
/* @__PURE__ */ jsx126("span", { className: styles["triggerLabel"], children: currentOption?.displayName ?? currentLanguage }),
|
|
19172
|
+
hasMultipleLanguages && /* @__PURE__ */ jsx126(ChevronDown_default, {})
|
|
18213
19173
|
]
|
|
18214
19174
|
}
|
|
18215
19175
|
),
|
|
18216
|
-
isOpen && hasMultipleLanguages && /* @__PURE__ */
|
|
19176
|
+
isOpen && hasMultipleLanguages && /* @__PURE__ */ jsx126(FloatingPortal4, { children: /* @__PURE__ */ jsx126(FloatingFocusManager4, { context, modal: false, children: /* @__PURE__ */ jsx126(
|
|
18217
19177
|
"div",
|
|
18218
19178
|
{
|
|
18219
19179
|
ref: refs.setFloating,
|
|
@@ -18222,21 +19182,21 @@ var BaseLanguageSwitcher = ({
|
|
|
18222
19182
|
className: styles["content"],
|
|
18223
19183
|
role: "listbox",
|
|
18224
19184
|
"aria-label": "Select language",
|
|
18225
|
-
children: languages.map((lang) => /* @__PURE__ */
|
|
19185
|
+
children: languages.map((lang) => /* @__PURE__ */ jsxs58(
|
|
18226
19186
|
"button",
|
|
18227
19187
|
{
|
|
18228
19188
|
type: "button",
|
|
18229
19189
|
role: "option",
|
|
18230
19190
|
"aria-selected": lang.code === currentLanguage,
|
|
18231
|
-
className:
|
|
19191
|
+
className: cx41(styles["option"], lang.code === currentLanguage && styles["optionActive"]),
|
|
18232
19192
|
onClick: () => {
|
|
18233
19193
|
onLanguageChange(lang.code);
|
|
18234
19194
|
setIsOpen(false);
|
|
18235
19195
|
},
|
|
18236
19196
|
children: [
|
|
18237
|
-
/* @__PURE__ */
|
|
18238
|
-
/* @__PURE__ */
|
|
18239
|
-
lang.code === currentLanguage && /* @__PURE__ */
|
|
19197
|
+
/* @__PURE__ */ jsx126("span", { className: styles["optionEmoji"], children: lang.emoji }),
|
|
19198
|
+
/* @__PURE__ */ jsx126("span", { className: styles["optionLabel"], children: lang.displayName }),
|
|
19199
|
+
lang.code === currentLanguage && /* @__PURE__ */ jsx126("span", { className: styles["checkIcon"], children: /* @__PURE__ */ jsx126(Check_default, {}) })
|
|
18240
19200
|
]
|
|
18241
19201
|
},
|
|
18242
19202
|
lang.code
|
|
@@ -18249,12 +19209,12 @@ var BaseLanguageSwitcher_default = BaseLanguageSwitcher;
|
|
|
18249
19209
|
|
|
18250
19210
|
// src/components/presentation/LanguageSwitcher/LanguageSwitcher.tsx
|
|
18251
19211
|
import { resolveLocaleDisplayName, resolveLocaleEmoji } from "@asgardeo/browser";
|
|
18252
|
-
import { useEffect as
|
|
19212
|
+
import { useEffect as useEffect29, useMemo as useMemo48 } from "react";
|
|
18253
19213
|
|
|
18254
19214
|
// src/contexts/FlowMeta/useFlowMeta.ts
|
|
18255
|
-
import { useContext as
|
|
19215
|
+
import { useContext as useContext17 } from "react";
|
|
18256
19216
|
var useFlowMeta = () => {
|
|
18257
|
-
const context =
|
|
19217
|
+
const context = useContext17(FlowMetaContext_default);
|
|
18258
19218
|
if (!context) {
|
|
18259
19219
|
throw new Error("useFlowMeta must be used within a FlowMetaProvider");
|
|
18260
19220
|
}
|
|
@@ -18263,7 +19223,7 @@ var useFlowMeta = () => {
|
|
|
18263
19223
|
var useFlowMeta_default = useFlowMeta;
|
|
18264
19224
|
|
|
18265
19225
|
// src/components/presentation/LanguageSwitcher/LanguageSwitcher.tsx
|
|
18266
|
-
import { jsx as
|
|
19226
|
+
import { jsx as jsx127 } from "react/jsx-runtime";
|
|
18267
19227
|
var LanguageSwitcher = ({ children, className }) => {
|
|
18268
19228
|
const { meta, switchLanguage, isLoading } = useFlowMeta_default();
|
|
18269
19229
|
const { currentLanguage } = useTranslation_default();
|
|
@@ -18281,7 +19241,7 @@ var LanguageSwitcher = ({ children, className }) => {
|
|
|
18281
19241
|
})),
|
|
18282
19242
|
[effectiveLanguageCodes]
|
|
18283
19243
|
);
|
|
18284
|
-
|
|
19244
|
+
useEffect29(() => {
|
|
18285
19245
|
if (availableLanguageCodes.length > 0 && !availableLanguageCodes.includes(currentLanguage)) {
|
|
18286
19246
|
switchLanguage(availableLanguageCodes[0]);
|
|
18287
19247
|
}
|
|
@@ -18291,7 +19251,7 @@ var LanguageSwitcher = ({ children, className }) => {
|
|
|
18291
19251
|
switchLanguage(language);
|
|
18292
19252
|
}
|
|
18293
19253
|
};
|
|
18294
|
-
return /* @__PURE__ */
|
|
19254
|
+
return /* @__PURE__ */ jsx127(
|
|
18295
19255
|
BaseLanguageSwitcher_default,
|
|
18296
19256
|
{
|
|
18297
19257
|
currentLanguage,
|
|
@@ -18325,7 +19285,9 @@ import {
|
|
|
18325
19285
|
EmbeddedFlowTextVariantV2,
|
|
18326
19286
|
EmbeddedFlowEventTypeV2,
|
|
18327
19287
|
EmbeddedSignInFlowStatusV2 as EmbeddedSignInFlowStatusV23,
|
|
18328
|
-
EmbeddedSignInFlowTypeV2 as EmbeddedSignInFlowTypeV22
|
|
19288
|
+
EmbeddedSignInFlowTypeV2 as EmbeddedSignInFlowTypeV22,
|
|
19289
|
+
EmbeddedRecoveryFlowStatusV2,
|
|
19290
|
+
EmbeddedRecoveryFlowTypeV2
|
|
18329
19291
|
} from "@asgardeo/browser";
|
|
18330
19292
|
export {
|
|
18331
19293
|
AcceptInvite_default as AcceptInvite,
|
|
@@ -18341,6 +19303,7 @@ export {
|
|
|
18341
19303
|
BaseOrganizationList_default as BaseOrganizationList,
|
|
18342
19304
|
BaseOrganizationProfile_default as BaseOrganizationProfile,
|
|
18343
19305
|
BaseOrganizationSwitcher_default as BaseOrganizationSwitcher,
|
|
19306
|
+
BaseRecovery_default3 as BaseRecovery,
|
|
18344
19307
|
BaseSignIn_default3 as BaseSignIn,
|
|
18345
19308
|
BaseSignInButton_default as BaseSignInButton,
|
|
18346
19309
|
BaseSignOutButton_default as BaseSignOutButton,
|
|
@@ -18369,6 +19332,8 @@ export {
|
|
|
18369
19332
|
EmbeddedFlowComponentTypeV2 as EmbeddedFlowComponentType,
|
|
18370
19333
|
EmbeddedFlowEventTypeV2 as EmbeddedFlowEventType,
|
|
18371
19334
|
EmbeddedFlowTextVariantV2 as EmbeddedFlowTextVariant,
|
|
19335
|
+
EmbeddedRecoveryFlowStatusV2 as EmbeddedRecoveryFlowStatus,
|
|
19336
|
+
EmbeddedRecoveryFlowTypeV2 as EmbeddedRecoveryFlowType,
|
|
18372
19337
|
EmbeddedSignInFlowStatusV23 as EmbeddedSignInFlowStatus,
|
|
18373
19338
|
EmbeddedSignInFlowTypeV22 as EmbeddedSignInFlowType,
|
|
18374
19339
|
Eye_default as Eye,
|
|
@@ -18405,6 +19370,7 @@ export {
|
|
|
18405
19370
|
OrganizationUnitPicker_default as OrganizationUnitPicker,
|
|
18406
19371
|
OtpField_default as OtpField,
|
|
18407
19372
|
PasswordField_default as PasswordField,
|
|
19373
|
+
Recovery_default3 as Recovery,
|
|
18408
19374
|
Select_default as Select,
|
|
18409
19375
|
SignIn_default2 as SignIn,
|
|
18410
19376
|
SignInButton_default as SignInButton,
|