@opexa/portal-components 0.0.410 → 0.0.412

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/dist/components/Banner/Banner.client.d.ts +12 -0
  2. package/dist/components/Banner/Banner.client.js +49 -0
  3. package/dist/components/PortalProvider/CXDTokenObserver.js +11 -11
  4. package/dist/components/Quests/DailyCheckInQuest.d.ts +2 -0
  5. package/dist/components/Quests/DailyCheckInQuest.js +7 -3
  6. package/dist/components/Quests/Quests.client.d.ts +3 -0
  7. package/dist/components/Quests/Quests.client.js +2 -2
  8. package/dist/components/Quests/WageringQuest.d.ts +3 -0
  9. package/dist/components/Quests/WageringQuest.js +11 -3
  10. package/dist/components/SignIn/utils.d.ts +8 -0
  11. package/dist/components/SignIn/utils.js +26 -0
  12. package/dist/constants/Branches.d.ts +2 -0
  13. package/dist/constants/Branches.js +42 -0
  14. package/dist/handlers/index.d.ts +7 -7
  15. package/dist/icons/MinusIcon.d.ts +2 -0
  16. package/dist/icons/MinusIcon.js +4 -0
  17. package/dist/third-parties/FacebookPixel/FacebookPixel.d.ts +4 -0
  18. package/dist/third-parties/FacebookPixel/FacebookPixel.js +4 -0
  19. package/dist/third-parties/FacebookPixel/api.d.ts +0 -0
  20. package/dist/third-parties/FacebookPixel/api.js +1 -0
  21. package/dist/third-parties/FacebookPixel/index.d.ts +1 -0
  22. package/dist/third-parties/FacebookPixel/index.js +1 -0
  23. package/dist/third-parties/GoogleRecaptcha/GoogleRecaptcha.d.ts +4 -0
  24. package/dist/third-parties/GoogleRecaptcha/GoogleRecaptcha.js +4 -0
  25. package/dist/third-parties/GoogleRecaptcha/api.d.ts +0 -0
  26. package/dist/third-parties/GoogleRecaptcha/api.js +1 -0
  27. package/dist/third-parties/GoogleRecaptcha/index.d.ts +1 -0
  28. package/dist/third-parties/GoogleRecaptcha/index.js +1 -0
  29. package/dist/third-parties/index.d.ts +2 -0
  30. package/dist/third-parties/index.js +2 -0
  31. package/dist/ui/Carousel/Carousel.d.ts +72 -72
  32. package/dist/ui/Carousel/carousel.recipe.d.ts +8 -8
  33. package/dist/ui/Checkbox/Checkbox.d.ts +23 -23
  34. package/dist/ui/Checkbox/checkbox.recipe.d.ts +3 -3
  35. package/dist/ui/Combobox/Combobox.d.ts +42 -42
  36. package/dist/ui/Combobox/combobox.recipe.d.ts +3 -3
  37. package/dist/ui/DatePicker/DatePicker.d.ts +72 -72
  38. package/dist/ui/DatePicker/datePicker.recipe.d.ts +3 -3
  39. package/dist/ui/Menu/Menu.d.ts +144 -144
  40. package/dist/ui/Menu/menu.recipe.d.ts +8 -8
  41. package/dist/ui/NumberInput/NumberInput.d.ts +24 -24
  42. package/dist/ui/NumberInput/numberInput.recipe.d.ts +3 -3
  43. package/dist/ui/QrCode/QrCode.d.ts +25 -25
  44. package/dist/ui/QrCode/qrCode.recipe.d.ts +5 -5
  45. package/dist/ui/SegmentGroup/SegmentGroup.d.ts +18 -18
  46. package/dist/ui/SegmentGroup/segmentGroup.recipe.d.ts +3 -3
  47. package/dist/ui/Select/Select.d.ts +45 -45
  48. package/dist/ui/Select/select.recipe.d.ts +3 -3
  49. package/dist/ui/Table/Table.d.ts +21 -21
  50. package/dist/ui/Table/table.anatomy.d.ts +1 -1
  51. package/dist/ui/Table/table.recipe.d.ts +3 -3
  52. package/package.json +1 -1
  53. package/dist/components/AccountInfo/GoogleDisconnect.d.ts +0 -7
  54. package/dist/components/AccountInfo/GoogleDisconnect.js +0 -11
  55. package/dist/icons/LinkBrokenIcon.d.ts +0 -2
  56. package/dist/icons/LinkBrokenIcon.js +0 -4
@@ -0,0 +1,12 @@
1
+ import type { ImageProps } from 'next/image';
2
+ export interface BannerEntry {
3
+ src: ImageProps['src'];
4
+ redirectUrl?: string;
5
+ }
6
+ export interface BannerProps {
7
+ banners: BannerEntry[];
8
+ imageWidth?: number | [mobile: number, desktop: number];
9
+ imageHeight?: number | [mobile: number, desktop: number];
10
+ className?: string;
11
+ }
12
+ export declare function Banner__client(props: BannerProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,49 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import emblaCarouselAutoplay from 'embla-carousel-autoplay';
4
+ import useEmblaCarousel, {} from 'embla-carousel-react';
5
+ import isMobile from 'is-mobile';
6
+ import Image from 'next/image';
7
+ import Link from 'next/link';
8
+ import { Fragment, useEffect, useState } from 'react';
9
+ import { twMerge } from 'tailwind-merge';
10
+ import { dataAttr } from '../../utils/dataAttr.js';
11
+ export function Banner__client(props) {
12
+ const [emblaRef, emblaApi] = useEmblaCarousel({
13
+ loop: true,
14
+ align: 'start',
15
+ }, [
16
+ emblaCarouselAutoplay({
17
+ playOnInit: true,
18
+ delay: 5000,
19
+ }),
20
+ ]);
21
+ const [currentIndex, setCurrentIndex] = useState(0);
22
+ useEffect(() => {
23
+ function handler(detail) {
24
+ setCurrentIndex(detail?.selectedScrollSnap() ?? 0);
25
+ }
26
+ emblaApi?.on('scroll', handler);
27
+ emblaApi?.on('init', handler);
28
+ return () => {
29
+ emblaApi?.on('init', handler);
30
+ emblaApi?.off('scroll', handler);
31
+ };
32
+ }, [emblaApi]);
33
+ const imageWidth = !props.imageWidth
34
+ ? [400, 1200]
35
+ : Array.isArray(props.imageWidth)
36
+ ? props.imageWidth
37
+ : [props.imageWidth, props.imageWidth];
38
+ const imageHeight = !props.imageHeight
39
+ ? [225, 300]
40
+ : Array.isArray(props.imageHeight)
41
+ ? props.imageHeight
42
+ : [props.imageHeight, props.imageHeight];
43
+ return (_jsxs("div", { className: twMerge('relative', props.className), children: [_jsx("div", { ref: emblaRef, className: "overflow-hidden", children: _jsx("div", { className: "flex gap-2", children: props.banners.map((banner, index) => {
44
+ const img = (_jsx(Image, { src: banner.src, alt: "", width: isMobile() ? imageWidth[0] : imageWidth[1], height: isMobile() ? imageHeight[0] : imageHeight[1], className: "block h-auto w-full", priority: index === 0 }));
45
+ return (_jsx(Fragment, { children: !banner.redirectUrl ? (_jsx("div", { className: "w-full shrink-0", children: img })) : (_jsx(Link, { href: banner.redirectUrl, className: "block w-full shrink-0", "aria-label": `Open ${banner.redirectUrl}`, children: img })) }, index));
46
+ }) }) }), _jsx("div", { className: "absolute bottom-lg left-1/2 flex w-fit -translate-x-1/2 gap-2", children: props.banners.map((_, index) => (_jsx("button", { type: "button", className: "ui-active:bg-brand-500 bg-gray-300 size-3 shrink-0 rounded-full border border-white transition-all duration-300 ui-active:w-9", onClick: () => {
47
+ emblaApi?.scrollTo(index);
48
+ }, "aria-label": `Go to slide ${index + 1}`, "data-active": dataAttr(index === currentIndex) }, index))) })] }));
49
+ }
@@ -1,30 +1,30 @@
1
1
  'use client';
2
2
  import { addHours } from 'date-fns';
3
3
  import { clamp } from 'lodash-es';
4
- import { useSearchParams } from 'next/navigation';
5
4
  import { useLocalStorage, useTimeout } from 'usehooks-ts';
6
5
  import { useAccountQuery } from '../../client/hooks/useAccountQuery.js';
7
6
  export function CXDTokenObserver() {
8
- const searchParams = useSearchParams();
9
- const cxdToken = searchParams.get('cxd');
10
- const accountQuery = useAccountQuery();
11
- const account = accountQuery.data;
12
- const [cxd, setCxd, removeCxd] = useLocalStorage('WebPortalCellxpertCxd', null);
7
+ const { data: account } = useAccountQuery();
8
+ const accountCxd = {
9
+ cxd: account?.cellxpertDetails?.cxd,
10
+ };
11
+ const [cxd, setCxd, removeCxd] = useLocalStorage('cxd', null);
13
12
  const now = new Date();
14
- const shouldTimeoutRun = cxdToken && account;
15
13
  const removeCxdUntilInMs = cxd?.timestamp
16
14
  ? clamp(cxd.timestamp - now.getTime(), 0, Infinity)
17
15
  : 0;
18
16
  useTimeout(() => {
19
- const isSame = cxd?.cxd === cxdToken;
17
+ const isSame = cxd?.cxd === accountCxd.cxd;
20
18
  if (!isSame) {
21
19
  const extendedTimestamp = addHours(new Date(), 6).getTime();
22
20
  setCxd({
23
- cxd: cxdToken,
21
+ cxd: accountCxd.cxd,
24
22
  timestamp: extendedTimestamp,
25
23
  });
26
24
  }
27
- }, shouldTimeoutRun ? 100 : null);
28
- useTimeout(() => removeCxd(), shouldTimeoutRun ? removeCxdUntilInMs : null);
25
+ }, account ? 100 : null);
26
+ useTimeout(() => {
27
+ removeCxd();
28
+ }, account ? removeCxdUntilInMs : null);
29
29
  return null;
30
30
  }
@@ -8,6 +8,8 @@ export interface ClassNameEntries {
8
8
  calendarDayText?: string;
9
9
  checkInButton?: string;
10
10
  }
11
+ export type UncompletedIconType = 'x' | 'minus';
11
12
  export declare function DailyCheckInQuest(props: {
12
13
  className?: string | ClassNameEntries;
14
+ uncompletedIcon?: UncompletedIconType;
13
15
  }): import("react/jsx-runtime").JSX.Element;
@@ -11,6 +11,7 @@ import { useRemainingTime } from '../../client/hooks/useRemainingTime.js';
11
11
  import { toaster } from '../../client/utils/toaster.js';
12
12
  import { CheckIcon } from '../../icons/CheckIcon.js';
13
13
  import { InfoCircleIcon } from '../../icons/InfoCircleIcon.js';
14
+ import { MinusIcon } from '../../icons/MinusIcon.js';
14
15
  import { XIcon } from '../../icons/XIcon.js';
15
16
  import { Button } from '../../ui/Button/index.js';
16
17
  import { Dialog } from '../../ui/Dialog/index.js';
@@ -24,7 +25,7 @@ import { getAvailableQuestsQueryKey } from '../../utils/queryKeys.js';
24
25
  import { useQuestContext } from './QuestsContext.js';
25
26
  import { RemainingTime } from './RemainingTime.js';
26
27
  export function DailyCheckInQuest(props) {
27
- const { className } = props;
28
+ const { className, uncompletedIcon = 'x' } = props;
28
29
  const classNames = isString(className) ? { root: className } : className;
29
30
  const quest = useQuestContext();
30
31
  const disclosure = useDisclosure();
@@ -50,7 +51,7 @@ export function DailyCheckInQuest(props) {
50
51
  onSuccess() {
51
52
  toaster.success({
52
53
  title: 'Check-in successful 🎉',
53
- description: 'You’ve successfully checked in for today! Keep it up to maintain your streak!',
54
+ description: "You've successfully checked in for today! Keep it up to maintain your streak!",
54
55
  });
55
56
  },
56
57
  onError(e) {
@@ -61,13 +62,16 @@ export function DailyCheckInQuest(props) {
61
62
  },
62
63
  });
63
64
  const remainingTime = useRemainingTime(endDateTime);
65
+ const renderUncompletedIcon = () => {
66
+ return uncompletedIcon === 'minus' ? (_jsx(MinusIcon, { className: "size-2" })) : (_jsx(XIcon, { className: "size-4" }));
67
+ };
64
68
  return (_jsxs(_Fragment, { children: [_jsxs("div", { className: twMerge('flex h-full w-full flex-col space-y-6 rounded-2xl border border-border-primary bg-bg-tertiary px-4 pt-5 pb-6', classNames?.root), children: [_jsxs("div", { className: "flex flex-col space-y-2", children: [_jsxs("div", { className: "flex max-h-7.5 items-start justify-between", children: [_jsx(RemainingTime, {}), _jsx("button", { type: "button", className: "flex size-9 cursor-pointer items-center justify-center rounded-md border border-border-secondary bg-bg-primary", onClick: () => disclosure.setOpen(true), "aria-label": "View Rules", children: _jsx(InfoCircleIcon, { className: "size-5 text-text-disabled" }) })] }), _jsx("p", { className: "font-semibold text-xl", children: name }), _jsx(Prose, { className: "text-wrap font-normal text-sm text-text-secondary-700", dangerouslySetInnerHTML: { __html: description } })] }), _jsxs("div", { className: "flex w-full flex-col space-y-2", children: [_jsx("div", { className: "grid grid-cols-7", children: dailyCheckedInData.map((item) => {
65
69
  const done = item.day <= (checkInStreak ?? 0);
66
70
  const reward = item.reward ? (`+${formatNumber(item.reward, {
67
71
  currency: localeInfo.currency.code,
68
72
  minDecimalPlaces: 0,
69
73
  maxDecimalPlaces: 0,
70
- })}`) : done ? (_jsx(CheckIcon, { className: "size-4" })) : (_jsx(XIcon, { className: "size-4" }));
74
+ })}`) : done ? (_jsx(CheckIcon, { className: "size-4" })) : (renderUncompletedIcon());
71
75
  return (_jsx("div", { className: twMerge('flex items-center justify-center', done ? 'text-brand-400' : 'text-text-secondary-700', classNames?.rewardContainer), children: _jsx("p", { children: reward }) }, item.day));
72
76
  }) }), _jsx("div", { className: twMerge('h-2 w-full overflow-hidden rounded-full bg-bg-primary', classNames?.progressBarContainer), children: _jsx("div", { className: twMerge('h-full rounded-full bg-utility-brand-600 transition-all duration-300', classNames?.progressBar), style: { width: `${progressPercentage}%` } }) }), _jsx("div", { className: "grid grid-cols-7 place-items-center", children: dailyCheckedInData.map((item) => (_jsxs("div", { className: twMerge('group relative size-fit text-text-secondary-700 ui-active:text-brand-400', classNames?.calendarIconContainer), "data-active": dataAttr(item.day <= (checkInStreak ?? 0)), children: [_jsx(CalendarIcon, { className: twMerge('h-4.5 w-auto', classNames?.calendarIcon) }), _jsx("p", { className: twMerge('-translate-x-1/2 -translate-y-1/2 absolute top-1/2 left-1/2 text-2xs leading-none', classNames?.calendarDayText), children: item.day })] }, item.day))) })] }), _jsx(Button, { onClick: () => checkInDailyQuestMutation.mutate(id), className: twMerge('disabled:bg-bg-primary disabled:text-text-disabled', classNames?.checkInButton), disabled: status === 'COMPLETED' ||
73
77
  status === 'FAILED' ||
@@ -11,5 +11,8 @@ export interface QuestsProps {
11
11
  heading?: string | ReactNode;
12
12
  className?: string | ClassNameEntries;
13
13
  style?: CSSProperties;
14
+ uncompletedIcon?: 'x' | 'minus';
15
+ customComplete?: ReactNode;
16
+ showTurnoverDecimals?: boolean;
14
17
  }
15
18
  export declare function Quests__client(props: QuestsProps): import("react/jsx-runtime").JSX.Element;
@@ -2,7 +2,7 @@
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { isString } from 'lodash-es';
4
4
  import Image from 'next/image';
5
- import { useState } from 'react';
5
+ import { useState, } from 'react';
6
6
  import { twMerge } from 'tailwind-merge';
7
7
  import { z } from 'zod';
8
8
  import { useAvailableQuestsQuery } from '../../client/hooks/useAvailableQuestsQuery.js';
@@ -56,6 +56,6 @@ export function Quests__client(props) {
56
56
  ? classNames?.wageringQuest
57
57
  : quest.type === 'DAILY_CHECKIN'
58
58
  ? classNames?.dailyCheckInQuest
59
- : '' }) }, quest.id));
59
+ : '', uncompletedIcon: props.uncompletedIcon, customComplete: quest.type === 'WAGERING' ? props.customComplete : undefined, showTurnoverDecimals: props.showTurnoverDecimals }) }, quest.id));
60
60
  }) })] }));
61
61
  }
@@ -1,3 +1,4 @@
1
+ import type { ReactNode } from 'react';
1
2
  export interface ClassNameEntries {
2
3
  root?: string;
3
4
  progressBarContainer?: string;
@@ -8,4 +9,6 @@ export interface ClassNameEntries {
8
9
  }
9
10
  export declare function WageringQuest(props: {
10
11
  className?: string | ClassNameEntries;
12
+ customComplete?: ReactNode;
13
+ showTurnoverDecimals?: boolean;
11
14
  }): import("react/jsx-runtime").JSX.Element;
@@ -16,17 +16,25 @@ import { parseDecimal } from '../../utils/parseDecimal.js';
16
16
  import { useQuestContext } from './QuestsContext.js';
17
17
  import { RemainingTime } from './RemainingTime.js';
18
18
  export function WageringQuest(props) {
19
- const { className } = props;
19
+ const { className, customComplete, showTurnoverDecimals = true } = props;
20
20
  const classNames = isString(className) ? { root: className } : className;
21
21
  const quest = useQuestContext();
22
22
  const disclosure = useDisclosure();
23
23
  const localeInfo = useLocaleInfo();
24
24
  const { progressPercentage, turnover, targetTurnover, name, description, endDateTime, bonus, status, } = quest;
25
25
  const remainingTime = useRemainingTime(endDateTime);
26
- return (_jsxs(_Fragment, { children: [_jsxs("div", { className: twMerge('flex h-full w-full flex-col space-y-6 rounded-2xl border border-border-primary bg-bg-tertiary px-4 pt-5 pb-6', classNames?.root), children: [_jsxs("div", { className: "flex flex-col space-y-2", children: [_jsxs("div", { className: "flex max-h-7.5 items-start justify-between", children: [_jsx(RemainingTime, {}), _jsx("button", { type: "button", className: "flex size-9 cursor-pointer items-center justify-center rounded-md border border-border-secondary bg-bg-primary", onClick: () => disclosure.setOpen(true), "aria-label": "View Rules", children: _jsx(InfoCircleIcon, { className: "size-5 text-text-disabled" }) })] }), _jsx("p", { className: "font-semibold text-xl", children: name }), _jsx(Prose, { className: "text-wrap font-normal text-sm text-text-secondary-700", dangerouslySetInnerHTML: { __html: description } })] }), _jsxs("div", { className: "flex w-full flex-col space-y-2", children: [_jsxs("div", { className: "group flex items-center justify-between text-text-primary-brand", children: [_jsxs("p", { children: ["Progress ", parseDecimal(progressPercentage, 0).toFixed(2), "%"] }), _jsxs("p", { children: [turnover, _jsxs("span", { className: "text-text-quarterary-brand", children: ["/", targetTurnover, " ", localeInfo.currency.code] })] })] }), _jsx("div", { className: twMerge('h-2 w-full overflow-hidden rounded-full bg-bg-primary', classNames?.progressBarContainer), children: _jsx("div", { className: twMerge('h-full rounded-full bg-utility-brand-600 transition-all duration-300', classNames?.progressBar), style: { width: `${progressPercentage}%` } }) })] }), _jsx("div", { className: "flex h-full items-end", children: _jsx("div", { className: twMerge('w-full rounded-md border border-bg-primary-hover bg-button-secondary-bg px-3.5 py-2.5 text-center', classNames?.bonusContainer), children: _jsxs("p", { className: twMerge((remainingTime.expired ||
26
+ const formatTurnover = (value) => {
27
+ if (showTurnoverDecimals) {
28
+ return value;
29
+ }
30
+ // Remove decimals and format as whole number
31
+ const numericValue = parseFloat(value);
32
+ return Math.floor(numericValue).toString();
33
+ };
34
+ return (_jsxs(_Fragment, { children: [_jsxs("div", { className: twMerge('flex h-full w-full flex-col space-y-6 rounded-2xl border border-border-primary bg-bg-tertiary px-4 pt-5 pb-6', classNames?.root), children: [_jsxs("div", { className: "flex flex-col space-y-2", children: [_jsxs("div", { className: "flex max-h-7.5 items-start justify-between", children: [_jsx(RemainingTime, {}), _jsx("button", { type: "button", className: "flex size-9 cursor-pointer items-center justify-center rounded-md border border-border-secondary bg-bg-primary", onClick: () => disclosure.setOpen(true), "aria-label": "View Rules", children: _jsx(InfoCircleIcon, { className: "size-5 text-text-disabled" }) })] }), _jsx("p", { className: "font-semibold text-xl", children: name }), _jsx(Prose, { className: "text-wrap font-normal text-sm text-text-secondary-700", dangerouslySetInnerHTML: { __html: description } })] }), _jsxs("div", { className: "flex w-full flex-col space-y-2", children: [_jsxs("div", { className: "group flex items-center justify-between text-text-primary-brand", children: [_jsxs("p", { children: ["Progress ", parseDecimal(progressPercentage, 0).toFixed(2), "%"] }), _jsxs("p", { children: [formatTurnover(turnover), _jsxs("span", { className: "text-text-quarterary-brand", children: ["/", targetTurnover, " ", localeInfo.currency.code] })] })] }), _jsx("div", { className: twMerge('h-2 w-full overflow-hidden rounded-full bg-bg-primary', classNames?.progressBarContainer), children: _jsx("div", { className: twMerge('h-full rounded-full bg-utility-brand-600 transition-all duration-300', classNames?.progressBar), style: { width: `${progressPercentage}%` } }) })] }), _jsx("div", { className: "flex h-full items-end", children: _jsx("div", { className: twMerge('w-full rounded-md border border-bg-primary-hover bg-button-secondary-bg px-3.5 py-2.5 text-center', classNames?.bonusContainer), children: status === 'COMPLETED' && customComplete ? (_jsx("div", { className: twMerge(classNames?.bonusText), children: customComplete })) : (_jsxs("p", { className: twMerge((remainingTime.expired ||
27
35
  status === 'COMPLETED' ||
28
36
  status === 'FAILED') &&
29
- 'opacity-50 grayscale', classNames?.bonusText), children: ["Complete to get", ' ', _jsxs("span", { className: twMerge('text-brand-400', classNames?.bonusAmount), children: ["\u20B1", bonus] }), ' ', "bonus!"] }) }) })] }), _jsx(Rules, { open: disclosure.open, onOpenChange: disclosure.setOpen })] }));
37
+ 'opacity-50 grayscale', classNames?.bonusText), children: ["Complete to get", ' ', _jsxs("span", { className: twMerge('text-brand-400', classNames?.bonusAmount), children: ["\u20B1", bonus] }), ' ', "bonus!"] })) }) })] }), _jsx(Rules, { open: disclosure.open, onOpenChange: disclosure.setOpen })] }));
30
38
  }
31
39
  function Rules(props) {
32
40
  const quest = useQuestContext();
@@ -0,0 +1,8 @@
1
+ type Options = {
2
+ accountName?: string;
3
+ siteName?: string;
4
+ signInOptions?: 'MOBILE_NUMBER' | 'NAME_AND_PASSWORD';
5
+ };
6
+ export type ErrorCode = 'MEMBER_ACCOUNT_BLACKLISTED' | 'MEMBER_ACCOUNT_SUSPENDED' | 'INVALID_RECAPTCHA_RESPONSE' | 'MEMBER_NOT_FOUND' | 'RATE_LIMIT_REACH' | 'NOT_READY_TO_SEND_VERIFICATION_ERROR' | 'Forbidden';
7
+ export declare function getFriendlyErrorMessage(code: ErrorCode, options?: Options): string;
8
+ export {};
@@ -0,0 +1,26 @@
1
+ export function getFriendlyErrorMessage(code, options) {
2
+ const accountName = options?.accountName ?? '';
3
+ const siteName = options?.siteName ?? '';
4
+ const signInOptions = options?.signInOptions ?? 'NAME_AND_PASSWORD';
5
+ switch (code) {
6
+ case 'MEMBER_ACCOUNT_BLACKLISTED':
7
+ return `Your account ${accountName} has been blacklisted due to a serious violation of our policies. For more information or to appeal, please contact the ${siteName} Chat Support team.`;
8
+ case 'MEMBER_ACCOUNT_SUSPENDED':
9
+ return `Your account ${accountName} has been temporarily suspended. Please reach out to the ${siteName} Chat Support team to learn more and get help with resolving the issue.`;
10
+ case 'INVALID_RECAPTCHA_RESPONSE':
11
+ return 'Invalid reCAPTCHA response';
12
+ case 'MEMBER_NOT_FOUND':
13
+ return 'Account not found. Please check your username and try again.';
14
+ case 'RATE_LIMIT_REACH':
15
+ return 'Rate limit exceeded';
16
+ case 'NOT_READY_TO_SEND_VERIFICATION_ERROR':
17
+ return 'Your account is not ready to send verification requests. Please try again later.';
18
+ case 'Forbidden':
19
+ if (signInOptions === 'MOBILE_NUMBER') {
20
+ return 'Invalid verification code. Please check the code and try again.';
21
+ }
22
+ return 'Invalid username or password, please try again.';
23
+ default:
24
+ return 'Something went wrong. Please try again later.';
25
+ }
26
+ }
@@ -0,0 +1,2 @@
1
+ import type { Branch } from '../types';
2
+ export declare const BRANCHES: Branch[];
@@ -0,0 +1,42 @@
1
+ export const BRANCHES = [
2
+ {
3
+ code: 'BRCAL',
4
+ name: 'Bingo Republic 2nd floor Primark Center Deparo St., Caloocan City',
5
+ },
6
+ {
7
+ code: 'BRNAG',
8
+ name: 'Bingo Republic 3rd floor Robinsons Mall, Naga City, Camarines Sur',
9
+ },
10
+ {
11
+ code: 'BRANT',
12
+ name: 'Bingo Republic 2nd floor Robinsons Mall, San Vicente,Antique',
13
+ },
14
+ {
15
+ code: 'BRCLA',
16
+ name: 'Clark',
17
+ },
18
+ {
19
+ code: 'BRLAG',
20
+ name: 'Laguna',
21
+ },
22
+ {
23
+ code: 'BREAS',
24
+ name: 'Eastwood City, Quezon City',
25
+ },
26
+ {
27
+ code: 'BRMAR',
28
+ name: 'Bingo ng Bayan 4th floor Marikina Public Market, Marikina City',
29
+ },
30
+ {
31
+ code: 'BRILO',
32
+ name: 'Iloilo',
33
+ },
34
+ {
35
+ code: 'BRFIM',
36
+ name: 'Fisher Mall,Quezon City',
37
+ },
38
+ {
39
+ code: 'BRCAC',
40
+ name: 'Villa Caceres Hotel, Naga City,Camsur',
41
+ },
42
+ ];
@@ -6,26 +6,26 @@ interface Context {
6
6
  params: Promise<Params>;
7
7
  }
8
8
  export declare const GET: (req: NextRequest, { params }: Context) => Promise<NextResponse<{
9
- ok: true;
10
- data?: never;
11
- } | {
12
9
  ok: false;
13
10
  message: string;
14
11
  __error?: unknown;
12
+ } | {
13
+ ok: true;
14
+ data: import("../types").Session;
15
15
  }> | NextResponse<{
16
+ ok: true;
17
+ data?: never;
18
+ } | {
16
19
  ok: false;
17
20
  message: string;
18
21
  __error?: unknown;
19
- } | {
20
- ok: true;
21
- data: Record<string, unknown>;
22
22
  }> | NextResponse<{
23
23
  ok: false;
24
24
  message: string;
25
25
  __error?: unknown;
26
26
  } | {
27
27
  ok: true;
28
- data: import("../types").Session;
28
+ data: Record<string, unknown>;
29
29
  }>>;
30
30
  export declare const DELETE: (req: NextRequest, { params }: Context) => Promise<NextResponse<{
31
31
  ok: true;
@@ -0,0 +1,2 @@
1
+ import type { ComponentPropsWithRef } from 'react';
2
+ export declare function MinusIcon(props: ComponentPropsWithRef<'svg'>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ export function MinusIcon(props) {
3
+ return (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "6", height: "2", fill: "none", viewBox: "0 0 6 2", ...props, children: _jsx("path", { fill: "#344054", d: "M5.224.347v1.471H.064V.347z" }) }));
4
+ }
@@ -0,0 +1,4 @@
1
+ export interface FacebookPixelProps {
2
+ fbId: string;
3
+ }
4
+ export declare function FacebookPixel(props: FacebookPixelProps): null;
@@ -0,0 +1,4 @@
1
+ export function FacebookPixel(props) {
2
+ console.log(props);
3
+ return null;
4
+ }
File without changes
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1 @@
1
+ export * from './FacebookPixel';
@@ -0,0 +1 @@
1
+ export * from './FacebookPixel.js';
@@ -0,0 +1,4 @@
1
+ export interface GoogleRecaptchaProps {
2
+ siteKey: string;
3
+ }
4
+ export declare function GoogleRecaptcha(props: GoogleRecaptchaProps): null;
@@ -0,0 +1,4 @@
1
+ export function GoogleRecaptcha(props) {
2
+ console.log(props);
3
+ return null;
4
+ }
File without changes
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1 @@
1
+ export * from './GoogleRecaptcha';
@@ -0,0 +1 @@
1
+ export * from './GoogleRecaptcha.js';
@@ -0,0 +1,2 @@
1
+ export * from './FacebookPixel';
2
+ export * from './GoogleRecaptcha';
@@ -0,0 +1,2 @@
1
+ export * from './FacebookPixel/index.js';
2
+ export * from './GoogleRecaptcha/index.js';