@hook-sdk/template 0.28.2 → 0.28.4
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/index.cjs +589 -533
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +492 -436
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// src/AppRoot.tsx
|
|
2
2
|
import { useMemo as useMemo3 } from "react";
|
|
3
3
|
import { BrowserRouter, MemoryRouter, Navigate, Route, Routes } from "react-router-dom";
|
|
4
|
-
import { useHook as
|
|
4
|
+
import { useHook as useHook8 } from "@hook-sdk/sdk";
|
|
5
5
|
|
|
6
6
|
// src/config/AppConfigContext.tsx
|
|
7
7
|
import { createContext, useContext } from "react";
|
|
@@ -2033,9 +2033,53 @@ function SessionExpiredBanner() {
|
|
|
2033
2033
|
] });
|
|
2034
2034
|
}
|
|
2035
2035
|
|
|
2036
|
+
// src/internal/EmailVerifyBanner.tsx
|
|
2037
|
+
import { useState as useState5 } from "react";
|
|
2038
|
+
import { useHook as useHook5 } from "@hook-sdk/sdk";
|
|
2039
|
+
import { jsx as jsx18, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2040
|
+
function EmailVerifyBanner() {
|
|
2041
|
+
const { user, auth } = useHook5();
|
|
2042
|
+
const [sending, setSending] = useState5(false);
|
|
2043
|
+
const [sent, setSent] = useState5(false);
|
|
2044
|
+
if (!user || user.emailVerified) return null;
|
|
2045
|
+
async function handleResend() {
|
|
2046
|
+
if (sending || sent) return;
|
|
2047
|
+
setSending(true);
|
|
2048
|
+
try {
|
|
2049
|
+
await auth.resendVerify();
|
|
2050
|
+
setSent(true);
|
|
2051
|
+
} catch {
|
|
2052
|
+
} finally {
|
|
2053
|
+
setSending(false);
|
|
2054
|
+
}
|
|
2055
|
+
}
|
|
2056
|
+
const label = sent ? "Enviado!" : sending ? "Enviando..." : "Reenviar link";
|
|
2057
|
+
return /* @__PURE__ */ jsxs12(
|
|
2058
|
+
"div",
|
|
2059
|
+
{
|
|
2060
|
+
role: "status",
|
|
2061
|
+
"data-testid": "email-verify-banner",
|
|
2062
|
+
className: "sticky top-0 inset-x-0 z-50 bg-yellow-100 text-yellow-900 border-b border-yellow-200 px-4 py-2 flex items-center justify-between gap-3 text-sm",
|
|
2063
|
+
children: [
|
|
2064
|
+
/* @__PURE__ */ jsx18("span", { children: "Confirma teu e-mail pra liberar tudo." }),
|
|
2065
|
+
/* @__PURE__ */ jsx18(
|
|
2066
|
+
"button",
|
|
2067
|
+
{
|
|
2068
|
+
type: "button",
|
|
2069
|
+
onClick: handleResend,
|
|
2070
|
+
disabled: sending || sent,
|
|
2071
|
+
className: "px-3 py-1 rounded text-xs font-medium bg-yellow-900 text-yellow-50 hover:bg-yellow-800 disabled:opacity-60 disabled:cursor-not-allowed",
|
|
2072
|
+
children: label
|
|
2073
|
+
}
|
|
2074
|
+
)
|
|
2075
|
+
]
|
|
2076
|
+
}
|
|
2077
|
+
);
|
|
2078
|
+
}
|
|
2079
|
+
|
|
2036
2080
|
// src/defaults/ErrorBoundary.tsx
|
|
2037
2081
|
import { Component } from "react";
|
|
2038
|
-
import { Fragment as Fragment4, jsx as
|
|
2082
|
+
import { Fragment as Fragment4, jsx as jsx19, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2039
2083
|
var ErrorBoundary = class extends Component {
|
|
2040
2084
|
state = { error: null };
|
|
2041
2085
|
static getDerivedStateFromError(error) {
|
|
@@ -2053,12 +2097,12 @@ var ErrorBoundary = class extends Component {
|
|
|
2053
2097
|
}
|
|
2054
2098
|
render() {
|
|
2055
2099
|
if (this.state.error) {
|
|
2056
|
-
return this.props.fallback ?? /* @__PURE__ */
|
|
2057
|
-
/* @__PURE__ */
|
|
2058
|
-
/* @__PURE__ */
|
|
2100
|
+
return this.props.fallback ?? /* @__PURE__ */ jsxs13("div", { role: "alert", style: { padding: 24, textAlign: "center" }, children: [
|
|
2101
|
+
/* @__PURE__ */ jsx19("h2", { children: "Algo deu errado" }),
|
|
2102
|
+
/* @__PURE__ */ jsx19("p", { style: { opacity: 0.7 }, children: "Recarregue a p\xE1gina pra tentar de novo." })
|
|
2059
2103
|
] });
|
|
2060
2104
|
}
|
|
2061
|
-
return /* @__PURE__ */
|
|
2105
|
+
return /* @__PURE__ */ jsx19(Fragment4, { children: this.props.children });
|
|
2062
2106
|
}
|
|
2063
2107
|
};
|
|
2064
2108
|
|
|
@@ -2067,7 +2111,7 @@ import { useEffect as useEffect7 } from "react";
|
|
|
2067
2111
|
import i18n from "i18next";
|
|
2068
2112
|
import { I18nextProvider, initReactI18next } from "react-i18next";
|
|
2069
2113
|
import { usePersistedState } from "@hook-sdk/sdk";
|
|
2070
|
-
import { jsx as
|
|
2114
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
2071
2115
|
function ensureInitialized(defaultLocale, supportedLocales, resources, initialLocale) {
|
|
2072
2116
|
if (i18n.isInitialized) return;
|
|
2073
2117
|
i18n.use(initReactI18next).init({
|
|
@@ -2096,7 +2140,7 @@ function I18nProvider({
|
|
|
2096
2140
|
i18n.changeLanguage(userLocale);
|
|
2097
2141
|
}
|
|
2098
2142
|
}, [userLocale]);
|
|
2099
|
-
return /* @__PURE__ */
|
|
2143
|
+
return /* @__PURE__ */ jsx20(I18nextProvider, { i18n, children });
|
|
2100
2144
|
}
|
|
2101
2145
|
|
|
2102
2146
|
// src/dev/env.ts
|
|
@@ -2107,9 +2151,9 @@ function isDevToolsEnabled() {
|
|
|
2107
2151
|
}
|
|
2108
2152
|
|
|
2109
2153
|
// src/dev/DevSkipOnboardingFab.tsx
|
|
2110
|
-
import { useCallback as useCallback3, useRef as useRef4, useState as
|
|
2111
|
-
import { useHook as
|
|
2112
|
-
import { jsx as
|
|
2154
|
+
import { useCallback as useCallback3, useRef as useRef4, useState as useState6 } from "react";
|
|
2155
|
+
import { useHook as useHook6, usePersistedState as usePersistedState2 } from "@hook-sdk/sdk";
|
|
2156
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
2113
2157
|
var STORAGE_KEY = "hook_dev_skip_email";
|
|
2114
2158
|
var TEST_EMAIL_DOMAIN = "@hook.test";
|
|
2115
2159
|
var TEST_PASSWORD = "SkipTest!2026";
|
|
@@ -2176,10 +2220,10 @@ var STYLES = {
|
|
|
2176
2220
|
};
|
|
2177
2221
|
var CONFIRM_TIMEOUT_MS = 3e3;
|
|
2178
2222
|
function DevSkipOnboardingFab({ defaults }) {
|
|
2179
|
-
const hook =
|
|
2223
|
+
const hook = useHook6();
|
|
2180
2224
|
const { slug } = useAppConfig();
|
|
2181
|
-
const [state, setState] =
|
|
2182
|
-
const [errorMsg, setErrorMsg] =
|
|
2225
|
+
const [state, setState] = useState6("idle");
|
|
2226
|
+
const [errorMsg, setErrorMsg] = useState6(null);
|
|
2183
2227
|
const timerRef = useRef4(null);
|
|
2184
2228
|
const isAuthed = hook.authStatus === "authenticated";
|
|
2185
2229
|
const [onboarding] = usePersistedState2(
|
|
@@ -2224,7 +2268,7 @@ function DevSkipOnboardingFab({ defaults }) {
|
|
|
2224
2268
|
...state === "confirm" || state === "error" ? STYLES.confirm : {},
|
|
2225
2269
|
...state === "busy" ? STYLES.busy : {}
|
|
2226
2270
|
};
|
|
2227
|
-
return /* @__PURE__ */
|
|
2271
|
+
return /* @__PURE__ */ jsx21(
|
|
2228
2272
|
"button",
|
|
2229
2273
|
{
|
|
2230
2274
|
type: "button",
|
|
@@ -2239,20 +2283,20 @@ function DevSkipOnboardingFab({ defaults }) {
|
|
|
2239
2283
|
}
|
|
2240
2284
|
|
|
2241
2285
|
// src/internal/PaymentReturnHandler.tsx
|
|
2242
|
-
import { useCallback as useCallback4, useEffect as useEffect8, useRef as useRef5, useState as
|
|
2243
|
-
import { useHook as
|
|
2244
|
-
import { Fragment as Fragment5, jsx as
|
|
2286
|
+
import { useCallback as useCallback4, useEffect as useEffect8, useRef as useRef5, useState as useState7 } from "react";
|
|
2287
|
+
import { useHook as useHook7 } from "@hook-sdk/sdk";
|
|
2288
|
+
import { Fragment as Fragment5, jsx as jsx22, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2245
2289
|
var BACKOFF_MS = [2e3, 5e3, 1e4, 2e4, 4e4];
|
|
2246
2290
|
var MAX_CYCLES = 3;
|
|
2247
2291
|
var SUPPORT_MAILTO = "mailto:suporte@usehook.net?subject=Pagamento%20pendente";
|
|
2248
2292
|
function PaymentReturnHandler({ children }) {
|
|
2249
|
-
const { subscription, track: track2 } =
|
|
2293
|
+
const { subscription, track: track2 } = useHook7();
|
|
2250
2294
|
const subRef = useRef5(subscription);
|
|
2251
2295
|
subRef.current = subscription;
|
|
2252
2296
|
const runIdRef = useRef5(0);
|
|
2253
2297
|
const cyclesRef = useRef5(0);
|
|
2254
2298
|
const startMsRef = useRef5(0);
|
|
2255
|
-
const [state, setState] =
|
|
2299
|
+
const [state, setState] = useState7("idle");
|
|
2256
2300
|
const runPoll = useCallback4(() => {
|
|
2257
2301
|
const runId = ++runIdRef.current;
|
|
2258
2302
|
const isFirstRun = cyclesRef.current === 0;
|
|
@@ -2318,19 +2362,19 @@ function PaymentReturnHandler({ children }) {
|
|
|
2318
2362
|
window.location.href = cleanUrl.toString();
|
|
2319
2363
|
}, []);
|
|
2320
2364
|
if (state === "confirming") {
|
|
2321
|
-
return /* @__PURE__ */
|
|
2365
|
+
return /* @__PURE__ */ jsx22("div", { role: "status", "aria-live": "polite", style: overlayStyle2, children: "Confirmando pagamento\u2026" });
|
|
2322
2366
|
}
|
|
2323
2367
|
if (state === "waiting") {
|
|
2324
|
-
return /* @__PURE__ */
|
|
2325
|
-
/* @__PURE__ */
|
|
2326
|
-
/* @__PURE__ */
|
|
2368
|
+
return /* @__PURE__ */ jsx22("div", { role: "status", "aria-live": "polite", style: overlayStyle2, children: /* @__PURE__ */ jsxs14("div", { style: { maxWidth: 320, textAlign: "center", lineHeight: 1.5 }, children: [
|
|
2369
|
+
/* @__PURE__ */ jsx22("div", { style: { marginBottom: 16 }, children: "Pagamento aceito. Estamos confirmando com o banco \u2014 pode levar alguns minutos." }),
|
|
2370
|
+
/* @__PURE__ */ jsx22("button", { type: "button", onClick: runPoll, style: buttonStyle, children: "Atualizar" })
|
|
2327
2371
|
] }) });
|
|
2328
2372
|
}
|
|
2329
2373
|
if (state === "timeout") {
|
|
2330
|
-
return /* @__PURE__ */
|
|
2331
|
-
/* @__PURE__ */
|
|
2332
|
-
/* @__PURE__ */
|
|
2333
|
-
/* @__PURE__ */
|
|
2374
|
+
return /* @__PURE__ */ jsx22("div", { role: "alert", "aria-live": "assertive", style: overlayStyle2, children: /* @__PURE__ */ jsxs14("div", { style: { maxWidth: 360, textAlign: "center", lineHeight: 1.5 }, children: [
|
|
2375
|
+
/* @__PURE__ */ jsx22("div", { style: { marginBottom: 16 }, children: "Ainda n\xE3o conseguimos confirmar seu pagamento com o banco. Voc\xEA pode tentar de novo, voltar pro app, ou falar com a gente." }),
|
|
2376
|
+
/* @__PURE__ */ jsxs14("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: [
|
|
2377
|
+
/* @__PURE__ */ jsx22(
|
|
2334
2378
|
"button",
|
|
2335
2379
|
{
|
|
2336
2380
|
type: "button",
|
|
@@ -2343,7 +2387,7 @@ function PaymentReturnHandler({ children }) {
|
|
|
2343
2387
|
children: "Tentar de novo"
|
|
2344
2388
|
}
|
|
2345
2389
|
),
|
|
2346
|
-
/* @__PURE__ */
|
|
2390
|
+
/* @__PURE__ */ jsx22(
|
|
2347
2391
|
"button",
|
|
2348
2392
|
{
|
|
2349
2393
|
type: "button",
|
|
@@ -2353,7 +2397,7 @@ function PaymentReturnHandler({ children }) {
|
|
|
2353
2397
|
children: "Voltar pro app"
|
|
2354
2398
|
}
|
|
2355
2399
|
),
|
|
2356
|
-
/* @__PURE__ */
|
|
2400
|
+
/* @__PURE__ */ jsx22(
|
|
2357
2401
|
"a",
|
|
2358
2402
|
{
|
|
2359
2403
|
href: SUPPORT_MAILTO,
|
|
@@ -2365,7 +2409,7 @@ function PaymentReturnHandler({ children }) {
|
|
|
2365
2409
|
] })
|
|
2366
2410
|
] }) });
|
|
2367
2411
|
}
|
|
2368
|
-
return /* @__PURE__ */
|
|
2412
|
+
return /* @__PURE__ */ jsx22(Fragment5, { children });
|
|
2369
2413
|
}
|
|
2370
2414
|
var overlayStyle2 = {
|
|
2371
2415
|
position: "fixed",
|
|
@@ -2404,7 +2448,7 @@ var linkStyle = {
|
|
|
2404
2448
|
};
|
|
2405
2449
|
|
|
2406
2450
|
// src/AppRoot.tsx
|
|
2407
|
-
import { Fragment as Fragment6, jsx as
|
|
2451
|
+
import { Fragment as Fragment6, jsx as jsx23, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2408
2452
|
function buildLegacyConfigShim(config) {
|
|
2409
2453
|
const paywall = config.paywall;
|
|
2410
2454
|
const isFree = paywall.mode === "free";
|
|
@@ -2483,14 +2527,17 @@ function AppRoot(props) {
|
|
|
2483
2527
|
const basename = `/app/${config.slug}`;
|
|
2484
2528
|
const routerProps = testRouter === "memory" ? { basename, initialEntries: testInitialEntries } : { basename };
|
|
2485
2529
|
const position = config.install_prompt?.position ?? "post-paywall";
|
|
2486
|
-
const subscriptionGated = /* @__PURE__ */
|
|
2487
|
-
|
|
2488
|
-
/* @__PURE__ */
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
/* @__PURE__ */
|
|
2492
|
-
|
|
2493
|
-
|
|
2530
|
+
const subscriptionGated = /* @__PURE__ */ jsxs15(SubscriptionGate, { Paywall: Paywall2 ?? FallbackPaywall, children: [
|
|
2531
|
+
/* @__PURE__ */ jsx23(EmailVerifyBanner, {}),
|
|
2532
|
+
position === "post-paywall" ? /* @__PURE__ */ jsxs15(InstallGate, { position: "post-paywall", children: [
|
|
2533
|
+
children,
|
|
2534
|
+
/* @__PURE__ */ jsx23(PushPrompt, {})
|
|
2535
|
+
] }) : /* @__PURE__ */ jsxs15(Fragment6, { children: [
|
|
2536
|
+
children,
|
|
2537
|
+
/* @__PURE__ */ jsx23(PushPrompt, {})
|
|
2538
|
+
] })
|
|
2539
|
+
] });
|
|
2540
|
+
const authGated = /* @__PURE__ */ jsx23(
|
|
2494
2541
|
AuthGated,
|
|
2495
2542
|
{
|
|
2496
2543
|
config,
|
|
@@ -2505,13 +2552,13 @@ function AppRoot(props) {
|
|
|
2505
2552
|
children: subscriptionGated
|
|
2506
2553
|
}
|
|
2507
2554
|
);
|
|
2508
|
-
const routedTree = /* @__PURE__ */
|
|
2509
|
-
/* @__PURE__ */
|
|
2510
|
-
/* @__PURE__ */
|
|
2511
|
-
position === "pre-auth" ? /* @__PURE__ */
|
|
2512
|
-
isDevToolsEnabled() && devSkipOnboarding ? /* @__PURE__ */
|
|
2555
|
+
const routedTree = /* @__PURE__ */ jsxs15(Router, { ...routerProps, children: [
|
|
2556
|
+
/* @__PURE__ */ jsx23(DeepLinkHandler, { deepLinks: config.deepLinks }),
|
|
2557
|
+
/* @__PURE__ */ jsx23(SessionExpiredBanner, {}),
|
|
2558
|
+
position === "pre-auth" ? /* @__PURE__ */ jsx23(InstallGate, { position: "pre-auth", children: authGated }) : authGated,
|
|
2559
|
+
isDevToolsEnabled() && devSkipOnboarding ? /* @__PURE__ */ jsx23(DevSkipOnboardingFab, { defaults: devSkipOnboarding.defaults }) : null
|
|
2513
2560
|
] });
|
|
2514
|
-
return /* @__PURE__ */
|
|
2561
|
+
return /* @__PURE__ */ jsx23(ErrorBoundary, { children: /* @__PURE__ */ jsx23(AppConfigProvider, { config, children: /* @__PURE__ */ jsx23(TemplateConfigProvider, { config: legacyShim, children: /* @__PURE__ */ jsx23(ThemeProvider, { children: /* @__PURE__ */ jsx23(PersistenceRegistry, { config: config.persistedKeys, children: config.i18n ? /* @__PURE__ */ jsx23(
|
|
2515
2562
|
I18nProvider,
|
|
2516
2563
|
{
|
|
2517
2564
|
defaultLocale: config.i18n.defaultLocale,
|
|
@@ -2531,46 +2578,46 @@ function AuthGated({
|
|
|
2531
2578
|
EmailVerify,
|
|
2532
2579
|
PreAuthFlow
|
|
2533
2580
|
}) {
|
|
2534
|
-
const { authStatus } =
|
|
2581
|
+
const { authStatus } = useHook8();
|
|
2535
2582
|
if (authStatus === "loading") return null;
|
|
2536
2583
|
if (authStatus !== "authenticated") {
|
|
2537
2584
|
if (config.authFlow.signupMode === "pay_first" && PreAuthFlow) {
|
|
2538
|
-
return /* @__PURE__ */
|
|
2539
|
-
/* @__PURE__ */
|
|
2540
|
-
/* @__PURE__ */
|
|
2541
|
-
/* @__PURE__ */
|
|
2542
|
-
EmailVerify ? /* @__PURE__ */
|
|
2543
|
-
/* @__PURE__ */
|
|
2585
|
+
return /* @__PURE__ */ jsxs15(Routes, { children: [
|
|
2586
|
+
/* @__PURE__ */ jsx23(Route, { path: "/signin", element: /* @__PURE__ */ jsx23(Login, {}) }),
|
|
2587
|
+
/* @__PURE__ */ jsx23(Route, { path: "/forgot", element: /* @__PURE__ */ jsx23(Forgot, {}) }),
|
|
2588
|
+
/* @__PURE__ */ jsx23(Route, { path: "/reset", element: /* @__PURE__ */ jsx23(Reset, {}) }),
|
|
2589
|
+
EmailVerify ? /* @__PURE__ */ jsx23(Route, { path: "/verify", element: /* @__PURE__ */ jsx23(EmailVerify, {}) }) : null,
|
|
2590
|
+
/* @__PURE__ */ jsx23(Route, { path: "/*", element: /* @__PURE__ */ jsx23(PreAuthFlow, {}) })
|
|
2544
2591
|
] });
|
|
2545
2592
|
}
|
|
2546
2593
|
if (config.onboarding?.trigger === "pre_signup_custom" && PreAuthFlow) {
|
|
2547
|
-
return /* @__PURE__ */
|
|
2548
|
-
/* @__PURE__ */
|
|
2549
|
-
/* @__PURE__ */
|
|
2550
|
-
/* @__PURE__ */
|
|
2551
|
-
/* @__PURE__ */
|
|
2552
|
-
EmailVerify ? /* @__PURE__ */
|
|
2553
|
-
/* @__PURE__ */
|
|
2594
|
+
return /* @__PURE__ */ jsxs15(Routes, { children: [
|
|
2595
|
+
/* @__PURE__ */ jsx23(Route, { path: "/signin", element: /* @__PURE__ */ jsx23(Login, {}) }),
|
|
2596
|
+
/* @__PURE__ */ jsx23(Route, { path: "/signup", element: /* @__PURE__ */ jsx23(Signup, {}) }),
|
|
2597
|
+
/* @__PURE__ */ jsx23(Route, { path: "/forgot", element: /* @__PURE__ */ jsx23(Forgot, {}) }),
|
|
2598
|
+
/* @__PURE__ */ jsx23(Route, { path: "/reset", element: /* @__PURE__ */ jsx23(Reset, {}) }),
|
|
2599
|
+
EmailVerify ? /* @__PURE__ */ jsx23(Route, { path: "/verify", element: /* @__PURE__ */ jsx23(EmailVerify, {}) }) : null,
|
|
2600
|
+
/* @__PURE__ */ jsx23(Route, { path: "/*", element: /* @__PURE__ */ jsx23(PreAuthFlow, {}) })
|
|
2554
2601
|
] });
|
|
2555
2602
|
}
|
|
2556
|
-
return /* @__PURE__ */
|
|
2557
|
-
/* @__PURE__ */
|
|
2558
|
-
/* @__PURE__ */
|
|
2559
|
-
/* @__PURE__ */
|
|
2560
|
-
/* @__PURE__ */
|
|
2561
|
-
EmailVerify ? /* @__PURE__ */
|
|
2562
|
-
/* @__PURE__ */
|
|
2603
|
+
return /* @__PURE__ */ jsxs15(Routes, { children: [
|
|
2604
|
+
/* @__PURE__ */ jsx23(Route, { path: "/", element: /* @__PURE__ */ jsx23(Login, {}) }),
|
|
2605
|
+
/* @__PURE__ */ jsx23(Route, { path: "/signup", element: /* @__PURE__ */ jsx23(Signup, {}) }),
|
|
2606
|
+
/* @__PURE__ */ jsx23(Route, { path: "/forgot", element: /* @__PURE__ */ jsx23(Forgot, {}) }),
|
|
2607
|
+
/* @__PURE__ */ jsx23(Route, { path: "/reset", element: /* @__PURE__ */ jsx23(Reset, {}) }),
|
|
2608
|
+
EmailVerify ? /* @__PURE__ */ jsx23(Route, { path: "/verify", element: /* @__PURE__ */ jsx23(EmailVerify, {}) }) : null,
|
|
2609
|
+
/* @__PURE__ */ jsx23(Route, { path: "*", element: /* @__PURE__ */ jsx23(Navigate, { to: "/", replace: true }) })
|
|
2563
2610
|
] });
|
|
2564
2611
|
}
|
|
2565
|
-
return /* @__PURE__ */
|
|
2612
|
+
return /* @__PURE__ */ jsx23(Fragment6, { children });
|
|
2566
2613
|
}
|
|
2567
2614
|
function FallbackPaywall() {
|
|
2568
2615
|
return null;
|
|
2569
2616
|
}
|
|
2570
2617
|
|
|
2571
2618
|
// src/hooks/usePush.ts
|
|
2572
|
-
import { useCallback as useCallback5, useEffect as useEffect9, useState as
|
|
2573
|
-
import { useHook as
|
|
2619
|
+
import { useCallback as useCallback5, useEffect as useEffect9, useState as useState8 } from "react";
|
|
2620
|
+
import { useHook as useHook9 } from "@hook-sdk/sdk";
|
|
2574
2621
|
var DISMISS_STORAGE_KEY = "push:dismissed-until";
|
|
2575
2622
|
var DISMISS_TTL_MS2 = 7 * 24 * 60 * 60 * 1e3;
|
|
2576
2623
|
function detectIosNeedsInstall() {
|
|
@@ -2614,8 +2661,8 @@ function deriveState(push) {
|
|
|
2614
2661
|
return { kind: "prompt" };
|
|
2615
2662
|
}
|
|
2616
2663
|
function usePush() {
|
|
2617
|
-
const { push } =
|
|
2618
|
-
const [state, setState] =
|
|
2664
|
+
const { push } = useHook9();
|
|
2665
|
+
const [state, setState] = useState8(() => deriveState(push));
|
|
2619
2666
|
useEffect9(() => {
|
|
2620
2667
|
setState(deriveState(push));
|
|
2621
2668
|
}, [push]);
|
|
@@ -2653,27 +2700,27 @@ function usePush() {
|
|
|
2653
2700
|
}
|
|
2654
2701
|
|
|
2655
2702
|
// src/components/PushPrompt.tsx
|
|
2656
|
-
import { jsx as
|
|
2703
|
+
import { jsx as jsx24, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2657
2704
|
function PushPrompt2({ texts, onSubscribed, onDeclined, onInstallRequested, className }) {
|
|
2658
2705
|
const { state, subscribe } = usePush();
|
|
2659
2706
|
if (state.kind === "denied" || state.kind === "dismissed" || state.kind === "subscribed") {
|
|
2660
2707
|
return null;
|
|
2661
2708
|
}
|
|
2662
2709
|
if (state.kind === "ios_needs_install") {
|
|
2663
|
-
return /* @__PURE__ */
|
|
2664
|
-
/* @__PURE__ */
|
|
2665
|
-
/* @__PURE__ */
|
|
2666
|
-
onInstallRequested && texts.iosInstallCta && /* @__PURE__ */
|
|
2710
|
+
return /* @__PURE__ */ jsxs16("div", { className, role: "region", "aria-label": texts.iosInstallTitle, children: [
|
|
2711
|
+
/* @__PURE__ */ jsx24("h3", { children: texts.iosInstallTitle }),
|
|
2712
|
+
/* @__PURE__ */ jsx24("p", { children: texts.iosInstallBody }),
|
|
2713
|
+
onInstallRequested && texts.iosInstallCta && /* @__PURE__ */ jsx24("button", { onClick: onInstallRequested, children: texts.iosInstallCta })
|
|
2667
2714
|
] });
|
|
2668
2715
|
}
|
|
2669
2716
|
if (state.kind === "unsupported") {
|
|
2670
|
-
return /* @__PURE__ */
|
|
2717
|
+
return /* @__PURE__ */ jsx24("div", { className, role: "region", children: /* @__PURE__ */ jsx24("p", { children: texts.unsupportedBody }) });
|
|
2671
2718
|
}
|
|
2672
2719
|
if (state.kind === "error") {
|
|
2673
|
-
return /* @__PURE__ */
|
|
2720
|
+
return /* @__PURE__ */ jsx24("div", { className, role: "region", "aria-label": "error", children: /* @__PURE__ */ jsx24("p", { children: state.message }) });
|
|
2674
2721
|
}
|
|
2675
|
-
return /* @__PURE__ */
|
|
2676
|
-
/* @__PURE__ */
|
|
2722
|
+
return /* @__PURE__ */ jsxs16("div", { className, role: "region", children: [
|
|
2723
|
+
/* @__PURE__ */ jsx24(
|
|
2677
2724
|
"button",
|
|
2678
2725
|
{
|
|
2679
2726
|
type: "button",
|
|
@@ -2687,13 +2734,13 @@ function PushPrompt2({ texts, onSubscribed, onDeclined, onInstallRequested, clas
|
|
|
2687
2734
|
children: texts.cta
|
|
2688
2735
|
}
|
|
2689
2736
|
),
|
|
2690
|
-
onDeclined && /* @__PURE__ */
|
|
2737
|
+
onDeclined && /* @__PURE__ */ jsx24("button", { type: "button", onClick: onDeclined, children: texts.declineCta })
|
|
2691
2738
|
] });
|
|
2692
2739
|
}
|
|
2693
2740
|
|
|
2694
2741
|
// src/components/LanguageSwitcher.tsx
|
|
2695
2742
|
import { usePersistedState as usePersistedState3 } from "@hook-sdk/sdk";
|
|
2696
|
-
import { jsx as
|
|
2743
|
+
import { jsx as jsx25, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2697
2744
|
function LanguageSwitcher({ id, className, label = "Language" }) {
|
|
2698
2745
|
const config = useAppConfig();
|
|
2699
2746
|
const i18nConfig = config.i18n;
|
|
@@ -2702,50 +2749,50 @@ function LanguageSwitcher({ id, className, label = "Language" }) {
|
|
|
2702
2749
|
i18nConfig?.defaultLocale ?? "en-US"
|
|
2703
2750
|
);
|
|
2704
2751
|
if (!i18nConfig) return null;
|
|
2705
|
-
return /* @__PURE__ */
|
|
2706
|
-
label ? /* @__PURE__ */
|
|
2707
|
-
/* @__PURE__ */
|
|
2752
|
+
return /* @__PURE__ */ jsxs17("label", { className, children: [
|
|
2753
|
+
label ? /* @__PURE__ */ jsx25("span", { children: label }) : null,
|
|
2754
|
+
/* @__PURE__ */ jsx25(
|
|
2708
2755
|
"select",
|
|
2709
2756
|
{
|
|
2710
2757
|
id,
|
|
2711
2758
|
value: userLocale,
|
|
2712
2759
|
onChange: (e) => setUserLocale(e.target.value),
|
|
2713
2760
|
"data-testid": "language-switcher",
|
|
2714
|
-
children: i18nConfig.supportedLocales.map((loc) => /* @__PURE__ */
|
|
2761
|
+
children: i18nConfig.supportedLocales.map((loc) => /* @__PURE__ */ jsx25("option", { value: loc, children: loc }, loc))
|
|
2715
2762
|
}
|
|
2716
2763
|
)
|
|
2717
2764
|
] });
|
|
2718
2765
|
}
|
|
2719
2766
|
|
|
2720
2767
|
// src/defaults/LoadingState.tsx
|
|
2721
|
-
import { jsx as
|
|
2768
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
2722
2769
|
function LoadingState({ message }) {
|
|
2723
|
-
return /* @__PURE__ */
|
|
2770
|
+
return /* @__PURE__ */ jsx26("div", { role: "status", "aria-live": "polite", style: { padding: 24, textAlign: "center" }, children: /* @__PURE__ */ jsx26("span", { children: message ?? "Carregando..." }) });
|
|
2724
2771
|
}
|
|
2725
2772
|
|
|
2726
2773
|
// src/defaults/EmptyState.tsx
|
|
2727
|
-
import { jsx as
|
|
2774
|
+
import { jsx as jsx27, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2728
2775
|
function EmptyState({ title, description, action }) {
|
|
2729
|
-
return /* @__PURE__ */
|
|
2730
|
-
/* @__PURE__ */
|
|
2731
|
-
description && /* @__PURE__ */
|
|
2732
|
-
action && /* @__PURE__ */
|
|
2776
|
+
return /* @__PURE__ */ jsxs18("div", { role: "status", style: { padding: 32, textAlign: "center" }, children: [
|
|
2777
|
+
/* @__PURE__ */ jsx27("h2", { style: { marginBottom: 8 }, children: title }),
|
|
2778
|
+
description && /* @__PURE__ */ jsx27("p", { style: { opacity: 0.7 }, children: description }),
|
|
2779
|
+
action && /* @__PURE__ */ jsx27("div", { style: { marginTop: 16 }, children: action })
|
|
2733
2780
|
] });
|
|
2734
2781
|
}
|
|
2735
2782
|
|
|
2736
2783
|
// src/defaults/CheckoutPageDefault.tsx
|
|
2737
|
-
import { useEffect as useEffect11, useMemo as useMemo5, useState as
|
|
2784
|
+
import { useEffect as useEffect11, useMemo as useMemo5, useState as useState10 } from "react";
|
|
2738
2785
|
import { useNavigate as useNavigate2 } from "react-router-dom";
|
|
2739
2786
|
|
|
2740
2787
|
// src/hooks/useCheckoutForm.ts
|
|
2741
|
-
import { useCallback as useCallback6, useEffect as useEffect10, useMemo as useMemo4, useRef as useRef6, useState as
|
|
2788
|
+
import { useCallback as useCallback6, useEffect as useEffect10, useMemo as useMemo4, useRef as useRef6, useState as useState9 } from "react";
|
|
2742
2789
|
import {
|
|
2743
|
-
useHook as
|
|
2790
|
+
useHook as useHook10,
|
|
2744
2791
|
EmailTakenError
|
|
2745
2792
|
} from "@hook-sdk/sdk";
|
|
2746
2793
|
|
|
2747
2794
|
// src/errors.ts
|
|
2748
|
-
import { SdkError, SdkAuthError, SdkRateLimitError } from "@hook-sdk/sdk";
|
|
2795
|
+
import { SdkError, SdkAuthError, SdkRateLimitError, SdkValidationError } from "@hook-sdk/sdk";
|
|
2749
2796
|
function mapSdkError(err) {
|
|
2750
2797
|
if (err instanceof SdkRateLimitError) {
|
|
2751
2798
|
return {
|
|
@@ -2764,6 +2811,9 @@ function mapSdkError(err) {
|
|
|
2764
2811
|
}
|
|
2765
2812
|
return { code: "invalid_credentials", message: "E-mail ou senha inv\xE1lidos." };
|
|
2766
2813
|
}
|
|
2814
|
+
if (err instanceof SdkValidationError && err.code === "auth.email_taken") {
|
|
2815
|
+
return { code: "email_taken", message: "Esse e-mail j\xE1 tem conta." };
|
|
2816
|
+
}
|
|
2767
2817
|
if (err instanceof SdkError && err.httpStatus === 0) {
|
|
2768
2818
|
return { code: "network", message: "Sem conex\xE3o com o servidor. Verifique sua internet." };
|
|
2769
2819
|
}
|
|
@@ -2778,15 +2828,15 @@ var EMAIL_RE = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
|
2778
2828
|
var PHONE_RE = /^[0-9()+\-\s]{8,20}$/;
|
|
2779
2829
|
var CHECK_DEBOUNCE_MS = 400;
|
|
2780
2830
|
function useCheckoutForm(args) {
|
|
2781
|
-
const { auth } =
|
|
2782
|
-
const [name, setName] =
|
|
2783
|
-
const [email, setEmail] =
|
|
2784
|
-
const [emailConfirm, setEmailConfirm] =
|
|
2785
|
-
const [phone, setPhone] =
|
|
2786
|
-
const [cpf, setCpf] =
|
|
2787
|
-
const [method, setMethod] =
|
|
2788
|
-
const [cycle, setCycle] =
|
|
2789
|
-
const [card, setCardState] =
|
|
2831
|
+
const { auth } = useHook10();
|
|
2832
|
+
const [name, setName] = useState9("");
|
|
2833
|
+
const [email, setEmail] = useState9("");
|
|
2834
|
+
const [emailConfirm, setEmailConfirm] = useState9("");
|
|
2835
|
+
const [phone, setPhone] = useState9("");
|
|
2836
|
+
const [cpf, setCpf] = useState9("");
|
|
2837
|
+
const [method, setMethod] = useState9(args.defaultMethod);
|
|
2838
|
+
const [cycle, setCycle] = useState9(args.defaultCycle);
|
|
2839
|
+
const [card, setCardState] = useState9({
|
|
2790
2840
|
number: "",
|
|
2791
2841
|
expiryMonth: "",
|
|
2792
2842
|
expiryYear: "",
|
|
@@ -2796,17 +2846,17 @@ function useCheckoutForm(args) {
|
|
|
2796
2846
|
const setCard = useCallback6((patch) => {
|
|
2797
2847
|
setCardState((prev) => ({ ...prev, ...patch }));
|
|
2798
2848
|
}, []);
|
|
2799
|
-
const [touchedName, setTouchedName] =
|
|
2800
|
-
const [touchedEmail, setTouchedEmail] =
|
|
2801
|
-
const [touchedEmailConfirm, setTouchedEmailConfirm] =
|
|
2802
|
-
const [touchedPhone, setTouchedPhone] =
|
|
2803
|
-
const [touchedCpf, setTouchedCpf] =
|
|
2804
|
-
const [formSubmitAttempted, setFormSubmitAttempted] =
|
|
2805
|
-
const [submitting, setSubmitting] =
|
|
2806
|
-
const [error, setError] =
|
|
2807
|
-
const [emailTaken, setEmailTaken] =
|
|
2808
|
-
const [loginUrl, setLoginUrl] =
|
|
2809
|
-
const [emailStatus, setEmailStatus] =
|
|
2849
|
+
const [touchedName, setTouchedName] = useState9(false);
|
|
2850
|
+
const [touchedEmail, setTouchedEmail] = useState9(false);
|
|
2851
|
+
const [touchedEmailConfirm, setTouchedEmailConfirm] = useState9(false);
|
|
2852
|
+
const [touchedPhone, setTouchedPhone] = useState9(false);
|
|
2853
|
+
const [touchedCpf, setTouchedCpf] = useState9(false);
|
|
2854
|
+
const [formSubmitAttempted, setFormSubmitAttempted] = useState9(false);
|
|
2855
|
+
const [submitting, setSubmitting] = useState9(false);
|
|
2856
|
+
const [error, setError] = useState9(null);
|
|
2857
|
+
const [emailTaken, setEmailTaken] = useState9(false);
|
|
2858
|
+
const [loginUrl, setLoginUrl] = useState9(null);
|
|
2859
|
+
const [emailStatus, setEmailStatus] = useState9("idle");
|
|
2810
2860
|
const lastCheckedEmail = useRef6("");
|
|
2811
2861
|
useEffect10(() => {
|
|
2812
2862
|
if (!email || !EMAIL_RE.test(email)) {
|
|
@@ -2890,10 +2940,16 @@ function useCheckoutForm(args) {
|
|
|
2890
2940
|
name: card.holderName || name.trim(),
|
|
2891
2941
|
email,
|
|
2892
2942
|
cpfCnpj: cpf.replace(/\D/g, ""),
|
|
2893
|
-
//
|
|
2894
|
-
//
|
|
2895
|
-
|
|
2896
|
-
|
|
2943
|
+
// Plan-V 0.28.4 — Asaas's `creditCardHolderInfo.postalCode`
|
|
2944
|
+
// rejects all-zeros with `tokenize_failed:invalid_holderInfo`
|
|
2945
|
+
// ("O CEP informado é inválido."). The default CheckoutPage
|
|
2946
|
+
// doesn't collect CEP from the user (reference design skipped
|
|
2947
|
+
// it), so ship a known-valid placeholder. Apps that need real
|
|
2948
|
+
// customer addresses must override CheckoutPageDefault and
|
|
2949
|
+
// collect CEP — see personalburn's PaywallStepPagamento for
|
|
2950
|
+
// the pattern.
|
|
2951
|
+
postalCode: "01001000",
|
|
2952
|
+
addressNumber: "100",
|
|
2897
2953
|
phone
|
|
2898
2954
|
}
|
|
2899
2955
|
};
|
|
@@ -2968,14 +3024,14 @@ function mod11(digits, len) {
|
|
|
2968
3024
|
}
|
|
2969
3025
|
|
|
2970
3026
|
// src/hooks/usePlan.ts
|
|
2971
|
-
import { useHook as
|
|
3027
|
+
import { useHook as useHook11 } from "@hook-sdk/sdk";
|
|
2972
3028
|
function usePlan() {
|
|
2973
|
-
const { plan } =
|
|
3029
|
+
const { plan } = useHook11();
|
|
2974
3030
|
return plan;
|
|
2975
3031
|
}
|
|
2976
3032
|
|
|
2977
3033
|
// src/defaults/CheckoutPageDefault.tsx
|
|
2978
|
-
import { Fragment as Fragment7, jsx as
|
|
3034
|
+
import { Fragment as Fragment7, jsx as jsx28, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2979
3035
|
var INTENT_KEY = "hook:paywall:intent";
|
|
2980
3036
|
var PIX_PAYLOAD_KEY = "hook:paywall:pix-pending";
|
|
2981
3037
|
function readIntent() {
|
|
@@ -3027,7 +3083,7 @@ function CheckoutPageDefault() {
|
|
|
3027
3083
|
const defaultMethod = intent.method === "pix-auto" ? "pix-auto" : "card";
|
|
3028
3084
|
const defaultCycle = intent.cycle === "MONTHLY" ? "MONTHLY" : "YEARLY";
|
|
3029
3085
|
const form = useCheckoutForm({ defaultMethod, defaultCycle });
|
|
3030
|
-
const [expiryMmAa, setExpiryMmAa] =
|
|
3086
|
+
const [expiryMmAa, setExpiryMmAa] = useState10("");
|
|
3031
3087
|
useEffect11(() => {
|
|
3032
3088
|
const { month, year } = parseExpiryMmAa(expiryMmAa);
|
|
3033
3089
|
if (month !== form.card.expiryMonth || year !== form.card.expiryYear) {
|
|
@@ -3091,57 +3147,57 @@ function CheckoutPageDefault() {
|
|
|
3091
3147
|
}
|
|
3092
3148
|
navigate(result.redirect.replace(/^.*\/app\/[^/]+/, "") || "/");
|
|
3093
3149
|
}
|
|
3094
|
-
return /* @__PURE__ */
|
|
3095
|
-
form.emailTaken ? /* @__PURE__ */
|
|
3150
|
+
return /* @__PURE__ */ jsx28("div", { className: "flex-1 flex flex-col bg-background min-h-0", children: /* @__PURE__ */ jsxs19("form", { onSubmit, className: "flex-1 overflow-y-auto", children: [
|
|
3151
|
+
form.emailTaken ? /* @__PURE__ */ jsx28("div", { className: "px-5 pt-4", children: /* @__PURE__ */ jsxs19("div", { role: "alert", className: "rounded-2xl bg-destructive/10 p-4 text-sm text-destructive border border-destructive/20", children: [
|
|
3096
3152
|
"Esse e-mail j\xE1 tem conta nesse app.",
|
|
3097
3153
|
" ",
|
|
3098
|
-
/* @__PURE__ */
|
|
3154
|
+
/* @__PURE__ */ jsx28("a", { href: form.loginUrl ?? "/signin", className: "underline font-semibold", children: "Entrar agora" })
|
|
3099
3155
|
] }) }) : null,
|
|
3100
|
-
form.error ? /* @__PURE__ */
|
|
3101
|
-
/* @__PURE__ */
|
|
3102
|
-
/* @__PURE__ */
|
|
3103
|
-
/* @__PURE__ */
|
|
3104
|
-
/* @__PURE__ */
|
|
3156
|
+
form.error ? /* @__PURE__ */ jsx28("div", { className: "px-5 pt-4", children: /* @__PURE__ */ jsx28("div", { role: "alert", className: "rounded-2xl bg-destructive/10 p-4 text-sm text-destructive border border-destructive/20", children: form.error.message || "N\xE3o foi poss\xEDvel concluir o pagamento. Tente novamente." }) }) : null,
|
|
3157
|
+
/* @__PURE__ */ jsx28("div", { className: "px-5 pt-4", children: form.method === "card" ? /* @__PURE__ */ jsxs19("div", { className: "rounded-2xl bg-card border-[1.5px] border-foreground p-3.5", children: [
|
|
3158
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex items-center gap-2 mb-2", children: [
|
|
3159
|
+
/* @__PURE__ */ jsx28(ShieldIcon, { className: "w-4 h-4" }),
|
|
3160
|
+
/* @__PURE__ */ jsx28("div", { className: "text-sm font-bold", children: "Voc\xEA N\xC3O ser\xE1 cobrada hoje" })
|
|
3105
3161
|
] }),
|
|
3106
|
-
/* @__PURE__ */
|
|
3107
|
-
/* @__PURE__ */
|
|
3108
|
-
/* @__PURE__ */
|
|
3109
|
-
/* @__PURE__ */
|
|
3162
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex justify-between items-baseline text-sm text-muted-foreground", children: [
|
|
3163
|
+
/* @__PURE__ */ jsx28("span", { children: "R$ 0,00 agora" }),
|
|
3164
|
+
/* @__PURE__ */ jsx28("span", { className: "opacity-50", children: "\xB7" }),
|
|
3165
|
+
/* @__PURE__ */ jsxs19("span", { children: [
|
|
3110
3166
|
monthlyText,
|
|
3111
3167
|
"/m\xEAs ap\xF3s ",
|
|
3112
3168
|
trialDays,
|
|
3113
3169
|
" dias"
|
|
3114
3170
|
] })
|
|
3115
3171
|
] }),
|
|
3116
|
-
/* @__PURE__ */
|
|
3117
|
-
/* @__PURE__ */
|
|
3172
|
+
/* @__PURE__ */ jsxs19("div", { className: "mt-2.5 text-[11px] text-muted-foreground flex items-center gap-1.5", children: [
|
|
3173
|
+
/* @__PURE__ */ jsx28(BellIcon, { className: "w-2.5 h-2.5" }),
|
|
3118
3174
|
"Avisamos por email 2 dias antes da primeira cobran\xE7a"
|
|
3119
3175
|
] })
|
|
3120
|
-
] }) : /* @__PURE__ */
|
|
3121
|
-
/* @__PURE__ */
|
|
3122
|
-
/* @__PURE__ */
|
|
3123
|
-
/* @__PURE__ */
|
|
3176
|
+
] }) : /* @__PURE__ */ jsxs19("div", { className: "rounded-2xl p-3.5 bg-emerald-50 border-[1.5px] border-emerald-600/60", children: [
|
|
3177
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex items-center gap-2 mb-2 text-emerald-900", children: [
|
|
3178
|
+
/* @__PURE__ */ jsx28(ShieldIcon, { className: "w-4 h-4" }),
|
|
3179
|
+
/* @__PURE__ */ jsxs19("div", { className: "text-sm font-bold", children: [
|
|
3124
3180
|
"Garantia incondicional de ",
|
|
3125
3181
|
trialDays,
|
|
3126
3182
|
" dias"
|
|
3127
3183
|
] })
|
|
3128
3184
|
] }),
|
|
3129
|
-
/* @__PURE__ */
|
|
3185
|
+
/* @__PURE__ */ jsxs19("div", { className: "text-sm text-emerald-900 leading-snug", children: [
|
|
3130
3186
|
"Voc\xEA paga ",
|
|
3131
|
-
/* @__PURE__ */
|
|
3187
|
+
/* @__PURE__ */ jsx28("b", { children: todayAmount }),
|
|
3132
3188
|
" agora via Pix.",
|
|
3133
|
-
/* @__PURE__ */
|
|
3189
|
+
/* @__PURE__ */ jsx28("br", {}),
|
|
3134
3190
|
"N\xE3o gostou em ",
|
|
3135
3191
|
trialDays,
|
|
3136
3192
|
" dias? Devolvemos ",
|
|
3137
|
-
/* @__PURE__ */
|
|
3193
|
+
/* @__PURE__ */ jsx28("b", { children: "100%" }),
|
|
3138
3194
|
" sem perguntas \u2014 direto pelo app."
|
|
3139
3195
|
] })
|
|
3140
3196
|
] }) }),
|
|
3141
|
-
/* @__PURE__ */
|
|
3142
|
-
/* @__PURE__ */
|
|
3143
|
-
/* @__PURE__ */
|
|
3144
|
-
/* @__PURE__ */
|
|
3197
|
+
/* @__PURE__ */ jsxs19("section", { className: "px-5 pt-5", children: [
|
|
3198
|
+
/* @__PURE__ */ jsx28("h2", { className: "font-display text-2xl mb-3.5 leading-tight text-foreground", children: "Quase l\xE1." }),
|
|
3199
|
+
/* @__PURE__ */ jsx28(FieldLabel, { children: "Email" }),
|
|
3200
|
+
/* @__PURE__ */ jsx28(
|
|
3145
3201
|
FieldInput,
|
|
3146
3202
|
{
|
|
3147
3203
|
type: "email",
|
|
@@ -3158,10 +3214,10 @@ function CheckoutPageDefault() {
|
|
|
3158
3214
|
valid: form.emailStatus === "available"
|
|
3159
3215
|
}
|
|
3160
3216
|
),
|
|
3161
|
-
!form.emailError && /* @__PURE__ */
|
|
3162
|
-
/* @__PURE__ */
|
|
3163
|
-
/* @__PURE__ */
|
|
3164
|
-
/* @__PURE__ */
|
|
3217
|
+
!form.emailError && /* @__PURE__ */ jsx28(FieldHint, { children: form.emailStatus === "checking" ? "Verificando\u2026" : form.emailStatus === "available" ? "\u2713 Dispon\xEDvel" : "Voc\xEA vai usar este email para entrar no app" }),
|
|
3218
|
+
/* @__PURE__ */ jsx28("div", { className: "h-3" }),
|
|
3219
|
+
/* @__PURE__ */ jsx28(FieldLabel, { children: "Nome completo" }),
|
|
3220
|
+
/* @__PURE__ */ jsx28(
|
|
3165
3221
|
FieldInput,
|
|
3166
3222
|
{
|
|
3167
3223
|
type: "text",
|
|
@@ -3174,9 +3230,9 @@ function CheckoutPageDefault() {
|
|
|
3174
3230
|
valid: !!form.name && !form.nameError
|
|
3175
3231
|
}
|
|
3176
3232
|
),
|
|
3177
|
-
/* @__PURE__ */
|
|
3178
|
-
/* @__PURE__ */
|
|
3179
|
-
/* @__PURE__ */
|
|
3233
|
+
/* @__PURE__ */ jsx28("div", { className: "h-3" }),
|
|
3234
|
+
/* @__PURE__ */ jsx28(FieldLabel, { children: "CPF" }),
|
|
3235
|
+
/* @__PURE__ */ jsx28(
|
|
3180
3236
|
FieldInput,
|
|
3181
3237
|
{
|
|
3182
3238
|
type: "text",
|
|
@@ -3189,10 +3245,10 @@ function CheckoutPageDefault() {
|
|
|
3189
3245
|
valid: !!form.cpf && !form.cpfError
|
|
3190
3246
|
}
|
|
3191
3247
|
),
|
|
3192
|
-
form.method === "card" ? /* @__PURE__ */
|
|
3193
|
-
/* @__PURE__ */
|
|
3194
|
-
/* @__PURE__ */
|
|
3195
|
-
/* @__PURE__ */
|
|
3248
|
+
form.method === "card" ? /* @__PURE__ */ jsxs19(Fragment7, { children: [
|
|
3249
|
+
/* @__PURE__ */ jsx28("div", { className: "h-3" }),
|
|
3250
|
+
/* @__PURE__ */ jsx28(FieldLabel, { children: "Telefone" }),
|
|
3251
|
+
/* @__PURE__ */ jsx28(
|
|
3196
3252
|
FieldInput,
|
|
3197
3253
|
{
|
|
3198
3254
|
type: "tel",
|
|
@@ -3206,29 +3262,29 @@ function CheckoutPageDefault() {
|
|
|
3206
3262
|
valid: !!form.phone && !form.phoneError
|
|
3207
3263
|
}
|
|
3208
3264
|
),
|
|
3209
|
-
!form.phoneError && /* @__PURE__ */
|
|
3265
|
+
!form.phoneError && /* @__PURE__ */ jsx28(FieldHint, { children: "Usado pra confirmar pagamento e tratar disputas." })
|
|
3210
3266
|
] }) : null
|
|
3211
3267
|
] }),
|
|
3212
|
-
/* @__PURE__ */
|
|
3213
|
-
/* @__PURE__ */
|
|
3214
|
-
/* @__PURE__ */
|
|
3215
|
-
/* @__PURE__ */
|
|
3268
|
+
/* @__PURE__ */ jsxs19("section", { className: "px-5 pt-5", children: [
|
|
3269
|
+
/* @__PURE__ */ jsx28(FieldLabel, { children: "Forma de pagamento" }),
|
|
3270
|
+
/* @__PURE__ */ jsxs19("div", { role: "tablist", className: "flex gap-1.5 bg-muted p-1 rounded-xl", children: [
|
|
3271
|
+
/* @__PURE__ */ jsx28(
|
|
3216
3272
|
TabButton,
|
|
3217
3273
|
{
|
|
3218
3274
|
active: form.method === "card",
|
|
3219
3275
|
onClick: () => form.setMethod("card"),
|
|
3220
|
-
icon: /* @__PURE__ */
|
|
3276
|
+
icon: /* @__PURE__ */ jsx28(CardIcon, { className: "w-3.5 h-3.5" }),
|
|
3221
3277
|
label: "Cart\xE3o",
|
|
3222
3278
|
subtitle: trialDays > 0 ? `${trialDays} dias gr\xE1tis` : "pague hoje",
|
|
3223
3279
|
subtitleActiveClass: "text-emerald-700"
|
|
3224
3280
|
}
|
|
3225
3281
|
),
|
|
3226
|
-
/* @__PURE__ */
|
|
3282
|
+
/* @__PURE__ */ jsx28(
|
|
3227
3283
|
TabButton,
|
|
3228
3284
|
{
|
|
3229
3285
|
active: form.method === "pix-auto",
|
|
3230
3286
|
onClick: () => form.setMethod("pix-auto"),
|
|
3231
|
-
icon: /* @__PURE__ */
|
|
3287
|
+
icon: /* @__PURE__ */ jsx28(PixIcon, { className: "w-3.5 h-3.5" }),
|
|
3232
3288
|
label: "Pix",
|
|
3233
3289
|
subtitle: `pague hoje \xB7 garantia ${trialDays}d`,
|
|
3234
3290
|
subtitleActiveClass: "text-foreground/70"
|
|
@@ -3236,10 +3292,10 @@ function CheckoutPageDefault() {
|
|
|
3236
3292
|
)
|
|
3237
3293
|
] })
|
|
3238
3294
|
] }),
|
|
3239
|
-
form.method === "card" ? /* @__PURE__ */
|
|
3240
|
-
/* @__PURE__ */
|
|
3241
|
-
/* @__PURE__ */
|
|
3242
|
-
/* @__PURE__ */
|
|
3295
|
+
form.method === "card" ? /* @__PURE__ */ jsxs19("section", { className: "px-5 pt-3.5", children: [
|
|
3296
|
+
/* @__PURE__ */ jsx28(FieldLabel, { children: "N\xFAmero do cart\xE3o" }),
|
|
3297
|
+
/* @__PURE__ */ jsxs19("div", { className: "relative", children: [
|
|
3298
|
+
/* @__PURE__ */ jsx28(
|
|
3243
3299
|
FieldInput,
|
|
3244
3300
|
{
|
|
3245
3301
|
type: "text",
|
|
@@ -3251,13 +3307,13 @@ function CheckoutPageDefault() {
|
|
|
3251
3307
|
style: cardBrand ? { paddingRight: "4.5rem" } : void 0
|
|
3252
3308
|
}
|
|
3253
3309
|
),
|
|
3254
|
-
cardBrand && /* @__PURE__ */
|
|
3310
|
+
cardBrand && /* @__PURE__ */ jsx28("span", { className: "absolute right-3 top-1/2 -translate-y-1/2 text-[10px] font-bold tracking-wide px-1.5 py-0.5 rounded bg-muted text-muted-foreground", children: cardBrand })
|
|
3255
3311
|
] }),
|
|
3256
|
-
/* @__PURE__ */
|
|
3257
|
-
/* @__PURE__ */
|
|
3258
|
-
/* @__PURE__ */
|
|
3259
|
-
/* @__PURE__ */
|
|
3260
|
-
/* @__PURE__ */
|
|
3312
|
+
/* @__PURE__ */ jsx28("div", { className: "h-3" }),
|
|
3313
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex gap-2.5", children: [
|
|
3314
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex-1", children: [
|
|
3315
|
+
/* @__PURE__ */ jsx28(FieldLabel, { children: "Validade" }),
|
|
3316
|
+
/* @__PURE__ */ jsx28(
|
|
3261
3317
|
FieldInput,
|
|
3262
3318
|
{
|
|
3263
3319
|
type: "text",
|
|
@@ -3269,9 +3325,9 @@ function CheckoutPageDefault() {
|
|
|
3269
3325
|
}
|
|
3270
3326
|
)
|
|
3271
3327
|
] }),
|
|
3272
|
-
/* @__PURE__ */
|
|
3273
|
-
/* @__PURE__ */
|
|
3274
|
-
/* @__PURE__ */
|
|
3328
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex-1", children: [
|
|
3329
|
+
/* @__PURE__ */ jsx28(FieldLabel, { children: "CVV" }),
|
|
3330
|
+
/* @__PURE__ */ jsx28(
|
|
3275
3331
|
FieldInput,
|
|
3276
3332
|
{
|
|
3277
3333
|
type: "text",
|
|
@@ -3284,9 +3340,9 @@ function CheckoutPageDefault() {
|
|
|
3284
3340
|
)
|
|
3285
3341
|
] })
|
|
3286
3342
|
] }),
|
|
3287
|
-
/* @__PURE__ */
|
|
3288
|
-
/* @__PURE__ */
|
|
3289
|
-
/* @__PURE__ */
|
|
3343
|
+
/* @__PURE__ */ jsx28("div", { className: "h-3" }),
|
|
3344
|
+
/* @__PURE__ */ jsx28(FieldLabel, { children: "Nome no cart\xE3o" }),
|
|
3345
|
+
/* @__PURE__ */ jsx28(
|
|
3290
3346
|
FieldInput,
|
|
3291
3347
|
{
|
|
3292
3348
|
type: "text",
|
|
@@ -3296,89 +3352,89 @@ function CheckoutPageDefault() {
|
|
|
3296
3352
|
onChange: (v) => form.setCard({ holderName: v })
|
|
3297
3353
|
}
|
|
3298
3354
|
)
|
|
3299
|
-
] }) : /* @__PURE__ */
|
|
3300
|
-
/* @__PURE__ */
|
|
3301
|
-
/* @__PURE__ */
|
|
3302
|
-
/* @__PURE__ */
|
|
3303
|
-
/* @__PURE__ */
|
|
3355
|
+
] }) : /* @__PURE__ */ jsx28("section", { className: "px-5 pt-3.5", children: /* @__PURE__ */ jsxs19("div", { className: "rounded-2xl bg-card border border-border p-3.5 flex gap-3.5 items-center", children: [
|
|
3356
|
+
/* @__PURE__ */ jsx28("div", { className: "w-[72px] h-[72px] rounded-xl shrink-0 border-2 border-foreground relative overflow-hidden bg-muted", children: /* @__PURE__ */ jsx28("div", { className: "absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 w-[22px] h-[22px] bg-background flex items-center justify-center", children: /* @__PURE__ */ jsx28(PixIcon, { className: "w-3.5 h-3.5 text-foreground" }) }) }),
|
|
3357
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex-1", children: [
|
|
3358
|
+
/* @__PURE__ */ jsx28("div", { className: "text-xs font-bold uppercase tracking-wider text-muted-foreground", children: "pagamento em segundos" }),
|
|
3359
|
+
/* @__PURE__ */ jsxs19("div", { className: "text-sm text-foreground mt-1 leading-snug", children: [
|
|
3304
3360
|
"Geramos seu ",
|
|
3305
|
-
/* @__PURE__ */
|
|
3361
|
+
/* @__PURE__ */ jsx28("b", { children: "QR Pix" }),
|
|
3306
3362
|
" no pr\xF3ximo passo. Pague pelo app do banco e seu acesso libera ",
|
|
3307
|
-
/* @__PURE__ */
|
|
3363
|
+
/* @__PURE__ */ jsx28("b", { children: "imediatamente" }),
|
|
3308
3364
|
"."
|
|
3309
3365
|
] })
|
|
3310
3366
|
] })
|
|
3311
3367
|
] }) }),
|
|
3312
|
-
/* @__PURE__ */
|
|
3313
|
-
/* @__PURE__ */
|
|
3314
|
-
/* @__PURE__ */
|
|
3315
|
-
/* @__PURE__ */
|
|
3316
|
-
/* @__PURE__ */
|
|
3368
|
+
/* @__PURE__ */ jsx28("section", { className: "px-5 pt-5", children: /* @__PURE__ */ jsxs19("div", { className: "bg-muted rounded-2xl p-4", children: [
|
|
3369
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex justify-between mb-2.5", children: [
|
|
3370
|
+
/* @__PURE__ */ jsxs19("div", { children: [
|
|
3371
|
+
/* @__PURE__ */ jsx28("div", { className: "text-sm font-semibold text-foreground", children: annual ? "Plano Anual" : "Plano Mensal" }),
|
|
3372
|
+
/* @__PURE__ */ jsx28("div", { className: "text-[11px] text-muted-foreground", children: "Coach" })
|
|
3317
3373
|
] }),
|
|
3318
|
-
/* @__PURE__ */
|
|
3319
|
-
/* @__PURE__ */
|
|
3374
|
+
/* @__PURE__ */ jsxs19("div", { className: "text-right", children: [
|
|
3375
|
+
/* @__PURE__ */ jsxs19("div", { className: "text-sm font-bold text-foreground", children: [
|
|
3320
3376
|
cyclePriceText,
|
|
3321
3377
|
"/",
|
|
3322
3378
|
annual ? "ano" : "m\xEAs"
|
|
3323
3379
|
] }),
|
|
3324
|
-
annual && annualSavingsCents > 0 && /* @__PURE__ */
|
|
3380
|
+
annual && annualSavingsCents > 0 && /* @__PURE__ */ jsxs19("div", { className: "text-[11px] text-emerald-700 font-semibold", children: [
|
|
3325
3381
|
"economia ",
|
|
3326
3382
|
formatBrl(annualSavingsCents)
|
|
3327
3383
|
] })
|
|
3328
3384
|
] })
|
|
3329
3385
|
] }),
|
|
3330
|
-
/* @__PURE__ */
|
|
3331
|
-
/* @__PURE__ */
|
|
3332
|
-
/* @__PURE__ */
|
|
3333
|
-
/* @__PURE__ */
|
|
3334
|
-
form.method === "card" && trialDays > 0 && /* @__PURE__ */
|
|
3386
|
+
/* @__PURE__ */ jsx28("div", { className: "h-px bg-border my-3" }),
|
|
3387
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex justify-between items-baseline", children: [
|
|
3388
|
+
/* @__PURE__ */ jsxs19("div", { children: [
|
|
3389
|
+
/* @__PURE__ */ jsx28("div", { className: "text-sm font-bold text-foreground", children: "Voc\xEA paga hoje" }),
|
|
3390
|
+
form.method === "card" && trialDays > 0 && /* @__PURE__ */ jsxs19("div", { className: "text-[11px] text-muted-foreground mt-0.5", children: [
|
|
3335
3391
|
"cobran\xE7a inicia no dia ",
|
|
3336
3392
|
trialDays
|
|
3337
3393
|
] }),
|
|
3338
|
-
form.method === "pix-auto" && /* @__PURE__ */
|
|
3394
|
+
form.method === "pix-auto" && /* @__PURE__ */ jsxs19("div", { className: "text-[11px] text-emerald-700 mt-0.5 font-semibold", children: [
|
|
3339
3395
|
"reembolso garantido at\xE9 o dia ",
|
|
3340
3396
|
trialDays
|
|
3341
3397
|
] })
|
|
3342
3398
|
] }),
|
|
3343
|
-
/* @__PURE__ */
|
|
3399
|
+
/* @__PURE__ */ jsx28("div", { className: "text-2xl font-bold font-display tracking-tight text-foreground", children: todayAmount })
|
|
3344
3400
|
] })
|
|
3345
3401
|
] }) }),
|
|
3346
|
-
/* @__PURE__ */
|
|
3347
|
-
/* @__PURE__ */
|
|
3348
|
-
/* @__PURE__ */
|
|
3402
|
+
/* @__PURE__ */ jsx28("div", { className: "h-4" }),
|
|
3403
|
+
/* @__PURE__ */ jsxs19("div", { className: "sticky bottom-0 px-5 pt-3.5 pb-6 bg-gradient-to-b from-transparent to-background", children: [
|
|
3404
|
+
/* @__PURE__ */ jsx28(
|
|
3349
3405
|
"button",
|
|
3350
3406
|
{
|
|
3351
3407
|
type: "submit",
|
|
3352
3408
|
disabled: !form.canSubmit,
|
|
3353
3409
|
className: "w-full rounded-full bg-primary text-primary-foreground min-h-14 px-5 text-base font-bold inline-flex items-center justify-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed shadow-lg",
|
|
3354
|
-
children: form.submitting ? /* @__PURE__ */
|
|
3355
|
-
/* @__PURE__ */
|
|
3410
|
+
children: form.submitting ? /* @__PURE__ */ jsxs19(Fragment7, { children: [
|
|
3411
|
+
/* @__PURE__ */ jsx28(Spinner2, {}),
|
|
3356
3412
|
" ",
|
|
3357
3413
|
form.method === "pix-auto" ? "Gerando QR\u2026" : "Confirmando\u2026"
|
|
3358
|
-
] }) : form.method === "card" ? /* @__PURE__ */
|
|
3359
|
-
/* @__PURE__ */
|
|
3414
|
+
] }) : form.method === "card" ? /* @__PURE__ */ jsxs19(Fragment7, { children: [
|
|
3415
|
+
/* @__PURE__ */ jsx28(LockIcon, { className: "w-3.5 h-3.5" }),
|
|
3360
3416
|
" Confirmar e come\xE7ar gr\xE1tis"
|
|
3361
|
-
] }) : /* @__PURE__ */
|
|
3362
|
-
/* @__PURE__ */
|
|
3417
|
+
] }) : /* @__PURE__ */ jsxs19(Fragment7, { children: [
|
|
3418
|
+
/* @__PURE__ */ jsx28(PixIcon, { className: "w-3.5 h-3.5" }),
|
|
3363
3419
|
" Gerar QR \xB7 pagar ",
|
|
3364
3420
|
todayAmount
|
|
3365
3421
|
] })
|
|
3366
3422
|
}
|
|
3367
3423
|
),
|
|
3368
|
-
/* @__PURE__ */
|
|
3424
|
+
/* @__PURE__ */ jsxs19("div", { className: "text-center mt-2.5 text-xs text-muted-foreground", children: [
|
|
3369
3425
|
"Ao continuar, voc\xEA concorda com nossos ",
|
|
3370
|
-
/* @__PURE__ */
|
|
3426
|
+
/* @__PURE__ */ jsx28("u", { children: "Termos" }),
|
|
3371
3427
|
". Pagamento seguro Asaas."
|
|
3372
3428
|
] }),
|
|
3373
|
-
/* @__PURE__ */
|
|
3374
|
-
/* @__PURE__ */
|
|
3375
|
-
/* @__PURE__ */
|
|
3429
|
+
/* @__PURE__ */ jsxs19("div", { className: "mt-3 flex items-center justify-center gap-3.5 text-[11px] text-muted-foreground", children: [
|
|
3430
|
+
/* @__PURE__ */ jsxs19("span", { className: "inline-flex items-center gap-1", children: [
|
|
3431
|
+
/* @__PURE__ */ jsx28(LockIcon, { className: "w-2.5 h-2.5 opacity-60" }),
|
|
3376
3432
|
" SSL 256-bit"
|
|
3377
3433
|
] }),
|
|
3378
|
-
/* @__PURE__ */
|
|
3379
|
-
/* @__PURE__ */
|
|
3380
|
-
/* @__PURE__ */
|
|
3381
|
-
/* @__PURE__ */
|
|
3434
|
+
/* @__PURE__ */ jsx28("span", { className: "w-px h-2.5 bg-border" }),
|
|
3435
|
+
/* @__PURE__ */ jsx28("span", { children: "Pagamento via Asaas" }),
|
|
3436
|
+
/* @__PURE__ */ jsx28("span", { className: "w-px h-2.5 bg-border" }),
|
|
3437
|
+
/* @__PURE__ */ jsxs19("span", { children: [
|
|
3382
3438
|
"Garantia ",
|
|
3383
3439
|
trialDays,
|
|
3384
3440
|
" dias"
|
|
@@ -3388,13 +3444,13 @@ function CheckoutPageDefault() {
|
|
|
3388
3444
|
] }) });
|
|
3389
3445
|
}
|
|
3390
3446
|
function FieldLabel({ children }) {
|
|
3391
|
-
return /* @__PURE__ */
|
|
3447
|
+
return /* @__PURE__ */ jsx28("div", { className: "text-xs font-semibold uppercase tracking-wide text-muted-foreground mb-1.5", children });
|
|
3392
3448
|
}
|
|
3393
3449
|
function FieldInput(props) {
|
|
3394
3450
|
const baseClass = "w-full px-4 rounded-xl bg-card text-base text-foreground outline-none border-[1.5px] transition-colors";
|
|
3395
3451
|
const stateClass = props.error ? "border-destructive focus:border-destructive" : props.valid ? "border-emerald-600 focus:border-emerald-700" : "border-border focus:border-foreground";
|
|
3396
|
-
return /* @__PURE__ */
|
|
3397
|
-
/* @__PURE__ */
|
|
3452
|
+
return /* @__PURE__ */ jsxs19(Fragment7, { children: [
|
|
3453
|
+
/* @__PURE__ */ jsx28(
|
|
3398
3454
|
"input",
|
|
3399
3455
|
{
|
|
3400
3456
|
type: props.type ?? "text",
|
|
@@ -3411,14 +3467,14 @@ function FieldInput(props) {
|
|
|
3411
3467
|
className: `${baseClass} ${stateClass}`
|
|
3412
3468
|
}
|
|
3413
3469
|
),
|
|
3414
|
-
props.error ? /* @__PURE__ */
|
|
3470
|
+
props.error ? /* @__PURE__ */ jsx28("div", { className: "mt-1.5 text-xs text-destructive font-medium", children: props.error }) : null
|
|
3415
3471
|
] });
|
|
3416
3472
|
}
|
|
3417
3473
|
function FieldHint({ children }) {
|
|
3418
|
-
return /* @__PURE__ */
|
|
3474
|
+
return /* @__PURE__ */ jsx28("div", { className: "mt-1.5 text-xs text-muted-foreground", children });
|
|
3419
3475
|
}
|
|
3420
3476
|
function TabButton({ active, onClick, icon, label, subtitle, subtitleActiveClass }) {
|
|
3421
|
-
return /* @__PURE__ */
|
|
3477
|
+
return /* @__PURE__ */ jsxs19(
|
|
3422
3478
|
"button",
|
|
3423
3479
|
{
|
|
3424
3480
|
type: "button",
|
|
@@ -3428,45 +3484,45 @@ function TabButton({ active, onClick, icon, label, subtitle, subtitleActiveClass
|
|
|
3428
3484
|
className: `flex-1 flex flex-col items-center justify-center gap-0.5 py-2.5 px-1.5 rounded-lg text-sm font-semibold transition-colors ${active ? "bg-card text-foreground shadow-sm" : "bg-transparent text-muted-foreground"}`,
|
|
3429
3485
|
style: { minHeight: 56 },
|
|
3430
3486
|
children: [
|
|
3431
|
-
/* @__PURE__ */
|
|
3487
|
+
/* @__PURE__ */ jsxs19("span", { className: "inline-flex items-center gap-1.5", children: [
|
|
3432
3488
|
icon,
|
|
3433
3489
|
" ",
|
|
3434
3490
|
label
|
|
3435
3491
|
] }),
|
|
3436
|
-
/* @__PURE__ */
|
|
3492
|
+
/* @__PURE__ */ jsx28("span", { className: `text-[10px] font-medium ${active ? subtitleActiveClass : "text-muted-foreground/70"}`, children: subtitle })
|
|
3437
3493
|
]
|
|
3438
3494
|
}
|
|
3439
3495
|
);
|
|
3440
3496
|
}
|
|
3441
3497
|
function CardIcon({ className }) {
|
|
3442
|
-
return /* @__PURE__ */
|
|
3443
|
-
/* @__PURE__ */
|
|
3444
|
-
/* @__PURE__ */
|
|
3498
|
+
return /* @__PURE__ */ jsxs19("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinejoin: "round", "aria-hidden": "true", children: [
|
|
3499
|
+
/* @__PURE__ */ jsx28("rect", { x: "2.5", y: "5.5", width: "19", height: "13", rx: "2.5" }),
|
|
3500
|
+
/* @__PURE__ */ jsx28("path", { d: "M2.5 10h19" })
|
|
3445
3501
|
] });
|
|
3446
3502
|
}
|
|
3447
3503
|
function PixIcon({ className }) {
|
|
3448
|
-
return /* @__PURE__ */
|
|
3504
|
+
return /* @__PURE__ */ jsx28("svg", { className, viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ jsx28("path", { d: "M12 2L2 12l10 10 10-10L12 2zm0 4.83L17.17 12 12 17.17 6.83 12 12 6.83z" }) });
|
|
3449
3505
|
}
|
|
3450
3506
|
function LockIcon({ className }) {
|
|
3451
|
-
return /* @__PURE__ */
|
|
3452
|
-
/* @__PURE__ */
|
|
3453
|
-
/* @__PURE__ */
|
|
3507
|
+
return /* @__PURE__ */ jsxs19("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
|
|
3508
|
+
/* @__PURE__ */ jsx28("rect", { x: "4", y: "10", width: "16", height: "11", rx: "2.5" }),
|
|
3509
|
+
/* @__PURE__ */ jsx28("path", { d: "M7.5 10V7a4.5 4.5 0 119 0v3" })
|
|
3454
3510
|
] });
|
|
3455
3511
|
}
|
|
3456
3512
|
function ShieldIcon({ className }) {
|
|
3457
|
-
return /* @__PURE__ */
|
|
3458
|
-
/* @__PURE__ */
|
|
3459
|
-
/* @__PURE__ */
|
|
3513
|
+
return /* @__PURE__ */ jsxs19("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
|
|
3514
|
+
/* @__PURE__ */ jsx28("path", { d: "M12 2.5l8 3v6c0 5-3.5 8.5-8 10-4.5-1.5-8-5-8-10v-6l8-3z" }),
|
|
3515
|
+
/* @__PURE__ */ jsx28("path", { d: "M9 12l2 2 4-4" })
|
|
3460
3516
|
] });
|
|
3461
3517
|
}
|
|
3462
3518
|
function BellIcon({ className }) {
|
|
3463
|
-
return /* @__PURE__ */
|
|
3464
|
-
/* @__PURE__ */
|
|
3465
|
-
/* @__PURE__ */
|
|
3519
|
+
return /* @__PURE__ */ jsxs19("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
|
|
3520
|
+
/* @__PURE__ */ jsx28("path", { d: "M6 17V11a6 6 0 1112 0v6l1.5 2H4.5L6 17z" }),
|
|
3521
|
+
/* @__PURE__ */ jsx28("path", { d: "M10 21a2 2 0 004 0" })
|
|
3466
3522
|
] });
|
|
3467
3523
|
}
|
|
3468
3524
|
function Spinner2() {
|
|
3469
|
-
return /* @__PURE__ */
|
|
3525
|
+
return /* @__PURE__ */ jsx28(
|
|
3470
3526
|
"span",
|
|
3471
3527
|
{
|
|
3472
3528
|
className: "w-4 h-4 rounded-full border-2 border-white/40 border-t-white",
|
|
@@ -3476,10 +3532,10 @@ function Spinner2() {
|
|
|
3476
3532
|
}
|
|
3477
3533
|
|
|
3478
3534
|
// src/defaults/PixWaitingPageDefault.tsx
|
|
3479
|
-
import { useEffect as useEffect12, useMemo as useMemo6, useState as
|
|
3535
|
+
import { useEffect as useEffect12, useMemo as useMemo6, useState as useState11 } from "react";
|
|
3480
3536
|
import { useNavigate as useNavigate3 } from "react-router-dom";
|
|
3481
|
-
import { useHook as
|
|
3482
|
-
import { jsx as
|
|
3537
|
+
import { useHook as useHook12 } from "@hook-sdk/sdk";
|
|
3538
|
+
import { jsx as jsx29, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
3483
3539
|
var PIX_PAYLOAD_KEY2 = "hook:paywall:pix-pending";
|
|
3484
3540
|
var TIMEOUT_MS = 30 * 60 * 1e3;
|
|
3485
3541
|
function readPixPayload() {
|
|
@@ -3501,10 +3557,10 @@ function clearPixPayload() {
|
|
|
3501
3557
|
}
|
|
3502
3558
|
function PixWaitingPageDefault() {
|
|
3503
3559
|
const navigate = useNavigate3();
|
|
3504
|
-
const { subscription } =
|
|
3560
|
+
const { subscription } = useHook12();
|
|
3505
3561
|
const payload = useMemo6(readPixPayload, []);
|
|
3506
|
-
const [copied, setCopied] =
|
|
3507
|
-
const [timedOut, setTimedOut] =
|
|
3562
|
+
const [copied, setCopied] = useState11(false);
|
|
3563
|
+
const [timedOut, setTimedOut] = useState11(false);
|
|
3508
3564
|
useEffect12(() => {
|
|
3509
3565
|
if (!payload) navigate("/paywall/checkout", { replace: true });
|
|
3510
3566
|
}, [payload, navigate]);
|
|
@@ -3530,10 +3586,10 @@ function PixWaitingPageDefault() {
|
|
|
3530
3586
|
}
|
|
3531
3587
|
if (!payload) return null;
|
|
3532
3588
|
if (timedOut) {
|
|
3533
|
-
return /* @__PURE__ */
|
|
3534
|
-
/* @__PURE__ */
|
|
3535
|
-
/* @__PURE__ */
|
|
3536
|
-
/* @__PURE__ */
|
|
3589
|
+
return /* @__PURE__ */ jsxs20("div", { className: "flex-1 flex flex-col items-center justify-center px-6 py-10 text-center bg-background space-y-4", children: [
|
|
3590
|
+
/* @__PURE__ */ jsx29("h1", { className: "font-display text-2xl text-foreground", children: "PIX expirado" }),
|
|
3591
|
+
/* @__PURE__ */ jsx29("p", { className: "text-sm text-muted-foreground", children: "O tempo pra pagar acabou. Gere um novo PIX." }),
|
|
3592
|
+
/* @__PURE__ */ jsx29(
|
|
3537
3593
|
"button",
|
|
3538
3594
|
{
|
|
3539
3595
|
onClick: () => {
|
|
@@ -3546,20 +3602,20 @@ function PixWaitingPageDefault() {
|
|
|
3546
3602
|
)
|
|
3547
3603
|
] });
|
|
3548
3604
|
}
|
|
3549
|
-
return /* @__PURE__ */
|
|
3550
|
-
/* @__PURE__ */
|
|
3551
|
-
/* @__PURE__ */
|
|
3552
|
-
/* @__PURE__ */
|
|
3605
|
+
return /* @__PURE__ */ jsxs20("div", { className: "flex-1 flex flex-col items-center px-6 py-8 bg-background space-y-6", children: [
|
|
3606
|
+
/* @__PURE__ */ jsxs20("header", { className: "text-center space-y-2", children: [
|
|
3607
|
+
/* @__PURE__ */ jsx29("h1", { className: "font-display text-2xl text-foreground", children: "Pague o PIX" }),
|
|
3608
|
+
/* @__PURE__ */ jsx29("p", { className: "text-sm text-muted-foreground", children: "Escaneie o QR Code no app do seu banco. O acesso libera assim que confirmarmos o pagamento." })
|
|
3553
3609
|
] }),
|
|
3554
|
-
payload.base64 ? /* @__PURE__ */
|
|
3610
|
+
payload.base64 ? /* @__PURE__ */ jsx29(
|
|
3555
3611
|
"img",
|
|
3556
3612
|
{
|
|
3557
3613
|
src: `data:image/png;base64,${payload.base64}`,
|
|
3558
3614
|
alt: "QR Code PIX",
|
|
3559
3615
|
className: "w-64 h-64 rounded-2xl border border-border bg-card p-2"
|
|
3560
3616
|
}
|
|
3561
|
-
) : /* @__PURE__ */
|
|
3562
|
-
payload.payload ? /* @__PURE__ */
|
|
3617
|
+
) : /* @__PURE__ */ jsx29("div", { className: "w-64 h-64 rounded-2xl border border-border bg-card flex items-center justify-center text-sm text-muted-foreground", children: "QR indispon\xEDvel" }),
|
|
3618
|
+
payload.payload ? /* @__PURE__ */ jsx29(
|
|
3563
3619
|
"button",
|
|
3564
3620
|
{
|
|
3565
3621
|
onClick: copyPayload,
|
|
@@ -3567,28 +3623,28 @@ function PixWaitingPageDefault() {
|
|
|
3567
3623
|
children: copied ? "\u2713 Copiado!" : "Copiar c\xF3digo PIX"
|
|
3568
3624
|
}
|
|
3569
3625
|
) : null,
|
|
3570
|
-
/* @__PURE__ */
|
|
3571
|
-
/* @__PURE__ */
|
|
3626
|
+
/* @__PURE__ */ jsxs20("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
|
|
3627
|
+
/* @__PURE__ */ jsx29("span", { className: "inline-block w-2 h-2 rounded-full bg-primary animate-pulse" }),
|
|
3572
3628
|
"Aguardando pagamento\u2026"
|
|
3573
3629
|
] }),
|
|
3574
|
-
/* @__PURE__ */
|
|
3630
|
+
/* @__PURE__ */ jsx29("p", { className: "text-center text-xs text-muted-foreground", children: "Pode fechar essa janela \u2014 tamb\xE9m enviamos um link de acesso pro seu e-mail." })
|
|
3575
3631
|
] });
|
|
3576
3632
|
}
|
|
3577
3633
|
|
|
3578
3634
|
// src/hooks/useLoginForm.ts
|
|
3579
|
-
import { useCallback as useCallback7, useMemo as useMemo7, useState as
|
|
3580
|
-
import { useHook as
|
|
3635
|
+
import { useCallback as useCallback7, useMemo as useMemo7, useState as useState12 } from "react";
|
|
3636
|
+
import { useHook as useHook13 } from "@hook-sdk/sdk";
|
|
3581
3637
|
var EMAIL_RE2 = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
3582
3638
|
var MIN_PASSWORD = 8;
|
|
3583
3639
|
function useLoginForm() {
|
|
3584
|
-
const { auth } =
|
|
3585
|
-
const [email, setEmail] =
|
|
3586
|
-
const [password, setPassword] =
|
|
3587
|
-
const [submitting, setSubmitting] =
|
|
3588
|
-
const [error, setError] =
|
|
3589
|
-
const [touchedEmail, setTouchedEmail] =
|
|
3590
|
-
const [touchedPassword, setTouchedPassword] =
|
|
3591
|
-
const [formSubmitAttempted, setFormSubmitAttempted] =
|
|
3640
|
+
const { auth } = useHook13();
|
|
3641
|
+
const [email, setEmail] = useState12("");
|
|
3642
|
+
const [password, setPassword] = useState12("");
|
|
3643
|
+
const [submitting, setSubmitting] = useState12(false);
|
|
3644
|
+
const [error, setError] = useState12(null);
|
|
3645
|
+
const [touchedEmail, setTouchedEmail] = useState12(false);
|
|
3646
|
+
const [touchedPassword, setTouchedPassword] = useState12(false);
|
|
3647
|
+
const [formSubmitAttempted, setFormSubmitAttempted] = useState12(false);
|
|
3592
3648
|
const validateEmail = useMemo7(() => {
|
|
3593
3649
|
if (email.length === 0) return null;
|
|
3594
3650
|
if (!EMAIL_RE2.test(email)) return "Formato de e-mail inv\xE1lido.";
|
|
@@ -3636,21 +3692,21 @@ function useLoginForm() {
|
|
|
3636
3692
|
}
|
|
3637
3693
|
|
|
3638
3694
|
// src/hooks/useSignupForm.ts
|
|
3639
|
-
import { useCallback as useCallback8, useMemo as useMemo8, useState as
|
|
3640
|
-
import { useHook as
|
|
3695
|
+
import { useCallback as useCallback8, useMemo as useMemo8, useState as useState13 } from "react";
|
|
3696
|
+
import { useHook as useHook14 } from "@hook-sdk/sdk";
|
|
3641
3697
|
var EMAIL_RE3 = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
3642
3698
|
var MIN_PASSWORD2 = 8;
|
|
3643
3699
|
function useSignupForm() {
|
|
3644
|
-
const { auth } =
|
|
3645
|
-
const [name, setName] =
|
|
3646
|
-
const [email, setEmail] =
|
|
3647
|
-
const [password, setPassword] =
|
|
3648
|
-
const [submitting, setSubmitting] =
|
|
3649
|
-
const [error, setError] =
|
|
3650
|
-
const [touchedName, setTouchedName] =
|
|
3651
|
-
const [touchedEmail, setTouchedEmail] =
|
|
3652
|
-
const [touchedPassword, setTouchedPassword] =
|
|
3653
|
-
const [formSubmitAttempted, setFormSubmitAttempted] =
|
|
3700
|
+
const { auth } = useHook14();
|
|
3701
|
+
const [name, setName] = useState13("");
|
|
3702
|
+
const [email, setEmail] = useState13("");
|
|
3703
|
+
const [password, setPassword] = useState13("");
|
|
3704
|
+
const [submitting, setSubmitting] = useState13(false);
|
|
3705
|
+
const [error, setError] = useState13(null);
|
|
3706
|
+
const [touchedName, setTouchedName] = useState13(false);
|
|
3707
|
+
const [touchedEmail, setTouchedEmail] = useState13(false);
|
|
3708
|
+
const [touchedPassword, setTouchedPassword] = useState13(false);
|
|
3709
|
+
const [formSubmitAttempted, setFormSubmitAttempted] = useState13(false);
|
|
3654
3710
|
const validateName = useMemo8(() => {
|
|
3655
3711
|
if (name.length === 0) return null;
|
|
3656
3712
|
if (name.trim().length < 2) return "Nome muito curto.";
|
|
@@ -3708,17 +3764,17 @@ function useSignupForm() {
|
|
|
3708
3764
|
}
|
|
3709
3765
|
|
|
3710
3766
|
// src/hooks/useForgotForm.ts
|
|
3711
|
-
import { useCallback as useCallback9, useMemo as useMemo9, useState as
|
|
3712
|
-
import { useHook as
|
|
3767
|
+
import { useCallback as useCallback9, useMemo as useMemo9, useState as useState14 } from "react";
|
|
3768
|
+
import { useHook as useHook15 } from "@hook-sdk/sdk";
|
|
3713
3769
|
var EMAIL_RE4 = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
3714
3770
|
function useForgotForm() {
|
|
3715
|
-
const { auth } =
|
|
3716
|
-
const [email, setEmail] =
|
|
3717
|
-
const [submitting, setSubmitting] =
|
|
3718
|
-
const [sent, setSent] =
|
|
3719
|
-
const [error, setError] =
|
|
3720
|
-
const [touchedEmail, setTouchedEmail] =
|
|
3721
|
-
const [formSubmitAttempted, setFormSubmitAttempted] =
|
|
3771
|
+
const { auth } = useHook15();
|
|
3772
|
+
const [email, setEmail] = useState14("");
|
|
3773
|
+
const [submitting, setSubmitting] = useState14(false);
|
|
3774
|
+
const [sent, setSent] = useState14(false);
|
|
3775
|
+
const [error, setError] = useState14(null);
|
|
3776
|
+
const [touchedEmail, setTouchedEmail] = useState14(false);
|
|
3777
|
+
const [formSubmitAttempted, setFormSubmitAttempted] = useState14(false);
|
|
3722
3778
|
const validateEmail = useMemo9(() => {
|
|
3723
3779
|
if (email.length === 0) return null;
|
|
3724
3780
|
if (!EMAIL_RE4.test(email)) return "Formato de e-mail inv\xE1lido.";
|
|
@@ -3757,20 +3813,20 @@ function useForgotForm() {
|
|
|
3757
3813
|
}
|
|
3758
3814
|
|
|
3759
3815
|
// src/hooks/useResetForm.ts
|
|
3760
|
-
import { useCallback as useCallback10, useEffect as useEffect13, useMemo as useMemo10, useState as
|
|
3761
|
-
import { useHook as
|
|
3762
|
-
var MIN_PASSWORD3 =
|
|
3816
|
+
import { useCallback as useCallback10, useEffect as useEffect13, useMemo as useMemo10, useState as useState15 } from "react";
|
|
3817
|
+
import { useHook as useHook16 } from "@hook-sdk/sdk";
|
|
3818
|
+
var MIN_PASSWORD3 = 8;
|
|
3763
3819
|
function useResetForm() {
|
|
3764
|
-
const { auth } =
|
|
3765
|
-
const [token, setToken] =
|
|
3766
|
-
const [password, setPassword] =
|
|
3767
|
-
const [confirm, setConfirm] =
|
|
3768
|
-
const [submitting, setSubmitting] =
|
|
3769
|
-
const [done, setDone] =
|
|
3770
|
-
const [error, setError] =
|
|
3771
|
-
const [touchedPassword, setTouchedPassword] =
|
|
3772
|
-
const [touchedConfirm, setTouchedConfirm] =
|
|
3773
|
-
const [formSubmitAttempted, setFormSubmitAttempted] =
|
|
3820
|
+
const { auth } = useHook16();
|
|
3821
|
+
const [token, setToken] = useState15(null);
|
|
3822
|
+
const [password, setPassword] = useState15("");
|
|
3823
|
+
const [confirm, setConfirm] = useState15("");
|
|
3824
|
+
const [submitting, setSubmitting] = useState15(false);
|
|
3825
|
+
const [done, setDone] = useState15(false);
|
|
3826
|
+
const [error, setError] = useState15(null);
|
|
3827
|
+
const [touchedPassword, setTouchedPassword] = useState15(false);
|
|
3828
|
+
const [touchedConfirm, setTouchedConfirm] = useState15(false);
|
|
3829
|
+
const [formSubmitAttempted, setFormSubmitAttempted] = useState15(false);
|
|
3774
3830
|
useEffect13(() => {
|
|
3775
3831
|
if (typeof window === "undefined") return;
|
|
3776
3832
|
const params = new URLSearchParams(window.location.search);
|
|
@@ -3859,10 +3915,10 @@ function discountPercent(anchorCents, realCents) {
|
|
|
3859
3915
|
|
|
3860
3916
|
// src/hooks/useAuthPrimitives.ts
|
|
3861
3917
|
import { useEffect as useEffect14 } from "react";
|
|
3862
|
-
import { useHook as
|
|
3918
|
+
import { useHook as useHook17 } from "@hook-sdk/sdk";
|
|
3863
3919
|
var warned = false;
|
|
3864
3920
|
function useAuthPrimitives() {
|
|
3865
|
-
const { auth } =
|
|
3921
|
+
const { auth } = useHook17();
|
|
3866
3922
|
useEffect14(() => {
|
|
3867
3923
|
if (!warned && process.env.NODE_ENV !== "production") {
|
|
3868
3924
|
warned = true;
|
|
@@ -3885,9 +3941,9 @@ function useAuthPrimitives() {
|
|
|
3885
3941
|
}
|
|
3886
3942
|
|
|
3887
3943
|
// src/hooks/useAuth.ts
|
|
3888
|
-
import { useHook as
|
|
3944
|
+
import { useHook as useHook18 } from "@hook-sdk/sdk";
|
|
3889
3945
|
function useAuth() {
|
|
3890
|
-
const { user, authStatus, auth } =
|
|
3946
|
+
const { user, authStatus, auth } = useHook18();
|
|
3891
3947
|
return {
|
|
3892
3948
|
user,
|
|
3893
3949
|
authStatus,
|
|
@@ -3899,22 +3955,22 @@ function useAuth() {
|
|
|
3899
3955
|
import { useTrackOnboardingStep } from "@hook-sdk/sdk";
|
|
3900
3956
|
|
|
3901
3957
|
// src/hooks/useSubscription.ts
|
|
3902
|
-
import { useHook as
|
|
3958
|
+
import { useHook as useHook19 } from "@hook-sdk/sdk";
|
|
3903
3959
|
function useSubscription() {
|
|
3904
|
-
const { subscription } =
|
|
3960
|
+
const { subscription } = useHook19();
|
|
3905
3961
|
return {
|
|
3906
3962
|
status: subscription.status()
|
|
3907
3963
|
};
|
|
3908
3964
|
}
|
|
3909
3965
|
|
|
3910
3966
|
// src/hooks/useReminders.ts
|
|
3911
|
-
import { useCallback as useCallback11, useEffect as useEffect15, useState as
|
|
3912
|
-
import { useHook as
|
|
3967
|
+
import { useCallback as useCallback11, useEffect as useEffect15, useState as useState16 } from "react";
|
|
3968
|
+
import { useHook as useHook20 } from "@hook-sdk/sdk";
|
|
3913
3969
|
function useReminders() {
|
|
3914
|
-
const { push } =
|
|
3970
|
+
const { push } = useHook20();
|
|
3915
3971
|
const r = push.reminders;
|
|
3916
|
-
const [reminders, setReminders] =
|
|
3917
|
-
const [loading, setLoading] =
|
|
3972
|
+
const [reminders, setReminders] = useState16([]);
|
|
3973
|
+
const [loading, setLoading] = useState16(true);
|
|
3918
3974
|
const reload = useCallback11(async () => {
|
|
3919
3975
|
setLoading(true);
|
|
3920
3976
|
try {
|
|
@@ -3945,9 +4001,9 @@ function useReminders() {
|
|
|
3945
4001
|
}
|
|
3946
4002
|
|
|
3947
4003
|
// src/hooks/useToast.ts
|
|
3948
|
-
import { useCallback as useCallback12, useState as
|
|
4004
|
+
import { useCallback as useCallback12, useState as useState17 } from "react";
|
|
3949
4005
|
function useToast() {
|
|
3950
|
-
const [items, setItems] =
|
|
4006
|
+
const [items, setItems] = useState17([]);
|
|
3951
4007
|
const show = useCallback12((message, kind = "info") => {
|
|
3952
4008
|
const id = `${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
|
|
3953
4009
|
setItems((prev) => [...prev, { id, message, kind }]);
|
|
@@ -3963,20 +4019,20 @@ function useToast() {
|
|
|
3963
4019
|
|
|
3964
4020
|
// src/RouteBoundary.tsx
|
|
3965
4021
|
import { Routes as Routes2, Route as Route2 } from "react-router-dom";
|
|
3966
|
-
import { jsx as
|
|
4022
|
+
import { jsx as jsx30, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
3967
4023
|
function RouteBoundary({ children }) {
|
|
3968
|
-
return /* @__PURE__ */
|
|
4024
|
+
return /* @__PURE__ */ jsxs21(Routes2, { children: [
|
|
3969
4025
|
children,
|
|
3970
|
-
/* @__PURE__ */
|
|
4026
|
+
/* @__PURE__ */ jsx30(Route2, { path: "*", element: /* @__PURE__ */ jsx30(DefaultNotFound, {}) })
|
|
3971
4027
|
] });
|
|
3972
4028
|
}
|
|
3973
4029
|
function DefaultNotFound() {
|
|
3974
|
-
return /* @__PURE__ */
|
|
4030
|
+
return /* @__PURE__ */ jsx30("div", { role: "alert", children: "P\xE1gina n\xE3o encontrada" });
|
|
3975
4031
|
}
|
|
3976
4032
|
|
|
3977
4033
|
// src/PreAuthShell.tsx
|
|
3978
4034
|
import { BrowserRouter as BrowserRouter2, MemoryRouter as MemoryRouter2, Routes as Routes3 } from "react-router-dom";
|
|
3979
|
-
import { jsx as
|
|
4035
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
3980
4036
|
function PreAuthShell({
|
|
3981
4037
|
basename,
|
|
3982
4038
|
testRouter,
|
|
@@ -3984,14 +4040,14 @@ function PreAuthShell({
|
|
|
3984
4040
|
children
|
|
3985
4041
|
}) {
|
|
3986
4042
|
if (testRouter === "memory") {
|
|
3987
|
-
return /* @__PURE__ */
|
|
4043
|
+
return /* @__PURE__ */ jsx31(MemoryRouter2, { basename, initialEntries: testInitialEntries, children: /* @__PURE__ */ jsx31(Routes3, { children }) });
|
|
3988
4044
|
}
|
|
3989
|
-
return /* @__PURE__ */
|
|
4045
|
+
return /* @__PURE__ */ jsx31(BrowserRouter2, { basename, children: /* @__PURE__ */ jsx31(Routes3, { children }) });
|
|
3990
4046
|
}
|
|
3991
4047
|
|
|
3992
4048
|
// src/OnboardingFlow.tsx
|
|
3993
4049
|
import { useCallback as useCallback13, useEffect as useEffect16, useMemo as useMemo11, useRef as useRef7 } from "react";
|
|
3994
|
-
import { usePersistedState as usePersistedState4, useHook as
|
|
4050
|
+
import { usePersistedState as usePersistedState4, useHook as useHook21 } from "@hook-sdk/sdk";
|
|
3995
4051
|
|
|
3996
4052
|
// src/hooks/useOnboardingStep.ts
|
|
3997
4053
|
import { createContext as createContext3, useContext as useContext4 } from "react";
|
|
@@ -4007,7 +4063,7 @@ function useOnboardingStep() {
|
|
|
4007
4063
|
}
|
|
4008
4064
|
|
|
4009
4065
|
// src/OnboardingFlow.tsx
|
|
4010
|
-
import { jsx as
|
|
4066
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
4011
4067
|
var isFilled = (v) => v != null && v !== "";
|
|
4012
4068
|
var CURRENT_STEP_FIELD = "currentStep";
|
|
4013
4069
|
function readPersistedStepIdx(draft) {
|
|
@@ -4043,7 +4099,7 @@ function OnboardingFlow({
|
|
|
4043
4099
|
[setDraft]
|
|
4044
4100
|
);
|
|
4045
4101
|
const step = steps[clampedIdx];
|
|
4046
|
-
const hookCtx =
|
|
4102
|
+
const hookCtx = useHook21();
|
|
4047
4103
|
const track2 = typeof hookCtx.track === "function" ? hookCtx.track : void 0;
|
|
4048
4104
|
useEffect16(() => {
|
|
4049
4105
|
if (status.loading) return;
|
|
@@ -4097,7 +4153,7 @@ function OnboardingFlow({
|
|
|
4097
4153
|
`[hook-template] OnboardingFlow: missing screen component for step '${step.id}' (expected key '${step.screen}' in screens prop)`
|
|
4098
4154
|
);
|
|
4099
4155
|
}
|
|
4100
|
-
return /* @__PURE__ */
|
|
4156
|
+
return /* @__PURE__ */ jsx32(OnboardingStepContext.Provider, { value: ctx, children: /* @__PURE__ */ jsx32(Screen, {}) });
|
|
4101
4157
|
}
|
|
4102
4158
|
|
|
4103
4159
|
// src/hooks/useFeature.ts
|
|
@@ -4108,15 +4164,15 @@ function useFeature(name) {
|
|
|
4108
4164
|
|
|
4109
4165
|
// src/components/paywall/Paywall.tsx
|
|
4110
4166
|
import { useEffect as useEffect17, useMemo as useMemo12 } from "react";
|
|
4111
|
-
import { useHook as
|
|
4167
|
+
import { useHook as useHook22 } from "@hook-sdk/sdk";
|
|
4112
4168
|
|
|
4113
4169
|
// src/components/paywall/PaywallProvider.tsx
|
|
4114
4170
|
import { createContext as createContext4 } from "react";
|
|
4115
|
-
import { jsx as
|
|
4171
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
4116
4172
|
var PaywallContext = createContext4(null);
|
|
4117
4173
|
function PaywallProvider({ children }) {
|
|
4118
4174
|
const state = usePaywallState();
|
|
4119
|
-
return /* @__PURE__ */
|
|
4175
|
+
return /* @__PURE__ */ jsx33(PaywallContext.Provider, { value: state, children });
|
|
4120
4176
|
}
|
|
4121
4177
|
|
|
4122
4178
|
// src/components/paywall/usePaywallContext.ts
|
|
@@ -4130,7 +4186,7 @@ function usePaywallContext() {
|
|
|
4130
4186
|
}
|
|
4131
4187
|
|
|
4132
4188
|
// src/components/paywall/PaywallMethodTabs.tsx
|
|
4133
|
-
import { jsx as
|
|
4189
|
+
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
4134
4190
|
function PaywallMethodTabs({
|
|
4135
4191
|
labels,
|
|
4136
4192
|
className,
|
|
@@ -4139,10 +4195,10 @@ function PaywallMethodTabs({
|
|
|
4139
4195
|
}) {
|
|
4140
4196
|
const { methods, selectedMethod, selectMethod } = usePaywallContext();
|
|
4141
4197
|
if (methods.length < 2) return null;
|
|
4142
|
-
return /* @__PURE__ */
|
|
4198
|
+
return /* @__PURE__ */ jsx34("div", { role: "tablist", "aria-label": "M\xE9todo de pagamento", className, children: methods.map((m) => {
|
|
4143
4199
|
const active = m === selectedMethod;
|
|
4144
4200
|
const label = labels[m] ?? m;
|
|
4145
|
-
return /* @__PURE__ */
|
|
4201
|
+
return /* @__PURE__ */ jsx34(
|
|
4146
4202
|
"button",
|
|
4147
4203
|
{
|
|
4148
4204
|
type: "button",
|
|
@@ -4160,16 +4216,16 @@ function PaywallMethodTabs({
|
|
|
4160
4216
|
}
|
|
4161
4217
|
|
|
4162
4218
|
// src/components/paywall/PaywallMethodContent.tsx
|
|
4163
|
-
import { jsx as
|
|
4219
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
4164
4220
|
function PaywallMethodContent({ copy, className, rowClassName }) {
|
|
4165
4221
|
const { selectedMethod, hasConsumedTrial } = usePaywallContext();
|
|
4166
4222
|
const useCardConsumed = selectedMethod === "card" && hasConsumedTrial && copy.cardConsumedTrial;
|
|
4167
4223
|
const rows = useCardConsumed ? copy.cardConsumedTrial.bodyRows : selectedMethod === "pix-auto" || selectedMethod === "pix-once" ? copy.pix.bodyRows : copy.card.bodyRows;
|
|
4168
|
-
return /* @__PURE__ */
|
|
4224
|
+
return /* @__PURE__ */ jsx35("div", { role: "tabpanel", id: `paywall-tab-${selectedMethod}`, className, children: rows.map((row, i) => /* @__PURE__ */ jsx35("div", { className: rowClassName, children: row }, i)) });
|
|
4169
4225
|
}
|
|
4170
4226
|
|
|
4171
4227
|
// src/components/paywall/PaywallCyclePicker.tsx
|
|
4172
|
-
import { jsx as
|
|
4228
|
+
import { jsx as jsx36, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
4173
4229
|
var VARIANT_CLASSES = {
|
|
4174
4230
|
default: { card: "", cardSelected: "" },
|
|
4175
4231
|
"premium-gold": {
|
|
@@ -4194,7 +4250,7 @@ function PaywallCyclePicker({
|
|
|
4194
4250
|
const { cycle: selected, setCycle, plan, anchorPriceCents } = ctx;
|
|
4195
4251
|
const cycles = ["MONTHLY", "YEARLY"];
|
|
4196
4252
|
if (render) {
|
|
4197
|
-
return /* @__PURE__ */
|
|
4253
|
+
return /* @__PURE__ */ jsx36("div", { className, children: render({ cycles, selected, setCycle, plan, anchorPriceCents }) });
|
|
4198
4254
|
}
|
|
4199
4255
|
if (cycles.length < 2) return null;
|
|
4200
4256
|
const v = VARIANT_CLASSES[variant];
|
|
@@ -4204,7 +4260,7 @@ function PaywallCyclePicker({
|
|
|
4204
4260
|
const yearlyCents = plan?.yearlyCents ?? 0;
|
|
4205
4261
|
const anchorMonthly = plan?.anchorMonthlyCents ?? null;
|
|
4206
4262
|
const anchorYearly = plan?.anchorYearlyCents ?? null;
|
|
4207
|
-
return /* @__PURE__ */
|
|
4263
|
+
return /* @__PURE__ */ jsx36(
|
|
4208
4264
|
"div",
|
|
4209
4265
|
{
|
|
4210
4266
|
role: "radiogroup",
|
|
@@ -4216,7 +4272,7 @@ function PaywallCyclePicker({
|
|
|
4216
4272
|
const suffix = c === "YEARLY" ? labels.annualSuffix : labels.monthlySuffix;
|
|
4217
4273
|
const mainCents = c === "YEARLY" ? Math.round(yearlyCents / 12) : monthlyCents;
|
|
4218
4274
|
const anchorCents = c === "YEARLY" ? anchorYearly : anchorMonthly;
|
|
4219
|
-
return /* @__PURE__ */
|
|
4275
|
+
return /* @__PURE__ */ jsxs22(
|
|
4220
4276
|
"button",
|
|
4221
4277
|
{
|
|
4222
4278
|
type: "button",
|
|
@@ -4229,10 +4285,10 @@ function PaywallCyclePicker({
|
|
|
4229
4285
|
active ? composedCardSelectedClassName : ""
|
|
4230
4286
|
].filter(Boolean).join(" "),
|
|
4231
4287
|
children: [
|
|
4232
|
-
/* @__PURE__ */
|
|
4233
|
-
/* @__PURE__ */
|
|
4234
|
-
/* @__PURE__ */
|
|
4235
|
-
anchorCents != null && anchorCents > mainCents ? /* @__PURE__ */
|
|
4288
|
+
/* @__PURE__ */ jsx36("span", { className: "font-bold text-base leading-tight", children: formatBRL(mainCents) }),
|
|
4289
|
+
/* @__PURE__ */ jsx36("span", { className: "text-xs opacity-70 leading-tight", children: suffix }),
|
|
4290
|
+
/* @__PURE__ */ jsx36("span", { className: "text-xs opacity-60 leading-tight", children: label }),
|
|
4291
|
+
anchorCents != null && anchorCents > mainCents ? /* @__PURE__ */ jsx36("span", { className: anchorClassName ?? "text-xs opacity-50", children: /* @__PURE__ */ jsx36("s", { children: formatBRL(anchorCents) }) }) : null
|
|
4236
4292
|
]
|
|
4237
4293
|
},
|
|
4238
4294
|
c
|
|
@@ -4243,7 +4299,7 @@ function PaywallCyclePicker({
|
|
|
4243
4299
|
}
|
|
4244
4300
|
|
|
4245
4301
|
// src/components/paywall/Paywall.tsx
|
|
4246
|
-
import { jsx as
|
|
4302
|
+
import { jsx as jsx37, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
4247
4303
|
var NBSP = "\xA0";
|
|
4248
4304
|
function Paywall({
|
|
4249
4305
|
copy,
|
|
@@ -4251,7 +4307,7 @@ function Paywall({
|
|
|
4251
4307
|
slots = {},
|
|
4252
4308
|
onBeforeCheckout
|
|
4253
4309
|
}) {
|
|
4254
|
-
return /* @__PURE__ */
|
|
4310
|
+
return /* @__PURE__ */ jsx37(PaywallProvider, { children: /* @__PURE__ */ jsx37(
|
|
4255
4311
|
PaywallInner,
|
|
4256
4312
|
{
|
|
4257
4313
|
copy,
|
|
@@ -4267,7 +4323,7 @@ function PaywallInner({
|
|
|
4267
4323
|
slots = {},
|
|
4268
4324
|
onBeforeCheckout
|
|
4269
4325
|
}) {
|
|
4270
|
-
const { track: track2 } =
|
|
4326
|
+
const { track: track2 } = useHook22();
|
|
4271
4327
|
const s = usePaywallContext();
|
|
4272
4328
|
const priceLabel = formatBRL(s.currentPriceCents).replace(new RegExp(NBSP, "g"), " ");
|
|
4273
4329
|
const trialDaysCardLabel = String(s.trialDaysCard);
|
|
@@ -4324,15 +4380,15 @@ function PaywallInner({
|
|
|
4324
4380
|
await s.submit();
|
|
4325
4381
|
};
|
|
4326
4382
|
const ctaTheme = s.selectedMethod === "card" ? themeClasses.ctaCard : themeClasses.ctaPix;
|
|
4327
|
-
return /* @__PURE__ */
|
|
4383
|
+
return /* @__PURE__ */ jsxs23("div", { className: themeClasses.container, children: [
|
|
4328
4384
|
slots.heroSlot,
|
|
4329
|
-
/* @__PURE__ */
|
|
4330
|
-
/* @__PURE__ */
|
|
4385
|
+
/* @__PURE__ */ jsx37("h1", { className: themeClasses.headline, children: copy.headline }),
|
|
4386
|
+
/* @__PURE__ */ jsx37("ul", { children: copy.features.map((f) => /* @__PURE__ */ jsxs23("li", { className: themeClasses.feature, children: [
|
|
4331
4387
|
"\u2713 ",
|
|
4332
|
-
/* @__PURE__ */
|
|
4388
|
+
/* @__PURE__ */ jsx37("span", { children: f })
|
|
4333
4389
|
] }, f)) }),
|
|
4334
|
-
copy.socialProof ? /* @__PURE__ */
|
|
4335
|
-
slots.cyclePickerSlot ?? /* @__PURE__ */
|
|
4390
|
+
copy.socialProof ? /* @__PURE__ */ jsx37("p", { className: themeClasses.socialProof, children: copy.socialProof }) : null,
|
|
4391
|
+
slots.cyclePickerSlot ?? /* @__PURE__ */ jsx37(
|
|
4336
4392
|
PaywallCyclePicker,
|
|
4337
4393
|
{
|
|
4338
4394
|
labels: copy.cycle,
|
|
@@ -4341,7 +4397,7 @@ function PaywallInner({
|
|
|
4341
4397
|
anchorClassName: themeClasses.anchorPrice
|
|
4342
4398
|
}
|
|
4343
4399
|
),
|
|
4344
|
-
/* @__PURE__ */
|
|
4400
|
+
/* @__PURE__ */ jsx37(
|
|
4345
4401
|
PaywallMethodTabs,
|
|
4346
4402
|
{
|
|
4347
4403
|
labels: { "pix-auto": copy.pix.tabLabel, card: copy.card.tabLabel },
|
|
@@ -4350,7 +4406,7 @@ function PaywallInner({
|
|
|
4350
4406
|
tabActiveClassName: themeClasses.tabActive
|
|
4351
4407
|
}
|
|
4352
4408
|
),
|
|
4353
|
-
/* @__PURE__ */
|
|
4409
|
+
/* @__PURE__ */ jsx37(
|
|
4354
4410
|
PaywallMethodContent,
|
|
4355
4411
|
{
|
|
4356
4412
|
copy: {
|
|
@@ -4368,8 +4424,8 @@ function PaywallInner({
|
|
|
4368
4424
|
}
|
|
4369
4425
|
),
|
|
4370
4426
|
slots.beforeCtaSlot,
|
|
4371
|
-
/* @__PURE__ */
|
|
4372
|
-
/* @__PURE__ */
|
|
4427
|
+
/* @__PURE__ */ jsxs23("div", { children: [
|
|
4428
|
+
/* @__PURE__ */ jsx37(
|
|
4373
4429
|
"button",
|
|
4374
4430
|
{
|
|
4375
4431
|
type: "button",
|
|
@@ -4381,8 +4437,8 @@ function PaywallInner({
|
|
|
4381
4437
|
children: s.submitting ? "Abrindo checkout\u2026" : ctaLabel
|
|
4382
4438
|
}
|
|
4383
4439
|
),
|
|
4384
|
-
switchHint ? /* @__PURE__ */
|
|
4385
|
-
/* @__PURE__ */
|
|
4440
|
+
switchHint ? /* @__PURE__ */ jsx37("p", { className: themeClasses.switchHint, children: switchHint }) : null,
|
|
4441
|
+
/* @__PURE__ */ jsx37("p", { className: themeClasses.trustLine, children: copy.trustLine })
|
|
4386
4442
|
] })
|
|
4387
4443
|
] });
|
|
4388
4444
|
}
|
|
@@ -4399,7 +4455,7 @@ function interpolateCopy(m, price, days) {
|
|
|
4399
4455
|
}
|
|
4400
4456
|
|
|
4401
4457
|
// src/components/paywall/PaywallCta.tsx
|
|
4402
|
-
import { jsx as
|
|
4458
|
+
import { jsx as jsx38, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
4403
4459
|
function PaywallCta({
|
|
4404
4460
|
ctaLabel,
|
|
4405
4461
|
loadingLabel,
|
|
@@ -4412,8 +4468,8 @@ function PaywallCta({
|
|
|
4412
4468
|
}) {
|
|
4413
4469
|
const { submit, submitting } = usePaywallContext();
|
|
4414
4470
|
const label = submitting && loadingLabel ? loadingLabel : ctaLabel;
|
|
4415
|
-
return /* @__PURE__ */
|
|
4416
|
-
/* @__PURE__ */
|
|
4471
|
+
return /* @__PURE__ */ jsxs24("div", { className, children: [
|
|
4472
|
+
/* @__PURE__ */ jsx38(
|
|
4417
4473
|
"button",
|
|
4418
4474
|
{
|
|
4419
4475
|
type: "button",
|
|
@@ -4425,20 +4481,20 @@ function PaywallCta({
|
|
|
4425
4481
|
children: label
|
|
4426
4482
|
}
|
|
4427
4483
|
),
|
|
4428
|
-
switchHint ? /* @__PURE__ */
|
|
4429
|
-
/* @__PURE__ */
|
|
4484
|
+
switchHint ? /* @__PURE__ */ jsx38("p", { className: switchHintClassName, children: switchHint }) : null,
|
|
4485
|
+
/* @__PURE__ */ jsx38("p", { className: trustClassName, children: trustLine })
|
|
4430
4486
|
] });
|
|
4431
4487
|
}
|
|
4432
4488
|
|
|
4433
4489
|
// src/components/paywall/blocks/PaywallEyebrow.tsx
|
|
4434
|
-
import { jsx as
|
|
4490
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
4435
4491
|
var DEFAULT_EYEBROW_CLASSES = "text-xs uppercase tracking-widest font-semibold opacity-70";
|
|
4436
4492
|
function PaywallEyebrow({ text, className }) {
|
|
4437
|
-
return /* @__PURE__ */
|
|
4493
|
+
return /* @__PURE__ */ jsx39("div", { className: [DEFAULT_EYEBROW_CLASSES, className].filter(Boolean).join(" "), children: text });
|
|
4438
4494
|
}
|
|
4439
4495
|
|
|
4440
4496
|
// src/components/paywall/blocks/PaywallHero.tsx
|
|
4441
|
-
import { jsx as
|
|
4497
|
+
import { jsx as jsx40, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
4442
4498
|
var DEFAULT_GRADIENT = "absolute inset-0 bg-gradient-to-t from-black/70 via-black/20 to-transparent";
|
|
4443
4499
|
function PaywallHero({
|
|
4444
4500
|
src,
|
|
@@ -4452,15 +4508,15 @@ function PaywallHero({
|
|
|
4452
4508
|
render
|
|
4453
4509
|
}) {
|
|
4454
4510
|
if (render) {
|
|
4455
|
-
return /* @__PURE__ */
|
|
4511
|
+
return /* @__PURE__ */ jsx40("div", { className, children: render({ src, headline }) });
|
|
4456
4512
|
}
|
|
4457
|
-
return /* @__PURE__ */
|
|
4513
|
+
return /* @__PURE__ */ jsxs25(
|
|
4458
4514
|
"div",
|
|
4459
4515
|
{
|
|
4460
4516
|
className: ["relative overflow-hidden", className].filter(Boolean).join(" "),
|
|
4461
4517
|
style: { aspectRatio },
|
|
4462
4518
|
children: [
|
|
4463
|
-
/* @__PURE__ */
|
|
4519
|
+
/* @__PURE__ */ jsx40(
|
|
4464
4520
|
"img",
|
|
4465
4521
|
{
|
|
4466
4522
|
src,
|
|
@@ -4468,8 +4524,8 @@ function PaywallHero({
|
|
|
4468
4524
|
className: ["absolute inset-0 w-full h-full object-cover", imgClassName].filter(Boolean).join(" ")
|
|
4469
4525
|
}
|
|
4470
4526
|
),
|
|
4471
|
-
/* @__PURE__ */
|
|
4472
|
-
headline ? /* @__PURE__ */
|
|
4527
|
+
/* @__PURE__ */ jsx40("div", { className: gradientClassName ?? DEFAULT_GRADIENT, "aria-hidden": "true" }),
|
|
4528
|
+
headline ? /* @__PURE__ */ jsx40(
|
|
4473
4529
|
"h1",
|
|
4474
4530
|
{
|
|
4475
4531
|
className: ["absolute bottom-0 left-0 right-0 p-4 text-white font-bold text-2xl", headlineClassName].filter(Boolean).join(" "),
|
|
@@ -4482,15 +4538,15 @@ function PaywallHero({
|
|
|
4482
4538
|
}
|
|
4483
4539
|
|
|
4484
4540
|
// src/components/paywall/blocks/PaywallHeadline.tsx
|
|
4485
|
-
import { jsx as
|
|
4541
|
+
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
4486
4542
|
var DEFAULT_HEADLINE_CLASSES = "text-2xl font-bold leading-tight";
|
|
4487
4543
|
function PaywallHeadline({ text, className, as = "h1" }) {
|
|
4488
4544
|
const Tag = as;
|
|
4489
|
-
return /* @__PURE__ */
|
|
4545
|
+
return /* @__PURE__ */ jsx41(Tag, { className: [DEFAULT_HEADLINE_CLASSES, className].filter(Boolean).join(" "), children: text });
|
|
4490
4546
|
}
|
|
4491
4547
|
|
|
4492
4548
|
// src/components/paywall/blocks/PaywallPriceHeadline.tsx
|
|
4493
|
-
import { jsx as
|
|
4549
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
4494
4550
|
var DEFAULT_CLASS = "text-2xl font-bold leading-tight";
|
|
4495
4551
|
var CYCLE_LABEL = {
|
|
4496
4552
|
MONTHLY: "mensal",
|
|
@@ -4510,16 +4566,16 @@ function PaywallPriceHeadline({
|
|
|
4510
4566
|
const rootClasses = [DEFAULT_CLASS, className].filter(Boolean).join(" ");
|
|
4511
4567
|
if (render) {
|
|
4512
4568
|
const RootTag2 = as;
|
|
4513
|
-
return /* @__PURE__ */
|
|
4569
|
+
return /* @__PURE__ */ jsx42(RootTag2, { className: [className].filter(Boolean).join(" ") || void 0, children: render({ pricePerDay, currentMonthlyEquivCents: monthlyEquiv, cycle }) });
|
|
4514
4570
|
}
|
|
4515
4571
|
const text = template.replaceAll("{pricePerDay}", pricePerDay).replaceAll("{currentMonthlyEquiv}", formatBRL(monthlyEquiv)).replaceAll("{cycle}", cycleLabel);
|
|
4516
4572
|
const RootTag = as;
|
|
4517
|
-
return /* @__PURE__ */
|
|
4573
|
+
return /* @__PURE__ */ jsx42(RootTag, { className: rootClasses, children: text });
|
|
4518
4574
|
}
|
|
4519
4575
|
|
|
4520
4576
|
// src/components/paywall/blocks/PaywallCountdown.tsx
|
|
4521
|
-
import { useEffect as useEffect18, useRef as useRef8, useState as
|
|
4522
|
-
import { jsx as
|
|
4577
|
+
import { useEffect as useEffect18, useRef as useRef8, useState as useState18 } from "react";
|
|
4578
|
+
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
4523
4579
|
var DEFAULT_COUNTDOWN_CLASSES = "font-mono tabular-nums";
|
|
4524
4580
|
function resolveDeadlineMs(deadline) {
|
|
4525
4581
|
if (deadline instanceof Date) return deadline.getTime();
|
|
@@ -4560,7 +4616,7 @@ function PaywallCountdown({
|
|
|
4560
4616
|
if (deadlineMsRef.current === null) {
|
|
4561
4617
|
deadlineMsRef.current = resolveDeadlineMs(deadline);
|
|
4562
4618
|
}
|
|
4563
|
-
const [state, setState] =
|
|
4619
|
+
const [state, setState] = useState18(() => computeRemaining(deadlineMsRef.current));
|
|
4564
4620
|
const expiredCalledRef = useRef8(false);
|
|
4565
4621
|
useEffect18(() => {
|
|
4566
4622
|
if (state.expired) {
|
|
@@ -4582,14 +4638,14 @@ function PaywallCountdown({
|
|
|
4582
4638
|
return () => clearInterval(id);
|
|
4583
4639
|
}, [state.expired]);
|
|
4584
4640
|
if (render) {
|
|
4585
|
-
return /* @__PURE__ */
|
|
4641
|
+
return /* @__PURE__ */ jsx43("div", { className, children: render(state) });
|
|
4586
4642
|
}
|
|
4587
4643
|
const formatted = format === "h:m:s" ? `${pad(state.h)}:${pad(state.m)}:${pad(state.s)}` : `${pad(state.h * 60 + state.m)}:${pad(state.s)}`;
|
|
4588
|
-
return /* @__PURE__ */
|
|
4644
|
+
return /* @__PURE__ */ jsx43("div", { className: [DEFAULT_COUNTDOWN_CLASSES, className].filter(Boolean).join(" "), children: formatted });
|
|
4589
4645
|
}
|
|
4590
4646
|
|
|
4591
4647
|
// src/components/paywall/blocks/PaywallFeatures.tsx
|
|
4592
|
-
import { jsx as
|
|
4648
|
+
import { jsx as jsx44, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
4593
4649
|
function PaywallFeatures({
|
|
4594
4650
|
items,
|
|
4595
4651
|
IconComponent,
|
|
@@ -4600,19 +4656,19 @@ function PaywallFeatures({
|
|
|
4600
4656
|
renderItem
|
|
4601
4657
|
}) {
|
|
4602
4658
|
if (render) {
|
|
4603
|
-
return /* @__PURE__ */
|
|
4659
|
+
return /* @__PURE__ */ jsx44("div", { className, children: render({ items }) });
|
|
4604
4660
|
}
|
|
4605
4661
|
if (renderItem) {
|
|
4606
|
-
return /* @__PURE__ */
|
|
4662
|
+
return /* @__PURE__ */ jsx44("ul", { className, children: items.map((item, idx) => /* @__PURE__ */ jsx44("li", { children: renderItem(item, idx) }, idx)) });
|
|
4607
4663
|
}
|
|
4608
|
-
return /* @__PURE__ */
|
|
4609
|
-
IconComponent ? /* @__PURE__ */
|
|
4610
|
-
/* @__PURE__ */
|
|
4664
|
+
return /* @__PURE__ */ jsx44("ul", { className, children: items.map((item, idx) => /* @__PURE__ */ jsxs26("li", { className: itemClassName, children: [
|
|
4665
|
+
IconComponent ? /* @__PURE__ */ jsx44(IconComponent, { className: iconClassName }) : /* @__PURE__ */ jsx44("span", { className: iconClassName, "aria-hidden": "true", children: "\u2713" }),
|
|
4666
|
+
/* @__PURE__ */ jsx44("span", { children: item })
|
|
4611
4667
|
] }, idx)) });
|
|
4612
4668
|
}
|
|
4613
4669
|
|
|
4614
4670
|
// src/components/paywall/blocks/PaywallFeaturesCard.tsx
|
|
4615
|
-
import { jsx as
|
|
4671
|
+
import { jsx as jsx45, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
4616
4672
|
var DEFAULT_CARD_CLASSES = "rounded-xl border p-4";
|
|
4617
4673
|
function PaywallFeaturesCard({
|
|
4618
4674
|
title,
|
|
@@ -4623,20 +4679,20 @@ function PaywallFeaturesCard({
|
|
|
4623
4679
|
itemClassName,
|
|
4624
4680
|
renderItem
|
|
4625
4681
|
}) {
|
|
4626
|
-
return /* @__PURE__ */
|
|
4627
|
-
title ? /* @__PURE__ */
|
|
4628
|
-
/* @__PURE__ */
|
|
4629
|
-
(item, idx) => renderItem ? /* @__PURE__ */
|
|
4630
|
-
/* @__PURE__ */
|
|
4682
|
+
return /* @__PURE__ */ jsx45("div", { className, children: /* @__PURE__ */ jsxs27("div", { className: [DEFAULT_CARD_CLASSES, cardClassName].filter(Boolean).join(" "), children: [
|
|
4683
|
+
title ? /* @__PURE__ */ jsx45("div", { className: ["font-semibold mb-2", titleClassName].filter(Boolean).join(" "), children: title }) : null,
|
|
4684
|
+
/* @__PURE__ */ jsx45("ul", { children: items.map(
|
|
4685
|
+
(item, idx) => renderItem ? /* @__PURE__ */ jsx45("li", { children: renderItem(item, idx) }, idx) : /* @__PURE__ */ jsxs27("li", { className: itemClassName, children: [
|
|
4686
|
+
/* @__PURE__ */ jsx45("span", { "aria-hidden": "true", children: "\u2022" }),
|
|
4631
4687
|
" ",
|
|
4632
|
-
/* @__PURE__ */
|
|
4688
|
+
/* @__PURE__ */ jsx45("span", { children: item })
|
|
4633
4689
|
] }, idx)
|
|
4634
4690
|
) })
|
|
4635
4691
|
] }) });
|
|
4636
4692
|
}
|
|
4637
4693
|
|
|
4638
4694
|
// src/components/paywall/blocks/PaywallTrophyBadge.tsx
|
|
4639
|
-
import { jsx as
|
|
4695
|
+
import { jsx as jsx46, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
4640
4696
|
var DEFAULT_CHIP_CLASSES = "inline-flex items-center gap-1 px-3 py-1 rounded-full bg-yellow-100 text-yellow-900 text-sm font-medium";
|
|
4641
4697
|
var FLOATING_CLASSES = "absolute top-2 right-2 z-10 shadow-md";
|
|
4642
4698
|
function PaywallTrophyBadge({
|
|
@@ -4647,21 +4703,21 @@ function PaywallTrophyBadge({
|
|
|
4647
4703
|
render
|
|
4648
4704
|
}) {
|
|
4649
4705
|
if (render) {
|
|
4650
|
-
return /* @__PURE__ */
|
|
4706
|
+
return /* @__PURE__ */ jsx46("div", { className, children: render({ text }) });
|
|
4651
4707
|
}
|
|
4652
4708
|
const rootClasses = [
|
|
4653
4709
|
DEFAULT_CHIP_CLASSES,
|
|
4654
4710
|
floating ? FLOATING_CLASSES : "",
|
|
4655
4711
|
className
|
|
4656
4712
|
].filter(Boolean).join(" ");
|
|
4657
|
-
return /* @__PURE__ */
|
|
4658
|
-
/* @__PURE__ */
|
|
4659
|
-
/* @__PURE__ */
|
|
4713
|
+
return /* @__PURE__ */ jsxs28("div", { className: rootClasses, children: [
|
|
4714
|
+
/* @__PURE__ */ jsx46("span", { className: iconClassName, "aria-hidden": "true", children: "\u{1F3C6}" }),
|
|
4715
|
+
/* @__PURE__ */ jsx46("span", { children: text })
|
|
4660
4716
|
] });
|
|
4661
4717
|
}
|
|
4662
4718
|
|
|
4663
4719
|
// src/components/paywall/blocks/PaywallAnchorPrice.tsx
|
|
4664
|
-
import { jsx as
|
|
4720
|
+
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
4665
4721
|
var DEFAULT_CLASS2 = "text-sm opacity-60 line-through";
|
|
4666
4722
|
function PaywallAnchorPrice({
|
|
4667
4723
|
className,
|
|
@@ -4675,13 +4731,13 @@ function PaywallAnchorPrice({
|
|
|
4675
4731
|
const formatted = formatBRL(anchorPriceCents);
|
|
4676
4732
|
const rootClasses = [DEFAULT_CLASS2, className].filter(Boolean).join(" ");
|
|
4677
4733
|
if (render) {
|
|
4678
|
-
return /* @__PURE__ */
|
|
4734
|
+
return /* @__PURE__ */ jsx47("span", { className: className || void 0, children: render({ anchorCents: anchorPriceCents, formatted }) });
|
|
4679
4735
|
}
|
|
4680
|
-
return /* @__PURE__ */
|
|
4736
|
+
return /* @__PURE__ */ jsx47("span", { className: rootClasses, children: formatted });
|
|
4681
4737
|
}
|
|
4682
4738
|
|
|
4683
4739
|
// src/components/paywall/blocks/PaywallTestimonials.tsx
|
|
4684
|
-
import { jsx as
|
|
4740
|
+
import { jsx as jsx48, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
4685
4741
|
var DEFAULT_ROOT = "flex gap-3 overflow-x-auto snap-x snap-mandatory pb-2";
|
|
4686
4742
|
var DEFAULT_CARD = "snap-start shrink-0 w-72 rounded-2xl border p-4 flex flex-col gap-2";
|
|
4687
4743
|
var DEFAULT_AVATAR = "w-10 h-10 rounded-full object-cover";
|
|
@@ -4707,13 +4763,13 @@ function PaywallTestimonials({
|
|
|
4707
4763
|
const quoteClasses = [DEFAULT_QUOTE, quoteClassName].filter(Boolean).join(" ");
|
|
4708
4764
|
const nameClasses = [DEFAULT_NAME, nameClassName].filter(Boolean).join(" ");
|
|
4709
4765
|
const starsClasses = [DEFAULT_STARS, starsClassName].filter(Boolean).join(" ");
|
|
4710
|
-
return /* @__PURE__ */
|
|
4766
|
+
return /* @__PURE__ */ jsx48("div", { className: rootClasses, children: items.map((item, idx) => {
|
|
4711
4767
|
if (renderItem) return renderItem(item, idx);
|
|
4712
4768
|
const filled = clampStars(item.stars);
|
|
4713
4769
|
const empty = 5 - filled;
|
|
4714
|
-
return /* @__PURE__ */
|
|
4715
|
-
/* @__PURE__ */
|
|
4716
|
-
item.avatar ? /* @__PURE__ */
|
|
4770
|
+
return /* @__PURE__ */ jsxs29("div", { className: cardClasses, children: [
|
|
4771
|
+
/* @__PURE__ */ jsxs29("div", { className: "flex items-center gap-2", children: [
|
|
4772
|
+
item.avatar ? /* @__PURE__ */ jsx48(
|
|
4717
4773
|
"img",
|
|
4718
4774
|
{
|
|
4719
4775
|
src: item.avatar,
|
|
@@ -4723,19 +4779,19 @@ function PaywallTestimonials({
|
|
|
4723
4779
|
"aria-hidden": "true"
|
|
4724
4780
|
}
|
|
4725
4781
|
) : null,
|
|
4726
|
-
/* @__PURE__ */
|
|
4782
|
+
/* @__PURE__ */ jsx48("div", { className: nameClasses, children: item.name })
|
|
4727
4783
|
] }),
|
|
4728
|
-
/* @__PURE__ */
|
|
4784
|
+
/* @__PURE__ */ jsxs29("div", { className: starsClasses, "aria-label": `${filled} de 5 estrelas`, children: [
|
|
4729
4785
|
"\u2605".repeat(filled),
|
|
4730
4786
|
"\u2606".repeat(empty)
|
|
4731
4787
|
] }),
|
|
4732
|
-
/* @__PURE__ */
|
|
4788
|
+
/* @__PURE__ */ jsx48("p", { className: quoteClasses, children: item.quote })
|
|
4733
4789
|
] }, idx);
|
|
4734
4790
|
}) });
|
|
4735
4791
|
}
|
|
4736
4792
|
|
|
4737
4793
|
// src/components/paywall/blocks/PaywallStatsRow.tsx
|
|
4738
|
-
import { jsx as
|
|
4794
|
+
import { jsx as jsx49, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
4739
4795
|
var DEFAULT_ROOT2 = "grid grid-cols-3 gap-4";
|
|
4740
4796
|
var DEFAULT_CELL = "flex flex-col items-center text-center";
|
|
4741
4797
|
var DEFAULT_VALUE = "text-2xl font-bold";
|
|
@@ -4752,18 +4808,18 @@ function PaywallStatsRow({
|
|
|
4752
4808
|
const cellClasses = [DEFAULT_CELL, cellClassName].filter(Boolean).join(" ");
|
|
4753
4809
|
const valueClasses = [DEFAULT_VALUE, valueClassName].filter(Boolean).join(" ");
|
|
4754
4810
|
const labelClasses = [DEFAULT_LABEL, labelClassName].filter(Boolean).join(" ");
|
|
4755
|
-
return /* @__PURE__ */
|
|
4811
|
+
return /* @__PURE__ */ jsx49("div", { className: rootClasses, children: stats.map((stat, idx) => {
|
|
4756
4812
|
if (renderCell) return renderCell(stat, idx);
|
|
4757
|
-
return /* @__PURE__ */
|
|
4758
|
-
stat.icon ? /* @__PURE__ */
|
|
4759
|
-
/* @__PURE__ */
|
|
4760
|
-
/* @__PURE__ */
|
|
4813
|
+
return /* @__PURE__ */ jsxs30("div", { className: cellClasses, children: [
|
|
4814
|
+
stat.icon ? /* @__PURE__ */ jsx49("div", { "aria-hidden": "true", children: stat.icon }) : null,
|
|
4815
|
+
/* @__PURE__ */ jsx49("div", { className: valueClasses, children: stat.value }),
|
|
4816
|
+
/* @__PURE__ */ jsx49("div", { className: labelClasses, children: stat.label })
|
|
4761
4817
|
] }, idx);
|
|
4762
4818
|
}) });
|
|
4763
4819
|
}
|
|
4764
4820
|
|
|
4765
4821
|
// src/components/paywall/blocks/PaywallFinePrint.tsx
|
|
4766
|
-
import { jsx as
|
|
4822
|
+
import { jsx as jsx50 } from "react/jsx-runtime";
|
|
4767
4823
|
var DEFAULT_CLASS3 = "text-xs opacity-60 leading-snug";
|
|
4768
4824
|
var CYCLE_LABEL2 = {
|
|
4769
4825
|
MONTHLY: "mensal",
|
|
@@ -4786,7 +4842,7 @@ function PaywallFinePrint({
|
|
|
4786
4842
|
const priceFormatted = formatBRL(currentPriceCents ?? 0);
|
|
4787
4843
|
const rootClasses = [DEFAULT_CLASS3, className].filter(Boolean).join(" ");
|
|
4788
4844
|
if (render) {
|
|
4789
|
-
return /* @__PURE__ */
|
|
4845
|
+
return /* @__PURE__ */ jsx50("p", { className: className || void 0, children: render({
|
|
4790
4846
|
currentPriceCents: currentPriceCents ?? 0,
|
|
4791
4847
|
cycle,
|
|
4792
4848
|
trialDays: trialDays ?? 0,
|
|
@@ -4794,11 +4850,11 @@ function PaywallFinePrint({
|
|
|
4794
4850
|
}) });
|
|
4795
4851
|
}
|
|
4796
4852
|
const text = template.replaceAll("{price}", priceFormatted).replaceAll("{trialDays}", String(trialDays ?? 0)).replaceAll("{cycle}", cycleLabel);
|
|
4797
|
-
return /* @__PURE__ */
|
|
4853
|
+
return /* @__PURE__ */ jsx50("p", { className: rootClasses, children: text });
|
|
4798
4854
|
}
|
|
4799
4855
|
|
|
4800
4856
|
// src/components/paywall/blocks/PaywallTrustLine.tsx
|
|
4801
|
-
import { jsx as
|
|
4857
|
+
import { jsx as jsx51, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
4802
4858
|
var DEFAULT_ROOT3 = "flex items-center gap-3";
|
|
4803
4859
|
var DEFAULT_ITEM = "flex items-center gap-1.5 text-xs";
|
|
4804
4860
|
function PaywallTrustLine({
|
|
@@ -4809,17 +4865,17 @@ function PaywallTrustLine({
|
|
|
4809
4865
|
}) {
|
|
4810
4866
|
const rootClasses = [DEFAULT_ROOT3, className].filter(Boolean).join(" ");
|
|
4811
4867
|
const itemClasses = [DEFAULT_ITEM, itemClassName].filter(Boolean).join(" ");
|
|
4812
|
-
return /* @__PURE__ */
|
|
4868
|
+
return /* @__PURE__ */ jsx51("div", { className: rootClasses, children: items.map((item, idx) => {
|
|
4813
4869
|
if (renderItem) return renderItem(item, idx);
|
|
4814
|
-
return /* @__PURE__ */
|
|
4815
|
-
/* @__PURE__ */
|
|
4816
|
-
/* @__PURE__ */
|
|
4870
|
+
return /* @__PURE__ */ jsxs31("span", { className: itemClasses, children: [
|
|
4871
|
+
/* @__PURE__ */ jsx51("span", { "aria-hidden": "true", children: item.icon }),
|
|
4872
|
+
/* @__PURE__ */ jsx51("span", { children: item.text })
|
|
4817
4873
|
] }, idx);
|
|
4818
4874
|
}) });
|
|
4819
4875
|
}
|
|
4820
4876
|
|
|
4821
4877
|
// src/components/paywall/blocks/PaywallStickyFooter.tsx
|
|
4822
|
-
import { jsx as
|
|
4878
|
+
import { jsx as jsx52 } from "react/jsx-runtime";
|
|
4823
4879
|
var DEFAULT_CLASSES = "sticky bottom-0 left-0 right-0 bg-background";
|
|
4824
4880
|
var SAFE_AREA_CLASS = "pb-[env(safe-area-inset-bottom)]";
|
|
4825
4881
|
function PaywallStickyFooter({
|
|
@@ -4828,7 +4884,7 @@ function PaywallStickyFooter({
|
|
|
4828
4884
|
safeAreaInsets = true
|
|
4829
4885
|
}) {
|
|
4830
4886
|
const classes = [DEFAULT_CLASSES, safeAreaInsets ? SAFE_AREA_CLASS : null, className].filter(Boolean).join(" ");
|
|
4831
|
-
return /* @__PURE__ */
|
|
4887
|
+
return /* @__PURE__ */ jsx52("div", { className: classes, children });
|
|
4832
4888
|
}
|
|
4833
4889
|
export {
|
|
4834
4890
|
AppConfigProvider,
|