@rpg-engine/long-bow 0.2.28 → 0.2.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/dist/components/Arrow/SelectArrow.d.ts +8 -0
  2. package/dist/components/SkillProgressBar.d.ts +2 -0
  3. package/dist/components/SkillsContainer.d.ts +2 -0
  4. package/dist/components/TradingMenu/TradingItemRow.d.ts +9 -0
  5. package/dist/components/TradingMenu/TradingMenu.d.ts +12 -0
  6. package/dist/components/TradingMenu/items.mock.d.ts +2 -0
  7. package/dist/components/shared/Ellipsis.d.ts +3 -1
  8. package/dist/index.d.ts +3 -2
  9. package/dist/long-bow.cjs.development.js +748 -686
  10. package/dist/long-bow.cjs.development.js.map +1 -1
  11. package/dist/long-bow.cjs.production.min.js +1 -1
  12. package/dist/long-bow.cjs.production.min.js.map +1 -1
  13. package/dist/long-bow.esm.js +749 -692
  14. package/dist/long-bow.esm.js.map +1 -1
  15. package/dist/stories/Arrow.stories.d.ts +5 -0
  16. package/dist/stories/ItemTradingComponent.stories.d.ts +5 -0
  17. package/dist/stories/TradingMenu.stories.d.ts +5 -0
  18. package/package.json +2 -2
  19. package/src/components/Arrow/SelectArrow.tsx +65 -0
  20. package/src/components/{PropertySelect/img/ui-arrows → Arrow/img}/arrow01-left-clicked.png +0 -0
  21. package/src/components/{PropertySelect/img/ui-arrows → Arrow/img}/arrow01-left.png +0 -0
  22. package/src/components/{PropertySelect/img/ui-arrows → Arrow/img}/arrow01-right-clicked.png +0 -0
  23. package/src/components/{PropertySelect/img/ui-arrows → Arrow/img}/arrow01-right.png +0 -0
  24. package/src/components/{PropertySelect/img/ui-arrows → Arrow/img}/arrow02-left-clicked.png +0 -0
  25. package/src/components/{PropertySelect/img/ui-arrows → Arrow/img}/arrow02-left.png +0 -0
  26. package/src/components/{PropertySelect/img/ui-arrows → Arrow/img}/arrow02-right-clicked.png +0 -0
  27. package/src/components/{PropertySelect/img/ui-arrows → Arrow/img}/arrow02-right.png +0 -0
  28. package/src/components/Item/Inventory/ItemSlot.tsx +5 -3
  29. package/src/components/NPCDialog/.DS_Store +0 -0
  30. package/src/components/NPCDialog/img/.DS_Store +0 -0
  31. package/src/components/PropertySelect/PropertySelect.tsx +12 -34
  32. package/src/components/QuestInfo/QuestInfo.tsx +8 -34
  33. package/src/components/ScrollList.tsx +2 -1
  34. package/src/components/SkillProgressBar.tsx +4 -2
  35. package/src/components/SkillsContainer.tsx +8 -37
  36. package/src/components/TradingMenu/TradingItemRow.tsx +172 -0
  37. package/src/components/TradingMenu/TradingMenu.tsx +188 -0
  38. package/src/components/TradingMenu/items.mock.ts +88 -0
  39. package/src/components/shared/Ellipsis.tsx +25 -6
  40. package/src/index.tsx +3 -2
  41. package/src/mocks/.DS_Store +0 -0
  42. package/src/stories/Arrow.stories.tsx +26 -0
  43. package/src/stories/ItemTradingComponent.stories.tsx +39 -0
  44. package/src/stories/SkillProgressBar.stories.tsx +4 -0
  45. package/src/stories/SkillsContainer.stories.tsx +4 -0
  46. package/src/stories/TradingMenu.stories.tsx +38 -0
@@ -9,31 +9,27 @@ import 'rpgui/rpgui.min.css';
9
9
  import 'rpgui/rpgui.min.js';
10
10
  import { observer } from 'mobx-react-lite';
11
11
  import _ from 'lodash-es';
12
+ import capitalize from 'lodash-es/capitalize';
12
13
 
13
14
  function _extends() {
14
15
  _extends = Object.assign ? Object.assign.bind() : function (target) {
15
16
  for (var i = 1; i < arguments.length; i++) {
16
17
  var source = arguments[i];
17
-
18
18
  for (var key in source) {
19
19
  if (Object.prototype.hasOwnProperty.call(source, key)) {
20
20
  target[key] = source[key];
21
21
  }
22
22
  }
23
23
  }
24
-
25
24
  return target;
26
25
  };
27
26
  return _extends.apply(this, arguments);
28
27
  }
29
-
30
28
  function _inheritsLoose(subClass, superClass) {
31
29
  subClass.prototype = Object.create(superClass.prototype);
32
30
  subClass.prototype.constructor = subClass;
33
-
34
31
  _setPrototypeOf(subClass, superClass);
35
32
  }
36
-
37
33
  function _setPrototypeOf(o, p) {
38
34
  _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
39
35
  o.__proto__ = p;
@@ -41,37 +37,34 @@ function _setPrototypeOf(o, p) {
41
37
  };
42
38
  return _setPrototypeOf(o, p);
43
39
  }
44
-
40
+ function _objectDestructuringEmpty(obj) {
41
+ if (obj == null) throw new TypeError("Cannot destructure " + obj);
42
+ }
45
43
  function _objectWithoutPropertiesLoose(source, excluded) {
46
44
  if (source == null) return {};
47
45
  var target = {};
48
46
  var sourceKeys = Object.keys(source);
49
47
  var key, i;
50
-
51
48
  for (i = 0; i < sourceKeys.length; i++) {
52
49
  key = sourceKeys[i];
53
50
  if (excluded.indexOf(key) >= 0) continue;
54
51
  target[key] = source[key];
55
52
  }
56
-
57
53
  return target;
58
54
  }
59
55
 
60
56
  var _excluded = ["disabled", "children", "buttonType"];
61
57
  var ButtonTypes;
62
-
63
58
  (function (ButtonTypes) {
64
59
  ButtonTypes["RPGUIButton"] = "rpgui-button";
65
60
  ButtonTypes["RPGUIGoldButton"] = "rpgui-button golden";
66
61
  })(ButtonTypes || (ButtonTypes = {}));
67
-
68
62
  var Button = function Button(_ref) {
69
63
  var _ref$disabled = _ref.disabled,
70
- disabled = _ref$disabled === void 0 ? false : _ref$disabled,
71
- children = _ref.children,
72
- buttonType = _ref.buttonType,
73
- props = _objectWithoutPropertiesLoose(_ref, _excluded);
74
-
64
+ disabled = _ref$disabled === void 0 ? false : _ref$disabled,
65
+ children = _ref.children,
66
+ buttonType = _ref.buttonType,
67
+ props = _objectWithoutPropertiesLoose(_ref, _excluded);
75
68
  return React.createElement(ButtonContainer, Object.assign({
76
69
  className: "" + buttonType,
77
70
  disabled: disabled
@@ -84,21 +77,21 @@ var ButtonContainer = /*#__PURE__*/styled.button.withConfig({
84
77
 
85
78
  var SpriteFromAtlas = function SpriteFromAtlas(_ref) {
86
79
  var atlasJSON = _ref.atlasJSON,
87
- atlasIMG = _ref.atlasIMG,
88
- spriteKey = _ref.spriteKey,
89
- _ref$width = _ref.width,
90
- width = _ref$width === void 0 ? GRID_WIDTH : _ref$width,
91
- _ref$height = _ref.height,
92
- height = _ref$height === void 0 ? GRID_HEIGHT : _ref$height,
93
- _ref$imgScale = _ref.imgScale,
94
- imgScale = _ref$imgScale === void 0 ? 2 : _ref$imgScale,
95
- imgStyle = _ref.imgStyle,
96
- onClick = _ref.onClick,
97
- containerStyle = _ref.containerStyle,
98
- _ref$grayScale = _ref.grayScale,
99
- grayScale = _ref$grayScale === void 0 ? false : _ref$grayScale,
100
- _ref$opacity = _ref.opacity,
101
- opacity = _ref$opacity === void 0 ? 1 : _ref$opacity;
80
+ atlasIMG = _ref.atlasIMG,
81
+ spriteKey = _ref.spriteKey,
82
+ _ref$width = _ref.width,
83
+ width = _ref$width === void 0 ? GRID_WIDTH : _ref$width,
84
+ _ref$height = _ref.height,
85
+ height = _ref$height === void 0 ? GRID_HEIGHT : _ref$height,
86
+ _ref$imgScale = _ref.imgScale,
87
+ imgScale = _ref$imgScale === void 0 ? 2 : _ref$imgScale,
88
+ imgStyle = _ref.imgStyle,
89
+ onClick = _ref.onClick,
90
+ containerStyle = _ref.containerStyle,
91
+ _ref$grayScale = _ref.grayScale,
92
+ grayScale = _ref$grayScale === void 0 ? false : _ref$grayScale,
93
+ _ref$opacity = _ref.opacity,
94
+ opacity = _ref$opacity === void 0 ? 1 : _ref$opacity;
102
95
  //! 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).
103
96
  //!Due to React's limitations, we cannot import it from the public folder directly!
104
97
  var spriteData = atlasJSON.frames[spriteKey];
@@ -27255,34 +27248,27 @@ var img$1 = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUAAAAFACAMAAAD6TlWYA
27255
27248
 
27256
27249
  var ErrorBoundary = /*#__PURE__*/function (_Component) {
27257
27250
  _inheritsLoose(ErrorBoundary, _Component);
27258
-
27259
27251
  function ErrorBoundary() {
27260
27252
  var _this;
27261
-
27262
27253
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
27263
27254
  args[_key] = arguments[_key];
27264
27255
  }
27265
-
27266
27256
  _this = _Component.call.apply(_Component, [this].concat(args)) || this;
27267
27257
  _this.state = {
27268
27258
  hasError: false
27269
27259
  };
27270
27260
  return _this;
27271
27261
  }
27272
-
27273
27262
  ErrorBoundary.getDerivedStateFromError = function getDerivedStateFromError(_) {
27274
27263
  // Update state so the next render will show the fallback UI.
27275
27264
  return {
27276
27265
  hasError: true
27277
27266
  };
27278
27267
  };
27279
-
27280
27268
  var _proto = ErrorBoundary.prototype;
27281
-
27282
27269
  _proto.componentDidCatch = function componentDidCatch(error, errorInfo) {
27283
27270
  console.error('Uncaught error:', error, errorInfo);
27284
27271
  };
27285
-
27286
27272
  _proto.render = function render() {
27287
27273
  if (this.state.hasError) {
27288
27274
  return React.createElement(SpriteFromAtlas, {
@@ -27292,80 +27278,121 @@ var ErrorBoundary = /*#__PURE__*/function (_Component) {
27292
27278
  imgScale: 3
27293
27279
  });
27294
27280
  }
27295
-
27296
27281
  return this.props.children;
27297
27282
  };
27298
-
27299
27283
  return ErrorBoundary;
27300
27284
  }(Component);
27301
27285
 
27286
+ var img$2 = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAASRJREFUWIXtl7EKwjAQhn8llg4dOig4uApu+gaib+Fj+CL6MO6Kk6N1ExRdHDJ06NChFEEnL6kmGkE5wf7TJVzbn+96uRb4d1VcE+tB62VO4HkUp3l+MeWEvk/P3Md7VF0NfEvsBsT9hg21C940zynuNZvG+0RS6tdW2AmwGxBAEXvo+xQnWUa4XPAOOmdtpeLF9qHSJHYC7AYEYMfuhtosHXskJcWB59FBFOMHCLAbEIAduwvqd6V3E/ADBNgN3LqA3kz9rJ6MQkqcre2HyTvSZ0rZBYDqAtrot2tUjuE0MY7d+Tg0bT+R6qxyHN9LAECcnmhjuSt8EVE5ui3VBbbS6LKVKZLFNTsBdgMf/S/Qy7Q5nY1lajfUOF4dD/wE2A2UYtcVzKJVOti5A44AAAAASUVORK5CYII=';
27287
+
27288
+ var img$3 = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAASZJREFUWIVjYBjpgJFYhSI8MgTVGBoJwNnnz334j02Nk5MY3M5Vm84xMBHrAFqBAXcARhTgCmpighcZHDvhhFXcymIfnP3myxPGAQ+BAXcAIwMDarA7OYnB2fv2vcIa1LiC98fKc1jFOcKN4OzRKEAHLAwMuIOd1KDGBZCD3dBIAJ7zdh96MvAhMOAOYGFgwB3spAY1MeD8uQ8o/AEPgQF3ACwXwFOmlcU+eHTsKxTApocioC/DAmfvvTEIQmDAHYBRF9irssLZB2//xloXFDqIEDTY1/APVnGnfkQuGK0LGBigueDNlydwgYO3UVpE8NwhI4CImv4Dbwi2iBgYCEcTA8MgCIEBdwBV+wXI0fTkA/YcpCrKBrfz+P17Ax8CA+6AUTDgAACD+FSXdO/L2QAAAABJRU5ErkJggg==';
27289
+
27290
+ var img$4 = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAARlJREFUWIXtl78KwjAQxr9IFIcODh0cuigKburoJLr7bD6S+ga6CV07CHZw6FCqoFPzp1w0g3KK/abjeinH78s1DfDvEgAwCAcqccnzO1UYtFqijLOiePniNEu8Gmh4VX1Q7A1IwMY+6XbJwv3pRFpjyrQJQUTWVK1hJ8DegHz2cDG6GXGo4s2RXuayqdNua2ugrUmzhJ8AewMSsHevjVFPhG2Hjm29niDTjjT7AgLsDUjA79vuIx9rKpMi2AmwN1BOgUq8y47VVNux3qYqrqegKgEAYRCRx7G5q02kLi3XFzI/HzYV9l18Vfn6LACI49iF3YXX1DiSCvUh0Wur2E2xE2BvQADArNdXifhckH81Lrwu1feCWj+jBx1LX0kx8GexAAAAAElFTkSuQmCC';
27291
+
27292
+ var img$5 = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAS5JREFUWIXtl7Fqw0AMhv8LLmTI4KFk8pJAtkKJpzRDCoasHZvnyJP0OZqx3Y90KZ3OdM7qKfHgIUNpAu1U+TA654YGUXr/JGRx/vmEdDbw36UA4P4upYTW2y+ucJzG6ifOTXXy4HJfeBnoeFWdUeIGFABc9hLC/vqWsYXTiT55mE+bmq0RJyBuIGp7+PFoKNbLmOLuIuXKMZ1odoKyrE+t0VYny30hT0DcgAKA+eyKErmpCKON3UctraHYbsfqycgTEDcQAX673Uf21Niyl1tjUpQ4AXEDEQBcJ/U+ei+Ov/4S9xSERcRcx67l85y3XhsAgId1yeZvRxeE/WVzoHy4CwDmOnahduG1lcQ16qKqUTex2xInIG5AAcDNYEiJze6T/apx4XUp/BcE/Rl9A77uW6caXAGtAAAAAElFTkSuQmCC';
27293
+
27294
+ var _excluded$1 = ["direction", "size", "onClick"];
27295
+ var SelectArrow = function SelectArrow(_ref) {
27296
+ var _ref$direction = _ref.direction,
27297
+ direction = _ref$direction === void 0 ? 'left' : _ref$direction,
27298
+ size = _ref.size,
27299
+ _onClick = _ref.onClick,
27300
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$1);
27301
+ return React.createElement(React.Fragment, null, direction === 'left' ? React.createElement(LeftArrow, Object.assign({
27302
+ size: size,
27303
+ onClick: function onClick() {
27304
+ return _onClick();
27305
+ }
27306
+ }, props)) : React.createElement(RightArrow, Object.assign({
27307
+ size: size,
27308
+ onClick: function onClick() {
27309
+ return _onClick();
27310
+ }
27311
+ }, props)));
27312
+ };
27313
+ var LeftArrow = /*#__PURE__*/styled.span.withConfig({
27314
+ displayName: "SelectArrow__LeftArrow",
27315
+ componentId: "sc-1h7cpoe-0"
27316
+ })(["background-image:url(", ");background-size:100% 100%;left:0;position:absolute;width:", "px;height:", "px;:active{background-image:url(", ");}z-index:2;"], img$3, function (props) {
27317
+ return props.size || 40;
27318
+ }, function (props) {
27319
+ return props.size || 42;
27320
+ }, img$2);
27321
+ var RightArrow = /*#__PURE__*/styled.span.withConfig({
27322
+ displayName: "SelectArrow__RightArrow",
27323
+ componentId: "sc-1h7cpoe-1"
27324
+ })(["background-image:url(", ");right:0;position:absolute;width:", "px;height:", "px;background-size:100% 100%;:active{background-image:url(", ");}z-index:2;"], img$5, function (props) {
27325
+ return props.size || 40;
27326
+ }, function (props) {
27327
+ return props.size || 42;
27328
+ }, img$4);
27329
+
27302
27330
  var Ellipsis = function Ellipsis(_ref) {
27303
27331
  var children = _ref.children,
27304
- maxLines = _ref.maxLines;
27305
- return React.createElement(Container$1, null, React.createElement("div", {
27332
+ maxLines = _ref.maxLines,
27333
+ maxWidth = _ref.maxWidth,
27334
+ fontSize = _ref.fontSize;
27335
+ return React.createElement(Container$1, {
27336
+ maxWidth: maxWidth,
27337
+ fontSize: fontSize
27338
+ }, React.createElement("p", {
27306
27339
  className: "ellipsis-" + maxLines + "-lines"
27307
27340
  }, children));
27308
27341
  };
27309
27342
  var Container$1 = /*#__PURE__*/styled.div.withConfig({
27310
27343
  displayName: "Ellipsis__Container",
27311
27344
  componentId: "sc-ysrlju-0"
27312
- })([".ellipsis-1-lines{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;}.ellipsis-2-lines{display:-webkit-box;max-width:100%;height:25px;margin:0 auto;line-height:1;-webkit-line-clamp:2;-webkit-box-orient:vertical;text-overflow:ellipsis;overflow:hidden;}.ellipsis-3-lines{display:-webkit-box;max-width:100%;height:43px;margin:0 auto;line-height:1;-webkit-line-clamp:3;-webkit-box-orient:vertical;text-overflow:ellipsis;overflow:hidden;}"]);
27313
-
27314
- var img$2 = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAASRJREFUWIXtl7EKwjAQhn8llg4dOig4uApu+gaib+Fj+CL6MO6Kk6N1ExRdHDJ06NChFEEnL6kmGkE5wf7TJVzbn+96uRb4d1VcE+tB62VO4HkUp3l+MeWEvk/P3Md7VF0NfEvsBsT9hg21C940zynuNZvG+0RS6tdW2AmwGxBAEXvo+xQnWUa4XPAOOmdtpeLF9qHSJHYC7AYEYMfuhtosHXskJcWB59FBFOMHCLAbEIAduwvqd6V3E/ADBNgN3LqA3kz9rJ6MQkqcre2HyTvSZ0rZBYDqAtrot2tUjuE0MY7d+Tg0bT+R6qxyHN9LAECcnmhjuSt8EVE5ui3VBbbS6LKVKZLFNTsBdgMf/S/Qy7Q5nY1lajfUOF4dD/wE2A2UYtcVzKJVOti5A44AAAAASUVORK5CYII=';
27315
-
27316
- var img$3 = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAASZJREFUWIVjYBjpgJFYhSI8MgTVGBoJwNnnz334j02Nk5MY3M5Vm84xMBHrAFqBAXcARhTgCmpighcZHDvhhFXcymIfnP3myxPGAQ+BAXcAIwMDarA7OYnB2fv2vcIa1LiC98fKc1jFOcKN4OzRKEAHLAwMuIOd1KDGBZCD3dBIAJ7zdh96MvAhMOAOYGFgwB3spAY1MeD8uQ8o/AEPgQF3ACwXwFOmlcU+eHTsKxTApocioC/DAmfvvTEIQmDAHYBRF9irssLZB2//xloXFDqIEDTY1/APVnGnfkQuGK0LGBigueDNlydwgYO3UVpE8NwhI4CImv4Dbwi2iBgYCEcTA8MgCIEBdwBV+wXI0fTkA/YcpCrKBrfz+P17Ax8CA+6AUTDgAACD+FSXdO/L2QAAAABJRU5ErkJggg==';
27317
-
27318
- var img$4 = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAARlJREFUWIXtl78KwjAQxr9IFIcODh0cuigKburoJLr7bD6S+ga6CV07CHZw6FCqoFPzp1w0g3KK/abjeinH78s1DfDvEgAwCAcqccnzO1UYtFqijLOiePniNEu8Gmh4VX1Q7A1IwMY+6XbJwv3pRFpjyrQJQUTWVK1hJ8DegHz2cDG6GXGo4s2RXuayqdNua2ugrUmzhJ8AewMSsHevjVFPhG2Hjm29niDTjjT7AgLsDUjA79vuIx9rKpMi2AmwN1BOgUq8y47VVNux3qYqrqegKgEAYRCRx7G5q02kLi3XFzI/HzYV9l18Vfn6LACI49iF3YXX1DiSCvUh0Wur2E2xE2BvQADArNdXifhckH81Lrwu1feCWj+jBx1LX0kx8GexAAAAAElFTkSuQmCC';
27319
-
27320
- var img$5 = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAS5JREFUWIXtl7Fqw0AMhv8LLmTI4KFk8pJAtkKJpzRDCoasHZvnyJP0OZqx3Y90KZ3OdM7qKfHgIUNpAu1U+TA654YGUXr/JGRx/vmEdDbw36UA4P4upYTW2y+ucJzG6ifOTXXy4HJfeBnoeFWdUeIGFABc9hLC/vqWsYXTiT55mE+bmq0RJyBuIGp7+PFoKNbLmOLuIuXKMZ1odoKyrE+t0VYny30hT0DcgAKA+eyKErmpCKON3UctraHYbsfqycgTEDcQAX673Uf21Niyl1tjUpQ4AXEDEQBcJ/U+ei+Ov/4S9xSERcRcx67l85y3XhsAgId1yeZvRxeE/WVzoHy4CwDmOnahduG1lcQ16qKqUTex2xInIG5AAcDNYEiJze6T/apx4XUp/BcE/Rl9A77uW6caXAGtAAAAAElFTkSuQmCC';
27345
+ })(["p{font-size:", ";}.ellipsis-1-lines{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-width:", "px;}.ellipsis-2-lines{display:-webkit-box;max-width:", "px;height:25px;margin:0 auto;line-height:1;-webkit-line-clamp:2;-webkit-box-orient:vertical;text-overflow:ellipsis;overflow:hidden;}.ellipsis-3-lines{display:-webkit-box;max-width:", "px;height:43px;margin:0 auto;line-height:1;-webkit-line-clamp:3;-webkit-box-orient:vertical;text-overflow:ellipsis;overflow:hidden;}"], function (props) {
27346
+ return props.fontSize || '1rem';
27347
+ }, function (props) {
27348
+ return props.maxWidth;
27349
+ }, function (props) {
27350
+ return props.maxWidth;
27351
+ }, function (props) {
27352
+ return props.maxWidth;
27353
+ });
27321
27354
 
27322
27355
  var PropertySelect = function PropertySelect(_ref) {
27323
27356
  var availableProperties = _ref.availableProperties,
27324
- onChange = _ref.onChange;
27325
-
27357
+ onChange = _ref.onChange;
27326
27358
  var _useState = useState(0),
27327
- currentIndex = _useState[0],
27328
- setCurrentIndex = _useState[1];
27329
-
27359
+ currentIndex = _useState[0],
27360
+ setCurrentIndex = _useState[1];
27330
27361
  var propertiesLength = availableProperties.length - 1;
27331
-
27332
27362
  var onLeftClick = function onLeftClick() {
27333
27363
  if (currentIndex === 0) setCurrentIndex(propertiesLength);else setCurrentIndex(function (index) {
27334
27364
  return index - 1;
27335
27365
  });
27336
27366
  };
27337
-
27338
27367
  var onRightClick = function onRightClick() {
27339
27368
  if (currentIndex === propertiesLength) setCurrentIndex(0);else setCurrentIndex(function (index) {
27340
27369
  return index + 1;
27341
27370
  });
27342
27371
  };
27343
-
27344
27372
  useEffect(function () {
27345
27373
  onChange(availableProperties[currentIndex]);
27346
27374
  }, [currentIndex]);
27347
27375
  useEffect(function () {
27348
27376
  setCurrentIndex(0);
27349
27377
  }, [JSON.stringify(availableProperties)]);
27350
-
27351
27378
  var getCurrentSelectionName = function getCurrentSelectionName() {
27352
27379
  var item = availableProperties[currentIndex];
27353
-
27354
27380
  if (item) {
27355
27381
  return item.name;
27356
27382
  }
27357
-
27358
27383
  return '';
27359
27384
  };
27360
-
27361
27385
  return React.createElement(Container$2, null, React.createElement(TextOverlay, null, React.createElement(Item, null, React.createElement(Ellipsis, {
27362
- maxLines: 1
27386
+ maxLines: 1,
27387
+ maxWidth: 200
27363
27388
  }, getCurrentSelectionName()))), React.createElement("div", {
27364
27389
  className: "rpgui-progress-track"
27365
- }), React.createElement(LeftArrow, {
27390
+ }), React.createElement(SelectArrow, {
27391
+ direction: "left",
27366
27392
  onClick: onLeftClick,
27367
27393
  onTouchStart: onLeftClick
27368
- }), React.createElement(RightArrow, {
27394
+ }), React.createElement(SelectArrow, {
27395
+ direction: "right",
27369
27396
  onClick: onRightClick,
27370
27397
  onTouchStart: onRightClick
27371
27398
  }));
@@ -27382,45 +27409,31 @@ var Container$2 = /*#__PURE__*/styled.div.withConfig({
27382
27409
  displayName: "PropertySelect__Container",
27383
27410
  componentId: "sc-12uqx6s-2"
27384
27411
  })(["position:relative;display:flex;flex-direction:column;justify-content:start;align-items:flex-start;min-width:100px;width:40%;"]);
27385
- var LeftArrow = /*#__PURE__*/styled.div.withConfig({
27386
- displayName: "PropertySelect__LeftArrow",
27387
- componentId: "sc-12uqx6s-3"
27388
- })(["background-image:url(", ");background-size:100% 100%;left:0;position:absolute;width:40px;height:42px;:active{background-image:url(", ");}z-index:2;"], img$3, img$2);
27389
- var RightArrow = /*#__PURE__*/styled.div.withConfig({
27390
- displayName: "PropertySelect__RightArrow",
27391
- componentId: "sc-12uqx6s-4"
27392
- })(["background-image:url(", ");right:0;position:absolute;width:40px;background-size:100% 100%;height:42px;:active{background-image:url(", ");}z-index:2;"], img$5, img$4);
27393
27412
 
27394
27413
  var CharacterSelection = function CharacterSelection(_ref) {
27395
27414
  var availableCharacters = _ref.availableCharacters,
27396
- onChange = _ref.onChange;
27415
+ onChange = _ref.onChange;
27397
27416
  var propertySelectValues = availableCharacters.map(function (item) {
27398
27417
  return {
27399
27418
  id: item.textureKey,
27400
27419
  name: item.name
27401
27420
  };
27402
27421
  });
27403
-
27404
27422
  var _useState = useState(),
27405
- selectedValue = _useState[0],
27406
- setSelectedValue = _useState[1];
27407
-
27423
+ selectedValue = _useState[0],
27424
+ setSelectedValue = _useState[1];
27408
27425
  var _useState2 = useState(''),
27409
- selectedSpriteKey = _useState2[0],
27410
- setSelectedSpriteKey = _useState2[1];
27411
-
27426
+ selectedSpriteKey = _useState2[0],
27427
+ setSelectedSpriteKey = _useState2[1];
27412
27428
  var onSelectedValueChange = function onSelectedValueChange() {
27413
27429
  var textureKey = selectedValue ? selectedValue.id : '';
27414
27430
  var spriteKey = textureKey ? textureKey + '/down/standing/0.png' : '';
27415
-
27416
27431
  if (spriteKey === selectedSpriteKey) {
27417
27432
  return;
27418
27433
  }
27419
-
27420
27434
  setSelectedSpriteKey(spriteKey);
27421
27435
  onChange(textureKey);
27422
27436
  };
27423
-
27424
27437
  useEffect(function () {
27425
27438
  onSelectedValueChange();
27426
27439
  }, [selectedValue]);
@@ -27466,27 +27479,24 @@ var colors = {
27466
27479
  };
27467
27480
 
27468
27481
  var Input = function Input(_ref) {
27469
- var props = _extends({}, _ref);
27470
-
27482
+ var props = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
27471
27483
  return React.createElement("input", Object.assign({}, props));
27472
27484
  };
27473
27485
 
27474
27486
  var RPGUIContainerTypes;
27475
-
27476
27487
  (function (RPGUIContainerTypes) {
27477
27488
  RPGUIContainerTypes["Framed"] = "framed";
27478
27489
  RPGUIContainerTypes["FramedGold"] = "framed-golden";
27479
27490
  RPGUIContainerTypes["FramedGold2"] = "framed-golden-2";
27480
27491
  RPGUIContainerTypes["FramedGrey"] = "framed-grey";
27481
27492
  })(RPGUIContainerTypes || (RPGUIContainerTypes = {}));
27482
-
27483
27493
  var RPGUIContainer = function RPGUIContainer(_ref) {
27484
27494
  var children = _ref.children,
27485
- type = _ref.type,
27486
- _ref$width = _ref.width,
27487
- width = _ref$width === void 0 ? '50%' : _ref$width,
27488
- height = _ref.height,
27489
- className = _ref.className;
27495
+ type = _ref.type,
27496
+ _ref$width = _ref.width,
27497
+ width = _ref$width === void 0 ? '50%' : _ref$width,
27498
+ height = _ref.height,
27499
+ className = _ref.className;
27490
27500
  return React.createElement(Container$4, {
27491
27501
  width: width,
27492
27502
  height: height || 'auto',
@@ -27518,60 +27528,51 @@ var Column = /*#__PURE__*/styled.div.withConfig({
27518
27528
 
27519
27529
  var Chat = function Chat(_ref) {
27520
27530
  var chatMessages = _ref.chatMessages,
27521
- onSendChatMessage = _ref.onSendChatMessage,
27522
- _ref$opacity = _ref.opacity,
27523
- opacity = _ref$opacity === void 0 ? 1 : _ref$opacity,
27524
- _ref$width = _ref.width,
27525
- width = _ref$width === void 0 ? '100%' : _ref$width,
27526
- _ref$height = _ref.height,
27527
- height = _ref$height === void 0 ? '250px' : _ref$height,
27528
- onCloseButton = _ref.onCloseButton;
27529
-
27531
+ onSendChatMessage = _ref.onSendChatMessage,
27532
+ _ref$opacity = _ref.opacity,
27533
+ opacity = _ref$opacity === void 0 ? 1 : _ref$opacity,
27534
+ _ref$width = _ref.width,
27535
+ width = _ref$width === void 0 ? '100%' : _ref$width,
27536
+ _ref$height = _ref.height,
27537
+ height = _ref$height === void 0 ? '250px' : _ref$height,
27538
+ onCloseButton = _ref.onCloseButton;
27530
27539
  var _useState = useState(''),
27531
- message = _useState[0],
27532
- setMessage = _useState[1];
27533
-
27540
+ message = _useState[0],
27541
+ setMessage = _useState[1];
27534
27542
  useEffect(function () {
27535
27543
  scrollChatToBottom();
27536
27544
  }, []);
27537
27545
  useEffect(function () {
27538
27546
  scrollChatToBottom();
27539
27547
  }, [chatMessages]);
27540
-
27541
27548
  var scrollChatToBottom = function scrollChatToBottom() {
27542
27549
  var scrollingElement = document.querySelector('.chat-body');
27543
-
27544
27550
  if (scrollingElement) {
27545
27551
  scrollingElement.scrollTop = scrollingElement.scrollHeight;
27546
27552
  }
27547
27553
  };
27548
-
27549
27554
  var handleSubmit = function handleSubmit(event) {
27550
27555
  event.preventDefault();
27551
27556
  onSendChatMessage(message);
27552
27557
  setMessage('');
27553
27558
  };
27554
-
27555
27559
  var getInputValue = function getInputValue(value) {
27556
27560
  setMessage(value);
27557
27561
  };
27558
-
27559
27562
  var onRenderMessageLines = function onRenderMessageLines(emitter, createdAt, message) {
27560
27563
  return dayjs(createdAt || new Date()).format('HH:mm') + " " + (emitter != null && emitter.name ? emitter.name + ": " : 'Unknown: ') + " " + message;
27561
27564
  };
27562
-
27563
27565
  var onRenderChatMessages = function onRenderChatMessages(chatMessages) {
27564
27566
  return chatMessages != null && chatMessages.length ? chatMessages == null ? void 0 : chatMessages.map(function (_ref2, index) {
27565
27567
  var _id = _ref2._id,
27566
- createdAt = _ref2.createdAt,
27567
- emitter = _ref2.emitter,
27568
- message = _ref2.message;
27568
+ createdAt = _ref2.createdAt,
27569
+ emitter = _ref2.emitter,
27570
+ message = _ref2.message;
27569
27571
  return React.createElement(MessageText, {
27570
27572
  key: _id + "_" + index
27571
27573
  }, onRenderMessageLines(emitter, createdAt, message));
27572
27574
  }) : React.createElement(MessageText, null, "No messages available.");
27573
27575
  };
27574
-
27575
27576
  return React.createElement(Container$5, null, React.createElement(CustomContainer, {
27576
27577
  type: RPGUIContainerTypes.FramedGrey,
27577
27578
  width: width,
@@ -27638,8 +27639,7 @@ var MessageText = /*#__PURE__*/styled.p.withConfig({
27638
27639
 
27639
27640
  var CheckButton = function CheckButton(_ref) {
27640
27641
  var items = _ref.items,
27641
- onChange = _ref.onChange;
27642
-
27642
+ onChange = _ref.onChange;
27643
27643
  var generateSelectedValuesList = function generateSelectedValuesList() {
27644
27644
  var selectedValues = {};
27645
27645
  items.forEach(function (item) {
@@ -27647,17 +27647,13 @@ var CheckButton = function CheckButton(_ref) {
27647
27647
  });
27648
27648
  return selectedValues;
27649
27649
  };
27650
-
27651
27650
  var _useState = useState(generateSelectedValuesList()),
27652
- selectedValues = _useState[0],
27653
- setSelectedValues = _useState[1];
27654
-
27651
+ selectedValues = _useState[0],
27652
+ setSelectedValues = _useState[1];
27655
27653
  var handleClick = function handleClick(label) {
27656
27654
  var _extends2;
27657
-
27658
27655
  setSelectedValues(_extends({}, selectedValues, (_extends2 = {}, _extends2[label] = !selectedValues[label], _extends2)));
27659
27656
  };
27660
-
27661
27657
  useEffect(function () {
27662
27658
  if (selectedValues) {
27663
27659
  onChange(selectedValues);
@@ -27693,12 +27689,10 @@ function useOutsideClick(ref, id) {
27693
27689
  id: id
27694
27690
  }
27695
27691
  });
27696
-
27697
27692
  document.dispatchEvent(_event);
27698
27693
  }
27699
- } // Bind the event listener
27700
-
27701
-
27694
+ }
27695
+ // Bind the event listener
27702
27696
  document.addEventListener('mousedown', handleClickOutside);
27703
27697
  return function () {
27704
27698
  // Unbind the event listener on clean up
@@ -27709,26 +27703,25 @@ function useOutsideClick(ref, id) {
27709
27703
 
27710
27704
  var DraggableContainer = function DraggableContainer(_ref) {
27711
27705
  var children = _ref.children,
27712
- _ref$width = _ref.width,
27713
- width = _ref$width === void 0 ? '50%' : _ref$width,
27714
- height = _ref.height,
27715
- className = _ref.className,
27716
- _ref$type = _ref.type,
27717
- type = _ref$type === void 0 ? RPGUIContainerTypes.FramedGold : _ref$type,
27718
- onCloseButton = _ref.onCloseButton,
27719
- title = _ref.title,
27720
- imgSrc = _ref.imgSrc,
27721
- _ref$imgWidth = _ref.imgWidth,
27722
- imgWidth = _ref$imgWidth === void 0 ? '20px' : _ref$imgWidth,
27723
- cancelDrag = _ref.cancelDrag,
27724
- onPositionChange = _ref.onPositionChange,
27725
- onOutsideClick = _ref.onOutsideClick;
27706
+ _ref$width = _ref.width,
27707
+ width = _ref$width === void 0 ? '50%' : _ref$width,
27708
+ height = _ref.height,
27709
+ className = _ref.className,
27710
+ _ref$type = _ref.type,
27711
+ type = _ref$type === void 0 ? RPGUIContainerTypes.FramedGold : _ref$type,
27712
+ onCloseButton = _ref.onCloseButton,
27713
+ title = _ref.title,
27714
+ imgSrc = _ref.imgSrc,
27715
+ _ref$imgWidth = _ref.imgWidth,
27716
+ imgWidth = _ref$imgWidth === void 0 ? '20px' : _ref$imgWidth,
27717
+ cancelDrag = _ref.cancelDrag,
27718
+ onPositionChange = _ref.onPositionChange,
27719
+ onOutsideClick = _ref.onOutsideClick;
27726
27720
  var draggableRef = useRef(null);
27727
27721
  useOutsideClick(draggableRef, 'item-container');
27728
27722
  useEffect(function () {
27729
27723
  document.addEventListener('clickOutside', function (event) {
27730
27724
  var e = event;
27731
-
27732
27725
  if (e.detail.id === 'item-container') {
27733
27726
  if (onOutsideClick) {
27734
27727
  onOutsideClick();
@@ -27793,6 +27786,7 @@ var Icon = /*#__PURE__*/styled.img.withConfig({
27793
27786
  return props.width;
27794
27787
  });
27795
27788
 
27789
+ //@ts-ignore
27796
27790
  var _RPGUI = RPGUI;
27797
27791
  var RPGUIRoot = function RPGUIRoot(_ref) {
27798
27792
  var children = _ref.children;
@@ -27803,19 +27797,15 @@ var RPGUIRoot = function RPGUIRoot(_ref) {
27803
27797
 
27804
27798
  var Dropdown = function Dropdown(_ref) {
27805
27799
  var options = _ref.options,
27806
- width = _ref.width,
27807
- onChange = _ref.onChange;
27800
+ width = _ref.width,
27801
+ onChange = _ref.onChange;
27808
27802
  var dropdownId = v4();
27809
-
27810
27803
  var _useState = useState(''),
27811
- selectedValue = _useState[0],
27812
- setSelectedValue = _useState[1];
27813
-
27804
+ selectedValue = _useState[0],
27805
+ setSelectedValue = _useState[1];
27814
27806
  useEffect(function () {
27815
27807
  var element = document.getElementById("rpgui-dropdown-" + dropdownId);
27816
-
27817
27808
  var dropdownValue = _RPGUI.get_value(element);
27818
-
27819
27809
  setSelectedValue(dropdownValue);
27820
27810
  element == null ? void 0 : element.addEventListener('change', function (event) {
27821
27811
  setSelectedValue(event == null ? void 0 : event.target.value);
@@ -27842,16 +27832,15 @@ var Dropdown = function Dropdown(_ref) {
27842
27832
 
27843
27833
  var RelativeListMenu = function RelativeListMenu(_ref) {
27844
27834
  var options = _ref.options,
27845
- onSelected = _ref.onSelected,
27846
- onOutsideClick = _ref.onOutsideClick,
27847
- _ref$fontSize = _ref.fontSize,
27848
- fontSize = _ref$fontSize === void 0 ? 0.8 : _ref$fontSize;
27835
+ onSelected = _ref.onSelected,
27836
+ onOutsideClick = _ref.onOutsideClick,
27837
+ _ref$fontSize = _ref.fontSize,
27838
+ fontSize = _ref$fontSize === void 0 ? 0.8 : _ref$fontSize;
27849
27839
  var ref = useRef(null);
27850
27840
  useOutsideClick(ref, 'relative-context-menu');
27851
27841
  useEffect(function () {
27852
27842
  document.addEventListener('clickOutside', function (event) {
27853
27843
  var e = event;
27854
-
27855
27844
  if (e.detail.id === 'relative-context-menu') {
27856
27845
  if (onOutsideClick) {
27857
27846
  onOutsideClick();
@@ -27908,10 +27897,8 @@ var generateContextMenuListOptions = function generateContextMenuListOptions(act
27908
27897
  });
27909
27898
  return contextMenu;
27910
27899
  };
27911
-
27912
27900
  var generateContextMenu = function generateContextMenu(itemType, itemContainerType) {
27913
27901
  var contextActionMenu = [];
27914
-
27915
27902
  if (itemContainerType === ItemContainerType.Inventory) {
27916
27903
  switch (itemType) {
27917
27904
  case ItemType.Weapon:
@@ -27920,40 +27907,32 @@ var generateContextMenu = function generateContextMenu(itemType, itemContainerTy
27920
27907
  case ItemType.Jewelry:
27921
27908
  contextActionMenu = generateContextMenuListOptions(ActionsForInventory.Equipment);
27922
27909
  break;
27923
-
27924
27910
  case ItemType.Container:
27925
27911
  contextActionMenu = generateContextMenuListOptions(ActionsForInventory.Container);
27926
27912
  break;
27927
-
27928
27913
  case ItemType.Consumable:
27929
27914
  contextActionMenu = generateContextMenuListOptions(ActionsForInventory.Consumable);
27930
27915
  break;
27931
-
27932
27916
  case ItemType.CraftMaterial:
27933
27917
  contextActionMenu = generateContextMenuListOptions(ActionsForInventory.CraftMaterial);
27934
27918
  break;
27935
-
27936
27919
  case ItemType.Tool:
27937
27920
  contextActionMenu = generateContextMenuListOptions(ActionsForInventory.Tool);
27938
27921
  break;
27939
-
27940
27922
  default:
27941
27923
  contextActionMenu = generateContextMenuListOptions(ActionsForInventory.Other);
27942
27924
  break;
27943
27925
  }
27944
27926
  }
27945
-
27946
27927
  if (itemContainerType === ItemContainerType.Equipment) {
27947
27928
  switch (itemType) {
27948
27929
  case ItemType.Container:
27949
27930
  contextActionMenu = generateContextMenuListOptions(ActionsForEquipmentSet.Container);
27950
27931
  break;
27951
-
27952
27932
  default:
27953
27933
  contextActionMenu = generateContextMenuListOptions(ActionsForEquipmentSet.Equipment);
27954
27934
  }
27955
27935
  }
27956
-
27957
27936
  if (itemContainerType === ItemContainerType.Loot) {
27958
27937
  switch (itemType) {
27959
27938
  case ItemType.Weapon:
@@ -27962,25 +27941,20 @@ var generateContextMenu = function generateContextMenu(itemType, itemContainerTy
27962
27941
  case ItemType.Jewelry:
27963
27942
  contextActionMenu = generateContextMenuListOptions(ActionsForLoot.Equipment);
27964
27943
  break;
27965
-
27966
27944
  case ItemType.Consumable:
27967
27945
  contextActionMenu = generateContextMenuListOptions(ActionsForLoot.Consumable);
27968
27946
  break;
27969
-
27970
27947
  case ItemType.CraftMaterial:
27971
27948
  contextActionMenu = generateContextMenuListOptions(ActionsForLoot.CraftMaterial);
27972
27949
  break;
27973
-
27974
27950
  case ItemType.Tool:
27975
27951
  contextActionMenu = generateContextMenuListOptions(ActionsForLoot.Tool);
27976
27952
  break;
27977
-
27978
27953
  default:
27979
27954
  contextActionMenu = generateContextMenuListOptions(ActionsForLoot.Other);
27980
27955
  break;
27981
27956
  }
27982
27957
  }
27983
-
27984
27958
  if (itemContainerType === ItemContainerType.MapContainer) {
27985
27959
  switch (itemType) {
27986
27960
  case ItemType.Weapon:
@@ -27989,25 +27963,20 @@ var generateContextMenu = function generateContextMenu(itemType, itemContainerTy
27989
27963
  case ItemType.Jewelry:
27990
27964
  contextActionMenu = generateContextMenuListOptions(ActionsForMapContainer.Equipment);
27991
27965
  break;
27992
-
27993
27966
  case ItemType.Consumable:
27994
27967
  contextActionMenu = generateContextMenuListOptions(ActionsForMapContainer.Consumable);
27995
27968
  break;
27996
-
27997
27969
  case ItemType.CraftMaterial:
27998
27970
  contextActionMenu = generateContextMenuListOptions(ActionsForMapContainer.CraftMaterial);
27999
27971
  break;
28000
-
28001
27972
  case ItemType.Tool:
28002
27973
  contextActionMenu = generateContextMenuListOptions(ActionsForMapContainer.Tool);
28003
27974
  break;
28004
-
28005
27975
  default:
28006
27976
  contextActionMenu = generateContextMenuListOptions(ActionsForMapContainer.Other);
28007
27977
  break;
28008
27978
  }
28009
27979
  }
28010
-
28011
27980
  return contextActionMenu;
28012
27981
  };
28013
27982
 
@@ -28025,39 +27994,33 @@ var EquipmentSlotSpriteByType = {
28025
27994
  };
28026
27995
  var ItemSlot = /*#__PURE__*/observer(function (_ref) {
28027
27996
  var slotIndex = _ref.slotIndex,
28028
- item = _ref.item,
28029
- containerType = _ref.itemContainerType,
28030
- slotSpriteMask = _ref.slotSpriteMask,
28031
- _onMouseOver = _ref.onMouseOver,
28032
- _onMouseOut = _ref.onMouseOut,
28033
- _onClick = _ref.onClick,
28034
- _onSelected = _ref.onSelected,
28035
- atlasJSON = _ref.atlasJSON,
28036
- atlasIMG = _ref.atlasIMG;
28037
-
27997
+ item = _ref.item,
27998
+ containerType = _ref.itemContainerType,
27999
+ slotSpriteMask = _ref.slotSpriteMask,
28000
+ _onMouseOver = _ref.onMouseOver,
28001
+ _onMouseOut = _ref.onMouseOut,
28002
+ _onClick = _ref.onClick,
28003
+ _onSelected = _ref.onSelected,
28004
+ atlasJSON = _ref.atlasJSON,
28005
+ atlasIMG = _ref.atlasIMG;
28038
28006
  var _useState = useState(false),
28039
- isTooltipVisible = _useState[0],
28040
- setTooltipVisible = _useState[1];
28041
-
28007
+ isTooltipVisible = _useState[0],
28008
+ setTooltipVisible = _useState[1];
28042
28009
  var _useState2 = useState(false),
28043
- isContextMenuVisible = _useState2[0],
28044
- setIsContextMenuVisible = _useState2[1];
28045
-
28010
+ isContextMenuVisible = _useState2[0],
28011
+ setIsContextMenuVisible = _useState2[1];
28046
28012
  var _useState3 = useState([]),
28047
- contextActions = _useState3[0],
28048
- setContextActions = _useState3[1];
28049
-
28013
+ contextActions = _useState3[0],
28014
+ setContextActions = _useState3[1];
28050
28015
  useEffect(function () {
28051
28016
  if (item) {
28052
28017
  setContextActions(generateContextMenu(item.type, containerType));
28053
28018
  }
28054
28019
  }, [item]);
28055
-
28056
28020
  var getLeftPositionValue = function getLeftPositionValue(quantity) {
28057
28021
  if (quantity > 0 && quantity < 10) return '2.5rem';else if (quantity > 9 && quantity < 100) return '2.0rem';else if (quantity > 99) return '1rem';
28058
28022
  return '2.5rem';
28059
28023
  };
28060
-
28061
28024
  var getStackInfo = function getStackInfo(itemId, stackQty) {
28062
28025
  // if (itemToRender?.isStackable && itemToRender?.stackQty) {
28063
28026
  if (stackQty > 1) {
@@ -28066,17 +28029,15 @@ var ItemSlot = /*#__PURE__*/observer(function (_ref) {
28066
28029
  key: "qty-" + itemId
28067
28030
  }, ' ', stackQty, ' ');
28068
28031
  }
28069
-
28070
28032
  return undefined;
28071
28033
  };
28072
-
28073
28034
  var renderItem = function renderItem(itemToRender) {
28074
28035
  var _itemToRender$_id, _itemToRender$stackQt;
28075
-
28076
28036
  var element = [];
28077
-
28078
28037
  if (itemToRender != null && itemToRender.texturePath) {
28079
- element.push(React.createElement(ErrorBoundary, null, React.createElement(SpriteFromAtlas, {
28038
+ element.push(React.createElement(ErrorBoundary, {
28039
+ key: itemToRender._id
28040
+ }, React.createElement(SpriteFromAtlas, {
28080
28041
  key: itemToRender._id,
28081
28042
  atlasIMG: atlasIMG,
28082
28043
  atlasJSON: atlasJSON,
@@ -28084,24 +28045,20 @@ var ItemSlot = /*#__PURE__*/observer(function (_ref) {
28084
28045
  imgScale: 3
28085
28046
  })));
28086
28047
  }
28087
-
28088
28048
  var stackInfo = getStackInfo((_itemToRender$_id = itemToRender == null ? void 0 : itemToRender._id) != null ? _itemToRender$_id : '', (_itemToRender$stackQt = itemToRender == null ? void 0 : itemToRender.stackQty) != null ? _itemToRender$stackQt : 0);
28089
-
28090
28049
  if (stackInfo) {
28091
28050
  element.push(stackInfo);
28092
28051
  }
28093
-
28094
28052
  return element;
28095
28053
  };
28096
-
28097
28054
  var renderEquipment = function renderEquipment(itemToRender) {
28098
28055
  var _itemToRender$allowed;
28099
-
28100
28056
  if (itemToRender != null && itemToRender.texturePath && (_itemToRender$allowed = itemToRender.allowedEquipSlotType) != null && _itemToRender$allowed.includes(slotSpriteMask)) {
28101
28057
  var _itemToRender$_id2, _itemToRender$stackQt2;
28102
-
28103
28058
  var element = [];
28104
- element.push(React.createElement(ErrorBoundary, null, React.createElement(SpriteFromAtlas, {
28059
+ element.push(React.createElement(ErrorBoundary, {
28060
+ key: itemToRender._id
28061
+ }, React.createElement(SpriteFromAtlas, {
28105
28062
  key: itemToRender._id,
28106
28063
  atlasIMG: atlasIMG,
28107
28064
  atlasJSON: atlasJSON,
@@ -28109,14 +28066,15 @@ var ItemSlot = /*#__PURE__*/observer(function (_ref) {
28109
28066
  imgScale: 3
28110
28067
  })));
28111
28068
  var stackInfo = getStackInfo((_itemToRender$_id2 = itemToRender == null ? void 0 : itemToRender._id) != null ? _itemToRender$_id2 : '', (_itemToRender$stackQt2 = itemToRender == null ? void 0 : itemToRender.stackQty) != null ? _itemToRender$stackQt2 : 0);
28112
-
28113
28069
  if (stackInfo) {
28114
28070
  element.push(stackInfo);
28115
28071
  }
28116
-
28117
28072
  return element;
28118
28073
  } else {
28119
- return React.createElement(ErrorBoundary, null, React.createElement(SpriteFromAtlas, {
28074
+ return React.createElement(ErrorBoundary, {
28075
+ key: v4()
28076
+ }, React.createElement(SpriteFromAtlas, {
28077
+ key: v4(),
28120
28078
  atlasIMG: atlasIMG,
28121
28079
  atlasJSON: atlasJSON,
28122
28080
  spriteKey: EquipmentSlotSpriteByType[slotSpriteMask],
@@ -28126,20 +28084,16 @@ var ItemSlot = /*#__PURE__*/observer(function (_ref) {
28126
28084
  }));
28127
28085
  }
28128
28086
  };
28129
-
28130
28087
  var onRenderSlot = function onRenderSlot(itemToRender) {
28131
28088
  switch (containerType) {
28132
28089
  case ItemContainerType.Equipment:
28133
28090
  return renderEquipment(itemToRender);
28134
-
28135
28091
  case ItemContainerType.Inventory:
28136
28092
  return renderItem(itemToRender);
28137
-
28138
28093
  default:
28139
28094
  return renderItem(itemToRender);
28140
28095
  }
28141
28096
  };
28142
-
28143
28097
  return React.createElement(Container$9, {
28144
28098
  className: "rpgui-icon empty-slot",
28145
28099
  onMouseOver: function onMouseOver(event) {
@@ -28156,10 +28110,8 @@ var ItemSlot = /*#__PURE__*/observer(function (_ref) {
28156
28110
  },
28157
28111
  onClick: function onClick() {
28158
28112
  setTooltipVisible(false);
28159
-
28160
28113
  if (item) {
28161
28114
  setIsContextMenuVisible(!isContextMenuVisible);
28162
-
28163
28115
  _onClick(item.type, containerType, item);
28164
28116
  }
28165
28117
  }
@@ -28167,7 +28119,6 @@ var ItemSlot = /*#__PURE__*/observer(function (_ref) {
28167
28119
  options: contextActions,
28168
28120
  onSelected: function onSelected(optionId) {
28169
28121
  setIsContextMenuVisible(false);
28170
-
28171
28122
  if (item) {
28172
28123
  _onSelected(optionId, item);
28173
28124
  }
@@ -28192,31 +28143,29 @@ var ItemQty = /*#__PURE__*/styled.span.withConfig({
28192
28143
 
28193
28144
  var EquipmentSet = function EquipmentSet(_ref) {
28194
28145
  var equipmentSet = _ref.equipmentSet,
28195
- onClose = _ref.onClose,
28196
- _onMouseOver = _ref.onMouseOver,
28197
- _onSelected = _ref.onSelected,
28198
- onItemClick = _ref.onItemClick,
28199
- atlasIMG = _ref.atlasIMG,
28200
- atlasJSON = _ref.atlasJSON;
28146
+ onClose = _ref.onClose,
28147
+ _onMouseOver = _ref.onMouseOver,
28148
+ _onSelected = _ref.onSelected,
28149
+ onItemClick = _ref.onItemClick,
28150
+ atlasIMG = _ref.atlasIMG,
28151
+ atlasJSON = _ref.atlasJSON;
28201
28152
  var neck = equipmentSet.neck,
28202
- leftHand = equipmentSet.leftHand,
28203
- ring = equipmentSet.ring,
28204
- head = equipmentSet.head,
28205
- armor = equipmentSet.armor,
28206
- legs = equipmentSet.legs,
28207
- boot = equipmentSet.boot,
28208
- inventory = equipmentSet.inventory,
28209
- rightHand = equipmentSet.rightHand,
28210
- accessory = equipmentSet.accessory;
28153
+ leftHand = equipmentSet.leftHand,
28154
+ ring = equipmentSet.ring,
28155
+ head = equipmentSet.head,
28156
+ armor = equipmentSet.armor,
28157
+ legs = equipmentSet.legs,
28158
+ boot = equipmentSet.boot,
28159
+ inventory = equipmentSet.inventory,
28160
+ rightHand = equipmentSet.rightHand,
28161
+ accessory = equipmentSet.accessory;
28211
28162
  var equipmentData = [neck, leftHand, ring, head, armor, legs, boot, inventory, rightHand, accessory];
28212
28163
  var equipmentMaskSlots = [ItemSlotType.Neck, ItemSlotType.LeftHand, ItemSlotType.Ring, ItemSlotType.Head, ItemSlotType.Torso, ItemSlotType.Legs, ItemSlotType.Feet, ItemSlotType.Inventory, ItemSlotType.RightHand, ItemSlotType.Accessory];
28213
-
28214
28164
  var onRenderEquipmentSlotRange = function onRenderEquipmentSlotRange(start, end) {
28215
28165
  var equipmentRange = equipmentData.slice(start, end);
28216
28166
  var slotMaksRange = equipmentMaskSlots.slice(start, end);
28217
28167
  return equipmentRange.map(function (data, i) {
28218
28168
  var _ref2;
28219
-
28220
28169
  var item = data;
28221
28170
  var itemContainer = (_ref2 = item && item.itemContainer) != null ? _ref2 : null;
28222
28171
  return React.createElement(ItemSlot, {
@@ -28240,7 +28189,6 @@ var EquipmentSet = function EquipmentSet(_ref) {
28240
28189
  });
28241
28190
  });
28242
28191
  };
28243
-
28244
28192
  return React.createElement(DraggableContainer, {
28245
28193
  title: 'Equipments',
28246
28194
  type: RPGUIContainerTypes.Framed,
@@ -28262,127 +28210,6 @@ var EquipmentColumn = /*#__PURE__*/styled.div.withConfig({
28262
28210
  componentId: "sc-1wuddg2-1"
28263
28211
  })(["display:flex;justify-content:center;flex-wrap:wrap;flex-direction:column;"]);
28264
28212
 
28265
- var SlotsContainer = function SlotsContainer(_ref) {
28266
- var children = _ref.children,
28267
- title = _ref.title,
28268
- onClose = _ref.onClose,
28269
- _onPositionChange = _ref.onPositionChange,
28270
- onOutsideClick = _ref.onOutsideClick;
28271
- return React.createElement(DraggableContainer, {
28272
- title: title,
28273
- type: RPGUIContainerTypes.Framed,
28274
- onCloseButton: function onCloseButton() {
28275
- if (onClose) {
28276
- onClose();
28277
- }
28278
- },
28279
- width: "330px",
28280
- cancelDrag: ".item-container-body",
28281
- onPositionChange: function onPositionChange(_ref2) {
28282
- var x = _ref2.x,
28283
- y = _ref2.y;
28284
-
28285
- if (_onPositionChange) {
28286
- _onPositionChange({
28287
- x: x,
28288
- y: y
28289
- });
28290
- }
28291
- },
28292
- onOutsideClick: onOutsideClick
28293
- }, children);
28294
- };
28295
-
28296
- var ItemContainer = function ItemContainer(_ref) {
28297
- var itemContainer = _ref.itemContainer,
28298
- onClose = _ref.onClose,
28299
- _onMouseOver = _ref.onMouseOver,
28300
- _onSelected = _ref.onSelected,
28301
- onItemClick = _ref.onItemClick,
28302
- type = _ref.type,
28303
- atlasJSON = _ref.atlasJSON,
28304
- atlasIMG = _ref.atlasIMG;
28305
-
28306
- var onRenderSlots = function onRenderSlots() {
28307
- var slots = [];
28308
-
28309
- for (var i = 0; i < itemContainer.slotQty; i++) {
28310
- var _itemContainer$slots;
28311
-
28312
- slots.push(React.createElement(ItemSlot, {
28313
- key: i,
28314
- slotIndex: i,
28315
- item: ((_itemContainer$slots = itemContainer.slots) == null ? void 0 : _itemContainer$slots[i]) || null,
28316
- itemContainerType: type,
28317
- onMouseOver: function onMouseOver(event, slotIndex, item) {
28318
- if (_onMouseOver) _onMouseOver(event, slotIndex, item);
28319
- },
28320
- onClick: function onClick(ItemType, ContainerType, item) {
28321
- if (onItemClick) onItemClick(item, ItemType, ContainerType);
28322
- },
28323
- onSelected: function onSelected(optionId, item) {
28324
- if (_onSelected) _onSelected(optionId, item);
28325
- },
28326
- atlasIMG: atlasIMG,
28327
- atlasJSON: atlasJSON
28328
- }));
28329
- }
28330
-
28331
- return slots;
28332
- };
28333
-
28334
- return React.createElement(SlotsContainer, {
28335
- title: itemContainer.name || 'Container',
28336
- onClose: onClose
28337
- }, React.createElement(ItemsContainer, {
28338
- className: "item-container-body"
28339
- }, onRenderSlots()));
28340
- };
28341
- var ItemsContainer = /*#__PURE__*/styled.div.withConfig({
28342
- displayName: "ItemContainer__ItemsContainer",
28343
- componentId: "sc-15y5p9l-0"
28344
- })(["max-width:280px;display:flex;justify-content:center;flex-wrap:wrap;"]);
28345
-
28346
- var ListMenu = function ListMenu(_ref) {
28347
- var options = _ref.options,
28348
- onSelected = _ref.onSelected,
28349
- x = _ref.x,
28350
- y = _ref.y,
28351
- _ref$fontSize = _ref.fontSize,
28352
- fontSize = _ref$fontSize === void 0 ? 0.8 : _ref$fontSize;
28353
- return React.createElement(Container$a, {
28354
- x: x,
28355
- y: y,
28356
- fontSize: fontSize
28357
- }, React.createElement("ul", {
28358
- className: "rpgui-list-imp",
28359
- style: {
28360
- overflow: 'hidden'
28361
- }
28362
- }, options.map(function (params, index) {
28363
- return React.createElement(ListElement$1, {
28364
- key: (params == null ? void 0 : params.id) || index,
28365
- onClick: function onClick() {
28366
- onSelected(params == null ? void 0 : params.id);
28367
- }
28368
- }, (params == null ? void 0 : params.text) || 'No text');
28369
- })));
28370
- };
28371
- var Container$a = /*#__PURE__*/styled.div.withConfig({
28372
- displayName: "ListMenu__Container",
28373
- componentId: "sc-i9097t-0"
28374
- })(["display:flex;flex-direction:column;width:100%;justify-content:start;align-items:flex-start;position:absolute;top:", "px;left:", "px;li{font-size:", "em;}"], function (props) {
28375
- return props.y || 0;
28376
- }, function (props) {
28377
- return props.x || 0;
28378
- }, function (props) {
28379
- return props.fontSize;
28380
- });
28381
- var ListElement$1 = /*#__PURE__*/styled.li.withConfig({
28382
- displayName: "ListMenu__ListElement",
28383
- componentId: "sc-i9097t-1"
28384
- })(["margin-right:0.5rem;"]);
28385
-
28386
28213
  var img$6 = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAP1BMVEUAAAA7FyVxQTsUEBPj5v////+5v/tCJDOOUlIiHBr1oJfptaO6dWr61rhzFy1bMTjoanMUNGQoXMQkn97+88DQ3IhAAAAAAXRSTlMAQObYZgAAAAFiS0dEBfhv6ccAAAAHdElNRQfmAw4VOBC7c5LYAAABM0lEQVQ4y3XRi5KDIAwFUAUkbrBgpP//rZsHVHQ009qZ3tPboNN0zmwzvcw8O5sX4y0NOg/Et3jRCXF+ziULorjkOQ9gE24dvuUAzq08DiCO4pe3WN7zCP56vmpubBReQYC11YPS86ySxxCsAABTSgjb5m4g8nfbxvFHBkH2OEEvAItVuCuIsgGgl+Gcr7kDXxhEAx55A2SQEEeQeZwUaIP8Tbo05B0RFPhItAjgj1w6cDnhLluDj+Egkh3pCCP4pKQAw1IPO0W9Nti5gW9RP2dKA3BZd2Dw+baYX+Nt4GM00O4S3kEpF6Alb2Bv4LeC3kkGfAW0/p0RPoJVKr63ghHsKuRh5DIUKOAlGOwrtt9fQekAEfmhZslHUDoglB0zjfkJigN7UnTQQ4GBWomoVhEN/AOPSBh38gy+fwAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAyMi0wMy0xNFQyMTo1NTo1MSswMDowMJcc0eEAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMjItMDMtMTRUMjE6NTU6NTErMDA6MDDmQWldAAAAAElFTkSuQmCC';
28387
28214
 
28388
28215
  var img$7 = 'data:image/gif;base64,R0lGODlhQAAgAPIAAAAAAA0NDRERESIiIigoKFlZWf///wAAACH/C05FVFNDQVBFMi4wAwEAAAAh/wtJbWFnZU1hZ2ljaw5nYW1tYT0wLjQ1NDU0NQAh+QQBFAAAACwAAAAAQAAgAAAD/wi63P4wykmrvTjrzbv/YAgIZGmeaKquakQWcCzPdG3fNukIeO//PQGDBywafcIF8chswpKKZcxApTqvNOiIZi0YsODncFaFlcNOrdTbJVff0/c3Lp/Xs2N37cy2ndt6ZnhKXHdsc4d7VnwyfIxqPWWOXXWLgHSGYoSNbZKVZp2WiJyjg1GFcaClqaqJhasyUAFrh3Cur3KqubWXBQIBAAEDtDeMaEEDAcLEx2gCycvN0jHPysPT09XR2M3a19zH3gTM4EYCBNDD4yzs7e4r48nB6gT19vf4+fr7/P3P8sKGvRtIkMUAeQoCHlzIsKHDhxAjSoTWQJnFixgzatzIsQWjRQYJAAAh/wtJbWFnZU1hZ2ljaw5nYW1tYT0wLjQ1NDU0NQAh+QQBFAAAACwAAAAAQAAgAAAD8Ai63P4wykmrvTjrzbv/YCiOlGCeaKqubMtGZiHPdG3feI6bjqD/wOBPwPAJj0ggcWFMOp+ypaI5M1it0KxNCqDKsAWDdhwt1q5fMPnJ9aJt17g4HafJ3/et+Tzn99V+aThqfTNtcHlhhIBVWG+BdDSHOmiPeHdij3aYhZONf46YkZGanzpSAV6KjaOIpqWtNwIBAAEDqqKKhZuJnHSwAgMBtqo5sGs5wcO3yM01ysTO0gXQzNPN1cXXUNnbyNna3kcmwrW3Lujp6ugD5bbn6/HyLe20Cu/t+fr7/P3+/wCF2VswrKDBgwgTKlzIsCCDBAA7';
@@ -28393,13 +28220,11 @@ var chunkString = function chunkString(str, length) {
28393
28220
 
28394
28221
  var DynamicText = function DynamicText(_ref) {
28395
28222
  var text = _ref.text,
28396
- onFinish = _ref.onFinish,
28397
- onStart = _ref.onStart;
28398
-
28223
+ onFinish = _ref.onFinish,
28224
+ onStart = _ref.onStart;
28399
28225
  var _useState = useState(''),
28400
- textState = _useState[0],
28401
- setTextState = _useState[1];
28402
-
28226
+ textState = _useState[0],
28227
+ setTextState = _useState[1];
28403
28228
  useEffect(function () {
28404
28229
  var i = 0;
28405
28230
  var interval = setInterval(function () {
@@ -28409,13 +28234,11 @@ var DynamicText = function DynamicText(_ref) {
28409
28234
  onStart();
28410
28235
  }
28411
28236
  }
28412
-
28413
28237
  if (i < text.length) {
28414
28238
  setTextState(text.substring(0, i + 1));
28415
28239
  i++;
28416
28240
  } else {
28417
28241
  clearInterval(interval);
28418
-
28419
28242
  if (onFinish) {
28420
28243
  onFinish();
28421
28244
  }
@@ -28434,19 +28257,16 @@ var TextContainer = /*#__PURE__*/styled.p.withConfig({
28434
28257
 
28435
28258
  var NPCDialogText = function NPCDialogText(_ref) {
28436
28259
  var text = _ref.text,
28437
- onClose = _ref.onClose,
28438
- onEndStep = _ref.onEndStep,
28439
- onStartStep = _ref.onStartStep;
28260
+ onClose = _ref.onClose,
28261
+ onEndStep = _ref.onEndStep,
28262
+ onStartStep = _ref.onStartStep;
28440
28263
  var textChunks = chunkString(text, 85);
28441
-
28442
28264
  var _useState = useState(0),
28443
- chunkIndex = _useState[0],
28444
- setChunkIndex = _useState[1];
28445
-
28265
+ chunkIndex = _useState[0],
28266
+ setChunkIndex = _useState[1];
28446
28267
  var onHandleSpacePress = function onHandleSpacePress(event) {
28447
28268
  if (event.code === 'Space') {
28448
28269
  var hasNextChunk = (textChunks == null ? void 0 : textChunks[chunkIndex + 1]) || false;
28449
-
28450
28270
  if (hasNextChunk) {
28451
28271
  setChunkIndex(function (prev) {
28452
28272
  return prev + 1;
@@ -28457,29 +28277,28 @@ var NPCDialogText = function NPCDialogText(_ref) {
28457
28277
  }
28458
28278
  }
28459
28279
  };
28460
-
28461
28280
  useEffect(function () {
28462
28281
  document.addEventListener('keydown', onHandleSpacePress);
28463
28282
  return function () {
28464
28283
  return document.removeEventListener('keydown', onHandleSpacePress);
28465
28284
  };
28466
28285
  }, [chunkIndex]);
28467
- return React.createElement(Container$b, null, React.createElement(DynamicText, {
28286
+ return React.createElement(Container$a, null, React.createElement(DynamicText, {
28468
28287
  text: (textChunks == null ? void 0 : textChunks[chunkIndex]) || '',
28469
28288
  onFinish: onEndStep,
28470
28289
  onStart: onStartStep
28471
28290
  }));
28472
28291
  };
28473
- var Container$b = /*#__PURE__*/styled.div.withConfig({
28292
+ var Container$a = /*#__PURE__*/styled.div.withConfig({
28474
28293
  displayName: "NPCDialogText__Container",
28475
28294
  componentId: "sc-1cxkdh9-0"
28476
28295
  })([""]);
28477
28296
 
28297
+ //@ts-ignore
28478
28298
  var useEventListener = function useEventListener(type, handler, el) {
28479
28299
  if (el === void 0) {
28480
28300
  el = window;
28481
28301
  }
28482
-
28483
28302
  var savedHandler = React.useRef();
28484
28303
  React.useEffect(function () {
28485
28304
  savedHandler.current = handler;
@@ -28489,7 +28308,6 @@ var useEventListener = function useEventListener(type, handler, el) {
28489
28308
  var listener = function listener(e) {
28490
28309
  return savedHandler.current(e);
28491
28310
  };
28492
-
28493
28311
  el.addEventListener(type, listener);
28494
28312
  return function () {
28495
28313
  el.removeEventListener(type, listener);
@@ -28499,36 +28317,29 @@ var useEventListener = function useEventListener(type, handler, el) {
28499
28317
 
28500
28318
  var QuestionDialog = function QuestionDialog(_ref) {
28501
28319
  var questions = _ref.questions,
28502
- answers = _ref.answers,
28503
- onClose = _ref.onClose;
28504
-
28320
+ answers = _ref.answers,
28321
+ onClose = _ref.onClose;
28505
28322
  var _useState = useState(questions[0]),
28506
- currentQuestion = _useState[0],
28507
- setCurrentQuestion = _useState[1];
28508
-
28323
+ currentQuestion = _useState[0],
28324
+ setCurrentQuestion = _useState[1];
28509
28325
  var _useState2 = useState(false),
28510
- canShowAnswers = _useState2[0],
28511
- setCanShowAnswers = _useState2[1];
28512
-
28326
+ canShowAnswers = _useState2[0],
28327
+ setCanShowAnswers = _useState2[1];
28513
28328
  var onGetFirstAnswer = function onGetFirstAnswer() {
28514
28329
  if (!currentQuestion.answerIds || currentQuestion.answerIds.length === 0) {
28515
28330
  return null;
28516
28331
  }
28517
-
28518
28332
  var firstAnswerId = currentQuestion.answerIds[0];
28519
28333
  return answers.find(function (answer) {
28520
28334
  return answer.id === firstAnswerId;
28521
28335
  });
28522
28336
  };
28523
-
28524
28337
  var _useState3 = useState(onGetFirstAnswer()),
28525
- currentAnswer = _useState3[0],
28526
- setCurrentAnswer = _useState3[1];
28527
-
28338
+ currentAnswer = _useState3[0],
28339
+ setCurrentAnswer = _useState3[1];
28528
28340
  useEffect(function () {
28529
28341
  setCurrentAnswer(onGetFirstAnswer());
28530
28342
  }, [currentQuestion]);
28531
-
28532
28343
  var onGetAnswers = function onGetAnswers(answerIds) {
28533
28344
  return answerIds.map(function (answerId) {
28534
28345
  return answers.find(function (answer) {
@@ -28536,7 +28347,6 @@ var QuestionDialog = function QuestionDialog(_ref) {
28536
28347
  });
28537
28348
  });
28538
28349
  };
28539
-
28540
28350
  var onKeyPress = function onKeyPress(e) {
28541
28351
  switch (e.key) {
28542
28352
  case 'ArrowDown':
@@ -28554,7 +28364,6 @@ var QuestionDialog = function QuestionDialog(_ref) {
28554
28364
  });
28555
28365
  setCurrentAnswer(nextAnswer || onGetFirstAnswer());
28556
28366
  break;
28557
-
28558
28367
  case 'ArrowUp':
28559
28368
  // select previous answer, if any.
28560
28369
  // if no previous answer, select last answer
@@ -28565,18 +28374,14 @@ var QuestionDialog = function QuestionDialog(_ref) {
28565
28374
  var previousAnswer = onGetAnswers(currentQuestion.answerIds).find(function (answer) {
28566
28375
  return (answer == null ? void 0 : answer.id) === previousAnswerID;
28567
28376
  });
28568
-
28569
28377
  if (previousAnswer) {
28570
28378
  setCurrentAnswer(previousAnswer);
28571
28379
  } else {
28572
28380
  setCurrentAnswer(onGetAnswers(currentQuestion.answerIds).pop());
28573
28381
  }
28574
-
28575
28382
  break;
28576
-
28577
28383
  case 'Enter':
28578
28384
  setCanShowAnswers(false);
28579
-
28580
28385
  if (!(currentAnswer != null && currentAnswer.nextQuestionId)) {
28581
28386
  onClose();
28582
28387
  return;
@@ -28585,16 +28390,12 @@ var QuestionDialog = function QuestionDialog(_ref) {
28585
28390
  return question.id === currentAnswer.nextQuestionId;
28586
28391
  }));
28587
28392
  }
28588
-
28589
28393
  break;
28590
28394
  }
28591
28395
  };
28592
-
28593
28396
  useEventListener('keydown', onKeyPress);
28594
-
28595
28397
  var onAnswerClick = function onAnswerClick(answer) {
28596
28398
  setCanShowAnswers(false);
28597
-
28598
28399
  if (answer.nextQuestionId) {
28599
28400
  // if there is a next question, go to it
28600
28401
  setCurrentQuestion(questions.find(function (question) {
@@ -28605,24 +28406,18 @@ var QuestionDialog = function QuestionDialog(_ref) {
28605
28406
  onClose();
28606
28407
  }
28607
28408
  };
28608
-
28609
28409
  var onRenderCurrentAnswers = function onRenderCurrentAnswers() {
28610
28410
  var answerIds = currentQuestion.answerIds;
28611
-
28612
28411
  if (!answerIds) {
28613
28412
  return null;
28614
28413
  }
28615
-
28616
28414
  var answers = onGetAnswers(answerIds);
28617
-
28618
28415
  if (!answers) {
28619
28416
  return null;
28620
28417
  }
28621
-
28622
28418
  return answers.map(function (answer) {
28623
28419
  var isSelected = (currentAnswer == null ? void 0 : currentAnswer.id) === (answer == null ? void 0 : answer.id);
28624
28420
  var selectedColor = isSelected ? 'yellow' : 'white';
28625
-
28626
28421
  if (answer) {
28627
28422
  return React.createElement(AnswerRow, {
28628
28423
  key: "answer_" + answer.id
@@ -28636,12 +28431,10 @@ var QuestionDialog = function QuestionDialog(_ref) {
28636
28431
  color: selectedColor
28637
28432
  }, answer.text));
28638
28433
  }
28639
-
28640
28434
  return null;
28641
28435
  });
28642
28436
  };
28643
-
28644
- return React.createElement(Container$c, null, React.createElement(QuestionContainer, null, React.createElement(DynamicText, {
28437
+ return React.createElement(Container$b, null, React.createElement(QuestionContainer, null, React.createElement(DynamicText, {
28645
28438
  text: currentQuestion.text,
28646
28439
  onStart: function onStart() {
28647
28440
  return setCanShowAnswers(false);
@@ -28651,7 +28444,7 @@ var QuestionDialog = function QuestionDialog(_ref) {
28651
28444
  }
28652
28445
  })), canShowAnswers && React.createElement(AnswersContainer, null, onRenderCurrentAnswers()));
28653
28446
  };
28654
- var Container$c = /*#__PURE__*/styled.div.withConfig({
28447
+ var Container$b = /*#__PURE__*/styled.div.withConfig({
28655
28448
  displayName: "QuestionDialog__Container",
28656
28449
  componentId: "sc-bxc5u0-0"
28657
28450
  })(["display:flex;word-break:break-all;box-sizing:border-box;justify-content:flex-start;align-items:flex-start;flex-wrap:wrap;"]);
@@ -28681,26 +28474,22 @@ var AnswerRow = /*#__PURE__*/styled.div.withConfig({
28681
28474
  })(["display:flex;flex-wrap:wrap;justify-content:center;align-items:center;margin-bottom:0.5rem;height:22px;p{line-height:unset;margin-top:0;margin-bottom:0rem;}"]);
28682
28475
 
28683
28476
  var NPCDialogType;
28684
-
28685
28477
  (function (NPCDialogType) {
28686
28478
  NPCDialogType["TextOnly"] = "TextOnly";
28687
28479
  NPCDialogType["TextAndThumbnail"] = "TextAndThumbnail";
28688
28480
  })(NPCDialogType || (NPCDialogType = {}));
28689
-
28690
28481
  var NPCDialog = function NPCDialog(_ref) {
28691
28482
  var text = _ref.text,
28692
- type = _ref.type,
28693
- _onClose = _ref.onClose,
28694
- imagePath = _ref.imagePath,
28695
- _ref$isQuestionDialog = _ref.isQuestionDialog,
28696
- isQuestionDialog = _ref$isQuestionDialog === void 0 ? false : _ref$isQuestionDialog,
28697
- questions = _ref.questions,
28698
- answers = _ref.answers;
28699
-
28483
+ type = _ref.type,
28484
+ _onClose = _ref.onClose,
28485
+ imagePath = _ref.imagePath,
28486
+ _ref$isQuestionDialog = _ref.isQuestionDialog,
28487
+ isQuestionDialog = _ref$isQuestionDialog === void 0 ? false : _ref$isQuestionDialog,
28488
+ questions = _ref.questions,
28489
+ answers = _ref.answers;
28700
28490
  var _useState = useState(false),
28701
- showGoNextIndicator = _useState[0],
28702
- setShowGoNextIndicator = _useState[1];
28703
-
28491
+ showGoNextIndicator = _useState[0],
28492
+ setShowGoNextIndicator = _useState[1];
28704
28493
  return React.createElement(RPGUIContainer, {
28705
28494
  type: RPGUIContainerTypes.FramedGold,
28706
28495
  width: isQuestionDialog ? '600px' : '50%',
@@ -28717,7 +28506,7 @@ var NPCDialog = function NPCDialog(_ref) {
28717
28506
  }
28718
28507
  })), type === NPCDialogType.TextAndThumbnail && React.createElement(ThumbnailContainer, null, React.createElement(NPCThumbnail, {
28719
28508
  src: imagePath || img$6
28720
- }))) : React.createElement(React.Fragment, null, React.createElement(Container$d, null, React.createElement(TextContainer$1, {
28509
+ }))) : React.createElement(React.Fragment, null, React.createElement(Container$c, null, React.createElement(TextContainer$1, {
28721
28510
  flex: type === NPCDialogType.TextAndThumbnail ? '70%' : '100%'
28722
28511
  }, React.createElement(NPCDialogText, {
28723
28512
  onStartStep: function onStartStep() {
@@ -28739,7 +28528,7 @@ var NPCDialog = function NPCDialog(_ref) {
28739
28528
  src: img$7
28740
28529
  })));
28741
28530
  };
28742
- var Container$d = /*#__PURE__*/styled.div.withConfig({
28531
+ var Container$c = /*#__PURE__*/styled.div.withConfig({
28743
28532
  displayName: "NPCDialog__Container",
28744
28533
  componentId: "sc-1b4aw74-0"
28745
28534
  })(["display:flex;width:100%;height:100%;box-sizing:border-box;justify-content:center;align-items:flex-start;position:relative;"]);
@@ -28766,27 +28555,309 @@ var PressSpaceIndicator = /*#__PURE__*/styled.img.withConfig({
28766
28555
  return right;
28767
28556
  });
28768
28557
 
28558
+ var ImgSide;
28559
+ (function (ImgSide) {
28560
+ ImgSide["right"] = "right";
28561
+ ImgSide["left"] = "left";
28562
+ })(ImgSide || (ImgSide = {}));
28563
+ var NPCMultiDialog = function NPCMultiDialog(_ref) {
28564
+ var _textAndTypeArray$sli;
28565
+ var _onClose = _ref.onClose,
28566
+ textAndTypeArray = _ref.textAndTypeArray;
28567
+ var _useState = useState(false),
28568
+ showGoNextIndicator = _useState[0],
28569
+ setShowGoNextIndicator = _useState[1];
28570
+ var _useState2 = useState(0),
28571
+ slide = _useState2[0],
28572
+ setSlide = _useState2[1];
28573
+ var onHandleSpacePress = function onHandleSpacePress(event) {
28574
+ if (event.code === 'Space') {
28575
+ if (slide < (textAndTypeArray == null ? void 0 : textAndTypeArray.length) - 1) {
28576
+ setSlide(function (prev) {
28577
+ return prev + 1;
28578
+ });
28579
+ } else {
28580
+ // if there's no more text chunks, close the dialog
28581
+ _onClose();
28582
+ }
28583
+ }
28584
+ };
28585
+ useEffect(function () {
28586
+ document.addEventListener('keydown', onHandleSpacePress);
28587
+ return function () {
28588
+ return document.removeEventListener('keydown', onHandleSpacePress);
28589
+ };
28590
+ }, [slide]);
28591
+ return React.createElement(RPGUIContainer, {
28592
+ type: RPGUIContainerTypes.FramedGold,
28593
+ width: '50%',
28594
+ height: '180px'
28595
+ }, React.createElement(React.Fragment, null, React.createElement(Container$d, null, ((_textAndTypeArray$sli = textAndTypeArray[slide]) == null ? void 0 : _textAndTypeArray$sli.imageSide) === 'right' && React.createElement(React.Fragment, null, React.createElement(TextContainer$2, {
28596
+ flex: '70%'
28597
+ }, React.createElement(NPCDialogText, {
28598
+ onStartStep: function onStartStep() {
28599
+ return setShowGoNextIndicator(false);
28600
+ },
28601
+ onEndStep: function onEndStep() {
28602
+ return setShowGoNextIndicator(true);
28603
+ },
28604
+ text: textAndTypeArray[slide].text || 'No text provided.',
28605
+ onClose: function onClose() {
28606
+ if (_onClose) {
28607
+ _onClose();
28608
+ }
28609
+ }
28610
+ })), React.createElement(ThumbnailContainer$1, null, React.createElement(NPCThumbnail$1, {
28611
+ src: textAndTypeArray[slide].imagePath || img$6
28612
+ })), showGoNextIndicator && React.createElement(PressSpaceIndicator$1, {
28613
+ right: '10.5rem',
28614
+ src: img$7
28615
+ })), textAndTypeArray[slide].imageSide === 'left' && React.createElement(React.Fragment, null, React.createElement(ThumbnailContainer$1, null, React.createElement(NPCThumbnail$1, {
28616
+ src: textAndTypeArray[slide].imagePath || img$6
28617
+ })), React.createElement(TextContainer$2, {
28618
+ flex: '70%'
28619
+ }, React.createElement(NPCDialogText, {
28620
+ onStartStep: function onStartStep() {
28621
+ return setShowGoNextIndicator(false);
28622
+ },
28623
+ onEndStep: function onEndStep() {
28624
+ return setShowGoNextIndicator(true);
28625
+ },
28626
+ text: textAndTypeArray[slide].text || 'No text provided.',
28627
+ onClose: function onClose() {
28628
+ if (_onClose) {
28629
+ _onClose();
28630
+ }
28631
+ }
28632
+ })), showGoNextIndicator && React.createElement(PressSpaceIndicator$1, {
28633
+ right: '1rem',
28634
+ src: img$7
28635
+ }))), ")"));
28636
+ };
28637
+ var Container$d = /*#__PURE__*/styled.div.withConfig({
28638
+ displayName: "NPCMultiDialog__Container",
28639
+ componentId: "sc-rvu5wg-0"
28640
+ })(["display:flex;width:100%;height:100%;box-sizing:border-box;justify-content:center;align-items:flex-start;position:relative;"]);
28641
+ var TextContainer$2 = /*#__PURE__*/styled.div.withConfig({
28642
+ displayName: "NPCMultiDialog__TextContainer",
28643
+ componentId: "sc-rvu5wg-1"
28644
+ })(["flex:", " 0 0;width:355px;"], function (_ref2) {
28645
+ var flex = _ref2.flex;
28646
+ return flex;
28647
+ });
28648
+ var ThumbnailContainer$1 = /*#__PURE__*/styled.div.withConfig({
28649
+ displayName: "NPCMultiDialog__ThumbnailContainer",
28650
+ componentId: "sc-rvu5wg-2"
28651
+ })(["flex:30% 0 0;display:flex;justify-content:flex-end;"]);
28652
+ var NPCThumbnail$1 = /*#__PURE__*/styled.img.withConfig({
28653
+ displayName: "NPCMultiDialog__NPCThumbnail",
28654
+ componentId: "sc-rvu5wg-3"
28655
+ })(["image-rendering:pixelated;height:128px;width:128px;"]);
28656
+ var PressSpaceIndicator$1 = /*#__PURE__*/styled.img.withConfig({
28657
+ displayName: "NPCMultiDialog__PressSpaceIndicator",
28658
+ componentId: "sc-rvu5wg-4"
28659
+ })(["position:absolute;right:", ";bottom:1rem;height:20.7px;image-rendering:-webkit-optimize-contrast;"], function (_ref3) {
28660
+ var right = _ref3.right;
28661
+ return right;
28662
+ });
28663
+
28664
+ var HistoryDialog = function HistoryDialog(_ref) {
28665
+ var backgroundImgPath = _ref.backgroundImgPath,
28666
+ fullCoverBackground = _ref.fullCoverBackground,
28667
+ questions = _ref.questions,
28668
+ answers = _ref.answers,
28669
+ text = _ref.text,
28670
+ imagePath = _ref.imagePath,
28671
+ textAndTypeArray = _ref.textAndTypeArray,
28672
+ onClose = _ref.onClose;
28673
+ var _useState = useState(0),
28674
+ img = _useState[0],
28675
+ setImage = _useState[1];
28676
+ var onHandleSpacePress = function onHandleSpacePress(event) {
28677
+ if (event.code === 'Space') {
28678
+ if (img < (backgroundImgPath == null ? void 0 : backgroundImgPath.length) - 1) {
28679
+ setImage(function (prev) {
28680
+ return prev + 1;
28681
+ });
28682
+ } else {
28683
+ // if there's no more text chunks, close the dialog
28684
+ onClose();
28685
+ }
28686
+ }
28687
+ };
28688
+ useEffect(function () {
28689
+ document.addEventListener('keydown', onHandleSpacePress);
28690
+ return function () {
28691
+ return document.removeEventListener('keydown', onHandleSpacePress);
28692
+ };
28693
+ }, [backgroundImgPath]);
28694
+ return React.createElement(BackgroundContainer, {
28695
+ imgPath: backgroundImgPath[img],
28696
+ fullImg: fullCoverBackground
28697
+ }, React.createElement(DialogContainer, null, textAndTypeArray ? React.createElement(NPCMultiDialog, {
28698
+ textAndTypeArray: textAndTypeArray,
28699
+ onClose: onClose
28700
+ }) : questions && answers ? React.createElement(QuestionDialog, {
28701
+ questions: questions,
28702
+ answers: answers,
28703
+ onClose: onClose
28704
+ }) : text && imagePath ? React.createElement(NPCDialog, {
28705
+ text: text,
28706
+ imagePath: imagePath,
28707
+ onClose: onClose,
28708
+ type: NPCDialogType.TextAndThumbnail
28709
+ }) : React.createElement(NPCDialog, {
28710
+ text: text,
28711
+ onClose: onClose,
28712
+ type: NPCDialogType.TextOnly
28713
+ })));
28714
+ };
28715
+ var BackgroundContainer = /*#__PURE__*/styled.div.withConfig({
28716
+ displayName: "HistoryDialog__BackgroundContainer",
28717
+ componentId: "sc-u6oe75-0"
28718
+ })(["width:100%;height:100%;background-image:url(", ");background-size:", ";display:flex;justify-content:space-evenly;align-items:center;"], function (props) {
28719
+ return props.imgPath;
28720
+ }, function (props) {
28721
+ return props.imgPath ? 'cover' : 'auto';
28722
+ });
28723
+ var DialogContainer = /*#__PURE__*/styled.div.withConfig({
28724
+ displayName: "HistoryDialog__DialogContainer",
28725
+ componentId: "sc-u6oe75-1"
28726
+ })(["display:flex;justify-content:center;padding-top:200px;"]);
28727
+
28728
+ var SlotsContainer = function SlotsContainer(_ref) {
28729
+ var children = _ref.children,
28730
+ title = _ref.title,
28731
+ onClose = _ref.onClose,
28732
+ _onPositionChange = _ref.onPositionChange,
28733
+ onOutsideClick = _ref.onOutsideClick;
28734
+ return React.createElement(DraggableContainer, {
28735
+ title: title,
28736
+ type: RPGUIContainerTypes.Framed,
28737
+ onCloseButton: function onCloseButton() {
28738
+ if (onClose) {
28739
+ onClose();
28740
+ }
28741
+ },
28742
+ width: "330px",
28743
+ cancelDrag: ".item-container-body",
28744
+ onPositionChange: function onPositionChange(_ref2) {
28745
+ var x = _ref2.x,
28746
+ y = _ref2.y;
28747
+ if (_onPositionChange) {
28748
+ _onPositionChange({
28749
+ x: x,
28750
+ y: y
28751
+ });
28752
+ }
28753
+ },
28754
+ onOutsideClick: onOutsideClick
28755
+ }, children);
28756
+ };
28757
+
28758
+ var ItemContainer = function ItemContainer(_ref) {
28759
+ var itemContainer = _ref.itemContainer,
28760
+ onClose = _ref.onClose,
28761
+ _onMouseOver = _ref.onMouseOver,
28762
+ _onSelected = _ref.onSelected,
28763
+ onItemClick = _ref.onItemClick,
28764
+ type = _ref.type,
28765
+ atlasJSON = _ref.atlasJSON,
28766
+ atlasIMG = _ref.atlasIMG;
28767
+ var onRenderSlots = function onRenderSlots() {
28768
+ var slots = [];
28769
+ for (var i = 0; i < itemContainer.slotQty; i++) {
28770
+ var _itemContainer$slots;
28771
+ slots.push(React.createElement(ItemSlot, {
28772
+ key: i,
28773
+ slotIndex: i,
28774
+ item: ((_itemContainer$slots = itemContainer.slots) == null ? void 0 : _itemContainer$slots[i]) || null,
28775
+ itemContainerType: type,
28776
+ onMouseOver: function onMouseOver(event, slotIndex, item) {
28777
+ if (_onMouseOver) _onMouseOver(event, slotIndex, item);
28778
+ },
28779
+ onClick: function onClick(ItemType, ContainerType, item) {
28780
+ if (onItemClick) onItemClick(item, ItemType, ContainerType);
28781
+ },
28782
+ onSelected: function onSelected(optionId, item) {
28783
+ if (_onSelected) _onSelected(optionId, item);
28784
+ },
28785
+ atlasIMG: atlasIMG,
28786
+ atlasJSON: atlasJSON
28787
+ }));
28788
+ }
28789
+ return slots;
28790
+ };
28791
+ return React.createElement(SlotsContainer, {
28792
+ title: itemContainer.name || 'Container',
28793
+ onClose: onClose
28794
+ }, React.createElement(ItemsContainer, {
28795
+ className: "item-container-body"
28796
+ }, onRenderSlots()));
28797
+ };
28798
+ var ItemsContainer = /*#__PURE__*/styled.div.withConfig({
28799
+ displayName: "ItemContainer__ItemsContainer",
28800
+ componentId: "sc-15y5p9l-0"
28801
+ })(["max-width:280px;display:flex;justify-content:center;flex-wrap:wrap;"]);
28802
+
28803
+ var ListMenu = function ListMenu(_ref) {
28804
+ var options = _ref.options,
28805
+ onSelected = _ref.onSelected,
28806
+ x = _ref.x,
28807
+ y = _ref.y,
28808
+ _ref$fontSize = _ref.fontSize,
28809
+ fontSize = _ref$fontSize === void 0 ? 0.8 : _ref$fontSize;
28810
+ return React.createElement(Container$e, {
28811
+ x: x,
28812
+ y: y,
28813
+ fontSize: fontSize
28814
+ }, React.createElement("ul", {
28815
+ className: "rpgui-list-imp",
28816
+ style: {
28817
+ overflow: 'hidden'
28818
+ }
28819
+ }, options.map(function (params, index) {
28820
+ return React.createElement(ListElement$1, {
28821
+ key: (params == null ? void 0 : params.id) || index,
28822
+ onClick: function onClick() {
28823
+ onSelected(params == null ? void 0 : params.id);
28824
+ }
28825
+ }, (params == null ? void 0 : params.text) || 'No text');
28826
+ })));
28827
+ };
28828
+ var Container$e = /*#__PURE__*/styled.div.withConfig({
28829
+ displayName: "ListMenu__Container",
28830
+ componentId: "sc-i9097t-0"
28831
+ })(["display:flex;flex-direction:column;width:100%;justify-content:start;align-items:flex-start;position:absolute;top:", "px;left:", "px;li{font-size:", "em;}"], function (props) {
28832
+ return props.y || 0;
28833
+ }, function (props) {
28834
+ return props.x || 0;
28835
+ }, function (props) {
28836
+ return props.fontSize;
28837
+ });
28838
+ var ListElement$1 = /*#__PURE__*/styled.li.withConfig({
28839
+ displayName: "ListMenu__ListElement",
28840
+ componentId: "sc-i9097t-1"
28841
+ })(["margin-right:0.5rem;"]);
28842
+
28769
28843
  var ProgressBar = function ProgressBar(_ref) {
28770
28844
  var max = _ref.max,
28771
- value = _ref.value,
28772
- color = _ref.color,
28773
- _ref$displayText = _ref.displayText,
28774
- displayText = _ref$displayText === void 0 ? true : _ref$displayText,
28775
- _ref$percentageWidth = _ref.percentageWidth,
28776
- percentageWidth = _ref$percentageWidth === void 0 ? 40 : _ref$percentageWidth,
28777
- _ref$minWidth = _ref.minWidth,
28778
- minWidth = _ref$minWidth === void 0 ? 100 : _ref$minWidth,
28779
- style = _ref.style;
28780
-
28845
+ value = _ref.value,
28846
+ color = _ref.color,
28847
+ _ref$displayText = _ref.displayText,
28848
+ displayText = _ref$displayText === void 0 ? true : _ref$displayText,
28849
+ _ref$percentageWidth = _ref.percentageWidth,
28850
+ percentageWidth = _ref$percentageWidth === void 0 ? 40 : _ref$percentageWidth,
28851
+ _ref$minWidth = _ref.minWidth,
28852
+ minWidth = _ref$minWidth === void 0 ? 100 : _ref$minWidth,
28853
+ style = _ref.style;
28781
28854
  var calculatePercentageValue = function calculatePercentageValue(max, value) {
28782
28855
  if (value > max) {
28783
28856
  value = max;
28784
28857
  }
28785
-
28786
28858
  return value * 100 / max;
28787
28859
  };
28788
-
28789
- return React.createElement(Container$e, {
28860
+ return React.createElement(Container$f, {
28790
28861
  className: "rpgui-progress",
28791
28862
  "data-value": calculatePercentageValue(max, value) / 100,
28792
28863
  "data-rpguitype": "progress",
@@ -28815,7 +28886,7 @@ var TextOverlay$1 = /*#__PURE__*/styled.div.withConfig({
28815
28886
  displayName: "ProgressBar__TextOverlay",
28816
28887
  componentId: "sc-qa6fzh-1"
28817
28888
  })(["width:100%;position:relative;"]);
28818
- var Container$e = /*#__PURE__*/styled.div.withConfig({
28889
+ var Container$f = /*#__PURE__*/styled.div.withConfig({
28819
28890
  displayName: "ProgressBar__Container",
28820
28891
  componentId: "sc-qa6fzh-2"
28821
28892
  })(["display:flex;flex-direction:column;min-width:", "px;width:", "%;justify-content:start;align-items:flex-start;", ""], function (props) {
@@ -28830,33 +28901,28 @@ var img$8 = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACIAAAAiCAYAAAA6RwvCA
28830
28901
 
28831
28902
  var QuestInfo = function QuestInfo(_ref) {
28832
28903
  var quests = _ref.quests,
28833
- onClose = _ref.onClose,
28834
- buttons = _ref.buttons,
28835
- onChangeQuest = _ref.onChangeQuest;
28836
-
28904
+ onClose = _ref.onClose,
28905
+ buttons = _ref.buttons,
28906
+ onChangeQuest = _ref.onChangeQuest;
28837
28907
  var _useState = useState(0),
28838
- currentIndex = _useState[0],
28839
- setCurrentIndex = _useState[1];
28840
-
28908
+ currentIndex = _useState[0],
28909
+ setCurrentIndex = _useState[1];
28841
28910
  var questsLength = quests.length - 1;
28842
28911
  useEffect(function () {
28843
28912
  if (onChangeQuest) {
28844
28913
  onChangeQuest(currentIndex, quests[currentIndex]._id);
28845
28914
  }
28846
28915
  }, [currentIndex]);
28847
-
28848
28916
  var onLeftClick = function onLeftClick() {
28849
28917
  if (currentIndex === 0) setCurrentIndex(questsLength);else setCurrentIndex(function (index) {
28850
28918
  return index - 1;
28851
28919
  });
28852
28920
  };
28853
-
28854
28921
  var onRightClick = function onRightClick() {
28855
28922
  if (currentIndex === questsLength) setCurrentIndex(0);else setCurrentIndex(function (index) {
28856
28923
  return index + 1;
28857
28924
  });
28858
28925
  };
28859
-
28860
28926
  return React.createElement(QuestDraggableContainer, {
28861
28927
  type: RPGUIContainerTypes.Framed,
28862
28928
  onCloseButton: function onCloseButton() {
@@ -28864,12 +28930,12 @@ var QuestInfo = function QuestInfo(_ref) {
28864
28930
  },
28865
28931
  width: "730px",
28866
28932
  cancelDrag: ".equipment-container-body .arrow-selector"
28867
- }, quests.length >= 2 ? React.createElement(QuestsContainer, null, currentIndex !== 0 && React.createElement(LeftArrow$1, {
28868
- className: "arrow-selector",
28933
+ }, quests.length >= 2 ? React.createElement(QuestsContainer, null, currentIndex !== 0 && React.createElement(SelectArrow, {
28934
+ direction: "left",
28869
28935
  onClick: onLeftClick,
28870
28936
  onTouchStart: onLeftClick
28871
- }), currentIndex !== quests.length - 1 && React.createElement(RightArrow$1, {
28872
- className: "arrow-selector",
28937
+ }), currentIndex !== quests.length - 1 && React.createElement(SelectArrow, {
28938
+ direction: "right",
28873
28939
  onClick: onRightClick,
28874
28940
  onTouchStart: onRightClick
28875
28941
  }), React.createElement(QuestContainer, null, React.createElement(TitleContainer$1, {
@@ -28948,18 +29014,10 @@ var Thumbnail = /*#__PURE__*/styled.img.withConfig({
28948
29014
  displayName: "QuestInfo__Thumbnail",
28949
29015
  componentId: "sc-15s2boc-8"
28950
29016
  })(["color:white;z-index:22;font-size:10px;width:64px;margin-right:0.5rem;"]);
28951
- var LeftArrow$1 = /*#__PURE__*/styled.div.withConfig({
28952
- displayName: "QuestInfo__LeftArrow",
28953
- componentId: "sc-15s2boc-9"
28954
- })(["background-image:url(", ");background-size:100% 100%;left:0;position:absolute;width:40px;height:42px;:active{background-image:url(", ");}"], img$3, img$2);
28955
- var RightArrow$1 = /*#__PURE__*/styled.div.withConfig({
28956
- displayName: "QuestInfo__RightArrow",
28957
- componentId: "sc-15s2boc-10"
28958
- })(["background-image:url(", ");right:0;position:absolute;width:40px;background-size:100% 100%;height:42px;:active{background-image:url(", ");}"], img$5, img$4);
28959
29017
 
28960
29018
  var QuestList = function QuestList(_ref) {
28961
29019
  var quests = _ref.quests,
28962
- onClose = _ref.onClose;
29020
+ onClose = _ref.onClose;
28963
29021
  return React.createElement(QuestDraggableContainer$1, {
28964
29022
  type: RPGUIContainerTypes.Framed,
28965
29023
  onCloseButton: function onCloseButton() {
@@ -29006,19 +29064,16 @@ var NoQuestContainer = /*#__PURE__*/styled.div.withConfig({
29006
29064
 
29007
29065
  var InputRadio = function InputRadio(_ref) {
29008
29066
  var name = _ref.name,
29009
- items = _ref.items,
29010
- onChange = _ref.onChange;
29011
-
29067
+ items = _ref.items,
29068
+ onChange = _ref.onChange;
29012
29069
  var _useState = useState(),
29013
- selectedValue = _useState[0],
29014
- setSelectedValue = _useState[1];
29015
-
29070
+ selectedValue = _useState[0],
29071
+ setSelectedValue = _useState[1];
29016
29072
  var handleClick = function handleClick() {
29017
29073
  var element = document.querySelector("input[name=" + name + "]:checked");
29018
29074
  var elementValue = element.value;
29019
29075
  setSelectedValue(elementValue);
29020
29076
  };
29021
-
29022
29077
  useEffect(function () {
29023
29078
  if (selectedValue) {
29024
29079
  onChange(selectedValue);
@@ -29040,28 +29095,22 @@ var InputRadio = function InputRadio(_ref) {
29040
29095
  };
29041
29096
 
29042
29097
  var RangeSliderType;
29043
-
29044
29098
  (function (RangeSliderType) {
29045
29099
  RangeSliderType["Slider"] = "rpgui-slider";
29046
29100
  RangeSliderType["GoldSlider"] = "rpgui-slider golden";
29047
29101
  })(RangeSliderType || (RangeSliderType = {}));
29048
-
29049
29102
  var RangeSlider = function RangeSlider(_ref) {
29050
29103
  var type = _ref.type,
29051
- valueMin = _ref.valueMin,
29052
- valueMax = _ref.valueMax,
29053
- width = _ref.width,
29054
- onChange = _ref.onChange;
29104
+ valueMin = _ref.valueMin,
29105
+ valueMax = _ref.valueMax,
29106
+ width = _ref.width,
29107
+ onChange = _ref.onChange;
29055
29108
  var sliderId = v4();
29056
-
29057
29109
  var onHandleMouseUp = function onHandleMouseUp() {
29058
29110
  var rpguiSlider = document.getElementById("rpgui-slider-" + sliderId);
29059
-
29060
29111
  var value = _RPGUI.get_value(rpguiSlider);
29061
-
29062
29112
  onChange(Number(value));
29063
29113
  };
29064
-
29065
29114
  return React.createElement("div", {
29066
29115
  onMouseUp: onHandleMouseUp
29067
29116
  }, React.createElement(Input$1, {
@@ -29082,11 +29131,11 @@ var Input$1 = /*#__PURE__*/styled.input.withConfig({
29082
29131
 
29083
29132
  var SimpleProgressBar = function SimpleProgressBar(_ref) {
29084
29133
  var value = _ref.value,
29085
- _ref$bgColor = _ref.bgColor,
29086
- bgColor = _ref$bgColor === void 0 ? 'red' : _ref$bgColor,
29087
- _ref$margin = _ref.margin,
29088
- margin = _ref$margin === void 0 ? 20 : _ref$margin;
29089
- return React.createElement(Container$f, {
29134
+ _ref$bgColor = _ref.bgColor,
29135
+ bgColor = _ref$bgColor === void 0 ? 'red' : _ref$bgColor,
29136
+ _ref$margin = _ref.margin,
29137
+ margin = _ref$margin === void 0 ? 20 : _ref$margin;
29138
+ return React.createElement(Container$g, {
29090
29139
  className: "simple-progress-bar"
29091
29140
  }, React.createElement(ProgressBarContainer, {
29092
29141
  margin: margin
@@ -29095,7 +29144,7 @@ var SimpleProgressBar = function SimpleProgressBar(_ref) {
29095
29144
  bgColor: bgColor
29096
29145
  }))));
29097
29146
  };
29098
- var Container$f = /*#__PURE__*/styled.div.withConfig({
29147
+ var Container$g = /*#__PURE__*/styled.div.withConfig({
29099
29148
  displayName: "SimpleProgressBar__Container",
29100
29149
  componentId: "sc-mbeil3-0"
29101
29150
  })(["display:flex;justify-content:center;align-items:center;width:100%;"]);
@@ -29120,16 +29169,18 @@ var ProgressBarContainer = /*#__PURE__*/styled.div.withConfig({
29120
29169
 
29121
29170
  var SkillProgressBar = function SkillProgressBar(_ref) {
29122
29171
  var bgColor = _ref.bgColor,
29123
- skillName = _ref.skillName,
29124
- level = _ref.level,
29125
- skillPoints = _ref.skillPoints,
29126
- texturePath = _ref.texturePath,
29127
- _ref$showSkillPoints = _ref.showSkillPoints,
29128
- showSkillPoints = _ref$showSkillPoints === void 0 ? true : _ref$showSkillPoints;
29172
+ skillName = _ref.skillName,
29173
+ level = _ref.level,
29174
+ skillPoints = _ref.skillPoints,
29175
+ texturePath = _ref.texturePath,
29176
+ _ref$showSkillPoints = _ref.showSkillPoints,
29177
+ showSkillPoints = _ref$showSkillPoints === void 0 ? true : _ref$showSkillPoints,
29178
+ atlasIMG = _ref.atlasIMG,
29179
+ atlasJSON = _ref.atlasJSON;
29129
29180
  var spForNextLevel = getSPForLevel(level + 1);
29130
29181
  var ratio = skillPoints / spForNextLevel * 100;
29131
- return React.createElement(React.Fragment, null, React.createElement(ProgressTitle, null, React.createElement(TitleName, null, skillName), React.createElement(ValueDisplay, null, "lv ", level)), React.createElement(ProgressBody, null, React.createElement(ProgressIconContainer, null, atlasJSON ? React.createElement(SpriteContainer, null, React.createElement(ErrorBoundary, null, React.createElement(SpriteFromAtlas, {
29132
- atlasIMG: img$1,
29182
+ return React.createElement(React.Fragment, null, React.createElement(ProgressTitle, null, React.createElement(TitleName, null, skillName), React.createElement(ValueDisplay, null, "lv ", level)), React.createElement(ProgressBody, null, React.createElement(ProgressIconContainer, null, atlasIMG && atlasJSON ? React.createElement(SpriteContainer, null, React.createElement(ErrorBoundary, null, React.createElement(SpriteFromAtlas, {
29183
+ atlasIMG: atlasIMG,
29133
29184
  atlasJSON: atlasJSON,
29134
29185
  spriteKey: texturePath,
29135
29186
  imgScale: 1,
@@ -29214,17 +29265,17 @@ var skillProps = {
29214
29265
  };
29215
29266
  var SkillsContainer = function SkillsContainer(_ref) {
29216
29267
  var onCloseButton = _ref.onCloseButton,
29217
- skill = _ref.skill;
29218
-
29268
+ skill = _ref.skill,
29269
+ atlasIMG = _ref.atlasIMG,
29270
+ atlasJSON = _ref.atlasJSON;
29219
29271
  var onRenderSkillCategory = function onRenderSkillCategory(category) {
29220
29272
  var skillCategory = skillProps[category];
29221
29273
  var skillCategoryColor = skillCategory.color;
29222
29274
  var output = [];
29223
-
29224
29275
  for (var _i = 0, _Object$entries = Object.entries(skillCategory.values); _i < _Object$entries.length; _i++) {
29225
29276
  var _Object$entries$_i = _Object$entries[_i],
29226
- key = _Object$entries$_i[0],
29227
- value = _Object$entries$_i[1];
29277
+ key = _Object$entries$_i[0],
29278
+ value = _Object$entries$_i[1];
29228
29279
  //@ts-ignore
29229
29280
  var skillDetails = skill[key];
29230
29281
  output.push(React.createElement(SkillProgressBar, {
@@ -29234,13 +29285,13 @@ var SkillsContainer = function SkillsContainer(_ref) {
29234
29285
  level: skillDetails.level || 0,
29235
29286
  skillPoints: Math.round(skillDetails.skillPoints) || 0,
29236
29287
  skillPointsToNextLevel: Math.round(skillDetails.skillPointsToNextLevel) || 0,
29237
- texturePath: value
29288
+ texturePath: value,
29289
+ atlasIMG: atlasIMG,
29290
+ atlasJSON: atlasJSON
29238
29291
  }));
29239
29292
  }
29240
-
29241
29293
  return output;
29242
29294
  };
29243
-
29244
29295
  return React.createElement(SkillsDraggableContainer, {
29245
29296
  title: "Skills"
29246
29297
  }, onCloseButton && React.createElement(CloseButton$2, {
@@ -29254,7 +29305,9 @@ var SkillsContainer = function SkillsContainer(_ref) {
29254
29305
  level: Math.round(skill.level) || 0,
29255
29306
  skillPoints: Math.round(skill.experience) || 0,
29256
29307
  skillPointsToNextLevel: Math.round(skill.xpToNextLevel) || 0,
29257
- texturePath: 'swords/broad-sword.png'
29308
+ texturePath: 'swords/broad-sword.png',
29309
+ atlasIMG: atlasIMG,
29310
+ atlasJSON: atlasJSON
29258
29311
  }), React.createElement("p", null, "Combat Skills"), React.createElement("hr", {
29259
29312
  className: "golden"
29260
29313
  })), onRenderSkillCategory('combat'), React.createElement(SkillSplitDiv, null, React.createElement("p", null, "Crafting Skills"), React.createElement("hr", {
@@ -29277,206 +29330,210 @@ var CloseButton$2 = /*#__PURE__*/styled.div.withConfig({
29277
29330
  })(["position:absolute;top:2px;right:2px;color:white;z-index:22;font-size:0.7rem;"]);
29278
29331
 
29279
29332
  var TextArea = function TextArea(_ref) {
29280
- var props = _extends({}, _ref);
29281
-
29333
+ var props = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
29282
29334
  return React.createElement("textarea", Object.assign({}, props));
29283
29335
  };
29284
29336
 
29285
- /* eslint-disable react/require-default-props */
29286
- var Truncate = function Truncate(_ref) {
29287
- var _ref$maxLines = _ref.maxLines,
29288
- maxLines = _ref$maxLines === void 0 ? 1 : _ref$maxLines,
29289
- children = _ref.children;
29290
- return React.createElement(Container$g, {
29291
- maxLines: maxLines
29292
- }, children);
29293
- };
29294
- var Container$g = /*#__PURE__*/styled.div.withConfig({
29295
- displayName: "Truncate__Container",
29296
- componentId: "sc-6x00qb-0"
29297
- })(["display:-webkit-box;max-width:100%;max-height:100%;-webkit-line-clamp:", ";-webkit-box-orient:vertical;overflow:hidden;"], function (props) {
29298
- return props.maxLines;
29299
- });
29300
-
29301
- var ImgSide;
29302
-
29303
- (function (ImgSide) {
29304
- ImgSide["right"] = "right";
29305
- ImgSide["left"] = "left";
29306
- })(ImgSide || (ImgSide = {}));
29307
-
29308
- var NPCMultiDialog = function NPCMultiDialog(_ref) {
29309
- var _textAndTypeArray$sli;
29310
-
29311
- var _onClose = _ref.onClose,
29312
- textAndTypeArray = _ref.textAndTypeArray;
29313
-
29314
- var _useState = useState(false),
29315
- showGoNextIndicator = _useState[0],
29316
- setShowGoNextIndicator = _useState[1];
29317
-
29318
- var _useState2 = useState(0),
29319
- slide = _useState2[0],
29320
- setSlide = _useState2[1];
29321
-
29322
- var onHandleSpacePress = function onHandleSpacePress(event) {
29323
- if (event.code === 'Space') {
29324
- if (slide < (textAndTypeArray == null ? void 0 : textAndTypeArray.length) - 1) {
29325
- setSlide(function (prev) {
29326
- return prev + 1;
29327
- });
29328
- } else {
29329
- // if there's no more text chunks, close the dialog
29330
- _onClose();
29331
- }
29337
+ var TradingItemRow = function TradingItemRow(_ref) {
29338
+ var atlasIMG = _ref.atlasIMG,
29339
+ atlasJSON = _ref.atlasJSON,
29340
+ updateChartTotals = _ref.updateChartTotals,
29341
+ traderItem = _ref.traderItem;
29342
+ var _useState = useState(0),
29343
+ itemQuantity = _useState[0],
29344
+ setItemQuantity = _useState[1];
29345
+ var onLeftClick = function onLeftClick() {
29346
+ if (itemQuantity > 0) {
29347
+ var newQuantity = itemQuantity - 1;
29348
+ setItemQuantity(newQuantity);
29349
+ updateChartTotals({
29350
+ key: traderItem.key,
29351
+ itemId: traderItem.itemId,
29352
+ qty: newQuantity,
29353
+ price: traderItem.price,
29354
+ texturePath: traderItem.texturePath,
29355
+ name: traderItem.name
29356
+ });
29332
29357
  }
29333
29358
  };
29334
-
29335
- useEffect(function () {
29336
- document.addEventListener('keydown', onHandleSpacePress);
29337
- return function () {
29338
- return document.removeEventListener('keydown', onHandleSpacePress);
29339
- };
29340
- }, [slide]);
29341
- return React.createElement(RPGUIContainer, {
29342
- type: RPGUIContainerTypes.FramedGold,
29343
- width: '50%',
29344
- height: '180px'
29345
- }, React.createElement(React.Fragment, null, React.createElement(Container$h, null, ((_textAndTypeArray$sli = textAndTypeArray[slide]) == null ? void 0 : _textAndTypeArray$sli.imageSide) === 'right' && React.createElement(React.Fragment, null, React.createElement(TextContainer$2, {
29346
- flex: '70%'
29347
- }, React.createElement(NPCDialogText, {
29348
- onStartStep: function onStartStep() {
29349
- return setShowGoNextIndicator(false);
29350
- },
29351
- onEndStep: function onEndStep() {
29352
- return setShowGoNextIndicator(true);
29353
- },
29354
- text: textAndTypeArray[slide].text || 'No text provided.',
29355
- onClose: function onClose() {
29356
- if (_onClose) {
29357
- _onClose();
29358
- }
29359
- }
29360
- })), React.createElement(ThumbnailContainer$1, null, React.createElement(NPCThumbnail$1, {
29361
- src: textAndTypeArray[slide].imagePath || img$6
29362
- })), showGoNextIndicator && React.createElement(PressSpaceIndicator$1, {
29363
- right: '10.5rem',
29364
- src: img$7
29365
- })), textAndTypeArray[slide].imageSide === 'left' && React.createElement(React.Fragment, null, React.createElement(ThumbnailContainer$1, null, React.createElement(NPCThumbnail$1, {
29366
- src: textAndTypeArray[slide].imagePath || img$6
29367
- })), React.createElement(TextContainer$2, {
29368
- flex: '70%'
29369
- }, React.createElement(NPCDialogText, {
29370
- onStartStep: function onStartStep() {
29371
- return setShowGoNextIndicator(false);
29372
- },
29373
- onEndStep: function onEndStep() {
29374
- return setShowGoNextIndicator(true);
29375
- },
29376
- text: textAndTypeArray[slide].text || 'No text provided.',
29377
- onClose: function onClose() {
29378
- if (_onClose) {
29379
- _onClose();
29380
- }
29359
+ var onRightClick = function onRightClick() {
29360
+ if (itemQuantity < 999) {
29361
+ var newQuantity = itemQuantity + 1;
29362
+ setItemQuantity(newQuantity);
29363
+ updateChartTotals({
29364
+ key: traderItem.key,
29365
+ itemId: traderItem.itemId,
29366
+ qty: newQuantity,
29367
+ price: traderItem.price,
29368
+ texturePath: traderItem.texturePath,
29369
+ name: traderItem.name
29370
+ });
29381
29371
  }
29382
- })), showGoNextIndicator && React.createElement(PressSpaceIndicator$1, {
29383
- right: '1rem',
29384
- src: img$7
29385
- }))), ")"));
29372
+ };
29373
+ return React.createElement(ItemWrapper, null, React.createElement(ItemIconContainer, null, React.createElement(SpriteContainer$1, null, React.createElement(SpriteFromAtlas, {
29374
+ atlasIMG: atlasIMG,
29375
+ atlasJSON: atlasJSON,
29376
+ spriteKey: traderItem.texturePath,
29377
+ imgScale: 2.5
29378
+ }))), React.createElement(ItemNameContainer, null, React.createElement(NameValue, null, React.createElement(Ellipsis, {
29379
+ maxLines: 1,
29380
+ maxWidth: 250
29381
+ }, capitalize(traderItem.name)), React.createElement("p", null, "$", traderItem.price))), React.createElement(QuantityContainer, null, React.createElement(SelectArrow, {
29382
+ size: 32,
29383
+ className: "arrow-selector",
29384
+ direction: "left",
29385
+ onClick: onLeftClick,
29386
+ onTouchStart: onLeftClick
29387
+ }), React.createElement(QuantityDisplay, null, React.createElement(TextOverlay$2, null, React.createElement(Item$1, null, itemQuantity))), React.createElement(SelectArrow, {
29388
+ size: 32,
29389
+ className: "arrow-selector",
29390
+ direction: "right",
29391
+ onClick: onRightClick,
29392
+ onTouchStart: onRightClick
29393
+ })));
29386
29394
  };
29387
- var Container$h = /*#__PURE__*/styled.div.withConfig({
29388
- displayName: "NPCMultiDialog__Container",
29389
- componentId: "sc-rvu5wg-0"
29390
- })(["display:flex;width:100%;height:100%;box-sizing:border-box;justify-content:center;align-items:flex-start;position:relative;"]);
29391
- var TextContainer$2 = /*#__PURE__*/styled.div.withConfig({
29392
- displayName: "NPCMultiDialog__TextContainer",
29393
- componentId: "sc-rvu5wg-1"
29394
- })(["flex:", " 0 0;width:355px;"], function (_ref2) {
29395
- var flex = _ref2.flex;
29396
- return flex;
29397
- });
29398
- var ThumbnailContainer$1 = /*#__PURE__*/styled.div.withConfig({
29399
- displayName: "NPCMultiDialog__ThumbnailContainer",
29400
- componentId: "sc-rvu5wg-2"
29401
- })(["flex:30% 0 0;display:flex;justify-content:flex-end;"]);
29402
- var NPCThumbnail$1 = /*#__PURE__*/styled.img.withConfig({
29403
- displayName: "NPCMultiDialog__NPCThumbnail",
29404
- componentId: "sc-rvu5wg-3"
29405
- })(["image-rendering:pixelated;height:128px;width:128px;"]);
29406
- var PressSpaceIndicator$1 = /*#__PURE__*/styled.img.withConfig({
29407
- displayName: "NPCMultiDialog__PressSpaceIndicator",
29408
- componentId: "sc-rvu5wg-4"
29409
- })(["position:absolute;right:", ";bottom:1rem;height:20.7px;image-rendering:-webkit-optimize-contrast;"], function (_ref3) {
29410
- var right = _ref3.right;
29411
- return right;
29412
- });
29413
-
29414
- var HistoryDialog = function HistoryDialog(_ref) {
29415
- var backgroundImgPath = _ref.backgroundImgPath,
29416
- fullCoverBackground = _ref.fullCoverBackground,
29417
- questions = _ref.questions,
29418
- answers = _ref.answers,
29419
- text = _ref.text,
29420
- imagePath = _ref.imagePath,
29421
- textAndTypeArray = _ref.textAndTypeArray,
29422
- onClose = _ref.onClose;
29395
+ var ItemWrapper = /*#__PURE__*/styled.div.withConfig({
29396
+ displayName: "TradingItemRow__ItemWrapper",
29397
+ componentId: "sc-mja0b5-0"
29398
+ })(["width:100%;margin:auto;display:flex;justify-content:space-between;margin-bottom:1rem;&:hover{background-color:", ";}padding:0.5rem;"], colors.darkGrey);
29399
+ var ItemNameContainer = /*#__PURE__*/styled.div.withConfig({
29400
+ displayName: "TradingItemRow__ItemNameContainer",
29401
+ componentId: "sc-mja0b5-1"
29402
+ })(["flex:60%;"]);
29403
+ var ItemIconContainer = /*#__PURE__*/styled.div.withConfig({
29404
+ displayName: "TradingItemRow__ItemIconContainer",
29405
+ componentId: "sc-mja0b5-2"
29406
+ })(["display:flex;justify-content:flex-start;align-items:center;flex:0 0 58px;"]);
29407
+ var SpriteContainer$1 = /*#__PURE__*/styled.div.withConfig({
29408
+ displayName: "TradingItemRow__SpriteContainer",
29409
+ componentId: "sc-mja0b5-3"
29410
+ })(["position:relative;top:-0.5rem;left:0.5rem;"]);
29411
+ var NameValue = /*#__PURE__*/styled.div.withConfig({
29412
+ displayName: "TradingItemRow__NameValue",
29413
+ componentId: "sc-mja0b5-4"
29414
+ })(["p{font-size:0.75rem;margin:0;}"]);
29415
+ var Item$1 = /*#__PURE__*/styled.span.withConfig({
29416
+ displayName: "TradingItemRow__Item",
29417
+ componentId: "sc-mja0b5-5"
29418
+ })(["font-size:1rem;color:white;text-align:center;z-index:1;width:100%;"]);
29419
+ var TextOverlay$2 = /*#__PURE__*/styled.div.withConfig({
29420
+ displayName: "TradingItemRow__TextOverlay",
29421
+ componentId: "sc-mja0b5-6"
29422
+ })(["width:100%;position:relative;"]);
29423
+ var QuantityContainer = /*#__PURE__*/styled.div.withConfig({
29424
+ displayName: "TradingItemRow__QuantityContainer",
29425
+ componentId: "sc-mja0b5-7"
29426
+ })(["position:relative;display:flex;min-width:100px;width:40%;justify-content:center;align-items:center;flex:20%;"]);
29427
+ var QuantityDisplay = /*#__PURE__*/styled.div.withConfig({
29428
+ displayName: "TradingItemRow__QuantityDisplay",
29429
+ componentId: "sc-mja0b5-8"
29430
+ })(["font-size:0.8rem;"]);
29423
29431
 
29432
+ var TradingMenu = function TradingMenu(_ref) {
29433
+ var traderItems = _ref.traderItems,
29434
+ onClose = _ref.onClose,
29435
+ type = _ref.type,
29436
+ atlasJSON = _ref.atlasJSON,
29437
+ atlasIMG = _ref.atlasIMG,
29438
+ characterAvailableGold = _ref.characterAvailableGold,
29439
+ onChangeTraderItems = _ref.onChangeTraderItems;
29424
29440
  var _useState = useState(0),
29425
- img = _useState[0],
29426
- setImage = _useState[1];
29427
-
29428
- var onHandleSpacePress = function onHandleSpacePress(event) {
29429
- if (event.code === 'Space') {
29430
- if (img < (backgroundImgPath == null ? void 0 : backgroundImgPath.length) - 1) {
29431
- setImage(function (prev) {
29432
- return prev + 1;
29433
- });
29434
- } else {
29435
- // if there's no more text chunks, close the dialog
29436
- onClose();
29437
- }
29441
+ sum = _useState[0],
29442
+ setSum = _useState[1];
29443
+ var newSumArray = 0;
29444
+ var updateChartTotals = function updateChartTotals(item) {
29445
+ var itemIndex = traderItems.findIndex(function (itemArray) {
29446
+ return itemArray.itemId === item.itemId;
29447
+ });
29448
+ traderItems[itemIndex] = item;
29449
+ traderItems.forEach(function (item) {
29450
+ if (item.qty) newSumArray += item.qty * item.price;
29451
+ setSum(newSumArray);
29452
+ });
29453
+ };
29454
+ useEffect(function () {
29455
+ if (onChangeTraderItems) {
29456
+ onChangeTraderItems(traderItems);
29438
29457
  }
29458
+ }, [traderItems]);
29459
+ var Capitalize = function Capitalize(word) {
29460
+ return word[0].toUpperCase() + word.substring(1);
29439
29461
  };
29462
+ return React.createElement(TradingMenuDraggableContainer, {
29463
+ type: RPGUIContainerTypes.Framed,
29464
+ onCloseButton: function onCloseButton() {
29465
+ if (onClose) onClose();
29466
+ },
29467
+ width: "500px",
29468
+ cancelDrag: ".equipment-container-body .arrow-selector"
29469
+ }, React.createElement(React.Fragment, null, React.createElement("div", {
29470
+ style: {
29471
+ width: '100%'
29472
+ }
29473
+ }, React.createElement(Title$3, null, Capitalize(type), " Menu"), React.createElement("hr", {
29474
+ className: "golden"
29475
+ })), React.createElement(TradingComponentScrollWrapper, null, traderItems.map(function (tradeItem) {
29476
+ return React.createElement(ItemWrapper$1, null, React.createElement(TradingItemRow, {
29477
+ atlasIMG: atlasIMG,
29478
+ atlasJSON: atlasJSON,
29479
+ updateChartTotals: updateChartTotals,
29480
+ traderItem: tradeItem
29481
+ }));
29482
+ })), React.createElement(GoldWrapper, null, React.createElement("p", null, "Available Gold:"), React.createElement("p", null, "$", characterAvailableGold)), React.createElement(TotalWrapper, null, React.createElement("p", null, "Total:"), React.createElement("p", null, "$", sum)), sum > characterAvailableGold ? React.createElement(AlertWrapper, null, React.createElement("p", null, " Sorry, not enough money.")) : React.createElement(GoldWrapper, null, React.createElement("p", null, "Final Gold:"), React.createElement("p", null, "$", characterAvailableGold - sum)), React.createElement(ButtonWrapper, null, React.createElement(Button, {
29483
+ buttonType: ButtonTypes.RPGUIButton,
29484
+ disabled: sum > characterAvailableGold
29485
+ }, "Confirm"), React.createElement(Button, {
29486
+ buttonType: ButtonTypes.RPGUIButton
29487
+ }, "Cancel"))));
29488
+ };
29489
+ var TradingMenuDraggableContainer = /*#__PURE__*/styled(DraggableContainer).withConfig({
29490
+ displayName: "TradingMenu__TradingMenuDraggableContainer",
29491
+ componentId: "sc-1wjsz1l-0"
29492
+ })([".container-close{top:10px;right:10px;}.quest-title{text-align:left;margin-left:44px;margin-top:20px;color:yellow;}.quest-desc{margin-top:12px;margin-left:44px;}.rpgui-progress{min-width:80%;margin:0 auto;}"]);
29493
+ var Title$3 = /*#__PURE__*/styled.h1.withConfig({
29494
+ displayName: "TradingMenu__Title",
29495
+ componentId: "sc-1wjsz1l-1"
29496
+ })(["z-index:22;font-size:0.6rem;color:yellow !important;"]);
29497
+ var TradingComponentScrollWrapper = /*#__PURE__*/styled.div.withConfig({
29498
+ displayName: "TradingMenu__TradingComponentScrollWrapper",
29499
+ componentId: "sc-1wjsz1l-2"
29500
+ })(["overflow-y:scroll;height:500px;width:100%;margin-top:1rem;"]);
29501
+ var ItemWrapper$1 = /*#__PURE__*/styled.div.withConfig({
29502
+ displayName: "TradingMenu__ItemWrapper",
29503
+ componentId: "sc-1wjsz1l-3"
29504
+ })(["margin:auto;display:flex;justify-content:space-between;"]);
29505
+ var TotalWrapper = /*#__PURE__*/styled.div.withConfig({
29506
+ displayName: "TradingMenu__TotalWrapper",
29507
+ componentId: "sc-1wjsz1l-4"
29508
+ })(["display:flex;margin:auto;justify-content:space-between;height:20px;margin-left:0.8rem;"]);
29509
+ var GoldWrapper = /*#__PURE__*/styled.div.withConfig({
29510
+ displayName: "TradingMenu__GoldWrapper",
29511
+ componentId: "sc-1wjsz1l-5"
29512
+ })(["margin-top:1rem;display:flex;justify-content:space-between;height:20px;p{color:yellow !important;}width:100%;margin-left:0.8rem;"]);
29513
+ var AlertWrapper = /*#__PURE__*/styled.div.withConfig({
29514
+ displayName: "TradingMenu__AlertWrapper",
29515
+ componentId: "sc-1wjsz1l-6"
29516
+ })(["display:flex;width:100%;justify-content:center;height:20px;p{color:red !important;}"]);
29517
+ var ButtonWrapper = /*#__PURE__*/styled.div.withConfig({
29518
+ displayName: "TradingMenu__ButtonWrapper",
29519
+ componentId: "sc-1wjsz1l-7"
29520
+ })(["display:flex;justify-content:space-around;padding-top:20px;width:100%;margin-top:1rem;"]);
29440
29521
 
29441
- useEffect(function () {
29442
- document.addEventListener('keydown', onHandleSpacePress);
29443
- return function () {
29444
- return document.removeEventListener('keydown', onHandleSpacePress);
29445
- };
29446
- }, [backgroundImgPath]);
29447
- return React.createElement(BackgroundContainer, {
29448
- imgPath: backgroundImgPath[img],
29449
- fullImg: fullCoverBackground
29450
- }, React.createElement(DialogContainer, null, textAndTypeArray ? React.createElement(NPCMultiDialog, {
29451
- textAndTypeArray: textAndTypeArray,
29452
- onClose: onClose
29453
- }) : questions && answers ? React.createElement(QuestionDialog, {
29454
- questions: questions,
29455
- answers: answers,
29456
- onClose: onClose
29457
- }) : text && imagePath ? React.createElement(NPCDialog, {
29458
- text: text,
29459
- imagePath: imagePath,
29460
- onClose: onClose,
29461
- type: NPCDialogType.TextAndThumbnail
29462
- }) : React.createElement(NPCDialog, {
29463
- text: text,
29464
- onClose: onClose,
29465
- type: NPCDialogType.TextOnly
29466
- })));
29522
+ /* eslint-disable react/require-default-props */
29523
+ var Truncate = function Truncate(_ref) {
29524
+ var _ref$maxLines = _ref.maxLines,
29525
+ maxLines = _ref$maxLines === void 0 ? 1 : _ref$maxLines,
29526
+ children = _ref.children;
29527
+ return React.createElement(Container$h, {
29528
+ maxLines: maxLines
29529
+ }, children);
29467
29530
  };
29468
- var BackgroundContainer = /*#__PURE__*/styled.div.withConfig({
29469
- displayName: "HistoryDialog__BackgroundContainer",
29470
- componentId: "sc-u6oe75-0"
29471
- })(["width:100%;height:100%;background-image:url(", ");background-size:", ";display:flex;justify-content:space-evenly;align-items:center;"], function (props) {
29472
- return props.imgPath;
29473
- }, function (props) {
29474
- return props.imgPath ? 'cover' : 'auto';
29531
+ var Container$h = /*#__PURE__*/styled.div.withConfig({
29532
+ displayName: "Truncate__Container",
29533
+ componentId: "sc-6x00qb-0"
29534
+ })(["display:-webkit-box;max-width:100%;max-height:100%;-webkit-line-clamp:", ";-webkit-box-orient:vertical;overflow:hidden;"], function (props) {
29535
+ return props.maxLines;
29475
29536
  });
29476
- var DialogContainer = /*#__PURE__*/styled.div.withConfig({
29477
- displayName: "HistoryDialog__DialogContainer",
29478
- componentId: "sc-u6oe75-1"
29479
- })(["display:flex;justify-content:center;padding-top:200px;"]);
29480
29537
 
29481
- export { Button, ButtonTypes, CharacterSelection, Chat, CheckButton, DraggableContainer, Dropdown, DynamicText, EquipmentSet, HistoryDialog, ImgSide, Input, InputRadio, ItemContainer, ItemSlot, ListMenu, NPCDialog, NPCDialogType, NPCMultiDialog, ProgressBar, PropertySelect, QuestInfo, QuestList, QuestionDialog, RPGUIContainer, RPGUIContainerTypes, RPGUIRoot, RangeSlider, RangeSliderType, SkillProgressBar, SkillsContainer, SpriteFromAtlas, TextArea, Truncate, _RPGUI, useEventListener };
29538
+ export { Button, ButtonTypes, CharacterSelection, Chat, CheckButton, DraggableContainer, Dropdown, DynamicText, EquipmentSet, HistoryDialog, ImgSide, Input, InputRadio, ItemContainer, ItemSlot, ListMenu, NPCDialog, NPCDialogType, NPCMultiDialog, ProgressBar, PropertySelect, QuestInfo, QuestList, QuestionDialog, RPGUIContainer, RPGUIContainerTypes, RPGUIRoot, RangeSlider, RangeSliderType, SkillProgressBar, SkillsContainer, SpriteFromAtlas, TextArea, TradingMenu, Truncate, _RPGUI, useEventListener };
29482
29539
  //# sourceMappingURL=long-bow.esm.js.map