@wix/members 1.0.544 → 1.0.545
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/build/cjs/context-authentication.js +115 -114
- package/build/cjs/context-authentication.js.map +1 -1
- package/build/es/context-authentication.mjs +115 -114
- package/build/es/context-authentication.mjs.map +1 -1
- package/context-runtime/context-authentication/runtime.js +2 -2
- package/package.json +2 -2
|
@@ -20,12 +20,12 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// context-authentication.ts
|
|
21
21
|
var context_authentication_exports = {};
|
|
22
22
|
__export(context_authentication_exports, {
|
|
23
|
-
AuthenticationContext: () =>
|
|
24
|
-
AuthenticationContextProvider: () =>
|
|
25
|
-
default: () =>
|
|
26
|
-
injectAccessTokenGetter: () =>
|
|
27
|
-
useContextProvider: () =>
|
|
28
|
-
useContextProviderSafe: () =>
|
|
23
|
+
AuthenticationContext: () => Sg,
|
|
24
|
+
AuthenticationContextProvider: () => Og,
|
|
25
|
+
default: () => Og,
|
|
26
|
+
injectAccessTokenGetter: () => kg,
|
|
27
|
+
useContextProvider: () => Cg,
|
|
28
|
+
useContextProviderSafe: () => wg
|
|
29
29
|
});
|
|
30
30
|
module.exports = __toCommonJS(context_authentication_exports);
|
|
31
31
|
|
|
@@ -4000,25 +4000,26 @@ var mh = { name: `memberState`, defaults: { memberState: { loginStatus: `LOGGED_
|
|
|
4000
4000
|
} };
|
|
4001
4001
|
var hh = { "-19999": `errorResetPasswordUserNotFound`, USER_NOT_FOUND: `errorResetPasswordUserNotFound`, INVALID_EMAIL: `errorResetPasswordInvalidEmail`, "-19901": `errorTooManyEmails`, RESOURCE_EXHAUSTED_EXCEPTION: `errorTooManyRequests`, 429: `errorTooManyRequests` };
|
|
4002
4002
|
var gh = (e6, t2 = Tm) => t2(e6 && hh[e6] || `errorGeneral`);
|
|
4003
|
-
var _h =
|
|
4004
|
-
var vh = `
|
|
4005
|
-
var yh = `
|
|
4006
|
-
var bh = `
|
|
4007
|
-
var xh = `
|
|
4008
|
-
var Sh =
|
|
4009
|
-
var Ch = () =>
|
|
4010
|
-
var wh =
|
|
4011
|
-
var Th =
|
|
4003
|
+
var _h = { PASSWORDS_DO_NOT_MATCH: `errorPasswordsDoNotMatch`, VALUE_TOO_SHORT: `errorPasswordTooShort`, MIN_LENGTH: `errorPasswordTooShort` };
|
|
4004
|
+
var vh = (e6, t2 = Tm) => t2(e6 && _h[e6] || `errorGeneral`);
|
|
4005
|
+
var yh = `SEND_RESET_PASSWORD_EMAIL_UNAVAILABLE`;
|
|
4006
|
+
var bh = `CHANGE_PASSWORD_UNAVAILABLE`;
|
|
4007
|
+
var xh = `MISSING_RESET_PASSWORD_TOKEN`;
|
|
4008
|
+
var Sh = `PASSWORDS_DO_NOT_MATCH`;
|
|
4009
|
+
var Ch = () => Promise.resolve();
|
|
4010
|
+
var wh = () => void 0;
|
|
4011
|
+
var Th = [`forgotPasswordToken`, `resetPasswordToken`];
|
|
4012
|
+
var Eh = () => {
|
|
4012
4013
|
if (typeof window > `u`) return null;
|
|
4013
4014
|
let e6 = new URLSearchParams(window.location.search);
|
|
4014
|
-
return
|
|
4015
|
+
return Th.map((t2) => e6.get(t2)).find(Boolean) ?? null;
|
|
4015
4016
|
};
|
|
4016
|
-
var
|
|
4017
|
-
let r2 = Dm(), o2 = (0, import_react.useCallback)((e7) => gh(e7, r2), [r2]), c2 = (0, import_react.useCallback)((e7) =>
|
|
4017
|
+
var Dh = { name: `resetPassword`, defaults: { resetPasswordState: P, changePasswordState: P, submitResetPasswordEmail: Ch, submitChangePassword: Ch }, useValue: ({ siteMembers: e6 }, { forms: t2 }) => {
|
|
4018
|
+
let r2 = Dm(), o2 = (0, import_react.useCallback)((e7) => gh(e7, r2), [r2]), c2 = (0, import_react.useCallback)((e7) => vh(e7, r2), [r2]), l2 = (0, import_react.useCallback)(async (t3) => {
|
|
4018
4019
|
let n2 = K();
|
|
4019
4020
|
q(G.forgotPasswordResetPasswordClick, n2);
|
|
4020
4021
|
try {
|
|
4021
|
-
if (!e6?.sendResetPasswordEmail) throw new N(
|
|
4022
|
+
if (!e6?.sendResetPasswordEmail) throw new N(yh);
|
|
4022
4023
|
await e6.sendResetPasswordEmail(t3);
|
|
4023
4024
|
} catch (e7) {
|
|
4024
4025
|
throw q(G.forgotPasswordFailure, { ...n2, failure_reason: qn(e7) }), e7;
|
|
@@ -4028,9 +4029,9 @@ var Eh = { name: `resetPassword`, defaults: { resetPasswordState: P, changePassw
|
|
|
4028
4029
|
let n2 = K();
|
|
4029
4030
|
q(G.newPasswordCreatePasswordClick, n2);
|
|
4030
4031
|
try {
|
|
4031
|
-
if (!e6?.changePassword) throw new N(
|
|
4032
|
-
let n3 =
|
|
4033
|
-
if (!n3) throw new N(
|
|
4032
|
+
if (!e6?.changePassword) throw new N(bh);
|
|
4033
|
+
let n3 = Eh();
|
|
4034
|
+
if (!n3) throw new N(xh);
|
|
4034
4035
|
await e6.changePassword(t3, n3);
|
|
4035
4036
|
} catch (t4) {
|
|
4036
4037
|
let r3 = qn(t4);
|
|
@@ -4041,15 +4042,15 @@ var Eh = { name: `resetPassword`, defaults: { resetPasswordState: P, changePassw
|
|
|
4041
4042
|
(0, import_react.useEffect)(() => t2.addErrorClearer(() => {
|
|
4042
4043
|
d2(I), h2(I);
|
|
4043
4044
|
}), [t2]);
|
|
4044
|
-
let _2 = (0, import_react.useCallback)(() => f2(t2.field(`email`).trim()).catch(
|
|
4045
|
+
let _2 = (0, import_react.useCallback)(() => f2(t2.field(`email`).trim()).catch(wh), [t2, f2]), v2 = (0, import_react.useCallback)(() => {
|
|
4045
4046
|
let e7 = t2.field(`password`);
|
|
4046
|
-
return t2.hasField(`confirmPassword`) && t2.field(`confirmPassword`) !== e7 ? F(h2, () => Promise.reject(new N(
|
|
4047
|
+
return t2.hasField(`confirmPassword`) && t2.field(`confirmPassword`) !== e7 ? F(h2, () => Promise.reject(new N(Sh)), c2).catch(wh) : g2(e7).catch(wh);
|
|
4047
4048
|
}, [t2, g2, c2]);
|
|
4048
4049
|
return (0, import_react.useMemo)(() => ({ resetPasswordState: u2, changePasswordState: m2, submitResetPasswordEmail: _2, submitChangePassword: v2 }), [u2, m2, _2, v2]);
|
|
4049
4050
|
} };
|
|
4050
|
-
var
|
|
4051
|
+
var Oh = () => {
|
|
4051
4052
|
};
|
|
4052
|
-
var
|
|
4053
|
+
var kh = { name: `screens`, defaults: Object.fromEntries(Pm.map((e6) => [e6.functionName, Oh])), useValue: ({ siteMembers: e6 }) => {
|
|
4053
4054
|
let t2 = Im(Mn()?.pages);
|
|
4054
4055
|
return (0, import_react.useEffect)(() => {
|
|
4055
4056
|
if (!t2) return;
|
|
@@ -4059,14 +4060,14 @@ var Oh = { name: `screens`, defaults: Object.fromEntries(Pm.map((e6) => [e6.func
|
|
|
4059
4060
|
!t3.appPageId && t3.pageViewEvent && q(t3.pageViewEvent, K()), J(e6, t3.navigation).catch((e7) => console.error(`[ContextProvider] ${t3.functionName} failed`, e7));
|
|
4060
4061
|
}])), [e6]);
|
|
4061
4062
|
} };
|
|
4062
|
-
var
|
|
4063
|
+
var Ah = { name: `popupForms`, defaults: { closeEmailConfirmation: () => {
|
|
4063
4064
|
} }, useValue: ({ siteMembers: e6 }) => (0, import_react.useMemo)(() => ({ closeEmailConfirmation: () => {
|
|
4064
4065
|
J(e6, `closePopup`).then(() => J(e6, `goToSignup`)).catch((e7) => console.error(`[ContextProvider] closeEmailConfirmation failed`, e7));
|
|
4065
4066
|
} }), [e6]) };
|
|
4066
|
-
function
|
|
4067
|
+
function jh() {
|
|
4067
4068
|
let e6 = typeof $wixContext < `u` && $wixContext.initWixModules ? $wixContext.initWixModules : globalThis.__wix_context__ !== void 0 && globalThis.__wix_context__.initWixModules ? globalThis.__wix_context__.initWixModules : void 0;
|
|
4068
4069
|
if (e6) return { initWixModules(t3, n3) {
|
|
4069
|
-
return
|
|
4070
|
+
return Mh(() => e6(t3, n3));
|
|
4070
4071
|
}, fetchWithAuth() {
|
|
4071
4072
|
throw Error(`fetchWithAuth is not available in this context`);
|
|
4072
4073
|
}, graphql() {
|
|
@@ -4076,10 +4077,10 @@ function Ah() {
|
|
|
4076
4077
|
if (t2 || n2) return { initWixModules(e7, r2) {
|
|
4077
4078
|
if (r2) {
|
|
4078
4079
|
if (!n2) throw Error(`An elevated client is required to use elevated modules. Make sure to initialize the Wix context with an elevated client before using elevated SDK modules`);
|
|
4079
|
-
return
|
|
4080
|
+
return Mh(() => n2.use(e7));
|
|
4080
4081
|
}
|
|
4081
4082
|
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
4082
|
-
return
|
|
4083
|
+
return Mh(() => t2.use(e7));
|
|
4083
4084
|
}, fetchWithAuth: (e7, n3) => {
|
|
4084
4085
|
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
4085
4086
|
return t2.fetchWithAuth(e7, n3);
|
|
@@ -4091,7 +4092,7 @@ function Ah() {
|
|
|
4091
4092
|
return t2.graphql(e7, n3, r2);
|
|
4092
4093
|
} };
|
|
4093
4094
|
}
|
|
4094
|
-
function
|
|
4095
|
+
function Mh(e6) {
|
|
4095
4096
|
let t2 = globalThis.__wix_context__, n2 = { client: p.client, elevatedClient: p.elevatedClient }, r2;
|
|
4096
4097
|
globalThis.__wix_context__ = void 0, p.client = void 0, p.elevatedClient = void 0, typeof $wixContext < `u` && (r2 = { client: $wixContext?.client, elevatedClient: $wixContext?.elevatedClient }, delete $wixContext.client, delete $wixContext.elevatedClient);
|
|
4097
4098
|
try {
|
|
@@ -4100,34 +4101,34 @@ function jh(e6) {
|
|
|
4100
4101
|
globalThis.__wix_context__ = t2, p.client = n2.client, p.elevatedClient = n2.elevatedClient, typeof $wixContext < `u` && ($wixContext.client = r2.client, $wixContext.elevatedClient = r2.elevatedClient);
|
|
4101
4102
|
}
|
|
4102
4103
|
}
|
|
4103
|
-
function
|
|
4104
|
+
function Nh(e6, t2) {
|
|
4104
4105
|
return (...n2) => {
|
|
4105
|
-
let r2 =
|
|
4106
|
+
let r2 = jh();
|
|
4106
4107
|
return r2 ? r2.initWixModules(e6, t2).apply(void 0, n2) : e6.apply(void 0, n2);
|
|
4107
4108
|
};
|
|
4108
4109
|
}
|
|
4109
|
-
function
|
|
4110
|
-
return
|
|
4110
|
+
function Ph(e6, t2 = false) {
|
|
4111
|
+
return Nh(e6, t2);
|
|
4111
4112
|
}
|
|
4112
4113
|
RegExp(`\\.(${[`wix.com`, `editorx.com`].join(`|`)})$`), RegExp(`\\.(${[`42.wixprod.net`, `uw2-edt-1.wixprod.net`, `virginia-edt.wixprod.net`].join(`|`)})$`);
|
|
4113
|
-
var
|
|
4114
|
-
|
|
4114
|
+
var Fh = Ph((e6) => (t2, n2) => e6.fetchWithAuth(t2, n2));
|
|
4115
|
+
Ph((e6) => async function(t2, n2, r2 = { apiVersion: `alpha` }) {
|
|
4115
4116
|
return (await e6.request(({ host: e7 }) => ({ method: `POST`, url: `${e7 === `www.wixapis.com` ? `/graphql` : `/_api/graphql`}/${r2.apiVersion}`, data: { query: t2, variables: n2 }, packageName: `@wix/essentials` }))).data;
|
|
4116
4117
|
});
|
|
4117
|
-
var
|
|
4118
|
-
function
|
|
4118
|
+
var Ih = [{ path: `memberPrivacySettings.updatedDate` }];
|
|
4119
|
+
function Lh(e6) {
|
|
4119
4120
|
return At(Object.assign(e6, { domainToMappings: { "editor.wixapps.net": [{ srcPath: `/_api/members/v1/privacy-settings`, destPath: `/v1/privacy-settings` }], "api._api_base_domain_": [{ srcPath: `/members/v1/privacy-settings`, destPath: `` }], "manage._base_domain_": [{ srcPath: `/_api/members/v1/privacy-settings`, destPath: `/v1/privacy-settings` }], "editor._base_domain_": [{ srcPath: `/_api/members/v1/privacy-settings`, destPath: `/v1/privacy-settings` }], "blocks._base_domain_": [{ srcPath: `/_api/members/v1/privacy-settings`, destPath: `/v1/privacy-settings` }], "create.editorx": [{ srcPath: `/_api/members/v1/privacy-settings`, destPath: `/v1/privacy-settings` }], "www.wixapis.com": [{ srcPath: `/members/v1/privacy-settings`, destPath: `/v1/privacy-settings` }], _: [{ srcPath: `/_api/members/v1/privacy-settings`, destPath: `/v1/privacy-settings` }], "www._base_domain_": [{ srcPath: `/_api/members/v1/privacy-settings`, destPath: `/v1/privacy-settings` }], "*.dev.wix-code.com": [{ srcPath: `/_api/members/v1/privacy-settings`, destPath: `/v1/privacy-settings` }], "bo._base_domain_": [{ srcPath: `/_api/members/v1/privacy-settings`, destPath: `/v1/privacy-settings` }], "wixbo.ai": [{ srcPath: `/_api/members/v1/privacy-settings`, destPath: `/v1/privacy-settings` }], "wix-bo.com": [{ srcPath: `/_api/members/v1/privacy-settings`, destPath: `/v1/privacy-settings` }], "apps._base_domain_": [{ srcPath: `/_api/members/v1/privacy-settings`, destPath: `/v1/privacy-settings` }] } }));
|
|
4120
4121
|
}
|
|
4121
|
-
var
|
|
4122
|
-
function
|
|
4122
|
+
var Rh = `@wix/auto_sdk_members_member-privacy-settings`;
|
|
4123
|
+
function zh(e6) {
|
|
4123
4124
|
function t2({ host: t3 }) {
|
|
4124
|
-
return { entityFqdn: `wix.members.v1.member_privacy_settings`, method: `GET`, methodFqn: `com.wixpress.members.memberprivacysettings.MemberPrivacySettingsService.GetMemberPrivacySettings`, packageName:
|
|
4125
|
+
return { entityFqdn: `wix.members.v1.member_privacy_settings`, method: `GET`, methodFqn: `com.wixpress.members.memberprivacysettings.MemberPrivacySettingsService.GetMemberPrivacySettings`, packageName: Rh, migrationOptions: { optInTransformResponse: true }, url: Lh({ protoPath: `/v1/privacy-settings`, data: e6, host: t3 }), params: kt(e6), transformResponse: (e7) => st(e7, [{ transformFn: Je, paths: Ih }]) };
|
|
4125
4126
|
}
|
|
4126
4127
|
return t2;
|
|
4127
4128
|
}
|
|
4128
|
-
var
|
|
4129
|
-
async function
|
|
4130
|
-
let { httpClient: e6, sideEffects: t2 } = arguments[0], n2 =
|
|
4129
|
+
var Bh = ((e6) => (e6.UNKNOWN = `UNKNOWN`, e6.NO_ONE = `NO_ONE`, e6.ANYONE = `ANYONE`, e6))(Bh || {});
|
|
4130
|
+
async function Vh() {
|
|
4131
|
+
let { httpClient: e6, sideEffects: t2 } = arguments[0], n2 = zh(Ke({}));
|
|
4131
4132
|
t2?.onSiteCall?.();
|
|
4132
4133
|
try {
|
|
4133
4134
|
let r2 = await e6.request(n2);
|
|
@@ -4137,111 +4138,111 @@ async function Bh() {
|
|
|
4137
4138
|
throw t2?.onError?.(e7), n3;
|
|
4138
4139
|
}
|
|
4139
4140
|
}
|
|
4140
|
-
function
|
|
4141
|
-
return () =>
|
|
4141
|
+
function Hh(e6) {
|
|
4142
|
+
return () => Vh({ httpClient: e6 });
|
|
4142
4143
|
}
|
|
4143
|
-
var
|
|
4144
|
-
var
|
|
4145
|
-
var
|
|
4146
|
-
var
|
|
4144
|
+
var Uh = Ot(Hh);
|
|
4145
|
+
var Wh = { availableSignInMethods: [], loginCaptchaStatus: `NOT_REQUIRED`, signupCaptchaStatus: `NOT_REQUIRED`, loginCaptchaOption: `NEVER`, signupCaptchaOption: `NEVER`, socialSignInStatus: `DISABLED`, publicMembersStatus: `NOT_ALLOWED`, signupEmailVerificationMode: `NONE`, signupCustomFields: [] };
|
|
4146
|
+
var Gh = ({ availableSignInMethods: e6, socialSignInStatus: t2, ...n2 }) => ({ availableLoginMethods: e6, ...n2, socialLoginStatus: t2 });
|
|
4147
|
+
var Kh = (e6) => {
|
|
4147
4148
|
let t2 = e6.availableSignInMethods.some((e7) => e7.type === `SSO`);
|
|
4148
|
-
return { loginSettings:
|
|
4149
|
+
return { loginSettings: Gh(e6), isSsoEnabled: t2, signInSettings: e6, ssoEnabled: t2 };
|
|
4149
4150
|
};
|
|
4150
|
-
var
|
|
4151
|
-
var
|
|
4152
|
-
var
|
|
4153
|
-
var
|
|
4154
|
-
let r2 =
|
|
4151
|
+
var qh = `/_serverless/collection-settings-facade/get-settings`;
|
|
4152
|
+
var Jh = `https://www.wixapis.com${qh}`;
|
|
4153
|
+
var Yh = { "31fff8fc-ea95-43ac-95c5-902497125b90": `PASSWORD`, "0e6a50f5-b523-4e29-990d-f37fa2ffdd69": `GOOGLE`, "3ecad13f-52c3-483d-911f-31dbcf2a6d23": `FACEBOOK`, "ce1be235-3691-4532-906c-5a7d2e3acdd1": `APPLE`, "4f199cbe-22ee-40c8-9129-11f2b4178a38": `SSO` };
|
|
4154
|
+
var Xh = (e6) => (e6 ?? []).flatMap(({ id: e7, appDefId: t2, displayName: n2 }) => {
|
|
4155
|
+
let r2 = Yh[t2];
|
|
4155
4156
|
return r2 ? [{ connectionId: e7, name: n2 ?? ``, type: r2 }] : [];
|
|
4156
4157
|
});
|
|
4157
|
-
var
|
|
4158
|
-
let t2 = await
|
|
4158
|
+
var Zh = async (e6) => {
|
|
4159
|
+
let t2 = await Fh(e6, { headers: { accept: `application/json` } });
|
|
4159
4160
|
if (!t2.ok) throw Error(`collection settings: ${t2.status}`);
|
|
4160
4161
|
return await t2.json();
|
|
4161
4162
|
};
|
|
4162
|
-
var
|
|
4163
|
-
var
|
|
4164
|
-
var
|
|
4165
|
-
var
|
|
4163
|
+
var Qh = (e6) => e6 === `ALWAYS` || e6 === `SUSPECTED_BOTS_ONLY` ? e6 : `NEVER`;
|
|
4164
|
+
var $h = (e6) => e6 === `NEVER` ? `NOT_REQUIRED` : `REQUIRED`;
|
|
4165
|
+
var eg = /* @__PURE__ */ new Set([`NONE`, `AFTER_SIGNUP`, `DURING_SIGNUP`]);
|
|
4166
|
+
var tg = (e6) => {
|
|
4166
4167
|
let t2 = e6?.emailVerificationOption;
|
|
4167
|
-
return t2 &&
|
|
4168
|
+
return t2 && eg.has(t2) ? t2 : e6?.requireEmailVerification ? `AFTER_SIGNUP` : `NONE`;
|
|
4168
4169
|
};
|
|
4169
|
-
var
|
|
4170
|
-
let { collectionSettings: e6, enabledConnections: t2 } = await
|
|
4171
|
-
return { availableSignInMethods:
|
|
4170
|
+
var ng = async () => {
|
|
4171
|
+
let { collectionSettings: e6, enabledConnections: t2 } = await Zh(qh).catch(() => Zh(Jh)), n2 = Qh(e6?.loginRecaptchaOption), r2 = Qh(e6?.signupRecaptchaOption);
|
|
4172
|
+
return { availableSignInMethods: Xh(t2), loginCaptchaStatus: $h(n2), signupCaptchaStatus: $h(r2), loginCaptchaOption: n2, signupCaptchaOption: r2, socialSignInStatus: e6?.disableSocialLogins ? `DISABLED` : `ENABLED`, signupEmailVerificationMode: tg(e6) };
|
|
4172
4173
|
};
|
|
4173
|
-
var
|
|
4174
|
-
var
|
|
4175
|
-
let { memberPrivacySettings: e6 } = await
|
|
4176
|
-
return e6?.publicMemberCandidates ===
|
|
4174
|
+
var rg = (e6) => ng().catch((t2) => (console.error(`[ContextProvider] collection settings load failed`, t2), e6?.(), {}));
|
|
4175
|
+
var ig = async () => {
|
|
4176
|
+
let { memberPrivacySettings: e6 } = await Uh();
|
|
4177
|
+
return e6?.publicMemberCandidates === Bh.ANYONE ? `ALLOWED` : `NOT_ALLOWED`;
|
|
4177
4178
|
};
|
|
4178
|
-
var
|
|
4179
|
+
var ag = () => ig().catch((e6) => {
|
|
4179
4180
|
console.error(`[ContextProvider] member privacy settings load failed`, e6);
|
|
4180
4181
|
});
|
|
4181
|
-
var
|
|
4182
|
-
var
|
|
4183
|
-
var
|
|
4184
|
-
var
|
|
4182
|
+
var og = async (e6) => e6.publicMembersStatus ? void 0 : ag();
|
|
4183
|
+
var sg = /* @__PURE__ */ new Set([`14dbef06-cc42-5583-32a7-3abd44da4908`, `14724f35-6794-cd1a-0244-25fd138f9242`, `148c2287-c669-d849-d153-463c7486a694`, `14bcded7-0066-7c35-14d7-466cb3f09103`, `1537b24e-29d1-6d8f-b8e1-d6860f2f70b9`, `476dc2dd-e16e-43b0-a0aa-1a486c78fbe2`, `2936472a-a1ed-4ae5-9f71-614313a9f4e7`, `13ff8629-c1fc-e289-e81f-bc8c8968e9d6`, `91c9d6a7-6667-41fb-b0b4-7d3b3ff0b02e`, `a95a5fce-e370-4402-9ce4-96956acc747d`, `140603ad-af8d-84a5-2c80-a0f60cb47351`]);
|
|
4184
|
+
var cg = ({ pages: e6 }) => Object.values(e6?.pages ?? {}).some(({ appDefinitionId: e7 }) => e7 !== void 0 && sg.has(e7));
|
|
4185
|
+
var lg = async ({ siteMembers: e6 }) => {
|
|
4185
4186
|
if (!e6?.getSignInSettings) throw Error(`GET_SIGN_IN_SETTINGS_UNAVAILABLE`);
|
|
4186
4187
|
let t2 = await e6.getSignInSettings() ?? {};
|
|
4187
4188
|
return Object.fromEntries(Object.entries(t2).filter(([, e7]) => e7 != null));
|
|
4188
4189
|
};
|
|
4189
|
-
var
|
|
4190
|
-
var
|
|
4191
|
-
var
|
|
4192
|
-
var
|
|
4193
|
-
let t2 =
|
|
4194
|
-
return { loginCaptchaStatus:
|
|
4190
|
+
var ug = (e6, t2) => lg(e6).catch((e7) => (console.error(`[ContextProvider] signInSettings load failed, using defaults`, e7), t2?.(), {}));
|
|
4191
|
+
var dg = /* @__PURE__ */ new Set([`loginCaptchaStatus`, `signupCaptchaStatus`, `loginCaptchaOption`, `signupCaptchaOption`]);
|
|
4192
|
+
var fg = (e6, t2) => t2 ?? (e6 === `REQUIRED` ? `ALWAYS` : `NEVER`);
|
|
4193
|
+
var pg = (e6) => {
|
|
4194
|
+
let t2 = fg(e6.loginCaptchaStatus, e6.loginCaptchaOption), n2 = fg(e6.signupCaptchaStatus, e6.signupCaptchaOption);
|
|
4195
|
+
return { loginCaptchaStatus: $h(t2), signupCaptchaStatus: $h(n2), loginCaptchaOption: t2, signupCaptchaOption: n2 };
|
|
4195
4196
|
};
|
|
4196
|
-
var
|
|
4197
|
-
let s2 = Object.fromEntries(Object.entries(e6).filter(([e7]) => !
|
|
4198
|
-
return
|
|
4197
|
+
var mg = (e6, { availableSignInMethods: t2, socialSignInStatus: n2, signupEmailVerificationMode: r2, ...i2 }, a2, o2) => {
|
|
4198
|
+
let s2 = Object.fromEntries(Object.entries(e6).filter(([e7]) => !dg.has(e7))), c2 = Object.keys(i2).length > 0 ? i2 : pg(e6), l2 = Object.fromEntries(Object.entries({ availableSignInMethods: t2, socialSignInStatus: n2, signupEmailVerificationMode: r2 }).filter(([, e7]) => e7 !== void 0)), u2 = a2 ? { publicMembersStatus: a2 } : {}, d2 = { ...Wh, ...u2, ...l2, ...s2, ...c2 };
|
|
4199
|
+
return Kh(o2 ? d2 : { ...d2, publicMembersStatus: `NOT_ALLOWED` });
|
|
4199
4200
|
};
|
|
4200
|
-
var
|
|
4201
|
-
let [n2, r2] = await Promise.all([
|
|
4202
|
-
return
|
|
4201
|
+
var hg = [{ name: `loginSettings`, defaults: Kh(Wh), load: async (e6, t2) => {
|
|
4202
|
+
let [n2, r2] = await Promise.all([ug(e6, t2), rg(t2)]);
|
|
4203
|
+
return mg(n2, r2, await og(n2), cg(e6));
|
|
4203
4204
|
} }];
|
|
4204
|
-
var
|
|
4205
|
-
var
|
|
4206
|
-
var
|
|
4207
|
-
var
|
|
4208
|
-
var
|
|
4209
|
-
var
|
|
4210
|
-
let [n2] = (0, import_react.useState)(Xn), r2 = (0, import_react.useMemo)(() => ({ forms: n2, loginSettings: t2 }), [n2, t2]), i2 =
|
|
4211
|
-
return (0, import_react.useMemo)(() =>
|
|
4205
|
+
var gg = [mh, ah, Dh, Bm, kh, Ah, lh];
|
|
4206
|
+
var _g = (e6) => Object.assign({}, ...e6);
|
|
4207
|
+
var vg = (e6) => Object.fromEntries(Object.keys(Bn).map((t2) => [t2, Bn[t2].replaceAll(`{email}`, () => e6)]));
|
|
4208
|
+
var yg = _g([...[...hg, ...gg].map((e6) => e6.defaults), { texts: vg(``) }]);
|
|
4209
|
+
var bg = (e6, t2) => Promise.all(hg.map((n2) => n2.load(e6, t2))).then(_g);
|
|
4210
|
+
var xg = (e6, t2) => {
|
|
4211
|
+
let [n2] = (0, import_react.useState)(Xn), r2 = (0, import_react.useMemo)(() => ({ forms: n2, loginSettings: t2 }), [n2, t2]), i2 = gg.map((t3) => t3.useValue(e6, r2));
|
|
4212
|
+
return (0, import_react.useMemo)(() => _g(i2), i2);
|
|
4212
4213
|
};
|
|
4213
|
-
var
|
|
4214
|
-
|
|
4215
|
-
function Sg() {
|
|
4216
|
-
return (0, import_react.useContext)(xg) ?? vg;
|
|
4217
|
-
}
|
|
4214
|
+
var Sg = (0, import_react.createContext)(null);
|
|
4215
|
+
Sg.displayName = `AuthenticationContext`;
|
|
4218
4216
|
function Cg() {
|
|
4219
|
-
return (0, import_react.useContext)(
|
|
4217
|
+
return (0, import_react.useContext)(Sg) ?? yg;
|
|
4218
|
+
}
|
|
4219
|
+
function wg() {
|
|
4220
|
+
return (0, import_react.useContext)(Sg);
|
|
4220
4221
|
}
|
|
4221
|
-
var
|
|
4222
|
-
let n2 = Sn(e6), r2 =
|
|
4223
|
-
return (0, import_jsx_runtime.jsx)(
|
|
4222
|
+
var Tg = ({ promise: e6, children: t2 }) => {
|
|
4223
|
+
let n2 = Sn(e6), r2 = xg(In(), n2.loginSettings), i2 = (0, import_react.useMemo)(() => ({ ...n2, ...r2, texts: vg(r2.pendingApprovalState.pendingApprovalEmail) }), [n2, r2]);
|
|
4224
|
+
return (0, import_jsx_runtime.jsx)(Sg.Provider, { value: i2, children: t2 });
|
|
4224
4225
|
};
|
|
4225
|
-
var
|
|
4226
|
+
var Eg = (e6, t2) => bg(e6, t2).catch((e7) => {
|
|
4226
4227
|
throw console.error(`AuthenticationProvider load failed:`, e7), t2?.(), e7;
|
|
4227
4228
|
});
|
|
4228
4229
|
var $;
|
|
4229
|
-
var
|
|
4230
|
-
if (typeof window > `u`) return
|
|
4230
|
+
var Dg = (e6) => {
|
|
4231
|
+
if (typeof window > `u`) return Eg(e6);
|
|
4231
4232
|
if (!$) {
|
|
4232
4233
|
let t2 = () => {
|
|
4233
4234
|
}, n2 = () => {
|
|
4234
4235
|
t2(), $ === r2 && ($ = void 0);
|
|
4235
|
-
}, r2 =
|
|
4236
|
+
}, r2 = Eg(e6, n2);
|
|
4236
4237
|
$ = r2, t2 = zn(n2);
|
|
4237
4238
|
}
|
|
4238
4239
|
return $;
|
|
4239
4240
|
};
|
|
4240
|
-
var
|
|
4241
|
-
let n2 = In(), [r2] = (0, import_react.useState)(() =>
|
|
4242
|
-
return (0, import_jsx_runtime.jsx)(import_react.Suspense, { fallback: null, children: (0, import_jsx_runtime.jsx)(
|
|
4241
|
+
var Og = ({ children: t2 }) => {
|
|
4242
|
+
let n2 = In(), [r2] = (0, import_react.useState)(() => Dg(n2));
|
|
4243
|
+
return (0, import_jsx_runtime.jsx)(import_react.Suspense, { fallback: null, children: (0, import_jsx_runtime.jsx)(Tg, { promise: r2, children: t2 }) });
|
|
4243
4244
|
};
|
|
4244
|
-
var
|
|
4245
|
+
var kg = xn(`f106f6a2-ebf1-442f-b82b-fbcc51c790b2`);
|
|
4245
4246
|
// Annotate the CommonJS export names for ESM import in node:
|
|
4246
4247
|
0 && (module.exports = {
|
|
4247
4248
|
AuthenticationContext,
|