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