@simpleapps-com/augur-utils 2.4.0 → 2026.11.1

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 (114) hide show
  1. package/EXPORTS.md +24 -31
  2. package/README.md +19 -180
  3. package/dist/address-comparison.d.ts +18 -0
  4. package/dist/address-comparison.d.ts.map +1 -0
  5. package/dist/address-schemas.d.ts +45 -0
  6. package/dist/address-schemas.d.ts.map +1 -0
  7. package/dist/analytics.d.ts +66 -0
  8. package/dist/analytics.d.ts.map +1 -0
  9. package/dist/build-checkout-payload.d.ts +37 -0
  10. package/dist/build-checkout-payload.d.ts.map +1 -0
  11. package/dist/cache-config.d.ts +42 -0
  12. package/dist/cache-config.d.ts.map +1 -0
  13. package/dist/chunk-5UMFBGVA.cjs.map +1 -1
  14. package/dist/date-helpers.d.ts +16 -0
  15. package/dist/date-helpers.d.ts.map +1 -0
  16. package/dist/derive-price.d.ts +49 -0
  17. package/dist/derive-price.d.ts.map +1 -0
  18. package/dist/format-price.d.ts +6 -0
  19. package/dist/format-price.d.ts.map +1 -0
  20. package/dist/get-payment-status.d.ts +10 -0
  21. package/dist/get-payment-status.d.ts.map +1 -0
  22. package/dist/image-rules.d.ts +70 -0
  23. package/dist/image-rules.d.ts.map +1 -0
  24. package/dist/image.d.ts +80 -0
  25. package/dist/image.d.ts.map +1 -0
  26. package/dist/index.cjs +371 -167
  27. package/dist/index.cjs.map +1 -1
  28. package/dist/index.d.ts +63 -1448
  29. package/dist/index.d.ts.map +1 -0
  30. package/dist/index.js +370 -166
  31. package/dist/index.js.map +1 -1
  32. package/dist/json-ld-rules.d.ts +50 -0
  33. package/dist/json-ld-rules.d.ts.map +1 -0
  34. package/dist/json-ld.d.ts +34 -0
  35. package/dist/json-ld.d.ts.map +1 -0
  36. package/dist/money.d.ts +37 -0
  37. package/dist/money.d.ts.map +1 -0
  38. package/dist/price-breaks.d.ts +16 -0
  39. package/dist/price-breaks.d.ts.map +1 -0
  40. package/dist/price-outcome.d.ts +19 -0
  41. package/dist/price-outcome.d.ts.map +1 -0
  42. package/dist/resolve-stock.d.ts +22 -0
  43. package/dist/resolve-stock.d.ts.map +1 -0
  44. package/dist/result.d.ts +33 -0
  45. package/dist/result.d.ts.map +1 -0
  46. package/dist/rules.d.ts +45 -0
  47. package/dist/rules.d.ts.map +1 -0
  48. package/dist/schema-availability.d.ts +11 -0
  49. package/dist/schema-availability.d.ts.map +1 -0
  50. package/dist/transform-ship-to-address.d.ts +15 -0
  51. package/dist/transform-ship-to-address.d.ts.map +1 -0
  52. package/dist/transforms.d.ts +70 -0
  53. package/dist/transforms.d.ts.map +1 -0
  54. package/dist/types/api.d.ts +8 -0
  55. package/dist/types/api.d.ts.map +1 -0
  56. package/dist/types/attribute.d.ts +12 -0
  57. package/dist/types/attribute.d.ts.map +1 -0
  58. package/dist/types/cart.d.ts +25 -0
  59. package/dist/types/cart.d.ts.map +1 -0
  60. package/dist/types/category-items.d.ts +4 -0
  61. package/dist/types/category-items.d.ts.map +1 -0
  62. package/dist/types/category.d.ts +19 -0
  63. package/dist/types/category.d.ts.map +1 -0
  64. package/dist/types/checkout.d.ts +4 -0
  65. package/dist/types/checkout.d.ts.map +1 -0
  66. package/dist/types/customer.d.ts +4 -0
  67. package/dist/types/customer.d.ts.map +1 -0
  68. package/dist/types/filter.d.ts +9 -0
  69. package/dist/types/filter.d.ts.map +1 -0
  70. package/dist/types/inventory.d.ts +10 -0
  71. package/dist/types/inventory.d.ts.map +1 -0
  72. package/dist/types/joomla.d.ts +11 -0
  73. package/dist/types/joomla.d.ts.map +1 -0
  74. package/dist/types/ltl-shipping.d.ts +45 -0
  75. package/dist/types/ltl-shipping.d.ts.map +1 -0
  76. package/dist/types/menu.d.ts +14 -0
  77. package/dist/types/menu.d.ts.map +1 -0
  78. package/dist/types/meta.d.ts +11 -0
  79. package/dist/types/meta.d.ts.map +1 -0
  80. package/dist/types/order.d.ts +72 -0
  81. package/dist/types/order.d.ts.map +1 -0
  82. package/dist/types/password.d.ts +7 -0
  83. package/dist/types/password.d.ts.map +1 -0
  84. package/dist/types/payment.d.ts +69 -0
  85. package/dist/types/payment.d.ts.map +1 -0
  86. package/dist/types/pricing.d.ts +25 -0
  87. package/dist/types/pricing.d.ts.map +1 -0
  88. package/dist/types/product.d.ts +58 -0
  89. package/dist/types/product.d.ts.map +1 -0
  90. package/dist/types/search.d.ts +16 -0
  91. package/dist/types/search.d.ts.map +1 -0
  92. package/dist/types/shipping.d.ts +4 -0
  93. package/dist/types/shipping.d.ts.map +1 -0
  94. package/dist/types/smarty-streets.d.ts +4 -0
  95. package/dist/types/smarty-streets.d.ts.map +1 -0
  96. package/dist/types/supplier.d.ts +4 -0
  97. package/dist/types/supplier.d.ts.map +1 -0
  98. package/dist/types/tax.d.ts +6 -0
  99. package/dist/types/tax.d.ts.map +1 -0
  100. package/dist/types/uom.d.ts +4 -0
  101. package/dist/types/uom.d.ts.map +1 -0
  102. package/dist/types/user-profile.d.ts +5 -0
  103. package/dist/types/user-profile.d.ts.map +1 -0
  104. package/dist/us-states.d.ts +15 -0
  105. package/dist/us-states.d.ts.map +1 -0
  106. package/dist/validation-patterns.d.ts +22 -0
  107. package/dist/validation-patterns.d.ts.map +1 -0
  108. package/dist/web.cjs.map +1 -1
  109. package/dist/web.d.ts +3 -5
  110. package/dist/web.d.ts.map +1 -0
  111. package/llms.txt +44 -38
  112. package/package.json +25 -13
  113. package/dist/index.d.cts +0 -1448
  114. package/dist/web.d.cts +0 -6
package/dist/index.cjs CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  var _chunk5UMFBGVAcjs = require('./chunk-5UMFBGVA.cjs');
4
4
 
5
+ // src/price-breaks.ts
6
+ function hasPriceBreaks(libraryPriceData) {
7
+ return libraryPriceData !== null && Array.isArray(libraryPriceData.breaks);
8
+ }
9
+
5
10
  // src/cache-config.ts
6
11
  var CACHE_CONFIG = {
7
12
  STATIC: {
@@ -44,29 +49,99 @@ function formatPrice(price, locale = "en-US", currency = "USD") {
44
49
  }).format(price);
45
50
  }
46
51
 
52
+ // src/rules.ts
53
+ function paymentStatusOf(paidInFull, hasAmounts, amountPaid) {
54
+ if (paidInFull) return "Paid";
55
+ if (hasAmounts && amountPaid > 0) return "Partially Paid";
56
+ return "Unpaid";
57
+ }
58
+ function isLowStockOf(quantity, threshold) {
59
+ return quantity > 0 && threshold > 0 && quantity <= threshold;
60
+ }
61
+ function allYesFrom(flags, i) {
62
+ if (i >= flags.length) return true;
63
+ return flags[i] === "Y" && allYesFrom(flags, i + 1);
64
+ }
65
+ function isDiscontinuedOf(flags) {
66
+ return flags.length > 0 && allYesFrom(flags, 0);
67
+ }
68
+ function categorySortBy(prefix, sortBy) {
69
+ return prefix !== "" && sortBy !== "" ? prefix + sortBy : sortBy;
70
+ }
71
+ function searchSortBy(sortBy) {
72
+ return sortBy !== "" ? sortBy : void 0;
73
+ }
74
+ function pageOffset(page, limit) {
75
+ return page * limit;
76
+ }
77
+ function unwrapMessage(error) {
78
+ return error !== "" ? error : "Action failed";
79
+ }
80
+ function shippingLeadOf(days) {
81
+ if (days === "1-2") return { from: 1, to: 4 };
82
+ if (days === "2") return { from: 4, to: 0 };
83
+ if (days === "2-3") return { from: 2, to: 5 };
84
+ if (days === "3") return { from: 5, to: 0 };
85
+ if (days === "3-4") return { from: 3, to: 6 };
86
+ if (days === "4") return { from: 6, to: 0 };
87
+ if (days === "5") return { from: 7, to: 0 };
88
+ return null;
89
+ }
90
+ function isBusinessDayName(dayName) {
91
+ return dayName !== "Sunday" && dayName !== "Saturday";
92
+ }
93
+ function availabilityOf(isInStock, isDiscontinued) {
94
+ if (isInStock) return "InStock";
95
+ if (isDiscontinued) return "OutOfStock";
96
+ return "BackOrder";
97
+ }
98
+ function takerOf(taker) {
99
+ return _nullishCoalesce(taker, () => ( "ESTORE"));
100
+ }
101
+ function addressDifferentOf(line1Same, citySame, stateSame, zipSame) {
102
+ return !line1Same || !citySame || !stateSame || !zipSame;
103
+ }
104
+
47
105
  // src/address-comparison.ts
48
106
  function isAddressDifferent(userAddress, smartyAddress) {
49
- return smartyAddress.deliveryLine1.toLowerCase() !== userAddress.address1.toLowerCase() || smartyAddress.cityName.toLowerCase() !== userAddress.city.toLowerCase() || smartyAddress.stateAbbreviation !== userAddress.state || smartyAddress.zipCode !== userAddress.postalCode;
107
+ return addressDifferentOf(
108
+ (_nullishCoalesce(smartyAddress.deliveryLine1, () => ( ""))).toLowerCase() === userAddress.address1.toLowerCase(),
109
+ (_nullishCoalesce(smartyAddress.cityName, () => ( ""))).toLowerCase() === userAddress.city.toLowerCase(),
110
+ smartyAddress.stateAbbreviation === userAddress.state,
111
+ smartyAddress.zipCode === userAddress.postalCode
112
+ );
50
113
  }
51
114
 
52
115
  // src/get-payment-status.ts
53
116
  function getPaymentStatus(invoice) {
54
- if (invoice.paidInFullFlag === "Y") return "Paid";
55
- if (invoice.amountPaid != null && invoice.totalAmount != null && invoice.amountPaid > 0)
56
- return "Partially Paid";
57
- return "Unpaid";
117
+ return paymentStatusOf(
118
+ invoice.paidInFullFlag === "Y",
119
+ invoice.amountPaid != null && invoice.totalAmount != null,
120
+ _nullishCoalesce(invoice.amountPaid, () => ( 0))
121
+ );
58
122
  }
59
123
 
60
124
  // src/transform-ship-to-address.ts
61
125
  function str(value) {
62
126
  return String(value).trim();
63
127
  }
64
- function pick(raw, keys) {
128
+ function firstPresent(raw, keys) {
65
129
  for (const k of keys) {
66
- if (raw[k] != null) return str(raw[k]);
130
+ if (raw[k] != null) return raw[k];
67
131
  }
68
132
  return "";
69
133
  }
134
+ function pick(raw, keys) {
135
+ return str(firstPresent(raw, keys));
136
+ }
137
+ var PHYS_MARKERS = [
138
+ "physAddress1",
139
+ "phys_address1",
140
+ "physCity",
141
+ "phys_city",
142
+ "physState",
143
+ "phys_state"
144
+ ];
70
145
  var PHYS_FIELDS = {
71
146
  address1: ["physAddress1", "phys_address1"],
72
147
  address2: ["physAddress2", "phys_address2"],
@@ -84,19 +159,19 @@ var MAIL_FIELDS = {
84
159
  country: ["mailCountry", "mail_country", "country"]
85
160
  };
86
161
  function transformShipToAddress(raw) {
87
- const isPhys = raw["physAddress1"] != null || raw["phys_address1"] != null || raw["physCity"] != null || raw["phys_city"] != null || raw["physState"] != null || raw["phys_state"] != null;
162
+ const isPhys = PHYS_MARKERS.some((k) => raw[k] != null);
88
163
  const f = isPhys ? PHYS_FIELDS : MAIL_FIELDS;
89
164
  const address = {
90
- shipToId: _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(raw["shipToId"], () => ( raw["ship_to_id"])), () => ( raw["id"])), () => ( "")),
91
- name: str(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(raw["shipToName"], () => ( raw["ship_to_name"])), () => ( raw["name"])), () => ( ""))),
92
- address1: pick(raw, [...f.address1]),
93
- city: pick(raw, [...f.city]),
94
- state: pick(raw, [...f.state]),
95
- zip: pick(raw, [...f.zip])
165
+ shipToId: firstPresent(raw, ["shipToId", "ship_to_id", "id"]),
166
+ name: pick(raw, ["shipToName", "ship_to_name", "name"]),
167
+ address1: pick(raw, f.address1),
168
+ city: pick(raw, f.city),
169
+ state: pick(raw, f.state),
170
+ zip: pick(raw, f.zip)
96
171
  };
97
- const address2 = pick(raw, [...f.address2]);
172
+ const address2 = pick(raw, f.address2);
98
173
  if (address2) address.address2 = address2;
99
- const country = pick(raw, [...f.country]);
174
+ const country = pick(raw, f.country);
100
175
  if (country) address.country = country;
101
176
  return address;
102
177
  }
@@ -109,7 +184,7 @@ function buildCheckoutPayload(input) {
109
184
  sales_location_id: input.salesLocationId,
110
185
  user_id: input.userId,
111
186
  user_email: input.userEmail,
112
- taker: _nullishCoalesce(input.taker, () => ( "ESTORE"))
187
+ taker: takerOf(input.taker)
113
188
  };
114
189
  if (input.poNumber != null) oe_hdr.customer_po_no = input.poNumber;
115
190
  if (input.shipToId != null) oe_hdr.ship_to_id = input.shipToId;
@@ -127,47 +202,95 @@ function buildCheckoutPayload(input) {
127
202
  return { oe_hdr, oe_line };
128
203
  }
129
204
 
130
- // src/derive-price.ts
131
- function derivePrice(input) {
132
- const { priceData, quantity = 1 } = input;
133
- if (!Number.isInteger(quantity) || quantity < 0) {
205
+ // src/money.ts
206
+ var MONEY_DECIMALS = 8;
207
+ var MAX_SHIFTED = 2 ** 51;
208
+ function shiftDecimal(value, places) {
209
+ const [mantissa, exponent = "0"] = String(value).split("e");
210
+ return Number(`${mantissa}e${Number(exponent) + places}`);
211
+ }
212
+ function roundHalfAway(value, decimals) {
213
+ if (!Number.isInteger(decimals) || decimals < 0) {
134
214
  throw new RangeError(
135
- `derivePrice: quantity must be a non-negative integer, got ${String(quantity)}`
215
+ `roundHalfAway: decimals must be a non-negative integer, got ${String(decimals)}`
136
216
  );
137
217
  }
138
- const unitPrice = _optionalChain([priceData, 'optionalAccess', _ => _.unitPrice]);
139
- if (!priceData || unitPrice == null) {
140
- return { state: "loading" };
218
+ if (!Number.isFinite(value)) return value;
219
+ const shifted = shiftDecimal(Math.abs(value), decimals);
220
+ if (!(shifted < MAX_SHIFTED)) return value;
221
+ const rounded = Math.round(shifted);
222
+ if (rounded === 0) return 0;
223
+ return Math.sign(value) * shiftDecimal(rounded, -decimals);
224
+ }
225
+ function cleanMoney(value) {
226
+ return roundHalfAway(value, MONEY_DECIMALS);
227
+ }
228
+
229
+ // src/price-outcome.ts
230
+ function priceOutcome(quantityOk, hasPrice, priceFinite, unitPrice) {
231
+ if (!quantityOk) return "badQuantity";
232
+ if (!hasPrice) return "loading";
233
+ if (!priceFinite || unitPrice < 0) return "badPrice";
234
+ if (unitPrice === 0) return "callForPrice";
235
+ return "priced";
236
+ }
237
+
238
+ // src/derive-price.ts
239
+ function outcomeError(outcome, quantity, unitPrice) {
240
+ if (outcome === "badQuantity") {
241
+ return new RangeError(
242
+ `derivePrice: quantity must be a non-negative finite number, got ${String(quantity)}`
243
+ );
141
244
  }
142
- if (!Number.isFinite(unitPrice) || unitPrice < 0) {
143
- throw new RangeError(
245
+ if (outcome === "badPrice") {
246
+ return new RangeError(
144
247
  `derivePrice: unitPrice must be a non-negative finite number, got ${String(unitPrice)}`
145
248
  );
146
249
  }
147
- const unitOfMeasure = priceData.unitOfMeasure || _optionalChain([priceData, 'access', _2 => _2.item, 'optionalAccess', _3 => _3.unitOfMeasure]) || "";
148
- if (unitPrice === 0) {
149
- return { state: "callForPrice", unitOfMeasure };
150
- }
151
- return { state: "priced", unitPrice, total: unitPrice * quantity, unitOfMeasure };
250
+ return null;
251
+ }
252
+ function outcomeFor(priceData, unitPrice, quantity) {
253
+ const hasPrice = priceData != null && unitPrice != null;
254
+ return priceOutcome(
255
+ Number.isFinite(quantity) && quantity >= 0,
256
+ hasPrice,
257
+ Number.isFinite(unitPrice),
258
+ // Read only when hasPrice is true; the 0 is never compared then.
259
+ _nullishCoalesce(unitPrice, () => ( 0))
260
+ );
261
+ }
262
+ function derivePrice(input) {
263
+ const { priceData, quantity = 1 } = input;
264
+ const unitPrice = _optionalChain([priceData, 'optionalAccess', _ => _.unitPrice]);
265
+ const outcome = outcomeFor(priceData, unitPrice, quantity);
266
+ const error = outcomeError(outcome, quantity, unitPrice);
267
+ if (error) throw error;
268
+ if (outcome === "loading") return { state: "loading" };
269
+ const record = priceData;
270
+ const price = unitPrice;
271
+ const unitOfMeasure = _nullishCoalesce(_optionalChain([record, 'access', _2 => _2.item, 'optionalAccess', _3 => _3.unitOfMeasure]), () => ( ""));
272
+ if (outcome === "callForPrice") return { state: "callForPrice", unitOfMeasure };
273
+ return { state: "priced", unitPrice: price, total: cleanMoney(price * quantity), unitOfMeasure };
152
274
  }
153
275
 
154
276
  // src/resolve-stock.ts
277
+ function summaryQuantity(companySummary, companyKey) {
278
+ if (companyKey && companyKey in companySummary) {
279
+ return _nullishCoalesce(companySummary[companyKey], () => ( 0));
280
+ }
281
+ return Object.values(companySummary).reduce((sum, val) => sum + val, 0);
282
+ }
283
+ function allDiscontinued(stockData) {
284
+ return isDiscontinuedOf(stockData.map((d) => d.discontinued));
285
+ }
155
286
  function resolveStock(input) {
156
287
  const { stock, companyKey, round = false, lowStockThreshold = 0, showQuantity = false } = input;
157
288
  if (!stock) return null;
158
- const { companySummary } = stock;
159
- let qty;
160
- if (companyKey && companyKey in companySummary) {
161
- qty = _nullishCoalesce(companySummary[companyKey], () => ( 0));
162
- } else {
163
- qty = Object.values(companySummary).reduce((sum, val) => sum + val, 0);
164
- }
165
- if (round) {
166
- qty = Math.round(qty);
167
- }
289
+ const summed = summaryQuantity(stock.companySummary, companyKey);
290
+ const qty = round ? Math.round(summed) : summed;
168
291
  const isInStock = qty > 0;
169
- const isLowStock = isInStock && lowStockThreshold > 0 && qty <= lowStockThreshold;
170
- const isDiscontinued = stock.stockData.length > 0 && stock.stockData.every((d) => d.discontinued === "Y");
292
+ const isLowStock = isLowStockOf(qty, lowStockThreshold);
293
+ const isDiscontinued = allDiscontinued(stock.stockData);
171
294
  return {
172
295
  quantity: qty,
173
296
  isInStock,
@@ -179,13 +302,49 @@ function resolveStock(input) {
179
302
 
180
303
  // src/schema-availability.ts
181
304
  function getSchemaAvailability(resolved) {
182
- if (_optionalChain([resolved, 'optionalAccess', _4 => _4.isInStock])) {
183
- return "https://schema.org/InStock";
184
- }
185
- if (_optionalChain([resolved, 'optionalAccess', _5 => _5.isDiscontinued])) {
186
- return "https://schema.org/OutOfStock";
187
- }
188
- return "https://schema.org/BackOrder";
305
+ return SCHEMA_URLS[availabilityOf(!!_optionalChain([resolved, 'optionalAccess', _4 => _4.isInStock]), !!_optionalChain([resolved, 'optionalAccess', _5 => _5.isDiscontinued]))];
306
+ }
307
+ var SCHEMA_URLS = {
308
+ InStock: "https://schema.org/InStock",
309
+ OutOfStock: "https://schema.org/OutOfStock",
310
+ BackOrder: "https://schema.org/BackOrder"
311
+ };
312
+
313
+ // src/json-ld-rules.ts
314
+ function breadcrumbPosition(i) {
315
+ return i + 1;
316
+ }
317
+ function gtinFieldOf(upper) {
318
+ if (upper === "UPC") return "gtin12";
319
+ if (upper === "EAN") return "gtin13";
320
+ return "gtin";
321
+ }
322
+ function isSuppressedOf(deleteFlag, onlineCd, statusCd) {
323
+ return deleteFlag === "Y" || onlineCd === 0 || statusCd === 0;
324
+ }
325
+ function productNameOf(suppressed, name, unitPrice) {
326
+ if (suppressed) return null;
327
+ if (name === "" || unitPrice <= 0) return null;
328
+ return name;
329
+ }
330
+ function firstNonBlankOf(a, b) {
331
+ if (a !== "") return a;
332
+ if (b !== "") return b;
333
+ return void 0;
334
+ }
335
+ function primarySupplierFrom(flags, i) {
336
+ if (i >= flags.length) return -1;
337
+ if (flags[i] === "Y") return i;
338
+ return primarySupplierFrom(flags, i + 1);
339
+ }
340
+ function supplierIndexOf(flags) {
341
+ const primary = primarySupplierFrom(flags, 0);
342
+ if (primary >= 0) return primary;
343
+ return flags.length > 0 ? 0 : -1;
344
+ }
345
+ function offerUrlOf(siteUrl, itemPath, itemId) {
346
+ if (siteUrl === "") return void 0;
347
+ return siteUrl + itemPath + "/" + itemId;
189
348
  }
190
349
 
191
350
  // src/json-ld.ts
@@ -195,21 +354,17 @@ function generateBreadcrumbJsonLd(items) {
195
354
  "@type": "BreadcrumbList",
196
355
  itemListElement: items.map((item, index) => ({
197
356
  "@type": "ListItem",
198
- position: index + 1,
357
+ position: breadcrumbPosition(index),
199
358
  name: item.name,
200
359
  item: item.url
201
360
  }))
202
361
  };
203
362
  }
204
363
  function getGtinField(upcOrEan) {
205
- const val = _optionalChain([upcOrEan, 'optionalAccess', _6 => _6.toUpperCase, 'call', _7 => _7()]);
206
- if (val === "UPC") return "gtin12";
207
- if (val === "EAN") return "gtin13";
208
- return "gtin";
364
+ return gtinFieldOf(_nullishCoalesce(_optionalChain([upcOrEan, 'optionalAccess', _6 => _6.toUpperCase, 'call', _7 => _7()]), () => ( "")));
209
365
  }
210
366
  function getPrimarySupplierPartNo(suppliers) {
211
- const primary = suppliers.find((s) => s.primarySupplierFlag === "Y");
212
- const supplier = _nullishCoalesce(primary, () => ( suppliers[0]));
367
+ const supplier = suppliers[supplierIndexOf(suppliers.map((s) => _nullishCoalesce(s.primarySupplierFlag, () => ( ""))))];
213
368
  const partNo = _optionalChain([supplier, 'optionalAccess', _8 => _8.supplierPartNo, 'optionalAccess', _9 => _9.trim, 'call', _10 => _10()]);
214
369
  return partNo || void 0;
215
370
  }
@@ -234,14 +389,12 @@ function omitEmpty(obj) {
234
389
  return result;
235
390
  }
236
391
  function resolveBrand(doc) {
237
- const name = _optionalChain([doc, 'access', _11 => _11.brandName, 'optionalAccess', _12 => _12.trim, 'call', _13 => _13()]) || _optionalChain([doc, 'access', _14 => _14.parkerProductCd, 'optionalAccess', _15 => _15.trim, 'call', _16 => _16()]);
238
- if (!name) return void 0;
392
+ const name = firstNonBlankOf(_nullishCoalesce(_optionalChain([doc, 'access', _11 => _11.brandName, 'optionalAccess', _12 => _12.trim, 'call', _13 => _13()]), () => ( "")), _nullishCoalesce(_optionalChain([doc, 'access', _14 => _14.parkerProductCd, 'optionalAccess', _15 => _15.trim, 'call', _16 => _16()]), () => ( "")));
393
+ if (name === void 0) return void 0;
239
394
  return { "@type": "Brand", name };
240
395
  }
241
396
  function resolveDescription(doc) {
242
- if (_optionalChain([doc, 'access', _17 => _17.displayDesc, 'optionalAccess', _18 => _18.trim, 'call', _19 => _19()])) return doc.displayDesc.trim();
243
- if (_optionalChain([doc, 'access', _20 => _20.extendedDesc, 'optionalAccess', _21 => _21.trim, 'call', _22 => _22()])) return doc.extendedDesc.trim();
244
- return void 0;
397
+ return firstNonBlankOf(_nullishCoalesce(_optionalChain([doc, 'access', _17 => _17.displayDesc, 'optionalAccess', _18 => _18.trim, 'call', _19 => _19()]), () => ( "")), _nullishCoalesce(_optionalChain([doc, 'access', _20 => _20.extendedDesc, 'optionalAccess', _21 => _21.trim, 'call', _22 => _22()]), () => ( "")));
245
398
  }
246
399
  function resolveImages(doc, transform2) {
247
400
  if (doc.images.length === 0) return void 0;
@@ -255,7 +408,7 @@ function buildOffers(doc, options) {
255
408
  const availability = getSchemaAvailability(resolved);
256
409
  const validUntil = /* @__PURE__ */ new Date();
257
410
  validUntil.setDate(validUntil.getDate() + priceValidDays);
258
- const url = options.siteUrl ? `${options.siteUrl}${itemPath}/${doc.itemId}` : void 0;
411
+ const url = offerUrlOf(_nullishCoalesce(options.siteUrl, () => ( "")), itemPath, doc.itemId);
259
412
  const eligibleQuantity = _optionalChain([doc, 'access', _23 => _23.defaultSellingUnit, 'optionalAccess', _24 => _24.trim, 'call', _25 => _25()]) ? { "@type": "QuantitativeValue", unitCode: doc.defaultSellingUnit.trim() } : void 0;
260
413
  const seller = options.seller ? { "@type": "Organization", name: options.seller.name, url: options.seller.url } : void 0;
261
414
  return {
@@ -272,22 +425,25 @@ function buildOffers(doc, options) {
272
425
  shippingDetails: options.shippingDetails
273
426
  };
274
427
  }
275
- function isSuppressed(doc) {
276
- return doc.deleteFlag === "Y" || doc.onlineCd === 0 || doc.statusCd === 0;
428
+ function productName(doc, unitPrice) {
429
+ const suppressed = isSuppressedOf(doc.deleteFlag, doc.onlineCd, doc.statusCd);
430
+ return productNameOf(suppressed, (doc.itemDesc || "").trim(), unitPrice);
431
+ }
432
+ function buildAggregateRating(rating) {
433
+ if (!rating) return void 0;
434
+ return {
435
+ "@type": "AggregateRating",
436
+ ratingValue: rating.ratingValue,
437
+ reviewCount: rating.reviewCount
438
+ };
277
439
  }
278
440
  function generateProductJsonLd(doc, options) {
279
- if (isSuppressed(doc)) return null;
280
- const name = (doc.itemDesc || "").trim();
281
- if (!name) return null;
282
- if (options.unitPrice <= 0) return null;
441
+ const name = productName(doc, options.unitPrice);
442
+ if (name === null) return null;
283
443
  const weightUnit = _nullishCoalesce(options.weightUnit, () => ( "LBR"));
284
444
  const dimensionUnit = _nullishCoalesce(options.dimensionUnit, () => ( "INH"));
285
445
  const gtinId = _optionalChain([doc, 'access', _26 => _26.upcOrEanId, 'optionalAccess', _27 => _27.trim, 'call', _28 => _28()]) || void 0;
286
- const aggregateRating = options.aggregateRating ? {
287
- "@type": "AggregateRating",
288
- ratingValue: options.aggregateRating.ratingValue,
289
- reviewCount: options.aggregateRating.reviewCount
290
- } : void 0;
446
+ const aggregateRating = buildAggregateRating(options.aggregateRating);
291
447
  const product = {
292
448
  "@context": "https://schema.org",
293
449
  "@type": "Product",
@@ -311,23 +467,99 @@ function generateProductJsonLd(doc, options) {
311
467
 
312
468
  // src/result.ts
313
469
  function unwrap(result) {
314
- if (!result.ok) throw new Error(result.error || "Action failed");
470
+ if (!result.ok) throw new Error(unwrapMessage(result.error));
315
471
  return result.data;
316
472
  }
317
473
  function unwrapOr(result) {
318
474
  return result.ok ? _nullishCoalesce(result.data, () => ( null)) : null;
319
475
  }
320
476
 
477
+ // ../utils/src/strings.ts
478
+ function codeAt(s, i) {
479
+ return i >= 0 && i < s.length ? s.charCodeAt(i) : -1;
480
+ }
481
+ function indexOfCode(s, code, from) {
482
+ const c = codeAt(s, from);
483
+ if (c === code) return from;
484
+ if (c === -1) return -1;
485
+ return indexOfCode(s, code, from + 1);
486
+ }
487
+ function startsWithAt(s, x, pos) {
488
+ const at = Math.min(pos, s.length);
489
+ return s.slice(at, Math.min(at + x.length, s.length)) === x;
490
+ }
491
+
492
+ // ../utils/src/lists.ts
493
+ function joinFrom(xs, sep, i) {
494
+ if (i >= xs.length) return "";
495
+ if (i === xs.length - 1) return xs[i];
496
+ return xs[i] + sep + joinFrom(xs, sep, i + 1);
497
+ }
498
+
499
+ // src/image-rules.ts
500
+ function transformKeyOf(field) {
501
+ if (field === "width") return "w";
502
+ if (field === "height") return "h";
503
+ if (field === "format") return "f";
504
+ if (field === "quality") return "q";
505
+ if (field === "fit") return "fit";
506
+ return "";
507
+ }
508
+ function transformValueOf(field, value) {
509
+ if (field === "format" && value === "jpg") return "jpeg";
510
+ return value;
511
+ }
512
+ function transformPartsFrom(fields, present, texts, i) {
513
+ if (i >= fields.length) return [];
514
+ const field = fields[i];
515
+ const key = transformKeyOf(field);
516
+ const rest = transformPartsFrom(fields, present, texts, i + 1);
517
+ if (present[i] && key !== "") {
518
+ return [key + "_" + transformValueOf(field, texts[i]), ...rest];
519
+ }
520
+ return rest;
521
+ }
522
+ function serializedTransforms(fields, present, texts) {
523
+ return joinFrom(transformPartsFrom(fields, present, texts, 0), ",", 0);
524
+ }
525
+ function isExternal(path) {
526
+ return startsWithAt(path, "http", 0);
527
+ }
528
+ function stripFirstPrefixFrom(path, prefixes, i) {
529
+ if (i >= prefixes.length) return path;
530
+ const prefix = prefixes[i];
531
+ if (startsWithAt(path, prefix, 0)) return path.slice(prefix.length);
532
+ return stripFirstPrefixFrom(path, prefixes, i + 1);
533
+ }
534
+ function stripLeadingSlashes(s) {
535
+ if (codeAt(s, 0) !== 47) return s;
536
+ return stripLeadingSlashes(s.slice(1));
537
+ }
538
+ function normalizedPath(raw, prefixes, defaultPath) {
539
+ if (isExternal(raw)) return raw;
540
+ const cleaned = stripLeadingSlashes(stripFirstPrefixFrom(raw, prefixes, 0));
541
+ if (defaultPath !== "" && indexOfCode(cleaned, 47, 0) < 0) return defaultPath + "/" + cleaned;
542
+ return cleaned;
543
+ }
544
+ function cdnUrlOf(clientDomain, serialized, normalized) {
545
+ const segment = serialized !== "" ? "/" + serialized : "";
546
+ return "https://agr.media/" + clientDomain + "/images" + segment + "/" + normalized;
547
+ }
548
+ function defaultImageUrlOf(clientDomain, fallback, prefixes, defaultPath) {
549
+ if (fallback === "") return "";
550
+ const normalized = normalizedPath(fallback, prefixes, defaultPath);
551
+ if (isExternal(normalized)) return normalized;
552
+ return "https://agr.media/" + clientDomain + "/images/" + normalized;
553
+ }
554
+ function imageUrlOf(clientDomain, path, serialized, fallback, prefixes, defaultPath) {
555
+ if (path === "") return defaultImageUrlOf(clientDomain, fallback, prefixes, defaultPath);
556
+ const normalized = normalizedPath(path, prefixes, defaultPath);
557
+ if (isExternal(normalized)) return normalized;
558
+ return cdnUrlOf(clientDomain, serialized, normalized);
559
+ }
560
+
321
561
  // src/image.ts
322
562
  var BLUR_DATA_URL = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mN88P/BfwYABQoBfqVKzQAAAABJRU5ErkJggg==";
323
- var CDN_BASE = "https://agr.media";
324
- var TRANSFORM_KEY_MAP = {
325
- width: "w",
326
- height: "h",
327
- format: "f",
328
- quality: "q",
329
- fit: "fit"
330
- };
331
563
  var DEFAULT_STRIP_PREFIXES = ["/images", "images"];
332
564
  function createImageConfig(clientDomain, opts) {
333
565
  return Object.freeze({
@@ -339,54 +571,43 @@ function createImageConfig(clientDomain, opts) {
339
571
  });
340
572
  }
341
573
  function serializeTransforms(transforms) {
342
- const parts = [];
343
- for (const [key, value] of Object.entries(transforms)) {
344
- if (value === void 0) continue;
345
- const prefix = TRANSFORM_KEY_MAP[key];
346
- if (prefix) {
347
- const v2 = key === "format" && value === "jpg" ? "jpeg" : value;
348
- parts.push(`${prefix}_${v2}`);
349
- }
350
- }
351
- return parts.join(",");
574
+ const entries = Object.entries(transforms);
575
+ return serializedTransforms(
576
+ entries.map(([key]) => key),
577
+ entries.map(([, value]) => value !== void 0),
578
+ entries.map(([, value]) => String(value))
579
+ );
352
580
  }
353
581
  function normalizePath(config, raw) {
354
- if (raw.startsWith("http")) return raw;
355
- let cleaned = raw;
356
- const prefixes = _nullishCoalesce(config.stripPrefixes, () => ( DEFAULT_STRIP_PREFIXES));
357
- for (const prefix of prefixes) {
358
- if (cleaned.startsWith(prefix)) {
359
- cleaned = cleaned.slice(prefix.length);
360
- break;
361
- }
362
- }
363
- cleaned = cleaned.replace(/^\/+/, "");
364
- if (config.defaultPath && !cleaned.includes("/")) {
365
- cleaned = `${config.defaultPath}/${cleaned}`;
366
- }
367
- return cleaned;
582
+ return normalizedPath(raw, prefixesOf(config), _nullishCoalesce(config.defaultPath, () => ( "")));
583
+ }
584
+ function prefixesOf(config) {
585
+ return _nullishCoalesce(config.stripPrefixes, () => ( DEFAULT_STRIP_PREFIXES));
368
586
  }
369
587
  function getImageUrl(config, imagePath, transforms, options) {
370
- const resolvedPath = _optionalChain([imagePath, 'optionalAccess', _33 => _33.trim, 'call', _34 => _34()]);
371
- if (!resolvedPath) {
372
- return getDefaultImageUrl(config, options);
373
- }
374
- const normalized = normalizePath(config, resolvedPath);
375
- if (normalized.startsWith("http")) return normalized;
376
588
  const merged = {
377
589
  ...config.defaultTransforms,
378
590
  ...transforms
379
591
  };
380
- const serialized = serializeTransforms(merged);
381
- const transformSegment = serialized ? `/${serialized}` : "";
382
- return `${CDN_BASE}/${config.clientDomain}/images${transformSegment}/${normalized}`;
592
+ return imageUrlOf(
593
+ config.clientDomain,
594
+ _nullishCoalesce(_optionalChain([imagePath, 'optionalAccess', _33 => _33.trim, 'call', _34 => _34()]), () => ( "")),
595
+ serializeTransforms(merged),
596
+ fallbackOf(config, options),
597
+ prefixesOf(config),
598
+ _nullishCoalesce(config.defaultPath, () => ( ""))
599
+ );
383
600
  }
384
601
  function getDefaultImageUrl(config, options) {
385
- const fallback = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _35 => _35.defaultImage]), () => ( config.defaultImage));
386
- if (!fallback) return "";
387
- const normalized = normalizePath(config, fallback);
388
- if (normalized.startsWith("http")) return normalized;
389
- return `${CDN_BASE}/${config.clientDomain}/images/${normalized}`;
602
+ return defaultImageUrlOf(
603
+ config.clientDomain,
604
+ fallbackOf(config, options),
605
+ prefixesOf(config),
606
+ _nullishCoalesce(config.defaultPath, () => ( ""))
607
+ );
608
+ }
609
+ function fallbackOf(config, options) {
610
+ return _nullishCoalesce(_nullishCoalesce(_optionalChain([options, 'optionalAccess', _35 => _35.defaultImage]), () => ( config.defaultImage)), () => ( ""));
390
611
  }
391
612
  function getImageSrcSet(config, imagePath, widths, transforms) {
392
613
  return widths.map((w) => {
@@ -448,20 +669,20 @@ var US_TERRITORIES = _statesus.states.filter((s) => s.territory);
448
669
 
449
670
  // src/address-schemas.ts
450
671
  var validStateCodes = US_STATES.map((state) => state.code);
672
+ function personName(requiredMessage, invalidMessage) {
673
+ return v.pipe(
674
+ v.string(),
675
+ v.minLength(1, requiredMessage),
676
+ v.regex(VALIDATION_PATTERNS.nameFormat, invalidMessage),
677
+ v.regex(VALIDATION_PATTERNS.nameNoNumbers, invalidMessage)
678
+ );
679
+ }
680
+ var firstName = personName("First name is required", "Invalid first name");
681
+ var lastName = personName("Last name is required", "Invalid last name");
451
682
  var ShippingAddressSchema = v.object({
452
683
  companyName: v.optional(v.string()),
453
- firstName: v.pipe(
454
- v.string(),
455
- v.minLength(1, "First name is required"),
456
- v.regex(VALIDATION_PATTERNS.nameFormat, "Invalid first name"),
457
- v.regex(VALIDATION_PATTERNS.nameNoNumbers, "Invalid first name")
458
- ),
459
- lastName: v.pipe(
460
- v.string(),
461
- v.minLength(1, "Last name is required"),
462
- v.regex(VALIDATION_PATTERNS.nameFormat, "Invalid last name"),
463
- v.regex(VALIDATION_PATTERNS.nameNoNumbers, "Invalid last name")
464
- ),
684
+ firstName,
685
+ lastName,
465
686
  address1: v.pipe(
466
687
  v.string(),
467
688
  v.minLength(1, "Address 1 is required"),
@@ -516,18 +737,8 @@ var ShippingAddressSchema = v.object({
516
737
  });
517
738
  var BillingAddressSchema = v.object({
518
739
  poNumber: v.optional(v.string()),
519
- firstName: v.pipe(
520
- v.string(),
521
- v.minLength(1, "First name is required"),
522
- v.regex(VALIDATION_PATTERNS.nameFormat, "Invalid first name"),
523
- v.regex(VALIDATION_PATTERNS.nameNoNumbers, "Invalid first name")
524
- ),
525
- lastName: v.pipe(
526
- v.string(),
527
- v.minLength(1, "Last name is required"),
528
- v.regex(VALIDATION_PATTERNS.nameFormat, "Invalid last name"),
529
- v.regex(VALIDATION_PATTERNS.nameNoNumbers, "Invalid last name")
530
- ),
740
+ firstName,
741
+ lastName,
531
742
  address1: v.pipe(
532
743
  v.string(),
533
744
  v.minLength(1, "Address 1 is required"),
@@ -557,24 +768,15 @@ function getBusinessDay(businessDaysFromNow) {
557
768
  const date = /* @__PURE__ */ new Date();
558
769
  date.setDate(date.getDate() + i);
559
770
  const dayName = date.toLocaleDateString("en-US", { weekday: "long" });
560
- if (dayName !== "Sunday" && dayName !== "Saturday") {
771
+ if (isBusinessDayName(dayName)) {
561
772
  businessDays.push(date.toLocaleDateString("en-US", DATE_FORMAT_OPTIONS));
562
773
  }
563
774
  i++;
564
775
  }
565
776
  return businessDays[businessDays.length - 1] || "";
566
777
  }
567
- var SHIPPING_LEAD_CONFIG = {
568
- "1-2": { from: 1, to: 4 },
569
- "2": { from: 4 },
570
- "2-3": { from: 2, to: 5 },
571
- "3": { from: 5 },
572
- "3-4": { from: 3, to: 6 },
573
- "4": { from: 6 },
574
- "5": { from: 7 }
575
- };
576
778
  function getShippingLeadDate(days) {
577
- const config = SHIPPING_LEAD_CONFIG[days];
779
+ const config = shippingLeadOf(days);
578
780
  if (!config) return "";
579
781
  const fromDate = getBusinessDay(config.from);
580
782
  if (config.to) {
@@ -587,10 +789,7 @@ function getShippingLeadDate(days) {
587
789
  // src/transforms.ts
588
790
  function serializeCategoryFilters(filters, options) {
589
791
  const { sortByPrefix, includeStock = true } = _nullishCoalesce(options, () => ( {}));
590
- let sortBy = filters.sortBy;
591
- if (sortByPrefix && sortBy) {
592
- sortBy = `${sortByPrefix}${sortBy}`;
593
- }
792
+ const sortBy = filters.sortBy ? categorySortBy(_nullishCoalesce(sortByPrefix, () => ( "")), filters.sortBy) : filters.sortBy;
594
793
  const params = {
595
794
  filters: JSON.stringify(filters.filters),
596
795
  limit: filters.limit,
@@ -610,7 +809,7 @@ function serializeSearchParams(filters, options) {
610
809
  searchType: "query",
611
810
  size: filters.limit,
612
811
  from: filters.offset,
613
- sortBy: filters.sortBy || void 0,
812
+ sortBy: searchSortBy(filters.sortBy),
614
813
  classId5List: categoryUid ? String(categoryUid) : void 0,
615
814
  filters: _optionalChain([filters, 'access', _36 => _36.filters, 'optionalAccess', _37 => _37.length]) ? JSON.stringify(filters.filters) : void 0,
616
815
  sourceFieldsList: sourceFields
@@ -619,7 +818,7 @@ function serializeSearchParams(filters, options) {
619
818
  function paginateOffset(filters, pageParam) {
620
819
  return {
621
820
  ...filters,
622
- offset: pageParam * filters.limit
821
+ offset: pageOffset(pageParam, filters.limit)
623
822
  };
624
823
  }
625
824
 
@@ -637,7 +836,7 @@ function trackAddToCart({
637
836
  event: "add_to_cart",
638
837
  ecommerce: {
639
838
  currency: "USD",
640
- value: Number(estimatedCost.toFixed(2)),
839
+ value: roundHalfAway(estimatedCost, 2),
641
840
  items: [
642
841
  {
643
842
  item_id: itemId,
@@ -685,7 +884,7 @@ function buildTrackingData({
685
884
  const items = cartLines.map((line, index) => {
686
885
  const details = itemDetails[line.itemId];
687
886
  const price = getUnitPrice(line.itemId);
688
- total += price * line.quantity;
887
+ total = cleanMoney(total + cleanMoney(price * line.quantity));
689
888
  return {
690
889
  item_id: line.itemId,
691
890
  item_name: _nullishCoalesce(_optionalChain([details, 'optionalAccess', _38 => _38.itemDesc]), () => ( "")),
@@ -699,7 +898,8 @@ function buildTrackingData({
699
898
  return {
700
899
  event: "begin_checkout",
701
900
  currency,
702
- value: Number(total.toFixed(2)),
901
+ // toFixed(2) rounds ties wrong (1.005 → "1.00"); roundHalfAway gives 1.01.
902
+ value: roundHalfAway(total, 2),
703
903
  items
704
904
  };
705
905
  }
@@ -756,5 +956,9 @@ function pushTrackingData(data) {
756
956
 
757
957
 
758
958
 
759
- exports.BLUR_DATA_URL = BLUR_DATA_URL; exports.BillingAddressInvoiceSchema = BillingAddressInvoiceSchema; exports.BillingAddressSchema = BillingAddressSchema; exports.CACHE_CONFIG = CACHE_CONFIG; exports.CONTIGUOUS_STATES = CONTIGUOUS_STATES; exports.ShippingAddressSchema = ShippingAddressSchema; exports.US_STATES = US_STATES; exports.US_STATES_FULL = US_STATES_FULL; exports.US_TERRITORIES = US_TERRITORIES; exports.VALIDATION_PATTERNS = VALIDATION_PATTERNS; exports.buildCheckoutPayload = buildCheckoutPayload; exports.buildImageLoader = buildImageLoader; exports.buildTrackingData = buildTrackingData; exports.cn = _chunk5UMFBGVAcjs.cn; exports.createImageConfig = createImageConfig; exports.derivePrice = derivePrice; exports.formatPrice = formatPrice; exports.generateBreadcrumbJsonLd = generateBreadcrumbJsonLd; exports.generateProductJsonLd = generateProductJsonLd; exports.getBusinessDay = getBusinessDay; exports.getDefaultImageUrl = getDefaultImageUrl; exports.getImageSrcSet = getImageSrcSet; exports.getImageUrl = getImageUrl; exports.getPaymentStatus = getPaymentStatus; exports.getSchemaAvailability = getSchemaAvailability; exports.getShippingLeadDate = getShippingLeadDate; exports.isAddressDifferent = isAddressDifferent; exports.normalizePath = normalizePath; exports.paginateOffset = paginateOffset; exports.pushTrackingData = pushTrackingData; exports.resolveStock = resolveStock; exports.sanitizeHtmlImages = sanitizeHtmlImages; exports.serializeCategoryFilters = serializeCategoryFilters; exports.serializeSearchParams = serializeSearchParams; exports.serializeTransforms = serializeTransforms; exports.trackAddToCart = trackAddToCart; exports.trackViewItem = trackViewItem; exports.transformShipToAddress = transformShipToAddress; exports.unwrap = unwrap; exports.unwrapOr = unwrapOr;
959
+
960
+
961
+
962
+
963
+ exports.BLUR_DATA_URL = BLUR_DATA_URL; exports.BillingAddressInvoiceSchema = BillingAddressInvoiceSchema; exports.BillingAddressSchema = BillingAddressSchema; exports.CACHE_CONFIG = CACHE_CONFIG; exports.CONTIGUOUS_STATES = CONTIGUOUS_STATES; exports.ShippingAddressSchema = ShippingAddressSchema; exports.US_STATES = US_STATES; exports.US_STATES_FULL = US_STATES_FULL; exports.US_TERRITORIES = US_TERRITORIES; exports.VALIDATION_PATTERNS = VALIDATION_PATTERNS; exports.buildCheckoutPayload = buildCheckoutPayload; exports.buildImageLoader = buildImageLoader; exports.buildTrackingData = buildTrackingData; exports.categorySortBy = categorySortBy; exports.cleanMoney = cleanMoney; exports.cn = _chunk5UMFBGVAcjs.cn; exports.createImageConfig = createImageConfig; exports.derivePrice = derivePrice; exports.formatPrice = formatPrice; exports.generateBreadcrumbJsonLd = generateBreadcrumbJsonLd; exports.generateProductJsonLd = generateProductJsonLd; exports.getBusinessDay = getBusinessDay; exports.getDefaultImageUrl = getDefaultImageUrl; exports.getImageSrcSet = getImageSrcSet; exports.getImageUrl = getImageUrl; exports.getPaymentStatus = getPaymentStatus; exports.getSchemaAvailability = getSchemaAvailability; exports.getShippingLeadDate = getShippingLeadDate; exports.hasPriceBreaks = hasPriceBreaks; exports.isAddressDifferent = isAddressDifferent; exports.normalizePath = normalizePath; exports.paginateOffset = paginateOffset; exports.pushTrackingData = pushTrackingData; exports.resolveStock = resolveStock; exports.roundHalfAway = roundHalfAway; exports.sanitizeHtmlImages = sanitizeHtmlImages; exports.serializeCategoryFilters = serializeCategoryFilters; exports.serializeSearchParams = serializeSearchParams; exports.serializeTransforms = serializeTransforms; exports.trackAddToCart = trackAddToCart; exports.trackViewItem = trackViewItem; exports.transformShipToAddress = transformShipToAddress; exports.unwrap = unwrap; exports.unwrapOr = unwrapOr;
760
964
  //# sourceMappingURL=index.cjs.map