1(function() { 2 try { 3 var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; 4 e.SENTRY_RELEASE = { id: "b96dc26" }; 5 var n = new e.Error().stack; 6 n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "f21faf86-920c-466f-a094-34b2398f226e", e._sentryDebugIdIdentifier = "sentry-dbid-f21faf86-920c-466f-a094-34b2398f226e"); 7 } catch (e) {} 8})(); 9import { n as __esmMin } from "./rolldown-runtime-sLwMD6dS.js"; 10import { M as init_currency_helper, j as CurrencyHelper } from "./controllers-jdPQjaCB.js"; 11import { a as cn, i as require_compiler_runtime, l as getCsrfToken, t as require_jsx_runtime, u as init_utils } from "./jsx-runtime-CHSMGLHp.js"; 12import { t as require_react } from "./react-CrLPhuc5.js"; 13import { n as init_icon, t as Icon } from "./icon-BNzYbsdJ.js"; 14import { r as init_button, t as Button } from "./button-DOiPZHfy.js"; 15import { a as init_dist, s as usePage } from "./dist-ZlUHm0R7.js"; 16import { n as init_OnboardingLayout, t as OnboardingLayout } from "./OnboardingLayout-BnUCTf-h.js"; 17import { i as init_AccountSetup, n as init_OnboardingHeader, r as AccountSetupHeading, t as OnboardingHeader } from "./OnboardingHeader-C7IoGNdr.js"; 18import { n as init_i18n, r as t } from "./i18n-D_KmXEqY.js"; 19//#region app/frontend/pages/Onboarding/Explore.tsx 20/** 21* /onboarding/explore â the Inertia port of `Onboarding::Intents::ExploreComponent`. 22* 23* Watch the product tour to the end and the overlay flips in with the credit-claim 24* form, while the skip link fades out â same `.video-frame__seen.is-visible` / 25* `.invisible` classes, same transition, now driven by React state instead of a 26* Stimulus controller toggling classes. 27* 28* The badge sentence is composed here from structured props: the legacy page received 29* the rendered `extra_credits_*_html` string from the server (R5). Which of the two 30* sentences applies is still decided in Ruby, by `single_credits_bucket?`. 31*/ 32function Explore() { 33 const $ = (0, import_compiler_runtime.c)(43); 34 const { creditsBadge, claimPath, skipPath, emailAddress, logoutPath } = usePage().props; 35 const [videoEnded, setVideoEnded] = (0, import_react.useState)(false); 36 const [claiming, setClaiming] = (0, import_react.useState)(false); 37 const playerContainer = (0, import_react.useRef)(null); 38 const claimSubmitted = (0, import_react.useRef)(false); 39 let t0; 40 if ($[0] === Symbol.for("react.memo_cache_sentinel")) { 41 t0 = (event) => { 42 if (claimSubmitted.current) { 43 event.preventDefault(); 44 return; 45 } 46 claimSubmitted.current = true; 47 setClaiming(true); 48 }; 49 $[0] = t0; 50 } else t0 = $[0]; 51 const handleClaimSubmit = t0; 52 let t1; 53 let t2; 54 if ($[1] === Symbol.for("react.memo_cache_sentinel")) { 55 t1 = () => { 56 const container = playerContainer.current; 57 if (!container) return; 58 const youtubeWindow = window; 59 let player = null; 60 let cancelled = false; 61 const createPlayer = () => { 62 if (cancelled || !youtubeWindow.YT) return; 63 player = new youtubeWindow.YT.Player(container, { 64 videoId: VIDEO_ID, 65 playerVars: { 66 controls: 0, 67 rel: 0, 68 disablekb: 1, 69 playsinline: 1 70 }, 71 events: { onStateChange: (event_0) => { 72 if (event_0.data === youtubeWindow.YT?.PlayerState.ENDED) setVideoEnded(true); 73 } } 74 }); 75 }; 76 if (youtubeWindow.YT?.Player) { 77 createPlayer(); 78 return () => { 79 cancelled = true; 80 player?.destroy(); 81 }; 82 } 83 const previousHook = youtubeWindow.onYouTubeIframeAPIReady; 84 youtubeWindow.onYouTubeIframeAPIReady = () => { 85 previousHook?.(); 86 createPlayer(); 87 }; 88 if (!document.querySelector(`script[src="${YOUTUBE_API_SRC}"]`)) { 89 const tag = document.createElement("script"); 90 tag.src = YOUTUBE_API_SRC; 91 document.body.appendChild(tag); 92 } 93 return () => { 94 cancelled = true; 95 youtubeWindow.onYouTubeIframeAPIReady = previousHook; 96 player?.destroy(); 97 }; 98 }; 99 t2 = []; 100 $[1] = t1; 101 $[2] = t2; 102 } else { 103 t1 = $[1]; 104 t2 = $[2]; 105 } 106 (0, import_react.useEffect)(t1, t2); 107 let t3; 108 if ($[3] !== creditsBadge.credits || $[4] !== creditsBadge.kind || $[5] !== creditsBadge.searchCredits || $[6] !== creditsBadge.verifyCredits) { 109 t3 = creditsBadge.kind === "unified" ? t("devise.registrations.new.explore_intent.extra_credits_unified_html", { credits: creditsBadge.credits }) : t("devise.registrations.new.explore_intent.extra_credits_double_html", { 110 search_credits: CurrencyHelper.numberWithDelimiter(creditsBadge.searchCredits), 111 verify_credits: CurrencyHelper.numberWithDelimiter(creditsBadge.verifyCredits) 112 }); 113 $[3] = creditsBadge.credits; 114 $[4] = creditsBadge.kind; 115 $[5] = creditsBadge.searchCredits; 116 $[6] = creditsBadge.verifyCredits; 117 $[7] = t3; 118 } else t3 = $[7]; 119 const badge = t3; 120 let t4; 121 if ($[8] !== emailAddress || $[9] !== logoutPath) { 122 t4 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(OnboardingHeader, { 123 emailAddress, 124 logoutPath 125 }); 126 $[8] = emailAddress; 127 $[9] = logoutPath; 128 $[10] = t4; 129 } else t4 = $[10]; 130 let t5; 131 if ($[11] === Symbol.for("react.memo_cache_sentinel")) { 132 t5 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AccountSetupHeading, { 133 title: t("devise.registrations.new.explore_intent.title"), 134 description: t("devise.registrations.new.explore_intent.description") 135 }); 136 $[11] = t5; 137 } else t5 = $[11]; 138 let t6; 139 if ($[12] === Symbol.for("react.memo_cache_sentinel")) { 140 t6 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { 141 icon: "coin", 142 className: "extra-credits-badge__icon" 143 }); 144 $[12] = t6; 145 } else t6 = $[12]; 146 let t7; 147 if ($[13] !== badge) { 148 t7 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { 149 className: "extra-credits-badge", 150 children: [t6, badge] 151 }); 152 $[13] = badge; 153 $[14] = t7; 154 } else t7 = $[14]; 155 let t8; 156 if ($[15] === Symbol.for("react.memo_cache_sentinel")) { 157 t8 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { 158 className: "video-frame__player", 159 ref: playerContainer 160 }); 161 $[15] = t8; 162 } else t8 = $[15]; 163 const t9 = videoEnded && "is-visible"; 164 let t10; 165 if ($[16] !== t9) { 166 t10 = cn("video-frame__seen", t9); 167 $[16] = t9; 168 $[17] = t10; 169 } else t10 = $[17]; 170 let t11; 171 if ($[18] === Symbol.for("react.memo_cache_sentinel")) { 172 t11 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { 173 className: "account-setup__title", 174 children: t("devise.registrations.new.explore_intent.seen.title") 175 }); 176 $[18] = t11; 177 } else t11 = $[18]; 178 let t12; 179 if ($[19] === Symbol.for("react.memo_cache_sentinel")) { 180 t12 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { 181 className: "account-setup__description", 182 children: t("devise.registrations.new.explore_intent.seen.description") 183 }); 184 $[19] = t12; 185 } else t12 = $[19]; 186 let t13; 187 if ($[20] === Symbol.for("react.memo_cache_sentinel")) { 188 t13 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", { 189 type: "hidden", 190 name: "authenticity_token", 191 value: getCsrfToken() 192 }); 193 $[20] = t13; 194 } else t13 = $[20]; 195 let t14; 196 if ($[21] === Symbol.for("react.memo_cache_sentinel")) { 197 t14 = t("devise.registrations.new.explore_intent.seen.cta"); 198 $[21] = t14; 199 } else t14 = $[21]; 200 let t15; 201 if ($[22] !== claiming) { 202 t15 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Button, { 203 type: "submit", 204 variant: "primary", 205 disabled: claiming, 206 children: t14 207 }); 208 $[22] = claiming; 209 $[23] = t15; 210 } else t15 = $[23]; 211 let t16; 212 if ($[24] !== claimPath || $[25] !== t15) { 213 t16 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("form", { 214 action: claimPath, 215 method: "post", 216 "data-turbo": "false", 217 onSubmit: handleClaimSubmit, 218 children: [t13, t15] 219 }); 220 $[24] = claimPath; 221 $[25] = t15; 222 $[26] = t16; 223 } else t16 = $[26]; 224 let t17; 225 if ($[27] !== t10 || $[28] !== t16) { 226 t17 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { 227 className: "video-frame",
228 children: [t8, /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { 229 className: t10, 230 children: [ 231 t11, 232 t12, 233 t16 234 ] 235 })] 236 }); 237 $[27] = t10; 238 $[28] = t16; 239 $[29] = t17; 240 } else t17 = $[29]; 241 const t18 = videoEnded ? "invisible" : void 0; 242 let t19; 243 if ($[30] === Symbol.for("react.memo_cache_sentinel")) { 244 t19 = { __html: t("devise.registrations.new.explore_intent.skip_html") }; 245 $[30] = t19; 246 } else t19 = $[30]; 247 let t20; 248 if ($[31] !== skipPath) { 249 t20 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("a", { 250 href: skipPath, 251 "data-turbo": "false", 252 dangerouslySetInnerHTML: t19 253 }); 254 $[31] = skipPath; 255 $[32] = t20; 256 } else t20 = $[32]; 257 let t21; 258 if ($[33] !== t18 || $[34] !== t20) { 259 t21 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Button, { 260 asChild: true, 261 className: t18, 262 children: t20 263 }); 264 $[33] = t18; 265 $[34] = t20; 266 $[35] = t21; 267 } else t21 = $[35]; 268 let t22; 269 if ($[36] !== t17 || $[37] !== t21 || $[38] !== t7) { 270 t22 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { 271 className: "account-setup account-setup--explore", 272 children: [ 273 t5, 274 t7, 275 t17, 276 t21 277 ] 278 }); 279 $[36] = t17; 280 $[37] = t21; 281 $[38] = t7; 282 $[39] = t22; 283 } else t22 = $[39]; 284 let t23; 285 if ($[40] !== t22 || $[41] !== t4) { 286 t23 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [t4, t22] }); 287 $[40] = t22; 288 $[41] = t4; 289 $[42] = t23; 290 } else t23 = $[42]; 291 return t23; 292} 293var import_compiler_runtime, import_react, import_jsx_runtime, YOUTUBE_API_SRC, VIDEO_ID; 294function init_Explore() { 295 return (init_Explore = __esmMin((() => { 296 import_compiler_runtime = require_compiler_runtime(); 297 import_react = require_react(); 298 init_dist(); 299 init_utils(); 300 init_OnboardingLayout(); 301 init_AccountSetup(); 302 init_OnboardingHeader(); 303 init_i18n(); 304 init_button(); 305 init_icon(); 306 init_currency_helper(); 307 import_jsx_runtime = require_jsx_runtime(); 308 YOUTUBE_API_SRC = "https://www.youtube.com/iframe_api"; 309 VIDEO_ID = "wVdksAFx5C0"; 310 Explore.layout = (page) => (0, import_react.createElement)(OnboardingLayout, null, page); 311 })))(); 312} 313//#endregion 314init_Explore(); 315export { Explore as default };
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.