{"version":3,"file":"competition-components-f5f6qzWE.js","sources":["../../../../node_modules/.pnpm/react-error-boundary@5.0.0_react@18.3.1/node_modules/react-error-boundary/dist/react-error-boundary.esm.js","../../../app/frontend/competion-components/hooks/useCurrentUser.ts","../../../app/frontend/shared/bugsnag.tsx","../../../app/frontend/competion-components/hooks/useRegistration.ts","../../../app/frontend/competion-components/hooks/useApolloClient.ts","../../../app/frontend/competion-components/AuthWidget/Form.tsx","../../../app/frontend/competion-components/AuthWidget/index.tsx","../../../app/frontend/competion-components/RegistrationWizard/UI/Form/components/Input.tsx","../../../../node_modules/.pnpm/@uploadcare+react-uploader@1.5.0_@types+react@18.3.18_next@15.2.1_@babel+core@7.26.9_react-do_5umj6ycjakdffabweisnyqczj4/node_modules/@uploadcare/react-uploader/dist/useIsBrowser-CGfWUmB6.js","../../../../node_modules/.pnpm/@uploadcare+react-uploader@1.5.0_@types+react@18.3.18_next@15.2.1_@babel+core@7.26.9_react-do_5umj6ycjakdffabweisnyqczj4/node_modules/@uploadcare/react-uploader/dist/FileUploaderRegular-BpoBQoe3.js","../../../../node_modules/.pnpm/@uploadcare+react-uploader@1.5.0_@types+react@18.3.18_next@15.2.1_@babel+core@7.26.9_react-do_5umj6ycjakdffabweisnyqczj4/node_modules/@uploadcare/react-uploader/dist/FileUploaderMinimal-DAz7Oga6.js","../../../../node_modules/.pnpm/@uploadcare+react-uploader@1.5.0_@types+react@18.3.18_next@15.2.1_@babel+core@7.26.9_react-do_5umj6ycjakdffabweisnyqczj4/node_modules/@uploadcare/react-uploader/dist/FileUploaderInline-5wOrjEmA.js","../../../app/frontend/competion-components/RegistrationWizard/UI/Form/components/ImageUpload.tsx","../../../app/frontend/competion-components/RegistrationWizard/UI/Form/components/BasicInfo.tsx","../../../app/frontend/competion-components/RegistrationWizard/constants.ts","../../../app/frontend/competion-components/RegistrationWizard/UI/Form/components/PerformanceLinks.tsx","../../../app/frontend/competion-components/RegistrationWizard/UI/Form/components/TextArea.tsx","../../../app/frontend/competion-components/RegistrationWizard/UI/Form/components/SocialMediaProfiles.tsx","../../../app/frontend/competion-components/RegistrationWizard/UI/Form/components/NavigationButtons.tsx","../../../app/frontend/competion-components/RegistrationWizard/UI/Form/components/About.tsx","../../../app/frontend/competion-components/RegistrationWizard/UI/Form/index.tsx","../../../app/frontend/competion-components/RegistrationWizard/types.ts","../../../app/frontend/competion-components/RegistrationWizard/UI/index.tsx","../../../app/frontend/competion-components/RegistrationWizard/index.tsx","../../../app/frontend/competion-components/AuthWidget/LogoutButton.tsx","../../../app/frontend/competion-components/Navigation/index.tsx","../../../app/frontend/competion-components/CountdownClock/index.tsx","../../../app/frontend/shared/components/Share/index.tsx","../../../app/frontend/competion-components/types.ts","../../../app/frontend/competion-components/VotingWidget/contexts/index.ts","../../../app/frontend/competion-components/VotingWidget/contexts/PersistentStorage.ts","../../../app/frontend/competion-components/VotingWidget/contexts/VoteIntentProxy.ts","../../../app/frontend/competion-components/VotingWidget/hooks/useCreateVote.ts","../../../app/frontend/competion-components/VotingWidget/hooks/useUpdateVote.ts","../../../app/frontend/competion-components/VotingWidget/hooks/useVoteIntentContext.ts","../../../app/frontend/competion-components/VotingWidget/contexts/Provider.tsx","../../../app/frontend/competion-components/hooks/useAnchor.ts","../../../app/frontend/competion-components/VotingWidget/hooks/useVoteIntent.ts","../../../app/frontend/competion-components/VotingWidget/Content/Card.tsx","../../../../node_modules/.pnpm/@stripe+stripe-js@4.10.0/node_modules/@stripe/stripe-js/dist/index.mjs","../../../../node_modules/.pnpm/@stripe+react-stripe-js@2.9.0_@stripe+stripe-js@4.10.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@stripe/react-stripe-js/dist/react-stripe.esm.mjs","../../../app/frontend/competion-components/StripeCheckout/create-payment-intent.ts","../../../app/frontend/competion-components/StripeCheckout/Form.tsx","../../../app/frontend/competion-components/StripeCheckout/index.tsx","../../../app/frontend/competion-components/VotingWidget/Content/Panel.tsx","../../../app/frontend/competion-components/VotingWidget/Content/index.tsx","../../../app/frontend/competion-components/VotingWidget/index.tsx","../../../app/frontend/shared/analytics/zaraz.ts","../../../app/frontend/entrypoints/competition-components.js"],"sourcesContent":["'use client';\nimport { createContext, Component, createElement, useContext, useState, useMemo, forwardRef } from 'react';\n\nconst ErrorBoundaryContext = createContext(null);\n\nconst initialState = {\n didCatch: false,\n error: null\n};\nclass ErrorBoundary extends Component {\n constructor(props) {\n super(props);\n this.resetErrorBoundary = this.resetErrorBoundary.bind(this);\n this.state = initialState;\n }\n static getDerivedStateFromError(error) {\n return {\n didCatch: true,\n error\n };\n }\n resetErrorBoundary() {\n const {\n error\n } = this.state;\n if (error !== null) {\n var _this$props$onReset, _this$props;\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n (_this$props$onReset = (_this$props = this.props).onReset) === null || _this$props$onReset === void 0 ? void 0 : _this$props$onReset.call(_this$props, {\n args,\n reason: \"imperative-api\"\n });\n this.setState(initialState);\n }\n }\n componentDidCatch(error, info) {\n var _this$props$onError, _this$props2;\n (_this$props$onError = (_this$props2 = this.props).onError) === null || _this$props$onError === void 0 ? void 0 : _this$props$onError.call(_this$props2, error, info);\n }\n componentDidUpdate(prevProps, prevState) {\n const {\n didCatch\n } = this.state;\n const {\n resetKeys\n } = this.props;\n\n // There's an edge case where if the thing that triggered the error happens to *also* be in the resetKeys array,\n // we'd end up resetting the error boundary immediately.\n // This would likely trigger a second error to be thrown.\n // So we make sure that we don't check the resetKeys on the first call of cDU after the error is set.\n\n if (didCatch && prevState.error !== null && hasArrayChanged(prevProps.resetKeys, resetKeys)) {\n var _this$props$onReset2, _this$props3;\n (_this$props$onReset2 = (_this$props3 = this.props).onReset) === null || _this$props$onReset2 === void 0 ? void 0 : _this$props$onReset2.call(_this$props3, {\n next: resetKeys,\n prev: prevProps.resetKeys,\n reason: \"keys\"\n });\n this.setState(initialState);\n }\n }\n render() {\n const {\n children,\n fallbackRender,\n FallbackComponent,\n fallback\n } = this.props;\n const {\n didCatch,\n error\n } = this.state;\n let childToRender = children;\n if (didCatch) {\n const props = {\n error,\n resetErrorBoundary: this.resetErrorBoundary\n };\n if (typeof fallbackRender === \"function\") {\n childToRender = fallbackRender(props);\n } else if (FallbackComponent) {\n childToRender = createElement(FallbackComponent, props);\n } else if (fallback !== undefined) {\n childToRender = fallback;\n } else {\n throw error;\n }\n }\n return createElement(ErrorBoundaryContext.Provider, {\n value: {\n didCatch,\n error,\n resetErrorBoundary: this.resetErrorBoundary\n }\n }, childToRender);\n }\n}\nfunction hasArrayChanged() {\n let a = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n let b = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n return a.length !== b.length || a.some((item, index) => !Object.is(item, b[index]));\n}\n\nfunction assertErrorBoundaryContext(value) {\n if (value == null || typeof value.didCatch !== \"boolean\" || typeof value.resetErrorBoundary !== \"function\") {\n throw new Error(\"ErrorBoundaryContext not found\");\n }\n}\n\nfunction useErrorBoundary() {\n const context = useContext(ErrorBoundaryContext);\n assertErrorBoundaryContext(context);\n const [state, setState] = useState({\n error: null,\n hasError: false\n });\n const memoized = useMemo(() => ({\n resetBoundary: () => {\n context.resetErrorBoundary();\n setState({\n error: null,\n hasError: false\n });\n },\n showBoundary: error => setState({\n error,\n hasError: true\n })\n }), [context.resetErrorBoundary]);\n if (state.hasError) {\n throw state.error;\n }\n return memoized;\n}\n\nfunction withErrorBoundary(component, errorBoundaryProps) {\n const Wrapped = forwardRef((props, ref) => createElement(ErrorBoundary, errorBoundaryProps, createElement(component, {\n ...props,\n ref\n })));\n\n // Format for display in DevTools\n const name = component.displayName || component.name || \"Unknown\";\n Wrapped.displayName = \"withErrorBoundary(\".concat(name, \")\");\n return Wrapped;\n}\n\nexport { ErrorBoundary, ErrorBoundaryContext, useErrorBoundary, withErrorBoundary };\n","import { ApolloClient, NormalizedCacheObject } from \"@apollo/client\"\nimport { useCallback } from \"react\"\n\nimport { USER_QUERY } from \"../gql\";\nimport { User } from \"../types\";\n\nexport interface GetUserByIdProps {\n id: string | undefined | null;\n options?: { enabled?: boolean };\n}\n\nexport type HydrateCurrentUser = (id?: string, options?: GetUserByIdProps['options']) => Promise<{ data: User | null, error: any }>\n\nexport const useCurrentUser = (client?: ApolloClient) => {\n const setCurrentUser = useCallback((user: User) => {\n if (!user) {\n localStorage.removeItem('user')\n return\n }\n\n localStorage.setItem('user', JSON.stringify(user))\n\n return user\n }, [])\n\n const getCurrentUser = useCallback(() => {\n const json = localStorage.getItem('user')\n const user = json ? JSON.parse(json) : null\n\n return user\n }, [])\n\n const resetCurrentUser = useCallback((user?: User) => {\n setCurrentUser(user)\n }, [])\n\n const hydrateCurrentUser: HydrateCurrentUser = useCallback(\n async function hydrateCurrentUser(id, options) {\n if (!client) throw new Error('Apollo client is required')\n \n try {\n if (options && options.enabled === false) {\n return { data: null, error: null }\n }\n \n if (!id) throw new Error('current user id is required')\n\n const { data, error } = await client.query({\n query: USER_QUERY,\n variables: { id }\n })\n \n if (error) throw error\n \n const { User: user } = data\n \n setCurrentUser(user)\n \n return {\n data: user,\n error: null\n }\n } catch(e) {\n console.log('error hydrating current user. resetting store', e)\n \n resetCurrentUser()\n \n return {\n data: null,\n error: e\n }\n }\n }\n , [client]\n )\n\n const currentUser = getCurrentUser()\n\n return {\n currentUser,\n authenticated: !!currentUser?.id,\n hydrate: hydrateCurrentUser,\n reset: resetCurrentUser,\n set: setCurrentUser,\n get: getCurrentUser\n }\n}\n","import { NotifiableError, Event } from \"@bugsnag/js\";\nimport React from \"react\";\n\ndeclare global {\n interface Window {\n Bugsnag?: any;\n }\n}\n\nexport const bugsnagEnabled = !!window.Bugsnag;\n\nimport { ReactNode } from \"react\";\nimport { ErrorBoundary, FallbackProps } from \"react-error-boundary\";\nimport { useCurrentUser } from \"../competion-components/hooks/useCurrentUser\";\n\ntype OnErrorCallback = (...args: any[]) => void | any;\ntype FallbackRenderer = (props: FallbackProps) => ReactNode;\n\nexport const CrashErrorBoundary = ({\n children,\n FallbackComponent = ErrorFallback,\n}: {\n children?: any;\n onError?: OnErrorCallback;\n FallbackComponent?: FallbackRenderer;\n}) => {\n const { currentUser } = useCurrentUser();\n\n const onError = (error: Error, _info: { componentStack: string }) => {\n notifyError(error, (event) => {\n event.setUser(currentUser?.id, currentUser?.email, currentUser?.name);\n });\n };\n\n return (\n \n {children}\n \n );\n};\n\nexport const notifyError = (\n error: NotifiableError,\n onError?: OnErrorCallback,\n postReportCallback?: (err: any, event: Event) => void\n) => {\n if (bugsnagEnabled) {\n console.log(\"Notifying Bugsnag of error\", error);\n window.Bugsnag.notify(error, onError, postReportCallback);\n } else {\n console.error(\n \"Bugsnag API key not found, skipping Bugsnag notification\",\n error\n );\n }\n};\n\n// NOTE: ChatGPT generated this component for you.\n\nexport const ErrorFallback = ({ error, resetErrorBoundary }: FallbackProps) => {\n return (\n
\n

Oops! Something went wrong.

\n

\n We’re sorry, but something went wrong while loading this page. Please\n try refreshing, or contact support if the issue persists.\n

\n window.location.reload())}\n >\n Reload Page\n \n {error && (\n
\n More information\n

{error.message}

\n
\n )}\n
\n );\n};\n\nconst styles = {\n container: {\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n justifyContent: \"center\",\n padding: \"2rem\",\n textAlign: \"center\",\n backgroundColor: \"#f8f9fa\",\n color: \"#333\",\n borderRadius: \"8px\",\n boxShadow: \"0 4px 8px rgba(0, 0, 0, 0.1)\",\n maxWidth: \"500px\",\n margin: \"10% auto 10%\",\n // marginTop: '10%',\n // height: '10% auto 10%'\n },\n title: {\n fontSize: \"1.5rem\",\n marginBottom: \"1rem\",\n },\n message: {\n fontSize: \"1rem\",\n marginBottom: \"1.5rem\",\n },\n button: {\n padding: \"0.75rem 1.5rem\",\n fontSize: \"1rem\",\n backgroundColor: \"#1890ff\", // (global / bootstrap primary)\n color: \"#fff\",\n border: \"none\",\n borderRadius: \"4px\",\n cursor: \"pointer\",\n },\n details: {\n marginTop: \"1rem\",\n fontSize: \"0.875rem\",\n color: \"#666\",\n },\n messageDetails: {\n marginTop: \"1rem\",\n },\n};\n","import { useCallback } from \"react\";\nimport { ApolloClient, NormalizedCacheObject } from \"@apollo/client/core\";\n\nimport {\n RegisterCompetitorMutationDocument,\n UpdateUserMutationDocument,\n} from \"../gql\";\nimport { RegisterCompetitorArgs } from \"../RegistrationWizard/types\";\n\nexport type RegisterCompetitor = ({\n competitionId,\n competitorData,\n}: RegisterCompetitorArgs) => Promise<{ data: any; errors: any }>;\n\nexport const useRegistration = (\n client: ApolloClient\n) => {\n const registerCompetitor: RegisterCompetitor = useCallback(\n async ({ competitionId, competitorData }) => {\n const { phone, email, birthday, name, competitorName, ...rest } =\n competitorData;\n await client.mutate({\n mutation: UpdateUserMutationDocument,\n variables: {\n id: competitorData.userId,\n name,\n email,\n phone,\n birthday,\n },\n });\n const { data, errors } = await client.mutate({\n mutation: RegisterCompetitorMutationDocument,\n variables: {\n competitionId,\n name: competitorName,\n ...rest,\n },\n });\n return { data, errors };\n },\n [client]\n );\n\n return {\n registerCompetitor,\n };\n};\n","import { useMemo } from \"react\";\nimport { ApolloClient, InMemoryCache } from \"@apollo/client/core\";\n\nexport const useApolloClient = (uri: string) => {\n const client = useMemo(() => {\n return new ApolloClient({\n uri,\n headers: {\n \"Content-Type\": \"application/json\"\n },\n cache: new InMemoryCache(),\n defaultOptions: {\n query: {\n fetchPolicy: 'no-cache'\n }\n }\n });\n }, [uri])\n\n return client;\n}","import { useServerRedirectSearchParams } from \"../../shared/hooks/useServerRedirectSearchParams\";\nimport { AuthWidgetProps } from \".\";\nimport { useProviders } from \"../../shared/hooks/useProviders\";\nimport { useEffect, useState } from \"react\";\nimport { OAuthButtons } from \"../../DashApp/Auth/LoginPage/OAuthButtons\";\n\nexport interface AuthFormProps\n extends Omit {}\n\nexport const AuthForm = ({ header, subheader, oauth }: AuthFormProps) => {\n const [errors, setErrors] = useState<{ key: string; msg: string }[]>();\n const { errors: serverRenderedErrors } = useServerRedirectSearchParams({\n removeParamsOnMount: true,\n });\n\n const { oauth: oauthProviders } = useProviders({\n enabled: oauth.enabledProviders,\n configured: oauth.configuredProviders,\n hidden: oauth.disabledProviders,\n });\n\n const onCustomLoginSuccess = ({ id }) => {\n const url = new URL(window.location.href);\n url.searchParams.set(\"user\", id);\n window.location.href = url.toString();\n };\n\n const onCustomLoginErrors = (errors) => {\n setErrors([{ key: \"Login Error\", msg: errors.first?.message }]);\n };\n\n const renderErrors = () => {\n if (!errors) return null;\n\n // NOTE: tailwind classes aren't working. add MUI colors for now\n const errorStyles = {\n backgroundColor: \"#fdeded\",\n color: \"#5f2120\",\n };\n return (\n
\n {errors.map(({ key, msg }) => (\n \n {key}\n
{msg}
\n
\n ))}\n \n );\n };\n\n const providers = oauthProviders.map((provider) => ({\n ...provider,\n path: `${oauth?.requestUrl || \"\"}${provider.path}${oauth?.redirectUrl ? `/?origin=${oauth.redirectUrl}` : \"\"}`,\n }));\n\n useEffect(() => {\n setErrors(serverRenderedErrors);\n }, [serverRenderedErrors]);\n\n return (\n <>\n
\n {header && (\n

\n {header}\n

\n )}\n {subheader &&

{subheader}

}\n
\n
\n {errors && renderErrors()}\n \n
\n

\n By signing up, you agree to the{\" \"}\n \n Terms of Use\n {\" \"}\n and{\" \"}\n \n Privacy Policy\n \n .\n

\n \n );\n};\n","import { AuthForm } from \"./Form\";\n\nexport interface OAuthCredentials {\n [provider: string]: {\n APP_ID?: string;\n }\n}\n\nexport interface AuthWidgetProps {\n oauth: {\n requestUrl?: string;\n redirectUrl?: string;\n enabledProviders: any[];\n configuredProviders: any[];\n disabledProviders?: any[];\n credentials?: OAuthCredentials\n };\n header?: string;\n open?: boolean;\n onClose?: () => void;\n subheader?: string;\n type: \"embed\" | \"modal\";\n}\n\nexport const AuthWidget = ({\n header = \"Register or Login with Existing Account\",\n subheader,\n oauth,\n open = false,\n onClose,\n type = \"embed\",\n}: AuthWidgetProps) => {\n if (type === \"embed\") {\n return (\n
\n \n
\n );\n }\n\n if (!open) return null;\n\n return (\n onClose && onClose()}\n >\n e.stopPropagation()} // Prevent clicks on the modal from closing it\n >\n \n \n \n );\n};\n","import React, { forwardRef } from 'react';\n\nexport interface InputProps {\n dataTestId?: string;\n defaultValue?: string;\n helperText?: string | React.ReactNode;\n error?: string;\n id?: string;\n label?: string;\n name?: string;\n required?: boolean;\n type?: string;\n className?: string;\n onChange?: (e: React.ChangeEvent) => void;\n value?: string;\n pattern?: string;\n title?: string;\n max?: string | number;\n min?: string | number;\n placeholder?: string;\n}\n\nexport const Input = forwardRef(({\n dataTestId,\n defaultValue,\n helperText,\n error,\n id,\n label,\n name,\n type = \"text\",\n required = false,\n className,\n onChange,\n value,\n pattern,\n title,\n max,\n min,\n placeholder\n}: InputProps, ref: React.Ref) => {\n const formatPhoneNumber = (value: string) => {\n // Remove all non-digits\n const digits = value.replace(/\\D/g, '');\n \n // Format the number\n if (digits.length <= 3) {\n return digits;\n } else if (digits.length <= 6) {\n return `(${digits.slice(0,3)}) ${digits.slice(3)}`;\n } else {\n return `(${digits.slice(0,3)}) ${digits.slice(3,6)}-${digits.slice(6,10)}`;\n }\n };\n\n const handleChange = (e: React.ChangeEvent) => {\n if (type === 'tel') {\n const formattedValue = formatPhoneNumber(e.target.value);\n e.target.value = formattedValue;\n }\n onChange?.(e);\n };\n\n return (\n
\n {label ? (\n \n ) : null}\n \n {error ? (\n

\n \n \n \n {error}\n

\n ) : helperText ? (\n

{helperText}

\n ) : null}\n
\n );\n});\n","import P, { useState as w, useEffect as y } from \"react\";\nimport * as v from \"@uploadcare/file-uploader\";\nconst b = /* @__PURE__ */ new Set([\n \"children\",\n \"ref\",\n \"style\",\n \"className\"\n]), A = (e = {}) => Object == null ? void 0 : Object.keys(e).reduce((n, o) => {\n var s, t;\n const r = e == null ? void 0 : e[o], a = `on${(t = (s = r == null ? void 0 : r.split(\"-\")) == null ? void 0 : s.map((c) => c.charAt(0).toUpperCase() + c.slice(1))) == null ? void 0 : t.join(\"\")}`;\n return n[a] = r, n;\n}, {}), m = /* @__PURE__ */ new WeakMap(), M = (e) => {\n let n = m.get(e);\n return n === void 0 && (n = /* @__PURE__ */ new Map(), m.set(e, n)), n;\n}, E = ({\n node: e,\n nameProp: n,\n valueProp: o,\n prevValueProp: s,\n event: t\n}) => {\n if (t !== void 0) {\n if (o !== s) {\n const r = M(e), a = r.has(t);\n let c = r.get(t);\n o !== void 0 ? a ? c.handleEvent = o : (c = { handleEvent: o }, r.set(t, c), e.addEventListener(\n t,\n (u) => c.handleEvent(u.detail)\n )) : a && (r.delete(t), e.removeEventListener(t, c));\n }\n return;\n }\n e[n] = o, o == null && n in HTMLElement.prototype && e.removeAttribute(n);\n}, O = (e, n, o) => {\n const s = {}, t = {};\n return Object.entries(e).forEach(([r, a]) => {\n b.has(r) ? s[r === \"className\" ? \"class\" : r] = a : n.has(r) || r in o.prototype ? t[r] = a : s[r] = a;\n }), { reactProps: s, customElProps: t };\n}, g = ({\n react: e,\n // https://react.dev/warnings/invalid-hook-call-warning\n tag: n,\n elClass: o,\n schemaEvents: s\n}) => {\n const t = A(s), r = new Set(Object.keys(t ?? {})), a = e.forwardRef(\n (c, u) => {\n const i = e.useRef(/* @__PURE__ */ new Map()), d = e.useRef(null), { reactProps: h, customElProps: f } = O(c, r, o);\n return e.useLayoutEffect(() => {\n if (d.current === null)\n return;\n const p = /* @__PURE__ */ new Map();\n for (const l in f)\n E({\n node: d.current,\n nameProp: l,\n valueProp: f[l],\n prevValueProp: i.current.get(l),\n event: t[l]\n }), i.current.delete(l), p.set(l, c[l]);\n for (const [l, C] of i.current)\n E({\n node: d.current,\n nameProp: l,\n valueProp: void 0,\n prevValueProp: C,\n event: t[l]\n });\n i.current = p;\n }), e.createElement(n ?? o.__tag, {\n ...h,\n ref: e.useCallback(\n (p) => {\n d.current = p, typeof u == \"function\" ? u(p) : u !== null && (u.current = p);\n },\n [u]\n )\n });\n }\n );\n return a.displayName = o.name, a;\n}, x = g({\n react: P,\n tag: \"uc-config\",\n elClass: v.Config\n}), R = g({\n react: P,\n tag: \"uc-upload-ctx-provider\",\n elClass: v.UploadCtxProvider,\n schemaEvents: v.UploadCtxProvider.EventType\n}), k = (e) => {\n const n = {}, o = {}, s = {};\n for (const [t, r] of Object.entries(e)) {\n if (t.startsWith(\"on\")) {\n n[t] = r;\n continue;\n }\n if (t === \"headless\") {\n s[t] = r;\n continue;\n }\n o[t] = r;\n }\n return {\n eventHandlers: n,\n uploader: s,\n config: o\n };\n}, U = \"1.4.0\", j = \"React-Uploader\", I = () => `${j}/${U}`, L = ({ children: e }) => e, S = () => {\n const [e, n] = w(!1);\n return y(() => {\n typeof window < \"u\" && n(!0);\n }, []), e;\n};\nexport {\n x as A,\n L as C,\n I as a,\n g as b,\n R as c,\n k as g,\n S as u\n};\n","import e, { useMemo as o } from \"react\";\nimport * as r from \"@uploadcare/file-uploader\";\nimport { b as u, g as f, u as C, C as A, A as U, a as E, c as x } from \"./useIsBrowser-CGfWUmB6.js\";\nr.defineComponents(r);\nconst I = u({\n react: e,\n tag: \"uc-file-uploader-regular\",\n elClass: r.FileUploaderRegular\n}), F = ({\n ctxName: a,\n className: s,\n classNameUploader: l,\n apiRef: c,\n fallback: i,\n ...n\n}) => {\n const t = o(() => a ?? r.UID.generate(), [a]), { eventHandlers: d, config: g, uploader: m } = o(\n () => f(n),\n [n]\n ), p = C();\n return /* @__PURE__ */ e.createElement(A, { condition: p, fallback: i }, /* @__PURE__ */ e.createElement(\"div\", { className: s }, /* @__PURE__ */ e.createElement(U, { userAgentIntegration: E(), \"ctx-name\": t, ...g }), /* @__PURE__ */ e.createElement(\n x,\n {\n ref: c,\n \"ctx-name\": t,\n ...d\n }\n ), /* @__PURE__ */ e.createElement(I, { class: l, \"ctx-name\": t, ...m })));\n};\nexport {\n F as FileUploaderRegular\n};\n","import e, { useMemo as o } from \"react\";\nimport * as t from \"@uploadcare/file-uploader\";\nimport { b as g, g as f, u as C, C as u, A, a as U, c as E } from \"./useIsBrowser-CGfWUmB6.js\";\nt.defineComponents(t);\nconst M = g({\n react: e,\n tag: \"uc-file-uploader-minimal\",\n elClass: t.FileUploaderMinimal\n}), v = ({\n ctxName: n,\n className: s,\n classNameUploader: i,\n apiRef: l,\n fallback: c,\n ...r\n}) => {\n const a = o(() => n ?? t.UID.generate(), [n]), { eventHandlers: m, config: d } = o(\n () => f(r),\n [r]\n ), p = C();\n return /* @__PURE__ */ e.createElement(u, { condition: p, fallback: c }, /* @__PURE__ */ e.createElement(\"div\", { className: s }, /* @__PURE__ */ e.createElement(A, { userAgentIntegration: U(), \"ctx-name\": a, ...d }), /* @__PURE__ */ e.createElement(\n E,\n {\n ref: l,\n \"ctx-name\": a,\n ...m\n }\n ), /* @__PURE__ */ e.createElement(M, { class: i, \"ctx-name\": a })));\n};\nexport {\n v as FileUploaderMinimal\n};\n","import e, { useMemo as o } from \"react\";\nimport * as t from \"@uploadcare/file-uploader\";\nimport { b as g, g as f, u as C, C as u, A, a as U, c as E } from \"./useIsBrowser-CGfWUmB6.js\";\nt.defineComponents(t);\nconst I = g({\n react: e,\n tag: \"uc-file-uploader-inline\",\n elClass: t.FileUploaderMinimal\n}), F = ({\n ctxName: r,\n className: s,\n classNameUploader: i,\n apiRef: l,\n fallback: c,\n ...a\n}) => {\n const n = o(() => r ?? t.UID.generate(), [r]), { eventHandlers: m, config: d } = o(\n () => f(a),\n [a]\n ), p = C();\n return /* @__PURE__ */ e.createElement(u, { condition: p, fallback: c }, /* @__PURE__ */ e.createElement(\"div\", { className: s }, /* @__PURE__ */ e.createElement(A, { userAgentIntegration: U(), \"ctx-name\": n, ...d }), /* @__PURE__ */ e.createElement(\n E,\n {\n ref: l,\n \"ctx-name\": n,\n ...m\n }\n ), /* @__PURE__ */ e.createElement(I, { class: i, \"ctx-name\": n })));\n};\nexport {\n F as FileUploaderInline\n};\n","import { forwardRef, useState, useMemo } from \"react\";\nimport type { Ref } from \"react\";\nimport { FileUploaderRegular } from \"@uploadcare/react-uploader\";\nimport \"@uploadcare/react-uploader/core.css\";\n\ntype UploadcareFile = {\n uuid: string;\n cdnUrl: string;\n};\n\ninterface ImageUploadProps {\n cropPreset?: string;\n dataTestId?: string;\n multiple?: boolean;\n name: string;\n uploadcareKey: string;\n onChange?: (\n value: string | { target: { name: string; value: string } }\n ) => void;\n setValue?: (name: string, value: string) => void;\n}\n\nexport const ImageUpload = forwardRef(\n (\n {\n cropPreset,\n dataTestId,\n multiple = false,\n name,\n onChange,\n setValue,\n uploadcareKey,\n }: ImageUploadProps,\n ref: Ref\n ) => {\n const [files, setFiles] = useState([]);\n\n const aspectRatio = useMemo(() => {\n if (!cropPreset) return 1; // square default\n const [width, height] = cropPreset.split(\":\").map(Number);\n return width / height;\n }, [cropPreset]);\n\n const updateValue = (newFiles: UploadcareFile[]) => {\n const fileValue = newFiles.map((file) => file.cdnUrl).join(\",\");\n\n // Update ref\n if (ref && typeof ref === \"object\" && ref.current) {\n ref.current.value = fileValue;\n }\n\n // Call setValue if provided\n if (setValue) {\n setValue(name, fileValue);\n }\n\n // Call onChange if provided\n if (onChange) {\n onChange({\n target: {\n name,\n value: fileValue,\n },\n });\n }\n };\n\n const onFileUrlChanged = (output: UploadcareFile) => {\n setFiles((currentFiles: UploadcareFile[]) => {\n let newFiles: UploadcareFile[];\n\n if (!multiple) {\n newFiles = [output];\n } else {\n const existingFileIndex = currentFiles.findIndex(\n (file: UploadcareFile) => file.uuid === output.uuid\n );\n\n if (existingFileIndex >= 0) {\n newFiles = [...currentFiles];\n newFiles[existingFileIndex] = output;\n } else {\n newFiles = [...currentFiles, output];\n }\n }\n\n // Update form values immediately after state update\n updateValue(newFiles);\n return newFiles;\n });\n };\n\n return (\n
\n \n\n {files.length > 0 && (\n
\n {files.map((file: UploadcareFile) => (\n \n \n
\n ))}\n
\n )}\n\n file.cdnUrl).join(\",\")}\n ref={ref}\n />\n \n );\n }\n);\n","import type {\n UseFormRegister,\n FieldErrors,\n UseFormSetValue,\n UseFormWatch,\n} from \"react-hook-form\";\nimport { Input } from \"./Input\";\nimport type { Input as RegistrationInput } from \"../../../types\";\nimport { User } from \"../../../../types\";\nimport { ImageUpload } from \"./ImageUpload\";\nimport { BooleanInput } from \"react-admin\";\n\nclass STRINGS {\n static SMS_DISCLOSURE = (\n <>\n When you provide us with your mobile number and submit this form, you\n agree to receive recurring automated marketing text messages (e.g. voting\n reminders and competition updates) from Elevate Global, Inc. on behalf of\n Next Music Star at the phone number provided. Message frequency varies.\n Message and data rates may apply. Reply HELP for help and STOP to cancel.\n View our{\" \"}\n \n Terms of Use\n {\" \"}\n and{\" \"}\n \n Privacy Policy\n \n .\n \n );\n // WAS:\n // \"When you provide us with your mobile number, you agree that we may send you text messages to that phone number about the competition. Message frequency varies. Message and data rates may apply. You can reply STOP to unsubscribe or HELP for help.\"\n}\ninterface BasicInfoProps {\n currentUser: User;\n competitionId: string;\n registrationSettings: Record;\n register: UseFormRegister;\n errors: FieldErrors;\n setValue: UseFormSetValue;\n watch: UseFormWatch;\n uploadcareKey: string;\n}\n\nconst AGE_OPTIONS = [\n { label: \"Over 18\", value: \"over18\" },\n { label: \"Between 13 and 18\", value: \"under18\" },\n { label: \"Under 13\", value: \"under13\" },\n];\n\nexport const BasicInfo = ({\n currentUser,\n competitionId,\n registrationSettings,\n errors,\n register,\n setValue,\n uploadcareKey,\n watch,\n}: BasicInfoProps) => {\n const age = watch(\"age\");\n\n return (\n \n

\n Basic Information\n

\n
\n {currentUser ? (\n \n ) : null}\n \n {currentUser ? (\n \n ) : null}\n {currentUser ? (\n \n ) : null}\n \n {registrationSettings.phone !== \"hidden\" && (\n
\n \n
\n )}\n {registrationSettings.profile_picture !== \"hidden\" ? (\n
\n \n

\n This photo will be used on your competitor profile page. The photo\n will be cropped to a 1:1 aspect ratio.\n

\n
\n \n {errors?.profileImage && (\n

\n \n \n \n {errors.profileImage.message || \"This field is required\"}\n

\n )}\n
\n
\n ) : null}\n {registrationSettings.birthdate !== \"hidden\" && (\n
\n \n Age\n *\n \n

\n You must be at least 13 years old to compete at the time of sign\n up.\n

\n
\n \n {AGE_OPTIONS.map((option) => (\n \n ))}\n \n {errors.age && (\n

\n \n \n \n {errors.age.message || \"This field is required\"}\n

\n )}\n {age === \"under18\" && (\n \n )}\n
\n
\n )}\n
\n \n );\n};\n","export const FORM_DATA_KEY = \"app_form_local_data\";\nexport const FORM_STEP_KEY = \"app_form_step\";\n\nexport const SOCIAL_MEDIA = [\n {\n key: \"instagram\",\n name: \"Instagram\",\n url: \"instagram.com/\",\n placeholder: \"username\",\n },\n {\n key: \"tiktok\",\n name: \"TikTok\",\n url: \"tiktok.com/\",\n placeholder: \"username\",\n },\n {\n key: \"facebook\",\n name: \"Facebook\",\n url: \"facebook.com/\",\n placeholder: \"username\",\n },\n {\n key: \"x\",\n name: \"X\",\n url: \"x.com/\",\n placeholder: \"username\",\n },\n {\n key: \"youtube\",\n name: \"YouTube\",\n url: \"youtube.com/\",\n placeholder: \"username\",\n },\n {\n key: \"bandcamp\",\n name: \"Bandcamp\",\n url: \"bandcamp.com/\",\n placeholder: \"username\",\n },\n {\n key: \"spotify\",\n name: \"Spotify\",\n url: \"spotify.com/\",\n placeholder: \"username\",\n },\n {\n key: \"soundcloud\",\n name: \"SoundCloud\",\n url: \"soundcloud.com/\",\n placeholder: \"username\",\n },\n {\n key: \"website\",\n name: \"Website\",\n url: \"\",\n placeholder: \"https://example.com\",\n },\n];\n\nexport const PERFORMANCE_PROVIDERS = {\n iheart: {\n name: \"iHeartRadio\",\n hosts: [\"iheart.com\", \"m.iheart.com\"],\n },\n youtube: {\n name: \"YouTube\",\n hosts: [\"youtube.com\", \"youtu.be\", \"m.youtube.com\"],\n },\n tiktok: {\n name: \"TikTok\",\n hosts: [\"tiktok.com\", \"vm.tiktok.com\", \"vt.tiktok.com\"],\n },\n instagram: {\n name: \"Instagram\",\n hosts: [\"instagram.com\", \"instagr.am\"],\n },\n spotify: {\n name: \"Spotify\",\n hosts: [\"spotify.com\", \"spoti.fi\", \"open.spotify.com\"],\n },\n soundcloud: {\n name: \"SoundCloud\",\n hosts: [\"soundcloud.com\", \"m.soundcloud.com\"],\n },\n bandcamp: {\n name: \"Bandcamp\",\n hosts: [\"bandcamp.com\"],\n },\n};\n\n// Should add?\n// apple music\n// tidal\n// deezer\n// facebook?\n\n// function that generates a regex from all the PERFORMANCE_PROVIDERS\n// that can be passed as 'pattern' to an HTML input to validate that the URL is\n// one of the hosts\nexport const generatePerformanceProvidersPattern = () => {\n const hosts = Object.values(PERFORMANCE_PROVIDERS).flatMap(\n (provider) => provider.hosts\n );\n const escapedDomains = hosts.map((host) => host.replace(/\\./g, \"\\\\.\"));\n\n // show a JS pattern to validate a URL in a\n //\n return `^\\\\s*https:\\\\/\\\\/(?:\\\\w+\\\\.)?(${escapedDomains.join(\"|\")})\\\\/.*\\\\s*$`;\n};\n","import type { UseFormRegister, FieldErrors } from \"react-hook-form\";\nimport {\n generatePerformanceProvidersPattern,\n PERFORMANCE_PROVIDERS,\n} from \"../../../constants\";\nimport type { Input as RegistrationInput } from \"../../../types\";\nimport { Input } from \"./Input\";\n\ninterface PerformanceLinksSettings {\n visibility: \"required\" | \"optional\" | \"hidden\";\n max: number;\n accepted: string[];\n}\n\ninterface PerformanceLinksProps {\n performanceLinksSettings?: PerformanceLinksSettings;\n errors: FieldErrors;\n register: UseFormRegister;\n}\n\nexport const PerformanceLinks = ({\n errors,\n performanceLinksSettings,\n register,\n}: PerformanceLinksProps) => {\n return (\n
\n

\n Performance Links\n

\n

\n Please provide links to your music from any of these platforms:{\" \"}\n {Object.keys(PERFORMANCE_PROVIDERS)\n .filter(platform => performanceLinksSettings?.accepted.includes(platform))\n .map(\n (platform) =>\n PERFORMANCE_PROVIDERS[\n platform as keyof typeof PERFORMANCE_PROVIDERS\n ]?.name\n )\n .map((name, index, array) => {\n if (index === array.length - 1 && array.length > 1) {\n return `or ${name}`;\n } else if (index === array.length - 2 && array.length > 2) {\n return `${name}, `;\n } else if (index < array.length - 2) {\n return `${name}, `;\n }\n return name;\n })\n .join(\"\")}\n

\n

\n {performanceLinksSettings?.visibility === \"required\" ? (\n <>\n You must provide at least 1 link. You\n may provide up to {performanceLinksSettings.max} performance links.\n \n ) : (\n `You may provide up to ${performanceLinksSettings?.max} performance links`\n )}\n

\n
\n {Array.from({\n length:\n performanceLinksSettings?.visibility === \"required\"\n ? performanceLinksSettings.max\n : performanceLinksSettings?.max || 4,\n }).map((_, index) => {\n const acceptedPatterns = generatePerformanceProvidersPattern();\n\n const acceptedProviders = performanceLinksSettings?.accepted\n .map(\n (platform) =>\n PERFORMANCE_PROVIDERS[\n platform as keyof typeof PERFORMANCE_PROVIDERS\n ]?.name\n )\n .join(\", \");\n\n return (\n
\n
\n \n \n
\n
\n );\n })}\n
\n
\n );\n};\n","import { forwardRef, useState } from \"react\";\nimport type { Ref } from \"react\";\n\nconst TEXT_AREA_CLASSES = `\n block w-full px-4 py-3 \n bg-white rounded-lg border border-gray-200\n text-gray-900 text-base\n transition duration-200 ease-in-out\n placeholder:text-gray-400\n focus:outline-none focus:ring-2 focus:ring-indigo-500/20 focus:border-indigo-500\n hover:border-gray-300\n disabled:bg-gray-50 disabled:text-gray-500\n`;\n\ninterface TextAreaProps {\n id?: string;\n dataTestID?: string;\n name: string;\n label?: string;\n placeholder?: string;\n required?: boolean;\n maxLength?: number;\n rows?: number;\n onChange?: (e: React.ChangeEvent) => void;\n value?: string;\n error?: string;\n helperText?: string;\n className?: string;\n}\n\nexport const TextArea = forwardRef(({\n id,\n dataTestID,\n name,\n label,\n placeholder,\n required,\n maxLength,\n onChange,\n value,\n rows = 4,\n error,\n helperText,\n className\n}: TextAreaProps, ref: Ref) => {\n const [charCount, setCharCount] = useState(value?.length || 0);\n\n const handleInput = (e: React.ChangeEvent) => {\n if (maxLength) {\n setCharCount(e.target.value.length);\n }\n onChange?.(e);\n };\n\n return (\n
\n {label && (\n \n {label}\n {required && (\n *\n )}\n \n )}\n \n {error ? (\n

\n \n \n \n {error}\n

\n ) : helperText ? (\n

{helperText}

\n ) : null}\n {maxLength && (\n
= maxLength * 0.9 && charCount < maxLength * 0.96\n ? 'text-amber-500'\n : charCount >= maxLength * 0.96\n ? 'text-red-500'\n : 'text-gray-500'\n }`}\n >\n {charCount} / {maxLength}\n
\n )}\n
\n );\n});","import { Fragment } from \"react\";\nimport type { UseFormRegister, FieldErrors } from \"react-hook-form\";\nimport { SOCIAL_MEDIA } from \"../../../constants\";\nimport type { Input as RegistrationInput } from \"../../../types\";\n\ninterface SocialMediaProfilesProps {\n registrationSettings: Record;\n errors: FieldErrors;\n register: UseFormRegister;\n}\n\nexport const SocialMediaProfiles = ({\n registrationSettings,\n register,\n errors,\n}: SocialMediaProfilesProps) => {\n const extractUsername = (url: string, socialKey: string): string => {\n try {\n // Trim whitespace first\n const trimmedUrl = url.trim();\n \n if (trimmedUrl.includes('http') || trimmedUrl.includes('www.') || trimmedUrl.includes('.com')) {\n const urlObj = new URL(trimmedUrl.startsWith('http') ? trimmedUrl : `https://${trimmedUrl}`);\n const path = urlObj.pathname.replace(/^\\//, '');\n const username = path.split('/')[0].split('?')[0];\n if (socialKey === 'tiktok') {\n return username ? username.substring(1) : trimmedUrl;\n }\n return username || trimmedUrl;\n }\n return trimmedUrl;\n } catch (e) {\n return url.trim();\n }\n };\n\n const handleInputChange = (e: React.ChangeEvent, socialKey: string, setValue: (value: string) => void) => {\n const value = e.target.value;\n if (value) {\n const username = extractUsername(value, socialKey);\n setValue(username);\n }\n };\n\n return (\n
\n

\n Social Media Profiles (Optional)\n

\n

\n Please provide links to your social media profiles.\n

\n
\n {SOCIAL_MEDIA.map((social) => (\n \n {registrationSettings[social.key] !== \"hidden\" && (\n
\n \n {social.name} Profile\n {registrationSettings[social.key] === \"required\" && (\n *\n )}\n \n
\n
\n \n {social.key === 'tiktok' ? `${social.url}@` : social.url}\n \n handleInputChange(\n e, \n social.key, \n (value) => {\n e.target.value = value;\n }\n ),\n setValueAs: (value: string) => value ? value.trim() : value\n })}\n />\n
\n
\n
\n )}\n
\n ))}\n
\n
\n )\n}","import { RegistrationStep } from \"..\";\n\ninterface NavigationButtonsProps {\n currentStep: RegistrationStep;\n handlePrevious: () => void;\n handleNext: () => void;\n registrationOpen: boolean;\n submitting: boolean;\n theme: { primary_color: string };\n}\n\nexport const NavigationButtons = ({ currentStep, handlePrevious, handleNext, registrationOpen, theme, submitting }: NavigationButtonsProps) => {\n return (\n
\n {currentStep !== RegistrationStep.BasicInfo ? (\n <>\n \n Previous\n \n \n {submitting ? (\n <>\n \n \n \n \n Submitting...\n \n ) : (\n \"Register\"\n )}\n \n \n ) : null}\n \n {currentStep !== RegistrationStep.About ? (\n \n Submit\n \n ) : null}\n
\n );\n};","import { UseFormRegister } from \"react-hook-form\";\nimport { FieldErrors } from \"react-hook-form\";\nimport { TextArea } from \"./TextArea\";\nimport type { Input as RegistrationInput } from \"../../../types\";\nimport { PerformanceLinks } from \"./PerformanceLinks\";\nimport { SocialMediaProfiles } from \"./SocialMediaProfiles\";\n\ninterface PerformanceLinksSettings {\n visibility: \"required\" | \"optional\" | \"hidden\";\n max: number;\n accepted: string[];\n}\n\ninterface AboutProps {\n registrationSettings: Record;\n errors: FieldErrors;\n register: UseFormRegister;\n performanceLinksSettings: PerformanceLinksSettings;\n theme: {\n primary_color: string;\n };\n competitionSlug: string;\n}\n\nexport const About = ({\n registrationSettings,\n errors,\n register,\n performanceLinksSettings,\n theme,\n competitionSlug,\n}: AboutProps) => {\n return (\n \n

\n Tell Us Your Story\n

\n {registrationSettings.bio !== \"hidden\" && (\n \n )}\n {performanceLinksSettings && performanceLinksSettings.visibility !== \"hidden\" && (\n \n )}\n \n
\n \n \n
\n \n );\n};\n","import { useCallback, useEffect, useState } from \"react\";\nimport { useForm, SubmitHandler } from \"react-hook-form\";\nimport { BasicInfo, NavigationButtons } from \"./components\";\nimport { FORM_DATA_KEY, FORM_STEP_KEY } from \"../../constants\";\nimport { Input, OnRegisterCompetitorHandler } from \"../../types\";\nimport { Competition, User } from \"../../../types\";\nimport { PubSub } from \"pubsub-js\";\nimport { About } from \"./components/About\";\nimport { notifyError } from \"../../../../shared/bugsnag\";\n\nexport enum RegistrationStep {\n BasicInfo = \"basic-info\",\n About = \"about\",\n}\n\ninterface RegistrationFormProps {\n competition: Competition;\n currentUser: User;\n onSubmit: OnRegisterCompetitorHandler;\n theme: {\n primary_color: string;\n };\n uploadcareKey: string;\n}\n\nexport const RegistrationForm = ({\n competition,\n currentUser,\n onSubmit: onSubmitHandler,\n theme,\n uploadcareKey,\n}: RegistrationFormProps) => {\n const {\n id: competitionId,\n name: competitionName,\n registration_open: registrationOpen,\n registration_settings: registrationSettings,\n } = competition;\n\n // Add effect to publish register.start event\n useEffect(() => {\n PubSub.publish(\"register.start\", { competitionId, userId: currentUser.id });\n }, [competitionId, currentUser.id]);\n\n const getSavedData = useCallback(() => {\n const savedData = localStorage.getItem(FORM_DATA_KEY);\n if (savedData) {\n return JSON.parse(savedData);\n }\n return null;\n }, []);\n\n const getSavedStep = useCallback(() => {\n const savedStep = localStorage.getItem(FORM_STEP_KEY);\n if (\n savedStep &&\n Object.values(RegistrationStep).includes(savedStep as RegistrationStep)\n ) {\n return savedStep as RegistrationStep;\n }\n return RegistrationStep.BasicInfo;\n }, []);\n\n const {\n register,\n handleSubmit,\n watch,\n formState: { errors },\n trigger,\n getFieldState,\n setValue,\n setError,\n clearErrors,\n } = useForm({\n mode: \"onBlur\",\n defaultValues: getSavedData() || {\n competitionId,\n tosAccepted: false,\n questionsAnswers: [],\n performanceLinks: [],\n },\n });\n\n const [currentStep, setCurrentStep] =\n useState(getSavedStep());\n const [submitting, setSubmitting] = useState(false);\n\n // Watch age value and clear error when it changes to a valid option\n const ageValue = watch(\"age\");\n useEffect(() => {\n if (ageValue && ageValue !== \"under13\") {\n clearErrors(\"age\");\n }\n }, [ageValue, clearErrors]);\n\n useEffect(() => {\n console.log(\"Saving step to localStorage:\", currentStep);\n localStorage.setItem(FORM_STEP_KEY, currentStep.toString());\n }, [currentStep]);\n\n // Watch all form values and update localStorage when they change\n const formValues = watch();\n useEffect(() => {\n localStorage.setItem(FORM_DATA_KEY, JSON.stringify(formValues));\n }, [formValues]);\n\n const validateBasicInfo = async (): Promise<{\n isValid: boolean;\n errors: any[];\n }> => {\n const fieldsToValidate: string[] = [];\n\n fieldsToValidate.push(\"name\");\n fieldsToValidate.push(\"email\");\n fieldsToValidate.push(\"competitorName\");\n\n if (registrationSettings.birthdate === \"required\")\n fieldsToValidate.push(\"birthday\");\n if (registrationSettings.phone === \"required\")\n fieldsToValidate.push(\"phone\");\n if (registrationSettings.profile_picture === \"required\")\n fieldsToValidate.push(\"profileImage\");\n\n if (registrationSettings.birthdate === \"required\") {\n fieldsToValidate.push(\"age\");\n const ageValue = watch(\"age\");\n\n // Check for under13 age value\n if (ageValue === \"under13\") {\n setError(\"age\", {\n type: \"manual\",\n message:\n \"You must be at least 13 years of age to enter the competition.\",\n });\n return {\n isValid: false,\n errors: [\n {\n type: \"manual\",\n message:\n \"You must be at least 13 years of age to enter the competition.\",\n },\n ],\n };\n }\n\n if (ageValue === \"under18\") {\n fieldsToValidate.push(\"responsiblePartyEmail\");\n }\n }\n\n await trigger(fieldsToValidate as any);\n\n const errors = fieldsToValidate\n .map((field) => {\n const fieldState = getFieldState(field as any);\n return fieldState.error;\n })\n .filter((error) => error !== undefined);\n\n const hasErrors = errors.length > 0;\n\n return { isValid: !hasErrors, errors };\n };\n\n const validateAbout = async (): Promise<{\n isValid: boolean;\n errors: any[];\n }> => {\n const fieldsToValidate: string[] = [];\n\n if (registrationSettings.bio === \"required\") {\n fieldsToValidate.push(\"bio\");\n }\n\n const performanceLinks = registrationSettings.performance_links;\n\n if (performanceLinks) {\n for (let i = 0; i < performanceLinks.max; i++) {\n fieldsToValidate.push(`performanceLinks[${i}]`);\n }\n }\n\n await trigger(fieldsToValidate as any);\n\n const errors = fieldsToValidate\n .map((field) => {\n const fieldState = getFieldState(field as any);\n return fieldState.error;\n })\n .filter((error) => error !== undefined);\n\n const hasErrors = errors.length > 0;\n\n return { isValid: !hasErrors, errors };\n };\n\n const validateStep = async (\n step: RegistrationStep\n ): Promise<{ isValid: boolean; errors: any[] }> => {\n try {\n switch (step) {\n case RegistrationStep.BasicInfo:\n return validateBasicInfo();\n case RegistrationStep.About:\n return validateAbout();\n }\n } catch (e) {\n console.error(\"Error validating step\", step, \":\", e);\n return { isValid: false, errors: [e] };\n }\n };\n\n const handlePrevious = () => {\n setCurrentStep(RegistrationStep.BasicInfo);\n window.scrollTo(0, 0);\n };\n\n const trackStepAnalytics = useCallback(\n (step: RegistrationStep, userId: string) => {\n switch (step) {\n case RegistrationStep.BasicInfo:\n PubSub.publish(\"register.basic-info\", { competitionId, userId });\n break;\n case RegistrationStep.About:\n PubSub.publish(\"register.about\", { competitionId, userId });\n break;\n }\n },\n [competitionId]\n );\n\n const handleNext = async () => {\n const { isValid, errors } = await validateStep(currentStep);\n\n console.log(\"isValid\", isValid);\n console.log(\"errors\", errors);\n\n if (isValid) {\n if (currentStep === RegistrationStep.BasicInfo) {\n trackStepAnalytics(currentStep, currentUser.id);\n setCurrentStep(RegistrationStep.About);\n window.scrollTo(0, 0);\n }\n } else {\n console.error(\"Validation failed\", errors);\n }\n };\n\n const alertFailure = (err: Error) => {\n notifyError(err, (event) => {\n event.setUser(currentUser?.id, currentUser?.email, currentUser?.name);\n });\n\n const msg =\n err.message ||\n \"There was an error submitting the form. Our team has been notified\";\n\n alert(`Registration Submit Error - ${msg}.`);\n };\n\n const onSubmit: SubmitHandler = async (data) => {\n const { isValid, errors } = await validateStep(currentStep);\n\n if (!isValid) {\n const err = new Error(errors.map((error) => error.message).join(\";\"));\n\n alertFailure(err);\n } else {\n setSubmitting(true);\n try {\n // Build social media links\n const socialLinks = [];\n if (data.website) {\n socialLinks.push({\n url: data.website,\n title: \"Website\",\n kind: \"social_media\",\n });\n }\n\n // Add other social media links\n const socialPlatforms = {\n facebook: \"facebook.com\",\n instagram: \"instagram.com\",\n tiktok: \"tiktok.com\",\n youtube: \"youtube.com\",\n x: \"twitter.com\",\n spotify: \"spotify.com\",\n soundcloud: \"soundcloud.com\",\n bandcamp: \"bandcamp.com\",\n };\n\n Object.entries(socialPlatforms).forEach(([platform, domain]) => {\n const handle = data[platform as keyof typeof data];\n if (handle) {\n const formattedHandle =\n platform === \"tiktok\" ? `@${handle}` : handle;\n socialLinks.push({\n url: `https://${domain}/${formattedHandle}`,\n title: platform.charAt(0).toUpperCase() + platform.slice(1),\n kind: \"social_media\",\n });\n }\n });\n\n // Build performance links\n const performanceLinks = (data.performanceLinks || [])\n .filter((url) => url && url.trim() !== \"\")\n .map((url) => {\n const getProviderTitle = (url: string) => {\n const providers = {\n youtube: \"YouTube\",\n vimeo: \"Vimeo\",\n soundcloud: \"SoundCloud\",\n spotify: \"Spotify\",\n bandcamp: \"Bandcamp\",\n };\n const provider = Object.keys(providers).find((key) =>\n url.includes(key)\n );\n return provider\n ? providers[provider as keyof typeof providers]\n : \"Unknown\";\n };\n\n return {\n url,\n title: getProviderTitle(url),\n kind: \"performance\",\n };\n });\n\n const formData = {\n competitionId: data.competitionId,\n competitorData: {\n userId: data.userId,\n name: data.name,\n email: data.email,\n competitorName: data.competitorName,\n phone: data.phone,\n birthday: data.birthday,\n bio: data.bio || \"\",\n responsiblePartyEmail: data.responsiblePartyEmail,\n questionsAnswers: data.questionsAnswers || [],\n links: [...socialLinks, ...performanceLinks],\n profileImage: data.profileImage,\n coverImage: data.coverImage,\n otherImages: data.otherImages ? data.otherImages.split(\",\") : [],\n tosAccepted: data.tosAccepted,\n },\n };\n\n const { userId } = formData.competitorData;\n const { error } = await onSubmitHandler(formData);\n if (error) throw error;\n PubSub.publish(\"register.success\", { competitionId, userId });\n localStorage.removeItem(FORM_DATA_KEY);\n localStorage.removeItem(FORM_STEP_KEY);\n } catch (error) {\n console.error(\"Registration failed:\", error);\n // PubSub.publish(\"register.error\", { competitionId, error: error });\n\n alertFailure(error);\n } finally {\n setSubmitting(false);\n }\n }\n };\n\n return (\n
\n

\n Register for {competitionName}\n

\n
\n
\n {currentStep === RegistrationStep.BasicInfo ? (\n \n ) : null}\n {currentStep === RegistrationStep.About ? (\n \n ) : null}\n \n
\n
\n
\n );\n};\n","import { AuthWidgetProps, OAuthCredentials } from \"../AuthWidget\";\nimport { HydrateCurrentUser } from \"../hooks/useCurrentUser\";\nimport { RegisterCompetitor } from \"../hooks/useRegistration\";\nimport type { Competition, User } from \"../types\";\n\nexport interface RegistrationWizardProps {\n competition: Competition;\n api_path: string;\n platform_url: string;\n dashboard_url: string;\n oauth_providers: any;\n oauth_credentials: OAuthCredentials;\n uploadcare_key: string;\n}\n\nexport interface RegistrationWizardUIProps {\n authConfig: AuthWidgetProps;\n user: User;\n hydrateCurrentUser: HydrateCurrentUser;\n registerCompetitor: RegisterCompetitor;\n competition: Competition;\n uploadcare_key: string;\n}\n\nexport interface RegisterCompetitorArgs {\n competitionId: string;\n competitorData: any;\n}\nexport type OnRegisterCompetitorHandler = (\n args: RegisterCompetitorArgs\n) => Promise<{ data: any; error: any }>;\n\nexport interface Input {\n competitionId: string;\n userId: string;\n name: string;\n competitorName: string;\n age: string;\n email?: string;\n phone?: string;\n birthday?: string;\n bio?: string;\n facebook?: string;\n instagram?: string;\n x?: string;\n tiktok?: string;\n youtube?: string;\n spotify?: string;\n soundcloud?: string;\n bandcamp?: string;\n website?: string;\n responsiblePartyEmail?: string;\n questionsAnswers?: {\n question: string;\n answer: string;\n }[];\n profileImage: string;\n coverImage?: string;\n otherImages?: string;\n performanceLinks?: string[];\n tosAccepted: boolean;\n}\n\nexport interface Question {\n visibility: \"required\" | \"optional\" | \"hidden\";\n text: string;\n}\n\nexport enum RegistrationStatus {\n UNKNOWN = \"unknown\",\n DRAFT = \"draft\",\n CLOSED = \"closed\",\n OPEN = \"open\",\n}\n\nexport enum CompetitorStatus {\n UNKNOWN = \"unknown\",\n VERIFYING = \"verifying\",\n NOT_AUTHED = \"not_authed\",\n REGISTERED = \"registered\",\n NOT_REGISTERED = \"not_registered\",\n}\n","import { useEffect, useState } from \"react\";\n\nimport { AuthWidget } from \"../../AuthWidget\";\nimport { RegistrationForm } from \"./Form\";\nimport {\n RegistrationWizardUIProps,\n RegistrationStatus,\n CompetitorStatus,\n OnRegisterCompetitorHandler,\n} from \"../types\";\nimport { Competitor } from \"../../types\";\nimport { ShareButtons } from \"../../../DashApp/components/ShareButtons\";\n\nexport const RegistrationWizardUI = (props: RegistrationWizardUIProps) => {\n const {\n authConfig,\n user,\n hydrateCurrentUser,\n registerCompetitor,\n competition,\n uploadcare_key,\n } = props;\n\n const [registrationStatus, setRegistrationStatus] =\n useState(RegistrationStatus.UNKNOWN);\n const [competitorStatus, setCompetitorStatus] = useState(\n CompetitorStatus.UNKNOWN\n );\n const [isLoading, setIsLoading] = useState(true);\n const [hydratedUser, setHydratedUser] = useState(user);\n\n const verifyCompetitorStatus = async () => {\n try {\n const { data: hydratedCurrentUser, error } = await hydrateCurrentUser(\n user.id\n );\n\n if (error) throw error;\n\n setHydratedUser(hydratedCurrentUser);\n\n const isAlreadyRegistered = !!hydratedCurrentUser.competitors?.find(\n (competitor: Competitor) =>\n competitor.competition?.id === competition.id\n );\n\n if (isAlreadyRegistered) setCompetitorStatus(CompetitorStatus.REGISTERED);\n else setCompetitorStatus(CompetitorStatus.NOT_REGISTERED);\n } catch (error) {\n console.error(\"Error loading user data:\", error);\n setCompetitorStatus(CompetitorStatus.NOT_AUTHED);\n }\n };\n\n const onRegisterCompetitor: OnRegisterCompetitorHandler = async (args) => {\n args.competitorData.userId = user.id;\n\n try {\n const { data, errors } = await registerCompetitor(args);\n if (errors) throw errors[0];\n\n setCompetitorStatus(CompetitorStatus.REGISTERED);\n\n window.scrollTo(0, 0);\n\n return { data, error: null };\n } catch (error) {\n return {\n data: null,\n error: error || \"An error occurred while registering\",\n };\n }\n };\n\n useEffect(() => {\n if (competition.status === \"draft\")\n setRegistrationStatus(RegistrationStatus.DRAFT);\n else if (!competition.registration_open)\n setRegistrationStatus(RegistrationStatus.CLOSED);\n else setRegistrationStatus(RegistrationStatus.OPEN);\n }, [competition]);\n\n useEffect(() => {\n if (!user?.id) setCompetitorStatus(CompetitorStatus.NOT_AUTHED);\n else if (competitorStatus === CompetitorStatus.UNKNOWN)\n setCompetitorStatus(CompetitorStatus.VERIFYING);\n }, [user]);\n\n useEffect(() => {\n if (competitorStatus === CompetitorStatus.VERIFYING)\n verifyCompetitorStatus();\n }, [competitorStatus]);\n\n useEffect(() => {\n if (\n registrationStatus !== RegistrationStatus.UNKNOWN &&\n competitorStatus !== CompetitorStatus.UNKNOWN &&\n competitorStatus !== CompetitorStatus.VERIFYING\n )\n setIsLoading(false);\n else setIsLoading(true);\n }, [registrationStatus, competitorStatus]);\n\n if (isLoading) return ;\n if (registrationStatus === RegistrationStatus.DRAFT)\n return ;\n if (registrationStatus === RegistrationStatus.CLOSED)\n return ;\n if (competitorStatus === CompetitorStatus.NOT_AUTHED)\n return ;\n if (competitorStatus === CompetitorStatus.REGISTERED)\n return ;\n\n return (\n \n );\n};\n\nexport const LoadingWidget = () => (\n
\n
\n
\n
\n
\n);\n\nexport const RegistrationNotOpenWidget = () => (\n

\n Registration has not opened yet\n

\n);\n\nexport const RegistrationClosedWidget = () => (\n

Registration is closed

\n);\n\nexport const ThankYouWidget = ({\n competitionUrl,\n}: {\n competitionUrl: string;\n}) => (\n \n
\n

Thank you for registering!

\n

We've received your registration and will be in touch soon.

\n

Make sure to follow us online:

\n
\n \n
\n
\n
\n \n Back to the competition\n \n
\n
\n);\n","import { useMemo } from \"react\";\n\nimport { useServerRedirectSearchParams } from \"../../shared/hooks/useServerRedirectSearchParams\";\nimport { type RegistrationWizardProps } from \"./types\";\nimport { type AuthWidgetProps } from \"../AuthWidget\";\nimport { useRegistration } from \"../hooks/useRegistration\";\nimport { useApolloClient } from \"../hooks/useApolloClient\";\nimport { useCurrentUser } from \"../hooks/useCurrentUser\";\nimport { RegistrationWizardUI } from \"./UI\";\n\nexport const RegistrationWizard = ({ \n api_path, \n // dashboard_url, \n platform_url, \n oauth_providers, \n oauth_credentials,\n competition, \n uploadcare_key \n}: RegistrationWizardProps) => {\n const { deleteParams } = useServerRedirectSearchParams()\n\n const competitionSiteURL = useMemo(() => {\n return new URL(window.location.href);\n }, [])\n\n const platformURL = useMemo(() => {\n if (platform_url.endsWith(\"/\")) platform_url = platform_url.slice(0, -1);\n\n return platform_url;\n }, [])\n\n const apiURL = useMemo(() => {\n return new URL(`${platformURL}${api_path}`).href;\n }, [])\n\n const userIdQueryParam = useMemo(() => {\n const userId = new URLSearchParams(competitionSiteURL.search).get('user')\n deleteParams([\"user\"])\n return userId ? userId : null\n }, []);\n\n const client = useApolloClient(apiURL);\n const { registerCompetitor } = useRegistration(client);\n const { get: getCurrentUser, hydrate: hydrateCurrentUser } = useCurrentUser(client);\n\n const auth: AuthWidgetProps = useMemo(() => {\n const oauth = {\n requestUrl: platformURL,\n redirectUrl: `${competitionSiteURL.origin}${competitionSiteURL.pathname}`,\n enabledProviders: oauth_providers.enabled || [],\n configuredProviders: oauth_providers.configured || [],\n credentials: oauth_credentials\n }\n\n return {\n oauth,\n type: \"embed\"\n }\n }, [oauth_providers])\n\n return (\n )\n}","import { useMemo } from \"react\";\nimport { useServerRedirectSearchParams } from \"../../shared/hooks/useServerRedirectSearchParams\";\nimport { useCurrentUser } from \"../hooks/useCurrentUser\";\n\ninterface LogoutButtonProps {\n aProps?: React.AnchorHTMLAttributes;\n dashboardUrl: string;\n wrapper?: {\n component: string;\n props?: any;\n }\n}\n\nexport const LogoutButton = ({ aProps, wrapper, dashboardUrl }: LogoutButtonProps) => {\n const { currentUser } = useCurrentUser()\n const { deleteParams } = useServerRedirectSearchParams()\n\n const url = useMemo(() => {\n return new URL(window.location.href);\n }, [window.location.href])\n \n function logoutUser() {\n deleteParams([\"user\"])\n localStorage.removeItem(\"user\");\n location.reload();\n }\n\n if (!currentUser?.id && !url.searchParams.has('user')) return null\n\n const logoutButton = (\n \n Logout\n \n )\n\n const dashboardButton = (\n \n Dashboard\n \n )\n\n if (wrapper) {\n const { component: WrapperComponent, props } = wrapper\n\n return (\n <>\n \n {dashboardButton}\n \n \n {logoutButton}\n \n \n )\n }\n\n return logoutButton\n}","import { useState } from 'react';\nimport { LogoutButton } from '../AuthWidget/LogoutButton';\n\ninterface NavigationProps {\n navigationLinks: {\n href: string;\n title: string;\n }[];\n dashboardUrl: string;\n transparent?: boolean;\n}\n\nexport const Navigation = ({\n navigationLinks,\n dashboardUrl,\n transparent = false,\n}: NavigationProps) => {\n const [isOpen, setIsOpen] = useState(false);\n\n const toggleMenu = () => {\n setIsOpen(!isOpen);\n };\n\n const NavLinks = () => (\n <>\n {navigationLinks.map((page) => (\n
  • \n setIsOpen(false)}\n >\n {page.title}\n \n
  • \n ))}\n \n \n );\n\n return (\n <>\n {/* Mobile Menu Button */}\n \n\n {/* Mobile Menu Overlay */}\n \n
    \n
    \n \n
    \n
      \n \n
    \n
    \n \n\n {/* Desktop Menu */}\n \n \n );\n}; ","import { useState, useEffect } from \"react\";\n\ninterface CountdownClockProps {\n endDate: string;\n theme: {\n primary_color: string;\n secondary_color: string;\n accent_color: string;\n background_primary_color: string;\n background_secondary_color: string;\n };\n}\n\nexport function CountdownClock({ theme, endDate }: CountdownClockProps) {\n const [timeLeft, setTimeLeft] = useState({\n days: 0,\n hours: 0,\n minutes: 0,\n seconds: 0,\n });\n\n useEffect(() => {\n const interval = setInterval(() => {\n const now = new Date().getTime();\n const end = new Date(endDate).getTime();\n const difference = end - now;\n\n if (difference > 0) {\n setTimeLeft({\n days: Math.floor(difference / (1000 * 60 * 60 * 24)),\n hours: Math.floor(\n (difference % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)\n ),\n minutes: Math.floor((difference % (1000 * 60 * 60)) / (1000 * 60)),\n seconds: Math.floor((difference % (1000 * 60)) / 1000),\n });\n } else {\n clearInterval(interval);\n setTimeLeft({ days: 0, hours: 0, minutes: 0, seconds: 0 });\n }\n }, 1000);\n\n return () => clearInterval(interval);\n }, [endDate]);\n\n return (\n
    \n
    \n
    \n \n {String(timeLeft.days).padStart(2, \"0\")[0]}\n \n \n {String(timeLeft.days).padStart(2, \"0\")[1]}\n \n
    \n Days\n
    \n
    \n
    \n \n {String(timeLeft.hours).padStart(2, \"0\")[0]}\n \n \n {String(timeLeft.hours).padStart(2, \"0\")[1]}\n \n
    \n Hours\n
    \n
    \n
    \n \n {String(timeLeft.minutes).padStart(2, \"0\")[0]}\n \n \n {String(timeLeft.minutes).padStart(2, \"0\")[1]}\n \n
    \n Mins\n
    \n
    \n
    \n \n {String(timeLeft.seconds).padStart(2, \"0\")[0]}\n \n \n {String(timeLeft.seconds).padStart(2, \"0\")[1]}\n \n
    \n Secs\n
    \n
    \n );\n}\n","import { useEffect, useState } from \"react\";\n\n// USAGE\n// \n// url is optional, will use window.location by default\ninterface ShareButtonProps {\n url?: string;\n color?: string;\n vertical?: boolean;\n shareTo?: (\"copy_link\" | \"any\" | string)[];\n followProfiles?: string[];\n}\n\n// Singleton to manage script loading\nconst scriptLoader = {\n promise: null as Promise | null,\n load() {\n if (!this.promise) {\n this.promise = new Promise((resolve) => {\n if (document.querySelector('script[src=\"https://static.addtoany.com/menu/page.js\"]')) {\n resolve();\n return;\n }\n const scriptTag = document.createElement(\"script\");\n scriptTag.src = \"https://static.addtoany.com/menu/page.js\";\n scriptTag.async = true;\n scriptTag.addEventListener(\"load\", () => {\n // Initialize AddToAny after script loads\n if (window.a2a) {\n window.a2a.init_all();\n }\n resolve();\n });\n document.body.appendChild(scriptTag);\n });\n }\n return this.promise;\n }\n};\n\n// Add type declaration for window.a2a\ndeclare global {\n interface Window {\n a2a?: {\n init_all: () => void;\n };\n }\n}\n\n// USAGE\n\n// \n// \nexport const Share = ({\n url,\n color,\n vertical,\n shareTo,\n followProfiles,\n}: ShareButtonProps) => {\n const [loaded, setLoaded] = useState(false);\n\n const mode = shareTo ? \"share\" : \"follow\";\n\n useEffect(() => {\n scriptLoader.load().then(() => {\n setLoaded(true);\n // Reinitialize AddToAny when component mounts\n if (window.a2a) {\n window.a2a.init_all();\n }\n });\n }, []);\n\n if (shareTo && followProfiles) {\n console.warn(\"SocialButtons: Set shareTo or followProfiles, not both\");\n return <>;\n }\n\n const serviceClass = (service: string) => {\n if (service == \"any\") return \"a2a_dd\";\n return `a2a_button_${service}`;\n };\n\n const shareLink = (service: string) => {\n return ;\n };\n\n const followLink = (link: string) => {\n const service = new URL(link).hostname.split(\".\").reverse()[1];\n return ;\n };\n\n let classes = \"a2a_kit a2a_kit_size_32 a2a_default_style\";\n classes += followProfiles && followProfiles.length > 0 ? \" a2a_follow\" : \"\";\n classes += vertical ? \" a2a_vertical_style\" : \"\";\n\n return (\n \n {shareTo &&\n shareTo.map((service, i) => (\n {shareLink(service)}\n ))}\n\n {followProfiles &&\n followProfiles.map((link, i) => (\n {followLink(link)}\n ))}\n \n );\n};\n","export type MediaBlob = {\n provider_url?: string\n thumbnail_url: string\n src_set: any\n}\n\nexport type Template = {\n id: string\n slug: string\n title: string\n design: any\n competition_id: string\n}\n\nexport type Competition = {\n id: string\n slug: string\n url: string\n path: string\n home_page_url: string\n status: string;\n registration_open: boolean;\n registration_settings: Record;\n name: string;\n theme?: {\n primary_text_color: string;\n secondary_text_color: string;\n accent_text_color: string;\n primary_background_color: string;\n secondary_background_color: string;\n };\n tagline?: string;\n start_date?: string;\n home_page?: Template\n}\n\nexport interface Competitor {\n id?: string\n slug?: string\n name: string;\n url: string\n path: string\n profile_image?: MediaBlob\n competition?: Competition\n}\n\nexport type PaymentIntent = {\n id: string;\n amount_cents: number;\n client_secret: string;\n currency: string;\n customer_id?: string;\n description?: string;\n metadata?: any;\n statement_descriptor?: string;\n statement_descriptor_suffix?: string;\n}\n\nexport type User = {\n id?: string\n email?: string\n name?: string\n roles?: string[]\n profile_image?: MediaBlob\n todays_votes?: any[]\n competitors?: Competitor[]\n}\n\nexport type Vote = {\n id: string;\n competitor_id: string;\n free: boolean;\n user_id: string;\n votes?: number;\n votes_intent: number;\n\n user: User;\n competitor: Competitor;\n\n created_at: string;\n updated_at: string;\n\n charge_amount?: any;\n charge_provider?: any;\n charge_id?: any;\n\n}\n\nexport type AppConfig = {\n app_level: number;\n has_admins: boolean;\n user_roles: string[];\n oauth_providers: {\n available: string[];\n enabled: {\n k: string;\n path: string;\n }[];\n configured: {\n provider: string;\n k: string;\n path: string;\n }[];\n };\n auth_providers: {\n available: {\n provider: string;\n k: string;\n }[];\n enabled: {\n provider: string;\n k: string;\n path?: string;\n }[];\n configured: {\n provider: string;\n k: string;\n path?: string;\n }[];\n };\n};\n\nexport enum VoteKind {\n Free = 'Free',\n Paid = 'Paid',\n}\n\nexport type VoteIntent = {\n id?: string;\n competitorId?: string\n competitionId?: string\n votes?: number\n type?: VoteKind\n completed?: boolean\n paymentIntentId?: string\n cartId?: string\n}\n\ntype PromoType = 'TwoForOneVotePromo';\n\nexport type Promo = {\n type: PromoType;\n banner_title?: string;\n banner_description?: string;\n end_at: Date;\n}","import { createContext } from \"react\";\n\nimport { VoteIntentProxy } from \"./VoteIntentProxy\";\nimport { VoteKind, type VoteIntent as VoteIntentType } from \"../../types\"\nimport { CreateVote } from \"../hooks/useCreateVote\";\nimport { UpdateVote } from \"../hooks/useUpdateVote\";\n\nexport interface VoteIntentContextType {\n voteIntent: VoteIntentType;\n proxy: VoteIntentProxy;\n defaultVals: VoteIntentType;\n createVote: CreateVote;\n updateVote: UpdateVote;\n initializing: boolean;\n}\n\nexport const voteIntentDefault: VoteIntentType = {\n competitorId: undefined,\n competitionId: undefined,\n votes: undefined,\n type: VoteKind.Paid,\n completed: false,\n paymentIntentId: undefined,\n cartId: undefined,\n}\n\nexport const VoteIntentContext = createContext({\n voteIntent: null,\n proxy: null,\n defaultVals: voteIntentDefault,\n createVote: null,\n updateVote: null,\n initializing: true\n});","import type { VoteIntent as VoteIntentType } from \"../../types\";\n\nexport const STORAGE_KEY = 'voteIntent' as const;\n\nexport interface VoteIntentPersistentStorageType {\n save(voteIntent: VoteIntentType): void;\n load(): VoteIntentType | null;\n clear(): void;\n}\n\nexport class VoteIntentPersistentStorage implements VoteIntentPersistentStorageType {\n save(voteIntent: VoteIntentType): void {\n localStorage.setItem(STORAGE_KEY, JSON.stringify(voteIntent));\n }\n\n load(): VoteIntentType | null {\n const data = localStorage.getItem(STORAGE_KEY);\n return data ? JSON.parse(data) : null;\n }\n\n clear(): void {\n localStorage.removeItem(STORAGE_KEY);\n }\n}\n","import type { VoteIntent as VoteIntentType } from \"../../types\";\nimport { voteIntentDefault } from \".\";\nimport { VoteIntentPersistentStorageType, VoteIntentPersistentStorage } from \"./PersistentStorage\";\n\nexport class VoteIntentProxy {\n private readonly storage: VoteIntentPersistentStorageType;\n private currentState: VoteIntentType = voteIntentDefault;\n\n constructor(\n private readonly onPersistSuccess: (voteIntent: VoteIntentType) => void,\n storage?: VoteIntentPersistentStorageType\n ) {\n this.storage = storage ?? new VoteIntentPersistentStorage();\n // Initialize current state from storage\n this.currentState = this.storage.load() || voteIntentDefault;\n }\n\n private persistToStorage(voteIntent: VoteIntentType | null): void {\n if (!voteIntent) {\n this.storage.clear();\n return;\n }\n this.storage.save(voteIntent);\n }\n\n get(): VoteIntentType {\n return this.currentState;\n }\n\n set(voteIntent: VoteIntentType): void {\n this.persistToStorage(voteIntent);\n this.currentState = voteIntent;\n this.onPersistSuccess(voteIntent);\n }\n\n setKey(key: K, value: VoteIntentType[K]): void {\n const current = this.get();\n this.set({ ...current, [key]: value });\n }\n\n resetStore(resetVals?: VoteIntentType): void { \n const newState = { ...voteIntentDefault, ...resetVals };\n this.set(newState);\n }\n\n markComplete(): void {\n this.setKey('completed', true);\n this.resetCartId();\n }\n\n private resetCartId(): void {\n this.setKey('cartId', crypto.randomUUID());\n }\n\n private get data(): VoteIntentType {\n return this.get();\n }\n\n getCartId(): string {\n if (!this.data.cartId) this.resetCartId();\n return this.data.cartId;\n }\n}\n","import { ApolloClient, NormalizedCacheObject } from \"@apollo/client\"\nimport { useCallback } from \"react\";\n\nimport { VOTE_CREATE_MUTATION } from '../../gql';\n\nexport interface CreateVoteProps {\n free: boolean;\n votes: number;\n userId: string;\n competitorId: string;\n chargeAmountCents?: number;\n chargeProvider?: string;\n paymentIntentId?: string;\n}\n\nexport type CreateVote = (client: ApolloClient, variables: CreateVoteProps) => Promise<{data: any; errors: any}>\n\nexport const useCreateVote = () => {\n const createVote: CreateVote = useCallback(async (client, variables) => {\n try { \n const { data, errors } = await client.mutate({\n mutation: VOTE_CREATE_MUTATION,\n variables\n })\n \n return {\n data: data?.create_vote,\n errors\n }\n } catch(e) {\n return {\n data: null,\n errors: [e]\n }\n }\n }, []) \n\n return {\n createVote\n }\n}","import { ApolloClient, NormalizedCacheObject } from \"@apollo/client\"\nimport { useCallback } from \"react\";\n\nimport { VOTE_UPDATE_MUTATION } from '../../gql';\n\nexport interface UpdateVoteProps {\n id: string;\n comment: string;\n}\n\nexport type UpdateVote = (client: ApolloClient, variables: UpdateVoteProps) => Promise<{data: any; errors: any}>\n\nexport const useUpdateVote = () => {\n const updateVote: UpdateVote = useCallback(async (client, variables) => {\n try { \n const { data, errors } = await client.mutate({\n mutation: VOTE_UPDATE_MUTATION,\n variables\n })\n \n return {\n data: data?.create_vote,\n errors\n }\n } catch(e) {\n return {\n data: null,\n errors: [e]\n }\n }\n }, []) \n\n return {\n updateVote\n }\n}","import { useCallback, useState } from \"react\";\n\nimport { type VoteIntent as VoteIntentType } from \"../../types\";\nimport { voteIntentDefault } from \"../contexts\";\nimport { VoteIntentPersistentStorageType, VoteIntentPersistentStorage } from \"../contexts/PersistentStorage\";\nimport { VoteIntentProxy } from \"../contexts/VoteIntentProxy\";\nimport { useCreateVote } from \"./useCreateVote\";\nimport { useUpdateVote } from \"./useUpdateVote\";\nexport const useVoteIntentContext = (storage?: VoteIntentPersistentStorageType) => {\n const [voteIntent, setVoteIntentState] = useState(() => {\n const storageImpl = storage ?? new VoteIntentPersistentStorage();\n return storageImpl.load() ?? voteIntentDefault;\n });\n\n const { createVote } = useCreateVote();\n const { updateVote } = useUpdateVote();\n\n const onUpdatePersistedVoteIntent = useCallback((voteIntent: VoteIntentType) => {\n setVoteIntentState(voteIntent);\n }, []);\n\n return {\n voteIntent,\n proxy: new VoteIntentProxy(onUpdatePersistedVoteIntent, storage),\n defaultVals: voteIntentDefault,\n createVote,\n updateVote,\n initializing: false,\n };\n}","import { ReactNode } from \"react\";\n\nimport { VoteIntentContext } from \".\";\nimport { useVoteIntentContext } from \"../hooks/useVoteIntentContext\";\n\nexport const VoteIntentContextProvider = ({ children }: { children: ReactNode }) => {\n const voteIntentContext = useVoteIntentContext();\n \n return (\n \n {children}\n \n )\n}","import { useCallback } from \"react\";\n\nexport const useAnchor = () => {\n const anchor = useCallback((anchorId: string) => {\n if (typeof window !== \"undefined\") {\n const params = new URLSearchParams(window.location.search);\n const anchor = params.get(\"anchor\");\n \n if (anchor && anchor === anchorId) {\n const element = document.getElementById(anchor);\n if (element) {\n element.scrollIntoView({ behavior: \"smooth\" });\n }\n }\n }\n }, [])\n\n return anchor;\n}","import { useContext } from 'react';\n\nimport { VoteIntentContext } from '../contexts'\nimport { VoteKind, type VoteIntent as VoteIntentType } from '../../types';\n\nconst CENTS_MULTIPLIER = 100;\n\nexport interface AugmentedVoteIntentType extends VoteIntentType {\n id: string;\n active: boolean;\n complete: boolean;\n isFree: boolean;\n currency: string;\n amount: number;\n amountCents: number;\n formattedAmount: string;\n}\n\nexport const useVoteIntent = () => {\n const { voteIntent, ...context } = useContext(VoteIntentContext);\n\n const amount = voteIntent.votes as number\n\n const augmented: AugmentedVoteIntentType = {\n ...voteIntent,\n id: voteIntent.id,\n active: voteIntent.votes && voteIntent.votes > 0,\n complete: voteIntent.completed === true,\n isFree: voteIntent.type === VoteKind.Free,\n currency: 'usd',\n amount,\n amountCents: amount * CENTS_MULTIPLIER,\n formattedAmount: new Intl.NumberFormat('en-US', {\n style: 'currency',\n currency: 'usd'\n }).format(amount)\n }\n\n return {\n voteIntent: augmented,\n ...context\n };\n};\n\n","import { VoteKind } from '../../types';\nimport type { VotingWidgetProps } from '..';\nimport type { onVoteFunc } from '.';\n\nexport interface VoteCardProps {\n active?: boolean;\n votes: number;\n voteType: VoteKind;\n theme: VotingWidgetProps['theme'];\n highlight?: boolean;\n disabled?: boolean;\n onVote: onVoteFunc;\n twoForOneActive?: boolean;\n}\n\nexport const VoteCard = ({\n active = false,\n theme,\n votes,\n voteType,\n highlight,\n disabled,\n onVote,\n twoForOneActive = false\n}: VoteCardProps) => { \n const color = active ? 'white' : 'black';\n const bgColor = active ? 'black' : 'white';\n\n const btnClasses = `w-full py-2 px-1 text-lg hover:cursor-pointer font-bold py-2 px-4 rounded bg-${bgColor} hover:bg-${bgColor} text-${color}`;\n\n const handleClick = () => {\n if (disabled) return;\n \n onVote({ votes, voteType });\n const votingPanel = document.getElementById(\"voter-feedback\");\n if (window.innerWidth < 1024) {\n votingPanel?.scrollIntoView({ behavior: \"smooth\" });\n }\n };\n\n return (\n \n );\n};","var V3_URL = 'https://js.stripe.com/v3';\nvar V3_URL_REGEX = /^https:\\/\\/js\\.stripe\\.com\\/v3\\/?(\\?.*)?$/;\nvar EXISTING_SCRIPT_MESSAGE = 'loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used';\nvar findScript = function findScript() {\n var scripts = document.querySelectorAll(\"script[src^=\\\"\".concat(V3_URL, \"\\\"]\"));\n\n for (var i = 0; i < scripts.length; i++) {\n var script = scripts[i];\n\n if (!V3_URL_REGEX.test(script.src)) {\n continue;\n }\n\n return script;\n }\n\n return null;\n};\n\nvar injectScript = function injectScript(params) {\n var queryString = params && !params.advancedFraudSignals ? '?advancedFraudSignals=false' : '';\n var script = document.createElement('script');\n script.src = \"\".concat(V3_URL).concat(queryString);\n var headOrBody = document.head || document.body;\n\n if (!headOrBody) {\n throw new Error('Expected document.body not to be null. Stripe.js requires a element.');\n }\n\n headOrBody.appendChild(script);\n return script;\n};\n\nvar registerWrapper = function registerWrapper(stripe, startTime) {\n if (!stripe || !stripe._registerWrapper) {\n return;\n }\n\n stripe._registerWrapper({\n name: 'stripe-js',\n version: \"4.6.0\",\n startTime: startTime\n });\n};\n\nvar stripePromise = null;\nvar onErrorListener = null;\nvar onLoadListener = null;\n\nvar onError = function onError(reject) {\n return function () {\n reject(new Error('Failed to load Stripe.js'));\n };\n};\n\nvar onLoad = function onLoad(resolve, reject) {\n return function () {\n if (window.Stripe) {\n resolve(window.Stripe);\n } else {\n reject(new Error('Stripe.js not available'));\n }\n };\n};\n\nvar loadScript = function loadScript(params) {\n // Ensure that we only attempt to load Stripe.js at most once\n if (stripePromise !== null) {\n return stripePromise;\n }\n\n stripePromise = new Promise(function (resolve, reject) {\n if (typeof window === 'undefined' || typeof document === 'undefined') {\n // Resolve to null when imported server side. This makes the module\n // safe to import in an isomorphic code base.\n resolve(null);\n return;\n }\n\n if (window.Stripe && params) {\n console.warn(EXISTING_SCRIPT_MESSAGE);\n }\n\n if (window.Stripe) {\n resolve(window.Stripe);\n return;\n }\n\n try {\n var script = findScript();\n\n if (script && params) {\n console.warn(EXISTING_SCRIPT_MESSAGE);\n } else if (!script) {\n script = injectScript(params);\n } else if (script && onLoadListener !== null && onErrorListener !== null) {\n var _script$parentNode;\n\n // remove event listeners\n script.removeEventListener('load', onLoadListener);\n script.removeEventListener('error', onErrorListener); // if script exists, but we are reloading due to an error,\n // reload script to trigger 'load' event\n\n (_script$parentNode = script.parentNode) === null || _script$parentNode === void 0 ? void 0 : _script$parentNode.removeChild(script);\n script = injectScript(params);\n }\n\n onLoadListener = onLoad(resolve, reject);\n onErrorListener = onError(reject);\n script.addEventListener('load', onLoadListener);\n script.addEventListener('error', onErrorListener);\n } catch (error) {\n reject(error);\n return;\n }\n }); // Resets stripePromise on error\n\n return stripePromise[\"catch\"](function (error) {\n stripePromise = null;\n return Promise.reject(error);\n });\n};\nvar initStripe = function initStripe(maybeStripe, args, startTime) {\n if (maybeStripe === null) {\n return null;\n }\n\n var stripe = maybeStripe.apply(undefined, args);\n registerWrapper(stripe, startTime);\n return stripe;\n}; // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\nvar stripePromise$1;\nvar loadCalled = false;\n\nvar getStripePromise = function getStripePromise() {\n if (stripePromise$1) {\n return stripePromise$1;\n }\n\n stripePromise$1 = loadScript(null)[\"catch\"](function (error) {\n // clear cache on error\n stripePromise$1 = null;\n return Promise.reject(error);\n });\n return stripePromise$1;\n}; // Execute our own script injection after a tick to give users time to do their\n// own script injection.\n\n\nPromise.resolve().then(function () {\n return getStripePromise();\n})[\"catch\"](function (error) {\n if (!loadCalled) {\n console.warn(error);\n }\n});\nvar loadStripe = function loadStripe() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n loadCalled = true;\n var startTime = Date.now(); // if previous attempts are unsuccessful, will re-load script\n\n return getStripePromise().then(function (maybeStripe) {\n return initStripe(maybeStripe, args, startTime);\n });\n};\n\nexport { loadStripe };\n","import React from 'react';\nimport PropTypes from 'prop-types';\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n\n if (enumerableOnly) {\n symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n }\n\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\nfunction _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n\n var target = _objectWithoutPropertiesLoose(source, excluded);\n\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\nfunction _slicedToArray(arr, i) {\n return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();\n}\n\nfunction _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}\n\nfunction _iterableToArrayLimit(arr, i) {\n var _i = arr && (typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]);\n\n if (_i == null) return;\n var _arr = [];\n var _n = true;\n var _d = false;\n\n var _s, _e;\n\n try {\n for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n}\n\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\n\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n\n return arr2;\n}\n\nfunction _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nvar useAttachEvent = function useAttachEvent(element, event, cb) {\n var cbDefined = !!cb;\n var cbRef = React.useRef(cb); // In many integrations the callback prop changes on each render.\n // Using a ref saves us from calling element.on/.off every render.\n\n React.useEffect(function () {\n cbRef.current = cb;\n }, [cb]);\n React.useEffect(function () {\n if (!cbDefined || !element) {\n return function () {};\n }\n\n var decoratedCb = function decoratedCb() {\n if (cbRef.current) {\n cbRef.current.apply(cbRef, arguments);\n }\n };\n\n element.on(event, decoratedCb);\n return function () {\n element.off(event, decoratedCb);\n };\n }, [cbDefined, event, element, cbRef]);\n};\n\nvar usePrevious = function usePrevious(value) {\n var ref = React.useRef(value);\n React.useEffect(function () {\n ref.current = value;\n }, [value]);\n return ref.current;\n};\n\nvar isUnknownObject = function isUnknownObject(raw) {\n return raw !== null && _typeof(raw) === 'object';\n};\nvar isPromise = function isPromise(raw) {\n return isUnknownObject(raw) && typeof raw.then === 'function';\n}; // We are using types to enforce the `stripe` prop in this lib,\n// but in an untyped integration `stripe` could be anything, so we need\n// to do some sanity validation to prevent type errors.\n\nvar isStripe = function isStripe(raw) {\n return isUnknownObject(raw) && typeof raw.elements === 'function' && typeof raw.createToken === 'function' && typeof raw.createPaymentMethod === 'function' && typeof raw.confirmCardPayment === 'function';\n};\n\nvar PLAIN_OBJECT_STR = '[object Object]';\nvar isEqual = function isEqual(left, right) {\n if (!isUnknownObject(left) || !isUnknownObject(right)) {\n return left === right;\n }\n\n var leftArray = Array.isArray(left);\n var rightArray = Array.isArray(right);\n if (leftArray !== rightArray) return false;\n var leftPlainObject = Object.prototype.toString.call(left) === PLAIN_OBJECT_STR;\n var rightPlainObject = Object.prototype.toString.call(right) === PLAIN_OBJECT_STR;\n if (leftPlainObject !== rightPlainObject) return false; // not sure what sort of special object this is (regexp is one option), so\n // fallback to reference check.\n\n if (!leftPlainObject && !leftArray) return left === right;\n var leftKeys = Object.keys(left);\n var rightKeys = Object.keys(right);\n if (leftKeys.length !== rightKeys.length) return false;\n var keySet = {};\n\n for (var i = 0; i < leftKeys.length; i += 1) {\n keySet[leftKeys[i]] = true;\n }\n\n for (var _i = 0; _i < rightKeys.length; _i += 1) {\n keySet[rightKeys[_i]] = true;\n }\n\n var allKeys = Object.keys(keySet);\n\n if (allKeys.length !== leftKeys.length) {\n return false;\n }\n\n var l = left;\n var r = right;\n\n var pred = function pred(key) {\n return isEqual(l[key], r[key]);\n };\n\n return allKeys.every(pred);\n};\n\nvar extractAllowedOptionsUpdates = function extractAllowedOptionsUpdates(options, prevOptions, immutableKeys) {\n if (!isUnknownObject(options)) {\n return null;\n }\n\n return Object.keys(options).reduce(function (newOptions, key) {\n var isUpdated = !isUnknownObject(prevOptions) || !isEqual(options[key], prevOptions[key]);\n\n if (immutableKeys.includes(key)) {\n if (isUpdated) {\n console.warn(\"Unsupported prop change: options.\".concat(key, \" is not a mutable property.\"));\n }\n\n return newOptions;\n }\n\n if (!isUpdated) {\n return newOptions;\n }\n\n return _objectSpread2(_objectSpread2({}, newOptions || {}), {}, _defineProperty({}, key, options[key]));\n }, null);\n};\n\nvar INVALID_STRIPE_ERROR$2 = 'Invalid prop `stripe` supplied to `Elements`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.'; // We are using types to enforce the `stripe` prop in this lib, but in a real\n// integration `stripe` could be anything, so we need to do some sanity\n// validation to prevent type errors.\n\nvar validateStripe = function validateStripe(maybeStripe) {\n var errorMsg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : INVALID_STRIPE_ERROR$2;\n\n if (maybeStripe === null || isStripe(maybeStripe)) {\n return maybeStripe;\n }\n\n throw new Error(errorMsg);\n};\n\nvar parseStripeProp = function parseStripeProp(raw) {\n var errorMsg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : INVALID_STRIPE_ERROR$2;\n\n if (isPromise(raw)) {\n return {\n tag: 'async',\n stripePromise: Promise.resolve(raw).then(function (result) {\n return validateStripe(result, errorMsg);\n })\n };\n }\n\n var stripe = validateStripe(raw, errorMsg);\n\n if (stripe === null) {\n return {\n tag: 'empty'\n };\n }\n\n return {\n tag: 'sync',\n stripe: stripe\n };\n};\n\nvar registerWithStripeJs = function registerWithStripeJs(stripe) {\n if (!stripe || !stripe._registerWrapper || !stripe.registerAppInfo) {\n return;\n }\n\n stripe._registerWrapper({\n name: 'react-stripe-js',\n version: \"2.8.1\"\n });\n\n stripe.registerAppInfo({\n name: 'react-stripe-js',\n version: \"2.8.1\",\n url: 'https://stripe.com/docs/stripe-js/react'\n });\n};\n\nvar ElementsContext = /*#__PURE__*/React.createContext(null);\nElementsContext.displayName = 'ElementsContext';\nvar parseElementsContext = function parseElementsContext(ctx, useCase) {\n if (!ctx) {\n throw new Error(\"Could not find Elements context; You need to wrap the part of your app that \".concat(useCase, \" in an provider.\"));\n }\n\n return ctx;\n};\n/**\n * The `Elements` provider allows you to use [Element components](https://stripe.com/docs/stripe-js/react#element-components) and access the [Stripe object](https://stripe.com/docs/js/initializing) in any nested component.\n * Render an `Elements` provider at the root of your React app so that it is available everywhere you need it.\n *\n * To use the `Elements` provider, call `loadStripe` from `@stripe/stripe-js` with your publishable key.\n * The `loadStripe` function will asynchronously load the Stripe.js script and initialize a `Stripe` object.\n * Pass the returned `Promise` to `Elements`.\n *\n * @docs https://stripe.com/docs/stripe-js/react#elements-provider\n */\n\nvar Elements = function Elements(_ref) {\n var rawStripeProp = _ref.stripe,\n options = _ref.options,\n children = _ref.children;\n var parsed = React.useMemo(function () {\n return parseStripeProp(rawStripeProp);\n }, [rawStripeProp]); // For a sync stripe instance, initialize into context\n\n var _React$useState = React.useState(function () {\n return {\n stripe: parsed.tag === 'sync' ? parsed.stripe : null,\n elements: parsed.tag === 'sync' ? parsed.stripe.elements(options) : null\n };\n }),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n ctx = _React$useState2[0],\n setContext = _React$useState2[1];\n\n React.useEffect(function () {\n var isMounted = true;\n\n var safeSetContext = function safeSetContext(stripe) {\n setContext(function (ctx) {\n // no-op if we already have a stripe instance (https://github.com/stripe/react-stripe-js/issues/296)\n if (ctx.stripe) return ctx;\n return {\n stripe: stripe,\n elements: stripe.elements(options)\n };\n });\n }; // For an async stripePromise, store it in context once resolved\n\n\n if (parsed.tag === 'async' && !ctx.stripe) {\n parsed.stripePromise.then(function (stripe) {\n if (stripe && isMounted) {\n // Only update Elements context if the component is still mounted\n // and stripe is not null. We allow stripe to be null to make\n // handling SSR easier.\n safeSetContext(stripe);\n }\n });\n } else if (parsed.tag === 'sync' && !ctx.stripe) {\n // Or, handle a sync stripe instance going from null -> populated\n safeSetContext(parsed.stripe);\n }\n\n return function () {\n isMounted = false;\n };\n }, [parsed, ctx, options]); // Warn on changes to stripe prop\n\n var prevStripe = usePrevious(rawStripeProp);\n React.useEffect(function () {\n if (prevStripe !== null && prevStripe !== rawStripeProp) {\n console.warn('Unsupported prop change on Elements: You cannot change the `stripe` prop after setting it.');\n }\n }, [prevStripe, rawStripeProp]); // Apply updates to elements when options prop has relevant changes\n\n var prevOptions = usePrevious(options);\n React.useEffect(function () {\n if (!ctx.elements) {\n return;\n }\n\n var updates = extractAllowedOptionsUpdates(options, prevOptions, ['clientSecret', 'fonts']);\n\n if (updates) {\n ctx.elements.update(updates);\n }\n }, [options, prevOptions, ctx.elements]); // Attach react-stripe-js version to stripe.js instance\n\n React.useEffect(function () {\n registerWithStripeJs(ctx.stripe);\n }, [ctx.stripe]);\n return /*#__PURE__*/React.createElement(ElementsContext.Provider, {\n value: ctx\n }, children);\n};\nElements.propTypes = {\n stripe: PropTypes.any,\n options: PropTypes.object\n};\nvar useElementsContextWithUseCase = function useElementsContextWithUseCase(useCaseMessage) {\n var ctx = React.useContext(ElementsContext);\n return parseElementsContext(ctx, useCaseMessage);\n};\n/**\n * @docs https://stripe.com/docs/stripe-js/react#useelements-hook\n */\n\nvar useElements = function useElements() {\n var _useElementsContextWi = useElementsContextWithUseCase('calls useElements()'),\n elements = _useElementsContextWi.elements;\n\n return elements;\n};\n/**\n * @docs https://stripe.com/docs/stripe-js/react#elements-consumer\n */\n\nvar ElementsConsumer = function ElementsConsumer(_ref2) {\n var children = _ref2.children;\n var ctx = useElementsContextWithUseCase('mounts '); // Assert to satisfy the busted React.FC return type (it should be ReactNode)\n\n return children(ctx);\n};\nElementsConsumer.propTypes = {\n children: PropTypes.func.isRequired\n};\n\nvar _excluded = [\"on\", \"session\"];\nvar CustomCheckoutSdkContext = /*#__PURE__*/React.createContext(null);\nCustomCheckoutSdkContext.displayName = 'CustomCheckoutSdkContext';\nvar parseCustomCheckoutSdkContext = function parseCustomCheckoutSdkContext(ctx, useCase) {\n if (!ctx) {\n throw new Error(\"Could not find CustomCheckoutProvider context; You need to wrap the part of your app that \".concat(useCase, \" in an provider.\"));\n }\n\n return ctx;\n};\nvar CustomCheckoutContext = /*#__PURE__*/React.createContext(null);\nCustomCheckoutContext.displayName = 'CustomCheckoutContext';\nvar extractCustomCheckoutContextValue = function extractCustomCheckoutContextValue(customCheckoutSdk, sessionState) {\n if (!customCheckoutSdk) {\n return null;\n }\n\n customCheckoutSdk.on;\n customCheckoutSdk.session;\n var actions = _objectWithoutProperties(customCheckoutSdk, _excluded);\n\n if (!sessionState) {\n return _objectSpread2(_objectSpread2({}, actions), customCheckoutSdk.session());\n }\n\n return _objectSpread2(_objectSpread2({}, actions), sessionState);\n};\nvar INVALID_STRIPE_ERROR$1 = 'Invalid prop `stripe` supplied to `CustomCheckoutProvider`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.';\nvar CustomCheckoutProvider = function CustomCheckoutProvider(_ref) {\n var rawStripeProp = _ref.stripe,\n options = _ref.options,\n children = _ref.children;\n var parsed = React.useMemo(function () {\n return parseStripeProp(rawStripeProp, INVALID_STRIPE_ERROR$1);\n }, [rawStripeProp]); // State used to trigger a re-render when sdk.session is updated\n\n var _React$useState = React.useState(null),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n session = _React$useState2[0],\n setSession = _React$useState2[1];\n\n var _React$useState3 = React.useState(function () {\n return {\n stripe: parsed.tag === 'sync' ? parsed.stripe : null,\n customCheckoutSdk: null\n };\n }),\n _React$useState4 = _slicedToArray(_React$useState3, 2),\n ctx = _React$useState4[0],\n setContext = _React$useState4[1];\n\n var safeSetContext = function safeSetContext(stripe, customCheckoutSdk) {\n setContext(function (ctx) {\n if (ctx.stripe && ctx.customCheckoutSdk) {\n return ctx;\n }\n\n return {\n stripe: stripe,\n customCheckoutSdk: customCheckoutSdk\n };\n });\n }; // Ref used to avoid calling initCustomCheckout multiple times when options changes\n\n\n var initCustomCheckoutCalledRef = React.useRef(false);\n React.useEffect(function () {\n var isMounted = true;\n\n if (parsed.tag === 'async' && !ctx.stripe) {\n parsed.stripePromise.then(function (stripe) {\n if (stripe && isMounted && !initCustomCheckoutCalledRef.current) {\n // Only update context if the component is still mounted\n // and stripe is not null. We allow stripe to be null to make\n // handling SSR easier.\n initCustomCheckoutCalledRef.current = true;\n stripe.initCustomCheckout(options).then(function (customCheckoutSdk) {\n if (customCheckoutSdk) {\n safeSetContext(stripe, customCheckoutSdk);\n customCheckoutSdk.on('change', setSession);\n }\n });\n }\n });\n } else if (parsed.tag === 'sync' && parsed.stripe && !initCustomCheckoutCalledRef.current) {\n initCustomCheckoutCalledRef.current = true;\n parsed.stripe.initCustomCheckout(options).then(function (customCheckoutSdk) {\n if (customCheckoutSdk) {\n safeSetContext(parsed.stripe, customCheckoutSdk);\n customCheckoutSdk.on('change', setSession);\n }\n });\n }\n\n return function () {\n isMounted = false;\n };\n }, [parsed, ctx, options, setSession]); // Warn on changes to stripe prop\n\n var prevStripe = usePrevious(rawStripeProp);\n React.useEffect(function () {\n if (prevStripe !== null && prevStripe !== rawStripeProp) {\n console.warn('Unsupported prop change on CustomCheckoutProvider: You cannot change the `stripe` prop after setting it.');\n }\n }, [prevStripe, rawStripeProp]); // Apply updates to elements when options prop has relevant changes\n\n var prevOptions = usePrevious(options);\n React.useEffect(function () {\n var _prevOptions$elements, _options$elementsOpti;\n\n if (!ctx.customCheckoutSdk) {\n return;\n }\n\n if (options.clientSecret && !isUnknownObject(prevOptions) && !isEqual(options.clientSecret, prevOptions.clientSecret)) {\n console.warn('Unsupported prop change: options.client_secret is not a mutable property.');\n }\n\n var previousAppearance = prevOptions === null || prevOptions === void 0 ? void 0 : (_prevOptions$elements = prevOptions.elementsOptions) === null || _prevOptions$elements === void 0 ? void 0 : _prevOptions$elements.appearance;\n var currentAppearance = options === null || options === void 0 ? void 0 : (_options$elementsOpti = options.elementsOptions) === null || _options$elementsOpti === void 0 ? void 0 : _options$elementsOpti.appearance;\n\n if (currentAppearance && !isEqual(currentAppearance, previousAppearance)) {\n ctx.customCheckoutSdk.changeAppearance(currentAppearance);\n }\n }, [options, prevOptions, ctx.customCheckoutSdk]); // Attach react-stripe-js version to stripe.js instance\n\n React.useEffect(function () {\n registerWithStripeJs(ctx.stripe);\n }, [ctx.stripe]);\n var customCheckoutContextValue = React.useMemo(function () {\n return extractCustomCheckoutContextValue(ctx.customCheckoutSdk, session);\n }, [ctx.customCheckoutSdk, session]);\n\n if (!ctx.customCheckoutSdk) {\n return null;\n }\n\n return /*#__PURE__*/React.createElement(CustomCheckoutSdkContext.Provider, {\n value: ctx\n }, /*#__PURE__*/React.createElement(CustomCheckoutContext.Provider, {\n value: customCheckoutContextValue\n }, children));\n};\nCustomCheckoutProvider.propTypes = {\n stripe: PropTypes.any,\n options: PropTypes.shape({\n clientSecret: PropTypes.string.isRequired,\n elementsOptions: PropTypes.object\n }).isRequired\n};\nvar useCustomCheckoutSdkContextWithUseCase = function useCustomCheckoutSdkContextWithUseCase(useCaseString) {\n var ctx = React.useContext(CustomCheckoutSdkContext);\n return parseCustomCheckoutSdkContext(ctx, useCaseString);\n};\nvar useElementsOrCustomCheckoutSdkContextWithUseCase = function useElementsOrCustomCheckoutSdkContextWithUseCase(useCaseString) {\n var customCheckoutSdkContext = React.useContext(CustomCheckoutSdkContext);\n var elementsContext = React.useContext(ElementsContext);\n\n if (customCheckoutSdkContext && elementsContext) {\n throw new Error(\"You cannot wrap the part of your app that \".concat(useCaseString, \" in both and providers.\"));\n }\n\n if (customCheckoutSdkContext) {\n return parseCustomCheckoutSdkContext(customCheckoutSdkContext, useCaseString);\n }\n\n return parseElementsContext(elementsContext, useCaseString);\n};\nvar useCustomCheckout = function useCustomCheckout() {\n // ensure it's in CustomCheckoutProvider\n useCustomCheckoutSdkContextWithUseCase('calls useCustomCheckout()');\n var ctx = React.useContext(CustomCheckoutContext);\n\n if (!ctx) {\n throw new Error('Could not find CustomCheckout Context; You need to wrap the part of your app that calls useCustomCheckout() in an provider.');\n }\n\n return ctx;\n};\n\nvar capitalized = function capitalized(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n};\n\nvar createElementComponent = function createElementComponent(type, isServer) {\n var displayName = \"\".concat(capitalized(type), \"Element\");\n\n var ClientElement = function ClientElement(_ref) {\n var id = _ref.id,\n className = _ref.className,\n _ref$options = _ref.options,\n options = _ref$options === void 0 ? {} : _ref$options,\n onBlur = _ref.onBlur,\n onFocus = _ref.onFocus,\n onReady = _ref.onReady,\n onChange = _ref.onChange,\n onEscape = _ref.onEscape,\n onClick = _ref.onClick,\n onLoadError = _ref.onLoadError,\n onLoaderStart = _ref.onLoaderStart,\n onNetworksChange = _ref.onNetworksChange,\n onConfirm = _ref.onConfirm,\n onCancel = _ref.onCancel,\n onShippingAddressChange = _ref.onShippingAddressChange,\n onShippingRateChange = _ref.onShippingRateChange;\n var ctx = useElementsOrCustomCheckoutSdkContextWithUseCase(\"mounts <\".concat(displayName, \">\"));\n var elements = 'elements' in ctx ? ctx.elements : null;\n var customCheckoutSdk = 'customCheckoutSdk' in ctx ? ctx.customCheckoutSdk : null;\n\n var _React$useState = React.useState(null),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n element = _React$useState2[0],\n setElement = _React$useState2[1];\n\n var elementRef = React.useRef(null);\n var domNode = React.useRef(null); // For every event where the merchant provides a callback, call element.on\n // with that callback. If the merchant ever changes the callback, removes\n // the old callback with element.off and then call element.on with the new one.\n\n useAttachEvent(element, 'blur', onBlur);\n useAttachEvent(element, 'focus', onFocus);\n useAttachEvent(element, 'escape', onEscape);\n useAttachEvent(element, 'click', onClick);\n useAttachEvent(element, 'loaderror', onLoadError);\n useAttachEvent(element, 'loaderstart', onLoaderStart);\n useAttachEvent(element, 'networkschange', onNetworksChange);\n useAttachEvent(element, 'confirm', onConfirm);\n useAttachEvent(element, 'cancel', onCancel);\n useAttachEvent(element, 'shippingaddresschange', onShippingAddressChange);\n useAttachEvent(element, 'shippingratechange', onShippingRateChange);\n useAttachEvent(element, 'change', onChange);\n var readyCallback;\n\n if (onReady) {\n if (type === 'expressCheckout') {\n // Passes through the event, which includes visible PM types\n readyCallback = onReady;\n } else {\n // For other Elements, pass through the Element itself.\n readyCallback = function readyCallback() {\n onReady(element);\n };\n }\n }\n\n useAttachEvent(element, 'ready', readyCallback);\n React.useLayoutEffect(function () {\n if (elementRef.current === null && domNode.current !== null && (elements || customCheckoutSdk)) {\n var newElement = null;\n\n if (customCheckoutSdk) {\n newElement = customCheckoutSdk.createElement(type, options);\n } else if (elements) {\n newElement = elements.create(type, options);\n } // Store element in a ref to ensure it's _immediately_ available in cleanup hooks in StrictMode\n\n\n elementRef.current = newElement; // Store element in state to facilitate event listener attachment\n\n setElement(newElement);\n\n if (newElement) {\n newElement.mount(domNode.current);\n }\n }\n }, [elements, customCheckoutSdk, options]);\n var prevOptions = usePrevious(options);\n React.useEffect(function () {\n if (!elementRef.current) {\n return;\n }\n\n var updates = extractAllowedOptionsUpdates(options, prevOptions, ['paymentRequest']);\n\n if (updates && 'update' in elementRef.current) {\n elementRef.current.update(updates);\n }\n }, [options, prevOptions]);\n React.useLayoutEffect(function () {\n return function () {\n if (elementRef.current && typeof elementRef.current.destroy === 'function') {\n try {\n elementRef.current.destroy();\n elementRef.current = null;\n } catch (error) {// Do nothing\n }\n }\n };\n }, []);\n return /*#__PURE__*/React.createElement(\"div\", {\n id: id,\n className: className,\n ref: domNode\n });\n }; // Only render the Element wrapper in a server environment.\n\n\n var ServerElement = function ServerElement(props) {\n useElementsOrCustomCheckoutSdkContextWithUseCase(\"mounts <\".concat(displayName, \">\"));\n var id = props.id,\n className = props.className;\n return /*#__PURE__*/React.createElement(\"div\", {\n id: id,\n className: className\n });\n };\n\n var Element = isServer ? ServerElement : ClientElement;\n Element.propTypes = {\n id: PropTypes.string,\n className: PropTypes.string,\n onChange: PropTypes.func,\n onBlur: PropTypes.func,\n onFocus: PropTypes.func,\n onReady: PropTypes.func,\n onEscape: PropTypes.func,\n onClick: PropTypes.func,\n onLoadError: PropTypes.func,\n onLoaderStart: PropTypes.func,\n onNetworksChange: PropTypes.func,\n onConfirm: PropTypes.func,\n onCancel: PropTypes.func,\n onShippingAddressChange: PropTypes.func,\n onShippingRateChange: PropTypes.func,\n options: PropTypes.object\n };\n Element.displayName = displayName;\n Element.__elementType = type;\n return Element;\n};\n\nvar isServer = typeof window === 'undefined';\n\nvar EmbeddedCheckoutContext = /*#__PURE__*/React.createContext(null);\nEmbeddedCheckoutContext.displayName = 'EmbeddedCheckoutProviderContext';\nvar useEmbeddedCheckoutContext = function useEmbeddedCheckoutContext() {\n var ctx = React.useContext(EmbeddedCheckoutContext);\n\n if (!ctx) {\n throw new Error(' must be used within ');\n }\n\n return ctx;\n};\nvar INVALID_STRIPE_ERROR = 'Invalid prop `stripe` supplied to `EmbeddedCheckoutProvider`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.';\nvar EmbeddedCheckoutProvider = function EmbeddedCheckoutProvider(_ref) {\n var rawStripeProp = _ref.stripe,\n options = _ref.options,\n children = _ref.children;\n var parsed = React.useMemo(function () {\n return parseStripeProp(rawStripeProp, INVALID_STRIPE_ERROR);\n }, [rawStripeProp]);\n var embeddedCheckoutPromise = React.useRef(null);\n var loadedStripe = React.useRef(null);\n\n var _React$useState = React.useState({\n embeddedCheckout: null\n }),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n ctx = _React$useState2[0],\n setContext = _React$useState2[1];\n\n React.useEffect(function () {\n // Don't support any ctx updates once embeddedCheckout or stripe is set.\n if (loadedStripe.current || embeddedCheckoutPromise.current) {\n return;\n }\n\n var setStripeAndInitEmbeddedCheckout = function setStripeAndInitEmbeddedCheckout(stripe) {\n if (loadedStripe.current || embeddedCheckoutPromise.current) return;\n loadedStripe.current = stripe;\n embeddedCheckoutPromise.current = loadedStripe.current.initEmbeddedCheckout(options).then(function (embeddedCheckout) {\n setContext({\n embeddedCheckout: embeddedCheckout\n });\n });\n }; // For an async stripePromise, store it once resolved\n\n\n if (parsed.tag === 'async' && !loadedStripe.current && (options.clientSecret || options.fetchClientSecret)) {\n parsed.stripePromise.then(function (stripe) {\n if (stripe) {\n setStripeAndInitEmbeddedCheckout(stripe);\n }\n });\n } else if (parsed.tag === 'sync' && !loadedStripe.current && (options.clientSecret || options.fetchClientSecret)) {\n // Or, handle a sync stripe instance going from null -> populated\n setStripeAndInitEmbeddedCheckout(parsed.stripe);\n }\n }, [parsed, options, ctx, loadedStripe]);\n React.useEffect(function () {\n // cleanup on unmount\n return function () {\n // If embedded checkout is fully initialized, destroy it.\n if (ctx.embeddedCheckout) {\n embeddedCheckoutPromise.current = null;\n ctx.embeddedCheckout.destroy();\n } else if (embeddedCheckoutPromise.current) {\n // If embedded checkout is still initializing, destroy it once\n // it's done. This could be caused by unmounting very quickly\n // after mounting.\n embeddedCheckoutPromise.current.then(function () {\n embeddedCheckoutPromise.current = null;\n\n if (ctx.embeddedCheckout) {\n ctx.embeddedCheckout.destroy();\n }\n });\n }\n };\n }, [ctx.embeddedCheckout]); // Attach react-stripe-js version to stripe.js instance\n\n React.useEffect(function () {\n registerWithStripeJs(loadedStripe);\n }, [loadedStripe]); // Warn on changes to stripe prop.\n // The stripe prop value can only go from null to non-null once and\n // can't be changed after that.\n\n var prevStripe = usePrevious(rawStripeProp);\n React.useEffect(function () {\n if (prevStripe !== null && prevStripe !== rawStripeProp) {\n console.warn('Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the `stripe` prop after setting it.');\n }\n }, [prevStripe, rawStripeProp]); // Warn on changes to options.\n\n var prevOptions = usePrevious(options);\n React.useEffect(function () {\n if (prevOptions == null) {\n return;\n }\n\n if (options == null) {\n console.warn('Unsupported prop change on EmbeddedCheckoutProvider: You cannot unset options after setting them.');\n return;\n }\n\n if (options.clientSecret === undefined && options.fetchClientSecret === undefined) {\n console.warn('Invalid props passed to EmbeddedCheckoutProvider: You must provide one of either `options.fetchClientSecret` or `options.clientSecret`.');\n }\n\n if (prevOptions.clientSecret != null && options.clientSecret !== prevOptions.clientSecret) {\n console.warn('Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the client secret after setting it. Unmount and create a new instance of EmbeddedCheckoutProvider instead.');\n }\n\n if (prevOptions.fetchClientSecret != null && options.fetchClientSecret !== prevOptions.fetchClientSecret) {\n console.warn('Unsupported prop change on EmbeddedCheckoutProvider: You cannot change fetchClientSecret after setting it. Unmount and create a new instance of EmbeddedCheckoutProvider instead.');\n }\n\n if (prevOptions.onComplete != null && options.onComplete !== prevOptions.onComplete) {\n console.warn('Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the onComplete option after setting it.');\n }\n\n if (prevOptions.onShippingDetailsChange != null && options.onShippingDetailsChange !== prevOptions.onShippingDetailsChange) {\n console.warn('Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the onShippingDetailsChange option after setting it.');\n }\n\n if (prevOptions.onLineItemsChange != null && options.onLineItemsChange !== prevOptions.onLineItemsChange) {\n console.warn('Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the onLineItemsChange option after setting it.');\n }\n }, [prevOptions, options]);\n return /*#__PURE__*/React.createElement(EmbeddedCheckoutContext.Provider, {\n value: ctx\n }, children);\n};\n\nvar EmbeddedCheckoutClientElement = function EmbeddedCheckoutClientElement(_ref) {\n var id = _ref.id,\n className = _ref.className;\n\n var _useEmbeddedCheckoutC = useEmbeddedCheckoutContext(),\n embeddedCheckout = _useEmbeddedCheckoutC.embeddedCheckout;\n\n var isMounted = React.useRef(false);\n var domNode = React.useRef(null);\n React.useLayoutEffect(function () {\n if (!isMounted.current && embeddedCheckout && domNode.current !== null) {\n embeddedCheckout.mount(domNode.current);\n isMounted.current = true;\n } // Clean up on unmount\n\n\n return function () {\n if (isMounted.current && embeddedCheckout) {\n try {\n embeddedCheckout.unmount();\n isMounted.current = false;\n } catch (e) {// Do nothing.\n // Parent effects are destroyed before child effects, so\n // in cases where both the EmbeddedCheckoutProvider and\n // the EmbeddedCheckout component are removed at the same\n // time, the embeddedCheckout instance will be destroyed,\n // which causes an error when calling unmount.\n }\n }\n };\n }, [embeddedCheckout]);\n return /*#__PURE__*/React.createElement(\"div\", {\n ref: domNode,\n id: id,\n className: className\n });\n}; // Only render the wrapper in a server environment.\n\n\nvar EmbeddedCheckoutServerElement = function EmbeddedCheckoutServerElement(_ref2) {\n var id = _ref2.id,\n className = _ref2.className;\n // Validate that we are in the right context by calling useEmbeddedCheckoutContext.\n useEmbeddedCheckoutContext();\n return /*#__PURE__*/React.createElement(\"div\", {\n id: id,\n className: className\n });\n};\n\nvar EmbeddedCheckout = isServer ? EmbeddedCheckoutServerElement : EmbeddedCheckoutClientElement;\n\n/**\n * @docs https://stripe.com/docs/stripe-js/react#usestripe-hook\n */\n\nvar useStripe = function useStripe() {\n var _useElementsOrCustomC = useElementsOrCustomCheckoutSdkContextWithUseCase('calls useStripe()'),\n stripe = _useElementsOrCustomC.stripe;\n\n return stripe;\n};\n\n/**\n * Requires beta access:\n * Contact [Stripe support](https://support.stripe.com/) for more information.\n *\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\nvar AuBankAccountElement = createElementComponent('auBankAccount', isServer);\n/**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\nvar CardElement = createElementComponent('card', isServer);\n/**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\nvar CardNumberElement = createElementComponent('cardNumber', isServer);\n/**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\nvar CardExpiryElement = createElementComponent('cardExpiry', isServer);\n/**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\nvar CardCvcElement = createElementComponent('cardCvc', isServer);\n/**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\nvar FpxBankElement = createElementComponent('fpxBank', isServer);\n/**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\nvar IbanElement = createElementComponent('iban', isServer);\n/**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\nvar IdealBankElement = createElementComponent('idealBank', isServer);\n/**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\nvar P24BankElement = createElementComponent('p24Bank', isServer);\n/**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\nvar EpsBankElement = createElementComponent('epsBank', isServer);\nvar PaymentElement = createElementComponent('payment', isServer);\n/**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\nvar ExpressCheckoutElement = createElementComponent('expressCheckout', isServer);\n/**\n * Requires beta access:\n * Contact [Stripe support](https://support.stripe.com/) for more information.\n */\n\nvar CurrencySelectorElement = createElementComponent('currencySelector', isServer);\n/**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\nvar PaymentRequestButtonElement = createElementComponent('paymentRequestButton', isServer);\n/**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\nvar LinkAuthenticationElement = createElementComponent('linkAuthentication', isServer);\n/**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\nvar AddressElement = createElementComponent('address', isServer);\n/**\n * @deprecated\n * Use `AddressElement` instead.\n *\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\nvar ShippingAddressElement = createElementComponent('shippingAddress', isServer);\n/**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\nvar PaymentMethodMessagingElement = createElementComponent('paymentMethodMessaging', isServer);\n/**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\nvar AffirmMessageElement = createElementComponent('affirmMessage', isServer);\n/**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\nvar AfterpayClearpayMessageElement = createElementComponent('afterpayClearpayMessage', isServer);\n\nexport { AddressElement, AffirmMessageElement, AfterpayClearpayMessageElement, AuBankAccountElement, CardCvcElement, CardElement, CardExpiryElement, CardNumberElement, CurrencySelectorElement, CustomCheckoutProvider, Elements, ElementsConsumer, EmbeddedCheckout, EmbeddedCheckoutProvider, EpsBankElement, ExpressCheckoutElement, FpxBankElement, IbanElement, IdealBankElement, LinkAuthenticationElement, P24BankElement, PaymentElement, PaymentMethodMessagingElement, PaymentRequestButtonElement, ShippingAddressElement, useCustomCheckout, useElements, useStripe };\n","import { type ApolloClient, type NormalizedCacheObject } from \"@apollo/client\";\nimport { PAYMENT_INTENT_CREATE_MUTATION } from \"../gql\";\nexport interface CreatePaymentIntentProps {\n idempotencyKey: string;\n amountCents: number;\n currency: string;\n automaticPaymentMethods?: boolean;\n customerId?: string;\n description?: string;\n metadata?: any;\n}\n\nexport async function createPaymentIntent(client: ApolloClient, variables: CreatePaymentIntentProps) {\n try { \n const { data, errors } = await client.mutate({\n mutation: PAYMENT_INTENT_CREATE_MUTATION,\n variables\n })\n \n return {\n data: data?.create_payment_intent,\n errors\n }\n } catch(e) {\n return {\n data: null,\n errors: [e]\n }\n }\n} ","import React, { useState } from 'react';\nimport { type ApolloClient, type NormalizedCacheObject } from '@apollo/client';\nimport { PaymentElement, useStripe, useElements } from '@stripe/react-stripe-js';\n\nimport { createPaymentIntent } from './create-payment-intent';\nimport type { StripeCheckoutProps } from '.';\n\ninterface StripeCheckoutFormProps {\n amount: StripeCheckoutProps['amount'];\n beforeConfirmPayment?: StripeCheckoutProps['beforeConfirmPayment'];\n onConfirmRedirectUrl: StripeCheckoutProps['onConfirmRedirectUrl'];\n paymentIntentIdempotencyKey: StripeCheckoutProps['paymentIntentIdempotencyKey'];\n client: ApolloClient;\n}\n\nexport const StripeCheckoutForm = ({ \n amount, \n beforeConfirmPayment, \n onConfirmRedirectUrl,\n paymentIntentIdempotencyKey,\n client\n}: StripeCheckoutFormProps) => {\n const stripe = useStripe();\n const elements = useElements();\n const [errorMessage, setErrorMessage] = useState(null);\n const [isProcessing, setIsProcessing] = useState(false);\n\n const handleError = (error: any) => {\n setErrorMessage(error.message);\n setIsProcessing(false);\n }\n\n const handleSubmit = async (event: React.FormEvent) => {\n event.preventDefault();\n\n if (!stripe || !elements) {\n return;\n }\n\n setIsProcessing(true);\n\n // Trigger form validation and wallet collection\n const {error: submitError} = await elements.submit();\n if (submitError) {\n handleError(submitError);\n return;\n }\n\n const { data: paymentIntent, errors } = await createPaymentIntent(client, {\n idempotencyKey: paymentIntentIdempotencyKey,\n amountCents: amount.cents,\n currency: amount.currency,\n });\n\n if (errors){\n handleError(errors[0]);\n return;\n }\n\n if (beforeConfirmPayment) {\n const { errors } = await beforeConfirmPayment(paymentIntent)\n if (errors) {\n handleError(errors[0]);\n return;\n }\n }\n \n const { \n error \n } = await stripe.confirmPayment({\n elements,\n clientSecret: paymentIntent.client_secret,\n confirmParams: {\n return_url: onConfirmRedirectUrl,\n },\n });\n\n if (error) {\n handleError(error || new Error('An error occurred during payment.'));\n } else {\n // Your customer is redirected to your `return_url`. For some payment\n // methods like iDEAL, your customer is redirected to an intermediate\n // site first to authorize the payment, then redirected to the `return_url`.\n // setIsProcessing(false);\n }\n };\n\n return (\n
    \n \n {errorMessage &&
    {errorMessage}
    }\n \n {isProcessing ? 'Processing...' : `Pay ${amount.formatted}`}\n \n \n );\n};","import { ApolloClient , NormalizedCacheObject } from '@apollo/client';\nimport { type StripeElementsOptions, type Stripe } from '@stripe/stripe-js';\nimport { Elements } from '@stripe/react-stripe-js';\nimport { type GraphQLFormattedError } from 'graphql';\n\nimport type { PaymentIntent } from '../types';\nimport { StripeCheckoutForm } from './Form';\n\nexport interface StripeCheckoutProps {\n amount: {\n cents: number;\n formatted: string;\n currency: string;\n }\n beforeConfirmPayment?: (paymentIntent: PaymentIntent) => Promise<{ errors?: unknown[] | readonly GraphQLFormattedError[] }>;\n elementsOptions: StripeElementsOptions\n onConfirmRedirectUrl: string;\n paymentIntentIdempotencyKey: string;\n client: ApolloClient;\n stripePromise: Promise;\n}\n\nexport const StripeCheckout = ({ \n amount, \n beforeConfirmPayment, \n elementsOptions, \n onConfirmRedirectUrl,\n paymentIntentIdempotencyKey,\n client,\n stripePromise\n}: StripeCheckoutProps) => {\n return (\n \n \n \n )\n};","import { useEffect, useMemo, useState } from \"react\";\nimport { ApolloClient, NormalizedCacheObject } from \"@apollo/client\";\nimport { loadStripe } from \"@stripe/stripe-js\";\n\nimport { useServerRedirectSearchParams } from \"../../../shared/hooks/useServerRedirectSearchParams\";\nimport { useCurrentUser } from \"../../hooks/useCurrentUser\";\nimport { StripeCheckout } from \"../../StripeCheckout\";\nimport { useVoteIntent } from \"../hooks/useVoteIntent\";\nimport { Competition, type PaymentIntent } from \"../../types\";\nimport { Share } from \"../../../shared/components/Share\";\nimport { useAnchor } from \"../../hooks/useAnchor\";\nimport { Button, TextField } from \"@mui/material\";\n\ninterface VotePanelProps {\n anchor: string;\n competitor: any;\n competition: any;\n client: ApolloClient;\n stripePublishableKey: string;\n shareUrl: string;\n theme: Competition[\"theme\"];\n freeVoteError?: string | null;\n twoForOneActive?: boolean;\n}\n\nconst VOTER_FEEDBACK_ID = \"voter-feedback\";\n\nconst getTimeUntilNextVote = () => {\n const now = new Date();\n const tomorrow = new Date(now);\n tomorrow.setUTCHours(24, 0, 0, 0);\n \n const diffMs = tomorrow.getTime() - now.getTime();\n const diffHours = Math.floor(diffMs / (1000 * 60 * 60));\n const diffMinutes = Math.floor((diffMs % (1000 * 60 * 60)) / (1000 * 60));\n \n if (diffHours > 0) {\n return `${diffHours} hour${diffHours !== 1 ? 's' : ''} and ${diffMinutes} minute${diffMinutes !== 1 ? 's' : ''}`;\n }\n return `${diffMinutes} minute${diffMinutes !== 1 ? 's' : ''}`;\n};\n\nexport const VotePanel = ({\n competitor,\n competition,\n client,\n stripePublishableKey,\n theme,\n shareUrl,\n freeVoteError,\n twoForOneActive = false\n}: VotePanelProps) => {\n const anchorPage = useAnchor();\n const [cartId, setCartId] = useState(null);\n const [comment, setComment] = useState(\"\");\n const [commentSent, setCommentSent] = useState(false);\n const [timeUntilNextVote, setTimeUntilNextVote] = useState(\"\");\n const { currentUser } = useCurrentUser();\n const { proxy: voteIntentProxy, voteIntent, createVote, updateVote } = useVoteIntent();\n const { deleteParams } = useServerRedirectSearchParams()\n const [showCommentSection, setShowCommentSection] = useState(true);\n const [showSuccessMessage, setShowSuccessMessage] = useState(false);\n\n const onStripeConfirmRedirectUrl = useMemo(() => {\n const uri = new URL(window.location.href);\n if (voteIntent.votes) {\n uri.searchParams.set(\"votes\", voteIntent.votes.toString());\n }\n\n uri.searchParams.set(\"anchor\", VOTER_FEEDBACK_ID);\n\n return uri.toString();\n }, [window.location.href, voteIntent.votes]);\n\n const beforeConfirmPayment = async (paymentIntent: PaymentIntent) => {\n const { data, errors } = await createVote(client, {\n free: false,\n votes: voteIntent.votes as number,\n paymentIntentId: paymentIntent.id,\n chargeAmountCents: voteIntent.amountCents,\n chargeProvider: \"stripe\",\n userId: currentUser?.id as string,\n competitorId: competitor?.id,\n });\n\n if (data?.id) {\n voteIntentProxy.set({ ...voteIntent, id: data.id });\n }\n\n return { errors };\n };\n\n const handleVoteIntentInitialization = () => {\n const params = new URLSearchParams(window.location.search);\n const currentIntent = voteIntentProxy.get();\n\n // Only initialize if we don't have votes already set\n if (!currentIntent.votes && !!currentUser?.id && !!params.get(\"votes\")) {\n // user is authed and redirects are persisting votes\n const votes = parseInt(params.get(\"votes\") as string);\n voteIntentProxy.resetStore({ ...currentIntent, votes });\n }\n };\n\n const handlePaymentConfirmationRedirect = () => {\n // handle stripe redirect on payment confirmation\n const params = new URLSearchParams(window.location.search);\n\n // Stripe adds payment_intent id and redirect_status to URL query params\n // We add votes to the query params to update the UI with the number of votes recorded\n if (\n params.has(\"payment_intent\") &&\n params.get(\"redirect_status\") === \"succeeded\"\n )\n onVoteSuccess();\n };\n \n async function handleCommentSubmit() {\n if (!voteIntent.id) return;\n\n try {\n await updateVote(client, {\n id: voteIntent.id,\n comment,\n });\n\n setCommentSent(true);\n setShowCommentSection(false);\n setShowSuccessMessage(true);\n } catch (error) {\n console.error(error);\n }\n }\n\n const handleSkipComment = () => {\n setShowCommentSection(false);\n setShowSuccessMessage(true);\n };\n\n const onPageMount = () => {\n handleVoteIntentInitialization();\n handlePaymentConfirmationRedirect();\n };\n\n useEffect(() => {\n onPageMount();\n const initCartId = () => {\n const id = voteIntentProxy.getCartId();\n setCartId(id);\n };\n initCartId();\n }, []);\n\n useEffect(() => {\n if (voteIntent.complete && voteIntent.votes) {\n anchorPage(VOTER_FEEDBACK_ID);\n }\n }, [voteIntent.complete, voteIntent.votes]);\n\n useEffect(() => {\n if (!freeVoteError) return;\n\n // Update immediately\n setTimeUntilNextVote(getTimeUntilNextVote());\n\n // Then update every minute\n const interval = setInterval(() => {\n setTimeUntilNextVote(getTimeUntilNextVote());\n }, 60000); // 60000ms = 1 minute\n\n return () => clearInterval(interval);\n }, [freeVoteError]);\n\n const onVoteSuccess = () => {\n if (voteIntent.active && !voteIntent.complete) {\n deleteParams([\"payment_intent\", \"redirect_status\", \"payment_intent_client_secret\", \"votes\"]);\n voteIntentProxy.markComplete();\n }\n };\n\n const renderCommentInput = () => {\n return (\n
    \n \n \n \n
    \n \n );\n };\n\n const renderVoteSuccess = () => {\n const freeVote = voteIntent.isFree;\n const successMessage = freeVote ? (\n \n Your free daily vote has been placed for {competitor.name}! Help make\n an even bigger impact for {competitor.name} with Paid Charity Votes \n that go to benefit the Bolsa Chica Conservancy, a 501(c)(3) charity.\n \n ) : (\n \n Your paid charity vote has been made! You are a rockstar! Help spread \n the word for {competitor.name} to get even more votes by sharing their\n voting page on your social profiles and with friends and family.\n \n );\n\n if (!freeVote && showCommentSection) {\n return (\n
    \n
    \n
    \n setComment(e.target.value)}\n placeholder=\"Send a note of support\"\n rows={4}\n sx={{\n width: \"100%\",\n \"& .MuiFormHelperText-root\": {\n textAlign: \"right\",\n }\n }}\n value={comment}\n variant=\"outlined\"\n helperText={`${comment.length} / 200`}\n />\n
    \n \n \n
    \n
    \n
    \n
    \n );\n }\n\n if (showSuccessMessage) {\n return (\n
    \n
    \n 🎉\n {successMessage}\n
    \n {!freeVote && (\n
    \n

    Share voting page

    \n \n
    \n )}\n
    \n );\n }\n\n return null;\n };\n\n const renderFreeVoteError = () => {\n if (!freeVoteError) return null;\n\n return (\n
    \n
    \n \n You have already used your free vote for today.\n You can vote again in {timeUntilNextVote}. You\n can still show your support for {competitor.name}\n by buying Paid Charity Votes!\n \n
    \n
    \n );\n };\n\n const stripePromise = useMemo(\n () => loadStripe(stripePublishableKey),\n [stripePublishableKey]\n );\n\n const renderPaidVoteCheckout = () => (\n <>\n

    \n Purchasing {twoForOneActive ? voteIntent.votes * 2 : voteIntent.votes} votes \n

    \n
    \n

    \n You are purchasing {twoForOneActive ? voteIntent.votes * 2 : voteIntent.votes} votes for {competitor.name} and your card will \n be charged ${voteIntent.votes}.\n

    \n
    \n {cartId && (\n \n )}\n

    \n Your purchase helps us provide the prize, run the competition \n and donate no less than twenty-five percent of the net proceeds\n to the Bolsa Chica Conservancy, a 501 (c)(3) organization.\n Purchase is not tax deductible. By purchasing you agree to our {\" \"}\n \n rules\n , \n terms of service\n and \n privacy policy\n .\n

    \n \n );\n\n const renderPanel = () => {\n if (voteIntent.complete && !freeVoteError && voteIntent.votes)\n return renderVoteSuccess();\n else if (voteIntent.isFree && freeVoteError) return renderFreeVoteError();\n else if (!voteIntent.isFree) return renderPaidVoteCheckout();\n return null;\n };\n\n if (!voteIntent.active) return null;\n\n return (\n
    \n
    \n

    \n {!voteIntent.complete && !showSuccessMessage && (\n <>\n Vote for {competitor.name}\n \n )}\n {voteIntent.complete && !voteIntent.isFree && showCommentSection && !showSuccessMessage && (\n <>\n Send a personal note to {competitor.name}\n \n )}\n

    \n
    \n {renderPanel()}\n
    \n );\n};\n","import React, { useMemo, useEffect, useState } from 'react';\nimport { Alert, AlertTitle, Typography } from '@mui/material';\n\nimport { useServerRedirectSearchParams } from '../../../shared/hooks/useServerRedirectSearchParams';\nimport { VotingWidgetProps } from '..';\nimport { AuthWidget } from '../../AuthWidget';\nimport { useAnchor } from '../../hooks/useAnchor';\nimport { useApolloClient } from '../../hooks/useApolloClient';\nimport { useCurrentUser } from '../../hooks/useCurrentUser';\nimport { useVoteIntent } from '../hooks/useVoteIntent';\nimport { VoteKind } from '../../types';\nimport { VoteCard } from './Card';\nimport { VotePanel } from './Panel';\n\n// PromoCountdown component to display time remaining until promo ends\nconst PromoCountdown = ({ endDate }: { endDate: Date }) => {\n const [timeLeft, setTimeLeft] = useState({\n days: 0,\n hours: 0,\n minutes: 0,\n seconds: 0,\n });\n\n useEffect(() => {\n const interval = setInterval(() => {\n const now = new Date().getTime();\n const end = new Date(endDate).getTime();\n const difference = end - now;\n\n if (difference > 0) {\n setTimeLeft({\n days: Math.floor(difference / (1000 * 60 * 60 * 24)),\n hours: Math.floor((difference % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)),\n minutes: Math.floor((difference % (1000 * 60 * 60)) / (1000 * 60)),\n seconds: Math.floor((difference % (1000 * 60)) / 1000),\n });\n } else {\n clearInterval(interval);\n setTimeLeft({ days: 0, hours: 0, minutes: 0, seconds: 0 });\n }\n }, 1000);\n\n return () => clearInterval(interval);\n }, [endDate]);\n\n // Determine which time units to display based on remaining time\n const showDays = timeLeft.days > 0;\n const showHours = showDays || timeLeft.hours > 0;\n const showMinutes = showHours || timeLeft.minutes > 0;\n const showSeconds = true; // Always show seconds\n\n return (\n \n Get 2 for 1 votes for the next{' '}\n {showDays && `${timeLeft.days} day${timeLeft.days !== 1 ? 's' : ''} `}\n {showHours && `${timeLeft.hours} hour${timeLeft.hours !== 1 ? 's' : ''} `}\n {showMinutes && `${timeLeft.minutes} minute${timeLeft.minutes !== 1 ? 's' : ''} `}\n {showSeconds && `${timeLeft.seconds} second${timeLeft.seconds !== 1 ? 's' : ''}`}.{' '}\n Vote now!\n \n );\n};\n\nexport function VotingWidgetContent({\n anchor,\n theme,\n competitor,\n competition,\n apiURL,\n platform_url,\n oauth_providers,\n oauth_credentials,\n stripePublishableKey,\n promos\n}: VotingWidgetProps) {\n const competitionSiteURL = useMemo(() => {\n const url = new URL(window.location.href);\n if (anchor) url.searchParams.set('anchor', anchor);\n\n return url;\n }, []);\n const client = useApolloClient(apiURL);\n const [initialized, setInitialized] = React.useState(false);\n const [authModalOpen, setAuthModalOpen] = React.useState(false);\n const [isHydrating, setIsHydrating] = React.useState(false);\n const [pendingVote, setPendingVote] = React.useState<{votes: number, type: VoteKind} | null>(null);\n const [freeVoteError, setFreeVoteError] = React.useState(null);\n const [processingFreeVote, setProcessingFreeVote] = React.useState(false);\n const [customAmount, setCustomAmount] = useState(\"\");\n const [customAmountError, setCustomAmountError] = useState(\"\");\n const anchorPage = useAnchor();\n const { currentUser, hydrate: hydrateCurrentUser, get: getCurrentUser } = useCurrentUser(client);\n const { proxy: voteIntentProxy, voteIntent, defaultVals: voteIntentDefault, initializing: voteIntentInitializing, createVote } = useVoteIntent();\n const { deleteParams } = useServerRedirectSearchParams()\n\n const platformURL = useMemo(() => {\n if (platform_url.endsWith(\"/\")) platform_url = platform_url.slice(0, -1);\n\n return platform_url;\n }, [platform_url]);\n\n const recordFreeVote = async () => {\n if (!currentUser?.id || !competitor?.id) return;\n \n setProcessingFreeVote(true);\n setFreeVoteError(null);\n\n // Get the current vote intent state to ensure we have the latest\n const currentVoteIntent = voteIntentProxy.get();\n\n const { errors } = await createVote(client, {\n free: true,\n votes: currentVoteIntent.votes as number,\n userId: currentUser.id,\n competitorId: competitor.id,\n });\n\n setProcessingFreeVote(false);\n\n if (errors) {\n setFreeVoteError((errors[0] as any).message);\n }\n\n // Mark as complete regardless of success or error\n await voteIntentProxy.markComplete();\n };\n\n const onVote: onVoteFunc = async ({ votes, voteType: type = VoteKind.Paid }) => {\n // If changing vote type or amount, reset the store first\n const currentVoteIntent = voteIntentProxy.get();\n if (currentVoteIntent.type !== type || currentVoteIntent.votes !== votes) {\n await voteIntentProxy.resetStore({ competitorId: competitor?.id, competitionId: competition?.id });\n }\n\n const newIntent = {\n competitorId: currentVoteIntent.competitorId || competitor?.id,\n competitionId: currentVoteIntent.competitionId || competition?.id,\n votes,\n type,\n completed: false,\n paymentIntentId: undefined,\n cartId: undefined\n };\n\n await voteIntentProxy.set(newIntent);\n \n if (!currentUser?.id) {\n setPendingVote({ votes, type });\n setAuthModalOpen(true);\n } else if (type === VoteKind.Free) {\n await recordFreeVote();\n }\n };\n\n const init = async () => {\n const userId = new URL(competitionSiteURL).searchParams.get('user');\n\n try {\n setIsHydrating(true);\n // Clear any existing error state first\n setFreeVoteError(null);\n \n await hydrateCurrentUser(userId as string, { enabled: !!userId });\n const user = getCurrentUser();\n\n deleteParams([\"user\"])\n \n // Get current vote intent state\n const currentVoteIntent = voteIntentProxy.get();\n \n // Reset vote intent if it's completed or has an error\n if (currentVoteIntent.completed || freeVoteError) {\n await voteIntentProxy.resetStore({ competitorId: competitor?.id, competitionId: competition?.id });\n }\n // If we have an incomplete free vote and a user, set it as pending\n else if (currentVoteIntent.type === VoteKind.Free && currentVoteIntent.votes && !currentVoteIntent.completed && user?.id) {\n setPendingVote({\n votes: currentVoteIntent.votes,\n type: VoteKind.Free\n });\n }\n \n setIsHydrating(false);\n } catch (e) {\n console.error('error hydrating current user store', e);\n setIsHydrating(false);\n }\n };\n\n const renderCustomAmountInput = () => {\n const handleAmountChange = (e) => {\n const inputValue = e.target.value;\n setCustomAmount(inputValue);\n \n // Clear error when user is typing\n if (customAmountError) setCustomAmountError(\"\");\n \n // Only update vote intent if value is valid and >= 10\n const value = parseInt(inputValue);\n if (!isNaN(value) && value >= 10) {\n voteIntentProxy.set({ ...voteIntentDefault, votes: value });\n }\n };\n\n const validateAmount = () => {\n const value = parseInt(customAmount);\n if (isNaN(value) || value < 10) {\n setCustomAmountError(\"Amount must be at least $10\");\n return false;\n }\n return true;\n };\n\n return (\n
    \n \n
    \n
    \n \n $\n \n \n
    \n {customAmountError &&

    {customAmountError}

    }\n
    \n

    $1 per vote

    \n
    \n )\n }\n\n useEffect(() => {\n (async () => {\n await init();\n })();\n }, []);\n\n useEffect(() => {\n // Reset cached vote intent if competitor or competition changes\n if (competitor?.id && competition?.id) {\n const competitorChanged = !voteIntent.competitorId || !voteIntent.competitionId || voteIntent.competitorId !== competitor.id || voteIntent.competitionId !== competition.id;\n if (competitorChanged) {\n voteIntentProxy.resetStore({ competitorId: competitor.id, competitionId: competition.id });\n }\n setInitialized(true);\n }\n }, [competitor?.id, competition?.id]);\n\n useEffect(() => {\n if (anchor && currentUser?.id && !voteIntentInitializing) {\n anchorPage(anchor);\n }\n }, [anchor, currentUser?.id, voteIntentInitializing]);\n\n useEffect(() => {\n if (currentUser?.id && pendingVote && !voteIntent.completed && !voteIntentInitializing) {\n // Auto-submit the vote after successful auth\n if (pendingVote.type === VoteKind.Free) {\n recordFreeVote();\n }\n setPendingVote(null);\n setAuthModalOpen(false);\n }\n }, [currentUser?.id, pendingVote, voteIntent.completed, voteIntentInitializing]);\n\n const shareUrl = `${competitionSiteURL.origin}${competitionSiteURL.pathname}`;\n\n if (!initialized || isHydrating || voteIntentInitializing) return null;\n\n const twoForOnePromo = promos.find((promo) => promo.type === 'TwoForOneVotePromo');\n\n return (\n <>\n {twoForOnePromo && (\n \n \n {twoForOnePromo.banner_title || '2-for 1 VOTES (for a limited time)'}\n \n {twoForOnePromo.banner_description && (\n \n {twoForOnePromo.banner_description}\n \n )}\n {twoForOnePromo.end_at && (\n \n )}\n \n )}\n

    \n IMPORTANT: Vote totals do NOT reset in these GROUP ELIMINATION ROUNDS. They are cumulative. If a competitor has 100 votes at the end of this round, they start the next round with the same 100 votes.\n Early votes will help competitors in upcoming Group elimination rounds as competition stiffens!\n

    \n
    \n
    \n {voteOptions.map((votes) => {\n const active = voteIntent.active\n ? voteIntent.votes === votes.num && voteIntent.type === votes.type\n : votes.num === 25; // default highlight to 25 votes\n return (\n \n );\n })}\n
    \n {currentUser?.id && renderCustomAmountInput()}\n {authModalOpen && (\n {\n setAuthModalOpen(false);\n setPendingVote(null);\n }} \n />\n )}\n {currentUser?.id \n && !voteIntentInitializing \n && (voteIntent.type === VoteKind.Paid || \n voteIntent.completed || \n freeVoteError) \n && (\n
    \n promo.type === 'TwoForOneVotePromo'))}\n />\n
    \n )\n }\n
    \n \n );\n}\n;\n\nexport type onVoteFunc = ({ votes, voteType }: { votes: number; voteType?: VoteKind; }) => void;\nconst voteOptions = [\n { num: 500, type: VoteKind.Paid },\n { num: 250, type: VoteKind.Paid },\n { num: 100, type: VoteKind.Paid },\n { num: 25, type: VoteKind.Paid },\n { num: 10, type: VoteKind.Paid },\n { num: 1, type: VoteKind.Free },\n];\n","import { useMemo } from 'react';\nimport { Competition, Competitor, Promo } from '../types';\nimport { VoteIntentContextProvider } from './contexts/Provider';\nimport { VotingWidgetContent } from './Content';\nimport { OAuthCredentials } from '../AuthWidget';\n\n\nexport interface VotingWidgetProps {\n theme: Competition['theme'];\n competitor: Competitor;\n competition: Competition;\n anchor?: string;\n mobile_anchor?: string;\n desktop_anchor?: string;\n apiURL: string;\n platform_url: string;\n oauth_providers: any;\n oauth_credentials: OAuthCredentials\n stripePublishableKey: string;\n promos?: Promo[];\n}\n\nexport function VotingWidget(props: VotingWidgetProps) {\n const { anchor: propAnchor, mobile_anchor, desktop_anchor, ...rest } = props;\n \n const dynamicAnchor = useMemo(() => {\n if (mobile_anchor || desktop_anchor) {\n return window.innerWidth < 1024 ? mobile_anchor || propAnchor : desktop_anchor || propAnchor;\n }\n return propAnchor;\n }, [mobile_anchor, desktop_anchor, propAnchor]);\n\n return (\n \n \n \n )\n}\n","import { PubSub } from \"pubsub-js\";\n\ndeclare global {\n interface Window {\n zaraz?: {\n track: (event: string, data: any) => void;\n };\n }\n}\n\nclass ZarazAdapter {\n private static instance = null;\n static getInstance() {\n if (!ZarazAdapter.instance) {\n ZarazAdapter.instance = new ZarazAdapter();\n }\n return ZarazAdapter.instance;\n }\n\n private constructor() {\n PubSub.subscribe(\"register\", this.onEvent);\n PubSub.subscribe(\"user\", this.onEvent);\n // if (import.meta.env.DEV) console.debug(\"Zaraz initialized\");\n }\n\n private onEvent = (topic: string, data?: any) => {\n try {\n window.zaraz?.track(topic, data || {});\n } catch (e) {\n console.warn(\"Error tracking zaraz event\", e, topic, data);\n }\n };\n}\n\nexport const ZarazConnection = ZarazAdapter.getInstance();\n","import React from \"react\";\nimport { createRoot } from \"react-dom/client\";\n\nimport { CrashErrorBoundary } from \"../shared/bugsnag\";\nimport * as components from \"../competion-components\";\nimport { ZarazConnection } from \"../shared/analytics/zaraz\";\nimport { PlatformConnection, setEgPlatformHost } from \"../shared/analytics/platform\";\n\nconst adapters = [ZarazConnection, PlatformConnection];\n// @ts-expect-error\nwindow.eg_adapters = adapters; // Ensure adapters stays in memory\n\ndocument.addEventListener(\"DOMContentLoaded\", () => {\n const sprinkles = document.querySelectorAll(\"[data-react-component]\");\n\n sprinkles.forEach((container) => {\n if (container && container instanceof HTMLElement) {\n let props = {};\n if (container.dataset.props) {\n if (container.dataset.encoded === \"true\") {\n // Decode the Base64-encoded props\n const decodedProps = atob(container.dataset.props);\n props = JSON.parse(decodedProps);\n } else {\n props = JSON.parse(container.dataset.props);\n }\n }\n const root = createRoot(container);\n\n const Component = components[container.dataset.reactComponent];\n\n if (props.platform_url) setEgPlatformHost(props.platform_url);\n\n root.render(\n React.createElement(\n CrashErrorBoundary,\n {},\n React.createElement(Component, props)\n )\n );\n }\n });\n});\n"],"names":["ErrorBoundaryContext","createContext","initialState","ErrorBoundary","Component","props","error","_this$props$onReset","_this$props","_len","args","_key","info","_this$props$onError","_this$props2","prevProps","prevState","didCatch","resetKeys","hasArrayChanged","_this$props$onReset2","_this$props3","children","fallbackRender","FallbackComponent","fallback","childToRender","createElement","a","b","item","index","useCurrentUser","client","setCurrentUser","useCallback","user","getCurrentUser","json","resetCurrentUser","hydrateCurrentUser","id","options","data","USER_QUERY","e","currentUser","bugsnagEnabled","CrashErrorBoundary","ErrorFallback","onError","_info","notifyError","event","jsx","postReportCallback","resetErrorBoundary","jsxs","styles","useRegistration","competitionId","competitorData","phone","email","birthday","name","competitorName","rest","UpdateUserMutationDocument","errors","RegisterCompetitorMutationDocument","useApolloClient","uri","useMemo","ApolloClient","InMemoryCache","AuthForm","header","subheader","oauth","setErrors","useState","serverRenderedErrors","useServerRedirectSearchParams","oauthProviders","useProviders","onCustomLoginSuccess","url","onCustomLoginErrors","renderErrors","errorStyles","key","msg","providers","provider","useEffect","Fragment","OAuthButtons","_b","_a","AuthWidget","open","onClose","type","Input","forwardRef","dataTestId","defaultValue","helperText","label","required","className","onChange","value","pattern","title","max","min","placeholder","ref","formatPhoneNumber","digits","handleChange","formattedValue","A","n","o","t","r","c","m","M","E","u","O","g","i","d","h","f","p","l","C","x","P","v.Config","R","v.UploadCtxProvider","k","U","j","I","L","S","w","y","r.defineComponents","r.FileUploaderRegular","F","s","r.UID","t.defineComponents","t.FileUploaderMinimal","ImageUpload","cropPreset","multiple","setValue","uploadcareKey","files","setFiles","aspectRatio","width","height","updateValue","newFiles","fileValue","file","onFileUrlChanged","output","currentFiles","existingFileIndex","FileUploaderRegular","_STRINGS","STRINGS","AGE_OPTIONS","BasicInfo","registrationSettings","register","watch","age","_c","_d","option","_e","FORM_DATA_KEY","FORM_STEP_KEY","SOCIAL_MEDIA","PERFORMANCE_PROVIDERS","generatePerformanceProvidersPattern","host","PerformanceLinks","performanceLinksSettings","platform","array","_","acceptedPatterns","acceptedProviders","TEXT_AREA_CLASSES","TextArea","dataTestID","maxLength","rows","charCount","setCharCount","handleInput","SocialMediaProfiles","extractUsername","socialKey","trimmedUrl","username","handleInputChange","social","NavigationButtons","currentStep","handlePrevious","handleNext","registrationOpen","theme","submitting","RegistrationStep","About","competitionSlug","RegistrationForm","competition","onSubmitHandler","competitionName","PubSub","getSavedData","savedData","getSavedStep","savedStep","handleSubmit","trigger","getFieldState","setError","clearErrors","useForm","setCurrentStep","setSubmitting","ageValue","formValues","validateBasicInfo","fieldsToValidate","field","validateAbout","performanceLinks","validateStep","step","trackStepAnalytics","userId","isValid","alertFailure","err","onSubmit","socialLinks","domain","handle","formattedHandle","formData","RegistrationStatus","CompetitorStatus","RegistrationWizardUI","authConfig","registerCompetitor","uploadcare_key","registrationStatus","setRegistrationStatus","competitorStatus","setCompetitorStatus","isLoading","setIsLoading","hydratedUser","setHydratedUser","verifyCompetitorStatus","hydratedCurrentUser","isAlreadyRegistered","competitor","onRegisterCompetitor","LoadingWidget","RegistrationNotOpenWidget","RegistrationClosedWidget","ThankYouWidget","competitionUrl","ShareButtons","RegistrationWizard","api_path","platform_url","oauth_providers","oauth_credentials","deleteParams","competitionSiteURL","platformURL","apiURL","userIdQueryParam","auth","LogoutButton","aProps","wrapper","dashboardUrl","logoutUser","logoutButton","dashboardButton","WrapperComponent","Navigation","navigationLinks","transparent","isOpen","setIsOpen","toggleMenu","NavLinks","page","CountdownClock","endDate","timeLeft","setTimeLeft","interval","now","difference","scriptLoader","resolve","scriptTag","Share","color","vertical","shareTo","followProfiles","loaded","setLoaded","serviceClass","service","shareLink","followLink","link","classes","VoteKind","voteIntentDefault","VoteIntentContext","STORAGE_KEY","VoteIntentPersistentStorage","voteIntent","VoteIntentProxy","onPersistSuccess","storage","current","resetVals","newState","useCreateVote","variables","VOTE_CREATE_MUTATION","useUpdateVote","VOTE_UPDATE_MUTATION","useVoteIntentContext","setVoteIntentState","createVote","updateVote","onUpdatePersistedVoteIntent","VoteIntentContextProvider","voteIntentContext","useAnchor","anchorId","anchor","element","CENTS_MULTIPLIER","useVoteIntent","context","useContext","amount","VoteCard","active","votes","voteType","highlight","disabled","onVote","twoForOneActive","bgColor","btnClasses","handleClick","votingPanel","V3_URL","V3_URL_REGEX","findScript","scripts","script","injectScript","params","queryString","headOrBody","registerWrapper","stripe","startTime","stripePromise","onErrorListener","onLoadListener","reject","onLoad","loadScript","_script$parentNode","initStripe","maybeStripe","stripePromise$1","loadCalled","getStripePromise","loadStripe","ownKeys","object","enumerableOnly","keys","symbols","sym","_objectSpread2","target","source","_defineProperty","_typeof","obj","_slicedToArray","arr","_arrayWithHoles","_iterableToArrayLimit","_unsupportedIterableToArray","_nonIterableRest","_i","_arr","_n","_s","minLen","_arrayLikeToArray","len","arr2","useAttachEvent","cb","cbDefined","cbRef","React","decoratedCb","usePrevious","isUnknownObject","raw","isPromise","isStripe","PLAIN_OBJECT_STR","isEqual","left","right","leftArray","rightArray","leftPlainObject","rightPlainObject","leftKeys","rightKeys","keySet","allKeys","pred","extractAllowedOptionsUpdates","prevOptions","immutableKeys","newOptions","isUpdated","INVALID_STRIPE_ERROR$2","validateStripe","errorMsg","parseStripeProp","result","registerWithStripeJs","ElementsContext","parseElementsContext","ctx","useCase","Elements","_ref","rawStripeProp","parsed","_React$useState","_React$useState2","setContext","isMounted","safeSetContext","prevStripe","updates","PropTypes","useElementsContextWithUseCase","useCaseMessage","useElements","_useElementsContextWi","elements","CustomCheckoutSdkContext","parseCustomCheckoutSdkContext","CustomCheckoutContext","useElementsOrCustomCheckoutSdkContextWithUseCase","useCaseString","customCheckoutSdkContext","elementsContext","capitalized","str","createElementComponent","isServer","displayName","ClientElement","_ref$options","onBlur","onFocus","onReady","onEscape","onClick","onLoadError","onLoaderStart","onNetworksChange","onConfirm","onCancel","onShippingAddressChange","onShippingRateChange","customCheckoutSdk","setElement","elementRef","domNode","readyCallback","newElement","ServerElement","Element","EmbeddedCheckoutContext","useStripe","_useElementsOrCustomC","PaymentElement","createPaymentIntent","PAYMENT_INTENT_CREATE_MUTATION","StripeCheckoutForm","beforeConfirmPayment","onConfirmRedirectUrl","paymentIntentIdempotencyKey","errorMessage","setErrorMessage","isProcessing","setIsProcessing","handleError","submitError","paymentIntent","StripeCheckout","elementsOptions","VOTER_FEEDBACK_ID","getTimeUntilNextVote","tomorrow","diffMs","diffHours","diffMinutes","VotePanel","stripePublishableKey","shareUrl","freeVoteError","anchorPage","cartId","setCartId","comment","setComment","commentSent","setCommentSent","timeUntilNextVote","setTimeUntilNextVote","voteIntentProxy","showCommentSection","setShowCommentSection","showSuccessMessage","setShowSuccessMessage","onStripeConfirmRedirectUrl","handleVoteIntentInitialization","currentIntent","handlePaymentConfirmationRedirect","onVoteSuccess","handleCommentSubmit","handleSkipComment","onPageMount","renderVoteSuccess","freeVote","successMessage","TextField","Button","renderFreeVoteError","renderPaidVoteCheckout","renderPanel","PromoCountdown","showDays","showHours","showMinutes","Typography","VotingWidgetContent","promos","initialized","setInitialized","authModalOpen","setAuthModalOpen","isHydrating","setIsHydrating","pendingVote","setPendingVote","setFreeVoteError","processingFreeVote","setProcessingFreeVote","customAmount","setCustomAmount","customAmountError","setCustomAmountError","voteIntentInitializing","recordFreeVote","currentVoteIntent","newIntent","init","renderCustomAmountInput","handleAmountChange","inputValue","validateAmount","twoForOnePromo","promo","Alert","AlertTitle","voteOptions","VotingWidget","propAnchor","mobile_anchor","desktop_anchor","dynamicAnchor","_ZarazAdapter","topic","ZarazAdapter","ZarazConnection","adapters","PlatformConnection","container","decodedProps","root","createRoot","components","setEgPlatformHost"],"mappings":"wSAGA,MAAMA,GAAuBC,EAAa,cAAC,IAAI,EAEzCC,GAAe,CACnB,SAAU,GACV,MAAO,IACT,EACA,MAAMC,WAAsBC,EAAAA,SAAU,CACpC,YAAYC,EAAO,CACjB,MAAMA,CAAK,EACX,KAAK,mBAAqB,KAAK,mBAAmB,KAAK,IAAI,EAC3D,KAAK,MAAQH,EACjB,CACE,OAAO,yBAAyBI,EAAO,CACrC,MAAO,CACL,SAAU,GACV,MAAAA,CACD,CACL,CACE,oBAAqB,CACnB,KAAM,CACJ,MAAAA,CACD,EAAG,KAAK,MACT,GAAIA,IAAU,KAAM,CAElB,QADIC,EAAqBC,EAChBC,EAAO,UAAU,OAAQC,EAAO,IAAI,MAAMD,CAAI,EAAGE,EAAO,EAAGA,EAAOF,EAAME,IAC/ED,EAAKC,CAAI,EAAI,UAAUA,CAAI,GAE5BJ,GAAuBC,EAAc,KAAK,OAAO,WAAa,MAAQD,IAAwB,QAAkBA,EAAoB,KAAKC,EAAa,CACrJ,KAAAE,EACA,OAAQ,gBAChB,CAAO,EACD,KAAK,SAASR,EAAY,CAChC,CACA,CACE,kBAAkBI,EAAOM,EAAM,CAC7B,IAAIC,EAAqBC,GACxBD,GAAuBC,EAAe,KAAK,OAAO,WAAa,MAAQD,IAAwB,QAAkBA,EAAoB,KAAKC,EAAcR,EAAOM,CAAI,CACxK,CACE,mBAAmBG,EAAWC,EAAW,CACvC,KAAM,CACJ,SAAAC,CACD,EAAG,KAAK,MACH,CACJ,UAAAC,CACD,EAAG,KAAK,MAOT,GAAID,GAAYD,EAAU,QAAU,MAAQG,GAAgBJ,EAAU,UAAWG,CAAS,EAA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