@rpg-engine/long-bow 0.3.82 → 0.3.84

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.
@@ -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/CircularController/CircularController.tsx","../src/hooks/useOutsideAlerter.ts","../src/components/NPCDialog/NPCDialog.tsx","../src/components/DraggableContainer.tsx","../src/components/Dropdown.tsx","../src/components/Abstractions/ModalPortal.tsx","../src/components/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/CraftBook.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/Abstractions/SlotsContainer.tsx","../src/components/Item/Inventory/ItemQuantitySelector.tsx","../src/components/Shortcuts/ShortcutsSetter.tsx","../src/components/Item/Inventory/ItemContainer.tsx","../src/components/itemSelector/ItemSelector.tsx","../src/components/ListMenu.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/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/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 <div className={`ellipsis-${maxLines}-lines`}>{children}</div>\n </Container>\n );\n};\n\ninterface IContainerProps {\n maxWidth?: string;\n fontSize?: string;\n center?: boolean;\n}\n\nconst Container = styled.div<IContainerProps>`\n .ellipsis-1-lines {\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n max-width: ${props => props.maxWidth};\n\n ${props => props.center && `margin: 0 auto;`}\n }\n .ellipsis-2-lines {\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 }\n .ellipsis-3-lines {\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 }\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 entitiesJSON from '../../mocks/atlas/entities/entities.json';\nimport entitiesIMG from '../../mocks/atlas/entities/entities.png';\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 onChange: (textureKey: string) => void;\n}\n\nexport const CharacterSelection: React.FC<ICharacterSelectionProps> = ({\n availableCharacters,\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 && (\n <ErrorBoundary>\n <SpriteFromAtlas\n spriteKey={selectedSpriteKey}\n atlasIMG={entitiesIMG}\n atlasJSON={entitiesJSON}\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: '#757161',\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: '#6DAA2C',\n brownGreen: '#346524',\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 &: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 {\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';\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};\n\nexport const CircularController: React.FC<CircularControllerProps> = ({\n onActionClick,\n onCancelClick,\n onShortcutClick,\n mana,\n shortcuts,\n inventory,\n atlasIMG,\n atlasJSON,\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 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 ? onShortcutClick.bind(null, i)\n : () => {};\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 {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 },\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=\"qty\">{totalQty}</span>\n </StyledShortcut>\n );\n }\n\n const payload = shortcuts[i]?.payload as IRawSpell | undefined;\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 <span className=\"mana\">{payload && payload.manaCost}</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: 6 }).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\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\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\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(-120%, calc(-5.5rem));\n }\n\n .bottom-2 {\n transform: translate(-30%, calc(-5.5rem - 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, { DraggableData } 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 onOutsideClick?: () => void;\n initialPosition?: IPosition;\n scale?: number;\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 onOutsideClick,\n initialPosition = { x: 0, y: 0 },\n scale,\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 onDrag={(_e, data: DraggableData) => {\n if (onPositionChange) {\n onPositionChange({\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.1rem;\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, { 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;\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>('');\n const [opened, setOpened] = useState<boolean>(false);\n\n useEffect(() => {\n const firstOption = options[0];\n\n if (firstOption && !selectedValue) {\n setSelectedValue(firstOption.value);\n setSelectedOption(firstOption.option);\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 onPointerDown={() => 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 onPointerDown={() => {\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\nconst DropdownOptions = styled.ul<{\n opened: boolean;\n}>`\n position: absolute;\n width: 100%;\n display: ${props => (props.opened ? 'block' : 'none')};\n box-sizing: border-box;\n`;\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport styled from 'styled-components';\n\nconst modalRoot = document.getElementById('modal-root')!;\n\ninterface ModalPortalProps {\n children: React.ReactNode;\n}\n\nconst ModalPortal: React.FC<ModalPortalProps> = ({ children }) => {\n return ReactDOM.createPortal(\n <Container className=\"rpgui-content\">{children}</Container>,\n modalRoot\n );\n};\n\nconst Container = styled.div`\n position: static !important;\n`;\n\nexport default ModalPortal;\n","import React, { useEffect, useRef } from 'react';\nimport styled from 'styled-components';\nimport { useOutsideClick } from '../hooks/useOutsideAlerter';\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}\n\nexport const RelativeListMenu: React.FC<IRelativeMenuProps> = ({\n options,\n onSelected,\n onOutsideClick,\n fontSize = 0.8,\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 <Container fontSize={fontSize} ref={ref}>\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 fontSize?: number;\n}\n\nconst Container = styled.div<IContainerProps>`\n position: absolute;\n top: 1rem;\n left: 4rem;\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: 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 {\n ActionsForEquipmentSet,\n ActionsForInventory,\n ActionsForLoot,\n ActionsForMapContainer,\n IItem,\n ItemContainerType,\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) => {\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 (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\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}\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 }) => {\n const [isTooltipVisible, setTooltipVisible] = useState(false);\n const [isTooltipMobileVisible, setIsTooltipMobileVisible] = useState(false);\n\n const [isContextMenuVisible, setIsContextMenuVisible] = useState(false);\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) {\n setContextActions(generateContextMenu(item, containerType));\n }\n }, [item]);\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 },\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 },\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) 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 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 onStop={(e, data) => {\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\n onPointerDown(item.type, containerType, item);\n }\n }}\n onStart={() => {\n if (!item || isSelectingShortcut) {\n return;\n }\n\n if (onDragStart) {\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(event, slotIndex, item, event.clientX, event.clientY);\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 />\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 = [];\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 = [];\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 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 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 {renderStatistics()}\n {item.isTwoHanded && <Statistic>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: 15rem;\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 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 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\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 itemFromEquipment = 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\n @media (max-width: 580px) {\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 { ICraftableItem, IEquipmentSet, ItemSubType } from '@rpg-engine/shared';\nimport React, { useState } from 'react';\nimport styled from 'styled-components';\nimport { Button, ButtonTypes } from '../Button';\nimport { DraggableContainer } from '../DraggableContainer';\nimport { Dropdown, IOptionsProps } from '../Dropdown';\nimport { ItemInfoWrapper } from '../Item/Cards/ItemInfoWrapper';\nimport { RPGUIContainerTypes } from '../RPGUIContainer';\nimport { SpriteFromAtlas } from '../shared/SpriteFromAtlas';\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 scale?: number;\n}\n\nexport interface ShowMessage {\n show: boolean;\n index: number;\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}) => {\n let optionsId: number = 0;\n const [isShown, setIsShown] = useState<ShowMessage>({\n show: false,\n index: 200,\n });\n const [craftItem, setCraftItem] = useState<string>();\n\n const getDropdownOptions = () => {\n const options: IOptionsProps[] = [];\n\n Object.keys(ItemSubType).forEach(key => {\n if (key === 'DeadBody') {\n return; // we can't craft crafting resouces...\n }\n\n options.push({\n id: optionsId,\n value: key,\n option: key,\n });\n optionsId += 1;\n });\n\n return options;\n };\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 handleClick = (value: string) => {\n setCraftItem(value);\n };\n\n return (\n <DraggableContainer\n type={RPGUIContainerTypes.Framed}\n width=\"500px\"\n cancelDrag=\".inputRadioCraftBook\"\n onCloseButton={() => {\n if (onClose) {\n onClose();\n }\n }}\n scale={scale}\n >\n <div style={{ width: '100%' }}>\n <Title>Craftbook</Title>\n <Subtitle>Select an item to craft</Subtitle>\n <hr className=\"golden\" />\n </div>\n <Dropdown\n options={getDropdownOptions()}\n onChange={value => onSelect(value)}\n />\n <RadioInputScroller className=\"inputRadioCraftBook\">\n {craftablesItems?.map((option, index) => (\n <RadioOptionsWrapper key={index}>\n <SpriteAtlasWrapper>\n <ItemInfoWrapper\n item={option}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n equipmentSet={equipmentSet}\n scale={scale}\n >\n <SpriteFromAtlas\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={option.texturePath}\n imgScale={3}\n grayScale={!option.canCraft}\n />\n </ItemInfoWrapper>\n </SpriteAtlasWrapper>\n <div>\n <div onPointerDown={() => handleClick(option.key)}>\n <input\n className=\"rpgui-radio\"\n type=\"radio\"\n value={option.name}\n name=\"test\"\n disabled={!option.canCraft}\n checked={craftItem === option.key}\n onChange={() => handleClick(option.key)}\n />\n <label\n onPointerDown={() => {\n handleClick(option.key);\n }}\n onTouchEnd={() => {\n setIsShown({ show: true, index: index });\n }}\n style={{ display: 'flex', alignItems: 'center' }}\n onMouseEnter={() => setIsShown({ show: true, index: index })}\n onMouseLeave={() => setIsShown({ show: false, index: index })}\n >\n {modifyString(option.name)}\n </label>\n </div>\n\n {isShown &&\n isShown.index === index &&\n option.ingredients.map((option, index) => (\n <Recipes key={index}>\n <SpriteFromAtlas\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={option.texturePath}\n imgScale={1}\n />\n <StyledItem>\n {modifyString(option.key)} ({option.qty}x)\n </StyledItem>\n </Recipes>\n ))}\n </div>\n </RadioOptionsWrapper>\n ))}\n </RadioInputScroller>\n <ButtonWrapper>\n <Button buttonType={ButtonTypes.RPGUIButton} onPointerDown={onClose}>\n Cancel\n </Button>\n <Button\n buttonType={ButtonTypes.RPGUIButton}\n onPointerDown={() => onCraftItem(craftItem)}\n >\n Craft\n </Button>\n </ButtonWrapper>\n </DraggableContainer>\n );\n};\n\nconst StyledItem = styled.div`\n margin-left: 10px;\n`;\n\nconst Recipes = styled.div`\n font-size: 0.6rem;\n color: yellow !important;\n margin-bottom: 3px;\n display: flex;\n align-items: center;\n\n .sprite-from-atlas-img {\n top: 0px;\n left: 0px;\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 -webkit-overflow-scrolling: touch;\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 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}\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}) => {\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 >\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 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 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 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 onOutsideClick={onOutsideClick}\n initialPosition={initialPosition}\n scale={scale}\n >\n {children}\n </DraggableContainer>\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 },\n atlasJSON\n )}\n width={32}\n height={32}\n imgScale={1.6}\n imgStyle={{ left: '5px' }}\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: 6 }).map((_, i) => (\n <Shortcut\n key={i}\n onPointerDown={() => {\n removeShortcut(i);\n if (!shortcuts[i] || shortcuts[i].type === ShortcutType.None)\n setSettingShortcutIndex(i);\n }}\n disabled={settingShortcutIndex !== -1 && settingShortcutIndex !== i}\n isBeingSet={settingShortcutIndex === 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 }\n`;\n\nconst Shortcut = styled.button<{ isBeingSet?: boolean }>`\n width: 2.6rem;\n height: 2.6rem;\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.5rem;\n padding-bottom: 0.5rem;\n padding-left: 0.5rem;\n box-sizing: border-box;\n margin: 0 !important;\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}\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}) => {\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 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 if (\n itemType === ItemType.Consumable ||\n itemType === ItemType.Tool\n ) {\n setItemShortcut?.(item.key, settingShortcutIndex);\n }\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 />\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 >\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, { 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 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 { 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}\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}) => {\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 >\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}\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`;\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 { SpriteFromAtlas } from '../shared/SpriteFromAtlas';\nimport { SingleShortcut } from './SingleShortcut';\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};\n\nexport const Shortcuts: React.FC<ShortcutsProps> = ({\n shortcuts,\n onShortcutCast,\n mana,\n isBlockedCastingByKeyboard = false,\n atlasJSON,\n atlasIMG,\n inventory,\n}) => {\n const shortcutsRefs = useRef<HTMLButtonElement[]>([]);\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 <= 5) {\n onShortcutCast(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]);\n\n return (\n <List>\n {Array.from({ length: 6 }).map((_, i) => {\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 onPointerDown={onShortcutCast.bind(null, i)}\n disabled={false}\n ref={el => {\n if (el) shortcutsRefs.current[i] = el;\n }}\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 },\n atlasJSON\n )}\n width={32}\n height={32}\n />\n )}\n <span className=\"qty\">{totalQty}</span>\n <span className=\"keyboard\">{i + 1}</span>\n </StyledShortcut>\n );\n }\n\n const payload = shortcuts[i]?.payload as IRawSpell | undefined;\n\n return (\n <StyledShortcut\n key={i}\n onPointerDown={onShortcutCast.bind(null, i)}\n disabled={mana < (payload?.manaCost ?? 0)}\n ref={el => {\n if (el) shortcutsRefs.current[i] = el;\n }}\n >\n <span className=\"mana\">{payload && payload.manaCost}</span>\n <span className=\"magicWords\">\n {payload?.magicWords.split(' ').map(word => word[0])}\n </span>\n <span className=\"keyboard\">{i + 1}</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","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 { ErrorBoundary } from './Item/Inventory/ErrorBoundary';\nimport { SpriteFromAtlas } from './shared/SpriteFromAtlas';\nimport { SimpleProgressBar } from './SimpleProgressBar';\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}\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}) => {\n if (!skillPointsToNextLevel) {\n skillPointsToNextLevel = getSPForLevel(level + 1);\n }\n\n const nextLevelSPWillbe = skillPoints + skillPointsToNextLevel;\n\n const ratio = (skillPoints / nextLevelSPWillbe) * 100;\n\n return (\n <>\n <ProgressTitle>\n <TitleName>{skillName}</TitleName>\n <ValueDisplay>lv {level}</ValueDisplay>\n </ProgressTitle>\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}/{nextLevelSPWillbe}\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 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: row;\n justify-content: space-between;\n span {\n font-size: 0.6rem;\n }\n`;\n","import { ISkill, ISkillDetails } 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 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 //@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(skillDetails.skillPointsToNextLevel) || 0\n }\n texturePath={value}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n />\n );\n }\n\n return output;\n };\n\n return (\n <SkillsDraggableContainer\n title=\"Skills\"\n cancelDrag=\"#skillsDiv\"\n scale={scale}\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={Math.round(skill.xpToNextLevel) || 0}\n texturePath={'swords/broad-sword.png'}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n />\n\n <p>Combat Skills</p>\n <hr className=\"golden\" />\n </SkillSplitDiv>\n\n {onRenderSkillCategory('combat')}\n\n <SkillSplitDiv>\n <p>Crafting Skills</p>\n <hr className=\"golden\" />\n </SkillSplitDiv>\n\n {onRenderSkillCategory('crafting')}\n\n <SkillSplitDiv>\n <p>Basic Attributes</p>\n <hr className=\"golden\" />\n </SkillSplitDiv>\n\n {onRenderSkillCategory('attributes')}\n </SkillsContainerDiv>\n </SkillsDraggableContainer>\n );\n};\n\nconst SkillsDraggableContainer = styled(DraggableContainer)`\n border: 1px solid black;\n width: 400px;\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 { IRawSpell } from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\nimport { uiFonts } from '../../constants/uiFonts';\n\ninterface Props extends IRawSpell {\n charMana: number;\n charMagicLevel: number;\n onPointerDown?: (spellKey: string) => void;\n isSettingShortcut?: boolean;\n spellKey: string;\n}\n\nexport const Spell: React.FC<Props> = ({\n spellKey,\n name,\n description,\n magicWords,\n manaCost,\n charMana,\n charMagicLevel,\n onPointerDown,\n isSettingShortcut,\n minMagicLevelRequired,\n}) => {\n const disabled = isSettingShortcut\n ? charMagicLevel < minMagicLevelRequired\n : manaCost > charMana || charMagicLevel < minMagicLevelRequired;\n\n return (\n <Container\n disabled={disabled}\n onPointerDown={onPointerDown?.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>{magicWords.split(' ').map(word => word[0])}</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 );\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 height: 5rem;\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`;\n\nconst Info = styled.span`\n width: 0;\n flex: 1;\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 { IRawSpell, IShortcut } from '@rpg-engine/shared';\nimport React, { Fragment, useEffect, 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: IRawSpell[];\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}\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}) => {\n const [search, setSearch] = useState('');\n const [settingShortcutIndex, setSettingShortcutIndex] = useState(-1);\n\n useEffect(() => {\n const handleEscapeClose = (e: KeyboardEvent) => {\n if (e.key === 'Escape') {\n onClose?.();\n }\n };\n\n document.addEventListener('keydown', handleEscapeClose);\n\n return () => {\n document.removeEventListener('keydown', handleEscapeClose);\n };\n }, [onClose]);\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 onPointerDown={\n settingShortcutIndex !== -1 ? setShortcut : onSpellClick\n }\n spellKey={spell.key}\n isSettingShortcut={settingShortcutIndex !== -1}\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 },\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`;\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';\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","CancelButton","ButtonsContainer","ShortcutsContainer","StyledShortcut","useOutsideClick","id","handleClickOutside","event","current","contains","target","CustomEvent","detail","document","dispatchEvent","addEventListener","removeEventListener","NPCDialogType","DraggableContainer","_ref$type","FramedGold","onCloseButton","title","imgSrc","_ref$imgWidth","imgWidth","cancelDrag","onPositionChange","onOutsideClick","_ref$initialPosition","initialPosition","draggableRef","useRef","_e","Draggable","cancel","onDrag","data","defaultPosition","TitleContainer","Title","Icon","src","h1","img","Dropdown","options","dropdownId","uuidv4","selectedValue","setSelectedValue","selectedOption","setSelectedOption","opened","setOpened","firstOption","value","option","onMouseLeave","DropdownSelect","prev","DropdownOptions","map","key","ul","modalRoot","getElementById","ModalPortal","ReactDOM","createPortal","RelativeListMenu","onSelected","_ref$fontSize","overflow","params","ListElement","text","li","MobileItemTooltip","closeTooltip","equipmentSet","_ref$scale","handleFadeOut","_ref$current","classList","add","onTouchEnd","setTimeout","ItemInfoDisplay","isMobile","OptionsContainer","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","isTooltipVisible","setTooltipVisible","isTooltipMobileVisible","setIsTooltipMobileVisible","isContextMenuVisible","setIsContextMenuVisible","isFocused","setIsFocused","wasDragged","setWasDragged","dragPosition","setDragPosition","dropPosition","setDropPosition","dragContainer","contextActions","setContextActions","contextActionMenu","ItemContainerType","ItemType","Weapon","Armor","Jewelry","ActionsForInventory","Equipment","Consumable","CraftingResource","Tool","Other","ActionsForEquipmentSet","Loot","ActionsForLoot","MapContainer","ActionsForMapContainer","contextActionMenuDontHaveUseWith","find","toLowerCase","includes","hasUseWith","push","generateContextMenu","getStackInfo","itemId","stackQty","qtyClassName","ItemQtyContainer","ItemQty","Math","round","resetItem","onSuccesfulDrag","quantity","onMouseUp","e","changedTouches","clientX","clientY","simulatedEvent","MouseEvent","bubbles","elementFromPoint","_document$elementFrom","axis","defaultClassName","onStop","classes","Array","from","_e$target","some","elm","window","getComputedStyle","matrix","DOMMatrixReadOnly","transform","m41","m42","isTouch","onStart","abs","position","ItemContainer","onMouseEnter","itemToRender","texturePath","allowedEquipSlotType","_itemToRender$allowed","element","_id","getItemTextureKeyPath","stackInfo","renderEquipment","renderItem","onRenderSlot","ItemTooltip","optionId","rarityColor","rarity","ItemRarities","Uncommon","Rare","Epic","Legendary","statisticsToDisplay","label","higherIsWorse","ItemInfo","itemToCompare","renderMissingStatistic","statistics","stat","itemToCompareStatistic","toUpperCase","slice","Statistic","toString","Header","Rarity","Type","subType","AllowedSlots","slotType","itemStatistic","isItemToCompare","isOnlyInOneItem","statDiff","parseInt","_itemToCompare$stat$k2","isDifference","isBetter","renderStatistics","isTwoHanded","Description","description","maxStackSize","StackInfo","MissingStatistics","itemSlotTypes","useMemo","_item$allowedEquipSlo","allowedSlotTypeCamelCase","camelCase","itemSubTypeCamelCase","getSlotType","itemFromEquipment","Flex","CompareContainer","Equipped","$isMobile","handleMouseMove","rect","getBoundingClientRect","tooltipWidth","tooltipHeight","isOffScreenRight","innerWidth","isOffScreenBottom","innerHeight","ItemInfoWrapper","setIsTooltipVisible","bind","log","StyledItem","Recipes","Subtitle","RadioInputScroller","SpriteAtlasWrapper","RadioOptionsWrapper","ButtonWrapper","Details","EquipmentSetContainer","EquipmentColumn","IS_MOBILE_OR_TABLET","isMobileOrTablet","DynamicText","onFinish","textState","setTextState","i","interval","setInterval","substring","clearInterval","TextContainer","NPCDialogText","str","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","SlotsContainer","Framed","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","isNaN","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","split","word","getContent","ItemsContainer","QuantitySelectorContainer","ProgressBarText","minWidth","percentageWidth","QuestDraggableContainer","QuestContainer","QuestsContainer","Content","QuestSplitDiv","QuestColumn","Thumbnail","QuestListContainer","NoQuestContainer","_RPGUI","RPGUI","SimpleProgressBar","_ref$bgColor","bgColor","_ref$margin","margin","ProgressBarContainer","BackgroundBar","Progress","SkillProgressBar","skillName","level","skillPoints","skillPointsToNextLevel","_ref$showSkillPoints","showSkillPoints","getSPForLevel","nextLevelSPWillbe","ratio","ProgressTitle","TitleName","ValueDisplay","ProgressBody","ProgressIconContainer","SpriteContainer","SkillDisplayContainer","SkillPointsDisplay","skillProps","attributes","values","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","Spell","manaCost","charMana","charMagicLevel","isSettingShortcut","minMagicLevelRequired","spellKey","Overlay","SpellImage","Info","Divider","Cost","SpellList","DayNightPeriod","periodOfDay","periodOfDaySrcFiles","PeriodOfDay","Morning","Afternoon","Night","GifContainer","WidgetContainer","Time","DayNightContainer","TradingItemRow","onQuantityChange","traderItem","selectedQty","onLeftClick","qty","onRightClick","ItemWrapper","ItemIconContainer","ItemNameContainer","NameValue","capitalize","price","QuantityContainer","StyledArrow","QuantityDisplay","TradingComponentScrollWrapper","TotalWrapper","GoldWrapper","AlertWrapper","availableCharacters","propertySelectValues","textureKey","selectedSpriteKey","setSelectedSpriteKey","entitiesJSON","display","paddingBottom","chatMessages","onSendChatMessage","onFocus","_ref$styles","styles","textColor","message","setMessage","scrollChatToBottom","scrollingElement","querySelector","scrollTop","scrollHeight","fallback","emitter","createdAt","dayjs","Date","format","onRenderMessageLines","onRenderChatMessages","trim","autoComplete","autoFocus","borderRadius","RxPaperPlane","FramedGrey","items","selectedValues","forEach","generateSelectedValuesList","setSelectedValues","checked","onActionClick","onCancelClick","onShortcutClick","mana","inventory","onTouchStart","remove","variant","onShortcutClickBinded","_shortcuts$i","_shortcuts$i2","_shortcuts$i3","itemsFromEquipment","Object","keys","slots","_inventory$slots$inde","totalQty","reduce","acc","_shortcuts$i4","renderShortcut","onSelect","onCraftItem","craftablesItems","optionsId","show","isShown","setIsShown","craftItem","setCraftItem","modifyString","parts","words","replace","concat","join","handleClick","ItemSubType","canCraft","ingredients","details","onItemClick","onItemDragEnd","onItemDragStart","onItemPlaceDrop","onItemOutsideDrop","equipmentData","neck","leftHand","ring","head","armor","legs","boot","rightHand","accessory","equipmentMaskSlots","ItemSlotType","onRenderEquipmentSlotRange","start","end","equipmentRange","slotMaksRange","itemContainer","itemType","ContainerType","backgroundImgPath","fullCoverBackground","setImage","fullImg","_ref$disableContextMe","disableContextMenu","setItemShortcut","isOpen","maxQuantity","callback","_quantity","quantitySelect","setQuantitySelect","slotQty","_itemContainer$slots","onRenderSlots","imageKey","_ref$displayText","displayText","_ref$percentageWidth","_ref$minWidth","calculatePercentageValue","quests","buttons","onChangeQuest","questsLength","thumbnail","thumbnailDefault","onClick","npcId","quest","onShortcutCast","_ref$isBlockedCasting","isBlockedCastingByKeyboard","shortcutsRefs","handleKeyDown","shortcutIndex","_shortcutsRefs$curren","_shortcutsRefs$curren2","skill","onRenderSkillCategory","category","skillCategory","skillCategoryColor","output","entries","skillDetails","experience","xpToNextLevel","onInputFocus","onInputBlur","spells","magicLevel","onSpellClick","setSpellShortcut","search","setSearch","handleEscapeClose","spellsToDisplay","sort","a","b","filter","spell","toLocaleLowerCase","setShortcut","Fragment","TimeClock","traderItems","characterAvailableGold","sum","setSum","Map","qtyMap","setQtyMap","set","newSum","get","isBuy","hasGoldForSale","tradeItem","assign"],"mappings":"mkCAAO,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,UAASC,IACTC,MAAAA,aAAQC,eAAUC,IAClBC,OAAAA,aAASC,gBAAWC,IACpBC,SAAAA,aAAW,IACXC,IAAAA,SACArB,IAAAA,cACAsB,IAAAA,eAAcC,IACdC,UAAAA,gBAAiBC,IACjBC,QAAAA,aAAU,IACVC,IAAAA,aAKMC,EACJlB,EAAUmB,OAAOjB,IAAcF,EAAUmB,OAAO,uBAElD,IAAKD,EAAY,MAAM,IAAIE,gBAAgBlB,0BAE3C,OACEV,gBAAC6B,GACCjB,MAAOA,EACPG,OAAQA,EACRe,SAAUR,EACVxB,cAAeA,EACfiC,MAAOX,GAEPpB,gBAACgC,GACC9B,oCAAoCuB,GAAgB,IACpDhB,SAAUA,EACVwB,MAAOP,EAAWO,MAClBC,MAAOhB,EACPI,UAAWA,EACXE,QAASA,EACTO,MAAOZ,MAyBTU,EAAY1B,EAAOgC,gBAAG9B,yCAAAC,4BAAVH,mCACP,SAACJ,GAAsB,OAAKA,EAAMa,SACjC,SAACb,GAAsB,OAAKA,EAAMgB,UAC1C,SAAChB,GAAsB,OACtBA,EAAM+B,4GAOLE,EAAY7B,EAAOgC,gBAAG9B,yCAAAC,4BAAVH,2KACP,SAAAJ,GAAK,OAAIA,EAAMkC,MAAMG,KACpB,SAAArC,GAA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SACnBZ,gBAACqJ,SA7BWuZ,EA6BOtc,GA5Bb,GAAGuP,cAAgB+M,EAAK1I,UAAU,YA6BxCla,sBAAIE,UAAU,YAEhBF,gBAAC4pB,IAA8B1iB,GAAG,mBAC/B8tB,EAAYrqB,KAAI,SAACirB,EAAW3wB,GAAK,MAAA,OAChCjF,gBAACmpB,IAAYve,IAAQgrB,EAAUhrB,QAAO3F,GACpCjF,gBAAC4oB,IACCnoB,SAAUA,EACVD,UAAWA,EACXqoB,iBAAkBA,EAClBC,WAAY8M,EACZ7M,qBAAasM,EAAOI,IAAIG,EAAUhrB,QAAQ,EAC1CiB,aAAcA,EACd3J,MAAOA,SAKflC,gBAAC8pB,QACC9pB,4CACAA,6BAAKi1B,IAEPj1B,gBAAC6pB,QACC7pB,mCACAA,6BAAKk1B,IAELS,IAKA31B,gBAAC8pB,QACC9pB,wCACAA,6BArEJ01B,IACKT,EAAyBC,EAEzBD,EAAyBC,IA4D5Bl1B,gBAAC+pB,QACC/pB,uDASJA,gBAACqZ,QACCrZ,gBAACN,GACCG,WAAYL,oBAAYmiB,YACxBhiB,UAAWg2B,IACX71B,cAAe,WAAA,OAjEjBqsB,EAA6B,GAEnC6I,EAAY3I,SAAQ,SAAAloB,GAClB,IAAM8kB,EAAMoM,EAAOI,IAAItxB,EAAKyG,KACxBqe,GACFkD,EAAMhb,KAAKmc,OAAOuI,OAAO,GAAI1xB,EAAM,CAAE8kB,IAAKA,aAI9CxI,EAAU0L,GAVW,IACfA,eAqEAnsB,gBAACN,GACCG,WAAYL,oBAAYmiB,YACxB7hB,cAAe,WAAA,OAAM2a,qCCxIS,oBAAGxW,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/CircularController/CircularController.tsx","../src/hooks/useOutsideAlerter.ts","../src/components/NPCDialog/NPCDialog.tsx","../src/components/DraggableContainer.tsx","../src/components/Dropdown.tsx","../src/components/Abstractions/ModalPortal.tsx","../src/components/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/CraftBook.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/Abstractions/SlotsContainer.tsx","../src/components/Item/Inventory/ItemQuantitySelector.tsx","../src/components/Shortcuts/ShortcutsSetter.tsx","../src/components/Item/Inventory/ItemContainer.tsx","../src/components/itemSelector/ItemSelector.tsx","../src/components/ListMenu.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/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/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 <div className={`ellipsis-${maxLines}-lines`}>{children}</div>\n </Container>\n );\n};\n\ninterface IContainerProps {\n maxWidth?: string;\n fontSize?: string;\n center?: boolean;\n}\n\nconst Container = styled.div<IContainerProps>`\n .ellipsis-1-lines {\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n max-width: ${props => props.maxWidth};\n\n ${props => props.center && `margin: 0 auto;`}\n }\n .ellipsis-2-lines {\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 }\n .ellipsis-3-lines {\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 }\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 entitiesJSON from '../../mocks/atlas/entities/entities.json';\nimport entitiesIMG from '../../mocks/atlas/entities/entities.png';\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 onChange: (textureKey: string) => void;\n}\n\nexport const CharacterSelection: React.FC<ICharacterSelectionProps> = ({\n availableCharacters,\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 && (\n <ErrorBoundary>\n <SpriteFromAtlas\n spriteKey={selectedSpriteKey}\n atlasIMG={entitiesIMG}\n atlasJSON={entitiesJSON}\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: '#757161',\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: '#6DAA2C',\n brownGreen: '#346524',\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 &: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 {\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';\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};\n\nexport const CircularController: React.FC<CircularControllerProps> = ({\n onActionClick,\n onCancelClick,\n onShortcutClick,\n mana,\n shortcuts,\n inventory,\n atlasIMG,\n atlasJSON,\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 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 ? onShortcutClick.bind(null, i)\n : () => {};\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 {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 },\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=\"qty\">{totalQty}</span>\n </StyledShortcut>\n );\n }\n\n const payload = shortcuts[i]?.payload as IRawSpell | undefined;\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 <span className=\"mana\">{payload && payload.manaCost}</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: 6 }).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\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\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\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(-120%, calc(-5.5rem));\n }\n\n .bottom-2 {\n transform: translate(-30%, calc(-5.5rem - 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}\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}) => {\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 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.1rem;\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, { 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;\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>('');\n const [opened, setOpened] = useState<boolean>(false);\n\n useEffect(() => {\n const firstOption = options[0];\n\n if (firstOption && !selectedValue) {\n setSelectedValue(firstOption.value);\n setSelectedOption(firstOption.option);\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 onPointerDown={() => 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 onPointerDown={() => {\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\nconst DropdownOptions = styled.ul<{\n opened: boolean;\n}>`\n position: absolute;\n width: 100%;\n display: ${props => (props.opened ? 'block' : 'none')};\n box-sizing: border-box;\n`;\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport styled from 'styled-components';\n\nconst modalRoot = document.getElementById('modal-root')!;\n\ninterface ModalPortalProps {\n children: React.ReactNode;\n}\n\nconst ModalPortal: React.FC<ModalPortalProps> = ({ children }) => {\n return ReactDOM.createPortal(\n <Container className=\"rpgui-content\">{children}</Container>,\n modalRoot\n );\n};\n\nconst Container = styled.div`\n position: static !important;\n`;\n\nexport default ModalPortal;\n","import 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: 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 {\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 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 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) {\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 },\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 },\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) 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 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 onStop={(e, data) => {\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, item);\n }\n }}\n onStart={() => {\n if (!item || isSelectingShortcut) {\n return;\n }\n\n if (onDragStart) {\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(event, slotIndex, item, event.clientX, event.clientY);\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 = [];\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 = [];\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 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 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 {renderStatistics()}\n {item.isTwoHanded && <Statistic>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: 15rem;\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 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 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\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 itemFromEquipment = 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\n @media (max-width: 580px) {\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 { ICraftableItem, IEquipmentSet, ItemSubType } from '@rpg-engine/shared';\nimport React, { useState } from 'react';\nimport styled from 'styled-components';\nimport { Button, ButtonTypes } from '../Button';\nimport { DraggableContainer } from '../DraggableContainer';\nimport { Dropdown, IOptionsProps } from '../Dropdown';\nimport { ItemInfoWrapper } from '../Item/Cards/ItemInfoWrapper';\nimport { RPGUIContainerTypes } from '../RPGUIContainer';\nimport { SpriteFromAtlas } from '../shared/SpriteFromAtlas';\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 scale?: number;\n}\n\nexport interface ShowMessage {\n show: boolean;\n index: number;\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}) => {\n let optionsId: number = 0;\n const [isShown, setIsShown] = useState<ShowMessage>({\n show: false,\n index: 200,\n });\n const [craftItem, setCraftItem] = useState<string>();\n\n const getDropdownOptions = () => {\n const options: IOptionsProps[] = [];\n\n Object.keys(ItemSubType).forEach(key => {\n if (key === 'DeadBody') {\n return; // we can't craft crafting resouces...\n }\n\n options.push({\n id: optionsId,\n value: key,\n option: key,\n });\n optionsId += 1;\n });\n\n return options;\n };\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 handleClick = (value: string) => {\n setCraftItem(value);\n };\n\n return (\n <DraggableContainer\n type={RPGUIContainerTypes.Framed}\n width=\"500px\"\n cancelDrag=\".inputRadioCraftBook\"\n onCloseButton={() => {\n if (onClose) {\n onClose();\n }\n }}\n scale={scale}\n >\n <div style={{ width: '100%' }}>\n <Title>Craftbook</Title>\n <Subtitle>Select an item to craft</Subtitle>\n <hr className=\"golden\" />\n </div>\n <Dropdown\n options={getDropdownOptions()}\n onChange={value => onSelect(value)}\n />\n <RadioInputScroller className=\"inputRadioCraftBook\">\n {craftablesItems?.map((option, index) => (\n <RadioOptionsWrapper key={index}>\n <SpriteAtlasWrapper>\n <ItemInfoWrapper\n item={option}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n equipmentSet={equipmentSet}\n scale={scale}\n >\n <SpriteFromAtlas\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={option.texturePath}\n imgScale={3}\n grayScale={!option.canCraft}\n />\n </ItemInfoWrapper>\n </SpriteAtlasWrapper>\n <div>\n <div onPointerDown={() => handleClick(option.key)}>\n <input\n className=\"rpgui-radio\"\n type=\"radio\"\n value={option.name}\n name=\"test\"\n disabled={!option.canCraft}\n checked={craftItem === option.key}\n onChange={() => handleClick(option.key)}\n />\n <label\n onPointerDown={() => {\n handleClick(option.key);\n }}\n onTouchEnd={() => {\n setIsShown({ show: true, index: index });\n }}\n style={{ display: 'flex', alignItems: 'center' }}\n onMouseEnter={() => setIsShown({ show: true, index: index })}\n onMouseLeave={() => setIsShown({ show: false, index: index })}\n >\n {modifyString(option.name)}\n </label>\n </div>\n\n {isShown &&\n isShown.index === index &&\n option.ingredients.map((option, index) => (\n <Recipes key={index}>\n <SpriteFromAtlas\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={option.texturePath}\n imgScale={1}\n />\n <StyledItem>\n {modifyString(option.key)} ({option.qty}x)\n </StyledItem>\n </Recipes>\n ))}\n </div>\n </RadioOptionsWrapper>\n ))}\n </RadioInputScroller>\n <ButtonWrapper>\n <Button buttonType={ButtonTypes.RPGUIButton} onPointerDown={onClose}>\n Cancel\n </Button>\n <Button\n buttonType={ButtonTypes.RPGUIButton}\n onPointerDown={() => onCraftItem(craftItem)}\n >\n Craft\n </Button>\n </ButtonWrapper>\n </DraggableContainer>\n );\n};\n\nconst StyledItem = styled.div`\n margin-left: 10px;\n`;\n\nconst Recipes = styled.div`\n font-size: 0.6rem;\n color: yellow !important;\n margin-bottom: 3px;\n display: flex;\n align-items: center;\n\n .sprite-from-atlas-img {\n top: 0px;\n left: 0px;\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 -webkit-overflow-scrolling: touch;\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 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 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 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 },\n atlasJSON\n )}\n width={32}\n height={32}\n imgScale={1.6}\n imgStyle={{ left: '5px' }}\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: 6 }).map((_, i) => (\n <Shortcut\n key={i}\n onPointerDown={() => {\n removeShortcut(i);\n if (!shortcuts[i] || shortcuts[i].type === ShortcutType.None)\n setSettingShortcutIndex(i);\n }}\n disabled={settingShortcutIndex !== -1 && settingShortcutIndex !== i}\n isBeingSet={settingShortcutIndex === 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 }\n`;\n\nconst Shortcut = styled.button<{ isBeingSet?: boolean }>`\n width: 2.6rem;\n height: 2.6rem;\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.5rem;\n padding-bottom: 0.5rem;\n padding-left: 0.5rem;\n box-sizing: border-box;\n margin: 0 !important;\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 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 if (\n itemType === ItemType.Consumable ||\n itemType === ItemType.Tool\n ) {\n setItemShortcut?.(item.key, settingShortcutIndex);\n }\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 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, { 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 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 { 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}\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}) => {\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 >\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}\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`;\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 { SpriteFromAtlas } from '../shared/SpriteFromAtlas';\nimport { SingleShortcut } from './SingleShortcut';\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};\n\nexport const Shortcuts: React.FC<ShortcutsProps> = ({\n shortcuts,\n onShortcutCast,\n mana,\n isBlockedCastingByKeyboard = false,\n atlasJSON,\n atlasIMG,\n inventory,\n}) => {\n const shortcutsRefs = useRef<HTMLButtonElement[]>([]);\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 <= 5) {\n onShortcutCast(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]);\n\n return (\n <List>\n {Array.from({ length: 6 }).map((_, i) => {\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 onPointerDown={onShortcutCast.bind(null, i)}\n disabled={false}\n ref={el => {\n if (el) shortcutsRefs.current[i] = el;\n }}\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 },\n atlasJSON\n )}\n width={32}\n height={32}\n />\n )}\n <span className=\"qty\">{totalQty}</span>\n <span className=\"keyboard\">{i + 1}</span>\n </StyledShortcut>\n );\n }\n\n const payload = shortcuts[i]?.payload as IRawSpell | undefined;\n\n return (\n <StyledShortcut\n key={i}\n onPointerDown={onShortcutCast.bind(null, i)}\n disabled={mana < (payload?.manaCost ?? 0)}\n ref={el => {\n if (el) shortcutsRefs.current[i] = el;\n }}\n >\n <span className=\"mana\">{payload && payload.manaCost}</span>\n <span className=\"magicWords\">\n {payload?.magicWords.split(' ').map(word => word[0])}\n </span>\n <span className=\"keyboard\">{i + 1}</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","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 { ErrorBoundary } from './Item/Inventory/ErrorBoundary';\nimport { SpriteFromAtlas } from './shared/SpriteFromAtlas';\nimport { SimpleProgressBar } from './SimpleProgressBar';\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}\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}) => {\n if (!skillPointsToNextLevel) {\n skillPointsToNextLevel = getSPForLevel(level + 1);\n }\n\n const nextLevelSPWillbe = skillPoints + skillPointsToNextLevel;\n\n const ratio = (skillPoints / nextLevelSPWillbe) * 100;\n\n return (\n <>\n <ProgressTitle>\n <TitleName>{skillName}</TitleName>\n <ValueDisplay>lv {level}</ValueDisplay>\n </ProgressTitle>\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}/{nextLevelSPWillbe}\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 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: row;\n justify-content: space-between;\n span {\n font-size: 0.6rem;\n }\n`;\n","import { ISkill, ISkillDetails } 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 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 //@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(skillDetails.skillPointsToNextLevel) || 0\n }\n texturePath={value}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n />\n );\n }\n\n return output;\n };\n\n return (\n <SkillsDraggableContainer\n title=\"Skills\"\n cancelDrag=\"#skillsDiv\"\n scale={scale}\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={Math.round(skill.xpToNextLevel) || 0}\n texturePath={'swords/broad-sword.png'}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n />\n\n <p>Combat Skills</p>\n <hr className=\"golden\" />\n </SkillSplitDiv>\n\n {onRenderSkillCategory('combat')}\n\n <SkillSplitDiv>\n <p>Crafting Skills</p>\n <hr className=\"golden\" />\n </SkillSplitDiv>\n\n {onRenderSkillCategory('crafting')}\n\n <SkillSplitDiv>\n <p>Basic Attributes</p>\n <hr className=\"golden\" />\n </SkillSplitDiv>\n\n {onRenderSkillCategory('attributes')}\n </SkillsContainerDiv>\n </SkillsDraggableContainer>\n );\n};\n\nconst SkillsDraggableContainer = styled(DraggableContainer)`\n border: 1px solid black;\n width: 400px;\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 { IRawSpell } from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\nimport { uiFonts } from '../../constants/uiFonts';\n\ninterface Props extends IRawSpell {\n charMana: number;\n charMagicLevel: number;\n onPointerDown?: (spellKey: string) => void;\n isSettingShortcut?: boolean;\n spellKey: string;\n}\n\nexport const Spell: React.FC<Props> = ({\n spellKey,\n name,\n description,\n magicWords,\n manaCost,\n charMana,\n charMagicLevel,\n onPointerDown,\n isSettingShortcut,\n minMagicLevelRequired,\n}) => {\n const disabled = isSettingShortcut\n ? charMagicLevel < minMagicLevelRequired\n : manaCost > charMana || charMagicLevel < minMagicLevelRequired;\n\n return (\n <Container\n disabled={disabled}\n onPointerDown={onPointerDown?.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>{magicWords.split(' ').map(word => word[0])}</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 );\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 height: 5rem;\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`;\n\nconst Info = styled.span`\n width: 0;\n flex: 1;\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 { IRawSpell, IShortcut } from '@rpg-engine/shared';\nimport React, { Fragment, useEffect, 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: IRawSpell[];\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}\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}) => {\n const [search, setSearch] = useState('');\n const [settingShortcutIndex, setSettingShortcutIndex] = useState(-1);\n\n useEffect(() => {\n const handleEscapeClose = (e: KeyboardEvent) => {\n if (e.key === 'Escape') {\n onClose?.();\n }\n };\n\n document.addEventListener('keydown', handleEscapeClose);\n\n return () => {\n document.removeEventListener('keydown', handleEscapeClose);\n };\n }, [onClose]);\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 onPointerDown={\n settingShortcutIndex !== -1 ? setShortcut : onSpellClick\n }\n spellKey={spell.key}\n isSettingShortcut={settingShortcutIndex !== -1}\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 },\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`;\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';\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","CancelButton","ButtonsContainer","ShortcutsContainer","StyledShortcut","useOutsideClick","id","handleClickOutside","event","current","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","draggableRef","useRef","_e","Draggable","cancel","onDrag","data","onStop","onStart","defaultPosition","TitleContainer","Title","Icon","src","h1","img","Dropdown","options","dropdownId","uuidv4","selectedValue","setSelectedValue","selectedOption","setSelectedOption","opened","setOpened","firstOption","value","option","onMouseLeave","DropdownSelect","prev","DropdownOptions","map","key","ul","modalRoot","getElementById","ModalPortal","ReactDOM","createPortal","RelativeListMenu","onSelected","_ref$fontSize","pos","overflow","params","ListElement","text","li","MobileItemTooltip","closeTooltip","equipmentSet","_ref$scale","handleFadeOut","_ref$current","classList","add","onTouchEnd","setTimeout","ItemInfoDisplay","isMobile","OptionsContainer","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","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","push","DepotSocketEvents","Deposit","ActionsForEquipmentSet","Loot","ActionsForLoot","MapContainer","ActionsForMapContainer","contextActionMenuDontHaveUseWith","find","toLowerCase","includes","hasUseWith","Depot","ItemSocketEvents","GetItemInfo","Withdraw","generateContextMenu","getStackInfo","itemId","stackQty","qtyClassName","ItemQtyContainer","ItemQty","Math","round","resetItem","onSuccesfulDrag","quantity","onMouseUp","e","changedTouches","clientX","clientY","simulatedEvent","MouseEvent","bubbles","elementFromPoint","_document$elementFrom","axis","defaultClassName","classes","Array","from","_e$target","some","elm","window","getComputedStyle","matrix","DOMMatrixReadOnly","transform","m41","m42","isTouch","abs","position","ItemContainer","onMouseEnter","itemToRender","texturePath","allowedEquipSlotType","_itemToRender$allowed","element","_id","getItemTextureKeyPath","stackInfo","renderEquipment","renderItem","onRenderSlot","ItemTooltip","optionId","rarityColor","rarity","ItemRarities","Uncommon","Rare","Epic","Legendary","statisticsToDisplay","label","higherIsWorse","ItemInfo","itemToCompare","renderMissingStatistic","statistics","stat","itemToCompareStatistic","toUpperCase","slice","Statistic","toString","Header","Rarity","Type","subType","AllowedSlots","slotType","itemStatistic","isItemToCompare","isOnlyInOneItem","statDiff","parseInt","_itemToCompare$stat$k2","isDifference","isBetter","renderStatistics","isTwoHanded","Description","description","maxStackSize","StackInfo","MissingStatistics","itemSlotTypes","useMemo","_item$allowedEquipSlo","allowedSlotTypeCamelCase","camelCase","itemSubTypeCamelCase","getSlotType","itemFromEquipment","Flex","CompareContainer","Equipped","$isMobile","handleMouseMove","rect","getBoundingClientRect","tooltipWidth","tooltipHeight","isOffScreenRight","innerWidth","isOffScreenBottom","innerHeight","ItemInfoWrapper","setIsTooltipVisible","bind","log","StyledItem","Recipes","Subtitle","RadioInputScroller","SpriteAtlasWrapper","RadioOptionsWrapper","ButtonWrapper","Details","EquipmentSetContainer","EquipmentColumn","IS_MOBILE_OR_TABLET","isMobileOrTablet","DynamicText","onFinish","textState","setTextState","i","interval","setInterval","substring","clearInterval","TextContainer","NPCDialogText","str","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","SlotsContainer","Framed","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","isNaN","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","split","word","getContent","ItemsContainer","QuantitySelectorContainer","ProgressBarText","minWidth","percentageWidth","QuestDraggableContainer","QuestContainer","QuestsContainer","Content","QuestSplitDiv","QuestColumn","Thumbnail","QuestListContainer","NoQuestContainer","_RPGUI","RPGUI","SimpleProgressBar","_ref$bgColor","bgColor","_ref$margin","margin","ProgressBarContainer","BackgroundBar","Progress","SkillProgressBar","skillName","level","skillPoints","skillPointsToNextLevel","_ref$showSkillPoints","showSkillPoints","getSPForLevel","nextLevelSPWillbe","ratio","ProgressTitle","TitleName","ValueDisplay","ProgressBody","ProgressIconContainer","SpriteContainer","SkillDisplayContainer","SkillPointsDisplay","skillProps","attributes","values","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","Spell","manaCost","charMana","charMagicLevel","isSettingShortcut","minMagicLevelRequired","spellKey","Overlay","SpellImage","Info","Divider","Cost","SpellList","DayNightPeriod","periodOfDay","periodOfDaySrcFiles","PeriodOfDay","Morning","Afternoon","Night","GifContainer","WidgetContainer","Time","DayNightContainer","TradingItemRow","onQuantityChange","traderItem","selectedQty","onLeftClick","qty","onRightClick","ItemWrapper","ItemIconContainer","ItemNameContainer","NameValue","capitalize","price","QuantityContainer","StyledArrow","QuantityDisplay","TradingComponentScrollWrapper","TotalWrapper","GoldWrapper","AlertWrapper","availableCharacters","propertySelectValues","textureKey","selectedSpriteKey","setSelectedSpriteKey","entitiesJSON","display","paddingBottom","chatMessages","onSendChatMessage","onFocus","_ref$styles","styles","textColor","message","setMessage","scrollChatToBottom","scrollingElement","querySelector","scrollTop","scrollHeight","fallback","emitter","createdAt","dayjs","Date","format","onRenderMessageLines","onRenderChatMessages","trim","autoComplete","autoFocus","borderRadius","RxPaperPlane","FramedGrey","items","selectedValues","forEach","generateSelectedValuesList","setSelectedValues","checked","onActionClick","onCancelClick","onShortcutClick","mana","inventory","onTouchStart","remove","variant","onShortcutClickBinded","_shortcuts$i","_shortcuts$i2","_shortcuts$i3","itemsFromEquipment","Object","keys","slots","_inventory$slots$inde","totalQty","reduce","acc","_shortcuts$i4","renderShortcut","onSelect","onCraftItem","craftablesItems","optionsId","show","isShown","setIsShown","craftItem","setCraftItem","modifyString","parts","words","replace","concat","join","handleClick","ItemSubType","canCraft","ingredients","details","onItemClick","onItemDragEnd","onItemDragStart","onItemPlaceDrop","onItemOutsideDrop","equipmentData","neck","leftHand","ring","head","armor","legs","boot","rightHand","accessory","equipmentMaskSlots","ItemSlotType","onRenderEquipmentSlotRange","start","end","equipmentRange","slotMaksRange","itemContainer","itemType","ContainerType","backgroundImgPath","fullCoverBackground","setImage","fullImg","_ref$disableContextMe","disableContextMenu","setItemShortcut","isOpen","maxQuantity","callback","_quantity","quantitySelect","setQuantitySelect","slotQty","_itemContainer$slots","onRenderSlots","imageKey","_ref$displayText","displayText","_ref$percentageWidth","_ref$minWidth","calculatePercentageValue","quests","buttons","onChangeQuest","questsLength","thumbnail","thumbnailDefault","onClick","npcId","quest","onShortcutCast","_ref$isBlockedCasting","isBlockedCastingByKeyboard","shortcutsRefs","handleKeyDown","shortcutIndex","_shortcutsRefs$curren","_shortcutsRefs$curren2","skill","onRenderSkillCategory","category","skillCategory","skillCategoryColor","output","entries","skillDetails","experience","xpToNextLevel","onInputFocus","onInputBlur","spells","magicLevel","onSpellClick","setSpellShortcut","search","setSearch","handleEscapeClose","spellsToDisplay","sort","a","b","filter","spell","toLocaleLowerCase","setShortcut","Fragment","TimeClock","traderItems","characterAvailableGold","sum","setSum","Map","qtyMap","setQtyMap","set","newSum","get","isBuy","hasGoldForSale","tradeItem","assign"],"mappings":"mkCAAO,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,UAASC,IACTC,MAAAA,aAAQC,eAAUC,IAClBC,OAAAA,aAASC,gBAAWC,IACpBC,SAAAA,aAAW,IACXC,IAAAA,SACArB,IAAAA,cACAsB,IAAAA,eAAcC,IACdC,UAAAA,gBAAiBC,IACjBC,QAAAA,aAAU,IACVC,IAAAA,aAKMC,EACJlB,EAAUmB,OAAOjB,IAAcF,EAAUmB,OAAO,uBAElD,IAAKD,EAAY,MAAM,IAAIE,gBAAgBlB,0BAE3C,OACEV,gBAAC6B,GACCjB,MAAOA,EACPG,OAAQA,EACRe,SAAUR,EACVxB,cAAeA,EACfiC,MAAOX,GAEPpB,gBAACgC,GACC9B,oCAAoCuB,GAAgB,IACpDhB,SAAUA,EACVwB,MAAOP,EAAWO,MAClBC,MAAOhB,EACPI,UAAWA,EACXE,QAASA,EACTO,MAAOZ,MAyBTU,EAAY1B,EAAOgC,gBAAG9B,yCAAAC,4BAAVH,mCACP,SAACJ,GAAsB,OAAKA,EAAMa,SACjC,SAACb,GAAsB,OAAKA,EAAMgB,UAC1C,SAAChB,GAAsB,OACtBA,EAAM+B,4GAOLE,EAAY7B,EAAOgC,gBAAG9B,yCAAAC,4BAAVH,2KACP,SAAAJ,GAAK,OA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