@wix/members 1.0.542 → 1.0.544

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/build/cjs/context-account-details.d.ts +9 -6
  2. package/build/cjs/context-account-details.js +94 -89
  3. package/build/cjs/context-account-details.js.map +1 -1
  4. package/build/cjs/context-addresses.js +2 -2
  5. package/build/cjs/context-addresses.js.map +1 -1
  6. package/build/es/context-account-details.d.mts +9 -6
  7. package/build/es/context-account-details.mjs +94 -89
  8. package/build/es/context-account-details.mjs.map +1 -1
  9. package/build/es/context-addresses.mjs +2 -2
  10. package/build/es/context-addresses.mjs.map +1 -1
  11. package/build/internal/cjs/context-account-details.d.ts +9 -6
  12. package/build/internal/es/context-account-details.d.mts +9 -6
  13. package/context-runtime/context-account-details/runtime.d.ts +9 -6
  14. package/context-runtime/context-account-details/runtime.js +3 -3
  15. package/context-runtime/context-addresses/runtime.js +3 -3
  16. package/package.json +2 -14
  17. package/account-home-context-provider/package.json +0 -3
  18. package/build/cjs/context-account-home.d.ts +0 -54
  19. package/build/cjs/context-account-home.js +0 -719
  20. package/build/cjs/context-account-home.js.map +0 -1
  21. package/build/es/context-account-home.d.mts +0 -54
  22. package/build/es/context-account-home.mjs +0 -690
  23. package/build/es/context-account-home.mjs.map +0 -1
  24. package/build/internal/cjs/context-account-home.d.ts +0 -54
  25. package/build/internal/es/context-account-home.d.mts +0 -54
  26. package/context/account-home/package.json +0 -3
  27. package/context-runtime/context-account-home/runtime.d.ts +0 -54
  28. package/context-runtime/context-account-home/runtime.js +0 -2
@@ -113,9 +113,9 @@ interface NamedFieldBinding {
113
113
  //#endregion
114
114
  //#region src/extensions/account-settings/context-providers/account-named-fields.d.ts
115
115
  /**
116
- * The platform's own field vocabulary, named as the Members SDK names each value. A `SYSTEM` or
117
- * `CONTACT` field exists on every site, so each one is addressable by name. Site-specific fields are
118
- * excluded from Phase 0. The contact email is absent on purpose: the API refuses a write to it.
116
+ * The platform's own field vocabulary, each named as the site names it. A `SYSTEM` or `CONTACT` field
117
+ * exists on every site, so each one is addressable by name. Site-specific fields are excluded from
118
+ * Phase 0. The contact email is absent on purpose: the API refuses a write to it.
119
119
  */
120
120
  declare const NAMED_FIELD_KEYS: {
121
121
  readonly firstName: "customfields.system.firstname";
@@ -124,12 +124,15 @@ declare const NAMED_FIELD_KEYS: {
124
124
  readonly title: "customfields.system.title";
125
125
  readonly birthdate: "customfields.contact.birthdate";
126
126
  readonly company: "customfields.contact.company";
127
- readonly jobTitle: "customfields.contact.position";
127
+ readonly position: "customfields.contact.position";
128
128
  };
129
129
  type NamedFieldName = keyof typeof NAMED_FIELD_KEYS;
130
- type NamedValidationErrors = Record<NamedFieldName, MemberFieldValidationError | null>;
130
+ type NamedValidationErrors = Record<NamedFieldName, MemberFieldValidationError | null> & {
131
+ /** @internal `position`'s, under the name pages saved before it still bind. */jobTitle: MemberFieldValidationError | null;
132
+ };
131
133
  type NamedAccountFields = Record<NamedFieldName, NamedFieldBinding> & {
132
- /** Every named field's fault, grouped so the binding picker lists them under one heading. */validationErrors: NamedValidationErrors;
134
+ /** @internal `position`, under the name pages saved before it still bind. */jobTitle: NamedFieldBinding; /** Every named field's fault, grouped so the binding picker lists them under one heading. */
135
+ validationErrors: NamedValidationErrors;
133
136
  };
134
137
  //#endregion
135
138
  //#region src/extensions/account-settings/login-info/credential-restriction.d.ts
@@ -3288,7 +3288,7 @@ var no = (e11) => {
3288
3288
  }
3289
3289
  return n2;
3290
3290
  };
3291
- var ro = [...`--wst-button-primary-background-color.--wst-button-primary-background-image.--wst-button-primary-padding-top.--wst-button-primary-border-top-color.--wst-button-primary-border-top-width.--wst-button-primary-border-top-style.--wst-button-primary-padding-right.--wst-button-primary-border-right-color.--wst-button-primary-border-right-width.--wst-button-primary-border-right-style.--wst-button-primary-padding-bottom.--wst-button-primary-border-bottom-color.--wst-button-primary-border-bottom-width.--wst-button-primary-border-bottom-style.--wst-button-primary-padding-left.--wst-button-primary-border-left-color.--wst-button-primary-border-left-width.--wst-button-primary-border-left-style.--wst-button-primary-border-top-left-radius.--wst-button-primary-border-top-right-radius.--wst-button-primary-border-bottom-right-radius.--wst-button-primary-border-bottom-left-radius.--wst-button-primary-box-shadow.--wst-button-primary-column-gap.--wst-button-primary-row-gap.--wst-button-primary-letter-spacing.--wst-button-primary-text-decoration.--wst-button-primary-text-transform.--wst-button-primary-text-shadow.--wst-button-secondary-background-color.--wst-button-secondary-background-image.--wst-button-secondary-padding-top.--wst-button-secondary-border-top-color.--wst-button-secondary-border-top-width.--wst-button-secondary-border-top-style.--wst-button-secondary-padding-right.--wst-button-secondary-border-right-color.--wst-button-secondary-border-right-width.--wst-button-secondary-border-right-style.--wst-button-secondary-padding-bottom.--wst-button-secondary-border-bottom-color.--wst-button-secondary-border-bottom-width.--wst-button-secondary-border-bottom-style.--wst-button-secondary-padding-left.--wst-button-secondary-border-left-color.--wst-button-secondary-border-left-width.--wst-button-secondary-border-left-style.--wst-button-secondary-border-top-left-radius.--wst-button-secondary-border-top-right-radius.--wst-button-secondary-border-bottom-right-radius.--wst-button-secondary-border-bottom-left-radius.--wst-button-secondary-box-shadow.--wst-button-secondary-column-gap.--wst-button-secondary-row-gap.--wst-button-secondary-letter-spacing.--wst-button-secondary-text-decoration.--wst-button-secondary-text-transform.--wst-button-secondary-text-shadow`.split(`.`), `--wst-graphics-1-color`, `--wst-system-line-1-color`, `--wst-system-line-1-width`, `--wst-system-disabled-color`, `--wst-primary-background-color`, `--wst-secondary-background-color`, `--wst-shade-2-color`, `--wst-shade-3-color`, `--wst-paragraph-1-color`, `--wst-paragraph-1-font`, `--wst-paragraph-2-color`, `--wst-paragraph-2-font`, `--wst-paragraph-3-color`, `--wst-paragraph-3-font`, `--wst-heading-5-color`, `--wst-heading-5-font`, `--wst-heading-6-color`, `--wst-heading-6-font`, `--wst-button-primary-color`, `--wst-button-primary-font`, `--wst-button-secondary-color`, `--wst-button-secondary-font`, `--wst-button-tertiary-color`, `--wst-button-tertiary-font`, `--wst-links-and-actions-color`, `--wst-system-alert-color`, `--wst-system-error-color`, `--wst-system-success-color`, `--wst-system-default-light-color`, `--wst-system-default-dark-color`];
3291
+ var ro = [...`--wst-button-primary-background-color.--wst-button-primary-background-image.--wst-button-primary-padding-top.--wst-button-primary-border-top-color.--wst-button-primary-border-top-width.--wst-button-primary-border-top-style.--wst-button-primary-padding-right.--wst-button-primary-border-right-color.--wst-button-primary-border-right-width.--wst-button-primary-border-right-style.--wst-button-primary-padding-bottom.--wst-button-primary-border-bottom-color.--wst-button-primary-border-bottom-width.--wst-button-primary-border-bottom-style.--wst-button-primary-padding-left.--wst-button-primary-border-left-color.--wst-button-primary-border-left-width.--wst-button-primary-border-left-style.--wst-button-primary-border-top-left-radius.--wst-button-primary-border-top-right-radius.--wst-button-primary-border-bottom-right-radius.--wst-button-primary-border-bottom-left-radius.--wst-button-primary-box-shadow.--wst-button-primary-column-gap.--wst-button-primary-row-gap.--wst-button-primary-letter-spacing.--wst-button-primary-text-decoration.--wst-button-primary-text-transform.--wst-button-primary-text-shadow.--wst-button-secondary-background-color.--wst-button-secondary-background-image.--wst-button-secondary-padding-top.--wst-button-secondary-border-top-color.--wst-button-secondary-border-top-width.--wst-button-secondary-border-top-style.--wst-button-secondary-padding-right.--wst-button-secondary-border-right-color.--wst-button-secondary-border-right-width.--wst-button-secondary-border-right-style.--wst-button-secondary-padding-bottom.--wst-button-secondary-border-bottom-color.--wst-button-secondary-border-bottom-width.--wst-button-secondary-border-bottom-style.--wst-button-secondary-padding-left.--wst-button-secondary-border-left-color.--wst-button-secondary-border-left-width.--wst-button-secondary-border-left-style.--wst-button-secondary-border-top-left-radius.--wst-button-secondary-border-top-right-radius.--wst-button-secondary-border-bottom-right-radius.--wst-button-secondary-border-bottom-left-radius.--wst-button-secondary-box-shadow.--wst-button-secondary-column-gap.--wst-button-secondary-row-gap.--wst-button-secondary-letter-spacing.--wst-button-secondary-text-decoration.--wst-button-secondary-text-transform.--wst-button-secondary-text-shadow`.split(`.`), `--wst-graphics-1-color`, `--wst-system-line-1-color`, `--wst-system-line-1-width`, `--wst-system-disabled-color`, `--wst-primary-background-color`, `--wst-secondary-background-color`, `--wst-shade-2-color`, `--wst-shade-3-color`, `--wst-paragraph-1-color`, `--wst-paragraph-1-font`, `--wst-paragraph-2-color`, `--wst-paragraph-2-font`, `--wst-paragraph-2-letter-spacing`, `--wst-paragraph-2-text-decoration`, `--wst-paragraph-3-color`, `--wst-paragraph-3-font`, `--wst-paragraph-3-letter-spacing`, `--wst-paragraph-3-text-decoration`, `--wst-heading-2-font`, `--wst-heading-2-letter-spacing`, `--wst-heading-2-text-decoration`, `--wst-heading-5-color`, `--wst-heading-5-font`, `--wst-heading-6-color`, `--wst-heading-6-font`, `--wst-button-primary-color`, `--wst-button-primary-font`, `--wst-button-secondary-color`, `--wst-button-secondary-font`, `--wst-button-tertiary-color`, `--wst-button-tertiary-font`, `--wst-button-tertiary-letter-spacing`, `--wst-button-tertiary-text-decoration`, `--wst-links-and-actions-color`, `--wst-system-alert-color`, `--wst-system-error-color`, `--wst-system-success-color`, `--wst-system-default-light-color`, `--wst-system-default-dark-color`];
3292
3292
  var io = `--builder-base`;
3293
3293
  var ao = (e11) => {
3294
3294
  let [, t2] = l(false);
@@ -9141,13 +9141,17 @@ var Bb = (e11) => {
9141
9141
  };
9142
9142
  var Vb = (e11) => ({ name: e11.label, value: e11.value });
9143
9143
  var Hb = (e11, t2) => t2.validity[e11.id] ?? null;
9144
- var Ub = { firstName: `customfields.system.firstname`, lastName: `customfields.system.lastname`, phone: `customfields.system.phone`, title: `customfields.system.title`, birthdate: `customfields.contact.birthdate`, company: `customfields.contact.company`, jobTitle: `customfields.contact.position` };
9145
- var Wb = new Set(Object.values(Ub));
9146
- var Gb = Object.keys(Ub);
9147
- var Kb = (e11) => Object.fromEntries(Gb.map((t2) => [t2, e11(t2)]));
9148
- var qb = { ...Kb(() => ({ name: void 0, value: `` })), validationErrors: Kb(() => null) };
9149
- var Jb = { name: null, value: `` };
9150
- var Yb = (e11) => {
9144
+ var Ub = { firstName: `customfields.system.firstname`, lastName: `customfields.system.lastname`, phone: `customfields.system.phone`, title: `customfields.system.title`, birthdate: `customfields.contact.birthdate`, company: `customfields.contact.company`, position: `customfields.contact.position` };
9145
+ var Wb = { jobTitle: `position` };
9146
+ var Gb = new Set(Object.values(Ub));
9147
+ var Kb = Object.keys(Ub);
9148
+ var qb = (e11) => {
9149
+ let t2 = Object.fromEntries(Kb.map((t3) => [t3, e11(t3)]));
9150
+ return { ...t2, ...Object.fromEntries(Object.entries(Wb).map(([e12, n2]) => [e12, t2[n2]])) };
9151
+ };
9152
+ var Jb = { ...qb(() => ({ name: void 0, value: `` })), validationErrors: qb(() => null) };
9153
+ var Yb = { name: null, value: `` };
9154
+ var Xb = (e11) => {
9151
9155
  let t2 = /* @__PURE__ */ new Map();
9152
9156
  return e11.forEach((e12) => {
9153
9157
  e12.fields.forEach((e13) => {
@@ -9155,130 +9159,131 @@ var Yb = (e11) => {
9155
9159
  });
9156
9160
  }), t2;
9157
9161
  };
9158
- var Xb = (e11, t2) => {
9159
- let n2 = Yb(e11), r2 = (e12) => n2.get(Ub[e12]);
9160
- return { ...Kb((e12) => {
9162
+ var Zb = (e11, t2) => {
9163
+ let n2 = Xb(e11), r2 = (e12) => n2.get(Ub[e12]);
9164
+ return { ...qb((e12) => {
9161
9165
  let t3 = r2(e12);
9162
- return t3 ? Vb(t3) : Jb;
9163
- }), validationErrors: Kb((e12) => {
9166
+ return t3 ? Vb(t3) : Yb;
9167
+ }), validationErrors: qb((e12) => {
9164
9168
  let n3 = r2(e12);
9165
9169
  return n3 ? Hb(n3, t2) : null;
9166
9170
  }) };
9167
9171
  };
9168
- var Zb = (e11, t2) => {
9169
- if (!Object.hasOwn(Ub, t2)) return null;
9170
- let n2 = Yb(e11).get(Ub[t2]);
9171
- return n2 && !n2.isReadOnly ? n2.id : null;
9172
- };
9173
- var Qb = t_;
9174
- var $b = /^\d{4}-\d{2}-\d{2}$/;
9175
- var ex = (e11) => {
9176
- if (!$b.test(e11)) return false;
9172
+ var Qb = (e11, t2) => {
9173
+ let n2 = Object.hasOwn(Wb, t2) ? Wb[t2] : t2;
9174
+ if (!Object.hasOwn(Ub, n2)) return null;
9175
+ let r2 = Xb(e11).get(Ub[n2]);
9176
+ return r2 && !r2.isReadOnly ? r2.id : null;
9177
+ };
9178
+ var $b = t_;
9179
+ var ex = /^\d{4}-\d{2}-\d{2}$/;
9180
+ var tx = (e11) => {
9181
+ if (!ex.test(e11)) return false;
9177
9182
  let [t2, n2, r2] = e11.split(`-`).map(Number), i2 = new Date(Date.UTC(t2, n2 - 1, r2));
9178
9183
  return i2.getUTCFullYear() === t2 && i2.getUTCMonth() === n2 - 1 && i2.getUTCDate() === r2;
9179
9184
  };
9180
- var tx = (e11) => {
9185
+ var nx = (e11) => {
9181
9186
  try {
9182
9187
  return new URL(e11.includes(`://`) ? e11 : `https://${e11}`).hostname.includes(`.`);
9183
9188
  } catch {
9184
9189
  return false;
9185
9190
  }
9186
9191
  };
9187
- var nx = (e11) => {
9192
+ var rx = (e11) => {
9188
9193
  let t2 = e11.value.trim();
9189
- if (!t2) return e11.isRequired ? Qb.REQUIRED : null;
9190
- if (e11.key === Ub.phone) return Bb(t2) ? null : Qb.PHONE;
9194
+ if (!t2) return e11.isRequired ? $b.REQUIRED : null;
9195
+ if (e11.key === Ub.phone) return Bb(t2) ? null : $b.PHONE;
9191
9196
  switch (e11.kind) {
9192
9197
  case r_.NUMBER:
9193
- return Number.isFinite(Number(t2)) ? null : Qb.NUMBER;
9198
+ return Number.isFinite(Number(t2)) ? null : $b.NUMBER;
9194
9199
  case r_.DATE:
9195
- return ex(t2) ? null : Qb.DATE;
9200
+ return tx(t2) ? null : $b.DATE;
9196
9201
  case r_.URL:
9197
9202
  case r_.SOCIAL:
9198
- return tx(t2) ? null : Qb.URL;
9203
+ return nx(t2) ? null : $b.URL;
9199
9204
  case r_.CHOICE:
9200
- return !e11.options?.length || e11.options.some((e12) => e12.value === t2) ? null : Qb.CHOICE;
9205
+ return !e11.options?.length || e11.options.some((e12) => e12.value === t2) ? null : $b.CHOICE;
9201
9206
  default:
9202
9207
  return null;
9203
9208
  }
9204
9209
  };
9205
- var rx = (e11) => {
9210
+ var ix = (e11) => {
9206
9211
  let t2 = {};
9207
9212
  return e11.forEach((e12) => {
9208
9213
  e12.fields.forEach((e13) => {
9209
9214
  if (e13.isReadOnly) return;
9210
- let n2 = nx(e13);
9215
+ let n2 = rx(e13);
9211
9216
  n2 && (t2[e13.id] = n2);
9212
9217
  });
9213
9218
  }), t2;
9214
9219
  };
9215
- var ix = (e11) => e11.flatMap((e12) => e12.fields.filter((e13) => !e13.isReadOnly && nx(e13) !== null).map((e13) => e13.id));
9216
- var ax = { LOGIN_EMAIL: `LOGIN_EMAIL`, PASSWORD: `PASSWORD` };
9217
- function ox(e11) {
9220
+ var ax = (e11) => e11.flatMap((e12) => e12.fields.filter((e13) => !e13.isReadOnly && rx(e13) !== null).map((e13) => e13.id));
9221
+ var ox = { LOGIN_EMAIL: `LOGIN_EMAIL`, PASSWORD: `PASSWORD` };
9222
+ function sx(e11) {
9218
9223
  return e11;
9219
9224
  }
9220
- var sx = ox(`@wix/site-service-business-logger`);
9221
- function cx() {
9222
- let { reportBi: e11 } = u(sx);
9225
+ var cx = sx(`@wix/site-service-business-logger`);
9226
+ function lx() {
9227
+ let { reportBi: e11 } = u(cx);
9223
9228
  return i(({ src: t2, evid: n2, endpoint: r2, params: i2 }) => e11({ src: t2, evid: n2, ...i2 }, { endpoint: r2 }), [e11]);
9224
9229
  }
9225
- function lx(e11) {
9230
+ function ux(e11) {
9226
9231
  return { evid: 815, src: 69, endpoint: `members-app-uou`, params: e11 };
9227
9232
  }
9228
- function ux(e11) {
9233
+ function dx(e11) {
9229
9234
  return { evid: 5001, src: 5, endpoint: ``, params: e11 };
9230
9235
  }
9231
- function dx(e11) {
9236
+ function fx(e11) {
9232
9237
  return { evid: 5002, src: 5, endpoint: ``, params: e11 };
9233
9238
  }
9234
- function fx(e11) {
9239
+ function px(e11) {
9235
9240
  return { evid: 5003, src: 5, endpoint: ``, params: e11 };
9236
9241
  }
9237
- function px(e11) {
9242
+ function mx(e11) {
9238
9243
  return { evid: 5005, src: 5, endpoint: ``, params: e11 };
9239
9244
  }
9240
- function mx(e11) {
9245
+ function hx(e11) {
9241
9246
  return { evid: 5006, src: 5, endpoint: ``, params: e11 };
9242
9247
  }
9243
- function hx(e11) {
9248
+ function gx(e11) {
9244
9249
  return { evid: 5007, src: 5, endpoint: ``, params: e11 };
9245
9250
  }
9246
- function gx(e11) {
9251
+ function _x(e11) {
9247
9252
  return { evid: 5008, src: 5, endpoint: ``, params: e11 };
9248
9253
  }
9249
- var _x = { EXIT: `exit`, CANCEL: `cancel`, RESET_OR_CREATE_PASSWORD: `reset_or_create_password` };
9250
- var vx = `my_account`;
9251
- var yx = ({ role: e11, isProfilePublic: t2 }) => ({ ...e11 ? { role: e11 } : {}, is_social: t2 });
9252
- var bx = (e11, t2) => e11 ? `${e11}, ${t2}` : t2;
9253
- var xx = (e11) => e11.reduce((e12, t2) => t2.key === Ub.title ? { ...e12, titleChanged: true } : t2.origin === `SYSTEM` ? { ...e12, systemFieldsChanged: bx(e12.systemFieldsChanged, t2.label) } : t2.origin === `CONTACT` ? { ...e12, contactsFieldsChanges: bx(e12.contactsFieldsChanges, t2.label) } : e12, {});
9254
- var Sx = (e11, t2) => lx({ ...yx(e11), saveOrigin: vx, componentType: `builder`, privacyChanged: false, urlChanged: false, ...xx(t2) });
9255
- var Cx = () => ux({});
9254
+ var vx = { EXIT: `exit`, CANCEL: `cancel`, RESET_OR_CREATE_PASSWORD: `reset_or_create_password` };
9255
+ var yx = `my_account`;
9256
+ var bx = ({ role: e11, isProfilePublic: t2 }) => ({ ...e11 ? { role: e11 } : {}, is_social: t2 });
9257
+ var xx = (e11, t2) => e11 ? `${e11}, ${t2}` : t2;
9258
+ var Sx = (e11) => e11.reduce((e12, t2) => t2.key === Ub.title ? { ...e12, titleChanged: true } : t2.origin === `SYSTEM` ? { ...e12, systemFieldsChanged: xx(e12.systemFieldsChanged, t2.label) } : t2.origin === `CONTACT` ? { ...e12, contactsFieldsChanges: xx(e12.contactsFieldsChanges, t2.label) } : e12, {});
9259
+ var Cx = (e11, t2) => ux({ ...bx(e11), saveOrigin: yx, componentType: `builder`, privacyChanged: false, urlChanged: false, ...Sx(t2) });
9256
9260
  var wx = () => dx({});
9257
9261
  var Tx = () => fx({});
9258
- var Ex = () => mx({});
9259
- var Dx = (e11) => hx({ button_click: e11 });
9260
- var Ox = (e11, t2) => px({ is_success: e11, failure_reason: t2 });
9261
- var kx = (e11, t2) => gx({ is_success: e11, failure_reason: t2 });
9262
- var Ax = { NONE: `NONE`, SITE_OWNER: `SITE_OWNER`, SITE_COLLABORATOR: `SITE_COLLABORATOR` };
9263
- var jx = (e11) => e11?.owner === true || e11?.role === `OWNER` ? Ax.SITE_OWNER : e11?.role === `CONTRIBUTOR` ? Ax.SITE_COLLABORATOR : Ax.NONE;
9264
- var Mx = { memberId: ``, rawMember: {}, loginEmail: ``, credentialRestriction: Ax.NONE, definitions: [], fieldSections: [], fieldOrigins: {}, biMember: { role: ``, isProfilePublic: false } };
9265
- var Nx = { [ax.LOGIN_EMAIL]: () => [Cx(), Tx()], [ax.PASSWORD]: () => [wx(), Ex()] };
9266
- var Px = (e11, t2) => ({ ...e11, rawMember: t2, loginEmail: t2.loginEmail || e11.loginEmail, fieldSections: m_({ member: t2, definitions: e11.definitions }), biMember: { ...e11.biMember, isProfilePublic: t2.privacyStatus === `PUBLIC` } });
9267
- var Fx = async (e11, t2) => {
9262
+ var Ex = () => px({});
9263
+ var Dx = () => hx({});
9264
+ var Ox = (e11) => gx({ button_click: e11 });
9265
+ var kx = (e11, t2) => mx({ is_success: e11, failure_reason: t2 });
9266
+ var Ax = (e11, t2) => _x({ is_success: e11, failure_reason: t2 });
9267
+ var jx = { NONE: `NONE`, SITE_OWNER: `SITE_OWNER`, SITE_COLLABORATOR: `SITE_COLLABORATOR` };
9268
+ var Mx = (e11) => e11?.owner === true || e11?.role === `OWNER` ? jx.SITE_OWNER : e11?.role === `CONTRIBUTOR` ? jx.SITE_COLLABORATOR : jx.NONE;
9269
+ var Nx = { memberId: ``, rawMember: {}, loginEmail: ``, credentialRestriction: jx.NONE, definitions: [], fieldSections: [], fieldOrigins: {}, biMember: { role: ``, isProfilePublic: false } };
9270
+ var Px = { [ox.LOGIN_EMAIL]: () => [wx(), Ex()], [ox.PASSWORD]: () => [Tx(), Dx()] };
9271
+ var Fx = (e11, t2) => ({ ...e11, rawMember: t2, loginEmail: t2.loginEmail || e11.loginEmail, fieldSections: m_({ member: t2, definitions: e11.definitions }), biMember: { ...e11.biMember, isProfilePublic: t2.privacyStatus === `PUBLIC` } });
9272
+ var Ix = async (e11, t2) => {
9268
9273
  try {
9269
9274
  let n2 = await t2.getMemberDetails?.(), r2 = (await e11.getCurrentMember().catch((e12) => {
9270
9275
  if (Jg(e12)) return null;
9271
9276
  throw e12;
9272
9277
  }))?.member, i2 = r2?._id;
9273
- if (!r2 || !i2) return { ok: true, data: Mx };
9274
- let [{ fields: a2 }, { results: o2 }] = await Promise.all([e11.listCustomFields(), e11.getMemberCustomFieldApplications(i2)]), s2 = new Set((o2?.[0]?.applications ?? []).filter((e12) => e12.applies).map((e12) => e12.customFieldKey)), c2 = (a2 ?? []).filter((e12) => s2.has(e12.key) && e12.fieldOrigin !== `CUSTOM` && Wb.has(e12.key ?? ``)), l2 = c2.map((e12) => ({ id: e12._id ?? e12.key ?? ``, key: e12.key ?? ``, name: e12.name ?? ``, fieldType: String(e12.fieldType ?? ``), socialType: e12.socialType, section: String(e12.section ?? ``) }));
9275
- return { ok: true, data: { memberId: i2, rawMember: r2, loginEmail: r2.loginEmail ?? ``, credentialRestriction: jx(n2), definitions: l2, fieldSections: m_({ member: r2, definitions: l2 }), fieldOrigins: Object.fromEntries(c2.map((e12) => [e12._id ?? e12.key ?? ``, String(e12.fieldOrigin ?? ``)])), biMember: { role: n2?.role ?? ``, isProfilePublic: r2.privacyStatus === `PUBLIC` } } };
9278
+ if (!r2 || !i2) return { ok: true, data: Nx };
9279
+ let [{ fields: a2 }, { results: o2 }] = await Promise.all([e11.listCustomFields(), e11.getMemberCustomFieldApplications(i2)]), s2 = new Set((o2?.[0]?.applications ?? []).filter((e12) => e12.applies).map((e12) => e12.customFieldKey)), c2 = (a2 ?? []).filter((e12) => s2.has(e12.key) && e12.fieldOrigin !== `CUSTOM` && Gb.has(e12.key ?? ``)), l2 = c2.map((e12) => ({ id: e12._id ?? e12.key ?? ``, key: e12.key ?? ``, name: e12.name ?? ``, fieldType: String(e12.fieldType ?? ``), socialType: e12.socialType, section: String(e12.section ?? ``) }));
9280
+ return { ok: true, data: { memberId: i2, rawMember: r2, loginEmail: r2.loginEmail ?? ``, credentialRestriction: Mx(n2), definitions: l2, fieldSections: m_({ member: r2, definitions: l2 }), fieldOrigins: Object.fromEntries(c2.map((e12) => [e12._id ?? e12.key ?? ``, String(e12.fieldOrigin ?? ``)])), biMember: { role: n2?.role ?? ``, isProfilePublic: r2.privacyStatus === `PUBLIC` } } };
9276
9281
  } catch (e12) {
9277
9282
  return { ok: false, error: kh(e12).message, cause: e12 };
9278
9283
  }
9279
9284
  };
9280
- var Ix = ({ children: e11 }) => {
9281
- let t2 = u(Ba), n2 = cx(), r2 = s(() => $g(t2), [t2]), a2 = dl(), d2 = no(Ah.toasts), f2 = i(() => Fx(r2, t2), [r2, t2]), [p2, h2] = l(null), g2 = c(null), [_2, v2] = l(false), [y2, b2] = l(false), [x2, S2] = l({}), [C2, ee2] = l(0), [w2, T2] = l(i_), [te2, ne2] = l(null), [re2, ie2] = l(null), ae2 = c(f2), oe2 = c(t2), [E2, se2] = l(0), D2 = c(0), ce2 = c(null), le2 = c(0), O2 = c(null), [k2, ue2] = l(false), de2 = c(null), A2 = c(null), j2 = i(() => {
9285
+ var Lx = ({ children: e11 }) => {
9286
+ let t2 = u(Ba), n2 = lx(), r2 = s(() => $g(t2), [t2]), a2 = dl(), d2 = no(Ah.toasts), f2 = i(() => Ix(r2, t2), [r2, t2]), [p2, h2] = l(null), g2 = c(null), [_2, v2] = l(false), [y2, b2] = l(false), [x2, S2] = l({}), [C2, ee2] = l(0), [w2, T2] = l(i_), [te2, ne2] = l(null), [re2, ie2] = l(null), ae2 = c(f2), oe2 = c(t2), [E2, se2] = l(0), D2 = c(0), ce2 = c(null), le2 = c(0), O2 = c(null), [k2, ue2] = l(false), de2 = c(null), A2 = c(null), j2 = i(() => {
9282
9287
  le2.current += 1;
9283
9288
  let e12 = le2.current, t3 = D2.current;
9284
9289
  return b2(true), () => le2.current === e12 && D2.current === t3;
@@ -9325,9 +9330,9 @@ var Ix = ({ children: e11 }) => {
9325
9330
  }, [E2, j2, M2]);
9326
9331
  let fe2 = i((e12, t3) => {
9327
9332
  S2((n3) => ({ ...n3, [e12]: t3 }));
9328
- }, []), P2 = p2 ?? Mx, F2 = !!P2.memberId && P2.credentialRestriction === Ax.NONE, pe2 = i((e12) => {
9329
- F2 && te2 !== e12 && (ne2(e12), Nx[e12]().forEach(n2));
9330
- }, [F2, te2, n2]), me2 = i(() => pe2(ax.LOGIN_EMAIL), [pe2]), he2 = i(() => pe2(ax.PASSWORD), [pe2]), ge2 = i(() => ne2(null), []), I2 = s(() => h_(P2.fieldSections, x2), [P2.fieldSections, x2]), _e2 = s(() => ({ validity: rx(I2) }), [I2]), ve2 = s(() => p2 === null ? qb : Xb(I2, _e2), [p2, I2, _e2]), ye2 = __(I2).length > 0 || k2;
9333
+ }, []), P2 = p2 ?? Nx, F2 = !!P2.memberId && P2.credentialRestriction === jx.NONE, pe2 = i((e12) => {
9334
+ F2 && te2 !== e12 && (ne2(e12), Px[e12]().forEach(n2));
9335
+ }, [F2, te2, n2]), me2 = i(() => pe2(ox.LOGIN_EMAIL), [pe2]), he2 = i(() => pe2(ox.PASSWORD), [pe2]), ge2 = i(() => ne2(null), []), I2 = s(() => h_(P2.fieldSections, x2), [P2.fieldSections, x2]), _e2 = s(() => ({ validity: ix(I2) }), [I2]), ve2 = s(() => p2 === null ? Jb : Zb(I2, _e2), [p2, I2, _e2]), ye2 = __(I2).length > 0 || k2;
9331
9336
  o(() => {
9332
9337
  if (!ye2) return;
9333
9338
  let e12 = (e13) => {
@@ -9340,14 +9345,14 @@ var Ix = ({ children: e11 }) => {
9340
9345
  let be2 = i(async () => {
9341
9346
  let e12 = D2.current;
9342
9347
  if (!P2.memberId) return false;
9343
- if (ix(I2).length) return ee2((e13) => e13 + 1), false;
9348
+ if (ax(I2).length) return ee2((e13) => e13 + 1), false;
9344
9349
  let t3 = __(I2);
9345
9350
  if (O2.current === e12) return !t3.length && de2.current ? de2.current : new Promise((t4) => {
9346
9351
  let n3 = A2.current ?? { session: e12, drafts: x2, resolvers: [] };
9347
9352
  n3.drafts = x2, n3.resolvers.push(t4), A2.current = n3;
9348
9353
  });
9349
9354
  if (!t3.length) return a2.success(d2.personalInfoSaved), true;
9350
- n2(Sx(P2.biMember, t3.map((e13) => ({ key: e13.key, label: e13.label, origin: P2.fieldOrigins[e13.id] ?? `` }))));
9355
+ n2(Cx(P2.biMember, t3.map((e13) => ({ key: e13.key, label: e13.label, origin: P2.fieldOrigins[e13.id] ?? `` }))));
9351
9356
  let i2 = N2(), o2 = () => {
9352
9357
  O2.current === e12 && (O2.current = null, ue2(false));
9353
9358
  }, s2 = g2.current ?? P2, c2 = x2, { member: l2, cleared: u2 } = v_(P2.rawMember, I2);
@@ -9361,7 +9366,7 @@ var Ix = ({ children: e11 }) => {
9361
9366
  }
9362
9367
  if (!i2()) return false;
9363
9368
  let t4 = false, n3 = g2.current ?? P2;
9364
- return M2({ ok: true, data: Px(n3, { ...e13, loginEmail: n3.loginEmail }) }, { isCurrent: j2(), always: o2, onCommitted: () => {
9369
+ return M2({ ok: true, data: Fx(n3, { ...e13, loginEmail: n3.loginEmail }) }, { isCurrent: j2(), always: o2, onCommitted: () => {
9365
9370
  t4 = true, a2.success(d2.personalInfoSaved);
9366
9371
  } }), t4;
9367
9372
  } catch (e13) {
@@ -9392,15 +9397,15 @@ var Ix = ({ children: e11 }) => {
9392
9397
  if (await r2.verifyPassword(P2.loginEmail, t3), !i2()) return false;
9393
9398
  let { member: o2 } = await r2.changeLoginEmail(P2.memberId, e12);
9394
9399
  if (!i2()) return false;
9395
- n2(Ox(true));
9400
+ n2(kx(true));
9396
9401
  let s2 = g2.current ?? P2, c2 = false;
9397
- return M2({ ok: true, data: { ...Px(s2, { ...s2.rawMember, loginEmail: o2?.loginEmail || e12 }), fieldSections: s2.fieldSections } }, { isCurrent: j2(), always: () => T2((e13) => ({ ...e13, isSaving: false })), onCommitted: () => {
9402
+ return M2({ ok: true, data: { ...Fx(s2, { ...s2.rawMember, loginEmail: o2?.loginEmail || e12 }), fieldSections: s2.fieldSections } }, { isCurrent: j2(), always: () => T2((e13) => ({ ...e13, isSaving: false })), onCommitted: () => {
9398
9403
  T2(i_), c2 = true, a2.success(d2.loginEmailChanged);
9399
9404
  } }), c2;
9400
9405
  } catch (e13) {
9401
9406
  if (!i2()) return false;
9402
9407
  let t4 = qg(e13);
9403
- return n2(Ox(false, t4)), T2({ isSaving: false, error: t4 }), t4 === Q.UNKNOWN && a2.error(kh(e13).message), false;
9408
+ return n2(kx(false, t4)), T2({ isSaving: false, error: t4 }), t4 === Q.UNKNOWN && a2.error(kh(e13).message), false;
9404
9409
  }
9405
9410
  }, [F2, P2, N2, j2, n2, r2, M2, d2.loginEmailChanged, a2]), Se2 = i(async (e12, t3) => {
9406
9411
  if (!F2) return false;
@@ -9413,15 +9418,15 @@ var Ix = ({ children: e11 }) => {
9413
9418
  } finally {
9414
9419
  ce2.current = null;
9415
9420
  }
9416
- return !i2() || (await r2.changePassword(t3), !i2()) ? false : (n2(kx(true)), T2(i_), a2.success(d2.passwordChanged), true);
9421
+ return !i2() || (await r2.changePassword(t3), !i2()) ? false : (n2(Ax(true)), T2(i_), a2.success(d2.passwordChanged), true);
9417
9422
  } catch (e13) {
9418
9423
  if (!i2()) return false;
9419
9424
  let t4 = qg(e13);
9420
- return n2(kx(false, t4)), T2({ isSaving: false, error: t4 }), e13 instanceof Qg ? a2.error(d2.passwordSignInUnconfirmed) : t4 === Q.UNKNOWN && a2.error(kh(e13).message), false;
9425
+ return n2(Ax(false, t4)), T2({ isSaving: false, error: t4 }), e13 instanceof Qg ? a2.error(d2.passwordSignInUnconfirmed) : t4 === Q.UNKNOWN && a2.error(kh(e13).message), false;
9421
9426
  }
9422
9427
  }, [F2, P2, N2, n2, r2, d2.passwordChanged, d2.passwordSignInUnconfirmed, a2]), Ce2 = i(async () => {
9423
9428
  if (!F2) return false;
9424
- n2(Dx(_x.RESET_OR_CREATE_PASSWORD));
9429
+ n2(Ox(vx.RESET_OR_CREATE_PASSWORD));
9425
9430
  let e12 = N2();
9426
9431
  T2({ isSaving: true, error: null });
9427
9432
  try {
@@ -9434,29 +9439,29 @@ var Ix = ({ children: e11 }) => {
9434
9439
  }, [F2, P2, N2, n2, r2, d2.setPasswordEmailSent, a2]), we2 = s(() => {
9435
9440
  let e12 = !!P2.memberId, t3 = (t4) => p2 === null ? void 0 : e12 ? t4 : null;
9436
9441
  return { isLoading: !_2 || y2, ...ve2, focusRequest: C2, updateNamedField: (e13, t4) => {
9437
- let n3 = Zb(I2, e13);
9442
+ let n3 = Qb(I2, e13);
9438
9443
  n3 && fe2(n3, String(t4.target.value ?? ``));
9439
9444
  }, loginEmail: t3(P2.loginEmail || null), credentialRestriction: t3(P2.credentialRestriction), credentialSaving: w2.isSaving, credentialError: w2.error, credentialDialog: te2, openChangeLoginEmailDialog: me2, openChangePasswordDialog: he2, closeCredentialDialog: ge2, savePersonalInfo: be2, changeLoginEmail: xe2, changePassword: Se2, sendSetPasswordEmail: Ce2 };
9440
9445
  }, [p2, _2, P2, I2, ve2, C2, fe2, y2, w2, te2, me2, he2, ge2, be2, xe2, Se2, Ce2]);
9441
9446
  if (re2) throw re2.cause;
9442
9447
  return m(a_.Provider, { value: we2, children: [e11, a2.themeAnchor] });
9443
9448
  };
9444
- Ix.displayName = `AccountSettingsProviderBody`;
9445
- var Lx = ({ children: e11 }) => {
9449
+ Lx.displayName = `AccountSettingsProviderBody`;
9450
+ var Rx = ({ children: e11 }) => {
9446
9451
  let t2 = Qa($a);
9447
- return p(Ra, { i18n: t2, children: p(Ix, { children: e11 }) });
9452
+ return p(Ra, { i18n: t2, children: p(Lx, { children: e11 }) });
9448
9453
  };
9449
- var Rx = On(`f8f3ae80-3fdf-4c8f-a197-d3bb73f04444`);
9454
+ var zx = On(`f8f3ae80-3fdf-4c8f-a197-d3bb73f04444`);
9450
9455
  export {
9451
- Lx as AccountDetailsContextProvider,
9456
+ Rx as AccountDetailsContextProvider,
9452
9457
  a_ as AccountSettingsContext,
9453
- ax as CREDENTIAL_DIALOG,
9458
+ ox as CREDENTIAL_DIALOG,
9454
9459
  Q as CREDENTIAL_ERROR,
9455
9460
  r_ as FIELD_KIND,
9456
9461
  Ub as NAMED_FIELD_KEYS,
9457
9462
  n_ as SECTION_KIND,
9458
- Lx as default,
9459
- Rx as injectAccessTokenGetter,
9463
+ Rx as default,
9464
+ zx as injectAccessTokenGetter,
9460
9465
  o_ as useAccountSettings
9461
9466
  };
9462
9467
  //# sourceMappingURL=context-account-details.mjs.map