@monetize.software/sdk 3.0.0-alpha.6 → 3.0.0-alpha.8

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 (203) hide show
  1. package/README.md +34 -13
  2. package/dist/chunks/{PaywallUI-BYquPomD.js → PaywallUI-BrDiS6zg.js} +926 -962
  3. package/dist/chunks/PaywallUI-BrDiS6zg.js.map +1 -0
  4. package/dist/chunks/PaywallUI-Bvx8nRL0.js +26 -0
  5. package/dist/chunks/PaywallUI-Bvx8nRL0.js.map +1 -0
  6. package/dist/chunks/{ar-nh4l4WDE.js → ar-CHae8g-2.js} +4 -3
  7. package/dist/chunks/ar-CHae8g-2.js.map +1 -0
  8. package/dist/chunks/ar-E1mc8SO_.js +2 -0
  9. package/dist/chunks/ar-E1mc8SO_.js.map +1 -0
  10. package/dist/chunks/cs-Dccq6LAT.js +2 -0
  11. package/dist/chunks/cs-Dccq6LAT.js.map +1 -0
  12. package/dist/chunks/{cs-2UYO2rWf.js → cs-eZTedzaK.js} +2 -1
  13. package/dist/chunks/cs-eZTedzaK.js.map +1 -0
  14. package/dist/chunks/da-C_4MbEh5.js +2 -0
  15. package/dist/chunks/da-C_4MbEh5.js.map +1 -0
  16. package/dist/chunks/{da-BD0O_HfV.js → da-Dca6j8fp.js} +2 -1
  17. package/dist/chunks/da-Dca6j8fp.js.map +1 -0
  18. package/dist/chunks/{de-BkCiXPsn.js → de-BCjn3PUI.js} +3 -1
  19. package/dist/chunks/de-BCjn3PUI.js.map +1 -0
  20. package/dist/chunks/de-DulxcJj-.js +2 -0
  21. package/dist/chunks/de-DulxcJj-.js.map +1 -0
  22. package/dist/chunks/{el-cIcxTp07.js → el-BpXtDTez.js} +2 -1
  23. package/dist/chunks/el-BpXtDTez.js.map +1 -0
  24. package/dist/chunks/el-CVG_1iKB.js +2 -0
  25. package/dist/chunks/el-CVG_1iKB.js.map +1 -0
  26. package/dist/chunks/{es-CJBC_jrV.js → es-B3P4nlMw.js} +3 -1
  27. package/dist/chunks/es-B3P4nlMw.js.map +1 -0
  28. package/dist/chunks/es-ri0uKzUW.js +2 -0
  29. package/dist/chunks/es-ri0uKzUW.js.map +1 -0
  30. package/dist/chunks/{fi-DyV7ynBf.js → fi-BbQ_Bs0Z.js} +2 -1
  31. package/dist/chunks/fi-BbQ_Bs0Z.js.map +1 -0
  32. package/dist/chunks/fi-CNZqWHjw.js +2 -0
  33. package/dist/chunks/fi-CNZqWHjw.js.map +1 -0
  34. package/dist/chunks/{fr-BLQ4AIu7.js → fr-BKDUXceO.js} +3 -1
  35. package/dist/chunks/fr-BKDUXceO.js.map +1 -0
  36. package/dist/chunks/fr-CfFOw4hD.js +2 -0
  37. package/dist/chunks/fr-CfFOw4hD.js.map +1 -0
  38. package/dist/chunks/{he-Bg-Bqi7r.js → he-BVCHlTtT.js} +2 -1
  39. package/dist/chunks/he-BVCHlTtT.js.map +1 -0
  40. package/dist/chunks/he-DN2JEtQb.js +2 -0
  41. package/dist/chunks/he-DN2JEtQb.js.map +1 -0
  42. package/dist/chunks/hi-DxfOerNP.js +2 -0
  43. package/dist/chunks/hi-DxfOerNP.js.map +1 -0
  44. package/dist/chunks/{hi-wQeE43oY.js → hi-H_Hshh-7.js} +4 -3
  45. package/dist/chunks/hi-H_Hshh-7.js.map +1 -0
  46. package/dist/chunks/hu-BTImywuV.js +2 -0
  47. package/dist/chunks/{hu-DXtscQ8_.js.map → hu-BTImywuV.js.map} +1 -1
  48. package/dist/chunks/{hu-D9qxzu0r.js → hu-ZWiNfzvN.js} +2 -1
  49. package/dist/chunks/{hu-D9qxzu0r.js.map → hu-ZWiNfzvN.js.map} +1 -1
  50. package/dist/chunks/{id-Rx_wYvqy.js → id-DeiRYsJ1.js} +2 -1
  51. package/dist/chunks/id-DeiRYsJ1.js.map +1 -0
  52. package/dist/chunks/id-YFuArJA6.js +2 -0
  53. package/dist/chunks/id-YFuArJA6.js.map +1 -0
  54. package/dist/chunks/{it-B1SRPZ3e.js → it-UH9OzFhg.js} +3 -1
  55. package/dist/chunks/it-UH9OzFhg.js.map +1 -0
  56. package/dist/chunks/it-mhkzXBM9.js +2 -0
  57. package/dist/chunks/it-mhkzXBM9.js.map +1 -0
  58. package/dist/chunks/{ja-CMC3Parn.js → ja-6l_z_G9k.js} +2 -2
  59. package/dist/chunks/ja-6l_z_G9k.js.map +1 -0
  60. package/dist/chunks/{ja-DiItm8te.js → ja-BYC8FRN8.js} +3 -1
  61. package/dist/chunks/ja-BYC8FRN8.js.map +1 -0
  62. package/dist/chunks/{ko-CdGFWAKX.js → ko-Bjs2ZRcF.js} +3 -1
  63. package/dist/chunks/ko-Bjs2ZRcF.js.map +1 -0
  64. package/dist/chunks/ko-YAl4XwHu.js +2 -0
  65. package/dist/chunks/ko-YAl4XwHu.js.map +1 -0
  66. package/dist/chunks/nl-C-9zHtfb.js +2 -0
  67. package/dist/chunks/nl-C-9zHtfb.js.map +1 -0
  68. package/dist/chunks/{nl-CmZ3vEvj.js → nl-Ch5HFWQO.js} +3 -1
  69. package/dist/chunks/nl-Ch5HFWQO.js.map +1 -0
  70. package/dist/chunks/{no-BuxByZpq.js → no-CljpinWz.js} +2 -1
  71. package/dist/chunks/no-CljpinWz.js.map +1 -0
  72. package/dist/chunks/no-qzPitLlx.js +2 -0
  73. package/dist/chunks/no-qzPitLlx.js.map +1 -0
  74. package/dist/chunks/{pl-jZFCnDb8.js → pl-CUcSS0zZ.js} +2 -1
  75. package/dist/chunks/pl-CUcSS0zZ.js.map +1 -0
  76. package/dist/chunks/pl-MAIYeuhW.js +2 -0
  77. package/dist/chunks/pl-MAIYeuhW.js.map +1 -0
  78. package/dist/chunks/{pt-Cld7MwIW.js → pt-BHK0LwkC.js} +3 -1
  79. package/dist/chunks/pt-BHK0LwkC.js.map +1 -0
  80. package/dist/chunks/pt-DqDabE4v.js +2 -0
  81. package/dist/chunks/pt-DqDabE4v.js.map +1 -0
  82. package/dist/chunks/ro-BVs-lHH-.js +2 -0
  83. package/dist/chunks/ro-BVs-lHH-.js.map +1 -0
  84. package/dist/chunks/{ro-CuKDqj3C.js → ro-Bj8cwU2n.js} +2 -1
  85. package/dist/chunks/ro-Bj8cwU2n.js.map +1 -0
  86. package/dist/chunks/{ru-B7cjqJUm.js → ru-CgqNy0Gb.js} +10 -1
  87. package/dist/chunks/ru-CgqNy0Gb.js.map +1 -0
  88. package/dist/chunks/ru-DP7qDAmE.js +2 -0
  89. package/dist/chunks/ru-DP7qDAmE.js.map +1 -0
  90. package/dist/chunks/sv-B3QEYGgd.js +2 -0
  91. package/dist/chunks/sv-B3QEYGgd.js.map +1 -0
  92. package/dist/chunks/{sv-D9y-M1Fo.js → sv-H7jroOQ5.js} +2 -1
  93. package/dist/chunks/sv-H7jroOQ5.js.map +1 -0
  94. package/dist/chunks/{th-D9umBjEy.js → th-Dqm-gpGe.js} +2 -1
  95. package/dist/chunks/th-Dqm-gpGe.js.map +1 -0
  96. package/dist/chunks/th-DzQau9aW.js +2 -0
  97. package/dist/chunks/th-DzQau9aW.js.map +1 -0
  98. package/dist/chunks/{tr-BddMywiw.js → tr-D3zPcNtT.js} +2 -1
  99. package/dist/chunks/tr-D3zPcNtT.js.map +1 -0
  100. package/dist/chunks/tr-cG1YuE1E.js +2 -0
  101. package/dist/chunks/tr-cG1YuE1E.js.map +1 -0
  102. package/dist/chunks/{uk-Dbd31hFt.js → uk-CoIIs3QI.js} +10 -1
  103. package/dist/chunks/uk-CoIIs3QI.js.map +1 -0
  104. package/dist/chunks/uk-Cvbo0IBW.js +2 -0
  105. package/dist/chunks/uk-Cvbo0IBW.js.map +1 -0
  106. package/dist/chunks/vi-BRtYSBUp.js +2 -0
  107. package/dist/chunks/{vi-CJefLP_g.js.map → vi-BRtYSBUp.js.map} +1 -1
  108. package/dist/chunks/{vi-Do3BMOdh.js → vi-C_fruIbh.js} +2 -1
  109. package/dist/chunks/{vi-Do3BMOdh.js.map → vi-C_fruIbh.js.map} +1 -1
  110. package/dist/chunks/zh-CwczPMPp.js +2 -0
  111. package/dist/chunks/zh-CwczPMPp.js.map +1 -0
  112. package/dist/chunks/{zh-gQSYLZI3.js → zh-LDkEV2D9.js} +3 -1
  113. package/dist/chunks/zh-LDkEV2D9.js.map +1 -0
  114. package/dist/core.cjs +1 -1
  115. package/dist/core.cjs.map +1 -1
  116. package/dist/core.js +20 -20
  117. package/dist/core.js.map +1 -1
  118. package/dist/index.cjs +1 -1
  119. package/dist/index.d.ts +31 -16
  120. package/dist/index.js +1 -1
  121. package/dist/ui.cjs +1 -1
  122. package/dist/ui.d.ts +31 -16
  123. package/dist/ui.js +1 -1
  124. package/package.json +1 -1
  125. package/dist/chunks/PaywallUI-BYquPomD.js.map +0 -1
  126. package/dist/chunks/PaywallUI-Cl9sz_xA.js +0 -26
  127. package/dist/chunks/PaywallUI-Cl9sz_xA.js.map +0 -1
  128. package/dist/chunks/ar-BUQInJ5a.js +0 -2
  129. package/dist/chunks/ar-BUQInJ5a.js.map +0 -1
  130. package/dist/chunks/ar-nh4l4WDE.js.map +0 -1
  131. package/dist/chunks/cs-2UYO2rWf.js.map +0 -1
  132. package/dist/chunks/cs-i5K4KTFV.js +0 -2
  133. package/dist/chunks/cs-i5K4KTFV.js.map +0 -1
  134. package/dist/chunks/da-BD0O_HfV.js.map +0 -1
  135. package/dist/chunks/da-CZbhtVJO.js +0 -2
  136. package/dist/chunks/da-CZbhtVJO.js.map +0 -1
  137. package/dist/chunks/de-Bc-GoLgC.js +0 -2
  138. package/dist/chunks/de-Bc-GoLgC.js.map +0 -1
  139. package/dist/chunks/de-BkCiXPsn.js.map +0 -1
  140. package/dist/chunks/el-CcMEbl_F.js +0 -2
  141. package/dist/chunks/el-CcMEbl_F.js.map +0 -1
  142. package/dist/chunks/el-cIcxTp07.js.map +0 -1
  143. package/dist/chunks/es-BvYmomAz.js +0 -2
  144. package/dist/chunks/es-BvYmomAz.js.map +0 -1
  145. package/dist/chunks/es-CJBC_jrV.js.map +0 -1
  146. package/dist/chunks/fi-DyV7ynBf.js.map +0 -1
  147. package/dist/chunks/fi-aZR-qmZN.js +0 -2
  148. package/dist/chunks/fi-aZR-qmZN.js.map +0 -1
  149. package/dist/chunks/fr-BLQ4AIu7.js.map +0 -1
  150. package/dist/chunks/fr-BgbFAgHx.js +0 -2
  151. package/dist/chunks/fr-BgbFAgHx.js.map +0 -1
  152. package/dist/chunks/he-Bg-Bqi7r.js.map +0 -1
  153. package/dist/chunks/he-CQ4yCuja.js +0 -2
  154. package/dist/chunks/he-CQ4yCuja.js.map +0 -1
  155. package/dist/chunks/hi-DtUsj1c-.js +0 -2
  156. package/dist/chunks/hi-DtUsj1c-.js.map +0 -1
  157. package/dist/chunks/hi-wQeE43oY.js.map +0 -1
  158. package/dist/chunks/hu-DXtscQ8_.js +0 -2
  159. package/dist/chunks/id-BByOYpeo.js +0 -2
  160. package/dist/chunks/id-BByOYpeo.js.map +0 -1
  161. package/dist/chunks/id-Rx_wYvqy.js.map +0 -1
  162. package/dist/chunks/it-52Ip42pa.js +0 -2
  163. package/dist/chunks/it-52Ip42pa.js.map +0 -1
  164. package/dist/chunks/it-B1SRPZ3e.js.map +0 -1
  165. package/dist/chunks/ja-CMC3Parn.js.map +0 -1
  166. package/dist/chunks/ja-DiItm8te.js.map +0 -1
  167. package/dist/chunks/ko-3qY21q40.js +0 -2
  168. package/dist/chunks/ko-3qY21q40.js.map +0 -1
  169. package/dist/chunks/ko-CdGFWAKX.js.map +0 -1
  170. package/dist/chunks/nl-Borc5nw1.js +0 -2
  171. package/dist/chunks/nl-Borc5nw1.js.map +0 -1
  172. package/dist/chunks/nl-CmZ3vEvj.js.map +0 -1
  173. package/dist/chunks/no-BuxByZpq.js.map +0 -1
  174. package/dist/chunks/no-Do2iGedg.js +0 -2
  175. package/dist/chunks/no-Do2iGedg.js.map +0 -1
  176. package/dist/chunks/pl-jZFCnDb8.js.map +0 -1
  177. package/dist/chunks/pl-mRaky_7k.js +0 -2
  178. package/dist/chunks/pl-mRaky_7k.js.map +0 -1
  179. package/dist/chunks/pt-Cld7MwIW.js.map +0 -1
  180. package/dist/chunks/pt-DilDTXfs.js +0 -2
  181. package/dist/chunks/pt-DilDTXfs.js.map +0 -1
  182. package/dist/chunks/ro-CuKDqj3C.js.map +0 -1
  183. package/dist/chunks/ro-DF2uzPIB.js +0 -2
  184. package/dist/chunks/ro-DF2uzPIB.js.map +0 -1
  185. package/dist/chunks/ru-B7cjqJUm.js.map +0 -1
  186. package/dist/chunks/ru-YeaXnTO-.js +0 -2
  187. package/dist/chunks/ru-YeaXnTO-.js.map +0 -1
  188. package/dist/chunks/sv-2pHEvuSe.js +0 -2
  189. package/dist/chunks/sv-2pHEvuSe.js.map +0 -1
  190. package/dist/chunks/sv-D9y-M1Fo.js.map +0 -1
  191. package/dist/chunks/th-D9umBjEy.js.map +0 -1
  192. package/dist/chunks/th-u2QSDF0G.js +0 -2
  193. package/dist/chunks/th-u2QSDF0G.js.map +0 -1
  194. package/dist/chunks/tr-BddMywiw.js.map +0 -1
  195. package/dist/chunks/tr-Bhgm6_ti.js +0 -2
  196. package/dist/chunks/tr-Bhgm6_ti.js.map +0 -1
  197. package/dist/chunks/uk-7vwqsaVK.js +0 -2
  198. package/dist/chunks/uk-7vwqsaVK.js.map +0 -1
  199. package/dist/chunks/uk-Dbd31hFt.js.map +0 -1
  200. package/dist/chunks/vi-CJefLP_g.js +0 -2
  201. package/dist/chunks/zh-D5C3BzYL.js +0 -2
  202. package/dist/chunks/zh-D5C3BzYL.js.map +0 -1
  203. package/dist/chunks/zh-gQSYLZI3.js.map +0 -1
package/dist/core.js CHANGED
@@ -240,7 +240,7 @@ function C() {
240
240
  const e = Array.from(t, (s) => s.toString(16).padStart(2, "0")).join("");
241
241
  return `${e.slice(0, 8)}-${e.slice(8, 12)}-${e.slice(12, 16)}-${e.slice(16, 20)}-${e.slice(20)}`;
242
242
  }
243
- async function I(i) {
243
+ async function b(i) {
244
244
  try {
245
245
  const e = await i.getItem(l.visitorId);
246
246
  if (e && typeof e == "string" && e.length >= 16) return e;
@@ -253,7 +253,7 @@ async function I(i) {
253
253
  }
254
254
  return t;
255
255
  }
256
- const H = 5e3, V = 30 * 6e4, b = 60 * 6e4, j = 5 * 6e4, _ = {
256
+ const H = 5e3, V = 30 * 6e4, _ = 60 * 6e4, j = 5 * 6e4, S = {
257
257
  has_active_subscription: !1,
258
258
  purchases: [],
259
259
  trial: null,
@@ -298,7 +298,7 @@ class ut {
298
298
  }), t.auth && (this.authUnsubscribe = t.auth.onAuthChange((s, a) => {
299
299
  const r = a ? T(a.user) : void 0;
300
300
  W(this.identity, r) || this.setIdentity(r);
301
- })), this.hydrateUserFromStorage(), this.hydrateBootstrapFromStorage(), this.subscribeBootstrapStorage(), this.hydrateBalancesFromStorage(), this.subscribeBalancesStorage(), this.visitorIdPromise = I(this.storage).then((s) => (this.visitorId = s, s));
301
+ })), this.hydrateUserFromStorage(), this.hydrateBootstrapFromStorage(), this.subscribeBootstrapStorage(), this.hydrateBalancesFromStorage(), this.subscribeBalancesStorage(), this.visitorIdPromise = b(this.storage).then((s) => (this.visitorId = s, s));
302
302
  }
303
303
  /**
304
304
  * Stable visitor_id (UUID v4). Первый вызов awaitит первичный резолв из
@@ -306,15 +306,15 @@ class ut {
306
306
  * EventTracker'ом для атрибуции аналитики.
307
307
  */
308
308
  async getVisitorId() {
309
- return this.visitorId ? this.visitorId : (this.visitorIdPromise || (this.visitorIdPromise = I(this.storage).then((t) => (this.visitorId = t, t))), this.visitorIdPromise);
309
+ return this.visitorId ? this.visitorId : (this.visitorIdPromise || (this.visitorIdPromise = b(this.storage).then((t) => (this.visitorId = t, t))), this.visitorIdPromise);
310
310
  }
311
311
  /** Sync-доступ к visitor_id. null если ещё не зарезолвили (первые ms жизни). */
312
312
  getCachedVisitorId() {
313
313
  return this.visitorId;
314
314
  }
315
315
  setIdentity(t) {
316
- this.identity = t, this.cachedUser = null, this.cachedUserAt = 0, this.inflightUser = null, this.cachedBalances = null, this.cachedBalancesAt = 0, this.inflightBalances = null, this.balancesStorageUnwatch && (this.balancesStorageUnwatch(), this.balancesStorageUnwatch = null), this.hydrateBalancesFromStorage(), this.subscribeBalancesStorage(), this.hydrateUserFromStorage(), t && this.getUser({ force: !0 }).catch(() => {
317
- });
316
+ this.identity = t, this.cachedUser = null, this.cachedUserAt = 0, this.inflightUser = null, this.cachedBalances = null, this.cachedBalancesAt = 0, this.inflightBalances = null, this.balancesStorageUnwatch && (this.balancesStorageUnwatch(), this.balancesStorageUnwatch = null), this.hydrateBalancesFromStorage(), this.subscribeBalancesStorage(), this.hydrateUserFromStorage(), t ? this.getUser({ force: !0 }).catch(() => {
317
+ }) : (this.applyUser(S), this.applyBalances([]));
318
318
  }
319
319
  /**
320
320
  * Отписаться от auth-event'ов и сбросить listener'ы. Вызывать когда
@@ -342,7 +342,7 @@ class ut {
342
342
  "BillingClient in preview mode but cachedBootstrap is not seeded. Call setBootstrap(bootstrap) before open()."
343
343
  );
344
344
  }
345
- const s = Date.now(), a = this.cachedBootstrap && this.cachedBootstrapAt > 0 && s - this.cachedBootstrapAt < b;
345
+ const s = Date.now(), a = this.cachedBootstrap && this.cachedBootstrapAt > 0 && s - this.cachedBootstrapAt < _;
346
346
  return !e.force && a ? (s - this.cachedBootstrapAt > j && this.revalidateBootstrap(e.signal).catch(() => {
347
347
  }), { ...this.cachedBootstrap, user: this.cachedUser ?? void 0 }) : this.inflightBootstrap ? this.inflightBootstrap : (this.inflightBootstrap = this.fetchBootstrap({
348
348
  ifVersion: e.force ? void 0 : this.cachedBootstrap?.version,
@@ -392,7 +392,7 @@ class ut {
392
392
  offers: t.offers !== void 0 ? t.offers : e.offers,
393
393
  version: `preview:${++this.previewVersionCounter}`
394
394
  };
395
- s.layout || (s.layout = U(s.settings, s.prices)), w(s), this.cachedBootstrap = s, this.cachedBootstrapAt = Date.now();
395
+ s.layout || (s.layout = O(s.settings, s.prices)), w(s), this.cachedBootstrap = s, this.cachedBootstrapAt = Date.now();
396
396
  for (const a of this.bootstrapListeners)
397
397
  try {
398
398
  a(s);
@@ -414,7 +414,7 @@ class ut {
414
414
  if ("unchanged" in a && a.unchanged)
415
415
  return this.cachedBootstrap ? (this.cachedBootstrapAt = Date.now(), a.user && this.applyUser(a.user), this.cachedBootstrap) : this.fetchBootstrap({ signal: t.signal });
416
416
  const r = a;
417
- return Y(r.settings.custom_domain, this.apiOrigin), r.layout || (r.layout = U(r.settings, r.prices)), w(r), this.applyBootstrap(r, { persist: !0 }), r.user && this.applyUser(r.user), r;
417
+ return Y(r.settings.custom_domain, this.apiOrigin), r.layout || (r.layout = O(r.settings, r.prices)), w(r), this.applyBootstrap(r, { persist: !0 }), r.user && this.applyUser(r.user), r;
418
418
  }
419
419
  // Фоновый revalidate из stale-while-revalidate ветки. Дедуплицируется через
420
420
  // `inflightBootstrap`, чтобы параллельные revalidate'ы не пересекались.
@@ -447,7 +447,7 @@ class ut {
447
447
  const t = await this.storage.getItem(l.bootstrap(this.paywallId));
448
448
  if (!t) return;
449
449
  const e = JSON.parse(t);
450
- if (!e?.bootstrap || Date.now() - e.at > b || this.cachedBootstrap) return;
450
+ if (!e?.bootstrap || Date.now() - e.at > _ || this.cachedBootstrap) return;
451
451
  w(e.bootstrap), this.cachedBootstrap = e.bootstrap, this.cachedBootstrapAt = e.at;
452
452
  for (const s of this.bootstrapListeners)
453
453
  try {
@@ -546,7 +546,7 @@ class ut {
546
546
  return !t && this.cachedUser && Date.now() - this.cachedUserAt < H ? this.cachedUser : this.inflightUser ? this.inflightUser : (this.inflightUser = (async () => {
547
547
  try {
548
548
  if (!this.identity?.email)
549
- return this.applyUser(_), _;
549
+ return this.applyUser(S), S;
550
550
  const s = await this.api.request(
551
551
  `/api/v1/paywall/${this.paywallId}/user-state`,
552
552
  { headers: { "X-User-Email": this.identity.email }, signal: e }
@@ -970,7 +970,7 @@ function T(i) {
970
970
  function W(i, t) {
971
971
  return i === t ? !0 : !i || !t ? !1 : i.email === t.email && i.userId === t.userId && i.anonymousId === t.anonymousId;
972
972
  }
973
- function O(i) {
973
+ function U(i) {
974
974
  if (!i) return null;
975
975
  const t = i.trim();
976
976
  if (!t) return null;
@@ -981,14 +981,14 @@ function O(i) {
981
981
  }
982
982
  }
983
983
  function Y(i, t) {
984
- const e = O(i);
985
- if (!(!e || O(t) === e))
984
+ const e = U(i);
985
+ if (!(!e || U(t) === e))
986
986
  throw new n(
987
987
  "invalid_config",
988
988
  `apiOrigin mismatch: SDK initialized with "${t}" but paywall is configured with custom_domain "${i}". Use the custom_domain from the platform paywall settings.`
989
989
  );
990
990
  }
991
- function U(i, t) {
991
+ function O(i, t) {
992
992
  return {
993
993
  type: "modal",
994
994
  blocks: [
@@ -1037,23 +1037,23 @@ function P(i) {
1037
1037
  for (let s = 0; s < i; s++) t[s] = Math.floor(Math.random() * 256);
1038
1038
  return t;
1039
1039
  }
1040
- function S(i) {
1040
+ function I(i) {
1041
1041
  let t = "";
1042
1042
  for (let e = 0; e < i.length; e++) t += String.fromCharCode(i[e]);
1043
1043
  return btoa(t).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
1044
1044
  }
1045
1045
  function Z() {
1046
- return S(P(64));
1046
+ return I(P(64));
1047
1047
  }
1048
1048
  async function tt(i) {
1049
1049
  const t = new TextEncoder().encode(i), e = globalThis.crypto;
1050
1050
  if (!e?.subtle?.digest)
1051
1051
  throw new Error("crypto.subtle is required for PKCE");
1052
1052
  const s = await e.subtle.digest("SHA-256", t);
1053
- return S(new Uint8Array(s));
1053
+ return I(new Uint8Array(s));
1054
1054
  }
1055
1055
  function et() {
1056
- return S(P(16));
1056
+ return I(P(16));
1057
1057
  }
1058
1058
  const st = 6e4, it = 600 * 1e3;
1059
1059
  class dt {
@@ -1981,7 +1981,7 @@ export {
1981
1981
  m as SDK_VERSION,
1982
1982
  l as STORAGE_KEYS,
1983
1983
  L as createStorage,
1984
- I as ensureVisitorId,
1984
+ b as ensureVisitorId,
1985
1985
  C as generateVisitorId
1986
1986
  };
1987
1987
  //# sourceMappingURL=core.js.map