@abcagency/hc-ui-components 1.5.1 → 1.5.3

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 (173) hide show
  1. package/dist/components/HireControlMap.js +52 -22
  2. package/dist/components/HireControlMap.js.map +1 -1
  3. package/dist/components/containers/accordions/filter-container.js +13 -5
  4. package/dist/components/containers/accordions/filter-container.js.map +1 -1
  5. package/dist/components/containers/accordions/filter-item-container.js +9 -9
  6. package/dist/components/containers/accordions/filter-item-container.js.map +1 -1
  7. package/dist/components/containers/accordions/map-accordion-item-container.js +10 -5
  8. package/dist/components/containers/accordions/map-accordion-item-container.js.map +1 -1
  9. package/dist/components/containers/filter/commute-container.js +3 -3
  10. package/dist/components/containers/filter/commute-container.js.map +1 -1
  11. package/dist/components/containers/filter/filter-container.js +6 -5
  12. package/dist/components/containers/filter/filter-container.js.map +1 -1
  13. package/dist/components/containers/filter/filter-item-container.js +12 -12
  14. package/dist/components/containers/filter/filter-item-container.js.map +1 -1
  15. package/dist/components/containers/filter/location-container.js +6 -5
  16. package/dist/components/containers/filter/location-container.js.map +1 -1
  17. package/dist/components/containers/filter/points-of-interest-container.js +5 -5
  18. package/dist/components/containers/filter/points-of-interest-container.js.map +1 -1
  19. package/dist/components/containers/filter/points-of-interest-radio-item-container.js +2 -2
  20. package/dist/components/containers/filter/points-of-interest-radio-item-container.js.map +1 -1
  21. package/dist/components/containers/filter/search-container.js +2 -2
  22. package/dist/components/containers/filter/search-container.js.map +1 -1
  23. package/dist/components/containers/jobListing/listing-details-container.js +2 -2
  24. package/dist/components/containers/jobListing/listing-details-container.js.map +1 -1
  25. package/dist/components/containers/list/item-list-container.js +8 -8
  26. package/dist/components/containers/list/item-list-container.js.map +1 -1
  27. package/dist/components/containers/list/list-item/list-item-container.js +2 -2
  28. package/dist/components/containers/list/list-item/list-item-container.js.map +1 -1
  29. package/dist/components/containers/maps/info-window-content-container.js +2 -2
  30. package/dist/components/containers/maps/info-window-content-container.js.map +1 -1
  31. package/dist/components/containers/maps/map-container.js +8 -9
  32. package/dist/components/containers/maps/map-container.js.map +1 -1
  33. package/dist/components/containers/maps/map-list-container.js +5 -5
  34. package/dist/components/containers/maps/map-list-container.js.map +1 -1
  35. package/dist/components/containers/maps/map-marker-container.js +6 -6
  36. package/dist/components/containers/maps/map-marker-container.js.map +1 -1
  37. package/dist/components/modules/accordions/MapAccordionItem.js +5 -5
  38. package/dist/components/modules/accordions/MapAccordionItem.js.map +1 -1
  39. package/dist/components/modules/accordions/default.js +15 -15
  40. package/dist/components/modules/accordions/default.js.map +1 -1
  41. package/dist/components/modules/accordions/filterItem.js +4 -4
  42. package/dist/components/modules/accordions/filterItem.js.map +1 -1
  43. package/dist/components/modules/accordions/filters.js +6 -6
  44. package/dist/components/modules/accordions/filters.js.map +1 -1
  45. package/dist/components/modules/buttons/button-group-apply.js +19 -19
  46. package/dist/components/modules/buttons/button-group-apply.js.map +1 -1
  47. package/dist/components/modules/buttons/default.js +9 -9
  48. package/dist/components/modules/buttons/default.js.map +1 -1
  49. package/dist/components/modules/buttons/items-pill.js +2 -2
  50. package/dist/components/modules/buttons/items-pill.js.map +1 -1
  51. package/dist/components/modules/buttons/pill-wrapper.js +2 -2
  52. package/dist/components/modules/buttons/pill-wrapper.js.map +1 -1
  53. package/dist/components/modules/buttons/show-all-button.js +3 -3
  54. package/dist/components/modules/buttons/show-all-button.js.map +1 -1
  55. package/dist/components/modules/cards/default.js +11 -11
  56. package/dist/components/modules/cards/default.js.map +1 -1
  57. package/dist/components/modules/cards/filter.js +5 -5
  58. package/dist/components/modules/cards/filter.js.map +1 -1
  59. package/dist/components/modules/dialogs/apply-dialog.js +19 -19
  60. package/dist/components/modules/dialogs/apply-dialog.js.map +1 -1
  61. package/dist/components/modules/filter/commute.js +18 -19
  62. package/dist/components/modules/filter/commute.js.map +1 -1
  63. package/dist/components/modules/filter/index.js +10 -10
  64. package/dist/components/modules/filter/index.js.map +1 -1
  65. package/dist/components/modules/filter/item.js +6 -6
  66. package/dist/components/modules/filter/item.js.map +1 -1
  67. package/dist/components/modules/filter/location.js +6 -6
  68. package/dist/components/modules/filter/location.js.map +1 -1
  69. package/dist/components/modules/filter/radio-item.js +6 -6
  70. package/dist/components/modules/filter/radio-item.js.map +1 -1
  71. package/dist/components/modules/filter/search.js +10 -10
  72. package/dist/components/modules/filter/search.js.map +1 -1
  73. package/dist/components/modules/filter/sort.js +28 -28
  74. package/dist/components/modules/filter/sort.js.map +1 -1
  75. package/dist/components/modules/grid.js +4 -4
  76. package/dist/components/modules/grid.js.map +1 -1
  77. package/dist/components/modules/icon.js +4 -4
  78. package/dist/components/modules/icon.js.map +1 -1
  79. package/dist/components/modules/jobListing/listing-details.js +4 -4
  80. package/dist/components/modules/jobListing/listing-details.js.map +1 -1
  81. package/dist/components/modules/list/field-mapper-desktop.js +8 -8
  82. package/dist/components/modules/list/field-mapper-desktop.js.map +1 -1
  83. package/dist/components/modules/list/field-mapper-mobile.js +18 -18
  84. package/dist/components/modules/list/field-mapper-mobile.js.map +1 -1
  85. package/dist/components/modules/list/header-item.js +7 -7
  86. package/dist/components/modules/list/header-item.js.map +1 -1
  87. package/dist/components/modules/list/header.js +5 -5
  88. package/dist/components/modules/list/header.js.map +1 -1
  89. package/dist/components/modules/list/item-expand-card/index.js +3 -3
  90. package/dist/components/modules/list/item-expand-card/index.js.map +1 -1
  91. package/dist/components/modules/list/item-list.js +15 -15
  92. package/dist/components/modules/list/item-list.js.map +1 -1
  93. package/dist/components/modules/list/list-item/list-item.js +13 -13
  94. package/dist/components/modules/list/list-item/list-item.js.map +1 -1
  95. package/dist/components/modules/maps/info-window-card.js +2 -2
  96. package/dist/components/modules/maps/info-window-card.js.map +1 -1
  97. package/dist/components/modules/maps/info-window-content.js +5 -5
  98. package/dist/components/modules/maps/info-window-content.js.map +1 -1
  99. package/dist/components/modules/maps/map-list.js +5 -5
  100. package/dist/components/modules/maps/map-list.js.map +1 -1
  101. package/dist/components/modules/maps/map-marker.js +3 -3
  102. package/dist/components/modules/maps/map-marker.js.map +1 -1
  103. package/dist/components/modules/maps/map.js +5 -5
  104. package/dist/components/modules/maps/map.js.map +1 -1
  105. package/dist/components/modules/maps/place-marker.js +5 -5
  106. package/dist/components/modules/maps/place-marker.js.map +1 -1
  107. package/dist/components/modules/maps/tabs.js +21 -21
  108. package/dist/components/modules/maps/tabs.js.map +1 -1
  109. package/dist/contexts/mapContext.js +18 -18
  110. package/dist/contexts/mapContext.js.map +1 -1
  111. package/dist/contexts/mapListContext.js +28 -24
  112. package/dist/contexts/mapListContext.js.map +1 -1
  113. package/dist/contexts/placesContext.js +2 -2
  114. package/dist/contexts/placesContext.js.map +1 -1
  115. package/dist/contexts/themeContext.js +2 -2
  116. package/dist/contexts/themeContext.js.map +1 -1
  117. package/dist/contexts/trackEventContext.js +2 -2
  118. package/dist/contexts/trackEventContext.js.map +1 -1
  119. package/dist/services/listingAggregatorService.js +19 -15
  120. package/dist/services/listingAggregatorService.js.map +1 -1
  121. package/dist/services/listingEntityService.js +3 -2
  122. package/dist/services/listingEntityService.js.map +1 -1
  123. package/dist/services/listingService.js +1 -16
  124. package/dist/services/listingService.js.map +1 -1
  125. package/dist/styles/index.css +1 -3
  126. package/dist/types/contexts/mapContext.d.ts +1 -0
  127. package/dist/types/services/listingAggregatorService.d.ts +2 -2
  128. package/dist/types/services/listingEntityService.d.ts +2 -3
  129. package/dist/types/types/GetListingParams.d.ts +1 -1
  130. package/dist/types/types/ListingEntity.d.ts +2 -1
  131. package/dist/types/types/ListingFields.d.ts +4 -2
  132. package/dist/types/types/Listings.d.ts +0 -1
  133. package/dist/types/util/algoliaSearchUtil.d.ts +4 -0
  134. package/dist/types/util/filterUtil.d.ts +2 -2
  135. package/dist/types/util/mapUtil.d.ts +3 -3
  136. package/dist/util/algoliaSearchUtil.js +133 -0
  137. package/dist/util/algoliaSearchUtil.js.map +1 -0
  138. package/dist/util/filterUtil.js +129 -66
  139. package/dist/util/filterUtil.js.map +1 -1
  140. package/dist/util/loading.js +3 -3
  141. package/dist/util/loading.js.map +1 -1
  142. package/dist/util/mapUtil.js +37 -25
  143. package/dist/util/mapUtil.js.map +1 -1
  144. package/package.json +60 -17
  145. package/src/components/HireControlMap.js +35 -9
  146. package/src/components/containers/accordions/filter-container.js +6 -1
  147. package/src/components/containers/accordions/filter-item-container.js +2 -2
  148. package/src/components/containers/accordions/map-accordion-item-container.js +6 -2
  149. package/src/components/containers/filter/filter-container.js +3 -2
  150. package/src/components/containers/filter/filter-item-container.js +10 -10
  151. package/src/components/containers/filter/location-container.js +3 -3
  152. package/src/components/containers/list/item-list-container.tsx +3 -3
  153. package/src/components/containers/maps/info-window-content-container.js +1 -1
  154. package/src/components/containers/maps/map-container.js +2 -1
  155. package/src/components/modules/buttons/button-group-apply.js +8 -8
  156. package/src/components/modules/dialogs/apply-dialog.js +2 -2
  157. package/src/components/modules/list/field-mapper-desktop.jsx +2 -2
  158. package/src/components/modules/list/field-mapper-mobile.jsx +8 -8
  159. package/src/components/modules/list/header-item.js +1 -1
  160. package/src/components/modules/maps/map-list.js +1 -1
  161. package/src/contexts/mapContext.tsx +17 -16
  162. package/src/contexts/mapListContext.tsx +55 -49
  163. package/src/services/listingAggregatorService.ts +29 -21
  164. package/src/services/listingEntityService.ts +3 -3
  165. package/src/services/listingService.ts +1 -11
  166. package/src/styles/components.css +30 -0
  167. package/src/types/GetListingParams.ts +1 -1
  168. package/src/types/ListingEntity.ts +2 -1
  169. package/src/types/ListingFields.ts +4 -2
  170. package/src/types/Listings.ts +0 -1
  171. package/src/util/algoliaSearchUtil.js +91 -0
  172. package/src/util/filterUtil.js +19 -8
  173. package/src/util/mapUtil.js +52 -41
@@ -1,5 +1,5 @@
1
- import React__default from 'react';
2
- import { Root as Root2, List, Trigger, Content } from '../../../packages/hc-ui-components/node_modules/@radix-ui/react-tabs/dist/index.js';
1
+ import React from 'react';
2
+ import * as Tabs from '@radix-ui/react-tabs';
3
3
  import Button from '../buttons/default.js';
4
4
  import { useMapList } from '../../../contexts/mapListContext.js';
5
5
 
@@ -14,69 +14,69 @@ var MapTabs = function MapTabs(_ref) {
14
14
  mobileTab = _useMapList.mobileTab,
15
15
  setMobileTab = _useMapList.setMobileTab,
16
16
  containerStyle = _useMapList.containerStyle;
17
- return /*#__PURE__*/React__default.createElement("div", {
17
+ return /*#__PURE__*/React.createElement("div", {
18
18
  style: containerStyle,
19
19
  className: "\n hc-relative hc-overflow-hidden\n ".concat(className !== null && className !== void 0 ? className : "", "\n ")
20
- }, /*#__PURE__*/React__default.createElement(Root2, {
20
+ }, /*#__PURE__*/React.createElement(Tabs.Root, {
21
21
  className: "hc-flex hc-flex-col hc-h-full",
22
22
  value: mobileTab
23
- }, /*#__PURE__*/React__default.createElement(List, {
23
+ }, /*#__PURE__*/React.createElement(Tabs.List, {
24
24
  className: "hc-w-full hc-shrink-0 hc-flex hc-divide-x hc-divide-primary hc-bg-white hc-z-10",
25
25
  "aria-label": "Review positions"
26
- }, /*#__PURE__*/React__default.createElement(Trigger, {
26
+ }, /*#__PURE__*/React.createElement(Tabs.Trigger, {
27
27
  value: "listTab",
28
28
  asChild: true,
29
29
  onClick: function onClick() {
30
30
  return setMobileTab("listTab");
31
31
  }
32
- }, /*#__PURE__*/React__default.createElement(Button.Btn, {
32
+ }, /*#__PURE__*/React.createElement(Button.Btn, {
33
33
  variant: "outline",
34
34
  isBlock: true,
35
35
  className: tabButtonClasses
36
- }, /*#__PURE__*/React__default.createElement(Button.Body, {
36
+ }, /*#__PURE__*/React.createElement(Button.Body, {
37
37
  className: "hc-justify-center"
38
- }, /*#__PURE__*/React__default.createElement(Button.Icon, {
38
+ }, /*#__PURE__*/React.createElement(Button.Icon, {
39
39
  icon: "mdi:view-list",
40
40
  size: "hc-size-5"
41
- }), "List"))), showMap && /*#__PURE__*/React__default.createElement(Trigger, {
41
+ }), "List"))), showMap && /*#__PURE__*/React.createElement(Tabs.Trigger, {
42
42
  value: "mapTab",
43
43
  asChild: true,
44
44
  onClick: function onClick() {
45
45
  return setMobileTab("mapTab");
46
46
  }
47
- }, /*#__PURE__*/React__default.createElement(Button.Btn, {
47
+ }, /*#__PURE__*/React.createElement(Button.Btn, {
48
48
  variant: "outline",
49
49
  isBlock: true,
50
50
  className: tabButtonClasses
51
- }, /*#__PURE__*/React__default.createElement(Button.Body, {
51
+ }, /*#__PURE__*/React.createElement(Button.Body, {
52
52
  className: "hc-justify-center"
53
- }, /*#__PURE__*/React__default.createElement(Button.Icon, {
53
+ }, /*#__PURE__*/React.createElement(Button.Icon, {
54
54
  icon: "mdi:map",
55
55
  size: "hc-size-5"
56
- }), "Map"))), /*#__PURE__*/React__default.createElement(Trigger, {
56
+ }), "Map"))), /*#__PURE__*/React.createElement(Tabs.Trigger, {
57
57
  value: "filterTab",
58
58
  asChild: true,
59
59
  onClick: function onClick() {
60
60
  return setMobileTab("filterTab");
61
61
  }
62
- }, /*#__PURE__*/React__default.createElement(Button.Btn, {
62
+ }, /*#__PURE__*/React.createElement(Button.Btn, {
63
63
  variant: "outline",
64
64
  isBlock: true,
65
65
  className: tabButtonClasses
66
- }, /*#__PURE__*/React__default.createElement(Button.Body, {
66
+ }, /*#__PURE__*/React.createElement(Button.Body, {
67
67
  className: "hc-justify-center"
68
- }, /*#__PURE__*/React__default.createElement(Button.Icon, {
68
+ }, /*#__PURE__*/React.createElement(Button.Icon, {
69
69
  icon: "fluent:search-12-filled",
70
70
  size: "hc-size-5"
71
- }), "Filter")))), /*#__PURE__*/React__default.createElement("div", {
71
+ }), "Filter")))), /*#__PURE__*/React.createElement("div", {
72
72
  className: "hc-flex-grow hc-h-[calc(100%-48px)]"
73
- }, /*#__PURE__*/React__default.createElement(Content, {
73
+ }, /*#__PURE__*/React.createElement(Tabs.Content, {
74
74
  className: "hc-h-full hc-overflow-auto hc-bg-white hc-outline-none",
75
75
  value: "listTab"
76
- }, list), showMap && /*#__PURE__*/React__default.createElement(Content, {
76
+ }, list), showMap && /*#__PURE__*/React.createElement(Tabs.Content, {
77
77
  className: "hc-h-full hc-overflow-auto hc-bg-white hc-outline-none",
78
78
  value: "mapTab"
79
- }, map), /*#__PURE__*/React__default.createElement(Content, {
79
+ }, map), /*#__PURE__*/React.createElement(Tabs.Content, {
80
80
  className: "hc-h-full hc-bg-white hc-outline-none",
81
81
  value: "filterTab"
82
82
  }, filter))));
@@ -1 +1 @@
1
- {"version":3,"file":"tabs.js","sources":["../../../../src/components/modules/maps/tabs.js"],"sourcesContent":["import React from 'react';\nimport * as Tabs from '@radix-ui/react-tabs';\nimport Button from '~/components/modules/buttons/default';\nimport { useMapList } from '~/contexts/mapListContext';\n\nconst MapTabs = ({\n\tmap,\n\tlist,\n\tfilter,\n\tclassName,\n\tshowMap\n}) => {\n\tconst tabButtonClasses =\n \"hc-flex hc-items-center hc-gap-2 hc-rounded-none hc-border-x-0 data-[state=active]:hc-bg-primary data-[state=active]:hc-text-white\";\n\tconst { mobileTab, setMobileTab, containerStyle } = useMapList();\n\n\treturn (\n\t\t<div\n\t\t\tstyle={containerStyle}\n\t\t\tclassName={`\n hc-relative hc-overflow-hidden\n ${className ?? \"\"}\n `}\n\t\t>\n\t\t\t<Tabs.Root\n\t\t\t\tclassName=\"hc-flex hc-flex-col hc-h-full\"\n\t\t\t\tvalue={mobileTab}\n\t\t\t>\n\t\t\t\t{/* Fixed tab header */}\n\t\t\t\t<Tabs.List\n\t\t\t\t\tclassName=\"hc-w-full hc-shrink-0 hc-flex hc-divide-x hc-divide-primary hc-bg-white hc-z-10\"\n\t\t\t\t\taria-label=\"Review positions\"\n\t\t\t\t>\n\t\t\t\t\t<Tabs.Trigger value=\"listTab\" asChild onClick={() => setMobileTab(\"listTab\")}>\n\t\t\t\t\t\t<Button.Btn variant=\"outline\" isBlock className={tabButtonClasses}>\n\t\t\t\t\t\t\t<Button.Body className=\"hc-justify-center\">\n\t\t\t\t\t\t\t\t<Button.Icon icon=\"mdi:view-list\" size=\"hc-size-5\" />\n List\n\t\t\t\t\t\t\t</Button.Body>\n\t\t\t\t\t\t</Button.Btn>\n\t\t\t\t\t</Tabs.Trigger>\n\t\t\t\t\t{showMap && (\n\t\t\t\t\t\t<Tabs.Trigger value=\"mapTab\" asChild onClick={() => setMobileTab(\"mapTab\")}>\n\t\t\t\t\t\t\t<Button.Btn\n\t\t\t\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\t\t\t\tisBlock\n\t\t\t\t\t\t\t\tclassName={tabButtonClasses}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Button.Body className=\"hc-justify-center\">\n\t\t\t\t\t\t\t\t\t<Button.Icon icon=\"mdi:map\" size=\"hc-size-5\" />\n Map\n\t\t\t\t\t\t\t\t</Button.Body>\n\t\t\t\t\t\t\t</Button.Btn>\n\t\t\t\t\t\t</Tabs.Trigger>\n\t\t\t\t\t)}\n\t\t\t\t\t<Tabs.Trigger value=\"filterTab\" asChild onClick={() => setMobileTab(\"filterTab\")}>\n\t\t\t\t\t\t<Button.Btn variant=\"outline\" isBlock className={tabButtonClasses}>\n\t\t\t\t\t\t\t<Button.Body className=\"hc-justify-center\">\n\t\t\t\t\t\t\t\t<Button.Icon icon=\"fluent:search-12-filled\" size=\"hc-size-5\" />\n Filter\n\t\t\t\t\t\t\t</Button.Body>\n\t\t\t\t\t\t</Button.Btn>\n\t\t\t\t\t</Tabs.Trigger>\n\t\t\t\t</Tabs.List>\n\n\t\t\t\t{/* Tab content */}\n\t\t\t\t<div className=\"hc-flex-grow hc-h-[calc(100%-48px)]\">\n\t\t\t\t\t{/* List Tab Content */}\n\t\t\t\t\t<Tabs.Content\n\t\t\t\t\t\tclassName=\"hc-h-full hc-overflow-auto hc-bg-white hc-outline-none\"\n\t\t\t\t\t\tvalue=\"listTab\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{list}\n\t\t\t\t\t</Tabs.Content>\n\n\t\t\t\t\t{/* Map Tab Content */}\n\t\t\t\t\t{showMap && (\n\t\t\t\t\t\t<Tabs.Content\n\t\t\t\t\t\t\tclassName=\"hc-h-full hc-overflow-auto hc-bg-white hc-outline-none\"\n\t\t\t\t\t\t\tvalue=\"mapTab\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{map}\n\t\t\t\t\t\t</Tabs.Content>\n\t\t\t\t\t)}\n\n\t\t\t\t\t{/* Filter Tab Content */}\n\t\t\t\t\t<Tabs.Content\n\t\t\t\t\t\tclassName=\"hc-h-full hc-bg-white hc-outline-none\"\n\t\t\t\t\t\tvalue=\"filterTab\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{filter}\n\t\t\t\t\t</Tabs.Content>\n\t\t\t\t</div>\n\t\t\t</Tabs.Root>\n\t\t</div>\n\t);\n};\n\nexport default MapTabs;"],"names":["MapTabs","_ref","map","list","filter","className","showMap","tabButtonClasses","_useMapList","useMapList","mobileTab","setMobileTab","containerStyle","React","createElement","style","concat","Tabs","value","asChild","onClick","Button","Btn","variant","isBlock","Body","Icon","icon","size"],"mappings":";;;;;AAKA,IAAMA,OAAO,GAAG,SAAVA,OAAOA,CAAAC,IAAA,EAMP;AAAA,EAAA,IALLC,GAAG,GAAAD,IAAA,CAAHC,GAAG;IACHC,IAAI,GAAAF,IAAA,CAAJE,IAAI;IACJC,MAAM,GAAAH,IAAA,CAANG,MAAM;IACNC,SAAS,GAAAJ,IAAA,CAATI,SAAS;IACTC,OAAO,GAAAL,IAAA,CAAPK,OAAO,CAAA;EAEP,IAAMC,gBAAgB,GACnB,oIAAoI,CAAA;AACvI,EAAA,IAAAC,WAAA,GAAoDC,UAAU,EAAE;IAAxDC,SAAS,GAAAF,WAAA,CAATE,SAAS;IAAEC,YAAY,GAAAH,WAAA,CAAZG,YAAY;IAAEC,cAAc,GAAAJ,WAAA,CAAdI,cAAc,CAAA;EAE/C,oBACCC,cAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AACCC,IAAAA,KAAK,EAAEH,cAAe;IACtBP,SAAS,EAAA,oDAAA,CAAAW,MAAA,CAEFX,SAAS,aAATA,SAAS,KAAA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AAC,EAGdG,OAAO,iBACPO,cAAA,CAAAC,aAAA,CAACG,OAAY,EAAA;AACZZ,IAAAA,SAAS,EAAC,wDAAwD;AAClEa,IAAAA,KAAK,EAAC,QAAA;GAELhB,EAAAA,GACY,CACd,eAGDW,cAAA,CAAAC,aAAA,CAACG,OAAY,EAAA;AACZZ,IAAAA,SAAS,EAAC,uCAAuC;AACjDa,IAAAA,KAAK,EAAC,WAAA;AAAW,GAAA,EAEhBd,MACY,CACV,CACK,CACP,CAAC,CAAA;AAER;;;;"}
1
+ {"version":3,"file":"tabs.js","sources":["../../../../src/components/modules/maps/tabs.js"],"sourcesContent":["import React from 'react';\nimport * as Tabs from '@radix-ui/react-tabs';\nimport Button from '~/components/modules/buttons/default';\nimport { useMapList } from '~/contexts/mapListContext';\n\nconst MapTabs = ({\n\tmap,\n\tlist,\n\tfilter,\n\tclassName,\n\tshowMap\n}) => {\n\tconst tabButtonClasses =\n \"hc-flex hc-items-center hc-gap-2 hc-rounded-none hc-border-x-0 data-[state=active]:hc-bg-primary data-[state=active]:hc-text-white\";\n\tconst { mobileTab, setMobileTab, containerStyle } = useMapList();\n\n\treturn (\n\t\t<div\n\t\t\tstyle={containerStyle}\n\t\t\tclassName={`\n hc-relative hc-overflow-hidden\n ${className ?? \"\"}\n `}\n\t\t>\n\t\t\t<Tabs.Root\n\t\t\t\tclassName=\"hc-flex hc-flex-col hc-h-full\"\n\t\t\t\tvalue={mobileTab}\n\t\t\t>\n\t\t\t\t{/* Fixed tab header */}\n\t\t\t\t<Tabs.List\n\t\t\t\t\tclassName=\"hc-w-full hc-shrink-0 hc-flex hc-divide-x hc-divide-primary hc-bg-white hc-z-10\"\n\t\t\t\t\taria-label=\"Review positions\"\n\t\t\t\t>\n\t\t\t\t\t<Tabs.Trigger value=\"listTab\" asChild onClick={() => setMobileTab(\"listTab\")}>\n\t\t\t\t\t\t<Button.Btn variant=\"outline\" isBlock className={tabButtonClasses}>\n\t\t\t\t\t\t\t<Button.Body className=\"hc-justify-center\">\n\t\t\t\t\t\t\t\t<Button.Icon icon=\"mdi:view-list\" size=\"hc-size-5\" />\n List\n\t\t\t\t\t\t\t</Button.Body>\n\t\t\t\t\t\t</Button.Btn>\n\t\t\t\t\t</Tabs.Trigger>\n\t\t\t\t\t{showMap && (\n\t\t\t\t\t\t<Tabs.Trigger value=\"mapTab\" asChild onClick={() => setMobileTab(\"mapTab\")}>\n\t\t\t\t\t\t\t<Button.Btn\n\t\t\t\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\t\t\t\tisBlock\n\t\t\t\t\t\t\t\tclassName={tabButtonClasses}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Button.Body className=\"hc-justify-center\">\n\t\t\t\t\t\t\t\t\t<Button.Icon icon=\"mdi:map\" size=\"hc-size-5\" />\n Map\n\t\t\t\t\t\t\t\t</Button.Body>\n\t\t\t\t\t\t\t</Button.Btn>\n\t\t\t\t\t\t</Tabs.Trigger>\n\t\t\t\t\t)}\n\t\t\t\t\t<Tabs.Trigger value=\"filterTab\" asChild onClick={() => setMobileTab(\"filterTab\")}>\n\t\t\t\t\t\t<Button.Btn variant=\"outline\" isBlock className={tabButtonClasses}>\n\t\t\t\t\t\t\t<Button.Body className=\"hc-justify-center\">\n\t\t\t\t\t\t\t\t<Button.Icon icon=\"fluent:search-12-filled\" size=\"hc-size-5\" />\n Filter\n\t\t\t\t\t\t\t</Button.Body>\n\t\t\t\t\t\t</Button.Btn>\n\t\t\t\t\t</Tabs.Trigger>\n\t\t\t\t</Tabs.List>\n\n\t\t\t\t{/* Tab content */}\n\t\t\t\t<div className=\"hc-flex-grow hc-h-[calc(100%-48px)]\">\n\t\t\t\t\t{/* List Tab Content */}\n\t\t\t\t\t<Tabs.Content\n\t\t\t\t\t\tclassName=\"hc-h-full hc-overflow-auto hc-bg-white hc-outline-none\"\n\t\t\t\t\t\tvalue=\"listTab\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{list}\n\t\t\t\t\t</Tabs.Content>\n\n\t\t\t\t\t{/* Map Tab Content */}\n\t\t\t\t\t{showMap && (\n\t\t\t\t\t\t<Tabs.Content\n\t\t\t\t\t\t\tclassName=\"hc-h-full hc-overflow-auto hc-bg-white hc-outline-none\"\n\t\t\t\t\t\t\tvalue=\"mapTab\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{map}\n\t\t\t\t\t\t</Tabs.Content>\n\t\t\t\t\t)}\n\n\t\t\t\t\t{/* Filter Tab Content */}\n\t\t\t\t\t<Tabs.Content\n\t\t\t\t\t\tclassName=\"hc-h-full hc-bg-white hc-outline-none\"\n\t\t\t\t\t\tvalue=\"filterTab\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{filter}\n\t\t\t\t\t</Tabs.Content>\n\t\t\t\t</div>\n\t\t\t</Tabs.Root>\n\t\t</div>\n\t);\n};\n\nexport default MapTabs;"],"names":["MapTabs","_ref","map","list","filter","className","showMap","tabButtonClasses","_useMapList","useMapList","mobileTab","setMobileTab","containerStyle","React","createElement","style","concat","Tabs","Root","value","List","Trigger","asChild","onClick","Button","Btn","variant","isBlock","Body","Icon","icon","size","Content"],"mappings":";;;;;AAKA,IAAMA,OAAO,GAAG,SAAVA,OAAOA,CAAAC,IAAA,EAMP;AAAA,EAAA,IALLC,GAAG,GAAAD,IAAA,CAAHC,GAAG;IACHC,IAAI,GAAAF,IAAA,CAAJE,IAAI;IACJC,MAAM,GAAAH,IAAA,CAANG,MAAM;IACNC,SAAS,GAAAJ,IAAA,CAATI,SAAS;IACTC,OAAO,GAAAL,IAAA,CAAPK,OAAO,CAAA;EAEP,IAAMC,gBAAgB,GACnB,oIAAoI,CAAA;AACvI,EAAA,IAAAC,WAAA,GAAoDC,UAAU,EAAE;IAAxDC,SAAS,GAAAF,WAAA,CAATE,SAAS;IAAEC,YAAY,GAAAH,WAAA,CAAZG,YAAY;IAAEC,cAAc,GAAAJ,WAAA,CAAdI,cAAc,CAAA;EAE/C,oBACCC,KAAA,CAAAC,aAAA,C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A;AAAKT,IAAAA,SAAS,EAAC,qCAAA;AAAqC,GAAA,eAEnDQ,KAAA,CAAAC,aAAA,CAACG,IAAI,CAACe,OAAO,EAAA;AACZ3B,IAAAA,SAAS,EAAC,wDAAwD;AAClEc,IAAAA,KAAK,EAAC,SAAA;GAELhB,EAAAA,IACY,CAAC,EAGdG,OAAO,iBACPO,KAAA,CAAAC,aAAA,CAACG,IAAI,CAACe,OAAO,EAAA;AACZ3B,IAAAA,SAAS,EAAC,wDAAwD;AAClEc,IAAAA,KAAK,EAAC,QAAA;GAELjB,EAAAA,GACY,CACd,eAGDW,KAAA,CAAAC,aAAA,CAACG,IAAI,CAACe,OAAO,EAAA;AACZ3B,IAAAA,SAAS,EAAC,uCAAuC;AACjDc,IAAAA,KAAK,EAAC,WAAA;AAAW,GAAA,EAEhBf,MACY,CACV,CACK,CACP,CAAC,CAAA;AAER;;;;"}
@@ -1,4 +1,4 @@
1
- import React__default, { createContext, useContext, useState, useRef, useEffect } from 'react';
1
+ import React, { createContext, useContext, useState, useRef, useEffect } from 'react';
2
2
  import { getStorageObject, setStorageObject } from '../util/localStorageUtil.js';
3
3
 
4
4
  const MapContext = createContext(undefined);
@@ -9,32 +9,32 @@ const useMap = () => {
9
9
  }
10
10
  return context;
11
11
  };
12
- const MapProvider = ({ children, resetFilters, defaultZoomOverride }) => {
13
- const [selectedListItem, setSelectedListItem] = useState(getStorageObject('selectedListItem'));
14
- const [location, setLocation] = useState(getStorageObject('location'));
15
- const [center, setCenter] = useState(getStorageObject("center", { lat: 39.8283, lng: -98.5795 }) || { lat: 39.8283, lng: -98.5795 });
16
- const [zoom, setZoom] = useState(getStorageObject("zoom", 9) || 9);
12
+ const MapProvider = ({ children, resetFilters, defaultZoomOverride, localStorageKey = '' }) => {
13
+ const [selectedListItem, setSelectedListItem] = useState(getStorageObject(localStorageKey + 'selectedListItem'));
14
+ const [location, setLocation] = useState(getStorageObject(localStorageKey + 'location'));
15
+ const [center, setCenter] = useState(getStorageObject(localStorageKey + "center", { lat: 39.8283, lng: -98.5795 }) || { lat: 39.8283, lng: -98.5795 });
16
+ const [zoom, setZoom] = useState(getStorageObject(localStorageKey + "zoom", 9) || 9);
17
17
  const [selectedPlaces, setSelectedPlaces] = useState([]);
18
18
  const [mapInteracted, setMapInteracted] = useState(false);
19
- const [firstLoadListItem] = useState(getStorageObject('selectedListItem', { id: "defaultId" }));
19
+ const [firstLoadListItem] = useState(getStorageObject(localStorageKey + 'selectedListItem', { id: "defaultId" }));
20
20
  const userSetZoom = useRef(true);
21
21
  useEffect(() => {
22
- setStorageObject("selectedListItem", selectedListItem);
23
- }, [selectedListItem]);
22
+ setStorageObject(localStorageKey + "selectedListItem", selectedListItem);
23
+ }, [selectedListItem, localStorageKey]);
24
24
  useEffect(() => {
25
- localStorage.setItem("zoom", zoom.toString());
26
- }, [zoom]);
25
+ localStorage.setItem(localStorageKey + "zoom", zoom.toString());
26
+ }, [zoom, localStorageKey]);
27
27
  useEffect(() => {
28
28
  if (location == null) {
29
- localStorage.removeItem("location");
29
+ localStorage.removeItem(localStorageKey + "location");
30
30
  }
31
31
  else {
32
- setStorageObject("location", location);
32
+ setStorageObject(localStorageKey + "location", location);
33
33
  }
34
- }, [location]);
34
+ }, [location, localStorageKey]);
35
35
  useEffect(() => {
36
- setStorageObject("center", center);
37
- }, [center]);
36
+ setStorageObject(localStorageKey + "center", center);
37
+ }, [center, localStorageKey]);
38
38
  const selectItem = (item, itemLocation, zoom, center) => {
39
39
  setSelectedListItem(item);
40
40
  if (mapInteracted === false && itemLocation != null) {
@@ -61,11 +61,11 @@ const MapProvider = ({ children, resetFilters, defaultZoomOverride }) => {
61
61
  }
62
62
  }, [resetFilters]);
63
63
  const selectLocationEntity = (location) => {
64
- localStorage.removeItem("selectedListItem");
64
+ localStorage.removeItem(localStorageKey + "selectedListItem");
65
65
  setTimeout(() => setLocation(location), 200);
66
66
  setSelectedListItem(null);
67
67
  };
68
- return (React__default.createElement(MapContext.Provider, { value: {
68
+ return (React.createElement(MapContext.Provider, { value: {
69
69
  selectedListItem,
70
70
  setSelectedListItem,
71
71
  location,
@@ -1 +1 @@
1
- {"version":3,"file":"mapContext.js","sources":["../../src/contexts/mapContext.tsx"],"sourcesContent":["import React, { createContext, useState, useContext, useEffect, useRef, ReactNode } from 'react';\nimport { getStorageObject, setStorageObject } from '~/util/localStorageUtil';\nimport { Listing } from '~/types/Listings';\nimport { LatLng } from '~/types/LatLng';\ninterface IMapContext {\n selectedListItem: Listing | null;\n setSelectedListItem: (item: Listing | null) => void;\n location: any | null;\n setLocation: (location: LatLng | null) => void;\n center: LatLng;\n setCenter: (center: LatLng) => void;\n zoom: number;\n setZoom: (zoom: number) => void;\n selectedPlaces: string[];\n setSelectedPlaces: (places: string[]) => void;\n mapInteracted: boolean;\n setMapInteracted: (interacted: boolean) => void;\n userSetZoom: React.MutableRefObject<boolean>;\n firstLoadListItem: any;\n selectItem: (item: Listing, itemLocation: LatLng | null, zoom: number, center: LatLng) => void;\n filterReset: () => void;\n selectLocationEntity: (location: LatLng) => void;\n\tdefaultZoomOverride?: number | null;\n}\n\nconst MapContext = createContext<IMapContext | undefined>(undefined);\n\nexport const useMap = () => {\n\tconst context = useContext(MapContext);\n\tif (!context) {\n\t\tthrow new Error(\"useMap must be used within a MapProvider\");\n\t}\n\treturn context;\n};\n\ninterface MapProviderProps {\n children: ReactNode;\n resetFilters: boolean;\n\tdefaultZoomOverride?: number | null;\n}\n\nexport const MapProvider: React.FC<MapProviderProps> = ({ children, resetFilters, defaultZoomOverride }) => {\n\tconst [selectedListItem, setSelectedListItem] = useState<Listing | null>(getStorageObject('selectedListItem'));\n\tconst [location, setLocation] = useState<any>(getStorageObject('location'));\n\tconst [center, setCenter] = useState<LatLng>(getStorageObject(\"center\", { lat: 39.8283, lng: -98.5795 }) || { lat: 39.8283, lng: -98.5795 });\n\tconst [zoom, setZoom] = useState<number>(getStorageObject(\"zoom\", 9) || 9);\n\tconst [selectedPlaces, setSelectedPlaces] = useState<string[]>([]);\n\tconst [mapInteracted, setMapInteracted] = useState<boolean>(false);\n\tconst [firstLoadListItem] = useState<any>(getStorageObject('selectedListItem', { id: \"defaultId\" }));\n\tconst userSetZoom = useRef<boolean>(true);\n\n\tuseEffect(() => {\n\t\tsetStorageObject(\"selectedListItem\", selectedListItem);\n\t}, [selectedListItem]);\n\n\tuseEffect(() => {\n\t\tlocalStorage.setItem(\"zoom\", zoom.toString());\n\t}, [zoom]);\n\n\tuseEffect(() => {\n\t\tif (location == null) {\n\t\t\tlocalStorage.removeItem(\"location\");\n\t\t} else {\n\t\t\tsetStorageObject(\"location\", location);\n\t\t}\n\t}, [location]);\n\n\tuseEffect(() => {\n\t\tsetStorageObject(\"center\", center);\n\t}, [center]);\n\n\tconst selectItem = (item: Listing, itemLocation: LatLng | null, zoom: number, center: LatLng) => {\n\t\tsetSelectedListItem(item);\n\t\tif (mapInteracted === false && itemLocation != null) {\n\t\t\tsetLocation(itemLocation);\n\t\t}\n\t\tif (mapInteracted === false || itemLocation != null) {\n\t\t\tsetLocation(itemLocation);\n\t\t\tsetCenter(center);\n\t\t}\n\t\tif (mapInteracted === false) {\n\t\t\tsetZoom(zoom);\n\t\t}\n\t};\n\n\tconst filterReset = () => {\n\t\tsetSelectedPlaces([]);\n\t\tsetSelectedListItem(null);\n\t\tsetLocation(null);\n\t\tsetZoom(8);\n\t\tsetMapInteracted(false);\n\t};\n\n\tuseEffect(() => {\n\t\tif (resetFilters === true) {\n\t\t\tfilterReset();\n\t\t}\n\t}, [resetFilters]);\n\n\tconst selectLocationEntity = (location: LatLng) => {\n\t\tlocalStorage.removeItem(\"selectedListItem\");\n\t\tsetTimeout(() => setLocation(location), 200);\n\t\tsetSelectedListItem(null);\n\t};\n\n\treturn (\n\t\t<MapContext.Provider\n\t\t\tvalue={{\n\t\t\t\tselectedListItem,\n\t\t\t\tsetSelectedListItem,\n\t\t\t\tlocation,\n\t\t\t\tcenter,\n\t\t\t\tsetCenter,\n\t\t\t\tzoom,\n\t\t\t\tsetZoom,\n\t\t\t\tselectItem,\n\t\t\t\tsetSelectedPlaces,\n\t\t\t\tselectedPlaces,\n\t\t\t\tselectLocationEntity,\n\t\t\t\tsetLocation,\n\t\t\t\tsetMapInteracted,\n\t\t\t\tmapInteracted,\n\t\t\t\tuserSetZoom,\n\t\t\t\tfirstLoadListItem,\n\t\t\t\tfilterReset,\n\t\t\t\tdefaultZoomOverride\n\t\t\t}}\n\t\t>\n\t\t\t{children}\n\t\t</MapContext.Provider>\n\t);\n};\n"],"names":["React"],"mappings":";;;AAyBA,MAAM,UAAU,GAAG,aAAa,CAA0B,SAAS,CAAC,CAAC;AAE9D,MAAM,MAAM,GAAG,MAAK;AAC1B,IAAA,MAAM,OAAO,GAAG,UAAU,CAAC,UAAU,CAAC,CAAC;IACvC,IAAI,CAAC,OAAO,EAAE;AACb,QAAA,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC;AAC5D,KAAA;AACD,IAAA,OAAO,OAAO,CAAC;AAChB,EAAE;AAQK,MAAM,WAAW,GAA+B,CAAC,EAAE,QAAQ,EAAE,YAAY,EAAE,mBAAmB,EAAE,KAAI;AAC1G,IAAA,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAG,QAAQ,CAAiB,gBAAgB,CAAC,kBAAkB,CAAC,CAAC,CAAC;AAC/G,IAAA,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAM,gBAAgB,CAAC,UAAU,CAAC,CAAC,CAAC;AAC5E,IAAA,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAS,gBAAgB,CAAC,QAAQ,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC;AAC7I,IAAA,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QA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YAChB,aAAa;YACb,WAAW;YACX,iBAAiB;YACjB,WAAW;YACX,mBAAmB;SACnB,EAEA,EAAA,QAAQ,CACY,EACrB;AACH;;;;"}
1
+ {"version":3,"file":"mapContext.js","sources":["../../src/contexts/mapContext.tsx"],"sourcesContent":["import React, { createContext, useState, useContext, useEffect, useRef, ReactNode } from 'react';\nimport { getStorageObject, setStorageObject } from '~/util/localStorageUtil';\nimport { Listing } from '~/types/Listings';\nimport { LatLng } from '~/types/LatLng';\ninterface IMapContext {\n selectedListItem: Listing | null;\n setSelectedListItem: (item: Listing | null) => void;\n location: any | null;\n setLocation: (location: LatLng | null) => void;\n center: LatLng;\n setCenter: (center: LatLng) => void;\n zoom: number;\n setZoom: (zoom: number) => void;\n selectedPlaces: string[];\n setSelectedPlaces: (places: string[]) => void;\n mapInteracted: boolean;\n setMapInteracted: (interacted: boolean) => void;\n userSetZoom: React.MutableRefObject<boolean>;\n firstLoadListItem: any;\n selectItem: (item: Listing, itemLocation: LatLng | null, zoom: number, center: LatLng) => void;\n filterReset: () => void;\n selectLocationEntity: (location: LatLng) => void;\n\tdefaultZoomOverride?: number | null;\n}\n\nconst MapContext = createContext<IMapContext | undefined>(undefined);\n\nexport const useMap = () => {\n\tconst context = useContext(MapContext);\n\tif (!context) {\n\t\tthrow new Error(\"useMap must be used within a MapProvider\");\n\t}\n\treturn context;\n};\n\ninterface MapProviderProps {\n children: ReactNode;\n resetFilters: boolean;\n\tdefaultZoomOverride?: number | null;\n\tlocalStorageKey?: string;\n}\n\nexport const MapProvider: React.FC<MapProviderProps> = ({ children, resetFilters, defaultZoomOverride, localStorageKey = '' }) => {\n\tconst [selectedListItem, setSelectedListItem] = useState<Listing | null>(getStorageObject(localStorageKey + 'selectedListItem'));\n\tconst [location, setLocation] = useState<any>(getStorageObject(localStorageKey + 'location'));\n\tconst [center, setCenter] = useState<LatLng>(getStorageObject(localStorageKey + \"center\", { lat: 39.8283, lng: -98.5795 }) || { lat: 39.8283, lng: -98.5795 });\n\tconst [zoom, setZoom] = useState<number>(getStorageObject(localStorageKey + \"zoom\", 9) || 9);\n\tconst [selectedPlaces, setSelectedPlaces] = useState<string[]>([]);\n\tconst [mapInteracted, setMapInteracted] = useState<boolean>(false);\n\tconst [firstLoadListItem] = useState<any>(getStorageObject(localStorageKey + 'selectedListItem', { id: \"defaultId\" }));\n\tconst userSetZoom = useRef<boolean>(true);\n\n\tuseEffect(() => {\n\t\tsetStorageObject(localStorageKey + \"selectedListItem\", selectedListItem);\n\t}, [selectedListItem, localStorageKey]);\n\n\tuseEffect(() => {\n\t\tlocalStorage.setItem(localStorageKey + \"zoom\", zoom.toString());\n\t}, [zoom, localStorageKey]);\n\n\tuseEffect(() => {\n\t\tif (location == null) {\n\t\t\tlocalStorage.removeItem(localStorageKey + \"location\");\n\t\t} else {\n\t\t\tsetStorageObject(localStorageKey + \"location\", location);\n\t\t}\n\t}, [location, localStorageKey]);\n\n\tuseEffect(() => {\n\t\tsetStorageObject(localStorageKey + \"center\", center);\n\t}, [center, localStorageKey]);\n\n\tconst selectItem = (item: Listing, itemLocation: LatLng | null, zoom: number, center: LatLng) => {\n\t\tsetSelectedListItem(item);\n\t\tif (mapInteracted === false && itemLocation != null) {\n\t\t\tsetLocation(itemLocation);\n\t\t}\n\t\tif (mapInteracted === false || itemLocation != null) {\n\t\t\tsetLocation(itemLocation);\n\t\t\tsetCenter(center);\n\t\t}\n\t\tif (mapInteracted === false) {\n\t\t\tsetZoom(zoom);\n\t\t}\n\t};\n\n\tconst filterReset = () => {\n\t\tsetSelectedPlaces([]);\n\t\tsetSelectedListItem(null);\n\t\tsetLocation(null);\n\t\tsetZoom(8);\n\t\tsetMapInteracted(false);\n\t};\n\n\tuseEffect(() => {\n\t\tif (resetFilters === true) {\n\t\t\tfilterReset();\n\t\t}\n\t}, [resetFilters]);\n\n\tconst selectLocationEntity = (location: LatLng) => {\n\t\tlocalStorage.removeItem(localStorageKey + \"selectedListItem\");\n\t\tsetTimeout(() => setLocation(location), 200);\n\t\tsetSelectedListItem(null);\n\t};\n\n\treturn (\n\t\t<MapContext.Provider\n\t\t\tvalue={{\n\t\t\t\tselectedListItem,\n\t\t\t\tsetSelectedListItem,\n\t\t\t\tlocation,\n\t\t\t\tcenter,\n\t\t\t\tsetCenter,\n\t\t\t\tzoom,\n\t\t\t\tsetZoom,\n\t\t\t\tselectItem,\n\t\t\t\tsetSelectedPlaces,\n\t\t\t\tselectedPlaces,\n\t\t\t\tselectLocationEntity,\n\t\t\t\tsetLocation,\n\t\t\t\tsetMapInteracted,\n\t\t\t\tmapInteracted,\n\t\t\t\tuserSetZoom,\n\t\t\t\tfirstLoadListItem,\n\t\t\t\tfilterReset,\n\t\t\t\tdefaultZoomOverride\n\t\t\t}}\n\t\t>\n\t\t\t{children}\n\t\t</MapContext.Provider>\n\t);\n};\n"],"names":[],"mappings":";;;AAyBA,MAAM,UAAU,GAAG,aAAa,CAA0B,SAAS,CAAC,CAAC;AAE9D,MAAM,MAAM,GAAG,MAAK;AAC1B,IAAA,MAAM,OAAO,GAAG,UAAU,CAAC,UAAU,CAAC,CAAC;IACvC,IAAI,CAAC,OAAO,EAAE;AACb,QAAA,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC;AAC5D,KAAA;AACD,IAAA,OAAO,OAAO,CAAC;AAChB,EAAE;AASW,MAAA,WAAW,GAA+B,CAAC,EAAE,QAAQ,EAAE,YAAY,EAAE,mBAAmB,EAAE,eAAe,GAAG,EAAE,EAAE,KAAI;AAChI,IAAA,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAG,QAAQ,CAAiB,gBAAgB,CAAC,eAAe,GAAG,kBAAkB,CAAC,CAAC,CAAC;AACjI,IAAA,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAM,gBAAgB,CAAC,eAAe,GAAG,UAAU,CAAC,CAAC,CAAC;AAC9F,IAAA,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,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,kBAAkB,CAAC,CAAC;QAC9D,UAAU,CAAC,MAAM,WAAW,CAAC,QAAQ,CAAC,EAAE,GAAG,CAAC,CAAC;QAC7C,mBAAmB,CAAC,IAAI,CAAC,CAAC;AAC3B,KAAC,CAAC;AAEF,IAAA,QACC,KAAC,CAAA,aAAA,CAAA,UAAU,CAAC,QAAQ,EAAA,EACnB,KAAK,EAAE;YACN,gBAAgB;YAChB,mBAAmB;YACnB,QAAQ;YACR,MAAM;YACN,SAAS;YACT,IAAI;YACJ,OAAO;YACP,UAAU;YACV,iBAAiB;YACjB,cAAc;YACd,oBAAoB;YACpB,WAAW;YACX,gBAAgB;YAChB,aAAa;YACb,WAAW;YACX,iBAAiB;YACjB,WAAW;YACX,mBAAmB;SACnB,EAEA,EAAA,QAAQ,CACY,EACrB;AACH;;;;"}
@@ -1,4 +1,4 @@
1
- import React__default, { createContext, useContext, useState, useEffect } from 'react';
1
+ import React, { createContext, useContext, useState, useEffect } from 'react';
2
2
  import { applyFilters, generateFilterOptions, filterListingsByLocation } from '../util/filterUtil.js';
3
3
  import { getStorageObject, setStorageObject } from '../util/localStorageUtil.js';
4
4
  import { filtersFromURL, updateURLWithFilters } from '../util/urlFilterUtil.js';
@@ -20,7 +20,7 @@ const getQuery = (localStorageKey = '') => {
20
20
  }
21
21
  return query;
22
22
  };
23
- const MapListProvider = ({ children, siteConfig, resetFilters, navigateToDetails, navigateToEasyApply, Link, linkFormat, easyApplyUrl, easyApplyText, isIframe, trackEvent, listings = [], entities = [], setFiltersUrl, hiddenFilters, handleUrlUpdate, defaultFilters, containerStyle, ExpandListComponent, getListingEntitiesCallback, localStorageKey }) => {
23
+ const MapListProvider = ({ children, siteConfig, resetFilters, navigateToDetails, navigateToEasyApply, Link, linkFormat, easyApplyUrl, easyApplyText, isIframe, trackEvent, listings = [], entities = [], setFiltersUrl, hiddenFilters, handleUrlUpdate, defaultFilters, containerStyle, ExpandListComponent, getListingEntitiesCallback, localStorageKey, hideMap = false, hideFilters = false, noEntities = false }) => {
24
24
  const firstLoadFilters = () => {
25
25
  let urlFilters = filtersFromURL(window.location)?.filters;
26
26
  return (setFiltersUrl === true && urlFilters && Object.keys(urlFilters).length > 0) ? urlFilters : getStorageObject(localStorageKey + 'selectedFilters', {}) || {};
@@ -44,7 +44,7 @@ const MapListProvider = ({ children, siteConfig, resetFilters, navigateToDetails
44
44
  const [sortSetting, setSortSetting] = useState(getStorageObject(localStorageKey + 'sortSetting', { field: 'position', type: 'asc' }) || { field: 'position', type: 'asc' });
45
45
  const [listingEntities, setListingEntities] = useState({});
46
46
  const [firstLoad, setFirstLoad] = useState(true);
47
- const [commuteLocation, setCommuteLocation] = useState(getStorageObject('commuteLocation'));
47
+ const [commuteLocation, setCommuteLocation] = useState(getStorageObject(localStorageKey + 'commuteLocation'));
48
48
  const [selectedFilters, setSelectedFilters] = useState(() => resetFilters ? {} : firstLoadFilters());
49
49
  const [filterOptions, setFilterOptions] = useState();
50
50
  const [recruiters, setRecruiters] = useState({});
@@ -60,7 +60,7 @@ const MapListProvider = ({ children, siteConfig, resetFilters, navigateToDetails
60
60
  return;
61
61
  localStorage.setItem(localStorageKey + 'sortSetting', JSON.stringify(sortSetting));
62
62
  setNewFilteredListings(filteredListings);
63
- }, [sortSetting, localStorageKey]);
63
+ }, [sortSetting, localStorageKey, filteredListings]);
64
64
  useEffect(() => {
65
65
  const loadedFavorites = JSON.parse(localStorage.getItem(localStorageKey + 'favorites') || '[]');
66
66
  setFavorites(loadedFavorites);
@@ -69,26 +69,29 @@ const MapListProvider = ({ children, siteConfig, resetFilters, navigateToDetails
69
69
  setStorageObject(localStorageKey + "commuteLocation", commuteLocation);
70
70
  }, [commuteLocation, localStorageKey]);
71
71
  useEffect(() => {
72
- if (!commuteLocation)
72
+ if (!commuteLocation || noEntities)
73
73
  return;
74
74
  async function fetchEntities() {
75
- const distinctEntityIds = [
76
- ...new Set(allListings.map(listing => listing.entityId ?? -1))
77
- ];
78
75
  try {
79
- console.log(getListingEntitiesCallback);
80
- console.log("fetching entities");
81
- const fetchedEntities = getListingEntitiesCallback !== null && getListingEntitiesCallback !== undefined ? await getListingEntitiesCallback(distinctEntityIds, `${commuteLocation.lat}, ${commuteLocation.lng}`) : await getListingEntities(distinctEntityIds, `${commuteLocation.lat}, ${commuteLocation.lng}`);
76
+ let fetchedEntities;
77
+ if (getListingEntitiesCallback) {
78
+ fetchedEntities = await getListingEntitiesCallback(`${commuteLocation.lat}, ${commuteLocation.lng}`);
79
+ }
80
+ else {
81
+ fetchedEntities = await getListingEntities(`${commuteLocation.lat}, ${commuteLocation.lng}`);
82
+ }
82
83
  setListingEntities(fetchedEntities);
83
- const newFilteredListings = [...filteredListings] ?? [];
84
+ // Update travelTime on listings
85
+ const newFilteredListings = [...filteredListings];
84
86
  for (let i = 0; i < allListings.length; i++) {
85
87
  const listing = newFilteredListings[i];
86
88
  if (listing &&
87
89
  listing.fields &&
88
- listing.entityId !== undefined &&
89
- listing.entityId !== -1) {
90
- const entityId = listing.entityId;
91
- const travelTime = fetchedEntities[entityId]?.travelTime;
90
+ listing.fields.entityKey &&
91
+ listing.fields.entityKey !== '') {
92
+ const entityKey = listing.fields.entityKey;
93
+ // Try exact match first, then lowercase match for case-insensitive lookup
94
+ const travelTime = (fetchedEntities[entityKey] || fetchedEntities[entityKey.toLowerCase()])?.travelTime;
92
95
  if (travelTime !== undefined && listing.fields) {
93
96
  listing.fields.travelTime = travelTime;
94
97
  }
@@ -100,14 +103,14 @@ const MapListProvider = ({ children, siteConfig, resetFilters, navigateToDetails
100
103
  }
101
104
  }
102
105
  fetchEntities();
103
- }, [commuteLocation, allListings, siteConfig.companyId]);
106
+ }, [commuteLocation, allListings, siteConfig.companyId, getListingEntitiesCallback, noEntities]);
104
107
  useEffect(() => {
105
108
  const handleFetchListings = async () => {
106
- if (!getStorageObject(localStorageKey + 'listings') ?? [].length) {
109
+ if (!(getStorageObject(localStorageKey + 'listings', []) || []).length) {
107
110
  setLoading(true);
108
111
  }
109
112
  try {
110
- const { listingsResult, fetchedEntities, distinctItems } = await fetchListings(commuteLocation, entities, listings, getListingEntitiesCallback);
113
+ const { listingsResult, entitiesByKey, distinctItems } = await fetchListings(commuteLocation, entities, listings, getListingEntitiesCallback, noEntities);
111
114
  if (defaultFilters) {
112
115
  const filteredListings = listingsResult.filter(listing => {
113
116
  if (!listing.fields)
@@ -123,7 +126,7 @@ const MapListProvider = ({ children, siteConfig, resetFilters, navigateToDetails
123
126
  else {
124
127
  setAllListings(listingsResult);
125
128
  }
126
- setListingEntities(fetchedEntities);
129
+ setListingEntities(entitiesByKey);
127
130
  setMapItems(distinctItems);
128
131
  }
129
132
  catch (error) {
@@ -134,11 +137,11 @@ const MapListProvider = ({ children, siteConfig, resetFilters, navigateToDetails
134
137
  handleFetchListings();
135
138
  }, [query, siteConfig, commuteLocation]);
136
139
  useEffect(() => {
137
- const processListings = () => {
140
+ const processListings = async () => {
138
141
  let filteredListings;
139
142
  let tempSelectedFilters = selectedFilters;
140
143
  let tempQuery = query;
141
- const { mapItems, filteredListings: tempFilteredListings } = applyFilters(allListings, tempSelectedFilters, tempQuery, listingEntities, favorites, siteConfig);
144
+ const { mapItems, filteredListings: tempFilteredListings } = await applyFilters(allListings, tempSelectedFilters, tempQuery, listingEntities, favorites, siteConfig);
142
145
  filteredListings = tempFilteredListings;
143
146
  if (filterByFavorites) {
144
147
  filteredListings = filteredListings.filter((x) => favorites.includes(x.id));
@@ -187,7 +190,7 @@ const MapListProvider = ({ children, siteConfig, resetFilters, navigateToDetails
187
190
  localStorage.setItem(localStorageKey + 'favorites', JSON.stringify(newFavorites));
188
191
  }
189
192
  };
190
- return (React__default.createElement(MapListContext.Provider, { value: {
193
+ return (React.createElement(MapListContext.Provider, { value: {
191
194
  loading,
192
195
  allListings,
193
196
  filteredListings,
@@ -226,7 +229,8 @@ const MapListProvider = ({ children, siteConfig, resetFilters, navigateToDetails
226
229
  defaultFilters,
227
230
  hiddenFilters,
228
231
  containerStyle,
229
- ExpandListComponent
232
+ ExpandListComponent,
233
+ noEntities
230
234
  } }, children));
231
235
  };
232
236
 
@@ -1 +1 @@
1
- {"version":3,"file":"mapListContext.js","sources":["../../src/contexts/mapListContext.tsx"],"sourcesContent":["import React, { createContext, useState, useEffect, useContext, ReactNode } from 'react';\n\nimport { generateFilterOptions, applyFilters, filterListingsByLocation } from '~/util/filterUtil';\nimport { getStorageObject, setStorageObject } from '~/util/localStorageUtil';\nimport { updateURLWithFilters, filtersFromURL } from '~/util/urlFilterUtil';\n\nimport { getListingEntities } from \"~/services/listingEntityService\";\nimport fetchListings from '~/services/listingAggregatorService';\n\nimport { Listing } from '~/types/Listings';\nimport { ListingEntity } from '~/types/ListingEntity';\nimport { Recruiter } from '~/types/Recruiter';\nimport { MapConfig, MapConfig as SiteConfig } from '~/types/config/MapConfig';\nimport { get } from 'http';\n\ninterface MapListContextProps {\n loading: boolean;\n allListings: Listing[];\n filteredListings: Listing[];\n mapItems: any;\n query: string | null;\n setNewFilteredListings: (filteredListings: Listing[]) => void;\n setQuery: (query: string | null) => void;\n listingEntities: Record<number, ListingEntity> | null;\n selectedFilters: Record<string, any>;\n setSelectedFilters: (filters: Record<string, any>) => void;\n filterOptions: any;\n recruiters: Record<number, Recruiter>;\n handleFilterListingsByLocation: (selectedLocation: any) => void;\n filterDialogIsOpen: boolean;\n setFilterDialogIsOpen: (isOpen: boolean) => void;\n setMobileTab: (tab: string) => void;\n mobileTab: string;\n siteConfig: SiteConfig;\n favorites: number[];\n resetEntityFilter: () => void;\n handleSettingFavorites: (favorites: number[] | null) => void;\n setFilterByFavorites: (filter: boolean) => void;\n filterByFavorites: boolean;\n commuteLocation: any | null;\n setCommuteLocation: (location: any | null) => void;\n navigateToDetails: (id: number) => void;\n navigateToEasyApply: (id: number) => void;\n Link: React.ComponentType<any>;\n linkFormat: string;\n easyApplyUrl: string;\n easyApplyText: string;\n\tisIframe: boolean;\n sortSetting: { field: string; type: string };\n setSortSetting: (setting: { field: string; type: string }) => void;\n trackEvent: (event: string) => void;\n defaultFilters?: Record<string, any>;\n hiddenFilters?: string[];\n containerStyle?: any;\n ExpandListComponent?: React.ComponentType<{ listing: any }> | ((listing: any) => JSX.Element) | null;\n}\n\nconst MapListContext = createContext<MapListContextProps | undefined>(undefined);\n\nexport const useMapList = () => {\n\tconst context = useContext(MapListContext);\n\tif (!context) {\n\t\tthrow new Error('useMapList must be used within a MapListProvider');\n\t}\n\treturn context;\n};\n\nconst getQuery = (localStorageKey: string = ''): string | null => {\n\tlet query: string | null = null;\n\tif (typeof window !== 'undefined') {\n\t\tquery = localStorage.getItem(localStorageKey + 'query');\n\t}\n\treturn query;\n};\n\ninterface MapListProviderProps {\n children: ReactNode;\n siteConfig: MapConfig;\n resetFilters: boolean;\n navigateToDetails: (id: number) => void;\n navigateToEasyApply: (id: number) => void;\n Link: React.ComponentType<any>;\n linkFormat: string;\n easyApplyUrl: string;\n easyApplyText: string;\n\tisIframe: boolean;\n trackEvent: (event: string) => void;\n listings?: Listing[];\n\tentities?: ListingEntity[];\n setFiltersUrl?:boolean;\n hiddenFilters?: string[];\n handleUrlUpdate: (searchParams: string) => void;\n defaultFilters?: Record<string, any>;\n containerStyle?: any;\n\tlocalStorageKey: string;\n\tgetListingEntitiesCallback?: (entityIds: number[], origin?: string) => Promise<ListingEntity[]>;\n ExpandListComponent?: React.ComponentType<{ listing: Listing }> | ((listing: Listing) => JSX.Element) | null;\n}\n\nexport const MapListProvider: React.FC<MapListProviderProps> = ({\n\tchildren,\n\tsiteConfig,\n\tresetFilters,\n\tnavigateToDetails,\n\tnavigateToEasyApply,\n\tLink,\n\tlinkFormat,\n\teasyApplyUrl,\n\teasyApplyText,\n\tisIframe,\n\ttrackEvent,\n\tlistings = [],\n\tentities = [],\n\tsetFiltersUrl,\n\thiddenFilters,\n\thandleUrlUpdate,\n\tdefaultFilters,\n\tcontainerStyle,\n\tExpandListComponent,\n\tgetListingEntitiesCallback,\n\tlocalStorageKey\n}) => {\n\tconst firstLoadFilters = () =>{\n\t\tlet urlFilters = filtersFromURL(window.location)?.filters;\n\t\treturn (setFiltersUrl === true && urlFilters && Object.keys(urlFilters).length > 0) ? urlFilters : getStorageObject(localStorageKey + 'selectedFilters', {}) || {}\n\t}\n\t\n\tconst firstLoadQuery = (): string | null => {\n\t\tif (resetFilters) return null;\n\t\t// Check URL first\n\t\tconst urlData = filtersFromURL(window.location);\n\t\tif (setFiltersUrl === true && urlData?.query) {\n\t\t\treturn urlData.query;\n\t\t}\n\t\t// Fall back to localStorage\n\t\treturn getQuery(localStorageKey);\n\t}\n\t\n\tconst [allListings, setAllListings] = useState<Listing[]>([]);\n\tconst [filteredListings, setFilteredListings] = useState<Listing[]>([]);\n\tconst [loading, setLoading] = useState<boolean>(false);\n\tconst [mapItems, setMapItems] = useState<any>(getStorageObject(localStorageKey + 'mapItems', []) || []);\n\tconst [query, setQuery] = useState<string | null>(() => firstLoadQuery());\n\tconst [sortSetting, setSortSetting] = useState<{ field: string; type: string }>(getStorageObject(localStorageKey + 'sortSetting', { field: 'position', type: 'asc' }) || { field: 'position', type: 'asc' });\n\tconst [listingEntities, setListingEntities] = useState<Record<number, ListingEntity> | null>({});\n\tconst [firstLoad, setFirstLoad] = useState<boolean>(true);\n\tconst [commuteLocation, setCommuteLocation] = useState<any | null>(getStorageObject('commuteLocation'));\n\tconst [selectedFilters, setSelectedFilters] = useState<Record<string, any>>(() => resetFilters ? {} : firstLoadFilters());\n\tconst [filterOptions, setFilterOptions] = useState<any>();\n\tconst [recruiters, setRecruiters] = useState<Record<number, Recruiter>>({});\n\tconst [filterDialogIsOpen, setFilterDialogIsOpen] = useState<boolean>(false);\n\tconst [mobileTab, setMobileTab] = useState<string>(\"listTab\");\n\tconst [favorites, setFavorites] = useState<number[]>([]);\n\tconst [filterByFavorites, setFilterByFavorites] = useState<boolean>(false);\n\n\tconst setNewFilteredListings = (filteredListings: Listing[]) => {\n\t\tsetFilteredListings(filteredListings);\n\t};\n\n\tuseEffect(() => {\n\t\tif (!sortSetting) return;\n\t\tlocalStorage.setItem(localStorageKey + 'sortSetting', JSON.stringify(sortSetting));\n\t\tsetNewFilteredListings(filteredListings);\n\t}, [sortSetting, localStorageKey]);\n\n\tuseEffect(() => {\n\t\tconst loadedFavorites = JSON.parse(localStorage.getItem(localStorageKey + 'favorites') || '[]');\n\t\tsetFavorites(loadedFavorites);\n\t}, [localStorageKey]);\n\n\tuseEffect(() => {\n\t\tsetStorageObject(localStorageKey + \"commuteLocation\", commuteLocation);\n\t}, [commuteLocation, localStorageKey]);\n\n\tuseEffect(() => {\n\t\tif (!commuteLocation) return;\n\n\t\tasync function fetchEntities() {\n\t\t\tconst distinctEntityIds = [\n\t\t\t\t...new Set(allListings.map(listing => listing.entityId ?? -1))\n\t\t\t];\n\t\t\ttry {\n\t\t\t\tconsole.log(getListingEntitiesCallback);\n\t\t\t\tconsole.log(\"fetching entities\")\n\t\t\t\tconst fetchedEntities = getListingEntitiesCallback !== null && getListingEntitiesCallback !== undefined ? await getListingEntitiesCallback(distinctEntityIds,\n\t\t\t\t\t`${commuteLocation.lat}, ${commuteLocation.lng}`) : await getListingEntities(\n\t\t\t\t\tdistinctEntityIds,\n\t\t\t\t\t`${commuteLocation.lat}, ${commuteLocation.lng}`\n\t\t\t\t);\n\t\t\t\tsetListingEntities(fetchedEntities);\n\t\t\t\tconst newFilteredListings: Listing[] = [...filteredListings] ?? [];\n\t\t\t\tfor (let i = 0; i < allListings.length; i++) {\n\t\t\t\t\tconst listing = newFilteredListings[i];\n\t\t\t\t\tif (\n\t\t\t\t\t\tlisting &&\n\t\t\t\t\t\tlisting.fields &&\n\t\t\t\t\t\tlisting.entityId !== undefined &&\n\t\t\t\t\t\tlisting.entityId !== -1\n\t\t\t\t\t) {\n\t\t\t\t\t\tconst entityId = listing.entityId;\n\t\t\t\t\t\tconst travelTime = fetchedEntities[entityId]?.travelTime;\n\n\t\t\t\t\t\tif (travelTime !== undefined && listing.fields) {\n\t\t\t\t\t\t\tlisting.fields.travelTime = travelTime;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tconsole.error(\"Failed to fetch listing entities:\", error);\n\t\t\t}\n\t\t}\n\n\t\tfetchEntities();\n\t}, [commuteLocation, allListings, siteConfig.companyId]);\n\n\tuseEffect(() => {\n\t\tconst handleFetchListings = async () => {\n\t\t\tif (!getStorageObject(localStorageKey + 'listings') ?? [].length) {\n\t\t\t\tsetLoading(true);\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tconst {\n\t\t\t\t\tlistingsResult,\n\t\t\t\t\tfetchedEntities,\n\t\t\t\t\tdistinctItems\n\t\t\t\t} = await fetchListings(commuteLocation, entities, listings, getListingEntitiesCallback);\n\t\t\t\tif (defaultFilters) {\n\t\t\t\t\tconst filteredListings = listingsResult.filter(listing => {\n\t\t\t\t\tif (!listing.fields) return false;\n\n\t\t\t\t\treturn Object.keys(defaultFilters).every(filterKey => {\n\t\t\t\t\t\tconst filterValues = defaultFilters[filterKey as keyof typeof defaultFilters];\n\t\t\t\t\t\tconst listingValue = listing.fields ? listing.fields[filterKey as keyof typeof listing.fields] : null;\n\t\t\t\t\t\treturn filterValues.includes(listingValue);\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t\tsetAllListings(filteredListings);\n\t\t\t} else {\n\t\t\t\tsetAllListings(listingsResult);\n\t\t\t}\n\t\t\t\tsetListingEntities(fetchedEntities);\n\t\t\t\tsetMapItems(distinctItems);\n\t\t\t} catch (error) {\n\t\t\t\tconsole.log(error);\n\t\t\t}\n\t\t\tsetLoading(false);\n\t\t};\n\t\thandleFetchListings();\n\t}, [query, siteConfig, commuteLocation]);\n\n\tuseEffect(() => {\n\t\tconst processListings = () => {\n\t\t\tlet filteredListings: Listing[];\n\t\t\tlet tempSelectedFilters = selectedFilters;\n\t\t\tlet tempQuery = query;\n\n\t\t\tconst { mapItems, filteredListings: tempFilteredListings } = applyFilters(\n\t\t\t\tallListings,\n\t\t\t\ttempSelectedFilters,\n\t\t\t\ttempQuery,\n\t\t\t\tlistingEntities,\n\t\t\t\tfavorites,\n\t\t\t\tsiteConfig\n\t\t\t);\n\t\t\tfilteredListings = tempFilteredListings;\n\n\t\t\tif (filterByFavorites) {\n\t\t\t\tfilteredListings = filteredListings.filter((x: Listing) => favorites.includes(x.id));\n\t\t\t}\n\t\t\tsetNewFilteredListings(filteredListings);\n\t\t\tif (firstLoad && tempSelectedFilters) {\n\t\t\t\t// Update URL with filters if needed\n\t\t\t} else if (Object.keys(tempSelectedFilters).length === 0 && !firstLoad) {\n\t\t\t\tlocalStorage.removeItem(localStorageKey + 'selectedFilters');\n\t\t\t} else if (!firstLoad) {\n\t\t\t\tsetStorageObject(localStorageKey + 'selectedFilters', tempSelectedFilters);\n\t\t\t}\n\t\t\tif(setFiltersUrl === true)\n\t\t\t{\n\t\t\t\tupdateURLWithFilters(tempSelectedFilters, window.location, tempQuery, handleUrlUpdate);\n\t\t\t}\n\t\t\ttempQuery != null ? localStorage.setItem(localStorageKey + 'query', tempQuery) : localStorage.removeItem(localStorageKey + 'query');\n\t\t\tsetMapItems(mapItems);\n\n\t\t\tif (tempSelectedFilters) {\n\t\t\t\tconst keys = Object.keys(tempSelectedFilters);\n\t\t\t\tconst lastKey = keys[keys.length - 1];\n\t\t\t\tconst options = generateFilterOptions(\n\t\t\t\t\tfilteredListings,\n\t\t\t\t\tallListings,\n\t\t\t\t\tsiteConfig,\n\t\t\t\t\tfilterOptions,\n\t\t\t\t\tlastKey,\n\t\t\t\t\tfavorites,\n\t\t\t\t\ttempSelectedFilters\n\t\t\t\t);\n\t\t\t\tif (options) {\n\t\t\t\t\tsetFilterOptions(options);\n\t\t\t\t\tif (firstLoad) setFirstLoad(false);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tprocessListings();\n\t}, [selectedFilters, query, listingEntities, filterByFavorites, favorites]);\n\n\tconst handleFilterListingsByLocation = (selectedLocation: any) => {\n\t\tconst { filteredListings } = filterListingsByLocation(\n\t\t\tallListings,\n\t\t\tselectedLocation,\n\t\t\tlistingEntities\n\t\t);\n\t\tsetNewFilteredListings(filteredListings);\n\t};\n\n\tconst resetEntityFilter = () => {\n\t\tlet newFilters = {...selectedFilters};\n\t\tdelete newFilters.entityId;\n\t\tsetSelectedFilters(newFilters);\n\t}\n\n\tconst handleSettingFavorites = (newFavorites: number[] | null) => {\n\t\tif (newFavorites == null) {\n\t\t\tlocalStorage.removeItem(localStorageKey + 'favorites');\n\t\t} else {\n\t\t\tsetFavorites(newFavorites);\n\t\t\tlocalStorage.setItem(localStorageKey + 'favorites', JSON.stringify(newFavorites));\n\t\t}\n\t};\n\n\treturn (\n\t\t<MapListContext.Provider value={{\n\t\t\tloading,\n\t\t\tallListings,\n\t\t\tfilteredListings,\n\t\t\tmapItems,\n\t\t\tquery,\n\t\t\tsetNewFilteredListings,\n\t\t\tsetQuery,\n\t\t\tlistingEntities,\n\t\t\tselectedFilters,\n\t\t\tsetSelectedFilters,\n\t\t\tfilterOptions,\n\t\t\trecruiters,\n\t\t\thandleFilterListingsByLocation,\n\t\t\tfilterDialogIsOpen,\n\t\t\tsetFilterDialogIsOpen,\n\t\t\tsetMobileTab,\n\t\t\tmobileTab,\n\t\t\tsiteConfig,\n\t\t\tfavorites,\n\t\t\thandleSettingFavorites,\n\t\t\tresetEntityFilter,\n\t\t\tsetFilterByFavorites,\n\t\t\tfilterByFavorites,\n\t\t\tcommuteLocation,\n\t\t\tsetCommuteLocation,\n\t\t\tnavigateToDetails,\n\t\t\tnavigateToEasyApply,\n\t\t\tLink,\n\t\t\tlinkFormat,\n\t\t\teasyApplyUrl,\n\t\t\teasyApplyText,\n\t\t\tisIframe,\n\t\t\tsortSetting,\n\t\t\tsetSortSetting,\n\t\t\ttrackEvent,\n\t\t\tdefaultFilters,\n\t\t\thiddenFilters,\n\t\t\tcontainerStyle,\n\t\t\tExpandListComponent\n\t\t}}>\n\t\t\t{children}\n\t\t</MapListContext.Provider>\n\t);\n};\n"],"names":["React"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B,qBAAqB;YACrB,YAAY;YACZ,SAAS;YACT,UAAU;YACV,SAAS;YACT,sBAAsB;YACtB,iBAAiB;YACjB,oBAAoB;YACpB,iBAAiB;YACjB,eAAe;YACf,kBAAkB;YAClB,iBAAiB;YACjB,mBAAmB;YACnB,IAAI;YACJ,UAAU;YACV,YAAY;YACZ,aAAa;YACb,QAAQ;YACR,WAAW;YACX,cAAc;YACd,UAAU;YACV,cAAc;YACd,aAAa;YACb,cAAc;YACd,mBAAmB;SACnB,EACC,EAAA,QAAQ,CACgB,EACzB;AACH;;;;"}
1
+ {"version":3,"file":"mapListContext.js","sources":["../../src/contexts/mapListContext.tsx"],"sourcesContent":["import React, { createContext, useState, useEffect, useContext, ReactNode } from 'react';\n\nimport { generateFilterOptions, applyFilters, filterListingsByLocation } from '~/util/filterUtil';\nimport { getStorageObject, setStorageObject } from '~/util/localStorageUtil';\nimport { updateURLWithFilters, filtersFromURL } from '~/util/urlFilterUtil';\n\nimport { getListingEntities } from \"~/services/listingEntityService\";\nimport fetchListings from '~/services/listingAggregatorService';\n\nimport { Listing } from '~/types/Listings';\nimport { ListingEntity } from '~/types/ListingEntity';\nimport { Recruiter } from '~/types/Recruiter';\nimport { MapConfig, MapConfig as SiteConfig } from '~/types/config/MapConfig';\nimport { get } from 'http';\n\ninterface MapListContextProps {\n loading: boolean;\n allListings: Listing[];\n filteredListings: Listing[];\n mapItems: any;\n query: string | null;\n setNewFilteredListings: (filteredListings: Listing[]) => void;\n setQuery: (query: string | null) => void;\n listingEntities: Record<number, ListingEntity> | null;\n selectedFilters: Record<string, any>;\n setSelectedFilters: (filters: Record<string, any>) => void;\n filterOptions: any;\n recruiters: Record<number, Recruiter>;\n handleFilterListingsByLocation: (selectedLocation: any) => void;\n filterDialogIsOpen: boolean;\n setFilterDialogIsOpen: (isOpen: boolean) => void;\n setMobileTab: (tab: string) => void;\n mobileTab: string;\n siteConfig: SiteConfig;\n favorites: number[];\n resetEntityFilter: () => void;\n handleSettingFavorites: (favorites: number[] | null) => void;\n setFilterByFavorites: (filter: boolean) => void;\n filterByFavorites: boolean;\n commuteLocation: any | null;\n setCommuteLocation: (location: any | null) => void;\n navigateToDetails: (id: number) => void;\n navigateToEasyApply: (id: number) => void;\n Link: React.ComponentType<any>;\n linkFormat: string;\n easyApplyUrl: string;\n easyApplyText: string;\n\tisIframe: boolean;\n sortSetting: { field: string; type: string };\n setSortSetting: (setting: { field: string; type: string }) => void;\n trackEvent: (event: string) => void;\n defaultFilters?: Record<string, any>;\n hiddenFilters?: string[];\n containerStyle?: any;\n ExpandListComponent?: React.ComponentType<{ listing: any }> | ((listing: any) => JSX.Element) | null;\n noEntities?: boolean;\n}\n\nconst MapListContext = createContext<MapListContextProps | undefined>(undefined);\n\nexport const useMapList = () => {\n\tconst context = useContext(MapListContext);\n\tif (!context) {\n\t\tthrow new Error('useMapList must be used within a MapListProvider');\n\t}\n\treturn context;\n};\n\nconst getQuery = (localStorageKey: string = ''): string | null => {\n\tlet query: string | null = null;\n\tif (typeof window !== 'undefined') {\n\t\tquery = localStorage.getItem(localStorageKey + 'query');\n\t}\n\treturn query;\n};\n\ninterface MapListProviderProps {\n children: ReactNode;\n siteConfig: MapConfig;\n resetFilters: boolean;\n navigateToDetails: (id: number) => void;\n navigateToEasyApply: (id: number) => void;\n Link: React.ComponentType<any>;\n linkFormat: string;\n easyApplyUrl: string;\n easyApplyText: string;\n\tisIframe: boolean;\n trackEvent: (event: string) => void;\n listings?: Listing[];\n\tentities?: ListingEntity[];\n setFiltersUrl?:boolean;\n hiddenFilters?: string[];\n handleUrlUpdate: (searchParams: string) => void;\n defaultFilters?: Record<string, any>;\n containerStyle?: any;\n\tlocalStorageKey: string;\n\tgetListingEntitiesCallback?: (origin?: string) => Promise<any>;\n ExpandListComponent?: React.ComponentType<{ listing: Listing }> | ((listing: Listing) => JSX.Element) | null;\n hideMap?: boolean;\n hideFilters?: boolean;\n noEntities?: boolean;\n}\n\nexport const MapListProvider: React.FC<MapListProviderProps> = ({\n\tchildren,\n\tsiteConfig,\n\tresetFilters,\n\tnavigateToDetails,\n\tnavigateToEasyApply,\n\tLink,\n\tlinkFormat,\n\teasyApplyUrl,\n\teasyApplyText,\n\tisIframe,\n\ttrackEvent,\n\tlistings = [],\n\tentities = [],\n\tsetFiltersUrl,\n\thiddenFilters,\n\thandleUrlUpdate,\n\tdefaultFilters,\n\tcontainerStyle,\n\tExpandListComponent,\n\tgetListingEntitiesCallback,\n\tlocalStorageKey,\n\thideMap = false,\n\thideFilters = false,\n\tnoEntities = false\n}) => {\n\tconst firstLoadFilters = () =>{\n\t\tlet urlFilters = filtersFromURL(window.location)?.filters;\n\t\treturn (setFiltersUrl === true && urlFilters && Object.keys(urlFilters).length > 0) ? urlFilters : getStorageObject(localStorageKey + 'selectedFilters', {}) || {}\n\t}\n\n\tconst firstLoadQuery = (): string | null => {\n\t\tif (resetFilters) return null;\n\t\t// Check URL first\n\t\tconst urlData = filtersFromURL(window.location);\n\t\tif (setFiltersUrl === true && urlData?.query) {\n\t\t\treturn urlData.query;\n\t\t}\n\t\t// Fall back to localStorage\n\t\treturn getQuery(localStorageKey);\n\t}\n\n\tconst [allListings, setAllListings] = useState<Listing[]>([]);\n\tconst [filteredListings, setFilteredListings] = useState<Listing[]>([]);\n\tconst [loading, setLoading] = useState<boolean>(false);\n\tconst [mapItems, setMapItems] = useState<any>(getStorageObject(localStorageKey + 'mapItems', []) || []);\n\tconst [query, setQuery] = useState<string | null>(() => firstLoadQuery());\n\tconst [sortSetting, setSortSetting] = useState<{ field: string; type: string }>(getStorageObject(localStorageKey + 'sortSetting', { field: 'position', type: 'asc' }) || { field: 'position', type: 'asc' });\n\tconst [listingEntities, setListingEntities] = useState<Record<number, ListingEntity> | null>({});\n\tconst [firstLoad, setFirstLoad] = useState<boolean>(true);\n\tconst [commuteLocation, setCommuteLocation] = useState<any | null>(getStorageObject(localStorageKey + 'commuteLocation'));\n\tconst [selectedFilters, setSelectedFilters] = useState<Record<string, any>>(() => resetFilters ? {} : firstLoadFilters());\n\tconst [filterOptions, setFilterOptions] = useState<any>();\n\tconst [recruiters, setRecruiters] = useState<Record<number, Recruiter>>({});\n\tconst [filterDialogIsOpen, setFilterDialogIsOpen] = useState<boolean>(false);\n\tconst [mobileTab, setMobileTab] = useState<string>(\"listTab\");\n\tconst [favorites, setFavorites] = useState<number[]>([]);\n\tconst [filterByFavorites, setFilterByFavorites] = useState<boolean>(false);\n\n\tconst setNewFilteredListings = (filteredListings: Listing[]) => {\n\t\tsetFilteredListings(filteredListings);\n\t};\n\n\tuseEffect(() => {\n\t\tif (!sortSetting) return;\n\t\tlocalStorage.setItem(localStorageKey + 'sortSetting', JSON.stringify(sortSetting));\n\t\tsetNewFilteredListings(filteredListings);\n\t}, [sortSetting, localStorageKey, filteredListings]);\n\n\tuseEffect(() => {\n\t\tconst loadedFavorites = JSON.parse(localStorage.getItem(localStorageKey + 'favorites') || '[]');\n\t\tsetFavorites(loadedFavorites);\n\t}, [localStorageKey]);\n\n\tuseEffect(() => {\n\t\tsetStorageObject(localStorageKey + \"commuteLocation\", commuteLocation);\n\t}, [commuteLocation, localStorageKey]);\n\n\n\tuseEffect(() => {\n\t\tif (!commuteLocation || noEntities) return;\n\n\t\tasync function fetchEntities() {\n\t\t\ttry {\n\t\t\t\tlet fetchedEntities;\n\t\t\t\tif (getListingEntitiesCallback) {\n\t\t\t\t\tfetchedEntities = await getListingEntitiesCallback(`${commuteLocation.lat}, ${commuteLocation.lng}`);\n\t\t\t\t} else {\n\t\t\t\t\tfetchedEntities = await getListingEntities(`${commuteLocation.lat}, ${commuteLocation.lng}`);\n\t\t\t\t}\n\t\t\t\tsetListingEntities(fetchedEntities);\n\t\t\t\t// Update travelTime on listings\n\t\t\t\tconst newFilteredListings: Listing[] = [...filteredListings];\n\t\t\t\tfor (let i = 0; i < allListings.length; i++) {\n\t\t\t\t\tconst listing = newFilteredListings[i];\n\t\t\t\t\tif (\n\t\t\t\t\t\tlisting &&\n\t\t\t\t\t\tlisting.fields &&\n\t\t\t\t\t\tlisting.fields.entityKey &&\n\t\t\t\t\t\tlisting.fields.entityKey !== ''\n\t\t\t\t\t) {\n\t\t\t\t\t\tconst entityKey = listing.fields.entityKey;\n\t\t\t\t\t\t// Try exact match first, then lowercase match for case-insensitive lookup\n\t\t\t\t\t\tconst travelTime = (fetchedEntities[entityKey] || fetchedEntities[entityKey.toLowerCase()])?.travelTime;\n\t\t\t\t\t\tif (travelTime !== undefined && listing.fields) {\n\t\t\t\t\t\t\tlisting.fields.travelTime = travelTime;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tconsole.error(\"Failed to fetch listing entities:\", error);\n\t\t\t}\n\t\t}\n\n\t\tfetchEntities();\n\t}, [commuteLocation, allListings, siteConfig.companyId, getListingEntitiesCallback, noEntities]);\n\n\tuseEffect(() => {\n\t\tconst handleFetchListings = async () => {\n\t\tif (!(getStorageObject(localStorageKey + 'listings', []) || []).length) {\n\t\t\tsetLoading(true);\n\t\t}\n\n\t\ttry {\n\t\t\tconst {\n\t\t\t\tlistingsResult,\n\t\t\t\tentitiesByKey,\n\t\t\t\tdistinctItems\n\t\t\t} = await fetchListings(commuteLocation, entities, listings, getListingEntitiesCallback, noEntities);\n\t\t\tif (defaultFilters) {\n\t\t\t\tconst filteredListings = listingsResult.filter(listing => {\n\t\t\t\tif (!listing.fields) return false;\n\n\t\t\t\treturn Object.keys(defaultFilters).every(filterKey => {\n\t\t\t\t\tconst filterValues = defaultFilters[filterKey as keyof typeof defaultFilters];\n\t\t\t\t\tconst listingValue = listing.fields ? listing.fields[filterKey as keyof typeof listing.fields] : null;\n\t\t\t\t\treturn filterValues.includes(listingValue);\n\t\t\t\t});\n\t\t\t});\n\t\t\tsetAllListings(filteredListings);\n\t\t} else {\n\t\t\tsetAllListings(listingsResult);\n\t\t}\n\t\t\tsetListingEntities(entitiesByKey);\n\t\t\t\tsetMapItems(distinctItems);\n\t\t\t} catch (error) {\n\t\t\t\tconsole.log(error);\n\t\t\t}\n\t\t\tsetLoading(false);\n\t\t};\n\t\thandleFetchListings();\n\t}, [query, siteConfig, commuteLocation]);\n\n\tuseEffect(() => {\n\t\tconst processListings = async () => {\n\t\t\tlet filteredListings: Listing[];\n\t\t\tlet tempSelectedFilters = selectedFilters;\n\t\t\tlet tempQuery = query;\n\n\t\t\tconst { mapItems, filteredListings: tempFilteredListings } = await applyFilters(\n\t\t\t\tallListings,\n\t\t\t\ttempSelectedFilters,\n\t\t\t\ttempQuery,\n\t\t\t\tlistingEntities,\n\t\t\t\tfavorites,\n\t\t\t\tsiteConfig\n\t\t\t);\n\t\t\tfilteredListings = tempFilteredListings;\n\n\t\t\tif (filterByFavorites) {\n\t\t\t\tfilteredListings = filteredListings.filter((x: Listing) => favorites.includes(x.id));\n\t\t\t}\n\t\t\tsetNewFilteredListings(filteredListings);\n\t\t\tif (firstLoad && tempSelectedFilters) {\n\t\t\t\t// Update URL with filters if needed\n\t\t\t} else if (Object.keys(tempSelectedFilters).length === 0 && !firstLoad) {\n\t\t\t\tlocalStorage.removeItem(localStorageKey + 'selectedFilters');\n\t\t\t} else if (!firstLoad) {\n\t\t\t\tsetStorageObject(localStorageKey + 'selectedFilters', tempSelectedFilters);\n\t\t\t}\n\t\t\tif(setFiltersUrl === true)\n\t\t\t{\n\t\t\t\tupdateURLWithFilters(tempSelectedFilters, window.location, tempQuery, handleUrlUpdate);\n\t\t\t}\n\t\t\ttempQuery != null ? localStorage.setItem(localStorageKey + 'query', tempQuery) : localStorage.removeItem(localStorageKey + 'query');\n\t\t\tsetMapItems(mapItems);\n\n\t\t\tif (tempSelectedFilters) {\n\t\t\t\tconst keys = Object.keys(tempSelectedFilters);\n\t\t\t\tconst lastKey = keys[keys.length - 1];\n\t\t\t\tconst options = generateFilterOptions(\n\t\t\t\t\tfilteredListings,\n\t\t\t\t\tallListings,\n\t\t\t\t\tsiteConfig,\n\t\t\t\t\tfilterOptions,\n\t\t\t\t\tlastKey,\n\t\t\t\t\tfavorites,\n\t\t\t\t\ttempSelectedFilters\n\t\t\t\t);\n\t\t\t\tif (options) {\n\t\t\t\t\tsetFilterOptions(options);\n\t\t\t\t\tif (firstLoad) setFirstLoad(false);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tprocessListings();\n\t}, [selectedFilters, query, listingEntities, filterByFavorites, favorites]);\n\n\tconst handleFilterListingsByLocation = (selectedLocation: any) => {\n\t\tconst { filteredListings } = filterListingsByLocation(\n\t\t\tallListings,\n\t\t\tselectedLocation,\n\t\t\tlistingEntities\n\t\t);\n\t\tsetNewFilteredListings(filteredListings);\n\t};\n\n\tconst resetEntityFilter = () => {\n\t\tlet newFilters = {...selectedFilters};\n\t\tdelete newFilters.entityId;\n\t\tsetSelectedFilters(newFilters);\n\t}\n\n\tconst handleSettingFavorites = (newFavorites: number[] | null) => {\n\t\tif (newFavorites == null) {\n\t\t\tlocalStorage.removeItem(localStorageKey + 'favorites');\n\t\t} else {\n\t\t\tsetFavorites(newFavorites);\n\t\t\tlocalStorage.setItem(localStorageKey + 'favorites', JSON.stringify(newFavorites));\n\t\t}\n\t};\n\n\treturn (\n\t\t<MapListContext.Provider value={{\n\t\t\tloading,\n\t\t\tallListings,\n\t\t\tfilteredListings,\n\t\t\tmapItems,\n\t\t\tquery,\n\t\t\tsetNewFilteredListings,\n\t\t\tsetQuery,\n\t\t\tlistingEntities,\n\t\t\tselectedFilters,\n\t\t\tsetSelectedFilters,\n\t\t\tfilterOptions,\n\t\t\trecruiters,\n\t\t\thandleFilterListingsByLocation,\n\t\t\tfilterDialogIsOpen,\n\t\t\tsetFilterDialogIsOpen,\n\t\t\tsetMobileTab,\n\t\t\tmobileTab,\n\t\t\tsiteConfig,\n\t\t\tfavorites,\n\t\t\thandleSettingFavorites,\n\t\t\tresetEntityFilter,\n\t\t\tsetFilterByFavorites,\n\t\t\tfilterByFavorites,\n\t\t\tcommuteLocation,\n\t\t\tsetCommuteLocation,\n\t\t\tnavigateToDetails,\n\t\t\tnavigateToEasyApply,\n\t\t\tLink,\n\t\t\tlinkFormat,\n\t\t\teasyApplyUrl,\n\t\t\teasyApplyText,\n\t\t\tisIframe,\n\t\t\tsortSetting,\n\t\t\tsetSortSetting,\n\t\t\ttrackEvent,\n\t\t\tdefaultFilters,\n\t\t\thiddenFilters,\n\t\t\tcontainerStyle,\n\t\t\tExpandListComponent,\n\t\t\tnoEntities\n\t\t}}>\n\t\t\t{children}\n\t\t</MapListContext.Provider>\n\t);\n};\n"],"names":[],"mappings":";;;;;;;AA0DA,MAAM,cAAc,GAAG,aAAa,CAAkC,SAAS,CAAC,CAAC;AAE1E,MAAM,UAAU,GAAG,MAAK;AAC9B,IAAA,MAAM,OAAO,GAAG,UAAU,CAAC,cAAc,CAAC,CAAC;IAC3C,IAAI,CAAC,OAAO,EAAE;AACb,QAAA,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC;AACpE,KAAA;AACD,IAAA,OAAO,OAAO,CAAC;AAChB,EAAE;AAEF,MAAM,QAAQ,GAAG,CAAC,eAA0B,GAAA,EAAE,KAAmB;IAChE,IAAI,KAAK,GAAkB,IAAI,CAAC;AAChC,IAAA,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;QAClC,KAAK,GAAG,YAAY,CAAC,OAAO,CAAC,eAAe,GAAG,OAAO,CAAC,CAAC;AACxD,KAAA;AACD,IAAA,OAAO,KAAK,CAAC;AACd,CAAC,CAAC;AA6BK,MAAM,eAAe,GAAmC,CAAC,EAC/D,QAAQ,EACR,UAAU,EACV,YAAY,EACZ,iBAAiB,EACjB,mBAAmB,EACnB,IAAI,EACJ,UAAU,EACV,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,UAAU,EACV,QAAQ,GAAG,EAAE,EACb,QAAQ,GAAG,EAAE,EACb,aAAa,EACb,aAAa,EACb,eAAe,EACf,cAAc,EACd,cAAc,EACd,mBAAmB,EACnB,0BAA0B,EAC1B,eAAe,EACf,OAAO,GAAG,KAAK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CAAC,YAAY,CAAC,CAAC,CAAC;AAClF,SAAA;AACF,KAAC,CAAC;AAEF,IAAA,QACC,KAAC,CAAA,aAAA,CAAA,cAAc,CAAC,QAAQ,EAAA,EAAC,KAAK,EAAE;YAC/B,OAAO;YACP,WAAW;YACX,gBAAgB;YAChB,QAAQ;YACR,KAAK;YACL,sBAAsB;YACtB,QAAQ;YACR,eAAe;YACf,eAAe;YACf,kBAAkB;YAClB,aAAa;YACb,UAAU;YACV,8BAA8B;YAC9B,kBAAkB;YAClB,qBAAqB;YACrB,YAAY;YACZ,SAAS;YACT,UAAU;YACV,SAAS;YACT,sBAAsB;YACtB,iBAAiB;YACjB,oBAAoB;YACpB,iBAAiB;YACjB,eAAe;YACf,kBAAkB;YAClB,iBAAiB;YACjB,mBAAmB;YACnB,IAAI;YACJ,UAAU;YACV,YAAY;YACZ,aAAa;YACb,QAAQ;YACR,WAAW;YACX,cAAc;YACd,UAAU;YACV,cAAc;YACd,aAAa;YACb,cAAc;YACd,mBAAmB;YACnB,UAAU;SACV,EACC,EAAA,QAAQ,CACgB,EACzB;AACH;;;;"}
@@ -1,5 +1,5 @@
1
1
  import { slicedToArray as _slicedToArray, asyncToGenerator as _asyncToGenerator, regeneratorRuntime as _regeneratorRuntime, createForOfIteratorHelper as _createForOfIteratorHelper } from '../_virtual/_rollupPluginBabelHelpers.js';
2
- import React__default, { useState, useCallback, useEffect, createContext, useContext } from 'react';
2
+ import React, { useState, useCallback, useEffect, createContext, useContext } from 'react';
3
3
  import { markerIconProps } from '../util/mapIconUtil.js';
4
4
  import { useMap } from './mapContext.js';
5
5
  import { searchNearbyPlaces } from '../services/googlePlacesNearbyService.js';
@@ -135,7 +135,7 @@ var PlacesProvider = function PlacesProvider(_ref) {
135
135
  }();
136
136
  fetchPlaces();
137
137
  }, [selectedPlaces, currentZoom, currentCenter, placeMappings, markerColors.placeMarkers, googleMapsApiKey, getRadiusForZoom, center]);
138
- return /*#__PURE__*/React__default.createElement(PlacesContext.Provider, {
138
+ return /*#__PURE__*/React.createElement(PlacesContext.Provider, {
139
139
  value: {
140
140
  poiMarkers: poiMarkers,
141
141
  setCurrentCenter: setCurrentCenter,
@@ -1 +1 @@
1
- {"version":3,"file":"placesContext.js","sources":["../../src/contexts/placesContext.js"],"sourcesContent":["import React, { createContext, useContext, useEffect, useState, useCallback } from 'react';\n\nimport { markerIconProps } from '~/util/mapIconUtil';\n\nimport { useMap } from '~/contexts/mapContext';\n\nimport { searchNearbyPlaces } from '~/services/googlePlacesNearbyService';\n\nconst PlacesContext = createContext();\n\nexport const usePlaces = () => useContext(PlacesContext);\n\nexport const PlacesProvider = ({ children, placeMappings, markerColors, additionalMapMarkers, googleMapsApiKey }) => {\n\tconst { selectedPlaces, zoom, center } = useMap();\n\tconst [poiMarkers, setPoiMarkers] = useState({ markers: [], icon: null });\n\tconst [currentCenter, setCurrentCenter] = useState(center);\n\tconst [currentZoom, setCurrentZoom] = useState(zoom);\n\tconst [placesWindow, setPlacesWindow] = useState(false);\n\tconst [selectedPlaceMarker, setSelectedPlaceMarker] = useState(null);\n\n\tconst getRadiusForZoom = useCallback(() => {\n\t\tif (currentZoom >= 18) return 1000;\n\t\tif (currentZoom <= 10) return 0;\n\n\t\tlet tempZoom = Math.pow(19 - currentZoom, 4.85);\n\t\tlet radius = tempZoom;\n\t\tlet minRadius = 1500;\n\t\tlet maxRadius = 800000;\n\n\t\tif (radius < minRadius) radius = minRadius;\n\t\telse if (radius > maxRadius) radius = maxRadius;\n\n\t\treturn radius;\n\t}, [currentZoom]);\n\n\tuseEffect(() => {\n\t\tif (!selectedPlaces || (!selectedPlaces.length > 0) || !center || currentZoom < 12) {\n\t\t\tsetPoiMarkers({ markers: [], icon: null });\n\t\t\treturn;\n\t\t}\n\t\tconst fetchPlaces = async () => {\n\t\t\tlet poiTypes = [];\n\t\t\tconst selectedPOICategories = selectedPlaces;\n\t\t\tselectedPOICategories.forEach(pointOfInterest => {\n\t\t\t\tpoiTypes = poiTypes.concat(placeMappings[pointOfInterest]);\n\t\t\t});\n\n\t\t\tconst radius = getRadiusForZoom();\n\t\t\tconst location = { latitude: currentCenter.lat, longitude: currentCenter.lng };\n\n\t\t\ttry {\n\t\t\t\tconst response = await searchNearbyPlaces(poiTypes, location, radius, googleMapsApiKey || process.env.GOOGLE_MAPS_API_KEY);\n\t\t\t\tconst newMarkers = response.places.map(place => {\n\t\t\t\t\tconst getParentCategory = types => {\n\t\t\t\t\t\tconst selectedTypes = selectedPOICategories.reduce((acc, category) => {\n\t\t\t\t\t\t\treturn acc.concat(placeMappings[category]);\n\t\t\t\t\t\t}, []);\n\n\t\t\t\t\t\tfor (const type of types) {\n\t\t\t\t\t\t\tif (!selectedTypes.includes(type)) continue;\n\t\t\t\t\t\t\tfor (const category in placeMappings) {\n\t\t\t\t\t\t\t\tif (placeMappings[category].includes(type)) {\n\t\t\t\t\t\t\t\t\treturn category;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\n\t\t\t\t\tconst icon = markerIconProps(markerColors.placeMarkers, getParentCategory(place.types));\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\tposition: { lat: place.location.latitude, lng: place.location.longitude },\n\t\t\t\t\t\ttitle: place.displayName.text,\n\t\t\t\t\t\ticon: icon\n\t\t\t\t\t};\n\t\t\t\t});\n\t\t\t\tsetPoiMarkers({ markers: newMarkers, icon: null });\n\t\t\t} catch (error) {\n\t\t\t\tconsole.error('Failed to fetch places:', error);\n\t\t\t}\n\t\t};\n\n\t\tfetchPlaces();\n\t}, [selectedPlaces, currentZoom, currentCenter, placeMappings, markerColors.placeMarkers, googleMapsApiKey, getRadiusForZoom, center]);\n\n\treturn (\n\t\t<PlacesContext.Provider value={{\n\t\t\tpoiMarkers,\n\t\t\tsetCurrentCenter,\n\t\t\tcurrentCenter,\n\t\t\tsetCurrentZoom,\n\t\t\tcurrentZoom,\n\t\t\tplacesWindow,\n\t\t\tsetPlacesWindow,\n\t\t\tselectedPlaceMarker,\n\t\t\tsetSelectedPlaceMarker,\n\t\t\tadditionalMapMarkers\n\t\t}}>\n\t\t\t{children}\n\t\t</PlacesContext.Provider>\n\t);\n};\n"],"names":["PlacesContext","createContext","usePlaces","useContext","PlacesProvider","_ref","children","placeMappings","markerColors","additionalMapMarkers","googleMapsApiKey","_useMap","useMap","selectedPlaces","zoom","center","_useState","useState","markers","icon","_useState2","_slicedToArray","poiMarkers","setPoiMarkers","_useState3","_useState4","currentCenter","setCurrentCenter","_useState5","_useState6","currentZoom","setCurrentZoom","_useState7","_useState8","placesWindow","setPlacesWindow","_useState9","_useState10","selectedPlaceMarker","setSelectedPlaceMarker","getRadiusForZoom","useCallback","tempZoom","Math","pow","radius","minRadius","maxRadius","useEffect","length","fetchPlaces","_ref2","_asyncToGenerator","_regeneratorRuntime","mark","_callee","poiTypes","selectedPOICategories","location","response","newMarkers","wrap","_callee$","_context","prev","next","forEach","pointOfInterest","concat","latitude","lat","longitude","lng","searchNearbyPlaces","process","env","GOOGLE_MAPS_API_KEY","sent","places","map","place","getParentCategory","types","selectedTypes","reduce","acc","category","_iterator","_createForOfIteratorHelper","_step","s","n","done","type","value","includes","err","e","f","markerIconProps","placeMarkers","position","title","displayName","text","t0","console","error","stop","apply","arguments","React","createElement","Provider"],"mappings":";;;;;;AAQA,IAAMA,aAAa,gBAAGC,aAAa,EAAE,CAAA;AAExBC,IAAAA,SAAS,GAAG,SAAZA,SAASA,GAAA;EAAA,OAASC,UAAU,CAACH,aAAa,CAAC,CAAA;AAAA,EAAA;IAE3CI,cAAc,GAAG,SAAjBA,cAAcA,CAAAC,IAAA,EAA0F;AAAA,EAAA,IAApFC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IAAEC,aAAa,GAAAF,IAAA,CAAbE,aAAa;IAAEC,YAAY,GAAAH,IAAA,CAAZG,YAAY;IAAEC,oBAAoB,GAAAJ,IAAA,CAApBI,oBAAoB;IAAEC,gBAAgB,GAAAL,IAAA,CA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,EAAVA,UAAU;AACVK,MAAAA,gBAAgB,EAAhBA,gBAAgB;AAChBD,MAAAA,aAAa,EAAbA,aAAa;AACbK,MAAAA,cAAc,EAAdA,cAAc;AACdD,MAAAA,WAAW,EAAXA,WAAW;AACXI,MAAAA,YAAY,EAAZA,YAAY;AACZC,MAAAA,eAAe,EAAfA,eAAe;AACfG,MAAAA,mBAAmB,EAAnBA,mBAAmB;AACnBC,MAAAA,sBAAsB,EAAtBA,sBAAsB;AACtB9B,MAAAA,oBAAoB,EAApBA,oBAAAA;AACD,KAAA;AAAE,GAAA,EACAH,QACsB,CAAC,CAAA;AAE3B;;;;"}
1
+ {"version":3,"file":"placesContext.js","sources":["../../src/contexts/placesContext.js"],"sourcesContent":["import React, { createContext, useContext, useEffect, useState, useCallback } from 'react';\n\nimport { markerIconProps } from '~/util/mapIconUtil';\n\nimport { useMap } from '~/contexts/mapContext';\n\nimport { searchNearbyPlaces } from '~/services/googlePlacesNearbyService';\n\nconst PlacesContext = createContext();\n\nexport const usePlaces = () => useContext(PlacesContext);\n\nexport const PlacesProvider = ({ children, placeMappings, markerColors, additionalMapMarkers, googleMapsApiKey }) => {\n\tconst { selectedPlaces, zoom, center } = useMap();\n\tconst [poiMarkers, setPoiMarkers] = useState({ markers: [], icon: null });\n\tconst [currentCenter, setCurrentCenter] = useState(center);\n\tconst [currentZoom, setCurrentZoom] = useState(zoom);\n\tconst [placesWindow, setPlacesWindow] = useState(false);\n\tconst [selectedPlaceMarker, setSelectedPlaceMarker] = useState(null);\n\n\tconst getRadiusForZoom = useCallback(() => {\n\t\tif (currentZoom >= 18) return 1000;\n\t\tif (currentZoom <= 10) return 0;\n\n\t\tlet tempZoom = Math.pow(19 - currentZoom, 4.85);\n\t\tlet radius = tempZoom;\n\t\tlet minRadius = 1500;\n\t\tlet maxRadius = 800000;\n\n\t\tif (radius < minRadius) radius = minRadius;\n\t\telse if (radius > maxRadius) radius = maxRadius;\n\n\t\treturn radius;\n\t}, [currentZoom]);\n\n\tuseEffect(() => {\n\t\tif (!selectedPlaces || (!selectedPlaces.length > 0) || !center || currentZoom < 12) {\n\t\t\tsetPoiMarkers({ markers: [], icon: null });\n\t\t\treturn;\n\t\t}\n\t\tconst fetchPlaces = async () => {\n\t\t\tlet poiTypes = [];\n\t\t\tconst selectedPOICategories = selectedPlaces;\n\t\t\tselectedPOICategories.forEach(pointOfInterest => {\n\t\t\t\tpoiTypes = poiTypes.concat(placeMappings[pointOfInterest]);\n\t\t\t});\n\n\t\t\tconst radius = getRadiusForZoom();\n\t\t\tconst location = { latitude: currentCenter.lat, longitude: currentCenter.lng };\n\n\t\t\ttry {\n\t\t\t\tconst response = await searchNearbyPlaces(poiTypes, location, radius, googleMapsApiKey || process.env.GOOGLE_MAPS_API_KEY);\n\t\t\t\tconst newMarkers = response.places.map(place => {\n\t\t\t\t\tconst getParentCategory = types => {\n\t\t\t\t\t\tconst selectedTypes = selectedPOICategories.reduce((acc, category) => {\n\t\t\t\t\t\t\treturn acc.concat(placeMappings[category]);\n\t\t\t\t\t\t}, []);\n\n\t\t\t\t\t\tfor (const type of types) {\n\t\t\t\t\t\t\tif (!selectedTypes.includes(type)) continue;\n\t\t\t\t\t\t\tfor (const category in placeMappings) {\n\t\t\t\t\t\t\t\tif (placeMappings[category].includes(type)) {\n\t\t\t\t\t\t\t\t\treturn category;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\n\t\t\t\t\tconst icon = markerIconProps(markerColors.placeMarkers, getParentCategory(place.types));\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\tposition: { lat: place.location.latitude, lng: place.location.longitude },\n\t\t\t\t\t\ttitle: place.displayName.text,\n\t\t\t\t\t\ticon: icon\n\t\t\t\t\t};\n\t\t\t\t});\n\t\t\t\tsetPoiMarkers({ markers: newMarkers, icon: null });\n\t\t\t} catch (error) {\n\t\t\t\tconsole.error('Failed to fetch places:', error);\n\t\t\t}\n\t\t};\n\n\t\tfetchPlaces();\n\t}, [selectedPlaces, currentZoom, currentCenter, placeMappings, markerColors.placeMarkers, googleMapsApiKey, getRadiusForZoom, center]);\n\n\treturn (\n\t\t<PlacesContext.Provider value={{\n\t\t\tpoiMarkers,\n\t\t\tsetCurrentCenter,\n\t\t\tcurrentCenter,\n\t\t\tsetCurrentZoom,\n\t\t\tcurrentZoom,\n\t\t\tplacesWindow,\n\t\t\tsetPlacesWindow,\n\t\t\tselectedPlaceMarker,\n\t\t\tsetSelectedPlaceMarker,\n\t\t\tadditionalMapMarkers\n\t\t}}>\n\t\t\t{children}\n\t\t</PlacesContext.Provider>\n\t);\n};\n"],"names":["PlacesContext","createContext","usePlaces","useContext","PlacesProvider","_ref","children","placeMappings","markerColors","additionalMapMarkers","googleMapsApiKey","_useMap","useMap","selectedPlaces","zoom","center","_useState","useState","markers","icon","_useState2","_slicedToArray","poiMarkers","setPoiMarkers","_useState3","_useState4","currentCenter","setCurrentCenter","_useState5","_useState6","currentZoom","setCurrentZoom","_useState7","_useState8","placesWindow","setPlacesWindow","_useState9","_useState10","selectedPlaceMarker","setSelectedPlaceMarker","getRadiusForZoom","useCallback","tempZoom","Math","pow","radius","minRadius","maxRadius","useEffect","length","fetchPlaces","_ref2","_asyncToGenerator","_regeneratorRuntime","mark","_callee","poiTypes","selectedPOICategories","location","response","newMarkers","wrap","_callee$","_context","prev","next","forEach","pointOfInterest","concat","latitude","lat","longitude","lng","searchNearbyPlaces","process","env","GOOGLE_MAPS_API_KEY","sent","places","map","place","getParentCategory","types","selectedTypes","reduce","acc","category","_iterator","_createForOfIteratorHelper","_step","s","n","done","type","value","includes","err","e","f","markerIconProps","placeMarkers","position","title","displayName","text","t0","console","error","stop","apply","arguments","React","createElement","Provider"],"mappings":";;;;;;AAQA,IAAMA,aAAa,gBAAGC,aAAa,EAAE,CAAA;AAExBC,IAAAA,SAAS,GAAG,SAAZA,SAASA,GAAA;EAAA,OAASC,UAAU,CAACH,aAAa,CAAC,CAAA;A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AE,CAACrC,cAAc,EAAEiB,WAAW,EAAEJ,aAAa,EAAEnB,aAAa,EAAEC,YAAY,CAAC4F,YAAY,EAAE1F,gBAAgB,EAAE8B,gBAAgB,EAAEzB,MAAM,CAAC,CAAC,CAAA;AAEtI,EAAA,oBACCgG,KAAA,CAAAC,aAAA,CAAChH,aAAa,CAACiH,QAAQ,EAAA;AAACnB,IAAAA,KAAK,EAAE;AAC9BxE,MAAAA,UAAU,EAAVA,UAAU;AACVK,MAAAA,gBAAgB,EAAhBA,gBAAgB;AAChBD,MAAAA,aAAa,EAAbA,aAAa;AACbK,MAAAA,cAAc,EAAdA,cAAc;AACdD,MAAAA,WAAW,EAAXA,WAAW;AACXI,MAAAA,YAAY,EAAZA,YAAY;AACZC,MAAAA,eAAe,EAAfA,eAAe;AACfG,MAAAA,mBAAmB,EAAnBA,mBAAmB;AACnBC,MAAAA,sBAAsB,EAAtBA,sBAAsB;AACtB9B,MAAAA,oBAAoB,EAApBA,oBAAAA;AACD,KAAA;AAAE,GAAA,EACAH,QACsB,CAAC,CAAA;AAE3B;;;;"}
@@ -1,4 +1,4 @@
1
- import React__default, { useEffect, createContext } from 'react';
1
+ import React, { useEffect, createContext } from 'react';
2
2
 
3
3
  var ThemeContext = /*#__PURE__*/createContext();
4
4
  var ThemeProvider = function ThemeProvider(_ref) {
@@ -17,7 +17,7 @@ var ThemeProvider = function ThemeProvider(_ref) {
17
17
  document.documentElement.style.setProperty('--secondary', secondary);
18
18
  document.documentElement.style.setProperty('--secondary-dark', secondaryDark);
19
19
  }, [uiText, uiAccent, primary, primaryDark, secondary, secondaryDark]);
20
- return /*#__PURE__*/React__default.createElement(ThemeContext.Provider, {
20
+ return /*#__PURE__*/React.createElement(ThemeContext.Provider, {
21
21
  value: {
22
22
  uiText: uiText,
23
23
  uiAccent: uiAccent,
@@ -1 +1 @@
1
- {"version":3,"file":"themeContext.js","sources":["../../src/contexts/themeContext.js"],"sourcesContent":["import React, { useEffect } from 'react';\nimport { createContext, useContext } from 'react';\n\nconst ThemeContext = createContext();\n\nexport const ThemeProvider = ({\n\tchildren,\n\tuiText,\n\tuiAccent,\n\tprimary,\n\tprimaryDark,\n\tsecondary,\n\tsecondaryDark\n}) => {\n\tuseEffect(() => {\n\t\tdocument.documentElement.style.setProperty('--ui-text', uiText);\n\t\tdocument.documentElement.style.setProperty('--ui-accent', uiAccent);\n\t\tdocument.documentElement.style.setProperty('--primary', primary);\n\t\tdocument.documentElement.style.setProperty('--primary-dark', primaryDark);\n\t\tdocument.documentElement.style.setProperty('--secondary', secondary);\n\t\tdocument.documentElement.style.setProperty('--secondary-dark', secondaryDark);\n\t}, [uiText, uiAccent, primary, primaryDark, secondary, secondaryDark]);\n\n\treturn (\n\t\t<ThemeContext.Provider\n\t\t\tvalue={{\n\t\t\t\tuiText,\n\t\t\t\tuiAccent,\n\t\t\t\tprimary,\n\t\t\t\tprimaryDark,\n\t\t\t\tsecondary,\n\t\t\t\tsecondaryDark\n\t\t\t}}\n\t\t>\n\t\t\t{children}\n\t\t</ThemeContext.Provider>\n\t);\n};\n\nexport const useTheme = () => useContext(ThemeContext);\n"],"names":["ThemeContext","createContext","ThemeProvider","_ref","children","uiText","uiAccent","primary","primaryDark","secondary","secondaryDark","useEffect","document","documentElement","style","setProperty","React","createElement","Provider","value"],"mappings":";;AAGA,IAAMA,YAAY,gBAAGC,aAAa,EAAE,CAAA;IAEvBC,aAAa,GAAG,SAAhBA,aAAaA,CAAAC,IAAA,EAQpB;AAAA,EAAA,IAPLC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IACRC,MAAM,GAAAF,IAAA,CAANE,MAAM;IACNC,QAAQ,GAAAH,IAAA,CAARG,QAAQ;IACRC,OAAO,GAAAJ,IAAA,CAAPI,OAAO;IACPC,WAAW,GAAAL,IAAA,CAAXK,WAAW;IACXC,SAAS,GAAAN,IAAA,CAATM,SAAS;IACTC,aAAa,GAAAP,IAAA,CAAbO,aAAa,CAAA;AAEbC,EAAAA,SAAS,CAAC,YAAM;IACfC,QAAQ,CAACC,eAAe,CAACC,KAAK,CAACC,WAAW,CAAC,WAAW,EAAEV,MAAM,CAAC,CAAA;IAC/DO,QAAQ,CAACC,eAAe,CAACC,KAAK,CAACC,WAAW,CAAC,aAAa,EAAET,QAAQ,CAAC,CAAA;IACnEM,QAAQ,CAACC,eAAe,CAACC,KAAK,CAACC,WAAW,CAAC,WAAW,EAAER,OAAO,CAAC,CAAA;IAChEK,QAAQ,CAACC,eAAe,CAACC,KAAK,CAACC,WAAW,CAAC,gBAAgB,EAAEP,WAAW,CAAC,CAAA;IACzEI,QAAQ,CAACC,eAAe,CAACC,KAAK,CAACC,WAAW,CAAC,aAAa,EAAEN,SAAS,CAAC,CAAA;IACpEG,QAAQ,CAACC,eAAe,CAACC,KAAK,CAACC,WAAW,CAAC,kBAAkB,EAAEL,aAAa,CAAC,CAAA;AAC9E,GAAC,EAAE,CAACL,MAAM,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,WAAW,EAAEC,SAAS,EAAEC,aAAa,CAAC,CAAC,CAAA;AAEtE,EAAA,oBACCM,cAAA,CAAAC,aAAA,CAACjB,YAAY,CAACkB,QAAQ,EAAA;AACrBC,IAAAA,KAAK,EAAE;AACNd,MAAAA,MAAM,EAANA,MAAM;AACNC,MAAAA,QAAQ,EAARA,QAAQ;AACRC,MAAAA,OAAO,EAAPA,OAAO;AACPC,MAAAA,WAAW,EAAXA,WAAW;AACXC,MAAAA,SAAS,EAATA,SAAS;AACTC,MAAAA,aAAa,EAAbA,aAAAA;AACD,KAAA;AAAE,GAAA,EAEDN,QACqB,CAAC,CAAA;AAE1B;;;;"}
1
+ {"version":3,"file":"themeContext.js","sources":["../../src/contexts/themeContext.js"],"sourcesContent":["import React, { useEffect } from 'react';\nimport { createContext, useContext } from 'react';\n\nconst ThemeContext = createContext();\n\nexport const ThemeProvider = ({\n\tchildren,\n\tuiText,\n\tuiAccent,\n\tprimary,\n\tprimaryDark,\n\tsecondary,\n\tsecondaryDark\n}) => {\n\tuseEffect(() => {\n\t\tdocument.documentElement.style.setProperty('--ui-text', uiText);\n\t\tdocument.documentElement.style.setProperty('--ui-accent', uiAccent);\n\t\tdocument.documentElement.style.setProperty('--primary', primary);\n\t\tdocument.documentElement.style.setProperty('--primary-dark', primaryDark);\n\t\tdocument.documentElement.style.setProperty('--secondary', secondary);\n\t\tdocument.documentElement.style.setProperty('--secondary-dark', secondaryDark);\n\t}, [uiText, uiAccent, primary, primaryDark, secondary, secondaryDark]);\n\n\treturn (\n\t\t<ThemeContext.Provider\n\t\t\tvalue={{\n\t\t\t\tuiText,\n\t\t\t\tuiAccent,\n\t\t\t\tprimary,\n\t\t\t\tprimaryDark,\n\t\t\t\tsecondary,\n\t\t\t\tsecondaryDark\n\t\t\t}}\n\t\t>\n\t\t\t{children}\n\t\t</ThemeContext.Provider>\n\t);\n};\n\nexport const useTheme = () => useContext(ThemeContext);\n"],"names":["ThemeContext","createContext","ThemeProvider","_ref","children","uiText","uiAccent","primary","primaryDark","secondary","secondaryDark","useEffect","document","documentElement","style","setProperty","React","createElement","Provider","value"],"mappings":";;AAGA,IAAMA,YAAY,gBAAGC,aAAa,EAAE,CAAA;IAEvBC,aAAa,GAAG,SAAhBA,aAAaA,CAAAC,IAAA,EAQpB;AAAA,EAAA,IAPLC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IACRC,MAAM,GAAAF,IAAA,CAANE,MAAM;IACNC,QAAQ,GAAAH,IAAA,CAARG,QAAQ;IACRC,OAAO,GAAAJ,IAAA,CAAPI,OAAO;IACPC,WAAW,GAAAL,IAAA,CAAXK,WAAW;IACXC,SAAS,GAAAN,IAAA,CAATM,SAAS;IACTC,aAAa,GAAAP,IAAA,CAAbO,aAAa,CAAA;AAEbC,EAAAA,SAAS,CAAC,YAAM;IACfC,QAAQ,CAACC,eAAe,CAACC,KAAK,CAACC,WAAW,CAAC,WAAW,EAAEV,MAAM,CAAC,CAAA;IAC/DO,QAAQ,CAACC,eAAe,CAACC,KAAK,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