@monetize.software/sdk 3.0.0-alpha.4 → 3.0.0-alpha.5

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 (128) hide show
  1. package/dist/chunks/PaywallUI-BD5hRY2P.js +26 -0
  2. package/dist/chunks/PaywallUI-BD5hRY2P.js.map +1 -0
  3. package/dist/chunks/PaywallUI-D7lp-bC5.js +3206 -0
  4. package/dist/chunks/PaywallUI-D7lp-bC5.js.map +1 -0
  5. package/dist/chunks/ar-BCHXVoE2.js +114 -0
  6. package/dist/chunks/ar-BCHXVoE2.js.map +1 -0
  7. package/dist/chunks/ar-CsJNZJSr.js +2 -0
  8. package/dist/chunks/ar-CsJNZJSr.js.map +1 -0
  9. package/dist/chunks/cs-B5NqpTW_.js +110 -0
  10. package/dist/chunks/cs-B5NqpTW_.js.map +1 -0
  11. package/dist/chunks/cs-BydWUC0e.js +2 -0
  12. package/dist/chunks/cs-BydWUC0e.js.map +1 -0
  13. package/dist/chunks/da-BJrGZ3LD.js +110 -0
  14. package/dist/chunks/da-BJrGZ3LD.js.map +1 -0
  15. package/dist/chunks/da-DNhiAQnh.js +2 -0
  16. package/dist/chunks/da-DNhiAQnh.js.map +1 -0
  17. package/dist/chunks/de-H8ztFOie.js +2 -0
  18. package/dist/chunks/de-H8ztFOie.js.map +1 -0
  19. package/dist/chunks/de-aepBKwsb.js +130 -0
  20. package/dist/chunks/de-aepBKwsb.js.map +1 -0
  21. package/dist/chunks/el-DRfoadtI.js +2 -0
  22. package/dist/chunks/el-DRfoadtI.js.map +1 -0
  23. package/dist/chunks/el-DTLQoX2D.js +114 -0
  24. package/dist/chunks/el-DTLQoX2D.js.map +1 -0
  25. package/dist/chunks/es-CLutF-D_.js +130 -0
  26. package/dist/chunks/es-CLutF-D_.js.map +1 -0
  27. package/dist/chunks/es-GlaYesNR.js +2 -0
  28. package/dist/chunks/es-GlaYesNR.js.map +1 -0
  29. package/dist/chunks/fi-BIHFyScH.js +2 -0
  30. package/dist/chunks/fi-BIHFyScH.js.map +1 -0
  31. package/dist/chunks/fi-DZ4csxqk.js +110 -0
  32. package/dist/chunks/fi-DZ4csxqk.js.map +1 -0
  33. package/dist/chunks/fr-BtZILUNZ.js +2 -0
  34. package/dist/chunks/fr-BtZILUNZ.js.map +1 -0
  35. package/dist/chunks/fr-jJU1SSpj.js +130 -0
  36. package/dist/chunks/fr-jJU1SSpj.js.map +1 -0
  37. package/dist/chunks/he-D9obGPNj.js +114 -0
  38. package/dist/chunks/he-D9obGPNj.js.map +1 -0
  39. package/dist/chunks/he-vSDRE4Nn.js +2 -0
  40. package/dist/chunks/he-vSDRE4Nn.js.map +1 -0
  41. package/dist/chunks/hi-B90FsnP6.js +2 -0
  42. package/dist/chunks/hi-B90FsnP6.js.map +1 -0
  43. package/dist/chunks/hi-pM8SQwZ3.js +114 -0
  44. package/dist/chunks/hi-pM8SQwZ3.js.map +1 -0
  45. package/dist/chunks/hu-DWVFODsS.js +2 -0
  46. package/dist/chunks/hu-DWVFODsS.js.map +1 -0
  47. package/dist/chunks/hu-E0m9WgbD.js +110 -0
  48. package/dist/chunks/hu-E0m9WgbD.js.map +1 -0
  49. package/dist/chunks/id-C6poPvby.js +110 -0
  50. package/dist/chunks/id-C6poPvby.js.map +1 -0
  51. package/dist/chunks/id-Ce2gzMVT.js +2 -0
  52. package/dist/chunks/id-Ce2gzMVT.js.map +1 -0
  53. package/dist/chunks/it-B2RSFyVd.js +130 -0
  54. package/dist/chunks/it-B2RSFyVd.js.map +1 -0
  55. package/dist/chunks/it-u-Gu44bl.js +2 -0
  56. package/dist/chunks/it-u-Gu44bl.js.map +1 -0
  57. package/dist/chunks/ja-CM-VgVG6.js +134 -0
  58. package/dist/chunks/ja-CM-VgVG6.js.map +1 -0
  59. package/dist/chunks/ja-CQy8RaRa.js +2 -0
  60. package/dist/chunks/ja-CQy8RaRa.js.map +1 -0
  61. package/dist/chunks/ko-BRnb7vJ7.js +2 -0
  62. package/dist/chunks/ko-BRnb7vJ7.js.map +1 -0
  63. package/dist/chunks/ko-C451fA21.js +134 -0
  64. package/dist/chunks/ko-C451fA21.js.map +1 -0
  65. package/dist/chunks/nl-CJelco6J.js +2 -0
  66. package/dist/chunks/nl-CJelco6J.js.map +1 -0
  67. package/dist/chunks/nl-DzQfJPo2.js +130 -0
  68. package/dist/chunks/nl-DzQfJPo2.js.map +1 -0
  69. package/dist/chunks/no-B51be8KT.js +110 -0
  70. package/dist/chunks/no-B51be8KT.js.map +1 -0
  71. package/dist/chunks/no-BwTjSZ4K.js +2 -0
  72. package/dist/chunks/no-BwTjSZ4K.js.map +1 -0
  73. package/dist/chunks/pl-5rTEkvfY.js +110 -0
  74. package/dist/chunks/pl-5rTEkvfY.js.map +1 -0
  75. package/dist/chunks/pl-kO82vcjb.js +2 -0
  76. package/dist/chunks/pl-kO82vcjb.js.map +1 -0
  77. package/dist/chunks/pt-CsJzaSjg.js +2 -0
  78. package/dist/chunks/pt-CsJzaSjg.js.map +1 -0
  79. package/dist/chunks/pt-JwqffZ9u.js +130 -0
  80. package/dist/chunks/pt-JwqffZ9u.js.map +1 -0
  81. package/dist/chunks/ro-BE_wJ1td.js +110 -0
  82. package/dist/chunks/ro-BE_wJ1td.js.map +1 -0
  83. package/dist/chunks/ro-ue15Ina4.js +2 -0
  84. package/dist/chunks/ro-ue15Ina4.js.map +1 -0
  85. package/dist/chunks/ru-B1iMOhX0.js +2 -0
  86. package/dist/chunks/ru-B1iMOhX0.js.map +1 -0
  87. package/dist/chunks/ru-BviATvLb.js +124 -0
  88. package/dist/chunks/ru-BviATvLb.js.map +1 -0
  89. package/dist/chunks/sv-CkNYpUVy.js +2 -0
  90. package/dist/chunks/sv-CkNYpUVy.js.map +1 -0
  91. package/dist/chunks/sv-DabGF9WL.js +110 -0
  92. package/dist/chunks/sv-DabGF9WL.js.map +1 -0
  93. package/dist/chunks/th-BiF-bNo0.js +114 -0
  94. package/dist/chunks/th-BiF-bNo0.js.map +1 -0
  95. package/dist/chunks/th-Cu80HK4y.js +2 -0
  96. package/dist/chunks/th-Cu80HK4y.js.map +1 -0
  97. package/dist/chunks/tr-B7c0afXV.js +2 -0
  98. package/dist/chunks/tr-B7c0afXV.js.map +1 -0
  99. package/dist/chunks/tr-xZuly8X8.js +110 -0
  100. package/dist/chunks/tr-xZuly8X8.js.map +1 -0
  101. package/dist/chunks/uk-BO106B0H.js +2 -0
  102. package/dist/chunks/uk-BO106B0H.js.map +1 -0
  103. package/dist/chunks/uk-KlkAaHuy.js +124 -0
  104. package/dist/chunks/uk-KlkAaHuy.js.map +1 -0
  105. package/dist/chunks/vi-BVCeumNE.js +110 -0
  106. package/dist/chunks/vi-BVCeumNE.js.map +1 -0
  107. package/dist/chunks/vi-CZ6ow40D.js +2 -0
  108. package/dist/chunks/vi-CZ6ow40D.js.map +1 -0
  109. package/dist/chunks/zh-BhP80WI1.js +2 -0
  110. package/dist/chunks/zh-BhP80WI1.js.map +1 -0
  111. package/dist/chunks/zh-C_ghwmqi.js +134 -0
  112. package/dist/chunks/zh-C_ghwmqi.js.map +1 -0
  113. package/dist/core.cjs +1 -1
  114. package/dist/core.cjs.map +1 -1
  115. package/dist/core.d.ts +81 -5
  116. package/dist/core.js +209 -171
  117. package/dist/core.js.map +1 -1
  118. package/dist/index.cjs +1 -1
  119. package/dist/index.d.ts +81 -5
  120. package/dist/index.js +1 -1
  121. package/dist/ui.cjs +1 -1
  122. package/dist/ui.d.ts +81 -5
  123. package/dist/ui.js +1 -1
  124. package/package.json +1 -1
  125. package/dist/chunks/PaywallUI-2bwf2scV.js +0 -2277
  126. package/dist/chunks/PaywallUI-2bwf2scV.js.map +0 -1
  127. package/dist/chunks/PaywallUI-Bu51__PT.js +0 -26
  128. package/dist/chunks/PaywallUI-Bu51__PT.js.map +0 -1
@@ -0,0 +1,3206 @@
1
+ import { PaywallError as R, BillingClient as Rt, EventTracker as Ut, AuthClient as dt } from "../core.js";
2
+ import { render as Z, h as ut, createContext as Dt } from "preact";
3
+ import { jsx as i, jsxs as c, Fragment as q } from "preact/jsx-runtime";
4
+ import { useContext as Nt, useState as b, useEffect as T, useRef as O, useMemo as St, useLayoutEffect as Vt } from "preact/hooks";
5
+ const pt = 3600 * 1e3;
6
+ function K(e) {
7
+ return `paywall-${e}-trial-time-first-open`;
8
+ }
9
+ function Y(e) {
10
+ return `paywall-${e}-skip-times`;
11
+ }
12
+ class Ct {
13
+ constructor(t, r, a) {
14
+ this.storage = t, this.paywallId = r, this.config = a;
15
+ }
16
+ async check() {
17
+ return this.config.mode === "time" ? this.checkTime() : this.checkOpens();
18
+ }
19
+ async recordBlock() {
20
+ return this.config.mode === "time" ? this.recordTime() : this.recordOpens();
21
+ }
22
+ async reset() {
23
+ await this.storage.removeItem(this.config.mode === "time" ? K(this.paywallId) : Y(this.paywallId));
24
+ }
25
+ async checkTime() {
26
+ const t = this.config.payload * pt, r = await this.storage.getItem(K(this.paywallId)), a = r ? Number(r) : null;
27
+ if (!a || !Number.isFinite(a))
28
+ return {
29
+ mode: "time",
30
+ blocked: !0,
31
+ startedAt: null,
32
+ expiresAt: null,
33
+ remainingMs: t,
34
+ totalMs: t
35
+ };
36
+ const n = a + t, o = Math.max(0, n - Date.now());
37
+ return {
38
+ mode: "time",
39
+ blocked: o > 0,
40
+ startedAt: a,
41
+ expiresAt: n,
42
+ remainingMs: o,
43
+ totalMs: t
44
+ };
45
+ }
46
+ async checkOpens() {
47
+ const t = this.config.payload, r = await this.storage.getItem(Y(this.paywallId)), a = r ? Number(r) : 0, n = Number.isFinite(a) ? a : 0, o = n < t, s = Math.max(0, t - n);
48
+ return {
49
+ mode: "opens",
50
+ blocked: o,
51
+ remainingActions: s,
52
+ totalActions: t
53
+ };
54
+ }
55
+ async recordTime() {
56
+ const t = this.config.payload * pt, r = K(this.paywallId), a = await this.storage.getItem(r);
57
+ let n = a ? Number(a) : null;
58
+ (!n || !Number.isFinite(n)) && (n = Date.now(), await this.storage.setItem(r, String(n)));
59
+ const o = n + t, s = Math.max(0, o - Date.now());
60
+ return {
61
+ mode: "time",
62
+ blocked: s > 0,
63
+ startedAt: n,
64
+ expiresAt: o,
65
+ remainingMs: s,
66
+ totalMs: t
67
+ };
68
+ }
69
+ async recordOpens() {
70
+ const t = this.config.payload, r = Y(this.paywallId), a = await this.storage.getItem(r), n = a ? Number(a) : 0, o = Number.isFinite(n) ? n : 0, s = Math.min(t, o + 1);
71
+ await this.storage.setItem(r, String(s));
72
+ const l = Math.max(0, t - s);
73
+ return {
74
+ mode: "opens",
75
+ blocked: s < t,
76
+ remainingActions: l,
77
+ totalActions: t
78
+ };
79
+ }
80
+ }
81
+ let ht = !1;
82
+ class $t {
83
+ constructor(t, r, a) {
84
+ ht || (ht = !0, console.warn(
85
+ '[paywall] trial.storage="server" is not implemented yet — falling back to client storage. State lives in localStorage; users can reset trial by clearing site data.'
86
+ )), this.fallback = new Ct(t, r, a);
87
+ }
88
+ check() {
89
+ return this.fallback.check();
90
+ }
91
+ recordBlock() {
92
+ return this.fallback.recordBlock();
93
+ }
94
+ reset() {
95
+ return this.fallback.reset();
96
+ }
97
+ }
98
+ function Ht(e, t, r) {
99
+ return r.storage === "server" ? new $t(e, t, r) : new Ct(e, t, r);
100
+ }
101
+ const It = '/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-600:oklch(57.7% .245 27.325);--color-red-700:oklch(50.5% .213 27.518);--color-emerald-100:oklch(95% .052 163.051);--color-emerald-500:oklch(69.6% .17 162.48);--color-emerald-700:oklch(50.8% .118 165.612);--color-slate-950:oklch(12.9% .042 264.695);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-gray-900:oklch(21% .034 264.665);--color-black:#000;--color-white:#fff;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-normal:0em;--tracking-wide:.025em;--tracking-wider:.05em;--leading-tight:1.25;--leading-snug:1.375;--leading-relaxed:1.625;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--radius-3xl:1.5rem;--animate-spin:spin 1s linear infinite;--animate-ping:ping 1s cubic-bezier(0, 0, .2, 1) infinite;--blur-sm:8px;--blur-md:12px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}:host{all:initial;color-scheme:light;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizelegibility;font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,sans-serif}*,:before,:after{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;box-sizing:border-box}button{cursor:pointer;font-family:inherit}button:disabled{cursor:not-allowed}[role=button],[role=radio]{cursor:pointer}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing) * 0)}.-top-2{top:calc(var(--spacing) * -2)}.-top-\\[9px\\]{top:-9px}.-top-\\[10px\\]{top:-10px}.top-1\\/2{top:50%}.top-3{top:calc(var(--spacing) * 3)}.top-4{top:calc(var(--spacing) * 4)}.-right-\\[6px\\]{right:-6px}.right-3{right:calc(var(--spacing) * 3)}.right-4{right:calc(var(--spacing) * 4)}.left-1\\/2{left:50%}.z-10{z-index:10}.z-\\[1\\]{z-index:1}.z-\\[2147483647\\]{z-index:2147483647}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mx-auto{margin-inline:auto}.-mt-3{margin-top:calc(var(--spacing) * -3)}.mt-0\\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-1\\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-2\\.5{margin-top:calc(var(--spacing) * 2.5)}.mt-3{margin-top:calc(var(--spacing) * 3)}.-mb-2{margin-bottom:calc(var(--spacing) * -2)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.-ml-1{margin-left:calc(var(--spacing) * -1)}.ml-2{margin-left:calc(var(--spacing) * 2)}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.h-1{height:calc(var(--spacing) * 1)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-6\\.5{height:calc(var(--spacing) * 6.5)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-10{height:calc(var(--spacing) * 10)}.h-11{height:calc(var(--spacing) * 11)}.h-12{height:calc(var(--spacing) * 12)}.h-14{height:calc(var(--spacing) * 14)}.h-\\[22px\\]{height:22px}.h-full{height:100%}.h-px{height:1px}.max-h-\\[calc\\(100dvh-1rem\\)\\]{max-height:calc(100dvh - 1rem)}.min-h-0{min-height:calc(var(--spacing) * 0)}.min-h-12{min-height:calc(var(--spacing) * 12)}.min-h-\\[2\\.4em\\]{min-height:2.4em}.min-h-\\[120px\\]{min-height:120px}.w-1{width:calc(var(--spacing) * 1)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-6\\.5{width:calc(var(--spacing) * 6.5)}.w-7{width:calc(var(--spacing) * 7)}.w-8{width:calc(var(--spacing) * 8)}.w-11{width:calc(var(--spacing) * 11)}.w-12{width:calc(var(--spacing) * 12)}.w-14{width:calc(var(--spacing) * 14)}.w-full{width:100%}.max-w-\\[18rem\\]{max-width:18rem}.max-w-\\[20rem\\]{max-width:20rem}.max-w-\\[75\\%\\]{max-width:75%}.max-w-\\[320px\\]{max-width:320px}.max-w-\\[360px\\]{max-width:360px}.max-w-\\[400px\\]{max-width:400px}.flex-1{flex:1}.flex-shrink-0{flex-shrink:0}.-translate-x-1\\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-\\[pw-fade-in_180ms_ease-out\\]{animation:.18s ease-out pw-fade-in}.animate-\\[pw-scale-in_220ms_cubic-bezier\\(0\\.16\\,1\\,0\\.3\\,1\\)\\]{animation:.22s cubic-bezier(.16,1,.3,1) pw-scale-in}.animate-ping{animation:var(--animate-ping)}.animate-spin{animation:var(--animate-spin)}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.flex-col{flex-direction:column}.flex-row-reverse{flex-direction:row-reverse}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-start{align-items:flex-start}.items-stretch{align-items:stretch}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.justify-start{justify-content:flex-start}.gap-0\\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-x-1\\.5{column-gap:calc(var(--spacing) * 1.5)}.gap-x-2{column-gap:calc(var(--spacing) * 2)}.gap-y-1{row-gap:calc(var(--spacing) * 1)}.self-center{align-self:center}.self-start{align-self:flex-start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-3xl{border-radius:var(--radius-3xl)}.rounded-\\[9px\\]{border-radius:9px}.rounded-\\[11px\\]{border-radius:11px}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-t-xl{border-top-left-radius:var(--radius-xl);border-top-right-radius:var(--radius-xl)}.rounded-tl-xl{border-top-left-radius:var(--radius-xl)}.rounded-tr-xl{border-top-right-radius:var(--radius-xl)}.rounded-b-none{border-bottom-right-radius:0;border-bottom-left-radius:0}.border,.border-1{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-\\[2\\.5px\\]{border-style:var(--tw-border-style);border-width:2.5px}.border-\\[3px\\]{border-style:var(--tw-border-style);border-width:3px}.border-\\[5px\\]{border-style:var(--tw-border-style);border-width:5px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b,.border-b-1{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-\\[var\\(--pw-accent\\)\\]{border-color:var(--pw-accent)}.border-gray-100{border-color:var(--color-gray-100)}.border-gray-200{border-color:var(--color-gray-200)}.border-gray-300{border-color:var(--color-gray-300)}.border-white{border-color:var(--color-white)}.border-white\\/40{border-color:#fff6}@supports (color:color-mix(in lab,red,red)){.border-white\\/40{border-color:color-mix(in oklab,var(--color-white) 40%,transparent)}}.border-t-\\[var\\(--pw-accent\\)\\]{border-top-color:var(--pw-accent)}.border-t-gray-700{border-top-color:var(--color-gray-700)}.border-t-white{border-top-color:var(--color-white)}.bg-\\[color-mix\\(in_srgb\\,var\\(--pw-accent\\)_6\\%\\,white\\)\\]{background-color:var(--pw-accent)}@supports (color:color-mix(in lab,red,red)){.bg-\\[color-mix\\(in_srgb\\,var\\(--pw-accent\\)_6\\%\\,white\\)\\]{background-color:color-mix(in srgb,var(--pw-accent) 6%,white)}}.bg-\\[var\\(--pw-accent\\)\\]{background-color:var(--pw-accent)}.bg-black\\/20{background-color:#0003}@supports (color:color-mix(in lab,red,red)){.bg-black\\/20{background-color:color-mix(in oklab,var(--color-black) 20%,transparent)}}.bg-emerald-100{background-color:var(--color-emerald-100)}.bg-gray-50{background-color:var(--color-gray-50)}.bg-gray-50\\/60{background-color:#f9fafb99}@supports (color:color-mix(in lab,red,red)){.bg-gray-50\\/60{background-color:color-mix(in oklab,var(--color-gray-50) 60%,transparent)}}.bg-gray-100{background-color:var(--color-gray-100)}.bg-gray-200{background-color:var(--color-gray-200)}.bg-gray-300{background-color:var(--color-gray-300)}.bg-gray-900{background-color:var(--color-gray-900)}.bg-red-50{background-color:var(--color-red-50)}.bg-slate-950\\/50{background-color:#02061880}@supports (color:color-mix(in lab,red,red)){.bg-slate-950\\/50{background-color:color-mix(in oklab,var(--color-slate-950) 50%,transparent)}}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-white\\/80{background-color:#fffc}@supports (color:color-mix(in lab,red,red)){.bg-white\\/80{background-color:color-mix(in oklab,var(--color-white) 80%,transparent)}}.p-2{padding:calc(var(--spacing) * 2)}.p-3\\.5{padding:calc(var(--spacing) * 3.5)}.p-4{padding:calc(var(--spacing) * 4)}.p-6{padding:calc(var(--spacing) * 6)}.p-8{padding:calc(var(--spacing) * 8)}.px-1\\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.px-8{padding-inline:calc(var(--spacing) * 8)}.py-0\\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-1\\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-3\\.5{padding-block:calc(var(--spacing) * 3.5)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-12{padding-block:calc(var(--spacing) * 12)}.pt-1{padding-top:calc(var(--spacing) * 1)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-3\\.5{padding-top:calc(var(--spacing) * 3.5)}.pt-6{padding-top:calc(var(--spacing) * 6)}.pr-10{padding-right:calc(var(--spacing) * 10)}.pr-12{padding-right:calc(var(--spacing) * 12)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pb-3\\.5{padding-bottom:calc(var(--spacing) * 3.5)}.pb-4{padding-bottom:calc(var(--spacing) * 4)}.pb-5{padding-bottom:calc(var(--spacing) * 5)}.pb-6{padding-bottom:calc(var(--spacing) * 6)}.pl-5{padding-left:calc(var(--spacing) * 5)}.text-center{text-align:center}.text-left{text-align:left}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\[0\\.9375rem\\]{font-size:.9375rem}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.text-\\[12px\\]{font-size:12px}.text-\\[13px\\]{font-size:13px}.text-\\[15px\\]{font-size:15px}.text-\\[22px\\]{font-size:22px}.text-\\[26px\\]{font-size:26px}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-snug{--tw-leading:var(--leading-snug);line-height:var(--leading-snug)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-normal{--tw-tracking:var(--tracking-normal);letter-spacing:var(--tracking-normal)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.text-balance{text-wrap:balance}.whitespace-nowrap{white-space:nowrap}.text-\\[var\\(--pw-accent\\)\\]{color:var(--pw-accent)}.text-emerald-500{color:var(--color-emerald-500)}.text-emerald-700{color:var(--color-emerald-700)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-700{color:var(--color-gray-700)}.text-gray-800{color:var(--color-gray-800)}.text-gray-800\\/70{color:#1e2939b3}@supports (color:color-mix(in lab,red,red)){.text-gray-800\\/70{color:color-mix(in oklab,var(--color-gray-800) 70%,transparent)}}.text-gray-900{color:var(--color-gray-900)}.text-red-600{color:var(--color-red-600)}.text-red-700{color:var(--color-red-700)}.text-transparent{color:#0000}.text-white{color:var(--color-white)}.capitalize{text-transform:capitalize}.uppercase{text-transform:uppercase}.line-through{text-decoration-line:line-through}.underline{text-decoration-line:underline}.decoration-gray-400{-webkit-text-decoration-color:var(--color-gray-400);text-decoration-color:var(--color-gray-400)}.decoration-\\[1\\.5px\\]{text-decoration-thickness:1.5px}.underline-offset-2{text-underline-offset:2px}.opacity-0{opacity:0}.opacity-40{opacity:.4}.opacity-60{opacity:.6}.opacity-90{opacity:.9}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\\[0_0_0_2px_rgba\\(239\\,68\\,68\\,0\\.5\\)\\]{--tw-shadow:0 0 0 2px var(--tw-shadow-color,#ef444480);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-8{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(8px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.\\!filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)!important}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-blur-md{--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.outline-none{--tw-outline-style:none;outline-style:none}.placeholder\\:text-gray-500::placeholder{color:var(--color-gray-500)}@media(hover:hover){.hover\\:-translate-y-px:hover{--tw-translate-y:-1px;translate:var(--tw-translate-x) var(--tw-translate-y)}.hover\\:border-gray-300:hover{border-color:var(--color-gray-300)}.hover\\:border-gray-400:hover{border-color:var(--color-gray-400)}.hover\\:bg-gray-50:hover{background-color:var(--color-gray-50)}.hover\\:bg-gray-50\\/60:hover{background-color:#f9fafb99}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-gray-50\\/60:hover{background-color:color-mix(in oklab,var(--color-gray-50) 60%,transparent)}}.hover\\:bg-gray-100:hover{background-color:var(--color-gray-100)}.hover\\:bg-gray-200\\/60:hover{background-color:#e5e7eb99}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-gray-200\\/60:hover{background-color:color-mix(in oklab,var(--color-gray-200) 60%,transparent)}}.hover\\:bg-white:hover{background-color:var(--color-white)}.hover\\:text-gray-700:hover{color:var(--color-gray-700)}.hover\\:text-gray-900:hover{color:var(--color-gray-900)}.hover\\:text-red-600:hover{color:var(--color-red-600)}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:opacity-80:hover{opacity:.8}.hover\\:opacity-90:hover{opacity:.9}.hover\\:brightness-105:hover{--tw-brightness:brightness(105%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}}.focus\\:bg-gray-200\\/60:focus{background-color:#e5e7eb99}@supports (color:color-mix(in lab,red,red)){.focus\\:bg-gray-200\\/60:focus{background-color:color-mix(in oklab,var(--color-gray-200) 60%,transparent)}}.focus\\:shadow-\\[0_0_0_2px_color-mix\\(in_srgb\\,var\\(--pw-accent\\)_30\\%\\,transparent\\)\\]:focus{--tw-shadow:0 0 0 2px var(--tw-shadow-color,var(--pw-accent))}@supports (color:color-mix(in lab,red,red)){.focus\\:shadow-\\[0_0_0_2px_color-mix\\(in_srgb\\,var\\(--pw-accent\\)_30\\%\\,transparent\\)\\]:focus{--tw-shadow:0 0 0 2px var(--tw-shadow-color,color-mix(in srgb,var(--pw-accent) 30%,transparent))}}.focus\\:shadow-\\[0_0_0_2px_color-mix\\(in_srgb\\,var\\(--pw-accent\\)_30\\%\\,transparent\\)\\]:focus{box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\\:opacity-80:focus-visible{opacity:.8}.focus-visible\\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\\:ring-\\[var\\(--pw-accent\\)\\]:focus-visible{--tw-ring-color:var(--pw-accent)}.focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.focus-visible\\:ring-inset:focus-visible{--tw-ring-inset:inset}.active\\:scale-\\[0\\.98\\]:active{scale:.98}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-60:disabled{opacity:.6}@media(hover:hover){.disabled\\:hover\\:translate-y-0:disabled:hover{--tw-translate-y:calc(var(--spacing) * 0);translate:var(--tw-translate-x) var(--tw-translate-y)}.disabled\\:hover\\:brightness-100:disabled:hover{--tw-brightness:brightness(100%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}}@media(min-width:40rem){.sm\\:max-h-\\[calc\\(100dvh-2rem\\)\\]{max-height:calc(100dvh - 2rem)}.sm\\:p-4{padding:calc(var(--spacing) * 4)}.sm\\:p-8{padding:calc(var(--spacing) * 8)}.sm\\:px-8{padding-inline:calc(var(--spacing) * 8)}.sm\\:pt-8{padding-top:calc(var(--spacing) * 8)}.sm\\:pb-4{padding-bottom:calc(var(--spacing) * 4)}.sm\\:text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}}}.pw-cta-shimmer:before{content:"";z-index:1;background:linear-gradient(90deg,#0000,#ffffff59 50%,#0000);width:100%;height:100%;animation:3s infinite pw-cta-shimmer;position:absolute;top:0;left:-100%}@keyframes pw-cta-shimmer{0%{left:-100%}to{left:100%}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}@keyframes ping{75%,to{opacity:0;transform:scale(2)}}';
102
+ let gt = !1;
103
+ function Gt() {
104
+ if (gt || (gt = !0, typeof CSS > "u" || typeof CSS.registerProperty != "function")) return;
105
+ let e;
106
+ try {
107
+ const t = new CSSStyleSheet();
108
+ t.replaceSync(It), e = t.cssRules;
109
+ } catch {
110
+ return;
111
+ }
112
+ for (const t of e) {
113
+ if (t.constructor.name !== "CSSPropertyRule") continue;
114
+ const r = t;
115
+ try {
116
+ CSS.registerProperty({
117
+ name: r.name,
118
+ syntax: r.syntax,
119
+ inherits: r.inherits,
120
+ ...r.initialValue != null ? { initialValue: r.initialValue } : {}
121
+ });
122
+ } catch {
123
+ }
124
+ }
125
+ }
126
+ function qt(e, t, r = {}) {
127
+ if (typeof document > "u")
128
+ throw new Error("mountShadow called in non-DOM environment");
129
+ Gt();
130
+ const a = r.host ?? document.createElement("div");
131
+ a.setAttribute("data-paywall-host", ""), a.style.cssText = r.inline ? "all: initial; position: absolute; inset: 0; z-index: 1; pointer-events: none;" : "all: initial; position: fixed; inset: 0; z-index: 2147483647; pointer-events: none;", !a.isConnected && !r.inline && document.body.appendChild(a);
132
+ const n = a.attachShadow({ mode: r.shadowMode ?? "closed" }), o = `
133
+ :host {
134
+ all: initial !important;
135
+ display: block !important;
136
+ color: #111827 !important;
137
+ font-family: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif !important;
138
+ font-size: 16px !important;
139
+ font-weight: 400 !important;
140
+ font-style: normal !important;
141
+ line-height: 1.5 !important;
142
+ letter-spacing: normal !important;
143
+ text-transform: none !important;
144
+ text-decoration: none !important;
145
+ text-align: left !important;
146
+ direction: ltr !important;
147
+ cursor: auto !important;
148
+ visibility: visible !important;
149
+ }
150
+ `, s = document.createElement("style");
151
+ s.textContent = o + It + (r.injectCss ?? ""), n.appendChild(s);
152
+ const l = document.createElement("div");
153
+ l.style.pointerEvents = "auto", n.appendChild(l);
154
+ let p = t;
155
+ return Z(ut(e, p), l), {
156
+ shadowRoot: n,
157
+ update(d) {
158
+ p = { ...p, ...d }, Z(ut(e, p), l);
159
+ },
160
+ unmount() {
161
+ Z(null, l), a.remove();
162
+ }
163
+ };
164
+ }
165
+ const Wt = (e, t, r) => {
166
+ const a = e[t];
167
+ return a ? typeof a == "function" ? a() : Promise.resolve(a) : new Promise((n, o) => {
168
+ (typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(
169
+ o.bind(
170
+ null,
171
+ new Error(
172
+ "Unknown variable dynamic import: " + t + (t.split("/").length !== r ? ". Note that variables only represent file names one level deep." : "")
173
+ )
174
+ )
175
+ );
176
+ });
177
+ }, Zt = [
178
+ "ru",
179
+ "uk",
180
+ "de",
181
+ "es",
182
+ "fr",
183
+ "it",
184
+ "pt",
185
+ "pl",
186
+ "cs",
187
+ "hu",
188
+ "ro",
189
+ "nl",
190
+ "sv",
191
+ "da",
192
+ "no",
193
+ "fi",
194
+ "el",
195
+ "tr",
196
+ "id",
197
+ "ar",
198
+ "ja",
199
+ "ko",
200
+ "zh",
201
+ "hi",
202
+ "th",
203
+ "vi",
204
+ "he"
205
+ ], At = (e, t, r) => Lt(t, r), Mt = Dt({ t: At, locale: "en" });
206
+ function Lt(e, t) {
207
+ if (!t) return e;
208
+ let r = e;
209
+ for (const [a, n] of Object.entries(t))
210
+ r = r.split(`{${a}}`).join(String(n));
211
+ return r;
212
+ }
213
+ const X = /* @__PURE__ */ new Map(), J = /* @__PURE__ */ new Map();
214
+ function Kt(e) {
215
+ return Zt.includes(e);
216
+ }
217
+ function Yt(e) {
218
+ const t = [];
219
+ if (typeof navigator < "u" && navigator.language) {
220
+ t.push(navigator.language);
221
+ const a = navigator.language.split("-")[0];
222
+ a && a !== navigator.language && t.push(a);
223
+ }
224
+ const r = e.settings.locale_default;
225
+ if (r) {
226
+ t.push(r);
227
+ const a = r.split("-")[0];
228
+ a && a !== r && t.push(a);
229
+ }
230
+ for (const a of t)
231
+ if (Kt(a)) return a;
232
+ return null;
233
+ }
234
+ function Xt(e) {
235
+ return !!e.locales && Object.keys(e.locales).length > 0;
236
+ }
237
+ async function Jt(e) {
238
+ const t = X.get(e);
239
+ if (t) return t;
240
+ const r = J.get(e);
241
+ if (r) return r;
242
+ const a = Wt(/* @__PURE__ */ Object.assign({ "./locales/ar.ts": () => import("./ar-BCHXVoE2.js"), "./locales/cs.ts": () => import("./cs-B5NqpTW_.js"), "./locales/da.ts": () => import("./da-BJrGZ3LD.js"), "./locales/de.ts": () => import("./de-aepBKwsb.js"), "./locales/el.ts": () => import("./el-DTLQoX2D.js"), "./locales/es.ts": () => import("./es-CLutF-D_.js"), "./locales/fi.ts": () => import("./fi-DZ4csxqk.js"), "./locales/fr.ts": () => import("./fr-jJU1SSpj.js"), "./locales/he.ts": () => import("./he-D9obGPNj.js"), "./locales/hi.ts": () => import("./hi-pM8SQwZ3.js"), "./locales/hu.ts": () => import("./hu-E0m9WgbD.js"), "./locales/id.ts": () => import("./id-C6poPvby.js"), "./locales/it.ts": () => import("./it-B2RSFyVd.js"), "./locales/ja.ts": () => import("./ja-CM-VgVG6.js"), "./locales/ko.ts": () => import("./ko-C451fA21.js"), "./locales/nl.ts": () => import("./nl-DzQfJPo2.js"), "./locales/no.ts": () => import("./no-B51be8KT.js"), "./locales/pl.ts": () => import("./pl-5rTEkvfY.js"), "./locales/pt.ts": () => import("./pt-JwqffZ9u.js"), "./locales/ro.ts": () => import("./ro-BE_wJ1td.js"), "./locales/ru.ts": () => import("./ru-BviATvLb.js"), "./locales/sv.ts": () => import("./sv-DabGF9WL.js"), "./locales/th.ts": () => import("./th-BiF-bNo0.js"), "./locales/tr.ts": () => import("./tr-xZuly8X8.js"), "./locales/uk.ts": () => import("./uk-KlkAaHuy.js"), "./locales/vi.ts": () => import("./vi-BVCeumNE.js"), "./locales/zh.ts": () => import("./zh-C_ghwmqi.js") }), `./locales/${e}.ts`, 3).then((n) => {
243
+ const o = n.default ?? {};
244
+ return X.set(e, o), o;
245
+ }).catch((n) => {
246
+ console.warn(`[paywall] failed to load locale chunk "${e}"`, n);
247
+ const o = {};
248
+ return X.set(e, o), o;
249
+ }).finally(() => {
250
+ J.delete(e);
251
+ });
252
+ return J.set(e, a), a;
253
+ }
254
+ function Qt({ bootstrap: e, children: t }) {
255
+ const [r, a] = b("en"), [n, o] = b(null);
256
+ T(() => {
257
+ if (!e || !Xt(e)) return;
258
+ const l = Yt(e);
259
+ if (!l || l === r && n) return;
260
+ let p = !1;
261
+ return Jt(l).then((d) => {
262
+ p || (a(l), o(d));
263
+ }), () => {
264
+ p = !0;
265
+ };
266
+ }, [e]);
267
+ const s = {
268
+ locale: r,
269
+ t: n ? (l, p, d) => Lt(n[l] ?? p, d) : At
270
+ };
271
+ return /* @__PURE__ */ i(Mt.Provider, { value: s, children: t });
272
+ }
273
+ function v() {
274
+ return Nt(Mt);
275
+ }
276
+ const ft = 'a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';
277
+ function te({
278
+ open: e,
279
+ onClose: t,
280
+ labelledBy: r,
281
+ brandColor: a,
282
+ topBanner: n,
283
+ allowClose: o = !0,
284
+ hideCloseButton: s = !1,
285
+ inline: l = !1,
286
+ children: p
287
+ }) {
288
+ const { t: d } = v(), g = O(null), h = O(null);
289
+ return T(() => {
290
+ if (!e) return;
291
+ h.current = document.activeElement ?? null;
292
+ const y = g.current;
293
+ y && (y.querySelector(ft) ?? y).focus({ preventScroll: !0 });
294
+ const B = (k) => {
295
+ if (k.key === "Escape") {
296
+ if (!o) return;
297
+ k.stopPropagation(), t();
298
+ return;
299
+ }
300
+ if (k.key !== "Tab" || !g.current) return;
301
+ const A = Array.from(
302
+ g.current.querySelectorAll(ft)
303
+ ).filter((E) => !E.hasAttribute("disabled") && E.tabIndex !== -1);
304
+ if (A.length === 0) {
305
+ k.preventDefault();
306
+ return;
307
+ }
308
+ const C = A[0], j = A[A.length - 1], z = document.activeElement;
309
+ k.shiftKey && z === C ? (k.preventDefault(), j.focus()) : !k.shiftKey && z === j && (k.preventDefault(), C.focus());
310
+ };
311
+ document.addEventListener("keydown", B, !0);
312
+ const P = document.body.style.overflow;
313
+ return l || (document.body.style.overflow = "hidden"), () => {
314
+ document.removeEventListener("keydown", B, !0), l || (document.body.style.overflow = P), h.current?.focus?.({ preventScroll: !0 });
315
+ };
316
+ }, [e, t, o, l]), e ? /* @__PURE__ */ c(
317
+ "div",
318
+ {
319
+ class: `${l ? "absolute z-[1]" : "fixed z-[2147483647]"} inset-0 flex items-center justify-center bg-slate-950/50 p-2 sm:p-4 backdrop-blur-md animate-[pw-fade-in_180ms_ease-out]`,
320
+ onClick: (y) => {
321
+ o && y.target === y.currentTarget && t();
322
+ },
323
+ "data-pw-root": !0,
324
+ children: [
325
+ /* @__PURE__ */ c(
326
+ "div",
327
+ {
328
+ class: "relative flex w-full max-w-[400px] flex-col animate-[pw-scale-in_220ms_cubic-bezier(0.16,1,0.3,1)]",
329
+ style: { "--pw-accent": a ?? "#3b82f6" },
330
+ children: [
331
+ n,
332
+ /* @__PURE__ */ c(
333
+ "div",
334
+ {
335
+ ref: g,
336
+ role: "dialog",
337
+ "aria-modal": "true",
338
+ "aria-labelledby": r,
339
+ tabIndex: -1,
340
+ class: "relative flex max-h-[calc(100dvh-1rem)] sm:max-h-[calc(100dvh-2rem)] w-full flex-col overflow-hidden rounded-xl bg-white outline-none",
341
+ style: {
342
+ boxShadow: "0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1)"
343
+ },
344
+ children: [
345
+ p,
346
+ o && !s ? /* @__PURE__ */ i(
347
+ "button",
348
+ {
349
+ type: "button",
350
+ onClick: t,
351
+ "aria-label": d("modal.close_aria", "Close"),
352
+ class: "absolute right-3 top-3 z-10 flex h-8 w-8 items-center justify-center rounded-full bg-white/80 text-gray-500 backdrop-blur-sm transition-colors hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",
353
+ children: /* @__PURE__ */ i("svg", { width: "14", height: "14", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ i(
354
+ "path",
355
+ {
356
+ d: "M3 3l10 10M13 3L3 13",
357
+ stroke: "currentColor",
358
+ "stroke-width": "1.75",
359
+ "stroke-linecap": "round"
360
+ }
361
+ ) })
362
+ }
363
+ ) : null
364
+ ]
365
+ }
366
+ )
367
+ ]
368
+ }
369
+ ),
370
+ /* @__PURE__ */ i("style", { children: `
371
+ @keyframes pw-fade-in { from { opacity: 0 } to { opacity: 1 } }
372
+ @keyframes pw-scale-in {
373
+ from { opacity: 0; transform: translateY(12px) scale(0.96) }
374
+ to { opacity: 1; transform: none }
375
+ }
376
+ ` })
377
+ ]
378
+ }
379
+ ) : null;
380
+ }
381
+ function ee(e, t) {
382
+ switch (e) {
383
+ case "google":
384
+ return t("auth.continue_with_google", "Continue with Google");
385
+ case "apple":
386
+ return t("auth.continue_with_apple", "Continue with Apple");
387
+ case "github":
388
+ return t("auth.continue_with_github", "Continue with GitHub");
389
+ case "facebook":
390
+ return t("auth.continue_with_facebook", "Continue with Facebook");
391
+ }
392
+ }
393
+ function Pt({ block: e, ctx: t }) {
394
+ const r = t.auth, a = t.authSession, n = e.allow_signup !== !1, o = e.allow_password_reset !== !1, s = e.hide_when_authenticated !== !1;
395
+ if (!r)
396
+ return typeof console < "u" && console.warn("[paywall] auth_panel rendered without AuthClient — pass `auth: true` to PaywallUI"), null;
397
+ const l = a && !a.user.is_anonymous ? a : null;
398
+ return l && s ? null : l ? /* @__PURE__ */ i(re, { email: l.user.email ?? "", onSignOut: () => r.signOut().catch(() => {
399
+ }) }) : /* @__PURE__ */ i(
400
+ ie,
401
+ {
402
+ block: e,
403
+ allowSignup: n,
404
+ allowReset: o,
405
+ ctx: t
406
+ }
407
+ );
408
+ }
409
+ function re({ email: e, onSignOut: t }) {
410
+ const { t: r } = v();
411
+ return /* @__PURE__ */ c("div", { class: "flex items-center justify-between gap-3 rounded-2xl bg-gray-100 px-4 py-3", children: [
412
+ /* @__PURE__ */ c("div", { class: "flex flex-col", children: [
413
+ /* @__PURE__ */ i("span", { class: "text-[10px] font-semibold uppercase tracking-wider text-gray-500", children: r("auth.signed_in", "Signed in") }),
414
+ /* @__PURE__ */ i("span", { class: "text-sm font-medium text-gray-900", children: e })
415
+ ] }),
416
+ /* @__PURE__ */ i(
417
+ "button",
418
+ {
419
+ type: "button",
420
+ onClick: t,
421
+ class: "rounded-md px-1.5 py-0.5 text-xs font-medium text-gray-600 transition-colors hover:bg-white hover:text-gray-900 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",
422
+ children: r("auth.sign_out", "Sign out")
423
+ }
424
+ )
425
+ ] });
426
+ }
427
+ function ie({ block: e, allowSignup: t, allowReset: r, ctx: a }) {
428
+ const { t: n } = v(), o = a.auth, s = e.providers ?? [], [l, p] = b("signin"), [d, g] = b(""), [h, x] = b(""), [u, m] = b(""), [y, B] = b(""), [P, k] = b(null), [A, C] = b(null), [j, z] = b(null), [E, D] = b(!1), [F, U] = b(null);
429
+ T(() => {
430
+ if (typeof o.getLastLogin != "function") return;
431
+ let S = !1;
432
+ return o.getLastLogin().then(
433
+ (L) => {
434
+ S || !L || (U(L), L.email && g((V) => V === "" ? L.email : V));
435
+ },
436
+ () => {
437
+ }
438
+ ), () => {
439
+ S = !0;
440
+ };
441
+ }, [o]);
442
+ const M = (S) => {
443
+ p(S), C(null), z(null), D(!1);
444
+ }, I = async (S) => {
445
+ if (S.preventDefault(), !P) {
446
+ if (C(null), z(null), l === "signup" && !E) {
447
+ if (!d.trim()) return;
448
+ D(!0);
449
+ return;
450
+ }
451
+ if (l === "signup" && h !== u) {
452
+ C(n("auth.passwords_mismatch", "Passwords don't match"));
453
+ return;
454
+ }
455
+ k("email");
456
+ try {
457
+ l === "signin" ? await o.signInWithEmail({ email: d, password: h }) : l === "signup" ? (await o.signUp({ email: d, password: h })).kind === "confirmation_required" && (p("reset_verify"), z(n("auth.check_email_message", "Check your email for a confirmation code."))) : l === "forgot" ? (await o.requestPasswordReset({ email: d }), p("reset_sent"), z(
458
+ n("auth.reset_sent_message", "If that email exists, a reset code has been sent.")
459
+ )) : l === "reset_verify" && (await o.verifyOtp({
460
+ email: d,
461
+ token: y,
462
+ type: h ? "recovery" : "email"
463
+ }), h && await o.updatePassword({ password: h }));
464
+ } catch (L) {
465
+ const V = L instanceof R ? L.message : n("auth.generic_error", "Something went wrong");
466
+ C(V);
467
+ } finally {
468
+ k(null);
469
+ }
470
+ }
471
+ }, w = async (S) => {
472
+ if (!P) {
473
+ k(S), C(null), z(null);
474
+ try {
475
+ await o.signInWithOAuth({
476
+ provider: S,
477
+ onPopupOpened: () => k(null)
478
+ });
479
+ } catch (L) {
480
+ if (L instanceof R) {
481
+ if (L.code === "oauth_cancelled" || L.code === "oauth_timeout") return;
482
+ C(L.message);
483
+ } else
484
+ C(n("auth.signin_failed", "Sign-in failed"));
485
+ } finally {
486
+ k(null);
487
+ }
488
+ }
489
+ }, f = s.length > 0 && (l === "signin" || l === "signup"), _ = l === "signin" || l === "signup" || l === "forgot", W = l === "signin" || l === "signup" && E;
490
+ return /* @__PURE__ */ c("div", { class: "flex flex-col gap-5", children: [
491
+ /* @__PURE__ */ i(ne, { mode: l, customHeading: e.heading, customSubheading: e.subheading }),
492
+ f ? /* @__PURE__ */ c("div", { class: "flex flex-col gap-2.5", children: [
493
+ s.map((S) => /* @__PURE__ */ c("div", { class: "relative", children: [
494
+ /* @__PURE__ */ c(
495
+ "button",
496
+ {
497
+ type: "button",
498
+ onClick: () => w(S),
499
+ disabled: P !== null,
500
+ class: "flex h-12 w-full items-center justify-center gap-2.5 rounded-full border-1 border-gray-200 bg-white px-5 text-base font-medium text-gray-900 transition-all hover:border-gray-300 hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-60 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",
501
+ children: [
502
+ P === S ? /* @__PURE__ */ i("span", { class: "inline-block h-4 w-4 animate-spin rounded-full border-2 border-gray-300 border-t-gray-700" }) : /* @__PURE__ */ i(he, { provider: S }),
503
+ /* @__PURE__ */ i("span", { children: ee(S, n) })
504
+ ]
505
+ }
506
+ ),
507
+ F?.method === S ? /* @__PURE__ */ i(mt, { email: F.email }) : null
508
+ ] }, S)),
509
+ /* @__PURE__ */ i(pe, {})
510
+ ] }) : null,
511
+ /* @__PURE__ */ c("form", { onSubmit: I, class: "flex flex-col gap-3", children: [
512
+ _ && /* @__PURE__ */ i(
513
+ wt,
514
+ {
515
+ type: "email",
516
+ placeholder: n("auth.email", "Email address"),
517
+ value: d,
518
+ onInput: g,
519
+ autocomplete: "email",
520
+ required: !0
521
+ }
522
+ ),
523
+ W && /* @__PURE__ */ i(
524
+ Q,
525
+ {
526
+ placeholder: n("auth.password", "Password"),
527
+ value: h,
528
+ onInput: x,
529
+ autocomplete: l === "signin" ? "current-password" : "new-password",
530
+ required: !0
531
+ }
532
+ ),
533
+ l === "signup" && E && /* @__PURE__ */ i(
534
+ Q,
535
+ {
536
+ placeholder: n("auth.repeat_password", "Repeat password"),
537
+ value: u,
538
+ onInput: m,
539
+ autocomplete: "new-password",
540
+ required: !0
541
+ }
542
+ ),
543
+ l === "reset_verify" && /* @__PURE__ */ c(q, { children: [
544
+ /* @__PURE__ */ i(
545
+ wt,
546
+ {
547
+ type: "text",
548
+ placeholder: n("auth.confirmation_code", "Confirmation code"),
549
+ value: y,
550
+ onInput: B,
551
+ autocomplete: "one-time-code",
552
+ inputMode: "numeric",
553
+ required: !0
554
+ }
555
+ ),
556
+ /* @__PURE__ */ i(
557
+ Q,
558
+ {
559
+ placeholder: n(
560
+ "auth.new_password_optional",
561
+ "New password (optional — only for password reset)"
562
+ ),
563
+ value: h,
564
+ onInput: x,
565
+ autocomplete: "new-password"
566
+ }
567
+ )
568
+ ] }),
569
+ l === "reset_sent" && j && /* @__PURE__ */ i("p", { class: "rounded-2xl bg-gray-100 px-4 py-3 text-sm text-gray-600", children: j }),
570
+ l === "signin" && r && /* @__PURE__ */ i("div", { class: "flex justify-end text-sm", children: /* @__PURE__ */ i(G, { onClick: () => M("forgot"), children: n("auth.forgot_password", "Forgot password?") }) }),
571
+ A && /* @__PURE__ */ i("p", { class: "text-sm text-red-600", children: A }),
572
+ j && l !== "reset_sent" && /* @__PURE__ */ i("p", { class: "text-sm text-gray-500", children: j }),
573
+ l !== "reset_sent" && /* @__PURE__ */ c("div", { class: "relative", children: [
574
+ /* @__PURE__ */ i(
575
+ le,
576
+ {
577
+ busy: P === "email",
578
+ label: oe(l, E, e.submit_label ?? e.heading, n)
579
+ }
580
+ ),
581
+ l === "signin" && F?.method === "email" ? /* @__PURE__ */ i(mt, { email: F.email }) : null
582
+ ] })
583
+ ] }),
584
+ /* @__PURE__ */ i(
585
+ se,
586
+ {
587
+ mode: l,
588
+ allowSignup: t,
589
+ onSwitch: M
590
+ }
591
+ )
592
+ ] });
593
+ }
594
+ function ne({
595
+ mode: e,
596
+ customHeading: t,
597
+ customSubheading: r
598
+ }) {
599
+ const { t: a } = v(), n = ae(e, a), o = e === "signin" || e === "signup", s = o && t ? t : n.title, l = o && r !== void 0 ? r || null : n.subtitle;
600
+ return /* @__PURE__ */ c("div", { class: "flex flex-col gap-2", children: [
601
+ /* @__PURE__ */ i("h2", { class: "text-3xl font-bold tracking-tight text-gray-900", children: s }),
602
+ l ? /* @__PURE__ */ i("p", { class: "text-base leading-relaxed text-gray-600", children: l }) : null
603
+ ] });
604
+ }
605
+ function ae(e, t) {
606
+ switch (e) {
607
+ case "signin":
608
+ return {
609
+ title: t("auth.welcome", "Welcome back!"),
610
+ subtitle: t("auth.default_subtitle", "Sign in to access all features and sync your data.")
611
+ };
612
+ case "signup":
613
+ return {
614
+ title: t("auth.welcome_signup", "Welcome!"),
615
+ subtitle: t("auth.default_subtitle", "Sign in to access all features and sync your data.")
616
+ };
617
+ case "forgot":
618
+ return {
619
+ title: t("auth.forgot_password_title", "Forgot password?"),
620
+ subtitle: t(
621
+ "auth.forgot_subtitle",
622
+ "Enter your email and we'll send you a password reset link."
623
+ )
624
+ };
625
+ case "reset_sent":
626
+ return {
627
+ title: t("auth.check_email_title", "Check your email"),
628
+ subtitle: null
629
+ };
630
+ case "reset_verify":
631
+ return {
632
+ title: t("auth.reset_password_title", "Reset password"),
633
+ subtitle: t(
634
+ "auth.reset_password_subtitle",
635
+ "Enter the code from your email and a new password."
636
+ )
637
+ };
638
+ }
639
+ }
640
+ function oe(e, t, r, a) {
641
+ if (e === "signin" && r) return r;
642
+ switch (e) {
643
+ case "signin":
644
+ return a("auth.log_in", "Sign In");
645
+ case "signup":
646
+ return t ? a("auth.create_account", "Create Account") : a("auth.sign_up", "Sign Up");
647
+ case "forgot":
648
+ return a("auth.send_reset", "Send Reset Email");
649
+ case "reset_verify":
650
+ return a("auth.verify", "Verify");
651
+ default:
652
+ return a("cta.continue", "Continue");
653
+ }
654
+ }
655
+ function se({
656
+ mode: e,
657
+ allowSignup: t,
658
+ onSwitch: r
659
+ }) {
660
+ const { t: a } = v();
661
+ return e === "signin" && t ? /* @__PURE__ */ c("p", { class: "text-center text-sm text-gray-600", children: [
662
+ a("auth.no_account", "Don't have an account?"),
663
+ " ",
664
+ /* @__PURE__ */ i(G, { onClick: () => r("signup"), children: a("auth.sign_up_link", "Sign Up") })
665
+ ] }) : e === "signup" ? /* @__PURE__ */ c("p", { class: "text-center text-sm text-gray-600", children: [
666
+ a("auth.have_account", "Already have an account?"),
667
+ " ",
668
+ /* @__PURE__ */ i(G, { onClick: () => r("signin"), children: a("auth.log_in_link", "Log In") })
669
+ ] }) : e === "forgot" || e === "reset_sent" || e === "reset_verify" ? /* @__PURE__ */ c("p", { class: "text-center text-sm text-gray-600", children: [
670
+ a("auth.no_account", "Don't have an account?"),
671
+ " ",
672
+ /* @__PURE__ */ i(G, { onClick: () => r("signup"), children: a("auth.sign_up_link", "Sign Up") })
673
+ ] }) : null;
674
+ }
675
+ function G({
676
+ onClick: e,
677
+ children: t
678
+ }) {
679
+ return /* @__PURE__ */ i(
680
+ "button",
681
+ {
682
+ type: "button",
683
+ onClick: e,
684
+ class: "font-semibold transition-opacity hover:opacity-80 focus:outline-none focus-visible:opacity-80",
685
+ style: { color: "var(--pw-accent)" },
686
+ children: t
687
+ }
688
+ );
689
+ }
690
+ function le({ busy: e, label: t }) {
691
+ return /* @__PURE__ */ i(
692
+ "button",
693
+ {
694
+ type: "submit",
695
+ disabled: e,
696
+ class: "pw-cta-shimmer relative mt-1 flex min-h-12 w-full items-center justify-center overflow-hidden rounded-3xl px-5 py-2 text-center text-base font-semibold leading-tight text-white transition-transform duration-150 active:scale-[0.98] disabled:cursor-not-allowed disabled:opacity-60 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",
697
+ style: {
698
+ background: "linear-gradient(135deg, color-mix(in srgb, var(--pw-accent) 55%, white) 0%, var(--pw-accent) 55%, color-mix(in srgb, var(--pw-accent) 90%, black) 100%)",
699
+ boxShadow: "0 0 20px 0 color-mix(in srgb, var(--pw-accent) 25%, transparent), inset 0 0 8px 0 color-mix(in srgb, white 25%, transparent)"
700
+ },
701
+ children: e ? /* @__PURE__ */ i("span", { class: "relative z-10 inline-block h-4 w-4 animate-spin rounded-full border-2 border-white/40 border-t-white" }) : /* @__PURE__ */ i("span", { class: "relative z-10", children: t })
702
+ }
703
+ );
704
+ }
705
+ function wt({ type: e, placeholder: t, value: r, onInput: a, autocomplete: n, inputMode: o, required: s }) {
706
+ return /* @__PURE__ */ i(
707
+ "input",
708
+ {
709
+ type: e,
710
+ value: r,
711
+ placeholder: t,
712
+ onInput: (l) => a(l.target.value),
713
+ autocomplete: n,
714
+ inputMode: o,
715
+ required: s,
716
+ class: "h-14 w-full rounded-2xl bg-gray-100 px-5 text-base text-gray-900 outline-none transition-all placeholder:text-gray-500 hover:bg-gray-200/60 focus:bg-gray-200/60 focus:shadow-[0_0_0_2px_color-mix(in_srgb,var(--pw-accent)_30%,transparent)]"
717
+ }
718
+ );
719
+ }
720
+ function Q({ placeholder: e, value: t, onInput: r, autocomplete: a, required: n }) {
721
+ const { t: o } = v(), [s, l] = b(!1), p = O(null);
722
+ T(() => {
723
+ const h = p.current;
724
+ h && h.value !== t && (h.value = t);
725
+ }, [s, t]);
726
+ const d = o("auth.show_password", "Show password"), g = o("auth.hide_password", "Hide password");
727
+ return /* @__PURE__ */ c("div", { class: "relative", children: [
728
+ /* @__PURE__ */ i(
729
+ "input",
730
+ {
731
+ ref: p,
732
+ type: s ? "text" : "password",
733
+ value: t,
734
+ placeholder: e,
735
+ onInput: (h) => r(h.target.value),
736
+ autocomplete: a,
737
+ required: n,
738
+ class: "h-14 w-full rounded-2xl bg-gray-100 pl-5 pr-12 text-base text-gray-900 outline-none transition-all placeholder:text-gray-500 hover:bg-gray-200/60 focus:bg-gray-200/60 focus:shadow-[0_0_0_2px_color-mix(in_srgb,var(--pw-accent)_30%,transparent)]"
739
+ }
740
+ ),
741
+ /* @__PURE__ */ i(
742
+ "button",
743
+ {
744
+ type: "button",
745
+ onClick: () => l((h) => !h),
746
+ "aria-label": s ? g : d,
747
+ tabIndex: -1,
748
+ class: "absolute right-4 top-1/2 -translate-y-1/2 flex h-6 w-6 items-center justify-center rounded text-gray-500 transition-colors hover:text-gray-700 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",
749
+ children: s ? /* @__PURE__ */ i(de, {}) : /* @__PURE__ */ i(ce, {})
750
+ }
751
+ )
752
+ ] });
753
+ }
754
+ function ce() {
755
+ return /* @__PURE__ */ c("svg", { width: "18", height: "18", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
756
+ /* @__PURE__ */ i(
757
+ "path",
758
+ {
759
+ d: "M1.667 10S4.583 4.167 10 4.167 18.333 10 18.333 10 15.417 15.833 10 15.833 1.667 10 1.667 10Z",
760
+ stroke: "currentColor",
761
+ "stroke-width": "1.5",
762
+ "stroke-linecap": "round",
763
+ "stroke-linejoin": "round"
764
+ }
765
+ ),
766
+ /* @__PURE__ */ i("circle", { cx: "10", cy: "10", r: "2.5", stroke: "currentColor", "stroke-width": "1.5" })
767
+ ] });
768
+ }
769
+ function de() {
770
+ return /* @__PURE__ */ c("svg", { width: "18", height: "18", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
771
+ /* @__PURE__ */ i(
772
+ "path",
773
+ {
774
+ d: "M8.236 4.293A6.96 6.96 0 0 1 10 4.167C15.417 4.167 18.333 10 18.333 10a13.5 13.5 0 0 1-1.92 2.755M11.768 11.768A2.5 2.5 0 0 1 8.233 8.233",
775
+ stroke: "currentColor",
776
+ "stroke-width": "1.5",
777
+ "stroke-linecap": "round",
778
+ "stroke-linejoin": "round"
779
+ }
780
+ ),
781
+ /* @__PURE__ */ i(
782
+ "path",
783
+ {
784
+ d: "M14.953 14.953A8.84 8.84 0 0 1 10 15.833C4.583 15.833 1.667 10 1.667 10a13.5 13.5 0 0 1 3.38-3.953M1.667 1.667l16.666 16.666",
785
+ stroke: "currentColor",
786
+ "stroke-width": "1.5",
787
+ "stroke-linecap": "round",
788
+ "stroke-linejoin": "round"
789
+ }
790
+ )
791
+ ] });
792
+ }
793
+ function mt({ email: e }) {
794
+ const { t } = v(), r = e ? t("auth.last_used", "Last · {email}", { email: ue(e) }) : t("auth.last_used_no_email", "Last");
795
+ return /* @__PURE__ */ i("span", { class: "pointer-events-none absolute -top-2 right-3 max-w-[75%] truncate rounded-full bg-gray-900 px-2 py-0.5 text-[10px] font-semibold tracking-wide text-white shadow-sm", children: r });
796
+ }
797
+ function ue(e) {
798
+ const [t, r] = e.split("@");
799
+ return r ? `${t.slice(0, 3)}*****@${r}` : e;
800
+ }
801
+ function pe() {
802
+ const { t: e } = v();
803
+ return /* @__PURE__ */ c("div", { class: "flex items-center gap-3 py-1 text-sm text-gray-400", children: [
804
+ /* @__PURE__ */ i("div", { class: "h-px flex-1 bg-gray-200" }),
805
+ /* @__PURE__ */ i("span", { children: e("auth.or", "or") }),
806
+ /* @__PURE__ */ i("div", { class: "h-px flex-1 bg-gray-200" })
807
+ ] });
808
+ }
809
+ function he({ provider: e }) {
810
+ return e === "google" ? /* @__PURE__ */ c("svg", { width: "20", height: "20", viewBox: "0 0 18 18", "aria-hidden": "true", children: [
811
+ /* @__PURE__ */ i("path", { fill: "#4285F4", d: "M17.64 9.2c0-.64-.06-1.25-.16-1.84H9v3.49h4.84a4.14 4.14 0 0 1-1.79 2.71v2.26h2.9c1.7-1.56 2.69-3.87 2.69-6.62Z" }),
812
+ /* @__PURE__ */ i("path", { fill: "#34A853", d: "M9 18c2.43 0 4.47-.8 5.96-2.18l-2.9-2.26c-.8.54-1.83.86-3.06.86-2.36 0-4.36-1.59-5.07-3.74H.92v2.33A9 9 0 0 0 9 18Z" }),
813
+ /* @__PURE__ */ i("path", { fill: "#FBBC05", d: "M3.93 10.68a5.4 5.4 0 0 1 0-3.36V4.99H.92a9 9 0 0 0 0 8.02l3-2.33Z" }),
814
+ /* @__PURE__ */ i("path", { fill: "#EA4335", d: "M9 3.58c1.32 0 2.5.45 3.44 1.34l2.58-2.58A9 9 0 0 0 .92 4.99l3.01 2.33C4.64 5.17 6.64 3.58 9 3.58Z" })
815
+ ] }) : e === "apple" ? (
816
+ // viewBox 0 0 24 24 даёт воздух сверху/снизу пути, поэтому визуально
817
+ // Apple-яблоко выглядит меньше Google. Компенсируем увеличенным
818
+ // width/height — 26×26 даёт примерно equal optical size с Google 20×20.
819
+ /* @__PURE__ */ i("svg", { width: "26", height: "26", viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ i("path", { d: "M17.05 20.28c-.98.95-2.05.8-3.08.35-1.09-.46-2.09-.48-3.24 0-1.44.62-2.2.44-3.06-.35C2.79 15.25 3.51 7.59 9.05 7.31c1.35.07 2.29.74 3.08.8 1.18-.24 2.31-.93 3.57-.84 1.51.12 2.65.72 3.4 1.8-3.12 1.87-2.38 5.98.48 7.13-.57 1.5-1.31 2.99-2.54 4.09zM12 7.25c-.15-2.23 1.66-4.07 3.74-4.25.29 2.58-2.34 4.5-3.74 4.25z" }) })
820
+ ) : e === "github" ? /* @__PURE__ */ i("svg", { width: "20", height: "20", viewBox: "0 0 16 16", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ i("path", { d: "M8 0C3.6 0 0 3.6 0 8a8 8 0 0 0 5.5 7.6c.4.1.5-.2.5-.4v-1.5c-2.2.5-2.7-1-2.7-1-.4-.9-.9-1.2-.9-1.2-.7-.5.1-.5.1-.5.8.1 1.2.8 1.2.8.7 1.2 1.9.9 2.4.7 0-.5.3-.9.5-1.1-1.8-.2-3.6-.9-3.6-4 0-.9.3-1.6.8-2.1-.1-.2-.4-1 .1-2.1 0 0 .7-.2 2.2.8a7.6 7.6 0 0 1 4 0c1.5-1 2.2-.8 2.2-.8.4 1.1.2 1.9.1 2.1.5.5.8 1.2.8 2.1 0 3.1-1.9 3.7-3.6 3.9.3.3.6.8.6 1.6V15c0 .2.1.5.6.4A8 8 0 0 0 16 8c0-4.4-3.6-8-8-8Z" }) }) : /* @__PURE__ */ i("svg", { width: "18", height: "20", viewBox: "0 0 14 16", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ i("path", { d: "M14 2.7C14 1.2 12.8 0 11.3 0H2.7C1.2 0 0 1.2 0 2.7v10.6C0 14.8 1.2 16 2.7 16h4V9.8H4.7v-2H6.7V6.4c0-2 1.2-3.1 3-3.1.9 0 1.7.1 2 .2V5h-1.4c-.8 0-1 .4-1 1v1.5h2.4l-.3 2H9.3V16h2c1.5 0 2.7-1.2 2.7-2.7V2.7Z" }) });
821
+ }
822
+ function ge({
823
+ block: e,
824
+ bootstrap: t,
825
+ auth: r,
826
+ authSession: a,
827
+ onBack: n,
828
+ showBack: o = !0,
829
+ intent: s = "preauth"
830
+ }) {
831
+ const { t: l } = v(), p = {
832
+ bootstrap: t,
833
+ selectedPriceId: null,
834
+ setSelectedPriceId: () => {
835
+ },
836
+ onAction: () => {
837
+ },
838
+ auth: r,
839
+ authSession: a
840
+ }, d = s === "restore" ? {
841
+ ...e,
842
+ heading: l("auth.restore_purchases_heading", "Restore Purchases"),
843
+ subheading: l(
844
+ "auth.restore_purchases_subheading",
845
+ "Please sign in to restore your purchases."
846
+ )
847
+ } : s === "preauth" ? {
848
+ ...e,
849
+ heading: l("auth.login_continue_purchase", "Log in to continue your purchase"),
850
+ subheading: l(
851
+ "auth.link_purchase_subheading",
852
+ "We'll link the purchase to your account to keep access."
853
+ ),
854
+ // Preauth heading — descriptive sentence ("Log in to continue your
855
+ // purchase"), а не action verb. Длинные локализации (RU: "Войдите,
856
+ // чтобы продолжить покупку") в pill-кнопку h-12 не помещаются и
857
+ // переносятся на 2 строки. Явный короткий submit_label решает.
858
+ submit_label: l("auth.log_in", "Sign In")
859
+ } : e;
860
+ return /* @__PURE__ */ c("div", { class: "relative flex-1 min-h-0 overflow-y-auto p-6 sm:p-8", children: [
861
+ o ? /* @__PURE__ */ i(fe, { onClick: n, ariaLabel: l("nav.back_aria", "Back") }) : null,
862
+ /* @__PURE__ */ i(Pt, { block: d, ctx: p })
863
+ ] });
864
+ }
865
+ function fe({ onClick: e, ariaLabel: t }) {
866
+ return /* @__PURE__ */ i(
867
+ "button",
868
+ {
869
+ type: "button",
870
+ onClick: e,
871
+ "aria-label": t,
872
+ class: "absolute right-4 top-4 z-10 flex h-8 w-8 items-center justify-center rounded-full text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-700 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",
873
+ children: /* @__PURE__ */ c("svg", { width: "18", height: "18", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
874
+ /* @__PURE__ */ i(
875
+ "path",
876
+ {
877
+ d: "M5 8h8a4 4 0 0 1 0 8H9",
878
+ stroke: "currentColor",
879
+ "stroke-width": "1.75",
880
+ "stroke-linecap": "round",
881
+ "stroke-linejoin": "round"
882
+ }
883
+ ),
884
+ /* @__PURE__ */ i(
885
+ "path",
886
+ {
887
+ d: "M8 4 4 8l4 4",
888
+ stroke: "currentColor",
889
+ "stroke-width": "1.75",
890
+ "stroke-linecap": "round",
891
+ "stroke-linejoin": "round"
892
+ }
893
+ )
894
+ ] })
895
+ }
896
+ );
897
+ }
898
+ function we({
899
+ auth: e,
900
+ onSuccess: t,
901
+ onBack: r,
902
+ heading: a,
903
+ description: n
904
+ }) {
905
+ const { t: o } = v(), s = a ?? o("anon.heading_default", "Continue as guest"), l = n ?? o("anon.description_default", "Setting up your guest session…"), [p, d] = b({ kind: "signing-in" }), g = O(!0);
906
+ T(() => () => {
907
+ g.current = !1;
908
+ }, []);
909
+ const h = () => {
910
+ d({ kind: "signing-in" }), (async () => {
911
+ try {
912
+ const x = await e.signInAnonymously();
913
+ if (!g.current) return;
914
+ t(x);
915
+ } catch (x) {
916
+ if (!g.current) return;
917
+ d({
918
+ kind: "error",
919
+ message: x instanceof Error ? x.message : "Anonymous sign-in failed"
920
+ });
921
+ }
922
+ })();
923
+ };
924
+ return T(() => {
925
+ h();
926
+ }, []), /* @__PURE__ */ c("div", { class: "flex flex-col gap-3", children: [
927
+ r ? /* @__PURE__ */ i(
928
+ "button",
929
+ {
930
+ type: "button",
931
+ onClick: r,
932
+ class: "-ml-1 self-start rounded-md px-1.5 py-0.5 text-xs font-medium text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",
933
+ children: o("nav.back", "← Back")
934
+ }
935
+ ) : null,
936
+ /* @__PURE__ */ c("div", { class: "flex flex-col gap-1", children: [
937
+ /* @__PURE__ */ i("h2", { class: "text-xl font-semibold text-gray-900", children: s }),
938
+ /* @__PURE__ */ i("p", { class: "text-sm text-gray-500", children: l })
939
+ ] }),
940
+ p.kind === "signing-in" ? /* @__PURE__ */ i("div", { class: "flex items-center justify-center py-6", children: /* @__PURE__ */ i(me, {}) }) : null,
941
+ p.kind === "error" ? /* @__PURE__ */ c("div", { class: "flex flex-col gap-3", children: [
942
+ /* @__PURE__ */ i("div", { class: "rounded-lg bg-red-50 px-3 py-2 text-sm text-red-700", children: p.message }),
943
+ /* @__PURE__ */ i(
944
+ "button",
945
+ {
946
+ type: "button",
947
+ onClick: h,
948
+ class: "self-start rounded-md bg-[var(--pw-accent)] px-3 py-1.5 text-sm font-medium text-white hover:opacity-90 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)] focus-visible:ring-offset-2",
949
+ children: o("anon.try_again", "Try again")
950
+ }
951
+ )
952
+ ] }) : null
953
+ ] });
954
+ }
955
+ function me() {
956
+ return /* @__PURE__ */ c("svg", { class: "h-5 w-5 animate-spin text-[var(--pw-accent)]", viewBox: "0 0 24 24", fill: "none", children: [
957
+ /* @__PURE__ */ i("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", "stroke-width": "3", "stroke-opacity": "0.2" }),
958
+ /* @__PURE__ */ i("path", { d: "M22 12a10 10 0 0 0-10-10", stroke: "currentColor", "stroke-width": "3", "stroke-linecap": "round" })
959
+ ] });
960
+ }
961
+ const Tt = (e) => `pw-offer-${e}-start`;
962
+ function tt(e) {
963
+ const t = e - Date.now();
964
+ return t <= 0 ? { days: 0, hours: 0, minutes: 0, seconds: 0, expired: !0 } : {
965
+ days: Math.floor(t / (1e3 * 60 * 60 * 24)),
966
+ hours: Math.floor(t % (1e3 * 60 * 60 * 24) / (1e3 * 60 * 60)),
967
+ minutes: Math.floor(t % (1e3 * 60 * 60) / (1e3 * 60)),
968
+ seconds: Math.floor(t % (1e3 * 60) / 1e3),
969
+ expired: !1
970
+ };
971
+ }
972
+ function be(e) {
973
+ if (e.expires_at) {
974
+ const t = Date.parse(e.expires_at);
975
+ return Number.isFinite(t) ? t : null;
976
+ }
977
+ if (e.duration_minutes && e.duration_minutes > 0) {
978
+ if (typeof window > "u") return null;
979
+ try {
980
+ const t = Tt(e.id);
981
+ let r = window.localStorage.getItem(t);
982
+ return r || (r = (/* @__PURE__ */ new Date()).toISOString(), window.localStorage.setItem(t, r)), Date.parse(r) + e.duration_minutes * 6e4;
983
+ } catch {
984
+ return null;
985
+ }
986
+ }
987
+ return null;
988
+ }
989
+ function Et(e, t) {
990
+ if (!e || e.length === 0) return null;
991
+ if (t) {
992
+ const r = e.find((a) => a.id === t);
993
+ if (r) return r;
994
+ }
995
+ return e.find((r) => r.expires_at || r.duration_minutes) ?? null;
996
+ }
997
+ function jt(e) {
998
+ const t = e ? be(e) : null, [r, a] = b(
999
+ () => t !== null ? tt(t) : null
1000
+ ), n = O(t);
1001
+ return n.current = t, T(() => {
1002
+ if (t === null) {
1003
+ a(null);
1004
+ return;
1005
+ }
1006
+ a(tt(t));
1007
+ const o = setInterval(() => {
1008
+ const s = tt(n.current ?? 0);
1009
+ if (a(s), s.expired && (clearInterval(o), e?.duration_minutes && typeof window < "u"))
1010
+ try {
1011
+ window.localStorage.removeItem(Tt(e.id));
1012
+ } catch {
1013
+ }
1014
+ }, 1e3);
1015
+ return () => clearInterval(o);
1016
+ }, [t, e?.duration_minutes, e?.id]), r;
1017
+ }
1018
+ function xe({ block: e, ctx: t }) {
1019
+ const { t: r } = v(), a = Et(t.bootstrap.offers, e.offer_id), n = jt(a);
1020
+ if (!a || n === null || n.expired && !e.force) return null;
1021
+ const o = e.title ?? a.label ?? r("offer.limited_time", "Limited-time offer"), s = a.discount_percent ? `${o} ${a.discount_percent}%` : o;
1022
+ return /* @__PURE__ */ c(
1023
+ "div",
1024
+ {
1025
+ class: "flex flex-wrap items-center justify-center gap-2 rounded-2xl px-4 py-3 text-[15px] font-semibold leading-tight text-white",
1026
+ style: {
1027
+ background: "linear-gradient(135deg, color-mix(in srgb, var(--pw-accent) 55%, white) 0%, var(--pw-accent) 50%, color-mix(in srgb, var(--pw-accent) 85%, black) 100%)",
1028
+ textShadow: "0 0 2px rgba(0, 0, 0, 0.25)"
1029
+ },
1030
+ role: "status",
1031
+ children: [
1032
+ /* @__PURE__ */ i(Bt, {}),
1033
+ /* @__PURE__ */ i("span", { children: s }),
1034
+ /* @__PURE__ */ i(zt, { value: n, t: r })
1035
+ ]
1036
+ }
1037
+ );
1038
+ }
1039
+ function zt({ value: e, t }) {
1040
+ return /* @__PURE__ */ c("div", { class: "flex items-center gap-1 font-mono text-sm", children: [
1041
+ e.days > 0 ? /* @__PURE__ */ c(q, { children: [
1042
+ /* @__PURE__ */ i($, { children: String(e.days) }),
1043
+ /* @__PURE__ */ i("span", { class: "text-xs", children: t("countdown.d", "d") })
1044
+ ] }) : null,
1045
+ /* @__PURE__ */ i($, { children: String(e.hours).padStart(2, "0") }),
1046
+ /* @__PURE__ */ i("span", { class: "text-xs", children: t("countdown.h", "h") }),
1047
+ /* @__PURE__ */ i($, { children: String(e.minutes).padStart(2, "0") }),
1048
+ /* @__PURE__ */ i("span", { class: "text-xs", children: t("countdown.m", "m") }),
1049
+ /* @__PURE__ */ i($, { children: String(e.seconds).padStart(2, "0") }),
1050
+ /* @__PURE__ */ i("span", { class: "text-xs", children: t("countdown.s", "s") })
1051
+ ] });
1052
+ }
1053
+ function $({ children: e }) {
1054
+ return /* @__PURE__ */ i("span", { class: "rounded bg-black/20 px-1.5 py-0.5 text-xs font-bold", children: e });
1055
+ }
1056
+ function ve({ offer: e }) {
1057
+ const { t } = v(), r = jt(e);
1058
+ if (r === null || r.expired) return null;
1059
+ const a = e.label ?? t("offer.limited_time", "Limited-time offer"), n = e.discount_percent ? `${a} ${e.discount_percent}%` : a;
1060
+ return /* @__PURE__ */ c(
1061
+ "div",
1062
+ {
1063
+ class: "-mb-2 flex flex-wrap items-center justify-center gap-2 rounded-t-xl px-4 pb-5 pt-3 text-[15px] font-semibold leading-tight text-white",
1064
+ style: {
1065
+ background: "linear-gradient(135deg, color-mix(in srgb, var(--pw-accent) 55%, white) 0%, var(--pw-accent) 50%, color-mix(in srgb, var(--pw-accent) 85%, black) 100%)",
1066
+ textShadow: "0 0 2px rgba(0, 0, 0, 0.25)"
1067
+ },
1068
+ role: "status",
1069
+ children: [
1070
+ /* @__PURE__ */ i(Bt, {}),
1071
+ /* @__PURE__ */ i("span", { children: n }),
1072
+ /* @__PURE__ */ i(zt, { value: r, t })
1073
+ ]
1074
+ }
1075
+ );
1076
+ }
1077
+ function Bt() {
1078
+ return /* @__PURE__ */ i(
1079
+ "svg",
1080
+ {
1081
+ width: "16",
1082
+ height: "16",
1083
+ viewBox: "0 0 12 12",
1084
+ fill: "none",
1085
+ "aria-hidden": "true",
1086
+ children: /* @__PURE__ */ i(
1087
+ "path",
1088
+ {
1089
+ fill: "currentColor",
1090
+ d: "m9.44 5.359-2.394-.895.61-3.036c.062-.31-.345-.531-.57-.291L2.434 6.105a.336.336 0 0 0 .126.537l2.395.894-.61 3.037c-.062.31.345.53.57.29l4.653-4.968a.336.336 0 0 0-.126-.536Z"
1091
+ }
1092
+ )
1093
+ }
1094
+ );
1095
+ }
1096
+ const et = 3, rt = 200, it = 5e3, nt = 5, ye = 10 * 1024 * 1024, bt = ["image/jpeg", "image/png", "image/webp"], xt = /.+@.+\..+/;
1097
+ function ke({ client: e, authSession: t, origin: r, onBack: a }) {
1098
+ const { t: n } = v(), o = t?.user.email ?? "", s = o || null, [l, p] = b(o), [d, g] = b(""), [h, x] = b(""), [u, m] = b([]), [y, B] = b(!1), [P, k] = b(null), [A, C] = b({}), j = St(() => {
1099
+ const M = (s ?? l).trim().toLowerCase(), I = d.trim(), w = h.trim();
1100
+ return xt.test(M) && I.length >= et && I.length <= rt && w.length >= 1 && w.length <= it;
1101
+ }, [s, l, d, h]), z = () => {
1102
+ const M = {}, I = (s ?? l).trim(), w = d.trim(), f = h.trim();
1103
+ return I ? xt.test(I.toLowerCase()) || (M.email = n("support.invalid_email", "Invalid email")) : M.email = n("support.required", "Required"), (w.length < et || w.length > rt) && (M.subject = n("support.subject_length", "{min}–{max} characters", {
1104
+ min: et,
1105
+ max: rt
1106
+ })), (f.length < 1 || f.length > it) && (M.message = n("support.message_length", "{min}–{max} characters", {
1107
+ min: 1,
1108
+ max: it
1109
+ })), C(M), Object.keys(M).length === 0;
1110
+ }, E = async (M) => {
1111
+ if (M.preventDefault(), !y && z()) {
1112
+ B(!0), C((I) => ({ ...I, submit: void 0 }));
1113
+ try {
1114
+ const I = (s ?? l).trim();
1115
+ await e.createSupportTicket({
1116
+ subject: d.trim(),
1117
+ content: h.trim(),
1118
+ email: I || void 0,
1119
+ files: u.length > 0 ? u : void 0
1120
+ }), k(I);
1121
+ } catch (I) {
1122
+ const w = I instanceof R && I.message || "Failed to send. Please try again.";
1123
+ C((f) => ({ ...f, submit: w }));
1124
+ } finally {
1125
+ B(!1);
1126
+ }
1127
+ }
1128
+ }, D = () => {
1129
+ g(""), x(""), m([]), C({}), k(null);
1130
+ }, F = "flex flex-col gap-3 bg-white px-6 pb-6 pt-3 sm:px-8", U = { boxShadow: "0 -4px 12px -4px rgba(15,23,42,0.06)" };
1131
+ return P ? /* @__PURE__ */ c("div", { class: "relative flex-1 min-h-0 flex flex-col", children: [
1132
+ /* @__PURE__ */ c("div", { class: "flex-1 min-h-0 overflow-y-auto flex flex-col items-center gap-4 px-6 pb-3 pt-6 sm:px-8 sm:pb-4 sm:pt-8 text-center", children: [
1133
+ /* @__PURE__ */ i(
1134
+ "div",
1135
+ {
1136
+ class: "flex h-14 w-14 items-center justify-center rounded-full",
1137
+ style: {
1138
+ background: "linear-gradient(135deg, color-mix(in srgb, var(--pw-accent) 85%, white), var(--pw-accent))",
1139
+ color: "#fff",
1140
+ boxShadow: "0 0 0 8px color-mix(in srgb, var(--pw-accent) 12%, transparent), 0 8px 20px -6px color-mix(in srgb, var(--pw-accent) 45%, transparent)"
1141
+ },
1142
+ "aria-hidden": "true",
1143
+ children: /* @__PURE__ */ i("svg", { viewBox: "0 0 24 24", class: "h-7 w-7", children: /* @__PURE__ */ i(
1144
+ "path",
1145
+ {
1146
+ fill: "currentColor",
1147
+ d: "M12 0a12 12 0 1 0 0 24 12 12 0 0 0 0-24Zm6.93 8.2-6.85 9.29a1.01 1.01 0 0 1-1.43.19L5.76 13.77a1 1 0 1 1 1.25-1.56l4.08 3.26 6.23-8.45a1 1 0 1 1 1.61 1.18Z"
1148
+ }
1149
+ ) })
1150
+ }
1151
+ ),
1152
+ /* @__PURE__ */ i("div", { class: "text-lg font-semibold tracking-tight text-gray-900", children: n("support.success_heading", "Request submitted") }),
1153
+ /* @__PURE__ */ c("div", { class: "max-w-[320px] text-sm leading-relaxed text-gray-500", children: [
1154
+ n(
1155
+ "support.success_message_prefix",
1156
+ "We've received your message and will respond to"
1157
+ ),
1158
+ " ",
1159
+ /* @__PURE__ */ i("b", { class: "text-gray-700", children: P }),
1160
+ "."
1161
+ ] })
1162
+ ] }),
1163
+ /* @__PURE__ */ i("div", { class: F, style: U, children: /* @__PURE__ */ c("div", { class: "flex items-center justify-center gap-3", children: [
1164
+ /* @__PURE__ */ i(
1165
+ "button",
1166
+ {
1167
+ type: "button",
1168
+ onClick: a,
1169
+ class: "rounded-xl px-3 py-2 text-sm font-medium text-gray-600 transition-colors hover:bg-gray-100 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",
1170
+ children: r === "standalone" ? n("support.done_button", "Done") : n("nav.back_aria", "Back")
1171
+ }
1172
+ ),
1173
+ /* @__PURE__ */ i(
1174
+ "button",
1175
+ {
1176
+ type: "button",
1177
+ onClick: D,
1178
+ class: "flex h-10 items-center justify-center rounded-xl px-4 text-sm font-semibold text-white transition-all hover:-translate-y-px hover:brightness-105 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",
1179
+ style: {
1180
+ background: "linear-gradient(180deg, color-mix(in srgb, var(--pw-accent) 92%, white), var(--pw-accent))",
1181
+ boxShadow: "0 1px 2px rgba(15,23,42,0.08), 0 6px 14px -4px color-mix(in srgb, var(--pw-accent) 50%, transparent)"
1182
+ },
1183
+ children: n("support.send_another", "Send another request")
1184
+ }
1185
+ )
1186
+ ] }) })
1187
+ ] }) : /* @__PURE__ */ c("form", { onSubmit: E, class: "relative flex-1 min-h-0 flex flex-col", children: [
1188
+ /* @__PURE__ */ i(_e, { onClick: a, ariaLabel: n("nav.back_aria", "Back") }),
1189
+ /* @__PURE__ */ i("div", { class: "flex-1 min-h-0 overflow-y-auto px-6 pb-3 pt-6 sm:px-8 sm:pb-4 sm:pt-8", children: /* @__PURE__ */ c("div", { class: "flex flex-col gap-5", children: [
1190
+ /* @__PURE__ */ c("div", { class: "flex flex-col gap-2 pr-10", children: [
1191
+ /* @__PURE__ */ i("h2", { class: "text-3xl font-bold tracking-tight text-gray-900", children: n("support.heading", "Support") }),
1192
+ /* @__PURE__ */ i("p", { class: "text-base leading-relaxed text-gray-600", children: n("support.instruction", "Please fill out the form below to submit your support request.") })
1193
+ ] }),
1194
+ /* @__PURE__ */ c("div", { class: "flex flex-col gap-3", children: [
1195
+ s ? /* @__PURE__ */ c("div", { class: "rounded-2xl bg-gray-100 px-5 py-3 text-sm text-gray-600", children: [
1196
+ n("support.sending_as", "Sending as"),
1197
+ " ",
1198
+ /* @__PURE__ */ i("b", { class: "font-medium text-gray-900", children: s })
1199
+ ] }) : /* @__PURE__ */ i(
1200
+ vt,
1201
+ {
1202
+ type: "email",
1203
+ placeholder: n("support.email_placeholder", "Enter your email *"),
1204
+ value: l,
1205
+ onInput: p,
1206
+ error: A.email,
1207
+ autocomplete: "email",
1208
+ required: !0
1209
+ }
1210
+ ),
1211
+ /* @__PURE__ */ i(
1212
+ vt,
1213
+ {
1214
+ type: "text",
1215
+ placeholder: n("support.subject_placeholder", "Enter your subject *"),
1216
+ value: d,
1217
+ onInput: g,
1218
+ error: A.subject,
1219
+ required: !0
1220
+ }
1221
+ ),
1222
+ /* @__PURE__ */ i(
1223
+ Se,
1224
+ {
1225
+ placeholder: n("support.message_placeholder", "Enter your message *"),
1226
+ value: h,
1227
+ onInput: x,
1228
+ error: A.message,
1229
+ required: !0
1230
+ }
1231
+ ),
1232
+ /* @__PURE__ */ i(Ce, { files: u, onChange: m, disabled: y })
1233
+ ] })
1234
+ ] }) }),
1235
+ /* @__PURE__ */ c("div", { class: F, style: U, children: [
1236
+ A.submit && /* @__PURE__ */ i("p", { class: "text-sm text-red-600", children: A.submit }),
1237
+ /* @__PURE__ */ c("div", { class: "flex items-center justify-end gap-3", children: [
1238
+ /* @__PURE__ */ i(
1239
+ "button",
1240
+ {
1241
+ type: "button",
1242
+ onClick: a,
1243
+ disabled: y,
1244
+ class: "rounded-full px-4 py-2 text-base font-medium text-gray-700 transition-colors hover:bg-gray-100 disabled:cursor-not-allowed disabled:opacity-60 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",
1245
+ children: r === "standalone" ? n("support.close_button", "Close") : n("nav.back_aria", "Back")
1246
+ }
1247
+ ),
1248
+ /* @__PURE__ */ i(
1249
+ "button",
1250
+ {
1251
+ type: "submit",
1252
+ disabled: !j || y,
1253
+ class: "pw-cta-shimmer relative flex h-12 items-center justify-center overflow-hidden rounded-full px-8 text-base font-semibold text-white transition-transform duration-150 active:scale-[0.98] disabled:cursor-not-allowed disabled:opacity-60 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",
1254
+ style: {
1255
+ background: "linear-gradient(135deg, color-mix(in srgb, var(--pw-accent) 55%, white) 0%, var(--pw-accent) 55%, color-mix(in srgb, var(--pw-accent) 90%, black) 100%)",
1256
+ boxShadow: "0 0 20px 0 color-mix(in srgb, var(--pw-accent) 25%, transparent), inset 0 0 8px 0 color-mix(in srgb, white 25%, transparent)"
1257
+ },
1258
+ children: y ? /* @__PURE__ */ i("span", { class: "relative z-10 inline-block h-4 w-4 animate-spin rounded-full border-2 border-white/40 border-t-white" }) : /* @__PURE__ */ i("span", { class: "relative z-10", children: n("support.send_button", "Send") })
1259
+ }
1260
+ )
1261
+ ] })
1262
+ ] })
1263
+ ] });
1264
+ }
1265
+ function _e({ onClick: e, ariaLabel: t }) {
1266
+ return /* @__PURE__ */ i(
1267
+ "button",
1268
+ {
1269
+ type: "button",
1270
+ onClick: e,
1271
+ "aria-label": t,
1272
+ class: "absolute right-4 top-4 z-10 flex h-8 w-8 items-center justify-center rounded-full text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-700 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",
1273
+ children: /* @__PURE__ */ c("svg", { width: "18", height: "18", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
1274
+ /* @__PURE__ */ i(
1275
+ "path",
1276
+ {
1277
+ d: "M5 8h8a4 4 0 0 1 0 8H9",
1278
+ stroke: "currentColor",
1279
+ "stroke-width": "1.75",
1280
+ "stroke-linecap": "round",
1281
+ "stroke-linejoin": "round"
1282
+ }
1283
+ ),
1284
+ /* @__PURE__ */ i(
1285
+ "path",
1286
+ {
1287
+ d: "M8 4 4 8l4 4",
1288
+ stroke: "currentColor",
1289
+ "stroke-width": "1.75",
1290
+ "stroke-linecap": "round",
1291
+ "stroke-linejoin": "round"
1292
+ }
1293
+ )
1294
+ ] })
1295
+ }
1296
+ );
1297
+ }
1298
+ function vt({
1299
+ type: e,
1300
+ placeholder: t,
1301
+ value: r,
1302
+ onInput: a,
1303
+ error: n,
1304
+ autocomplete: o,
1305
+ required: s
1306
+ }) {
1307
+ return /* @__PURE__ */ c("div", { children: [
1308
+ /* @__PURE__ */ i(
1309
+ "input",
1310
+ {
1311
+ type: e,
1312
+ value: r,
1313
+ placeholder: t,
1314
+ onInput: (l) => a(l.target.value),
1315
+ autocomplete: o,
1316
+ required: s,
1317
+ class: `h-14 w-full rounded-2xl bg-gray-100 px-5 text-base text-gray-900 outline-none transition-all placeholder:text-gray-500 hover:bg-gray-200/60 focus:bg-gray-200/60 ${n ? "shadow-[0_0_0_2px_rgba(239,68,68,0.5)]" : "focus:shadow-[0_0_0_2px_color-mix(in_srgb,var(--pw-accent)_30%,transparent)]"}`
1318
+ }
1319
+ ),
1320
+ n && /* @__PURE__ */ i("span", { class: "mt-1 ml-2 block text-sm text-red-600", children: n })
1321
+ ] });
1322
+ }
1323
+ function Se({
1324
+ placeholder: e,
1325
+ value: t,
1326
+ onInput: r,
1327
+ error: a,
1328
+ required: n
1329
+ }) {
1330
+ return /* @__PURE__ */ c("div", { children: [
1331
+ /* @__PURE__ */ i(
1332
+ "textarea",
1333
+ {
1334
+ value: t,
1335
+ placeholder: e,
1336
+ onInput: (o) => r(o.target.value),
1337
+ required: n,
1338
+ rows: 5,
1339
+ class: `min-h-[120px] w-full rounded-2xl bg-gray-100 px-5 py-3.5 text-base leading-relaxed text-gray-900 outline-none transition-all placeholder:text-gray-500 hover:bg-gray-200/60 focus:bg-gray-200/60 ${a ? "shadow-[0_0_0_2px_rgba(239,68,68,0.5)]" : "focus:shadow-[0_0_0_2px_color-mix(in_srgb,var(--pw-accent)_30%,transparent)]"}`
1340
+ }
1341
+ ),
1342
+ a && /* @__PURE__ */ i("span", { class: "mt-1 ml-2 block text-sm text-red-600", children: a })
1343
+ ] });
1344
+ }
1345
+ function Ce({ files: e, onChange: t, disabled: r }) {
1346
+ const { t: a } = v(), n = O(null), [o, s] = b(!1), [l, p] = b(null), d = (g) => {
1347
+ if (!g || r) return;
1348
+ p(null);
1349
+ const h = Array.from(g);
1350
+ if (e.length + h.length > nt) {
1351
+ p(a("support.too_many_files", "Up to {max} files", { max: nt }));
1352
+ return;
1353
+ }
1354
+ const x = h.filter(
1355
+ (u) => bt.includes(u.type) && u.size <= ye
1356
+ );
1357
+ if (x.length !== h.length) {
1358
+ p(a("support.invalid_file", "Only JPEG/PNG/WebP, ≤ 10MB each"));
1359
+ return;
1360
+ }
1361
+ t([...e, ...x]);
1362
+ };
1363
+ return /* @__PURE__ */ c("div", { children: [
1364
+ /* @__PURE__ */ i("span", { class: "text-xs font-medium text-gray-700", children: a("support.attachments_label", "Attachments (optional)") }),
1365
+ /* @__PURE__ */ c(
1366
+ "div",
1367
+ {
1368
+ role: "button",
1369
+ tabIndex: 0,
1370
+ "aria-label": a("support.attachments_aria", "Attachments upload"),
1371
+ onClick: () => !r && n.current?.click(),
1372
+ onDragOver: (g) => {
1373
+ g.preventDefault(), r || s(!0);
1374
+ },
1375
+ onDragLeave: () => s(!1),
1376
+ onDrop: (g) => {
1377
+ g.preventDefault(), s(!1), d(g.dataTransfer?.files ?? null);
1378
+ },
1379
+ class: `mt-1.5 cursor-pointer rounded-2xl border border-dashed p-3.5 text-center transition-all ${o ? "border-[var(--pw-accent)] bg-[color-mix(in_srgb,var(--pw-accent)_6%,white)]" : "border-gray-300 hover:border-gray-400 hover:bg-gray-50/60"} ${r ? "cursor-not-allowed opacity-60" : ""}`,
1380
+ children: [
1381
+ /* @__PURE__ */ i("div", { class: "text-xs text-gray-500", children: a("support.dropzone_text", "Drop images here or click to select") }),
1382
+ /* @__PURE__ */ i("div", { class: "mt-0.5 text-[11px] text-gray-400", children: a("support.file_requirements", "JPEG/PNG/WebP, up to {max} files, ≤ 10MB each", {
1383
+ max: nt
1384
+ }) })
1385
+ ]
1386
+ }
1387
+ ),
1388
+ /* @__PURE__ */ i(
1389
+ "input",
1390
+ {
1391
+ ref: n,
1392
+ type: "file",
1393
+ multiple: !0,
1394
+ accept: bt.join(","),
1395
+ class: "hidden",
1396
+ onChange: (g) => {
1397
+ d(g.target.files), g.currentTarget.value = "";
1398
+ }
1399
+ }
1400
+ ),
1401
+ l && /* @__PURE__ */ i("p", { class: "mt-1 text-xs text-red-600", children: l }),
1402
+ e.length > 0 && /* @__PURE__ */ i("ul", { class: "mt-2 flex flex-col gap-1", children: e.map((g, h) => /* @__PURE__ */ c(
1403
+ "li",
1404
+ {
1405
+ class: "flex items-center justify-between gap-2 rounded bg-gray-50 px-2 py-1 text-xs",
1406
+ children: [
1407
+ /* @__PURE__ */ i("span", { class: "truncate text-gray-700", children: g.name }),
1408
+ /* @__PURE__ */ i(
1409
+ "button",
1410
+ {
1411
+ type: "button",
1412
+ onClick: () => {
1413
+ const x = [...e];
1414
+ x.splice(h, 1), t(x);
1415
+ },
1416
+ disabled: r,
1417
+ class: "text-gray-500 hover:text-red-600 disabled:cursor-not-allowed disabled:opacity-60",
1418
+ "aria-label": a("support.remove_file_aria", "Remove {filename}", { filename: g.name }),
1419
+ children: "✕"
1420
+ }
1421
+ )
1422
+ ]
1423
+ },
1424
+ `${g.name}-${g.size}-${h}`
1425
+ )) })
1426
+ ] });
1427
+ }
1428
+ const Ie = {
1429
+ day: "cta.get_plan_daily",
1430
+ week: "cta.get_plan_weekly",
1431
+ month: "cta.get_plan_monthly",
1432
+ year: "cta.get_plan_yearly"
1433
+ }, Ae = {
1434
+ day: "Get Daily Plan",
1435
+ week: "Get Weekly Plan",
1436
+ month: "Get Monthly Plan",
1437
+ year: "Get Yearly Plan"
1438
+ };
1439
+ function Me(e, t, r, a) {
1440
+ if (t === "close") return a("cta.close", "Close");
1441
+ if (!e) return a("cta.continue", "Continue");
1442
+ if (!r && e.trial_days && e.interval && e.interval !== "lifetime")
1443
+ return a("cta.start_trial", "Start {days}-Day Free Trial", { days: e.trial_days });
1444
+ if (!e.interval || e.interval === "lifetime")
1445
+ return a("cta.get_lifetime_access", "Get Lifetime Access");
1446
+ const n = Ie[e.interval];
1447
+ return n ? a(n, Ae[e.interval]) : a("cta.get_plan_generic", "Get {interval} Plan", {
1448
+ interval: Le(e.interval)
1449
+ });
1450
+ }
1451
+ function Le(e) {
1452
+ return e.length ? e[0].toUpperCase() + e.slice(1) : e;
1453
+ }
1454
+ function Pe({ block: e, ctx: t }) {
1455
+ const { t: r } = v(), [a, n] = b(!1), o = e.priceId ?? t.selectedPriceId, s = a || e.action === "checkout" && !o, l = o ? t.bootstrap.prices.find((h) => h.id === o) ?? null : null, p = t.bootstrap.user?.had_previous_trial ?? !1, d = e.label ?? Me(l, e.action, p, r);
1456
+ return /* @__PURE__ */ c(
1457
+ "button",
1458
+ {
1459
+ type: "button",
1460
+ disabled: s,
1461
+ onClick: async () => {
1462
+ if (!s) {
1463
+ n(!0);
1464
+ try {
1465
+ await t.onAction(e.action, { priceId: o });
1466
+ } finally {
1467
+ n(!1);
1468
+ }
1469
+ }
1470
+ },
1471
+ class: "pw-cta-shimmer relative flex min-h-12 w-full items-center justify-center overflow-hidden rounded-3xl px-5 py-2 text-center text-base font-semibold leading-tight text-white transition-transform duration-150 active:scale-[0.98] disabled:cursor-not-allowed disabled:opacity-60 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",
1472
+ style: {
1473
+ background: "linear-gradient(135deg, color-mix(in srgb, var(--pw-accent) 55%, white) 0%, var(--pw-accent) 55%, color-mix(in srgb, var(--pw-accent) 90%, black) 100%)",
1474
+ boxShadow: "0 0 20px 0 color-mix(in srgb, var(--pw-accent) 25%, transparent), inset 0 0 8px 0 color-mix(in srgb, white 25%, transparent)"
1475
+ },
1476
+ children: [
1477
+ /* @__PURE__ */ i(
1478
+ "span",
1479
+ {
1480
+ class: "absolute inset-0 opacity-40",
1481
+ style: {
1482
+ background: "radial-gradient(circle at 50% 0%, color-mix(in srgb, white 40%, transparent) 0%, transparent 70%)"
1483
+ },
1484
+ "aria-hidden": "true"
1485
+ }
1486
+ ),
1487
+ a ? /* @__PURE__ */ i("span", { class: "relative z-10 inline-block h-4 w-4 animate-spin rounded-full border-2 border-white/40 border-t-white" }) : /* @__PURE__ */ i("span", { class: "relative z-10", children: d })
1488
+ ]
1489
+ }
1490
+ );
1491
+ }
1492
+ function Te({ ctx: e }) {
1493
+ const { t } = v(), r = e.authSession, a = e.auth, [n, o] = b(!1), s = () => e.onAction("support");
1494
+ if (r && !r.user.is_anonymous) {
1495
+ const l = async () => {
1496
+ if (!(!a || n)) {
1497
+ o(!0);
1498
+ try {
1499
+ await a.signOut();
1500
+ } catch {
1501
+ } finally {
1502
+ o(!1);
1503
+ }
1504
+ }
1505
+ };
1506
+ return /* @__PURE__ */ c("div", { class: "-mt-3 flex flex-col items-center gap-1.5 pt-1 text-center text-[13px] text-gray-500", children: [
1507
+ /* @__PURE__ */ c("span", { children: [
1508
+ t("session.signed_in_as_prefix", "Signed in as"),
1509
+ " ",
1510
+ /* @__PURE__ */ i("b", { class: "font-medium text-gray-700", children: r.user.email })
1511
+ ] }),
1512
+ /* @__PURE__ */ c("div", { class: "flex items-center justify-center gap-3", children: [
1513
+ /* @__PURE__ */ i(H, { onClick: l, disabled: !a || n, children: n ? t("session.signing_out", "Signing out…") : t("session.sign_out", "Sign Out") }),
1514
+ /* @__PURE__ */ i(yt, {}),
1515
+ /* @__PURE__ */ i(H, { onClick: s, children: t("session.contact_support", "Contact Support") })
1516
+ ] })
1517
+ ] });
1518
+ }
1519
+ return /* @__PURE__ */ c("div", { class: "-mt-3 flex items-center justify-center gap-3 pt-1 text-center text-[13px]", children: [
1520
+ /* @__PURE__ */ i(H, { onClick: () => e.onAction("restore"), children: t("session.restore_purchases", "Restore purchases") }),
1521
+ /* @__PURE__ */ i(yt, {}),
1522
+ /* @__PURE__ */ i(H, { onClick: s, children: t("session.contact_support", "Contact Support") })
1523
+ ] });
1524
+ }
1525
+ function H({
1526
+ onClick: e,
1527
+ disabled: t,
1528
+ children: r
1529
+ }) {
1530
+ return /* @__PURE__ */ i(
1531
+ "button",
1532
+ {
1533
+ type: "button",
1534
+ onClick: e,
1535
+ disabled: t,
1536
+ class: "font-semibold transition-opacity hover:opacity-80 disabled:cursor-not-allowed disabled:opacity-60 focus:outline-none focus-visible:opacity-80",
1537
+ style: { color: "var(--pw-accent)" },
1538
+ children: r
1539
+ }
1540
+ );
1541
+ }
1542
+ function yt() {
1543
+ return /* @__PURE__ */ i("span", { class: "h-1 w-1 rounded-full bg-gray-300", "aria-hidden": "true" });
1544
+ }
1545
+ function Ee({ block: e }) {
1546
+ return e.items.length ? /* @__PURE__ */ i("ul", { class: "flex flex-col gap-2.5", role: "list", children: e.items.map((t) => /* @__PURE__ */ c("li", { class: "flex items-start gap-3 text-sm text-gray-700", children: [
1547
+ /* @__PURE__ */ i(
1548
+ "svg",
1549
+ {
1550
+ width: "18",
1551
+ height: "18",
1552
+ viewBox: "0 0 20 20",
1553
+ fill: "none",
1554
+ class: "mt-0.5 flex-shrink-0 text-emerald-500",
1555
+ "aria-hidden": "true",
1556
+ children: /* @__PURE__ */ i(
1557
+ "path",
1558
+ {
1559
+ d: "M4 10.5l3.5 3.5 8.5-8.5",
1560
+ stroke: "currentColor",
1561
+ "stroke-width": "2.5",
1562
+ "stroke-linecap": "round",
1563
+ "stroke-linejoin": "round"
1564
+ }
1565
+ )
1566
+ }
1567
+ ),
1568
+ /* @__PURE__ */ c("div", { class: "flex flex-col gap-0.5", children: [
1569
+ /* @__PURE__ */ i("span", { class: "font-medium leading-snug text-gray-900", children: t.name }),
1570
+ t.desc ? /* @__PURE__ */ i("span", { class: "text-xs leading-relaxed text-gray-400", children: t.desc }) : null
1571
+ ] })
1572
+ ] }, t.id)) }) : null;
1573
+ }
1574
+ function je({ block: e }) {
1575
+ const { t } = v(), r = e.title ?? t("pricing.money_back", "30-day money-back guarantee"), a = e.subtitle, n = (e.icon ?? "dollar_shield") !== "none", o = ze(r);
1576
+ return /* @__PURE__ */ c("div", { class: "flex flex-col items-center gap-1.5 border-b-1 pb-4 mb-1 border-gray-100", children: [
1577
+ /* @__PURE__ */ c("div", { class: "inline-flex items-center gap-2 text-[12px] text-gray-700", children: [
1578
+ n ? /* @__PURE__ */ i(Be, {}) : null,
1579
+ o ? /* @__PURE__ */ c("span", { children: [
1580
+ /* @__PURE__ */ i("b", { class: "font-bold text-gray-900", children: o.bold }),
1581
+ " ",
1582
+ /* @__PURE__ */ i("span", { class: "font-medium", children: o.rest })
1583
+ ] }) : /* @__PURE__ */ i("span", { class: "font-medium", children: r })
1584
+ ] }),
1585
+ a ? /* @__PURE__ */ i("span", { class: "text-center text-xs leading-relaxed text-gray-500", children: a }) : null
1586
+ ] });
1587
+ }
1588
+ function ze(e) {
1589
+ const t = e.match(/^(\d+[-\s]?days?)\s+(.+)$/i);
1590
+ return t ? { bold: t[1], rest: t[2] } : null;
1591
+ }
1592
+ function Be() {
1593
+ return /* @__PURE__ */ c(
1594
+ "svg",
1595
+ {
1596
+ xmlns: "http://www.w3.org/2000/svg",
1597
+ viewBox: "0 0 24 24",
1598
+ fill: "none",
1599
+ width: "16",
1600
+ height: "16",
1601
+ class: "flex-shrink-0 text-emerald-500",
1602
+ "aria-hidden": "true",
1603
+ children: [
1604
+ /* @__PURE__ */ i(
1605
+ "path",
1606
+ {
1607
+ d: "M12 2 4 5v6c0 5.25 3.5 9.5 8 11 4.5-1.5 8-5.75 8-11V5l-8-3Z",
1608
+ stroke: "currentColor",
1609
+ "stroke-width": "2",
1610
+ "stroke-linejoin": "round"
1611
+ }
1612
+ ),
1613
+ /* @__PURE__ */ i(
1614
+ "path",
1615
+ {
1616
+ d: "m9 12 2 2 4-4",
1617
+ stroke: "currentColor",
1618
+ "stroke-width": "2",
1619
+ "stroke-linecap": "round",
1620
+ "stroke-linejoin": "round"
1621
+ }
1622
+ )
1623
+ ]
1624
+ }
1625
+ );
1626
+ }
1627
+ const Ot = 24, Oe = 16, Fe = 2;
1628
+ function Re(e, t) {
1629
+ const r = t * Fe;
1630
+ let a = Ot;
1631
+ for (e.style.fontSize = `${a}px`; e.scrollHeight > r && a > Oe; )
1632
+ a -= 1, e.style.fontSize = `${a}px`;
1633
+ }
1634
+ function Ue({ block: e, ctx: t }) {
1635
+ const r = e.level ?? 1, a = `h${r}`, n = r === 1 ? "text-[22px] sm:text-2xl font-semibold leading-tight text-center text-balance text-gray-800" : r === 2 ? "text-xl font-semibold leading-snug text-gray-900 tracking-tight" : "text-base font-medium text-gray-900", o = O(null), s = r === 1 && !!t.bootstrap.settings.title_auto_fit;
1636
+ return T(() => {
1637
+ if (!s || !o.current) return;
1638
+ const l = getComputedStyle(o.current), p = parseFloat(l.lineHeight) || Ot * 1.5;
1639
+ Re(o.current, p);
1640
+ }, [s, e.text]), /* @__PURE__ */ i(a, { ref: o, class: n, children: e.text });
1641
+ }
1642
+ function De(e) {
1643
+ const t = e.local ?? { currency: e.currency, amount: e.amount };
1644
+ if (e.interval === "year") {
1645
+ const r = (e.interval_count ?? 1) * 12;
1646
+ return { amount: t.amount / r, currency: t.currency };
1647
+ }
1648
+ return { amount: t.amount, currency: t.currency };
1649
+ }
1650
+ function at(e, t) {
1651
+ const r = e % 1 !== 0 ? 2 : 0;
1652
+ try {
1653
+ const a = new Intl.NumberFormat(void 0, {
1654
+ style: "currency",
1655
+ currency: t,
1656
+ currencyDisplay: "narrowSymbol",
1657
+ maximumFractionDigits: r,
1658
+ minimumFractionDigits: r
1659
+ }).formatToParts(e);
1660
+ let n = "", o = "";
1661
+ for (const s of a)
1662
+ s.type === "currency" ? n = s.value : s.type !== "literal" && (o += s.value);
1663
+ return { currency: n || t, amount: o.trim() };
1664
+ } catch {
1665
+ return { currency: t, amount: String(e) };
1666
+ }
1667
+ }
1668
+ function lt(e, t) {
1669
+ const { amount: r, currency: a } = De(e);
1670
+ if (!t) {
1671
+ const { currency: l, amount: p } = at(r, a);
1672
+ return { currency: l, amount: p, originalAmount: null };
1673
+ }
1674
+ const n = r * (1 - t / 100), o = at(n, a), s = at(r, a);
1675
+ return {
1676
+ currency: o.currency,
1677
+ amount: o.amount,
1678
+ originalAmount: `${s.currency}${s.amount}`
1679
+ };
1680
+ }
1681
+ function ot(e, t) {
1682
+ if (!e || e.length === 0) return null;
1683
+ const r = e.find(
1684
+ (n) => n.price_id === t && n.discount_percent && n.discount_percent > 0
1685
+ );
1686
+ return r || (e.find(
1687
+ (n) => n.price_id == null && n.discount_percent && n.discount_percent > 0
1688
+ ) ?? null);
1689
+ }
1690
+ function Ft(e, t) {
1691
+ if (e.label) return e.label.toUpperCase();
1692
+ if (!e.interval || e.interval === "lifetime")
1693
+ return t("pricing.plan_label.lifetime", "LIFETIME");
1694
+ const a = {
1695
+ day: { key: "pricing.plan_label.daily", fallback: "DAILY PLAN" },
1696
+ week: { key: "pricing.plan_label.weekly", fallback: "WEEKLY PLAN" },
1697
+ month: { key: "pricing.plan_label.monthly", fallback: "MONTHLY PLAN" },
1698
+ year: { key: "pricing.plan_label.yearly", fallback: "YEARLY PLAN" }
1699
+ }[e.interval];
1700
+ return a ? t(a.key, a.fallback) : `${e.interval.toUpperCase()} PLAN`;
1701
+ }
1702
+ function ct(e, t) {
1703
+ if (!e.interval || e.interval === "lifetime")
1704
+ return t("pricing.interval.lifetime_short", "lifetime");
1705
+ if (e.interval === "year") return t("pricing.interval.month", "month");
1706
+ const r = e.interval_count ?? 1;
1707
+ return r === 1 ? t(`pricing.interval.${e.interval}`, e.interval) : `${r} ${e.interval}s`;
1708
+ }
1709
+ function Ne({ block: e, ctx: t }) {
1710
+ const { t: r } = v(), a = e.priceIds && e.priceIds.length > 0 ? new Set(e.priceIds) : null, n = t.bootstrap.prices.filter((s) => !a || a.has(s.id));
1711
+ if (n.length === 0)
1712
+ return /* @__PURE__ */ i("p", { class: "text-sm text-gray-500", children: r("pricing.no_prices", "No prices available.") });
1713
+ const o = e.popular_label ?? r("pricing.most_popular", "Most popular");
1714
+ if (e.view === "compact")
1715
+ return /* @__PURE__ */ i(
1716
+ "div",
1717
+ {
1718
+ class: "flex w-full flex-col",
1719
+ role: "radiogroup",
1720
+ "aria-label": r("pricing.plans_aria", "Plans"),
1721
+ children: n.map((s, l) => /* @__PURE__ */ i(
1722
+ $e,
1723
+ {
1724
+ price: s,
1725
+ isLast: l === n.length - 1,
1726
+ isPopular: e.popular_price_id === s.id,
1727
+ popularLabel: o,
1728
+ offer: ot(t.bootstrap.offers, s.id),
1729
+ selected: t.selectedPriceId === s.id,
1730
+ onSelect: () => {
1731
+ t.setSelectedPriceId(s.id), t.onAction("price_selected", { priceId: s.id, price: s });
1732
+ },
1733
+ t: r
1734
+ },
1735
+ s.id
1736
+ ))
1737
+ }
1738
+ );
1739
+ if (e.view === "horizontal") {
1740
+ const s = Math.min(n.length, 3);
1741
+ return /* @__PURE__ */ i(
1742
+ "div",
1743
+ {
1744
+ class: "grid items-stretch gap-2",
1745
+ style: { gridTemplateColumns: `repeat(${s}, minmax(0, 1fr))` },
1746
+ role: "radiogroup",
1747
+ "aria-label": r("pricing.plans_aria", "Plans"),
1748
+ children: n.map((l) => /* @__PURE__ */ i(
1749
+ He,
1750
+ {
1751
+ price: l,
1752
+ isPopular: e.popular_price_id === l.id,
1753
+ popularLabel: o,
1754
+ offer: ot(t.bootstrap.offers, l.id),
1755
+ selected: t.selectedPriceId === l.id,
1756
+ onSelect: () => {
1757
+ t.setSelectedPriceId(l.id), t.onAction("price_selected", { priceId: l.id, price: l });
1758
+ },
1759
+ t: r
1760
+ },
1761
+ l.id
1762
+ ))
1763
+ }
1764
+ );
1765
+ }
1766
+ return /* @__PURE__ */ i(
1767
+ "div",
1768
+ {
1769
+ class: "flex flex-col gap-2",
1770
+ role: "radiogroup",
1771
+ "aria-label": r("pricing.plans_aria", "Plans"),
1772
+ children: n.map((s) => {
1773
+ const l = t.selectedPriceId === s.id, p = e.popular_price_id === s.id, g = ot(t.bootstrap.offers, s.id)?.discount_percent ?? null, { currency: h, amount: x, originalAmount: u } = lt(s, g);
1774
+ return /* @__PURE__ */ c(
1775
+ "button",
1776
+ {
1777
+ type: "button",
1778
+ role: "radio",
1779
+ "aria-checked": l,
1780
+ onClick: () => {
1781
+ t.setSelectedPriceId(s.id), t.onAction("price_selected", { priceId: s.id, price: s });
1782
+ },
1783
+ class: [
1784
+ "group relative inline-flex w-full mx-auto items-center justify-between flex-row-reverse gap-4 rounded-2xl border-2 p-4 text-left transition-colors duration-150 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",
1785
+ // Везде border 2px — selection выражается только цветом, layout
1786
+ // не прыгает (равная толщина у selected/unselected). Цветовая
1787
+ // разница accent vs gray достаточно сильная для visual hierarchy.
1788
+ l ? "border-[var(--pw-accent)] bg-transparent" : "border-gray-200 bg-transparent hover:bg-gray-50"
1789
+ ].join(" "),
1790
+ children: [
1791
+ /* @__PURE__ */ i(
1792
+ "span",
1793
+ {
1794
+ class: [
1795
+ "flex h-6.5 w-6.5 flex-shrink-0 items-center justify-center rounded-full border transition-colors",
1796
+ l ? "border-[var(--pw-accent)] text-white" : "border-gray-300 bg-transparent text-transparent",
1797
+ // Popular-label badge сидит absolute сверху-справа карточки и
1798
+ // визуально сдвигает центр content'а вниз. flex items-center
1799
+ // на карточке держит галочку по геометрическому центру, что
1800
+ // делает её визуально выше — компенсируем небольшим mt'ом.
1801
+ p ? "mt-3" : ""
1802
+ ].join(" "),
1803
+ style: l ? {
1804
+ background: "linear-gradient(135deg, color-mix(in srgb, var(--pw-accent) 70%, white) 0%, var(--pw-accent) 50%, color-mix(in srgb, var(--pw-accent) 85%, black) 100%)"
1805
+ } : void 0,
1806
+ "aria-hidden": "true",
1807
+ children: /* @__PURE__ */ i(
1808
+ "svg",
1809
+ {
1810
+ width: "14",
1811
+ height: "10",
1812
+ viewBox: "0 0 17 12",
1813
+ fill: "none",
1814
+ xmlns: "http://www.w3.org/2000/svg",
1815
+ class: l ? "opacity-100" : "opacity-0",
1816
+ children: /* @__PURE__ */ i(
1817
+ "path",
1818
+ {
1819
+ d: "M16.5234 0.476562C16.9805 0.898438 16.9805 1.63672 16.5234 2.05859L7.52344 11.0586C7.10156 11.5156 6.36328 11.5156 5.94141 11.0586L1.44141 6.55859C0.984375 6.13672 0.984375 5.39844 1.44141 4.97656C1.86328 4.51953 2.60156 4.51953 3.02344 4.97656L6.75 8.66797L14.9414 0.476562C15.3633 0.0195312 16.1016 0.0195312 16.5234 0.476562Z",
1820
+ fill: "currentColor"
1821
+ }
1822
+ )
1823
+ }
1824
+ )
1825
+ }
1826
+ ),
1827
+ /* @__PURE__ */ c("div", { class: "flex flex-1 flex-col gap-0.5", children: [
1828
+ /* @__PURE__ */ c("div", { class: "flex flex-wrap items-center gap-x-2 gap-y-1", children: [
1829
+ /* @__PURE__ */ i("span", { class: "text-xs font-normal uppercase tracking-normal text-gray-800/70", children: Ft(s, r) }),
1830
+ u ? (
1831
+ // opacity-60 приглушает strike: глаз сначала ловит label
1832
+ // и discount-badge, потом main price; original «бывшая цена»
1833
+ // — третичная информация, не должна конкурировать с label.
1834
+ /* @__PURE__ */ i("span", { class: "text-[15px] font-normal text-gray-400 opacity-60 line-through decoration-gray-400 decoration-[1.5px]", children: u })
1835
+ ) : null,
1836
+ g ? (
1837
+ // Emerald pill — фиксированный «успех/выгода», не зависит от
1838
+ // brand_color. Читается даже на тёмных бренд-акцентах.
1839
+ /* @__PURE__ */ c("span", { class: "rounded-full bg-emerald-100 px-2.5 py-1 text-xs font-bold leading-none text-emerald-700", children: [
1840
+ "-",
1841
+ g,
1842
+ "%"
1843
+ ] })
1844
+ ) : null
1845
+ ] }),
1846
+ /* @__PURE__ */ i("div", { class: "flex items-baseline gap-2 flex-wrap", children: /* @__PURE__ */ c("span", { class: "text-[26px] leading-tight whitespace-nowrap text-gray-800 font-medium", children: [
1847
+ /* @__PURE__ */ i("span", { class: "opacity-90", children: h }),
1848
+ " ",
1849
+ x,
1850
+ /* @__PURE__ */ c("span", { class: "text-sm font-normal text-gray-500", children: [
1851
+ " ",
1852
+ "/ ",
1853
+ ct(s, r)
1854
+ ] })
1855
+ ] }) }),
1856
+ s.description ? /* @__PURE__ */ i("span", { class: "mt-1 text-xs leading-relaxed text-gray-500", children: s.description }) : null,
1857
+ s.trial_days ? /* @__PURE__ */ i("span", { class: "mt-1 text-xs font-medium text-[var(--pw-accent)]", children: r("pricing.free_trial_days", "{days}-day free trial", { days: s.trial_days }) }) : null
1858
+ ] }),
1859
+ p ? /* @__PURE__ */ i(
1860
+ "span",
1861
+ {
1862
+ class: "absolute -top-[9px] -right-[6px] rounded-[11px] border-[5px] border-white px-2 py-1 text-[12px] font-semibold text-white",
1863
+ style: { background: "var(--pw-accent)" },
1864
+ children: o
1865
+ }
1866
+ ) : null
1867
+ ]
1868
+ },
1869
+ s.id
1870
+ );
1871
+ })
1872
+ }
1873
+ );
1874
+ }
1875
+ function Ve(e, t) {
1876
+ return e.label ? e.label : !e.interval || e.interval === "lifetime" ? t("pricing.interval.lifetime_short", "lifetime") : t(`pricing.interval.${e.interval}`, e.interval);
1877
+ }
1878
+ function $e({
1879
+ price: e,
1880
+ isLast: t,
1881
+ isPopular: r,
1882
+ popularLabel: a,
1883
+ offer: n,
1884
+ selected: o,
1885
+ onSelect: s,
1886
+ t: l
1887
+ }) {
1888
+ const p = n?.discount_percent ?? null, { currency: d, amount: g, originalAmount: h } = lt(e, p);
1889
+ return /* @__PURE__ */ c(
1890
+ "button",
1891
+ {
1892
+ type: "button",
1893
+ role: "radio",
1894
+ "aria-checked": o,
1895
+ onClick: s,
1896
+ class: "group relative inline-flex w-full max-w-[360px] mx-auto items-center justify-between gap-4 px-4 pt-3.5 text-left focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--pw-accent)]",
1897
+ children: [
1898
+ /* @__PURE__ */ i(
1899
+ "span",
1900
+ {
1901
+ class: [
1902
+ "flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full border transition-colors mb-3",
1903
+ o ? "border-[var(--pw-accent)] text-white" : "border-gray-300 bg-transparent text-transparent"
1904
+ ].join(" "),
1905
+ style: o ? {
1906
+ background: "linear-gradient(135deg, color-mix(in srgb, var(--pw-accent) 70%, white) 0%, var(--pw-accent) 50%, color-mix(in srgb, var(--pw-accent) 85%, black) 100%)"
1907
+ } : void 0,
1908
+ "aria-hidden": "true",
1909
+ children: /* @__PURE__ */ i(
1910
+ "svg",
1911
+ {
1912
+ width: "14",
1913
+ height: "10",
1914
+ viewBox: "0 0 17 12",
1915
+ fill: "none",
1916
+ xmlns: "http://www.w3.org/2000/svg",
1917
+ class: o ? "opacity-100" : "opacity-0",
1918
+ children: /* @__PURE__ */ i(
1919
+ "path",
1920
+ {
1921
+ d: "M16.5234 0.476562C16.9805 0.898438 16.9805 1.63672 16.5234 2.05859L7.52344 11.0586C7.10156 11.5156 6.36328 11.5156 5.94141 11.0586L1.44141 6.55859C0.984375 6.13672 0.984375 5.39844 1.44141 4.97656C1.86328 4.51953 2.60156 4.51953 3.02344 4.97656L6.75 8.66797L14.9414 0.476562C15.3633 0.0195312 16.1016 0.0195312 16.5234 0.476562Z",
1922
+ fill: "currentColor"
1923
+ }
1924
+ )
1925
+ }
1926
+ )
1927
+ }
1928
+ ),
1929
+ /* @__PURE__ */ c(
1930
+ "div",
1931
+ {
1932
+ class: [
1933
+ "flex flex-1 items-center gap-1.5 pb-3.5",
1934
+ t ? "" : "border-b border-gray-200"
1935
+ ].join(" "),
1936
+ children: [
1937
+ /* @__PURE__ */ c("div", { class: "flex flex-wrap items-center gap-1 gap-x-1.5", children: [
1938
+ /* @__PURE__ */ i("span", { class: "text-base font-normal capitalize text-gray-800", children: Ve(e, l) }),
1939
+ r ? (
1940
+ // Pastel brand-mix pill — точно как `badge` в TelegramPricingRadio.
1941
+ // Низкий visual weight: pill про "имя плана" (most popular), а не
1942
+ // про savings — не должна конкурировать с -X% discount-pill.
1943
+ /* @__PURE__ */ i(
1944
+ "span",
1945
+ {
1946
+ class: "rounded-[9px] px-2 py-1 text-[10px] font-bold",
1947
+ style: {
1948
+ background: "linear-gradient(160deg, color-mix(in srgb, var(--pw-accent) 6%, white) 0%, color-mix(in srgb, var(--pw-accent) 15%, white) 100%)",
1949
+ color: "var(--pw-accent)"
1950
+ },
1951
+ children: a
1952
+ }
1953
+ )
1954
+ ) : null,
1955
+ p ? /* @__PURE__ */ c("span", { class: "rounded-md bg-emerald-100 px-1.5 py-0.5 text-[10px] font-bold leading-none text-emerald-700", children: [
1956
+ "-",
1957
+ p,
1958
+ "%"
1959
+ ] }) : null
1960
+ ] }),
1961
+ /* @__PURE__ */ i("div", { class: "flex-1" }),
1962
+ /* @__PURE__ */ c("span", { class: "flex items-baseline gap-1.5 text-base font-normal text-gray-600", children: [
1963
+ h ? /* @__PURE__ */ i("span", { class: "text-xs text-gray-400 line-through decoration-gray-400 decoration-[1.5px]", children: h }) : null,
1964
+ /* @__PURE__ */ c("span", { class: "whitespace-nowrap", children: [
1965
+ /* @__PURE__ */ i("span", { class: "opacity-90", children: d }),
1966
+ g,
1967
+ /* @__PURE__ */ c("span", { class: "text-xs text-gray-400", children: [
1968
+ " ",
1969
+ "/ ",
1970
+ ct(e, l)
1971
+ ] })
1972
+ ] })
1973
+ ] })
1974
+ ]
1975
+ }
1976
+ )
1977
+ ]
1978
+ }
1979
+ );
1980
+ }
1981
+ function He({
1982
+ price: e,
1983
+ isPopular: t,
1984
+ popularLabel: r,
1985
+ offer: a,
1986
+ selected: n,
1987
+ onSelect: o,
1988
+ t: s
1989
+ }) {
1990
+ const l = a?.discount_percent ?? null, { currency: p, amount: d, originalAmount: g } = lt(e, l);
1991
+ return /* @__PURE__ */ c(
1992
+ "button",
1993
+ {
1994
+ type: "button",
1995
+ role: "radio",
1996
+ "aria-checked": n,
1997
+ onClick: o,
1998
+ class: [
1999
+ "group relative flex h-full flex-col items-center justify-start gap-1 rounded-2xl border-2 px-3 pb-4 pt-3.5 text-center transition-colors duration-150 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",
2000
+ n ? "border-[var(--pw-accent)]" : "border-gray-200 hover:bg-gray-50"
2001
+ ].join(" "),
2002
+ style: n ? { background: "color-mix(in srgb, var(--pw-accent) 6%, transparent)" } : void 0,
2003
+ children: [
2004
+ /* @__PURE__ */ i("span", { class: "flex min-h-[2.4em] items-center text-[11px] font-normal uppercase leading-tight text-gray-800/70", children: Ft(e, s) }),
2005
+ /* @__PURE__ */ c("div", { class: "flex h-[22px] items-center justify-center gap-1.5", children: [
2006
+ g ? /* @__PURE__ */ i("span", { class: "text-[12px] text-gray-400 line-through decoration-gray-400 decoration-[1.5px]", children: g }) : null,
2007
+ l ? /* @__PURE__ */ c("span", { class: "rounded-md bg-emerald-100 px-1.5 py-0.5 text-[10px] font-bold leading-none text-emerald-700", children: [
2008
+ "-",
2009
+ l,
2010
+ "%"
2011
+ ] }) : null
2012
+ ] }),
2013
+ /* @__PURE__ */ c("span", { class: "text-[26px] leading-none whitespace-nowrap text-gray-800 font-medium", children: [
2014
+ /* @__PURE__ */ i("span", { class: "opacity-90", children: p }),
2015
+ d
2016
+ ] }),
2017
+ /* @__PURE__ */ c("span", { class: "text-xs font-normal text-gray-500", children: [
2018
+ "/ ",
2019
+ ct(e, s)
2020
+ ] }),
2021
+ e.trial_days ? /* @__PURE__ */ i("span", { class: "mt-1 text-[11px] font-medium text-[var(--pw-accent)]", children: s("pricing.free_trial_days", "{days}-day free trial", { days: e.trial_days }) }) : null,
2022
+ t ? /* @__PURE__ */ i(
2023
+ "span",
2024
+ {
2025
+ class: "absolute -top-[10px] left-1/2 -translate-x-1/2 whitespace-nowrap rounded-[11px] border-[3px] border-white px-2.5 py-0.5 text-[10px] font-semibold uppercase tracking-wider text-white",
2026
+ style: { background: "var(--pw-accent)" },
2027
+ children: r
2028
+ }
2029
+ ) : null
2030
+ ]
2031
+ }
2032
+ );
2033
+ }
2034
+ function Ge({ block: e }) {
2035
+ return /* @__PURE__ */ i("p", { class: "text-[0.9375rem] leading-relaxed text-gray-600", children: e.text });
2036
+ }
2037
+ const qe = {
2038
+ week: 0.25,
2039
+ month: 1,
2040
+ year: 12
2041
+ };
2042
+ function We(e, t) {
2043
+ return e ? t(`pricing.interval.${e}`, e) : t("pricing.interval.period", "period");
2044
+ }
2045
+ function Ze({ block: e, ctx: t }) {
2046
+ const { t: r } = v();
2047
+ if (!e.queries.length) return null;
2048
+ const n = t.bootstrap.prices.find((s) => s.id === t.selectedPriceId)?.interval ?? null, o = n ? qe[n] : void 0;
2049
+ return /* @__PURE__ */ c("div", { class: "flex flex-col gap-2", children: [
2050
+ /* @__PURE__ */ i("div", { class: "text-sm font-semibold text-gray-800", children: r("pricing.included_per", "Included per {interval}:", {
2051
+ interval: We(n, r)
2052
+ }) }),
2053
+ /* @__PURE__ */ i("ul", { class: "flex flex-col gap-2", role: "list", children: e.queries.map((s) => {
2054
+ const l = Number.isFinite(s.count) ? s.count : 0, p = o !== void 0 ? Math.round(l * o) : l;
2055
+ return /* @__PURE__ */ c("li", { class: `flex gap-3 ${s.desc ? "items-start" : "items-center"}`, children: [
2056
+ /* @__PURE__ */ i(
2057
+ "svg",
2058
+ {
2059
+ width: "18",
2060
+ height: "18",
2061
+ viewBox: "0 0 20 20",
2062
+ fill: "none",
2063
+ class: `flex-shrink-0 text-emerald-500 ${s.desc ? "mt-0.5" : ""}`,
2064
+ "aria-hidden": "true",
2065
+ children: /* @__PURE__ */ i(
2066
+ "path",
2067
+ {
2068
+ d: "M4 10.5l3.5 3.5 8.5-8.5",
2069
+ stroke: "currentColor",
2070
+ "stroke-width": "2.5",
2071
+ "stroke-linecap": "round",
2072
+ "stroke-linejoin": "round"
2073
+ }
2074
+ )
2075
+ }
2076
+ ),
2077
+ /* @__PURE__ */ c("div", { children: [
2078
+ /* @__PURE__ */ i("span", { class: "font-semibold text-gray-900 text-sm", children: p }),
2079
+ " ",
2080
+ /* @__PURE__ */ i("span", { class: "text-sm text-gray-800", children: s.name }),
2081
+ s.desc ? /* @__PURE__ */ c(q, { children: [
2082
+ /* @__PURE__ */ i("br", {}),
2083
+ /* @__PURE__ */ i("span", { class: "text-xs text-gray-400", children: s.desc })
2084
+ ] }) : null
2085
+ ] })
2086
+ ] }, s.id);
2087
+ }) })
2088
+ ] });
2089
+ }
2090
+ const Ke = {
2091
+ heading: Ue,
2092
+ text: Ge,
2093
+ price_grid: Ne,
2094
+ cta_button: Pe,
2095
+ auth_panel: Pt,
2096
+ current_session: Te,
2097
+ features_list: Ee,
2098
+ tokenization_gate: Ze,
2099
+ guarantee_badge: je,
2100
+ offer_banner: xe
2101
+ };
2102
+ function Ye({ layout: e, bootstrap: t, onAction: r, auth: a, authSession: n }) {
2103
+ const o = St(() => {
2104
+ for (const u of e.blocks)
2105
+ if (u.type === "price_grid" && u.popular_price_id && t.prices.some((m) => m.id === u.popular_price_id))
2106
+ return u.popular_price_id;
2107
+ return t.prices[0]?.id ?? null;
2108
+ }, [e.blocks, t.prices]), [s, l] = b(o), p = {
2109
+ bootstrap: t,
2110
+ selectedPriceId: s,
2111
+ setSelectedPriceId: l,
2112
+ onAction: r,
2113
+ auth: a,
2114
+ authSession: n
2115
+ }, d = e.blocks.findIndex((u) => u.type === "cta_button"), g = d === -1 ? e.blocks : e.blocks.slice(0, d), h = d === -1 ? [] : e.blocks.slice(d), x = (u, m) => {
2116
+ const y = Ke[u.type];
2117
+ return y ? /* @__PURE__ */ i(y, { block: u, ctx: p }, `${u.type}-${m}`) : (typeof console < "u" && console.warn(`[paywall] unknown block type: ${u.type}`), null);
2118
+ };
2119
+ return /* @__PURE__ */ c(q, { children: [
2120
+ /* @__PURE__ */ i("div", { class: "flex-1 min-h-0 overflow-y-auto px-6 pb-3 pt-6 sm:px-8 sm:pb-4 sm:pt-8", children: /* @__PURE__ */ i("div", { class: "flex flex-col gap-6", children: g.map(x) }) }),
2121
+ h.length > 0 ? (
2122
+ // Тонкий shadow-top вместо border-t — создаёт depth, читается как
2123
+ // «footer закреплён к низу dialog'а». Линия выглядела как divider
2124
+ // в обычном flow, не передавала sticky-character.
2125
+ /* @__PURE__ */ i(
2126
+ "div",
2127
+ {
2128
+ class: "flex flex-col gap-4 bg-white px-6 pb-6 pt-3 sm:px-8",
2129
+ style: { boxShadow: "0 -4px 12px -4px rgba(15,23,42,0.06)" },
2130
+ children: h.map((u, m) => x(u, g.length + m))
2131
+ }
2132
+ )
2133
+ ) : null
2134
+ ] });
2135
+ }
2136
+ function Xe(e, t, r, a) {
2137
+ return e ? a ? { open: !0, view: "purchased", error: null } : t.status === "idle" || t.status === "loading" ? { open: !0, view: "loading", error: null } : t.status === "error" ? { open: !0, view: "error", error: t.error } : r.kind === "support" ? { open: !0, view: "support", error: null } : r.kind === "auth_gate" ? { open: !0, view: "auth", error: null } : r.kind === "anon_gate" ? { open: !0, view: "anon", error: null } : r.kind === "awaiting_payment" ? { open: !0, view: "awaiting_payment", error: null } : r.kind === "popup_blocked" ? { open: !0, view: "popup_blocked", error: null } : r.kind === "purchase_success" ? { open: !0, view: "purchased", error: null } : r.kind === "verifying" ? { open: !0, view: "loading", error: null } : { open: !0, view: "layout", error: null } : { open: !1, view: null, error: null };
2138
+ }
2139
+ function Je(e, t) {
2140
+ return e.open === t.open && e.view === t.view && e.error === t.error;
2141
+ }
2142
+ function Qe({
2143
+ client: e,
2144
+ open: t,
2145
+ onClose: r,
2146
+ onEvent: a,
2147
+ initialView: n,
2148
+ purchased: o,
2149
+ renew: s,
2150
+ onState: l,
2151
+ inline: p
2152
+ }) {
2153
+ const [d, g] = b({ status: "idle" }), [h, x] = b(
2154
+ () => e.auth?.getCachedSession() ?? null
2155
+ ), [u, m] = b(() => n === "support" ? { kind: "support", origin: "standalone" } : n === "auth" ? { kind: "auth_gate", origin: "standalone" } : n === "anon" ? { kind: "anon_gate", origin: "standalone" } : { kind: "layout" }), y = O(!1), B = O(null);
2156
+ T(() => {
2157
+ if (!l) return;
2158
+ const w = Xe(t, d, u, o), f = B.current;
2159
+ f && Je(f, w) || (B.current = w, l(w));
2160
+ }, [t, d, u, o, l]), T(() => {
2161
+ if (e.auth)
2162
+ return e.auth.onAuthChange((w, f) => x(f));
2163
+ }, [e.auth]), T(() => {
2164
+ if (typeof e.onBootstrapChange == "function")
2165
+ return e.onBootstrapChange((w) => {
2166
+ g(
2167
+ (f) => f.status === "ready" ? { status: "ready", data: w } : f
2168
+ );
2169
+ });
2170
+ }, [e]), T(() => {
2171
+ if (!t || d.status === "ready" || d.status === "loading") return;
2172
+ let w = !1;
2173
+ return g({ status: "loading" }), e.bootstrap().then((f) => {
2174
+ w || (g({ status: "ready", data: f }), a("ready", f), f.user?.has_active_subscription && !s && (a("purchase_completed", {
2175
+ priceId: null,
2176
+ sessionId: null,
2177
+ restored: !0
2178
+ }), m({ kind: "purchase_success", restored: !0 })));
2179
+ }).catch((f) => {
2180
+ if (w) return;
2181
+ const _ = f instanceof R ? f : new R("unknown", "Failed to load paywall", { cause: f });
2182
+ g({ status: "error", error: _ }), a("error", _);
2183
+ }), () => {
2184
+ w = !0;
2185
+ };
2186
+ }, [t, e]), Vt(() => {
2187
+ if (!t) {
2188
+ m({ kind: "layout" }), y.current = !1;
2189
+ return;
2190
+ }
2191
+ n === "support" ? m({ kind: "support", origin: "standalone" }) : n === "auth" ? m({ kind: "auth_gate", origin: "standalone" }) : n === "anon" && m({ kind: "anon_gate", origin: "standalone" });
2192
+ }, [t, n]);
2193
+ const P = async (w) => {
2194
+ try {
2195
+ const f = await e.createCheckout({
2196
+ priceId: w,
2197
+ ignoreActivePurchase: s === !0
2198
+ });
2199
+ if (a("checkout_started", { priceId: w, url: f.url, acquiring: f.acquiring }), typeof window > "u" || !f.url) return;
2200
+ const _ = window.open(f.url, "_blank");
2201
+ if (_) {
2202
+ try {
2203
+ _.opener = null;
2204
+ } catch {
2205
+ }
2206
+ m({ kind: "awaiting_payment", priceId: w, url: f.url });
2207
+ } else
2208
+ m({ kind: "popup_blocked", priceId: w, url: f.url });
2209
+ } catch (f) {
2210
+ if (f instanceof R && f.code === "already_purchased") {
2211
+ try {
2212
+ await e.getUser({ force: !0 });
2213
+ } catch {
2214
+ }
2215
+ a("purchase_completed", { priceId: w, sessionId: null, restored: !0 }), m({ kind: "purchase_success", restored: !0 });
2216
+ return;
2217
+ }
2218
+ const _ = f instanceof R ? f : new R("checkout_failed", "Checkout failed", { cause: f });
2219
+ a("error", _), m({ kind: "layout" });
2220
+ }
2221
+ }, k = (w, f) => {
2222
+ if (typeof window > "u") return;
2223
+ const _ = window.open(f, "_blank");
2224
+ if (_) {
2225
+ try {
2226
+ _.opener = null;
2227
+ } catch {
2228
+ }
2229
+ m({ kind: "awaiting_payment", priceId: w, url: f });
2230
+ }
2231
+ };
2232
+ T(() => {
2233
+ if (u.kind !== "auth_gate" || !h || h.user.is_anonymous || y.current) return;
2234
+ y.current = !0;
2235
+ const w = u.pendingCheckout, f = u.origin;
2236
+ m({ kind: "verifying" }), (async () => {
2237
+ if (!s)
2238
+ try {
2239
+ if ((await e.getUser({ force: !0 })).has_active_subscription) {
2240
+ a("purchase_completed", {
2241
+ priceId: w?.priceId ?? null,
2242
+ sessionId: null,
2243
+ restored: !0
2244
+ }), m({ kind: "purchase_success", restored: !0 });
2245
+ return;
2246
+ }
2247
+ } catch {
2248
+ }
2249
+ if (!w) {
2250
+ f === "standalone" ? r() : m({ kind: "layout" });
2251
+ return;
2252
+ }
2253
+ await P(w.priceId);
2254
+ })().finally(() => {
2255
+ y.current = !1;
2256
+ });
2257
+ }, [h, u]);
2258
+ const A = async (w, f) => {
2259
+ if (w === "close") {
2260
+ r();
2261
+ return;
2262
+ }
2263
+ if (w === "price_selected") {
2264
+ a("price_selected", f);
2265
+ return;
2266
+ }
2267
+ if (w === "restore") {
2268
+ if (!e.auth) return;
2269
+ const _ = e.auth.getCachedSession();
2270
+ if (_ && !_.user.is_anonymous) return;
2271
+ m({ kind: "auth_gate", intent: "restore" });
2272
+ return;
2273
+ }
2274
+ if (w === "support") {
2275
+ m({ kind: "support", origin: "layout" });
2276
+ return;
2277
+ }
2278
+ if (w === "checkout" && d.status === "ready") {
2279
+ const _ = f?.priceId;
2280
+ if (!_) {
2281
+ a("error", new R("no_price", "No price selected"));
2282
+ return;
2283
+ }
2284
+ const W = d.data.settings.checkout_mode ?? "guest", S = e.auth?.getCachedSession() ?? null, L = !!S && !S.user.is_anonymous;
2285
+ if (W === "preauth" && !!e.auth && !L) {
2286
+ m({ kind: "auth_gate", pendingCheckout: { priceId: _ } });
2287
+ return;
2288
+ }
2289
+ await P(_);
2290
+ }
2291
+ }, C = d.status === "ready" ? d.data.settings.brand_color : null, j = d.status === "ready" ? d.data.settings.allow_close !== !1 : !0, E = u.kind === "layout" && d.status === "ready" ? Et(d.data.offers) : null, D = E ? /* @__PURE__ */ i(ve, { offer: E }) : null, F = {
2292
+ type: "auth_panel",
2293
+ // Заголовок не задаём — AuthGate сам решит по intent'у (restore →
2294
+ // "Restore Purchases", остальные → дефолтный "Welcome back!").
2295
+ allow_signup: !0,
2296
+ allow_password_reset: !0,
2297
+ // Не скрываем при наличии сессии — auto-resume useEffect отрабатывает быстрее,
2298
+ // чем хотим показывать "Signed in as ..." промежуточным экраном.
2299
+ hide_when_authenticated: !1,
2300
+ providers: d.status === "ready" ? d.data.settings.auth_providers : void 0
2301
+ }, U = u.kind === "support" ? /* @__PURE__ */ i(
2302
+ ke,
2303
+ {
2304
+ client: e,
2305
+ authSession: h,
2306
+ origin: u.origin,
2307
+ onBack: () => {
2308
+ u.origin === "standalone" ? r() : m({ kind: "layout" });
2309
+ }
2310
+ }
2311
+ ) : null, M = u.kind === "auth_gate" && u.origin !== "standalone" || u.kind === "support", I = d.status === "ready" ? d.data : null;
2312
+ return /* @__PURE__ */ i(Qt, { bootstrap: I, children: /* @__PURE__ */ i(
2313
+ te,
2314
+ {
2315
+ open: t,
2316
+ onClose: r,
2317
+ brandColor: C,
2318
+ topBanner: D,
2319
+ allowClose: j,
2320
+ hideCloseButton: M,
2321
+ inline: p,
2322
+ labelledBy: "pw-title",
2323
+ children: o ? /* @__PURE__ */ i(kt, { onContinue: r }) : u.kind === "purchase_success" ? /* @__PURE__ */ i(kt, { restored: u.restored, onContinue: r }) : U || (d.status === "loading" || d.status === "idle" || u.kind === "verifying" ? /* @__PURE__ */ i(tr, { verifying: u.kind === "verifying" }) : d.status === "error" ? /* @__PURE__ */ i(er, { message: d.error.message }) : u.kind === "auth_gate" && e.auth ? /* @__PURE__ */ i(
2324
+ ge,
2325
+ {
2326
+ block: F,
2327
+ bootstrap: d.data,
2328
+ auth: e.auth,
2329
+ authSession: h,
2330
+ showBack: u.origin !== "standalone",
2331
+ intent: u.intent ?? (u.origin === "standalone" ? "standalone" : "preauth"),
2332
+ onBack: () => {
2333
+ u.origin === "standalone" ? r() : m({ kind: "layout" });
2334
+ }
2335
+ }
2336
+ ) : u.kind === "anon_gate" && e.auth ? /* @__PURE__ */ i(
2337
+ we,
2338
+ {
2339
+ auth: e.auth,
2340
+ onSuccess: () => {
2341
+ u.origin === "standalone" ? r() : m({ kind: "layout" });
2342
+ },
2343
+ onBack: u.origin === "standalone" ? void 0 : () => m({ kind: "layout" })
2344
+ }
2345
+ ) : u.kind === "awaiting_payment" ? /* @__PURE__ */ i(
2346
+ ir,
2347
+ {
2348
+ client: e,
2349
+ onBack: () => m({ kind: "layout" }),
2350
+ onReopen: () => {
2351
+ if (typeof window > "u") return;
2352
+ const w = window.open(u.url, "_blank");
2353
+ if (w)
2354
+ try {
2355
+ w.opener = null;
2356
+ } catch {
2357
+ }
2358
+ },
2359
+ onRetry: () => P(u.priceId)
2360
+ }
2361
+ ) : u.kind === "popup_blocked" ? /* @__PURE__ */ i(rr, { onReopen: () => k(u.priceId, u.url) }) : /* @__PURE__ */ i(
2362
+ Ye,
2363
+ {
2364
+ layout: d.data.layout,
2365
+ bootstrap: d.data,
2366
+ onAction: A,
2367
+ auth: e.auth,
2368
+ authSession: h
2369
+ }
2370
+ ))
2371
+ }
2372
+ ) });
2373
+ }
2374
+ function tr({ verifying: e }) {
2375
+ const { t } = v();
2376
+ return /* @__PURE__ */ c("div", { class: "flex flex-col items-center justify-center gap-3 py-12", children: [
2377
+ /* @__PURE__ */ i("span", { class: "inline-block h-7 w-7 animate-spin rounded-full border-[2.5px] border-gray-200 border-t-[var(--pw-accent)]" }),
2378
+ /* @__PURE__ */ i("span", { class: "text-xs font-medium tracking-wide text-gray-500", children: e ? t("modal.verifying_subscription", "Checking your subscription…") : t("modal.loading", "Loading…") })
2379
+ ] });
2380
+ }
2381
+ function er({ message: e }) {
2382
+ const { t } = v();
2383
+ return /* @__PURE__ */ c("div", { class: "flex flex-col items-center gap-2 py-8 text-center", children: [
2384
+ /* @__PURE__ */ i("div", { class: "flex h-11 w-11 items-center justify-center rounded-full bg-red-50", children: /* @__PURE__ */ c("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
2385
+ /* @__PURE__ */ i("path", { d: "M10 6v5M10 14h.01", stroke: "#dc2626", "stroke-width": "2", "stroke-linecap": "round" }),
2386
+ /* @__PURE__ */ i("circle", { cx: "10", cy: "10", r: "8", stroke: "#dc2626", "stroke-width": "1.75" })
2387
+ ] }) }),
2388
+ /* @__PURE__ */ i("p", { class: "text-sm font-semibold tracking-tight text-gray-900", children: t("modal.error_generic", "Something went wrong") }),
2389
+ /* @__PURE__ */ i("p", { class: "text-xs leading-relaxed text-gray-500", children: e })
2390
+ ] });
2391
+ }
2392
+ function rr({ onReopen: e }) {
2393
+ const { t } = v();
2394
+ return /* @__PURE__ */ c("div", { class: "flex flex-col items-center gap-3 py-8 text-center", children: [
2395
+ /* @__PURE__ */ i(
2396
+ "div",
2397
+ {
2398
+ class: "flex h-11 w-11 items-center justify-center rounded-full",
2399
+ style: { background: "color-mix(in srgb, var(--pw-accent) 12%, white)", color: "var(--pw-accent)" },
2400
+ "aria-hidden": "true",
2401
+ children: /* @__PURE__ */ c("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", children: [
2402
+ /* @__PURE__ */ i("path", { d: "M4 5h12v10H4z", stroke: "currentColor", "stroke-width": "1.75", "stroke-linejoin": "round" }),
2403
+ /* @__PURE__ */ i("path", { d: "M7 9l3 3 4-5", stroke: "currentColor", "stroke-width": "1.75", "stroke-linecap": "round", "stroke-linejoin": "round" })
2404
+ ] })
2405
+ }
2406
+ ),
2407
+ /* @__PURE__ */ i("p", { class: "text-sm font-semibold tracking-tight text-gray-900", children: t("payment.popup_blocked_title", "Allow popups to continue") }),
2408
+ /* @__PURE__ */ i("p", { class: "max-w-[18rem] text-xs leading-relaxed text-gray-500", children: t("payment.popup_blocked_message", "Your browser blocked the checkout tab. Click below to open it.") }),
2409
+ /* @__PURE__ */ i(
2410
+ "button",
2411
+ {
2412
+ type: "button",
2413
+ onClick: e,
2414
+ class: "mt-1 rounded-xl px-4 py-2 text-xs font-semibold text-white transition-all hover:-translate-y-px hover:brightness-105 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",
2415
+ style: {
2416
+ background: "linear-gradient(180deg, color-mix(in srgb, var(--pw-accent) 92%, white), var(--pw-accent))",
2417
+ boxShadow: "0 1px 2px rgba(15,23,42,0.08), 0 6px 14px -4px color-mix(in srgb, var(--pw-accent) 50%, transparent)"
2418
+ },
2419
+ children: t("payment.open_checkout_button", "Open checkout")
2420
+ }
2421
+ )
2422
+ ] });
2423
+ }
2424
+ function ir({
2425
+ client: e,
2426
+ onBack: t,
2427
+ onReopen: r,
2428
+ onRetry: a
2429
+ }) {
2430
+ const { t: n } = v(), [o, s] = b(!1), [l, p] = b(!1), d = O(null);
2431
+ T(() => () => {
2432
+ d.current !== null && clearTimeout(d.current);
2433
+ }, []);
2434
+ const g = async () => {
2435
+ if (!o) {
2436
+ s(!0), p(!1);
2437
+ try {
2438
+ if ((await e.getUser({ force: !0 })).has_active_subscription) {
2439
+ typeof window < "u" && window.postMessage({ type: "paywall_purchase" }, "*");
2440
+ return;
2441
+ }
2442
+ p(!0), d.current !== null && clearTimeout(d.current), d.current = setTimeout(() => {
2443
+ p(!1), d.current = null;
2444
+ }, 5e3);
2445
+ } catch {
2446
+ p(!0);
2447
+ } finally {
2448
+ s(!1);
2449
+ }
2450
+ }
2451
+ };
2452
+ return /* @__PURE__ */ c("div", { class: "flex flex-col gap-3", children: [
2453
+ /* @__PURE__ */ i(
2454
+ "button",
2455
+ {
2456
+ type: "button",
2457
+ onClick: t,
2458
+ class: "-ml-1 self-start rounded-md px-1.5 py-0.5 text-xs font-medium text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",
2459
+ children: n("nav.back", "← Back")
2460
+ }
2461
+ ),
2462
+ /* @__PURE__ */ c("div", { class: "flex flex-col items-center gap-3 py-6 text-center", children: [
2463
+ /* @__PURE__ */ c("div", { class: "relative flex h-12 w-12 items-center justify-center", children: [
2464
+ /* @__PURE__ */ i(
2465
+ "span",
2466
+ {
2467
+ class: "absolute inset-0 animate-ping rounded-full opacity-40",
2468
+ style: { background: "color-mix(in srgb, var(--pw-accent) 30%, transparent)" },
2469
+ "aria-hidden": "true"
2470
+ }
2471
+ ),
2472
+ /* @__PURE__ */ i("span", { class: "relative inline-block h-7 w-7 animate-spin rounded-full border-[2.5px] border-gray-200 border-t-[var(--pw-accent)]" })
2473
+ ] }),
2474
+ /* @__PURE__ */ i("p", { class: "text-sm font-semibold tracking-tight text-gray-900", children: n("payment.awaiting_title", "Complete payment in the new tab") }),
2475
+ /* @__PURE__ */ i("p", { class: "max-w-[20rem] text-xs leading-relaxed text-gray-500", children: n(
2476
+ "payment.awaiting_subtitle",
2477
+ "We'll detect your payment automatically — or click below once you're done."
2478
+ ) }),
2479
+ /* @__PURE__ */ i(
2480
+ "button",
2481
+ {
2482
+ type: "button",
2483
+ onClick: g,
2484
+ disabled: o,
2485
+ class: "mt-1 rounded-xl px-5 py-2.5 text-sm font-semibold text-white transition-all hover:-translate-y-px hover:brightness-105 disabled:cursor-not-allowed disabled:opacity-60 disabled:hover:translate-y-0 disabled:hover:brightness-100 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",
2486
+ style: {
2487
+ background: "linear-gradient(180deg, color-mix(in srgb, var(--pw-accent) 92%, white), var(--pw-accent))",
2488
+ boxShadow: "0 1px 2px rgba(15,23,42,0.08), 0 6px 14px -4px color-mix(in srgb, var(--pw-accent) 50%, transparent)"
2489
+ },
2490
+ children: o ? n("payment.checking", "Checking…") : n("payment.ive_paid", "I've paid")
2491
+ }
2492
+ ),
2493
+ l ? /* @__PURE__ */ i("p", { class: "text-xs leading-relaxed text-gray-500", children: n("payment.still_processing", "Payment is still being processed. Please try again in a moment.") }) : null
2494
+ ] }),
2495
+ /* @__PURE__ */ c("div", { class: "rounded-2xl border border-gray-200 bg-gray-50/60 p-3.5", children: [
2496
+ /* @__PURE__ */ i("p", { class: "text-xs leading-relaxed text-gray-600", children: n("payment.popup_help_text", "Checkout window didn't open or got blocked? Click here to open it again.") }),
2497
+ /* @__PURE__ */ i(
2498
+ "button",
2499
+ {
2500
+ type: "button",
2501
+ onClick: r,
2502
+ class: "mt-2.5 w-full rounded-xl border border-gray-200 bg-white px-3 py-2 text-xs font-semibold text-gray-700 transition-colors hover:border-gray-300 hover:bg-gray-50 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",
2503
+ children: n("payment.open_checkout_again", "Open checkout again")
2504
+ }
2505
+ )
2506
+ ] }),
2507
+ /* @__PURE__ */ i(
2508
+ "button",
2509
+ {
2510
+ type: "button",
2511
+ onClick: a,
2512
+ class: "self-center rounded-md px-2 py-1 text-xs text-gray-500 underline-offset-2 hover:text-gray-900 hover:underline focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",
2513
+ children: n("payment.tab_closed_retry", "Tab closed? Try again")
2514
+ }
2515
+ )
2516
+ ] });
2517
+ }
2518
+ function kt({
2519
+ onContinue: e,
2520
+ restored: t = !1
2521
+ }) {
2522
+ const { t: r } = v();
2523
+ return /* @__PURE__ */ c("div", { class: "flex flex-col items-center gap-3 py-8 text-center", children: [
2524
+ /* @__PURE__ */ i(
2525
+ "div",
2526
+ {
2527
+ class: "flex h-14 w-14 items-center justify-center rounded-full ring-8",
2528
+ style: {
2529
+ background: "linear-gradient(135deg, #4ade80, #16a34a)",
2530
+ color: "#fff",
2531
+ // emerald ring with low alpha for a halo effect
2532
+ boxShadow: "0 0 0 8px rgba(74,222,128,0.12), 0 8px 20px -6px rgba(22,163,74,0.45)"
2533
+ },
2534
+ "aria-hidden": "true",
2535
+ children: /* @__PURE__ */ i("svg", { width: "28", height: "28", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ i(
2536
+ "path",
2537
+ {
2538
+ d: "M5 13l4 4L19 7",
2539
+ stroke: "currentColor",
2540
+ "stroke-width": "2.5",
2541
+ "stroke-linecap": "round",
2542
+ "stroke-linejoin": "round"
2543
+ }
2544
+ ) })
2545
+ }
2546
+ ),
2547
+ /* @__PURE__ */ i("p", { id: "pw-title", class: "mt-1 text-lg font-semibold tracking-tight text-gray-900", children: t ? r("modal.purchase_restored_title", "Subscription restored") : r("modal.purchase_success_title", "Payment received") }),
2548
+ /* @__PURE__ */ i("p", { class: "text-sm leading-relaxed text-gray-500", children: t ? r(
2549
+ "modal.purchase_restored_subtitle",
2550
+ "Welcome back — your subscription is already active."
2551
+ ) : r("modal.purchase_success_subtitle", "Your subscription is now active.") }),
2552
+ /* @__PURE__ */ i(
2553
+ "button",
2554
+ {
2555
+ type: "button",
2556
+ onClick: e,
2557
+ class: "mt-3 rounded-xl px-5 py-2.5 text-sm font-semibold text-white transition-all hover:-translate-y-px hover:brightness-105 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",
2558
+ style: {
2559
+ background: "linear-gradient(180deg, color-mix(in srgb, var(--pw-accent) 92%, white), var(--pw-accent))",
2560
+ boxShadow: "0 1px 2px rgba(15,23,42,0.08), 0 8px 20px -6px color-mix(in srgb, var(--pw-accent) 50%, transparent)"
2561
+ },
2562
+ children: r("modal.continue", "Continue")
2563
+ }
2564
+ )
2565
+ ] });
2566
+ }
2567
+ const nr = 10 * 6e4, ar = 5e3, or = 3e4;
2568
+ class sr {
2569
+ constructor(t) {
2570
+ this.timer = null, this.timeoutTimer = null, this.visibilityHandler = null, this.focusHandler = null, this.messageHandler = null, this.stopped = !1, this.checking = !1, this.opts = {
2571
+ client: t.client,
2572
+ onActive: t.onActive,
2573
+ onTimeout: t.onTimeout ?? (() => {
2574
+ }),
2575
+ timeoutMs: t.timeoutMs ?? nr,
2576
+ visibleIntervalMs: t.visibleIntervalMs ?? ar,
2577
+ hiddenIntervalMs: t.hiddenIntervalMs ?? or
2578
+ };
2579
+ }
2580
+ start() {
2581
+ this.stopped || typeof document > "u" || typeof window > "u" || (this.check(), this.scheduleNext(), this.visibilityHandler = () => this.handleVisibilityChange(), document.addEventListener("visibilitychange", this.visibilityHandler), this.focusHandler = () => void this.check(), window.addEventListener("focus", this.focusHandler), this.messageHandler = (t) => this.handleMessage(t), window.addEventListener("message", this.messageHandler), this.timeoutTimer = setTimeout(() => {
2582
+ this.stopped || (this.stop(), this.opts.onTimeout());
2583
+ }, this.opts.timeoutMs));
2584
+ }
2585
+ stop() {
2586
+ this.stopped = !0, this.timer !== null && clearTimeout(this.timer), this.timer = null, this.timeoutTimer !== null && clearTimeout(this.timeoutTimer), this.timeoutTimer = null, typeof document < "u" && this.visibilityHandler && document.removeEventListener("visibilitychange", this.visibilityHandler), typeof window < "u" && (this.focusHandler && window.removeEventListener("focus", this.focusHandler), this.messageHandler && window.removeEventListener("message", this.messageHandler)), this.visibilityHandler = null, this.focusHandler = null, this.messageHandler = null;
2587
+ }
2588
+ async check() {
2589
+ if (!(this.stopped || this.checking)) {
2590
+ this.checking = !0;
2591
+ try {
2592
+ const t = await this.opts.client.getUser({ force: !0 });
2593
+ if (this.stopped) return;
2594
+ t.has_active_subscription && (this.stop(), this.opts.onActive(t));
2595
+ } catch {
2596
+ } finally {
2597
+ this.checking = !1;
2598
+ }
2599
+ }
2600
+ }
2601
+ scheduleNext() {
2602
+ if (this.stopped) return;
2603
+ const r = typeof document < "u" && document.visibilityState === "visible" ? this.opts.visibleIntervalMs : this.opts.hiddenIntervalMs;
2604
+ this.timer = setTimeout(async () => {
2605
+ await this.check(), this.scheduleNext();
2606
+ }, r);
2607
+ }
2608
+ handleVisibilityChange() {
2609
+ typeof document > "u" || (document.visibilityState === "visible" && this.check(), this.timer !== null && (clearTimeout(this.timer), this.timer = null), this.scheduleNext());
2610
+ }
2611
+ handleMessage(t) {
2612
+ const r = t.data;
2613
+ !r || typeof r != "object" || r.type === "paywall_purchase" && this.check();
2614
+ }
2615
+ }
2616
+ function lr() {
2617
+ return !(typeof document > "u" || typeof window > "u" || typeof location < "u" && location.protocol === "chrome-extension:");
2618
+ }
2619
+ const st = { open: !1, view: null, error: null }, N = {
2620
+ status: "paywall_status",
2621
+ priceId: "paywall_price_id",
2622
+ sessionId: "paywall_session_id"
2623
+ };
2624
+ class xr {
2625
+ constructor(t) {
2626
+ this.handle = null, this.isOpen = !1, this.listeners = /* @__PURE__ */ new Map(), this.userUnsub = null, this.authUnsub = null, this.watcher = null, this.tracker = null, this.purchased = !1, this.trialStore = null, this.trialStoreConfig = null, this.lastTrialStatus = null, this.trialExpiredFired = !1, this.lastVisibility = null, this.currentState = st, this.stateListeners = /* @__PURE__ */ new Set();
2627
+ const { auth: r, ownsAuth: a } = cr(t);
2628
+ this.auth = r, this.ownsAuth = a, this.billing = t.client ?? new Rt({ ...t, auth: this.auth }), this.host = t.host, this.shadowMode = t.shadowMode ?? "closed", this.mountThenLoad = t.mountThenLoad ?? !0, this.inline = t.inline === !0, this.userUnsub = this.billing.onUserChange((n) => {
2629
+ this.emit("userChange", n);
2630
+ }), this.auth && (this.authUnsub = this.auth.onAuthChange((n, o) => {
2631
+ this.emit("authChange", { event: n, session: o });
2632
+ })), this.initTracker(t.analytics), t.autoDetectReturn !== !1 && typeof window < "u" && queueMicrotask(() => this.checkReturn());
2633
+ }
2634
+ initTracker(t) {
2635
+ if (t === !1) return;
2636
+ const r = typeof t == "object" && t !== null ? t : {};
2637
+ if (r.enabled === !1) return;
2638
+ const a = r.endpoint ?? `${this.billing.apiOrigin}/api/v1/paywall/${this.billing.paywallId}/events`;
2639
+ this.tracker = new Ut({
2640
+ endpoint: a,
2641
+ paywallId: this.billing.paywallId,
2642
+ capabilities: this.billing.capabilities,
2643
+ getVisitorId: () => this.billing.getVisitorId(),
2644
+ getCachedVisitorId: () => this.billing.getCachedVisitorId(),
2645
+ getUserId: () => this.billing.getIdentity()?.userId ?? null,
2646
+ flushIntervalMs: r.flushIntervalMs,
2647
+ maxBufferSize: r.maxBufferSize,
2648
+ fetch: r.fetch,
2649
+ sendBeacon: r.sendBeacon
2650
+ }), this.on("open", () => this.tracker?.track("paywall_opened")), this.on(
2651
+ "ready",
2652
+ (n) => this.tracker?.track("paywall_viewed", {
2653
+ is_test_mode: n.settings.is_test_mode,
2654
+ prices_count: n.prices.length,
2655
+ offers_count: n.offers.length
2656
+ })
2657
+ ), this.on(
2658
+ "price_selected",
2659
+ (n) => this.tracker?.track("price_selected", { price_id: n.priceId })
2660
+ ), this.on(
2661
+ "checkout_started",
2662
+ (n) => this.tracker?.track("checkout_started", {
2663
+ price_id: n.priceId,
2664
+ acquiring: n.acquiring
2665
+ })
2666
+ ), this.on(
2667
+ "purchase_completed",
2668
+ (n) => this.tracker?.track("purchase_completed", {
2669
+ price_id: n.priceId,
2670
+ session_id: n.sessionId
2671
+ })
2672
+ ), this.on(
2673
+ "purchase_failed",
2674
+ (n) => this.tracker?.track("purchase_failed", { reason: n.reason })
2675
+ ), this.on("close", () => this.tracker?.track("paywall_closed")), this.on(
2676
+ "trial_blocked",
2677
+ (n) => this.tracker?.track("trial_blocked", {
2678
+ mode: n.mode,
2679
+ ...n.mode === "time" ? { remaining_ms: n.remainingMs, total_ms: n.totalMs } : n.mode === "opens" ? { remaining_actions: n.remainingActions, total_actions: n.totalActions } : {}
2680
+ })
2681
+ ), this.on("trial_expired", () => this.tracker?.track("trial_expired")), this.on(
2682
+ "visibility_blocked",
2683
+ (n) => this.tracker?.track("visibility_blocked", {
2684
+ reason: n.reason,
2685
+ country: n.country,
2686
+ tier: n.tier
2687
+ })
2688
+ ), this.on(
2689
+ "error",
2690
+ (n) => this.tracker?.track("error", { code: n.code, message: n.message })
2691
+ );
2692
+ }
2693
+ /**
2694
+ * Отправить произвольное аналитическое событие. Имена из системного whitelist'а
2695
+ * (`app_opened`, `paywall_viewed`, ...) разрешены как есть. Кастомные —
2696
+ * с префиксом `host:` (например `host:user_clicked_upgrade`). Сервер
2697
+ * дропает события с неразрешёнными именами.
2698
+ *
2699
+ * Самый частый кейс — `track('app_opened')` от хоста сразу после загрузки
2700
+ * приложения, чтобы зафиксировать воронку до открытия пейвола.
2701
+ */
2702
+ track(t, r) {
2703
+ this.tracker?.track(t, r);
2704
+ }
2705
+ /**
2706
+ * Удобный шорткат вместо `paywall.on('userChange', cb)` — самый частый
2707
+ * паттерн в host-коде, поэтому отдельный named метод. Колбек получает
2708
+ * last-known user из кеша синхронно через microtask, если он есть.
2709
+ */
2710
+ onUserChange(t) {
2711
+ return this.on("userChange", t);
2712
+ }
2713
+ /**
2714
+ * Заменить cachedBootstrap живыми данными — для preview-режима в редакторе
2715
+ * админки. Если модалка открыта, PaywallRoot подписан на onBootstrapChange
2716
+ * и перерендерится мгновенно. До open() — затравка для bootstrap()-effect'а.
2717
+ *
2718
+ * См. {@link BillingClientOptions.preview} — обычно эту опцию ставят на
2719
+ * клиент, чтобы заодно отключить сетевой revalidate. setBootstrap технически
2720
+ * работает и в production-режиме, но конкуренция с revalidate'ом из сети
2721
+ * почти всегда нежелательна.
2722
+ */
2723
+ setBootstrap(t) {
2724
+ this.billing.setBootstrap(t);
2725
+ }
2726
+ on(t, r) {
2727
+ let a = this.listeners.get(t);
2728
+ return a || (a = /* @__PURE__ */ new Set(), this.listeners.set(t, a)), a.add(r), () => a.delete(r);
2729
+ }
2730
+ off(t, r) {
2731
+ this.listeners.get(t)?.delete(r);
2732
+ }
2733
+ emit(t, ...r) {
2734
+ const a = this.listeners.get(t);
2735
+ if (!a) return;
2736
+ const n = r[0];
2737
+ for (const o of a)
2738
+ try {
2739
+ o(n);
2740
+ } catch (s) {
2741
+ typeof console < "u" && console.error("[paywall] listener error", s);
2742
+ }
2743
+ }
2744
+ open(t = {}) {
2745
+ this.openInternal("layout", t);
2746
+ }
2747
+ /**
2748
+ * Прогревает bootstrap-кеш и balance-кеш заранее, без открытия модалки.
2749
+ * Полезно когда host знает, что юзер скоро откроет paywall (hover на CTA,
2750
+ * mount компонента) — первый `open()` рендерится мгновенно, без loading-flash.
2751
+ *
2752
+ * Не throw'ает: если сеть упала, тихо игнорирует (повторный open() сделает
2753
+ * fresh-bootstrap с error-state как обычно). `signal` для отмены — например,
2754
+ * если хост размонтирует компонент быстрее, чем bootstrap вернётся.
2755
+ *
2756
+ * Вызывать можно сколько угодно раз — последующие вызовы возвращают cached
2757
+ * Promise (BillingClient уже дедуплицирует).
2758
+ */
2759
+ async preload(t = {}) {
2760
+ try {
2761
+ await this.billing.bootstrap({ signal: t.signal }), this.billing.auth && await this.billing.getBalances({ signal: t.signal });
2762
+ } catch {
2763
+ }
2764
+ }
2765
+ /**
2766
+ * Открывает модалку сразу с саппорт-формой (минуя layout с тарифами).
2767
+ * Полезно, когда host-приложение хочет дать юзеру кнопку «Help / Support»,
2768
+ * не связанную с пейволом-апгрейдом. Back/Done в саппорт-форме закрывают
2769
+ * модалку (не возвращают к тарифам), потому что юзер пришёл сюда напрямую.
2770
+ *
2771
+ * Из обычного `paywall.open()`-flow саппорт всё равно доступен через
2772
+ * Contact Support-ссылку в `current_session`-блоке (там Back возвращает
2773
+ * к layout).
2774
+ */
2775
+ openSupport(t = {}) {
2776
+ this.openInternal("support", t);
2777
+ }
2778
+ /**
2779
+ * Открывает модалку сразу с auth-gate (логин/регистрация), без layout с
2780
+ * тарифами. Сценарий: returning customer уже купил, ему просто нужно
2781
+ * залогиниться, чтобы SDK подцепил его purchases. После signIn модалка
2782
+ * закрывается; Back тоже закрывает (юзер пришёл только за логином).
2783
+ *
2784
+ * Без `auth` (managed-auth не подключён) метод — no-op: некому делать
2785
+ * signIn. Если юзер уже залогинен — модалка всё равно откроется и
2786
+ * закроется через auto-resume в auth_gate effect'е (мгновение).
2787
+ *
2788
+ * Триал не блокирует этот флоу — auth не connect'ится с trial-механикой.
2789
+ */
2790
+ openAuth(t = {}) {
2791
+ this.auth && this.openInternal("auth", { ...t, skipTrial: !0 });
2792
+ }
2793
+ /**
2794
+ * Открывает модалку с anonymous-gate. AnonGate сразу зовёт
2795
+ * `auth.signInAnonymously()`:
2796
+ * - если в storage есть `anonRefreshToken` — silent resume через
2797
+ * /auth/refresh, модалка схлопывается мгновенно (юзер видит лёгкий
2798
+ * спиннер ~100мс);
2799
+ * - иначе — fresh POST /auth/anonymous/signin без captcha (защита от
2800
+ * abuse держится на Supabase per-real-IP rate-limit + CF Bot Fight Mode).
2801
+ *
2802
+ * После успешного signIn'а модалка закрывается; host подхватывает свежую
2803
+ * session через `auth.onAuthChange` или `paywall.onUserChange`. Для UX
2804
+ * "просто залогиниться чтобы api-gateway работал, без покупок".
2805
+ *
2806
+ * Без managed-auth (`auth` не подключён) метод — no-op. Триал и
2807
+ * visibility-таргетинг этот flow обходит: анон-логин не должен зависеть
2808
+ * от страны юзера или trial-стейджа.
2809
+ */
2810
+ openAnonGate(t = {}) {
2811
+ this.auth && this.openInternal("anon", { ...t, skipTrial: !0, skipVisibility: !0 });
2812
+ }
2813
+ openInternal(t, r) {
2814
+ r.identity && this.billing.setIdentity(r.identity), this.purchased = !1;
2815
+ const a = r.skipTrial === !0 || t === "support", n = r.skipVisibility === !0 || t === "support" || t === "auth" || t === "anon", o = r.renew === !0;
2816
+ if (a && n) {
2817
+ this.mountAndShow(t, { renew: o });
2818
+ return;
2819
+ }
2820
+ const s = this.billing.getCachedBootstrap();
2821
+ if (s) {
2822
+ this.runOpenGates(t, s, { skipTrial: a, skipVisibility: n, renew: o });
2823
+ return;
2824
+ }
2825
+ if (this.mountThenLoad) {
2826
+ this.mountAndShow(t, { renew: o }), this.billing.bootstrap().then((l) => this.runDelayedGates(l, { skipTrial: a, skipVisibility: n })).catch(() => {
2827
+ });
2828
+ return;
2829
+ }
2830
+ this.billing.bootstrap().then((l) => this.runOpenGates(t, l, { skipTrial: a, skipVisibility: n, renew: o })).catch(() => {
2831
+ this.mountAndShow(t, { renew: o });
2832
+ });
2833
+ }
2834
+ /** Применить gates ПОСЛЕ того, как модалка уже смонтирована (mount-then-load
2835
+ * путь). Если gate блокирует — close() + emit. Если юзер уже сам закрыл
2836
+ * модалку до резолва bootstrap'а — no-op (isOpen=false). */
2837
+ runDelayedGates(t, r) {
2838
+ if (!this.isOpen) return;
2839
+ if (!r.skipVisibility) {
2840
+ const o = t.settings.visibility;
2841
+ if (o && (this.lastVisibility = o, !o.visible)) {
2842
+ this.close(), this.emit("visibility_blocked", o);
2843
+ return;
2844
+ }
2845
+ }
2846
+ if (r.skipTrial) return;
2847
+ const a = t.settings.trial;
2848
+ if (!a) return;
2849
+ const n = this.ensureTrialStore(a);
2850
+ n.check().then(async (o) => {
2851
+ if (this.isOpen && (this.lastTrialStatus = o, o.mode !== "none")) {
2852
+ if (o.blocked) {
2853
+ const s = await n.recordBlock();
2854
+ if (this.lastTrialStatus = s, !this.isOpen) return;
2855
+ this.close(), this.emit("trial_blocked", s);
2856
+ return;
2857
+ }
2858
+ this.trialExpiredFired || (this.trialExpiredFired = !0, this.emit("trial_expired"));
2859
+ }
2860
+ }).catch((o) => {
2861
+ typeof console < "u" && console.warn("[paywall] trial check failed", o);
2862
+ });
2863
+ }
2864
+ // Порядок гейтов: visibility → trial. Country-mismatch ≠ trial-block, и
2865
+ // вести trial-стейт «осталось N показов» под юзером, который вообще не
2866
+ // должен увидеть пейвол по таргетингу — бессмысленно: при возврате в
2867
+ // правильную страну он окажется со «слипшимся» триал-счётчиком.
2868
+ runOpenGates(t, r, a) {
2869
+ if (!a.skipVisibility) {
2870
+ const n = r.settings.visibility;
2871
+ if (n && (this.lastVisibility = n, !n.visible)) {
2872
+ this.emit("visibility_blocked", n);
2873
+ return;
2874
+ }
2875
+ }
2876
+ if (a.skipTrial) {
2877
+ this.mountAndShow(t, { renew: a.renew });
2878
+ return;
2879
+ }
2880
+ this.gateThroughTrial(t, r, a.renew);
2881
+ }
2882
+ gateThroughTrial(t, r, a) {
2883
+ const n = r.settings.trial;
2884
+ if (!n) {
2885
+ this.mountAndShow(t, { renew: a });
2886
+ return;
2887
+ }
2888
+ const o = this.ensureTrialStore(n);
2889
+ o.check().then(async (s) => {
2890
+ if (this.lastTrialStatus = s, s.mode === "none") {
2891
+ this.mountAndShow(t, { renew: a });
2892
+ return;
2893
+ }
2894
+ if (s.blocked) {
2895
+ const l = await o.recordBlock();
2896
+ this.lastTrialStatus = l, this.emit("trial_blocked", l);
2897
+ return;
2898
+ }
2899
+ this.trialExpiredFired || (this.trialExpiredFired = !0, this.emit("trial_expired")), this.mountAndShow(t, { renew: a });
2900
+ }).catch((s) => {
2901
+ typeof console < "u" && console.warn("[paywall] trial check failed", s), this.mountAndShow(t, { renew: a });
2902
+ });
2903
+ }
2904
+ ensureTrialStore(t) {
2905
+ if (this.trialStore && this.trialStoreConfig && pr(this.trialStoreConfig, t))
2906
+ return this.trialStore;
2907
+ this.trialStoreConfig = t;
2908
+ const r = this.billing.createTrialStore;
2909
+ return this.trialStore = typeof r == "function" ? r.call(this.billing, t) : Ht(this.billing.getStorage(), this.billing.paywallId, t), this.trialStore;
2910
+ }
2911
+ mountAndShow(t, r = {}) {
2912
+ const a = r.renew === !0;
2913
+ if (this.handle) {
2914
+ this.isOpen = !0, this.handle.update({ open: !0, initialView: t, purchased: !1, renew: a }), this.emit("open");
2915
+ return;
2916
+ }
2917
+ this.isOpen = !0, this.handle = qt(
2918
+ Qe,
2919
+ {
2920
+ client: this.billing,
2921
+ open: !0,
2922
+ initialView: t,
2923
+ purchased: !1,
2924
+ renew: a,
2925
+ onClose: () => this.close(),
2926
+ onEvent: (n, o) => {
2927
+ this.emit(n, o), n === "checkout_started" && this.startUserWatcher();
2928
+ },
2929
+ onState: (n) => this.applyState(n),
2930
+ inline: this.inline
2931
+ },
2932
+ { host: this.host, shadowMode: this.shadowMode, inline: this.inline }
2933
+ ), this.emit("open");
2934
+ }
2935
+ applyState(t) {
2936
+ if (!ur(this.currentState, t)) {
2937
+ this.currentState = t;
2938
+ for (const r of this.stateListeners)
2939
+ try {
2940
+ r(t);
2941
+ } catch (a) {
2942
+ console.warn("[paywall] onStateChange listener threw", a);
2943
+ }
2944
+ }
2945
+ }
2946
+ /**
2947
+ * Sync-snapshot текущего состояния модалки. Подходит для `useSyncExternalStore`
2948
+ * в React (`useSyncExternalStore(paywall.onStateChange, paywall.getState)`)
2949
+ * и для одноразовых проверок («открыт ли пейвол сейчас?»).
2950
+ *
2951
+ * Snapshot стабилен — пока state не изменился, повторный getState() вернёт
2952
+ * `===`-равный объект (важно для useSyncExternalStore чтобы не ре-рендерить).
2953
+ */
2954
+ getState() {
2955
+ return this.currentState;
2956
+ }
2957
+ /**
2958
+ * Подписка на изменения state. Колбек вызывается при каждом реальном
2959
+ * изменении (closed → loading → ready → ...). По умолчанию initial snapshot
2960
+ * отдаётся через microtask после подписки; через `{immediate: 'sync'|'none'}`
2961
+ * можно сделать sync-доставку (для useSyncExternalStore — там она не нужна,
2962
+ * snapshot читается через getSnapshot отдельно) или вовсе пропустить
2963
+ * initial.
2964
+ *
2965
+ * Возвращает unsubscribe.
2966
+ */
2967
+ onStateChange(t, r = {}) {
2968
+ this.stateListeners.add(t);
2969
+ const a = r.immediate ?? "microtask";
2970
+ if (a !== "none") {
2971
+ const n = this.currentState;
2972
+ if (a === "sync")
2973
+ try {
2974
+ t(n);
2975
+ } catch (o) {
2976
+ console.warn("[paywall] onStateChange initial sync threw", o);
2977
+ }
2978
+ else
2979
+ queueMicrotask(() => {
2980
+ this.stateListeners.has(t) && t(n);
2981
+ });
2982
+ }
2983
+ return () => {
2984
+ this.stateListeners.delete(t);
2985
+ };
2986
+ }
2987
+ /** Sync-доступ к последнему известному статусу триала. null — `paywall.open()`
2988
+ * ещё не вызывался либо триал отключён в конфиге пейвола. Удобно для
2989
+ * собственного UI хоста («осталось 3 показа», «триал истечёт через 2ч»). */
2990
+ getTrialStatus() {
2991
+ return this.lastTrialStatus;
2992
+ }
2993
+ /** Sync-доступ к последнему server-computed visibility-статусу. null —
2994
+ * bootstrap ещё не загружен или сервер не отдаёт `settings.visibility`
2995
+ * (например, старая версия online без targeting-патча). Хост может
2996
+ * использовать для собственного fallback'а: «сервис недоступен в вашей
2997
+ * стране». Обновляется на каждом open(), который проходит через gate. */
2998
+ getVisibility() {
2999
+ return this.lastVisibility;
3000
+ }
3001
+ /**
3002
+ * Цены пейвола — шорткат над `bootstrap()`. Локали уже применены, кэш и
3003
+ * stale-while-revalidate идентичны `billing.bootstrap()`. Подходит для
3004
+ * pricing-страниц/карточек на сайте, где host хочет показать те же цены,
3005
+ * что и в модалке, не вытаскивая bootstrap руками.
3006
+ */
3007
+ getPrices(t = {}) {
3008
+ return this.billing.getPrices(t);
3009
+ }
3010
+ /** Sync-снимок цен. null — bootstrap ещё не загружали. */
3011
+ getCachedPrices() {
3012
+ return this.billing.getCachedPrices();
3013
+ }
3014
+ /** Снимок текущего «языка юзера» — proxy над `billing.getUserLanguage()`.
3015
+ * Используй, чтобы синхронизировать i18n host'а с тем, что фактически
3016
+ * показывает пейвол. См. подробности в `BillingClient.getUserLanguage`. */
3017
+ getUserLanguage() {
3018
+ return this.billing.getUserLanguage();
3019
+ }
3020
+ /**
3021
+ * Решает, нужно ли блокировать фичу для текущего юзера. Без побочных эффектов
3022
+ * (на trial-storage `recordBlock` не вызывается, модалка не монтируется).
3023
+ *
3024
+ * Порядок проверок (первый сработавший — финальный):
3025
+ * 1. `has_active_subscription` — самый сильный сигнал, перебивает остальные.
3026
+ * Юзер с подпиской получает доступ независимо от visibility/trial.
3027
+ * 2. `visibility` (страна/девайс/disabled-флаг) — юзер вне monetization-scope'а
3028
+ * пейвола, гейтить нельзя.
3029
+ * 3. `trial` — пре-пейвольный бесплатный период активен.
3030
+ * 4. Иначе — `blocked`, host лочит фичу и зовёт `paywall.open()`.
3031
+ *
3032
+ * Bootstrap кешируется в BillingClient — `getAccess()` можно дёргать на
3033
+ * каждый рендер host-компонента, /bootstrap не дублируется. При упавшей сети
3034
+ * fallback на persistent-cached user из storage: юзер с прошлой подпиской
3035
+ * получает `granted` офлайн, иначе `blocked` (host покажет пейвол с
3036
+ * error-state, юзер сможет ретрайнуть). Side-эффект: обновляются
3037
+ * `lastVisibility` / `lastTrialStatus`, чтобы синхронные геттеры
3038
+ * `getVisibility()` / `getTrialStatus()` видели свежие данные после первого
3039
+ * `getAccess()`, а не только после первого `open()`.
3040
+ */
3041
+ async getAccess(t = {}) {
3042
+ let r = this.billing.getCachedBootstrap();
3043
+ if (!r)
3044
+ try {
3045
+ r = await this.billing.bootstrap({ signal: t.signal });
3046
+ } catch {
3047
+ const s = this.billing.getCachedUser();
3048
+ return s?.has_active_subscription ? {
3049
+ access: "granted",
3050
+ reason: "has_subscription",
3051
+ visibility: null,
3052
+ trial: null,
3053
+ user: s
3054
+ } : {
3055
+ access: "blocked",
3056
+ reason: "no_subscription",
3057
+ visibility: null,
3058
+ trial: null,
3059
+ user: s
3060
+ };
3061
+ }
3062
+ const a = r.user ?? null;
3063
+ if (a?.has_active_subscription)
3064
+ return {
3065
+ access: "granted",
3066
+ reason: "has_subscription",
3067
+ visibility: r.settings.visibility ?? null,
3068
+ trial: null,
3069
+ user: a
3070
+ };
3071
+ let n = null;
3072
+ if (!t.skipVisibility) {
3073
+ const s = r.settings.visibility;
3074
+ if (s && (n = s, this.lastVisibility = s, !s.visible))
3075
+ return { access: "granted", reason: "visibility_blocked", visibility: n, trial: null, user: a };
3076
+ }
3077
+ let o = null;
3078
+ if (!t.skipTrial) {
3079
+ const s = r.settings.trial;
3080
+ if (s)
3081
+ try {
3082
+ if (o = await this.ensureTrialStore(s).check(), this.lastTrialStatus = o, o.blocked)
3083
+ return { access: "granted", reason: "trial_blocked", visibility: n, trial: o, user: a };
3084
+ } catch (l) {
3085
+ typeof console < "u" && console.warn("[paywall] getAccess: trial check failed", l);
3086
+ }
3087
+ }
3088
+ return { access: "blocked", reason: "no_subscription", visibility: n, trial: o, user: a };
3089
+ }
3090
+ /** Сбросить состояние триала в storage. Полезно для дев-режима / админ-кнопки
3091
+ * «прогнать сценарий заново». В проде хост обычно не дёргает. */
3092
+ async resetTrial() {
3093
+ this.trialStore && (await this.trialStore.reset(), this.lastTrialStatus = null, this.trialExpiredFired = !1);
3094
+ }
3095
+ // Запускает polling user-state до has_active_subscription=true либо до
3096
+ // таймаута. Идемпотентен: повторный вызов на уже работающем watcher'е —
3097
+ // no-op (юзер мог нажать Continue повторно после возврата).
3098
+ //
3099
+ // В extension popup runtime — no-op (popup не доживёт). Там полагаемся на
3100
+ // bootstrap при следующем открытии.
3101
+ startUserWatcher() {
3102
+ this.watcher || lr() && (this.watcher = new sr({
3103
+ client: this.billing,
3104
+ onActive: (t) => {
3105
+ this.watcher = null, this.emit("purchase_completed", { priceId: null, sessionId: null });
3106
+ const r = this.billing.getCachedBootstrap()?.settings.success_redirect_url;
3107
+ if (r && typeof window < "u")
3108
+ try {
3109
+ window.location.assign(r);
3110
+ return;
3111
+ } catch {
3112
+ }
3113
+ this.isOpen && this.handle && (this.purchased = !0, this.handle.update({ purchased: !0 }));
3114
+ },
3115
+ onTimeout: () => {
3116
+ this.watcher = null;
3117
+ }
3118
+ }), this.watcher.start());
3119
+ }
3120
+ close() {
3121
+ !this.isOpen || !this.handle || (this.isOpen = !1, this.purchased = !1, this.handle.update({ open: !1, purchased: !1 }), this.applyState(st), this.emit("close"));
3122
+ }
3123
+ /**
3124
+ * Сканирует текущий URL на маркеры возврата с checkout и эмитит
3125
+ * purchase_completed / purchase_failed. Маркеры удаляются из URL
3126
+ * через history.replaceState. Ищет и в hash, и в search (hash приоритетнее —
3127
+ * защита от клиентских SPA-роутеров, перехватывающих query).
3128
+ */
3129
+ checkReturn() {
3130
+ if (typeof window > "u") return;
3131
+ const t = new URL(window.location.href), r = _t(t.hash.replace(/^#/, "")), a = _t(t.search.replace(/^\?/, "")), n = r ?? a;
3132
+ n && (n.status === "paid" ? (this.emit("purchase_completed", {
3133
+ priceId: n.priceId,
3134
+ sessionId: n.sessionId
3135
+ }), hr(n)) : (n.status === "failed" || n.status === "cancelled") && this.emit("purchase_failed", { reason: n.status }), gr(t));
3136
+ }
3137
+ destroy() {
3138
+ this.tracker?.destroy(), this.tracker = null, this.listeners.clear(), this.stateListeners.clear(), this.watcher?.stop(), this.watcher = null, this.userUnsub?.(), this.userUnsub = null, this.authUnsub?.(), this.authUnsub = null, this.ownsAuth && this.auth && this.auth.destroy?.(), this.ownsAuth = !1, this.billing.destroy?.(), this.handle?.unmount(), this.handle = null, this.isOpen = !1, this.currentState = st;
3139
+ }
3140
+ }
3141
+ function cr(e) {
3142
+ if (!e.auth) return { auth: void 0, ownsAuth: !1 };
3143
+ if (e.auth instanceof dt || dr(e.auth))
3144
+ return { auth: e.auth, ownsAuth: !1 };
3145
+ const t = e.auth === !0 ? {} : e.auth;
3146
+ return {
3147
+ auth: new dt({
3148
+ paywallId: e.paywallId,
3149
+ apiOrigin: t.apiOrigin ?? e.apiOrigin,
3150
+ storage: t.storage ?? e.storage,
3151
+ fetch: t.fetch ?? e.fetch,
3152
+ openPopup: t.openPopup
3153
+ }),
3154
+ ownsAuth: !0
3155
+ };
3156
+ }
3157
+ function dr(e) {
3158
+ if (typeof e != "object" || e === null) return !1;
3159
+ const t = e;
3160
+ return typeof t.onAuthChange == "function" && typeof t.getCachedSession == "function" && typeof t.signOut == "function";
3161
+ }
3162
+ function ur(e, t) {
3163
+ return e.open === t.open && e.view === t.view && e.error === t.error;
3164
+ }
3165
+ function pr(e, t) {
3166
+ return e.mode === t.mode && e.payload === t.payload && e.storage === t.storage;
3167
+ }
3168
+ function _t(e) {
3169
+ if (!e) return null;
3170
+ const t = new URLSearchParams(e), r = t.get(N.status);
3171
+ return r ? {
3172
+ status: r,
3173
+ priceId: t.get(N.priceId),
3174
+ sessionId: t.get(N.sessionId)
3175
+ } : null;
3176
+ }
3177
+ function hr(e) {
3178
+ if (!(typeof window > "u" || !window.opener))
3179
+ try {
3180
+ window.opener.postMessage(
3181
+ {
3182
+ type: "paywall_purchase",
3183
+ status: e.status,
3184
+ priceId: e.priceId,
3185
+ sessionId: e.sessionId
3186
+ },
3187
+ "*"
3188
+ );
3189
+ } catch {
3190
+ }
3191
+ }
3192
+ function gr(e) {
3193
+ const t = (a, n) => {
3194
+ if (!a) return "";
3195
+ const o = new URLSearchParams(a.replace(/^[?#]/, ""));
3196
+ o.delete(N.status), o.delete(N.priceId), o.delete(N.sessionId);
3197
+ const s = o.toString();
3198
+ return s ? n + s : "";
3199
+ }, r = e.pathname + t(e.search, "?") + t(e.hash, "#");
3200
+ window.history.replaceState(null, "", r);
3201
+ }
3202
+ export {
3203
+ xr as P,
3204
+ Ke as b
3205
+ };
3206
+ //# sourceMappingURL=PaywallUI-D7lp-bC5.js.map