@monetize.software/sdk-extension 3.0.0-alpha.9 → 3.0.0-beta.0

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 (226) hide show
  1. package/dist/chunks/ar-CViBaj16.js +2 -0
  2. package/dist/chunks/ar-CViBaj16.js.map +1 -0
  3. package/dist/chunks/{ar-CHae8g-2.js → ar-ClwBmll7.js} +6 -2
  4. package/dist/chunks/ar-ClwBmll7.js.map +1 -0
  5. package/dist/chunks/{chrome-port-BzNV1ahF.js → chrome-port-BEMjZQAH.js} +2 -2
  6. package/dist/chunks/chrome-port-BEMjZQAH.js.map +1 -0
  7. package/dist/chunks/{chrome-port-rVd4zwU3.js → chrome-port-bfTUUDz_.js} +159 -123
  8. package/dist/chunks/chrome-port-bfTUUDz_.js.map +1 -0
  9. package/dist/chunks/{cs-eZTedzaK.js → cs-Cc_D0W4S.js} +6 -2
  10. package/dist/chunks/cs-Cc_D0W4S.js.map +1 -0
  11. package/dist/chunks/cs-DQJWP65K.js +2 -0
  12. package/dist/chunks/cs-DQJWP65K.js.map +1 -0
  13. package/dist/chunks/{da-Dca6j8fp.js → da-BtKcMSxH.js} +6 -2
  14. package/dist/chunks/da-BtKcMSxH.js.map +1 -0
  15. package/dist/chunks/da-Cyr_IXhb.js +2 -0
  16. package/dist/chunks/da-Cyr_IXhb.js.map +1 -0
  17. package/dist/chunks/de-BOCUj1pF.js +2 -0
  18. package/dist/chunks/de-BOCUj1pF.js.map +1 -0
  19. package/dist/chunks/{de-BCjn3PUI.js → de-iwQW5eYl.js} +6 -2
  20. package/dist/chunks/de-iwQW5eYl.js.map +1 -0
  21. package/dist/chunks/{el-BpXtDTez.js → el-BoH65CeJ.js} +6 -2
  22. package/dist/chunks/el-BoH65CeJ.js.map +1 -0
  23. package/dist/chunks/el-C6jLHiEF.js +2 -0
  24. package/dist/chunks/el-C6jLHiEF.js.map +1 -0
  25. package/dist/chunks/es-CARHLxHR.js +2 -0
  26. package/dist/chunks/es-CARHLxHR.js.map +1 -0
  27. package/dist/chunks/{es-B3P4nlMw.js → es-CkP16_8K.js} +6 -2
  28. package/dist/chunks/es-CkP16_8K.js.map +1 -0
  29. package/dist/chunks/fi-B8OhRbwY.js +2 -0
  30. package/dist/chunks/fi-B8OhRbwY.js.map +1 -0
  31. package/dist/chunks/{fi-BbQ_Bs0Z.js → fi-yUXSmK1E.js} +6 -2
  32. package/dist/chunks/fi-yUXSmK1E.js.map +1 -0
  33. package/dist/chunks/fr-CoM18zzM.js +2 -0
  34. package/dist/chunks/fr-CoM18zzM.js.map +1 -0
  35. package/dist/chunks/{fr-BKDUXceO.js → fr-DSZRGsxI.js} +6 -2
  36. package/dist/chunks/fr-DSZRGsxI.js.map +1 -0
  37. package/dist/chunks/he-DTDVc3lA.js +2 -0
  38. package/dist/chunks/he-DTDVc3lA.js.map +1 -0
  39. package/dist/chunks/{he-BVCHlTtT.js → he-ZUo7cQjk.js} +8 -4
  40. package/dist/chunks/he-ZUo7cQjk.js.map +1 -0
  41. package/dist/chunks/hi-BjnS9UeE.js +2 -0
  42. package/dist/chunks/hi-BjnS9UeE.js.map +1 -0
  43. package/dist/chunks/{hi-H_Hshh-7.js → hi-CEutBKiG.js} +6 -2
  44. package/dist/chunks/hi-CEutBKiG.js.map +1 -0
  45. package/dist/chunks/hu-CN06FMhV.js +2 -0
  46. package/dist/chunks/hu-CN06FMhV.js.map +1 -0
  47. package/dist/chunks/{hu-ZWiNfzvN.js → hu-DvEAWGS7.js} +6 -2
  48. package/dist/chunks/hu-DvEAWGS7.js.map +1 -0
  49. package/dist/chunks/id-BITgaBxq.js +2 -0
  50. package/dist/chunks/id-BITgaBxq.js.map +1 -0
  51. package/dist/chunks/{id-DeiRYsJ1.js → id-_eEMrYMW.js} +6 -2
  52. package/dist/chunks/id-_eEMrYMW.js.map +1 -0
  53. package/dist/chunks/{it-UH9OzFhg.js → it-BAmsQbIl.js} +6 -2
  54. package/dist/chunks/it-BAmsQbIl.js.map +1 -0
  55. package/dist/chunks/it-DVcsq015.js +2 -0
  56. package/dist/chunks/it-DVcsq015.js.map +1 -0
  57. package/dist/chunks/ja-Bim7Ok2e.js +2 -0
  58. package/dist/chunks/ja-Bim7Ok2e.js.map +1 -0
  59. package/dist/chunks/{ja-BYC8FRN8.js → ja-BqCZWVKK.js} +8 -4
  60. package/dist/chunks/ja-BqCZWVKK.js.map +1 -0
  61. package/dist/chunks/{ko-Bjs2ZRcF.js → ko-CkIzeOzb.js} +8 -4
  62. package/dist/chunks/ko-CkIzeOzb.js.map +1 -0
  63. package/dist/chunks/ko-DqEfcVCB.js +2 -0
  64. package/dist/chunks/ko-DqEfcVCB.js.map +1 -0
  65. package/dist/chunks/nl-DSNuJWIo.js +2 -0
  66. package/dist/chunks/nl-DSNuJWIo.js.map +1 -0
  67. package/dist/chunks/{nl-Ch5HFWQO.js → nl-Mu_KNzli.js} +6 -2
  68. package/dist/chunks/nl-Mu_KNzli.js.map +1 -0
  69. package/dist/chunks/{no-CljpinWz.js → no-9HMjljBs.js} +6 -2
  70. package/dist/chunks/no-9HMjljBs.js.map +1 -0
  71. package/dist/chunks/no-B5HY_A8_.js +2 -0
  72. package/dist/chunks/no-B5HY_A8_.js.map +1 -0
  73. package/dist/chunks/{pl-CUcSS0zZ.js → pl-Cbr2qDwv.js} +6 -2
  74. package/dist/chunks/pl-Cbr2qDwv.js.map +1 -0
  75. package/dist/chunks/pl-ChGLn9Sy.js +2 -0
  76. package/dist/chunks/pl-ChGLn9Sy.js.map +1 -0
  77. package/dist/chunks/port-name-CF4WQQ3-.js +2 -0
  78. package/dist/chunks/port-name-CF4WQQ3-.js.map +1 -0
  79. package/dist/chunks/port-name-ervLBWAQ.js +6 -0
  80. package/dist/chunks/port-name-ervLBWAQ.js.map +1 -0
  81. package/dist/chunks/pt-CDLEktT9.js +2 -0
  82. package/dist/chunks/pt-CDLEktT9.js.map +1 -0
  83. package/dist/chunks/{pt-BHK0LwkC.js → pt-_jirA6IR.js} +6 -2
  84. package/dist/chunks/pt-_jirA6IR.js.map +1 -0
  85. package/dist/chunks/ro-BHCHiXY3.js +2 -0
  86. package/dist/chunks/ro-BHCHiXY3.js.map +1 -0
  87. package/dist/chunks/{ro-Bj8cwU2n.js → ro-oZLxhwHc.js} +6 -2
  88. package/dist/chunks/ro-oZLxhwHc.js.map +1 -0
  89. package/dist/chunks/ru-B6HgmINj.js +2 -0
  90. package/dist/chunks/ru-B6HgmINj.js.map +1 -0
  91. package/dist/chunks/{ru-CgqNy0Gb.js → ru-C2-sqY7B.js} +6 -2
  92. package/dist/chunks/ru-C2-sqY7B.js.map +1 -0
  93. package/dist/chunks/sv-DoSs4a9n.js +2 -0
  94. package/dist/chunks/sv-DoSs4a9n.js.map +1 -0
  95. package/dist/chunks/{sv-H7jroOQ5.js → sv-y385MWVy.js} +6 -2
  96. package/dist/chunks/sv-y385MWVy.js.map +1 -0
  97. package/dist/chunks/{th-Dqm-gpGe.js → th-Bjbv4M1s.js} +6 -2
  98. package/dist/chunks/th-Bjbv4M1s.js.map +1 -0
  99. package/dist/chunks/th-UeweOhwg.js +2 -0
  100. package/dist/chunks/th-UeweOhwg.js.map +1 -0
  101. package/dist/chunks/tr-BbBr5tyB.js +2 -0
  102. package/dist/chunks/tr-BbBr5tyB.js.map +1 -0
  103. package/dist/chunks/{tr-D3zPcNtT.js → tr-DmHo9F8i.js} +8 -4
  104. package/dist/chunks/tr-DmHo9F8i.js.map +1 -0
  105. package/dist/chunks/uk-CJTA1SJK.js +2 -0
  106. package/dist/chunks/uk-CJTA1SJK.js.map +1 -0
  107. package/dist/chunks/{uk-CoIIs3QI.js → uk-DwvAoTe5.js} +6 -2
  108. package/dist/chunks/uk-DwvAoTe5.js.map +1 -0
  109. package/dist/chunks/{vi-C_fruIbh.js → vi-BEpwsVLR.js} +6 -2
  110. package/dist/chunks/vi-BEpwsVLR.js.map +1 -0
  111. package/dist/chunks/vi-ZvBo7PbB.js +2 -0
  112. package/dist/chunks/vi-ZvBo7PbB.js.map +1 -0
  113. package/dist/chunks/zh-CPZBEb3d.js +2 -0
  114. package/dist/chunks/zh-CPZBEb3d.js.map +1 -0
  115. package/dist/chunks/{zh-LDkEV2D9.js → zh-DrG18oGe.js} +7 -3
  116. package/dist/chunks/zh-DrG18oGe.js.map +1 -0
  117. package/dist/content/PaywallUI.d.ts +1 -1
  118. package/dist/content/RemoteAuthClient.d.ts +3 -3
  119. package/dist/content/RemoteBillingClient.d.ts +7 -3
  120. package/dist/content/RemoteBillingClient.d.ts.map +1 -1
  121. package/dist/content/RemoteTrialStore.d.ts +2 -2
  122. package/dist/content.cjs +3 -3
  123. package/dist/content.cjs.map +1 -1
  124. package/dist/content.js +1198 -766
  125. package/dist/content.js.map +1 -1
  126. package/dist/offscreen/server.d.ts +3 -3
  127. package/dist/offscreen/server.d.ts.map +1 -1
  128. package/dist/offscreen.cjs +1 -1
  129. package/dist/offscreen.cjs.map +1 -1
  130. package/dist/offscreen.js +9 -9
  131. package/dist/offscreen.js.map +1 -1
  132. package/dist/shared/messages.d.ts +4 -4
  133. package/dist/shared/port-name.d.ts +1 -0
  134. package/dist/shared/port-name.d.ts.map +1 -1
  135. package/dist/sw.cjs +1 -1
  136. package/dist/sw.cjs.map +1 -1
  137. package/dist/sw.js +14 -14
  138. package/dist/sw.js.map +1 -1
  139. package/package.json +3 -3
  140. package/dist/chunks/ar-CHae8g-2.js.map +0 -1
  141. package/dist/chunks/ar-E1mc8SO_.js +0 -2
  142. package/dist/chunks/ar-E1mc8SO_.js.map +0 -1
  143. package/dist/chunks/chrome-port-BzNV1ahF.js.map +0 -1
  144. package/dist/chunks/chrome-port-rVd4zwU3.js.map +0 -1
  145. package/dist/chunks/cs-Dccq6LAT.js +0 -2
  146. package/dist/chunks/cs-Dccq6LAT.js.map +0 -1
  147. package/dist/chunks/cs-eZTedzaK.js.map +0 -1
  148. package/dist/chunks/da-C_4MbEh5.js +0 -2
  149. package/dist/chunks/da-C_4MbEh5.js.map +0 -1
  150. package/dist/chunks/da-Dca6j8fp.js.map +0 -1
  151. package/dist/chunks/de-BCjn3PUI.js.map +0 -1
  152. package/dist/chunks/de-DulxcJj-.js +0 -2
  153. package/dist/chunks/de-DulxcJj-.js.map +0 -1
  154. package/dist/chunks/el-BpXtDTez.js.map +0 -1
  155. package/dist/chunks/el-CVG_1iKB.js +0 -2
  156. package/dist/chunks/el-CVG_1iKB.js.map +0 -1
  157. package/dist/chunks/es-B3P4nlMw.js.map +0 -1
  158. package/dist/chunks/es-ri0uKzUW.js +0 -2
  159. package/dist/chunks/es-ri0uKzUW.js.map +0 -1
  160. package/dist/chunks/fi-BbQ_Bs0Z.js.map +0 -1
  161. package/dist/chunks/fi-CNZqWHjw.js +0 -2
  162. package/dist/chunks/fi-CNZqWHjw.js.map +0 -1
  163. package/dist/chunks/fr-BKDUXceO.js.map +0 -1
  164. package/dist/chunks/fr-CfFOw4hD.js +0 -2
  165. package/dist/chunks/fr-CfFOw4hD.js.map +0 -1
  166. package/dist/chunks/he-BVCHlTtT.js.map +0 -1
  167. package/dist/chunks/he-DN2JEtQb.js +0 -2
  168. package/dist/chunks/he-DN2JEtQb.js.map +0 -1
  169. package/dist/chunks/hi-DxfOerNP.js +0 -2
  170. package/dist/chunks/hi-DxfOerNP.js.map +0 -1
  171. package/dist/chunks/hi-H_Hshh-7.js.map +0 -1
  172. package/dist/chunks/hu-BTImywuV.js +0 -2
  173. package/dist/chunks/hu-BTImywuV.js.map +0 -1
  174. package/dist/chunks/hu-ZWiNfzvN.js.map +0 -1
  175. package/dist/chunks/id-DeiRYsJ1.js.map +0 -1
  176. package/dist/chunks/id-YFuArJA6.js +0 -2
  177. package/dist/chunks/id-YFuArJA6.js.map +0 -1
  178. package/dist/chunks/it-UH9OzFhg.js.map +0 -1
  179. package/dist/chunks/it-mhkzXBM9.js +0 -2
  180. package/dist/chunks/it-mhkzXBM9.js.map +0 -1
  181. package/dist/chunks/ja-6l_z_G9k.js +0 -2
  182. package/dist/chunks/ja-6l_z_G9k.js.map +0 -1
  183. package/dist/chunks/ja-BYC8FRN8.js.map +0 -1
  184. package/dist/chunks/ko-Bjs2ZRcF.js.map +0 -1
  185. package/dist/chunks/ko-YAl4XwHu.js +0 -2
  186. package/dist/chunks/ko-YAl4XwHu.js.map +0 -1
  187. package/dist/chunks/nl-C-9zHtfb.js +0 -2
  188. package/dist/chunks/nl-C-9zHtfb.js.map +0 -1
  189. package/dist/chunks/nl-Ch5HFWQO.js.map +0 -1
  190. package/dist/chunks/no-CljpinWz.js.map +0 -1
  191. package/dist/chunks/no-qzPitLlx.js +0 -2
  192. package/dist/chunks/no-qzPitLlx.js.map +0 -1
  193. package/dist/chunks/pl-CUcSS0zZ.js.map +0 -1
  194. package/dist/chunks/pl-MAIYeuhW.js +0 -2
  195. package/dist/chunks/pl-MAIYeuhW.js.map +0 -1
  196. package/dist/chunks/port-name-BPfQKtdb.js +0 -5
  197. package/dist/chunks/port-name-BPfQKtdb.js.map +0 -1
  198. package/dist/chunks/port-name-qwB109u9.js +0 -2
  199. package/dist/chunks/port-name-qwB109u9.js.map +0 -1
  200. package/dist/chunks/pt-BHK0LwkC.js.map +0 -1
  201. package/dist/chunks/pt-DqDabE4v.js +0 -2
  202. package/dist/chunks/pt-DqDabE4v.js.map +0 -1
  203. package/dist/chunks/ro-BVs-lHH-.js +0 -2
  204. package/dist/chunks/ro-BVs-lHH-.js.map +0 -1
  205. package/dist/chunks/ro-Bj8cwU2n.js.map +0 -1
  206. package/dist/chunks/ru-CgqNy0Gb.js.map +0 -1
  207. package/dist/chunks/ru-DP7qDAmE.js +0 -2
  208. package/dist/chunks/ru-DP7qDAmE.js.map +0 -1
  209. package/dist/chunks/sv-B3QEYGgd.js +0 -2
  210. package/dist/chunks/sv-B3QEYGgd.js.map +0 -1
  211. package/dist/chunks/sv-H7jroOQ5.js.map +0 -1
  212. package/dist/chunks/th-Dqm-gpGe.js.map +0 -1
  213. package/dist/chunks/th-DzQau9aW.js +0 -2
  214. package/dist/chunks/th-DzQau9aW.js.map +0 -1
  215. package/dist/chunks/tr-D3zPcNtT.js.map +0 -1
  216. package/dist/chunks/tr-cG1YuE1E.js +0 -2
  217. package/dist/chunks/tr-cG1YuE1E.js.map +0 -1
  218. package/dist/chunks/uk-CoIIs3QI.js.map +0 -1
  219. package/dist/chunks/uk-Cvbo0IBW.js +0 -2
  220. package/dist/chunks/uk-Cvbo0IBW.js.map +0 -1
  221. package/dist/chunks/vi-BRtYSBUp.js +0 -2
  222. package/dist/chunks/vi-BRtYSBUp.js.map +0 -1
  223. package/dist/chunks/vi-C_fruIbh.js.map +0 -1
  224. package/dist/chunks/zh-CwczPMPp.js +0 -2
  225. package/dist/chunks/zh-CwczPMPp.js.map +0 -1
  226. package/dist/chunks/zh-LDkEV2D9.js.map +0 -1
package/dist/content.js CHANGED
@@ -1,16 +1,62 @@
1
- import { P as B, B as Ue, E as je, c as Re, A as le, w as ze, a as K, r as De, b as qe } from "./chunks/chrome-port-rVd4zwU3.js";
2
- import { render as X, h as ce, createContext as Ne } from "preact";
3
- import { jsx as o, jsxs as u, Fragment as oe } from "preact/jsx-runtime";
4
- import { useState as x, useEffect as O, useContext as Fe, useRef as z, useMemo as Ve, useLayoutEffect as $e } from "preact/hooks";
5
- import { P as He } from "./chunks/port-name-BPfQKtdb.js";
6
- const ve = '@layer theme,base,components,utilities;@layer theme{@theme default{ --font-sans: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; --font-serif: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif; --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-100: oklch(93.6% .032 17.717); --color-red-200: oklch(88.5% .062 18.334); --color-red-300: oklch(80.8% .114 19.571); --color-red-400: oklch(70.4% .191 22.216); --color-red-500: oklch(63.7% .237 25.331); --color-red-600: oklch(57.7% .245 27.325); --color-red-700: oklch(50.5% .213 27.518); --color-red-800: oklch(44.4% .177 26.899); --color-red-900: oklch(39.6% .141 25.723); --color-red-950: oklch(25.8% .092 26.042); --color-orange-50: oklch(98% .016 73.684); --color-orange-100: oklch(95.4% .038 75.164); --color-orange-200: oklch(90.1% .076 70.697); --color-orange-300: oklch(83.7% .128 66.29); --color-orange-400: oklch(75% .183 55.934); --color-orange-500: oklch(70.5% .213 47.604); --color-orange-600: oklch(64.6% .222 41.116); --color-orange-700: oklch(55.3% .195 38.402); --color-orange-800: oklch(47% .157 37.304); --color-orange-900: oklch(40.8% .123 38.172); --color-orange-950: oklch(26.6% .079 36.259); --color-amber-50: oklch(98.7% .022 95.277); --color-amber-100: oklch(96.2% .059 95.617); --color-amber-200: oklch(92.4% .12 95.746); --color-amber-300: oklch(87.9% .169 91.605); --color-amber-400: oklch(82.8% .189 84.429); --color-amber-500: oklch(76.9% .188 70.08); --color-amber-600: oklch(66.6% .179 58.318); --color-amber-700: oklch(55.5% .163 48.998); --color-amber-800: oklch(47.3% .137 46.201); --color-amber-900: oklch(41.4% .112 45.904); --color-amber-950: oklch(27.9% .077 45.635); --color-yellow-50: oklch(98.7% .026 102.212); --color-yellow-100: oklch(97.3% .071 103.193); --color-yellow-200: oklch(94.5% .129 101.54); --color-yellow-300: oklch(90.5% .182 98.111); --color-yellow-400: oklch(85.2% .199 91.936); --color-yellow-500: oklch(79.5% .184 86.047); --color-yellow-600: oklch(68.1% .162 75.834); --color-yellow-700: oklch(55.4% .135 66.442); --color-yellow-800: oklch(47.6% .114 61.907); --color-yellow-900: oklch(42.1% .095 57.708); --color-yellow-950: oklch(28.6% .066 53.813); --color-lime-50: oklch(98.6% .031 120.757); --color-lime-100: oklch(96.7% .067 122.328); --color-lime-200: oklch(93.8% .127 124.321); --color-lime-300: oklch(89.7% .196 126.665); --color-lime-400: oklch(84.1% .238 128.85); --color-lime-500: oklch(76.8% .233 130.85); --color-lime-600: oklch(64.8% .2 131.684); --color-lime-700: oklch(53.2% .157 131.589); --color-lime-800: oklch(45.3% .124 130.933); --color-lime-900: oklch(40.5% .101 131.063); --color-lime-950: oklch(27.4% .072 132.109); --color-green-50: oklch(98.2% .018 155.826); --color-green-100: oklch(96.2% .044 156.743); --color-green-200: oklch(92.5% .084 155.995); --color-green-300: oklch(87.1% .15 154.449); --color-green-400: oklch(79.2% .209 151.711); --color-green-500: oklch(72.3% .219 149.579); --color-green-600: oklch(62.7% .194 149.214); --color-green-700: oklch(52.7% .154 150.069); --color-green-800: oklch(44.8% .119 151.328); --color-green-900: oklch(39.3% .095 152.535); --color-green-950: oklch(26.6% .065 152.934); --color-emerald-50: oklch(97.9% .021 166.113); --color-emerald-100: oklch(95% .052 163.051); --color-emerald-200: oklch(90.5% .093 164.15); --color-emerald-300: oklch(84.5% .143 164.978); --color-emerald-400: oklch(76.5% .177 163.223); --color-emerald-500: oklch(69.6% .17 162.48); --color-emerald-600: oklch(59.6% .145 163.225); --color-emerald-700: oklch(50.8% .118 165.612); --color-emerald-800: oklch(43.2% .095 166.913); --color-emerald-900: oklch(37.8% .077 168.94); --color-emerald-950: oklch(26.2% .051 172.552); --color-teal-50: oklch(98.4% .014 180.72); --color-teal-100: oklch(95.3% .051 180.801); --color-teal-200: oklch(91% .096 180.426); --color-teal-300: oklch(85.5% .138 181.071); --color-teal-400: oklch(77.7% .152 181.912); --color-teal-500: oklch(70.4% .14 182.503); --color-teal-600: oklch(60% .118 184.704); --color-teal-700: oklch(51.1% .096 186.391); --color-teal-800: oklch(43.7% .078 188.216); --color-teal-900: oklch(38.6% .063 188.416); --color-teal-950: oklch(27.7% .046 192.524); --color-cyan-50: oklch(98.4% .019 200.873); --color-cyan-100: oklch(95.6% .045 203.388); --color-cyan-200: oklch(91.7% .08 205.041); --color-cyan-300: oklch(86.5% .127 207.078); --color-cyan-400: oklch(78.9% .154 211.53); --color-cyan-500: oklch(71.5% .143 215.221); --color-cyan-600: oklch(60.9% .126 221.723); --color-cyan-700: oklch(52% .105 223.128); --color-cyan-800: oklch(45% .085 224.283); --color-cyan-900: oklch(39.8% .07 227.392); --color-cyan-950: oklch(30.2% .056 229.695); --color-sky-50: oklch(97.7% .013 236.62); --color-sky-100: oklch(95.1% .026 236.824); --color-sky-200: oklch(90.1% .058 230.902); --color-sky-300: oklch(82.8% .111 230.318); --color-sky-400: oklch(74.6% .16 232.661); --color-sky-500: oklch(68.5% .169 237.323); --color-sky-600: oklch(58.8% .158 241.966); --color-sky-700: oklch(50% .134 242.749); --color-sky-800: oklch(44.3% .11 240.79); --color-sky-900: oklch(39.1% .09 240.876); --color-sky-950: oklch(29.3% .066 243.157); --color-blue-50: oklch(97% .014 254.604); --color-blue-100: oklch(93.2% .032 255.585); --color-blue-200: oklch(88.2% .059 254.128); --color-blue-300: oklch(80.9% .105 251.813); --color-blue-400: oklch(70.7% .165 254.624); --color-blue-500: oklch(62.3% .214 259.815); --color-blue-600: oklch(54.6% .245 262.881); --color-blue-700: oklch(48.8% .243 264.376); --color-blue-800: oklch(42.4% .199 265.638); --color-blue-900: oklch(37.9% .146 265.522); --color-blue-950: oklch(28.2% .091 267.935); --color-indigo-50: oklch(96.2% .018 272.314); --color-indigo-100: oklch(93% .034 272.788); --color-indigo-200: oklch(87% .065 274.039); --color-indigo-300: oklch(78.5% .115 274.713); --color-indigo-400: oklch(67.3% .182 276.935); --color-indigo-500: oklch(58.5% .233 277.117); --color-indigo-600: oklch(51.1% .262 276.966); --color-indigo-700: oklch(45.7% .24 277.023); --color-indigo-800: oklch(39.8% .195 277.366); --color-indigo-900: oklch(35.9% .144 278.697); --color-indigo-950: oklch(25.7% .09 281.288); --color-violet-50: oklch(96.9% .016 293.756); --color-violet-100: oklch(94.3% .029 294.588); --color-violet-200: oklch(89.4% .057 293.283); --color-violet-300: oklch(81.1% .111 293.571); --color-violet-400: oklch(70.2% .183 293.541); --color-violet-500: oklch(60.6% .25 292.717); --color-violet-600: oklch(54.1% .281 293.009); --color-violet-700: oklch(49.1% .27 292.581); --color-violet-800: oklch(43.2% .232 292.759); --color-violet-900: oklch(38% .189 293.745); --color-violet-950: oklch(28.3% .141 291.089); --color-purple-50: oklch(97.7% .014 308.299); --color-purple-100: oklch(94.6% .033 307.174); --color-purple-200: oklch(90.2% .063 306.703); --color-purple-300: oklch(82.7% .119 306.383); --color-purple-400: oklch(71.4% .203 305.504); --color-purple-500: oklch(62.7% .265 303.9); --color-purple-600: oklch(55.8% .288 302.321); --color-purple-700: oklch(49.6% .265 301.924); --color-purple-800: oklch(43.8% .218 303.724); --color-purple-900: oklch(38.1% .176 304.987); --color-purple-950: oklch(29.1% .149 302.717); --color-fuchsia-50: oklch(97.7% .017 320.058); --color-fuchsia-100: oklch(95.2% .037 318.852); --color-fuchsia-200: oklch(90.3% .076 319.62); --color-fuchsia-300: oklch(83.3% .145 321.434); --color-fuchsia-400: oklch(74% .238 322.16); --color-fuchsia-500: oklch(66.7% .295 322.15); --color-fuchsia-600: oklch(59.1% .293 322.896); --color-fuchsia-700: oklch(51.8% .253 323.949); --color-fuchsia-800: oklch(45.2% .211 324.591); --color-fuchsia-900: oklch(40.1% .17 325.612); --color-fuchsia-950: oklch(29.3% .136 325.661); --color-pink-50: oklch(97.1% .014 343.198); --color-pink-100: oklch(94.8% .028 342.258); --color-pink-200: oklch(89.9% .061 343.231); --color-pink-300: oklch(82.3% .12 346.018); --color-pink-400: oklch(71.8% .202 349.761); --color-pink-500: oklch(65.6% .241 354.308); --color-pink-600: oklch(59.2% .249 .584); --color-pink-700: oklch(52.5% .223 3.958); --color-pink-800: oklch(45.9% .187 3.815); --color-pink-900: oklch(40.8% .153 2.432); --color-pink-950: oklch(28.4% .109 3.907); --color-rose-50: oklch(96.9% .015 12.422); --color-rose-100: oklch(94.1% .03 12.58); --color-rose-200: oklch(89.2% .058 10.001); --color-rose-300: oklch(81% .117 11.638); --color-rose-400: oklch(71.2% .194 13.428); --color-rose-500: oklch(64.5% .246 16.439); --color-rose-600: oklch(58.6% .253 17.585); --color-rose-700: oklch(51.4% .222 16.935); --color-rose-800: oklch(45.5% .188 13.697); --color-rose-900: oklch(41% .159 10.272); --color-rose-950: oklch(27.1% .105 12.094); --color-slate-50: oklch(98.4% .003 247.858); --color-slate-100: oklch(96.8% .007 247.896); --color-slate-200: oklch(92.9% .013 255.508); --color-slate-300: oklch(86.9% .022 252.894); --color-slate-400: oklch(70.4% .04 256.788); --color-slate-500: oklch(55.4% .046 257.417); --color-slate-600: oklch(44.6% .043 257.281); --color-slate-700: oklch(37.2% .044 257.287); --color-slate-800: oklch(27.9% .041 260.031); --color-slate-900: oklch(20.8% .042 265.755); --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-gray-950: oklch(13% .028 261.692); --color-zinc-50: oklch(98.5% 0 0); --color-zinc-100: oklch(96.7% .001 286.375); --color-zinc-200: oklch(92% .004 286.32); --color-zinc-300: oklch(87.1% .006 286.286); --color-zinc-400: oklch(70.5% .015 286.067); --color-zinc-500: oklch(55.2% .016 285.938); --color-zinc-600: oklch(44.2% .017 285.786); --color-zinc-700: oklch(37% .013 285.805); --color-zinc-800: oklch(27.4% .006 286.033); --color-zinc-900: oklch(21% .006 285.885); --color-zinc-950: oklch(14.1% .005 285.823); --color-neutral-50: oklch(98.5% 0 0); --color-neutral-100: oklch(97% 0 0); --color-neutral-200: oklch(92.2% 0 0); --color-neutral-300: oklch(87% 0 0); --color-neutral-400: oklch(70.8% 0 0); --color-neutral-500: oklch(55.6% 0 0); --color-neutral-600: oklch(43.9% 0 0); --color-neutral-700: oklch(37.1% 0 0); --color-neutral-800: oklch(26.9% 0 0); --color-neutral-900: oklch(20.5% 0 0); --color-neutral-950: oklch(14.5% 0 0); --color-stone-50: oklch(98.5% .001 106.423); --color-stone-100: oklch(97% .001 106.424); --color-stone-200: oklch(92.3% .003 48.717); --color-stone-300: oklch(86.9% .005 56.366); --color-stone-400: oklch(70.9% .01 56.259); --color-stone-500: oklch(55.3% .013 58.071); --color-stone-600: oklch(44.4% .011 73.639); --color-stone-700: oklch(37.4% .01 67.558); --color-stone-800: oklch(26.8% .007 34.298); --color-stone-900: oklch(21.6% .006 56.043); --color-stone-950: oklch(14.7% .004 49.25); --color-mauve-50: oklch(98.5% 0 0); --color-mauve-100: oklch(96% .003 325.6); --color-mauve-200: oklch(92.2% .005 325.62); --color-mauve-300: oklch(86.5% .012 325.68); --color-mauve-400: oklch(71.1% .019 323.02); --color-mauve-500: oklch(54.2% .034 322.5); --color-mauve-600: oklch(43.5% .029 321.78); --color-mauve-700: oklch(36.4% .029 323.89); --color-mauve-800: oklch(26.3% .024 320.12); --color-mauve-900: oklch(21.2% .019 322.12); --color-mauve-950: oklch(14.5% .008 326); --color-olive-50: oklch(98.8% .003 106.5); --color-olive-100: oklch(96.6% .005 106.5); --color-olive-200: oklch(93% .007 106.5); --color-olive-300: oklch(88% .011 106.6); --color-olive-400: oklch(73.7% .021 106.9); --color-olive-500: oklch(58% .031 107.3); --color-olive-600: oklch(46.6% .025 107.3); --color-olive-700: oklch(39.4% .023 107.4); --color-olive-800: oklch(28.6% .016 107.4); --color-olive-900: oklch(22.8% .013 107.4); --color-olive-950: oklch(15.3% .006 107.1); --color-mist-50: oklch(98.7% .002 197.1); --color-mist-100: oklch(96.3% .002 197.1); --color-mist-200: oklch(92.5% .005 214.3); --color-mist-300: oklch(87.2% .007 219.6); --color-mist-400: oklch(72.3% .014 214.4); --color-mist-500: oklch(56% .021 213.5); --color-mist-600: oklch(45% .017 213.2); --color-mist-700: oklch(37.8% .015 216); --color-mist-800: oklch(27.5% .011 216.9); --color-mist-900: oklch(21.8% .008 223.9); --color-mist-950: oklch(14.8% .004 228.8); --color-taupe-50: oklch(98.6% .002 67.8); --color-taupe-100: oklch(96% .002 17.2); --color-taupe-200: oklch(92.2% .005 34.3); --color-taupe-300: oklch(86.8% .007 39.5); --color-taupe-400: oklch(71.4% .014 41.2); --color-taupe-500: oklch(54.7% .021 43.1); --color-taupe-600: oklch(43.8% .017 39.3); --color-taupe-700: oklch(36.7% .016 35.7); --color-taupe-800: oklch(26.8% .011 36.5); --color-taupe-900: oklch(21.4% .009 43.1); --color-taupe-950: oklch(14.7% .004 49.3); --color-black: #000; --color-white: #fff; --spacing: .25rem; --breakpoint-sm: 40rem; --breakpoint-md: 48rem; --breakpoint-lg: 64rem; --breakpoint-xl: 80rem; --breakpoint-2xl: 96rem; --container-3xs: 16rem; --container-2xs: 18rem; --container-xs: 20rem; --container-sm: 24rem; --container-md: 28rem; --container-lg: 32rem; --container-xl: 36rem; --container-2xl: 42rem; --container-3xl: 48rem; --container-4xl: 56rem; --container-5xl: 64rem; --container-6xl: 72rem; --container-7xl: 80rem; --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 ; --text-4xl: 2.25rem; --text-4xl--line-height: calc(2.5 / 2.25); --text-5xl: 3rem; --text-5xl--line-height: 1; --text-6xl: 3.75rem; --text-6xl--line-height: 1; --text-7xl: 4.5rem; --text-7xl--line-height: 1; --text-8xl: 6rem; --text-8xl--line-height: 1; --text-9xl: 8rem; --text-9xl--line-height: 1; --font-weight-thin: 100; --font-weight-extralight: 200; --font-weight-light: 300; --font-weight-normal: 400; --font-weight-medium: 500; --font-weight-semibold: 600; --font-weight-bold: 700; --font-weight-extrabold: 800; --font-weight-black: 900; --tracking-tighter: -.05em; --tracking-tight: -.025em; --tracking-normal: 0em; --tracking-wide: .025em; --tracking-wider: .05em; --tracking-widest: .1em; --leading-tight: 1.25; --leading-snug: 1.375; --leading-normal: 1.5; --leading-relaxed: 1.625; --leading-loose: 2; --radius-xs: .125rem; --radius-sm: .25rem; --radius-md: .375rem; --radius-lg: .5rem; --radius-xl: .75rem; --radius-2xl: 1rem; --radius-3xl: 1.5rem; --radius-4xl: 2rem; --shadow-2xs: 0 1px rgb(0 0 0 / .05); --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / .05); --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1); --shadow-md: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1); --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1); --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1); --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / .25); --inset-shadow-2xs: inset 0 1px rgb(0 0 0 / .05); --inset-shadow-xs: inset 0 1px 1px rgb(0 0 0 / .05); --inset-shadow-sm: inset 0 2px 4px rgb(0 0 0 / .05); --drop-shadow-xs: 0 1px 1px rgb(0 0 0 / .05); --drop-shadow-sm: 0 1px 2px rgb(0 0 0 / .15); --drop-shadow-md: 0 3px 3px rgb(0 0 0 / .12); --drop-shadow-lg: 0 4px 4px rgb(0 0 0 / .15); --drop-shadow-xl: 0 9px 7px rgb(0 0 0 / .1); --drop-shadow-2xl: 0 25px 25px rgb(0 0 0 / .15); --text-shadow-2xs: 0px 1px 0px rgb(0 0 0 / .15); --text-shadow-xs: 0px 1px 1px rgb(0 0 0 / .2); --text-shadow-sm: 0px 1px 0px rgb(0 0 0 / .075), 0px 1px 1px rgb(0 0 0 / .075), 0px 2px 2px rgb(0 0 0 / .075); --text-shadow-md: 0px 1px 1px rgb(0 0 0 / .1), 0px 1px 2px rgb(0 0 0 / .1), 0px 2px 4px rgb(0 0 0 / .1); --text-shadow-lg: 0px 1px 2px rgb(0 0 0 / .1), 0px 3px 2px rgb(0 0 0 / .1), 0px 4px 8px rgb(0 0 0 / .1); --ease-in: cubic-bezier(.4, 0, 1, 1); --ease-out: cubic-bezier(0, 0, .2, 1); --ease-in-out: cubic-bezier(.4, 0, .2, 1); --animate-spin: spin 1s linear infinite; --animate-ping: ping 1s cubic-bezier(0, 0, .2, 1) infinite; --animate-pulse: pulse 2s cubic-bezier(.4, 0, .6, 1) infinite; --animate-bounce: bounce 1s infinite; @keyframes spin { to { transform: rotate(360deg); } } @keyframes ping { 75%, 100% { transform: scale(2); opacity: 0; } } @keyframes pulse { 50% { opacity: .5; } } @keyframes bounce { 0%, 100% { transform: translateY(-25%); animation-timing-function: cubic-bezier(.8, 0, 1, 1); } 50% { transform: none; animation-timing-function: cubic-bezier(0, 0, .2, 1); } } --blur-xs: 4px; --blur-sm: 8px; --blur-md: 12px; --blur-lg: 16px; --blur-xl: 24px; --blur-2xl: 40px; --blur-3xl: 64px; --perspective-dramatic: 100px; --perspective-near: 300px; --perspective-normal: 500px; --perspective-midrange: 800px; --perspective-distant: 1200px; --aspect-video: 16 / 9; --default-transition-duration: .15s; --default-transition-timing-function: cubic-bezier(.4, 0, .2, 1); --default-font-family: --theme(--font-sans, initial); --default-font-feature-settings: --theme( --font-sans--font-feature-settings, initial ); --default-font-variation-settings: --theme( --font-sans--font-variation-settings, initial ); --default-mono-font-family: --theme(--font-mono, initial); --default-mono-font-feature-settings: --theme( --font-mono--font-feature-settings, initial ); --default-mono-font-variation-settings: --theme( --font-mono--font-variation-settings, initial ); }@theme default inline reference{ --blur: 8px; --shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1); --shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / .05); --drop-shadow: 0 1px 2px rgb(0 0 0 / .1), 0 1px 1px rgb(0 0 0 / .06); --radius: .25rem; --max-width-prose: 65ch; }}@layer base{*,:after,:before,::backdrop,::file-selector-button{box-sizing:border-box;margin:0;padding:0;border:0 solid}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;tab-size:4;font-family:--theme(--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:--theme(--default-font-feature-settings,normal);font-variation-settings:--theme(--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:--theme(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:--theme(--default-mono-font-feature-settings,normal);font-variation-settings:--theme(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}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{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea,::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;border-radius:0;background-color:transparent;opacity:1}: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: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,::-webkit-datetime-edit-year-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-millisecond-field,::-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]),::file-selector-button{appearance:button}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer utilities{@tailwind utilities;}@source "../**/*.{ts,tsx,js,jsx}";@layer base{:host{all:initial;color-scheme:light;font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizeLegibility}*,*:before,*:after{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}*,*:before,*:after{box-sizing:border-box}button{font-family:inherit;cursor:pointer}button:disabled{cursor:not-allowed}[role=button],[role=radio]{cursor:pointer}}.pw-cta-shimmer:before{content:"";position:absolute;top:0;left:-100%;width:100%;height:100%;background:linear-gradient(90deg,transparent,rgba(255,255,255,.35) 50%,transparent);animation:pw-cta-shimmer 3s infinite;z-index:1}@keyframes pw-cta-shimmer{0%{left:-100%}to{left:100%}}';
7
- let ue = !1;
8
- function Ge() {
9
- if (ue || (ue = !0, typeof CSS > "u" || typeof CSS.registerProperty != "function")) return;
1
+ import { P as L, B as qe, E as Ne, c as Fe, A as de, w as Ve, a as Q, r as $e, b as He } from "./chunks/chrome-port-bfTUUDz_.js";
2
+ import { render as ee, h as he, createContext as Ge } from "preact";
3
+ import { jsx as o, jsxs as u, Fragment as le } from "preact/jsx-runtime";
4
+ import { useState as k, useEffect as P, useContext as We, useRef as U, useMemo as Ze, useLayoutEffect as Ye } from "preact/hooks";
5
+ import { P as Ke } from "./chunks/port-name-ervLBWAQ.js";
6
+ function Xe(r) {
7
+ return `pw-offer-${r}-start`;
8
+ }
9
+ function Ce(r, e) {
10
+ if (!r || r.length === 0) return null;
11
+ const t = r.find(
12
+ (i) => i.price_id === e && (i.discount_percent ?? 0) > 0
13
+ );
14
+ return t || (r.find(
15
+ (i) => i.price_id == null && (i.discount_percent ?? 0) > 0
16
+ ) ?? null);
17
+ }
18
+ function $(r, e, t = {}) {
19
+ const n = Ce(r, e);
20
+ return n && Ie(n, t) ? n : null;
21
+ }
22
+ function Ie(r, e = {}) {
23
+ const t = r.discount_percent ?? 0;
24
+ if (t <= 0) return null;
25
+ const n = e.now ?? Date.now(), i = Je(r, e.readStart), s = Qe(r, i), a = i !== null ? Math.max(0, i - n) : null;
26
+ return i !== null && i <= n ? null : { offer: r, discountPercent: t, remainingMs: a, totalMs: s, expiresAt: i };
27
+ }
28
+ function Je(r, e) {
29
+ if (r.expires_at) {
30
+ const t = Date.parse(r.expires_at);
31
+ return Number.isFinite(t) ? t : null;
32
+ }
33
+ if (r.duration_minutes && r.duration_minutes > 0 && e) {
34
+ const t = e(r.id);
35
+ if (!t) return null;
36
+ const n = Date.parse(t);
37
+ return Number.isFinite(n) ? n + r.duration_minutes * 6e4 : null;
38
+ }
39
+ return null;
40
+ }
41
+ function Qe(r, e) {
42
+ return r.duration_minutes && r.duration_minutes > 0 ? r.duration_minutes * 6e4 : e !== null ? e - Date.now() : null;
43
+ }
44
+ function N(r) {
45
+ if (typeof window > "u") return null;
46
+ try {
47
+ return window.localStorage.getItem(Xe(r));
48
+ } catch {
49
+ return null;
50
+ }
51
+ }
52
+ const Ae = '@layer theme,base,components,utilities;@layer theme{@theme default{ --font-sans: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; --font-serif: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif; --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-100: oklch(93.6% .032 17.717); --color-red-200: oklch(88.5% .062 18.334); --color-red-300: oklch(80.8% .114 19.571); --color-red-400: oklch(70.4% .191 22.216); --color-red-500: oklch(63.7% .237 25.331); --color-red-600: oklch(57.7% .245 27.325); --color-red-700: oklch(50.5% .213 27.518); --color-red-800: oklch(44.4% .177 26.899); --color-red-900: oklch(39.6% .141 25.723); --color-red-950: oklch(25.8% .092 26.042); --color-orange-50: oklch(98% .016 73.684); --color-orange-100: oklch(95.4% .038 75.164); --color-orange-200: oklch(90.1% .076 70.697); --color-orange-300: oklch(83.7% .128 66.29); --color-orange-400: oklch(75% .183 55.934); --color-orange-500: oklch(70.5% .213 47.604); --color-orange-600: oklch(64.6% .222 41.116); --color-orange-700: oklch(55.3% .195 38.402); --color-orange-800: oklch(47% .157 37.304); --color-orange-900: oklch(40.8% .123 38.172); --color-orange-950: oklch(26.6% .079 36.259); --color-amber-50: oklch(98.7% .022 95.277); --color-amber-100: oklch(96.2% .059 95.617); --color-amber-200: oklch(92.4% .12 95.746); --color-amber-300: oklch(87.9% .169 91.605); --color-amber-400: oklch(82.8% .189 84.429); --color-amber-500: oklch(76.9% .188 70.08); --color-amber-600: oklch(66.6% .179 58.318); --color-amber-700: oklch(55.5% .163 48.998); --color-amber-800: oklch(47.3% .137 46.201); --color-amber-900: oklch(41.4% .112 45.904); --color-amber-950: oklch(27.9% .077 45.635); --color-yellow-50: oklch(98.7% .026 102.212); --color-yellow-100: oklch(97.3% .071 103.193); --color-yellow-200: oklch(94.5% .129 101.54); --color-yellow-300: oklch(90.5% .182 98.111); --color-yellow-400: oklch(85.2% .199 91.936); --color-yellow-500: oklch(79.5% .184 86.047); --color-yellow-600: oklch(68.1% .162 75.834); --color-yellow-700: oklch(55.4% .135 66.442); --color-yellow-800: oklch(47.6% .114 61.907); --color-yellow-900: oklch(42.1% .095 57.708); --color-yellow-950: oklch(28.6% .066 53.813); --color-lime-50: oklch(98.6% .031 120.757); --color-lime-100: oklch(96.7% .067 122.328); --color-lime-200: oklch(93.8% .127 124.321); --color-lime-300: oklch(89.7% .196 126.665); --color-lime-400: oklch(84.1% .238 128.85); --color-lime-500: oklch(76.8% .233 130.85); --color-lime-600: oklch(64.8% .2 131.684); --color-lime-700: oklch(53.2% .157 131.589); --color-lime-800: oklch(45.3% .124 130.933); --color-lime-900: oklch(40.5% .101 131.063); --color-lime-950: oklch(27.4% .072 132.109); --color-green-50: oklch(98.2% .018 155.826); --color-green-100: oklch(96.2% .044 156.743); --color-green-200: oklch(92.5% .084 155.995); --color-green-300: oklch(87.1% .15 154.449); --color-green-400: oklch(79.2% .209 151.711); --color-green-500: oklch(72.3% .219 149.579); --color-green-600: oklch(62.7% .194 149.214); --color-green-700: oklch(52.7% .154 150.069); --color-green-800: oklch(44.8% .119 151.328); --color-green-900: oklch(39.3% .095 152.535); --color-green-950: oklch(26.6% .065 152.934); --color-emerald-50: oklch(97.9% .021 166.113); --color-emerald-100: oklch(95% .052 163.051); --color-emerald-200: oklch(90.5% .093 164.15); --color-emerald-300: oklch(84.5% .143 164.978); --color-emerald-400: oklch(76.5% .177 163.223); --color-emerald-500: oklch(69.6% .17 162.48); --color-emerald-600: oklch(59.6% .145 163.225); --color-emerald-700: oklch(50.8% .118 165.612); --color-emerald-800: oklch(43.2% .095 166.913); --color-emerald-900: oklch(37.8% .077 168.94); --color-emerald-950: oklch(26.2% .051 172.552); --color-teal-50: oklch(98.4% .014 180.72); --color-teal-100: oklch(95.3% .051 180.801); --color-teal-200: oklch(91% .096 180.426); --color-teal-300: oklch(85.5% .138 181.071); --color-teal-400: oklch(77.7% .152 181.912); --color-teal-500: oklch(70.4% .14 182.503); --color-teal-600: oklch(60% .118 184.704); --color-teal-700: oklch(51.1% .096 186.391); --color-teal-800: oklch(43.7% .078 188.216); --color-teal-900: oklch(38.6% .063 188.416); --color-teal-950: oklch(27.7% .046 192.524); --color-cyan-50: oklch(98.4% .019 200.873); --color-cyan-100: oklch(95.6% .045 203.388); --color-cyan-200: oklch(91.7% .08 205.041); --color-cyan-300: oklch(86.5% .127 207.078); --color-cyan-400: oklch(78.9% .154 211.53); --color-cyan-500: oklch(71.5% .143 215.221); --color-cyan-600: oklch(60.9% .126 221.723); --color-cyan-700: oklch(52% .105 223.128); --color-cyan-800: oklch(45% .085 224.283); --color-cyan-900: oklch(39.8% .07 227.392); --color-cyan-950: oklch(30.2% .056 229.695); --color-sky-50: oklch(97.7% .013 236.62); --color-sky-100: oklch(95.1% .026 236.824); --color-sky-200: oklch(90.1% .058 230.902); --color-sky-300: oklch(82.8% .111 230.318); --color-sky-400: oklch(74.6% .16 232.661); --color-sky-500: oklch(68.5% .169 237.323); --color-sky-600: oklch(58.8% .158 241.966); --color-sky-700: oklch(50% .134 242.749); --color-sky-800: oklch(44.3% .11 240.79); --color-sky-900: oklch(39.1% .09 240.876); --color-sky-950: oklch(29.3% .066 243.157); --color-blue-50: oklch(97% .014 254.604); --color-blue-100: oklch(93.2% .032 255.585); --color-blue-200: oklch(88.2% .059 254.128); --color-blue-300: oklch(80.9% .105 251.813); --color-blue-400: oklch(70.7% .165 254.624); --color-blue-500: oklch(62.3% .214 259.815); --color-blue-600: oklch(54.6% .245 262.881); --color-blue-700: oklch(48.8% .243 264.376); --color-blue-800: oklch(42.4% .199 265.638); --color-blue-900: oklch(37.9% .146 265.522); --color-blue-950: oklch(28.2% .091 267.935); --color-indigo-50: oklch(96.2% .018 272.314); --color-indigo-100: oklch(93% .034 272.788); --color-indigo-200: oklch(87% .065 274.039); --color-indigo-300: oklch(78.5% .115 274.713); --color-indigo-400: oklch(67.3% .182 276.935); --color-indigo-500: oklch(58.5% .233 277.117); --color-indigo-600: oklch(51.1% .262 276.966); --color-indigo-700: oklch(45.7% .24 277.023); --color-indigo-800: oklch(39.8% .195 277.366); --color-indigo-900: oklch(35.9% .144 278.697); --color-indigo-950: oklch(25.7% .09 281.288); --color-violet-50: oklch(96.9% .016 293.756); --color-violet-100: oklch(94.3% .029 294.588); --color-violet-200: oklch(89.4% .057 293.283); --color-violet-300: oklch(81.1% .111 293.571); --color-violet-400: oklch(70.2% .183 293.541); --color-violet-500: oklch(60.6% .25 292.717); --color-violet-600: oklch(54.1% .281 293.009); --color-violet-700: oklch(49.1% .27 292.581); --color-violet-800: oklch(43.2% .232 292.759); --color-violet-900: oklch(38% .189 293.745); --color-violet-950: oklch(28.3% .141 291.089); --color-purple-50: oklch(97.7% .014 308.299); --color-purple-100: oklch(94.6% .033 307.174); --color-purple-200: oklch(90.2% .063 306.703); --color-purple-300: oklch(82.7% .119 306.383); --color-purple-400: oklch(71.4% .203 305.504); --color-purple-500: oklch(62.7% .265 303.9); --color-purple-600: oklch(55.8% .288 302.321); --color-purple-700: oklch(49.6% .265 301.924); --color-purple-800: oklch(43.8% .218 303.724); --color-purple-900: oklch(38.1% .176 304.987); --color-purple-950: oklch(29.1% .149 302.717); --color-fuchsia-50: oklch(97.7% .017 320.058); --color-fuchsia-100: oklch(95.2% .037 318.852); --color-fuchsia-200: oklch(90.3% .076 319.62); --color-fuchsia-300: oklch(83.3% .145 321.434); --color-fuchsia-400: oklch(74% .238 322.16); --color-fuchsia-500: oklch(66.7% .295 322.15); --color-fuchsia-600: oklch(59.1% .293 322.896); --color-fuchsia-700: oklch(51.8% .253 323.949); --color-fuchsia-800: oklch(45.2% .211 324.591); --color-fuchsia-900: oklch(40.1% .17 325.612); --color-fuchsia-950: oklch(29.3% .136 325.661); --color-pink-50: oklch(97.1% .014 343.198); --color-pink-100: oklch(94.8% .028 342.258); --color-pink-200: oklch(89.9% .061 343.231); --color-pink-300: oklch(82.3% .12 346.018); --color-pink-400: oklch(71.8% .202 349.761); --color-pink-500: oklch(65.6% .241 354.308); --color-pink-600: oklch(59.2% .249 .584); --color-pink-700: oklch(52.5% .223 3.958); --color-pink-800: oklch(45.9% .187 3.815); --color-pink-900: oklch(40.8% .153 2.432); --color-pink-950: oklch(28.4% .109 3.907); --color-rose-50: oklch(96.9% .015 12.422); --color-rose-100: oklch(94.1% .03 12.58); --color-rose-200: oklch(89.2% .058 10.001); --color-rose-300: oklch(81% .117 11.638); --color-rose-400: oklch(71.2% .194 13.428); --color-rose-500: oklch(64.5% .246 16.439); --color-rose-600: oklch(58.6% .253 17.585); --color-rose-700: oklch(51.4% .222 16.935); --color-rose-800: oklch(45.5% .188 13.697); --color-rose-900: oklch(41% .159 10.272); --color-rose-950: oklch(27.1% .105 12.094); --color-slate-50: oklch(98.4% .003 247.858); --color-slate-100: oklch(96.8% .007 247.896); --color-slate-200: oklch(92.9% .013 255.508); --color-slate-300: oklch(86.9% .022 252.894); --color-slate-400: oklch(70.4% .04 256.788); --color-slate-500: oklch(55.4% .046 257.417); --color-slate-600: oklch(44.6% .043 257.281); --color-slate-700: oklch(37.2% .044 257.287); --color-slate-800: oklch(27.9% .041 260.031); --color-slate-900: oklch(20.8% .042 265.755); --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-gray-950: oklch(13% .028 261.692); --color-zinc-50: oklch(98.5% 0 0); --color-zinc-100: oklch(96.7% .001 286.375); --color-zinc-200: oklch(92% .004 286.32); --color-zinc-300: oklch(87.1% .006 286.286); --color-zinc-400: oklch(70.5% .015 286.067); --color-zinc-500: oklch(55.2% .016 285.938); --color-zinc-600: oklch(44.2% .017 285.786); --color-zinc-700: oklch(37% .013 285.805); --color-zinc-800: oklch(27.4% .006 286.033); --color-zinc-900: oklch(21% .006 285.885); --color-zinc-950: oklch(14.1% .005 285.823); --color-neutral-50: oklch(98.5% 0 0); --color-neutral-100: oklch(97% 0 0); --color-neutral-200: oklch(92.2% 0 0); --color-neutral-300: oklch(87% 0 0); --color-neutral-400: oklch(70.8% 0 0); --color-neutral-500: oklch(55.6% 0 0); --color-neutral-600: oklch(43.9% 0 0); --color-neutral-700: oklch(37.1% 0 0); --color-neutral-800: oklch(26.9% 0 0); --color-neutral-900: oklch(20.5% 0 0); --color-neutral-950: oklch(14.5% 0 0); --color-stone-50: oklch(98.5% .001 106.423); --color-stone-100: oklch(97% .001 106.424); --color-stone-200: oklch(92.3% .003 48.717); --color-stone-300: oklch(86.9% .005 56.366); --color-stone-400: oklch(70.9% .01 56.259); --color-stone-500: oklch(55.3% .013 58.071); --color-stone-600: oklch(44.4% .011 73.639); --color-stone-700: oklch(37.4% .01 67.558); --color-stone-800: oklch(26.8% .007 34.298); --color-stone-900: oklch(21.6% .006 56.043); --color-stone-950: oklch(14.7% .004 49.25); --color-mauve-50: oklch(98.5% 0 0); --color-mauve-100: oklch(96% .003 325.6); --color-mauve-200: oklch(92.2% .005 325.62); --color-mauve-300: oklch(86.5% .012 325.68); --color-mauve-400: oklch(71.1% .019 323.02); --color-mauve-500: oklch(54.2% .034 322.5); --color-mauve-600: oklch(43.5% .029 321.78); --color-mauve-700: oklch(36.4% .029 323.89); --color-mauve-800: oklch(26.3% .024 320.12); --color-mauve-900: oklch(21.2% .019 322.12); --color-mauve-950: oklch(14.5% .008 326); --color-olive-50: oklch(98.8% .003 106.5); --color-olive-100: oklch(96.6% .005 106.5); --color-olive-200: oklch(93% .007 106.5); --color-olive-300: oklch(88% .011 106.6); --color-olive-400: oklch(73.7% .021 106.9); --color-olive-500: oklch(58% .031 107.3); --color-olive-600: oklch(46.6% .025 107.3); --color-olive-700: oklch(39.4% .023 107.4); --color-olive-800: oklch(28.6% .016 107.4); --color-olive-900: oklch(22.8% .013 107.4); --color-olive-950: oklch(15.3% .006 107.1); --color-mist-50: oklch(98.7% .002 197.1); --color-mist-100: oklch(96.3% .002 197.1); --color-mist-200: oklch(92.5% .005 214.3); --color-mist-300: oklch(87.2% .007 219.6); --color-mist-400: oklch(72.3% .014 214.4); --color-mist-500: oklch(56% .021 213.5); --color-mist-600: oklch(45% .017 213.2); --color-mist-700: oklch(37.8% .015 216); --color-mist-800: oklch(27.5% .011 216.9); --color-mist-900: oklch(21.8% .008 223.9); --color-mist-950: oklch(14.8% .004 228.8); --color-taupe-50: oklch(98.6% .002 67.8); --color-taupe-100: oklch(96% .002 17.2); --color-taupe-200: oklch(92.2% .005 34.3); --color-taupe-300: oklch(86.8% .007 39.5); --color-taupe-400: oklch(71.4% .014 41.2); --color-taupe-500: oklch(54.7% .021 43.1); --color-taupe-600: oklch(43.8% .017 39.3); --color-taupe-700: oklch(36.7% .016 35.7); --color-taupe-800: oklch(26.8% .011 36.5); --color-taupe-900: oklch(21.4% .009 43.1); --color-taupe-950: oklch(14.7% .004 49.3); --color-black: #000; --color-white: #fff; --spacing: .25rem; --breakpoint-sm: 40rem; --breakpoint-md: 48rem; --breakpoint-lg: 64rem; --breakpoint-xl: 80rem; --breakpoint-2xl: 96rem; --container-3xs: 16rem; --container-2xs: 18rem; --container-xs: 20rem; --container-sm: 24rem; --container-md: 28rem; --container-lg: 32rem; --container-xl: 36rem; --container-2xl: 42rem; --container-3xl: 48rem; --container-4xl: 56rem; --container-5xl: 64rem; --container-6xl: 72rem; --container-7xl: 80rem; --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 ; --text-4xl: 2.25rem; --text-4xl--line-height: calc(2.5 / 2.25); --text-5xl: 3rem; --text-5xl--line-height: 1; --text-6xl: 3.75rem; --text-6xl--line-height: 1; --text-7xl: 4.5rem; --text-7xl--line-height: 1; --text-8xl: 6rem; --text-8xl--line-height: 1; --text-9xl: 8rem; --text-9xl--line-height: 1; --font-weight-thin: 100; --font-weight-extralight: 200; --font-weight-light: 300; --font-weight-normal: 400; --font-weight-medium: 500; --font-weight-semibold: 600; --font-weight-bold: 700; --font-weight-extrabold: 800; --font-weight-black: 900; --tracking-tighter: -.05em; --tracking-tight: -.025em; --tracking-normal: 0em; --tracking-wide: .025em; --tracking-wider: .05em; --tracking-widest: .1em; --leading-tight: 1.25; --leading-snug: 1.375; --leading-normal: 1.5; --leading-relaxed: 1.625; --leading-loose: 2; --radius-xs: .125rem; --radius-sm: .25rem; --radius-md: .375rem; --radius-lg: .5rem; --radius-xl: .75rem; --radius-2xl: 1rem; --radius-3xl: 1.5rem; --radius-4xl: 2rem; --shadow-2xs: 0 1px rgb(0 0 0 / .05); --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / .05); --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1); --shadow-md: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1); --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1); --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1); --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / .25); --inset-shadow-2xs: inset 0 1px rgb(0 0 0 / .05); --inset-shadow-xs: inset 0 1px 1px rgb(0 0 0 / .05); --inset-shadow-sm: inset 0 2px 4px rgb(0 0 0 / .05); --drop-shadow-xs: 0 1px 1px rgb(0 0 0 / .05); --drop-shadow-sm: 0 1px 2px rgb(0 0 0 / .15); --drop-shadow-md: 0 3px 3px rgb(0 0 0 / .12); --drop-shadow-lg: 0 4px 4px rgb(0 0 0 / .15); --drop-shadow-xl: 0 9px 7px rgb(0 0 0 / .1); --drop-shadow-2xl: 0 25px 25px rgb(0 0 0 / .15); --text-shadow-2xs: 0px 1px 0px rgb(0 0 0 / .15); --text-shadow-xs: 0px 1px 1px rgb(0 0 0 / .2); --text-shadow-sm: 0px 1px 0px rgb(0 0 0 / .075), 0px 1px 1px rgb(0 0 0 / .075), 0px 2px 2px rgb(0 0 0 / .075); --text-shadow-md: 0px 1px 1px rgb(0 0 0 / .1), 0px 1px 2px rgb(0 0 0 / .1), 0px 2px 4px rgb(0 0 0 / .1); --text-shadow-lg: 0px 1px 2px rgb(0 0 0 / .1), 0px 3px 2px rgb(0 0 0 / .1), 0px 4px 8px rgb(0 0 0 / .1); --ease-in: cubic-bezier(.4, 0, 1, 1); --ease-out: cubic-bezier(0, 0, .2, 1); --ease-in-out: cubic-bezier(.4, 0, .2, 1); --animate-spin: spin 1s linear infinite; --animate-ping: ping 1s cubic-bezier(0, 0, .2, 1) infinite; --animate-pulse: pulse 2s cubic-bezier(.4, 0, .6, 1) infinite; --animate-bounce: bounce 1s infinite; @keyframes spin { to { transform: rotate(360deg); } } @keyframes ping { 75%, 100% { transform: scale(2); opacity: 0; } } @keyframes pulse { 50% { opacity: .5; } } @keyframes bounce { 0%, 100% { transform: translateY(-25%); animation-timing-function: cubic-bezier(.8, 0, 1, 1); } 50% { transform: none; animation-timing-function: cubic-bezier(0, 0, .2, 1); } } --blur-xs: 4px; --blur-sm: 8px; --blur-md: 12px; --blur-lg: 16px; --blur-xl: 24px; --blur-2xl: 40px; --blur-3xl: 64px; --perspective-dramatic: 100px; --perspective-near: 300px; --perspective-normal: 500px; --perspective-midrange: 800px; --perspective-distant: 1200px; --aspect-video: 16 / 9; --default-transition-duration: .15s; --default-transition-timing-function: cubic-bezier(.4, 0, .2, 1); --default-font-family: --theme(--font-sans, initial); --default-font-feature-settings: --theme( --font-sans--font-feature-settings, initial ); --default-font-variation-settings: --theme( --font-sans--font-variation-settings, initial ); --default-mono-font-family: --theme(--font-mono, initial); --default-mono-font-feature-settings: --theme( --font-mono--font-feature-settings, initial ); --default-mono-font-variation-settings: --theme( --font-mono--font-variation-settings, initial ); }@theme default inline reference{ --blur: 8px; --shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1); --shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / .05); --drop-shadow: 0 1px 2px rgb(0 0 0 / .1), 0 1px 1px rgb(0 0 0 / .06); --radius: .25rem; --max-width-prose: 65ch; }}@layer base{*,:after,:before,::backdrop,::file-selector-button{box-sizing:border-box;margin:0;padding:0;border:0 solid}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;tab-size:4;font-family:--theme(--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:--theme(--default-font-feature-settings,normal);font-variation-settings:--theme(--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:--theme(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:--theme(--default-mono-font-feature-settings,normal);font-variation-settings:--theme(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}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{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea,::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;border-radius:0;background-color:transparent;opacity:1}: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: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,::-webkit-datetime-edit-year-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-millisecond-field,::-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]),::file-selector-button{appearance:button}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer utilities{@tailwind utilities;}@source "../**/*.{ts,tsx,js,jsx}";@layer base{:host{all:initial;color-scheme:light;font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizeLegibility}*,*:before,*:after{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}*,*:before,*:after{box-sizing:border-box}button{font-family:inherit;cursor:pointer}button:disabled{cursor:not-allowed}[role=button],[role=radio]{cursor:pointer}}.pw-cta-shimmer:before{content:"";position:absolute;top:0;left:-100%;width:100%;height:100%;background:linear-gradient(90deg,transparent,rgba(255,255,255,.35) 50%,transparent);animation:pw-cta-shimmer 3s infinite;z-index:1}@keyframes pw-cta-shimmer{0%{left:-100%}to{left:100%}}';
53
+ let pe = !1;
54
+ function et() {
55
+ if (pe || (pe = !0, typeof CSS > "u" || typeof CSS.registerProperty != "function")) return;
10
56
  let r;
11
57
  try {
12
58
  const e = new CSSStyleSheet();
13
- e.replaceSync(ve), r = e.cssRules;
59
+ e.replaceSync(Ae), r = e.cssRules;
14
60
  } catch {
15
61
  return;
16
62
  }
@@ -28,10 +74,10 @@ function Ge() {
28
74
  }
29
75
  }
30
76
  }
31
- function We(r, e, t = {}) {
77
+ function tt(r, e, t = {}) {
32
78
  if (typeof document > "u")
33
79
  throw new Error("mountShadow called in non-DOM environment");
34
- Ge();
80
+ et();
35
81
  const n = t.host ?? document.createElement("div");
36
82
  n.setAttribute("data-paywall-host", ""), n.style.cssText = t.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;", !n.isConnected && !t.inline && document.body.appendChild(n);
37
83
  const i = n.attachShadow({ mode: t.shadowMode ?? "closed" }), s = `
@@ -53,21 +99,21 @@ function We(r, e, t = {}) {
53
99
  visibility: visible !important;
54
100
  }
55
101
  `, a = document.createElement("style");
56
- a.textContent = s + ve + (t.injectCss ?? ""), i.appendChild(a);
57
- const c = document.createElement("div");
58
- c.style.pointerEvents = "auto", i.appendChild(c);
59
- let l = e;
60
- return X(ce(r, l), c), {
102
+ a.textContent = s + Ae + (t.injectCss ?? ""), i.appendChild(a);
103
+ const l = document.createElement("div");
104
+ l.style.pointerEvents = "auto", i.appendChild(l);
105
+ let c = e;
106
+ return ee(he(r, c), l), {
61
107
  shadowRoot: i,
62
- update(f) {
63
- l = { ...l, ...f }, X(ce(r, l), c);
108
+ update(h) {
109
+ c = { ...c, ...h }, ee(he(r, c), l);
64
110
  },
65
111
  unmount() {
66
- X(null, c), n.remove();
112
+ ee(null, l), n.remove();
67
113
  }
68
114
  };
69
115
  }
70
- const Ze = (r, e, t) => {
116
+ const rt = (r, e, t) => {
71
117
  const n = r[e];
72
118
  return n ? typeof n == "function" ? n() : Promise.resolve(n) : new Promise((i, s) => {
73
119
  (typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(
@@ -79,7 +125,7 @@ const Ze = (r, e, t) => {
79
125
  )
80
126
  );
81
127
  });
82
- }, Ye = [
128
+ }, nt = [
83
129
  "ru",
84
130
  "uk",
85
131
  "de",
@@ -107,19 +153,19 @@ const Ze = (r, e, t) => {
107
153
  "th",
108
154
  "vi",
109
155
  "he"
110
- ], _e = (r, e, t) => Ce(e, t), Se = Ne({ t: _e, locale: "en" });
111
- function Ce(r, e) {
156
+ ], Le = (r, e, t) => Te(e, t), Me = Ge({ t: Le, locale: "en" });
157
+ function Te(r, e) {
112
158
  if (!e) return r;
113
159
  let t = r;
114
160
  for (const [n, i] of Object.entries(e))
115
161
  t = t.split(`{${n}}`).join(String(i));
116
162
  return t;
117
163
  }
118
- const J = /* @__PURE__ */ new Map(), Q = /* @__PURE__ */ new Map();
119
- function Ie(r) {
120
- return Ye.includes(r);
164
+ const te = /* @__PURE__ */ new Map(), re = /* @__PURE__ */ new Map();
165
+ function Be(r) {
166
+ return nt.includes(r);
121
167
  }
122
- function Ke(r) {
168
+ function it(r) {
123
169
  const e = [];
124
170
  if (typeof navigator < "u" && navigator.language) {
125
171
  e.push(navigator.language);
@@ -133,60 +179,60 @@ function Ke(r) {
133
179
  n && n !== t && e.push(n);
134
180
  }
135
181
  for (const n of e)
136
- if (Ie(n)) return n;
182
+ if (Be(n)) return n;
137
183
  return null;
138
184
  }
139
- function Xe(r, e) {
185
+ function ot(r, e) {
140
186
  return !!r.locales && r.locales[e] !== void 0;
141
187
  }
142
- async function Je(r) {
143
- const e = J.get(r);
188
+ async function st(r) {
189
+ const e = te.get(r);
144
190
  if (e) return e;
145
- const t = Q.get(r);
191
+ const t = re.get(r);
146
192
  if (t) return t;
147
- const n = Ze(/* @__PURE__ */ Object.assign({ "./locales/ar.ts": () => import("./chunks/ar-CHae8g-2.js"), "./locales/cs.ts": () => import("./chunks/cs-eZTedzaK.js"), "./locales/da.ts": () => import("./chunks/da-Dca6j8fp.js"), "./locales/de.ts": () => import("./chunks/de-BCjn3PUI.js"), "./locales/el.ts": () => import("./chunks/el-BpXtDTez.js"), "./locales/es.ts": () => import("./chunks/es-B3P4nlMw.js"), "./locales/fi.ts": () => import("./chunks/fi-BbQ_Bs0Z.js"), "./locales/fr.ts": () => import("./chunks/fr-BKDUXceO.js"), "./locales/he.ts": () => import("./chunks/he-BVCHlTtT.js"), "./locales/hi.ts": () => import("./chunks/hi-H_Hshh-7.js"), "./locales/hu.ts": () => import("./chunks/hu-ZWiNfzvN.js"), "./locales/id.ts": () => import("./chunks/id-DeiRYsJ1.js"), "./locales/it.ts": () => import("./chunks/it-UH9OzFhg.js"), "./locales/ja.ts": () => import("./chunks/ja-BYC8FRN8.js"), "./locales/ko.ts": () => import("./chunks/ko-Bjs2ZRcF.js"), "./locales/nl.ts": () => import("./chunks/nl-Ch5HFWQO.js"), "./locales/no.ts": () => import("./chunks/no-CljpinWz.js"), "./locales/pl.ts": () => import("./chunks/pl-CUcSS0zZ.js"), "./locales/pt.ts": () => import("./chunks/pt-BHK0LwkC.js"), "./locales/ro.ts": () => import("./chunks/ro-Bj8cwU2n.js"), "./locales/ru.ts": () => import("./chunks/ru-CgqNy0Gb.js"), "./locales/sv.ts": () => import("./chunks/sv-H7jroOQ5.js"), "./locales/th.ts": () => import("./chunks/th-Dqm-gpGe.js"), "./locales/tr.ts": () => import("./chunks/tr-D3zPcNtT.js"), "./locales/uk.ts": () => import("./chunks/uk-CoIIs3QI.js"), "./locales/vi.ts": () => import("./chunks/vi-C_fruIbh.js"), "./locales/zh.ts": () => import("./chunks/zh-LDkEV2D9.js") }), `./locales/${r}.ts`, 3).then((i) => {
193
+ const n = rt(/* @__PURE__ */ Object.assign({ "./locales/ar.ts": () => import("./chunks/ar-ClwBmll7.js"), "./locales/cs.ts": () => import("./chunks/cs-Cc_D0W4S.js"), "./locales/da.ts": () => import("./chunks/da-BtKcMSxH.js"), "./locales/de.ts": () => import("./chunks/de-iwQW5eYl.js"), "./locales/el.ts": () => import("./chunks/el-BoH65CeJ.js"), "./locales/es.ts": () => import("./chunks/es-CkP16_8K.js"), "./locales/fi.ts": () => import("./chunks/fi-yUXSmK1E.js"), "./locales/fr.ts": () => import("./chunks/fr-DSZRGsxI.js"), "./locales/he.ts": () => import("./chunks/he-ZUo7cQjk.js"), "./locales/hi.ts": () => import("./chunks/hi-CEutBKiG.js"), "./locales/hu.ts": () => import("./chunks/hu-DvEAWGS7.js"), "./locales/id.ts": () => import("./chunks/id-_eEMrYMW.js"), "./locales/it.ts": () => import("./chunks/it-BAmsQbIl.js"), "./locales/ja.ts": () => import("./chunks/ja-BqCZWVKK.js"), "./locales/ko.ts": () => import("./chunks/ko-CkIzeOzb.js"), "./locales/nl.ts": () => import("./chunks/nl-Mu_KNzli.js"), "./locales/no.ts": () => import("./chunks/no-9HMjljBs.js"), "./locales/pl.ts": () => import("./chunks/pl-Cbr2qDwv.js"), "./locales/pt.ts": () => import("./chunks/pt-_jirA6IR.js"), "./locales/ro.ts": () => import("./chunks/ro-oZLxhwHc.js"), "./locales/ru.ts": () => import("./chunks/ru-C2-sqY7B.js"), "./locales/sv.ts": () => import("./chunks/sv-y385MWVy.js"), "./locales/th.ts": () => import("./chunks/th-Bjbv4M1s.js"), "./locales/tr.ts": () => import("./chunks/tr-DmHo9F8i.js"), "./locales/uk.ts": () => import("./chunks/uk-DwvAoTe5.js"), "./locales/vi.ts": () => import("./chunks/vi-BEpwsVLR.js"), "./locales/zh.ts": () => import("./chunks/zh-DrG18oGe.js") }), `./locales/${r}.ts`, 3).then((i) => {
148
194
  const s = i.default ?? {};
149
- return J.set(r, s), s;
195
+ return te.set(r, s), s;
150
196
  }).catch((i) => {
151
197
  console.warn(`[paywall] failed to load locale chunk "${r}"`, i);
152
198
  const s = {};
153
- return J.set(r, s), s;
199
+ return te.set(r, s), s;
154
200
  }).finally(() => {
155
- Q.delete(r);
201
+ re.delete(r);
156
202
  });
157
- return Q.set(r, n), n;
203
+ return re.set(r, n), n;
158
204
  }
159
- function Qe({ bootstrap: r, forceLocale: e, children: t }) {
160
- const [n, i] = x("en"), [s, a] = x(null);
161
- O(() => {
162
- const f = (e && Ie(e) ? e : null) ?? (() => {
205
+ function at({ bootstrap: r, forceLocale: e, children: t }) {
206
+ const [n, i] = k("en"), [s, a] = k(null);
207
+ P(() => {
208
+ const h = (e && Be(e) ? e : null) ?? (() => {
163
209
  if (!r) return null;
164
- const d = Ke(r);
165
- return !d || !Xe(r, d) ? null : d;
210
+ const g = it(r);
211
+ return !g || !ot(r, g) ? null : g;
166
212
  })();
167
- if (!f) {
213
+ if (!h) {
168
214
  (s !== null || n !== "en") && (i("en"), a(null));
169
215
  return;
170
216
  }
171
- if (f === n && s) return;
172
- let h = !1;
173
- return Je(f).then((d) => {
174
- h || (i(f), a(d));
217
+ if (h === n && s) return;
218
+ let d = !1;
219
+ return st(h).then((g) => {
220
+ d || (i(h), a(g));
175
221
  }), () => {
176
- h = !0;
222
+ d = !0;
177
223
  };
178
224
  }, [r, e]);
179
- const c = {
225
+ const l = {
180
226
  locale: n,
181
- t: s ? (l, f, h) => Ce(s[l] ?? f, h) : _e
227
+ t: s ? (c, h, d) => Te(s[c] ?? h, d) : Le
182
228
  };
183
- return /* @__PURE__ */ o(Se.Provider, { value: c, children: t });
229
+ return /* @__PURE__ */ o(Me.Provider, { value: l, children: t });
184
230
  }
185
- function k() {
186
- return Fe(Se);
231
+ function S() {
232
+ return We(Me);
187
233
  }
188
- const de = 'a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';
189
- function et({
234
+ const fe = 'a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';
235
+ function lt({
190
236
  open: r,
191
237
  onClose: e,
192
238
  labelledBy: t,
@@ -194,43 +240,43 @@ function et({
194
240
  topBanner: i,
195
241
  allowClose: s = !0,
196
242
  hideCloseButton: a = !1,
197
- inline: c = !1,
198
- children: l
243
+ inline: l = !1,
244
+ children: c
199
245
  }) {
200
- const { t: f } = k(), h = z(null), d = z(null);
201
- return O(() => {
246
+ const { t: h } = S(), d = U(null), g = U(null);
247
+ return P(() => {
202
248
  if (!r) return;
203
- d.current = document.activeElement ?? null;
204
- const p = h.current;
205
- p && (p.querySelector(de) ?? p).focus({ preventScroll: !0 });
206
- const y = (_) => {
207
- if (_.key === "Escape") {
249
+ g.current = document.activeElement ?? null;
250
+ const m = d.current;
251
+ m && (m.querySelector(fe) ?? m).focus({ preventScroll: !0 });
252
+ const A = (b) => {
253
+ if (b.key === "Escape") {
208
254
  if (!s) return;
209
- _.stopPropagation(), e();
255
+ b.stopPropagation(), e();
210
256
  return;
211
257
  }
212
- if (_.key !== "Tab" || !h.current) return;
213
- const S = Array.from(
214
- h.current.querySelectorAll(de)
215
- ).filter((T) => !T.hasAttribute("disabled") && T.tabIndex !== -1);
216
- if (S.length === 0) {
217
- _.preventDefault();
258
+ if (b.key !== "Tab" || !d.current) return;
259
+ const C = Array.from(
260
+ d.current.querySelectorAll(fe)
261
+ ).filter((R) => !R.hasAttribute("disabled") && R.tabIndex !== -1);
262
+ if (C.length === 0) {
263
+ b.preventDefault();
218
264
  return;
219
265
  }
220
- const P = S[0], M = S[S.length - 1], j = document.activeElement;
221
- _.shiftKey && j === P ? (_.preventDefault(), M.focus()) : !_.shiftKey && j === M && (_.preventDefault(), P.focus());
266
+ const I = C[0], j = C[C.length - 1], M = document.activeElement;
267
+ b.shiftKey && M === I ? (b.preventDefault(), j.focus()) : !b.shiftKey && M === j && (b.preventDefault(), I.focus());
222
268
  };
223
- document.addEventListener("keydown", y, !0);
224
- const U = document.body.style.overflow;
225
- return c || (document.body.style.overflow = "hidden"), () => {
226
- document.removeEventListener("keydown", y, !0), c || (document.body.style.overflow = U), d.current?.focus?.({ preventScroll: !0 });
269
+ document.addEventListener("keydown", A, !0);
270
+ const y = document.body.style.overflow;
271
+ return l || (document.body.style.overflow = "hidden"), () => {
272
+ document.removeEventListener("keydown", A, !0), l || (document.body.style.overflow = y), g.current?.focus?.({ preventScroll: !0 });
227
273
  };
228
- }, [r, e, s, c]), r ? /* @__PURE__ */ u(
274
+ }, [r, e, s, l]), r ? /* @__PURE__ */ u(
229
275
  "div",
230
276
  {
231
- class: `${c ? "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]`,
232
- onClick: (p) => {
233
- s && p.target === p.currentTarget && e();
277
+ 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]`,
278
+ onClick: (m) => {
279
+ s && m.target === m.currentTarget && e();
234
280
  },
235
281
  "data-pw-root": !0,
236
282
  children: [
@@ -244,7 +290,7 @@ function et({
244
290
  /* @__PURE__ */ u(
245
291
  "div",
246
292
  {
247
- ref: h,
293
+ ref: d,
248
294
  role: "dialog",
249
295
  "aria-modal": "true",
250
296
  "aria-labelledby": t,
@@ -254,13 +300,13 @@ function et({
254
300
  boxShadow: "0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1)"
255
301
  },
256
302
  children: [
257
- l,
303
+ c,
258
304
  s && !a ? /* @__PURE__ */ o(
259
305
  "button",
260
306
  {
261
307
  type: "button",
262
308
  onClick: e,
263
- "aria-label": f("modal.close_aria", "Close"),
309
+ "aria-label": h("modal.close_aria", "Close"),
264
310
  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)]",
265
311
  children: /* @__PURE__ */ o("svg", { width: "14", height: "14", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ o(
266
312
  "path",
@@ -290,7 +336,7 @@ function et({
290
336
  }
291
337
  ) : null;
292
338
  }
293
- function tt(r, e) {
339
+ function ct(r, e) {
294
340
  switch (r) {
295
341
  case "google":
296
342
  return e("auth.continue_with_google", "Continue with Google");
@@ -302,9 +348,9 @@ function tt(r, e) {
302
348
  return e("auth.continue_with_facebook", "Continue with Facebook");
303
349
  }
304
350
  }
305
- function he(r, e, t) {
351
+ function ge(r, e, t) {
306
352
  const n = e === "signup" ? t("auth.signup_failed", "Sign-up failed") : t("auth.signin_failed", "Sign-in failed");
307
- if (!(r instanceof B)) return n;
353
+ if (!(r instanceof L)) return n;
308
354
  switch (r.code) {
309
355
  case "invalid_credentials":
310
356
  return t("auth.invalid_credentials", "Invalid email or password");
@@ -323,7 +369,7 @@ function he(r, e, t) {
323
369
  case "over_request_rate_limit":
324
370
  case "rate_limited":
325
371
  case "http_429":
326
- return t("auth.rate_limited", "Too many requests. Please try again in a moment.");
372
+ return t("auth.rate_limited", "Too many requests. Please try again later.");
327
373
  case "network_error":
328
374
  return t("auth.network_error", "Network error. Please check your connection and try again.");
329
375
  case "upstream":
@@ -336,14 +382,14 @@ function he(r, e, t) {
336
382
  return n;
337
383
  }
338
384
  }
339
- function Ae({ block: r, ctx: e }) {
385
+ function Ee({ block: r, ctx: e }) {
340
386
  const t = e.auth, n = e.authSession, i = r.allow_signup !== !1, s = r.allow_password_reset !== !1, a = r.hide_when_authenticated !== !1;
341
387
  if (!t)
342
388
  return typeof console < "u" && console.warn("[paywall] auth_panel rendered without AuthClient — pass `auth: true` to PaywallUI"), null;
343
- const c = n && !n.user.is_anonymous ? n : null;
344
- return c && a ? null : c ? /* @__PURE__ */ o(rt, { email: c.user.email ?? "", onSignOut: () => t.signOut().catch(() => {
389
+ const l = n && !n.user.is_anonymous ? n : null;
390
+ return l && a ? null : l ? /* @__PURE__ */ o(ut, { email: l.user.email ?? "", onSignOut: () => t.signOut().catch(() => {
345
391
  }) }) : /* @__PURE__ */ o(
346
- nt,
392
+ dt,
347
393
  {
348
394
  block: r,
349
395
  allowSignup: i,
@@ -352,8 +398,8 @@ function Ae({ block: r, ctx: e }) {
352
398
  }
353
399
  );
354
400
  }
355
- function rt({ email: r, onSignOut: e }) {
356
- const { t } = k();
401
+ function ut({ email: r, onSignOut: e }) {
402
+ const { t } = S();
357
403
  return /* @__PURE__ */ u("div", { class: "flex items-center justify-between gap-3 rounded-2xl bg-gray-100 px-4 py-3", children: [
358
404
  /* @__PURE__ */ u("div", { class: "flex flex-col", children: [
359
405
  /* @__PURE__ */ o("span", { class: "text-[10px] font-semibold uppercase tracking-wider text-gray-500", children: t("auth.signed_in", "Signed in") }),
@@ -370,177 +416,179 @@ function rt({ email: r, onSignOut: e }) {
370
416
  )
371
417
  ] });
372
418
  }
373
- function nt({ block: r, allowSignup: e, allowReset: t, ctx: n }) {
374
- const { t: i } = k(), s = n.auth, a = r.providers ?? [], c = n.initialAuthMode === "signup" && e ? "signup" : "signin", [l, f] = x(c), [h, d] = x(""), [b, w] = x(""), [v, p] = x(""), [y, U] = x(""), [_, S] = x(null), [P, M] = x(null), [j, T] = x(null), [D, q] = x(!1), [E, L] = x(null);
375
- O(() => {
419
+ function dt({ block: r, allowSignup: e, allowReset: t, ctx: n }) {
420
+ const { t: i } = S(), s = n.auth, a = r.providers ?? [], l = n.initialAuthMode === "signup" && e ? "signup" : "signin", [c, h] = k(l), [d, g] = k(""), [_, p] = k(""), [v, m] = k(""), [A, y] = k(""), [b, C] = k(null), I = U(!1), [j, M] = k(null), [R, q] = k(null), [D, B] = k(!1), [T, z] = k(null);
421
+ P(() => {
376
422
  if (typeof s.getLastLogin != "function") return;
377
- let I = !1;
423
+ let f = !1;
378
424
  return s.getLastLogin().then(
379
- (A) => {
380
- I || !A || (L(A), A.email && d((V) => V === "" ? A.email : V));
425
+ (w) => {
426
+ f || !w || (z(w), w.email && g((E) => E === "" ? w.email : E));
381
427
  },
382
428
  () => {
383
429
  }
384
430
  ), () => {
385
- I = !0;
431
+ f = !0;
386
432
  };
387
433
  }, [s]);
388
- const R = (I) => {
389
- f(I), M(null), T(null), q(!1);
390
- }, N = async (I) => {
391
- if (I.preventDefault(), !_) {
392
- if (M(null), T(null), l === "signup" && !D) {
393
- if (!h.trim()) return;
394
- q(!0);
395
- return;
396
- }
397
- if (l === "signup" && b !== v) {
398
- M(i("auth.passwords_mismatch", "Passwords don't match"));
399
- return;
400
- }
401
- S("email");
434
+ const O = (f) => {
435
+ h(f), M(null), q(null), B(!1);
436
+ }, K = async (f) => {
437
+ if (f.preventDefault(), !(I.current || b)) {
438
+ I.current = !0;
402
439
  try {
403
- l === "signin" ? await s.signInWithEmail({ email: h, password: b }) : l === "signup" ? (await s.signUp({ email: h, password: b })).kind === "confirmation_required" && (w(""), f("signup_verify"), T(i("auth.check_email_message", "Check your email for a confirmation code."))) : l === "forgot" ? (await s.requestPasswordReset({ email: h }), f("reset_sent"), T(
404
- i("auth.reset_sent_message", "If that email exists, a reset code has been sent.")
405
- )) : l === "signup_verify" ? await s.verifyOtp({ email: h, token: y, type: "email" }) : l === "reset_verify" && (await s.verifyOtp({
406
- email: h,
407
- token: y,
408
- type: b ? "recovery" : "email"
409
- }), b && await s.updatePassword({ password: b }));
410
- } catch (A) {
411
- M(he(A, l === "signup" ? "signup" : l === "signup_verify" || l === "reset_verify" ? "otp" : l === "forgot" ? "reset" : "signin", i));
440
+ if (M(null), q(null), c === "signup" && !D) {
441
+ if (!d.trim()) return;
442
+ B(!0);
443
+ return;
444
+ }
445
+ if (c === "signup" && _ !== v) {
446
+ M(i("auth.passwords_mismatch", "Passwords don't match"));
447
+ return;
448
+ }
449
+ C("email");
450
+ try {
451
+ c === "signin" ? await s.signInWithEmail({ email: d, password: _ }) : c === "signup" ? (await s.signUp({ email: d, password: _ })).kind === "confirmation_required" && (p(""), h("signup_sent")) : c === "forgot" ? (await s.requestPasswordReset({ email: d }), h("reset_sent")) : c === "reset_verify" && (await s.verifyOtp({
452
+ email: d,
453
+ token: A,
454
+ type: _ ? "recovery" : "email"
455
+ }), _ && await s.updatePassword({ password: _ }));
456
+ } catch (w) {
457
+ M(ge(w, c === "signup" ? "signup" : c === "reset_verify" ? "otp" : c === "forgot" ? "reset" : "signin", i));
458
+ } finally {
459
+ C(null);
460
+ }
412
461
  } finally {
413
- S(null);
462
+ I.current = !1;
414
463
  }
415
464
  }
416
- }, Y = async (I) => {
417
- if (!_) {
418
- S(I), M(null), T(null);
465
+ }, H = async (f) => {
466
+ if (!(I.current || b)) {
467
+ I.current = !0, C(f), M(null), q(null);
419
468
  try {
420
469
  await s.signInWithOAuth({
421
- provider: I,
422
- onPopupOpened: () => S(null)
470
+ provider: f,
471
+ onPopupOpened: () => C(null)
423
472
  });
424
- } catch (A) {
425
- if (A instanceof B && (A.code === "oauth_cancelled" || A.code === "oauth_timeout"))
473
+ } catch (w) {
474
+ if (w instanceof L && (w.code === "oauth_cancelled" || w.code === "oauth_timeout"))
426
475
  return;
427
- M(he(A, "signin", i));
476
+ M(ge(w, "signin", i));
428
477
  } finally {
429
- S(null);
478
+ I.current = !1, C(null);
430
479
  }
431
480
  }
432
- }, m = a.length > 0 && (l === "signin" || l === "signup"), g = l === "signin" || l === "signup" || l === "forgot", C = l === "signin" || l === "signup" && D;
433
- return /* @__PURE__ */ u("div", { class: "flex flex-col gap-5", children: [
434
- /* @__PURE__ */ o(it, { mode: l, customHeading: r.heading, customSubheading: r.subheading }),
435
- m ? /* @__PURE__ */ u("div", { class: "flex flex-col gap-2.5", children: [
436
- a.map((I) => /* @__PURE__ */ u("div", { class: "relative", children: [
481
+ }, X = a.length > 0 && (c === "signin" || c === "signup"), J = c === "signin" || c === "signup" || c === "forgot", x = c === "signin" || c === "signup" && D;
482
+ return c === "reset_sent" ? /* @__PURE__ */ o(St, { email: d, onBack: () => O("signin"), t: i }) : c === "signup_sent" ? /* @__PURE__ */ o(_t, { email: d, onBack: () => O("signin"), t: i }) : /* @__PURE__ */ u("div", { class: "flex flex-col gap-5", children: [
483
+ /* @__PURE__ */ o(ht, { mode: c, customHeading: r.heading, customSubheading: r.subheading }),
484
+ X ? /* @__PURE__ */ u("div", { class: "flex flex-col gap-2.5", children: [
485
+ a.map((f) => /* @__PURE__ */ u("div", { class: "relative", children: [
437
486
  /* @__PURE__ */ u(
438
487
  "button",
439
488
  {
440
489
  type: "button",
441
- onClick: () => Y(I),
442
- disabled: _ !== null,
490
+ onClick: () => H(f),
491
+ disabled: b !== null,
443
492
  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)]",
444
493
  children: [
445
- _ === I ? /* @__PURE__ */ o("span", { class: "inline-block h-4 w-4 animate-spin rounded-full border-2 border-gray-300 border-t-gray-700" }) : /* @__PURE__ */ o(ft, { provider: I }),
446
- /* @__PURE__ */ o("span", { children: tt(I, i) })
494
+ b === f ? /* @__PURE__ */ o("span", { class: "inline-block h-4 w-4 animate-spin rounded-full border-2 border-gray-300 border-t-gray-700" }) : /* @__PURE__ */ o(vt, { provider: f }),
495
+ /* @__PURE__ */ o("span", { children: ct(f, i) })
447
496
  ]
448
497
  }
449
498
  ),
450
- E?.method === I ? /* @__PURE__ */ o(dt, { email: E.email }) : null
451
- ] }, I)),
452
- /* @__PURE__ */ o(pt, {})
499
+ T?.method === f ? /* @__PURE__ */ o(xt, { email: T.email }) : null
500
+ ] }, f)),
501
+ /* @__PURE__ */ o(kt, {})
453
502
  ] }) : null,
454
- /* @__PURE__ */ u("form", { onSubmit: N, class: "flex flex-col gap-3", children: [
455
- g && /* @__PURE__ */ o(
456
- pe,
503
+ /* @__PURE__ */ u("form", { onSubmit: K, class: "flex flex-col gap-3", children: [
504
+ J && /* @__PURE__ */ o(
505
+ me,
457
506
  {
458
507
  type: "email",
459
508
  placeholder: i("auth.email", "Email address"),
460
- value: h,
461
- onInput: d,
509
+ value: d,
510
+ onInput: g,
462
511
  autocomplete: "email",
463
512
  required: !0
464
513
  }
465
514
  ),
466
- C && /* @__PURE__ */ o(
467
- ee,
515
+ x && /* @__PURE__ */ o(
516
+ ne,
468
517
  {
469
518
  placeholder: i("auth.password", "Password"),
470
- value: b,
471
- onInput: w,
472
- autocomplete: l === "signin" ? "current-password" : "new-password",
519
+ value: _,
520
+ onInput: p,
521
+ autocomplete: c === "signin" ? "current-password" : "new-password",
473
522
  required: !0
474
523
  }
475
524
  ),
476
- l === "signup" && D && /* @__PURE__ */ o(
477
- ee,
525
+ c === "signup" && D && /* @__PURE__ */ o(
526
+ ne,
478
527
  {
479
528
  placeholder: i("auth.repeat_password", "Repeat password"),
480
529
  value: v,
481
- onInput: p,
530
+ onInput: m,
482
531
  autocomplete: "new-password",
483
532
  required: !0
484
533
  }
485
534
  ),
486
- (l === "signup_verify" || l === "reset_verify") && /* @__PURE__ */ o(
487
- pe,
535
+ c === "reset_verify" && /* @__PURE__ */ o(
536
+ me,
488
537
  {
489
538
  type: "text",
490
539
  placeholder: i("auth.confirmation_code", "Confirmation code"),
491
- value: y,
492
- onInput: U,
540
+ value: A,
541
+ onInput: y,
493
542
  autocomplete: "one-time-code",
494
543
  inputMode: "numeric",
495
544
  required: !0
496
545
  }
497
546
  ),
498
- l === "reset_verify" && /* @__PURE__ */ o(
499
- ee,
547
+ c === "reset_verify" && /* @__PURE__ */ o(
548
+ ne,
500
549
  {
501
550
  placeholder: i(
502
551
  "auth.new_password_optional",
503
552
  "New password (optional — only for password reset)"
504
553
  ),
505
- value: b,
506
- onInput: w,
554
+ value: _,
555
+ onInput: p,
507
556
  autocomplete: "new-password"
508
557
  }
509
558
  ),
510
- l === "reset_sent" && j && /* @__PURE__ */ o("p", { class: "rounded-2xl bg-gray-100 px-4 py-3 text-sm text-gray-600", children: j }),
511
- l === "signin" && t && /* @__PURE__ */ o("div", { class: "flex justify-end text-sm", children: /* @__PURE__ */ o(Z, { onClick: () => R("forgot"), children: i("auth.forgot_password", "Forgot password?") }) }),
512
- P && /* @__PURE__ */ o("p", { class: "text-sm text-red-600", children: P }),
513
- j && l !== "reset_sent" && /* @__PURE__ */ o("p", { class: "text-sm text-gray-500", children: j }),
514
- l !== "reset_sent" && /* @__PURE__ */ o(
515
- lt,
559
+ c === "signin" && t && /* @__PURE__ */ o("div", { class: "flex justify-end text-sm", children: /* @__PURE__ */ o(Y, { onClick: () => O("forgot"), children: i("auth.forgot_password", "Forgot password?") }) }),
560
+ j && /* @__PURE__ */ o("p", { class: "text-sm text-red-600", children: j }),
561
+ R && /* @__PURE__ */ o("p", { class: "text-sm text-gray-500", children: R }),
562
+ /* @__PURE__ */ o(
563
+ mt,
516
564
  {
517
- busy: _ === "email",
518
- label: st(l, D, r.submit_label ?? r.heading, i)
565
+ busy: b === "email",
566
+ label: ft(c, D, r.submit_label ?? r.heading, i)
519
567
  }
520
568
  )
521
569
  ] }),
522
570
  /* @__PURE__ */ o(
523
- at,
571
+ gt,
524
572
  {
525
- mode: l,
573
+ mode: c,
526
574
  allowSignup: e,
527
- onSwitch: R
575
+ onSwitch: O
528
576
  }
529
577
  )
530
578
  ] });
531
579
  }
532
- function it({
580
+ function ht({
533
581
  mode: r,
534
582
  customHeading: e,
535
583
  customSubheading: t
536
584
  }) {
537
- const { t: n } = k(), i = ot(r, n), s = r === "signin" || r === "signup", a = s && e ? e : i.title, c = s && t !== void 0 ? t || null : i.subtitle;
585
+ const { t: n } = S(), i = pt(r, n), s = r === "signin" || r === "signup", a = s && e ? e : i.title, l = s && t !== void 0 ? t || null : i.subtitle;
538
586
  return /* @__PURE__ */ u("div", { class: "flex flex-col gap-2", children: [
539
587
  /* @__PURE__ */ o("h2", { class: "text-3xl font-bold tracking-tight text-gray-900", children: a }),
540
- c ? /* @__PURE__ */ o("p", { class: "text-base leading-relaxed text-gray-600", children: c }) : null
588
+ l ? /* @__PURE__ */ o("p", { class: "text-base leading-relaxed text-gray-600", children: l }) : null
541
589
  ] });
542
590
  }
543
- function ot(r, e) {
591
+ function pt(r, e) {
544
592
  switch (r) {
545
593
  case "signin":
546
594
  return {
@@ -561,6 +609,7 @@ function ot(r, e) {
561
609
  )
562
610
  };
563
611
  case "reset_sent":
612
+ case "signup_sent":
564
613
  return {
565
614
  title: e("auth.check_email_title", "Check your email"),
566
615
  subtitle: null
@@ -573,17 +622,9 @@ function ot(r, e) {
573
622
  "Enter the code from your email and a new password."
574
623
  )
575
624
  };
576
- case "signup_verify":
577
- return {
578
- title: e("auth.confirm_email_title", "Confirm your email"),
579
- subtitle: e(
580
- "auth.confirm_email_subtitle",
581
- "Enter the code we sent to your email to finish creating your account."
582
- )
583
- };
584
625
  }
585
626
  }
586
- function st(r, e, t, n) {
627
+ function ft(r, e, t, n) {
587
628
  if (r === "signin" && t) return t;
588
629
  switch (r) {
589
630
  case "signin":
@@ -592,34 +633,33 @@ function st(r, e, t, n) {
592
633
  return e ? n("auth.create_account", "Create Account") : n("auth.sign_up", "Sign Up");
593
634
  case "forgot":
594
635
  return n("auth.send_reset", "Send Reset Email");
595
- case "signup_verify":
596
636
  case "reset_verify":
597
637
  return n("auth.verify", "Verify");
598
638
  default:
599
639
  return n("cta.continue", "Continue");
600
640
  }
601
641
  }
602
- function at({
642
+ function gt({
603
643
  mode: r,
604
644
  allowSignup: e,
605
645
  onSwitch: t
606
646
  }) {
607
- const { t: n } = k();
647
+ const { t: n } = S();
608
648
  return r === "signin" && e ? /* @__PURE__ */ u("p", { class: "text-center text-sm text-gray-600", children: [
609
649
  n("auth.no_account", "Don't have an account?"),
610
650
  " ",
611
- /* @__PURE__ */ o(Z, { onClick: () => t("signup"), children: n("auth.sign_up_link", "Sign Up") })
612
- ] }) : r === "signup" || r === "signup_verify" ? /* @__PURE__ */ u("p", { class: "text-center text-sm text-gray-600", children: [
651
+ /* @__PURE__ */ o(Y, { onClick: () => t("signup"), children: n("auth.sign_up_link", "Sign Up") })
652
+ ] }) : r === "signup" ? /* @__PURE__ */ u("p", { class: "text-center text-sm text-gray-600", children: [
613
653
  n("auth.have_account", "Already have an account?"),
614
654
  " ",
615
- /* @__PURE__ */ o(Z, { onClick: () => t("signin"), children: n("auth.log_in_link", "Log In") })
655
+ /* @__PURE__ */ o(Y, { onClick: () => t("signin"), children: n("auth.log_in_link", "Log In") })
616
656
  ] }) : r === "forgot" || r === "reset_sent" || r === "reset_verify" ? /* @__PURE__ */ u("p", { class: "text-center text-sm text-gray-600", children: [
617
657
  n("auth.no_account", "Don't have an account?"),
618
658
  " ",
619
- /* @__PURE__ */ o(Z, { onClick: () => t("signup"), children: n("auth.sign_up_link", "Sign Up") })
659
+ /* @__PURE__ */ o(Y, { onClick: () => t("signup"), children: n("auth.sign_up_link", "Sign Up") })
620
660
  ] }) : null;
621
661
  }
622
- function Z({
662
+ function Y({
623
663
  onClick: r,
624
664
  children: e
625
665
  }) {
@@ -634,7 +674,7 @@ function Z({
634
674
  }
635
675
  );
636
676
  }
637
- function lt({ busy: r, label: e }) {
677
+ function mt({ busy: r, label: e }) {
638
678
  return /* @__PURE__ */ o(
639
679
  "button",
640
680
  {
@@ -649,14 +689,14 @@ function lt({ busy: r, label: e }) {
649
689
  }
650
690
  );
651
691
  }
652
- function pe({ type: r, placeholder: e, value: t, onInput: n, autocomplete: i, inputMode: s, required: a }) {
692
+ function me({ type: r, placeholder: e, value: t, onInput: n, autocomplete: i, inputMode: s, required: a }) {
653
693
  return /* @__PURE__ */ o(
654
694
  "input",
655
695
  {
656
696
  type: r,
657
697
  value: t,
658
698
  placeholder: e,
659
- onInput: (c) => n(c.target.value),
699
+ onInput: (l) => n(l.target.value),
660
700
  autocomplete: i,
661
701
  inputMode: s,
662
702
  required: a,
@@ -664,22 +704,22 @@ function pe({ type: r, placeholder: e, value: t, onInput: n, autocomplete: i, in
664
704
  }
665
705
  );
666
706
  }
667
- function ee({ placeholder: r, value: e, onInput: t, autocomplete: n, required: i }) {
668
- const { t: s } = k(), [a, c] = x(!1), l = z(null);
669
- O(() => {
670
- const d = l.current;
671
- d && d.value !== e && (d.value = e);
707
+ function ne({ placeholder: r, value: e, onInput: t, autocomplete: n, required: i }) {
708
+ const { t: s } = S(), [a, l] = k(!1), c = U(null);
709
+ P(() => {
710
+ const g = c.current;
711
+ g && g.value !== e && (g.value = e);
672
712
  }, [a, e]);
673
- const f = s("auth.show_password", "Show password"), h = s("auth.hide_password", "Hide password");
713
+ const h = s("auth.show_password", "Show password"), d = s("auth.hide_password", "Hide password");
674
714
  return /* @__PURE__ */ u("div", { class: "relative", children: [
675
715
  /* @__PURE__ */ o(
676
716
  "input",
677
717
  {
678
- ref: l,
718
+ ref: c,
679
719
  type: a ? "text" : "password",
680
720
  value: e,
681
721
  placeholder: r,
682
- onInput: (d) => t(d.target.value),
722
+ onInput: (g) => t(g.target.value),
683
723
  autocomplete: n,
684
724
  required: i,
685
725
  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)]"
@@ -689,16 +729,16 @@ function ee({ placeholder: r, value: e, onInput: t, autocomplete: n, required: i
689
729
  "button",
690
730
  {
691
731
  type: "button",
692
- onClick: () => c((d) => !d),
693
- "aria-label": a ? h : f,
732
+ onClick: () => l((g) => !g),
733
+ "aria-label": a ? d : h,
694
734
  tabIndex: -1,
695
735
  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)]",
696
- children: a ? /* @__PURE__ */ o(ut, {}) : /* @__PURE__ */ o(ct, {})
736
+ children: a ? /* @__PURE__ */ o(yt, {}) : /* @__PURE__ */ o(bt, {})
697
737
  }
698
738
  )
699
739
  ] });
700
740
  }
701
- function ct() {
741
+ function bt() {
702
742
  return /* @__PURE__ */ u("svg", { width: "18", height: "18", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
703
743
  /* @__PURE__ */ o(
704
744
  "path",
@@ -713,7 +753,7 @@ function ct() {
713
753
  /* @__PURE__ */ o("circle", { cx: "10", cy: "10", r: "2.5", stroke: "currentColor", "stroke-width": "1.5" })
714
754
  ] });
715
755
  }
716
- function ut() {
756
+ function yt() {
717
757
  return /* @__PURE__ */ u("svg", { width: "18", height: "18", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
718
758
  /* @__PURE__ */ o(
719
759
  "path",
@@ -737,23 +777,23 @@ function ut() {
737
777
  )
738
778
  ] });
739
779
  }
740
- function dt({ email: r }) {
741
- const { t: e } = k(), t = r ? e("auth.last_used", "Last · {email}", { email: ht(r) }) : e("auth.last_used_no_email", "Last");
780
+ function xt({ email: r }) {
781
+ const { t: e } = S(), t = r ? e("auth.last_used", "Last · {email}", { email: wt(r) }) : e("auth.last_used_no_email", "Last");
742
782
  return /* @__PURE__ */ o("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: t });
743
783
  }
744
- function ht(r) {
784
+ function wt(r) {
745
785
  const [e, t] = r.split("@");
746
786
  return t ? `${e.slice(0, 3)}*****@${t}` : r;
747
787
  }
748
- function pt() {
749
- const { t: r } = k();
788
+ function kt() {
789
+ const { t: r } = S();
750
790
  return /* @__PURE__ */ u("div", { class: "flex items-center gap-3 py-1 text-sm text-gray-400", children: [
751
791
  /* @__PURE__ */ o("div", { class: "h-px flex-1 bg-gray-200" }),
752
792
  /* @__PURE__ */ o("span", { children: r("auth.or", "or") }),
753
793
  /* @__PURE__ */ o("div", { class: "h-px flex-1 bg-gray-200" })
754
794
  ] });
755
795
  }
756
- function ft({ provider: r }) {
796
+ function vt({ provider: r }) {
757
797
  return r === "google" ? /* @__PURE__ */ u("svg", { width: "20", height: "20", viewBox: "0 0 18 18", "aria-hidden": "true", children: [
758
798
  /* @__PURE__ */ o("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" }),
759
799
  /* @__PURE__ */ o("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" }),
@@ -766,7 +806,106 @@ function ft({ provider: r }) {
766
806
  /* @__PURE__ */ o("svg", { width: "26", height: "26", viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ o("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" }) })
767
807
  ) : r === "github" ? /* @__PURE__ */ o("svg", { width: "20", height: "20", viewBox: "0 0 16 16", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ o("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__ */ o("svg", { width: "18", height: "20", viewBox: "0 0 14 16", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ o("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" }) });
768
808
  }
769
- function gt({
809
+ function _t({
810
+ email: r,
811
+ onBack: e,
812
+ t
813
+ }) {
814
+ return /* @__PURE__ */ u("div", { class: "flex flex-col items-center gap-4 py-2 text-center", children: [
815
+ /* @__PURE__ */ o(
816
+ "div",
817
+ {
818
+ class: "flex h-14 w-14 items-center justify-center rounded-full",
819
+ style: {
820
+ background: "linear-gradient(135deg, #4ade80, #16a34a)",
821
+ color: "#fff",
822
+ boxShadow: "0 0 0 8px rgba(74,222,128,0.12), 0 8px 20px -6px rgba(22,163,74,0.45)"
823
+ },
824
+ "aria-hidden": "true",
825
+ children: /* @__PURE__ */ o("svg", { width: "28", height: "28", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ o(
826
+ "path",
827
+ {
828
+ d: "M5 13l4 4L19 7",
829
+ stroke: "currentColor",
830
+ "stroke-width": "2.5",
831
+ "stroke-linecap": "round",
832
+ "stroke-linejoin": "round"
833
+ }
834
+ ) })
835
+ }
836
+ ),
837
+ /* @__PURE__ */ o("h2", { class: "mt-1 text-3xl font-bold tracking-tight text-gray-900", children: t("auth.check_email_title", "Check your email") }),
838
+ /* @__PURE__ */ o("p", { class: "text-base leading-relaxed text-gray-600", children: t(
839
+ "auth.signup_sent_subtitle",
840
+ "We sent a confirmation link to your email. Click it to activate your account, then sign in."
841
+ ) }),
842
+ r ? /* @__PURE__ */ o("p", { class: "break-all text-base font-semibold text-gray-900", children: r }) : null,
843
+ /* @__PURE__ */ o(
844
+ "button",
845
+ {
846
+ type: "button",
847
+ onClick: e,
848
+ class: "pw-cta-shimmer relative mt-2 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] focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",
849
+ style: {
850
+ 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%)",
851
+ 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)"
852
+ },
853
+ children: /* @__PURE__ */ o("span", { class: "relative z-10", children: t("auth.back_to_login", "Back to Login") })
854
+ }
855
+ )
856
+ ] });
857
+ }
858
+ function St({
859
+ email: r,
860
+ onBack: e,
861
+ t
862
+ }) {
863
+ return /* @__PURE__ */ u("div", { class: "flex flex-col items-center gap-4 py-2 text-center", children: [
864
+ /* @__PURE__ */ o(
865
+ "div",
866
+ {
867
+ class: "flex h-14 w-14 items-center justify-center rounded-full",
868
+ style: {
869
+ background: "linear-gradient(135deg, #4ade80, #16a34a)",
870
+ color: "#fff",
871
+ boxShadow: "0 0 0 8px rgba(74,222,128,0.12), 0 8px 20px -6px rgba(22,163,74,0.45)"
872
+ },
873
+ "aria-hidden": "true",
874
+ children: /* @__PURE__ */ o("svg", { width: "28", height: "28", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ o(
875
+ "path",
876
+ {
877
+ d: "M5 13l4 4L19 7",
878
+ stroke: "currentColor",
879
+ "stroke-width": "2.5",
880
+ "stroke-linecap": "round",
881
+ "stroke-linejoin": "round"
882
+ }
883
+ ) })
884
+ }
885
+ ),
886
+ /* @__PURE__ */ o("h2", { class: "mt-1 text-3xl font-bold tracking-tight text-gray-900", children: t("auth.check_email_title", "Check your email") }),
887
+ /* @__PURE__ */ o("p", { class: "text-base leading-relaxed text-gray-600", children: t(
888
+ "auth.reset_sent_subtitle",
889
+ "We sent a password reset link. Follow the instructions in the email to reset your password."
890
+ ) }),
891
+ r ? /* @__PURE__ */ o("p", { class: "break-all text-base font-semibold text-gray-900", children: r }) : null,
892
+ /* @__PURE__ */ o("p", { class: "text-sm text-gray-500", children: t("auth.reset_link_valid", "The link is valid for 1 hour.") }),
893
+ /* @__PURE__ */ o(
894
+ "button",
895
+ {
896
+ type: "button",
897
+ onClick: e,
898
+ class: "pw-cta-shimmer relative mt-2 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] focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",
899
+ style: {
900
+ 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%)",
901
+ 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)"
902
+ },
903
+ children: /* @__PURE__ */ o("span", { class: "relative z-10", children: t("auth.back_to_login", "Back to Login") })
904
+ }
905
+ )
906
+ ] });
907
+ }
908
+ function Ct({
770
909
  block: r,
771
910
  bootstrap: e,
772
911
  auth: t,
@@ -774,9 +913,9 @@ function gt({
774
913
  onBack: i,
775
914
  showBack: s = !0,
776
915
  intent: a = "preauth",
777
- initialMode: c
916
+ initialMode: l
778
917
  }) {
779
- const { t: l } = k(), f = {
918
+ const { t: c } = S(), h = {
780
919
  bootstrap: e,
781
920
  selectedPriceId: null,
782
921
  setSelectedPriceId: () => {
@@ -785,18 +924,18 @@ function gt({
785
924
  },
786
925
  auth: t,
787
926
  authSession: n,
788
- initialAuthMode: c
789
- }, h = a === "restore" ? {
927
+ initialAuthMode: l
928
+ }, d = a === "restore" ? {
790
929
  ...r,
791
- heading: l("auth.restore_purchases_heading", "Restore Purchases"),
792
- subheading: l(
930
+ heading: c("auth.restore_purchases_heading", "Restore Purchases"),
931
+ subheading: c(
793
932
  "auth.restore_purchases_subheading",
794
933
  "Please sign in to restore your purchases."
795
934
  )
796
935
  } : a === "preauth" ? {
797
936
  ...r,
798
- heading: l("auth.login_continue_purchase", "Log in to continue your purchase"),
799
- subheading: l(
937
+ heading: c("auth.login_continue_purchase", "Log in to continue your purchase"),
938
+ subheading: c(
800
939
  "auth.link_purchase_subheading",
801
940
  "We'll link the purchase to your account to keep access."
802
941
  ),
@@ -804,14 +943,14 @@ function gt({
804
943
  // purchase"), а не action verb. Длинные локализации (RU: "Войдите,
805
944
  // чтобы продолжить покупку") в pill-кнопку h-12 не помещаются и
806
945
  // переносятся на 2 строки. Явный короткий submit_label решает.
807
- submit_label: l("auth.log_in", "Sign In")
946
+ submit_label: c("auth.log_in", "Sign In")
808
947
  } : r;
809
948
  return /* @__PURE__ */ u("div", { class: "relative flex-1 min-h-0 overflow-y-auto p-6 sm:p-8", children: [
810
- s ? /* @__PURE__ */ o(mt, { onClick: i, ariaLabel: l("nav.back_aria", "Back") }) : null,
811
- /* @__PURE__ */ o(Ae, { block: h, ctx: f })
949
+ s ? /* @__PURE__ */ o(It, { onClick: i, ariaLabel: c("nav.back_aria", "Back") }) : null,
950
+ /* @__PURE__ */ o(Ee, { block: d, ctx: h })
812
951
  ] });
813
952
  }
814
- function mt({ onClick: r, ariaLabel: e }) {
953
+ function It({ onClick: r, ariaLabel: e }) {
815
954
  return /* @__PURE__ */ o(
816
955
  "button",
817
956
  {
@@ -844,8 +983,8 @@ function mt({ onClick: r, ariaLabel: e }) {
844
983
  }
845
984
  );
846
985
  }
847
- const Le = (r) => `pw-offer-${r}-start`;
848
- function te(r) {
986
+ const At = (r) => `pw-offer-${r}-start`;
987
+ function ie(r) {
849
988
  const e = r - Date.now();
850
989
  return e <= 0 ? { days: 0, hours: 0, minutes: 0, seconds: 0, expired: !0 } : {
851
990
  days: Math.floor(e / (1e3 * 60 * 60 * 24)),
@@ -855,7 +994,7 @@ function te(r) {
855
994
  expired: !1
856
995
  };
857
996
  }
858
- function yt(r) {
997
+ function Lt(r) {
859
998
  if (r.expires_at) {
860
999
  const e = Date.parse(r.expires_at);
861
1000
  return Number.isFinite(e) ? e : null;
@@ -863,7 +1002,7 @@ function yt(r) {
863
1002
  if (r.duration_minutes && r.duration_minutes > 0) {
864
1003
  if (typeof window > "u") return null;
865
1004
  try {
866
- const e = Le(r.id);
1005
+ const e = At(r.id);
867
1006
  let t = window.localStorage.getItem(e);
868
1007
  return t || (t = (/* @__PURE__ */ new Date()).toISOString(), window.localStorage.setItem(e, t)), Date.parse(t) + r.duration_minutes * 6e4;
869
1008
  } catch {
@@ -872,7 +1011,7 @@ function yt(r) {
872
1011
  }
873
1012
  return null;
874
1013
  }
875
- function Me(r, e) {
1014
+ function Pe(r, e) {
876
1015
  if (!r || r.length === 0) return null;
877
1016
  if (e) {
878
1017
  const t = r.find((n) => n.id === e);
@@ -880,29 +1019,25 @@ function Me(r, e) {
880
1019
  }
881
1020
  return r.find((t) => t.expires_at || t.duration_minutes) ?? null;
882
1021
  }
883
- function Ee(r) {
884
- const e = r ? yt(r) : null, [t, n] = x(
885
- () => e !== null ? te(e) : null
886
- ), i = z(e);
887
- return i.current = e, O(() => {
1022
+ function Oe(r) {
1023
+ const e = r ? Lt(r) : null, [t, n] = k(
1024
+ () => e !== null ? ie(e) : null
1025
+ ), i = U(e);
1026
+ return i.current = e, P(() => {
888
1027
  if (e === null) {
889
1028
  n(null);
890
1029
  return;
891
1030
  }
892
- n(te(e));
1031
+ n(ie(e));
893
1032
  const s = setInterval(() => {
894
- const a = te(i.current ?? 0);
895
- if (n(a), a.expired && (clearInterval(s), r?.duration_minutes && typeof window < "u"))
896
- try {
897
- window.localStorage.removeItem(Le(r.id));
898
- } catch {
899
- }
1033
+ const a = ie(i.current ?? 0);
1034
+ n(a), a.expired && clearInterval(s);
900
1035
  }, 1e3);
901
1036
  return () => clearInterval(s);
902
1037
  }, [e, r?.duration_minutes, r?.id]), t;
903
1038
  }
904
- function xt({ block: r, ctx: e }) {
905
- const { t } = k(), n = Me(e.bootstrap.offers, r.offer_id), i = Ee(n);
1039
+ function Mt({ block: r, ctx: e }) {
1040
+ const { t } = S(), n = Pe(e.bootstrap.offers, r.offer_id), i = Oe(n);
906
1041
  if (!n || i === null || i.expired && !r.force) return null;
907
1042
  const s = r.title ?? n.label ?? t("offer.limited_time", "Limited-time offer"), a = n.discount_percent ? `${s} ${n.discount_percent}%` : s;
908
1043
  return /* @__PURE__ */ u(
@@ -915,32 +1050,32 @@ function xt({ block: r, ctx: e }) {
915
1050
  },
916
1051
  role: "status",
917
1052
  children: [
918
- /* @__PURE__ */ o(Te, {}),
1053
+ /* @__PURE__ */ o(Ue, {}),
919
1054
  /* @__PURE__ */ o("span", { children: a }),
920
- /* @__PURE__ */ o(Pe, { value: i, t })
1055
+ /* @__PURE__ */ o(je, { value: i, t })
921
1056
  ]
922
1057
  }
923
1058
  );
924
1059
  }
925
- function Pe({ value: r, t: e }) {
1060
+ function je({ value: r, t: e }) {
926
1061
  return /* @__PURE__ */ u("div", { class: "flex items-center gap-1 font-mono text-sm", children: [
927
- r.days > 0 ? /* @__PURE__ */ u(oe, { children: [
928
- /* @__PURE__ */ o($, { children: String(r.days) }),
1062
+ r.days > 0 ? /* @__PURE__ */ u(le, { children: [
1063
+ /* @__PURE__ */ o(G, { children: String(r.days) }),
929
1064
  /* @__PURE__ */ o("span", { class: "text-xs", children: e("countdown.d", "d") })
930
1065
  ] }) : null,
931
- /* @__PURE__ */ o($, { children: String(r.hours).padStart(2, "0") }),
1066
+ /* @__PURE__ */ o(G, { children: String(r.hours).padStart(2, "0") }),
932
1067
  /* @__PURE__ */ o("span", { class: "text-xs", children: e("countdown.h", "h") }),
933
- /* @__PURE__ */ o($, { children: String(r.minutes).padStart(2, "0") }),
1068
+ /* @__PURE__ */ o(G, { children: String(r.minutes).padStart(2, "0") }),
934
1069
  /* @__PURE__ */ o("span", { class: "text-xs", children: e("countdown.m", "m") }),
935
- /* @__PURE__ */ o($, { children: String(r.seconds).padStart(2, "0") }),
1070
+ /* @__PURE__ */ o(G, { children: String(r.seconds).padStart(2, "0") }),
936
1071
  /* @__PURE__ */ o("span", { class: "text-xs", children: e("countdown.s", "s") })
937
1072
  ] });
938
1073
  }
939
- function $({ children: r }) {
1074
+ function G({ children: r }) {
940
1075
  return /* @__PURE__ */ o("span", { class: "rounded bg-black/20 px-1.5 py-0.5 text-xs font-bold", children: r });
941
1076
  }
942
- function bt({ offer: r }) {
943
- const { t: e } = k(), t = Ee(r);
1077
+ function Tt({ offer: r }) {
1078
+ const { t: e } = S(), t = Oe(r);
944
1079
  if (t === null || t.expired) return null;
945
1080
  const n = r.label ?? e("offer.limited_time", "Limited-time offer"), i = r.discount_percent ? `${n} ${r.discount_percent}%` : n;
946
1081
  return /* @__PURE__ */ u(
@@ -953,14 +1088,14 @@ function bt({ offer: r }) {
953
1088
  },
954
1089
  role: "status",
955
1090
  children: [
956
- /* @__PURE__ */ o(Te, {}),
1091
+ /* @__PURE__ */ o(Ue, {}),
957
1092
  /* @__PURE__ */ o("span", { children: i }),
958
- /* @__PURE__ */ o(Pe, { value: t, t: e })
1093
+ /* @__PURE__ */ o(je, { value: t, t: e })
959
1094
  ]
960
1095
  }
961
1096
  );
962
1097
  }
963
- function Te() {
1098
+ function Ue() {
964
1099
  return /* @__PURE__ */ o(
965
1100
  "svg",
966
1101
  {
@@ -979,39 +1114,39 @@ function Te() {
979
1114
  }
980
1115
  );
981
1116
  }
982
- const fe = 3, ge = 200, me = 5e3, re = 5, wt = 10 * 1024 * 1024, ye = ["image/jpeg", "image/png", "image/webp"], kt = /.+@.+\..+/;
983
- function vt({ client: r, authSession: e, origin: t, onBack: n }) {
984
- const { t: i } = k(), s = e?.user.email ?? "", a = s || null, [c, l] = x(s), [f, h] = x(""), [d, b] = x(""), [w, v] = x([]), [p, y] = x(!1), [U, _] = x(null), [S, P] = x({}), M = () => {
985
- const E = {}, L = (a ?? c).trim(), R = f.trim(), N = d.trim();
986
- return L ? kt.test(L.toLowerCase()) || (E.email = i("support.invalid_email", "Invalid email")) : E.email = i("support.required", "Required"), (R.length < fe || R.length > ge) && (E.subject = i("support.subject_length", "{min}–{max} characters", {
987
- min: fe,
988
- max: ge
989
- })), (N.length < 1 || N.length > me) && (E.message = i("support.message_length", "{min}–{max} characters", {
1117
+ const be = 3, ye = 200, xe = 5e3, oe = 5, Bt = 10 * 1024 * 1024, we = ["image/jpeg", "image/png", "image/webp"], Et = /.+@.+\..+/;
1118
+ function Pt({ client: r, authSession: e, origin: t, onBack: n }) {
1119
+ const { t: i } = S(), s = e?.user.email ?? "", a = s || null, [l, c] = k(s), [h, d] = k(""), [g, _] = k(""), [p, v] = k([]), [m, A] = k(!1), [y, b] = k(null), [C, I] = k({}), j = () => {
1120
+ const B = {}, T = (a ?? l).trim(), z = h.trim(), O = g.trim();
1121
+ return T ? Et.test(T.toLowerCase()) || (B.email = i("support.invalid_email", "Invalid email")) : B.email = i("support.required", "Required"), (z.length < be || z.length > ye) && (B.subject = i("support.subject_length", "{min}–{max} characters", {
1122
+ min: be,
1123
+ max: ye
1124
+ })), (O.length < 1 || O.length > xe) && (B.message = i("support.message_length", "{min}–{max} characters", {
990
1125
  min: 1,
991
- max: me
992
- })), P(E), Object.keys(E).length === 0;
993
- }, j = async (E) => {
994
- if (E.preventDefault(), !p && M()) {
995
- y(!0), P((L) => ({ ...L, submit: void 0 }));
1126
+ max: xe
1127
+ })), I(B), Object.keys(B).length === 0;
1128
+ }, M = async (B) => {
1129
+ if (B.preventDefault(), !m && j()) {
1130
+ A(!0), I((T) => ({ ...T, submit: void 0 }));
996
1131
  try {
997
- const L = (a ?? c).trim();
1132
+ const T = (a ?? l).trim();
998
1133
  await r.createSupportTicket({
999
- subject: f.trim(),
1000
- content: d.trim(),
1001
- email: L || void 0,
1002
- files: w.length > 0 ? w : void 0
1003
- }), _(L);
1004
- } catch (L) {
1005
- const R = L instanceof B && L.message || "Failed to send. Please try again.";
1006
- P((N) => ({ ...N, submit: R }));
1134
+ subject: h.trim(),
1135
+ content: g.trim(),
1136
+ email: T || void 0,
1137
+ files: p.length > 0 ? p : void 0
1138
+ }), b(T);
1139
+ } catch (T) {
1140
+ const z = T instanceof L && T.message || "Failed to send. Please try again.";
1141
+ I((O) => ({ ...O, submit: z }));
1007
1142
  } finally {
1008
- y(!1);
1143
+ A(!1);
1009
1144
  }
1010
1145
  }
1011
- }, T = () => {
1012
- h(""), b(""), v([]), P({}), _(null);
1013
- }, D = "flex flex-col gap-3 bg-white px-6 pb-6 pt-3 sm:px-8", q = { boxShadow: "0 -4px 12px -4px rgba(15,23,42,0.06)" };
1014
- return U ? /* @__PURE__ */ u("div", { class: "relative flex-1 min-h-0 flex flex-col", children: [
1146
+ }, R = () => {
1147
+ d(""), _(""), v([]), I({}), b(null);
1148
+ }, q = "flex flex-col gap-3 bg-white px-6 pb-6 pt-3 sm:px-8", D = { boxShadow: "0 -4px 12px -4px rgba(15,23,42,0.06)" };
1149
+ return y ? /* @__PURE__ */ u("div", { class: "relative flex-1 min-h-0 flex flex-col", children: [
1015
1150
  /* @__PURE__ */ u("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: [
1016
1151
  /* @__PURE__ */ o(
1017
1152
  "div",
@@ -1039,11 +1174,11 @@ function vt({ client: r, authSession: e, origin: t, onBack: n }) {
1039
1174
  "We've received your message and will respond to"
1040
1175
  ),
1041
1176
  " ",
1042
- /* @__PURE__ */ o("b", { class: "text-gray-700", children: U }),
1177
+ /* @__PURE__ */ o("b", { class: "text-gray-700", children: y }),
1043
1178
  "."
1044
1179
  ] })
1045
1180
  ] }),
1046
- /* @__PURE__ */ o("div", { class: D, style: q, children: /* @__PURE__ */ u("div", { class: "flex items-center justify-center gap-3", children: [
1181
+ /* @__PURE__ */ o("div", { class: q, style: D, children: /* @__PURE__ */ u("div", { class: "flex items-center justify-center gap-3", children: [
1047
1182
  /* @__PURE__ */ o(
1048
1183
  "button",
1049
1184
  {
@@ -1057,7 +1192,7 @@ function vt({ client: r, authSession: e, origin: t, onBack: n }) {
1057
1192
  "button",
1058
1193
  {
1059
1194
  type: "button",
1060
- onClick: T,
1195
+ onClick: R,
1061
1196
  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)]",
1062
1197
  style: {
1063
1198
  background: "linear-gradient(180deg, color-mix(in srgb, var(--pw-accent) 92%, white), var(--pw-accent))",
@@ -1067,8 +1202,8 @@ function vt({ client: r, authSession: e, origin: t, onBack: n }) {
1067
1202
  }
1068
1203
  )
1069
1204
  ] }) })
1070
- ] }) : /* @__PURE__ */ u("form", { onSubmit: j, class: "relative flex-1 min-h-0 flex flex-col", children: [
1071
- /* @__PURE__ */ o(_t, { onClick: n, ariaLabel: i("nav.back_aria", "Back") }),
1205
+ ] }) : /* @__PURE__ */ u("form", { onSubmit: M, class: "relative flex-1 min-h-0 flex flex-col", children: [
1206
+ /* @__PURE__ */ o(Ot, { onClick: n, ariaLabel: i("nav.back_aria", "Back") }),
1072
1207
  /* @__PURE__ */ o("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__ */ u("div", { class: "flex flex-col gap-5", children: [
1073
1208
  /* @__PURE__ */ u("div", { class: "flex flex-col gap-2 pr-10", children: [
1074
1209
  /* @__PURE__ */ o("h2", { class: "text-3xl font-bold tracking-tight text-gray-900", children: i("support.heading", "Support") }),
@@ -1080,50 +1215,50 @@ function vt({ client: r, authSession: e, origin: t, onBack: n }) {
1080
1215
  " ",
1081
1216
  /* @__PURE__ */ o("b", { class: "font-medium text-gray-900", children: a })
1082
1217
  ] }) : /* @__PURE__ */ o(
1083
- xe,
1218
+ ke,
1084
1219
  {
1085
1220
  type: "email",
1086
1221
  placeholder: i("support.email_placeholder", "Enter your email *"),
1087
- value: c,
1088
- onInput: l,
1089
- error: S.email,
1222
+ value: l,
1223
+ onInput: c,
1224
+ error: C.email,
1090
1225
  autocomplete: "email",
1091
1226
  required: !0
1092
1227
  }
1093
1228
  ),
1094
1229
  /* @__PURE__ */ o(
1095
- xe,
1230
+ ke,
1096
1231
  {
1097
1232
  type: "text",
1098
1233
  placeholder: i("support.subject_placeholder", "Enter your subject *"),
1099
- value: f,
1100
- onInput: h,
1101
- error: S.subject,
1234
+ value: h,
1235
+ onInput: d,
1236
+ error: C.subject,
1102
1237
  required: !0
1103
1238
  }
1104
1239
  ),
1105
1240
  /* @__PURE__ */ o(
1106
- St,
1241
+ jt,
1107
1242
  {
1108
1243
  placeholder: i("support.message_placeholder", "Enter your message *"),
1109
- value: d,
1110
- onInput: b,
1111
- error: S.message,
1244
+ value: g,
1245
+ onInput: _,
1246
+ error: C.message,
1112
1247
  required: !0
1113
1248
  }
1114
1249
  ),
1115
- /* @__PURE__ */ o(Ct, { files: w, onChange: v, disabled: p })
1250
+ /* @__PURE__ */ o(Ut, { files: p, onChange: v, disabled: m })
1116
1251
  ] })
1117
1252
  ] }) }),
1118
- /* @__PURE__ */ u("div", { class: D, style: q, children: [
1119
- S.submit && /* @__PURE__ */ o("p", { class: "text-sm text-red-600", children: S.submit }),
1253
+ /* @__PURE__ */ u("div", { class: q, style: D, children: [
1254
+ C.submit && /* @__PURE__ */ o("p", { class: "text-sm text-red-600", children: C.submit }),
1120
1255
  /* @__PURE__ */ u("div", { class: "flex items-center justify-end gap-3", children: [
1121
1256
  /* @__PURE__ */ o(
1122
1257
  "button",
1123
1258
  {
1124
1259
  type: "button",
1125
1260
  onClick: n,
1126
- disabled: p,
1261
+ disabled: m,
1127
1262
  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)]",
1128
1263
  children: t === "standalone" ? i("support.close_button", "Close") : i("nav.back_aria", "Back")
1129
1264
  }
@@ -1132,20 +1267,20 @@ function vt({ client: r, authSession: e, origin: t, onBack: n }) {
1132
1267
  "button",
1133
1268
  {
1134
1269
  type: "submit",
1135
- disabled: p,
1270
+ disabled: m,
1136
1271
  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)]",
1137
1272
  style: {
1138
1273
  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%)",
1139
1274
  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)"
1140
1275
  },
1141
- children: p ? /* @__PURE__ */ o("span", { class: "relative z-10 inline-block h-4 w-4 animate-spin rounded-full border-2 border-white/40 border-t-white" }) : /* @__PURE__ */ o("span", { class: "relative z-10", children: i("support.send_button", "Send") })
1276
+ children: m ? /* @__PURE__ */ o("span", { class: "relative z-10 inline-block h-4 w-4 animate-spin rounded-full border-2 border-white/40 border-t-white" }) : /* @__PURE__ */ o("span", { class: "relative z-10", children: i("support.send_button", "Send") })
1142
1277
  }
1143
1278
  )
1144
1279
  ] })
1145
1280
  ] })
1146
1281
  ] });
1147
1282
  }
1148
- function _t({ onClick: r, ariaLabel: e }) {
1283
+ function Ot({ onClick: r, ariaLabel: e }) {
1149
1284
  return /* @__PURE__ */ o(
1150
1285
  "button",
1151
1286
  {
@@ -1178,7 +1313,7 @@ function _t({ onClick: r, ariaLabel: e }) {
1178
1313
  }
1179
1314
  );
1180
1315
  }
1181
- function xe({
1316
+ function ke({
1182
1317
  type: r,
1183
1318
  placeholder: e,
1184
1319
  value: t,
@@ -1194,7 +1329,7 @@ function xe({
1194
1329
  type: r,
1195
1330
  value: t,
1196
1331
  placeholder: e,
1197
- onInput: (c) => n(c.target.value),
1332
+ onInput: (l) => n(l.target.value),
1198
1333
  autocomplete: s,
1199
1334
  required: a,
1200
1335
  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 ${i ? "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)]"}`
@@ -1203,7 +1338,7 @@ function xe({
1203
1338
  i && /* @__PURE__ */ o("span", { class: "mt-1 ml-2 block text-sm text-red-600", children: i })
1204
1339
  ] });
1205
1340
  }
1206
- function St({
1341
+ function jt({
1207
1342
  placeholder: r,
1208
1343
  value: e,
1209
1344
  onInput: t,
@@ -1225,23 +1360,23 @@ function St({
1225
1360
  n && /* @__PURE__ */ o("span", { class: "mt-1 ml-2 block text-sm text-red-600", children: n })
1226
1361
  ] });
1227
1362
  }
1228
- function Ct({ files: r, onChange: e, disabled: t }) {
1229
- const { t: n } = k(), i = z(null), [s, a] = x(!1), [c, l] = x(null), f = (h) => {
1230
- if (!h || t) return;
1231
- l(null);
1232
- const d = Array.from(h);
1233
- if (r.length + d.length > re) {
1234
- l(n("support.too_many_files", "Up to {max} files", { max: re }));
1363
+ function Ut({ files: r, onChange: e, disabled: t }) {
1364
+ const { t: n } = S(), i = U(null), [s, a] = k(!1), [l, c] = k(null), h = (d) => {
1365
+ if (!d || t) return;
1366
+ c(null);
1367
+ const g = Array.from(d);
1368
+ if (r.length + g.length > oe) {
1369
+ c(n("support.too_many_files", "Up to {max} files", { max: oe }));
1235
1370
  return;
1236
1371
  }
1237
- const b = d.filter(
1238
- (w) => ye.includes(w.type) && w.size <= wt
1372
+ const _ = g.filter(
1373
+ (p) => we.includes(p.type) && p.size <= Bt
1239
1374
  );
1240
- if (b.length !== d.length) {
1241
- l(n("support.invalid_file", "Only JPEG/PNG/WebP, ≤ 10MB each"));
1375
+ if (_.length !== g.length) {
1376
+ c(n("support.invalid_file", "Only JPEG/PNG/WebP, ≤ 10MB each"));
1242
1377
  return;
1243
1378
  }
1244
- e([...r, ...b]);
1379
+ e([...r, ..._]);
1245
1380
  };
1246
1381
  return /* @__PURE__ */ u("div", { children: [
1247
1382
  /* @__PURE__ */ o("span", { class: "text-xs font-medium text-gray-700", children: n("support.attachments_label", "Attachments (optional)") }),
@@ -1252,18 +1387,18 @@ function Ct({ files: r, onChange: e, disabled: t }) {
1252
1387
  tabIndex: 0,
1253
1388
  "aria-label": n("support.attachments_aria", "Attachments upload"),
1254
1389
  onClick: () => !t && i.current?.click(),
1255
- onDragOver: (h) => {
1256
- h.preventDefault(), t || a(!0);
1390
+ onDragOver: (d) => {
1391
+ d.preventDefault(), t || a(!0);
1257
1392
  },
1258
1393
  onDragLeave: () => a(!1),
1259
- onDrop: (h) => {
1260
- h.preventDefault(), a(!1), f(h.dataTransfer?.files ?? null);
1394
+ onDrop: (d) => {
1395
+ d.preventDefault(), a(!1), h(d.dataTransfer?.files ?? null);
1261
1396
  },
1262
1397
  class: `mt-1.5 cursor-pointer rounded-2xl border border-dashed p-3.5 text-center transition-all ${s ? "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"} ${t ? "cursor-not-allowed opacity-60" : ""}`,
1263
1398
  children: [
1264
1399
  /* @__PURE__ */ o("div", { class: "text-xs text-gray-500", children: n("support.dropzone_text", "Drop images here or click to select") }),
1265
1400
  /* @__PURE__ */ o("div", { class: "mt-0.5 text-[11px] text-gray-400", children: n("support.file_requirements", "JPEG/PNG/WebP, up to {max} files, ≤ 10MB each", {
1266
- max: re
1401
+ max: oe
1267
1402
  }) })
1268
1403
  ]
1269
1404
  }
@@ -1274,68 +1409,68 @@ function Ct({ files: r, onChange: e, disabled: t }) {
1274
1409
  ref: i,
1275
1410
  type: "file",
1276
1411
  multiple: !0,
1277
- accept: ye.join(","),
1412
+ accept: we.join(","),
1278
1413
  class: "hidden",
1279
- onChange: (h) => {
1280
- f(h.target.files), h.currentTarget.value = "";
1414
+ onChange: (d) => {
1415
+ h(d.target.files), d.currentTarget.value = "";
1281
1416
  }
1282
1417
  }
1283
1418
  ),
1284
- c && /* @__PURE__ */ o("p", { class: "mt-1 text-xs text-red-600", children: c }),
1285
- r.length > 0 && /* @__PURE__ */ o("ul", { class: "mt-2 flex flex-col gap-1", children: r.map((h, d) => /* @__PURE__ */ u(
1419
+ l && /* @__PURE__ */ o("p", { class: "mt-1 text-xs text-red-600", children: l }),
1420
+ r.length > 0 && /* @__PURE__ */ o("ul", { class: "mt-2 flex flex-col gap-1", children: r.map((d, g) => /* @__PURE__ */ u(
1286
1421
  "li",
1287
1422
  {
1288
1423
  class: "flex items-center justify-between gap-2 rounded bg-gray-50 px-2 py-1 text-xs",
1289
1424
  children: [
1290
- /* @__PURE__ */ o("span", { class: "truncate text-gray-700", children: h.name }),
1425
+ /* @__PURE__ */ o("span", { class: "truncate text-gray-700", children: d.name }),
1291
1426
  /* @__PURE__ */ o(
1292
1427
  "button",
1293
1428
  {
1294
1429
  type: "button",
1295
1430
  onClick: () => {
1296
- const b = [...r];
1297
- b.splice(d, 1), e(b);
1431
+ const _ = [...r];
1432
+ _.splice(g, 1), e(_);
1298
1433
  },
1299
1434
  disabled: t,
1300
1435
  class: "text-gray-500 hover:text-red-600 disabled:cursor-not-allowed disabled:opacity-60",
1301
- "aria-label": n("support.remove_file_aria", "Remove {filename}", { filename: h.name }),
1436
+ "aria-label": n("support.remove_file_aria", "Remove {filename}", { filename: d.name }),
1302
1437
  children: "✕"
1303
1438
  }
1304
1439
  )
1305
1440
  ]
1306
1441
  },
1307
- `${h.name}-${h.size}-${d}`
1442
+ `${d.name}-${d.size}-${g}`
1308
1443
  )) })
1309
1444
  ] });
1310
1445
  }
1311
- const It = {
1446
+ const Rt = {
1312
1447
  day: "cta.get_plan_daily",
1313
1448
  week: "cta.get_plan_weekly",
1314
1449
  month: "cta.get_plan_monthly",
1315
1450
  year: "cta.get_plan_yearly"
1316
- }, At = {
1451
+ }, Dt = {
1317
1452
  day: "Get Daily Plan",
1318
1453
  week: "Get Weekly Plan",
1319
1454
  month: "Get Monthly Plan",
1320
1455
  year: "Get Yearly Plan"
1321
1456
  };
1322
- function Lt(r, e, t, n) {
1457
+ function zt(r, e, t, n) {
1323
1458
  if (e === "close") return n("cta.close", "Close");
1324
1459
  if (!r) return n("cta.continue", "Continue");
1325
1460
  if (!t && r.trial_days && r.interval && r.interval !== "lifetime")
1326
1461
  return n("cta.start_trial", "Start {days}-Day Free Trial", { days: r.trial_days });
1327
1462
  if (!r.interval || r.interval === "lifetime")
1328
1463
  return n("cta.get_lifetime_access", "Get Lifetime Access");
1329
- const i = It[r.interval];
1330
- return i ? n(i, At[r.interval]) : n("cta.get_plan_generic", "Get {interval} Plan", {
1331
- interval: Mt(r.interval)
1464
+ const i = Rt[r.interval];
1465
+ return i ? n(i, Dt[r.interval]) : n("cta.get_plan_generic", "Get {interval} Plan", {
1466
+ interval: qt(r.interval)
1332
1467
  });
1333
1468
  }
1334
- function Mt(r) {
1469
+ function qt(r) {
1335
1470
  return r.length ? r[0].toUpperCase() + r.slice(1) : r;
1336
1471
  }
1337
- function Et({ block: r, ctx: e }) {
1338
- const { t } = k(), [n, i] = x(!1), s = r.priceId ?? e.selectedPriceId, a = n || r.action === "checkout" && !s, c = s ? e.bootstrap.prices.find((d) => d.id === s) ?? null : null, l = e.bootstrap.user?.had_previous_trial ?? !1, f = r.label ?? Lt(c, r.action, l, t);
1472
+ function Nt({ block: r, ctx: e }) {
1473
+ const { t } = S(), [n, i] = k(!1), s = r.priceId ?? e.selectedPriceId, a = n || r.action === "checkout" && !s, l = s ? e.bootstrap.prices.find((g) => g.id === s) ?? null : null, c = e.bootstrap.user?.had_previous_trial ?? !1, h = r.label ?? zt(l, r.action, c, t);
1339
1474
  return /* @__PURE__ */ u(
1340
1475
  "button",
1341
1476
  {
@@ -1367,15 +1502,15 @@ function Et({ block: r, ctx: e }) {
1367
1502
  "aria-hidden": "true"
1368
1503
  }
1369
1504
  ),
1370
- n ? /* @__PURE__ */ o("span", { class: "relative z-10 inline-block h-4 w-4 animate-spin rounded-full border-2 border-white/40 border-t-white" }) : /* @__PURE__ */ o("span", { class: "relative z-10", children: f })
1505
+ n ? /* @__PURE__ */ o("span", { class: "relative z-10 inline-block h-4 w-4 animate-spin rounded-full border-2 border-white/40 border-t-white" }) : /* @__PURE__ */ o("span", { class: "relative z-10", children: h })
1371
1506
  ]
1372
1507
  }
1373
1508
  );
1374
1509
  }
1375
- function Pt({ ctx: r }) {
1376
- const { t: e } = k(), t = r.authSession, n = r.auth, [i, s] = x(!1), a = () => r.onAction("support");
1510
+ function Ft({ ctx: r }) {
1511
+ const { t: e } = S(), t = r.authSession, n = r.auth, [i, s] = k(!1), a = () => r.onAction("support");
1377
1512
  if (t && !t.user.is_anonymous) {
1378
- const c = async () => {
1513
+ const l = async () => {
1379
1514
  if (!(!n || i)) {
1380
1515
  s(!0);
1381
1516
  try {
@@ -1393,19 +1528,19 @@ function Pt({ ctx: r }) {
1393
1528
  /* @__PURE__ */ o("b", { class: "font-medium text-gray-700", children: t.user.email })
1394
1529
  ] }),
1395
1530
  /* @__PURE__ */ u("div", { class: "flex items-center justify-center gap-3", children: [
1396
- /* @__PURE__ */ o(H, { onClick: c, disabled: !n || i, children: i ? e("session.signing_out", "Signing out…") : e("session.sign_out", "Sign Out") }),
1397
- /* @__PURE__ */ o(be, {}),
1398
- /* @__PURE__ */ o(H, { onClick: a, children: e("session.contact_support", "Contact Support") })
1531
+ /* @__PURE__ */ o(W, { onClick: l, disabled: !n || i, children: i ? e("session.signing_out", "Signing out…") : e("session.sign_out", "Sign Out") }),
1532
+ /* @__PURE__ */ o(ve, {}),
1533
+ /* @__PURE__ */ o(W, { onClick: a, children: e("session.contact_support", "Contact Support") })
1399
1534
  ] })
1400
1535
  ] });
1401
1536
  }
1402
1537
  return /* @__PURE__ */ u("div", { class: "-mt-3 flex items-center justify-center gap-3 pt-1 text-center text-[13px]", children: [
1403
- /* @__PURE__ */ o(H, { onClick: () => r.onAction("restore"), children: e("session.restore_purchases", "Restore purchases") }),
1404
- /* @__PURE__ */ o(be, {}),
1405
- /* @__PURE__ */ o(H, { onClick: a, children: e("session.contact_support", "Contact Support") })
1538
+ /* @__PURE__ */ o(W, { onClick: () => r.onAction("restore"), children: e("session.restore_purchases", "Restore purchases") }),
1539
+ /* @__PURE__ */ o(ve, {}),
1540
+ /* @__PURE__ */ o(W, { onClick: a, children: e("session.contact_support", "Contact Support") })
1406
1541
  ] });
1407
1542
  }
1408
- function H({
1543
+ function W({
1409
1544
  onClick: r,
1410
1545
  disabled: e,
1411
1546
  children: t
@@ -1422,10 +1557,10 @@ function H({
1422
1557
  }
1423
1558
  );
1424
1559
  }
1425
- function be() {
1560
+ function ve() {
1426
1561
  return /* @__PURE__ */ o("span", { class: "h-1 w-1 rounded-full bg-gray-300", "aria-hidden": "true" });
1427
1562
  }
1428
- function Tt({ block: r }) {
1563
+ function Vt({ block: r }) {
1429
1564
  return r.items.length ? /* @__PURE__ */ o("ul", { class: "flex flex-col gap-2.5", role: "list", children: r.items.map((e) => /* @__PURE__ */ u("li", { class: "flex items-start gap-3 text-sm text-gray-700", children: [
1430
1565
  /* @__PURE__ */ o(
1431
1566
  "svg",
@@ -1454,11 +1589,11 @@ function Tt({ block: r }) {
1454
1589
  ] })
1455
1590
  ] }, e.id)) }) : null;
1456
1591
  }
1457
- function Bt({ block: r }) {
1458
- const { t: e } = k(), t = r.title ?? e("pricing.money_back", "30-day money-back guarantee"), n = r.subtitle, i = (r.icon ?? "dollar_shield") !== "none", s = Ot(t);
1592
+ function $t({ block: r }) {
1593
+ const { t: e } = S(), t = r.title ?? e("pricing.money_back", "30-day money-back guarantee"), n = r.subtitle, i = (r.icon ?? "dollar_shield") !== "none", s = Ht(t);
1459
1594
  return /* @__PURE__ */ u("div", { class: "flex flex-col items-center gap-1.5 border-b-1 pb-4 mb-1 border-gray-100", children: [
1460
1595
  /* @__PURE__ */ u("div", { class: "inline-flex items-center gap-2 text-[12px] text-gray-700", children: [
1461
- i ? /* @__PURE__ */ o(Ut, {}) : null,
1596
+ i ? /* @__PURE__ */ o(Gt, {}) : null,
1462
1597
  s ? /* @__PURE__ */ u("span", { children: [
1463
1598
  /* @__PURE__ */ o("b", { class: "font-bold text-gray-900", children: s.bold }),
1464
1599
  " ",
@@ -1468,11 +1603,11 @@ function Bt({ block: r }) {
1468
1603
  n ? /* @__PURE__ */ o("span", { class: "text-center text-xs leading-relaxed text-gray-500", children: n }) : null
1469
1604
  ] });
1470
1605
  }
1471
- function Ot(r) {
1606
+ function Ht(r) {
1472
1607
  const e = r.match(/^(\d+[-\s]?days?)\s+(.+)$/i);
1473
1608
  return e ? { bold: e[1], rest: e[2] } : null;
1474
1609
  }
1475
- function Ut() {
1610
+ function Gt() {
1476
1611
  return /* @__PURE__ */ u(
1477
1612
  "svg",
1478
1613
  {
@@ -1507,22 +1642,22 @@ function Ut() {
1507
1642
  }
1508
1643
  );
1509
1644
  }
1510
- const Be = 24, jt = 16, Rt = 2;
1511
- function zt(r, e) {
1512
- const t = e * Rt;
1513
- let n = Be;
1514
- for (r.style.fontSize = `${n}px`; r.scrollHeight > t && n > jt; )
1645
+ const Re = 24, Wt = 16, Zt = 2;
1646
+ function Yt(r, e) {
1647
+ const t = e * Zt;
1648
+ let n = Re;
1649
+ for (r.style.fontSize = `${n}px`; r.scrollHeight > t && n > Wt; )
1515
1650
  n -= 1, r.style.fontSize = `${n}px`;
1516
1651
  }
1517
- function Dt({ block: r, ctx: e }) {
1518
- const t = r.level ?? 1, n = `h${t}`, i = t === 1 ? "text-[22px] sm:text-2xl font-semibold leading-tight text-center text-balance text-gray-800" : t === 2 ? "text-xl font-semibold leading-snug text-gray-900 tracking-tight" : "text-base font-medium text-gray-900", s = z(null), a = t === 1 && !!e.bootstrap.settings.title_auto_fit;
1519
- return O(() => {
1652
+ function Kt({ block: r, ctx: e }) {
1653
+ const t = r.level ?? 1, n = `h${t}`, i = t === 1 ? "text-[22px] sm:text-2xl font-semibold leading-tight text-center text-balance text-gray-800" : t === 2 ? "text-xl font-semibold leading-snug text-gray-900 tracking-tight" : "text-base font-medium text-gray-900", s = U(null), a = t === 1 && !!e.bootstrap.settings.title_auto_fit;
1654
+ return P(() => {
1520
1655
  if (!a || !s.current) return;
1521
- const c = getComputedStyle(s.current), l = parseFloat(c.lineHeight) || Be * 1.5;
1522
- zt(s.current, l);
1656
+ const l = getComputedStyle(s.current), c = parseFloat(l.lineHeight) || Re * 1.5;
1657
+ Yt(s.current, c);
1523
1658
  }, [a, r.text]), /* @__PURE__ */ o(n, { ref: s, class: i, children: r.text });
1524
1659
  }
1525
- function qt(r) {
1660
+ function Xt(r) {
1526
1661
  const e = r.local ?? { currency: r.currency, amount: r.amount };
1527
1662
  if (r.interval === "year") {
1528
1663
  const t = (r.interval_count ?? 1) * 12;
@@ -1530,7 +1665,7 @@ function qt(r) {
1530
1665
  }
1531
1666
  return { amount: e.amount, currency: e.currency };
1532
1667
  }
1533
- function ne(r, e) {
1668
+ function se(r, e) {
1534
1669
  const t = r % 1 !== 0 ? 2 : 0;
1535
1670
  try {
1536
1671
  const n = new Intl.NumberFormat(void 0, {
@@ -1548,29 +1683,20 @@ function ne(r, e) {
1548
1683
  return { currency: e, amount: String(r) };
1549
1684
  }
1550
1685
  }
1551
- function se(r, e) {
1552
- const { amount: t, currency: n } = qt(r);
1686
+ function ce(r, e) {
1687
+ const { amount: t, currency: n } = Xt(r);
1553
1688
  if (!e) {
1554
- const { currency: c, amount: l } = ne(t, n);
1555
- return { currency: c, amount: l, originalAmount: null };
1689
+ const { currency: l, amount: c } = se(t, n);
1690
+ return { currency: l, amount: c, originalAmount: null };
1556
1691
  }
1557
- const i = t * (1 - e / 100), s = ne(i, n), a = ne(t, n);
1692
+ const i = t * (1 - e / 100), s = se(i, n), a = se(t, n);
1558
1693
  return {
1559
1694
  currency: s.currency,
1560
1695
  amount: s.amount,
1561
1696
  originalAmount: `${a.currency}${a.amount}`
1562
1697
  };
1563
1698
  }
1564
- function G(r, e) {
1565
- if (!r || r.length === 0) return null;
1566
- const t = r.find(
1567
- (i) => i.price_id === e && i.discount_percent && i.discount_percent > 0
1568
- );
1569
- return t || (r.find(
1570
- (i) => i.price_id == null && i.discount_percent && i.discount_percent > 0
1571
- ) ?? null);
1572
- }
1573
- function Oe(r, e) {
1699
+ function De(r, e) {
1574
1700
  if (r.label) return r.label.toUpperCase();
1575
1701
  if (!r.interval || r.interval === "lifetime")
1576
1702
  return e("pricing.plan_label.lifetime", "LIFETIME");
@@ -1582,15 +1708,15 @@ function Oe(r, e) {
1582
1708
  }[r.interval];
1583
1709
  return n ? e(n.key, n.fallback) : `${r.interval.toUpperCase()} PLAN`;
1584
1710
  }
1585
- function ae(r, e) {
1711
+ function ue(r, e) {
1586
1712
  if (!r.interval || r.interval === "lifetime")
1587
1713
  return e("pricing.interval.lifetime_short", "lifetime");
1588
1714
  if (r.interval === "year") return e("pricing.interval.month", "month");
1589
1715
  const t = r.interval_count ?? 1;
1590
1716
  return t === 1 ? e(`pricing.interval.${r.interval}`, r.interval) : `${t} ${r.interval}s`;
1591
1717
  }
1592
- function Nt({ block: r, ctx: e }) {
1593
- const { t } = k(), n = r.priceIds && r.priceIds.length > 0 ? new Set(r.priceIds) : null, i = e.bootstrap.prices.filter((a) => !n || n.has(a.id));
1718
+ function Jt({ block: r, ctx: e }) {
1719
+ const { t } = S(), n = r.priceIds && r.priceIds.length > 0 ? new Set(r.priceIds) : null, i = e.bootstrap.prices.filter((a) => !n || n.has(a.id));
1594
1720
  if (i.length === 0)
1595
1721
  return /* @__PURE__ */ o("p", { class: "text-sm text-gray-500", children: t("pricing.no_prices", "No prices available.") });
1596
1722
  const s = r.popular_label ?? t("pricing.most_popular", "Most popular");
@@ -1601,14 +1727,14 @@ function Nt({ block: r, ctx: e }) {
1601
1727
  class: "flex w-full flex-col rounded-xl border border-gray-200 bg-gray-50",
1602
1728
  role: "radiogroup",
1603
1729
  "aria-label": t("pricing.plans_aria", "Plans"),
1604
- children: i.map((a, c) => /* @__PURE__ */ o(
1605
- Vt,
1730
+ children: i.map((a, l) => /* @__PURE__ */ o(
1731
+ er,
1606
1732
  {
1607
1733
  price: a,
1608
- isLast: c === i.length - 1,
1734
+ isLast: l === i.length - 1,
1609
1735
  isPopular: r.popular_price_id === a.id,
1610
1736
  popularLabel: s,
1611
- offer: G(e.bootstrap.offers, a.id),
1737
+ offer: $(e.bootstrap.offers, a.id, { readStart: N }),
1612
1738
  selected: e.selectedPriceId === a.id,
1613
1739
  onSelect: () => {
1614
1740
  e.setSelectedPriceId(a.id), e.onAction("price_selected", { priceId: a.id, price: a });
@@ -1620,8 +1746,8 @@ function Nt({ block: r, ctx: e }) {
1620
1746
  }
1621
1747
  );
1622
1748
  if (r.view === "horizontal") {
1623
- const a = Math.min(i.length, 3), c = i.some(
1624
- (l) => (G(e.bootstrap.offers, l.id)?.discount_percent ?? 0) > 0
1749
+ const a = Math.min(i.length, 3), l = i.some(
1750
+ (c) => ($(e.bootstrap.offers, c.id, { readStart: N })?.discount_percent ?? 0) > 0
1625
1751
  );
1626
1752
  return /* @__PURE__ */ o(
1627
1753
  "div",
@@ -1630,21 +1756,21 @@ function Nt({ block: r, ctx: e }) {
1630
1756
  style: { gridTemplateColumns: `repeat(${a}, minmax(0, 1fr))` },
1631
1757
  role: "radiogroup",
1632
1758
  "aria-label": t("pricing.plans_aria", "Plans"),
1633
- children: i.map((l) => /* @__PURE__ */ o(
1634
- $t,
1759
+ children: i.map((c) => /* @__PURE__ */ o(
1760
+ tr,
1635
1761
  {
1636
- price: l,
1637
- isPopular: r.popular_price_id === l.id,
1762
+ price: c,
1763
+ isPopular: r.popular_price_id === c.id,
1638
1764
  popularLabel: s,
1639
- offer: G(e.bootstrap.offers, l.id),
1640
- reserveStrikeRow: c,
1641
- selected: e.selectedPriceId === l.id,
1765
+ offer: $(e.bootstrap.offers, c.id, { readStart: N }),
1766
+ reserveStrikeRow: l,
1767
+ selected: e.selectedPriceId === c.id,
1642
1768
  onSelect: () => {
1643
- e.setSelectedPriceId(l.id), e.onAction("price_selected", { priceId: l.id, price: l });
1769
+ e.setSelectedPriceId(c.id), e.onAction("price_selected", { priceId: c.id, price: c });
1644
1770
  },
1645
1771
  t
1646
1772
  },
1647
- l.id
1773
+ c.id
1648
1774
  ))
1649
1775
  }
1650
1776
  );
@@ -1656,13 +1782,13 @@ function Nt({ block: r, ctx: e }) {
1656
1782
  role: "radiogroup",
1657
1783
  "aria-label": t("pricing.plans_aria", "Plans"),
1658
1784
  children: i.map((a) => {
1659
- const c = e.selectedPriceId === a.id, l = r.popular_price_id === a.id, h = G(e.bootstrap.offers, a.id)?.discount_percent ?? null, { currency: d, amount: b, originalAmount: w } = se(a, h);
1785
+ const l = e.selectedPriceId === a.id, c = r.popular_price_id === a.id, d = $(e.bootstrap.offers, a.id, { readStart: N })?.discount_percent ?? null, { currency: g, amount: _, originalAmount: p } = ce(a, d);
1660
1786
  return /* @__PURE__ */ u(
1661
1787
  "button",
1662
1788
  {
1663
1789
  type: "button",
1664
1790
  role: "radio",
1665
- "aria-checked": c,
1791
+ "aria-checked": l,
1666
1792
  onClick: () => {
1667
1793
  e.setSelectedPriceId(a.id), e.onAction("price_selected", { priceId: a.id, price: a });
1668
1794
  },
@@ -1671,7 +1797,7 @@ function Nt({ block: r, ctx: e }) {
1671
1797
  // Везде border 2px — selection выражается только цветом, layout
1672
1798
  // не прыгает (равная толщина у selected/unselected). Цветовая
1673
1799
  // разница accent vs gray достаточно сильная для visual hierarchy.
1674
- c ? "border-[var(--pw-accent)] bg-transparent" : "border-gray-200 bg-transparent hover:bg-gray-50"
1800
+ l ? "border-[var(--pw-accent)] bg-transparent" : "border-gray-200 bg-transparent hover:bg-gray-50"
1675
1801
  ].join(" "),
1676
1802
  children: [
1677
1803
  /* @__PURE__ */ o(
@@ -1679,14 +1805,14 @@ function Nt({ block: r, ctx: e }) {
1679
1805
  {
1680
1806
  class: [
1681
1807
  "flex h-6.5 w-6.5 flex-shrink-0 items-center justify-center rounded-full border transition-colors",
1682
- c ? "border-[var(--pw-accent)] text-white" : "border-gray-300 bg-transparent text-transparent",
1808
+ l ? "border-[var(--pw-accent)] text-white" : "border-gray-300 bg-transparent text-transparent",
1683
1809
  // Popular-label badge сидит absolute сверху-справа карточки и
1684
1810
  // визуально сдвигает центр content'а вниз. flex items-center
1685
1811
  // на карточке держит галочку по геометрическому центру, что
1686
1812
  // делает её визуально выше — компенсируем небольшим mt'ом.
1687
- l ? "mt-3" : ""
1813
+ c ? "mt-3" : ""
1688
1814
  ].join(" "),
1689
- style: c ? {
1815
+ style: l ? {
1690
1816
  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%)"
1691
1817
  } : void 0,
1692
1818
  "aria-hidden": "true",
@@ -1698,7 +1824,7 @@ function Nt({ block: r, ctx: e }) {
1698
1824
  viewBox: "0 0 17 12",
1699
1825
  fill: "none",
1700
1826
  xmlns: "http://www.w3.org/2000/svg",
1701
- class: c ? "opacity-100" : "opacity-0",
1827
+ class: l ? "opacity-100" : "opacity-0",
1702
1828
  children: /* @__PURE__ */ o(
1703
1829
  "path",
1704
1830
  {
@@ -1712,35 +1838,35 @@ function Nt({ block: r, ctx: e }) {
1712
1838
  ),
1713
1839
  /* @__PURE__ */ u("div", { class: "flex flex-1 flex-col gap-0.5", children: [
1714
1840
  /* @__PURE__ */ u("div", { class: "flex flex-wrap items-center gap-x-2 gap-y-1", children: [
1715
- /* @__PURE__ */ o("span", { class: "text-xs font-normal uppercase tracking-normal text-gray-800/70", children: Oe(a, t) }),
1716
- w ? (
1841
+ /* @__PURE__ */ o("span", { class: "text-xs font-normal uppercase tracking-normal text-gray-800/70", children: De(a, t) }),
1842
+ p ? (
1717
1843
  // opacity-60 приглушает strike: глаз сначала ловит label
1718
1844
  // и discount-badge, потом main price; original «бывшая цена»
1719
1845
  // — третичная информация, не должна конкурировать с label.
1720
- /* @__PURE__ */ o("span", { class: "text-[15px] font-normal text-gray-400 opacity-60 line-through decoration-gray-400 decoration-[1.5px]", children: w })
1846
+ /* @__PURE__ */ o("span", { class: "text-[15px] font-normal text-gray-400 opacity-60 line-through decoration-gray-400 decoration-[1.5px]", children: p })
1721
1847
  ) : null,
1722
- h ? (
1848
+ d ? (
1723
1849
  // Emerald pill — фиксированный «успех/выгода», не зависит от
1724
1850
  // brand_color. Читается даже на тёмных бренд-акцентах.
1725
1851
  /* @__PURE__ */ u("span", { class: "rounded-full bg-emerald-100 px-2.5 py-1 text-xs font-bold leading-none text-emerald-700", children: [
1726
1852
  "-",
1727
- h,
1853
+ d,
1728
1854
  "%"
1729
1855
  ] })
1730
1856
  ) : null
1731
1857
  ] }),
1732
1858
  /* @__PURE__ */ o("div", { class: "flex items-baseline gap-2 flex-wrap", children: /* @__PURE__ */ u("span", { class: "text-[26px] leading-tight whitespace-nowrap text-gray-800 font-medium", children: [
1733
- /* @__PURE__ */ o("span", { class: "opacity-90", children: d }),
1734
- b,
1859
+ /* @__PURE__ */ o("span", { class: "opacity-90", children: g }),
1860
+ _,
1735
1861
  /* @__PURE__ */ u("span", { class: "text-sm font-normal text-gray-500", children: [
1736
1862
  " ",
1737
1863
  "/ ",
1738
- ae(a, t)
1864
+ ue(a, t)
1739
1865
  ] })
1740
1866
  ] }) }),
1741
1867
  a.description ? /* @__PURE__ */ o("span", { class: "mt-1 text-xs leading-relaxed text-gray-500", children: a.description }) : null
1742
1868
  ] }),
1743
- l ? /* @__PURE__ */ o(
1869
+ c ? /* @__PURE__ */ o(
1744
1870
  "span",
1745
1871
  {
1746
1872
  class: "absolute -top-[9px] -right-[6px] rounded-[11px] border-[5px] border-white px-2 py-1 text-[12px] font-semibold text-white",
@@ -1756,10 +1882,10 @@ function Nt({ block: r, ctx: e }) {
1756
1882
  }
1757
1883
  );
1758
1884
  }
1759
- function Ft(r, e) {
1885
+ function Qt(r, e) {
1760
1886
  return r.label ? r.label : !r.interval || r.interval === "lifetime" ? e("pricing.interval.lifetime_short", "lifetime") : e(`pricing.interval.${r.interval}`, r.interval);
1761
1887
  }
1762
- function Vt({
1888
+ function er({
1763
1889
  price: r,
1764
1890
  isLast: e,
1765
1891
  isPopular: t,
@@ -1767,9 +1893,9 @@ function Vt({
1767
1893
  offer: i,
1768
1894
  selected: s,
1769
1895
  onSelect: a,
1770
- t: c
1896
+ t: l
1771
1897
  }) {
1772
- const l = i?.discount_percent ?? null, { currency: f, amount: h, originalAmount: d } = se(r, l);
1898
+ const c = i?.discount_percent ?? null, { currency: h, amount: d, originalAmount: g } = ce(r, c);
1773
1899
  return /* @__PURE__ */ u(
1774
1900
  "button",
1775
1901
  {
@@ -1819,7 +1945,7 @@ function Vt({
1819
1945
  ].join(" "),
1820
1946
  children: [
1821
1947
  /* @__PURE__ */ u("div", { class: "flex flex-wrap items-center gap-1 gap-x-1.5", children: [
1822
- /* @__PURE__ */ o("span", { class: "text-base font-normal capitalize text-gray-800", children: Ft(r, c) }),
1948
+ /* @__PURE__ */ o("span", { class: "text-base font-normal capitalize text-gray-800", children: Qt(r, l) }),
1823
1949
  t ? (
1824
1950
  // Pastel brand-mix pill — точно как `badge` в TelegramPricingRadio.
1825
1951
  // Низкий visual weight: pill про "имя плана" (most popular), а не
@@ -1836,22 +1962,22 @@ function Vt({
1836
1962
  }
1837
1963
  )
1838
1964
  ) : null,
1839
- l ? /* @__PURE__ */ u("span", { class: "rounded-md bg-emerald-100 px-1.5 py-0.5 text-[10px] font-bold leading-none text-emerald-700", children: [
1965
+ c ? /* @__PURE__ */ u("span", { class: "rounded-md bg-emerald-100 px-1.5 py-0.5 text-[10px] font-bold leading-none text-emerald-700", children: [
1840
1966
  "-",
1841
- l,
1967
+ c,
1842
1968
  "%"
1843
1969
  ] }) : null
1844
1970
  ] }),
1845
1971
  /* @__PURE__ */ o("div", { class: "flex-1" }),
1846
1972
  /* @__PURE__ */ u("span", { class: "flex items-baseline gap-1.5 text-base font-normal text-gray-600", children: [
1847
- d ? /* @__PURE__ */ o("span", { class: "text-xs text-gray-400 line-through decoration-gray-400 decoration-[1.5px]", children: d }) : null,
1973
+ g ? /* @__PURE__ */ o("span", { class: "text-xs text-gray-400 line-through decoration-gray-400 decoration-[1.5px]", children: g }) : null,
1848
1974
  /* @__PURE__ */ u("span", { class: "whitespace-nowrap", children: [
1849
- /* @__PURE__ */ o("span", { class: "opacity-90", children: f }),
1850
- h,
1975
+ /* @__PURE__ */ o("span", { class: "opacity-90", children: h }),
1976
+ d,
1851
1977
  /* @__PURE__ */ u("span", { class: "text-xs text-gray-400", children: [
1852
1978
  " ",
1853
1979
  "/ ",
1854
- ae(r, c)
1980
+ ue(r, l)
1855
1981
  ] })
1856
1982
  ] })
1857
1983
  ] })
@@ -1862,7 +1988,7 @@ function Vt({
1862
1988
  }
1863
1989
  );
1864
1990
  }
1865
- function $t({
1991
+ function tr({
1866
1992
  price: r,
1867
1993
  isPopular: e,
1868
1994
  popularLabel: t,
@@ -1870,9 +1996,9 @@ function $t({
1870
1996
  reserveStrikeRow: i,
1871
1997
  selected: s,
1872
1998
  onSelect: a,
1873
- t: c
1999
+ t: l
1874
2000
  }) {
1875
- const l = n?.discount_percent ?? null, { currency: f, amount: h, originalAmount: d } = se(r, l);
2001
+ const c = n?.discount_percent ?? null, { currency: h, amount: d, originalAmount: g } = ce(r, c);
1876
2002
  return /* @__PURE__ */ u(
1877
2003
  "button",
1878
2004
  {
@@ -1886,22 +2012,22 @@ function $t({
1886
2012
  ].join(" "),
1887
2013
  style: s ? { background: "color-mix(in srgb, var(--pw-accent) 6%, transparent)" } : void 0,
1888
2014
  children: [
1889
- /* @__PURE__ */ o("span", { class: "flex min-h-[2.4em] items-center text-[10px] font-normal uppercase leading-tight text-gray-800/70", children: Oe(r, c) }),
2015
+ /* @__PURE__ */ o("span", { class: "flex min-h-[2.4em] items-center text-[10px] font-normal uppercase leading-tight text-gray-800/70", children: De(r, l) }),
1890
2016
  i ? /* @__PURE__ */ u("div", { class: "flex h-[22px] items-center justify-center gap-1.5", children: [
1891
- d ? /* @__PURE__ */ o("span", { class: "text-[12px] text-gray-400 line-through decoration-gray-400 decoration-[1.5px]", children: d }) : null,
1892
- l ? /* @__PURE__ */ u("span", { class: "rounded-md bg-emerald-100 px-1.5 py-0.5 text-[10px] font-bold leading-none text-emerald-700", children: [
2017
+ g ? /* @__PURE__ */ o("span", { class: "text-[12px] text-gray-400 line-through decoration-gray-400 decoration-[1.5px]", children: g }) : null,
2018
+ c ? /* @__PURE__ */ u("span", { class: "rounded-md bg-emerald-100 px-1.5 py-0.5 text-[10px] font-bold leading-none text-emerald-700", children: [
1893
2019
  "-",
1894
- l,
2020
+ c,
1895
2021
  "%"
1896
2022
  ] }) : null
1897
2023
  ] }) : null,
1898
2024
  /* @__PURE__ */ u("span", { class: "text-[26px] leading-none whitespace-nowrap text-gray-800 font-medium", children: [
1899
- /* @__PURE__ */ o("span", { class: "opacity-90", children: f }),
1900
- h
2025
+ /* @__PURE__ */ o("span", { class: "opacity-90", children: h }),
2026
+ d
1901
2027
  ] }),
1902
2028
  /* @__PURE__ */ u("span", { class: "text-xs font-normal text-gray-500", children: [
1903
2029
  "/ ",
1904
- ae(r, c)
2030
+ ue(r, l)
1905
2031
  ] }),
1906
2032
  e ? /* @__PURE__ */ o(
1907
2033
  "span",
@@ -1915,27 +2041,27 @@ function $t({
1915
2041
  }
1916
2042
  );
1917
2043
  }
1918
- function Ht({ block: r }) {
2044
+ function rr({ block: r }) {
1919
2045
  return /* @__PURE__ */ o("p", { class: "text-[0.9375rem] leading-relaxed text-gray-600", children: r.text });
1920
2046
  }
1921
- const Gt = {
2047
+ const nr = {
1922
2048
  week: 0.25,
1923
2049
  month: 1,
1924
2050
  year: 12
1925
2051
  };
1926
- function Wt(r, e) {
2052
+ function ir(r, e) {
1927
2053
  return r ? e(`pricing.interval.${r}`, r) : e("pricing.interval.period", "period");
1928
2054
  }
1929
- function Zt({ block: r, ctx: e }) {
1930
- const { t } = k();
2055
+ function or({ block: r, ctx: e }) {
2056
+ const { t } = S();
1931
2057
  if (!r.queries.length) return null;
1932
- const i = e.bootstrap.prices.find((a) => a.id === e.selectedPriceId)?.interval ?? null, s = i ? Gt[i] : void 0;
2058
+ const i = e.bootstrap.prices.find((a) => a.id === e.selectedPriceId)?.interval ?? null, s = i ? nr[i] : void 0;
1933
2059
  return /* @__PURE__ */ u("div", { class: "flex flex-col gap-2", children: [
1934
2060
  /* @__PURE__ */ o("div", { class: "text-sm font-semibold text-gray-800", children: !i || i === "lifetime" ? t("pricing.included_total", "Included for lifetime:") : t("pricing.included_per", "Included per {interval}:", {
1935
- interval: Wt(i, t)
2061
+ interval: ir(i, t)
1936
2062
  }) }),
1937
2063
  /* @__PURE__ */ o("ul", { class: "flex flex-col gap-2", role: "list", children: r.queries.map((a) => {
1938
- const c = Number.isFinite(a.count) ? a.count : 0, l = s !== void 0 ? Math.round(c * s) : c;
2064
+ const l = Number.isFinite(a.count) ? a.count : 0, c = s !== void 0 ? Math.round(l * s) : l;
1939
2065
  return /* @__PURE__ */ u("li", { class: `flex gap-3 ${a.desc ? "items-start" : "items-center"}`, children: [
1940
2066
  /* @__PURE__ */ o(
1941
2067
  "svg",
@@ -1959,10 +2085,10 @@ function Zt({ block: r, ctx: e }) {
1959
2085
  }
1960
2086
  ),
1961
2087
  /* @__PURE__ */ u("div", { children: [
1962
- /* @__PURE__ */ o("span", { class: "font-semibold text-gray-900 text-sm", children: l }),
2088
+ /* @__PURE__ */ o("span", { class: "font-semibold text-gray-900 text-sm", children: c }),
1963
2089
  " ",
1964
2090
  /* @__PURE__ */ o("span", { class: "text-sm text-gray-800", children: a.name }),
1965
- a.desc ? /* @__PURE__ */ u(oe, { children: [
2091
+ a.desc ? /* @__PURE__ */ u(le, { children: [
1966
2092
  /* @__PURE__ */ o("br", {}),
1967
2093
  /* @__PURE__ */ o("span", { class: "text-xs text-gray-400", children: a.desc })
1968
2094
  ] }) : null
@@ -1971,38 +2097,38 @@ function Zt({ block: r, ctx: e }) {
1971
2097
  }) })
1972
2098
  ] });
1973
2099
  }
1974
- const Yt = {
1975
- heading: Dt,
1976
- text: Ht,
1977
- price_grid: Nt,
1978
- cta_button: Et,
1979
- auth_panel: Ae,
1980
- current_session: Pt,
1981
- features_list: Tt,
1982
- tokenization_gate: Zt,
1983
- guarantee_badge: Bt,
1984
- offer_banner: xt
2100
+ const sr = {
2101
+ heading: Kt,
2102
+ text: rr,
2103
+ price_grid: Jt,
2104
+ cta_button: Nt,
2105
+ auth_panel: Ee,
2106
+ current_session: Ft,
2107
+ features_list: Vt,
2108
+ tokenization_gate: or,
2109
+ guarantee_badge: $t,
2110
+ offer_banner: Mt
1985
2111
  };
1986
- function Kt({ layout: r, bootstrap: e, onAction: t, auth: n, authSession: i, hasTopBanner: s }) {
1987
- const a = Ve(() => {
2112
+ function ar({ layout: r, bootstrap: e, onAction: t, auth: n, authSession: i, hasTopBanner: s }) {
2113
+ const a = Ze(() => {
1988
2114
  for (const v of r.blocks)
1989
- if (v.type === "price_grid" && v.popular_price_id && e.prices.some((p) => p.id === v.popular_price_id))
2115
+ if (v.type === "price_grid" && v.popular_price_id && e.prices.some((m) => m.id === v.popular_price_id))
1990
2116
  return v.popular_price_id;
1991
2117
  return e.prices[0]?.id ?? null;
1992
- }, [r.blocks, e.prices]), [c, l] = x(a), f = {
2118
+ }, [r.blocks, e.prices]), [l, c] = k(a), h = {
1993
2119
  bootstrap: e,
1994
- selectedPriceId: c,
1995
- setSelectedPriceId: l,
2120
+ selectedPriceId: l,
2121
+ setSelectedPriceId: c,
1996
2122
  onAction: t,
1997
2123
  auth: n,
1998
2124
  authSession: i
1999
- }, h = r.blocks.findIndex((v) => v.type === "cta_button"), d = h === -1 ? r.blocks : r.blocks.slice(0, h), b = h === -1 ? [] : r.blocks.slice(h), w = (v, p) => {
2000
- const y = Yt[v.type];
2001
- return y ? /* @__PURE__ */ o(y, { block: v, ctx: f }, `${v.type}-${p}`) : (typeof console < "u" && console.warn(`[paywall] unknown block type: ${v.type}`), null);
2125
+ }, d = r.blocks.findIndex((v) => v.type === "cta_button"), g = d === -1 ? r.blocks : r.blocks.slice(0, d), _ = d === -1 ? [] : r.blocks.slice(d), p = (v, m) => {
2126
+ const A = sr[v.type];
2127
+ return A ? /* @__PURE__ */ o(A, { block: v, ctx: h }, `${v.type}-${m}`) : (typeof console < "u" && console.warn(`[paywall] unknown block type: ${v.type}`), null);
2002
2128
  };
2003
- return /* @__PURE__ */ u(oe, { children: [
2004
- /* @__PURE__ */ o("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__ */ o("div", { class: "flex flex-col gap-6", children: d.map(w) }) }),
2005
- b.length > 0 ? (
2129
+ return /* @__PURE__ */ u(le, { children: [
2130
+ /* @__PURE__ */ o("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__ */ o("div", { class: "flex flex-col gap-6", children: g.map(p) }) }),
2131
+ _.length > 0 ? (
2006
2132
  // Тонкий shadow-top вместо border-t — создаёт depth, читается как
2007
2133
  // «footer закреплён к низу dialog'а». Линия выглядела как divider
2008
2134
  // в обычном flow, не передавала sticky-character.
@@ -2011,170 +2137,202 @@ function Kt({ layout: r, bootstrap: e, onAction: t, auth: n, authSession: i, has
2011
2137
  {
2012
2138
  class: "flex flex-col gap-4 bg-white px-6 pb-6 pt-3 sm:px-8",
2013
2139
  style: { boxShadow: "0 -4px 12px -4px rgba(15,23,42,0.06)" },
2014
- children: b.map((v, p) => w(v, d.length + p))
2140
+ children: _.map((v, m) => p(v, g.length + m))
2015
2141
  }
2016
2142
  )
2017
2143
  ) : null
2018
2144
  ] });
2019
2145
  }
2020
- function Xt(r, e, t, n) {
2021
- return r ? n ? { open: !0, view: "purchased", error: null } : e.status === "idle" || e.status === "loading" ? { open: !0, view: "loading", error: null } : e.status === "error" ? { open: !0, view: "error", error: e.error } : t.kind === "support" ? { open: !0, view: "support", error: null } : t.kind === "auth_gate" ? { open: !0, view: "auth", error: null } : t.kind === "awaiting_payment" ? { open: !0, view: "awaiting_payment", error: null } : t.kind === "popup_blocked" ? { open: !0, view: "popup_blocked", error: null } : t.kind === "purchase_success" ? { open: !0, view: "purchased", error: null } : t.kind === "verifying" ? { open: !0, view: "loading", error: null } : { open: !0, view: "layout", error: null } : { open: !1, view: null, error: null };
2146
+ function lr(r, e, t, n) {
2147
+ return r ? n ? { open: !0, view: "purchased", error: null, processing: !1 } : e.status === "idle" || e.status === "loading" ? { open: !0, view: "loading", error: null, processing: !1 } : e.status === "error" ? { open: !0, view: "error", error: e.error, processing: !1 } : t.kind === "support" ? { open: !0, view: "support", error: null, processing: !1 } : t.kind === "auth_gate" ? { open: !0, view: "auth", error: null, processing: !1 } : t.kind === "awaiting_payment" ? { open: !0, view: "awaiting_payment", error: null, processing: !1 } : t.kind === "popup_blocked" ? { open: !0, view: "popup_blocked", error: null, processing: !1 } : t.kind === "purchase_success" ? { open: !0, view: "purchased", error: null, processing: !1 } : t.kind === "verifying" ? { open: !0, view: "loading", error: null, processing: !1 } : { open: !0, view: "layout", error: null, processing: !1 } : { open: !1, view: null, error: null, processing: !1 };
2022
2148
  }
2023
- function Jt(r, e) {
2024
- return r.open === e.open && r.view === e.view && r.error === e.error;
2149
+ function cr(r, e) {
2150
+ return r.open === e.open && r.view === e.view && r.error === e.error && r.processing === e.processing;
2025
2151
  }
2026
- function Qt({
2152
+ function ur({
2027
2153
  client: r,
2028
2154
  open: e,
2029
2155
  onClose: t,
2030
2156
  onEvent: n,
2031
2157
  initialView: i,
2032
2158
  initialAuthMode: s,
2033
- purchased: a,
2034
- renew: c,
2035
- onState: l,
2036
- inline: f,
2037
- locale: h
2159
+ initialCheckoutPriceId: a,
2160
+ initialCheckoutUrl: l,
2161
+ purchased: c,
2162
+ renew: h,
2163
+ onState: d,
2164
+ inline: g,
2165
+ locale: _
2038
2166
  }) {
2039
- const [d, b] = x({ status: "idle" }), [w, v] = x(
2167
+ const [p, v] = k({ status: "idle" }), [m, A] = k(
2040
2168
  () => r.auth?.getCachedSession() ?? null
2041
- ), [p, y] = x(() => i === "support" ? { kind: "support", origin: "standalone" } : i === "auth" ? { kind: "auth_gate", origin: "standalone" } : { kind: "layout" }), U = z(!1), _ = z(null);
2042
- O(() => {
2043
- if (!l) return;
2044
- const m = Xt(e, d, p, a), g = _.current;
2045
- g && Jt(g, m) || (_.current = m, l(m));
2046
- }, [e, d, p, a, l]), O(() => {
2169
+ ), [y, b] = k(() => i === "support" ? { kind: "support", origin: "standalone" } : i === "auth" ? a ? {
2170
+ kind: "auth_gate",
2171
+ pendingCheckout: { priceId: a, direct: !0 },
2172
+ origin: "standalone",
2173
+ intent: "preauth"
2174
+ } : { kind: "auth_gate", origin: "standalone" } : i === "awaiting_payment" && a && l ? {
2175
+ kind: "awaiting_payment",
2176
+ priceId: a,
2177
+ url: l
2178
+ } : i === "popup_blocked" && a && l ? {
2179
+ kind: "popup_blocked",
2180
+ priceId: a,
2181
+ url: l
2182
+ } : { kind: "layout" }), C = i === "awaiting_payment" || i === "popup_blocked" || i === "auth" && !!a, I = U(!1), j = U(null);
2183
+ P(() => {
2184
+ if (!d) return;
2185
+ const x = lr(e, p, y, c), f = j.current;
2186
+ f && cr(f, x) || (j.current = x, d(x));
2187
+ }, [e, p, y, c, d]), P(() => {
2047
2188
  if (r.auth)
2048
- return r.auth.onAuthChange((m, g) => v(g));
2049
- }, [r.auth]), O(() => {
2189
+ return r.auth.onAuthChange((x, f) => A(f));
2190
+ }, [r.auth]), P(() => {
2050
2191
  if (typeof r.onBootstrapChange == "function")
2051
- return r.onBootstrapChange((m) => {
2052
- b(
2053
- (g) => g.status === "ready" ? { status: "ready", data: m } : g
2192
+ return r.onBootstrapChange((x) => {
2193
+ v(
2194
+ (f) => f.status === "ready" ? { status: "ready", data: x } : f
2054
2195
  );
2055
2196
  });
2056
- }, [r]), O(() => {
2057
- if (!e || d.status === "ready" || d.status === "loading") return;
2058
- let m = !1;
2059
- return b({ status: "loading" }), r.bootstrap().then((g) => {
2060
- m || (b({ status: "ready", data: g }), n("ready", g), g.user?.has_active_subscription && !c && !i && (n("purchase_completed", {
2061
- priceId: null,
2197
+ }, [r]), P(() => {
2198
+ if (!e || p.status === "ready" || p.status === "loading") return;
2199
+ let x = !1;
2200
+ return v({ status: "loading" }), r.bootstrap().then((f) => {
2201
+ if (x) return;
2202
+ v({ status: "ready", data: f }), n("ready", f);
2203
+ const w = i === "support" || i === "auth" || C;
2204
+ f.user?.has_active_subscription && !h && !w && (n("purchase_completed", {
2205
+ priceId: a ?? null,
2062
2206
  sessionId: null,
2063
2207
  restored: !0
2064
- }), y({ kind: "purchase_success", restored: !0 })));
2065
- }).catch((g) => {
2066
- if (m) return;
2067
- const C = g instanceof B ? g : new B("unknown", "Failed to load paywall", { cause: g });
2068
- b({ status: "error", error: C }), n("error", C);
2208
+ }), b({ kind: "purchase_success", restored: !0 }));
2209
+ }).catch((f) => {
2210
+ if (x) return;
2211
+ const w = f instanceof L ? f : new L("unknown", "Failed to load paywall", { cause: f });
2212
+ v({ status: "error", error: w }), n("error", w);
2069
2213
  }), () => {
2070
- m = !0;
2214
+ x = !0;
2071
2215
  };
2072
- }, [e, r]), $e(() => {
2216
+ }, [e, r]), Ye(() => {
2073
2217
  if (!e) {
2074
- y({ kind: "layout" }), U.current = !1;
2218
+ b({ kind: "layout" }), I.current = !1;
2075
2219
  return;
2076
2220
  }
2077
- i === "support" ? y({ kind: "support", origin: "standalone" }) : i === "auth" && y({ kind: "auth_gate", origin: "standalone" });
2078
- }, [e, i]);
2079
- const S = async (m) => {
2221
+ i === "support" ? b({ kind: "support", origin: "standalone" }) : i === "auth" ? b(a ? {
2222
+ kind: "auth_gate",
2223
+ pendingCheckout: { priceId: a, direct: !0 },
2224
+ origin: "standalone",
2225
+ intent: "preauth"
2226
+ } : { kind: "auth_gate", origin: "standalone" }) : i === "awaiting_payment" && a && l ? b({
2227
+ kind: "awaiting_payment",
2228
+ priceId: a,
2229
+ url: l
2230
+ }) : i === "popup_blocked" && a && l && b({
2231
+ kind: "popup_blocked",
2232
+ priceId: a,
2233
+ url: l
2234
+ });
2235
+ }, [e, i, a, l]);
2236
+ const M = async (x) => {
2080
2237
  try {
2081
- const g = await r.createCheckout({
2082
- priceId: m,
2083
- ignoreActivePurchase: c === !0
2238
+ const f = r.getCachedOffers?.() ?? null, w = f ? $(f, x, { readStart: N }) : null, E = await r.createCheckout({
2239
+ priceId: x,
2240
+ offerId: w?.id,
2241
+ ignoreActivePurchase: h === !0
2084
2242
  });
2085
- if (n("checkout_started", { priceId: m, url: g.url, acquiring: g.acquiring }), typeof window > "u" || !g.url) return;
2086
- const C = window.open(g.url, "_blank");
2087
- if (C) {
2243
+ if (n("checkout_started", { priceId: x, url: E.url, acquiring: E.acquiring }), typeof window > "u" || !E.url) return;
2244
+ const V = window.open(E.url, "_blank");
2245
+ if (V) {
2088
2246
  try {
2089
- C.opener = null;
2247
+ V.opener = null;
2090
2248
  } catch {
2091
2249
  }
2092
- y({ kind: "awaiting_payment", priceId: m, url: g.url });
2250
+ b({ kind: "awaiting_payment", priceId: x, url: E.url });
2093
2251
  } else
2094
- y({ kind: "popup_blocked", priceId: m, url: g.url });
2095
- } catch (g) {
2096
- if (g instanceof B && g.code === "already_purchased") {
2252
+ b({ kind: "popup_blocked", priceId: x, url: E.url });
2253
+ } catch (f) {
2254
+ if (f instanceof L && f.code === "already_purchased") {
2097
2255
  try {
2098
2256
  await r.getUser({ force: !0 });
2099
2257
  } catch {
2100
2258
  }
2101
- n("purchase_completed", { priceId: m, sessionId: null, restored: !0 }), y({ kind: "purchase_success", restored: !0 });
2259
+ n("purchase_completed", { priceId: x, sessionId: null, restored: !0 }), C ? t() : b({ kind: "purchase_success", restored: !0 });
2102
2260
  return;
2103
2261
  }
2104
- const C = g instanceof B ? g : new B("checkout_failed", "Checkout failed", { cause: g });
2105
- n("error", C), y({ kind: "layout" });
2262
+ const w = f instanceof L ? f : new L("checkout_failed", "Checkout failed", { cause: f });
2263
+ n("error", w), C ? t() : b({ kind: "layout" });
2106
2264
  }
2107
- }, P = (m, g) => {
2265
+ }, R = (x, f) => {
2108
2266
  if (typeof window > "u") return;
2109
- const C = window.open(g, "_blank");
2110
- if (C) {
2267
+ const w = window.open(f, "_blank");
2268
+ if (w) {
2111
2269
  try {
2112
- C.opener = null;
2270
+ w.opener = null;
2113
2271
  } catch {
2114
2272
  }
2115
- y({ kind: "awaiting_payment", priceId: m, url: g });
2273
+ b({ kind: "awaiting_payment", priceId: x, url: f });
2116
2274
  }
2117
2275
  };
2118
- O(() => {
2119
- if (p.kind !== "auth_gate" || !w || w.user.is_anonymous || U.current) return;
2120
- U.current = !0;
2121
- const m = p.pendingCheckout, g = p.origin;
2122
- y({ kind: "verifying" }), (async () => {
2123
- if (!c)
2276
+ P(() => {
2277
+ if (y.kind !== "auth_gate" || !m || m.user.is_anonymous || I.current) return;
2278
+ I.current = !0;
2279
+ const x = y.pendingCheckout, f = y.origin;
2280
+ b({ kind: "verifying" }), (async () => {
2281
+ if (!h)
2124
2282
  try {
2125
2283
  if ((await r.getUser({ force: !0 })).has_active_subscription) {
2126
2284
  n("purchase_completed", {
2127
- priceId: m?.priceId ?? null,
2285
+ priceId: x?.priceId ?? null,
2128
2286
  sessionId: null,
2129
2287
  restored: !0
2130
- }), y({ kind: "purchase_success", restored: !0 });
2288
+ }), x?.direct ? t() : b({ kind: "purchase_success", restored: !0 });
2131
2289
  return;
2132
2290
  }
2133
2291
  } catch {
2134
2292
  }
2135
- if (!m) {
2136
- g === "standalone" ? t() : y({ kind: "layout" });
2293
+ if (!x) {
2294
+ f === "standalone" ? t() : b({ kind: "layout" });
2137
2295
  return;
2138
2296
  }
2139
- await S(m.priceId);
2297
+ await M(x.priceId);
2140
2298
  })().finally(() => {
2141
- U.current = !1;
2299
+ I.current = !1;
2142
2300
  });
2143
- }, [w, p]);
2144
- const M = async (m, g) => {
2145
- if (m === "close") {
2301
+ }, [m, y]);
2302
+ const q = async (x, f) => {
2303
+ if (x === "close") {
2146
2304
  t();
2147
2305
  return;
2148
2306
  }
2149
- if (m === "price_selected") {
2150
- n("price_selected", g);
2307
+ if (x === "price_selected") {
2308
+ n("price_selected", f);
2151
2309
  return;
2152
2310
  }
2153
- if (m === "restore") {
2311
+ if (x === "restore") {
2154
2312
  if (!r.auth) return;
2155
- const C = r.auth.getCachedSession();
2156
- if (C && !C.user.is_anonymous) return;
2157
- y({ kind: "auth_gate", intent: "restore" });
2313
+ const w = r.auth.getCachedSession();
2314
+ if (w && !w.user.is_anonymous) return;
2315
+ b({ kind: "auth_gate", intent: "restore" });
2158
2316
  return;
2159
2317
  }
2160
- if (m === "support") {
2161
- y({ kind: "support", origin: "layout" });
2318
+ if (x === "support") {
2319
+ b({ kind: "support", origin: "layout" });
2162
2320
  return;
2163
2321
  }
2164
- if (m === "checkout" && d.status === "ready") {
2165
- const C = g?.priceId;
2166
- if (!C) {
2167
- n("error", new B("no_price", "No price selected"));
2322
+ if (x === "checkout" && p.status === "ready") {
2323
+ const w = f?.priceId;
2324
+ if (!w) {
2325
+ n("error", new L("no_price", "No price selected"));
2168
2326
  return;
2169
2327
  }
2170
- const I = d.data.settings.checkout_mode ?? "guest", A = r.auth?.getCachedSession() ?? null, V = !!A && !A.user.is_anonymous;
2171
- if (I === "preauth" && !!r.auth && !V) {
2172
- y({ kind: "auth_gate", pendingCheckout: { priceId: C } });
2328
+ const E = p.data.settings.checkout_mode ?? "guest", V = r.auth?.getCachedSession() ?? null, ze = !!V && !V.user.is_anonymous;
2329
+ if (E === "preauth" && !!r.auth && !ze) {
2330
+ b({ kind: "auth_gate", pendingCheckout: { priceId: w } });
2173
2331
  return;
2174
2332
  }
2175
- await S(C);
2333
+ await M(w);
2176
2334
  }
2177
- }, j = d.status === "ready" ? d.data.settings.brand_color : null, T = d.status === "ready" ? d.data.settings.allow_close !== !1 : !0, q = p.kind === "layout" && d.status === "ready" ? Me(d.data.offers) : null, E = q ? /* @__PURE__ */ o(bt, { offer: q }) : null, L = {
2335
+ }, D = p.status === "ready" ? p.data.settings.brand_color : null, B = p.status === "ready" ? p.data.settings.allow_close !== !1 : !0, z = y.kind === "layout" && p.status === "ready" ? Pe(p.data.offers) : null, O = z ? /* @__PURE__ */ o(Tt, { offer: z }) : null, K = {
2178
2336
  type: "auth_panel",
2179
2337
  // Заголовок не задаём — AuthGate сам решит по intent'у (restore →
2180
2338
  // "Restore Purchases", остальные → дефолтный "Welcome back!").
@@ -2183,81 +2341,81 @@ function Qt({
2183
2341
  // Не скрываем при наличии сессии — auto-resume useEffect отрабатывает быстрее,
2184
2342
  // чем хотим показывать "Signed in as ..." промежуточным экраном.
2185
2343
  hide_when_authenticated: !1,
2186
- providers: d.status === "ready" ? d.data.settings.auth_providers : void 0
2187
- }, R = p.kind === "support" ? /* @__PURE__ */ o(
2188
- vt,
2344
+ providers: p.status === "ready" ? p.data.settings.auth_providers : void 0
2345
+ }, H = y.kind === "support" ? /* @__PURE__ */ o(
2346
+ Pt,
2189
2347
  {
2190
2348
  client: r,
2191
- authSession: w,
2192
- origin: p.origin,
2349
+ authSession: m,
2350
+ origin: y.origin,
2193
2351
  onBack: () => {
2194
- p.origin === "standalone" ? t() : y({ kind: "layout" });
2352
+ y.origin === "standalone" ? t() : b({ kind: "layout" });
2195
2353
  }
2196
2354
  }
2197
- ) : null, N = p.kind === "auth_gate" && p.origin !== "standalone" || p.kind === "support", Y = d.status === "ready" ? d.data : null;
2198
- return /* @__PURE__ */ o(Qe, { bootstrap: Y, forceLocale: h, children: /* @__PURE__ */ o(
2199
- et,
2355
+ ) : null, X = y.kind === "auth_gate" && y.origin !== "standalone" || y.kind === "support", J = p.status === "ready" ? p.data : null;
2356
+ return /* @__PURE__ */ o(at, { bootstrap: J, forceLocale: _, children: /* @__PURE__ */ o(
2357
+ lt,
2200
2358
  {
2201
2359
  open: e,
2202
2360
  onClose: t,
2203
- brandColor: j,
2204
- topBanner: E,
2205
- allowClose: T,
2206
- hideCloseButton: N,
2207
- inline: f,
2361
+ brandColor: D,
2362
+ topBanner: O,
2363
+ allowClose: B,
2364
+ hideCloseButton: X,
2365
+ inline: g,
2208
2366
  labelledBy: "pw-title",
2209
- children: a ? /* @__PURE__ */ o(we, { onContinue: t }) : p.kind === "purchase_success" ? /* @__PURE__ */ o(we, { restored: p.restored, onContinue: t }) : R || (d.status === "loading" || d.status === "idle" || p.kind === "verifying" ? /* @__PURE__ */ o(er, { verifying: p.kind === "verifying" }) : d.status === "error" ? /* @__PURE__ */ o(tr, { message: d.error.message }) : p.kind === "auth_gate" && r.auth ? /* @__PURE__ */ o(
2210
- gt,
2367
+ children: c ? /* @__PURE__ */ o(_e, { onContinue: t }) : y.kind === "purchase_success" ? /* @__PURE__ */ o(_e, { restored: y.restored, onContinue: t }) : H || (p.status === "loading" || p.status === "idle" || y.kind === "verifying" ? /* @__PURE__ */ o(dr, { verifying: y.kind === "verifying" }) : p.status === "error" ? /* @__PURE__ */ o(hr, { message: p.error.message }) : y.kind === "auth_gate" && r.auth ? /* @__PURE__ */ o(
2368
+ Ct,
2211
2369
  {
2212
- block: L,
2213
- bootstrap: d.data,
2370
+ block: K,
2371
+ bootstrap: p.data,
2214
2372
  auth: r.auth,
2215
- authSession: w,
2216
- showBack: p.origin !== "standalone",
2217
- intent: p.intent ?? (p.origin === "standalone" ? "standalone" : "preauth"),
2218
- initialMode: p.origin === "standalone" ? s : void 0,
2373
+ authSession: m,
2374
+ showBack: y.origin !== "standalone",
2375
+ intent: y.intent ?? (y.origin === "standalone" ? "standalone" : "preauth"),
2376
+ initialMode: y.origin === "standalone" ? s : void 0,
2219
2377
  onBack: () => {
2220
- p.origin === "standalone" ? t() : y({ kind: "layout" });
2378
+ y.origin === "standalone" ? t() : b({ kind: "layout" });
2221
2379
  }
2222
2380
  }
2223
- ) : p.kind === "awaiting_payment" ? /* @__PURE__ */ o(
2224
- nr,
2381
+ ) : y.kind === "awaiting_payment" ? /* @__PURE__ */ o(
2382
+ fr,
2225
2383
  {
2226
2384
  client: r,
2227
- onBack: () => y({ kind: "layout" }),
2385
+ onBack: () => b({ kind: "layout" }),
2228
2386
  onReopen: () => {
2229
2387
  if (typeof window > "u") return;
2230
- const m = window.open(p.url, "_blank");
2231
- if (m)
2388
+ const x = window.open(y.url, "_blank");
2389
+ if (x)
2232
2390
  try {
2233
- m.opener = null;
2391
+ x.opener = null;
2234
2392
  } catch {
2235
2393
  }
2236
2394
  },
2237
- onRetry: () => S(p.priceId)
2395
+ onRetry: () => M(y.priceId)
2238
2396
  }
2239
- ) : p.kind === "popup_blocked" ? /* @__PURE__ */ o(rr, { onReopen: () => P(p.priceId, p.url) }) : /* @__PURE__ */ o(
2240
- Kt,
2397
+ ) : y.kind === "popup_blocked" ? /* @__PURE__ */ o(pr, { onReopen: () => R(y.priceId, y.url) }) : /* @__PURE__ */ o(
2398
+ ar,
2241
2399
  {
2242
- layout: d.data.layout,
2243
- bootstrap: d.data,
2244
- onAction: M,
2400
+ layout: p.data.layout,
2401
+ bootstrap: p.data,
2402
+ onAction: q,
2245
2403
  auth: r.auth,
2246
- authSession: w
2404
+ authSession: m
2247
2405
  }
2248
2406
  ))
2249
2407
  }
2250
2408
  ) });
2251
2409
  }
2252
- function er({ verifying: r }) {
2253
- const { t: e } = k();
2410
+ function dr({ verifying: r }) {
2411
+ const { t: e } = S();
2254
2412
  return /* @__PURE__ */ u("div", { class: "flex flex-col items-center justify-center gap-3 py-12", children: [
2255
2413
  /* @__PURE__ */ o("span", { class: "inline-block h-7 w-7 animate-spin rounded-full border-[2.5px] border-gray-200 border-t-[var(--pw-accent)]" }),
2256
2414
  /* @__PURE__ */ o("span", { class: "text-xs font-medium tracking-wide text-gray-500", children: r ? e("modal.verifying_subscription", "Checking your subscription…") : e("modal.loading", "Loading…") })
2257
2415
  ] });
2258
2416
  }
2259
- function tr({ message: r }) {
2260
- const { t: e } = k();
2417
+ function hr({ message: r }) {
2418
+ const { t: e } = S();
2261
2419
  return /* @__PURE__ */ u("div", { class: "flex flex-col items-center gap-2 py-8 text-center", children: [
2262
2420
  /* @__PURE__ */ o("div", { class: "flex h-11 w-11 items-center justify-center rounded-full bg-red-50", children: /* @__PURE__ */ u("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
2263
2421
  /* @__PURE__ */ o("path", { d: "M10 6v5M10 14h.01", stroke: "#dc2626", "stroke-width": "2", "stroke-linecap": "round" }),
@@ -2267,61 +2425,96 @@ function tr({ message: r }) {
2267
2425
  /* @__PURE__ */ o("p", { class: "text-xs leading-relaxed text-gray-500", children: r })
2268
2426
  ] });
2269
2427
  }
2270
- function rr({ onReopen: r }) {
2271
- const { t: e } = k();
2428
+ function pr({ onReopen: r }) {
2429
+ const { t: e } = S();
2272
2430
  return /* @__PURE__ */ u("div", { class: "flex flex-col items-center gap-3 py-8 text-center", children: [
2273
2431
  /* @__PURE__ */ o(
2274
2432
  "div",
2275
2433
  {
2276
- class: "flex h-11 w-11 items-center justify-center rounded-full",
2434
+ class: "flex h-14 w-14 items-center justify-center rounded-full",
2277
2435
  style: { background: "color-mix(in srgb, var(--pw-accent) 12%, white)", color: "var(--pw-accent)" },
2278
2436
  "aria-hidden": "true",
2279
- children: /* @__PURE__ */ u("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", children: [
2280
- /* @__PURE__ */ o("path", { d: "M4 5h12v10H4z", stroke: "currentColor", "stroke-width": "1.75", "stroke-linejoin": "round" }),
2281
- /* @__PURE__ */ o("path", { d: "M7 9l3 3 4-5", stroke: "currentColor", "stroke-width": "1.75", "stroke-linecap": "round", "stroke-linejoin": "round" })
2437
+ children: /* @__PURE__ */ u("svg", { width: "26", height: "26", viewBox: "0 0 24 24", fill: "none", children: [
2438
+ /* @__PURE__ */ o(
2439
+ "path",
2440
+ {
2441
+ d: "M14 4h6v6",
2442
+ stroke: "currentColor",
2443
+ "stroke-width": "2",
2444
+ "stroke-linecap": "round",
2445
+ "stroke-linejoin": "round"
2446
+ }
2447
+ ),
2448
+ /* @__PURE__ */ o(
2449
+ "path",
2450
+ {
2451
+ d: "M20 4l-9 9",
2452
+ stroke: "currentColor",
2453
+ "stroke-width": "2",
2454
+ "stroke-linecap": "round",
2455
+ "stroke-linejoin": "round"
2456
+ }
2457
+ ),
2458
+ /* @__PURE__ */ o(
2459
+ "path",
2460
+ {
2461
+ d: "M19 13v5a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2h5",
2462
+ stroke: "currentColor",
2463
+ "stroke-width": "2",
2464
+ "stroke-linecap": "round",
2465
+ "stroke-linejoin": "round"
2466
+ }
2467
+ )
2282
2468
  ] })
2283
2469
  }
2284
2470
  ),
2285
- /* @__PURE__ */ o("p", { class: "text-sm font-semibold tracking-tight text-gray-900", children: e("payment.popup_blocked_title", "Allow popups to continue") }),
2286
- /* @__PURE__ */ o("p", { class: "max-w-[18rem] text-xs leading-relaxed text-gray-500", children: e("payment.popup_blocked_message", "Your browser blocked the checkout tab. Click below to open it.") }),
2471
+ /* @__PURE__ */ o(
2472
+ "p",
2473
+ {
2474
+ id: "pw-title",
2475
+ class: "mt-1 text-lg font-semibold tracking-tight text-gray-900",
2476
+ children: e("payment.popup_blocked_title", "Allow popups to continue")
2477
+ }
2478
+ ),
2479
+ /* @__PURE__ */ o("p", { class: "max-w-[20rem] text-sm leading-relaxed text-gray-500", children: e("payment.popup_blocked_message", "Your browser blocked the checkout tab. Click below to open it.") }),
2287
2480
  /* @__PURE__ */ o(
2288
2481
  "button",
2289
2482
  {
2290
2483
  type: "button",
2291
2484
  onClick: r,
2292
- 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)]",
2485
+ 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)]",
2293
2486
  style: {
2294
2487
  background: "linear-gradient(180deg, color-mix(in srgb, var(--pw-accent) 92%, white), var(--pw-accent))",
2295
- boxShadow: "0 1px 2px rgba(15,23,42,0.08), 0 6px 14px -4px color-mix(in srgb, var(--pw-accent) 50%, transparent)"
2488
+ boxShadow: "0 1px 2px rgba(15,23,42,0.08), 0 8px 20px -6px color-mix(in srgb, var(--pw-accent) 50%, transparent)"
2296
2489
  },
2297
2490
  children: e("payment.open_checkout_button", "Open checkout")
2298
2491
  }
2299
2492
  )
2300
2493
  ] });
2301
2494
  }
2302
- function nr({
2495
+ function fr({
2303
2496
  client: r,
2304
2497
  onBack: e,
2305
2498
  onReopen: t,
2306
2499
  onRetry: n
2307
2500
  }) {
2308
- const { t: i } = k(), [s, a] = x(!1), [c, l] = x(!1), f = z(null);
2309
- O(() => () => {
2310
- f.current !== null && clearTimeout(f.current);
2501
+ const { t: i } = S(), [s, a] = k(!1), [l, c] = k(!1), h = U(null);
2502
+ P(() => () => {
2503
+ h.current !== null && clearTimeout(h.current);
2311
2504
  }, []);
2312
- const h = async () => {
2505
+ const d = async () => {
2313
2506
  if (!s) {
2314
- a(!0), l(!1);
2507
+ a(!0), c(!1);
2315
2508
  try {
2316
2509
  if ((await r.getUser({ force: !0 })).has_active_subscription) {
2317
2510
  typeof window < "u" && window.postMessage({ type: "paywall_purchase" }, "*");
2318
2511
  return;
2319
2512
  }
2320
- l(!0), f.current !== null && clearTimeout(f.current), f.current = setTimeout(() => {
2321
- l(!1), f.current = null;
2513
+ c(!0), h.current !== null && clearTimeout(h.current), h.current = setTimeout(() => {
2514
+ c(!1), h.current = null;
2322
2515
  }, 5e3);
2323
2516
  } catch {
2324
- l(!0);
2517
+ c(!0);
2325
2518
  } finally {
2326
2519
  a(!1);
2327
2520
  }
@@ -2338,7 +2531,7 @@ function nr({
2338
2531
  }
2339
2532
  ),
2340
2533
  /* @__PURE__ */ u("div", { class: "flex flex-col items-center gap-3 py-6 text-center", children: [
2341
- /* @__PURE__ */ u("div", { class: "relative flex h-12 w-12 items-center justify-center", children: [
2534
+ /* @__PURE__ */ u("div", { class: "relative flex h-14 w-14 items-center justify-center", children: [
2342
2535
  /* @__PURE__ */ o(
2343
2536
  "span",
2344
2537
  {
@@ -2347,10 +2540,17 @@ function nr({
2347
2540
  "aria-hidden": "true"
2348
2541
  }
2349
2542
  ),
2350
- /* @__PURE__ */ o("span", { class: "relative inline-block h-7 w-7 animate-spin rounded-full border-[2.5px] border-gray-200 border-t-[var(--pw-accent)]" })
2543
+ /* @__PURE__ */ o("span", { class: "relative inline-block h-8 w-8 animate-spin rounded-full border-[2.5px] border-gray-200 border-t-[var(--pw-accent)]" })
2351
2544
  ] }),
2352
- /* @__PURE__ */ o("p", { class: "text-sm font-semibold tracking-tight text-gray-900", children: i("payment.awaiting_title", "Complete payment in the new tab") }),
2353
- /* @__PURE__ */ o("p", { class: "max-w-[20rem] text-xs leading-relaxed text-gray-500", children: i(
2545
+ /* @__PURE__ */ o(
2546
+ "p",
2547
+ {
2548
+ id: "pw-title",
2549
+ class: "mt-1 text-lg font-semibold tracking-tight text-gray-900",
2550
+ children: i("payment.awaiting_title", "Complete payment in the new tab")
2551
+ }
2552
+ ),
2553
+ /* @__PURE__ */ o("p", { class: "max-w-[22rem] text-sm leading-relaxed text-gray-500", children: i(
2354
2554
  "payment.awaiting_subtitle",
2355
2555
  "We'll detect your payment automatically — or click below once you're done."
2356
2556
  ) }),
@@ -2358,17 +2558,17 @@ function nr({
2358
2558
  "button",
2359
2559
  {
2360
2560
  type: "button",
2361
- onClick: h,
2561
+ onClick: d,
2362
2562
  disabled: s,
2363
- 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)]",
2563
+ 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 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)]",
2364
2564
  style: {
2365
2565
  background: "linear-gradient(180deg, color-mix(in srgb, var(--pw-accent) 92%, white), var(--pw-accent))",
2366
- boxShadow: "0 1px 2px rgba(15,23,42,0.08), 0 6px 14px -4px color-mix(in srgb, var(--pw-accent) 50%, transparent)"
2566
+ boxShadow: "0 1px 2px rgba(15,23,42,0.08), 0 8px 20px -6px color-mix(in srgb, var(--pw-accent) 50%, transparent)"
2367
2567
  },
2368
2568
  children: s ? i("payment.checking", "Checking…") : i("payment.ive_paid", "I've paid")
2369
2569
  }
2370
2570
  ),
2371
- c ? /* @__PURE__ */ o("p", { class: "text-xs leading-relaxed text-gray-500", children: i("payment.still_processing", "Payment is still being processed. Please try again in a moment.") }) : null
2571
+ l ? /* @__PURE__ */ o("p", { class: "text-xs leading-relaxed text-gray-500", children: i("payment.still_processing", "Payment is still being processed. Please try again in a moment.") }) : null
2372
2572
  ] }),
2373
2573
  /* @__PURE__ */ u("div", { class: "rounded-2xl border border-gray-200 bg-gray-50/60 p-3.5", children: [
2374
2574
  /* @__PURE__ */ o("p", { class: "text-xs leading-relaxed text-gray-600", children: i("payment.popup_help_text", "Checkout window didn't open or got blocked? Click here to open it again.") }),
@@ -2393,20 +2593,19 @@ function nr({
2393
2593
  )
2394
2594
  ] });
2395
2595
  }
2396
- function we({
2596
+ function _e({
2397
2597
  onContinue: r,
2398
2598
  restored: e = !1
2399
2599
  }) {
2400
- const { t } = k();
2401
- return /* @__PURE__ */ u("div", { class: "flex flex-col items-center gap-3 py-8 text-center", children: [
2600
+ const { t } = S();
2601
+ return /* @__PURE__ */ u("div", { class: "flex flex-col items-center gap-4 py-6 text-center", children: [
2402
2602
  /* @__PURE__ */ o(
2403
2603
  "div",
2404
2604
  {
2405
- class: "flex h-14 w-14 items-center justify-center rounded-full ring-8",
2605
+ class: "flex h-14 w-14 items-center justify-center rounded-full",
2406
2606
  style: {
2407
2607
  background: "linear-gradient(135deg, #4ade80, #16a34a)",
2408
2608
  color: "#fff",
2409
- // emerald ring with low alpha for a halo effect
2410
2609
  boxShadow: "0 0 0 8px rgba(74,222,128,0.12), 0 8px 20px -6px rgba(22,163,74,0.45)"
2411
2610
  },
2412
2611
  "aria-hidden": "true",
@@ -2422,8 +2621,8 @@ function we({
2422
2621
  ) })
2423
2622
  }
2424
2623
  ),
2425
- /* @__PURE__ */ o("p", { id: "pw-title", class: "mt-1 text-lg font-semibold tracking-tight text-gray-900", children: e ? t("modal.purchase_restored_title", "Subscription restored") : t("modal.purchase_success_title", "Payment received") }),
2426
- /* @__PURE__ */ o("p", { class: "text-sm leading-relaxed text-gray-500", children: e ? t(
2624
+ /* @__PURE__ */ o("p", { id: "pw-title", class: "mt-1 text-3xl font-bold tracking-tight text-gray-900", children: e ? t("modal.purchase_restored_title", "Subscription restored") : t("modal.purchase_success_title", "Payment received") }),
2625
+ /* @__PURE__ */ o("p", { class: "text-base leading-relaxed text-gray-600", children: e ? t(
2427
2626
  "modal.purchase_restored_subtitle",
2428
2627
  "Welcome back — your subscription is already active."
2429
2628
  ) : t("modal.purchase_success_subtitle", "Your subscription is now active.") }),
@@ -2432,27 +2631,27 @@ function we({
2432
2631
  {
2433
2632
  type: "button",
2434
2633
  onClick: r,
2435
- 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)]",
2634
+ class: "pw-cta-shimmer relative mt-2 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] focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",
2436
2635
  style: {
2437
- background: "linear-gradient(180deg, color-mix(in srgb, var(--pw-accent) 92%, white), var(--pw-accent))",
2438
- boxShadow: "0 1px 2px rgba(15,23,42,0.08), 0 8px 20px -6px color-mix(in srgb, var(--pw-accent) 50%, transparent)"
2636
+ 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%)",
2637
+ 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)"
2439
2638
  },
2440
- children: t("modal.continue", "Continue")
2639
+ children: /* @__PURE__ */ o("span", { class: "relative z-10", children: t("modal.continue", "Continue") })
2441
2640
  }
2442
2641
  )
2443
2642
  ] });
2444
2643
  }
2445
- const ir = 10 * 6e4, or = 5e3, sr = 3e4;
2446
- class ar {
2644
+ const gr = 10 * 6e4, mr = 5e3, br = 3e4;
2645
+ class yr {
2447
2646
  constructor(e) {
2448
2647
  this.timer = null, this.timeoutTimer = null, this.visibilityHandler = null, this.focusHandler = null, this.messageHandler = null, this.stopped = !1, this.checking = !1, this.opts = {
2449
2648
  client: e.client,
2450
2649
  onActive: e.onActive,
2451
2650
  onTimeout: e.onTimeout ?? (() => {
2452
2651
  }),
2453
- timeoutMs: e.timeoutMs ?? ir,
2454
- visibleIntervalMs: e.visibleIntervalMs ?? or,
2455
- hiddenIntervalMs: e.hiddenIntervalMs ?? sr
2652
+ timeoutMs: e.timeoutMs ?? gr,
2653
+ visibleIntervalMs: e.visibleIntervalMs ?? mr,
2654
+ hiddenIntervalMs: e.hiddenIntervalMs ?? br
2456
2655
  };
2457
2656
  }
2458
2657
  start() {
@@ -2491,19 +2690,24 @@ class ar {
2491
2690
  !t || typeof t != "object" || t.type === "paywall_purchase" && this.check();
2492
2691
  }
2493
2692
  }
2494
- function lr() {
2693
+ function xr() {
2495
2694
  return !(typeof document > "u" || typeof window > "u" || typeof location < "u" && location.protocol === "chrome-extension:");
2496
2695
  }
2497
- const ie = { open: !1, view: null, error: null }, F = {
2696
+ const ae = {
2697
+ open: !1,
2698
+ view: null,
2699
+ error: null,
2700
+ processing: !1
2701
+ }, F = {
2498
2702
  status: "paywall_status",
2499
2703
  priceId: "paywall_price_id",
2500
2704
  sessionId: "paywall_session_id"
2501
2705
  };
2502
- let cr = class {
2706
+ let wr = class {
2503
2707
  constructor(e) {
2504
- 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 = ie, this.stateListeners = /* @__PURE__ */ new Set();
2505
- const { auth: t, ownsAuth: n } = ur(e);
2506
- this.auth = t, this.ownsAuth = n, this.billing = e.client ?? new Ue({ ...e, auth: this.auth }), this.host = e.host, this.shadowMode = e.shadowMode ?? "closed", this.mountThenLoad = e.mountThenLoad ?? !0, this.inline = e.inline === !0, this.forceLocale = e.locale ?? null, this.userUnsub = this.billing.onUserChange((i) => {
2708
+ 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.lastMountedView = null, this.trialStore = null, this.trialStoreConfig = null, this.lastTrialStatus = null, this.trialExpiredFired = !1, this.lastVisibility = null, this.currentState = ae, this.stateListeners = /* @__PURE__ */ new Set();
2709
+ const { auth: t, ownsAuth: n } = kr(e);
2710
+ this.auth = t, this.ownsAuth = n, this.billing = e.client ?? new qe({ ...e, auth: this.auth }), this.host = e.host, this.shadowMode = e.shadowMode ?? "closed", this.mountThenLoad = e.mountThenLoad ?? !0, this.inline = e.inline === !0, this.forceLocale = e.locale ?? null, this.userUnsub = this.billing.onUserChange((i) => {
2507
2711
  this.emit("userChange", i);
2508
2712
  }), this.auth && (this.authUnsub = this.auth.onAuthChange((i, s) => {
2509
2713
  this.emit("authChange", { event: i, session: s });
@@ -2514,7 +2718,7 @@ let cr = class {
2514
2718
  const t = typeof e == "object" && e !== null ? e : {};
2515
2719
  if (t.enabled === !1) return;
2516
2720
  const n = t.endpoint ?? `${this.billing.apiOrigin}/api/v1/paywall/${this.billing.paywallId}/events`;
2517
- this.tracker = new je({
2721
+ this.tracker = new Ne({
2518
2722
  endpoint: n,
2519
2723
  paywallId: this.billing.paywallId,
2520
2724
  capabilities: this.billing.capabilities,
@@ -2525,14 +2729,15 @@ let cr = class {
2525
2729
  maxBufferSize: t.maxBufferSize,
2526
2730
  fetch: t.fetch,
2527
2731
  sendBeacon: t.sendBeacon
2528
- }), this.on("open", () => this.tracker?.track("paywall_opened")), this.on(
2529
- "ready",
2530
- (i) => this.tracker?.track("paywall_viewed", {
2732
+ }), this.on("open", () => {
2733
+ this.lastMountedView === "layout" && this.tracker?.track("paywall_opened");
2734
+ }), this.on("ready", (i) => {
2735
+ this.lastMountedView === "layout" && this.tracker?.track("paywall_viewed", {
2531
2736
  is_test_mode: i.settings.is_test_mode,
2532
2737
  prices_count: i.prices.length,
2533
2738
  offers_count: i.offers.length
2534
- })
2535
- ), this.on(
2739
+ });
2740
+ }), this.on(
2536
2741
  "price_selected",
2537
2742
  (i) => this.tracker?.track("price_selected", { price_id: i.priceId })
2538
2743
  ), this.on(
@@ -2550,7 +2755,9 @@ let cr = class {
2550
2755
  ), this.on(
2551
2756
  "purchase_failed",
2552
2757
  (i) => this.tracker?.track("purchase_failed", { reason: i.reason })
2553
- ), this.on("close", () => this.tracker?.track("paywall_closed")), this.on(
2758
+ ), this.on("close", () => {
2759
+ this.lastMountedView === "layout" && this.tracker?.track("paywall_closed");
2760
+ }), this.on(
2554
2761
  "trial_blocked",
2555
2762
  (i) => this.tracker?.track("trial_blocked", {
2556
2763
  mode: i.mode,
@@ -2701,6 +2908,188 @@ let cr = class {
2701
2908
  openSignup(e = {}) {
2702
2909
  this.auth && this.openInternal("auth", { ...e, skipTrial: !0, authMode: "signup" });
2703
2910
  }
2911
+ /**
2912
+ * Direct-checkout: создать checkout-URL по конкретной цене и сразу открыть
2913
+ * платёжного провайдера, минуя layout с тарифами. Полезно когда
2914
+ * host-приложение рендерит pricing-карточки/таблицу собственным UI и
2915
+ * хочет, чтобы клик по «Buy / Get this plan» вёл прямо в Stripe/Paddle.
2916
+ *
2917
+ * **Late-mount UX.** В отличие от `open()`, модалка не появляется во время
2918
+ * фоновой работы (bootstrap + visibility/trial gates + createCheckout).
2919
+ * Хост на этой фазе показывает busy-state прямо на своей кнопке (через
2920
+ * `state.processing === true` из `paywall.getState()` — или автоматически
2921
+ * через `<PaywallButton priceId>` в sdk-react). Модалка монтируется
2922
+ * ТОЛЬКО когда реально нужна UI:
2923
+ * - `checkout_mode='preauth'` + managed-auth + не залогинен → auth-gate
2924
+ * (форма signin'а); после успеха auto-resume в createCheckout.
2925
+ * - popup провайдера заблокирован браузером → popup_blocked view с
2926
+ * retry-кнопкой под fresh user gesture.
2927
+ * - popup открылся успешно → awaiting_payment view (индикатор «оплати
2928
+ * в новой вкладке» + I've paid).
2929
+ *
2930
+ * Что эмитится без модалки:
2931
+ * - `purchase_completed{restored:true, priceId}` когда юзер уже подписан
2932
+ * (cached user, fresh bootstrap, или 409 hasActivePurchase от бэка) —
2933
+ * headless reject;
2934
+ * - `error` когда createCheckout упал или identity.email отсутствует;
2935
+ * - `visibility_blocked` / `trial_blocked` — стандартные gate-эвенты.
2936
+ *
2937
+ * Что эмитится одновременно с модалкой:
2938
+ * - `checkout_started{priceId, url, acquiring}` ровно когда headless URL
2939
+ * получен, ДО mount'а awaiting_payment/popup_blocked.
2940
+ *
2941
+ * Offer (countdown-скидка) автоматически резолвится из cached offers'ов
2942
+ * через `getOfferForPrice(priceId)` и передаётся в createCheckout как
2943
+ * `offerId` — чтобы duration_minutes-офферы тоже применились на бэке
2944
+ * (для них нет server-side таймера, без явного offer-id скидка теряется).
2945
+ *
2946
+ * Требования:
2947
+ * - `identity.email` должен быть выставлен (через `opts.identity`, либо
2948
+ * managed-auth, либо ранний `setIdentity`/`paywall.open({identity})`).
2949
+ * Без email бэк `/start-checkout` 400'нёт; SDK эмитнет `error`.
2950
+ * - В `checkout_mode='preauth'` без managed-auth — backend требует
2951
+ * email-юзера; убедись что `identity.email` явно задан.
2952
+ *
2953
+ * Без модалки совсем (когда host рендерит свой awaiting-payment экран) —
2954
+ * используй `paywall.billing.createCheckout({priceId, offerId})` напрямую,
2955
+ * но тогда auth-gate / popup_blocked / awaiting_payment придётся рисовать
2956
+ * самостоятельно.
2957
+ */
2958
+ checkout(e, t = {}) {
2959
+ if (t.identity && this.billing.setIdentity(t.identity), t.renew !== !0 && this.billing.getCachedUser()?.has_active_subscription) {
2960
+ this.emit("purchase_completed", {
2961
+ priceId: e,
2962
+ sessionId: null,
2963
+ restored: !0
2964
+ });
2965
+ return;
2966
+ }
2967
+ this.runDirectCheckout(e, t);
2968
+ }
2969
+ /** Headless prep-work для `checkout(priceId, opts)`: bootstrap → gates →
2970
+ * preauth check → createCheckout → mount модалки с финальным view.
2971
+ * Вынесено отдельным методом ради чистого async/await flow вместо вложенных
2972
+ * then-chain'ов (5+ ветвей). Любая ошибка не пробрасывается наружу: эмитим
2973
+ * через `paywall.emit('error')` и выходим — host подписан на `error`-event. */
2974
+ async runDirectCheckout(e, t) {
2975
+ const n = t.renew === !0, i = t.skipTrial === !0, s = t.skipVisibility === !0;
2976
+ this.applyProcessing(!0);
2977
+ const a = () => {
2978
+ this.applyProcessing(!1);
2979
+ };
2980
+ let l;
2981
+ try {
2982
+ l = await this.billing.bootstrap();
2983
+ } catch (m) {
2984
+ const A = m instanceof L ? m : new L("unknown", "Failed to load paywall", { cause: m });
2985
+ this.emit("error", A), a();
2986
+ return;
2987
+ }
2988
+ if (!s) {
2989
+ const m = l.settings.visibility;
2990
+ if (m && (this.lastVisibility = m, !m.visible)) {
2991
+ this.emit("visibility_blocked", m), a();
2992
+ return;
2993
+ }
2994
+ }
2995
+ if (!i && await this.checkTrialBeforeCheckout(l)) {
2996
+ a();
2997
+ return;
2998
+ }
2999
+ if (!n && l.user?.has_active_subscription) {
3000
+ this.emit("purchase_completed", {
3001
+ priceId: e,
3002
+ sessionId: null,
3003
+ restored: !0
3004
+ }), a();
3005
+ return;
3006
+ }
3007
+ const c = l.settings.checkout_mode ?? "guest", h = this.auth?.getCachedSession() ?? null, d = !!h && !h.user.is_anonymous;
3008
+ if (c === "preauth" && !!this.auth && !d) {
3009
+ this.purchased = !1, this.mountAndShow("auth", {
3010
+ renew: n,
3011
+ authMode: "signin",
3012
+ checkoutPriceId: e
3013
+ });
3014
+ return;
3015
+ }
3016
+ const _ = this.getOfferForPrice(e);
3017
+ let p;
3018
+ try {
3019
+ p = await this.billing.createCheckout({
3020
+ priceId: e,
3021
+ offerId: _?.offer.id,
3022
+ ignoreActivePurchase: n
3023
+ });
3024
+ } catch (m) {
3025
+ if (m instanceof L && m.code === "already_purchased") {
3026
+ try {
3027
+ await this.billing.getUser({ force: !0 });
3028
+ } catch {
3029
+ }
3030
+ this.emit("purchase_completed", {
3031
+ priceId: e,
3032
+ sessionId: null,
3033
+ restored: !0
3034
+ }), a();
3035
+ return;
3036
+ }
3037
+ const A = m instanceof L ? m : new L("checkout_failed", "Checkout failed", { cause: m });
3038
+ this.emit("error", A), a();
3039
+ return;
3040
+ }
3041
+ if (this.emit("checkout_started", {
3042
+ priceId: e,
3043
+ url: p.url,
3044
+ acquiring: p.acquiring
3045
+ }), this.startUserWatcher(), typeof window > "u" || !p.url) {
3046
+ this.mountAndShow("awaiting_payment", {
3047
+ renew: n,
3048
+ checkoutPriceId: e,
3049
+ checkoutUrl: p.url
3050
+ });
3051
+ return;
3052
+ }
3053
+ const v = window.open(p.url, "_blank");
3054
+ if (this.purchased = !1, v) {
3055
+ try {
3056
+ v.opener = null;
3057
+ } catch {
3058
+ }
3059
+ this.mountAndShow("awaiting_payment", {
3060
+ renew: n,
3061
+ checkoutPriceId: e,
3062
+ checkoutUrl: p.url
3063
+ });
3064
+ } else
3065
+ this.mountAndShow("popup_blocked", {
3066
+ renew: n,
3067
+ checkoutPriceId: e,
3068
+ checkoutUrl: p.url
3069
+ });
3070
+ }
3071
+ /** Trial-check без mount'а (для late-mount direct-checkout). Возвращает
3072
+ * true если trial заблокировал — caller должен прекратить flow. На любой
3073
+ * storage-ошибке log+продолжаем (не блокируем продажу). */
3074
+ async checkTrialBeforeCheckout(e) {
3075
+ const t = e.settings.trial;
3076
+ if (!t) return !1;
3077
+ const n = this.ensureTrialStore(t);
3078
+ try {
3079
+ const i = await n.check();
3080
+ if (this.lastTrialStatus = i, i.mode === "none") return !1;
3081
+ if (i.blocked) {
3082
+ const s = await n.recordBlock();
3083
+ return this.lastTrialStatus = s, this.emit("trial_blocked", s), !0;
3084
+ }
3085
+ return this.trialExpiredFired || (this.trialExpiredFired = !0, this.emit("trial_expired")), !1;
3086
+ } catch (i) {
3087
+ return typeof console < "u" && console.warn("[paywall] trial check failed", i), !1;
3088
+ }
3089
+ }
3090
+ applyProcessing(e) {
3091
+ this.currentState.processing !== e && this.applyState({ ...this.currentState, processing: e });
3092
+ }
2704
3093
  /**
2705
3094
  * Headless anonymous signin без открытия модалки. Внутри:
2706
3095
  * idempotent (если уже анон — instant return) → resume через сохранённый
@@ -2714,7 +3103,7 @@ let cr = class {
2714
3103
  */
2715
3104
  signInAnonymously() {
2716
3105
  return this.auth ? this.auth.signInAnonymously() : Promise.reject(
2717
- new B(
3106
+ new L(
2718
3107
  "invalid_config",
2719
3108
  "signInAnonymously requires managed-auth. Pass `auth: true` to PaywallUI."
2720
3109
  )
@@ -2733,11 +3122,13 @@ let cr = class {
2733
3122
  return;
2734
3123
  }
2735
3124
  if (this.mountThenLoad) {
2736
- this.mountAndShow(e, { renew: s }), this.billing.bootstrap().then((c) => this.runDelayedGates(c, { skipTrial: n, skipVisibility: i })).catch(() => {
3125
+ this.mountAndShow(e, { renew: s }), this.billing.bootstrap().then((l) => this.runDelayedGates(l, { skipTrial: n, skipVisibility: i })).catch(() => {
2737
3126
  });
2738
3127
  return;
2739
3128
  }
2740
- this.billing.bootstrap().then((c) => this.runOpenGates(e, c, { skipTrial: n, skipVisibility: i, renew: s })).catch(() => {
3129
+ this.billing.bootstrap().then(
3130
+ (l) => this.runOpenGates(e, l, { skipTrial: n, skipVisibility: i, renew: s })
3131
+ ).catch(() => {
2741
3132
  this.mountAndShow(e, { renew: s });
2742
3133
  });
2743
3134
  }
@@ -2802,8 +3193,8 @@ let cr = class {
2802
3193
  return;
2803
3194
  }
2804
3195
  if (a.blocked) {
2805
- const c = await s.recordBlock();
2806
- this.lastTrialStatus = c, this.emit("trial_blocked", c);
3196
+ const l = await s.recordBlock();
3197
+ this.lastTrialStatus = l, this.emit("trial_blocked", l);
2807
3198
  return;
2808
3199
  }
2809
3200
  this.trialExpiredFired || (this.trialExpiredFired = !0, this.emit("trial_expired")), this.mountAndShow(e, { renew: n });
@@ -2812,38 +3203,43 @@ let cr = class {
2812
3203
  });
2813
3204
  }
2814
3205
  ensureTrialStore(e) {
2815
- if (this.trialStore && this.trialStoreConfig && pr(this.trialStoreConfig, e))
3206
+ if (this.trialStore && this.trialStoreConfig && Sr(this.trialStoreConfig, e))
2816
3207
  return this.trialStore;
2817
3208
  this.trialStoreConfig = e;
2818
3209
  const t = this.billing.createTrialStore;
2819
- return this.trialStore = typeof t == "function" ? t.call(this.billing, e) : Re(this.billing.getStorage(), this.billing.paywallId, e), this.trialStore;
3210
+ return this.trialStore = typeof t == "function" ? t.call(this.billing, e) : Fe(this.billing.getStorage(), this.billing.paywallId, e), this.trialStore;
2820
3211
  }
2821
3212
  mountAndShow(e, t = {}) {
2822
- const n = t.renew === !0, i = t.authMode;
3213
+ this.lastMountedView = e;
3214
+ const n = t.renew === !0, i = t.authMode, a = e === "auth" || e === "awaiting_payment" || e === "popup_blocked" ? t.checkoutPriceId ?? null : null, l = e === "awaiting_payment" || e === "popup_blocked" ? t.checkoutUrl ?? null : null;
2823
3215
  if (this.handle) {
2824
3216
  this.isOpen = !0, this.handle.update({
2825
3217
  open: !0,
2826
3218
  initialView: e,
2827
3219
  initialAuthMode: i,
3220
+ initialCheckoutPriceId: a,
3221
+ initialCheckoutUrl: l,
2828
3222
  purchased: !1,
2829
3223
  renew: n
2830
3224
  }), this.emit("open");
2831
3225
  return;
2832
3226
  }
2833
- this.isOpen = !0, this.handle = We(
2834
- Qt,
3227
+ this.isOpen = !0, this.handle = tt(
3228
+ ur,
2835
3229
  {
2836
3230
  client: this.billing,
2837
3231
  open: !0,
2838
3232
  initialView: e,
2839
3233
  initialAuthMode: i,
3234
+ initialCheckoutPriceId: a,
3235
+ initialCheckoutUrl: l,
2840
3236
  purchased: !1,
2841
3237
  renew: n,
2842
3238
  onClose: () => this.close(),
2843
- onEvent: (s, a) => {
2844
- this.emit(s, a), s === "checkout_started" && this.startUserWatcher();
3239
+ onEvent: (c, h) => {
3240
+ this.emit(c, h), c === "checkout_started" && this.startUserWatcher();
2845
3241
  },
2846
- onState: (s) => this.applyState(s),
3242
+ onState: (c) => this.applyState(c),
2847
3243
  inline: this.inline,
2848
3244
  locale: this.forceLocale
2849
3245
  },
@@ -2851,7 +3247,7 @@ let cr = class {
2851
3247
  ), this.emit("open");
2852
3248
  }
2853
3249
  applyState(e) {
2854
- if (!hr(this.currentState, e)) {
3250
+ if (!_r(this.currentState, e)) {
2855
3251
  this.currentState = e;
2856
3252
  for (const t of this.stateListeners)
2857
3253
  try {
@@ -2929,6 +3325,36 @@ let cr = class {
2929
3325
  getCachedPrices() {
2930
3326
  return this.billing.getCachedPrices();
2931
3327
  }
3328
+ /** Sync-снимок офферов. null = bootstrap не загружали, [] = пейвол без офферов.
3329
+ * Бэк уже применил серверный targeting (страны/email/режим) — наружу
3330
+ * выезжает только то, что применимо к текущему юзеру. */
3331
+ getCachedOffers() {
3332
+ return this.billing.getCachedOffers();
3333
+ }
3334
+ /**
3335
+ * Резолвит активный offer для конкретной цены: price_id-таргетинг +
3336
+ * countdown (`expires_at` ИЛИ `duration_minutes` от первого открытия
3337
+ * пейвола, см. clientStorage `pw-offer-{id}-start`).
3338
+ *
3339
+ * Read-only — НЕ записывает start для `duration_minutes`-офферов. Запись
3340
+ * стартует только когда модалка реально открыта (renderer'ом). До этого
3341
+ * `getOfferForPrice` вернёт `null` для duration-only офферов, чтобы
3342
+ * страницы-хосты вне модалки (pricing, landing) не активировали countdown
3343
+ * раньше времени.
3344
+ *
3345
+ * Хост-странице нужен countdown, который тикает каждую секунду — для
3346
+ * этого использовать React-хук `usePaywallOffer(priceId)` из sdk-react
3347
+ * либо обёртку поверх `setInterval(1000)` + повторный вызов этого метода.
3348
+ */
3349
+ getOfferForPrice(e) {
3350
+ const t = this.billing.getCachedOffers();
3351
+ if (!t) return null;
3352
+ const n = Ce(t, e);
3353
+ return n ? Ie(n, {
3354
+ now: Date.now(),
3355
+ readStart: N
3356
+ }) : null;
3357
+ }
2932
3358
  /** Снимок текущего «языка юзера» — proxy над `billing.getUserLanguage()`.
2933
3359
  * Используй, чтобы синхронизировать i18n host'а с тем, что фактически
2934
3360
  * показывает пейвол. См. подробности в `BillingClient.getUserLanguage`. */
@@ -2977,7 +3403,7 @@ let cr = class {
2977
3403
  user: a
2978
3404
  };
2979
3405
  }
2980
- const n = t.user ?? null;
3406
+ const n = this.billing.getCachedUser() ?? t.user ?? null;
2981
3407
  if (n?.has_active_subscription)
2982
3408
  return {
2983
3409
  access: "granted",
@@ -2999,8 +3425,8 @@ let cr = class {
2999
3425
  try {
3000
3426
  if (s = await this.ensureTrialStore(a).check(), this.lastTrialStatus = s, s.blocked)
3001
3427
  return { access: "granted", reason: "trial_blocked", visibility: i, trial: s, user: n };
3002
- } catch (c) {
3003
- typeof console < "u" && console.warn("[paywall] getAccess: trial check failed", c);
3428
+ } catch (l) {
3429
+ typeof console < "u" && console.warn("[paywall] getAccess: trial check failed", l);
3004
3430
  }
3005
3431
  }
3006
3432
  return { access: "blocked", reason: "no_subscription", visibility: i, trial: s, user: n };
@@ -3017,7 +3443,7 @@ let cr = class {
3017
3443
  // В extension popup runtime — no-op (popup не доживёт). Там полагаемся на
3018
3444
  // bootstrap при следующем открытии.
3019
3445
  startUserWatcher() {
3020
- this.watcher || lr() && (this.watcher = new ar({
3446
+ this.watcher || xr() && (this.watcher = new yr({
3021
3447
  client: this.billing,
3022
3448
  onActive: (e) => {
3023
3449
  this.watcher = null, this.emit("purchase_completed", { priceId: null, sessionId: null });
@@ -3036,7 +3462,7 @@ let cr = class {
3036
3462
  }), this.watcher.start());
3037
3463
  }
3038
3464
  close() {
3039
- !this.isOpen || !this.handle || (this.isOpen = !1, this.purchased = !1, this.handle.update({ open: !1, purchased: !1 }), this.applyState(ie), this.emit("close"));
3465
+ !this.isOpen || !this.handle || (this.isOpen = !1, this.purchased = !1, this.handle.update({ open: !1, purchased: !1 }), this.applyState(ae), this.emit("close"));
3040
3466
  }
3041
3467
  /**
3042
3468
  * Сканирует текущий URL на маркеры возврата с checkout и эмитит
@@ -3046,23 +3472,23 @@ let cr = class {
3046
3472
  */
3047
3473
  checkReturn() {
3048
3474
  if (typeof window > "u") return;
3049
- const e = new URL(window.location.href), t = ke(e.hash.replace(/^#/, "")), n = ke(e.search.replace(/^\?/, "")), i = t ?? n;
3475
+ const e = new URL(window.location.href), t = Se(e.hash.replace(/^#/, "")), n = Se(e.search.replace(/^\?/, "")), i = t ?? n;
3050
3476
  i && (i.status === "paid" ? (this.emit("purchase_completed", {
3051
3477
  priceId: i.priceId,
3052
3478
  sessionId: i.sessionId
3053
- }), fr(i)) : (i.status === "failed" || i.status === "cancelled") && this.emit("purchase_failed", { reason: i.status }), gr(e));
3479
+ }), Cr(i)) : (i.status === "failed" || i.status === "cancelled") && this.emit("purchase_failed", { reason: i.status }), Ir(e));
3054
3480
  }
3055
3481
  destroy() {
3056
- 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 = ie;
3482
+ 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 = ae;
3057
3483
  }
3058
3484
  };
3059
- function ur(r) {
3485
+ function kr(r) {
3060
3486
  if (!r.auth) return { auth: void 0, ownsAuth: !1 };
3061
- if (r.auth instanceof le || dr(r.auth))
3487
+ if (r.auth instanceof de || vr(r.auth))
3062
3488
  return { auth: r.auth, ownsAuth: !1 };
3063
3489
  const e = r.auth === !0 ? {} : r.auth;
3064
3490
  return {
3065
- auth: new le({
3491
+ auth: new de({
3066
3492
  paywallId: r.paywallId,
3067
3493
  apiOrigin: e.apiOrigin ?? r.apiOrigin,
3068
3494
  storage: e.storage ?? r.storage,
@@ -3072,18 +3498,18 @@ function ur(r) {
3072
3498
  ownsAuth: !0
3073
3499
  };
3074
3500
  }
3075
- function dr(r) {
3501
+ function vr(r) {
3076
3502
  if (typeof r != "object" || r === null) return !1;
3077
3503
  const e = r;
3078
3504
  return typeof e.onAuthChange == "function" && typeof e.getCachedSession == "function" && typeof e.signOut == "function";
3079
3505
  }
3080
- function hr(r, e) {
3081
- return r.open === e.open && r.view === e.view && r.error === e.error;
3506
+ function _r(r, e) {
3507
+ return r.open === e.open && r.view === e.view && r.error === e.error && r.processing === e.processing;
3082
3508
  }
3083
- function pr(r, e) {
3509
+ function Sr(r, e) {
3084
3510
  return r.mode === e.mode && r.payload === e.payload && r.storage === e.storage;
3085
3511
  }
3086
- function ke(r) {
3512
+ function Se(r) {
3087
3513
  if (!r) return null;
3088
3514
  const e = new URLSearchParams(r), t = e.get(F.status);
3089
3515
  return t ? {
@@ -3092,7 +3518,7 @@ function ke(r) {
3092
3518
  sessionId: e.get(F.sessionId)
3093
3519
  } : null;
3094
3520
  }
3095
- function fr(r) {
3521
+ function Cr(r) {
3096
3522
  if (!(typeof window > "u" || !window.opener))
3097
3523
  try {
3098
3524
  window.opener.postMessage(
@@ -3107,7 +3533,7 @@ function fr(r) {
3107
3533
  } catch {
3108
3534
  }
3109
3535
  }
3110
- function gr(r) {
3536
+ function Ir(r) {
3111
3537
  const e = (n, i) => {
3112
3538
  if (!n) return "";
3113
3539
  const s = new URLSearchParams(n.replace(/^[?#]/, ""));
@@ -3117,7 +3543,7 @@ function gr(r) {
3117
3543
  }, t = r.pathname + e(r.search, "?") + e(r.hash, "#");
3118
3544
  window.history.replaceState(null, "", t);
3119
3545
  }
3120
- class mr {
3546
+ class Ar {
3121
3547
  constructor(e, t, n) {
3122
3548
  this.transport = e, this.paywallId = t, this.config = n;
3123
3549
  }
@@ -3140,7 +3566,7 @@ class mr {
3140
3566
  });
3141
3567
  }
3142
3568
  }
3143
- class yr {
3569
+ class Lr {
3144
3570
  constructor(e, t) {
3145
3571
  this.transport = e, this.cachedBootstrap = null, this.cachedUser = null, this.cachedBalances = null, this.identity = null, this.userListeners = /* @__PURE__ */ new Set(), this.balanceListeners = /* @__PURE__ */ new Set(), this.bootstrapListeners = /* @__PURE__ */ new Set(), this.unsubUserBroadcast = null, this.unsubBalancesBroadcast = null, this.paywallId = t.paywallId, this.apiOrigin = t.apiOrigin, this.remoteStorageAdapter = {
3146
3572
  getItem: (n) => this.transport.request("storage.get", { key: n }),
@@ -3208,6 +3634,12 @@ class yr {
3208
3634
  getCachedPrices() {
3209
3635
  return this.cachedBootstrap?.prices ?? null;
3210
3636
  }
3637
+ /** Sync-снимок офферов. null = bootstrap не загружали, [] = пейвол без офферов.
3638
+ * Серверный таргетинг (страны/email/режим) уже применён бэком — наружу
3639
+ * выезжает только то, что применимо к текущему юзеру. */
3640
+ getCachedOffers() {
3641
+ return this.cachedBootstrap?.offers ?? null;
3642
+ }
3211
3643
  // === Visitor ===
3212
3644
  async getVisitorId() {
3213
3645
  return this.transport.request("billing.getVisitorId", void 0);
@@ -3321,7 +3753,7 @@ class yr {
3321
3753
  * read-modify-write. PaywallUI duck-types этот метод и предпочитает его
3322
3754
  * локальной фабрике, если он есть. */
3323
3755
  createTrialStore(e) {
3324
- return new mr(this.transport, this.paywallId, e);
3756
+ return new Ar(this.transport, this.paywallId, e);
3325
3757
  }
3326
3758
  // === Identity ===
3327
3759
  getIdentity() {
@@ -3354,10 +3786,10 @@ class yr {
3354
3786
  * broadcast'ов от offscreen — чтобы host'овский onUserChange handler
3355
3787
  * получил signal независимо от того, кто триггернул обновление. */
3356
3788
  applyUser(e) {
3357
- xr(this.cachedUser, e) || (this.cachedUser = e, this.fireUserListeners(e));
3789
+ Mr(this.cachedUser, e) || (this.cachedUser = e, this.fireUserListeners(e));
3358
3790
  }
3359
3791
  applyBalances(e) {
3360
- br(this.cachedBalances, e) || (this.cachedBalances = e, this.fireBalanceListeners(e));
3792
+ Tr(this.cachedBalances, e) || (this.cachedBalances = e, this.fireBalanceListeners(e));
3361
3793
  }
3362
3794
  fireUserListeners(e) {
3363
3795
  for (const t of [...this.userListeners])
@@ -3376,17 +3808,17 @@ class yr {
3376
3808
  }
3377
3809
  }
3378
3810
  }
3379
- function xr(r, e) {
3811
+ function Mr(r, e) {
3380
3812
  return r === e ? !0 : !r || !e ? !1 : r.has_active_subscription === e.has_active_subscription && (r.purchases?.length ?? 0) === (e.purchases?.length ?? 0);
3381
3813
  }
3382
- function br(r, e) {
3814
+ function Tr(r, e) {
3383
3815
  if (r === e) return !0;
3384
3816
  if (!r || !e || r.length !== e.length) return !1;
3385
3817
  for (let t = 0; t < r.length; t++)
3386
3818
  if (r[t].type !== e[t].type || r[t].count !== e[t].count) return !1;
3387
3819
  return !0;
3388
3820
  }
3389
- class wr {
3821
+ class Br {
3390
3822
  constructor(e, t) {
3391
3823
  this.transport = e, this.session = null, this.listeners = /* @__PURE__ */ new Set(), this.unsubBroadcast = null, this.paywallId = t.paywallId, this.apiOrigin = t.apiOrigin, this.unsubBroadcast = this.transport.on("authChange", ({ event: n, session: i }) => {
3392
3824
  this.applySession(n, i);
@@ -3464,12 +3896,12 @@ class wr {
3464
3896
  /** Анонимный sign-in (Supabase user без email). Логика (idempotent-check +
3465
3897
  * resume через сохранённый refresh_token + fresh signin) живёт в
3466
3898
  * offscreen-AuthClient'е — content только проксирует. captchaToken и
3467
- * forceCaptcha — pass-through для forward-compat / switch-account flow. */
3899
+ * forceNewAnon — pass-through для forward-compat / switch-account flow. */
3468
3900
  async signInAnonymously(e = {}) {
3469
3901
  const t = await this.transport.request("auth.signInAnonymously", {
3470
3902
  captchaToken: e.captchaToken,
3471
3903
  userMeta: e.userMeta,
3472
- forceCaptcha: e.forceCaptcha
3904
+ forceNewAnon: e.forceNewAnon
3473
3905
  });
3474
3906
  return this.applySession("SIGNED_IN", t), t;
3475
3907
  }
@@ -3497,14 +3929,14 @@ class wr {
3497
3929
  */
3498
3930
  async signInWithOAuth(e) {
3499
3931
  if (typeof window > "u")
3500
- throw new B("oauth_unavailable", "window is required for OAuth");
3932
+ throw new L("oauth_unavailable", "window is required for OAuth");
3501
3933
  const t = `pw-oauth-pending-${Math.random().toString(36).slice(2, 10)}`, n = window.open("about:blank", t, "width=480,height=640,popup=yes");
3502
3934
  if (!n)
3503
- throw new B(
3935
+ throw new L(
3504
3936
  "popup_blocked",
3505
3937
  "browser blocked auth popup — call from a user gesture"
3506
3938
  );
3507
- _r(n, e.provider);
3939
+ Or(n, e.provider);
3508
3940
  try {
3509
3941
  const { authorizeUrl: i, state: s } = await this.transport.request("auth.oauthStart", {
3510
3942
  provider: e.provider,
@@ -3512,8 +3944,8 @@ class wr {
3512
3944
  userMeta: e.userMeta
3513
3945
  });
3514
3946
  n.name = `pw-oauth-${s}`, n.location.replace(i), e.onPopupOpened?.();
3515
- const a = await ze(n, s), c = await this.transport.request("auth.oauthExchange", { state: s, code: a });
3516
- return this.applySession("SIGNED_IN", c), c;
3947
+ const a = await Ve(n, s), l = await this.transport.request("auth.oauthExchange", { state: s, code: a });
3948
+ return this.applySession("SIGNED_IN", l), l;
3517
3949
  } catch (i) {
3518
3950
  try {
3519
3951
  n.close();
@@ -3526,7 +3958,7 @@ class wr {
3526
3958
  this.unsubBroadcast?.(), this.unsubBroadcast = null, this.listeners.clear(), this.session = null;
3527
3959
  }
3528
3960
  applySession(e, t) {
3529
- if (!kr(this.session, t)) {
3961
+ if (!Er(this.session, t)) {
3530
3962
  this.session = t;
3531
3963
  for (const n of [...this.listeners])
3532
3964
  try {
@@ -3537,17 +3969,17 @@ class wr {
3537
3969
  }
3538
3970
  }
3539
3971
  }
3540
- function kr(r, e) {
3972
+ function Er(r, e) {
3541
3973
  return r === e ? !0 : !r || !e ? !1 : r.access_token === e.access_token && r.refresh_token === e.refresh_token && r.expires_at === e.expires_at && r.user.id === e.user.id;
3542
3974
  }
3543
- const vr = {
3975
+ const Pr = {
3544
3976
  google: "Google",
3545
3977
  apple: "Apple",
3546
3978
  github: "GitHub",
3547
3979
  facebook: "Facebook"
3548
3980
  };
3549
- function _r(r, e) {
3550
- const t = vr[e] ?? e;
3981
+ function Or(r, e) {
3982
+ const t = Pr[e] ?? e;
3551
3983
  try {
3552
3984
  const n = r.document;
3553
3985
  n.title = `Sign in with ${t}`;
@@ -3557,12 +3989,12 @@ function _r(r, e) {
3557
3989
  s.className = "pw-oauth-wrap";
3558
3990
  const a = n.createElement("div");
3559
3991
  a.className = "pw-oauth-spinner";
3560
- const c = n.createElement("div");
3561
- c.className = "pw-oauth-label", c.textContent = `Connecting to ${t}…`, s.appendChild(a), s.appendChild(c), n.body.appendChild(s);
3992
+ const l = n.createElement("div");
3993
+ l.className = "pw-oauth-label", l.textContent = `Connecting to ${t}…`, s.appendChild(a), s.appendChild(l), n.body.appendChild(s);
3562
3994
  } catch {
3563
3995
  }
3564
3996
  }
3565
- class Sr {
3997
+ class jr {
3566
3998
  constructor(e) {
3567
3999
  this.transport = e;
3568
4000
  }
@@ -3574,7 +4006,7 @@ class Sr {
3574
4006
  });
3575
4007
  }
3576
4008
  }
3577
- class Cr {
4009
+ class Ur {
3578
4010
  constructor(e) {
3579
4011
  this.factory = e, this.channel = null, this.channelDisposers = [], this.pending = /* @__PURE__ */ new Map(), this.listeners = /* @__PURE__ */ new Map(), this.destroyed = !1, this.nextId = 0, this.clientId = `c-${Math.random().toString(36).slice(2, 10)}`;
3580
4012
  }
@@ -3588,21 +4020,21 @@ class Cr {
3588
4020
  this.channel = e;
3589
4021
  const t = e.onMessage((i) => this.handleMessage(i)), n = e.onDisconnect(() => this.handleDisconnect());
3590
4022
  return this.channelDisposers = [t, n], this.request("handshake", {
3591
- protocolVersion: K,
4023
+ protocolVersion: Q,
3592
4024
  clientId: this.clientId
3593
4025
  }).then((i) => {
3594
- i.protocolVersion !== K && console.warn(
3595
- `[sdk-extension] protocol version mismatch: client=${K}, offscreen=${i.protocolVersion}. Update host's @monetize.software/sdk-extension.`
4026
+ i.protocolVersion !== Q && console.warn(
4027
+ `[sdk-extension] protocol version mismatch: client=${Q}, offscreen=${i.protocolVersion}. Update host's @monetize.software/sdk-extension.`
3596
4028
  );
3597
4029
  }).catch(() => {
3598
4030
  }), e;
3599
4031
  }
3600
4032
  handleMessage(e) {
3601
- if (Ar(e)) {
4033
+ if (Dr(e)) {
3602
4034
  if (e.type === "response") {
3603
4035
  const t = this.pending.get(e.id);
3604
4036
  if (!t) return;
3605
- this.pending.delete(e.id), t.signal?.removeEventListener("abort", t.abortListener), e.ok ? t.resolve(e.result) : t.reject(De(e.error));
4037
+ this.pending.delete(e.id), t.signal?.removeEventListener("abort", t.abortListener), e.ok ? t.resolve(e.result) : t.reject($e(e.error));
3606
4038
  return;
3607
4039
  }
3608
4040
  if (e.type === "event") {
@@ -3623,7 +4055,7 @@ class Cr {
3623
4055
  const e = Array.from(this.pending.values());
3624
4056
  this.pending.clear();
3625
4057
  for (const t of e)
3626
- t.signal?.removeEventListener("abort", t.abortListener), t.reject(new Ir());
4058
+ t.signal?.removeEventListener("abort", t.abortListener), t.reject(new Rr());
3627
4059
  }
3628
4060
  request(e, t, n = {}) {
3629
4061
  if (this.destroyed)
@@ -3631,31 +4063,31 @@ class Cr {
3631
4063
  if (n.signal?.aborted)
3632
4064
  return Promise.reject(new DOMException("Aborted", "AbortError"));
3633
4065
  const i = this.ensureChannel(), s = `r${++this.nextId}`;
3634
- return new Promise((a, c) => {
3635
- const l = {
4066
+ return new Promise((a, l) => {
4067
+ const c = {
3636
4068
  resolve: a,
3637
- reject: c,
4069
+ reject: l,
3638
4070
  signal: n.signal
3639
4071
  };
3640
- n.signal && (l.abortListener = () => {
4072
+ n.signal && (c.abortListener = () => {
3641
4073
  if (this.pending.delete(s)) {
3642
- c(new DOMException("Aborted", "AbortError"));
4074
+ l(new DOMException("Aborted", "AbortError"));
3643
4075
  try {
3644
4076
  i.send({ type: "cancel", id: s });
3645
4077
  } catch {
3646
4078
  }
3647
4079
  }
3648
- }, n.signal.addEventListener("abort", l.abortListener)), this.pending.set(s, l);
3649
- const f = {
4080
+ }, n.signal.addEventListener("abort", c.abortListener)), this.pending.set(s, c);
4081
+ const h = {
3650
4082
  type: "request",
3651
4083
  id: s,
3652
4084
  kind: e,
3653
4085
  params: t
3654
4086
  };
3655
4087
  try {
3656
- i.send(f);
3657
- } catch (h) {
3658
- this.pending.delete(s), n.signal?.removeEventListener("abort", l.abortListener), c(h);
4088
+ i.send(h);
4089
+ } catch (d) {
4090
+ this.pending.delete(s), n.signal?.removeEventListener("abort", c.abortListener), l(d);
3659
4091
  }
3660
4092
  });
3661
4093
  }
@@ -3679,28 +4111,28 @@ class Cr {
3679
4111
  this.channel?.close(), this.channel = null;
3680
4112
  }
3681
4113
  }
3682
- class Ir extends Error {
4114
+ class Rr extends Error {
3683
4115
  constructor() {
3684
4116
  super("Transport channel disconnected mid-request"), this.code = "transport_disconnected", this.name = "TransportDisconnectedError";
3685
4117
  }
3686
4118
  }
3687
- function Ar(r) {
4119
+ function Dr(r) {
3688
4120
  if (typeof r != "object" || r === null) return !1;
3689
4121
  const e = r.type;
3690
4122
  return e === "request" || e === "response" || e === "event";
3691
4123
  }
3692
- let W = null;
3693
- function Lr() {
3694
- return W || (W = new Cr(() => qe(He)), W);
4124
+ let Z = null;
4125
+ function zr() {
4126
+ return Z || (Z = new Ur(() => He(Ke)), Z);
3695
4127
  }
3696
- class jr extends cr {
4128
+ class Wr extends wr {
3697
4129
  constructor(e) {
3698
- const t = Lr(), n = new yr(t, {
4130
+ const t = zr(), n = new Lr(t, {
3699
4131
  paywallId: e.paywallId,
3700
4132
  apiOrigin: e.apiOrigin
3701
4133
  });
3702
4134
  let i;
3703
- e.auth === !0 ? i = new wr(t, {
4135
+ e.auth === !0 ? i = new Br(t, {
3704
4136
  paywallId: e.paywallId,
3705
4137
  apiOrigin: e.apiOrigin
3706
4138
  }) : e.auth && console.warn(
@@ -3716,7 +4148,7 @@ class jr extends cr {
3716
4148
  // Внутренний EventTracker отключаем — единственный tracker живёт в
3717
4149
  // offscreen'е. Манчиально подписываемся ниже.
3718
4150
  analytics: !1
3719
- }), this.remoteTracker = null, this.trackerUnsubs = [], e.analytics !== !1 && (this.remoteTracker = new Sr(t), this.bindAnalytics());
4151
+ }), this.remoteTracker = null, this.trackerUnsubs = [], e.analytics !== !1 && (this.remoteTracker = new jr(t), this.bindAnalytics());
3720
4152
  }
3721
4153
  /** Зеркало sdk/PaywallUI.initTracker'овских биндингов, но с RemoteEventTracker.
3722
4154
  * Когда @monetize.software/sdk экспоузнет публичный hook для inject'а tracker'а,
@@ -3774,11 +4206,11 @@ class jr extends cr {
3774
4206
  }
3775
4207
  }
3776
4208
  export {
3777
- K as PROTOCOL_VERSION,
3778
- jr as PaywallUI,
3779
- wr as RemoteAuthClient,
3780
- yr as RemoteBillingClient,
3781
- Sr as RemoteEventTracker,
3782
- Lr as getContentTransport
4209
+ Q as PROTOCOL_VERSION,
4210
+ Wr as PaywallUI,
4211
+ Br as RemoteAuthClient,
4212
+ Lr as RemoteBillingClient,
4213
+ jr as RemoteEventTracker,
4214
+ zr as getContentTransport
3783
4215
  };
3784
4216
  //# sourceMappingURL=content.js.map