@simpleapps-com/augur-hooks 2.4.0 → 2026.11.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/EXPORTS.md +25 -65
  2. package/README.md +21 -246
  3. package/dist/checkout/create-checkout-provider.d.ts +25 -0
  4. package/dist/checkout/create-checkout-provider.d.ts.map +1 -0
  5. package/dist/checkout/index.cjs +123 -106
  6. package/dist/checkout/index.cjs.map +1 -1
  7. package/dist/checkout/index.d.ts +5 -293
  8. package/dist/checkout/index.d.ts.map +1 -0
  9. package/dist/checkout/index.js +99 -82
  10. package/dist/checkout/index.js.map +1 -1
  11. package/dist/checkout/{index.d.cts → types.d.ts} +18 -40
  12. package/dist/checkout/types.d.ts.map +1 -0
  13. package/dist/chunk-6Z6JGK2C.cjs.map +1 -1
  14. package/dist/chunk-JJX23M5N.js +532 -0
  15. package/dist/chunk-JJX23M5N.js.map +1 -0
  16. package/dist/chunk-UZAFXUAO.cjs +532 -0
  17. package/dist/chunk-UZAFXUAO.cjs.map +1 -0
  18. package/dist/duration.d.ts +16 -0
  19. package/dist/duration.d.ts.map +1 -0
  20. package/dist/hooks/use-cart-actions.d.ts +68 -0
  21. package/dist/hooks/use-cart-actions.d.ts.map +1 -0
  22. package/dist/hooks/use-cart-initialization.d.ts +60 -0
  23. package/dist/hooks/use-cart-initialization.d.ts.map +1 -0
  24. package/dist/hooks/use-cart-pricing.d.ts +41 -0
  25. package/dist/hooks/use-cart-pricing.d.ts.map +1 -0
  26. package/dist/hooks/use-checkout-persistence.d.ts +41 -0
  27. package/dist/hooks/use-checkout-persistence.d.ts.map +1 -0
  28. package/dist/hooks/use-debounce.d.ts +6 -0
  29. package/dist/hooks/use-debounce.d.ts.map +1 -0
  30. package/dist/hooks/use-format-price.d.ts +29 -0
  31. package/dist/hooks/use-format-price.d.ts.map +1 -0
  32. package/dist/hooks/use-latest.d.ts +8 -0
  33. package/dist/hooks/use-latest.d.ts.map +1 -0
  34. package/dist/hooks/use-modal-lifecycle.d.ts +11 -0
  35. package/dist/hooks/use-modal-lifecycle.d.ts.map +1 -0
  36. package/dist/hooks/use-order-readiness.d.ts +47 -0
  37. package/dist/hooks/use-order-readiness.d.ts.map +1 -0
  38. package/dist/hooks/use-pagination-prefetch.d.ts +27 -0
  39. package/dist/hooks/use-pagination-prefetch.d.ts.map +1 -0
  40. package/dist/{use-order-readiness-DZTIfRzw.d.ts → hooks/use-payment-flow.d.ts} +23 -67
  41. package/dist/hooks/use-payment-flow.d.ts.map +1 -0
  42. package/dist/hooks/use-stock.d.ts +32 -0
  43. package/dist/hooks/use-stock.d.ts.map +1 -0
  44. package/dist/index.cjs +227 -184
  45. package/dist/index.cjs.map +1 -1
  46. package/dist/index.d.ts +32 -456
  47. package/dist/index.d.ts.map +1 -0
  48. package/dist/index.js +205 -162
  49. package/dist/index.js.map +1 -1
  50. package/dist/persistence/apply-limits.d.ts +8 -0
  51. package/dist/persistence/apply-limits.d.ts.map +1 -0
  52. package/dist/persistence/create-persister.d.ts +10 -0
  53. package/dist/persistence/create-persister.d.ts.map +1 -0
  54. package/dist/persistence/serializer.d.ts +11 -0
  55. package/dist/persistence/serializer.d.ts.map +1 -0
  56. package/dist/persistence/use-persistence.d.ts +59 -0
  57. package/dist/persistence/use-persistence.d.ts.map +1 -0
  58. package/dist/persistence/use-storage-monitor.d.ts +11 -0
  59. package/dist/persistence/use-storage-monitor.d.ts.map +1 -0
  60. package/dist/provider.d.ts +89 -0
  61. package/dist/provider.d.ts.map +1 -0
  62. package/dist/queries/batch-query.d.ts +23 -0
  63. package/dist/queries/batch-query.d.ts.map +1 -0
  64. package/dist/queries/index.d.ts +3 -0
  65. package/dist/queries/index.d.ts.map +1 -0
  66. package/dist/query-action-registry.d.ts +19 -0
  67. package/dist/query-action-registry.d.ts.map +1 -0
  68. package/dist/rules.d.ts +133 -0
  69. package/dist/rules.d.ts.map +1 -0
  70. package/dist/server.cjs +2 -1
  71. package/dist/server.cjs.map +1 -1
  72. package/dist/server.d.ts +10 -12
  73. package/dist/server.d.ts.map +1 -0
  74. package/dist/server.js +2 -1
  75. package/dist/server.js.map +1 -1
  76. package/dist/stores/cart-store.d.ts +51 -0
  77. package/dist/stores/cart-store.d.ts.map +1 -0
  78. package/dist/stores/items-filters-store.d.ts +30 -0
  79. package/dist/stores/items-filters-store.d.ts.map +1 -0
  80. package/dist/types.d.ts +48 -0
  81. package/dist/types.d.ts.map +1 -0
  82. package/dist/web/use-image-with-fallback.d.ts +16 -0
  83. package/dist/web/use-image-with-fallback.d.ts.map +1 -0
  84. package/dist/web/use-mobile-detection.d.ts +28 -0
  85. package/dist/web/use-mobile-detection.d.ts.map +1 -0
  86. package/dist/web/use-mobile-optimized-intersection.d.ts +17 -0
  87. package/dist/web/use-mobile-optimized-intersection.d.ts.map +1 -0
  88. package/dist/web.cjs.map +1 -1
  89. package/dist/web.d.ts +4 -60
  90. package/dist/web.d.ts.map +1 -0
  91. package/dist/web.js.map +1 -1
  92. package/llms.txt +76 -54
  93. package/package.json +26 -14
  94. package/dist/batch-query-CTlvxSmL.d.cts +0 -165
  95. package/dist/batch-query-CTlvxSmL.d.ts +0 -165
  96. package/dist/chunk-F5DUFW57.cjs +0 -383
  97. package/dist/chunk-F5DUFW57.cjs.map +0 -1
  98. package/dist/chunk-JNOHB4OP.js +0 -383
  99. package/dist/chunk-JNOHB4OP.js.map +0 -1
  100. package/dist/index.d.cts +0 -456
  101. package/dist/server.d.cts +0 -44
  102. package/dist/use-order-readiness-DZTIfRzw.d.cts +0 -137
  103. package/dist/web.d.cts +0 -60
package/dist/index.cjs CHANGED
@@ -20,7 +20,15 @@ var _chunk6Z6JGK2Ccjs = require('./chunk-6Z6JGK2C.cjs');
20
20
 
21
21
 
22
22
 
23
- var _chunkF5DUFW57cjs = require('./chunk-F5DUFW57.cjs');
23
+
24
+
25
+
26
+
27
+
28
+
29
+
30
+
31
+ var _chunkUZAFXUAOcjs = require('./chunk-UZAFXUAO.cjs');
24
32
 
25
33
  // src/provider.tsx
26
34
  var _react = require('react');
@@ -37,12 +45,14 @@ var AugurOptionsContext = _react.createContext.call(void 0, null);
37
45
  var AugurSiteContext = _react.createContext.call(void 0, void 0);
38
46
  function AugurHooksProvider({ api, auth, cache, site, children }) {
39
47
  const proxyConfig = cache ? { cache: { static: cache.static, semiStatic: cache.semiStatic } } : void 0;
48
+ const proxyConfigRef = _chunkUZAFXUAOcjs.useLatest.call(void 0, proxyConfig);
40
49
  const options = _react.useMemo.call(void 0, () => {
41
- if (api) return _augurcore.createOptionsProxy.call(void 0, api, proxyConfig);
50
+ const config = proxyConfigRef.current;
51
+ if (api) return _augurcore.createOptionsProxy.call(void 0, api, config);
42
52
  const registeredAction = _chunk6Z6JGK2Ccjs.getRegisteredQueryAction.call(void 0, );
43
- if (registeredAction) return _augurcore.createQueryActionProxy.call(void 0, registeredAction, proxyConfig);
44
- return _augurcore.createKeysOnlyProxy.call(void 0, proxyConfig);
45
- }, [api]);
53
+ if (registeredAction) return _augurcore.createQueryActionProxy.call(void 0, registeredAction, config);
54
+ return _augurcore.createKeysOnlyProxy.call(void 0, config);
55
+ }, [api, proxyConfigRef]);
46
56
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, AugurApiContext.Provider, { value: _nullishCoalesce(api, () => ( null)), children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, AugurAuthReactContext.Provider, { value: auth, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, AugurCacheContext.Provider, { value: cache, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, AugurSiteContext.Provider, { value: site, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, AugurOptionsContext.Provider, { value: options, children }) }) }) }) });
47
57
  }
48
58
  function useAugurOptions() {
@@ -117,6 +127,7 @@ function useDebounce(value, delay = 500) {
117
127
  }
118
128
 
119
129
  // src/hooks/use-format-price.ts
130
+ var _augurutils = require('@simpleapps-com/augur-utils');
120
131
  function normaliseOptions(optionsOrLocale, legacyCurrency) {
121
132
  if (typeof optionsOrLocale === "string") {
122
133
  return { locale: optionsOrLocale, currency: legacyCurrency };
@@ -124,11 +135,12 @@ function normaliseOptions(optionsOrLocale, legacyCurrency) {
124
135
  return _nullishCoalesce(optionsOrLocale, () => ( {}));
125
136
  }
126
137
  function resolveFormatting(opts, siteFormatting) {
138
+ const site = _nullishCoalesce(siteFormatting, () => ( {}));
127
139
  return {
128
- locale: _nullishCoalesce(_nullishCoalesce(opts.locale, () => ( _optionalChain([siteFormatting, 'optionalAccess', _ => _.locale]))), () => ( "en-US")),
129
- currency: _nullishCoalesce(_nullishCoalesce(opts.currency, () => ( _optionalChain([siteFormatting, 'optionalAccess', _2 => _2.currency]))), () => ( "USD")),
130
- precision: _nullishCoalesce(_nullishCoalesce(opts.precision, () => ( _optionalChain([siteFormatting, 'optionalAccess', _3 => _3.precision]))), () => ( 2)),
131
- zeroLabel: _nullishCoalesce(opts.zeroLabel, () => ( _optionalChain([siteFormatting, 'optionalAccess', _4 => _4.zeroLabel])))
140
+ locale: _nullishCoalesce(_nullishCoalesce(opts.locale, () => ( site.locale)), () => ( "en-US")),
141
+ currency: _nullishCoalesce(_nullishCoalesce(opts.currency, () => ( site.currency)), () => ( "USD")),
142
+ precision: _nullishCoalesce(_nullishCoalesce(opts.precision, () => ( site.precision)), () => ( 2)),
143
+ zeroLabel: _nullishCoalesce(opts.zeroLabel, () => ( site.zeroLabel))
132
144
  };
133
145
  }
134
146
  function useFormatPrice(optionsOrLocale, legacyCurrency) {
@@ -139,13 +151,13 @@ function useFormatPrice(optionsOrLocale, legacyCurrency) {
139
151
  currency,
140
152
  precision: basePrecision,
141
153
  zeroLabel
142
- } = resolveFormatting(opts, _optionalChain([site, 'optionalAccess', _5 => _5.formatting]));
154
+ } = resolveFormatting(opts, _optionalChain([site, 'optionalAccess', _ => _.formatting]));
143
155
  const formatPrice = (price, callOptions) => {
144
- const effectiveValue = price * (_nullishCoalesce(_optionalChain([callOptions, 'optionalAccess', _6 => _6.quantity]), () => ( 1)));
156
+ const effectiveValue = _augurutils.cleanMoney.call(void 0, price * (_nullishCoalesce(_optionalChain([callOptions, 'optionalAccess', _2 => _2.quantity]), () => ( 1))));
145
157
  if (effectiveValue === 0 && zeroLabel !== void 0) {
146
158
  return zeroLabel;
147
159
  }
148
- const precision = _nullishCoalesce(_optionalChain([callOptions, 'optionalAccess', _7 => _7.precision]), () => ( basePrecision));
160
+ const precision = _nullishCoalesce(_optionalChain([callOptions, 'optionalAccess', _3 => _3.precision]), () => ( basePrecision));
149
161
  return new Intl.NumberFormat(locale, {
150
162
  style: "currency",
151
163
  currency,
@@ -159,7 +171,7 @@ function useFormatPrice(optionsOrLocale, legacyCurrency) {
159
171
  // src/hooks/use-stock.ts
160
172
 
161
173
  var _reactquery = require('@tanstack/react-query');
162
- var _augurutils = require('@simpleapps-com/augur-utils');
174
+
163
175
  function useStock(invMastUid, options = {}) {
164
176
  const proxy = useAugurOptions();
165
177
  const resolvedQueryFn = options.queryFn;
@@ -167,22 +179,11 @@ function useStock(invMastUid, options = {}) {
167
179
  const query = _reactquery.useQuery.call(void 0, {
168
180
  ...proxyOpts,
169
181
  ...resolvedQueryFn ? { queryFn: resolvedQueryFn } : {},
170
- enabled: (_nullishCoalesce(options.enabled, () => ( true))) && !!invMastUid,
182
+ enabled: _chunkUZAFXUAOcjs.stockEnabled.call(void 0, options.enabled, !!invMastUid),
171
183
  retry: 3,
172
- /* v8 ignore start */
173
- retryDelay: (attemptIndex) => Math.min(1e3 * 2 ** attemptIndex, 1e4)
174
- /* v8 ignore stop */
184
+ retryDelay: _chunkUZAFXUAOcjs.stockRetryDelay
175
185
  });
176
- const stockData = _react.useMemo.call(void 0, () => {
177
- const rawData = query.data;
178
- if (!rawData) return null;
179
- const inner = _nullishCoalesce(rawData.data, () => ( rawData));
180
- const stock = inner;
181
- return {
182
- stockData: _nullishCoalesce(stock.stockData, () => ( [])),
183
- companySummary: _nullishCoalesce(stock.companySummary, () => ( {}))
184
- };
185
- }, [query.data]);
186
+ const stockData = _nullishCoalesce(query.data, () => ( null));
186
187
  const resolved = _react.useMemo.call(void 0,
187
188
  () => _augurutils.resolveStock.call(void 0, {
188
189
  stock: stockData,
@@ -204,16 +205,30 @@ function useStock(invMastUid, options = {}) {
204
205
  // src/hooks/use-cart-actions.ts
205
206
 
206
207
 
208
+
209
+ // ../utils/src/lists.ts
210
+ function hasNumberFrom(xs, x, i) {
211
+ if (i === xs.length) return false;
212
+ if (xs[i] === x) return true;
213
+ return hasNumberFrom(xs, x, i + 1);
214
+ }
215
+
216
+ // src/hooks/use-cart-actions.ts
207
217
  function requireCartUid(cartHdrUid) {
208
218
  const num = typeof cartHdrUid === "string" ? Number(cartHdrUid) : cartHdrUid;
209
- if (!num) throw new Error("Cart UID is not set");
210
- return num;
219
+ const uid = _chunkUZAFXUAOcjs.requiredCartUid.call(void 0, num === void 0 || Number.isNaN(num) ? void 0 : num);
220
+ if (uid === null) throw new Error("Cart UID is not set");
221
+ return uid;
222
+ }
223
+ function liveCart() {
224
+ const { cartHdrUid, cartLines } = _chunkUZAFXUAOcjs.useCartStore.getState();
225
+ return { uid: requireCartUid(cartHdrUid), lines: cartLines };
211
226
  }
212
227
  function buildOptimisticAdd(cartLines, item, cartHdrUid, itemId) {
213
- const existingIndex = cartLines.findIndex((line) => line.invMastUid === item.invMastUid);
228
+ const existingIndex = _chunkUZAFXUAOcjs.indexOfUidFrom.call(void 0, uidsOf(cartLines), item.invMastUid, 0);
214
229
  if (existingIndex >= 0) {
215
230
  return cartLines.map(
216
- (line, index) => index === existingIndex ? { ...line, quantity: line.quantity + item.quantity } : line
231
+ (line, index) => index === existingIndex ? { ...line, quantity: _chunkUZAFXUAOcjs.qtyOrZero.call(void 0, line.quantity) + item.quantity } : line
217
232
  );
218
233
  }
219
234
  return [
@@ -227,14 +242,17 @@ function buildOptimisticAdd(cartLines, item, cartHdrUid, itemId) {
227
242
  lineNo: cartLines.length + 1,
228
243
  lineNote: null,
229
244
  quantity: item.quantity,
230
- unitOfMeasure: item.unitOfMeasure
245
+ unitOfMeasure: item.unitOfMeasure,
246
+ key: null,
247
+ unitPrice: null
231
248
  }
232
249
  ];
233
250
  }
234
251
  function reverseAdd(cartLines, invMastUid, quantity) {
235
- return cartLines.map(
236
- (line) => line.invMastUid === invMastUid ? { ...line, quantity: line.quantity - quantity } : line
237
- ).filter((line) => line.invMastUid !== invMastUid || line.quantity > 0);
252
+ return cartLines.flatMap((line) => {
253
+ if (line.invMastUid !== invMastUid) return [line];
254
+ return _chunkUZAFXUAOcjs.keepsAfterReverse.call(void 0, line.quantity, quantity) ? [{ ...line, quantity: _chunkUZAFXUAOcjs.qtyOrZero.call(void 0, line.quantity) - quantity }] : [];
255
+ });
238
256
  }
239
257
  function reverseQuantity(cartLines, invMastUid, previousQuantity) {
240
258
  if (previousQuantity === void 0) return cartLines;
@@ -244,21 +262,42 @@ function reverseQuantity(cartLines, invMastUid, previousQuantity) {
244
262
  }
245
263
  function restoreRemoved(cartLines, invMastUid, removedLine) {
246
264
  if (!removedLine) return cartLines;
247
- if (cartLines.some((line) => line.invMastUid === invMastUid)) return cartLines;
265
+ if (hasNumberFrom(uidsOf(cartLines), invMastUid, 0)) return cartLines;
248
266
  return [...cartLines, removedLine];
249
267
  }
250
268
  function mergeRestore(cartLines, snapshot) {
251
269
  const merged = [...cartLines];
252
270
  for (const line of snapshot) {
253
- if (!merged.some((existing) => existing.invMastUid === line.invMastUid)) merged.push(line);
271
+ if (!hasNumberFrom(uidsOf(merged), line.invMastUid, 0)) merged.push(line);
254
272
  }
255
273
  return merged;
256
274
  }
275
+ function uidsOf(cartLines) {
276
+ return cartLines.map((line) => line.invMastUid);
277
+ }
278
+ function sendToast(notify, kind, showToast, message) {
279
+ if (showToast && message !== void 0) _optionalChain([notify, 'optionalAccess', _4 => _4[kind], 'optionalCall', _5 => _5(message)]);
280
+ }
281
+ async function settleCartOp(op, options, notify, invalidate) {
282
+ try {
283
+ const success = await op.call();
284
+ if (!success) throw new Error(op.failure);
285
+ invalidate();
286
+ sendToast(notify, "info", op.showToast, op.infoMessage);
287
+ _optionalChain([options, 'access', _6 => _6.onSuccess, 'optionalCall', _7 => _7()]);
288
+ return true;
289
+ } catch (error) {
290
+ op.rollback();
291
+ sendToast(notify, "error", op.showToast, op.errorMessage);
292
+ _optionalChain([options, 'access', _8 => _8.onError, 'optionalCall', _9 => _9(error)]);
293
+ return false;
294
+ }
295
+ }
257
296
  function useCartActions(callbacks) {
258
297
  const queryClient = _reactquery.useQueryClient.call(void 0, );
259
- const cartHdrUid = _chunkF5DUFW57cjs.useCartHdrUid.call(void 0, );
260
- const cartLines = _chunkF5DUFW57cjs.useCartLines.call(void 0, );
261
- const setCartLines = _chunkF5DUFW57cjs.useSetCartLines.call(void 0, );
298
+ const cartHdrUid = _chunkUZAFXUAOcjs.useCartHdrUid.call(void 0, );
299
+ const cartLines = _chunkUZAFXUAOcjs.useCartLines.call(void 0, );
300
+ const setCartLines = _chunkUZAFXUAOcjs.useSetCartLines.call(void 0, );
262
301
  const notify = callbacks.toast;
263
302
  const invalidateCartCache = _react.useCallback.call(void 0, () => {
264
303
  void queryClient.invalidateQueries({ queryKey: ["cartLines", cartHdrUid] });
@@ -268,119 +307,105 @@ function useCartActions(callbacks) {
268
307
  }, [queryClient, cartHdrUid]);
269
308
  const addToCart = _react.useCallback.call(void 0,
270
309
  async (item, options = {}) => {
271
- const { showToast = true, itemId = "", onSuccess, onError } = options;
272
- const { cartHdrUid: liveUid, cartLines: liveLines } = _chunkF5DUFW57cjs.useCartStore.getState();
273
- const uid = requireCartUid(liveUid);
310
+ const { showToast = true, itemId = "" } = options;
311
+ const { uid, lines: liveLines } = liveCart();
274
312
  setCartLines(buildOptimisticAdd(liveLines, item, uid, itemId));
275
- try {
276
- const success = await callbacks.addToCart(uid, [
277
- {
278
- cartHdrUid: uid,
279
- invMastUid: item.invMastUid,
280
- quantity: item.quantity,
281
- unitOfMeasure: item.unitOfMeasure
282
- }
283
- ]);
284
- if (!success) throw new Error("Failed to add item to cart");
285
- invalidateCartCache();
286
- if (showToast && _optionalChain([notify, 'optionalAccess', _8 => _8.info])) {
287
- notify.info(`${item.quantity} x ${itemId || "Item"} added to cart`);
288
- }
289
- _optionalChain([onSuccess, 'optionalCall', _9 => _9()]);
290
- return true;
291
- } catch (error) {
292
- setCartLines(reverseAdd(_chunkF5DUFW57cjs.useCartStore.getState().cartLines, item.invMastUid, item.quantity));
293
- if (showToast && _optionalChain([notify, 'optionalAccess', _10 => _10.error])) {
294
- notify.error("Failed to add item to cart. Please try again.");
295
- }
296
- _optionalChain([onError, 'optionalCall', _11 => _11(error)]);
297
- return false;
298
- }
313
+ return settleCartOp(
314
+ {
315
+ call: () => callbacks.addToCart(uid, [
316
+ {
317
+ cartHdrUid: uid,
318
+ invMastUid: item.invMastUid,
319
+ quantity: item.quantity,
320
+ unitOfMeasure: item.unitOfMeasure
321
+ }
322
+ ]),
323
+ failure: "Failed to add item to cart",
324
+ infoMessage: `${item.quantity} x ${itemId || "Item"} added to cart`,
325
+ errorMessage: "Failed to add item to cart. Please try again.",
326
+ showToast,
327
+ rollback: () => setCartLines(
328
+ reverseAdd(_chunkUZAFXUAOcjs.useCartStore.getState().cartLines, item.invMastUid, item.quantity)
329
+ )
330
+ },
331
+ options,
332
+ notify,
333
+ invalidateCartCache
334
+ );
299
335
  },
300
336
  [setCartLines, invalidateCartCache, callbacks, notify]
301
337
  );
302
338
  const updateQuantity = _react.useCallback.call(void 0,
303
339
  async (invMastUid, newQuantity, options = {}) => {
304
- const { showToast = false, onSuccess, onError } = options;
305
- const { cartHdrUid: liveUid, cartLines: liveLines } = _chunkF5DUFW57cjs.useCartStore.getState();
306
- const uid = requireCartUid(liveUid);
307
- const previousQuantity = _optionalChain([liveLines, 'access', _12 => _12.find, 'call', _13 => _13((line) => line.invMastUid === invMastUid), 'optionalAccess', _14 => _14.quantity]);
340
+ const { showToast = false } = options;
341
+ const { uid, lines: liveLines } = liveCart();
342
+ const previousQuantity = _optionalChain([liveLines, 'access', _10 => _10.find, 'call', _11 => _11((line) => line.invMastUid === invMastUid), 'optionalAccess', _12 => _12.quantity]);
308
343
  const updatedLines = liveLines.map(
309
344
  (line) => line.invMastUid === invMastUid ? { ...line, quantity: newQuantity } : line
310
345
  );
311
346
  setCartLines(updatedLines);
312
- try {
313
- const success = await callbacks.updateCartLines(uid, updatedLines);
314
- if (!success) throw new Error("Failed to update quantity");
315
- invalidateCartCache();
316
- _optionalChain([onSuccess, 'optionalCall', _15 => _15()]);
317
- return true;
318
- } catch (error) {
319
- setCartLines(
320
- reverseQuantity(_chunkF5DUFW57cjs.useCartStore.getState().cartLines, invMastUid, previousQuantity)
321
- );
322
- if (showToast && _optionalChain([notify, 'optionalAccess', _16 => _16.error])) {
323
- notify.error("Failed to update quantity. Please try again.");
324
- }
325
- _optionalChain([onError, 'optionalCall', _17 => _17(error)]);
326
- return false;
327
- }
347
+ return settleCartOp(
348
+ {
349
+ call: () => callbacks.updateCartLines(uid, updatedLines),
350
+ failure: "Failed to update quantity",
351
+ errorMessage: "Failed to update quantity. Please try again.",
352
+ showToast,
353
+ rollback: () => setCartLines(
354
+ reverseQuantity(_chunkUZAFXUAOcjs.useCartStore.getState().cartLines, invMastUid, previousQuantity)
355
+ )
356
+ },
357
+ options,
358
+ notify,
359
+ invalidateCartCache
360
+ );
328
361
  },
329
362
  [setCartLines, invalidateCartCache, callbacks, notify]
330
363
  );
331
364
  const removeFromCart = _react.useCallback.call(void 0,
332
365
  async (invMastUid, options = {}) => {
333
- const { showToast = true, itemId = "", onSuccess, onError } = options;
334
- const { cartHdrUid: liveUid, cartLines: liveLines } = _chunkF5DUFW57cjs.useCartStore.getState();
335
- const uid = requireCartUid(liveUid);
366
+ const { showToast = true, itemId = "" } = options;
367
+ const { uid, lines: liveLines } = liveCart();
336
368
  const removedLine = liveLines.find((line) => line.invMastUid === invMastUid);
337
369
  setCartLines(liveLines.filter((line) => line.invMastUid !== invMastUid));
338
- try {
339
- const zeroedLines = liveLines.map(
340
- (line) => line.invMastUid === invMastUid ? { ...line, quantity: 0 } : line
341
- );
342
- const success = await callbacks.updateCartLines(uid, zeroedLines);
343
- if (!success) throw new Error("Failed to remove item");
344
- invalidateCartCache();
345
- if (showToast && _optionalChain([notify, 'optionalAccess', _18 => _18.info])) {
346
- notify.info(`${itemId || "Item"} removed from cart`);
347
- }
348
- _optionalChain([onSuccess, 'optionalCall', _19 => _19()]);
349
- return true;
350
- } catch (error) {
351
- setCartLines(restoreRemoved(_chunkF5DUFW57cjs.useCartStore.getState().cartLines, invMastUid, removedLine));
352
- if (showToast && _optionalChain([notify, 'optionalAccess', _20 => _20.error])) {
353
- notify.error("Failed to remove item. Please try again.");
354
- }
355
- _optionalChain([onError, 'optionalCall', _21 => _21(error)]);
356
- return false;
357
- }
370
+ const zeroedLines = liveLines.map(
371
+ (line) => line.invMastUid === invMastUid ? { ...line, quantity: 0 } : line
372
+ );
373
+ return settleCartOp(
374
+ {
375
+ call: () => callbacks.updateCartLines(uid, zeroedLines),
376
+ failure: "Failed to remove item",
377
+ infoMessage: `${itemId || "Item"} removed from cart`,
378
+ errorMessage: "Failed to remove item. Please try again.",
379
+ showToast,
380
+ rollback: () => setCartLines(
381
+ restoreRemoved(_chunkUZAFXUAOcjs.useCartStore.getState().cartLines, invMastUid, removedLine)
382
+ )
383
+ },
384
+ options,
385
+ notify,
386
+ invalidateCartCache
387
+ );
358
388
  },
359
389
  [setCartLines, invalidateCartCache, callbacks, notify]
360
390
  );
361
391
  const clearCart = _react.useCallback.call(void 0,
362
392
  async (options = {}) => {
363
- const { showToast = true, onSuccess, onError } = options;
364
- const { cartHdrUid: liveUid, cartLines: snapshot } = _chunkF5DUFW57cjs.useCartStore.getState();
365
- const uid = requireCartUid(liveUid);
393
+ const { showToast = true } = options;
394
+ const { uid, lines: snapshot } = liveCart();
366
395
  setCartLines([]);
367
- try {
368
- const success = await callbacks.deleteItemsFromCart(uid);
369
- if (!success) throw new Error("Failed to clear cart");
370
- invalidateCartCache();
371
- if (showToast && _optionalChain([notify, 'optionalAccess', _22 => _22.info])) {
372
- notify.info("Cart cleared");
373
- }
374
- _optionalChain([onSuccess, 'optionalCall', _23 => _23()]);
375
- return true;
376
- } catch (error) {
377
- setCartLines(mergeRestore(_chunkF5DUFW57cjs.useCartStore.getState().cartLines, snapshot));
378
- if (showToast && _optionalChain([notify, 'optionalAccess', _24 => _24.error])) {
379
- notify.error("Failed to clear cart. Please try again.");
380
- }
381
- _optionalChain([onError, 'optionalCall', _25 => _25(error)]);
382
- return false;
383
- }
396
+ return settleCartOp(
397
+ {
398
+ call: () => callbacks.deleteItemsFromCart(uid),
399
+ failure: "Failed to clear cart",
400
+ infoMessage: "Cart cleared",
401
+ errorMessage: "Failed to clear cart. Please try again.",
402
+ showToast,
403
+ rollback: () => setCartLines(mergeRestore(_chunkUZAFXUAOcjs.useCartStore.getState().cartLines, snapshot))
404
+ },
405
+ options,
406
+ notify,
407
+ invalidateCartCache
408
+ );
384
409
  },
385
410
  [setCartLines, invalidateCartCache, callbacks, notify]
386
411
  );
@@ -392,7 +417,7 @@ function useCartActions(callbacks) {
392
417
  );
393
418
  const getItemQuantity = _react.useCallback.call(void 0,
394
419
  (invMastUid) => {
395
- return _nullishCoalesce(_optionalChain([cartLines, 'access', _26 => _26.find, 'call', _27 => _27((line) => line.invMastUid === invMastUid), 'optionalAccess', _28 => _28.quantity]), () => ( 0));
420
+ return _nullishCoalesce(_optionalChain([cartLines, 'access', _13 => _13.find, 'call', _14 => _14((line) => line.invMastUid === invMastUid), 'optionalAccess', _15 => _15.quantity]), () => ( 0));
396
421
  },
397
422
  [cartLines]
398
423
  );
@@ -437,6 +462,11 @@ function useModalLifecycle(isOpen, onClose) {
437
462
 
438
463
  var MAX_RETRY_ATTEMPTS = 7;
439
464
  var RETRY_DELAY_MS = 1e3;
465
+ async function waitBeforeRetry(attempt) {
466
+ if (attempt >= MAX_RETRY_ATTEMPTS) return;
467
+ const delay = Math.min(RETRY_DELAY_MS * Math.pow(1.5, attempt), 1e4);
468
+ await new Promise((resolve) => setTimeout(resolve, delay));
469
+ }
440
470
  var defaultGetCartToken = () => localStorage.getItem("cartToken");
441
471
  var defaultSaveCartToken = (token) => localStorage.setItem("cartToken", token);
442
472
  var defaultGenerateCartToken = () => crypto.randomUUID();
@@ -445,14 +475,14 @@ function useCartInitialization(session, callbacks) {
445
475
  const saveCartToken = _nullishCoalesce(callbacks.saveCartToken, () => ( defaultSaveCartToken));
446
476
  const generateCartToken = _nullishCoalesce(callbacks.generateCartToken, () => ( defaultGenerateCartToken));
447
477
  const auth = useAugurAuth();
448
- const cartHdrUid = _chunkF5DUFW57cjs.useCartHdrUid.call(void 0, );
449
- const setCartHdrUid = _chunkF5DUFW57cjs.useSetCartHdrUid.call(void 0, );
450
- const setCartLines = _chunkF5DUFW57cjs.useSetCartLines.call(void 0, );
451
- const clearCart = _chunkF5DUFW57cjs.useClearCart.call(void 0, );
478
+ const cartHdrUid = _chunkUZAFXUAOcjs.useCartHdrUid.call(void 0, );
479
+ const setCartHdrUid = _chunkUZAFXUAOcjs.useSetCartHdrUid.call(void 0, );
480
+ const setCartLines = _chunkUZAFXUAOcjs.useSetCartLines.call(void 0, );
481
+ const clearCart = _chunkUZAFXUAOcjs.useClearCart.call(void 0, );
452
482
  const queryClient = _reactquery.useQueryClient.call(void 0, );
453
483
  const effectiveStatus = session.status;
454
- const effectiveUserId = _nullishCoalesce(session.userId, () => ( _optionalChain([auth, 'optionalAccess', _29 => _29.userId])));
455
- const effectiveCartHdrUid = _nullishCoalesce(session.cartHdrUid, () => ( _optionalChain([auth, 'optionalAccess', _30 => _30.cartHdrUid])));
484
+ const effectiveUserId = _nullishCoalesce(session.userId, () => ( _optionalChain([auth, 'optionalAccess', _16 => _16.userId])));
485
+ const effectiveCartHdrUid = _nullishCoalesce(session.cartHdrUid, () => ( _optionalChain([auth, 'optionalAccess', _17 => _17.cartHdrUid])));
456
486
  const effectiveSession = _react.useMemo.call(void 0,
457
487
  () => ({ status: effectiveStatus, userId: effectiveUserId, cartHdrUid: effectiveCartHdrUid }),
458
488
  [effectiveStatus, effectiveUserId, effectiveCartHdrUid]
@@ -492,17 +522,11 @@ function useCartInitialization(session, callbacks) {
492
522
  return;
493
523
  }
494
524
  retryCountRef.current++;
495
- if (retryCountRef.current < MAX_RETRY_ATTEMPTS) {
496
- const delay = Math.min(RETRY_DELAY_MS * Math.pow(1.5, retryCountRef.current), 1e4);
497
- await new Promise((resolve) => setTimeout(resolve, delay));
498
- }
525
+ await waitBeforeRetry(retryCountRef.current);
499
526
  } catch (error) {
500
527
  lastError = error;
501
528
  retryCountRef.current++;
502
- if (retryCountRef.current < MAX_RETRY_ATTEMPTS) {
503
- const delay = Math.min(RETRY_DELAY_MS * Math.pow(1.5, retryCountRef.current), 1e4);
504
- await new Promise((resolve) => setTimeout(resolve, delay));
505
- }
529
+ await waitBeforeRetry(retryCountRef.current);
506
530
  }
507
531
  }
508
532
  console.error(`Cart initialization failed after ${MAX_RETRY_ATTEMPTS} attempts`, lastError);
@@ -540,19 +564,33 @@ function useCartInitialization(session, callbacks) {
540
564
 
541
565
 
542
566
 
567
+ function deriveLineUnitPrice(priceData, quantity) {
568
+ if (typeof quantity !== "number" || !Number.isFinite(quantity)) return 0;
569
+ try {
570
+ const derived = _augurutils.derivePrice.call(void 0, { priceData, quantity });
571
+ return derived.state === "priced" ? derived.unitPrice : 0;
572
+ } catch (error) {
573
+ if (error instanceof RangeError) return 0;
574
+ throw error;
575
+ }
576
+ }
577
+ function lineTotal(unitPrice, quantity) {
578
+ return Number.isFinite(quantity) ? _augurutils.cleanMoney.call(void 0, unitPrice * quantity) : 0;
579
+ }
543
580
  function useCartPricing(options = {}) {
544
581
  const proxy = useAugurOptions();
545
582
  const auth = useAugurAuth();
546
583
  const site = useAugurSite();
547
- const cartLines = _chunkF5DUFW57cjs.useCartLines.call(void 0, );
548
- const customerId = _nullishCoalesce(_nullishCoalesce(options.customerId, () => ( _optionalChain([auth, 'optionalAccess', _31 => _31.customerId]))), () => ( _optionalChain([site, 'optionalAccess', _32 => _32.defaults, 'optionalAccess', _33 => _33.customerId])));
584
+ const cartLines = _chunkUZAFXUAOcjs.useCartLines.call(void 0, );
585
+ const customerId = _nullishCoalesce(_nullishCoalesce(options.customerId, () => ( _optionalChain([auth, 'optionalAccess', _18 => _18.customerId]))), () => ( _optionalChain([site, 'optionalAccess', _19 => _19.defaults, 'optionalAccess', _20 => _20.customerId])));
549
586
  const priceFn = options.queryFn;
550
587
  const priceQueries = _reactquery.useQueries.call(void 0, {
551
588
  queries: cartLines.map((line) => {
589
+ const quantity = _nullishCoalesce(line.quantity, () => ( 1));
552
590
  if (priceFn) {
553
591
  return {
554
- queryKey: ["price", _optionalChain([line, 'access', _34 => _34.itemId, 'optionalAccess', _35 => _35.toUpperCase, 'call', _36 => _36()]) || "", customerId, line.quantity],
555
- queryFn: () => priceFn(line.itemId, customerId, line.quantity),
592
+ queryKey: ["price", _optionalChain([line, 'access', _21 => _21.itemId, 'optionalAccess', _22 => _22.toUpperCase, 'call', _23 => _23()]) || "", customerId, quantity],
593
+ queryFn: () => priceFn(line.itemId, customerId, quantity),
556
594
  refetchOnReconnect: true,
557
595
  refetchOnWindowFocus: false,
558
596
  meta: { persist: true },
@@ -560,9 +598,9 @@ function useCartPricing(options = {}) {
560
598
  };
561
599
  }
562
600
  const proxyOpts = proxy.pricing.priceEngine.list({
563
- itemId: _optionalChain([line, 'access', _37 => _37.itemId, 'optionalAccess', _38 => _38.toUpperCase, 'call', _39 => _39()]) || "",
601
+ itemId: _optionalChain([line, 'access', _24 => _24.itemId, 'optionalAccess', _25 => _25.toUpperCase, 'call', _26 => _26()]) || "",
564
602
  customerId: Number(customerId),
565
- quantity: line.quantity
603
+ quantity
566
604
  });
567
605
  return {
568
606
  ...proxyOpts,
@@ -577,14 +615,9 @@ function useCartPricing(options = {}) {
577
615
  const map = {};
578
616
  cartLines.forEach((line, index) => {
579
617
  const queryResult = priceQueries[index];
580
- const rawData = _optionalChain([queryResult, 'optionalAccess', _40 => _40.data]);
581
- if (rawData) {
582
- const priceData = _nullishCoalesce(rawData.data, () => ( rawData));
583
- const derived = _augurutils.derivePrice.call(void 0, {
584
- priceData,
585
- quantity: line.quantity
586
- });
587
- const unitPrice = derived.state === "priced" ? derived.unitPrice : 0;
618
+ const priceData = _optionalChain([queryResult, 'optionalAccess', _27 => _27.data]);
619
+ if (priceData) {
620
+ const unitPrice = deriveLineUnitPrice(priceData, line.quantity);
588
621
  map[line.itemId.toUpperCase()] = {
589
622
  unitPrice,
590
623
  priceData
@@ -595,18 +628,18 @@ function useCartPricing(options = {}) {
595
628
  }, [cartLines, priceQueries]);
596
629
  const getUnitPrice = _react.useMemo.call(void 0, () => {
597
630
  return (itemId) => {
598
- return _nullishCoalesce(_optionalChain([prices, 'access', _41 => _41[_optionalChain([itemId, 'optionalAccess', _42 => _42.toUpperCase, 'call', _43 => _43()])], 'optionalAccess', _44 => _44.unitPrice]), () => ( 0));
631
+ return _nullishCoalesce(_optionalChain([prices, 'access', _28 => _28[_optionalChain([itemId, 'optionalAccess', _29 => _29.toUpperCase, 'call', _30 => _30()])], 'optionalAccess', _31 => _31.unitPrice]), () => ( 0));
599
632
  };
600
633
  }, [prices]);
601
634
  const getItemTotal = _react.useMemo.call(void 0, () => {
602
635
  return (itemId, quantity) => {
603
- return getUnitPrice(itemId) * quantity;
636
+ return lineTotal(getUnitPrice(itemId), quantity);
604
637
  };
605
638
  }, [getUnitPrice]);
606
639
  const subtotal = _react.useMemo.call(void 0, () => {
607
640
  return cartLines.reduce((sum, line) => {
608
- const unitPrice = _nullishCoalesce(_optionalChain([prices, 'access', _45 => _45[line.itemId.toUpperCase()], 'optionalAccess', _46 => _46.unitPrice]), () => ( 0));
609
- return sum + unitPrice * line.quantity;
641
+ const unitPrice = _nullishCoalesce(_optionalChain([prices, 'access', _32 => _32[line.itemId.toUpperCase()], 'optionalAccess', _33 => _33.unitPrice]), () => ( 0));
642
+ return _augurutils.cleanMoney.call(void 0, sum + lineTotal(unitPrice, line.quantity));
610
643
  }, 0);
611
644
  }, [cartLines, prices]);
612
645
  const isLoading = priceQueries.some((q) => q.isLoading);
@@ -626,13 +659,14 @@ function useCartPricing(options = {}) {
626
659
  // src/hooks/use-pagination-prefetch.ts
627
660
 
628
661
 
662
+
629
663
  var usePaginationPrefetch = ({
630
664
  queryKey,
631
665
  queryFn,
632
666
  pageSize,
633
667
  queryKeyFn,
634
- staleTime = 10 * 60 * 1e3,
635
- gcTime = 30 * 60 * 1e3,
668
+ staleTime = _augurutils.toMillis.call(void 0, _augurutils.minutes.call(void 0, 10)),
669
+ gcTime = _augurutils.toMillis.call(void 0, _augurutils.minutes.call(void 0, 30)),
636
670
  enabled = true
637
671
  }) => {
638
672
  const queryClient = _reactquery.useQueryClient.call(void 0, );
@@ -665,6 +699,10 @@ var usePaginationPrefetch = ({
665
699
  // src/persistence/use-persistence.ts
666
700
 
667
701
 
702
+
703
+ // src/persistence/create-persister.ts
704
+
705
+
668
706
  // src/persistence/serializer.ts
669
707
  function serialize(data) {
670
708
  return JSON.stringify(data, (_key, value) => {
@@ -678,7 +716,7 @@ function deserialize(data) {
678
716
 
679
717
  // src/persistence/apply-limits.ts
680
718
  function applyLimits(data, limits) {
681
- const queries = _optionalChain([data, 'access', _47 => _47.clientState, 'optionalAccess', _48 => _48.queries]);
719
+ const queries = _optionalChain([data, 'access', _34 => _34.clientState, 'optionalAccess', _35 => _35.queries]);
682
720
  if (!queries || Object.keys(limits).length === 0) return data;
683
721
  const entries = queries;
684
722
  const unlimited = [];
@@ -720,18 +758,16 @@ var noopPersister = {
720
758
  };
721
759
  function createPersister(config) {
722
760
  if (typeof window === "undefined") return noopPersister;
723
- const throttleMs = _nullishCoalesce(config.throttleMs, () => ( 1e3));
761
+ const throttleMs = _nullishCoalesce(config.throttleMs, () => ( _augurutils.toMillis.call(void 0, _augurutils.seconds.call(void 0, 1))));
724
762
  const limits = _nullishCoalesce(config.limits, () => ( {}));
725
763
  let timer;
726
764
  let pending;
727
- function flush() {
728
- if (!pending) return;
765
+ function write(client) {
729
766
  try {
730
- const limited = applyLimits(pending, limits);
767
+ const limited = applyLimits(client, limits);
731
768
  window.localStorage.setItem(config.key, serialize(limited));
732
769
  } catch (e2) {
733
770
  }
734
- pending = void 0;
735
771
  }
736
772
  return {
737
773
  persistClient(client) {
@@ -739,7 +775,7 @@ function createPersister(config) {
739
775
  if (!timer) {
740
776
  timer = setTimeout(() => {
741
777
  timer = void 0;
742
- flush();
778
+ write(pending);
743
779
  }, throttleMs);
744
780
  }
745
781
  },
@@ -760,11 +796,14 @@ function createPersister(config) {
760
796
 
761
797
  // src/persistence/use-storage-monitor.ts
762
798
 
763
- var CHECK_INTERVAL_MS = 5 * 60 * 1e3;
799
+
800
+ var CHECK_INTERVAL = _augurutils.toMillis.call(void 0, _augurutils.minutes.call(void 0, 5));
764
801
  function useStorageMonitor(config) {
765
802
  const { key, limits = {}, maxStorageMB = 3 } = config;
766
- const limitKeys = Object.keys(limits);
803
+ const limitKeysRef = _chunkUZAFXUAOcjs.useLatest.call(void 0, Object.keys(limits));
804
+ const limitCount = limitKeysRef.current.length;
767
805
  _react.useEffect.call(void 0, () => {
806
+ const limitKeys = limitKeysRef.current;
768
807
  if (typeof window === "undefined" || limitKeys.length === 0) return;
769
808
  function evict() {
770
809
  const storage = window.localStorage;
@@ -779,7 +818,7 @@ function useStorageMonitor(config) {
779
818
  const raw = storage.getItem(key);
780
819
  if (!raw) return;
781
820
  const parsed = JSON.parse(raw);
782
- if (!_optionalChain([parsed, 'access', _49 => _49.clientState, 'optionalAccess', _50 => _50.queries])) return;
821
+ if (!_optionalChain([parsed, 'access', _36 => _36.clientState, 'optionalAccess', _37 => _37.queries])) return;
783
822
  parsed.clientState.queries = parsed.clientState.queries.filter(
784
823
  (q) => {
785
824
  if (!Array.isArray(q.queryKey)) return true;
@@ -793,12 +832,13 @@ function useStorageMonitor(config) {
793
832
  }
794
833
  }
795
834
  evict();
796
- const id = setInterval(evict, CHECK_INTERVAL_MS);
835
+ const id = setInterval(evict, CHECK_INTERVAL);
797
836
  return () => clearInterval(id);
798
- }, [key, maxStorageMB, limitKeys.length]);
837
+ }, [key, maxStorageMB, limitCount, limitKeysRef]);
799
838
  }
800
839
 
801
840
  // src/persistence/use-persistence.ts
841
+ var PERSISTED_DATA_FORMAT = "augur-2";
802
842
  function useAugurPersistence(config) {
803
843
  const [persister] = _react.useState.call(void 0, () => createPersister(config));
804
844
  const [isMounted, setIsMounted] = _react.useState.call(void 0, false);
@@ -806,23 +846,26 @@ function useAugurPersistence(config) {
806
846
  setIsMounted(true);
807
847
  }, []);
808
848
  useStorageMonitor(config);
809
- const isDev = typeof process !== "undefined" && _optionalChain([process, 'access', _51 => _51.env, 'optionalAccess', _52 => _52["NODE_ENV"]]) === "development";
849
+ const isDev = typeof process !== "undefined" && _optionalChain([process, 'access', _38 => _38.env, 'optionalAccess', _39 => _39["NODE_ENV"]]) === "development";
810
850
  const { persistableKeys } = config;
811
851
  const dehydrateOptions = _react.useMemo.call(void 0,
812
852
  () => ({
813
853
  shouldDehydrateQuery: (query) => {
814
854
  const key = query.queryKey;
815
- if (!Array.isArray(key) || key.length === 0) return false;
816
- if (query.state.status !== "success") return false;
817
- return persistableKeys.includes(key[0]);
855
+ const hasHead = Array.isArray(key) && key.length > 0;
856
+ return _chunkUZAFXUAOcjs.shouldPersistOf.call(void 0,
857
+ hasHead,
858
+ query.state.status === "success",
859
+ hasHead && persistableKeys.includes(key[0])
860
+ );
818
861
  }
819
862
  }),
820
863
  [persistableKeys]
821
864
  );
822
865
  return {
823
866
  persister,
824
- maxAge: isMounted ? _nullishCoalesce(config.maxAge, () => ( 24 * 60 * 60 * 1e3)) : 0,
825
- buster: isDev ? String(Date.now()) : _nullishCoalesce(config.buster, () => ( "")),
867
+ maxAge: isMounted ? _nullishCoalesce(config.maxAge, () => ( _augurutils.toMillis.call(void 0, _augurutils.hours.call(void 0, 24)))) : 0,
868
+ buster: isDev ? String(Date.now()) : `${PERSISTED_DATA_FORMAT}:${_nullishCoalesce(config.buster, () => ( ""))}`,
826
869
  dehydrateOptions
827
870
  };
828
871
  }
@@ -863,5 +906,5 @@ function useAugurPersistence(config) {
863
906
 
864
907
 
865
908
 
866
- exports.AugurHooksProvider = AugurHooksProvider; exports.clearCheckoutPersistence = _chunkF5DUFW57cjs.clearCheckoutPersistence; exports.clearFromSession = _chunkF5DUFW57cjs.clearFromSession; exports.determineOrderReadiness = _chunkF5DUFW57cjs.determineOrderReadiness; exports.executeBatchQuery = _chunk6Z6JGK2Ccjs.executeBatchQuery; exports.getRegisteredQueryAction = _chunk6Z6JGK2Ccjs.getRegisteredQueryAction; exports.loadFromSession = _chunkF5DUFW57cjs.loadFromSession; exports.registerQueryAction = _chunk6Z6JGK2Ccjs.registerQueryAction; exports.saveToSession = _chunkF5DUFW57cjs.saveToSession; exports.useAugurApi = useAugurApi; exports.useAugurApiOptional = useAugurApiOptional; exports.useAugurAuth = useAugurAuth; exports.useAugurCache = useAugurCache; exports.useAugurOptions = useAugurOptions; exports.useAugurPersistence = useAugurPersistence; exports.useAugurSite = useAugurSite; exports.useCartActions = useCartActions; exports.useCartHdrUid = _chunkF5DUFW57cjs.useCartHdrUid; exports.useCartInitialization = useCartInitialization; exports.useCartLineCount = _chunkF5DUFW57cjs.useCartLineCount; exports.useCartLines = _chunkF5DUFW57cjs.useCartLines; exports.useCartPricing = useCartPricing; exports.useCartQuantityTotal = _chunkF5DUFW57cjs.useCartQuantityTotal; exports.useCartStore = _chunkF5DUFW57cjs.useCartStore; exports.useCheckoutPersistence = _chunkF5DUFW57cjs.useCheckoutPersistence; exports.useClearCart = _chunkF5DUFW57cjs.useClearCart; exports.useDebounce = useDebounce; exports.useFormatPrice = useFormatPrice; exports.useItemFiltersStore = useItemFiltersStore; exports.useModalLifecycle = useModalLifecycle; exports.useOrderReadiness = _chunkF5DUFW57cjs.useOrderReadiness; exports.usePaginationPrefetch = usePaginationPrefetch; exports.usePaymentFlow = _chunkF5DUFW57cjs.usePaymentFlow; exports.useSetCartHdrUid = _chunkF5DUFW57cjs.useSetCartHdrUid; exports.useSetCartLines = _chunkF5DUFW57cjs.useSetCartLines; exports.useStock = useStock;
909
+ exports.AugurHooksProvider = AugurHooksProvider; exports.clearCheckoutPersistence = _chunkUZAFXUAOcjs.clearCheckoutPersistence; exports.clearFromSession = _chunkUZAFXUAOcjs.clearFromSession; exports.determineOrderReadiness = _chunkUZAFXUAOcjs.determineOrderReadiness; exports.executeBatchQuery = _chunk6Z6JGK2Ccjs.executeBatchQuery; exports.getRegisteredQueryAction = _chunk6Z6JGK2Ccjs.getRegisteredQueryAction; exports.loadFromSession = _chunkUZAFXUAOcjs.loadFromSession; exports.registerQueryAction = _chunk6Z6JGK2Ccjs.registerQueryAction; exports.saveToSession = _chunkUZAFXUAOcjs.saveToSession; exports.useAugurApi = useAugurApi; exports.useAugurApiOptional = useAugurApiOptional; exports.useAugurAuth = useAugurAuth; exports.useAugurCache = useAugurCache; exports.useAugurOptions = useAugurOptions; exports.useAugurPersistence = useAugurPersistence; exports.useAugurSite = useAugurSite; exports.useCartActions = useCartActions; exports.useCartHdrUid = _chunkUZAFXUAOcjs.useCartHdrUid; exports.useCartInitialization = useCartInitialization; exports.useCartLineCount = _chunkUZAFXUAOcjs.useCartLineCount; exports.useCartLines = _chunkUZAFXUAOcjs.useCartLines; exports.useCartPricing = useCartPricing; exports.useCartQuantityTotal = _chunkUZAFXUAOcjs.useCartQuantityTotal; exports.useCartStore = _chunkUZAFXUAOcjs.useCartStore; exports.useCheckoutPersistence = _chunkUZAFXUAOcjs.useCheckoutPersistence; exports.useClearCart = _chunkUZAFXUAOcjs.useClearCart; exports.useDebounce = useDebounce; exports.useFormatPrice = useFormatPrice; exports.useItemFiltersStore = useItemFiltersStore; exports.useModalLifecycle = useModalLifecycle; exports.useOrderReadiness = _chunkUZAFXUAOcjs.useOrderReadiness; exports.usePaginationPrefetch = usePaginationPrefetch; exports.usePaymentFlow = _chunkUZAFXUAOcjs.usePaymentFlow; exports.useSetCartHdrUid = _chunkUZAFXUAOcjs.useSetCartHdrUid; exports.useSetCartLines = _chunkUZAFXUAOcjs.useSetCartLines; exports.useStock = useStock;
867
910
  //# sourceMappingURL=index.cjs.map