@wix/stores 1.0.994 → 1.0.995

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.
@@ -3426,33 +3426,41 @@ function Zl() {
3426
3426
  return Ql(new URL(e2.currentUrl));
3427
3427
  }
3428
3428
  function Ql(e2) {
3429
- return e2.pathname.split(`/`).filter(Boolean).at(-1) || void 0;
3429
+ let t2 = e2.pathname.split(`/`).filter(Boolean).at(-1);
3430
+ return t2 ? $l(t2) : void 0;
3430
3431
  }
3431
- var $l = q(`seo/seo-service`);
3432
- var eu = q(`@wix/site-service-rendering-context`);
3433
- function tu(e2) {
3434
- let t2 = c($l), { SSR: n2 } = c(eu), i2 = r(false);
3432
+ function $l(e2) {
3433
+ try {
3434
+ return decodeURIComponent(e2);
3435
+ } catch {
3436
+ return e2;
3437
+ }
3438
+ }
3439
+ var eu = q(`seo/seo-service`);
3440
+ var tu = q(`@wix/site-service-rendering-context`);
3441
+ function nu(e2) {
3442
+ let t2 = c(eu), { SSR: n2 } = c(tu), i2 = r(false);
3435
3443
  !i2.current && e2.id && n2 && (i2.current = true, t2.setSeoEntity({ itemType: `STORES_PRODUCT`, seoData: e2.seoData ?? {}, itemData: { product: e2 } }).catch(() => {
3436
3444
  }));
3437
3445
  }
3438
- var nu = `No product slug is available for the product context`;
3439
- function ru() {
3446
+ var ru = `No product slug is available for the product context`;
3447
+ function iu() {
3440
3448
  return o();
3441
3449
  }
3442
- function iu({ productPromise: e2 }) {
3450
+ function au({ productPromise: e2 }) {
3443
3451
  let { seoProduct: t2 } = kn(e2);
3444
- return tu(t2), null;
3452
+ return nu(t2), null;
3445
3453
  }
3446
- function au({ children: e2 }) {
3447
- let t2 = Zl(), n2 = Yl(`slug:${t2}`, () => t2 ? Gi(t2) : Promise.reject(Error(nu)));
3448
- return u(zl, { productPromise: n2, source: Xl.PRODUCT_BY_SLUG, children: [l(iu, { productPromise: n2 }), e2] });
3454
+ function ou({ children: e2 }) {
3455
+ let t2 = Zl(), n2 = Yl(`slug:${t2}`, () => t2 ? Gi(t2) : Promise.reject(Error(ru)));
3456
+ return u(zl, { productPromise: n2, source: Xl.PRODUCT_BY_SLUG, children: [l(au, { productPromise: n2 }), e2] });
3449
3457
  }
3450
- var ou = On(`b276b552-68b9-4936-98d5-fbe43c0bd257`);
3458
+ var su = On(`b276b552-68b9-4936-98d5-fbe43c0bd257`);
3451
3459
  export {
3452
- nu as NO_PRODUCT_SLUG_ERROR,
3453
- au as ProductBySlugContextProvider,
3454
- au as default,
3455
- ou as injectAccessTokenGetter,
3456
- ru as useProductBySlugContext
3460
+ ru as NO_PRODUCT_SLUG_ERROR,
3461
+ ou as ProductBySlugContextProvider,
3462
+ ou as default,
3463
+ su as injectAccessTokenGetter,
3464
+ iu as useProductBySlugContext
3457
3465
  };
3458
3466
  //# sourceMappingURL=context-product-by-slug.mjs.map