@wix/stores 1.0.976 → 1.0.978

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 (31) hide show
  1. package/_sdk-exports/context-category-by-id/runtime.js +2 -2
  2. package/_sdk-exports/context-category-by-slug/runtime.js +2 -2
  3. package/_sdk-exports/context-category-info/runtime.js +2 -2
  4. package/_sdk-exports/context-product-by-id/runtime.js +2 -2
  5. package/_sdk-exports/context-product-by-slug/runtime.js +2 -2
  6. package/_sdk-exports/context-product-item/runtime.js +2 -2
  7. package/build/cjs/context-category-by-id.js +218 -207
  8. package/build/cjs/context-category-by-id.js.map +1 -1
  9. package/build/cjs/context-category-by-slug.js +1202 -1191
  10. package/build/cjs/context-category-by-slug.js.map +1 -1
  11. package/build/cjs/context-category-info.js +258 -248
  12. package/build/cjs/context-category-info.js.map +1 -1
  13. package/build/cjs/context-product-by-id.js +39 -31
  14. package/build/cjs/context-product-by-id.js.map +1 -1
  15. package/build/cjs/context-product-by-slug.js +48 -40
  16. package/build/cjs/context-product-by-slug.js.map +1 -1
  17. package/build/cjs/context-product-item.js +1042 -1034
  18. package/build/cjs/context-product-item.js.map +1 -1
  19. package/build/es/context-category-by-id.mjs +218 -207
  20. package/build/es/context-category-by-id.mjs.map +1 -1
  21. package/build/es/context-category-by-slug.mjs +1202 -1191
  22. package/build/es/context-category-by-slug.mjs.map +1 -1
  23. package/build/es/context-category-info.mjs +262 -252
  24. package/build/es/context-category-info.mjs.map +1 -1
  25. package/build/es/context-product-by-id.mjs +39 -31
  26. package/build/es/context-product-by-id.mjs.map +1 -1
  27. package/build/es/context-product-by-slug.mjs +48 -40
  28. package/build/es/context-product-by-slug.mjs.map +1 -1
  29. package/build/es/context-product-item.mjs +1042 -1034
  30. package/build/es/context-product-item.mjs.map +1 -1
  31. package/package.json +5 -5
@@ -3353,7 +3353,15 @@ function Il(t2) {
3353
3353
  }
3354
3354
  Il.displayName = `StandaloneProductContextProvider`;
3355
3355
  var Ll = K(`@wix/site-service-warmup-data`);
3356
- async function Rl(e2, t2, n2) {
3356
+ function Rl() {
3357
+ let e2 = o(), t2 = s(Jc), n2;
3358
+ try {
3359
+ n2 = e2(Yc);
3360
+ } catch {
3361
+ }
3362
+ return n2?.multilingualEnabled && n2.currentLocale?.languageCode || t2.language;
3363
+ }
3364
+ async function zl(e2, t2, n2) {
3357
3365
  let r2 = typeof window > `u`;
3358
3366
  if (!r2 && e2) try {
3359
3367
  let n3 = await e2.get(t2);
@@ -3367,61 +3375,61 @@ async function Rl(e2, t2, n2) {
3367
3375
  }
3368
3376
  return i2;
3369
3377
  }
3370
- function zl(e2, t2) {
3371
- let n2 = o(), [i2] = r(() => {
3372
- let r2;
3378
+ function Bl(e2, t2) {
3379
+ let r2 = o(), i2 = Rl();
3380
+ return n(() => {
3381
+ let n2;
3373
3382
  try {
3374
- r2 = n2(Ll);
3383
+ n2 = r2(Ll);
3375
3384
  } catch {
3376
- r2 = null;
3385
+ n2 = null;
3377
3386
  }
3378
- return Rl(r2, e2, t2);
3379
- });
3380
- return i2;
3387
+ return zl(n2, `${e2}:${i2}`, t2);
3388
+ }, [i2]);
3381
3389
  }
3382
- async function Bl() {
3390
+ async function Vl() {
3383
3391
  return (await ai().eq(`defaultLocation`, true).find()).items?.[0]?._id ?? void 0;
3384
3392
  }
3385
- async function Vl() {
3393
+ async function Hl() {
3386
3394
  try {
3387
3395
  return (await ia()).settings?.collectionStates?.some((e2) => e2.appId === `215238eb-22a5-4c36-9e7b-e7c08025e04e` && e2.collectingRequests) ?? false;
3388
3396
  } catch {
3389
3397
  return false;
3390
3398
  }
3391
3399
  }
3392
- function Hl(e2) {
3400
+ function Ul(e2) {
3393
3401
  return e2.map((e3) => ({ variantId: e3.variantId ?? ``, availabilityStatus: e3.availabilityStatus, quantity: e3.quantity ?? void 0, trackQuantity: e3.trackQuantity ?? false, preorderInfo: e3.preorderInfo ? { message: e3.preorderInfo.message ?? void 0, quantity: e3.preorderInfo.quantity ?? void 0 } : void 0 }));
3394
3402
  }
3395
- async function Ul(e2, t2) {
3396
- return Hl((await Dr().eq(`productId`, e2).eq(`locationId`, t2).find()).items ?? []);
3403
+ async function Wl(e2, t2) {
3404
+ return Ul((await Dr().eq(`productId`, e2).eq(`locationId`, t2).find()).items ?? []);
3397
3405
  }
3398
- async function Wl(e2) {
3399
- let [t2, n2, r2] = await Promise.all([e2(), Bl(), Vl()]), { product: i2 } = t2;
3406
+ async function Gl(e2) {
3407
+ let [t2, n2, r2] = await Promise.all([e2(), Vl(), Hl()]), { product: i2 } = t2;
3400
3408
  if (!n2) throw Error(`Location not found`);
3401
- let [a2, o2] = await Promise.all([Ul(i2.id, n2), i2.productGroupId ? wl(i2.productGroupId) : void 0]);
3409
+ let [a2, o2] = await Promise.all([Wl(i2.id, n2), i2.productGroupId ? wl(i2.productGroupId) : void 0]);
3402
3410
  return { ...t2, productGroup: o2, inventoryItems: a2, isBackInStockEnabled: r2 };
3403
3411
  }
3404
- function Gl(e2, t2) {
3405
- return zl(`wixstores-storefront-builder:product-data:${e2}`, () => Wl(t2));
3412
+ function Kl(e2, t2) {
3413
+ return Bl(`wixstores-storefront-builder:product-data:${e2}`, () => Gl(t2));
3406
3414
  }
3407
- var Kl = function(e2) {
3415
+ var ql = function(e2) {
3408
3416
  return e2.PRODUCT_BY_SLUG = `product-by-slug`, e2.PRODUCT_BY_ID = `product-by-id`, e2.PRODUCT_ITEM = `product-item`, e2;
3409
3417
  }({});
3410
- function ql() {
3418
+ function Jl() {
3411
3419
  return a();
3412
3420
  }
3413
- function Jl({ productId: e2, children: t2 }) {
3414
- let n2 = Gl(`id:${e2}`, () => Hi(e2));
3415
- return c(Il, { productPromise: n2, source: Kl.PRODUCT_BY_ID, children: t2 });
3416
- }
3417
3421
  function Yl({ productId: e2, children: t2 }) {
3418
- return e2 ? c(Jl, { productId: e2, children: t2 }, e2) : null;
3422
+ let n2 = Kl(`id:${e2}`, () => Hi(e2));
3423
+ return c(Il, { productPromise: n2, source: ql.PRODUCT_BY_ID, children: t2 });
3424
+ }
3425
+ function Xl({ productId: e2, children: t2 }) {
3426
+ return e2 ? c(Yl, { productId: e2, children: t2 }, e2) : null;
3419
3427
  }
3420
- var Xl = Dn(`213f32a8-6f88-4024-a54b-f1264433e878`);
3428
+ var Zl = Dn(`213f32a8-6f88-4024-a54b-f1264433e878`);
3421
3429
  export {
3422
- Yl as ProductByIdContextProvider,
3423
- Yl as default,
3424
- Xl as injectAccessTokenGetter,
3425
- ql as useProductByIdContext
3430
+ Xl as ProductByIdContextProvider,
3431
+ Xl as default,
3432
+ Zl as injectAccessTokenGetter,
3433
+ Jl as useProductByIdContext
3426
3434
  };
3427
3435
  //# sourceMappingURL=context-product-by-id.mjs.map