@rpg-engine/long-bow 0.5.2 → 0.5.4
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/ImageCarousel/ImageCarousel.d.ts +1 -0
- package/dist/components/Spellbook/Spell.d.ts +2 -0
- package/dist/components/Spellbook/Spellbook.d.ts +2 -0
- package/dist/components/shared/SpriteFromAtlas.d.ts +2 -0
- package/dist/long-bow.cjs.development.js +101 -32
- 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 +101 -32
- package/dist/long-bow.esm.js.map +1 -1
- package/dist/mocks/shortcut.mocks.d.ts +2 -0
- package/package.json +2 -2
- package/src/components/CircularController/CircularController.tsx +16 -1
- package/src/components/ImageCarousel/ImageCarousel.tsx +20 -0
- package/src/components/Shortcuts/Shortcuts.tsx +17 -3
- package/src/components/Shortcuts/ShortcutsSetter.tsx +21 -2
- package/src/components/Spellbook/Spell.tsx +16 -1
- package/src/components/Spellbook/Spellbook.tsx +6 -0
- package/src/components/Spellbook/mockSpells.ts +27 -13
- package/src/components/shared/SpriteFromAtlas.tsx +11 -2
- package/src/mocks/shortcut.mocks.ts +2 -0
- package/src/stories/Spellbook.stories.tsx +11 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"long-bow.cjs.production.min.js","sources":["../src/constants/uiFonts.ts","../src/components/Button.tsx","../src/components/RPGUIContainer.tsx","../src/components/shared/SpriteFromAtlas.tsx","../src/components/Item/Inventory/ErrorBoundary.tsx","../src/components/Arrow/SelectArrow.tsx","../src/components/shared/Ellipsis.tsx","../src/components/PropertySelect/PropertySelect.tsx","../src/components/Character/CharacterSelection.tsx","../src/components/shared/Column.tsx","../src/components/Chat/Chat.tsx","../src/components/Input.tsx","../src/components/Chatdeprecated/ChatDeprecated.tsx","../src/constants/uiColors.ts","../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/RelativeListMenu.tsx","../src/components/Item/Cards/MobileItemTooltip.tsx","../src/components/Item/Inventory/itemContainerHelper.ts","../src/components/Item/Inventory/ItemSlot.tsx","../src/components/Item/Cards/ItemInfo.tsx","../src/components/Item/Cards/ItemInfoDisplay.tsx","../src/components/Item/Cards/ItemTooltip.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/Equipment/EquipmentSet.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/Abstractions/SlotsContainer.tsx","../src/components/Marketplace/filters/index.tsx","../src/components/Item/Inventory/ItemQuantitySelector.tsx","../src/components/Shortcuts/ShortcutsSetter.tsx","../src/components/Item/Inventory/ItemContainer.tsx","../src/components/ListMenu.tsx","../src/components/Pager.tsx","../src/components/ConfirmModal.tsx","../src/components/Marketplace/MarketplaceRows.tsx","../src/components/Marketplace/BuyPanel.tsx","../src/components/Marketplace/ManagmentPanel.tsx","../src/components/Marketplace/Marketplace.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/PartySystem/PartyManager/PartyManagerRows.tsx","../src/components/PartySystem/PartyManager/PartyManager.tsx","../src/components/PartySystem/mockedConstantes/mockedValues.tsx","../src/components/ProgressBar.tsx","../src/components/QuestInfo/QuestInfo.tsx","../src/components/QuestList.tsx","../src/components/RPGUIRoot.tsx","../src/components/Shortcuts/Shortcuts.tsx","../src/components/SimpleProgressBar.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/TimeWidget/DayNightPeriod/DayNightPeriod.tsx","../src/components/TimeWidget/TimeWidget.tsx","../src/components/TradingMenu/TradingItemRow.tsx","../src/components/TradingMenu/TradingMenu.tsx","../src/components/Truncate.tsx","../src/components/itemSelector/ItemSelector.tsx","../src/components/CheckButton.tsx","../src/components/RadioButton.tsx","../src/components/TextArea.tsx"],"sourcesContent":["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 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';\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","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}\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}) => {\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] || atlasJSON.frames['others/no-image.png'];\n\n if (!spriteData) throw new Error(`Sprite ${spriteKey} not found in atlas!`);\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 />\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}\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: 8px;\n left: 8px;\n filter: ${props => (props.grayScale ? 'grayscale(100%)' : 'none')};\n opacity: ${props => props.opacity};\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';\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}\n\nexport const SelectArrow: React.FC<ArrowBarProps> = ({\n direction = 'left',\n size,\n onPointerDown,\n ...props\n}) => {\n return (\n <>\n {direction === 'left' ? (\n <LeftArrow\n size={size}\n onPointerDown={() => onPointerDown()}\n {...props}\n ></LeftArrow>\n ) : (\n <RightArrow\n size={size}\n onPointerDown={() => onPointerDown()}\n {...props}\n ></RightArrow>\n )}\n </>\n );\n};\n\ninterface IArrowProps {\n size?: 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 :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 :active {\n background-image: url(${RightArrowClickIcon});\n }\n z-index: 2;\n`;\n\nexport default SelectArrow;\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,\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 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 { IChatMessage } from '@rpg-engine/shared';\nimport dayjs from 'dayjs';\nimport React, { useEffect, useState } from 'react';\nimport { ErrorBoundary } from 'react-error-boundary';\nimport { RxPaperPlane } from 'react-icons/rx';\nimport styled from 'styled-components';\nimport { Column } from '../shared/Column';\n\ninterface IEmitter {\n _id: string;\n name: string;\n}\n\ninterface IStyles {\n textColor?: string;\n buttonColor?: string;\n buttonBackgroundColor?: string;\n width?: string;\n height?: string;\n}\n\nexport interface IChatProps {\n chatMessages: IChatMessage[];\n onSendChatMessage: (message: string) => void;\n onCloseButton: () => void;\n onFocus?: () => void;\n onBlur?: () => void;\n opacity?: number;\n sendMessage: boolean;\n styles?: IStyles;\n}\n\nexport const Chat: React.FC<IChatProps> = ({\n chatMessages,\n onSendChatMessage,\n onFocus,\n onBlur,\n styles = {\n textColor: '#c65102',\n buttonColor: '#005b96',\n buttonBackgroundColor: 'rgba(0,0,0,.2)',\n width: '80%',\n height: 'auto',\n },\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 if (!message || message.trim() === '') return;\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: IChatMessage[]) => {\n return chatMessages?.length ? (\n chatMessages?.map(({ _id, createdAt, emitter, message }, index) => (\n <Message color={styles?.textColor || '#c65102'} key={`${_id}_${index}`}>\n {onRenderMessageLines(emitter, createdAt as string, message)}\n </Message>\n ))\n ) : (\n <Message color={styles?.textColor || '#c65102'}>\n No messages available.\n </Message>\n );\n };\n\n return (\n <ChatContainer\n width={styles?.width || '80%'}\n height={styles?.height || 'auto'}\n >\n <ErrorBoundary fallback={<p>Oops! Your chat has crashed.</p>}>\n <MessagesContainer className=\"chat-body\">\n {onRenderChatMessages(chatMessages)}\n </MessagesContainer>\n\n <Form onSubmit={handleSubmit}>\n <Column flex={70}>\n <TextField\n value={message}\n id=\"inputMessage\"\n onChange={e => getInputValue(e.target.value)}\n height={20}\n type=\"text\"\n autoComplete=\"off\"\n onFocus={onFocus}\n onBlur={onBlur}\n onPointerDown={onFocus}\n autoFocus\n />\n </Column>\n <Column justifyContent=\"flex-end\">\n <Button\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 <RxPaperPlane size={15} />\n </Button>\n </Column>\n </Form>\n </ErrorBoundary>\n </ChatContainer>\n );\n};\n\ninterface IContainerProps {\n width: string;\n height: string;\n}\n\ninterface IMessageProps {\n color: string;\n}\n\ninterface IButtonProps {\n buttonColor: string;\n buttonBackgroundColor: string;\n}\n\nconst ChatContainer = styled.div<IContainerProps>`\n height: ${props => props.height};\n width: ${({ width }) => width};\n padding: 10px;\n background-color: rgba(0, 0, 0, 0.2);\n height: auto;\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 MessagesContainer = styled.div`\n height: 70%;\n margin-bottom: 10px;\n .chat-body {\n max-height: auto;\n overflow-y: auto;\n }\n`;\n\nconst Message = styled.div<IMessageProps>`\n margin-bottom: 8px;\n color: ${({ color }) => color};\n`;\n\nconst Form = styled.form`\n display: flex;\n width: 100%;\n justify-content: center;\n align-items: center;\n`;\n\nconst Button = styled.button<IButtonProps>`\n color: ${({ buttonColor }) => buttonColor};\n background-color: ${({ buttonBackgroundColor }) => buttonBackgroundColor};\n width: 28px;\n height: 28px;\n border: none !important;\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 { IChatMessage } 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 '../RPGUIContainer';\nimport { Column } from '../shared/Column';\n\ninterface IEmitter {\n _id: string;\n name: string;\n}\nexport interface IChatDeprecatedProps {\n chatMessages: IChatMessage[];\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: IChatMessage[]) => {\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","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 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 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?.magicWords.split(' ').map(word => word[0])}\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 '../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 <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\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 from 'styled-components';\nimport { uiFonts } from '../constants/uiFonts';\nimport { useOutsideClick } from '../hooks/useOutsideAlerter';\nimport { IPosition } from '../types/eventTypes';\nimport { RPGUIContainerTypes } from './RPGUIContainer';\n\nexport interface IDraggableContainerProps {\n children: React.ReactNode;\n width?: string;\n height?: 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}\n\nexport const DraggableContainer: React.FC<IDraggableContainerProps> = ({\n children,\n width = '50%',\n height,\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}) => {\n const draggableRef = useRef(null);\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,${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 className={`rpgui-container ${type} ${className}`}\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}\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 &.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`;\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`\n color: white;\n z-index: 22;\n font-size: ${uiFonts.size.xsmall};\n width: ${(props: ICustomIconProps) => props.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 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, { 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 {\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 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 {\n getItemTextureKeyPath,\n IEquipmentSet,\n IItem,\n IItemContainer,\n ItemContainerType,\n ItemRarities,\n ItemSlotType,\n ItemType,\n} from '@rpg-engine/shared';\n\nimport { observer } from 'mobx-react-lite';\nimport React, { useEffect, useRef, useState } from 'react';\nimport Draggable from 'react-draggable';\nimport styled from 'styled-components';\nimport { v4 as uuidv4 } from 'uuid';\nimport { uiFonts } from '../../../constants/uiFonts';\nimport { IPosition } from '../../../types/eventTypes';\nimport { RelativeListMenu } from '../../RelativeListMenu';\nimport { Ellipsis } from '../../shared/Ellipsis';\nimport { SpriteFromAtlas } from '../../shared/SpriteFromAtlas';\nimport { ItemTooltip } from '../Cards/ItemTooltip';\nimport { MobileItemTooltip } from '../Cards/MobileItemTooltip';\nimport { ErrorBoundary } from './ErrorBoundary';\nimport { generateContextMenu, IContextMenuItem } from './itemContainerHelper';\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 onSelected?: (selectedOption: string, item: IItem) => void;\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 onSelected,\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 equipmentSet,\n setItemShortcut,\n isDepotSystem,\n }) => {\n const [isTooltipVisible, setTooltipVisible] = useState(false);\n const [isTooltipMobileVisible, setIsTooltipMobileVisible] = useState(false);\n\n const [isContextMenuVisible, setIsContextMenuVisible] = useState(false);\n const [contextMenuPosition, setContextMenuPosition] = useState({\n x: 0,\n y: 0,\n });\n\n const [isFocused, setIsFocused] = useState(false);\n const [wasDragged, setWasDragged] = useState(false);\n const [dragPosition, setDragPosition] = useState<IPosition>({ x: 0, y: 0 });\n const [dropPosition, setDropPosition] = useState<IPosition | null>(null);\n const dragContainer = useRef<HTMLDivElement>(null);\n\n const [contextActions, setContextActions] = useState<IContextMenuItem[]>(\n []\n );\n\n useEffect(() => {\n setDragPosition({ x: 0, y: 0 });\n setIsFocused(false);\n\n if (item && containerType) {\n setContextActions(\n generateContextMenu(item, containerType, isDepotSystem)\n );\n }\n }, [item, isDepotSystem]);\n\n useEffect(() => {\n if (onDrop && item && dropPosition) {\n onDrop(item, dropPosition);\n }\n }, [dropPosition]);\n\n const getStackInfo = (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 <ItemQtyContainer key={`qty-${itemId}`}>\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 return undefined;\n };\n\n const renderItem = (itemToRender: IItem | null) => {\n const element = [];\n\n if (itemToRender?.texturePath) {\n element.push(\n <ErrorBoundary key={itemToRender._id}>\n <SpriteFromAtlas\n key={itemToRender._id}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={getItemTextureKeyPath(\n {\n key: itemToRender.texturePath,\n texturePath: itemToRender.texturePath,\n stackQty: itemToRender.stackQty || 1,\n isStackable: itemToRender.isStackable,\n },\n atlasJSON\n )}\n imgScale={3}\n imgClassname=\"sprite-from-atlas-img--item\"\n />\n </ErrorBoundary>\n );\n }\n const stackInfo = getStackInfo(\n itemToRender?._id ?? '',\n itemToRender?.stackQty ?? 0\n );\n if (stackInfo) {\n element.push(stackInfo);\n }\n\n return element;\n };\n\n const renderEquipment = (itemToRender: IItem | null) => {\n if (\n itemToRender?.texturePath &&\n itemToRender.allowedEquipSlotType?.includes(slotSpriteMask!)\n ) {\n const element = [];\n\n element.push(\n <ErrorBoundary key={itemToRender._id}>\n <SpriteFromAtlas\n key={itemToRender._id}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={getItemTextureKeyPath(\n {\n key: itemToRender.texturePath,\n texturePath: itemToRender.texturePath,\n stackQty: itemToRender.stackQty || 1,\n isStackable: itemToRender.isStackable,\n },\n atlasJSON\n )}\n imgScale={3}\n imgClassname=\"sprite-from-atlas-img--item\"\n />\n </ErrorBoundary>\n );\n const stackInfo = getStackInfo(\n itemToRender?._id ?? '',\n itemToRender?.stackQty ?? 0\n );\n if (stackInfo) {\n element.push(stackInfo);\n }\n return element;\n } else {\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\n const onRenderSlot = (itemToRender: IItem | null) => {\n switch (containerType) {\n case ItemContainerType.Equipment:\n return renderEquipment(itemToRender);\n case ItemContainerType.Inventory:\n return renderItem(itemToRender);\n default:\n return renderItem(itemToRender);\n }\n };\n\n const resetItem = () => {\n setTooltipVisible(false);\n setWasDragged(false);\n };\n\n const onSuccesfulDrag = (quantity?: number) => {\n resetItem();\n\n if (quantity === -1) {\n setDragPosition({ x: 0, y: 0 });\n setIsFocused(false);\n } else if (item) {\n onDragEnd?.(quantity);\n }\n };\n\n return (\n <Container\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 || item?.type === ItemType.Tool)\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={(e, data) => {\n const target = e.target as HTMLElement;\n if (\n target?.id.includes('shortcutSetter') &&\n setItemShortcut &&\n item\n ) {\n const index = parseInt(target.id.split('_')[1]);\n if (!isNaN(index)) {\n setItemShortcut(item, index);\n }\n }\n\n if (wasDragged && item && !isSelectingShortcut) {\n //@ts-ignore\n const classes: string[] = Array.from(e.target?.classList);\n\n const isOutsideDrop =\n classes.some(elm => {\n return elm.includes('rpgui-content');\n }) || classes.length === 0;\n\n if (isOutsideDrop) {\n setDropPosition({\n x: data.x,\n y: data.y,\n });\n }\n\n setWasDragged(false);\n\n const target = dragContainer.current;\n if (!target || !wasDragged) return;\n\n const style = window.getComputedStyle(target);\n const matrix = new DOMMatrixReadOnly(style.transform);\n const x = matrix.m41;\n const y = matrix.m42;\n\n setDragPosition({ x, y });\n\n setTimeout(() => {\n if (checkIfItemCanBeMoved?.()) {\n if (checkIfItemShouldDragEnd && !checkIfItemShouldDragEnd())\n return;\n\n if (\n item.stackQty &&\n item.stackQty !== 1 &&\n openQuantitySelector\n )\n openQuantitySelector(item.stackQty, onSuccesfulDrag);\n else onSuccesfulDrag(item.stackQty);\n } else {\n resetItem();\n setIsFocused(false);\n setDragPosition({ x: 0, y: 0 });\n }\n }, 100);\n } else if (item) {\n let isTouch = false;\n if (\n !isContextMenuDisabled &&\n e.type === 'touchend' &&\n !isSelectingShortcut\n ) {\n isTouch = true;\n setIsTooltipMobileVisible(true);\n }\n\n if (!isContextMenuDisabled && !isSelectingShortcut && !isTouch) {\n setIsContextMenuVisible(!isContextMenuVisible);\n const event = e as MouseEvent;\n\n if (event.clientX && event.clientY) {\n setContextMenuPosition({\n x: event.clientX - 10,\n y: event.clientY - 5,\n });\n }\n }\n\n onPointerDown(item.type, containerType ?? null, item);\n }\n }}\n onStart={() => {\n if (!item || isSelectingShortcut) {\n return;\n }\n\n if (onDragStart && containerType) {\n onDragStart(item, slotIndex, containerType);\n }\n }}\n onDrag={(_e, data) => {\n if (\n Math.abs(data.x - dragPosition.x) > 5 ||\n Math.abs(data.y - dragPosition.y) > 5\n ) {\n setWasDragged(true);\n setIsFocused(true);\n }\n }}\n position={dragPosition}\n cancel=\".empty-slot\"\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 setTooltipVisible(true);\n }}\n onMouseLeave={() => {\n setTooltipVisible(false);\n }}\n >\n {onRenderSlot(item)}\n </ItemContainer>\n </Draggable>\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 setIsTooltipMobileVisible(false);\n }}\n scale={dragScale}\n options={contextActions}\n onSelected={(optionId: string) => {\n setIsContextMenuVisible(false);\n if (item) {\n onSelected?.(optionId, item);\n }\n }}\n />\n )}\n\n {!isContextMenuDisabled && isContextMenuVisible && contextActions && (\n <RelativeListMenu\n options={contextActions}\n onSelected={(optionId: string) => {\n setIsContextMenuVisible(false);\n if (item) {\n onSelected?.(optionId, item);\n }\n }}\n onOutsideClick={() => {\n setIsContextMenuVisible(false);\n }}\n pos={contextMenuPosition}\n />\n )}\n </Container>\n );\n }\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\ninterface ContainerTypes {\n item: IItem | null;\n isSelectingShortcut?: boolean;\n}\n\nconst Container = styled.div<ContainerTypes>`\n margin: 0.1rem;\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,\n}) => `0 0 4px 3px ${rarityColor(item)}`};\n //background-color: ${({ item }) => rarityColor(item)};\n }\n position: relative;\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: 100%;\n height: 100%;\n position: relative;\n\n ${props => props.isFocused && 'z-index: 100; pointer-events: none;'}\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 { 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, rarityColor } from '../Inventory/ItemSlot';\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, { 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 '../RPGUIContainer';\nimport { CraftingRecipe } from './CraftingRecipe';\n\nexport interface IItemCraftSelectorProps {\n atlasJSON: any;\n atlasIMG: any;\n onClose: () => void;\n onSelect: (value: string) => void;\n onCraftItem: (value: string | undefined) => 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\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 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 <hr className=\"golden\" />\n </div>\n\n <ContentContainer>\n <ItemTypes className=\"inputRadioCraftBook\">\n {renderItemTypes()}\n </ItemTypes>\n\n <RadioInputScroller className=\"inputRadioCraftBook\">\n {craftablesItems?.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}\n buttonType={ButtonTypes.RPGUIButton}\n onPointerDown={() => onCraftItem(craftItemKey)}\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","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}\n\nexport const Dropdown: React.FC<IDropdownProps> = ({\n options,\n width,\n onChange,\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 /**\n * make a selection if there is no selected value already present\n * or if there is a selected value but its not in new options\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 className=\"rpgui-dropdown-imp\" opened={opened}>\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}>`\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\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 {\n IEquipmentSet,\n IItem,\n IItemContainer,\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 { ItemSlot } from '../Item/Inventory/ItemSlot';\nimport { RPGUIContainerTypes } from '../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 onSelected={(optionId: string) => {\n if (onSelected) onSelected(optionId);\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 <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>{onRenderEquipmentSlotRange(0, 3)}</EquipmentColumn>\n <EquipmentColumn>{onRenderEquipmentSlotRange(3, 7)}</EquipmentColumn>\n <EquipmentColumn>{onRenderEquipmentSlotRange(7, 10)}</EquipmentColumn>\n </EquipmentSetContainer>\n </DraggableContainer>\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`;\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 { 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 }, 50);\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 '../RPGUIContainer';\nimport aliceDefaultThumbnail from './img/npcDialog/npcThumbnails/alice.png';\nimport pressSpaceGif from './img/space.gif';\nimport { NPCDialogText } from './NPCDialogText';\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, { 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}\n\nexport const RangeSlider: React.FC<IRangeSliderProps> = ({\n type,\n valueMin,\n valueMax,\n width,\n onChange,\n value,\n}) => {\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)) * (calculatedWidth - 35) +\n 10\n )\n );\n }, [value, valueMin, valueMax]);\n\n const typeClass = type === RangeSliderType.GoldSlider ? 'golden' : '';\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 onChange={e => onChange(Number(e.target.value))}\n value={value}\n className=\"rpgui-cursor-point\"\n />\n </div>\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 '../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}\n\nexport const ImageCarousel: React.FC<IImageCarouselProps> = ({\n textImage,\n isTextFixed,\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 </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: cover;\n width: 100%;\n height: ${props => (props.isTextFixed ? '80%' : '100%')};\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","import React from 'react';\nimport { IPosition } from '../../types/eventTypes';\nimport { DraggableContainer } from '../DraggableContainer';\nimport { RPGUIContainerTypes } from '../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}\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}) => {\n return (\n <DraggableContainer\n title={title}\n type={RPGUIContainerTypes.Framed}\n onCloseButton={() => {\n if (onClose) {\n onClose();\n }\n }}\n width=\"400px\"\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 { 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 { Input } from '../../Input';\nimport { RPGUIContainer, RPGUIContainerTypes } from '../../RPGUIContainer';\nimport { RangeSlider, RangeSliderType } from '../../RangeSlider';\n\nexport interface IItemQuantitySelectorProps {\n quantity: number;\n onConfirm: (quantity: number) => void;\n onClose: () => void;\n}\n\nexport const ItemQuantitySelector: React.FC<IItemQuantitySelectorProps> = ({\n quantity,\n onConfirm,\n onClose,\n}) => {\n const [value, setValue] = useState(quantity);\n\n const inputRef = useRef<HTMLInputElement>(null);\n\n useEffect(() => {\n if (inputRef.current) {\n inputRef.current.focus();\n inputRef.current.select();\n\n const closeSelector = (e: KeyboardEvent) => {\n if (e.key === 'Escape') {\n onClose();\n }\n };\n\n document.addEventListener('keydown', closeSelector);\n\n return () => {\n document.removeEventListener('keydown', closeSelector);\n };\n }\n\n return () => {};\n }, []);\n\n return (\n <StyledContainer type={RPGUIContainerTypes.Framed} width=\"25rem\">\n <CloseButton className=\"container-close\" onPointerDown={onClose}>\n X\n </CloseButton>\n <h2>Select quantity to move</h2>\n <StyledForm\n style={{ width: '100%' }}\n onSubmit={e => {\n e.preventDefault();\n\n const numberValue = Number(value);\n\n if (Number.isNaN(numberValue)) {\n return;\n }\n\n onConfirm(Math.max(1, Math.min(quantity, numberValue)));\n }}\n noValidate\n >\n <StyledInput\n innerRef={inputRef}\n placeholder=\"Enter quantity\"\n type=\"number\"\n min={1}\n max={quantity}\n value={value}\n onChange={e => {\n if (Number(e.target.value) >= quantity) {\n setValue(quantity);\n return;\n }\n\n setValue((e.target.value as unknown) as number);\n }}\n onBlur={e => {\n const newValue = Math.max(\n 1,\n Math.min(quantity, Number(e.target.value))\n );\n\n setValue(newValue);\n }}\n />\n <RangeSlider\n type={RangeSliderType.Slider}\n valueMin={1}\n valueMax={quantity}\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 display: flex;\n flex-direction: column;\n align-items: center;\n`;\n\nconst StyledForm = styled.form`\n display: flex;\n flex-direction: column;\n align-items: center;\n width: 100%;\n`;\nconst StyledInput = styled(Input)`\n text-align: center;\n\n &::-webkit-outer-spin-button,\n &::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n\n &[type='number'] {\n -moz-appearance: textfield;\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: 0.8rem;\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\n const payload = shortcuts[index]?.payload as IRawSpell | undefined;\n\n return <span>{payload?.magicWords.split(' ').map(word => word[0])}</span>;\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 padding-bottom: 1rem;\n`;\n","import {\n IEquipmentSet,\n IItem,\n IItemContainer,\n IShortcut,\n ItemContainerType,\n ItemType,\n} from '@rpg-engine/shared';\nimport React, { useState } from 'react';\nimport styled from 'styled-components';\nimport { SlotsContainer } from '../../Abstractions/SlotsContainer';\nimport { ItemQuantitySelector } from './ItemQuantitySelector';\n\nimport { IPosition } from '../../../types/eventTypes';\nimport ModalPortal from '../../Abstractions/ModalPortal';\nimport { ShortcutsSetter } from '../../Shortcuts/ShortcutsSetter';\nimport { ItemSlot } from './ItemSlot';\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}\n\nexport const ItemContainer: React.FC<IItemContainerProps> = ({\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}) => {\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 handleSetShortcut = (item: IItem, index: number) => {\n if (item.type === ItemType.Consumable || item.type === ItemType.Tool) {\n setItemShortcut?.(item.key, index);\n }\n };\n\n const onRenderSlots = () => {\n const slots = [];\n\n for (let i = 0; i < itemContainer.slotQty; i++) {\n slots.push(\n <ItemSlot\n isContextMenuDisabled={disableContextMenu}\n key={i}\n slotIndex={i}\n item={itemContainer.slots?.[i] || null}\n itemContainerType={type}\n onMouseOver={(event, slotIndex, item) => {\n if (onMouseOver) onMouseOver(event, slotIndex, item);\n }}\n onPointerDown={(itemType, containerType, item) => {\n if (settingShortcutIndex !== -1) {\n setSettingShortcutIndex(-1);\n\n handleSetShortcut(item, settingShortcutIndex);\n } else if (onItemClick) onItemClick(item, itemType, containerType);\n }}\n onSelected={(optionId: string, item: IItem) => {\n if (onSelected) onSelected(optionId, item);\n }}\n onDragStart={(item, slotIndex, itemContainerType) => {\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 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 onOutsideDrop={(item, position) => {\n if (onOutsideDrop) onOutsideDrop(item, position);\n }}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n isSelectingShortcut={settingShortcutIndex !== -1}\n equipmentSet={equipmentSet}\n setItemShortcut={\n type === ItemContainerType.Inventory ? handleSetShortcut : undefined\n }\n isDepotSystem={isDepotSystem}\n />\n );\n }\n return slots;\n };\n\n return (\n <>\n <SlotsContainer\n title={itemContainer.name || 'Container'}\n onClose={onClose}\n initialPosition={initialPosition}\n scale={scale}\n onPositionChangeEnd={onPositionChangeEnd}\n onPositionChangeStart={onPositionChangeStart}\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 className=\"item-container-body\">\n {onRenderSlots()}\n </ItemsContainer>\n </SlotsContainer>\n {quantitySelect.isOpen && (\n <ModalPortal>\n <QuantitySelectorContainer>\n <ItemQuantitySelector\n quantity={quantitySelect.maxQuantity}\n onConfirm={quantity => {\n quantitySelect.callback(quantity);\n setQuantitySelect({\n isOpen: false,\n maxQuantity: 1,\n callback: () => {},\n });\n }}\n onClose={() => {\n quantitySelect.callback(-1);\n setQuantitySelect({\n isOpen: false,\n maxQuantity: 1,\n callback: () => {},\n });\n }}\n />\n </QuantitySelectorContainer>\n </ModalPortal>\n )}\n </>\n );\n};\n\nconst ItemsContainer = styled.div`\n display: flex;\n justify-content: center;\n flex-wrap: wrap;\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 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\ninterface 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 { rarityColor } from '../Item/Inventory/ItemSlot';\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 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 <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 />\n </RarityContainer>\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 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 { 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 '../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';\nimport { uiColors } from '../../../constants/uiColors';\nimport { Button, ButtonTypes } from '../../Button';\nimport { DraggableContainer } from '../../DraggableContainer';\nimport { Input } from '../../Input';\nimport { RPGUIContainerTypes } from '../../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 '../../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 '../../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';\nimport { Button, ButtonTypes } from '../../Button';\n\nexport interface IPartyManagerRowProps {\n id: string;\n charName: string;\n charClass: string;\n isLeader: boolean;\n leaderId: 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 onRemovePlayer,\n onChangeLeader,\n}) => {\n return (\n <PartyWrapper>\n <TextContainer>{charName}</TextContainer>\n <TextContainer>{charClass}</TextContainer>\n <div className=\"cancel-button\">\n <Button\n buttonType={ButtonTypes.RPGUIButton}\n onPointerDown={() => onRemovePlayer(id)}\n >\n Remove\n </Button>\n </div>\n <Button\n buttonType={ButtonTypes.RPGUIButton}\n disabled={!isLeader || leaderId === id}\n onPointerDown={() => onChangeLeader(id)}\n >\n New Leader\n </Button>\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 { ICharacterPartyShared, isMobileOrTablet } from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../../constants/uiColors';\nimport { DraggableContainer } from '../../DraggableContainer';\nimport { RPGUIContainerTypes } from '../../RPGUIContainer';\nimport { PartyManagerRow } from './PartyManagerRows';\n\nexport interface IPartyManagerProps {\n partyRows: ICharacterPartyShared | null;\n isLeader: boolean;\n onClose?: () => void;\n onRemovePlayer: (id: string) => void;\n onChangeLeader: (id: string) => void;\n}\n\nexport const PartyManager: React.FC<IPartyManagerProps> = ({\n partyRows,\n isLeader,\n onClose,\n onRemovePlayer,\n onChangeLeader,\n}) => {\n const invitationActionText = isMobileOrTablet() ? 'Tap' : 'Right click';\n\n return (\n <DraggableContainer\n type={RPGUIContainerTypes.Framed}\n onCloseButton={onClose}\n width=\"800px\"\n height=\"400px\"\n cancelDrag=\".partyRows\"\n >\n <Wrapper>\n <div style={{ width: '100%' }}>\n <Title>Party Dashboard</Title>\n <hr className=\"golden\" />\n </div>\n </Wrapper>\n <RowsWrapper className=\"partyRows\">\n {partyRows && partyRows.members ? (\n <>\n <PartyManagerRow\n key={partyRows.leader._id}\n id={partyRows.leader._id}\n leaderId={partyRows.leader._id}\n charName={partyRows.leader.name}\n charClass={partyRows.leader.class}\n isLeader={true}\n onRemovePlayer={() => onRemovePlayer(partyRows.leader._id)}\n onChangeLeader={() => onChangeLeader(partyRows.leader._id)}\n />\n {partyRows.members.map(partyRow => (\n <PartyManagerRow\n key={partyRow._id}\n charName={partyRow.name}\n charClass={partyRow.class}\n id={partyRow._id}\n isLeader={isLeader}\n leaderId={partyRows.leader._id}\n onRemovePlayer={() => onRemovePlayer(partyRow._id)}\n onChangeLeader={() => onChangeLeader(partyRow._id)}\n />\n ))}\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 )}\n </RowsWrapper>\n </DraggableContainer>\n );\n};\nconst YellowText = styled.span`\n color: ${uiColors.yellow} !important;\n`;\n\nconst Wrapper = styled.div`\n display: flex;\n flex-direction: column;\n width: 100%;\n`;\n\nconst RowsWrapper = styled.div`\n width: 100%;\n`;\n\nconst Title = styled.h1`\n font-size: 0.6rem;\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 ],\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","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 '../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 } from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { uiFonts } from '../constants/uiFonts';\nimport { DraggableContainer } from './DraggableContainer';\nimport { RPGUIContainerTypes } from './RPGUIContainer';\n\nexport interface IQuestListProps {\n quests?: IQuest[];\n onClose: () => void;\n scale?: number;\n}\n\nexport const QuestList: React.FC<IQuestListProps> = ({\n quests,\n onClose,\n scale,\n}) => {\n return (\n <QuestDraggableContainer\n type={RPGUIContainerTypes.Framed}\n onCloseButton={() => {\n if (onClose) onClose();\n }}\n width=\"520px\"\n scale={scale}\n >\n <div style={{ width: '100%' }}>\n <Title>Quests</Title>\n <hr className=\"golden\" />\n\n <QuestListContainer>\n {quests ? (\n quests.map((quest, i) => (\n <div className=\"quest-item\" key={i}>\n <span className=\"quest-number\">{i + 1}</span>\n <div className=\"quest-detail\">\n <p className=\"quest-detail__title\">{quest.title}</p>\n <p className=\"quest-detail__description\">\n {quest.description}\n </p>\n </div>\n </div>\n ))\n ) : (\n <NoQuestContainer>\n <p>There are no ongoing quests</p>\n </NoQuestContainer>\n )}\n </QuestListContainer>\n </div>\n </QuestDraggableContainer>\n );\n};\n\nconst QuestDraggableContainer = styled(DraggableContainer)`\n .container-close {\n top: 10px;\n right: 10px;\n }\n\n .quest-title {\n text-align: left;\n margin-left: 44px;\n margin-top: 20px;\n color: yellow;\n }\n\n .quest-desc {\n margin-top: 12px;\n margin-left: 44px;\n }\n\n .rpgui-progress {\n min-width: 80%;\n margin: 0 auto;\n }\n`;\n\nconst Title = styled.h1`\n z-index: 22;\n font-size: ${uiFonts.size.medium} !important;\n color: yellow !important;\n`;\n\nconst QuestListContainer = styled.div`\n margin-top: 20px;\n margin-bottom: 40px;\n overflow-y: auto;\n max-height: 400px;\n\n .quest-item {\n display: flex;\n align-items: flex-start;\n margin-bottom: 12px;\n }\n\n .quest-number {\n border-radius: 50%;\n width: 28px;\n height: 28px;\n display: flex;\n align-items: center;\n justify-content: center;\n margin-right: 16px;\n background-color: brown;\n flex-shrink: 0;\n }\n\n .quest-number.completed {\n background-color: yellow;\n }\n\n p {\n margin: 0;\n }\n\n .quest-detail__title {\n color: yellow;\n }\n\n .quest-detail__description {\n margin-top: 5px;\n }\n .Noquest-detail__description {\n margin-top: 5px;\n margin: auto;\n }\n`;\nconst NoQuestContainer = styled.div`\n text-align: center;\n p {\n margin-top: 5px;\n }\n`;\n","import React from 'react';\nimport 'rpgui/rpgui.min.css';\nimport 'rpgui/rpgui.min.js';\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 <div className=\"rpgui-content\">{children}</div>;\n};\n","import {\n getItemTextureKeyPath,\n IItem,\n IItemContainer,\n IRawSpell,\n IShortcut,\n ShortcutType,\n} from '@rpg-engine/shared';\nimport React, { 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 useEffect(() => {\n const handleKeyDown = (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 setTimeout(() => {\n shortcutsRefs.current[shortcutIndex]?.classList.remove('active');\n }, 150);\n }\n };\n\n window.addEventListener('keydown', handleKeyDown);\n\n return () => {\n window.removeEventListener('keydown', handleKeyDown);\n };\n }, [shortcuts, isBlockedCastingByKeyboard, shortcutCooldown]);\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 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 className={buildClassName('mana', isOnCooldown)}>\n {payload && payload.manaCost}\n </span>\n <span className=\"magicWords\">\n {payload?.magicWords.split(' ').map(word => word[0])}\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 return (\n <Container className=\"simple-progress-bar\">\n <ProgressBarContainer margin={margin}>\n <BackgroundBar>\n <Progress value={value} 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 ISimpleProgressBarThemeProps {\n value: number;\n bgColor: string;\n}\n\nconst Progress = styled.span`\n background-color: ${(props: ISimpleProgressBarThemeProps) => props.bgColor};\n width: ${(props: ISimpleProgressBarThemeProps) => props.value}%;\n`;\n\ninterface ISimpleProgressBarTheme2Props {\n margin: number;\n}\n\nconst ProgressBarContainer = styled.div`\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: ISimpleProgressBarTheme2Props) => props.margin}px;\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 { SimpleProgressBar } from './SimpleProgressBar';\nimport { SpriteFromAtlas } from './shared/SpriteFromAtlas';\n\nexport interface ISkillProgressBarProps {\n skillName: string;\n bgColor: string;\n level: number;\n skillPoints: number;\n skillPointsToNextLevel?: number;\n texturePath: string;\n showSkillPoints?: boolean;\n atlasJSON: any;\n atlasIMG: any;\n buffAndDebuff?: number;\n ratio: number;\n}\n\nexport const SkillProgressBar: React.FC<ISkillProgressBarProps> = ({\n bgColor,\n skillName,\n level,\n skillPoints,\n skillPointsToNextLevel,\n texturePath,\n showSkillPoints = true,\n atlasIMG,\n atlasJSON,\n buffAndDebuff,\n ratio,\n}) => {\n if (!skillPointsToNextLevel) {\n skillPointsToNextLevel = getSPForLevel(level + 1);\n }\n\n const skillsBuffsCalc = (level: number, buffAndDebuff: number): string => {\n const result = level * (buffAndDebuff / 100);\n\n if (result > 0) {\n return `+${result.toFixed(2)}`;\n } else {\n return `${result.toFixed(2)}`;\n }\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>(+{buffAndDebuff}%)</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>({buffAndDebuff}%)</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 <ProgressBarContainer>\n <SimpleProgressBar value={ratio} bgColor={bgColor} />\n </ProgressBarContainer>\n </ProgressBody>\n {showSkillPoints && (\n <SkillDisplayContainer>\n <SkillPointsDisplay>\n {skillPoints}/{skillPointsToNextLevel}\n </SkillPointsDisplay>\n </SkillDisplayContainer>\n )}\n </>\n );\n};\n\nconst ProgressBarContainer = styled.div`\n position: relative;\n top: 8px;\n width: 100%;\n height: auto;\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.6rem !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: 'spell-icons/regenerate.png',\n magic: 'spell-icons/fireball.png',\n magicResistance: 'spell-icons/freeze.png',\n strength: 'spell-icons/enchanted-blow.png',\n resistance: 'spell-icons/magic-shield.png',\n dexterity: 'spell-icons/haste.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 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 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 SPRatio = (level: number, skillPoints: number) => {\n const SPLevelActual = getSPForLevel(level + 1);\n const SPLevelBefore = getSPForLevel(level);\n const SPCalc = SPLevelActual - SPLevelBefore;\n if (level === 1) {\n return (skillPoints / SPLevelActual) * 100;\n }\n return ((skillPoints - SPLevelBefore) / SPCalc) * 100;\n };\n\n const XPRatio = (level: number, skillPoints: number) => {\n const XPLevelActual = getXPForLevel(level + 1);\n const XPLevelBefore = getXPForLevel(level);\n const XPCalc = XPLevelActual - XPLevelBefore;\n if (level === 1) {\n return (skillPoints / XPLevelActual) * 100;\n }\n return ((skillPoints - XPLevelBefore) / XPCalc) * 100;\n };\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 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 ratio={SPRatio(skillDetails.level, skillDetails.skillPoints)}\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 ratio={XPRatio(skill.level, skill.experience)}\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, { 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}\n\nexport const SpellInfoWrapper: React.FC<ISpellInfoWrapperProps> = ({\n children,\n spell,\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 <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};\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 { SpellInfoWrapper } from './cards/SpellInfoWrapper';\n\nexport interface ISpellProps {\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 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 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 {magicWords.split(' ').map(word => word[0])}\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 '../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 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 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 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 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 scale={scale}>\n <WidgetContainer>\n <CloseButton onPointerDown={onClose}>X</CloseButton>\n <DayNightContainer>\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 {\n getItemTextureKeyPath,\n IEquipmentSet,\n ITradeResponseItem,\n} from '@rpg-engine/shared';\nimport capitalize from 'lodash/capitalize';\nimport React 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';\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}\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}) => {\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 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.5}\n />\n </ItemInfoWrapper>\n </SpriteContainer>\n </ItemIconContainer>\n\n <ItemNameContainer>\n <NameValue>\n <p>\n <Ellipsis maxLines={1} maxWidth=\"250px\">\n {capitalize(traderItem.name)}\n </Ellipsis>\n </p>\n <p>${traderItem.price}</p>\n </NameValue>\n </ItemNameContainer>\n <QuantityContainer>\n <SelectArrow\n size={32}\n className=\"arrow-selector\"\n direction=\"left\"\n onPointerDown={onLeftClick.bind(null, outerQty)}\n />\n <StyledArrow\n size={32}\n className=\"arrow-selector\"\n direction=\"left\"\n onPointerDown={onLeftClick}\n />\n <QuantityDisplay>\n <TextOverlay>\n <Item>{selectedQty}</Item>\n </TextOverlay>\n </QuantityDisplay>\n <StyledArrow\n size={32}\n className=\"arrow-selector\"\n direction=\"right\"\n onPointerDown={onRightClick}\n />\n <SelectArrow\n size={32}\n className=\"arrow-selector\"\n direction=\"right\"\n onPointerDown={onRightClick.bind(null, outerQty)}\n />\n </QuantityContainer>\n </ItemWrapper>\n );\n};\n\nconst StyledArrow = styled(SelectArrow)`\n margin: 40px;\n`;\n\nconst ItemWrapper = styled.div`\n width: 100%;\n margin: auto;\n display: flex;\n justify-content: space-between;\n margin-bottom: 1rem;\n\n &:hover {\n background-color: ${uiColors.darkGray};\n }\n padding: 0.5rem;\n`;\n\nconst ItemNameContainer = styled.div`\n flex: 60%;\n`;\n\nconst ItemIconContainer = styled.div`\n display: flex;\n justify-content: flex-start;\n align-items: center;\n\n flex: 0 0 58px;\n`;\n\nconst SpriteContainer = styled.div`\n position: relative;\n top: -0.5rem;\n left: 0.5rem;\n`;\n\nconst NameValue = styled.div`\n p {\n font-size: 0.75rem;\n margin: 0;\n }\n`;\n\nconst Item = styled.span`\n color: white;\n text-align: center;\n z-index: 1;\n\n width: 100%;\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 QuantityContainer = styled.div<IContainerProps>`\n position: relative;\n display: flex;\n\n min-width: 100px;\n width: 40%;\n justify-content: center;\n align-items: center;\n\n flex: 40%;\n`;\n\nconst QuantityDisplay = styled.div`\n font-size: ${uiFonts.size.small};\n`;\n","import {\n IEquipmentSet,\n ITradeRequestItem,\n ITradeResponseItem,\n TradeTransactionType,\n} from '@rpg-engine/shared';\nimport React, { useState } from 'react';\nimport styled from 'styled-components';\nimport { Button, ButtonTypes } from '../Button';\nimport { DraggableContainer } from '../DraggableContainer';\nimport { RPGUIContainerTypes } from '../RPGUIContainer';\nimport { TradingItemRow } from './TradingItemRow';\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 [sum, setSum] = useState(0);\n const [qtyMap, setQtyMap] = useState(new Map());\n\n const onQuantityChange = (item: ITradeResponseItem, selectedQty: number) => {\n setQtyMap(new Map(qtyMap.set(item.key, selectedQty)));\n\n let newSum = 0;\n traderItems.forEach(item => {\n const qty = qtyMap.get(item.key);\n if (qty) newSum += qty * item.price;\n setSum(newSum);\n });\n };\n\n const isBuy = () => {\n return type == 'buy';\n };\n\n const hasGoldForSale = () => {\n if (isBuy()) {\n return !(sum > characterAvailableGold);\n }\n return true;\n };\n\n const getFinalGold = () => {\n if (isBuy()) {\n return characterAvailableGold - sum;\n } else {\n return characterAvailableGold + sum;\n }\n };\n\n const Capitalize = (word: string) => {\n return word[0].toUpperCase() + word.substring(1);\n };\n\n const onConfirmClick = () => {\n const items: ITradeRequestItem[] = [];\n\n traderItems.forEach(item => {\n const qty = qtyMap.get(item.key);\n if (qty) {\n items.push(Object.assign({}, item, { qty: qty }));\n }\n });\n\n onConfirm(items);\n };\n\n return (\n <DraggableContainer\n type={RPGUIContainerTypes.Framed}\n onCloseButton={() => {\n if (onClose) onClose();\n }}\n width=\"600px\"\n cancelDrag=\"#TraderContainer\"\n scale={scale}\n >\n <>\n <div style={{ width: '100%' }}>\n <Title>{Capitalize(type)} Menu</Title>\n <hr className=\"golden\" />\n </div>\n <TradingComponentScrollWrapper id=\"TraderContainer\">\n {traderItems.map((tradeItem, index) => (\n <ItemWrapper key={`${tradeItem.key}_${index}`}>\n <TradingItemRow\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n onQuantityChange={onQuantityChange}\n traderItem={tradeItem}\n selectedQty={qtyMap.get(tradeItem.key) ?? 0}\n equipmentSet={equipmentSet}\n scale={scale}\n />\n </ItemWrapper>\n ))}\n </TradingComponentScrollWrapper>\n <GoldWrapper>\n <p>Available Gold:</p>\n <p>${characterAvailableGold}</p>\n </GoldWrapper>\n <TotalWrapper>\n <p>Total:</p>\n <p>${sum}</p>\n </TotalWrapper>\n {!hasGoldForSale() ? (\n <AlertWrapper>\n <p> Sorry, not enough money.</p>\n </AlertWrapper>\n ) : (\n <GoldWrapper>\n <p>Final Gold:</p>\n <p>${getFinalGold()}</p>\n </GoldWrapper>\n )}\n\n <ButtonWrapper>\n <Button\n buttonType={ButtonTypes.RPGUIButton}\n disabled={!hasGoldForSale()}\n onPointerDown={() => onConfirmClick()}\n >\n Confirm\n </Button>\n <Button\n buttonType={ButtonTypes.RPGUIButton}\n onPointerDown={() => onClose()}\n >\n Cancel\n </Button>\n </ButtonWrapper>\n </>\n </DraggableContainer>\n );\n};\n\nconst Title = styled.h1`\n z-index: 22;\n font-size: 0.6rem;\n color: yellow !important;\n`;\n\nconst TradingComponentScrollWrapper = styled.div`\n overflow-y: scroll;\n height: 390px;\n width: 100%;\n margin-top: 1rem;\n`;\n\nconst ItemWrapper = styled.div`\n margin: auto;\n display: flex;\n justify-content: space-between;\n`;\n\nconst TotalWrapper = styled.div`\n margin-top: 1rem;\n display: flex;\n justify-content: space-between;\n height: 20px;\n p {\n color: white !important;\n }\n width: 100%;\n margin-left: 0.8rem;\n`;\n\nconst GoldWrapper = styled.div`\n margin-top: 1rem;\n display: flex;\n justify-content: space-between;\n height: 20px;\n p {\n color: yellow !important;\n }\n width: 100%;\n margin-left: 0.8rem;\n`;\n\nconst AlertWrapper = styled.div`\n margin-top: 1rem;\n display: flex;\n width: 100%;\n justify-content: center;\n height: 20px;\n p {\n color: red !important;\n }\n`;\n\nconst ButtonWrapper = styled.div`\n display: flex;\n justify-content: space-around;\n padding-top: 20px;\n width: 100%;\n margin-top: 1rem;\n button {\n padding: 0px 50px;\n }\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, { useEffect, useState } from 'react';\nimport styled from 'styled-components';\nimport { Button, ButtonTypes } from '../Button';\nimport { DraggableContainer } from '../DraggableContainer';\nimport { RPGUIContainerTypes } from '../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 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, { 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"],"names":["ButtonTypes","RPGUIContainerTypes","Button","disabled","children","buttonType","onPointerDown","props","React","ButtonContainer","className","styled","button","displayName","componentId","SpriteFromAtlas","atlasJSON","atlasIMG","spriteKey","_ref$width","width","GRID_WIDTH","_ref$height","height","GRID_HEIGHT","_ref$imgScale","imgScale","imgStyle","containerStyle","_ref$grayScale","grayScale","_ref$opacity","opacity","imgClassname","spriteData","frames","Error","Container","hasHover","style","ImgSprite","frame","scale","div","w","h","x","y","ErrorBoundary","args","_this","state","hasError","getDerivedStateFromError","_","_proto","componentDidCatch","error","errorInfo","console","render","this","Component","SelectArrow","direction","size","LeftArrow","RightArrow","span","Ellipsis","maxWidth","fontSize","center","maxLines","PropertySelect","item","availableProperties","onChange","useState","currentIndex","setCurrentIndex","propertiesLength","length","useEffect","JSON","stringify","TextOverlay","Item","name","index","Column","flex","flexWrap","alignItems","justifyContent","ChatContainer","TextField","input","MessagesContainer","Message","color","Form","form","buttonColor","buttonBackgroundColor","Input","rest","ref","innerRef","RPGUIContainer","type","CloseButton","CustomInput","CustomContainer","MessageText","p","SingleShortcut","useShortcutCooldown","onShortcutCast","shortcutCooldown","setShortcutCooldown","cooldownTimeout","useRef","current","clearTimeout","setTimeout","handleShortcutCast","CancelButton","ButtonsContainer","ShortcutsContainer","StyledShortcut","useOutsideClick","id","handleClickOutside","event","contains","target","CustomEvent","detail","document","dispatchEvent","addEventListener","removeEventListener","NPCDialogType","DraggableContainer","_ref$type","FramedGold","onCloseButton","title","imgSrc","_ref$imgWidth","imgWidth","cancelDrag","onPositionChange","onPositionChangeEnd","onPositionChangeStart","onOutsideClick","_ref$initialPosition","initialPosition","_ref$dragDisabled","dragDisabled","draggableRef","_e","Draggable","cancel","onDrag","data","onStop","onStart","defaultPosition","TitleContainer","Title","Icon","src","h1","img","InputRadio","label","value","onRadioSelect","onPointerUp","checked","isChecked","readOnly","countItemFromInventory","itemKey","inventory","itemsFromInventory","Object","keys","slots","forEach","i","parseInt","_inventory$slots$inde","key","push","reduce","acc","stackQty","modalRoot","getElementById","ModalPortal","ReactDOM","createPortal","RelativeListMenu","options","onSelected","_ref$fontSize","pos","overflow","map","params","ListElement","text","li","MobileItemTooltip","closeTooltip","equipmentSet","_ref$scale","handleFadeOut","_ref$current","classList","add","onTouchEnd","ItemInfoDisplay","isMobile","OptionsContainer","option","Option","generateContextMenuListOptions","actionsByTypeList","action","ItemSocketEventsDisplayLabels","EquipmentSlotSpriteByType","Neck","LeftHand","Ring","Head","Torso","Legs","Feet","Inventory","RightHand","Accessory","ItemSlot","observer","slotIndex","containerType","itemContainerType","slotSpriteMask","onMouseOver","onMouseOut","_ref$isContextMenuDis","isContextMenuDisabled","onDragEnd","onDragStart","onPlaceDrop","onDrop","onOutsideDrop","checkIfItemCanBeMoved","openQuantitySelector","checkIfItemShouldDragEnd","dragScale","isSelectingShortcut","setItemShortcut","isDepotSystem","isTooltipVisible","setTooltipVisible","isTooltipMobileVisible","setIsTooltipMobileVisible","isContextMenuVisible","setIsContextMenuVisible","contextMenuPosition","setContextMenuPosition","isFocused","setIsFocused","wasDragged","setWasDragged","dragPosition","setDragPosition","dropPosition","setDropPosition","dragContainer","contextActions","setContextActions","contextActionMenu","ItemContainerType","ItemType","Weapon","Armor","Jewelry","ActionsForInventory","Equipment","Consumable","CraftingResource","Tool","Other","DepotSocketEvents","Deposit","ActionsForEquipmentSet","Loot","ActionsForLoot","MapContainer","ActionsForMapContainer","contextActionMenuDontHaveUseWith","find","toLowerCase","includes","hasUseWith","Depot","ItemSocketEvents","GetItemInfo","Withdraw","generateContextMenu","getStackInfo","itemId","qtyClassName","ItemQtyContainer","ItemQty","Math","round","resetItem","onSuccesfulDrag","quantity","onMouseUp","e","changedTouches","clientX","clientY","simulatedEvent","MouseEvent","bubbles","elementFromPoint","_document$elementFrom","undefined","axis","defaultClassName","split","isNaN","classes","Array","from","_e$target","some","elm","window","getComputedStyle","matrix","DOMMatrixReadOnly","transform","m41","m42","isTouch","abs","position","ItemContainer","onMouseEnter","onMouseLeave","itemToRender","texturePath","allowedEquipSlotType","_itemToRender$allowed","element","_id","getItemTextureKeyPath","isStackable","stackInfo","uuidv4","renderEquipment","renderItem","onRenderSlot","ItemTooltip","optionId","rarityColor","rarity","ItemRarities","Uncommon","Rare","Epic","Legendary","statisticsToDisplay","higherIsWorse","ItemInfo","itemToCompare","renderMissingStatistic","statistics","stat","itemToCompareStatistic","toUpperCase","slice","Statistic","toString","skillName","minRequirements","_item$minRequirements","skill","_item$minRequirements2","Header","Rarity","Type","subType","AllowedSlots","slotType","LevelRequirement","_item$minRequirements3","level","charAt","_item$minRequirements4","_item$minRequirements5","itemStatistic","isItemToCompare","isOnlyInOneItem","statDiff","_itemToCompare$stat$k2","isDifference","isBetter","renderStatistics","entityEffects","entityEffectChance","effect","usableEffectDescription","equippedBuffDescription","isTwoHanded","Description","description","maxStackSize","StackInfo","MissingStatistics","$isSpecial","itemSlotTypes","useMemo","_item$allowedEquipSlo","allowedSlotTypeCamelCase","camelCase","itemSubTypeCamelCase","getSlotType","itemFromEquipment","values","Flex","CompareContainer","Equipped","$isMobile","handleMouseMove","rect","getBoundingClientRect","tooltipWidth","tooltipHeight","isOffScreenRight","innerWidth","isOffScreenBottom","innerHeight","ItemInfoWrapper","setIsTooltipVisible","bind","log","CraftingRecipe","recipe","handleRecipeSelect","selectedCraftItemKey","skills","modifyString","str","parts","words","replace","concat","join","levelInSkill","minCraftingRequirements","_recipe$minCraftingRe2","_skills","RadioOptionsWrapper","SpriteAtlasWrapper","canCraft","display","MinCraftingRequirementsText","levelIsOk","_recipe$minCraftingRe4","_recipe$minCraftingRe6","ingredients","ingredient","itemQtyInInventory","Recipe","Ingredient","isQuantityOk","qty","desktop","mobileLanscape","mobilePortrait","Wrapper","Subtitle","RadioInputScroller","ButtonWrapper","ContentContainer","ItemTypes","Dropdown","dropdownId","selectedValue","setSelectedValue","selectedOption","setSelectedOption","opened","setOpened","firstOption","change","filter","o","DropdownSelect","prev","DropdownOptions","ul","Details","EquipmentSetContainer","EquipmentColumn","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","RangeSliderType","NPCMultiDialog","textAndTypeArray","slide","setSlide","_textAndTypeArray$sli","imageSide","BackgroundContainer","imgPath","DialogContainer","CarouselWrapper","ArrowContainer","BackgroundImage","isTextFixed","textPosition","SlotsContainer","Framed","OrderByType","RangeSlider","valueMin","valueMax","sliderId","containerRef","left","setLeft","calculatedWidth","_containerRef$current","clientWidth","max","typeClass","GoldSlider","pointerEvents","min","Number","ItemQuantitySelector","onConfirm","setValue","inputRef","focus","select","closeSelector","StyledContainer","StyledForm","onSubmit","preventDefault","numberValue","noValidate","StyledInput","placeholder","onBlur","newValue","Slider","RPGUIButton","ShortcutsSetter","setSettingShortcutIndex","settingShortcutIndex","shortcuts","removeShortcut","List","Shortcut","ShortcutType","None","isBeingSet","_shortcuts$index","payload","_shortcuts$index2","_shortcuts$index3","magicWords","word","getContent","ItemsContainer","QuantitySelectorContainer","Pager","totalItems","currentPage","onPageChange","totalPages","ceil","itemsPerPage","PagerContainer","ConfirmModal","message","Background","stopPropagation","ButtonsWrapper","MarketplaceRows","itemPrice","onMarketPlaceItemBuy","onMarketPlaceItemRemove","MarketplaceWrapper","ItemIconContainer","SpriteContainer","RarityContainer","QuantityContainer","PriceValue","GoldContainer","itemTypeOptions","ItemSubType","itemType","itemRarityOptions","itemRarity","orderByOptions","flatMap","orderBy","BuyPanel","items","onChangeType","onChangeRarity","onChangeOrder","onChangeNameInput","onChangeMainLevelInput","onChangeSecondaryLevelInput","onChangePriceInput","characterId","enableHotkeys","disableHotkeys","setName","mainLevel","setMainLevel","secondaryLevel","setSecondaryLevel","price","setPrice","buyingItemId","setBuyingItemId","itemsContainer","_itemsContainer$curre","scrollTo","InputWrapper","onFocus","OptionsWrapper","FilterInputsWrapper","AiFillCaretRight","WrapperContainer","StyledDropdown","ItemComponentScrollWrapper","owner","ManagmentPanel","availableGold","selectedItemToSell","onSelectedItemToSellRemove","onAddItemToMarketplace","onMoneyWithdraw","isCreatingOffer","setIsCreatingOffer","removingItemId","setRemovingItemId","InnerOptionsWrapper","SellDescription","__","PriceInputWrapper","AvailableGold","$disabled","PartyRow","charName","charClass","charLevel","playerQty","isInvited","PartyWrapper","partyName","RowsWrapper","PlayersRow","isNotInvited","PartyManagerRow","isLeader","leaderId","onRemovePlayer","onChangeLeader","YellowText","NotInParty","mockedPartyRows","mockedPlayersRows2","leader","class","CharacterClass","Druid","members","maxSize","mockedPlayersRows","mockedPartyManager","ProgressBarText","minWidth","percentageWidth","mobileScale","QuestDraggableContainer","QuestContainer","QuestsContainer","Content","QuestSplitDiv","QuestColumn","Thumbnail","QuestListContainer","NoQuestContainer","_RPGUI","RPGUI","SimpleProgressBar","_ref$bgColor","bgColor","_ref$margin","margin","ProgressBarContainer","BackgroundBar","Progress","SkillProgressBar","skillPoints","skillPointsToNextLevel","_ref$showSkillPoints","showSkillPoints","buffAndDebuff","ratio","getSPForLevel","skillsBuffsCalc","result","toFixed","ProgressTitle","BuffAndDebuffContainer","TitleNameContainer","TitleNameBuff","TitleNameBuffContainer","TitleNameDebuff","TitleName","ValueDisplay","ProgressBody","ProgressIconContainer","SkillDisplayContainer","SkillPointsDisplay","skillProps","attributes","stamina","magic","magicResistance","strength","resistance","dexterity","combat","first","club","sword","axe","distance","shielding","dagger","crafting","fishing","mining","lumberjacking","blacksmithing","cooking","alchemy","skillNameMap","SkillsDraggableContainer","SkillsContainerDiv","SkillSplitDiv","SpellInfo","spell","manaCost","requiredItem","castingType","cooldown","maxDistanceGrid","formatSpellCastingType","SpellInfoDisplay","MobileSpellTooltip","MagicTooltip","SpellInfoWrapper","Spell","charMana","charMagicLevel","isSettingShortcut","activeCooldown","minMagicLevelRequired","spellKey","Overlay","SpellImage","Info","Divider","Cost","SpellList","DayNightPeriod","periodOfDay","periodOfDaySrcFiles","PeriodOfDay","Morning","Afternoon","Night","GifContainer","WidgetContainer","Time","DayNightContainer","TradingItemRow","onQuantityChange","traderItem","selectedQty","onLeftClick","onRightClick","ItemWrapper","ItemNameContainer","NameValue","capitalize","StyledArrow","QuantityDisplay","TradingComponentScrollWrapper","TotalWrapper","GoldWrapper","AlertWrapper","availableCharacters","propertySelectValues","textureKey","selectedSpriteKey","setSelectedSpriteKey","paddingBottom","chatMessages","onSendChatMessage","_ref$styles","styles","textColor","setMessage","scrollChatToBottom","scrollingElement","querySelector","scrollTop","scrollHeight","fallback","emitter","createdAt","dayjs","Date","format","onRenderMessageLines","onRenderChatMessages","trim","autoComplete","autoFocus","borderRadius","RxPaperPlane","FramedGrey","selectedValues","generateSelectedValuesList","setSelectedValues","onActionClick","onCancelClick","mana","spellCooldowns","onShortcutClick","onTouchStart","remove","buildClassName","classBase","isOnCooldown","variant","onShortcutClickBinded","_shortcuts$i","isOnShortcutCooldown","_shortcuts$i2","_shortcuts$i3","itemsFromEquipment","totalQty","_shortcuts$i4","spellCooldown","replaceAll","renderShortcut","onSelect","onCraftItem","craftablesItems","savedSelectedType","craftItemKey","setCraftItemKey","selectedType","setSelectedType","setSize","handleResize","itemTypes","sort","a","b","localeCompare","rows","row","gap","renderItemTypes","details","onItemClick","onItemDragEnd","onItemDragStart","onItemPlaceDrop","onItemOutsideDrop","equipmentData","neck","leftHand","ring","head","armor","legs","boot","rightHand","accessory","equipmentMaskSlots","ItemSlotType","onRenderEquipmentSlotRange","start","end","equipmentRange","slotMaksRange","itemContainer","ContainerType","backgroundImgPath","fullCoverBackground","setImage","fullImg","textImage","textImageSelected","setTextImageSelected","goToPreviousImage","indexOf","goToNextImage","image","handleClick","_ref$disableContextMe","disableContextMenu","isOpen","maxQuantity","callback","_quantity","quantitySelect","setQuantitySelect","handleSetShortcut","slotQty","_itemContainer$slots","onRenderSlots","imageKey","onYourPanelToggle","isYourPanel","setIsYourPanel","onCreate","close","partyRows","playersRows","invitationActionText","partyRow","_ref$displayText","displayText","_ref$percentageWidth","_ref$minWidth","calculatePercentageValue","quests","buttons","onChangeQuest","questsLength","thumbnail","thumbnailDefault","onClick","npcId","quest","_ref$isBlockedCasting","isBlockedCastingByKeyboard","shortcutsRefs","handleKeyDown","shortcutIndex","_shortcutsRefs$curren","_shortcutsRefs$curren2","XPLevelActual","XPLevelBefore","onRenderSkillCategory","category","SPLevelActual","SPLevelBefore","skillCategory","skillCategoryColor","output","entries","skillDetails","experience","getXPForLevel","onInputFocus","onInputBlur","spells","magicLevel","onSpellClick","setSpellShortcut","search","setSearch","spellsToDisplay","toLocaleLowerCase","setShortcut","Fragment","TimeClock","traderItems","characterAvailableGold","sum","setSum","Map","qtyMap","setQtyMap","set","newSum","get","isBuy","hasGoldForSale","tradeItem","assign"],"mappings":"+lCAAO,ICIKA,0DAAAA,EAAAA,sBAAAA,oDAEVA,4CCHUC,EDcCC,EAAS,oBACpBC,SAAAA,gBACAC,IAAAA,SACAC,IAAAA,WACAC,IAAAA,cACGC,SAEH,OACEC,gBAACC,iBACCC,aAAcL,EACdF,SAAUA,GACNI,GACJD,cAAeA,IAEfE,yBAAIJ,KAKJK,EAAkBE,EAAOC,mBAAMC,sCAAAC,2BAAbH,gCDhCb,QGeEI,EAAoC,gBAC/CC,IAAAA,UACAC,IAAAA,SACAC,IAAAA,U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AkBA,EAClBC,WAAY+M,EACZ9M,qBAAauM,EAAOI,IAAIG,EAAUp4B,QAAQ,EAC1CuB,aAAcA,EACdhL,MAAOA,SAKflC,gBAAC43B,QACC53B,4CACAA,6BAAKojC,IAEPpjC,gBAAC23B,QACC33B,mCACAA,6BAAKqjC,IAELS,IAKA9jC,gBAAC43B,QACC53B,wCACAA,6BArEJ6jC,IACKT,EAAyBC,EAEzBD,EAAyBC,IA4D5BrjC,gBAAC63B,QACC73B,uDASJA,gBAACqe,QACCre,gBAACN,GACCG,WAAYL,oBAAYwoB,YACxBroB,UAAWmkC,IACXhkC,cAAe,WAAA,OAjEjBurB,EAA6B,GAEnC8X,EAAY53B,SAAQ,SAAApH,GAClB,IAAM2Z,EAAM0lB,EAAOI,IAAIz/B,EAAKwH,KACxBmS,GACFuN,EAAMzf,KAAKR,OAAO44B,OAAO,GAAI7/B,EAAM,CAAE2Z,IAAKA,aAI9CiJ,EAAUsE,GAVW,IACfA,eAqEArrB,gBAACN,GACCG,WAAYL,oBAAYwoB,YACxBloB,cAAe,WAAA,OAAM2gB,qCCxIS,oBAAGxc,SAC3C,OAAOjE,gBAAC6B,IAAUoC,oBADoC,OAAGrE"}
|
|
1
|
+
{"version":3,"file":"long-bow.cjs.production.min.js","sources":["../src/constants/uiFonts.ts","../src/components/Button.tsx","../src/components/RPGUIContainer.tsx","../src/components/shared/SpriteFromAtlas.tsx","../src/components/Item/Inventory/ErrorBoundary.tsx","../src/components/Arrow/SelectArrow.tsx","../src/components/shared/Ellipsis.tsx","../src/components/PropertySelect/PropertySelect.tsx","../src/components/Character/CharacterSelection.tsx","../src/components/shared/Column.tsx","../src/components/Chat/Chat.tsx","../src/components/Input.tsx","../src/components/Chatdeprecated/ChatDeprecated.tsx","../src/constants/uiColors.ts","../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/RelativeListMenu.tsx","../src/components/Item/Cards/MobileItemTooltip.tsx","../src/components/Item/Inventory/itemContainerHelper.ts","../src/components/Item/Inventory/ItemSlot.tsx","../src/components/Item/Cards/ItemInfo.tsx","../src/components/Item/Cards/ItemInfoDisplay.tsx","../src/components/Item/Cards/ItemTooltip.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/Equipment/EquipmentSet.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/Abstractions/SlotsContainer.tsx","../src/components/Marketplace/filters/index.tsx","../src/components/Item/Inventory/ItemQuantitySelector.tsx","../src/components/Shortcuts/ShortcutsSetter.tsx","../src/components/Item/Inventory/ItemContainer.tsx","../src/components/ListMenu.tsx","../src/components/Pager.tsx","../src/components/ConfirmModal.tsx","../src/components/Marketplace/MarketplaceRows.tsx","../src/components/Marketplace/BuyPanel.tsx","../src/components/Marketplace/ManagmentPanel.tsx","../src/components/Marketplace/Marketplace.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/PartySystem/PartyManager/PartyManagerRows.tsx","../src/components/PartySystem/PartyManager/PartyManager.tsx","../src/components/PartySystem/mockedConstantes/mockedValues.tsx","../src/components/ProgressBar.tsx","../src/components/QuestInfo/QuestInfo.tsx","../src/components/QuestList.tsx","../src/components/RPGUIRoot.tsx","../src/components/Shortcuts/Shortcuts.tsx","../src/components/SimpleProgressBar.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/TimeWidget/DayNightPeriod/DayNightPeriod.tsx","../src/components/TimeWidget/TimeWidget.tsx","../src/components/TradingMenu/TradingItemRow.tsx","../src/components/TradingMenu/TradingMenu.tsx","../src/components/Truncate.tsx","../src/components/itemSelector/ItemSelector.tsx","../src/components/CheckButton.tsx","../src/components/RadioButton.tsx","../src/components/TextArea.tsx"],"sourcesContent":["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 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';\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","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] || atlasJSON.frames['others/no-image.png'];\n\n if (!spriteData) throw new Error(`Sprite ${spriteKey} not found in atlas!`);\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';\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}\n\nexport const SelectArrow: React.FC<ArrowBarProps> = ({\n direction = 'left',\n size,\n onPointerDown,\n ...props\n}) => {\n return (\n <>\n {direction === 'left' ? (\n <LeftArrow\n size={size}\n onPointerDown={() => onPointerDown()}\n {...props}\n ></LeftArrow>\n ) : (\n <RightArrow\n size={size}\n onPointerDown={() => onPointerDown()}\n {...props}\n ></RightArrow>\n )}\n </>\n );\n};\n\ninterface IArrowProps {\n size?: 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 :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 :active {\n background-image: url(${RightArrowClickIcon});\n }\n z-index: 2;\n`;\n\nexport default SelectArrow;\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,\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 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 { IChatMessage } from '@rpg-engine/shared';\nimport dayjs from 'dayjs';\nimport React, { useEffect, useState } from 'react';\nimport { ErrorBoundary } from 'react-error-boundary';\nimport { RxPaperPlane } from 'react-icons/rx';\nimport styled from 'styled-components';\nimport { Column } from '../shared/Column';\n\ninterface IEmitter {\n _id: string;\n name: string;\n}\n\ninterface IStyles {\n textColor?: string;\n buttonColor?: string;\n buttonBackgroundColor?: string;\n width?: string;\n height?: string;\n}\n\nexport interface IChatProps {\n chatMessages: IChatMessage[];\n onSendChatMessage: (message: string) => void;\n onCloseButton: () => void;\n onFocus?: () => void;\n onBlur?: () => void;\n opacity?: number;\n sendMessage: boolean;\n styles?: IStyles;\n}\n\nexport const Chat: React.FC<IChatProps> = ({\n chatMessages,\n onSendChatMessage,\n onFocus,\n onBlur,\n styles = {\n textColor: '#c65102',\n buttonColor: '#005b96',\n buttonBackgroundColor: 'rgba(0,0,0,.2)',\n width: '80%',\n height: 'auto',\n },\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 if (!message || message.trim() === '') return;\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: IChatMessage[]) => {\n return chatMessages?.length ? (\n chatMessages?.map(({ _id, createdAt, emitter, message }, index) => (\n <Message color={styles?.textColor || '#c65102'} key={`${_id}_${index}`}>\n {onRenderMessageLines(emitter, createdAt as string, message)}\n </Message>\n ))\n ) : (\n <Message color={styles?.textColor || '#c65102'}>\n No messages available.\n </Message>\n );\n };\n\n return (\n <ChatContainer\n width={styles?.width || '80%'}\n height={styles?.height || 'auto'}\n >\n <ErrorBoundary fallback={<p>Oops! Your chat has crashed.</p>}>\n <MessagesContainer className=\"chat-body\">\n {onRenderChatMessages(chatMessages)}\n </MessagesContainer>\n\n <Form onSubmit={handleSubmit}>\n <Column flex={70}>\n <TextField\n value={message}\n id=\"inputMessage\"\n onChange={e => getInputValue(e.target.value)}\n height={20}\n type=\"text\"\n autoComplete=\"off\"\n onFocus={onFocus}\n onBlur={onBlur}\n onPointerDown={onFocus}\n autoFocus\n />\n </Column>\n <Column justifyContent=\"flex-end\">\n <Button\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 <RxPaperPlane size={15} />\n </Button>\n </Column>\n </Form>\n </ErrorBoundary>\n </ChatContainer>\n );\n};\n\ninterface IContainerProps {\n width: string;\n height: string;\n}\n\ninterface IMessageProps {\n color: string;\n}\n\ninterface IButtonProps {\n buttonColor: string;\n buttonBackgroundColor: string;\n}\n\nconst ChatContainer = styled.div<IContainerProps>`\n height: ${props => props.height};\n width: ${({ width }) => width};\n padding: 10px;\n background-color: rgba(0, 0, 0, 0.2);\n height: auto;\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 MessagesContainer = styled.div`\n height: 70%;\n margin-bottom: 10px;\n .chat-body {\n max-height: auto;\n overflow-y: auto;\n }\n`;\n\nconst Message = styled.div<IMessageProps>`\n margin-bottom: 8px;\n color: ${({ color }) => color};\n`;\n\nconst Form = styled.form`\n display: flex;\n width: 100%;\n justify-content: center;\n align-items: center;\n`;\n\nconst Button = styled.button<IButtonProps>`\n color: ${({ buttonColor }) => buttonColor};\n background-color: ${({ buttonBackgroundColor }) => buttonBackgroundColor};\n width: 28px;\n height: 28px;\n border: none !important;\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 { IChatMessage } 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 '../RPGUIContainer';\nimport { Column } from '../shared/Column';\n\ninterface IEmitter {\n _id: string;\n name: string;\n}\nexport interface IChatDeprecatedProps {\n chatMessages: IChatMessage[];\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: IChatMessage[]) => {\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","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 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 '../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 <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\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 from 'styled-components';\nimport { uiFonts } from '../constants/uiFonts';\nimport { useOutsideClick } from '../hooks/useOutsideAlerter';\nimport { IPosition } from '../types/eventTypes';\nimport { RPGUIContainerTypes } from './RPGUIContainer';\n\nexport interface IDraggableContainerProps {\n children: React.ReactNode;\n width?: string;\n height?: 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}\n\nexport const DraggableContainer: React.FC<IDraggableContainerProps> = ({\n children,\n width = '50%',\n height,\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}) => {\n const draggableRef = useRef(null);\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,${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 className={`rpgui-container ${type} ${className}`}\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}\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 &.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`;\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`\n color: white;\n z-index: 22;\n font-size: ${uiFonts.size.xsmall};\n width: ${(props: ICustomIconProps) => props.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 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, { 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 {\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 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 {\n getItemTextureKeyPath,\n IEquipmentSet,\n IItem,\n IItemContainer,\n ItemContainerType,\n ItemRarities,\n ItemSlotType,\n ItemType,\n} from '@rpg-engine/shared';\n\nimport { observer } from 'mobx-react-lite';\nimport React, { useEffect, useRef, useState } from 'react';\nimport Draggable from 'react-draggable';\nimport styled from 'styled-components';\nimport { v4 as uuidv4 } from 'uuid';\nimport { uiFonts } from '../../../constants/uiFonts';\nimport { IPosition } from '../../../types/eventTypes';\nimport { RelativeListMenu } from '../../RelativeListMenu';\nimport { Ellipsis } from '../../shared/Ellipsis';\nimport { SpriteFromAtlas } from '../../shared/SpriteFromAtlas';\nimport { ItemTooltip } from '../Cards/ItemTooltip';\nimport { MobileItemTooltip } from '../Cards/MobileItemTooltip';\nimport { ErrorBoundary } from './ErrorBoundary';\nimport { generateContextMenu, IContextMenuItem } from './itemContainerHelper';\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 onSelected?: (selectedOption: string, item: IItem) => void;\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 onSelected,\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 equipmentSet,\n setItemShortcut,\n isDepotSystem,\n }) => {\n const [isTooltipVisible, setTooltipVisible] = useState(false);\n const [isTooltipMobileVisible, setIsTooltipMobileVisible] = useState(false);\n\n const [isContextMenuVisible, setIsContextMenuVisible] = useState(false);\n const [contextMenuPosition, setContextMenuPosition] = useState({\n x: 0,\n y: 0,\n });\n\n const [isFocused, setIsFocused] = useState(false);\n const [wasDragged, setWasDragged] = useState(false);\n const [dragPosition, setDragPosition] = useState<IPosition>({ x: 0, y: 0 });\n const [dropPosition, setDropPosition] = useState<IPosition | null>(null);\n const dragContainer = useRef<HTMLDivElement>(null);\n\n const [contextActions, setContextActions] = useState<IContextMenuItem[]>(\n []\n );\n\n useEffect(() => {\n setDragPosition({ x: 0, y: 0 });\n setIsFocused(false);\n\n if (item && containerType) {\n setContextActions(\n generateContextMenu(item, containerType, isDepotSystem)\n );\n }\n }, [item, isDepotSystem]);\n\n useEffect(() => {\n if (onDrop && item && dropPosition) {\n onDrop(item, dropPosition);\n }\n }, [dropPosition]);\n\n const getStackInfo = (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 <ItemQtyContainer key={`qty-${itemId}`}>\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 return undefined;\n };\n\n const renderItem = (itemToRender: IItem | null) => {\n const element = [];\n\n if (itemToRender?.texturePath) {\n element.push(\n <ErrorBoundary key={itemToRender._id}>\n <SpriteFromAtlas\n key={itemToRender._id}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={getItemTextureKeyPath(\n {\n key: itemToRender.texturePath,\n texturePath: itemToRender.texturePath,\n stackQty: itemToRender.stackQty || 1,\n isStackable: itemToRender.isStackable,\n },\n atlasJSON\n )}\n imgScale={3}\n imgClassname=\"sprite-from-atlas-img--item\"\n />\n </ErrorBoundary>\n );\n }\n const stackInfo = getStackInfo(\n itemToRender?._id ?? '',\n itemToRender?.stackQty ?? 0\n );\n if (stackInfo) {\n element.push(stackInfo);\n }\n\n return element;\n };\n\n const renderEquipment = (itemToRender: IItem | null) => {\n if (\n itemToRender?.texturePath &&\n itemToRender.allowedEquipSlotType?.includes(slotSpriteMask!)\n ) {\n const element = [];\n\n element.push(\n <ErrorBoundary key={itemToRender._id}>\n <SpriteFromAtlas\n key={itemToRender._id}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={getItemTextureKeyPath(\n {\n key: itemToRender.texturePath,\n texturePath: itemToRender.texturePath,\n stackQty: itemToRender.stackQty || 1,\n isStackable: itemToRender.isStackable,\n },\n atlasJSON\n )}\n imgScale={3}\n imgClassname=\"sprite-from-atlas-img--item\"\n />\n </ErrorBoundary>\n );\n const stackInfo = getStackInfo(\n itemToRender?._id ?? '',\n itemToRender?.stackQty ?? 0\n );\n if (stackInfo) {\n element.push(stackInfo);\n }\n return element;\n } else {\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\n const onRenderSlot = (itemToRender: IItem | null) => {\n switch (containerType) {\n case ItemContainerType.Equipment:\n return renderEquipment(itemToRender);\n case ItemContainerType.Inventory:\n return renderItem(itemToRender);\n default:\n return renderItem(itemToRender);\n }\n };\n\n const resetItem = () => {\n setTooltipVisible(false);\n setWasDragged(false);\n };\n\n const onSuccesfulDrag = (quantity?: number) => {\n resetItem();\n\n if (quantity === -1) {\n setDragPosition({ x: 0, y: 0 });\n setIsFocused(false);\n } else if (item) {\n onDragEnd?.(quantity);\n }\n };\n\n return (\n <Container\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 || item?.type === ItemType.Tool)\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={(e, data) => {\n const target = e.target as HTMLElement;\n if (\n target?.id.includes('shortcutSetter') &&\n setItemShortcut &&\n item\n ) {\n const index = parseInt(target.id.split('_')[1]);\n if (!isNaN(index)) {\n setItemShortcut(item, index);\n }\n }\n\n if (wasDragged && item && !isSelectingShortcut) {\n //@ts-ignore\n const classes: string[] = Array.from(e.target?.classList);\n\n const isOutsideDrop =\n classes.some(elm => {\n return elm.includes('rpgui-content');\n }) || classes.length === 0;\n\n if (isOutsideDrop) {\n setDropPosition({\n x: data.x,\n y: data.y,\n });\n }\n\n setWasDragged(false);\n\n const target = dragContainer.current;\n if (!target || !wasDragged) return;\n\n const style = window.getComputedStyle(target);\n const matrix = new DOMMatrixReadOnly(style.transform);\n const x = matrix.m41;\n const y = matrix.m42;\n\n setDragPosition({ x, y });\n\n setTimeout(() => {\n if (checkIfItemCanBeMoved?.()) {\n if (checkIfItemShouldDragEnd && !checkIfItemShouldDragEnd())\n return;\n\n if (\n item.stackQty &&\n item.stackQty !== 1 &&\n openQuantitySelector\n )\n openQuantitySelector(item.stackQty, onSuccesfulDrag);\n else onSuccesfulDrag(item.stackQty);\n } else {\n resetItem();\n setIsFocused(false);\n setDragPosition({ x: 0, y: 0 });\n }\n }, 100);\n } else if (item) {\n let isTouch = false;\n if (\n !isContextMenuDisabled &&\n e.type === 'touchend' &&\n !isSelectingShortcut\n ) {\n isTouch = true;\n setIsTooltipMobileVisible(true);\n }\n\n if (!isContextMenuDisabled && !isSelectingShortcut && !isTouch) {\n setIsContextMenuVisible(!isContextMenuVisible);\n const event = e as MouseEvent;\n\n if (event.clientX && event.clientY) {\n setContextMenuPosition({\n x: event.clientX - 10,\n y: event.clientY - 5,\n });\n }\n }\n\n onPointerDown(item.type, containerType ?? null, item);\n }\n }}\n onStart={() => {\n if (!item || isSelectingShortcut) {\n return;\n }\n\n if (onDragStart && containerType) {\n onDragStart(item, slotIndex, containerType);\n }\n }}\n onDrag={(_e, data) => {\n if (\n Math.abs(data.x - dragPosition.x) > 5 ||\n Math.abs(data.y - dragPosition.y) > 5\n ) {\n setWasDragged(true);\n setIsFocused(true);\n }\n }}\n position={dragPosition}\n cancel=\".empty-slot\"\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 setTooltipVisible(true);\n }}\n onMouseLeave={() => {\n setTooltipVisible(false);\n }}\n >\n {onRenderSlot(item)}\n </ItemContainer>\n </Draggable>\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 setIsTooltipMobileVisible(false);\n }}\n scale={dragScale}\n options={contextActions}\n onSelected={(optionId: string) => {\n setIsContextMenuVisible(false);\n if (item) {\n onSelected?.(optionId, item);\n }\n }}\n />\n )}\n\n {!isContextMenuDisabled && isContextMenuVisible && contextActions && (\n <RelativeListMenu\n options={contextActions}\n onSelected={(optionId: string) => {\n setIsContextMenuVisible(false);\n if (item) {\n onSelected?.(optionId, item);\n }\n }}\n onOutsideClick={() => {\n setIsContextMenuVisible(false);\n }}\n pos={contextMenuPosition}\n />\n )}\n </Container>\n );\n }\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\ninterface ContainerTypes {\n item: IItem | null;\n isSelectingShortcut?: boolean;\n}\n\nconst Container = styled.div<ContainerTypes>`\n margin: 0.1rem;\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,\n}) => `0 0 4px 3px ${rarityColor(item)}`};\n //background-color: ${({ item }) => rarityColor(item)};\n }\n position: relative;\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: 100%;\n height: 100%;\n position: relative;\n\n ${props => props.isFocused && 'z-index: 100; pointer-events: none;'}\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 { 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, rarityColor } from '../Inventory/ItemSlot';\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, { 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 '../RPGUIContainer';\nimport { CraftingRecipe } from './CraftingRecipe';\n\nexport interface IItemCraftSelectorProps {\n atlasJSON: any;\n atlasIMG: any;\n onClose: () => void;\n onSelect: (value: string) => void;\n onCraftItem: (value: string | undefined) => 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\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 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 <hr className=\"golden\" />\n </div>\n\n <ContentContainer>\n <ItemTypes className=\"inputRadioCraftBook\">\n {renderItemTypes()}\n </ItemTypes>\n\n <RadioInputScroller className=\"inputRadioCraftBook\">\n {craftablesItems?.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}\n buttonType={ButtonTypes.RPGUIButton}\n onPointerDown={() => onCraftItem(craftItemKey)}\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","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}\n\nexport const Dropdown: React.FC<IDropdownProps> = ({\n options,\n width,\n onChange,\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 /**\n * make a selection if there is no selected value already present\n * or if there is a selected value but its not in new options\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 className=\"rpgui-dropdown-imp\" opened={opened}>\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}>`\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\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 {\n IEquipmentSet,\n IItem,\n IItemContainer,\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 { ItemSlot } from '../Item/Inventory/ItemSlot';\nimport { RPGUIContainerTypes } from '../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 onSelected={(optionId: string) => {\n if (onSelected) onSelected(optionId);\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 <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>{onRenderEquipmentSlotRange(0, 3)}</EquipmentColumn>\n <EquipmentColumn>{onRenderEquipmentSlotRange(3, 7)}</EquipmentColumn>\n <EquipmentColumn>{onRenderEquipmentSlotRange(7, 10)}</EquipmentColumn>\n </EquipmentSetContainer>\n </DraggableContainer>\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`;\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 { 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 }, 50);\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 '../RPGUIContainer';\nimport aliceDefaultThumbnail from './img/npcDialog/npcThumbnails/alice.png';\nimport pressSpaceGif from './img/space.gif';\nimport { NPCDialogText } from './NPCDialogText';\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, { 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}\n\nexport const RangeSlider: React.FC<IRangeSliderProps> = ({\n type,\n valueMin,\n valueMax,\n width,\n onChange,\n value,\n}) => {\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)) * (calculatedWidth - 35) +\n 10\n )\n );\n }, [value, valueMin, valueMax]);\n\n const typeClass = type === RangeSliderType.GoldSlider ? 'golden' : '';\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 onChange={e => onChange(Number(e.target.value))}\n value={value}\n className=\"rpgui-cursor-point\"\n />\n </div>\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 '../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: cover;\n width: 100%;\n height: ${props => (props.isTextFixed ? '80%' : '100%')};\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 from 'react';\nimport { IPosition } from '../../types/eventTypes';\nimport { DraggableContainer } from '../DraggableContainer';\nimport { RPGUIContainerTypes } from '../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}\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}) => {\n return (\n <DraggableContainer\n title={title}\n type={RPGUIContainerTypes.Framed}\n onCloseButton={() => {\n if (onClose) {\n onClose();\n }\n }}\n width=\"400px\"\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 { 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 { Input } from '../../Input';\nimport { RPGUIContainer, RPGUIContainerTypes } from '../../RPGUIContainer';\nimport { RangeSlider, RangeSliderType } from '../../RangeSlider';\n\nexport interface IItemQuantitySelectorProps {\n quantity: number;\n onConfirm: (quantity: number) => void;\n onClose: () => void;\n}\n\nexport const ItemQuantitySelector: React.FC<IItemQuantitySelectorProps> = ({\n quantity,\n onConfirm,\n onClose,\n}) => {\n const [value, setValue] = useState(quantity);\n\n const inputRef = useRef<HTMLInputElement>(null);\n\n useEffect(() => {\n if (inputRef.current) {\n inputRef.current.focus();\n inputRef.current.select();\n\n const closeSelector = (e: KeyboardEvent) => {\n if (e.key === 'Escape') {\n onClose();\n }\n };\n\n document.addEventListener('keydown', closeSelector);\n\n return () => {\n document.removeEventListener('keydown', closeSelector);\n };\n }\n\n return () => {};\n }, []);\n\n return (\n <StyledContainer type={RPGUIContainerTypes.Framed} width=\"25rem\">\n <CloseButton className=\"container-close\" onPointerDown={onClose}>\n X\n </CloseButton>\n <h2>Select quantity to move</h2>\n <StyledForm\n style={{ width: '100%' }}\n onSubmit={e => {\n e.preventDefault();\n\n const numberValue = Number(value);\n\n if (Number.isNaN(numberValue)) {\n return;\n }\n\n onConfirm(Math.max(1, Math.min(quantity, numberValue)));\n }}\n noValidate\n >\n <StyledInput\n innerRef={inputRef}\n placeholder=\"Enter quantity\"\n type=\"number\"\n min={1}\n max={quantity}\n value={value}\n onChange={e => {\n if (Number(e.target.value) >= quantity) {\n setValue(quantity);\n return;\n }\n\n setValue((e.target.value as unknown) as number);\n }}\n onBlur={e => {\n const newValue = Math.max(\n 1,\n Math.min(quantity, Number(e.target.value))\n );\n\n setValue(newValue);\n }}\n />\n <RangeSlider\n type={RangeSliderType.Slider}\n valueMin={1}\n valueMax={quantity}\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 display: flex;\n flex-direction: column;\n align-items: center;\n`;\n\nconst StyledForm = styled.form`\n display: flex;\n flex-direction: column;\n align-items: center;\n width: 100%;\n`;\nconst StyledInput = styled(Input)`\n text-align: center;\n\n &::-webkit-outer-spin-button,\n &::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n\n &[type='number'] {\n -moz-appearance: textfield;\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: 0.8rem;\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 padding-bottom: 1rem;\n`;\n","import {\n IEquipmentSet,\n IItem,\n IItemContainer,\n IShortcut,\n ItemContainerType,\n ItemType,\n} from '@rpg-engine/shared';\nimport React, { useState } from 'react';\nimport styled from 'styled-components';\nimport { SlotsContainer } from '../../Abstractions/SlotsContainer';\nimport { ItemQuantitySelector } from './ItemQuantitySelector';\n\nimport { IPosition } from '../../../types/eventTypes';\nimport ModalPortal from '../../Abstractions/ModalPortal';\nimport { ShortcutsSetter } from '../../Shortcuts/ShortcutsSetter';\nimport { ItemSlot } from './ItemSlot';\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}\n\nexport const ItemContainer: React.FC<IItemContainerProps> = ({\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}) => {\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 handleSetShortcut = (item: IItem, index: number) => {\n if (item.type === ItemType.Consumable || item.type === ItemType.Tool) {\n setItemShortcut?.(item.key, index);\n }\n };\n\n const onRenderSlots = () => {\n const slots = [];\n\n for (let i = 0; i < itemContainer.slotQty; i++) {\n slots.push(\n <ItemSlot\n isContextMenuDisabled={disableContextMenu}\n key={i}\n slotIndex={i}\n item={itemContainer.slots?.[i] || null}\n itemContainerType={type}\n onMouseOver={(event, slotIndex, item) => {\n if (onMouseOver) onMouseOver(event, slotIndex, item);\n }}\n onPointerDown={(itemType, containerType, item) => {\n if (settingShortcutIndex !== -1) {\n setSettingShortcutIndex(-1);\n\n handleSetShortcut(item, settingShortcutIndex);\n } else if (onItemClick) onItemClick(item, itemType, containerType);\n }}\n onSelected={(optionId: string, item: IItem) => {\n if (onSelected) onSelected(optionId, item);\n }}\n onDragStart={(item, slotIndex, itemContainerType) => {\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 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 onOutsideDrop={(item, position) => {\n if (onOutsideDrop) onOutsideDrop(item, position);\n }}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n isSelectingShortcut={settingShortcutIndex !== -1}\n equipmentSet={equipmentSet}\n setItemShortcut={\n type === ItemContainerType.Inventory ? handleSetShortcut : undefined\n }\n isDepotSystem={isDepotSystem}\n />\n );\n }\n return slots;\n };\n\n return (\n <>\n <SlotsContainer\n title={itemContainer.name || 'Container'}\n onClose={onClose}\n initialPosition={initialPosition}\n scale={scale}\n onPositionChangeEnd={onPositionChangeEnd}\n onPositionChangeStart={onPositionChangeStart}\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 className=\"item-container-body\">\n {onRenderSlots()}\n </ItemsContainer>\n </SlotsContainer>\n {quantitySelect.isOpen && (\n <ModalPortal>\n <QuantitySelectorContainer>\n <ItemQuantitySelector\n quantity={quantitySelect.maxQuantity}\n onConfirm={quantity => {\n quantitySelect.callback(quantity);\n setQuantitySelect({\n isOpen: false,\n maxQuantity: 1,\n callback: () => {},\n });\n }}\n onClose={() => {\n quantitySelect.callback(-1);\n setQuantitySelect({\n isOpen: false,\n maxQuantity: 1,\n callback: () => {},\n });\n }}\n />\n </QuantitySelectorContainer>\n </ModalPortal>\n )}\n </>\n );\n};\n\nconst ItemsContainer = styled.div`\n display: flex;\n justify-content: center;\n flex-wrap: wrap;\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 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\ninterface 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 { rarityColor } from '../Item/Inventory/ItemSlot';\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 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 <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 />\n </RarityContainer>\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 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 { 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 '../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';\nimport { uiColors } from '../../../constants/uiColors';\nimport { Button, ButtonTypes } from '../../Button';\nimport { DraggableContainer } from '../../DraggableContainer';\nimport { Input } from '../../Input';\nimport { RPGUIContainerTypes } from '../../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 '../../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 '../../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';\nimport { Button, ButtonTypes } from '../../Button';\n\nexport interface IPartyManagerRowProps {\n id: string;\n charName: string;\n charClass: string;\n isLeader: boolean;\n leaderId: 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 onRemovePlayer,\n onChangeLeader,\n}) => {\n return (\n <PartyWrapper>\n <TextContainer>{charName}</TextContainer>\n <TextContainer>{charClass}</TextContainer>\n <div className=\"cancel-button\">\n <Button\n buttonType={ButtonTypes.RPGUIButton}\n onPointerDown={() => onRemovePlayer(id)}\n >\n Remove\n </Button>\n </div>\n <Button\n buttonType={ButtonTypes.RPGUIButton}\n disabled={!isLeader || leaderId === id}\n onPointerDown={() => onChangeLeader(id)}\n >\n New Leader\n </Button>\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 { ICharacterPartyShared, isMobileOrTablet } from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../../constants/uiColors';\nimport { DraggableContainer } from '../../DraggableContainer';\nimport { RPGUIContainerTypes } from '../../RPGUIContainer';\nimport { PartyManagerRow } from './PartyManagerRows';\n\nexport interface IPartyManagerProps {\n partyRows: ICharacterPartyShared | null;\n isLeader: boolean;\n onClose?: () => void;\n onRemovePlayer: (id: string) => void;\n onChangeLeader: (id: string) => void;\n}\n\nexport const PartyManager: React.FC<IPartyManagerProps> = ({\n partyRows,\n isLeader,\n onClose,\n onRemovePlayer,\n onChangeLeader,\n}) => {\n const invitationActionText = isMobileOrTablet() ? 'Tap' : 'Right click';\n\n return (\n <DraggableContainer\n type={RPGUIContainerTypes.Framed}\n onCloseButton={onClose}\n width=\"800px\"\n height=\"400px\"\n cancelDrag=\".partyRows\"\n >\n <Wrapper>\n <div style={{ width: '100%' }}>\n <Title>Party Dashboard</Title>\n <hr className=\"golden\" />\n </div>\n </Wrapper>\n <RowsWrapper className=\"partyRows\">\n {partyRows && partyRows.members ? (\n <>\n <PartyManagerRow\n key={partyRows.leader._id}\n id={partyRows.leader._id}\n leaderId={partyRows.leader._id}\n charName={partyRows.leader.name}\n charClass={partyRows.leader.class}\n isLeader={true}\n onRemovePlayer={() => onRemovePlayer(partyRows.leader._id)}\n onChangeLeader={() => onChangeLeader(partyRows.leader._id)}\n />\n {partyRows.members.map(partyRow => (\n <PartyManagerRow\n key={partyRow._id}\n charName={partyRow.name}\n charClass={partyRow.class}\n id={partyRow._id}\n isLeader={isLeader}\n leaderId={partyRows.leader._id}\n onRemovePlayer={() => onRemovePlayer(partyRow._id)}\n onChangeLeader={() => onChangeLeader(partyRow._id)}\n />\n ))}\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 )}\n </RowsWrapper>\n </DraggableContainer>\n );\n};\nconst YellowText = styled.span`\n color: ${uiColors.yellow} !important;\n`;\n\nconst Wrapper = styled.div`\n display: flex;\n flex-direction: column;\n width: 100%;\n`;\n\nconst RowsWrapper = styled.div`\n width: 100%;\n`;\n\nconst Title = styled.h1`\n font-size: 0.6rem;\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 ],\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","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 '../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 } from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { uiFonts } from '../constants/uiFonts';\nimport { DraggableContainer } from './DraggableContainer';\nimport { RPGUIContainerTypes } from './RPGUIContainer';\n\nexport interface IQuestListProps {\n quests?: IQuest[];\n onClose: () => void;\n scale?: number;\n}\n\nexport const QuestList: React.FC<IQuestListProps> = ({\n quests,\n onClose,\n scale,\n}) => {\n return (\n <QuestDraggableContainer\n type={RPGUIContainerTypes.Framed}\n onCloseButton={() => {\n if (onClose) onClose();\n }}\n width=\"520px\"\n scale={scale}\n >\n <div style={{ width: '100%' }}>\n <Title>Quests</Title>\n <hr className=\"golden\" />\n\n <QuestListContainer>\n {quests ? (\n quests.map((quest, i) => (\n <div className=\"quest-item\" key={i}>\n <span className=\"quest-number\">{i + 1}</span>\n <div className=\"quest-detail\">\n <p className=\"quest-detail__title\">{quest.title}</p>\n <p className=\"quest-detail__description\">\n {quest.description}\n </p>\n </div>\n </div>\n ))\n ) : (\n <NoQuestContainer>\n <p>There are no ongoing quests</p>\n </NoQuestContainer>\n )}\n </QuestListContainer>\n </div>\n </QuestDraggableContainer>\n );\n};\n\nconst QuestDraggableContainer = styled(DraggableContainer)`\n .container-close {\n top: 10px;\n right: 10px;\n }\n\n .quest-title {\n text-align: left;\n margin-left: 44px;\n margin-top: 20px;\n color: yellow;\n }\n\n .quest-desc {\n margin-top: 12px;\n margin-left: 44px;\n }\n\n .rpgui-progress {\n min-width: 80%;\n margin: 0 auto;\n }\n`;\n\nconst Title = styled.h1`\n z-index: 22;\n font-size: ${uiFonts.size.medium} !important;\n color: yellow !important;\n`;\n\nconst QuestListContainer = styled.div`\n margin-top: 20px;\n margin-bottom: 40px;\n overflow-y: auto;\n max-height: 400px;\n\n .quest-item {\n display: flex;\n align-items: flex-start;\n margin-bottom: 12px;\n }\n\n .quest-number {\n border-radius: 50%;\n width: 28px;\n height: 28px;\n display: flex;\n align-items: center;\n justify-content: center;\n margin-right: 16px;\n background-color: brown;\n flex-shrink: 0;\n }\n\n .quest-number.completed {\n background-color: yellow;\n }\n\n p {\n margin: 0;\n }\n\n .quest-detail__title {\n color: yellow;\n }\n\n .quest-detail__description {\n margin-top: 5px;\n }\n .Noquest-detail__description {\n margin-top: 5px;\n margin: auto;\n }\n`;\nconst NoQuestContainer = styled.div`\n text-align: center;\n p {\n margin-top: 5px;\n }\n`;\n","import React from 'react';\nimport 'rpgui/rpgui.min.css';\nimport 'rpgui/rpgui.min.js';\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 <div className=\"rpgui-content\">{children}</div>;\n};\n","import {\n getItemTextureKeyPath,\n IItem,\n IItemContainer,\n IRawSpell,\n IShortcut,\n ShortcutType,\n} from '@rpg-engine/shared';\nimport React, { 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 useEffect(() => {\n const handleKeyDown = (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 setTimeout(() => {\n shortcutsRefs.current[shortcutIndex]?.classList.remove('active');\n }, 150);\n }\n };\n\n window.addEventListener('keydown', handleKeyDown);\n\n return () => {\n window.removeEventListener('keydown', handleKeyDown);\n };\n }, [shortcuts, isBlockedCastingByKeyboard, shortcutCooldown]);\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 return (\n <Container className=\"simple-progress-bar\">\n <ProgressBarContainer margin={margin}>\n <BackgroundBar>\n <Progress value={value} 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 ISimpleProgressBarThemeProps {\n value: number;\n bgColor: string;\n}\n\nconst Progress = styled.span`\n background-color: ${(props: ISimpleProgressBarThemeProps) => props.bgColor};\n width: ${(props: ISimpleProgressBarThemeProps) => props.value}%;\n`;\n\ninterface ISimpleProgressBarTheme2Props {\n margin: number;\n}\n\nconst ProgressBarContainer = styled.div`\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: ISimpleProgressBarTheme2Props) => props.margin}px;\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 { SimpleProgressBar } from './SimpleProgressBar';\nimport { SpriteFromAtlas } from './shared/SpriteFromAtlas';\n\nexport interface ISkillProgressBarProps {\n skillName: string;\n bgColor: string;\n level: number;\n skillPoints: number;\n skillPointsToNextLevel?: number;\n texturePath: string;\n showSkillPoints?: boolean;\n atlasJSON: any;\n atlasIMG: any;\n buffAndDebuff?: number;\n ratio: number;\n}\n\nexport const SkillProgressBar: React.FC<ISkillProgressBarProps> = ({\n bgColor,\n skillName,\n level,\n skillPoints,\n skillPointsToNextLevel,\n texturePath,\n showSkillPoints = true,\n atlasIMG,\n atlasJSON,\n buffAndDebuff,\n ratio,\n}) => {\n if (!skillPointsToNextLevel) {\n skillPointsToNextLevel = getSPForLevel(level + 1);\n }\n\n const skillsBuffsCalc = (level: number, buffAndDebuff: number): string => {\n const result = level * (buffAndDebuff / 100);\n\n if (result > 0) {\n return `+${result.toFixed(2)}`;\n } else {\n return `${result.toFixed(2)}`;\n }\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>(+{buffAndDebuff}%)</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>({buffAndDebuff}%)</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 <ProgressBarContainer>\n <SimpleProgressBar value={ratio} bgColor={bgColor} />\n </ProgressBarContainer>\n </ProgressBody>\n {showSkillPoints && (\n <SkillDisplayContainer>\n <SkillPointsDisplay>\n {skillPoints}/{skillPointsToNextLevel}\n </SkillPointsDisplay>\n </SkillDisplayContainer>\n )}\n </>\n );\n};\n\nconst ProgressBarContainer = styled.div`\n position: relative;\n top: 8px;\n width: 100%;\n height: auto;\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.6rem !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: 'spell-icons/regenerate.png',\n magic: 'spell-icons/fireball.png',\n magicResistance: 'spell-icons/freeze.png',\n strength: 'spell-icons/enchanted-blow.png',\n resistance: 'spell-icons/magic-shield.png',\n dexterity: 'spell-icons/haste.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 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 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 SPRatio = (level: number, skillPoints: number) => {\n const SPLevelActual = getSPForLevel(level + 1);\n const SPLevelBefore = getSPForLevel(level);\n const SPCalc = SPLevelActual - SPLevelBefore;\n if (level === 1) {\n return (skillPoints / SPLevelActual) * 100;\n }\n return ((skillPoints - SPLevelBefore) / SPCalc) * 100;\n };\n\n const XPRatio = (level: number, skillPoints: number) => {\n const XPLevelActual = getXPForLevel(level + 1);\n const XPLevelBefore = getXPForLevel(level);\n const XPCalc = XPLevelActual - XPLevelBefore;\n if (level === 1) {\n return (skillPoints / XPLevelActual) * 100;\n }\n return ((skillPoints - XPLevelBefore) / XPCalc) * 100;\n };\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 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 ratio={SPRatio(skillDetails.level, skillDetails.skillPoints)}\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 ratio={XPRatio(skill.level, skill.experience)}\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, { 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}\n\nexport const SpellInfoWrapper: React.FC<ISpellInfoWrapperProps> = ({\n children,\n spell,\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 <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};\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 '../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 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 scale={scale}>\n <WidgetContainer>\n <CloseButton onPointerDown={onClose}>X</CloseButton>\n <DayNightContainer>\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 {\n getItemTextureKeyPath,\n IEquipmentSet,\n ITradeResponseItem,\n} from '@rpg-engine/shared';\nimport capitalize from 'lodash/capitalize';\nimport React 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';\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}\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}) => {\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 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.5}\n />\n </ItemInfoWrapper>\n </SpriteContainer>\n </ItemIconContainer>\n\n <ItemNameContainer>\n <NameValue>\n <p>\n <Ellipsis maxLines={1} maxWidth=\"250px\">\n {capitalize(traderItem.name)}\n </Ellipsis>\n </p>\n <p>${traderItem.price}</p>\n </NameValue>\n </ItemNameContainer>\n <QuantityContainer>\n <SelectArrow\n size={32}\n className=\"arrow-selector\"\n direction=\"left\"\n onPointerDown={onLeftClick.bind(null, outerQty)}\n />\n <StyledArrow\n size={32}\n className=\"arrow-selector\"\n direction=\"left\"\n onPointerDown={onLeftClick}\n />\n <QuantityDisplay>\n <TextOverlay>\n <Item>{selectedQty}</Item>\n </TextOverlay>\n </QuantityDisplay>\n <StyledArrow\n size={32}\n className=\"arrow-selector\"\n direction=\"right\"\n onPointerDown={onRightClick}\n />\n <SelectArrow\n size={32}\n className=\"arrow-selector\"\n direction=\"right\"\n onPointerDown={onRightClick.bind(null, outerQty)}\n />\n </QuantityContainer>\n </ItemWrapper>\n );\n};\n\nconst StyledArrow = styled(SelectArrow)`\n margin: 40px;\n`;\n\nconst ItemWrapper = styled.div`\n width: 100%;\n margin: auto;\n display: flex;\n justify-content: space-between;\n margin-bottom: 1rem;\n\n &:hover {\n background-color: ${uiColors.darkGray};\n }\n padding: 0.5rem;\n`;\n\nconst ItemNameContainer = styled.div`\n flex: 60%;\n`;\n\nconst ItemIconContainer = styled.div`\n display: flex;\n justify-content: flex-start;\n align-items: center;\n\n flex: 0 0 58px;\n`;\n\nconst SpriteContainer = styled.div`\n position: relative;\n top: -0.5rem;\n left: 0.5rem;\n`;\n\nconst NameValue = styled.div`\n p {\n font-size: 0.75rem;\n margin: 0;\n }\n`;\n\nconst Item = styled.span`\n color: white;\n text-align: center;\n z-index: 1;\n\n width: 100%;\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 QuantityContainer = styled.div<IContainerProps>`\n position: relative;\n display: flex;\n\n min-width: 100px;\n width: 40%;\n justify-content: center;\n align-items: center;\n\n flex: 40%;\n`;\n\nconst QuantityDisplay = styled.div`\n font-size: ${uiFonts.size.small};\n`;\n","import {\n IEquipmentSet,\n ITradeRequestItem,\n ITradeResponseItem,\n TradeTransactionType,\n} from '@rpg-engine/shared';\nimport React, { useState } from 'react';\nimport styled from 'styled-components';\nimport { Button, ButtonTypes } from '../Button';\nimport { DraggableContainer } from '../DraggableContainer';\nimport { RPGUIContainerTypes } from '../RPGUIContainer';\nimport { TradingItemRow } from './TradingItemRow';\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 [sum, setSum] = useState(0);\n const [qtyMap, setQtyMap] = useState(new Map());\n\n const onQuantityChange = (item: ITradeResponseItem, selectedQty: number) => {\n setQtyMap(new Map(qtyMap.set(item.key, selectedQty)));\n\n let newSum = 0;\n traderItems.forEach(item => {\n const qty = qtyMap.get(item.key);\n if (qty) newSum += qty * item.price;\n setSum(newSum);\n });\n };\n\n const isBuy = () => {\n return type == 'buy';\n };\n\n const hasGoldForSale = () => {\n if (isBuy()) {\n return !(sum > characterAvailableGold);\n }\n return true;\n };\n\n const getFinalGold = () => {\n if (isBuy()) {\n return characterAvailableGold - sum;\n } else {\n return characterAvailableGold + sum;\n }\n };\n\n const Capitalize = (word: string) => {\n return word[0].toUpperCase() + word.substring(1);\n };\n\n const onConfirmClick = () => {\n const items: ITradeRequestItem[] = [];\n\n traderItems.forEach(item => {\n const qty = qtyMap.get(item.key);\n if (qty) {\n items.push(Object.assign({}, item, { qty: qty }));\n }\n });\n\n onConfirm(items);\n };\n\n return (\n <DraggableContainer\n type={RPGUIContainerTypes.Framed}\n onCloseButton={() => {\n if (onClose) onClose();\n }}\n width=\"600px\"\n cancelDrag=\"#TraderContainer\"\n scale={scale}\n >\n <>\n <div style={{ width: '100%' }}>\n <Title>{Capitalize(type)} Menu</Title>\n <hr className=\"golden\" />\n </div>\n <TradingComponentScrollWrapper id=\"TraderContainer\">\n {traderItems.map((tradeItem, index) => (\n <ItemWrapper key={`${tradeItem.key}_${index}`}>\n <TradingItemRow\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n onQuantityChange={onQuantityChange}\n traderItem={tradeItem}\n selectedQty={qtyMap.get(tradeItem.key) ?? 0}\n equipmentSet={equipmentSet}\n scale={scale}\n />\n </ItemWrapper>\n ))}\n </TradingComponentScrollWrapper>\n <GoldWrapper>\n <p>Available Gold:</p>\n <p>${characterAvailableGold}</p>\n </GoldWrapper>\n <TotalWrapper>\n <p>Total:</p>\n <p>${sum}</p>\n </TotalWrapper>\n {!hasGoldForSale() ? (\n <AlertWrapper>\n <p> Sorry, not enough money.</p>\n </AlertWrapper>\n ) : (\n <GoldWrapper>\n <p>Final Gold:</p>\n <p>${getFinalGold()}</p>\n </GoldWrapper>\n )}\n\n <ButtonWrapper>\n <Button\n buttonType={ButtonTypes.RPGUIButton}\n disabled={!hasGoldForSale()}\n onPointerDown={() => onConfirmClick()}\n >\n Confirm\n </Button>\n <Button\n buttonType={ButtonTypes.RPGUIButton}\n onPointerDown={() => onClose()}\n >\n Cancel\n </Button>\n </ButtonWrapper>\n </>\n </DraggableContainer>\n );\n};\n\nconst Title = styled.h1`\n z-index: 22;\n font-size: 0.6rem;\n color: yellow !important;\n`;\n\nconst TradingComponentScrollWrapper = styled.div`\n overflow-y: scroll;\n height: 390px;\n width: 100%;\n margin-top: 1rem;\n`;\n\nconst ItemWrapper = styled.div`\n margin: auto;\n display: flex;\n justify-content: space-between;\n`;\n\nconst TotalWrapper = styled.div`\n margin-top: 1rem;\n display: flex;\n justify-content: space-between;\n height: 20px;\n p {\n color: white !important;\n }\n width: 100%;\n margin-left: 0.8rem;\n`;\n\nconst GoldWrapper = styled.div`\n margin-top: 1rem;\n display: flex;\n justify-content: space-between;\n height: 20px;\n p {\n color: yellow !important;\n }\n width: 100%;\n margin-left: 0.8rem;\n`;\n\nconst AlertWrapper = styled.div`\n margin-top: 1rem;\n display: flex;\n width: 100%;\n justify-content: center;\n height: 20px;\n p {\n color: red !important;\n }\n`;\n\nconst ButtonWrapper = styled.div`\n display: flex;\n justify-content: space-around;\n padding-top: 20px;\n width: 100%;\n margin-top: 1rem;\n button {\n padding: 0px 50px;\n }\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, { useEffect, useState } from 'react';\nimport styled from 'styled-components';\nimport { Button, ButtonTypes } from '../Button';\nimport { DraggableContainer } from '../DraggableContainer';\nimport { RPGUIContainerTypes } from '../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 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, { 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"],"names":["ButtonTypes","RPGUIContainerTypes","Button","disabled","children","buttonType","onPointerDown","props","React","ButtonContainer","className","styled","button","displayName","componentId","SpriteFromAtlas","atlasJSON","atlasIMG","spriteKey","_ref$width","width","GRID_WIDTH","_ref$height","height","GRID_HEIGHT","_ref$imgScale","imgScale","imgStyle","containerStyle","_ref$grayScale","grayScale","_ref$opacity","opacity","imgClassname","centered","borderRadius","spriteData","frames","Error","Container","hasHover","style","ImgSprite","frame","scale","div","w","h","x","y","ErrorBoundary","args","_this","state","hasError","getDerivedStateFromError","_","_proto","componentDidCatch","error","errorInfo","console","render","this","Component","SelectArrow","direction","size","LeftArrow","RightArrow","span","Ellipsis","maxWidth","fontSize","center","maxLines","PropertySelect","item","availableProperties","onChange","useState","currentIndex","setCurrentIndex","propertiesLength","length","useEffect","JSON","stringify","TextOverlay","Item","name","index","Column","flex","flexWrap","alignItems","justifyContent","ChatContainer","TextField","input","MessagesContainer","Message","color","Form","form","buttonColor","buttonBackgroundColor","Input","rest","ref","innerRef","RPGUIContainer","type","CloseButton","CustomInput","CustomContainer","MessageText","p","SingleShortcut","useShortcutCooldown","onShortcutCast","shortcutCooldown","setShortcutCooldown","cooldownTimeout","useRef","current","clearTimeout","setTimeout","handleShortcutCast","CancelButton","ButtonsContainer","ShortcutsContainer","StyledShortcut","useOutsideClick","id","handleClickOutside","event","contains","target","CustomEvent","detail","document","dispatchEvent","addEventListener","removeEventListener","NPCDialogType","DraggableContainer","_ref$type","FramedGold","onCloseButton","title","imgSrc","_ref$imgWidth","imgWidth","cancelDrag","onPositionChange","onPositionChangeEnd","onPositionChangeStart","onOutsideClick","_ref$initialPosition","initialPosition","_ref$dragDisabled","dragDisabled","draggableRef","_e","Draggable","cancel","onDrag","data","onStop","onStart","defaultPosition","TitleContainer","Title","Icon","src","h1","img","InputRadio","label","value","onRadioSelect","onPointerUp","checked","isChecked","readOnly","countItemFromInventory","itemKey","inventory","itemsFromInventory","Object","keys","slots","forEach","i","parseInt","_inventory$slots$inde","key","push","reduce","acc","stackQty","modalRoot","getElementById","ModalPortal","ReactDOM","createPortal","RelativeListMenu","options","onSelected","_ref$fontSize","pos","overflow","map","params","ListElement","text","li","MobileItemTooltip","closeTooltip","equipmentSet","_ref$scale","handleFadeOut","_ref$current","classList","add","onTouchEnd","ItemInfoDisplay","isMobile","OptionsContainer","option","Option","generateContextMenuListOptions","actionsByTypeList","action","ItemSocketEventsDisplayLabels","EquipmentSlotSpriteByType","Neck","LeftHand","Ring","Head","Torso","Legs","Feet","Inventory","RightHand","Accessory","ItemSlot","observer","slotIndex","containerType","itemContainerType","slotSpriteMask","onMouseOver","onMouseOut","_ref$isContextMenuDis","isContextMenuDisabled","onDragEnd","onDragStart","onPlaceDrop","onDrop","onOutsideDrop","checkIfItemCanBeMoved","openQuantitySelector","checkIfItemShouldDragEnd","dragScale","isSelectingShortcut","setItemShortcut","isDepotSystem","isTooltipVisible","setTooltipVisible","isTooltipMobileVisible","setIsTooltipMobileVisible","isContextMenuVisible","setIsContextMenuVisible","contextMenuPosition","setContextMenuPosition","isFocused","setIsFocused","wasDragged","setWasDragged","dragPosition","setDragPosition","dropPosition","setDropPosition","dragContainer","contextActions","setContextActions","contextActionMenu","ItemContainerType","ItemType","Weapon","Armor","Jewelry","ActionsForInventory","Equipment","Consumable","CraftingResource","Tool","Other","DepotSocketEvents","Deposit","ActionsForEquipmentSet","Loot","ActionsForLoot","MapContainer","ActionsForMapContainer","contextActionMenuDontHaveUseWith","find","toLowerCase","includes","hasUseWith","Depot","ItemSocketEvents","GetItemInfo","Withdraw","generateContextMenu","getStackInfo","itemId","qtyClassName","ItemQtyContainer","ItemQty","Math","round","resetItem","onSuccesfulDrag","quantity","onMouseUp","e","changedTouches","clientX","clientY","simulatedEvent","MouseEvent","bubbles","elementFromPoint","_document$elementFrom","undefined","axis","defaultClassName","split","isNaN","classes","Array","from","_e$target","some","elm","window","getComputedStyle","matrix","DOMMatrixReadOnly","transform","m41","m42","isTouch","abs","position","ItemContainer","onMouseEnter","onMouseLeave","itemToRender","texturePath","allowedEquipSlotType","_itemToRender$allowed","element","_id","getItemTextureKeyPath","isStackable","stackInfo","uuidv4","renderEquipment","renderItem","onRenderSlot","ItemTooltip","optionId","rarityColor","rarity","ItemRarities","Uncommon","Rare","Epic","Legendary","statisticsToDisplay","higherIsWorse","ItemInfo","itemToCompare","renderMissingStatistic","statistics","stat","itemToCompareStatistic","toUpperCase","slice","Statistic","toString","skillName","minRequirements","_item$minRequirements","skill","_item$minRequirements2","Header","Rarity","Type","subType","AllowedSlots","slotType","LevelRequirement","_item$minRequirements3","level","charAt","_item$minRequirements4","_item$minRequirements5","itemStatistic","isItemToCompare","isOnlyInOneItem","statDiff","_itemToCompare$stat$k2","isDifference","isBetter","renderStatistics","entityEffects","entityEffectChance","effect","usableEffectDescription","equippedBuffDescription","isTwoHanded","Description","description","maxStackSize","StackInfo","MissingStatistics","$isSpecial","itemSlotTypes","useMemo","_item$allowedEquipSlo","allowedSlotTypeCamelCase","camelCase","itemSubTypeCamelCase","getSlotType","itemFromEquipment","values","Flex","CompareContainer","Equipped","$isMobile","handleMouseMove","rect","getBoundingClientRect","tooltipWidth","tooltipHeight","isOffScreenRight","innerWidth","isOffScreenBottom","innerHeight","ItemInfoWrapper","setIsTooltipVisible","bind","log","CraftingRecipe","recipe","handleRecipeSelect","selectedCraftItemKey","skills","modifyString","str","parts","words","replace","concat","join","levelInSkill","minCraftingRequirements","_recipe$minCraftingRe2","_skills","RadioOptionsWrapper","SpriteAtlasWrapper","canCraft","display","MinCraftingRequirementsText","levelIsOk","_recipe$minCraftingRe4","_recipe$minCraftingRe6","ingredients","ingredient","itemQtyInInventory","Recipe","Ingredient","isQuantityOk","qty","desktop","mobileLanscape","mobilePortrait","Wrapper","Subtitle","RadioInputScroller","ButtonWrapper","ContentContainer","ItemTypes","Dropdown","dropdownId","selectedValue","setSelectedValue","selectedOption","setSelectedOption","opened","setOpened","firstOption","change","filter","o","DropdownSelect","prev","DropdownOptions","ul","Details","EquipmentSetContainer","EquipmentColumn","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","RangeSliderType","NPCMultiDialog","textAndTypeArray","slide","setSlide","_textAndTypeArray$sli","imageSide","BackgroundContainer","imgPath","DialogContainer","CarouselWrapper","ArrowContainer","BackgroundImage","isTextFixed","textPosition","SlotsContainer","Framed","OrderByType","RangeSlider","valueMin","valueMax","sliderId","containerRef","left","setLeft","calculatedWidth","_containerRef$current","clientWidth","max","typeClass","GoldSlider","pointerEvents","min","Number","ItemQuantitySelector","onConfirm","setValue","inputRef","focus","select","closeSelector","StyledContainer","StyledForm","onSubmit","preventDefault","numberValue","noValidate","StyledInput","placeholder","onBlur","newValue","Slider","RPGUIButton","ShortcutsSetter","setSettingShortcutIndex","settingShortcutIndex","shortcuts","removeShortcut","List","Shortcut","ShortcutType","None","isBeingSet","_shortcuts$index","payload","_shortcuts$index2","shortcut","Spell","getContent","ItemsContainer","QuantitySelectorContainer","Pager","totalItems","currentPage","onPageChange","totalPages","ceil","itemsPerPage","PagerContainer","ConfirmModal","message","Background","stopPropagation","ButtonsWrapper","MarketplaceRows","itemPrice","onMarketPlaceItemBuy","onMarketPlaceItemRemove","MarketplaceWrapper","ItemIconContainer","SpriteContainer","RarityContainer","QuantityContainer","PriceValue","GoldContainer","itemTypeOptions","ItemSubType","itemType","itemRarityOptions","itemRarity","orderByOptions","flatMap","orderBy","BuyPanel","items","onChangeType","onChangeRarity","onChangeOrder","onChangeNameInput","onChangeMainLevelInput","onChangeSecondaryLevelInput","onChangePriceInput","characterId","enableHotkeys","disableHotkeys","setName","mainLevel","setMainLevel","secondaryLevel","setSecondaryLevel","price","setPrice","buyingItemId","setBuyingItemId","itemsContainer","_itemsContainer$curre","scrollTo","InputWrapper","onFocus","OptionsWrapper","FilterInputsWrapper","AiFillCaretRight","WrapperContainer","StyledDropdown","ItemComponentScrollWrapper","owner","ManagmentPanel","availableGold","selectedItemToSell","onSelectedItemToSellRemove","onAddItemToMarketplace","onMoneyWithdraw","isCreatingOffer","setIsCreatingOffer","removingItemId","setRemovingItemId","InnerOptionsWrapper","SellDescription","__","PriceInputWrapper","AvailableGold","$disabled","PartyRow","charName","charClass","charLevel","playerQty","isInvited","PartyWrapper","partyName","RowsWrapper","PlayersRow","isNotInvited","PartyManagerRow","isLeader","leaderId","onRemovePlayer","onChangeLeader","YellowText","NotInParty","mockedPartyRows","mockedPlayersRows2","leader","class","CharacterClass","Druid","members","maxSize","mockedPlayersRows","mockedPartyManager","ProgressBarText","minWidth","percentageWidth","mobileScale","QuestDraggableContainer","QuestContainer","QuestsContainer","Content","QuestSplitDiv","QuestColumn","Thumbnail","QuestListContainer","NoQuestContainer","_RPGUI","RPGUI","SimpleProgressBar","_ref$bgColor","bgColor","_ref$margin","margin","ProgressBarContainer","BackgroundBar","Progress","SkillProgressBar","skillPoints","skillPointsToNextLevel","_ref$showSkillPoints","showSkillPoints","buffAndDebuff","ratio","getSPForLevel","skillsBuffsCalc","result","toFixed","ProgressTitle","BuffAndDebuffContainer","TitleNameContainer","TitleNameBuff","TitleNameBuffContainer","TitleNameDebuff","TitleName","ValueDisplay","ProgressBody","ProgressIconContainer","SkillDisplayContainer","SkillPointsDisplay","skillProps","attributes","stamina","magic","magicResistance","strength","resistance","dexterity","combat","first","club","sword","axe","distance","shielding","dagger","crafting","fishing","mining","lumberjacking","blacksmithing","cooking","alchemy","skillNameMap","SkillsDraggableContainer","SkillsContainerDiv","SkillSplitDiv","SpellInfo","spell","magicWords","manaCost","requiredItem","castingType","cooldown","maxDistanceGrid","word","formatSpellCastingType","SpellInfoDisplay","MobileSpellTooltip","MagicTooltip","SpellInfoWrapper","charMana","charMagicLevel","isSettingShortcut","activeCooldown","minMagicLevelRequired","spellKey","Overlay","SpellImage","Info","Divider","Cost","SpellList","DayNightPeriod","periodOfDay","periodOfDaySrcFiles","PeriodOfDay","Morning","Afternoon","Night","GifContainer","WidgetContainer","Time","DayNightContainer","TradingItemRow","onQuantityChange","traderItem","selectedQty","onLeftClick","onRightClick","ItemWrapper","ItemNameContainer","NameValue","capitalize","StyledArrow","QuantityDisplay","TradingComponentScrollWrapper","TotalWrapper","GoldWrapper","AlertWrapper","availableCharacters","propertySelectValues","textureKey","selectedSpriteKey","setSelectedSpriteKey","paddingBottom","chatMessages","onSendChatMessage","_ref$styles","styles","textColor","setMessage","scrollChatToBottom","scrollingElement","querySelector","scrollTop","scrollHeight","fallback","emitter","createdAt","dayjs","Date","format","onRenderMessageLines","onRenderChatMessages","trim","autoComplete","autoFocus","RxPaperPlane","FramedGrey","selectedValues","generateSelectedValuesList","setSelectedValues","onActionClick","onCancelClick","mana","spellCooldowns","onShortcutClick","onTouchStart","remove","buildClassName","classBase","isOnCooldown","variant","onShortcutClickBinded","_shortcuts$i","isOnShortcutCooldown","_shortcuts$i2","_shortcuts$i3","itemsFromEquipment","totalQty","_shortcuts$i4","spellCooldown","replaceAll","renderShortcut","onSelect","onCraftItem","craftablesItems","savedSelectedType","craftItemKey","setCraftItemKey","selectedType","setSelectedType","setSize","handleResize","itemTypes","sort","a","b","localeCompare","rows","row","gap","renderItemTypes","details","onItemClick","onItemDragEnd","onItemDragStart","onItemPlaceDrop","onItemOutsideDrop","equipmentData","neck","leftHand","ring","head","armor","legs","boot","rightHand","accessory","equipmentMaskSlots","ItemSlotType","onRenderEquipmentSlotRange","start","end","equipmentRange","slotMaksRange","itemContainer","ContainerType","backgroundImgPath","fullCoverBackground","setImage","fullImg","textImage","textImageSelected","setTextImageSelected","goToPreviousImage","indexOf","goToNextImage","image","handleClick","_ref$disableContextMe","disableContextMenu","isOpen","maxQuantity","callback","_quantity","quantitySelect","setQuantitySelect","handleSetShortcut","slotQty","_itemContainer$slots","onRenderSlots","imageKey","onYourPanelToggle","isYourPanel","setIsYourPanel","onCreate","close","partyRows","playersRows","invitationActionText","partyRow","_ref$displayText","displayText","_ref$percentageWidth","_ref$minWidth","calculatePercentageValue","quests","buttons","onChangeQuest","questsLength","thumbnail","thumbnailDefault","onClick","npcId","quest","_ref$isBlockedCasting","isBlockedCastingByKeyboard","shortcutsRefs","handleKeyDown","shortcutIndex","_shortcutsRefs$curren","_shortcutsRefs$curren2","XPLevelActual","XPLevelBefore","onRenderSkillCategory","category","SPLevelActual","SPLevelBefore","skillCategory","skillCategoryColor","output","entries","skillDetails","experience","getXPForLevel","onInputFocus","onInputBlur","spells","magicLevel","onSpellClick","setSpellShortcut","iconAtlasIMG","iconAtlasJSON","search","setSearch","spellsToDisplay","toLocaleLowerCase","setShortcut","Fragment","TimeClock","traderItems","characterAvailableGold","sum","setSum","Map","qtyMap","setQtyMap","set","newSum","get","isBuy","hasGoldForSale","tradeItem","assign"],"mappings":"+lCAAO,ICIKA,0DAAAA,EAAAA,sBAAAA,oDAEVA,4CCHUC,EDcCC,EAAS,oBACpBC,SAAAA,gBACAC,IAAAA,SACAC,IAAAA,WACAC,IAAAA,cACGC,SAEH,OACEC,gBAACC,iBACCC,aAAcL,EACdF,SAAUA,GACNI,GACJD,cAAe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