@aglyn/plugins-commerce 1.0.0-beta.143

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 (417) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +10 -0
  3. package/package.json +57 -0
  4. package/src/index.d.ts +38 -0
  5. package/src/index.js +38 -0
  6. package/src/index.js.map +1 -0
  7. package/src/lib/components/account.d.ts +31 -0
  8. package/src/lib/components/account.js +645 -0
  9. package/src/lib/components/account.js.map +1 -0
  10. package/src/lib/components/cart.d.ts +38 -0
  11. package/src/lib/components/cart.js +851 -0
  12. package/src/lib/components/cart.js.map +1 -0
  13. package/src/lib/components/commerce-console-page.d.ts +32 -0
  14. package/src/lib/components/commerce-console-page.js +296 -0
  15. package/src/lib/components/commerce-console-page.js.map +1 -0
  16. package/src/lib/components/commerce-console-sections.d.ts +34 -0
  17. package/src/lib/components/commerce-console-sections.js +62 -0
  18. package/src/lib/components/commerce-console-sections.js.map +1 -0
  19. package/src/lib/components/console/catalog-organization-card.component.d.ts +14 -0
  20. package/src/lib/components/console/catalog-organization-card.component.js +1087 -0
  21. package/src/lib/components/console/catalog-organization-card.component.js.map +1 -0
  22. package/src/lib/components/console/commerce-analytics-card.component.d.ts +27 -0
  23. package/src/lib/components/console/commerce-analytics-card.component.js +310 -0
  24. package/src/lib/components/console/commerce-analytics-card.component.js.map +1 -0
  25. package/src/lib/components/console/commerce-glance-card.component.d.ts +20 -0
  26. package/src/lib/components/console/commerce-glance-card.component.js +340 -0
  27. package/src/lib/components/console/commerce-glance-card.component.js.map +1 -0
  28. package/src/lib/components/console/commerce-stat-tile.component.d.ts +37 -0
  29. package/src/lib/components/console/commerce-stat-tile.component.js +72 -0
  30. package/src/lib/components/console/commerce-stat-tile.component.js.map +1 -0
  31. package/src/lib/components/console/discounts-card.component.d.ts +14 -0
  32. package/src/lib/components/console/discounts-card.component.js +443 -0
  33. package/src/lib/components/console/discounts-card.component.js.map +1 -0
  34. package/src/lib/components/console/entitlement-gate.component.d.ts +76 -0
  35. package/src/lib/components/console/entitlement-gate.component.js +115 -0
  36. package/src/lib/components/console/entitlement-gate.component.js.map +1 -0
  37. package/src/lib/components/console/gift-cards-card.component.d.ts +29 -0
  38. package/src/lib/components/console/gift-cards-card.component.js +379 -0
  39. package/src/lib/components/console/gift-cards-card.component.js.map +1 -0
  40. package/src/lib/components/console/host-coupons-card.component.d.ts +14 -0
  41. package/src/lib/components/console/host-coupons-card.component.js +252 -0
  42. package/src/lib/components/console/host-coupons-card.component.js.map +1 -0
  43. package/src/lib/components/console/host-orders-card.component.d.ts +13 -0
  44. package/src/lib/components/console/host-orders-card.component.js +861 -0
  45. package/src/lib/components/console/host-orders-card.component.js.map +1 -0
  46. package/src/lib/components/console/locations-card.component.d.ts +14 -0
  47. package/src/lib/components/console/locations-card.component.js +256 -0
  48. package/src/lib/components/console/locations-card.component.js.map +1 -0
  49. package/src/lib/components/console/member-posts-card.component.d.ts +8 -0
  50. package/src/lib/components/console/member-posts-card.component.js +283 -0
  51. package/src/lib/components/console/member-posts-card.component.js.map +1 -0
  52. package/src/lib/components/console/newest-site-users-card.component.d.ts +36 -0
  53. package/src/lib/components/console/newest-site-users-card.component.js +126 -0
  54. package/src/lib/components/console/newest-site-users-card.component.js.map +1 -0
  55. package/src/lib/components/console/order-detail-dialog.component.d.ts +28 -0
  56. package/src/lib/components/console/order-detail-dialog.component.js +976 -0
  57. package/src/lib/components/console/order-detail-dialog.component.js.map +1 -0
  58. package/src/lib/components/console/paid-media.d.ts +127 -0
  59. package/src/lib/components/console/paid-media.js +397 -0
  60. package/src/lib/components/console/paid-media.js.map +1 -0
  61. package/src/lib/components/console/payments-settings-card.component.d.ts +13 -0
  62. package/src/lib/components/console/payments-settings-card.component.js +295 -0
  63. package/src/lib/components/console/payments-settings-card.component.js.map +1 -0
  64. package/src/lib/components/console/pos-page.component.d.ts +13 -0
  65. package/src/lib/components/console/pos-page.component.js +916 -0
  66. package/src/lib/components/console/pos-page.component.js.map +1 -0
  67. package/src/lib/components/console/product-editor-dialog.component.d.ts +32 -0
  68. package/src/lib/components/console/product-editor-dialog.component.js +1374 -0
  69. package/src/lib/components/console/product-editor-dialog.component.js.map +1 -0
  70. package/src/lib/components/console/products-hub-card.component.d.ts +16 -0
  71. package/src/lib/components/console/products-hub-card.component.js +1280 -0
  72. package/src/lib/components/console/products-hub-card.component.js.map +1 -0
  73. package/src/lib/components/console/products-hub-zone.component.d.ts +50 -0
  74. package/src/lib/components/console/products-hub-zone.component.js +200 -0
  75. package/src/lib/components/console/products-hub-zone.component.js.map +1 -0
  76. package/src/lib/components/console/recovery-queue-card.component.d.ts +39 -0
  77. package/src/lib/components/console/recovery-queue-card.component.js +262 -0
  78. package/src/lib/components/console/recovery-queue-card.component.js.map +1 -0
  79. package/src/lib/components/console/registers-card.component.d.ts +21 -0
  80. package/src/lib/components/console/registers-card.component.js +296 -0
  81. package/src/lib/components/console/registers-card.component.js.map +1 -0
  82. package/src/lib/components/console/reservations-card.component.d.ts +14 -0
  83. package/src/lib/components/console/reservations-card.component.js +650 -0
  84. package/src/lib/components/console/reservations-card.component.js.map +1 -0
  85. package/src/lib/components/console/reviews-moderation-card.component.d.ts +8 -0
  86. package/src/lib/components/console/reviews-moderation-card.component.js +235 -0
  87. package/src/lib/components/console/reviews-moderation-card.component.js.map +1 -0
  88. package/src/lib/components/console/shipping-settings-card.component.d.ts +38 -0
  89. package/src/lib/components/console/shipping-settings-card.component.js +560 -0
  90. package/src/lib/components/console/shipping-settings-card.component.js.map +1 -0
  91. package/src/lib/components/console/stock-movements-card.component.d.ts +31 -0
  92. package/src/lib/components/console/stock-movements-card.component.js +333 -0
  93. package/src/lib/components/console/stock-movements-card.component.js.map +1 -0
  94. package/src/lib/components/console/store-settings-card.component.d.ts +14 -0
  95. package/src/lib/components/console/store-settings-card.component.js +300 -0
  96. package/src/lib/components/console/store-settings-card.component.js.map +1 -0
  97. package/src/lib/components/console/storefront-tax-summary-card.component.d.ts +73 -0
  98. package/src/lib/components/console/storefront-tax-summary-card.component.js +408 -0
  99. package/src/lib/components/console/storefront-tax-summary-card.component.js.map +1 -0
  100. package/src/lib/components/console/suppliers-card.component.d.ts +8 -0
  101. package/src/lib/components/console/suppliers-card.component.js +328 -0
  102. package/src/lib/components/console/suppliers-card.component.js.map +1 -0
  103. package/src/lib/components/console/tax-settings-card.component.d.ts +14 -0
  104. package/src/lib/components/console/tax-settings-card.component.js +473 -0
  105. package/src/lib/components/console/tax-settings-card.component.js.map +1 -0
  106. package/src/lib/components/gate.d.ts +39 -0
  107. package/src/lib/components/gate.js +202 -0
  108. package/src/lib/components/gate.js.map +1 -0
  109. package/src/lib/components/gated-video.d.ts +40 -0
  110. package/src/lib/components/gated-video.js +366 -0
  111. package/src/lib/components/gated-video.js.map +1 -0
  112. package/src/lib/components/member-feed.d.ts +32 -0
  113. package/src/lib/components/member-feed.js +198 -0
  114. package/src/lib/components/member-feed.js.map +1 -0
  115. package/src/lib/components/member-recovery.d.ts +35 -0
  116. package/src/lib/components/member-recovery.js +313 -0
  117. package/src/lib/components/member-recovery.js.map +1 -0
  118. package/src/lib/components/member-signin.d.ts +35 -0
  119. package/src/lib/components/member-signin.js +257 -0
  120. package/src/lib/components/member-signin.js.map +1 -0
  121. package/src/lib/components/member-signup.d.ts +34 -0
  122. package/src/lib/components/member-signup.js +287 -0
  123. package/src/lib/components/member-signup.js.map +1 -0
  124. package/src/lib/components/newsletter-signup.d.ts +39 -0
  125. package/src/lib/components/newsletter-signup.js +229 -0
  126. package/src/lib/components/newsletter-signup.js.map +1 -0
  127. package/src/lib/components/product-detail.d.ts +38 -0
  128. package/src/lib/components/product-detail.js +1022 -0
  129. package/src/lib/components/product-detail.js.map +1 -0
  130. package/src/lib/components/product-grid.d.ts +67 -0
  131. package/src/lib/components/product-grid.js +909 -0
  132. package/src/lib/components/product-grid.js.map +1 -0
  133. package/src/lib/components/product-reviews.d.ts +32 -0
  134. package/src/lib/components/product-reviews.js +349 -0
  135. package/src/lib/components/product-reviews.js.map +1 -0
  136. package/src/lib/components/related-products.d.ts +33 -0
  137. package/src/lib/components/related-products.js +232 -0
  138. package/src/lib/components/related-products.js.map +1 -0
  139. package/src/lib/components/reservation-widget.d.ts +33 -0
  140. package/src/lib/components/reservation-widget.js +418 -0
  141. package/src/lib/components/reservation-widget.js.map +1 -0
  142. package/src/lib/components/storefront-payment-element-fallback.d.ts +18 -0
  143. package/src/lib/components/storefront-payment-element-fallback.js +51 -0
  144. package/src/lib/components/storefront-payment-element-fallback.js.map +1 -0
  145. package/src/lib/components/storefront-payment-element.d.ts +78 -0
  146. package/src/lib/components/storefront-payment-element.js +156 -0
  147. package/src/lib/components/storefront-payment-element.js.map +1 -0
  148. package/src/lib/components/wishlist.d.ts +46 -0
  149. package/src/lib/components/wishlist.js +304 -0
  150. package/src/lib/components/wishlist.js.map +1 -0
  151. package/src/lib/constants/bundle-common.d.ts +18 -0
  152. package/src/lib/constants/bundle-common.js +18 -0
  153. package/src/lib/constants/bundle-common.js.map +1 -0
  154. package/src/lib/constants/product-filters.d.ts +35 -0
  155. package/src/lib/constants/product-filters.js +109 -0
  156. package/src/lib/constants/product-filters.js.map +1 -0
  157. package/src/lib/model/commerce-cart.d.ts +52 -0
  158. package/src/lib/model/commerce-cart.js +102 -0
  159. package/src/lib/model/commerce-cart.js.map +1 -0
  160. package/src/lib/model/commerce-connect-transfer.d.ts +243 -0
  161. package/src/lib/model/commerce-connect-transfer.js +231 -0
  162. package/src/lib/model/commerce-connect-transfer.js.map +1 -0
  163. package/src/lib/model/commerce-discounts.d.ts +164 -0
  164. package/src/lib/model/commerce-discounts.js +231 -0
  165. package/src/lib/model/commerce-discounts.js.map +1 -0
  166. package/src/lib/model/commerce-dispute.d.ts +124 -0
  167. package/src/lib/model/commerce-dispute.js +225 -0
  168. package/src/lib/model/commerce-dispute.js.map +1 -0
  169. package/src/lib/model/commerce-gift-cards.d.ts +107 -0
  170. package/src/lib/model/commerce-gift-cards.js +121 -0
  171. package/src/lib/model/commerce-gift-cards.js.map +1 -0
  172. package/src/lib/model/commerce-io.d.ts +36 -0
  173. package/src/lib/model/commerce-io.js +245 -0
  174. package/src/lib/model/commerce-io.js.map +1 -0
  175. package/src/lib/model/commerce-orders.d.ts +1040 -0
  176. package/src/lib/model/commerce-orders.js +1022 -0
  177. package/src/lib/model/commerce-orders.js.map +1 -0
  178. package/src/lib/model/commerce-promotions.d.ts +188 -0
  179. package/src/lib/model/commerce-promotions.js +199 -0
  180. package/src/lib/model/commerce-promotions.js.map +1 -0
  181. package/src/lib/model/commerce-reservations.d.ts +175 -0
  182. package/src/lib/model/commerce-reservations.js +157 -0
  183. package/src/lib/model/commerce-reservations.js.map +1 -0
  184. package/src/lib/model/commerce-shipping.d.ts +316 -0
  185. package/src/lib/model/commerce-shipping.js +484 -0
  186. package/src/lib/model/commerce-shipping.js.map +1 -0
  187. package/src/lib/model/commerce-stock-holds.d.ts +199 -0
  188. package/src/lib/model/commerce-stock-holds.js +190 -0
  189. package/src/lib/model/commerce-stock-holds.js.map +1 -0
  190. package/src/lib/model/commerce-subscription-status.d.ts +67 -0
  191. package/src/lib/model/commerce-subscription-status.js +76 -0
  192. package/src/lib/model/commerce-subscription-status.js.map +1 -0
  193. package/src/lib/model/commerce-tax-decision.d.ts +222 -0
  194. package/src/lib/model/commerce-tax-decision.js +165 -0
  195. package/src/lib/model/commerce-tax-decision.js.map +1 -0
  196. package/src/lib/model/commerce-tax.d.ts +176 -0
  197. package/src/lib/model/commerce-tax.js +92 -0
  198. package/src/lib/model/commerce-tax.js.map +1 -0
  199. package/src/lib/model/commerce.d.ts +551 -0
  200. package/src/lib/model/commerce.js +739 -0
  201. package/src/lib/model/commerce.js.map +1 -0
  202. package/src/lib/model/index.d.ts +40 -0
  203. package/src/lib/model/index.js +40 -0
  204. package/src/lib/model/index.js.map +1 -0
  205. package/src/lib/model/order-figures.d.ts +48 -0
  206. package/src/lib/model/order-figures.js +74 -0
  207. package/src/lib/model/order-figures.js.map +1 -0
  208. package/src/lib/model/plugin-permissions.d.ts +23 -0
  209. package/src/lib/model/plugin-permissions.js +34 -0
  210. package/src/lib/model/plugin-permissions.js.map +1 -0
  211. package/src/lib/model/purchase-analytics.d.ts +186 -0
  212. package/src/lib/model/purchase-analytics.js +216 -0
  213. package/src/lib/model/purchase-analytics.js.map +1 -0
  214. package/src/lib/plugin-config.d.ts +62 -0
  215. package/src/lib/plugin-config.js +78 -0
  216. package/src/lib/plugin-config.js.map +1 -0
  217. package/src/lib/plugin.d.ts +28 -0
  218. package/src/lib/plugin.js +147 -0
  219. package/src/lib/plugin.js.map +1 -0
  220. package/src/lib/server/billing-webhook.d.ts +26 -0
  221. package/src/lib/server/billing-webhook.js +4011 -0
  222. package/src/lib/server/billing-webhook.js.map +1 -0
  223. package/src/lib/server/cancel-order.d.ts +87 -0
  224. package/src/lib/server/cancel-order.js +368 -0
  225. package/src/lib/server/cancel-order.js.map +1 -0
  226. package/src/lib/server/cart-checkout.d.ts +25 -0
  227. package/src/lib/server/cart-checkout.js +976 -0
  228. package/src/lib/server/cart-checkout.js.map +1 -0
  229. package/src/lib/server/cart-cookie.d.ts +32 -0
  230. package/src/lib/server/cart-cookie.js +77 -0
  231. package/src/lib/server/cart-cookie.js.map +1 -0
  232. package/src/lib/server/cart.d.ts +34 -0
  233. package/src/lib/server/cart.js +181 -0
  234. package/src/lib/server/cart.js.map +1 -0
  235. package/src/lib/server/catalog.d.ts +127 -0
  236. package/src/lib/server/catalog.js +277 -0
  237. package/src/lib/server/catalog.js.map +1 -0
  238. package/src/lib/server/checkout.d.ts +36 -0
  239. package/src/lib/server/checkout.js +915 -0
  240. package/src/lib/server/checkout.js.map +1 -0
  241. package/src/lib/server/connect.d.ts +26 -0
  242. package/src/lib/server/connect.js +238 -0
  243. package/src/lib/server/connect.js.map +1 -0
  244. package/src/lib/server/contact-refund.d.ts +117 -0
  245. package/src/lib/server/contact-refund.js +196 -0
  246. package/src/lib/server/contact-refund.js.map +1 -0
  247. package/src/lib/server/download.d.ts +39 -0
  248. package/src/lib/server/download.js +206 -0
  249. package/src/lib/server/download.js.map +1 -0
  250. package/src/lib/server/draft-order.d.ts +26 -0
  251. package/src/lib/server/draft-order.js +706 -0
  252. package/src/lib/server/draft-order.js.map +1 -0
  253. package/src/lib/server/feed.d.ts +24 -0
  254. package/src/lib/server/feed.js +59 -0
  255. package/src/lib/server/feed.js.map +1 -0
  256. package/src/lib/server/fulfill-order.d.ts +97 -0
  257. package/src/lib/server/fulfill-order.js +235 -0
  258. package/src/lib/server/fulfill-order.js.map +1 -0
  259. package/src/lib/server/gate.d.ts +36 -0
  260. package/src/lib/server/gate.js +112 -0
  261. package/src/lib/server/gate.js.map +1 -0
  262. package/src/lib/server/gift-cards.d.ts +42 -0
  263. package/src/lib/server/gift-cards.js +219 -0
  264. package/src/lib/server/gift-cards.js.map +1 -0
  265. package/src/lib/server/low-stock.d.ts +49 -0
  266. package/src/lib/server/low-stock.js +60 -0
  267. package/src/lib/server/low-stock.js.map +1 -0
  268. package/src/lib/server/manual-tax-rate.d.ts +82 -0
  269. package/src/lib/server/manual-tax-rate.js +113 -0
  270. package/src/lib/server/manual-tax-rate.js.map +1 -0
  271. package/src/lib/server/member-feed.d.ts +24 -0
  272. package/src/lib/server/member-feed.js +72 -0
  273. package/src/lib/server/member-feed.js.map +1 -0
  274. package/src/lib/server/member-name-search.d.ts +37 -0
  275. package/src/lib/server/member-name-search.js +42 -0
  276. package/src/lib/server/member-name-search.js.map +1 -0
  277. package/src/lib/server/member-post.d.ts +23 -0
  278. package/src/lib/server/member-post.js +166 -0
  279. package/src/lib/server/member-post.js.map +1 -0
  280. package/src/lib/server/membership-account.d.ts +37 -0
  281. package/src/lib/server/membership-account.js +148 -0
  282. package/src/lib/server/membership-account.js.map +1 -0
  283. package/src/lib/server/membership-admin-password.d.ts +33 -0
  284. package/src/lib/server/membership-admin-password.js +202 -0
  285. package/src/lib/server/membership-admin-password.js.map +1 -0
  286. package/src/lib/server/membership-content.d.ts +23 -0
  287. package/src/lib/server/membership-content.js +105 -0
  288. package/src/lib/server/membership-content.js.map +1 -0
  289. package/src/lib/server/membership-login.d.ts +19 -0
  290. package/src/lib/server/membership-login.js +137 -0
  291. package/src/lib/server/membership-login.js.map +1 -0
  292. package/src/lib/server/membership-logout.d.ts +19 -0
  293. package/src/lib/server/membership-logout.js +35 -0
  294. package/src/lib/server/membership-logout.js.map +1 -0
  295. package/src/lib/server/membership-recover.d.ts +60 -0
  296. package/src/lib/server/membership-recover.js +244 -0
  297. package/src/lib/server/membership-recover.js.map +1 -0
  298. package/src/lib/server/membership-register.d.ts +22 -0
  299. package/src/lib/server/membership-register.js +241 -0
  300. package/src/lib/server/membership-register.js.map +1 -0
  301. package/src/lib/server/membership-reset.d.ts +26 -0
  302. package/src/lib/server/membership-reset.js +88 -0
  303. package/src/lib/server/membership-reset.js.map +1 -0
  304. package/src/lib/server/membership-wishlist.d.ts +23 -0
  305. package/src/lib/server/membership-wishlist.js +89 -0
  306. package/src/lib/server/membership-wishlist.js.map +1 -0
  307. package/src/lib/server/membership.d.ts +96 -0
  308. package/src/lib/server/membership.js +222 -0
  309. package/src/lib/server/membership.js.map +1 -0
  310. package/src/lib/server/native-checkout.d.ts +170 -0
  311. package/src/lib/server/native-checkout.js +193 -0
  312. package/src/lib/server/native-checkout.js.map +1 -0
  313. package/src/lib/server/newsletter.d.ts +23 -0
  314. package/src/lib/server/newsletter.js +323 -0
  315. package/src/lib/server/newsletter.js.map +1 -0
  316. package/src/lib/server/notify-restock.d.ts +22 -0
  317. package/src/lib/server/notify-restock.js +84 -0
  318. package/src/lib/server/notify-restock.js.map +1 -0
  319. package/src/lib/server/order-analytics.d.ts +134 -0
  320. package/src/lib/server/order-analytics.js +263 -0
  321. package/src/lib/server/order-analytics.js.map +1 -0
  322. package/src/lib/server/order-figures.d.ts +33 -0
  323. package/src/lib/server/order-figures.js +220 -0
  324. package/src/lib/server/order-figures.js.map +1 -0
  325. package/src/lib/server/paid-media-delivery.d.ts +173 -0
  326. package/src/lib/server/paid-media-delivery.js +212 -0
  327. package/src/lib/server/paid-media-delivery.js.map +1 -0
  328. package/src/lib/server/pos-order.d.ts +54 -0
  329. package/src/lib/server/pos-order.js +1137 -0
  330. package/src/lib/server/pos-order.js.map +1 -0
  331. package/src/lib/server/process-abandoned.d.ts +54 -0
  332. package/src/lib/server/process-abandoned.js +222 -0
  333. package/src/lib/server/process-abandoned.js.map +1 -0
  334. package/src/lib/server/process-restock.d.ts +42 -0
  335. package/src/lib/server/process-restock.js +219 -0
  336. package/src/lib/server/process-restock.js.map +1 -0
  337. package/src/lib/server/product-card.d.ts +29 -0
  338. package/src/lib/server/product-card.js +54 -0
  339. package/src/lib/server/product-card.js.map +1 -0
  340. package/src/lib/server/product.d.ts +70 -0
  341. package/src/lib/server/product.js +105 -0
  342. package/src/lib/server/product.js.map +1 -0
  343. package/src/lib/server/promotion-hold.d.ts +144 -0
  344. package/src/lib/server/promotion-hold.js +174 -0
  345. package/src/lib/server/promotion-hold.js.map +1 -0
  346. package/src/lib/server/reconcile-stock.d.ts +106 -0
  347. package/src/lib/server/reconcile-stock.js +349 -0
  348. package/src/lib/server/reconcile-stock.js.map +1 -0
  349. package/src/lib/server/refund.d.ts +45 -0
  350. package/src/lib/server/refund.js +607 -0
  351. package/src/lib/server/refund.js.map +1 -0
  352. package/src/lib/server/related.d.ts +24 -0
  353. package/src/lib/server/related.js +104 -0
  354. package/src/lib/server/related.js.map +1 -0
  355. package/src/lib/server/reservation-availability.d.ts +23 -0
  356. package/src/lib/server/reservation-availability.js +111 -0
  357. package/src/lib/server/reservation-availability.js.map +1 -0
  358. package/src/lib/server/reserve-stock.d.ts +156 -0
  359. package/src/lib/server/reserve-stock.js +146 -0
  360. package/src/lib/server/reserve-stock.js.map +1 -0
  361. package/src/lib/server/reserve.d.ts +25 -0
  362. package/src/lib/server/reserve.js +426 -0
  363. package/src/lib/server/reserve.js.map +1 -0
  364. package/src/lib/server/restock-flag.d.ts +202 -0
  365. package/src/lib/server/restock-flag.js +449 -0
  366. package/src/lib/server/restock-flag.js.map +1 -0
  367. package/src/lib/server/reviews.d.ts +51 -0
  368. package/src/lib/server/reviews.js +132 -0
  369. package/src/lib/server/reviews.js.map +1 -0
  370. package/src/lib/server/site-page-enricher.d.ts +42 -0
  371. package/src/lib/server/site-page-enricher.js +149 -0
  372. package/src/lib/server/site-page-enricher.js.map +1 -0
  373. package/src/lib/server/site-page-resolver.d.ts +26 -0
  374. package/src/lib/server/site-page-resolver.js +223 -0
  375. package/src/lib/server/site-page-resolver.js.map +1 -0
  376. package/src/lib/server/stock-hold.d.ts +127 -0
  377. package/src/lib/server/stock-hold.js +258 -0
  378. package/src/lib/server/stock-hold.js.map +1 -0
  379. package/src/lib/server/storefront-tax-record.d.ts +22 -0
  380. package/src/lib/server/storefront-tax-record.js +218 -0
  381. package/src/lib/server/storefront-tax-record.js.map +1 -0
  382. package/src/lib/server/storefront-tax.d.ts +197 -0
  383. package/src/lib/server/storefront-tax.js +245 -0
  384. package/src/lib/server/storefront-tax.js.map +1 -0
  385. package/src/lib/server/stream.d.ts +25 -0
  386. package/src/lib/server/stream.js +191 -0
  387. package/src/lib/server/stream.js.map +1 -0
  388. package/src/lib/server/subscription-portal.d.ts +24 -0
  389. package/src/lib/server/subscription-portal.js +91 -0
  390. package/src/lib/server/subscription-portal.js.map +1 -0
  391. package/src/lib/server/supplier-outbox.d.ts +190 -0
  392. package/src/lib/server/supplier-outbox.js +342 -0
  393. package/src/lib/server/supplier-outbox.js.map +1 -0
  394. package/src/lib/server/supplier-update.d.ts +23 -0
  395. package/src/lib/server/supplier-update.js +289 -0
  396. package/src/lib/server/supplier-update.js.map +1 -0
  397. package/src/lib/server/tax-profile.d.ts +29 -0
  398. package/src/lib/server/tax-profile.js +40 -0
  399. package/src/lib/server/tax-profile.js.map +1 -0
  400. package/src/lib/server.d.ts +32 -0
  401. package/src/lib/server.js +311 -0
  402. package/src/lib/server.js.map +1 -0
  403. package/src/lib/site.d.ts +27 -0
  404. package/src/lib/site.js +134 -0
  405. package/src/lib/site.js.map +1 -0
  406. package/src/lib/utils/escape-html.d.ts +41 -0
  407. package/src/lib/utils/escape-html.js +41 -0
  408. package/src/lib/utils/escape-html.js.map +1 -0
  409. package/src/lib/utils/generate-preset-id.d.ts +19 -0
  410. package/src/lib/utils/generate-preset-id.js +25 -0
  411. package/src/lib/utils/generate-preset-id.js.map +1 -0
  412. package/src/lib/utils/member-continue.d.ts +45 -0
  413. package/src/lib/utils/member-continue.js +49 -0
  414. package/src/lib/utils/member-continue.js.map +1 -0
  415. package/src/lib/utils/use-storefront-purchase-event.d.ts +60 -0
  416. package/src/lib/utils/use-storefront-purchase-event.js +142 -0
  417. package/src/lib/utils/use-storefront-purchase-event.js.map +1 -0
@@ -0,0 +1,156 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */ 'use client';
17
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
18
+ import { CheckoutProvider, PaymentElement, useCheckout } from "@stripe/react-stripe-js";
19
+ // `/pure` deliberately, not the bare entry (AGL-2486). The bare entry ends
20
+ // with a module-scope `Promise.resolve().then(() => getStripePromise())`,
21
+ // so merely EVALUATING it injects the js.stripe.com/v3 script tag —
22
+ // 249 KB gzipped — on any page that reaches this module, whether or not
23
+ // `loadStripe` is ever called. `/pure` is the same API without that
24
+ // statement, so the script is fetched when we ask for it and not before.
25
+ import { loadStripe } from "@stripe/stripe-js/pure";
26
+ import Alert from "@mui/material/Alert";
27
+ import Box from "@mui/material/Box";
28
+ import Button from "@mui/material/Button";
29
+ import { useCallback, useMemo, useState } from "react";
30
+ /**
31
+ * `loadStripe` injects a script tag, so it is memoized per key rather than
32
+ * called per render. Keyed because a page could in principle mount this for
33
+ * two different merchants; in practice it is one, and the map costs nothing.
34
+ */ const stripePromises = new Map();
35
+ function getStripe(publishableKey) {
36
+ if (!publishableKey) return null;
37
+ let promise = stripePromises.get(publishableKey);
38
+ if (!promise) {
39
+ promise = loadStripe(publishableKey);
40
+ stripePromises.set(publishableKey, promise);
41
+ }
42
+ return promise;
43
+ }
44
+ /** Test seam: `loadStripe` caches per key across a file's tests otherwise. */ export function __resetStripePromises() {
45
+ stripePromises.clear();
46
+ }
47
+ function PaymentForm({ payLabel, onCancel }) {
48
+ const checkout = useCheckout();
49
+ const [status, setStatus] = useState('idle');
50
+ const [message, setMessage] = useState('');
51
+ const handlePay = useCallback(async ()=>{
52
+ // Guarded rather than merely disabled: a disabled button is a rendering
53
+ // fact, and a keyboard or a slow re-render can still land a second call
54
+ // during a 3DS challenge.
55
+ if (status === 'confirming') return;
56
+ setStatus('confirming');
57
+ setMessage('');
58
+ try {
59
+ const result = await checkout.confirm();
60
+ if ((result == null ? void 0 : result.type) === 'error') {
61
+ var _ref;
62
+ var _result_error;
63
+ // A decline, an expired card, an incomplete field. Recoverable: the
64
+ // form stays mounted with everything the shopper typed still in it.
65
+ setMessage(String((_ref = (_result_error = result.error) == null ? void 0 : _result_error.message) != null ? _ref : '') || 'That payment could not be completed. Try another card.');
66
+ setStatus('error');
67
+ return;
68
+ }
69
+ // Success does NOT mean fulfilled, and nothing is reported to our server
70
+ // here. Stripe redirects to the `return_url` the session carries; if it
71
+ // has not by the time this resolves, the confirm is still in flight and
72
+ // the button stays disabled rather than inviting a second attempt.
73
+ } catch (unused) {
74
+ setMessage('That payment could not be completed. Try another card.');
75
+ setStatus('error');
76
+ }
77
+ }, [
78
+ checkout,
79
+ status
80
+ ]);
81
+ return /*#__PURE__*/ _jsxs(Box, {
82
+ sx: {
83
+ display: 'flex',
84
+ flexDirection: 'column',
85
+ gap: 2
86
+ },
87
+ children: [
88
+ /*#__PURE__*/ _jsx(PaymentElement, {}),
89
+ message ? // `error` severity is right here and wrong for a lockdown pause — this
90
+ // really is "your payment did not go through", which is the one thing
91
+ // a shopper must be told plainly.
92
+ /*#__PURE__*/ _jsx(Alert, {
93
+ severity: "error",
94
+ role: "alert",
95
+ children: message
96
+ }) : null,
97
+ /*#__PURE__*/ _jsxs(Box, {
98
+ sx: {
99
+ display: 'flex',
100
+ gap: 1
101
+ },
102
+ children: [
103
+ /*#__PURE__*/ _jsx(Button, {
104
+ variant: "contained",
105
+ onClick: handlePay,
106
+ disabled: status === 'confirming',
107
+ fullWidth: true,
108
+ children: status === 'confirming' ? 'Paying…' : payLabel || 'Pay now'
109
+ }),
110
+ onCancel ? /*#__PURE__*/ _jsx(Button, {
111
+ variant: "text",
112
+ onClick: onCancel,
113
+ disabled: status === 'confirming',
114
+ children: 'Cancel'
115
+ }) : null
116
+ ]
117
+ })
118
+ ]
119
+ });
120
+ }
121
+ export function StorefrontPaymentElement({ clientSecret, publishableKey, payLabel, onCancel }) {
122
+ const stripe = useMemo(()=>getStripe(publishableKey), [
123
+ publishableKey
124
+ ]);
125
+ // Belt and braces with the server's own gate, which already refuses native
126
+ // mode without a publishable key: rendering nothing beats rendering an empty
127
+ // white box that looks like a broken payment form.
128
+ if (!clientSecret || !stripe) return null;
129
+ return /*#__PURE__*/ _jsx(CheckoutProvider, {
130
+ stripe: stripe,
131
+ options: {
132
+ clientSecret
133
+ },
134
+ children: /*#__PURE__*/ _jsx(Box, {
135
+ sx: {
136
+ py: 2
137
+ },
138
+ "data-testid": "storefront-payment-element",
139
+ children: /*#__PURE__*/ _jsx(PaymentForm, {
140
+ payLabel: payLabel,
141
+ onCancel: onCancel
142
+ })
143
+ })
144
+ });
145
+ }
146
+ /**
147
+ * Re-exported so the old import path still resolves, but the definition now
148
+ * lives in its own module (AGL-2486): a fallback imported FROM the lazily
149
+ * loaded module drags that module into the eager bundle and cancels the
150
+ * `lazy()`. Callers must import it from `./storefront-payment-element-fallback`
151
+ * — importing it from here is exactly the bug, and re-exporting it does not
152
+ * make that safe.
153
+ */ export { StorefrontPaymentElementFallback } from "./storefront-payment-element-fallback.js";
154
+ export default StorefrontPaymentElement;
155
+
156
+ //# sourceMappingURL=storefront-payment-element.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../libs/plugins/commerce/src/lib/components/storefront-payment-element.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n'use client'\n\nimport { CheckoutProvider, PaymentElement, useCheckout } from '@stripe/react-stripe-js'\n// `/pure` deliberately, not the bare entry (AGL-2486). The bare entry ends\n// with a module-scope `Promise.resolve().then(() => getStripePromise())`,\n// so merely EVALUATING it injects the js.stripe.com/v3 script tag —\n// 249 KB gzipped — on any page that reaches this module, whether or not\n// `loadStripe` is ever called. `/pure` is the same API without that\n// statement, so the script is fetched when we ask for it and not before.\nimport { loadStripe } from '@stripe/stripe-js/pure'\n// The TYPE only, and from the bare entry because `/pure` does not re-export\n// it. `import type` is erased entirely at compile time, so this adds no\n// runtime import and cannot re-introduce the script injection above.\nimport type { Stripe } from '@stripe/stripe-js'\nimport Alert from '@mui/material/Alert'\nimport Box from '@mui/material/Box'\nimport Button from '@mui/material/Button'\nimport { useCallback, useMemo, useState } from 'react'\n\n/**\n * The storefront Payment Element (AGL-1944) — the shopper pays on the\n * merchant's own domain instead of being sent to `checkout.stripe.com`.\n *\n * ## THIS COMPONENT DOES NOT FULFIL ANYTHING\n *\n * It has no success callback, and that absence is the design rather than an\n * omission. `libs/plugins/commerce/src/lib/server/billing-webhook.ts` creates\n * the order on `checkout.session.completed` and is the only thing that ever\n * does. An in-page flow makes trusting the browser far more tempting than a\n * redirect does — the form is right there, `confirm()` resolves in hand, and\n * posting \"done, please fulfil\" is one line away — and the browser is the one\n * participant in a payment that can lie about having paid.\n *\n * It is also the participant that can VANISH. A shopper who confirms and\n * closes the tab never runs a callback, so a flow that fulfils here loses the\n * order outright while keeping the money; a shopper who refreshes the return\n * page runs it twice. Neither is reachable from a design with no callback in\n * it. What happens after a successful confirm is a redirect to `return_url`,\n * carrying the `session_id` the server put there — so the page can SHOW the\n * shopper a result by looking the order up, without being TOLD the outcome by\n * this code.\n *\n * ## Declines and 3DS\n *\n * Both were handled for us by the redirect and now have to be handled here.\n *\n * A decline resolves as `{ type: 'error' }` and is rendered inline WITHOUT\n * unmounting the form: the shopper's basket, address and chosen method are all\n * still on screen and they can try another card. That is the whole difference\n * between a recoverable decline and a dead end, and it is why the error state\n * below sits beside the element rather than replacing it.\n *\n * A 3DS challenge is Stripe's own: `confirm()` presents the challenge and, for\n * redirect-based methods, sends the browser to `return_url` and back. Nothing\n * here has to model it — but the button must stay disabled across the whole\n * await, because a second `confirm()` during a challenge is exactly the\n * double-submit the server's idempotency claim exists to survive and there is\n * no reason to make it lean on that.\n */\n\nexport interface StorefrontPaymentElementProps {\n /** Stripe's instruction to the browser. Not a claim that money moved. */\n clientSecret: string\n publishableKey: string\n /** Shown on the pay button, so the merchant's own total reads through. */\n payLabel?: string\n /** Abandon the in-page form and return to the store. */\n onCancel?: () => void\n}\n\n/**\n * `loadStripe` injects a script tag, so it is memoized per key rather than\n * called per render. Keyed because a page could in principle mount this for\n * two different merchants; in practice it is one, and the map costs nothing.\n */\nconst stripePromises = new Map<string, Promise<Stripe | null>>()\nfunction getStripe(publishableKey: string): Promise<Stripe | null> | null {\n if (!publishableKey) return null\n let promise = stripePromises.get(publishableKey)\n if (!promise) {\n promise = loadStripe(publishableKey)\n stripePromises.set(publishableKey, promise)\n }\n return promise\n}\n\n/** Test seam: `loadStripe` caches per key across a file's tests otherwise. */\nexport function __resetStripePromises(): void {\n stripePromises.clear()\n}\n\nfunction PaymentForm({\n payLabel,\n onCancel,\n}: Pick<StorefrontPaymentElementProps, 'payLabel' | 'onCancel'>) {\n const checkout = useCheckout()\n const [status, setStatus] = useState<'idle' | 'confirming' | 'error'>('idle')\n const [message, setMessage] = useState('')\n\n const handlePay = useCallback(async () => {\n // Guarded rather than merely disabled: a disabled button is a rendering\n // fact, and a keyboard or a slow re-render can still land a second call\n // during a 3DS challenge.\n if (status === 'confirming') return\n setStatus('confirming')\n setMessage('')\n try {\n const result = await checkout.confirm()\n if (result?.type === 'error') {\n // A decline, an expired card, an incomplete field. Recoverable: the\n // form stays mounted with everything the shopper typed still in it.\n setMessage(\n String(result.error?.message ?? '') ||\n 'That payment could not be completed. Try another card.',\n )\n setStatus('error')\n return\n }\n // Success does NOT mean fulfilled, and nothing is reported to our server\n // here. Stripe redirects to the `return_url` the session carries; if it\n // has not by the time this resolves, the confirm is still in flight and\n // the button stays disabled rather than inviting a second attempt.\n } catch {\n setMessage('That payment could not be completed. Try another card.')\n setStatus('error')\n }\n }, [checkout, status])\n\n return (\n <Box sx={{ display: 'flex', flexDirection: 'column', gap: 2 }}>\n <PaymentElement />\n {message ? (\n // `error` severity is right here and wrong for a lockdown pause — this\n // really is \"your payment did not go through\", which is the one thing\n // a shopper must be told plainly.\n <Alert severity=\"error\" role=\"alert\">\n {message}\n </Alert>\n ) : null}\n <Box sx={{ display: 'flex', gap: 1 }}>\n <Button\n variant=\"contained\"\n onClick={handlePay}\n disabled={status === 'confirming'}\n fullWidth\n >\n {status === 'confirming' ? 'Paying…' : payLabel || 'Pay now'}\n </Button>\n {onCancel ? (\n <Button\n variant=\"text\"\n onClick={onCancel}\n disabled={status === 'confirming'}\n >\n {'Cancel'}\n </Button>\n ) : null}\n </Box>\n </Box>\n )\n}\n\nexport function StorefrontPaymentElement({\n clientSecret,\n publishableKey,\n payLabel,\n onCancel,\n}: StorefrontPaymentElementProps) {\n const stripe = useMemo(() => getStripe(publishableKey), [publishableKey])\n // Belt and braces with the server's own gate, which already refuses native\n // mode without a publishable key: rendering nothing beats rendering an empty\n // white box that looks like a broken payment form.\n if (!clientSecret || !stripe) return null\n return (\n <CheckoutProvider stripe={stripe} options={{ clientSecret }}>\n <Box sx={{ py: 2 }} data-testid=\"storefront-payment-element\">\n <PaymentForm payLabel={payLabel} onCancel={onCancel} />\n </Box>\n </CheckoutProvider>\n )\n}\n\n/**\n * Re-exported so the old import path still resolves, but the definition now\n * lives in its own module (AGL-2486): a fallback imported FROM the lazily\n * loaded module drags that module into the eager bundle and cancels the\n * `lazy()`. Callers must import it from `./storefront-payment-element-fallback`\n * — importing it from here is exactly the bug, and re-exporting it does not\n * make that safe.\n */\nexport { StorefrontPaymentElementFallback } from './storefront-payment-element-fallback'\n\nexport default StorefrontPaymentElement\n"],"names":["CheckoutProvider","PaymentElement","useCheckout","loadStripe","Alert","Box","Button","useCallback","useMemo","useState","stripePromises","Map","getStripe","publishableKey","promise","get","set","__resetStripePromises","clear","PaymentForm","payLabel","onCancel","checkout","status","setStatus","message","setMessage","handlePay","result","confirm","type","String","error","sx","display","flexDirection","gap","severity","role","variant","onClick","disabled","fullWidth","StorefrontPaymentElement","clientSecret","stripe","options","py","data-testid","StorefrontPaymentElementFallback"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;AAEA,SAASA,gBAAgB,EAAEC,cAAc,EAAEC,WAAW,QAAQ,0BAAyB;AACvF,2EAA2E;AAC3E,0EAA0E;AAC1E,oEAAoE;AACpE,wEAAwE;AACxE,oEAAoE;AACpE,yEAAyE;AACzE,SAASC,UAAU,QAAQ,yBAAwB;AAKnD,OAAOC,WAAW,sBAAqB;AACvC,OAAOC,SAAS,oBAAmB;AACn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;gBAAMiC,UAAS;gBAAQC,MAAK;0BAC1Bb;iBAED;0BACJ,MAACpB;gBAAI4B,IAAI;oBAAEC,SAAS;oBAAQE,KAAK;gBAAE;;kCACjC,KAAC9B;wBACCiC,SAAQ;wBACRC,SAASb;wBACTc,UAAUlB,WAAW;wBACrBmB,SAAS;kCAERnB,WAAW,eAAe,YAAYH,YAAY;;oBAEpDC,yBACC,KAACf;wBACCiC,SAAQ;wBACRC,SAASnB;wBACToB,UAAUlB,WAAW;kCAEpB;yBAED;;;;;AAIZ;AAEA,OAAO,SAASoB,yBAAyB,EACvCC,YAAY,EACZ/B,cAAc,EACdO,QAAQ,EACRC,QAAQ,EACsB;IAC9B,MAAMwB,SAASrC,QAAQ,IAAMI,UAAUC,iBAAiB;QAACA;KAAe;IACxE,2EAA2E;IAC3E,6EAA6E;IAC7E,mDAAmD;IACnD,IAAI,CAAC+B,gBAAgB,CAACC,QAAQ,OAAO;IACrC,qBACE,KAAC7C;QAAiB6C,QAAQA;QAAQC,SAAS;YAAEF;QAAa;kBACxD,cAAA,KAACvC;YAAI4B,IAAI;gBAAEc,IAAI;YAAE;YAAGC,eAAY;sBAC9B,cAAA,KAAC7B;gBAAYC,UAAUA;gBAAUC,UAAUA;;;;AAInD;AAEA;;;;;;;CAOC,GACD,SAAS4B,gCAAgC,QAAQ,2CAAuC;AAExF,eAAeN,yBAAwB"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import * as Aglyn from '@aglyn/aglyn';
18
+ export declare const ID: Aglyn.ComponentId;
19
+ export declare const WISHLIST_UPDATED_EVENT = "aglyn:wishlist-updated";
20
+ /** Guest wishlist ids from localStorage. */
21
+ export declare function readLocalWishlist(hostId: string): string[];
22
+ /**
23
+ * Toggles a product on the wishlist (AGL-297): members persist on their
24
+ * doc (guest list merges in on first signed-in call); guests persist in
25
+ * localStorage. Returns whether the product is on the list afterward.
26
+ *
27
+ * Takes its own `fetch` (AGL-1139). This is a plain module function, not a
28
+ * component, so it cannot read the site context that says whether it is
29
+ * running in Preview — and both callers are components that can. Defaulting
30
+ * to the global keeps every other caller unchanged; passing `useSiteFetch()`
31
+ * is what stops a preview click from writing to a real member's wishlist.
32
+ */
33
+ export declare function toggleWishlist(hostId: string, productId: string, siteFetch?: typeof fetch): Promise<boolean>;
34
+ export interface WishlistProps {
35
+ heading?: string;
36
+ emptyText?: string;
37
+ }
38
+ /**
39
+ * Wishlist block (AGL-297): renders the saved products (member doc when
40
+ * signed in — merging any guest list — else localStorage) as cards
41
+ * linking to their PDPs, with remove buttons.
42
+ */
43
+ declare const Wishlist: import("react").ForwardRefExoticComponent<WishlistProps & import("react").RefAttributes<HTMLDivElement>>;
44
+ export declare const schema: Aglyn.ComponentSchema<WishlistProps>;
45
+ export declare const presets: Aglyn.PresetSchema[];
46
+ export default Wishlist;
@@ -0,0 +1,304 @@
1
+ import { _ as _extends } from "@swc/helpers/_/_extends";
2
+ import { _ as _object_without_properties_loose } from "@swc/helpers/_/_object_without_properties_loose";
3
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
4
+ /**
5
+ * @license
6
+ * Copyright 2026 Aglyn LLC
7
+ *
8
+ * Licensed under the Apache License, Version 2.0 (the "License");
9
+ * you may not use this file except in compliance with the License.
10
+ * You may obtain a copy of the License at
11
+ *
12
+ * http://www.apache.org/licenses/LICENSE-2.0
13
+ *
14
+ * Unless required by applicable law or agreed to in writing, software
15
+ * distributed under the License is distributed on an "AS IS" BASIS,
16
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ * See the License for the specific language governing permissions and
18
+ * limitations under the License.
19
+ */ import * as Aglyn from "@aglyn/aglyn";
20
+ import { mdiHeartOutline } from "@aglyn/shared-data-mdi";
21
+ import Box from "@mui/material/Box";
22
+ import Button from "@mui/material/Button";
23
+ import Card from "@mui/material/Card";
24
+ import CardActionArea from "@mui/material/CardActionArea";
25
+ import CardContent from "@mui/material/CardContent";
26
+ import CardMedia from "@mui/material/CardMedia";
27
+ import Typography from "@mui/material/Typography";
28
+ import { forwardRef, useCallback, useEffect, useState } from "react";
29
+ import { BUNDLE_ID } from "../constants/bundle-common.js";
30
+ import { generatePresetId } from "../utils/generate-preset-id.js";
31
+ // Component ids are persisted in screen documents; never rename.
32
+ export const ID = 'wishlist';
33
+ export const WISHLIST_UPDATED_EVENT = 'aglyn:wishlist-updated';
34
+ function storageKey(hostId) {
35
+ return `aglyn_wishlist_${hostId}`;
36
+ }
37
+ /** Guest wishlist ids from localStorage. */ export function readLocalWishlist(hostId) {
38
+ try {
39
+ const raw = window.localStorage.getItem(storageKey(hostId));
40
+ return raw ? JSON.parse(raw).slice(0, 200) : [];
41
+ } catch (unused) {
42
+ return [];
43
+ }
44
+ }
45
+ function writeLocalWishlist(hostId, productIds) {
46
+ try {
47
+ window.localStorage.setItem(storageKey(hostId), JSON.stringify(productIds.slice(0, 200)));
48
+ } catch (unused) {
49
+ // Private-mode storage failures degrade to session-only behavior.
50
+ }
51
+ }
52
+ /**
53
+ * Toggles a product on the wishlist (AGL-297): members persist on their
54
+ * doc (guest list merges in on first signed-in call); guests persist in
55
+ * localStorage. Returns whether the product is on the list afterward.
56
+ *
57
+ * Takes its own `fetch` (AGL-1139). This is a plain module function, not a
58
+ * component, so it cannot read the site context that says whether it is
59
+ * running in Preview — and both callers are components that can. Defaulting
60
+ * to the global keeps every other caller unchanged; passing `useSiteFetch()`
61
+ * is what stops a preview click from writing to a real member's wishlist.
62
+ */ export async function toggleWishlist(hostId, productId, siteFetch = fetch) {
63
+ const local = readLocalWishlist(hostId);
64
+ const has = local.includes(productId);
65
+ const next = has ? local.filter((id)=>id !== productId) : [
66
+ ...local,
67
+ productId
68
+ ];
69
+ writeLocalWishlist(hostId, next);
70
+ // Best-effort member sync — 401 just means guest.
71
+ void siteFetch('/api/membership/wishlist', {
72
+ method: 'POST',
73
+ headers: {
74
+ 'Content-Type': 'application/json'
75
+ },
76
+ body: JSON.stringify({
77
+ hostId,
78
+ action: has ? 'remove' : 'add',
79
+ productId
80
+ })
81
+ }).catch(()=>undefined);
82
+ window.dispatchEvent(new Event(WISHLIST_UPDATED_EVENT));
83
+ return !has;
84
+ }
85
+ /**
86
+ * Wishlist block (AGL-297): renders the saved products (member doc when
87
+ * signed in — merging any guest list — else localStorage) as cards
88
+ * linking to their PDPs, with remove buttons.
89
+ */ const Wishlist = /*#__PURE__*/ forwardRef((props, ref)=>{
90
+ const { heading, emptyText } = props, rest = _object_without_properties_loose(props, [
91
+ "heading",
92
+ "emptyText"
93
+ ]);
94
+ // Node styles ride the renderer-merged sx; recompose (stack.ts pattern).
95
+ const nodeSx = Array.isArray(props['sx']) ? props['sx'] : [
96
+ props['sx']
97
+ ];
98
+ const { hostId } = Aglyn.useSite();
99
+ const siteFetch = Aglyn.useSiteFetch();
100
+ const [items, setItems] = useState(null);
101
+ const refresh = useCallback(async ()=>{
102
+ if (!hostId) return;
103
+ let productIds = readLocalWishlist(hostId);
104
+ try {
105
+ // Merge the guest list into the member doc; response is canonical.
106
+ const response = await siteFetch('/api/membership/wishlist', {
107
+ method: 'POST',
108
+ headers: {
109
+ 'Content-Type': 'application/json'
110
+ },
111
+ body: JSON.stringify({
112
+ hostId,
113
+ action: 'merge',
114
+ productIds
115
+ })
116
+ });
117
+ if (response.ok) {
118
+ var _ref;
119
+ const payload = await response.json();
120
+ productIds = (_ref = payload == null ? void 0 : payload.productIds) != null ? _ref : productIds;
121
+ writeLocalWishlist(hostId, productIds);
122
+ }
123
+ } catch (unused) {
124
+ // Guest path.
125
+ }
126
+ if (productIds.length === 0) return setItems([]);
127
+ try {
128
+ var _ref1;
129
+ const response = await fetch(`/api/commerce/catalog?hostId=${encodeURIComponent(hostId)}` + `&ids=${encodeURIComponent(productIds.join(','))}&limit=100`);
130
+ const payload = await response.json();
131
+ setItems((_ref1 = payload == null ? void 0 : payload.items) != null ? _ref1 : []);
132
+ } catch (unused) {
133
+ setItems([]);
134
+ }
135
+ }, [
136
+ hostId,
137
+ siteFetch
138
+ ]);
139
+ useEffect(()=>{
140
+ void refresh();
141
+ const handler = ()=>void refresh();
142
+ window.addEventListener(WISHLIST_UPDATED_EVENT, handler);
143
+ return ()=>window.removeEventListener(WISHLIST_UPDATED_EVENT, handler);
144
+ }, [
145
+ refresh
146
+ ]);
147
+ if (!hostId) {
148
+ return /*#__PURE__*/ _jsx(Box, _extends({
149
+ ref: ref
150
+ }, rest, {
151
+ sx: [
152
+ {
153
+ p: 3,
154
+ border: '1px dashed',
155
+ borderColor: 'divider',
156
+ borderRadius: 1,
157
+ color: 'text.secondary',
158
+ fontSize: 13,
159
+ fontFamily: 'system-ui, sans-serif'
160
+ },
161
+ ...nodeSx
162
+ ],
163
+ children: 'Wishlist — saved products render here'
164
+ }));
165
+ }
166
+ return /*#__PURE__*/ _jsxs(Box, _extends({
167
+ ref: ref
168
+ }, rest, {
169
+ children: [
170
+ heading ? /*#__PURE__*/ _jsx(Typography, {
171
+ variant: "h5",
172
+ gutterBottom: true,
173
+ children: heading
174
+ }) : null,
175
+ items && items.length === 0 ? /*#__PURE__*/ _jsx(Typography, {
176
+ variant: "body2",
177
+ color: "text.secondary",
178
+ children: emptyText || 'Nothing saved yet — tap the heart on any product.'
179
+ }) : /*#__PURE__*/ _jsx(Box, {
180
+ sx: {
181
+ display: 'grid',
182
+ gap: 2,
183
+ gridTemplateColumns: {
184
+ xs: 'repeat(2, 1fr)',
185
+ md: 'repeat(4, 1fr)'
186
+ }
187
+ },
188
+ children: (items != null ? items : []).map((item)=>{
189
+ // AGL-1726: resolved BEFORE the guard — see the note in
190
+ // `product-detail.tsx`.
191
+ const imageUrl = Aglyn.siteRelativeMediaSrc(item.imageUrl, {
192
+ hostId
193
+ });
194
+ return /*#__PURE__*/ _jsxs(Card, {
195
+ variant: "outlined",
196
+ children: [
197
+ /*#__PURE__*/ _jsxs(CardActionArea, {
198
+ href: `/products/${item.slug}`,
199
+ children: [
200
+ imageUrl ? /*#__PURE__*/ _jsx(CardMedia, _extends({
201
+ component: "img",
202
+ image: imageUrl,
203
+ alt: item.name,
204
+ sx: {
205
+ height: 120,
206
+ objectFit: 'cover'
207
+ }
208
+ }, Aglyn.DEFERRED_IMAGE_ATTRIBUTES)) : /*#__PURE__*/ _jsx(Box, {
209
+ sx: {
210
+ height: 120,
211
+ bgcolor: 'action.hover'
212
+ }
213
+ }),
214
+ /*#__PURE__*/ _jsxs(CardContent, {
215
+ sx: {
216
+ pb: 1
217
+ },
218
+ children: [
219
+ /*#__PURE__*/ _jsx(Typography, {
220
+ variant: "body2",
221
+ noWrap: true,
222
+ children: item.name
223
+ }),
224
+ /*#__PURE__*/ _jsx(Typography, {
225
+ variant: "caption",
226
+ color: "text.secondary",
227
+ children: item.soldOut ? 'Sold out' : `$${item.priceUsd}`
228
+ })
229
+ ]
230
+ })
231
+ ]
232
+ }),
233
+ /*#__PURE__*/ _jsx(Button, {
234
+ size: "small",
235
+ color: "error",
236
+ fullWidth: true,
237
+ onClick: ()=>void toggleWishlist(hostId, item.id, siteFetch),
238
+ children: 'Remove'
239
+ })
240
+ ]
241
+ }, item.id);
242
+ })
243
+ })
244
+ ]
245
+ }));
246
+ });
247
+ Wishlist.displayName = 'AglynWishlist';
248
+ export const schema = {
249
+ $id: ID,
250
+ pluginId: BUNDLE_ID,
251
+ displayName: 'Wishlist',
252
+ description: 'Products a visitor saved, linking back to their pages.',
253
+ category: Aglyn.ComponentCategory.COMMERCE,
254
+ icon: {
255
+ path: mdiHeartOutline.path,
256
+ sx: {
257
+ color: '#2e7d32'
258
+ }
259
+ },
260
+ flags: {
261
+ selfClosing: Aglyn.FEATURE_FLAG.ENABLED
262
+ },
263
+ attributes: [
264
+ {
265
+ name: 'heading',
266
+ label: 'Heading',
267
+ description: 'Shown above the saved products.',
268
+ component: Aglyn.FieldComponentType.TEXT_FIELD
269
+ },
270
+ {
271
+ name: 'emptyText',
272
+ label: 'Empty text',
273
+ description: 'Copy when nothing is saved.',
274
+ component: Aglyn.FieldComponentType.TEXT_FIELD
275
+ }
276
+ ]
277
+ };
278
+ export const presets = [
279
+ {
280
+ $id: generatePresetId(ID),
281
+ type: Aglyn.NodeType.PRESET,
282
+ displayName: 'Wishlist',
283
+ pluginId: BUNDLE_ID,
284
+ description: 'Saved products with links back to their pages',
285
+ category: Aglyn.ComponentCategory.COMMERCE,
286
+ icon: {
287
+ path: mdiHeartOutline.path,
288
+ sx: {
289
+ color: '#2e7d32'
290
+ }
291
+ },
292
+ data: {
293
+ $id: null,
294
+ componentId: ID,
295
+ pluginId: BUNDLE_ID,
296
+ props: {
297
+ heading: 'Your wishlist'
298
+ }
299
+ }
300
+ }
301
+ ];
302
+ export default Wishlist;
303
+
304
+ //# sourceMappingURL=wishlist.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../libs/plugins/commerce/src/lib/components/wishlist.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport * as Aglyn from '@aglyn/aglyn'\nimport { mdiHeartOutline } from '@aglyn/shared-data-mdi'\nimport Box from '@mui/material/Box'\nimport Button from '@mui/material/Button'\nimport Card from '@mui/material/Card'\nimport CardActionArea from '@mui/material/CardActionArea'\nimport CardContent from '@mui/material/CardContent'\nimport CardMedia from '@mui/material/CardMedia'\nimport Typography from '@mui/material/Typography'\nimport { forwardRef, useCallback, useEffect, useState } from 'react'\nimport { BUNDLE_ID } from '../constants/bundle-common'\nimport { generatePresetId } from '../utils/generate-preset-id'\n\n// Component ids are persisted in screen documents; never rename.\nexport const ID: Aglyn.ComponentId = 'wishlist'\n\nexport const WISHLIST_UPDATED_EVENT = 'aglyn:wishlist-updated'\n\nfunction storageKey(hostId: string): string {\n return `aglyn_wishlist_${hostId}`\n}\n\n/** Guest wishlist ids from localStorage. */\nexport function readLocalWishlist(hostId: string): string[] {\n try {\n const raw = window.localStorage.getItem(storageKey(hostId))\n return raw ? (JSON.parse(raw) as string[]).slice(0, 200) : []\n } catch {\n return []\n }\n}\n\nfunction writeLocalWishlist(hostId: string, productIds: string[]): void {\n try {\n window.localStorage.setItem(\n storageKey(hostId),\n JSON.stringify(productIds.slice(0, 200)),\n )\n } catch {\n // Private-mode storage failures degrade to session-only behavior.\n }\n}\n\n/**\n * Toggles a product on the wishlist (AGL-297): members persist on their\n * doc (guest list merges in on first signed-in call); guests persist in\n * localStorage. Returns whether the product is on the list afterward.\n *\n * Takes its own `fetch` (AGL-1139). This is a plain module function, not a\n * component, so it cannot read the site context that says whether it is\n * running in Preview — and both callers are components that can. Defaulting\n * to the global keeps every other caller unchanged; passing `useSiteFetch()`\n * is what stops a preview click from writing to a real member's wishlist.\n */\nexport async function toggleWishlist(\n hostId: string,\n productId: string,\n siteFetch: typeof fetch = fetch,\n): Promise<boolean> {\n const local = readLocalWishlist(hostId)\n const has = local.includes(productId)\n const next = has\n ? local.filter((id) => id !== productId)\n : [...local, productId]\n writeLocalWishlist(hostId, next)\n // Best-effort member sync — 401 just means guest.\n void siteFetch('/api/membership/wishlist', {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({\n hostId,\n action: has ? 'remove' : 'add',\n productId,\n }),\n }).catch(() => undefined)\n window.dispatchEvent(new Event(WISHLIST_UPDATED_EVENT))\n return !has\n}\n\nexport interface WishlistProps {\n heading?: string\n emptyText?: string\n}\n\ninterface CatalogItem {\n id: string\n name: string\n slug: string\n priceUsd: number\n imageUrl?: string\n soldOut: boolean\n}\n\n/**\n * Wishlist block (AGL-297): renders the saved products (member doc when\n * signed in — merging any guest list — else localStorage) as cards\n * linking to their PDPs, with remove buttons.\n */\nconst Wishlist = forwardRef<HTMLDivElement, WishlistProps>((props, ref) => {\n const { heading, emptyText, ...rest } = props\n // Node styles ride the renderer-merged sx; recompose (stack.ts pattern).\n const nodeSx = Array.isArray(props['sx']) ? props['sx'] : [props['sx']]\n const { hostId } = Aglyn.useSite()\n const siteFetch = Aglyn.useSiteFetch()\n const [items, setItems] = useState<CatalogItem[] | null>(null)\n\n const refresh = useCallback(async () => {\n if (!hostId) return\n let productIds = readLocalWishlist(hostId)\n try {\n // Merge the guest list into the member doc; response is canonical.\n const response = await siteFetch('/api/membership/wishlist', {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ hostId, action: 'merge', productIds }),\n })\n if (response.ok) {\n const payload = await response.json()\n productIds = payload?.productIds ?? productIds\n writeLocalWishlist(hostId, productIds)\n }\n } catch {\n // Guest path.\n }\n if (productIds.length === 0) return setItems([])\n try {\n const response = await fetch(\n `/api/commerce/catalog?hostId=${encodeURIComponent(hostId)}` +\n `&ids=${encodeURIComponent(productIds.join(','))}&limit=100`,\n )\n const payload = await response.json()\n setItems(payload?.items ?? [])\n } catch {\n setItems([])\n }\n }, [hostId, siteFetch])\n\n useEffect(() => {\n void refresh()\n const handler = () => void refresh()\n window.addEventListener(WISHLIST_UPDATED_EVENT, handler)\n return () => window.removeEventListener(WISHLIST_UPDATED_EVENT, handler)\n }, [refresh])\n\n if (!hostId) {\n return (\n <Box\n ref={ref}\n {...rest}\n sx={[\n {\n p: 3,\n border: '1px dashed',\n borderColor: 'divider',\n borderRadius: 1,\n color: 'text.secondary',\n fontSize: 13,\n fontFamily: 'system-ui, sans-serif',\n },\n ...nodeSx,\n ]}\n >\n {'Wishlist — saved products render here'}\n </Box>\n )\n }\n\n return (\n <Box ref={ref} {...rest}>\n {heading ? (\n <Typography variant=\"h5\" gutterBottom>\n {heading}\n </Typography>\n ) : null}\n {items && items.length === 0 ? (\n <Typography variant=\"body2\" color=\"text.secondary\">\n {emptyText || 'Nothing saved yet — tap the heart on any product.'}\n </Typography>\n ) : (\n <Box\n sx={{\n display: 'grid',\n gap: 2,\n gridTemplateColumns: {\n xs: 'repeat(2, 1fr)',\n md: 'repeat(4, 1fr)',\n },\n }}\n >\n {(items ?? []).map((item) => {\n // AGL-1726: resolved BEFORE the guard — see the note in\n // `product-detail.tsx`.\n const imageUrl = Aglyn.siteRelativeMediaSrc(item.imageUrl, {\n hostId,\n })\n return (\n <Card key={item.id} variant=\"outlined\">\n <CardActionArea href={`/products/${item.slug}`}>\n {imageUrl ? (\n <CardMedia\n component=\"img\"\n image={imageUrl}\n alt={item.name}\n sx={{ height: 120, objectFit: 'cover' }}\n // Deferred (AGL-2486), same reasoning as the product\n // grid: one image per saved item, none of them the lead.\n {...Aglyn.DEFERRED_IMAGE_ATTRIBUTES}\n />\n ) : (\n <Box sx={{ height: 120, bgcolor: 'action.hover' }} />\n )}\n <CardContent sx={{ pb: 1 }}>\n <Typography variant=\"body2\" noWrap>\n {item.name}\n </Typography>\n <Typography variant=\"caption\" color=\"text.secondary\">\n {item.soldOut ? 'Sold out' : `$${item.priceUsd}`}\n </Typography>\n </CardContent>\n </CardActionArea>\n <Button\n size=\"small\"\n color=\"error\"\n fullWidth\n onClick={() => void toggleWishlist(hostId, item.id, siteFetch)}\n >\n {'Remove'}\n </Button>\n </Card>\n )\n })}\n </Box>\n )}\n </Box>\n )\n})\nWishlist.displayName = 'AglynWishlist'\n\nexport const schema: Aglyn.ComponentSchema<WishlistProps> = {\n $id: ID,\n pluginId: BUNDLE_ID,\n displayName: 'Wishlist',\n description: 'Products a visitor saved, linking back to their pages.',\n category: Aglyn.ComponentCategory.COMMERCE,\n icon: { path: mdiHeartOutline.path, sx: { color: '#2e7d32' } },\n flags: { selfClosing: Aglyn.FEATURE_FLAG.ENABLED },\n attributes: [\n {\n name: 'heading',\n label: 'Heading',\n description: 'Shown above the saved products.',\n component: Aglyn.FieldComponentType.TEXT_FIELD,\n },\n {\n name: 'emptyText',\n label: 'Empty text',\n description: 'Copy when nothing is saved.',\n component: Aglyn.FieldComponentType.TEXT_FIELD,\n },\n ],\n}\n\nexport const presets: Aglyn.PresetSchema[] = [\n {\n $id: generatePresetId(ID),\n type: Aglyn.NodeType.PRESET,\n displayName: 'Wishlist',\n pluginId: BUNDLE_ID,\n description: 'Saved products with links back to their pages',\n category: Aglyn.ComponentCategory.COMMERCE,\n icon: { path: mdiHeartOutline.path, sx: { color: '#2e7d32' } },\n data: {\n $id: null,\n componentId: ID,\n pluginId: BUNDLE_ID,\n props: { heading: 'Your wishlist' },\n },\n },\n]\n\nexport default Wishlist\n"],"names":["Aglyn","mdiHeartOutline","Box","Button","Card","CardActionArea","CardContent","CardMedia","Typography","forwardRef","useCallback","useEffect","useState","BUNDLE_ID","generatePresetId","ID","WISHLIST_UPDATED_EVENT","storageKey","hostId","readLocalWishlist","raw","window","localStorage","getItem","JSON","parse","slice","writeLocalWishlist","productIds","setItem","stringify","toggleWishlist","productId","siteFetch","fetch","local","has","includes","next","filter","id","method","headers","body","action","catch","undefined","dispatchEvent","Event","Wishlist","props","ref","heading","emptyText","rest","nodeSx","Array","isArray","useSite","useSiteFetch","items","setItems","refresh","response","ok","payload","json","length","encodeURIComponent","join","handler","addEventListener","removeEventListener","sx","p","border","borderColor","borderRadius","color","fontSize","fontFamily","variant","gutterBottom","display","gap","gridTemplateColumns","xs","md","map","item","imageUrl","siteRelativeMediaSrc","href","slug","component","image","alt","name","height","objectFit","DEFERRED_IMAGE_ATTRIBUTES","bgcolor","pb","noWrap","soldOut","priceUsd","size","fullWidth","onClick","displayName","schema","$id","pluginId","description","category","ComponentCategory","COMMERCE","icon","path","flags","selfClosing","FEATURE_FLAG","ENABLED","attributes","label","FieldComponentType","TEXT_FIELD","presets","type","NodeType","PRESET","data","componentId"],"mappings":";;;AAAA;;;;;;;;;;;;;;;CAeC,GAED,YAAYA,WAAW,eAAc;AACrC,SAASC,eAAe,QAAQ,yBAAwB;AACxD,OAAOC,SAAS,oBAAmB;AACnC,OAAOC,YAAY,uBAAsB;AACzC,OAAOC,UAAU,qBAAoB;AACrC,OAAOC,oBAAoB,+BAA8B;AACzD,OAAOC,iBAAiB,4BAA2B;AACnD,OAAOC,eAAe,0BAAyB;AAC/C,OAAOC,gBAAgB,2BAA0B;AACjD,SAASC,UAAU,EAAEC,WAAW,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,QAAO;AACpE,SAASC,SAAS,QAAQ,gCAA4B;AACtD,SAASC,gBAAgB,QAAQ,iCAA6B;AAE9D,iEAAiE;AACjE,OAAO,MAAMC,KAAwB,WAAU;AAE/C,OAAO,MAAMC,yBAAyB,yBAAwB;AAE9D,SAASC,WAAWC,MAAc;IAChC,OAAO,CAAC,eAAe,EAAEA,QAAQ;AACnC;AAEA,0CAA0C,GAC1C,OAAO,SAASC,kBAAkBD,MAAc;IAC9C,IAAI;QACF,MAAME,MAAMC,OAAOC,YAAY,CAACC,OAAO,CAACN,WAAWC;QACnD,OAAOE,MAAM,AAACI,KAAKC,KAAK,CAACL,KAAkBM,KAAK,CAAC,GAAG,OAAO,EAAE;IAC/D,EAAE,eAAM;QACN,OAAO,EAAE;IACX;AACF;AAEA,SAASC,mBAAmBT,MAAc,EAAEU,UAAoB;IAC9D,IAAI;QACFP,OAAOC,YAAY,CAACO,OAAO,CACzBZ,WAAWC,SACXM,KAAKM,SAAS,CAACF,WAAWF,KAAK,CAAC,GAAG;IAEvC,EAAE,eAAM;IACN,kEAAkE;IACpE;AACF;AAEA;;;;;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AAE7C,IAAI;YAAEK,OAAO;QAAU;IAAE;IAC7DyC,OAAO;QAAEC,aAAaxH,MAAMyH,YAAY,CAACC,OAAO;IAAC;IACjDC,YAAY;QACV;YACE1B,MAAM;YACN2B,OAAO;YACPX,aAAa;YACbnB,WAAW9F,MAAM6H,kBAAkB,CAACC,UAAU;QAChD;QACA;YACE7B,MAAM;YACN2B,OAAO;YACPX,aAAa;YACbnB,WAAW9F,MAAM6H,kBAAkB,CAACC,UAAU;QAChD;KACD;AACH,EAAC;AAED,OAAO,MAAMC,UAAgC;IAC3C;QACEhB,KAAKjG,iBAAiBC;QACtBiH,MAAMhI,MAAMiI,QAAQ,CAACC,MAAM;QAC3BrB,aAAa;QACbG,UAAUnG;QACVoG,aAAa;QACbC,UAAUlH,MAAMmH,iBAAiB,CAACC,QAAQ;QAC1CC,MAAM;YAAEC,MAAMrH,gBAAgBqH,IAAI;YAAE7C,IAAI;gBAAEK,OAAO;YAAU;QAAE;QAC7DqD,MAAM;YACJpB,KAAK;YACLqB,aAAarH;YACbiG,UAAUnG;YACVqC,OAAO;gBAAEE,SAAS;YAAgB;QACpC;IACF;CACD,CAAA;AAED,eAAeH,SAAQ"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ /** Persisted as pluginId in screen docs — never rename (AGL-290). */
18
+ export declare const BUNDLE_ID = "commerce";
@@ -0,0 +1,18 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */ /** Persisted as pluginId in screen docs — never rename (AGL-290). */ export const BUNDLE_ID = 'commerce';
17
+
18
+ //# sourceMappingURL=bundle-common.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../libs/plugins/commerce/src/lib/constants/bundle-common.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** Persisted as pluginId in screen docs — never rename (AGL-290). */\nexport const BUNDLE_ID = 'commerce'\n"],"names":["BUNDLE_ID"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,mEAAmE,GACnE,OAAO,MAAMA,YAAY,WAAU"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import type { ListFilterField } from '@aglyn/shared-ui-jsx/const/list-filter';
18
+ /**
19
+ * Products (`hosts/{hostId}/products`).
20
+ *
21
+ * The card's listener is `limit(500)` and stays that way — a 25,000-product
22
+ * catalog does not belong in a table, and the head-count has been a server
23
+ * aggregate since AGL-1716. What that cap must NOT decide is what a search can
24
+ * find, and it did: the search compared the rows already fetched, so a product
25
+ * past the window answered "no products match".
26
+ *
27
+ * ⛔ A SKU is matched WHOLE, not as a substring. It lived inside `variants`, an
28
+ * array of objects, and Firestore cannot look inside one — so the write path
29
+ * flattens them into `skus` and this is an `array-contains`. A SKU is a value
30
+ * somebody copies rather than half-remembers, which is why that trade is the
31
+ * right way round.
32
+ */
33
+ export declare const PRODUCT_LIST_FILTER_FIELDS: readonly ListFilterField[];
34
+ /** Headers for product fields that are filterable without being columns. */
35
+ export declare const PRODUCT_LIST_FILTER_HEADERS: Readonly<Record<string, string>>;