@rpg-engine/long-bow 0.7.91 → 0.7.92
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/CraftBook/CraftingTooltip.d.ts +13 -0
- package/dist/components/CraftBook/components/CraftBookHeader.d.ts +9 -0
- package/dist/components/CraftBook/components/CraftBookPagination.d.ts +0 -0
- package/dist/components/CraftBook/components/CraftBookSearch.d.ts +0 -0
- package/dist/components/CraftBook/hooks/useCraftBookFilters.d.ts +9 -0
- package/dist/components/CraftBook/hooks/useFilteredItems.d.ts +9 -0
- package/dist/components/CraftBook/hooks/usePagination.d.ts +13 -0
- package/dist/components/CraftBook/hooks/useResponsiveSize.d.ts +6 -0
- package/dist/components/CraftBook/utils/modifyString.d.ts +1 -0
- package/dist/components/shared/Pagination/Pagination.d.ts +9 -0
- package/dist/components/shared/SearchBar/SearchBar.d.ts +10 -0
- package/dist/hooks/useLocalStorage.d.ts +1 -0
- package/dist/long-bow.cjs.development.js +448 -293
- package/dist/long-bow.cjs.development.js.map +1 -1
- package/dist/long-bow.cjs.production.min.js +1 -1
- package/dist/long-bow.cjs.production.min.js.map +1 -1
- package/dist/long-bow.esm.js +448 -294
- package/dist/long-bow.esm.js.map +1 -1
- package/dist/stories/Features/craftbook/CraftBook.stories.d.ts +2 -0
- package/package.json +1 -1
- package/src/components/CraftBook/CraftBook.tsx +281 -138
- package/src/components/CraftBook/CraftingRecipe.tsx +97 -97
- package/src/components/CraftBook/CraftingTooltip.tsx +137 -0
- package/src/components/CraftBook/components/CraftBookHeader.tsx +81 -0
- package/src/components/CraftBook/components/CraftBookPagination.tsx +1 -0
- package/src/components/CraftBook/components/CraftBookSearch.tsx +1 -0
- package/src/components/CraftBook/hooks/useCraftBookFilters.ts +39 -0
- package/src/components/CraftBook/hooks/useFilteredItems.ts +39 -0
- package/src/components/CraftBook/hooks/usePagination.ts +39 -0
- package/src/components/CraftBook/hooks/useResponsiveSize.ts +50 -0
- package/src/components/CraftBook/utils/modifyString.ts +11 -0
- package/src/components/shared/Pagination/Pagination.tsx +69 -0
- package/src/components/shared/SearchBar/SearchBar.tsx +52 -0
- package/src/hooks/useLocalStorage.ts +44 -0
- package/src/stories/Features/craftbook/CraftBook.stories.tsx +41 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"long-bow.cjs.production.min.js","sources":["../src/components/Button.tsx","../src/components/Arrow/SelectArrow.tsx","../src/components/AsyncDropdown.tsx","../src/components/RPGUI/RPGUIContainer.tsx","../src/constants/uiFonts.ts","../src/components/shared/SpriteFromAtlas.tsx","../src/components/Item/Inventory/ErrorBoundary.tsx","../src/components/shared/Ellipsis.tsx","../src/components/PropertySelect/PropertySelect.tsx","../src/components/Character/CharacterSelection.tsx","../src/components/Chat/Chat.tsx","../src/constants/uiColors.ts","../src/components/Input.tsx","../src/components/shared/Column.tsx","../src/components/Chatdeprecated/ChatDeprecated.tsx","../src/components/ChatRevamp/SearchCharacter.tsx","../src/components/ChatRevamp/ChatContent.tsx","../src/components/ChatRevamp/ChatTabs.tsx","../src/components/ChatRevamp/ExpandButton.tsx","../src/components/ChatRevamp/RecentChats.tsx","../src/components/ChatRevamp/ChatRevamp.tsx","../src/components/Shortcuts/SingleShortcut.ts","../src/components/Shortcuts/useShortcutCooldown.ts","../src/components/CircularController/CircularController.tsx","../src/hooks/useOutsideAlerter.ts","../src/components/NPCDialog/NPCDialog.tsx","../src/components/DraggableContainer.tsx","../src/components/InputRadio.tsx","../src/libs/itemCounter.ts","../src/components/Abstractions/ModalPortal.tsx","../src/components/Item/Inventory/ItemSlotRarity.ts","../src/components/Item/Inventory/ItemGem.tsx","../src/components/Item/Inventory/ItemSlotQty/ItemSlotQty.tsx","../src/components/Item/Inventory/ItemSlotRenderer.tsx","../src/components/Item/Inventory/itemContainerHelper.ts","../src/components/Item/Inventory/context/ItemSlotDetailsContext.tsx","../src/components/Item/Inventory/context/ItemSlotDraggingContext.tsx","../src/components/Item/Inventory/ItemSlot.tsx","../src/hooks/useTouchTarget.ts","../src/components/Item/Cards/ItemInfo.tsx","../src/components/Item/Cards/ItemInfoDisplay.tsx","../src/components/Item/Cards/ItemTooltip.tsx","../src/components/Item/Cards/MobileItemTooltip.tsx","../src/components/Item/Cards/ItemInfoWrapper.tsx","../src/components/CraftBook/CraftingRecipe.tsx","../src/components/CraftBook/CraftBook.tsx","../src/components/Dropdown.tsx","../src/components/DropdownSelectorContainer.tsx","../src/components/Item/Inventory/DraggedItem.tsx","../src/hooks/useCursorPosition.ts","../src/components/RelativeListMenu.tsx","../src/components/Item/Inventory/ItemSlotTooltips.tsx","../src/components/Equipment/EquipmentSet.tsx","../src/components/Table/Table.tsx","../src/components/Friends/SearchFriend.tsx","../src/components/Friends/FriendList.tsx","../src/constants/uiDevices.ts","../src/components/typography/DynamicText.tsx","../src/components/NPCDialog/NPCDialogText.tsx","../src/libs/StringHelpers.ts","../src/hooks/useEventListener.ts","../src/components/NPCDialog/QuestionDialog/QuestionDialog.tsx","../src/components/NPCDialog/NPCMultiDialog.tsx","../src/components/RangeSlider.tsx","../src/components/HistoryDialog.tsx","../src/components/ImageCarousel/ImageCarousel.tsx","../src/components/ImageCarousel/SimpleImageCarousel.tsx","../src/components/InternalTabs/InternalTabs.tsx","../src/components/Abstractions/SlotsContainer.tsx","../src/components/Shortcuts/ShortcutsSetter.tsx","../src/components/Marketplace/filters/index.tsx","../src/components/QuantitySelector/QuantitySelector.tsx","../src/components/QuantitySelector/QuantitySelectorModal.tsx","../src/components/Item/Inventory/ItemQuantitySelectorModal.tsx","../src/components/Item/Inventory/ItemContainer.tsx","../src/hooks/useScrollOnDrag.ts","../src/components/itemSelector/ItemSelector.tsx","../src/components/Leaderboard/LeaderboardTable.tsx","../src/components/Leaderboard/Leaderboard.tsx","../src/components/ListMenu.tsx","../src/components/Pager.tsx","../src/components/ConfirmModal.tsx","../src/components/Marketplace/MarketplaceRows.tsx","../src/components/Multitab/TabsContainer.tsx","../src/components/Marketplace/BuyPanel.tsx","../src/components/Marketplace/ManagmentPanel.tsx","../src/components/Marketplace/Marketplace.tsx","../src/components/Multitab/TabBody.tsx","../src/components/Multitab/Tab.tsx","../src/components/PartySystem/PartyCreate/PartyCreate.tsx","../src/components/PartySystem/PartyDashboard/PartyRows.tsx","../src/components/PartySystem/PartyDashboard/PartyDashboard.tsx","../src/components/PartySystem/PartyInvite/PlayersRows.tsx","../src/components/PartySystem/PartyInvite/PartyInvite.tsx","../src/components/Text/HighlightedText.tsx","../src/components/PartySystem/PartyManager/PartyManagerRows.tsx","../src/components/PartySystem/PartyManager/PartyManager.tsx","../src/components/PartySystem/mockedConstantes/mockedValues.tsx","../src/components/ProgressBar.tsx","../src/components/Quests/QuestInfo/QuestInfo.tsx","../src/components/Quests/QuestList.tsx","../src/components/RPGUI/RPGUIScrollbar.tsx","../src/components/RPGUI/RPGUIOverrides.tsx","../src/components/RPGUI/RPGUIRoot.tsx","../src/components/Shortcuts/Shortcuts.tsx","../src/components/SimpleProgressBar.tsx","../src/components/Tooltip/Tooltip.tsx","../src/components/SkillProgressBar.tsx","../src/components/SkillsContainer.tsx","../src/components/Spellbook/cards/SpellInfo.tsx","../src/libs/CastingTypeHelper.ts","../src/components/Spellbook/cards/SpellInfoDisplay.tsx","../src/components/Spellbook/cards/MobileSpellTooltip.tsx","../src/components/Spellbook/cards/SpellTooltip.tsx","../src/components/Spellbook/cards/SpellInfoWrapper.tsx","../src/components/Spellbook/Spell.tsx","../src/components/Spellbook/Spellbook.tsx","../src/components/Stepper.tsx","../src/components/TimeWidget/DayNightPeriod/DayNightPeriod.tsx","../src/components/TimeWidget/TimeWidget.tsx","../src/components/TradingMenu/PremiumLabel.tsx","../src/components/TradingMenu/TradingItemRow.tsx","../src/components/TradingMenu/TradingMenu.tsx","../src/components/Truncate.tsx","../src/components/Image/ZoomableImage.tsx","../src/components/Tutorial/TutorialStepper.tsx","../src/hooks/useChat.ts","../src/components/CheckButton.tsx","../src/components/CheckItem.tsx","../src/components/CraftBook/utils/calculateMaxCraftable.ts","../src/components/RadioButton.tsx","../src/components/TextArea.tsx","../src/components/TradingMenu/useTradingGold.ts"],"sourcesContent":["import React from 'react';\nimport styled from 'styled-components';\nimport { uiFonts } from '../constants/uiFonts';\n\nexport enum ButtonTypes {\n RPGUIButton = 'rpgui-button',\n RPGUIGoldButton = 'rpgui-button golden',\n}\n\nexport interface IButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n disabled?: boolean;\n children: React.ReactNode;\n buttonType: ButtonTypes;\n onPointerDown?: (e: any) => void;\n}\n\nexport const Button = ({\n disabled = false,\n children,\n buttonType,\n onPointerDown,\n ...props\n}: IButtonProps) => {\n return (\n <ButtonContainer\n className={`${buttonType}`}\n disabled={disabled}\n {...props}\n onPointerDown={onPointerDown}\n >\n <p>{children}</p>\n </ButtonContainer>\n );\n};\n\nconst ButtonContainer = styled.button`\n height: 45px;\n font-size: ${uiFonts.size.small};\n`;\n","import React from 'react';\nimport styled from 'styled-components';\nimport LeftArrowClickIcon from './img/arrow01-left-clicked.png';\nimport LeftArrowIcon from './img/arrow01-left.png';\nimport RightArrowClickIcon from './img/arrow01-right-clicked.png';\nimport RightArrowIcon from './img/arrow01-right.png';\n\nexport interface ArrowBarProps extends React.HTMLAttributes<HTMLDivElement> {\n direction: 'right' | 'left';\n onPointerDown: () => void;\n size?: number;\n scale?: number;\n}\n\nexport const SelectArrow: React.FC<ArrowBarProps> = ({\n direction = 'left',\n size,\n scale = 1,\n onPointerDown,\n ...props\n}) => {\n return (\n <>\n {direction === 'left' ? (\n <LeftArrow\n size={size}\n scale={scale}\n onPointerDown={() => onPointerDown()}\n {...props}\n ></LeftArrow>\n ) : (\n <RightArrow\n size={size}\n scale={scale}\n onPointerDown={() => onPointerDown()}\n {...props}\n ></RightArrow>\n )}\n </>\n );\n};\n\ninterface IArrowProps {\n size?: number;\n scale?: number;\n}\n\nconst LeftArrow = styled.span<IArrowProps>`\n background-image: url(${LeftArrowIcon});\n background-size: 100% 100%;\n left: 0;\n position: absolute;\n width: ${props => props.size || 40}px;\n height: ${props => props.size || 42}px;\n transform: scale(${props => props.scale || 1});\n :active {\n background-image: url(${LeftArrowClickIcon});\n }\n z-index: 2;\n`;\n\nconst RightArrow = styled.span<IArrowProps>`\n background-image: url(${RightArrowIcon});\n right: 0;\n position: absolute;\n width: ${props => props.size || 40}px;\n height: ${props => props.size || 42}px;\n background-size: 100% 100%;\n transform: scale(${props => props.scale || 1});\n :active {\n background-image: url(${RightArrowClickIcon});\n }\n z-index: 2;\n`;\n\nexport default SelectArrow;\n","import React, { useEffect, useState } from 'react';\nimport { BeatLoader } from 'react-spinners';\nimport styled from 'styled-components';\nimport { v4 as uuidv4 } from 'uuid';\nimport { uiColors } from '../constants/uiColors';\n\nexport interface IAsyncDropdownOptionsProps {\n id: number;\n value: string;\n option: string | JSX.Element;\n}\n\nexport interface IAsyncDropdownProps {\n options: IAsyncDropdownOptionsProps[];\n width?: string;\n onChange: (value: string) => void;\n defaultValue?: string;\n opensUp?: boolean;\n}\n\nexport const AsyncDropdown: React.FC<IAsyncDropdownProps> = ({\n options,\n width,\n onChange,\n defaultValue,\n opensUp = false,\n}) => {\n const dropdownId = uuidv4();\n\n const [selectedValue, setSelectedValue] = useState<string>(\n defaultValue || options?.[0]?.value\n );\n const [selectedOption, setSelectedOption] = useState<string | JSX.Element>(\n options?.find(option => option.value === defaultValue)?.option ||\n options?.[0]?.option\n );\n const [opened, setOpened] = useState<boolean>(false);\n\n useEffect(() => {\n if (defaultValue) {\n setSelectedValue(defaultValue);\n setSelectedOption(\n //@ts-ignore\n options?.find(option => option.value === defaultValue)?.option\n );\n } else if (options?.length > 0) {\n setSelectedValue(options[0].value);\n setSelectedOption(options[0].option);\n }\n }, [options, defaultValue]);\n\n const handleSelection = (value: string, option: string | JSX.Element) => {\n if (value !== selectedValue) {\n setSelectedValue(value);\n setSelectedOption(option);\n onChange(value);\n }\n };\n\n return (\n <Container onMouseLeave={() => setOpened(false)} width={width}>\n <DropdownSelect\n id={`dropdown-${dropdownId}`}\n className=\"rpgui-dropdown-imp rpgui-dropdown-imp-header\"\n onPointerUp={() => setOpened(prev => !prev)}\n >\n <DropdownDisplay>\n <DropdownLabel>▼</DropdownLabel> {selectedOption}\n {!options.length && <BeatLoader size={4} color={uiColors.white} />}\n </DropdownDisplay>\n </DropdownSelect>\n\n <DropdownOptions\n className=\"rpgui-dropdown-imp\"\n opened={opened}\n opensUp={opensUp}\n >\n {options?.map(option => (\n <li\n key={option.id}\n onPointerUp={() => {\n handleSelection(option.value, option.option);\n setOpened(false);\n }}\n >\n {option.option}\n </li>\n ))}\n </DropdownOptions>\n </Container>\n );\n};\n\nconst DropdownDisplay = styled.span`\n display: flex;\n flex-wrap: wrap;\n justify-content: start;\n align-items: center;\n`;\n\nconst DropdownLabel = styled.label`\n margin-right: 0.5rem;\n`;\n\nconst Container = styled.div<{ width: string | undefined }>`\n position: relative;\n width: ${props => props.width || '100%'};\n`;\n\nconst DropdownSelect = styled.p`\n width: 100%;\n box-sizing: border-box;\n\n label {\n display: inline-block;\n transform: translateY(-2px);\n }\n`;\n\nconst DropdownOptions = styled.ul<{\n opened: boolean;\n opensUp: boolean;\n}>`\n position: absolute;\n width: 100%;\n max-height: 300px;\n overflow-y: auto;\n display: ${props => (props.opened ? 'block' : 'none')};\n box-sizing: border-box;\n bottom: ${props => (props.opensUp ? '100%' : 'auto')};\n top: ${props => (props.opensUp ? 'auto' : '100%')};\n margin: 0;\n padding: 0;\n\n @media (max-width: 768px) {\n padding: 8px 0;\n }\n`;\n","import React from 'react';\nimport styled from 'styled-components';\n\nexport enum RPGUIContainerTypes {\n Framed = 'framed',\n FramedGold = 'framed-golden',\n FramedGold2 = 'framed-golden-2',\n FramedGrey = 'framed-grey',\n}\nexport interface IRPGUIContainerProps {\n type: RPGUIContainerTypes;\n children: React.ReactNode;\n width?: string;\n height?: string;\n className?: string;\n}\n\nexport const RPGUIContainer: React.FC<IRPGUIContainerProps> = ({\n children,\n type,\n width = '50%',\n height,\n className,\n}) => {\n return (\n <Container\n width={width}\n height={height || 'auto'}\n className={`rpgui-container ${type} ${className}`}\n >\n {children}\n </Container>\n );\n};\n\ninterface IContainerProps {\n width: string;\n height: string;\n}\n\nconst Container = styled.div<IContainerProps>`\n height: ${props => props.height};\n width: ${({ width }) => width};\n display: flex;\n flex-wrap: wrap;\n image-rendering: pixelated;\n`;\n","export const uiFonts = {\n size: {\n xxsmall: '8px',\n xsmall: '9px',\n small: '12px',\n medium: '14px',\n large: '16px',\n xLarge: '18px',\n xxLarge: '20px',\n xxxLarge: '24px',\n },\n};\n","import { GRID_HEIGHT, GRID_WIDTH } from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\n\ninterface IProps {\n atlasJSON: any;\n atlasIMG: any;\n spriteKey: string;\n width?: number;\n height?: number;\n grayScale?: boolean;\n opacity?: number;\n onPointerDown?: () => void;\n containerStyle?: any;\n imgStyle?: any;\n imgScale?: number;\n imgClassname?: string;\n centered?: boolean;\n borderRadius?: string;\n}\n\nexport const SpriteFromAtlas: React.FC<IProps> = ({\n atlasJSON,\n atlasIMG,\n spriteKey,\n width = GRID_WIDTH,\n height = GRID_HEIGHT,\n imgScale = 2,\n imgStyle,\n onPointerDown,\n containerStyle,\n grayScale = false,\n opacity = 1,\n imgClassname,\n centered,\n borderRadius,\n}) => {\n //! If an item is not showing, remember that you MUST run yarn atlas:copy everytime you add a new item to the atlas (it will sync our public folder atlas with src/atlas).\n //!Due to React's limitations, we cannot import it from the public folder directly!\n\n const spriteData =\n atlasJSON?.frames?.[spriteKey] ||\n atlasJSON?.frames?.['others/no-image.png'];\n\n if (!spriteData) {\n console.error(\n `SpriteFromAtlas: Could not find sprite with key ${spriteKey} in atlasJSON.`\n );\n return null;\n }\n\n return (\n <Container\n width={width}\n height={height}\n hasHover={grayScale}\n onPointerDown={onPointerDown}\n style={containerStyle}\n >\n <ImgSprite\n className={`sprite-from-atlas-img ${imgClassname || ''}`}\n atlasIMG={atlasIMG}\n frame={spriteData.frame}\n scale={imgScale}\n grayScale={grayScale}\n opacity={opacity}\n style={imgStyle}\n centered={centered}\n borderRadius={borderRadius}\n />\n </Container>\n );\n};\n\ninterface IImgSpriteProps {\n atlasIMG: any;\n frame: {\n x: number;\n y: number;\n w: number;\n h: number;\n };\n scale: number;\n grayScale: boolean;\n opacity: number;\n centered?: boolean;\n borderRadius?: string;\n}\n\ninterface IContainerProps {\n width: number;\n height: number;\n hasHover: boolean;\n}\n\nconst Container = styled.div`\n width: ${(props: IContainerProps) => props.width}px;\n height: ${(props: IContainerProps) => props.height}px;\n ${(props: IContainerProps) =>\n !props.hasHover\n ? `&:hover {\n filter: sepia(100%) saturate(300%) brightness(70%) hue-rotate(180deg);\n }`\n : ``}\n`;\n\nconst ImgSprite = styled.div<IImgSpriteProps>`\n width: ${props => props.frame.w}px;\n height: ${props => props.frame.h}px;\n background-image: url(${props => props.atlasIMG});\n background-position: -${props => props.frame.x}px -${props => props.frame.y}px;\n transform: scale(${props => props.scale});\n position: relative;\n top: ${props => (props.centered ? '0' : '8px')};\n left: ${props => (props.centered ? '0' : '8px')};\n filter: ${props => (props.grayScale ? 'grayscale(100%)' : 'none')};\n opacity: ${props => props.opacity};\n border-radius: ${props => (props.borderRadius ? props.borderRadius : '0')};\n`;\n","import React, { Component, ErrorInfo, ReactNode } from 'react';\nimport atlasJSON from '../../../mocks/atlas/items/items.json';\nimport atlasIMG from '../../../mocks/atlas/items/items.png';\nimport { SpriteFromAtlas } from '../../shared/SpriteFromAtlas';\n\ninterface Props {\n children?: ReactNode;\n}\n\ninterface State {\n hasError: boolean;\n}\n\nexport class ErrorBoundary extends Component<Props, State> {\n public state: State = {\n hasError: false,\n };\n\n public static getDerivedStateFromError(_: Error): State {\n // Update state so the next render will show the fallback UI.\n return { hasError: true };\n }\n\n public componentDidCatch(error: Error, errorInfo: ErrorInfo) {\n console.error('Uncaught error:', error, errorInfo);\n }\n\n public render() {\n if (this.state.hasError) {\n return (\n <SpriteFromAtlas\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={'others/no-image.png'}\n imgScale={3}\n />\n );\n }\n\n return this.props.children;\n }\n}\n","import React from 'react';\nimport styled from 'styled-components';\n\ninterface IProps {\n children: React.ReactNode;\n maxLines?: 1 | 2 | 3;\n maxWidth: string;\n fontSize?: string;\n center?: boolean;\n}\n\nexport const Ellipsis = ({\n children,\n maxLines = 1,\n maxWidth,\n fontSize,\n center,\n}: IProps) => {\n return (\n <Container maxWidth={maxWidth} fontSize={fontSize} center={center}>\n <span className={`ellipsis-${maxLines}-lines`}>{children}</span>\n </Container>\n );\n};\n\ninterface IContainerProps {\n maxWidth?: string;\n fontSize?: string;\n center?: boolean;\n}\n\nconst Container = styled.span<IContainerProps>`\n display: block;\n margin: 0;\n\n .ellipsis-1-lines {\n display: block;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n max-width: ${props => props.maxWidth};\n font-size: ${props => props.fontSize};\n\n ${props => props.center && `margin: 0 auto;`}\n }\n\n .ellipsis-2-lines {\n display: block;\n display: -webkit-box;\n max-width: ${props => props.maxWidth}px;\n\n height: 25px;\n margin: 0 auto;\n line-height: 1;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n text-overflow: ellipsis;\n overflow: hidden;\n font-size: ${props => props.fontSize};\n }\n\n .ellipsis-3-lines {\n display: block;\n display: -webkit-box;\n max-width: ${props => props.maxWidth}px;\n\n height: 43px;\n margin: 0 auto;\n line-height: 1;\n -webkit-line-clamp: 3;\n -webkit-box-orient: vertical;\n text-overflow: ellipsis;\n overflow: hidden;\n font-size: ${props => props.fontSize};\n }\n`;\n","import React, { useEffect, useState } from 'react';\nimport styled from 'styled-components';\nimport { uiFonts } from '../../constants/uiFonts';\nimport SelectArrow from '../Arrow/SelectArrow';\nimport { Ellipsis } from '../shared/Ellipsis';\n\nexport interface IPropertySelectProps {\n availableProperties: Array<IPropertiesProps>;\n selectedProperty?: IPropertiesProps;\n children?: React.ReactNode;\n onChange: (selectedProperty: IPropertiesProps) => void;\n}\n\nexport interface IPropertiesProps {\n id: string;\n name: string;\n}\n\nexport const PropertySelect: React.FC<IPropertySelectProps> = ({\n availableProperties,\n onChange,\n}) => {\n const [currentIndex, setCurrentIndex] = useState(0);\n const propertiesLength = availableProperties.length - 1;\n\n const onLeftClick = () => {\n if (currentIndex === 0) setCurrentIndex(propertiesLength);\n else setCurrentIndex(index => index - 1);\n };\n const onRightClick = () => {\n if (currentIndex === propertiesLength) setCurrentIndex(0);\n else setCurrentIndex(index => index + 1);\n };\n\n useEffect(() => {\n onChange(availableProperties[currentIndex]);\n }, [currentIndex]);\n\n useEffect(() => {\n setCurrentIndex(0);\n }, [JSON.stringify(availableProperties)]);\n\n const getCurrentSelectionName = () => {\n const item = availableProperties[currentIndex];\n if (item) {\n return item.name;\n }\n return '';\n };\n\n return (\n <Container>\n <TextOverlay>\n <p>\n <Item>\n <Ellipsis maxLines={1} maxWidth=\"60%\" center>\n {getCurrentSelectionName()}\n </Ellipsis>\n </Item>\n </p>\n </TextOverlay>\n <div className=\"rpgui-progress-track\"></div>\n\n <SelectArrow direction=\"left\" onPointerDown={onLeftClick}></SelectArrow>\n <SelectArrow direction=\"right\" onPointerDown={onRightClick}></SelectArrow>\n </Container>\n );\n};\n\nconst Item = styled.span`\n font-size: 1rem;\n color: white;\n text-align: center;\n z-index: 1;\n position: absolute;\n top: 12px;\n width: 100%;\n\n p {\n margin: 0 auto;\n font-size: ${uiFonts.size.small};\n }\n`;\n\nconst TextOverlay = styled.div`\n width: 100%;\n position: relative;\n`;\n\ninterface IContainerProps {\n percentageWidth?: number;\n minWidth?: number;\n style?: Record<string, any>;\n}\n\nconst Container = styled.div<IContainerProps>`\n position: relative;\n display: flex;\n flex-direction: column;\n justify-content: start;\n align-items: flex-start;\n min-width: 100px;\n width: 40%;\n`;\n\nexport default PropertySelect;\n","import React, { useEffect, useState } from 'react';\nimport styled from 'styled-components';\n\nimport { SpriteFromAtlas } from '../shared/SpriteFromAtlas';\n\nimport { ErrorBoundary } from '../Item/Inventory/ErrorBoundary';\nimport PropertySelect, {\n IPropertiesProps,\n} from '../PropertySelect/PropertySelect';\n\nexport interface ICharacterProps {\n name: string;\n textureKey: string;\n}\n\nexport interface ICharacterSelectionProps {\n availableCharacters: ICharacterProps[];\n atlasJSON: any;\n atlasIMG: any;\n onChange: (textureKey: string) => void;\n}\n\nexport const CharacterSelection: React.FC<ICharacterSelectionProps> = ({\n availableCharacters,\n atlasJSON,\n atlasIMG,\n onChange,\n}) => {\n const propertySelectValues = availableCharacters.map((item) => {\n return {\n id: item.textureKey,\n name: item.name,\n };\n });\n\n const [selectedValue, setSelectedValue] = useState<IPropertiesProps>();\n const [selectedSpriteKey, setSelectedSpriteKey] = useState('');\n\n const onSelectedValueChange = () => {\n const textureKey = selectedValue ? selectedValue.id : '';\n const spriteKey = textureKey ? textureKey + '/down/standing/0.png' : '';\n\n if (spriteKey === selectedSpriteKey) {\n return;\n }\n\n setSelectedSpriteKey(spriteKey);\n onChange(textureKey);\n };\n\n useEffect(() => {\n onSelectedValueChange();\n }, [selectedValue]);\n\n useEffect(() => {\n setSelectedValue(propertySelectValues[0]);\n }, [availableCharacters]);\n\n return (\n <Container>\n {selectedSpriteKey && atlasIMG && atlasJSON && (\n <ErrorBoundary>\n <SpriteFromAtlas\n spriteKey={selectedSpriteKey}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n imgScale={4}\n height={80}\n width={64}\n containerStyle={{\n display: 'flex',\n alignItems: 'center',\n paddingBottom: '15px',\n }}\n imgStyle={{\n left: '22px',\n }}\n />\n </ErrorBoundary>\n )}\n <PropertySelect\n availableProperties={propertySelectValues}\n onChange={(value) => {\n setSelectedValue(value);\n }}\n />\n </Container>\n );\n};\n\nconst Container = styled.div`\n display: flex;\n flex-direction: column;\n align-items: center;\n image-rendering: pixelated;\n`;\n\nexport default CharacterSelection;\n","import dayjs from 'dayjs';\nimport React, { useEffect, useRef, useState } from 'react';\nimport { ErrorBoundary } from 'react-error-boundary';\nimport { FaTimes } from 'react-icons/fa';\nimport styled from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\nimport { ChatMessage } from '../ChatRevamp/types';\n\nexport interface IStyles {\n textColor?: string;\n buttonColor?: string;\n buttonBackgroundColor?: string;\n width?: string;\n height?: string;\n}\n\nexport interface IEmitter {\n _id: string;\n name: string;\n}\n\nexport interface IChatProps {\n chatMessages: ChatMessage[];\n onSendChatMessage: (message: string) => void;\n onCloseButton: () => void;\n onFocus?: () => void;\n onBlur?: () => void;\n opacity?: number;\n sendMessage: boolean;\n styles?: IStyles;\n isExpanded: boolean;\n}\n\nexport const Chat: React.FC<IChatProps> = ({\n chatMessages,\n onSendChatMessage,\n onCloseButton,\n onFocus,\n onBlur,\n styles = {\n textColor: '#ff6600',\n buttonColor: '#ff6600',\n buttonBackgroundColor: '#333',\n width: '100%',\n height: '100%',\n },\n isExpanded,\n}) => {\n const [message, setMessage] = useState('');\n const inputRef = useRef<HTMLInputElement>(null);\n\n useEffect(() => {\n if (isExpanded) {\n scrollChatToBottom();\n }\n inputRef.current?.focus();\n }, [chatMessages, isExpanded]);\n\n const scrollChatToBottom = () => {\n const scrollingElement = document.querySelector('.chat-body');\n if (scrollingElement) {\n scrollingElement.scrollTop = scrollingElement.scrollHeight;\n }\n };\n\n const handleSubmit = (event: React.FormEvent<HTMLFormElement>) => {\n event.preventDefault();\n if (!message.trim()) return;\n onSendChatMessage(message);\n setMessage('');\n };\n\n const truncateName = (name: string, maxLength: number = 10) => {\n return name.length > maxLength ? name.slice(0, maxLength) + '...' : name;\n };\n\n const formatMessage = (chatMessage: ChatMessage) => {\n const timestamp = dayjs(chatMessage.createdAt).format('HH:mm');\n const truncatedName = truncateName(chatMessage.emitter.name);\n return `${timestamp} ${truncatedName}: ${chatMessage.message}`;\n };\n\n return (\n <ChatContainer\n width={styles.width || 'auto'}\n height={styles.height || 'auto'}\n isExpanded={isExpanded}\n >\n {isExpanded && (\n <ErrorBoundary fallback={<p>Oops! Your chat has crashed.</p>}>\n <CloseButton onClick={onCloseButton}>\n <FaTimes />\n </CloseButton>\n <MessagesContainer className=\"chat-body\">\n {chatMessages.map((chatMessage, index) => (\n <Message\n color={styles.textColor || uiColors.yellow}\n key={`${chatMessage._id}_${index}`}\n >\n {formatMessage(chatMessage)}\n </Message>\n ))}\n </MessagesContainer>\n </ErrorBoundary>\n )}\n <Form onSubmit={handleSubmit} isExpanded={isExpanded}>\n <TextField\n ref={inputRef}\n value={message}\n onChange={e => setMessage(e.target.value)}\n type=\"text\"\n autoComplete=\"off\"\n onFocus={onFocus}\n onBlur={onBlur}\n onPointerDown={onFocus}\n placeholder=\"Type your message...\"\n />\n <SendButton type=\"submit\" disabled={!message.trim()}>\n ▶\n </SendButton>\n </Form>\n </ChatContainer>\n );\n};\n\ninterface IContainerProps {\n width: string;\n height: string;\n}\n\ninterface IMessageProps {\n color: string;\n}\n\nconst ChatContainer = styled.div<IContainerProps & { isExpanded: boolean }>`\n width: ${props => props.width};\n height: ${props => (props.isExpanded ? props.height : 'auto')};\n background-color: rgba(30, 30, 30, 0.3);\n display: flex;\n flex-direction: column;\n position: relative;\n border-radius: 8px;\n border: 1px solid rgba(0, 0, 0, 0.1);\n overflow: hidden;\n`;\n\nconst CloseButton = styled.button`\n position: absolute;\n top: 8px;\n right: 8px;\n background-color: transparent;\n border: none;\n color: white;\n font-size: 16px;\n cursor: pointer;\n z-index: 1;\n`;\n\nconst MessagesContainer = styled.div`\n flex-grow: 1;\n overflow-y: auto;\n padding: 12px;\n margin-bottom: 8px;\n\n scrollbar-width: thin;\n scrollbar-color: rgba(51, 51, 51, 0.4) rgba(30, 30, 30, 0.4);\n\n &::-webkit-scrollbar {\n width: 6px;\n }\n\n &::-webkit-scrollbar-track {\n background: rgba(30, 30, 30, 0.4);\n }\n\n &::-webkit-scrollbar-thumb {\n background-color: rgba(51, 51, 51, 0.4);\n border-radius: 3px;\n }\n`;\n\nconst Message = styled.div<IMessageProps>`\n margin-bottom: 6px;\n color: ${({ color }) => color};\n font-family: 'Press Start 2P', cursive;\n font-size: 0.7rem;\n line-height: 1.4;\n word-break: break-word;\n`;\n\nconst Form = styled.form<{ isExpanded: boolean }>`\n display: flex;\n padding: 8px;\n background-color: rgba(42, 42, 42, 0.4);\n border-radius: ${props => (props.isExpanded ? '0' : '8px')};\n`;\n\nconst TextField = styled.input`\n flex-grow: 1;\n background-color: rgba(26, 26, 26, 0.6);\n color: #ff6600;\n border: 1px solid rgba(51, 51, 51, 0.6);\n border-radius: 4px;\n padding: 8px;\n margin-right: 8px;\n font-family: 'Press Start 2P', cursive;\n font-size: 0.7rem;\n height: 32px;\n transition: border-color 0.3s, background-color 0.3s;\n\n &::placeholder {\n color: rgba(255, 255, 255, 0.5);\n font-size: 0.6rem;\n }\n\n &:focus {\n outline: none;\n border-color: #ff6600;\n background-color: rgba(42, 42, 42, 0.9);\n }\n`;\n\nconst SendButton = styled.button`\n background-color: transparent;\n color: #ff6600;\n border: none;\n padding: 8px 12px;\n font-size: 14px;\n cursor: pointer;\n transition: opacity 0.3s ease;\n\n &:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n`;\n","export const uiColors = {\n lightGray: '#888',\n gray: '#4E4A4E',\n darkGray: '#3e3e3e',\n darkYellow: '#FFC857',\n yellow: '#FFFF00',\n orange: '#D27D2C',\n cardinal: '#C5283D',\n red: '#D04648',\n darkRed: '#442434',\n raisinBlack: '#191923',\n navyBlue: '#0E79B2',\n purple: '#6833A3',\n darkPurple: '#522761',\n blue: '#597DCE',\n darkBlue: '#30346D',\n brown: '#854C30',\n lightGreen: '#66cd1c',\n brownGreen: '#346524',\n white: '#fff'\n};\n","import React from 'react';\n\nexport interface IInputProps\n extends React.DetailedHTMLProps<\n React.InputHTMLAttributes<HTMLInputElement>,\n HTMLInputElement\n > {\n innerRef?: React.Ref<HTMLInputElement>;\n}\n\nexport const Input: React.FC<IInputProps> = ({ ...props }) => {\n const { innerRef, ...rest } = props;\n\n return <input {...rest} ref={props.innerRef} />;\n};\n","import styled from 'styled-components';\n\ninterface IColumn {\n flex?: number;\n alignItems?: string;\n justifyContent?: string;\n flexWrap?: string;\n}\n\nexport const Column = styled.div<IColumn>`\n flex: ${props => props.flex || 'auto'};\n display: flex;\n flex-wrap: ${props => props.flexWrap || 'nowrap'};\n align-items: ${props => props.alignItems || 'flex-start'};\n justify-content: ${props => props.justifyContent || 'flex-start'};\n`;\n","import { ILocalChatMessage } from '@rpg-engine/shared';\nimport dayjs from 'dayjs';\nimport React, { useEffect, useState } from 'react';\nimport { ErrorBoundary } from 'react-error-boundary';\nimport styled from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\nimport { uiFonts } from '../../constants/uiFonts';\nimport { Button, ButtonTypes } from '../Button';\nimport { Input } from '../Input';\nimport { RPGUIContainer, RPGUIContainerTypes } from '../RPGUI/RPGUIContainer';\nimport { Column } from '../shared/Column';\n\ninterface IEmitter {\n _id: string;\n name: string;\n}\nexport interface IChatDeprecatedProps {\n chatMessages: ILocalChatMessage[];\n onSendChatMessage: (message: string) => void;\n onCloseButton: () => void;\n onFocus?: () => void;\n onBlur?: () => void;\n opacity?: number;\n width?: string;\n height?: string;\n}\n\nexport const ChatDeprecated: React.FC<IChatDeprecatedProps> = ({\n chatMessages,\n onSendChatMessage,\n opacity = 1,\n width = '100%',\n height = '250px',\n onCloseButton,\n onFocus,\n onBlur,\n}) => {\n const [message, setMessage] = useState('');\n\n useEffect(() => {\n scrollChatToBottom();\n }, []);\n\n useEffect(() => {\n scrollChatToBottom();\n }, [chatMessages]);\n\n const scrollChatToBottom = () => {\n const scrollingElement = document.querySelector('.chat-body');\n if (scrollingElement) {\n scrollingElement.scrollTop = scrollingElement.scrollHeight;\n }\n };\n\n const handleSubmit = (event: React.SyntheticEvent<HTMLFormElement>) => {\n event.preventDefault();\n onSendChatMessage(message);\n setMessage('');\n };\n const getInputValue = (value: string) => {\n setMessage(value);\n };\n\n const onRenderMessageLines = (\n emitter: IEmitter,\n createdAt: string | undefined,\n message: string\n ) => {\n return `${dayjs(createdAt || new Date()).format('HH:mm')} ${\n emitter?.name ? `${emitter.name}: ` : 'Unknown: '\n } ${message}`;\n };\n\n const onRenderChatMessages = (chatMessages: ILocalChatMessage[]) => {\n return chatMessages?.length ? (\n chatMessages?.map(({ _id, createdAt, emitter, message }, index) => (\n <MessageText key={`${_id}_${index}`}>\n {onRenderMessageLines(emitter, createdAt as string, message)}\n </MessageText>\n ))\n ) : (\n <MessageText>No messages available.</MessageText>\n );\n };\n\n return (\n <Container>\n <CustomContainer\n type={RPGUIContainerTypes.FramedGrey}\n width={width}\n height={height}\n className=\"chat-container\"\n opacity={opacity}\n >\n <ErrorBoundary fallback={<p>Oops! Your chat has crashed.</p>}>\n {onCloseButton && (\n <CloseButton onPointerDown={onCloseButton}>X</CloseButton>\n )}\n <RPGUIContainer\n type={RPGUIContainerTypes.FramedGrey}\n width={'100%'}\n height={'80%'}\n className=\"chat-body dark-background\"\n >\n {onRenderChatMessages(chatMessages)}\n </RPGUIContainer>\n\n <Form onSubmit={handleSubmit}>\n <Column flex={70}>\n <CustomInput\n value={message}\n id=\"inputMessage\"\n onChange={e => getInputValue(e.target.value)}\n height={20}\n className=\"chat-input dark-background\"\n type=\"text\"\n autoComplete=\"off\"\n onFocus={onFocus}\n onBlur={onBlur}\n />\n </Column>\n <Column justifyContent=\"flex-end\">\n <Button\n buttonType={ButtonTypes.RPGUIButton}\n id=\"chat-send-button\"\n >\n Send\n </Button>\n </Column>\n </Form>\n </ErrorBoundary>\n </CustomContainer>\n </Container>\n );\n};\n\nconst Container = styled.div`\n position: relative;\n`;\n\nconst CloseButton = styled.div`\n position: absolute;\n top: 2px;\n right: 0px;\n color: white;\n z-index: 22;\n font-size: 0.7rem;\n`;\n\nconst CustomInput = styled(Input)`\n height: 30px;\n width: 100%;\n\n .rpgui-content .input {\n min-height: 39px;\n }\n`;\n\ninterface ICustomContainerProps {\n opacity: number;\n}\n\nconst CustomContainer = styled(RPGUIContainer)`\n display: block;\n\n opacity: ${(props: ICustomContainerProps) => props.opacity};\n\n &:hover {\n opacity: 1;\n }\n\n .dark-background {\n background-color: ${uiColors.darkGray} !important;\n }\n\n .chat-body {\n &.rpgui-container.framed-grey {\n background: unset;\n }\n max-height: 170px;\n overflow-y: auto;\n }\n`;\n\nconst Form = styled.form`\n display: flex;\n width: 100%;\n justify-content: center;\n align-items: center;\n`;\n\nconst MessageText = styled.p`\n display: block !important;\n width: 100%;\n font-size: ${uiFonts.size.xsmall} !important;\n overflow-y: auto;\n margin: 0;\n`;\n","import React, { useEffect, useRef, useState } from 'react';\nimport { RxMagnifyingGlass } from 'react-icons/rx';\nimport styled from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\nimport { uiFonts } from '../../constants/uiFonts';\nimport { IStyles } from '../Chat/Chat';\nimport { Column } from '../shared/Column';\nimport { Ellipsis } from '../shared/Ellipsis';\nimport { PrivateChatCharacter } from './types';\n\ninterface ISearchCharacterProps {\n onFocus?: () => void;\n onBlur?: () => void;\n onChangeCharacterName: (characterName: string) => void;\n styles?: IStyles;\n recentCharacters?: PrivateChatCharacter[];\n onCharacterClick?: (character: PrivateChatCharacter) => void;\n hideSearchCharacterUI: () => void;\n}\n\nexport const SearchCharacter = ({\n onChangeCharacterName,\n onBlur,\n onFocus,\n recentCharacters,\n hideSearchCharacterUI,\n onCharacterClick,\n styles = {\n textColor: '#c65102',\n buttonColor: '#005b96',\n buttonBackgroundColor: 'rgba(0,0,0,.2)',\n width: '80%',\n height: 'auto',\n },\n}: ISearchCharacterProps) => {\n const [characterName, setCharacterName] = useState('');\n const searchCharacterRef = useRef<HTMLInputElement>(null);\n\n useEffect(() => {\n const timer = setTimeout(() => {\n if (searchCharacterRef.current) {\n searchCharacterRef.current.focus();\n }\n }, 100);\n\n return () => clearTimeout(timer);\n }, []);\n\n const handleSubmit = (event: React.SyntheticEvent<HTMLFormElement>) => {\n event.preventDefault();\n if (!characterName || characterName.trim() === '') return;\n onChangeCharacterName(characterName);\n };\n\n const handleCharacterClick = (character: PrivateChatCharacter) => {\n if (!onCharacterClick) return;\n setCharacterName('');\n onCharacterClick(character);\n hideSearchCharacterUI();\n };\n\n return (\n <SearchContainer>\n <Form onSubmit={handleSubmit}>\n <Column flex={70}>\n <TextField\n value={characterName}\n ref={searchCharacterRef}\n id=\"characterName\"\n name=\"characterName\"\n onChange={e => {\n setCharacterName(e.target.value);\n onChangeCharacterName(e.target.value);\n }}\n placeholder=\"Search for a character...\"\n height={20}\n type=\"text\"\n autoComplete=\"off\"\n onFocus={onFocus}\n onBlur={onBlur}\n onPointerDown={onFocus}\n />\n </Column>\n <Column justifyContent=\"flex-end\">\n <SearchButton\n type=\"submit\"\n buttonColor={styles?.buttonColor || '#005b96'}\n buttonBackgroundColor={\n styles?.buttonBackgroundColor || 'rgba(0,0,0,.5)'\n }\n id=\"chat-send-button\"\n style={{ borderRadius: '20%' }}\n >\n <RxMagnifyingGlass size={15} />\n </SearchButton>\n </Column>\n </Form>\n\n {recentCharacters && recentCharacters.length > 0 && (\n <ListContainer>\n {recentCharacters.map(character => (\n <ListElement\n onPointerDown={() => handleCharacterClick(character)}\n key={character._id}\n >\n <Ellipsis maxWidth=\"150px\" maxLines={1}>\n {character.name}\n </Ellipsis>\n </ListElement>\n ))}\n </ListContainer>\n )}\n </SearchContainer>\n );\n};\n\ninterface IButtonProps {\n buttonColor: string;\n buttonBackgroundColor: string;\n}\n\nconst SearchContainer = styled.div`\n width: 100%;\n`;\n\nconst Form = styled.form`\n display: flex;\n width: 100%;\n justify-content: center;\n align-items: center;\n`;\n\nconst TextField = styled.input`\n width: 100%;\n background-color: rgba(0, 0, 0, 0.25) !important;\n border: none !important;\n max-height: 28px !important;\n`;\n\nconst SearchButton = styled.button<IButtonProps>`\n color: ${({ buttonColor }) => buttonColor};\n background-color: ${({ buttonBackgroundColor }) => buttonBackgroundColor};\n width: 28px;\n height: 28px;\n border: none !important;\n`;\n\nconst ListContainer = styled.ul`\n border: none;\n overflow-y: scroll;\n list-style: none;\n padding: 0;\n`;\n\nconst ListElement = styled.li`\n margin: 0.5rem 0 !important;\n font-size: ${uiFonts.size.small};\n padding: 0.5rem 2px;\n\n &:hover {\n color: #ff0;\n background-color: ${uiColors.darkGray};\n }\n\n button {\n all: unset;\n }\n`;\n","import React from 'react';\nimport styled from 'styled-components';\nimport { Chat, IStyles } from '../Chat/Chat';\nimport { SearchCharacter } from './SearchCharacter';\nimport { ChatMessage, PrivateChatCharacter } from './types';\n\ninterface ChatContentProps {\n isPrivate: boolean;\n isTrade: boolean;\n isGlobal: boolean;\n searchCharacterUI: boolean;\n chatMessages: ChatMessage[];\n onSendGlobalChatMessage: (message: string) => void;\n onSendLocalChatMessage: (message: string) => void;\n onSendPrivateChatMessage: (message: string) => void;\n onSendTradeMessage: (message: string) => void;\n onCloseButton: () => void;\n styles?: IStyles;\n onFocus?: () => void;\n onBlur?: () => void;\n isExpanded: boolean;\n autoCloseOnSend: boolean;\n onChangeCharacterName: (characterName: string) => void;\n privateChatCharacters?: PrivateChatCharacter[];\n hideSearchCharacterUI: () => void;\n onCharacterClick?: (character: PrivateChatCharacter) => void;\n isGuild: boolean;\n onSendGuildChatMessage: (message: string) => void;\n}\n\nexport const ChatContent: React.FC<ChatContentProps> = ({\n isPrivate,\n isTrade,\n isGlobal,\n searchCharacterUI,\n chatMessages,\n onSendLocalChatMessage,\n onSendGlobalChatMessage,\n onSendPrivateChatMessage,\n onSendTradeMessage,\n onCloseButton,\n styles,\n onFocus,\n onBlur,\n isExpanded,\n autoCloseOnSend,\n onChangeCharacterName,\n privateChatCharacters,\n hideSearchCharacterUI,\n onCharacterClick,\n isGuild,\n onSendGuildChatMessage,\n}) => {\n const handleSendMessage = (message: string) => {\n if (autoCloseOnSend) {\n onCloseButton();\n }\n\n if (isPrivate) {\n onSendPrivateChatMessage(message);\n } else if (isTrade) {\n onSendTradeMessage(message);\n } else if (isGuild) {\n onSendGuildChatMessage(message);\n } else if (isGlobal) {\n onSendGlobalChatMessage(message);\n } else {\n onSendLocalChatMessage(message);\n }\n };\n\n if (isPrivate && searchCharacterUI) {\n return (\n <SearchCharacter\n onFocus={onFocus}\n onBlur={onBlur}\n onChangeCharacterName={onChangeCharacterName}\n styles={styles}\n recentCharacters={privateChatCharacters}\n hideSearchCharacterUI={hideSearchCharacterUI}\n onCharacterClick={onCharacterClick}\n />\n );\n }\n\n return (\n <ChatWrapper>\n <Chat\n chatMessages={chatMessages}\n onSendChatMessage={handleSendMessage}\n sendMessage={true}\n onCloseButton={onCloseButton}\n styles={styles}\n onFocus={onFocus}\n onBlur={onBlur}\n isExpanded={isExpanded}\n />\n </ChatWrapper>\n );\n};\n\nconst ChatWrapper = styled.div`\n flex-grow: 1;\n overflow: hidden;\n display: flex;\n flex-direction: column;\n position: relative;\n`;\n","import React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\n\ninterface ChatTabsProps {\n tabs: { label: string; id: string }[];\n activeTab: string;\n onChangeTab: (tabId: string) => void;\n}\n\nexport const ChatTabs: React.FC<ChatTabsProps> = ({\n tabs,\n activeTab,\n onChangeTab,\n}) => (\n <TabContainer>\n {tabs.map((tab, index) => (\n <Tab\n key={`${tab.label}_${index}`}\n active={tab.id === activeTab}\n onPointerDown={() => onChangeTab(tab.id)}\n >\n {tab.label}\n </Tab>\n ))}\n </TabContainer>\n);\n\nconst TabContainer = styled.div`\n display: flex;\n gap: 10px;\n align-items: center;\n flex-grow: 1;\n`;\n\nconst Tab = styled.button<{ active: boolean }>`\n width: 120px;\n color: white;\n font-size: 0.8rem;\n all: unset;\n padding: 0.6rem;\n font-size: 0.8rem;\n border-radius: 5px 5px 0 0;\n border-width: 0.25rem 0.25rem 0 0.25rem;\n border-style: solid;\n border-color: ${props =>\n props.active ? 'rgba(198, 81, 2, 0.5)' : 'rgba(128, 128, 128, 0.5)'};\n background-color: ${props =>\n props.active ? uiColors.orange : 'rgba(0, 0, 0, 0.2)'};\n color: ${props => (props.active ? 'white' : uiColors.darkGray)};\n`;\n","import React from 'react';\nimport { IoMdContract, IoMdExpand } from 'react-icons/io';\nimport styled from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\n\ninterface ExpandButtonProps {\n isExpanded: boolean;\n onClick: () => void;\n}\n\nexport const ExpandButton: React.FC<ExpandButtonProps> = ({\n isExpanded,\n onClick,\n}) => (\n <StyledExpandButton isExpanded={isExpanded} onClick={onClick}>\n {isExpanded ? <IoMdContract size={20} /> : <IoMdExpand size={20} />}\n </StyledExpandButton>\n);\n\nconst StyledExpandButton = styled.button<{ isExpanded: boolean }>`\n position: absolute;\n top: 0;\n ${({ isExpanded }) => (isExpanded ? 'right: 0' : 'left: 0.5rem')};\n width: 30px;\n height: 30px;\n background-color: ${uiColors.orange};\n color: white;\n border: none;\n border-radius: 50%;\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n transition: all 0.3s ease;\n z-index: 10;\n\n &:hover {\n background-color: ${uiColors.orange};\n }\n`;\n","import React from 'react';\nimport { RxCross2, RxMagnifyingGlass } from 'react-icons/rx';\nimport styled from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\nimport { uiFonts } from '../../constants/uiFonts';\nimport { Ellipsis } from '../shared/Ellipsis';\nimport { PrivateChatCharacter } from './types';\n\ninterface IRecentChatsProps {\n showRecentChats: boolean;\n toggleRecentChats: () => void;\n hasUnseenMessages: boolean;\n showSearchCharacterUI: () => void;\n recentChatCharacters?: PrivateChatCharacter[];\n recentSelectedChatCharacterId?: string;\n unseenMessageCharacterIds?: string[];\n onPreviousChatCharacterClick: (character: PrivateChatCharacter) => void;\n onRemoveRecentChatCharacter?: (character: PrivateChatCharacter) => void;\n isPrivate: boolean;\n hideSearchCharacterUI: () => void; // Add this line\n}\n\nexport const RecentChats: React.FC<IRecentChatsProps> = ({\n showRecentChats,\n toggleRecentChats,\n hasUnseenMessages,\n showSearchCharacterUI,\n recentChatCharacters,\n recentSelectedChatCharacterId,\n unseenMessageCharacterIds,\n onPreviousChatCharacterClick,\n onRemoveRecentChatCharacter,\n isPrivate,\n hideSearchCharacterUI, // Add this line\n}) => {\n const handlePreviousChatCharacterClick = (\n character: PrivateChatCharacter\n ) => {\n onPreviousChatCharacterClick(character);\n hideSearchCharacterUI(); // Call hideSearchCharacterUI here\n };\n\n return (\n <RecentChatTabContainer isOpen={showRecentChats} isPrivate={isPrivate}>\n <RecentChatTopBar>\n <BurgerIconContainer\n onPointerDown={toggleRecentChats}\n hasUnseenMessages={hasUnseenMessages}\n >\n <BurgerLineIcon />\n <BurgerLineIcon />\n <BurgerLineIcon />\n </BurgerIconContainer>\n {showRecentChats && (\n <SearchButton onPointerDown={showSearchCharacterUI}>\n <RxMagnifyingGlass size={16} color={uiColors.white} />\n </SearchButton>\n )}\n </RecentChatTopBar>\n <RecentChatLogContainer isOpen={showRecentChats}>\n {recentChatCharacters?.map(character => (\n <ListElementContainer key={character._id}>\n <ListElement\n active={character._id === recentSelectedChatCharacterId}\n onPointerDown={() => handlePreviousChatCharacterClick(character)}\n >\n <StatusDot\n isUnseen={\n unseenMessageCharacterIds?.includes(character._id) ?? false\n }\n />\n <Ellipsis maxWidth=\"140px\" maxLines={1}>\n {character.name}\n </Ellipsis>\n </ListElement>\n <CloseButton\n className=\"close-button\"\n onPointerDown={() => onRemoveRecentChatCharacter?.(character)}\n >\n <RxCross2 size={16} />\n </CloseButton>\n </ListElementContainer>\n ))}\n </RecentChatLogContainer>\n </RecentChatTabContainer>\n );\n};\n\nconst RecentChatTabContainer = styled.div<{\n isPrivate: boolean;\n isOpen: boolean;\n}>`\n display: ${props => (props.isPrivate ? 'flex' : 'none')};\n flex-direction: column;\n border-right: 1px solid ${uiColors.gray};\n outline: none;\n width: ${props => (props.isOpen ? '25%' : '30px')};\n max-width: 200px;\n min-width: ${props => (props.isOpen ? '180px' : '30px')};\n transition: all 0.3s ease-in-out;\n overflow: hidden;\n height: 100%;\n @media (max-width: 768px) {\n width: ${props => (props.isOpen ? '50%' : '30px')};\n min-width: ${props => (props.isOpen ? '150px' : '30px')};\n }\n`;\n\nconst RecentChatTopBar = styled.div`\n display: flex;\n align-items: center;\n justify-content: space-between;\n height: 30px;\n flex-shrink: 0;\n`;\n\nconst SearchButton = styled.button`\n border: none;\n background-color: transparent;\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n gap: 2px;\n padding: 4px;\n position: relative;\n`;\n\nconst BurgerIconContainer = styled.button<{ hasUnseenMessages: boolean }>`\n border: none;\n background-color: transparent;\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n padding: 4px;\n gap: 2px;\n position: relative;\n\n &:after {\n content: '';\n width: 6px;\n height: 6px;\n position: absolute;\n top: 0;\n right: 2px;\n border-radius: 50%;\n background-color: ${uiColors.lightGreen};\n display: ${props => (props.hasUnseenMessages ? 'block' : 'none')};\n }\n`;\n\nconst BurgerLineIcon = styled.span`\n width: 1rem;\n height: 2px;\n background-color: #ffffff;\n`;\n\nconst RecentChatLogContainer = styled.div<{ isOpen: boolean }>`\n display: ${props => (props.isOpen ? 'flex' : 'none')};\n opacity: ${props => (props.isOpen ? 1 : 0)};\n flex-direction: column;\n gap: 0.25rem; // Reduce this from 0.5rem to 0.25rem\n transition: opacity 0.3s ease-in-out;\n padding: 0;\n margin: 0;\n overflow-y: auto;\n flex-grow: 1;\n height: 0;\n\n /* Firefox */\n scrollbar-width: thin;\n scrollbar-color: rgba(51, 51, 51, 0.4) rgba(30, 30, 30, 0.4);\n\n /* WebKit and Chromium-based browsers */\n &::-webkit-scrollbar {\n width: 8px;\n height: 8px;\n }\n\n &::-webkit-scrollbar-track {\n background: rgba(30, 30, 30, 0.2);\n border-radius: 4px;\n }\n\n &::-webkit-scrollbar-thumb {\n background-color: rgba(255, 102, 0, 0.5);\n border-radius: 4px;\n border: 2px solid rgba(30, 30, 30, 0.2);\n }\n\n &::-webkit-scrollbar-thumb:hover {\n background-color: rgba(255, 102, 0, 0.7);\n }\n`;\n\nconst ListElementContainer = styled.div`\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 2px 0; // Add small vertical padding\n`;\n\nconst ListElement = styled.button<{ active: boolean }>`\n margin: 0 !important; // Remove vertical margins\n font-size: ${uiFonts.size.small} !important;\n padding: 2px;\n all: unset;\n color: ${props => (props.active ? uiColors.yellow : uiColors.white)};\n width: 100%;\n position: relative;\n display: flex;\n align-items: center;\n gap: 4px;\n\n &:hover {\n color: #ff0;\n }\n max-width: calc(100% - 24px);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n`;\n\nconst StatusDot = styled.span<{ isUnseen: boolean }>`\n width: 6px;\n height: 6px;\n border-radius: 50%;\n background-color: ${props =>\n props.isUnseen ? uiColors.lightGreen : uiColors.gray};\n display: inline-block;\n margin-right: 6px;\n`;\n\nconst CloseButton = styled.button`\n all: unset;\n font-size: ${uiFonts.size.xxsmall};\n margin: 0 0.5rem;\n transition: all 0.2s ease-in-out;\n background-color: ${uiColors.red};\n color: ${uiColors.white};\n width: 16px;\n height: 16px;\n border-radius: 50%;\n display: flex;\n justify-content: center;\n align-items: center;\n &:hover {\n background-color: ${uiColors.white};\n color: ${uiColors.red};\n }\n`;\n","import React from 'react';\nimport styled from 'styled-components';\nimport { useChat } from '../../hooks/useChat';\nimport { Chat } from '../Chat/Chat';\nimport { ChatContent } from './ChatContent';\nimport { ChatTabs } from './ChatTabs';\nimport { ExpandButton } from './ExpandButton';\nimport { RecentChats } from './RecentChats';\nimport { IChatRevampProps } from './types';\n\nexport const ChatRevamp = ({\n chatMessages,\n onSendGlobalChatMessage,\n onSendGuildChatMessage, // Add this new prop\n onChangeCharacterName,\n onFocus,\n onBlur,\n onCloseButton,\n styles,\n tabs,\n onChangeTab,\n activeTab = 'global',\n privateChatCharacters,\n onCharacterClick,\n onSendPrivateChatMessage,\n recentChatCharacters,\n recentSelectedChatCharacterId,\n onPreviousChatCharacterClick,\n onRemoveRecentChatCharacter,\n unseenMessageCharacterIds,\n onSendTradeMessage,\n searchCharacterUI,\n hideSearchCharacterUI,\n showSearchCharacterUI,\n minimizedByDefault = false,\n autoCloseOnSend,\n onSendLocalChatMessage,\n}: IChatRevampProps) => {\n const isPrivate = activeTab === 'private';\n const isTrade = activeTab === 'trade';\n const isGuild = activeTab === 'guild';\n const isGlobal = activeTab === 'global';\n const chatHook = useChat({\n minimizedByDefault,\n isPrivate,\n onChangeTab,\n onPreviousChatCharacterClick,\n unseenMessageCharacterIds,\n });\n\n return (\n <ChatRevampContainer>\n <TopBar isExpanded={chatHook.isExpanded}>\n {chatHook.isExpanded && (\n <ChatTabs\n tabs={tabs}\n activeTab={activeTab}\n onChangeTab={chatHook.handleTabChange}\n />\n )}\n <ExpandButton\n isExpanded={chatHook.isExpanded}\n onClick={chatHook.toggleExpand}\n />\n </TopBar>\n <AllChatsContainer\n width={styles?.width || '80%'}\n height={styles?.height || 'auto'}\n isExpanded={chatHook.isExpanded}\n >\n {chatHook.isExpanded ? (\n <ExpandedChatContent>\n {isPrivate && (\n <RecentChats\n showRecentChats={chatHook.showRecentChats}\n toggleRecentChats={chatHook.toggleRecentChats}\n hasUnseenMessages={chatHook.hasUnseenMessages || false}\n showSearchCharacterUI={showSearchCharacterUI}\n recentChatCharacters={recentChatCharacters}\n recentSelectedChatCharacterId={recentSelectedChatCharacterId}\n unseenMessageCharacterIds={unseenMessageCharacterIds}\n onPreviousChatCharacterClick={\n chatHook.handlePreviousChatCharacterClick\n }\n onRemoveRecentChatCharacter={onRemoveRecentChatCharacter}\n isPrivate={isPrivate}\n hideSearchCharacterUI={hideSearchCharacterUI}\n />\n )}\n <ChatContentWrapper isPrivate={isPrivate}>\n <ChatContent\n isPrivate={isPrivate}\n isTrade={isTrade}\n isGuild={isGuild}\n isGlobal={isGlobal}\n searchCharacterUI={searchCharacterUI}\n chatMessages={chatMessages}\n onSendGlobalChatMessage={onSendGlobalChatMessage}\n onSendPrivateChatMessage={onSendPrivateChatMessage}\n onSendTradeMessage={onSendTradeMessage}\n onSendGuildChatMessage={onSendGuildChatMessage}\n onSendLocalChatMessage={onSendLocalChatMessage}\n onCloseButton={onCloseButton}\n styles={styles}\n onFocus={onFocus}\n onBlur={onBlur}\n isExpanded={chatHook.isExpanded}\n autoCloseOnSend={autoCloseOnSend || false}\n onChangeCharacterName={onChangeCharacterName}\n privateChatCharacters={privateChatCharacters}\n hideSearchCharacterUI={hideSearchCharacterUI}\n onCharacterClick={onCharacterClick}\n />\n </ChatContentWrapper>\n </ExpandedChatContent>\n ) : (\n <CollapsedChatInput>\n <Chat\n chatMessages={[]}\n onSendChatMessage={onSendLocalChatMessage}\n sendMessage={true}\n onCloseButton={onCloseButton}\n styles={styles}\n onFocus={onFocus}\n onBlur={onBlur}\n isExpanded={false}\n />\n </CollapsedChatInput>\n )}\n </AllChatsContainer>\n </ChatRevampContainer>\n );\n};\n\nconst ChatRevampContainer = styled.div`\n display: flex;\n flex-direction: column;\n width: 100%;\n position: relative;\n`;\n\nconst TopBar = styled.div<{ isExpanded: boolean }>`\n display: flex;\n align-items: center;\n justify-content: flex-start;\n min-height: ${({ isExpanded }) => (isExpanded ? 'auto' : '32px')};\n`;\n\nconst AllChatsContainer = styled.div<{\n width: string;\n height: string;\n isExpanded: boolean;\n}>`\n width: ${({ width }) => width};\n height: ${({ height, isExpanded }) => (isExpanded ? height : 'auto')};\n padding: 10px;\n background-color: rgba(0, 0, 0, 0.2);\n display: flex;\n gap: 10px;\n flex-wrap: wrap;\n`;\n\nconst ChatContentWrapper = styled.div<{ isPrivate: boolean }>`\n flex-grow: 1;\n overflow: hidden;\n display: flex;\n flex-direction: column;\n position: relative;\n width: ${props => (props.isPrivate ? '75%' : '100%')};\n`;\n\nconst CollapsedChatInput = styled.div`\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n`;\n\nconst ExpandedChatContent = styled.div`\n display: flex;\n width: 100%;\n height: 100%;\n`;\n","import styled from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\n\nexport const SingleShortcut = styled.button`\n width: 3rem;\n height: 3rem;\n background-color: ${uiColors.lightGray};\n border: 2px solid ${uiColors.darkGray};\n border-radius: 50%;\n text-transform: uppercase;\n font-size: 0.7rem;\n font-weight: bold;\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n\n span {\n pointer-events: none;\n }\n\n .mana {\n position: absolute;\n top: -5px;\n right: 0;\n font-size: 0.65rem;\n color: ${uiColors.blue};\n }\n\n .qty {\n position: absolute;\n top: -5px;\n right: 0;\n font-size: 0.65rem;\n }\n\n .magicWords {\n margin-top: 4px;\n }\n\n .keyboard {\n position: absolute;\n bottom: -5px;\n left: 0;\n font-size: 0.65rem;\n color: ${uiColors.yellow};\n }\n\n .onCooldown {\n color: ${uiColors.gray};\n }\n\n .cooldown {\n position: absolute;\n z-index: 1;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n border-radius: inherit;\n background-color: rgba(0 0 0 / 60%);\n font-size: 0.7rem;\n display: flex;\n align-items: center;\n justify-content: center;\n color: ${uiColors.darkYellow};\n }\n\n &:hover,\n &:focus {\n background-color: ${uiColors.darkGray};\n }\n\n &:active {\n background-color: ${uiColors.gray};\n border-color: ${uiColors.yellow};\n }\n\n &:disabled {\n opacity: 0.5;\n }\n`;\n","import { useEffect, useRef, useState } from 'react';\n\nexport const useShortcutCooldown = (\n onShortcutCast: (index: number) => void\n) => {\n const [shortcutCooldown, setShortcutCooldown] = useState(0);\n const cooldownTimeout = useRef<NodeJS.Timeout | null>(null);\n\n const handleShortcutCast = (index: number) => {\n if (shortcutCooldown <= 0) setShortcutCooldown(1.5);\n onShortcutCast(index);\n };\n\n useEffect(() => {\n if (cooldownTimeout.current) clearTimeout(cooldownTimeout.current);\n\n if (shortcutCooldown > 0) {\n cooldownTimeout.current = setTimeout(() => {\n setShortcutCooldown(shortcutCooldown - 0.1);\n }, 100);\n }\n }, [shortcutCooldown]);\n\n return { shortcutCooldown, handleShortcutCast };\n};\n","import {\n getItemTextureKeyPath,\n IItem,\n IItemContainer,\n IRawSpell,\n IShortcut,\n ShortcutType,\n} from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\nimport { SpriteFromAtlas } from '../shared/SpriteFromAtlas';\nimport { SingleShortcut } from '../Shortcuts/SingleShortcut';\nimport { useShortcutCooldown } from '../Shortcuts/useShortcutCooldown';\n\nexport type CircularControllerProps = {\n onActionClick: () => void;\n onCancelClick: () => void;\n onShortcutClick: (index: number) => void;\n mana: number;\n shortcuts: IShortcut[];\n inventory?: IItemContainer | null;\n atlasIMG: any;\n atlasJSON: any;\n spellCooldowns?: Record<string, number>;\n};\n\nexport const CircularController: React.FC<CircularControllerProps> = ({\n onActionClick,\n onCancelClick,\n onShortcutClick,\n mana,\n shortcuts,\n inventory,\n atlasIMG,\n atlasJSON,\n spellCooldowns,\n}) => {\n const { handleShortcutCast, shortcutCooldown } = useShortcutCooldown(\n onShortcutClick\n );\n\n const onTouchStart = (e: React.TouchEvent<HTMLButtonElement>) => {\n const target = e.target as HTMLButtonElement;\n target?.classList.add('active');\n };\n\n const onTouchEnd = (\n action: () => void,\n e: React.TouchEvent<HTMLButtonElement>\n ) => {\n const target = e.target as HTMLButtonElement;\n setTimeout(() => {\n target?.classList.remove('active');\n }, 100);\n action();\n };\n\n const renderShortcut = (i: number) => {\n const buildClassName = (classBase: string, isOnCooldown: boolean) => {\n return `${classBase} ${isOnCooldown ? 'onCooldown' : ''}`;\n };\n\n let variant = '';\n\n if (i === 0) variant = 'top';\n else if (i >= 3) variant = `bottom-${i - 3}`;\n\n const onShortcutClickBinded =\n shortcuts[i]?.type !== ShortcutType.None\n ? handleShortcutCast.bind(null, i)\n : () => {};\n\n const isOnShortcutCooldown = shortcutCooldown > 0;\n\n if (shortcuts[i]?.type === ShortcutType.Item) {\n const payload = shortcuts[i]?.payload as IItem | undefined;\n\n let itemsFromEquipment: (IItem | undefined | null)[] = [];\n\n if (inventory) {\n Object.keys(inventory.slots).forEach(i => {\n const index = parseInt(i);\n\n if (inventory.slots[index]?.key === payload?.key) {\n itemsFromEquipment.push(inventory.slots[index]);\n }\n });\n }\n\n const totalQty = itemsFromEquipment.reduce(\n (acc, item) => acc + (item?.stackQty || 1),\n 0\n );\n\n return (\n <StyledShortcut\n key={i}\n onTouchStart={onTouchStart}\n onTouchEnd={onTouchEnd.bind(null, onShortcutClickBinded)}\n disabled={false}\n className={variant}\n >\n {isOnShortcutCooldown && (\n <span className=\"cooldown\">{shortcutCooldown.toFixed(1)}</span>\n )}\n {payload && (\n <SpriteFromAtlas\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={getItemTextureKeyPath(\n {\n key: payload.texturePath,\n texturePath: payload.texturePath,\n stackQty: payload.stackQty || 1,\n isStackable: payload.isStackable,\n },\n atlasJSON\n )}\n width={32}\n height={32}\n imgScale={1.4}\n imgStyle={{ left: '4px' }}\n containerStyle={{ pointerEvents: 'none' }}\n />\n )}\n <span className={buildClassName('qty', isOnShortcutCooldown)}>\n {totalQty}\n </span>\n </StyledShortcut>\n );\n }\n\n const payload = shortcuts[i]?.payload as IRawSpell | undefined;\n\n const spellCooldown = !payload\n ? 0\n : spellCooldowns?.[payload.magicWords.replaceAll(' ', '_')] ??\n shortcutCooldown;\n const cooldown =\n spellCooldown > shortcutCooldown ? spellCooldown : shortcutCooldown;\n const isOnCooldown = cooldown > 0 && !!payload;\n\n const CONTAINER_STYLE = { width: '32px', height: '32px' };\n const IMAGE_SCALE = 1.5;\n\n return (\n <StyledShortcut\n key={i}\n onTouchStart={onTouchStart}\n onTouchEnd={onTouchEnd.bind(null, onShortcutClickBinded)}\n disabled={mana < (payload?.manaCost ?? 0)}\n className={variant}\n >\n {isOnCooldown && (\n <span className=\"cooldown\">\n {cooldown.toFixed(cooldown < 10 ? 1 : 0)}\n </span>\n )}\n <span className={buildClassName('mana', isOnCooldown)}>\n {payload && payload.manaCost}\n </span>\n <span className=\"magicWords\">\n {payload?.texturePath ? (\n <SpriteFromAtlas\n atlasIMG={payload.atlasIMG}\n atlasJSON={payload.atlasJSON}\n spriteKey={payload.texturePath}\n imgScale={IMAGE_SCALE}\n containerStyle={CONTAINER_STYLE}\n centered={true}\n borderRadius=\"50%\"\n />\n ) : (\n payload?.magicWords.split(' ').map(word => word[0])\n )}\n </span>\n </StyledShortcut>\n );\n };\n\n return (\n <ButtonsContainer>\n <ShortcutsContainer>\n {Array.from({ length: 12 }).map((_, i) => renderShortcut(i))}\n </ShortcutsContainer>\n <Button\n onTouchStart={onTouchStart}\n onTouchEnd={onTouchEnd.bind(null, onActionClick)}\n >\n <div className=\"rpgui-icon sword\" />\n </Button>\n\n <CancelButton\n onTouchStart={onTouchStart}\n onTouchEnd={onTouchEnd.bind(null, onCancelClick)}\n >\n <span>X</span>\n </CancelButton>\n </ButtonsContainer>\n );\n};\n\nconst Button = styled.button`\n width: 4.3rem;\n height: 4.3rem;\n background-color: ${uiColors.lightGray};\n border: 2px solid ${uiColors.darkGray};\n border-radius: 50%;\n text-transform: uppercase;\n font-size: 0.7rem;\n font-weight: bold;\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n transition: all 0.1s;\n margin-top: -3rem;\n top: -144px;\n\n &.active {\n background-color: ${uiColors.gray};\n border-color: ${uiColors.yellow};\n }\n\n .sword {\n transform: rotate(-45deg);\n height: 2.5rem;\n width: 1.9rem;\n pointer-events: none;\n }\n`;\n\nconst CancelButton = styled(Button)`\n width: 3rem;\n height: 3rem;\n font-size: 0.8rem;\n position: relative;\n left: 2.6rem;\n\n span {\n margin-top: 4px;\n margin-left: 2px;\n pointer-events: none;\n }\n`;\n\nconst ButtonsContainer = styled.div`\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 0.5rem;\n\n scale: 0.9;\n`;\n\nconst ShortcutsContainer = styled.div`\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 0.5rem;\n flex-direction: column;\n margin-top: 3rem;\n\n .top {\n transform: translate(93%, 25%);\n }\n\n .bottom-0 {\n transform: translate(93%, -25%);\n }\n\n .bottom-1 {\n transform: translate(320%, calc(-4.5rem));\n }\n\n .bottom-2 {\n transform: translate(-13.5%, calc(-5.6rem - 25%));\n }\n\n .bottom-3 {\n transform: translate(318%, calc(-15.8rem - 25%));\n }\n\n .bottom-4 {\n transform: translate(-15%, calc(-20.2rem - 25%));\n }\n .bottom-5 {\n transform: translate(210%, calc(-15rem - 25%));\n }\n\n .bottom-6 {\n transform: translate(210%, calc(-25.7rem - 25%));\n }\n\n .bottom-7 {\n transform: translate(304%, calc(-24.9rem - 25%));\n }\n\n .bottom-8 {\n transform: translate(-101%, calc(-27.7rem - 25%));\n }\n`;\n\nconst StyledShortcut = styled(SingleShortcut)`\n width: 2.5rem;\n height: 2.5rem;\n transition: all 0.1s;\n\n .mana,\n .qty {\n font-size: 0.5rem;\n }\n\n &:hover,\n &:focus,\n &:active {\n background-color: ${uiColors.lightGray};\n }\n\n &.active {\n background-color: ${uiColors.gray};\n border-color: ${uiColors.yellow};\n }\n`;\n","import { useEffect } from 'react';\n\nexport function useOutsideClick(ref: any, id: string) {\n useEffect(() => {\n /**\n * Alert if clicked on outside of element\n */\n function handleClickOutside(event: any) {\n if (ref.current && !ref.current.contains(event.target)) {\n const event = new CustomEvent('clickOutside', {\n detail: {\n id,\n },\n });\n document.dispatchEvent(event);\n }\n }\n // Bind the event listener\n document.addEventListener('pointerdown', handleClickOutside);\n return () => {\n // Unbind the event listener on clean up\n document.removeEventListener('pointerdown', handleClickOutside);\n };\n }, [ref]);\n}\n","import React from 'react';\nimport styled from 'styled-components';\nimport { RPGUIContainer, RPGUIContainerTypes } from '../RPGUI/RPGUIContainer';\nimport { NPCDialogText } from './NPCDialogText';\nimport {\n IQuestionDialog,\n IQuestionDialogAnswer,\n QuestionDialog,\n} from './QuestionDialog/QuestionDialog';\nimport aliceDefaultThumbnail from './img/npcDialog/npcThumbnails/alice.png';\n\nexport enum NPCDialogType {\n TextOnly = 'TextOnly',\n TextAndThumbnail = 'TextAndThumbnail',\n}\n\nexport interface INPCDialogProps {\n text?: string;\n type: NPCDialogType;\n imagePath?: string;\n onClose?: () => void;\n isQuestionDialog?: boolean;\n answers?: IQuestionDialogAnswer[];\n questions?: IQuestionDialog[];\n}\n\nexport const NPCDialog: React.FC<INPCDialogProps> = ({\n text,\n type,\n onClose,\n imagePath,\n isQuestionDialog = false,\n questions,\n answers,\n}) => {\n return (\n <RPGUIContainer\n type={RPGUIContainerTypes.FramedGold}\n width={isQuestionDialog ? '600px' : '80%'}\n height={'180px'}\n >\n {isQuestionDialog && questions && answers ? (\n <>\n <TextContainer\n flex={type === NPCDialogType.TextAndThumbnail ? '70%' : '100%'}\n >\n <QuestionDialog\n questions={questions}\n answers={answers}\n onClose={() => {\n if (onClose) {\n onClose();\n }\n }}\n />\n </TextContainer>\n {type === NPCDialogType.TextAndThumbnail && (\n <ThumbnailContainer>\n <NPCThumbnail src={imagePath || aliceDefaultThumbnail} />\n </ThumbnailContainer>\n )}\n </>\n ) : (\n <>\n <Container>\n <CloseIcon onPointerDown={onClose}>X</CloseIcon>\n <TextContainer\n flex={type === NPCDialogType.TextAndThumbnail ? '70%' : '100%'}\n >\n <NPCDialogText\n type={type}\n text={text || 'No text provided.'}\n onClose={() => {\n if (onClose) {\n onClose();\n }\n }}\n />\n </TextContainer>\n {type === NPCDialogType.TextAndThumbnail && (\n <ThumbnailContainer>\n <NPCThumbnail src={imagePath || aliceDefaultThumbnail} />\n </ThumbnailContainer>\n )}\n </Container>\n </>\n )}\n </RPGUIContainer>\n );\n};\n\nconst Container = styled.div`\n display: flex;\n width: 100%;\n height: 100%;\n\n box-sizing: border-box;\n justify-content: center;\n align-items: flex-start;\n position: relative;\n`;\n\nconst CloseIcon = styled.p`\n position: absolute;\n top: -1.5rem;\n right: -0.4rem;\n cursor: pointer;\n color: white;\n font-size: 1.1rem !important;\n`;\n\ninterface ITextContainerProps {\n flex: string;\n}\n\nconst TextContainer = styled.div<ITextContainerProps>`\n flex: ${({ flex }) => flex} 0 0;\n width: 355px;\n`;\n\nconst ThumbnailContainer = styled.div`\n flex: 30% 0 0;\n display: flex;\n justify-content: flex-end;\n`;\n\nconst NPCThumbnail = styled.img`\n image-rendering: pixelated;\n height: 128px;\n width: 128px;\n`;\n","import React, { useEffect, useRef } from 'react';\nimport Draggable from 'react-draggable';\nimport styled, { css } from 'styled-components';\nimport { uiFonts } from '../constants/uiFonts';\nimport { useOutsideClick } from '../hooks/useOutsideAlerter';\nimport { IPosition } from '../types/eventTypes';\nimport { RPGUIContainerTypes } from './RPGUI/RPGUIContainer';\n\nexport interface IDraggableContainerProps {\n children: React.ReactNode;\n width?: string;\n height?: string;\n minWidth?: string;\n minHeight?: string;\n className?: string;\n type?: RPGUIContainerTypes;\n title?: string;\n imgSrc?: string;\n imgWidth?: string;\n onCloseButton?: () => void;\n cancelDrag?: string;\n onPositionChange?: (position: IPosition) => void;\n onPositionChangeEnd?: (position: IPosition) => void;\n onPositionChangeStart?: (position: IPosition) => void;\n onOutsideClick?: () => void;\n initialPosition?: IPosition;\n scale?: number;\n dragDisabled?: boolean;\n isFullScreen?: boolean;\n opacity?: number;\n}\n\nexport const DraggableContainer: React.FC<IDraggableContainerProps> = ({\n children,\n width = '50%',\n height,\n minHeight,\n minWidth,\n className,\n type = RPGUIContainerTypes.FramedGold,\n onCloseButton,\n title,\n imgSrc,\n imgWidth = '20px',\n cancelDrag,\n onPositionChange,\n onPositionChangeEnd,\n onPositionChangeStart,\n onOutsideClick,\n initialPosition = { x: 0, y: 0 },\n scale,\n dragDisabled = false,\n isFullScreen,\n opacity,\n}) => {\n const draggableRef = useRef(null);\n\n if (isFullScreen) {\n width = '100%';\n height = '100%';\n }\n\n useOutsideClick(draggableRef, 'item-container');\n\n useEffect(() => {\n document.addEventListener('clickOutside', event => {\n const e = event as CustomEvent;\n\n if (e.detail.id === 'item-container') {\n if (onOutsideClick) {\n onOutsideClick();\n }\n }\n });\n\n return () => {\n document.removeEventListener('clickOutside', _e => {});\n };\n }, []);\n\n return (\n <Draggable\n cancel={`.container-close,input,button,${cancelDrag}`}\n disabled={dragDisabled}\n onDrag={(_e, data) => {\n if (onPositionChange) {\n onPositionChange({\n x: data.x,\n y: data.y,\n });\n }\n }}\n onStop={(_e, data) => {\n if (onPositionChangeEnd) {\n onPositionChangeEnd({\n x: data.x,\n y: data.y,\n });\n }\n }}\n onStart={(_e, data) => {\n if (onPositionChangeStart) {\n onPositionChangeStart({\n x: data.x,\n y: data.y,\n });\n }\n }}\n defaultPosition={initialPosition}\n scale={scale}\n >\n <Container\n ref={draggableRef}\n width={width}\n height={height || 'auto'}\n minWidth={minWidth}\n minHeight={minHeight}\n className={`rpgui-container ${type} ${className}`}\n isFullScreen={isFullScreen}\n opacity={opacity}\n >\n {title && (\n <TitleContainer className=\"drag-handler\">\n <Title>\n {imgSrc && <Icon src={imgSrc} width={imgWidth} />}\n {title}\n </Title>\n </TitleContainer>\n )}\n {onCloseButton && (\n <CloseButton\n className=\"container-close\"\n onPointerDown={onCloseButton}\n >\n X\n </CloseButton>\n )}\n\n {children}\n </Container>\n </Draggable>\n );\n};\n\ninterface IContainerProps {\n width: string;\n height: string;\n minWidth?: string;\n minHeight?: string;\n isFullScreen?: boolean;\n opacity?: number;\n}\n\nconst Container = styled.div<IContainerProps>`\n height: ${props => props.height};\n width: ${({ width }) => width};\n min-width: ${({ minWidth }) => minWidth || 'auto'};\n min-height: ${({ minHeight }) => minHeight || 'auto'};\n display: flex;\n flex-wrap: wrap;\n image-rendering: pixelated;\n\n overflow-y: hidden;\n\n ${({ opacity }) =>\n opacity &&\n css`\n opacity: ${opacity};\n `}\n\n ${({ isFullScreen }) =>\n isFullScreen &&\n css`\n justify-content: center;\n align-items: flex-start;\n align-content: flex-start;\n `}\n\n &.rpgui-container {\n padding-top: 1.5rem;\n }\n`;\n\nconst CloseButton = styled.div`\n position: absolute;\n top: 3px;\n right: 0px;\n color: white;\n z-index: 22;\n font-size: 1.5rem;\n @media (max-width: 950px) {\n font-size: 1.7rem;\n padding: 12px;\n }\n`;\n\nconst TitleContainer = styled.div`\n width: 100%;\n height: 100%;\n display: flex;\n flex-wrap: wrap;\n justify-content: flex-start;\n align-items: center;\n max-height: 42px;\n`;\n\nconst Title = styled.h1`\n color: white;\n z-index: 22;\n font-size: ${uiFonts.size.large};\n`;\n\ninterface ICustomIconProps {\n width: string;\n}\n\nconst Icon = styled.img<ICustomIconProps>`\n color: white;\n z-index: 22;\n font-size: ${uiFonts.size.xsmall};\n width: ${({ width }) => width};\n margin-right: 0.5rem;\n`;\n","import React from 'react';\n\ninterface IProps\n extends React.DetailedHTMLProps<\n React.InputHTMLAttributes<HTMLInputElement>,\n HTMLInputElement\n > {\n label: string;\n name: string;\n value: string;\n isChecked: boolean;\n onRadioSelect: (value: string) => void;\n}\n\nexport const InputRadio: React.FC<IProps> = ({\n label,\n name,\n value,\n isChecked,\n onRadioSelect,\n}) => {\n const onRadioClick = (): void => {\n onRadioSelect(value);\n };\n\n return (\n <div onPointerUp={onRadioClick}>\n <input\n className=\"rpgui-radio\"\n name={name}\n value={value}\n type=\"radio\"\n data-rpguitype=\"radio\"\n checked={isChecked}\n // rpgui breaks onChange on this input (doesn't work). That's why I had to wrap it with a div and a onClick listener.\n readOnly\n ></input>\n <label>{label}</label>\n </div>\n );\n};\n","import { IItem, IItemContainer } from \"@rpg-engine/shared\";\n\nexport const countItemFromInventory = (itemKey: string, inventory: IItemContainer) => {\n let itemsFromInventory: (IItem | undefined | null)[] = [];\n\n if (inventory) {\n Object.keys(inventory.slots).forEach(i => {\n const index = parseInt(i);\n\n if (inventory.slots[index]?.key === itemKey) {\n itemsFromInventory.push(inventory.slots[index]);\n }\n });\n }\n\n const totalQty = itemsFromInventory.reduce(\n (acc, item) => acc + (item?.stackQty || 1),\n 0\n );\n\n return totalQty;\n};","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport styled from 'styled-components';\n\nconst modalRoot = document.getElementById('modal-root')!;\n\ninterface ModalPortalProps {\n children: React.ReactNode;\n}\n\nconst ModalPortal: React.FC<ModalPortalProps> = ({ children }) => {\n return ReactDOM.createPortal(\n <Container className=\"rpgui-content\">{children}</Container>,\n modalRoot\n );\n};\n\nconst Container = styled.div`\n position: static !important;\n`;\n\nexport default ModalPortal;\n","import { IItem, ItemRarities } from '@rpg-engine/shared';\n\n\nexport const rarityColor = (item: IItem | null) => {\n switch (item?.rarity) {\n case ItemRarities.Uncommon:\n return 'rgba(13, 193, 13, 0.6)';\n case ItemRarities.Rare:\n return 'rgba(8, 104, 187, 0.6)';\n case ItemRarities.Epic:\n return 'rgba(191, 0, 255, 0.6)';\n case ItemRarities.Legendary:\n return 'rgba(255, 191, 0,0.6)';\n default:\n return null;\n }\n};\n","import { IItem } from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\n\ninterface IProps {\n item: IItem;\n}\n\nconst gemColors: { [key: string]: string } = {\n 'emerald-gem': '#50C878', // Emerald green\n 'topaz-radiance': '#FFC87C', // Topaz yellow\n 'sapphire-gem': '#0F52BA', // Sapphire blue\n 'ruby-gem': '#E0115F', // Ruby red\n 'misty-quartz-gem': '#D9D9F3', // Misty Quartz purple\n 'coral-reef-gem': '#FF7F50', // Coral reef orange\n 'jasper-gem': '#D73B3E', // Jasper red\n 'earthstone-gem': '#8B4513', // Earthstone brown\n 'obsidian-gem': '#0B0C0E', // Obsidian black\n 'amethyst-gem': '#9966CC', // Amethyst purple\n};\n\nconst defaultColor = '#FFFFFF'; // Default color (white)\n\nexport const onRenderGems = (item: IItem) => {\n const gemQty = item.attachedGems?.length || 0;\n\n if (gemQty > 0) {\n return <ItemSlotQty item={item} />;\n }\n return undefined;\n};\n\nexport const ItemSlotQty = ({ item }: IProps): JSX.Element => {\n const itemId = item._id;\n\n return (\n <ItemQtyContainer key={`qty-${itemId}`} className=\"item-slot-qty\">\n {item.attachedGems?.map((gem, index) => (\n <Gem\n key={`${itemId}-gem-${index}`}\n color={gemColors[gem.key] || defaultColor}\n />\n ))}\n </ItemQtyContainer>\n );\n};\n\nconst ItemQtyContainer = styled.div`\n position: relative;\n width: 85%;\n height: 16px;\n top: 28px;\n left: 0px;\n pointer-events: none;\n transform: scale(0.8);\n display: flex;\n align-items: center;\n justify-content: flex-start; /* Align gems to the left */\n opacity: 0.8;\n`;\n\nconst Gem = styled.div<{ color: string }>`\n width: 8px;\n height: 8px;\n background: ${({ color }) =>\n `radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.8), transparent 30%), \n linear-gradient(45deg, ${color}, ${color} 50%, rgba(255, 255, 255, 0.2))`};\n border: 1px solid black;\n transform: rotate(45deg);\n margin: 0 2px;\n box-shadow: 0 0 5px ${({ color }) => color}; /* Glow effect */\n transition: transform 0.2s, box-shadow 0.2s; /* Smooth transition for hover effect */\n\n &:hover {\n transform: rotate(45deg) scale(1.2);\n box-shadow: 0 0 10px ${({ color }) => color}; /* Enhanced glow on hover */\n }\n`;\n\nexport default ItemSlotQty;\n","import React from 'react';\nimport styled from 'styled-components';\nimport { uiFonts } from '../../../../constants/uiFonts';\nimport { Ellipsis } from '../../../shared/Ellipsis';\n\ninterface IProps {\n itemId: string;\n stackQty: number;\n qtyClassName: string;\n}\n\nexport const onRenderStackInfo = (itemId: string, stackQty: number) => {\n const isFractionalStackQty = stackQty % 1 !== 0;\n const isLargerThan999 = stackQty > 999;\n\n let qtyClassName = 'regular';\n if (isLargerThan999) qtyClassName = 'small';\n if (isFractionalStackQty) qtyClassName = 'xsmall';\n\n if (stackQty > 1) {\n return (\n <ItemSlotQty\n itemId={itemId}\n stackQty={stackQty}\n qtyClassName={qtyClassName}\n />\n );\n }\n return undefined;\n};\n\nexport const ItemSlotQty = ({\n itemId,\n stackQty,\n qtyClassName,\n}: IProps): JSX.Element => {\n return (\n <ItemQtyContainer key={`qty-${itemId}`} className=\"item-slot-qty\">\n <Ellipsis maxLines={1} maxWidth=\"48px\">\n <ItemQty className={qtyClassName}>\n {Math.round(stackQty * 100) / 100}{' '}\n </ItemQty>\n </Ellipsis>\n </ItemQtyContainer>\n );\n};\n\nconst ItemQtyContainer = styled.div`\n position: relative;\n width: 85%;\n height: 16px;\n top: 25px;\n left: 2px;\n pointer-events: none;\n\n display: flex;\n justify-content: flex-end;\n`;\n\nconst ItemQty = styled.span`\n &.regular {\n font-size: ${uiFonts.size.small};\n }\n &.small {\n font-size: ${uiFonts.size.xsmall};\n }\n &.xsmall {\n font-size: ${uiFonts.size.xxsmall};\n }\n`;\n","import {\n IItem,\n ItemContainerType,\n ItemSlotType,\n getItemTextureKeyPath,\n} from '@rpg-engine/shared';\nimport React from 'react';\nimport { v4 as uuidv4 } from 'uuid';\nimport { SpriteFromAtlas } from '../../shared/SpriteFromAtlas';\nimport { ErrorBoundary } from './ErrorBoundary';\nimport { onRenderGems } from './ItemGem';\nimport { EquipmentSlotSpriteByType } from './ItemSlot';\nimport { onRenderStackInfo } from './ItemSlotQty/ItemSlotQty';\n\ninterface IProps {\n containerType: ItemContainerType | null | undefined;\n atlasJSON: any;\n atlasIMG: any;\n slotSpriteMask: ItemSlotType | null | undefined;\n item: IItem | null;\n}\n\nexport const ItemSlotRenderer: React.FC<IProps> = ({\n containerType,\n atlasJSON,\n atlasIMG,\n slotSpriteMask,\n item,\n}) => {\n const renderStackInfo = (item: IItem) => {\n return (\n item.stackQty &&\n item.stackQty > 1 &&\n onRenderStackInfo(item._id, item.stackQty)\n );\n };\n\n const renderGems = (item: IItem) => {\n return item.attachedGems && onRenderGems(item);\n };\n\n const renderItem = (item: IItem | null) => {\n if (!item?.texturePath) {\n return null;\n }\n\n return (\n <ErrorBoundary key={item._id}>\n <SpriteFromAtlas\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={getItemTextureKeyPath(\n {\n key: item.texturePath,\n texturePath: item.texturePath,\n stackQty: item.stackQty || 1,\n isStackable: item.isStackable,\n },\n atlasJSON\n )}\n imgScale={3}\n imgClassname=\"sprite-from-atlas-img--item\"\n />\n {renderStackInfo(item)}\n {renderGems(item)}\n </ErrorBoundary>\n );\n };\n\n const renderEquipment = (itemToRender: IItem | null) => {\n if (\n !itemToRender?.texturePath ||\n !itemToRender.allowedEquipSlotType?.includes(slotSpriteMask!)\n ) {\n return (\n <ErrorBoundary key={uuidv4()}>\n <SpriteFromAtlas\n key={uuidv4()}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={EquipmentSlotSpriteByType[slotSpriteMask!]}\n imgScale={3}\n grayScale={true}\n opacity={0.4}\n imgClassname=\"sprite-from-atlas-img--item\"\n />\n </ErrorBoundary>\n );\n }\n\n return renderItem(itemToRender);\n };\n\n const onRenderSlot = (itemToRender: IItem | null) => {\n switch (containerType) {\n case ItemContainerType.Equipment:\n return renderEquipment(itemToRender);\n default:\n return renderItem(itemToRender);\n }\n };\n\n return <>{onRenderSlot(item)}</>;\n};\n","import {\n ActionsForEquipmentSet,\n ActionsForInventory,\n ActionsForLoot,\n ActionsForMapContainer,\n DepotSocketEvents,\n IItem,\n ItemContainerType,\n ItemSocketEvents,\n ItemSocketEventsDisplayLabels,\n ItemType,\n} from '@rpg-engine/shared';\n\nexport interface IContextMenuItem {\n id: string;\n text: string;\n}\n\nconst generateContextMenuListOptions = (actionsByTypeList: any) => {\n const contextMenu: IContextMenuItem[] = actionsByTypeList.map(\n (action: string) => {\n return { id: action, text: ItemSocketEventsDisplayLabels[action] };\n }\n );\n return contextMenu;\n};\n\nexport const generateContextMenu = (\n item: IItem,\n itemContainerType: ItemContainerType | null,\n isDepotSystem?: boolean\n) => {\n let contextActionMenu: IContextMenuItem[] = [];\n\n if (itemContainerType === ItemContainerType.Inventory) {\n switch (item.type) {\n case ItemType.Weapon:\n case ItemType.Armor:\n case ItemType.Accessory:\n case ItemType.Jewelry:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForInventory.Equipment\n );\n break;\n case ItemType.Container:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForInventory.Container\n );\n break;\n case ItemType.Consumable:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForInventory.Consumable\n );\n break;\n case ItemType.CraftingResource:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForInventory.CraftingResource\n );\n break;\n case ItemType.Tool:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForInventory.Tool\n );\n break;\n\n default:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForInventory.Other\n );\n break;\n }\n\n if (isDepotSystem) {\n contextActionMenu.push({\n id: DepotSocketEvents.Deposit,\n text: 'Deposit',\n });\n }\n\n const contextActionMenuDontHaveUseWith = !contextActionMenu.find(action =>\n action.text.toLowerCase().includes('use with')\n );\n\n if (item.hasUseWith && contextActionMenuDontHaveUseWith) {\n contextActionMenu.push({\n id: ItemSocketEvents.UseWith,\n text: ItemSocketEvents.UseWith,\n });\n }\n }\n if (itemContainerType === ItemContainerType.Equipment) {\n switch (item.type) {\n case ItemType.Container:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForEquipmentSet.Container\n );\n\n break;\n default:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForEquipmentSet.Equipment\n );\n }\n }\n if (itemContainerType === ItemContainerType.Loot) {\n switch (item.type) {\n case ItemType.Weapon:\n case ItemType.Armor:\n case ItemType.Accessory:\n case ItemType.Jewelry:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForLoot.Equipment\n );\n break;\n case ItemType.Consumable:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForLoot.Consumable\n );\n break;\n case ItemType.CraftingResource:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForLoot.CraftingResource\n );\n break;\n case ItemType.Tool:\n contextActionMenu = generateContextMenuListOptions(ActionsForLoot.Tool);\n break;\n default:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForLoot.Other\n );\n break;\n }\n }\n if (itemContainerType === ItemContainerType.MapContainer) {\n switch (item.type) {\n case ItemType.Weapon:\n case ItemType.Armor:\n case ItemType.Accessory:\n case ItemType.Jewelry:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForMapContainer.Equipment\n );\n break;\n case ItemType.Consumable:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForMapContainer.Consumable\n );\n break;\n case ItemType.CraftingResource:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForMapContainer.CraftingResource\n );\n break;\n case ItemType.Tool:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForMapContainer.Tool\n );\n break;\n default:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForMapContainer.Other\n );\n break;\n }\n\n const contextActionMenuDontHaveUseWith = !contextActionMenu.find(action =>\n action.text.toLowerCase().includes('use with')\n );\n\n if (item.hasUseWith && contextActionMenuDontHaveUseWith) {\n contextActionMenu.push({ id: 'use-with', text: 'Use with...' });\n }\n }\n if (itemContainerType === ItemContainerType.Depot) {\n contextActionMenu = [\n {\n id: ItemSocketEvents.GetItemInfo,\n text: ItemSocketEventsDisplayLabels.GetItemInfo,\n },\n { id: DepotSocketEvents.Withdraw, text: 'Withdraw' },\n ];\n }\n\n return contextActionMenu;\n};\n","import { IItem, ItemContainerType } from '@rpg-engine/shared';\nimport React, {\n createContext,\n useCallback,\n useContext,\n useMemo,\n useState,\n} from 'react';\nimport { generateContextMenu, IContextMenuItem } from '../itemContainerHelper';\n\ninterface IPosition {\n x: number;\n y: number;\n}\n\ninterface IItemSlotDetailsState {\n item: IItem | null;\n isTooltipVisible: boolean;\n isTooltipMobileVisible: boolean;\n isContextMenuVisible: boolean;\n contextMenuPosition: IPosition;\n contextActions: IContextMenuItem[];\n clearContextActions: () => void;\n clearDetailsState: () => void;\n}\n\ninterface IItemSlotDetailsContext {\n detailsState: IItemSlotDetailsState;\n updateDetailsState: (newState: Partial<IItemSlotDetailsState>) => void;\n clearDetailsState: () => void;\n setContextActions: (\n item: IItem | null,\n containerType: string | null,\n isDepotSystem: boolean,\n isContextMenuDisabled: boolean\n ) => void;\n clearContextActions: () => void;\n}\n\nconst initialDetailsState: IItemSlotDetailsState = {\n item: null,\n isTooltipVisible: false,\n isTooltipMobileVisible: false,\n isContextMenuVisible: false,\n contextMenuPosition: { x: 0, y: 0 },\n contextActions: [],\n clearContextActions: () => {},\n clearDetailsState: () => {},\n};\n\nconst ItemSlotDetailsContext = createContext<IItemSlotDetailsContext>({\n detailsState: initialDetailsState,\n updateDetailsState: () => {},\n clearDetailsState: () => {},\n setContextActions: () => {},\n clearContextActions: () => {},\n});\n\nexport const useItemSlotDetails = (): IItemSlotDetailsContext =>\n useContext(ItemSlotDetailsContext);\n\ninterface IProps {\n children: React.ReactNode;\n}\n\nexport const ItemSlotDetailsProvider: React.FC<IProps> = ({ children }) => {\n const [detailsState, setDetailsState] = useState<IItemSlotDetailsState>(\n initialDetailsState\n );\n\n const updateDetailsState = useCallback(\n (newState: Partial<IItemSlotDetailsState>): void => {\n setDetailsState(prevState => ({\n ...prevState,\n ...newState,\n }));\n },\n []\n );\n\n const clearDetailsState = useCallback(() => {\n setDetailsState(initialDetailsState);\n }, [setDetailsState]);\n\n const setContextActions = useCallback(\n (\n item: IItem | null,\n containerType: string | null,\n isDepotSystem: boolean,\n isContextMenuDisabled: boolean\n ): void => {\n if (item && containerType && !isContextMenuDisabled) {\n const newContextActions = generateContextMenu(\n item,\n containerType as ItemContainerType,\n isDepotSystem\n );\n updateDetailsState({ contextActions: newContextActions });\n } else {\n updateDetailsState({ contextActions: [] });\n }\n },\n []\n );\n\n const clearContextActions = useCallback(() => {\n updateDetailsState({ contextActions: [] });\n }, [updateDetailsState]);\n\n const contextValue = useMemo(\n () => ({\n detailsState,\n updateDetailsState,\n clearDetailsState,\n setContextActions,\n clearContextActions,\n }),\n [\n detailsState,\n updateDetailsState,\n clearDetailsState,\n setContextActions,\n clearContextActions,\n ]\n );\n\n return (\n <ItemSlotDetailsContext.Provider value={contextValue}>\n {children}\n </ItemSlotDetailsContext.Provider>\n );\n};\n","import { IItem } from '@rpg-engine/shared';\nimport React, {\n createContext,\n useCallback,\n useContext,\n useMemo,\n useState,\n} from 'react';\nimport { IPosition } from '../../../../types/eventTypes';\n\ninterface IDraggingState {\n item: IItem | null;\n isDragging: boolean;\n position: IPosition;\n dropPosition: IPosition | null;\n isFocused: boolean;\n draggingDistance: number;\n}\n\ninterface IDraggingContext {\n draggingState: IDraggingState;\n updateDraggingState: (newState: Partial<IDraggingState>) => void;\n clearDraggingState: () => void;\n}\n\nconst initialDraggingState: IDraggingState = {\n item: null,\n isDragging: false,\n position: { x: 0, y: 0 },\n dropPosition: null,\n isFocused: false,\n draggingDistance: 0,\n};\n\nconst ItemSlotDraggingContext = createContext<IDraggingContext>({\n draggingState: initialDraggingState,\n updateDraggingState: () => {},\n clearDraggingState: () => {},\n});\n\nexport const useItemSlotDragging = (): IDraggingContext =>\n useContext(ItemSlotDraggingContext);\n\ninterface IProps {\n children: React.ReactNode;\n}\n\nexport const ItemSlotDraggingProvider: React.FC<IProps> = ({ children }) => {\n const [draggingState, setDraggingState] = useState<IDraggingState>(\n initialDraggingState\n );\n\n const updateDraggingState = useCallback(\n (newState: Partial<IDraggingState>): void => {\n setDraggingState(prevState => ({\n ...prevState,\n ...newState,\n }));\n },\n []\n );\n\n const clearDraggingState = useCallback(() => {\n setDraggingState(initialDraggingState);\n }, []);\n\n const contextValue = useMemo(\n () => ({\n draggingState,\n updateDraggingState,\n clearDraggingState,\n }),\n [draggingState, updateDraggingState, clearDraggingState]\n );\n\n return (\n <ItemSlotDraggingContext.Provider value={contextValue}>\n {children}\n </ItemSlotDraggingContext.Provider>\n );\n};\n","import {\n IEquipmentSet,\n IItem,\n IItemContainer,\n isMobile,\n ItemContainerType,\n ItemSlotType,\n ItemSubType,\n ItemType,\n} from '@rpg-engine/shared';\n\nimport { observer } from 'mobx-react-lite';\nimport React, { useCallback, useEffect, useRef } from 'react';\nimport Draggable, { DraggableEventHandler } from 'react-draggable';\nimport styled from 'styled-components';\nimport useTouchTarget from '../../../hooks/useTouchTarget';\nimport { IPosition } from '../../../types/eventTypes';\nimport { rarityColor } from './ItemSlotRarity';\nimport { ItemSlotRenderer } from './ItemSlotRenderer';\nimport { useItemSlotDetails } from './context/ItemSlotDetailsContext';\nimport { useItemSlotDragging } from './context/ItemSlotDraggingContext';\n\nexport const EquipmentSlotSpriteByType: any = {\n Neck: 'accessories/corruption-necklace.png',\n LeftHand: 'swords/broad-sword.png',\n Ring: 'rings/iron-ring.png',\n Head: 'helmets/viking-helmet.png',\n Torso: 'armors/iron-armor.png',\n Legs: 'legs/studded-legs.png',\n Feet: 'boots/iron-boots.png',\n Inventory: 'containers/bag.png',\n RightHand: 'shields/plate-shield.png',\n Accessory: 'ranged-weapons/arrow.png',\n};\n\ninterface IProps {\n slotIndex: number;\n item: IItem | null;\n itemContainer?: IItemContainer | null;\n itemContainerType?: ItemContainerType | null;\n slotSpriteMask?: ItemSlotType | null;\n onMouseOver?: (\n event: any,\n slotIndex: number,\n item: IItem | null,\n x: number,\n y: number\n ) => void;\n onMouseOut?: () => void;\n onPointerDown: (\n ItemType: ItemType,\n itemContainerType: ItemContainerType | null,\n item: IItem\n ) => void;\n onDragStart?: (\n item: IItem,\n slotIndex: number,\n itemContainerType: ItemContainerType | null\n ) => void;\n onDragEnd?: (quantity?: number) => void;\n onOutsideDrop?: (item: IItem, position: IPosition) => void;\n dragScale?: number;\n checkIfItemCanBeMoved?: () => boolean;\n checkIfItemShouldDragEnd?: () => boolean;\n openQuantitySelector?: (maxQuantity: number, callback: () => void) => void;\n onPlaceDrop?: (\n item: IItem | null,\n slotIndex: number,\n itemContainerType: ItemContainerType | null\n ) => void;\n atlasJSON: any;\n atlasIMG: any;\n isContextMenuDisabled?: boolean;\n isSelectingShortcut?: boolean;\n equipmentSet?: IEquipmentSet | null;\n setItemShortcut?: (item: IItem, shortcutIndex: number) => void;\n isDepotSystem?: boolean;\n}\n\ninterface IProps {\n slotIndex: number;\n item: IItem | null;\n itemContainer?: IItemContainer | null;\n itemContainerType?: ItemContainerType | null;\n slotSpriteMask?: ItemSlotType | null;\n onMouseOver?: (\n event: any,\n slotIndex: number,\n item: IItem | null,\n x: number,\n y: number\n ) => void;\n onMouseOut?: () => void;\n onPointerDown: (\n ItemType: ItemType,\n itemContainerType: ItemContainerType | null,\n item: IItem\n ) => void;\n onDragStart?: (\n item: IItem,\n slotIndex: number,\n itemContainerType: ItemContainerType | null\n ) => void;\n onDragEnd?: (quantity?: number) => void;\n onOutsideDrop?: (item: IItem, position: IPosition) => void;\n dragScale?: number;\n checkIfItemCanBeMoved?: () => boolean;\n checkIfItemShouldDragEnd?: () => boolean;\n openQuantitySelector?: (maxQuantity: number, callback: () => void) => void;\n onPlaceDrop?: (\n item: IItem | null,\n slotIndex: number,\n itemContainerType: ItemContainerType | null\n ) => void;\n atlasJSON: any;\n atlasIMG: any;\n isContextMenuDisabled?: boolean;\n isSelectingShortcut?: boolean;\n equipmentSet?: IEquipmentSet | null;\n setItemShortcut?: (item: IItem, shortcutIndex: number) => void;\n isDepotSystem?: boolean;\n}\n\nexport const ItemSlot: React.FC<IProps> = observer(\n ({\n slotIndex,\n item,\n itemContainerType: containerType,\n slotSpriteMask,\n onMouseOver,\n onMouseOut,\n onPointerDown,\n atlasJSON,\n atlasIMG,\n isContextMenuDisabled = false,\n onDragEnd,\n onDragStart,\n onPlaceDrop,\n onOutsideDrop: onDrop,\n checkIfItemCanBeMoved,\n openQuantitySelector,\n checkIfItemShouldDragEnd,\n dragScale,\n isSelectingShortcut,\n\n setItemShortcut,\n isDepotSystem,\n }) => {\n const {\n detailsState,\n updateDetailsState,\n setContextActions,\n } = useItemSlotDetails();\n\n const getTouchTarget = useTouchTarget();\n\n const {\n isContextMenuVisible,\n clearDetailsState,\n clearContextActions,\n } = detailsState;\n\n const dragContainer = useRef<HTMLDivElement>(null);\n\n const {\n draggingState,\n updateDraggingState,\n clearDraggingState,\n } = useItemSlotDragging();\n\n const { isFocused, isDragging, draggingDistance } = draggingState;\n\n useEffect(() => {\n // Reset drag position and focus when item changes\n updateDraggingState({\n position: { x: 0, y: 0 },\n isFocused: false,\n });\n }, [\n containerType,\n isDepotSystem,\n setContextActions,\n clearContextActions,\n isContextMenuDisabled, // Added missing dependency\n ]);\n\n useEffect(() => {\n // Reset drag position and focus when item changes\n clearDraggingState();\n\n // Clear context actions when component unmounts or dependencies change\n return () => {\n clearContextActions();\n };\n }, [\n containerType,\n isDepotSystem,\n setContextActions,\n clearContextActions,\n isContextMenuDisabled,\n updateDraggingState, // Add this dependency\n ]);\n\n const resetItem = () => {\n clearDraggingState();\n clearDetailsState();\n };\n\n const onSuccessfulDrag = (quantity?: number) => {\n resetItem();\n\n if (quantity === -1) {\n updateDraggingState({\n position: { x: 0, y: 0 },\n isFocused: false,\n });\n } else if (item) {\n onDragEnd?.(quantity);\n }\n };\n\n const refreshContextActions = () => {\n setContextActions(\n item,\n containerType as ItemContainerType,\n isDepotSystem ?? false,\n isContextMenuDisabled\n );\n };\n\n const onDraggableStop: DraggableEventHandler = (e, data) => {\n requestAnimationFrame(() => {\n updateDraggingState({\n item: null,\n });\n\n let target = e.target as HTMLElement;\n\n if (isMobile()) {\n target = getTouchTarget(e as MouseEvent);\n }\n\n handleShortcutSetter(target);\n removeDraggingClass(target);\n\n const shouldHandleDraggedItemResult = shouldHandleDraggedItem();\n\n if (shouldHandleDraggedItemResult) {\n handleDraggedItem(e, data);\n } else if (item && !isDragging) {\n handleContextMenuOrTooltip(e as React.MouseEvent);\n }\n });\n };\n\n /**\n * Handles the shortcut setter logic if the target element is a shortcut setter.\n */\n const handleShortcutSetter = (target: HTMLElement) => {\n if (target?.id.includes('shortcutSetter') && setItemShortcut && item) {\n const index = parseInt(target.id.split('_')[1], 10);\n if (!isNaN(index)) {\n setItemShortcut(item, index);\n }\n }\n };\n\n /**\n * Removes the dragging CSS class from the target element.\n */\n const removeDraggingClass = (target: HTMLElement) => {\n target.classList.remove('react-draggable-dragging');\n };\n\n /**\n * Determines whether the dragged item should be processed.\n */\n const shouldHandleDraggedItem = (): boolean => {\n return !!(isDragging && draggingState.item && !isSelectingShortcut);\n };\n\n /**\n * Handles the logic when an item has been dragged.\n */\n const handleDraggedItem = useCallback(\n (e: any, data: any) => {\n const targetClasses = Array.from((e.target as HTMLElement).classList);\n const isOutsideDrop =\n targetClasses.some(elm => elm.includes('rpgui-content')) ||\n targetClasses.length === 0;\n\n if (isOutsideDrop && draggingState.isDragging && draggingState.item) {\n console.log('ITEM SLOT: Outside drop', draggingState.item.key);\n onDrop?.(draggingState.item, { x: data.x, y: data.y });\n clearDraggingState();\n } else {\n updateDraggingState({\n dropPosition: {\n x: data.x,\n y: data.y,\n },\n isDragging: false,\n });\n\n const targetElement = dragContainer.current;\n if (!targetElement) return;\n\n const { x, y } = getElementTransform(targetElement);\n\n updateDraggingState({\n position: { x, y },\n });\n\n processDragEnd(item!);\n }\n },\n [\n draggingState.isDragging,\n draggingState.item,\n onDrop,\n clearDraggingState,\n updateDraggingState,\n ]\n );\n\n /**\n * Retrieves the current transform position of the dragged element.\n */\n const getElementTransform = (\n element: HTMLElement\n ): { x: number; y: number } => {\n const style = window.getComputedStyle(element);\n const matrix = new DOMMatrixReadOnly(style.transform);\n return { x: matrix.m41, y: matrix.m42 };\n };\n\n const processDragEnd = useCallback(\n (item: IItem) => {\n if (checkIfItemCanBeMoved?.()) {\n if (checkIfItemShouldDragEnd && !checkIfItemShouldDragEnd()) {\n resetItem();\n return;\n }\n\n if (item.stackQty && item.stackQty !== 1 && openQuantitySelector) {\n openQuantitySelector(item.stackQty, onSuccessfulDrag);\n } else {\n onSuccessfulDrag(item.stackQty);\n }\n } else {\n resetItem();\n }\n },\n [\n checkIfItemCanBeMoved,\n checkIfItemShouldDragEnd,\n openQuantitySelector,\n onSuccessfulDrag,\n resetItem,\n ]\n );\n\n /**\n * Handles the context menu or tooltip display after dragging stops without a drop.\n */\n const handleContextMenuOrTooltip = (\n e: React.MouseEvent | React.TouchEvent\n ) => {\n const isTouchEvent = e.type === 'touchend';\n const shouldShowMobileTooltip =\n !isContextMenuDisabled && isTouchEvent && !isSelectingShortcut;\n const shouldToggleContextMenu =\n !isContextMenuDisabled && !isSelectingShortcut && !isTouchEvent;\n\n if (shouldShowMobileTooltip) {\n updateDetailsState({\n item,\n isTooltipMobileVisible: true,\n isContextMenuVisible: false, // Ensure context menu is hidden\n });\n } else if (shouldToggleContextMenu) {\n const mouseEvent = e as React.MouseEvent;\n updateDetailsState({\n item,\n isContextMenuVisible: !isContextMenuVisible && !isMobile(),\n isTooltipMobileVisible: false, // Ensure mobile tooltip is hidden\n contextMenuPosition: {\n x: mouseEvent.clientX - 10,\n y: mouseEvent.clientY - 5,\n },\n });\n }\n\n if (item) {\n onPointerDown(item.type, containerType ?? null, item);\n }\n };\n\n const onDraggableStart: DraggableEventHandler = () => {\n if (!item || isSelectingShortcut) {\n return;\n }\n\n refreshContextActions();\n\n if (onDragStart && containerType) {\n onDragStart(item, slotIndex, containerType);\n }\n };\n\n const onDraggableProgress: DraggableEventHandler = (_e, _data) => {\n // increment draggingDistance by 1\n updateDraggingState({\n draggingDistance: draggingState.draggingDistance + 1,\n });\n\n if (draggingDistance > 10) {\n updateDraggingState({\n isDragging: true,\n isFocused: true,\n });\n }\n\n if (!draggingState.item) {\n updateDraggingState({\n item: item,\n });\n }\n };\n\n return (\n <Container\n isDraggingItem={!!draggingState.item}\n item={item}\n className=\"rpgui-icon empty-slot\"\n onMouseUp={() => {\n const data = item ? item : null;\n if (onPlaceDrop && containerType)\n onPlaceDrop(data, slotIndex, containerType);\n }}\n onTouchEnd={e => {\n const { clientX, clientY } = e.changedTouches[0];\n const simulatedEvent = new MouseEvent('mouseup', {\n clientX,\n clientY,\n bubbles: true,\n });\n\n document\n .elementFromPoint(clientX, clientY)\n ?.dispatchEvent(simulatedEvent);\n }}\n onPointerDown={\n onDragStart !== undefined && onDragEnd !== undefined\n ? undefined\n : () => {\n if (item) onPointerDown(item.type, containerType ?? null, item);\n }\n }\n isSelectingShortcut={\n isSelectingShortcut &&\n (item?.type === ItemType.Consumable ||\n item?.type === ItemType.Tool ||\n item?.subType === ItemSubType.Seed)\n }\n >\n <Draggable\n axis={isSelectingShortcut ? 'none' : 'both'}\n defaultClassName={item ? 'draggable' : 'empty-slot'}\n scale={dragScale}\n disabled={onDragStart === undefined || onDragEnd === undefined}\n onStop={onDraggableStop}\n onStart={onDraggableStart}\n onDrag={onDraggableProgress}\n position={draggingState.position}\n cancel=\".empty-slot\"\n bounds=\".item-container-body, .equipment-container-body\"\n >\n <ItemContainer\n ref={dragContainer}\n isFocused={isFocused}\n onMouseOver={event => {\n onMouseOver?.(\n event,\n slotIndex,\n item,\n event.clientX,\n event.clientY\n );\n }}\n onMouseOut={() => {\n if (onMouseOut) onMouseOut();\n }}\n onMouseEnter={() => {\n updateDetailsState({\n item,\n isTooltipVisible: true,\n });\n }}\n onMouseLeave={() => {\n updateDetailsState({\n item,\n isTooltipVisible: false,\n });\n }}\n >\n <ItemSlotRenderer\n item={item}\n slotSpriteMask={slotSpriteMask}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n containerType={containerType}\n />\n </ItemContainer>\n </Draggable>\n </Container>\n );\n }\n);\n\ninterface ContainerTypes {\n item: IItem | null;\n containerType?: ItemContainerType | null;\n isSelectingShortcut?: boolean;\n isDraggingItem?: boolean;\n}\n\nconst Container = styled.div<ContainerTypes>`\n margin: 0.1rem;\n\n .react-draggable-dragging {\n // If dragging item, set opacity to 0\n opacity: ${({ isDraggingItem }) => (isDraggingItem ? 0 : 1)};\n }\n\n position: relative;\n\n .sprite-from-atlas-img--item {\n position: relative;\n top: 1.5rem;\n left: 1.5rem;\n border-color: ${({ item }) => rarityColor(item)};\n box-shadow: ${({ item }) => `0 0 5px 2px ${rarityColor(item)}`} inset,\n ${({ item }) => `0 0 4px 3px ${rarityColor(item)}`};\n }\n\n &::before {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 1;\n border-radius: 12px;\n pointer-events: none;\n animation: ${({ isSelectingShortcut }) =>\n isSelectingShortcut ? 'bg-color-change 1s infinite' : 'none'};\n\n @keyframes bg-color-change {\n 0% {\n background-color: rgba(255 255 255 / 0.5);\n }\n 50% {\n background-color: transparent;\n }\n 100% {\n background-color: rgba(255 255 255 / 0.5);\n }\n }\n }\n`;\n\nconst ItemContainer = styled.div<{ isFocused?: boolean }>`\n width: 64px;\n height: 64px;\n\n position: relative;\n ${props => props.isFocused && 'z-index: 100; pointer-events: none;'};\n`;\n","import { useCallback } from 'react';\n\ninterface IEventWithTarget {\n target: EventTarget | null;\n}\n\ninterface ITouchEvent extends IEventWithTarget {\n changedTouches?: TouchList;\n\n touches?: TouchList;\n}\n\nexport function useTouchTarget() {\n const getTouchTarget = useCallback(\n (e: MouseEvent | TouchEvent | IEventWithTarget): HTMLElement => {\n // Check if it's a touch event\n if ('changedTouches' in e || 'touches' in e) {\n const touchEvent = e as ITouchEvent;\n const touch = touchEvent.changedTouches?.[0] || touchEvent.touches?.[0];\n\n if (touch) {\n return document.elementFromPoint(\n touch.clientX,\n touch.clientY\n ) as HTMLElement;\n }\n }\n\n // If it's not a touch event or touch is not available, fallback to target\n return (e.target as HTMLElement) || document.body;\n },\n []\n );\n\n return getTouchTarget;\n}\n\nexport default useTouchTarget;\n","import { IItem } from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../../constants/uiColors';\nimport { uiFonts } from '../../../constants/uiFonts';\nimport { SpriteFromAtlas } from '../../shared/SpriteFromAtlas';\nimport { ErrorBoundary } from '../Inventory/ErrorBoundary';\nimport { EquipmentSlotSpriteByType } from '../Inventory/ItemSlot';\nimport { rarityColor } from '../Inventory/ItemSlotRarity';\n\ninterface IItemInfoProps {\n item: IItem;\n itemToCompare?: IItem;\n atlasIMG: any;\n atlasJSON: any;\n}\n\ninterface IItemStat {\n key: keyof IItem;\n label?: string;\n higherIsWorse?: boolean;\n}\n\nconst statisticsToDisplay: IItemStat[] = [\n { key: 'attack' },\n { key: 'defense' },\n { key: 'maxRange', label: 'Range' },\n { key: 'weight', higherIsWorse: true },\n];\n\nexport const ItemInfo: React.FC<IItemInfoProps> = ({\n item,\n itemToCompare,\n atlasIMG,\n atlasJSON,\n}) => {\n const renderStatistics = () => {\n const statistics: React.ReactNode[] = [];\n\n for (const stat of statisticsToDisplay) {\n const itemStatistic = item[stat.key];\n\n if (itemStatistic) {\n const label =\n stat.label || stat.key[0].toUpperCase() + stat.key.slice(1);\n\n const isItemToCompare = !!itemToCompare;\n\n const isOnlyInOneItem = isItemToCompare && !itemToCompare?.[stat.key];\n const statDiff =\n parseInt(itemStatistic.toString()) -\n parseInt(itemToCompare?.[stat.key]?.toString() ?? '0');\n\n const isDifference = isItemToCompare && statDiff !== 0;\n const isBetter =\n (statDiff > 0 && !stat.higherIsWorse) ||\n (statDiff < 0 && stat.higherIsWorse);\n\n statistics.push(\n <Statistic key={stat.key} className={isOnlyInOneItem ? 'better' : ''}>\n <div className=\"label\">{label}:</div>\n <div\n className={`value ${\n isDifference ? (isBetter ? 'better' : 'worse') : ''\n }`}\n >\n {`${itemStatistic.toString()} ${\n isDifference ? `(${statDiff > 0 ? '+' : ''}${statDiff})` : ''\n }`}\n </div>\n </Statistic>\n );\n }\n }\n\n return statistics;\n };\n\n const renderMissingStatistic = () => {\n const statistics: React.ReactNode[] = [];\n\n for (const stat of statisticsToDisplay) {\n const itemToCompareStatistic = itemToCompare?.[stat.key];\n\n if (itemToCompareStatistic && !item[stat.key]) {\n const label =\n stat.label || stat.key[0].toUpperCase() + stat.key.slice(1);\n\n statistics.push(\n <Statistic key={stat.key} className=\"worse\">\n <div className=\"label\">{label}:</div>\n <div className=\"value worse\">\n {itemToCompareStatistic.toString()}\n </div>\n </Statistic>\n );\n }\n }\n\n return statistics;\n };\n\n const renderEntityEffects = () => {\n if (!item.entityEffects || !item.entityEffectChance) return null;\n\n return item.entityEffects.map((effect, index) => (\n <Statistic key={index} $isSpecial>\n {effect[0].toUpperCase() + effect.slice(1)} ({item.entityEffectChance}%)\n </Statistic>\n ));\n };\n\n const renderAvaibleSlots = () => {\n if (!item.allowedEquipSlotType) return null;\n\n return item.allowedEquipSlotType.map((slotType, index) => (\n <ErrorBoundary key={index}>\n <SpriteFromAtlas\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={EquipmentSlotSpriteByType[slotType]}\n imgScale={2}\n grayScale={true}\n opacity={0.4}\n containerStyle={{ width: '32px', height: '32px' }}\n />\n </ErrorBoundary>\n ));\n };\n\n const skillName = item.minRequirements?.skill?.name;\n\n return (\n <Container item={item}>\n <Header>\n <div>\n <Title>{item.name}</Title>\n {item.rarity !== 'Common' && (\n <Rarity item={item}>{item.rarity}</Rarity>\n )}\n <Type>{item.subType}</Type>\n </div>\n <AllowedSlots>{renderAvaibleSlots()}</AllowedSlots>\n </Header>\n\n {item.minRequirements && (\n <LevelRequirement>\n <div className=\"title\">Requirements:</div>\n <div>- Level: {item.minRequirements?.level}</div>\n {skillName && (\n <div>\n - {skillName.charAt(0).toUpperCase() + skillName.slice(1)}:{' '}\n {item.minRequirements?.skill?.level}\n </div>\n )}\n </LevelRequirement>\n )}\n\n {renderStatistics()}\n {renderEntityEffects()}\n {item.usableEffectDescription && (\n <Statistic $isSpecial>{item.usableEffectDescription}</Statistic>\n )}\n {item.equippedBuffDescription && (\n <Statistic $isSpecial>{item.equippedBuffDescription}</Statistic>\n )}\n {item.isTwoHanded && <Statistic $isSpecial>Two handed</Statistic>}\n\n <Description>{item.description}</Description>\n\n {item.maxStackSize && item.maxStackSize !== 1 && (\n <StackInfo>\n x{Math.round((item.stackQty ?? 1) * 100) / 100}({item.maxStackSize})\n </StackInfo>\n )}\n\n {renderMissingStatistic().length > 0 && (\n <MissingStatistics>\n <Statistic>Equipped Diff</Statistic>\n {itemToCompare && renderMissingStatistic()}\n </MissingStatistics>\n )}\n </Container>\n );\n};\n\nconst Container = styled.div<{ item: IItem }>`\n color: white;\n background-color: #222;\n border-radius: 5px;\n padding: 0.5rem;\n font-size: ${uiFonts.size.small};\n border: 3px solid ${({ item }) => rarityColor(item) ?? uiColors.lightGray};\n height: max-content;\n width: 18rem;\n\n @media (max-width: 640px) {\n width: 80vw;\n }\n`;\n\nconst Title = styled.div`\n font-size: ${uiFonts.size.medium};\n font-weight: bold;\n margin-bottom: 0.5rem;\n display: flex;\n align-items: center;\n margin: 0;\n`;\n\nconst Rarity = styled.div<{ item: IItem }>`\n font-size: ${uiFonts.size.small};\n font-weight: normal;\n margin-top: 0.2rem;\n color: ${({ item }) => rarityColor(item)};\n filter: brightness(1.5);\n`;\n\nconst Type = styled.div`\n font-size: ${uiFonts.size.small};\n margin-top: 0.2rem;\n color: ${uiColors.lightGray};\n`;\n\nconst LevelRequirement = styled.div`\n font-size: ${uiFonts.size.small};\n margin-top: 0.2rem;\n margin-bottom: 1rem;\n color: ${uiColors.orange};\n\n .title {\n margin-bottom: 4px;\n }\n\n div {\n margin-bottom: 2px;\n }\n`;\n\nconst Statistic = styled.div<{ $isSpecial?: boolean }>`\n margin-bottom: 0.4rem;\n width: 100%;\n color: ${({ $isSpecial }) => ($isSpecial ? uiColors.darkYellow : 'inherit')};\n\n .label {\n display: inline-block;\n margin-right: 0.5rem;\n color: inherit;\n }\n\n .value {\n display: inline-block;\n color: inherit;\n }\n\n &.better,\n .better {\n color: ${uiColors.lightGreen};\n }\n\n &.worse,\n .worse {\n color: ${uiColors.cardinal};\n }\n`;\n\nconst Description = styled.div`\n margin-top: 1.5rem;\n font-size: ${uiFonts.size.small};\n color: ${uiColors.lightGray};\n font-style: italic;\n`;\n\nconst Header = styled.div`\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-bottom: 0.5rem;\n`;\n\nconst AllowedSlots = styled.div`\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 0.5rem;\n margin-left: auto;\n align-self: flex-start;\n`;\n\nconst StackInfo = styled.div`\n width: 100%;\n text-align: right;\n font-size: ${uiFonts.size.small};\n color: ${uiColors.orange};\n margin-top: 1rem;\n`;\n\nconst MissingStatistics = styled.div`\n margin-top: 1rem;\n color: ${uiColors.cardinal};\n`;\n","import { IEquipmentSet, IItem } from '@rpg-engine/shared';\nimport { camelCase } from 'lodash';\nimport React, { useMemo } from 'react';\nimport styled from 'styled-components';\nimport { ItemInfo } from './ItemInfo';\n\nexport interface IItemInfoDisplayProps {\n item: IItem;\n atlasIMG: any;\n atlasJSON: any;\n equipmentSet?: IEquipmentSet | null;\n isMobile?: boolean;\n}\n\ntype EquipmentSlotTypes =\n | 'head'\n | 'neck'\n | 'leftHand'\n | 'rightHand'\n | 'ring'\n | 'legs'\n | 'boot'\n | 'accessory'\n | 'armor'\n | 'inventory';\n\nconst itemSlotTypes: EquipmentSlotTypes[] = [\n 'head',\n 'neck',\n 'leftHand',\n 'rightHand',\n 'ring',\n 'legs',\n 'boot',\n 'accessory',\n 'armor',\n 'inventory',\n];\n\nconst getSlotType = (\n itemSlotTypes: string[],\n slotType: string,\n subType: string\n): keyof IEquipmentSet => {\n if (!itemSlotTypes.includes(slotType)) {\n return subType as keyof IEquipmentSet;\n }\n return slotType as keyof IEquipmentSet;\n};\n\nexport const ItemInfoDisplay: React.FC<IItemInfoDisplayProps> = ({\n item,\n atlasIMG,\n atlasJSON,\n equipmentSet,\n isMobile,\n}) => {\n const itemToCompare = useMemo(() => {\n if (equipmentSet && item.allowedEquipSlotType?.length) {\n const allowedSlotTypeCamelCase = camelCase(item.allowedEquipSlotType[0]);\n const itemSubTypeCamelCase = camelCase(item.subType);\n\n const slotType = getSlotType(\n itemSlotTypes,\n allowedSlotTypeCamelCase,\n itemSubTypeCamelCase\n );\n\n const itemSubTypeFromEquipment = Object.values(equipmentSet).find(\n item => camelCase(item?.subType ?? '') === itemSubTypeCamelCase\n );\n\n const itemFromEquipment = itemSubTypeFromEquipment\n ? itemSubTypeFromEquipment\n : (equipmentSet[slotType] as IItem);\n\n if (\n itemFromEquipment &&\n (!item._id || itemFromEquipment._id !== item._id)\n ) {\n return itemFromEquipment;\n }\n }\n\n return undefined;\n }, [equipmentSet, item]);\n\n return (\n <Flex $isMobile={isMobile}>\n <ItemInfo\n item={item}\n itemToCompare={itemToCompare}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n />\n\n {itemToCompare && (\n <CompareContainer>\n <Equipped>\n <span>Equipped</span>\n </Equipped>\n <ItemInfo\n item={itemToCompare}\n itemToCompare={item}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n />\n </CompareContainer>\n )}\n </Flex>\n );\n};\n\nconst Flex = styled.div<{ $isMobile?: boolean }>`\n display: flex;\n gap: 0.5rem;\n flex-direction: ${({ $isMobile }) => ($isMobile ? 'row-reverse' : 'row')};\n align-items: center;\n\n @media (max-width: 640px) {\n flex-direction: column-reverse;\n align-items: center;\n }\n`;\n\nconst Equipped = styled.div`\n position: absolute;\n bottom: 100%;\n left: 50%;\n transform: translateX(-50%);\n`;\n\nconst CompareContainer = styled.div`\n position: relative;\n`;\n","import { IEquipmentSet, IItem } from '@rpg-engine/shared';\nimport React, { useEffect, useRef } from 'react';\nimport styled from 'styled-components';\nimport ModalPortal from '../../Abstractions/ModalPortal';\nimport { ItemInfoDisplay } from './ItemInfoDisplay';\n\nexport interface IItemTooltipProps {\n item: IItem;\n atlasIMG: any;\n atlasJSON: any;\n equipmentSet?: IEquipmentSet | null;\n}\n\nconst offset = 20;\n\nexport const ItemTooltip: React.FC<IItemTooltipProps> = ({\n item,\n atlasIMG,\n atlasJSON,\n equipmentSet,\n}) => {\n const ref = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const { current } = ref;\n\n if (current) {\n const handleMouseMove = (event: MouseEvent) => {\n const { clientX, clientY } = event;\n\n // Adjust the position of the tooltip based on the mouse position\n const rect = current.getBoundingClientRect();\n\n const tooltipWidth = rect.width;\n const tooltipHeight = rect.height;\n const isOffScreenRight =\n clientX + tooltipWidth + offset > window.innerWidth;\n const isOffScreenBottom =\n clientY + tooltipHeight + offset > window.innerHeight;\n const x = isOffScreenRight\n ? clientX - tooltipWidth - offset\n : clientX + offset;\n const y = isOffScreenBottom\n ? clientY - tooltipHeight - offset\n : clientY + offset;\n\n current.style.transform = `translate(${x}px, ${y}px)`;\n current.style.opacity = '1';\n };\n\n window.addEventListener('mousemove', handleMouseMove);\n\n return () => {\n window.removeEventListener('mousemove', handleMouseMove);\n };\n }\n\n return;\n }, []);\n\n return (\n <ModalPortal>\n <Container ref={ref}>\n <ItemInfoDisplay\n item={item}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n equipmentSet={equipmentSet}\n />\n </Container>\n </ModalPortal>\n );\n};\n\nconst Container = styled.div`\n position: absolute;\n z-index: 100;\n pointer-events: none;\n left: 0;\n top: 0;\n opacity: 0;\n transition: opacity 0.08s;\n`;\n","import { IEquipmentSet, IItem } from '@rpg-engine/shared';\nimport React, { useRef } from 'react';\nimport styled from 'styled-components';\nimport ModalPortal from '../../Abstractions/ModalPortal';\nimport { ItemInfoDisplay } from './ItemInfoDisplay';\n\ninterface IListMenuOption {\n id: string;\n text: string;\n}\n\nexport interface MobileItemTooltipProps {\n item: IItem;\n atlasIMG: any;\n atlasJSON: any;\n closeTooltip: () => void;\n equipmentSet?: IEquipmentSet | null;\n scale?: number;\n options?: IListMenuOption[];\n onSelected?: (selectedOptionId: string) => void;\n}\n\nexport const MobileItemTooltip: React.FC<MobileItemTooltipProps> = ({\n item,\n atlasIMG,\n atlasJSON,\n closeTooltip,\n equipmentSet,\n scale = 1,\n options,\n onSelected,\n}) => {\n const ref = useRef<HTMLDivElement>(null);\n\n const handleFadeOut = () => {\n ref.current?.classList.add('fadeOut');\n };\n\n return (\n <ModalPortal>\n <Container\n ref={ref}\n onTouchEnd={() => {\n handleFadeOut();\n setTimeout(() => {\n closeTooltip();\n }, 100);\n }}\n scale={scale}\n >\n <ItemInfoDisplay\n item={item}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n equipmentSet={equipmentSet}\n isMobile\n />\n <OptionsContainer>\n {options?.map(option => (\n <Option\n key={option.id}\n onTouchEnd={() => {\n handleFadeOut();\n setTimeout(() => {\n onSelected?.(option.id);\n closeTooltip();\n }, 100);\n }}\n >\n {option.text}\n </Option>\n ))}\n </OptionsContainer>\n </Container>\n </ModalPortal>\n );\n};\n\nconst Container = styled.div<{ scale: number }>`\n position: absolute;\n z-index: 100;\n left: 0;\n top: 0;\n width: 100vw;\n height: 100vh;\n background-color: rgba(0 0 0 / 0.5);\n display: flex;\n justify-content: center;\n align-items: center;\n gap: 0.5rem;\n transition: opacity 0.08s;\n animation: fadeIn 0.1s forwards;\n\n @keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 0.92;\n }\n }\n\n @keyframes fadeOut {\n 0% {\n opacity: 0.92;\n }\n 100% {\n opacity: 0;\n }\n }\n\n &.fadeOut {\n animation: fadeOut 0.1s forwards;\n }\n\n @media (max-width: 640px) {\n flex-direction: column;\n }\n`;\n\nconst OptionsContainer = styled.div`\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n flex-wrap: wrap;\n\n @media (max-width: 640px) {\n flex-direction: row;\n justify-content: center;\n }\n`;\n\nconst Option = styled.button`\n padding: 1rem;\n background-color: #333;\n color: white;\n border: none;\n border-radius: 3px;\n width: 8rem;\n transition: background-color 0.1s;\n\n &:hover {\n background-color: #555;\n }\n\n @media (max-width: 640px) {\n padding: 1rem 0.5rem;\n }\n`;\n","import { IEquipmentSet, IItem } from '@rpg-engine/shared';\nimport React, { useState } from 'react';\nimport { ItemTooltip } from './ItemTooltip';\nimport { MobileItemTooltip } from './MobileItemTooltip';\n\ninterface IItemInfoWrapperProps {\n item: IItem;\n children: React.ReactNode;\n atlasIMG: any;\n atlasJSON: any;\n equipmentSet?: IEquipmentSet | null;\n scale?: number;\n}\n\nexport const ItemInfoWrapper: React.FC<IItemInfoWrapperProps> = ({\n children,\n atlasIMG,\n atlasJSON,\n item,\n equipmentSet,\n scale,\n}) => {\n const [isTooltipVisible, setIsTooltipVisible] = useState(false);\n const [isTooltipMobileVisible, setIsTooltipMobileVisible] = useState(false);\n\n return (\n <div\n onMouseEnter={() => {\n if (!isTooltipMobileVisible) setIsTooltipVisible(true);\n }}\n onMouseLeave={setIsTooltipVisible.bind(null, false)}\n onTouchEnd={() => {\n setIsTooltipMobileVisible(true);\n setIsTooltipVisible(false);\n }}\n >\n {children}\n\n {isTooltipVisible && !isTooltipMobileVisible && (\n <ItemTooltip\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n equipmentSet={equipmentSet}\n item={item}\n />\n )}\n {isTooltipMobileVisible && (\n <MobileItemTooltip\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n equipmentSet={equipmentSet}\n closeTooltip={() => {\n setIsTooltipMobileVisible(false);\n console.log('close');\n }}\n item={item}\n scale={scale}\n />\n )}\n </div>\n );\n};\n","import {\n ICraftableItem,\n IEquipmentSet,\n IItemContainer,\n ISkill,\n} from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\nimport { countItemFromInventory } from '../../libs/itemCounter';\nimport { ItemInfoWrapper } from '../Item/Cards/ItemInfoWrapper';\nimport { SpriteFromAtlas } from '../shared/SpriteFromAtlas';\n\ninterface ICraftingRecipeProps {\n atlasJSON: any;\n atlasIMG: any;\n equipmentSet?: IEquipmentSet | null;\n recipe: ICraftableItem;\n scale?: number;\n handleRecipeSelect: () => void;\n selectedCraftItemKey?: string;\n inventory?: IItemContainer | null;\n skills?: ISkill | null;\n}\n\nexport const CraftingRecipe: React.FC<ICraftingRecipeProps> = ({\n atlasIMG,\n atlasJSON,\n equipmentSet,\n recipe,\n scale,\n handleRecipeSelect,\n selectedCraftItemKey,\n inventory,\n skills,\n}) => {\n const modifyString = (str: string) => {\n // Split the string by \"/\" and \".\"\n let parts = str.split('/');\n let fileName = parts[parts.length - 1];\n parts = fileName.split('.');\n let name = parts[0];\n\n // Replace all occurrences of \"-\" with \" \"\n name = name.replace(/-/g, ' ');\n\n // Uppercase the first word\n let words = name.split(' ');\n let firstWord = words[0].slice(0, 1).toUpperCase() + words[0].slice(1);\n let modifiedWords = [firstWord].concat(words.slice(1));\n name = modifiedWords.join(' ');\n\n return name;\n };\n\n const levelInSkill =\n (skills?.[\n (recipe?.minCraftingRequirements?.[0] ?? '') as keyof ISkill\n ] as any)?.level ?? 1;\n\n return (\n <RadioOptionsWrapper>\n <SpriteAtlasWrapper>\n <ItemInfoWrapper\n item={recipe}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n equipmentSet={equipmentSet}\n scale={scale}\n >\n <SpriteFromAtlas\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={recipe.texturePath}\n imgScale={3}\n grayScale={!recipe.canCraft}\n />\n </ItemInfoWrapper>\n </SpriteAtlasWrapper>\n <div>\n <div onPointerUp={recipe.canCraft ? handleRecipeSelect : undefined}>\n <input\n className=\"rpgui-radio\"\n type=\"radio\"\n value={recipe.name}\n name=\"test\"\n disabled={!recipe.canCraft}\n checked={selectedCraftItemKey === recipe.key}\n onChange={handleRecipeSelect}\n />\n <label style={{ display: 'flex', alignItems: 'center' }}>\n {modifyString(recipe.name)}\n </label>\n </div>\n\n <MinCraftingRequirementsText levelIsOk={recipe?.levelIsOk ?? false}>\n {modifyString(`${recipe?.minCraftingRequirements?.[0] ?? ''}`)} lvl{' '}\n {recipe?.minCraftingRequirements?.[1] ?? 0} ({levelInSkill})\n </MinCraftingRequirementsText>\n\n {recipe.ingredients.map((ingredient, index) => {\n const itemQtyInInventory = !inventory\n ? 0\n : countItemFromInventory(ingredient.key, inventory);\n\n return (\n <Recipe key={index}>\n <SpriteFromAtlas\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={ingredient.texturePath}\n imgScale={1.2}\n />\n <Ingredient isQuantityOk={ingredient.qty <= itemQtyInInventory}>\n {modifyString(ingredient.key)} x{ingredient.qty} (\n {itemQtyInInventory})\n </Ingredient>\n </Recipe>\n );\n })}\n </div>\n </RadioOptionsWrapper>\n );\n};\n\nconst Ingredient = styled.p<{ isQuantityOk: boolean }>`\n margin: 0;\n margin-left: 14px;\n color: ${({ isQuantityOk }) =>\n isQuantityOk ? uiColors.lightGreen : uiColors.lightGray} !important;\n`;\n\nconst Recipe = styled.div`\n font-size: 0.6rem;\n margin-bottom: 3px;\n display: flex;\n align-items: center;\n margin-left: 4px;\n\n .sprite-from-atlas-img {\n top: 0px;\n left: 0px;\n }\n`;\n\nconst SpriteAtlasWrapper = styled.div`\n margin-right: 40px;\n`;\n\nconst RadioOptionsWrapper = styled.div`\n display: flex;\n align-items: stretch;\n margin-bottom: 40px;\n`;\n\nconst MinCraftingRequirementsText = styled.p<{ levelIsOk: boolean }>`\n font-size: 0.6rem !important;\n margin: 0 5px 0 35px;\n color: ${({ levelIsOk }) =>\n levelIsOk ? uiColors.lightGreen : uiColors.lightGray} !important;\n`;\n","import {\n ICraftableItem,\n IEquipmentSet,\n IItemContainer,\n ISkill,\n ItemSubType,\n} from '@rpg-engine/shared';\nimport React, { useEffect, useState } from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\nimport { Button, ButtonTypes } from '../Button';\nimport { DraggableContainer } from '../DraggableContainer';\nimport { InputRadio } from '../InputRadio';\nimport { RPGUIContainerTypes } from '../RPGUI/RPGUIContainer';\nimport { CraftingRecipe } from './CraftingRecipe';\nimport { calculateMaxCraftable } from './utils/calculateMaxCraftable';\n\nexport interface IItemCraftSelectorProps {\n atlasJSON: any;\n atlasIMG: any;\n onClose: () => void;\n onSelect: (value: string) => void;\n onCraftItem: (value: string | undefined, maxCraftable: number) => void;\n craftablesItems: ICraftableItem[];\n equipmentSet?: IEquipmentSet | null;\n inventory?: IItemContainer | null;\n scale?: number;\n skills?: ISkill | null;\n savedSelectedType?: string;\n}\n\nexport interface ShowMessage {\n show: boolean;\n index: number;\n}\n\nconst desktop = {\n width: 'min(900px, 80%)',\n height: 'min(700px, 80%)',\n};\n\nconst mobileLanscape = {\n width: '800px',\n height: '500px',\n};\n\nconst mobilePortrait = {\n width: '500px',\n height: '700px',\n};\n\nexport const CraftBook: React.FC<IItemCraftSelectorProps> = ({\n atlasIMG,\n atlasJSON,\n onClose,\n onSelect,\n onCraftItem,\n craftablesItems,\n equipmentSet,\n scale,\n inventory,\n skills,\n savedSelectedType,\n}) => {\n const [craftItemKey, setCraftItemKey] = useState<string>();\n const [selectedType, setSelectedType] = useState<string>(\n savedSelectedType ?? Object.keys(ItemSubType)[0]\n );\n const [size, setSize] = useState<{ width: string; height: string }>();\n const [searchTerm, setSearchTerm] = useState('');\n const [isCraftingDisabled, setIsCraftingDisabled] = useState(false);\n\n useEffect(() => {\n const handleResize = (): void => {\n if (\n window.innerWidth < 500 &&\n size?.width !== mobilePortrait.width &&\n (!scale || scale < 1)\n ) {\n setSize(mobilePortrait);\n } else if (\n (!scale || scale < 1) &&\n size?.width !== mobileLanscape.width\n ) {\n setSize(mobileLanscape);\n } else if (size?.width !== desktop.width) {\n setSize(desktop);\n }\n };\n handleResize();\n\n window.addEventListener('resize', handleResize);\n\n return () => window.removeEventListener('resize', handleResize);\n }, [scale]);\n\n const renderItemTypes = () => {\n const itemTypes = ['Suggested', ...Object.keys(ItemSubType)]\n .filter(type => type !== 'DeadBody')\n .sort((a, b) => {\n if (a === 'Suggested') return -1;\n if (b === 'Suggested') return 1;\n return a.localeCompare(b);\n });\n\n if (window.innerWidth > parseInt(mobilePortrait.width)) {\n return itemTypes.map(type => {\n return (\n <InputRadio\n key={type}\n value={type}\n label={type}\n name={type}\n isChecked={selectedType === type}\n onRadioSelect={value => {\n setSelectedType(value);\n onSelect(value);\n }}\n />\n );\n });\n }\n\n const rows: JSX.Element[][] = [[], []];\n\n itemTypes.forEach((type, index) => {\n let row = 0;\n\n if (index % 2 === 1) row = 1;\n\n rows[row].push(\n <InputRadio\n key={type}\n value={type}\n label={type}\n name={type}\n isChecked={selectedType === type}\n onRadioSelect={value => {\n setSelectedType(value);\n onSelect(value);\n }}\n />\n );\n });\n\n return rows.map((row, index) => (\n <div key={index} style={{ display: 'flex', gap: '10px' }}>\n {row}\n </div>\n ));\n };\n\n const filteredCraftableItems = craftablesItems?.filter(item => {\n const matchesSearch = item.name\n .toLowerCase()\n .includes(searchTerm.toLowerCase());\n const matchesCategory =\n selectedType === 'Suggested' || item.type === selectedType;\n return matchesSearch && matchesCategory;\n });\n\n if (!size) return null;\n\n return (\n <DraggableContainer\n type={RPGUIContainerTypes.Framed}\n width={size.width}\n height={size.height}\n cancelDrag=\".inputRadioCraftBook\"\n onCloseButton={() => {\n if (onClose) {\n onClose();\n }\n }}\n scale={scale}\n >\n <Wrapper>\n <div style={{ width: '100%' }}>\n <Title>Craftbook</Title>\n <Subtitle>Select an item to craft</Subtitle>\n <SearchContainer>\n <input\n type=\"text\"\n className=\"rpgui-input\"\n placeholder=\"Search items...\"\n value={searchTerm}\n onChange={e => setSearchTerm(e.target.value)}\n />\n </SearchContainer>\n <hr className=\"golden\" />\n </div>\n\n <ContentContainer>\n <ItemTypes className=\"inputRadioCraftBook\">\n {renderItemTypes()}\n </ItemTypes>\n\n <RadioInputScroller className=\"inputRadioCraftBook\">\n {filteredCraftableItems?.map(item => (\n <CraftingRecipe\n key={item.key}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n equipmentSet={equipmentSet}\n recipe={item}\n scale={scale}\n handleRecipeSelect={setCraftItemKey.bind(null, item.key)}\n selectedCraftItemKey={craftItemKey}\n inventory={inventory}\n skills={skills}\n />\n ))}\n </RadioInputScroller>\n </ContentContainer>\n <ButtonWrapper>\n <Button buttonType={ButtonTypes.RPGUIButton} onPointerDown={onClose}>\n Cancel\n </Button>\n <Button\n disabled={!craftItemKey || isCraftingDisabled}\n buttonType={ButtonTypes.RPGUIButton}\n onPointerDown={() => {\n if (!craftItemKey || isCraftingDisabled) return;\n\n const selectedItem = craftablesItems.find(\n item => item.key === craftItemKey\n );\n const maxCraftable = calculateMaxCraftable(\n selectedItem,\n inventory\n );\n\n onCraftItem(craftItemKey, maxCraftable);\n setIsCraftingDisabled(true);\n\n setTimeout(() => {\n setIsCraftingDisabled(false);\n }, 2000);\n }}\n >\n Craft\n </Button>\n </ButtonWrapper>\n </Wrapper>\n </DraggableContainer>\n );\n};\n\nconst Wrapper = styled.div`\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n`;\n\nconst Title = styled.h1`\n font-size: 0.6rem;\n color: ${uiColors.yellow} !important;\n`;\n\nconst Subtitle = styled.h1`\n font-size: 0.4rem;\n color: ${uiColors.yellow} !important;\n`;\n\nconst RadioInputScroller = styled.div`\n padding-left: 15px;\n padding-top: 10px;\n margin-top: 1rem;\n align-items: center;\n align-items: flex-start;\n overflow-y: scroll;\n min-height: 0;\n flex: 1;\n margin-left: 10px;\n -webkit-overflow-scrolling: touch;\n\n @media (max-width: ${mobilePortrait.width}) {\n margin-left: 0;\n }\n`;\n\nconst ButtonWrapper = styled.div`\n display: flex;\n justify-content: flex-end;\n margin-top: 10px;\n width: 100%;\n\n button {\n padding: 0px 50px;\n margin: 5px;\n }\n\n @media (max-width: ${mobilePortrait.width}) {\n justify-content: center;\n }\n`;\n\nconst ContentContainer = styled.div`\n display: flex;\n width: 100%;\n min-height: 0;\n flex: 1;\n\n @media (max-width: ${mobilePortrait.width}) {\n flex-direction: column;\n }\n`;\n\nconst ItemTypes = styled.div`\n display: flex;\n overflow-y: scroll;\n overflow-x: hidden;\n width: max-content;\n flex-direction: column;\n padding-right: 5px;\n\n @media (max-width: ${mobilePortrait.width}) {\n overflow-x: scroll;\n overflow-y: hidden;\n padding-right: 0;\n width: 100%;\n }\n`;\n\nconst SearchContainer = styled.div`\n margin: 8px 0;\n padding: 0 16px;\n\n input {\n width: 100%;\n font-size: 0.8rem;\n padding: 8px 12px;\n background-color: rgba(0, 0, 0, 0.3);\n border: none;\n color: white;\n border-radius: 4px;\n\n &::placeholder {\n color: rgba(255, 255, 255, 0.5);\n }\n\n &:focus {\n outline: none;\n background-color: rgba(0, 0, 0, 0.4);\n }\n }\n`;\n","import React, { useEffect, useState } from 'react';\nimport styled from 'styled-components';\nimport { v4 as uuidv4 } from 'uuid';\n\nexport interface IOptionsProps {\n id: number;\n value: string;\n option: string | JSX.Element;\n}\n\nexport interface IDropdownProps {\n options: IOptionsProps[];\n width?: string;\n onChange: (value: string) => void;\n opensUp?: boolean; // Add a new prop to control the dropdown direction\n}\n\nexport const Dropdown: React.FC<IDropdownProps> = ({\n options,\n width,\n onChange,\n opensUp = false, // Default value is false\n}) => {\n const dropdownId = uuidv4();\n\n const [selectedValue, setSelectedValue] = useState<string>('');\n const [selectedOption, setSelectedOption] = useState<string | JSX.Element>(\n ''\n );\n const [opened, setOpened] = useState<boolean>(false);\n\n useEffect(() => {\n const firstOption = options[0];\n\n if (firstOption) {\n let change = !selectedValue;\n if (!change) {\n change = options.filter(o => o.value === selectedValue).length < 1;\n }\n\n if (change) {\n setSelectedValue(firstOption.value);\n setSelectedOption(firstOption.option);\n }\n }\n }, [options]);\n\n useEffect(() => {\n if (selectedValue) {\n onChange(selectedValue);\n }\n }, [selectedValue]);\n\n return (\n <Container onMouseLeave={() => setOpened(false)} width={width}>\n <DropdownSelect\n id={`dropdown-${dropdownId}`}\n className=\"rpgui-dropdown-imp rpgui-dropdown-imp-header\"\n onPointerUp={() => setOpened(prev => !prev)}\n >\n <label>▼</label> {selectedOption}\n </DropdownSelect>\n\n <DropdownOptions\n className=\"rpgui-dropdown-imp\"\n opened={opened}\n opensUp={opensUp}\n >\n {options.map(option => {\n return (\n <li\n key={option.id}\n onPointerUp={() => {\n setSelectedValue(option.value);\n setSelectedOption(option.option);\n setOpened(false);\n }}\n >\n {option.option}\n </li>\n );\n })}\n </DropdownOptions>\n </Container>\n );\n};\n\nconst Container = styled.div<{ width: string | undefined }>`\n position: relative;\n width: ${props => props.width || '100%'};\n`;\n\nconst DropdownSelect = styled.p`\n width: 100%;\n box-sizing: border-box;\n\n label {\n display: inline-block;\n transform: translateY(-2px);\n }\n`;\n\nconst DropdownOptions = styled.ul<{\n opened: boolean;\n opensUp: boolean;\n}>`\n position: absolute;\n width: 100%;\n max-height: 300px;\n overflow-y: auto;\n display: ${props => (props.opened ? 'block' : 'none')};\n box-sizing: border-box;\n bottom: ${props => (props.opensUp ? '100%' : 'auto')};\n top: ${props => (props.opensUp ? 'auto' : '100%')};\n margin: 0;\n padding: 0;\n @media (max-width: 768px) {\n padding: 8px 0;\n }\n`;\n","import React from 'react';\nimport styled from 'styled-components';\nimport { uiFonts } from '../constants/uiFonts';\nimport { Dropdown } from './Dropdown';\n\ninterface IDropdownSelectorOption {\n id: string;\n name: string;\n}\n\nexport interface IDropdownSelectorContainer {\n onChange: (id: string) => void;\n options: IDropdownSelectorOption[];\n details?: string;\n title: string;\n}\n\nexport const DropdownSelectorContainer: React.FC<IDropdownSelectorContainer> = ({\n title,\n onChange,\n options,\n details,\n}) => {\n return (\n <div>\n <p>{title}</p>\n <Dropdown\n options={options.map((option, index) => ({\n option: option.name,\n value: option.id,\n id: index,\n }))}\n onChange={onChange}\n />\n <Details>{details}</Details>\n </div>\n );\n};\n\nconst Details = styled.p`\n font-size: ${uiFonts.size.xsmall} !important;\n`;\n","import { getItemTextureKeyPath } from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { useCursorPosition } from '../../../hooks/useCursorPosition';\nimport { SpriteFromAtlas } from '../../shared/SpriteFromAtlas';\nimport { onRenderStackInfo } from './ItemSlotQty/ItemSlotQty';\nimport { useItemSlotDragging } from './context/ItemSlotDraggingContext';\n\nconst CONTAINER_SIZE = 32;\nconst OFFSET = CONTAINER_SIZE / 2;\n\ninterface IProps {\n atlasJSON: any;\n atlasIMG: any;\n scale?: number;\n}\n\nexport const DraggedItem = ({\n atlasJSON,\n atlasIMG,\n scale,\n}: IProps): JSX.Element | null => {\n const { draggingState } = useItemSlotDragging();\n\n const { item } = draggingState;\n\n const { x, y } = useCursorPosition({\n scale,\n });\n\n if (!item) {\n return null;\n }\n\n if (x === 0 && y === 0) {\n return null;\n }\n\n const centeredX = x - OFFSET;\n const centeredY = y - OFFSET;\n\n const stackInfo = onRenderStackInfo(item?._id ?? '', item?.stackQty ?? 0);\n\n return (\n <Container>\n <SpriteContainer x={centeredX} y={centeredY}>\n <SpriteFromAtlas\n key={item._id}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={getItemTextureKeyPath(\n {\n key: item.texturePath,\n texturePath: item.texturePath,\n stackQty: item.stackQty || 1,\n isStackable: item.isStackable,\n },\n atlasJSON\n )}\n imgScale={3}\n imgClassname=\"sprite-from-atlas-img--item\"\n />\n {stackInfo}\n </SpriteContainer>\n </Container>\n );\n};\n\ninterface IContainer {\n x: number;\n y: number;\n}\n\nconst pulse = `\n @keyframes pulse {\n 0%, 100% {\n transform: scale(1) rotate(-3deg);\n }\n 50% {\n transform: scale(0.95) rotate(-3deg);\n }\n }\n`;\n\nconst Container = styled.div`\n position: relative;\n`;\n\nconst SpriteContainer = styled.div.attrs<IContainer>(props => ({\n style: {\n left: `${props.x}px`,\n top: `${props.y}px`,\n },\n}))<IContainer>`\n ${pulse}\n\n position: absolute;\n z-index: 100;\n pointer-events: none;\n\n width: ${CONTAINER_SIZE}px;\n height: ${CONTAINER_SIZE}px;\n\n transform: rotate(-3deg);\n\n filter: grayscale(100%);\n opacity: 0.35;\n\n animation: pulse 2s infinite;\n\n .item-slot-qty {\n position: absolute;\n bottom: 0;\n margin-left: 0.8rem;\n }\n`;\n\nexport default DraggedItem;\n","import { GRID_HEIGHT, GRID_WIDTH } from '@rpg-engine/shared';\nimport { useCallback, useEffect, useState } from 'react';\nimport { IPosition } from '../types/eventTypes';\n\ninterface ICursorPositionProps {\n scale?: number;\n}\n\nexport const useCursorPosition = ({ scale = 1 }: ICursorPositionProps): IPosition => {\n const [position, setPosition] = useState<IPosition>({ x: 0, y: 0 });\n\n const scalePosition = useCallback((x: number, y: number): IPosition => {\n return {\n x: ((x - GRID_WIDTH / 2) / scale) + GRID_WIDTH / 2,\n y: ((y - GRID_HEIGHT / 2) / scale) + GRID_HEIGHT / 2,\n };\n }, [scale]);\n\n const setFromEvent = useCallback((e: MouseEvent | TouchEvent) => {\n let x, y;\n\n if ('touches' in e) {\n x = e.touches[0].clientX;\n y = e.touches[0].clientY;\n } else {\n x = e.clientX;\n y = e.clientY;\n }\n\n const scaledPosition = scalePosition(x, y);\n setPosition(scaledPosition);\n }, [scale, scalePosition]);\n\n const cleanup = useCallback(() => {\n setPosition({ x: 0, y: 0 });\n }, []);\n\n useEffect(() => {\n const handleEvent = (e: Event) => setFromEvent(e as MouseEvent | TouchEvent);\n\n window.addEventListener('mousemove', handleEvent);\n window.addEventListener('touchmove', handleEvent);\n window.addEventListener('mouseup', cleanup);\n window.addEventListener('touchend', cleanup);\n\n return () => {\n window.removeEventListener('mousemove', handleEvent);\n window.removeEventListener('touchmove', handleEvent);\n window.removeEventListener('mouseup', cleanup);\n window.removeEventListener('touchend', cleanup);\n };\n }, [setFromEvent, cleanup]);\n\n return position;\n};\n","import React, { useEffect, useRef } from 'react';\nimport styled from 'styled-components';\nimport { useOutsideClick } from '../hooks/useOutsideAlerter';\nimport ModalPortal from './Abstractions/ModalPortal';\n\ninterface IListMenuOption {\n id: string;\n text: string;\n}\n\nexport interface IRelativeMenuProps {\n options: IListMenuOption[];\n onSelected: (selectedOptionId: string) => void;\n fontSize?: number;\n onOutsideClick?: () => void;\n pos: { x: number; y: number };\n}\n\nexport const RelativeListMenu: React.FC<IRelativeMenuProps> = ({\n options,\n onSelected,\n onOutsideClick,\n fontSize = 0.8,\n pos,\n}) => {\n const ref = useRef(null);\n\n useOutsideClick(ref, 'relative-context-menu');\n\n useEffect(() => {\n document.addEventListener('clickOutside', event => {\n const e = event as CustomEvent;\n\n if (e.detail.id === 'relative-context-menu') {\n if (onOutsideClick) {\n onOutsideClick();\n }\n }\n });\n\n return () => {\n document.removeEventListener('clickOutside', _e => {});\n };\n }, []);\n\n return (\n <ModalPortal>\n <Container fontSize={fontSize} ref={ref} {...pos}>\n <ul className=\"rpgui-list-imp\" style={{ overflow: 'hidden' }}>\n {options.map((params, index) => (\n <ListElement\n key={params?.id || index}\n onPointerDown={() => {\n onSelected(params?.id);\n }}\n >\n {params?.text || 'No text'}\n </ListElement>\n ))}\n </ul>\n </Container>\n </ModalPortal>\n );\n};\n\ninterface IContainerProps {\n fontSize?: number;\n x: number;\n y: number;\n}\n\nconst Container = styled.div<IContainerProps>`\n position: absolute;\n top: ${props => props.y}px;\n left: ${props => props.x}px;\n\n display: flex;\n flex-direction: column;\n width: max-content;\n justify-content: start;\n align-items: flex-start;\n\n li {\n font-size: ${props => props.fontSize}em;\n }\n`;\n\nconst ListElement = styled.li`\n margin-right: 0.5rem;\n`;\n","import { IEquipmentSet, IItem } from '@rpg-engine/shared';\nimport React from 'react';\nimport { RelativeListMenu } from '../../RelativeListMenu';\nimport { ItemTooltip } from '../Cards/ItemTooltip';\nimport { MobileItemTooltip } from '../Cards/MobileItemTooltip';\nimport { useItemSlotDetails } from './context/ItemSlotDetailsContext';\nimport { useItemSlotDragging } from './context/ItemSlotDraggingContext';\n\ninterface IProps {\n dragScale: number | undefined;\n onSelected?: (optionId: string, item: IItem) => void;\n atlasIMG: any;\n atlasJSON: any;\n equipmentSet?: IEquipmentSet | null;\n isContextMenuDisabled?: boolean;\n}\n\nexport const ItemSlotToolTips = ({\n dragScale,\n onSelected,\n atlasIMG,\n atlasJSON,\n equipmentSet,\n isContextMenuDisabled,\n}: IProps): JSX.Element => {\n const { detailsState, updateDetailsState } = useItemSlotDetails();\n\n const {\n isTooltipVisible,\n isTooltipMobileVisible,\n isContextMenuVisible,\n contextMenuPosition,\n contextActions,\n item,\n } = detailsState;\n\n const { draggingState } = useItemSlotDragging();\n\n const { isFocused } = draggingState;\n\n return (\n <>\n {isTooltipVisible && item && !isFocused && (\n <ItemTooltip\n item={item}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n equipmentSet={equipmentSet}\n />\n )}\n\n {isTooltipMobileVisible && item && (\n <MobileItemTooltip\n item={item}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n equipmentSet={equipmentSet}\n closeTooltip={() => {\n updateDetailsState({ isTooltipMobileVisible: false });\n }}\n scale={dragScale}\n options={contextActions}\n onSelected={(optionId: string) => {\n updateDetailsState({\n isContextMenuVisible: false,\n });\n if (item) {\n onSelected?.(optionId, item);\n }\n }}\n />\n )}\n\n {!isContextMenuDisabled &&\n isContextMenuVisible &&\n contextActions &&\n contextActions.length > 0 && (\n <RelativeListMenu\n options={contextActions}\n onSelected={(optionId: string) => {\n updateDetailsState({ isContextMenuVisible: false });\n if (item) {\n onSelected?.(optionId, item);\n }\n }}\n onOutsideClick={() => {\n updateDetailsState({ isContextMenuVisible: false });\n }}\n pos={contextMenuPosition}\n />\n )}\n </>\n );\n};\n","import {\n IEquipmentSet,\n IItem,\n IItemContainer,\n isMobile,\n ItemContainerType,\n ItemSlotType,\n ItemType,\n} from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { IPosition } from '../../types/eventTypes';\nimport { DraggableContainer } from '../DraggableContainer';\nimport { ItemSlotDetailsProvider } from '../Item/Inventory/context/ItemSlotDetailsContext';\nimport { ItemSlotDraggingProvider } from '../Item/Inventory/context/ItemSlotDraggingContext';\nimport DraggedItem from '../Item/Inventory/DraggedItem';\nimport { ItemSlot } from '../Item/Inventory/ItemSlot';\nimport { ItemSlotToolTips } from '../Item/Inventory/ItemSlotTooltips';\nimport { RPGUIContainerTypes } from '../RPGUI/RPGUIContainer';\n\nexport interface IEquipmentSetProps {\n equipmentSet: IEquipmentSet;\n onClose?: () => void;\n onItemClick?: (\n ItemType: ItemType,\n item: IItem,\n itemContainerType: ItemContainerType | null\n ) => void;\n onItemDragStart?: (\n item: IItem,\n slotIndex: number,\n itemContainerType: ItemContainerType | null\n ) => void;\n onItemDragEnd?: (quantity?: number) => void;\n onItemPlaceDrop?: (\n item: IItem | null,\n slotIndex: number,\n itemContainerType: ItemContainerType | null\n ) => void;\n onItemOutsideDrop?: (item: IItem, position: IPosition) => void;\n scale?: number;\n checkIfItemCanBeMoved: () => boolean;\n checkIfItemShouldDragEnd?: () => boolean;\n onMouseOver?: (e: any, slotIndex: number, item: IItem | null) => void;\n onSelected?: (optionId: string) => void;\n initialPosition?: { x: number; y: number };\n type: ItemContainerType | null;\n atlasIMG: any;\n atlasJSON: any;\n onPositionChangeEnd?: (position: IPosition) => void;\n onPositionChangeStart?: (position: IPosition) => void;\n}\n\nexport const EquipmentSet: React.FC<IEquipmentSetProps> = ({\n equipmentSet,\n onClose,\n onMouseOver,\n onSelected,\n onItemClick,\n atlasIMG,\n atlasJSON,\n onItemDragEnd,\n onItemDragStart,\n onItemPlaceDrop,\n onItemOutsideDrop,\n checkIfItemCanBeMoved,\n checkIfItemShouldDragEnd,\n scale,\n initialPosition,\n onPositionChangeEnd,\n onPositionChangeStart,\n}) => {\n const {\n neck,\n leftHand,\n ring,\n head,\n armor,\n legs,\n boot,\n inventory,\n rightHand,\n accessory,\n } = equipmentSet;\n\n const equipmentData = [\n neck,\n leftHand,\n ring,\n head,\n armor,\n legs,\n boot,\n inventory,\n rightHand,\n accessory,\n ];\n\n const equipmentMaskSlots = [\n ItemSlotType.Neck,\n ItemSlotType.LeftHand,\n ItemSlotType.Ring,\n ItemSlotType.Head,\n ItemSlotType.Torso,\n ItemSlotType.Legs,\n ItemSlotType.Feet,\n ItemSlotType.Inventory,\n ItemSlotType.RightHand,\n ItemSlotType.Accessory,\n ];\n\n const onRenderEquipmentSlotRange = (start: number, end: number) => {\n const equipmentRange = equipmentData.slice(start, end);\n const slotMaksRange = equipmentMaskSlots.slice(start, end);\n\n return equipmentRange.map((data, i) => {\n const item = data as IItem;\n const itemContainer =\n (item && (item.itemContainer as IItemContainer)) ?? null;\n\n return (\n <ItemSlot\n key={i}\n slotIndex={i}\n item={item}\n itemContainer={itemContainer}\n itemContainerType={ItemContainerType.Equipment}\n slotSpriteMask={slotMaksRange[i]}\n onMouseOver={(event, slotIndex, item) => {\n if (onMouseOver) onMouseOver(event, slotIndex, item);\n }}\n onPointerDown={(itemType, ContainerType) => {\n if (onItemClick) onItemClick(itemType, item, ContainerType);\n }}\n onDragStart={(item, slotIndex, itemContainerType) => {\n if (!item) {\n return;\n }\n\n if (onItemDragStart)\n onItemDragStart(item, slotIndex, itemContainerType);\n }}\n onDragEnd={quantity => {\n if (onItemDragEnd) onItemDragEnd(quantity);\n }}\n dragScale={scale}\n checkIfItemCanBeMoved={checkIfItemCanBeMoved}\n checkIfItemShouldDragEnd={checkIfItemShouldDragEnd}\n onPlaceDrop={(item, slotIndex, itemContainerType) => {\n if (onItemPlaceDrop)\n onItemPlaceDrop(item, slotIndex, itemContainerType);\n }}\n onOutsideDrop={(item, position) => {\n if (onItemOutsideDrop) onItemOutsideDrop(item, position);\n }}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n />\n );\n });\n };\n\n return (\n <ItemSlotDraggingProvider>\n <ItemSlotDetailsProvider>\n <DraggedItem atlasIMG={atlasIMG} atlasJSON={atlasJSON} scale={scale} />\n <DraggableContainer\n title={'Equipments'}\n type={RPGUIContainerTypes.Framed}\n onCloseButton={() => {\n if (onClose) onClose();\n }}\n width=\"330px\"\n cancelDrag=\".equipment-container-body\"\n scale={scale}\n initialPosition={initialPosition}\n onPositionChangeEnd={onPositionChangeEnd}\n onPositionChangeStart={onPositionChangeStart}\n >\n <EquipmentSetContainer className=\"equipment-container-body\">\n <EquipmentColumn>\n {onRenderEquipmentSlotRange(0, 3)}\n </EquipmentColumn>\n <EquipmentColumn>\n {onRenderEquipmentSlotRange(3, 7)}\n </EquipmentColumn>\n <EquipmentColumn>\n {onRenderEquipmentSlotRange(7, 10)}\n </EquipmentColumn>\n </EquipmentSetContainer>\n </DraggableContainer>\n\n <ItemSlotToolTips\n dragScale={scale}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n equipmentSet={equipmentSet}\n onSelected={onSelected}\n isContextMenuDisabled={isMobile()}\n />\n </ItemSlotDetailsProvider>\n </ItemSlotDraggingProvider>\n );\n};\n\nconst EquipmentSetContainer = styled.div`\n width: inherit;\n display: flex;\n justify-content: center;\n flex-wrap: wrap;\n flex-direction: row;\n touch-action: none;\n overflow: hidden;\n`;\n\nconst EquipmentColumn = styled.div`\n display: flex;\n justify-content: center;\n flex-wrap: wrap;\n flex-direction: column;\n touch-action: none;\n`;\n","import styled from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\n\nexport const Table = styled.table`\n width: 100%;\n border-collapse: collapse;\n margin-top: 1rem;\n`;\n\nexport const TableRow = styled.tr`\n &:nth-child(even) {\n background-color: rgba(255, 255, 255, 0.05) !important;\n }\n &:hover {\n background-color: rgba(255, 255, 255, 0.1) !important;\n }\n`;\n\nexport const TableHeader = styled.th`\n text-align: left;\n padding: 0.5rem;\n color: ${uiColors.yellow} !important;\n border-bottom: 1px solid ${uiColors.lightGray};\n text-shadow: -2px 0 black, 0 2px black, 2px 0 black, 0 -2px black;\n`;\n\nexport const TableCell = styled.td`\n padding: 0.5rem;\n color: ${uiColors.white};\n border-bottom: 1px solid ${uiColors.lightGray};\n text-shadow: -2px 0 black, 0 2px black, 2px 0 black, 0 -2px black;\n`;\n\nexport const ActionButtons = styled.div`\n display: flex;\n gap: 10px;\n align-items: center;\n`;\n\ninterface IUserActionProps {\n color: string;\n}\n\nexport const UserActionLink = styled.span<IUserActionProps>`\n color: ${({ color }) => color} !important;\n cursor: pointer;\n margin-right: 0.5rem;\n\n &:hover {\n text-decoration: underline;\n }\n`;\n","import { debounce } from 'lodash';\nimport React, { useCallback, useState } from 'react';\nimport styled from 'styled-components';\nimport { InternalTabs, UserActionLink } from '../..';\nimport { uiColors } from '../../constants/uiColors';\nimport { uiFonts } from '../../constants/uiFonts';\nimport { IFriend } from './FriendList';\n\ninterface ISearchFriendProps {\n searchedCharacters: IFriend[];\n friendRequests: IFriend[];\n onFocus?: () => void;\n onBlur?: () => void;\n onSearch: (characterName: string) => void;\n onSendFriendRequest: (character: IFriend) => void;\n onAcceptRequest: (character: IFriend) => void;\n onRejectRequest: (character: IFriend) => void;\n}\n\nexport const SearchFriend: React.FC<ISearchFriendProps> = ({\n searchedCharacters,\n friendRequests,\n onBlur,\n onFocus,\n onSearch,\n onSendFriendRequest,\n onAcceptRequest,\n onRejectRequest,\n}) => {\n const [characterName, setCharacterName] = useState('');\n\n const debouncedSearch = useCallback(\n debounce((name: string) => {\n onSearch(name);\n }, 300),\n []\n );\n\n const handleInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const name = e.target.value;\n setCharacterName(name);\n debouncedSearch(name);\n };\n\n const handleSubmit = (event: React.SyntheticEvent<HTMLFormElement>) => {\n event.preventDefault();\n if (characterName.trim()) {\n onSearch(characterName);\n }\n };\n\n const searchTabContent = (\n <ListContainer>\n <SearchForm onSubmit={handleSubmit}>\n <SearchInput\n value={characterName}\n id=\"characterName\"\n name=\"characterName\"\n onChange={handleInputChange}\n type=\"text\"\n autoComplete=\"off\"\n onFocus={onFocus}\n onBlur={onBlur}\n onPointerDown={onFocus}\n autoFocus\n placeholder=\"Search for a character...\"\n />\n </SearchForm>\n <CharacterList\n characters={searchedCharacters}\n onAction={onSendFriendRequest}\n actionLabel=\"Add Friend\"\n />\n </ListContainer>\n );\n\n const requestsTabContent = (\n <ListContainer>\n <FriendRequestSection\n friendRequests={friendRequests}\n onAccept={onAcceptRequest}\n onReject={onRejectRequest}\n />\n </ListContainer>\n );\n\n const tabs = [\n { id: 'search', title: 'Search', content: searchTabContent },\n {\n id: 'requests',\n title: `Requests (${friendRequests.length})`,\n content: requestsTabContent,\n },\n ];\n\n return (\n <Container>\n <InternalTabs\n tabs={tabs}\n activeTextColor=\"#000\"\n inactiveColor=\"#777\"\n borderColor=\"#f59e0b\"\n />\n </Container>\n );\n};\n\nconst CharacterList: React.FC<{\n characters: IFriend[];\n onAction: (character: IFriend) => void;\n actionLabel: string;\n}> = ({ characters, onAction, actionLabel }) => (\n <ListContainer>\n {characters.map(character => (\n <ListItem key={character._id}>\n <CharacterName>{character.name}</CharacterName>\n <UserActionLink\n color={uiColors.lightGreen}\n onClick={() => onAction(character)}\n >\n {actionLabel}\n </UserActionLink>\n </ListItem>\n ))}\n </ListContainer>\n);\n\nconst FriendRequestSection: React.FC<{\n friendRequests: IFriend[];\n onAccept: (character: IFriend) => void;\n onReject: (character: IFriend) => void;\n}> = ({ friendRequests, onAccept, onReject }) => (\n <>\n {friendRequests.length > 0 && (\n <ListContainer>\n {friendRequests.map(character => (\n <ListItem key={character._id}>\n <CharacterName>{character.name}</CharacterName>\n <AcceptRejectActions>\n <UserActionLink\n color={uiColors.lightGreen}\n onClick={() => onAccept(character)}\n >\n Accept\n </UserActionLink>\n <UserActionLink\n color={uiColors.red}\n onClick={() => onReject(character)}\n >\n Reject\n </UserActionLink>\n </AcceptRejectActions>\n </ListItem>\n ))}\n </ListContainer>\n )}\n </>\n);\n\nconst Container = styled.div`\n display: flex;\n flex-direction: column;\n gap: 1rem;\n`;\n\nconst SearchForm = styled.form`\n display: flex;\n align-items: center;\n width: 100%;\n margin-top: 1rem;\n`;\n\nconst SearchInput = styled.input`\n width: 100%;\n background-color: rgba(0, 0, 0, 0.25);\n border: none;\n padding: 0.5rem;\n font-size: ${uiFonts.size.small};\n`;\n\nconst ListContainer = styled.ul`\n list-style: none;\n padding: 0;\n margin: 0;\n width: 100%;\n max-height: 50vh;\n overflow-y: auto;\n\n @media (max-width: 768px) {\n max-height: 90vh;\n }\n`;\n\nconst ListItem = styled.li`\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0.5rem;\n border-bottom: 1px solid rgba(255, 255, 255, 0.1);\n`;\n\nconst CharacterName = styled.p`\n font-size: ${uiFonts.size.small};\n margin: 0;\n`;\n\nconst AcceptRejectActions = styled.div`\n display: flex;\n gap: 0.5rem;\n`;\n","import React, { useEffect, useState } from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\nimport { Button, ButtonTypes } from '../Button';\n\nimport { ICharacter } from '@rpg-engine/shared';\nimport {\n ActionButtons,\n Table,\n TableCell,\n TableHeader,\n TableRow,\n UserActionLink,\n} from '../Table/Table';\nimport { SearchFriend } from './SearchFriend';\nexport type IFriend = Pick<ICharacter, 'name' | '_id' | 'isOnline'>;\ninterface IFriendListProps {\n scale?: number;\n friends: IFriend[];\n friendRequests: IFriend[];\n searchedCharacters: IFriend[];\n onFocus?: () => void;\n onBlur?: () => void;\n onClose: () => void;\n onOpenPrivateMessage: (character: IFriend) => void;\n onRemoveFriend: (character: IFriend) => void;\n onSendFriendRequest: (character: IFriend) => void;\n onSearch: (characterName: string) => void;\n onAcceptRequest: (character: IFriend) => void;\n onRejectRequest: (character: IFriend) => void;\n onAddFriend?: () => void;\n onBackFriendList?: () => void;\n}\n\nexport const FriendList: React.FC<IFriendListProps> = ({\n friends,\n friendRequests,\n searchedCharacters,\n onFocus,\n onBlur,\n onSearch,\n onAcceptRequest,\n onSendFriendRequest,\n onRemoveFriend,\n onOpenPrivateMessage,\n onRejectRequest,\n onAddFriend,\n onBackFriendList,\n}) => {\n const [isAddFriendUI, setIsAddFriendUI] = useState(false);\n\n useEffect(() => {\n if (isAddFriendUI) {\n onAddFriend?.();\n } else {\n onBackFriendList?.();\n }\n }, [isAddFriendUI]);\n\n return (\n <ListWrapper>\n {isAddFriendUI ? (\n <SearchFriend\n searchedCharacters={searchedCharacters}\n onSendFriendRequest={onSendFriendRequest}\n onAcceptRequest={onAcceptRequest}\n onRejectRequest={onRejectRequest}\n friendRequests={friendRequests}\n onSearch={onSearch}\n onBlur={onBlur}\n onFocus={onFocus}\n />\n ) : (\n <>\n <ScrollableArea>\n <Table>\n <thead>\n <TableRow>\n <TableHeader>Online</TableHeader>\n <TableHeader>Name</TableHeader>\n <TableHeader>Actions</TableHeader>\n </TableRow>\n </thead>\n <tbody>\n {friends.map(friend => (\n <TableRow key={friend._id}>\n <TableCell>\n <IsOnlineBadge $isOnline={friend.isOnline} />\n </TableCell>\n <TableCell>{friend.name}</TableCell>\n <TableCell>\n <ActionButtons>\n <UserActionLink\n color={uiColors.white}\n onClick={() => onOpenPrivateMessage(friend)}\n >\n Chat\n </UserActionLink>\n <UserActionLink\n color={uiColors.red}\n onClick={() => onRemoveFriend(friend)}\n >\n Remove\n </UserActionLink>\n </ActionButtons>\n </TableCell>\n </TableRow>\n ))}\n </tbody>\n </Table>\n </ScrollableArea>\n </>\n )}\n\n <ButtonContainer>\n <Button\n buttonType={ButtonTypes.RPGUIButton}\n onClick={() => setIsAddFriendUI(prev => !prev)}\n >\n {isAddFriendUI ? 'Back' : 'Add New Friend'}\n </Button>\n </ButtonContainer>\n </ListWrapper>\n );\n};\n\n// Styled components for FriendList UI\nconst ListWrapper = styled.div`\n margin-top: 1rem;\n max-height: 350px;\n display: flex;\n flex-direction: column;\n`;\n\nconst ScrollableArea = styled.div`\n overflow-y: auto;\n max-height: 300px; /* Adjust this value based on your layout */\n`;\n\nconst IsOnlineBadge = styled.div<{ $isOnline: boolean }>`\n width: 10px;\n height: 10px;\n border-radius: 50%;\n background-color: ${({ $isOnline }) =>\n $isOnline ? uiColors.lightGreen : uiColors.red};\n margin-right: 1rem;\n`;\n\nconst ButtonContainer = styled.div`\n display: flex;\n justify-content: center;\n align-items: center;\n width: 100%;\n margin-top: 1rem;\n`;\n","import { isMobileOrTablet } from '@rpg-engine/shared';\n\nexport const IS_MOBILE_OR_TABLET = isMobileOrTablet();\n","import React, { useEffect, useState } from 'react';\nimport styled from 'styled-components';\n\ninterface IProps {\n text: string;\n onFinish?: () => void;\n onStart?: () => void;\n}\n\nexport const DynamicText: React.FC<IProps> = ({ text, onFinish, onStart }) => {\n const [textState, setTextState] = useState<string>('');\n\n useEffect(() => {\n let i = 0;\n const interval = setInterval(() => {\n // on every interval, show one more character\n\n if (i === 0) {\n if (onStart) {\n onStart();\n }\n }\n\n if (i < text.length) {\n setTextState(text.substring(0, i + 1));\n i++;\n } else {\n clearInterval(interval);\n if (onFinish) {\n onFinish();\n }\n }\n }, 25);\n\n return () => {\n clearInterval(interval);\n };\n }, [text]);\n\n return <TextContainer>{textState}</TextContainer>;\n};\n\nconst TextContainer = styled.p`\n font-size: 0.7rem !important;\n color: white;\n text-shadow: 1px 1px 0px #000000;\n letter-spacing: 1.2px;\n word-break: normal;\n`;\n","import React, { useEffect, useRef, useState } from 'react';\nimport styled from 'styled-components';\nimport { NPCDialogType } from '../..';\nimport { IS_MOBILE_OR_TABLET } from '../../constants/uiDevices';\nimport { chunkString } from '../../libs/StringHelpers';\nimport { DynamicText } from '../typography/DynamicText';\nimport pressButtonGif from './img/press-button.gif';\nimport pressSpaceGif from './img/space.gif';\n\ninterface IProps {\n text: string;\n onClose: () => void;\n onEndStep?: () => void;\n onStartStep?: () => void;\n type?: NPCDialogType;\n}\n\nexport const NPCDialogText: React.FC<IProps> = ({\n text,\n onClose,\n onEndStep,\n onStartStep,\n type,\n}) => {\n const windowSize = useRef([window.innerWidth, window.innerHeight]);\n function maxCharacters(width: number) {\n // Set the font size to 16 pixels\n var fontSize = 11.2;\n\n // Calculate the number of characters that can fit in one line\n var charactersPerLine = Math.floor(width / 2 / fontSize);\n\n // Calculate the number of lines that can fit in the div\n var linesPerDiv = Math.floor(180 / fontSize);\n\n // Calculate the maximum number of characters that can fit in the div\n var maxCharacters = charactersPerLine * linesPerDiv;\n\n // Return the maximum number of characters\n return Math.round(maxCharacters / 5);\n }\n\n const textChunks = chunkString(text, maxCharacters(windowSize.current[0]));\n\n const [chunkIndex, setChunkIndex] = useState<number>(0);\n const onHandleSpacePress = (event: KeyboardEvent) => {\n if (event.code === 'Space') {\n goToNextStep();\n }\n };\n\n const goToNextStep = () => {\n const hasNextChunk = textChunks?.[chunkIndex + 1] || false;\n\n if (hasNextChunk) {\n setChunkIndex(prev => prev + 1);\n } else {\n // if there's no more text chunks, close the dialog\n onClose();\n }\n };\n\n useEffect(() => {\n document.addEventListener('keydown', onHandleSpacePress);\n\n return () => document.removeEventListener('keydown', onHandleSpacePress);\n }, [chunkIndex]);\n\n const [showGoNextIndicator, setShowGoNextIndicator] = useState<boolean>(\n false\n );\n\n return (\n <Container>\n <DynamicText\n text={textChunks?.[chunkIndex] || ''}\n onFinish={() => {\n setShowGoNextIndicator(true);\n\n onEndStep && onEndStep();\n }}\n onStart={() => {\n setShowGoNextIndicator(false);\n\n onStartStep && onStartStep();\n }}\n />\n {showGoNextIndicator && (\n <PressSpaceIndicator\n right={type === NPCDialogType.TextOnly ? '1rem' : '10.5rem'}\n src={IS_MOBILE_OR_TABLET ? pressButtonGif : pressSpaceGif}\n onPointerDown={() => {\n goToNextStep();\n }}\n />\n )}\n </Container>\n );\n};\n\nconst Container = styled.div``;\n\ninterface IPressSpaceIndicatorProps {\n right: string;\n}\n\nconst PressSpaceIndicator = styled.img<IPressSpaceIndicatorProps>`\n position: absolute;\n right: ${({ right }) => right};\n bottom: 1rem;\n height: 20.7px;\n image-rendering: -webkit-optimize-contrast;\n`;\n","export const chunkString = (str: string, length: number) => {\n return str.match(new RegExp('.{1,' + length + '}', 'g'));\n};\n","import React from 'react';\n\n//@ts-ignore\nexport const useEventListener = (type, handler, el = window) => {\n const savedHandler = React.useRef();\n\n React.useEffect(() => {\n savedHandler.current = handler;\n }, [handler]);\n\n React.useEffect(() => {\n //@ts-ignore\n const listener = e => savedHandler.current(e);\n\n el.addEventListener(type, listener);\n\n return () => {\n el.removeEventListener(type, listener);\n };\n }, [type, el]);\n};\n","import React, { useEffect, useState } from 'react';\nimport styled from 'styled-components';\nimport { useEventListener } from '../../../hooks/useEventListener';\nimport { DynamicText } from '../../typography/DynamicText';\n\nexport interface IQuestionDialogAnswer {\n id: number;\n text: string;\n nextQuestionId?: number;\n}\n\nexport interface IQuestionDialog {\n id: number;\n text: string;\n answerIds?: number[];\n}\n\nexport interface IProps {\n questions: IQuestionDialog[];\n answers: IQuestionDialogAnswer[];\n onClose: () => void;\n}\n\nexport const QuestionDialog: React.FC<IProps> = ({\n questions,\n answers,\n onClose,\n}) => {\n const [currentQuestion, setCurrentQuestion] = useState(questions[0]);\n\n const [canShowAnswers, setCanShowAnswers] = useState<boolean>(false);\n\n const onGetFirstAnswer = () => {\n if (!currentQuestion.answerIds || currentQuestion.answerIds.length === 0) {\n return null;\n }\n\n const firstAnswerId = currentQuestion.answerIds![0];\n\n return answers.find(answer => answer.id === firstAnswerId);\n };\n\n const [\n currentAnswer,\n setCurrentAnswer,\n ] = useState<IQuestionDialogAnswer | null>(onGetFirstAnswer()!);\n\n useEffect(() => {\n setCurrentAnswer(onGetFirstAnswer()!);\n }, [currentQuestion]);\n\n const onGetAnswers = (answerIds: number[]) => {\n return answerIds.map((answerId: number) =>\n answers.find(answer => answer.id === answerId)\n );\n };\n\n const onKeyPress = (e: KeyboardEvent) => {\n switch (e.key) {\n case 'ArrowDown':\n // select next answer, if any.\n // if no next answer, select first answer\n // const nextAnswer = onGetAnswers(currentQuestion.answerIds!).find(\n // (answer) => answer?.id === currentAnswer!.id + 1\n // );\n\n const nextAnswerIndex = onGetAnswers(\n currentQuestion.answerIds!\n ).findIndex(answer => answer?.id === currentAnswer!.id + 1);\n\n const nextAnswerID = currentQuestion.answerIds![nextAnswerIndex];\n\n const nextAnswer = onGetAnswers(currentQuestion.answerIds!).find(\n answer => answer?.id === nextAnswerID\n );\n\n setCurrentAnswer(nextAnswer || onGetFirstAnswer()!);\n\n break;\n case 'ArrowUp':\n // select previous answer, if any.\n // if no previous answer, select last answer\n\n const previousAnswerIndex = onGetAnswers(\n currentQuestion.answerIds!\n ).findIndex(answer => answer?.id === currentAnswer!.id - 1);\n\n const previousAnswerID =\n currentQuestion.answerIds &&\n currentQuestion.answerIds[previousAnswerIndex];\n\n const previousAnswer = onGetAnswers(currentQuestion.answerIds!).find(\n answer => answer?.id === previousAnswerID\n );\n\n if (previousAnswer) {\n setCurrentAnswer(previousAnswer);\n } else {\n setCurrentAnswer(onGetAnswers(currentQuestion.answerIds!).pop()!);\n }\n\n break;\n case 'Enter':\n setCanShowAnswers(false);\n\n if (!currentAnswer?.nextQuestionId) {\n onClose();\n return;\n } else {\n setCurrentQuestion(\n questions.find(\n question => question.id === currentAnswer!.nextQuestionId\n )!\n );\n }\n\n break;\n }\n };\n useEventListener('keydown', onKeyPress);\n\n const onAnswerClick = (answer: IQuestionDialogAnswer) => {\n setCanShowAnswers(false);\n if (answer.nextQuestionId) {\n // if there is a next question, go to it\n setCurrentQuestion(\n questions.find(question => question.id === answer.nextQuestionId)!\n );\n } else {\n // else, finish dialog!\n onClose();\n }\n };\n\n const onRenderCurrentAnswers = () => {\n const answerIds = currentQuestion.answerIds;\n if (!answerIds) {\n return null;\n }\n\n const answers = onGetAnswers(answerIds);\n\n if (!answers) {\n return null;\n }\n\n return answers.map(answer => {\n const isSelected = currentAnswer?.id === answer?.id;\n const selectedColor = isSelected ? 'yellow' : 'white';\n\n if (answer) {\n return (\n <AnswerRow key={`answer_${answer.id}`}>\n <AnswerSelectedIcon color={selectedColor}>\n {isSelected ? 'X' : null}\n </AnswerSelectedIcon>\n\n <Answer\n key={answer.id}\n onPointerDown={() => onAnswerClick(answer)}\n color={selectedColor}\n >\n {answer.text}\n </Answer>\n </AnswerRow>\n );\n }\n\n return null;\n });\n };\n\n return (\n <Container>\n <QuestionContainer>\n <DynamicText\n text={currentQuestion.text}\n onStart={() => setCanShowAnswers(false)}\n onFinish={() => setCanShowAnswers(true)}\n />\n </QuestionContainer>\n\n {canShowAnswers && (\n <AnswersContainer>{onRenderCurrentAnswers()}</AnswersContainer>\n )}\n </Container>\n );\n};\n\nconst Container = styled.div`\n display: flex;\n word-break: break-all;\n box-sizing: border-box;\n justify-content: flex-start;\n align-items: flex-start;\n flex-wrap: wrap;\n`;\n\nconst QuestionContainer = styled.div`\n flex: 100%;\n width: 100%;\n`;\n\nconst AnswersContainer = styled.div`\n flex: 100%;\n`;\n\ninterface IAnswerProps {\n color: string;\n}\n\nconst Answer = styled.p<IAnswerProps>`\n flex: auto;\n color: ${props => props.color} !important;\n font-size: 0.65rem !important;\n background: inherit;\n border: none;\n`;\n\nconst AnswerSelectedIcon = styled.span<IAnswerProps>`\n flex: 5% 0 0;\n color: ${props => props.color} !important;\n`;\n\nconst AnswerRow = styled.div`\n display: flex;\n flex-wrap: wrap;\n justify-content: center;\n align-items: center;\n margin-bottom: 0.5rem;\n height: 22px;\n p {\n line-height: unset;\n margin-top: 0;\n margin-bottom: 0rem;\n }\n`;\n","import React, { useEffect, useState } from 'react';\nimport styled from 'styled-components';\nimport { RPGUIContainer, RPGUIContainerTypes } from '../RPGUI/RPGUIContainer';\nimport { NPCDialogText } from './NPCDialogText';\nimport aliceDefaultThumbnail from './img/npcDialog/npcThumbnails/alice.png';\nimport pressSpaceGif from './img/space.gif';\n\nexport enum ImgSide {\n right = 'right',\n left = 'left',\n}\n\nexport interface NPCMultiDialogType {\n text: string;\n imagePath?: string;\n imageSide: ImgSide;\n}\n\nexport interface INPCMultiDialogProps {\n onClose: () => void;\n textAndTypeArray: NPCMultiDialogType[];\n}\n\nexport const NPCMultiDialog: React.FC<INPCMultiDialogProps> = ({\n onClose,\n textAndTypeArray,\n}) => {\n const [showGoNextIndicator, setShowGoNextIndicator] = useState<boolean>(\n false\n );\n const [slide, setSlide] = useState<number>(0);\n\n const onHandleSpacePress = (event: KeyboardEvent) => {\n if (event.code === 'Space') {\n if (slide < textAndTypeArray?.length - 1) {\n setSlide(prev => prev + 1);\n } else {\n // if there's no more text chunks, close the dialog\n onClose();\n }\n }\n };\n\n useEffect(() => {\n document.addEventListener('keydown', onHandleSpacePress);\n\n return () => document.removeEventListener('keydown', onHandleSpacePress);\n }, [slide]);\n\n return (\n <RPGUIContainer\n type={RPGUIContainerTypes.FramedGold}\n width={'50%'}\n height={'180px'}\n >\n <>\n <Container>\n {textAndTypeArray[slide]?.imageSide === 'right' && (\n <>\n <TextContainer flex={'70%'}>\n <NPCDialogText\n onStartStep={() => setShowGoNextIndicator(false)}\n onEndStep={() => setShowGoNextIndicator(true)}\n text={textAndTypeArray[slide].text || 'No text provided.'}\n onClose={() => {\n if (onClose) {\n onClose();\n }\n }}\n />\n </TextContainer>\n <ThumbnailContainer>\n <NPCThumbnail\n src={\n textAndTypeArray[slide].imagePath || aliceDefaultThumbnail\n }\n />\n </ThumbnailContainer>\n {showGoNextIndicator && (\n <PressSpaceIndicator right={'10.5rem'} src={pressSpaceGif} />\n )}\n </>\n )}\n {textAndTypeArray[slide].imageSide === 'left' && (\n <>\n <ThumbnailContainer>\n <NPCThumbnail\n src={\n textAndTypeArray[slide].imagePath || aliceDefaultThumbnail\n }\n />\n </ThumbnailContainer>\n <TextContainer flex={'70%'}>\n <NPCDialogText\n onStartStep={() => setShowGoNextIndicator(false)}\n onEndStep={() => setShowGoNextIndicator(true)}\n text={textAndTypeArray[slide].text || 'No text provided.'}\n onClose={() => {\n if (onClose) {\n onClose();\n }\n }}\n />\n </TextContainer>\n {showGoNextIndicator && (\n <PressSpaceIndicator right={'1rem'} src={pressSpaceGif} />\n )}\n </>\n )}\n </Container>\n )\n </>\n </RPGUIContainer>\n );\n};\n\nconst Container = styled.div`\n display: flex;\n width: 100%;\n height: 100%;\n\n box-sizing: border-box;\n justify-content: center;\n align-items: flex-start;\n position: relative;\n`;\n\ninterface ITextContainerProps {\n flex: string;\n}\n\nconst TextContainer = styled.div<ITextContainerProps>`\n flex: ${({ flex }) => flex} 0 0;\n width: 355px;\n`;\n\nconst ThumbnailContainer = styled.div`\n flex: 30% 0 0;\n display: flex;\n justify-content: flex-end;\n`;\n\nconst NPCThumbnail = styled.img`\n image-rendering: pixelated;\n height: 128px;\n width: 128px;\n`;\n\ninterface IPressSpaceIndicatorProps {\n right: string;\n}\n\nconst PressSpaceIndicator = styled.img<IPressSpaceIndicatorProps>`\n position: absolute;\n right: ${({ right }) => right};\n bottom: 1rem;\n height: 20.7px;\n image-rendering: -webkit-optimize-contrast;\n`;\n","import React, { useCallback, useEffect, useRef, useState } from 'react';\nimport styled from 'styled-components';\nimport { v4 as uuidv4 } from 'uuid';\n\nexport enum RangeSliderType {\n Slider = 'rpgui-slider',\n GoldSlider = 'rpgui-slider golden',\n}\n\nexport interface IRangeSliderProps {\n type: RangeSliderType;\n valueMin: number;\n valueMax: number;\n width: string;\n onChange: (value: number) => void;\n value: number;\n step?: number;\n}\n\nexport const RangeSlider: React.FC<IRangeSliderProps> = React.memo(\n ({ type, valueMin, valueMax, width, onChange, value, step = 1 }) => {\n const sliderId = uuidv4();\n\n const containerRef = useRef<HTMLDivElement>(null);\n const [left, setLeft] = useState(0);\n\n useEffect(() => {\n const calculatedWidth = containerRef.current?.clientWidth || 0;\n setLeft(\n Math.max(\n ((value - valueMin) / (valueMax - valueMin)) *\n (calculatedWidth - 35) +\n 10\n )\n );\n }, [value, valueMin, valueMax]);\n\n const typeClass = type === RangeSliderType.GoldSlider ? 'golden' : '';\n\n const handleChange = useCallback(\n (e: { target: { value: any } }) => {\n onChange(Number(e.target.value));\n },\n [onChange]\n );\n\n return (\n <div\n style={{ width: width, position: 'relative' }}\n className={`rpgui-slider-container ${typeClass}`}\n id={`rpgui-slider-${sliderId}`}\n ref={containerRef}\n >\n <div style={{ pointerEvents: 'none' }}>\n <div className={`rpgui-slider-track ${typeClass}`} />\n <div className={`rpgui-slider-left-edge ${typeClass}`} />\n <div className={`rpgui-slider-right-edge ${typeClass}`} />\n <div className={`rpgui-slider-thumb ${typeClass}`} style={{ left }} />\n </div>\n <Input\n type=\"range\"\n style={{ width: width }}\n min={valueMin}\n max={valueMax}\n step={step}\n onChange={handleChange}\n value={value}\n className=\"rpgui-cursor-point\"\n />\n </div>\n );\n }\n);\n\nconst Input = styled.input`\n opacity: 0;\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n margin-top: -5px;\n`;\n","import React, { useEffect, useState } from 'react';\nimport styled from 'styled-components';\nimport { NPCDialog, NPCDialogType } from './NPCDialog/NPCDialog';\nimport { NPCMultiDialog, NPCMultiDialogType } from './NPCDialog/NPCMultiDialog';\nimport {\n IQuestionDialog,\n IQuestionDialogAnswer,\n QuestionDialog,\n} from './NPCDialog/QuestionDialog/QuestionDialog';\n\nexport interface IHistoryDialogProps {\n backgroundImgPath: string[];\n fullCoverBackground: boolean;\n questions?: IQuestionDialog[];\n answers?: IQuestionDialogAnswer[];\n text?: string;\n imagePath?: string;\n textAndTypeArray?: NPCMultiDialogType[];\n onClose: () => void;\n}\n\nexport const HistoryDialog: React.FC<IHistoryDialogProps> = ({\n backgroundImgPath,\n fullCoverBackground,\n questions,\n answers,\n text,\n imagePath,\n textAndTypeArray,\n onClose,\n}) => {\n const [img, setImage] = useState<number>(0);\n const onHandleSpacePress = (event: KeyboardEvent) => {\n if (event.code === 'Space') {\n if (img < backgroundImgPath?.length - 1) {\n setImage(prev => prev + 1);\n } else {\n // if there's no more text chunks, close the dialog\n onClose();\n }\n }\n };\n\n useEffect(() => {\n document.addEventListener('keydown', onHandleSpacePress);\n\n return () => document.removeEventListener('keydown', onHandleSpacePress);\n }, [backgroundImgPath]);\n return (\n <BackgroundContainer\n imgPath={backgroundImgPath[img]}\n fullImg={fullCoverBackground}\n >\n <DialogContainer>\n {textAndTypeArray ? (\n <NPCMultiDialog\n textAndTypeArray={textAndTypeArray}\n onClose={onClose}\n />\n ) : questions && answers ? (\n <QuestionDialog\n questions={questions}\n answers={answers}\n onClose={onClose}\n />\n ) : text && imagePath ? (\n <NPCDialog\n text={text}\n imagePath={imagePath}\n onClose={onClose}\n type={NPCDialogType.TextAndThumbnail}\n />\n ) : (\n <NPCDialog\n text={text}\n onClose={onClose}\n type={NPCDialogType.TextOnly}\n />\n )}\n </DialogContainer>\n </BackgroundContainer>\n );\n};\n\ninterface IImgContainerProps {\n imgPath: string;\n fullImg: boolean;\n}\n\nconst BackgroundContainer = styled.div<IImgContainerProps>`\n width: 100%;\n height: 100%;\n background-image: url(${props => props.imgPath});\n background-size: ${props => (props.imgPath ? 'cover' : 'auto')};\n display: flex;\n justify-content: space-evenly;\n align-items: center;\n`;\n\nconst DialogContainer = styled.div`\n display: flex;\n justify-content: center;\n padding-top: 200px;\n`;\n","import React, { useState } from 'react';\nimport styled from 'styled-components';\nimport SelectArrow from '../Arrow/SelectArrow';\nimport { DraggableContainer } from '../DraggableContainer';\nimport { RPGUIContainerTypes } from '../RPGUI/RPGUIContainer';\nimport { DynamicText } from '../typography/DynamicText';\n\nexport interface ITextImageProps {\n image: string;\n textPosition?: 'flex-start' | 'flex-end';\n text: string;\n}\n\nexport interface IImageCarouselProps {\n textImage: ITextImageProps[];\n isTextFixed: boolean;\n onCloseButton?: () => void;\n}\n\nexport const ImageCarousel: React.FC<IImageCarouselProps> = ({\n textImage,\n isTextFixed,\n onCloseButton,\n}) => {\n const [textImageSelected, setTextImageSelected] = useState(textImage[0]);\n\n const goToPreviousImage = () => {\n const currentIndex = textImage.indexOf(textImageSelected);\n if (currentIndex > 0) {\n setTextImageSelected(textImage[currentIndex - 1]);\n }\n };\n\n const goToNextImage = () => {\n const currentIndex = textImage.indexOf(textImageSelected);\n if (currentIndex < textImage.length - 1) {\n setTextImageSelected(textImage[currentIndex + 1]);\n }\n };\n\n return (\n <CarouselWrapper type={RPGUIContainerTypes.Framed}>\n {isTextFixed ? (\n <>\n <BackgroundImage\n imagePath={textImageSelected.image}\n isTextFixed={isTextFixed}\n >\n <ArrowContainer>\n {textImageSelected !== textImage[0] && (\n <SelectArrow\n direction=\"left\"\n onPointerDown={() => goToPreviousImage()}\n ></SelectArrow>\n )}\n\n {textImageSelected !== textImage[textImage.length - 1] && (\n <SelectArrow\n direction=\"right\"\n onPointerDown={() => goToNextImage()}\n ></SelectArrow>\n )}\n </ArrowContainer>\n </BackgroundImage>\n <Description\n textPosition={textImageSelected.textPosition ?? 'flex-start'}\n isTextFixed={isTextFixed}\n >\n <DynamicText text={textImageSelected.text} />\n </Description>\n </>\n ) : (\n <BackgroundImage\n imagePath={textImageSelected.image}\n isTextFixed={isTextFixed}\n >\n <ArrowContainer>\n {textImageSelected !== textImage[0] && (\n <SelectArrow\n direction=\"left\"\n onPointerDown={() => goToPreviousImage()}\n ></SelectArrow>\n )}\n <Description\n textPosition={textImageSelected.textPosition ?? 'flex-start'}\n isTextFixed={isTextFixed}\n >\n <DynamicText text={textImageSelected.text} />\n </Description>\n {textImageSelected !== textImage[textImage.length - 1] && (\n <SelectArrow\n direction=\"right\"\n onPointerDown={() => goToNextImage()}\n ></SelectArrow>\n )}\n </ArrowContainer>\n </BackgroundImage>\n )}\n {onCloseButton && (\n <CloseButton className=\"container-close\" onPointerDown={onCloseButton}>\n X\n </CloseButton>\n )}\n </CarouselWrapper>\n );\n};\n\ninterface IBackgroundImage {\n imagePath: string;\n isTextFixed: boolean;\n}\n\ninterface ITextDescription {\n textPosition: 'flex-start' | 'flex-end';\n isTextFixed: boolean;\n}\n\nconst CarouselWrapper = styled(DraggableContainer)`\n width: 100%;\n height: 100%;\n`;\n\nconst ArrowContainer = styled.span`\n display: flex;\n height: 100%;\n align-items: center;\n`;\n\nconst BackgroundImage = styled.div<IBackgroundImage>`\n background-image: url(${props => props.imagePath});\n background-repeat: no-repeat;\n background-attachment: fixed;\n background-size: contain;\n background-position: center;\n width: 100%;\n height: ${props => (props.isTextFixed ? '80%' : '100%')};\n`;\n\nconst Description = styled.div<ITextDescription>`\n width: 100%;\n height: ${props => (props.isTextFixed ? 'auto' : '100%')};\n display: flex;\n align-items: ${props => props.textPosition};\n p {\n background-color: ${props =>\n props.isTextFixed ? 'none' : 'rgba(0, 0, 0, 0.6)'};\n border-radius: 5px;\n text-align: justify;\n height: auto;\n }\n`;\n\nconst CloseButton = styled.div`\n position: absolute;\n top: 3px;\n right: 0px;\n color: white;\n z-index: 22;\n font-size: 1.5rem;\n @media (max-width: 950px) {\n font-size: 1.7rem;\n padding: 12px;\n }\n`;\n","import React, { useEffect, useRef, useState } from 'react';\nimport styled, { keyframes } from 'styled-components';\nimport SelectArrow from '../Arrow/SelectArrow';\n\nexport interface ISimpleImageCarousel {\n images: string[];\n styles?: React.CSSProperties;\n autoCycle?: boolean;\n autoCycleDelay?: number;\n stopAutoCyclingOnInteraction?: boolean;\n}\n\nexport const SimpleImageCarousel: React.FC<ISimpleImageCarousel> = ({\n images,\n styles,\n autoCycle = false,\n autoCycleDelay = 3000,\n stopAutoCyclingOnInteraction = false,\n}) => {\n const [currentImage, setCurrentImage] = useState(0);\n const autoCycleId = useRef<NodeJS.Timeout | null>(null);\n\n const handleLeftClick = () => {\n setCurrentImage(\n prevImage => (prevImage - 1 + images?.length) % images?.length\n );\n if (stopAutoCyclingOnInteraction && autoCycleId.current) {\n clearInterval(autoCycleId.current);\n autoCycleId.current = null;\n }\n };\n\n const handleRightClick = () => {\n setCurrentImage(prevImage => (prevImage + 1) % images?.length);\n if (stopAutoCyclingOnInteraction && autoCycleId.current) {\n clearInterval(autoCycleId.current);\n autoCycleId.current = null;\n }\n };\n\n useEffect(() => {\n if (autoCycle) {\n autoCycleId.current = setInterval(() => {\n setCurrentImage(prevImage => (prevImage + 1) % images?.length);\n }, autoCycleDelay);\n }\n\n return () => {\n if (autoCycleId.current) {\n clearInterval(autoCycleId.current);\n }\n };\n }, [autoCycle, autoCycleDelay, images?.length]);\n\n const hasMoreThanOneImage = images?.length > 1;\n\n return (\n <ImageContainer style={styles}>\n {hasMoreThanOneImage && (\n <CustomLeftArrow direction=\"left\" onPointerDown={handleLeftClick} />\n )}\n {hasMoreThanOneImage && (\n <CustomRightArrow direction=\"right\" onPointerDown={handleRightClick} />\n )}\n <Carousel>\n <FadeInCarouselImg\n key={currentImage}\n src={images?.[currentImage]}\n alt={`Image ${currentImage}`}\n />\n </Carousel>\n </ImageContainer>\n );\n};\n\nconst ImageContainer = styled.div`\n flex: 1;\n display: flex;\n justify-content: center;\n align-items: center;\n height: 100%;\n margin-right: 0.5rem;\n max-width: 400px;\n position: relative;\n width: 400px;\n`;\n\nconst CustomLeftArrow = styled(SelectArrow)`\n position: absolute;\n left: -0.5rem;\n top: 50%;\n transform: translateY(-50%);\n`;\n\nconst CustomRightArrow = styled(SelectArrow)`\n position: absolute;\n right: -2.5rem;\n top: 50%;\n transform: translateY(-50%);\n`;\n\nconst Carousel = styled.div`\n display: flex;\n`;\n\nconst CarouselImg = styled.img`\n flex: 0 0 auto;\n width: 100%;\n height: auto;\n margin: 0 1rem;\n border-radius: 5px;\n box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.2);\n scroll-snap-align: start;\n margin-right: 3rem;\n`;\n\nconst fadeIn = keyframes`\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n`;\n\nconst FadeInCarouselImg = styled(CarouselImg)`\n animation: ${fadeIn} 0.5s;\n`;\n","import React, { useState } from 'react';\nimport styled from 'styled-components';\n\ninterface TabItem {\n id: string;\n title: string;\n content: React.ReactNode;\n}\n\nexport interface TableTabProps {\n tabs: TabItem[];\n activeColor?: string;\n activeTextColor: string;\n inactiveColor?: string;\n borderColor?: string;\n hoverColor?: string;\n}\n\nexport const InternalTabs: React.FC<TableTabProps> = ({\n tabs,\n activeColor = '#fef08a',\n activeTextColor = '#000000',\n inactiveColor = '#6b7280',\n borderColor = '#f59e0b',\n hoverColor = '#fef3c7',\n}) => {\n const [activeTab, setActiveTab] = useState(tabs[0].id);\n\n return (\n <TableWrapper>\n <TabHeader borderColor={borderColor}>\n {tabs.map(tab => (\n <TabButton\n key={tab.id}\n active={activeTab === tab.id}\n activeColor={activeColor}\n activeTextColor={activeTextColor}\n inactiveColor={inactiveColor}\n borderColor={borderColor}\n hoverColor={hoverColor}\n onClick={() => setActiveTab(tab.id)}\n >\n {tab.title}\n </TabButton>\n ))}\n </TabHeader>\n <ContentWrapper>\n {tabs.find(tab => tab.id === activeTab)?.content}\n </ContentWrapper>\n </TableWrapper>\n );\n};\n\nconst TableWrapper = styled.div`\n width: 100%;\n`;\n\nconst TabHeader = styled.div<{ borderColor: string }>`\n display: flex;\n border-bottom: 1px solid ${props => props.borderColor};\n`;\n\nconst TabButton = styled.button<{\n active: boolean;\n activeColor: string;\n activeTextColor: string;\n inactiveColor: string;\n borderColor: string;\n hoverColor: string;\n}>`\n flex: 1;\n padding: 0.5rem 1rem;\n font-size: 0.875rem;\n font-weight: 500;\n border-right: 1px solid ${props => props.borderColor};\n background-color: ${props =>\n props.active ? props.activeColor : 'transparent'};\n color: ${props =>\n props.active ? props.activeTextColor : props.inactiveColor};\n\n &:last-child {\n border-right: none;\n }\n\n &:hover {\n background-color: ${props =>\n props.active ? props.activeColor : props.hoverColor};\n }\n`;\n\nconst ContentWrapper = styled.div`\n padding: 1rem;\n`;\n","import React from 'react';\nimport { IPosition } from '../../types/eventTypes';\nimport { DraggableContainer } from '../DraggableContainer';\nimport { RPGUIContainerTypes } from '../RPGUI/RPGUIContainer';\n\ninterface IProps {\n children: React.ReactNode;\n title: string;\n onClose?: () => void;\n onPositionChange?: (position: IPosition) => void;\n onPositionChangeEnd?: (position: IPosition) => void;\n onPositionChangeStart?: (position: IPosition) => void;\n onOutsideClick?: () => void;\n initialPosition?: IPosition;\n scale?: number;\n width?: string;\n isFullScreen?: boolean;\n opacity?: number;\n}\n\nexport const SlotsContainer: React.FC<IProps> = ({\n children,\n title,\n onClose,\n onPositionChange,\n onPositionChangeEnd,\n onPositionChangeStart,\n onOutsideClick,\n initialPosition,\n scale,\n width,\n isFullScreen,\n opacity,\n}) => {\n return (\n <DraggableContainer\n isFullScreen={isFullScreen}\n opacity={opacity}\n title={title}\n type={RPGUIContainerTypes.Framed}\n onCloseButton={() => {\n if (onClose) {\n onClose();\n }\n }}\n width={width ?? '415px'}\n cancelDrag=\".item-container-body, #shortcuts_list\"\n onPositionChange={({ x, y }) => {\n if (onPositionChange) {\n onPositionChange({ x, y });\n }\n }}\n onPositionChangeEnd={({ x, y }) => {\n if (onPositionChangeEnd) {\n onPositionChangeEnd({ x, y });\n }\n }}\n onPositionChangeStart={({ x, y }) => {\n if (onPositionChangeStart) {\n onPositionChangeStart({ x, y });\n }\n }}\n onOutsideClick={onOutsideClick}\n initialPosition={initialPosition}\n scale={scale}\n >\n {children}\n </DraggableContainer>\n );\n};\n","import {\n getItemTextureKeyPath,\n IItem,\n IRawSpell,\n IShortcut,\n ShortcutType,\n} from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\nimport { SpriteFromAtlas } from '../shared/SpriteFromAtlas';\n\ntype ShortcutsSetterProps = {\n setSettingShortcutIndex: (index: number) => void;\n settingShortcutIndex: number;\n shortcuts: IShortcut[];\n removeShortcut: (index: number) => void;\n atlasJSON: any;\n atlasIMG: any;\n};\n\nexport const ShortcutsSetter: React.FC<ShortcutsSetterProps> = ({\n setSettingShortcutIndex,\n settingShortcutIndex,\n shortcuts,\n removeShortcut,\n atlasJSON,\n atlasIMG,\n}) => {\n const getContent = (index: number) => {\n if (shortcuts[index]?.type === ShortcutType.Item) {\n const payload = shortcuts[index]?.payload as IItem | undefined;\n\n if (!payload) return null;\n\n return (\n <SpriteFromAtlas\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={getItemTextureKeyPath(\n {\n key: payload.texturePath,\n texturePath: payload.texturePath,\n stackQty: payload.stackQty || 1,\n isStackable: payload.isStackable,\n },\n atlasJSON\n )}\n width={32}\n height={32}\n imgScale={1.2}\n imgStyle={{ left: '3px' }}\n />\n );\n }\n const IMAGE_SIZE = 32;\n const IMAGE_SCALE = 1;\n\n const shortcut = shortcuts[index];\n\n if (shortcut?.type === ShortcutType.Spell && shortcut.payload) {\n const payload = shortcut.payload as IRawSpell; // TypeScript type assertion\n\n return (\n <SpriteFromAtlas\n atlasIMG={payload.atlasIMG}\n atlasJSON={payload.atlasJSON}\n spriteKey={payload.texturePath ?? ''}\n width={IMAGE_SIZE}\n height={IMAGE_SIZE}\n imgScale={IMAGE_SCALE}\n centered\n borderRadius=\"50%\"\n />\n );\n }\n\n return null;\n };\n\n return (\n <Container>\n <p>Shortcuts:</p>\n <List id=\"shortcuts_list\">\n {Array.from({ length: 12 }).map((_, i) => (\n <Shortcut\n key={i}\n onPointerDown={() => {\n if (settingShortcutIndex !== -1) setSettingShortcutIndex(-1);\n\n removeShortcut(i);\n if (\n settingShortcutIndex === -1 &&\n (!shortcuts[i] || shortcuts[i].type === ShortcutType.None)\n )\n setSettingShortcutIndex(i);\n }}\n disabled={settingShortcutIndex !== -1 && settingShortcutIndex !== i}\n isBeingSet={settingShortcutIndex === i}\n id={`shortcutSetter_${i}`}\n >\n {getContent(i)}\n </Shortcut>\n ))}\n </List>\n </Container>\n );\n};\n\nconst Container = styled.div`\n p {\n margin: 0;\n margin-left: 0.5rem;\n font-size: 10px;\n }\n\n width: 100%;\n`;\n\nconst Shortcut = styled.button<{ isBeingSet?: boolean }>`\n width: 2.4rem;\n height: 2.4rem;\n\n background-color: ${uiColors.lightGray};\n border: 2px solid\n ${({ isBeingSet }) => (isBeingSet ? uiColors.yellow : uiColors.darkGray)};\n border-radius: 50%;\n text-transform: uppercase;\n font-size: 0.7rem;\n font-weight: bold;\n display: flex;\n align-items: center;\n justify-content: center;\n\n span {\n margin-top: 4px;\n }\n\n &:hover,\n &:focus {\n background-color: ${uiColors.darkGray};\n }\n\n &:active {\n background-color: ${uiColors.gray};\n }\n\n &:disabled {\n opacity: 0.5;\n }\n`;\n\nconst List = styled.div`\n width: 100%;\n display: flex;\n align-items: center;\n gap: 0.4rem;\n box-sizing: border-box;\n margin: 0 !important;\n\n flex-wrap: wrap;\n\n padding: 0.3rem;\n\n padding-bottom: 1rem;\n`;\n","import { ItemRarities, ItemSubType } from '@rpg-engine/shared';\nimport React from 'react';\nimport { IOptionsProps } from '../../Dropdown';\n\nexport enum OrderByType {\n Name = 'Name',\n Price = 'Price',\n}\n\nexport const itemTypeOptions: IOptionsProps[] = [\n 'Type',\n ...Object.keys(ItemSubType),\n]\n .filter(type => type !== 'DeadBody')\n .map((itemType, index) => ({\n id: index + 1,\n value: itemType,\n option: itemType,\n }));\n\nexport const itemRarityOptions: IOptionsProps[] = [\n 'Rarity',\n ...Object.values(ItemRarities),\n].map((itemRarity, index) => ({\n id: index + 1,\n value: itemRarity,\n option: itemRarity,\n}));\n\nexport const orderByOptions: IOptionsProps[] = Object.values(\n OrderByType\n).flatMap((orderBy, index) => [\n {\n id: index * 2 + 1,\n value: orderBy.toLowerCase(),\n option: (\n <>\n {orderBy}{' '}\n <span\n style={{\n transform: 'translateY(-2px)',\n display: 'inline-block',\n }}\n >\n ↑\n </span>\n </>\n ),\n },\n {\n id: index * 2 + 2,\n value: '-' + orderBy.toLowerCase(),\n option: (\n <>\n {orderBy}{' '}\n <span\n style={{\n transform: 'translateY(-2px)',\n display: 'inline-block',\n }}\n >\n ↓\n </span>\n </>\n ),\n },\n]);\n","import React, { useEffect, useRef, useState } from 'react';\nimport styled from 'styled-components';\nimport { Button, ButtonTypes } from '../Button';\nimport { RPGUIContainer, RPGUIContainerTypes } from '../RPGUI/RPGUIContainer';\nimport { RangeSlider, RangeSliderType } from '../RangeSlider';\n\nexport interface IQuantitySelectorProps {\n maxQuantity: number;\n initialQuantity?: number;\n title?: string;\n onConfirm: (quantity: number) => void;\n onClose: () => void;\n}\n\nexport const QuantitySelector: React.FC<IQuantitySelectorProps> = ({\n maxQuantity,\n initialQuantity,\n title = 'Select quantity',\n onConfirm,\n onClose,\n}) => {\n const [value, setValue] = useState(initialQuantity ?? maxQuantity);\n const inputRef = useRef<HTMLInputElement>(null);\n\n useEffect(() => {\n const closeSelector = (e: KeyboardEvent) => {\n if (e.key === 'Escape') {\n onClose();\n }\n };\n\n if (inputRef.current) {\n inputRef.current.focus();\n inputRef.current.select();\n }\n\n document.addEventListener('keydown', closeSelector);\n return () => document.removeEventListener('keydown', closeSelector);\n }, [onClose]);\n\n return (\n <StyledContainer type={RPGUIContainerTypes.Framed} width=\"25rem\">\n <CloseButton className=\"container-close\" onPointerDown={onClose}>\n X\n </CloseButton>\n <h2>{title}</h2>\n <StyledForm\n onSubmit={e => {\n e.preventDefault();\n const numberValue = Number(value);\n if (!Number.isNaN(numberValue)) {\n onConfirm(Math.max(1, Math.min(maxQuantity, numberValue)));\n }\n }}\n noValidate\n >\n <StyledInput\n ref={inputRef}\n placeholder=\"Enter quantity\"\n type=\"number\"\n min={1}\n max={maxQuantity}\n value={value}\n onChange={e => {\n if (Number(e.target.value) >= maxQuantity) {\n setValue(maxQuantity);\n return;\n }\n setValue(Number(e.target.value));\n }}\n onBlur={e => {\n setValue(\n Math.max(1, Math.min(maxQuantity, Number(e.target.value)))\n );\n }}\n />\n <RangeSlider\n type={RangeSliderType.Slider}\n valueMin={1}\n valueMax={maxQuantity}\n width=\"100%\"\n onChange={setValue}\n value={value}\n />\n <Button buttonType={ButtonTypes.RPGUIButton} type=\"submit\">\n Confirm\n </Button>\n </StyledForm>\n </StyledContainer>\n );\n};\n\nconst StyledContainer = styled(RPGUIContainer)`\n position: relative;\n display: flex;\n flex-direction: column;\n align-items: center;\n padding: 1rem;\n\n h2 {\n margin: 0;\n margin-bottom: 1rem;\n font-size: 1rem;\n }\n`;\n\nconst CloseButton = styled.div`\n position: absolute;\n top: 3px;\n right: 0px;\n color: white;\n z-index: 22;\n font-size: 1.5rem;\n cursor: pointer;\n`;\n\nconst StyledForm = styled.form`\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 1rem;\n width: 100%;\n`;\n\nconst StyledInput = styled.input`\n width: 100%;\n padding: 0.5rem;\n background-color: rgba(0, 0, 0, 0.25);\n border: none;\n color: white;\n font-size: 1rem;\n text-align: center;\n\n &::-webkit-inner-spin-button,\n &::-webkit-outer-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n\n &[type='number'] {\n -moz-appearance: textfield;\n }\n`;\n","import React from 'react';\nimport styled from 'styled-components';\nimport ModalPortal from '../Abstractions/ModalPortal';\nimport { QuantitySelector } from './QuantitySelector';\n\nexport interface IQuantitySelect {\n isOpen: boolean;\n maxQuantity: number;\n callback: (quantity: number) => void;\n title?: string;\n initialQuantity?: number;\n}\n\ninterface IProps {\n quantitySelect: IQuantitySelect;\n setQuantitySelect: React.Dispatch<React.SetStateAction<IQuantitySelect>>;\n}\n\nconst validateQuantitySelect = (\n quantitySelect: IQuantitySelect\n): IQuantitySelect => ({\n ...quantitySelect,\n maxQuantity: Math.max(1, quantitySelect.maxQuantity),\n initialQuantity: quantitySelect.initialQuantity\n ? Math.max(\n 1,\n Math.min(quantitySelect.maxQuantity, quantitySelect.initialQuantity)\n )\n : undefined,\n});\n\nexport const QuantitySelectorModal = ({\n quantitySelect,\n setQuantitySelect,\n}: IProps): JSX.Element => {\n const resetQuantitySelect = () => {\n setQuantitySelect({\n isOpen: false,\n maxQuantity: 1,\n callback: () => {},\n });\n };\n\n // Validate the input values\n const validatedQuantitySelect = validateQuantitySelect(quantitySelect);\n\n return (\n <ModalPortal>\n <QuantitySelectorContainer>\n <QuantitySelector\n maxQuantity={validatedQuantitySelect.maxQuantity}\n initialQuantity={validatedQuantitySelect.initialQuantity}\n title={validatedQuantitySelect.title}\n onConfirm={quantity => {\n validatedQuantitySelect.callback(quantity);\n resetQuantitySelect();\n }}\n onClose={() => {\n validatedQuantitySelect.callback(-1);\n resetQuantitySelect();\n }}\n />\n </QuantitySelectorContainer>\n </ModalPortal>\n );\n};\n\nconst QuantitySelectorContainer = styled.div`\n position: absolute;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n z-index: 100;\n display: flex;\n justify-content: center;\n align-items: center;\n background-color: rgba(0, 0, 0, 0.5);\n`;\n","import React from 'react';\nimport { IQuantitySelect, QuantitySelectorModal } from '../../QuantitySelector/QuantitySelectorModal';\n\ninterface IProps {\n quantitySelect: IQuantitySelect;\n setQuantitySelect: React.Dispatch<React.SetStateAction<IQuantitySelect>>;\n}\n\nexport const ItemQuantitySelectorModal = ({\n quantitySelect,\n setQuantitySelect,\n}: IProps): JSX.Element => {\n return (\n <QuantitySelectorModal\n quantitySelect={quantitySelect}\n setQuantitySelect={setQuantitySelect}\n />\n );\n};\n\nexport type { IQuantitySelect };\n","import {\n IEquipmentSet,\n IItem,\n IItemContainer,\n IShortcut,\n ItemContainerType,\n ItemSubType,\n ItemType,\n} from '@rpg-engine/shared';\nimport React, { useCallback, useMemo, useRef, useState } from 'react';\nimport styled from 'styled-components';\nimport { SlotsContainer } from '../../Abstractions/SlotsContainer';\n\nimport { useScrollOnDrag } from '../../../hooks/useScrollOnDrag';\nimport { IPosition } from '../../../types/eventTypes';\nimport { ShortcutsSetter } from '../../Shortcuts/ShortcutsSetter';\nimport { ItemSlotDetailsProvider } from './context/ItemSlotDetailsContext';\nimport { ItemSlotDraggingProvider } from './context/ItemSlotDraggingContext';\nimport { DraggedItem } from './DraggedItem';\nimport { ItemQuantitySelectorModal } from './ItemQuantitySelectorModal';\nimport { ItemSlot } from './ItemSlot';\nimport { ItemSlotToolTips } from './ItemSlotTooltips';\n\nexport interface IItemContainerProps {\n itemContainer: IItemContainer;\n onClose?: () => void;\n onItemClick?: (\n item: IItem,\n ItemType: IItem['type'],\n itemContainerType: ItemContainerType | null\n ) => void;\n onItemDragStart?: (\n item: IItem,\n slotIndex: number,\n itemContainerType: ItemContainerType | null\n ) => void;\n onItemDragEnd?: (quantity?: number) => void;\n onOutsideDrop?: (item: IItem, position: IPosition) => void;\n onItemPlaceDrop?: (\n item: IItem | null,\n slotIndex: number,\n itemContainerType: ItemContainerType | null\n ) => void;\n scale?: number;\n checkIfItemCanBeMoved: () => boolean;\n checkIfItemShouldDragEnd?: () => boolean;\n onMouseOver?: (e: any, slotIndex: number, item: IItem | null) => void;\n onSelected?: (optionId: string, item: IItem) => void;\n type: ItemContainerType;\n atlasJSON: any;\n atlasIMG: any;\n disableContextMenu?: boolean;\n initialPosition?: { x: number; y: number };\n shortcuts?: IShortcut[];\n setItemShortcut?: (key: string, index: number) => void;\n removeShortcut?: (index: number) => void;\n equipmentSet?: IEquipmentSet | null;\n isDepotSystem?: boolean;\n onPositionChangeEnd?: (position: IPosition) => void;\n onPositionChangeStart?: (position: IPosition) => void;\n isFullScreen?: boolean;\n opacity?: number;\n}\n\ntype onDragStart =\n | ((\n item: IItem,\n slotIndex: number,\n itemContainerType: ItemContainerType | null\n ) => void)\n | undefined;\ntype onDragEnd = ((quantity?: number) => void) | undefined;\n\nconst MIN_SLOTS_FOR_SCROLL = 20;\n\nexport const ItemContainer: React.FC<IItemContainerProps> = React.memo(\n ({\n itemContainer,\n onClose,\n onMouseOver,\n onSelected,\n onItemClick,\n type,\n atlasJSON,\n atlasIMG,\n disableContextMenu = false,\n onItemDragEnd,\n onItemDragStart,\n onItemPlaceDrop,\n onOutsideDrop,\n checkIfItemCanBeMoved,\n initialPosition,\n checkIfItemShouldDragEnd,\n scale,\n shortcuts,\n setItemShortcut,\n removeShortcut,\n equipmentSet,\n isDepotSystem,\n onPositionChangeEnd,\n onPositionChangeStart,\n isFullScreen,\n opacity,\n }) => {\n const [quantitySelect, setQuantitySelect] = useState({\n isOpen: false,\n maxQuantity: 1,\n callback: (_quantity: number) => {},\n });\n const [settingShortcutIndex, setSettingShortcutIndex] = useState(-1);\n\n const containerRef = useRef<HTMLDivElement>(null);\n\n const { startScrolling, stopScrolling } = useScrollOnDrag({\n containerRef,\n threshold: 50,\n scrollStep: 4,\n });\n\n const handleSetShortcut = useCallback(\n (item: IItem, index: number) => {\n if (\n item.type === ItemType.Consumable ||\n item.type === ItemType.Tool ||\n item.subType === ItemSubType.Seed\n ) {\n setItemShortcut?.(item.key, index);\n }\n },\n [setItemShortcut]\n );\n\n const handleMouseMove = useCallback(\n (e: MouseEvent) => {\n startScrolling(e.clientY);\n },\n [startScrolling]\n );\n\n const onDragStartScrollingEvents = useCallback(() => {\n document.addEventListener('pointermove', handleMouseMove);\n document.addEventListener(\n 'pointerup',\n () => {\n stopScrolling();\n document.removeEventListener('pointermove', handleMouseMove);\n },\n { once: true }\n );\n }, [handleMouseMove, stopScrolling]);\n\n const onDragEndScrollingEvents = useCallback(() => {\n stopScrolling();\n document.removeEventListener('pointermove', handleMouseMove);\n }, [handleMouseMove, stopScrolling]);\n\n const onDragStartHandler: onDragStart = useCallback(\n (\n item: IItem,\n slotIndex: number,\n itemContainerType: ItemContainerType | null\n ) => {\n if (onItemDragStart) {\n onItemDragStart(item, slotIndex, itemContainerType);\n }\n\n onDragStartScrollingEvents();\n },\n [onItemDragStart, onDragStartScrollingEvents]\n );\n\n const onDragEndHandler: onDragEnd = useCallback(\n (quantity: number | undefined) => {\n if (onItemDragEnd) {\n onItemDragEnd(quantity);\n }\n onDragEndScrollingEvents();\n },\n [onItemDragEnd, onDragEndScrollingEvents]\n );\n\n // Memoize handleSetShortcut to prevent unnecessary re-renders\n const memoizedHandleSetShortcut = useCallback(\n (item: IItem, index: number) => {\n handleSetShortcut(item, index);\n },\n [handleSetShortcut]\n );\n\n // Memoize onRenderSlots to prevent re-creating the slots array on every render\n const onRenderSlots = useMemo(() => {\n const slots = [];\n\n for (let i = 0; i < itemContainer.slotQty; i++) {\n const currentItem = itemContainer.slots?.[i] || null;\n\n slots.push(\n <ItemSlot\n key={i}\n slotIndex={i}\n item={currentItem}\n itemContainerType={type}\n onMouseOver={\n onMouseOver\n ? (event, slotIndex, item) =>\n onMouseOver(event, slotIndex, item)\n : undefined\n }\n onMouseOut={undefined} // Assuming you don't need onMouseOut here\n onPointerDown={(itemType, containerType, item) => {\n if (settingShortcutIndex !== -1) {\n setSettingShortcutIndex(-1);\n memoizedHandleSetShortcut(item, settingShortcutIndex);\n } else if (onItemClick) {\n onItemClick(item, itemType, containerType);\n }\n }}\n onDragStart={onDragStartHandler}\n onDragEnd={onDragEndHandler}\n dragScale={scale}\n checkIfItemCanBeMoved={checkIfItemCanBeMoved}\n checkIfItemShouldDragEnd={checkIfItemShouldDragEnd}\n openQuantitySelector={(maxQuantity, callback) => {\n setQuantitySelect({\n isOpen: true,\n maxQuantity,\n callback,\n });\n }}\n onPlaceDrop={(item, slotIndex, itemContainerType) => {\n if (onItemPlaceDrop) {\n onItemPlaceDrop(item, slotIndex, itemContainerType);\n }\n\n console.log('PLACE DROP');\n\n onDragEndScrollingEvents();\n }}\n onOutsideDrop={(item, position) => {\n if (onOutsideDrop) {\n onOutsideDrop(item, position);\n }\n\n console.log('OUTSIDE DROP');\n\n onDragEndScrollingEvents();\n }}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n isSelectingShortcut={settingShortcutIndex !== -1}\n equipmentSet={equipmentSet}\n setItemShortcut={\n type === ItemContainerType.Inventory\n ? memoizedHandleSetShortcut\n : undefined\n }\n isDepotSystem={isDepotSystem}\n />\n );\n }\n return slots;\n }, [\n itemContainer.slotQty,\n itemContainer.slots,\n type,\n onMouseOver,\n settingShortcutIndex,\n memoizedHandleSetShortcut,\n onItemClick,\n onDragStartHandler,\n onDragEndHandler,\n scale,\n checkIfItemCanBeMoved,\n checkIfItemShouldDragEnd,\n onItemPlaceDrop,\n onOutsideDrop,\n atlasIMG,\n atlasJSON,\n equipmentSet,\n isDepotSystem,\n onDragEndScrollingEvents,\n ]);\n\n return (\n <ItemSlotDraggingProvider>\n <ItemSlotDetailsProvider>\n <DraggedItem\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n scale={scale}\n />\n <SlotsContainer\n title={itemContainer.name || 'Container'}\n onClose={onClose}\n initialPosition={initialPosition}\n scale={scale}\n onPositionChangeEnd={onPositionChangeEnd}\n onPositionChangeStart={onPositionChangeStart}\n isFullScreen={isFullScreen}\n opacity={opacity}\n >\n {type === ItemContainerType.Inventory &&\n shortcuts &&\n removeShortcut && (\n <ShortcutsSetter\n setSettingShortcutIndex={setSettingShortcutIndex}\n settingShortcutIndex={settingShortcutIndex}\n shortcuts={shortcuts}\n removeShortcut={removeShortcut}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n />\n )}\n <ItemsContainer\n className=\"item-container-body\"\n ref={containerRef}\n isScrollable={itemContainer.slotQty > MIN_SLOTS_FOR_SCROLL}\n isFullScreen={isFullScreen}\n >\n {onRenderSlots}\n </ItemsContainer>\n </SlotsContainer>\n {quantitySelect.isOpen && (\n <ItemQuantitySelectorModal\n quantitySelect={quantitySelect}\n setQuantitySelect={setQuantitySelect}\n />\n )}\n <ItemSlotToolTips\n dragScale={scale}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n equipmentSet={equipmentSet}\n isContextMenuDisabled={disableContextMenu}\n onSelected={onSelected}\n />\n </ItemSlotDetailsProvider>\n </ItemSlotDraggingProvider>\n );\n }\n);\n\ninterface IItemsContainerProps {\n isScrollable: boolean;\n isFullScreen?: boolean;\n}\n\nconst ItemsContainer = styled.div<IItemsContainerProps>`\n display: flex;\n justify-content: ${({ isFullScreen }) =>\n isFullScreen ? 'flex-start' : 'center'};\n flex-wrap: wrap;\n max-height: ${({ isFullScreen }) =>\n isFullScreen\n ? undefined\n : '270px'}; // Adjust the max-height based on the prop\n overflow-y: ${({ isScrollable }) => (isScrollable ? 'auto' : 'hidden')};\n overflow-x: hidden;\n width: ${({ isFullScreen }) =>\n isFullScreen ? '100vw' : '415px'}; // Adjust the width based on the prop\n\n max-height: ${({ isFullScreen }) => isFullScreen && '60%'};\n\n @media screen and (max-height: 350px) {\n max-height: ${({ isFullScreen }) => isFullScreen && '50%'};\n }\n`;\n","import { useCallback, useRef } from 'react';\n\ninterface IUseScrollOnDragProps {\n containerRef: React.RefObject<HTMLDivElement>;\n threshold: number;\n scrollStep: number;\n}\n\nexport const useScrollOnDrag = ({\n containerRef,\n threshold,\n scrollStep,\n}: IUseScrollOnDragProps) => {\n const animationFrameId = useRef<number | null>(null);\n\n const startScrolling = useCallback(\n (clientY: number) => {\n const scroll = () => {\n if (containerRef.current) {\n const { top, bottom } = containerRef.current.getBoundingClientRect();\n\n const maxScrollTop =\n containerRef.current.scrollHeight -\n containerRef.current.clientHeight;\n const distanceFromTop = clientY - top;\n const distanceFromBottom = bottom - clientY;\n\n if (\n distanceFromTop < threshold &&\n containerRef.current.scrollTop > 0\n ) {\n containerRef.current.scrollTop -= scrollStep;\n animationFrameId.current = requestAnimationFrame(scroll);\n } else if (\n distanceFromBottom < threshold &&\n containerRef.current.scrollTop < maxScrollTop\n ) {\n containerRef.current.scrollTop += scrollStep;\n animationFrameId.current = requestAnimationFrame(scroll);\n } else {\n // Check if we are near the bottom of the container\n if (containerRef.current.scrollTop >= maxScrollTop) {\n // You can perform any action here when the scroll hits the bottom.\n } else {\n // Check if we are near the top of the container\n if (containerRef.current.scrollTop <= 0) {\n // You can perform any action here when the scroll hits the top.\n }\n }\n // Stop scrolling if neither condition is met\n stopScrolling();\n }\n }\n };\n\n const stopScrolling = () => {\n if (animationFrameId.current !== null) {\n cancelAnimationFrame(animationFrameId.current);\n animationFrameId.current = null;\n }\n };\n\n //@ts-ignore\n cancelAnimationFrame(animationFrameId.current); // Cancel any existing animation frame\n animationFrameId.current = requestAnimationFrame(scroll);\n },\n [containerRef, threshold, scrollStep]\n );\n\n const stopScrolling = useCallback(() => {\n if (animationFrameId.current !== null) {\n cancelAnimationFrame(animationFrameId.current);\n animationFrameId.current = null;\n }\n }, []);\n\n return { startScrolling, stopScrolling };\n};\n","import React, { useEffect, useState } from 'react';\nimport styled from 'styled-components';\nimport { Button, ButtonTypes } from '../Button';\nimport { DraggableContainer } from '../DraggableContainer';\nimport { RPGUIContainerTypes } from '../RPGUI/RPGUIContainer';\nimport { SpriteFromAtlas } from '../shared/SpriteFromAtlas';\n\nexport interface IOptionsItemSelectorProps {\n name: string;\n description?: string;\n imageKey: string;\n}\n\nexport interface IItemSelectorProps {\n atlasJSON: any;\n atlasIMG: any;\n options: IOptionsItemSelectorProps[];\n onClose: () => void;\n onSelect: (value: string) => void;\n}\n\nexport const ItemSelector: React.FC<IItemSelectorProps> = ({\n atlasIMG,\n atlasJSON,\n options,\n onClose,\n onSelect,\n}) => {\n const [selectedValue, setSelectedValue] = useState<string>();\n\n const handleClick = () => {\n let element = document.querySelector(\n `input[name='test']:checked`\n ) as HTMLInputElement;\n const elementValue = element.value;\n setSelectedValue(elementValue);\n };\n\n useEffect(() => {\n if (selectedValue) {\n onSelect(selectedValue);\n }\n }, [selectedValue]);\n return (\n <DraggableContainer\n type={RPGUIContainerTypes.Framed}\n width=\"500px\"\n cancelDrag=\".equipment-container-body .arrow-selector\"\n onCloseButton={() => {\n if (onClose) {\n onClose();\n }\n }}\n >\n <div style={{ width: '100%' }}>\n <Title>{'Harvesting instruments'}</Title>\n <Subtitle>{'Use the tool, you need it'}</Subtitle>\n <hr className=\"golden\" />\n </div>\n\n <RadioInputScroller>\n {options?.map((option, index) => (\n <RadioOptionsWrapper key={index}>\n <SpriteAtlasWrapper>\n <SpriteFromAtlas\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={option.imageKey}\n imgScale={3}\n />\n </SpriteAtlasWrapper>\n <div>\n <input\n className=\"rpgui-radio\"\n type=\"radio\"\n value={option.name}\n name=\"test\"\n />\n <label\n onPointerDown={handleClick}\n style={{ display: 'flex', alignItems: 'center' }}\n >\n {option.name} <br />\n {option.description}\n </label>\n </div>\n </RadioOptionsWrapper>\n ))}\n </RadioInputScroller>\n <ButtonWrapper>\n <Button buttonType={ButtonTypes.RPGUIButton} onPointerDown={onClose}>\n Cancel\n </Button>\n <Button buttonType={ButtonTypes.RPGUIButton}>Select</Button>\n </ButtonWrapper>\n </DraggableContainer>\n );\n};\n\nconst Title = styled.h1`\n font-size: 0.6rem;\n color: yellow !important;\n`;\nconst Subtitle = styled.h1`\n font-size: 0.4rem;\n color: yellow !important;\n`;\n\nconst RadioInputScroller = styled.div`\n padding-left: 15px;\n padding-top: 10px;\n width: 100%;\n margin-top: 1rem;\n align-items: center;\n margin-left: 20px;\n align-items: flex-start;\n overflow-y: scroll;\n height: 360px;\n`;\n\nconst SpriteAtlasWrapper = styled.div`\n margin-right: 40px;\n`;\n\nconst RadioOptionsWrapper = styled.div`\n display: flex;\n align-items: stretch;\n margin-bottom: 40px;\n`;\n\nconst ButtonWrapper = styled.div`\n display: flex;\n justify-content: space-around;\n padding-top: 20px;\n width: 100%;\n`;\n","import {\n IRankingTopCharacterEntry,\n IRankingTopSkillEntry,\n} from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\nimport { Ellipsis } from '../shared/Ellipsis';\n\nexport interface ILeaderboardLevelProps {\n items: Set<IRankingTopCharacterEntry> | Set<IRankingTopSkillEntry> | null;\n rankType: string;\n}\n\nexport const LeaderboardTable: React.FC<ILeaderboardLevelProps> = props => {\n const { items, rankType } = props;\n if (!items) return null;\n\n function isTopSkillEntry(entry: any): entry is IRankingTopSkillEntry {\n return 'skill' in entry;\n }\n\n return (\n <>\n <thead>\n <TableRowWrapper>\n <TableRowValue>\n <p>\n <Ellipsis maxLines={1} maxWidth=\"200px\" fontSize=\"14px\">\n Name\n </Ellipsis>\n </p>\n </TableRowValue>\n {rankType === 'Skill' ? (\n <TableRowValue>\n <p>\n <Ellipsis maxLines={1} maxWidth=\"200px\" fontSize=\"14px\">\n Skill\n </Ellipsis>\n </p>\n </TableRowValue>\n ) : null}\n <TableRowValue>\n <p>\n <Ellipsis maxLines={1} maxWidth=\"200px\" fontSize=\"14px\">\n Level\n </Ellipsis>\n </p>\n </TableRowValue>\n </TableRowWrapper>\n </thead>\n <tbody>\n {Array.from(items).map(entry => (\n <TableRowWrapper key={entry.name}>\n <TableRowValue>\n <p>\n <Ellipsis maxLines={1} maxWidth=\"200px\" fontSize=\"10px\">\n {entry.name}\n </Ellipsis>\n </p>\n </TableRowValue>\n {isTopSkillEntry(entry) ? (\n <TableRowValue>\n <p>\n <Ellipsis maxLines={1} maxWidth=\"200px\" fontSize=\"10px\">\n {entry.skill}\n </Ellipsis>\n </p>\n </TableRowValue>\n ) : null}\n <TableRowValue>\n <p>\n <Ellipsis maxLines={1} maxWidth=\"200px\" fontSize=\"10px\">\n {entry.level}\n </Ellipsis>\n </p>\n </TableRowValue>\n </TableRowWrapper>\n ))}\n </tbody>\n </>\n );\n};\n\nconst TableRowWrapper = styled.tr`\n margin: auto;\n padding: 0.5rem;\n\n &:hover {\n background-color: ${uiColors.darkGray};\n }\n\n p {\n font-size: 0.8rem;\n }\n`;\n\nconst TableRowValue = styled.td`\n padding: 0 20px;\n`;\n","import {\n IRankingTopCharacterEntry,\n IRankingTopSkillEntry,\n} from '@rpg-engine/shared';\nimport React, { useEffect, useRef } from 'react';\nimport styled from 'styled-components';\nimport { Dropdown, IOptionsProps } from '../Dropdown';\nimport { LeaderboardTable } from './LeaderboardTable';\n\nexport interface ILeaderboardProps {\n items: Set<IRankingTopCharacterEntry> | Set<IRankingTopSkillEntry> | null;\n onChangeClassType: (value: string) => void;\n onChangeRankType: (value: string) => void;\n onChangeSkillType: (value: string) => void;\n skillOptions: string[];\n rankOptions: string[];\n classOptions: string[];\n rankType: string;\n}\n\nexport const Leaderboard = (props: ILeaderboardProps) => {\n const {\n items,\n onChangeRankType,\n onChangeClassType,\n rankType,\n skillOptions,\n onChangeSkillType,\n classOptions,\n rankOptions,\n } = props;\n const itemsContainer = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n itemsContainer.current?.scrollTo(0, 0);\n }, []);\n\n const rankTypeOptions: IOptionsProps[] = rankOptions.map(\n (itemType, index) => ({\n id: index + 1,\n value: itemType,\n option: itemType,\n })\n );\n\n const skillTypeOptions: IOptionsProps[] = skillOptions.map(\n (itemType, index) => ({\n id: index + 1,\n value: itemType,\n option: itemType,\n })\n );\n\n const classTypeOptions: IOptionsProps[] = classOptions.map(\n (itemType, index) => ({\n id: index + 1,\n value: itemType,\n option: itemType,\n })\n );\n\n return (\n <>\n <WrapperContainer>\n <StyledDropdown\n options={rankTypeOptions}\n onChange={onChangeRankType}\n width=\"80%\"\n />\n {rankType === 'Class' ? (\n <StyledDropdown\n options={classTypeOptions}\n onChange={onChangeClassType}\n width=\"100%\"\n />\n ) : null}\n {rankType === 'Skill' ? (\n <StyledDropdown\n options={skillTypeOptions}\n onChange={onChangeSkillType}\n width=\"100%\"\n />\n ) : null}\n </WrapperContainer>\n <ItemComponentScrollWrapper\n id=\"LeaderboardContainer\"\n ref={itemsContainer}\n >\n <TableWrapper>\n <LeaderboardTable items={items} rankType={rankType} />\n </TableWrapper>\n </ItemComponentScrollWrapper>\n </>\n );\n};\n\nconst WrapperContainer = styled.div`\n display: grid;\n grid-template-columns: 50% 50%;\n justify-content: space-between;\n width: calc(100% - 40px);\n margin-left: 10px;\n\n .rpgui-content .rpgui-dropdown-imp-header {\n padding: 0px 10px 0 !important;\n }\n`;\n\nconst StyledDropdown = styled(Dropdown)`\n margin: 3px !important;\n width: 170px !important;\n`;\n\nconst ItemComponentScrollWrapper = styled.div`\n overflow-y: auto;\n height: 390px;\n width: 100%;\n margin-top: 1rem;\n\n @media (max-width: 950px) {\n height: 250px;\n }\n`;\n\nconst TableWrapper = styled.table`\n margin: auto;\n width: 100%;\n`;\n","import React from 'react';\nimport styled from 'styled-components';\nimport { uiFonts } from '../constants/uiFonts';\n\ninterface IListMenuOption {\n id: string;\n text: string;\n}\n\nexport interface IListMenuProps {\n x: number;\n y: number;\n options: IListMenuOption[];\n onSelected: (selectedOptionId: string) => void;\n}\n\nexport const ListMenu: React.FC<IListMenuProps> = ({\n options,\n onSelected,\n x,\n y,\n}) => {\n return (\n <Container x={x} y={y}>\n <ul className=\"rpgui-list-imp\" style={{ overflow: 'hidden' }}>\n {options.map((params, index) => (\n <ListElement\n key={params?.id || index}\n onPointerDown={() => {\n onSelected(params?.id);\n }}\n >\n {params?.text || 'No text'}\n </ListElement>\n ))}\n </ul>\n </Container>\n );\n};\n\ninterface IContainerProps {\n x?: number;\n y?: number;\n}\n\nconst Container = styled.div<IContainerProps>`\n display: flex;\n flex-direction: column;\n width: 100%;\n justify-content: start;\n align-items: flex-start;\n position: absolute;\n top: ${props => props.y || 0}px;\n left: ${props => props.x || 0}px;\n\n li {\n font-size: ${uiFonts.size.xsmall};\n }\n`;\n\nconst ListElement = styled.li`\n margin-right: 0.5rem;\n`;\n","import React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../constants/uiColors';\nimport { uiFonts } from '../constants/uiFonts';\n\ninterface PagerProps {\n totalItems: number;\n currentPage: number;\n itemsPerPage: number;\n onPageChange: (page: number) => void;\n}\n\nexport const Pager: React.FC<PagerProps> = ({\n totalItems,\n currentPage,\n itemsPerPage,\n onPageChange,\n}) => {\n const totalPages = Math.ceil(totalItems / itemsPerPage);\n\n return (\n <Container>\n <p>Total items: {totalItems}</p>\n <PagerContainer>\n <button\n disabled={currentPage === 1}\n onPointerDown={() => onPageChange(Math.max(currentPage - 1, 1))}\n >\n {'<'}\n </button>\n\n <div className=\"rpgui-container framed-grey\">{currentPage}</div>\n\n <button\n disabled={currentPage === totalPages}\n onPointerDown={() =>\n onPageChange(Math.min(currentPage + 1, totalPages))\n }\n >\n {'>'}\n </button>\n </PagerContainer>\n </Container>\n );\n};\n\nconst Container = styled.div`\n display: flex;\n flex-direction: column;\n align-items: center;\n\n p {\n margin: 0;\n font-size: ${uiFonts.size.xsmall};\n }\n`;\n\nconst PagerContainer = styled.div`\n display: flex;\n justify-content: center;\n align-items: center;\n gap: 5px;\n\n p {\n margin: 0;\n }\n\n div {\n color: white;\n }\n\n button {\n width: 40px;\n height: 40px;\n background-color: ${uiColors.darkGray};\n border: none;\n border-radius: 5px;\n color: white;\n\n :hover {\n background-color: ${uiColors.lightGray};\n }\n\n :disabled {\n opacity: 0.5;\n }\n\n &.active {\n background-color: ${uiColors.orange};\n font-weight: bold;\n color: black;\n }\n }\n`;\n","import React from 'react';\nimport styled from 'styled-components';\nimport ModalPortal from './Abstractions/ModalPortal';\nimport { Button, ButtonTypes } from './Button';\nimport { DraggableContainer } from './DraggableContainer';\n\nexport interface IConfirmModalProps {\n onConfirm: () => void;\n onClose: () => void;\n message?: string;\n}\n\nexport const ConfirmModal: React.FC<IConfirmModalProps> = ({\n onConfirm,\n onClose,\n message,\n}) => {\n return (\n <ModalPortal>\n <Background />\n <Container onPointerDown={onClose}>\n <DraggableContainer width=\"auto\" dragDisabled>\n <Wrapper onPointerDown={e => e.stopPropagation()}>\n <p>{message ?? 'Are you sure?'}</p>\n\n <ButtonsWrapper>\n <div className=\"cancel-button\">\n <Button\n buttonType={ButtonTypes.RPGUIButton}\n onPointerDown={onClose}\n >\n No\n </Button>\n </div>\n <Button\n buttonType={ButtonTypes.RPGUIButton}\n onPointerDown={onConfirm}\n >\n Yes\n </Button>\n </ButtonsWrapper>\n </Wrapper>\n </DraggableContainer>\n </Container>\n </ModalPortal>\n );\n};\n\nconst Background = styled.div`\n position: absolute;\n width: 100%;\n height: 100%;\n background-color: #000000;\n opacity: 0.5;\n left: 0;\n top: 0;\n z-index: 1000;\n`;\n\nconst Container = styled.div`\n position: absolute;\n width: 100%;\n height: 100%;\n left: 0;\n top: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: 1001;\n`;\n\nconst Wrapper = styled.div`\n p {\n margin: 0;\n }\n`;\n\nconst ButtonsWrapper = styled.div`\n display: flex;\n justify-content: flex-end;\n gap: 5px;\n margin-top: 5px;\n\n .cancel-button {\n filter: grayscale(0.7);\n }\n`;\n","import {\n getItemTextureKeyPath,\n IEquipmentSet,\n IItem,\n} from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\nimport { uiFonts } from '../../constants/uiFonts';\nimport { Button, ButtonTypes } from '../Button';\nimport { ItemInfoWrapper } from '../Item/Cards/ItemInfoWrapper';\nimport { onRenderGems } from '../Item/Inventory/ItemGem';\nimport { rarityColor } from '../Item/Inventory/ItemSlotRarity';\nimport { Ellipsis } from '../shared/Ellipsis';\nimport { SpriteFromAtlas } from '../shared/SpriteFromAtlas';\n\nexport interface IMarketPlaceRowsPropos {\n atlasJSON: any;\n atlasIMG: any;\n item: IItem;\n itemPrice: number;\n equipmentSet?: IEquipmentSet | null;\n scale?: number;\n onMarketPlaceItemBuy?: () => void;\n onMarketPlaceItemRemove?: () => void;\n disabled?: boolean;\n}\n\nexport const MarketplaceRows: React.FC<IMarketPlaceRowsPropos> = ({\n atlasJSON,\n atlasIMG,\n item,\n itemPrice,\n equipmentSet,\n scale,\n onMarketPlaceItemBuy,\n onMarketPlaceItemRemove,\n disabled,\n}) => {\n const renderGems = (item: IItem) => {\n return item.attachedGems && onRenderGems(item);\n };\n\n return (\n <MarketplaceWrapper>\n <ItemIconContainer>\n <SpriteContainer>\n <ItemInfoWrapper\n item={item}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n equipmentSet={equipmentSet}\n scale={scale}\n >\n <GemContainer>{renderGems(item)}</GemContainer>\n <RarityContainer item={item}>\n <SpriteFromAtlas\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={getItemTextureKeyPath(\n {\n key: item.key,\n stackQty: item.stackQty || 1,\n texturePath: item.texturePath,\n isStackable: item.isStackable,\n },\n atlasJSON\n )}\n imgScale={2}\n imgClassname=\"sprite-from-atlas-img--item\"\n />\n </RarityContainer>\n\n <QuantityContainer>\n {item.stackQty &&\n item.stackQty > 1 &&\n `x${Math.round(item.stackQty * 10) / 10}`}\n </QuantityContainer>\n </ItemInfoWrapper>\n </SpriteContainer>\n <PriceValue>\n <p>\n <Ellipsis maxLines={1} maxWidth=\"200px\" fontSize=\"10px\">\n {item.name}\n </Ellipsis>\n </p>\n </PriceValue>\n </ItemIconContainer>\n\n <Flex>\n <ItemIconContainer>\n <GoldContainer>\n <SpriteFromAtlas\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey=\"others/gold-coin-qty-5.png\"\n imgScale={2}\n />\n </GoldContainer>\n <PriceValue>\n <p>\n <Ellipsis maxLines={1} maxWidth=\"200px\" fontSize=\"10px\">\n ${itemPrice}\n </Ellipsis>\n </p>\n </PriceValue>\n </ItemIconContainer>\n <ButtonContainer>\n <Button\n buttonType={ButtonTypes.RPGUIButton}\n disabled={disabled}\n onPointerDown={() => {\n if (disabled) return;\n\n onMarketPlaceItemBuy?.();\n onMarketPlaceItemRemove?.();\n }}\n >\n {onMarketPlaceItemBuy ? 'Buy' : 'Remove'}\n </Button>\n </ButtonContainer>\n </Flex>\n </MarketplaceWrapper>\n );\n};\n\nconst MarketplaceWrapper = styled.div`\n margin: auto;\n display: flex;\n justify-content: space-between;\n padding: 0.5rem;\n\n &:hover {\n background-color: ${uiColors.darkGray};\n }\n\n p {\n font-size: 0.8rem;\n }\n`;\n\nconst QuantityContainer = styled.p`\n position: absolute;\n display: block;\n top: 15px;\n left: 25px;\n font-size: ${uiFonts.size.xsmall} !important;\n`;\n\nconst GemContainer = styled.p`\n position: absolute;\n display: block;\n top: -5px;\n left: -10px;\n font-size: ${uiFonts.size.xsmall} !important;\n`;\n\nconst Flex = styled.div`\n display: flex;\n gap: 24px;\n`;\n\nconst ItemIconContainer = styled.div`\n display: flex;\n justify-content: flex-start;\n align-items: center;\n`;\n\nconst GoldContainer = styled.div`\n position: relative;\n top: -0.5rem;\n left: 0.5rem;\n`;\nconst SpriteContainer = styled.div`\n position: relative;\n left: 0.5rem;\n`;\n\nconst PriceValue = styled.div`\n margin-left: 40px;\n`;\n\nconst ButtonContainer = styled.div`\n margin: auto;\n`;\n\nconst RarityContainer = styled.div<{ item: IItem }>`\n border-color: ${({ item }) => rarityColor(item)};\n box-shadow: ${({ item }) => `0 0 5px 8px ${rarityColor(item)}`} inset,\n ${({ item }) => `0 0 8px 6px ${rarityColor(item)}`};\n width: 32px;\n height: 32px;\n`;\n","import React, { useState } from 'react';\nimport styled from 'styled-components';\nimport { DraggableContainer } from '../DraggableContainer';\nimport { RPGUIContainerTypes } from '../RPGUI/RPGUIContainer';\nimport { Tab } from './Tab';\n\ninterface ITab {\n label: string;\n id: string;\n}\n\nexport enum MultitabType {\n Brown = 'brown',\n Gray = 'gray',\n}\n\nexport interface ITabsContainer {\n children: React.ReactNode;\n onCloseButton?: () => void;\n tabs: ITab[];\n type: MultitabType;\n styles?: {\n width?: string;\n minWidth?: string;\n minHeight?: string;\n height?: string;\n className?: string;\n title?: string;\n imgSrc?: string;\n imgWidth?: string;\n };\n isDraggableModal?: boolean;\n}\n\nexport const TabsContainer: React.FC<ITabsContainer> = ({\n children,\n onCloseButton,\n tabs,\n type = MultitabType.Brown,\n styles = {},\n isDraggableModal = false,\n}) => {\n const [selectedTab, setSelectedTab] = useState(tabs[0].id);\n\n const onRenderTabs = () =>\n tabs.map((tab, index) => (\n <Tab\n type={type}\n active={selectedTab === tab.id}\n label={tab.label}\n key={`${tab.label}_${index}`}\n onPointerDown={() => setSelectedTab(tab.id)}\n />\n ));\n\n const onGetContainerType = () => {\n switch (type) {\n case MultitabType.Brown:\n return RPGUIContainerTypes.FramedGold;\n case MultitabType.Gray:\n return RPGUIContainerTypes.Framed;\n default:\n return RPGUIContainerTypes.Framed;\n }\n };\n\n const TabsCore = () => (\n <>\n {onRenderTabs()}\n <BodyContainer\n selectedTab={selectedTab}\n className={`${type} tabs-container`}\n >\n {children}\n </BodyContainer>\n </>\n );\n\n if (isDraggableModal) {\n return (\n <DraggableContainer\n onCloseButton={onCloseButton}\n type={onGetContainerType()}\n cancelDrag=\".tabs-container *\"\n width={styles?.width}\n height={styles?.height}\n minWidth={styles?.minWidth}\n minHeight={styles?.minHeight}\n className={styles?.className}\n title={styles?.title}\n imgSrc={styles?.imgSrc}\n imgWidth={styles?.imgWidth}\n >\n {TabsCore()}\n </DraggableContainer>\n );\n }\n\n return (\n <NonDraggableWrapper\n width={styles?.width}\n height={styles?.height}\n minWidth={styles?.minWidth}\n minHeight={styles?.minHeight}\n >\n {TabsCore()}\n </NonDraggableWrapper>\n );\n};\n\ninterface IBodyContainer {\n selectedTab: string;\n}\n\nconst BodyContainer = styled.div<IBodyContainer>`\n\n display: flex; \n width: 100%;\n height: 100%;\n justify-content: space-between;\n\n /* hide everything that is not data-tab-id selectedTab */\n & > *:not([data-tab-id=${props => props.selectedTab}]) {\n display: none;\n }\n\n &.brown {\n border: 0.25rem solid #996D55;\n background-color: #BF886A;\n }\n \n &.gray {\n border: 0.25rem solid rgba(0, 0, 0, 0.25);\n background-color: #4E4A4E;\n }\n \n border-radius: 5px; \n padding: 0.5rem; \n`;\n\ninterface INonDraggableWrapperProps {\n width?: string;\n height?: string;\n minWidth?: string;\n minHeight?: string;\n}\n\nconst NonDraggableWrapper = styled.div<INonDraggableWrapperProps>`\n height: ${props => props.height || 'auto'};\n width: ${props => props.width || '50%'};\n min-width: ${props => props.minWidth || 'auto'};\n min-height: ${props => props.minHeight || 'auto'};\n display: flex;\n flex-wrap: wrap;\n image-rendering: pixelated;\n overflow-y: hidden;\n padding-top: 1.5rem;\n position: relative;\n`;\n","import { IEquipmentSet, IMarketplaceItem } from '@rpg-engine/shared';\nimport React, { useEffect, useRef, useState } from 'react';\nimport { AiFillCaretRight } from 'react-icons/ai';\nimport styled from 'styled-components';\nimport { ConfirmModal } from '../ConfirmModal';\nimport { Dropdown } from '../Dropdown';\nimport { Input } from '../Input';\nimport { MarketplaceRows } from './MarketplaceRows';\nimport { itemRarityOptions, itemTypeOptions, orderByOptions } from './filters';\n\nexport interface IBuyPanelProps {\n items: IMarketplaceItem[];\n atlasJSON: any;\n atlasIMG: any;\n onClose: () => void;\n onChangeType: (value: string) => void;\n onChangeRarity: (value: string) => void;\n onChangeOrder: (value: string) => void;\n onChangeNameInput: (value: string) => void;\n onChangeMainLevelInput: (\n value: [number | undefined, number | undefined]\n ) => void;\n onChangeSecondaryLevelInput: (\n value: [number | undefined, number | undefined]\n ) => void;\n onChangePriceInput: (value: [number | undefined, number | undefined]) => void;\n scale?: number;\n equipmentSet?: IEquipmentSet | null;\n onMarketPlaceItemBuy?: (marketPlaceItemId: string) => void;\n characterId: string;\n enableHotkeys?: () => void;\n disableHotkeys?: () => void;\n currentPage: number;\n}\n\nexport const BuyPanel: React.FC<IBuyPanelProps> = ({\n items,\n atlasIMG,\n atlasJSON,\n onChangeType,\n onChangeRarity,\n onChangeOrder,\n onChangeNameInput,\n onChangeMainLevelInput,\n onChangeSecondaryLevelInput,\n onChangePriceInput,\n equipmentSet,\n onMarketPlaceItemBuy,\n characterId,\n enableHotkeys,\n disableHotkeys,\n currentPage,\n}) => {\n const [name, setName] = useState('');\n const [mainLevel, setMainLevel] = useState<\n [number | undefined, number | undefined]\n >([undefined, undefined]);\n const [secondaryLevel, setSecondaryLevel] = useState<\n [number | undefined, number | undefined]\n >([undefined, undefined]);\n const [price, setPrice] = useState<[number | undefined, number | undefined]>([\n undefined,\n undefined,\n ]);\n const [buyingItemId, setBuyingItemId] = useState<string | null>(null);\n\n const itemsContainer = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n itemsContainer.current?.scrollTo(0, 0);\n }, [currentPage]);\n\n return (\n <>\n {buyingItemId && (\n <ConfirmModal\n onClose={setBuyingItemId.bind(null, null)}\n onConfirm={() => {\n onMarketPlaceItemBuy?.(buyingItemId);\n setBuyingItemId(null);\n enableHotkeys?.();\n }}\n message=\"Are you sure to buy this item?\"\n />\n )}\n <InputWrapper>\n <p>Search By Name</p>\n <Input\n onChange={e => {\n setName(e.target.value);\n onChangeNameInput(e.target.value);\n }}\n value={name}\n placeholder=\"Enter name...\"\n onBlur={enableHotkeys}\n onFocus={disableHotkeys}\n />\n </InputWrapper>\n\n <OptionsWrapper>\n <FilterInputsWrapper>\n <div>\n <p>Main level</p>\n <Input\n onChange={e => {\n setMainLevel([Number(e.target.value), mainLevel[1]]);\n onChangeMainLevelInput([Number(e.target.value), mainLevel[1]]);\n }}\n placeholder=\"Min\"\n type=\"number\"\n min={0}\n onBlur={enableHotkeys}\n onFocus={disableHotkeys}\n />\n <AiFillCaretRight />\n <Input\n onChange={e => {\n setMainLevel([mainLevel[0], Number(e.target.value)]);\n onChangeMainLevelInput([mainLevel[0], Number(e.target.value)]);\n }}\n placeholder=\"Max\"\n type=\"number\"\n min={0}\n onBlur={enableHotkeys}\n onFocus={disableHotkeys}\n />\n </div>\n\n <div>\n <p>Secondary level</p>\n <Input\n onChange={e => {\n setSecondaryLevel([Number(e.target.value), secondaryLevel[1]]);\n onChangeSecondaryLevelInput([\n Number(e.target.value),\n secondaryLevel[1],\n ]);\n }}\n placeholder=\"Min\"\n type=\"number\"\n min={0}\n onBlur={enableHotkeys}\n onFocus={disableHotkeys}\n />\n <AiFillCaretRight />\n <Input\n onChange={e => {\n setSecondaryLevel([secondaryLevel[0], Number(e.target.value)]);\n onChangeSecondaryLevelInput([\n secondaryLevel[0],\n Number(e.target.value),\n ]);\n }}\n placeholder=\"Max\"\n type=\"number\"\n min={0}\n onBlur={enableHotkeys}\n onFocus={disableHotkeys}\n />\n </div>\n\n <div>\n <p>Price</p>\n <Input\n onChange={e => {\n setPrice([Number(e.target.value), price[1]]);\n onChangePriceInput([Number(e.target.value), price[1]]);\n }}\n placeholder=\"Min\"\n type=\"number\"\n min={0}\n className=\"big-input\"\n onBlur={enableHotkeys}\n onFocus={disableHotkeys}\n />\n <AiFillCaretRight />\n <Input\n onChange={e => {\n setPrice([price[0], Number(e.target.value)]);\n onChangePriceInput([price[0], Number(e.target.value)]);\n }}\n placeholder=\"Max\"\n type=\"number\"\n min={0}\n className=\"big-input\"\n onBlur={enableHotkeys}\n onFocus={disableHotkeys}\n />\n </div>\n </FilterInputsWrapper>\n\n <WrapperContainer>\n <StyledDropdown\n options={itemTypeOptions}\n onChange={onChangeType}\n width=\"95%\"\n />\n <StyledDropdown\n options={itemRarityOptions}\n onChange={onChangeRarity}\n width=\"95%\"\n />\n <StyledDropdown\n options={orderByOptions}\n onChange={onChangeOrder}\n width=\"100%\"\n />\n </WrapperContainer>\n </OptionsWrapper>\n\n <ItemComponentScrollWrapper id=\"MarketContainer\" ref={itemsContainer}>\n {items?.map(({ item, price, _id, owner }, index) => (\n <MarketplaceRows\n key={`${item.key}_${index}`}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n item={item}\n itemPrice={price}\n equipmentSet={equipmentSet}\n onMarketPlaceItemBuy={setBuyingItemId.bind(null, _id)}\n disabled={owner === characterId}\n />\n ))}\n </ItemComponentScrollWrapper>\n </>\n );\n};\n\nconst InputWrapper = styled.div`\n width: 95%;\n display: flex !important;\n justify-content: flex-start;\n align-items: center;\n margin: auto;\n\n p {\n width: auto;\n margin-right: 20px;\n }\n\n input {\n width: 68%;\n height: 10px;\n }\n`;\n\nconst OptionsWrapper = styled.div`\n width: 100%;\n height: 100px;\n`;\n\nconst FilterInputsWrapper = styled.div`\n width: 95%;\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 10px;\n margin-left: 10px;\n gap: 5px;\n color: white;\n flex-wrap: wrap;\n\n p {\n width: auto;\n margin: 0;\n }\n\n input {\n width: 75px;\n height: 10px;\n }\n\n .big-input {\n width: 130px;\n }\n`;\n\nconst WrapperContainer = styled.div`\n display: grid;\n grid-template-columns: 40% 30% 30%;\n justify-content: space-between;\n width: calc(100% - 40px);\n margin-left: 10px;\n\n .rpgui-content .rpgui-dropdown-imp-header {\n padding: 0px 10px 0 !important;\n }\n`;\n\nconst ItemComponentScrollWrapper = styled.div`\n overflow-y: scroll;\n height: 390px;\n width: 100%;\n margin-top: 1rem;\n\n @media (max-width: 950px) {\n height: 250px;\n }\n`;\n\nconst StyledDropdown = styled(Dropdown)`\n margin: 3px !important;\n width: 170px !important;\n`;\n","import { IEquipmentSet, IItem, IMarketplaceItem } from '@rpg-engine/shared';\nimport React, { useEffect, useRef, useState } from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\nimport { uiFonts } from '../../constants/uiFonts';\nimport { Button, ButtonTypes } from '../Button';\nimport { ConfirmModal } from '../ConfirmModal';\nimport { Input } from '../Input';\nimport { ItemSlot } from '../Item/Inventory/ItemSlot';\nimport { MarketplaceRows } from './MarketplaceRows';\n\nexport interface IManagmentPanelProps {\n items: IMarketplaceItem[];\n atlasJSON: any;\n atlasIMG: any;\n onChangeNameInput: (value: string) => void;\n equipmentSet?: IEquipmentSet | null;\n availableGold: number;\n onMarketPlaceItemRemove?: (marketPlaceItemId: string) => void;\n selectedItemToSell: IItem | null;\n onSelectedItemToSellRemove: (item: IItem) => void;\n onAddItemToMarketplace: (item: IItem, price: number) => void;\n enableHotkeys?: () => void;\n disableHotkeys?: () => void;\n onMoneyWithdraw: () => void;\n currentPage: number;\n}\n\nexport const ManagmentPanel: React.FC<IManagmentPanelProps> = ({\n items,\n atlasIMG,\n atlasJSON,\n onChangeNameInput,\n equipmentSet,\n availableGold,\n onMarketPlaceItemRemove,\n selectedItemToSell,\n onSelectedItemToSellRemove,\n onAddItemToMarketplace,\n enableHotkeys,\n disableHotkeys,\n onMoneyWithdraw,\n currentPage,\n}) => {\n const [name, setName] = useState('');\n const [price, setPrice] = useState('');\n const [isCreatingOffer, setIsCreatingOffer] = useState(false);\n const [removingItemId, setRemovingItemId] = useState<string | null>(null);\n\n const itemsContainer = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n itemsContainer.current?.scrollTo(0, 0);\n }, [currentPage]);\n\n return (\n <>\n {isCreatingOffer && (\n <ConfirmModal\n onClose={setIsCreatingOffer.bind(null, false)}\n onConfirm={() => {\n if (selectedItemToSell && price && Number(price)) {\n onAddItemToMarketplace(selectedItemToSell, Number(price));\n setPrice('');\n onSelectedItemToSellRemove(selectedItemToSell);\n setIsCreatingOffer(false);\n enableHotkeys?.();\n }\n }}\n message=\"Are you sure to create this offer?\"\n />\n )}\n {removingItemId && (\n <ConfirmModal\n onClose={setRemovingItemId.bind(null, null)}\n onConfirm={() => {\n onMarketPlaceItemRemove?.(removingItemId);\n setRemovingItemId(null);\n enableHotkeys?.();\n }}\n message=\"Are you sure to remove this item?\"\n />\n )}\n <InputWrapper>\n <p>Search By Name</p>\n <Input\n onChange={e => {\n setName(e.target.value);\n onChangeNameInput(e.target.value);\n }}\n value={name}\n placeholder=\"Enter name...\"\n onBlur={enableHotkeys}\n onFocus={disableHotkeys}\n />\n </InputWrapper>\n\n <OptionsWrapper>\n <InnerOptionsWrapper>\n <SellDescription>\n Click on item in inventory to sell it\n </SellDescription>\n <Flex>\n <ItemSlot\n slotIndex={0}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n onPointerDown={(_, __, item) => onSelectedItemToSellRemove(item)}\n item={selectedItemToSell}\n />\n <PriceInputWrapper>\n <p>Enter price</p>\n <Flex>\n <Input\n onChange={e => {\n setPrice(e.target.value);\n }}\n value={price}\n placeholder=\"Enter price...\"\n type=\"number\"\n disabled={!selectedItemToSell}\n onBlur={enableHotkeys}\n onFocus={disableHotkeys}\n />\n <Button\n buttonType={ButtonTypes.RPGUIButton}\n disabled={!selectedItemToSell || !price}\n onPointerDown={() => {\n if (selectedItemToSell && price && Number(price)) {\n setIsCreatingOffer(true);\n }\n }}\n >\n Create offer\n </Button>\n </Flex>\n </PriceInputWrapper>\n </Flex>\n </InnerOptionsWrapper>\n <InnerOptionsWrapper>\n <AvailableGold $disabled={availableGold === 0}>\n <p>Available gold</p>\n <p className=\"center\">${availableGold}</p>\n <Button\n buttonType={ButtonTypes.RPGUIButton}\n disabled={availableGold === 0}\n onPointerDown={() => availableGold > 0 && onMoneyWithdraw()}\n >\n Withdraw\n </Button>\n </AvailableGold>\n </InnerOptionsWrapper>\n </OptionsWrapper>\n\n <ItemComponentScrollWrapper id=\"MarketContainer\" ref={itemsContainer}>\n {items?.map(({ item, price, _id }, index) => (\n <MarketplaceRows\n key={`${item.key}_${index}`}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n item={item}\n itemPrice={price}\n equipmentSet={equipmentSet}\n onMarketPlaceItemRemove={setRemovingItemId.bind(null, _id)}\n />\n ))}\n </ItemComponentScrollWrapper>\n </>\n );\n};\n\nconst Flex = styled.div`\n display: flex;\n gap: 5px;\n align-items: center;\n`;\n\nconst InputWrapper = styled.div`\n width: 95%;\n display: flex !important;\n justify-content: flex-start;\n align-items: center;\n margin: auto;\n\n p {\n width: auto;\n margin-right: 20px;\n }\n\n input {\n width: 68%;\n height: 10px;\n }\n`;\n\nconst OptionsWrapper = styled.div`\n width: 100%;\n height: 100px;\n display: flex;\n align-items: center;\n justify-content: space-around;\n`;\n\nconst InnerOptionsWrapper = styled.div`\n display: flex;\n justify-content: space-between;\n flex-direction: column;\n height: 100%;\n`;\n\nconst ItemComponentScrollWrapper = styled.div`\n overflow-y: scroll;\n height: 390px;\n width: 100%;\n margin-top: 1rem;\n\n @media (max-width: 950px) {\n height: 250px;\n }\n`;\n\nconst PriceInputWrapper = styled.div`\n p {\n margin: 0;\n }\n\n input {\n width: 200px;\n }\n`;\n\nconst SellDescription = styled.p`\n margin: 0;\n font-size: ${uiFonts.size.xsmall} !important;\n`;\n\nconst AvailableGold = styled.div<{ $disabled: boolean }>`\n height: 100%;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n\n p {\n margin: 0;\n color: ${props =>\n props.$disabled ? uiColors.lightGray : 'white'} !important;\n }\n\n .center {\n text-align: center;\n font-size: ${uiFonts.size.large} !important;\n color: ${props =>\n props.$disabled ? uiColors.lightGray : uiColors.lightGreen} !important;\n }\n`;\n","import { IEquipmentSet, IItem, IMarketplaceItem } from '@rpg-engine/shared';\nimport React, { useState } from 'react';\nimport styled from 'styled-components';\nimport { Button, ButtonTypes } from '../Button';\nimport { DraggableContainer } from '../DraggableContainer';\nimport { Pager } from '../Pager';\nimport { RPGUIContainerTypes } from '../RPGUI/RPGUIContainer';\nimport { BuyPanel } from './BuyPanel';\nimport { ManagmentPanel } from './ManagmentPanel';\n\nexport interface IMarketPlaceProps {\n items: IMarketplaceItem[];\n atlasJSON: any;\n atlasIMG: any;\n onClose: () => void;\n onChangeType: (value: string) => void;\n onChangeRarity: (value: string) => void;\n onChangeOrder: (value: string) => void;\n onChangeNameInput: (value: string) => void;\n onChangeMainLevelInput: (\n value: [number | undefined, number | undefined]\n ) => void;\n onChangeSecondaryLevelInput: (\n value: [number | undefined, number | undefined]\n ) => void;\n onChangePriceInput: (value: [number | undefined, number | undefined]) => void;\n scale?: number;\n equipmentSet?: IEquipmentSet | null;\n onMarketPlaceItemBuy?: (marketPlaceItemId: string) => void;\n onMarketPlaceItemRemove?: (marketPlaceItemId: string) => void;\n availableGold: number;\n selectedItemToSell: IItem | null;\n onSelectedItemToSellRemove: (item: IItem) => void;\n onYourPanelToggle: (yourPanel: boolean) => void;\n onAddItemToMarketplace: (item: IItem, price: number) => void;\n characterId: string;\n enableHotkeys?: () => void;\n disableHotkeys?: () => void;\n onMoneyWithdraw: () => void;\n totalItems: number;\n currentPage: number;\n itemsPerPage: number;\n onPageChange: (page: number) => void;\n}\n\nexport const Marketplace: React.FC<IMarketPlaceProps> = props => {\n const { onClose, scale, onYourPanelToggle } = props;\n\n const [isYourPanel, setIsYourPanel] = useState(false);\n\n return (\n <DraggableContainer\n type={RPGUIContainerTypes.Framed}\n onCloseButton={() => {\n if (onClose) onClose();\n }}\n width=\"800px\"\n cancelDrag=\"#MarketContainer, .rpgui-dropdown-imp, input, .empty-slot, button\"\n scale={scale}\n >\n {isYourPanel && (\n <>\n <ManagmentPanel {...props} />\n\n <PagerContainer>\n <Button\n buttonType={ButtonTypes.RPGUIButton}\n onPointerDown={() => {\n onYourPanelToggle(false);\n setIsYourPanel(false);\n }}\n >\n Go to marketplace\n </Button>\n <Pager {...props} />\n </PagerContainer>\n </>\n )}\n {!isYourPanel && (\n <>\n <BuyPanel {...props} />\n\n <PagerContainer>\n <Button\n buttonType={ButtonTypes.RPGUIButton}\n onPointerDown={() => {\n onYourPanelToggle(true);\n setIsYourPanel(true);\n }}\n >\n Go to your panel\n </Button>\n <Pager {...props} />\n </PagerContainer>\n </>\n )}\n </DraggableContainer>\n );\n};\n\nconst PagerContainer = styled.div`\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: calc(100% - 30px);\n`;\n","import React from 'react';\nimport styled from 'styled-components';\n\ninterface IContainerStyles {\n height?: string;\n width?: string;\n}\n\ninterface IProps {\n id: string;\n children: React.ReactNode;\n styles?: IContainerStyles;\n centerContent?: boolean;\n}\n\nexport const TabBody: React.FC<IProps> = ({\n id,\n children,\n styles,\n centerContent,\n}) => {\n return (\n <Container styles={styles} data-tab-id={id} centerContent={centerContent}>\n {children}\n </Container>\n );\n};\n\ninterface IContainerProps {\n styles?: IContainerStyles;\n centerContent?: boolean;\n}\n\nconst Container = styled.div<IContainerProps>`\n width: ${props => props.styles?.width || '100%'};\n height: ${props => props.styles?.height || 'auto'};\n overflow-y: auto;\n display: ${props => (props.centerContent ? 'flex' : 'block')};\n justify-content: ${props => (props.centerContent ? 'center' : 'initial')};\n align-items: ${props => (props.centerContent ? 'center' : 'initial')};\n`;\n","import React from 'react';\nimport styled from 'styled-components';\nimport { MultitabType } from './TabsContainer';\n\nexport interface ISingleTab {\n active: boolean;\n label: string;\n onPointerDown: () => void;\n type: MultitabType;\n}\n\nexport const Tab: React.FC<ISingleTab> = ({\n active,\n label,\n onPointerDown,\n type,\n}) => {\n return (\n <CustomTab\n activeTab={active}\n onPointerDown={onPointerDown}\n className={type}\n >\n <p>{label}</p>\n </CustomTab>\n );\n};\n\ninterface ICustomTab {\n activeTab: boolean;\n}\n\nconst CustomTab = styled.div<ICustomTab>`\n width: 120px;\n color: white;\n font-size: 0.8rem;\n\n &.gray {\n border-left: 0.25rem solid rgba(0, 0, 0, 0.25);\n border-right: 0.25rem solid rgba(0, 0, 0, 0.25);\n border-top: 0.25rem solid rgba(0, 0, 0, 0.25);\n border-bottom: ${props =>\n props.activeTab ? '' : '0.25rem solid rgba(0, 0, 0, 0.25)'};\n background: ${props => (props.activeTab ? '#4E4A4E' : '#2b292b')};\n }\n\n &.brown {\n border-left: 0.25rem solid #996d55;\n border-right: 0.25rem solid #996d55;\n border-top: 0.25rem solid #996d55;\n border-bottom: ${props => (props.activeTab ? '' : '0.25rem solid #996d55')};\n background: ${props => (props.activeTab ? '#BF886A' : '#B67051')};\n }\n\n margin-right: 10px;\n p {\n text-align: center;\n font-size: 0.6rem;\n\n opacity: ${props => (props.activeTab ? '1' : '0.5')};\n }\n\n border-radius: 5px 5px 0 0;\n\n position: relative;\n top: 0.3rem;\n`;\n","import React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../../constants/uiColors';\nimport { Button, ButtonTypes } from '../../Button';\nimport { DraggableContainer } from '../../DraggableContainer';\nimport { Input } from '../../Input';\nimport { RPGUIContainerTypes } from '../../RPGUI/RPGUIContainer';\n\nexport interface IPartyCreateProps {\n onClose: () => void;\n onCreate: () => void;\n}\n\nexport const PartyCreate: React.FC<IPartyCreateProps> = ({\n onClose,\n onCreate,\n}) => {\n return (\n <DraggableContainer\n type={RPGUIContainerTypes.Framed}\n onCloseButton={() => {\n if (onClose) onClose();\n }}\n width=\"500px\"\n height=\"300px\"\n cancelDrag=\".partyRows\"\n >\n <Wrapper>\n <div style={{ width: '100%' }}>\n <Title>Create Party</Title>\n <hr className=\"golden\" />\n </div>\n </Wrapper>\n <h1>Type your party name</h1>\n <Input placeholder=\"Type party name\" type=\"text\" />\n <ButtonWrapper>\n <Button\n buttonType={ButtonTypes.RPGUIButton}\n onPointerDown={() => {\n onCreate();\n }}\n >\n Confirm\n </Button>\n <div className=\"cancel-button\">\n <Button\n buttonType={ButtonTypes.RPGUIButton}\n onPointerDown={() => {\n close();\n }}\n >\n Cancel\n </Button>\n </div>\n </ButtonWrapper>\n </DraggableContainer>\n );\n};\n\nconst Wrapper = styled.div`\n display: flex;\n flex-direction: column;\n width: 100%;\n`;\nconst Title = styled.h1`\n font-size: 0.6rem;\n color: ${uiColors.yellow} !important;\n`;\n\nconst ButtonWrapper = styled.div`\n margin-top: 10px;\n width: 100%;\n display: flex;\n justify-content: space-around;\n align-items: center;\n .cancel-button {\n filter: grayscale(0.7);\n }\n`;\n","import React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../../constants/uiColors';\nimport { Button, ButtonTypes } from '../../Button';\n\nexport interface IPartyRowProps {\n id: string;\n charName: string;\n charClass: string;\n charLevel: number;\n playerQty: number;\n isInvited: boolean;\n partyName: string;\n}\n\nexport const PartyRow: React.FC<IPartyRowProps> = ({\n charName,\n charClass,\n charLevel,\n playerQty,\n isInvited,\n partyName,\n}) => {\n return (\n <PartyWrapper>\n <TextContainer>{partyName}</TextContainer>\n <TextContainer>{charName}</TextContainer>\n <TextContainer>{charClass}</TextContainer>\n <TextContainer>{charLevel}</TextContainer>\n <TextContainer>{playerQty}/5</TextContainer>\n {isInvited ? (\n <>\n <Button buttonType={ButtonTypes.RPGUIButton}>Accept</Button>\n <div className=\"cancel-button\">\n <Button buttonType={ButtonTypes.RPGUIButton}>Decline</Button>\n </div>\n </>\n ) : (\n <Button buttonType={ButtonTypes.RPGUIButton}>Join</Button>\n )}\n </PartyWrapper>\n );\n};\n\nconst PartyWrapper = styled.div`\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: space-around;\n .cancel-button {\n filter: grayscale(0.7);\n }\n`;\n\nconst TextContainer = styled.div`\n color: ${uiColors.white};\n`;\n","import React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../../constants/uiColors';\nimport { Button, ButtonTypes } from '../../Button';\nimport { DraggableContainer } from '../../DraggableContainer';\nimport { RPGUIContainerTypes } from '../../RPGUI/RPGUIContainer';\nimport { IPartyRowProps, PartyRow } from './PartyRows';\n\nexport interface IPartyDashboardProps {\n partyRows: IPartyRowProps[];\n}\n\nexport const PartyDashboard: React.FC<IPartyDashboardProps> = ({\n partyRows,\n}) => {\n return (\n <DraggableContainer\n type={RPGUIContainerTypes.Framed}\n onCloseButton={() => {\n console.log('Close');\n }}\n width=\"800px\"\n height=\"400px\"\n cancelDrag=\".partyRows\"\n >\n <Wrapper>\n <div style={{ width: '100%' }}>\n <Title>Party Dashboard</Title>\n <Button buttonType={ButtonTypes.RPGUIButton}>Create</Button>\n <hr className=\"golden\" />\n </div>\n </Wrapper>\n <RowsWrapper className=\"partyRows\">\n {partyRows.map(partyRows => (\n <PartyRow\n key={partyRows.id}\n charName={partyRows.charName}\n charClass={partyRows.charClass}\n charLevel={partyRows.charLevel}\n playerQty={partyRows.playerQty}\n id={partyRows.id}\n isInvited={partyRows.isInvited}\n partyName={partyRows.partyName}\n />\n ))}\n </RowsWrapper>\n </DraggableContainer>\n );\n};\n\nconst Wrapper = styled.div`\n display: flex;\n flex-direction: column;\n width: 100%;\n`;\n\nconst RowsWrapper = styled.div`\n overflow-y: scroll;\n -webkit-overflow-scrolling: touch;\n width: 100%;\n height: 200px;\n`;\n\nconst Title = styled.h1`\n font-size: 0.6rem;\n color: ${uiColors.yellow} !important;\n`;\n","import React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../../constants/uiColors';\nimport { Button, ButtonTypes } from '../../Button';\n\nexport interface IPlayersRowProps {\n id: string;\n charName: string;\n charClass: string;\n charLevel: number;\n isNotInvited: boolean;\n}\n\nexport const PlayersRow: React.FC<IPlayersRowProps> = ({\n charName,\n charClass,\n charLevel,\n isNotInvited,\n}) => {\n return (\n <PartyWrapper>\n <TextContainer>{charName}</TextContainer>\n <TextContainer>{charClass}</TextContainer>\n <TextContainer>{charLevel}</TextContainer>\n {isNotInvited ? (\n <>\n <Button buttonType={ButtonTypes.RPGUIButton}>Invite</Button>\n </>\n ) : (\n <TextContainer>Invited</TextContainer>\n )}\n </PartyWrapper>\n );\n};\n\nconst PartyWrapper = styled.div`\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: space-around;\n flex-direction: row;\n flex: auto;\n`;\n\nconst TextContainer = styled.div`\n color: ${uiColors.white};\n flex: auto;\n margin: auto;\n`;\n","import React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../../constants/uiColors';\nimport { DraggableContainer } from '../../DraggableContainer';\nimport { RPGUIContainerTypes } from '../../RPGUI/RPGUIContainer';\nimport { IPlayersRowProps, PlayersRow } from './PlayersRows';\n\nexport interface IPartyInviteProps {\n playersRows: IPlayersRowProps[];\n}\n\nexport const PartyInvite: React.FC<IPartyInviteProps> = ({ playersRows }) => {\n return (\n <DraggableContainer\n type={RPGUIContainerTypes.Framed}\n onCloseButton={() => {\n console.log('Close');\n }}\n width=\"600px\"\n height=\"400px\"\n cancelDrag=\".playersRows\"\n >\n <Wrapper>\n <div style={{ width: '100%' }}>\n <Title>Invite for Party</Title>\n <hr className=\"golden\" />\n </div>\n </Wrapper>\n <RowsWrapper className=\"playersRows\">\n {playersRows.map(playersRows => (\n <PlayersRow\n key={playersRows.id}\n charName={playersRows.charName}\n charClass={playersRows.charClass}\n charLevel={playersRows.charLevel}\n id={playersRows.id}\n isNotInvited={playersRows.isNotInvited}\n />\n ))}\n </RowsWrapper>\n </DraggableContainer>\n );\n};\n\nconst Wrapper = styled.div`\n display: flex;\n flex-direction: column;\n width: 100%;\n`;\nconst Title = styled.h1`\n font-size: 0.6rem;\n color: ${uiColors.yellow} !important;\n`;\n\nconst RowsWrapper = styled.div`\n overflow-y: scroll;\n -webkit-overflow-scrolling: touch;\n width: 100%;\n height: 200px;\n`;\n","import React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\n\ninterface IProps extends React.HTMLAttributes<HTMLParagraphElement> {\n children: string;\n}\n\nexport const HighlightedText = ({ children, ...rest }: IProps) => {\n return <Text {...rest}>{children}</Text>;\n};\n\nconst Text = styled.p`\n color: ${uiColors.yellow} !important;\n\n font-weight: bold;\n font-size: 1.2rem;\n\n // show the cursor as a pointer when hovering over the text\n\n &:hover {\n text-decoration: underline;\n cursor: pointer;\n }\n`;\n","import React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../../constants/uiColors';\nimport { HighlightedText } from '../../Text/HighlightedText';\nimport { Ellipsis } from '../../shared/Ellipsis';\n\nexport interface IPartyManagerRowProps {\n id: string;\n charName: string;\n charClass: string;\n isLeader: boolean;\n leaderId: string;\n userId: string;\n onRemovePlayer: (id: string) => void;\n onChangeLeader: (id: string) => void;\n}\n\nexport const PartyManagerRow: React.FC<IPartyManagerRowProps> = ({\n charName,\n charClass,\n isLeader,\n id,\n leaderId,\n userId,\n onRemovePlayer,\n onChangeLeader,\n}) => {\n const isCurrentUser = id === userId;\n const canRemove = leaderId === userId || isCurrentUser;\n\n return (\n <PartyWrapper>\n <TextContainer>\n <Ellipsis maxLines={1} maxWidth=\"300px\">\n {charName} {isCurrentUser ? '(You)' : ''} {isLeader ? '(Leader)' : ''}\n </Ellipsis>\n </TextContainer>\n <TextContainer>\n <Ellipsis maxLines={1} maxWidth=\"300px\">\n {charClass}\n </Ellipsis>\n </TextContainer>\n <ButtonContainer>\n {canRemove && (\n <HighlightedText onPointerDown={() => onRemovePlayer(id)}>\n {isCurrentUser ? 'Leave' : 'Remove'}\n </HighlightedText>\n )}\n {leaderId === userId && leaderId !== id && (\n <HighlightedText onPointerDown={() => onChangeLeader(id)}>\n New Leader\n </HighlightedText>\n )}\n </ButtonContainer>\n </PartyWrapper>\n );\n};\n\nconst PartyWrapper = styled.div`\n display: grid;\n grid-template-columns: 2fr 1fr 1fr;\n align-items: center;\n padding: 0.5rem;\n min-height: 50px;\n box-sizing: border-box;\n width: 100%;\n border-bottom: 1px solid ${uiColors.darkGray};\n\n &:hover {\n background-color: ${uiColors.darkGray};\n cursor: pointer;\n }\n`;\n\nconst TextContainer = styled.div`\n color: ${uiColors.white};\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n`;\n\nconst ButtonContainer = styled.div`\n display: flex;\n align-items: center;\n gap: 1rem;\n justify-content: flex-start;\n`;\n","import { ICharacterPartyShared, isMobileOrTablet } from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../../constants/uiColors';\nimport { PartyManagerRow } from './PartyManagerRows';\n\nexport interface IPartyManagerProps {\n partyRows: ICharacterPartyShared | null;\n\n userId: string;\n onRemovePlayer: (id: string) => void;\n onChangeLeader: (id: string) => void;\n}\n\nexport const PartyManager: React.FC<IPartyManagerProps> = ({\n partyRows,\n userId,\n onRemovePlayer,\n onChangeLeader,\n}) => {\n const invitationActionText = isMobileOrTablet() ? 'Tap' : 'Right click';\n\n const sortedMembers =\n partyRows?.leader && partyRows?.members\n ? [partyRows.leader, ...partyRows.members].sort((a, b) =>\n a._id === partyRows.leader._id\n ? -1\n : b._id === partyRows.leader._id\n ? 1\n : 0\n )\n : [];\n\n return (\n <>\n <RowsWrapper className=\"partyRows\">\n {partyRows && sortedMembers.length ? (\n sortedMembers.map(partyRow => (\n <PartyManagerRow\n userId={userId}\n key={partyRow._id}\n charName={partyRow.name}\n charClass={partyRow.class}\n id={partyRow._id}\n isLeader={partyRow._id === partyRows.leader._id}\n leaderId={partyRows.leader._id}\n onRemovePlayer={() => onRemovePlayer(partyRow._id)}\n onChangeLeader={() => onChangeLeader(partyRow._id)}\n />\n ))\n ) : (\n <NotInParty>\n <p>You're not in a party.</p>\n <p>\n Tip: <YellowText>{invitationActionText}</YellowText> on a player\n to invite them.\n </p>\n </NotInParty>\n )}\n </RowsWrapper>\n </>\n );\n};\n\nconst RowsWrapper = styled.div`\n width: 100%;\n max-height: 300px;\n overflow-y: auto;\n overflow-x: hidden;\n`;\n\nconst YellowText = styled.span`\n color: ${uiColors.yellow} !important;\n`;\n\nconst NotInParty = styled.h1`\n font-size: 0.6rem;\n margin: auto;\n`;\n","import { CharacterClass, ICharacterPartyShared } from '@rpg-engine/shared';\nimport { v4 as uuidv4 } from 'uuid';\nimport { IPartyRowProps } from '../PartyDashboard/PartyRows';\nimport { IPlayersRowProps } from '../PartyInvite';\n\nexport const mockedPartyRows: IPartyRowProps[] = [\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n charLevel: 1,\n playerQty: 3,\n isInvited: true,\n partyName: 'Party',\n },\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n charLevel: 1,\n playerQty: 3,\n isInvited: true,\n partyName: 'Party',\n },\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n charLevel: 1,\n playerQty: 3,\n isInvited: true,\n partyName: 'Party',\n },\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n charLevel: 1,\n playerQty: 3,\n isInvited: true,\n partyName: 'Party',\n },\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n charLevel: 1,\n playerQty: 3,\n isInvited: true,\n partyName: 'Party',\n },\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n charLevel: 1,\n playerQty: 3,\n isInvited: true,\n partyName: 'Party',\n },\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n charLevel: 1,\n playerQty: 3,\n isInvited: true,\n partyName: 'Party',\n },\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n charLevel: 1,\n playerQty: 3,\n isInvited: true,\n partyName: 'Party',\n },\n];\n\nexport const mockedPlayersRows2: ICharacterPartyShared = {\n id: uuidv4(),\n leader: {\n _id: uuidv4(),\n class: CharacterClass.Druid,\n name: 'leader',\n },\n members: [\n { _id: uuidv4(), class: CharacterClass.Druid, name: 'blblb' },\n { _id: uuidv4(), class: CharacterClass.Druid, name: 'blblb' },\n { _id: uuidv4(), class: CharacterClass.Druid, name: 'blblb' },\n { _id: uuidv4(), class: CharacterClass.Druid, name: 'blblb' },\n { _id: uuidv4(), class: CharacterClass.Druid, name: 'blblb' },\n { _id: uuidv4(), class: CharacterClass.Druid, name: 'blblb' },\n { _id: uuidv4(), class: CharacterClass.Druid, name: 'blblb' },\n { _id: uuidv4(), class: CharacterClass.Druid, name: 'blblb' },\n { _id: uuidv4(), class: CharacterClass.Druid, name: 'blblb' },\n { _id: uuidv4(), class: CharacterClass.Druid, name: 'blblb' },\n { _id: uuidv4(), class: CharacterClass.Druid, name: 'blblb' },\n ],\n maxSize: 5,\n size: 4,\n};\n\nexport const mockedPlayersRows: IPlayersRowProps[] = [\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n charLevel: 1,\n isNotInvited: true,\n },\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n charLevel: 1,\n isNotInvited: true,\n },\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n charLevel: 1,\n isNotInvited: true,\n },\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n charLevel: 1,\n isNotInvited: true,\n },\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n charLevel: 1,\n isNotInvited: true,\n },\n];\n\nexport const mockedPartyManager: any[] = [\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n isLeader: false,\n },\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n isLeader: false,\n },\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n isLeader: false,\n },\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n isLeader: false,\n },\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n isLeader: false,\n },\n];\n\n// Function to generate mock data for when you are the leader\nexport const getMockedPlayersRowsLeader = (\n userId: string\n): ICharacterPartyShared => ({\n id: uuidv4(),\n leader: {\n _id: userId, // You are the leader\n class: CharacterClass.Warrior,\n name: 'YourName',\n },\n members: [\n { _id: uuidv4(), class: CharacterClass.Druid, name: 'Member1' },\n { _id: uuidv4(), class: CharacterClass.Sorcerer, name: 'Member2' },\n { _id: uuidv4(), class: CharacterClass.Rogue, name: 'Member3' },\n ],\n maxSize: 5,\n size: 4,\n});\n\n// Function to generate mock data for when you are not the leader\nexport const getMockedPlayersRowsNotLeader = (\n userId: string\n): ICharacterPartyShared => ({\n id: uuidv4(),\n leader: {\n _id: uuidv4(), // Someone else is the leader\n class: CharacterClass.Druid,\n name: 'LeaderName',\n },\n members: [\n { _id: userId, class: CharacterClass.Warrior, name: 'YourName' }, // You are a member\n { _id: uuidv4(), class: CharacterClass.Sorcerer, name: 'Member2' },\n { _id: uuidv4(), class: CharacterClass.Rogue, name: 'Member3' },\n ],\n maxSize: 5,\n size: 4,\n});\n","import React from 'react';\nimport styled from 'styled-components';\nimport { uiFonts } from '../constants/uiFonts';\n\nexport interface IBarProps {\n max: number;\n value: number;\n color: 'red' | 'blue' | 'green';\n style?: Record<string, any>;\n displayText?: boolean;\n percentageWidth?: number;\n minWidth?: number;\n mobileScale?: number;\n}\n\nexport const ProgressBar: React.FC<IBarProps> = ({\n max,\n value,\n color,\n displayText = true,\n percentageWidth = 40,\n minWidth = 100,\n style,\n mobileScale,\n}) => {\n value = Math.round(value);\n max = Math.round(max);\n\n const calculatePercentageValue = function(max: number, value: number) {\n if (value > max) {\n value = max;\n }\n return (value * 100) / max;\n };\n\n return (\n <Container\n className=\"rpgui-progress\"\n data-value={calculatePercentageValue(max, value) / 100}\n data-rpguitype=\"progress\"\n percentageWidth={percentageWidth}\n minWidth={minWidth}\n style={style}\n mobileScale={mobileScale}\n >\n {displayText && (\n <TextOverlay>\n <ProgressBarText>\n {value}/{max}\n </ProgressBarText>\n </TextOverlay>\n )}\n <div className=\" rpgui-progress-track\">\n <div\n className={`rpgui-progress-fill ${color} `}\n style={{\n left: '0px',\n width: calculatePercentageValue(max, value) + '%',\n }}\n ></div>\n </div>\n <div className=\" rpgui-progress-left-edge\"></div>\n <div className=\" rpgui-progress-right-edge\"></div>\n </Container>\n );\n};\n\nconst ProgressBarText = styled.span`\n font-size: ${uiFonts.size.small} !important;\n color: white;\n text-align: center;\n z-index: 1;\n position: absolute;\n left: 50%;\n transform: translateX(-50%);\n top: 12px;\n`;\n\nconst TextOverlay = styled.div`\n width: 100%;\n position: relative;\n`;\n\ninterface IContainerProps {\n percentageWidth?: number;\n minWidth?: number;\n style?: Record<string, any>;\n mobileScale?: number;\n}\n\nconst Container = styled.div<IContainerProps>`\n display: flex;\n flex-direction: column;\n min-width: ${props => props.minWidth}px;\n width: ${props => props.percentageWidth}%;\n justify-content: start;\n align-items: flex-start;\n ${props => props.style}\n @media (max-width: 950px) {\n transform: scale(${props => props.mobileScale});\n }\n`;\n","import { IQuest } from '@rpg-engine/shared';\nimport React, { useEffect, useState } from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../../constants/uiColors';\nimport { uiFonts } from '../../../constants/uiFonts';\nimport SelectArrow from '../../Arrow/SelectArrow';\nimport { Button, ButtonTypes } from '../../Button';\nimport { DraggableContainer } from '../../DraggableContainer';\n\nimport { RPGUIContainerTypes } from '../../RPGUI/RPGUIContainer';\nimport { Column } from '../../shared/Column';\nimport thumbnailDefault from './img/default.png';\n\nexport interface IQuestsButtonProps {\n disabled: boolean;\n title: string;\n onClick: (questId: string, npcId: string) => void;\n}\n\nexport interface IQuestInfoProps {\n onClose?: () => void;\n buttons?: IQuestsButtonProps[];\n quests: IQuest[];\n onChangeQuest: (currentQuestIndex: number, currentQuestId: string) => void;\n scale?: number;\n}\n\nexport const QuestInfo: React.FC<IQuestInfoProps> = ({\n quests,\n onClose,\n buttons,\n onChangeQuest,\n scale,\n}) => {\n const [currentIndex, setCurrentIndex] = useState(0);\n const questsLength = quests.length - 1;\n\n useEffect(() => {\n if (onChangeQuest) {\n onChangeQuest(currentIndex, quests[currentIndex]._id);\n }\n }, [currentIndex]);\n\n const onLeftClick = () => {\n if (currentIndex === 0) setCurrentIndex(questsLength);\n else setCurrentIndex(index => index - 1);\n };\n const onRightClick = () => {\n if (currentIndex === questsLength) setCurrentIndex(0);\n else setCurrentIndex(index => index + 1);\n };\n\n return (\n <QuestDraggableContainer\n type={RPGUIContainerTypes.Framed}\n onCloseButton={() => {\n if (onClose) onClose();\n }}\n width=\"730px\"\n cancelDrag=\".equipment-container-body .arrow-selector\"\n scale={scale}\n >\n {quests.length >= 2 ? (\n <QuestsContainer>\n {currentIndex !== 0 && (\n <SelectArrow\n direction=\"left\"\n onPointerDown={onLeftClick}\n ></SelectArrow>\n )}\n {currentIndex !== quests.length - 1 && (\n <SelectArrow\n direction=\"right\"\n onPointerDown={onRightClick}\n ></SelectArrow>\n )}\n\n <QuestContainer>\n <TitleContainer className=\"drag-handler\">\n <Title>\n <Thumbnail\n src={quests[currentIndex].thumbnail || thumbnailDefault}\n />\n {quests[currentIndex].title}\n </Title>\n <QuestSplitDiv>\n <hr className=\"golden\" />\n </QuestSplitDiv>\n </TitleContainer>\n <Content>\n <p>{quests[currentIndex].description}</p>\n </Content>\n <QuestColumn className=\"dark-background\" justifyContent=\"flex-end\">\n {buttons &&\n buttons.map((button, index) => (\n <Button\n key={index}\n onPointerDown={() =>\n button.onClick(\n quests[currentIndex]._id,\n quests[currentIndex].npcId\n )\n }\n disabled={button.disabled}\n buttonType={ButtonTypes.RPGUIButton}\n id={`button-${index}`}\n >\n {button.title}\n </Button>\n ))}\n </QuestColumn>\n </QuestContainer>\n </QuestsContainer>\n ) : (\n <QuestsContainer>\n <QuestContainer>\n <TitleContainer className=\"drag-handler\">\n <Title>\n <Thumbnail src={quests[0].thumbnail || thumbnailDefault} />\n {quests[0].title}\n </Title>\n <QuestSplitDiv>\n <hr className=\"golden\" />\n </QuestSplitDiv>\n </TitleContainer>\n <Content>\n <p>{quests[0].description}</p>\n </Content>\n <QuestColumn className=\"dark-background\" justifyContent=\"flex-end\">\n {buttons &&\n buttons.map((button, index) => (\n <Button\n key={index}\n onPointerDown={() =>\n button.onClick(quests[0]._id, quests[0].npcId)\n }\n disabled={button.disabled}\n buttonType={ButtonTypes.RPGUIButton}\n id={`button-${index}`}\n >\n {button.title}\n </Button>\n ))}\n </QuestColumn>\n </QuestContainer>\n </QuestsContainer>\n )}\n </QuestDraggableContainer>\n );\n};\n\nconst QuestDraggableContainer = styled(DraggableContainer)`\n border: 1px solid black;\n width: 600px;\n padding: 0 0 0 0 !important;\n .DraggableContainer__TitleContainer-sc-184mpyl-2 {\n height: auto;\n }\n .container-close {\n position: absolute;\n margin-left: auto;\n top: 20px;\n padding-right: 5px;\n }\n img {\n display: inline-block;\n vertical-align: middle;\n line-height: normal;\n }\n`;\n\nconst QuestContainer = styled.div`\n margin-right: 40px;\n margin-left: 40px;\n`;\n\nconst QuestsContainer = styled.div`\n display: flex;\n align-items: center;\n`;\n\nconst Content = styled.div`\n padding: 18px;\n h1 {\n text-align: left;\n margin: 14px 0px;\n }\n`;\n\nconst QuestSplitDiv = styled.div`\n width: 100%;\n font-size: 11px;\n margin-bottom: 10px;\n hr {\n margin: 0px;\n padding: 0px;\n }\n p {\n margin-bottom: 0px;\n }\n`;\n\nconst QuestColumn = styled(Column)`\n padding-top: 5px;\n margin-bottom: 20px;\n display: flex;\n justify-content: space-evenly;\n`;\n\nconst TitleContainer = styled.div`\n width: 100%;\n display: flex;\n flex-wrap: wrap;\n justify-content: flex-start;\n align-items: center;\n margin-top: 1rem;\n`;\n\nconst Title = styled.h1`\n color: white;\n z-index: 22;\n font-size: ${uiFonts.size.medium} !important;\n color: ${uiColors.yellow} !important;\n`;\n\nconst Thumbnail = styled.img`\n color: white;\n z-index: 22;\n width: 32px * 1.5;\n margin-right: 0.5rem;\n position: relative;\n top: -4px;\n`;\n","import { IQuest, QuestStatus } from '@rpg-engine/shared';\nimport React from 'react';\nimport styled, { CSSProperties } from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\n\nexport interface IQuestListProps {\n quests?: IQuest[];\n styles?: {\n container?: CSSProperties;\n card?: CSSProperties;\n label?: CSSProperties;\n value?: CSSProperties;\n };\n}\n\nexport const QuestList: React.FC<IQuestListProps> = ({ quests, styles }) => {\n return (\n <QuestListContainer style={styles?.container}>\n {quests && quests.length > 0 ? (\n quests.map((quest, i) => (\n <QuestCard key={i} style={styles?.card}>\n <QuestItem>\n <Label style={styles?.label}>Title:</Label>\n <Value style={styles?.value}>\n {formatQuestText(quest.title)}\n </Value>\n </QuestItem>\n <QuestItem>\n <Label style={styles?.label}>Status:</Label>\n <Value\n style={{\n ...styles?.value,\n color: getQuestStatusColor(quest.status),\n }}\n >\n {formatQuestStatus(quest.status) ?? 'Unknown'}\n </Value>\n </QuestItem>\n <QuestItem>\n <Label style={styles?.label}>Description:</Label>\n <Value style={styles?.value}>{quest.description}</Value>\n </QuestItem>\n </QuestCard>\n ))\n ) : (\n <NoQuestContainer>\n <p>There are no ongoing quests</p>\n </NoQuestContainer>\n )}\n </QuestListContainer>\n );\n};\n\nconst QuestListContainer = styled.div`\n max-height: 400px;\n padding: 10px;\n border-radius: 10px;\n font-size: 0.7rem;\n`;\n\nconst QuestCard = styled.div`\n background-color: ${uiColors.darkGray};\n padding: 15px;\n margin-bottom: 10px;\n border-radius: 10px;\n border: 1px solid ${uiColors.gray};\n display: flex;\n flex-direction: column;\n`;\n\nconst QuestItem = styled.div`\n display: flex;\n margin-bottom: 5px;\n flex-wrap: wrap;\n\n &:last-child {\n margin-bottom: 0;\n }\n`;\n\nconst Label = styled.span`\n font-weight: bold;\n color: ${uiColors.yellow} !important;\n margin-right: 10px;\n`;\n\nconst Value = styled.span`\n flex-grow: 1;\n color: ${uiColors.white};\n word-wrap: break-word;\n`;\n\nconst NoQuestContainer = styled.div`\n text-align: center;\n p {\n margin-top: 5px;\n color: ${uiColors.lightGray};\n }\n`;\n\nexport const formatQuestText = (text: string) => {\n if (!text) return '';\n return text\n .split('-')\n .map(word => word.charAt(0).toUpperCase() + word.slice(1))\n .join(' ');\n};\n\nexport const getQuestStatusColor = (status?: QuestStatus) => {\n switch (status) {\n case QuestStatus.Pending:\n return uiColors.orange;\n case QuestStatus.InProgress:\n return uiColors.blue;\n case QuestStatus.Completed:\n return uiColors.lightGreen;\n default:\n return uiColors.white;\n }\n};\n\nexport const formatQuestStatus = (status?: QuestStatus) => {\n if (!status) return '';\n return status\n .split(/(?=[A-Z])/)\n .join(' ')\n .replace(/^\\w/, c => c.toUpperCase());\n};\n","import React from 'react';\nimport styled from 'styled-components';\n\ninterface IProps {\n children: React.ReactNode;\n}\n\nexport const RPGUIScrollbar = ({ children }: IProps) => {\n return <Container>{children}</Container>;\n};\n\nconst Container = styled.div`\n /* Override RPGUI CSS */\n\n .rpgui-content ::-webkit-scrollbar,\n .rpgui-content::-webkit-scrollbar {\n width: 25px !important;\n }\n\n .rpgui-content ::-webkit-scrollbar-track,\n .rpgui-content::-webkit-scrollbar-track {\n background-size: 25px 60px !important;\n }\n`;\n","import React from 'react';\nimport { RPGUIScrollbar } from './RPGUIScrollbar';\ninterface IProps {\n children: React.ReactNode;\n}\n\nexport const RPGUIOverrides = ({ children }: IProps) => {\n return <RPGUIScrollbar>{children}</RPGUIScrollbar>;\n};\n","import React from 'react';\nimport 'rpgui/rpgui.css';\nimport 'rpgui/rpgui.min.js';\nimport { RPGUIOverrides } from './RPGUIOverrides';\n\ninterface IProps {\n children: React.ReactNode;\n}\n\n//@ts-ignore\nexport const _RPGUI = RPGUI;\n\nexport const RPGUIRoot: React.FC<IProps> = ({ children }) => {\n return (\n <RPGUIOverrides>\n <div className=\"rpgui-content\">{children}</div>\n </RPGUIOverrides>\n );\n};\n","import {\n getItemTextureKeyPath,\n IItem,\n IItemContainer,\n IRawSpell,\n IShortcut,\n ShortcutType,\n} from '@rpg-engine/shared';\nimport React, { useCallback, useEffect, useRef } from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\nimport { countItemFromInventory } from '../../libs/itemCounter';\nimport { SpriteFromAtlas } from '../shared/SpriteFromAtlas';\nimport { SingleShortcut } from './SingleShortcut';\nimport { useShortcutCooldown } from './useShortcutCooldown';\n\nexport type ShortcutsProps = {\n shortcuts: IShortcut[];\n onShortcutCast: (index: number) => void;\n mana: number;\n isBlockedCastingByKeyboard?: boolean;\n inventory?: IItemContainer | null;\n atlasJSON: any;\n atlasIMG: any;\n spellCooldowns?: Record<string, number>;\n};\n\nexport const Shortcuts: React.FC<ShortcutsProps> = ({\n shortcuts,\n onShortcutCast,\n mana,\n isBlockedCastingByKeyboard = false,\n atlasJSON,\n atlasIMG,\n inventory,\n spellCooldowns,\n}) => {\n const shortcutsRefs = useRef<HTMLButtonElement[]>([]);\n\n const { handleShortcutCast, shortcutCooldown } = useShortcutCooldown(\n onShortcutCast\n );\n\n const handleKeyDown = useCallback(\n (e: KeyboardEvent) => {\n if (isBlockedCastingByKeyboard) return;\n\n const shortcutIndex = Number(e.key) - 1;\n if (shortcutIndex >= 0 && shortcutIndex <= 11) {\n handleShortcutCast(shortcutIndex);\n shortcutsRefs.current[shortcutIndex]?.classList.add('active');\n const timeoutId = setTimeout(() => {\n shortcutsRefs.current[shortcutIndex]?.classList.remove('active');\n }, 150);\n // Store timeoutId for later cleanup\n timeoutIds.current.push((timeoutId as unknown) as number);\n }\n },\n [isBlockedCastingByKeyboard, handleShortcutCast]\n );\n\n // Initialize a ref to store the timeout ids\n const timeoutIds = useRef<number[]>([]);\n\n useEffect(() => {\n window.addEventListener('keydown', handleKeyDown);\n\n return () => {\n window.removeEventListener('keydown', handleKeyDown);\n // Clear all timeouts when the component unmounts\n timeoutIds.current.forEach(id => clearTimeout(id));\n };\n }, [handleKeyDown]);\n\n return (\n <List>\n {Array.from({ length: 12 }).map((_, i) => {\n const buildClassName = (classBase: string, isOnCooldown: boolean) => {\n return `${classBase} ${isOnCooldown ? 'onCooldown' : ''}`;\n };\n\n const isOnShortcutCooldown = shortcutCooldown > 0;\n\n if (shortcuts && shortcuts[i]?.type === ShortcutType.Item) {\n const payload = shortcuts[i]?.payload as IItem | undefined;\n\n let itemsFromEquipment: (IItem | undefined | null)[] = [];\n\n if (inventory) {\n Object.keys(inventory.slots).forEach(i => {\n const index = parseInt(i);\n\n if (inventory.slots[index]?.key === payload?.key) {\n itemsFromEquipment.push(inventory.slots[index]);\n }\n });\n }\n\n const totalQty =\n payload && inventory\n ? countItemFromInventory(payload.key, inventory)\n : 0;\n\n return (\n <StyledShortcut\n key={i}\n onPointerDown={handleShortcutCast.bind(null, i)}\n disabled={false}\n ref={el => {\n if (el) shortcutsRefs.current[i] = el;\n }}\n >\n {isOnShortcutCooldown && (\n <span className=\"cooldown\">{shortcutCooldown.toFixed(1)}</span>\n )}\n {payload && (\n <SpriteFromAtlas\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={getItemTextureKeyPath(\n {\n key: payload.texturePath,\n texturePath: payload.texturePath,\n stackQty: payload.stackQty || 1,\n isStackable: payload.isStackable,\n },\n atlasJSON\n )}\n width={32}\n height={32}\n />\n )}\n <span className={buildClassName('qty', isOnShortcutCooldown)}>\n {totalQty}\n </span>\n <span\n className={buildClassName('keyboard', isOnShortcutCooldown)}\n >\n {i + 1}\n </span>\n </StyledShortcut>\n );\n }\n\n const payload =\n shortcuts && (shortcuts[i]?.payload as IRawSpell | undefined); //check if shortcuts exists before using the ? operator.\n\n const spellCooldown = !payload\n ? 0\n : spellCooldowns?.[payload.magicWords.replaceAll(' ', '_')] ??\n shortcutCooldown;\n const cooldown =\n spellCooldown > shortcutCooldown ? spellCooldown : shortcutCooldown;\n const isOnCooldown = cooldown > 0 && !!payload;\n\n const IMAGE_SCALE = 1.5;\n const IMAGE_SIZE = 32;\n\n return (\n <StyledShortcut\n key={i}\n onPointerDown={handleShortcutCast.bind(null, i)}\n disabled={mana < (payload?.manaCost ?? 0)}\n ref={el => {\n if (el) shortcutsRefs.current[i] = el;\n }}\n >\n {isOnCooldown && (\n <span className=\"cooldown\">\n {cooldown.toFixed(cooldown < 10 ? 1 : 0)}\n </span>\n )}\n <span>\n {payload?.atlasIMG && (\n <SpriteFromAtlas\n atlasIMG={payload.atlasIMG}\n atlasJSON={payload.atlasJSON}\n spriteKey={payload.texturePath ?? ''}\n width={IMAGE_SIZE}\n height={IMAGE_SIZE}\n imgScale={IMAGE_SCALE}\n centered\n borderRadius=\"50%\"\n />\n )}\n </span>\n <span className={buildClassName('mana', isOnCooldown)}>\n {payload && payload.manaCost}\n </span>\n <span className={buildClassName('keyboard', isOnCooldown)}>\n {i + 1}\n </span>\n </StyledShortcut>\n );\n })}\n </List>\n );\n};\n\nconst StyledShortcut = styled(SingleShortcut)`\n transition: all 0.15s;\n\n &.active {\n background-color: ${uiColors.gray};\n border-color: ${uiColors.yellow};\n }\n`;\n\nconst List = styled.p`\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 0.5rem;\n box-sizing: border-box;\n margin: 0 !important;\n\n scale: 0.9;\n`;\n","import React from 'react';\nimport styled from 'styled-components';\n\nexport interface ISimpleProgressBarProps {\n value: number;\n bgColor?: string;\n margin?: number;\n}\n\nexport const SimpleProgressBar: React.FC<ISimpleProgressBarProps> = ({\n value,\n bgColor = 'red',\n margin = 20,\n}) => {\n // Ensure the width is at least 1% if value is greater than 0\n const width = value > 0 ? Math.max(1, Math.min(100, value)) : 0;\n\n return (\n <Container className=\"simple-progress-bar\">\n <ProgressBarContainer margin={margin}>\n <BackgroundBar>\n <Progress width={width} bgColor={bgColor} />\n </BackgroundBar>\n </ProgressBarContainer>\n </Container>\n );\n};\n\nconst Container = styled.div`\n display: flex;\n justify-content: center;\n align-items: center;\n width: 100%;\n`;\n\nconst BackgroundBar = styled.span`\n background-color: rgba(0, 0, 0, 0.075);\n`;\n\ninterface IProgressProps {\n width: number;\n bgColor: string;\n}\n\nconst Progress = styled.span<IProgressProps>`\n background-color: ${props => props.bgColor};\n width: ${props => props.width.toFixed(2)}%;\n transition: width 0.5s ease-in-out;\n`;\n\ninterface IProgressBarContainerProps {\n margin: number;\n}\n\nconst ProgressBarContainer = styled.div<IProgressBarContainerProps>`\n border-radius: 60px;\n border: 1px solid #282424;\n overflow: hidden;\n width: 100%;\n span {\n display: block;\n height: 100%;\n }\n height: 8px;\n margin-left: ${props => props.margin}px;\n`;\n","import styled from 'styled-components';\n\nexport const Tooltip = styled.div`\n visibility: hidden;\n position: absolute;\n background-color: black;\n color: white;\n text-align: center;\n border-radius: 4px;\n padding: 5px;\n z-index: 1;\n font-size: 0.5rem;\n white-space: nowrap;\n\n /* Positioning */\n top: -20px; /* Adjust based on where you want the tooltip to appear */\n left: 50%;\n transform: translateX(-50%);\n`;\n","import { getSPForLevel } from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../constants/uiColors';\nimport { ErrorBoundary } from './Item/Inventory/ErrorBoundary';\nimport { SpriteFromAtlas } from './shared/SpriteFromAtlas';\nimport { SimpleProgressBar } from './SimpleProgressBar';\nimport { Tooltip } from './Tooltip/Tooltip';\n\nexport interface ISkillProgressBarProps {\n skillName: string;\n bgColor: string;\n level: number;\n skillPoints: number;\n texturePath: string;\n showSkillPoints?: boolean;\n skillPointsToNextLevel: number;\n atlasJSON: any;\n atlasIMG: any;\n buffAndDebuff?: number;\n}\n\nexport const SkillProgressBar: React.FC<ISkillProgressBarProps> = ({\n bgColor,\n skillName,\n level,\n skillPoints: currentSkillPoints,\n skillPointsToNextLevel,\n texturePath,\n showSkillPoints = true,\n atlasIMG,\n atlasJSON,\n\n buffAndDebuff,\n}) => {\n // Skill points needed to start the current level\n const baseSkillPoints = getSPForLevel(level);\n const calculateProgress = (): number => {\n const totalPointsForLevelUp = Math.max(\n 1,\n skillPointsToNextLevel - baseSkillPoints\n );\n const excessSkillPoints = Math.max(0, currentSkillPoints - baseSkillPoints);\n\n return Math.min(\n 100,\n Math.max(0, (excessSkillPoints / totalPointsForLevelUp) * 100)\n );\n };\n\n const progress = calculateProgress();\n\n const formatBuffAndDebuff = (value?: number): string =>\n value !== undefined ? value.toFixed(2) : '0';\n\n const skillsBuffsCalc = (level: number, buffAndDebuff: number): string => {\n if (buffAndDebuff === 0) return '0';\n const result = level * (buffAndDebuff / 100);\n return result > 0 ? `+${result.toFixed(2)}` : `${result.toFixed(2)}`;\n };\n\n return (\n <>\n <ProgressTitle>\n {buffAndDebuff !== undefined && (\n <>\n {buffAndDebuff > 0 ? (\n <BuffAndDebuffContainer>\n <TitleNameContainer>\n <TitleNameBuff>{skillName}</TitleNameBuff>\n <TitleNameBuff>\n lv {level} ({skillsBuffsCalc(level, buffAndDebuff)})\n </TitleNameBuff>\n </TitleNameContainer>\n <TitleNameBuffContainer>\n <TitleNameBuff>\n (+{formatBuffAndDebuff(buffAndDebuff)}%)\n </TitleNameBuff>\n </TitleNameBuffContainer>\n </BuffAndDebuffContainer>\n ) : buffAndDebuff < 0 ? (\n <>\n <TitleNameContainer>\n <TitleNameDebuff>{skillName}</TitleNameDebuff>\n <TitleNameDebuff>\n lv {level} ({skillsBuffsCalc(level, buffAndDebuff)})\n </TitleNameDebuff>\n </TitleNameContainer>\n <div>\n <TitleNameDebuff>\n ({formatBuffAndDebuff(buffAndDebuff)}%)\n </TitleNameDebuff>\n </div>\n </>\n ) : (\n <TitleName>{skillName}</TitleName>\n )}\n </>\n )}\n {!buffAndDebuff && (\n <TitleNameContainer>\n <TitleName>{skillName}</TitleName>\n <ValueDisplay>lv {level}</ValueDisplay>\n </TitleNameContainer>\n )}\n </ProgressTitle>\n\n <ProgressBody>\n <ProgressIconContainer>\n {atlasIMG && atlasJSON ? (\n <SpriteContainer>\n <ErrorBoundary>\n <SpriteFromAtlas\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={texturePath}\n imgScale={1}\n grayScale\n opacity={0.5}\n />\n </ErrorBoundary>\n </SpriteContainer>\n ) : (\n <></>\n )}\n </ProgressIconContainer>\n\n <ProgressBarWrapper>\n <SimpleProgressBar value={progress} bgColor={bgColor} />\n <Tooltip>SP: {currentSkillPoints}</Tooltip>\n </ProgressBarWrapper>\n </ProgressBody>\n {showSkillPoints && (\n <SkillDisplayContainer>\n <SkillPointsDisplay>{progress.toFixed(2)}%</SkillPointsDisplay>\n </SkillDisplayContainer>\n )}\n </>\n );\n};\n\nconst ProgressBarWrapper = styled.div`\n position: relative;\n\n &:hover ${Tooltip}, &:active ${Tooltip} {\n visibility: visible;\n }\n width: 100%;\n height: auto;\n top: 8px;\n`;\n\nconst SpriteContainer = styled.div`\n position: relative;\n top: -3px;\n left: 0;\n`;\n\nconst SkillDisplayContainer = styled.div`\n margin: 0 auto;\n\n p {\n margin: 0;\n }\n`;\n\nconst SkillPointsDisplay = styled.p`\n font-size: 0.55rem !important;\n font-weight: bold;\n text-align: center;\n`;\n\nconst TitleName = styled.span`\n margin-left: 5px;\n`;\n\nconst TitleNameBuff = styled.span`\n margin-left: 5px;\n color: ${uiColors.lightGreen} !important;\n`;\n\nconst TitleNameDebuff = styled.span`\n margin-left: 5px;\n color: ${uiColors.red} !important;\n`;\n\nconst ValueDisplay = styled.span``;\n\nconst ProgressIconContainer = styled.div`\n display: flex;\n justify-content: center;\n align-items: center;\n`;\n\nconst ProgressBody = styled.div`\n display: flex;\n flex-direction: row;\n width: 100%;\n`;\n\nconst ProgressTitle = styled.div`\n width: 100%;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n span {\n font-size: 0.6rem;\n }\n`;\n\nconst BuffAndDebuffContainer = styled.div``;\n\nconst TitleNameBuffContainer = styled.div``;\n\nconst TitleNameContainer = styled.div`\n display: flex;\n justify-content: space-between;\n`;\n","import {\n ISkill,\n ISkillDetails,\n getSPForLevel,\n getXPForLevel,\n} from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../constants/uiColors';\nimport { DraggableContainer } from './DraggableContainer';\nimport { SkillProgressBar } from './SkillProgressBar';\n\nexport interface ISkillContainerProps {\n skill: ISkill;\n onCloseButton: () => void;\n atlasJSON: any;\n atlasIMG: any;\n scale?: number;\n}\n\nconst skillProps = {\n attributes: {\n color: uiColors.purple,\n values: {\n stamina: 'staffs/doom-staff.png',\n magic: 'helmets/yellow-enchanter-hat.png',\n magicResistance: 'gems/amethyst-gem.png',\n strength: 'crafting-resources/dragon-tooth.png',\n resistance: 'books/magic-orb.png',\n dexterity: 'boots/gaias-soleplate.png',\n },\n },\n combat: {\n color: uiColors.cardinal,\n values: {\n first: 'gloves/leather-gloves.png',\n club: 'maces/club.png',\n sword: 'swords/double-edged-sword.png',\n axe: 'axes/double-axe.png',\n distance: 'ranged-weapons/horse-bow.png',\n shielding: 'shields/studded-shield.png',\n dagger: 'daggers/dagger.png',\n },\n },\n crafting: {\n color: uiColors.blue,\n values: {\n fishing: 'foods/fish.png',\n farming: 'tools/watering-can.png',\n mining: 'crafting-resources/iron-ingot.png',\n lumberjacking: 'crafting-resources/greater-wooden-log.png',\n blacksmithing: 'hammers/hammer.png',\n cooking: 'foods/chickens-meat.png',\n alchemy: 'potions/greater-mana-potion.png',\n },\n },\n};\n\ninterface SkillMap {\n [key: string]: string;\n}\n\nconst skillNameMap: SkillMap = {\n stamina: 'Stamina',\n magic: 'Magic',\n magicResistance: 'Magic Resistance',\n strength: 'Strength',\n resistance: 'Resistance',\n dexterity: 'Dexterity',\n first: 'Fist',\n club: 'Club',\n sword: 'Sword',\n axe: 'Axe',\n distance: 'Distance',\n shielding: 'Shielding',\n dagger: 'Dagger',\n fishing: 'Fishing',\n farming: 'Farming',\n mining: 'Mining',\n lumberjacking: 'Lumberjacking',\n blacksmithing: 'Blacksmithing',\n cooking: 'Cooking',\n alchemy: 'Alchemy',\n};\n\nexport const SkillsContainer: React.FC<ISkillContainerProps> = ({\n onCloseButton,\n skill,\n atlasIMG,\n atlasJSON,\n scale,\n}) => {\n const onRenderSkillCategory = (\n category: 'attributes' | 'combat' | 'crafting'\n ) => {\n const skillCategory = skillProps[category];\n\n const skillCategoryColor = skillCategory.color;\n\n const output = [];\n\n for (const [key, value] of Object.entries(skillCategory.values)) {\n if (key === 'stamina') {\n continue;\n }\n //@ts-ignore\n const skillDetails = (skill[key] as unknown) as ISkillDetails;\n\n if (!skillDetails) {\n continue;\n }\n\n output.push(\n <SkillProgressBar\n key={key}\n skillName={skillNameMap[key]}\n bgColor={skillCategoryColor}\n level={skillDetails.level || 0}\n skillPoints={Math.round(skillDetails.skillPoints) || 0}\n skillPointsToNextLevel={\n Math.round(getSPForLevel(skillDetails.level + 1)) || 0\n }\n texturePath={value}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n buffAndDebuff={skillDetails.buffAndDebuff}\n />\n );\n }\n\n return output;\n };\n\n return (\n <SkillsDraggableContainer\n title=\"Skills\"\n cancelDrag=\"#skillsDiv\"\n scale={scale}\n width=\"100%\"\n >\n {onCloseButton && (\n <CloseButton onPointerDown={onCloseButton}>X</CloseButton>\n )}\n <SkillsContainerDiv id=\"skillsDiv\">\n <SkillSplitDiv>\n <p>General</p>\n <hr className=\"golden\" />\n\n <SkillProgressBar\n skillName={'Level'}\n bgColor={uiColors.navyBlue}\n level={Math.round(skill.level) || 0}\n skillPoints={Math.round(skill.experience) || 0}\n skillPointsToNextLevel={\n Math.round(getXPForLevel(skill.level + 1)) || 0\n }\n texturePath={'swords/broad-sword.png'}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n />\n\n <p>Combat Skills</p>\n <hr className=\"golden\" />\n </SkillSplitDiv>\n\n {onRenderSkillCategory('combat')}\n\n <SkillSplitDiv>\n <p>Crafting Skills</p>\n <hr className=\"golden\" />\n </SkillSplitDiv>\n\n {onRenderSkillCategory('crafting')}\n\n <SkillSplitDiv>\n <p>Basic Attributes</p>\n <hr className=\"golden\" />\n </SkillSplitDiv>\n\n {onRenderSkillCategory('attributes')}\n </SkillsContainerDiv>\n </SkillsDraggableContainer>\n );\n};\n\nconst SkillsDraggableContainer = styled(DraggableContainer)`\n border: 1px solid black;\n\n max-width: 450px;\n\n height: 90%;\n .DraggableContainer__TitleContainer-sc-184mpyl-2 {\n width: auto;\n height: auto;\n }\n`;\n\nconst SkillsContainerDiv = styled.div`\n width: 100%;\n -webkit-overflow-y: scroll;\n overflow-y: scroll;\n height: 90%;\n padding-right: 10px;\n`;\n\nconst SkillSplitDiv = styled.div`\n width: 100%;\n font-size: 11px;\n hr {\n margin: 0;\n margin-bottom: 1rem;\n padding: 0px;\n }\n p {\n margin-bottom: 0px;\n }\n`;\n\nconst CloseButton = styled.div`\n position: absolute;\n top: 2px;\n right: 2px;\n color: white;\n z-index: 22;\n font-size: 1.1rem;\n`;\n","import { ISpell } from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../../constants/uiColors';\nimport { uiFonts } from '../../../constants/uiFonts';\nimport { formatSpellCastingType } from '../../../libs/CastingTypeHelper';\n\ninterface ISpellInfoProps {\n spell: ISpell;\n}\n\nexport const SpellInfo: React.FC<ISpellInfoProps> = ({ spell }) => {\n const {\n magicWords,\n name,\n manaCost,\n requiredItem,\n description,\n castingType,\n cooldown,\n maxDistanceGrid,\n } = spell;\n return (\n <Container>\n <Header>\n <div>\n <Title>{name}</Title>\n <Type>{magicWords}</Type>\n </div>\n </Header>\n <Statistic>\n <div className=\"label\">Casting Type:</div>\n <div className=\"value\">{formatSpellCastingType(castingType)}</div>\n </Statistic>\n <Statistic>\n <div className=\"label\">Magic words:</div>\n <div className=\"value\">{magicWords}</div>\n </Statistic>\n <Statistic>\n <div className=\"label\">Mana cost:</div>\n <div className=\"value\">{manaCost}</div>\n </Statistic>\n <Statistic>\n <div className=\"label\">Cooldown:</div>\n <div className=\"value\">{cooldown}</div>\n </Statistic>\n {maxDistanceGrid && (\n <Statistic>\n <div className=\"label\">Max Distance Grid:</div>\n <div className=\"value\">{maxDistanceGrid}</div>\n </Statistic>\n )}\n <Statistic>\n {requiredItem && (\n <>\n <div className=\"label\">Required Item:</div>\n <div className=\"value\">{requiredItem}</div>\n </>\n )}\n </Statistic>\n <Description>{description}</Description>\n </Container>\n );\n};\n\nconst Container = styled.div`\n color: white;\n background-color: #222;\n border-radius: 5px;\n padding: 0.5rem;\n font-size: ${uiFonts.size.small};\n border: 3px solid ${uiColors.lightGray};\n height: max-content;\n width: 30rem;\n\n @media (max-width: 580px) {\n width: 80vw;\n }\n`;\n\nconst Title = styled.div`\n font-size: ${uiFonts.size.medium};\n font-weight: bold;\n margin-bottom: 0.5rem;\n display: flex;\n align-items: center;\n margin: 0;\n`;\n\nconst Type = styled.div`\n font-size: ${uiFonts.size.small};\n margin-top: 0.2rem;\n color: ${uiColors.lightGray};\n`;\n\nconst Description = styled.div`\n margin-top: 1.5rem;\n font-size: ${uiFonts.size.small};\n color: ${uiColors.lightGray};\n font-style: italic;\n`;\n\nconst Header = styled.div`\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-bottom: 0.5rem;\n`;\n\nconst Statistic = styled.div`\n margin-bottom: 0.4rem;\n width: max-content;\n\n .label {\n display: inline-block;\n margin-right: 0.5rem;\n color: inherit;\n }\n\n .value {\n display: inline-block;\n color: inherit;\n }\n\n &.better,\n .better {\n color: ${uiColors.lightGreen};\n }\n\n &.worse,\n .worse {\n color: ${uiColors.cardinal};\n }\n`;\n","export const formatSpellCastingType = (castingType: string): string => {\n const formattedCastingType = castingType\n .split(\"-\")\n .map(word => word.charAt(0).toUpperCase() + word.slice(1))\n .join(\" \");\n \n return formattedCastingType;\n };","import { ISpell } from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { SpellInfo } from './SpellInfo';\n\nexport interface ISpellInfoDisplayProps {\n spell: ISpell;\n isMobile?: boolean;\n}\n\nexport const SpellInfoDisplay: React.FC<ISpellInfoDisplayProps> = ({\n spell,\n isMobile,\n}) => {\n return (\n <Flex $isMobile={isMobile}>\n <SpellInfo spell={spell} />\n </Flex>\n );\n};\n\nconst Flex = styled.div<{ $isMobile?: boolean }>`\n display: flex;\n gap: 0.5rem;\n flex-direction: ${({ $isMobile }) => ($isMobile ? 'row-reverse' : 'row')};\n\n @media (max-width: 580px) {\n flex-direction: column-reverse;\n align-items: center;\n }\n`;\n","import { ISpell } from '@rpg-engine/shared';\nimport React, { useRef } from 'react';\nimport styled from 'styled-components';\nimport ModalPortal from '../../Abstractions/ModalPortal';\nimport { SpellInfoDisplay } from './SpellInfoDisplay';\n\ninterface IListMenuOption {\n id: string;\n text: string;\n}\n\nexport interface MobileSpellTooltipProps {\n spell: ISpell;\n closeTooltip: () => void;\n scale?: number;\n options?: IListMenuOption[];\n onSelected?: (selectedOptionId: string) => void;\n}\n\nexport const MobileSpellTooltip: React.FC<MobileSpellTooltipProps> = ({\n spell,\n closeTooltip,\n scale = 1,\n options,\n onSelected,\n}) => {\n const ref = useRef<HTMLDivElement>(null);\n\n const handleFadeOut = () => {\n ref.current?.classList.add('fadeOut');\n };\n\n return (\n <ModalPortal>\n <Container\n ref={ref}\n onTouchEnd={() => {\n handleFadeOut();\n setTimeout(() => {\n closeTooltip();\n }, 100);\n }}\n scale={scale}\n >\n <SpellInfoDisplay spell={spell} isMobile />\n <OptionsContainer>\n {options?.map(option => (\n <Option\n key={option.id}\n onTouchEnd={() => {\n handleFadeOut();\n setTimeout(() => {\n onSelected?.(option.id);\n closeTooltip();\n }, 100);\n }}\n >\n {option.text}\n </Option>\n ))}\n </OptionsContainer>\n </Container>\n </ModalPortal>\n );\n};\n\nconst Container = styled.div<{ scale: number }>`\n position: absolute;\n z-index: 100;\n left: 0;\n top: 0;\n width: 100vw;\n height: 100vh;\n background-color: rgba(0 0 0 / 0.5);\n display: flex;\n justify-content: center;\n align-items: center;\n gap: 0.5rem;\n transition: opacity 0.08s;\n animation: fadeIn 0.1s forwards;\n\n @keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 0.92;\n }\n }\n\n @keyframes fadeOut {\n 0% {\n opacity: 0.92;\n }\n 100% {\n opacity: 0;\n }\n }\n\n &.fadeOut {\n animation: fadeOut 0.1s forwards;\n }\n\n @media (max-width: 580px) {\n flex-direction: column;\n }\n`;\n\nconst OptionsContainer = styled.div`\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n flex-wrap: wrap;\n\n @media (max-width: 580px) {\n flex-direction: row;\n justify-content: center;\n }\n`;\n\nconst Option = styled.button`\n padding: 1rem;\n background-color: #333;\n color: white;\n border: none;\n border-radius: 3px;\n width: 8rem;\n transition: background-color 0.1s;\n\n &:hover {\n background-color: #555;\n }\n\n @media (max-width: 580px) {\n padding: 1rem 0.5rem;\n }\n`;\n","import { ISpell } from '@rpg-engine/shared';\nimport React, { useEffect, useRef } from 'react';\nimport styled from 'styled-components';\nimport ModalPortal from '../../Abstractions/ModalPortal';\nimport { SpellInfoDisplay } from './SpellInfoDisplay';\n\nexport interface IMagicTooltipProps {\n spell: ISpell;\n}\n\nconst offset = 20;\n\nexport const MagicTooltip: React.FC<IMagicTooltipProps> = ({ spell }) => {\n const ref = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const { current } = ref;\n\n if (current) {\n const handleMouseMove = (event: MouseEvent) => {\n const { clientX, clientY } = event;\n\n // Adjust the position of the tooltip based on the mouse position\n const rect = current.getBoundingClientRect();\n\n const tooltipWidth = rect.width;\n const tooltipHeight = rect.height;\n const isOffScreenRight =\n clientX + tooltipWidth + offset > window.innerWidth;\n const isOffScreenBottom =\n clientY + tooltipHeight + offset > window.innerHeight;\n const x = isOffScreenRight\n ? clientX - tooltipWidth - offset\n : clientX + offset;\n const y = isOffScreenBottom\n ? clientY - tooltipHeight - offset\n : clientY + offset;\n\n current.style.transform = `translate(${x}px, ${y}px)`;\n current.style.opacity = '1';\n };\n\n window.addEventListener('mousemove', handleMouseMove);\n\n return () => {\n window.removeEventListener('mousemove', handleMouseMove);\n };\n }\n\n return;\n }, []);\n\n return (\n <ModalPortal>\n <Container ref={ref}>\n <SpellInfoDisplay spell={spell} />\n </Container>\n </ModalPortal>\n );\n};\n\nconst Container = styled.div`\n position: absolute;\n z-index: 100;\n pointer-events: none;\n left: 0;\n top: 0;\n opacity: 0;\n transition: opacity 0.08s;\n`;\n","import { ISpell } from '@rpg-engine/shared';\nimport React, { useRef, useState } from 'react';\nimport { MobileSpellTooltip } from './MobileSpellTooltip';\nimport { MagicTooltip } from './SpellTooltip';\n\ninterface ISpellInfoWrapperProps {\n spell: ISpell;\n children: React.ReactNode;\n scale?: number;\n holdTouchDuration?: number; // New prop for hold touch duration\n}\n\nexport const SpellInfoWrapper: React.FC<ISpellInfoWrapperProps> = ({\n children,\n spell,\n scale,\n holdTouchDuration = 500, // Default hold duration to 500ms\n}) => {\n const [isTooltipVisible, setIsTooltipVisible] = useState(false);\n const [isTooltipMobileVisible, setIsTooltipMobileVisible] = useState(false);\n const touchTimeoutRef = useRef<NodeJS.Timeout | null>(null);\n\n const handleTouchStart = () => {\n touchTimeoutRef.current = setTimeout(() => {\n setIsTooltipMobileVisible(true);\n setIsTooltipVisible(false);\n }, holdTouchDuration);\n };\n\n const handleTouchEnd = () => {\n if (touchTimeoutRef.current) {\n clearTimeout(touchTimeoutRef.current);\n touchTimeoutRef.current = null;\n }\n };\n\n return (\n <div\n onMouseEnter={() => {\n if (!isTooltipMobileVisible) setIsTooltipVisible(true);\n }}\n onMouseLeave={setIsTooltipVisible.bind(null, false)}\n onTouchStart={handleTouchStart}\n onTouchEnd={handleTouchEnd}\n >\n {children}\n\n {isTooltipVisible && !isTooltipMobileVisible && (\n <MagicTooltip spell={spell} />\n )}\n {isTooltipMobileVisible && (\n <MobileSpellTooltip\n closeTooltip={() => {\n setIsTooltipMobileVisible(false);\n console.log('close');\n }}\n spell={spell}\n scale={scale}\n />\n )}\n </div>\n );\n};","import { ISpell } from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\nimport { uiFonts } from '../../constants/uiFonts';\nimport { SpriteFromAtlas } from '../shared/SpriteFromAtlas';\nimport { SpellInfoWrapper } from './cards/SpellInfoWrapper';\n\nexport interface ISpellProps {\n atlasJSON: any;\n atlasIMG: any;\n charMana: number;\n charMagicLevel: number;\n onPointerUp?: (spellKey: string) => void;\n isSettingShortcut?: boolean;\n spellKey: string;\n spell: ISpell;\n activeCooldown?: number;\n}\n\nexport const Spell: React.FC<ISpellProps> = ({\n atlasIMG,\n atlasJSON,\n spellKey,\n charMana,\n charMagicLevel,\n onPointerUp,\n isSettingShortcut,\n spell,\n activeCooldown,\n}) => {\n const {\n manaCost,\n minMagicLevelRequired,\n magicWords,\n name,\n description,\n } = spell;\n const disabled = isSettingShortcut\n ? charMagicLevel < minMagicLevelRequired\n : manaCost > charMana || charMagicLevel < minMagicLevelRequired;\n\n const CONTAINER_STYLE = { width: '32px', height: '32px' };\n const IMAGE_SCALE = 2;\n\n return (\n <SpellInfoWrapper spell={spell}>\n <Container\n onPointerUp={onPointerUp?.bind(null, spellKey)}\n isSettingShortcut={isSettingShortcut && !disabled}\n className=\"spell\"\n >\n {disabled && (\n <Overlay>\n {charMagicLevel < minMagicLevelRequired\n ? 'Low magic level'\n : manaCost > charMana && 'No mana'}\n </Overlay>\n )}\n <SpellImage>\n {activeCooldown && activeCooldown > 0 ? (\n <span className=\"cooldown\">\n {activeCooldown.toFixed(activeCooldown > 10 ? 0 : 1)}\n </span>\n ) : null}\n <SpriteFromAtlas\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={spell.texturePath ?? ''}\n imgScale={IMAGE_SCALE}\n containerStyle={CONTAINER_STYLE}\n centered\n />\n </SpellImage>\n <Info>\n <Title>\n <span>{name}</span>\n <span className=\"spell\">({magicWords})</span>\n </Title>\n <Description>{description}</Description>\n </Info>\n\n <Divider />\n <Cost>\n <span>Mana cost:</span>\n <span className=\"mana\">{manaCost}</span>\n </Cost>\n </Container>\n </SpellInfoWrapper>\n );\n};\n\nconst Container = styled.button<{ isSettingShortcut?: boolean }>`\n display: block;\n background: none;\n border: 2px solid transparent;\n border-radius: 1rem;\n width: 100%;\n display: flex;\n\n gap: 1rem;\n align-items: center;\n padding: 0 1rem;\n text-align: left;\n position: relative;\n\n animation: ${({ isSettingShortcut }) =>\n isSettingShortcut ? 'border-color-change 1s infinite' : 'none'};\n\n @keyframes border-color-change {\n 0% {\n border-color: ${uiColors.yellow};\n }\n 50% {\n border-color: transparent;\n }\n 100% {\n border-color: ${uiColors.yellow};\n }\n }\n\n &:hover,\n &:focus {\n background-color: ${uiColors.darkGray};\n }\n\n &:active {\n background: none;\n }\n`;\n\nconst SpellImage = styled.div`\n width: 4rem;\n height: 4rem;\n font-size: ${uiFonts.size.xLarge};\n font-weight: bold;\n background-color: ${uiColors.darkGray};\n color: ${uiColors.lightGray};\n display: flex;\n justify-content: center;\n align-items: center;\n text-transform: uppercase;\n position: relative;\n overflow: hidden;\n\n .cooldown {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0 0 0 / 20%);\n color: ${uiColors.darkYellow};\n font-weight: bold;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n`;\n\nconst Info = styled.span`\n width: 0;\n flex: 1;\n\n @media (orientation: portrait) {\n display: none;\n }\n`;\nconst Title = styled.p`\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n margin-bottom: 5px;\n margin: 0;\n\n span {\n font-size: ${uiFonts.size.medium} !important;\n font-weight: bold !important;\n color: ${uiColors.yellow} !important;\n margin-right: 0.5rem;\n }\n\n .spell {\n font-size: ${uiFonts.size.small} !important;\n font-weight: normal !important;\n color: ${uiColors.lightGray} !important;\n }\n`;\n\nconst Description = styled.div`\n font-size: ${uiFonts.size.small} !important;\n line-height: 1.1 !important;\n`;\n\nconst Divider = styled.div`\n width: 1px;\n height: 100%;\n margin: 0 1rem;\n background-color: ${uiColors.lightGray};\n`;\n\nconst Cost = styled.p`\n display: flex;\n align-items: center;\n flex-direction: column;\n gap: 0.5rem;\n\n div {\n z-index: 1;\n }\n\n .mana {\n position: relative;\n font-size: ${uiFonts.size.medium};\n font-weight: bold;\n z-index: 1;\n\n &::after {\n position: absolute;\n content: '';\n top: 0;\n left: 0;\n background-color: ${uiColors.blue};\n width: 100%;\n height: 100%;\n border-radius: 50%;\n transform: scale(1.8);\n filter: blur(10px);\n z-index: -1;\n }\n }\n`;\n\nconst Overlay = styled.p`\n margin: 0 !important;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n border-radius: 1rem;\n display: flex;\n justify-content: center;\n align-items: center;\n color: ${uiColors.yellow};\n font-size: ${uiFonts.size.large} !important;\n font-weight: bold;\n z-index: 10;\n background-color: rgba(0 0 0 / 0.2);\n`;\n","import { IShortcut, ISpell } from '@rpg-engine/shared';\nimport React, { Fragment, useMemo, useState } from 'react';\nimport styled from 'styled-components';\nimport { uiFonts } from '../../constants/uiFonts';\nimport { DraggableContainer } from '../DraggableContainer';\nimport { Input } from '../Input';\nimport { RPGUIContainerTypes } from '../RPGUI/RPGUIContainer';\nimport { ShortcutsSetter } from '../Shortcuts/ShortcutsSetter';\nimport { Spell } from './Spell';\n\nexport interface ISpellbookProps {\n onClose?: () => void;\n onInputFocus?: () => void;\n onInputBlur?: () => void;\n spells: ISpell[];\n magicLevel: number;\n mana: number;\n onSpellClick: (spellKey: string) => void;\n setSpellShortcut: (key: string, index: number) => void;\n shortcuts: IShortcut[];\n removeShortcut: (index: number) => void;\n atlasIMG: any;\n atlasJSON: any;\n iconAtlasIMG?: any;\n iconAtlasJSON?: any;\n scale?: number;\n spellCooldowns?: Record<string, number>;\n}\n\nexport const Spellbook: React.FC<ISpellbookProps> = ({\n onClose,\n onInputFocus,\n onInputBlur,\n spells,\n magicLevel,\n mana,\n onSpellClick,\n setSpellShortcut,\n shortcuts,\n removeShortcut,\n atlasIMG,\n atlasJSON,\n iconAtlasIMG,\n iconAtlasJSON,\n scale,\n spellCooldowns,\n}) => {\n const [search, setSearch] = useState('');\n const [settingShortcutIndex, setSettingShortcutIndex] = useState(-1);\n\n const spellsToDisplay = useMemo(() => {\n return spells\n .sort((a, b) => {\n if (a.minMagicLevelRequired > b.minMagicLevelRequired) return 1;\n if (a.minMagicLevelRequired < b.minMagicLevelRequired) return -1;\n return 0;\n })\n .filter(\n spell =>\n spell.name.toLocaleLowerCase().includes(search.toLocaleLowerCase()) ||\n spell.magicWords\n .toLocaleLowerCase()\n .includes(search.toLocaleLowerCase())\n );\n }, [search, spells]);\n\n const setShortcut = (spellKey: string) => {\n setSpellShortcut?.(spellKey, settingShortcutIndex);\n setSettingShortcutIndex(-1);\n };\n\n return (\n <DraggableContainer\n type={RPGUIContainerTypes.Framed}\n onCloseButton={onClose}\n width=\"inherit\"\n height=\"inherit\"\n cancelDrag=\"#spellbook-search, #shortcuts_list, .spell\"\n scale={scale}\n >\n <Container>\n <Title>Learned Spells</Title>\n\n <ShortcutsSetter\n setSettingShortcutIndex={setSettingShortcutIndex}\n settingShortcutIndex={settingShortcutIndex}\n shortcuts={shortcuts}\n removeShortcut={removeShortcut}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n />\n\n <Input\n placeholder=\"Search for spell\"\n value={search}\n onChange={e => setSearch(e.target.value)}\n onFocus={onInputFocus}\n onBlur={onInputBlur}\n id=\"spellbook-search\"\n />\n\n <SpellList>\n {spellsToDisplay.map(spell => (\n <Fragment key={spell.key}>\n <Spell\n atlasIMG={iconAtlasIMG}\n atlasJSON={iconAtlasJSON}\n charMana={mana}\n charMagicLevel={magicLevel}\n onPointerUp={\n settingShortcutIndex !== -1 ? setShortcut : onSpellClick\n }\n spellKey={spell.key}\n isSettingShortcut={settingShortcutIndex !== -1}\n spell={spell}\n activeCooldown={\n spellCooldowns?.[spell.magicWords.replaceAll(' ', '_')]\n }\n {...spell}\n />\n </Fragment>\n ))}\n </SpellList>\n </Container>\n </DraggableContainer>\n );\n};\n\nconst Title = styled.h1`\n font-size: ${uiFonts.size.large} !important;\n margin-bottom: 0 !important;\n`;\n\nconst Container = styled.div`\n width: 100%;\n height: 100%;\n color: white;\n display: flex;\n flex-direction: column;\n`;\n\nconst SpellList = styled.div`\n width: 100%;\n min-height: 0;\n flex: 1;\n overflow-y: auto;\n display: flex;\n flex-direction: column;\n gap: 1.5rem;\n margin-top: 1rem;\n`;\n","import React, { useState } from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../constants/uiColors';\nimport SelectArrow from './Arrow/SelectArrow';\nimport { Button, ButtonTypes } from './Button';\n\ninterface IStep {\n component: React.ReactNode;\n id: number;\n validate?: () => boolean | Promise<boolean>;\n errorMessage?: string;\n}\n\ninterface IStepperProps {\n steps: IStep[];\n finalCTAButton?: {\n label: string;\n onClick: (() => void) | (() => Promise<void>) | ((e: any) => Promise<void>);\n };\n onError?: (message: string) => void;\n useSideArrows?: boolean; // New prop to control arrow position\n styles?: {\n stepperProgressColor?: string;\n };\n}\n\nexport const Stepper: React.FC<IStepperProps> = ({\n steps,\n finalCTAButton,\n onError,\n useSideArrows = false, // Default to false for backwards compatibility\n styles,\n}) => {\n const [currentStep, setCurrentStep] = useState(0);\n\n const currentComponent = steps[currentStep]?.component;\n\n const totalSteps = steps.length;\n\n const onStepChange = async (step: number) => {\n if (steps[currentStep]?.validate) {\n try {\n const isValid = await steps[currentStep].validate!();\n if (!isValid) {\n if (onError) {\n onError(\n steps[currentStep].errorMessage ||\n `Validation failed on step ${currentStep + 1}`\n );\n }\n return;\n }\n } catch (error) {\n if (onError) {\n onError(\n `An error occurred during validation on step ${currentStep + 1}`\n );\n }\n return;\n }\n }\n setCurrentStep(step);\n };\n\n const renderArrows = () => {\n const leftArrow = (\n <SelectArrow\n direction=\"left\"\n onPointerDown={() => onStepChange(Math.max(0, currentStep - 1))}\n />\n );\n\n const rightArrow = (\n <SelectArrow\n direction=\"right\"\n onPointerDown={() =>\n onStepChange(Math.min(totalSteps - 1, currentStep + 1))\n }\n />\n );\n\n if (useSideArrows) {\n return (\n <>\n {currentStep > 0 && <ArrowContainer left>{leftArrow}</ArrowContainer>}\n {currentStep < totalSteps - 1 && (\n <ArrowContainer right>{rightArrow}</ArrowContainer>\n )}\n </>\n );\n } else {\n return (\n <>\n {currentStep > 0 && leftArrow}\n {currentStep < totalSteps - 1 && rightArrow}\n </>\n );\n }\n };\n\n return (\n <StepperContainer className=\"stepper-container\">\n <StepperTop>\n {Array.from({ length: totalSteps }, (_, i) => (\n <ProgressIndicator\n key={i}\n isActive={i <= currentStep}\n stepperProgressColor={styles?.stepperProgressColor}\n onClick={() => onStepChange(i)}\n />\n ))}\n </StepperTop>\n\n <StepperBodyContainer>\n {useSideArrows && renderArrows()}\n <StepperBody>{currentComponent}</StepperBody>\n </StepperBodyContainer>\n\n {(!useSideArrows ||\n (currentStep === totalSteps - 1 && finalCTAButton)) && (\n <StepperFooter>\n {!useSideArrows && renderArrows()}\n {currentStep === totalSteps - 1 && finalCTAButton && (\n <Button\n buttonType={ButtonTypes.RPGUIButton}\n onClick={finalCTAButton.onClick}\n >\n {finalCTAButton.label}\n </Button>\n )}\n </StepperFooter>\n )}\n </StepperContainer>\n );\n};\n\nconst StepperContainer = styled.div`\n display: flex;\n flex-direction: column;\n height: 100%;\n`;\n\nconst StepperTop = styled.div`\n flex: 1;\n display: flex;\n flex-wrap: wrap;\n justify-content: center;\n align-items: center;\n margin-bottom: 1rem;\n`;\n\nconst StepperBodyContainer = styled.div`\n flex: 8;\n display: flex;\n align-items: center;\n position: relative;\n height: 100%; /* Ensure full height */\n`;\n\nconst StepperBody = styled.div`\n flex: 1;\n min-height: 200px; /* Set an appropriate minimum height */\n transition: height 0.3s ease-in-out; /* Smooth height transition */\n`;\n\nconst ArrowContainer = styled.div<{ left?: boolean; right?: boolean }>`\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n ${props => props.left && 'left: -30px;'}\n ${props => props.right && 'right: -30px;'}\n`;\n\nconst StepperFooter = styled.div`\n margin-top: 1rem;\n flex: 1;\n display: flex;\n justify-content: center;\n align-items: center;\n`;\n\nconst ProgressIndicator = styled.div<{\n isActive: boolean;\n stepperProgressColor?: string;\n}>`\n width: 20px;\n height: 20px;\n background-color: ${({ isActive, stepperProgressColor }) =>\n isActive ? stepperProgressColor || uiColors.orange : uiColors.lightGray};\n margin: 0 5px;\n transition: background-color 0.3s;\n opacity: ${({ isActive }) => (isActive ? 1 : 0.25)};\n border: 1px solid ${uiColors.raisinBlack};\n cursor: pointer;\n clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);\n /* Create a diamond shape */\n box-shadow: ${({ isActive }) =>\n isActive\n ? '0 0 0 1px black, 1px 1px 0 1px black, 2px 2px 0 1px black, -1px -1px 0 1px black'\n : '0 0 0 1px black, 1px 1px 0 1px gray, 2px 2px 0 1px gray, -1px -1px 0 1px gray'};\n /* Add pixel art border effect */\n border-radius: 0;\n /* Remove border-radius to make it square */\n`;\n","import React from 'react';\nimport styled from 'styled-components';\n\nimport { PeriodOfDay } from '@rpg-engine/shared';\nimport AfternoonGif from './gif/afternoon.gif';\nimport MorningGif from './gif/morning.gif';\nimport NightGif from './gif/night.gif';\n\nexport interface IPeriodOfDayDisplayProps {\n periodOfDay: PeriodOfDay;\n}\n\nexport const DayNightPeriod: React.FC<IPeriodOfDayDisplayProps> = ({\n periodOfDay,\n}) => {\n const periodOfDaySrcFiles = {\n [PeriodOfDay.Morning]: MorningGif,\n [PeriodOfDay.Afternoon]: AfternoonGif,\n [PeriodOfDay.Night]: NightGif,\n };\n\n return (\n <GifContainer>\n <img src={periodOfDaySrcFiles[periodOfDay]} />\n </GifContainer>\n );\n};\n\nconst GifContainer = styled.div`\n width: 100%;\n\n img {\n width: 67%;\n }\n`;\n","import { PeriodOfDay } from '@rpg-engine/shared';\nimport React from 'react';\nimport Draggable from 'react-draggable';\nimport styled from 'styled-components';\nimport { uiFonts } from '../../constants/uiFonts';\nimport { DayNightPeriod } from './DayNightPeriod/DayNightPeriod';\n\nimport ClockWidgetImg from './img/clockwidget.png';\n\nexport interface IClockWidgetProps {\n onClose?: () => void;\n TimeClock: string;\n periodOfDay: PeriodOfDay;\n scale?: number;\n}\n\nexport const TimeWidget: React.FC<IClockWidgetProps> = ({\n onClose,\n TimeClock,\n periodOfDay,\n scale,\n}) => {\n return (\n <Draggable\n scale={scale}\n cancel=\".time-widget-close,.time-widget-container,.time-widget-container *\"\n >\n <WidgetContainer>\n <CloseButton onPointerDown={onClose} className=\"time-widget-close\">\n X\n </CloseButton>\n <DayNightContainer className=\"time-widget-container\">\n <DayNightPeriod periodOfDay={periodOfDay} />\n </DayNightContainer>\n <Time>{TimeClock}</Time>\n </WidgetContainer>\n </Draggable>\n );\n};\n\nconst WidgetContainer = styled.div`\n background-image: url(${ClockWidgetImg});\n background-size: 10rem;\n background-repeat: no-repeat;\n width: 10rem;\n position: absolute;\n height: 100px;\n`;\n\nconst Time = styled.div`\n top: 0.75rem;\n right: 0.5rem;\n position: absolute;\n font-size: ${uiFonts.size.small};\n color: white;\n`;\n\nconst CloseButton = styled.p`\n position: absolute;\n top: -0.5rem;\n margin: 0;\n right: -0.2rem;\n font-size: ${uiFonts.size.small} !important;\n z-index: 1;\n`;\n\nconst DayNightContainer = styled.div`\n margin-top: -0.3rem;\n margin-left: -0.3rem;\n`;\n","import { UserAccountTypes } from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\n\ninterface IPremiumLabelProps {\n accountType: UserAccountTypes;\n}\n\nconst PremiumLabel: React.FC<IPremiumLabelProps> = ({ accountType }) => {\n if (accountType === UserAccountTypes.Free) return null;\n\n const getBackgroundColor = () => {\n switch (accountType) {\n case UserAccountTypes.PremiumBronze:\n return '#CD7F32';\n case UserAccountTypes.PremiumSilver:\n return '#C0C0C0';\n case UserAccountTypes.PremiumGold:\n return '#FFD700';\n case UserAccountTypes.PremiumUltimate:\n return '#002E99';\n default:\n return 'transparent';\n }\n };\n\n const getShortLabel = () => {\n switch (accountType) {\n case UserAccountTypes.PremiumBronze:\n return 'Bronze PA';\n case UserAccountTypes.PremiumSilver:\n return 'Silver PA';\n case UserAccountTypes.PremiumGold:\n return 'Gold PA';\n case UserAccountTypes.PremiumUltimate:\n return 'Ultimate PA';\n default:\n return '';\n }\n };\n\n return (\n <StyledLabel backgroundColor={getBackgroundColor()}>\n {getShortLabel()}\n </StyledLabel>\n );\n};\n\nconst StyledLabel = styled.span<{ backgroundColor: string }>`\n background-color: ${({ backgroundColor }) => backgroundColor};\n color: ${({ backgroundColor }) =>\n backgroundColor === '#002E99' ? 'white' : 'black'};\n font-weight: bold;\n padding: 0 0.4rem;\n border-radius: 3px;\n margin-right: 3px;\n margin-bottom: 2px;\n display: inline-block;\n font-size: 0.5rem !important;\n`;\n\nexport default PremiumLabel;\n","import {\n getItemTextureKeyPath,\n IEquipmentSet,\n ITradeResponseItem,\n} from '@rpg-engine/shared';\nimport capitalize from 'lodash/capitalize';\nimport React, { useEffect, useState } from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\nimport { uiFonts } from '../../constants/uiFonts';\nimport SelectArrow from '../Arrow/SelectArrow';\nimport { ItemInfoWrapper } from '../Item/Cards/ItemInfoWrapper';\nimport { Ellipsis } from '../shared/Ellipsis';\nimport { SpriteFromAtlas } from '../shared/SpriteFromAtlas';\nimport PremiumLabel from './PremiumLabel';\n\nexport interface ITradeComponentProps {\n traderItem: ITradeResponseItem;\n onQuantityChange: (\n traderItem: ITradeResponseItem,\n selectedQty: number\n ) => void;\n atlasJSON: any;\n atlasIMG: any;\n selectedQty: number;\n equipmentSet?: IEquipmentSet | null;\n scale?: number;\n isBuy?: boolean;\n}\n\nconst outerQty = 10;\n\nexport const TradingItemRow: React.FC<ITradeComponentProps> = ({\n atlasIMG,\n atlasJSON,\n onQuantityChange,\n traderItem,\n selectedQty,\n equipmentSet,\n scale,\n isBuy,\n}) => {\n const [inputQty, setInputQty] = useState(selectedQty.toString());\n\n useEffect(() => {\n setInputQty(selectedQty.toString());\n }, [selectedQty]);\n\n const handleQuantityChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const newQty = parseInt(e.target.value, 10);\n if (!isNaN(newQty)) {\n setInputQty(e.target.value);\n onQuantityChange(\n traderItem,\n Math.max(0, Math.min(newQty, traderItem.stackQty ?? 999))\n );\n }\n };\n\n const handleBlur = () => {\n const newQty = parseInt(inputQty, 10);\n if (isNaN(newQty)) {\n setInputQty(selectedQty.toString());\n }\n };\n\n const onLeftClick = (qty = 1) => {\n onQuantityChange(traderItem, Math.max(0, selectedQty - qty));\n };\n\n const onRightClick = (qty = 1) => {\n onQuantityChange(\n traderItem,\n Math.min(traderItem.stackQty ?? 999, selectedQty + qty)\n );\n };\n\n const renderAccountTypeIndicator = () => {\n if (isBuy && traderItem.canBePurchasedOnlyByPremiumPlans) {\n return traderItem.canBePurchasedOnlyByPremiumPlans.map(accountType => (\n <PremiumLabel key={accountType} accountType={accountType} />\n ));\n }\n return null;\n };\n\n return (\n <ItemWrapper>\n <ItemIconContainer>\n <SpriteContainer>\n <ItemInfoWrapper\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n equipmentSet={equipmentSet}\n item={traderItem}\n scale={scale}\n >\n <SpriteFromAtlas\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={getItemTextureKeyPath(\n {\n key: traderItem.key,\n stackQty: traderItem.stackQty || 1,\n texturePath: traderItem.texturePath,\n isStackable: traderItem.isStackable,\n },\n atlasJSON\n )}\n imgScale={2}\n />\n </ItemInfoWrapper>\n </SpriteContainer>\n </ItemIconContainer>\n\n <ItemNameContainer>\n <NameValue>\n <p>\n <Ellipsis maxLines={1} maxWidth=\"180px\">\n {capitalize(traderItem.name)}\n </Ellipsis>\n </p>\n <p>${traderItem.price}</p>\n <p>{renderAccountTypeIndicator()}</p>\n </NameValue>\n </ItemNameContainer>\n <QuantityContainer>\n <SelectArrow\n size={24}\n className=\"arrow-selector\"\n direction=\"left\"\n onPointerDown={() => onLeftClick(outerQty)}\n scale={0.7}\n />\n <StyledArrow\n size={24}\n className=\"arrow-selector\"\n direction=\"left\"\n onPointerDown={() => onLeftClick()}\n />\n <QuantityInput\n type=\"text\"\n value={inputQty}\n onChange={handleQuantityChange}\n onBlur={handleBlur}\n />\n <StyledArrow\n size={24}\n className=\"arrow-selector\"\n direction=\"right\"\n onPointerDown={() => onRightClick()}\n />\n <SelectArrow\n size={24}\n className=\"arrow-selector\"\n direction=\"right\"\n onPointerDown={() => onRightClick(outerQty)}\n scale={0.7}\n />\n </QuantityContainer>\n </ItemWrapper>\n );\n};\n\nconst StyledArrow = styled(SelectArrow)`\n margin: 0 1.5rem;\n`;\n\nconst ItemWrapper = styled.div`\n width: 100%;\n display: flex;\n justify-content: space-between;\n margin-bottom: 0.5rem;\n padding: 0.25rem;\n\n &:hover {\n background-color: ${uiColors.darkGray};\n }\n`;\n\nconst ItemNameContainer = styled.div`\n flex: 60%;\n display: flex;\n align-items: center;\n`;\n\nconst ItemIconContainer = styled.div`\n display: flex;\n justify-content: flex-start;\n align-items: center;\n flex: 0 0 40px;\n`;\n\nconst SpriteContainer = styled.div`\n position: relative;\n top: -0.5rem;\n left: 0;\n`;\n\nconst NameValue = styled.div`\n p {\n font-size: 0.6rem;\n margin: 0;\n line-height: 1.2;\n }\n`;\n\nconst QuantityContainer = styled.div`\n display: flex;\n min-width: 90px;\n width: 40%;\n justify-content: flex-end;\n align-items: center;\n flex: 30%;\n gap: 2px;\n position: relative;\n`;\n\nconst QuantityInput = styled.input`\n width: 30px;\n text-align: center;\n background-color: ${uiColors.darkGray};\n color: white;\n border: none;\n padding: 1px;\n font-size: ${uiFonts.size.small};\n position: relative;\n right: 4px;\n`;\n","import {\n IEquipmentSet,\n ITradeRequestItem,\n ITradeResponseItem,\n TradeTransactionType,\n} from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { Button, ButtonTypes } from '../Button';\nimport { DraggableContainer } from '../DraggableContainer';\nimport { RPGUIContainerTypes } from '../RPGUI/RPGUIContainer';\nimport { TradingItemRow } from './TradingItemRow';\nimport { useTradingGold } from './useTradingGold';\n\nexport interface ITradingMenu {\n traderItems: ITradeResponseItem[];\n onClose: () => void;\n onConfirm: (items: ITradeRequestItem[]) => void;\n type: TradeTransactionType;\n atlasJSON: any;\n atlasIMG: any;\n characterAvailableGold: number;\n equipmentSet?: IEquipmentSet | null;\n scale?: number;\n}\n\nexport const TradingMenu: React.FC<ITradingMenu> = ({\n traderItems,\n onClose,\n type,\n atlasJSON,\n atlasIMG,\n characterAvailableGold,\n onConfirm,\n equipmentSet,\n scale,\n}) => {\n const {\n sum,\n qtyMap,\n isBuy,\n hasGoldForSale,\n getFinalGold,\n getTradeItems,\n updateQuantity,\n } = useTradingGold({ characterAvailableGold, type, traderItems });\n\n return (\n <DraggableContainer\n type={RPGUIContainerTypes.Framed}\n onCloseButton={onClose}\n width=\"500px\"\n cancelDrag=\"#TraderContainer\"\n scale={scale}\n >\n <Container>\n <Title>{type.charAt(0).toUpperCase() + type.slice(1)} Menu</Title>\n <hr className=\"golden\" />\n\n <ScrollWrapper id=\"TraderContainer\">\n {traderItems.map((tradeItem, index) => (\n <TradingItemRow\n key={`${tradeItem.key}_${index}`}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n onQuantityChange={updateQuantity}\n traderItem={tradeItem}\n selectedQty={qtyMap.get(tradeItem.key) ?? 0}\n equipmentSet={equipmentSet}\n scale={scale}\n isBuy={isBuy()}\n />\n ))}\n </ScrollWrapper>\n\n <InfoSection>\n <GoldInfo>\n <p>Available Gold:</p>\n <p>${characterAvailableGold.toFixed(2)}</p>\n </GoldInfo>\n <GoldInfo>\n <p>Total:</p>\n <p>${sum}</p>\n </GoldInfo>\n {!hasGoldForSale() ? (\n <AlertText>Sorry, not enough money.</AlertText>\n ) : (\n <GoldInfo>\n <p>Final Gold:</p>\n <p>${getFinalGold().toFixed(2)}</p>\n </GoldInfo>\n )}\n </InfoSection>\n\n <ButtonWrapper>\n <Button\n buttonType={ButtonTypes.RPGUIButton}\n disabled={!hasGoldForSale()}\n onPointerDown={() => onConfirm(getTradeItems())}\n >\n Confirm\n </Button>\n <Button buttonType={ButtonTypes.RPGUIButton} onPointerDown={onClose}>\n Cancel\n </Button>\n </ButtonWrapper>\n </Container>\n </DraggableContainer>\n );\n};\n\nconst Container = styled.div`\n width: 100%;\n`;\n\nconst Title = styled.h1`\n font-size: 0.7rem !important;\n color: yellow !important;\n text-align: center;\n`;\n\nconst ScrollWrapper = styled.div`\n overflow-y: scroll;\n height: 250px;\n width: 100%;\n margin-top: 0.3rem;\n overflow-x: hidden;\n padding: 0 0.3rem;\n`;\n\nconst InfoSection = styled.div`\n margin-top: 0.3rem;\n padding: 0 0.5rem;\n`;\n\nconst GoldInfo = styled.div`\n display: flex;\n justify-content: space-between;\n height: 16px;\n width: 100%;\n margin: 0.5rem 0;\n p {\n color: yellow !important;\n margin: 0;\n font-size: 0.6rem;\n }\n`;\n\nconst AlertText = styled.p`\n color: red !important;\n text-align: center;\n margin: 0.3rem 0;\n font-size: 0.5rem;\n`;\n\nconst ButtonWrapper = styled.div`\n display: flex;\n justify-content: space-around;\n width: 100%;\n margin-top: 1rem;\n`;\n","/* eslint-disable react/require-default-props */\nimport React from 'react';\nimport styled from 'styled-components';\n\ninterface IProps {\n maxLines?: number;\n children: React.ReactNode;\n}\n\nexport const Truncate: React.FC<IProps> = ({ maxLines = 1, children }) => {\n return <Container maxLines={maxLines}>{children}</Container>;\n};\n\ninterface IContainerProps {\n maxLines: number;\n}\n\nconst Container = styled.div<IContainerProps>`\n display: -webkit-box;\n max-width: 100%;\n max-height: 100%;\n -webkit-line-clamp: ${props => props.maxLines};\n -webkit-box-orient: vertical;\n overflow: hidden;\n`;\n","import React, { useState } from 'react';\n\nexport const ZoomableImage: React.FC<{ src: string; alt: string }> = ({\n src,\n alt,\n}) => {\n const [isZoomed, setIsZoomed] = useState(false);\n const [zoomPosition, setZoomPosition] = useState({ x: 50, y: 50 });\n\n const handleMouseMove = (\n e: React.MouseEvent<HTMLImageElement, MouseEvent>\n ) => {\n const {\n left,\n top,\n width,\n height,\n } = e.currentTarget.getBoundingClientRect();\n const x = ((e.clientX - left) / width) * 100;\n const y = ((e.clientY - top) / height) * 100;\n setZoomPosition({ x, y });\n };\n\n const handleTouchMove = (e: React.TouchEvent<HTMLImageElement>) => {\n const {\n left,\n top,\n width,\n height,\n } = e.currentTarget.getBoundingClientRect();\n const touch = e.touches[0];\n const x = ((touch.clientX - left) / width) * 100;\n const y = ((touch.clientY - top) / height) * 100;\n setZoomPosition({ x, y });\n };\n\n const handleZoomToggle = () => {\n setIsZoomed(!isZoomed);\n };\n\n return (\n <img\n src={src}\n alt={alt}\n onMouseMove={handleMouseMove}\n onTouchMove={handleTouchMove}\n onClick={handleZoomToggle} // Toggle zoom on click/tap\n style={{\n width: '100%',\n height: '100%',\n objectFit: 'cover',\n transform: isZoomed ? 'scale(1.5)' : 'scale(1)',\n transformOrigin: `${zoomPosition.x}% ${zoomPosition.y}%`,\n transition: 'transform 0.3s ease',\n cursor: 'pointer', // Indicate interactivity\n }}\n />\n );\n};\n","import React, { useMemo } from 'react';\nimport styled, { CSSProperties } from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\nimport { ZoomableImage } from '../Image/ZoomableImage';\nimport { Stepper } from '../Stepper';\nimport { DynamicText } from '../typography/DynamicText';\n\nexport interface ITutorialLesson {\n title: string;\n body?: React.ReactNode | string;\n text?: string;\n image: string;\n imageUrl?: string;\n}\n\nexport interface ITutorialStepperProps {\n lessons: ITutorialLesson[];\n onLessonFinish: () => void;\n imageStyle?: CSSProperties;\n}\n\nexport const TutorialStepper = React.memo(\n ({ lessons, onLessonFinish, imageStyle }: ITutorialStepperProps) => {\n const generateLessons = useMemo(\n () =>\n lessons.map((lesson, index) => ({\n component: (\n <LessonContainer key={index} className=\"lesson-container\">\n <LessonTitle className=\"lesson-title\">{lesson.title}</LessonTitle>\n {lesson.image && (\n <LessonImageWrapper className=\"lesson-image-wrapper\">\n <LessonImage className=\"lesson-image\" style={imageStyle}>\n {lesson.imageUrl ? (\n <a\n href={lesson.imageUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n <ZoomableImage\n src={lesson.image}\n alt={lesson.title || 'Tutorial image'}\n />\n </a>\n ) : (\n <ZoomableImage\n src={lesson.image}\n alt={lesson.title || 'Tutorial image'}\n />\n )}\n </LessonImage>\n </LessonImageWrapper>\n )}\n <LessonFooter className=\"lesson-footer\">\n {lesson.body && (\n <LessonBody\n className=\"lesson-body\"\n dangerouslySetInnerHTML={{ __html: lesson.body as string }}\n ></LessonBody>\n )}\n {lesson.text && <DynamicText text={lesson.text} />}\n </LessonFooter>\n </LessonContainer>\n ),\n id: index,\n })),\n [lessons, imageStyle]\n );\n\n return (\n <Container>\n <Stepper\n steps={generateLessons}\n finalCTAButton={{\n label: 'Close',\n onClick: onLessonFinish,\n }}\n useSideArrows\n />\n </Container>\n );\n }\n);\n\nconst LessonImageWrapper = styled.div`\n width: 100%;\n max-width: 500px;\n margin: 1rem auto;\n aspect-ratio: auto; /* Allow the image to define its own aspect ratio */\n border-radius: 10px;\n`;\n\nconst LessonBody = styled.div``;\n\nconst Container = styled.div`\n width: 80%;\n max-width: 600px;\n\n @media (max-width: 600px) {\n width: 95%;\n }\n`;\n\nconst LessonFooter = styled.div`\n margin-top: 1rem;\n`;\n\nconst LessonImage = styled.div`\n display: flex;\n justify-content: center;\n align-items: center;\n width: 100%;\n max-width: 500px;\n margin: auto;\n\n img {\n width: 100%;\n height: auto;\n object-fit: contain; /* Ensures the entire image is visible */\n border-radius: 10px;\n }\n`;\n\nconst LessonTitle = styled.h1`\n color: ${uiColors.yellow} !important;\n font-size: 0.8rem !important;\n`;\n\nconst LessonContainer = styled.div`\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n min-height: 200px; /* Match with StepperBody for consistent height */\n\n p {\n // make font size consistent with rest\n font-size: 0.7rem !important;\n }\n`;\n","import { useEffect, useState } from 'react';\nimport { PrivateChatCharacter } from '../components/ChatRevamp/types';\n\ninterface IUseChat {\n minimizedByDefault: boolean;\n isPrivate: boolean;\n onChangeTab: (tabId: string) => void;\n onPreviousChatCharacterClick?: (character: PrivateChatCharacter) => void;\n hideSearchCharacterUI?: () => void;\n unseenMessageCharacterIds?: string[];\n}\n\nexport const useChat = ({\n minimizedByDefault,\n isPrivate,\n onChangeTab,\n onPreviousChatCharacterClick,\n hideSearchCharacterUI,\n unseenMessageCharacterIds,\n}: IUseChat) => {\n const [showRecentChats, setShowRecentChats] = useState(false);\n const [isExpanded, setIsExpanded] = useState(!minimizedByDefault);\n\n useEffect(() => {\n if (isPrivate) {\n setIsExpanded(true);\n }\n }, [isPrivate]);\n\n const toggleExpand = () => setIsExpanded(prev => !prev);\n\n const toggleRecentChats = () => setShowRecentChats(prev => !prev);\n\n const handleTabChange = (tabId: string) => {\n if (tabId === 'private') {\n setIsExpanded(true);\n }\n onChangeTab(tabId);\n };\n\n const handlePreviousChatCharacterClick = (\n character: PrivateChatCharacter\n ) => {\n if (onPreviousChatCharacterClick) {\n onPreviousChatCharacterClick(character);\n }\n if (hideSearchCharacterUI) {\n hideSearchCharacterUI();\n }\n };\n\n return {\n showRecentChats,\n isExpanded,\n toggleExpand,\n toggleRecentChats,\n handleTabChange,\n handlePreviousChatCharacterClick,\n hasUnseenMessages:\n unseenMessageCharacterIds && unseenMessageCharacterIds?.length > 0,\n };\n};\n","import React, { useEffect, useState } from 'react';\n\nexport interface ICheckItems {\n label: string;\n value: string;\n}\n\nexport interface ICheckProps {\n items: ICheckItems[];\n onChange: (selectedValues: IChecklistSelectedValues) => void;\n}\n\nexport interface IChecklistSelectedValues {\n [label: string]: boolean;\n}\n\nexport const CheckButton: React.FC<ICheckProps> = ({ items, onChange }) => {\n const generateSelectedValuesList = () => {\n const selectedValues: IChecklistSelectedValues = {};\n\n items.forEach(item => {\n selectedValues[item.label] = false;\n });\n\n return selectedValues;\n };\n\n const [selectedValues, setSelectedValues] = useState<\n IChecklistSelectedValues\n >(generateSelectedValuesList());\n\n const handleClick = (label: string) => {\n setSelectedValues({\n ...selectedValues,\n [label]: !selectedValues[label],\n });\n };\n\n useEffect(() => {\n if (selectedValues) {\n onChange(selectedValues);\n }\n }, [selectedValues]);\n\n return (\n <div id=\"elemento-checkbox\">\n {items?.map((element, index) => {\n return (\n <div key={`${element.label}_${index}`}>\n <input\n className=\"rpgui-checkbox\"\n type=\"checkbox\"\n checked={selectedValues[element.label]}\n onChange={() => {}}\n />\n <label onPointerDown={() => handleClick(element.label)}>\n {element.label}\n </label>\n <br />\n </div>\n );\n })}\n </div>\n );\n};\n","import React, { useState } from 'react';\n\nexport interface ICheckItemProps {\n label?: string;\n defaultValue?: boolean;\n onChange: (label: string | undefined, selected: boolean) => void;\n}\n\nexport const CheckItem: React.FC<ICheckItemProps> = ({\n label,\n defaultValue = false,\n onChange,\n}) => {\n const [checked, setChecked] = useState(defaultValue);\n\n const handleClick = () => {\n const newCheckedState = !checked;\n setChecked(newCheckedState);\n onChange(label, newCheckedState);\n };\n\n return (\n <div onPointerDown={handleClick}>\n <input\n className=\"rpgui-checkbox\"\n type=\"checkbox\"\n checked={checked}\n readOnly\n />\n <label>{label}</label>\n <br />\n </div>\n );\n};\n","import { ICraftableItem, IItem, IItemContainer } from '@rpg-engine/shared';\n\nexport function calculateMaxCraftable(\n recipe: ICraftableItem | undefined,\n inventory: IItemContainer | null | undefined\n): number {\n if (!inventory || !recipe?.ingredients) {\n return 0;\n }\n\n return recipe.ingredients.reduce((maxPossible, ingredient) => {\n const inventoryItem = Object.values(inventory.slots).find(\n (item): item is IItem => item?.key === ingredient.key\n );\n\n if (!inventoryItem) {\n return 0;\n }\n\n const possibleWithThisIngredient = Math.floor(\n inventoryItem.stackQty ?? 0 / ingredient.qty\n );\n\n if (maxPossible === -1) {\n return possibleWithThisIngredient;\n }\n\n return Math.min(maxPossible, possibleWithThisIngredient);\n }, -1);\n}\n","import React, { useEffect, useState } from 'react';\n\nexport interface IRadioItems {\n label: string;\n value: string;\n}\n\nexport interface IRadioProps {\n name: string;\n items: IRadioItems[];\n onChange: (value: string) => void;\n}\n\nexport const InputRadio: React.FC<IRadioProps> = ({\n name,\n items,\n onChange,\n}) => {\n const [selectedValue, setSelectedValue] = useState<string>();\n const handleClick = () => {\n let element = document.querySelector(\n `input[name=${name}]:checked`\n ) as HTMLInputElement;\n const elementValue = element.value;\n setSelectedValue(elementValue);\n };\n\n useEffect(() => {\n if (selectedValue) {\n onChange(selectedValue);\n }\n }, [selectedValue]);\n\n return (\n <div id=\"elemento-radio\">\n {items.map(element => {\n return (\n <>\n <input\n key={element.value}\n className=\"rpgui-radio\"\n value={element.value}\n name={name}\n type=\"radio\"\n />\n <label onPointerDown={handleClick}>{element.label}</label>\n <br />\n </>\n );\n })}\n </div>\n );\n};\n","import React from 'react';\n\nexport interface ITextArea\n extends React.DetailedHTMLProps<\n React.TextareaHTMLAttributes<HTMLTextAreaElement>,\n HTMLTextAreaElement\n > {}\n\nexport const TextArea: React.FC<ITextArea> = ({ ...props }) => {\n return <textarea {...props} />;\n};\n","import {\n ITradeRequestItem,\n ITradeResponseItem,\n TradeTransactionType,\n} from '@rpg-engine/shared';\nimport { useState } from 'react';\n\ninterface ITradingGoldHook {\n characterAvailableGold: number;\n type: TradeTransactionType;\n traderItems: ITradeResponseItem[];\n}\n\nexport const useTradingGold = ({\n characterAvailableGold,\n type,\n traderItems,\n}: ITradingGoldHook) => {\n const [sum, setSum] = useState(0);\n const [qtyMap, setQtyMap] = useState(new Map<string, number>());\n\n const isBuy = () => type === 'buy';\n\n const hasGoldForSale = () =>\n isBuy() ? !(sum > characterAvailableGold) : true;\n\n const getFinalGold = () =>\n isBuy() ? characterAvailableGold - sum : characterAvailableGold + sum;\n\n const getTradeItems = (): ITradeRequestItem[] => {\n const items: ITradeRequestItem[] = [];\n traderItems.forEach(item => {\n const qty = qtyMap.get(item.key);\n if (qty) {\n items.push({\n ...item,\n qty,\n });\n }\n });\n return items;\n };\n\n const updateQuantity = (item: ITradeResponseItem, selectedQty: number) => {\n setQtyMap(new Map(qtyMap.set(item.key, selectedQty)));\n\n let newSum = 0;\n qtyMap.forEach((qty, key) => {\n const item = traderItems.find(i => i.key === key);\n if (item) newSum += qty * item.price;\n });\n setSum(newSum);\n };\n\n return {\n sum,\n qtyMap,\n isBuy,\n hasGoldForSale,\n getFinalGold,\n getTradeItems,\n updateQuantity,\n };\n};\n"],"names":["ButtonTypes","SelectArrow","_ref","direction","_ref$direction","size","_ref$scale","scale","onPointerDown","props","_objectWithoutPropertiesLoose","_excluded","React","LeftArrow","RightArrow","styled","span","withConfig","displayName","componentId","DropdownDisplay","DropdownLabel","label","Container","div","width","DropdownSelect","p","DropdownOptions","ul","opened","opensUp","RPGUIContainerTypes","Button","disabled","_ref$disabled","children","buttonType","ButtonContainer","className","button","SpriteFromAtlas","atlasJSON","spriteKey","_ref$width","_ref$height","height","_ref$imgScale","imgScale","_ref$grayScale","grayScale","_ref$opacity","opacity","spriteData","_atlasJSON$frames","frames","_atlasJSON$frames2","GRID_WIDTH","GRID_HEIGHT","hasHover","style","containerStyle","ImgSprite","imgClassname","atlasIMG","frame","imgStyle","centered","borderRadius","console","error","w","h","x","y","ErrorBoundary","_Component","_this","_len","arguments","length","args","Array","_key","call","apply","concat","state","hasError","getDerivedStateFromError","_","_proto","prototype","componentDidCatch","errorInfo","render","this","Component","Ellipsis","_ref$maxLines","maxLines","maxWidth","fontSize","center","PropertySelect","item","availableProperties","onChange","_useState","useState","currentIndex","setCurrentIndex","propertiesLength","useEffect","JSON","stringify","TextOverlay","Item","name","index","Chat","chatMessages","onSendChatMessage","onCloseButton","onFocus","onBlur","_ref$styles","styles","textColor","buttonColor","buttonBackgroundColor","isExpanded","message","setMessage","inputRef","useRef","scrollChatToBottom","_inputRef$current","current","focus","scrollingElement","document","querySelector","scrollTop","scrollHeight","ChatContainer","fallback","CloseButton","onClick","FaTimes","MessagesContainer","map","chatMessage","Message","color","key","_id","maxLength","dayjs","createdAt","format","emitter","slice","formatMessage","Form","onSubmit","event","preventDefault","trim","TextField","ref","value","e","target","type","autoComplete","placeholder","SendButton","_ref2","form","input","Input","_extends","_objectDestructuringEmpty","rest","innerRef","RPGUIContainer","Column","flex","flexWrap","alignItems","justifyContent","CustomInput","CustomContainer","MessageText","SearchCharacter","onChangeCharacterName","recentCharacters","hideSearchCharacterUI","onCharacterClick","characterName","setCharacterName","searchCharacterRef","timer","setTimeout","clearTimeout","SearchContainer","id","SearchButton","RxMagnifyingGlass","ListContainer","character","ListElement","handleCharacterClick","_ref3","li","ChatContent","isPrivate","isTrade","isGlobal","onSendLocalChatMessage","onSendGlobalChatMessage","onSendPrivateChatMessage","onSendTradeMessage","autoCloseOnSend","isGuild","onSendGuildChatMessage","searchCharacterUI","privateChatCharacters","ChatWrapper","sendMessage","ChatTabs","activeTab","onChangeTab","TabContainer","tabs","tab","Tab","active","ExpandButton","StyledExpandButton","IoMdContract","IoMdExpand","RecentChats","showRecentChats","showSearchCharacterUI","recentChatCharacters","recentSelectedChatCharacterId","unseenMessageCharacterIds","onPreviousChatCharacterClick","onRemoveRecentChatCharacter","RecentChatTabContainer","isOpen","RecentChatTopBar","BurgerIconContainer","toggleRecentChats","hasUnseenMessages","BurgerLineIcon","RecentChatLogContainer","_unseenMessageCharact","ListElementContainer","handlePreviousChatCharacterClick","StatusDot","isUnseen","includes","RxCross2","ChatRevampContainer","TopBar","AllChatsContainer","_ref4","ChatContentWrapper","CollapsedChatInput","ExpandedChatContent","SingleShortcut","useShortcutCooldown","onShortcutCast","shortcutCooldown","setShortcutCooldown","cooldownTimeout","handleShortcutCast","CancelButton","ButtonsContainer","ShortcutsContainer","StyledShortcut","useOutsideClick","handleClickOutside","contains","CustomEvent","detail","dispatchEvent","addEventListener","removeEventListener","NPCDialogType","DraggableContainer","minHeight","minWidth","_ref$type","FramedGold","title","imgSrc","_ref$imgWidth","imgWidth","cancelDrag","onPositionChange","onPositionChangeEnd","onPositionChangeStart","onOutsideClick","_ref$initialPosition","initialPosition","_ref$dragDisabled","dragDisabled","isFullScreen","draggableRef","_e","Draggable","cancel","onDrag","data","onStop","onStart","defaultPosition","TitleContainer","Title","Icon","src","_ref5","css","_ref6","h1","img","_ref7","InputRadio","onRadioSelect","onPointerUp","checked","isChecked","readOnly","countItemFromInventory","itemKey","inventory","itemsFromInventory","Object","keys","slots","forEach","i","parseInt","_inventory$slots$inde","push","reduce","acc","stackQty","modalRoot","getElementById","ModalPortal","ReactDOM","createPortal","rarityColor","rarity","ItemRarities","Uncommon","Rare","Epic","Legendary","gemColors","emerald-gem","topaz-radiance","sapphire-gem","ruby-gem","misty-quartz-gem","coral-reef-gem","jasper-gem","earthstone-gem","obsidian-gem","amethyst-gem","onRenderGems","_item$attachedGems","attachedGems","ItemSlotQty","itemId","ItemQtyContainer","_item$attachedGems2","gem","Gem","onRenderStackInfo","qtyClassName","ItemQty","Math","round","ItemSlotRenderer","containerType","slotSpriteMask","renderItem","texturePath","getItemTextureKeyPath","isStackable","renderStackInfo","renderGems","itemToRender","ItemContainerType","Equipment","_itemToRender$allowed","allowedEquipSlotType","uuidv4","EquipmentSlotSpriteByType","renderEquipment","onRenderSlot","generateContextMenuListOptions","actionsByTypeList","action","text","ItemSocketEventsDisplayLabels","initialDetailsState","isTooltipVisible","isTooltipMobileVisible","isContextMenuVisible","contextMenuPosition","contextActions","clearContextActions","clearDetailsState","ItemSlotDetailsContext","createContext","detailsState","updateDetailsState","setContextActions","useItemSlotDetails","useContext","ItemSlotDetailsProvider","setDetailsState","useCallback","newState","prevState","isDepotSystem","isContextMenuDisabled","newContextActions","itemContainerType","contextActionMenu","Inventory","ItemType","Weapon","Armor","Accessory","Jewelry","ActionsForInventory","Consumable","CraftingResource","Tool","Other","DepotSocketEvents","Deposit","contextActionMenuDontHaveUseWith","find","toLowerCase","hasUseWith","ItemSocketEvents","UseWith","ActionsForEquipmentSet","Loot","ActionsForLoot","MapContainer","ActionsForMapContainer","Depot","GetItemInfo","Withdraw","generateContextMenu","contextValue","useMemo","Provider","initialDraggingState","isDragging","position","dropPosition","isFocused","draggingDistance","ItemSlotDraggingContext","draggingState","updateDraggingState","clearDraggingState","useItemSlotDragging","ItemSlotDraggingProvider","setDraggingState","Neck","LeftHand","Ring","Head","Torso","Legs","Feet","RightHand","ItemSlot","observer","slotIndex","onMouseOver","onMouseOut","_ref$isContextMenuDis","onDragEnd","onDragStart","onPlaceDrop","onDrop","onOutsideDrop","checkIfItemCanBeMoved","openQuantitySelector","checkIfItemShouldDragEnd","dragScale","isSelectingShortcut","setItemShortcut","_useItemSlotDetails","getTouchTarget","_touchEvent$changedTo","_touchEvent$touches","touch","changedTouches","touches","elementFromPoint","clientX","clientY","body","dragContainer","_useItemSlotDragging","resetItem","onSuccessfulDrag","quantity","handleDraggedItem","targetClasses","from","classList","some","elm","log","targetElement","_getElementTransform","getElementTransform","processDragEnd","element","window","getComputedStyle","matrix","DOMMatrixReadOnly","transform","m41","m42","isDraggingItem","onMouseUp","onTouchEnd","_e$changedTouches$","simulatedEvent","MouseEvent","bubbles","_document$elementFrom","undefined","subType","ItemSubType","Seed","axis","defaultClassName","requestAnimationFrame","isMobile","split","isNaN","handleShortcutSetter","remove","removeDraggingClass","isTouchEvent","mouseEvent","handleContextMenuOrTooltip","_data","bounds","ItemContainer","onMouseEnter","onMouseLeave","statisticsToDisplay","higherIsWorse","ItemInfo","itemToCompare","renderMissingStatistic","statistics","_i2","_statisticsToDisplay2","stat","itemToCompareStatistic","toUpperCase","Statistic","toString","skillName","_item$minRequirements","minRequirements","_item$minRequirements2","skill","Header","Rarity","Type","AllowedSlots","slotType","LevelRequirement","_item$minRequirements3","level","charAt","_item$minRequirements4","_item$minRequirements5","_i","_statisticsToDisplay","itemStatistic","_itemToCompare$stat$k","_itemToCompare$stat$k2","isItemToCompare","isOnlyInOneItem","statDiff","isDifference","isBetter","renderStatistics","entityEffects","entityEffectChance","effect","usableEffectDescription","equippedBuffDescription","isTwoHanded","Description","description","maxStackSize","StackInfo","_item$stackQty","MissingStatistics","_rarityColor","$isSpecial","itemSlotTypes","ItemInfoDisplay","equipmentSet","_item$allowedEquipSlo","allowedSlotTypeCamelCase","camelCase","itemSubTypeCamelCase","getSlotType","itemFromEquipment","values","_item$subType","Flex","CompareContainer","Equipped","$isMobile","ItemTooltip","handleMouseMove","rect","getBoundingClientRect","tooltipWidth","tooltipHeight","isOffScreenRight","innerWidth","isOffScreenBottom","innerHeight","MobileItemTooltip","closeTooltip","options","onSelected","handleFadeOut","_ref$current","add","OptionsContainer","option","Option","ItemInfoWrapper","setIsTooltipVisible","_useState2","setIsTooltipMobileVisible","bind","CraftingRecipe","recipe","handleRecipeSelect","selectedCraftItemKey","skills","modifyString","str","parts","words","replace","join","levelInSkill","_skills$level","_skills","_recipe$minCraftingRe","_recipe$minCraftingRe2","minCraftingRequirements","RadioOptionsWrapper","SpriteAtlasWrapper","canCraft","display","MinCraftingRequirementsText","levelIsOk","_recipe$levelIsOk","_recipe$minCraftingRe3","_recipe$minCraftingRe4","_recipe$minCraftingRe5","_recipe$minCraftingRe6","ingredients","ingredient","itemQtyInInventory","Recipe","Ingredient","isQuantityOk","qty","desktop","mobileLanscape","mobilePortrait","Wrapper","Subtitle","RadioInputScroller","ButtonWrapper","ContentContainer","ItemTypes","Dropdown","_ref$opensUp","dropdownId","selectedValue","setSelectedValue","selectedOption","setSelectedOption","_useState3","setOpened","firstOption","change","filter","o","prev","Details","DraggedItem","_useCursorPosition","setPosition","scalePosition","setFromEvent","scaledPosition","cleanup","handleEvent","useCursorPosition","centeredX","CONTAINER_SIZE","centeredY","stackInfo","_item$_id","SpriteContainer","attrs","left","top","RelativeListMenu","_ref$fontSize","pos","overflow","params","ItemSlotToolTips","optionId","EquipmentSetContainer","EquipmentColumn","Table","table","TableRow","tr","TableHeader","th","TableCell","td","ActionButtons","UserActionLink","SearchFriend","searchedCharacters","friendRequests","onSearch","onSendFriendRequest","onAcceptRequest","onRejectRequest","debouncedSearch","debounce","searchTabContent","SearchForm","SearchInput","autoFocus","CharacterList","characters","onAction","actionLabel","requestsTabContent","FriendRequestSection","onAccept","onReject","InternalTabs","content","activeTextColor","inactiveColor","borderColor","ListItem","CharacterName","AcceptRejectActions","ListWrapper","ScrollableArea","IsOnlineBadge","$isOnline","IS_MOBILE_OR_TABLET","isMobileOrTablet","DynamicText","onFinish","textState","setTextState","interval","setInterval","substring","clearInterval","TextContainer","NPCDialogText","charactersPerLine","linesPerDiv","onClose","onEndStep","onStartStep","windowSize","textChunks","floor","match","RegExp","chunkIndex","setChunkIndex","onHandleSpacePress","code","goToNextStep","showGoNextIndicator","setShowGoNextIndicator","PressSpaceIndicator","right","TextOnly","pressSpaceGif","useEventListener","handler","el","savedHandler","listener","QuestionDialog","questions","answers","currentQuestion","setCurrentQuestion","canShowAnswers","setCanShowAnswers","onGetFirstAnswer","answerIds","firstAnswerId","answer","currentAnswer","setCurrentAnswer","onGetAnswers","answerId","nextAnswerIndex","findIndex","nextAnswerID","nextAnswer","previousAnswerIndex","previousAnswerID","previousAnswer","pop","nextQuestionId","question","QuestionContainer","AnswersContainer","isSelected","selectedColor","AnswerRow","AnswerSelectedIcon","Answer","onAnswerClick","onRenderCurrentAnswers","ImgSide","NPCDialog","imagePath","_ref$isQuestionDialog","isQuestionDialog","TextAndThumbnail","ThumbnailContainer","NPCThumbnail","aliceDefaultThumbnail","CloseIcon","RangeSliderType","NPCMultiDialog","textAndTypeArray","slide","setSlide","_textAndTypeArray$sli","imageSide","BackgroundContainer","imgPath","DialogContainer","CarouselWrapper","ArrowContainer","BackgroundImage","isTextFixed","textPosition","ImageContainer","CustomLeftArrow","CustomRightArrow","Carousel","CarouselImg","fadeIn","keyframes","FadeInCarouselImg","_ref$activeColor","activeColor","_ref$activeTextColor","_ref$inactiveColor","_ref$borderColor","_ref$hoverColor","hoverColor","setActiveTab","TableWrapper","TabHeader","TabButton","ContentWrapper","_tabs$find","SlotsContainer","Framed","ShortcutsSetter","setSettingShortcutIndex","settingShortcutIndex","shortcuts","removeShortcut","List","Shortcut","ShortcutType","None","isBeingSet","_shortcuts$index","_shortcuts$index2","payload","shortcut","Spell","_payload$texturePath","getContent","OrderByType","RangeSlider","memo","valueMin","valueMax","_ref$step","step","sliderId","containerRef","setLeft","calculatedWidth","_containerRef$current","clientWidth","max","typeClass","GoldSlider","handleChange","Number","pointerEvents","min","QuantitySelector","maxQuantity","initialQuantity","_ref$title","onConfirm","setValue","closeSelector","select","StyledContainer","StyledForm","numberValue","noValidate","StyledInput","Slider","RPGUIButton","QuantitySelectorModal","quantitySelect","setQuantitySelect","resetQuantitySelect","callback","validatedQuantitySelect","QuantitySelectorContainer","ItemQuantitySelectorModal","itemContainer","onItemClick","_ref$disableContextMe","disableContextMenu","onItemDragEnd","onItemDragStart","onItemPlaceDrop","_quantity","_useScrollOnDrag","threshold","scrollStep","animationFrameId","startScrolling","scroll","maxScrollTop","clientHeight","distanceFromBottom","bottom","stopScrolling","cancelAnimationFrame","useScrollOnDrag","handleSetShortcut","onDragStartScrollingEvents","once","onDragEndScrollingEvents","onDragStartHandler","onDragEndHandler","memoizedHandleSetShortcut","onRenderSlots","slotQty","_itemContainer$slots","currentItem","itemType","ItemsContainer","isScrollable","LeaderboardTable","items","rankType","TableRowWrapper","TableRowValue","entry","isTopSkillEntry","WrapperContainer","StyledDropdown","ItemComponentScrollWrapper","Pager","totalItems","currentPage","onPageChange","totalPages","ceil","itemsPerPage","PagerContainer","ConfirmModal","Background","stopPropagation","ButtonsWrapper","MarketplaceRows","itemPrice","onMarketPlaceItemBuy","onMarketPlaceItemRemove","MarketplaceWrapper","ItemIconContainer","GemContainer","RarityContainer","QuantityContainer","PriceValue","GoldContainer","MultitabType","itemTypeOptions","itemRarityOptions","itemRarity","orderByOptions","flatMap","orderBy","BuyPanel","onChangeType","onChangeRarity","onChangeOrder","onChangeNameInput","onChangeMainLevelInput","onChangeSecondaryLevelInput","onChangePriceInput","characterId","enableHotkeys","disableHotkeys","setName","mainLevel","setMainLevel","secondaryLevel","setSecondaryLevel","_useState4","price","setPrice","_useState5","buyingItemId","setBuyingItemId","itemsContainer","_itemsContainer$curre","scrollTo","InputWrapper","OptionsWrapper","FilterInputsWrapper","AiFillCaretRight","owner","ManagmentPanel","availableGold","selectedItemToSell","onSelectedItemToSellRemove","onAddItemToMarketplace","onMoneyWithdraw","isCreatingOffer","setIsCreatingOffer","removingItemId","setRemovingItemId","InnerOptionsWrapper","SellDescription","__","PriceInputWrapper","AvailableGold","$disabled","_props$styles","_props$styles2","centerContent","CustomTab","BodyContainer","selectedTab","NonDraggableWrapper","PartyRow","charName","charClass","charLevel","playerQty","isInvited","PartyWrapper","partyName","RowsWrapper","PlayersRow","isNotInvited","HighlightedText","Text","PartyManagerRow","leaderId","userId","onRemovePlayer","onChangeLeader","isCurrentUser","canRemove","isLeader","YellowText","NotInParty","mockedPartyRows","mockedPlayersRows2","leader","class","CharacterClass","Druid","members","maxSize","mockedPlayersRows","mockedPartyManager","ProgressBarText","percentageWidth","mobileScale","QuestDraggableContainer","QuestContainer","QuestsContainer","Content","QuestSplitDiv","QuestColumn","Thumbnail","QuestListContainer","QuestCard","QuestItem","Label","Value","NoQuestContainer","formatQuestText","word","getQuestStatusColor","status","QuestStatus","Pending","InProgress","Completed","formatQuestStatus","c","RPGUIScrollbar","RPGUIOverrides","_RPGUI","RPGUI","SimpleProgressBar","_ref$bgColor","bgColor","_ref$margin","margin","ProgressBarContainer","BackgroundBar","Progress","toFixed","Tooltip","SkillProgressBar","totalPointsForLevelUp","excessSkillPoints","currentSkillPoints","skillPoints","skillPointsToNextLevel","_ref$showSkillPoints","showSkillPoints","buffAndDebuff","baseSkillPoints","getSPForLevel","progress","formatBuffAndDebuff","skillsBuffsCalc","result","ProgressTitle","BuffAndDebuffContainer","TitleNameContainer","TitleNameBuff","TitleNameBuffContainer","TitleNameDebuff","TitleName","ValueDisplay","ProgressBody","ProgressIconContainer","ProgressBarWrapper","SkillDisplayContainer","SkillPointsDisplay","skillProps","attributes","stamina","magic","magicResistance","strength","resistance","dexterity","combat","first","club","sword","axe","distance","shielding","dagger","crafting","fishing","farming","mining","lumberjacking","blacksmithing","cooking","alchemy","skillNameMap","SkillsDraggableContainer","SkillsContainerDiv","SkillSplitDiv","SpellInfo","spell","magicWords","manaCost","requiredItem","castingType","cooldown","maxDistanceGrid","formatSpellCastingType","SpellInfoDisplay","MobileSpellTooltip","MagicTooltip","SpellInfoWrapper","_ref$holdTouchDuratio","holdTouchDuration","touchTimeoutRef","onTouchStart","charMana","charMagicLevel","isSettingShortcut","activeCooldown","minMagicLevelRequired","spellKey","Overlay","SpellImage","_spell$texturePath","Info","Divider","Cost","SpellList","Stepper","steps","finalCTAButton","onError","_ref$useSideArrows","useSideArrows","currentStep","setCurrentStep","currentComponent","_steps$currentStep","component","totalSteps","onStepChange","_regeneratorRuntime","mark","_callee","_steps$currentStep2","wrap","_context","next","validate","sent","errorMessage","abrupt","t0","stop","_x","renderArrows","leftArrow","rightArrow","StepperContainer","StepperTop","ProgressIndicator","isActive","stepperProgressColor","StepperBodyContainer","StepperBody","StepperFooter","DayNightPeriod","periodOfDay","periodOfDaySrcFiles","_periodOfDaySrcFiles","PeriodOfDay","Morning","Afternoon","Night","GifContainer","WidgetContainer","Time","DayNightContainer","PremiumLabel","accountType","UserAccountTypes","Free","StyledLabel","backgroundColor","PremiumBronze","PremiumSilver","PremiumGold","PremiumUltimate","getBackgroundColor","getShortLabel","TradingItemRow","onQuantityChange","traderItem","selectedQty","isBuy","inputQty","setInputQty","onLeftClick","onRightClick","_traderItem$stackQty2","ItemWrapper","ItemNameContainer","NameValue","capitalize","canBePurchasedOnlyByPremiumPlans","StyledArrow","QuantityInput","_traderItem$stackQty","newQty","ScrollWrapper","InfoSection","GoldInfo","AlertText","ZoomableImage","alt","isZoomed","setIsZoomed","zoomPosition","setZoomPosition","onMouseMove","_e$currentTarget$getB","currentTarget","onTouchMove","_e$currentTarget$getB2","objectFit","transformOrigin","transition","cursor","TutorialStepper","lessons","onLessonFinish","imageStyle","generateLessons","lesson","LessonContainer","LessonTitle","image","LessonImageWrapper","LessonImage","imageUrl","href","rel","LessonFooter","LessonBody","dangerouslySetInnerHTML","__html","defaultValue","_options$","_options$find","_options$2","_options$find2","BeatLoader","handleSelection","availableCharacters","propertySelectValues","textureKey","selectedSpriteKey","setSelectedSpriteKey","paddingBottom","FramedGrey","Date","onRenderMessageLines","onRenderChatMessages","_ref$activeTab","_ref$minimizedByDefau","minimizedByDefault","chatHook","setShowRecentChats","setIsExpanded","toggleExpand","handleTabChange","tabId","useChat","selectedValues","generateSelectedValuesList","setSelectedValues","_extends2","_ref$defaultValue","setChecked","newCheckedState","onActionClick","onCancelClick","mana","spellCooldowns","_useShortcutCooldown","onShortcutClick","buildClassName","classBase","isOnCooldown","variant","onShortcutClickBinded","_shortcuts$i","isOnShortcutCooldown","_shortcuts$i2","_shortcuts$i3","itemsFromEquipment","totalQty","_shortcuts$i4","spellCooldown","_spellCooldowns$paylo","replaceAll","_payload$manaCost","renderShortcut","onSelect","onCraftItem","craftablesItems","savedSelectedType","craftItemKey","setCraftItemKey","selectedType","setSelectedType","setSize","searchTerm","setSearchTerm","isCraftingDisabled","setIsCraftingDisabled","handleResize","filteredCraftableItems","itemTypes","sort","a","b","localeCompare","rows","row","gap","renderItemTypes","maxCraftable","maxPossible","inventoryItem","possibleWithThisIngredient","_inventoryItem$stackQ","calculateMaxCraftable","details","onItemOutsideDrop","equipmentData","neck","leftHand","ring","head","armor","legs","boot","rightHand","accessory","equipmentMaskSlots","ItemSlotType","onRenderEquipmentSlotRange","start","end","equipmentRange","slotMaksRange","ContainerType","friends","onRemoveFriend","onOpenPrivateMessage","onAddFriend","onBackFriendList","isAddFriendUI","setIsAddFriendUI","friend","isOnline","backgroundImgPath","fullCoverBackground","setImage","fullImg","textImage","textImageSelected","setTextImageSelected","goToPreviousImage","indexOf","goToNextImage","_textImageSelected$te","_textImageSelected$te2","handleClick","imageKey","onChangeRankType","onChangeClassType","skillOptions","onChangeSkillType","classOptions","rankOptions","rankTypeOptions","skillTypeOptions","classTypeOptions","onYourPanelToggle","isYourPanel","setIsYourPanel","onCreate","close","partyRows","playersRows","invitationActionText","sortedMembers","partyRow","_ref$displayText","displayText","_ref$percentageWidth","_ref$minWidth","calculatePercentageValue","quests","buttons","onChangeQuest","questsLength","thumbnail","thumbnailDefault","npcId","container","quest","_formatQuestStatus","card","_ref$isBlockedCasting","isBlockedCastingByKeyboard","shortcutsRefs","handleKeyDown","shortcutIndex","_shortcutsRefs$curren","timeoutId","_shortcutsRefs$curren2","timeoutIds","images","_ref$autoCycle","autoCycle","_ref$autoCycleDelay","autoCycleDelay","_ref$stopAutoCyclingO","stopAutoCyclingOnInteraction","currentImage","setCurrentImage","autoCycleId","prevImage","hasMoreThanOneImage","onRenderSkillCategory","category","skillCategory","skillCategoryColor","output","_Object$entries","entries","_Object$entries$_i","skillDetails","experience","getXPForLevel","onInputFocus","onInputBlur","spells","magicLevel","onSpellClick","setSpellShortcut","iconAtlasIMG","iconAtlasJSON","search","setSearch","spellsToDisplay","toLocaleLowerCase","setShortcut","Fragment","Brown","_ref$isDraggableModal","isDraggableModal","setSelectedTab","TabsCore","Gray","onGetContainerType","TimeClock","traderItems","characterAvailableGold","_useTradingGold","sum","setSum","Map","qtyMap","setQtyMap","hasGoldForSale","getFinalGold","getTradeItems","get","updateQuantity","set","newSum","useTradingGold","tradeItem","_qtyMap$get","Warrior","Sorcerer","Rogue"],"mappings":"yoPAIYA,iDCUCC,EAAuC,SAA5BC,WACtBC,UAAAA,WAASC,EAAG,OAAMA,EAClBC,EAAIH,EAAJG,KAAIC,EAAAJ,EACJK,MAAAA,WAAKD,EAAG,EAACA,EACTE,EA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CrrB,gBAACqB,GACCI,WAAYrC,oBAAYo8B,YACxBl6B,UAAWmiD,IACX7jD,cAAe,WAAF,OAAQk7B,EAAU6oB,kBAIjC3jD,gBAACqB,GAAOI,WAAYrC,oBAAYo8B,YAAa57B,cAAe+xB,kCC7F5B,SAArBryB,WAAwBkG,SAC3C,OAAOxF,gBAACW,IAAU6E,kBADiCD,EAAG,EAACA,GAAUjG,EAARkC,6K1BuKjB,SACxCwjC,GAAc,MACa,CAC3B74B,GAAIoM,OACJmtB,OAAQ,CACN18B,IAAKg8B,EACLW,MAAOC,iBAAeue,QACtBz9C,KAAM,YAERo/B,QAAS,CACP,CAAE98B,IAAKuP,OAAUotB,MAAOC,iBAAeC,MAAOn/B,KAAM,WACpD,CAAEsC,IAAKuP,OAAUotB,MAAOC,iBAAewe,SAAU19C,KAAM,WACvD,CAAEsC,IAAKuP,OAAUotB,MAAOC,iBAAeye,MAAO39C,KAAM,YAEtDq/B,QAAS,EACTtmC,KAAM,0CAIqC,SAC3CulC,GAAc,MACa,CAC3B74B,GAAIoM,OACJmtB,OAAQ,CACN18B,IAAKuP,OACLotB,MAAOC,iBAAeC,MACtBn/B,KAAM,cAERo/B,QAAS,CACP,CAAE98B,IAAKg8B,EAAQW,MAAOC,iBAAeue,QAASz9C,KAAM,YACpD,CAAEsC,IAAKuP,OAAUotB,MAAOC,iBAAewe,SAAU19C,KAAM,WACvD,CAAEsC,IAAKuP,OAAUotB,MAAOC,iBAAeye,MAAO39C,KAAM,YAEtDq/B,QAAS,EACTtmC,KAAM"}
|
|
1
|
+
{"version":3,"file":"long-bow.cjs.production.min.js","sources":["../src/components/Button.tsx","../src/components/Arrow/SelectArrow.tsx","../src/components/AsyncDropdown.tsx","../src/components/RPGUI/RPGUIContainer.tsx","../src/constants/uiFonts.ts","../src/components/shared/SpriteFromAtlas.tsx","../src/components/Item/Inventory/ErrorBoundary.tsx","../src/components/shared/Ellipsis.tsx","../src/components/PropertySelect/PropertySelect.tsx","../src/components/Character/CharacterSelection.tsx","../src/components/Chat/Chat.tsx","../src/constants/uiColors.ts","../src/components/Input.tsx","../src/components/shared/Column.tsx","../src/components/Chatdeprecated/ChatDeprecated.tsx","../src/components/ChatRevamp/SearchCharacter.tsx","../src/components/ChatRevamp/ChatContent.tsx","../src/components/ChatRevamp/ChatTabs.tsx","../src/components/ChatRevamp/ExpandButton.tsx","../src/components/ChatRevamp/RecentChats.tsx","../src/components/ChatRevamp/ChatRevamp.tsx","../src/components/Shortcuts/SingleShortcut.ts","../src/components/Shortcuts/useShortcutCooldown.ts","../src/components/CircularController/CircularController.tsx","../src/hooks/useOutsideAlerter.ts","../src/components/NPCDialog/NPCDialog.tsx","../src/components/DraggableContainer.tsx","../src/components/Dropdown.tsx","../src/components/Abstractions/ModalPortal.tsx","../src/components/Item/Inventory/ItemSlotRarity.ts","../src/components/Item/Inventory/ItemGem.tsx","../src/components/Item/Inventory/ItemSlotQty/ItemSlotQty.tsx","../src/components/Item/Inventory/ItemSlotRenderer.tsx","../src/components/Item/Inventory/itemContainerHelper.ts","../src/components/Item/Inventory/context/ItemSlotDetailsContext.tsx","../src/components/Item/Inventory/context/ItemSlotDraggingContext.tsx","../src/components/Item/Inventory/ItemSlot.tsx","../src/hooks/useTouchTarget.ts","../src/components/Item/Cards/ItemInfo.tsx","../src/components/Item/Cards/ItemInfoDisplay.tsx","../src/components/Item/Cards/ItemTooltip.tsx","../src/components/Item/Cards/MobileItemTooltip.tsx","../src/components/Item/Cards/ItemInfoWrapper.tsx","../src/libs/itemCounter.ts","../src/components/CraftBook/utils/modifyString.ts","../src/components/CraftBook/CraftingTooltip.tsx","../src/components/CraftBook/CraftingRecipe.tsx","../src/components/CraftBook/CraftBook.tsx","../src/components/DropdownSelectorContainer.tsx","../src/components/Item/Inventory/DraggedItem.tsx","../src/hooks/useCursorPosition.ts","../src/components/RelativeListMenu.tsx","../src/components/Item/Inventory/ItemSlotTooltips.tsx","../src/components/Equipment/EquipmentSet.tsx","../src/components/Table/Table.tsx","../src/components/Friends/SearchFriend.tsx","../src/components/Friends/FriendList.tsx","../src/constants/uiDevices.ts","../src/components/typography/DynamicText.tsx","../src/components/NPCDialog/NPCDialogText.tsx","../src/libs/StringHelpers.ts","../src/hooks/useEventListener.ts","../src/components/NPCDialog/QuestionDialog/QuestionDialog.tsx","../src/components/NPCDialog/NPCMultiDialog.tsx","../src/components/RangeSlider.tsx","../src/components/HistoryDialog.tsx","../src/components/ImageCarousel/ImageCarousel.tsx","../src/components/ImageCarousel/SimpleImageCarousel.tsx","../src/components/InternalTabs/InternalTabs.tsx","../src/components/Abstractions/SlotsContainer.tsx","../src/components/Shortcuts/ShortcutsSetter.tsx","../src/components/Marketplace/filters/index.tsx","../src/components/QuantitySelector/QuantitySelector.tsx","../src/components/QuantitySelector/QuantitySelectorModal.tsx","../src/components/Item/Inventory/ItemQuantitySelectorModal.tsx","../src/components/Item/Inventory/ItemContainer.tsx","../src/hooks/useScrollOnDrag.ts","../src/components/itemSelector/ItemSelector.tsx","../src/components/Leaderboard/LeaderboardTable.tsx","../src/components/Leaderboard/Leaderboard.tsx","../src/components/ListMenu.tsx","../src/components/Pager.tsx","../src/components/ConfirmModal.tsx","../src/components/Marketplace/MarketplaceRows.tsx","../src/components/Multitab/TabsContainer.tsx","../src/components/Marketplace/BuyPanel.tsx","../src/components/Marketplace/ManagmentPanel.tsx","../src/components/Marketplace/Marketplace.tsx","../src/components/Multitab/TabBody.tsx","../src/components/Multitab/Tab.tsx","../src/components/PartySystem/PartyCreate/PartyCreate.tsx","../src/components/PartySystem/PartyDashboard/PartyRows.tsx","../src/components/PartySystem/PartyDashboard/PartyDashboard.tsx","../src/components/PartySystem/PartyInvite/PlayersRows.tsx","../src/components/PartySystem/PartyInvite/PartyInvite.tsx","../src/components/Text/HighlightedText.tsx","../src/components/PartySystem/PartyManager/PartyManagerRows.tsx","../src/components/PartySystem/PartyManager/PartyManager.tsx","../src/components/PartySystem/mockedConstantes/mockedValues.tsx","../src/components/ProgressBar.tsx","../src/components/Quests/QuestInfo/QuestInfo.tsx","../src/components/Quests/QuestList.tsx","../src/components/RPGUI/RPGUIScrollbar.tsx","../src/components/RPGUI/RPGUIOverrides.tsx","../src/components/RPGUI/RPGUIRoot.tsx","../src/components/Shortcuts/Shortcuts.tsx","../src/components/SimpleProgressBar.tsx","../src/components/Tooltip/Tooltip.tsx","../src/components/SkillProgressBar.tsx","../src/components/SkillsContainer.tsx","../src/components/Spellbook/cards/SpellInfo.tsx","../src/libs/CastingTypeHelper.ts","../src/components/Spellbook/cards/SpellInfoDisplay.tsx","../src/components/Spellbook/cards/MobileSpellTooltip.tsx","../src/components/Spellbook/cards/SpellTooltip.tsx","../src/components/Spellbook/cards/SpellInfoWrapper.tsx","../src/components/Spellbook/Spell.tsx","../src/components/Spellbook/Spellbook.tsx","../src/components/Stepper.tsx","../src/components/TimeWidget/DayNightPeriod/DayNightPeriod.tsx","../src/components/TimeWidget/TimeWidget.tsx","../src/components/TradingMenu/PremiumLabel.tsx","../src/components/TradingMenu/TradingItemRow.tsx","../src/components/TradingMenu/TradingMenu.tsx","../src/components/Truncate.tsx","../src/components/Image/ZoomableImage.tsx","../src/components/Tutorial/TutorialStepper.tsx","../src/hooks/useChat.ts","../src/components/CheckButton.tsx","../src/components/CheckItem.tsx","../src/hooks/useLocalStorage.ts","../src/components/CraftBook/utils/calculateMaxCraftable.ts","../src/components/RadioButton.tsx","../src/components/TextArea.tsx","../src/components/TradingMenu/useTradingGold.ts"],"sourcesContent":["import React from 'react';\nimport styled from 'styled-components';\nimport { uiFonts } from '../constants/uiFonts';\n\nexport enum ButtonTypes {\n RPGUIButton = 'rpgui-button',\n RPGUIGoldButton = 'rpgui-button golden',\n}\n\nexport interface IButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n disabled?: boolean;\n children: React.ReactNode;\n buttonType: ButtonTypes;\n onPointerDown?: (e: any) => void;\n}\n\nexport const Button = ({\n disabled = false,\n children,\n buttonType,\n onPointerDown,\n ...props\n}: IButtonProps) => {\n return (\n <ButtonContainer\n className={`${buttonType}`}\n disabled={disabled}\n {...props}\n onPointerDown={onPointerDown}\n >\n <p>{children}</p>\n </ButtonContainer>\n );\n};\n\nconst ButtonContainer = styled.button`\n height: 45px;\n font-size: ${uiFonts.size.small};\n`;\n","import React from 'react';\nimport styled from 'styled-components';\nimport LeftArrowClickIcon from './img/arrow01-left-clicked.png';\nimport LeftArrowIcon from './img/arrow01-left.png';\nimport RightArrowClickIcon from './img/arrow01-right-clicked.png';\nimport RightArrowIcon from './img/arrow01-right.png';\n\nexport interface ArrowBarProps extends React.HTMLAttributes<HTMLDivElement> {\n direction: 'right' | 'left';\n onPointerDown: () => void;\n size?: number;\n scale?: number;\n}\n\nexport const SelectArrow: React.FC<ArrowBarProps> = ({\n direction = 'left',\n size,\n scale = 1,\n onPointerDown,\n ...props\n}) => {\n return (\n <>\n {direction === 'left' ? (\n <LeftArrow\n size={size}\n scale={scale}\n onPointerDown={() => onPointerDown()}\n {...props}\n ></LeftArrow>\n ) : (\n <RightArrow\n size={size}\n scale={scale}\n onPointerDown={() => onPointerDown()}\n {...props}\n ></RightArrow>\n )}\n </>\n );\n};\n\ninterface IArrowProps {\n size?: number;\n scale?: number;\n}\n\nconst LeftArrow = styled.span<IArrowProps>`\n background-image: url(${LeftArrowIcon});\n background-size: 100% 100%;\n left: 0;\n position: absolute;\n width: ${props => props.size || 40}px;\n height: ${props => props.size || 42}px;\n transform: scale(${props => props.scale || 1});\n :active {\n background-image: url(${LeftArrowClickIcon});\n }\n z-index: 2;\n`;\n\nconst RightArrow = styled.span<IArrowProps>`\n background-image: url(${RightArrowIcon});\n right: 0;\n position: absolute;\n width: ${props => props.size || 40}px;\n height: ${props => props.size || 42}px;\n background-size: 100% 100%;\n transform: scale(${props => props.scale || 1});\n :active {\n background-image: url(${RightArrowClickIcon});\n }\n z-index: 2;\n`;\n\nexport default SelectArrow;\n","import React, { useEffect, useState } from 'react';\nimport { BeatLoader } from 'react-spinners';\nimport styled from 'styled-components';\nimport { v4 as uuidv4 } from 'uuid';\nimport { uiColors } from '../constants/uiColors';\n\nexport interface IAsyncDropdownOptionsProps {\n id: number;\n value: string;\n option: string | JSX.Element;\n}\n\nexport interface IAsyncDropdownProps {\n options: IAsyncDropdownOptionsProps[];\n width?: string;\n onChange: (value: string) => void;\n defaultValue?: string;\n opensUp?: boolean;\n}\n\nexport const AsyncDropdown: React.FC<IAsyncDropdownProps> = ({\n options,\n width,\n onChange,\n defaultValue,\n opensUp = false,\n}) => {\n const dropdownId = uuidv4();\n\n const [selectedValue, setSelectedValue] = useState<string>(\n defaultValue || options?.[0]?.value\n );\n const [selectedOption, setSelectedOption] = useState<string | JSX.Element>(\n options?.find(option => option.value === defaultValue)?.option ||\n options?.[0]?.option\n );\n const [opened, setOpened] = useState<boolean>(false);\n\n useEffect(() => {\n if (defaultValue) {\n setSelectedValue(defaultValue);\n setSelectedOption(\n //@ts-ignore\n options?.find(option => option.value === defaultValue)?.option\n );\n } else if (options?.length > 0) {\n setSelectedValue(options[0].value);\n setSelectedOption(options[0].option);\n }\n }, [options, defaultValue]);\n\n const handleSelection = (value: string, option: string | JSX.Element) => {\n if (value !== selectedValue) {\n setSelectedValue(value);\n setSelectedOption(option);\n onChange(value);\n }\n };\n\n return (\n <Container onMouseLeave={() => setOpened(false)} width={width}>\n <DropdownSelect\n id={`dropdown-${dropdownId}`}\n className=\"rpgui-dropdown-imp rpgui-dropdown-imp-header\"\n onPointerUp={() => setOpened(prev => !prev)}\n >\n <DropdownDisplay>\n <DropdownLabel>▼</DropdownLabel> {selectedOption}\n {!options.length && <BeatLoader size={4} color={uiColors.white} />}\n </DropdownDisplay>\n </DropdownSelect>\n\n <DropdownOptions\n className=\"rpgui-dropdown-imp\"\n opened={opened}\n opensUp={opensUp}\n >\n {options?.map(option => (\n <li\n key={option.id}\n onPointerUp={() => {\n handleSelection(option.value, option.option);\n setOpened(false);\n }}\n >\n {option.option}\n </li>\n ))}\n </DropdownOptions>\n </Container>\n );\n};\n\nconst DropdownDisplay = styled.span`\n display: flex;\n flex-wrap: wrap;\n justify-content: start;\n align-items: center;\n`;\n\nconst DropdownLabel = styled.label`\n margin-right: 0.5rem;\n`;\n\nconst Container = styled.div<{ width: string | undefined }>`\n position: relative;\n width: ${props => props.width || '100%'};\n`;\n\nconst DropdownSelect = styled.p`\n width: 100%;\n box-sizing: border-box;\n\n label {\n display: inline-block;\n transform: translateY(-2px);\n }\n`;\n\nconst DropdownOptions = styled.ul<{\n opened: boolean;\n opensUp: boolean;\n}>`\n position: absolute;\n width: 100%;\n max-height: 300px;\n overflow-y: auto;\n display: ${props => (props.opened ? 'block' : 'none')};\n box-sizing: border-box;\n bottom: ${props => (props.opensUp ? '100%' : 'auto')};\n top: ${props => (props.opensUp ? 'auto' : '100%')};\n margin: 0;\n padding: 0;\n\n @media (max-width: 768px) {\n padding: 8px 0;\n }\n`;\n","import React from 'react';\nimport styled from 'styled-components';\n\nexport enum RPGUIContainerTypes {\n Framed = 'framed',\n FramedGold = 'framed-golden',\n FramedGold2 = 'framed-golden-2',\n FramedGrey = 'framed-grey',\n}\nexport interface IRPGUIContainerProps {\n type: RPGUIContainerTypes;\n children: React.ReactNode;\n width?: string;\n height?: string;\n className?: string;\n}\n\nexport const RPGUIContainer: React.FC<IRPGUIContainerProps> = ({\n children,\n type,\n width = '50%',\n height,\n className,\n}) => {\n return (\n <Container\n width={width}\n height={height || 'auto'}\n className={`rpgui-container ${type} ${className}`}\n >\n {children}\n </Container>\n );\n};\n\ninterface IContainerProps {\n width: string;\n height: string;\n}\n\nconst Container = styled.div<IContainerProps>`\n height: ${props => props.height};\n width: ${({ width }) => width};\n display: flex;\n flex-wrap: wrap;\n image-rendering: pixelated;\n`;\n","export const uiFonts = {\n size: {\n xxsmall: '8px',\n xsmall: '9px',\n small: '12px',\n medium: '14px',\n large: '16px',\n xLarge: '18px',\n xxLarge: '20px',\n xxxLarge: '24px',\n },\n};\n","import { GRID_HEIGHT, GRID_WIDTH } from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\n\ninterface IProps {\n atlasJSON: any;\n atlasIMG: any;\n spriteKey: string;\n width?: number;\n height?: number;\n grayScale?: boolean;\n opacity?: number;\n onPointerDown?: () => void;\n containerStyle?: any;\n imgStyle?: any;\n imgScale?: number;\n imgClassname?: string;\n centered?: boolean;\n borderRadius?: string;\n}\n\nexport const SpriteFromAtlas: React.FC<IProps> = ({\n atlasJSON,\n atlasIMG,\n spriteKey,\n width = GRID_WIDTH,\n height = GRID_HEIGHT,\n imgScale = 2,\n imgStyle,\n onPointerDown,\n containerStyle,\n grayScale = false,\n opacity = 1,\n imgClassname,\n centered,\n borderRadius,\n}) => {\n //! If an item is not showing, remember that you MUST run yarn atlas:copy everytime you add a new item to the atlas (it will sync our public folder atlas with src/atlas).\n //!Due to React's limitations, we cannot import it from the public folder directly!\n\n const spriteData =\n atlasJSON?.frames?.[spriteKey] ||\n atlasJSON?.frames?.['others/no-image.png'];\n\n if (!spriteData) {\n console.error(\n `SpriteFromAtlas: Could not find sprite with key ${spriteKey} in atlasJSON.`\n );\n return null;\n }\n\n return (\n <Container\n width={width}\n height={height}\n hasHover={grayScale}\n onPointerDown={onPointerDown}\n style={containerStyle}\n >\n <ImgSprite\n className={`sprite-from-atlas-img ${imgClassname || ''}`}\n atlasIMG={atlasIMG}\n frame={spriteData.frame}\n scale={imgScale}\n grayScale={grayScale}\n opacity={opacity}\n style={imgStyle}\n centered={centered}\n borderRadius={borderRadius}\n />\n </Container>\n );\n};\n\ninterface IImgSpriteProps {\n atlasIMG: any;\n frame: {\n x: number;\n y: number;\n w: number;\n h: number;\n };\n scale: number;\n grayScale: boolean;\n opacity: number;\n centered?: boolean;\n borderRadius?: string;\n}\n\ninterface IContainerProps {\n width: number;\n height: number;\n hasHover: boolean;\n}\n\nconst Container = styled.div`\n width: ${(props: IContainerProps) => props.width}px;\n height: ${(props: IContainerProps) => props.height}px;\n ${(props: IContainerProps) =>\n !props.hasHover\n ? `&:hover {\n filter: sepia(100%) saturate(300%) brightness(70%) hue-rotate(180deg);\n }`\n : ``}\n`;\n\nconst ImgSprite = styled.div<IImgSpriteProps>`\n width: ${props => props.frame.w}px;\n height: ${props => props.frame.h}px;\n background-image: url(${props => props.atlasIMG});\n background-position: -${props => props.frame.x}px -${props => props.frame.y}px;\n transform: scale(${props => props.scale});\n position: relative;\n top: ${props => (props.centered ? '0' : '8px')};\n left: ${props => (props.centered ? '0' : '8px')};\n filter: ${props => (props.grayScale ? 'grayscale(100%)' : 'none')};\n opacity: ${props => props.opacity};\n border-radius: ${props => (props.borderRadius ? props.borderRadius : '0')};\n`;\n","import React, { Component, ErrorInfo, ReactNode } from 'react';\nimport atlasJSON from '../../../mocks/atlas/items/items.json';\nimport atlasIMG from '../../../mocks/atlas/items/items.png';\nimport { SpriteFromAtlas } from '../../shared/SpriteFromAtlas';\n\ninterface Props {\n children?: ReactNode;\n}\n\ninterface State {\n hasError: boolean;\n}\n\nexport class ErrorBoundary extends Component<Props, State> {\n public state: State = {\n hasError: false,\n };\n\n public static getDerivedStateFromError(_: Error): State {\n // Update state so the next render will show the fallback UI.\n return { hasError: true };\n }\n\n public componentDidCatch(error: Error, errorInfo: ErrorInfo) {\n console.error('Uncaught error:', error, errorInfo);\n }\n\n public render() {\n if (this.state.hasError) {\n return (\n <SpriteFromAtlas\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={'others/no-image.png'}\n imgScale={3}\n />\n );\n }\n\n return this.props.children;\n }\n}\n","import React from 'react';\nimport styled from 'styled-components';\n\ninterface IProps {\n children: React.ReactNode;\n maxLines?: 1 | 2 | 3;\n maxWidth: string;\n fontSize?: string;\n center?: boolean;\n}\n\nexport const Ellipsis = ({\n children,\n maxLines = 1,\n maxWidth,\n fontSize,\n center,\n}: IProps) => {\n return (\n <Container maxWidth={maxWidth} fontSize={fontSize} center={center}>\n <span className={`ellipsis-${maxLines}-lines`}>{children}</span>\n </Container>\n );\n};\n\ninterface IContainerProps {\n maxWidth?: string;\n fontSize?: string;\n center?: boolean;\n}\n\nconst Container = styled.span<IContainerProps>`\n display: block;\n margin: 0;\n\n .ellipsis-1-lines {\n display: block;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n max-width: ${props => props.maxWidth};\n font-size: ${props => props.fontSize};\n\n ${props => props.center && `margin: 0 auto;`}\n }\n\n .ellipsis-2-lines {\n display: block;\n display: -webkit-box;\n max-width: ${props => props.maxWidth}px;\n\n height: 25px;\n margin: 0 auto;\n line-height: 1;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n text-overflow: ellipsis;\n overflow: hidden;\n font-size: ${props => props.fontSize};\n }\n\n .ellipsis-3-lines {\n display: block;\n display: -webkit-box;\n max-width: ${props => props.maxWidth}px;\n\n height: 43px;\n margin: 0 auto;\n line-height: 1;\n -webkit-line-clamp: 3;\n -webkit-box-orient: vertical;\n text-overflow: ellipsis;\n overflow: hidden;\n font-size: ${props => props.fontSize};\n }\n`;\n","import React, { useEffect, useState } from 'react';\nimport styled from 'styled-components';\nimport { uiFonts } from '../../constants/uiFonts';\nimport SelectArrow from '../Arrow/SelectArrow';\nimport { Ellipsis } from '../shared/Ellipsis';\n\nexport interface IPropertySelectProps {\n availableProperties: Array<IPropertiesProps>;\n selectedProperty?: IPropertiesProps;\n children?: React.ReactNode;\n onChange: (selectedProperty: IPropertiesProps) => void;\n}\n\nexport interface IPropertiesProps {\n id: string;\n name: string;\n}\n\nexport const PropertySelect: React.FC<IPropertySelectProps> = ({\n availableProperties,\n onChange,\n}) => {\n const [currentIndex, setCurrentIndex] = useState(0);\n const propertiesLength = availableProperties.length - 1;\n\n const onLeftClick = () => {\n if (currentIndex === 0) setCurrentIndex(propertiesLength);\n else setCurrentIndex(index => index - 1);\n };\n const onRightClick = () => {\n if (currentIndex === propertiesLength) setCurrentIndex(0);\n else setCurrentIndex(index => index + 1);\n };\n\n useEffect(() => {\n onChange(availableProperties[currentIndex]);\n }, [currentIndex]);\n\n useEffect(() => {\n setCurrentIndex(0);\n }, [JSON.stringify(availableProperties)]);\n\n const getCurrentSelectionName = () => {\n const item = availableProperties[currentIndex];\n if (item) {\n return item.name;\n }\n return '';\n };\n\n return (\n <Container>\n <TextOverlay>\n <p>\n <Item>\n <Ellipsis maxLines={1} maxWidth=\"60%\" center>\n {getCurrentSelectionName()}\n </Ellipsis>\n </Item>\n </p>\n </TextOverlay>\n <div className=\"rpgui-progress-track\"></div>\n\n <SelectArrow direction=\"left\" onPointerDown={onLeftClick}></SelectArrow>\n <SelectArrow direction=\"right\" onPointerDown={onRightClick}></SelectArrow>\n </Container>\n );\n};\n\nconst Item = styled.span`\n font-size: 1rem;\n color: white;\n text-align: center;\n z-index: 1;\n position: absolute;\n top: 12px;\n width: 100%;\n\n p {\n margin: 0 auto;\n font-size: ${uiFonts.size.small};\n }\n`;\n\nconst TextOverlay = styled.div`\n width: 100%;\n position: relative;\n`;\n\ninterface IContainerProps {\n percentageWidth?: number;\n minWidth?: number;\n style?: Record<string, any>;\n}\n\nconst Container = styled.div<IContainerProps>`\n position: relative;\n display: flex;\n flex-direction: column;\n justify-content: start;\n align-items: flex-start;\n min-width: 100px;\n width: 40%;\n`;\n\nexport default PropertySelect;\n","import React, { useEffect, useState } from 'react';\nimport styled from 'styled-components';\n\nimport { SpriteFromAtlas } from '../shared/SpriteFromAtlas';\n\nimport { ErrorBoundary } from '../Item/Inventory/ErrorBoundary';\nimport PropertySelect, {\n IPropertiesProps,\n} from '../PropertySelect/PropertySelect';\n\nexport interface ICharacterProps {\n name: string;\n textureKey: string;\n}\n\nexport interface ICharacterSelectionProps {\n availableCharacters: ICharacterProps[];\n atlasJSON: any;\n atlasIMG: any;\n onChange: (textureKey: string) => void;\n}\n\nexport const CharacterSelection: React.FC<ICharacterSelectionProps> = ({\n availableCharacters,\n atlasJSON,\n atlasIMG,\n onChange,\n}) => {\n const propertySelectValues = availableCharacters.map((item) => {\n return {\n id: item.textureKey,\n name: item.name,\n };\n });\n\n const [selectedValue, setSelectedValue] = useState<IPropertiesProps>();\n const [selectedSpriteKey, setSelectedSpriteKey] = useState('');\n\n const onSelectedValueChange = () => {\n const textureKey = selectedValue ? selectedValue.id : '';\n const spriteKey = textureKey ? textureKey + '/down/standing/0.png' : '';\n\n if (spriteKey === selectedSpriteKey) {\n return;\n }\n\n setSelectedSpriteKey(spriteKey);\n onChange(textureKey);\n };\n\n useEffect(() => {\n onSelectedValueChange();\n }, [selectedValue]);\n\n useEffect(() => {\n setSelectedValue(propertySelectValues[0]);\n }, [availableCharacters]);\n\n return (\n <Container>\n {selectedSpriteKey && atlasIMG && atlasJSON && (\n <ErrorBoundary>\n <SpriteFromAtlas\n spriteKey={selectedSpriteKey}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n imgScale={4}\n height={80}\n width={64}\n containerStyle={{\n display: 'flex',\n alignItems: 'center',\n paddingBottom: '15px',\n }}\n imgStyle={{\n left: '22px',\n }}\n />\n </ErrorBoundary>\n )}\n <PropertySelect\n availableProperties={propertySelectValues}\n onChange={(value) => {\n setSelectedValue(value);\n }}\n />\n </Container>\n );\n};\n\nconst Container = styled.div`\n display: flex;\n flex-direction: column;\n align-items: center;\n image-rendering: pixelated;\n`;\n\nexport default CharacterSelection;\n","import dayjs from 'dayjs';\nimport React, { useEffect, useRef, useState } from 'react';\nimport { ErrorBoundary } from 'react-error-boundary';\nimport { FaTimes } from 'react-icons/fa';\nimport styled from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\nimport { ChatMessage } from '../ChatRevamp/types';\n\nexport interface IStyles {\n textColor?: string;\n buttonColor?: string;\n buttonBackgroundColor?: string;\n width?: string;\n height?: string;\n}\n\nexport interface IEmitter {\n _id: string;\n name: string;\n}\n\nexport interface IChatProps {\n chatMessages: ChatMessage[];\n onSendChatMessage: (message: string) => void;\n onCloseButton: () => void;\n onFocus?: () => void;\n onBlur?: () => void;\n opacity?: number;\n sendMessage: boolean;\n styles?: IStyles;\n isExpanded: boolean;\n}\n\nexport const Chat: React.FC<IChatProps> = ({\n chatMessages,\n onSendChatMessage,\n onCloseButton,\n onFocus,\n onBlur,\n styles = {\n textColor: '#ff6600',\n buttonColor: '#ff6600',\n buttonBackgroundColor: '#333',\n width: '100%',\n height: '100%',\n },\n isExpanded,\n}) => {\n const [message, setMessage] = useState('');\n const inputRef = useRef<HTMLInputElement>(null);\n\n useEffect(() => {\n if (isExpanded) {\n scrollChatToBottom();\n }\n inputRef.current?.focus();\n }, [chatMessages, isExpanded]);\n\n const scrollChatToBottom = () => {\n const scrollingElement = document.querySelector('.chat-body');\n if (scrollingElement) {\n scrollingElement.scrollTop = scrollingElement.scrollHeight;\n }\n };\n\n const handleSubmit = (event: React.FormEvent<HTMLFormElement>) => {\n event.preventDefault();\n if (!message.trim()) return;\n onSendChatMessage(message);\n setMessage('');\n };\n\n const truncateName = (name: string, maxLength: number = 10) => {\n return name.length > maxLength ? name.slice(0, maxLength) + '...' : name;\n };\n\n const formatMessage = (chatMessage: ChatMessage) => {\n const timestamp = dayjs(chatMessage.createdAt).format('HH:mm');\n const truncatedName = truncateName(chatMessage.emitter.name);\n return `${timestamp} ${truncatedName}: ${chatMessage.message}`;\n };\n\n return (\n <ChatContainer\n width={styles.width || 'auto'}\n height={styles.height || 'auto'}\n isExpanded={isExpanded}\n >\n {isExpanded && (\n <ErrorBoundary fallback={<p>Oops! Your chat has crashed.</p>}>\n <CloseButton onClick={onCloseButton}>\n <FaTimes />\n </CloseButton>\n <MessagesContainer className=\"chat-body\">\n {chatMessages.map((chatMessage, index) => (\n <Message\n color={styles.textColor || uiColors.yellow}\n key={`${chatMessage._id}_${index}`}\n >\n {formatMessage(chatMessage)}\n </Message>\n ))}\n </MessagesContainer>\n </ErrorBoundary>\n )}\n <Form onSubmit={handleSubmit} isExpanded={isExpanded}>\n <TextField\n ref={inputRef}\n value={message}\n onChange={e => setMessage(e.target.value)}\n type=\"text\"\n autoComplete=\"off\"\n onFocus={onFocus}\n onBlur={onBlur}\n onPointerDown={onFocus}\n placeholder=\"Type your message...\"\n />\n <SendButton type=\"submit\" disabled={!message.trim()}>\n ▶\n </SendButton>\n </Form>\n </ChatContainer>\n );\n};\n\ninterface IContainerProps {\n width: string;\n height: string;\n}\n\ninterface IMessageProps {\n color: string;\n}\n\nconst ChatContainer = styled.div<IContainerProps & { isExpanded: boolean }>`\n width: ${props => props.width};\n height: ${props => (props.isExpanded ? props.height : 'auto')};\n background-color: rgba(30, 30, 30, 0.3);\n display: flex;\n flex-direction: column;\n position: relative;\n border-radius: 8px;\n border: 1px solid rgba(0, 0, 0, 0.1);\n overflow: hidden;\n`;\n\nconst CloseButton = styled.button`\n position: absolute;\n top: 8px;\n right: 8px;\n background-color: transparent;\n border: none;\n color: white;\n font-size: 16px;\n cursor: pointer;\n z-index: 1;\n`;\n\nconst MessagesContainer = styled.div`\n flex-grow: 1;\n overflow-y: auto;\n padding: 12px;\n margin-bottom: 8px;\n\n scrollbar-width: thin;\n scrollbar-color: rgba(51, 51, 51, 0.4) rgba(30, 30, 30, 0.4);\n\n &::-webkit-scrollbar {\n width: 6px;\n }\n\n &::-webkit-scrollbar-track {\n background: rgba(30, 30, 30, 0.4);\n }\n\n &::-webkit-scrollbar-thumb {\n background-color: rgba(51, 51, 51, 0.4);\n border-radius: 3px;\n }\n`;\n\nconst Message = styled.div<IMessageProps>`\n margin-bottom: 6px;\n color: ${({ color }) => color};\n font-family: 'Press Start 2P', cursive;\n font-size: 0.7rem;\n line-height: 1.4;\n word-break: break-word;\n`;\n\nconst Form = styled.form<{ isExpanded: boolean }>`\n display: flex;\n padding: 8px;\n background-color: rgba(42, 42, 42, 0.4);\n border-radius: ${props => (props.isExpanded ? '0' : '8px')};\n`;\n\nconst TextField = styled.input`\n flex-grow: 1;\n background-color: rgba(26, 26, 26, 0.6);\n color: #ff6600;\n border: 1px solid rgba(51, 51, 51, 0.6);\n border-radius: 4px;\n padding: 8px;\n margin-right: 8px;\n font-family: 'Press Start 2P', cursive;\n font-size: 0.7rem;\n height: 32px;\n transition: border-color 0.3s, background-color 0.3s;\n\n &::placeholder {\n color: rgba(255, 255, 255, 0.5);\n font-size: 0.6rem;\n }\n\n &:focus {\n outline: none;\n border-color: #ff6600;\n background-color: rgba(42, 42, 42, 0.9);\n }\n`;\n\nconst SendButton = styled.button`\n background-color: transparent;\n color: #ff6600;\n border: none;\n padding: 8px 12px;\n font-size: 14px;\n cursor: pointer;\n transition: opacity 0.3s ease;\n\n &:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n`;\n","export const uiColors = {\n lightGray: '#888',\n gray: '#4E4A4E',\n darkGray: '#3e3e3e',\n darkYellow: '#FFC857',\n yellow: '#FFFF00',\n orange: '#D27D2C',\n cardinal: '#C5283D',\n red: '#D04648',\n darkRed: '#442434',\n raisinBlack: '#191923',\n navyBlue: '#0E79B2',\n purple: '#6833A3',\n darkPurple: '#522761',\n blue: '#597DCE',\n darkBlue: '#30346D',\n brown: '#854C30',\n lightGreen: '#66cd1c',\n brownGreen: '#346524',\n white: '#fff'\n};\n","import React from 'react';\n\nexport interface IInputProps\n extends React.DetailedHTMLProps<\n React.InputHTMLAttributes<HTMLInputElement>,\n HTMLInputElement\n > {\n innerRef?: React.Ref<HTMLInputElement>;\n}\n\nexport const Input: React.FC<IInputProps> = ({ ...props }) => {\n const { innerRef, ...rest } = props;\n\n return <input {...rest} ref={props.innerRef} />;\n};\n","import styled from 'styled-components';\n\ninterface IColumn {\n flex?: number;\n alignItems?: string;\n justifyContent?: string;\n flexWrap?: string;\n}\n\nexport const Column = styled.div<IColumn>`\n flex: ${props => props.flex || 'auto'};\n display: flex;\n flex-wrap: ${props => props.flexWrap || 'nowrap'};\n align-items: ${props => props.alignItems || 'flex-start'};\n justify-content: ${props => props.justifyContent || 'flex-start'};\n`;\n","import { ILocalChatMessage } from '@rpg-engine/shared';\nimport dayjs from 'dayjs';\nimport React, { useEffect, useState } from 'react';\nimport { ErrorBoundary } from 'react-error-boundary';\nimport styled from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\nimport { uiFonts } from '../../constants/uiFonts';\nimport { Button, ButtonTypes } from '../Button';\nimport { Input } from '../Input';\nimport { RPGUIContainer, RPGUIContainerTypes } from '../RPGUI/RPGUIContainer';\nimport { Column } from '../shared/Column';\n\ninterface IEmitter {\n _id: string;\n name: string;\n}\nexport interface IChatDeprecatedProps {\n chatMessages: ILocalChatMessage[];\n onSendChatMessage: (message: string) => void;\n onCloseButton: () => void;\n onFocus?: () => void;\n onBlur?: () => void;\n opacity?: number;\n width?: string;\n height?: string;\n}\n\nexport const ChatDeprecated: React.FC<IChatDeprecatedProps> = ({\n chatMessages,\n onSendChatMessage,\n opacity = 1,\n width = '100%',\n height = '250px',\n onCloseButton,\n onFocus,\n onBlur,\n}) => {\n const [message, setMessage] = useState('');\n\n useEffect(() => {\n scrollChatToBottom();\n }, []);\n\n useEffect(() => {\n scrollChatToBottom();\n }, [chatMessages]);\n\n const scrollChatToBottom = () => {\n const scrollingElement = document.querySelector('.chat-body');\n if (scrollingElement) {\n scrollingElement.scrollTop = scrollingElement.scrollHeight;\n }\n };\n\n const handleSubmit = (event: React.SyntheticEvent<HTMLFormElement>) => {\n event.preventDefault();\n onSendChatMessage(message);\n setMessage('');\n };\n const getInputValue = (value: string) => {\n setMessage(value);\n };\n\n const onRenderMessageLines = (\n emitter: IEmitter,\n createdAt: string | undefined,\n message: string\n ) => {\n return `${dayjs(createdAt || new Date()).format('HH:mm')} ${\n emitter?.name ? `${emitter.name}: ` : 'Unknown: '\n } ${message}`;\n };\n\n const onRenderChatMessages = (chatMessages: ILocalChatMessage[]) => {\n return chatMessages?.length ? (\n chatMessages?.map(({ _id, createdAt, emitter, message }, index) => (\n <MessageText key={`${_id}_${index}`}>\n {onRenderMessageLines(emitter, createdAt as string, message)}\n </MessageText>\n ))\n ) : (\n <MessageText>No messages available.</MessageText>\n );\n };\n\n return (\n <Container>\n <CustomContainer\n type={RPGUIContainerTypes.FramedGrey}\n width={width}\n height={height}\n className=\"chat-container\"\n opacity={opacity}\n >\n <ErrorBoundary fallback={<p>Oops! Your chat has crashed.</p>}>\n {onCloseButton && (\n <CloseButton onPointerDown={onCloseButton}>X</CloseButton>\n )}\n <RPGUIContainer\n type={RPGUIContainerTypes.FramedGrey}\n width={'100%'}\n height={'80%'}\n className=\"chat-body dark-background\"\n >\n {onRenderChatMessages(chatMessages)}\n </RPGUIContainer>\n\n <Form onSubmit={handleSubmit}>\n <Column flex={70}>\n <CustomInput\n value={message}\n id=\"inputMessage\"\n onChange={e => getInputValue(e.target.value)}\n height={20}\n className=\"chat-input dark-background\"\n type=\"text\"\n autoComplete=\"off\"\n onFocus={onFocus}\n onBlur={onBlur}\n />\n </Column>\n <Column justifyContent=\"flex-end\">\n <Button\n buttonType={ButtonTypes.RPGUIButton}\n id=\"chat-send-button\"\n >\n Send\n </Button>\n </Column>\n </Form>\n </ErrorBoundary>\n </CustomContainer>\n </Container>\n );\n};\n\nconst Container = styled.div`\n position: relative;\n`;\n\nconst CloseButton = styled.div`\n position: absolute;\n top: 2px;\n right: 0px;\n color: white;\n z-index: 22;\n font-size: 0.7rem;\n`;\n\nconst CustomInput = styled(Input)`\n height: 30px;\n width: 100%;\n\n .rpgui-content .input {\n min-height: 39px;\n }\n`;\n\ninterface ICustomContainerProps {\n opacity: number;\n}\n\nconst CustomContainer = styled(RPGUIContainer)`\n display: block;\n\n opacity: ${(props: ICustomContainerProps) => props.opacity};\n\n &:hover {\n opacity: 1;\n }\n\n .dark-background {\n background-color: ${uiColors.darkGray} !important;\n }\n\n .chat-body {\n &.rpgui-container.framed-grey {\n background: unset;\n }\n max-height: 170px;\n overflow-y: auto;\n }\n`;\n\nconst Form = styled.form`\n display: flex;\n width: 100%;\n justify-content: center;\n align-items: center;\n`;\n\nconst MessageText = styled.p`\n display: block !important;\n width: 100%;\n font-size: ${uiFonts.size.xsmall} !important;\n overflow-y: auto;\n margin: 0;\n`;\n","import React, { useEffect, useRef, useState } from 'react';\nimport { RxMagnifyingGlass } from 'react-icons/rx';\nimport styled from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\nimport { uiFonts } from '../../constants/uiFonts';\nimport { IStyles } from '../Chat/Chat';\nimport { Column } from '../shared/Column';\nimport { Ellipsis } from '../shared/Ellipsis';\nimport { PrivateChatCharacter } from './types';\n\ninterface ISearchCharacterProps {\n onFocus?: () => void;\n onBlur?: () => void;\n onChangeCharacterName: (characterName: string) => void;\n styles?: IStyles;\n recentCharacters?: PrivateChatCharacter[];\n onCharacterClick?: (character: PrivateChatCharacter) => void;\n hideSearchCharacterUI: () => void;\n}\n\nexport const SearchCharacter = ({\n onChangeCharacterName,\n onBlur,\n onFocus,\n recentCharacters,\n hideSearchCharacterUI,\n onCharacterClick,\n styles = {\n textColor: '#c65102',\n buttonColor: '#005b96',\n buttonBackgroundColor: 'rgba(0,0,0,.2)',\n width: '80%',\n height: 'auto',\n },\n}: ISearchCharacterProps) => {\n const [characterName, setCharacterName] = useState('');\n const searchCharacterRef = useRef<HTMLInputElement>(null);\n\n useEffect(() => {\n const timer = setTimeout(() => {\n if (searchCharacterRef.current) {\n searchCharacterRef.current.focus();\n }\n }, 100);\n\n return () => clearTimeout(timer);\n }, []);\n\n const handleSubmit = (event: React.SyntheticEvent<HTMLFormElement>) => {\n event.preventDefault();\n if (!characterName || characterName.trim() === '') return;\n onChangeCharacterName(characterName);\n };\n\n const handleCharacterClick = (character: PrivateChatCharacter) => {\n if (!onCharacterClick) return;\n setCharacterName('');\n onCharacterClick(character);\n hideSearchCharacterUI();\n };\n\n return (\n <SearchContainer>\n <Form onSubmit={handleSubmit}>\n <Column flex={70}>\n <TextField\n value={characterName}\n ref={searchCharacterRef}\n id=\"characterName\"\n name=\"characterName\"\n onChange={e => {\n setCharacterName(e.target.value);\n onChangeCharacterName(e.target.value);\n }}\n placeholder=\"Search for a character...\"\n height={20}\n type=\"text\"\n autoComplete=\"off\"\n onFocus={onFocus}\n onBlur={onBlur}\n onPointerDown={onFocus}\n />\n </Column>\n <Column justifyContent=\"flex-end\">\n <SearchButton\n type=\"submit\"\n buttonColor={styles?.buttonColor || '#005b96'}\n buttonBackgroundColor={\n styles?.buttonBackgroundColor || 'rgba(0,0,0,.5)'\n }\n id=\"chat-send-button\"\n style={{ borderRadius: '20%' }}\n >\n <RxMagnifyingGlass size={15} />\n </SearchButton>\n </Column>\n </Form>\n\n {recentCharacters && recentCharacters.length > 0 && (\n <ListContainer>\n {recentCharacters.map(character => (\n <ListElement\n onPointerDown={() => handleCharacterClick(character)}\n key={character._id}\n >\n <Ellipsis maxWidth=\"150px\" maxLines={1}>\n {character.name}\n </Ellipsis>\n </ListElement>\n ))}\n </ListContainer>\n )}\n </SearchContainer>\n );\n};\n\ninterface IButtonProps {\n buttonColor: string;\n buttonBackgroundColor: string;\n}\n\nconst SearchContainer = styled.div`\n width: 100%;\n`;\n\nconst Form = styled.form`\n display: flex;\n width: 100%;\n justify-content: center;\n align-items: center;\n`;\n\nconst TextField = styled.input`\n width: 100%;\n background-color: rgba(0, 0, 0, 0.25) !important;\n border: none !important;\n max-height: 28px !important;\n`;\n\nconst SearchButton = styled.button<IButtonProps>`\n color: ${({ buttonColor }) => buttonColor};\n background-color: ${({ buttonBackgroundColor }) => buttonBackgroundColor};\n width: 28px;\n height: 28px;\n border: none !important;\n`;\n\nconst ListContainer = styled.ul`\n border: none;\n overflow-y: scroll;\n list-style: none;\n padding: 0;\n`;\n\nconst ListElement = styled.li`\n margin: 0.5rem 0 !important;\n font-size: ${uiFonts.size.small};\n padding: 0.5rem 2px;\n\n &:hover {\n color: #ff0;\n background-color: ${uiColors.darkGray};\n }\n\n button {\n all: unset;\n }\n`;\n","import React from 'react';\nimport styled from 'styled-components';\nimport { Chat, IStyles } from '../Chat/Chat';\nimport { SearchCharacter } from './SearchCharacter';\nimport { ChatMessage, PrivateChatCharacter } from './types';\n\ninterface ChatContentProps {\n isPrivate: boolean;\n isTrade: boolean;\n isGlobal: boolean;\n searchCharacterUI: boolean;\n chatMessages: ChatMessage[];\n onSendGlobalChatMessage: (message: string) => void;\n onSendLocalChatMessage: (message: string) => void;\n onSendPrivateChatMessage: (message: string) => void;\n onSendTradeMessage: (message: string) => void;\n onCloseButton: () => void;\n styles?: IStyles;\n onFocus?: () => void;\n onBlur?: () => void;\n isExpanded: boolean;\n autoCloseOnSend: boolean;\n onChangeCharacterName: (characterName: string) => void;\n privateChatCharacters?: PrivateChatCharacter[];\n hideSearchCharacterUI: () => void;\n onCharacterClick?: (character: PrivateChatCharacter) => void;\n isGuild: boolean;\n onSendGuildChatMessage: (message: string) => void;\n}\n\nexport const ChatContent: React.FC<ChatContentProps> = ({\n isPrivate,\n isTrade,\n isGlobal,\n searchCharacterUI,\n chatMessages,\n onSendLocalChatMessage,\n onSendGlobalChatMessage,\n onSendPrivateChatMessage,\n onSendTradeMessage,\n onCloseButton,\n styles,\n onFocus,\n onBlur,\n isExpanded,\n autoCloseOnSend,\n onChangeCharacterName,\n privateChatCharacters,\n hideSearchCharacterUI,\n onCharacterClick,\n isGuild,\n onSendGuildChatMessage,\n}) => {\n const handleSendMessage = (message: string) => {\n if (autoCloseOnSend) {\n onCloseButton();\n }\n\n if (isPrivate) {\n onSendPrivateChatMessage(message);\n } else if (isTrade) {\n onSendTradeMessage(message);\n } else if (isGuild) {\n onSendGuildChatMessage(message);\n } else if (isGlobal) {\n onSendGlobalChatMessage(message);\n } else {\n onSendLocalChatMessage(message);\n }\n };\n\n if (isPrivate && searchCharacterUI) {\n return (\n <SearchCharacter\n onFocus={onFocus}\n onBlur={onBlur}\n onChangeCharacterName={onChangeCharacterName}\n styles={styles}\n recentCharacters={privateChatCharacters}\n hideSearchCharacterUI={hideSearchCharacterUI}\n onCharacterClick={onCharacterClick}\n />\n );\n }\n\n return (\n <ChatWrapper>\n <Chat\n chatMessages={chatMessages}\n onSendChatMessage={handleSendMessage}\n sendMessage={true}\n onCloseButton={onCloseButton}\n styles={styles}\n onFocus={onFocus}\n onBlur={onBlur}\n isExpanded={isExpanded}\n />\n </ChatWrapper>\n );\n};\n\nconst ChatWrapper = styled.div`\n flex-grow: 1;\n overflow: hidden;\n display: flex;\n flex-direction: column;\n position: relative;\n`;\n","import React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\n\ninterface ChatTabsProps {\n tabs: { label: string; id: string }[];\n activeTab: string;\n onChangeTab: (tabId: string) => void;\n}\n\nexport const ChatTabs: React.FC<ChatTabsProps> = ({\n tabs,\n activeTab,\n onChangeTab,\n}) => (\n <TabContainer>\n {tabs.map((tab, index) => (\n <Tab\n key={`${tab.label}_${index}`}\n active={tab.id === activeTab}\n onPointerDown={() => onChangeTab(tab.id)}\n >\n {tab.label}\n </Tab>\n ))}\n </TabContainer>\n);\n\nconst TabContainer = styled.div`\n display: flex;\n gap: 10px;\n align-items: center;\n flex-grow: 1;\n`;\n\nconst Tab = styled.button<{ active: boolean }>`\n width: 120px;\n color: white;\n font-size: 0.8rem;\n all: unset;\n padding: 0.6rem;\n font-size: 0.8rem;\n border-radius: 5px 5px 0 0;\n border-width: 0.25rem 0.25rem 0 0.25rem;\n border-style: solid;\n border-color: ${props =>\n props.active ? 'rgba(198, 81, 2, 0.5)' : 'rgba(128, 128, 128, 0.5)'};\n background-color: ${props =>\n props.active ? uiColors.orange : 'rgba(0, 0, 0, 0.2)'};\n color: ${props => (props.active ? 'white' : uiColors.darkGray)};\n`;\n","import React from 'react';\nimport { IoMdContract, IoMdExpand } from 'react-icons/io';\nimport styled from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\n\ninterface ExpandButtonProps {\n isExpanded: boolean;\n onClick: () => void;\n}\n\nexport const ExpandButton: React.FC<ExpandButtonProps> = ({\n isExpanded,\n onClick,\n}) => (\n <StyledExpandButton isExpanded={isExpanded} onClick={onClick}>\n {isExpanded ? <IoMdContract size={20} /> : <IoMdExpand size={20} />}\n </StyledExpandButton>\n);\n\nconst StyledExpandButton = styled.button<{ isExpanded: boolean }>`\n position: absolute;\n top: 0;\n ${({ isExpanded }) => (isExpanded ? 'right: 0' : 'left: 0.5rem')};\n width: 30px;\n height: 30px;\n background-color: ${uiColors.orange};\n color: white;\n border: none;\n border-radius: 50%;\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n transition: all 0.3s ease;\n z-index: 10;\n\n &:hover {\n background-color: ${uiColors.orange};\n }\n`;\n","import React from 'react';\nimport { RxCross2, RxMagnifyingGlass } from 'react-icons/rx';\nimport styled from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\nimport { uiFonts } from '../../constants/uiFonts';\nimport { Ellipsis } from '../shared/Ellipsis';\nimport { PrivateChatCharacter } from './types';\n\ninterface IRecentChatsProps {\n showRecentChats: boolean;\n toggleRecentChats: () => void;\n hasUnseenMessages: boolean;\n showSearchCharacterUI: () => void;\n recentChatCharacters?: PrivateChatCharacter[];\n recentSelectedChatCharacterId?: string;\n unseenMessageCharacterIds?: string[];\n onPreviousChatCharacterClick: (character: PrivateChatCharacter) => void;\n onRemoveRecentChatCharacter?: (character: PrivateChatCharacter) => void;\n isPrivate: boolean;\n hideSearchCharacterUI: () => void; // Add this line\n}\n\nexport const RecentChats: React.FC<IRecentChatsProps> = ({\n showRecentChats,\n toggleRecentChats,\n hasUnseenMessages,\n showSearchCharacterUI,\n recentChatCharacters,\n recentSelectedChatCharacterId,\n unseenMessageCharacterIds,\n onPreviousChatCharacterClick,\n onRemoveRecentChatCharacter,\n isPrivate,\n hideSearchCharacterUI, // Add this line\n}) => {\n const handlePreviousChatCharacterClick = (\n character: PrivateChatCharacter\n ) => {\n onPreviousChatCharacterClick(character);\n hideSearchCharacterUI(); // Call hideSearchCharacterUI here\n };\n\n return (\n <RecentChatTabContainer isOpen={showRecentChats} isPrivate={isPrivate}>\n <RecentChatTopBar>\n <BurgerIconContainer\n onPointerDown={toggleRecentChats}\n hasUnseenMessages={hasUnseenMessages}\n >\n <BurgerLineIcon />\n <BurgerLineIcon />\n <BurgerLineIcon />\n </BurgerIconContainer>\n {showRecentChats && (\n <SearchButton onPointerDown={showSearchCharacterUI}>\n <RxMagnifyingGlass size={16} color={uiColors.white} />\n </SearchButton>\n )}\n </RecentChatTopBar>\n <RecentChatLogContainer isOpen={showRecentChats}>\n {recentChatCharacters?.map(character => (\n <ListElementContainer key={character._id}>\n <ListElement\n active={character._id === recentSelectedChatCharacterId}\n onPointerDown={() => handlePreviousChatCharacterClick(character)}\n >\n <StatusDot\n isUnseen={\n unseenMessageCharacterIds?.includes(character._id) ?? false\n }\n />\n <Ellipsis maxWidth=\"140px\" maxLines={1}>\n {character.name}\n </Ellipsis>\n </ListElement>\n <CloseButton\n className=\"close-button\"\n onPointerDown={() => onRemoveRecentChatCharacter?.(character)}\n >\n <RxCross2 size={16} />\n </CloseButton>\n </ListElementContainer>\n ))}\n </RecentChatLogContainer>\n </RecentChatTabContainer>\n );\n};\n\nconst RecentChatTabContainer = styled.div<{\n isPrivate: boolean;\n isOpen: boolean;\n}>`\n display: ${props => (props.isPrivate ? 'flex' : 'none')};\n flex-direction: column;\n border-right: 1px solid ${uiColors.gray};\n outline: none;\n width: ${props => (props.isOpen ? '25%' : '30px')};\n max-width: 200px;\n min-width: ${props => (props.isOpen ? '180px' : '30px')};\n transition: all 0.3s ease-in-out;\n overflow: hidden;\n height: 100%;\n @media (max-width: 768px) {\n width: ${props => (props.isOpen ? '50%' : '30px')};\n min-width: ${props => (props.isOpen ? '150px' : '30px')};\n }\n`;\n\nconst RecentChatTopBar = styled.div`\n display: flex;\n align-items: center;\n justify-content: space-between;\n height: 30px;\n flex-shrink: 0;\n`;\n\nconst SearchButton = styled.button`\n border: none;\n background-color: transparent;\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n gap: 2px;\n padding: 4px;\n position: relative;\n`;\n\nconst BurgerIconContainer = styled.button<{ hasUnseenMessages: boolean }>`\n border: none;\n background-color: transparent;\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n padding: 4px;\n gap: 2px;\n position: relative;\n\n &:after {\n content: '';\n width: 6px;\n height: 6px;\n position: absolute;\n top: 0;\n right: 2px;\n border-radius: 50%;\n background-color: ${uiColors.lightGreen};\n display: ${props => (props.hasUnseenMessages ? 'block' : 'none')};\n }\n`;\n\nconst BurgerLineIcon = styled.span`\n width: 1rem;\n height: 2px;\n background-color: #ffffff;\n`;\n\nconst RecentChatLogContainer = styled.div<{ isOpen: boolean }>`\n display: ${props => (props.isOpen ? 'flex' : 'none')};\n opacity: ${props => (props.isOpen ? 1 : 0)};\n flex-direction: column;\n gap: 0.25rem; // Reduce this from 0.5rem to 0.25rem\n transition: opacity 0.3s ease-in-out;\n padding: 0;\n margin: 0;\n overflow-y: auto;\n flex-grow: 1;\n height: 0;\n\n /* Firefox */\n scrollbar-width: thin;\n scrollbar-color: rgba(51, 51, 51, 0.4) rgba(30, 30, 30, 0.4);\n\n /* WebKit and Chromium-based browsers */\n &::-webkit-scrollbar {\n width: 8px;\n height: 8px;\n }\n\n &::-webkit-scrollbar-track {\n background: rgba(30, 30, 30, 0.2);\n border-radius: 4px;\n }\n\n &::-webkit-scrollbar-thumb {\n background-color: rgba(255, 102, 0, 0.5);\n border-radius: 4px;\n border: 2px solid rgba(30, 30, 30, 0.2);\n }\n\n &::-webkit-scrollbar-thumb:hover {\n background-color: rgba(255, 102, 0, 0.7);\n }\n`;\n\nconst ListElementContainer = styled.div`\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 2px 0; // Add small vertical padding\n`;\n\nconst ListElement = styled.button<{ active: boolean }>`\n margin: 0 !important; // Remove vertical margins\n font-size: ${uiFonts.size.small} !important;\n padding: 2px;\n all: unset;\n color: ${props => (props.active ? uiColors.yellow : uiColors.white)};\n width: 100%;\n position: relative;\n display: flex;\n align-items: center;\n gap: 4px;\n\n &:hover {\n color: #ff0;\n }\n max-width: calc(100% - 24px);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n`;\n\nconst StatusDot = styled.span<{ isUnseen: boolean }>`\n width: 6px;\n height: 6px;\n border-radius: 50%;\n background-color: ${props =>\n props.isUnseen ? uiColors.lightGreen : uiColors.gray};\n display: inline-block;\n margin-right: 6px;\n`;\n\nconst CloseButton = styled.button`\n all: unset;\n font-size: ${uiFonts.size.xxsmall};\n margin: 0 0.5rem;\n transition: all 0.2s ease-in-out;\n background-color: ${uiColors.red};\n color: ${uiColors.white};\n width: 16px;\n height: 16px;\n border-radius: 50%;\n display: flex;\n justify-content: center;\n align-items: center;\n &:hover {\n background-color: ${uiColors.white};\n color: ${uiColors.red};\n }\n`;\n","import React from 'react';\nimport styled from 'styled-components';\nimport { useChat } from '../../hooks/useChat';\nimport { Chat } from '../Chat/Chat';\nimport { ChatContent } from './ChatContent';\nimport { ChatTabs } from './ChatTabs';\nimport { ExpandButton } from './ExpandButton';\nimport { RecentChats } from './RecentChats';\nimport { IChatRevampProps } from './types';\n\nexport const ChatRevamp = ({\n chatMessages,\n onSendGlobalChatMessage,\n onSendGuildChatMessage, // Add this new prop\n onChangeCharacterName,\n onFocus,\n onBlur,\n onCloseButton,\n styles,\n tabs,\n onChangeTab,\n activeTab = 'global',\n privateChatCharacters,\n onCharacterClick,\n onSendPrivateChatMessage,\n recentChatCharacters,\n recentSelectedChatCharacterId,\n onPreviousChatCharacterClick,\n onRemoveRecentChatCharacter,\n unseenMessageCharacterIds,\n onSendTradeMessage,\n searchCharacterUI,\n hideSearchCharacterUI,\n showSearchCharacterUI,\n minimizedByDefault = false,\n autoCloseOnSend,\n onSendLocalChatMessage,\n}: IChatRevampProps) => {\n const isPrivate = activeTab === 'private';\n const isTrade = activeTab === 'trade';\n const isGuild = activeTab === 'guild';\n const isGlobal = activeTab === 'global';\n const chatHook = useChat({\n minimizedByDefault,\n isPrivate,\n onChangeTab,\n onPreviousChatCharacterClick,\n unseenMessageCharacterIds,\n });\n\n return (\n <ChatRevampContainer>\n <TopBar isExpanded={chatHook.isExpanded}>\n {chatHook.isExpanded && (\n <ChatTabs\n tabs={tabs}\n activeTab={activeTab}\n onChangeTab={chatHook.handleTabChange}\n />\n )}\n <ExpandButton\n isExpanded={chatHook.isExpanded}\n onClick={chatHook.toggleExpand}\n />\n </TopBar>\n <AllChatsContainer\n width={styles?.width || '80%'}\n height={styles?.height || 'auto'}\n isExpanded={chatHook.isExpanded}\n >\n {chatHook.isExpanded ? (\n <ExpandedChatContent>\n {isPrivate && (\n <RecentChats\n showRecentChats={chatHook.showRecentChats}\n toggleRecentChats={chatHook.toggleRecentChats}\n hasUnseenMessages={chatHook.hasUnseenMessages || false}\n showSearchCharacterUI={showSearchCharacterUI}\n recentChatCharacters={recentChatCharacters}\n recentSelectedChatCharacterId={recentSelectedChatCharacterId}\n unseenMessageCharacterIds={unseenMessageCharacterIds}\n onPreviousChatCharacterClick={\n chatHook.handlePreviousChatCharacterClick\n }\n onRemoveRecentChatCharacter={onRemoveRecentChatCharacter}\n isPrivate={isPrivate}\n hideSearchCharacterUI={hideSearchCharacterUI}\n />\n )}\n <ChatContentWrapper isPrivate={isPrivate}>\n <ChatContent\n isPrivate={isPrivate}\n isTrade={isTrade}\n isGuild={isGuild}\n isGlobal={isGlobal}\n searchCharacterUI={searchCharacterUI}\n chatMessages={chatMessages}\n onSendGlobalChatMessage={onSendGlobalChatMessage}\n onSendPrivateChatMessage={onSendPrivateChatMessage}\n onSendTradeMessage={onSendTradeMessage}\n onSendGuildChatMessage={onSendGuildChatMessage}\n onSendLocalChatMessage={onSendLocalChatMessage}\n onCloseButton={onCloseButton}\n styles={styles}\n onFocus={onFocus}\n onBlur={onBlur}\n isExpanded={chatHook.isExpanded}\n autoCloseOnSend={autoCloseOnSend || false}\n onChangeCharacterName={onChangeCharacterName}\n privateChatCharacters={privateChatCharacters}\n hideSearchCharacterUI={hideSearchCharacterUI}\n onCharacterClick={onCharacterClick}\n />\n </ChatContentWrapper>\n </ExpandedChatContent>\n ) : (\n <CollapsedChatInput>\n <Chat\n chatMessages={[]}\n onSendChatMessage={onSendLocalChatMessage}\n sendMessage={true}\n onCloseButton={onCloseButton}\n styles={styles}\n onFocus={onFocus}\n onBlur={onBlur}\n isExpanded={false}\n />\n </CollapsedChatInput>\n )}\n </AllChatsContainer>\n </ChatRevampContainer>\n );\n};\n\nconst ChatRevampContainer = styled.div`\n display: flex;\n flex-direction: column;\n width: 100%;\n position: relative;\n`;\n\nconst TopBar = styled.div<{ isExpanded: boolean }>`\n display: flex;\n align-items: center;\n justify-content: flex-start;\n min-height: ${({ isExpanded }) => (isExpanded ? 'auto' : '32px')};\n`;\n\nconst AllChatsContainer = styled.div<{\n width: string;\n height: string;\n isExpanded: boolean;\n}>`\n width: ${({ width }) => width};\n height: ${({ height, isExpanded }) => (isExpanded ? height : 'auto')};\n padding: 10px;\n background-color: rgba(0, 0, 0, 0.2);\n display: flex;\n gap: 10px;\n flex-wrap: wrap;\n`;\n\nconst ChatContentWrapper = styled.div<{ isPrivate: boolean }>`\n flex-grow: 1;\n overflow: hidden;\n display: flex;\n flex-direction: column;\n position: relative;\n width: ${props => (props.isPrivate ? '75%' : '100%')};\n`;\n\nconst CollapsedChatInput = styled.div`\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n`;\n\nconst ExpandedChatContent = styled.div`\n display: flex;\n width: 100%;\n height: 100%;\n`;\n","import styled from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\n\nexport const SingleShortcut = styled.button`\n width: 3rem;\n height: 3rem;\n background-color: ${uiColors.lightGray};\n border: 2px solid ${uiColors.darkGray};\n border-radius: 50%;\n text-transform: uppercase;\n font-size: 0.7rem;\n font-weight: bold;\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n\n span {\n pointer-events: none;\n }\n\n .mana {\n position: absolute;\n top: -5px;\n right: 0;\n font-size: 0.65rem;\n color: ${uiColors.blue};\n }\n\n .qty {\n position: absolute;\n top: -5px;\n right: 0;\n font-size: 0.65rem;\n }\n\n .magicWords {\n margin-top: 4px;\n }\n\n .keyboard {\n position: absolute;\n bottom: -5px;\n left: 0;\n font-size: 0.65rem;\n color: ${uiColors.yellow};\n }\n\n .onCooldown {\n color: ${uiColors.gray};\n }\n\n .cooldown {\n position: absolute;\n z-index: 1;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n border-radius: inherit;\n background-color: rgba(0 0 0 / 60%);\n font-size: 0.7rem;\n display: flex;\n align-items: center;\n justify-content: center;\n color: ${uiColors.darkYellow};\n }\n\n &:hover,\n &:focus {\n background-color: ${uiColors.darkGray};\n }\n\n &:active {\n background-color: ${uiColors.gray};\n border-color: ${uiColors.yellow};\n }\n\n &:disabled {\n opacity: 0.5;\n }\n`;\n","import { useEffect, useRef, useState } from 'react';\n\nexport const useShortcutCooldown = (\n onShortcutCast: (index: number) => void\n) => {\n const [shortcutCooldown, setShortcutCooldown] = useState(0);\n const cooldownTimeout = useRef<NodeJS.Timeout | null>(null);\n\n const handleShortcutCast = (index: number) => {\n if (shortcutCooldown <= 0) setShortcutCooldown(1.5);\n onShortcutCast(index);\n };\n\n useEffect(() => {\n if (cooldownTimeout.current) clearTimeout(cooldownTimeout.current);\n\n if (shortcutCooldown > 0) {\n cooldownTimeout.current = setTimeout(() => {\n setShortcutCooldown(shortcutCooldown - 0.1);\n }, 100);\n }\n }, [shortcutCooldown]);\n\n return { shortcutCooldown, handleShortcutCast };\n};\n","import {\n getItemTextureKeyPath,\n IItem,\n IItemContainer,\n IRawSpell,\n IShortcut,\n ShortcutType,\n} from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\nimport { SpriteFromAtlas } from '../shared/SpriteFromAtlas';\nimport { SingleShortcut } from '../Shortcuts/SingleShortcut';\nimport { useShortcutCooldown } from '../Shortcuts/useShortcutCooldown';\n\nexport type CircularControllerProps = {\n onActionClick: () => void;\n onCancelClick: () => void;\n onShortcutClick: (index: number) => void;\n mana: number;\n shortcuts: IShortcut[];\n inventory?: IItemContainer | null;\n atlasIMG: any;\n atlasJSON: any;\n spellCooldowns?: Record<string, number>;\n};\n\nexport const CircularController: React.FC<CircularControllerProps> = ({\n onActionClick,\n onCancelClick,\n onShortcutClick,\n mana,\n shortcuts,\n inventory,\n atlasIMG,\n atlasJSON,\n spellCooldowns,\n}) => {\n const { handleShortcutCast, shortcutCooldown } = useShortcutCooldown(\n onShortcutClick\n );\n\n const onTouchStart = (e: React.TouchEvent<HTMLButtonElement>) => {\n const target = e.target as HTMLButtonElement;\n target?.classList.add('active');\n };\n\n const onTouchEnd = (\n action: () => void,\n e: React.TouchEvent<HTMLButtonElement>\n ) => {\n const target = e.target as HTMLButtonElement;\n setTimeout(() => {\n target?.classList.remove('active');\n }, 100);\n action();\n };\n\n const renderShortcut = (i: number) => {\n const buildClassName = (classBase: string, isOnCooldown: boolean) => {\n return `${classBase} ${isOnCooldown ? 'onCooldown' : ''}`;\n };\n\n let variant = '';\n\n if (i === 0) variant = 'top';\n else if (i >= 3) variant = `bottom-${i - 3}`;\n\n const onShortcutClickBinded =\n shortcuts[i]?.type !== ShortcutType.None\n ? handleShortcutCast.bind(null, i)\n : () => {};\n\n const isOnShortcutCooldown = shortcutCooldown > 0;\n\n if (shortcuts[i]?.type === ShortcutType.Item) {\n const payload = shortcuts[i]?.payload as IItem | undefined;\n\n let itemsFromEquipment: (IItem | undefined | null)[] = [];\n\n if (inventory) {\n Object.keys(inventory.slots).forEach(i => {\n const index = parseInt(i);\n\n if (inventory.slots[index]?.key === payload?.key) {\n itemsFromEquipment.push(inventory.slots[index]);\n }\n });\n }\n\n const totalQty = itemsFromEquipment.reduce(\n (acc, item) => acc + (item?.stackQty || 1),\n 0\n );\n\n return (\n <StyledShortcut\n key={i}\n onTouchStart={onTouchStart}\n onTouchEnd={onTouchEnd.bind(null, onShortcutClickBinded)}\n disabled={false}\n className={variant}\n >\n {isOnShortcutCooldown && (\n <span className=\"cooldown\">{shortcutCooldown.toFixed(1)}</span>\n )}\n {payload && (\n <SpriteFromAtlas\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={getItemTextureKeyPath(\n {\n key: payload.texturePath,\n texturePath: payload.texturePath,\n stackQty: payload.stackQty || 1,\n isStackable: payload.isStackable,\n },\n atlasJSON\n )}\n width={32}\n height={32}\n imgScale={1.4}\n imgStyle={{ left: '4px' }}\n containerStyle={{ pointerEvents: 'none' }}\n />\n )}\n <span className={buildClassName('qty', isOnShortcutCooldown)}>\n {totalQty}\n </span>\n </StyledShortcut>\n );\n }\n\n const payload = shortcuts[i]?.payload as IRawSpell | undefined;\n\n const spellCooldown = !payload\n ? 0\n : spellCooldowns?.[payload.magicWords.replaceAll(' ', '_')] ??\n shortcutCooldown;\n const cooldown =\n spellCooldown > shortcutCooldown ? spellCooldown : shortcutCooldown;\n const isOnCooldown = cooldown > 0 && !!payload;\n\n const CONTAINER_STYLE = { width: '32px', height: '32px' };\n const IMAGE_SCALE = 1.5;\n\n return (\n <StyledShortcut\n key={i}\n onTouchStart={onTouchStart}\n onTouchEnd={onTouchEnd.bind(null, onShortcutClickBinded)}\n disabled={mana < (payload?.manaCost ?? 0)}\n className={variant}\n >\n {isOnCooldown && (\n <span className=\"cooldown\">\n {cooldown.toFixed(cooldown < 10 ? 1 : 0)}\n </span>\n )}\n <span className={buildClassName('mana', isOnCooldown)}>\n {payload && payload.manaCost}\n </span>\n <span className=\"magicWords\">\n {payload?.texturePath ? (\n <SpriteFromAtlas\n atlasIMG={payload.atlasIMG}\n atlasJSON={payload.atlasJSON}\n spriteKey={payload.texturePath}\n imgScale={IMAGE_SCALE}\n containerStyle={CONTAINER_STYLE}\n centered={true}\n borderRadius=\"50%\"\n />\n ) : (\n payload?.magicWords.split(' ').map(word => word[0])\n )}\n </span>\n </StyledShortcut>\n );\n };\n\n return (\n <ButtonsContainer>\n <ShortcutsContainer>\n {Array.from({ length: 12 }).map((_, i) => renderShortcut(i))}\n </ShortcutsContainer>\n <Button\n onTouchStart={onTouchStart}\n onTouchEnd={onTouchEnd.bind(null, onActionClick)}\n >\n <div className=\"rpgui-icon sword\" />\n </Button>\n\n <CancelButton\n onTouchStart={onTouchStart}\n onTouchEnd={onTouchEnd.bind(null, onCancelClick)}\n >\n <span>X</span>\n </CancelButton>\n </ButtonsContainer>\n );\n};\n\nconst Button = styled.button`\n width: 4.3rem;\n height: 4.3rem;\n background-color: ${uiColors.lightGray};\n border: 2px solid ${uiColors.darkGray};\n border-radius: 50%;\n text-transform: uppercase;\n font-size: 0.7rem;\n font-weight: bold;\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n transition: all 0.1s;\n margin-top: -3rem;\n top: -144px;\n\n &.active {\n background-color: ${uiColors.gray};\n border-color: ${uiColors.yellow};\n }\n\n .sword {\n transform: rotate(-45deg);\n height: 2.5rem;\n width: 1.9rem;\n pointer-events: none;\n }\n`;\n\nconst CancelButton = styled(Button)`\n width: 3rem;\n height: 3rem;\n font-size: 0.8rem;\n position: relative;\n left: 2.6rem;\n\n span {\n margin-top: 4px;\n margin-left: 2px;\n pointer-events: none;\n }\n`;\n\nconst ButtonsContainer = styled.div`\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 0.5rem;\n\n scale: 0.9;\n`;\n\nconst ShortcutsContainer = styled.div`\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 0.5rem;\n flex-direction: column;\n margin-top: 3rem;\n\n .top {\n transform: translate(93%, 25%);\n }\n\n .bottom-0 {\n transform: translate(93%, -25%);\n }\n\n .bottom-1 {\n transform: translate(320%, calc(-4.5rem));\n }\n\n .bottom-2 {\n transform: translate(-13.5%, calc(-5.6rem - 25%));\n }\n\n .bottom-3 {\n transform: translate(318%, calc(-15.8rem - 25%));\n }\n\n .bottom-4 {\n transform: translate(-15%, calc(-20.2rem - 25%));\n }\n .bottom-5 {\n transform: translate(210%, calc(-15rem - 25%));\n }\n\n .bottom-6 {\n transform: translate(210%, calc(-25.7rem - 25%));\n }\n\n .bottom-7 {\n transform: translate(304%, calc(-24.9rem - 25%));\n }\n\n .bottom-8 {\n transform: translate(-101%, calc(-27.7rem - 25%));\n }\n`;\n\nconst StyledShortcut = styled(SingleShortcut)`\n width: 2.5rem;\n height: 2.5rem;\n transition: all 0.1s;\n\n .mana,\n .qty {\n font-size: 0.5rem;\n }\n\n &:hover,\n &:focus,\n &:active {\n background-color: ${uiColors.lightGray};\n }\n\n &.active {\n background-color: ${uiColors.gray};\n border-color: ${uiColors.yellow};\n }\n`;\n","import { useEffect } from 'react';\n\nexport function useOutsideClick(ref: any, id: string) {\n useEffect(() => {\n /**\n * Alert if clicked on outside of element\n */\n function handleClickOutside(event: any) {\n if (ref.current && !ref.current.contains(event.target)) {\n const event = new CustomEvent('clickOutside', {\n detail: {\n id,\n },\n });\n document.dispatchEvent(event);\n }\n }\n // Bind the event listener\n document.addEventListener('pointerdown', handleClickOutside);\n return () => {\n // Unbind the event listener on clean up\n document.removeEventListener('pointerdown', handleClickOutside);\n };\n }, [ref]);\n}\n","import React from 'react';\nimport styled from 'styled-components';\nimport { RPGUIContainer, RPGUIContainerTypes } from '../RPGUI/RPGUIContainer';\nimport { NPCDialogText } from './NPCDialogText';\nimport {\n IQuestionDialog,\n IQuestionDialogAnswer,\n QuestionDialog,\n} from './QuestionDialog/QuestionDialog';\nimport aliceDefaultThumbnail from './img/npcDialog/npcThumbnails/alice.png';\n\nexport enum NPCDialogType {\n TextOnly = 'TextOnly',\n TextAndThumbnail = 'TextAndThumbnail',\n}\n\nexport interface INPCDialogProps {\n text?: string;\n type: NPCDialogType;\n imagePath?: string;\n onClose?: () => void;\n isQuestionDialog?: boolean;\n answers?: IQuestionDialogAnswer[];\n questions?: IQuestionDialog[];\n}\n\nexport const NPCDialog: React.FC<INPCDialogProps> = ({\n text,\n type,\n onClose,\n imagePath,\n isQuestionDialog = false,\n questions,\n answers,\n}) => {\n return (\n <RPGUIContainer\n type={RPGUIContainerTypes.FramedGold}\n width={isQuestionDialog ? '600px' : '80%'}\n height={'180px'}\n >\n {isQuestionDialog && questions && answers ? (\n <>\n <TextContainer\n flex={type === NPCDialogType.TextAndThumbnail ? '70%' : '100%'}\n >\n <QuestionDialog\n questions={questions}\n answers={answers}\n onClose={() => {\n if (onClose) {\n onClose();\n }\n }}\n />\n </TextContainer>\n {type === NPCDialogType.TextAndThumbnail && (\n <ThumbnailContainer>\n <NPCThumbnail src={imagePath || aliceDefaultThumbnail} />\n </ThumbnailContainer>\n )}\n </>\n ) : (\n <>\n <Container>\n <CloseIcon onPointerDown={onClose}>X</CloseIcon>\n <TextContainer\n flex={type === NPCDialogType.TextAndThumbnail ? '70%' : '100%'}\n >\n <NPCDialogText\n type={type}\n text={text || 'No text provided.'}\n onClose={() => {\n if (onClose) {\n onClose();\n }\n }}\n />\n </TextContainer>\n {type === NPCDialogType.TextAndThumbnail && (\n <ThumbnailContainer>\n <NPCThumbnail src={imagePath || aliceDefaultThumbnail} />\n </ThumbnailContainer>\n )}\n </Container>\n </>\n )}\n </RPGUIContainer>\n );\n};\n\nconst Container = styled.div`\n display: flex;\n width: 100%;\n height: 100%;\n\n box-sizing: border-box;\n justify-content: center;\n align-items: flex-start;\n position: relative;\n`;\n\nconst CloseIcon = styled.p`\n position: absolute;\n top: -1.5rem;\n right: -0.4rem;\n cursor: pointer;\n color: white;\n font-size: 1.1rem !important;\n`;\n\ninterface ITextContainerProps {\n flex: string;\n}\n\nconst TextContainer = styled.div<ITextContainerProps>`\n flex: ${({ flex }) => flex} 0 0;\n width: 355px;\n`;\n\nconst ThumbnailContainer = styled.div`\n flex: 30% 0 0;\n display: flex;\n justify-content: flex-end;\n`;\n\nconst NPCThumbnail = styled.img`\n image-rendering: pixelated;\n height: 128px;\n width: 128px;\n`;\n","import React, { useEffect, useRef } from 'react';\nimport Draggable from 'react-draggable';\nimport styled, { css } from 'styled-components';\nimport { uiFonts } from '../constants/uiFonts';\nimport { useOutsideClick } from '../hooks/useOutsideAlerter';\nimport { IPosition } from '../types/eventTypes';\nimport { RPGUIContainerTypes } from './RPGUI/RPGUIContainer';\n\nexport interface IDraggableContainerProps {\n children: React.ReactNode;\n width?: string;\n height?: string;\n minWidth?: string;\n minHeight?: string;\n className?: string;\n type?: RPGUIContainerTypes;\n title?: string;\n imgSrc?: string;\n imgWidth?: string;\n onCloseButton?: () => void;\n cancelDrag?: string;\n onPositionChange?: (position: IPosition) => void;\n onPositionChangeEnd?: (position: IPosition) => void;\n onPositionChangeStart?: (position: IPosition) => void;\n onOutsideClick?: () => void;\n initialPosition?: IPosition;\n scale?: number;\n dragDisabled?: boolean;\n isFullScreen?: boolean;\n opacity?: number;\n}\n\nexport const DraggableContainer: React.FC<IDraggableContainerProps> = ({\n children,\n width = '50%',\n height,\n minHeight,\n minWidth,\n className,\n type = RPGUIContainerTypes.FramedGold,\n onCloseButton,\n title,\n imgSrc,\n imgWidth = '20px',\n cancelDrag,\n onPositionChange,\n onPositionChangeEnd,\n onPositionChangeStart,\n onOutsideClick,\n initialPosition = { x: 0, y: 0 },\n scale,\n dragDisabled = false,\n isFullScreen,\n opacity,\n}) => {\n const draggableRef = useRef(null);\n\n if (isFullScreen) {\n width = '100%';\n height = '100%';\n }\n\n useOutsideClick(draggableRef, 'item-container');\n\n useEffect(() => {\n document.addEventListener('clickOutside', event => {\n const e = event as CustomEvent;\n\n if (e.detail.id === 'item-container') {\n if (onOutsideClick) {\n onOutsideClick();\n }\n }\n });\n\n return () => {\n document.removeEventListener('clickOutside', _e => {});\n };\n }, []);\n\n return (\n <Draggable\n cancel={`.container-close,input,button,${cancelDrag}`}\n disabled={dragDisabled}\n onDrag={(_e, data) => {\n if (onPositionChange) {\n onPositionChange({\n x: data.x,\n y: data.y,\n });\n }\n }}\n onStop={(_e, data) => {\n if (onPositionChangeEnd) {\n onPositionChangeEnd({\n x: data.x,\n y: data.y,\n });\n }\n }}\n onStart={(_e, data) => {\n if (onPositionChangeStart) {\n onPositionChangeStart({\n x: data.x,\n y: data.y,\n });\n }\n }}\n defaultPosition={initialPosition}\n scale={scale}\n >\n <Container\n ref={draggableRef}\n width={width}\n height={height || 'auto'}\n minWidth={minWidth}\n minHeight={minHeight}\n className={`rpgui-container ${type} ${className}`}\n isFullScreen={isFullScreen}\n opacity={opacity}\n >\n {title && (\n <TitleContainer className=\"drag-handler\">\n <Title>\n {imgSrc && <Icon src={imgSrc} width={imgWidth} />}\n {title}\n </Title>\n </TitleContainer>\n )}\n {onCloseButton && (\n <CloseButton\n className=\"container-close\"\n onPointerDown={onCloseButton}\n >\n X\n </CloseButton>\n )}\n\n {children}\n </Container>\n </Draggable>\n );\n};\n\ninterface IContainerProps {\n width: string;\n height: string;\n minWidth?: string;\n minHeight?: string;\n isFullScreen?: boolean;\n opacity?: number;\n}\n\nconst Container = styled.div<IContainerProps>`\n height: ${props => props.height};\n width: ${({ width }) => width};\n min-width: ${({ minWidth }) => minWidth || 'auto'};\n min-height: ${({ minHeight }) => minHeight || 'auto'};\n display: flex;\n flex-wrap: wrap;\n image-rendering: pixelated;\n\n overflow-y: hidden;\n\n ${({ opacity }) =>\n opacity &&\n css`\n opacity: ${opacity};\n `}\n\n ${({ isFullScreen }) =>\n isFullScreen &&\n css`\n justify-content: center;\n align-items: flex-start;\n align-content: flex-start;\n `}\n\n &.rpgui-container {\n padding-top: 1.5rem;\n }\n`;\n\nconst CloseButton = styled.div`\n position: absolute;\n top: 3px;\n right: 0px;\n color: white;\n z-index: 22;\n font-size: 1.5rem;\n @media (max-width: 950px) {\n font-size: 1.7rem;\n padding: 12px;\n }\n`;\n\nconst TitleContainer = styled.div`\n width: 100%;\n height: 100%;\n display: flex;\n flex-wrap: wrap;\n justify-content: flex-start;\n align-items: center;\n max-height: 42px;\n`;\n\nconst Title = styled.h1`\n color: white;\n z-index: 22;\n font-size: ${uiFonts.size.large};\n`;\n\ninterface ICustomIconProps {\n width: string;\n}\n\nconst Icon = styled.img<ICustomIconProps>`\n color: white;\n z-index: 22;\n font-size: ${uiFonts.size.xsmall};\n width: ${({ width }) => width};\n margin-right: 0.5rem;\n`;\n","import React, { useEffect, useState } from 'react';\nimport styled from 'styled-components';\nimport { v4 as uuidv4 } from 'uuid';\n\nexport interface IOptionsProps {\n id: number;\n value: string;\n option: string | JSX.Element;\n}\n\nexport interface IDropdownProps {\n options: IOptionsProps[];\n width?: string;\n onChange: (value: string) => void;\n opensUp?: boolean; // Add a new prop to control the dropdown direction\n}\n\nexport const Dropdown: React.FC<IDropdownProps> = ({\n options,\n width,\n onChange,\n opensUp = false, // Default value is false\n}) => {\n const dropdownId = uuidv4();\n\n const [selectedValue, setSelectedValue] = useState<string>('');\n const [selectedOption, setSelectedOption] = useState<string | JSX.Element>(\n ''\n );\n const [opened, setOpened] = useState<boolean>(false);\n\n useEffect(() => {\n const firstOption = options[0];\n\n if (firstOption) {\n let change = !selectedValue;\n if (!change) {\n change = options.filter(o => o.value === selectedValue).length < 1;\n }\n\n if (change) {\n setSelectedValue(firstOption.value);\n setSelectedOption(firstOption.option);\n }\n }\n }, [options]);\n\n useEffect(() => {\n if (selectedValue) {\n onChange(selectedValue);\n }\n }, [selectedValue]);\n\n return (\n <Container onMouseLeave={() => setOpened(false)} width={width}>\n <DropdownSelect\n id={`dropdown-${dropdownId}`}\n className=\"rpgui-dropdown-imp rpgui-dropdown-imp-header\"\n onPointerUp={() => setOpened(prev => !prev)}\n >\n <label>▼</label> {selectedOption}\n </DropdownSelect>\n\n <DropdownOptions\n className=\"rpgui-dropdown-imp\"\n opened={opened}\n opensUp={opensUp}\n >\n {options.map(option => {\n return (\n <li\n key={option.id}\n onPointerUp={() => {\n setSelectedValue(option.value);\n setSelectedOption(option.option);\n setOpened(false);\n }}\n >\n {option.option}\n </li>\n );\n })}\n </DropdownOptions>\n </Container>\n );\n};\n\nconst Container = styled.div<{ width: string | undefined }>`\n position: relative;\n width: ${props => props.width || '100%'};\n`;\n\nconst DropdownSelect = styled.p`\n width: 100%;\n box-sizing: border-box;\n\n label {\n display: inline-block;\n transform: translateY(-2px);\n }\n`;\n\nconst DropdownOptions = styled.ul<{\n opened: boolean;\n opensUp: boolean;\n}>`\n position: absolute;\n width: 100%;\n max-height: 300px;\n overflow-y: auto;\n display: ${props => (props.opened ? 'block' : 'none')};\n box-sizing: border-box;\n bottom: ${props => (props.opensUp ? '100%' : 'auto')};\n top: ${props => (props.opensUp ? 'auto' : '100%')};\n margin: 0;\n padding: 0;\n @media (max-width: 768px) {\n padding: 8px 0;\n }\n`;\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport styled from 'styled-components';\n\nconst modalRoot = document.getElementById('modal-root')!;\n\ninterface ModalPortalProps {\n children: React.ReactNode;\n}\n\nconst ModalPortal: React.FC<ModalPortalProps> = ({ children }) => {\n return ReactDOM.createPortal(\n <Container className=\"rpgui-content\">{children}</Container>,\n modalRoot\n );\n};\n\nconst Container = styled.div`\n position: static !important;\n`;\n\nexport default ModalPortal;\n","import { IItem, ItemRarities } from '@rpg-engine/shared';\n\n\nexport const rarityColor = (item: IItem | null) => {\n switch (item?.rarity) {\n case ItemRarities.Uncommon:\n return 'rgba(13, 193, 13, 0.6)';\n case ItemRarities.Rare:\n return 'rgba(8, 104, 187, 0.6)';\n case ItemRarities.Epic:\n return 'rgba(191, 0, 255, 0.6)';\n case ItemRarities.Legendary:\n return 'rgba(255, 191, 0,0.6)';\n default:\n return null;\n }\n};\n","import { IItem } from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\n\ninterface IProps {\n item: IItem;\n}\n\nconst gemColors: { [key: string]: string } = {\n 'emerald-gem': '#50C878', // Emerald green\n 'topaz-radiance': '#FFC87C', // Topaz yellow\n 'sapphire-gem': '#0F52BA', // Sapphire blue\n 'ruby-gem': '#E0115F', // Ruby red\n 'misty-quartz-gem': '#D9D9F3', // Misty Quartz purple\n 'coral-reef-gem': '#FF7F50', // Coral reef orange\n 'jasper-gem': '#D73B3E', // Jasper red\n 'earthstone-gem': '#8B4513', // Earthstone brown\n 'obsidian-gem': '#0B0C0E', // Obsidian black\n 'amethyst-gem': '#9966CC', // Amethyst purple\n};\n\nconst defaultColor = '#FFFFFF'; // Default color (white)\n\nexport const onRenderGems = (item: IItem) => {\n const gemQty = item.attachedGems?.length || 0;\n\n if (gemQty > 0) {\n return <ItemSlotQty item={item} />;\n }\n return undefined;\n};\n\nexport const ItemSlotQty = ({ item }: IProps): JSX.Element => {\n const itemId = item._id;\n\n return (\n <ItemQtyContainer key={`qty-${itemId}`} className=\"item-slot-qty\">\n {item.attachedGems?.map((gem, index) => (\n <Gem\n key={`${itemId}-gem-${index}`}\n color={gemColors[gem.key] || defaultColor}\n />\n ))}\n </ItemQtyContainer>\n );\n};\n\nconst ItemQtyContainer = styled.div`\n position: relative;\n width: 85%;\n height: 16px;\n top: 28px;\n left: 0px;\n pointer-events: none;\n transform: scale(0.8);\n display: flex;\n align-items: center;\n justify-content: flex-start; /* Align gems to the left */\n opacity: 0.8;\n`;\n\nconst Gem = styled.div<{ color: string }>`\n width: 8px;\n height: 8px;\n background: ${({ color }) =>\n `radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.8), transparent 30%), \n linear-gradient(45deg, ${color}, ${color} 50%, rgba(255, 255, 255, 0.2))`};\n border: 1px solid black;\n transform: rotate(45deg);\n margin: 0 2px;\n box-shadow: 0 0 5px ${({ color }) => color}; /* Glow effect */\n transition: transform 0.2s, box-shadow 0.2s; /* Smooth transition for hover effect */\n\n &:hover {\n transform: rotate(45deg) scale(1.2);\n box-shadow: 0 0 10px ${({ color }) => color}; /* Enhanced glow on hover */\n }\n`;\n\nexport default ItemSlotQty;\n","import React from 'react';\nimport styled from 'styled-components';\nimport { uiFonts } from '../../../../constants/uiFonts';\nimport { Ellipsis } from '../../../shared/Ellipsis';\n\ninterface IProps {\n itemId: string;\n stackQty: number;\n qtyClassName: string;\n}\n\nexport const onRenderStackInfo = (itemId: string, stackQty: number) => {\n const isFractionalStackQty = stackQty % 1 !== 0;\n const isLargerThan999 = stackQty > 999;\n\n let qtyClassName = 'regular';\n if (isLargerThan999) qtyClassName = 'small';\n if (isFractionalStackQty) qtyClassName = 'xsmall';\n\n if (stackQty > 1) {\n return (\n <ItemSlotQty\n itemId={itemId}\n stackQty={stackQty}\n qtyClassName={qtyClassName}\n />\n );\n }\n return undefined;\n};\n\nexport const ItemSlotQty = ({\n itemId,\n stackQty,\n qtyClassName,\n}: IProps): JSX.Element => {\n return (\n <ItemQtyContainer key={`qty-${itemId}`} className=\"item-slot-qty\">\n <Ellipsis maxLines={1} maxWidth=\"48px\">\n <ItemQty className={qtyClassName}>\n {Math.round(stackQty * 100) / 100}{' '}\n </ItemQty>\n </Ellipsis>\n </ItemQtyContainer>\n );\n};\n\nconst ItemQtyContainer = styled.div`\n position: relative;\n width: 85%;\n height: 16px;\n top: 25px;\n left: 2px;\n pointer-events: none;\n\n display: flex;\n justify-content: flex-end;\n`;\n\nconst ItemQty = styled.span`\n &.regular {\n font-size: ${uiFonts.size.small};\n }\n &.small {\n font-size: ${uiFonts.size.xsmall};\n }\n &.xsmall {\n font-size: ${uiFonts.size.xxsmall};\n }\n`;\n","import {\n IItem,\n ItemContainerType,\n ItemSlotType,\n getItemTextureKeyPath,\n} from '@rpg-engine/shared';\nimport React from 'react';\nimport { v4 as uuidv4 } from 'uuid';\nimport { SpriteFromAtlas } from '../../shared/SpriteFromAtlas';\nimport { ErrorBoundary } from './ErrorBoundary';\nimport { onRenderGems } from './ItemGem';\nimport { EquipmentSlotSpriteByType } from './ItemSlot';\nimport { onRenderStackInfo } from './ItemSlotQty/ItemSlotQty';\n\ninterface IProps {\n containerType: ItemContainerType | null | undefined;\n atlasJSON: any;\n atlasIMG: any;\n slotSpriteMask: ItemSlotType | null | undefined;\n item: IItem | null;\n}\n\nexport const ItemSlotRenderer: React.FC<IProps> = ({\n containerType,\n atlasJSON,\n atlasIMG,\n slotSpriteMask,\n item,\n}) => {\n const renderStackInfo = (item: IItem) => {\n return (\n item.stackQty &&\n item.stackQty > 1 &&\n onRenderStackInfo(item._id, item.stackQty)\n );\n };\n\n const renderGems = (item: IItem) => {\n return item.attachedGems && onRenderGems(item);\n };\n\n const renderItem = (item: IItem | null) => {\n if (!item?.texturePath) {\n return null;\n }\n\n return (\n <ErrorBoundary key={item._id}>\n <SpriteFromAtlas\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={getItemTextureKeyPath(\n {\n key: item.texturePath,\n texturePath: item.texturePath,\n stackQty: item.stackQty || 1,\n isStackable: item.isStackable,\n },\n atlasJSON\n )}\n imgScale={3}\n imgClassname=\"sprite-from-atlas-img--item\"\n />\n {renderStackInfo(item)}\n {renderGems(item)}\n </ErrorBoundary>\n );\n };\n\n const renderEquipment = (itemToRender: IItem | null) => {\n if (\n !itemToRender?.texturePath ||\n !itemToRender.allowedEquipSlotType?.includes(slotSpriteMask!)\n ) {\n return (\n <ErrorBoundary key={uuidv4()}>\n <SpriteFromAtlas\n key={uuidv4()}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={EquipmentSlotSpriteByType[slotSpriteMask!]}\n imgScale={3}\n grayScale={true}\n opacity={0.4}\n imgClassname=\"sprite-from-atlas-img--item\"\n />\n </ErrorBoundary>\n );\n }\n\n return renderItem(itemToRender);\n };\n\n const onRenderSlot = (itemToRender: IItem | null) => {\n switch (containerType) {\n case ItemContainerType.Equipment:\n return renderEquipment(itemToRender);\n default:\n return renderItem(itemToRender);\n }\n };\n\n return <>{onRenderSlot(item)}</>;\n};\n","import {\n ActionsForEquipmentSet,\n ActionsForInventory,\n ActionsForLoot,\n ActionsForMapContainer,\n DepotSocketEvents,\n IItem,\n ItemContainerType,\n ItemSocketEvents,\n ItemSocketEventsDisplayLabels,\n ItemType,\n} from '@rpg-engine/shared';\n\nexport interface IContextMenuItem {\n id: string;\n text: string;\n}\n\nconst generateContextMenuListOptions = (actionsByTypeList: any) => {\n const contextMenu: IContextMenuItem[] = actionsByTypeList.map(\n (action: string) => {\n return { id: action, text: ItemSocketEventsDisplayLabels[action] };\n }\n );\n return contextMenu;\n};\n\nexport const generateContextMenu = (\n item: IItem,\n itemContainerType: ItemContainerType | null,\n isDepotSystem?: boolean\n) => {\n let contextActionMenu: IContextMenuItem[] = [];\n\n if (itemContainerType === ItemContainerType.Inventory) {\n switch (item.type) {\n case ItemType.Weapon:\n case ItemType.Armor:\n case ItemType.Accessory:\n case ItemType.Jewelry:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForInventory.Equipment\n );\n break;\n case ItemType.Container:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForInventory.Container\n );\n break;\n case ItemType.Consumable:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForInventory.Consumable\n );\n break;\n case ItemType.CraftingResource:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForInventory.CraftingResource\n );\n break;\n case ItemType.Tool:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForInventory.Tool\n );\n break;\n\n default:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForInventory.Other\n );\n break;\n }\n\n if (isDepotSystem) {\n contextActionMenu.push({\n id: DepotSocketEvents.Deposit,\n text: 'Deposit',\n });\n }\n\n const contextActionMenuDontHaveUseWith = !contextActionMenu.find(action =>\n action.text.toLowerCase().includes('use with')\n );\n\n if (item.hasUseWith && contextActionMenuDontHaveUseWith) {\n contextActionMenu.push({\n id: ItemSocketEvents.UseWith,\n text: ItemSocketEvents.UseWith,\n });\n }\n }\n if (itemContainerType === ItemContainerType.Equipment) {\n switch (item.type) {\n case ItemType.Container:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForEquipmentSet.Container\n );\n\n break;\n default:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForEquipmentSet.Equipment\n );\n }\n }\n if (itemContainerType === ItemContainerType.Loot) {\n switch (item.type) {\n case ItemType.Weapon:\n case ItemType.Armor:\n case ItemType.Accessory:\n case ItemType.Jewelry:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForLoot.Equipment\n );\n break;\n case ItemType.Consumable:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForLoot.Consumable\n );\n break;\n case ItemType.CraftingResource:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForLoot.CraftingResource\n );\n break;\n case ItemType.Tool:\n contextActionMenu = generateContextMenuListOptions(ActionsForLoot.Tool);\n break;\n default:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForLoot.Other\n );\n break;\n }\n }\n if (itemContainerType === ItemContainerType.MapContainer) {\n switch (item.type) {\n case ItemType.Weapon:\n case ItemType.Armor:\n case ItemType.Accessory:\n case ItemType.Jewelry:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForMapContainer.Equipment\n );\n break;\n case ItemType.Consumable:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForMapContainer.Consumable\n );\n break;\n case ItemType.CraftingResource:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForMapContainer.CraftingResource\n );\n break;\n case ItemType.Tool:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForMapContainer.Tool\n );\n break;\n default:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForMapContainer.Other\n );\n break;\n }\n\n const contextActionMenuDontHaveUseWith = !contextActionMenu.find(action =>\n action.text.toLowerCase().includes('use with')\n );\n\n if (item.hasUseWith && contextActionMenuDontHaveUseWith) {\n contextActionMenu.push({ id: 'use-with', text: 'Use with...' });\n }\n }\n if (itemContainerType === ItemContainerType.Depot) {\n contextActionMenu = [\n {\n id: ItemSocketEvents.GetItemInfo,\n text: ItemSocketEventsDisplayLabels.GetItemInfo,\n },\n { id: DepotSocketEvents.Withdraw, text: 'Withdraw' },\n ];\n }\n\n return contextActionMenu;\n};\n","import { IItem, ItemContainerType } from '@rpg-engine/shared';\nimport React, {\n createContext,\n useCallback,\n useContext,\n useMemo,\n useState,\n} from 'react';\nimport { generateContextMenu, IContextMenuItem } from '../itemContainerHelper';\n\ninterface IPosition {\n x: number;\n y: number;\n}\n\ninterface IItemSlotDetailsState {\n item: IItem | null;\n isTooltipVisible: boolean;\n isTooltipMobileVisible: boolean;\n isContextMenuVisible: boolean;\n contextMenuPosition: IPosition;\n contextActions: IContextMenuItem[];\n clearContextActions: () => void;\n clearDetailsState: () => void;\n}\n\ninterface IItemSlotDetailsContext {\n detailsState: IItemSlotDetailsState;\n updateDetailsState: (newState: Partial<IItemSlotDetailsState>) => void;\n clearDetailsState: () => void;\n setContextActions: (\n item: IItem | null,\n containerType: string | null,\n isDepotSystem: boolean,\n isContextMenuDisabled: boolean\n ) => void;\n clearContextActions: () => void;\n}\n\nconst initialDetailsState: IItemSlotDetailsState = {\n item: null,\n isTooltipVisible: false,\n isTooltipMobileVisible: false,\n isContextMenuVisible: false,\n contextMenuPosition: { x: 0, y: 0 },\n contextActions: [],\n clearContextActions: () => {},\n clearDetailsState: () => {},\n};\n\nconst ItemSlotDetailsContext = createContext<IItemSlotDetailsContext>({\n detailsState: initialDetailsState,\n updateDetailsState: () => {},\n clearDetailsState: () => {},\n setContextActions: () => {},\n clearContextActions: () => {},\n});\n\nexport const useItemSlotDetails = (): IItemSlotDetailsContext =>\n useContext(ItemSlotDetailsContext);\n\ninterface IProps {\n children: React.ReactNode;\n}\n\nexport const ItemSlotDetailsProvider: React.FC<IProps> = ({ children }) => {\n const [detailsState, setDetailsState] = useState<IItemSlotDetailsState>(\n initialDetailsState\n );\n\n const updateDetailsState = useCallback(\n (newState: Partial<IItemSlotDetailsState>): void => {\n setDetailsState(prevState => ({\n ...prevState,\n ...newState,\n }));\n },\n []\n );\n\n const clearDetailsState = useCallback(() => {\n setDetailsState(initialDetailsState);\n }, [setDetailsState]);\n\n const setContextActions = useCallback(\n (\n item: IItem | null,\n containerType: string | null,\n isDepotSystem: boolean,\n isContextMenuDisabled: boolean\n ): void => {\n if (item && containerType && !isContextMenuDisabled) {\n const newContextActions = generateContextMenu(\n item,\n containerType as ItemContainerType,\n isDepotSystem\n );\n updateDetailsState({ contextActions: newContextActions });\n } else {\n updateDetailsState({ contextActions: [] });\n }\n },\n []\n );\n\n const clearContextActions = useCallback(() => {\n updateDetailsState({ contextActions: [] });\n }, [updateDetailsState]);\n\n const contextValue = useMemo(\n () => ({\n detailsState,\n updateDetailsState,\n clearDetailsState,\n setContextActions,\n clearContextActions,\n }),\n [\n detailsState,\n updateDetailsState,\n clearDetailsState,\n setContextActions,\n clearContextActions,\n ]\n );\n\n return (\n <ItemSlotDetailsContext.Provider value={contextValue}>\n {children}\n </ItemSlotDetailsContext.Provider>\n );\n};\n","import { IItem } from '@rpg-engine/shared';\nimport React, {\n createContext,\n useCallback,\n useContext,\n useMemo,\n useState,\n} from 'react';\nimport { IPosition } from '../../../../types/eventTypes';\n\ninterface IDraggingState {\n item: IItem | null;\n isDragging: boolean;\n position: IPosition;\n dropPosition: IPosition | null;\n isFocused: boolean;\n draggingDistance: number;\n}\n\ninterface IDraggingContext {\n draggingState: IDraggingState;\n updateDraggingState: (newState: Partial<IDraggingState>) => void;\n clearDraggingState: () => void;\n}\n\nconst initialDraggingState: IDraggingState = {\n item: null,\n isDragging: false,\n position: { x: 0, y: 0 },\n dropPosition: null,\n isFocused: false,\n draggingDistance: 0,\n};\n\nconst ItemSlotDraggingContext = createContext<IDraggingContext>({\n draggingState: initialDraggingState,\n updateDraggingState: () => {},\n clearDraggingState: () => {},\n});\n\nexport const useItemSlotDragging = (): IDraggingContext =>\n useContext(ItemSlotDraggingContext);\n\ninterface IProps {\n children: React.ReactNode;\n}\n\nexport const ItemSlotDraggingProvider: React.FC<IProps> = ({ children }) => {\n const [draggingState, setDraggingState] = useState<IDraggingState>(\n initialDraggingState\n );\n\n const updateDraggingState = useCallback(\n (newState: Partial<IDraggingState>): void => {\n setDraggingState(prevState => ({\n ...prevState,\n ...newState,\n }));\n },\n []\n );\n\n const clearDraggingState = useCallback(() => {\n setDraggingState(initialDraggingState);\n }, []);\n\n const contextValue = useMemo(\n () => ({\n draggingState,\n updateDraggingState,\n clearDraggingState,\n }),\n [draggingState, updateDraggingState, clearDraggingState]\n );\n\n return (\n <ItemSlotDraggingContext.Provider value={contextValue}>\n {children}\n </ItemSlotDraggingContext.Provider>\n );\n};\n","import {\n IEquipmentSet,\n IItem,\n IItemContainer,\n isMobile,\n ItemContainerType,\n ItemSlotType,\n ItemSubType,\n ItemType,\n} from '@rpg-engine/shared';\n\nimport { observer } from 'mobx-react-lite';\nimport React, { useCallback, useEffect, useRef } from 'react';\nimport Draggable, { DraggableEventHandler } from 'react-draggable';\nimport styled from 'styled-components';\nimport useTouchTarget from '../../../hooks/useTouchTarget';\nimport { IPosition } from '../../../types/eventTypes';\nimport { rarityColor } from './ItemSlotRarity';\nimport { ItemSlotRenderer } from './ItemSlotRenderer';\nimport { useItemSlotDetails } from './context/ItemSlotDetailsContext';\nimport { useItemSlotDragging } from './context/ItemSlotDraggingContext';\n\nexport const EquipmentSlotSpriteByType: any = {\n Neck: 'accessories/corruption-necklace.png',\n LeftHand: 'swords/broad-sword.png',\n Ring: 'rings/iron-ring.png',\n Head: 'helmets/viking-helmet.png',\n Torso: 'armors/iron-armor.png',\n Legs: 'legs/studded-legs.png',\n Feet: 'boots/iron-boots.png',\n Inventory: 'containers/bag.png',\n RightHand: 'shields/plate-shield.png',\n Accessory: 'ranged-weapons/arrow.png',\n};\n\ninterface IProps {\n slotIndex: number;\n item: IItem | null;\n itemContainer?: IItemContainer | null;\n itemContainerType?: ItemContainerType | null;\n slotSpriteMask?: ItemSlotType | null;\n onMouseOver?: (\n event: any,\n slotIndex: number,\n item: IItem | null,\n x: number,\n y: number\n ) => void;\n onMouseOut?: () => void;\n onPointerDown: (\n ItemType: ItemType,\n itemContainerType: ItemContainerType | null,\n item: IItem\n ) => void;\n onDragStart?: (\n item: IItem,\n slotIndex: number,\n itemContainerType: ItemContainerType | null\n ) => void;\n onDragEnd?: (quantity?: number) => void;\n onOutsideDrop?: (item: IItem, position: IPosition) => void;\n dragScale?: number;\n checkIfItemCanBeMoved?: () => boolean;\n checkIfItemShouldDragEnd?: () => boolean;\n openQuantitySelector?: (maxQuantity: number, callback: () => void) => void;\n onPlaceDrop?: (\n item: IItem | null,\n slotIndex: number,\n itemContainerType: ItemContainerType | null\n ) => void;\n atlasJSON: any;\n atlasIMG: any;\n isContextMenuDisabled?: boolean;\n isSelectingShortcut?: boolean;\n equipmentSet?: IEquipmentSet | null;\n setItemShortcut?: (item: IItem, shortcutIndex: number) => void;\n isDepotSystem?: boolean;\n}\n\ninterface IProps {\n slotIndex: number;\n item: IItem | null;\n itemContainer?: IItemContainer | null;\n itemContainerType?: ItemContainerType | null;\n slotSpriteMask?: ItemSlotType | null;\n onMouseOver?: (\n event: any,\n slotIndex: number,\n item: IItem | null,\n x: number,\n y: number\n ) => void;\n onMouseOut?: () => void;\n onPointerDown: (\n ItemType: ItemType,\n itemContainerType: ItemContainerType | null,\n item: IItem\n ) => void;\n onDragStart?: (\n item: IItem,\n slotIndex: number,\n itemContainerType: ItemContainerType | null\n ) => void;\n onDragEnd?: (quantity?: number) => void;\n onOutsideDrop?: (item: IItem, position: IPosition) => void;\n dragScale?: number;\n checkIfItemCanBeMoved?: () => boolean;\n checkIfItemShouldDragEnd?: () => boolean;\n openQuantitySelector?: (maxQuantity: number, callback: () => void) => void;\n onPlaceDrop?: (\n item: IItem | null,\n slotIndex: number,\n itemContainerType: ItemContainerType | null\n ) => void;\n atlasJSON: any;\n atlasIMG: any;\n isContextMenuDisabled?: boolean;\n isSelectingShortcut?: boolean;\n equipmentSet?: IEquipmentSet | null;\n setItemShortcut?: (item: IItem, shortcutIndex: number) => void;\n isDepotSystem?: boolean;\n}\n\nexport const ItemSlot: React.FC<IProps> = observer(\n ({\n slotIndex,\n item,\n itemContainerType: containerType,\n slotSpriteMask,\n onMouseOver,\n onMouseOut,\n onPointerDown,\n atlasJSON,\n atlasIMG,\n isContextMenuDisabled = false,\n onDragEnd,\n onDragStart,\n onPlaceDrop,\n onOutsideDrop: onDrop,\n checkIfItemCanBeMoved,\n openQuantitySelector,\n checkIfItemShouldDragEnd,\n dragScale,\n isSelectingShortcut,\n\n setItemShortcut,\n isDepotSystem,\n }) => {\n const {\n detailsState,\n updateDetailsState,\n setContextActions,\n } = useItemSlotDetails();\n\n const getTouchTarget = useTouchTarget();\n\n const {\n isContextMenuVisible,\n clearDetailsState,\n clearContextActions,\n } = detailsState;\n\n const dragContainer = useRef<HTMLDivElement>(null);\n\n const {\n draggingState,\n updateDraggingState,\n clearDraggingState,\n } = useItemSlotDragging();\n\n const { isFocused, isDragging, draggingDistance } = draggingState;\n\n useEffect(() => {\n // Reset drag position and focus when item changes\n updateDraggingState({\n position: { x: 0, y: 0 },\n isFocused: false,\n });\n }, [\n containerType,\n isDepotSystem,\n setContextActions,\n clearContextActions,\n isContextMenuDisabled, // Added missing dependency\n ]);\n\n useEffect(() => {\n // Reset drag position and focus when item changes\n clearDraggingState();\n\n // Clear context actions when component unmounts or dependencies change\n return () => {\n clearContextActions();\n };\n }, [\n containerType,\n isDepotSystem,\n setContextActions,\n clearContextActions,\n isContextMenuDisabled,\n updateDraggingState, // Add this dependency\n ]);\n\n const resetItem = () => {\n clearDraggingState();\n clearDetailsState();\n };\n\n const onSuccessfulDrag = (quantity?: number) => {\n resetItem();\n\n if (quantity === -1) {\n updateDraggingState({\n position: { x: 0, y: 0 },\n isFocused: false,\n });\n } else if (item) {\n onDragEnd?.(quantity);\n }\n };\n\n const refreshContextActions = () => {\n setContextActions(\n item,\n containerType as ItemContainerType,\n isDepotSystem ?? false,\n isContextMenuDisabled\n );\n };\n\n const onDraggableStop: DraggableEventHandler = (e, data) => {\n requestAnimationFrame(() => {\n updateDraggingState({\n item: null,\n });\n\n let target = e.target as HTMLElement;\n\n if (isMobile()) {\n target = getTouchTarget(e as MouseEvent);\n }\n\n handleShortcutSetter(target);\n removeDraggingClass(target);\n\n const shouldHandleDraggedItemResult = shouldHandleDraggedItem();\n\n if (shouldHandleDraggedItemResult) {\n handleDraggedItem(e, data);\n } else if (item && !isDragging) {\n handleContextMenuOrTooltip(e as React.MouseEvent);\n }\n });\n };\n\n /**\n * Handles the shortcut setter logic if the target element is a shortcut setter.\n */\n const handleShortcutSetter = (target: HTMLElement) => {\n if (target?.id.includes('shortcutSetter') && setItemShortcut && item) {\n const index = parseInt(target.id.split('_')[1], 10);\n if (!isNaN(index)) {\n setItemShortcut(item, index);\n }\n }\n };\n\n /**\n * Removes the dragging CSS class from the target element.\n */\n const removeDraggingClass = (target: HTMLElement) => {\n target.classList.remove('react-draggable-dragging');\n };\n\n /**\n * Determines whether the dragged item should be processed.\n */\n const shouldHandleDraggedItem = (): boolean => {\n return !!(isDragging && draggingState.item && !isSelectingShortcut);\n };\n\n /**\n * Handles the logic when an item has been dragged.\n */\n const handleDraggedItem = useCallback(\n (e: any, data: any) => {\n const targetClasses = Array.from((e.target as HTMLElement).classList);\n const isOutsideDrop =\n targetClasses.some(elm => elm.includes('rpgui-content')) ||\n targetClasses.length === 0;\n\n if (isOutsideDrop && draggingState.isDragging && draggingState.item) {\n console.log('ITEM SLOT: Outside drop', draggingState.item.key);\n onDrop?.(draggingState.item, { x: data.x, y: data.y });\n clearDraggingState();\n } else {\n updateDraggingState({\n dropPosition: {\n x: data.x,\n y: data.y,\n },\n isDragging: false,\n });\n\n const targetElement = dragContainer.current;\n if (!targetElement) return;\n\n const { x, y } = getElementTransform(targetElement);\n\n updateDraggingState({\n position: { x, y },\n });\n\n processDragEnd(item!);\n }\n },\n [\n draggingState.isDragging,\n draggingState.item,\n onDrop,\n clearDraggingState,\n updateDraggingState,\n ]\n );\n\n /**\n * Retrieves the current transform position of the dragged element.\n */\n const getElementTransform = (\n element: HTMLElement\n ): { x: number; y: number } => {\n const style = window.getComputedStyle(element);\n const matrix = new DOMMatrixReadOnly(style.transform);\n return { x: matrix.m41, y: matrix.m42 };\n };\n\n const processDragEnd = useCallback(\n (item: IItem) => {\n if (checkIfItemCanBeMoved?.()) {\n if (checkIfItemShouldDragEnd && !checkIfItemShouldDragEnd()) {\n resetItem();\n return;\n }\n\n if (item.stackQty && item.stackQty !== 1 && openQuantitySelector) {\n openQuantitySelector(item.stackQty, onSuccessfulDrag);\n } else {\n onSuccessfulDrag(item.stackQty);\n }\n } else {\n resetItem();\n }\n },\n [\n checkIfItemCanBeMoved,\n checkIfItemShouldDragEnd,\n openQuantitySelector,\n onSuccessfulDrag,\n resetItem,\n ]\n );\n\n /**\n * Handles the context menu or tooltip display after dragging stops without a drop.\n */\n const handleContextMenuOrTooltip = (\n e: React.MouseEvent | React.TouchEvent\n ) => {\n const isTouchEvent = e.type === 'touchend';\n const shouldShowMobileTooltip =\n !isContextMenuDisabled && isTouchEvent && !isSelectingShortcut;\n const shouldToggleContextMenu =\n !isContextMenuDisabled && !isSelectingShortcut && !isTouchEvent;\n\n if (shouldShowMobileTooltip) {\n updateDetailsState({\n item,\n isTooltipMobileVisible: true,\n isContextMenuVisible: false, // Ensure context menu is hidden\n });\n } else if (shouldToggleContextMenu) {\n const mouseEvent = e as React.MouseEvent;\n updateDetailsState({\n item,\n isContextMenuVisible: !isContextMenuVisible && !isMobile(),\n isTooltipMobileVisible: false, // Ensure mobile tooltip is hidden\n contextMenuPosition: {\n x: mouseEvent.clientX - 10,\n y: mouseEvent.clientY - 5,\n },\n });\n }\n\n if (item) {\n onPointerDown(item.type, containerType ?? null, item);\n }\n };\n\n const onDraggableStart: DraggableEventHandler = () => {\n if (!item || isSelectingShortcut) {\n return;\n }\n\n refreshContextActions();\n\n if (onDragStart && containerType) {\n onDragStart(item, slotIndex, containerType);\n }\n };\n\n const onDraggableProgress: DraggableEventHandler = (_e, _data) => {\n // increment draggingDistance by 1\n updateDraggingState({\n draggingDistance: draggingState.draggingDistance + 1,\n });\n\n if (draggingDistance > 10) {\n updateDraggingState({\n isDragging: true,\n isFocused: true,\n });\n }\n\n if (!draggingState.item) {\n updateDraggingState({\n item: item,\n });\n }\n };\n\n return (\n <Container\n isDraggingItem={!!draggingState.item}\n item={item}\n className=\"rpgui-icon empty-slot\"\n onMouseUp={() => {\n const data = item ? item : null;\n if (onPlaceDrop && containerType)\n onPlaceDrop(data, slotIndex, containerType);\n }}\n onTouchEnd={e => {\n const { clientX, clientY } = e.changedTouches[0];\n const simulatedEvent = new MouseEvent('mouseup', {\n clientX,\n clientY,\n bubbles: true,\n });\n\n document\n .elementFromPoint(clientX, clientY)\n ?.dispatchEvent(simulatedEvent);\n }}\n onPointerDown={\n onDragStart !== undefined && onDragEnd !== undefined\n ? undefined\n : () => {\n if (item) onPointerDown(item.type, containerType ?? null, item);\n }\n }\n isSelectingShortcut={\n isSelectingShortcut &&\n (item?.type === ItemType.Consumable ||\n item?.type === ItemType.Tool ||\n item?.subType === ItemSubType.Seed)\n }\n >\n <Draggable\n axis={isSelectingShortcut ? 'none' : 'both'}\n defaultClassName={item ? 'draggable' : 'empty-slot'}\n scale={dragScale}\n disabled={onDragStart === undefined || onDragEnd === undefined}\n onStop={onDraggableStop}\n onStart={onDraggableStart}\n onDrag={onDraggableProgress}\n position={draggingState.position}\n cancel=\".empty-slot\"\n bounds=\".item-container-body, .equipment-container-body\"\n >\n <ItemContainer\n ref={dragContainer}\n isFocused={isFocused}\n onMouseOver={event => {\n onMouseOver?.(\n event,\n slotIndex,\n item,\n event.clientX,\n event.clientY\n );\n }}\n onMouseOut={() => {\n if (onMouseOut) onMouseOut();\n }}\n onMouseEnter={() => {\n updateDetailsState({\n item,\n isTooltipVisible: true,\n });\n }}\n onMouseLeave={() => {\n updateDetailsState({\n item,\n isTooltipVisible: false,\n });\n }}\n >\n <ItemSlotRenderer\n item={item}\n slotSpriteMask={slotSpriteMask}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n containerType={containerType}\n />\n </ItemContainer>\n </Draggable>\n </Container>\n );\n }\n);\n\ninterface ContainerTypes {\n item: IItem | null;\n containerType?: ItemContainerType | null;\n isSelectingShortcut?: boolean;\n isDraggingItem?: boolean;\n}\n\nconst Container = styled.div<ContainerTypes>`\n margin: 0.1rem;\n\n .react-draggable-dragging {\n // If dragging item, set opacity to 0\n opacity: ${({ isDraggingItem }) => (isDraggingItem ? 0 : 1)};\n }\n\n position: relative;\n\n .sprite-from-atlas-img--item {\n position: relative;\n top: 1.5rem;\n left: 1.5rem;\n border-color: ${({ item }) => rarityColor(item)};\n box-shadow: ${({ item }) => `0 0 5px 2px ${rarityColor(item)}`} inset,\n ${({ item }) => `0 0 4px 3px ${rarityColor(item)}`};\n }\n\n &::before {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 1;\n border-radius: 12px;\n pointer-events: none;\n animation: ${({ isSelectingShortcut }) =>\n isSelectingShortcut ? 'bg-color-change 1s infinite' : 'none'};\n\n @keyframes bg-color-change {\n 0% {\n background-color: rgba(255 255 255 / 0.5);\n }\n 50% {\n background-color: transparent;\n }\n 100% {\n background-color: rgba(255 255 255 / 0.5);\n }\n }\n }\n`;\n\nconst ItemContainer = styled.div<{ isFocused?: boolean }>`\n width: 64px;\n height: 64px;\n\n position: relative;\n ${props => props.isFocused && 'z-index: 100; pointer-events: none;'};\n`;\n","import { useCallback } from 'react';\n\ninterface IEventWithTarget {\n target: EventTarget | null;\n}\n\ninterface ITouchEvent extends IEventWithTarget {\n changedTouches?: TouchList;\n\n touches?: TouchList;\n}\n\nexport function useTouchTarget() {\n const getTouchTarget = useCallback(\n (e: MouseEvent | TouchEvent | IEventWithTarget): HTMLElement => {\n // Check if it's a touch event\n if ('changedTouches' in e || 'touches' in e) {\n const touchEvent = e as ITouchEvent;\n const touch = touchEvent.changedTouches?.[0] || touchEvent.touches?.[0];\n\n if (touch) {\n return document.elementFromPoint(\n touch.clientX,\n touch.clientY\n ) as HTMLElement;\n }\n }\n\n // If it's not a touch event or touch is not available, fallback to target\n return (e.target as HTMLElement) || document.body;\n },\n []\n );\n\n return getTouchTarget;\n}\n\nexport default useTouchTarget;\n","import { IItem } from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../../constants/uiColors';\nimport { uiFonts } from '../../../constants/uiFonts';\nimport { SpriteFromAtlas } from '../../shared/SpriteFromAtlas';\nimport { ErrorBoundary } from '../Inventory/ErrorBoundary';\nimport { EquipmentSlotSpriteByType } from '../Inventory/ItemSlot';\nimport { rarityColor } from '../Inventory/ItemSlotRarity';\n\ninterface IItemInfoProps {\n item: IItem;\n itemToCompare?: IItem;\n atlasIMG: any;\n atlasJSON: any;\n}\n\ninterface IItemStat {\n key: keyof IItem;\n label?: string;\n higherIsWorse?: boolean;\n}\n\nconst statisticsToDisplay: IItemStat[] = [\n { key: 'attack' },\n { key: 'defense' },\n { key: 'maxRange', label: 'Range' },\n { key: 'weight', higherIsWorse: true },\n];\n\nexport const ItemInfo: React.FC<IItemInfoProps> = ({\n item,\n itemToCompare,\n atlasIMG,\n atlasJSON,\n}) => {\n const renderStatistics = () => {\n const statistics: React.ReactNode[] = [];\n\n for (const stat of statisticsToDisplay) {\n const itemStatistic = item[stat.key];\n\n if (itemStatistic) {\n const label =\n stat.label || stat.key[0].toUpperCase() + stat.key.slice(1);\n\n const isItemToCompare = !!itemToCompare;\n\n const isOnlyInOneItem = isItemToCompare && !itemToCompare?.[stat.key];\n const statDiff =\n parseInt(itemStatistic.toString()) -\n parseInt(itemToCompare?.[stat.key]?.toString() ?? '0');\n\n const isDifference = isItemToCompare && statDiff !== 0;\n const isBetter =\n (statDiff > 0 && !stat.higherIsWorse) ||\n (statDiff < 0 && stat.higherIsWorse);\n\n statistics.push(\n <Statistic key={stat.key} className={isOnlyInOneItem ? 'better' : ''}>\n <div className=\"label\">{label}:</div>\n <div\n className={`value ${\n isDifference ? (isBetter ? 'better' : 'worse') : ''\n }`}\n >\n {`${itemStatistic.toString()} ${\n isDifference ? `(${statDiff > 0 ? '+' : ''}${statDiff})` : ''\n }`}\n </div>\n </Statistic>\n );\n }\n }\n\n return statistics;\n };\n\n const renderMissingStatistic = () => {\n const statistics: React.ReactNode[] = [];\n\n for (const stat of statisticsToDisplay) {\n const itemToCompareStatistic = itemToCompare?.[stat.key];\n\n if (itemToCompareStatistic && !item[stat.key]) {\n const label =\n stat.label || stat.key[0].toUpperCase() + stat.key.slice(1);\n\n statistics.push(\n <Statistic key={stat.key} className=\"worse\">\n <div className=\"label\">{label}:</div>\n <div className=\"value worse\">\n {itemToCompareStatistic.toString()}\n </div>\n </Statistic>\n );\n }\n }\n\n return statistics;\n };\n\n const renderEntityEffects = () => {\n if (!item.entityEffects || !item.entityEffectChance) return null;\n\n return item.entityEffects.map((effect, index) => (\n <Statistic key={index} $isSpecial>\n {effect[0].toUpperCase() + effect.slice(1)} ({item.entityEffectChance}%)\n </Statistic>\n ));\n };\n\n const renderAvaibleSlots = () => {\n if (!item.allowedEquipSlotType) return null;\n\n return item.allowedEquipSlotType.map((slotType, index) => (\n <ErrorBoundary key={index}>\n <SpriteFromAtlas\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={EquipmentSlotSpriteByType[slotType]}\n imgScale={2}\n grayScale={true}\n opacity={0.4}\n containerStyle={{ width: '32px', height: '32px' }}\n />\n </ErrorBoundary>\n ));\n };\n\n const skillName = item.minRequirements?.skill?.name;\n\n return (\n <Container item={item}>\n <Header>\n <div>\n <Title>{item.name}</Title>\n {item.rarity !== 'Common' && (\n <Rarity item={item}>{item.rarity}</Rarity>\n )}\n <Type>{item.subType}</Type>\n </div>\n <AllowedSlots>{renderAvaibleSlots()}</AllowedSlots>\n </Header>\n\n {item.minRequirements && (\n <LevelRequirement>\n <div className=\"title\">Requirements:</div>\n <div>- Level: {item.minRequirements?.level}</div>\n {skillName && (\n <div>\n - {skillName.charAt(0).toUpperCase() + skillName.slice(1)}:{' '}\n {item.minRequirements?.skill?.level}\n </div>\n )}\n </LevelRequirement>\n )}\n\n {renderStatistics()}\n {renderEntityEffects()}\n {item.usableEffectDescription && (\n <Statistic $isSpecial>{item.usableEffectDescription}</Statistic>\n )}\n {item.equippedBuffDescription && (\n <Statistic $isSpecial>{item.equippedBuffDescription}</Statistic>\n )}\n {item.isTwoHanded && <Statistic $isSpecial>Two handed</Statistic>}\n\n <Description>{item.description}</Description>\n\n {item.maxStackSize && item.maxStackSize !== 1 && (\n <StackInfo>\n x{Math.round((item.stackQty ?? 1) * 100) / 100}({item.maxStackSize})\n </StackInfo>\n )}\n\n {renderMissingStatistic().length > 0 && (\n <MissingStatistics>\n <Statistic>Equipped Diff</Statistic>\n {itemToCompare && renderMissingStatistic()}\n </MissingStatistics>\n )}\n </Container>\n );\n};\n\nconst Container = styled.div<{ item: IItem }>`\n color: white;\n background-color: #222;\n border-radius: 5px;\n padding: 0.5rem;\n font-size: ${uiFonts.size.small};\n border: 3px solid ${({ item }) => rarityColor(item) ?? uiColors.lightGray};\n height: max-content;\n width: 18rem;\n\n @media (max-width: 640px) {\n width: 80vw;\n }\n`;\n\nconst Title = styled.div`\n font-size: ${uiFonts.size.medium};\n font-weight: bold;\n margin-bottom: 0.5rem;\n display: flex;\n align-items: center;\n margin: 0;\n`;\n\nconst Rarity = styled.div<{ item: IItem }>`\n font-size: ${uiFonts.size.small};\n font-weight: normal;\n margin-top: 0.2rem;\n color: ${({ item }) => rarityColor(item)};\n filter: brightness(1.5);\n`;\n\nconst Type = styled.div`\n font-size: ${uiFonts.size.small};\n margin-top: 0.2rem;\n color: ${uiColors.lightGray};\n`;\n\nconst LevelRequirement = styled.div`\n font-size: ${uiFonts.size.small};\n margin-top: 0.2rem;\n margin-bottom: 1rem;\n color: ${uiColors.orange};\n\n .title {\n margin-bottom: 4px;\n }\n\n div {\n margin-bottom: 2px;\n }\n`;\n\nconst Statistic = styled.div<{ $isSpecial?: boolean }>`\n margin-bottom: 0.4rem;\n width: 100%;\n color: ${({ $isSpecial }) => ($isSpecial ? uiColors.darkYellow : 'inherit')};\n\n .label {\n display: inline-block;\n margin-right: 0.5rem;\n color: inherit;\n }\n\n .value {\n display: inline-block;\n color: inherit;\n }\n\n &.better,\n .better {\n color: ${uiColors.lightGreen};\n }\n\n &.worse,\n .worse {\n color: ${uiColors.cardinal};\n }\n`;\n\nconst Description = styled.div`\n margin-top: 1.5rem;\n font-size: ${uiFonts.size.small};\n color: ${uiColors.lightGray};\n font-style: italic;\n`;\n\nconst Header = styled.div`\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-bottom: 0.5rem;\n`;\n\nconst AllowedSlots = styled.div`\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 0.5rem;\n margin-left: auto;\n align-self: flex-start;\n`;\n\nconst StackInfo = styled.div`\n width: 100%;\n text-align: right;\n font-size: ${uiFonts.size.small};\n color: ${uiColors.orange};\n margin-top: 1rem;\n`;\n\nconst MissingStatistics = styled.div`\n margin-top: 1rem;\n color: ${uiColors.cardinal};\n`;\n","import { IEquipmentSet, IItem } from '@rpg-engine/shared';\nimport { camelCase } from 'lodash';\nimport React, { useMemo } from 'react';\nimport styled from 'styled-components';\nimport { ItemInfo } from './ItemInfo';\n\nexport interface IItemInfoDisplayProps {\n item: IItem;\n atlasIMG: any;\n atlasJSON: any;\n equipmentSet?: IEquipmentSet | null;\n isMobile?: boolean;\n}\n\ntype EquipmentSlotTypes =\n | 'head'\n | 'neck'\n | 'leftHand'\n | 'rightHand'\n | 'ring'\n | 'legs'\n | 'boot'\n | 'accessory'\n | 'armor'\n | 'inventory';\n\nconst itemSlotTypes: EquipmentSlotTypes[] = [\n 'head',\n 'neck',\n 'leftHand',\n 'rightHand',\n 'ring',\n 'legs',\n 'boot',\n 'accessory',\n 'armor',\n 'inventory',\n];\n\nconst getSlotType = (\n itemSlotTypes: string[],\n slotType: string,\n subType: string\n): keyof IEquipmentSet => {\n if (!itemSlotTypes.includes(slotType)) {\n return subType as keyof IEquipmentSet;\n }\n return slotType as keyof IEquipmentSet;\n};\n\nexport const ItemInfoDisplay: React.FC<IItemInfoDisplayProps> = ({\n item,\n atlasIMG,\n atlasJSON,\n equipmentSet,\n isMobile,\n}) => {\n const itemToCompare = useMemo(() => {\n if (equipmentSet && item.allowedEquipSlotType?.length) {\n const allowedSlotTypeCamelCase = camelCase(item.allowedEquipSlotType[0]);\n const itemSubTypeCamelCase = camelCase(item.subType);\n\n const slotType = getSlotType(\n itemSlotTypes,\n allowedSlotTypeCamelCase,\n itemSubTypeCamelCase\n );\n\n const itemSubTypeFromEquipment = Object.values(equipmentSet).find(\n item => camelCase(item?.subType ?? '') === itemSubTypeCamelCase\n );\n\n const itemFromEquipment = itemSubTypeFromEquipment\n ? itemSubTypeFromEquipment\n : (equipmentSet[slotType] as IItem);\n\n if (\n itemFromEquipment &&\n (!item._id || itemFromEquipment._id !== item._id)\n ) {\n return itemFromEquipment;\n }\n }\n\n return undefined;\n }, [equipmentSet, item]);\n\n return (\n <Flex $isMobile={isMobile}>\n <ItemInfo\n item={item}\n itemToCompare={itemToCompare}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n />\n\n {itemToCompare && (\n <CompareContainer>\n <Equipped>\n <span>Equipped</span>\n </Equipped>\n <ItemInfo\n item={itemToCompare}\n itemToCompare={item}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n />\n </CompareContainer>\n )}\n </Flex>\n );\n};\n\nconst Flex = styled.div<{ $isMobile?: boolean }>`\n display: flex;\n gap: 0.5rem;\n flex-direction: ${({ $isMobile }) => ($isMobile ? 'row-reverse' : 'row')};\n align-items: center;\n\n @media (max-width: 640px) {\n flex-direction: column-reverse;\n align-items: center;\n }\n`;\n\nconst Equipped = styled.div`\n position: absolute;\n bottom: 100%;\n left: 50%;\n transform: translateX(-50%);\n`;\n\nconst CompareContainer = styled.div`\n position: relative;\n`;\n","import { IEquipmentSet, IItem } from '@rpg-engine/shared';\nimport React, { useEffect, useRef } from 'react';\nimport styled from 'styled-components';\nimport ModalPortal from '../../Abstractions/ModalPortal';\nimport { ItemInfoDisplay } from './ItemInfoDisplay';\n\nexport interface IItemTooltipProps {\n item: IItem;\n atlasIMG: any;\n atlasJSON: any;\n equipmentSet?: IEquipmentSet | null;\n}\n\nconst offset = 20;\n\nexport const ItemTooltip: React.FC<IItemTooltipProps> = ({\n item,\n atlasIMG,\n atlasJSON,\n equipmentSet,\n}) => {\n const ref = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const { current } = ref;\n\n if (current) {\n const handleMouseMove = (event: MouseEvent) => {\n const { clientX, clientY } = event;\n\n // Adjust the position of the tooltip based on the mouse position\n const rect = current.getBoundingClientRect();\n\n const tooltipWidth = rect.width;\n const tooltipHeight = rect.height;\n const isOffScreenRight =\n clientX + tooltipWidth + offset > window.innerWidth;\n const isOffScreenBottom =\n clientY + tooltipHeight + offset > window.innerHeight;\n const x = isOffScreenRight\n ? clientX - tooltipWidth - offset\n : clientX + offset;\n const y = isOffScreenBottom\n ? clientY - tooltipHeight - offset\n : clientY + offset;\n\n current.style.transform = `translate(${x}px, ${y}px)`;\n current.style.opacity = '1';\n };\n\n window.addEventListener('mousemove', handleMouseMove);\n\n return () => {\n window.removeEventListener('mousemove', handleMouseMove);\n };\n }\n\n return;\n }, []);\n\n return (\n <ModalPortal>\n <Container ref={ref}>\n <ItemInfoDisplay\n item={item}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n equipmentSet={equipmentSet}\n />\n </Container>\n </ModalPortal>\n );\n};\n\nconst Container = styled.div`\n position: absolute;\n z-index: 100;\n pointer-events: none;\n left: 0;\n top: 0;\n opacity: 0;\n transition: opacity 0.08s;\n`;\n","import { IEquipmentSet, IItem } from '@rpg-engine/shared';\nimport React, { useRef } from 'react';\nimport styled from 'styled-components';\nimport ModalPortal from '../../Abstractions/ModalPortal';\nimport { ItemInfoDisplay } from './ItemInfoDisplay';\n\ninterface IListMenuOption {\n id: string;\n text: string;\n}\n\nexport interface MobileItemTooltipProps {\n item: IItem;\n atlasIMG: any;\n atlasJSON: any;\n closeTooltip: () => void;\n equipmentSet?: IEquipmentSet | null;\n scale?: number;\n options?: IListMenuOption[];\n onSelected?: (selectedOptionId: string) => void;\n}\n\nexport const MobileItemTooltip: React.FC<MobileItemTooltipProps> = ({\n item,\n atlasIMG,\n atlasJSON,\n closeTooltip,\n equipmentSet,\n scale = 1,\n options,\n onSelected,\n}) => {\n const ref = useRef<HTMLDivElement>(null);\n\n const handleFadeOut = () => {\n ref.current?.classList.add('fadeOut');\n };\n\n return (\n <ModalPortal>\n <Container\n ref={ref}\n onTouchEnd={() => {\n handleFadeOut();\n setTimeout(() => {\n closeTooltip();\n }, 100);\n }}\n scale={scale}\n >\n <ItemInfoDisplay\n item={item}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n equipmentSet={equipmentSet}\n isMobile\n />\n <OptionsContainer>\n {options?.map(option => (\n <Option\n key={option.id}\n onTouchEnd={() => {\n handleFadeOut();\n setTimeout(() => {\n onSelected?.(option.id);\n closeTooltip();\n }, 100);\n }}\n >\n {option.text}\n </Option>\n ))}\n </OptionsContainer>\n </Container>\n </ModalPortal>\n );\n};\n\nconst Container = styled.div<{ scale: number }>`\n position: absolute;\n z-index: 100;\n left: 0;\n top: 0;\n width: 100vw;\n height: 100vh;\n background-color: rgba(0 0 0 / 0.5);\n display: flex;\n justify-content: center;\n align-items: center;\n gap: 0.5rem;\n transition: opacity 0.08s;\n animation: fadeIn 0.1s forwards;\n\n @keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 0.92;\n }\n }\n\n @keyframes fadeOut {\n 0% {\n opacity: 0.92;\n }\n 100% {\n opacity: 0;\n }\n }\n\n &.fadeOut {\n animation: fadeOut 0.1s forwards;\n }\n\n @media (max-width: 640px) {\n flex-direction: column;\n }\n`;\n\nconst OptionsContainer = styled.div`\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n flex-wrap: wrap;\n\n @media (max-width: 640px) {\n flex-direction: row;\n justify-content: center;\n }\n`;\n\nconst Option = styled.button`\n padding: 1rem;\n background-color: #333;\n color: white;\n border: none;\n border-radius: 3px;\n width: 8rem;\n transition: background-color 0.1s;\n\n &:hover {\n background-color: #555;\n }\n\n @media (max-width: 640px) {\n padding: 1rem 0.5rem;\n }\n`;\n","import { IEquipmentSet, IItem } from '@rpg-engine/shared';\nimport React, { useState } from 'react';\nimport { ItemTooltip } from './ItemTooltip';\nimport { MobileItemTooltip } from './MobileItemTooltip';\n\ninterface IItemInfoWrapperProps {\n item: IItem;\n children: React.ReactNode;\n atlasIMG: any;\n atlasJSON: any;\n equipmentSet?: IEquipmentSet | null;\n scale?: number;\n}\n\nexport const ItemInfoWrapper: React.FC<IItemInfoWrapperProps> = ({\n children,\n atlasIMG,\n atlasJSON,\n item,\n equipmentSet,\n scale,\n}) => {\n const [isTooltipVisible, setIsTooltipVisible] = useState(false);\n const [isTooltipMobileVisible, setIsTooltipMobileVisible] = useState(false);\n\n return (\n <div\n onMouseEnter={() => {\n if (!isTooltipMobileVisible) setIsTooltipVisible(true);\n }}\n onMouseLeave={setIsTooltipVisible.bind(null, false)}\n onTouchEnd={() => {\n setIsTooltipMobileVisible(true);\n setIsTooltipVisible(false);\n }}\n >\n {children}\n\n {isTooltipVisible && !isTooltipMobileVisible && (\n <ItemTooltip\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n equipmentSet={equipmentSet}\n item={item}\n />\n )}\n {isTooltipMobileVisible && (\n <MobileItemTooltip\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n equipmentSet={equipmentSet}\n closeTooltip={() => {\n setIsTooltipMobileVisible(false);\n console.log('close');\n }}\n item={item}\n scale={scale}\n />\n )}\n </div>\n );\n};\n","import { IItem, IItemContainer } from \"@rpg-engine/shared\";\n\nexport const countItemFromInventory = (itemKey: string, inventory: IItemContainer) => {\n let itemsFromInventory: (IItem | undefined | null)[] = [];\n\n if (inventory) {\n Object.keys(inventory.slots).forEach(i => {\n const index = parseInt(i);\n\n if (inventory.slots[index]?.key === itemKey) {\n itemsFromInventory.push(inventory.slots[index]);\n }\n });\n }\n\n const totalQty = itemsFromInventory.reduce(\n (acc, item) => acc + (item?.stackQty || 1),\n 0\n );\n\n return totalQty;\n};","export const modifyString = (str: string): string => {\n let parts = str.split('/');\n let fileName = parts[parts.length - 1];\n parts = fileName.split('.');\n let name = parts[0];\n name = name.replace(/-/g, ' ');\n let words = name.split(' ');\n let firstWord = words[0].slice(0, 1).toUpperCase() + words[0].slice(1);\n let modifiedWords = [firstWord].concat(words.slice(1));\n return modifiedWords.join(' ');\n};\n","import { ICraftableItem, IItemContainer, ISkill } from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\nimport { countItemFromInventory } from '../../libs/itemCounter';\nimport { SpriteFromAtlas } from '../shared/SpriteFromAtlas';\nimport { modifyString } from './utils/modifyString';\n\ninterface ICraftingTooltipProps {\n x: number;\n y: number;\n recipe: ICraftableItem;\n inventory?: IItemContainer | null;\n skills?: ISkill | null;\n atlasIMG: any;\n atlasJSON: any;\n}\n\nconst TooltipContainer = styled.div<{ x: number; y: number }>`\n position: fixed;\n left: ${props => props.x}px;\n top: ${props => props.y}px;\n background-color: rgba(0, 0, 0, 0.95);\n color: white;\n text-align: left;\n border-radius: 4px;\n padding: 10px;\n z-index: 1000;\n font-family: 'Press Start 2P', cursive;\n font-size: 0.6rem;\n width: max-content;\n max-width: 250px;\n white-space: normal;\n border: 1px solid ${uiColors.darkGray};\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n line-height: 1.4;\n\n /* Arrow */\n &:before {\n content: '';\n position: absolute;\n top: 12px;\n left: -6px;\n border-width: 6px 6px 6px 0;\n border-style: solid;\n border-color: transparent rgba(0, 0, 0, 0.95) transparent transparent;\n }\n`;\n\nconst MinCraftingRequirementsText = styled.div<{ levelIsOk: boolean }>`\n font-size: 0.55rem;\n margin: 0;\n margin-bottom: 12px;\n color: ${({ levelIsOk }) =>\n levelIsOk ? uiColors.lightGreen : uiColors.lightGray} !important;\n`;\n\nconst IngredientsTitle = styled.div`\n color: ${uiColors.yellow};\n font-size: 0.6rem;\n margin-bottom: 12px;\n text-transform: uppercase;\n letter-spacing: 0.5px;\n`;\n\nconst Recipe = styled.div`\n display: flex;\n align-items: center;\n font-size: 0.55rem;\n margin-bottom: 8px;\n margin-left: 4px;\n\n &:last-child {\n margin-bottom: 0;\n }\n\n .sprite-from-atlas-img {\n top: 0px;\n left: 0px;\n }\n`;\n\nconst Ingredient = styled.div<{ isQuantityOk: boolean }>`\n margin: 0;\n margin-left: 14px;\n color: ${({ isQuantityOk }) =>\n isQuantityOk ? uiColors.lightGreen : uiColors.lightGray} !important;\n`;\n\nexport const CraftingTooltip: React.FC<ICraftingTooltipProps> = ({\n x,\n y,\n recipe,\n inventory,\n skills,\n atlasIMG,\n atlasJSON,\n}) => {\n const levelInSkill =\n (skills?.[\n (recipe?.minCraftingRequirements?.[0] ?? '') as keyof ISkill\n ] as any)?.level ?? 1;\n\n const levelIsOk = recipe?.levelIsOk ?? false;\n\n return (\n <TooltipContainer x={x} y={y}>\n <MinCraftingRequirementsText levelIsOk={levelIsOk}>\n {modifyString(`${recipe?.minCraftingRequirements?.[0] ?? ''}`)} lvl{' '}\n {recipe?.minCraftingRequirements?.[1] ?? 0} ({levelInSkill})\n </MinCraftingRequirementsText>\n\n <IngredientsTitle>Ingredients</IngredientsTitle>\n {recipe.ingredients.map((ingredient, index) => {\n const itemQtyInInventory = !inventory\n ? 0\n : countItemFromInventory(ingredient.key, inventory);\n const isQuantityOk = ingredient.qty <= itemQtyInInventory;\n\n return (\n <Recipe key={index}>\n <SpriteFromAtlas\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={ingredient.texturePath}\n imgScale={1.2}\n />\n <Ingredient isQuantityOk={isQuantityOk}>\n {modifyString(ingredient.key)} x{ingredient.qty} (\n {itemQtyInInventory})\n </Ingredient>\n </Recipe>\n );\n })}\n </TooltipContainer>\n );\n};\n","import {\n ICraftableItem,\n IEquipmentSet,\n IItemContainer,\n ISkill,\n} from '@rpg-engine/shared';\nimport React, { useEffect, useRef, useState } from 'react';\nimport { createPortal } from 'react-dom';\nimport styled from 'styled-components';\nimport { ItemInfoWrapper } from '../Item/Cards/ItemInfoWrapper';\nimport { SpriteFromAtlas } from '../shared/SpriteFromAtlas';\nimport { CraftingTooltip } from './CraftingTooltip';\nimport { modifyString } from './utils/modifyString';\n\ninterface ICraftingRecipeProps {\n atlasJSON: any;\n atlasIMG: any;\n equipmentSet?: IEquipmentSet | null;\n recipe: ICraftableItem;\n scale?: number;\n handleRecipeSelect: () => void;\n selectedCraftItemKey?: string;\n inventory?: IItemContainer | null;\n skills?: ISkill | null;\n}\n\nconst RadioOptionsWrapper = styled.div`\n display: flex;\n align-items: stretch;\n margin-bottom: 0.5rem;\n padding: 8px;\n position: relative;\n cursor: pointer;\n`;\n\nconst SpriteAtlasWrapper = styled.div`\n margin-right: 40px;\n flex-shrink: 0;\n width: 32px;\n height: 32px;\n display: flex;\n align-items: center;\n justify-content: center;\n`;\n\nconst MainContent = styled.div`\n flex: 1;\n min-width: 0;\n`;\n\nconst ItemHeader = styled.div`\n display: flex;\n align-items: center;\n gap: 8px;\n margin-bottom: 4px;\n\n label {\n font-size: 0.9rem;\n font-weight: bold;\n display: flex;\n align-items: center;\n }\n`;\n\nexport const CraftingRecipe: React.FC<ICraftingRecipeProps> = ({\n atlasIMG,\n atlasJSON,\n equipmentSet,\n recipe,\n scale,\n handleRecipeSelect,\n selectedCraftItemKey,\n inventory,\n skills,\n}) => {\n const [showTooltip, setShowTooltip] = useState(false);\n const [tooltipPosition, setTooltipPosition] = useState({ x: 0, y: 0 });\n const wrapperRef = useRef<HTMLDivElement>(null);\n\n const isSelected = selectedCraftItemKey === recipe.key;\n\n useEffect(() => {\n const handleClickOutside = (event: MouseEvent) => {\n if (\n wrapperRef.current &&\n !wrapperRef.current.contains(event.target as Node)\n ) {\n setShowTooltip(false);\n }\n };\n\n document.addEventListener('mousedown', handleClickOutside);\n return () => {\n document.removeEventListener('mousedown', handleClickOutside);\n };\n }, []);\n\n const handleClick = () => {\n if (wrapperRef.current) {\n const rect = wrapperRef.current.getBoundingClientRect();\n setTooltipPosition({\n x: rect.right + 10,\n y: rect.top,\n });\n setShowTooltip(true);\n }\n };\n\n return (\n <RadioOptionsWrapper ref={wrapperRef} onClick={handleClick}>\n <SpriteAtlasWrapper>\n <ItemInfoWrapper\n item={recipe}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n equipmentSet={equipmentSet}\n scale={scale}\n >\n <SpriteFromAtlas\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={recipe.texturePath}\n imgScale={3}\n grayScale={!recipe.canCraft}\n />\n </ItemInfoWrapper>\n </SpriteAtlasWrapper>\n\n <MainContent>\n <ItemHeader\n onPointerUp={recipe.canCraft ? handleRecipeSelect : undefined}\n >\n <input\n className=\"rpgui-radio\"\n type=\"radio\"\n value={recipe.name}\n name=\"test\"\n disabled={!recipe.canCraft}\n checked={isSelected}\n onChange={handleRecipeSelect}\n />\n <label>{modifyString(recipe.name)}</label>\n </ItemHeader>\n </MainContent>\n\n {showTooltip &&\n createPortal(\n <CraftingTooltip\n x={tooltipPosition.x}\n y={tooltipPosition.y}\n recipe={recipe}\n inventory={inventory}\n skills={skills}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n />,\n document.body\n )}\n </RadioOptionsWrapper>\n );\n};\n","import {\n ICraftableItem,\n IEquipmentSet,\n IItemContainer,\n ISkill,\n ItemSubType,\n} from '@rpg-engine/shared';\nimport React, { useEffect, useState } from 'react';\nimport {\n FaChevronLeft,\n FaChevronRight,\n FaSearch,\n FaThumbtack,\n} from 'react-icons/fa';\nimport styled from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\nimport { useLocalStorage } from '../../hooks/useLocalStorage';\nimport { Button, ButtonTypes } from '../Button';\nimport { DraggableContainer } from '../DraggableContainer';\nimport { Dropdown, IOptionsProps } from '../Dropdown';\nimport { RPGUIContainerTypes } from '../RPGUI/RPGUIContainer';\nimport { CraftingRecipe } from './CraftingRecipe';\nimport { calculateMaxCraftable } from './utils/calculateMaxCraftable';\n\nexport interface IItemCraftSelectorProps {\n atlasJSON: any;\n atlasIMG: any;\n onClose: () => void;\n onSelect: (value: string) => void;\n onCraftItem: (value: string | undefined, maxCraftable: number) => void;\n craftablesItems: ICraftableItem[];\n equipmentSet?: IEquipmentSet | null;\n inventory?: IItemContainer | null;\n scale?: number;\n skills?: ISkill | null;\n savedSelectedType?: string;\n}\n\nexport interface ShowMessage {\n show: boolean;\n index: number;\n}\n\nconst desktop = {\n width: 'min(900px, 80%)',\n height: 'min(700px, 80%)',\n};\n\nconst mobileLanscape = {\n width: '800px',\n height: '500px',\n};\n\nconst mobilePortrait = {\n width: '500px',\n height: '700px',\n};\n\nconst ITEMS_PER_PAGE = 8;\n\nexport const CraftBook: React.FC<IItemCraftSelectorProps> = ({\n atlasIMG,\n atlasJSON,\n onClose,\n onSelect,\n onCraftItem,\n craftablesItems,\n equipmentSet,\n scale,\n inventory,\n skills,\n savedSelectedType,\n}) => {\n const [craftItemKey, setCraftItemKey] = useState<string>();\n const [selectedType, setSelectedType] = useState<string>(\n savedSelectedType ?? Object.keys(ItemSubType)[0]\n );\n const [size, setSize] = useState<{ width: string; height: string }>();\n const [searchTerm, setSearchTerm] = useState('');\n const [isSearchVisible, setIsSearchVisible] = useState(false);\n const [isCraftingDisabled, setIsCraftingDisabled] = useState(false);\n const [pinnedItems, setPinnedItems] = useLocalStorage<string[]>(\n 'pinnedCraftItems',\n []\n );\n const [currentPage, setCurrentPage] = useState(1);\n\n useEffect(() => {\n const handleResize = (): void => {\n if (\n window.innerWidth < 500 &&\n size?.width !== mobilePortrait.width &&\n (!scale || scale < 1)\n ) {\n setSize(mobilePortrait);\n } else if (\n (!scale || scale < 1) &&\n size?.width !== mobileLanscape.width\n ) {\n setSize(mobileLanscape);\n } else if (size?.width !== desktop.width) {\n setSize(desktop);\n }\n };\n handleResize();\n\n window.addEventListener('resize', handleResize);\n\n return () => window.removeEventListener('resize', handleResize);\n }, [scale]);\n\n const togglePinItem = (itemKey: string) => {\n setPinnedItems(current =>\n current.includes(itemKey)\n ? current.filter(key => key !== itemKey)\n : [...current, itemKey]\n );\n };\n\n const categoryOptions: IOptionsProps[] = [\n 'Suggested',\n ...(pinnedItems.length > 0 ? ['Pinned'] : []),\n ...Object.keys(ItemSubType),\n ]\n .filter(type => type !== 'DeadBody')\n .sort((a, b) => {\n if (a === 'Suggested') return -1;\n if (b === 'Suggested') return 1;\n if (a === 'Pinned') return -1;\n if (b === 'Pinned') return 1;\n return a.localeCompare(b);\n })\n .map((type, index) => ({\n id: index,\n value: type,\n option: type,\n }));\n\n const filteredCraftableItems = craftablesItems?.filter(item => {\n const matchesSearch = item.name\n .toLowerCase()\n .includes(searchTerm.toLowerCase());\n const matchesCategory =\n selectedType === 'Suggested' ||\n (selectedType === 'Pinned' && pinnedItems.includes(item.key)) ||\n item.type === selectedType;\n return matchesSearch && matchesCategory;\n });\n\n const sortedItems = [...(filteredCraftableItems || [])].sort((a, b) => {\n const aIsPinned = pinnedItems.includes(a.key);\n const bIsPinned = pinnedItems.includes(b.key);\n if (aIsPinned && !bIsPinned) return -1;\n if (!aIsPinned && bIsPinned) return 1;\n return 0;\n });\n\n const totalPages = Math.ceil(sortedItems.length / ITEMS_PER_PAGE);\n const paginatedItems = sortedItems.slice(\n (currentPage - 1) * ITEMS_PER_PAGE,\n currentPage * ITEMS_PER_PAGE\n );\n\n useEffect(() => {\n setCurrentPage(1);\n }, [selectedType, searchTerm]);\n\n if (!size) return null;\n\n return (\n <DraggableContainer\n type={RPGUIContainerTypes.Framed}\n width={size.width}\n height={size.height}\n cancelDrag=\".inputRadioCraftBook\"\n onCloseButton={onClose}\n scale={scale}\n >\n <Wrapper>\n <HeaderContainer>\n <Title>Craftbook</Title>\n <HeaderControls>\n <DropdownWrapper>\n <Dropdown\n options={categoryOptions}\n onChange={value => {\n setSelectedType(value);\n onSelect(value);\n }}\n width=\"200px\"\n />\n </DropdownWrapper>\n <SearchButton onClick={() => setIsSearchVisible(!isSearchVisible)}>\n <FaSearch size={16} />\n </SearchButton>\n </HeaderControls>\n </HeaderContainer>\n\n {isSearchVisible && (\n <SearchContainer>\n <input\n type=\"text\"\n className=\"rpgui-input\"\n placeholder=\"Search items...\"\n value={searchTerm}\n onChange={e => setSearchTerm(e.target.value)}\n autoFocus\n />\n </SearchContainer>\n )}\n\n <ContentContainer>\n <RadioInputScroller className=\"inputRadioCraftBook\">\n {paginatedItems?.map(item => (\n <CraftingRecipeWrapper\n key={item.key}\n isSelected={pinnedItems.includes(item.key)}\n >\n <PinButton\n onClick={e => {\n e.stopPropagation();\n togglePinItem(item.key);\n }}\n isPinned={pinnedItems.includes(item.key)}\n >\n <FaThumbtack size={14} />\n </PinButton>\n <CraftingRecipe\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n equipmentSet={equipmentSet}\n recipe={item}\n scale={scale}\n handleRecipeSelect={setCraftItemKey.bind(null, item.key)}\n selectedCraftItemKey={craftItemKey}\n inventory={inventory}\n skills={skills}\n />\n </CraftingRecipeWrapper>\n ))}\n </RadioInputScroller>\n </ContentContainer>\n\n <PaginationContainer>\n <PaginationButton\n onClick={() => setCurrentPage(prev => Math.max(1, prev - 1))}\n disabled={currentPage === 1}\n >\n <FaChevronLeft size={12} />\n </PaginationButton>\n <PageInfo>\n Page {currentPage} of {totalPages}\n </PageInfo>\n <PaginationButton\n onClick={() =>\n setCurrentPage(prev => Math.min(totalPages, prev + 1))\n }\n disabled={currentPage === totalPages}\n >\n <FaChevronRight size={12} />\n </PaginationButton>\n </PaginationContainer>\n\n <Footer>\n <Button buttonType={ButtonTypes.RPGUIButton} onPointerDown={onClose}>\n Cancel\n </Button>\n <Button\n disabled={!craftItemKey || isCraftingDisabled}\n buttonType={ButtonTypes.RPGUIButton}\n onPointerDown={() => {\n if (!craftItemKey || isCraftingDisabled) return;\n\n const selectedItem = craftablesItems.find(\n item => item.key === craftItemKey\n );\n const maxCraftable = calculateMaxCraftable(\n selectedItem,\n inventory\n );\n\n onCraftItem(craftItemKey, maxCraftable);\n setIsCraftingDisabled(true);\n\n setTimeout(() => {\n setIsCraftingDisabled(false);\n }, 2000);\n }}\n >\n Craft\n </Button>\n </Footer>\n </Wrapper>\n </DraggableContainer>\n );\n};\n\nconst Wrapper = styled.div`\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n\n & > * {\n box-sizing: border-box;\n }\n`;\n\nconst HeaderContainer = styled.div`\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n padding: 16px 16px 0;\n`;\n\nconst Title = styled.h1`\n font-size: 1.2rem;\n color: ${uiColors.yellow} !important;\n margin: 0;\n text-shadow: 2px 2px 2px rgba(0, 0, 0, 0.5);\n`;\n\nconst HeaderControls = styled.div`\n display: flex;\n align-items: center;\n gap: 16px;\n position: relative;\n left: -2rem;\n`;\n\nconst DropdownWrapper = styled.div`\n width: 200px;\n`;\n\nconst SearchButton = styled.button`\n background: none;\n border: none;\n cursor: pointer;\n padding: 8px;\n width: 32px;\n height: 32px;\n color: ${uiColors.yellow};\n opacity: 0.8;\n transition: opacity 0.2s;\n display: flex;\n align-items: center;\n justify-content: center;\n\n &:hover {\n opacity: 1;\n }\n`;\n\nconst SearchContainer = styled.div`\n padding: 0 16px;\n margin-top: 16px;\n\n input {\n width: 100%;\n font-size: 0.8rem;\n padding: 8px 12px;\n background-color: rgba(0, 0, 0, 0.3);\n border: none;\n color: white;\n border-radius: 4px;\n\n &::placeholder {\n color: rgba(255, 255, 255, 0.5);\n }\n\n &:focus {\n outline: none;\n background-color: rgba(0, 0, 0, 0.4);\n }\n }\n`;\n\nconst ContentContainer = styled.div`\n flex: 1;\n min-height: 0;\n padding: 16px;\n padding-right: 0;\n padding-bottom: 0;\n overflow: hidden;\n width: 100%;\n`;\n\nconst RadioInputScroller = styled.div`\n height: 100%;\n overflow-y: scroll;\n overflow-x: hidden;\n padding: 8px 16px;\n padding-right: 24px;\n width: 100%;\n box-sizing: border-box;\n\n display: grid;\n grid-template-columns: repeat(2, minmax(0, 1fr));\n gap: 16px;\n align-items: start;\n\n @media (max-width: ${mobilePortrait.width}) {\n grid-template-columns: 1fr;\n }\n`;\n\nconst CraftingRecipeWrapper = styled.div<{ isSelected: boolean }>`\n position: relative;\n width: 100%;\n min-width: 0;\n box-sizing: border-box;\n transition: background-color 0.2s;\n\n &:hover {\n background: rgba(0, 0, 0, 0.4);\n }\n\n ${props =>\n props.isSelected &&\n `\n background: rgba(255, 215, 0, 0.1);\n `}\n`;\n\nconst PinButton = styled.button<{ isPinned: boolean }>`\n position: absolute;\n top: 8px;\n right: 8px;\n background: none;\n border: none;\n cursor: pointer;\n padding: 4px;\n color: ${props => (props.isPinned ? uiColors.yellow : uiColors.lightGray)};\n opacity: ${props => (props.isPinned ? 1 : 0.6)};\n transition: all 0.2s;\n z-index: 2;\n\n &:hover {\n opacity: 1;\n color: ${uiColors.yellow};\n }\n`;\n\nconst Footer = styled.div`\n display: flex;\n justify-content: flex-end;\n gap: 16px;\n padding: 8px;\n\n button {\n min-width: 100px;\n }\n\n @media (max-width: ${mobilePortrait.width}) {\n justify-content: center;\n }\n`;\n\nconst PaginationContainer = styled.div`\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 16px;\n padding: 8px;\n margin-top: 8px;\n border-top: 1px solid ${uiColors.darkGray};\n`;\n\nconst PaginationButton = styled.button<{ disabled?: boolean }>`\n background: none;\n border: none;\n color: ${props => (props.disabled ? uiColors.darkGray : uiColors.yellow)};\n cursor: ${props => (props.disabled ? 'not-allowed' : 'pointer')};\n opacity: ${props => (props.disabled ? 0.5 : 0.8)};\n padding: 4px;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: opacity 0.2s;\n\n &:hover:not(:disabled) {\n opacity: 1;\n }\n`;\n\nconst PageInfo = styled.div`\n color: ${uiColors.lightGray};\n font-size: 0.8rem;\n font-family: 'Press Start 2P', cursive;\n`;\n","import React from 'react';\nimport styled from 'styled-components';\nimport { uiFonts } from '../constants/uiFonts';\nimport { Dropdown } from './Dropdown';\n\ninterface IDropdownSelectorOption {\n id: string;\n name: string;\n}\n\nexport interface IDropdownSelectorContainer {\n onChange: (id: string) => void;\n options: IDropdownSelectorOption[];\n details?: string;\n title: string;\n}\n\nexport const DropdownSelectorContainer: React.FC<IDropdownSelectorContainer> = ({\n title,\n onChange,\n options,\n details,\n}) => {\n return (\n <div>\n <p>{title}</p>\n <Dropdown\n options={options.map((option, index) => ({\n option: option.name,\n value: option.id,\n id: index,\n }))}\n onChange={onChange}\n />\n <Details>{details}</Details>\n </div>\n );\n};\n\nconst Details = styled.p`\n font-size: ${uiFonts.size.xsmall} !important;\n`;\n","import { getItemTextureKeyPath } from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { useCursorPosition } from '../../../hooks/useCursorPosition';\nimport { SpriteFromAtlas } from '../../shared/SpriteFromAtlas';\nimport { onRenderStackInfo } from './ItemSlotQty/ItemSlotQty';\nimport { useItemSlotDragging } from './context/ItemSlotDraggingContext';\n\nconst CONTAINER_SIZE = 32;\nconst OFFSET = CONTAINER_SIZE / 2;\n\ninterface IProps {\n atlasJSON: any;\n atlasIMG: any;\n scale?: number;\n}\n\nexport const DraggedItem = ({\n atlasJSON,\n atlasIMG,\n scale,\n}: IProps): JSX.Element | null => {\n const { draggingState } = useItemSlotDragging();\n\n const { item } = draggingState;\n\n const { x, y } = useCursorPosition({\n scale,\n });\n\n if (!item) {\n return null;\n }\n\n if (x === 0 && y === 0) {\n return null;\n }\n\n const centeredX = x - OFFSET;\n const centeredY = y - OFFSET;\n\n const stackInfo = onRenderStackInfo(item?._id ?? '', item?.stackQty ?? 0);\n\n return (\n <Container>\n <SpriteContainer x={centeredX} y={centeredY}>\n <SpriteFromAtlas\n key={item._id}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={getItemTextureKeyPath(\n {\n key: item.texturePath,\n texturePath: item.texturePath,\n stackQty: item.stackQty || 1,\n isStackable: item.isStackable,\n },\n atlasJSON\n )}\n imgScale={3}\n imgClassname=\"sprite-from-atlas-img--item\"\n />\n {stackInfo}\n </SpriteContainer>\n </Container>\n );\n};\n\ninterface IContainer {\n x: number;\n y: number;\n}\n\nconst pulse = `\n @keyframes pulse {\n 0%, 100% {\n transform: scale(1) rotate(-3deg);\n }\n 50% {\n transform: scale(0.95) rotate(-3deg);\n }\n }\n`;\n\nconst Container = styled.div`\n position: relative;\n`;\n\nconst SpriteContainer = styled.div.attrs<IContainer>(props => ({\n style: {\n left: `${props.x}px`,\n top: `${props.y}px`,\n },\n}))<IContainer>`\n ${pulse}\n\n position: absolute;\n z-index: 100;\n pointer-events: none;\n\n width: ${CONTAINER_SIZE}px;\n height: ${CONTAINER_SIZE}px;\n\n transform: rotate(-3deg);\n\n filter: grayscale(100%);\n opacity: 0.35;\n\n animation: pulse 2s infinite;\n\n .item-slot-qty {\n position: absolute;\n bottom: 0;\n margin-left: 0.8rem;\n }\n`;\n\nexport default DraggedItem;\n","import { GRID_HEIGHT, GRID_WIDTH } from '@rpg-engine/shared';\nimport { useCallback, useEffect, useState } from 'react';\nimport { IPosition } from '../types/eventTypes';\n\ninterface ICursorPositionProps {\n scale?: number;\n}\n\nexport const useCursorPosition = ({ scale = 1 }: ICursorPositionProps): IPosition => {\n const [position, setPosition] = useState<IPosition>({ x: 0, y: 0 });\n\n const scalePosition = useCallback((x: number, y: number): IPosition => {\n return {\n x: ((x - GRID_WIDTH / 2) / scale) + GRID_WIDTH / 2,\n y: ((y - GRID_HEIGHT / 2) / scale) + GRID_HEIGHT / 2,\n };\n }, [scale]);\n\n const setFromEvent = useCallback((e: MouseEvent | TouchEvent) => {\n let x, y;\n\n if ('touches' in e) {\n x = e.touches[0].clientX;\n y = e.touches[0].clientY;\n } else {\n x = e.clientX;\n y = e.clientY;\n }\n\n const scaledPosition = scalePosition(x, y);\n setPosition(scaledPosition);\n }, [scale, scalePosition]);\n\n const cleanup = useCallback(() => {\n setPosition({ x: 0, y: 0 });\n }, []);\n\n useEffect(() => {\n const handleEvent = (e: Event) => setFromEvent(e as MouseEvent | TouchEvent);\n\n window.addEventListener('mousemove', handleEvent);\n window.addEventListener('touchmove', handleEvent);\n window.addEventListener('mouseup', cleanup);\n window.addEventListener('touchend', cleanup);\n\n return () => {\n window.removeEventListener('mousemove', handleEvent);\n window.removeEventListener('touchmove', handleEvent);\n window.removeEventListener('mouseup', cleanup);\n window.removeEventListener('touchend', cleanup);\n };\n }, [setFromEvent, cleanup]);\n\n return position;\n};\n","import React, { useEffect, useRef } from 'react';\nimport styled from 'styled-components';\nimport { useOutsideClick } from '../hooks/useOutsideAlerter';\nimport ModalPortal from './Abstractions/ModalPortal';\n\ninterface IListMenuOption {\n id: string;\n text: string;\n}\n\nexport interface IRelativeMenuProps {\n options: IListMenuOption[];\n onSelected: (selectedOptionId: string) => void;\n fontSize?: number;\n onOutsideClick?: () => void;\n pos: { x: number; y: number };\n}\n\nexport const RelativeListMenu: React.FC<IRelativeMenuProps> = ({\n options,\n onSelected,\n onOutsideClick,\n fontSize = 0.8,\n pos,\n}) => {\n const ref = useRef(null);\n\n useOutsideClick(ref, 'relative-context-menu');\n\n useEffect(() => {\n document.addEventListener('clickOutside', event => {\n const e = event as CustomEvent;\n\n if (e.detail.id === 'relative-context-menu') {\n if (onOutsideClick) {\n onOutsideClick();\n }\n }\n });\n\n return () => {\n document.removeEventListener('clickOutside', _e => {});\n };\n }, []);\n\n return (\n <ModalPortal>\n <Container fontSize={fontSize} ref={ref} {...pos}>\n <ul className=\"rpgui-list-imp\" style={{ overflow: 'hidden' }}>\n {options.map((params, index) => (\n <ListElement\n key={params?.id || index}\n onPointerDown={() => {\n onSelected(params?.id);\n }}\n >\n {params?.text || 'No text'}\n </ListElement>\n ))}\n </ul>\n </Container>\n </ModalPortal>\n );\n};\n\ninterface IContainerProps {\n fontSize?: number;\n x: number;\n y: number;\n}\n\nconst Container = styled.div<IContainerProps>`\n position: absolute;\n top: ${props => props.y}px;\n left: ${props => props.x}px;\n\n display: flex;\n flex-direction: column;\n width: max-content;\n justify-content: start;\n align-items: flex-start;\n\n li {\n font-size: ${props => props.fontSize}em;\n }\n`;\n\nconst ListElement = styled.li`\n margin-right: 0.5rem;\n`;\n","import { IEquipmentSet, IItem } from '@rpg-engine/shared';\nimport React from 'react';\nimport { RelativeListMenu } from '../../RelativeListMenu';\nimport { ItemTooltip } from '../Cards/ItemTooltip';\nimport { MobileItemTooltip } from '../Cards/MobileItemTooltip';\nimport { useItemSlotDetails } from './context/ItemSlotDetailsContext';\nimport { useItemSlotDragging } from './context/ItemSlotDraggingContext';\n\ninterface IProps {\n dragScale: number | undefined;\n onSelected?: (optionId: string, item: IItem) => void;\n atlasIMG: any;\n atlasJSON: any;\n equipmentSet?: IEquipmentSet | null;\n isContextMenuDisabled?: boolean;\n}\n\nexport const ItemSlotToolTips = ({\n dragScale,\n onSelected,\n atlasIMG,\n atlasJSON,\n equipmentSet,\n isContextMenuDisabled,\n}: IProps): JSX.Element => {\n const { detailsState, updateDetailsState } = useItemSlotDetails();\n\n const {\n isTooltipVisible,\n isTooltipMobileVisible,\n isContextMenuVisible,\n contextMenuPosition,\n contextActions,\n item,\n } = detailsState;\n\n const { draggingState } = useItemSlotDragging();\n\n const { isFocused } = draggingState;\n\n return (\n <>\n {isTooltipVisible && item && !isFocused && (\n <ItemTooltip\n item={item}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n equipmentSet={equipmentSet}\n />\n )}\n\n {isTooltipMobileVisible && item && (\n <MobileItemTooltip\n item={item}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n equipmentSet={equipmentSet}\n closeTooltip={() => {\n updateDetailsState({ isTooltipMobileVisible: false });\n }}\n scale={dragScale}\n options={contextActions}\n onSelected={(optionId: string) => {\n updateDetailsState({\n isContextMenuVisible: false,\n });\n if (item) {\n onSelected?.(optionId, item);\n }\n }}\n />\n )}\n\n {!isContextMenuDisabled &&\n isContextMenuVisible &&\n contextActions &&\n contextActions.length > 0 && (\n <RelativeListMenu\n options={contextActions}\n onSelected={(optionId: string) => {\n updateDetailsState({ isContextMenuVisible: false });\n if (item) {\n onSelected?.(optionId, item);\n }\n }}\n onOutsideClick={() => {\n updateDetailsState({ isContextMenuVisible: false });\n }}\n pos={contextMenuPosition}\n />\n )}\n </>\n );\n};\n","import {\n IEquipmentSet,\n IItem,\n IItemContainer,\n isMobile,\n ItemContainerType,\n ItemSlotType,\n ItemType,\n} from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { IPosition } from '../../types/eventTypes';\nimport { DraggableContainer } from '../DraggableContainer';\nimport { ItemSlotDetailsProvider } from '../Item/Inventory/context/ItemSlotDetailsContext';\nimport { ItemSlotDraggingProvider } from '../Item/Inventory/context/ItemSlotDraggingContext';\nimport DraggedItem from '../Item/Inventory/DraggedItem';\nimport { ItemSlot } from '../Item/Inventory/ItemSlot';\nimport { ItemSlotToolTips } from '../Item/Inventory/ItemSlotTooltips';\nimport { RPGUIContainerTypes } from '../RPGUI/RPGUIContainer';\n\nexport interface IEquipmentSetProps {\n equipmentSet: IEquipmentSet;\n onClose?: () => void;\n onItemClick?: (\n ItemType: ItemType,\n item: IItem,\n itemContainerType: ItemContainerType | null\n ) => void;\n onItemDragStart?: (\n item: IItem,\n slotIndex: number,\n itemContainerType: ItemContainerType | null\n ) => void;\n onItemDragEnd?: (quantity?: number) => void;\n onItemPlaceDrop?: (\n item: IItem | null,\n slotIndex: number,\n itemContainerType: ItemContainerType | null\n ) => void;\n onItemOutsideDrop?: (item: IItem, position: IPosition) => void;\n scale?: number;\n checkIfItemCanBeMoved: () => boolean;\n checkIfItemShouldDragEnd?: () => boolean;\n onMouseOver?: (e: any, slotIndex: number, item: IItem | null) => void;\n onSelected?: (optionId: string) => void;\n initialPosition?: { x: number; y: number };\n type: ItemContainerType | null;\n atlasIMG: any;\n atlasJSON: any;\n onPositionChangeEnd?: (position: IPosition) => void;\n onPositionChangeStart?: (position: IPosition) => void;\n}\n\nexport const EquipmentSet: React.FC<IEquipmentSetProps> = ({\n equipmentSet,\n onClose,\n onMouseOver,\n onSelected,\n onItemClick,\n atlasIMG,\n atlasJSON,\n onItemDragEnd,\n onItemDragStart,\n onItemPlaceDrop,\n onItemOutsideDrop,\n checkIfItemCanBeMoved,\n checkIfItemShouldDragEnd,\n scale,\n initialPosition,\n onPositionChangeEnd,\n onPositionChangeStart,\n}) => {\n const {\n neck,\n leftHand,\n ring,\n head,\n armor,\n legs,\n boot,\n inventory,\n rightHand,\n accessory,\n } = equipmentSet;\n\n const equipmentData = [\n neck,\n leftHand,\n ring,\n head,\n armor,\n legs,\n boot,\n inventory,\n rightHand,\n accessory,\n ];\n\n const equipmentMaskSlots = [\n ItemSlotType.Neck,\n ItemSlotType.LeftHand,\n ItemSlotType.Ring,\n ItemSlotType.Head,\n ItemSlotType.Torso,\n ItemSlotType.Legs,\n ItemSlotType.Feet,\n ItemSlotType.Inventory,\n ItemSlotType.RightHand,\n ItemSlotType.Accessory,\n ];\n\n const onRenderEquipmentSlotRange = (start: number, end: number) => {\n const equipmentRange = equipmentData.slice(start, end);\n const slotMaksRange = equipmentMaskSlots.slice(start, end);\n\n return equipmentRange.map((data, i) => {\n const item = data as IItem;\n const itemContainer =\n (item && (item.itemContainer as IItemContainer)) ?? null;\n\n return (\n <ItemSlot\n key={i}\n slotIndex={i}\n item={item}\n itemContainer={itemContainer}\n itemContainerType={ItemContainerType.Equipment}\n slotSpriteMask={slotMaksRange[i]}\n onMouseOver={(event, slotIndex, item) => {\n if (onMouseOver) onMouseOver(event, slotIndex, item);\n }}\n onPointerDown={(itemType, ContainerType) => {\n if (onItemClick) onItemClick(itemType, item, ContainerType);\n }}\n onDragStart={(item, slotIndex, itemContainerType) => {\n if (!item) {\n return;\n }\n\n if (onItemDragStart)\n onItemDragStart(item, slotIndex, itemContainerType);\n }}\n onDragEnd={quantity => {\n if (onItemDragEnd) onItemDragEnd(quantity);\n }}\n dragScale={scale}\n checkIfItemCanBeMoved={checkIfItemCanBeMoved}\n checkIfItemShouldDragEnd={checkIfItemShouldDragEnd}\n onPlaceDrop={(item, slotIndex, itemContainerType) => {\n if (onItemPlaceDrop)\n onItemPlaceDrop(item, slotIndex, itemContainerType);\n }}\n onOutsideDrop={(item, position) => {\n if (onItemOutsideDrop) onItemOutsideDrop(item, position);\n }}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n />\n );\n });\n };\n\n return (\n <ItemSlotDraggingProvider>\n <ItemSlotDetailsProvider>\n <DraggedItem atlasIMG={atlasIMG} atlasJSON={atlasJSON} scale={scale} />\n <DraggableContainer\n title={'Equipments'}\n type={RPGUIContainerTypes.Framed}\n onCloseButton={() => {\n if (onClose) onClose();\n }}\n width=\"330px\"\n cancelDrag=\".equipment-container-body\"\n scale={scale}\n initialPosition={initialPosition}\n onPositionChangeEnd={onPositionChangeEnd}\n onPositionChangeStart={onPositionChangeStart}\n >\n <EquipmentSetContainer className=\"equipment-container-body\">\n <EquipmentColumn>\n {onRenderEquipmentSlotRange(0, 3)}\n </EquipmentColumn>\n <EquipmentColumn>\n {onRenderEquipmentSlotRange(3, 7)}\n </EquipmentColumn>\n <EquipmentColumn>\n {onRenderEquipmentSlotRange(7, 10)}\n </EquipmentColumn>\n </EquipmentSetContainer>\n </DraggableContainer>\n\n <ItemSlotToolTips\n dragScale={scale}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n equipmentSet={equipmentSet}\n onSelected={onSelected}\n isContextMenuDisabled={isMobile()}\n />\n </ItemSlotDetailsProvider>\n </ItemSlotDraggingProvider>\n );\n};\n\nconst EquipmentSetContainer = styled.div`\n width: inherit;\n display: flex;\n justify-content: center;\n flex-wrap: wrap;\n flex-direction: row;\n touch-action: none;\n overflow: hidden;\n`;\n\nconst EquipmentColumn = styled.div`\n display: flex;\n justify-content: center;\n flex-wrap: wrap;\n flex-direction: column;\n touch-action: none;\n`;\n","import styled from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\n\nexport const Table = styled.table`\n width: 100%;\n border-collapse: collapse;\n margin-top: 1rem;\n`;\n\nexport const TableRow = styled.tr`\n &:nth-child(even) {\n background-color: rgba(255, 255, 255, 0.05) !important;\n }\n &:hover {\n background-color: rgba(255, 255, 255, 0.1) !important;\n }\n`;\n\nexport const TableHeader = styled.th`\n text-align: left;\n padding: 0.5rem;\n color: ${uiColors.yellow} !important;\n border-bottom: 1px solid ${uiColors.lightGray};\n text-shadow: -2px 0 black, 0 2px black, 2px 0 black, 0 -2px black;\n`;\n\nexport const TableCell = styled.td`\n padding: 0.5rem;\n color: ${uiColors.white};\n border-bottom: 1px solid ${uiColors.lightGray};\n text-shadow: -2px 0 black, 0 2px black, 2px 0 black, 0 -2px black;\n`;\n\nexport const ActionButtons = styled.div`\n display: flex;\n gap: 10px;\n align-items: center;\n`;\n\ninterface IUserActionProps {\n color: string;\n}\n\nexport const UserActionLink = styled.span<IUserActionProps>`\n color: ${({ color }) => color} !important;\n cursor: pointer;\n margin-right: 0.5rem;\n\n &:hover {\n text-decoration: underline;\n }\n`;\n","import { debounce } from 'lodash';\nimport React, { useCallback, useState } from 'react';\nimport styled from 'styled-components';\nimport { InternalTabs, UserActionLink } from '../..';\nimport { uiColors } from '../../constants/uiColors';\nimport { uiFonts } from '../../constants/uiFonts';\nimport { IFriend } from './FriendList';\n\ninterface ISearchFriendProps {\n searchedCharacters: IFriend[];\n friendRequests: IFriend[];\n onFocus?: () => void;\n onBlur?: () => void;\n onSearch: (characterName: string) => void;\n onSendFriendRequest: (character: IFriend) => void;\n onAcceptRequest: (character: IFriend) => void;\n onRejectRequest: (character: IFriend) => void;\n}\n\nexport const SearchFriend: React.FC<ISearchFriendProps> = ({\n searchedCharacters,\n friendRequests,\n onBlur,\n onFocus,\n onSearch,\n onSendFriendRequest,\n onAcceptRequest,\n onRejectRequest,\n}) => {\n const [characterName, setCharacterName] = useState('');\n\n const debouncedSearch = useCallback(\n debounce((name: string) => {\n onSearch(name);\n }, 300),\n []\n );\n\n const handleInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const name = e.target.value;\n setCharacterName(name);\n debouncedSearch(name);\n };\n\n const handleSubmit = (event: React.SyntheticEvent<HTMLFormElement>) => {\n event.preventDefault();\n if (characterName.trim()) {\n onSearch(characterName);\n }\n };\n\n const searchTabContent = (\n <ListContainer>\n <SearchForm onSubmit={handleSubmit}>\n <SearchInput\n value={characterName}\n id=\"characterName\"\n name=\"characterName\"\n onChange={handleInputChange}\n type=\"text\"\n autoComplete=\"off\"\n onFocus={onFocus}\n onBlur={onBlur}\n onPointerDown={onFocus}\n autoFocus\n placeholder=\"Search for a character...\"\n />\n </SearchForm>\n <CharacterList\n characters={searchedCharacters}\n onAction={onSendFriendRequest}\n actionLabel=\"Add Friend\"\n />\n </ListContainer>\n );\n\n const requestsTabContent = (\n <ListContainer>\n <FriendRequestSection\n friendRequests={friendRequests}\n onAccept={onAcceptRequest}\n onReject={onRejectRequest}\n />\n </ListContainer>\n );\n\n const tabs = [\n { id: 'search', title: 'Search', content: searchTabContent },\n {\n id: 'requests',\n title: `Requests (${friendRequests.length})`,\n content: requestsTabContent,\n },\n ];\n\n return (\n <Container>\n <InternalTabs\n tabs={tabs}\n activeTextColor=\"#000\"\n inactiveColor=\"#777\"\n borderColor=\"#f59e0b\"\n />\n </Container>\n );\n};\n\nconst CharacterList: React.FC<{\n characters: IFriend[];\n onAction: (character: IFriend) => void;\n actionLabel: string;\n}> = ({ characters, onAction, actionLabel }) => (\n <ListContainer>\n {characters.map(character => (\n <ListItem key={character._id}>\n <CharacterName>{character.name}</CharacterName>\n <UserActionLink\n color={uiColors.lightGreen}\n onClick={() => onAction(character)}\n >\n {actionLabel}\n </UserActionLink>\n </ListItem>\n ))}\n </ListContainer>\n);\n\nconst FriendRequestSection: React.FC<{\n friendRequests: IFriend[];\n onAccept: (character: IFriend) => void;\n onReject: (character: IFriend) => void;\n}> = ({ friendRequests, onAccept, onReject }) => (\n <>\n {friendRequests.length > 0 && (\n <ListContainer>\n {friendRequests.map(character => (\n <ListItem key={character._id}>\n <CharacterName>{character.name}</CharacterName>\n <AcceptRejectActions>\n <UserActionLink\n color={uiColors.lightGreen}\n onClick={() => onAccept(character)}\n >\n Accept\n </UserActionLink>\n <UserActionLink\n color={uiColors.red}\n onClick={() => onReject(character)}\n >\n Reject\n </UserActionLink>\n </AcceptRejectActions>\n </ListItem>\n ))}\n </ListContainer>\n )}\n </>\n);\n\nconst Container = styled.div`\n display: flex;\n flex-direction: column;\n gap: 1rem;\n`;\n\nconst SearchForm = styled.form`\n display: flex;\n align-items: center;\n width: 100%;\n margin-top: 1rem;\n`;\n\nconst SearchInput = styled.input`\n width: 100%;\n background-color: rgba(0, 0, 0, 0.25);\n border: none;\n padding: 0.5rem;\n font-size: ${uiFonts.size.small};\n`;\n\nconst ListContainer = styled.ul`\n list-style: none;\n padding: 0;\n margin: 0;\n width: 100%;\n max-height: 50vh;\n overflow-y: auto;\n\n @media (max-width: 768px) {\n max-height: 90vh;\n }\n`;\n\nconst ListItem = styled.li`\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0.5rem;\n border-bottom: 1px solid rgba(255, 255, 255, 0.1);\n`;\n\nconst CharacterName = styled.p`\n font-size: ${uiFonts.size.small};\n margin: 0;\n`;\n\nconst AcceptRejectActions = styled.div`\n display: flex;\n gap: 0.5rem;\n`;\n","import React, { useEffect, useState } from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\nimport { Button, ButtonTypes } from '../Button';\n\nimport { ICharacter } from '@rpg-engine/shared';\nimport {\n ActionButtons,\n Table,\n TableCell,\n TableHeader,\n TableRow,\n UserActionLink,\n} from '../Table/Table';\nimport { SearchFriend } from './SearchFriend';\nexport type IFriend = Pick<ICharacter, 'name' | '_id' | 'isOnline'>;\ninterface IFriendListProps {\n scale?: number;\n friends: IFriend[];\n friendRequests: IFriend[];\n searchedCharacters: IFriend[];\n onFocus?: () => void;\n onBlur?: () => void;\n onClose: () => void;\n onOpenPrivateMessage: (character: IFriend) => void;\n onRemoveFriend: (character: IFriend) => void;\n onSendFriendRequest: (character: IFriend) => void;\n onSearch: (characterName: string) => void;\n onAcceptRequest: (character: IFriend) => void;\n onRejectRequest: (character: IFriend) => void;\n onAddFriend?: () => void;\n onBackFriendList?: () => void;\n}\n\nexport const FriendList: React.FC<IFriendListProps> = ({\n friends,\n friendRequests,\n searchedCharacters,\n onFocus,\n onBlur,\n onSearch,\n onAcceptRequest,\n onSendFriendRequest,\n onRemoveFriend,\n onOpenPrivateMessage,\n onRejectRequest,\n onAddFriend,\n onBackFriendList,\n}) => {\n const [isAddFriendUI, setIsAddFriendUI] = useState(false);\n\n useEffect(() => {\n if (isAddFriendUI) {\n onAddFriend?.();\n } else {\n onBackFriendList?.();\n }\n }, [isAddFriendUI]);\n\n return (\n <ListWrapper>\n {isAddFriendUI ? (\n <SearchFriend\n searchedCharacters={searchedCharacters}\n onSendFriendRequest={onSendFriendRequest}\n onAcceptRequest={onAcceptRequest}\n onRejectRequest={onRejectRequest}\n friendRequests={friendRequests}\n onSearch={onSearch}\n onBlur={onBlur}\n onFocus={onFocus}\n />\n ) : (\n <>\n <ScrollableArea>\n <Table>\n <thead>\n <TableRow>\n <TableHeader>Online</TableHeader>\n <TableHeader>Name</TableHeader>\n <TableHeader>Actions</TableHeader>\n </TableRow>\n </thead>\n <tbody>\n {friends.map(friend => (\n <TableRow key={friend._id}>\n <TableCell>\n <IsOnlineBadge $isOnline={friend.isOnline} />\n </TableCell>\n <TableCell>{friend.name}</TableCell>\n <TableCell>\n <ActionButtons>\n <UserActionLink\n color={uiColors.white}\n onClick={() => onOpenPrivateMessage(friend)}\n >\n Chat\n </UserActionLink>\n <UserActionLink\n color={uiColors.red}\n onClick={() => onRemoveFriend(friend)}\n >\n Remove\n </UserActionLink>\n </ActionButtons>\n </TableCell>\n </TableRow>\n ))}\n </tbody>\n </Table>\n </ScrollableArea>\n </>\n )}\n\n <ButtonContainer>\n <Button\n buttonType={ButtonTypes.RPGUIButton}\n onClick={() => setIsAddFriendUI(prev => !prev)}\n >\n {isAddFriendUI ? 'Back' : 'Add New Friend'}\n </Button>\n </ButtonContainer>\n </ListWrapper>\n );\n};\n\n// Styled components for FriendList UI\nconst ListWrapper = styled.div`\n margin-top: 1rem;\n max-height: 350px;\n display: flex;\n flex-direction: column;\n`;\n\nconst ScrollableArea = styled.div`\n overflow-y: auto;\n max-height: 300px; /* Adjust this value based on your layout */\n`;\n\nconst IsOnlineBadge = styled.div<{ $isOnline: boolean }>`\n width: 10px;\n height: 10px;\n border-radius: 50%;\n background-color: ${({ $isOnline }) =>\n $isOnline ? uiColors.lightGreen : uiColors.red};\n margin-right: 1rem;\n`;\n\nconst ButtonContainer = styled.div`\n display: flex;\n justify-content: center;\n align-items: center;\n width: 100%;\n margin-top: 1rem;\n`;\n","import { isMobileOrTablet } from '@rpg-engine/shared';\n\nexport const IS_MOBILE_OR_TABLET = isMobileOrTablet();\n","import React, { useEffect, useState } from 'react';\nimport styled from 'styled-components';\n\ninterface IProps {\n text: string;\n onFinish?: () => void;\n onStart?: () => void;\n}\n\nexport const DynamicText: React.FC<IProps> = ({ text, onFinish, onStart }) => {\n const [textState, setTextState] = useState<string>('');\n\n useEffect(() => {\n let i = 0;\n const interval = setInterval(() => {\n // on every interval, show one more character\n\n if (i === 0) {\n if (onStart) {\n onStart();\n }\n }\n\n if (i < text.length) {\n setTextState(text.substring(0, i + 1));\n i++;\n } else {\n clearInterval(interval);\n if (onFinish) {\n onFinish();\n }\n }\n }, 25);\n\n return () => {\n clearInterval(interval);\n };\n }, [text]);\n\n return <TextContainer>{textState}</TextContainer>;\n};\n\nconst TextContainer = styled.p`\n font-size: 0.7rem !important;\n color: white;\n text-shadow: 1px 1px 0px #000000;\n letter-spacing: 1.2px;\n word-break: normal;\n`;\n","import React, { useEffect, useRef, useState } from 'react';\nimport styled from 'styled-components';\nimport { NPCDialogType } from '../..';\nimport { IS_MOBILE_OR_TABLET } from '../../constants/uiDevices';\nimport { chunkString } from '../../libs/StringHelpers';\nimport { DynamicText } from '../typography/DynamicText';\nimport pressButtonGif from './img/press-button.gif';\nimport pressSpaceGif from './img/space.gif';\n\ninterface IProps {\n text: string;\n onClose: () => void;\n onEndStep?: () => void;\n onStartStep?: () => void;\n type?: NPCDialogType;\n}\n\nexport const NPCDialogText: React.FC<IProps> = ({\n text,\n onClose,\n onEndStep,\n onStartStep,\n type,\n}) => {\n const windowSize = useRef([window.innerWidth, window.innerHeight]);\n function maxCharacters(width: number) {\n // Set the font size to 16 pixels\n var fontSize = 11.2;\n\n // Calculate the number of characters that can fit in one line\n var charactersPerLine = Math.floor(width / 2 / fontSize);\n\n // Calculate the number of lines that can fit in the div\n var linesPerDiv = Math.floor(180 / fontSize);\n\n // Calculate the maximum number of characters that can fit in the div\n var maxCharacters = charactersPerLine * linesPerDiv;\n\n // Return the maximum number of characters\n return Math.round(maxCharacters / 5);\n }\n\n const textChunks = chunkString(text, maxCharacters(windowSize.current[0]));\n\n const [chunkIndex, setChunkIndex] = useState<number>(0);\n const onHandleSpacePress = (event: KeyboardEvent) => {\n if (event.code === 'Space') {\n goToNextStep();\n }\n };\n\n const goToNextStep = () => {\n const hasNextChunk = textChunks?.[chunkIndex + 1] || false;\n\n if (hasNextChunk) {\n setChunkIndex(prev => prev + 1);\n } else {\n // if there's no more text chunks, close the dialog\n onClose();\n }\n };\n\n useEffect(() => {\n document.addEventListener('keydown', onHandleSpacePress);\n\n return () => document.removeEventListener('keydown', onHandleSpacePress);\n }, [chunkIndex]);\n\n const [showGoNextIndicator, setShowGoNextIndicator] = useState<boolean>(\n false\n );\n\n return (\n <Container>\n <DynamicText\n text={textChunks?.[chunkIndex] || ''}\n onFinish={() => {\n setShowGoNextIndicator(true);\n\n onEndStep && onEndStep();\n }}\n onStart={() => {\n setShowGoNextIndicator(false);\n\n onStartStep && onStartStep();\n }}\n />\n {showGoNextIndicator && (\n <PressSpaceIndicator\n right={type === NPCDialogType.TextOnly ? '1rem' : '10.5rem'}\n src={IS_MOBILE_OR_TABLET ? pressButtonGif : pressSpaceGif}\n onPointerDown={() => {\n goToNextStep();\n }}\n />\n )}\n </Container>\n );\n};\n\nconst Container = styled.div``;\n\ninterface IPressSpaceIndicatorProps {\n right: string;\n}\n\nconst PressSpaceIndicator = styled.img<IPressSpaceIndicatorProps>`\n position: absolute;\n right: ${({ right }) => right};\n bottom: 1rem;\n height: 20.7px;\n image-rendering: -webkit-optimize-contrast;\n`;\n","export const chunkString = (str: string, length: number) => {\n return str.match(new RegExp('.{1,' + length + '}', 'g'));\n};\n","import React from 'react';\n\n//@ts-ignore\nexport const useEventListener = (type, handler, el = window) => {\n const savedHandler = React.useRef();\n\n React.useEffect(() => {\n savedHandler.current = handler;\n }, [handler]);\n\n React.useEffect(() => {\n //@ts-ignore\n const listener = e => savedHandler.current(e);\n\n el.addEventListener(type, listener);\n\n return () => {\n el.removeEventListener(type, listener);\n };\n }, [type, el]);\n};\n","import React, { useEffect, useState } from 'react';\nimport styled from 'styled-components';\nimport { useEventListener } from '../../../hooks/useEventListener';\nimport { DynamicText } from '../../typography/DynamicText';\n\nexport interface IQuestionDialogAnswer {\n id: number;\n text: string;\n nextQuestionId?: number;\n}\n\nexport interface IQuestionDialog {\n id: number;\n text: string;\n answerIds?: number[];\n}\n\nexport interface IProps {\n questions: IQuestionDialog[];\n answers: IQuestionDialogAnswer[];\n onClose: () => void;\n}\n\nexport const QuestionDialog: React.FC<IProps> = ({\n questions,\n answers,\n onClose,\n}) => {\n const [currentQuestion, setCurrentQuestion] = useState(questions[0]);\n\n const [canShowAnswers, setCanShowAnswers] = useState<boolean>(false);\n\n const onGetFirstAnswer = () => {\n if (!currentQuestion.answerIds || currentQuestion.answerIds.length === 0) {\n return null;\n }\n\n const firstAnswerId = currentQuestion.answerIds![0];\n\n return answers.find(answer => answer.id === firstAnswerId);\n };\n\n const [\n currentAnswer,\n setCurrentAnswer,\n ] = useState<IQuestionDialogAnswer | null>(onGetFirstAnswer()!);\n\n useEffect(() => {\n setCurrentAnswer(onGetFirstAnswer()!);\n }, [currentQuestion]);\n\n const onGetAnswers = (answerIds: number[]) => {\n return answerIds.map((answerId: number) =>\n answers.find(answer => answer.id === answerId)\n );\n };\n\n const onKeyPress = (e: KeyboardEvent) => {\n switch (e.key) {\n case 'ArrowDown':\n // select next answer, if any.\n // if no next answer, select first answer\n // const nextAnswer = onGetAnswers(currentQuestion.answerIds!).find(\n // (answer) => answer?.id === currentAnswer!.id + 1\n // );\n\n const nextAnswerIndex = onGetAnswers(\n currentQuestion.answerIds!\n ).findIndex(answer => answer?.id === currentAnswer!.id + 1);\n\n const nextAnswerID = currentQuestion.answerIds![nextAnswerIndex];\n\n const nextAnswer = onGetAnswers(currentQuestion.answerIds!).find(\n answer => answer?.id === nextAnswerID\n );\n\n setCurrentAnswer(nextAnswer || onGetFirstAnswer()!);\n\n break;\n case 'ArrowUp':\n // select previous answer, if any.\n // if no previous answer, select last answer\n\n const previousAnswerIndex = onGetAnswers(\n currentQuestion.answerIds!\n ).findIndex(answer => answer?.id === currentAnswer!.id - 1);\n\n const previousAnswerID =\n currentQuestion.answerIds &&\n currentQuestion.answerIds[previousAnswerIndex];\n\n const previousAnswer = onGetAnswers(currentQuestion.answerIds!).find(\n answer => answer?.id === previousAnswerID\n );\n\n if (previousAnswer) {\n setCurrentAnswer(previousAnswer);\n } else {\n setCurrentAnswer(onGetAnswers(currentQuestion.answerIds!).pop()!);\n }\n\n break;\n case 'Enter':\n setCanShowAnswers(false);\n\n if (!currentAnswer?.nextQuestionId) {\n onClose();\n return;\n } else {\n setCurrentQuestion(\n questions.find(\n question => question.id === currentAnswer!.nextQuestionId\n )!\n );\n }\n\n break;\n }\n };\n useEventListener('keydown', onKeyPress);\n\n const onAnswerClick = (answer: IQuestionDialogAnswer) => {\n setCanShowAnswers(false);\n if (answer.nextQuestionId) {\n // if there is a next question, go to it\n setCurrentQuestion(\n questions.find(question => question.id === answer.nextQuestionId)!\n );\n } else {\n // else, finish dialog!\n onClose();\n }\n };\n\n const onRenderCurrentAnswers = () => {\n const answerIds = currentQuestion.answerIds;\n if (!answerIds) {\n return null;\n }\n\n const answers = onGetAnswers(answerIds);\n\n if (!answers) {\n return null;\n }\n\n return answers.map(answer => {\n const isSelected = currentAnswer?.id === answer?.id;\n const selectedColor = isSelected ? 'yellow' : 'white';\n\n if (answer) {\n return (\n <AnswerRow key={`answer_${answer.id}`}>\n <AnswerSelectedIcon color={selectedColor}>\n {isSelected ? 'X' : null}\n </AnswerSelectedIcon>\n\n <Answer\n key={answer.id}\n onPointerDown={() => onAnswerClick(answer)}\n color={selectedColor}\n >\n {answer.text}\n </Answer>\n </AnswerRow>\n );\n }\n\n return null;\n });\n };\n\n return (\n <Container>\n <QuestionContainer>\n <DynamicText\n text={currentQuestion.text}\n onStart={() => setCanShowAnswers(false)}\n onFinish={() => setCanShowAnswers(true)}\n />\n </QuestionContainer>\n\n {canShowAnswers && (\n <AnswersContainer>{onRenderCurrentAnswers()}</AnswersContainer>\n )}\n </Container>\n );\n};\n\nconst Container = styled.div`\n display: flex;\n word-break: break-all;\n box-sizing: border-box;\n justify-content: flex-start;\n align-items: flex-start;\n flex-wrap: wrap;\n`;\n\nconst QuestionContainer = styled.div`\n flex: 100%;\n width: 100%;\n`;\n\nconst AnswersContainer = styled.div`\n flex: 100%;\n`;\n\ninterface IAnswerProps {\n color: string;\n}\n\nconst Answer = styled.p<IAnswerProps>`\n flex: auto;\n color: ${props => props.color} !important;\n font-size: 0.65rem !important;\n background: inherit;\n border: none;\n`;\n\nconst AnswerSelectedIcon = styled.span<IAnswerProps>`\n flex: 5% 0 0;\n color: ${props => props.color} !important;\n`;\n\nconst AnswerRow = styled.div`\n display: flex;\n flex-wrap: wrap;\n justify-content: center;\n align-items: center;\n margin-bottom: 0.5rem;\n height: 22px;\n p {\n line-height: unset;\n margin-top: 0;\n margin-bottom: 0rem;\n }\n`;\n","import React, { useEffect, useState } from 'react';\nimport styled from 'styled-components';\nimport { RPGUIContainer, RPGUIContainerTypes } from '../RPGUI/RPGUIContainer';\nimport { NPCDialogText } from './NPCDialogText';\nimport aliceDefaultThumbnail from './img/npcDialog/npcThumbnails/alice.png';\nimport pressSpaceGif from './img/space.gif';\n\nexport enum ImgSide {\n right = 'right',\n left = 'left',\n}\n\nexport interface NPCMultiDialogType {\n text: string;\n imagePath?: string;\n imageSide: ImgSide;\n}\n\nexport interface INPCMultiDialogProps {\n onClose: () => void;\n textAndTypeArray: NPCMultiDialogType[];\n}\n\nexport const NPCMultiDialog: React.FC<INPCMultiDialogProps> = ({\n onClose,\n textAndTypeArray,\n}) => {\n const [showGoNextIndicator, setShowGoNextIndicator] = useState<boolean>(\n false\n );\n const [slide, setSlide] = useState<number>(0);\n\n const onHandleSpacePress = (event: KeyboardEvent) => {\n if (event.code === 'Space') {\n if (slide < textAndTypeArray?.length - 1) {\n setSlide(prev => prev + 1);\n } else {\n // if there's no more text chunks, close the dialog\n onClose();\n }\n }\n };\n\n useEffect(() => {\n document.addEventListener('keydown', onHandleSpacePress);\n\n return () => document.removeEventListener('keydown', onHandleSpacePress);\n }, [slide]);\n\n return (\n <RPGUIContainer\n type={RPGUIContainerTypes.FramedGold}\n width={'50%'}\n height={'180px'}\n >\n <>\n <Container>\n {textAndTypeArray[slide]?.imageSide === 'right' && (\n <>\n <TextContainer flex={'70%'}>\n <NPCDialogText\n onStartStep={() => setShowGoNextIndicator(false)}\n onEndStep={() => setShowGoNextIndicator(true)}\n text={textAndTypeArray[slide].text || 'No text provided.'}\n onClose={() => {\n if (onClose) {\n onClose();\n }\n }}\n />\n </TextContainer>\n <ThumbnailContainer>\n <NPCThumbnail\n src={\n textAndTypeArray[slide].imagePath || aliceDefaultThumbnail\n }\n />\n </ThumbnailContainer>\n {showGoNextIndicator && (\n <PressSpaceIndicator right={'10.5rem'} src={pressSpaceGif} />\n )}\n </>\n )}\n {textAndTypeArray[slide].imageSide === 'left' && (\n <>\n <ThumbnailContainer>\n <NPCThumbnail\n src={\n textAndTypeArray[slide].imagePath || aliceDefaultThumbnail\n }\n />\n </ThumbnailContainer>\n <TextContainer flex={'70%'}>\n <NPCDialogText\n onStartStep={() => setShowGoNextIndicator(false)}\n onEndStep={() => setShowGoNextIndicator(true)}\n text={textAndTypeArray[slide].text || 'No text provided.'}\n onClose={() => {\n if (onClose) {\n onClose();\n }\n }}\n />\n </TextContainer>\n {showGoNextIndicator && (\n <PressSpaceIndicator right={'1rem'} src={pressSpaceGif} />\n )}\n </>\n )}\n </Container>\n )\n </>\n </RPGUIContainer>\n );\n};\n\nconst Container = styled.div`\n display: flex;\n width: 100%;\n height: 100%;\n\n box-sizing: border-box;\n justify-content: center;\n align-items: flex-start;\n position: relative;\n`;\n\ninterface ITextContainerProps {\n flex: string;\n}\n\nconst TextContainer = styled.div<ITextContainerProps>`\n flex: ${({ flex }) => flex} 0 0;\n width: 355px;\n`;\n\nconst ThumbnailContainer = styled.div`\n flex: 30% 0 0;\n display: flex;\n justify-content: flex-end;\n`;\n\nconst NPCThumbnail = styled.img`\n image-rendering: pixelated;\n height: 128px;\n width: 128px;\n`;\n\ninterface IPressSpaceIndicatorProps {\n right: string;\n}\n\nconst PressSpaceIndicator = styled.img<IPressSpaceIndicatorProps>`\n position: absolute;\n right: ${({ right }) => right};\n bottom: 1rem;\n height: 20.7px;\n image-rendering: -webkit-optimize-contrast;\n`;\n","import React, { useCallback, useEffect, useRef, useState } from 'react';\nimport styled from 'styled-components';\nimport { v4 as uuidv4 } from 'uuid';\n\nexport enum RangeSliderType {\n Slider = 'rpgui-slider',\n GoldSlider = 'rpgui-slider golden',\n}\n\nexport interface IRangeSliderProps {\n type: RangeSliderType;\n valueMin: number;\n valueMax: number;\n width: string;\n onChange: (value: number) => void;\n value: number;\n step?: number;\n}\n\nexport const RangeSlider: React.FC<IRangeSliderProps> = React.memo(\n ({ type, valueMin, valueMax, width, onChange, value, step = 1 }) => {\n const sliderId = uuidv4();\n\n const containerRef = useRef<HTMLDivElement>(null);\n const [left, setLeft] = useState(0);\n\n useEffect(() => {\n const calculatedWidth = containerRef.current?.clientWidth || 0;\n setLeft(\n Math.max(\n ((value - valueMin) / (valueMax - valueMin)) *\n (calculatedWidth - 35) +\n 10\n )\n );\n }, [value, valueMin, valueMax]);\n\n const typeClass = type === RangeSliderType.GoldSlider ? 'golden' : '';\n\n const handleChange = useCallback(\n (e: { target: { value: any } }) => {\n onChange(Number(e.target.value));\n },\n [onChange]\n );\n\n return (\n <div\n style={{ width: width, position: 'relative' }}\n className={`rpgui-slider-container ${typeClass}`}\n id={`rpgui-slider-${sliderId}`}\n ref={containerRef}\n >\n <div style={{ pointerEvents: 'none' }}>\n <div className={`rpgui-slider-track ${typeClass}`} />\n <div className={`rpgui-slider-left-edge ${typeClass}`} />\n <div className={`rpgui-slider-right-edge ${typeClass}`} />\n <div className={`rpgui-slider-thumb ${typeClass}`} style={{ left }} />\n </div>\n <Input\n type=\"range\"\n style={{ width: width }}\n min={valueMin}\n max={valueMax}\n step={step}\n onChange={handleChange}\n value={value}\n className=\"rpgui-cursor-point\"\n />\n </div>\n );\n }\n);\n\nconst Input = styled.input`\n opacity: 0;\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n margin-top: -5px;\n`;\n","import React, { useEffect, useState } from 'react';\nimport styled from 'styled-components';\nimport { NPCDialog, NPCDialogType } from './NPCDialog/NPCDialog';\nimport { NPCMultiDialog, NPCMultiDialogType } from './NPCDialog/NPCMultiDialog';\nimport {\n IQuestionDialog,\n IQuestionDialogAnswer,\n QuestionDialog,\n} from './NPCDialog/QuestionDialog/QuestionDialog';\n\nexport interface IHistoryDialogProps {\n backgroundImgPath: string[];\n fullCoverBackground: boolean;\n questions?: IQuestionDialog[];\n answers?: IQuestionDialogAnswer[];\n text?: string;\n imagePath?: string;\n textAndTypeArray?: NPCMultiDialogType[];\n onClose: () => void;\n}\n\nexport const HistoryDialog: React.FC<IHistoryDialogProps> = ({\n backgroundImgPath,\n fullCoverBackground,\n questions,\n answers,\n text,\n imagePath,\n textAndTypeArray,\n onClose,\n}) => {\n const [img, setImage] = useState<number>(0);\n const onHandleSpacePress = (event: KeyboardEvent) => {\n if (event.code === 'Space') {\n if (img < backgroundImgPath?.length - 1) {\n setImage(prev => prev + 1);\n } else {\n // if there's no more text chunks, close the dialog\n onClose();\n }\n }\n };\n\n useEffect(() => {\n document.addEventListener('keydown', onHandleSpacePress);\n\n return () => document.removeEventListener('keydown', onHandleSpacePress);\n }, [backgroundImgPath]);\n return (\n <BackgroundContainer\n imgPath={backgroundImgPath[img]}\n fullImg={fullCoverBackground}\n >\n <DialogContainer>\n {textAndTypeArray ? (\n <NPCMultiDialog\n textAndTypeArray={textAndTypeArray}\n onClose={onClose}\n />\n ) : questions && answers ? (\n <QuestionDialog\n questions={questions}\n answers={answers}\n onClose={onClose}\n />\n ) : text && imagePath ? (\n <NPCDialog\n text={text}\n imagePath={imagePath}\n onClose={onClose}\n type={NPCDialogType.TextAndThumbnail}\n />\n ) : (\n <NPCDialog\n text={text}\n onClose={onClose}\n type={NPCDialogType.TextOnly}\n />\n )}\n </DialogContainer>\n </BackgroundContainer>\n );\n};\n\ninterface IImgContainerProps {\n imgPath: string;\n fullImg: boolean;\n}\n\nconst BackgroundContainer = styled.div<IImgContainerProps>`\n width: 100%;\n height: 100%;\n background-image: url(${props => props.imgPath});\n background-size: ${props => (props.imgPath ? 'cover' : 'auto')};\n display: flex;\n justify-content: space-evenly;\n align-items: center;\n`;\n\nconst DialogContainer = styled.div`\n display: flex;\n justify-content: center;\n padding-top: 200px;\n`;\n","import React, { useState } from 'react';\nimport styled from 'styled-components';\nimport SelectArrow from '../Arrow/SelectArrow';\nimport { DraggableContainer } from '../DraggableContainer';\nimport { RPGUIContainerTypes } from '../RPGUI/RPGUIContainer';\nimport { DynamicText } from '../typography/DynamicText';\n\nexport interface ITextImageProps {\n image: string;\n textPosition?: 'flex-start' | 'flex-end';\n text: string;\n}\n\nexport interface IImageCarouselProps {\n textImage: ITextImageProps[];\n isTextFixed: boolean;\n onCloseButton?: () => void;\n}\n\nexport const ImageCarousel: React.FC<IImageCarouselProps> = ({\n textImage,\n isTextFixed,\n onCloseButton,\n}) => {\n const [textImageSelected, setTextImageSelected] = useState(textImage[0]);\n\n const goToPreviousImage = () => {\n const currentIndex = textImage.indexOf(textImageSelected);\n if (currentIndex > 0) {\n setTextImageSelected(textImage[currentIndex - 1]);\n }\n };\n\n const goToNextImage = () => {\n const currentIndex = textImage.indexOf(textImageSelected);\n if (currentIndex < textImage.length - 1) {\n setTextImageSelected(textImage[currentIndex + 1]);\n }\n };\n\n return (\n <CarouselWrapper type={RPGUIContainerTypes.Framed}>\n {isTextFixed ? (\n <>\n <BackgroundImage\n imagePath={textImageSelected.image}\n isTextFixed={isTextFixed}\n >\n <ArrowContainer>\n {textImageSelected !== textImage[0] && (\n <SelectArrow\n direction=\"left\"\n onPointerDown={() => goToPreviousImage()}\n ></SelectArrow>\n )}\n\n {textImageSelected !== textImage[textImage.length - 1] && (\n <SelectArrow\n direction=\"right\"\n onPointerDown={() => goToNextImage()}\n ></SelectArrow>\n )}\n </ArrowContainer>\n </BackgroundImage>\n <Description\n textPosition={textImageSelected.textPosition ?? 'flex-start'}\n isTextFixed={isTextFixed}\n >\n <DynamicText text={textImageSelected.text} />\n </Description>\n </>\n ) : (\n <BackgroundImage\n imagePath={textImageSelected.image}\n isTextFixed={isTextFixed}\n >\n <ArrowContainer>\n {textImageSelected !== textImage[0] && (\n <SelectArrow\n direction=\"left\"\n onPointerDown={() => goToPreviousImage()}\n ></SelectArrow>\n )}\n <Description\n textPosition={textImageSelected.textPosition ?? 'flex-start'}\n isTextFixed={isTextFixed}\n >\n <DynamicText text={textImageSelected.text} />\n </Description>\n {textImageSelected !== textImage[textImage.length - 1] && (\n <SelectArrow\n direction=\"right\"\n onPointerDown={() => goToNextImage()}\n ></SelectArrow>\n )}\n </ArrowContainer>\n </BackgroundImage>\n )}\n {onCloseButton && (\n <CloseButton className=\"container-close\" onPointerDown={onCloseButton}>\n X\n </CloseButton>\n )}\n </CarouselWrapper>\n );\n};\n\ninterface IBackgroundImage {\n imagePath: string;\n isTextFixed: boolean;\n}\n\ninterface ITextDescription {\n textPosition: 'flex-start' | 'flex-end';\n isTextFixed: boolean;\n}\n\nconst CarouselWrapper = styled(DraggableContainer)`\n width: 100%;\n height: 100%;\n`;\n\nconst ArrowContainer = styled.span`\n display: flex;\n height: 100%;\n align-items: center;\n`;\n\nconst BackgroundImage = styled.div<IBackgroundImage>`\n background-image: url(${props => props.imagePath});\n background-repeat: no-repeat;\n background-attachment: fixed;\n background-size: contain;\n background-position: center;\n width: 100%;\n height: ${props => (props.isTextFixed ? '80%' : '100%')};\n`;\n\nconst Description = styled.div<ITextDescription>`\n width: 100%;\n height: ${props => (props.isTextFixed ? 'auto' : '100%')};\n display: flex;\n align-items: ${props => props.textPosition};\n p {\n background-color: ${props =>\n props.isTextFixed ? 'none' : 'rgba(0, 0, 0, 0.6)'};\n border-radius: 5px;\n text-align: justify;\n height: auto;\n }\n`;\n\nconst CloseButton = styled.div`\n position: absolute;\n top: 3px;\n right: 0px;\n color: white;\n z-index: 22;\n font-size: 1.5rem;\n @media (max-width: 950px) {\n font-size: 1.7rem;\n padding: 12px;\n }\n`;\n","import React, { useEffect, useRef, useState } from 'react';\nimport styled, { keyframes } from 'styled-components';\nimport SelectArrow from '../Arrow/SelectArrow';\n\nexport interface ISimpleImageCarousel {\n images: string[];\n styles?: React.CSSProperties;\n autoCycle?: boolean;\n autoCycleDelay?: number;\n stopAutoCyclingOnInteraction?: boolean;\n}\n\nexport const SimpleImageCarousel: React.FC<ISimpleImageCarousel> = ({\n images,\n styles,\n autoCycle = false,\n autoCycleDelay = 3000,\n stopAutoCyclingOnInteraction = false,\n}) => {\n const [currentImage, setCurrentImage] = useState(0);\n const autoCycleId = useRef<NodeJS.Timeout | null>(null);\n\n const handleLeftClick = () => {\n setCurrentImage(\n prevImage => (prevImage - 1 + images?.length) % images?.length\n );\n if (stopAutoCyclingOnInteraction && autoCycleId.current) {\n clearInterval(autoCycleId.current);\n autoCycleId.current = null;\n }\n };\n\n const handleRightClick = () => {\n setCurrentImage(prevImage => (prevImage + 1) % images?.length);\n if (stopAutoCyclingOnInteraction && autoCycleId.current) {\n clearInterval(autoCycleId.current);\n autoCycleId.current = null;\n }\n };\n\n useEffect(() => {\n if (autoCycle) {\n autoCycleId.current = setInterval(() => {\n setCurrentImage(prevImage => (prevImage + 1) % images?.length);\n }, autoCycleDelay);\n }\n\n return () => {\n if (autoCycleId.current) {\n clearInterval(autoCycleId.current);\n }\n };\n }, [autoCycle, autoCycleDelay, images?.length]);\n\n const hasMoreThanOneImage = images?.length > 1;\n\n return (\n <ImageContainer style={styles}>\n {hasMoreThanOneImage && (\n <CustomLeftArrow direction=\"left\" onPointerDown={handleLeftClick} />\n )}\n {hasMoreThanOneImage && (\n <CustomRightArrow direction=\"right\" onPointerDown={handleRightClick} />\n )}\n <Carousel>\n <FadeInCarouselImg\n key={currentImage}\n src={images?.[currentImage]}\n alt={`Image ${currentImage}`}\n />\n </Carousel>\n </ImageContainer>\n );\n};\n\nconst ImageContainer = styled.div`\n flex: 1;\n display: flex;\n justify-content: center;\n align-items: center;\n height: 100%;\n margin-right: 0.5rem;\n max-width: 400px;\n position: relative;\n width: 400px;\n`;\n\nconst CustomLeftArrow = styled(SelectArrow)`\n position: absolute;\n left: -0.5rem;\n top: 50%;\n transform: translateY(-50%);\n`;\n\nconst CustomRightArrow = styled(SelectArrow)`\n position: absolute;\n right: -2.5rem;\n top: 50%;\n transform: translateY(-50%);\n`;\n\nconst Carousel = styled.div`\n display: flex;\n`;\n\nconst CarouselImg = styled.img`\n flex: 0 0 auto;\n width: 100%;\n height: auto;\n margin: 0 1rem;\n border-radius: 5px;\n box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.2);\n scroll-snap-align: start;\n margin-right: 3rem;\n`;\n\nconst fadeIn = keyframes`\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n`;\n\nconst FadeInCarouselImg = styled(CarouselImg)`\n animation: ${fadeIn} 0.5s;\n`;\n","import React, { useState } from 'react';\nimport styled from 'styled-components';\n\ninterface TabItem {\n id: string;\n title: string;\n content: React.ReactNode;\n}\n\nexport interface TableTabProps {\n tabs: TabItem[];\n activeColor?: string;\n activeTextColor: string;\n inactiveColor?: string;\n borderColor?: string;\n hoverColor?: string;\n}\n\nexport const InternalTabs: React.FC<TableTabProps> = ({\n tabs,\n activeColor = '#fef08a',\n activeTextColor = '#000000',\n inactiveColor = '#6b7280',\n borderColor = '#f59e0b',\n hoverColor = '#fef3c7',\n}) => {\n const [activeTab, setActiveTab] = useState(tabs[0].id);\n\n return (\n <TableWrapper>\n <TabHeader borderColor={borderColor}>\n {tabs.map(tab => (\n <TabButton\n key={tab.id}\n active={activeTab === tab.id}\n activeColor={activeColor}\n activeTextColor={activeTextColor}\n inactiveColor={inactiveColor}\n borderColor={borderColor}\n hoverColor={hoverColor}\n onClick={() => setActiveTab(tab.id)}\n >\n {tab.title}\n </TabButton>\n ))}\n </TabHeader>\n <ContentWrapper>\n {tabs.find(tab => tab.id === activeTab)?.content}\n </ContentWrapper>\n </TableWrapper>\n );\n};\n\nconst TableWrapper = styled.div`\n width: 100%;\n`;\n\nconst TabHeader = styled.div<{ borderColor: string }>`\n display: flex;\n border-bottom: 1px solid ${props => props.borderColor};\n`;\n\nconst TabButton = styled.button<{\n active: boolean;\n activeColor: string;\n activeTextColor: string;\n inactiveColor: string;\n borderColor: string;\n hoverColor: string;\n}>`\n flex: 1;\n padding: 0.5rem 1rem;\n font-size: 0.875rem;\n font-weight: 500;\n border-right: 1px solid ${props => props.borderColor};\n background-color: ${props =>\n props.active ? props.activeColor : 'transparent'};\n color: ${props =>\n props.active ? props.activeTextColor : props.inactiveColor};\n\n &:last-child {\n border-right: none;\n }\n\n &:hover {\n background-color: ${props =>\n props.active ? props.activeColor : props.hoverColor};\n }\n`;\n\nconst ContentWrapper = styled.div`\n padding: 1rem;\n`;\n","import React from 'react';\nimport { IPosition } from '../../types/eventTypes';\nimport { DraggableContainer } from '../DraggableContainer';\nimport { RPGUIContainerTypes } from '../RPGUI/RPGUIContainer';\n\ninterface IProps {\n children: React.ReactNode;\n title: string;\n onClose?: () => void;\n onPositionChange?: (position: IPosition) => void;\n onPositionChangeEnd?: (position: IPosition) => void;\n onPositionChangeStart?: (position: IPosition) => void;\n onOutsideClick?: () => void;\n initialPosition?: IPosition;\n scale?: number;\n width?: string;\n isFullScreen?: boolean;\n opacity?: number;\n}\n\nexport const SlotsContainer: React.FC<IProps> = ({\n children,\n title,\n onClose,\n onPositionChange,\n onPositionChangeEnd,\n onPositionChangeStart,\n onOutsideClick,\n initialPosition,\n scale,\n width,\n isFullScreen,\n opacity,\n}) => {\n return (\n <DraggableContainer\n isFullScreen={isFullScreen}\n opacity={opacity}\n title={title}\n type={RPGUIContainerTypes.Framed}\n onCloseButton={() => {\n if (onClose) {\n onClose();\n }\n }}\n width={width ?? '415px'}\n cancelDrag=\".item-container-body, #shortcuts_list\"\n onPositionChange={({ x, y }) => {\n if (onPositionChange) {\n onPositionChange({ x, y });\n }\n }}\n onPositionChangeEnd={({ x, y }) => {\n if (onPositionChangeEnd) {\n onPositionChangeEnd({ x, y });\n }\n }}\n onPositionChangeStart={({ x, y }) => {\n if (onPositionChangeStart) {\n onPositionChangeStart({ x, y });\n }\n }}\n onOutsideClick={onOutsideClick}\n initialPosition={initialPosition}\n scale={scale}\n >\n {children}\n </DraggableContainer>\n );\n};\n","import {\n getItemTextureKeyPath,\n IItem,\n IRawSpell,\n IShortcut,\n ShortcutType,\n} from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\nimport { SpriteFromAtlas } from '../shared/SpriteFromAtlas';\n\ntype ShortcutsSetterProps = {\n setSettingShortcutIndex: (index: number) => void;\n settingShortcutIndex: number;\n shortcuts: IShortcut[];\n removeShortcut: (index: number) => void;\n atlasJSON: any;\n atlasIMG: any;\n};\n\nexport const ShortcutsSetter: React.FC<ShortcutsSetterProps> = ({\n setSettingShortcutIndex,\n settingShortcutIndex,\n shortcuts,\n removeShortcut,\n atlasJSON,\n atlasIMG,\n}) => {\n const getContent = (index: number) => {\n if (shortcuts[index]?.type === ShortcutType.Item) {\n const payload = shortcuts[index]?.payload as IItem | undefined;\n\n if (!payload) return null;\n\n return (\n <SpriteFromAtlas\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={getItemTextureKeyPath(\n {\n key: payload.texturePath,\n texturePath: payload.texturePath,\n stackQty: payload.stackQty || 1,\n isStackable: payload.isStackable,\n },\n atlasJSON\n )}\n width={32}\n height={32}\n imgScale={1.2}\n imgStyle={{ left: '3px' }}\n />\n );\n }\n const IMAGE_SIZE = 32;\n const IMAGE_SCALE = 1;\n\n const shortcut = shortcuts[index];\n\n if (shortcut?.type === ShortcutType.Spell && shortcut.payload) {\n const payload = shortcut.payload as IRawSpell; // TypeScript type assertion\n\n return (\n <SpriteFromAtlas\n atlasIMG={payload.atlasIMG}\n atlasJSON={payload.atlasJSON}\n spriteKey={payload.texturePath ?? ''}\n width={IMAGE_SIZE}\n height={IMAGE_SIZE}\n imgScale={IMAGE_SCALE}\n centered\n borderRadius=\"50%\"\n />\n );\n }\n\n return null;\n };\n\n return (\n <Container>\n <p>Shortcuts:</p>\n <List id=\"shortcuts_list\">\n {Array.from({ length: 12 }).map((_, i) => (\n <Shortcut\n key={i}\n onPointerDown={() => {\n if (settingShortcutIndex !== -1) setSettingShortcutIndex(-1);\n\n removeShortcut(i);\n if (\n settingShortcutIndex === -1 &&\n (!shortcuts[i] || shortcuts[i].type === ShortcutType.None)\n )\n setSettingShortcutIndex(i);\n }}\n disabled={settingShortcutIndex !== -1 && settingShortcutIndex !== i}\n isBeingSet={settingShortcutIndex === i}\n id={`shortcutSetter_${i}`}\n >\n {getContent(i)}\n </Shortcut>\n ))}\n </List>\n </Container>\n );\n};\n\nconst Container = styled.div`\n p {\n margin: 0;\n margin-left: 0.5rem;\n font-size: 10px;\n }\n\n width: 100%;\n`;\n\nconst Shortcut = styled.button<{ isBeingSet?: boolean }>`\n width: 2.4rem;\n height: 2.4rem;\n\n background-color: ${uiColors.lightGray};\n border: 2px solid\n ${({ isBeingSet }) => (isBeingSet ? uiColors.yellow : uiColors.darkGray)};\n border-radius: 50%;\n text-transform: uppercase;\n font-size: 0.7rem;\n font-weight: bold;\n display: flex;\n align-items: center;\n justify-content: center;\n\n span {\n margin-top: 4px;\n }\n\n &:hover,\n &:focus {\n background-color: ${uiColors.darkGray};\n }\n\n &:active {\n background-color: ${uiColors.gray};\n }\n\n &:disabled {\n opacity: 0.5;\n }\n`;\n\nconst List = styled.div`\n width: 100%;\n display: flex;\n align-items: center;\n gap: 0.4rem;\n box-sizing: border-box;\n margin: 0 !important;\n\n flex-wrap: wrap;\n\n padding: 0.3rem;\n\n padding-bottom: 1rem;\n`;\n","import { ItemRarities, ItemSubType } from '@rpg-engine/shared';\nimport React from 'react';\nimport { IOptionsProps } from '../../Dropdown';\n\nexport enum OrderByType {\n Name = 'Name',\n Price = 'Price',\n}\n\nexport const itemTypeOptions: IOptionsProps[] = [\n 'Type',\n ...Object.keys(ItemSubType),\n]\n .filter(type => type !== 'DeadBody')\n .map((itemType, index) => ({\n id: index + 1,\n value: itemType,\n option: itemType,\n }));\n\nexport const itemRarityOptions: IOptionsProps[] = [\n 'Rarity',\n ...Object.values(ItemRarities),\n].map((itemRarity, index) => ({\n id: index + 1,\n value: itemRarity,\n option: itemRarity,\n}));\n\nexport const orderByOptions: IOptionsProps[] = Object.values(\n OrderByType\n).flatMap((orderBy, index) => [\n {\n id: index * 2 + 1,\n value: orderBy.toLowerCase(),\n option: (\n <>\n {orderBy}{' '}\n <span\n style={{\n transform: 'translateY(-2px)',\n display: 'inline-block',\n }}\n >\n ↑\n </span>\n </>\n ),\n },\n {\n id: index * 2 + 2,\n value: '-' + orderBy.toLowerCase(),\n option: (\n <>\n {orderBy}{' '}\n <span\n style={{\n transform: 'translateY(-2px)',\n display: 'inline-block',\n }}\n >\n ↓\n </span>\n </>\n ),\n },\n]);\n","import React, { useEffect, useRef, useState } from 'react';\nimport styled from 'styled-components';\nimport { Button, ButtonTypes } from '../Button';\nimport { RPGUIContainer, RPGUIContainerTypes } from '../RPGUI/RPGUIContainer';\nimport { RangeSlider, RangeSliderType } from '../RangeSlider';\n\nexport interface IQuantitySelectorProps {\n maxQuantity: number;\n initialQuantity?: number;\n title?: string;\n onConfirm: (quantity: number) => void;\n onClose: () => void;\n}\n\nexport const QuantitySelector: React.FC<IQuantitySelectorProps> = ({\n maxQuantity,\n initialQuantity,\n title = 'Select quantity',\n onConfirm,\n onClose,\n}) => {\n const [value, setValue] = useState(initialQuantity ?? maxQuantity);\n const inputRef = useRef<HTMLInputElement>(null);\n\n useEffect(() => {\n const closeSelector = (e: KeyboardEvent) => {\n if (e.key === 'Escape') {\n onClose();\n }\n };\n\n if (inputRef.current) {\n inputRef.current.focus();\n inputRef.current.select();\n }\n\n document.addEventListener('keydown', closeSelector);\n return () => document.removeEventListener('keydown', closeSelector);\n }, [onClose]);\n\n return (\n <StyledContainer type={RPGUIContainerTypes.Framed} width=\"25rem\">\n <CloseButton className=\"container-close\" onPointerDown={onClose}>\n X\n </CloseButton>\n <h2>{title}</h2>\n <StyledForm\n onSubmit={e => {\n e.preventDefault();\n const numberValue = Number(value);\n if (!Number.isNaN(numberValue)) {\n onConfirm(Math.max(1, Math.min(maxQuantity, numberValue)));\n }\n }}\n noValidate\n >\n <StyledInput\n ref={inputRef}\n placeholder=\"Enter quantity\"\n type=\"number\"\n min={1}\n max={maxQuantity}\n value={value}\n onChange={e => {\n if (Number(e.target.value) >= maxQuantity) {\n setValue(maxQuantity);\n return;\n }\n setValue(Number(e.target.value));\n }}\n onBlur={e => {\n setValue(\n Math.max(1, Math.min(maxQuantity, Number(e.target.value)))\n );\n }}\n />\n <RangeSlider\n type={RangeSliderType.Slider}\n valueMin={1}\n valueMax={maxQuantity}\n width=\"100%\"\n onChange={setValue}\n value={value}\n />\n <Button buttonType={ButtonTypes.RPGUIButton} type=\"submit\">\n Confirm\n </Button>\n </StyledForm>\n </StyledContainer>\n );\n};\n\nconst StyledContainer = styled(RPGUIContainer)`\n position: relative;\n display: flex;\n flex-direction: column;\n align-items: center;\n padding: 1rem;\n\n h2 {\n margin: 0;\n margin-bottom: 1rem;\n font-size: 1rem;\n }\n`;\n\nconst CloseButton = styled.div`\n position: absolute;\n top: 3px;\n right: 0px;\n color: white;\n z-index: 22;\n font-size: 1.5rem;\n cursor: pointer;\n`;\n\nconst StyledForm = styled.form`\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 1rem;\n width: 100%;\n`;\n\nconst StyledInput = styled.input`\n width: 100%;\n padding: 0.5rem;\n background-color: rgba(0, 0, 0, 0.25);\n border: none;\n color: white;\n font-size: 1rem;\n text-align: center;\n\n &::-webkit-inner-spin-button,\n &::-webkit-outer-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n\n &[type='number'] {\n -moz-appearance: textfield;\n }\n`;\n","import React from 'react';\nimport styled from 'styled-components';\nimport ModalPortal from '../Abstractions/ModalPortal';\nimport { QuantitySelector } from './QuantitySelector';\n\nexport interface IQuantitySelect {\n isOpen: boolean;\n maxQuantity: number;\n callback: (quantity: number) => void;\n title?: string;\n initialQuantity?: number;\n}\n\ninterface IProps {\n quantitySelect: IQuantitySelect;\n setQuantitySelect: React.Dispatch<React.SetStateAction<IQuantitySelect>>;\n}\n\nconst validateQuantitySelect = (\n quantitySelect: IQuantitySelect\n): IQuantitySelect => ({\n ...quantitySelect,\n maxQuantity: Math.max(1, quantitySelect.maxQuantity),\n initialQuantity: quantitySelect.initialQuantity\n ? Math.max(\n 1,\n Math.min(quantitySelect.maxQuantity, quantitySelect.initialQuantity)\n )\n : undefined,\n});\n\nexport const QuantitySelectorModal = ({\n quantitySelect,\n setQuantitySelect,\n}: IProps): JSX.Element => {\n const resetQuantitySelect = () => {\n setQuantitySelect({\n isOpen: false,\n maxQuantity: 1,\n callback: () => {},\n });\n };\n\n // Validate the input values\n const validatedQuantitySelect = validateQuantitySelect(quantitySelect);\n\n return (\n <ModalPortal>\n <QuantitySelectorContainer>\n <QuantitySelector\n maxQuantity={validatedQuantitySelect.maxQuantity}\n initialQuantity={validatedQuantitySelect.initialQuantity}\n title={validatedQuantitySelect.title}\n onConfirm={quantity => {\n validatedQuantitySelect.callback(quantity);\n resetQuantitySelect();\n }}\n onClose={() => {\n validatedQuantitySelect.callback(-1);\n resetQuantitySelect();\n }}\n />\n </QuantitySelectorContainer>\n </ModalPortal>\n );\n};\n\nconst QuantitySelectorContainer = styled.div`\n position: absolute;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n z-index: 100;\n display: flex;\n justify-content: center;\n align-items: center;\n background-color: rgba(0, 0, 0, 0.5);\n`;\n","import React from 'react';\nimport { IQuantitySelect, QuantitySelectorModal } from '../../QuantitySelector/QuantitySelectorModal';\n\ninterface IProps {\n quantitySelect: IQuantitySelect;\n setQuantitySelect: React.Dispatch<React.SetStateAction<IQuantitySelect>>;\n}\n\nexport const ItemQuantitySelectorModal = ({\n quantitySelect,\n setQuantitySelect,\n}: IProps): JSX.Element => {\n return (\n <QuantitySelectorModal\n quantitySelect={quantitySelect}\n setQuantitySelect={setQuantitySelect}\n />\n );\n};\n\nexport type { IQuantitySelect };\n","import {\n IEquipmentSet,\n IItem,\n IItemContainer,\n IShortcut,\n ItemContainerType,\n ItemSubType,\n ItemType,\n} from '@rpg-engine/shared';\nimport React, { useCallback, useMemo, useRef, useState } from 'react';\nimport styled from 'styled-components';\nimport { SlotsContainer } from '../../Abstractions/SlotsContainer';\n\nimport { useScrollOnDrag } from '../../../hooks/useScrollOnDrag';\nimport { IPosition } from '../../../types/eventTypes';\nimport { ShortcutsSetter } from '../../Shortcuts/ShortcutsSetter';\nimport { ItemSlotDetailsProvider } from './context/ItemSlotDetailsContext';\nimport { ItemSlotDraggingProvider } from './context/ItemSlotDraggingContext';\nimport { DraggedItem } from './DraggedItem';\nimport { ItemQuantitySelectorModal } from './ItemQuantitySelectorModal';\nimport { ItemSlot } from './ItemSlot';\nimport { ItemSlotToolTips } from './ItemSlotTooltips';\n\nexport interface IItemContainerProps {\n itemContainer: IItemContainer;\n onClose?: () => void;\n onItemClick?: (\n item: IItem,\n ItemType: IItem['type'],\n itemContainerType: ItemContainerType | null\n ) => void;\n onItemDragStart?: (\n item: IItem,\n slotIndex: number,\n itemContainerType: ItemContainerType | null\n ) => void;\n onItemDragEnd?: (quantity?: number) => void;\n onOutsideDrop?: (item: IItem, position: IPosition) => void;\n onItemPlaceDrop?: (\n item: IItem | null,\n slotIndex: number,\n itemContainerType: ItemContainerType | null\n ) => void;\n scale?: number;\n checkIfItemCanBeMoved: () => boolean;\n checkIfItemShouldDragEnd?: () => boolean;\n onMouseOver?: (e: any, slotIndex: number, item: IItem | null) => void;\n onSelected?: (optionId: string, item: IItem) => void;\n type: ItemContainerType;\n atlasJSON: any;\n atlasIMG: any;\n disableContextMenu?: boolean;\n initialPosition?: { x: number; y: number };\n shortcuts?: IShortcut[];\n setItemShortcut?: (key: string, index: number) => void;\n removeShortcut?: (index: number) => void;\n equipmentSet?: IEquipmentSet | null;\n isDepotSystem?: boolean;\n onPositionChangeEnd?: (position: IPosition) => void;\n onPositionChangeStart?: (position: IPosition) => void;\n isFullScreen?: boolean;\n opacity?: number;\n}\n\ntype onDragStart =\n | ((\n item: IItem,\n slotIndex: number,\n itemContainerType: ItemContainerType | null\n ) => void)\n | undefined;\ntype onDragEnd = ((quantity?: number) => void) | undefined;\n\nconst MIN_SLOTS_FOR_SCROLL = 20;\n\nexport const ItemContainer: React.FC<IItemContainerProps> = React.memo(\n ({\n itemContainer,\n onClose,\n onMouseOver,\n onSelected,\n onItemClick,\n type,\n atlasJSON,\n atlasIMG,\n disableContextMenu = false,\n onItemDragEnd,\n onItemDragStart,\n onItemPlaceDrop,\n onOutsideDrop,\n checkIfItemCanBeMoved,\n initialPosition,\n checkIfItemShouldDragEnd,\n scale,\n shortcuts,\n setItemShortcut,\n removeShortcut,\n equipmentSet,\n isDepotSystem,\n onPositionChangeEnd,\n onPositionChangeStart,\n isFullScreen,\n opacity,\n }) => {\n const [quantitySelect, setQuantitySelect] = useState({\n isOpen: false,\n maxQuantity: 1,\n callback: (_quantity: number) => {},\n });\n const [settingShortcutIndex, setSettingShortcutIndex] = useState(-1);\n\n const containerRef = useRef<HTMLDivElement>(null);\n\n const { startScrolling, stopScrolling } = useScrollOnDrag({\n containerRef,\n threshold: 50,\n scrollStep: 4,\n });\n\n const handleSetShortcut = useCallback(\n (item: IItem, index: number) => {\n if (\n item.type === ItemType.Consumable ||\n item.type === ItemType.Tool ||\n item.subType === ItemSubType.Seed\n ) {\n setItemShortcut?.(item.key, index);\n }\n },\n [setItemShortcut]\n );\n\n const handleMouseMove = useCallback(\n (e: MouseEvent) => {\n startScrolling(e.clientY);\n },\n [startScrolling]\n );\n\n const onDragStartScrollingEvents = useCallback(() => {\n document.addEventListener('pointermove', handleMouseMove);\n document.addEventListener(\n 'pointerup',\n () => {\n stopScrolling();\n document.removeEventListener('pointermove', handleMouseMove);\n },\n { once: true }\n );\n }, [handleMouseMove, stopScrolling]);\n\n const onDragEndScrollingEvents = useCallback(() => {\n stopScrolling();\n document.removeEventListener('pointermove', handleMouseMove);\n }, [handleMouseMove, stopScrolling]);\n\n const onDragStartHandler: onDragStart = useCallback(\n (\n item: IItem,\n slotIndex: number,\n itemContainerType: ItemContainerType | null\n ) => {\n if (onItemDragStart) {\n onItemDragStart(item, slotIndex, itemContainerType);\n }\n\n onDragStartScrollingEvents();\n },\n [onItemDragStart, onDragStartScrollingEvents]\n );\n\n const onDragEndHandler: onDragEnd = useCallback(\n (quantity: number | undefined) => {\n if (onItemDragEnd) {\n onItemDragEnd(quantity);\n }\n onDragEndScrollingEvents();\n },\n [onItemDragEnd, onDragEndScrollingEvents]\n );\n\n // Memoize handleSetShortcut to prevent unnecessary re-renders\n const memoizedHandleSetShortcut = useCallback(\n (item: IItem, index: number) => {\n handleSetShortcut(item, index);\n },\n [handleSetShortcut]\n );\n\n // Memoize onRenderSlots to prevent re-creating the slots array on every render\n const onRenderSlots = useMemo(() => {\n const slots = [];\n\n for (let i = 0; i < itemContainer.slotQty; i++) {\n const currentItem = itemContainer.slots?.[i] || null;\n\n slots.push(\n <ItemSlot\n key={i}\n slotIndex={i}\n item={currentItem}\n itemContainerType={type}\n onMouseOver={\n onMouseOver\n ? (event, slotIndex, item) =>\n onMouseOver(event, slotIndex, item)\n : undefined\n }\n onMouseOut={undefined} // Assuming you don't need onMouseOut here\n onPointerDown={(itemType, containerType, item) => {\n if (settingShortcutIndex !== -1) {\n setSettingShortcutIndex(-1);\n memoizedHandleSetShortcut(item, settingShortcutIndex);\n } else if (onItemClick) {\n onItemClick(item, itemType, containerType);\n }\n }}\n onDragStart={onDragStartHandler}\n onDragEnd={onDragEndHandler}\n dragScale={scale}\n checkIfItemCanBeMoved={checkIfItemCanBeMoved}\n checkIfItemShouldDragEnd={checkIfItemShouldDragEnd}\n openQuantitySelector={(maxQuantity, callback) => {\n setQuantitySelect({\n isOpen: true,\n maxQuantity,\n callback,\n });\n }}\n onPlaceDrop={(item, slotIndex, itemContainerType) => {\n if (onItemPlaceDrop) {\n onItemPlaceDrop(item, slotIndex, itemContainerType);\n }\n\n console.log('PLACE DROP');\n\n onDragEndScrollingEvents();\n }}\n onOutsideDrop={(item, position) => {\n if (onOutsideDrop) {\n onOutsideDrop(item, position);\n }\n\n console.log('OUTSIDE DROP');\n\n onDragEndScrollingEvents();\n }}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n isSelectingShortcut={settingShortcutIndex !== -1}\n equipmentSet={equipmentSet}\n setItemShortcut={\n type === ItemContainerType.Inventory\n ? memoizedHandleSetShortcut\n : undefined\n }\n isDepotSystem={isDepotSystem}\n />\n );\n }\n return slots;\n }, [\n itemContainer.slotQty,\n itemContainer.slots,\n type,\n onMouseOver,\n settingShortcutIndex,\n memoizedHandleSetShortcut,\n onItemClick,\n onDragStartHandler,\n onDragEndHandler,\n scale,\n checkIfItemCanBeMoved,\n checkIfItemShouldDragEnd,\n onItemPlaceDrop,\n onOutsideDrop,\n atlasIMG,\n atlasJSON,\n equipmentSet,\n isDepotSystem,\n onDragEndScrollingEvents,\n ]);\n\n return (\n <ItemSlotDraggingProvider>\n <ItemSlotDetailsProvider>\n <DraggedItem\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n scale={scale}\n />\n <SlotsContainer\n title={itemContainer.name || 'Container'}\n onClose={onClose}\n initialPosition={initialPosition}\n scale={scale}\n onPositionChangeEnd={onPositionChangeEnd}\n onPositionChangeStart={onPositionChangeStart}\n isFullScreen={isFullScreen}\n opacity={opacity}\n >\n {type === ItemContainerType.Inventory &&\n shortcuts &&\n removeShortcut && (\n <ShortcutsSetter\n setSettingShortcutIndex={setSettingShortcutIndex}\n settingShortcutIndex={settingShortcutIndex}\n shortcuts={shortcuts}\n removeShortcut={removeShortcut}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n />\n )}\n <ItemsContainer\n className=\"item-container-body\"\n ref={containerRef}\n isScrollable={itemContainer.slotQty > MIN_SLOTS_FOR_SCROLL}\n isFullScreen={isFullScreen}\n >\n {onRenderSlots}\n </ItemsContainer>\n </SlotsContainer>\n {quantitySelect.isOpen && (\n <ItemQuantitySelectorModal\n quantitySelect={quantitySelect}\n setQuantitySelect={setQuantitySelect}\n />\n )}\n <ItemSlotToolTips\n dragScale={scale}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n equipmentSet={equipmentSet}\n isContextMenuDisabled={disableContextMenu}\n onSelected={onSelected}\n />\n </ItemSlotDetailsProvider>\n </ItemSlotDraggingProvider>\n );\n }\n);\n\ninterface IItemsContainerProps {\n isScrollable: boolean;\n isFullScreen?: boolean;\n}\n\nconst ItemsContainer = styled.div<IItemsContainerProps>`\n display: flex;\n justify-content: ${({ isFullScreen }) =>\n isFullScreen ? 'flex-start' : 'center'};\n flex-wrap: wrap;\n max-height: ${({ isFullScreen }) =>\n isFullScreen\n ? undefined\n : '270px'}; // Adjust the max-height based on the prop\n overflow-y: ${({ isScrollable }) => (isScrollable ? 'auto' : 'hidden')};\n overflow-x: hidden;\n width: ${({ isFullScreen }) =>\n isFullScreen ? '100vw' : '415px'}; // Adjust the width based on the prop\n\n max-height: ${({ isFullScreen }) => isFullScreen && '60%'};\n\n @media screen and (max-height: 350px) {\n max-height: ${({ isFullScreen }) => isFullScreen && '50%'};\n }\n`;\n","import { useCallback, useRef } from 'react';\n\ninterface IUseScrollOnDragProps {\n containerRef: React.RefObject<HTMLDivElement>;\n threshold: number;\n scrollStep: number;\n}\n\nexport const useScrollOnDrag = ({\n containerRef,\n threshold,\n scrollStep,\n}: IUseScrollOnDragProps) => {\n const animationFrameId = useRef<number | null>(null);\n\n const startScrolling = useCallback(\n (clientY: number) => {\n const scroll = () => {\n if (containerRef.current) {\n const { top, bottom } = containerRef.current.getBoundingClientRect();\n\n const maxScrollTop =\n containerRef.current.scrollHeight -\n containerRef.current.clientHeight;\n const distanceFromTop = clientY - top;\n const distanceFromBottom = bottom - clientY;\n\n if (\n distanceFromTop < threshold &&\n containerRef.current.scrollTop > 0\n ) {\n containerRef.current.scrollTop -= scrollStep;\n animationFrameId.current = requestAnimationFrame(scroll);\n } else if (\n distanceFromBottom < threshold &&\n containerRef.current.scrollTop < maxScrollTop\n ) {\n containerRef.current.scrollTop += scrollStep;\n animationFrameId.current = requestAnimationFrame(scroll);\n } else {\n // Check if we are near the bottom of the container\n if (containerRef.current.scrollTop >= maxScrollTop) {\n // You can perform any action here when the scroll hits the bottom.\n } else {\n // Check if we are near the top of the container\n if (containerRef.current.scrollTop <= 0) {\n // You can perform any action here when the scroll hits the top.\n }\n }\n // Stop scrolling if neither condition is met\n stopScrolling();\n }\n }\n };\n\n const stopScrolling = () => {\n if (animationFrameId.current !== null) {\n cancelAnimationFrame(animationFrameId.current);\n animationFrameId.current = null;\n }\n };\n\n //@ts-ignore\n cancelAnimationFrame(animationFrameId.current); // Cancel any existing animation frame\n animationFrameId.current = requestAnimationFrame(scroll);\n },\n [containerRef, threshold, scrollStep]\n );\n\n const stopScrolling = useCallback(() => {\n if (animationFrameId.current !== null) {\n cancelAnimationFrame(animationFrameId.current);\n animationFrameId.current = null;\n }\n }, []);\n\n return { startScrolling, stopScrolling };\n};\n","import React, { useEffect, useState } from 'react';\nimport styled from 'styled-components';\nimport { Button, ButtonTypes } from '../Button';\nimport { DraggableContainer } from '../DraggableContainer';\nimport { RPGUIContainerTypes } from '../RPGUI/RPGUIContainer';\nimport { SpriteFromAtlas } from '../shared/SpriteFromAtlas';\n\nexport interface IOptionsItemSelectorProps {\n name: string;\n description?: string;\n imageKey: string;\n}\n\nexport interface IItemSelectorProps {\n atlasJSON: any;\n atlasIMG: any;\n options: IOptionsItemSelectorProps[];\n onClose: () => void;\n onSelect: (value: string) => void;\n}\n\nexport const ItemSelector: React.FC<IItemSelectorProps> = ({\n atlasIMG,\n atlasJSON,\n options,\n onClose,\n onSelect,\n}) => {\n const [selectedValue, setSelectedValue] = useState<string>();\n\n const handleClick = () => {\n let element = document.querySelector(\n `input[name='test']:checked`\n ) as HTMLInputElement;\n const elementValue = element.value;\n setSelectedValue(elementValue);\n };\n\n useEffect(() => {\n if (selectedValue) {\n onSelect(selectedValue);\n }\n }, [selectedValue]);\n return (\n <DraggableContainer\n type={RPGUIContainerTypes.Framed}\n width=\"500px\"\n cancelDrag=\".equipment-container-body .arrow-selector\"\n onCloseButton={() => {\n if (onClose) {\n onClose();\n }\n }}\n >\n <div style={{ width: '100%' }}>\n <Title>{'Harvesting instruments'}</Title>\n <Subtitle>{'Use the tool, you need it'}</Subtitle>\n <hr className=\"golden\" />\n </div>\n\n <RadioInputScroller>\n {options?.map((option, index) => (\n <RadioOptionsWrapper key={index}>\n <SpriteAtlasWrapper>\n <SpriteFromAtlas\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={option.imageKey}\n imgScale={3}\n />\n </SpriteAtlasWrapper>\n <div>\n <input\n className=\"rpgui-radio\"\n type=\"radio\"\n value={option.name}\n name=\"test\"\n />\n <label\n onPointerDown={handleClick}\n style={{ display: 'flex', alignItems: 'center' }}\n >\n {option.name} <br />\n {option.description}\n </label>\n </div>\n </RadioOptionsWrapper>\n ))}\n </RadioInputScroller>\n <ButtonWrapper>\n <Button buttonType={ButtonTypes.RPGUIButton} onPointerDown={onClose}>\n Cancel\n </Button>\n <Button buttonType={ButtonTypes.RPGUIButton}>Select</Button>\n </ButtonWrapper>\n </DraggableContainer>\n );\n};\n\nconst Title = styled.h1`\n font-size: 0.6rem;\n color: yellow !important;\n`;\nconst Subtitle = styled.h1`\n font-size: 0.4rem;\n color: yellow !important;\n`;\n\nconst RadioInputScroller = styled.div`\n padding-left: 15px;\n padding-top: 10px;\n width: 100%;\n margin-top: 1rem;\n align-items: center;\n margin-left: 20px;\n align-items: flex-start;\n overflow-y: scroll;\n height: 360px;\n`;\n\nconst SpriteAtlasWrapper = styled.div`\n margin-right: 40px;\n`;\n\nconst RadioOptionsWrapper = styled.div`\n display: flex;\n align-items: stretch;\n margin-bottom: 40px;\n`;\n\nconst ButtonWrapper = styled.div`\n display: flex;\n justify-content: space-around;\n padding-top: 20px;\n width: 100%;\n`;\n","import {\n IRankingTopCharacterEntry,\n IRankingTopSkillEntry,\n} from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\nimport { Ellipsis } from '../shared/Ellipsis';\n\nexport interface ILeaderboardLevelProps {\n items: Set<IRankingTopCharacterEntry> | Set<IRankingTopSkillEntry> | null;\n rankType: string;\n}\n\nexport const LeaderboardTable: React.FC<ILeaderboardLevelProps> = props => {\n const { items, rankType } = props;\n if (!items) return null;\n\n function isTopSkillEntry(entry: any): entry is IRankingTopSkillEntry {\n return 'skill' in entry;\n }\n\n return (\n <>\n <thead>\n <TableRowWrapper>\n <TableRowValue>\n <p>\n <Ellipsis maxLines={1} maxWidth=\"200px\" fontSize=\"14px\">\n Name\n </Ellipsis>\n </p>\n </TableRowValue>\n {rankType === 'Skill' ? (\n <TableRowValue>\n <p>\n <Ellipsis maxLines={1} maxWidth=\"200px\" fontSize=\"14px\">\n Skill\n </Ellipsis>\n </p>\n </TableRowValue>\n ) : null}\n <TableRowValue>\n <p>\n <Ellipsis maxLines={1} maxWidth=\"200px\" fontSize=\"14px\">\n Level\n </Ellipsis>\n </p>\n </TableRowValue>\n </TableRowWrapper>\n </thead>\n <tbody>\n {Array.from(items).map(entry => (\n <TableRowWrapper key={entry.name}>\n <TableRowValue>\n <p>\n <Ellipsis maxLines={1} maxWidth=\"200px\" fontSize=\"10px\">\n {entry.name}\n </Ellipsis>\n </p>\n </TableRowValue>\n {isTopSkillEntry(entry) ? (\n <TableRowValue>\n <p>\n <Ellipsis maxLines={1} maxWidth=\"200px\" fontSize=\"10px\">\n {entry.skill}\n </Ellipsis>\n </p>\n </TableRowValue>\n ) : null}\n <TableRowValue>\n <p>\n <Ellipsis maxLines={1} maxWidth=\"200px\" fontSize=\"10px\">\n {entry.level}\n </Ellipsis>\n </p>\n </TableRowValue>\n </TableRowWrapper>\n ))}\n </tbody>\n </>\n );\n};\n\nconst TableRowWrapper = styled.tr`\n margin: auto;\n padding: 0.5rem;\n\n &:hover {\n background-color: ${uiColors.darkGray};\n }\n\n p {\n font-size: 0.8rem;\n }\n`;\n\nconst TableRowValue = styled.td`\n padding: 0 20px;\n`;\n","import {\n IRankingTopCharacterEntry,\n IRankingTopSkillEntry,\n} from '@rpg-engine/shared';\nimport React, { useEffect, useRef } from 'react';\nimport styled from 'styled-components';\nimport { Dropdown, IOptionsProps } from '../Dropdown';\nimport { LeaderboardTable } from './LeaderboardTable';\n\nexport interface ILeaderboardProps {\n items: Set<IRankingTopCharacterEntry> | Set<IRankingTopSkillEntry> | null;\n onChangeClassType: (value: string) => void;\n onChangeRankType: (value: string) => void;\n onChangeSkillType: (value: string) => void;\n skillOptions: string[];\n rankOptions: string[];\n classOptions: string[];\n rankType: string;\n}\n\nexport const Leaderboard = (props: ILeaderboardProps) => {\n const {\n items,\n onChangeRankType,\n onChangeClassType,\n rankType,\n skillOptions,\n onChangeSkillType,\n classOptions,\n rankOptions,\n } = props;\n const itemsContainer = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n itemsContainer.current?.scrollTo(0, 0);\n }, []);\n\n const rankTypeOptions: IOptionsProps[] = rankOptions.map(\n (itemType, index) => ({\n id: index + 1,\n value: itemType,\n option: itemType,\n })\n );\n\n const skillTypeOptions: IOptionsProps[] = skillOptions.map(\n (itemType, index) => ({\n id: index + 1,\n value: itemType,\n option: itemType,\n })\n );\n\n const classTypeOptions: IOptionsProps[] = classOptions.map(\n (itemType, index) => ({\n id: index + 1,\n value: itemType,\n option: itemType,\n })\n );\n\n return (\n <>\n <WrapperContainer>\n <StyledDropdown\n options={rankTypeOptions}\n onChange={onChangeRankType}\n width=\"80%\"\n />\n {rankType === 'Class' ? (\n <StyledDropdown\n options={classTypeOptions}\n onChange={onChangeClassType}\n width=\"100%\"\n />\n ) : null}\n {rankType === 'Skill' ? (\n <StyledDropdown\n options={skillTypeOptions}\n onChange={onChangeSkillType}\n width=\"100%\"\n />\n ) : null}\n </WrapperContainer>\n <ItemComponentScrollWrapper\n id=\"LeaderboardContainer\"\n ref={itemsContainer}\n >\n <TableWrapper>\n <LeaderboardTable items={items} rankType={rankType} />\n </TableWrapper>\n </ItemComponentScrollWrapper>\n </>\n );\n};\n\nconst WrapperContainer = styled.div`\n display: grid;\n grid-template-columns: 50% 50%;\n justify-content: space-between;\n width: calc(100% - 40px);\n margin-left: 10px;\n\n .rpgui-content .rpgui-dropdown-imp-header {\n padding: 0px 10px 0 !important;\n }\n`;\n\nconst StyledDropdown = styled(Dropdown)`\n margin: 3px !important;\n width: 170px !important;\n`;\n\nconst ItemComponentScrollWrapper = styled.div`\n overflow-y: auto;\n height: 390px;\n width: 100%;\n margin-top: 1rem;\n\n @media (max-width: 950px) {\n height: 250px;\n }\n`;\n\nconst TableWrapper = styled.table`\n margin: auto;\n width: 100%;\n`;\n","import React from 'react';\nimport styled from 'styled-components';\nimport { uiFonts } from '../constants/uiFonts';\n\ninterface IListMenuOption {\n id: string;\n text: string;\n}\n\nexport interface IListMenuProps {\n x: number;\n y: number;\n options: IListMenuOption[];\n onSelected: (selectedOptionId: string) => void;\n}\n\nexport const ListMenu: React.FC<IListMenuProps> = ({\n options,\n onSelected,\n x,\n y,\n}) => {\n return (\n <Container x={x} y={y}>\n <ul className=\"rpgui-list-imp\" style={{ overflow: 'hidden' }}>\n {options.map((params, index) => (\n <ListElement\n key={params?.id || index}\n onPointerDown={() => {\n onSelected(params?.id);\n }}\n >\n {params?.text || 'No text'}\n </ListElement>\n ))}\n </ul>\n </Container>\n );\n};\n\ninterface IContainerProps {\n x?: number;\n y?: number;\n}\n\nconst Container = styled.div<IContainerProps>`\n display: flex;\n flex-direction: column;\n width: 100%;\n justify-content: start;\n align-items: flex-start;\n position: absolute;\n top: ${props => props.y || 0}px;\n left: ${props => props.x || 0}px;\n\n li {\n font-size: ${uiFonts.size.xsmall};\n }\n`;\n\nconst ListElement = styled.li`\n margin-right: 0.5rem;\n`;\n","import React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../constants/uiColors';\nimport { uiFonts } from '../constants/uiFonts';\n\ninterface PagerProps {\n totalItems: number;\n currentPage: number;\n itemsPerPage: number;\n onPageChange: (page: number) => void;\n}\n\nexport const Pager: React.FC<PagerProps> = ({\n totalItems,\n currentPage,\n itemsPerPage,\n onPageChange,\n}) => {\n const totalPages = Math.ceil(totalItems / itemsPerPage);\n\n return (\n <Container>\n <p>Total items: {totalItems}</p>\n <PagerContainer>\n <button\n disabled={currentPage === 1}\n onPointerDown={() => onPageChange(Math.max(currentPage - 1, 1))}\n >\n {'<'}\n </button>\n\n <div className=\"rpgui-container framed-grey\">{currentPage}</div>\n\n <button\n disabled={currentPage === totalPages}\n onPointerDown={() =>\n onPageChange(Math.min(currentPage + 1, totalPages))\n }\n >\n {'>'}\n </button>\n </PagerContainer>\n </Container>\n );\n};\n\nconst Container = styled.div`\n display: flex;\n flex-direction: column;\n align-items: center;\n\n p {\n margin: 0;\n font-size: ${uiFonts.size.xsmall};\n }\n`;\n\nconst PagerContainer = styled.div`\n display: flex;\n justify-content: center;\n align-items: center;\n gap: 5px;\n\n p {\n margin: 0;\n }\n\n div {\n color: white;\n }\n\n button {\n width: 40px;\n height: 40px;\n background-color: ${uiColors.darkGray};\n border: none;\n border-radius: 5px;\n color: white;\n\n :hover {\n background-color: ${uiColors.lightGray};\n }\n\n :disabled {\n opacity: 0.5;\n }\n\n &.active {\n background-color: ${uiColors.orange};\n font-weight: bold;\n color: black;\n }\n }\n`;\n","import React from 'react';\nimport styled from 'styled-components';\nimport ModalPortal from './Abstractions/ModalPortal';\nimport { Button, ButtonTypes } from './Button';\nimport { DraggableContainer } from './DraggableContainer';\n\nexport interface IConfirmModalProps {\n onConfirm: () => void;\n onClose: () => void;\n message?: string;\n}\n\nexport const ConfirmModal: React.FC<IConfirmModalProps> = ({\n onConfirm,\n onClose,\n message,\n}) => {\n return (\n <ModalPortal>\n <Background />\n <Container onPointerDown={onClose}>\n <DraggableContainer width=\"auto\" dragDisabled>\n <Wrapper onPointerDown={e => e.stopPropagation()}>\n <p>{message ?? 'Are you sure?'}</p>\n\n <ButtonsWrapper>\n <div className=\"cancel-button\">\n <Button\n buttonType={ButtonTypes.RPGUIButton}\n onPointerDown={onClose}\n >\n No\n </Button>\n </div>\n <Button\n buttonType={ButtonTypes.RPGUIButton}\n onPointerDown={onConfirm}\n >\n Yes\n </Button>\n </ButtonsWrapper>\n </Wrapper>\n </DraggableContainer>\n </Container>\n </ModalPortal>\n );\n};\n\nconst Background = styled.div`\n position: absolute;\n width: 100%;\n height: 100%;\n background-color: #000000;\n opacity: 0.5;\n left: 0;\n top: 0;\n z-index: 1000;\n`;\n\nconst Container = styled.div`\n position: absolute;\n width: 100%;\n height: 100%;\n left: 0;\n top: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: 1001;\n`;\n\nconst Wrapper = styled.div`\n p {\n margin: 0;\n }\n`;\n\nconst ButtonsWrapper = styled.div`\n display: flex;\n justify-content: flex-end;\n gap: 5px;\n margin-top: 5px;\n\n .cancel-button {\n filter: grayscale(0.7);\n }\n`;\n","import {\n getItemTextureKeyPath,\n IEquipmentSet,\n IItem,\n} from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\nimport { uiFonts } from '../../constants/uiFonts';\nimport { Button, ButtonTypes } from '../Button';\nimport { ItemInfoWrapper } from '../Item/Cards/ItemInfoWrapper';\nimport { onRenderGems } from '../Item/Inventory/ItemGem';\nimport { rarityColor } from '../Item/Inventory/ItemSlotRarity';\nimport { Ellipsis } from '../shared/Ellipsis';\nimport { SpriteFromAtlas } from '../shared/SpriteFromAtlas';\n\nexport interface IMarketPlaceRowsPropos {\n atlasJSON: any;\n atlasIMG: any;\n item: IItem;\n itemPrice: number;\n equipmentSet?: IEquipmentSet | null;\n scale?: number;\n onMarketPlaceItemBuy?: () => void;\n onMarketPlaceItemRemove?: () => void;\n disabled?: boolean;\n}\n\nexport const MarketplaceRows: React.FC<IMarketPlaceRowsPropos> = ({\n atlasJSON,\n atlasIMG,\n item,\n itemPrice,\n equipmentSet,\n scale,\n onMarketPlaceItemBuy,\n onMarketPlaceItemRemove,\n disabled,\n}) => {\n const renderGems = (item: IItem) => {\n return item.attachedGems && onRenderGems(item);\n };\n\n return (\n <MarketplaceWrapper>\n <ItemIconContainer>\n <SpriteContainer>\n <ItemInfoWrapper\n item={item}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n equipmentSet={equipmentSet}\n scale={scale}\n >\n <GemContainer>{renderGems(item)}</GemContainer>\n <RarityContainer item={item}>\n <SpriteFromAtlas\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={getItemTextureKeyPath(\n {\n key: item.key,\n stackQty: item.stackQty || 1,\n texturePath: item.texturePath,\n isStackable: item.isStackable,\n },\n atlasJSON\n )}\n imgScale={2}\n imgClassname=\"sprite-from-atlas-img--item\"\n />\n </RarityContainer>\n\n <QuantityContainer>\n {item.stackQty &&\n item.stackQty > 1 &&\n `x${Math.round(item.stackQty * 10) / 10}`}\n </QuantityContainer>\n </ItemInfoWrapper>\n </SpriteContainer>\n <PriceValue>\n <p>\n <Ellipsis maxLines={1} maxWidth=\"200px\" fontSize=\"10px\">\n {item.name}\n </Ellipsis>\n </p>\n </PriceValue>\n </ItemIconContainer>\n\n <Flex>\n <ItemIconContainer>\n <GoldContainer>\n <SpriteFromAtlas\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey=\"others/gold-coin-qty-5.png\"\n imgScale={2}\n />\n </GoldContainer>\n <PriceValue>\n <p>\n <Ellipsis maxLines={1} maxWidth=\"200px\" fontSize=\"10px\">\n ${itemPrice}\n </Ellipsis>\n </p>\n </PriceValue>\n </ItemIconContainer>\n <ButtonContainer>\n <Button\n buttonType={ButtonTypes.RPGUIButton}\n disabled={disabled}\n onPointerDown={() => {\n if (disabled) return;\n\n onMarketPlaceItemBuy?.();\n onMarketPlaceItemRemove?.();\n }}\n >\n {onMarketPlaceItemBuy ? 'Buy' : 'Remove'}\n </Button>\n </ButtonContainer>\n </Flex>\n </MarketplaceWrapper>\n );\n};\n\nconst MarketplaceWrapper = styled.div`\n margin: auto;\n display: flex;\n justify-content: space-between;\n padding: 0.5rem;\n\n &:hover {\n background-color: ${uiColors.darkGray};\n }\n\n p {\n font-size: 0.8rem;\n }\n`;\n\nconst QuantityContainer = styled.p`\n position: absolute;\n display: block;\n top: 15px;\n left: 25px;\n font-size: ${uiFonts.size.xsmall} !important;\n`;\n\nconst GemContainer = styled.p`\n position: absolute;\n display: block;\n top: -5px;\n left: -10px;\n font-size: ${uiFonts.size.xsmall} !important;\n`;\n\nconst Flex = styled.div`\n display: flex;\n gap: 24px;\n`;\n\nconst ItemIconContainer = styled.div`\n display: flex;\n justify-content: flex-start;\n align-items: center;\n`;\n\nconst GoldContainer = styled.div`\n position: relative;\n top: -0.5rem;\n left: 0.5rem;\n`;\nconst SpriteContainer = styled.div`\n position: relative;\n left: 0.5rem;\n`;\n\nconst PriceValue = styled.div`\n margin-left: 40px;\n`;\n\nconst ButtonContainer = styled.div`\n margin: auto;\n`;\n\nconst RarityContainer = styled.div<{ item: IItem }>`\n border-color: ${({ item }) => rarityColor(item)};\n box-shadow: ${({ item }) => `0 0 5px 8px ${rarityColor(item)}`} inset,\n ${({ item }) => `0 0 8px 6px ${rarityColor(item)}`};\n width: 32px;\n height: 32px;\n`;\n","import React, { useState } from 'react';\nimport styled from 'styled-components';\nimport { DraggableContainer } from '../DraggableContainer';\nimport { RPGUIContainerTypes } from '../RPGUI/RPGUIContainer';\nimport { Tab } from './Tab';\n\ninterface ITab {\n label: string;\n id: string;\n}\n\nexport enum MultitabType {\n Brown = 'brown',\n Gray = 'gray',\n}\n\nexport interface ITabsContainer {\n children: React.ReactNode;\n onCloseButton?: () => void;\n tabs: ITab[];\n type: MultitabType;\n styles?: {\n width?: string;\n minWidth?: string;\n minHeight?: string;\n height?: string;\n className?: string;\n title?: string;\n imgSrc?: string;\n imgWidth?: string;\n };\n isDraggableModal?: boolean;\n}\n\nexport const TabsContainer: React.FC<ITabsContainer> = ({\n children,\n onCloseButton,\n tabs,\n type = MultitabType.Brown,\n styles = {},\n isDraggableModal = false,\n}) => {\n const [selectedTab, setSelectedTab] = useState(tabs[0].id);\n\n const onRenderTabs = () =>\n tabs.map((tab, index) => (\n <Tab\n type={type}\n active={selectedTab === tab.id}\n label={tab.label}\n key={`${tab.label}_${index}`}\n onPointerDown={() => setSelectedTab(tab.id)}\n />\n ));\n\n const onGetContainerType = () => {\n switch (type) {\n case MultitabType.Brown:\n return RPGUIContainerTypes.FramedGold;\n case MultitabType.Gray:\n return RPGUIContainerTypes.Framed;\n default:\n return RPGUIContainerTypes.Framed;\n }\n };\n\n const TabsCore = () => (\n <>\n {onRenderTabs()}\n <BodyContainer\n selectedTab={selectedTab}\n className={`${type} tabs-container`}\n >\n {children}\n </BodyContainer>\n </>\n );\n\n if (isDraggableModal) {\n return (\n <DraggableContainer\n onCloseButton={onCloseButton}\n type={onGetContainerType()}\n cancelDrag=\".tabs-container *\"\n width={styles?.width}\n height={styles?.height}\n minWidth={styles?.minWidth}\n minHeight={styles?.minHeight}\n className={styles?.className}\n title={styles?.title}\n imgSrc={styles?.imgSrc}\n imgWidth={styles?.imgWidth}\n >\n {TabsCore()}\n </DraggableContainer>\n );\n }\n\n return (\n <NonDraggableWrapper\n width={styles?.width}\n height={styles?.height}\n minWidth={styles?.minWidth}\n minHeight={styles?.minHeight}\n >\n {TabsCore()}\n </NonDraggableWrapper>\n );\n};\n\ninterface IBodyContainer {\n selectedTab: string;\n}\n\nconst BodyContainer = styled.div<IBodyContainer>`\n\n display: flex; \n width: 100%;\n height: 100%;\n justify-content: space-between;\n\n /* hide everything that is not data-tab-id selectedTab */\n & > *:not([data-tab-id=${props => props.selectedTab}]) {\n display: none;\n }\n\n &.brown {\n border: 0.25rem solid #996D55;\n background-color: #BF886A;\n }\n \n &.gray {\n border: 0.25rem solid rgba(0, 0, 0, 0.25);\n background-color: #4E4A4E;\n }\n \n border-radius: 5px; \n padding: 0.5rem; \n`;\n\ninterface INonDraggableWrapperProps {\n width?: string;\n height?: string;\n minWidth?: string;\n minHeight?: string;\n}\n\nconst NonDraggableWrapper = styled.div<INonDraggableWrapperProps>`\n height: ${props => props.height || 'auto'};\n width: ${props => props.width || '50%'};\n min-width: ${props => props.minWidth || 'auto'};\n min-height: ${props => props.minHeight || 'auto'};\n display: flex;\n flex-wrap: wrap;\n image-rendering: pixelated;\n overflow-y: hidden;\n padding-top: 1.5rem;\n position: relative;\n`;\n","import { IEquipmentSet, IMarketplaceItem } from '@rpg-engine/shared';\nimport React, { useEffect, useRef, useState } from 'react';\nimport { AiFillCaretRight } from 'react-icons/ai';\nimport styled from 'styled-components';\nimport { ConfirmModal } from '../ConfirmModal';\nimport { Dropdown } from '../Dropdown';\nimport { Input } from '../Input';\nimport { MarketplaceRows } from './MarketplaceRows';\nimport { itemRarityOptions, itemTypeOptions, orderByOptions } from './filters';\n\nexport interface IBuyPanelProps {\n items: IMarketplaceItem[];\n atlasJSON: any;\n atlasIMG: any;\n onClose: () => void;\n onChangeType: (value: string) => void;\n onChangeRarity: (value: string) => void;\n onChangeOrder: (value: string) => void;\n onChangeNameInput: (value: string) => void;\n onChangeMainLevelInput: (\n value: [number | undefined, number | undefined]\n ) => void;\n onChangeSecondaryLevelInput: (\n value: [number | undefined, number | undefined]\n ) => void;\n onChangePriceInput: (value: [number | undefined, number | undefined]) => void;\n scale?: number;\n equipmentSet?: IEquipmentSet | null;\n onMarketPlaceItemBuy?: (marketPlaceItemId: string) => void;\n characterId: string;\n enableHotkeys?: () => void;\n disableHotkeys?: () => void;\n currentPage: number;\n}\n\nexport const BuyPanel: React.FC<IBuyPanelProps> = ({\n items,\n atlasIMG,\n atlasJSON,\n onChangeType,\n onChangeRarity,\n onChangeOrder,\n onChangeNameInput,\n onChangeMainLevelInput,\n onChangeSecondaryLevelInput,\n onChangePriceInput,\n equipmentSet,\n onMarketPlaceItemBuy,\n characterId,\n enableHotkeys,\n disableHotkeys,\n currentPage,\n}) => {\n const [name, setName] = useState('');\n const [mainLevel, setMainLevel] = useState<\n [number | undefined, number | undefined]\n >([undefined, undefined]);\n const [secondaryLevel, setSecondaryLevel] = useState<\n [number | undefined, number | undefined]\n >([undefined, undefined]);\n const [price, setPrice] = useState<[number | undefined, number | undefined]>([\n undefined,\n undefined,\n ]);\n const [buyingItemId, setBuyingItemId] = useState<string | null>(null);\n\n const itemsContainer = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n itemsContainer.current?.scrollTo(0, 0);\n }, [currentPage]);\n\n return (\n <>\n {buyingItemId && (\n <ConfirmModal\n onClose={setBuyingItemId.bind(null, null)}\n onConfirm={() => {\n onMarketPlaceItemBuy?.(buyingItemId);\n setBuyingItemId(null);\n enableHotkeys?.();\n }}\n message=\"Are you sure to buy this item?\"\n />\n )}\n <InputWrapper>\n <p>Search By Name</p>\n <Input\n onChange={e => {\n setName(e.target.value);\n onChangeNameInput(e.target.value);\n }}\n value={name}\n placeholder=\"Enter name...\"\n onBlur={enableHotkeys}\n onFocus={disableHotkeys}\n />\n </InputWrapper>\n\n <OptionsWrapper>\n <FilterInputsWrapper>\n <div>\n <p>Main level</p>\n <Input\n onChange={e => {\n setMainLevel([Number(e.target.value), mainLevel[1]]);\n onChangeMainLevelInput([Number(e.target.value), mainLevel[1]]);\n }}\n placeholder=\"Min\"\n type=\"number\"\n min={0}\n onBlur={enableHotkeys}\n onFocus={disableHotkeys}\n />\n <AiFillCaretRight />\n <Input\n onChange={e => {\n setMainLevel([mainLevel[0], Number(e.target.value)]);\n onChangeMainLevelInput([mainLevel[0], Number(e.target.value)]);\n }}\n placeholder=\"Max\"\n type=\"number\"\n min={0}\n onBlur={enableHotkeys}\n onFocus={disableHotkeys}\n />\n </div>\n\n <div>\n <p>Secondary level</p>\n <Input\n onChange={e => {\n setSecondaryLevel([Number(e.target.value), secondaryLevel[1]]);\n onChangeSecondaryLevelInput([\n Number(e.target.value),\n secondaryLevel[1],\n ]);\n }}\n placeholder=\"Min\"\n type=\"number\"\n min={0}\n onBlur={enableHotkeys}\n onFocus={disableHotkeys}\n />\n <AiFillCaretRight />\n <Input\n onChange={e => {\n setSecondaryLevel([secondaryLevel[0], Number(e.target.value)]);\n onChangeSecondaryLevelInput([\n secondaryLevel[0],\n Number(e.target.value),\n ]);\n }}\n placeholder=\"Max\"\n type=\"number\"\n min={0}\n onBlur={enableHotkeys}\n onFocus={disableHotkeys}\n />\n </div>\n\n <div>\n <p>Price</p>\n <Input\n onChange={e => {\n setPrice([Number(e.target.value), price[1]]);\n onChangePriceInput([Number(e.target.value), price[1]]);\n }}\n placeholder=\"Min\"\n type=\"number\"\n min={0}\n className=\"big-input\"\n onBlur={enableHotkeys}\n onFocus={disableHotkeys}\n />\n <AiFillCaretRight />\n <Input\n onChange={e => {\n setPrice([price[0], Number(e.target.value)]);\n onChangePriceInput([price[0], Number(e.target.value)]);\n }}\n placeholder=\"Max\"\n type=\"number\"\n min={0}\n className=\"big-input\"\n onBlur={enableHotkeys}\n onFocus={disableHotkeys}\n />\n </div>\n </FilterInputsWrapper>\n\n <WrapperContainer>\n <StyledDropdown\n options={itemTypeOptions}\n onChange={onChangeType}\n width=\"95%\"\n />\n <StyledDropdown\n options={itemRarityOptions}\n onChange={onChangeRarity}\n width=\"95%\"\n />\n <StyledDropdown\n options={orderByOptions}\n onChange={onChangeOrder}\n width=\"100%\"\n />\n </WrapperContainer>\n </OptionsWrapper>\n\n <ItemComponentScrollWrapper id=\"MarketContainer\" ref={itemsContainer}>\n {items?.map(({ item, price, _id, owner }, index) => (\n <MarketplaceRows\n key={`${item.key}_${index}`}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n item={item}\n itemPrice={price}\n equipmentSet={equipmentSet}\n onMarketPlaceItemBuy={setBuyingItemId.bind(null, _id)}\n disabled={owner === characterId}\n />\n ))}\n </ItemComponentScrollWrapper>\n </>\n );\n};\n\nconst InputWrapper = styled.div`\n width: 95%;\n display: flex !important;\n justify-content: flex-start;\n align-items: center;\n margin: auto;\n\n p {\n width: auto;\n margin-right: 20px;\n }\n\n input {\n width: 68%;\n height: 10px;\n }\n`;\n\nconst OptionsWrapper = styled.div`\n width: 100%;\n height: 100px;\n`;\n\nconst FilterInputsWrapper = styled.div`\n width: 95%;\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 10px;\n margin-left: 10px;\n gap: 5px;\n color: white;\n flex-wrap: wrap;\n\n p {\n width: auto;\n margin: 0;\n }\n\n input {\n width: 75px;\n height: 10px;\n }\n\n .big-input {\n width: 130px;\n }\n`;\n\nconst WrapperContainer = styled.div`\n display: grid;\n grid-template-columns: 40% 30% 30%;\n justify-content: space-between;\n width: calc(100% - 40px);\n margin-left: 10px;\n\n .rpgui-content .rpgui-dropdown-imp-header {\n padding: 0px 10px 0 !important;\n }\n`;\n\nconst ItemComponentScrollWrapper = styled.div`\n overflow-y: scroll;\n height: 390px;\n width: 100%;\n margin-top: 1rem;\n\n @media (max-width: 950px) {\n height: 250px;\n }\n`;\n\nconst StyledDropdown = styled(Dropdown)`\n margin: 3px !important;\n width: 170px !important;\n`;\n","import { IEquipmentSet, IItem, IMarketplaceItem } from '@rpg-engine/shared';\nimport React, { useEffect, useRef, useState } from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\nimport { uiFonts } from '../../constants/uiFonts';\nimport { Button, ButtonTypes } from '../Button';\nimport { ConfirmModal } from '../ConfirmModal';\nimport { Input } from '../Input';\nimport { ItemSlot } from '../Item/Inventory/ItemSlot';\nimport { MarketplaceRows } from './MarketplaceRows';\n\nexport interface IManagmentPanelProps {\n items: IMarketplaceItem[];\n atlasJSON: any;\n atlasIMG: any;\n onChangeNameInput: (value: string) => void;\n equipmentSet?: IEquipmentSet | null;\n availableGold: number;\n onMarketPlaceItemRemove?: (marketPlaceItemId: string) => void;\n selectedItemToSell: IItem | null;\n onSelectedItemToSellRemove: (item: IItem) => void;\n onAddItemToMarketplace: (item: IItem, price: number) => void;\n enableHotkeys?: () => void;\n disableHotkeys?: () => void;\n onMoneyWithdraw: () => void;\n currentPage: number;\n}\n\nexport const ManagmentPanel: React.FC<IManagmentPanelProps> = ({\n items,\n atlasIMG,\n atlasJSON,\n onChangeNameInput,\n equipmentSet,\n availableGold,\n onMarketPlaceItemRemove,\n selectedItemToSell,\n onSelectedItemToSellRemove,\n onAddItemToMarketplace,\n enableHotkeys,\n disableHotkeys,\n onMoneyWithdraw,\n currentPage,\n}) => {\n const [name, setName] = useState('');\n const [price, setPrice] = useState('');\n const [isCreatingOffer, setIsCreatingOffer] = useState(false);\n const [removingItemId, setRemovingItemId] = useState<string | null>(null);\n\n const itemsContainer = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n itemsContainer.current?.scrollTo(0, 0);\n }, [currentPage]);\n\n return (\n <>\n {isCreatingOffer && (\n <ConfirmModal\n onClose={setIsCreatingOffer.bind(null, false)}\n onConfirm={() => {\n if (selectedItemToSell && price && Number(price)) {\n onAddItemToMarketplace(selectedItemToSell, Number(price));\n setPrice('');\n onSelectedItemToSellRemove(selectedItemToSell);\n setIsCreatingOffer(false);\n enableHotkeys?.();\n }\n }}\n message=\"Are you sure to create this offer?\"\n />\n )}\n {removingItemId && (\n <ConfirmModal\n onClose={setRemovingItemId.bind(null, null)}\n onConfirm={() => {\n onMarketPlaceItemRemove?.(removingItemId);\n setRemovingItemId(null);\n enableHotkeys?.();\n }}\n message=\"Are you sure to remove this item?\"\n />\n )}\n <InputWrapper>\n <p>Search By Name</p>\n <Input\n onChange={e => {\n setName(e.target.value);\n onChangeNameInput(e.target.value);\n }}\n value={name}\n placeholder=\"Enter name...\"\n onBlur={enableHotkeys}\n onFocus={disableHotkeys}\n />\n </InputWrapper>\n\n <OptionsWrapper>\n <InnerOptionsWrapper>\n <SellDescription>\n Click on item in inventory to sell it\n </SellDescription>\n <Flex>\n <ItemSlot\n slotIndex={0}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n onPointerDown={(_, __, item) => onSelectedItemToSellRemove(item)}\n item={selectedItemToSell}\n />\n <PriceInputWrapper>\n <p>Enter price</p>\n <Flex>\n <Input\n onChange={e => {\n setPrice(e.target.value);\n }}\n value={price}\n placeholder=\"Enter price...\"\n type=\"number\"\n disabled={!selectedItemToSell}\n onBlur={enableHotkeys}\n onFocus={disableHotkeys}\n />\n <Button\n buttonType={ButtonTypes.RPGUIButton}\n disabled={!selectedItemToSell || !price}\n onPointerDown={() => {\n if (selectedItemToSell && price && Number(price)) {\n setIsCreatingOffer(true);\n }\n }}\n >\n Create offer\n </Button>\n </Flex>\n </PriceInputWrapper>\n </Flex>\n </InnerOptionsWrapper>\n <InnerOptionsWrapper>\n <AvailableGold $disabled={availableGold === 0}>\n <p>Available gold</p>\n <p className=\"center\">${availableGold}</p>\n <Button\n buttonType={ButtonTypes.RPGUIButton}\n disabled={availableGold === 0}\n onPointerDown={() => availableGold > 0 && onMoneyWithdraw()}\n >\n Withdraw\n </Button>\n </AvailableGold>\n </InnerOptionsWrapper>\n </OptionsWrapper>\n\n <ItemComponentScrollWrapper id=\"MarketContainer\" ref={itemsContainer}>\n {items?.map(({ item, price, _id }, index) => (\n <MarketplaceRows\n key={`${item.key}_${index}`}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n item={item}\n itemPrice={price}\n equipmentSet={equipmentSet}\n onMarketPlaceItemRemove={setRemovingItemId.bind(null, _id)}\n />\n ))}\n </ItemComponentScrollWrapper>\n </>\n );\n};\n\nconst Flex = styled.div`\n display: flex;\n gap: 5px;\n align-items: center;\n`;\n\nconst InputWrapper = styled.div`\n width: 95%;\n display: flex !important;\n justify-content: flex-start;\n align-items: center;\n margin: auto;\n\n p {\n width: auto;\n margin-right: 20px;\n }\n\n input {\n width: 68%;\n height: 10px;\n }\n`;\n\nconst OptionsWrapper = styled.div`\n width: 100%;\n height: 100px;\n display: flex;\n align-items: center;\n justify-content: space-around;\n`;\n\nconst InnerOptionsWrapper = styled.div`\n display: flex;\n justify-content: space-between;\n flex-direction: column;\n height: 100%;\n`;\n\nconst ItemComponentScrollWrapper = styled.div`\n overflow-y: scroll;\n height: 390px;\n width: 100%;\n margin-top: 1rem;\n\n @media (max-width: 950px) {\n height: 250px;\n }\n`;\n\nconst PriceInputWrapper = styled.div`\n p {\n margin: 0;\n }\n\n input {\n width: 200px;\n }\n`;\n\nconst SellDescription = styled.p`\n margin: 0;\n font-size: ${uiFonts.size.xsmall} !important;\n`;\n\nconst AvailableGold = styled.div<{ $disabled: boolean }>`\n height: 100%;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n\n p {\n margin: 0;\n color: ${props =>\n props.$disabled ? uiColors.lightGray : 'white'} !important;\n }\n\n .center {\n text-align: center;\n font-size: ${uiFonts.size.large} !important;\n color: ${props =>\n props.$disabled ? uiColors.lightGray : uiColors.lightGreen} !important;\n }\n`;\n","import { IEquipmentSet, IItem, IMarketplaceItem } from '@rpg-engine/shared';\nimport React, { useState } from 'react';\nimport styled from 'styled-components';\nimport { Button, ButtonTypes } from '../Button';\nimport { DraggableContainer } from '../DraggableContainer';\nimport { Pager } from '../Pager';\nimport { RPGUIContainerTypes } from '../RPGUI/RPGUIContainer';\nimport { BuyPanel } from './BuyPanel';\nimport { ManagmentPanel } from './ManagmentPanel';\n\nexport interface IMarketPlaceProps {\n items: IMarketplaceItem[];\n atlasJSON: any;\n atlasIMG: any;\n onClose: () => void;\n onChangeType: (value: string) => void;\n onChangeRarity: (value: string) => void;\n onChangeOrder: (value: string) => void;\n onChangeNameInput: (value: string) => void;\n onChangeMainLevelInput: (\n value: [number | undefined, number | undefined]\n ) => void;\n onChangeSecondaryLevelInput: (\n value: [number | undefined, number | undefined]\n ) => void;\n onChangePriceInput: (value: [number | undefined, number | undefined]) => void;\n scale?: number;\n equipmentSet?: IEquipmentSet | null;\n onMarketPlaceItemBuy?: (marketPlaceItemId: string) => void;\n onMarketPlaceItemRemove?: (marketPlaceItemId: string) => void;\n availableGold: number;\n selectedItemToSell: IItem | null;\n onSelectedItemToSellRemove: (item: IItem) => void;\n onYourPanelToggle: (yourPanel: boolean) => void;\n onAddItemToMarketplace: (item: IItem, price: number) => void;\n characterId: string;\n enableHotkeys?: () => void;\n disableHotkeys?: () => void;\n onMoneyWithdraw: () => void;\n totalItems: number;\n currentPage: number;\n itemsPerPage: number;\n onPageChange: (page: number) => void;\n}\n\nexport const Marketplace: React.FC<IMarketPlaceProps> = props => {\n const { onClose, scale, onYourPanelToggle } = props;\n\n const [isYourPanel, setIsYourPanel] = useState(false);\n\n return (\n <DraggableContainer\n type={RPGUIContainerTypes.Framed}\n onCloseButton={() => {\n if (onClose) onClose();\n }}\n width=\"800px\"\n cancelDrag=\"#MarketContainer, .rpgui-dropdown-imp, input, .empty-slot, button\"\n scale={scale}\n >\n {isYourPanel && (\n <>\n <ManagmentPanel {...props} />\n\n <PagerContainer>\n <Button\n buttonType={ButtonTypes.RPGUIButton}\n onPointerDown={() => {\n onYourPanelToggle(false);\n setIsYourPanel(false);\n }}\n >\n Go to marketplace\n </Button>\n <Pager {...props} />\n </PagerContainer>\n </>\n )}\n {!isYourPanel && (\n <>\n <BuyPanel {...props} />\n\n <PagerContainer>\n <Button\n buttonType={ButtonTypes.RPGUIButton}\n onPointerDown={() => {\n onYourPanelToggle(true);\n setIsYourPanel(true);\n }}\n >\n Go to your panel\n </Button>\n <Pager {...props} />\n </PagerContainer>\n </>\n )}\n </DraggableContainer>\n );\n};\n\nconst PagerContainer = styled.div`\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: calc(100% - 30px);\n`;\n","import React from 'react';\nimport styled from 'styled-components';\n\ninterface IContainerStyles {\n height?: string;\n width?: string;\n}\n\ninterface IProps {\n id: string;\n children: React.ReactNode;\n styles?: IContainerStyles;\n centerContent?: boolean;\n}\n\nexport const TabBody: React.FC<IProps> = ({\n id,\n children,\n styles,\n centerContent,\n}) => {\n return (\n <Container styles={styles} data-tab-id={id} centerContent={centerContent}>\n {children}\n </Container>\n );\n};\n\ninterface IContainerProps {\n styles?: IContainerStyles;\n centerContent?: boolean;\n}\n\nconst Container = styled.div<IContainerProps>`\n width: ${props => props.styles?.width || '100%'};\n height: ${props => props.styles?.height || 'auto'};\n overflow-y: auto;\n display: ${props => (props.centerContent ? 'flex' : 'block')};\n justify-content: ${props => (props.centerContent ? 'center' : 'initial')};\n align-items: ${props => (props.centerContent ? 'center' : 'initial')};\n`;\n","import React from 'react';\nimport styled from 'styled-components';\nimport { MultitabType } from './TabsContainer';\n\nexport interface ISingleTab {\n active: boolean;\n label: string;\n onPointerDown: () => void;\n type: MultitabType;\n}\n\nexport const Tab: React.FC<ISingleTab> = ({\n active,\n label,\n onPointerDown,\n type,\n}) => {\n return (\n <CustomTab\n activeTab={active}\n onPointerDown={onPointerDown}\n className={type}\n >\n <p>{label}</p>\n </CustomTab>\n );\n};\n\ninterface ICustomTab {\n activeTab: boolean;\n}\n\nconst CustomTab = styled.div<ICustomTab>`\n width: 120px;\n color: white;\n font-size: 0.8rem;\n\n &.gray {\n border-left: 0.25rem solid rgba(0, 0, 0, 0.25);\n border-right: 0.25rem solid rgba(0, 0, 0, 0.25);\n border-top: 0.25rem solid rgba(0, 0, 0, 0.25);\n border-bottom: ${props =>\n props.activeTab ? '' : '0.25rem solid rgba(0, 0, 0, 0.25)'};\n background: ${props => (props.activeTab ? '#4E4A4E' : '#2b292b')};\n }\n\n &.brown {\n border-left: 0.25rem solid #996d55;\n border-right: 0.25rem solid #996d55;\n border-top: 0.25rem solid #996d55;\n border-bottom: ${props => (props.activeTab ? '' : '0.25rem solid #996d55')};\n background: ${props => (props.activeTab ? '#BF886A' : '#B67051')};\n }\n\n margin-right: 10px;\n p {\n text-align: center;\n font-size: 0.6rem;\n\n opacity: ${props => (props.activeTab ? '1' : '0.5')};\n }\n\n border-radius: 5px 5px 0 0;\n\n position: relative;\n top: 0.3rem;\n`;\n","import React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../../constants/uiColors';\nimport { Button, ButtonTypes } from '../../Button';\nimport { DraggableContainer } from '../../DraggableContainer';\nimport { Input } from '../../Input';\nimport { RPGUIContainerTypes } from '../../RPGUI/RPGUIContainer';\n\nexport interface IPartyCreateProps {\n onClose: () => void;\n onCreate: () => void;\n}\n\nexport const PartyCreate: React.FC<IPartyCreateProps> = ({\n onClose,\n onCreate,\n}) => {\n return (\n <DraggableContainer\n type={RPGUIContainerTypes.Framed}\n onCloseButton={() => {\n if (onClose) onClose();\n }}\n width=\"500px\"\n height=\"300px\"\n cancelDrag=\".partyRows\"\n >\n <Wrapper>\n <div style={{ width: '100%' }}>\n <Title>Create Party</Title>\n <hr className=\"golden\" />\n </div>\n </Wrapper>\n <h1>Type your party name</h1>\n <Input placeholder=\"Type party name\" type=\"text\" />\n <ButtonWrapper>\n <Button\n buttonType={ButtonTypes.RPGUIButton}\n onPointerDown={() => {\n onCreate();\n }}\n >\n Confirm\n </Button>\n <div className=\"cancel-button\">\n <Button\n buttonType={ButtonTypes.RPGUIButton}\n onPointerDown={() => {\n close();\n }}\n >\n Cancel\n </Button>\n </div>\n </ButtonWrapper>\n </DraggableContainer>\n );\n};\n\nconst Wrapper = styled.div`\n display: flex;\n flex-direction: column;\n width: 100%;\n`;\nconst Title = styled.h1`\n font-size: 0.6rem;\n color: ${uiColors.yellow} !important;\n`;\n\nconst ButtonWrapper = styled.div`\n margin-top: 10px;\n width: 100%;\n display: flex;\n justify-content: space-around;\n align-items: center;\n .cancel-button {\n filter: grayscale(0.7);\n }\n`;\n","import React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../../constants/uiColors';\nimport { Button, ButtonTypes } from '../../Button';\n\nexport interface IPartyRowProps {\n id: string;\n charName: string;\n charClass: string;\n charLevel: number;\n playerQty: number;\n isInvited: boolean;\n partyName: string;\n}\n\nexport const PartyRow: React.FC<IPartyRowProps> = ({\n charName,\n charClass,\n charLevel,\n playerQty,\n isInvited,\n partyName,\n}) => {\n return (\n <PartyWrapper>\n <TextContainer>{partyName}</TextContainer>\n <TextContainer>{charName}</TextContainer>\n <TextContainer>{charClass}</TextContainer>\n <TextContainer>{charLevel}</TextContainer>\n <TextContainer>{playerQty}/5</TextContainer>\n {isInvited ? (\n <>\n <Button buttonType={ButtonTypes.RPGUIButton}>Accept</Button>\n <div className=\"cancel-button\">\n <Button buttonType={ButtonTypes.RPGUIButton}>Decline</Button>\n </div>\n </>\n ) : (\n <Button buttonType={ButtonTypes.RPGUIButton}>Join</Button>\n )}\n </PartyWrapper>\n );\n};\n\nconst PartyWrapper = styled.div`\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: space-around;\n .cancel-button {\n filter: grayscale(0.7);\n }\n`;\n\nconst TextContainer = styled.div`\n color: ${uiColors.white};\n`;\n","import React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../../constants/uiColors';\nimport { Button, ButtonTypes } from '../../Button';\nimport { DraggableContainer } from '../../DraggableContainer';\nimport { RPGUIContainerTypes } from '../../RPGUI/RPGUIContainer';\nimport { IPartyRowProps, PartyRow } from './PartyRows';\n\nexport interface IPartyDashboardProps {\n partyRows: IPartyRowProps[];\n}\n\nexport const PartyDashboard: React.FC<IPartyDashboardProps> = ({\n partyRows,\n}) => {\n return (\n <DraggableContainer\n type={RPGUIContainerTypes.Framed}\n onCloseButton={() => {\n console.log('Close');\n }}\n width=\"800px\"\n height=\"400px\"\n cancelDrag=\".partyRows\"\n >\n <Wrapper>\n <div style={{ width: '100%' }}>\n <Title>Party Dashboard</Title>\n <Button buttonType={ButtonTypes.RPGUIButton}>Create</Button>\n <hr className=\"golden\" />\n </div>\n </Wrapper>\n <RowsWrapper className=\"partyRows\">\n {partyRows.map(partyRows => (\n <PartyRow\n key={partyRows.id}\n charName={partyRows.charName}\n charClass={partyRows.charClass}\n charLevel={partyRows.charLevel}\n playerQty={partyRows.playerQty}\n id={partyRows.id}\n isInvited={partyRows.isInvited}\n partyName={partyRows.partyName}\n />\n ))}\n </RowsWrapper>\n </DraggableContainer>\n );\n};\n\nconst Wrapper = styled.div`\n display: flex;\n flex-direction: column;\n width: 100%;\n`;\n\nconst RowsWrapper = styled.div`\n overflow-y: scroll;\n -webkit-overflow-scrolling: touch;\n width: 100%;\n height: 200px;\n`;\n\nconst Title = styled.h1`\n font-size: 0.6rem;\n color: ${uiColors.yellow} !important;\n`;\n","import React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../../constants/uiColors';\nimport { Button, ButtonTypes } from '../../Button';\n\nexport interface IPlayersRowProps {\n id: string;\n charName: string;\n charClass: string;\n charLevel: number;\n isNotInvited: boolean;\n}\n\nexport const PlayersRow: React.FC<IPlayersRowProps> = ({\n charName,\n charClass,\n charLevel,\n isNotInvited,\n}) => {\n return (\n <PartyWrapper>\n <TextContainer>{charName}</TextContainer>\n <TextContainer>{charClass}</TextContainer>\n <TextContainer>{charLevel}</TextContainer>\n {isNotInvited ? (\n <>\n <Button buttonType={ButtonTypes.RPGUIButton}>Invite</Button>\n </>\n ) : (\n <TextContainer>Invited</TextContainer>\n )}\n </PartyWrapper>\n );\n};\n\nconst PartyWrapper = styled.div`\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: space-around;\n flex-direction: row;\n flex: auto;\n`;\n\nconst TextContainer = styled.div`\n color: ${uiColors.white};\n flex: auto;\n margin: auto;\n`;\n","import React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../../constants/uiColors';\nimport { DraggableContainer } from '../../DraggableContainer';\nimport { RPGUIContainerTypes } from '../../RPGUI/RPGUIContainer';\nimport { IPlayersRowProps, PlayersRow } from './PlayersRows';\n\nexport interface IPartyInviteProps {\n playersRows: IPlayersRowProps[];\n}\n\nexport const PartyInvite: React.FC<IPartyInviteProps> = ({ playersRows }) => {\n return (\n <DraggableContainer\n type={RPGUIContainerTypes.Framed}\n onCloseButton={() => {\n console.log('Close');\n }}\n width=\"600px\"\n height=\"400px\"\n cancelDrag=\".playersRows\"\n >\n <Wrapper>\n <div style={{ width: '100%' }}>\n <Title>Invite for Party</Title>\n <hr className=\"golden\" />\n </div>\n </Wrapper>\n <RowsWrapper className=\"playersRows\">\n {playersRows.map(playersRows => (\n <PlayersRow\n key={playersRows.id}\n charName={playersRows.charName}\n charClass={playersRows.charClass}\n charLevel={playersRows.charLevel}\n id={playersRows.id}\n isNotInvited={playersRows.isNotInvited}\n />\n ))}\n </RowsWrapper>\n </DraggableContainer>\n );\n};\n\nconst Wrapper = styled.div`\n display: flex;\n flex-direction: column;\n width: 100%;\n`;\nconst Title = styled.h1`\n font-size: 0.6rem;\n color: ${uiColors.yellow} !important;\n`;\n\nconst RowsWrapper = styled.div`\n overflow-y: scroll;\n -webkit-overflow-scrolling: touch;\n width: 100%;\n height: 200px;\n`;\n","import React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\n\ninterface IProps extends React.HTMLAttributes<HTMLParagraphElement> {\n children: string;\n}\n\nexport const HighlightedText = ({ children, ...rest }: IProps) => {\n return <Text {...rest}>{children}</Text>;\n};\n\nconst Text = styled.p`\n color: ${uiColors.yellow} !important;\n\n font-weight: bold;\n font-size: 1.2rem;\n\n // show the cursor as a pointer when hovering over the text\n\n &:hover {\n text-decoration: underline;\n cursor: pointer;\n }\n`;\n","import React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../../constants/uiColors';\nimport { HighlightedText } from '../../Text/HighlightedText';\nimport { Ellipsis } from '../../shared/Ellipsis';\n\nexport interface IPartyManagerRowProps {\n id: string;\n charName: string;\n charClass: string;\n isLeader: boolean;\n leaderId: string;\n userId: string;\n onRemovePlayer: (id: string) => void;\n onChangeLeader: (id: string) => void;\n}\n\nexport const PartyManagerRow: React.FC<IPartyManagerRowProps> = ({\n charName,\n charClass,\n isLeader,\n id,\n leaderId,\n userId,\n onRemovePlayer,\n onChangeLeader,\n}) => {\n const isCurrentUser = id === userId;\n const canRemove = leaderId === userId || isCurrentUser;\n\n return (\n <PartyWrapper>\n <TextContainer>\n <Ellipsis maxLines={1} maxWidth=\"300px\">\n {charName} {isCurrentUser ? '(You)' : ''} {isLeader ? '(Leader)' : ''}\n </Ellipsis>\n </TextContainer>\n <TextContainer>\n <Ellipsis maxLines={1} maxWidth=\"300px\">\n {charClass}\n </Ellipsis>\n </TextContainer>\n <ButtonContainer>\n {canRemove && (\n <HighlightedText onPointerDown={() => onRemovePlayer(id)}>\n {isCurrentUser ? 'Leave' : 'Remove'}\n </HighlightedText>\n )}\n {leaderId === userId && leaderId !== id && (\n <HighlightedText onPointerDown={() => onChangeLeader(id)}>\n New Leader\n </HighlightedText>\n )}\n </ButtonContainer>\n </PartyWrapper>\n );\n};\n\nconst PartyWrapper = styled.div`\n display: grid;\n grid-template-columns: 2fr 1fr 1fr;\n align-items: center;\n padding: 0.5rem;\n min-height: 50px;\n box-sizing: border-box;\n width: 100%;\n border-bottom: 1px solid ${uiColors.darkGray};\n\n &:hover {\n background-color: ${uiColors.darkGray};\n cursor: pointer;\n }\n`;\n\nconst TextContainer = styled.div`\n color: ${uiColors.white};\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n`;\n\nconst ButtonContainer = styled.div`\n display: flex;\n align-items: center;\n gap: 1rem;\n justify-content: flex-start;\n`;\n","import { ICharacterPartyShared, isMobileOrTablet } from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../../constants/uiColors';\nimport { PartyManagerRow } from './PartyManagerRows';\n\nexport interface IPartyManagerProps {\n partyRows: ICharacterPartyShared | null;\n\n userId: string;\n onRemovePlayer: (id: string) => void;\n onChangeLeader: (id: string) => void;\n}\n\nexport const PartyManager: React.FC<IPartyManagerProps> = ({\n partyRows,\n userId,\n onRemovePlayer,\n onChangeLeader,\n}) => {\n const invitationActionText = isMobileOrTablet() ? 'Tap' : 'Right click';\n\n const sortedMembers =\n partyRows?.leader && partyRows?.members\n ? [partyRows.leader, ...partyRows.members].sort((a, b) =>\n a._id === partyRows.leader._id\n ? -1\n : b._id === partyRows.leader._id\n ? 1\n : 0\n )\n : [];\n\n return (\n <>\n <RowsWrapper className=\"partyRows\">\n {partyRows && sortedMembers.length ? (\n sortedMembers.map(partyRow => (\n <PartyManagerRow\n userId={userId}\n key={partyRow._id}\n charName={partyRow.name}\n charClass={partyRow.class}\n id={partyRow._id}\n isLeader={partyRow._id === partyRows.leader._id}\n leaderId={partyRows.leader._id}\n onRemovePlayer={() => onRemovePlayer(partyRow._id)}\n onChangeLeader={() => onChangeLeader(partyRow._id)}\n />\n ))\n ) : (\n <NotInParty>\n <p>You're not in a party.</p>\n <p>\n Tip: <YellowText>{invitationActionText}</YellowText> on a player\n to invite them.\n </p>\n </NotInParty>\n )}\n </RowsWrapper>\n </>\n );\n};\n\nconst RowsWrapper = styled.div`\n width: 100%;\n max-height: 300px;\n overflow-y: auto;\n overflow-x: hidden;\n`;\n\nconst YellowText = styled.span`\n color: ${uiColors.yellow} !important;\n`;\n\nconst NotInParty = styled.h1`\n font-size: 0.6rem;\n margin: auto;\n`;\n","import { CharacterClass, ICharacterPartyShared } from '@rpg-engine/shared';\nimport { v4 as uuidv4 } from 'uuid';\nimport { IPartyRowProps } from '../PartyDashboard/PartyRows';\nimport { IPlayersRowProps } from '../PartyInvite';\n\nexport const mockedPartyRows: IPartyRowProps[] = [\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n charLevel: 1,\n playerQty: 3,\n isInvited: true,\n partyName: 'Party',\n },\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n charLevel: 1,\n playerQty: 3,\n isInvited: true,\n partyName: 'Party',\n },\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n charLevel: 1,\n playerQty: 3,\n isInvited: true,\n partyName: 'Party',\n },\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n charLevel: 1,\n playerQty: 3,\n isInvited: true,\n partyName: 'Party',\n },\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n charLevel: 1,\n playerQty: 3,\n isInvited: true,\n partyName: 'Party',\n },\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n charLevel: 1,\n playerQty: 3,\n isInvited: true,\n partyName: 'Party',\n },\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n charLevel: 1,\n playerQty: 3,\n isInvited: true,\n partyName: 'Party',\n },\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n charLevel: 1,\n playerQty: 3,\n isInvited: true,\n partyName: 'Party',\n },\n];\n\nexport const mockedPlayersRows2: ICharacterPartyShared = {\n id: uuidv4(),\n leader: {\n _id: uuidv4(),\n class: CharacterClass.Druid,\n name: 'leader',\n },\n members: [\n { _id: uuidv4(), class: CharacterClass.Druid, name: 'blblb' },\n { _id: uuidv4(), class: CharacterClass.Druid, name: 'blblb' },\n { _id: uuidv4(), class: CharacterClass.Druid, name: 'blblb' },\n { _id: uuidv4(), class: CharacterClass.Druid, name: 'blblb' },\n { _id: uuidv4(), class: CharacterClass.Druid, name: 'blblb' },\n { _id: uuidv4(), class: CharacterClass.Druid, name: 'blblb' },\n { _id: uuidv4(), class: CharacterClass.Druid, name: 'blblb' },\n { _id: uuidv4(), class: CharacterClass.Druid, name: 'blblb' },\n { _id: uuidv4(), class: CharacterClass.Druid, name: 'blblb' },\n { _id: uuidv4(), class: CharacterClass.Druid, name: 'blblb' },\n { _id: uuidv4(), class: CharacterClass.Druid, name: 'blblb' },\n ],\n maxSize: 5,\n size: 4,\n};\n\nexport const mockedPlayersRows: IPlayersRowProps[] = [\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n charLevel: 1,\n isNotInvited: true,\n },\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n charLevel: 1,\n isNotInvited: true,\n },\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n charLevel: 1,\n isNotInvited: true,\n },\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n charLevel: 1,\n isNotInvited: true,\n },\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n charLevel: 1,\n isNotInvited: true,\n },\n];\n\nexport const mockedPartyManager: any[] = [\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n isLeader: false,\n },\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n isLeader: false,\n },\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n isLeader: false,\n },\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n isLeader: false,\n },\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n isLeader: false,\n },\n];\n\n// Function to generate mock data for when you are the leader\nexport const getMockedPlayersRowsLeader = (\n userId: string\n): ICharacterPartyShared => ({\n id: uuidv4(),\n leader: {\n _id: userId, // You are the leader\n class: CharacterClass.Warrior,\n name: 'YourName',\n },\n members: [\n { _id: uuidv4(), class: CharacterClass.Druid, name: 'Member1' },\n { _id: uuidv4(), class: CharacterClass.Sorcerer, name: 'Member2' },\n { _id: uuidv4(), class: CharacterClass.Rogue, name: 'Member3' },\n ],\n maxSize: 5,\n size: 4,\n});\n\n// Function to generate mock data for when you are not the leader\nexport const getMockedPlayersRowsNotLeader = (\n userId: string\n): ICharacterPartyShared => ({\n id: uuidv4(),\n leader: {\n _id: uuidv4(), // Someone else is the leader\n class: CharacterClass.Druid,\n name: 'LeaderName',\n },\n members: [\n { _id: userId, class: CharacterClass.Warrior, name: 'YourName' }, // You are a member\n { _id: uuidv4(), class: CharacterClass.Sorcerer, name: 'Member2' },\n { _id: uuidv4(), class: CharacterClass.Rogue, name: 'Member3' },\n ],\n maxSize: 5,\n size: 4,\n});\n","import React from 'react';\nimport styled from 'styled-components';\nimport { uiFonts } from '../constants/uiFonts';\n\nexport interface IBarProps {\n max: number;\n value: number;\n color: 'red' | 'blue' | 'green';\n style?: Record<string, any>;\n displayText?: boolean;\n percentageWidth?: number;\n minWidth?: number;\n mobileScale?: number;\n}\n\nexport const ProgressBar: React.FC<IBarProps> = ({\n max,\n value,\n color,\n displayText = true,\n percentageWidth = 40,\n minWidth = 100,\n style,\n mobileScale,\n}) => {\n value = Math.round(value);\n max = Math.round(max);\n\n const calculatePercentageValue = function(max: number, value: number) {\n if (value > max) {\n value = max;\n }\n return (value * 100) / max;\n };\n\n return (\n <Container\n className=\"rpgui-progress\"\n data-value={calculatePercentageValue(max, value) / 100}\n data-rpguitype=\"progress\"\n percentageWidth={percentageWidth}\n minWidth={minWidth}\n style={style}\n mobileScale={mobileScale}\n >\n {displayText && (\n <TextOverlay>\n <ProgressBarText>\n {value}/{max}\n </ProgressBarText>\n </TextOverlay>\n )}\n <div className=\" rpgui-progress-track\">\n <div\n className={`rpgui-progress-fill ${color} `}\n style={{\n left: '0px',\n width: calculatePercentageValue(max, value) + '%',\n }}\n ></div>\n </div>\n <div className=\" rpgui-progress-left-edge\"></div>\n <div className=\" rpgui-progress-right-edge\"></div>\n </Container>\n );\n};\n\nconst ProgressBarText = styled.span`\n font-size: ${uiFonts.size.small} !important;\n color: white;\n text-align: center;\n z-index: 1;\n position: absolute;\n left: 50%;\n transform: translateX(-50%);\n top: 12px;\n`;\n\nconst TextOverlay = styled.div`\n width: 100%;\n position: relative;\n`;\n\ninterface IContainerProps {\n percentageWidth?: number;\n minWidth?: number;\n style?: Record<string, any>;\n mobileScale?: number;\n}\n\nconst Container = styled.div<IContainerProps>`\n display: flex;\n flex-direction: column;\n min-width: ${props => props.minWidth}px;\n width: ${props => props.percentageWidth}%;\n justify-content: start;\n align-items: flex-start;\n ${props => props.style}\n @media (max-width: 950px) {\n transform: scale(${props => props.mobileScale});\n }\n`;\n","import { IQuest } from '@rpg-engine/shared';\nimport React, { useEffect, useState } from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../../constants/uiColors';\nimport { uiFonts } from '../../../constants/uiFonts';\nimport SelectArrow from '../../Arrow/SelectArrow';\nimport { Button, ButtonTypes } from '../../Button';\nimport { DraggableContainer } from '../../DraggableContainer';\n\nimport { RPGUIContainerTypes } from '../../RPGUI/RPGUIContainer';\nimport { Column } from '../../shared/Column';\nimport thumbnailDefault from './img/default.png';\n\nexport interface IQuestsButtonProps {\n disabled: boolean;\n title: string;\n onClick: (questId: string, npcId: string) => void;\n}\n\nexport interface IQuestInfoProps {\n onClose?: () => void;\n buttons?: IQuestsButtonProps[];\n quests: IQuest[];\n onChangeQuest: (currentQuestIndex: number, currentQuestId: string) => void;\n scale?: number;\n}\n\nexport const QuestInfo: React.FC<IQuestInfoProps> = ({\n quests,\n onClose,\n buttons,\n onChangeQuest,\n scale,\n}) => {\n const [currentIndex, setCurrentIndex] = useState(0);\n const questsLength = quests.length - 1;\n\n useEffect(() => {\n if (onChangeQuest) {\n onChangeQuest(currentIndex, quests[currentIndex]._id);\n }\n }, [currentIndex]);\n\n const onLeftClick = () => {\n if (currentIndex === 0) setCurrentIndex(questsLength);\n else setCurrentIndex(index => index - 1);\n };\n const onRightClick = () => {\n if (currentIndex === questsLength) setCurrentIndex(0);\n else setCurrentIndex(index => index + 1);\n };\n\n return (\n <QuestDraggableContainer\n type={RPGUIContainerTypes.Framed}\n onCloseButton={() => {\n if (onClose) onClose();\n }}\n width=\"730px\"\n cancelDrag=\".equipment-container-body .arrow-selector\"\n scale={scale}\n >\n {quests.length >= 2 ? (\n <QuestsContainer>\n {currentIndex !== 0 && (\n <SelectArrow\n direction=\"left\"\n onPointerDown={onLeftClick}\n ></SelectArrow>\n )}\n {currentIndex !== quests.length - 1 && (\n <SelectArrow\n direction=\"right\"\n onPointerDown={onRightClick}\n ></SelectArrow>\n )}\n\n <QuestContainer>\n <TitleContainer className=\"drag-handler\">\n <Title>\n <Thumbnail\n src={quests[currentIndex].thumbnail || thumbnailDefault}\n />\n {quests[currentIndex].title}\n </Title>\n <QuestSplitDiv>\n <hr className=\"golden\" />\n </QuestSplitDiv>\n </TitleContainer>\n <Content>\n <p>{quests[currentIndex].description}</p>\n </Content>\n <QuestColumn className=\"dark-background\" justifyContent=\"flex-end\">\n {buttons &&\n buttons.map((button, index) => (\n <Button\n key={index}\n onPointerDown={() =>\n button.onClick(\n quests[currentIndex]._id,\n quests[currentIndex].npcId\n )\n }\n disabled={button.disabled}\n buttonType={ButtonTypes.RPGUIButton}\n id={`button-${index}`}\n >\n {button.title}\n </Button>\n ))}\n </QuestColumn>\n </QuestContainer>\n </QuestsContainer>\n ) : (\n <QuestsContainer>\n <QuestContainer>\n <TitleContainer className=\"drag-handler\">\n <Title>\n <Thumbnail src={quests[0].thumbnail || thumbnailDefault} />\n {quests[0].title}\n </Title>\n <QuestSplitDiv>\n <hr className=\"golden\" />\n </QuestSplitDiv>\n </TitleContainer>\n <Content>\n <p>{quests[0].description}</p>\n </Content>\n <QuestColumn className=\"dark-background\" justifyContent=\"flex-end\">\n {buttons &&\n buttons.map((button, index) => (\n <Button\n key={index}\n onPointerDown={() =>\n button.onClick(quests[0]._id, quests[0].npcId)\n }\n disabled={button.disabled}\n buttonType={ButtonTypes.RPGUIButton}\n id={`button-${index}`}\n >\n {button.title}\n </Button>\n ))}\n </QuestColumn>\n </QuestContainer>\n </QuestsContainer>\n )}\n </QuestDraggableContainer>\n );\n};\n\nconst QuestDraggableContainer = styled(DraggableContainer)`\n border: 1px solid black;\n width: 600px;\n padding: 0 0 0 0 !important;\n .DraggableContainer__TitleContainer-sc-184mpyl-2 {\n height: auto;\n }\n .container-close {\n position: absolute;\n margin-left: auto;\n top: 20px;\n padding-right: 5px;\n }\n img {\n display: inline-block;\n vertical-align: middle;\n line-height: normal;\n }\n`;\n\nconst QuestContainer = styled.div`\n margin-right: 40px;\n margin-left: 40px;\n`;\n\nconst QuestsContainer = styled.div`\n display: flex;\n align-items: center;\n`;\n\nconst Content = styled.div`\n padding: 18px;\n h1 {\n text-align: left;\n margin: 14px 0px;\n }\n`;\n\nconst QuestSplitDiv = styled.div`\n width: 100%;\n font-size: 11px;\n margin-bottom: 10px;\n hr {\n margin: 0px;\n padding: 0px;\n }\n p {\n margin-bottom: 0px;\n }\n`;\n\nconst QuestColumn = styled(Column)`\n padding-top: 5px;\n margin-bottom: 20px;\n display: flex;\n justify-content: space-evenly;\n`;\n\nconst TitleContainer = styled.div`\n width: 100%;\n display: flex;\n flex-wrap: wrap;\n justify-content: flex-start;\n align-items: center;\n margin-top: 1rem;\n`;\n\nconst Title = styled.h1`\n color: white;\n z-index: 22;\n font-size: ${uiFonts.size.medium} !important;\n color: ${uiColors.yellow} !important;\n`;\n\nconst Thumbnail = styled.img`\n color: white;\n z-index: 22;\n width: 32px * 1.5;\n margin-right: 0.5rem;\n position: relative;\n top: -4px;\n`;\n","import { IQuest, QuestStatus } from '@rpg-engine/shared';\nimport React from 'react';\nimport styled, { CSSProperties } from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\n\nexport interface IQuestListProps {\n quests?: IQuest[];\n styles?: {\n container?: CSSProperties;\n card?: CSSProperties;\n label?: CSSProperties;\n value?: CSSProperties;\n };\n}\n\nexport const QuestList: React.FC<IQuestListProps> = ({ quests, styles }) => {\n return (\n <QuestListContainer style={styles?.container}>\n {quests && quests.length > 0 ? (\n quests.map((quest, i) => (\n <QuestCard key={i} style={styles?.card}>\n <QuestItem>\n <Label style={styles?.label}>Title:</Label>\n <Value style={styles?.value}>\n {formatQuestText(quest.title)}\n </Value>\n </QuestItem>\n <QuestItem>\n <Label style={styles?.label}>Status:</Label>\n <Value\n style={{\n ...styles?.value,\n color: getQuestStatusColor(quest.status),\n }}\n >\n {formatQuestStatus(quest.status) ?? 'Unknown'}\n </Value>\n </QuestItem>\n <QuestItem>\n <Label style={styles?.label}>Description:</Label>\n <Value style={styles?.value}>{quest.description}</Value>\n </QuestItem>\n </QuestCard>\n ))\n ) : (\n <NoQuestContainer>\n <p>There are no ongoing quests</p>\n </NoQuestContainer>\n )}\n </QuestListContainer>\n );\n};\n\nconst QuestListContainer = styled.div`\n max-height: 400px;\n padding: 10px;\n border-radius: 10px;\n font-size: 0.7rem;\n`;\n\nconst QuestCard = styled.div`\n background-color: ${uiColors.darkGray};\n padding: 15px;\n margin-bottom: 10px;\n border-radius: 10px;\n border: 1px solid ${uiColors.gray};\n display: flex;\n flex-direction: column;\n`;\n\nconst QuestItem = styled.div`\n display: flex;\n margin-bottom: 5px;\n flex-wrap: wrap;\n\n &:last-child {\n margin-bottom: 0;\n }\n`;\n\nconst Label = styled.span`\n font-weight: bold;\n color: ${uiColors.yellow} !important;\n margin-right: 10px;\n`;\n\nconst Value = styled.span`\n flex-grow: 1;\n color: ${uiColors.white};\n word-wrap: break-word;\n`;\n\nconst NoQuestContainer = styled.div`\n text-align: center;\n p {\n margin-top: 5px;\n color: ${uiColors.lightGray};\n }\n`;\n\nexport const formatQuestText = (text: string) => {\n if (!text) return '';\n return text\n .split('-')\n .map(word => word.charAt(0).toUpperCase() + word.slice(1))\n .join(' ');\n};\n\nexport const getQuestStatusColor = (status?: QuestStatus) => {\n switch (status) {\n case QuestStatus.Pending:\n return uiColors.orange;\n case QuestStatus.InProgress:\n return uiColors.blue;\n case QuestStatus.Completed:\n return uiColors.lightGreen;\n default:\n return uiColors.white;\n }\n};\n\nexport const formatQuestStatus = (status?: QuestStatus) => {\n if (!status) return '';\n return status\n .split(/(?=[A-Z])/)\n .join(' ')\n .replace(/^\\w/, c => c.toUpperCase());\n};\n","import React from 'react';\nimport styled from 'styled-components';\n\ninterface IProps {\n children: React.ReactNode;\n}\n\nexport const RPGUIScrollbar = ({ children }: IProps) => {\n return <Container>{children}</Container>;\n};\n\nconst Container = styled.div`\n /* Override RPGUI CSS */\n\n .rpgui-content ::-webkit-scrollbar,\n .rpgui-content::-webkit-scrollbar {\n width: 25px !important;\n }\n\n .rpgui-content ::-webkit-scrollbar-track,\n .rpgui-content::-webkit-scrollbar-track {\n background-size: 25px 60px !important;\n }\n`;\n","import React from 'react';\nimport { RPGUIScrollbar } from './RPGUIScrollbar';\ninterface IProps {\n children: React.ReactNode;\n}\n\nexport const RPGUIOverrides = ({ children }: IProps) => {\n return <RPGUIScrollbar>{children}</RPGUIScrollbar>;\n};\n","import React from 'react';\nimport 'rpgui/rpgui.css';\nimport 'rpgui/rpgui.min.js';\nimport { RPGUIOverrides } from './RPGUIOverrides';\n\ninterface IProps {\n children: React.ReactNode;\n}\n\n//@ts-ignore\nexport const _RPGUI = RPGUI;\n\nexport const RPGUIRoot: React.FC<IProps> = ({ children }) => {\n return (\n <RPGUIOverrides>\n <div className=\"rpgui-content\">{children}</div>\n </RPGUIOverrides>\n );\n};\n","import {\n getItemTextureKeyPath,\n IItem,\n IItemContainer,\n IRawSpell,\n IShortcut,\n ShortcutType,\n} from '@rpg-engine/shared';\nimport React, { useCallback, useEffect, useRef } from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\nimport { countItemFromInventory } from '../../libs/itemCounter';\nimport { SpriteFromAtlas } from '../shared/SpriteFromAtlas';\nimport { SingleShortcut } from './SingleShortcut';\nimport { useShortcutCooldown } from './useShortcutCooldown';\n\nexport type ShortcutsProps = {\n shortcuts: IShortcut[];\n onShortcutCast: (index: number) => void;\n mana: number;\n isBlockedCastingByKeyboard?: boolean;\n inventory?: IItemContainer | null;\n atlasJSON: any;\n atlasIMG: any;\n spellCooldowns?: Record<string, number>;\n};\n\nexport const Shortcuts: React.FC<ShortcutsProps> = ({\n shortcuts,\n onShortcutCast,\n mana,\n isBlockedCastingByKeyboard = false,\n atlasJSON,\n atlasIMG,\n inventory,\n spellCooldowns,\n}) => {\n const shortcutsRefs = useRef<HTMLButtonElement[]>([]);\n\n const { handleShortcutCast, shortcutCooldown } = useShortcutCooldown(\n onShortcutCast\n );\n\n const handleKeyDown = useCallback(\n (e: KeyboardEvent) => {\n if (isBlockedCastingByKeyboard) return;\n\n const shortcutIndex = Number(e.key) - 1;\n if (shortcutIndex >= 0 && shortcutIndex <= 11) {\n handleShortcutCast(shortcutIndex);\n shortcutsRefs.current[shortcutIndex]?.classList.add('active');\n const timeoutId = setTimeout(() => {\n shortcutsRefs.current[shortcutIndex]?.classList.remove('active');\n }, 150);\n // Store timeoutId for later cleanup\n timeoutIds.current.push((timeoutId as unknown) as number);\n }\n },\n [isBlockedCastingByKeyboard, handleShortcutCast]\n );\n\n // Initialize a ref to store the timeout ids\n const timeoutIds = useRef<number[]>([]);\n\n useEffect(() => {\n window.addEventListener('keydown', handleKeyDown);\n\n return () => {\n window.removeEventListener('keydown', handleKeyDown);\n // Clear all timeouts when the component unmounts\n timeoutIds.current.forEach(id => clearTimeout(id));\n };\n }, [handleKeyDown]);\n\n return (\n <List>\n {Array.from({ length: 12 }).map((_, i) => {\n const buildClassName = (classBase: string, isOnCooldown: boolean) => {\n return `${classBase} ${isOnCooldown ? 'onCooldown' : ''}`;\n };\n\n const isOnShortcutCooldown = shortcutCooldown > 0;\n\n if (shortcuts && shortcuts[i]?.type === ShortcutType.Item) {\n const payload = shortcuts[i]?.payload as IItem | undefined;\n\n let itemsFromEquipment: (IItem | undefined | null)[] = [];\n\n if (inventory) {\n Object.keys(inventory.slots).forEach(i => {\n const index = parseInt(i);\n\n if (inventory.slots[index]?.key === payload?.key) {\n itemsFromEquipment.push(inventory.slots[index]);\n }\n });\n }\n\n const totalQty =\n payload && inventory\n ? countItemFromInventory(payload.key, inventory)\n : 0;\n\n return (\n <StyledShortcut\n key={i}\n onPointerDown={handleShortcutCast.bind(null, i)}\n disabled={false}\n ref={el => {\n if (el) shortcutsRefs.current[i] = el;\n }}\n >\n {isOnShortcutCooldown && (\n <span className=\"cooldown\">{shortcutCooldown.toFixed(1)}</span>\n )}\n {payload && (\n <SpriteFromAtlas\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={getItemTextureKeyPath(\n {\n key: payload.texturePath,\n texturePath: payload.texturePath,\n stackQty: payload.stackQty || 1,\n isStackable: payload.isStackable,\n },\n atlasJSON\n )}\n width={32}\n height={32}\n />\n )}\n <span className={buildClassName('qty', isOnShortcutCooldown)}>\n {totalQty}\n </span>\n <span\n className={buildClassName('keyboard', isOnShortcutCooldown)}\n >\n {i + 1}\n </span>\n </StyledShortcut>\n );\n }\n\n const payload =\n shortcuts && (shortcuts[i]?.payload as IRawSpell | undefined); //check if shortcuts exists before using the ? operator.\n\n const spellCooldown = !payload\n ? 0\n : spellCooldowns?.[payload.magicWords.replaceAll(' ', '_')] ??\n shortcutCooldown;\n const cooldown =\n spellCooldown > shortcutCooldown ? spellCooldown : shortcutCooldown;\n const isOnCooldown = cooldown > 0 && !!payload;\n\n const IMAGE_SCALE = 1.5;\n const IMAGE_SIZE = 32;\n\n return (\n <StyledShortcut\n key={i}\n onPointerDown={handleShortcutCast.bind(null, i)}\n disabled={mana < (payload?.manaCost ?? 0)}\n ref={el => {\n if (el) shortcutsRefs.current[i] = el;\n }}\n >\n {isOnCooldown && (\n <span className=\"cooldown\">\n {cooldown.toFixed(cooldown < 10 ? 1 : 0)}\n </span>\n )}\n <span>\n {payload?.atlasIMG && (\n <SpriteFromAtlas\n atlasIMG={payload.atlasIMG}\n atlasJSON={payload.atlasJSON}\n spriteKey={payload.texturePath ?? ''}\n width={IMAGE_SIZE}\n height={IMAGE_SIZE}\n imgScale={IMAGE_SCALE}\n centered\n borderRadius=\"50%\"\n />\n )}\n </span>\n <span className={buildClassName('mana', isOnCooldown)}>\n {payload && payload.manaCost}\n </span>\n <span className={buildClassName('keyboard', isOnCooldown)}>\n {i + 1}\n </span>\n </StyledShortcut>\n );\n })}\n </List>\n );\n};\n\nconst StyledShortcut = styled(SingleShortcut)`\n transition: all 0.15s;\n\n &.active {\n background-color: ${uiColors.gray};\n border-color: ${uiColors.yellow};\n }\n`;\n\nconst List = styled.p`\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 0.5rem;\n box-sizing: border-box;\n margin: 0 !important;\n\n scale: 0.9;\n`;\n","import React from 'react';\nimport styled from 'styled-components';\n\nexport interface ISimpleProgressBarProps {\n value: number;\n bgColor?: string;\n margin?: number;\n}\n\nexport const SimpleProgressBar: React.FC<ISimpleProgressBarProps> = ({\n value,\n bgColor = 'red',\n margin = 20,\n}) => {\n // Ensure the width is at least 1% if value is greater than 0\n const width = value > 0 ? Math.max(1, Math.min(100, value)) : 0;\n\n return (\n <Container className=\"simple-progress-bar\">\n <ProgressBarContainer margin={margin}>\n <BackgroundBar>\n <Progress width={width} bgColor={bgColor} />\n </BackgroundBar>\n </ProgressBarContainer>\n </Container>\n );\n};\n\nconst Container = styled.div`\n display: flex;\n justify-content: center;\n align-items: center;\n width: 100%;\n`;\n\nconst BackgroundBar = styled.span`\n background-color: rgba(0, 0, 0, 0.075);\n`;\n\ninterface IProgressProps {\n width: number;\n bgColor: string;\n}\n\nconst Progress = styled.span<IProgressProps>`\n background-color: ${props => props.bgColor};\n width: ${props => props.width.toFixed(2)}%;\n transition: width 0.5s ease-in-out;\n`;\n\ninterface IProgressBarContainerProps {\n margin: number;\n}\n\nconst ProgressBarContainer = styled.div<IProgressBarContainerProps>`\n border-radius: 60px;\n border: 1px solid #282424;\n overflow: hidden;\n width: 100%;\n span {\n display: block;\n height: 100%;\n }\n height: 8px;\n margin-left: ${props => props.margin}px;\n`;\n","import styled from 'styled-components';\n\nexport const Tooltip = styled.div`\n visibility: hidden;\n position: absolute;\n background-color: black;\n color: white;\n text-align: center;\n border-radius: 4px;\n padding: 5px;\n z-index: 1;\n font-size: 0.5rem;\n white-space: nowrap;\n\n /* Positioning */\n top: -20px; /* Adjust based on where you want the tooltip to appear */\n left: 50%;\n transform: translateX(-50%);\n`;\n","import { getSPForLevel } from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../constants/uiColors';\nimport { ErrorBoundary } from './Item/Inventory/ErrorBoundary';\nimport { SpriteFromAtlas } from './shared/SpriteFromAtlas';\nimport { SimpleProgressBar } from './SimpleProgressBar';\nimport { Tooltip } from './Tooltip/Tooltip';\n\nexport interface ISkillProgressBarProps {\n skillName: string;\n bgColor: string;\n level: number;\n skillPoints: number;\n texturePath: string;\n showSkillPoints?: boolean;\n skillPointsToNextLevel: number;\n atlasJSON: any;\n atlasIMG: any;\n buffAndDebuff?: number;\n}\n\nexport const SkillProgressBar: React.FC<ISkillProgressBarProps> = ({\n bgColor,\n skillName,\n level,\n skillPoints: currentSkillPoints,\n skillPointsToNextLevel,\n texturePath,\n showSkillPoints = true,\n atlasIMG,\n atlasJSON,\n\n buffAndDebuff,\n}) => {\n // Skill points needed to start the current level\n const baseSkillPoints = getSPForLevel(level);\n const calculateProgress = (): number => {\n const totalPointsForLevelUp = Math.max(\n 1,\n skillPointsToNextLevel - baseSkillPoints\n );\n const excessSkillPoints = Math.max(0, currentSkillPoints - baseSkillPoints);\n\n return Math.min(\n 100,\n Math.max(0, (excessSkillPoints / totalPointsForLevelUp) * 100)\n );\n };\n\n const progress = calculateProgress();\n\n const formatBuffAndDebuff = (value?: number): string =>\n value !== undefined ? value.toFixed(2) : '0';\n\n const skillsBuffsCalc = (level: number, buffAndDebuff: number): string => {\n if (buffAndDebuff === 0) return '0';\n const result = level * (buffAndDebuff / 100);\n return result > 0 ? `+${result.toFixed(2)}` : `${result.toFixed(2)}`;\n };\n\n return (\n <>\n <ProgressTitle>\n {buffAndDebuff !== undefined && (\n <>\n {buffAndDebuff > 0 ? (\n <BuffAndDebuffContainer>\n <TitleNameContainer>\n <TitleNameBuff>{skillName}</TitleNameBuff>\n <TitleNameBuff>\n lv {level} ({skillsBuffsCalc(level, buffAndDebuff)})\n </TitleNameBuff>\n </TitleNameContainer>\n <TitleNameBuffContainer>\n <TitleNameBuff>\n (+{formatBuffAndDebuff(buffAndDebuff)}%)\n </TitleNameBuff>\n </TitleNameBuffContainer>\n </BuffAndDebuffContainer>\n ) : buffAndDebuff < 0 ? (\n <>\n <TitleNameContainer>\n <TitleNameDebuff>{skillName}</TitleNameDebuff>\n <TitleNameDebuff>\n lv {level} ({skillsBuffsCalc(level, buffAndDebuff)})\n </TitleNameDebuff>\n </TitleNameContainer>\n <div>\n <TitleNameDebuff>\n ({formatBuffAndDebuff(buffAndDebuff)}%)\n </TitleNameDebuff>\n </div>\n </>\n ) : (\n <TitleName>{skillName}</TitleName>\n )}\n </>\n )}\n {!buffAndDebuff && (\n <TitleNameContainer>\n <TitleName>{skillName}</TitleName>\n <ValueDisplay>lv {level}</ValueDisplay>\n </TitleNameContainer>\n )}\n </ProgressTitle>\n\n <ProgressBody>\n <ProgressIconContainer>\n {atlasIMG && atlasJSON ? (\n <SpriteContainer>\n <ErrorBoundary>\n <SpriteFromAtlas\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={texturePath}\n imgScale={1}\n grayScale\n opacity={0.5}\n />\n </ErrorBoundary>\n </SpriteContainer>\n ) : (\n <></>\n )}\n </ProgressIconContainer>\n\n <ProgressBarWrapper>\n <SimpleProgressBar value={progress} bgColor={bgColor} />\n <Tooltip>SP: {currentSkillPoints}</Tooltip>\n </ProgressBarWrapper>\n </ProgressBody>\n {showSkillPoints && (\n <SkillDisplayContainer>\n <SkillPointsDisplay>{progress.toFixed(2)}%</SkillPointsDisplay>\n </SkillDisplayContainer>\n )}\n </>\n );\n};\n\nconst ProgressBarWrapper = styled.div`\n position: relative;\n\n &:hover ${Tooltip}, &:active ${Tooltip} {\n visibility: visible;\n }\n width: 100%;\n height: auto;\n top: 8px;\n`;\n\nconst SpriteContainer = styled.div`\n position: relative;\n top: -3px;\n left: 0;\n`;\n\nconst SkillDisplayContainer = styled.div`\n margin: 0 auto;\n\n p {\n margin: 0;\n }\n`;\n\nconst SkillPointsDisplay = styled.p`\n font-size: 0.55rem !important;\n font-weight: bold;\n text-align: center;\n`;\n\nconst TitleName = styled.span`\n margin-left: 5px;\n`;\n\nconst TitleNameBuff = styled.span`\n margin-left: 5px;\n color: ${uiColors.lightGreen} !important;\n`;\n\nconst TitleNameDebuff = styled.span`\n margin-left: 5px;\n color: ${uiColors.red} !important;\n`;\n\nconst ValueDisplay = styled.span``;\n\nconst ProgressIconContainer = styled.div`\n display: flex;\n justify-content: center;\n align-items: center;\n`;\n\nconst ProgressBody = styled.div`\n display: flex;\n flex-direction: row;\n width: 100%;\n`;\n\nconst ProgressTitle = styled.div`\n width: 100%;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n span {\n font-size: 0.6rem;\n }\n`;\n\nconst BuffAndDebuffContainer = styled.div``;\n\nconst TitleNameBuffContainer = styled.div``;\n\nconst TitleNameContainer = styled.div`\n display: flex;\n justify-content: space-between;\n`;\n","import {\n ISkill,\n ISkillDetails,\n getSPForLevel,\n getXPForLevel,\n} from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../constants/uiColors';\nimport { DraggableContainer } from './DraggableContainer';\nimport { SkillProgressBar } from './SkillProgressBar';\n\nexport interface ISkillContainerProps {\n skill: ISkill;\n onCloseButton: () => void;\n atlasJSON: any;\n atlasIMG: any;\n scale?: number;\n}\n\nconst skillProps = {\n attributes: {\n color: uiColors.purple,\n values: {\n stamina: 'staffs/doom-staff.png',\n magic: 'helmets/yellow-enchanter-hat.png',\n magicResistance: 'gems/amethyst-gem.png',\n strength: 'crafting-resources/dragon-tooth.png',\n resistance: 'books/magic-orb.png',\n dexterity: 'boots/gaias-soleplate.png',\n },\n },\n combat: {\n color: uiColors.cardinal,\n values: {\n first: 'gloves/leather-gloves.png',\n club: 'maces/club.png',\n sword: 'swords/double-edged-sword.png',\n axe: 'axes/double-axe.png',\n distance: 'ranged-weapons/horse-bow.png',\n shielding: 'shields/studded-shield.png',\n dagger: 'daggers/dagger.png',\n },\n },\n crafting: {\n color: uiColors.blue,\n values: {\n fishing: 'foods/fish.png',\n farming: 'tools/watering-can.png',\n mining: 'crafting-resources/iron-ingot.png',\n lumberjacking: 'crafting-resources/greater-wooden-log.png',\n blacksmithing: 'hammers/hammer.png',\n cooking: 'foods/chickens-meat.png',\n alchemy: 'potions/greater-mana-potion.png',\n },\n },\n};\n\ninterface SkillMap {\n [key: string]: string;\n}\n\nconst skillNameMap: SkillMap = {\n stamina: 'Stamina',\n magic: 'Magic',\n magicResistance: 'Magic Resistance',\n strength: 'Strength',\n resistance: 'Resistance',\n dexterity: 'Dexterity',\n first: 'Fist',\n club: 'Club',\n sword: 'Sword',\n axe: 'Axe',\n distance: 'Distance',\n shielding: 'Shielding',\n dagger: 'Dagger',\n fishing: 'Fishing',\n farming: 'Farming',\n mining: 'Mining',\n lumberjacking: 'Lumberjacking',\n blacksmithing: 'Blacksmithing',\n cooking: 'Cooking',\n alchemy: 'Alchemy',\n};\n\nexport const SkillsContainer: React.FC<ISkillContainerProps> = ({\n onCloseButton,\n skill,\n atlasIMG,\n atlasJSON,\n scale,\n}) => {\n const onRenderSkillCategory = (\n category: 'attributes' | 'combat' | 'crafting'\n ) => {\n const skillCategory = skillProps[category];\n\n const skillCategoryColor = skillCategory.color;\n\n const output = [];\n\n for (const [key, value] of Object.entries(skillCategory.values)) {\n if (key === 'stamina') {\n continue;\n }\n //@ts-ignore\n const skillDetails = (skill[key] as unknown) as ISkillDetails;\n\n if (!skillDetails) {\n continue;\n }\n\n output.push(\n <SkillProgressBar\n key={key}\n skillName={skillNameMap[key]}\n bgColor={skillCategoryColor}\n level={skillDetails.level || 0}\n skillPoints={Math.round(skillDetails.skillPoints) || 0}\n skillPointsToNextLevel={\n Math.round(getSPForLevel(skillDetails.level + 1)) || 0\n }\n texturePath={value}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n buffAndDebuff={skillDetails.buffAndDebuff}\n />\n );\n }\n\n return output;\n };\n\n return (\n <SkillsDraggableContainer\n title=\"Skills\"\n cancelDrag=\"#skillsDiv\"\n scale={scale}\n width=\"100%\"\n >\n {onCloseButton && (\n <CloseButton onPointerDown={onCloseButton}>X</CloseButton>\n )}\n <SkillsContainerDiv id=\"skillsDiv\">\n <SkillSplitDiv>\n <p>General</p>\n <hr className=\"golden\" />\n\n <SkillProgressBar\n skillName={'Level'}\n bgColor={uiColors.navyBlue}\n level={Math.round(skill.level) || 0}\n skillPoints={Math.round(skill.experience) || 0}\n skillPointsToNextLevel={\n Math.round(getXPForLevel(skill.level + 1)) || 0\n }\n texturePath={'swords/broad-sword.png'}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n />\n\n <p>Combat Skills</p>\n <hr className=\"golden\" />\n </SkillSplitDiv>\n\n {onRenderSkillCategory('combat')}\n\n <SkillSplitDiv>\n <p>Crafting Skills</p>\n <hr className=\"golden\" />\n </SkillSplitDiv>\n\n {onRenderSkillCategory('crafting')}\n\n <SkillSplitDiv>\n <p>Basic Attributes</p>\n <hr className=\"golden\" />\n </SkillSplitDiv>\n\n {onRenderSkillCategory('attributes')}\n </SkillsContainerDiv>\n </SkillsDraggableContainer>\n );\n};\n\nconst SkillsDraggableContainer = styled(DraggableContainer)`\n border: 1px solid black;\n\n max-width: 450px;\n\n height: 90%;\n .DraggableContainer__TitleContainer-sc-184mpyl-2 {\n width: auto;\n height: auto;\n }\n`;\n\nconst SkillsContainerDiv = styled.div`\n width: 100%;\n -webkit-overflow-y: scroll;\n overflow-y: scroll;\n height: 90%;\n padding-right: 10px;\n`;\n\nconst SkillSplitDiv = styled.div`\n width: 100%;\n font-size: 11px;\n hr {\n margin: 0;\n margin-bottom: 1rem;\n padding: 0px;\n }\n p {\n margin-bottom: 0px;\n }\n`;\n\nconst CloseButton = styled.div`\n position: absolute;\n top: 2px;\n right: 2px;\n color: white;\n z-index: 22;\n font-size: 1.1rem;\n`;\n","import { ISpell } from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../../constants/uiColors';\nimport { uiFonts } from '../../../constants/uiFonts';\nimport { formatSpellCastingType } from '../../../libs/CastingTypeHelper';\n\ninterface ISpellInfoProps {\n spell: ISpell;\n}\n\nexport const SpellInfo: React.FC<ISpellInfoProps> = ({ spell }) => {\n const {\n magicWords,\n name,\n manaCost,\n requiredItem,\n description,\n castingType,\n cooldown,\n maxDistanceGrid,\n } = spell;\n return (\n <Container>\n <Header>\n <div>\n <Title>{name}</Title>\n <Type>{magicWords}</Type>\n </div>\n </Header>\n <Statistic>\n <div className=\"label\">Casting Type:</div>\n <div className=\"value\">{formatSpellCastingType(castingType)}</div>\n </Statistic>\n <Statistic>\n <div className=\"label\">Magic words:</div>\n <div className=\"value\">{magicWords}</div>\n </Statistic>\n <Statistic>\n <div className=\"label\">Mana cost:</div>\n <div className=\"value\">{manaCost}</div>\n </Statistic>\n <Statistic>\n <div className=\"label\">Cooldown:</div>\n <div className=\"value\">{cooldown}</div>\n </Statistic>\n {maxDistanceGrid && (\n <Statistic>\n <div className=\"label\">Max Distance Grid:</div>\n <div className=\"value\">{maxDistanceGrid}</div>\n </Statistic>\n )}\n <Statistic>\n {requiredItem && (\n <>\n <div className=\"label\">Required Item:</div>\n <div className=\"value\">{requiredItem}</div>\n </>\n )}\n </Statistic>\n <Description>{description}</Description>\n </Container>\n );\n};\n\nconst Container = styled.div`\n color: white;\n background-color: #222;\n border-radius: 5px;\n padding: 0.5rem;\n font-size: ${uiFonts.size.small};\n border: 3px solid ${uiColors.lightGray};\n height: max-content;\n width: 30rem;\n\n @media (max-width: 580px) {\n width: 80vw;\n }\n`;\n\nconst Title = styled.div`\n font-size: ${uiFonts.size.medium};\n font-weight: bold;\n margin-bottom: 0.5rem;\n display: flex;\n align-items: center;\n margin: 0;\n`;\n\nconst Type = styled.div`\n font-size: ${uiFonts.size.small};\n margin-top: 0.2rem;\n color: ${uiColors.lightGray};\n`;\n\nconst Description = styled.div`\n margin-top: 1.5rem;\n font-size: ${uiFonts.size.small};\n color: ${uiColors.lightGray};\n font-style: italic;\n`;\n\nconst Header = styled.div`\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-bottom: 0.5rem;\n`;\n\nconst Statistic = styled.div`\n margin-bottom: 0.4rem;\n width: max-content;\n\n .label {\n display: inline-block;\n margin-right: 0.5rem;\n color: inherit;\n }\n\n .value {\n display: inline-block;\n color: inherit;\n }\n\n &.better,\n .better {\n color: ${uiColors.lightGreen};\n }\n\n &.worse,\n .worse {\n color: ${uiColors.cardinal};\n }\n`;\n","export const formatSpellCastingType = (castingType: string): string => {\n const formattedCastingType = castingType\n .split(\"-\")\n .map(word => word.charAt(0).toUpperCase() + word.slice(1))\n .join(\" \");\n \n return formattedCastingType;\n };","import { ISpell } from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { SpellInfo } from './SpellInfo';\n\nexport interface ISpellInfoDisplayProps {\n spell: ISpell;\n isMobile?: boolean;\n}\n\nexport const SpellInfoDisplay: React.FC<ISpellInfoDisplayProps> = ({\n spell,\n isMobile,\n}) => {\n return (\n <Flex $isMobile={isMobile}>\n <SpellInfo spell={spell} />\n </Flex>\n );\n};\n\nconst Flex = styled.div<{ $isMobile?: boolean }>`\n display: flex;\n gap: 0.5rem;\n flex-direction: ${({ $isMobile }) => ($isMobile ? 'row-reverse' : 'row')};\n\n @media (max-width: 580px) {\n flex-direction: column-reverse;\n align-items: center;\n }\n`;\n","import { ISpell } from '@rpg-engine/shared';\nimport React, { useRef } from 'react';\nimport styled from 'styled-components';\nimport ModalPortal from '../../Abstractions/ModalPortal';\nimport { SpellInfoDisplay } from './SpellInfoDisplay';\n\ninterface IListMenuOption {\n id: string;\n text: string;\n}\n\nexport interface MobileSpellTooltipProps {\n spell: ISpell;\n closeTooltip: () => void;\n scale?: number;\n options?: IListMenuOption[];\n onSelected?: (selectedOptionId: string) => void;\n}\n\nexport const MobileSpellTooltip: React.FC<MobileSpellTooltipProps> = ({\n spell,\n closeTooltip,\n scale = 1,\n options,\n onSelected,\n}) => {\n const ref = useRef<HTMLDivElement>(null);\n\n const handleFadeOut = () => {\n ref.current?.classList.add('fadeOut');\n };\n\n return (\n <ModalPortal>\n <Container\n ref={ref}\n onTouchEnd={() => {\n handleFadeOut();\n setTimeout(() => {\n closeTooltip();\n }, 100);\n }}\n scale={scale}\n >\n <SpellInfoDisplay spell={spell} isMobile />\n <OptionsContainer>\n {options?.map(option => (\n <Option\n key={option.id}\n onTouchEnd={() => {\n handleFadeOut();\n setTimeout(() => {\n onSelected?.(option.id);\n closeTooltip();\n }, 100);\n }}\n >\n {option.text}\n </Option>\n ))}\n </OptionsContainer>\n </Container>\n </ModalPortal>\n );\n};\n\nconst Container = styled.div<{ scale: number }>`\n position: absolute;\n z-index: 100;\n left: 0;\n top: 0;\n width: 100vw;\n height: 100vh;\n background-color: rgba(0 0 0 / 0.5);\n display: flex;\n justify-content: center;\n align-items: center;\n gap: 0.5rem;\n transition: opacity 0.08s;\n animation: fadeIn 0.1s forwards;\n\n @keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 0.92;\n }\n }\n\n @keyframes fadeOut {\n 0% {\n opacity: 0.92;\n }\n 100% {\n opacity: 0;\n }\n }\n\n &.fadeOut {\n animation: fadeOut 0.1s forwards;\n }\n\n @media (max-width: 580px) {\n flex-direction: column;\n }\n`;\n\nconst OptionsContainer = styled.div`\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n flex-wrap: wrap;\n\n @media (max-width: 580px) {\n flex-direction: row;\n justify-content: center;\n }\n`;\n\nconst Option = styled.button`\n padding: 1rem;\n background-color: #333;\n color: white;\n border: none;\n border-radius: 3px;\n width: 8rem;\n transition: background-color 0.1s;\n\n &:hover {\n background-color: #555;\n }\n\n @media (max-width: 580px) {\n padding: 1rem 0.5rem;\n }\n`;\n","import { ISpell } from '@rpg-engine/shared';\nimport React, { useEffect, useRef } from 'react';\nimport styled from 'styled-components';\nimport ModalPortal from '../../Abstractions/ModalPortal';\nimport { SpellInfoDisplay } from './SpellInfoDisplay';\n\nexport interface IMagicTooltipProps {\n spell: ISpell;\n}\n\nconst offset = 20;\n\nexport const MagicTooltip: React.FC<IMagicTooltipProps> = ({ spell }) => {\n const ref = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const { current } = ref;\n\n if (current) {\n const handleMouseMove = (event: MouseEvent) => {\n const { clientX, clientY } = event;\n\n // Adjust the position of the tooltip based on the mouse position\n const rect = current.getBoundingClientRect();\n\n const tooltipWidth = rect.width;\n const tooltipHeight = rect.height;\n const isOffScreenRight =\n clientX + tooltipWidth + offset > window.innerWidth;\n const isOffScreenBottom =\n clientY + tooltipHeight + offset > window.innerHeight;\n const x = isOffScreenRight\n ? clientX - tooltipWidth - offset\n : clientX + offset;\n const y = isOffScreenBottom\n ? clientY - tooltipHeight - offset\n : clientY + offset;\n\n current.style.transform = `translate(${x}px, ${y}px)`;\n current.style.opacity = '1';\n };\n\n window.addEventListener('mousemove', handleMouseMove);\n\n return () => {\n window.removeEventListener('mousemove', handleMouseMove);\n };\n }\n\n return;\n }, []);\n\n return (\n <ModalPortal>\n <Container ref={ref}>\n <SpellInfoDisplay spell={spell} />\n </Container>\n </ModalPortal>\n );\n};\n\nconst Container = styled.div`\n position: absolute;\n z-index: 100;\n pointer-events: none;\n left: 0;\n top: 0;\n opacity: 0;\n transition: opacity 0.08s;\n`;\n","import { ISpell } from '@rpg-engine/shared';\nimport React, { useRef, useState } from 'react';\nimport { MobileSpellTooltip } from './MobileSpellTooltip';\nimport { MagicTooltip } from './SpellTooltip';\n\ninterface ISpellInfoWrapperProps {\n spell: ISpell;\n children: React.ReactNode;\n scale?: number;\n holdTouchDuration?: number; // New prop for hold touch duration\n}\n\nexport const SpellInfoWrapper: React.FC<ISpellInfoWrapperProps> = ({\n children,\n spell,\n scale,\n holdTouchDuration = 500, // Default hold duration to 500ms\n}) => {\n const [isTooltipVisible, setIsTooltipVisible] = useState(false);\n const [isTooltipMobileVisible, setIsTooltipMobileVisible] = useState(false);\n const touchTimeoutRef = useRef<NodeJS.Timeout | null>(null);\n\n const handleTouchStart = () => {\n touchTimeoutRef.current = setTimeout(() => {\n setIsTooltipMobileVisible(true);\n setIsTooltipVisible(false);\n }, holdTouchDuration);\n };\n\n const handleTouchEnd = () => {\n if (touchTimeoutRef.current) {\n clearTimeout(touchTimeoutRef.current);\n touchTimeoutRef.current = null;\n }\n };\n\n return (\n <div\n onMouseEnter={() => {\n if (!isTooltipMobileVisible) setIsTooltipVisible(true);\n }}\n onMouseLeave={setIsTooltipVisible.bind(null, false)}\n onTouchStart={handleTouchStart}\n onTouchEnd={handleTouchEnd}\n >\n {children}\n\n {isTooltipVisible && !isTooltipMobileVisible && (\n <MagicTooltip spell={spell} />\n )}\n {isTooltipMobileVisible && (\n <MobileSpellTooltip\n closeTooltip={() => {\n setIsTooltipMobileVisible(false);\n console.log('close');\n }}\n spell={spell}\n scale={scale}\n />\n )}\n </div>\n );\n};","import { ISpell } from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\nimport { uiFonts } from '../../constants/uiFonts';\nimport { SpriteFromAtlas } from '../shared/SpriteFromAtlas';\nimport { SpellInfoWrapper } from './cards/SpellInfoWrapper';\n\nexport interface ISpellProps {\n atlasJSON: any;\n atlasIMG: any;\n charMana: number;\n charMagicLevel: number;\n onPointerUp?: (spellKey: string) => void;\n isSettingShortcut?: boolean;\n spellKey: string;\n spell: ISpell;\n activeCooldown?: number;\n}\n\nexport const Spell: React.FC<ISpellProps> = ({\n atlasIMG,\n atlasJSON,\n spellKey,\n charMana,\n charMagicLevel,\n onPointerUp,\n isSettingShortcut,\n spell,\n activeCooldown,\n}) => {\n const {\n manaCost,\n minMagicLevelRequired,\n magicWords,\n name,\n description,\n } = spell;\n const disabled = isSettingShortcut\n ? charMagicLevel < minMagicLevelRequired\n : manaCost > charMana || charMagicLevel < minMagicLevelRequired;\n\n const CONTAINER_STYLE = { width: '32px', height: '32px' };\n const IMAGE_SCALE = 2;\n\n return (\n <SpellInfoWrapper spell={spell}>\n <Container\n onPointerUp={onPointerUp?.bind(null, spellKey)}\n isSettingShortcut={isSettingShortcut && !disabled}\n className=\"spell\"\n >\n {disabled && (\n <Overlay>\n {charMagicLevel < minMagicLevelRequired\n ? 'Low magic level'\n : manaCost > charMana && 'No mana'}\n </Overlay>\n )}\n <SpellImage>\n {activeCooldown && activeCooldown > 0 ? (\n <span className=\"cooldown\">\n {activeCooldown.toFixed(activeCooldown > 10 ? 0 : 1)}\n </span>\n ) : null}\n <SpriteFromAtlas\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={spell.texturePath ?? ''}\n imgScale={IMAGE_SCALE}\n containerStyle={CONTAINER_STYLE}\n centered\n />\n </SpellImage>\n <Info>\n <Title>\n <span>{name}</span>\n <span className=\"spell\">({magicWords})</span>\n </Title>\n <Description>{description}</Description>\n </Info>\n\n <Divider />\n <Cost>\n <span>Mana cost:</span>\n <span className=\"mana\">{manaCost}</span>\n </Cost>\n </Container>\n </SpellInfoWrapper>\n );\n};\n\nconst Container = styled.button<{ isSettingShortcut?: boolean }>`\n display: block;\n background: none;\n border: 2px solid transparent;\n border-radius: 1rem;\n width: 100%;\n display: flex;\n\n gap: 1rem;\n align-items: center;\n padding: 0 1rem;\n text-align: left;\n position: relative;\n\n animation: ${({ isSettingShortcut }) =>\n isSettingShortcut ? 'border-color-change 1s infinite' : 'none'};\n\n @keyframes border-color-change {\n 0% {\n border-color: ${uiColors.yellow};\n }\n 50% {\n border-color: transparent;\n }\n 100% {\n border-color: ${uiColors.yellow};\n }\n }\n\n &:hover,\n &:focus {\n background-color: ${uiColors.darkGray};\n }\n\n &:active {\n background: none;\n }\n`;\n\nconst SpellImage = styled.div`\n width: 4rem;\n height: 4rem;\n font-size: ${uiFonts.size.xLarge};\n font-weight: bold;\n background-color: ${uiColors.darkGray};\n color: ${uiColors.lightGray};\n display: flex;\n justify-content: center;\n align-items: center;\n text-transform: uppercase;\n position: relative;\n overflow: hidden;\n\n .cooldown {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0 0 0 / 20%);\n color: ${uiColors.darkYellow};\n font-weight: bold;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n`;\n\nconst Info = styled.span`\n width: 0;\n flex: 1;\n\n @media (orientation: portrait) {\n display: none;\n }\n`;\nconst Title = styled.p`\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n margin-bottom: 5px;\n margin: 0;\n\n span {\n font-size: ${uiFonts.size.medium} !important;\n font-weight: bold !important;\n color: ${uiColors.yellow} !important;\n margin-right: 0.5rem;\n }\n\n .spell {\n font-size: ${uiFonts.size.small} !important;\n font-weight: normal !important;\n color: ${uiColors.lightGray} !important;\n }\n`;\n\nconst Description = styled.div`\n font-size: ${uiFonts.size.small} !important;\n line-height: 1.1 !important;\n`;\n\nconst Divider = styled.div`\n width: 1px;\n height: 100%;\n margin: 0 1rem;\n background-color: ${uiColors.lightGray};\n`;\n\nconst Cost = styled.p`\n display: flex;\n align-items: center;\n flex-direction: column;\n gap: 0.5rem;\n\n div {\n z-index: 1;\n }\n\n .mana {\n position: relative;\n font-size: ${uiFonts.size.medium};\n font-weight: bold;\n z-index: 1;\n\n &::after {\n position: absolute;\n content: '';\n top: 0;\n left: 0;\n background-color: ${uiColors.blue};\n width: 100%;\n height: 100%;\n border-radius: 50%;\n transform: scale(1.8);\n filter: blur(10px);\n z-index: -1;\n }\n }\n`;\n\nconst Overlay = styled.p`\n margin: 0 !important;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n border-radius: 1rem;\n display: flex;\n justify-content: center;\n align-items: center;\n color: ${uiColors.yellow};\n font-size: ${uiFonts.size.large} !important;\n font-weight: bold;\n z-index: 10;\n background-color: rgba(0 0 0 / 0.2);\n`;\n","import { IShortcut, ISpell } from '@rpg-engine/shared';\nimport React, { Fragment, useMemo, useState } from 'react';\nimport styled from 'styled-components';\nimport { uiFonts } from '../../constants/uiFonts';\nimport { DraggableContainer } from '../DraggableContainer';\nimport { Input } from '../Input';\nimport { RPGUIContainerTypes } from '../RPGUI/RPGUIContainer';\nimport { ShortcutsSetter } from '../Shortcuts/ShortcutsSetter';\nimport { Spell } from './Spell';\n\nexport interface ISpellbookProps {\n onClose?: () => void;\n onInputFocus?: () => void;\n onInputBlur?: () => void;\n spells: ISpell[];\n magicLevel: number;\n mana: number;\n onSpellClick: (spellKey: string) => void;\n setSpellShortcut: (key: string, index: number) => void;\n shortcuts: IShortcut[];\n removeShortcut: (index: number) => void;\n atlasIMG: any;\n atlasJSON: any;\n iconAtlasIMG?: any;\n iconAtlasJSON?: any;\n scale?: number;\n spellCooldowns?: Record<string, number>;\n}\n\nexport const Spellbook: React.FC<ISpellbookProps> = ({\n onClose,\n onInputFocus,\n onInputBlur,\n spells,\n magicLevel,\n mana,\n onSpellClick,\n setSpellShortcut,\n shortcuts,\n removeShortcut,\n atlasIMG,\n atlasJSON,\n iconAtlasIMG,\n iconAtlasJSON,\n scale,\n spellCooldowns,\n}) => {\n const [search, setSearch] = useState('');\n const [settingShortcutIndex, setSettingShortcutIndex] = useState(-1);\n\n const spellsToDisplay = useMemo(() => {\n return spells\n .sort((a, b) => {\n if (a.minMagicLevelRequired > b.minMagicLevelRequired) return 1;\n if (a.minMagicLevelRequired < b.minMagicLevelRequired) return -1;\n return 0;\n })\n .filter(\n spell =>\n spell.name.toLocaleLowerCase().includes(search.toLocaleLowerCase()) ||\n spell.magicWords\n .toLocaleLowerCase()\n .includes(search.toLocaleLowerCase())\n );\n }, [search, spells]);\n\n const setShortcut = (spellKey: string) => {\n setSpellShortcut?.(spellKey, settingShortcutIndex);\n setSettingShortcutIndex(-1);\n };\n\n return (\n <DraggableContainer\n type={RPGUIContainerTypes.Framed}\n onCloseButton={onClose}\n width=\"inherit\"\n height=\"inherit\"\n cancelDrag=\"#spellbook-search, #shortcuts_list, .spell\"\n scale={scale}\n >\n <Container>\n <Title>Learned Spells</Title>\n\n <ShortcutsSetter\n setSettingShortcutIndex={setSettingShortcutIndex}\n settingShortcutIndex={settingShortcutIndex}\n shortcuts={shortcuts}\n removeShortcut={removeShortcut}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n />\n\n <Input\n placeholder=\"Search for spell\"\n value={search}\n onChange={e => setSearch(e.target.value)}\n onFocus={onInputFocus}\n onBlur={onInputBlur}\n id=\"spellbook-search\"\n />\n\n <SpellList>\n {spellsToDisplay.map(spell => (\n <Fragment key={spell.key}>\n <Spell\n atlasIMG={iconAtlasIMG}\n atlasJSON={iconAtlasJSON}\n charMana={mana}\n charMagicLevel={magicLevel}\n onPointerUp={\n settingShortcutIndex !== -1 ? setShortcut : onSpellClick\n }\n spellKey={spell.key}\n isSettingShortcut={settingShortcutIndex !== -1}\n spell={spell}\n activeCooldown={\n spellCooldowns?.[spell.magicWords.replaceAll(' ', '_')]\n }\n {...spell}\n />\n </Fragment>\n ))}\n </SpellList>\n </Container>\n </DraggableContainer>\n );\n};\n\nconst Title = styled.h1`\n font-size: ${uiFonts.size.large} !important;\n margin-bottom: 0 !important;\n`;\n\nconst Container = styled.div`\n width: 100%;\n height: 100%;\n color: white;\n display: flex;\n flex-direction: column;\n`;\n\nconst SpellList = styled.div`\n width: 100%;\n min-height: 0;\n flex: 1;\n overflow-y: auto;\n display: flex;\n flex-direction: column;\n gap: 1.5rem;\n margin-top: 1rem;\n`;\n","import React, { useState } from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../constants/uiColors';\nimport SelectArrow from './Arrow/SelectArrow';\nimport { Button, ButtonTypes } from './Button';\n\ninterface IStep {\n component: React.ReactNode;\n id: number;\n validate?: () => boolean | Promise<boolean>;\n errorMessage?: string;\n}\n\ninterface IStepperProps {\n steps: IStep[];\n finalCTAButton?: {\n label: string;\n onClick: (() => void) | (() => Promise<void>) | ((e: any) => Promise<void>);\n };\n onError?: (message: string) => void;\n useSideArrows?: boolean; // New prop to control arrow position\n styles?: {\n stepperProgressColor?: string;\n };\n}\n\nexport const Stepper: React.FC<IStepperProps> = ({\n steps,\n finalCTAButton,\n onError,\n useSideArrows = false, // Default to false for backwards compatibility\n styles,\n}) => {\n const [currentStep, setCurrentStep] = useState(0);\n\n const currentComponent = steps[currentStep]?.component;\n\n const totalSteps = steps.length;\n\n const onStepChange = async (step: number) => {\n if (steps[currentStep]?.validate) {\n try {\n const isValid = await steps[currentStep].validate!();\n if (!isValid) {\n if (onError) {\n onError(\n steps[currentStep].errorMessage ||\n `Validation failed on step ${currentStep + 1}`\n );\n }\n return;\n }\n } catch (error) {\n if (onError) {\n onError(\n `An error occurred during validation on step ${currentStep + 1}`\n );\n }\n return;\n }\n }\n setCurrentStep(step);\n };\n\n const renderArrows = () => {\n const leftArrow = (\n <SelectArrow\n direction=\"left\"\n onPointerDown={() => onStepChange(Math.max(0, currentStep - 1))}\n />\n );\n\n const rightArrow = (\n <SelectArrow\n direction=\"right\"\n onPointerDown={() =>\n onStepChange(Math.min(totalSteps - 1, currentStep + 1))\n }\n />\n );\n\n if (useSideArrows) {\n return (\n <>\n {currentStep > 0 && <ArrowContainer left>{leftArrow}</ArrowContainer>}\n {currentStep < totalSteps - 1 && (\n <ArrowContainer right>{rightArrow}</ArrowContainer>\n )}\n </>\n );\n } else {\n return (\n <>\n {currentStep > 0 && leftArrow}\n {currentStep < totalSteps - 1 && rightArrow}\n </>\n );\n }\n };\n\n return (\n <StepperContainer className=\"stepper-container\">\n <StepperTop>\n {Array.from({ length: totalSteps }, (_, i) => (\n <ProgressIndicator\n key={i}\n isActive={i <= currentStep}\n stepperProgressColor={styles?.stepperProgressColor}\n onClick={() => onStepChange(i)}\n />\n ))}\n </StepperTop>\n\n <StepperBodyContainer>\n {useSideArrows && renderArrows()}\n <StepperBody>{currentComponent}</StepperBody>\n </StepperBodyContainer>\n\n {(!useSideArrows ||\n (currentStep === totalSteps - 1 && finalCTAButton)) && (\n <StepperFooter>\n {!useSideArrows && renderArrows()}\n {currentStep === totalSteps - 1 && finalCTAButton && (\n <Button\n buttonType={ButtonTypes.RPGUIButton}\n onClick={finalCTAButton.onClick}\n >\n {finalCTAButton.label}\n </Button>\n )}\n </StepperFooter>\n )}\n </StepperContainer>\n );\n};\n\nconst StepperContainer = styled.div`\n display: flex;\n flex-direction: column;\n height: 100%;\n`;\n\nconst StepperTop = styled.div`\n flex: 1;\n display: flex;\n flex-wrap: wrap;\n justify-content: center;\n align-items: center;\n margin-bottom: 1rem;\n`;\n\nconst StepperBodyContainer = styled.div`\n flex: 8;\n display: flex;\n align-items: center;\n position: relative;\n height: 100%; /* Ensure full height */\n`;\n\nconst StepperBody = styled.div`\n flex: 1;\n min-height: 200px; /* Set an appropriate minimum height */\n transition: height 0.3s ease-in-out; /* Smooth height transition */\n`;\n\nconst ArrowContainer = styled.div<{ left?: boolean; right?: boolean }>`\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n ${props => props.left && 'left: -30px;'}\n ${props => props.right && 'right: -30px;'}\n`;\n\nconst StepperFooter = styled.div`\n margin-top: 1rem;\n flex: 1;\n display: flex;\n justify-content: center;\n align-items: center;\n`;\n\nconst ProgressIndicator = styled.div<{\n isActive: boolean;\n stepperProgressColor?: string;\n}>`\n width: 20px;\n height: 20px;\n background-color: ${({ isActive, stepperProgressColor }) =>\n isActive ? stepperProgressColor || uiColors.orange : uiColors.lightGray};\n margin: 0 5px;\n transition: background-color 0.3s;\n opacity: ${({ isActive }) => (isActive ? 1 : 0.25)};\n border: 1px solid ${uiColors.raisinBlack};\n cursor: pointer;\n clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);\n /* Create a diamond shape */\n box-shadow: ${({ isActive }) =>\n isActive\n ? '0 0 0 1px black, 1px 1px 0 1px black, 2px 2px 0 1px black, -1px -1px 0 1px black'\n : '0 0 0 1px black, 1px 1px 0 1px gray, 2px 2px 0 1px gray, -1px -1px 0 1px gray'};\n /* Add pixel art border effect */\n border-radius: 0;\n /* Remove border-radius to make it square */\n`;\n","import React from 'react';\nimport styled from 'styled-components';\n\nimport { PeriodOfDay } from '@rpg-engine/shared';\nimport AfternoonGif from './gif/afternoon.gif';\nimport MorningGif from './gif/morning.gif';\nimport NightGif from './gif/night.gif';\n\nexport interface IPeriodOfDayDisplayProps {\n periodOfDay: PeriodOfDay;\n}\n\nexport const DayNightPeriod: React.FC<IPeriodOfDayDisplayProps> = ({\n periodOfDay,\n}) => {\n const periodOfDaySrcFiles = {\n [PeriodOfDay.Morning]: MorningGif,\n [PeriodOfDay.Afternoon]: AfternoonGif,\n [PeriodOfDay.Night]: NightGif,\n };\n\n return (\n <GifContainer>\n <img src={periodOfDaySrcFiles[periodOfDay]} />\n </GifContainer>\n );\n};\n\nconst GifContainer = styled.div`\n width: 100%;\n\n img {\n width: 67%;\n }\n`;\n","import { PeriodOfDay } from '@rpg-engine/shared';\nimport React from 'react';\nimport Draggable from 'react-draggable';\nimport styled from 'styled-components';\nimport { uiFonts } from '../../constants/uiFonts';\nimport { DayNightPeriod } from './DayNightPeriod/DayNightPeriod';\n\nimport ClockWidgetImg from './img/clockwidget.png';\n\nexport interface IClockWidgetProps {\n onClose?: () => void;\n TimeClock: string;\n periodOfDay: PeriodOfDay;\n scale?: number;\n}\n\nexport const TimeWidget: React.FC<IClockWidgetProps> = ({\n onClose,\n TimeClock,\n periodOfDay,\n scale,\n}) => {\n return (\n <Draggable\n scale={scale}\n cancel=\".time-widget-close,.time-widget-container,.time-widget-container *\"\n >\n <WidgetContainer>\n <CloseButton onPointerDown={onClose} className=\"time-widget-close\">\n X\n </CloseButton>\n <DayNightContainer className=\"time-widget-container\">\n <DayNightPeriod periodOfDay={periodOfDay} />\n </DayNightContainer>\n <Time>{TimeClock}</Time>\n </WidgetContainer>\n </Draggable>\n );\n};\n\nconst WidgetContainer = styled.div`\n background-image: url(${ClockWidgetImg});\n background-size: 10rem;\n background-repeat: no-repeat;\n width: 10rem;\n position: absolute;\n height: 100px;\n`;\n\nconst Time = styled.div`\n top: 0.75rem;\n right: 0.5rem;\n position: absolute;\n font-size: ${uiFonts.size.small};\n color: white;\n`;\n\nconst CloseButton = styled.p`\n position: absolute;\n top: -0.5rem;\n margin: 0;\n right: -0.2rem;\n font-size: ${uiFonts.size.small} !important;\n z-index: 1;\n`;\n\nconst DayNightContainer = styled.div`\n margin-top: -0.3rem;\n margin-left: -0.3rem;\n`;\n","import { UserAccountTypes } from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\n\ninterface IPremiumLabelProps {\n accountType: UserAccountTypes;\n}\n\nconst PremiumLabel: React.FC<IPremiumLabelProps> = ({ accountType }) => {\n if (accountType === UserAccountTypes.Free) return null;\n\n const getBackgroundColor = () => {\n switch (accountType) {\n case UserAccountTypes.PremiumBronze:\n return '#CD7F32';\n case UserAccountTypes.PremiumSilver:\n return '#C0C0C0';\n case UserAccountTypes.PremiumGold:\n return '#FFD700';\n case UserAccountTypes.PremiumUltimate:\n return '#002E99';\n default:\n return 'transparent';\n }\n };\n\n const getShortLabel = () => {\n switch (accountType) {\n case UserAccountTypes.PremiumBronze:\n return 'Bronze PA';\n case UserAccountTypes.PremiumSilver:\n return 'Silver PA';\n case UserAccountTypes.PremiumGold:\n return 'Gold PA';\n case UserAccountTypes.PremiumUltimate:\n return 'Ultimate PA';\n default:\n return '';\n }\n };\n\n return (\n <StyledLabel backgroundColor={getBackgroundColor()}>\n {getShortLabel()}\n </StyledLabel>\n );\n};\n\nconst StyledLabel = styled.span<{ backgroundColor: string }>`\n background-color: ${({ backgroundColor }) => backgroundColor};\n color: ${({ backgroundColor }) =>\n backgroundColor === '#002E99' ? 'white' : 'black'};\n font-weight: bold;\n padding: 0 0.4rem;\n border-radius: 3px;\n margin-right: 3px;\n margin-bottom: 2px;\n display: inline-block;\n font-size: 0.5rem !important;\n`;\n\nexport default PremiumLabel;\n","import {\n getItemTextureKeyPath,\n IEquipmentSet,\n ITradeResponseItem,\n} from '@rpg-engine/shared';\nimport capitalize from 'lodash/capitalize';\nimport React, { useEffect, useState } from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\nimport { uiFonts } from '../../constants/uiFonts';\nimport SelectArrow from '../Arrow/SelectArrow';\nimport { ItemInfoWrapper } from '../Item/Cards/ItemInfoWrapper';\nimport { Ellipsis } from '../shared/Ellipsis';\nimport { SpriteFromAtlas } from '../shared/SpriteFromAtlas';\nimport PremiumLabel from './PremiumLabel';\n\nexport interface ITradeComponentProps {\n traderItem: ITradeResponseItem;\n onQuantityChange: (\n traderItem: ITradeResponseItem,\n selectedQty: number\n ) => void;\n atlasJSON: any;\n atlasIMG: any;\n selectedQty: number;\n equipmentSet?: IEquipmentSet | null;\n scale?: number;\n isBuy?: boolean;\n}\n\nconst outerQty = 10;\n\nexport const TradingItemRow: React.FC<ITradeComponentProps> = ({\n atlasIMG,\n atlasJSON,\n onQuantityChange,\n traderItem,\n selectedQty,\n equipmentSet,\n scale,\n isBuy,\n}) => {\n const [inputQty, setInputQty] = useState(selectedQty.toString());\n\n useEffect(() => {\n setInputQty(selectedQty.toString());\n }, [selectedQty]);\n\n const handleQuantityChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const newQty = parseInt(e.target.value, 10);\n if (!isNaN(newQty)) {\n setInputQty(e.target.value);\n onQuantityChange(\n traderItem,\n Math.max(0, Math.min(newQty, traderItem.stackQty ?? 999))\n );\n }\n };\n\n const handleBlur = () => {\n const newQty = parseInt(inputQty, 10);\n if (isNaN(newQty)) {\n setInputQty(selectedQty.toString());\n }\n };\n\n const onLeftClick = (qty = 1) => {\n onQuantityChange(traderItem, Math.max(0, selectedQty - qty));\n };\n\n const onRightClick = (qty = 1) => {\n onQuantityChange(\n traderItem,\n Math.min(traderItem.stackQty ?? 999, selectedQty + qty)\n );\n };\n\n const renderAccountTypeIndicator = () => {\n if (isBuy && traderItem.canBePurchasedOnlyByPremiumPlans) {\n return traderItem.canBePurchasedOnlyByPremiumPlans.map(accountType => (\n <PremiumLabel key={accountType} accountType={accountType} />\n ));\n }\n return null;\n };\n\n return (\n <ItemWrapper>\n <ItemIconContainer>\n <SpriteContainer>\n <ItemInfoWrapper\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n equipmentSet={equipmentSet}\n item={traderItem}\n scale={scale}\n >\n <SpriteFromAtlas\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={getItemTextureKeyPath(\n {\n key: traderItem.key,\n stackQty: traderItem.stackQty || 1,\n texturePath: traderItem.texturePath,\n isStackable: traderItem.isStackable,\n },\n atlasJSON\n )}\n imgScale={2}\n />\n </ItemInfoWrapper>\n </SpriteContainer>\n </ItemIconContainer>\n\n <ItemNameContainer>\n <NameValue>\n <p>\n <Ellipsis maxLines={1} maxWidth=\"180px\">\n {capitalize(traderItem.name)}\n </Ellipsis>\n </p>\n <p>${traderItem.price}</p>\n <p>{renderAccountTypeIndicator()}</p>\n </NameValue>\n </ItemNameContainer>\n <QuantityContainer>\n <SelectArrow\n size={24}\n className=\"arrow-selector\"\n direction=\"left\"\n onPointerDown={() => onLeftClick(outerQty)}\n scale={0.7}\n />\n <StyledArrow\n size={24}\n className=\"arrow-selector\"\n direction=\"left\"\n onPointerDown={() => onLeftClick()}\n />\n <QuantityInput\n type=\"text\"\n value={inputQty}\n onChange={handleQuantityChange}\n onBlur={handleBlur}\n />\n <StyledArrow\n size={24}\n className=\"arrow-selector\"\n direction=\"right\"\n onPointerDown={() => onRightClick()}\n />\n <SelectArrow\n size={24}\n className=\"arrow-selector\"\n direction=\"right\"\n onPointerDown={() => onRightClick(outerQty)}\n scale={0.7}\n />\n </QuantityContainer>\n </ItemWrapper>\n );\n};\n\nconst StyledArrow = styled(SelectArrow)`\n margin: 0 1.5rem;\n`;\n\nconst ItemWrapper = styled.div`\n width: 100%;\n display: flex;\n justify-content: space-between;\n margin-bottom: 0.5rem;\n padding: 0.25rem;\n\n &:hover {\n background-color: ${uiColors.darkGray};\n }\n`;\n\nconst ItemNameContainer = styled.div`\n flex: 60%;\n display: flex;\n align-items: center;\n`;\n\nconst ItemIconContainer = styled.div`\n display: flex;\n justify-content: flex-start;\n align-items: center;\n flex: 0 0 40px;\n`;\n\nconst SpriteContainer = styled.div`\n position: relative;\n top: -0.5rem;\n left: 0;\n`;\n\nconst NameValue = styled.div`\n p {\n font-size: 0.6rem;\n margin: 0;\n line-height: 1.2;\n }\n`;\n\nconst QuantityContainer = styled.div`\n display: flex;\n min-width: 90px;\n width: 40%;\n justify-content: flex-end;\n align-items: center;\n flex: 30%;\n gap: 2px;\n position: relative;\n`;\n\nconst QuantityInput = styled.input`\n width: 30px;\n text-align: center;\n background-color: ${uiColors.darkGray};\n color: white;\n border: none;\n padding: 1px;\n font-size: ${uiFonts.size.small};\n position: relative;\n right: 4px;\n`;\n","import {\n IEquipmentSet,\n ITradeRequestItem,\n ITradeResponseItem,\n TradeTransactionType,\n} from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { Button, ButtonTypes } from '../Button';\nimport { DraggableContainer } from '../DraggableContainer';\nimport { RPGUIContainerTypes } from '../RPGUI/RPGUIContainer';\nimport { TradingItemRow } from './TradingItemRow';\nimport { useTradingGold } from './useTradingGold';\n\nexport interface ITradingMenu {\n traderItems: ITradeResponseItem[];\n onClose: () => void;\n onConfirm: (items: ITradeRequestItem[]) => void;\n type: TradeTransactionType;\n atlasJSON: any;\n atlasIMG: any;\n characterAvailableGold: number;\n equipmentSet?: IEquipmentSet | null;\n scale?: number;\n}\n\nexport const TradingMenu: React.FC<ITradingMenu> = ({\n traderItems,\n onClose,\n type,\n atlasJSON,\n atlasIMG,\n characterAvailableGold,\n onConfirm,\n equipmentSet,\n scale,\n}) => {\n const {\n sum,\n qtyMap,\n isBuy,\n hasGoldForSale,\n getFinalGold,\n getTradeItems,\n updateQuantity,\n } = useTradingGold({ characterAvailableGold, type, traderItems });\n\n return (\n <DraggableContainer\n type={RPGUIContainerTypes.Framed}\n onCloseButton={onClose}\n width=\"500px\"\n cancelDrag=\"#TraderContainer\"\n scale={scale}\n >\n <Container>\n <Title>{type.charAt(0).toUpperCase() + type.slice(1)} Menu</Title>\n <hr className=\"golden\" />\n\n <ScrollWrapper id=\"TraderContainer\">\n {traderItems.map((tradeItem, index) => (\n <TradingItemRow\n key={`${tradeItem.key}_${index}`}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n onQuantityChange={updateQuantity}\n traderItem={tradeItem}\n selectedQty={qtyMap.get(tradeItem.key) ?? 0}\n equipmentSet={equipmentSet}\n scale={scale}\n isBuy={isBuy()}\n />\n ))}\n </ScrollWrapper>\n\n <InfoSection>\n <GoldInfo>\n <p>Available Gold:</p>\n <p>${characterAvailableGold.toFixed(2)}</p>\n </GoldInfo>\n <GoldInfo>\n <p>Total:</p>\n <p>${sum}</p>\n </GoldInfo>\n {!hasGoldForSale() ? (\n <AlertText>Sorry, not enough money.</AlertText>\n ) : (\n <GoldInfo>\n <p>Final Gold:</p>\n <p>${getFinalGold().toFixed(2)}</p>\n </GoldInfo>\n )}\n </InfoSection>\n\n <ButtonWrapper>\n <Button\n buttonType={ButtonTypes.RPGUIButton}\n disabled={!hasGoldForSale()}\n onPointerDown={() => onConfirm(getTradeItems())}\n >\n Confirm\n </Button>\n <Button buttonType={ButtonTypes.RPGUIButton} onPointerDown={onClose}>\n Cancel\n </Button>\n </ButtonWrapper>\n </Container>\n </DraggableContainer>\n );\n};\n\nconst Container = styled.div`\n width: 100%;\n`;\n\nconst Title = styled.h1`\n font-size: 0.7rem !important;\n color: yellow !important;\n text-align: center;\n`;\n\nconst ScrollWrapper = styled.div`\n overflow-y: scroll;\n height: 250px;\n width: 100%;\n margin-top: 0.3rem;\n overflow-x: hidden;\n padding: 0 0.3rem;\n`;\n\nconst InfoSection = styled.div`\n margin-top: 0.3rem;\n padding: 0 0.5rem;\n`;\n\nconst GoldInfo = styled.div`\n display: flex;\n justify-content: space-between;\n height: 16px;\n width: 100%;\n margin: 0.5rem 0;\n p {\n color: yellow !important;\n margin: 0;\n font-size: 0.6rem;\n }\n`;\n\nconst AlertText = styled.p`\n color: red !important;\n text-align: center;\n margin: 0.3rem 0;\n font-size: 0.5rem;\n`;\n\nconst ButtonWrapper = styled.div`\n display: flex;\n justify-content: space-around;\n width: 100%;\n margin-top: 1rem;\n`;\n","/* eslint-disable react/require-default-props */\nimport React from 'react';\nimport styled from 'styled-components';\n\ninterface IProps {\n maxLines?: number;\n children: React.ReactNode;\n}\n\nexport const Truncate: React.FC<IProps> = ({ maxLines = 1, children }) => {\n return <Container maxLines={maxLines}>{children}</Container>;\n};\n\ninterface IContainerProps {\n maxLines: number;\n}\n\nconst Container = styled.div<IContainerProps>`\n display: -webkit-box;\n max-width: 100%;\n max-height: 100%;\n -webkit-line-clamp: ${props => props.maxLines};\n -webkit-box-orient: vertical;\n overflow: hidden;\n`;\n","import React, { useState } from 'react';\n\nexport const ZoomableImage: React.FC<{ src: string; alt: string }> = ({\n src,\n alt,\n}) => {\n const [isZoomed, setIsZoomed] = useState(false);\n const [zoomPosition, setZoomPosition] = useState({ x: 50, y: 50 });\n\n const handleMouseMove = (\n e: React.MouseEvent<HTMLImageElement, MouseEvent>\n ) => {\n const {\n left,\n top,\n width,\n height,\n } = e.currentTarget.getBoundingClientRect();\n const x = ((e.clientX - left) / width) * 100;\n const y = ((e.clientY - top) / height) * 100;\n setZoomPosition({ x, y });\n };\n\n const handleTouchMove = (e: React.TouchEvent<HTMLImageElement>) => {\n const {\n left,\n top,\n width,\n height,\n } = e.currentTarget.getBoundingClientRect();\n const touch = e.touches[0];\n const x = ((touch.clientX - left) / width) * 100;\n const y = ((touch.clientY - top) / height) * 100;\n setZoomPosition({ x, y });\n };\n\n const handleZoomToggle = () => {\n setIsZoomed(!isZoomed);\n };\n\n return (\n <img\n src={src}\n alt={alt}\n onMouseMove={handleMouseMove}\n onTouchMove={handleTouchMove}\n onClick={handleZoomToggle} // Toggle zoom on click/tap\n style={{\n width: '100%',\n height: '100%',\n objectFit: 'cover',\n transform: isZoomed ? 'scale(1.5)' : 'scale(1)',\n transformOrigin: `${zoomPosition.x}% ${zoomPosition.y}%`,\n transition: 'transform 0.3s ease',\n cursor: 'pointer', // Indicate interactivity\n }}\n />\n );\n};\n","import React, { useMemo } from 'react';\nimport styled, { CSSProperties } from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\nimport { ZoomableImage } from '../Image/ZoomableImage';\nimport { Stepper } from '../Stepper';\nimport { DynamicText } from '../typography/DynamicText';\n\nexport interface ITutorialLesson {\n title: string;\n body?: React.ReactNode | string;\n text?: string;\n image: string;\n imageUrl?: string;\n}\n\nexport interface ITutorialStepperProps {\n lessons: ITutorialLesson[];\n onLessonFinish: () => void;\n imageStyle?: CSSProperties;\n}\n\nexport const TutorialStepper = React.memo(\n ({ lessons, onLessonFinish, imageStyle }: ITutorialStepperProps) => {\n const generateLessons = useMemo(\n () =>\n lessons.map((lesson, index) => ({\n component: (\n <LessonContainer key={index} className=\"lesson-container\">\n <LessonTitle className=\"lesson-title\">{lesson.title}</LessonTitle>\n {lesson.image && (\n <LessonImageWrapper className=\"lesson-image-wrapper\">\n <LessonImage className=\"lesson-image\" style={imageStyle}>\n {lesson.imageUrl ? (\n <a\n href={lesson.imageUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n <ZoomableImage\n src={lesson.image}\n alt={lesson.title || 'Tutorial image'}\n />\n </a>\n ) : (\n <ZoomableImage\n src={lesson.image}\n alt={lesson.title || 'Tutorial image'}\n />\n )}\n </LessonImage>\n </LessonImageWrapper>\n )}\n <LessonFooter className=\"lesson-footer\">\n {lesson.body && (\n <LessonBody\n className=\"lesson-body\"\n dangerouslySetInnerHTML={{ __html: lesson.body as string }}\n ></LessonBody>\n )}\n {lesson.text && <DynamicText text={lesson.text} />}\n </LessonFooter>\n </LessonContainer>\n ),\n id: index,\n })),\n [lessons, imageStyle]\n );\n\n return (\n <Container>\n <Stepper\n steps={generateLessons}\n finalCTAButton={{\n label: 'Close',\n onClick: onLessonFinish,\n }}\n useSideArrows\n />\n </Container>\n );\n }\n);\n\nconst LessonImageWrapper = styled.div`\n width: 100%;\n max-width: 500px;\n margin: 1rem auto;\n aspect-ratio: auto; /* Allow the image to define its own aspect ratio */\n border-radius: 10px;\n`;\n\nconst LessonBody = styled.div``;\n\nconst Container = styled.div`\n width: 80%;\n max-width: 600px;\n\n @media (max-width: 600px) {\n width: 95%;\n }\n`;\n\nconst LessonFooter = styled.div`\n margin-top: 1rem;\n`;\n\nconst LessonImage = styled.div`\n display: flex;\n justify-content: center;\n align-items: center;\n width: 100%;\n max-width: 500px;\n margin: auto;\n\n img {\n width: 100%;\n height: auto;\n object-fit: contain; /* Ensures the entire image is visible */\n border-radius: 10px;\n }\n`;\n\nconst LessonTitle = styled.h1`\n color: ${uiColors.yellow} !important;\n font-size: 0.8rem !important;\n`;\n\nconst LessonContainer = styled.div`\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n min-height: 200px; /* Match with StepperBody for consistent height */\n\n p {\n // make font size consistent with rest\n font-size: 0.7rem !important;\n }\n`;\n","import { useEffect, useState } from 'react';\nimport { PrivateChatCharacter } from '../components/ChatRevamp/types';\n\ninterface IUseChat {\n minimizedByDefault: boolean;\n isPrivate: boolean;\n onChangeTab: (tabId: string) => void;\n onPreviousChatCharacterClick?: (character: PrivateChatCharacter) => void;\n hideSearchCharacterUI?: () => void;\n unseenMessageCharacterIds?: string[];\n}\n\nexport const useChat = ({\n minimizedByDefault,\n isPrivate,\n onChangeTab,\n onPreviousChatCharacterClick,\n hideSearchCharacterUI,\n unseenMessageCharacterIds,\n}: IUseChat) => {\n const [showRecentChats, setShowRecentChats] = useState(false);\n const [isExpanded, setIsExpanded] = useState(!minimizedByDefault);\n\n useEffect(() => {\n if (isPrivate) {\n setIsExpanded(true);\n }\n }, [isPrivate]);\n\n const toggleExpand = () => setIsExpanded(prev => !prev);\n\n const toggleRecentChats = () => setShowRecentChats(prev => !prev);\n\n const handleTabChange = (tabId: string) => {\n if (tabId === 'private') {\n setIsExpanded(true);\n }\n onChangeTab(tabId);\n };\n\n const handlePreviousChatCharacterClick = (\n character: PrivateChatCharacter\n ) => {\n if (onPreviousChatCharacterClick) {\n onPreviousChatCharacterClick(character);\n }\n if (hideSearchCharacterUI) {\n hideSearchCharacterUI();\n }\n };\n\n return {\n showRecentChats,\n isExpanded,\n toggleExpand,\n toggleRecentChats,\n handleTabChange,\n handlePreviousChatCharacterClick,\n hasUnseenMessages:\n unseenMessageCharacterIds && unseenMessageCharacterIds?.length > 0,\n };\n};\n","import React, { useEffect, useState } from 'react';\n\nexport interface ICheckItems {\n label: string;\n value: string;\n}\n\nexport interface ICheckProps {\n items: ICheckItems[];\n onChange: (selectedValues: IChecklistSelectedValues) => void;\n}\n\nexport interface IChecklistSelectedValues {\n [label: string]: boolean;\n}\n\nexport const CheckButton: React.FC<ICheckProps> = ({ items, onChange }) => {\n const generateSelectedValuesList = () => {\n const selectedValues: IChecklistSelectedValues = {};\n\n items.forEach(item => {\n selectedValues[item.label] = false;\n });\n\n return selectedValues;\n };\n\n const [selectedValues, setSelectedValues] = useState<\n IChecklistSelectedValues\n >(generateSelectedValuesList());\n\n const handleClick = (label: string) => {\n setSelectedValues({\n ...selectedValues,\n [label]: !selectedValues[label],\n });\n };\n\n useEffect(() => {\n if (selectedValues) {\n onChange(selectedValues);\n }\n }, [selectedValues]);\n\n return (\n <div id=\"elemento-checkbox\">\n {items?.map((element, index) => {\n return (\n <div key={`${element.label}_${index}`}>\n <input\n className=\"rpgui-checkbox\"\n type=\"checkbox\"\n checked={selectedValues[element.label]}\n onChange={() => {}}\n />\n <label onPointerDown={() => handleClick(element.label)}>\n {element.label}\n </label>\n <br />\n </div>\n );\n })}\n </div>\n );\n};\n","import React, { useState } from 'react';\n\nexport interface ICheckItemProps {\n label?: string;\n defaultValue?: boolean;\n onChange: (label: string | undefined, selected: boolean) => void;\n}\n\nexport const CheckItem: React.FC<ICheckItemProps> = ({\n label,\n defaultValue = false,\n onChange,\n}) => {\n const [checked, setChecked] = useState(defaultValue);\n\n const handleClick = () => {\n const newCheckedState = !checked;\n setChecked(newCheckedState);\n onChange(label, newCheckedState);\n };\n\n return (\n <div onPointerDown={handleClick}>\n <input\n className=\"rpgui-checkbox\"\n type=\"checkbox\"\n checked={checked}\n readOnly\n />\n <label>{label}</label>\n <br />\n </div>\n );\n};\n","/* eslint-disable @typescript-eslint/explicit-function-return-type */\n\nimport { useState } from 'react';\n\nexport function useLocalStorage<T>(key: string, initialValue: T) {\n // State to store our value\n // Pass initial state function to useState so logic is only executed once\n const [storedValue, setStoredValue] = useState<T>(() => {\n if (typeof window === 'undefined') {\n return initialValue;\n }\n try {\n // Get from local storage by key\n const item = window.localStorage.getItem(key);\n // Parse stored json or if none return initialValue\n return item ? JSON.parse(item) : initialValue;\n } catch (error) {\n // If error also return initialValue\n console.log(error);\n return initialValue;\n }\n });\n\n // Return a wrapped version of useState's setter function that ...\n // ... persists the new value to localStorage.\n const setValue = (value: T | ((val: T) => T)) => {\n try {\n // Allow value to be a function so we have same API as useState\n const valueToStore =\n value instanceof Function ? value(storedValue) : value;\n // Save state\n setStoredValue(valueToStore);\n // Save to local storage\n if (typeof window !== 'undefined') {\n window.localStorage.setItem(key, JSON.stringify(valueToStore));\n }\n } catch (error) {\n // A more advanced implementation would handle the error case\n console.log(error);\n }\n };\n\n return [storedValue, setValue] as const;\n}\n","import { ICraftableItem, IItem, IItemContainer } from '@rpg-engine/shared';\n\nexport function calculateMaxCraftable(\n recipe: ICraftableItem | undefined,\n inventory: IItemContainer | null | undefined\n): number {\n if (!inventory || !recipe?.ingredients) {\n return 0;\n }\n\n return recipe.ingredients.reduce((maxPossible, ingredient) => {\n const inventoryItem = Object.values(inventory.slots).find(\n (item): item is IItem => item?.key === ingredient.key\n );\n\n if (!inventoryItem) {\n return 0;\n }\n\n const possibleWithThisIngredient = Math.floor(\n inventoryItem.stackQty ?? 0 / ingredient.qty\n );\n\n if (maxPossible === -1) {\n return possibleWithThisIngredient;\n }\n\n return Math.min(maxPossible, possibleWithThisIngredient);\n }, -1);\n}\n","import React, { useEffect, useState } from 'react';\n\nexport interface IRadioItems {\n label: string;\n value: string;\n}\n\nexport interface IRadioProps {\n name: string;\n items: IRadioItems[];\n onChange: (value: string) => void;\n}\n\nexport const InputRadio: React.FC<IRadioProps> = ({\n name,\n items,\n onChange,\n}) => {\n const [selectedValue, setSelectedValue] = useState<string>();\n const handleClick = () => {\n let element = document.querySelector(\n `input[name=${name}]:checked`\n ) as HTMLInputElement;\n const elementValue = element.value;\n setSelectedValue(elementValue);\n };\n\n useEffect(() => {\n if (selectedValue) {\n onChange(selectedValue);\n }\n }, [selectedValue]);\n\n return (\n <div id=\"elemento-radio\">\n {items.map(element => {\n return (\n <>\n <input\n key={element.value}\n className=\"rpgui-radio\"\n value={element.value}\n name={name}\n type=\"radio\"\n />\n <label onPointerDown={handleClick}>{element.label}</label>\n <br />\n </>\n );\n })}\n </div>\n );\n};\n","import React from 'react';\n\nexport interface ITextArea\n extends React.DetailedHTMLProps<\n React.TextareaHTMLAttributes<HTMLTextAreaElement>,\n HTMLTextAreaElement\n > {}\n\nexport const TextArea: React.FC<ITextArea> = ({ ...props }) => {\n return <textarea {...props} />;\n};\n","import {\n ITradeRequestItem,\n ITradeResponseItem,\n TradeTransactionType,\n} from '@rpg-engine/shared';\nimport { useState } from 'react';\n\ninterface ITradingGoldHook {\n characterAvailableGold: number;\n type: TradeTransactionType;\n traderItems: ITradeResponseItem[];\n}\n\nexport const useTradingGold = ({\n characterAvailableGold,\n type,\n traderItems,\n}: ITradingGoldHook) => {\n const [sum, setSum] = useState(0);\n const [qtyMap, setQtyMap] = useState(new Map<string, number>());\n\n const isBuy = () => type === 'buy';\n\n const hasGoldForSale = () =>\n isBuy() ? !(sum > characterAvailableGold) : true;\n\n const getFinalGold = () =>\n isBuy() ? characterAvailableGold - sum : characterAvailableGold + sum;\n\n const getTradeItems = (): ITradeRequestItem[] => {\n const items: ITradeRequestItem[] = [];\n traderItems.forEach(item => {\n const qty = qtyMap.get(item.key);\n if (qty) {\n items.push({\n ...item,\n qty,\n });\n }\n });\n return items;\n };\n\n const updateQuantity = (item: ITradeResponseItem, selectedQty: number) => {\n setQtyMap(new Map(qtyMap.set(item.key, selectedQty)));\n\n let newSum = 0;\n qtyMap.forEach((qty, key) => {\n const item = traderItems.find(i => i.key === key);\n if (item) newSum += qty * item.price;\n });\n setSum(newSum);\n };\n\n return {\n sum,\n qtyMap,\n isBuy,\n hasGoldForSale,\n getFinalGold,\n getTradeItems,\n updateQuantity,\n };\n};\n"],"names":["ButtonTypes","SelectArrow","_ref","direction","_ref$direction","size","_ref$scale","scale","onPointerDown","props","_objectWithoutPropertiesLoose","_excluded","React","LeftArrow","RightArrow","styled","span","withConfig","displayName","componentId","DropdownDisplay","DropdownLabel","label","Container","div","width","DropdownSelect","p","DropdownOptions","ul","opened","opensUp","RPGUIContainerTypes","Button","disabled","_ref$disabled","children","buttonType","ButtonContainer","className","button","SpriteFromAtlas","atlasJSON","spriteKey","_ref$width","_ref$height","height","_ref$imgScale","imgScale","_ref$grayScale","grayScale","_ref$opacity","opacity","spriteData","_atlasJSON$frames","frames","_atlasJSON$frames2","GRID_WIDTH","GRID_HEIGHT","hasHover","style","containerStyle","ImgSprite","imgClassname","atlasIMG","frame","imgStyle","centered","borderRadius","console","error","w","h","x","y","ErrorBoundary","_Component","_this","_len","arguments","length","args","Array","_key","call","apply","concat","state","hasError","getDerivedStateFromError","_","_proto","prototype","componentDidCatch","errorInfo","render","this","Component","Ellipsis","_ref$maxLines","maxLines","maxWidth","fontSize","center","PropertySelect","item","availableProperties","onChange","_useState","useState","currentIndex","setCurrentIndex","propertiesLength","useEffect","JSON","stringify","TextOverlay","Item","name","index","Chat","chatMessages","onSendChatMessage","onCloseButton","onFocus","onBlur","_ref$styles","styles","textColor","buttonColor","buttonBackgroundColor","isExpanded","message","setMessage","inputRef","useRef","scrollChatToBottom","_inputRef$current","current","focus","scrollingElement","document","querySelector","scrollTop","scrollHeight","ChatContainer","fallback","CloseButton","onClick","FaTimes","MessagesContainer","map","chatMessage","Message","color","key","_id","maxLength","dayjs","createdAt","format","emitter","slice","formatMessage","Form","onSubmit","event","preventDefault","trim","TextField","ref","value","e","target","type","autoComplete","placeholder","SendButton","_ref2","form","input","Input","_extends","_objectDestructuringEmpty","rest","innerRef","RPGUIContainer","Column","flex","flexWrap","alignItems","justifyContent","CustomInput","CustomContainer","MessageText","SearchCharacter","onChangeCharacterName","recentCharacters","hideSearchCharacterUI","onCharacterClick","characterName","setCharacterName","searchCharacterRef","timer","setTimeout","clearTimeout","SearchContainer","id","SearchButton","RxMagnifyingGlass","ListContainer","character","ListElement","handleCharacterClick","_ref3","li","ChatContent","isPrivate","isTrade","isGlobal","onSendLocalChatMessage","onSendGlobalChatMessage","onSendPrivateChatMessage","onSendTradeMessage","autoCloseOnSend","isGuild","onSendGuildChatMessage","searchCharacterUI","privateChatCharacters","ChatWrapper","sendMessage","ChatTabs","activeTab","onChangeTab","TabContainer","tabs","tab","Tab","active","ExpandButton","StyledExpandButton","IoMdContract","IoMdExpand","RecentChats","showRecentChats","showSearchCharacterUI","recentChatCharacters","recentSelectedChatCharacterId","unseenMessageCharacterIds","onPreviousChatCharacterClick","onRemoveRecentChatCharacter","RecentChatTabContainer","isOpen","RecentChatTopBar","BurgerIconContainer","toggleRecentChats","hasUnseenMessages","BurgerLineIcon","RecentChatLogContainer","_unseenMessageCharact","ListElementContainer","handlePreviousChatCharacterClick","StatusDot","isUnseen","includes","RxCross2","ChatRevampContainer","TopBar","AllChatsContainer","_ref4","ChatContentWrapper","CollapsedChatInput","ExpandedChatContent","SingleShortcut","useShortcutCooldown","onShortcutCast","shortcutCooldown","setShortcutCooldown","cooldownTimeout","handleShortcutCast","CancelButton","ButtonsContainer","ShortcutsContainer","StyledShortcut","useOutsideClick","handleClickOutside","contains","CustomEvent","detail","dispatchEvent","addEventListener","removeEventListener","NPCDialogType","DraggableContainer","minHeight","minWidth","_ref$type","FramedGold","title","imgSrc","_ref$imgWidth","imgWidth","cancelDrag","onPositionChange","onPositionChangeEnd","onPositionChangeStart","onOutsideClick","_ref$initialPosition","initialPosition","_ref$dragDisabled","dragDisabled","isFullScreen","draggableRef","_e","Draggable","cancel","onDrag","data","onStop","onStart","defaultPosition","TitleContainer","Title","Icon","src","_ref5","css","_ref6","h1","img","_ref7","Dropdown","options","_ref$opensUp","dropdownId","uuidv4","selectedValue","setSelectedValue","_useState2","selectedOption","setSelectedOption","_useState3","setOpened","firstOption","change","filter","o","option","onMouseLeave","onPointerUp","prev","modalRoot","getElementById","ModalPortal","ReactDOM","createPortal","rarityColor","rarity","ItemRarities","Uncommon","Rare","Epic","Legendary","gemColors","emerald-gem","topaz-radiance","sapphire-gem","ruby-gem","misty-quartz-gem","coral-reef-gem","jasper-gem","earthstone-gem","obsidian-gem","amethyst-gem","onRenderGems","_item$attachedGems","attachedGems","ItemSlotQty","itemId","ItemQtyContainer","_item$attachedGems2","gem","Gem","onRenderStackInfo","stackQty","qtyClassName","ItemQty","Math","round","ItemSlotRenderer","containerType","slotSpriteMask","renderItem","texturePath","getItemTextureKeyPath","isStackable","renderStackInfo","renderGems","itemToRender","ItemContainerType","Equipment","_itemToRender$allowed","allowedEquipSlotType","EquipmentSlotSpriteByType","renderEquipment","onRenderSlot","generateContextMenuListOptions","actionsByTypeList","action","text","ItemSocketEventsDisplayLabels","initialDetailsState","isTooltipVisible","isTooltipMobileVisible","isContextMenuVisible","contextMenuPosition","contextActions","clearContextActions","clearDetailsState","ItemSlotDetailsContext","createContext","detailsState","updateDetailsState","setContextActions","useItemSlotDetails","useContext","ItemSlotDetailsProvider","setDetailsState","useCallback","newState","prevState","isDepotSystem","isContextMenuDisabled","newContextActions","itemContainerType","contextActionMenu","Inventory","ItemType","Weapon","Armor","Accessory","Jewelry","ActionsForInventory","Consumable","CraftingResource","Tool","Other","push","DepotSocketEvents","Deposit","contextActionMenuDontHaveUseWith","find","toLowerCase","hasUseWith","ItemSocketEvents","UseWith","ActionsForEquipmentSet","Loot","ActionsForLoot","MapContainer","ActionsForMapContainer","Depot","GetItemInfo","Withdraw","generateContextMenu","contextValue","useMemo","Provider","initialDraggingState","isDragging","position","dropPosition","isFocused","draggingDistance","ItemSlotDraggingContext","draggingState","updateDraggingState","clearDraggingState","useItemSlotDragging","ItemSlotDraggingProvider","setDraggingState","Neck","LeftHand","Ring","Head","Torso","Legs","Feet","RightHand","ItemSlot","observer","slotIndex","onMouseOver","onMouseOut","_ref$isContextMenuDis","onDragEnd","onDragStart","onPlaceDrop","onDrop","onOutsideDrop","checkIfItemCanBeMoved","openQuantitySelector","checkIfItemShouldDragEnd","dragScale","isSelectingShortcut","setItemShortcut","_useItemSlotDetails","getTouchTarget","_touchEvent$changedTo","_touchEvent$touches","touch","changedTouches","touches","elementFromPoint","clientX","clientY","body","dragContainer","_useItemSlotDragging","resetItem","onSuccessfulDrag","quantity","handleDraggedItem","targetClasses","from","classList","some","elm","log","targetElement","_getElementTransform","getElementTransform","processDragEnd","element","window","getComputedStyle","matrix","DOMMatrixReadOnly","transform","m41","m42","isDraggingItem","onMouseUp","onTouchEnd","_e$changedTouches$","simulatedEvent","MouseEvent","bubbles","_document$elementFrom","undefined","subType","ItemSubType","Seed","axis","defaultClassName","requestAnimationFrame","isMobile","parseInt","split","isNaN","handleShortcutSetter","remove","removeDraggingClass","isTouchEvent","mouseEvent","handleContextMenuOrTooltip","_data","bounds","ItemContainer","onMouseEnter","statisticsToDisplay","higherIsWorse","ItemInfo","itemToCompare","renderMissingStatistic","statistics","_i2","_statisticsToDisplay2","stat","itemToCompareStatistic","toUpperCase","Statistic","toString","skillName","_item$minRequirements","minRequirements","_item$minRequirements2","skill","Header","Rarity","Type","AllowedSlots","slotType","LevelRequirement","_item$minRequirements3","level","charAt","_item$minRequirements4","_item$minRequirements5","_i","_statisticsToDisplay","itemStatistic","_itemToCompare$stat$k","_itemToCompare$stat$k2","isItemToCompare","isOnlyInOneItem","statDiff","isDifference","isBetter","renderStatistics","entityEffects","entityEffectChance","effect","usableEffectDescription","equippedBuffDescription","isTwoHanded","Description","description","maxStackSize","StackInfo","_item$stackQty","MissingStatistics","_rarityColor","$isSpecial","itemSlotTypes","ItemInfoDisplay","equipmentSet","_item$allowedEquipSlo","allowedSlotTypeCamelCase","camelCase","itemSubTypeCamelCase","getSlotType","itemFromEquipment","Object","values","_item$subType","Flex","CompareContainer","Equipped","$isMobile","ItemTooltip","handleMouseMove","rect","getBoundingClientRect","tooltipWidth","tooltipHeight","isOffScreenRight","innerWidth","isOffScreenBottom","innerHeight","MobileItemTooltip","closeTooltip","onSelected","handleFadeOut","_ref$current","add","OptionsContainer","Option","ItemInfoWrapper","setIsTooltipVisible","setIsTooltipMobileVisible","bind","countItemFromInventory","itemKey","inventory","itemsFromInventory","keys","slots","forEach","i","_inventory$slots$inde","reduce","acc","modifyString","str","parts","words","replace","join","TooltipContainer","MinCraftingRequirementsText","levelIsOk","IngredientsTitle","Recipe","Ingredient","isQuantityOk","CraftingTooltip","recipe","skills","levelInSkill","_skills$level","_skills","_recipe$minCraftingRe","_recipe$minCraftingRe2","minCraftingRequirements","_recipe$levelIsOk","_recipe$minCraftingRe3","_recipe$minCraftingRe4","_recipe$minCraftingRe5","_recipe$minCraftingRe6","ingredients","ingredient","itemQtyInInventory","qty","RadioOptionsWrapper","SpriteAtlasWrapper","MainContent","ItemHeader","CraftingRecipe","handleRecipeSelect","selectedCraftItemKey","showTooltip","setShowTooltip","tooltipPosition","setTooltipPosition","wrapperRef","isSelected","right","top","canCraft","checked","desktop","mobileLanscape","mobilePortrait","Wrapper","HeaderContainer","HeaderControls","DropdownWrapper","ContentContainer","RadioInputScroller","CraftingRecipeWrapper","PinButton","isPinned","Footer","PaginationContainer","PaginationButton","PageInfo","Details","DraggedItem","_useCursorPosition","setPosition","scalePosition","setFromEvent","scaledPosition","cleanup","handleEvent","useCursorPosition","centeredX","CONTAINER_SIZE","centeredY","stackInfo","_item$_id","SpriteContainer","attrs","left","RelativeListMenu","_ref$fontSize","pos","overflow","params","ItemSlotToolTips","optionId","EquipmentSetContainer","EquipmentColumn","Table","table","TableRow","tr","TableHeader","th","TableCell","td","ActionButtons","UserActionLink","SearchFriend","searchedCharacters","friendRequests","onSearch","onSendFriendRequest","onAcceptRequest","onRejectRequest","debouncedSearch","debounce","searchTabContent","SearchForm","SearchInput","autoFocus","CharacterList","characters","onAction","actionLabel","requestsTabContent","FriendRequestSection","onAccept","onReject","InternalTabs","content","activeTextColor","inactiveColor","borderColor","ListItem","CharacterName","AcceptRejectActions","ListWrapper","ScrollableArea","IsOnlineBadge","$isOnline","IS_MOBILE_OR_TABLET","isMobileOrTablet","DynamicText","onFinish","textState","setTextState","interval","setInterval","substring","clearInterval","TextContainer","NPCDialogText","charactersPerLine","linesPerDiv","onClose","onEndStep","onStartStep","windowSize","textChunks","floor","match","RegExp","chunkIndex","setChunkIndex","onHandleSpacePress","code","goToNextStep","showGoNextIndicator","setShowGoNextIndicator","PressSpaceIndicator","TextOnly","pressSpaceGif","useEventListener","handler","el","savedHandler","listener","QuestionDialog","questions","answers","currentQuestion","setCurrentQuestion","canShowAnswers","setCanShowAnswers","onGetFirstAnswer","answerIds","firstAnswerId","answer","currentAnswer","setCurrentAnswer","onGetAnswers","answerId","nextAnswerIndex","findIndex","nextAnswerID","nextAnswer","previousAnswerIndex","previousAnswerID","previousAnswer","pop","nextQuestionId","question","QuestionContainer","AnswersContainer","selectedColor","AnswerRow","AnswerSelectedIcon","Answer","onAnswerClick","onRenderCurrentAnswers","ImgSide","NPCDialog","imagePath","_ref$isQuestionDialog","isQuestionDialog","TextAndThumbnail","ThumbnailContainer","NPCThumbnail","aliceDefaultThumbnail","CloseIcon","RangeSliderType","NPCMultiDialog","textAndTypeArray","slide","setSlide","_textAndTypeArray$sli","imageSide","BackgroundContainer","imgPath","DialogContainer","CarouselWrapper","ArrowContainer","BackgroundImage","isTextFixed","textPosition","ImageContainer","CustomLeftArrow","CustomRightArrow","Carousel","CarouselImg","fadeIn","keyframes","FadeInCarouselImg","_ref$activeColor","activeColor","_ref$activeTextColor","_ref$inactiveColor","_ref$borderColor","_ref$hoverColor","hoverColor","setActiveTab","TableWrapper","TabHeader","TabButton","ContentWrapper","_tabs$find","SlotsContainer","Framed","ShortcutsSetter","setSettingShortcutIndex","settingShortcutIndex","shortcuts","removeShortcut","List","Shortcut","ShortcutType","None","isBeingSet","_shortcuts$index","_shortcuts$index2","payload","shortcut","Spell","_payload$texturePath","getContent","OrderByType","RangeSlider","memo","valueMin","valueMax","_ref$step","step","sliderId","containerRef","setLeft","calculatedWidth","_containerRef$current","clientWidth","max","typeClass","GoldSlider","handleChange","Number","pointerEvents","min","QuantitySelector","maxQuantity","initialQuantity","_ref$title","onConfirm","setValue","closeSelector","select","StyledContainer","StyledForm","numberValue","noValidate","StyledInput","Slider","RPGUIButton","QuantitySelectorModal","quantitySelect","setQuantitySelect","resetQuantitySelect","callback","validatedQuantitySelect","QuantitySelectorContainer","ItemQuantitySelectorModal","itemContainer","onItemClick","_ref$disableContextMe","disableContextMenu","onItemDragEnd","onItemDragStart","onItemPlaceDrop","_quantity","_useScrollOnDrag","threshold","scrollStep","animationFrameId","startScrolling","scroll","maxScrollTop","clientHeight","distanceFromBottom","bottom","stopScrolling","cancelAnimationFrame","useScrollOnDrag","handleSetShortcut","onDragStartScrollingEvents","once","onDragEndScrollingEvents","onDragStartHandler","onDragEndHandler","memoizedHandleSetShortcut","onRenderSlots","slotQty","_itemContainer$slots","currentItem","itemType","ItemsContainer","isScrollable","Subtitle","ButtonWrapper","LeaderboardTable","items","rankType","TableRowWrapper","TableRowValue","entry","isTopSkillEntry","WrapperContainer","StyledDropdown","ItemComponentScrollWrapper","Pager","totalItems","currentPage","onPageChange","totalPages","ceil","itemsPerPage","PagerContainer","ConfirmModal","Background","stopPropagation","ButtonsWrapper","MarketplaceRows","itemPrice","onMarketPlaceItemBuy","onMarketPlaceItemRemove","MarketplaceWrapper","ItemIconContainer","GemContainer","RarityContainer","QuantityContainer","PriceValue","GoldContainer","MultitabType","itemTypeOptions","itemRarityOptions","itemRarity","orderByOptions","flatMap","orderBy","display","BuyPanel","onChangeType","onChangeRarity","onChangeOrder","onChangeNameInput","onChangeMainLevelInput","onChangeSecondaryLevelInput","onChangePriceInput","characterId","enableHotkeys","disableHotkeys","setName","mainLevel","setMainLevel","secondaryLevel","setSecondaryLevel","_useState4","price","setPrice","_useState5","buyingItemId","setBuyingItemId","itemsContainer","_itemsContainer$curre","scrollTo","InputWrapper","OptionsWrapper","FilterInputsWrapper","AiFillCaretRight","owner","ManagmentPanel","availableGold","selectedItemToSell","onSelectedItemToSellRemove","onAddItemToMarketplace","onMoneyWithdraw","isCreatingOffer","setIsCreatingOffer","removingItemId","setRemovingItemId","InnerOptionsWrapper","SellDescription","__","PriceInputWrapper","AvailableGold","$disabled","_props$styles","_props$styles2","centerContent","CustomTab","BodyContainer","selectedTab","NonDraggableWrapper","PartyRow","charName","charClass","charLevel","playerQty","isInvited","PartyWrapper","partyName","RowsWrapper","PlayersRow","isNotInvited","HighlightedText","Text","PartyManagerRow","leaderId","userId","onRemovePlayer","onChangeLeader","isCurrentUser","canRemove","isLeader","YellowText","NotInParty","mockedPartyRows","mockedPlayersRows2","leader","class","CharacterClass","Druid","members","maxSize","mockedPlayersRows","mockedPartyManager","ProgressBarText","percentageWidth","mobileScale","QuestDraggableContainer","QuestContainer","QuestsContainer","Content","QuestSplitDiv","QuestColumn","Thumbnail","QuestListContainer","QuestCard","QuestItem","Label","Value","NoQuestContainer","formatQuestText","word","getQuestStatusColor","status","QuestStatus","Pending","InProgress","Completed","formatQuestStatus","c","RPGUIScrollbar","RPGUIOverrides","_RPGUI","RPGUI","SimpleProgressBar","_ref$bgColor","bgColor","_ref$margin","margin","ProgressBarContainer","BackgroundBar","Progress","toFixed","Tooltip","SkillProgressBar","totalPointsForLevelUp","excessSkillPoints","currentSkillPoints","skillPoints","skillPointsToNextLevel","_ref$showSkillPoints","showSkillPoints","buffAndDebuff","baseSkillPoints","getSPForLevel","progress","formatBuffAndDebuff","skillsBuffsCalc","result","ProgressTitle","BuffAndDebuffContainer","TitleNameContainer","TitleNameBuff","TitleNameBuffContainer","TitleNameDebuff","TitleName","ValueDisplay","ProgressBody","ProgressIconContainer","ProgressBarWrapper","SkillDisplayContainer","SkillPointsDisplay","skillProps","attributes","stamina","magic","magicResistance","strength","resistance","dexterity","combat","first","club","sword","axe","distance","shielding","dagger","crafting","fishing","farming","mining","lumberjacking","blacksmithing","cooking","alchemy","skillNameMap","SkillsDraggableContainer","SkillsContainerDiv","SkillSplitDiv","SpellInfo","spell","magicWords","manaCost","requiredItem","castingType","cooldown","maxDistanceGrid","formatSpellCastingType","SpellInfoDisplay","MobileSpellTooltip","MagicTooltip","SpellInfoWrapper","_ref$holdTouchDuratio","holdTouchDuration","touchTimeoutRef","onTouchStart","charMana","charMagicLevel","isSettingShortcut","activeCooldown","minMagicLevelRequired","spellKey","Overlay","SpellImage","_spell$texturePath","Info","Divider","Cost","SpellList","Stepper","steps","finalCTAButton","onError","_ref$useSideArrows","useSideArrows","currentStep","setCurrentStep","currentComponent","_steps$currentStep","component","totalSteps","onStepChange","_regeneratorRuntime","mark","_callee","_steps$currentStep2","wrap","_context","next","validate","sent","errorMessage","abrupt","t0","stop","_x","renderArrows","leftArrow","rightArrow","StepperContainer","StepperTop","ProgressIndicator","isActive","stepperProgressColor","StepperBodyContainer","StepperBody","StepperFooter","DayNightPeriod","periodOfDay","periodOfDaySrcFiles","_periodOfDaySrcFiles","PeriodOfDay","Morning","Afternoon","Night","GifContainer","WidgetContainer","Time","DayNightContainer","PremiumLabel","accountType","UserAccountTypes","Free","StyledLabel","backgroundColor","PremiumBronze","PremiumSilver","PremiumGold","PremiumUltimate","getBackgroundColor","getShortLabel","TradingItemRow","onQuantityChange","traderItem","selectedQty","isBuy","inputQty","setInputQty","onLeftClick","onRightClick","_traderItem$stackQty2","ItemWrapper","ItemNameContainer","NameValue","capitalize","canBePurchasedOnlyByPremiumPlans","StyledArrow","QuantityInput","_traderItem$stackQty","newQty","ScrollWrapper","InfoSection","GoldInfo","AlertText","ZoomableImage","alt","isZoomed","setIsZoomed","zoomPosition","setZoomPosition","onMouseMove","_e$currentTarget$getB","currentTarget","onTouchMove","_e$currentTarget$getB2","objectFit","transformOrigin","transition","cursor","TutorialStepper","lessons","onLessonFinish","imageStyle","generateLessons","lesson","LessonContainer","LessonTitle","image","LessonImageWrapper","LessonImage","imageUrl","href","rel","LessonFooter","LessonBody","dangerouslySetInnerHTML","__html","defaultValue","_options$","_options$find","_options$2","_options$find2","BeatLoader","handleSelection","availableCharacters","propertySelectValues","textureKey","selectedSpriteKey","setSelectedSpriteKey","paddingBottom","FramedGrey","Date","onRenderMessageLines","onRenderChatMessages","_ref$activeTab","_ref$minimizedByDefau","minimizedByDefault","chatHook","setShowRecentChats","setIsExpanded","toggleExpand","handleTabChange","tabId","useChat","selectedValues","generateSelectedValuesList","setSelectedValues","_extends2","_ref$defaultValue","setChecked","newCheckedState","readOnly","onActionClick","onCancelClick","mana","spellCooldowns","_useShortcutCooldown","onShortcutClick","buildClassName","classBase","isOnCooldown","variant","onShortcutClickBinded","_shortcuts$i","isOnShortcutCooldown","_shortcuts$i2","_shortcuts$i3","itemsFromEquipment","totalQty","_shortcuts$i4","spellCooldown","_spellCooldowns$paylo","replaceAll","_payload$manaCost","renderShortcut","onSelect","onCraftItem","craftablesItems","savedSelectedType","craftItemKey","setCraftItemKey","selectedType","setSelectedType","setSize","searchTerm","setSearchTerm","isSearchVisible","setIsSearchVisible","_useState6","isCraftingDisabled","setIsCraftingDisabled","_useLocalStorage","initialValue","localStorage","getItem","parse","storedValue","setStoredValue","valueToStore","Function","setItem","useLocalStorage","pinnedItems","setPinnedItems","_useState7","setCurrentPage","handleResize","categoryOptions","sort","a","b","localeCompare","filteredCraftableItems","matchesSearch","matchesCategory","sortedItems","aIsPinned","bIsPinned","paginatedItems","FaSearch","FaThumbtack","FaChevronLeft","FaChevronRight","maxCraftable","maxPossible","inventoryItem","possibleWithThisIngredient","_inventoryItem$stackQ","calculateMaxCraftable","details","onItemOutsideDrop","equipmentData","neck","leftHand","ring","head","armor","legs","boot","rightHand","accessory","equipmentMaskSlots","ItemSlotType","onRenderEquipmentSlotRange","start","end","equipmentRange","slotMaksRange","ContainerType","friends","onRemoveFriend","onOpenPrivateMessage","onAddFriend","onBackFriendList","isAddFriendUI","setIsAddFriendUI","friend","isOnline","backgroundImgPath","fullCoverBackground","setImage","fullImg","textImage","textImageSelected","setTextImageSelected","goToPreviousImage","indexOf","goToNextImage","_textImageSelected$te","_textImageSelected$te2","handleClick","imageKey","onChangeRankType","onChangeClassType","skillOptions","onChangeSkillType","classOptions","rankOptions","rankTypeOptions","skillTypeOptions","classTypeOptions","onYourPanelToggle","isYourPanel","setIsYourPanel","onCreate","close","partyRows","playersRows","invitationActionText","sortedMembers","partyRow","_ref$displayText","displayText","_ref$percentageWidth","_ref$minWidth","calculatePercentageValue","quests","buttons","onChangeQuest","questsLength","thumbnail","thumbnailDefault","npcId","container","quest","_formatQuestStatus","card","_ref$isBlockedCasting","isBlockedCastingByKeyboard","shortcutsRefs","handleKeyDown","shortcutIndex","_shortcutsRefs$curren","timeoutId","_shortcutsRefs$curren2","timeoutIds","images","_ref$autoCycle","autoCycle","_ref$autoCycleDelay","autoCycleDelay","_ref$stopAutoCyclingO","stopAutoCyclingOnInteraction","currentImage","setCurrentImage","autoCycleId","prevImage","hasMoreThanOneImage","onRenderSkillCategory","category","skillCategory","skillCategoryColor","output","_Object$entries","entries","_Object$entries$_i","skillDetails","experience","getXPForLevel","onInputFocus","onInputBlur","spells","magicLevel","onSpellClick","setSpellShortcut","iconAtlasIMG","iconAtlasJSON","search","setSearch","spellsToDisplay","toLocaleLowerCase","setShortcut","Fragment","Brown","_ref$isDraggableModal","isDraggableModal","setSelectedTab","TabsCore","Gray","onGetContainerType","TimeClock","traderItems","characterAvailableGold","_useTradingGold","sum","setSum","Map","qtyMap","setQtyMap","hasGoldForSale","getFinalGold","getTradeItems","get","updateQuantity","set","newSum","useTradingGold","tradeItem","_qtyMap$get","Warrior","Sorcerer","Rogue"],"mappings":"6oPAIYA,iDCUCC,EAAuC,SAA5BC,WACtBC,UAAAA,WAASC,EAAG,OAAMA,EAClBC,EAAIH,EAAJG,KAAIC,EAAAJ,EACJK,MAAAA,WAAKD,EAAG,EAACA,EACTE,EAAaN,EAAbM,cACGC,EAAKC,EAAAR,EAAAS,GAER,OACEC,gCAEIA,gBADa,SAAdT,EACEU,EAOAC,iBANCT,KAAMA,EACNE,MAAOA,EACPC,cAAe,WAAF,OAAQA,MACjBC,MAmBRI,EAAYE,EAAOC,KAAIC,YAAAC,qCAAAC,4BAAXJ,grBAKP,SAAAN,GAAK,OAAIA,EAAMJ,MAAQ,MACtB,SAAAI,GAAK,OAAIA,EAAMJ,MAAQ,MACd,SAAAI,GAAK,OAAIA,EAAMF,OAAS,kgBAOvCO,EAAaC,EAAOC,KAAIC,YAAAC,sCAAAC,4BAAXJ,yrBAIR,SAAAN,GAAK,OAAIA,EAAMJ,MAAQ,MACtB,SAAAI,GAAK,OAAIA,EAAMJ,MAAQ,MAEd,SAAAI,GAAK,OAAIA,EAAMF,OAAS,kfCyBvCa,EAAkBL,EAAOC,KAAIC,YAAAC,6CAAAC,2BAAXJ,4EAOlBM,EAAgBN,EAAOO,MAAKL,YAAAC,2CAAAC,2BAAZJ,2BAIhBQ,EAAYR,EAAOS,IAAGP,YAAAC,uCAAAC,2BAAVJ,mCAEP,SAAAN,GAAK,OAAIA,EAAM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