diff --git a/.babelrc b/.babelrc deleted file mode 100644 index e5ef908d..00000000 --- a/.babelrc +++ /dev/null @@ -1,20 +0,0 @@ -{ - "presets": [ - "next/babel" - ], - "plugins": [ - [ - "inline-react-svg", - { - "svgo": { - "plugins": [ - { - "name": "removeViewBox", - "active": false - } - ] - } - } - ] - ] -} \ No newline at end of file diff --git a/api/resolvers/blockHeight.js b/api/resolvers/blockHeight.js index 4fd270d9..0be9a0ea 100644 --- a/api/resolvers/blockHeight.js +++ b/api/resolvers/blockHeight.js @@ -1,5 +1,5 @@ import lndService from 'ln-service' -import lnd from '../lnd' +import lnd from '@/api/lnd' const cache = new Map() const expiresIn = 1000 * 30 // 30 seconds in milliseconds diff --git a/api/resolvers/chainFee.js b/api/resolvers/chainFee.js index a3c3728d..c07be05a 100644 --- a/api/resolvers/chainFee.js +++ b/api/resolvers/chainFee.js @@ -1,5 +1,5 @@ import lndService from 'ln-service' -import lnd from '../lnd' +import lnd from '@/api/lnd' const cache = new Map() const expiresIn = 1000 * 30 // 30 seconds in milliseconds diff --git a/api/resolvers/growth.js b/api/resolvers/growth.js index 4e36cbd1..571db8be 100644 --- a/api/resolvers/growth.js +++ b/api/resolvers/growth.js @@ -1,4 +1,4 @@ -import { timeUnitForRange, whenRange } from '../../lib/time' +import { timeUnitForRange, whenRange } from '@/lib/time' export function withClause (range) { const unit = timeUnitForRange(range) diff --git a/api/resolvers/image.js b/api/resolvers/image.js index 209f090d..d27a3eb5 100644 --- a/api/resolvers/image.js +++ b/api/resolvers/image.js @@ -1,5 +1,5 @@ -import { ANON_USER_ID, AWS_S3_URL_REGEXP } from '../../lib/constants' -import { msatsToSats } from '../../lib/format' +import { ANON_USER_ID, AWS_S3_URL_REGEXP } from '@/lib/constants' +import { msatsToSats } from '@/lib/format' export default { Query: { diff --git a/api/resolvers/invite.js b/api/resolvers/invite.js index e3703928..a06e9da1 100644 --- a/api/resolvers/invite.js +++ b/api/resolvers/invite.js @@ -1,6 +1,6 @@ import { GraphQLError } from 'graphql' -import { inviteSchema, ssValidate } from '../../lib/validate' -import { msatsToSats } from '../../lib/format' +import { inviteSchema, ssValidate } from '@/lib/validate' +import { msatsToSats } from '@/lib/format' export default { Query: { diff --git a/api/resolvers/item.js b/api/resolvers/item.js index e683be53..d8e59718 100644 --- a/api/resolvers/item.js +++ b/api/resolvers/item.js @@ -1,23 +1,23 @@ import { GraphQLError } from 'graphql' -import { ensureProtocol, removeTracking, stripTrailingSlash } from '../../lib/url' +import { ensureProtocol, removeTracking, stripTrailingSlash } from '@/lib/url' import serialize, { serializeInvoicable } from './serial' -import { decodeCursor, LIMIT, nextCursorEncoded } from '../../lib/cursor' +import { decodeCursor, LIMIT, nextCursorEncoded } from '@/lib/cursor' import { getMetadata, metadataRuleSets } from 'page-metadata-parser' -import { ruleSet as publicationDateRuleSet } from '../../lib/timedate-scraper' +import { ruleSet as publicationDateRuleSet } from '@/lib/timedate-scraper' import domino from 'domino' import { ITEM_SPAM_INTERVAL, ITEM_FILTER_THRESHOLD, COMMENT_DEPTH_LIMIT, COMMENT_TYPE_QUERY, ANON_USER_ID, ANON_ITEM_SPAM_INTERVAL, POLL_COST, ITEM_ALLOW_EDITS, GLOBAL_SEED, ANON_FEE_MULTIPLIER, NOFOLLOW_LIMIT, UNKNOWN_LINK_REL -} from '../../lib/constants' -import { msatsToSats } from '../../lib/format' +} from '@/lib/constants' +import { msatsToSats } from '@/lib/format' import { parse } from 'tldts' import uu from 'url-unshort' -import { actSchema, advSchema, bountySchema, commentSchema, discussionSchema, jobSchema, linkSchema, pollSchema, ssValidate } from '../../lib/validate' -import { notifyItemParents, notifyUserSubscribers, notifyZapped, notifyTerritorySubscribers, notifyMention } from '../../lib/webPush' -import { defaultCommentSort, isJob, deleteItemByAuthor, getDeleteCommand, hasDeleteCommand } from '../../lib/item' -import { datePivot, whenRange } from '../../lib/time' +import { actSchema, advSchema, bountySchema, commentSchema, discussionSchema, jobSchema, linkSchema, pollSchema, ssValidate } from '@/lib/validate' +import { notifyItemParents, notifyUserSubscribers, notifyZapped, notifyTerritorySubscribers, notifyMention } from '@/lib/webPush' +import { defaultCommentSort, isJob, deleteItemByAuthor, getDeleteCommand, hasDeleteCommand } from '@/lib/item' +import { datePivot, whenRange } from '@/lib/time' import { imageFeesInfo, uploadIdsFromText } from './image' import assertGofacYourself from './ofac' diff --git a/api/resolvers/notifications.js b/api/resolvers/notifications.js index 58a310f8..f29d741a 100644 --- a/api/resolvers/notifications.js +++ b/api/resolvers/notifications.js @@ -1,9 +1,9 @@ import { GraphQLError } from 'graphql' -import { decodeCursor, LIMIT, nextNoteCursorEncoded } from '../../lib/cursor' +import { decodeCursor, LIMIT, nextNoteCursorEncoded } from '@/lib/cursor' import { getItem, filterClause, whereClause, muteClause } from './item' import { getInvoice } from './wallet' -import { pushSubscriptionSchema, ssValidate } from '../../lib/validate' -import { replyToSubscription } from '../../lib/webPush' +import { pushSubscriptionSchema, ssValidate } from '@/lib/validate' +import { replyToSubscription } from '@/lib/webPush' import { getSub } from './sub' export default { diff --git a/api/resolvers/referrals.js b/api/resolvers/referrals.js index c17fc5dc..5cbec9f8 100644 --- a/api/resolvers/referrals.js +++ b/api/resolvers/referrals.js @@ -1,6 +1,6 @@ import { GraphQLError } from 'graphql' import { withClause, intervalClause } from './growth' -import { timeUnitForRange, whenRange } from '../../lib/time' +import { timeUnitForRange, whenRange } from '@/lib/time' export default { Query: { diff --git a/api/resolvers/rewards.js b/api/resolvers/rewards.js index 32fbeb8d..646c5195 100644 --- a/api/resolvers/rewards.js +++ b/api/resolvers/rewards.js @@ -1,7 +1,7 @@ import { GraphQLError } from 'graphql' -import { amountSchema, ssValidate } from '../../lib/validate' +import { amountSchema, ssValidate } from '@/lib/validate' import { serializeInvoicable } from './serial' -import { ANON_USER_ID } from '../../lib/constants' +import { ANON_USER_ID } from '@/lib/constants' import { getItem } from './item' import { topUsers } from './user' diff --git a/api/resolvers/search.js b/api/resolvers/search.js index 28c900c3..0d4854a1 100644 --- a/api/resolvers/search.js +++ b/api/resolvers/search.js @@ -1,5 +1,5 @@ -import { decodeCursor, LIMIT, nextCursorEncoded } from '../../lib/cursor' -import { whenToFrom } from '../../lib/time' +import { decodeCursor, LIMIT, nextCursorEncoded } from '@/lib/cursor' +import { whenToFrom } from '@/lib/time' import { getItem, itemQueryWithMeta, SELECT } from './item' function queryParts (q) { diff --git a/api/resolvers/serial.js b/api/resolvers/serial.js index 9bcdbc94..62bb6a59 100644 --- a/api/resolvers/serial.js +++ b/api/resolvers/serial.js @@ -3,8 +3,8 @@ import retry from 'async-retry' import Prisma from '@prisma/client' import { settleHodlInvoice } from 'ln-service' import { createHmac } from './wallet' -import { msatsToSats, numWithUnits } from '../../lib/format' -import { BALANCE_LIMIT_MSATS } from '../../lib/constants' +import { msatsToSats, numWithUnits } from '@/lib/format' +import { BALANCE_LIMIT_MSATS } from '@/lib/constants' export default async function serialize (models, ...calls) { return await retry(async bail => { diff --git a/api/resolvers/sub.js b/api/resolvers/sub.js index 19f73581..dcd09303 100644 --- a/api/resolvers/sub.js +++ b/api/resolvers/sub.js @@ -1,13 +1,12 @@ import { GraphQLError } from 'graphql' import { serializeInvoicable } from './serial' -import { TERRITORY_COST_MONTHLY, TERRITORY_COST_ONCE, TERRITORY_COST_YEARLY, TERRITORY_PERIOD_COST } from '../../lib/constants' -import { datePivot, whenRange } from '../../lib/time' -import { ssValidate, territorySchema } from '../../lib/validate' -import { nextBilling, proratedBillingCost } from '../../lib/territory' -import { decodeCursor, LIMIT, nextCursorEncoded } from '../../lib/cursor' +import { TERRITORY_COST_MONTHLY, TERRITORY_COST_ONCE, TERRITORY_COST_YEARLY, TERRITORY_PERIOD_COST } from '@/lib/constants' +import { datePivot, whenRange } from '@/lib/time' +import { ssValidate, territorySchema } from '@/lib/validate' +import { nextBilling, proratedBillingCost } from '@/lib/territory' +import { decodeCursor, LIMIT, nextCursorEncoded } from '@/lib/cursor' import { subViewGroup } from './growth' -import { notifyTerritoryTransfer } from '../../lib/webPush' - +import { notifyTerritoryTransfer } from '@/lib/webPush' export function paySubQueries (sub, models) { if (sub.billingType === 'ONCE') { return [] diff --git a/api/resolvers/upload.js b/api/resolvers/upload.js index ec098cf4..4aecaabb 100644 --- a/api/resolvers/upload.js +++ b/api/resolvers/upload.js @@ -1,6 +1,6 @@ import { GraphQLError } from 'graphql' -import { ANON_USER_ID, IMAGE_PIXELS_MAX, UPLOAD_SIZE_MAX, UPLOAD_SIZE_MAX_AVATAR, UPLOAD_TYPES_ALLOW } from '../../lib/constants' -import { createPresignedPost } from '../s3' +import { ANON_USER_ID, IMAGE_PIXELS_MAX, UPLOAD_SIZE_MAX, UPLOAD_SIZE_MAX_AVATAR, UPLOAD_TYPES_ALLOW } from '@/lib/constants' +import { createPresignedPost } from '@/api/s3' export default { Mutation: { diff --git a/api/resolvers/user.js b/api/resolvers/user.js index ea6b143c..f7baaa3a 100644 --- a/api/resolvers/user.js +++ b/api/resolvers/user.js @@ -1,13 +1,13 @@ import { readFile } from 'fs/promises' import { join, resolve } from 'path' import { GraphQLError } from 'graphql' -import { decodeCursor, LIMIT, nextCursorEncoded } from '../../lib/cursor' -import { msatsToSats } from '../../lib/format' -import { bioSchema, emailSchema, settingsSchema, ssValidate, userSchema } from '../../lib/validate' +import { decodeCursor, LIMIT, nextCursorEncoded } from '@/lib/cursor' +import { msatsToSats } from '@/lib/format' +import { bioSchema, emailSchema, settingsSchema, ssValidate, userSchema } from '@/lib/validate' import { getItem, updateItem, filterClause, createItem, whereClause, muteClause } from './item' -import { ANON_USER_ID, DELETE_USER_ID, RESERVED_MAX_USER_ID, SN_USER_IDS } from '../../lib/constants' +import { ANON_USER_ID, DELETE_USER_ID, RESERVED_MAX_USER_ID, SN_USER_IDS } from '@/lib/constants' import { viewGroup } from './growth' -import { whenRange } from '../../lib/time' +import { whenRange } from '@/lib/time' const contributors = new Set() diff --git a/api/resolvers/wallet.js b/api/resolvers/wallet.js index e7d97493..bfca346b 100644 --- a/api/resolvers/wallet.js +++ b/api/resolvers/wallet.js @@ -2,14 +2,14 @@ import { getIdentity, createHodlInvoice, createInvoice, decodePaymentRequest, pa import { GraphQLError } from 'graphql' import crypto from 'crypto' import serialize from './serial' -import { decodeCursor, LIMIT, nextCursorEncoded } from '../../lib/cursor' +import { decodeCursor, LIMIT, nextCursorEncoded } from '@/lib/cursor' import lnpr from 'bolt11' import { SELECT } from './item' -import { lnAddrOptions } from '../../lib/lnurl' -import { msatsToSats, msatsToSatsDecimal, ensureB64 } from '../../lib/format' -import { LNDAutowithdrawSchema, amountSchema, lnAddrAutowithdrawSchema, lnAddrSchema, ssValidate, withdrawlSchema } from '../../lib/validate' -import { ANON_BALANCE_LIMIT_MSATS, ANON_INV_PENDING_LIMIT, ANON_USER_ID, BALANCE_LIMIT_MSATS, INVOICE_RETENTION_DAYS, INV_PENDING_LIMIT, USER_IDS_BALANCE_NO_LIMIT } from '../../lib/constants' -import { datePivot } from '../../lib/time' +import { lnAddrOptions } from '@/lib/lnurl' +import { msatsToSats, msatsToSatsDecimal, ensureB64 } from '@/lib/format' +import { LNDAutowithdrawSchema, amountSchema, lnAddrAutowithdrawSchema, lnAddrSchema, ssValidate, withdrawlSchema } from '@/lib/validate' +import { ANON_BALANCE_LIMIT_MSATS, ANON_INV_PENDING_LIMIT, ANON_USER_ID, BALANCE_LIMIT_MSATS, INVOICE_RETENTION_DAYS, INV_PENDING_LIMIT, USER_IDS_BALANCE_NO_LIMIT } from '@/lib/constants' +import { datePivot } from '@/lib/time' import assertGofacYourself from './ofac' export async function getInvoice (parent, { id }, { me, models, lnd }) { diff --git a/api/s3/index.js b/api/s3/index.js index 2a364970..7c9722b9 100644 --- a/api/s3/index.js +++ b/api/s3/index.js @@ -1,5 +1,5 @@ import AWS from 'aws-sdk' -import { MEDIA_URL } from '../../lib/constants' +import { MEDIA_URL } from '@/lib/constants' const bucketRegion = 'us-east-1' const Bucket = process.env.NEXT_PUBLIC_AWS_UPLOAD_BUCKET diff --git a/api/ssrApollo.js b/api/ssrApollo.js index 2524fd86..95830f2f 100644 --- a/api/ssrApollo.js +++ b/api/ssrApollo.js @@ -7,12 +7,12 @@ import models from './models' import { print } from 'graphql' import lnd from './lnd' import search from './search' -import { ME } from '../fragments/users' -import { PRICE } from '../fragments/price' -import { BLOCK_HEIGHT } from '../fragments/blockHeight' -import { CHAIN_FEE } from '../fragments/chainFee' +import { ME } from '@/fragments/users' +import { PRICE } from '@/fragments/price' +import { BLOCK_HEIGHT } from '@/fragments/blockHeight' +import { CHAIN_FEE } from '@/fragments/chainFee' import { getServerSession } from 'next-auth/next' -import { getAuthOptions } from '../pages/api/auth/[...nextauth]' +import { getAuthOptions } from '@/pages/api/auth/[...nextauth]' export default async function getSSRApolloClient ({ req, res, me = null }) { const session = req && await getServerSession(req, res, getAuthOptions(req)) diff --git a/api/webPush/index.js b/api/webPush/index.js new file mode 100644 index 00000000..7e19e961 --- /dev/null +++ b/api/webPush/index.js @@ -0,0 +1,114 @@ +import webPush from 'web-push' +import models from '@/api/models' +import { COMMENT_DEPTH_LIMIT } from '@/lib/constants' +import removeMd from 'remove-markdown' + +const webPushEnabled = process.env.NODE_ENV === 'production' || + (process.env.VAPID_MAILTO && process.env.NEXT_PUBLIC_VAPID_PUBKEY && process.env.VAPID_PRIVKEY) + +if (webPushEnabled) { + webPush.setVapidDetails( + process.env.VAPID_MAILTO, + process.env.NEXT_PUBLIC_VAPID_PUBKEY, + process.env.VAPID_PRIVKEY + ) +} else { + console.warn('VAPID_* env vars not set, skipping webPush setup') +} + +const createPayload = (notification) => { + // https://web.dev/push-notifications-display-a-notification/#visual-options + let { title, body, ...options } = notification + if (body) body = removeMd(body) + return JSON.stringify({ + title, + options: { + body, + timestamp: Date.now(), + icon: '/icons/icon_x96.png', + ...options + } + }) +} + +const createUserFilter = (tag) => { + // filter users by notification settings + const tagMap = { + REPLY: 'noteAllDescendants', + MENTION: 'noteMentions', + TIP: 'noteItemSats', + FORWARDEDTIP: 'noteForwardedSats', + REFERRAL: 'noteInvites', + INVITE: 'noteInvites', + EARN: 'noteEarning', + DEPOSIT: 'noteDeposits', + STREAK: 'noteCowboyHat' + } + const key = tagMap[tag.split('-')[0]] + return key ? { user: { [key]: true } } : undefined +} + +const createItemUrl = async ({ id }) => { + const [rootItem] = await models.$queryRawUnsafe( + 'SELECT subpath(path, -LEAST(nlevel(path), $1::INTEGER), 1)::text AS id FROM "Item" WHERE id = $2::INTEGER', + COMMENT_DEPTH_LIMIT + 1, Number(id) + ) + return `/items/${rootItem.id}` + (rootItem.id !== id ? `?commentId=${id}` : '') +} + +const sendNotification = (subscription, payload) => { + if (!webPushEnabled) { + console.warn('webPush not configured. skipping notification') + return + } + const { id, endpoint, p256dh, auth } = subscription + return webPush.sendNotification({ endpoint, keys: { p256dh, auth } }, payload) + .catch(async (err) => { + if (err.statusCode === 400) { + console.log('[webPush] invalid request: ', err) + } else if ([401, 403].includes(err.statusCode)) { + console.log('[webPush] auth error: ', err) + } else if (err.statusCode === 404 || err.statusCode === 410) { + console.log('[webPush] subscription has expired or is no longer valid: ', err) + const deletedSubscripton = await models.pushSubscription.delete({ where: { id } }) + console.log(`[webPush] deleted subscription ${id} of user ${deletedSubscripton.userId} due to push error`) + } else if (err.statusCode === 413) { + console.log('[webPush] payload too large: ', err) + } else if (err.statusCode === 429) { + console.log('[webPush] too many requests: ', err) + } else { + console.log('[webPush] error: ', err) + } + }) +} + +export async function sendUserNotification (userId, notification) { + try { + notification.data ??= {} + if (notification.item) { + notification.data.url ??= await createItemUrl(notification.item) + notification.data.itemId ??= notification.item.id + delete notification.item + } + const userFilter = createUserFilter(notification.tag) + const payload = createPayload(notification) + const subscriptions = await models.pushSubscription.findMany({ + where: { userId, ...userFilter } + }) + await Promise.allSettled( + subscriptions.map(subscription => sendNotification(subscription, payload)) + ) + } catch (err) { + console.log('[webPush] error sending user notification: ', err) + } +} + +export async function replyToSubscription (subscriptionId, notification) { + try { + const payload = createPayload(notification) + const subscription = await models.pushSubscription.findUnique({ where: { id: subscriptionId } }) + await sendNotification(subscription, payload) + } catch (err) { + console.log('[webPush] error sending subscription reply: ', err) + } +} diff --git a/components/accordian-item.js b/components/accordian-item.js index 4041dd76..13700530 100644 --- a/components/accordian-item.js +++ b/components/accordian-item.js @@ -1,8 +1,8 @@ import Accordion from 'react-bootstrap/Accordion' import AccordionContext from 'react-bootstrap/AccordionContext' import { useAccordionButton } from 'react-bootstrap/AccordionButton' -import ArrowRight from '../svgs/arrow-right-s-fill.svg' -import ArrowDown from '../svgs/arrow-down-s-fill.svg' +import ArrowRight from '@/svgs/arrow-right-s-fill.svg' +import ArrowDown from '@/svgs/arrow-down-s-fill.svg' import { useContext } from 'react' function ContextAwareToggle ({ children, headerColor = 'var(--theme-grey)', eventKey }) { diff --git a/components/action-dropdown.js b/components/action-dropdown.js index ea19ebac..0a67f92a 100644 --- a/components/action-dropdown.js +++ b/components/action-dropdown.js @@ -1,6 +1,6 @@ import Dropdown from 'react-bootstrap/Dropdown' import styles from './item.module.css' -import MoreIcon from '../svgs/more-fill.svg' +import MoreIcon from '@/svgs/more-fill.svg' export default function ActionDropdown ({ children }) { if (!children) { diff --git a/components/adv-post-form.js b/components/adv-post-form.js index 09414a52..0b70f0b7 100644 --- a/components/adv-post-form.js +++ b/components/adv-post-form.js @@ -2,10 +2,10 @@ import { useState, useEffect } from 'react' import AccordianItem from './accordian-item' import { Input, InputUserSuggest, VariableInput, Checkbox } from './form' import InputGroup from 'react-bootstrap/InputGroup' -import { BOOST_MIN, BOOST_MULT, MAX_FORWARDS } from '../lib/constants' -import { DEFAULT_CROSSPOSTING_RELAYS } from '../lib/nostr' +import { BOOST_MIN, BOOST_MULT, MAX_FORWARDS } from '@/lib/constants' +import { DEFAULT_CROSSPOSTING_RELAYS } from '@/lib/nostr' import Info from './info' -import { numWithUnits } from '../lib/format' +import { numWithUnits } from '@/lib/format' import styles from './adv-post-form.module.css' import { useMe } from './me' import { useFeeButton } from './fee-button' diff --git a/components/autowithdraw-shared.js b/components/autowithdraw-shared.js index b826f829..850e45c4 100644 --- a/components/autowithdraw-shared.js +++ b/components/autowithdraw-shared.js @@ -3,7 +3,7 @@ import { Checkbox, Input } from './form' import { useMe } from './me' import { useEffect, useState } from 'react' import { isNumber } from 'mathjs' -import { numWithUnits } from '../lib/format' +import { numWithUnits } from '@/lib/format' function autoWithdrawThreshold ({ me }) { return isNumber(me?.privates?.autoWithdrawThreshold) ? me?.privates?.autoWithdrawThreshold : 10000 diff --git a/components/avatar.js b/components/avatar.js index 5c18f2e1..b000af81 100644 --- a/components/avatar.js +++ b/components/avatar.js @@ -2,8 +2,8 @@ import { useRef, useState } from 'react' import AvatarEditor from 'react-avatar-editor' import Button from 'react-bootstrap/Button' import BootstrapForm from 'react-bootstrap/Form' -import EditImage from '../svgs/image-edit-fill.svg' -import Moon from '../svgs/moon-fill.svg' +import EditImage from '@/svgs/image-edit-fill.svg' +import Moon from '@/svgs/moon-fill.svg' import { useShowModal } from './modal' import { ImageUpload } from './image' diff --git a/components/banners.js b/components/banners.js index 78102d1f..43a6b716 100644 --- a/components/banners.js +++ b/components/banners.js @@ -1,12 +1,12 @@ import Alert from 'react-bootstrap/Alert' import styles from './banners.module.css' import { useEffect, useState } from 'react' -import { useMe } from '../components/me' +import { useMe } from '@/components/me' import { useMutation } from '@apollo/client' -import { WELCOME_BANNER_MUTATION } from '../fragments/users' -import { useToast } from '../components/toast' -import { BALANCE_LIMIT_MSATS } from '../lib/constants' -import { msatsToSats, numWithUnits } from '../lib/format' +import { WELCOME_BANNER_MUTATION } from '@/fragments/users' +import { useToast } from '@/components/toast' +import { BALANCE_LIMIT_MSATS } from '@/lib/constants' +import { msatsToSats, numWithUnits } from '@/lib/format' export function WelcomeBanner ({ Banner }) { const me = useMe() diff --git a/components/block-height.js b/components/block-height.js index dae0d60d..2fa18e72 100644 --- a/components/block-height.js +++ b/components/block-height.js @@ -1,7 +1,7 @@ import { createContext, useContext, useMemo } from 'react' import { useQuery } from '@apollo/client' -import { SSR } from '../lib/constants' -import { BLOCK_HEIGHT } from '../fragments/blockHeight' +import { SSR } from '@/lib/constants' +import { BLOCK_HEIGHT } from '@/fragments/blockHeight' export const BlockHeightContext = createContext({ height: 0 diff --git a/components/bounty-form.js b/components/bounty-form.js index 4da4162e..c29fd01d 100644 --- a/components/bounty-form.js +++ b/components/bounty-form.js @@ -1,15 +1,15 @@ -import { Form, Input, MarkdownInput } from '../components/form' +import { Form, Input, MarkdownInput } from '@/components/form' import { useRouter } from 'next/router' import { gql, useApolloClient, useMutation } from '@apollo/client' import Countdown from './countdown' import AdvPostForm, { AdvPostInitial } from './adv-post-form' import InputGroup from 'react-bootstrap/InputGroup' import useCrossposter from './use-crossposter' -import { bountySchema } from '../lib/validate' +import { bountySchema } from '@/lib/validate' import { SubSelectInitial } from './sub-select' import { useCallback } from 'react' -import { normalizeForwards, toastDeleteScheduled } from '../lib/form' -import { MAX_TITLE_LENGTH } from '../lib/constants' +import { normalizeForwards, toastDeleteScheduled } from '@/lib/form' +import { MAX_TITLE_LENGTH } from '@/lib/constants' import { useMe } from './me' import { useToast } from './toast' import { ItemButtonBar } from './post' diff --git a/components/chain-fee.js b/components/chain-fee.js index 9171292b..ae50c942 100644 --- a/components/chain-fee.js +++ b/components/chain-fee.js @@ -1,7 +1,7 @@ import { createContext, useContext, useMemo } from 'react' import { useQuery } from '@apollo/client' -import { SSR } from '../lib/constants' -import { CHAIN_FEE } from '../fragments/chainFee' +import { SSR } from '@/lib/constants' +import { CHAIN_FEE } from '@/fragments/chainFee' export const ChainFeeContext = createContext({ fee: 0 diff --git a/components/charts.js b/components/charts.js index 0a7f3b2f..f8deb618 100644 --- a/components/charts.js +++ b/components/charts.js @@ -12,9 +12,9 @@ import { ResponsiveContainer } from 'recharts/lib/component/ResponsiveContainer' import { PieChart } from 'recharts/lib/chart/PieChart' import { Cell } from 'recharts/lib/component/Cell' import { Pie } from 'recharts/lib/polar/Pie' -import { abbrNum } from '../lib/format' +import { abbrNum } from '@/lib/format' import { useRouter } from 'next/router' -import { timeUnitForRange } from '../lib/time' +import { timeUnitForRange } from '@/lib/time' const dateFormatter = (when, from, to) => { const unit = xAxisName(when, from, to) diff --git a/components/comment-edit.js b/components/comment-edit.js index 1a6818cd..4338dfbf 100644 --- a/components/comment-edit.js +++ b/components/comment-edit.js @@ -1,9 +1,9 @@ -import { Form, MarkdownInput } from '../components/form' +import { Form, MarkdownInput } from '@/components/form' import { gql, useMutation } from '@apollo/client' import styles from './reply.module.css' -import { commentSchema } from '../lib/validate' +import { commentSchema } from '@/lib/validate' import { useToast } from './toast' -import { toastDeleteScheduled } from '../lib/form' +import { toastDeleteScheduled } from '@/lib/form' import { FeeButtonProvider } from './fee-button' import { ItemButtonBar } from './post' diff --git a/components/comment.js b/components/comment.js index 2e9347db..e19c7bcb 100644 --- a/components/comment.js +++ b/components/comment.js @@ -5,16 +5,16 @@ import Link from 'next/link' import Reply, { ReplyOnAnotherPage } from './reply' import { useEffect, useMemo, useRef, useState } from 'react' import UpVote from './upvote' -import Eye from '../svgs/eye-fill.svg' -import EyeClose from '../svgs/eye-close-line.svg' +import Eye from '@/svgs/eye-fill.svg' +import EyeClose from '@/svgs/eye-close-line.svg' import { useRouter } from 'next/router' import CommentEdit from './comment-edit' -import { ANON_USER_ID, COMMENT_DEPTH_LIMIT, UNKNOWN_LINK_REL } from '../lib/constants' -import { ignoreClick } from '../lib/clicks' +import { ANON_USER_ID, COMMENT_DEPTH_LIMIT, UNKNOWN_LINK_REL } from '@/lib/constants' +import { ignoreClick } from '@/lib/clicks' import PayBounty from './pay-bounty' -import BountyIcon from '../svgs/bounty-bag.svg' +import BountyIcon from '@/svgs/bounty-bag.svg' import ActionTooltip from './action-tooltip' -import { numWithUnits } from '../lib/format' +import { numWithUnits } from '@/lib/format' import Share from './share' import ItemInfo from './item-info' import Badge from 'react-bootstrap/Badge' @@ -22,9 +22,9 @@ import { RootProvider, useRoot } from './root' import { useMe } from './me' import { useQuoteReply } from './use-quote-reply' import { DownZap } from './dont-link-this' -import Skull from '../svgs/death-skull.svg' -import { commentSubTreeRootId } from '../lib/item' -import Pin from '../svgs/pushpin-fill.svg' +import Skull from '@/svgs/death-skull.svg' +import { commentSubTreeRootId } from '@/lib/item' +import Pin from '@/svgs/pushpin-fill.svg' function Parent ({ item, rootText }) { const root = useRoot() diff --git a/components/comments.js b/components/comments.js index e77337a7..c475dc25 100644 --- a/components/comments.js +++ b/components/comments.js @@ -3,8 +3,8 @@ import Comment, { CommentSkeleton } from './comment' import styles from './header.module.css' import Nav from 'react-bootstrap/Nav' import Navbar from 'react-bootstrap/Navbar' -import { numWithUnits } from '../lib/format' -import { defaultCommentSort } from '../lib/item' +import { numWithUnits } from '@/lib/format' +import { defaultCommentSort } from '@/lib/item' import { useRouter } from 'next/router' export function CommentsHeader ({ handleSort, pinned, bio, parentCreatedAt, commentSats }) { diff --git a/components/discussion-form.js b/components/discussion-form.js index 97aa7a77..efa9d9c7 100644 --- a/components/discussion-form.js +++ b/components/discussion-form.js @@ -1,16 +1,16 @@ -import { Form, Input, MarkdownInput } from '../components/form' +import { Form, Input, MarkdownInput } from '@/components/form' import { useRouter } from 'next/router' import { gql, useApolloClient, useLazyQuery, useMutation } from '@apollo/client' import Countdown from './countdown' import AdvPostForm, { AdvPostInitial } from './adv-post-form' -import { ITEM_FIELDS } from '../fragments/items' +import { ITEM_FIELDS } from '@/fragments/items' import AccordianItem from './accordian-item' import Item from './item' -import { discussionSchema } from '../lib/validate' +import { discussionSchema } from '@/lib/validate' import { SubSelectInitial } from './sub-select' import { useCallback } from 'react' -import { normalizeForwards, toastDeleteScheduled } from '../lib/form' -import { MAX_TITLE_LENGTH } from '../lib/constants' +import { normalizeForwards, toastDeleteScheduled } from '@/lib/form' +import { MAX_TITLE_LENGTH } from '@/lib/constants' import { useMe } from './me' import useCrossposter from './use-crossposter' import { useToast } from './toast' diff --git a/components/dont-link-this.js b/components/dont-link-this.js index 5cf71aa6..0fa35fc4 100644 --- a/components/dont-link-this.js +++ b/components/dont-link-this.js @@ -3,9 +3,9 @@ import { useShowModal } from './modal' import { useToast } from './toast' import ItemAct from './item-act' import AccordianItem from './accordian-item' -import Flag from '../svgs/flag-fill.svg' +import Flag from '@/svgs/flag-fill.svg' import { useMemo } from 'react' -import getColor from '../lib/rainbow' +import getColor from '@/lib/rainbow' import { gql, useMutation } from '@apollo/client' import { useMe } from './me' diff --git a/components/error-boundary.js b/components/error-boundary.js index 26b8e966..2b496ec7 100644 --- a/components/error-boundary.js +++ b/components/error-boundary.js @@ -1,6 +1,6 @@ import { Component } from 'react' import { StaticLayout } from './layout' -import styles from '../styles/error.module.css' +import styles from '@/styles/error.module.css' import Image from 'react-bootstrap/Image' import copy from 'clipboard-copy' import { LoggerContext } from './logger' diff --git a/components/fee-button.js b/components/fee-button.js index 502724da..dd7db599 100644 --- a/components/fee-button.js +++ b/components/fee-button.js @@ -4,10 +4,10 @@ import ActionTooltip from './action-tooltip' import Info from './info' import styles from './fee-button.module.css' import { gql, useQuery } from '@apollo/client' -import { ANON_FEE_MULTIPLIER, SSR } from '../lib/constants' -import { numWithUnits } from '../lib/format' +import { ANON_FEE_MULTIPLIER, SSR } from '@/lib/constants' +import { numWithUnits } from '@/lib/format' import { useMe } from './me' -import AnonIcon from '../svgs/spy-fill.svg' +import AnonIcon from '@/svgs/spy-fill.svg' import { useShowModal } from './modal' import Link from 'next/link' import { SubmitButton } from './form' diff --git a/components/footer-rewards.js b/components/footer-rewards.js index 91b6cee4..77cf69c6 100644 --- a/components/footer-rewards.js +++ b/components/footer-rewards.js @@ -1,7 +1,7 @@ import { gql, useQuery } from '@apollo/client' import Link from 'next/link' -import { RewardLine } from '../pages/rewards' -import { SSR } from '../lib/constants' +import { RewardLine } from '@/pages/rewards' +import { SSR } from '@/lib/constants' const REWARDS = gql` { diff --git a/components/footer.js b/components/footer.js index f6f6208d..eb3bad70 100644 --- a/components/footer.js +++ b/components/footer.js @@ -3,15 +3,15 @@ import OverlayTrigger from 'react-bootstrap/OverlayTrigger' import Popover from 'react-bootstrap/Popover' import { CopyInput } from './form' import styles from './footer.module.css' -import Texas from '../svgs/texas.svg' -import Github from '../svgs/github-fill.svg' +import Texas from '@/svgs/texas.svg' +import Github from '@/svgs/github-fill.svg' import Link from 'next/link' -import Sun from '../svgs/sun-fill.svg' -import Moon from '../svgs/moon-fill.svg' -import No from '../svgs/no.svg' -import Bolt from '../svgs/bolt.svg' -import Amboss from '../svgs/amboss.svg' -import Mempool from '../svgs/bimi.svg' +import Sun from '@/svgs/sun-fill.svg' +import Moon from '@/svgs/moon-fill.svg' +import No from '@/svgs/no.svg' +import Bolt from '@/svgs/bolt.svg' +import Amboss from '@/svgs/amboss.svg' +import Mempool from '@/svgs/bimi.svg' import { useEffect, useState } from 'react' import Rewards from './footer-rewards' import useDarkMode from './dark-mode' diff --git a/components/form.js b/components/form.js index c9b2915d..42f0e6c5 100644 --- a/components/form.js +++ b/components/form.js @@ -8,27 +8,27 @@ import Col from 'react-bootstrap/Col' import Dropdown from 'react-bootstrap/Dropdown' import Nav from 'react-bootstrap/Nav' import Row from 'react-bootstrap/Row' -import Markdown from '../svgs/markdown-line.svg' -import AddImageIcon from '../svgs/image-add-line.svg' +import Markdown from '@/svgs/markdown-line.svg' +import AddImageIcon from '@/svgs/image-add-line.svg' import styles from './form.module.css' -import Text from '../components/text' -import AddIcon from '../svgs/add-fill.svg' -import CloseIcon from '../svgs/close-line.svg' +import Text from '@/components/text' +import AddIcon from '@/svgs/add-fill.svg' +import CloseIcon from '@/svgs/close-line.svg' import { gql, useLazyQuery } from '@apollo/client' -import { USER_SUGGESTIONS } from '../fragments/users' +import { USER_SUGGESTIONS } from '@/fragments/users' import TextareaAutosize from 'react-textarea-autosize' import { useToast } from './toast' import { useInvoiceable } from './invoice' -import { numWithUnits } from '../lib/format' +import { numWithUnits } from '@/lib/format' import textAreaCaret from 'textarea-caret' import ReactDatePicker from 'react-datepicker' import 'react-datepicker/dist/react-datepicker.css' import useDebounceCallback, { debounce } from './use-debounce-callback' import { ImageUpload } from './image' -import { AWS_S3_URL_REGEXP } from '../lib/constants' -import { whenRange } from '../lib/time' +import { AWS_S3_URL_REGEXP } from '@/lib/constants' +import { whenRange } from '@/lib/time' import { useFeeButton } from './fee-button' -import Thumb from '../svgs/thumb-up-fill.svg' +import Thumb from '@/svgs/thumb-up-fill.svg' import Info from './info' export function SubmitButton ({ diff --git a/components/hat.js b/components/hat.js index 229ee251..9856b6a0 100644 --- a/components/hat.js +++ b/components/hat.js @@ -1,10 +1,10 @@ import Badge from 'react-bootstrap/Badge' import OverlayTrigger from 'react-bootstrap/OverlayTrigger' import Tooltip from 'react-bootstrap/Tooltip' -import CowboyHatIcon from '../svgs/cowboy.svg' -import AnonIcon from '../svgs/spy-fill.svg' -import { numWithUnits } from '../lib/format' -import { AD_USER_ID, ANON_USER_ID } from '../lib/constants' +import CowboyHatIcon from '@/svgs/cowboy.svg' +import AnonIcon from '@/svgs/spy-fill.svg' +import { numWithUnits } from '@/lib/format' +import { AD_USER_ID, ANON_USER_ID } from '@/lib/constants' export default function Hat ({ user, badge, className = 'ms-1', height = 16, width = 16 }) { if (!user || Number(user.id) === AD_USER_ID) return null diff --git a/components/header.js b/components/header.js index 410b8235..59c4518a 100644 --- a/components/header.js +++ b/components/header.js @@ -11,20 +11,20 @@ import { useMe } from './me' import Head from 'next/head' import { signOut } from 'next-auth/react' import { useCallback, useEffect } from 'react' -import { randInRange } from '../lib/rand' -import { abbrNum, msatsToSats } from '../lib/format' -import NoteIcon from '../svgs/notification-4-fill.svg' +import { randInRange } from '@/lib/rand' +import { abbrNum, msatsToSats } from '@/lib/format' +import NoteIcon from '@/svgs/notification-4-fill.svg' import { useQuery } from '@apollo/client' -import LightningIcon from '../svgs/bolt.svg' -import SearchIcon from '../svgs/search-line.svg' -import BackArrow from '../svgs/arrow-left-line.svg' -import { BALANCE_LIMIT_MSATS, SSR } from '../lib/constants' +import LightningIcon from '@/svgs/bolt.svg' +import SearchIcon from '@/svgs/search-line.svg' +import BackArrow from '@/svgs/arrow-left-line.svg' +import { BALANCE_LIMIT_MSATS, SSR } from '@/lib/constants' import { useLightning } from './lightning' -import { HAS_NOTIFICATIONS } from '../fragments/notifications' -import AnonIcon from '../svgs/spy-fill.svg' +import { HAS_NOTIFICATIONS } from '@/fragments/notifications' +import AnonIcon from '@/svgs/spy-fill.svg' import Hat from './hat' import HiddenWalletSummary from './hidden-wallet-summary' -import { clearNotifications } from '../lib/badge' +import { clearNotifications } from '@/lib/badge' import { useServiceWorker } from './serviceworker' import SubSelect from './sub-select' diff --git a/components/hidden-wallet-summary.js b/components/hidden-wallet-summary.js index 161f03b3..51189e49 100644 --- a/components/hidden-wallet-summary.js +++ b/components/hidden-wallet-summary.js @@ -1,5 +1,5 @@ import { useState, useRef, useEffect } from 'react' -import { abbrNum, numWithUnits } from '../lib/format' +import { abbrNum, numWithUnits } from '@/lib/format' import { useMe } from './me' export default function HiddenWalletSummary ({ abbreviate, fixedWidth }) { diff --git a/components/image.js b/components/image.js index 8eebc8f5..5f775ad5 100644 --- a/components/image.js +++ b/components/image.js @@ -1,10 +1,10 @@ import styles from './text.module.css' import { Fragment, useState, useEffect, useMemo, useCallback, forwardRef, useRef, memo } from 'react' -import { IMGPROXY_URL_REGEXP } from '../lib/url' +import { IMGPROXY_URL_REGEXP } from '@/lib/url' import { useShowModal } from './modal' import { useMe } from './me' import { Dropdown } from 'react-bootstrap' -import { UNKNOWN_LINK_REL, UPLOAD_TYPES_ALLOW, MEDIA_URL } from '../lib/constants' +import { UNKNOWN_LINK_REL, UPLOAD_TYPES_ALLOW, MEDIA_URL } from '@/lib/constants' import { useToast } from './toast' import gql from 'graphql-tag' import { useMutation } from '@apollo/client' diff --git a/components/info.js b/components/info.js index 9d8c2696..acd6ed13 100644 --- a/components/info.js +++ b/components/info.js @@ -1,5 +1,5 @@ import React from 'react' -import InfoIcon from '../svgs/information-fill.svg' +import InfoIcon from '@/svgs/information-fill.svg' import { useShowModal } from './modal' export default function Info ({ children, label, iconClassName = 'fill-theme-color' }) { diff --git a/components/invite.js b/components/invite.js index c809819b..445175fb 100644 --- a/components/invite.js +++ b/components/invite.js @@ -1,7 +1,7 @@ import { CopyInput } from './form' import { gql, useMutation } from '@apollo/client' -import { INVITE_FIELDS } from '../fragments/invites' -import styles from '../styles/invites.module.css' +import { INVITE_FIELDS } from '@/fragments/invites' +import styles from '@/styles/invites.module.css' export default function Invite ({ invite, active }) { const [revokeInvite] = useMutation( diff --git a/components/invoice-status.js b/components/invoice-status.js index 271599ff..e2f6a3b3 100644 --- a/components/invoice-status.js +++ b/components/invoice-status.js @@ -1,6 +1,6 @@ -import Moon from '../svgs/moon-fill.svg' -import Check from '../svgs/check-double-line.svg' -import ThumbDown from '../svgs/thumb-down-fill.svg' +import Moon from '@/svgs/moon-fill.svg' +import Check from '@/svgs/check-double-line.svg' +import ThumbDown from '@/svgs/thumb-down-fill.svg' function InvoiceDefaultStatus ({ status }) { return ( diff --git a/components/invoice.js b/components/invoice.js index 9da9657c..fa569e0d 100644 --- a/components/invoice.js +++ b/components/invoice.js @@ -2,10 +2,10 @@ import { useState, useCallback, useEffect } from 'react' import { useApolloClient, useMutation, useQuery } from '@apollo/client' import { Button } from 'react-bootstrap' import { gql } from 'graphql-tag' -import { numWithUnits } from '../lib/format' +import { numWithUnits } from '@/lib/format' import AccordianItem from './accordian-item' import Qr, { QrSkeleton } from './qr' -import { INVOICE } from '../fragments/wallet' +import { INVOICE } from '@/fragments/wallet' import InvoiceStatus from './invoice-status' import { useMe } from './me' import { useShowModal } from './modal' diff --git a/components/item-act.js b/components/item-act.js index a2ccea9b..e72928b3 100644 --- a/components/item-act.js +++ b/components/item-act.js @@ -3,8 +3,8 @@ import InputGroup from 'react-bootstrap/InputGroup' import React, { useState, useRef, useEffect, useCallback } from 'react' import { Form, Input, SubmitButton } from './form' import { useMe } from './me' -import UpBolt from '../svgs/bolt.svg' -import { amountSchema } from '../lib/validate' +import UpBolt from '@/svgs/bolt.svg' +import { amountSchema } from '@/lib/validate' import { gql, useApolloClient, useMutation } from '@apollo/client' import { payOrLoginError, useInvoiceModal } from './invoice' import { TOAST_DEFAULT_DELAY_MS, useToast, withToastFlow } from './toast' diff --git a/components/item-full.js b/components/item-full.js index b671e2cf..13600404 100644 --- a/components/item-full.js +++ b/components/item-full.js @@ -5,7 +5,7 @@ import Comment from './comment' import Text, { SearchText } from './text' import ZoomableImage from './image' import Comments from './comments' -import styles from '../styles/item.module.css' +import styles from '@/styles/item.module.css' import itemStyles from './item.module.css' import { useMe } from './me' import Button from 'react-bootstrap/Button' @@ -14,18 +14,18 @@ import YouTube from 'react-youtube' import useDarkMode from './dark-mode' import { useEffect, useState } from 'react' import Poll from './poll' -import { commentsViewed } from '../lib/new-comments' +import { commentsViewed } from '@/lib/new-comments' import Related from './related' import PastBounties from './past-bounties' -import Check from '../svgs/check-double-line.svg' +import Check from '@/svgs/check-double-line.svg' import Share from './share' import Toc from './table-of-contents' import Link from 'next/link' import { RootProvider } from './root' -import { IMGPROXY_URL_REGEXP } from '../lib/url' -import { numWithUnits } from '../lib/format' +import { IMGPROXY_URL_REGEXP } from '@/lib/url' +import { numWithUnits } from '@/lib/format' import { useQuoteReply } from './use-quote-reply' -import { UNKNOWN_LINK_REL } from '../lib/constants' +import { UNKNOWN_LINK_REL } from '@/lib/constants' function BioItem ({ item, handleClick }) { const me = useMe() diff --git a/components/item-info.js b/components/item-info.js index dbd7fe63..498419e5 100644 --- a/components/item-info.js +++ b/components/item-info.js @@ -4,9 +4,9 @@ import { useEffect, useState } from 'react' import Badge from 'react-bootstrap/Badge' import Dropdown from 'react-bootstrap/Dropdown' import Countdown from './countdown' -import { abbrNum, numWithUnits } from '../lib/format' -import { newComments, commentsViewedAt } from '../lib/new-comments' -import { timeSince } from '../lib/time' +import { abbrNum, numWithUnits } from '@/lib/format' +import { newComments, commentsViewedAt } from '@/lib/new-comments' +import { timeSince } from '@/lib/time' import { DeleteDropdownItem } from './delete' import styles from './item.module.css' import { useMe } from './me' @@ -15,7 +15,7 @@ import BookmarkDropdownItem from './bookmark' import SubscribeDropdownItem from './subscribe' import { CopyLinkDropdownItem, CrosspostDropdownItem } from './share' import Hat from './hat' -import { AD_USER_ID } from '../lib/constants' +import { AD_USER_ID } from '@/lib/constants' import ActionDropdown from './action-dropdown' import MuteDropdownItem from './mute' import { DropdownItemUpVote } from './upvote' diff --git a/components/item-job.js b/components/item-job.js index c59190c9..c0ae33f6 100644 --- a/components/item-job.js +++ b/components/item-job.js @@ -6,11 +6,11 @@ import Image from 'react-bootstrap/Image' import { SearchTitle } from './item' import styles from './item.module.css' import Link from 'next/link' -import { timeSince } from '../lib/time' -import EmailIcon from '../svgs/mail-open-line.svg' +import { timeSince } from '@/lib/time' +import EmailIcon from '@/svgs/mail-open-line.svg' import Share from './share' import Hat from './hat' -import { MEDIA_URL } from '../lib/constants' +import { MEDIA_URL } from '@/lib/constants' export default function ItemJob ({ item, toc, rank, children }) { const isEmail = string().email().isValidSync(item.url) diff --git a/components/item.js b/components/item.js index ce3c9a5f..d859ff31 100644 --- a/components/item.js +++ b/components/item.js @@ -2,22 +2,22 @@ import Link from 'next/link' import styles from './item.module.css' import UpVote from './upvote' import { useRef } from 'react' -import { AD_USER_ID, UNKNOWN_LINK_REL } from '../lib/constants' -import Pin from '../svgs/pushpin-fill.svg' +import { AD_USER_ID, UNKNOWN_LINK_REL } from '@/lib/constants' +import Pin from '@/svgs/pushpin-fill.svg' import reactStringReplace from 'react-string-replace' -import PollIcon from '../svgs/bar-chart-horizontal-fill.svg' -import BountyIcon from '../svgs/bounty-bag.svg' +import PollIcon from '@/svgs/bar-chart-horizontal-fill.svg' +import BountyIcon from '@/svgs/bounty-bag.svg' import ActionTooltip from './action-tooltip' -import ImageIcon from '../svgs/image-fill.svg' -import { numWithUnits } from '../lib/format' +import ImageIcon from '@/svgs/image-fill.svg' +import { numWithUnits } from '@/lib/format' import ItemInfo from './item-info' -import Prism from '../svgs/prism.svg' -import { commentsViewedAt } from '../lib/new-comments' +import Prism from '@/svgs/prism.svg' +import { commentsViewedAt } from '@/lib/new-comments' import { useRouter } from 'next/router' import { Badge } from 'react-bootstrap' -import AdIcon from '../svgs/advertisement-fill.svg' +import AdIcon from '@/svgs/advertisement-fill.svg' import { DownZap } from './dont-link-this' -import { timeLeft } from '../lib/time' +import { timeLeft } from '@/lib/time' export function SearchTitle ({ title }) { return reactStringReplace(title, /\*\*\*([^*]+)\*\*\*/g, (match, i) => { diff --git a/components/items.js b/components/items.js index 1aeb604d..f58917be 100644 --- a/components/items.js +++ b/components/items.js @@ -5,8 +5,8 @@ import styles from './items.module.css' import MoreFooter from './more-footer' import { Fragment, useCallback, useMemo } from 'react' import { CommentFlat } from './comment' -import { SUB_ITEMS } from '../fragments/subs' -import { LIMIT } from '../lib/cursor' +import { SUB_ITEMS } from '@/fragments/subs' +import { LIMIT } from '@/lib/cursor' import ItemFull from './item-full' import { useData } from './use-data' diff --git a/components/job-form.js b/components/job-form.js index 0dbf2325..dee96df8 100644 --- a/components/job-form.js +++ b/components/job-form.js @@ -8,16 +8,16 @@ import Alert from 'react-bootstrap/Alert' import { useCallback, useEffect, useState } from 'react' import Info from './info' import AccordianItem from './accordian-item' -import styles from '../styles/post.module.css' +import styles from '@/styles/post.module.css' import { useLazyQuery, gql, useMutation } from '@apollo/client' import { useRouter } from 'next/router' import Link from 'next/link' import { usePrice } from './price' import Avatar from './avatar' -import { jobSchema } from '../lib/validate' -import { MAX_TITLE_LENGTH, MEDIA_URL } from '../lib/constants' +import { jobSchema } from '@/lib/validate' +import { MAX_TITLE_LENGTH, MEDIA_URL } from '@/lib/constants' import { useToast } from './toast' -import { toastDeleteScheduled } from '../lib/form' +import { toastDeleteScheduled } from '@/lib/form' import { ItemButtonBar } from './post' function satsMin2Mo (minute) { diff --git a/components/lightning-auth.js b/components/lightning-auth.js index 135fbe61..8bdef0f2 100644 --- a/components/lightning-auth.js +++ b/components/lightning-auth.js @@ -7,9 +7,9 @@ import Row from 'react-bootstrap/Row' import AccordianItem from './accordian-item' import Qr, { QrSkeleton } from './qr' import styles from './lightning-auth.module.css' -import BackIcon from '../svgs/arrow-left-line.svg' +import BackIcon from '@/svgs/arrow-left-line.svg' import { useRouter } from 'next/router' -import { SSR } from '../lib/constants' +import { SSR } from '@/lib/constants' function QrAuth ({ k1, encodedUrl, callbackUrl }) { const query = gql` diff --git a/components/lightning.js b/components/lightning.js index 948abf56..a9594ba8 100644 --- a/components/lightning.js +++ b/components/lightning.js @@ -1,5 +1,5 @@ import React, { useRef, useEffect, useContext } from 'react' -import { randInRange } from '../lib/rand' +import { randInRange } from '@/lib/rand' export const LightningContext = React.createContext(() => {}) diff --git a/components/link-form.js b/components/link-form.js index 3858ee57..fa754721 100644 --- a/components/link-form.js +++ b/components/link-form.js @@ -1,18 +1,18 @@ import { useState, useEffect, useCallback } from 'react' -import { Form, Input, MarkdownInput } from '../components/form' +import { Form, Input, MarkdownInput } from '@/components/form' import { useRouter } from 'next/router' import { gql, useApolloClient, useLazyQuery, useMutation } from '@apollo/client' import Countdown from './countdown' import AdvPostForm, { AdvPostInitial } from './adv-post-form' -import { ITEM_FIELDS } from '../fragments/items' +import { ITEM_FIELDS } from '@/fragments/items' import Item from './item' import AccordianItem from './accordian-item' -import { linkSchema } from '../lib/validate' -import Moon from '../svgs/moon-fill.svg' -import { normalizeForwards, toastDeleteScheduled } from '../lib/form' +import { linkSchema } from '@/lib/validate' +import Moon from '@/svgs/moon-fill.svg' +import { normalizeForwards, toastDeleteScheduled } from '@/lib/form' import { useToast } from './toast' import { SubSelectInitial } from './sub-select' -import { MAX_TITLE_LENGTH } from '../lib/constants' +import { MAX_TITLE_LENGTH } from '@/lib/constants' import useCrossposter from './use-crossposter' import { useMe } from './me' import { ItemButtonBar } from './post' diff --git a/components/logger.js b/components/logger.js index 64d331b7..d3a6f94f 100644 --- a/components/logger.js +++ b/components/logger.js @@ -1,6 +1,6 @@ import { createContext, useCallback, useContext, useEffect, useMemo, useState } from 'react' import { useMe } from './me' -import fancyNames from '../lib/fancy-names.json' +import fancyNames from '@/lib/fancy-names.json' const generateFancyName = () => { // 100 adjectives * 100 nouns * 10000 = 100M possible names diff --git a/components/login-button.js b/components/login-button.js index 052560c8..26d6ef6f 100644 --- a/components/login-button.js +++ b/components/login-button.js @@ -1,7 +1,7 @@ -import GithubIcon from '../svgs/github-fill.svg' -import TwitterIcon from '../svgs/twitter-fill.svg' -import LightningIcon from '../svgs/bolt.svg' -import NostrIcon from '../svgs/nostr.svg' +import GithubIcon from '@/svgs/github-fill.svg' +import TwitterIcon from '@/svgs/twitter-fill.svg' +import LightningIcon from '@/svgs/bolt.svg' +import NostrIcon from '@/svgs/nostr.svg' import Button from 'react-bootstrap/Button' export default function LoginButton ({ text, type, className, onClick }) { diff --git a/components/login.js b/components/login.js index eedc58b3..6f84f802 100644 --- a/components/login.js +++ b/components/login.js @@ -1,13 +1,13 @@ import { signIn } from 'next-auth/react' import styles from './login.module.css' -import { Form, Input, SubmitButton } from '../components/form' +import { Form, Input, SubmitButton } from '@/components/form' import { useState } from 'react' import Alert from 'react-bootstrap/Alert' import { useRouter } from 'next/router' import { LightningAuthWithExplainer } from './lightning-auth' import NostrAuth from './nostr-auth' import LoginButton from './login-button' -import { emailSchema } from '../lib/validate' +import { emailSchema } from '@/lib/validate' export function EmailLoginForm ({ text, callbackUrl }) { return ( diff --git a/components/me.js b/components/me.js index d3d61fae..3937950d 100644 --- a/components/me.js +++ b/components/me.js @@ -1,7 +1,7 @@ import React, { useContext } from 'react' import { useQuery } from '@apollo/client' -import { ME } from '../fragments/users' -import { SSR } from '../lib/constants' +import { ME } from '@/fragments/users' +import { SSR } from '@/lib/constants' export const MeContext = React.createContext({ me: null diff --git a/components/modal.js b/components/modal.js index 68b53dab..7ae025c5 100644 --- a/components/modal.js +++ b/components/modal.js @@ -1,6 +1,6 @@ import { createContext, useCallback, useContext, useEffect, useMemo, useState } from 'react' import Modal from 'react-bootstrap/Modal' -import BackArrow from '../svgs/arrow-left-line.svg' +import BackArrow from '@/svgs/arrow-left-line.svg' import { useRouter } from 'next/router' import ActionDropdown from './action-dropdown' diff --git a/components/nostr-auth.js b/components/nostr-auth.js index bbae4095..530e3865 100644 --- a/components/nostr-auth.js +++ b/components/nostr-auth.js @@ -6,9 +6,9 @@ import Col from 'react-bootstrap/Col' import Row from 'react-bootstrap/Row' import { useRouter } from 'next/router' import AccordianItem from './accordian-item' -import BackIcon from '../svgs/arrow-left-line.svg' +import BackIcon from '@/svgs/arrow-left-line.svg' import styles from './lightning-auth.module.css' -import { callWithTimeout } from '../lib/nostr' +import { callWithTimeout } from '@/lib/nostr' function ExtensionError ({ message, details }) { return ( diff --git a/components/notifications.js b/components/notifications.js index a767c0aa..9a9d3360 100644 --- a/components/notifications.js +++ b/components/notifications.js @@ -3,17 +3,17 @@ import { useQuery } from '@apollo/client' import Comment, { CommentSkeleton } from './comment' import Item from './item' import ItemJob from './item-job' -import { NOTIFICATIONS } from '../fragments/notifications' +import { NOTIFICATIONS } from '@/fragments/notifications' import MoreFooter from './more-footer' import Invite from './invite' -import { ignoreClick } from '../lib/clicks' -import { dayMonthYear, timeSince } from '../lib/time' +import { ignoreClick } from '@/lib/clicks' +import { dayMonthYear, timeSince } from '@/lib/time' import Link from 'next/link' -import Check from '../svgs/check-double-line.svg' -import HandCoin from '../svgs/hand-coin-fill.svg' -import { LOST_BLURBS, FOUND_BLURBS, UNKNOWN_LINK_REL } from '../lib/constants' -import CowboyHatIcon from '../svgs/cowboy.svg' -import BaldIcon from '../svgs/bald.svg' +import Check from '@/svgs/check-double-line.svg' +import HandCoin from '@/svgs/hand-coin-fill.svg' +import { LOST_BLURBS, FOUND_BLURBS, UNKNOWN_LINK_REL } from '@/lib/constants' +import CowboyHatIcon from '@/svgs/cowboy.svg' +import BaldIcon from '@/svgs/bald.svg' import { RootProvider } from './root' import Alert from 'react-bootstrap/Alert' import styles from './notifications.module.css' @@ -21,14 +21,14 @@ import { useServiceWorker } from './serviceworker' import { Checkbox, Form } from './form' import { useRouter } from 'next/router' import { useData } from './use-data' -import { nostrZapDetails } from '../lib/nostr' +import { nostrZapDetails } from '@/lib/nostr' import Text from './text' -import NostrIcon from '../svgs/nostr.svg' -import { numWithUnits } from '../lib/format' -import BountyIcon from '../svgs/bounty-bag.svg' +import NostrIcon from '@/svgs/nostr.svg' +import { numWithUnits } from '@/lib/format' +import BountyIcon from '@/svgs/bounty-bag.svg' import { LongCountdown } from './countdown' -import { nextBillingWithGrace } from '../lib/territory' -import { commentSubTreeRootId } from '../lib/item' +import { nextBillingWithGrace } from '@/lib/territory' +import { commentSubTreeRootId } from '@/lib/item' function Notification ({ n, fresh }) { const type = n.__typename diff --git a/components/page-loading.js b/components/page-loading.js index 9fe4f9eb..189f1aa9 100644 --- a/components/page-loading.js +++ b/components/page-loading.js @@ -1,4 +1,4 @@ -import Moon from '../svgs/moon-fill.svg' +import Moon from '@/svgs/moon-fill.svg' export default function PageLoading () { return ( diff --git a/components/pay-bounty.js b/components/pay-bounty.js index 483de2df..cd03c0a9 100644 --- a/components/pay-bounty.js +++ b/components/pay-bounty.js @@ -3,7 +3,7 @@ import Button from 'react-bootstrap/Button' import styles from './pay-bounty.module.css' import ActionTooltip from './action-tooltip' import { useMe } from './me' -import { numWithUnits } from '../lib/format' +import { numWithUnits } from '@/lib/format' import { useShowModal } from './modal' import { useRoot } from './root' import { payOrLoginError, useInvoiceModal } from './invoice' diff --git a/components/poll-form.js b/components/poll-form.js index 4b8f8c32..2ce59045 100644 --- a/components/poll-form.js +++ b/components/poll-form.js @@ -1,14 +1,14 @@ -import { DateTimeInput, Form, Input, MarkdownInput, VariableInput } from '../components/form' +import { DateTimeInput, Form, Input, MarkdownInput, VariableInput } from '@/components/form' import { useRouter } from 'next/router' import { gql, useApolloClient, useMutation } from '@apollo/client' import Countdown from './countdown' import AdvPostForm, { AdvPostInitial } from './adv-post-form' -import { MAX_POLL_CHOICE_LENGTH, MAX_POLL_NUM_CHOICES, MAX_TITLE_LENGTH } from '../lib/constants' -import { datePivot } from '../lib/time' -import { pollSchema } from '../lib/validate' +import { MAX_POLL_CHOICE_LENGTH, MAX_POLL_NUM_CHOICES, MAX_TITLE_LENGTH } from '@/lib/constants' +import { datePivot } from '@/lib/time' +import { pollSchema } from '@/lib/validate' import { SubSelectInitial } from './sub-select' import { useCallback } from 'react' -import { normalizeForwards, toastDeleteScheduled } from '../lib/form' +import { normalizeForwards, toastDeleteScheduled } from '@/lib/form' import useCrossposter from './use-crossposter' import { useMe } from './me' import { useToast } from './toast' diff --git a/components/poll.js b/components/poll.js index 9cc67ecb..7185421c 100644 --- a/components/poll.js +++ b/components/poll.js @@ -1,13 +1,13 @@ import { gql, useMutation } from '@apollo/client' import Button from 'react-bootstrap/Button' -import { fixedDecimal, numWithUnits } from '../lib/format' -import { timeLeft } from '../lib/time' +import { fixedDecimal, numWithUnits } from '@/lib/format' +import { timeLeft } from '@/lib/time' import { useMe } from './me' import styles from './poll.module.css' -import Check from '../svgs/checkbox-circle-fill.svg' +import Check from '@/svgs/checkbox-circle-fill.svg' import { signIn } from 'next-auth/react' import ActionTooltip from './action-tooltip' -import { POLL_COST } from '../lib/constants' +import { POLL_COST } from '@/lib/constants' import { payOrLoginError, useInvoiceModal } from './invoice' export default function Poll ({ item }) { diff --git a/components/price.js b/components/price.js index f9fa6f2f..cb53fe7f 100644 --- a/components/price.js +++ b/components/price.js @@ -1,10 +1,10 @@ import React, { useContext, useEffect, useMemo, useState } from 'react' import { useQuery } from '@apollo/client' -import { fixedDecimal } from '../lib/format' +import { fixedDecimal } from '@/lib/format' import { useMe } from './me' -import { PRICE } from '../fragments/price' -import { CURRENCY_SYMBOLS } from '../lib/currency' -import { SSR } from '../lib/constants' +import { PRICE } from '@/fragments/price' +import { CURRENCY_SYMBOLS } from '@/lib/currency' +import { SSR } from '@/lib/constants' import { useBlockHeight } from './block-height' import { useChainFee } from './chain-fee' diff --git a/components/recent-header.js b/components/recent-header.js index 79d56b11..cfc75a90 100644 --- a/components/recent-header.js +++ b/components/recent-header.js @@ -1,4 +1,4 @@ -import { ITEM_TYPES, ITEM_TYPES_UNIVERSAL } from '../lib/constants' +import { ITEM_TYPES, ITEM_TYPES_UNIVERSAL } from '@/lib/constants' import { Select } from './form' import { useRouter } from 'next/router' diff --git a/components/related.js b/components/related.js index 150ed3f4..3669f2e7 100644 --- a/components/related.js +++ b/components/related.js @@ -1,4 +1,4 @@ -import { RELATED_ITEMS } from '../fragments/items' +import { RELATED_ITEMS } from '@/fragments/items' import AccordianItem from './accordian-item' import Items from './items' import { NavigateFooter } from './more-footer' diff --git a/components/reply.js b/components/reply.js index 44e5183d..dd74c978 100644 --- a/components/reply.js +++ b/components/reply.js @@ -1,20 +1,20 @@ -import { Form, MarkdownInput } from '../components/form' +import { Form, MarkdownInput } from '@/components/form' import { gql, useMutation } from '@apollo/client' import styles from './reply.module.css' -import { COMMENTS } from '../fragments/comments' +import { COMMENTS } from '@/fragments/comments' import { useMe } from './me' import { forwardRef, useCallback, useEffect, useState, useRef } from 'react' import Link from 'next/link' import { FeeButtonProvider, postCommentBaseLineItems, postCommentUseRemoteLineItems } from './fee-button' -import { commentsViewedAfterComment } from '../lib/new-comments' -import { commentSchema } from '../lib/validate' +import { commentsViewedAfterComment } from '@/lib/new-comments' +import { commentSchema } from '@/lib/validate' import { useToast } from './toast' -import { toastDeleteScheduled } from '../lib/form' +import { toastDeleteScheduled } from '@/lib/form' import { ItemButtonBar } from './post' import { useShowModal } from './modal' import { Button } from 'react-bootstrap' import { useRoot } from './root' -import { commentSubTreeRootId } from '../lib/item' +import { commentSubTreeRootId } from '@/lib/item' export function ReplyOnAnotherPage ({ item }) { const rootId = commentSubTreeRootId(item) diff --git a/components/search.js b/components/search.js index 0433e085..fbfb65ba 100644 --- a/components/search.js +++ b/components/search.js @@ -1,10 +1,10 @@ import Container from 'react-bootstrap/Container' import styles from './search.module.css' -import SearchIcon from '../svgs/search-line.svg' +import SearchIcon from '@/svgs/search-line.svg' import { useEffect, useRef, useState } from 'react' import { Form, Input, Select, DatePicker, SubmitButton } from './form' import { useRouter } from 'next/router' -import { whenToFrom } from '../lib/time' +import { whenToFrom } from '@/lib/time' export default function Search ({ sub }) { const router = useRouter() diff --git a/components/seo.js b/components/seo.js index 9dfb037d..2aaa6615 100644 --- a/components/seo.js +++ b/components/seo.js @@ -1,7 +1,7 @@ import { NextSeo } from 'next-seo' import { useRouter } from 'next/router' import removeMd from 'remove-markdown' -import { numWithUnits } from '../lib/format' +import { numWithUnits } from '@/lib/format' export function SeoSearch ({ sub }) { const router = useRouter() diff --git a/components/share.js b/components/share.js index cec126d1..2f69882f 100644 --- a/components/share.js +++ b/components/share.js @@ -1,11 +1,11 @@ import Dropdown from 'react-bootstrap/Dropdown' -import ShareIcon from '../svgs/share-fill.svg' +import ShareIcon from '@/svgs/share-fill.svg' import copy from 'clipboard-copy' import useCrossposter from './use-crossposter' import { useMe } from './me' import { useToast } from './toast' -import { SSR } from '../lib/constants' -import { commentSubTreeRootId } from '../lib/item' +import { SSR } from '@/lib/constants' +import { commentSubTreeRootId } from '@/lib/item' import { useRouter } from 'next/router' const referrurl = (ipath, me) => { diff --git a/components/snl.js b/components/snl.js index cdb126f7..178cc874 100644 --- a/components/snl.js +++ b/components/snl.js @@ -1,8 +1,8 @@ import Alert from 'react-bootstrap/Alert' -import YouTube from '../svgs/youtube-line.svg' +import YouTube from '@/svgs/youtube-line.svg' import { useEffect, useState } from 'react' import { gql, useQuery } from '@apollo/client' -import { datePivot } from '../lib/time' +import { datePivot } from '@/lib/time' export default function Snl ({ ignorePreference }) { const [show, setShow] = useState() diff --git a/components/snow.js b/components/snow.js index 08e76a0f..d05f16b6 100644 --- a/components/snow.js +++ b/components/snow.js @@ -1,5 +1,5 @@ import React, { useCallback, useContext, useState } from 'react' -import { randInRange } from '../lib/rand' +import { randInRange } from '@/lib/rand' export const SnowContext = React.createContext(() => {}) diff --git a/components/sub-select.js b/components/sub-select.js index cb67702c..c36c69e1 100644 --- a/components/sub-select.js +++ b/components/sub-select.js @@ -1,7 +1,7 @@ import { useRouter } from 'next/router' import { Select } from './form' -import { SSR } from '../lib/constants' -import { SUBS } from '../fragments/subs' +import { SSR } from '@/lib/constants' +import { SUBS } from '@/fragments/subs' import { useQuery } from '@apollo/client' import { useEffect, useState } from 'react' import styles from './sub-select.module.css' diff --git a/components/table-of-contents.js b/components/table-of-contents.js index 956dadaf..0fe87d5e 100644 --- a/components/table-of-contents.js +++ b/components/table-of-contents.js @@ -1,7 +1,7 @@ import React, { useMemo, useState } from 'react' import Dropdown from 'react-bootstrap/Dropdown' import FormControl from 'react-bootstrap/FormControl' -import TocIcon from '../svgs/list-unordered.svg' +import TocIcon from '@/svgs/list-unordered.svg' import { fromMarkdown } from 'mdast-util-from-markdown' import { visit } from 'unist-util-visit' import { toString } from 'mdast-util-to-string' diff --git a/components/territory-form.js b/components/territory-form.js index 7db8cbea..948a6a77 100644 --- a/components/territory-form.js +++ b/components/territory-form.js @@ -5,13 +5,13 @@ import FeeButton, { FeeButtonProvider } from './fee-button' import { gql, useApolloClient, useLazyQuery, useMutation } from '@apollo/client' import { useCallback, useMemo, useState } from 'react' import { useRouter } from 'next/router' -import { MAX_TERRITORY_DESC_LENGTH, POST_TYPES, TERRITORY_BILLING_OPTIONS, TERRITORY_PERIOD_COST } from '../lib/constants' -import { territorySchema } from '../lib/validate' +import { MAX_TERRITORY_DESC_LENGTH, POST_TYPES, TERRITORY_BILLING_OPTIONS, TERRITORY_PERIOD_COST } from '@/lib/constants' +import { territorySchema } from '@/lib/validate' import { useMe } from './me' import Info from './info' -import { abbrNum } from '../lib/format' -import { purchasedType } from '../lib/territory' -import { SUB } from '../fragments/subs' +import { abbrNum } from '@/lib/format' +import { purchasedType } from '@/lib/territory' +import { SUB } from '@/fragments/subs' export default function TerritoryForm ({ sub }) { const router = useRouter() diff --git a/components/territory-header.js b/components/territory-header.js index 83aa47b4..a6b46212 100644 --- a/components/territory-header.js +++ b/components/territory-header.js @@ -3,7 +3,7 @@ import { AccordianCard } from './accordian-item' import TerritoryPaymentDue, { TerritoryBillingLine } from './territory-payment-due' import Link from 'next/link' import Text from './text' -import { numWithUnits } from '../lib/format' +import { numWithUnits } from '@/lib/format' import styles from './item.module.css' import Hat from './hat' import { useMe } from './me' diff --git a/components/territory-list.js b/components/territory-list.js index 6445ee58..e2f7f531 100644 --- a/components/territory-list.js +++ b/components/territory-list.js @@ -1,5 +1,5 @@ import Link from 'next/link' -import { abbrNum, numWithUnits } from '../lib/format' +import { abbrNum, numWithUnits } from '@/lib/format' import styles from './item.module.css' import React, { useEffect, useMemo, useState } from 'react' import { useQuery } from '@apollo/client' diff --git a/components/territory-payment-due.js b/components/territory-payment-due.js index 70b42c1a..ae4a1b9c 100644 --- a/components/territory-payment-due.js +++ b/components/territory-payment-due.js @@ -1,14 +1,14 @@ import { Alert } from 'react-bootstrap' import { useMe } from './me' import FeeButton, { FeeButtonProvider } from './fee-button' -import { TERRITORY_BILLING_OPTIONS } from '../lib/constants' +import { TERRITORY_BILLING_OPTIONS } from '@/lib/constants' import { Form } from './form' -import { timeSince } from '../lib/time' +import { timeSince } from '@/lib/time' import { LongCountdown } from './countdown' import { useCallback } from 'react' import { useApolloClient, useMutation } from '@apollo/client' -import { SUB_PAY } from '../fragments/subs' -import { nextBillingWithGrace } from '../lib/territory' +import { SUB_PAY } from '@/fragments/subs' +import { nextBillingWithGrace } from '@/lib/territory' export default function TerritoryPaymentDue ({ sub }) { const me = useMe() diff --git a/components/territory-transfer.js b/components/territory-transfer.js index 3533cc01..c11dc25d 100644 --- a/components/territory-transfer.js +++ b/components/territory-transfer.js @@ -3,7 +3,7 @@ import { useShowModal } from './modal' import { useToast } from './toast' import { Button, Dropdown, InputGroup } from 'react-bootstrap' import { Form, InputUserSuggest, SubmitButton } from './form' -import { territoryTransferSchema } from '../lib/validate' +import { territoryTransferSchema } from '@/lib/validate' import { useCallback } from 'react' import Link from 'next/link' import { useMe } from './me' diff --git a/components/text.js b/components/text.js index 6d5d5527..04b70617 100644 --- a/components/text.js +++ b/components/text.js @@ -4,22 +4,22 @@ import YouTube from 'react-youtube' import gfm from 'remark-gfm' import { LightAsync as SyntaxHighlighter } from 'react-syntax-highlighter' import atomDark from 'react-syntax-highlighter/dist/cjs/styles/prism/atom-dark' -import mention from '../lib/remark-mention' -import sub from '../lib/remark-sub' +import mention from '@/lib/remark-mention' +import sub from '@/lib/remark-sub' import React, { useState, memo, useRef, useCallback, useMemo, useEffect } from 'react' import GithubSlugger from 'github-slugger' -import LinkIcon from '../svgs/link.svg' -import Thumb from '../svgs/thumb-up-fill.svg' +import LinkIcon from '@/svgs/link.svg' +import Thumb from '@/svgs/thumb-up-fill.svg' import { toString } from 'mdast-util-to-string' import copy from 'clipboard-copy' import ZoomableImage, { decodeOriginalUrl } from './image' -import { IMGPROXY_URL_REGEXP, parseInternalLinks } from '../lib/url' +import { IMGPROXY_URL_REGEXP, parseInternalLinks } from '@/lib/url' import reactStringReplace from 'react-string-replace' -import { rehypeInlineCodeProperty } from '../lib/md' +import { rehypeInlineCodeProperty } from '@/lib/md' import { Button } from 'react-bootstrap' import { useRouter } from 'next/router' import Link from 'next/link' -import { UNKNOWN_LINK_REL } from '../lib/constants' +import { UNKNOWN_LINK_REL } from '@/lib/constants' import isEqual from 'lodash/isEqual' export function SearchText ({ text }) { diff --git a/components/top-header.js b/components/top-header.js index f49ea285..d9b180f9 100644 --- a/components/top-header.js +++ b/components/top-header.js @@ -1,7 +1,7 @@ import { useRouter } from 'next/router' import { Form, Select, DatePicker } from './form' -import { ITEM_SORTS, SUB_SORTS, USER_SORTS, WHENS } from '../lib/constants' -import { whenToFrom } from '../lib/time' +import { ITEM_SORTS, SUB_SORTS, USER_SORTS, WHENS } from '@/lib/constants' +import { whenToFrom } from '@/lib/time' export default function TopHeader ({ sub, cat }) { const router = useRouter() diff --git a/components/upvote.js b/components/upvote.js index 5ddb8735..4c78111d 100644 --- a/components/upvote.js +++ b/components/upvote.js @@ -1,16 +1,16 @@ -import UpBolt from '../svgs/bolt.svg' +import UpBolt from '@/svgs/bolt.svg' import styles from './upvote.module.css' import { gql, useMutation } from '@apollo/client' import ActionTooltip from './action-tooltip' import ItemAct, { useAct, useZap } from './item-act' import { useMe } from './me' -import getColor from '../lib/rainbow' +import getColor from '@/lib/rainbow' import { useCallback, useMemo, useRef, useState } from 'react' import LongPressable from 'react-longpressable' import Overlay from 'react-bootstrap/Overlay' import Popover from 'react-bootstrap/Popover' import { useShowModal } from './modal' -import { numWithUnits } from '../lib/format' +import { numWithUnits } from '@/lib/format' import { Dropdown } from 'react-bootstrap' const UpvotePopover = ({ target, show, handleClose }) => { diff --git a/components/usage-header.js b/components/usage-header.js index b0abad63..925ded9c 100644 --- a/components/usage-header.js +++ b/components/usage-header.js @@ -1,7 +1,7 @@ import { useRouter } from 'next/router' import { Select, DatePicker } from './form' -import { WHENS } from '../lib/constants' -import { whenToFrom } from '../lib/time' +import { WHENS } from '@/lib/constants' +import { whenToFrom } from '@/lib/time' export function UsageHeader () { const router = useRouter() diff --git a/components/use-crossposter.js b/components/use-crossposter.js index 80ad3dd6..56f23a1f 100644 --- a/components/use-crossposter.js +++ b/components/use-crossposter.js @@ -1,10 +1,10 @@ import { useCallback } from 'react' import { useToast } from './toast' import { Button } from 'react-bootstrap' -import { DEFAULT_CROSSPOSTING_RELAYS, crosspost, callWithTimeout } from '../lib/nostr' +import { DEFAULT_CROSSPOSTING_RELAYS, crosspost, callWithTimeout } from '@/lib/nostr' import { gql, useMutation, useQuery, useLazyQuery } from '@apollo/client' -import { SETTINGS } from '../fragments/users' -import { ITEM_FULL_FIELDS, POLL_FIELDS } from '../fragments/items' +import { SETTINGS } from '@/fragments/users' +import { ITEM_FULL_FIELDS, POLL_FIELDS } from '@/fragments/items' async function discussionToEvent (item) { const createdAt = Math.floor(Date.now() / 1000) diff --git a/components/use-quote-reply.js b/components/use-quote-reply.js index 0f085375..3ca57e58 100644 --- a/components/use-quote-reply.js +++ b/components/use-quote-reply.js @@ -1,5 +1,5 @@ import { useCallback, useEffect, useRef, useState } from 'react' -import { quote as quoteMd } from '../lib/md' +import { quote as quoteMd } from '@/lib/md' export function useQuoteReply ({ text }) { const ref = useRef(null) diff --git a/components/user-header.js b/components/user-header.js index 3a916cfe..5784eccd 100644 --- a/components/user-header.js +++ b/components/user-header.js @@ -9,26 +9,26 @@ import { Form, Input, SubmitButton } from './form' import { gql, useApolloClient, useMutation } from '@apollo/client' import styles from './user-header.module.css' import { useMe } from './me' -import { NAME_MUTATION } from '../fragments/users' +import { NAME_MUTATION } from '@/fragments/users' import QRCode from 'qrcode.react' -import LightningIcon from '../svgs/bolt.svg' -import { encodeLNUrl } from '../lib/lnurl' +import LightningIcon from '@/svgs/bolt.svg' +import { encodeLNUrl } from '@/lib/lnurl' import Avatar from './avatar' -import { userSchema } from '../lib/validate' +import { userSchema } from '@/lib/validate' import { useShowModal } from './modal' -import { numWithUnits } from '../lib/format' +import { numWithUnits } from '@/lib/format' import Hat from './hat' import SubscribeUserDropdownItem from './subscribeUser' import ActionDropdown from './action-dropdown' -import CodeIcon from '../svgs/terminal-box-fill.svg' +import CodeIcon from '@/svgs/terminal-box-fill.svg' import MuteDropdownItem from './mute' import copy from 'clipboard-copy' import { useToast } from './toast' -import { hexToBech32 } from '../lib/nostr' -import NostrIcon from '../svgs/nostr.svg' -import GithubIcon from '../svgs/github-fill.svg' -import TwitterIcon from '../svgs/twitter-fill.svg' -import { UNKNOWN_LINK_REL, MEDIA_URL } from '../lib/constants' +import { hexToBech32 } from '@/lib/nostr' +import NostrIcon from '@/svgs/nostr.svg' +import GithubIcon from '@/svgs/github-fill.svg' +import TwitterIcon from '@/svgs/twitter-fill.svg' +import { UNKNOWN_LINK_REL, MEDIA_URL } from '@/lib/constants' export default function UserHeader ({ user }) { const router = useRouter() diff --git a/components/user-list.js b/components/user-list.js index bc6846ea..5a761a4c 100644 --- a/components/user-list.js +++ b/components/user-list.js @@ -1,6 +1,6 @@ import Link from 'next/link' import Image from 'react-bootstrap/Image' -import { abbrNum, numWithUnits } from '../lib/format' +import { abbrNum, numWithUnits } from '@/lib/format' import styles from './item.module.css' import userStyles from './user-header.module.css' import React, { useEffect, useMemo, useState } from 'react' @@ -9,7 +9,7 @@ import MoreFooter from './more-footer' import { useData } from './use-data' import Hat from './hat' import { useMe } from './me' -import { MEDIA_URL } from '../lib/constants' +import { MEDIA_URL } from '@/lib/constants' // all of this nonsense is to show the stat we are sorting by first const Stacked = ({ user }) => (user.optional.stacked !== null && {abbrNum(user.optional.stacked)} stacked) diff --git a/components/wallet-card.js b/components/wallet-card.js index dcfa0385..6071b1ad 100644 --- a/components/wallet-card.js +++ b/components/wallet-card.js @@ -1,7 +1,7 @@ import { Badge, Button, Card } from 'react-bootstrap' -import styles from '../styles/wallet.module.css' -import Plug from '../svgs/plug.svg' -import Gear from '../svgs/settings-5-fill.svg' +import styles from '@/styles/wallet.module.css' +import Plug from '@/svgs/plug.svg' +import Gear from '@/svgs/settings-5-fill.svg' import Link from 'next/link' import CancelButton from './cancel-button' import { SubmitButton } from './form' diff --git a/components/webln/index.js b/components/webln/index.js index 2e16aff8..a3ccd63c 100644 --- a/components/webln/index.js +++ b/components/webln/index.js @@ -1,7 +1,7 @@ import { createContext, useCallback, useContext, useEffect, useState } from 'react' import { LNbitsProvider, useLNbits } from './lnbits' import { NWCProvider, useNWC } from './nwc' -import { useToast, withToastFlow } from '../toast' +import { useToast, withToastFlow } from '@/components/toast' import { gql, useMutation } from '@apollo/client' const WebLNContext = createContext({}) diff --git a/components/webln/nwc.js b/components/webln/nwc.js index fef7c798..bca9be50 100644 --- a/components/webln/nwc.js +++ b/components/webln/nwc.js @@ -2,7 +2,7 @@ import { createContext, useCallback, useContext, useEffect, useRef, useState } from 'react' import { Relay, finalizeEvent, nip04 } from 'nostr-tools' -import { parseNwcUrl } from '../../lib/url' +import { parseNwcUrl } from '@/lib/url' const NWCContext = createContext() diff --git a/jsconfig.json b/jsconfig.json new file mode 100644 index 00000000..bb96307c --- /dev/null +++ b/jsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "baseUrl": ".", + "paths": { + "@/api/*": [ + "api/*" + ], + "@/lib/*": [ + "lib/*" + ], + "@/fragments/*": [ + "fragments/*" + ], + "@/pages/*": [ + "pages/*" + ], + "@/components/*": [ + "components/*" + ], + "@/styles/*": [ + "styles/*" + ], + "@/svgs/*": [ + "svgs/*" + ], + } + } +} \ No newline at end of file diff --git a/lib/push-notifications.js b/lib/push-notifications.js new file mode 100644 index 00000000..cec723a7 --- /dev/null +++ b/lib/push-notifications.js @@ -0,0 +1,143 @@ +import { sendUserNotification } from '@/api/webPush' +import { ANON_USER_ID } from '@/lib/constants' +import { msatsToSats, numWithUnits } from '@/lib/format' + +export const notifyUserSubscribers = async ({ models, item }) => { + try { + const isPost = !!item.title + const userSubs = await models.userSubscription.findMany({ + where: { + followeeId: Number(item.userId), + [isPost ? 'postsSubscribedAt' : 'commentsSubscribedAt']: { not: null } + }, + include: { + followee: true + } + }) + const subType = isPost ? 'POST' : 'COMMENT' + const tag = `FOLLOW-${item.userId}-${subType}` + await Promise.allSettled(userSubs.map(({ followerId, followee }) => sendUserNotification(followerId, { + title: `@${followee.name} ${isPost ? 'created a post' : 'replied to a post'}`, + body: isPost ? item.title : item.text, + item, + data: { followeeName: followee.name, subType }, + tag + }))) + } catch (err) { + console.error(err) + } +} + +export const notifyTerritorySubscribers = async ({ models, item }) => { + try { + const isPost = !!item.title + const { subName } = item + + // only notify on posts in subs + if (!isPost || !subName) return + + const territorySubs = await models.subSubscription.findMany({ + where: { + subName + } + }) + + const author = await models.user.findUnique({ where: { id: item.userId } }) + + const tag = `TERRITORY_POST-${subName}` + await Promise.allSettled( + territorySubs + // don't send push notification to author itself + .filter(({ userId }) => userId !== author.id) + .map(({ userId }) => + sendUserNotification(userId, { + title: `@${author.name} created a post in ~${subName}`, + body: item.title, + item, + data: { subName }, + tag + }))) + } catch (err) { + console.error(err) + } +} + +export const notifyItemParents = async ({ models, item, me }) => { + try { + const user = await models.user.findUnique({ where: { id: me?.id || ANON_USER_ID } }) + const parents = await models.$queryRawUnsafe( + 'SELECT DISTINCT p."userId" FROM "Item" i JOIN "Item" p ON p.path @> i.path WHERE i.id = $1 and p."userId" <> $2 ' + + 'AND NOT EXISTS (SELECT 1 FROM "Mute" m WHERE m."muterId" = p."userId" AND m."mutedId" = $2)', + Number(item.parentId), Number(user.id)) + Promise.allSettled( + parents.map(({ userId }) => sendUserNotification(userId, { + title: `@${user.name} replied to you`, + body: item.text, + item, + tag: 'REPLY' + })) + ) + } catch (err) { + console.error(err) + } +} + +export const notifyZapped = async ({ models, id }) => { + try { + const updatedItem = await models.item.findUnique({ where: { id: Number(id) } }) + const forwards = await models.itemForward.findMany({ where: { itemId: Number(id) } }) + const userPromises = forwards.map(fwd => models.user.findUnique({ where: { id: fwd.userId } })) + const userResults = await Promise.allSettled(userPromises) + const mappedForwards = forwards.map((fwd, index) => ({ ...fwd, user: userResults[index].value ?? null })) + let forwardedSats = 0 + let forwardedUsers = '' + if (mappedForwards.length) { + forwardedSats = Math.floor(msatsToSats(updatedItem.msats) * mappedForwards.map(fwd => fwd.pct).reduce((sum, cur) => sum + cur) / 100) + forwardedUsers = mappedForwards.map(fwd => `@${fwd.user.name}`).join(', ') + } + let notificationTitle + if (updatedItem.title) { + if (forwards.length > 0) { + notificationTitle = `your post forwarded ${numWithUnits(forwardedSats)} to ${forwardedUsers}` + } else { + notificationTitle = `your post stacked ${numWithUnits(msatsToSats(updatedItem.msats))}` + } + } else { + if (forwards.length > 0) { + // I don't think this case is possible + notificationTitle = `your reply forwarded ${numWithUnits(forwardedSats)} to ${forwardedUsers}` + } else { + notificationTitle = `your reply stacked ${numWithUnits(msatsToSats(updatedItem.msats))}` + } + } + await sendUserNotification(updatedItem.userId, { + title: notificationTitle, + body: updatedItem.title ? updatedItem.title : updatedItem.text, + item: updatedItem, + tag: `TIP-${updatedItem.id}` + }) + + // send push notifications to forwarded recipients + if (mappedForwards.length) { + await Promise.allSettled(mappedForwards.map(forward => sendUserNotification(forward.user.id, { + title: `you were forwarded ${numWithUnits(msatsToSats(updatedItem.msats) * forward.pct / 100)}`, + body: updatedItem.title ?? updatedItem.text, + item: updatedItem, + tag: `FORWARDEDTIP-${updatedItem.id}` + }))) + } + } catch (err) { + console.error(err) + } +} + +export const notifyTerritoryTransfer = async ({ models, sub, to }) => { + try { + await sendUserNotification(to.id, { + title: `~${sub.name} was transferred to you`, + tag: `TERRITORY_TRANSFER-${sub.name}` + }) + } catch (err) { + console.error(err) + } +} diff --git a/lib/rss.js b/lib/rss.js index 69966cdc..747d1eaf 100644 --- a/lib/rss.js +++ b/lib/rss.js @@ -1,4 +1,4 @@ -import getSSRApolloClient from '../api/ssrApollo' +import getSSRApolloClient from '@/api/ssrApollo' const SITE_URL = 'https://stacker.news' const SITE_TITLE = 'stacker news' diff --git a/lib/validate.js b/lib/validate.js index fe439d05..f6fddfbf 100644 --- a/lib/validate.js +++ b/lib/validate.js @@ -7,8 +7,8 @@ import { import { SUPPORTED_CURRENCIES } from './currency' import { NOSTR_MAX_RELAY_NUM, NOSTR_PUBKEY_BECH32, NOSTR_PUBKEY_HEX } from './nostr' import { msatsToSats, numWithUnits, abbrNum, ensureB64 } from './format' -import * as usersFragments from '../fragments/users' -import * as subsFragments from '../fragments/subs' +import * as usersFragments from '@/fragments/users' +import * as subsFragments from '@/fragments/subs' import { isInvoicableMacaroon, isInvoiceMacaroon } from './macaroon' import { parseNwcUrl } from './url' import { datePivot } from './time' diff --git a/lib/webPush.js b/lib/webPush.js index edf0da38..4a460681 100644 --- a/lib/webPush.js +++ b/lib/webPush.js @@ -2,7 +2,7 @@ import webPush from 'web-push' import removeMd from 'remove-markdown' import { ANON_USER_ID, COMMENT_DEPTH_LIMIT, FOUND_BLURBS, LOST_BLURBS } from './constants' import { msatsToSats, numWithUnits } from './format' -import models from '../api/models' +import models from '@/api/models' const webPushEnabled = process.env.NODE_ENV === 'production' || (process.env.VAPID_MAILTO && process.env.NEXT_PUBLIC_VAPID_PUBKEY && process.env.VAPID_PRIVKEY) @@ -250,7 +250,7 @@ export const notifyMention = async (userId, item) => { body: item.text, item, tag: 'MENTION' - }).catch(console.error) + }) } catch (err) { console.error(err) } @@ -258,7 +258,15 @@ export const notifyMention = async (userId, item) => { export const notifyReferral = async (userId) => { try { - await sendUserNotification(userId, { title: 'someone joined via one of your referral links', tag: 'REFERRAL' }).catch(console.error) + await sendUserNotification(userId, { title: 'someone joined via one of your referral links', tag: 'REFERRAL' }) + } catch (err) { + console.error(err) + } +} + +export const notifyInvite = async (userId) => { + try { + await sendUserNotification(userId, { title: 'your invite has been redeemed', tag: 'INVITE' }) } catch (err) { console.error(err) } @@ -315,7 +323,7 @@ export async function notifyNewStreak (userId, streak) { title: 'you found a cowboy hat', body: blurb, tag: 'STREAK-FOUND' - }).catch(console.error) + }) } catch (err) { console.error(err) } diff --git a/next.config.js b/next.config.js index 68aab201..a10c2a5c 100644 --- a/next.config.js +++ b/next.config.js @@ -189,7 +189,7 @@ module.exports = withPlausibleProxy()({ } ] }, - webpack: (config, { isServer, dev }) => { + webpack: (config, { isServer, dev, defaultLoaders }) => { if (isServer) { generatePrecacheManifest() const workboxPlugin = new InjectManifest({ @@ -229,6 +229,32 @@ module.exports = withPlausibleProxy()({ config.plugins.push(workboxPlugin) } + + config.module.rules.push( + { + test: /\.svg$/, + use: [ + defaultLoaders.babel, + { + loader: '@svgr/webpack', + options: { + babel: false, + svgoConfig: { + plugins: [{ + name: 'preset-default', + params: { + overrides: { + removeViewBox: false + } + } + }] + } + } + } + ] + } + ) + return config } }) diff --git a/package-lock.json b/package-lock.json index 4af4d3de..9416f858 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,12 +17,12 @@ "@opensearch-project/opensearch": "^2.4.0", "@prisma/client": "^5.4.2", "@slack/web-api": "^6.9.0", + "@svgr/webpack": "^8.1.0", "@yudiel/react-qr-scanner": "^1.1.10", "acorn": "^8.10.0", "ajv": "^8.12.0", "async-retry": "^1.3.1", "aws-sdk": "^2.1473.0", - "babel-plugin-inline-react-svg": "^2.0.2", "bech32": "^2.0.0", "bolt11": "^1.4.1", "bootstrap": "^5.3.2", @@ -657,19 +657,19 @@ "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" }, "node_modules/@babel/helper-create-class-features-plugin": { - "version": "7.22.6", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.22.6.tgz", - "integrity": "sha512-iwdzgtSiBxF6ni6mzVnZCF3xt5qE6cEA0J7nFt8QOAWZ0zjCFceEgpn3vtb2V7WFR6QzP2jmIFOHMTRo7eNJjQ==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.24.1.tgz", + "integrity": "sha512-1yJa9dX9g//V6fDebXoEfEsxkZHk3Hcbm+zLhyu6qVgYFLvmTALTeV+jNU9e5RnYtioBrGEOdoI2joMSNQ/+aA==", "dependencies": { "@babel/helper-annotate-as-pure": "^7.22.5", - "@babel/helper-environment-visitor": "^7.22.5", - "@babel/helper-function-name": "^7.22.5", - "@babel/helper-member-expression-to-functions": "^7.22.5", + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-function-name": "^7.23.0", + "@babel/helper-member-expression-to-functions": "^7.23.0", "@babel/helper-optimise-call-expression": "^7.22.5", - "@babel/helper-replace-supers": "^7.22.5", + "@babel/helper-replace-supers": "^7.24.1", "@babel/helper-skip-transparent-expression-wrappers": "^7.22.5", "@babel/helper-split-export-declaration": "^7.22.6", - "@nicolo-ribaudo/semver-v6": "^6.3.3" + "semver": "^6.3.1" }, "engines": { "node": ">=6.9.0" @@ -742,37 +742,37 @@ } }, "node_modules/@babel/helper-member-expression-to-functions": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.22.5.tgz", - "integrity": "sha512-aBiH1NKMG0H2cGZqspNvsaBe6wNGjbJjuLy29aU+eDZjSbbN53BaxlpB02xm9v34pLTZ1nIQPFYn2qMZoa5BQQ==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.23.0.tgz", + "integrity": "sha512-6gfrPwh7OuT6gZyJZvd6WbTfrqAo7vm4xCzAXOusKqq/vWdKXphTpj5klHKNmRUU6/QRGlBsyU9mAIPaWHlqJA==", "dependencies": { - "@babel/types": "^7.22.5" + "@babel/types": "^7.23.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-imports": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.22.5.tgz", - "integrity": "sha512-8Dl6+HD/cKifutF5qGd/8ZJi84QeAKh+CEe1sBzz8UayBBGg1dAIJrdHOcOM5b2MpzWL2yuotJTtGjETq0qjXg==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.24.1.tgz", + "integrity": "sha512-HfEWzysMyOa7xI5uQHc/OcZf67/jc+xe/RZlznWQHhbb8Pg1SkRdbK4yEi61aY8wxQA7PkSfoojtLQP/Kpe3og==", "dependencies": { - "@babel/types": "^7.22.5" + "@babel/types": "^7.24.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-transforms": { - "version": "7.22.9", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.22.9.tgz", - "integrity": "sha512-t+WA2Xn5K+rTeGtC8jCsdAH52bjggG5TKRuRrAGNM/mjIbO4GxvlLMFOEz9wXY5I2XQ60PMFsAG2WIcG82dQMQ==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.23.3.tgz", + "integrity": "sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ==", "dependencies": { - "@babel/helper-environment-visitor": "^7.22.5", - "@babel/helper-module-imports": "^7.22.5", + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-module-imports": "^7.22.15", "@babel/helper-simple-access": "^7.22.5", "@babel/helper-split-export-declaration": "^7.22.6", - "@babel/helper-validator-identifier": "^7.22.5" + "@babel/helper-validator-identifier": "^7.22.20" }, "engines": { "node": ">=6.9.0" @@ -793,9 +793,9 @@ } }, "node_modules/@babel/helper-plugin-utils": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz", - "integrity": "sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg==", + "version": "7.24.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.24.0.tgz", + "integrity": "sha512-9cUznXMG0+FxRuJfvL82QlTqIzhVW9sL0KjMPHhAOOvpQGL8QtdxnBKILjBqxlHyliz0yCa1G903ZXI/FuHy2w==", "engines": { "node": ">=6.9.0" } @@ -818,19 +818,19 @@ } }, "node_modules/@babel/helper-replace-supers": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.22.5.tgz", - "integrity": "sha512-aLdNM5I3kdI/V9xGNyKSF3X/gTyMUBohTZ+/3QdQKAA9vxIiy12E+8E2HoOP1/DjeqU+g6as35QHJNMDDYpuCg==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.24.1.tgz", + "integrity": "sha512-QCR1UqC9BzG5vZl8BMicmZ28RuUBnHhAMddD8yHFHDRH9lLTZ9uUPehX8ctVPT8l0TKblJidqcgUUKGVrePleQ==", "dependencies": { - "@babel/helper-environment-visitor": "^7.22.5", - "@babel/helper-member-expression-to-functions": "^7.22.5", - "@babel/helper-optimise-call-expression": "^7.22.5", - "@babel/template": "^7.22.5", - "@babel/traverse": "^7.22.5", - "@babel/types": "^7.22.5" + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-member-expression-to-functions": "^7.23.0", + "@babel/helper-optimise-call-expression": "^7.22.5" }, "engines": { "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" } }, "node_modules/@babel/helper-simple-access": { @@ -883,9 +883,9 @@ } }, "node_modules/@babel/helper-validator-option": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.22.5.tgz", - "integrity": "sha512-R3oB6xlIVKUnxNUxbmgq7pKjxpru24zlimpE8WK47fACIlM0II/Hm1RS8IaOI7NgCr6LNS+jl5l75m20npAziw==", + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.23.5.tgz", + "integrity": "sha512-85ttAOMLsr53VgXkTbkx8oA6YTfT4q7/HzXSLEYmjcSTJPMPQtvq1BD79Byep5xMUYbGRzEpDsjUf3dyp54IKw==", "engines": { "node": ">=6.9.0" } @@ -1118,12 +1118,11 @@ } }, "node_modules/@babel/plugin-syntax-jsx": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.23.3.tgz", - "integrity": "sha512-EB2MELswq55OHUoRZLGg/zC7QWUKfNLpE57m/S2yr1uEneIgsTgrSzXP3NXEsMkVn76OlaVVnzN+ugObuYGwhg==", - "dev": true, + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.24.1.tgz", + "integrity": "sha512-2eCtxZXf+kbkMIsXS4poTvT4Yu5rXiRa+9xGVT56raghjmBTKMpFNc9R4IDiB4emao9eO22Ox7CxuJG7BgExqA==", "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" + "@babel/helper-plugin-utils": "^7.24.0" }, "engines": { "node": ">=6.9.0" @@ -1227,12 +1226,11 @@ } }, "node_modules/@babel/plugin-syntax-typescript": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.23.3.tgz", - "integrity": "sha512-9EiNjVJOMwCO+43TqoTrgQ8jMwcAd0sWyXi9RPfIsLTj4R2MADDDQXELhffaUx/uJv2AYcxBgPwH6j4TIA4ytQ==", - "dev": true, + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.24.1.tgz", + "integrity": "sha512-Yhnmvy5HZEnHUty6i++gcfH1/l68AHnItFHnaCv6hn9dNh0hQvvQJsxpi4BMBFN5DLeHBuucT/0DgzXif/OyRw==", "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" + "@babel/helper-plugin-utils": "^7.24.0" }, "engines": { "node": ">=6.9.0" @@ -1591,12 +1589,12 @@ } }, "node_modules/@babel/plugin-transform-modules-commonjs": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.22.5.tgz", - "integrity": "sha512-B4pzOXj+ONRmuaQTg05b3y/4DuFz3WcCNAXPLb2Q0GT0TrGKGxNKV4jwsXts+StaM0LQczZbOpj8o1DLPDJIiA==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.24.1.tgz", + "integrity": "sha512-szog8fFTUxBfw0b98gEWPaEqF42ZUD/T3bkynW/wtgx2p/XCP55WEsb+VosKceRSd6njipdZvNogqdtI4Q0chw==", "dependencies": { - "@babel/helper-module-transforms": "^7.22.5", - "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-module-transforms": "^7.23.3", + "@babel/helper-plugin-utils": "^7.24.0", "@babel/helper-simple-access": "^7.22.5" }, "engines": { @@ -1821,6 +1819,81 @@ "@babel/core": "^7.0.0-0" } }, + "node_modules/@babel/plugin-transform-react-constant-elements": { + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-constant-elements/-/plugin-transform-react-constant-elements-7.24.1.tgz", + "integrity": "sha512-QXp1U9x0R7tkiGB0FOk8o74jhnap0FlZ5gNkRIWdG3eP+SvMFg118e1zaWewDzgABb106QSKpVsD3Wgd8t6ifA==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-react-display-name": { + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-display-name/-/plugin-transform-react-display-name-7.24.1.tgz", + "integrity": "sha512-mvoQg2f9p2qlpDQRBC7M3c3XTr0k7cp/0+kFKKO/7Gtu0LSw16eKB+Fabe2bDT/UpsyasTBBkAnbdsLrkD5XMw==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx": { + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.23.4.tgz", + "integrity": "sha512-5xOpoPguCZCRbo/JeHlloSkTA8Bld1J/E1/kLfD1nsuiW1m8tduTA1ERCgIZokDflX/IBzKcqR3l7VlRgiIfHA==", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.22.5", + "@babel/helper-module-imports": "^7.22.15", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-jsx": "^7.23.3", + "@babel/types": "^7.23.4" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx-development": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-development/-/plugin-transform-react-jsx-development-7.22.5.tgz", + "integrity": "sha512-bDhuzwWMuInwCYeDeMzyi7TaBgRQei6DqxhbyniL7/VG4RSS7HtSL2QbY4eESy1KJqlWt8g3xeEBGPuo+XqC8A==", + "dependencies": { + "@babel/plugin-transform-react-jsx": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-react-pure-annotations": { + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-pure-annotations/-/plugin-transform-react-pure-annotations-7.24.1.tgz", + "integrity": "sha512-+pWEAaDJvSm9aFvJNpLiM2+ktl2Sn2U5DdyiWdZBxmLc6+xGt88dvFqsHiAiDS+8WqUwbDfkKz9jRxK3M0k+kA==", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.22.5", + "@babel/helper-plugin-utils": "^7.24.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, "node_modules/@babel/plugin-transform-regenerator": { "version": "7.22.5", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.22.5.tgz", @@ -1940,6 +2013,23 @@ "@babel/core": "^7.0.0-0" } }, + "node_modules/@babel/plugin-transform-typescript": { + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.24.1.tgz", + "integrity": "sha512-liYSESjX2fZ7JyBFkYG78nfvHlMKE6IpNdTVnxmlYUR+j5ZLsitFbaAE+eJSK2zPPkNWNw4mXL51rQ8WrvdK0w==", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.22.5", + "@babel/helper-create-class-features-plugin": "^7.24.1", + "@babel/helper-plugin-utils": "^7.24.0", + "@babel/plugin-syntax-typescript": "^7.24.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, "node_modules/@babel/plugin-transform-unicode-escapes": { "version": "7.22.5", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.22.5.tgz", @@ -2158,6 +2248,43 @@ "@babel/core": "^7.0.0-0" } }, + "node_modules/@babel/preset-react": { + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/preset-react/-/preset-react-7.24.1.tgz", + "integrity": "sha512-eFa8up2/8cZXLIpkafhaADTXSnl7IsUFCYenRWrARBz0/qZwcT0RBXpys0LJU4+WfPoF2ZG6ew6s2V6izMCwRA==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.0", + "@babel/helper-validator-option": "^7.23.5", + "@babel/plugin-transform-react-display-name": "^7.24.1", + "@babel/plugin-transform-react-jsx": "^7.23.4", + "@babel/plugin-transform-react-jsx-development": "^7.22.5", + "@babel/plugin-transform-react-pure-annotations": "^7.24.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/preset-typescript": { + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.24.1.tgz", + "integrity": "sha512-1DBaMmRDpuYQBPWD8Pf/WEwCrtgRHxsZnP4mIy9G/X+hFfbI47Q2G4t1Paakld84+qsk2fSsUPMKg71jkoOOaQ==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.0", + "@babel/helper-validator-option": "^7.23.5", + "@babel/plugin-syntax-jsx": "^7.24.1", + "@babel/plugin-transform-modules-commonjs": "^7.24.1", + "@babel/plugin-transform-typescript": "^7.24.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, "node_modules/@babel/regjsgen": { "version": "0.8.0", "resolved": "https://registry.npmjs.org/@babel/regjsgen/-/regjsgen-0.8.0.tgz", @@ -2208,9 +2335,9 @@ } }, "node_modules/@babel/types": { - "version": "7.23.9", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.9.tgz", - "integrity": "sha512-dQjSq/7HaSjRM43FFGnv5keM2HsxpmyV1PfaSVm0nzzjwwTmjOe6J4bC8e3+pTEIgHaHj+1ZlLThRJ2auc/w1Q==", + "version": "7.24.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.0.tgz", + "integrity": "sha512-+j7a5c253RfKh8iABBhywc8NSfP5LURe7Uh4qpsh6jc+aLJguvmIUBdjSdEMQv2bENrCR5MfRdjGo7vzS/ob7w==", "dependencies": { "@babel/helper-string-parser": "^7.23.4", "@babel/helper-validator-identifier": "^7.22.20", @@ -3989,6 +4116,416 @@ "node": ">=6" } }, + "node_modules/@svgr/babel-plugin-add-jsx-attribute": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-add-jsx-attribute/-/babel-plugin-add-jsx-attribute-8.0.0.tgz", + "integrity": "sha512-b9MIk7yhdS1pMCZM8VeNfUlSKVRhsHZNMl5O9SfaX0l0t5wjdgu4IDzGB8bpnGBBOjGST3rRFVsaaEtI4W6f7g==", + "engines": { + "node": ">=14" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/gregberge" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@svgr/babel-plugin-remove-jsx-attribute": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-remove-jsx-attribute/-/babel-plugin-remove-jsx-attribute-8.0.0.tgz", + "integrity": "sha512-BcCkm/STipKvbCl6b7QFrMh/vx00vIP63k2eM66MfHJzPr6O2U0jYEViXkHJWqXqQYjdeA9cuCl5KWmlwjDvbA==", + "engines": { + "node": ">=14" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/gregberge" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@svgr/babel-plugin-remove-jsx-empty-expression": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-remove-jsx-empty-expression/-/babel-plugin-remove-jsx-empty-expression-8.0.0.tgz", + "integrity": "sha512-5BcGCBfBxB5+XSDSWnhTThfI9jcO5f0Ai2V24gZpG+wXF14BzwxxdDb4g6trdOux0rhibGs385BeFMSmxtS3uA==", + "engines": { + "node": ">=14" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/gregberge" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@svgr/babel-plugin-replace-jsx-attribute-value": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-replace-jsx-attribute-value/-/babel-plugin-replace-jsx-attribute-value-8.0.0.tgz", + "integrity": "sha512-KVQ+PtIjb1BuYT3ht8M5KbzWBhdAjjUPdlMtpuw/VjT8coTrItWX6Qafl9+ji831JaJcu6PJNKCV0bp01lBNzQ==", + "engines": { + "node": ">=14" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/gregberge" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@svgr/babel-plugin-svg-dynamic-title": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-svg-dynamic-title/-/babel-plugin-svg-dynamic-title-8.0.0.tgz", + "integrity": "sha512-omNiKqwjNmOQJ2v6ge4SErBbkooV2aAWwaPFs2vUY7p7GhVkzRkJ00kILXQvRhA6miHnNpXv7MRnnSjdRjK8og==", + "engines": { + "node": ">=14" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/gregberge" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@svgr/babel-plugin-svg-em-dimensions": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-svg-em-dimensions/-/babel-plugin-svg-em-dimensions-8.0.0.tgz", + "integrity": "sha512-mURHYnu6Iw3UBTbhGwE/vsngtCIbHE43xCRK7kCw4t01xyGqb2Pd+WXekRRoFOBIY29ZoOhUCTEweDMdrjfi9g==", + "engines": { + "node": ">=14" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/gregberge" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@svgr/babel-plugin-transform-react-native-svg": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-transform-react-native-svg/-/babel-plugin-transform-react-native-svg-8.1.0.tgz", + "integrity": "sha512-Tx8T58CHo+7nwJ+EhUwx3LfdNSG9R2OKfaIXXs5soiy5HtgoAEkDay9LIimLOcG8dJQH1wPZp/cnAv6S9CrR1Q==", + "engines": { + "node": ">=14" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/gregberge" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@svgr/babel-plugin-transform-svg-component": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-transform-svg-component/-/babel-plugin-transform-svg-component-8.0.0.tgz", + "integrity": "sha512-DFx8xa3cZXTdb/k3kfPeaixecQLgKh5NVBMwD0AQxOzcZawK4oo1Jh9LbrcACUivsCA7TLG8eeWgrDXjTMhRmw==", + "engines": { + "node": ">=12" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/gregberge" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@svgr/babel-preset": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@svgr/babel-preset/-/babel-preset-8.1.0.tgz", + "integrity": "sha512-7EYDbHE7MxHpv4sxvnVPngw5fuR6pw79SkcrILHJ/iMpuKySNCl5W1qcwPEpU+LgyRXOaAFgH0KhwD18wwg6ug==", + "dependencies": { + "@svgr/babel-plugin-add-jsx-attribute": "8.0.0", + "@svgr/babel-plugin-remove-jsx-attribute": "8.0.0", + "@svgr/babel-plugin-remove-jsx-empty-expression": "8.0.0", + "@svgr/babel-plugin-replace-jsx-attribute-value": "8.0.0", + "@svgr/babel-plugin-svg-dynamic-title": "8.0.0", + "@svgr/babel-plugin-svg-em-dimensions": "8.0.0", + "@svgr/babel-plugin-transform-react-native-svg": "8.1.0", + "@svgr/babel-plugin-transform-svg-component": "8.0.0" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/gregberge" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@svgr/core": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@svgr/core/-/core-8.1.0.tgz", + "integrity": "sha512-8QqtOQT5ACVlmsvKOJNEaWmRPmcojMOzCz4Hs2BGG/toAp/K38LcsMRyLp349glq5AzJbCEeimEoxaX6v/fLrA==", + "dependencies": { + "@babel/core": "^7.21.3", + "@svgr/babel-preset": "8.1.0", + "camelcase": "^6.2.0", + "cosmiconfig": "^8.1.3", + "snake-case": "^3.0.4" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/gregberge" + } + }, + "node_modules/@svgr/core/node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@svgr/hast-util-to-babel-ast": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@svgr/hast-util-to-babel-ast/-/hast-util-to-babel-ast-8.0.0.tgz", + "integrity": "sha512-EbDKwO9GpfWP4jN9sGdYwPBU0kdomaPIL2Eu4YwmgP+sJeXT+L7bMwJUBnhzfH8Q2qMBqZ4fJwpCyYsAN3mt2Q==", + "dependencies": { + "@babel/types": "^7.21.3", + "entities": "^4.4.0" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/gregberge" + } + }, + "node_modules/@svgr/hast-util-to-babel-ast/node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/@svgr/plugin-jsx": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@svgr/plugin-jsx/-/plugin-jsx-8.1.0.tgz", + "integrity": "sha512-0xiIyBsLlr8quN+WyuxooNW9RJ0Dpr8uOnH/xrCVO8GLUcwHISwj1AG0k+LFzteTkAA0GbX0kj9q6Dk70PTiPA==", + "dependencies": { + "@babel/core": "^7.21.3", + "@svgr/babel-preset": "8.1.0", + "@svgr/hast-util-to-babel-ast": "8.0.0", + "svg-parser": "^2.0.4" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/gregberge" + }, + "peerDependencies": { + "@svgr/core": "*" + } + }, + "node_modules/@svgr/plugin-svgo": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@svgr/plugin-svgo/-/plugin-svgo-8.1.0.tgz", + "integrity": "sha512-Ywtl837OGO9pTLIN/onoWLmDQ4zFUycI1g76vuKGEz6evR/ZTJlJuz3G/fIkb6OVBJ2g0o6CGJzaEjfmEo3AHA==", + "dependencies": { + "cosmiconfig": "^8.1.3", + "deepmerge": "^4.3.1", + "svgo": "^3.0.2" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/gregberge" + }, + "peerDependencies": { + "@svgr/core": "*" + } + }, + "node_modules/@svgr/plugin-svgo/node_modules/css-select": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz", + "integrity": "sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==", + "dependencies": { + "boolbase": "^1.0.0", + "css-what": "^6.1.0", + "domhandler": "^5.0.2", + "domutils": "^3.0.1", + "nth-check": "^2.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/@svgr/plugin-svgo/node_modules/css-tree": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.3.1.tgz", + "integrity": "sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==", + "dependencies": { + "mdn-data": "2.0.30", + "source-map-js": "^1.0.1" + }, + "engines": { + "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0" + } + }, + "node_modules/@svgr/plugin-svgo/node_modules/csso": { + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/csso/-/csso-5.0.5.tgz", + "integrity": "sha512-0LrrStPOdJj+SPCCrGhzryycLjwcgUSHBtxNA8aIDxf0GLsRh1cKYhB00Gd1lDOS4yGH69+SNn13+TWbVHETFQ==", + "dependencies": { + "css-tree": "~2.2.0" + }, + "engines": { + "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/@svgr/plugin-svgo/node_modules/csso/node_modules/css-tree": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.2.1.tgz", + "integrity": "sha512-OA0mILzGc1kCOCSJerOeqDxDQ4HOh+G8NbOJFOTgOCzpw7fCBubk0fEyxp8AgOL/jvLgYA/uV0cMbe43ElF1JA==", + "dependencies": { + "mdn-data": "2.0.28", + "source-map-js": "^1.0.1" + }, + "engines": { + "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/@svgr/plugin-svgo/node_modules/csso/node_modules/mdn-data": { + "version": "2.0.28", + "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.28.tgz", + "integrity": "sha512-aylIc7Z9y4yzHYAJNuESG3hfhC+0Ibp/MAMiaOZgNv4pmEdFyfZhhhny4MNiAfWdBQ1RQ2mfDWmM1x8SvGyp8g==" + }, + "node_modules/@svgr/plugin-svgo/node_modules/deepmerge": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", + "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@svgr/plugin-svgo/node_modules/dom-serializer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", + "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", + "dependencies": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.2", + "entities": "^4.2.0" + }, + "funding": { + "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" + } + }, + "node_modules/@svgr/plugin-svgo/node_modules/domhandler": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", + "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", + "dependencies": { + "domelementtype": "^2.3.0" + }, + "engines": { + "node": ">= 4" + }, + "funding": { + "url": "https://github.com/fb55/domhandler?sponsor=1" + } + }, + "node_modules/@svgr/plugin-svgo/node_modules/domutils": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.1.0.tgz", + "integrity": "sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==", + "dependencies": { + "dom-serializer": "^2.0.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3" + }, + "funding": { + "url": "https://github.com/fb55/domutils?sponsor=1" + } + }, + "node_modules/@svgr/plugin-svgo/node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/@svgr/plugin-svgo/node_modules/mdn-data": { + "version": "2.0.30", + "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.30.tgz", + "integrity": "sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==" + }, + "node_modules/@svgr/plugin-svgo/node_modules/svgo": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/svgo/-/svgo-3.2.0.tgz", + "integrity": "sha512-4PP6CMW/V7l/GmKRKzsLR8xxjdHTV4IMvhTnpuHwwBazSIlw5W/5SmPjN8Dwyt7lKbSJrRDgp4t9ph0HgChFBQ==", + "dependencies": { + "@trysound/sax": "0.2.0", + "commander": "^7.2.0", + "css-select": "^5.1.0", + "css-tree": "^2.3.1", + "css-what": "^6.1.0", + "csso": "^5.0.5", + "picocolors": "^1.0.0" + }, + "bin": { + "svgo": "bin/svgo" + }, + "engines": { + "node": ">=14.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/svgo" + } + }, + "node_modules/@svgr/webpack": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@svgr/webpack/-/webpack-8.1.0.tgz", + "integrity": "sha512-LnhVjMWyMQV9ZmeEy26maJk+8HTIbd59cH4F2MJ439k9DqejRisfFNGAPvRYlKETuh9LrImlS8aKsBgKjMA8WA==", + "dependencies": { + "@babel/core": "^7.21.3", + "@babel/plugin-transform-react-constant-elements": "^7.21.3", + "@babel/preset-env": "^7.20.2", + "@babel/preset-react": "^7.18.6", + "@babel/preset-typescript": "^7.21.0", + "@svgr/core": "8.1.0", + "@svgr/plugin-jsx": "8.1.0", + "@svgr/plugin-svgo": "8.1.0" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/gregberge" + } + }, "node_modules/@swc/helpers": { "version": "0.5.2", "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.2.tgz", @@ -5206,40 +5743,6 @@ "node": ">=8" } }, - "node_modules/babel-plugin-inline-react-svg": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/babel-plugin-inline-react-svg/-/babel-plugin-inline-react-svg-2.0.2.tgz", - "integrity": "sha512-iM9obPpCcdPE1EJE+UF+tni7CZ4q/OvdDm/TeBBHAYAEOqDcFd7fdnmym6OYAQMYfEpUnRYUYx2KxSUyo4cQxQ==", - "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/parser": "^7.0.0", - "lodash.isplainobject": "^4.0.6", - "resolve": "^2.0.0-next.4", - "svgo": "^2.8.0" - }, - "engines": { - "node": ">=10.13" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" - } - }, - "node_modules/babel-plugin-inline-react-svg/node_modules/resolve": { - "version": "2.0.0-next.4", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.4.tgz", - "integrity": "sha512-iMDbmAWtfU+MHpxt/I5iWI7cY6YVEZUQ3MBgPQ++XD1PELuJHIl82xBmObyP2KyQmkNB2dsqF7seoQQiAn5yDQ==", - "dependencies": { - "is-core-module": "^2.9.0", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - }, - "bin": { - "resolve": "bin/resolve" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/babel-plugin-istanbul": { "version": "6.1.1", "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz", @@ -5941,7 +6444,6 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true, "engines": { "node": ">=6" } @@ -6421,6 +6923,31 @@ "node": ">= 0.10" } }, + "node_modules/cosmiconfig": { + "version": "8.3.6", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-8.3.6.tgz", + "integrity": "sha512-kcZ6+W5QzcJ3P1Mt+83OUv/oHFqZHIx8DuxG6eZ5RGMERoLqp4BuGjhHLYGK+Kf5XVkQvqBSmAy/nGWN3qDgEA==", + "dependencies": { + "import-fresh": "^3.3.0", + "js-yaml": "^4.1.0", + "parse-json": "^5.2.0", + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/d-fischer" + }, + "peerDependencies": { + "typescript": ">=4.9.5" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, "node_modules/create-hash": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", @@ -6565,41 +7092,6 @@ "node": ">=8" } }, - "node_modules/css-select": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/css-select/-/css-select-4.3.0.tgz", - "integrity": "sha512-wPpOYtnsVontu2mODhA19JrqWxNsfdatRKd64kmpRbQgh1KtItko5sTnEpPdpSaJszTOhEMlF/RPz28qj4HqhQ==", - "dependencies": { - "boolbase": "^1.0.0", - "css-what": "^6.0.1", - "domhandler": "^4.3.1", - "domutils": "^2.8.0", - "nth-check": "^2.0.1" - }, - "funding": { - "url": "https://github.com/sponsors/fb55" - } - }, - "node_modules/css-tree": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.1.3.tgz", - "integrity": "sha512-tRpdppF7TRazZrjJ6v3stzv93qxRcSsFmW6cX0Zm2NVKpxE1WV1HblnghVv9TreireHkqI/VDEsfolRF1p6y7Q==", - "dependencies": { - "mdn-data": "2.0.14", - "source-map": "^0.6.1" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/css-tree/node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/css-what": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.1.0.tgz", @@ -6611,17 +7103,6 @@ "url": "https://github.com/sponsors/fb55" } }, - "node_modules/csso": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/csso/-/csso-4.2.0.tgz", - "integrity": "sha512-wvlcdIbf6pwKEk7vHj8/Bkc0B4ylXZruLvOgs9doS5eOsOpuodOV2zJChSpkp+pRpYQLQMeF04nr3Z68Sta9jA==", - "dependencies": { - "css-tree": "^1.1.2" - }, - "engines": { - "node": ">=8.0.0" - } - }, "node_modules/csstype": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.1.tgz", @@ -6995,19 +7476,6 @@ "csstype": "^3.0.2" } }, - "node_modules/dom-serializer": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-1.4.1.tgz", - "integrity": "sha512-VHwB3KfrcOOkelEG2ZOfxqLZdfkil8PtJi4P8N2MMXucZq2yLp75ClViUlOVwyoHEDjYU433Aq+5zWP61+RGag==", - "dependencies": { - "domelementtype": "^2.0.1", - "domhandler": "^4.2.0", - "entities": "^2.0.0" - }, - "funding": { - "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" - } - }, "node_modules/domelementtype": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", @@ -7019,36 +7487,18 @@ } ] }, - "node_modules/domhandler": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-4.3.1.tgz", - "integrity": "sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ==", - "dependencies": { - "domelementtype": "^2.2.0" - }, - "engines": { - "node": ">= 4" - }, - "funding": { - "url": "https://github.com/fb55/domhandler?sponsor=1" - } - }, "node_modules/domino": { "version": "2.1.6", "resolved": "https://registry.npmjs.org/domino/-/domino-2.1.6.tgz", "integrity": "sha512-3VdM/SXBZX2omc9JF9nOPCtDaYQ67BGp5CoLpIQlO2KCAPETs8TcDHacF26jXadGbvUteZzRTeos2fhID5+ucQ==" }, - "node_modules/domutils": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-2.8.0.tgz", - "integrity": "sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A==", + "node_modules/dot-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/dot-case/-/dot-case-3.0.4.tgz", + "integrity": "sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==", "dependencies": { - "dom-serializer": "^1.0.1", - "domelementtype": "^2.2.0", - "domhandler": "^4.2.0" - }, - "funding": { - "url": "https://github.com/fb55/domutils?sponsor=1" + "no-case": "^3.0.4", + "tslib": "^2.0.3" } }, "node_modules/dset": { @@ -7216,19 +7666,10 @@ "node": ">=10.13.0" } }, - "node_modules/entities": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-2.2.0.tgz", - "integrity": "sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==", - "funding": { - "url": "https://github.com/fb55/entities?sponsor=1" - } - }, "node_modules/error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "dev": true, "dependencies": { "is-arrayish": "^0.2.1" } @@ -9210,7 +9651,6 @@ "version": "3.3.0", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", - "dev": true, "dependencies": { "parent-module": "^1.0.0", "resolve-from": "^4.0.0" @@ -9362,8 +9802,7 @@ "node_modules/is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", - "dev": true + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=" }, "node_modules/is-bigint": { "version": "1.0.4", @@ -12112,8 +12551,7 @@ "node_modules/lines-and-columns": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", - "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", - "dev": true + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==" }, "node_modules/listenercount": { "version": "1.0.1", @@ -12182,11 +12620,6 @@ "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", "integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168=" }, - "node_modules/lodash.isplainobject": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", - "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=" - }, "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", @@ -12234,6 +12667,14 @@ "loose-envify": "cli.js" } }, + "node_modules/lower-case": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz", + "integrity": "sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==", + "dependencies": { + "tslib": "^2.0.3" + } + }, "node_modules/lowlight": { "version": "1.20.0", "resolved": "https://registry.npmjs.org/lowlight/-/lowlight-1.20.0.tgz", @@ -12650,11 +13091,6 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/mdn-data": { - "version": "2.0.14", - "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.14.tgz", - "integrity": "sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow==" - }, "node_modules/mdurl": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", @@ -13922,6 +14358,15 @@ "react-dom": ">=16.0.0" } }, + "node_modules/no-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz", + "integrity": "sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==", + "dependencies": { + "lower-case": "^2.0.2", + "tslib": "^2.0.3" + } + }, "node_modules/noble-secp256k1": { "version": "1.2.14", "resolved": "https://registry.npmjs.org/noble-secp256k1/-/noble-secp256k1-1.2.14.tgz", @@ -14450,7 +14895,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dev": true, "dependencies": { "callsites": "^3.0.0" }, @@ -14479,7 +14923,6 @@ "version": "5.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", - "dev": true, "dependencies": { "@babel/code-frame": "^7.0.0", "error-ex": "^1.3.1", @@ -14537,6 +14980,14 @@ "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "engines": { + "node": ">=8" + } + }, "node_modules/performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", @@ -16014,7 +16465,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true, "engines": { "node": ">=4" } @@ -16506,6 +16956,15 @@ "node": ">=8" } }, + "node_modules/snake-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/snake-case/-/snake-case-3.0.4.tgz", + "integrity": "sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg==", + "dependencies": { + "dot-case": "^3.0.4", + "tslib": "^2.0.3" + } + }, "node_modules/source-list-map": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz", @@ -16628,12 +17087,6 @@ "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", "integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==" }, - "node_modules/stable": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/stable/-/stable-0.1.8.tgz", - "integrity": "sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w==", - "deprecated": "Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility" - }, "node_modules/stack-utils": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz", @@ -16956,25 +17409,10 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/svgo": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/svgo/-/svgo-2.8.0.tgz", - "integrity": "sha512-+N/Q9kV1+F+UeWYoSiULYo4xYSDQlTgb+ayMobAXPwMnLvop7oxKMo9OzIrX5x3eS4L4f2UHhc9axXwY8DpChg==", - "dependencies": { - "@trysound/sax": "0.2.0", - "commander": "^7.2.0", - "css-select": "^4.1.3", - "css-tree": "^1.1.3", - "csso": "^4.2.0", - "picocolors": "^1.0.0", - "stable": "^0.1.8" - }, - "bin": { - "svgo": "bin/svgo" - }, - "engines": { - "node": ">=10.13.0" - } + "node_modules/svg-parser": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/svg-parser/-/svg-parser-2.0.4.tgz", + "integrity": "sha512-e4hG1hRwoOdRb37cIMSgzNsxyzKfayW6VOflrwvR+/bzrkyxY/31WkbgnQpgtrNp1SdpJvpUAGTa/ZoiPNDuRQ==" }, "node_modules/symbol-observable": { "version": "4.0.0", diff --git a/package.json b/package.json index 50593920..b2f560ee 100644 --- a/package.json +++ b/package.json @@ -22,12 +22,12 @@ "@opensearch-project/opensearch": "^2.4.0", "@prisma/client": "^5.4.2", "@slack/web-api": "^6.9.0", + "@svgr/webpack": "^8.1.0", "@yudiel/react-qr-scanner": "^1.1.10", "acorn": "^8.10.0", "ajv": "^8.12.0", "async-retry": "^1.3.1", "aws-sdk": "^2.1473.0", - "babel-plugin-inline-react-svg": "^2.0.2", "bech32": "^2.0.0", "bolt11": "^1.4.1", "bootstrap": "^5.3.2", diff --git a/pages/[name]/[type].js b/pages/[name]/[type].js index d304227a..bb16df16 100644 --- a/pages/[name]/[type].js +++ b/pages/[name]/[type].js @@ -1,13 +1,13 @@ -import { getGetServerSideProps } from '../../api/ssrApollo' -import Items from '../../components/items' +import { getGetServerSideProps } from '@/api/ssrApollo' +import Items from '@/components/items' import { useRouter } from 'next/router' -import { USER, USER_WITH_ITEMS } from '../../fragments/users' +import { USER, USER_WITH_ITEMS } from '@/fragments/users' import { useQuery } from '@apollo/client' -import { COMMENT_TYPE_QUERY, ITEM_SORTS, ITEM_TYPES_USER, WHENS } from '../../lib/constants' -import PageLoading from '../../components/page-loading' +import { COMMENT_TYPE_QUERY, ITEM_SORTS, ITEM_TYPES_USER, WHENS } from '@/lib/constants' +import PageLoading from '@/components/page-loading' import { UserLayout } from '.' -import { Form, Select, DatePicker } from '../../components/form' -import { whenToFrom } from '../../lib/time' +import { Form, Select, DatePicker } from '@/components/form' +import { whenToFrom } from '@/lib/time' const staticVariables = { sort: 'user' } const variablesFunc = vars => ({ diff --git a/pages/[name]/index.js b/pages/[name]/index.js index 6c267a0e..0ca1b9d7 100644 --- a/pages/[name]/index.js +++ b/pages/[name]/index.js @@ -1,20 +1,20 @@ -import Layout from '../../components/layout' +import Layout from '@/components/layout' import { gql, useMutation, useQuery } from '@apollo/client' -import UserHeader from '../../components/user-header' +import UserHeader from '@/components/user-header' import Button from 'react-bootstrap/Button' -import styles from '../../styles/user.module.css' +import styles from '@/styles/user.module.css' import { useState } from 'react' -import ItemFull from '../../components/item-full' -import { Form, MarkdownInput } from '../../components/form' -import { useMe } from '../../components/me' -import { USER_FULL } from '../../fragments/users' -import { ITEM_FIELDS } from '../../fragments/items' -import { getGetServerSideProps } from '../../api/ssrApollo' -import { FeeButtonProvider } from '../../components/fee-button' -import { bioSchema } from '../../lib/validate' +import ItemFull from '@/components/item-full' +import { Form, MarkdownInput } from '@/components/form' +import { useMe } from '@/components/me' +import { USER_FULL } from '@/fragments/users' +import { ITEM_FIELDS } from '@/fragments/items' +import { getGetServerSideProps } from '@/api/ssrApollo' +import { FeeButtonProvider } from '@/components/fee-button' +import { bioSchema } from '@/lib/validate' import { useRouter } from 'next/router' -import PageLoading from '../../components/page-loading' -import { ItemButtonBar } from '../../components/post' +import PageLoading from '@/components/page-loading' +import { ItemButtonBar } from '@/components/post' export const getServerSideProps = getGetServerSideProps({ query: USER_FULL, diff --git a/pages/[name]/territories.js b/pages/[name]/territories.js index 3b7a1877..bf0f7627 100644 --- a/pages/[name]/territories.js +++ b/pages/[name]/territories.js @@ -1,10 +1,10 @@ -import { getGetServerSideProps } from '../../api/ssrApollo' +import { getGetServerSideProps } from '@/api/ssrApollo' import { useRouter } from 'next/router' -import { USER, USER_WITH_SUBS } from '../../fragments/users' +import { USER, USER_WITH_SUBS } from '@/fragments/users' import { useQuery } from '@apollo/client' -import PageLoading from '../../components/page-loading' +import PageLoading from '@/components/page-loading' import { UserLayout } from '.' -import TerritoryList from '../../components/territory-list' +import TerritoryList from '@/components/territory-list' export const getServerSideProps = getGetServerSideProps({ query: USER_WITH_SUBS }) diff --git a/pages/_app.js b/pages/_app.js index b537811d..488bdd37 100644 --- a/pages/_app.js +++ b/pages/_app.js @@ -1,24 +1,24 @@ -import '../styles/globals.scss' +import '@/styles/globals.scss' import { ApolloProvider, gql } from '@apollo/client' -import { MeProvider } from '../components/me' +import { MeProvider } from '@/components/me' import PlausibleProvider from 'next-plausible' -import getApolloClient from '../lib/apollo.js' -import { PriceProvider } from '../components/price' -import { BlockHeightProvider } from '../components/block-height' +import getApolloClient from '@/lib/apollo.js' +import { PriceProvider } from '@/components/price' +import { BlockHeightProvider } from '@/components/block-height' import Head from 'next/head' import { useRouter } from 'next/dist/client/router' import { useEffect } from 'react' -import { ShowModalProvider } from '../components/modal' -import ErrorBoundary from '../components/error-boundary' -import { LightningProvider } from '../components/lightning' -import { ToastProvider } from '../components/toast' -import { ServiceWorkerProvider } from '../components/serviceworker' -import { SSR } from '../lib/constants' +import { ShowModalProvider } from '@/components/modal' +import ErrorBoundary from '@/components/error-boundary' +import { LightningProvider } from '@/components/lightning' +import { ToastProvider } from '@/components/toast' +import { ServiceWorkerProvider } from '@/components/serviceworker' +import { SSR } from '@/lib/constants' import NProgress from 'nprogress' import 'nprogress/nprogress.css' -import { LoggerProvider } from '../components/logger' -import { ChainFeeProvider } from '../components/chain-fee.js' -import { WebLNProvider } from '../components/webln' +import { LoggerProvider } from '@/components/logger' +import { ChainFeeProvider } from '@/components/chain-fee.js' +import { WebLNProvider } from '@/components/webln' import dynamic from 'next/dynamic' const PWAPrompt = dynamic(() => import('react-ios-pwa-prompt'), { ssr: false }) diff --git a/pages/_error.js b/pages/_error.js index 16a3586d..02d52c23 100644 --- a/pages/_error.js +++ b/pages/_error.js @@ -1,6 +1,6 @@ import Image from 'react-bootstrap/Image' -import { StaticLayout } from '../components/layout' -import styles from '../styles/error.module.css' +import { StaticLayout } from '@/components/layout' +import styles from '@/styles/error.module.css' const statusDescribe = { 200: 'OK', diff --git a/pages/api/auth/[...nextauth].js b/pages/api/auth/[...nextauth].js index ca76095d..342d60c8 100644 --- a/pages/api/auth/[...nextauth].js +++ b/pages/api/auth/[...nextauth].js @@ -4,13 +4,13 @@ import CredentialsProvider from 'next-auth/providers/credentials' import GitHubProvider from 'next-auth/providers/github' import TwitterProvider from 'next-auth/providers/twitter' import EmailProvider from 'next-auth/providers/email' -import prisma from '../../../api/models' +import prisma from '@/api/models' import nodemailer from 'nodemailer' import { PrismaAdapter } from '@auth/prisma-adapter' import { getToken } from 'next-auth/jwt' import { NodeNextRequest } from 'next/dist/server/base-http/node' import { schnorr } from '@noble/curves/secp256k1' -import { notifyReferral } from '../../../lib/webPush' +import { notifyReferral } from '@/lib/webPush' /** * Stores userIds in user table diff --git a/pages/api/daily.js b/pages/api/daily.js index 8a615968..4ca1fc8d 100644 --- a/pages/api/daily.js +++ b/pages/api/daily.js @@ -1,4 +1,4 @@ -import models from '../../api/models' +import models from '@/api/models' export default async (_, res) => { // get the latest daily discussion thread diff --git a/pages/api/graphql.js b/pages/api/graphql.js index f77ac348..14cfba3b 100644 --- a/pages/api/graphql.js +++ b/pages/api/graphql.js @@ -1,12 +1,12 @@ import { ApolloServer } from '@apollo/server' import { startServerAndCreateNextHandler } from '@as-integrations/next' -import resolvers from '../../api/resolvers' -import models from '../../api/models' -import lnd from '../../api/lnd' -import typeDefs from '../../api/typeDefs' +import resolvers from '@/api/resolvers' +import models from '@/api/models' +import lnd from '@/api/lnd' +import typeDefs from '@/api/typeDefs' import { getServerSession } from 'next-auth/next' import { getAuthOptions } from './auth/[...nextauth]' -import search from '../../api/search' +import search from '@/api/search' import { ApolloServerPluginLandingPageLocalDefault, ApolloServerPluginLandingPageProductionDefault diff --git a/pages/api/lnauth.js b/pages/api/lnauth.js index e7e22f0f..7abae1de 100644 --- a/pages/api/lnauth.js +++ b/pages/api/lnauth.js @@ -2,7 +2,7 @@ // store pubkey in db // create user with pubkey and name truncated pubkey import { secp256k1 } from '@noble/curves/secp256k1' -import models from '../../api/models' +import models from '@/api/models' const HOUR = 1000 * 60 * 60 diff --git a/pages/api/lnurlp/[username]/index.js b/pages/api/lnurlp/[username]/index.js index 8c413a93..20628fba 100644 --- a/pages/api/lnurlp/[username]/index.js +++ b/pages/api/lnurlp/[username]/index.js @@ -1,7 +1,7 @@ import { getPublicKey } from 'nostr' -import models from '../../../../api/models' -import { lnurlPayMetadataString } from '../../../../lib/lnurl' -import { LNURLP_COMMENT_MAX_LENGTH } from '../../../../lib/constants' +import models from '@/api/models' +import { lnurlPayMetadataString } from '@/lib/lnurl' +import { LNURLP_COMMENT_MAX_LENGTH } from '@/lib/constants' export default async ({ query: { username } }, res) => { const user = await models.user.findUnique({ where: { name: username } }) diff --git a/pages/api/lnurlp/[username]/pay.js b/pages/api/lnurlp/[username]/pay.js index b293f963..6361ee66 100644 --- a/pages/api/lnurlp/[username]/pay.js +++ b/pages/api/lnurlp/[username]/pay.js @@ -1,14 +1,14 @@ -import models from '../../../../api/models' -import lnd from '../../../../api/lnd' +import models from '@/api/models' +import lnd from '@/api/lnd' import { createInvoice } from 'ln-service' -import { lnurlPayDescriptionHashForUser, lnurlPayMetadataString, lnurlPayDescriptionHash } from '../../../../lib/lnurl' -import serialize from '../../../../api/resolvers/serial' +import { lnurlPayDescriptionHashForUser, lnurlPayMetadataString, lnurlPayDescriptionHash } from '@/lib/lnurl' +import serialize from '@/api/resolvers/serial' import { schnorr } from '@noble/curves/secp256k1' import { createHash } from 'crypto' -import { datePivot } from '../../../../lib/time' -import { BALANCE_LIMIT_MSATS, INV_PENDING_LIMIT, LNURLP_COMMENT_MAX_LENGTH, USER_IDS_BALANCE_NO_LIMIT } from '../../../../lib/constants' -import { ssValidate, lud18PayerDataSchema } from '../../../../lib/validate' -import assertGofacYourself from '../../../../api/resolvers/ofac' +import { datePivot } from '@/lib/time' +import { BALANCE_LIMIT_MSATS, INV_PENDING_LIMIT, LNURLP_COMMENT_MAX_LENGTH, USER_IDS_BALANCE_NO_LIMIT } from '@/lib/constants' +import { ssValidate, lud18PayerDataSchema } from '@/lib/validate' +import assertGofacYourself from '@/api/resolvers/ofac' export default async ({ query: { username, amount, nostr, comment, payerdata: payerData }, headers }, res) => { const user = await models.user.findUnique({ where: { name: username } }) diff --git a/pages/api/lnwith.js b/pages/api/lnwith.js index 1f146b70..ed22d499 100644 --- a/pages/api/lnwith.js +++ b/pages/api/lnwith.js @@ -1,9 +1,9 @@ // verify k1 exists // send back -import models from '../../api/models' -import { datePivot } from '../../lib/time' -import lnd from '../../api/lnd' -import { createWithdrawal } from '../../api/resolvers/wallet' +import models from '@/api/models' +import { datePivot } from '@/lib/time' +import lnd from '@/api/lnd' +import { createWithdrawal } from '@/api/resolvers/wallet' export default async ({ query, headers }, res) => { if (!query.k1) { diff --git a/pages/api/log/index.js b/pages/api/log/index.js index 2238cc20..18ffbc35 100644 --- a/pages/api/log/index.js +++ b/pages/api/log/index.js @@ -1,5 +1,5 @@ -import models from '../../../api/models' -import slackClient from '../../../api/slack' +import models from '@/api/models' +import slackClient from '@/api/slack' const channelId = process.env.SLACK_CHANNEL_ID diff --git a/pages/api/nostr/nip05.js b/pages/api/nostr/nip05.js index 54d1d7c5..27951c34 100644 --- a/pages/api/nostr/nip05.js +++ b/pages/api/nostr/nip05.js @@ -1,4 +1,4 @@ -import models from '../../../api/models' +import models from '@/api/models' export default async function Nip05 ({ query: { name } }, res) { const names = {} diff --git a/pages/api/ots/preimage/[id].js b/pages/api/ots/preimage/[id].js index 05fca508..83d2cb34 100644 --- a/pages/api/ots/preimage/[id].js +++ b/pages/api/ots/preimage/[id].js @@ -1,5 +1,5 @@ -import getSSRApolloClient from '../../../../api/ssrApollo' -import { ITEM_OTS } from '../../../../fragments/items' +import getSSRApolloClient from '@/api/ssrApollo' +import { ITEM_OTS } from '@/fragments/items' import stringifyCanon from 'canonical-json' export default async function handler (req, res) { diff --git a/pages/api/ots/proof/[id].js b/pages/api/ots/proof/[id].js index a89f8a56..97e0ff73 100644 --- a/pages/api/ots/proof/[id].js +++ b/pages/api/ots/proof/[id].js @@ -1,4 +1,4 @@ -import models from '../../../../api/models' +import models from '@/api/models' export default async function handler (req, res) { const item = await models.item.findUnique({ where: { id: Number(req.query.id) } }) diff --git a/pages/auth/error.js b/pages/auth/error.js index 5c714af2..c95a8ae2 100644 --- a/pages/auth/error.js +++ b/pages/auth/error.js @@ -1,7 +1,7 @@ import Image from 'react-bootstrap/Image' -import { StaticLayout } from '../../components/layout' -import styles from '../../styles/error.module.css' -import LightningIcon from '../../svgs/bolt.svg' +import { StaticLayout } from '@/components/layout' +import styles from '@/styles/error.module.css' +import LightningIcon from '@/svgs/bolt.svg' import { useRouter } from 'next/router' import Button from 'react-bootstrap/Button' diff --git a/pages/email.js b/pages/email.js index d516344d..c3bba919 100644 --- a/pages/email.js +++ b/pages/email.js @@ -1,6 +1,6 @@ import Image from 'react-bootstrap/Image' -import { StaticLayout } from '../components/layout' -import { getGetServerSideProps } from '../api/ssrApollo' +import { StaticLayout } from '@/components/layout' +import { getGetServerSideProps } from '@/api/ssrApollo' // force SSR to include CSP nonces export const getServerSideProps = getGetServerSideProps({ query: null }) diff --git a/pages/invites/[id].js b/pages/invites/[id].js index 83648b48..74042986 100644 --- a/pages/invites/[id].js +++ b/pages/invites/[id].js @@ -1,15 +1,15 @@ -import Login from '../../components/login' +import Login from '@/components/login' import { getProviders } from 'next-auth/react' import { getServerSession } from 'next-auth/next' -import models from '../../api/models' -import serialize from '../../api/resolvers/serial' +import models from '@/api/models' +import serialize from '@/api/resolvers/serial' import { gql } from '@apollo/client' -import { INVITE_FIELDS } from '../../fragments/invites' -import getSSRApolloClient from '../../api/ssrApollo' +import { INVITE_FIELDS } from '@/fragments/invites' +import getSSRApolloClient from '@/api/ssrApollo' import Link from 'next/link' -import { CenterLayout } from '../../components/layout' -import { getAuthOptions } from '../api/auth/[...nextauth]' -import { sendUserNotification } from '../../lib/webPush' +import { CenterLayout } from '@/components/layout' +import { getAuthOptions } from '@/api/auth/[...nextauth]' +import { notifyInvite } from '@/lib/webPush' export async function getServerSideProps ({ req, res, query: { id, error = null } }) { const session = await getServerSession(req, res, getAuthOptions(req)) @@ -38,7 +38,7 @@ export async function getServerSideProps ({ req, res, query: { id, error = null await serialize(models, models.$queryRawUnsafe('SELECT invite_drain($1::INTEGER, $2::INTEGER)', session.user.id, id)) const invite = await models.invite.findUnique({ where: { id } }) - sendUserNotification(invite.userId, { title: 'your invite has been redeemed', tag: 'INVITE' }).catch(console.error) + notifyInvite(invite.userId) } catch (e) { console.log(e) } diff --git a/pages/invites/index.js b/pages/invites/index.js index 9189eff1..982955de 100644 --- a/pages/invites/index.js +++ b/pages/invites/index.js @@ -1,14 +1,14 @@ -import Layout from '../../components/layout' -import { Form, Input, SubmitButton } from '../../components/form' +import Layout from '@/components/layout' +import { Form, Input, SubmitButton } from '@/components/form' import InputGroup from 'react-bootstrap/InputGroup' import { gql, useMutation, useQuery } from '@apollo/client' -import { INVITE_FIELDS } from '../../fragments/invites' -import AccordianItem from '../../components/accordian-item' -import styles from '../../styles/invites.module.css' -import Invite from '../../components/invite' -import { inviteSchema } from '../../lib/validate' -import { SSR } from '../../lib/constants' -import { getGetServerSideProps } from '../../api/ssrApollo' +import { INVITE_FIELDS } from '@/fragments/invites' +import AccordianItem from '@/components/accordian-item' +import styles from '@/styles/invites.module.css' +import Invite from '@/components/invite' +import { inviteSchema } from '@/lib/validate' +import { SSR } from '@/lib/constants' +import { getGetServerSideProps } from '@/api/ssrApollo' // force SSR to include CSP nonces export const getServerSideProps = getGetServerSideProps({ query: null }) diff --git a/pages/invoices/[id].js b/pages/invoices/[id].js index 734850a6..d71abfd8 100644 --- a/pages/invoices/[id].js +++ b/pages/invoices/[id].js @@ -1,11 +1,11 @@ import { useQuery } from '@apollo/client' -import { Invoice } from '../../components/invoice' -import { QrSkeleton } from '../../components/qr' -import { CenterLayout } from '../../components/layout' +import { Invoice } from '@/components/invoice' +import { QrSkeleton } from '@/components/qr' +import { CenterLayout } from '@/components/layout' import { useRouter } from 'next/router' -import { INVOICE } from '../../fragments/wallet' -import { SSR } from '../../lib/constants' -import { getGetServerSideProps } from '../../api/ssrApollo' +import { INVOICE } from '@/fragments/wallet' +import { SSR } from '@/lib/constants' +import { getGetServerSideProps } from '@/api/ssrApollo' // force SSR to include CSP nonces export const getServerSideProps = getGetServerSideProps({ query: null }) diff --git a/pages/items/[id]/edit.js b/pages/items/[id]/edit.js index caa8669b..df8efdbd 100644 --- a/pages/items/[id]/edit.js +++ b/pages/items/[id]/edit.js @@ -1,17 +1,17 @@ -import { ITEM } from '../../../fragments/items' -import { getGetServerSideProps } from '../../../api/ssrApollo' -import { DiscussionForm } from '../../../components/discussion-form' -import { LinkForm } from '../../../components/link-form' -import { CenterLayout } from '../../../components/layout' -import JobForm from '../../../components/job-form' -import { PollForm } from '../../../components/poll-form' -import { BountyForm } from '../../../components/bounty-form' +import { ITEM } from '@/fragments/items' +import { getGetServerSideProps } from '@/api/ssrApollo' +import { DiscussionForm } from '@/components/discussion-form' +import { LinkForm } from '@/components/link-form' +import { CenterLayout } from '@/components/layout' +import JobForm from '@/components/job-form' +import { PollForm } from '@/components/poll-form' +import { BountyForm } from '@/components/bounty-form' import { useState } from 'react' import { useQuery } from '@apollo/client' import { useRouter } from 'next/router' -import PageLoading from '../../../components/page-loading' -import { FeeButtonProvider } from '../../../components/fee-button' -import SubSelect from '../../../components/sub-select' +import PageLoading from '@/components/page-loading' +import { FeeButtonProvider } from '@/components/fee-button' +import SubSelect from '@/components/sub-select' export const getServerSideProps = getGetServerSideProps({ query: ITEM, diff --git a/pages/items/[id]/index.js b/pages/items/[id]/index.js index 7fc98243..da00f573 100644 --- a/pages/items/[id]/index.js +++ b/pages/items/[id]/index.js @@ -1,10 +1,10 @@ -import Layout from '../../../components/layout' -import { ITEM_FULL } from '../../../fragments/items' -import ItemFull from '../../../components/item-full' -import { getGetServerSideProps } from '../../../api/ssrApollo' +import Layout from '@/components/layout' +import { ITEM_FULL } from '@/fragments/items' +import ItemFull from '@/components/item-full' +import { getGetServerSideProps } from '@/api/ssrApollo' import { useQuery } from '@apollo/client' import { useRouter } from 'next/router' -import PageLoading from '../../../components/page-loading' +import PageLoading from '@/components/page-loading' export const getServerSideProps = getGetServerSideProps({ query: ITEM_FULL, diff --git a/pages/items/[id]/ots.js b/pages/items/[id]/ots.js index b73f653f..aefe3731 100644 --- a/pages/items/[id]/ots.js +++ b/pages/items/[id]/ots.js @@ -1,11 +1,11 @@ -import Layout from '../../../components/layout' -import { ITEM_OTS } from '../../../fragments/items' -import { getGetServerSideProps } from '../../../api/ssrApollo' +import Layout from '@/components/layout' +import { ITEM_OTS } from '@/fragments/items' +import { getGetServerSideProps } from '@/api/ssrApollo' import stringifyCanon from 'canonical-json' import Button from 'react-bootstrap/Button' import { useQuery } from '@apollo/client' import { useRouter } from 'next/router' -import PageLoading from '../../../components/page-loading' +import PageLoading from '@/components/page-loading' export const getServerSideProps = getGetServerSideProps({ query: ITEM_OTS, diff --git a/pages/items/[id]/related.js b/pages/items/[id]/related.js index 393848d8..07b69898 100644 --- a/pages/items/[id]/related.js +++ b/pages/items/[id]/related.js @@ -1,13 +1,13 @@ // ssr the related query with an adequate limit // need to use a cursor on related -import { RELATED_ITEMS, RELATED_ITEMS_WITH_ITEM } from '../../../fragments/items' -import { getGetServerSideProps } from '../../../api/ssrApollo' -import Items from '../../../components/items' -import Layout from '../../../components/layout' +import { RELATED_ITEMS, RELATED_ITEMS_WITH_ITEM } from '@/fragments/items' +import { getGetServerSideProps } from '@/api/ssrApollo' +import Items from '@/components/items' +import Layout from '@/components/layout' import { useRouter } from 'next/router' -import Item from '../../../components/item' +import Item from '@/components/item' import { useQuery } from '@apollo/client' -import PageLoading from '../../../components/page-loading' +import PageLoading from '@/components/page-loading' export const getServerSideProps = getGetServerSideProps({ query: RELATED_ITEMS_WITH_ITEM, diff --git a/pages/live.js b/pages/live.js index 38272eed..e4ada619 100644 --- a/pages/live.js +++ b/pages/live.js @@ -1,9 +1,9 @@ import Button from 'react-bootstrap/Button' -import { CenterLayout } from '../components/layout' -import Snl from '../components/snl' +import { CenterLayout } from '@/components/layout' +import Snl from '@/components/snl' import { gql } from 'graphql-tag' import { useMutation, useQuery } from '@apollo/client' -import { getGetServerSideProps } from '../api/ssrApollo' +import { getGetServerSideProps } from '@/api/ssrApollo' // force SSR to include CSP nonces export const getServerSideProps = getGetServerSideProps({ query: null }) diff --git a/pages/login.js b/pages/login.js index f933140c..e6ba0216 100644 --- a/pages/login.js +++ b/pages/login.js @@ -2,9 +2,9 @@ import { getProviders } from 'next-auth/react' import { getServerSession } from 'next-auth/next' import { getAuthOptions } from './api/auth/[...nextauth]' import Link from 'next/link' -import { StaticLayout } from '../components/layout' -import Login from '../components/login' -import { isExternal } from '../lib/url' +import { StaticLayout } from '@/components/layout' +import Login from '@/components/login' +import { isExternal } from '@/lib/url' export async function getServerSideProps ({ req, res, query: { callbackUrl, error = null } }) { const session = await getServerSession(req, res, getAuthOptions(req)) diff --git a/pages/notifications.js b/pages/notifications.js index 6bfcc0f7..cc25930c 100644 --- a/pages/notifications.js +++ b/pages/notifications.js @@ -1,10 +1,10 @@ import { useEffect } from 'react' -import { getGetServerSideProps } from '../api/ssrApollo' -import Layout from '../components/layout' -import Notifications, { NotificationAlert } from '../components/notifications' -import { HAS_NOTIFICATIONS, NOTIFICATIONS } from '../fragments/notifications' +import { getGetServerSideProps } from '@/api/ssrApollo' +import Layout from '@/components/layout' +import Notifications, { NotificationAlert } from '@/components/notifications' +import { HAS_NOTIFICATIONS, NOTIFICATIONS } from '@/fragments/notifications' import { useApolloClient } from '@apollo/client' -import { clearNotifications } from '../lib/badge' +import { clearNotifications } from '@/lib/badge' export const getServerSideProps = getGetServerSideProps({ query: NOTIFICATIONS, authRequired: true }) diff --git a/pages/offline.js b/pages/offline.js index 566de6e1..b9a0c58d 100644 --- a/pages/offline.js +++ b/pages/offline.js @@ -1,6 +1,6 @@ import Image from 'react-bootstrap/Image' -import { StaticLayout } from '../components/layout' -import styles from '../styles/error.module.css' +import { StaticLayout } from '@/components/layout' +import styles from '@/styles/error.module.css' export default function offline () { return ( diff --git a/pages/referrals/[when].js b/pages/referrals/[when].js index 54df8126..2c327248 100644 --- a/pages/referrals/[when].js +++ b/pages/referrals/[when].js @@ -1,18 +1,18 @@ import { gql } from 'graphql-tag' import Link from 'next/link' import { useRouter } from 'next/router' -import { getGetServerSideProps } from '../../api/ssrApollo' -import { CopyInput, Select, DatePicker } from '../../components/form' -import { CenterLayout } from '../../components/layout' -import { useMe } from '../../components/me' +import { getGetServerSideProps } from '@/api/ssrApollo' +import { CopyInput, Select, DatePicker } from '@/components/form' +import { CenterLayout } from '@/components/layout' +import { useMe } from '@/components/me' import { useQuery } from '@apollo/client' -import PageLoading from '../../components/page-loading' -import { WHENS } from '../../lib/constants' +import PageLoading from '@/components/page-loading' +import { WHENS } from '@/lib/constants' import dynamic from 'next/dynamic' -import { numWithUnits } from '../../lib/format' -import { whenToFrom } from '../../lib/time' +import { numWithUnits } from '@/lib/format' +import { whenToFrom } from '@/lib/time' -const WhenComposedChart = dynamic(() => import('../../components/charts').then(mod => mod.WhenComposedChart), { +const WhenComposedChart = dynamic(() => import('@/components/charts').then(mod => mod.WhenComposedChart), { loading: () =>
Loading...
}) diff --git a/pages/rewards/[...when].js b/pages/rewards/[...when].js index 62c2b973..05b93034 100644 --- a/pages/rewards/[...when].js +++ b/pages/rewards/[...when].js @@ -1,16 +1,16 @@ import { useQuery } from '@apollo/client' -import PageLoading from '../../components/page-loading' -import { ME_REWARDS } from '../../fragments/rewards' -import { CenterLayout } from '../../components/layout' +import PageLoading from '@/components/page-loading' +import { ME_REWARDS } from '@/fragments/rewards' +import { CenterLayout } from '@/components/layout' import dynamic from 'next/dynamic' import { useRouter } from 'next/router' -import { getGetServerSideProps } from '../../api/ssrApollo' -import { fixedDecimal } from '../../lib/format' -import Trophy from '../../svgs/trophy-fill.svg' -import { ListItem } from '../../components/items' -import { dayMonthYear } from '../../lib/time' +import { getGetServerSideProps } from '@/api/ssrApollo' +import { fixedDecimal } from '@/lib/format' +import Trophy from '@/svgs/trophy-fill.svg' +import { ListItem } from '@/components/items' +import { dayMonthYear } from '@/lib/time' -const GrowthPieChart = dynamic(() => import('../../components/charts').then(mod => mod.GrowthPieChart), { +const GrowthPieChart = dynamic(() => import('@/components/charts').then(mod => mod.GrowthPieChart), { loading: () =>
Loading...
}) diff --git a/pages/rewards/index.js b/pages/rewards/index.js index 0e3b0b31..c5440f06 100644 --- a/pages/rewards/index.js +++ b/pages/rewards/index.js @@ -1,26 +1,26 @@ import { gql } from 'graphql-tag' import Button from 'react-bootstrap/Button' import InputGroup from 'react-bootstrap/InputGroup' -import { getGetServerSideProps } from '../../api/ssrApollo' -import { Form, Input, SubmitButton } from '../../components/form' -import Layout from '../../components/layout' +import { getGetServerSideProps } from '@/api/ssrApollo' +import { Form, Input, SubmitButton } from '@/components/form' +import Layout from '@/components/layout' import { useMutation, useQuery } from '@apollo/client' import Link from 'next/link' -import { amountSchema } from '../../lib/validate' +import { amountSchema } from '@/lib/validate' import Countdown from 'react-countdown' -import { numWithUnits } from '../../lib/format' -import PageLoading from '../../components/page-loading' -import { useShowModal } from '../../components/modal' +import { numWithUnits } from '@/lib/format' +import PageLoading from '@/components/page-loading' +import { useShowModal } from '@/components/modal' import dynamic from 'next/dynamic' -import { SSR } from '../../lib/constants' -import { useToast } from '../../components/toast' -import { useLightning } from '../../components/lightning' -import { ListUsers } from '../../components/user-list' +import { SSR } from '@/lib/constants' +import { useToast } from '@/components/toast' +import { useLightning } from '@/components/lightning' +import { ListUsers } from '@/components/user-list' import { Col, Row } from 'react-bootstrap' -import { proportions } from '../../lib/madness' -import { useData } from '../../components/use-data' +import { proportions } from '@/lib/madness' +import { useData } from '@/components/use-data' -const GrowthPieChart = dynamic(() => import('../../components/charts').then(mod => mod.GrowthPieChart), { +const GrowthPieChart = dynamic(() => import('@/components/charts').then(mod => mod.GrowthPieChart), { loading: () =>
Loading...
}) diff --git a/pages/satistics.js b/pages/satistics.js index d6e60f77..05f3662e 100644 --- a/pages/satistics.js +++ b/pages/satistics.js @@ -1,20 +1,20 @@ import { useQuery } from '@apollo/client' import Link from 'next/link' -import { getGetServerSideProps } from '../api/ssrApollo' -import Layout from '../components/layout' -import MoreFooter from '../components/more-footer' -import { WALLET_HISTORY } from '../fragments/wallet' -import styles from '../styles/satistics.module.css' -import Moon from '../svgs/moon-fill.svg' -import Check from '../svgs/check-double-line.svg' -import ThumbDown from '../svgs/thumb-down-fill.svg' -import { Checkbox, Form } from '../components/form' +import { getGetServerSideProps } from '@/api/ssrApollo' +import Layout from '@/components/layout' +import MoreFooter from '@/components/more-footer' +import { WALLET_HISTORY } from '@/fragments/wallet' +import styles from '@/styles/satistics.module.css' +import Moon from '@/svgs/moon-fill.svg' +import Check from '@/svgs/check-double-line.svg' +import ThumbDown from '@/svgs/thumb-down-fill.svg' +import { Checkbox, Form } from '@/components/form' import { useRouter } from 'next/router' -import Item from '../components/item' -import { CommentFlat } from '../components/comment' -import ItemJob from '../components/item-job' -import PageLoading from '../components/page-loading' -import PayerData from '../components/payer-data' +import Item from '@/components/item' +import { CommentFlat } from '@/components/comment' +import ItemJob from '@/components/item-job' +import PageLoading from '@/components/page-loading' +import PayerData from '@/components/payer-data' import { Badge } from 'react-bootstrap' export const getServerSideProps = getGetServerSideProps({ query: WALLET_HISTORY, authRequired: true }) diff --git a/pages/settings/index.js b/pages/settings/index.js index d6f99cfc..0f707027 100644 --- a/pages/settings/index.js +++ b/pages/settings/index.js @@ -1,33 +1,33 @@ -import { Checkbox, Form, Input, SubmitButton, Select, VariableInput, CopyInput } from '../../components/form' +import { Checkbox, Form, Input, SubmitButton, Select, VariableInput, CopyInput } from '@/components/form' import Alert from 'react-bootstrap/Alert' import Button from 'react-bootstrap/Button' import InputGroup from 'react-bootstrap/InputGroup' -import { CenterLayout } from '../../components/layout' +import { CenterLayout } from '@/components/layout' import { useState, useMemo } from 'react' import { gql, useMutation, useQuery } from '@apollo/client' -import { getGetServerSideProps } from '../../api/ssrApollo' -import LoginButton from '../../components/login-button' +import { getGetServerSideProps } from '@/api/ssrApollo' +import LoginButton from '@/components/login-button' import { signIn } from 'next-auth/react' -import { LightningAuth } from '../../components/lightning-auth' -import { SETTINGS, SET_SETTINGS } from '../../fragments/users' +import { LightningAuth } from '@/components/lightning-auth' +import { SETTINGS, SET_SETTINGS } from '@/fragments/users' import { useRouter } from 'next/router' -import Info from '../../components/info' +import Info from '@/components/info' import Link from 'next/link' -import AccordianItem from '../../components/accordian-item' +import AccordianItem from '@/components/accordian-item' import { bech32 } from 'bech32' -import { NOSTR_MAX_RELAY_NUM, NOSTR_PUBKEY_BECH32, DEFAULT_CROSSPOSTING_RELAYS } from '../../lib/nostr' -import { emailSchema, lastAuthRemovalSchema, settingsSchema } from '../../lib/validate' -import { SUPPORTED_CURRENCIES } from '../../lib/currency' -import PageLoading from '../../components/page-loading' -import { useShowModal } from '../../components/modal' -import { authErrorMessage } from '../../components/login' -import { NostrAuth } from '../../components/nostr-auth' -import { useToast } from '../../components/toast' -import { useLogger } from '../../components/logger' -import { useMe } from '../../components/me' -import { INVOICE_RETENTION_DAYS } from '../../lib/constants' +import { NOSTR_MAX_RELAY_NUM, NOSTR_PUBKEY_BECH32, DEFAULT_CROSSPOSTING_RELAYS } from '@/lib/nostr' +import { emailSchema, lastAuthRemovalSchema, settingsSchema } from '@/lib/validate' +import { SUPPORTED_CURRENCIES } from '@/lib/currency' +import PageLoading from '@/components/page-loading' +import { useShowModal } from '@/components/modal' +import { authErrorMessage } from '@/components/login' +import { NostrAuth } from '@/components/nostr-auth' +import { useToast } from '@/components/toast' +import { useLogger } from '@/components/logger' +import { useMe } from '@/components/me' +import { INVOICE_RETENTION_DAYS } from '@/lib/constants' import { OverlayTrigger, Tooltip } from 'react-bootstrap' -import DeleteIcon from '../../svgs/delete-bin-line.svg' +import DeleteIcon from '@/svgs/delete-bin-line.svg' export const getServerSideProps = getGetServerSideProps({ query: SETTINGS, authRequired: true }) diff --git a/pages/settings/wallets/index.js b/pages/settings/wallets/index.js index a9ffe44c..088d0dca 100644 --- a/pages/settings/wallets/index.js +++ b/pages/settings/wallets/index.js @@ -1,14 +1,14 @@ -import { getGetServerSideProps } from '../../../api/ssrApollo' -import Layout from '../../../components/layout' -import styles from '../../../styles/wallet.module.css' -import { WalletCard } from '../../../components/wallet-card' +import { getGetServerSideProps } from '@/api/ssrApollo' +import Layout from '@/components/layout' +import styles from '@/styles/wallet.module.css' +import { WalletCard } from '@/components/wallet-card' import { LightningAddressWalletCard } from './lightning-address' import { LNbitsCard } from './lnbits' import { NWCCard } from './nwc' import { LNDCard } from './lnd' -import { WALLETS } from '../../../fragments/wallet' +import { WALLETS } from '@/fragments/wallet' import { useQuery } from '@apollo/client' -import PageLoading from '../../../components/page-loading' +import PageLoading from '@/components/page-loading' export const getServerSideProps = getGetServerSideProps({ query: WALLETS, authRequired: true }) diff --git a/pages/settings/wallets/lightning-address.js b/pages/settings/wallets/lightning-address.js index d3301dfb..68d0f7b1 100644 --- a/pages/settings/wallets/lightning-address.js +++ b/pages/settings/wallets/lightning-address.js @@ -1,14 +1,14 @@ -import { getGetServerSideProps } from '../../../api/ssrApollo' -import { Form, Input } from '../../../components/form' -import { CenterLayout } from '../../../components/layout' -import { useMe } from '../../../components/me' -import { WalletButtonBar, WalletCard } from '../../../components/wallet-card' +import { getGetServerSideProps } from '@/api/ssrApollo' +import { Form, Input } from '@/components/form' +import { CenterLayout } from '@/components/layout' +import { useMe } from '@/components/me' +import { WalletButtonBar, WalletCard } from '@/components/wallet-card' import { useMutation } from '@apollo/client' -import { useToast } from '../../../components/toast' -import { lnAddrAutowithdrawSchema } from '../../../lib/validate' +import { useToast } from '@/components/toast' +import { lnAddrAutowithdrawSchema } from '@/lib/validate' import { useRouter } from 'next/router' -import { AutowithdrawSettings, autowithdrawInitial } from '../../../components/autowithdraw-shared' -import { REMOVE_WALLET, UPSERT_WALLET_LNADDR, WALLET_BY_TYPE } from '../../../fragments/wallet' +import { AutowithdrawSettings, autowithdrawInitial } from '@/components/autowithdraw-shared' +import { REMOVE_WALLET, UPSERT_WALLET_LNADDR, WALLET_BY_TYPE } from '@/fragments/wallet' const variables = { type: 'LIGHTNING_ADDRESS' } export const getServerSideProps = getGetServerSideProps({ query: WALLET_BY_TYPE, variables, authRequired: true }) diff --git a/pages/settings/wallets/lnbits.js b/pages/settings/wallets/lnbits.js index 8ad2adb2..c1fd3dc4 100644 --- a/pages/settings/wallets/lnbits.js +++ b/pages/settings/wallets/lnbits.js @@ -1,13 +1,13 @@ -import { getGetServerSideProps } from '../../../api/ssrApollo' -import { Form, ClientInput, ClientCheckbox } from '../../../components/form' -import { CenterLayout } from '../../../components/layout' -import { WalletButtonBar, WalletCard } from '../../../components/wallet-card' -import { lnbitsSchema } from '../../../lib/validate' -import { useToast } from '../../../components/toast' +import { getGetServerSideProps } from '@/api/ssrApollo' +import { Form, ClientInput, ClientCheckbox } from '@/components/form' +import { CenterLayout } from '@/components/layout' +import { WalletButtonBar, WalletCard } from '@/components/wallet-card' +import { lnbitsSchema } from '@/lib/validate' +import { useToast } from '@/components/toast' import { useRouter } from 'next/router' -import { useLNbits } from '../../../components/webln/lnbits' -import { WalletSecurityBanner } from '../../../components/banners' -import { useWebLNConfigurator } from '../../../components/webln' +import { useLNbits } from '@/components/webln/lnbits' +import { WalletSecurityBanner } from '@/components/banners' +import { useWebLNConfigurator } from '@/components/webln' export const getServerSideProps = getGetServerSideProps({ authRequired: true }) diff --git a/pages/settings/wallets/lnd.js b/pages/settings/wallets/lnd.js index 2c8be748..e1501fb3 100644 --- a/pages/settings/wallets/lnd.js +++ b/pages/settings/wallets/lnd.js @@ -1,16 +1,16 @@ -import { getGetServerSideProps } from '../../../api/ssrApollo' -import { Form, Input } from '../../../components/form' -import { CenterLayout } from '../../../components/layout' -import { useMe } from '../../../components/me' -import { WalletButtonBar, WalletCard } from '../../../components/wallet-card' +import { getGetServerSideProps } from '@/api/ssrApollo' +import { Form, Input } from '@/components/form' +import { CenterLayout } from '@/components/layout' +import { useMe } from '@/components/me' +import { WalletButtonBar, WalletCard } from '@/components/wallet-card' import { useMutation } from '@apollo/client' -import { useToast } from '../../../components/toast' -import { LNDAutowithdrawSchema } from '../../../lib/validate' +import { useToast } from '@/components/toast' +import { LNDAutowithdrawSchema } from '@/lib/validate' import { useRouter } from 'next/router' -import { AutowithdrawSettings, autowithdrawInitial } from '../../../components/autowithdraw-shared' -import { REMOVE_WALLET, UPSERT_WALLET_LND, WALLET_BY_TYPE } from '../../../fragments/wallet' -import Info from '../../../components/info' -import Text from '../../../components/text' +import { AutowithdrawSettings, autowithdrawInitial } from '@/components/autowithdraw-shared' +import { REMOVE_WALLET, UPSERT_WALLET_LND, WALLET_BY_TYPE } from '@/fragments/wallet' +import Info from '@/components/info' +import Text from '@/components/text' const variables = { type: 'LND' } export const getServerSideProps = getGetServerSideProps({ query: WALLET_BY_TYPE, variables, authRequired: true }) diff --git a/pages/settings/wallets/nwc.js b/pages/settings/wallets/nwc.js index 25e74b86..f0ff9617 100644 --- a/pages/settings/wallets/nwc.js +++ b/pages/settings/wallets/nwc.js @@ -1,13 +1,13 @@ -import { getGetServerSideProps } from '../../../api/ssrApollo' -import { Form, ClientInput, ClientCheckbox } from '../../../components/form' -import { CenterLayout } from '../../../components/layout' -import { WalletButtonBar, WalletCard } from '../../../components/wallet-card' -import { nwcSchema } from '../../../lib/validate' -import { useToast } from '../../../components/toast' +import { getGetServerSideProps } from '@/api/ssrApollo' +import { Form, ClientInput, ClientCheckbox } from '@/components/form' +import { CenterLayout } from '@/components/layout' +import { WalletButtonBar, WalletCard } from '@/components/wallet-card' +import { nwcSchema } from '@/lib/validate' +import { useToast } from '@/components/toast' import { useRouter } from 'next/router' -import { useNWC } from '../../../components/webln/nwc' -import { WalletSecurityBanner } from '../../../components/banners' -import { useWebLNConfigurator } from '../../../components/webln' +import { useNWC } from '@/components/webln/nwc' +import { WalletSecurityBanner } from '@/components/banners' +import { useWebLNConfigurator } from '@/components/webln' export const getServerSideProps = getGetServerSideProps({ authRequired: true }) diff --git a/pages/signup.js b/pages/signup.js index aef965ae..d9e0a118 100644 --- a/pages/signup.js +++ b/pages/signup.js @@ -1,6 +1,6 @@ import Link from 'next/link' -import { StaticLayout } from '../components/layout' -import Login from '../components/login' +import { StaticLayout } from '@/components/layout' +import Login from '@/components/login' export { getServerSideProps } from './login' function SignUpHeader () { diff --git a/pages/stackers/[when].js b/pages/stackers/[when].js index ed54a0fe..ebe3ec9b 100644 --- a/pages/stackers/[when].js +++ b/pages/stackers/[when].js @@ -1,20 +1,20 @@ import { gql, useQuery } from '@apollo/client' -import { getGetServerSideProps } from '../../api/ssrApollo' -import Layout from '../../components/layout' +import { getGetServerSideProps } from '@/api/ssrApollo' +import Layout from '@/components/layout' import Col from 'react-bootstrap/Col' import Row from 'react-bootstrap/Row' -import { UsageHeader } from '../../components/usage-header' +import { UsageHeader } from '@/components/usage-header' import { useRouter } from 'next/router' import dynamic from 'next/dynamic' -import PageLoading from '../../components/page-loading' +import PageLoading from '@/components/page-loading' -const WhenAreaChart = dynamic(() => import('../../components/charts').then(mod => mod.WhenAreaChart), { +const WhenAreaChart = dynamic(() => import('@/components/charts').then(mod => mod.WhenAreaChart), { loading: () =>
Loading...
}) -const WhenLineChart = dynamic(() => import('../../components/charts').then(mod => mod.WhenLineChart), { +const WhenLineChart = dynamic(() => import('@/components/charts').then(mod => mod.WhenLineChart), { loading: () =>
Loading...
}) -const WhenComposedChart = dynamic(() => import('../../components/charts').then(mod => mod.WhenComposedChart), { +const WhenComposedChart = dynamic(() => import('@/components/charts').then(mod => mod.WhenComposedChart), { loading: () =>
Loading...
}) diff --git a/pages/stackers/search.js b/pages/stackers/search.js index 97b26209..996264e1 100644 --- a/pages/stackers/search.js +++ b/pages/stackers/search.js @@ -1,7 +1,7 @@ -import { SearchLayout } from '../../components/layout' -import { getGetServerSideProps } from '../../api/ssrApollo' -import { USER_SEARCH } from '../../fragments/users' -import UserList from '../../components/user-list' +import { SearchLayout } from '@/components/layout' +import { getGetServerSideProps } from '@/api/ssrApollo' +import { USER_SEARCH } from '@/fragments/users' +import UserList from '@/components/user-list' import { useRouter } from 'next/router' const staticVariables = { limit: 21, similarity: 0.2 } diff --git a/pages/territory.js b/pages/territory.js index 3f5ae86e..11e3d419 100644 --- a/pages/territory.js +++ b/pages/territory.js @@ -1,7 +1,7 @@ import Link from 'next/link' -import { getGetServerSideProps } from '../api/ssrApollo' -import { CenterLayout } from '../components/layout' -import TerritoryForm from '../components/territory-form' +import { getGetServerSideProps } from '@/api/ssrApollo' +import { CenterLayout } from '@/components/layout' +import TerritoryForm from '@/components/territory-form' export const getServerSideProps = getGetServerSideProps({ authRequired: true }) diff --git a/pages/wallet.js b/pages/wallet.js index 7a71889a..6a292559 100644 --- a/pages/wallet.js +++ b/pages/wallet.js @@ -1,34 +1,34 @@ import { useRouter } from 'next/router' -import { Checkbox, Form, Input, InputUserSuggest, SubmitButton } from '../components/form' +import { Checkbox, Form, Input, InputUserSuggest, SubmitButton } from '@/components/form' import Link from 'next/link' import Button from 'react-bootstrap/Button' import { gql, useMutation, useQuery } from '@apollo/client' -import Qr, { QrSkeleton } from '../components/qr' -import { CenterLayout } from '../components/layout' +import Qr, { QrSkeleton } from '@/components/qr' +import { CenterLayout } from '@/components/layout' import InputGroup from 'react-bootstrap/InputGroup' import { WithdrawlSkeleton } from './withdrawals/[id]' -import { useMe } from '../components/me' +import { useMe } from '@/components/me' import { useEffect, useState } from 'react' import { requestProvider } from 'webln' import Alert from 'react-bootstrap/Alert' -import { CREATE_WITHDRAWL, SEND_TO_LNADDR } from '../fragments/wallet' -import { getGetServerSideProps } from '../api/ssrApollo' -import { amountSchema, lnAddrSchema, withdrawlSchema } from '../lib/validate' +import { CREATE_WITHDRAWL, SEND_TO_LNADDR } from '@/fragments/wallet' +import { getGetServerSideProps } from '@/api/ssrApollo' +import { amountSchema, lnAddrSchema, withdrawlSchema } from '@/lib/validate' import Nav from 'react-bootstrap/Nav' -import { BALANCE_LIMIT_MSATS, SSR } from '../lib/constants' -import { msatsToSats, numWithUnits } from '../lib/format' -import styles from '../components/user-header.module.css' -import HiddenWalletSummary from '../components/hidden-wallet-summary' -import AccordianItem from '../components/accordian-item' -import { lnAddrOptions } from '../lib/lnurl' -import useDebounceCallback from '../components/use-debounce-callback' +import { BALANCE_LIMIT_MSATS, SSR } from '@/lib/constants' +import { msatsToSats, numWithUnits } from '@/lib/format' +import styles from '@/components/user-header.module.css' +import HiddenWalletSummary from '@/components/hidden-wallet-summary' +import AccordianItem from '@/components/accordian-item' +import { lnAddrOptions } from '@/lib/lnurl' +import useDebounceCallback from '@/components/use-debounce-callback' import { QrScanner } from '@yudiel/react-qr-scanner' -import CameraIcon from '../svgs/camera-line.svg' -import { useShowModal } from '../components/modal' +import CameraIcon from '@/svgs/camera-line.svg' +import { useShowModal } from '@/components/modal' import { useField } from 'formik' -import { useToast } from '../components/toast' -import { WalletLimitBanner } from '../components/banners' -import Plug from '../svgs/plug.svg' +import { useToast } from '@/components/toast' +import { WalletLimitBanner } from '@/components/banners' +import Plug from '@/svgs/plug.svg' import { decode } from 'bolt11' export const getServerSideProps = getGetServerSideProps({ authRequired: true }) diff --git a/pages/withdrawals/[id].js b/pages/withdrawals/[id].js index 2bf58542..9dd28e9f 100644 --- a/pages/withdrawals/[id].js +++ b/pages/withdrawals/[id].js @@ -1,21 +1,21 @@ import { useQuery, useMutation } from '@apollo/client' -import { CenterLayout } from '../../components/layout' -import { CopyInput, Input, InputSkeleton } from '../../components/form' +import { CenterLayout } from '@/components/layout' +import { CopyInput, Input, InputSkeleton } from '@/components/form' import InputGroup from 'react-bootstrap/InputGroup' -import InvoiceStatus from '../../components/invoice-status' +import InvoiceStatus from '@/components/invoice-status' import { useRouter } from 'next/router' -import { WITHDRAWL } from '../../fragments/wallet' +import { WITHDRAWL } from '@/fragments/wallet' import Link from 'next/link' -import { SSR, INVOICE_RETENTION_DAYS } from '../../lib/constants' -import { numWithUnits } from '../../lib/format' -import Bolt11Info from '../../components/bolt11-info' -import { datePivot, timeLeft } from '../../lib/time' -import { useMe } from '../../components/me' -import { useToast } from '../../components/toast' +import { SSR, INVOICE_RETENTION_DAYS } from '@/lib/constants' +import { numWithUnits } from '@/lib/format' +import Bolt11Info from '@/components/bolt11-info' +import { datePivot, timeLeft } from '@/lib/time' +import { useMe } from '@/components/me' +import { useToast } from '@/components/toast' import { gql } from 'graphql-tag' -import { useShowModal } from '../../components/modal' -import { DeleteConfirm } from '../../components/delete' -import { getGetServerSideProps } from '../../api/ssrApollo' +import { useShowModal } from '@/components/modal' +import { DeleteConfirm } from '@/components/delete' +import { getGetServerSideProps } from '@/api/ssrApollo' // force SSR to include CSP nonces export const getServerSideProps = getGetServerSideProps({ query: null }) diff --git a/pages/~/edit.js b/pages/~/edit.js index c9b9ee1e..818b608e 100644 --- a/pages/~/edit.js +++ b/pages/~/edit.js @@ -1,11 +1,11 @@ -import { SUB } from '../../fragments/subs' -import { getGetServerSideProps } from '../../api/ssrApollo' -import { CenterLayout } from '../../components/layout' -import TerritoryForm from '../../components/territory-form' -import PageLoading from '../../components/page-loading' +import { SUB } from '@/fragments/subs' +import { getGetServerSideProps } from '@/api/ssrApollo' +import { CenterLayout } from '@/components/layout' +import TerritoryForm from '@/components/territory-form' +import PageLoading from '@/components/page-loading' import { useQuery } from '@apollo/client' import { useRouter } from 'next/router' -import TerritoryPaymentDue from '../../components/territory-payment-due' +import TerritoryPaymentDue from '@/components/territory-payment-due' export const getServerSideProps = getGetServerSideProps({ query: SUB, diff --git a/pages/~/index.js b/pages/~/index.js index 05c51e7a..351fada6 100644 --- a/pages/~/index.js +++ b/pages/~/index.js @@ -1,13 +1,13 @@ import { useRouter } from 'next/router' -import { getGetServerSideProps } from '../../api/ssrApollo' -import Items from '../../components/items' -import Layout from '../../components/layout' -import { SUB_FULL, SUB_ITEMS } from '../../fragments/subs' -import Snl from '../../components/snl' -import { MadnessBanner, WelcomeBanner } from '../../components/banners' +import { getGetServerSideProps } from '@/api/ssrApollo' +import Items from '@/components/items' +import Layout from '@/components/layout' +import { SUB_FULL, SUB_ITEMS } from '@/fragments/subs' +import Snl from '@/components/snl' +import { MadnessBanner, WelcomeBanner } from '@/components/banners' import { useQuery } from '@apollo/client' -import PageLoading from '../../components/page-loading' -import TerritoryHeader from '../../components/territory-header' +import PageLoading from '@/components/page-loading' +import TerritoryHeader from '@/components/territory-header' export const getServerSideProps = getGetServerSideProps({ query: SUB_ITEMS, diff --git a/pages/~/post.js b/pages/~/post.js index 1a4d2b55..967c276a 100644 --- a/pages/~/post.js +++ b/pages/~/post.js @@ -1,10 +1,10 @@ -import { getGetServerSideProps } from '../../api/ssrApollo' -import { SUB_FULL } from '../../fragments/subs' -import { CenterLayout } from '../../components/layout' -import Post from '../../components/post' +import { getGetServerSideProps } from '@/api/ssrApollo' +import { SUB_FULL } from '@/fragments/subs' +import { CenterLayout } from '@/components/layout' +import Post from '@/components/post' import { useQuery } from '@apollo/client' import { useRouter } from 'next/router' -import PageLoading from '../../components/page-loading' +import PageLoading from '@/components/page-loading' export const getServerSideProps = getGetServerSideProps({ query: SUB_FULL, diff --git a/pages/~/recent/[type].js b/pages/~/recent/[type].js index dac6fa87..3bf7f60f 100644 --- a/pages/~/recent/[type].js +++ b/pages/~/recent/[type].js @@ -1,12 +1,12 @@ -import Layout from '../../../components/layout' -import Items from '../../../components/items' -import { getGetServerSideProps } from '../../../api/ssrApollo' -import RecentHeader from '../../../components/recent-header' +import Layout from '@/components/layout' +import Items from '@/components/items' +import { getGetServerSideProps } from '@/api/ssrApollo' +import RecentHeader from '@/components/recent-header' import { useRouter } from 'next/router' -import { SUB_FULL, SUB_ITEMS } from '../../../fragments/subs' -import { COMMENT_TYPE_QUERY } from '../../../lib/constants' +import { SUB_FULL, SUB_ITEMS } from '@/fragments/subs' +import { COMMENT_TYPE_QUERY } from '@/lib/constants' import { useQuery } from '@apollo/client' -import PageLoading from '../../../components/page-loading' +import PageLoading from '@/components/page-loading' const staticVariables = { sort: 'recent' } const variablesFunc = vars => diff --git a/pages/~/rss.js b/pages/~/rss.js index 50073b58..f648404d 100644 --- a/pages/~/rss.js +++ b/pages/~/rss.js @@ -1,5 +1,5 @@ -import getGetRssServerSideProps from '../../lib/rss' -import { SUB_ITEMS } from '../../fragments/subs' +import getGetRssServerSideProps from '@/lib/rss' +import { SUB_ITEMS } from '@/fragments/subs' export default function RssFeed () { return null diff --git a/pages/~/search.js b/pages/~/search.js index 8f0f1d07..94a74ee4 100644 --- a/pages/~/search.js +++ b/pages/~/search.js @@ -1,8 +1,8 @@ -import { SearchLayout } from '../../components/layout' -import { getGetServerSideProps } from '../../api/ssrApollo' +import { SearchLayout } from '@/components/layout' +import { getGetServerSideProps } from '@/api/ssrApollo' import { useRouter } from 'next/router' -import { SUB_SEARCH } from '../../fragments/subs' -import Items from '../../components/items' +import { SUB_SEARCH } from '@/fragments/subs' +import Items from '@/components/items' import styles from './search.module.css' export const getServerSideProps = getGetServerSideProps({ diff --git a/pages/~/top/[type]/[when].js b/pages/~/top/[type]/[when].js index 79eed497..e591b22b 100644 --- a/pages/~/top/[type]/[when].js +++ b/pages/~/top/[type]/[when].js @@ -1,10 +1,10 @@ -import Layout from '../../../../components/layout' -import Items from '../../../../components/items' +import Layout from '@/components/layout' +import Items from '@/components/items' import { useRouter } from 'next/router' -import { getGetServerSideProps } from '../../../../api/ssrApollo' -import TopHeader from '../../../../components/top-header' -import { SUB_ITEMS } from '../../../../fragments/subs' -import { COMMENT_TYPE_QUERY } from '../../../../lib/constants' +import { getGetServerSideProps } from '@/api/ssrApollo' +import TopHeader from '@/components/top-header' +import { SUB_ITEMS } from '@/fragments/subs' +import { COMMENT_TYPE_QUERY } from '@/lib/constants' const staticVariables = { sort: 'top' } const variablesFunc = vars => { diff --git a/pages/~/top/cowboys.js b/pages/~/top/cowboys.js index c77b0ee6..daaecc9b 100644 --- a/pages/~/top/cowboys.js +++ b/pages/~/top/cowboys.js @@ -1,8 +1,8 @@ -import Layout from '../../../components/layout' -import { getGetServerSideProps } from '../../../api/ssrApollo' -import TopHeader from '../../../components/top-header' -import { TOP_COWBOYS } from '../../../fragments/users' -import UserList from '../../../components/user-list' +import Layout from '@/components/layout' +import { getGetServerSideProps } from '@/api/ssrApollo' +import TopHeader from '@/components/top-header' +import { TOP_COWBOYS } from '@/fragments/users' +import UserList from '@/components/user-list' export const getServerSideProps = getGetServerSideProps({ query: TOP_COWBOYS }) diff --git a/pages/~/top/stackers/[when].js b/pages/~/top/stackers/[when].js index 2bf8af43..d7f1a206 100644 --- a/pages/~/top/stackers/[when].js +++ b/pages/~/top/stackers/[when].js @@ -1,9 +1,9 @@ -import Layout from '../../../../components/layout' +import Layout from '@/components/layout' import { useRouter } from 'next/router' -import { getGetServerSideProps } from '../../../../api/ssrApollo' -import TopHeader from '../../../../components/top-header' -import { TOP_USERS } from '../../../../fragments/users' -import UserList from '../../../../components/user-list' +import { getGetServerSideProps } from '@/api/ssrApollo' +import TopHeader from '@/components/top-header' +import { TOP_USERS } from '@/fragments/users' +import UserList from '@/components/user-list' export const getServerSideProps = getGetServerSideProps({ query: TOP_USERS }) diff --git a/pages/~/top/territories/[when].js b/pages/~/top/territories/[when].js index 49f05f65..db02c732 100644 --- a/pages/~/top/territories/[when].js +++ b/pages/~/top/territories/[when].js @@ -1,9 +1,9 @@ -import Layout from '../../../../components/layout' +import Layout from '@/components/layout' import { useRouter } from 'next/router' -import { getGetServerSideProps } from '../../../../api/ssrApollo' -import TopHeader from '../../../../components/top-header' -import { TOP_SUBS } from '../../../../fragments/subs' -import TerritoryList from '../../../../components/territory-list' +import { getGetServerSideProps } from '@/api/ssrApollo' +import TopHeader from '@/components/top-header' +import { TOP_SUBS } from '@/fragments/subs' +import TerritoryList from '@/components/territory-list' export const getServerSideProps = getGetServerSideProps({ query: TOP_SUBS }) diff --git a/sw/eventListener.js b/sw/eventListener.js index a3d925df..5cb8b6a7 100644 --- a/sw/eventListener.js +++ b/sw/eventListener.js @@ -1,7 +1,7 @@ import ServiceWorkerStorage from 'serviceworker-storage' -import { numWithUnits } from '../lib/format' -import { CLEAR_NOTIFICATIONS, clearAppBadge, setAppBadge } from '../lib/badge' -import { ACTION_PORT, DELETE_SUBSCRIPTION, MESSAGE_PORT, STORE_OS, STORE_SUBSCRIPTION, SYNC_SUBSCRIPTION } from '../components/serviceworker' +import { numWithUnits } from '@/lib/format' +import { CLEAR_NOTIFICATIONS, clearAppBadge, setAppBadge } from '@/lib/badge' +import { ACTION_PORT, DELETE_SUBSCRIPTION, MESSAGE_PORT, STORE_OS, STORE_SUBSCRIPTION, SYNC_SUBSCRIPTION } from '@/components/serviceworker' // we store existing push subscriptions to keep them in sync with server const storage = new ServiceWorkerStorage('sw:storage', 1) diff --git a/worker/auction.js b/worker/auction.js index bbca3957..901c7859 100644 --- a/worker/auction.js +++ b/worker/auction.js @@ -1,4 +1,4 @@ -import serialize from '../api/resolvers/serial.js' +import serialize from '@/api/resolvers/serial.js' export async function auction ({ models }) { // get all items we need to check diff --git a/worker/autowithdraw.js b/worker/autowithdraw.js index 55010aef..c9d17b99 100644 --- a/worker/autowithdraw.js +++ b/worker/autowithdraw.js @@ -1,7 +1,7 @@ import { authenticatedLndGrpc, createInvoice } from 'ln-service' -import { msatsToSats, satsToMsats } from '../lib/format' -import { datePivot } from '../lib/time' -import { createWithdrawal, sendToLnAddr } from '../api/resolvers/wallet' +import { msatsToSats, satsToMsats } from '@/lib/format' +import { datePivot } from '@/lib/time' +import { createWithdrawal, sendToLnAddr } from '@/api/resolvers/wallet' export async function autoWithdraw ({ data: { id }, models, lnd }) { const user = await models.user.findUnique({ where: { id } }) diff --git a/worker/deleteUnusedImages.js b/worker/deleteUnusedImages.js index b7eef0b2..19133c8c 100644 --- a/worker/deleteUnusedImages.js +++ b/worker/deleteUnusedImages.js @@ -1,5 +1,5 @@ -import { deleteObjects } from '../api/s3' -import { ANON_USER_ID } from '../lib/constants' +import { deleteObjects } from '@/api/s3' +import { ANON_USER_ID } from '@/lib/constants' export async function deleteUnusedImages ({ models }) { // delete all images in database and S3 which weren't paid in the last 24 hours diff --git a/worker/earn.js b/worker/earn.js index f1bce310..12259f17 100644 --- a/worker/earn.js +++ b/worker/earn.js @@ -1,8 +1,8 @@ -import serialize from '../api/resolvers/serial.js' -import { notifyEarner } from '../lib/webPush.js' +import serialize from '@/api/resolvers/serial.js' +import { notifyEarner } from '@/lib/webPush.js' import { PrismaClient } from '@prisma/client' -import { proportions } from '../lib/madness.js' -import { SN_USER_IDS } from '../lib/constants.js' +import { proportions } from '@/lib/madness.js' +import { SN_USER_IDS } from '@/lib/constants.js' const TOTAL_UPPER_BOUND_MSATS = 10000000000 diff --git a/worker/ephemeralItems.js b/worker/ephemeralItems.js index d93aad63..7e1eca45 100644 --- a/worker/ephemeralItems.js +++ b/worker/ephemeralItems.js @@ -1,4 +1,4 @@ -import { deleteItemByAuthor } from '../lib/item.js' +import { deleteItemByAuthor } from '@/lib/item.js' export async function deleteItem ({ data: { id }, models }) { await deleteItemByAuthor({ models, id }) diff --git a/worker/imgproxy.js b/worker/imgproxy.js index c2d9438d..6f4691be 100644 --- a/worker/imgproxy.js +++ b/worker/imgproxy.js @@ -1,6 +1,6 @@ import { createHmac } from 'node:crypto' -import { extractUrls } from '../lib/md.js' -import { isJob } from '../lib/item.js' +import { extractUrls } from '@/lib/md.js' +import { isJob } from '@/lib/item.js' import path from 'node:path' const imgProxyEnabled = process.env.NODE_ENV === 'production' || diff --git a/worker/ofac.js b/worker/ofac.js index 30fe2efc..5040119f 100644 --- a/worker/ofac.js +++ b/worker/ofac.js @@ -2,7 +2,7 @@ import { createReadStream, createWriteStream, unlinkSync } from 'fs' import unzipper from 'unzipper' import csvParser from 'csv-parser' import stream from 'stream' -import { SANCTIONED_COUNTRY_CODES } from '../lib/constants.js' +import { SANCTIONED_COUNTRY_CODES } from '@/lib/constants.js' const IPV4_URL = 'https://ipapi.is/data/geolocationDatabaseIPv4.csv.zip' const IPV6_URL = 'https://ipapi.is/data/geolocationDatabaseIPv6.csv.zip' diff --git a/worker/search.js b/worker/search.js index fb0a4d5f..f059dd47 100644 --- a/worker/search.js +++ b/worker/search.js @@ -1,5 +1,5 @@ import { gql } from 'graphql-tag' -import search from '../api/search/index.js' +import search from '@/api/search/index.js' import removeMd from 'remove-markdown' const ITEM_SEARCH_FIELDS = gql` diff --git a/worker/streak.js b/worker/streak.js index 9027dd03..5db7a5a0 100644 --- a/worker/streak.js +++ b/worker/streak.js @@ -1,4 +1,4 @@ -import { notifyNewStreak, notifyStreakLost } from '../lib/webPush' +import { notifyNewStreak, notifyStreakLost } from '@/lib/webPush' const STREAK_THRESHOLD = 100 diff --git a/worker/territory.js b/worker/territory.js index b2533c1d..36deebe9 100644 --- a/worker/territory.js +++ b/worker/territory.js @@ -1,7 +1,7 @@ -import serialize from '../api/resolvers/serial' -import { paySubQueries } from '../api/resolvers/sub' -import { nextBillingWithGrace } from '../lib/territory' -import { datePivot } from '../lib/time' +import serialize from '@/api/resolvers/serial' +import { paySubQueries } from '@/api/resolvers/sub' +import { nextBillingWithGrace } from '@/lib/territory' +import { datePivot } from '@/lib/time' export async function territoryBilling ({ data: { subName }, boss, models }) { const sub = await models.sub.findUnique({ diff --git a/worker/trust.js b/worker/trust.js index 9f9a8d1a..44c85f3d 100644 --- a/worker/trust.js +++ b/worker/trust.js @@ -1,5 +1,5 @@ import * as math from 'mathjs' -import { ANON_USER_ID, SN_USER_IDS } from '../lib/constants.js' +import { ANON_USER_ID, SN_USER_IDS } from '@/lib/constants.js' export async function trust ({ boss, models }) { try { diff --git a/worker/wallet.js b/worker/wallet.js index a848c12b..8242202b 100644 --- a/worker/wallet.js +++ b/worker/wallet.js @@ -1,11 +1,11 @@ -import serialize from '../api/resolvers/serial.js' +import serialize from '@/api/resolvers/serial.js' import { getInvoice, getPayment, cancelHodlInvoice, deletePayment, subscribeToInvoices, subscribeToPayments, subscribeToInvoice } from 'ln-service' -import { notifyDeposit } from '../lib/webPush' -import { INVOICE_RETENTION_DAYS } from '../lib/constants' -import { datePivot, sleep } from '../lib/time.js' +import { notifyDeposit } from '@/lib/webPush' +import { INVOICE_RETENTION_DAYS } from '@/lib/constants' +import { datePivot, sleep } from '@/lib/time.js' import retry from 'async-retry' export async function subscribeToWallet (args) {