@monetize.software/sdk-extension 3.0.0-alpha.4 → 3.0.0-alpha.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/ar-BCHXVoE2.js +114 -0
- package/dist/chunks/ar-BCHXVoE2.js.map +1 -0
- package/dist/chunks/ar-CsJNZJSr.js +2 -0
- package/dist/chunks/ar-CsJNZJSr.js.map +1 -0
- package/dist/chunks/{chrome-port-BAMwPMV0.js → chrome-port-CxW3Pwc2.js} +185 -114
- package/dist/chunks/chrome-port-CxW3Pwc2.js.map +1 -0
- package/dist/chunks/chrome-port-PhlW29BV.js +2 -0
- package/dist/chunks/chrome-port-PhlW29BV.js.map +1 -0
- package/dist/chunks/cs-B5NqpTW_.js +110 -0
- package/dist/chunks/cs-B5NqpTW_.js.map +1 -0
- package/dist/chunks/cs-BydWUC0e.js +2 -0
- package/dist/chunks/cs-BydWUC0e.js.map +1 -0
- package/dist/chunks/da-BJrGZ3LD.js +110 -0
- package/dist/chunks/da-BJrGZ3LD.js.map +1 -0
- package/dist/chunks/da-DNhiAQnh.js +2 -0
- package/dist/chunks/da-DNhiAQnh.js.map +1 -0
- package/dist/chunks/de-H8ztFOie.js +2 -0
- package/dist/chunks/de-H8ztFOie.js.map +1 -0
- package/dist/chunks/de-aepBKwsb.js +130 -0
- package/dist/chunks/de-aepBKwsb.js.map +1 -0
- package/dist/chunks/el-DRfoadtI.js +2 -0
- package/dist/chunks/el-DRfoadtI.js.map +1 -0
- package/dist/chunks/el-DTLQoX2D.js +114 -0
- package/dist/chunks/el-DTLQoX2D.js.map +1 -0
- package/dist/chunks/es-CLutF-D_.js +130 -0
- package/dist/chunks/es-CLutF-D_.js.map +1 -0
- package/dist/chunks/es-GlaYesNR.js +2 -0
- package/dist/chunks/es-GlaYesNR.js.map +1 -0
- package/dist/chunks/fi-BIHFyScH.js +2 -0
- package/dist/chunks/fi-BIHFyScH.js.map +1 -0
- package/dist/chunks/fi-DZ4csxqk.js +110 -0
- package/dist/chunks/fi-DZ4csxqk.js.map +1 -0
- package/dist/chunks/fr-BtZILUNZ.js +2 -0
- package/dist/chunks/fr-BtZILUNZ.js.map +1 -0
- package/dist/chunks/fr-jJU1SSpj.js +130 -0
- package/dist/chunks/fr-jJU1SSpj.js.map +1 -0
- package/dist/chunks/he-D9obGPNj.js +114 -0
- package/dist/chunks/he-D9obGPNj.js.map +1 -0
- package/dist/chunks/he-vSDRE4Nn.js +2 -0
- package/dist/chunks/he-vSDRE4Nn.js.map +1 -0
- package/dist/chunks/hi-B90FsnP6.js +2 -0
- package/dist/chunks/hi-B90FsnP6.js.map +1 -0
- package/dist/chunks/hi-pM8SQwZ3.js +114 -0
- package/dist/chunks/hi-pM8SQwZ3.js.map +1 -0
- package/dist/chunks/hu-DWVFODsS.js +2 -0
- package/dist/chunks/hu-DWVFODsS.js.map +1 -0
- package/dist/chunks/hu-E0m9WgbD.js +110 -0
- package/dist/chunks/hu-E0m9WgbD.js.map +1 -0
- package/dist/chunks/id-C6poPvby.js +110 -0
- package/dist/chunks/id-C6poPvby.js.map +1 -0
- package/dist/chunks/id-Ce2gzMVT.js +2 -0
- package/dist/chunks/id-Ce2gzMVT.js.map +1 -0
- package/dist/chunks/it-B2RSFyVd.js +130 -0
- package/dist/chunks/it-B2RSFyVd.js.map +1 -0
- package/dist/chunks/it-u-Gu44bl.js +2 -0
- package/dist/chunks/it-u-Gu44bl.js.map +1 -0
- package/dist/chunks/ja-CM-VgVG6.js +134 -0
- package/dist/chunks/ja-CM-VgVG6.js.map +1 -0
- package/dist/chunks/ja-CQy8RaRa.js +2 -0
- package/dist/chunks/ja-CQy8RaRa.js.map +1 -0
- package/dist/chunks/ko-BRnb7vJ7.js +2 -0
- package/dist/chunks/ko-BRnb7vJ7.js.map +1 -0
- package/dist/chunks/ko-C451fA21.js +134 -0
- package/dist/chunks/ko-C451fA21.js.map +1 -0
- package/dist/chunks/nl-CJelco6J.js +2 -0
- package/dist/chunks/nl-CJelco6J.js.map +1 -0
- package/dist/chunks/nl-DzQfJPo2.js +130 -0
- package/dist/chunks/nl-DzQfJPo2.js.map +1 -0
- package/dist/chunks/no-B51be8KT.js +110 -0
- package/dist/chunks/no-B51be8KT.js.map +1 -0
- package/dist/chunks/no-BwTjSZ4K.js +2 -0
- package/dist/chunks/no-BwTjSZ4K.js.map +1 -0
- package/dist/chunks/pl-5rTEkvfY.js +110 -0
- package/dist/chunks/pl-5rTEkvfY.js.map +1 -0
- package/dist/chunks/pl-kO82vcjb.js +2 -0
- package/dist/chunks/pl-kO82vcjb.js.map +1 -0
- package/dist/chunks/pt-CsJzaSjg.js +2 -0
- package/dist/chunks/pt-CsJzaSjg.js.map +1 -0
- package/dist/chunks/pt-JwqffZ9u.js +130 -0
- package/dist/chunks/pt-JwqffZ9u.js.map +1 -0
- package/dist/chunks/ro-BE_wJ1td.js +110 -0
- package/dist/chunks/ro-BE_wJ1td.js.map +1 -0
- package/dist/chunks/ro-ue15Ina4.js +2 -0
- package/dist/chunks/ro-ue15Ina4.js.map +1 -0
- package/dist/chunks/ru-B1iMOhX0.js +2 -0
- package/dist/chunks/ru-B1iMOhX0.js.map +1 -0
- package/dist/chunks/ru-BviATvLb.js +124 -0
- package/dist/chunks/ru-BviATvLb.js.map +1 -0
- package/dist/chunks/sv-CkNYpUVy.js +2 -0
- package/dist/chunks/sv-CkNYpUVy.js.map +1 -0
- package/dist/chunks/sv-DabGF9WL.js +110 -0
- package/dist/chunks/sv-DabGF9WL.js.map +1 -0
- package/dist/chunks/th-BiF-bNo0.js +114 -0
- package/dist/chunks/th-BiF-bNo0.js.map +1 -0
- package/dist/chunks/th-Cu80HK4y.js +2 -0
- package/dist/chunks/th-Cu80HK4y.js.map +1 -0
- package/dist/chunks/tr-B7c0afXV.js +2 -0
- package/dist/chunks/tr-B7c0afXV.js.map +1 -0
- package/dist/chunks/tr-xZuly8X8.js +110 -0
- package/dist/chunks/tr-xZuly8X8.js.map +1 -0
- package/dist/chunks/uk-BO106B0H.js +2 -0
- package/dist/chunks/uk-BO106B0H.js.map +1 -0
- package/dist/chunks/uk-KlkAaHuy.js +124 -0
- package/dist/chunks/uk-KlkAaHuy.js.map +1 -0
- package/dist/chunks/vi-BVCeumNE.js +110 -0
- package/dist/chunks/vi-BVCeumNE.js.map +1 -0
- package/dist/chunks/vi-CZ6ow40D.js +2 -0
- package/dist/chunks/vi-CZ6ow40D.js.map +1 -0
- package/dist/chunks/zh-BhP80WI1.js +2 -0
- package/dist/chunks/zh-BhP80WI1.js.map +1 -0
- package/dist/chunks/zh-C_ghwmqi.js +134 -0
- package/dist/chunks/zh-C_ghwmqi.js.map +1 -0
- package/dist/content/RemoteAuthClient.d.ts +5 -1
- package/dist/content/RemoteAuthClient.d.ts.map +1 -1
- package/dist/content/RemoteAuthClient.test-d.d.ts +2 -0
- package/dist/content/RemoteAuthClient.test-d.d.ts.map +1 -0
- package/dist/content/RemoteBillingClient.d.ts +29 -0
- package/dist/content/RemoteBillingClient.d.ts.map +1 -1
- package/dist/content/RemoteBillingClient.test-d.d.ts +2 -0
- package/dist/content/RemoteBillingClient.test-d.d.ts.map +1 -0
- package/dist/content.cjs +3 -3
- package/dist/content.cjs.map +1 -1
- package/dist/content.js +2260 -1237
- package/dist/content.js.map +1 -1
- package/dist/offscreen/server.d.ts.map +1 -1
- package/dist/offscreen.cjs +1 -1
- package/dist/offscreen.cjs.map +1 -1
- package/dist/offscreen.js +5 -2
- package/dist/offscreen.js.map +1 -1
- package/dist/shared/messages.d.ts +21 -1
- package/dist/shared/messages.d.ts.map +1 -1
- package/dist/shared/protocol.d.ts +1 -1
- package/dist/shared/protocol.d.ts.map +1 -1
- package/package.json +7 -6
- package/dist/chunks/chrome-port-BAMwPMV0.js.map +0 -1
- package/dist/chunks/chrome-port-CdxuZ1ND.js +0 -2
- package/dist/chunks/chrome-port-CdxuZ1ND.js.map +0 -1
package/dist/content.js
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
import { P as
|
|
2
|
-
import { render as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { P as
|
|
6
|
-
const oe = '@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}*,*:before,*:after{box-sizing:border-box}button{font-family:inherit;cursor:pointer}button:disabled{cursor:not-allowed}[role=button],[role=radio]{cursor:pointer}}';
|
|
7
|
-
let
|
|
8
|
-
function
|
|
9
|
-
if (
|
|
10
|
-
let
|
|
1
|
+
import { P as U, B as Ue, E as je, c as Re, A as ue, w as ze, a as Y, r as De, b as qe } from "./chunks/chrome-port-CxW3Pwc2.js";
|
|
2
|
+
import { render as K, h as de, createContext as Ne } from "preact";
|
|
3
|
+
import { jsx as o, jsxs as c, Fragment as W } from "preact/jsx-runtime";
|
|
4
|
+
import { useState as x, useEffect as B, useContext as Fe, useRef as R, useMemo as ve, useLayoutEffect as Ve } from "preact/hooks";
|
|
5
|
+
import { P as $e } from "./chunks/port-name-BPfQKtdb.js";
|
|
6
|
+
const _e = '@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 he = !1;
|
|
8
|
+
function He() {
|
|
9
|
+
if (he || (he = !0, typeof CSS > "u" || typeof CSS.registerProperty != "function")) return;
|
|
10
|
+
let t;
|
|
11
11
|
try {
|
|
12
12
|
const e = new CSSStyleSheet();
|
|
13
|
-
e.replaceSync(
|
|
13
|
+
e.replaceSync(_e), t = e.cssRules;
|
|
14
14
|
} catch {
|
|
15
15
|
return;
|
|
16
16
|
}
|
|
17
|
-
for (const e of
|
|
17
|
+
for (const e of t) {
|
|
18
18
|
if (e.constructor.name !== "CSSPropertyRule") continue;
|
|
19
|
-
const
|
|
19
|
+
const n = e;
|
|
20
20
|
try {
|
|
21
21
|
CSS.registerProperty({
|
|
22
|
-
name:
|
|
23
|
-
syntax:
|
|
24
|
-
inherits:
|
|
25
|
-
...
|
|
22
|
+
name: n.name,
|
|
23
|
+
syntax: n.syntax,
|
|
24
|
+
inherits: n.inherits,
|
|
25
|
+
...n.initialValue != null ? { initialValue: n.initialValue } : {}
|
|
26
26
|
});
|
|
27
27
|
} catch {
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function Ge(t, e, n = {}) {
|
|
32
32
|
if (typeof document > "u")
|
|
33
33
|
throw new Error("mountShadow called in non-DOM environment");
|
|
34
|
-
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
const i =
|
|
34
|
+
He();
|
|
35
|
+
const r = n.host ?? document.createElement("div");
|
|
36
|
+
r.setAttribute("data-paywall-host", ""), r.style.cssText = n.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;", !r.isConnected && !n.inline && document.body.appendChild(r);
|
|
37
|
+
const i = r.attachShadow({ mode: n.shadowMode ?? "closed" }), s = `
|
|
38
38
|
:host {
|
|
39
39
|
all: initial !important;
|
|
40
40
|
display: block !important;
|
|
@@ -52,125 +52,223 @@ function me(r, e, t = {}) {
|
|
|
52
52
|
cursor: auto !important;
|
|
53
53
|
visibility: visible !important;
|
|
54
54
|
}
|
|
55
|
-
`,
|
|
56
|
-
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
let
|
|
60
|
-
return
|
|
55
|
+
`, a = document.createElement("style");
|
|
56
|
+
a.textContent = s + _e + (n.injectCss ?? ""), i.appendChild(a);
|
|
57
|
+
const l = document.createElement("div");
|
|
58
|
+
l.style.pointerEvents = "auto", i.appendChild(l);
|
|
59
|
+
let d = e;
|
|
60
|
+
return K(de(t, d), l), {
|
|
61
61
|
shadowRoot: i,
|
|
62
|
-
update(
|
|
63
|
-
|
|
62
|
+
update(u) {
|
|
63
|
+
d = { ...d, ...u }, K(de(t, d), l);
|
|
64
64
|
},
|
|
65
65
|
unmount() {
|
|
66
|
-
|
|
66
|
+
K(null, l), r.remove();
|
|
67
67
|
}
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
|
|
70
|
+
const We = (t, e, n) => {
|
|
71
|
+
const r = t[e];
|
|
72
|
+
return r ? typeof r == "function" ? r() : Promise.resolve(r) : new Promise((i, s) => {
|
|
73
|
+
(typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(
|
|
74
|
+
s.bind(
|
|
75
|
+
null,
|
|
76
|
+
new Error(
|
|
77
|
+
"Unknown variable dynamic import: " + e + (e.split("/").length !== n ? ". Note that variables only represent file names one level deep." : "")
|
|
78
|
+
)
|
|
79
|
+
)
|
|
80
|
+
);
|
|
81
|
+
});
|
|
82
|
+
}, Ze = [
|
|
83
|
+
"ru",
|
|
84
|
+
"uk",
|
|
85
|
+
"de",
|
|
86
|
+
"es",
|
|
87
|
+
"fr",
|
|
88
|
+
"it",
|
|
89
|
+
"pt",
|
|
90
|
+
"pl",
|
|
91
|
+
"cs",
|
|
92
|
+
"hu",
|
|
93
|
+
"ro",
|
|
94
|
+
"nl",
|
|
95
|
+
"sv",
|
|
96
|
+
"da",
|
|
97
|
+
"no",
|
|
98
|
+
"fi",
|
|
99
|
+
"el",
|
|
100
|
+
"tr",
|
|
101
|
+
"id",
|
|
102
|
+
"ar",
|
|
103
|
+
"ja",
|
|
104
|
+
"ko",
|
|
105
|
+
"zh",
|
|
106
|
+
"hi",
|
|
107
|
+
"th",
|
|
108
|
+
"vi",
|
|
109
|
+
"he"
|
|
110
|
+
], Se = (t, e, n) => Ie(e, n), Ce = Ne({ t: Se, locale: "en" });
|
|
111
|
+
function Ie(t, e) {
|
|
112
|
+
if (!e) return t;
|
|
113
|
+
let n = t;
|
|
114
|
+
for (const [r, i] of Object.entries(e))
|
|
115
|
+
n = n.split(`{${r}}`).join(String(i));
|
|
116
|
+
return n;
|
|
117
|
+
}
|
|
118
|
+
const X = /* @__PURE__ */ new Map(), J = /* @__PURE__ */ new Map();
|
|
119
|
+
function Ye(t) {
|
|
120
|
+
return Ze.includes(t);
|
|
121
|
+
}
|
|
122
|
+
function Ke(t) {
|
|
123
|
+
const e = [];
|
|
124
|
+
if (typeof navigator < "u" && navigator.language) {
|
|
125
|
+
e.push(navigator.language);
|
|
126
|
+
const r = navigator.language.split("-")[0];
|
|
127
|
+
r && r !== navigator.language && e.push(r);
|
|
128
|
+
}
|
|
129
|
+
const n = t.settings.locale_default;
|
|
130
|
+
if (n) {
|
|
131
|
+
e.push(n);
|
|
132
|
+
const r = n.split("-")[0];
|
|
133
|
+
r && r !== n && e.push(r);
|
|
134
|
+
}
|
|
135
|
+
for (const r of e)
|
|
136
|
+
if (Ye(r)) return r;
|
|
137
|
+
return null;
|
|
138
|
+
}
|
|
139
|
+
function Xe(t) {
|
|
140
|
+
return !!t.locales && Object.keys(t.locales).length > 0;
|
|
141
|
+
}
|
|
142
|
+
async function Je(t) {
|
|
143
|
+
const e = X.get(t);
|
|
144
|
+
if (e) return e;
|
|
145
|
+
const n = J.get(t);
|
|
146
|
+
if (n) return n;
|
|
147
|
+
const r = We(/* @__PURE__ */ Object.assign({ "./locales/ar.ts": () => import("./chunks/ar-BCHXVoE2.js"), "./locales/cs.ts": () => import("./chunks/cs-B5NqpTW_.js"), "./locales/da.ts": () => import("./chunks/da-BJrGZ3LD.js"), "./locales/de.ts": () => import("./chunks/de-aepBKwsb.js"), "./locales/el.ts": () => import("./chunks/el-DTLQoX2D.js"), "./locales/es.ts": () => import("./chunks/es-CLutF-D_.js"), "./locales/fi.ts": () => import("./chunks/fi-DZ4csxqk.js"), "./locales/fr.ts": () => import("./chunks/fr-jJU1SSpj.js"), "./locales/he.ts": () => import("./chunks/he-D9obGPNj.js"), "./locales/hi.ts": () => import("./chunks/hi-pM8SQwZ3.js"), "./locales/hu.ts": () => import("./chunks/hu-E0m9WgbD.js"), "./locales/id.ts": () => import("./chunks/id-C6poPvby.js"), "./locales/it.ts": () => import("./chunks/it-B2RSFyVd.js"), "./locales/ja.ts": () => import("./chunks/ja-CM-VgVG6.js"), "./locales/ko.ts": () => import("./chunks/ko-C451fA21.js"), "./locales/nl.ts": () => import("./chunks/nl-DzQfJPo2.js"), "./locales/no.ts": () => import("./chunks/no-B51be8KT.js"), "./locales/pl.ts": () => import("./chunks/pl-5rTEkvfY.js"), "./locales/pt.ts": () => import("./chunks/pt-JwqffZ9u.js"), "./locales/ro.ts": () => import("./chunks/ro-BE_wJ1td.js"), "./locales/ru.ts": () => import("./chunks/ru-BviATvLb.js"), "./locales/sv.ts": () => import("./chunks/sv-DabGF9WL.js"), "./locales/th.ts": () => import("./chunks/th-BiF-bNo0.js"), "./locales/tr.ts": () => import("./chunks/tr-xZuly8X8.js"), "./locales/uk.ts": () => import("./chunks/uk-KlkAaHuy.js"), "./locales/vi.ts": () => import("./chunks/vi-BVCeumNE.js"), "./locales/zh.ts": () => import("./chunks/zh-C_ghwmqi.js") }), `./locales/${t}.ts`, 3).then((i) => {
|
|
148
|
+
const s = i.default ?? {};
|
|
149
|
+
return X.set(t, s), s;
|
|
150
|
+
}).catch((i) => {
|
|
151
|
+
console.warn(`[paywall] failed to load locale chunk "${t}"`, i);
|
|
152
|
+
const s = {};
|
|
153
|
+
return X.set(t, s), s;
|
|
154
|
+
}).finally(() => {
|
|
155
|
+
J.delete(t);
|
|
156
|
+
});
|
|
157
|
+
return J.set(t, r), r;
|
|
158
|
+
}
|
|
159
|
+
function Qe({ bootstrap: t, children: e }) {
|
|
160
|
+
const [n, r] = x("en"), [i, s] = x(null);
|
|
161
|
+
B(() => {
|
|
162
|
+
if (!t || !Xe(t)) return;
|
|
163
|
+
const l = Ke(t);
|
|
164
|
+
if (!l || l === n && i) return;
|
|
165
|
+
let d = !1;
|
|
166
|
+
return Je(l).then((u) => {
|
|
167
|
+
d || (r(l), s(u));
|
|
168
|
+
}), () => {
|
|
169
|
+
d = !0;
|
|
170
|
+
};
|
|
171
|
+
}, [t]);
|
|
172
|
+
const a = {
|
|
173
|
+
locale: n,
|
|
174
|
+
t: i ? (l, d, u) => Ie(i[l] ?? d, u) : Se
|
|
175
|
+
};
|
|
176
|
+
return /* @__PURE__ */ o(Ce.Provider, { value: a, children: e });
|
|
177
|
+
}
|
|
178
|
+
function w() {
|
|
179
|
+
return Fe(Ce);
|
|
180
|
+
}
|
|
181
|
+
const pe = 'a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';
|
|
182
|
+
function et({
|
|
183
|
+
open: t,
|
|
73
184
|
onClose: e,
|
|
74
|
-
labelledBy:
|
|
75
|
-
brandColor:
|
|
76
|
-
|
|
185
|
+
labelledBy: n,
|
|
186
|
+
brandColor: r,
|
|
187
|
+
topBanner: i,
|
|
77
188
|
allowClose: s = !0,
|
|
189
|
+
hideCloseButton: a = !1,
|
|
78
190
|
inline: l = !1,
|
|
79
|
-
children:
|
|
191
|
+
children: d
|
|
80
192
|
}) {
|
|
81
|
-
const
|
|
82
|
-
return
|
|
83
|
-
if (!
|
|
84
|
-
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
const
|
|
193
|
+
const { t: u } = w(), p = R(null), f = R(null);
|
|
194
|
+
return B(() => {
|
|
195
|
+
if (!t) return;
|
|
196
|
+
f.current = document.activeElement ?? null;
|
|
197
|
+
const k = p.current;
|
|
198
|
+
k && (k.querySelector(pe) ?? k).focus({ preventScroll: !0 });
|
|
199
|
+
const j = (v) => {
|
|
88
200
|
if (v.key === "Escape") {
|
|
89
201
|
if (!s) return;
|
|
90
202
|
v.stopPropagation(), e();
|
|
91
203
|
return;
|
|
92
204
|
}
|
|
93
|
-
if (v.key !== "Tab" || !
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
).filter((
|
|
97
|
-
if (
|
|
205
|
+
if (v.key !== "Tab" || !p.current) return;
|
|
206
|
+
const L = Array.from(
|
|
207
|
+
p.current.querySelectorAll(pe)
|
|
208
|
+
).filter((M) => !M.hasAttribute("disabled") && M.tabIndex !== -1);
|
|
209
|
+
if (L.length === 0) {
|
|
98
210
|
v.preventDefault();
|
|
99
211
|
return;
|
|
100
212
|
}
|
|
101
|
-
const
|
|
102
|
-
v.shiftKey &&
|
|
213
|
+
const C = L[0], P = L[L.length - 1], O = document.activeElement;
|
|
214
|
+
v.shiftKey && O === C ? (v.preventDefault(), P.focus()) : !v.shiftKey && O === P && (v.preventDefault(), C.focus());
|
|
103
215
|
};
|
|
104
|
-
document.addEventListener("keydown",
|
|
105
|
-
const
|
|
216
|
+
document.addEventListener("keydown", j, !0);
|
|
217
|
+
const T = document.body.style.overflow;
|
|
106
218
|
return l || (document.body.style.overflow = "hidden"), () => {
|
|
107
|
-
document.removeEventListener("keydown",
|
|
219
|
+
document.removeEventListener("keydown", j, !0), l || (document.body.style.overflow = T), f.current?.focus?.({ preventScroll: !0 });
|
|
108
220
|
};
|
|
109
|
-
}, [
|
|
221
|
+
}, [t, e, s, l]), t ? /* @__PURE__ */ c(
|
|
110
222
|
"div",
|
|
111
223
|
{
|
|
112
224
|
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]`,
|
|
113
|
-
onClick: (
|
|
114
|
-
s &&
|
|
225
|
+
onClick: (k) => {
|
|
226
|
+
s && k.target === k.currentTarget && e();
|
|
115
227
|
},
|
|
116
228
|
"data-pw-root": !0,
|
|
117
229
|
children: [
|
|
118
|
-
/* @__PURE__ */
|
|
230
|
+
/* @__PURE__ */ c(
|
|
119
231
|
"div",
|
|
120
232
|
{
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
"aria-modal": "true",
|
|
124
|
-
"aria-labelledby": t,
|
|
125
|
-
tabIndex: -1,
|
|
126
|
-
class: "relative flex max-h-[calc(100dvh-1rem)] sm:max-h-[calc(100dvh-2rem)] w-full max-w-md flex-col overflow-hidden rounded-3xl bg-white outline-none ring-1 ring-black/5 animate-[pw-scale-in_220ms_cubic-bezier(0.16,1,0.3,1)]",
|
|
127
|
-
style: {
|
|
128
|
-
"--pw-accent": n ?? "#3b82f6",
|
|
129
|
-
boxShadow: "0 1px 2px rgba(15,23,42,0.04), 0 12px 32px -8px rgba(15,23,42,0.18), 0 24px 64px -16px rgba(15,23,42,0.22)"
|
|
130
|
-
},
|
|
233
|
+
class: "relative flex w-full max-w-[400px] flex-col animate-[pw-scale-in_220ms_cubic-bezier(0.16,1,0.3,1)]",
|
|
234
|
+
style: { "--pw-accent": r ?? "#3b82f6" },
|
|
131
235
|
children: [
|
|
132
|
-
i
|
|
236
|
+
i,
|
|
237
|
+
/* @__PURE__ */ c(
|
|
133
238
|
"div",
|
|
134
239
|
{
|
|
135
|
-
|
|
136
|
-
role: "
|
|
240
|
+
ref: p,
|
|
241
|
+
role: "dialog",
|
|
242
|
+
"aria-modal": "true",
|
|
243
|
+
"aria-labelledby": n,
|
|
244
|
+
tabIndex: -1,
|
|
245
|
+
class: "relative flex max-h-[calc(100dvh-1rem)] sm:max-h-[calc(100dvh-2rem)] w-full flex-col overflow-hidden rounded-xl bg-white outline-none",
|
|
246
|
+
style: {
|
|
247
|
+
boxShadow: "0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1)"
|
|
248
|
+
},
|
|
137
249
|
children: [
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
250
|
+
d,
|
|
251
|
+
s && !a ? /* @__PURE__ */ o(
|
|
252
|
+
"button",
|
|
253
|
+
{
|
|
254
|
+
type: "button",
|
|
255
|
+
onClick: e,
|
|
256
|
+
"aria-label": u("modal.close_aria", "Close"),
|
|
257
|
+
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)]",
|
|
258
|
+
children: /* @__PURE__ */ o("svg", { width: "14", height: "14", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ o(
|
|
259
|
+
"path",
|
|
260
|
+
{
|
|
261
|
+
d: "M3 3l10 10M13 3L3 13",
|
|
262
|
+
stroke: "currentColor",
|
|
263
|
+
"stroke-width": "1.75",
|
|
264
|
+
"stroke-linecap": "round"
|
|
265
|
+
}
|
|
266
|
+
) })
|
|
267
|
+
}
|
|
268
|
+
) : null
|
|
152
269
|
]
|
|
153
270
|
}
|
|
154
|
-
)
|
|
155
|
-
/* @__PURE__ */ o("div", { class: "flex-1 overflow-y-auto p-7", children: a }),
|
|
156
|
-
s ? /* @__PURE__ */ o(
|
|
157
|
-
"button",
|
|
158
|
-
{
|
|
159
|
-
type: "button",
|
|
160
|
-
onClick: e,
|
|
161
|
-
"aria-label": "Close",
|
|
162
|
-
class: `absolute right-3 ${i ? "top-10" : "top-3"} z-10 flex h-8 w-8 items-center justify-center rounded-full bg-white/80 text-gray-400 backdrop-blur-sm transition-colors hover:bg-gray-100 hover:text-gray-700 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]`,
|
|
163
|
-
children: /* @__PURE__ */ o("svg", { width: "14", height: "14", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ o(
|
|
164
|
-
"path",
|
|
165
|
-
{
|
|
166
|
-
d: "M3 3l10 10M13 3L3 13",
|
|
167
|
-
stroke: "currentColor",
|
|
168
|
-
"stroke-width": "1.75",
|
|
169
|
-
"stroke-linecap": "round"
|
|
170
|
-
}
|
|
171
|
-
) })
|
|
172
|
-
}
|
|
173
|
-
) : null
|
|
271
|
+
)
|
|
174
272
|
]
|
|
175
273
|
}
|
|
176
274
|
),
|
|
@@ -185,33 +283,40 @@ function ye({
|
|
|
185
283
|
}
|
|
186
284
|
) : null;
|
|
187
285
|
}
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
286
|
+
function tt(t, e) {
|
|
287
|
+
switch (t) {
|
|
288
|
+
case "google":
|
|
289
|
+
return e("auth.continue_with_google", "Continue with Google");
|
|
290
|
+
case "apple":
|
|
291
|
+
return e("auth.continue_with_apple", "Continue with Apple");
|
|
292
|
+
case "github":
|
|
293
|
+
return e("auth.continue_with_github", "Continue with GitHub");
|
|
294
|
+
case "facebook":
|
|
295
|
+
return e("auth.continue_with_facebook", "Continue with Facebook");
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
function Le({ block: t, ctx: e }) {
|
|
299
|
+
const n = e.auth, r = e.authSession, i = t.allow_signup !== !1, s = t.allow_password_reset !== !1, a = t.hide_when_authenticated !== !1;
|
|
300
|
+
if (!n)
|
|
197
301
|
return typeof console < "u" && console.warn("[paywall] auth_panel rendered without AuthClient — pass `auth: true` to PaywallUI"), null;
|
|
198
|
-
const
|
|
199
|
-
return
|
|
302
|
+
const l = r && !r.user.is_anonymous ? r : null;
|
|
303
|
+
return l && a ? null : l ? /* @__PURE__ */ o(nt, { email: l.user.email ?? "", onSignOut: () => n.signOut().catch(() => {
|
|
200
304
|
}) }) : /* @__PURE__ */ o(
|
|
201
|
-
|
|
305
|
+
rt,
|
|
202
306
|
{
|
|
203
|
-
block:
|
|
307
|
+
block: t,
|
|
204
308
|
allowSignup: i,
|
|
205
309
|
allowReset: s,
|
|
206
310
|
ctx: e
|
|
207
311
|
}
|
|
208
312
|
);
|
|
209
313
|
}
|
|
210
|
-
function
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
/* @__PURE__ */ o("span", { class: "text-
|
|
314
|
+
function nt({ email: t, onSignOut: e }) {
|
|
315
|
+
const { t: n } = w();
|
|
316
|
+
return /* @__PURE__ */ c("div", { class: "flex items-center justify-between gap-3 rounded-2xl bg-gray-100 px-4 py-3", children: [
|
|
317
|
+
/* @__PURE__ */ c("div", { class: "flex flex-col", children: [
|
|
318
|
+
/* @__PURE__ */ o("span", { class: "text-[10px] font-semibold uppercase tracking-wider text-gray-500", children: n("auth.signed_in", "Signed in") }),
|
|
319
|
+
/* @__PURE__ */ o("span", { class: "text-sm font-medium text-gray-900", children: t })
|
|
215
320
|
] }),
|
|
216
321
|
/* @__PURE__ */ o(
|
|
217
322
|
"button",
|
|
@@ -219,774 +324,1451 @@ function xe({ email: r, onSignOut: e }) {
|
|
|
219
324
|
type: "button",
|
|
220
325
|
onClick: e,
|
|
221
326
|
class: "rounded-md px-1.5 py-0.5 text-xs font-medium text-gray-600 transition-colors hover:bg-white hover:text-gray-900 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",
|
|
222
|
-
children: "Sign out"
|
|
327
|
+
children: n("auth.sign_out", "Sign out")
|
|
223
328
|
}
|
|
224
329
|
)
|
|
225
330
|
] });
|
|
226
331
|
}
|
|
227
|
-
function
|
|
228
|
-
const i =
|
|
229
|
-
|
|
230
|
-
|
|
332
|
+
function rt({ block: t, allowSignup: e, allowReset: n, ctx: r }) {
|
|
333
|
+
const { t: i } = w(), s = r.auth, a = t.providers ?? [], [l, d] = x("signin"), [u, p] = x(""), [f, b] = x(""), [h, y] = x(""), [k, j] = x(""), [T, v] = x(null), [L, C] = x(null), [P, O] = x(null), [M, q] = x(!1), [z, D] = x(null);
|
|
334
|
+
B(() => {
|
|
335
|
+
if (typeof s.getLastLogin != "function") return;
|
|
336
|
+
let S = !1;
|
|
337
|
+
return s.getLastLogin().then(
|
|
338
|
+
(E) => {
|
|
339
|
+
S || !E || (D(E), E.email && p((F) => F === "" ? E.email : F));
|
|
340
|
+
},
|
|
341
|
+
() => {
|
|
342
|
+
}
|
|
343
|
+
), () => {
|
|
344
|
+
S = !0;
|
|
345
|
+
};
|
|
346
|
+
}, [s]);
|
|
347
|
+
const A = (S) => {
|
|
348
|
+
d(S), C(null), O(null), q(!1);
|
|
349
|
+
}, I = async (S) => {
|
|
350
|
+
if (S.preventDefault(), !T) {
|
|
351
|
+
if (C(null), O(null), l === "signup" && !M) {
|
|
352
|
+
if (!u.trim()) return;
|
|
353
|
+
q(!0);
|
|
354
|
+
return;
|
|
355
|
+
}
|
|
356
|
+
if (l === "signup" && f !== h) {
|
|
357
|
+
C(i("auth.passwords_mismatch", "Passwords don't match"));
|
|
358
|
+
return;
|
|
359
|
+
}
|
|
360
|
+
v("email");
|
|
231
361
|
try {
|
|
232
|
-
l === "signin" ? await
|
|
233
|
-
email
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
362
|
+
l === "signin" ? await s.signInWithEmail({ email: u, password: f }) : l === "signup" ? (await s.signUp({ email: u, password: f })).kind === "confirmation_required" && (d("reset_verify"), O(i("auth.check_email_message", "Check your email for a confirmation code."))) : l === "forgot" ? (await s.requestPasswordReset({ email: u }), d("reset_sent"), O(
|
|
363
|
+
i("auth.reset_sent_message", "If that email exists, a reset code has been sent.")
|
|
364
|
+
)) : l === "reset_verify" && (await s.verifyOtp({
|
|
365
|
+
email: u,
|
|
366
|
+
token: k,
|
|
367
|
+
type: f ? "recovery" : "email"
|
|
368
|
+
}), f && await s.updatePassword({ password: f }));
|
|
369
|
+
} catch (E) {
|
|
370
|
+
const F = E instanceof U ? E.message : i("auth.generic_error", "Something went wrong");
|
|
371
|
+
C(F);
|
|
240
372
|
} finally {
|
|
241
|
-
|
|
373
|
+
v(null);
|
|
242
374
|
}
|
|
243
375
|
}
|
|
244
|
-
},
|
|
245
|
-
if (!
|
|
246
|
-
|
|
376
|
+
}, m = async (S) => {
|
|
377
|
+
if (!T) {
|
|
378
|
+
v(S), C(null), O(null);
|
|
247
379
|
try {
|
|
248
|
-
await
|
|
249
|
-
provider:
|
|
250
|
-
onPopupOpened: () =>
|
|
380
|
+
await s.signInWithOAuth({
|
|
381
|
+
provider: S,
|
|
382
|
+
onPopupOpened: () => v(null)
|
|
251
383
|
});
|
|
252
|
-
} catch (
|
|
253
|
-
if (
|
|
254
|
-
if (
|
|
255
|
-
|
|
384
|
+
} catch (E) {
|
|
385
|
+
if (E instanceof U) {
|
|
386
|
+
if (E.code === "oauth_cancelled" || E.code === "oauth_timeout") return;
|
|
387
|
+
C(E.message);
|
|
256
388
|
} else
|
|
257
|
-
|
|
389
|
+
C(i("auth.signin_failed", "Sign-in failed"));
|
|
258
390
|
} finally {
|
|
259
|
-
|
|
391
|
+
v(null);
|
|
260
392
|
}
|
|
261
393
|
}
|
|
262
|
-
};
|
|
263
|
-
return /* @__PURE__ */
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
394
|
+
}, g = a.length > 0 && (l === "signin" || l === "signup"), _ = l === "signin" || l === "signup" || l === "forgot", Z = l === "signin" || l === "signup" && M;
|
|
395
|
+
return /* @__PURE__ */ c("div", { class: "flex flex-col gap-5", children: [
|
|
396
|
+
/* @__PURE__ */ o(it, { mode: l, customHeading: t.heading, customSubheading: t.subheading }),
|
|
397
|
+
g ? /* @__PURE__ */ c("div", { class: "flex flex-col gap-2.5", children: [
|
|
398
|
+
a.map((S) => /* @__PURE__ */ c("div", { class: "relative", children: [
|
|
399
|
+
/* @__PURE__ */ c(
|
|
400
|
+
"button",
|
|
401
|
+
{
|
|
402
|
+
type: "button",
|
|
403
|
+
onClick: () => m(S),
|
|
404
|
+
disabled: T !== null,
|
|
405
|
+
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)]",
|
|
406
|
+
children: [
|
|
407
|
+
T === S ? /* @__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(pt, { provider: S }),
|
|
408
|
+
/* @__PURE__ */ o("span", { children: tt(S, i) })
|
|
409
|
+
]
|
|
410
|
+
}
|
|
411
|
+
),
|
|
412
|
+
z?.method === S ? /* @__PURE__ */ o(ge, { email: z.email }) : null
|
|
413
|
+
] }, S)),
|
|
414
|
+
/* @__PURE__ */ o(ht, {})
|
|
281
415
|
] }) : null,
|
|
282
|
-
/* @__PURE__ */
|
|
283
|
-
|
|
284
|
-
|
|
416
|
+
/* @__PURE__ */ c("form", { onSubmit: I, class: "flex flex-col gap-3", children: [
|
|
417
|
+
_ && /* @__PURE__ */ o(
|
|
418
|
+
fe,
|
|
285
419
|
{
|
|
286
420
|
type: "email",
|
|
287
|
-
|
|
288
|
-
value:
|
|
289
|
-
onInput:
|
|
421
|
+
placeholder: i("auth.email", "Email address"),
|
|
422
|
+
value: u,
|
|
423
|
+
onInput: p,
|
|
290
424
|
autocomplete: "email",
|
|
291
425
|
required: !0
|
|
292
426
|
}
|
|
293
427
|
),
|
|
294
|
-
|
|
295
|
-
|
|
428
|
+
Z && /* @__PURE__ */ o(
|
|
429
|
+
Q,
|
|
296
430
|
{
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
value: m,
|
|
431
|
+
placeholder: i("auth.password", "Password"),
|
|
432
|
+
value: f,
|
|
300
433
|
onInput: b,
|
|
301
434
|
autocomplete: l === "signin" ? "current-password" : "new-password",
|
|
302
435
|
required: !0
|
|
303
436
|
}
|
|
304
437
|
),
|
|
305
|
-
l === "
|
|
438
|
+
l === "signup" && M && /* @__PURE__ */ o(
|
|
439
|
+
Q,
|
|
440
|
+
{
|
|
441
|
+
placeholder: i("auth.repeat_password", "Repeat password"),
|
|
442
|
+
value: h,
|
|
443
|
+
onInput: y,
|
|
444
|
+
autocomplete: "new-password",
|
|
445
|
+
required: !0
|
|
446
|
+
}
|
|
447
|
+
),
|
|
448
|
+
l === "reset_verify" && /* @__PURE__ */ c(W, { children: [
|
|
306
449
|
/* @__PURE__ */ o(
|
|
307
|
-
|
|
450
|
+
fe,
|
|
308
451
|
{
|
|
309
452
|
type: "text",
|
|
310
|
-
|
|
311
|
-
value:
|
|
312
|
-
onInput:
|
|
453
|
+
placeholder: i("auth.confirmation_code", "Confirmation code"),
|
|
454
|
+
value: k,
|
|
455
|
+
onInput: j,
|
|
313
456
|
autocomplete: "one-time-code",
|
|
314
457
|
inputMode: "numeric",
|
|
315
458
|
required: !0
|
|
316
459
|
}
|
|
317
460
|
),
|
|
318
461
|
/* @__PURE__ */ o(
|
|
319
|
-
|
|
462
|
+
Q,
|
|
320
463
|
{
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
464
|
+
placeholder: i(
|
|
465
|
+
"auth.new_password_optional",
|
|
466
|
+
"New password (optional — only for password reset)"
|
|
467
|
+
),
|
|
468
|
+
value: f,
|
|
324
469
|
onInput: b,
|
|
325
470
|
autocomplete: "new-password"
|
|
326
471
|
}
|
|
327
472
|
)
|
|
328
473
|
] }),
|
|
329
|
-
l === "reset_sent" &&
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
l !== "reset_sent" && /* @__PURE__ */ o(
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
}
|
|
344
|
-
)
|
|
474
|
+
l === "reset_sent" && P && /* @__PURE__ */ o("p", { class: "rounded-2xl bg-gray-100 px-4 py-3 text-sm text-gray-600", children: P }),
|
|
475
|
+
l === "signin" && n && /* @__PURE__ */ o("div", { class: "flex justify-end text-sm", children: /* @__PURE__ */ o(G, { onClick: () => A("forgot"), children: i("auth.forgot_password", "Forgot password?") }) }),
|
|
476
|
+
L && /* @__PURE__ */ o("p", { class: "text-sm text-red-600", children: L }),
|
|
477
|
+
P && l !== "reset_sent" && /* @__PURE__ */ o("p", { class: "text-sm text-gray-500", children: P }),
|
|
478
|
+
l !== "reset_sent" && /* @__PURE__ */ c("div", { class: "relative", children: [
|
|
479
|
+
/* @__PURE__ */ o(
|
|
480
|
+
lt,
|
|
481
|
+
{
|
|
482
|
+
busy: T === "email",
|
|
483
|
+
label: st(l, M, t.submit_label ?? t.heading, i)
|
|
484
|
+
}
|
|
485
|
+
),
|
|
486
|
+
l === "signin" && z?.method === "email" ? /* @__PURE__ */ o(ge, { email: z.email }) : null
|
|
487
|
+
] })
|
|
345
488
|
] }),
|
|
346
|
-
/* @__PURE__ */
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
489
|
+
/* @__PURE__ */ o(
|
|
490
|
+
at,
|
|
491
|
+
{
|
|
492
|
+
mode: l,
|
|
493
|
+
allowSignup: e,
|
|
494
|
+
onSwitch: A
|
|
495
|
+
}
|
|
496
|
+
)
|
|
497
|
+
] });
|
|
498
|
+
}
|
|
499
|
+
function it({
|
|
500
|
+
mode: t,
|
|
501
|
+
customHeading: e,
|
|
502
|
+
customSubheading: n
|
|
503
|
+
}) {
|
|
504
|
+
const { t: r } = w(), i = ot(t, r), s = t === "signin" || t === "signup", a = s && e ? e : i.title, l = s && n !== void 0 ? n || null : i.subtitle;
|
|
505
|
+
return /* @__PURE__ */ c("div", { class: "flex flex-col gap-2", children: [
|
|
506
|
+
/* @__PURE__ */ o("h2", { class: "text-3xl font-bold tracking-tight text-gray-900", children: a }),
|
|
507
|
+
l ? /* @__PURE__ */ o("p", { class: "text-base leading-relaxed text-gray-600", children: l }) : null
|
|
353
508
|
] });
|
|
354
509
|
}
|
|
355
|
-
function
|
|
356
|
-
switch (
|
|
510
|
+
function ot(t, e) {
|
|
511
|
+
switch (t) {
|
|
512
|
+
case "signin":
|
|
513
|
+
return {
|
|
514
|
+
title: e("auth.welcome", "Welcome back!"),
|
|
515
|
+
subtitle: e("auth.default_subtitle", "Sign in to access all features and sync your data.")
|
|
516
|
+
};
|
|
517
|
+
case "signup":
|
|
518
|
+
return {
|
|
519
|
+
title: e("auth.welcome_signup", "Welcome!"),
|
|
520
|
+
subtitle: e("auth.default_subtitle", "Sign in to access all features and sync your data.")
|
|
521
|
+
};
|
|
522
|
+
case "forgot":
|
|
523
|
+
return {
|
|
524
|
+
title: e("auth.forgot_password_title", "Forgot password?"),
|
|
525
|
+
subtitle: e(
|
|
526
|
+
"auth.forgot_subtitle",
|
|
527
|
+
"Enter your email and we'll send you a password reset link."
|
|
528
|
+
)
|
|
529
|
+
};
|
|
530
|
+
case "reset_sent":
|
|
531
|
+
return {
|
|
532
|
+
title: e("auth.check_email_title", "Check your email"),
|
|
533
|
+
subtitle: null
|
|
534
|
+
};
|
|
535
|
+
case "reset_verify":
|
|
536
|
+
return {
|
|
537
|
+
title: e("auth.reset_password_title", "Reset password"),
|
|
538
|
+
subtitle: e(
|
|
539
|
+
"auth.reset_password_subtitle",
|
|
540
|
+
"Enter the code from your email and a new password."
|
|
541
|
+
)
|
|
542
|
+
};
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
function st(t, e, n, r) {
|
|
546
|
+
if (t === "signin" && n) return n;
|
|
547
|
+
switch (t) {
|
|
357
548
|
case "signin":
|
|
358
|
-
return "Sign
|
|
549
|
+
return r("auth.log_in", "Sign In");
|
|
359
550
|
case "signup":
|
|
360
|
-
return "Create
|
|
551
|
+
return e ? r("auth.create_account", "Create Account") : r("auth.sign_up", "Sign Up");
|
|
361
552
|
case "forgot":
|
|
362
|
-
return "Send
|
|
553
|
+
return r("auth.send_reset", "Send Reset Email");
|
|
363
554
|
case "reset_verify":
|
|
364
|
-
return "Verify";
|
|
555
|
+
return r("auth.verify", "Verify");
|
|
365
556
|
default:
|
|
366
|
-
return "Continue";
|
|
557
|
+
return r("cta.continue", "Continue");
|
|
367
558
|
}
|
|
368
559
|
}
|
|
369
|
-
function
|
|
370
|
-
|
|
560
|
+
function at({
|
|
561
|
+
mode: t,
|
|
562
|
+
allowSignup: e,
|
|
563
|
+
onSwitch: n
|
|
564
|
+
}) {
|
|
565
|
+
const { t: r } = w();
|
|
566
|
+
return t === "signin" && e ? /* @__PURE__ */ c("p", { class: "text-center text-sm text-gray-600", children: [
|
|
567
|
+
r("auth.no_account", "Don't have an account?"),
|
|
568
|
+
" ",
|
|
569
|
+
/* @__PURE__ */ o(G, { onClick: () => n("signup"), children: r("auth.sign_up_link", "Sign Up") })
|
|
570
|
+
] }) : t === "signup" ? /* @__PURE__ */ c("p", { class: "text-center text-sm text-gray-600", children: [
|
|
571
|
+
r("auth.have_account", "Already have an account?"),
|
|
572
|
+
" ",
|
|
573
|
+
/* @__PURE__ */ o(G, { onClick: () => n("signin"), children: r("auth.log_in_link", "Log In") })
|
|
574
|
+
] }) : t === "forgot" || t === "reset_sent" || t === "reset_verify" ? /* @__PURE__ */ c("p", { class: "text-center text-sm text-gray-600", children: [
|
|
575
|
+
r("auth.no_account", "Don't have an account?"),
|
|
576
|
+
" ",
|
|
577
|
+
/* @__PURE__ */ o(G, { onClick: () => n("signup"), children: r("auth.sign_up_link", "Sign Up") })
|
|
578
|
+
] }) : null;
|
|
579
|
+
}
|
|
580
|
+
function G({
|
|
581
|
+
onClick: t,
|
|
582
|
+
children: e
|
|
583
|
+
}) {
|
|
584
|
+
return /* @__PURE__ */ o(
|
|
585
|
+
"button",
|
|
586
|
+
{
|
|
587
|
+
type: "button",
|
|
588
|
+
onClick: t,
|
|
589
|
+
class: "font-semibold transition-opacity hover:opacity-80 focus:outline-none focus-visible:opacity-80",
|
|
590
|
+
style: { color: "var(--pw-accent)" },
|
|
591
|
+
children: e
|
|
592
|
+
}
|
|
593
|
+
);
|
|
594
|
+
}
|
|
595
|
+
function lt({ busy: t, label: e }) {
|
|
596
|
+
return /* @__PURE__ */ o(
|
|
597
|
+
"button",
|
|
598
|
+
{
|
|
599
|
+
type: "submit",
|
|
600
|
+
disabled: t,
|
|
601
|
+
class: "pw-cta-shimmer relative mt-1 flex min-h-12 w-full items-center justify-center overflow-hidden rounded-3xl px-5 py-2 text-center text-base font-semibold leading-tight text-white transition-transform duration-150 active:scale-[0.98] disabled:cursor-not-allowed disabled:opacity-60 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",
|
|
602
|
+
style: {
|
|
603
|
+
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%)",
|
|
604
|
+
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)"
|
|
605
|
+
},
|
|
606
|
+
children: t ? /* @__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: e })
|
|
607
|
+
}
|
|
608
|
+
);
|
|
371
609
|
}
|
|
372
|
-
function
|
|
373
|
-
return /* @__PURE__ */
|
|
374
|
-
|
|
610
|
+
function fe({ type: t, placeholder: e, value: n, onInput: r, autocomplete: i, inputMode: s, required: a }) {
|
|
611
|
+
return /* @__PURE__ */ o(
|
|
612
|
+
"input",
|
|
613
|
+
{
|
|
614
|
+
type: t,
|
|
615
|
+
value: n,
|
|
616
|
+
placeholder: e,
|
|
617
|
+
onInput: (l) => r(l.target.value),
|
|
618
|
+
autocomplete: i,
|
|
619
|
+
inputMode: s,
|
|
620
|
+
required: a,
|
|
621
|
+
class: "h-14 w-full rounded-2xl bg-gray-100 px-5 text-base text-gray-900 outline-none transition-all placeholder:text-gray-500 hover:bg-gray-200/60 focus:bg-gray-200/60 focus:shadow-[0_0_0_2px_color-mix(in_srgb,var(--pw-accent)_30%,transparent)]"
|
|
622
|
+
}
|
|
623
|
+
);
|
|
624
|
+
}
|
|
625
|
+
function Q({ placeholder: t, value: e, onInput: n, autocomplete: r, required: i }) {
|
|
626
|
+
const { t: s } = w(), [a, l] = x(!1), d = R(null);
|
|
627
|
+
B(() => {
|
|
628
|
+
const f = d.current;
|
|
629
|
+
f && f.value !== e && (f.value = e);
|
|
630
|
+
}, [a, e]);
|
|
631
|
+
const u = s("auth.show_password", "Show password"), p = s("auth.hide_password", "Hide password");
|
|
632
|
+
return /* @__PURE__ */ c("div", { class: "relative", children: [
|
|
375
633
|
/* @__PURE__ */ o(
|
|
376
634
|
"input",
|
|
377
635
|
{
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
636
|
+
ref: d,
|
|
637
|
+
type: a ? "text" : "password",
|
|
638
|
+
value: e,
|
|
639
|
+
placeholder: t,
|
|
640
|
+
onInput: (f) => n(f.target.value),
|
|
641
|
+
autocomplete: r,
|
|
642
|
+
required: i,
|
|
643
|
+
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)]"
|
|
644
|
+
}
|
|
645
|
+
),
|
|
646
|
+
/* @__PURE__ */ o(
|
|
647
|
+
"button",
|
|
648
|
+
{
|
|
649
|
+
type: "button",
|
|
650
|
+
onClick: () => l((f) => !f),
|
|
651
|
+
"aria-label": a ? p : u,
|
|
652
|
+
tabIndex: -1,
|
|
653
|
+
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)]",
|
|
654
|
+
children: a ? /* @__PURE__ */ o(ut, {}) : /* @__PURE__ */ o(ct, {})
|
|
385
655
|
}
|
|
386
656
|
)
|
|
387
657
|
] });
|
|
388
658
|
}
|
|
389
|
-
function
|
|
390
|
-
return /* @__PURE__ */
|
|
391
|
-
/* @__PURE__ */ o(
|
|
392
|
-
|
|
393
|
-
|
|
659
|
+
function ct() {
|
|
660
|
+
return /* @__PURE__ */ c("svg", { width: "18", height: "18", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
661
|
+
/* @__PURE__ */ o(
|
|
662
|
+
"path",
|
|
663
|
+
{
|
|
664
|
+
d: "M1.667 10S4.583 4.167 10 4.167 18.333 10 18.333 10 15.417 15.833 10 15.833 1.667 10 1.667 10Z",
|
|
665
|
+
stroke: "currentColor",
|
|
666
|
+
"stroke-width": "1.5",
|
|
667
|
+
"stroke-linecap": "round",
|
|
668
|
+
"stroke-linejoin": "round"
|
|
669
|
+
}
|
|
670
|
+
),
|
|
671
|
+
/* @__PURE__ */ o("circle", { cx: "10", cy: "10", r: "2.5", stroke: "currentColor", "stroke-width": "1.5" })
|
|
394
672
|
] });
|
|
395
673
|
}
|
|
396
|
-
function
|
|
397
|
-
return
|
|
674
|
+
function ut() {
|
|
675
|
+
return /* @__PURE__ */ c("svg", { width: "18", height: "18", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
676
|
+
/* @__PURE__ */ o(
|
|
677
|
+
"path",
|
|
678
|
+
{
|
|
679
|
+
d: "M8.236 4.293A6.96 6.96 0 0 1 10 4.167C15.417 4.167 18.333 10 18.333 10a13.5 13.5 0 0 1-1.92 2.755M11.768 11.768A2.5 2.5 0 0 1 8.233 8.233",
|
|
680
|
+
stroke: "currentColor",
|
|
681
|
+
"stroke-width": "1.5",
|
|
682
|
+
"stroke-linecap": "round",
|
|
683
|
+
"stroke-linejoin": "round"
|
|
684
|
+
}
|
|
685
|
+
),
|
|
686
|
+
/* @__PURE__ */ o(
|
|
687
|
+
"path",
|
|
688
|
+
{
|
|
689
|
+
d: "M14.953 14.953A8.84 8.84 0 0 1 10 15.833C4.583 15.833 1.667 10 1.667 10a13.5 13.5 0 0 1 3.38-3.953M1.667 1.667l16.666 16.666",
|
|
690
|
+
stroke: "currentColor",
|
|
691
|
+
"stroke-width": "1.5",
|
|
692
|
+
"stroke-linecap": "round",
|
|
693
|
+
"stroke-linejoin": "round"
|
|
694
|
+
}
|
|
695
|
+
)
|
|
696
|
+
] });
|
|
697
|
+
}
|
|
698
|
+
function ge({ email: t }) {
|
|
699
|
+
const { t: e } = w(), n = t ? e("auth.last_used", "Last · {email}", { email: dt(t) }) : e("auth.last_used_no_email", "Last");
|
|
700
|
+
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: n });
|
|
701
|
+
}
|
|
702
|
+
function dt(t) {
|
|
703
|
+
const [e, n] = t.split("@");
|
|
704
|
+
return n ? `${e.slice(0, 3)}*****@${n}` : t;
|
|
705
|
+
}
|
|
706
|
+
function ht() {
|
|
707
|
+
const { t } = w();
|
|
708
|
+
return /* @__PURE__ */ c("div", { class: "flex items-center gap-3 py-1 text-sm text-gray-400", children: [
|
|
709
|
+
/* @__PURE__ */ o("div", { class: "h-px flex-1 bg-gray-200" }),
|
|
710
|
+
/* @__PURE__ */ o("span", { children: t("auth.or", "or") }),
|
|
711
|
+
/* @__PURE__ */ o("div", { class: "h-px flex-1 bg-gray-200" })
|
|
712
|
+
] });
|
|
713
|
+
}
|
|
714
|
+
function pt({ provider: t }) {
|
|
715
|
+
return t === "google" ? /* @__PURE__ */ c("svg", { width: "20", height: "20", viewBox: "0 0 18 18", "aria-hidden": "true", children: [
|
|
398
716
|
/* @__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" }),
|
|
399
717
|
/* @__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" }),
|
|
400
718
|
/* @__PURE__ */ o("path", { fill: "#FBBC05", d: "M3.93 10.68a5.4 5.4 0 0 1 0-3.36V4.99H.92a9 9 0 0 0 0 8.02l3-2.33Z" }),
|
|
401
719
|
/* @__PURE__ */ o("path", { fill: "#EA4335", d: "M9 3.58c1.32 0 2.5.45 3.44 1.34l2.58-2.58A9 9 0 0 0 .92 4.99l3.01 2.33C4.64 5.17 6.64 3.58 9 3.58Z" })
|
|
402
|
-
] }) :
|
|
720
|
+
] }) : t === "apple" ? (
|
|
721
|
+
// viewBox 0 0 24 24 даёт воздух сверху/снизу пути, поэтому визуально
|
|
722
|
+
// Apple-яблоко выглядит меньше Google. Компенсируем увеличенным
|
|
723
|
+
// width/height — 26×26 даёт примерно equal optical size с Google 20×20.
|
|
724
|
+
/* @__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" }) })
|
|
725
|
+
) : t === "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" }) });
|
|
403
726
|
}
|
|
404
|
-
function
|
|
405
|
-
block:
|
|
727
|
+
function ft({
|
|
728
|
+
block: t,
|
|
406
729
|
bootstrap: e,
|
|
407
|
-
auth:
|
|
408
|
-
authSession:
|
|
730
|
+
auth: n,
|
|
731
|
+
authSession: r,
|
|
409
732
|
onBack: i,
|
|
410
|
-
showBack: s = !0
|
|
733
|
+
showBack: s = !0,
|
|
734
|
+
intent: a = "preauth"
|
|
411
735
|
}) {
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
736
|
+
const { t: l } = w(), d = {
|
|
737
|
+
bootstrap: e,
|
|
738
|
+
selectedPriceId: null,
|
|
739
|
+
setSelectedPriceId: () => {
|
|
740
|
+
},
|
|
741
|
+
onAction: () => {
|
|
742
|
+
},
|
|
743
|
+
auth: n,
|
|
744
|
+
authSession: r
|
|
745
|
+
}, u = a === "restore" ? {
|
|
746
|
+
...t,
|
|
747
|
+
heading: l("auth.restore_purchases_heading", "Restore Purchases"),
|
|
748
|
+
subheading: l(
|
|
749
|
+
"auth.restore_purchases_subheading",
|
|
750
|
+
"Please sign in to restore your purchases."
|
|
751
|
+
)
|
|
752
|
+
} : a === "preauth" ? {
|
|
753
|
+
...t,
|
|
754
|
+
heading: l("auth.login_continue_purchase", "Log in to continue your purchase"),
|
|
755
|
+
subheading: l(
|
|
756
|
+
"auth.link_purchase_subheading",
|
|
757
|
+
"We'll link the purchase to your account to keep access."
|
|
758
|
+
),
|
|
759
|
+
// Preauth heading — descriptive sentence ("Log in to continue your
|
|
760
|
+
// purchase"), а не action verb. Длинные локализации (RU: "Войдите,
|
|
761
|
+
// чтобы продолжить покупку") в pill-кнопку h-12 не помещаются и
|
|
762
|
+
// переносятся на 2 строки. Явный короткий submit_label решает.
|
|
763
|
+
submit_label: l("auth.log_in", "Sign In")
|
|
764
|
+
} : t;
|
|
765
|
+
return /* @__PURE__ */ c("div", { class: "relative flex-1 min-h-0 overflow-y-auto p-6 sm:p-8", children: [
|
|
766
|
+
s ? /* @__PURE__ */ o(gt, { onClick: i, ariaLabel: l("nav.back_aria", "Back") }) : null,
|
|
767
|
+
/* @__PURE__ */ o(Le, { block: u, ctx: d })
|
|
432
768
|
] });
|
|
433
769
|
}
|
|
434
|
-
function
|
|
435
|
-
|
|
770
|
+
function gt({ onClick: t, ariaLabel: e }) {
|
|
771
|
+
return /* @__PURE__ */ o(
|
|
772
|
+
"button",
|
|
773
|
+
{
|
|
774
|
+
type: "button",
|
|
775
|
+
onClick: t,
|
|
776
|
+
"aria-label": e,
|
|
777
|
+
class: "absolute right-4 top-4 z-10 flex h-8 w-8 items-center justify-center rounded-full text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-700 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",
|
|
778
|
+
children: /* @__PURE__ */ c("svg", { width: "18", height: "18", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
779
|
+
/* @__PURE__ */ o(
|
|
780
|
+
"path",
|
|
781
|
+
{
|
|
782
|
+
d: "M5 8h8a4 4 0 0 1 0 8H9",
|
|
783
|
+
stroke: "currentColor",
|
|
784
|
+
"stroke-width": "1.75",
|
|
785
|
+
"stroke-linecap": "round",
|
|
786
|
+
"stroke-linejoin": "round"
|
|
787
|
+
}
|
|
788
|
+
),
|
|
789
|
+
/* @__PURE__ */ o(
|
|
790
|
+
"path",
|
|
791
|
+
{
|
|
792
|
+
d: "M8 4 4 8l4 4",
|
|
793
|
+
stroke: "currentColor",
|
|
794
|
+
"stroke-width": "1.75",
|
|
795
|
+
"stroke-linecap": "round",
|
|
796
|
+
"stroke-linejoin": "round"
|
|
797
|
+
}
|
|
798
|
+
)
|
|
799
|
+
] })
|
|
800
|
+
}
|
|
801
|
+
);
|
|
802
|
+
}
|
|
803
|
+
function mt({
|
|
804
|
+
auth: t,
|
|
436
805
|
onSuccess: e,
|
|
437
|
-
onBack:
|
|
438
|
-
heading:
|
|
439
|
-
description: i
|
|
806
|
+
onBack: n,
|
|
807
|
+
heading: r,
|
|
808
|
+
description: i
|
|
440
809
|
}) {
|
|
441
|
-
const
|
|
442
|
-
|
|
443
|
-
|
|
810
|
+
const { t: s } = w(), a = r ?? s("anon.heading_default", "Continue as guest"), l = i ?? s("anon.description_default", "Setting up your guest session…"), [d, u] = x({ kind: "signing-in" }), p = R(!0);
|
|
811
|
+
B(() => () => {
|
|
812
|
+
p.current = !1;
|
|
444
813
|
}, []);
|
|
445
|
-
const
|
|
446
|
-
|
|
814
|
+
const f = () => {
|
|
815
|
+
u({ kind: "signing-in" }), (async () => {
|
|
447
816
|
try {
|
|
448
|
-
const
|
|
449
|
-
if (!
|
|
450
|
-
e(
|
|
451
|
-
} catch (
|
|
452
|
-
if (!
|
|
453
|
-
|
|
817
|
+
const b = await t.signInAnonymously();
|
|
818
|
+
if (!p.current) return;
|
|
819
|
+
e(b);
|
|
820
|
+
} catch (b) {
|
|
821
|
+
if (!p.current) return;
|
|
822
|
+
u({
|
|
454
823
|
kind: "error",
|
|
455
|
-
message:
|
|
824
|
+
message: b instanceof Error ? b.message : "Anonymous sign-in failed"
|
|
456
825
|
});
|
|
457
826
|
}
|
|
458
827
|
})();
|
|
459
828
|
};
|
|
460
|
-
return
|
|
461
|
-
|
|
462
|
-
}, []), /* @__PURE__ */
|
|
463
|
-
|
|
829
|
+
return B(() => {
|
|
830
|
+
f();
|
|
831
|
+
}, []), /* @__PURE__ */ c("div", { class: "flex flex-col gap-3", children: [
|
|
832
|
+
n ? /* @__PURE__ */ o(
|
|
464
833
|
"button",
|
|
465
834
|
{
|
|
466
835
|
type: "button",
|
|
467
|
-
onClick:
|
|
836
|
+
onClick: n,
|
|
468
837
|
class: "-ml-1 self-start rounded-md px-1.5 py-0.5 text-xs font-medium text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",
|
|
469
|
-
children: "← Back"
|
|
838
|
+
children: s("nav.back", "← Back")
|
|
470
839
|
}
|
|
471
840
|
) : null,
|
|
472
|
-
/* @__PURE__ */
|
|
473
|
-
/* @__PURE__ */ o("h2", { class: "text-xl font-semibold text-gray-900", children:
|
|
474
|
-
/* @__PURE__ */ o("p", { class: "text-sm text-gray-500", children:
|
|
841
|
+
/* @__PURE__ */ c("div", { class: "flex flex-col gap-1", children: [
|
|
842
|
+
/* @__PURE__ */ o("h2", { class: "text-xl font-semibold text-gray-900", children: a }),
|
|
843
|
+
/* @__PURE__ */ o("p", { class: "text-sm text-gray-500", children: l })
|
|
475
844
|
] }),
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
/* @__PURE__ */ o("div", { class: "rounded-lg bg-red-50 px-3 py-2 text-sm text-red-700", children:
|
|
845
|
+
d.kind === "signing-in" ? /* @__PURE__ */ o("div", { class: "flex items-center justify-center py-6", children: /* @__PURE__ */ o(yt, {}) }) : null,
|
|
846
|
+
d.kind === "error" ? /* @__PURE__ */ c("div", { class: "flex flex-col gap-3", children: [
|
|
847
|
+
/* @__PURE__ */ o("div", { class: "rounded-lg bg-red-50 px-3 py-2 text-sm text-red-700", children: d.message }),
|
|
479
848
|
/* @__PURE__ */ o(
|
|
480
849
|
"button",
|
|
481
850
|
{
|
|
482
851
|
type: "button",
|
|
483
|
-
onClick:
|
|
852
|
+
onClick: f,
|
|
484
853
|
class: "self-start rounded-md bg-[var(--pw-accent)] px-3 py-1.5 text-sm font-medium text-white hover:opacity-90 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)] focus-visible:ring-offset-2",
|
|
485
|
-
children: "Try again"
|
|
854
|
+
children: s("anon.try_again", "Try again")
|
|
486
855
|
}
|
|
487
856
|
)
|
|
488
857
|
] }) : null
|
|
489
858
|
] });
|
|
490
859
|
}
|
|
491
|
-
function
|
|
492
|
-
return /* @__PURE__ */
|
|
860
|
+
function yt() {
|
|
861
|
+
return /* @__PURE__ */ c("svg", { class: "h-5 w-5 animate-spin text-[var(--pw-accent)]", viewBox: "0 0 24 24", fill: "none", children: [
|
|
493
862
|
/* @__PURE__ */ o("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", "stroke-width": "3", "stroke-opacity": "0.2" }),
|
|
494
863
|
/* @__PURE__ */ o("path", { d: "M22 12a10 10 0 0 0-10-10", stroke: "currentColor", "stroke-width": "3", "stroke-linecap": "round" })
|
|
495
864
|
] });
|
|
496
865
|
}
|
|
497
|
-
const
|
|
498
|
-
function
|
|
499
|
-
const
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
866
|
+
const Ae = (t) => `pw-offer-${t}-start`;
|
|
867
|
+
function ee(t) {
|
|
868
|
+
const e = t - Date.now();
|
|
869
|
+
return e <= 0 ? { days: 0, hours: 0, minutes: 0, seconds: 0, expired: !0 } : {
|
|
870
|
+
days: Math.floor(e / (1e3 * 60 * 60 * 24)),
|
|
871
|
+
hours: Math.floor(e % (1e3 * 60 * 60 * 24) / (1e3 * 60 * 60)),
|
|
872
|
+
minutes: Math.floor(e % (1e3 * 60 * 60) / (1e3 * 60)),
|
|
873
|
+
seconds: Math.floor(e % (1e3 * 60) / 1e3),
|
|
874
|
+
expired: !1
|
|
875
|
+
};
|
|
876
|
+
}
|
|
877
|
+
function xt(t) {
|
|
878
|
+
if (t.expires_at) {
|
|
879
|
+
const e = Date.parse(t.expires_at);
|
|
880
|
+
return Number.isFinite(e) ? e : null;
|
|
881
|
+
}
|
|
882
|
+
if (t.duration_minutes && t.duration_minutes > 0) {
|
|
883
|
+
if (typeof window > "u") return null;
|
|
884
|
+
try {
|
|
885
|
+
const e = Ae(t.id);
|
|
886
|
+
let n = window.localStorage.getItem(e);
|
|
887
|
+
return n || (n = (/* @__PURE__ */ new Date()).toISOString(), window.localStorage.setItem(e, n)), Date.parse(n) + t.duration_minutes * 6e4;
|
|
888
|
+
} catch {
|
|
889
|
+
return null;
|
|
890
|
+
}
|
|
891
|
+
}
|
|
892
|
+
return null;
|
|
893
|
+
}
|
|
894
|
+
function Ee(t, e) {
|
|
895
|
+
if (!t || t.length === 0) return null;
|
|
896
|
+
if (e) {
|
|
897
|
+
const n = t.find((r) => r.id === e);
|
|
898
|
+
if (n) return n;
|
|
899
|
+
}
|
|
900
|
+
return t.find((n) => n.expires_at || n.duration_minutes) ?? null;
|
|
901
|
+
}
|
|
902
|
+
function Te(t) {
|
|
903
|
+
const e = t ? xt(t) : null, [n, r] = x(
|
|
904
|
+
() => e !== null ? ee(e) : null
|
|
905
|
+
), i = R(e);
|
|
906
|
+
return i.current = e, B(() => {
|
|
907
|
+
if (e === null) {
|
|
908
|
+
r(null);
|
|
909
|
+
return;
|
|
910
|
+
}
|
|
911
|
+
r(ee(e));
|
|
912
|
+
const s = setInterval(() => {
|
|
913
|
+
const a = ee(i.current ?? 0);
|
|
914
|
+
if (r(a), a.expired && (clearInterval(s), t?.duration_minutes && typeof window < "u"))
|
|
915
|
+
try {
|
|
916
|
+
window.localStorage.removeItem(Ae(t.id));
|
|
917
|
+
} catch {
|
|
918
|
+
}
|
|
919
|
+
}, 1e3);
|
|
920
|
+
return () => clearInterval(s);
|
|
921
|
+
}, [e, t?.duration_minutes, t?.id]), n;
|
|
922
|
+
}
|
|
923
|
+
function bt({ block: t, ctx: e }) {
|
|
924
|
+
const { t: n } = w(), r = Ee(e.bootstrap.offers, t.offer_id), i = Te(r);
|
|
925
|
+
if (!r || i === null || i.expired && !t.force) return null;
|
|
926
|
+
const s = t.title ?? r.label ?? n("offer.limited_time", "Limited-time offer"), a = r.discount_percent ? `${s} ${r.discount_percent}%` : s;
|
|
927
|
+
return /* @__PURE__ */ c(
|
|
928
|
+
"div",
|
|
929
|
+
{
|
|
930
|
+
class: "flex flex-wrap items-center justify-center gap-2 rounded-2xl px-4 py-3 text-[15px] font-semibold leading-tight text-white",
|
|
931
|
+
style: {
|
|
932
|
+
background: "linear-gradient(135deg, color-mix(in srgb, var(--pw-accent) 55%, white) 0%, var(--pw-accent) 50%, color-mix(in srgb, var(--pw-accent) 85%, black) 100%)",
|
|
933
|
+
textShadow: "0 0 2px rgba(0, 0, 0, 0.25)"
|
|
934
|
+
},
|
|
935
|
+
role: "status",
|
|
936
|
+
children: [
|
|
937
|
+
/* @__PURE__ */ o(Me, {}),
|
|
938
|
+
/* @__PURE__ */ o("span", { children: a }),
|
|
939
|
+
/* @__PURE__ */ o(Be, { value: i, t: n })
|
|
940
|
+
]
|
|
941
|
+
}
|
|
942
|
+
);
|
|
943
|
+
}
|
|
944
|
+
function Be({ value: t, t: e }) {
|
|
945
|
+
return /* @__PURE__ */ c("div", { class: "flex items-center gap-1 font-mono text-sm", children: [
|
|
946
|
+
t.days > 0 ? /* @__PURE__ */ c(W, { children: [
|
|
947
|
+
/* @__PURE__ */ o(V, { children: String(t.days) }),
|
|
948
|
+
/* @__PURE__ */ o("span", { class: "text-xs", children: e("countdown.d", "d") })
|
|
949
|
+
] }) : null,
|
|
950
|
+
/* @__PURE__ */ o(V, { children: String(t.hours).padStart(2, "0") }),
|
|
951
|
+
/* @__PURE__ */ o("span", { class: "text-xs", children: e("countdown.h", "h") }),
|
|
952
|
+
/* @__PURE__ */ o(V, { children: String(t.minutes).padStart(2, "0") }),
|
|
953
|
+
/* @__PURE__ */ o("span", { class: "text-xs", children: e("countdown.m", "m") }),
|
|
954
|
+
/* @__PURE__ */ o(V, { children: String(t.seconds).padStart(2, "0") }),
|
|
955
|
+
/* @__PURE__ */ o("span", { class: "text-xs", children: e("countdown.s", "s") })
|
|
956
|
+
] });
|
|
957
|
+
}
|
|
958
|
+
function V({ children: t }) {
|
|
959
|
+
return /* @__PURE__ */ o("span", { class: "rounded bg-black/20 px-1.5 py-0.5 text-xs font-bold", children: t });
|
|
960
|
+
}
|
|
961
|
+
function wt({ offer: t }) {
|
|
962
|
+
const { t: e } = w(), n = Te(t);
|
|
963
|
+
if (n === null || n.expired) return null;
|
|
964
|
+
const r = t.label ?? e("offer.limited_time", "Limited-time offer"), i = t.discount_percent ? `${r} ${t.discount_percent}%` : r;
|
|
965
|
+
return /* @__PURE__ */ c(
|
|
966
|
+
"div",
|
|
967
|
+
{
|
|
968
|
+
class: "-mb-2 flex flex-wrap items-center justify-center gap-2 rounded-t-xl px-4 pb-5 pt-3 text-[15px] font-semibold leading-tight text-white",
|
|
969
|
+
style: {
|
|
970
|
+
background: "linear-gradient(135deg, color-mix(in srgb, var(--pw-accent) 55%, white) 0%, var(--pw-accent) 50%, color-mix(in srgb, var(--pw-accent) 85%, black) 100%)",
|
|
971
|
+
textShadow: "0 0 2px rgba(0, 0, 0, 0.25)"
|
|
972
|
+
},
|
|
973
|
+
role: "status",
|
|
974
|
+
children: [
|
|
975
|
+
/* @__PURE__ */ o(Me, {}),
|
|
976
|
+
/* @__PURE__ */ o("span", { children: i }),
|
|
977
|
+
/* @__PURE__ */ o(Be, { value: n, t: e })
|
|
978
|
+
]
|
|
979
|
+
}
|
|
980
|
+
);
|
|
981
|
+
}
|
|
982
|
+
function Me() {
|
|
983
|
+
return /* @__PURE__ */ o(
|
|
984
|
+
"svg",
|
|
985
|
+
{
|
|
986
|
+
width: "16",
|
|
987
|
+
height: "16",
|
|
988
|
+
viewBox: "0 0 12 12",
|
|
989
|
+
fill: "none",
|
|
990
|
+
"aria-hidden": "true",
|
|
991
|
+
children: /* @__PURE__ */ o(
|
|
992
|
+
"path",
|
|
993
|
+
{
|
|
994
|
+
fill: "currentColor",
|
|
995
|
+
d: "m9.44 5.359-2.394-.895.61-3.036c.062-.31-.345-.531-.57-.291L2.434 6.105a.336.336 0 0 0 .126.537l2.395.894-.61 3.037c-.062.31.345.53.57.29l4.653-4.968a.336.336 0 0 0-.126-.536Z"
|
|
996
|
+
}
|
|
997
|
+
)
|
|
998
|
+
}
|
|
999
|
+
);
|
|
1000
|
+
}
|
|
1001
|
+
const te = 3, ne = 200, re = 5e3, ie = 5, kt = 10 * 1024 * 1024, me = ["image/jpeg", "image/png", "image/webp"], ye = /.+@.+\..+/;
|
|
1002
|
+
function vt({ client: t, authSession: e, origin: n, onBack: r }) {
|
|
1003
|
+
const { t: i } = w(), s = e?.user.email ?? "", a = s || null, [l, d] = x(s), [u, p] = x(""), [f, b] = x(""), [h, y] = x([]), [k, j] = x(!1), [T, v] = x(null), [L, C] = x({}), P = ve(() => {
|
|
1004
|
+
const A = (a ?? l).trim().toLowerCase(), I = u.trim(), m = f.trim();
|
|
1005
|
+
return ye.test(A) && I.length >= te && I.length <= ne && m.length >= 1 && m.length <= re;
|
|
1006
|
+
}, [a, l, u, f]), O = () => {
|
|
1007
|
+
const A = {}, I = (a ?? l).trim(), m = u.trim(), g = f.trim();
|
|
1008
|
+
return I ? ye.test(I.toLowerCase()) || (A.email = i("support.invalid_email", "Invalid email")) : A.email = i("support.required", "Required"), (m.length < te || m.length > ne) && (A.subject = i("support.subject_length", "{min}–{max} characters", {
|
|
1009
|
+
min: te,
|
|
1010
|
+
max: ne
|
|
1011
|
+
})), (g.length < 1 || g.length > re) && (A.message = i("support.message_length", "{min}–{max} characters", {
|
|
1012
|
+
min: 1,
|
|
1013
|
+
max: re
|
|
1014
|
+
})), C(A), Object.keys(A).length === 0;
|
|
1015
|
+
}, M = async (A) => {
|
|
1016
|
+
if (A.preventDefault(), !k && O()) {
|
|
1017
|
+
j(!0), C((I) => ({ ...I, submit: void 0 }));
|
|
508
1018
|
try {
|
|
509
|
-
const
|
|
510
|
-
await
|
|
511
|
-
subject:
|
|
512
|
-
content:
|
|
513
|
-
email:
|
|
514
|
-
files:
|
|
515
|
-
}),
|
|
516
|
-
} catch (
|
|
517
|
-
const
|
|
518
|
-
|
|
1019
|
+
const I = (a ?? l).trim();
|
|
1020
|
+
await t.createSupportTicket({
|
|
1021
|
+
subject: u.trim(),
|
|
1022
|
+
content: f.trim(),
|
|
1023
|
+
email: I || void 0,
|
|
1024
|
+
files: h.length > 0 ? h : void 0
|
|
1025
|
+
}), v(I);
|
|
1026
|
+
} catch (I) {
|
|
1027
|
+
const m = I instanceof U && I.message || "Failed to send. Please try again.";
|
|
1028
|
+
C((g) => ({ ...g, submit: m }));
|
|
519
1029
|
} finally {
|
|
520
|
-
|
|
1030
|
+
j(!1);
|
|
521
1031
|
}
|
|
522
1032
|
}
|
|
523
|
-
},
|
|
524
|
-
|
|
525
|
-
};
|
|
526
|
-
return
|
|
527
|
-
/* @__PURE__ */
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
"
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
"
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
1033
|
+
}, q = () => {
|
|
1034
|
+
p(""), b(""), y([]), C({}), v(null);
|
|
1035
|
+
}, z = "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)" };
|
|
1036
|
+
return T ? /* @__PURE__ */ c("div", { class: "relative flex-1 min-h-0 flex flex-col", children: [
|
|
1037
|
+
/* @__PURE__ */ c("div", { class: "flex-1 min-h-0 overflow-y-auto flex flex-col items-center gap-4 px-6 pb-3 pt-6 sm:px-8 sm:pb-4 sm:pt-8 text-center", children: [
|
|
1038
|
+
/* @__PURE__ */ o(
|
|
1039
|
+
"div",
|
|
1040
|
+
{
|
|
1041
|
+
class: "flex h-14 w-14 items-center justify-center rounded-full",
|
|
1042
|
+
style: {
|
|
1043
|
+
background: "linear-gradient(135deg, color-mix(in srgb, var(--pw-accent) 85%, white), var(--pw-accent))",
|
|
1044
|
+
color: "#fff",
|
|
1045
|
+
boxShadow: "0 0 0 8px color-mix(in srgb, var(--pw-accent) 12%, transparent), 0 8px 20px -6px color-mix(in srgb, var(--pw-accent) 45%, transparent)"
|
|
1046
|
+
},
|
|
1047
|
+
"aria-hidden": "true",
|
|
1048
|
+
children: /* @__PURE__ */ o("svg", { viewBox: "0 0 24 24", class: "h-7 w-7", children: /* @__PURE__ */ o(
|
|
1049
|
+
"path",
|
|
1050
|
+
{
|
|
1051
|
+
fill: "currentColor",
|
|
1052
|
+
d: "M12 0a12 12 0 1 0 0 24 12 12 0 0 0 0-24Zm6.93 8.2-6.85 9.29a1.01 1.01 0 0 1-1.43.19L5.76 13.77a1 1 0 1 1 1.25-1.56l4.08 3.26 6.23-8.45a1 1 0 1 1 1.61 1.18Z"
|
|
1053
|
+
}
|
|
1054
|
+
) })
|
|
1055
|
+
}
|
|
1056
|
+
),
|
|
1057
|
+
/* @__PURE__ */ o("div", { class: "text-lg font-semibold tracking-tight text-gray-900", children: i("support.success_heading", "Request submitted") }),
|
|
1058
|
+
/* @__PURE__ */ c("div", { class: "max-w-[320px] text-sm leading-relaxed text-gray-500", children: [
|
|
1059
|
+
i(
|
|
1060
|
+
"support.success_message_prefix",
|
|
1061
|
+
"We've received your message and will respond to"
|
|
1062
|
+
),
|
|
1063
|
+
" ",
|
|
1064
|
+
/* @__PURE__ */ o("b", { class: "text-gray-700", children: T }),
|
|
1065
|
+
"."
|
|
1066
|
+
] })
|
|
552
1067
|
] }),
|
|
553
|
-
/* @__PURE__ */
|
|
1068
|
+
/* @__PURE__ */ o("div", { class: z, style: D, children: /* @__PURE__ */ c("div", { class: "flex items-center justify-center gap-3", children: [
|
|
554
1069
|
/* @__PURE__ */ o(
|
|
555
1070
|
"button",
|
|
556
1071
|
{
|
|
557
1072
|
type: "button",
|
|
558
|
-
onClick:
|
|
1073
|
+
onClick: r,
|
|
559
1074
|
class: "rounded-xl px-3 py-2 text-sm font-medium text-gray-600 transition-colors hover:bg-gray-100 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",
|
|
560
|
-
children:
|
|
1075
|
+
children: n === "standalone" ? i("support.done_button", "Done") : i("nav.back_aria", "Back")
|
|
561
1076
|
}
|
|
562
1077
|
),
|
|
563
1078
|
/* @__PURE__ */ o(
|
|
564
1079
|
"button",
|
|
565
1080
|
{
|
|
566
1081
|
type: "button",
|
|
567
|
-
onClick:
|
|
1082
|
+
onClick: q,
|
|
568
1083
|
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)]",
|
|
569
1084
|
style: {
|
|
570
1085
|
background: "linear-gradient(180deg, color-mix(in srgb, var(--pw-accent) 92%, white), var(--pw-accent))",
|
|
571
1086
|
boxShadow: "0 1px 2px rgba(15,23,42,0.08), 0 6px 14px -4px color-mix(in srgb, var(--pw-accent) 50%, transparent)"
|
|
572
1087
|
},
|
|
573
|
-
children: "Send another request"
|
|
1088
|
+
children: i("support.send_another", "Send another request")
|
|
574
1089
|
}
|
|
575
1090
|
)
|
|
576
|
-
] })
|
|
577
|
-
] }) : /* @__PURE__ */
|
|
578
|
-
/* @__PURE__ */ o(
|
|
579
|
-
|
|
580
|
-
{
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
),
|
|
629
|
-
/* @__PURE__ */ o(Me, { files: A, onChange: f, disabled: g }),
|
|
630
|
-
S.submit && /* @__PURE__ */ o("p", { class: "text-xs text-red-600", children: S.submit }),
|
|
631
|
-
/* @__PURE__ */ u("div", { class: "mt-1 flex items-center justify-end gap-2", children: [
|
|
1091
|
+
] }) })
|
|
1092
|
+
] }) : /* @__PURE__ */ c("form", { onSubmit: M, class: "relative flex-1 min-h-0 flex flex-col", children: [
|
|
1093
|
+
/* @__PURE__ */ o(_t, { onClick: r, ariaLabel: i("nav.back_aria", "Back") }),
|
|
1094
|
+
/* @__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__ */ c("div", { class: "flex flex-col gap-5", children: [
|
|
1095
|
+
/* @__PURE__ */ c("div", { class: "flex flex-col gap-2 pr-10", children: [
|
|
1096
|
+
/* @__PURE__ */ o("h2", { class: "text-3xl font-bold tracking-tight text-gray-900", children: i("support.heading", "Support") }),
|
|
1097
|
+
/* @__PURE__ */ o("p", { class: "text-base leading-relaxed text-gray-600", children: i("support.instruction", "Please fill out the form below to submit your support request.") })
|
|
1098
|
+
] }),
|
|
1099
|
+
/* @__PURE__ */ c("div", { class: "flex flex-col gap-3", children: [
|
|
1100
|
+
a ? /* @__PURE__ */ c("div", { class: "rounded-2xl bg-gray-100 px-5 py-3 text-sm text-gray-600", children: [
|
|
1101
|
+
i("support.sending_as", "Sending as"),
|
|
1102
|
+
" ",
|
|
1103
|
+
/* @__PURE__ */ o("b", { class: "font-medium text-gray-900", children: a })
|
|
1104
|
+
] }) : /* @__PURE__ */ o(
|
|
1105
|
+
xe,
|
|
1106
|
+
{
|
|
1107
|
+
type: "email",
|
|
1108
|
+
placeholder: i("support.email_placeholder", "Enter your email *"),
|
|
1109
|
+
value: l,
|
|
1110
|
+
onInput: d,
|
|
1111
|
+
error: L.email,
|
|
1112
|
+
autocomplete: "email",
|
|
1113
|
+
required: !0
|
|
1114
|
+
}
|
|
1115
|
+
),
|
|
1116
|
+
/* @__PURE__ */ o(
|
|
1117
|
+
xe,
|
|
1118
|
+
{
|
|
1119
|
+
type: "text",
|
|
1120
|
+
placeholder: i("support.subject_placeholder", "Enter your subject *"),
|
|
1121
|
+
value: u,
|
|
1122
|
+
onInput: p,
|
|
1123
|
+
error: L.subject,
|
|
1124
|
+
required: !0
|
|
1125
|
+
}
|
|
1126
|
+
),
|
|
1127
|
+
/* @__PURE__ */ o(
|
|
1128
|
+
St,
|
|
1129
|
+
{
|
|
1130
|
+
placeholder: i("support.message_placeholder", "Enter your message *"),
|
|
1131
|
+
value: f,
|
|
1132
|
+
onInput: b,
|
|
1133
|
+
error: L.message,
|
|
1134
|
+
required: !0
|
|
1135
|
+
}
|
|
1136
|
+
),
|
|
1137
|
+
/* @__PURE__ */ o(Ct, { files: h, onChange: y, disabled: k })
|
|
1138
|
+
] })
|
|
1139
|
+
] }) }),
|
|
1140
|
+
/* @__PURE__ */ c("div", { class: z, style: D, children: [
|
|
1141
|
+
L.submit && /* @__PURE__ */ o("p", { class: "text-sm text-red-600", children: L.submit }),
|
|
1142
|
+
/* @__PURE__ */ c("div", { class: "flex items-center justify-end gap-3", children: [
|
|
632
1143
|
/* @__PURE__ */ o(
|
|
633
1144
|
"button",
|
|
634
1145
|
{
|
|
635
1146
|
type: "button",
|
|
636
|
-
onClick:
|
|
637
|
-
disabled:
|
|
638
|
-
class: "rounded-
|
|
639
|
-
children:
|
|
1147
|
+
onClick: r,
|
|
1148
|
+
disabled: k,
|
|
1149
|
+
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)]",
|
|
1150
|
+
children: n === "standalone" ? i("support.close_button", "Close") : i("nav.back_aria", "Back")
|
|
640
1151
|
}
|
|
641
1152
|
),
|
|
642
1153
|
/* @__PURE__ */ o(
|
|
643
1154
|
"button",
|
|
644
1155
|
{
|
|
645
1156
|
type: "submit",
|
|
646
|
-
disabled: !
|
|
647
|
-
class: "flex h-
|
|
1157
|
+
disabled: !P || k,
|
|
1158
|
+
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)]",
|
|
648
1159
|
style: {
|
|
649
|
-
background: "linear-gradient(
|
|
650
|
-
boxShadow: "0
|
|
1160
|
+
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%)",
|
|
1161
|
+
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)"
|
|
651
1162
|
},
|
|
652
|
-
children:
|
|
1163
|
+
children: k ? /* @__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") })
|
|
653
1164
|
}
|
|
654
1165
|
)
|
|
655
1166
|
] })
|
|
656
1167
|
] })
|
|
657
1168
|
] });
|
|
658
1169
|
}
|
|
659
|
-
function
|
|
660
|
-
return /* @__PURE__ */
|
|
661
|
-
|
|
1170
|
+
function _t({ onClick: t, ariaLabel: e }) {
|
|
1171
|
+
return /* @__PURE__ */ o(
|
|
1172
|
+
"button",
|
|
1173
|
+
{
|
|
1174
|
+
type: "button",
|
|
1175
|
+
onClick: t,
|
|
1176
|
+
"aria-label": e,
|
|
1177
|
+
class: "absolute right-4 top-4 z-10 flex h-8 w-8 items-center justify-center rounded-full text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-700 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",
|
|
1178
|
+
children: /* @__PURE__ */ c("svg", { width: "18", height: "18", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
1179
|
+
/* @__PURE__ */ o(
|
|
1180
|
+
"path",
|
|
1181
|
+
{
|
|
1182
|
+
d: "M5 8h8a4 4 0 0 1 0 8H9",
|
|
1183
|
+
stroke: "currentColor",
|
|
1184
|
+
"stroke-width": "1.75",
|
|
1185
|
+
"stroke-linecap": "round",
|
|
1186
|
+
"stroke-linejoin": "round"
|
|
1187
|
+
}
|
|
1188
|
+
),
|
|
1189
|
+
/* @__PURE__ */ o(
|
|
1190
|
+
"path",
|
|
1191
|
+
{
|
|
1192
|
+
d: "M8 4 4 8l4 4",
|
|
1193
|
+
stroke: "currentColor",
|
|
1194
|
+
"stroke-width": "1.75",
|
|
1195
|
+
"stroke-linecap": "round",
|
|
1196
|
+
"stroke-linejoin": "round"
|
|
1197
|
+
}
|
|
1198
|
+
)
|
|
1199
|
+
] })
|
|
1200
|
+
}
|
|
1201
|
+
);
|
|
1202
|
+
}
|
|
1203
|
+
function xe({
|
|
1204
|
+
type: t,
|
|
1205
|
+
placeholder: e,
|
|
1206
|
+
value: n,
|
|
1207
|
+
onInput: r,
|
|
1208
|
+
error: i,
|
|
1209
|
+
autocomplete: s,
|
|
1210
|
+
required: a
|
|
1211
|
+
}) {
|
|
1212
|
+
return /* @__PURE__ */ c("div", { children: [
|
|
662
1213
|
/* @__PURE__ */ o(
|
|
663
1214
|
"input",
|
|
664
1215
|
{
|
|
665
|
-
type:
|
|
666
|
-
value:
|
|
667
|
-
|
|
1216
|
+
type: t,
|
|
1217
|
+
value: n,
|
|
1218
|
+
placeholder: e,
|
|
1219
|
+
onInput: (l) => r(l.target.value),
|
|
668
1220
|
autocomplete: s,
|
|
669
|
-
required:
|
|
670
|
-
class: `h-
|
|
1221
|
+
required: a,
|
|
1222
|
+
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)]"}`
|
|
671
1223
|
}
|
|
672
1224
|
),
|
|
673
|
-
i && /* @__PURE__ */ o("span", { class: "text-
|
|
1225
|
+
i && /* @__PURE__ */ o("span", { class: "mt-1 ml-2 block text-sm text-red-600", children: i })
|
|
674
1226
|
] });
|
|
675
1227
|
}
|
|
676
|
-
function
|
|
677
|
-
|
|
678
|
-
|
|
1228
|
+
function St({
|
|
1229
|
+
placeholder: t,
|
|
1230
|
+
value: e,
|
|
1231
|
+
onInput: n,
|
|
1232
|
+
error: r,
|
|
1233
|
+
required: i
|
|
1234
|
+
}) {
|
|
1235
|
+
return /* @__PURE__ */ c("div", { children: [
|
|
679
1236
|
/* @__PURE__ */ o(
|
|
680
1237
|
"textarea",
|
|
681
1238
|
{
|
|
682
1239
|
value: e,
|
|
683
|
-
|
|
1240
|
+
placeholder: t,
|
|
1241
|
+
onInput: (s) => n(s.target.value),
|
|
684
1242
|
required: i,
|
|
685
|
-
rows:
|
|
686
|
-
class: `min-h-[
|
|
1243
|
+
rows: 5,
|
|
1244
|
+
class: `min-h-[120px] w-full rounded-2xl bg-gray-100 px-5 py-3.5 text-base leading-relaxed text-gray-900 outline-none transition-all placeholder:text-gray-500 hover:bg-gray-200/60 focus:bg-gray-200/60 ${r ? "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)]"}`
|
|
687
1245
|
}
|
|
688
1246
|
),
|
|
689
|
-
|
|
1247
|
+
r && /* @__PURE__ */ o("span", { class: "mt-1 ml-2 block text-sm text-red-600", children: r })
|
|
690
1248
|
] });
|
|
691
1249
|
}
|
|
692
|
-
function
|
|
693
|
-
const
|
|
694
|
-
if (!
|
|
695
|
-
|
|
696
|
-
const
|
|
697
|
-
if (
|
|
698
|
-
|
|
1250
|
+
function Ct({ files: t, onChange: e, disabled: n }) {
|
|
1251
|
+
const { t: r } = w(), i = R(null), [s, a] = x(!1), [l, d] = x(null), u = (p) => {
|
|
1252
|
+
if (!p || n) return;
|
|
1253
|
+
d(null);
|
|
1254
|
+
const f = Array.from(p);
|
|
1255
|
+
if (t.length + f.length > ie) {
|
|
1256
|
+
d(r("support.too_many_files", "Up to {max} files", { max: ie }));
|
|
699
1257
|
return;
|
|
700
1258
|
}
|
|
701
|
-
const b =
|
|
702
|
-
(
|
|
1259
|
+
const b = f.filter(
|
|
1260
|
+
(h) => me.includes(h.type) && h.size <= kt
|
|
703
1261
|
);
|
|
704
|
-
if (b.length !==
|
|
705
|
-
|
|
1262
|
+
if (b.length !== f.length) {
|
|
1263
|
+
d(r("support.invalid_file", "Only JPEG/PNG/WebP, ≤ 10MB each"));
|
|
706
1264
|
return;
|
|
707
1265
|
}
|
|
708
|
-
e([...
|
|
1266
|
+
e([...t, ...b]);
|
|
709
1267
|
};
|
|
710
|
-
return /* @__PURE__ */
|
|
711
|
-
/* @__PURE__ */ o("span", { class: "text-xs font-medium text-gray-700", children: "Attachments (optional)" }),
|
|
712
|
-
/* @__PURE__ */
|
|
1268
|
+
return /* @__PURE__ */ c("div", { children: [
|
|
1269
|
+
/* @__PURE__ */ o("span", { class: "text-xs font-medium text-gray-700", children: r("support.attachments_label", "Attachments (optional)") }),
|
|
1270
|
+
/* @__PURE__ */ c(
|
|
713
1271
|
"div",
|
|
714
1272
|
{
|
|
715
1273
|
role: "button",
|
|
716
1274
|
tabIndex: 0,
|
|
717
|
-
"aria-label": "Attachments upload",
|
|
718
|
-
onClick: () => !
|
|
719
|
-
onDragOver: (
|
|
720
|
-
|
|
1275
|
+
"aria-label": r("support.attachments_aria", "Attachments upload"),
|
|
1276
|
+
onClick: () => !n && i.current?.click(),
|
|
1277
|
+
onDragOver: (p) => {
|
|
1278
|
+
p.preventDefault(), n || a(!0);
|
|
721
1279
|
},
|
|
722
|
-
onDragLeave: () =>
|
|
723
|
-
onDrop: (
|
|
724
|
-
|
|
1280
|
+
onDragLeave: () => a(!1),
|
|
1281
|
+
onDrop: (p) => {
|
|
1282
|
+
p.preventDefault(), a(!1), u(p.dataTransfer?.files ?? null);
|
|
725
1283
|
},
|
|
726
|
-
class: `mt-1.5 cursor-pointer rounded-2xl border border-dashed p-3.5 text-center transition-all ${
|
|
1284
|
+
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"} ${n ? "cursor-not-allowed opacity-60" : ""}`,
|
|
727
1285
|
children: [
|
|
728
|
-
/* @__PURE__ */ o("div", { class: "text-xs text-gray-500", children: "Drop images here or click to select" }),
|
|
729
|
-
/* @__PURE__ */
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
" files, ≤ 10MB each"
|
|
733
|
-
] })
|
|
1286
|
+
/* @__PURE__ */ o("div", { class: "text-xs text-gray-500", children: r("support.dropzone_text", "Drop images here or click to select") }),
|
|
1287
|
+
/* @__PURE__ */ o("div", { class: "mt-0.5 text-[11px] text-gray-400", children: r("support.file_requirements", "JPEG/PNG/WebP, up to {max} files, ≤ 10MB each", {
|
|
1288
|
+
max: ie
|
|
1289
|
+
}) })
|
|
734
1290
|
]
|
|
735
1291
|
}
|
|
736
1292
|
),
|
|
737
1293
|
/* @__PURE__ */ o(
|
|
738
1294
|
"input",
|
|
739
1295
|
{
|
|
740
|
-
ref:
|
|
1296
|
+
ref: i,
|
|
741
1297
|
type: "file",
|
|
742
1298
|
multiple: !0,
|
|
743
|
-
accept:
|
|
1299
|
+
accept: me.join(","),
|
|
744
1300
|
class: "hidden",
|
|
745
|
-
onChange: (
|
|
746
|
-
|
|
1301
|
+
onChange: (p) => {
|
|
1302
|
+
u(p.target.files), p.currentTarget.value = "";
|
|
747
1303
|
}
|
|
748
1304
|
}
|
|
749
1305
|
),
|
|
750
1306
|
l && /* @__PURE__ */ o("p", { class: "mt-1 text-xs text-red-600", children: l }),
|
|
751
|
-
|
|
1307
|
+
t.length > 0 && /* @__PURE__ */ o("ul", { class: "mt-2 flex flex-col gap-1", children: t.map((p, f) => /* @__PURE__ */ c(
|
|
752
1308
|
"li",
|
|
753
1309
|
{
|
|
754
1310
|
class: "flex items-center justify-between gap-2 rounded bg-gray-50 px-2 py-1 text-xs",
|
|
755
1311
|
children: [
|
|
756
|
-
/* @__PURE__ */ o("span", { class: "truncate text-gray-700", children:
|
|
1312
|
+
/* @__PURE__ */ o("span", { class: "truncate text-gray-700", children: p.name }),
|
|
757
1313
|
/* @__PURE__ */ o(
|
|
758
1314
|
"button",
|
|
759
1315
|
{
|
|
760
1316
|
type: "button",
|
|
761
1317
|
onClick: () => {
|
|
762
|
-
const b = [...
|
|
763
|
-
b.splice(
|
|
1318
|
+
const b = [...t];
|
|
1319
|
+
b.splice(f, 1), e(b);
|
|
764
1320
|
},
|
|
765
|
-
disabled:
|
|
1321
|
+
disabled: n,
|
|
766
1322
|
class: "text-gray-500 hover:text-red-600 disabled:cursor-not-allowed disabled:opacity-60",
|
|
767
|
-
"aria-label":
|
|
1323
|
+
"aria-label": r("support.remove_file_aria", "Remove {filename}", { filename: p.name }),
|
|
768
1324
|
children: "✕"
|
|
769
1325
|
}
|
|
770
1326
|
)
|
|
771
1327
|
]
|
|
772
1328
|
},
|
|
773
|
-
`${
|
|
1329
|
+
`${p.name}-${p.size}-${f}`
|
|
774
1330
|
)) })
|
|
775
1331
|
] });
|
|
776
1332
|
}
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
1333
|
+
const It = {
|
|
1334
|
+
day: "cta.get_plan_daily",
|
|
1335
|
+
week: "cta.get_plan_weekly",
|
|
1336
|
+
month: "cta.get_plan_monthly",
|
|
1337
|
+
year: "cta.get_plan_yearly"
|
|
1338
|
+
}, Lt = {
|
|
1339
|
+
day: "Get Daily Plan",
|
|
1340
|
+
week: "Get Weekly Plan",
|
|
1341
|
+
month: "Get Monthly Plan",
|
|
1342
|
+
year: "Get Yearly Plan"
|
|
1343
|
+
};
|
|
1344
|
+
function At(t, e, n, r) {
|
|
1345
|
+
if (e === "close") return r("cta.close", "Close");
|
|
1346
|
+
if (!t) return r("cta.continue", "Continue");
|
|
1347
|
+
if (!n && t.trial_days && t.interval && t.interval !== "lifetime")
|
|
1348
|
+
return r("cta.start_trial", "Start {days}-Day Free Trial", { days: t.trial_days });
|
|
1349
|
+
if (!t.interval || t.interval === "lifetime")
|
|
1350
|
+
return r("cta.get_lifetime_access", "Get Lifetime Access");
|
|
1351
|
+
const i = It[t.interval];
|
|
1352
|
+
return i ? r(i, Lt[t.interval]) : r("cta.get_plan_generic", "Get {interval} Plan", {
|
|
1353
|
+
interval: Et(t.interval)
|
|
1354
|
+
});
|
|
1355
|
+
}
|
|
1356
|
+
function Et(t) {
|
|
1357
|
+
return t.length ? t[0].toUpperCase() + t.slice(1) : t;
|
|
1358
|
+
}
|
|
1359
|
+
function Tt({ block: t, ctx: e }) {
|
|
1360
|
+
const { t: n } = w(), [r, i] = x(!1), s = t.priceId ?? e.selectedPriceId, a = r || t.action === "checkout" && !s, l = s ? e.bootstrap.prices.find((f) => f.id === s) ?? null : null, d = e.bootstrap.user?.had_previous_trial ?? !1, u = t.label ?? At(l, t.action, d, n);
|
|
1361
|
+
return /* @__PURE__ */ c(
|
|
780
1362
|
"button",
|
|
781
1363
|
{
|
|
782
1364
|
type: "button",
|
|
783
|
-
disabled:
|
|
1365
|
+
disabled: a,
|
|
784
1366
|
onClick: async () => {
|
|
785
|
-
if (!
|
|
786
|
-
|
|
1367
|
+
if (!a) {
|
|
1368
|
+
i(!0);
|
|
787
1369
|
try {
|
|
788
|
-
await e.onAction(
|
|
1370
|
+
await e.onAction(t.action, { priceId: s });
|
|
789
1371
|
} finally {
|
|
790
|
-
|
|
1372
|
+
i(!1);
|
|
791
1373
|
}
|
|
792
1374
|
}
|
|
793
1375
|
},
|
|
794
|
-
class: "relative flex h-12 w-full items-center justify-center overflow-hidden rounded-
|
|
1376
|
+
class: "pw-cta-shimmer relative flex min-h-12 w-full items-center justify-center overflow-hidden rounded-3xl px-5 py-2 text-center text-base font-semibold leading-tight text-white transition-transform duration-150 active:scale-[0.98] disabled:cursor-not-allowed disabled:opacity-60 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",
|
|
795
1377
|
style: {
|
|
796
|
-
background: "linear-gradient(
|
|
797
|
-
boxShadow: "0
|
|
1378
|
+
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%)",
|
|
1379
|
+
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)"
|
|
798
1380
|
},
|
|
799
|
-
children:
|
|
1381
|
+
children: [
|
|
1382
|
+
/* @__PURE__ */ o(
|
|
1383
|
+
"span",
|
|
1384
|
+
{
|
|
1385
|
+
class: "absolute inset-0 opacity-40",
|
|
1386
|
+
style: {
|
|
1387
|
+
background: "radial-gradient(circle at 50% 0%, color-mix(in srgb, white 40%, transparent) 0%, transparent 70%)"
|
|
1388
|
+
},
|
|
1389
|
+
"aria-hidden": "true"
|
|
1390
|
+
}
|
|
1391
|
+
),
|
|
1392
|
+
r ? /* @__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: u })
|
|
1393
|
+
]
|
|
800
1394
|
}
|
|
801
1395
|
);
|
|
802
1396
|
}
|
|
803
|
-
function
|
|
804
|
-
const e =
|
|
805
|
-
if (
|
|
1397
|
+
function Bt({ ctx: t }) {
|
|
1398
|
+
const { t: e } = w(), n = t.authSession, r = t.auth, [i, s] = x(!1), a = () => t.onAction("support");
|
|
1399
|
+
if (n && !n.user.is_anonymous) {
|
|
806
1400
|
const l = async () => {
|
|
807
|
-
if (!(!
|
|
808
|
-
|
|
1401
|
+
if (!(!r || i)) {
|
|
1402
|
+
s(!0);
|
|
809
1403
|
try {
|
|
810
|
-
await
|
|
1404
|
+
await r.signOut();
|
|
811
1405
|
} catch {
|
|
812
1406
|
} finally {
|
|
813
|
-
|
|
1407
|
+
s(!1);
|
|
814
1408
|
}
|
|
815
1409
|
}
|
|
816
1410
|
};
|
|
817
|
-
return /* @__PURE__ */
|
|
818
|
-
/* @__PURE__ */
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
/* @__PURE__ */ o(
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
class: "font-medium text-gray-600 underline-offset-2 hover:underline disabled:cursor-not-allowed disabled:opacity-60 focus:outline-none focus-visible:underline",
|
|
828
|
-
children: n ? "Signing out…" : "Sign out"
|
|
829
|
-
}
|
|
830
|
-
),
|
|
831
|
-
/* @__PURE__ */ o(Q, {}),
|
|
832
|
-
/* @__PURE__ */ o(J, { onClick: s })
|
|
1411
|
+
return /* @__PURE__ */ c("div", { class: "-mt-3 flex flex-col items-center gap-1.5 pt-1 text-center text-[13px] text-gray-500", children: [
|
|
1412
|
+
/* @__PURE__ */ c("span", { children: [
|
|
1413
|
+
e("session.signed_in_as_prefix", "Signed in as"),
|
|
1414
|
+
" ",
|
|
1415
|
+
/* @__PURE__ */ o("b", { class: "font-medium text-gray-700", children: n.user.email })
|
|
1416
|
+
] }),
|
|
1417
|
+
/* @__PURE__ */ c("div", { class: "flex items-center justify-center gap-3", children: [
|
|
1418
|
+
/* @__PURE__ */ o($, { onClick: l, disabled: !r || i, children: i ? e("session.signing_out", "Signing out…") : e("session.sign_out", "Sign Out") }),
|
|
1419
|
+
/* @__PURE__ */ o(be, {}),
|
|
1420
|
+
/* @__PURE__ */ o($, { onClick: a, children: e("session.contact_support", "Contact Support") })
|
|
833
1421
|
] })
|
|
834
1422
|
] });
|
|
835
1423
|
}
|
|
836
|
-
return /* @__PURE__ */
|
|
837
|
-
/* @__PURE__ */ o(
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
type: "button",
|
|
841
|
-
onClick: () => r.onAction("restore"),
|
|
842
|
-
class: "font-medium text-gray-600 underline-offset-2 hover:underline focus:outline-none focus-visible:underline",
|
|
843
|
-
children: "Restore purchases"
|
|
844
|
-
}
|
|
845
|
-
),
|
|
846
|
-
/* @__PURE__ */ o(Q, {}),
|
|
847
|
-
/* @__PURE__ */ o(J, { onClick: s })
|
|
1424
|
+
return /* @__PURE__ */ c("div", { class: "-mt-3 flex items-center justify-center gap-3 pt-1 text-center text-[13px]", children: [
|
|
1425
|
+
/* @__PURE__ */ o($, { onClick: () => t.onAction("restore"), children: e("session.restore_purchases", "Restore purchases") }),
|
|
1426
|
+
/* @__PURE__ */ o(be, {}),
|
|
1427
|
+
/* @__PURE__ */ o($, { onClick: a, children: e("session.contact_support", "Contact Support") })
|
|
848
1428
|
] });
|
|
849
1429
|
}
|
|
850
|
-
function
|
|
1430
|
+
function $({
|
|
1431
|
+
onClick: t,
|
|
1432
|
+
disabled: e,
|
|
1433
|
+
children: n
|
|
1434
|
+
}) {
|
|
851
1435
|
return /* @__PURE__ */ o(
|
|
852
1436
|
"button",
|
|
853
1437
|
{
|
|
854
1438
|
type: "button",
|
|
855
|
-
onClick:
|
|
856
|
-
|
|
857
|
-
|
|
1439
|
+
onClick: t,
|
|
1440
|
+
disabled: e,
|
|
1441
|
+
class: "font-semibold transition-opacity hover:opacity-80 disabled:cursor-not-allowed disabled:opacity-60 focus:outline-none focus-visible:opacity-80",
|
|
1442
|
+
style: { color: "var(--pw-accent)" },
|
|
1443
|
+
children: n
|
|
858
1444
|
}
|
|
859
1445
|
);
|
|
860
1446
|
}
|
|
861
|
-
function
|
|
1447
|
+
function be() {
|
|
862
1448
|
return /* @__PURE__ */ o("span", { class: "h-1 w-1 rounded-full bg-gray-300", "aria-hidden": "true" });
|
|
863
1449
|
}
|
|
864
|
-
function
|
|
865
|
-
return
|
|
1450
|
+
function Mt({ block: t }) {
|
|
1451
|
+
return t.items.length ? /* @__PURE__ */ o("ul", { class: "flex flex-col gap-2.5", role: "list", children: t.items.map((e) => /* @__PURE__ */ c("li", { class: "flex items-start gap-3 text-sm text-gray-700", children: [
|
|
866
1452
|
/* @__PURE__ */ o(
|
|
867
|
-
"
|
|
1453
|
+
"svg",
|
|
868
1454
|
{
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
1455
|
+
width: "18",
|
|
1456
|
+
height: "18",
|
|
1457
|
+
viewBox: "0 0 20 20",
|
|
1458
|
+
fill: "none",
|
|
1459
|
+
class: "mt-0.5 flex-shrink-0 text-emerald-500",
|
|
874
1460
|
"aria-hidden": "true",
|
|
875
|
-
children: /* @__PURE__ */ o(
|
|
1461
|
+
children: /* @__PURE__ */ o(
|
|
876
1462
|
"path",
|
|
877
1463
|
{
|
|
878
|
-
d: "
|
|
1464
|
+
d: "M4 10.5l3.5 3.5 8.5-8.5",
|
|
879
1465
|
stroke: "currentColor",
|
|
880
1466
|
"stroke-width": "2.5",
|
|
881
1467
|
"stroke-linecap": "round",
|
|
882
1468
|
"stroke-linejoin": "round"
|
|
883
1469
|
}
|
|
884
|
-
)
|
|
1470
|
+
)
|
|
885
1471
|
}
|
|
886
1472
|
),
|
|
887
|
-
/* @__PURE__ */
|
|
1473
|
+
/* @__PURE__ */ c("div", { class: "flex flex-col gap-0.5", children: [
|
|
888
1474
|
/* @__PURE__ */ o("span", { class: "font-medium leading-snug text-gray-900", children: e.name }),
|
|
889
|
-
e.desc ? /* @__PURE__ */ o("span", { class: "text-xs leading-relaxed text-gray-
|
|
1475
|
+
e.desc ? /* @__PURE__ */ o("span", { class: "text-xs leading-relaxed text-gray-400", children: e.desc }) : null
|
|
890
1476
|
] })
|
|
891
1477
|
] }, e.id)) }) : null;
|
|
892
1478
|
}
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
}
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
1479
|
+
function Pt({ block: t }) {
|
|
1480
|
+
const { t: e } = w(), n = t.title ?? e("pricing.money_back", "30-day money-back guarantee"), r = t.subtitle, i = (t.icon ?? "dollar_shield") !== "none", s = Ot(n);
|
|
1481
|
+
return /* @__PURE__ */ c("div", { class: "flex flex-col items-center gap-1.5 border-b-1 pb-4 mb-1 border-gray-100", children: [
|
|
1482
|
+
/* @__PURE__ */ c("div", { class: "inline-flex items-center gap-2 text-[12px] text-gray-700", children: [
|
|
1483
|
+
i ? /* @__PURE__ */ o(Ut, {}) : null,
|
|
1484
|
+
s ? /* @__PURE__ */ c("span", { children: [
|
|
1485
|
+
/* @__PURE__ */ o("b", { class: "font-bold text-gray-900", children: s.bold }),
|
|
1486
|
+
" ",
|
|
1487
|
+
/* @__PURE__ */ o("span", { class: "font-medium", children: s.rest })
|
|
1488
|
+
] }) : /* @__PURE__ */ o("span", { class: "font-medium", children: n })
|
|
1489
|
+
] }),
|
|
1490
|
+
r ? /* @__PURE__ */ o("span", { class: "text-center text-xs leading-relaxed text-gray-500", children: r }) : null
|
|
1491
|
+
] });
|
|
1492
|
+
}
|
|
1493
|
+
function Ot(t) {
|
|
1494
|
+
const e = t.match(/^(\d+[-\s]?days?)\s+(.+)$/i);
|
|
1495
|
+
return e ? { bold: e[1], rest: e[2] } : null;
|
|
1496
|
+
}
|
|
1497
|
+
function Ut() {
|
|
1498
|
+
return /* @__PURE__ */ c(
|
|
1499
|
+
"svg",
|
|
1500
|
+
{
|
|
1501
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1502
|
+
viewBox: "0 0 24 24",
|
|
1503
|
+
fill: "none",
|
|
1504
|
+
width: "16",
|
|
1505
|
+
height: "16",
|
|
1506
|
+
class: "flex-shrink-0 text-emerald-500",
|
|
1507
|
+
"aria-hidden": "true",
|
|
1508
|
+
children: [
|
|
1509
|
+
/* @__PURE__ */ o(
|
|
1510
|
+
"path",
|
|
1511
|
+
{
|
|
1512
|
+
d: "M12 2 4 5v6c0 5.25 3.5 9.5 8 11 4.5-1.5 8-5.75 8-11V5l-8-3Z",
|
|
1513
|
+
stroke: "currentColor",
|
|
1514
|
+
"stroke-width": "2",
|
|
1515
|
+
"stroke-linejoin": "round"
|
|
1516
|
+
}
|
|
1517
|
+
),
|
|
1518
|
+
/* @__PURE__ */ o(
|
|
1519
|
+
"path",
|
|
1520
|
+
{
|
|
1521
|
+
d: "m9 12 2 2 4-4",
|
|
1522
|
+
stroke: "currentColor",
|
|
1523
|
+
"stroke-width": "2",
|
|
1524
|
+
"stroke-linecap": "round",
|
|
1525
|
+
"stroke-linejoin": "round"
|
|
1526
|
+
}
|
|
1527
|
+
)
|
|
1528
|
+
]
|
|
1529
|
+
}
|
|
1530
|
+
);
|
|
1531
|
+
}
|
|
1532
|
+
const Pe = 24, jt = 16, Rt = 2;
|
|
1533
|
+
function zt(t, e) {
|
|
1534
|
+
const n = e * Rt;
|
|
1535
|
+
let r = Pe;
|
|
1536
|
+
for (t.style.fontSize = `${r}px`; t.scrollHeight > n && r > jt; )
|
|
1537
|
+
r -= 1, t.style.fontSize = `${r}px`;
|
|
1538
|
+
}
|
|
1539
|
+
function Dt({ block: t, ctx: e }) {
|
|
1540
|
+
const n = t.level ?? 1, r = `h${n}`, i = n === 1 ? "text-[22px] sm:text-2xl font-semibold leading-tight text-center text-balance text-gray-800" : n === 2 ? "text-xl font-semibold leading-snug text-gray-900 tracking-tight" : "text-base font-medium text-gray-900", s = R(null), a = n === 1 && !!e.bootstrap.settings.title_auto_fit;
|
|
1541
|
+
return B(() => {
|
|
1542
|
+
if (!a || !s.current) return;
|
|
1543
|
+
const l = getComputedStyle(s.current), d = parseFloat(l.lineHeight) || Pe * 1.5;
|
|
1544
|
+
zt(s.current, d);
|
|
1545
|
+
}, [a, t.text]), /* @__PURE__ */ o(r, { ref: s, class: i, children: t.text });
|
|
1546
|
+
}
|
|
1547
|
+
function qt(t) {
|
|
1548
|
+
const e = t.local ?? { currency: t.currency, amount: t.amount };
|
|
1549
|
+
if (t.interval === "year") {
|
|
1550
|
+
const n = (t.interval_count ?? 1) * 12;
|
|
1551
|
+
return { amount: e.amount / n, currency: e.currency };
|
|
1552
|
+
}
|
|
1553
|
+
return { amount: e.amount, currency: e.currency };
|
|
1554
|
+
}
|
|
1555
|
+
function oe(t, e) {
|
|
1556
|
+
const n = t % 1 !== 0 ? 2 : 0;
|
|
910
1557
|
try {
|
|
911
|
-
|
|
1558
|
+
const r = new Intl.NumberFormat(void 0, {
|
|
912
1559
|
style: "currency",
|
|
913
|
-
currency: e
|
|
914
|
-
|
|
915
|
-
|
|
1560
|
+
currency: e,
|
|
1561
|
+
currencyDisplay: "narrowSymbol",
|
|
1562
|
+
maximumFractionDigits: n,
|
|
1563
|
+
minimumFractionDigits: n
|
|
1564
|
+
}).formatToParts(t);
|
|
1565
|
+
let i = "", s = "";
|
|
1566
|
+
for (const a of r)
|
|
1567
|
+
a.type === "currency" ? i = a.value : a.type !== "literal" && (s += a.value);
|
|
1568
|
+
return { currency: i || e, amount: s.trim() };
|
|
916
1569
|
} catch {
|
|
917
|
-
return
|
|
1570
|
+
return { currency: e, amount: String(t) };
|
|
1571
|
+
}
|
|
1572
|
+
}
|
|
1573
|
+
function le(t, e) {
|
|
1574
|
+
const { amount: n, currency: r } = qt(t);
|
|
1575
|
+
if (!e) {
|
|
1576
|
+
const { currency: l, amount: d } = oe(n, r);
|
|
1577
|
+
return { currency: l, amount: d, originalAmount: null };
|
|
918
1578
|
}
|
|
1579
|
+
const i = n * (1 - e / 100), s = oe(i, r), a = oe(n, r);
|
|
1580
|
+
return {
|
|
1581
|
+
currency: s.currency,
|
|
1582
|
+
amount: s.amount,
|
|
1583
|
+
originalAmount: `${a.currency}${a.amount}`
|
|
1584
|
+
};
|
|
1585
|
+
}
|
|
1586
|
+
function se(t, e) {
|
|
1587
|
+
if (!t || t.length === 0) return null;
|
|
1588
|
+
const n = t.find(
|
|
1589
|
+
(i) => i.price_id === e && i.discount_percent && i.discount_percent > 0
|
|
1590
|
+
);
|
|
1591
|
+
return n || (t.find(
|
|
1592
|
+
(i) => i.price_id == null && i.discount_percent && i.discount_percent > 0
|
|
1593
|
+
) ?? null);
|
|
919
1594
|
}
|
|
920
|
-
function
|
|
921
|
-
if (
|
|
922
|
-
|
|
923
|
-
|
|
1595
|
+
function Oe(t, e) {
|
|
1596
|
+
if (t.label) return t.label.toUpperCase();
|
|
1597
|
+
if (!t.interval || t.interval === "lifetime")
|
|
1598
|
+
return e("pricing.plan_label.lifetime", "LIFETIME");
|
|
1599
|
+
const r = {
|
|
1600
|
+
day: { key: "pricing.plan_label.daily", fallback: "DAILY PLAN" },
|
|
1601
|
+
week: { key: "pricing.plan_label.weekly", fallback: "WEEKLY PLAN" },
|
|
1602
|
+
month: { key: "pricing.plan_label.monthly", fallback: "MONTHLY PLAN" },
|
|
1603
|
+
year: { key: "pricing.plan_label.yearly", fallback: "YEARLY PLAN" }
|
|
1604
|
+
}[t.interval];
|
|
1605
|
+
return r ? e(r.key, r.fallback) : `${t.interval.toUpperCase()} PLAN`;
|
|
924
1606
|
}
|
|
925
|
-
function
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
const
|
|
1607
|
+
function ce(t, e) {
|
|
1608
|
+
if (!t.interval || t.interval === "lifetime")
|
|
1609
|
+
return e("pricing.interval.lifetime_short", "lifetime");
|
|
1610
|
+
if (t.interval === "year") return e("pricing.interval.month", "month");
|
|
1611
|
+
const n = t.interval_count ?? 1;
|
|
1612
|
+
return n === 1 ? e(`pricing.interval.${t.interval}`, t.interval) : `${n} ${t.interval}s`;
|
|
1613
|
+
}
|
|
1614
|
+
function Nt({ block: t, ctx: e }) {
|
|
1615
|
+
const { t: n } = w(), r = t.priceIds && t.priceIds.length > 0 ? new Set(t.priceIds) : null, i = e.bootstrap.prices.filter((a) => !r || r.has(a.id));
|
|
1616
|
+
if (i.length === 0)
|
|
1617
|
+
return /* @__PURE__ */ o("p", { class: "text-sm text-gray-500", children: n("pricing.no_prices", "No prices available.") });
|
|
1618
|
+
const s = t.popular_label ?? n("pricing.most_popular", "Most popular");
|
|
1619
|
+
if (t.view === "compact")
|
|
1620
|
+
return /* @__PURE__ */ o(
|
|
1621
|
+
"div",
|
|
1622
|
+
{
|
|
1623
|
+
class: "flex w-full flex-col",
|
|
1624
|
+
role: "radiogroup",
|
|
1625
|
+
"aria-label": n("pricing.plans_aria", "Plans"),
|
|
1626
|
+
children: i.map((a, l) => /* @__PURE__ */ o(
|
|
1627
|
+
Vt,
|
|
1628
|
+
{
|
|
1629
|
+
price: a,
|
|
1630
|
+
isLast: l === i.length - 1,
|
|
1631
|
+
isPopular: t.popular_price_id === a.id,
|
|
1632
|
+
popularLabel: s,
|
|
1633
|
+
offer: se(e.bootstrap.offers, a.id),
|
|
1634
|
+
selected: e.selectedPriceId === a.id,
|
|
1635
|
+
onSelect: () => {
|
|
1636
|
+
e.setSelectedPriceId(a.id), e.onAction("price_selected", { priceId: a.id, price: a });
|
|
1637
|
+
},
|
|
1638
|
+
t: n
|
|
1639
|
+
},
|
|
1640
|
+
a.id
|
|
1641
|
+
))
|
|
1642
|
+
}
|
|
1643
|
+
);
|
|
1644
|
+
if (t.view === "horizontal") {
|
|
1645
|
+
const a = Math.min(i.length, 3);
|
|
1646
|
+
return /* @__PURE__ */ o(
|
|
1647
|
+
"div",
|
|
1648
|
+
{
|
|
1649
|
+
class: "grid items-stretch gap-2",
|
|
1650
|
+
style: { gridTemplateColumns: `repeat(${a}, minmax(0, 1fr))` },
|
|
1651
|
+
role: "radiogroup",
|
|
1652
|
+
"aria-label": n("pricing.plans_aria", "Plans"),
|
|
1653
|
+
children: i.map((l) => /* @__PURE__ */ o(
|
|
1654
|
+
$t,
|
|
1655
|
+
{
|
|
1656
|
+
price: l,
|
|
1657
|
+
isPopular: t.popular_price_id === l.id,
|
|
1658
|
+
popularLabel: s,
|
|
1659
|
+
offer: se(e.bootstrap.offers, l.id),
|
|
1660
|
+
selected: e.selectedPriceId === l.id,
|
|
1661
|
+
onSelect: () => {
|
|
1662
|
+
e.setSelectedPriceId(l.id), e.onAction("price_selected", { priceId: l.id, price: l });
|
|
1663
|
+
},
|
|
1664
|
+
t: n
|
|
1665
|
+
},
|
|
1666
|
+
l.id
|
|
1667
|
+
))
|
|
1668
|
+
}
|
|
1669
|
+
);
|
|
1670
|
+
}
|
|
930
1671
|
return /* @__PURE__ */ o(
|
|
931
1672
|
"div",
|
|
932
1673
|
{
|
|
933
|
-
class:
|
|
934
|
-
style: i ? { gridTemplateColumns: `repeat(${l}, minmax(0, 1fr))` } : void 0,
|
|
1674
|
+
class: "flex flex-col gap-2",
|
|
935
1675
|
role: "radiogroup",
|
|
936
|
-
"aria-label": "Plans",
|
|
937
|
-
children:
|
|
938
|
-
const
|
|
939
|
-
return /* @__PURE__ */
|
|
1676
|
+
"aria-label": n("pricing.plans_aria", "Plans"),
|
|
1677
|
+
children: i.map((a) => {
|
|
1678
|
+
const l = e.selectedPriceId === a.id, d = t.popular_price_id === a.id, p = se(e.bootstrap.offers, a.id)?.discount_percent ?? null, { currency: f, amount: b, originalAmount: h } = le(a, p);
|
|
1679
|
+
return /* @__PURE__ */ c(
|
|
940
1680
|
"button",
|
|
941
1681
|
{
|
|
942
1682
|
type: "button",
|
|
943
1683
|
role: "radio",
|
|
944
|
-
"aria-checked":
|
|
1684
|
+
"aria-checked": l,
|
|
945
1685
|
onClick: () => {
|
|
946
1686
|
e.setSelectedPriceId(a.id), e.onAction("price_selected", { priceId: a.id, price: a });
|
|
947
1687
|
},
|
|
948
1688
|
class: [
|
|
949
|
-
"group relative rounded-2xl border
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
1689
|
+
"group relative inline-flex w-full mx-auto items-center justify-between flex-row-reverse gap-4 rounded-2xl border-2 p-4 text-left transition-colors duration-150 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",
|
|
1690
|
+
// Везде border 2px — selection выражается только цветом, layout
|
|
1691
|
+
// не прыгает (равная толщина у selected/unselected). Цветовая
|
|
1692
|
+
// разница accent vs gray достаточно сильная для visual hierarchy.
|
|
1693
|
+
l ? "border-[var(--pw-accent)] bg-transparent" : "border-gray-200 bg-transparent hover:bg-gray-50"
|
|
953
1694
|
].join(" "),
|
|
954
1695
|
children: [
|
|
955
|
-
|
|
1696
|
+
/* @__PURE__ */ o(
|
|
956
1697
|
"span",
|
|
957
1698
|
{
|
|
958
|
-
class:
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
1699
|
+
class: [
|
|
1700
|
+
"flex h-6.5 w-6.5 flex-shrink-0 items-center justify-center rounded-full border transition-colors",
|
|
1701
|
+
l ? "border-[var(--pw-accent)] text-white" : "border-gray-300 bg-transparent text-transparent",
|
|
1702
|
+
// Popular-label badge сидит absolute сверху-справа карточки и
|
|
1703
|
+
// визуально сдвигает центр content'а вниз. flex items-center
|
|
1704
|
+
// на карточке держит галочку по геометрическому центру, что
|
|
1705
|
+
// делает её визуально выше — компенсируем небольшим mt'ом.
|
|
1706
|
+
d ? "mt-3" : ""
|
|
1707
|
+
].join(" "),
|
|
1708
|
+
style: l ? {
|
|
1709
|
+
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%)"
|
|
1710
|
+
} : void 0,
|
|
1711
|
+
"aria-hidden": "true",
|
|
1712
|
+
children: /* @__PURE__ */ o(
|
|
1713
|
+
"svg",
|
|
1714
|
+
{
|
|
1715
|
+
width: "14",
|
|
1716
|
+
height: "10",
|
|
1717
|
+
viewBox: "0 0 17 12",
|
|
1718
|
+
fill: "none",
|
|
1719
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1720
|
+
class: l ? "opacity-100" : "opacity-0",
|
|
1721
|
+
children: /* @__PURE__ */ o(
|
|
1722
|
+
"path",
|
|
1723
|
+
{
|
|
1724
|
+
d: "M16.5234 0.476562C16.9805 0.898438 16.9805 1.63672 16.5234 2.05859L7.52344 11.0586C7.10156 11.5156 6.36328 11.5156 5.94141 11.0586L1.44141 6.55859C0.984375 6.13672 0.984375 5.39844 1.44141 4.97656C1.86328 4.51953 2.60156 4.51953 3.02344 4.97656L6.75 8.66797L14.9414 0.476562C15.3633 0.0195312 16.1016 0.0195312 16.5234 0.476562Z",
|
|
1725
|
+
fill: "currentColor"
|
|
1726
|
+
}
|
|
1727
|
+
)
|
|
1728
|
+
}
|
|
1729
|
+
)
|
|
963
1730
|
}
|
|
964
|
-
)
|
|
965
|
-
/* @__PURE__ */
|
|
966
|
-
/* @__PURE__ */
|
|
967
|
-
"span",
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
].
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
]
|
|
1731
|
+
),
|
|
1732
|
+
/* @__PURE__ */ c("div", { class: "flex flex-1 flex-col gap-0.5", children: [
|
|
1733
|
+
/* @__PURE__ */ c("div", { class: "flex flex-wrap items-center gap-x-2 gap-y-1", children: [
|
|
1734
|
+
/* @__PURE__ */ o("span", { class: "text-xs font-normal uppercase tracking-normal text-gray-800/70", children: Oe(a, n) }),
|
|
1735
|
+
h ? (
|
|
1736
|
+
// opacity-60 приглушает strike: глаз сначала ловит label
|
|
1737
|
+
// и discount-badge, потом main price; original «бывшая цена»
|
|
1738
|
+
// — третичная информация, не должна конкурировать с label.
|
|
1739
|
+
/* @__PURE__ */ o("span", { class: "text-[15px] font-normal text-gray-400 opacity-60 line-through decoration-gray-400 decoration-[1.5px]", children: h })
|
|
1740
|
+
) : null,
|
|
1741
|
+
p ? (
|
|
1742
|
+
// Emerald pill — фиксированный «успех/выгода», не зависит от
|
|
1743
|
+
// brand_color. Читается даже на тёмных бренд-акцентах.
|
|
1744
|
+
/* @__PURE__ */ c("span", { class: "rounded-full bg-emerald-100 px-2.5 py-1 text-xs font-bold leading-none text-emerald-700", children: [
|
|
1745
|
+
"-",
|
|
1746
|
+
p,
|
|
1747
|
+
"%"
|
|
1748
|
+
] })
|
|
1749
|
+
) : null
|
|
1750
|
+
] }),
|
|
1751
|
+
/* @__PURE__ */ o("div", { class: "flex items-baseline gap-2 flex-wrap", children: /* @__PURE__ */ c("span", { class: "text-[26px] leading-tight whitespace-nowrap text-gray-800 font-medium", children: [
|
|
1752
|
+
/* @__PURE__ */ o("span", { class: "opacity-90", children: f }),
|
|
1753
|
+
" ",
|
|
1754
|
+
b,
|
|
1755
|
+
/* @__PURE__ */ c("span", { class: "text-sm font-normal text-gray-500", children: [
|
|
1756
|
+
" ",
|
|
1757
|
+
"/ ",
|
|
1758
|
+
ce(a, n)
|
|
1759
|
+
] })
|
|
1760
|
+
] }) }),
|
|
1761
|
+
a.description ? /* @__PURE__ */ o("span", { class: "mt-1 text-xs leading-relaxed text-gray-500", children: a.description }) : null,
|
|
1762
|
+
a.trial_days ? /* @__PURE__ */ o("span", { class: "mt-1 text-xs font-medium text-[var(--pw-accent)]", children: n("pricing.free_trial_days", "{days}-day free trial", { days: a.trial_days }) }) : null
|
|
985
1763
|
] }),
|
|
986
|
-
/* @__PURE__ */
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
1764
|
+
d ? /* @__PURE__ */ o(
|
|
1765
|
+
"span",
|
|
1766
|
+
{
|
|
1767
|
+
class: "absolute -top-[9px] -right-[6px] rounded-[11px] border-[5px] border-white px-2 py-1 text-[12px] font-semibold text-white",
|
|
1768
|
+
style: { background: "var(--pw-accent)" },
|
|
1769
|
+
children: s
|
|
1770
|
+
}
|
|
1771
|
+
) : null
|
|
990
1772
|
]
|
|
991
1773
|
},
|
|
992
1774
|
a.id
|
|
@@ -995,394 +1777,595 @@ function ze({ block: r, ctx: e }) {
|
|
|
995
1777
|
}
|
|
996
1778
|
);
|
|
997
1779
|
}
|
|
998
|
-
function
|
|
999
|
-
return
|
|
1780
|
+
function Ft(t, e) {
|
|
1781
|
+
return t.label ? t.label : !t.interval || t.interval === "lifetime" ? e("pricing.interval.lifetime_short", "lifetime") : e(`pricing.interval.${t.interval}`, t.interval);
|
|
1782
|
+
}
|
|
1783
|
+
function Vt({
|
|
1784
|
+
price: t,
|
|
1785
|
+
isLast: e,
|
|
1786
|
+
isPopular: n,
|
|
1787
|
+
popularLabel: r,
|
|
1788
|
+
offer: i,
|
|
1789
|
+
selected: s,
|
|
1790
|
+
onSelect: a,
|
|
1791
|
+
t: l
|
|
1792
|
+
}) {
|
|
1793
|
+
const d = i?.discount_percent ?? null, { currency: u, amount: p, originalAmount: f } = le(t, d);
|
|
1794
|
+
return /* @__PURE__ */ c(
|
|
1795
|
+
"button",
|
|
1796
|
+
{
|
|
1797
|
+
type: "button",
|
|
1798
|
+
role: "radio",
|
|
1799
|
+
"aria-checked": s,
|
|
1800
|
+
onClick: a,
|
|
1801
|
+
class: "group relative inline-flex w-full max-w-[360px] mx-auto items-center justify-between gap-4 px-4 pt-3.5 text-left focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--pw-accent)]",
|
|
1802
|
+
children: [
|
|
1803
|
+
/* @__PURE__ */ o(
|
|
1804
|
+
"span",
|
|
1805
|
+
{
|
|
1806
|
+
class: [
|
|
1807
|
+
"flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full border transition-colors mb-3",
|
|
1808
|
+
s ? "border-[var(--pw-accent)] text-white" : "border-gray-300 bg-transparent text-transparent"
|
|
1809
|
+
].join(" "),
|
|
1810
|
+
style: s ? {
|
|
1811
|
+
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%)"
|
|
1812
|
+
} : void 0,
|
|
1813
|
+
"aria-hidden": "true",
|
|
1814
|
+
children: /* @__PURE__ */ o(
|
|
1815
|
+
"svg",
|
|
1816
|
+
{
|
|
1817
|
+
width: "14",
|
|
1818
|
+
height: "10",
|
|
1819
|
+
viewBox: "0 0 17 12",
|
|
1820
|
+
fill: "none",
|
|
1821
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1822
|
+
class: s ? "opacity-100" : "opacity-0",
|
|
1823
|
+
children: /* @__PURE__ */ o(
|
|
1824
|
+
"path",
|
|
1825
|
+
{
|
|
1826
|
+
d: "M16.5234 0.476562C16.9805 0.898438 16.9805 1.63672 16.5234 2.05859L7.52344 11.0586C7.10156 11.5156 6.36328 11.5156 5.94141 11.0586L1.44141 6.55859C0.984375 6.13672 0.984375 5.39844 1.44141 4.97656C1.86328 4.51953 2.60156 4.51953 3.02344 4.97656L6.75 8.66797L14.9414 0.476562C15.3633 0.0195312 16.1016 0.0195312 16.5234 0.476562Z",
|
|
1827
|
+
fill: "currentColor"
|
|
1828
|
+
}
|
|
1829
|
+
)
|
|
1830
|
+
}
|
|
1831
|
+
)
|
|
1832
|
+
}
|
|
1833
|
+
),
|
|
1834
|
+
/* @__PURE__ */ c(
|
|
1835
|
+
"div",
|
|
1836
|
+
{
|
|
1837
|
+
class: [
|
|
1838
|
+
"flex flex-1 items-center gap-1.5 pb-3.5",
|
|
1839
|
+
e ? "" : "border-b border-gray-200"
|
|
1840
|
+
].join(" "),
|
|
1841
|
+
children: [
|
|
1842
|
+
/* @__PURE__ */ c("div", { class: "flex flex-wrap items-center gap-1 gap-x-1.5", children: [
|
|
1843
|
+
/* @__PURE__ */ o("span", { class: "text-base font-normal capitalize text-gray-800", children: Ft(t, l) }),
|
|
1844
|
+
n ? (
|
|
1845
|
+
// Pastel brand-mix pill — точно как `badge` в TelegramPricingRadio.
|
|
1846
|
+
// Низкий visual weight: pill про "имя плана" (most popular), а не
|
|
1847
|
+
// про savings — не должна конкурировать с -X% discount-pill.
|
|
1848
|
+
/* @__PURE__ */ o(
|
|
1849
|
+
"span",
|
|
1850
|
+
{
|
|
1851
|
+
class: "rounded-[9px] px-2 py-1 text-[10px] font-bold",
|
|
1852
|
+
style: {
|
|
1853
|
+
background: "linear-gradient(160deg, color-mix(in srgb, var(--pw-accent) 6%, white) 0%, color-mix(in srgb, var(--pw-accent) 15%, white) 100%)",
|
|
1854
|
+
color: "var(--pw-accent)"
|
|
1855
|
+
},
|
|
1856
|
+
children: r
|
|
1857
|
+
}
|
|
1858
|
+
)
|
|
1859
|
+
) : null,
|
|
1860
|
+
d ? /* @__PURE__ */ c("span", { class: "rounded-md bg-emerald-100 px-1.5 py-0.5 text-[10px] font-bold leading-none text-emerald-700", children: [
|
|
1861
|
+
"-",
|
|
1862
|
+
d,
|
|
1863
|
+
"%"
|
|
1864
|
+
] }) : null
|
|
1865
|
+
] }),
|
|
1866
|
+
/* @__PURE__ */ o("div", { class: "flex-1" }),
|
|
1867
|
+
/* @__PURE__ */ c("span", { class: "flex items-baseline gap-1.5 text-base font-normal text-gray-600", children: [
|
|
1868
|
+
f ? /* @__PURE__ */ o("span", { class: "text-xs text-gray-400 line-through decoration-gray-400 decoration-[1.5px]", children: f }) : null,
|
|
1869
|
+
/* @__PURE__ */ c("span", { class: "whitespace-nowrap", children: [
|
|
1870
|
+
/* @__PURE__ */ o("span", { class: "opacity-90", children: u }),
|
|
1871
|
+
p,
|
|
1872
|
+
/* @__PURE__ */ c("span", { class: "text-xs text-gray-400", children: [
|
|
1873
|
+
" ",
|
|
1874
|
+
"/ ",
|
|
1875
|
+
ce(t, l)
|
|
1876
|
+
] })
|
|
1877
|
+
] })
|
|
1878
|
+
] })
|
|
1879
|
+
]
|
|
1880
|
+
}
|
|
1881
|
+
)
|
|
1882
|
+
]
|
|
1883
|
+
}
|
|
1884
|
+
);
|
|
1885
|
+
}
|
|
1886
|
+
function $t({
|
|
1887
|
+
price: t,
|
|
1888
|
+
isPopular: e,
|
|
1889
|
+
popularLabel: n,
|
|
1890
|
+
offer: r,
|
|
1891
|
+
selected: i,
|
|
1892
|
+
onSelect: s,
|
|
1893
|
+
t: a
|
|
1894
|
+
}) {
|
|
1895
|
+
const l = r?.discount_percent ?? null, { currency: d, amount: u, originalAmount: p } = le(t, l);
|
|
1896
|
+
return /* @__PURE__ */ c(
|
|
1897
|
+
"button",
|
|
1898
|
+
{
|
|
1899
|
+
type: "button",
|
|
1900
|
+
role: "radio",
|
|
1901
|
+
"aria-checked": i,
|
|
1902
|
+
onClick: s,
|
|
1903
|
+
class: [
|
|
1904
|
+
"group relative flex h-full flex-col items-center justify-start gap-1 rounded-2xl border-2 px-3 pb-4 pt-3.5 text-center transition-colors duration-150 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--pw-accent)]",
|
|
1905
|
+
i ? "border-[var(--pw-accent)]" : "border-gray-200 hover:bg-gray-50"
|
|
1906
|
+
].join(" "),
|
|
1907
|
+
style: i ? { background: "color-mix(in srgb, var(--pw-accent) 6%, transparent)" } : void 0,
|
|
1908
|
+
children: [
|
|
1909
|
+
/* @__PURE__ */ o("span", { class: "flex min-h-[2.4em] items-center text-[11px] font-normal uppercase leading-tight text-gray-800/70", children: Oe(t, a) }),
|
|
1910
|
+
/* @__PURE__ */ c("div", { class: "flex h-[22px] items-center justify-center gap-1.5", children: [
|
|
1911
|
+
p ? /* @__PURE__ */ o("span", { class: "text-[12px] text-gray-400 line-through decoration-gray-400 decoration-[1.5px]", children: p }) : null,
|
|
1912
|
+
l ? /* @__PURE__ */ c("span", { class: "rounded-md bg-emerald-100 px-1.5 py-0.5 text-[10px] font-bold leading-none text-emerald-700", children: [
|
|
1913
|
+
"-",
|
|
1914
|
+
l,
|
|
1915
|
+
"%"
|
|
1916
|
+
] }) : null
|
|
1917
|
+
] }),
|
|
1918
|
+
/* @__PURE__ */ c("span", { class: "text-[26px] leading-none whitespace-nowrap text-gray-800 font-medium", children: [
|
|
1919
|
+
/* @__PURE__ */ o("span", { class: "opacity-90", children: d }),
|
|
1920
|
+
u
|
|
1921
|
+
] }),
|
|
1922
|
+
/* @__PURE__ */ c("span", { class: "text-xs font-normal text-gray-500", children: [
|
|
1923
|
+
"/ ",
|
|
1924
|
+
ce(t, a)
|
|
1925
|
+
] }),
|
|
1926
|
+
t.trial_days ? /* @__PURE__ */ o("span", { class: "mt-1 text-[11px] font-medium text-[var(--pw-accent)]", children: a("pricing.free_trial_days", "{days}-day free trial", { days: t.trial_days }) }) : null,
|
|
1927
|
+
e ? /* @__PURE__ */ o(
|
|
1928
|
+
"span",
|
|
1929
|
+
{
|
|
1930
|
+
class: "absolute -top-[10px] left-1/2 -translate-x-1/2 whitespace-nowrap rounded-[11px] border-[3px] border-white px-2.5 py-0.5 text-[10px] font-semibold uppercase tracking-wider text-white",
|
|
1931
|
+
style: { background: "var(--pw-accent)" },
|
|
1932
|
+
children: n
|
|
1933
|
+
}
|
|
1934
|
+
) : null
|
|
1935
|
+
]
|
|
1936
|
+
}
|
|
1937
|
+
);
|
|
1938
|
+
}
|
|
1939
|
+
function Ht({ block: t }) {
|
|
1940
|
+
return /* @__PURE__ */ o("p", { class: "text-[0.9375rem] leading-relaxed text-gray-600", children: t.text });
|
|
1000
1941
|
}
|
|
1001
|
-
const
|
|
1942
|
+
const Gt = {
|
|
1002
1943
|
week: 0.25,
|
|
1003
1944
|
month: 1,
|
|
1004
1945
|
year: 12
|
|
1005
1946
|
};
|
|
1006
|
-
function
|
|
1007
|
-
return
|
|
1008
|
-
}
|
|
1009
|
-
function
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
return /* @__PURE__ */ u("li", { class: `flex gap-2 ${s.desc ? "" : "items-center"}`, children: [
|
|
1947
|
+
function Wt(t, e) {
|
|
1948
|
+
return t ? e(`pricing.interval.${t}`, t) : e("pricing.interval.period", "period");
|
|
1949
|
+
}
|
|
1950
|
+
function Zt({ block: t, ctx: e }) {
|
|
1951
|
+
const { t: n } = w();
|
|
1952
|
+
if (!t.queries.length) return null;
|
|
1953
|
+
const i = e.bootstrap.prices.find((a) => a.id === e.selectedPriceId)?.interval ?? null, s = i ? Gt[i] : void 0;
|
|
1954
|
+
return /* @__PURE__ */ c("div", { class: "flex flex-col gap-2", children: [
|
|
1955
|
+
/* @__PURE__ */ o("div", { class: "text-sm font-semibold text-gray-800", children: n("pricing.included_per", "Included per {interval}:", {
|
|
1956
|
+
interval: Wt(i, n)
|
|
1957
|
+
}) }),
|
|
1958
|
+
/* @__PURE__ */ o("ul", { class: "flex flex-col gap-2", role: "list", children: t.queries.map((a) => {
|
|
1959
|
+
const l = Number.isFinite(a.count) ? a.count : 0, d = s !== void 0 ? Math.round(l * s) : l;
|
|
1960
|
+
return /* @__PURE__ */ c("li", { class: `flex gap-3 ${a.desc ? "items-start" : "items-center"}`, children: [
|
|
1021
1961
|
/* @__PURE__ */ o(
|
|
1022
|
-
"
|
|
1962
|
+
"svg",
|
|
1023
1963
|
{
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
}
|
|
1964
|
+
width: "18",
|
|
1965
|
+
height: "18",
|
|
1966
|
+
viewBox: "0 0 20 20",
|
|
1967
|
+
fill: "none",
|
|
1968
|
+
class: `flex-shrink-0 text-emerald-500 ${a.desc ? "mt-0.5" : ""}`,
|
|
1029
1969
|
"aria-hidden": "true",
|
|
1030
|
-
children: /* @__PURE__ */ o(
|
|
1970
|
+
children: /* @__PURE__ */ o(
|
|
1031
1971
|
"path",
|
|
1032
1972
|
{
|
|
1033
|
-
d: "
|
|
1973
|
+
d: "M4 10.5l3.5 3.5 8.5-8.5",
|
|
1034
1974
|
stroke: "currentColor",
|
|
1035
1975
|
"stroke-width": "2.5",
|
|
1036
1976
|
"stroke-linecap": "round",
|
|
1037
1977
|
"stroke-linejoin": "round"
|
|
1038
1978
|
}
|
|
1039
|
-
)
|
|
1979
|
+
)
|
|
1040
1980
|
}
|
|
1041
1981
|
),
|
|
1042
|
-
/* @__PURE__ */
|
|
1043
|
-
/* @__PURE__ */ o("span", { class: "font-semibold text-gray-900 text-sm", children:
|
|
1982
|
+
/* @__PURE__ */ c("div", { children: [
|
|
1983
|
+
/* @__PURE__ */ o("span", { class: "font-semibold text-gray-900 text-sm", children: d }),
|
|
1044
1984
|
" ",
|
|
1045
|
-
/* @__PURE__ */ o("span", { class: "text-sm text-gray-800", children:
|
|
1046
|
-
|
|
1985
|
+
/* @__PURE__ */ o("span", { class: "text-sm text-gray-800", children: a.name }),
|
|
1986
|
+
a.desc ? /* @__PURE__ */ c(W, { children: [
|
|
1047
1987
|
/* @__PURE__ */ o("br", {}),
|
|
1048
|
-
/* @__PURE__ */ o("span", { class: "text-xs text-gray-
|
|
1988
|
+
/* @__PURE__ */ o("span", { class: "text-xs text-gray-400", children: a.desc })
|
|
1049
1989
|
] }) : null
|
|
1050
1990
|
] })
|
|
1051
|
-
] },
|
|
1991
|
+
] }, a.id);
|
|
1052
1992
|
}) })
|
|
1053
1993
|
] });
|
|
1054
1994
|
}
|
|
1055
|
-
const
|
|
1056
|
-
heading:
|
|
1057
|
-
text:
|
|
1058
|
-
price_grid:
|
|
1059
|
-
cta_button:
|
|
1060
|
-
auth_panel:
|
|
1061
|
-
current_session:
|
|
1062
|
-
features_list:
|
|
1063
|
-
tokenization_gate:
|
|
1995
|
+
const Yt = {
|
|
1996
|
+
heading: Dt,
|
|
1997
|
+
text: Ht,
|
|
1998
|
+
price_grid: Nt,
|
|
1999
|
+
cta_button: Tt,
|
|
2000
|
+
auth_panel: Le,
|
|
2001
|
+
current_session: Bt,
|
|
2002
|
+
features_list: Mt,
|
|
2003
|
+
tokenization_gate: Zt,
|
|
2004
|
+
guarantee_badge: Pt,
|
|
2005
|
+
offer_banner: bt
|
|
1064
2006
|
};
|
|
1065
|
-
function
|
|
1066
|
-
const s =
|
|
2007
|
+
function Kt({ layout: t, bootstrap: e, onAction: n, auth: r, authSession: i }) {
|
|
2008
|
+
const s = ve(() => {
|
|
2009
|
+
for (const h of t.blocks)
|
|
2010
|
+
if (h.type === "price_grid" && h.popular_price_id && e.prices.some((y) => y.id === h.popular_price_id))
|
|
2011
|
+
return h.popular_price_id;
|
|
2012
|
+
return e.prices[0]?.id ?? null;
|
|
2013
|
+
}, [t.blocks, e.prices]), [a, l] = x(s), d = {
|
|
1067
2014
|
bootstrap: e,
|
|
1068
|
-
selectedPriceId:
|
|
1069
|
-
setSelectedPriceId:
|
|
1070
|
-
onAction:
|
|
1071
|
-
auth:
|
|
2015
|
+
selectedPriceId: a,
|
|
2016
|
+
setSelectedPriceId: l,
|
|
2017
|
+
onAction: n,
|
|
2018
|
+
auth: r,
|
|
1072
2019
|
authSession: i
|
|
2020
|
+
}, u = t.blocks.findIndex((h) => h.type === "cta_button"), p = u === -1 ? t.blocks : t.blocks.slice(0, u), f = u === -1 ? [] : t.blocks.slice(u), b = (h, y) => {
|
|
2021
|
+
const k = Yt[h.type];
|
|
2022
|
+
return k ? /* @__PURE__ */ o(k, { block: h, ctx: d }, `${h.type}-${y}`) : (typeof console < "u" && console.warn(`[paywall] unknown block type: ${h.type}`), null);
|
|
1073
2023
|
};
|
|
1074
|
-
return /* @__PURE__ */
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
2024
|
+
return /* @__PURE__ */ c(W, { children: [
|
|
2025
|
+
/* @__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: p.map(b) }) }),
|
|
2026
|
+
f.length > 0 ? (
|
|
2027
|
+
// Тонкий shadow-top вместо border-t — создаёт depth, читается как
|
|
2028
|
+
// «footer закреплён к низу dialog'а». Линия выглядела как divider
|
|
2029
|
+
// в обычном flow, не передавала sticky-character.
|
|
2030
|
+
/* @__PURE__ */ o(
|
|
2031
|
+
"div",
|
|
2032
|
+
{
|
|
2033
|
+
class: "flex flex-col gap-4 bg-white px-6 pb-6 pt-3 sm:px-8",
|
|
2034
|
+
style: { boxShadow: "0 -4px 12px -4px rgba(15,23,42,0.06)" },
|
|
2035
|
+
children: f.map((h, y) => b(h, p.length + y))
|
|
2036
|
+
}
|
|
2037
|
+
)
|
|
2038
|
+
) : null
|
|
2039
|
+
] });
|
|
1078
2040
|
}
|
|
1079
|
-
function
|
|
1080
|
-
return
|
|
2041
|
+
function Xt(t, e, n, r) {
|
|
2042
|
+
return t ? r ? { 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 } : n.kind === "support" ? { open: !0, view: "support", error: null } : n.kind === "auth_gate" ? { open: !0, view: "auth", error: null } : n.kind === "anon_gate" ? { open: !0, view: "anon", error: null } : n.kind === "awaiting_payment" ? { open: !0, view: "awaiting_payment", error: null } : n.kind === "popup_blocked" ? { open: !0, view: "popup_blocked", error: null } : n.kind === "purchase_success" ? { open: !0, view: "purchased", error: null } : n.kind === "verifying" ? { open: !0, view: "loading", error: null } : { open: !0, view: "layout", error: null } : { open: !1, view: null, error: null };
|
|
1081
2043
|
}
|
|
1082
|
-
function
|
|
1083
|
-
return
|
|
2044
|
+
function Jt(t, e) {
|
|
2045
|
+
return t.open === e.open && t.view === e.view && t.error === e.error;
|
|
1084
2046
|
}
|
|
1085
|
-
function
|
|
1086
|
-
client:
|
|
2047
|
+
function Qt({
|
|
2048
|
+
client: t,
|
|
1087
2049
|
open: e,
|
|
1088
|
-
onClose:
|
|
1089
|
-
onEvent:
|
|
2050
|
+
onClose: n,
|
|
2051
|
+
onEvent: r,
|
|
1090
2052
|
initialView: i,
|
|
1091
2053
|
purchased: s,
|
|
1092
|
-
renew:
|
|
1093
|
-
onState:
|
|
1094
|
-
inline:
|
|
2054
|
+
renew: a,
|
|
2055
|
+
onState: l,
|
|
2056
|
+
inline: d
|
|
1095
2057
|
}) {
|
|
1096
|
-
const [
|
|
1097
|
-
() =>
|
|
1098
|
-
), [
|
|
1099
|
-
|
|
1100
|
-
if (!
|
|
1101
|
-
const
|
|
1102
|
-
|
|
1103
|
-
}, [e,
|
|
1104
|
-
if (
|
|
1105
|
-
return
|
|
1106
|
-
}, [
|
|
1107
|
-
if (typeof
|
|
1108
|
-
return
|
|
1109
|
-
|
|
1110
|
-
(
|
|
2058
|
+
const [u, p] = x({ status: "idle" }), [f, b] = x(
|
|
2059
|
+
() => t.auth?.getCachedSession() ?? null
|
|
2060
|
+
), [h, y] = x(() => i === "support" ? { kind: "support", origin: "standalone" } : i === "auth" ? { kind: "auth_gate", origin: "standalone" } : i === "anon" ? { kind: "anon_gate", origin: "standalone" } : { kind: "layout" }), k = R(!1), j = R(null);
|
|
2061
|
+
B(() => {
|
|
2062
|
+
if (!l) return;
|
|
2063
|
+
const m = Xt(e, u, h, s), g = j.current;
|
|
2064
|
+
g && Jt(g, m) || (j.current = m, l(m));
|
|
2065
|
+
}, [e, u, h, s, l]), B(() => {
|
|
2066
|
+
if (t.auth)
|
|
2067
|
+
return t.auth.onAuthChange((m, g) => b(g));
|
|
2068
|
+
}, [t.auth]), B(() => {
|
|
2069
|
+
if (typeof t.onBootstrapChange == "function")
|
|
2070
|
+
return t.onBootstrapChange((m) => {
|
|
2071
|
+
p(
|
|
2072
|
+
(g) => g.status === "ready" ? { status: "ready", data: m } : g
|
|
1111
2073
|
);
|
|
1112
2074
|
});
|
|
1113
|
-
}, [
|
|
1114
|
-
if (!e ||
|
|
1115
|
-
let
|
|
1116
|
-
return
|
|
1117
|
-
|
|
2075
|
+
}, [t]), B(() => {
|
|
2076
|
+
if (!e || u.status === "ready" || u.status === "loading") return;
|
|
2077
|
+
let m = !1;
|
|
2078
|
+
return p({ status: "loading" }), t.bootstrap().then((g) => {
|
|
2079
|
+
m || (p({ status: "ready", data: g }), r("ready", g), g.user?.has_active_subscription && !a && (r("purchase_completed", {
|
|
1118
2080
|
priceId: null,
|
|
1119
2081
|
sessionId: null,
|
|
1120
2082
|
restored: !0
|
|
1121
|
-
}),
|
|
1122
|
-
}).catch((
|
|
1123
|
-
if (
|
|
1124
|
-
const
|
|
1125
|
-
|
|
2083
|
+
}), y({ kind: "purchase_success", restored: !0 })));
|
|
2084
|
+
}).catch((g) => {
|
|
2085
|
+
if (m) return;
|
|
2086
|
+
const _ = g instanceof U ? g : new U("unknown", "Failed to load paywall", { cause: g });
|
|
2087
|
+
p({ status: "error", error: _ }), r("error", _);
|
|
1126
2088
|
}), () => {
|
|
1127
|
-
|
|
2089
|
+
m = !0;
|
|
1128
2090
|
};
|
|
1129
|
-
}, [e,
|
|
2091
|
+
}, [e, t]), Ve(() => {
|
|
1130
2092
|
if (!e) {
|
|
1131
|
-
|
|
2093
|
+
y({ kind: "layout" }), k.current = !1;
|
|
1132
2094
|
return;
|
|
1133
2095
|
}
|
|
1134
|
-
i === "support" ?
|
|
2096
|
+
i === "support" ? y({ kind: "support", origin: "standalone" }) : i === "auth" ? y({ kind: "auth_gate", origin: "standalone" }) : i === "anon" && y({ kind: "anon_gate", origin: "standalone" });
|
|
1135
2097
|
}, [e, i]);
|
|
1136
|
-
const
|
|
2098
|
+
const T = async (m) => {
|
|
1137
2099
|
try {
|
|
1138
|
-
const
|
|
1139
|
-
priceId:
|
|
1140
|
-
ignoreActivePurchase:
|
|
2100
|
+
const g = await t.createCheckout({
|
|
2101
|
+
priceId: m,
|
|
2102
|
+
ignoreActivePurchase: a === !0
|
|
1141
2103
|
});
|
|
1142
|
-
if (
|
|
1143
|
-
const
|
|
1144
|
-
if (
|
|
2104
|
+
if (r("checkout_started", { priceId: m, url: g.url, acquiring: g.acquiring }), typeof window > "u" || !g.url) return;
|
|
2105
|
+
const _ = window.open(g.url, "_blank");
|
|
2106
|
+
if (_) {
|
|
1145
2107
|
try {
|
|
1146
|
-
|
|
2108
|
+
_.opener = null;
|
|
1147
2109
|
} catch {
|
|
1148
2110
|
}
|
|
1149
|
-
|
|
2111
|
+
y({ kind: "awaiting_payment", priceId: m, url: g.url });
|
|
1150
2112
|
} else
|
|
1151
|
-
|
|
1152
|
-
} catch (
|
|
1153
|
-
if (
|
|
2113
|
+
y({ kind: "popup_blocked", priceId: m, url: g.url });
|
|
2114
|
+
} catch (g) {
|
|
2115
|
+
if (g instanceof U && g.code === "already_purchased") {
|
|
1154
2116
|
try {
|
|
1155
|
-
await
|
|
2117
|
+
await t.getUser({ force: !0 });
|
|
1156
2118
|
} catch {
|
|
1157
2119
|
}
|
|
1158
|
-
|
|
2120
|
+
r("purchase_completed", { priceId: m, sessionId: null, restored: !0 }), y({ kind: "purchase_success", restored: !0 });
|
|
1159
2121
|
return;
|
|
1160
2122
|
}
|
|
1161
|
-
const
|
|
1162
|
-
|
|
2123
|
+
const _ = g instanceof U ? g : new U("checkout_failed", "Checkout failed", { cause: g });
|
|
2124
|
+
r("error", _), y({ kind: "layout" });
|
|
1163
2125
|
}
|
|
1164
|
-
},
|
|
2126
|
+
}, v = (m, g) => {
|
|
1165
2127
|
if (typeof window > "u") return;
|
|
1166
|
-
const
|
|
1167
|
-
if (
|
|
2128
|
+
const _ = window.open(g, "_blank");
|
|
2129
|
+
if (_) {
|
|
1168
2130
|
try {
|
|
1169
|
-
|
|
2131
|
+
_.opener = null;
|
|
1170
2132
|
} catch {
|
|
1171
2133
|
}
|
|
1172
|
-
|
|
2134
|
+
y({ kind: "awaiting_payment", priceId: m, url: g });
|
|
1173
2135
|
}
|
|
1174
2136
|
};
|
|
1175
|
-
|
|
1176
|
-
if (
|
|
1177
|
-
|
|
1178
|
-
const
|
|
1179
|
-
|
|
1180
|
-
if (!
|
|
2137
|
+
B(() => {
|
|
2138
|
+
if (h.kind !== "auth_gate" || !f || f.user.is_anonymous || k.current) return;
|
|
2139
|
+
k.current = !0;
|
|
2140
|
+
const m = h.pendingCheckout, g = h.origin;
|
|
2141
|
+
y({ kind: "verifying" }), (async () => {
|
|
2142
|
+
if (!a)
|
|
1181
2143
|
try {
|
|
1182
|
-
if ((await
|
|
1183
|
-
|
|
1184
|
-
priceId:
|
|
2144
|
+
if ((await t.getUser({ force: !0 })).has_active_subscription) {
|
|
2145
|
+
r("purchase_completed", {
|
|
2146
|
+
priceId: m?.priceId ?? null,
|
|
1185
2147
|
sessionId: null,
|
|
1186
2148
|
restored: !0
|
|
1187
|
-
}),
|
|
2149
|
+
}), y({ kind: "purchase_success", restored: !0 });
|
|
1188
2150
|
return;
|
|
1189
2151
|
}
|
|
1190
2152
|
} catch {
|
|
1191
2153
|
}
|
|
1192
|
-
if (!
|
|
1193
|
-
|
|
2154
|
+
if (!m) {
|
|
2155
|
+
g === "standalone" ? n() : y({ kind: "layout" });
|
|
1194
2156
|
return;
|
|
1195
2157
|
}
|
|
1196
|
-
await
|
|
2158
|
+
await T(m.priceId);
|
|
1197
2159
|
})().finally(() => {
|
|
1198
|
-
|
|
2160
|
+
k.current = !1;
|
|
1199
2161
|
});
|
|
1200
|
-
}, [
|
|
1201
|
-
const
|
|
1202
|
-
if (
|
|
1203
|
-
|
|
2162
|
+
}, [f, h]);
|
|
2163
|
+
const L = async (m, g) => {
|
|
2164
|
+
if (m === "close") {
|
|
2165
|
+
n();
|
|
1204
2166
|
return;
|
|
1205
2167
|
}
|
|
1206
|
-
if (
|
|
1207
|
-
|
|
2168
|
+
if (m === "price_selected") {
|
|
2169
|
+
r("price_selected", g);
|
|
1208
2170
|
return;
|
|
1209
2171
|
}
|
|
1210
|
-
if (
|
|
1211
|
-
if (!
|
|
1212
|
-
|
|
2172
|
+
if (m === "restore") {
|
|
2173
|
+
if (!t.auth) return;
|
|
2174
|
+
const _ = t.auth.getCachedSession();
|
|
2175
|
+
if (_ && !_.user.is_anonymous) return;
|
|
2176
|
+
y({ kind: "auth_gate", intent: "restore" });
|
|
1213
2177
|
return;
|
|
1214
2178
|
}
|
|
1215
|
-
if (
|
|
1216
|
-
|
|
2179
|
+
if (m === "support") {
|
|
2180
|
+
y({ kind: "support", origin: "layout" });
|
|
1217
2181
|
return;
|
|
1218
2182
|
}
|
|
1219
|
-
if (
|
|
1220
|
-
const
|
|
1221
|
-
if (!
|
|
1222
|
-
|
|
2183
|
+
if (m === "checkout" && u.status === "ready") {
|
|
2184
|
+
const _ = g?.priceId;
|
|
2185
|
+
if (!_) {
|
|
2186
|
+
r("error", new U("no_price", "No price selected"));
|
|
1223
2187
|
return;
|
|
1224
2188
|
}
|
|
1225
|
-
|
|
1226
|
-
|
|
2189
|
+
const Z = u.data.settings.checkout_mode ?? "guest", S = t.auth?.getCachedSession() ?? null, E = !!S && !S.user.is_anonymous;
|
|
2190
|
+
if (Z === "preauth" && !!t.auth && !E) {
|
|
2191
|
+
y({ kind: "auth_gate", pendingCheckout: { priceId: _ } });
|
|
1227
2192
|
return;
|
|
1228
2193
|
}
|
|
1229
|
-
await
|
|
2194
|
+
await T(_);
|
|
1230
2195
|
}
|
|
1231
|
-
},
|
|
2196
|
+
}, C = u.status === "ready" ? u.data.settings.brand_color : null, P = u.status === "ready" ? u.data.settings.allow_close !== !1 : !0, M = h.kind === "layout" && u.status === "ready" ? Ee(u.data.offers) : null, q = M ? /* @__PURE__ */ o(wt, { offer: M }) : null, z = {
|
|
1232
2197
|
type: "auth_panel",
|
|
1233
|
-
|
|
2198
|
+
// Заголовок не задаём — AuthGate сам решит по intent'у (restore →
|
|
2199
|
+
// "Restore Purchases", остальные → дефолтный "Welcome back!").
|
|
1234
2200
|
allow_signup: !0,
|
|
1235
2201
|
allow_password_reset: !0,
|
|
1236
2202
|
// Не скрываем при наличии сессии — auto-resume useEffect отрабатывает быстрее,
|
|
1237
2203
|
// чем хотим показывать "Signed in as ..." промежуточным экраном.
|
|
1238
2204
|
hide_when_authenticated: !1,
|
|
1239
|
-
providers:
|
|
1240
|
-
},
|
|
1241
|
-
|
|
2205
|
+
providers: u.status === "ready" ? u.data.settings.auth_providers : void 0
|
|
2206
|
+
}, D = h.kind === "support" ? /* @__PURE__ */ o(
|
|
2207
|
+
vt,
|
|
1242
2208
|
{
|
|
1243
|
-
client:
|
|
1244
|
-
authSession:
|
|
1245
|
-
origin:
|
|
2209
|
+
client: t,
|
|
2210
|
+
authSession: f,
|
|
2211
|
+
origin: h.origin,
|
|
1246
2212
|
onBack: () => {
|
|
1247
|
-
|
|
2213
|
+
h.origin === "standalone" ? n() : y({ kind: "layout" });
|
|
1248
2214
|
}
|
|
1249
2215
|
}
|
|
1250
|
-
) : null;
|
|
1251
|
-
return /* @__PURE__ */ o(
|
|
1252
|
-
|
|
2216
|
+
) : null, A = h.kind === "auth_gate" && h.origin !== "standalone" || h.kind === "support", I = u.status === "ready" ? u.data : null;
|
|
2217
|
+
return /* @__PURE__ */ o(Qe, { bootstrap: I, children: /* @__PURE__ */ o(
|
|
2218
|
+
et,
|
|
1253
2219
|
{
|
|
1254
2220
|
open: e,
|
|
1255
|
-
onClose:
|
|
1256
|
-
brandColor:
|
|
1257
|
-
|
|
1258
|
-
allowClose:
|
|
1259
|
-
|
|
2221
|
+
onClose: n,
|
|
2222
|
+
brandColor: C,
|
|
2223
|
+
topBanner: q,
|
|
2224
|
+
allowClose: P,
|
|
2225
|
+
hideCloseButton: A,
|
|
2226
|
+
inline: d,
|
|
1260
2227
|
labelledBy: "pw-title",
|
|
1261
|
-
children: s ? /* @__PURE__ */ o(
|
|
1262
|
-
|
|
1263
|
-
/* @__PURE__ */ o("span", { class: "text-xs font-medium tracking-wide text-gray-500", children: f.kind === "verifying" ? "Checking your subscription…" : "Loading…" })
|
|
1264
|
-
] }) : c.status === "error" ? /* @__PURE__ */ u("div", { class: "flex flex-col items-center gap-2 py-8 text-center", children: [
|
|
1265
|
-
/* @__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: [
|
|
1266
|
-
/* @__PURE__ */ o(
|
|
1267
|
-
"path",
|
|
1268
|
-
{
|
|
1269
|
-
d: "M10 6v5M10 14h.01",
|
|
1270
|
-
stroke: "#dc2626",
|
|
1271
|
-
"stroke-width": "2",
|
|
1272
|
-
"stroke-linecap": "round"
|
|
1273
|
-
}
|
|
1274
|
-
),
|
|
1275
|
-
/* @__PURE__ */ o("circle", { cx: "10", cy: "10", r: "8", stroke: "#dc2626", "stroke-width": "1.75" })
|
|
1276
|
-
] }) }),
|
|
1277
|
-
/* @__PURE__ */ o("p", { class: "text-sm font-semibold tracking-tight text-gray-900", children: "Something went wrong" }),
|
|
1278
|
-
/* @__PURE__ */ o("p", { class: "text-xs leading-relaxed text-gray-500", children: c.error.message })
|
|
1279
|
-
] }) : f.kind === "auth_gate" && r.auth ? /* @__PURE__ */ o(
|
|
1280
|
-
Se,
|
|
2228
|
+
children: s ? /* @__PURE__ */ o(we, { onContinue: n }) : h.kind === "purchase_success" ? /* @__PURE__ */ o(we, { restored: h.restored, onContinue: n }) : D || (u.status === "loading" || u.status === "idle" || h.kind === "verifying" ? /* @__PURE__ */ o(en, { verifying: h.kind === "verifying" }) : u.status === "error" ? /* @__PURE__ */ o(tn, { message: u.error.message }) : h.kind === "auth_gate" && t.auth ? /* @__PURE__ */ o(
|
|
2229
|
+
ft,
|
|
1281
2230
|
{
|
|
1282
|
-
block:
|
|
1283
|
-
bootstrap:
|
|
1284
|
-
auth:
|
|
1285
|
-
authSession:
|
|
1286
|
-
showBack:
|
|
2231
|
+
block: z,
|
|
2232
|
+
bootstrap: u.data,
|
|
2233
|
+
auth: t.auth,
|
|
2234
|
+
authSession: f,
|
|
2235
|
+
showBack: h.origin !== "standalone",
|
|
2236
|
+
intent: h.intent ?? (h.origin === "standalone" ? "standalone" : "preauth"),
|
|
1287
2237
|
onBack: () => {
|
|
1288
|
-
|
|
2238
|
+
h.origin === "standalone" ? n() : y({ kind: "layout" });
|
|
1289
2239
|
}
|
|
1290
2240
|
}
|
|
1291
|
-
) :
|
|
1292
|
-
|
|
2241
|
+
) : h.kind === "anon_gate" && t.auth ? /* @__PURE__ */ o(
|
|
2242
|
+
mt,
|
|
1293
2243
|
{
|
|
1294
|
-
auth:
|
|
2244
|
+
auth: t.auth,
|
|
1295
2245
|
onSuccess: () => {
|
|
1296
|
-
|
|
2246
|
+
h.origin === "standalone" ? n() : y({ kind: "layout" });
|
|
1297
2247
|
},
|
|
1298
|
-
onBack:
|
|
2248
|
+
onBack: h.origin === "standalone" ? void 0 : () => y({ kind: "layout" })
|
|
1299
2249
|
}
|
|
1300
|
-
) :
|
|
1301
|
-
|
|
2250
|
+
) : h.kind === "awaiting_payment" ? /* @__PURE__ */ o(
|
|
2251
|
+
rn,
|
|
1302
2252
|
{
|
|
1303
|
-
client:
|
|
1304
|
-
onBack: () =>
|
|
2253
|
+
client: t,
|
|
2254
|
+
onBack: () => y({ kind: "layout" }),
|
|
1305
2255
|
onReopen: () => {
|
|
1306
2256
|
if (typeof window > "u") return;
|
|
1307
|
-
const
|
|
1308
|
-
if (
|
|
2257
|
+
const m = window.open(h.url, "_blank");
|
|
2258
|
+
if (m)
|
|
1309
2259
|
try {
|
|
1310
|
-
|
|
2260
|
+
m.opener = null;
|
|
1311
2261
|
} catch {
|
|
1312
2262
|
}
|
|
1313
2263
|
},
|
|
1314
|
-
onRetry: () =>
|
|
2264
|
+
onRetry: () => T(h.priceId)
|
|
1315
2265
|
}
|
|
1316
|
-
) :
|
|
1317
|
-
|
|
1318
|
-
"div",
|
|
1319
|
-
{
|
|
1320
|
-
class: "flex h-11 w-11 items-center justify-center rounded-full",
|
|
1321
|
-
style: { background: "color-mix(in srgb, var(--pw-accent) 12%, white)", color: "var(--pw-accent)" },
|
|
1322
|
-
"aria-hidden": "true",
|
|
1323
|
-
children: /* @__PURE__ */ u("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", children: [
|
|
1324
|
-
/* @__PURE__ */ o(
|
|
1325
|
-
"path",
|
|
1326
|
-
{
|
|
1327
|
-
d: "M4 5h12v10H4z",
|
|
1328
|
-
stroke: "currentColor",
|
|
1329
|
-
"stroke-width": "1.75",
|
|
1330
|
-
"stroke-linejoin": "round"
|
|
1331
|
-
}
|
|
1332
|
-
),
|
|
1333
|
-
/* @__PURE__ */ o("path", { d: "M7 9l3 3 4-5", stroke: "currentColor", "stroke-width": "1.75", "stroke-linecap": "round", "stroke-linejoin": "round" })
|
|
1334
|
-
] })
|
|
1335
|
-
}
|
|
1336
|
-
),
|
|
1337
|
-
/* @__PURE__ */ o("p", { class: "text-sm font-semibold tracking-tight text-gray-900", children: "Allow popups to continue" }),
|
|
1338
|
-
/* @__PURE__ */ o("p", { class: "max-w-[18rem] text-xs leading-relaxed text-gray-500", children: "Your browser blocked the checkout tab. Click below to open it." }),
|
|
1339
|
-
/* @__PURE__ */ o(
|
|
1340
|
-
"button",
|
|
1341
|
-
{
|
|
1342
|
-
type: "button",
|
|
1343
|
-
onClick: () => S(f.priceId, f.url),
|
|
1344
|
-
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)]",
|
|
1345
|
-
style: {
|
|
1346
|
-
background: "linear-gradient(180deg, color-mix(in srgb, var(--pw-accent) 92%, white), var(--pw-accent))",
|
|
1347
|
-
boxShadow: "0 1px 2px rgba(15,23,42,0.08), 0 6px 14px -4px color-mix(in srgb, var(--pw-accent) 50%, transparent)"
|
|
1348
|
-
},
|
|
1349
|
-
children: "Open checkout"
|
|
1350
|
-
}
|
|
1351
|
-
)
|
|
1352
|
-
] }) : /* @__PURE__ */ o(
|
|
1353
|
-
He,
|
|
2266
|
+
) : h.kind === "popup_blocked" ? /* @__PURE__ */ o(nn, { onReopen: () => v(h.priceId, h.url) }) : /* @__PURE__ */ o(
|
|
2267
|
+
Kt,
|
|
1354
2268
|
{
|
|
1355
|
-
layout:
|
|
1356
|
-
bootstrap:
|
|
1357
|
-
onAction:
|
|
1358
|
-
auth:
|
|
1359
|
-
authSession:
|
|
2269
|
+
layout: u.data.layout,
|
|
2270
|
+
bootstrap: u.data,
|
|
2271
|
+
onAction: L,
|
|
2272
|
+
auth: t.auth,
|
|
2273
|
+
authSession: f
|
|
1360
2274
|
}
|
|
1361
2275
|
))
|
|
1362
2276
|
}
|
|
1363
|
-
);
|
|
2277
|
+
) });
|
|
2278
|
+
}
|
|
2279
|
+
function en({ verifying: t }) {
|
|
2280
|
+
const { t: e } = w();
|
|
2281
|
+
return /* @__PURE__ */ c("div", { class: "flex flex-col items-center justify-center gap-3 py-12", children: [
|
|
2282
|
+
/* @__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)]" }),
|
|
2283
|
+
/* @__PURE__ */ o("span", { class: "text-xs font-medium tracking-wide text-gray-500", children: t ? e("modal.verifying_subscription", "Checking your subscription…") : e("modal.loading", "Loading…") })
|
|
2284
|
+
] });
|
|
2285
|
+
}
|
|
2286
|
+
function tn({ message: t }) {
|
|
2287
|
+
const { t: e } = w();
|
|
2288
|
+
return /* @__PURE__ */ c("div", { class: "flex flex-col items-center gap-2 py-8 text-center", children: [
|
|
2289
|
+
/* @__PURE__ */ o("div", { class: "flex h-11 w-11 items-center justify-center rounded-full bg-red-50", children: /* @__PURE__ */ c("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
2290
|
+
/* @__PURE__ */ o("path", { d: "M10 6v5M10 14h.01", stroke: "#dc2626", "stroke-width": "2", "stroke-linecap": "round" }),
|
|
2291
|
+
/* @__PURE__ */ o("circle", { cx: "10", cy: "10", r: "8", stroke: "#dc2626", "stroke-width": "1.75" })
|
|
2292
|
+
] }) }),
|
|
2293
|
+
/* @__PURE__ */ o("p", { class: "text-sm font-semibold tracking-tight text-gray-900", children: e("modal.error_generic", "Something went wrong") }),
|
|
2294
|
+
/* @__PURE__ */ o("p", { class: "text-xs leading-relaxed text-gray-500", children: t })
|
|
2295
|
+
] });
|
|
1364
2296
|
}
|
|
1365
|
-
function
|
|
1366
|
-
|
|
2297
|
+
function nn({ onReopen: t }) {
|
|
2298
|
+
const { t: e } = w();
|
|
2299
|
+
return /* @__PURE__ */ c("div", { class: "flex flex-col items-center gap-3 py-8 text-center", children: [
|
|
2300
|
+
/* @__PURE__ */ o(
|
|
2301
|
+
"div",
|
|
2302
|
+
{
|
|
2303
|
+
class: "flex h-11 w-11 items-center justify-center rounded-full",
|
|
2304
|
+
style: { background: "color-mix(in srgb, var(--pw-accent) 12%, white)", color: "var(--pw-accent)" },
|
|
2305
|
+
"aria-hidden": "true",
|
|
2306
|
+
children: /* @__PURE__ */ c("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", children: [
|
|
2307
|
+
/* @__PURE__ */ o("path", { d: "M4 5h12v10H4z", stroke: "currentColor", "stroke-width": "1.75", "stroke-linejoin": "round" }),
|
|
2308
|
+
/* @__PURE__ */ o("path", { d: "M7 9l3 3 4-5", stroke: "currentColor", "stroke-width": "1.75", "stroke-linecap": "round", "stroke-linejoin": "round" })
|
|
2309
|
+
] })
|
|
2310
|
+
}
|
|
2311
|
+
),
|
|
2312
|
+
/* @__PURE__ */ o("p", { class: "text-sm font-semibold tracking-tight text-gray-900", children: e("payment.popup_blocked_title", "Allow popups to continue") }),
|
|
2313
|
+
/* @__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.") }),
|
|
2314
|
+
/* @__PURE__ */ o(
|
|
2315
|
+
"button",
|
|
2316
|
+
{
|
|
2317
|
+
type: "button",
|
|
2318
|
+
onClick: t,
|
|
2319
|
+
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)]",
|
|
2320
|
+
style: {
|
|
2321
|
+
background: "linear-gradient(180deg, color-mix(in srgb, var(--pw-accent) 92%, white), var(--pw-accent))",
|
|
2322
|
+
boxShadow: "0 1px 2px rgba(15,23,42,0.08), 0 6px 14px -4px color-mix(in srgb, var(--pw-accent) 50%, transparent)"
|
|
2323
|
+
},
|
|
2324
|
+
children: e("payment.open_checkout_button", "Open checkout")
|
|
2325
|
+
}
|
|
2326
|
+
)
|
|
2327
|
+
] });
|
|
2328
|
+
}
|
|
2329
|
+
function rn({
|
|
2330
|
+
client: t,
|
|
1367
2331
|
onBack: e,
|
|
1368
|
-
onReopen:
|
|
1369
|
-
onRetry:
|
|
2332
|
+
onReopen: n,
|
|
2333
|
+
onRetry: r
|
|
1370
2334
|
}) {
|
|
1371
|
-
const
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
}, [])
|
|
2335
|
+
const { t: i } = w(), [s, a] = x(!1), [l, d] = x(!1), u = R(null);
|
|
2336
|
+
B(() => () => {
|
|
2337
|
+
u.current !== null && clearTimeout(u.current);
|
|
2338
|
+
}, []);
|
|
2339
|
+
const p = async () => {
|
|
2340
|
+
if (!s) {
|
|
2341
|
+
a(!0), d(!1);
|
|
2342
|
+
try {
|
|
2343
|
+
if ((await t.getUser({ force: !0 })).has_active_subscription) {
|
|
2344
|
+
typeof window < "u" && window.postMessage({ type: "paywall_purchase" }, "*");
|
|
2345
|
+
return;
|
|
2346
|
+
}
|
|
2347
|
+
d(!0), u.current !== null && clearTimeout(u.current), u.current = setTimeout(() => {
|
|
2348
|
+
d(!1), u.current = null;
|
|
2349
|
+
}, 5e3);
|
|
2350
|
+
} catch {
|
|
2351
|
+
d(!0);
|
|
2352
|
+
} finally {
|
|
2353
|
+
a(!1);
|
|
2354
|
+
}
|
|
2355
|
+
}
|
|
2356
|
+
};
|
|
2357
|
+
return /* @__PURE__ */ c("div", { class: "flex flex-col gap-3", children: [
|
|
1375
2358
|
/* @__PURE__ */ o(
|
|
1376
2359
|
"button",
|
|
1377
2360
|
{
|
|
1378
2361
|
type: "button",
|
|
1379
2362
|
onClick: e,
|
|
1380
2363
|
class: "-ml-1 self-start rounded-md px-1.5 py-0.5 text-xs font-medium text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",
|
|
1381
|
-
children: "← Back"
|
|
2364
|
+
children: i("nav.back", "← Back")
|
|
1382
2365
|
}
|
|
1383
2366
|
),
|
|
1384
|
-
/* @__PURE__ */
|
|
1385
|
-
/* @__PURE__ */
|
|
2367
|
+
/* @__PURE__ */ c("div", { class: "flex flex-col items-center gap-3 py-6 text-center", children: [
|
|
2368
|
+
/* @__PURE__ */ c("div", { class: "relative flex h-12 w-12 items-center justify-center", children: [
|
|
1386
2369
|
/* @__PURE__ */ o(
|
|
1387
2370
|
"span",
|
|
1388
2371
|
{
|
|
@@ -1393,50 +2376,36 @@ function Xe({
|
|
|
1393
2376
|
),
|
|
1394
2377
|
/* @__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)]" })
|
|
1395
2378
|
] }),
|
|
1396
|
-
/* @__PURE__ */ o("p", { class: "text-sm font-semibold tracking-tight text-gray-900", children: "Complete payment in the new tab" }),
|
|
1397
|
-
/* @__PURE__ */ o("p", { class: "max-w-[20rem] text-xs leading-relaxed text-gray-500", children:
|
|
2379
|
+
/* @__PURE__ */ o("p", { class: "text-sm font-semibold tracking-tight text-gray-900", children: i("payment.awaiting_title", "Complete payment in the new tab") }),
|
|
2380
|
+
/* @__PURE__ */ o("p", { class: "max-w-[20rem] text-xs leading-relaxed text-gray-500", children: i(
|
|
2381
|
+
"payment.awaiting_subtitle",
|
|
2382
|
+
"We'll detect your payment automatically — or click below once you're done."
|
|
2383
|
+
) }),
|
|
1398
2384
|
/* @__PURE__ */ o(
|
|
1399
2385
|
"button",
|
|
1400
2386
|
{
|
|
1401
2387
|
type: "button",
|
|
1402
|
-
onClick:
|
|
1403
|
-
|
|
1404
|
-
s(!0), a(!1);
|
|
1405
|
-
try {
|
|
1406
|
-
if ((await r.getUser({ force: !0 })).has_active_subscription) {
|
|
1407
|
-
typeof window < "u" && window.postMessage({ type: "paywall_purchase" }, "*");
|
|
1408
|
-
return;
|
|
1409
|
-
}
|
|
1410
|
-
a(!0), h.current !== null && clearTimeout(h.current), h.current = setTimeout(() => {
|
|
1411
|
-
a(!1), h.current = null;
|
|
1412
|
-
}, 5e3);
|
|
1413
|
-
} catch {
|
|
1414
|
-
a(!0);
|
|
1415
|
-
} finally {
|
|
1416
|
-
s(!1);
|
|
1417
|
-
}
|
|
1418
|
-
}
|
|
1419
|
-
},
|
|
1420
|
-
disabled: i,
|
|
2388
|
+
onClick: p,
|
|
2389
|
+
disabled: s,
|
|
1421
2390
|
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)]",
|
|
1422
2391
|
style: {
|
|
1423
2392
|
background: "linear-gradient(180deg, color-mix(in srgb, var(--pw-accent) 92%, white), var(--pw-accent))",
|
|
1424
2393
|
boxShadow: "0 1px 2px rgba(15,23,42,0.08), 0 6px 14px -4px color-mix(in srgb, var(--pw-accent) 50%, transparent)"
|
|
1425
2394
|
},
|
|
1426
|
-
children:
|
|
2395
|
+
children: s ? i("payment.checking", "Checking…") : i("payment.ive_paid", "I've paid")
|
|
1427
2396
|
}
|
|
1428
2397
|
),
|
|
1429
|
-
l ? /* @__PURE__ */ o("p", { class: "text-xs leading-relaxed text-gray-500", children: "Payment is still being processed. Please try again in a moment." }) : null
|
|
2398
|
+
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
|
|
1430
2399
|
] }),
|
|
1431
|
-
/* @__PURE__ */
|
|
1432
|
-
/* @__PURE__ */ o("p", { class: "text-xs leading-relaxed text-gray-600", children: "Checkout window didn't open or got blocked? Click here to open it again." }),
|
|
2400
|
+
/* @__PURE__ */ c("div", { class: "rounded-2xl border border-gray-200 bg-gray-50/60 p-3.5", children: [
|
|
2401
|
+
/* @__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.") }),
|
|
1433
2402
|
/* @__PURE__ */ o(
|
|
1434
2403
|
"button",
|
|
1435
2404
|
{
|
|
1436
2405
|
type: "button",
|
|
1437
|
-
onClick:
|
|
2406
|
+
onClick: n,
|
|
1438
2407
|
class: "mt-2.5 w-full rounded-xl border border-gray-200 bg-white px-3 py-2 text-xs font-semibold text-gray-700 transition-colors hover:border-gray-300 hover:bg-gray-50 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",
|
|
1439
|
-
children: "Open checkout again"
|
|
2408
|
+
children: i("payment.open_checkout_again", "Open checkout again")
|
|
1440
2409
|
}
|
|
1441
2410
|
)
|
|
1442
2411
|
] }),
|
|
@@ -1444,18 +2413,19 @@ function Xe({
|
|
|
1444
2413
|
"button",
|
|
1445
2414
|
{
|
|
1446
2415
|
type: "button",
|
|
1447
|
-
onClick:
|
|
2416
|
+
onClick: r,
|
|
1448
2417
|
class: "self-center rounded-md px-2 py-1 text-xs text-gray-500 underline-offset-2 hover:text-gray-900 hover:underline focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--pw-accent)]",
|
|
1449
|
-
children: "Tab closed? Try again"
|
|
2418
|
+
children: i("payment.tab_closed_retry", "Tab closed? Try again")
|
|
1450
2419
|
}
|
|
1451
2420
|
)
|
|
1452
2421
|
] });
|
|
1453
2422
|
}
|
|
1454
|
-
function
|
|
1455
|
-
onContinue:
|
|
2423
|
+
function we({
|
|
2424
|
+
onContinue: t,
|
|
1456
2425
|
restored: e = !1
|
|
1457
2426
|
}) {
|
|
1458
|
-
|
|
2427
|
+
const { t: n } = w();
|
|
2428
|
+
return /* @__PURE__ */ c("div", { class: "flex flex-col items-center gap-3 py-8 text-center", children: [
|
|
1459
2429
|
/* @__PURE__ */ o(
|
|
1460
2430
|
"div",
|
|
1461
2431
|
{
|
|
@@ -1479,34 +2449,37 @@ function te({
|
|
|
1479
2449
|
) })
|
|
1480
2450
|
}
|
|
1481
2451
|
),
|
|
1482
|
-
/* @__PURE__ */ o("p", { id: "pw-title", class: "mt-1 text-lg font-semibold tracking-tight text-gray-900", children: e ? "Subscription restored" : "Payment received" }),
|
|
1483
|
-
/* @__PURE__ */ o("p", { class: "text-sm leading-relaxed text-gray-500", children: e ?
|
|
2452
|
+
/* @__PURE__ */ o("p", { id: "pw-title", class: "mt-1 text-lg font-semibold tracking-tight text-gray-900", children: e ? n("modal.purchase_restored_title", "Subscription restored") : n("modal.purchase_success_title", "Payment received") }),
|
|
2453
|
+
/* @__PURE__ */ o("p", { class: "text-sm leading-relaxed text-gray-500", children: e ? n(
|
|
2454
|
+
"modal.purchase_restored_subtitle",
|
|
2455
|
+
"Welcome back — your subscription is already active."
|
|
2456
|
+
) : n("modal.purchase_success_subtitle", "Your subscription is now active.") }),
|
|
1484
2457
|
/* @__PURE__ */ o(
|
|
1485
2458
|
"button",
|
|
1486
2459
|
{
|
|
1487
2460
|
type: "button",
|
|
1488
|
-
onClick:
|
|
2461
|
+
onClick: t,
|
|
1489
2462
|
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)]",
|
|
1490
2463
|
style: {
|
|
1491
2464
|
background: "linear-gradient(180deg, color-mix(in srgb, var(--pw-accent) 92%, white), var(--pw-accent))",
|
|
1492
2465
|
boxShadow: "0 1px 2px rgba(15,23,42,0.08), 0 8px 20px -6px color-mix(in srgb, var(--pw-accent) 50%, transparent)"
|
|
1493
2466
|
},
|
|
1494
|
-
children: "Continue"
|
|
2467
|
+
children: n("modal.continue", "Continue")
|
|
1495
2468
|
}
|
|
1496
2469
|
)
|
|
1497
2470
|
] });
|
|
1498
2471
|
}
|
|
1499
|
-
const
|
|
1500
|
-
class
|
|
2472
|
+
const on = 10 * 6e4, sn = 5e3, an = 3e4;
|
|
2473
|
+
class ln {
|
|
1501
2474
|
constructor(e) {
|
|
1502
2475
|
this.timer = null, this.timeoutTimer = null, this.visibilityHandler = null, this.focusHandler = null, this.messageHandler = null, this.stopped = !1, this.checking = !1, this.opts = {
|
|
1503
2476
|
client: e.client,
|
|
1504
2477
|
onActive: e.onActive,
|
|
1505
2478
|
onTimeout: e.onTimeout ?? (() => {
|
|
1506
2479
|
}),
|
|
1507
|
-
timeoutMs: e.timeoutMs ??
|
|
1508
|
-
visibleIntervalMs: e.visibleIntervalMs ??
|
|
1509
|
-
hiddenIntervalMs: e.hiddenIntervalMs ??
|
|
2480
|
+
timeoutMs: e.timeoutMs ?? on,
|
|
2481
|
+
visibleIntervalMs: e.visibleIntervalMs ?? sn,
|
|
2482
|
+
hiddenIntervalMs: e.hiddenIntervalMs ?? an
|
|
1510
2483
|
};
|
|
1511
2484
|
}
|
|
1512
2485
|
start() {
|
|
@@ -1532,32 +2505,32 @@ class Qe {
|
|
|
1532
2505
|
}
|
|
1533
2506
|
scheduleNext() {
|
|
1534
2507
|
if (this.stopped) return;
|
|
1535
|
-
const
|
|
2508
|
+
const n = typeof document < "u" && document.visibilityState === "visible" ? this.opts.visibleIntervalMs : this.opts.hiddenIntervalMs;
|
|
1536
2509
|
this.timer = setTimeout(async () => {
|
|
1537
2510
|
await this.check(), this.scheduleNext();
|
|
1538
|
-
},
|
|
2511
|
+
}, n);
|
|
1539
2512
|
}
|
|
1540
2513
|
handleVisibilityChange() {
|
|
1541
2514
|
typeof document > "u" || (document.visibilityState === "visible" && this.check(), this.timer !== null && (clearTimeout(this.timer), this.timer = null), this.scheduleNext());
|
|
1542
2515
|
}
|
|
1543
2516
|
handleMessage(e) {
|
|
1544
|
-
const
|
|
1545
|
-
!
|
|
2517
|
+
const n = e.data;
|
|
2518
|
+
!n || typeof n != "object" || n.type === "paywall_purchase" && this.check();
|
|
1546
2519
|
}
|
|
1547
2520
|
}
|
|
1548
|
-
function
|
|
2521
|
+
function cn() {
|
|
1549
2522
|
return !(typeof document > "u" || typeof window > "u" || typeof location < "u" && location.protocol === "chrome-extension:");
|
|
1550
2523
|
}
|
|
1551
|
-
const
|
|
2524
|
+
const ae = { open: !1, view: null, error: null }, N = {
|
|
1552
2525
|
status: "paywall_status",
|
|
1553
2526
|
priceId: "paywall_price_id",
|
|
1554
2527
|
sessionId: "paywall_session_id"
|
|
1555
2528
|
};
|
|
1556
|
-
let
|
|
2529
|
+
let un = class {
|
|
1557
2530
|
constructor(e) {
|
|
1558
|
-
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 =
|
|
1559
|
-
const { auth:
|
|
1560
|
-
this.auth =
|
|
2531
|
+
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 = ae, this.stateListeners = /* @__PURE__ */ new Set();
|
|
2532
|
+
const { auth: n, ownsAuth: r } = dn(e);
|
|
2533
|
+
this.auth = n, this.ownsAuth = r, 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.userUnsub = this.billing.onUserChange((i) => {
|
|
1561
2534
|
this.emit("userChange", i);
|
|
1562
2535
|
}), this.auth && (this.authUnsub = this.auth.onAuthChange((i, s) => {
|
|
1563
2536
|
this.emit("authChange", { event: i, session: s });
|
|
@@ -1565,20 +2538,20 @@ let tt = class {
|
|
|
1565
2538
|
}
|
|
1566
2539
|
initTracker(e) {
|
|
1567
2540
|
if (e === !1) return;
|
|
1568
|
-
const
|
|
1569
|
-
if (
|
|
1570
|
-
const
|
|
1571
|
-
this.tracker = new
|
|
1572
|
-
endpoint:
|
|
2541
|
+
const n = typeof e == "object" && e !== null ? e : {};
|
|
2542
|
+
if (n.enabled === !1) return;
|
|
2543
|
+
const r = n.endpoint ?? `${this.billing.apiOrigin}/api/v1/paywall/${this.billing.paywallId}/events`;
|
|
2544
|
+
this.tracker = new je({
|
|
2545
|
+
endpoint: r,
|
|
1573
2546
|
paywallId: this.billing.paywallId,
|
|
1574
2547
|
capabilities: this.billing.capabilities,
|
|
1575
2548
|
getVisitorId: () => this.billing.getVisitorId(),
|
|
1576
2549
|
getCachedVisitorId: () => this.billing.getCachedVisitorId(),
|
|
1577
2550
|
getUserId: () => this.billing.getIdentity()?.userId ?? null,
|
|
1578
|
-
flushIntervalMs:
|
|
1579
|
-
maxBufferSize:
|
|
1580
|
-
fetch:
|
|
1581
|
-
sendBeacon:
|
|
2551
|
+
flushIntervalMs: n.flushIntervalMs,
|
|
2552
|
+
maxBufferSize: n.maxBufferSize,
|
|
2553
|
+
fetch: n.fetch,
|
|
2554
|
+
sendBeacon: n.sendBeacon
|
|
1582
2555
|
}), this.on("open", () => this.tracker?.track("paywall_opened")), this.on(
|
|
1583
2556
|
"ready",
|
|
1584
2557
|
(i) => this.tracker?.track("paywall_viewed", {
|
|
@@ -1631,8 +2604,8 @@ let tt = class {
|
|
|
1631
2604
|
* Самый частый кейс — `track('app_opened')` от хоста сразу после загрузки
|
|
1632
2605
|
* приложения, чтобы зафиксировать воронку до открытия пейвола.
|
|
1633
2606
|
*/
|
|
1634
|
-
track(e,
|
|
1635
|
-
this.tracker?.track(e,
|
|
2607
|
+
track(e, n) {
|
|
2608
|
+
this.tracker?.track(e, n);
|
|
1636
2609
|
}
|
|
1637
2610
|
/**
|
|
1638
2611
|
* Удобный шорткат вместо `paywall.on('userChange', cb)` — самый частый
|
|
@@ -1655,22 +2628,22 @@ let tt = class {
|
|
|
1655
2628
|
setBootstrap(e) {
|
|
1656
2629
|
this.billing.setBootstrap(e);
|
|
1657
2630
|
}
|
|
1658
|
-
on(e,
|
|
1659
|
-
let
|
|
1660
|
-
return
|
|
2631
|
+
on(e, n) {
|
|
2632
|
+
let r = this.listeners.get(e);
|
|
2633
|
+
return r || (r = /* @__PURE__ */ new Set(), this.listeners.set(e, r)), r.add(n), () => r.delete(n);
|
|
1661
2634
|
}
|
|
1662
|
-
off(e,
|
|
1663
|
-
this.listeners.get(e)?.delete(
|
|
2635
|
+
off(e, n) {
|
|
2636
|
+
this.listeners.get(e)?.delete(n);
|
|
1664
2637
|
}
|
|
1665
|
-
emit(e, ...
|
|
1666
|
-
const
|
|
1667
|
-
if (!
|
|
1668
|
-
const i =
|
|
1669
|
-
for (const s of
|
|
2638
|
+
emit(e, ...n) {
|
|
2639
|
+
const r = this.listeners.get(e);
|
|
2640
|
+
if (!r) return;
|
|
2641
|
+
const i = n[0];
|
|
2642
|
+
for (const s of r)
|
|
1670
2643
|
try {
|
|
1671
2644
|
s(i);
|
|
1672
|
-
} catch (
|
|
1673
|
-
typeof console < "u" && console.error("[paywall] listener error",
|
|
2645
|
+
} catch (a) {
|
|
2646
|
+
typeof console < "u" && console.error("[paywall] listener error", a);
|
|
1674
2647
|
}
|
|
1675
2648
|
}
|
|
1676
2649
|
open(e = {}) {
|
|
@@ -1742,49 +2715,49 @@ let tt = class {
|
|
|
1742
2715
|
openAnonGate(e = {}) {
|
|
1743
2716
|
this.auth && this.openInternal("anon", { ...e, skipTrial: !0, skipVisibility: !0 });
|
|
1744
2717
|
}
|
|
1745
|
-
openInternal(e,
|
|
1746
|
-
|
|
1747
|
-
const
|
|
1748
|
-
if (
|
|
2718
|
+
openInternal(e, n) {
|
|
2719
|
+
n.identity && this.billing.setIdentity(n.identity), this.purchased = !1;
|
|
2720
|
+
const r = n.skipTrial === !0 || e === "support", i = n.skipVisibility === !0 || e === "support" || e === "auth" || e === "anon", s = n.renew === !0;
|
|
2721
|
+
if (r && i) {
|
|
1749
2722
|
this.mountAndShow(e, { renew: s });
|
|
1750
2723
|
return;
|
|
1751
2724
|
}
|
|
1752
|
-
const
|
|
1753
|
-
if (
|
|
1754
|
-
this.runOpenGates(e,
|
|
2725
|
+
const a = this.billing.getCachedBootstrap();
|
|
2726
|
+
if (a) {
|
|
2727
|
+
this.runOpenGates(e, a, { skipTrial: r, skipVisibility: i, renew: s });
|
|
1755
2728
|
return;
|
|
1756
2729
|
}
|
|
1757
2730
|
if (this.mountThenLoad) {
|
|
1758
|
-
this.mountAndShow(e, { renew: s }), this.billing.bootstrap().then((
|
|
2731
|
+
this.mountAndShow(e, { renew: s }), this.billing.bootstrap().then((l) => this.runDelayedGates(l, { skipTrial: r, skipVisibility: i })).catch(() => {
|
|
1759
2732
|
});
|
|
1760
2733
|
return;
|
|
1761
2734
|
}
|
|
1762
|
-
this.billing.bootstrap().then((
|
|
2735
|
+
this.billing.bootstrap().then((l) => this.runOpenGates(e, l, { skipTrial: r, skipVisibility: i, renew: s })).catch(() => {
|
|
1763
2736
|
this.mountAndShow(e, { renew: s });
|
|
1764
2737
|
});
|
|
1765
2738
|
}
|
|
1766
2739
|
/** Применить gates ПОСЛЕ того, как модалка уже смонтирована (mount-then-load
|
|
1767
2740
|
* путь). Если gate блокирует — close() + emit. Если юзер уже сам закрыл
|
|
1768
2741
|
* модалку до резолва bootstrap'а — no-op (isOpen=false). */
|
|
1769
|
-
runDelayedGates(e,
|
|
2742
|
+
runDelayedGates(e, n) {
|
|
1770
2743
|
if (!this.isOpen) return;
|
|
1771
|
-
if (!
|
|
2744
|
+
if (!n.skipVisibility) {
|
|
1772
2745
|
const s = e.settings.visibility;
|
|
1773
2746
|
if (s && (this.lastVisibility = s, !s.visible)) {
|
|
1774
2747
|
this.close(), this.emit("visibility_blocked", s);
|
|
1775
2748
|
return;
|
|
1776
2749
|
}
|
|
1777
2750
|
}
|
|
1778
|
-
if (
|
|
1779
|
-
const
|
|
1780
|
-
if (!
|
|
1781
|
-
const i = this.ensureTrialStore(
|
|
2751
|
+
if (n.skipTrial) return;
|
|
2752
|
+
const r = e.settings.trial;
|
|
2753
|
+
if (!r) return;
|
|
2754
|
+
const i = this.ensureTrialStore(r);
|
|
1782
2755
|
i.check().then(async (s) => {
|
|
1783
2756
|
if (this.isOpen && (this.lastTrialStatus = s, s.mode !== "none")) {
|
|
1784
2757
|
if (s.blocked) {
|
|
1785
|
-
const
|
|
1786
|
-
if (this.lastTrialStatus =
|
|
1787
|
-
this.close(), this.emit("trial_blocked",
|
|
2758
|
+
const a = await i.recordBlock();
|
|
2759
|
+
if (this.lastTrialStatus = a, !this.isOpen) return;
|
|
2760
|
+
this.close(), this.emit("trial_blocked", a);
|
|
1788
2761
|
return;
|
|
1789
2762
|
}
|
|
1790
2763
|
this.trialExpiredFired || (this.trialExpiredFired = !0, this.emit("trial_expired"));
|
|
@@ -1797,63 +2770,63 @@ let tt = class {
|
|
|
1797
2770
|
// вести trial-стейт «осталось N показов» под юзером, который вообще не
|
|
1798
2771
|
// должен увидеть пейвол по таргетингу — бессмысленно: при возврате в
|
|
1799
2772
|
// правильную страну он окажется со «слипшимся» триал-счётчиком.
|
|
1800
|
-
runOpenGates(e,
|
|
1801
|
-
if (!
|
|
1802
|
-
const i =
|
|
2773
|
+
runOpenGates(e, n, r) {
|
|
2774
|
+
if (!r.skipVisibility) {
|
|
2775
|
+
const i = n.settings.visibility;
|
|
1803
2776
|
if (i && (this.lastVisibility = i, !i.visible)) {
|
|
1804
2777
|
this.emit("visibility_blocked", i);
|
|
1805
2778
|
return;
|
|
1806
2779
|
}
|
|
1807
2780
|
}
|
|
1808
|
-
if (
|
|
1809
|
-
this.mountAndShow(e, { renew:
|
|
2781
|
+
if (r.skipTrial) {
|
|
2782
|
+
this.mountAndShow(e, { renew: r.renew });
|
|
1810
2783
|
return;
|
|
1811
2784
|
}
|
|
1812
|
-
this.gateThroughTrial(e,
|
|
2785
|
+
this.gateThroughTrial(e, n, r.renew);
|
|
1813
2786
|
}
|
|
1814
|
-
gateThroughTrial(e,
|
|
1815
|
-
const i =
|
|
2787
|
+
gateThroughTrial(e, n, r) {
|
|
2788
|
+
const i = n.settings.trial;
|
|
1816
2789
|
if (!i) {
|
|
1817
|
-
this.mountAndShow(e, { renew:
|
|
2790
|
+
this.mountAndShow(e, { renew: r });
|
|
1818
2791
|
return;
|
|
1819
2792
|
}
|
|
1820
2793
|
const s = this.ensureTrialStore(i);
|
|
1821
|
-
s.check().then(async (
|
|
1822
|
-
if (this.lastTrialStatus =
|
|
1823
|
-
this.mountAndShow(e, { renew:
|
|
2794
|
+
s.check().then(async (a) => {
|
|
2795
|
+
if (this.lastTrialStatus = a, a.mode === "none") {
|
|
2796
|
+
this.mountAndShow(e, { renew: r });
|
|
1824
2797
|
return;
|
|
1825
2798
|
}
|
|
1826
|
-
if (
|
|
1827
|
-
const
|
|
1828
|
-
this.lastTrialStatus =
|
|
2799
|
+
if (a.blocked) {
|
|
2800
|
+
const l = await s.recordBlock();
|
|
2801
|
+
this.lastTrialStatus = l, this.emit("trial_blocked", l);
|
|
1829
2802
|
return;
|
|
1830
2803
|
}
|
|
1831
|
-
this.trialExpiredFired || (this.trialExpiredFired = !0, this.emit("trial_expired")), this.mountAndShow(e, { renew:
|
|
1832
|
-
}).catch((
|
|
1833
|
-
typeof console < "u" && console.warn("[paywall] trial check failed",
|
|
2804
|
+
this.trialExpiredFired || (this.trialExpiredFired = !0, this.emit("trial_expired")), this.mountAndShow(e, { renew: r });
|
|
2805
|
+
}).catch((a) => {
|
|
2806
|
+
typeof console < "u" && console.warn("[paywall] trial check failed", a), this.mountAndShow(e, { renew: r });
|
|
1834
2807
|
});
|
|
1835
2808
|
}
|
|
1836
2809
|
ensureTrialStore(e) {
|
|
1837
|
-
if (this.trialStore && this.trialStoreConfig &&
|
|
2810
|
+
if (this.trialStore && this.trialStoreConfig && fn(this.trialStoreConfig, e))
|
|
1838
2811
|
return this.trialStore;
|
|
1839
2812
|
this.trialStoreConfig = e;
|
|
1840
|
-
const
|
|
1841
|
-
return this.trialStore = typeof
|
|
2813
|
+
const n = this.billing.createTrialStore;
|
|
2814
|
+
return this.trialStore = typeof n == "function" ? n.call(this.billing, e) : Re(this.billing.getStorage(), this.billing.paywallId, e), this.trialStore;
|
|
1842
2815
|
}
|
|
1843
|
-
mountAndShow(e,
|
|
1844
|
-
const
|
|
2816
|
+
mountAndShow(e, n = {}) {
|
|
2817
|
+
const r = n.renew === !0;
|
|
1845
2818
|
if (this.handle) {
|
|
1846
|
-
this.isOpen = !0, this.handle.update({ open: !0, initialView: e, purchased: !1, renew:
|
|
2819
|
+
this.isOpen = !0, this.handle.update({ open: !0, initialView: e, purchased: !1, renew: r }), this.emit("open");
|
|
1847
2820
|
return;
|
|
1848
2821
|
}
|
|
1849
|
-
this.isOpen = !0, this.handle =
|
|
1850
|
-
|
|
2822
|
+
this.isOpen = !0, this.handle = Ge(
|
|
2823
|
+
Qt,
|
|
1851
2824
|
{
|
|
1852
2825
|
client: this.billing,
|
|
1853
2826
|
open: !0,
|
|
1854
2827
|
initialView: e,
|
|
1855
2828
|
purchased: !1,
|
|
1856
|
-
renew:
|
|
2829
|
+
renew: r,
|
|
1857
2830
|
onClose: () => this.close(),
|
|
1858
2831
|
onEvent: (i, s) => {
|
|
1859
2832
|
this.emit(i, s), i === "checkout_started" && this.startUserWatcher();
|
|
@@ -1865,13 +2838,13 @@ let tt = class {
|
|
|
1865
2838
|
), this.emit("open");
|
|
1866
2839
|
}
|
|
1867
2840
|
applyState(e) {
|
|
1868
|
-
if (!
|
|
2841
|
+
if (!pn(this.currentState, e)) {
|
|
1869
2842
|
this.currentState = e;
|
|
1870
|
-
for (const
|
|
2843
|
+
for (const n of this.stateListeners)
|
|
1871
2844
|
try {
|
|
1872
|
-
|
|
1873
|
-
} catch (
|
|
1874
|
-
console.warn("[paywall] onStateChange listener threw",
|
|
2845
|
+
n(e);
|
|
2846
|
+
} catch (r) {
|
|
2847
|
+
console.warn("[paywall] onStateChange listener threw", r);
|
|
1875
2848
|
}
|
|
1876
2849
|
}
|
|
1877
2850
|
}
|
|
@@ -1896,12 +2869,12 @@ let tt = class {
|
|
|
1896
2869
|
*
|
|
1897
2870
|
* Возвращает unsubscribe.
|
|
1898
2871
|
*/
|
|
1899
|
-
onStateChange(e,
|
|
2872
|
+
onStateChange(e, n = {}) {
|
|
1900
2873
|
this.stateListeners.add(e);
|
|
1901
|
-
const
|
|
1902
|
-
if (
|
|
2874
|
+
const r = n.immediate ?? "microtask";
|
|
2875
|
+
if (r !== "none") {
|
|
1903
2876
|
const i = this.currentState;
|
|
1904
|
-
if (
|
|
2877
|
+
if (r === "sync")
|
|
1905
2878
|
try {
|
|
1906
2879
|
e(i);
|
|
1907
2880
|
} catch (s) {
|
|
@@ -1971,53 +2944,53 @@ let tt = class {
|
|
|
1971
2944
|
* `getAccess()`, а не только после первого `open()`.
|
|
1972
2945
|
*/
|
|
1973
2946
|
async getAccess(e = {}) {
|
|
1974
|
-
let
|
|
1975
|
-
if (!
|
|
2947
|
+
let n = this.billing.getCachedBootstrap();
|
|
2948
|
+
if (!n)
|
|
1976
2949
|
try {
|
|
1977
|
-
|
|
2950
|
+
n = await this.billing.bootstrap({ signal: e.signal });
|
|
1978
2951
|
} catch {
|
|
1979
|
-
const
|
|
1980
|
-
return
|
|
2952
|
+
const a = this.billing.getCachedUser();
|
|
2953
|
+
return a?.has_active_subscription ? {
|
|
1981
2954
|
access: "granted",
|
|
1982
2955
|
reason: "has_subscription",
|
|
1983
2956
|
visibility: null,
|
|
1984
2957
|
trial: null,
|
|
1985
|
-
user:
|
|
2958
|
+
user: a
|
|
1986
2959
|
} : {
|
|
1987
2960
|
access: "blocked",
|
|
1988
2961
|
reason: "no_subscription",
|
|
1989
2962
|
visibility: null,
|
|
1990
2963
|
trial: null,
|
|
1991
|
-
user:
|
|
2964
|
+
user: a
|
|
1992
2965
|
};
|
|
1993
2966
|
}
|
|
1994
|
-
const
|
|
1995
|
-
if (
|
|
2967
|
+
const r = n.user ?? null;
|
|
2968
|
+
if (r?.has_active_subscription)
|
|
1996
2969
|
return {
|
|
1997
2970
|
access: "granted",
|
|
1998
2971
|
reason: "has_subscription",
|
|
1999
|
-
visibility:
|
|
2972
|
+
visibility: n.settings.visibility ?? null,
|
|
2000
2973
|
trial: null,
|
|
2001
|
-
user:
|
|
2974
|
+
user: r
|
|
2002
2975
|
};
|
|
2003
2976
|
let i = null;
|
|
2004
2977
|
if (!e.skipVisibility) {
|
|
2005
|
-
const
|
|
2006
|
-
if (
|
|
2007
|
-
return { access: "granted", reason: "visibility_blocked", visibility: i, trial: null, user:
|
|
2978
|
+
const a = n.settings.visibility;
|
|
2979
|
+
if (a && (i = a, this.lastVisibility = a, !a.visible))
|
|
2980
|
+
return { access: "granted", reason: "visibility_blocked", visibility: i, trial: null, user: r };
|
|
2008
2981
|
}
|
|
2009
2982
|
let s = null;
|
|
2010
2983
|
if (!e.skipTrial) {
|
|
2011
|
-
const
|
|
2012
|
-
if (
|
|
2984
|
+
const a = n.settings.trial;
|
|
2985
|
+
if (a)
|
|
2013
2986
|
try {
|
|
2014
|
-
if (s = await this.ensureTrialStore(
|
|
2015
|
-
return { access: "granted", reason: "trial_blocked", visibility: i, trial: s, user:
|
|
2016
|
-
} catch (
|
|
2017
|
-
typeof console < "u" && console.warn("[paywall] getAccess: trial check failed",
|
|
2987
|
+
if (s = await this.ensureTrialStore(a).check(), this.lastTrialStatus = s, s.blocked)
|
|
2988
|
+
return { access: "granted", reason: "trial_blocked", visibility: i, trial: s, user: r };
|
|
2989
|
+
} catch (l) {
|
|
2990
|
+
typeof console < "u" && console.warn("[paywall] getAccess: trial check failed", l);
|
|
2018
2991
|
}
|
|
2019
2992
|
}
|
|
2020
|
-
return { access: "blocked", reason: "no_subscription", visibility: i, trial: s, user:
|
|
2993
|
+
return { access: "blocked", reason: "no_subscription", visibility: i, trial: s, user: r };
|
|
2021
2994
|
}
|
|
2022
2995
|
/** Сбросить состояние триала в storage. Полезно для дев-режима / админ-кнопки
|
|
2023
2996
|
* «прогнать сценарий заново». В проде хост обычно не дёргает. */
|
|
@@ -2031,14 +3004,14 @@ let tt = class {
|
|
|
2031
3004
|
// В extension popup runtime — no-op (popup не доживёт). Там полагаемся на
|
|
2032
3005
|
// bootstrap при следующем открытии.
|
|
2033
3006
|
startUserWatcher() {
|
|
2034
|
-
this.watcher ||
|
|
3007
|
+
this.watcher || cn() && (this.watcher = new ln({
|
|
2035
3008
|
client: this.billing,
|
|
2036
3009
|
onActive: (e) => {
|
|
2037
3010
|
this.watcher = null, this.emit("purchase_completed", { priceId: null, sessionId: null });
|
|
2038
|
-
const
|
|
2039
|
-
if (
|
|
3011
|
+
const n = this.billing.getCachedBootstrap()?.settings.success_redirect_url;
|
|
3012
|
+
if (n && typeof window < "u")
|
|
2040
3013
|
try {
|
|
2041
|
-
window.location.assign(
|
|
3014
|
+
window.location.assign(n);
|
|
2042
3015
|
return;
|
|
2043
3016
|
} catch {
|
|
2044
3017
|
}
|
|
@@ -2050,7 +3023,7 @@ let tt = class {
|
|
|
2050
3023
|
}), this.watcher.start());
|
|
2051
3024
|
}
|
|
2052
3025
|
close() {
|
|
2053
|
-
!this.isOpen || !this.handle || (this.isOpen = !1, this.purchased = !1, this.handle.update({ open: !1, purchased: !1 }), this.applyState(
|
|
3026
|
+
!this.isOpen || !this.handle || (this.isOpen = !1, this.purchased = !1, this.handle.update({ open: !1, purchased: !1 }), this.applyState(ae), this.emit("close"));
|
|
2054
3027
|
}
|
|
2055
3028
|
/**
|
|
2056
3029
|
* Сканирует текущий URL на маркеры возврата с checkout и эмитит
|
|
@@ -2060,80 +3033,80 @@ let tt = class {
|
|
|
2060
3033
|
*/
|
|
2061
3034
|
checkReturn() {
|
|
2062
3035
|
if (typeof window > "u") return;
|
|
2063
|
-
const e = new URL(window.location.href),
|
|
3036
|
+
const e = new URL(window.location.href), n = ke(e.hash.replace(/^#/, "")), r = ke(e.search.replace(/^\?/, "")), i = n ?? r;
|
|
2064
3037
|
i && (i.status === "paid" ? (this.emit("purchase_completed", {
|
|
2065
3038
|
priceId: i.priceId,
|
|
2066
3039
|
sessionId: i.sessionId
|
|
2067
|
-
}),
|
|
3040
|
+
}), gn(i)) : (i.status === "failed" || i.status === "cancelled") && this.emit("purchase_failed", { reason: i.status }), mn(e));
|
|
2068
3041
|
}
|
|
2069
3042
|
destroy() {
|
|
2070
|
-
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 =
|
|
3043
|
+
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;
|
|
2071
3044
|
}
|
|
2072
3045
|
};
|
|
2073
|
-
function
|
|
2074
|
-
if (!
|
|
2075
|
-
if (
|
|
2076
|
-
return { auth:
|
|
2077
|
-
const e =
|
|
3046
|
+
function dn(t) {
|
|
3047
|
+
if (!t.auth) return { auth: void 0, ownsAuth: !1 };
|
|
3048
|
+
if (t.auth instanceof ue || hn(t.auth))
|
|
3049
|
+
return { auth: t.auth, ownsAuth: !1 };
|
|
3050
|
+
const e = t.auth === !0 ? {} : t.auth;
|
|
2078
3051
|
return {
|
|
2079
|
-
auth: new
|
|
2080
|
-
paywallId:
|
|
2081
|
-
apiOrigin: e.apiOrigin ??
|
|
2082
|
-
storage: e.storage ??
|
|
2083
|
-
fetch: e.fetch ??
|
|
3052
|
+
auth: new ue({
|
|
3053
|
+
paywallId: t.paywallId,
|
|
3054
|
+
apiOrigin: e.apiOrigin ?? t.apiOrigin,
|
|
3055
|
+
storage: e.storage ?? t.storage,
|
|
3056
|
+
fetch: e.fetch ?? t.fetch,
|
|
2084
3057
|
openPopup: e.openPopup
|
|
2085
3058
|
}),
|
|
2086
3059
|
ownsAuth: !0
|
|
2087
3060
|
};
|
|
2088
3061
|
}
|
|
2089
|
-
function
|
|
2090
|
-
if (typeof
|
|
2091
|
-
const e =
|
|
3062
|
+
function hn(t) {
|
|
3063
|
+
if (typeof t != "object" || t === null) return !1;
|
|
3064
|
+
const e = t;
|
|
2092
3065
|
return typeof e.onAuthChange == "function" && typeof e.getCachedSession == "function" && typeof e.signOut == "function";
|
|
2093
3066
|
}
|
|
2094
|
-
function
|
|
2095
|
-
return
|
|
3067
|
+
function pn(t, e) {
|
|
3068
|
+
return t.open === e.open && t.view === e.view && t.error === e.error;
|
|
2096
3069
|
}
|
|
2097
|
-
function
|
|
2098
|
-
return
|
|
3070
|
+
function fn(t, e) {
|
|
3071
|
+
return t.mode === e.mode && t.payload === e.payload && t.storage === e.storage;
|
|
2099
3072
|
}
|
|
2100
|
-
function
|
|
2101
|
-
if (!
|
|
2102
|
-
const e = new URLSearchParams(
|
|
2103
|
-
return
|
|
2104
|
-
status:
|
|
2105
|
-
priceId: e.get(
|
|
2106
|
-
sessionId: e.get(
|
|
3073
|
+
function ke(t) {
|
|
3074
|
+
if (!t) return null;
|
|
3075
|
+
const e = new URLSearchParams(t), n = e.get(N.status);
|
|
3076
|
+
return n ? {
|
|
3077
|
+
status: n,
|
|
3078
|
+
priceId: e.get(N.priceId),
|
|
3079
|
+
sessionId: e.get(N.sessionId)
|
|
2107
3080
|
} : null;
|
|
2108
3081
|
}
|
|
2109
|
-
function
|
|
3082
|
+
function gn(t) {
|
|
2110
3083
|
if (!(typeof window > "u" || !window.opener))
|
|
2111
3084
|
try {
|
|
2112
3085
|
window.opener.postMessage(
|
|
2113
3086
|
{
|
|
2114
3087
|
type: "paywall_purchase",
|
|
2115
|
-
status:
|
|
2116
|
-
priceId:
|
|
2117
|
-
sessionId:
|
|
3088
|
+
status: t.status,
|
|
3089
|
+
priceId: t.priceId,
|
|
3090
|
+
sessionId: t.sessionId
|
|
2118
3091
|
},
|
|
2119
3092
|
"*"
|
|
2120
3093
|
);
|
|
2121
3094
|
} catch {
|
|
2122
3095
|
}
|
|
2123
3096
|
}
|
|
2124
|
-
function
|
|
2125
|
-
const e = (
|
|
2126
|
-
if (!
|
|
2127
|
-
const s = new URLSearchParams(
|
|
2128
|
-
s.delete(
|
|
2129
|
-
const
|
|
2130
|
-
return
|
|
2131
|
-
},
|
|
2132
|
-
window.history.replaceState(null, "",
|
|
3097
|
+
function mn(t) {
|
|
3098
|
+
const e = (r, i) => {
|
|
3099
|
+
if (!r) return "";
|
|
3100
|
+
const s = new URLSearchParams(r.replace(/^[?#]/, ""));
|
|
3101
|
+
s.delete(N.status), s.delete(N.priceId), s.delete(N.sessionId);
|
|
3102
|
+
const a = s.toString();
|
|
3103
|
+
return a ? i + a : "";
|
|
3104
|
+
}, n = t.pathname + e(t.search, "?") + e(t.hash, "#");
|
|
3105
|
+
window.history.replaceState(null, "", n);
|
|
2133
3106
|
}
|
|
2134
|
-
class
|
|
2135
|
-
constructor(e,
|
|
2136
|
-
this.transport = e, this.paywallId =
|
|
3107
|
+
class yn {
|
|
3108
|
+
constructor(e, n, r) {
|
|
3109
|
+
this.transport = e, this.paywallId = n, this.config = r;
|
|
2137
3110
|
}
|
|
2138
3111
|
async check() {
|
|
2139
3112
|
return this.transport.request("trial.check", {
|
|
@@ -2154,37 +3127,65 @@ class at {
|
|
|
2154
3127
|
});
|
|
2155
3128
|
}
|
|
2156
3129
|
}
|
|
2157
|
-
class
|
|
2158
|
-
constructor(e,
|
|
2159
|
-
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.unsubUserBroadcast = null, this.unsubBalancesBroadcast = null, this.paywallId =
|
|
2160
|
-
getItem: (
|
|
2161
|
-
setItem: async (
|
|
2162
|
-
await this.transport.request("storage.set", { key:
|
|
3130
|
+
class xn {
|
|
3131
|
+
constructor(e, n) {
|
|
3132
|
+
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 = n.paywallId, this.apiOrigin = n.apiOrigin, this.remoteStorageAdapter = {
|
|
3133
|
+
getItem: (r) => this.transport.request("storage.get", { key: r }),
|
|
3134
|
+
setItem: async (r, i) => {
|
|
3135
|
+
await this.transport.request("storage.set", { key: r, value: i });
|
|
2163
3136
|
},
|
|
2164
|
-
removeItem: async (
|
|
2165
|
-
await this.transport.request("storage.remove", { key:
|
|
3137
|
+
removeItem: async (r) => {
|
|
3138
|
+
await this.transport.request("storage.remove", { key: r });
|
|
2166
3139
|
}
|
|
2167
3140
|
// watch не реализуем — для cross-context уведомлений consumer'ы (AuthClient,
|
|
2168
3141
|
// TrialStore) подписываются на broadcast-events напрямую через transport.
|
|
2169
3142
|
// Если когда-то понадобится — добавим storage.watch broadcast.
|
|
2170
|
-
}, this.unsubUserBroadcast = this.transport.on("userChange", (
|
|
2171
|
-
this.applyUser(
|
|
2172
|
-
}), this.unsubBalancesBroadcast = this.transport.on("balancesChange", (
|
|
2173
|
-
this.applyBalances([...
|
|
3143
|
+
}, this.unsubUserBroadcast = this.transport.on("userChange", (r) => {
|
|
3144
|
+
this.applyUser(r);
|
|
3145
|
+
}), this.unsubBalancesBroadcast = this.transport.on("balancesChange", (r) => {
|
|
3146
|
+
this.applyBalances([...r]);
|
|
2174
3147
|
});
|
|
2175
3148
|
}
|
|
2176
3149
|
// === Bootstrap ===
|
|
2177
3150
|
async bootstrap(e = {}) {
|
|
2178
|
-
const
|
|
3151
|
+
const n = await this.transport.request(
|
|
2179
3152
|
"billing.bootstrap",
|
|
2180
3153
|
{ force: e.force },
|
|
2181
3154
|
{ signal: e.signal }
|
|
2182
3155
|
);
|
|
2183
|
-
return this.
|
|
3156
|
+
return this.applyBootstrap(n), n.user && this.applyUser(n.user), n;
|
|
2184
3157
|
}
|
|
2185
3158
|
getCachedBootstrap() {
|
|
2186
3159
|
return this.cachedBootstrap;
|
|
2187
3160
|
}
|
|
3161
|
+
/** Подписка на bootstrap-state. Структурно совместима с
|
|
3162
|
+
* `BillingClient.onBootstrapChange` — те же микротаск-семантики для initial
|
|
3163
|
+
* snapshot. В extension-режиме offscreen пока не broadcast'ит bootstrapChange,
|
|
3164
|
+
* поэтому listener срабатывает только на self-инициированные `bootstrap()`
|
|
3165
|
+
* внутри этого RemoteBillingClient'а (popup перезапрашивает bootstrap → mirror
|
|
3166
|
+
* обновляется → listener вызывается). Cross-surface revalidate (другая вкладка
|
|
3167
|
+
* обновила bootstrap) не доезжает до popup'а — для этого нужен отдельный
|
|
3168
|
+
* bootstrapChange-broadcast в protocol.ts/server.ts. */
|
|
3169
|
+
onBootstrapChange(e, n = {}) {
|
|
3170
|
+
this.bootstrapListeners.add(e);
|
|
3171
|
+
const r = n.immediate ?? "microtask";
|
|
3172
|
+
if (this.cachedBootstrap && r !== "none") {
|
|
3173
|
+
const i = this.cachedBootstrap;
|
|
3174
|
+
if (r === "sync")
|
|
3175
|
+
try {
|
|
3176
|
+
e(i);
|
|
3177
|
+
} catch (s) {
|
|
3178
|
+
console.warn("[paywall] onBootstrapChange initial sync threw", s);
|
|
3179
|
+
}
|
|
3180
|
+
else
|
|
3181
|
+
queueMicrotask(() => {
|
|
3182
|
+
this.bootstrapListeners.has(e) && e(i);
|
|
3183
|
+
});
|
|
3184
|
+
}
|
|
3185
|
+
return () => {
|
|
3186
|
+
this.bootstrapListeners.delete(e);
|
|
3187
|
+
};
|
|
3188
|
+
}
|
|
2188
3189
|
/** Шорткат над `bootstrap()` — возвращает цены пейвола (locale-оверрайды
|
|
2189
3190
|
* уже применены в offscreen'е). Те же кэш-семантики, что у `bootstrap()`. */
|
|
2190
3191
|
async getPrices(e = {}) {
|
|
@@ -2200,12 +3201,12 @@ class ct {
|
|
|
2200
3201
|
}
|
|
2201
3202
|
// === User ===
|
|
2202
3203
|
async getUser(e = {}) {
|
|
2203
|
-
const
|
|
3204
|
+
const n = await this.transport.request(
|
|
2204
3205
|
"billing.getUser",
|
|
2205
3206
|
{ force: e.force },
|
|
2206
3207
|
{ signal: e.signal }
|
|
2207
3208
|
);
|
|
2208
|
-
return this.applyUser(
|
|
3209
|
+
return this.applyUser(n), n;
|
|
2209
3210
|
}
|
|
2210
3211
|
getCachedUser() {
|
|
2211
3212
|
return this.cachedUser;
|
|
@@ -2213,12 +3214,12 @@ class ct {
|
|
|
2213
3214
|
/** Подписка на user-state. Mirror'имся на broadcast'ы offscreen'а; initial
|
|
2214
3215
|
* snapshot отдаётся через microtask из локального cache (если есть) —
|
|
2215
3216
|
* ровно как в BillingClient.onUserChange. Возвращает функцию отписки. */
|
|
2216
|
-
onUserChange(e,
|
|
3217
|
+
onUserChange(e, n = {}) {
|
|
2217
3218
|
this.userListeners.add(e);
|
|
2218
|
-
const
|
|
2219
|
-
if (this.cachedUser &&
|
|
3219
|
+
const r = n.immediate ?? "microtask";
|
|
3220
|
+
if (this.cachedUser && r !== "none") {
|
|
2220
3221
|
const i = this.cachedUser;
|
|
2221
|
-
if (
|
|
3222
|
+
if (r === "sync")
|
|
2222
3223
|
try {
|
|
2223
3224
|
e(i);
|
|
2224
3225
|
} catch (s) {
|
|
@@ -2235,22 +3236,22 @@ class ct {
|
|
|
2235
3236
|
}
|
|
2236
3237
|
// === Balances ===
|
|
2237
3238
|
async getBalances(e = {}) {
|
|
2238
|
-
const
|
|
3239
|
+
const r = [...await this.transport.request(
|
|
2239
3240
|
"billing.getBalances",
|
|
2240
3241
|
{ force: e.force },
|
|
2241
3242
|
{ signal: e.signal }
|
|
2242
3243
|
)];
|
|
2243
|
-
return this.applyBalances(
|
|
3244
|
+
return this.applyBalances(r), r;
|
|
2244
3245
|
}
|
|
2245
3246
|
getCachedBalances() {
|
|
2246
3247
|
return this.cachedBalances;
|
|
2247
3248
|
}
|
|
2248
|
-
onBalanceChange(e,
|
|
3249
|
+
onBalanceChange(e, n = {}) {
|
|
2249
3250
|
this.balanceListeners.add(e);
|
|
2250
|
-
const
|
|
2251
|
-
if (this.cachedBalances &&
|
|
3251
|
+
const r = n.immediate ?? "microtask";
|
|
3252
|
+
if (this.cachedBalances && r !== "none") {
|
|
2252
3253
|
const i = this.cachedBalances;
|
|
2253
|
-
if (
|
|
3254
|
+
if (r === "sync")
|
|
2254
3255
|
try {
|
|
2255
3256
|
e(i);
|
|
2256
3257
|
} catch (s) {
|
|
@@ -2267,8 +3268,8 @@ class ct {
|
|
|
2267
3268
|
}
|
|
2268
3269
|
// === Checkout ===
|
|
2269
3270
|
async createCheckout(e) {
|
|
2270
|
-
const { signal:
|
|
2271
|
-
return this.transport.request("billing.createCheckout",
|
|
3271
|
+
const { signal: n, ...r } = e;
|
|
3272
|
+
return this.transport.request("billing.createCheckout", r, { signal: n });
|
|
2272
3273
|
}
|
|
2273
3274
|
// === Customer portal: list/cancel purchases ===
|
|
2274
3275
|
/** Rich-shape список покупок юзера (с ценой, валютой, interval, discount,
|
|
@@ -2280,12 +3281,19 @@ class ct {
|
|
|
2280
3281
|
signal: e.signal
|
|
2281
3282
|
})];
|
|
2282
3283
|
}
|
|
3284
|
+
/** Саппорт-тикет через offscreen'овский BillingClient. File-объекты
|
|
3285
|
+
* переживают chrome.runtime structured-clone (port forward'ит as-is) —
|
|
3286
|
+
* Bearer-токен/email-substitution делает offscreen, как в обычном
|
|
3287
|
+
* BillingClient. */
|
|
3288
|
+
async createSupportTicket(e) {
|
|
3289
|
+
return this.transport.request("billing.createSupportTicket", e);
|
|
3290
|
+
}
|
|
2283
3291
|
/** Отменить подписку через бэк. По умолчанию cancel в конце текущего
|
|
2284
3292
|
* периода (юзер сохраняет access до renewal date'ы). reason обязательна
|
|
2285
3293
|
* (валидируется бэком) — собирается через select причин в host-UI. */
|
|
2286
3294
|
async cancelSubscription(e) {
|
|
2287
|
-
const { signal:
|
|
2288
|
-
return this.transport.request("billing.cancelSubscription",
|
|
3295
|
+
const { signal: n, ...r } = e;
|
|
3296
|
+
return this.transport.request("billing.cancelSubscription", r, { signal: n });
|
|
2289
3297
|
}
|
|
2290
3298
|
// === Storage ===
|
|
2291
3299
|
/** PaywallUI просит storage у billing-клиента для TrialStore и других
|
|
@@ -2300,7 +3308,7 @@ class ct {
|
|
|
2300
3308
|
* read-modify-write. PaywallUI duck-types этот метод и предпочитает его
|
|
2301
3309
|
* локальной фабрике, если он есть. */
|
|
2302
3310
|
createTrialStore(e) {
|
|
2303
|
-
return new
|
|
3311
|
+
return new yn(this.transport, this.paywallId, e);
|
|
2304
3312
|
}
|
|
2305
3313
|
// === Identity ===
|
|
2306
3314
|
getIdentity() {
|
|
@@ -2317,51 +3325,60 @@ class ct {
|
|
|
2317
3325
|
return this.identity = e, e;
|
|
2318
3326
|
}
|
|
2319
3327
|
destroy() {
|
|
2320
|
-
this.unsubUserBroadcast?.(), this.unsubBalancesBroadcast?.(), this.unsubUserBroadcast = null, this.unsubBalancesBroadcast = null, this.userListeners.clear(), this.balanceListeners.clear(), this.cachedBootstrap = null, this.cachedUser = null, this.cachedBalances = null, this.identity = null;
|
|
3328
|
+
this.unsubUserBroadcast?.(), this.unsubBalancesBroadcast?.(), this.unsubUserBroadcast = null, this.unsubBalancesBroadcast = null, this.userListeners.clear(), this.balanceListeners.clear(), this.bootstrapListeners.clear(), this.cachedBootstrap = null, this.cachedUser = null, this.cachedBalances = null, this.identity = null;
|
|
3329
|
+
}
|
|
3330
|
+
applyBootstrap(e) {
|
|
3331
|
+
this.cachedBootstrap = e;
|
|
3332
|
+
for (const n of [...this.bootstrapListeners])
|
|
3333
|
+
try {
|
|
3334
|
+
n(e);
|
|
3335
|
+
} catch (r) {
|
|
3336
|
+
console.warn("[paywall] onBootstrapChange listener threw", r);
|
|
3337
|
+
}
|
|
2321
3338
|
}
|
|
2322
3339
|
/** Обновить mirror user'а и эмитнуть listener'ам если он реально изменился.
|
|
2323
3340
|
* Используется и для self-инициированных RPC (bootstrap/getUser), и для
|
|
2324
3341
|
* broadcast'ов от offscreen — чтобы host'овский onUserChange handler
|
|
2325
3342
|
* получил signal независимо от того, кто триггернул обновление. */
|
|
2326
3343
|
applyUser(e) {
|
|
2327
|
-
|
|
3344
|
+
bn(this.cachedUser, e) || (this.cachedUser = e, this.fireUserListeners(e));
|
|
2328
3345
|
}
|
|
2329
3346
|
applyBalances(e) {
|
|
2330
|
-
|
|
3347
|
+
wn(this.cachedBalances, e) || (this.cachedBalances = e, this.fireBalanceListeners(e));
|
|
2331
3348
|
}
|
|
2332
3349
|
fireUserListeners(e) {
|
|
2333
|
-
for (const
|
|
3350
|
+
for (const n of [...this.userListeners])
|
|
2334
3351
|
try {
|
|
2335
|
-
|
|
2336
|
-
} catch (
|
|
2337
|
-
console.warn("[paywall] onUserChange listener threw",
|
|
3352
|
+
n(e);
|
|
3353
|
+
} catch (r) {
|
|
3354
|
+
console.warn("[paywall] onUserChange listener threw", r);
|
|
2338
3355
|
}
|
|
2339
3356
|
}
|
|
2340
3357
|
fireBalanceListeners(e) {
|
|
2341
|
-
for (const
|
|
3358
|
+
for (const n of [...this.balanceListeners])
|
|
2342
3359
|
try {
|
|
2343
|
-
|
|
2344
|
-
} catch (
|
|
2345
|
-
console.warn("[paywall] onBalanceChange listener threw",
|
|
3360
|
+
n(e);
|
|
3361
|
+
} catch (r) {
|
|
3362
|
+
console.warn("[paywall] onBalanceChange listener threw", r);
|
|
2346
3363
|
}
|
|
2347
3364
|
}
|
|
2348
3365
|
}
|
|
2349
|
-
function
|
|
2350
|
-
return
|
|
3366
|
+
function bn(t, e) {
|
|
3367
|
+
return t === e ? !0 : !t || !e ? !1 : t.has_active_subscription === e.has_active_subscription && (t.purchases?.length ?? 0) === (e.purchases?.length ?? 0);
|
|
2351
3368
|
}
|
|
2352
|
-
function
|
|
2353
|
-
if (
|
|
2354
|
-
if (!
|
|
2355
|
-
for (let
|
|
2356
|
-
if (
|
|
3369
|
+
function wn(t, e) {
|
|
3370
|
+
if (t === e) return !0;
|
|
3371
|
+
if (!t || !e || t.length !== e.length) return !1;
|
|
3372
|
+
for (let n = 0; n < t.length; n++)
|
|
3373
|
+
if (t[n].type !== e[n].type || t[n].count !== e[n].count) return !1;
|
|
2357
3374
|
return !0;
|
|
2358
3375
|
}
|
|
2359
|
-
class
|
|
2360
|
-
constructor(e,
|
|
2361
|
-
this.transport = e, this.session = null, this.listeners = /* @__PURE__ */ new Set(), this.unsubBroadcast = null, this.paywallId =
|
|
2362
|
-
this.applySession(
|
|
2363
|
-
}), this.hydrated = this.transport.request("auth.getCachedSession", void 0).then((
|
|
2364
|
-
this.session === null &&
|
|
3376
|
+
class kn {
|
|
3377
|
+
constructor(e, n) {
|
|
3378
|
+
this.transport = e, this.session = null, this.listeners = /* @__PURE__ */ new Set(), this.unsubBroadcast = null, this.paywallId = n.paywallId, this.apiOrigin = n.apiOrigin, this.unsubBroadcast = this.transport.on("authChange", ({ event: r, session: i }) => {
|
|
3379
|
+
this.applySession(r, i);
|
|
3380
|
+
}), this.hydrated = this.transport.request("auth.getCachedSession", void 0).then((r) => {
|
|
3381
|
+
this.session === null && r !== null && (this.session = r);
|
|
2365
3382
|
}).catch(() => {
|
|
2366
3383
|
});
|
|
2367
3384
|
}
|
|
@@ -2381,8 +3398,8 @@ class dt {
|
|
|
2381
3398
|
if (this.listeners.has(e))
|
|
2382
3399
|
try {
|
|
2383
3400
|
e("INITIAL_SESSION", this.session);
|
|
2384
|
-
} catch (
|
|
2385
|
-
console.warn("[paywall] onAuthChange INITIAL_SESSION threw",
|
|
3401
|
+
} catch (n) {
|
|
3402
|
+
console.warn("[paywall] onAuthChange INITIAL_SESSION threw", n);
|
|
2386
3403
|
}
|
|
2387
3404
|
}), () => {
|
|
2388
3405
|
this.listeners.delete(e);
|
|
@@ -2390,12 +3407,12 @@ class dt {
|
|
|
2390
3407
|
}
|
|
2391
3408
|
// === Email/password ===
|
|
2392
3409
|
async signInWithEmail(e) {
|
|
2393
|
-
const
|
|
2394
|
-
return this.applySession("SIGNED_IN",
|
|
3410
|
+
const n = await this.transport.request("auth.signInWithEmail", e);
|
|
3411
|
+
return this.applySession("SIGNED_IN", n), n;
|
|
2395
3412
|
}
|
|
2396
3413
|
async signUp(e) {
|
|
2397
|
-
const
|
|
2398
|
-
return
|
|
3414
|
+
const n = await this.transport.request("auth.signUp", e);
|
|
3415
|
+
return n.kind === "signed_in" && this.applySession("SIGNED_IN", n.session), n;
|
|
2399
3416
|
}
|
|
2400
3417
|
async signOut() {
|
|
2401
3418
|
await this.transport.request("auth.signOut", void 0);
|
|
@@ -2409,8 +3426,8 @@ class dt {
|
|
|
2409
3426
|
await this.transport.request("auth.sendOtp", e);
|
|
2410
3427
|
}
|
|
2411
3428
|
async verifyOtp(e) {
|
|
2412
|
-
const
|
|
2413
|
-
return this.applySession(e.type === "recovery" ? "PASSWORD_RECOVERY" : "SIGNED_IN",
|
|
3429
|
+
const n = await this.transport.request("auth.verifyOtp", e);
|
|
3430
|
+
return this.applySession(e.type === "recovery" ? "PASSWORD_RECOVERY" : "SIGNED_IN", n), n;
|
|
2414
3431
|
}
|
|
2415
3432
|
async resendConfirmation(e) {
|
|
2416
3433
|
await this.transport.request("auth.resendConfirmation", e);
|
|
@@ -2424,18 +3441,24 @@ class dt {
|
|
|
2424
3441
|
async revokeAllSessions() {
|
|
2425
3442
|
await this.transport.request("auth.revokeAllSessions", void 0);
|
|
2426
3443
|
}
|
|
3444
|
+
/** Last-used auth method + email — читается из offscreen-storage. AuthPanel
|
|
3445
|
+
* использует для "Last used"-бейджа и pre-fill'а email. Storage paywall-
|
|
3446
|
+
* scoped, и offscreen — единый источник правды для всех вкладок/popup'ов. */
|
|
3447
|
+
async getLastLogin() {
|
|
3448
|
+
return this.transport.request("auth.getLastLogin", void 0);
|
|
3449
|
+
}
|
|
2427
3450
|
// === Anonymous sign-in ===
|
|
2428
3451
|
/** Анонимный sign-in (Supabase user без email). Логика (idempotent-check +
|
|
2429
3452
|
* resume через сохранённый refresh_token + fresh signin) живёт в
|
|
2430
3453
|
* offscreen-AuthClient'е — content только проксирует. captchaToken и
|
|
2431
3454
|
* forceCaptcha — pass-through для forward-compat / switch-account flow. */
|
|
2432
3455
|
async signInAnonymously(e = {}) {
|
|
2433
|
-
const
|
|
3456
|
+
const n = await this.transport.request("auth.signInAnonymously", {
|
|
2434
3457
|
captchaToken: e.captchaToken,
|
|
2435
3458
|
userMeta: e.userMeta,
|
|
2436
3459
|
forceCaptcha: e.forceCaptcha
|
|
2437
3460
|
});
|
|
2438
|
-
return this.applySession("SIGNED_IN",
|
|
3461
|
+
return this.applySession("SIGNED_IN", n), n;
|
|
2439
3462
|
}
|
|
2440
3463
|
/** Текущий access token (lazy-refreshable в offscreen'е). content/popup
|
|
2441
3464
|
* использует для Bearer'а в внешние fetch'и — ApiGatewayClient в
|
|
@@ -2461,26 +3484,26 @@ class dt {
|
|
|
2461
3484
|
*/
|
|
2462
3485
|
async signInWithOAuth(e) {
|
|
2463
3486
|
if (typeof window > "u")
|
|
2464
|
-
throw new
|
|
2465
|
-
const
|
|
2466
|
-
if (!
|
|
2467
|
-
throw new
|
|
3487
|
+
throw new U("oauth_unavailable", "window is required for OAuth");
|
|
3488
|
+
const n = `pw-oauth-pending-${Math.random().toString(36).slice(2, 10)}`, r = window.open("about:blank", n, "width=480,height=640,popup=yes");
|
|
3489
|
+
if (!r)
|
|
3490
|
+
throw new U(
|
|
2468
3491
|
"popup_blocked",
|
|
2469
3492
|
"browser blocked auth popup — call from a user gesture"
|
|
2470
3493
|
);
|
|
2471
|
-
|
|
3494
|
+
Sn(r, e.provider);
|
|
2472
3495
|
try {
|
|
2473
3496
|
const { authorizeUrl: i, state: s } = await this.transport.request("auth.oauthStart", {
|
|
2474
3497
|
provider: e.provider,
|
|
2475
3498
|
scopes: e.scopes,
|
|
2476
3499
|
userMeta: e.userMeta
|
|
2477
3500
|
});
|
|
2478
|
-
|
|
2479
|
-
const
|
|
2480
|
-
return this.applySession("SIGNED_IN",
|
|
3501
|
+
r.name = `pw-oauth-${s}`, r.location.replace(i), e.onPopupOpened?.();
|
|
3502
|
+
const a = await ze(r, s), l = await this.transport.request("auth.oauthExchange", { state: s, code: a });
|
|
3503
|
+
return this.applySession("SIGNED_IN", l), l;
|
|
2481
3504
|
} catch (i) {
|
|
2482
3505
|
try {
|
|
2483
|
-
|
|
3506
|
+
r.close();
|
|
2484
3507
|
} catch {
|
|
2485
3508
|
}
|
|
2486
3509
|
throw i;
|
|
@@ -2489,56 +3512,56 @@ class dt {
|
|
|
2489
3512
|
destroy() {
|
|
2490
3513
|
this.unsubBroadcast?.(), this.unsubBroadcast = null, this.listeners.clear(), this.session = null;
|
|
2491
3514
|
}
|
|
2492
|
-
applySession(e,
|
|
2493
|
-
if (!
|
|
2494
|
-
this.session =
|
|
2495
|
-
for (const
|
|
3515
|
+
applySession(e, n) {
|
|
3516
|
+
if (!vn(this.session, n)) {
|
|
3517
|
+
this.session = n;
|
|
3518
|
+
for (const r of [...this.listeners])
|
|
2496
3519
|
try {
|
|
2497
|
-
|
|
3520
|
+
r(e, n);
|
|
2498
3521
|
} catch (i) {
|
|
2499
3522
|
console.warn("[paywall] onAuthChange listener threw", i);
|
|
2500
3523
|
}
|
|
2501
3524
|
}
|
|
2502
3525
|
}
|
|
2503
3526
|
}
|
|
2504
|
-
function
|
|
2505
|
-
return
|
|
3527
|
+
function vn(t, e) {
|
|
3528
|
+
return t === e ? !0 : !t || !e ? !1 : t.access_token === e.access_token && t.refresh_token === e.refresh_token && t.expires_at === e.expires_at && t.user.id === e.user.id;
|
|
2506
3529
|
}
|
|
2507
|
-
const
|
|
3530
|
+
const _n = {
|
|
2508
3531
|
google: "Google",
|
|
2509
3532
|
apple: "Apple",
|
|
2510
3533
|
github: "GitHub",
|
|
2511
3534
|
facebook: "Facebook"
|
|
2512
3535
|
};
|
|
2513
|
-
function
|
|
2514
|
-
const
|
|
3536
|
+
function Sn(t, e) {
|
|
3537
|
+
const n = _n[e] ?? e;
|
|
2515
3538
|
try {
|
|
2516
|
-
const
|
|
2517
|
-
|
|
2518
|
-
const i =
|
|
2519
|
-
i.textContent = "html,body{margin:0;padding:0;height:100%;font-family:-apple-system,system-ui,sans-serif;background:#fafafa;color:#475569}.pw-oauth-wrap{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;gap:16px}.pw-oauth-spinner{width:36px;height:36px;border:3px solid #e2e8f0;border-top-color:#7c3aed;border-radius:50%;animation:pw-oauth-spin 800ms linear infinite}.pw-oauth-label{font-size:14px;font-weight:500;letter-spacing:-0.01em}@keyframes pw-oauth-spin{to{transform:rotate(360deg)}}",
|
|
2520
|
-
const s =
|
|
3539
|
+
const r = t.document;
|
|
3540
|
+
r.title = `Sign in with ${n}`;
|
|
3541
|
+
const i = r.createElement("style");
|
|
3542
|
+
i.textContent = "html,body{margin:0;padding:0;height:100%;font-family:-apple-system,system-ui,sans-serif;background:#fafafa;color:#475569}.pw-oauth-wrap{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;gap:16px}.pw-oauth-spinner{width:36px;height:36px;border:3px solid #e2e8f0;border-top-color:#7c3aed;border-radius:50%;animation:pw-oauth-spin 800ms linear infinite}.pw-oauth-label{font-size:14px;font-weight:500;letter-spacing:-0.01em}@keyframes pw-oauth-spin{to{transform:rotate(360deg)}}", r.head.appendChild(i);
|
|
3543
|
+
const s = r.createElement("div");
|
|
2521
3544
|
s.className = "pw-oauth-wrap";
|
|
2522
|
-
const
|
|
2523
|
-
|
|
2524
|
-
const
|
|
2525
|
-
|
|
3545
|
+
const a = r.createElement("div");
|
|
3546
|
+
a.className = "pw-oauth-spinner";
|
|
3547
|
+
const l = r.createElement("div");
|
|
3548
|
+
l.className = "pw-oauth-label", l.textContent = `Connecting to ${n}…`, s.appendChild(a), s.appendChild(l), r.body.appendChild(s);
|
|
2526
3549
|
} catch {
|
|
2527
3550
|
}
|
|
2528
3551
|
}
|
|
2529
|
-
class
|
|
3552
|
+
class Cn {
|
|
2530
3553
|
constructor(e) {
|
|
2531
3554
|
this.transport = e;
|
|
2532
3555
|
}
|
|
2533
3556
|
/** Отправить событие. Fire-and-forget — не возвращает Promise, не throw'ает.
|
|
2534
3557
|
* Сетевые/транспортные ошибки логируются в console и не блокируют caller. */
|
|
2535
|
-
track(e,
|
|
2536
|
-
typeof e != "string" || e.length === 0 || this.transport.request("tracker.track", { name: e, props:
|
|
2537
|
-
console.warn("[paywall] track failed",
|
|
3558
|
+
track(e, n) {
|
|
3559
|
+
typeof e != "string" || e.length === 0 || this.transport.request("tracker.track", { name: e, props: n }).catch((r) => {
|
|
3560
|
+
console.warn("[paywall] track failed", r);
|
|
2538
3561
|
});
|
|
2539
3562
|
}
|
|
2540
3563
|
}
|
|
2541
|
-
class
|
|
3564
|
+
class In {
|
|
2542
3565
|
constructor(e) {
|
|
2543
3566
|
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)}`;
|
|
2544
3567
|
}
|
|
@@ -2550,31 +3573,31 @@ class yt {
|
|
|
2550
3573
|
if (this.channel) return this.channel;
|
|
2551
3574
|
const e = this.factory();
|
|
2552
3575
|
this.channel = e;
|
|
2553
|
-
const
|
|
2554
|
-
return this.channelDisposers = [
|
|
2555
|
-
protocolVersion:
|
|
3576
|
+
const n = e.onMessage((i) => this.handleMessage(i)), r = e.onDisconnect(() => this.handleDisconnect());
|
|
3577
|
+
return this.channelDisposers = [n, r], this.request("handshake", {
|
|
3578
|
+
protocolVersion: Y,
|
|
2556
3579
|
clientId: this.clientId
|
|
2557
3580
|
}).then((i) => {
|
|
2558
|
-
i.protocolVersion !==
|
|
2559
|
-
`[sdk-extension] protocol version mismatch: client=${
|
|
3581
|
+
i.protocolVersion !== Y && console.warn(
|
|
3582
|
+
`[sdk-extension] protocol version mismatch: client=${Y}, offscreen=${i.protocolVersion}. Update host's @monetize.software/sdk-extension.`
|
|
2560
3583
|
);
|
|
2561
3584
|
}).catch(() => {
|
|
2562
3585
|
}), e;
|
|
2563
3586
|
}
|
|
2564
3587
|
handleMessage(e) {
|
|
2565
|
-
if (
|
|
3588
|
+
if (An(e)) {
|
|
2566
3589
|
if (e.type === "response") {
|
|
2567
|
-
const
|
|
2568
|
-
if (!
|
|
2569
|
-
this.pending.delete(e.id),
|
|
3590
|
+
const n = this.pending.get(e.id);
|
|
3591
|
+
if (!n) return;
|
|
3592
|
+
this.pending.delete(e.id), n.signal?.removeEventListener("abort", n.abortListener), e.ok ? n.resolve(e.result) : n.reject(De(e.error));
|
|
2570
3593
|
return;
|
|
2571
3594
|
}
|
|
2572
3595
|
if (e.type === "event") {
|
|
2573
|
-
const
|
|
2574
|
-
if (!
|
|
2575
|
-
for (const
|
|
3596
|
+
const n = this.listeners.get(e.kind);
|
|
3597
|
+
if (!n) return;
|
|
3598
|
+
for (const r of [...n])
|
|
2576
3599
|
try {
|
|
2577
|
-
|
|
3600
|
+
r(e.payload);
|
|
2578
3601
|
} catch (i) {
|
|
2579
3602
|
console.error("[sdk-extension] event handler threw", i);
|
|
2580
3603
|
}
|
|
@@ -2582,105 +3605,105 @@ class yt {
|
|
|
2582
3605
|
}
|
|
2583
3606
|
}
|
|
2584
3607
|
handleDisconnect() {
|
|
2585
|
-
for (const
|
|
3608
|
+
for (const n of this.channelDisposers) n();
|
|
2586
3609
|
this.channelDisposers = [], this.channel = null;
|
|
2587
3610
|
const e = Array.from(this.pending.values());
|
|
2588
3611
|
this.pending.clear();
|
|
2589
|
-
for (const
|
|
2590
|
-
|
|
3612
|
+
for (const n of e)
|
|
3613
|
+
n.signal?.removeEventListener("abort", n.abortListener), n.reject(new Ln());
|
|
2591
3614
|
}
|
|
2592
|
-
request(e,
|
|
3615
|
+
request(e, n, r = {}) {
|
|
2593
3616
|
if (this.destroyed)
|
|
2594
3617
|
return Promise.reject(new Error("TransportClient destroyed"));
|
|
2595
|
-
if (
|
|
3618
|
+
if (r.signal?.aborted)
|
|
2596
3619
|
return Promise.reject(new DOMException("Aborted", "AbortError"));
|
|
2597
3620
|
const i = this.ensureChannel(), s = `r${++this.nextId}`;
|
|
2598
|
-
return new Promise((
|
|
2599
|
-
const
|
|
2600
|
-
resolve:
|
|
2601
|
-
reject:
|
|
2602
|
-
signal:
|
|
3621
|
+
return new Promise((a, l) => {
|
|
3622
|
+
const d = {
|
|
3623
|
+
resolve: a,
|
|
3624
|
+
reject: l,
|
|
3625
|
+
signal: r.signal
|
|
2603
3626
|
};
|
|
2604
|
-
|
|
3627
|
+
r.signal && (d.abortListener = () => {
|
|
2605
3628
|
if (this.pending.delete(s)) {
|
|
2606
|
-
|
|
3629
|
+
l(new DOMException("Aborted", "AbortError"));
|
|
2607
3630
|
try {
|
|
2608
3631
|
i.send({ type: "cancel", id: s });
|
|
2609
3632
|
} catch {
|
|
2610
3633
|
}
|
|
2611
3634
|
}
|
|
2612
|
-
},
|
|
2613
|
-
const
|
|
3635
|
+
}, r.signal.addEventListener("abort", d.abortListener)), this.pending.set(s, d);
|
|
3636
|
+
const u = {
|
|
2614
3637
|
type: "request",
|
|
2615
3638
|
id: s,
|
|
2616
3639
|
kind: e,
|
|
2617
|
-
params:
|
|
3640
|
+
params: n
|
|
2618
3641
|
};
|
|
2619
3642
|
try {
|
|
2620
|
-
i.send(
|
|
2621
|
-
} catch (
|
|
2622
|
-
this.pending.delete(s),
|
|
3643
|
+
i.send(u);
|
|
3644
|
+
} catch (p) {
|
|
3645
|
+
this.pending.delete(s), r.signal?.removeEventListener("abort", d.abortListener), l(p);
|
|
2623
3646
|
}
|
|
2624
3647
|
});
|
|
2625
3648
|
}
|
|
2626
|
-
on(e,
|
|
2627
|
-
let
|
|
2628
|
-
|
|
2629
|
-
const i =
|
|
2630
|
-
return
|
|
2631
|
-
|
|
3649
|
+
on(e, n) {
|
|
3650
|
+
let r = this.listeners.get(e);
|
|
3651
|
+
r || (r = /* @__PURE__ */ new Set(), this.listeners.set(e, r));
|
|
3652
|
+
const i = n;
|
|
3653
|
+
return r.add(i), this.ensureChannel(), () => {
|
|
3654
|
+
r.delete(i);
|
|
2632
3655
|
};
|
|
2633
3656
|
}
|
|
2634
3657
|
destroy() {
|
|
2635
3658
|
if (this.destroyed) return;
|
|
2636
3659
|
this.destroyed = !0;
|
|
2637
|
-
for (const
|
|
3660
|
+
for (const n of this.channelDisposers) n();
|
|
2638
3661
|
this.channelDisposers = [], this.listeners.clear();
|
|
2639
3662
|
const e = Array.from(this.pending.values());
|
|
2640
3663
|
this.pending.clear();
|
|
2641
|
-
for (const
|
|
2642
|
-
|
|
3664
|
+
for (const n of e)
|
|
3665
|
+
n.signal?.removeEventListener("abort", n.abortListener), n.reject(new Error("TransportClient destroyed"));
|
|
2643
3666
|
this.channel?.close(), this.channel = null;
|
|
2644
3667
|
}
|
|
2645
3668
|
}
|
|
2646
|
-
class
|
|
3669
|
+
class Ln extends Error {
|
|
2647
3670
|
constructor() {
|
|
2648
3671
|
super("Transport channel disconnected mid-request"), this.code = "transport_disconnected", this.name = "TransportDisconnectedError";
|
|
2649
3672
|
}
|
|
2650
3673
|
}
|
|
2651
|
-
function
|
|
2652
|
-
if (typeof
|
|
2653
|
-
const e =
|
|
3674
|
+
function An(t) {
|
|
3675
|
+
if (typeof t != "object" || t === null) return !1;
|
|
3676
|
+
const e = t.type;
|
|
2654
3677
|
return e === "request" || e === "response" || e === "event";
|
|
2655
3678
|
}
|
|
2656
|
-
let
|
|
2657
|
-
function
|
|
2658
|
-
return
|
|
3679
|
+
let H = null;
|
|
3680
|
+
function En() {
|
|
3681
|
+
return H || (H = new In(() => qe($e)), H);
|
|
2659
3682
|
}
|
|
2660
|
-
class
|
|
3683
|
+
class jn extends un {
|
|
2661
3684
|
constructor(e) {
|
|
2662
|
-
const
|
|
3685
|
+
const n = En(), r = new xn(n, {
|
|
2663
3686
|
paywallId: e.paywallId,
|
|
2664
3687
|
apiOrigin: e.apiOrigin
|
|
2665
3688
|
});
|
|
2666
3689
|
let i;
|
|
2667
|
-
e.auth === !0 ? i = new
|
|
3690
|
+
e.auth === !0 ? i = new kn(n, {
|
|
2668
3691
|
paywallId: e.paywallId,
|
|
2669
3692
|
apiOrigin: e.apiOrigin
|
|
2670
3693
|
}) : e.auth && console.warn(
|
|
2671
3694
|
"[sdk-extension] passing AuthClient instance to PaywallUI.opts.auth is not supported in extension mode — pass `auth: true` to use offscreen-shared auth, or omit for hybrid identity-only mode."
|
|
2672
|
-
), i && (
|
|
3695
|
+
), i && (r.auth = i), super({
|
|
2673
3696
|
...e,
|
|
2674
3697
|
// Cast'ы безопасны: PaywallUI'ев resolveAuth duck-type'ит auth (см.
|
|
2675
3698
|
// sdk/src/ui/PaywallUI.ts isAuthClientLike), а billing-параметр идёт
|
|
2676
3699
|
// через `opts.client ?? new BillingClient(...)` — RemoteBillingClient
|
|
2677
3700
|
// там используется как есть, методы все сходятся.
|
|
2678
|
-
client:
|
|
3701
|
+
client: r,
|
|
2679
3702
|
auth: i,
|
|
2680
3703
|
// Внутренний EventTracker отключаем — единственный tracker живёт в
|
|
2681
3704
|
// offscreen'е. Манчиально подписываемся ниже.
|
|
2682
3705
|
analytics: !1
|
|
2683
|
-
}), this.remoteTracker = null, this.trackerUnsubs = [], e.analytics !== !1 && (this.remoteTracker = new
|
|
3706
|
+
}), this.remoteTracker = null, this.trackerUnsubs = [], e.analytics !== !1 && (this.remoteTracker = new Cn(n), this.bindAnalytics());
|
|
2684
3707
|
}
|
|
2685
3708
|
/** Зеркало sdk/PaywallUI.initTracker'овских биндингов, но с RemoteEventTracker.
|
|
2686
3709
|
* Когда @monetize.software/sdk экспоузнет публичный hook для inject'а tracker'а,
|
|
@@ -2691,46 +3714,46 @@ class Et extends tt {
|
|
|
2691
3714
|
this.on("open", () => e.track("paywall_opened")),
|
|
2692
3715
|
this.on(
|
|
2693
3716
|
"ready",
|
|
2694
|
-
(
|
|
2695
|
-
is_test_mode:
|
|
2696
|
-
prices_count:
|
|
2697
|
-
offers_count:
|
|
3717
|
+
(n) => e.track("paywall_viewed", {
|
|
3718
|
+
is_test_mode: n.settings.is_test_mode,
|
|
3719
|
+
prices_count: n.prices.length,
|
|
3720
|
+
offers_count: n.offers.length
|
|
2698
3721
|
})
|
|
2699
3722
|
),
|
|
2700
3723
|
this.on(
|
|
2701
3724
|
"price_selected",
|
|
2702
|
-
(
|
|
3725
|
+
(n) => e.track("price_selected", { price_id: n.priceId })
|
|
2703
3726
|
),
|
|
2704
3727
|
this.on(
|
|
2705
3728
|
"checkout_started",
|
|
2706
|
-
(
|
|
3729
|
+
(n) => e.track("checkout_started", { price_id: n.priceId, acquiring: n.acquiring })
|
|
2707
3730
|
),
|
|
2708
3731
|
this.on(
|
|
2709
3732
|
"purchase_completed",
|
|
2710
|
-
(
|
|
3733
|
+
(n) => e.track("purchase_completed", { price_id: n.priceId, session_id: n.sessionId })
|
|
2711
3734
|
),
|
|
2712
|
-
this.on("purchase_failed", (
|
|
3735
|
+
this.on("purchase_failed", (n) => e.track("purchase_failed", { reason: n.reason })),
|
|
2713
3736
|
this.on("close", () => e.track("paywall_closed")),
|
|
2714
3737
|
this.on(
|
|
2715
3738
|
"trial_blocked",
|
|
2716
|
-
(
|
|
2717
|
-
mode:
|
|
2718
|
-
...
|
|
3739
|
+
(n) => e.track("trial_blocked", {
|
|
3740
|
+
mode: n.mode,
|
|
3741
|
+
...n.mode === "time" ? { remaining_ms: n.remainingMs, total_ms: n.totalMs } : n.mode === "opens" ? { remaining_actions: n.remainingActions, total_actions: n.totalActions } : {}
|
|
2719
3742
|
})
|
|
2720
3743
|
),
|
|
2721
3744
|
this.on("trial_expired", () => e.track("trial_expired")),
|
|
2722
3745
|
this.on(
|
|
2723
3746
|
"visibility_blocked",
|
|
2724
|
-
(
|
|
3747
|
+
(n) => e.track("visibility_blocked", { reason: n.reason, country: n.country, tier: n.tier })
|
|
2725
3748
|
),
|
|
2726
|
-
this.on("error", (
|
|
3749
|
+
this.on("error", (n) => e.track("error", { code: n.code, message: n.message }))
|
|
2727
3750
|
);
|
|
2728
3751
|
}
|
|
2729
3752
|
/** Прокси через RemoteEventTracker. Hosts могут вызывать paywall.track
|
|
2730
3753
|
* для произвольных аналитических событий — летит в единственный
|
|
2731
3754
|
* offscreen-tracker наряду с auto-emit'ами PaywallUI. */
|
|
2732
|
-
track(e,
|
|
2733
|
-
this.remoteTracker?.track(e,
|
|
3755
|
+
track(e, n) {
|
|
3756
|
+
this.remoteTracker?.track(e, n);
|
|
2734
3757
|
}
|
|
2735
3758
|
destroy() {
|
|
2736
3759
|
for (const e of this.trackerUnsubs) e();
|
|
@@ -2738,11 +3761,11 @@ class Et extends tt {
|
|
|
2738
3761
|
}
|
|
2739
3762
|
}
|
|
2740
3763
|
export {
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
3764
|
+
Y as PROTOCOL_VERSION,
|
|
3765
|
+
jn as PaywallUI,
|
|
3766
|
+
kn as RemoteAuthClient,
|
|
3767
|
+
xn as RemoteBillingClient,
|
|
3768
|
+
Cn as RemoteEventTracker,
|
|
3769
|
+
En as getContentTransport
|
|
2747
3770
|
};
|
|
2748
3771
|
//# sourceMappingURL=content.js.map
|