@pontive/pontkit-core 1.7.6 → 1.7.7

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/index.mjs CHANGED
@@ -17322,14 +17322,14 @@ var Ye, M1 = (Ye = class {
17322
17322
  clear() {
17323
17323
  this.data.clear();
17324
17324
  }
17325
- }, R(Ye, "instance"), Ye), ct = M1.Instance, Ze, Vo = (Ze = class {
17325
+ }, R(Ye, "instance"), Ye), at = M1.Instance, Ze, Vo = (Ze = class {
17326
17326
  constructor() {
17327
17327
  }
17328
17328
  static get Instance() {
17329
17329
  return Ze.instance || (Ze.instance = new Ze()), Ze.instance;
17330
17330
  }
17331
17331
  async request(e, n = {}) {
17332
- const o = ct.getConfig(), r = `${ct.getApiBaseUrl()}${e}`, i = 5e4, s = new AbortController(), c = setTimeout(() => s.abort(), i);
17332
+ const o = at.getConfig(), r = `${at.getApiBaseUrl()}${e}`, i = 5e4, s = new AbortController(), c = setTimeout(() => s.abort(), i);
17333
17333
  try {
17334
17334
  const d = await fetch(r, {
17335
17335
  ...n,
@@ -17376,7 +17376,7 @@ var Ye, M1 = (Ye = class {
17376
17376
  * as get() does.
17377
17377
  */
17378
17378
  async getOptional(e) {
17379
- const n = ct.getConfig(), o = await fetch(`${ct.getApiBaseUrl()}${e}`, {
17379
+ const n = at.getConfig(), o = await fetch(`${at.getApiBaseUrl()}${e}`, {
17380
17380
  credentials: "include",
17381
17381
  method: "GET",
17382
17382
  headers: { ...n.headers }
@@ -17438,12 +17438,12 @@ function U1() {
17438
17438
  }
17439
17439
  }
17440
17440
  function j1(t) {
17441
- return t !== "" || ct.apiIsSameOrigin();
17441
+ return t !== "" || at.apiIsSameOrigin();
17442
17442
  }
17443
17443
  function q1() {
17444
17444
  let t;
17445
17445
  try {
17446
- t = new URL(ct.getApiBaseUrl()).hostname;
17446
+ t = new URL(at.getApiBaseUrl()).hostname;
17447
17447
  } catch {
17448
17448
  return "";
17449
17449
  }
@@ -17545,7 +17545,7 @@ var Ht, Zt = (Ht = class {
17545
17545
  }
17546
17546
  /** Channel and lock names are per app, so unrelated apps on one origin do not queue behind each other. */
17547
17547
  channelKey(e) {
17548
- const n = ct.getConfig();
17548
+ const n = at.getConfig();
17549
17549
  return `pontive-${e}:${(n == null ? void 0 : n.domain) ?? ""}:${(n == null ? void 0 : n.appId) ?? ""}`;
17550
17550
  }
17551
17551
  ensureChannel() {
@@ -17790,7 +17790,7 @@ var Ht, Zt = (Ht = class {
17790
17790
  const o = {
17791
17791
  ...n,
17792
17792
  grant_type: "refresh_token",
17793
- client_id: (i = ct.getConfig()) == null ? void 0 : i.appId
17793
+ client_id: (i = at.getConfig()) == null ? void 0 : i.appId
17794
17794
  };
17795
17795
  e != null && e.refresh_token && (o.refresh_token = e.refresh_token);
17796
17796
  const r = await Vo.Instance.postForm("/oauth2/token", o);
@@ -17826,7 +17826,7 @@ var Ht, Zt = (Ht = class {
17826
17826
  */
17827
17827
  async readCurrentToken() {
17828
17828
  var n;
17829
- const e = (n = ct.getConfig()) == null ? void 0 : n.appId;
17829
+ const e = (n = at.getConfig()) == null ? void 0 : n.appId;
17830
17830
  if (!e)
17831
17831
  return null;
17832
17832
  try {
@@ -18083,7 +18083,7 @@ R(Br, "INVITE_TOKEN_PARAM", "invite_token"), Br), Tu = class {
18083
18083
  R(this, "linkWatchGeneration", 0);
18084
18084
  /** The flow's last answer said it waits on an emailed link. */
18085
18085
  R(this, "waitingForLink", !1);
18086
- const s = ct.getConfig();
18086
+ const s = at.getConfig();
18087
18087
  if (!s.domain)
18088
18088
  throw new st("CONFIG_ERROR", "Domain is required");
18089
18089
  if (!s.appId)
@@ -18212,7 +18212,7 @@ R(Br, "INVITE_TOKEN_PARAM", "invite_token"), Br), Tu = class {
18212
18212
  expires_at: Date.now() + e.expires_in * 1e3
18213
18213
  };
18214
18214
  Zt.Instance.setCurrentSession(n), Zt.Instance.scheduleTokenRefresh(), this.flowStateManager.clearFlowState();
18215
- const { onAuthenticated: o } = ct.getConfig();
18215
+ const { onAuthenticated: o } = at.getConfig();
18216
18216
  if (o) {
18217
18217
  o(n);
18218
18218
  return;
@@ -18226,7 +18226,7 @@ R(Br, "INVITE_TOKEN_PARAM", "invite_token"), Br), Tu = class {
18226
18226
  * Initialize or resume the flow.
18227
18227
  */
18228
18228
  async initializeFlowInternal() {
18229
- const e = ct.getConfig(), n = ms.detect(e, this.location);
18229
+ const e = at.getConfig(), n = ms.detect(e, this.location);
18230
18230
  this.validateFlowType(n);
18231
18231
  const o = this.flowStateManager.getFlowState();
18232
18232
  return this.shouldResumeFlow(o, n) ? await this.resumeExistingFlow(o, n) : await this.startNewFlow(n);
@@ -18294,7 +18294,7 @@ R(Br, "INVITE_TOKEN_PARAM", "invite_token"), Br), Tu = class {
18294
18294
  * Start a new flow.
18295
18295
  */
18296
18296
  async startNewFlow(e) {
18297
- const n = ct.getConfig(), o = new URLSearchParams(this.location.search), r = {};
18297
+ const n = at.getConfig(), o = new URLSearchParams(this.location.search), r = {};
18298
18298
  o.forEach((d, g) => {
18299
18299
  r[g] = d;
18300
18300
  }), n.organizationId && !r.organization_id && (r.organization_id = n.organizationId), console.log("metadata", r);
@@ -18305,7 +18305,8 @@ R(Br, "INVITE_TOKEN_PARAM", "invite_token"), Br), Tu = class {
18305
18305
  signup_url: n.signupUrl,
18306
18306
  locales: i,
18307
18307
  flow_id: this.determineFlowId(e),
18308
- metadata: r
18308
+ metadata: r,
18309
+ auth_base_url: at.getApiBaseUrl()
18309
18310
  }, c = await this.startFlow(e, s);
18310
18311
  if (this.watchForLink(e, c), !c.auth_result) {
18311
18312
  this.flowStateManager.saveFlowState(
@@ -18393,7 +18394,7 @@ R(Br, "INVITE_TOKEN_PARAM", "invite_token"), Br), Tu = class {
18393
18394
  /** Another tab continued this flow; this one has nothing left to show but that. */
18394
18395
  announceContinuedElsewhere(e, n) {
18395
18396
  var o, r;
18396
- this.stopWatchingForLink(), this.flowStateManager.clearFlowState(), (r = (o = ct.getConfig()).onFlowStateChange) == null || r.call(o, {
18397
+ this.stopWatchingForLink(), this.flowStateManager.clearFlowState(), (r = (o = at.getConfig()).onFlowStateChange) == null || r.call(o, {
18397
18398
  eventType: "flow_continued_elsewhere",
18398
18399
  flowType: e,
18399
18400
  state: n
@@ -18415,7 +18416,7 @@ R(Br, "INVITE_TOKEN_PARAM", "invite_token"), Br), Tu = class {
18415
18416
  * without the resume that brought it here.
18416
18417
  */
18417
18418
  async handleContinueHere() {
18418
- const { continueHereUrl: e } = ct.getConfig();
18419
+ const { continueHereUrl: e } = at.getConfig();
18419
18420
  this.flowStateManager.clearFlowState();
18420
18421
  let n = e;
18421
18422
  if (!n) {
@@ -18428,14 +18429,14 @@ R(Br, "INVITE_TOKEN_PARAM", "invite_token"), Br), Tu = class {
18428
18429
  * Handle switch to signin event.
18429
18430
  */
18430
18431
  async handleSwitchToSignin() {
18431
- const e = ct.getConfig();
18432
+ const e = at.getConfig();
18432
18433
  return this.redirect({ url: this.withCurrentQuery(e.signinUrl), redirect_delay: 0 }), { state: "End" };
18433
18434
  }
18434
18435
  /**
18435
18436
  * Handle switch to signup event.
18436
18437
  */
18437
18438
  async handleSwitchToSignup() {
18438
- const e = ct.getConfig();
18439
+ const e = at.getConfig();
18439
18440
  return this.redirect({ url: this.withCurrentQuery(e.signupUrl), redirect_delay: 0 }), { state: "End" };
18440
18441
  }
18441
18442
  /**
@@ -18570,7 +18571,7 @@ R(Br, "INVITE_TOKEN_PARAM", "invite_token"), Br), Tu = class {
18570
18571
  }
18571
18572
  console.log("[NavigationManager] Starting popstate processing"), this.isProcessing = !0, this.isHandlingNavigationEvent = !0;
18572
18573
  try {
18573
- const e = t.state, n = this.flowStateManager.getFlowState(), o = ct.getConfig(), r = ms.detect(o, this.location);
18574
+ const e = t.state, n = this.flowStateManager.getFlowState(), o = at.getConfig(), r = ms.detect(o, this.location);
18574
18575
  if (e && this.restoreHistoryStateToSession(e), this.shouldRestartFlow(e, n, r)) {
18575
18576
  await this.triggerFlowRestart();
18576
18577
  return;
@@ -18592,7 +18593,7 @@ R(Br, "INVITE_TOKEN_PARAM", "invite_token"), Br), Tu = class {
18592
18593
  }
18593
18594
  console.log("[NavigationManager] Starting bfcache restoration processing"), this.isProcessing = !0, this.isHandlingNavigationEvent = !0;
18594
18595
  try {
18595
- const t = this.historyAdapter.state, e = this.flowStateManager.getFlowState(), n = ct.getConfig(), o = ms.detect(n, this.location);
18596
+ const t = this.historyAdapter.state, e = this.flowStateManager.getFlowState(), n = at.getConfig(), o = ms.detect(n, this.location);
18596
18597
  if (t && this.restoreHistoryStateToSession(t), this.shouldRestartFlow(t, e, o)) {
18597
18598
  await this.triggerFlowRestart();
18598
18599
  return;
@@ -19104,7 +19105,7 @@ var Je, X1 = (Je = class {
19104
19105
  },
19105
19106
  n
19106
19107
  );
19107
- const o = await K1.init(e, this.flowEventBus), r = ct.getConfig();
19108
+ const o = await K1.init(e, this.flowEventBus), r = at.getConfig();
19108
19109
  this.startPasskeyAuthentication(o.flowType, !0), this.loginflow = o.sdk;
19109
19110
  const i = {
19110
19111
  flowType: o.flowType,
@@ -19128,7 +19129,7 @@ var Je, X1 = (Je = class {
19128
19129
  "CONFIG_ERROR",
19129
19130
  "domain and appId are required"
19130
19131
  );
19131
- ct.setConfig(e), this.configured = !0, this.configuredResolve();
19132
+ at.setConfig(e), this.configured = !0, this.configuredResolve();
19132
19133
  }
19133
19134
  /**
19134
19135
  * Resolves once configure() has been called, immediately if it already has.
@@ -19190,7 +19191,7 @@ var Je, X1 = (Je = class {
19190
19191
  async processLoginflowEvent(e) {
19191
19192
  var i, s;
19192
19193
  this.ensureConfigured(), this.ensureLoginflowInitialized();
19193
- const n = ct.getConfig(), o = ms.detect(n, location);
19194
+ const n = at.getConfig(), o = ms.detect(n, location);
19194
19195
  if (e.event === "signin_with_passkey" && !((i = e.data) != null && i.credential_request)) {
19195
19196
  const c = await this.getPasskeyCredential(o, !1);
19196
19197
  if (!c || !c.cred)
@@ -19360,8 +19361,8 @@ var Je, X1 = (Je = class {
19360
19361
  async signOut(e) {
19361
19362
  var r;
19362
19363
  this.ensureConfigured();
19363
- const n = t0(Zt.Instance.peekSession()), o = ((r = ct.getConfig()) == null ? void 0 : r.appId) ?? "";
19364
- if (vl(), Zt.Instance.clearSession(), Zt.Instance.cleanup(), this.loginflow && (this.loginflow.cleanup(), this.loginflow = null), this.navigationManager && (this.navigationManager.destroy(), this.navigationManager = null), this.flowEventBus && (this.flowEventBus.clear(), this.flowEventBus = null), !ct.apiIsSameOrigin()) {
19364
+ const n = t0(Zt.Instance.peekSession()), o = ((r = at.getConfig()) == null ? void 0 : r.appId) ?? "";
19365
+ if (vl(), Zt.Instance.clearSession(), Zt.Instance.cleanup(), this.loginflow && (this.loginflow.cleanup(), this.loginflow = null), this.navigationManager && (this.navigationManager.destroy(), this.navigationManager = null), this.flowEventBus && (this.flowEventBus.clear(), this.flowEventBus = null), !at.apiIsSameOrigin()) {
19365
19366
  window.location.assign(this.logoutUrl(n, o, e == null ? void 0 : e.returnTo));
19366
19367
  return;
19367
19368
  }
@@ -19377,7 +19378,7 @@ var Je, X1 = (Je = class {
19377
19378
  */
19378
19379
  async endServerSession(e, n) {
19379
19380
  try {
19380
- await fetch(`${ct.getApiBaseUrl()}/oauth2/logout`, {
19381
+ await fetch(`${at.getApiBaseUrl()}/oauth2/logout`, {
19381
19382
  method: "POST",
19382
19383
  credentials: "include",
19383
19384
  headers: { "Content-Type": "application/x-www-form-urlencoded" },
@@ -19404,7 +19405,7 @@ var Je, X1 = (Je = class {
19404
19405
  post_logout_redirect_uri: o ?? `${window.location.origin}${window.location.pathname}`,
19405
19406
  client_id: n
19406
19407
  });
19407
- return e && r.set("logout_hint", e), `${ct.getApiBaseUrl()}/oauth2/logout?${r.toString()}`;
19408
+ return e && r.set("logout_hint", e), `${at.getApiBaseUrl()}/oauth2/logout?${r.toString()}`;
19408
19409
  }
19409
19410
  }, R(Je, "instance"), Je);
19410
19411
  function t0(t) {
@@ -19415,7 +19416,7 @@ function t0(t) {
19415
19416
  return n.sid;
19416
19417
  }
19417
19418
  }
19418
- var lt = X1.Instance, e0 = Object.defineProperty, r0 = (t, e, n, o) => {
19419
+ var ct = X1.Instance, e0 = Object.defineProperty, r0 = (t, e, n, o) => {
19419
19420
  for (var r = void 0, i = t.length - 1, s; i >= 0; i--)
19420
19421
  (s = t[i]) && (r = s(e, n, r) || r);
19421
19422
  return r && e0(e, n, r), r;
@@ -19631,7 +19632,7 @@ function h0(t) {
19631
19632
  }
19632
19633
  function Ne() {
19633
19634
  var t;
19634
- return (t = lt.getCurrentSession()) == null ? void 0 : t.access_token;
19635
+ return (t = ct.getCurrentSession()) == null ? void 0 : t.access_token;
19635
19636
  }
19636
19637
  function _l(t, e = !1) {
19637
19638
  if (!t && t !== 0) return "N/A";
@@ -19728,7 +19729,7 @@ let J = class extends f {
19728
19729
  );
19729
19730
  try {
19730
19731
  if (this.event) {
19731
- const t = await lt.processLoginflowEvent({
19732
+ const t = await ct.processLoginflowEvent({
19732
19733
  event: this.event
19733
19734
  });
19734
19735
  this.dispatchEvent(
@@ -19900,7 +19901,7 @@ let Z = class extends f {
19900
19901
  );
19901
19902
  try {
19902
19903
  if (this.event) {
19903
- const t = await lt.processLoginflowEvent({
19904
+ const t = await ct.processLoginflowEvent({
19904
19905
  event: this.event
19905
19906
  });
19906
19907
  this.dispatchEvent(
@@ -20240,7 +20241,7 @@ let $ = class extends f {
20240
20241
  );
20241
20242
  try {
20242
20243
  if (n) {
20243
- const o = await lt.processLoginflowEvent({
20244
+ const o = await ct.processLoginflowEvent({
20244
20245
  event: n
20245
20246
  });
20246
20247
  this.dispatchEvent(
@@ -22571,7 +22572,7 @@ let Y = class extends f {
22571
22572
  );
22572
22573
  try {
22573
22574
  if (o && n === "auth") {
22574
- const r = await lt.processLoginflowEvent({
22575
+ const r = await ct.processLoginflowEvent({
22575
22576
  event: o
22576
22577
  });
22577
22578
  this.dispatchEvent(
@@ -22953,7 +22954,7 @@ var Z0 = Object.defineProperty, J0 = Object.getOwnPropertyDescriptor, Ci = (t, e
22953
22954
  let Ft = class extends f {
22954
22955
  constructor() {
22955
22956
  super(...arguments), this.seed = Bt(), this.identifier = B0.identifier, this.event = "", this._handleClick = () => {
22956
- lt.processLoginflowEvent({ event: this.event });
22957
+ ct.processLoginflowEvent({ event: this.event });
22957
22958
  };
22958
22959
  }
22959
22960
  /* ---------------------------------------- */
@@ -28393,7 +28394,7 @@ class se extends f {
28393
28394
  }
28394
28395
  async loadUser() {
28395
28396
  var e, n;
28396
- if (!(!((e = this.auth) != null && e.resolved) || !this.auth.isAuthenticated) && !(this._userLoaded || this._userLoading) && (this.userContextValue.identifier = ((n = lt.getAuthenticatedUser()) == null ? void 0 : n.email) ?? "", !!this.userContextValue.identifier)) {
28397
+ if (!(!((e = this.auth) != null && e.resolved) || !this.auth.isAuthenticated) && !(this._userLoaded || this._userLoading) && (this.userContextValue.identifier = ((n = ct.getAuthenticatedUser()) == null ? void 0 : n.email) ?? "", !!this.userContextValue.identifier)) {
28397
28398
  this._userLoading = !0;
28398
28399
  try {
28399
28400
  this.userContextValue.user = await CC(), this.tryRemoveFallback(), this.fillProfileData(this.userContextValue.user), this._userLoaded = !0;
@@ -28768,7 +28769,7 @@ let de = class extends f {
28768
28769
  const e = {
28769
28770
  emails: this.emails,
28770
28771
  roles: this.roles,
28771
- invited_by: (n = lt.getAuthenticatedUser()) == null ? void 0 : n.sub,
28772
+ invited_by: (n = ct.getAuthenticatedUser()) == null ? void 0 : n.sub,
28772
28773
  // invited_by: "usr_06fgveyxgdtff295nb0se579cc",
28773
28774
  message: this.customMessage || void 0
28774
28775
  };
@@ -31201,7 +31202,7 @@ class jn extends f {
31201
31202
  }
31202
31203
  async startAuthFlow() {
31203
31204
  if (!this.__flowStarted) {
31204
- this.__flowStarted = !0, this.startError = void 0, await d0(lt);
31205
+ this.__flowStarted = !0, this.startError = void 0, await d0(ct);
31205
31206
  try {
31206
31207
  await this.startFlow();
31207
31208
  } catch (e) {
@@ -31247,7 +31248,7 @@ var xE = Object.getOwnPropertyDescriptor, OE = (t, e, n, o) => {
31247
31248
  };
31248
31249
  let lh = class extends jn {
31249
31250
  startFlow() {
31250
- return lt.startLoginflow();
31251
+ return ct.startLoginflow();
31251
31252
  }
31252
31253
  };
31253
31254
  lh = OE([
@@ -31260,7 +31261,7 @@ var PE = Object.getOwnPropertyDescriptor, RE = (t, e, n, o) => {
31260
31261
  };
31261
31262
  let ch = class extends jn {
31262
31263
  startFlow() {
31263
- return lt.startLoginflow("sys_signin-flow-passkey");
31264
+ return ct.startLoginflow("sys_signin-flow-passkey");
31264
31265
  }
31265
31266
  };
31266
31267
  ch = RE([
@@ -31273,7 +31274,7 @@ var IE = Object.getOwnPropertyDescriptor, TE = (t, e, n, o) => {
31273
31274
  };
31274
31275
  let dh = class extends jn {
31275
31276
  startFlow() {
31276
- return lt.startLoginflow("sys_signup-flow");
31277
+ return ct.startLoginflow("sys_signup-flow");
31277
31278
  }
31278
31279
  };
31279
31280
  dh = TE([
@@ -31347,7 +31348,7 @@ class kr extends f {
31347
31348
  }, this._handleLogout = () => {
31348
31349
  this.dispatchEvent(
31349
31350
  new CustomEvent("logout", { bubbles: !0, composed: !0 })
31350
- ), lt.signOut();
31351
+ ), ct.signOut();
31351
31352
  };
31352
31353
  }
31353
31354
  createRenderRoot() {
@@ -31383,7 +31384,7 @@ class kr extends f {
31383
31384
  try {
31384
31385
  const n = this.auth.isAuthenticated;
31385
31386
  if (this.signedIn = n, n) {
31386
- const o = lt.getAuthenticatedUser();
31387
+ const o = ct.getAuthenticatedUser();
31387
31388
  this.user = {
31388
31389
  email: o == null ? void 0 : o.email,
31389
31390
  name: (o == null ? void 0 : o.name) || `${(o == null ? void 0 : o.given_name) || ""} ${(o == null ? void 0 : o.family_name) || ""}`.trim(),
@@ -31634,7 +31635,7 @@ class ze extends f {
31634
31635
  }
31635
31636
  readCurrent() {
31636
31637
  var e;
31637
- this.currentId = ((e = lt.getOrganization()) == null ? void 0 : e.id) ?? null;
31638
+ this.currentId = ((e = ct.getOrganization()) == null ? void 0 : e.id) ?? null;
31638
31639
  }
31639
31640
  async load() {
31640
31641
  var e;
@@ -31656,8 +31657,8 @@ class ze extends f {
31656
31657
  if (!(e === this.currentId || this.switching)) {
31657
31658
  this.switching = e, this.error = null;
31658
31659
  try {
31659
- await lt.switchOrganization(e), this.readCurrent();
31660
- const r = lt.getOrganization(), i = {
31660
+ await ct.switchOrganization(e), this.readCurrent();
31661
+ const r = ct.getOrganization(), i = {
31661
31662
  organizationId: e,
31662
31663
  roles: (r == null ? void 0 : r.roles) ?? [],
31663
31664
  permissions: (r == null ? void 0 : r.permissions) ?? []
@@ -31792,7 +31793,7 @@ let mt = class extends _e {
31792
31793
  const e = {};
31793
31794
  e[this.dataKey] = t;
31794
31795
  try {
31795
- await lt.processLoginflowEvent({
31796
+ await ct.processLoginflowEvent({
31796
31797
  event: this.event,
31797
31798
  data: e
31798
31799
  });
@@ -31825,7 +31826,7 @@ let mt = class extends _e {
31825
31826
  }, this.handleResend = async () => {
31826
31827
  if (this.resendEvent)
31827
31828
  try {
31828
- await lt.processLoginflowEvent({
31829
+ await ct.processLoginflowEvent({
31829
31830
  event: this.resendEvent
31830
31831
  });
31831
31832
  } finally {
@@ -32024,7 +32025,7 @@ var qE = Object.defineProperty, BE = Object.getOwnPropertyDescriptor, on = (t, e
32024
32025
  let dt = class extends f {
32025
32026
  constructor() {
32026
32027
  super(...arguments), this.seed = Bt(), this.duration = ki.duration, this.resend_event = ki.resend_event, this.resend_button_label = ki.resend_button_label, this.count_down_text = ki.count_down_text, this._remaining = 0, this._handleResendClick = () => {
32027
- lt.processLoginflowEvent({ event: this.resend_event }), this._startCountdown();
32028
+ ct.processLoginflowEvent({ event: this.resend_event }), this._startCountdown();
32028
32029
  };
32029
32030
  }
32030
32031
  /* ------------------------------------------------------------ */
@@ -32140,7 +32141,7 @@ var VE = Object.defineProperty, HE = Object.getOwnPropertyDescriptor, Si = (t, e
32140
32141
  (s = t[i]) && (r = (o ? s(e, n, r) : s(r)) || r);
32141
32142
  return o && r && VE(e, n, r), r;
32142
32143
  };
32143
- let at = class extends f {
32144
+ let lt = class extends f {
32144
32145
  constructor() {
32145
32146
  super(...arguments), this.seed = Bt(), this._loading = !1, this._handleSubmitClick = (t) => {
32146
32147
  var e;
@@ -32159,7 +32160,7 @@ let at = class extends f {
32159
32160
  return;
32160
32161
  }
32161
32162
  if (!i) return;
32162
- const s = new CustomEvent(at.SUBMIT_EVENT, {
32163
+ const s = new CustomEvent(lt.SUBMIT_EVENT, {
32163
32164
  detail: { id: this.rootId, data: r, event: i },
32164
32165
  bubbles: !0,
32165
32166
  composed: !0,
@@ -32175,11 +32176,11 @@ let at = class extends f {
32175
32176
  g
32176
32177
  );
32177
32178
  try {
32178
- const v = await lt.processLoginflowEvent({
32179
+ const v = await ct.processLoginflowEvent({
32179
32180
  event: i,
32180
32181
  ...Object.keys(r).length ? { data: r } : {}
32181
32182
  });
32182
- this._dispatch(at.SUCCESS_EVENT, {
32183
+ this._dispatch(lt.SUCCESS_EVENT, {
32183
32184
  id: this.rootId,
32184
32185
  data: r,
32185
32186
  event: i,
@@ -32187,7 +32188,7 @@ let at = class extends f {
32187
32188
  });
32188
32189
  } catch (v) {
32189
32190
  const y = v instanceof Error ? v.message : String(v);
32190
- this._dispatch(at.ERROR_EVENT, {
32191
+ this._dispatch(lt.ERROR_EVENT, {
32191
32192
  id: this.rootId,
32192
32193
  data: r,
32193
32194
  event: i,
@@ -32204,7 +32205,7 @@ let at = class extends f {
32204
32205
  ), this._pendingEvent = void 0;
32205
32206
  }
32206
32207
  }, this._handleReset = (t) => {
32207
- this._pendingEvent = void 0, this.onReset && this.onReset(t), this._dispatch(at.RESET_EVENT, { id: this.rootId });
32208
+ this._pendingEvent = void 0, this.onReset && this.onReset(t), this._dispatch(lt.RESET_EVENT, { id: this.rootId });
32208
32209
  };
32209
32210
  }
32210
32211
  /* ------------------------------------------------------------ */
@@ -32213,11 +32214,11 @@ let at = class extends f {
32213
32214
  }
32214
32215
  /* ------------------------------------------------------------ */
32215
32216
  get rootId() {
32216
- return this.customId ?? `${at.TAG}-${this.seed}`;
32217
+ return this.customId ?? `${lt.TAG}-${this.seed}`;
32217
32218
  }
32218
32219
  /* ---------------------------------------- */
32219
32220
  get _form() {
32220
- const t = `form[part="${at.PARTS.root}"]`;
32221
+ const t = `form[part="${lt.PARTS.root}"]`;
32221
32222
  return this.querySelector(t);
32222
32223
  }
32223
32224
  get _fields() {
@@ -32274,35 +32275,35 @@ let at = class extends f {
32274
32275
  return l`
32275
32276
  <form
32276
32277
  id="${this.rootId}"
32277
- part="${at.PARTS.root}"
32278
+ part="${lt.PARTS.root}"
32278
32279
  @submit=${this._handleSubmit}
32279
32280
  @reset=${this._handleReset}
32280
32281
  ></form>
32281
32282
  `;
32282
32283
  }
32283
32284
  };
32284
- at.ROOT = "form";
32285
- at.TAG = `${Ct}-${at.ROOT}`;
32286
- at.SUBMIT_EVENT = `${at.TAG}:submit`;
32287
- at.SUCCESS_EVENT = `${at.TAG}:success`;
32288
- at.ERROR_EVENT = `${at.TAG}:error`;
32289
- at.RESET_EVENT = `${at.TAG}:reset`;
32290
- at.PARTS = { root: at.ROOT };
32285
+ lt.ROOT = "form";
32286
+ lt.TAG = `${Ct}-${lt.ROOT}`;
32287
+ lt.SUBMIT_EVENT = `${lt.TAG}:submit`;
32288
+ lt.SUCCESS_EVENT = `${lt.TAG}:success`;
32289
+ lt.ERROR_EVENT = `${lt.TAG}:error`;
32290
+ lt.RESET_EVENT = `${lt.TAG}:reset`;
32291
+ lt.PARTS = { root: lt.ROOT };
32291
32292
  Si([
32292
32293
  a({ type: String })
32293
- ], at.prototype, "seed", 2);
32294
+ ], lt.prototype, "seed", 2);
32294
32295
  Si([
32295
32296
  a({ type: String, attribute: "custom-id" })
32296
- ], at.prototype, "customId", 2);
32297
+ ], lt.prototype, "customId", 2);
32297
32298
  Si([
32298
32299
  a({ attribute: !1 })
32299
- ], at.prototype, "onSubmit", 2);
32300
+ ], lt.prototype, "onSubmit", 2);
32300
32301
  Si([
32301
32302
  a({ attribute: !1 })
32302
- ], at.prototype, "onReset", 2);
32303
- at = Si([
32303
+ ], lt.prototype, "onReset", 2);
32304
+ lt = Si([
32304
32305
  p("pont-form")
32305
- ], at);
32306
+ ], lt);
32306
32307
  var GE = Object.defineProperty, KE = Object.getOwnPropertyDescriptor, xi = (t, e, n, o) => {
32307
32308
  for (var r = o > 1 ? void 0 : o ? KE(e, n) : e, i = t.length - 1, s; i >= 0; i--)
32308
32309
  (s = t[i]) && (r = (o ? s(e, n, r) : s(r)) || r);
@@ -32404,7 +32405,7 @@ let wt = class extends f {
32404
32405
  };
32405
32406
  wt.RESTART_EVENT = "pont-layout:restart";
32406
32407
  wt.ERROR_EVENTS = [
32407
- at.ERROR_EVENT,
32408
+ lt.ERROR_EVENT,
32408
32409
  Z.ERROR_EVENT,
32409
32410
  J.ERROR_EVENT,
32410
32411
  Y.ERROR_EVENT,
@@ -32516,7 +32517,7 @@ let Rr = class extends f {
32516
32517
  }, document.head.appendChild(n);
32517
32518
  }
32518
32519
  configureAuth(t) {
32519
- lt.configure({
32520
+ ct.configure({
32520
32521
  domain: t.domain,
32521
32522
  appId: t.appId,
32522
32523
  // Two different things that both read as "locale": the first is the
@@ -32572,7 +32573,7 @@ let Rr = class extends f {
32572
32573
  });
32573
32574
  if (t) {
32574
32575
  if (this.wasBouncedBackFrom(t)) {
32575
- this.clearRedirectAttempt(), lt.invalidateSession(), this.refreshAuthState();
32576
+ this.clearRedirectAttempt(), ct.invalidateSession(), this.refreshAuthState();
32576
32577
  return;
32577
32578
  }
32578
32579
  this.recordRedirectAttempt(t), window.location.href = t;
@@ -32644,7 +32645,7 @@ let Rr = class extends f {
32644
32645
  }
32645
32646
  }
32646
32647
  refreshAuthState() {
32647
- this.auth = { isAuthenticated: lt.isAuthenticated(), resolved: !0 }, this.dispatchAuthChangedEvent(this.auth);
32648
+ this.auth = { isAuthenticated: ct.isAuthenticated(), resolved: !0 }, this.dispatchAuthChangedEvent(this.auth);
32648
32649
  }
32649
32650
  /**
32650
32651
  * Publishes the auth state to anything that is not a Lit context consumer.
@@ -32691,11 +32692,11 @@ let Rr = class extends f {
32691
32692
  */
32692
32693
  async restoreThenRefreshAuthState() {
32693
32694
  if (Yu(window.location.search)) {
32694
- lt.invalidateSession(), this.refreshAuthState();
32695
+ ct.invalidateSession(), this.refreshAuthState();
32695
32696
  return;
32696
32697
  }
32697
32698
  try {
32698
- await lt.restoreSession();
32699
+ await ct.restoreSession();
32699
32700
  } catch {
32700
32701
  }
32701
32702
  this.refreshAuthState();
@@ -32882,7 +32883,7 @@ Rl = Qu([
32882
32883
  p("pont-auth-state")
32883
32884
  ], Rl);
32884
32885
  function yS() {
32885
- return lt;
32886
+ return ct;
32886
32887
  }
32887
32888
  export {
32888
32889
  Rl as AuthStateElement,
@@ -32903,7 +32904,7 @@ export {
32903
32904
  me as PontDivider,
32904
32905
  Ft as PontEditIdentifier,
32905
32906
  A as PontEmailField,
32906
- at as PontForm,
32907
+ lt as PontForm,
32907
32908
  ri as PontGap,
32908
32909
  vs as PontHeader,
32909
32910
  El as PontHint,