@athoscommerce/snap-store-mobx 1.2.3-beta.3 → 1.2.3-beta.5

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 (91) hide show
  1. package/dist/cjs/Autocomplete/AutocompleteStore.d.ts +1 -1
  2. package/dist/cjs/Autocomplete/AutocompleteStore.d.ts.map +1 -1
  3. package/dist/cjs/Autocomplete/AutocompleteStore.js +8 -5
  4. package/dist/cjs/Autocomplete/Stores/AutocompleteFacetStore.js +2 -1
  5. package/dist/cjs/Chat/ChatStore.d.ts +36 -5
  6. package/dist/cjs/Chat/ChatStore.d.ts.map +1 -1
  7. package/dist/cjs/Chat/ChatStore.js +214 -54
  8. package/dist/cjs/Chat/Stores/ChatAttachmentStore.d.ts.map +1 -1
  9. package/dist/cjs/Chat/Stores/ChatAttachmentStore.js +4 -2
  10. package/dist/cjs/Chat/Stores/ChatCompareStore.d.ts +2 -0
  11. package/dist/cjs/Chat/Stores/ChatCompareStore.d.ts.map +1 -1
  12. package/dist/cjs/Chat/Stores/ChatCompareStore.js +4 -2
  13. package/dist/cjs/Chat/Stores/ChatSessionStore.d.ts +10 -7
  14. package/dist/cjs/Chat/Stores/ChatSessionStore.d.ts.map +1 -1
  15. package/dist/cjs/Chat/Stores/ChatSessionStore.js +34 -23
  16. package/dist/cjs/Finder/FinderStore.d.ts +1 -1
  17. package/dist/cjs/Finder/FinderStore.d.ts.map +1 -1
  18. package/dist/cjs/Finder/FinderStore.js +3 -3
  19. package/dist/cjs/Finder/Stores/FinderSelectionStore.d.ts +1 -1
  20. package/dist/cjs/Finder/Stores/FinderSelectionStore.d.ts.map +1 -1
  21. package/dist/cjs/ProductQuickView/ProductQuickViewStore.d.ts +21 -0
  22. package/dist/cjs/ProductQuickView/ProductQuickViewStore.d.ts.map +1 -0
  23. package/dist/cjs/ProductQuickView/ProductQuickViewStore.js +69 -0
  24. package/dist/cjs/ProductQuickView/cloneProductForQuickView.d.ts +7 -0
  25. package/dist/cjs/ProductQuickView/cloneProductForQuickView.d.ts.map +1 -0
  26. package/dist/cjs/ProductQuickView/cloneProductForQuickView.js +23 -0
  27. package/dist/cjs/Recommendation/RecommendationStore.d.ts +2 -0
  28. package/dist/cjs/Recommendation/RecommendationStore.d.ts.map +1 -1
  29. package/dist/cjs/Recommendation/RecommendationStore.js +3 -0
  30. package/dist/cjs/Recommendation/Stores/RecommendationProfileStore.js +1 -1
  31. package/dist/cjs/Search/SearchStore.d.ts +1 -1
  32. package/dist/cjs/Search/SearchStore.d.ts.map +1 -1
  33. package/dist/cjs/Search/SearchStore.js +2 -2
  34. package/dist/cjs/Search/Stores/SearchFacetStore.d.ts +1 -1
  35. package/dist/cjs/Search/Stores/SearchFacetStore.d.ts.map +1 -1
  36. package/dist/cjs/Search/Stores/SearchFacetStore.js +13 -10
  37. package/dist/cjs/Search/Stores/SearchHistoryStore.js +2 -2
  38. package/dist/cjs/index.d.ts +4 -2
  39. package/dist/cjs/index.d.ts.map +1 -1
  40. package/dist/cjs/index.js +8 -4
  41. package/dist/cjs/types.d.ts +8 -2
  42. package/dist/cjs/types.d.ts.map +1 -1
  43. package/dist/esm/Autocomplete/AutocompleteStore.d.ts +1 -1
  44. package/dist/esm/Autocomplete/AutocompleteStore.d.ts.map +1 -1
  45. package/dist/esm/Autocomplete/AutocompleteStore.js +5 -3
  46. package/dist/esm/Autocomplete/Stores/AutocompleteFacetStore.js +1 -1
  47. package/dist/esm/Chat/ChatStore.d.ts +36 -5
  48. package/dist/esm/Chat/ChatStore.d.ts.map +1 -1
  49. package/dist/esm/Chat/ChatStore.js +201 -43
  50. package/dist/esm/Chat/Stores/ChatAttachmentStore.d.ts.map +1 -1
  51. package/dist/esm/Chat/Stores/ChatAttachmentStore.js +4 -2
  52. package/dist/esm/Chat/Stores/ChatCompareStore.d.ts +2 -0
  53. package/dist/esm/Chat/Stores/ChatCompareStore.d.ts.map +1 -1
  54. package/dist/esm/Chat/Stores/ChatCompareStore.js +3 -1
  55. package/dist/esm/Chat/Stores/ChatSessionStore.d.ts +10 -7
  56. package/dist/esm/Chat/Stores/ChatSessionStore.d.ts.map +1 -1
  57. package/dist/esm/Chat/Stores/ChatSessionStore.js +26 -18
  58. package/dist/esm/Finder/FinderStore.d.ts +1 -1
  59. package/dist/esm/Finder/FinderStore.d.ts.map +1 -1
  60. package/dist/esm/Finder/FinderStore.js +1 -1
  61. package/dist/esm/Finder/Stores/FinderSelectionStore.d.ts +1 -1
  62. package/dist/esm/Finder/Stores/FinderSelectionStore.d.ts.map +1 -1
  63. package/dist/esm/ProductQuickView/ProductQuickViewStore.d.ts +21 -0
  64. package/dist/esm/ProductQuickView/ProductQuickViewStore.d.ts.map +1 -0
  65. package/dist/esm/ProductQuickView/ProductQuickViewStore.js +56 -0
  66. package/dist/esm/ProductQuickView/cloneProductForQuickView.d.ts +7 -0
  67. package/dist/esm/ProductQuickView/cloneProductForQuickView.d.ts.map +1 -0
  68. package/dist/esm/ProductQuickView/cloneProductForQuickView.js +19 -0
  69. package/dist/esm/Recommendation/RecommendationStore.d.ts +2 -0
  70. package/dist/esm/Recommendation/RecommendationStore.d.ts.map +1 -1
  71. package/dist/esm/Recommendation/RecommendationStore.js +3 -0
  72. package/dist/esm/Recommendation/Stores/RecommendationProfileStore.js +1 -1
  73. package/dist/esm/Search/SearchStore.d.ts +1 -1
  74. package/dist/esm/Search/SearchStore.d.ts.map +1 -1
  75. package/dist/esm/Search/SearchStore.js +1 -1
  76. package/dist/esm/Search/Stores/SearchFacetStore.d.ts +1 -1
  77. package/dist/esm/Search/Stores/SearchFacetStore.d.ts.map +1 -1
  78. package/dist/esm/Search/Stores/SearchFacetStore.js +13 -10
  79. package/dist/esm/Search/Stores/SearchHistoryStore.js +1 -1
  80. package/dist/esm/index.d.ts +4 -2
  81. package/dist/esm/index.d.ts.map +1 -1
  82. package/dist/esm/index.js +3 -1
  83. package/dist/esm/types.d.ts +8 -2
  84. package/dist/esm/types.d.ts.map +1 -1
  85. package/package.json +11 -6
  86. package/dist/cjs/Storage/StorageStore.d.ts +0 -27
  87. package/dist/cjs/Storage/StorageStore.d.ts.map +0 -1
  88. package/dist/cjs/Storage/StorageStore.js +0 -176
  89. package/dist/esm/Storage/StorageStore.d.ts +0 -27
  90. package/dist/esm/Storage/StorageStore.d.ts.map +0 -1
  91. package/dist/esm/Storage/StorageStore.js +0 -169
@@ -12,7 +12,7 @@ var __assign = (this && this.__assign) || function () {
12
12
  };
13
13
  Object.defineProperty(exports, "__esModule", { value: true });
14
14
  exports.SearchHistoryStore = void 0;
15
- var StorageStore_1 = require("../../Storage/StorageStore");
15
+ var snap_toolbox_1 = require("@athoscommerce/snap-toolbox");
16
16
  var SearchQueryStore_1 = require("./SearchQueryStore");
17
17
  var SearchHistoryStore = /** @class */ (function () {
18
18
  function SearchHistoryStore(params) {
@@ -28,7 +28,7 @@ var SearchHistoryStore = /** @class */ (function () {
28
28
  return __assign(__assign({}, translatorConfig), { urlRoot: (_b = (_a = _this.config.settings) === null || _a === void 0 ? void 0 : _a.history) === null || _b === void 0 ? void 0 : _b.url });
29
29
  });
30
30
  }
31
- this.storage = new StorageStore_1.StorageStore({
31
+ this.storage = new snap_toolbox_1.StorageStore({
32
32
  type: 'local',
33
33
  key: "athos-history".concat(((_f = this.config.globals) === null || _f === void 0 ? void 0 : _f.siteId) ? "-".concat((_g = this.config.globals) === null || _g === void 0 ? void 0 : _g.siteId) : ""),
34
34
  });
@@ -4,13 +4,15 @@ export { FinderStore } from './Finder/FinderStore';
4
4
  export { SearchStore } from './Search/SearchStore';
5
5
  export { ChatStore } from './Chat/ChatStore';
6
6
  export type { ChatAttachmentImage, ChatAttachmentProduct, ChatAttachmentFacet } from './Chat/Stores/ChatAttachmentStore';
7
- export type { ChatActions, ActionsData, FacetsData, ChatMessage, ChatSessionFeedback } from './Chat/Stores/ChatSessionStore';
7
+ export type { ChatActions, ActionsData, ChatMessage, ChatSessionFeedback } from './Chat/Stores/ChatSessionStore';
8
8
  export * from './Search/Stores/';
9
9
  export * from './Autocomplete/Stores/';
10
10
  export { RecommendationStore } from './Recommendation/RecommendationStore';
11
11
  export { CartStore } from './Cart/CartStore';
12
- export { StorageStore, StorageConfig, StorageType } from './Storage/StorageStore';
12
+ export { StorageStore, StorageConfig, StorageType } from '@athoscommerce/snap-toolbox';
13
13
  export { MetaStore } from './Meta/MetaStore';
14
+ export { ProductQuickViewStore } from './ProductQuickView/ProductQuickViewStore';
15
+ export { cloneProductForQuickView } from './ProductQuickView/cloneProductForQuickView';
14
16
  export * from './types';
15
17
  export { ChatSessionStore } from './Chat/Stores/ChatSessionStore';
16
18
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,YAAY,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACzH,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAE7H,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAClF,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,YAAY,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACzH,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAEjH,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AACvF,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,EAAE,wBAAwB,EAAE,MAAM,6CAA6C,CAAC;AACvF,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC"}
package/dist/cjs/index.js CHANGED
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.ChatSessionStore = exports.MetaStore = exports.StorageType = exports.StorageStore = exports.CartStore = exports.RecommendationStore = exports.ChatStore = exports.SearchStore = exports.FinderStore = exports.AutocompleteStore = exports.AbstractStore = void 0;
17
+ exports.ChatSessionStore = exports.cloneProductForQuickView = exports.ProductQuickViewStore = exports.MetaStore = exports.StorageType = exports.StorageStore = exports.CartStore = exports.RecommendationStore = exports.ChatStore = exports.SearchStore = exports.FinderStore = exports.AutocompleteStore = exports.AbstractStore = void 0;
18
18
  var AbstractStore_1 = require("./Abstract/AbstractStore");
19
19
  Object.defineProperty(exports, "AbstractStore", { enumerable: true, get: function () { return AbstractStore_1.AbstractStore; } });
20
20
  var AutocompleteStore_1 = require("./Autocomplete/AutocompleteStore");
@@ -31,11 +31,15 @@ var RecommendationStore_1 = require("./Recommendation/RecommendationStore");
31
31
  Object.defineProperty(exports, "RecommendationStore", { enumerable: true, get: function () { return RecommendationStore_1.RecommendationStore; } });
32
32
  var CartStore_1 = require("./Cart/CartStore");
33
33
  Object.defineProperty(exports, "CartStore", { enumerable: true, get: function () { return CartStore_1.CartStore; } });
34
- var StorageStore_1 = require("./Storage/StorageStore");
35
- Object.defineProperty(exports, "StorageStore", { enumerable: true, get: function () { return StorageStore_1.StorageStore; } });
36
- Object.defineProperty(exports, "StorageType", { enumerable: true, get: function () { return StorageStore_1.StorageType; } });
34
+ var snap_toolbox_1 = require("@athoscommerce/snap-toolbox");
35
+ Object.defineProperty(exports, "StorageStore", { enumerable: true, get: function () { return snap_toolbox_1.StorageStore; } });
36
+ Object.defineProperty(exports, "StorageType", { enumerable: true, get: function () { return snap_toolbox_1.StorageType; } });
37
37
  var MetaStore_1 = require("./Meta/MetaStore");
38
38
  Object.defineProperty(exports, "MetaStore", { enumerable: true, get: function () { return MetaStore_1.MetaStore; } });
39
+ var ProductQuickViewStore_1 = require("./ProductQuickView/ProductQuickViewStore");
40
+ Object.defineProperty(exports, "ProductQuickViewStore", { enumerable: true, get: function () { return ProductQuickViewStore_1.ProductQuickViewStore; } });
41
+ var cloneProductForQuickView_1 = require("./ProductQuickView/cloneProductForQuickView");
42
+ Object.defineProperty(exports, "cloneProductForQuickView", { enumerable: true, get: function () { return cloneProductForQuickView_1.cloneProductForQuickView; } });
39
43
  __exportStar(require("./types"), exports);
40
44
  var ChatSessionStore_1 = require("./Chat/Stores/ChatSessionStore");
41
45
  Object.defineProperty(exports, "ChatSessionStore", { enumerable: true, get: function () { return ChatSessionStore_1.ChatSessionStore; } });
@@ -74,10 +74,15 @@ export type ChatStoreConfig = StoreConfig & {
74
74
  settings?: ChatStoreConfigSettings;
75
75
  siteId?: string;
76
76
  };
77
- export type ChatStoreConfigSettings = {
77
+ export type QuickviewConfig = {
78
+ enabled: boolean;
78
79
  displayFields?: string[];
79
- addToCart?: (products: any) => void;
80
+ };
81
+ export type ChatStoreConfigSettings = {
82
+ quickview?: QuickviewConfig;
80
83
  feedbackAfterMessages?: number;
84
+ /** Background filters forwarded to the chat init API as `searchConfig.bgFilters`. */
85
+ bgFilters?: Record<string, string>;
81
86
  [key: string]: unknown;
82
87
  };
83
88
  export type SearchStoreConfig = StoreConfig & {
@@ -162,6 +167,7 @@ export type RecommendationStoreConfig = StoreConfig & {
162
167
  settings?: {
163
168
  variants?: VariantConfig;
164
169
  searchOnPageShow?: boolean;
170
+ quickview?: QuickviewConfig;
165
171
  };
166
172
  };
167
173
  export type StoreConfigs = SearchStoreConfig | AutocompleteStoreConfig | FinderStoreConfig | RecommendationStoreConfig | ChatStoreConfig;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,KAAK,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAC1F,OAAO,KAAK,EACX,wCAAwC,EACxC,wBAAwB,EACxB,kBAAkB,EAClB,yBAAyB,EACzB,+BAA+B,EAC/B,MAA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;IACb,KAAK,UAAU;CACf;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,wCAAwC,EAAE,CAAC;IACjD,KAAK,EAAE,GAAG,CAAC;CACX,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,yBAAyB,GAAG,+BAA+B,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { UrlManager } from '@athoscommerce/snap-url-manager';
2
+ import { StorageStore } from '@athoscommerce/snap-toolbox';
2
3
  import { AbstractStore } from '../Abstract/AbstractStore';
3
4
  import { SearchFilterStore, SearchResultStore, SearchMerchandisingStore, SearchPaginationStore, SearchSortingStore } from '../Search/Stores';
4
- import { StorageStore } from '../Storage/StorageStore';
5
5
  import { AutocompleteStateStore, AutocompleteTermStore, AutocompleteQueryStore, AutocompleteFacetStore, AutocompleteTrendingStore, AutocompleteHistoryStore } from './Stores';
6
6
  import type { AutocompleteResponseModel, MetaResponseModel } from '@athoscommerce/snapi-types';
7
7
  import type { TrendingResponseModel } from '@athoscommerce/snap-client';
@@ -1 +1 @@
1
- {"version":3,"file":"AutocompleteStore.d.ts","sourceRoot":"","sources":["../../../src/Autocomplete/AutocompleteStore.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EACN,iBAAiB,EACjB,iBAAiB,EACjB,wBAAwB,EACxB,qBAAqB,EACrB,kBAAkB,EAElB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EACN,sBAAsB,EACtB,qBAAqB,EACrB,sBAAsB,EACtB,sBAAsB,EACtB,yBAAyB,EACzB,wBAAwB,EACxB,MAAM,UAAU,CAAC;AAElB,OAAO,KAAK,EAAE,yBAAyB,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC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gBAE7B,MAAM,EAAE,uBAAuB,EAAE,QAAQ,EAAE,aAAa;IAoCpE,IAAI,QAAQ,YAEX;IAEM,KAAK,IAAI,IAAI;IAMb,WAAW,IAAI,IAAI;IA8BnB,UAAU,IAAI,IAAI;IAMlB,gBAAgB,IAAI,IAAI;IAIxB,aAAa,IAAI,IAAI;IAIrB,YAAY,IAAI,IAAI;IAIpB,UAAU,CAAC,IAAI,EAAE,MAAM,aAAa,EAAE,OAAO,EAAE,UAAU,GAAG,IAAI;IAYhE,mBAAmB,CAAC,QAAQ,EAAE,qBAAqB,GAAG,IAAI;IAiB1D,MAAM,CAAC,IAAI,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,iBAAiB,CAAC;QAAC,MAAM,CAAC,EAAE,yBAAyB,CAAA;KAAE,GAAG,IAAI;CA8G5F"}
@@ -1,7 +1,7 @@
1
1
  import { makeObservable, observable } from 'mobx';
2
+ import { StorageStore } from '@athoscommerce/snap-toolbox';
2
3
  import { AbstractStore } from '../Abstract/AbstractStore';
3
4
  import { SearchFilterStore, SearchResultStore, SearchMerchandisingStore, SearchPaginationStore, SearchSortingStore, SearchHistoryStore, } from '../Search/Stores';
4
- import { StorageStore } from '../Storage/StorageStore';
5
5
  import { AutocompleteStateStore, AutocompleteTermStore, AutocompleteQueryStore, AutocompleteFacetStore, AutocompleteTrendingStore, AutocompleteHistoryStore, } from './Stores';
6
6
  import { MetaStore } from '../Meta/MetaStore';
7
7
  export class AutocompleteStore extends AbstractStore {
@@ -43,7 +43,7 @@ export class AutocompleteStore extends AbstractStore {
43
43
  }
44
44
  initHistory() {
45
45
  const limit = this.config.settings?.history?.limit;
46
- if (limit) {
46
+ if (limit && this.config.settings?.history?.enabled !== false) {
47
47
  const historyStore = new SearchHistoryStore({
48
48
  services: this.services,
49
49
  config: {
@@ -89,7 +89,9 @@ export class AutocompleteStore extends AbstractStore {
89
89
  this.services[name] = service;
90
90
  if (name === 'urlManager') {
91
91
  this.state.url = service;
92
- this.initHistory();
92
+ this.history?.forEach((term) => {
93
+ term.url = service.set({ query: term.value });
94
+ });
93
95
  }
94
96
  }
95
97
  }
@@ -26,7 +26,7 @@ export class AutocompleteFacetStore extends Array {
26
26
  facet.filtered = true;
27
27
  value.filtered = true;
28
28
  state?.autocomplete.locks.facets.lock();
29
- value.url.go();
29
+ value.url?.go();
30
30
  };
31
31
  });
32
32
  });
@@ -1,17 +1,25 @@
1
- import { ChatStoreConfig } from '../types';
1
+ import { ChatStoreConfig, StoreServices } from '../types';
2
2
  import { MetaStore } from '../Meta/MetaStore';
3
- import type { MetaResponseModel } from '@athoscommerce/snapi-types';
3
+ import type { MetaResponseModel, SearchResponseModelFacet } from '@athoscommerce/snapi-types';
4
4
  import { AbstractStore } from '../Abstract/AbstractStore';
5
5
  import type { ChatResponseModel, ChatRequestModel, ProductsResponseModel } from '@athoscommerce/snap-client';
6
- import { StorageStore } from '../Storage/StorageStore';
6
+ import type { UrlManager } from '@athoscommerce/snap-url-manager';
7
+ import { StorageStore } from '@athoscommerce/snap-toolbox';
7
8
  import { ChatSessionStore } from './Stores/ChatSessionStore';
8
9
  import { ChatStatusResponse } from '@athoscommerce/snap-client';
9
10
  import { Product } from '../Search/Stores/SearchResultStore';
11
+ import { SearchFacetStore } from '../Search/Stores/SearchFacetStore';
10
12
  export declare class ChatStore extends AbstractStore<ChatStoreConfig> {
11
13
  meta?: MetaStore;
12
14
  inputValue: string;
13
15
  open: boolean;
14
16
  storage: StorageStore;
17
+ services: StoreServices;
18
+ /** Detached UrlManager — holds the in-progress facet selection for the active facets display.
19
+ * Detached so .go() updates state without navigating the page. */
20
+ urlManager: UrlManager;
21
+ /** The single facet store rendered in chat — backed by the active message's facets. */
22
+ facets: SearchFacetStore;
15
23
  chats: ChatSessionStore[];
16
24
  currentChatId: string;
17
25
  chatEnabled: boolean | null;
@@ -23,10 +31,29 @@ export declare class ChatStore extends AbstractStore<ChatStoreConfig> {
23
31
  productQuickviewError: string | null;
24
32
  /** Raw meta kept for lazy hydration of inactive chat sessions. */
25
33
  private storedMetaData;
26
- constructor(config: ChatStoreConfig);
34
+ /** Tracks which message currently owns the displayed facets — guards against redundant rebuilds. */
35
+ private activeFacetsMessageId;
36
+ /** Bumps on every detached-urlManager change so observers re-evaluate isFacetSelected. */
37
+ urlVersion: number;
38
+ /** Snapshot of the applied filter state captured the last time the active message was seeded.
39
+ * Compared against the live urlManager state to decide whether there are pending changes. */
40
+ private appliedFilterSnapshot;
41
+ constructor(config: ChatStoreConfig, services: StoreServices);
42
+ /** Build a SearchFacetStore from raw facet data using the current detached urlManager.
43
+ * Synthesizes meta entries for each facet so SearchFacetStore's display/meta filter
44
+ * doesn't drop chat facets (the chat backend already decided what to send). */
45
+ private buildFacetStore;
46
+ /** Reset the detached urlManager and seed it with this message's filtered facet values,
47
+ * then rebuild the root SearchFacetStore so the UI shows the matching display. */
48
+ setActiveFacets(facets: SearchResponseModelFacet[], messageId: string | null): void;
49
+ /** True when the in-progress facet selection differs from the filters that were applied
50
+ * by the active productSearchResult — i.e. the user has selected/removed something that
51
+ * hasn't been sent yet. Used to decide whether to show the Apply button. */
52
+ get hasPendingFacetChanges(): boolean;
27
53
  get currentChat(): ChatSessionStore | undefined;
28
54
  get chatsIds(): string[];
29
55
  get blocked(): boolean;
56
+ private applyChatStatusResponse;
30
57
  handleChatStatusResponse(response: ChatStatusResponse): boolean;
31
58
  reset(): void;
32
59
  setProductQuickview(product: Product): void;
@@ -36,13 +63,17 @@ export declare class ChatStore extends AbstractStore<ChatStoreConfig> {
36
63
  clearHistory(): void;
37
64
  createChat(data?: {
38
65
  sessionId: string;
66
+ sessionEndTime?: Date;
39
67
  }): ChatSessionStore;
40
68
  switchChat(id: string): void;
41
69
  sendProductQuery(result: any, options: {
42
70
  requestType: 'productQuery' | 'productSimilar' | 'productComparison';
43
71
  }): void;
44
72
  compareProduct(result: any): void;
45
- addFacet(facet: any): void;
73
+ addFacet(facet: {
74
+ key: string;
75
+ value: string;
76
+ }): void;
46
77
  removeFacet(key: string, value: string): void;
47
78
  clearPendingFacets(): void;
48
79
  isFacetSelected(key: string, value: string): boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"ChatStore.d.ts","sourceRoot":"","sources":["../../../src/Chat/ChatStore.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAC7G,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,OAAO,EAAY,MAAM,oCAAoC,CAAC;AAIvE,qBAAa,SAAU,SAAQ,aAAa,CAAC,eAAe,CAAC;IACrD,IAAI,CAAC,EAAE,SAAS,CAAa;IAC7B,UAAU,EAAE,MAAM,CAAM;IACxB,IAAI,EAAE,OAAO,CAAS;IACtB,OAAO,EAAE,YAAY,CAAC;IACtB,KAAK,EAAE,gBAAgB,EAAE,CAAM;IAC/B,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,OAAO,GAAG,IAAI,CAAQ;IACnC,eAAe,EAAE,OAAO,CAAS;IACjC,kBAAkB,EAAE,MAAM,EAAE,CAAM;IAClC,cAAc,EAAE,MAAM,CAAM;IAC5B,QAAQ,EAAE,kBAAkB,CAAC,UAAU,CAAC,CAA4E;IACpH,gBAAgB,EAAE,OAAO,GAAG,IAAI,CAAQ;IACxC,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAQ;IACnD,kEAAkE;IAClE,OA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M,EAAE,GAAG,EAAE,OAAO,EAAE;QAAE,WAAW,EAAE,cAAc,GAAG,gBAAgB,GAAG,mBAAmB,CAAA;KAAE,GAAG,IAAI;IAkBtH,cAAc,CAAC,MAAM,EAAE,GAAG,GAAG,IAAI;IAMjC,QAAQ,CAAC,KAAK,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;IAKrD,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAK7C,kBAAkB,IAAI,IAAI;IAI1B,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO;IAWpD,OAAO,CAAC,OAAO,EAAE,gBAAgB,GAAG,IAAI;IA6BxC,MAAM,CAAC,IAAI,EAAE;QAAE,IAAI,EAAE,iBAAiB,CAAC;QAAC,IAAI,EAAE,iBAAiB,CAAA;KAAE,GAAG,IAAI;CAkB/E"}
@@ -1,12 +1,13 @@
1
- import { makeObservable, observable, computed } from 'mobx';
1
+ import { makeObservable, observable, computed, reaction } from 'mobx';
2
2
  import { MetaStore } from '../Meta/MetaStore';
3
3
  import { AbstractStore } from '../Abstract/AbstractStore';
4
- import { StorageStore } from '../Storage/StorageStore';
4
+ import { StorageStore } from '@athoscommerce/snap-toolbox';
5
5
  import { ChatSessionStore } from './Stores/ChatSessionStore';
6
- import { Variants } from '../Search/Stores/SearchResultStore';
6
+ import { Product, Variants } from '../Search/Stores/SearchResultStore';
7
+ import { SearchFacetStore } from '../Search/Stores/SearchFacetStore';
7
8
  const CHAT_STATUS_EXPIRATION_TIME = 1000 * 60 * 60 * 12; // 12 hours
8
9
  export class ChatStore extends AbstractStore {
9
- constructor(config) {
10
+ constructor(config, services) {
10
11
  super(config);
11
12
  this.meta = undefined;
12
13
  this.inputValue = '';
@@ -21,12 +22,25 @@ export class ChatStore extends AbstractStore {
21
22
  this.productQuickviewError = null;
22
23
  /** Raw meta kept for lazy hydration of inactive chat sessions. */
23
24
  this.storedMetaData = null;
25
+ /** Tracks which message currently owns the displayed facets — guards against redundant rebuilds. */
26
+ this.activeFacetsMessageId = null;
27
+ /** Bumps on every detached-urlManager change so observers re-evaluate isFacetSelected. */
28
+ this.urlVersion = 0;
29
+ /** Snapshot of the applied filter state captured the last time the active message was seeded.
30
+ * Compared against the live urlManager state to decide whether there are pending changes. */
31
+ this.appliedFilterSnapshot = '{}';
32
+ this.services = services;
33
+ this.urlManager = services.urlManager.detach(true);
34
+ this.urlManager.subscribe(() => {
35
+ this.urlVersion++;
36
+ });
24
37
  const legacyKey = `ss-${this.config.id}`;
25
38
  const storageKey = this.config.siteId ? `ss-${this.config.siteId}-${this.config.id}` : legacyKey;
26
39
  this.storage = new StorageStore({
27
40
  type: 'local',
28
41
  key: storageKey,
29
42
  });
43
+ this.facets = this.buildFacetStore();
30
44
  const storedChatStatusResponse = this.storage.get('chatStatusResponse');
31
45
  if (storedChatStatusResponse) {
32
46
  try {
@@ -36,7 +50,10 @@ export class ChatStore extends AbstractStore {
36
50
  this.storage.set('chatStatusResponse', null);
37
51
  }
38
52
  else {
39
- this.handleChatStatusResponse(storedChatStatus.response);
53
+ // Apply the stored response without persisting, so the 12-hour
54
+ // checkTime keeps counting from the last real API call rather
55
+ // than resetting on every page load.
56
+ this.applyChatStatusResponse(storedChatStatus.response);
40
57
  }
41
58
  }
42
59
  catch {
@@ -110,7 +127,95 @@ export class ChatStore extends AbstractStore {
110
127
  welcomeMessage: observable,
111
128
  productQuickview: observable,
112
129
  productQuickviewError: observable,
130
+ facets: observable,
131
+ urlVersion: observable,
132
+ hasPendingFacetChanges: computed,
113
133
  });
134
+ // Sync the root facets display with the active message. Only productSearchResult
135
+ // messages carry facets — for any other active message, clear the display so a
136
+ // stale facet bar from a previous response doesn't linger.
137
+ reaction(() => {
138
+ const active = this.currentChat?.activeMessage;
139
+ return active && active.messageType === 'productSearchResult' ? active : null;
140
+ }, (active) => {
141
+ if (active && active.id !== this.activeFacetsMessageId) {
142
+ const facets = active.facets;
143
+ this.setActiveFacets(facets || [], active.id);
144
+ }
145
+ else if (!active && this.activeFacetsMessageId !== null) {
146
+ this.setActiveFacets([], null);
147
+ }
148
+ }, { fireImmediately: true });
149
+ }
150
+ /** Build a SearchFacetStore from raw facet data using the current detached urlManager.
151
+ * Synthesizes meta entries for each facet so SearchFacetStore's display/meta filter
152
+ * doesn't drop chat facets (the chat backend already decided what to send). */
153
+ buildFacetStore(facets = []) {
154
+ const baseMeta = this.meta?.data || {};
155
+ const baseFacetMeta = baseMeta.facets || {};
156
+ const facetMeta = { ...baseFacetMeta };
157
+ facets.forEach((facet) => {
158
+ if (!facet.field)
159
+ return;
160
+ const expectedDisplay = facet.type === 'range' ? 'slider' : 'list';
161
+ const existing = facetMeta[facet.field];
162
+ if (!existing || existing.display !== expectedDisplay) {
163
+ facetMeta[facet.field] = {
164
+ ...(existing || {}),
165
+ field: facet.field,
166
+ label: facet.label,
167
+ display: expectedDisplay,
168
+ };
169
+ }
170
+ });
171
+ return new SearchFacetStore({
172
+ config: {},
173
+ services: { ...this.services, urlManager: this.urlManager },
174
+ stores: { storage: this.storage },
175
+ data: {
176
+ search: { facets },
177
+ meta: { ...baseMeta, facets: facetMeta },
178
+ },
179
+ });
180
+ }
181
+ /** Reset the detached urlManager and seed it with this message's filtered facet values,
182
+ * then rebuild the root SearchFacetStore so the UI shows the matching display. */
183
+ setActiveFacets(facets, messageId) {
184
+ // reset url state, then seed with the API-reported filtered values
185
+ this.urlManager.reset().go();
186
+ facets.forEach((facet) => {
187
+ // Slider/range facets carry the active selection on the facet itself rather
188
+ // than on individual bucket values.
189
+ if (facet.type === 'range') {
190
+ const active = facet.active;
191
+ const range = facet.range;
192
+ if (active && range && (active.low !== range.low || active.high !== range.high)) {
193
+ this.urlManager.set(`filter.${facet.field}`, { low: active.low, high: active.high }).go();
194
+ }
195
+ return;
196
+ }
197
+ const filteredValues = (facet.values || []).filter((v) => v?.filtered);
198
+ filteredValues.forEach((v) => {
199
+ if (typeof v.low !== 'undefined' || typeof v.high !== 'undefined') {
200
+ this.urlManager.merge(`filter.${facet.field}`, [{ low: v.low, high: v.high }]).go();
201
+ }
202
+ else if (typeof v.value !== 'undefined') {
203
+ this.urlManager.merge(`filter.${facet.field}`, v.value).go();
204
+ }
205
+ });
206
+ });
207
+ this.facets = this.buildFacetStore(facets);
208
+ this.activeFacetsMessageId = messageId;
209
+ this.appliedFilterSnapshot = stableStringify(this.urlManager.state?.filter);
210
+ }
211
+ /** True when the in-progress facet selection differs from the filters that were applied
212
+ * by the active productSearchResult — i.e. the user has selected/removed something that
213
+ * hasn't been sent yet. Used to decide whether to show the Apply button. */
214
+ get hasPendingFacetChanges() {
215
+ // touch the version so mobx re-runs this when urlManager state changes
216
+ void this.urlVersion;
217
+ const current = stableStringify(this.urlManager.state?.filter);
218
+ return current !== this.appliedFilterSnapshot;
114
219
  }
115
220
  get currentChat() {
116
221
  return this.chats.find((chat) => chat.id === this.currentChatId);
@@ -126,16 +231,22 @@ export class ChatStore extends AbstractStore {
126
231
  }
127
232
  return isBlocked;
128
233
  }
129
- handleChatStatusResponse(response) {
234
+ applyChatStatusResponse(response) {
130
235
  const { chatbot, features } = response;
131
236
  const { status, suggestedQuestions, welcomeMessage } = chatbot;
132
237
  this.chatEnabled = status.enabled === true;
133
238
  this.features = features;
134
239
  this.suggestedQuestions = suggestedQuestions || [];
135
240
  this.welcomeMessage = welcomeMessage || '';
136
- this.storage.set('chatStatusResponse', JSON.stringify({ response, checkTime: Date.now() }));
137
241
  return this.chatEnabled;
138
242
  }
243
+ handleChatStatusResponse(response) {
244
+ const enabled = this.applyChatStatusResponse(response);
245
+ // Always persist on a real API response — restarts the 12-hour expiration
246
+ // so each new chat session refreshes the cache.
247
+ this.storage.set('chatStatusResponse', JSON.stringify({ response, checkTime: Date.now() }));
248
+ return enabled;
249
+ }
139
250
  reset() {
140
251
  this.chats = [];
141
252
  this.clearProductQuickview();
@@ -143,7 +254,10 @@ export class ChatStore extends AbstractStore {
143
254
  this.createChat();
144
255
  }
145
256
  setProductQuickview(product) {
146
- this.productQuickview = product;
257
+ // Clone the product so variant selections (and the parent-mappings merge done
258
+ // in updateProductQuickview) only affect the quickview — the carousel and any
259
+ // other surfaces still hold the original instance.
260
+ this.productQuickview = cloneProductForQuickview(product, this.meta?.data);
147
261
  this.productQuickviewError = null;
148
262
  }
149
263
  updateProductQuickview(response) {
@@ -207,6 +321,7 @@ export class ChatStore extends AbstractStore {
207
321
  const newChat = new ChatSessionStore({
208
322
  data: {
209
323
  sessionId: data?.sessionId,
324
+ sessionEndTime: data?.sessionEndTime,
210
325
  },
211
326
  stores: {
212
327
  storage: this.storage,
@@ -251,49 +366,45 @@ export class ChatStore extends AbstractStore {
251
366
  });
252
367
  }
253
368
  addFacet(facet) {
254
- this.currentChat?.attachments.add({
255
- type: 'facet',
256
- key: facet.key,
257
- facetLabel: facet.facetLabel,
258
- value: facet.value,
259
- label: facet.label,
260
- count: facet.count,
261
- });
369
+ const value = parseFacetValue(facet.value);
370
+ this.urlManager.merge(`filter.${facet.key}`, Array.isArray(value) ? value : value).go();
262
371
  }
263
372
  removeFacet(key, value) {
264
- const facetAttachment = this.currentChat?.attachments.items.find((item) => item.type === 'facet' &&
265
- item.key === key &&
266
- item.value === value &&
267
- (item.state === 'active' || item.state === 'attached'));
268
- if (facetAttachment) {
269
- const index = this.currentChat?.attachments.items.indexOf(facetAttachment);
270
- if (index !== undefined && index !== -1) {
271
- this.currentChat?.attachments.items.splice(index, 1);
272
- }
273
- }
373
+ const parsed = parseFacetValue(value);
374
+ this.urlManager.remove(`filter.${key}`, parsed).go();
274
375
  }
275
376
  clearPendingFacets() {
276
- const facetAttachments = this.currentChat?.attachments.items.filter((item) => item.type === 'facet' && (item.state === 'active' || item.state === 'attached')) || [];
277
- facetAttachments.forEach((item) => {
278
- const index = this.currentChat?.attachments.items.indexOf(item);
279
- if (index !== undefined && index !== -1) {
280
- this.currentChat?.attachments.items.splice(index, 1);
281
- }
282
- });
377
+ this.urlManager.remove('filter').go();
283
378
  }
284
379
  isFacetSelected(key, value) {
285
- return (this.currentChat?.attachments.items.some((item) => item.type === 'facet' &&
286
- item.key === key &&
287
- item.value === value &&
288
- (item.state === 'active' || item.state === 'attached')) || false);
380
+ // touch the version so mobx re-runs this when urlManager state changes (the
381
+ // underlying UrlManager isn't a mobx observable, so we mirror its updates here)
382
+ void this.urlVersion;
383
+ const filterState = this.urlManager.state?.filter;
384
+ if (!filterState || !filterState[key])
385
+ return false;
386
+ const stored = Array.isArray(filterState[key]) ? filterState[key] : [filterState[key]];
387
+ const parsed = parseFacetValue(value);
388
+ return stored.some((entry) => facetValueEquals(entry, parsed));
289
389
  }
290
390
  request(request) {
291
- this.currentChat?.request(request);
292
- // remove any facet attachments after request
293
- const facetAttachments = this.currentChat?.attachments.attached.filter((item) => item.type === 'facet') || [];
294
- facetAttachments.forEach((item) => {
295
- this.currentChat?.attachments.remove(item.id);
296
- });
391
+ // snapshot facet labels (field + per-value) from the active facets display so the
392
+ // outgoing user message can render "Filter by Color Red" rather than raw keys
393
+ const filterLabels = {};
394
+ for (const facet of this.facets) {
395
+ const valueFacet = facet;
396
+ const values = {};
397
+ (valueFacet.values || []).forEach((v) => {
398
+ if (typeof v.low !== 'undefined' || typeof v.high !== 'undefined') {
399
+ values[`${v.low ?? '*'}:${v.high ?? '*'}`] = v.label;
400
+ }
401
+ else if (typeof v.value !== 'undefined') {
402
+ values[v.value] = v.label;
403
+ }
404
+ });
405
+ filterLabels[valueFacet.field] = { facetLabel: valueFacet.label || valueFacet.field, values };
406
+ }
407
+ this.currentChat?.request(request, filterLabels);
297
408
  // remove any productSimilar attachments after request
298
409
  const productSimilarAttachments = this.currentChat?.attachments.attached.filter((item) => item.type === 'product' && item.requestType === 'productSimilar') || [];
299
410
  productSimilarAttachments.forEach((item) => {
@@ -318,3 +429,50 @@ export class ChatStore extends AbstractStore {
318
429
  this.storedMetaData = data.meta;
319
430
  }
320
431
  }
432
+ /** Deterministic JSON.stringify — sorts object keys recursively so equality comparisons
433
+ * aren't sensitive to insertion order. */
434
+ function stableStringify(value) {
435
+ if (value === null || value === undefined)
436
+ return 'null';
437
+ if (typeof value !== 'object')
438
+ return JSON.stringify(value);
439
+ if (Array.isArray(value)) {
440
+ return `[${value.map((v) => stableStringify(v)).join(',')}]`;
441
+ }
442
+ const keys = Object.keys(value).sort();
443
+ return `{${keys.map((k) => `${JSON.stringify(k)}:${stableStringify(value[k])}`).join(',')}}`;
444
+ }
445
+ /** Convert a chat-facet UI value into the URL-state shape — range buckets arrive as "low:high". */
446
+ function parseFacetValue(value) {
447
+ if (typeof value === 'string' && value.includes(':')) {
448
+ const [low, high] = value.split(':');
449
+ return {
450
+ low: low === '*' ? undefined : Number(low),
451
+ high: high === '*' ? undefined : Number(high),
452
+ };
453
+ }
454
+ return value;
455
+ }
456
+ function facetValueEquals(a, b) {
457
+ if (typeof a === 'object' && a !== null && typeof b === 'object' && b !== null) {
458
+ return a.low === b.low && a.high === b.high;
459
+ }
460
+ return a === b;
461
+ }
462
+ /** Build a fresh observable Product from an existing one. Variants are intentionally
463
+ * omitted — `updateProductQuickview` populates them from the products API response. */
464
+ function cloneProductForQuickview(product, meta) {
465
+ const result = {
466
+ id: product.id,
467
+ responseId: product.responseId,
468
+ mappings: JSON.parse(JSON.stringify(product.mappings || {})),
469
+ attributes: JSON.parse(JSON.stringify(product.attributes || {})),
470
+ badges: product.badges?.all?.map((b) => ({ tag: b.tag })) || [],
471
+ };
472
+ return new Product({
473
+ config: {},
474
+ data: { result, meta: meta || {} },
475
+ position: product.position ?? 0,
476
+ responseId: product.responseId,
477
+ });
478
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"ChatAttachmentStore.d.ts","sourceRoot":"","sources":["../../../../src/Chat/Stores/ChatAttachmentStore.ts"],"names":[],"mappings":"AAKA,KAAK,eAAe,GAAG,SAAS,GAAG,OAAO,GAAG,UAAU,GAAG,QAAQ,G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