the-foxy-library 1.0.0 → 1.0.2

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 (318) hide show
  1. package/dist/cjs/app-globals-CXkOeBU1.js +39 -0
  2. package/dist/cjs/app-globals-CXkOeBU1.js.map +1 -0
  3. package/dist/cjs/factory-CIGw8cuP.js +37 -0
  4. package/dist/cjs/factory-CIGw8cuP.js.map +1 -0
  5. package/dist/cjs/factory-CffqQl1G.js +580 -0
  6. package/dist/cjs/factory-CffqQl1G.js.map +1 -0
  7. package/dist/cjs/factory-CktIyPWt.js +219 -0
  8. package/dist/cjs/factory-CktIyPWt.js.map +1 -0
  9. package/dist/cjs/index-DiBg0RCo.js +2311 -0
  10. package/dist/cjs/index-DiBg0RCo.js.map +1 -0
  11. package/dist/cjs/index.cjs.js +8 -0
  12. package/dist/cjs/index.cjs.js.map +1 -0
  13. package/dist/cjs/intravenous.cjs.js +26 -0
  14. package/dist/cjs/intravenous.cjs.js.map +1 -0
  15. package/dist/cjs/iv-accordion.iv-button.iv-card.iv-layout.iv-link.iv-modal.iv-recently-viewed.iv-sidebar.iv-toast.iv-toast-container.iv-wishlist-view.entry.cjs.js.map +1 -0
  16. package/dist/cjs/iv-accordion_11.cjs.entry.js +426 -0
  17. package/dist/cjs/iv-banner.cjs.entry.js +29 -0
  18. package/dist/cjs/iv-banner.entry.cjs.js.map +1 -0
  19. package/dist/cjs/iv-carousel.cjs.entry.js +18 -0
  20. package/dist/cjs/iv-carousel.entry.cjs.js.map +1 -0
  21. package/dist/cjs/iv-dynamic-products-carousel.cjs.entry.js +114 -0
  22. package/dist/cjs/iv-dynamic-products-carousel.entry.cjs.js.map +1 -0
  23. package/dist/cjs/iv-dynamic-products.cjs.entry.js +97 -0
  24. package/dist/cjs/iv-dynamic-products.entry.cjs.js.map +1 -0
  25. package/dist/cjs/iv-filters.cjs.entry.js +20 -0
  26. package/dist/cjs/iv-filters.entry.cjs.js.map +1 -0
  27. package/dist/cjs/iv-predictive-search.cjs.entry.js +304 -0
  28. package/dist/cjs/iv-predictive-search.entry.cjs.js.map +1 -0
  29. package/dist/cjs/iv-spinner.cjs.entry.js +20 -0
  30. package/dist/cjs/iv-spinner.entry.cjs.js.map +1 -0
  31. package/dist/cjs/iv-suggest.cjs.entry.js +72 -0
  32. package/dist/cjs/iv-suggest.entry.cjs.js.map +1 -0
  33. package/dist/cjs/iv-tabs.cjs.entry.js +23 -0
  34. package/dist/cjs/iv-tabs.entry.cjs.js.map +1 -0
  35. package/dist/cjs/iv-wishlist.cjs.entry.js +74 -0
  36. package/dist/cjs/iv-wishlist.entry.cjs.js.map +1 -0
  37. package/dist/cjs/loader.cjs.js +14 -0
  38. package/dist/cjs/loader.cjs.js.map +1 -0
  39. package/dist/cjs/sw-in-grid-content.cjs.entry.js +19 -0
  40. package/dist/cjs/sw-in-grid-content.entry.cjs.js.map +1 -0
  41. package/dist/cjs/sw-size-guide.cjs.entry.js +106 -0
  42. package/dist/cjs/sw-size-guide.entry.cjs.js.map +1 -0
  43. package/dist/collection/collection-manifest.json +35 -0
  44. package/dist/collection/components/iv-accordion/iv-accordion.css +3 -0
  45. package/dist/collection/components/iv-accordion/iv-accordion.js +184 -0
  46. package/dist/collection/components/iv-accordion/iv-accordion.js.map +1 -0
  47. package/dist/collection/components/iv-banner/iv-banner.css +3 -0
  48. package/dist/collection/components/iv-banner/iv-banner.js +111 -0
  49. package/dist/collection/components/iv-banner/iv-banner.js.map +1 -0
  50. package/dist/collection/components/iv-button/iv-button.css +87 -0
  51. package/dist/collection/components/iv-button/iv-button.js +164 -0
  52. package/dist/collection/components/iv-button/iv-button.js.map +1 -0
  53. package/dist/collection/components/iv-card/iv-card.css +115 -0
  54. package/dist/collection/components/iv-card/iv-card.js +226 -0
  55. package/dist/collection/components/iv-card/iv-card.js.map +1 -0
  56. package/dist/collection/components/iv-carousel/iv-carousel.css +0 -0
  57. package/dist/collection/components/iv-carousel/iv-carousel.js +19 -0
  58. package/dist/collection/components/iv-carousel/iv-carousel.js.map +1 -0
  59. package/dist/collection/components/iv-dynamic-products/iv-dynamic-products.css +77 -0
  60. package/dist/collection/components/iv-dynamic-products/iv-dynamic-products.js +415 -0
  61. package/dist/collection/components/iv-dynamic-products/iv-dynamic-products.js.map +1 -0
  62. package/dist/collection/components/iv-dynamic-products-carousel/iv-dynamic-products-carousel.css +143 -0
  63. package/dist/collection/components/iv-dynamic-products-carousel/iv-dynamic-products-carousel.js +395 -0
  64. package/dist/collection/components/iv-dynamic-products-carousel/iv-dynamic-products-carousel.js.map +1 -0
  65. package/dist/collection/components/iv-filters/iv-filters.css +3 -0
  66. package/dist/collection/components/iv-filters/iv-filters.js +21 -0
  67. package/dist/collection/components/iv-filters/iv-filters.js.map +1 -0
  68. package/dist/collection/components/iv-layout/iv-layout.css +66 -0
  69. package/dist/collection/components/iv-layout/iv-layout.js +203 -0
  70. package/dist/collection/components/iv-layout/iv-layout.js.map +1 -0
  71. package/dist/collection/components/iv-link/iv-link.css +0 -0
  72. package/dist/collection/components/iv-link/iv-link.js +148 -0
  73. package/dist/collection/components/iv-link/iv-link.js.map +1 -0
  74. package/dist/collection/components/iv-modal/iv-modal.css +58 -0
  75. package/dist/collection/components/iv-modal/iv-modal.js +23 -0
  76. package/dist/collection/components/iv-modal/iv-modal.js.map +1 -0
  77. package/dist/collection/components/iv-predictive-search/iv-predictive-search.css +149 -0
  78. package/dist/collection/components/iv-predictive-search/iv-predictive-search.js +696 -0
  79. package/dist/collection/components/iv-predictive-search/iv-predictive-search.js.map +1 -0
  80. package/dist/collection/components/iv-recently-viewed/iv-recently-viewed.css +80 -0
  81. package/dist/collection/components/iv-recently-viewed/iv-recently-viewed.js +210 -0
  82. package/dist/collection/components/iv-recently-viewed/iv-recently-viewed.js.map +1 -0
  83. package/dist/collection/components/iv-sidebar/iv-sidebar.css +82 -0
  84. package/dist/collection/components/iv-sidebar/iv-sidebar.js +60 -0
  85. package/dist/collection/components/iv-sidebar/iv-sidebar.js.map +1 -0
  86. package/dist/collection/components/iv-spinner/iv-spinner.css +3 -0
  87. package/dist/collection/components/iv-spinner/iv-spinner.js +45 -0
  88. package/dist/collection/components/iv-spinner/iv-spinner.js.map +1 -0
  89. package/dist/collection/components/iv-suggest/iv-suggest.css +103 -0
  90. package/dist/collection/components/iv-suggest/iv-suggest.js +326 -0
  91. package/dist/collection/components/iv-suggest/iv-suggest.js.map +1 -0
  92. package/dist/collection/components/iv-tabs/iv-tabs.css +3 -0
  93. package/dist/collection/components/iv-tabs/iv-tabs.js +90 -0
  94. package/dist/collection/components/iv-tabs/iv-tabs.js.map +1 -0
  95. package/dist/collection/components/iv-toast/iv-toast.css +90 -0
  96. package/dist/collection/components/iv-toast/iv-toast.js +107 -0
  97. package/dist/collection/components/iv-toast/iv-toast.js.map +1 -0
  98. package/dist/collection/components/iv-toast-container/iv-toast-container.css +10 -0
  99. package/dist/{intravenous/iv-toast-container.entry.js → collection/components/iv-toast-container/iv-toast-container.js} +21 -13
  100. package/dist/collection/components/iv-toast-container/iv-toast-container.js.map +1 -0
  101. package/dist/collection/components/iv-wishlist/iv-wishlist.css +3 -0
  102. package/dist/collection/components/iv-wishlist/iv-wishlist.js +245 -0
  103. package/dist/collection/components/iv-wishlist/iv-wishlist.js.map +1 -0
  104. package/dist/collection/components/iv-wishlist-view/iv-wishlist-view.css +3 -0
  105. package/dist/{intravenous/iv-wishlist-view.entry.js → collection/components/iv-wishlist-view/iv-wishlist-view.js} +18 -15
  106. package/dist/collection/components/iv-wishlist-view/iv-wishlist-view.js.map +1 -0
  107. package/dist/collection/components/sw-in-grid-content/sw-in-grid-content.css +116 -0
  108. package/dist/collection/components/sw-in-grid-content/sw-in-grid-content.js +20 -0
  109. package/dist/collection/components/sw-in-grid-content/sw-in-grid-content.js.map +1 -0
  110. package/dist/collection/components/sw-size-guide/sw-size-guide.css +84 -0
  111. package/dist/collection/components/sw-size-guide/sw-size-guide.js +119 -0
  112. package/dist/collection/components/sw-size-guide/sw-size-guide.js.map +1 -0
  113. package/dist/collection/global/app.js +31 -0
  114. package/dist/collection/global/app.js.map +1 -0
  115. package/dist/collection/index.js +11 -0
  116. package/dist/collection/index.js.map +1 -0
  117. package/dist/collection/utils/caching/factory.js +361 -0
  118. package/dist/collection/utils/caching/factory.js.map +1 -0
  119. package/dist/collection/utils/caching/productCache.js +80 -0
  120. package/dist/collection/utils/caching/productCache.js.map +1 -0
  121. package/dist/collection/utils/config/factory.js +42 -0
  122. package/dist/collection/utils/config/factory.js.map +1 -0
  123. package/dist/collection/utils/error_handling/factory.js +151 -0
  124. package/dist/collection/utils/error_handling/factory.js.map +1 -0
  125. package/dist/collection/utils/helpers/factory.js +32 -0
  126. package/dist/collection/utils/helpers/factory.js.map +1 -0
  127. package/dist/collection/utils/store/store.js +92 -0
  128. package/dist/collection/utils/store/store.js.map +1 -0
  129. package/dist/{intravenous/factory-1QinX-o0.js → collection/utils/storefront_api/factory.js} +7 -12
  130. package/dist/collection/utils/storefront_api/factory.js.map +1 -0
  131. package/dist/collection/utils/utils.js +5 -0
  132. package/dist/collection/utils/utils.js.map +1 -0
  133. package/dist/components/index.js +44 -0
  134. package/dist/components/index.js.map +1 -0
  135. package/dist/components/iv-accordion.js +65 -0
  136. package/dist/components/iv-accordion.js.map +1 -0
  137. package/dist/components/iv-banner.js +9 -0
  138. package/dist/components/iv-banner.js.map +1 -0
  139. package/dist/components/iv-button.js +9 -0
  140. package/dist/components/iv-button.js.map +1 -0
  141. package/dist/components/iv-card.js +9 -0
  142. package/dist/components/iv-card.js.map +1 -0
  143. package/dist/components/iv-carousel.js +39 -0
  144. package/dist/components/iv-carousel.js.map +1 -0
  145. package/dist/components/iv-dynamic-products-carousel.js +181 -0
  146. package/dist/components/iv-dynamic-products-carousel.js.map +1 -0
  147. package/dist/components/iv-dynamic-products.js +171 -0
  148. package/dist/components/iv-dynamic-products.js.map +1 -0
  149. package/dist/components/iv-filters.js +40 -0
  150. package/dist/components/iv-filters.js.map +1 -0
  151. package/dist/components/iv-layout.js +9 -0
  152. package/dist/components/iv-layout.js.map +1 -0
  153. package/dist/components/iv-link.js +9 -0
  154. package/dist/components/iv-link.js.map +1 -0
  155. package/dist/{intravenous/iv-modal.entry.js → components/iv-modal.js} +43 -9
  156. package/dist/components/iv-modal.js.map +1 -0
  157. package/dist/components/iv-predictive-search.js +370 -0
  158. package/dist/components/iv-predictive-search.js.map +1 -0
  159. package/dist/{intravenous/iv-recently-viewed.entry.js → components/iv-recently-viewed.js} +63 -14
  160. package/dist/components/iv-recently-viewed.js.map +1 -0
  161. package/dist/{intravenous/iv-sidebar.entry.js → components/iv-sidebar.js} +44 -9
  162. package/dist/components/iv-sidebar.js.map +1 -0
  163. package/dist/components/iv-spinner.js +9 -0
  164. package/dist/components/iv-spinner.js.map +1 -0
  165. package/dist/components/iv-suggest.js +136 -0
  166. package/dist/components/iv-suggest.js.map +1 -0
  167. package/dist/components/iv-tabs.js +9 -0
  168. package/dist/components/iv-tabs.js.map +1 -0
  169. package/dist/components/iv-toast-container.js +74 -0
  170. package/dist/components/iv-toast-container.js.map +1 -0
  171. package/dist/components/iv-toast.js +9 -0
  172. package/dist/components/iv-toast.js.map +1 -0
  173. package/dist/components/iv-wishlist-view.js +9 -0
  174. package/dist/components/iv-wishlist-view.js.map +1 -0
  175. package/dist/components/iv-wishlist.js +109 -0
  176. package/dist/components/iv-wishlist.js.map +1 -0
  177. package/dist/components/p-A1obmoUb.js +51 -0
  178. package/dist/components/p-A1obmoUb.js.map +1 -0
  179. package/dist/components/p-B0FwtJkz.js +39 -0
  180. package/dist/components/p-B0FwtJkz.js.map +1 -0
  181. package/dist/{intravenous/factory-mrqy6XUM.js → components/p-B1ZxQSqg.js} +2 -8
  182. package/dist/components/p-B1ZxQSqg.js.map +1 -0
  183. package/dist/components/p-B5_mndmn.js +45 -0
  184. package/dist/components/p-B5_mndmn.js.map +1 -0
  185. package/dist/{intravenous/iv-layout.entry.js → components/p-C7ahdyUj.js} +35 -11
  186. package/dist/components/p-C7ahdyUj.js.map +1 -0
  187. package/dist/components/p-DGazyVNO.js +214 -0
  188. package/dist/components/p-DGazyVNO.js.map +1 -0
  189. package/dist/components/p-DkYGjXky.js +2077 -0
  190. package/dist/components/p-DkYGjXky.js.map +1 -0
  191. package/dist/components/p-DwwyNs2H.js +50 -0
  192. package/dist/components/p-DwwyNs2H.js.map +1 -0
  193. package/dist/{intravenous/iv-toast.entry.js → components/p-DxED_G2q.js} +32 -9
  194. package/dist/components/p-DxED_G2q.js.map +1 -0
  195. package/dist/components/p-EuHiPk5q.js +45 -0
  196. package/dist/components/p-EuHiPk5q.js.map +1 -0
  197. package/dist/{intravenous/iv-card.entry.js → components/p-GgFls1_9.js} +49 -11
  198. package/dist/components/p-GgFls1_9.js.map +1 -0
  199. package/dist/{intravenous/iv-button.entry.js → components/p-SDmLRvSn.js} +35 -12
  200. package/dist/components/p-SDmLRvSn.js.map +1 -0
  201. package/dist/components/p-TOCiiSZt.js +387 -0
  202. package/dist/components/p-TOCiiSZt.js.map +1 -0
  203. package/dist/components/sw-in-grid-content.js +39 -0
  204. package/dist/components/sw-in-grid-content.js.map +1 -0
  205. package/dist/components/sw-size-guide.js +128 -0
  206. package/dist/components/sw-size-guide.js.map +1 -0
  207. package/dist/esm/app-globals-Bb1KQ8yQ.js +37 -0
  208. package/dist/esm/app-globals-Bb1KQ8yQ.js.map +1 -0
  209. package/dist/esm/factory-3G0XnXRH.js +30 -0
  210. package/dist/esm/factory-3G0XnXRH.js.map +1 -0
  211. package/dist/esm/factory-ClqXFNr2.js +214 -0
  212. package/dist/esm/factory-ClqXFNr2.js.map +1 -0
  213. package/dist/{intravenous/factory-JClanx-E.js → esm/factory-Opl8iokX.js} +3 -22
  214. package/dist/esm/factory-Opl8iokX.js.map +1 -0
  215. package/dist/esm/index-C4-XLZHN.js +2294 -0
  216. package/dist/esm/index-C4-XLZHN.js.map +1 -0
  217. package/dist/esm/index.js +6 -0
  218. package/dist/esm/index.js.map +1 -0
  219. package/dist/esm/intravenous.js +22 -0
  220. package/dist/esm/intravenous.js.map +1 -0
  221. package/dist/esm/iv-accordion.iv-button.iv-card.iv-layout.iv-link.iv-modal.iv-recently-viewed.iv-sidebar.iv-toast.iv-toast-container.iv-wishlist-view.entry.js.map +1 -0
  222. package/dist/esm/iv-accordion_11.entry.js +414 -0
  223. package/dist/{intravenous → esm}/iv-banner.entry.js +2 -3
  224. package/dist/esm/iv-banner.entry.js.map +1 -0
  225. package/dist/{intravenous → esm}/iv-carousel.entry.js +2 -2
  226. package/dist/esm/iv-carousel.entry.js.map +1 -0
  227. package/dist/{intravenous → esm}/iv-dynamic-products-carousel.entry.js +9 -11
  228. package/dist/esm/iv-dynamic-products-carousel.entry.js.map +1 -0
  229. package/dist/{intravenous → esm}/iv-dynamic-products.entry.js +4 -6
  230. package/dist/esm/iv-dynamic-products.entry.js.map +1 -0
  231. package/dist/{intravenous → esm}/iv-filters.entry.js +2 -3
  232. package/dist/esm/iv-filters.entry.js.map +1 -0
  233. package/dist/{intravenous → esm}/iv-predictive-search.entry.js +4 -13
  234. package/dist/esm/iv-predictive-search.entry.js.map +1 -0
  235. package/dist/{intravenous → esm}/iv-spinner.entry.js +2 -3
  236. package/dist/esm/iv-spinner.entry.js.map +1 -0
  237. package/dist/{intravenous → esm}/iv-suggest.entry.js +3 -5
  238. package/dist/esm/iv-suggest.entry.js.map +1 -0
  239. package/dist/{intravenous → esm}/iv-tabs.entry.js +2 -3
  240. package/dist/esm/iv-tabs.entry.js.map +1 -0
  241. package/dist/{intravenous → esm}/iv-wishlist.entry.js +2 -3
  242. package/dist/esm/iv-wishlist.entry.js.map +1 -0
  243. package/dist/esm/loader.js +12 -0
  244. package/dist/esm/loader.js.map +1 -0
  245. package/dist/{intravenous → esm}/sw-in-grid-content.entry.js +2 -3
  246. package/dist/esm/sw-in-grid-content.entry.js.map +1 -0
  247. package/dist/{intravenous → esm}/sw-size-guide.entry.js +2 -9
  248. package/dist/esm/sw-size-guide.entry.js.map +1 -0
  249. package/dist/index.cjs.js +1 -0
  250. package/dist/index.js +1 -0
  251. package/dist/intravenous/index.esm.js +2 -17
  252. package/dist/intravenous/index.esm.js.map +1 -1
  253. package/dist/intravenous/intravenous.esm.js +2 -48
  254. package/dist/intravenous/intravenous.esm.js.map +1 -1
  255. package/dist/intravenous/iv-accordion.iv-button.iv-card.iv-layout.iv-link.iv-modal.iv-recently-viewed.iv-sidebar.iv-toast.iv-toast-container.iv-wishlist-view.entry.esm.js.map +1 -0
  256. package/dist/intravenous/iv-banner.entry.esm.js.map +1 -1
  257. package/dist/intravenous/iv-dynamic-products-carousel.entry.esm.js.map +1 -1
  258. package/dist/intravenous/iv-dynamic-products.entry.esm.js.map +1 -1
  259. package/dist/intravenous/iv-filters.entry.esm.js.map +1 -1
  260. package/dist/intravenous/iv-predictive-search.entry.esm.js.map +1 -1
  261. package/dist/intravenous/iv-spinner.entry.esm.js.map +1 -1
  262. package/dist/intravenous/iv-suggest.entry.esm.js.map +1 -1
  263. package/dist/intravenous/iv-tabs.entry.esm.js.map +1 -1
  264. package/dist/intravenous/iv-wishlist.entry.esm.js.map +1 -1
  265. package/dist/intravenous/loader.esm.js.map +1 -1
  266. package/dist/intravenous/p-0a24e4ba.entry.js +2 -0
  267. package/dist/intravenous/p-0a24e4ba.entry.js.map +1 -0
  268. package/dist/intravenous/p-128b6cac.entry.js +2 -0
  269. package/dist/intravenous/p-128b6cac.entry.js.map +1 -0
  270. package/dist/intravenous/p-2d5d9359.entry.js +2 -0
  271. package/dist/intravenous/p-2d5d9359.entry.js.map +1 -0
  272. package/dist/intravenous/p-2f5c081f.entry.js +2 -0
  273. package/dist/intravenous/p-2f5c081f.entry.js.map +1 -0
  274. package/dist/intravenous/p-335c12e1.entry.js +2 -0
  275. package/dist/intravenous/p-335c12e1.entry.js.map +1 -0
  276. package/dist/intravenous/p-3G0XnXRH.js +2 -0
  277. package/dist/intravenous/p-3G0XnXRH.js.map +1 -0
  278. package/dist/intravenous/p-60554353.entry.js +2 -0
  279. package/dist/intravenous/p-60554353.entry.js.map +1 -0
  280. package/dist/intravenous/p-66ebd8f1.entry.js +2 -0
  281. package/dist/intravenous/p-66ebd8f1.entry.js.map +1 -0
  282. package/dist/intravenous/p-8ac29c77.entry.js +2 -0
  283. package/dist/intravenous/p-8ac29c77.entry.js.map +1 -0
  284. package/dist/intravenous/p-BvKHmCfH.js +2 -0
  285. package/dist/intravenous/p-BvKHmCfH.js.map +1 -0
  286. package/dist/intravenous/p-C4-XLZHN.js +3 -0
  287. package/dist/intravenous/p-C4-XLZHN.js.map +1 -0
  288. package/dist/intravenous/p-C9w3yU1Z.js +2 -0
  289. package/dist/intravenous/p-C9w3yU1Z.js.map +1 -0
  290. package/dist/intravenous/p-MuJ1P-w6.js +2 -0
  291. package/dist/intravenous/p-MuJ1P-w6.js.map +1 -0
  292. package/dist/intravenous/p-a3928f84.entry.js +2 -0
  293. package/dist/intravenous/p-a3928f84.entry.js.map +1 -0
  294. package/dist/intravenous/p-aabedd5e.entry.js +2 -0
  295. package/dist/intravenous/p-aabedd5e.entry.js.map +1 -0
  296. package/dist/intravenous/p-b1b44a12.entry.js +2 -0
  297. package/dist/intravenous/p-b1b44a12.entry.js.map +1 -0
  298. package/dist/intravenous/p-bc77e1fd.entry.js +2 -0
  299. package/dist/intravenous/p-bc77e1fd.entry.js.map +1 -0
  300. package/dist/intravenous/p-e911fc8a.entry.js +2 -0
  301. package/dist/intravenous/p-e911fc8a.entry.js.map +1 -0
  302. package/dist/intravenous/sw-in-grid-content.entry.esm.js.map +1 -1
  303. package/dist/intravenous/sw-size-guide.entry.esm.js.map +1 -1
  304. package/package.json +1 -1
  305. package/dist/intravenous/index-Py50VI8u.js +0 -4761
  306. package/dist/intravenous/iv-accordion.entry.esm.js.map +0 -1
  307. package/dist/intravenous/iv-accordion.entry.js +0 -35
  308. package/dist/intravenous/iv-button.entry.esm.js.map +0 -1
  309. package/dist/intravenous/iv-card.entry.esm.js.map +0 -1
  310. package/dist/intravenous/iv-layout.entry.esm.js.map +0 -1
  311. package/dist/intravenous/iv-link.entry.esm.js.map +0 -1
  312. package/dist/intravenous/iv-link.entry.js +0 -25
  313. package/dist/intravenous/iv-modal.entry.esm.js.map +0 -1
  314. package/dist/intravenous/iv-recently-viewed.entry.esm.js.map +0 -1
  315. package/dist/intravenous/iv-sidebar.entry.esm.js.map +0 -1
  316. package/dist/intravenous/iv-toast-container.entry.esm.js.map +0 -1
  317. package/dist/intravenous/iv-toast.entry.esm.js.map +0 -1
  318. package/dist/intravenous/iv-wishlist-view.entry.esm.js.map +0 -1
@@ -0,0 +1,39 @@
1
+ 'use strict';
2
+
3
+ var index = require('./index-DiBg0RCo.js');
4
+
5
+ // Idempotent global init (prevents double execution if script loaded twice)
6
+ // Also resolves Stencil v update expecting a default export from globalScript.
7
+ // Flags kept minimal to avoid polluting window.
8
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
9
+ // @ts-ignore
10
+ const w = (typeof window !== 'undefined') ? window : {};
11
+ async function intravenousGlobalInit() {
12
+ try {
13
+ if (!w.__IV_API_SETUP_DONE) {
14
+ index.apiSetup();
15
+ w.__IV_API_SETUP_DONE = true;
16
+ }
17
+ if (!w.__IV_CURRENCY_FETCH_DONE) {
18
+ try {
19
+ const code = await index.fetchShopifyCurrencyCode();
20
+ if (code)
21
+ index.state.setCurrencyCode(code);
22
+ }
23
+ catch (err) {
24
+ console.debug('[IV] currency fetch skipped', err);
25
+ }
26
+ w.__IV_CURRENCY_FETCH_DONE = true;
27
+ }
28
+ }
29
+ catch (err) {
30
+ console.error('[IV] Global init failed', err);
31
+ }
32
+ }
33
+
34
+ const globalScripts = intravenousGlobalInit;
35
+
36
+ exports.globalScripts = globalScripts;
37
+ //# sourceMappingURL=app-globals-CXkOeBU1.js.map
38
+
39
+ //# sourceMappingURL=app-globals-CXkOeBU1.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-globals-CXkOeBU1.js","sources":["src/global/app.ts","@stencil/core/internal/app-globals"],"sourcesContent":["import { apiSetup, fetchShopifyCurrencyCode } from '../utils/config/factory';\nimport { state } from '../utils/store/store';\n\n// Idempotent global init (prevents double execution if script loaded twice)\n// Also resolves Stencil v update expecting a default export from globalScript.\n// Flags kept minimal to avoid polluting window.\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nconst w: any = (typeof window !== 'undefined') ? window : {};\n\nexport default async function intravenousGlobalInit() {\n try {\n if(!w.__IV_API_SETUP_DONE) {\n apiSetup();\n w.__IV_API_SETUP_DONE = true;\n }\n if(!w.__IV_CURRENCY_FETCH_DONE) {\n try {\n const code = await fetchShopifyCurrencyCode();\n if(code) state.setCurrencyCode(code);\n } catch (err) {\n console.debug('[IV] currency fetch skipped', err);\n }\n w.__IV_CURRENCY_FETCH_DONE = true;\n }\n } catch(err) {\n console.error('[IV] Global init failed', err);\n }\n}","import appGlobalScript from 'C:/Users/BeauBuxton/OneDrive - Herd Agency Limited/Documents/ending/intravenous/src/global/app.ts';\nexport const globalScripts = appGlobalScript;\nexport const globalStyles = \"\";\n"],"names":["apiSetup","fetchShopifyCurrencyCode","state","appGlobalScript"],"mappings":";;;;AAGA;AACA;AACA;AACA;AACA;AACA,MAAM,CAAC,GAAQ,CAAC,OAAO,MAAM,KAAK,WAAW,IAAI,MAAM,GAAG,EAAE;AAE7C,eAAe,qBAAqB,GAAA;AACjD,IAAA,IAAI;AACF,QAAA,IAAG,CAAC,CAAC,CAAC,mBAAmB,EAAE;AACzB,YAAAA,cAAQ,EAAE;AACV,YAAA,CAAC,CAAC,mBAAmB,GAAG,IAAI;;AAE9B,QAAA,IAAG,CAAC,CAAC,CAAC,wBAAwB,EAAE;AAC9B,YAAA,IAAI;AACF,gBAAA,MAAM,IAAI,GAAG,MAAMC,8BAAwB,EAAE;AAC7C,gBAAA,IAAG,IAAI;AAAE,oBAAAC,WAAK,CAAC,eAAe,CAAC,IAAI,CAAC;;YACpC,OAAO,GAAG,EAAE;AACZ,gBAAA,OAAO,CAAC,KAAK,CAAC,6BAA6B,EAAE,GAAG,CAAC;;AAEnD,YAAA,CAAC,CAAC,wBAAwB,GAAG,IAAI;;;IAEnC,OAAM,GAAG,EAAE;AACX,QAAA,OAAO,CAAC,KAAK,CAAC,yBAAyB,EAAE,GAAG,CAAC;;AAEjD;;AC3BY,MAAC,aAAa,GAAGC;;;;"}
@@ -0,0 +1,37 @@
1
+ 'use strict';
2
+
3
+ function decodeJsonString(str) {
4
+ return str.replace(/"/g, '"');
5
+ }
6
+ function requestedFields(fields) {
7
+ return fields ? fields.split(',').map(f => f.trim()) : null;
8
+ }
9
+ function formatMoney(amount, currencyCode = 'GBP', locale = 'en-GB') {
10
+ // return new Intl.NumberFormat(locale, { style: 'currency', currency: currencyCode }).format(amount / 100);
11
+ return new Intl.NumberFormat(locale, { style: 'currency', currency: currencyCode }).format(amount);
12
+ }
13
+ function getCurrencySymbol(currencyCode = 'GBP', locale = 'en-GB') {
14
+ return (0).toLocaleString(locale, {
15
+ style: 'currency',
16
+ currency: currencyCode,
17
+ minimumFractionDigits: 0,
18
+ maximumFractionDigits: 0
19
+ }).replace(/\d/g, '').trim();
20
+ }
21
+ function getProductIDFromGid(id) {
22
+ return Number(id.split('/').pop());
23
+ }
24
+ function getProductHandle() {
25
+ const path = window.location.pathname;
26
+ return path.startsWith('/products/') ? path.replace('/products/', '').split('/')[0] : null;
27
+ }
28
+
29
+ exports.decodeJsonString = decodeJsonString;
30
+ exports.formatMoney = formatMoney;
31
+ exports.getCurrencySymbol = getCurrencySymbol;
32
+ exports.getProductHandle = getProductHandle;
33
+ exports.getProductIDFromGid = getProductIDFromGid;
34
+ exports.requestedFields = requestedFields;
35
+ //# sourceMappingURL=factory-CIGw8cuP.js.map
36
+
37
+ //# sourceMappingURL=factory-CIGw8cuP.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"factory-CIGw8cuP.js","sources":["src/utils/helpers/factory.ts"],"sourcesContent":["export function decodeJsonString(str: string): string {\n return str.replace(/"/g, '\"');\n};\n\nexport function requestedFields(fields: string): string[] | null {\n return fields ? fields.split(',').map(f => f.trim()) : null;\n}; \n\nexport function formatMoney(amount: number, currencyCode: string = 'GBP', locale: string = 'en-GB'): string {\n // return new Intl.NumberFormat(locale, { style: 'currency', currency: currencyCode }).format(amount / 100);\n return new Intl.NumberFormat(locale, { style: 'currency', currency: currencyCode }).format(amount);\n};\n\nexport function getCurrencySymbol(currencyCode: string = 'GBP', locale: string = 'en-GB'): string {\n return (0).toLocaleString(locale, {\n style: 'currency',\n currency: currencyCode,\n minimumFractionDigits: 0,\n maximumFractionDigits: 0\n }).replace(/\\d/g, '').trim();\n};\n\nexport function getProductIDFromGid(id: string): number {\n return Number(id.split('/').pop()); \n};\n\nexport function getProductHandle(): string {\n const path = window.location.pathname;\n return path.startsWith('/products/') ? path.replace('/products/', '').split('/')[0] : null;\n};"],"names":[],"mappings":";;AAAM,SAAU,gBAAgB,CAAC,GAAW,EAAA;IAC1C,OAAO,GAAG,CAAC,OAAO,CAAC,SAAS,EAAE,GAAG,CAAC;AACpC;AAEM,SAAU,eAAe,CAAC,MAAc,EAAA;IAC5C,OAAO,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI;AAC7D;AAEM,SAAU,WAAW,CAAC,MAAc,EAAE,YAAuB,GAAA,KAAK,EAAE,MAAA,GAAiB,OAAO,EAAA;;IAEhG,OAAO,IAAI,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,YAAY,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC;AACpG;AAEM,SAAU,iBAAiB,CAAC,eAAuB,KAAK,EAAE,SAAiB,OAAO,EAAA;AACtF,IAAA,OAAO,CAAC,CAAC,EAAE,cAAc,CAAC,MAAM,EAAE;AAChC,QAAA,KAAK,EAAE,UAAU;AACjB,QAAA,QAAQ,EAAE,YAAY;AACtB,QAAA,qBAAqB,EAAE,CAAC;AACxB,QAAA,qBAAqB,EAAE;KACxB,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE;AAC9B;AAEM,SAAU,mBAAmB,CAAC,EAAU,EAAA;AAC5C,IAAA,OAAO,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;AACpC;SAEgB,gBAAgB,GAAA;AAC9B,IAAA,MAAM,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ;AACrC,IAAA,OAAO,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI;AAC5F;;;;;;;;;"}
@@ -0,0 +1,580 @@
1
+ 'use strict';
2
+
3
+ var index = require('./index-DiBg0RCo.js');
4
+
5
+ /*
6
+ Generic caching factory for component data (and optionally pre-rendered markup).
7
+ Focus: Avoid repeated Storefront API calls across page loads & multiple instances.
8
+
9
+ Strategy:
10
+ - Cache normalized data (preferred) so Stencil still renders & binds events.
11
+ - Optional markup caching (only for fully static / idempotent HTML) via setMarkup/getMarkup helpers.
12
+ - Deterministic key: namespace + stable-hash(params + version + type).
13
+ - Supports localStorage / sessionStorage / memory fallback.
14
+ - TTL + optional staleWhileRevalidate.
15
+ - Inflight request dedupe (single network fetch per key at a time).
16
+ - Event emission (CustomEvent 'iv-cache') for diagnostics (hit/miss/stale/set/purge/error).
17
+
18
+ IMPORTANT NOTE ABOUT MARKUP CACHING:
19
+ Injecting raw cached markup can skip Stencil lifecycle & event listener binding.
20
+ Prefer data caching and regular render path. Use markup caching only for static read-only fragments.
21
+ */
22
+ function createCache(options) {
23
+ const { namespace, version = '1', storage = 'local', prefix = 'iv:cache:', defaultTTL = 1000 * 60 * 5, staleTTL, maxEntries = 200, maxValueBytes = 250_000, // ~250 KB safety guard
24
+ serialize = JSON.stringify, deserialize = JSON.parse, dispatchEvents = true, target = (typeof window !== 'undefined' ? window : undefined) } = options;
25
+ const adapter = resolveAdapter(storage);
26
+ const inflight = new Map();
27
+ let opCount = 0;
28
+ function emit(action, key, info) {
29
+ if (!dispatchEvents || !target || typeof target.dispatchEvent !== 'function')
30
+ return;
31
+ try {
32
+ const detail = { action, key, namespace, info };
33
+ target.dispatchEvent(new CustomEvent('iv-cache', { detail, bubbles: true, composed: true }));
34
+ }
35
+ catch (_) { }
36
+ }
37
+ function stableString(obj) {
38
+ if (obj === null)
39
+ return 'null';
40
+ const type = typeof obj;
41
+ if (type !== 'object')
42
+ return JSON.stringify(obj);
43
+ if (Array.isArray(obj))
44
+ return '[' + obj.map(stableString).join(',') + ']';
45
+ const keys = Object.keys(obj).sort();
46
+ return '{' + keys.map(k => JSON.stringify(k) + ':' + stableString(obj[k])).join(',') + '}';
47
+ }
48
+ function hash(str) {
49
+ let h = 5381, i = str.length;
50
+ while (i)
51
+ h = (h * 33) ^ str.charCodeAt(--i);
52
+ return (h >>> 0).toString(36);
53
+ }
54
+ function buildKey(type, params) {
55
+ const base = stableString(params);
56
+ return `${prefix}${namespace}:${type}:${version}:${hash(base)}`;
57
+ }
58
+ function read(key) {
59
+ try {
60
+ const rawStr = adapter.getItem(key);
61
+ if (!rawStr)
62
+ return { isExpired: true, isStale: false, ageMs: 0 };
63
+ const stored = deserialize(rawStr);
64
+ if (!stored || stored.v !== version)
65
+ return { isExpired: true, isStale: false, ageMs: 0 };
66
+ const ageMs = Date.now() - stored.ts;
67
+ const isExpired = ageMs > stored.ttl;
68
+ const isStale = isExpired && staleTTL ? ageMs <= stored.ttl + staleTTL : false;
69
+ return { data: stored.data, meta: stored.meta, isExpired, isStale, ageMs, raw: stored };
70
+ }
71
+ catch (err) {
72
+ emit('error', key, { err: err?.message });
73
+ return { isExpired: true, isStale: false, ageMs: 0 };
74
+ }
75
+ }
76
+ function write(key, type, data, cfg) {
77
+ const ttl = cfg?.ttl ?? defaultTTL;
78
+ const stored = { v: version, ts: Date.now(), ttl, t: type, data, meta: cfg?.meta };
79
+ try {
80
+ const payload = serialize(stored);
81
+ if (maxValueBytes && byteLength(payload) > maxValueBytes) {
82
+ emit('error', key, { reason: 'oversize', bytes: byteLength(payload) });
83
+ return;
84
+ }
85
+ adapter.setItem(key, payload);
86
+ emit('set', key, { ttl, type });
87
+ enforceLimit();
88
+ }
89
+ catch (err) {
90
+ emit('error', key, { err: err?.message });
91
+ }
92
+ }
93
+ function get(key) {
94
+ const res = read(key);
95
+ if (res.data && !res.isExpired)
96
+ emit('hit', key, { ageMs: res.ageMs });
97
+ else if (res.data && res.isExpired && res.isStale)
98
+ emit('stale', key, { ageMs: res.ageMs });
99
+ else
100
+ emit('miss', key);
101
+ return res;
102
+ }
103
+ async function getOrSet(key, type, fetcher, opts) {
104
+ const existing = get(key);
105
+ if (existing.data && !existing.isExpired)
106
+ return existing.data;
107
+ if (existing.data && existing.isStale && opts?.staleWhileRevalidate) {
108
+ // return stale, refresh in background
109
+ refresh(key, type, fetcher, opts);
110
+ return existing.data;
111
+ }
112
+ if (inflight.has(key))
113
+ return inflight.get(key);
114
+ const p = (async () => {
115
+ try {
116
+ const raw = await fetcher();
117
+ const transformed = opts?.transform ? opts.transform(raw) : raw;
118
+ write(key, type, transformed, { ttl: opts?.ttl, meta: opts?.meta });
119
+ return transformed;
120
+ }
121
+ finally {
122
+ inflight.delete(key);
123
+ }
124
+ })();
125
+ inflight.set(key, p);
126
+ return p;
127
+ }
128
+ function refresh(key, type, fetcher, opts) {
129
+ return getOrSet(key, type, fetcher, opts); // reuse logic
130
+ }
131
+ function purge(key) {
132
+ adapter.removeItem(key);
133
+ emit('purge', key);
134
+ }
135
+ function purgePattern(pattern) {
136
+ const keys = adapter.keys();
137
+ for (const k of keys) {
138
+ if (!k.startsWith(`${prefix}${namespace}:`))
139
+ continue;
140
+ const matched = typeof pattern === 'function' ? pattern(k) : pattern.test(k);
141
+ if (matched)
142
+ purge(k);
143
+ }
144
+ }
145
+ function clearNamespace() { purgePattern(() => true); }
146
+ function enforceLimit() {
147
+ if (!adapter.keys)
148
+ return;
149
+ opCount++;
150
+ // only enforce every 20 writes to reduce overhead
151
+ if (opCount % 20 !== 0)
152
+ return;
153
+ const keys = adapter.keys().filter(k => k.startsWith(`${prefix}${namespace}:`));
154
+ if (keys.length <= maxEntries)
155
+ return;
156
+ const arr = keys.map(k => {
157
+ try {
158
+ const raw = deserialize(adapter.getItem(k));
159
+ return { k, ts: raw?.ts || 0 };
160
+ }
161
+ catch {
162
+ return { k, ts: 0 };
163
+ }
164
+ }).sort((a, b) => a.ts - b.ts); // oldest first
165
+ const removeCount = keys.length - maxEntries;
166
+ arr.slice(0, removeCount).forEach(e => { purge(e.k); emit('evict', e.k); });
167
+ }
168
+ // Convenience wrappers for common patterns
169
+ function keyForData(params) { return buildKey('data', params); }
170
+ function keyForMarkup(params) { return buildKey('markup', params); }
171
+ function setData(params, data, cfg) {
172
+ write(keyForData(params), 'data', data, cfg);
173
+ }
174
+ function getData(params) {
175
+ return get(keyForData(params));
176
+ }
177
+ function getOrSetData(params, fetcher, opts) {
178
+ return getOrSet(keyForData(params), 'data', fetcher, opts);
179
+ }
180
+ function setMarkup(params, html, cfg) {
181
+ write(keyForMarkup(params), 'markup', html, cfg);
182
+ }
183
+ function getMarkup(params) {
184
+ return get(keyForMarkup(params));
185
+ }
186
+ function getOrSetMarkup(params, producer, opts) {
187
+ return getOrSet(keyForMarkup(params), 'markup', producer, opts);
188
+ }
189
+ return {
190
+ // generic
191
+ buildKey,
192
+ get,
193
+ set: write,
194
+ getOrSet,
195
+ refresh,
196
+ purge,
197
+ purgePattern,
198
+ clearNamespace,
199
+ inflight,
200
+ // data-specific helpers
201
+ keyForData,
202
+ getData,
203
+ setData,
204
+ getOrSetData,
205
+ // markup-specific helpers
206
+ keyForMarkup,
207
+ getMarkup,
208
+ setMarkup,
209
+ getOrSetMarkup
210
+ };
211
+ }
212
+ function resolveAdapter(sel) {
213
+ if (sel === 'memory')
214
+ return createMemoryAdapter();
215
+ const store = safeStorage(sel === 'session' ? 'session' : 'local');
216
+ if (!store)
217
+ return createMemoryAdapter();
218
+ return {
219
+ getItem: k => store.getItem(k),
220
+ setItem: (k, v) => store.setItem(k, v),
221
+ removeItem: k => store.removeItem(k),
222
+ keys: () => {
223
+ const arr = [];
224
+ for (let i = 0; i < store.length; i++) {
225
+ const key = store.key(i);
226
+ if (key)
227
+ arr.push(key);
228
+ }
229
+ return arr;
230
+ }
231
+ };
232
+ }
233
+ function safeStorage(type) {
234
+ try {
235
+ if (typeof window === 'undefined')
236
+ return undefined;
237
+ const s = type === 'local' ? window.localStorage : window.sessionStorage;
238
+ const testKey = '__iv_cache_test__';
239
+ s.setItem(testKey, '1');
240
+ s.removeItem(testKey);
241
+ return s;
242
+ }
243
+ catch {
244
+ return undefined;
245
+ }
246
+ }
247
+ function createMemoryAdapter() {
248
+ const map = new Map();
249
+ return {
250
+ getItem: k => map.get(k) || null,
251
+ setItem: (k, v) => { map.set(k, v); },
252
+ removeItem: k => { map.delete(k); },
253
+ keys: () => Array.from(map.keys())
254
+ };
255
+ }
256
+ function byteLength(str) {
257
+ if (typeof Blob !== 'undefined')
258
+ return new Blob([str]).size;
259
+ // fallback rough estimate
260
+ return encodeURIComponent(str).replace(/%../g, 'x').length;
261
+ }
262
+ /*
263
+ USAGE EXAMPLES (iv-dynamic-products):
264
+
265
+ import { createCache } from '../../utils/caching/factory';
266
+ import { fetchProducts } from '../../utils/storefront_api/factory';
267
+
268
+ const productCache = createCache({
269
+ namespace: 'iv-dynamic-products',
270
+ version: '1',
271
+ storage: 'local',
272
+ defaultTTL: 1000 * 60 * 5, // 5 minutes fresh
273
+ staleTTL: 1000 * 60 * 5 // additional 5 minutes stale window
274
+ });
275
+
276
+ async function loadProducts(params) {
277
+ const data = await productCache.getOrSetData(
278
+ { handle: params.handle, sort: params.sort, fields: params.fields, limit: params.limit, currency: params.currency },
279
+ () => fetchProducts(params),
280
+ { ttl: 1000 * 60 * 5, staleWhileRevalidate: true }
281
+ );
282
+ // assign to component state & let Stencil render
283
+ this.products = data;
284
+ }
285
+
286
+ // Optional MARKUP caching (only if safe & static):
287
+ async function getMarkupFast(params) {
288
+ return productCache.getOrSetMarkup(
289
+ { handle: params.handle, sort: params.sort, limit: params.limit },
290
+ async () => {
291
+ const data = await fetchProducts(params);
292
+ // build HTML string (ensure no dynamic listeners needed)
293
+ return data.map(p => `<div class=\"iv-card\">${p.title}</div>`).join('');
294
+ },
295
+ { ttl: 1000 * 60 * 2, staleWhileRevalidate: true }
296
+ );
297
+ }
298
+
299
+ /*
300
+ ============================================================
301
+ CACHING FACTORY – USAGE & RATIONALE NOTES
302
+ ============================================================
303
+ Purpose:
304
+ Provide a unified, lightweight, observable cache for normalized DATA (preferred) and optionally static MARKUP.
305
+ Designed to prevent redundant Shopify Storefront API calls across multiple component instances / navigations.
306
+
307
+ Core Concepts:
308
+ Key Derivation: stable, deterministic hash of (params + namespace + version + type).
309
+ Data vs Markup: Markup support exists but is discouraged for interactive Stencil components (event binding loss).
310
+ Fresh vs Stale vs Expired:
311
+ - fresh: age <= ttl
312
+ - expired + stale window active: treat as stale (returned immediately if staleWhileRevalidate enabled)
313
+ - expired beyond stale window: treated as miss
314
+ Stale‑While‑Revalidate: returns stale value immediately while background refresh updates cache.
315
+ Inflight Dedupe: concurrent requests for same key share the same Promise.
316
+ Size Guard: prevents storing overly large payloads (default ~250KB serialized).
317
+ Soft Eviction: oldest entries removed when exceeding maxEntries (checked every 20 writes).
318
+ Events: CustomEvent 'iv-cache' with actions (hit|miss|stale|set|purge|error|evict) for telemetry / debugging.
319
+
320
+ Recommended Usage Pattern (Data):
321
+ 1. Create one shared cache per domain concern (e.g. productCache, predictiveSearchCache).
322
+ 2. Always cache normalized data objects – keep UI rendering inside Stencil.
323
+ 3. Include parameters that materially affect the response in the key params object (collection handle, sort key, limit, currency).
324
+ 4. Use staleWhileRevalidate for UX smoothness (fast paint + silent refresh).
325
+ 5. Avoid caching partial markup for interactive components.
326
+
327
+ Example (Products):
328
+ import { productCache } from '../caching/productCache';
329
+ import { fetchProducts } from '../storefront_api/factory';
330
+ const products = await productCache.getOrSetData(
331
+ { handle, sort, limit, fields, currency },
332
+ () => fetchProducts({ collectionHandle: handle, sortKey: sort, limit, fields }),
333
+ { ttl: 1000 * 60 * 5, staleWhileRevalidate: true }
334
+ );
335
+
336
+ Deciding TTL / Stale:
337
+ High traffic / slow changing catalog: longer ttl (5–15m) + generous stale window.
338
+ Rapidly changing pricing/inventory: shorter ttl (1–2m) or disable stale if consistency is critical.
339
+
340
+ When NOT to Use This Cache:
341
+ - Server authoritative real-time inventory checks pre‑purchase.
342
+ - Personalized data (user-specific recommendations) unless key includes identity.
343
+ - Security sensitive payloads (never store secrets / tokens).
344
+
345
+ Extensibility Ideas:
346
+ - BroadcastChannel or storage event listener to sync invalidations across tabs.
347
+ - Add diff hashing of payload to skip downstream re-renders.
348
+ - Integrate global telemetry to record hit/miss ratio.
349
+
350
+ Debugging Tips:
351
+ window.addEventListener('iv-cache', e => console.log('cache event', e.detail));
352
+ productCache.clearNamespace() // manual purge
353
+
354
+ Migration Path If Dropping Markup:
355
+ 1. Remove 'markup' references and helpers.
356
+ 2. Narrow CacheStored.t to implicit 'data'.
357
+ 3. Delete keyForMarkup / setMarkup / getMarkup / getOrSetMarkup usages.
358
+
359
+ Safety Notes:
360
+ - Serialization errors are caught and emitted as 'error' events.
361
+ - Oversize entries are skipped (no partial writes).
362
+ - Stale return path never blocks UI; refresh runs through same deduped pipeline.
363
+ ============================================================
364
+ */
365
+
366
+ // Shared product cache singleton for product-related data across components.
367
+ // Focused on data (not markup) to preserve Stencil lifecycle & event binding.
368
+ // Includes stale-while-revalidate so multiple component instances reuse results.
369
+ const productCache = createCache({
370
+ namespace: 'products',
371
+ version: '1',
372
+ storage: 'local',
373
+ defaultTTL: 1000 * 60 * 5, // 5 minutes fresh
374
+ staleTTL: 1000 * 60 * 5, // additional 5 minutes stale window
375
+ dispatchEvents: true
376
+ });
377
+ /*
378
+ ============================================================
379
+ PRODUCT CACHE – USAGE NOTES
380
+ ============================================================
381
+ Goal:
382
+ Provide a shared, cross-component data cache for normalized Shopify product lists.
383
+ Prevents duplicate Storefront API queries when multiple components (e.g. carousels, grids) request the same dataset.
384
+
385
+ Why Data (Not Markup):
386
+ Data caching keeps Stencil's render lifecycle & event listeners intact.
387
+ Markup caching risks stale styling, missed hydration, lost interactivity.
388
+
389
+ Key Parameters Included in Cache Key:
390
+ handle : collection or 'all'
391
+ sort : sort key (BEST_SELLING, PRICE, etc.)
392
+ fields : requested GraphQL fields (affects shape / payload size)
393
+ limit : number of products
394
+ currency : ensures price formatting differences are segregated
395
+
396
+ Stale-While-Revalidate Flow:
397
+ 1. Fresh hit -> returned immediately.
398
+ 2. Expired but within stale window + staleWhileRevalidate=true -> stale data returned; background refresh updates cache.
399
+ 3. Expired beyond stale window -> treated as miss; new fetch awaited.
400
+
401
+ Basic Usage in a Component:
402
+ import { productCache } from '../../utils/caching/productCache';
403
+ import { fetchProducts } from '../../utils/storefront_api/factory';
404
+
405
+ async function load() {
406
+ const params = { handle: 'all', sort: 'BEST_SELLING', fields: 'id,title,images', limit: 8, currency: 'GBP' };
407
+ const products = await productCache.getOrSetData(
408
+ params,
409
+ () => fetchProducts({
410
+ collectionHandle: params.handle,
411
+ sortKey: params.sort,
412
+ limit: params.limit,
413
+ fields: params.fields,
414
+ }),
415
+ { ttl: 1000 * 60 * 5, staleWhileRevalidate: true }
416
+ );
417
+ // render products...
418
+ }
419
+
420
+ Listening for Cache Diagnostics:
421
+ window.addEventListener('iv-cache', e => {
422
+ const { action, key, namespace, info } = (e as CustomEvent).detail;
423
+ if(namespace === 'products') console.debug('[productCache]', action, { key, info });
424
+ });
425
+
426
+ Manual Invalidation Examples:
427
+ productCache.clearNamespace(); // purge everything in 'products'
428
+ // or targeted:
429
+ // productCache.purge(specificKey);
430
+
431
+ Adjusting Freshness Strategy:
432
+ - High stability content: increase defaultTTL (10–15m) + keep staleTTL (same or larger).
433
+ - Rapid inventory changes: shorten TTL (1–2m) or disable staleWhileRevalidate on critical views.
434
+
435
+ Extending:
436
+ - Add a lightweight wrapper that injects user segment into params if personalization introduced.
437
+ - Introduce a background warm-up (call getOrSetData on route prefetch).
438
+
439
+ Safety:
440
+ - Oversize payloads are ignored (error event emitted) to guard storage quota.
441
+ - Serialization failures fail open (miss on next access).
442
+ ============================================================
443
+ */
444
+
445
+ function createErrorHandler(config = {}) {
446
+ const { component, toast, toastDuration = 3000, emitEvents = true, target = window, classifier, dedupeMs = 4000, defaultUserMessage = 'Something went wrong. Please try again.', maxConsoleStack = 6, telemetry, _sharedRecent } = config;
447
+ const recent = _sharedRecent || new Map();
448
+ function severityToToastType(sev) {
449
+ if (sev === 'warn')
450
+ return 'warning';
451
+ if (sev === 'debug' || sev === 'info')
452
+ return 'info';
453
+ return 'error';
454
+ }
455
+ function dispatchToast(message, severity) {
456
+ const type = severityToToastType(severity);
457
+ try {
458
+ toast ? toast({ message, variant: type }) : index.showToast(message, type, toastDuration);
459
+ }
460
+ catch (_) { /* swallow toast errors */ }
461
+ }
462
+ function classify(base) {
463
+ let severity = base.severity || base.level || 'error';
464
+ let userSafe = !!base.userMessage;
465
+ let userMessage = base.userMessage;
466
+ const err = base.error;
467
+ const isNetwork = err?.name === 'TypeError' && /fetch/i.test(err?.message || '');
468
+ if (isNetwork) {
469
+ userSafe = true;
470
+ userMessage ||= 'Network issue. Please retry.';
471
+ }
472
+ const status = err?.status || err?.response?.status;
473
+ if (status) {
474
+ if (status >= 400 && status < 500)
475
+ userSafe = true;
476
+ if (status >= 500) {
477
+ userSafe = false;
478
+ severity = 'error';
479
+ }
480
+ }
481
+ if (!userMessage && userSafe)
482
+ userMessage = defaultUserMessage;
483
+ if (classifier) {
484
+ const override = classifier({ error: err, scope: base.scope }) || {};
485
+ if (override.userSafe !== undefined)
486
+ userSafe = override.userSafe;
487
+ if (override.severity)
488
+ severity = override.severity;
489
+ if (override.userMessage)
490
+ userMessage = override.userMessage;
491
+ }
492
+ if (!userSafe)
493
+ userMessage = undefined;
494
+ return { userSafe, severity, userMessage };
495
+ }
496
+ function dedupeKey(n) {
497
+ return `${n.component || ''}|${n.scope}|${n.devMessage || n.userMessage || n.raw?.message || ''}|${n.severity}`;
498
+ }
499
+ function handle(opts) {
500
+ const { error, scope, devMessage, meta } = opts;
501
+ const { userSafe, severity, userMessage } = classify(opts);
502
+ const stack = (error?.stack || '').split('\n').slice(0, maxConsoleStack).join('\n');
503
+ const normalized = {
504
+ id: crypto?.randomUUID ? crypto.randomUUID() : Date.now().toString(36) + Math.random().toString(36).slice(2),
505
+ ts: Date.now(),
506
+ component,
507
+ scope,
508
+ severity,
509
+ userSafe,
510
+ userMessage,
511
+ devMessage: devMessage ?? (userSafe ? error?.message : undefined),
512
+ raw: error,
513
+ meta,
514
+ stack
515
+ };
516
+ if (telemetry?.enrich) {
517
+ try {
518
+ Object.assign(normalized, telemetry.enrich(normalized));
519
+ }
520
+ catch (_) { }
521
+ }
522
+ const key = dedupeKey(normalized);
523
+ const last = recent.get(key);
524
+ last && (Date.now() - last) < dedupeMs ? normalized.deduped = true : recent.set(key, Date.now());
525
+ const consolePayload = { ...normalized, raw: undefined };
526
+ if (severity === 'debug')
527
+ console.debug('[iv-error]', consolePayload, error);
528
+ else if (severity === 'info')
529
+ console.info('[iv-error]', consolePayload, error);
530
+ else if (severity === 'warn')
531
+ console.warn('[iv-error]', consolePayload, error);
532
+ else
533
+ console.error('[iv-error]', consolePayload, error);
534
+ if (userSafe && !normalized.deduped && userMessage) {
535
+ dispatchToast(userMessage, severity);
536
+ }
537
+ if (emitEvents && (opts.emitEvent !== false) && target && typeof target.dispatchEvent === 'function') {
538
+ try {
539
+ target.dispatchEvent(new CustomEvent('iv-error', { detail: normalized, bubbles: true, composed: true }));
540
+ }
541
+ catch (_) { }
542
+ }
543
+ if (telemetry && (!telemetry.sampleRate || Math.random() < telemetry.sampleRate)) {
544
+ if (!telemetry.filter || telemetry.filter(normalized)) {
545
+ try {
546
+ Promise.resolve(telemetry.record(normalized)).catch(() => { });
547
+ }
548
+ catch (_) { }
549
+ }
550
+ }
551
+ return normalized;
552
+ }
553
+ return { handle };
554
+ }
555
+ // Usage in a component:
556
+ /*
557
+ import { createErrorHandler } from '../../utils/error_handling/factory';
558
+ const errors = createErrorHandler({ component: 'iv-dynamic-products', toast: showToast });
559
+
560
+ try {
561
+ await fetchProducts(...);
562
+ } catch(err) {
563
+ errors.handle({
564
+ error: err,
565
+ scope: 'fetchProducts',
566
+ userMessage: 'Could not load products.',
567
+ devMessage: 'Storefront API fetch failed',
568
+ severity: 'error'
569
+ });
570
+ }
571
+
572
+ So simplest component usage:
573
+ const errors = createErrorHandler({ component: 'iv-card' }); try { ... } catch (e) { errors.handle({ error: e, scope: 'load', userMessage: 'Failed to load.' }); }
574
+ */
575
+
576
+ exports.createErrorHandler = createErrorHandler;
577
+ exports.productCache = productCache;
578
+ //# sourceMappingURL=factory-CffqQl1G.js.map
579
+
580
+ //# sourceMappingURL=factory-CffqQl1G.js.map