cloudcommerce 2.3.1 → 2.3.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 (150) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/ecomplus-stores/barra-doce/functions/many/package.json +3 -3
  3. package/ecomplus-stores/barra-doce/functions/ssr/package.json +6 -6
  4. package/ecomplus-stores/barra-doce/functions/with-apps/package.json +3 -3
  5. package/ecomplus-stores/barra-doce/package.json +2 -2
  6. package/package.json +6 -6
  7. package/packages/api/package.json +1 -1
  8. package/packages/apps/affiliate-program/package.json +1 -1
  9. package/packages/apps/correios/package.json +2 -2
  10. package/packages/apps/custom-payment/package.json +1 -1
  11. package/packages/apps/custom-shipping/package.json +1 -1
  12. package/packages/apps/datafrete/package.json +1 -1
  13. package/packages/apps/discounts/package.json +1 -1
  14. package/packages/apps/emails/package.json +1 -1
  15. package/packages/apps/fb-conversions/package.json +2 -2
  16. package/packages/apps/flash-courier/package.json +1 -1
  17. package/packages/apps/frenet/package.json +1 -1
  18. package/packages/apps/galaxpay/package.json +1 -1
  19. package/packages/apps/google-analytics/package.json +1 -1
  20. package/packages/apps/jadlog/package.json +1 -1
  21. package/packages/apps/loyalty-points/package.json +1 -1
  22. package/packages/apps/mandae/package.json +1 -1
  23. package/packages/apps/melhor-envio/package.json +1 -1
  24. package/packages/apps/mercadopago/package.json +1 -1
  25. package/packages/apps/pagarme/package.json +1 -1
  26. package/packages/apps/pagarme-v5/package.json +1 -1
  27. package/packages/apps/paghiper/package.json +1 -1
  28. package/packages/apps/pix/package.json +1 -1
  29. package/packages/apps/tiny-erp/package.json +1 -1
  30. package/packages/apps/webhooks/package.json +1 -1
  31. package/packages/cli/package.json +1 -1
  32. package/packages/config/package.json +1 -1
  33. package/packages/emails/package.json +1 -1
  34. package/packages/eslint/package.json +5 -5
  35. package/packages/events/package.json +1 -1
  36. package/packages/feeds/package.json +1 -1
  37. package/packages/firebase/package.json +2 -2
  38. package/packages/i18n/package.json +1 -1
  39. package/packages/modules/package.json +1 -1
  40. package/packages/passport/package.json +1 -1
  41. package/packages/ssr/lib/lib/analytics/send-to-ga4.js +2 -1
  42. package/packages/ssr/lib/lib/analytics/send-to-ga4.js.map +1 -1
  43. package/packages/ssr/lib/lib/analytics-events.js +11 -1
  44. package/packages/ssr/lib/lib/analytics-events.js.map +1 -1
  45. package/packages/ssr/lib/lib/serve-storefront.js +35 -21
  46. package/packages/ssr/lib/lib/serve-storefront.js.map +1 -1
  47. package/packages/ssr/package.json +3 -3
  48. package/packages/ssr/src/lib/analytics/send-to-ga4.ts +2 -0
  49. package/packages/ssr/src/lib/analytics-events.ts +11 -1
  50. package/packages/ssr/src/lib/serve-storefront.ts +36 -22
  51. package/packages/storefront/astro.config.mjs +4 -1
  52. package/packages/storefront/config/astro/vue-server.mjs +64 -0
  53. package/packages/storefront/dist/client/_astro/{AccountPage.3-eqV6OR.js → AccountPage.0M6_FdU6.js} +1 -1
  54. package/packages/storefront/dist/client/_astro/{CartSidebar.-Gy6eqIy.js → CartSidebar.L0Vbhsdt.js} +1 -1
  55. package/packages/storefront/dist/client/_astro/ProductDetails.FQtM5kpd.js +7 -0
  56. package/packages/storefront/dist/client/_astro/{ProductShelf.qbTNzuvn.js → ProductShelf.-4fsYkPB.js} +1 -1
  57. package/packages/storefront/dist/client/_astro/{ProductShelf.b77WjhZZ.js → ProductShelf.GAAhKdTN.js} +1 -1
  58. package/packages/storefront/dist/client/_astro/{SearchModal.WzDMBjqi.js → SearchModal.rasg5jV6.js} +1 -1
  59. package/packages/storefront/dist/client/_astro/SearchShowcase.kA6jICYo.js +1 -0
  60. package/packages/storefront/dist/client/_astro/ShopHeader.v_L96Y90.js +7 -0
  61. package/packages/storefront/dist/client/_astro/{_slug_.WkuZ8tvp.css → _slug_.4W7qhV-L.css} +1 -1
  62. package/packages/storefront/dist/client/_astro/customer-session.ZD6tLDQJ.js +7 -0
  63. package/packages/storefront/dist/client/_astro/{firebase-app.VduCDgof.js → firebase-app.iLdzDVjL.js} +1 -1
  64. package/packages/storefront/dist/client/_astro/hoisted.GaT7bmE3.js +1 -0
  65. package/packages/storefront/dist/client/_astro/{hoisted.xTPkED8g.js → hoisted.ICXGWNEA.js} +1 -1
  66. package/packages/storefront/dist/client/_astro/hoisted.XOXTrHqn.js +1 -0
  67. package/packages/storefront/dist/client/_astro/{index-dd468b12.fl8bpn8l.js → index-bea2a320.eWykogwr.js} +93 -93
  68. package/packages/storefront/dist/client/_astro/{shopping-cart.v-dB3kHB.js → shopping-cart.nSNNOrp9.js} +1 -1
  69. package/packages/storefront/dist/client/_astro/use-analytics.wTmoP8B1.js +1 -0
  70. package/packages/storefront/dist/client/_astro/{use-product-card.nNtSJVtB.js → use-product-card.UFr8SCuD.js} +1 -1
  71. package/packages/storefront/dist/client/_astro/use-text-value.lKqoIagH.js +4 -0
  72. package/packages/storefront/dist/server/chunks/{CartSidebar_blvgfFa-.mjs → CartSidebar_3_1aFp67.mjs} +1 -1
  73. package/packages/storefront/dist/server/chunks/{SearchModal_Sktaq643.mjs → SearchModal_2azP1u7P.mjs} +1 -1
  74. package/packages/storefront/dist/server/chunks/_.._19fCuQdO.mjs +5 -0
  75. package/packages/storefront/dist/server/chunks/{_page__9PfWVh79.mjs → _page__qqIVxbal.mjs} +1 -1
  76. package/packages/storefront/dist/server/chunks/{account_R4bpY7O1.mjs → account_vK6pmJlz.mjs} +1 -1
  77. package/packages/storefront/dist/server/chunks/astro/{assets-service_oQ4-9MNg.mjs → assets-service_631fRtTy.mjs} +66 -11
  78. package/packages/storefront/dist/server/chunks/{astro_ECsNQeA2.mjs → astro_u-oSb215.mjs} +8 -2
  79. package/packages/storefront/dist/server/chunks/{index__PeYBuja.mjs → index__05fnqFh.mjs} +1 -1
  80. package/packages/storefront/dist/server/chunks/{node_njrZIjT6.mjs → node_zqXXqc-u.mjs} +1 -1
  81. package/packages/storefront/dist/server/chunks/pages/{__XOsz50la.mjs → __ZucPYaOo.mjs} +380 -118
  82. package/packages/storefront/dist/server/chunks/pages/{_page__cIw_KTpN.mjs → _page__0sN9U0SD.mjs} +19 -3
  83. package/packages/storefront/dist/server/chunks/pages/account_OQr_6KN1.mjs +33 -0
  84. package/packages/storefront/dist/server/chunks/pages/{index_KP7Gn0ld.mjs → index_3IjgOEIq.mjs} +15 -4
  85. package/packages/storefront/dist/server/chunks/pages/node_OmjWRf8D.mjs +112 -0
  86. package/packages/storefront/dist/server/chunks/pages/~fallback_133FK-CP.mjs +59 -0
  87. package/packages/storefront/dist/server/chunks/~fallback_Wahcp9Wk.mjs +5 -0
  88. package/packages/storefront/dist/server/entry.mjs +9 -9
  89. package/packages/storefront/dist/server/manifest_9FASPYUE.mjs +202 -0
  90. package/packages/storefront/dist/server/renderers.mjs +45 -34
  91. package/packages/storefront/package.json +4 -4
  92. package/packages/storefront/server.d.ts +0 -1
  93. package/packages/storefront/src/lib/$storefront.d.ts +23 -16
  94. package/packages/storefront/src/lib/composables/use-pagination.ts +1 -3
  95. package/packages/storefront/src/lib/layouts/BaseHead.astro +5 -0
  96. package/packages/storefront/src/lib/scripts/push-analytics-events.ts +8 -6
  97. package/packages/storefront/src/lib/ssr-context.ts +46 -6
  98. package/packages/storefront/src/lib/state/use-analytics.ts +12 -11
  99. package/packages/storefront/src/lib/state/use-storage.ts +23 -9
  100. package/packages/test-base/package.json +1 -1
  101. package/packages/types/package.json +1 -1
  102. package/packages/storefront/dist/client/_astro/ProductDetails.ATGXfGhG.js +0 -7
  103. package/packages/storefront/dist/client/_astro/SearchShowcase.9gIA4Cq0.js +0 -1
  104. package/packages/storefront/dist/client/_astro/ShopHeader.Ee4OJr3q.js +0 -7
  105. package/packages/storefront/dist/client/_astro/customer-session.dSYHWdP4.js +0 -7
  106. package/packages/storefront/dist/client/_astro/ecom-icon_12falx.png +0 -0
  107. package/packages/storefront/dist/client/_astro/ecom-icon_15pqnO.png +0 -0
  108. package/packages/storefront/dist/client/_astro/ecom-icon_t3guw.png +0 -0
  109. package/packages/storefront/dist/client/_astro/headphone_T2Jjc.avif +0 -0
  110. package/packages/storefront/dist/client/_astro/headphone_Z1CG18r.webp +0 -0
  111. package/packages/storefront/dist/client/_astro/hoisted.d2SGwVMl.js +0 -1
  112. package/packages/storefront/dist/client/_astro/hoisted.x1b7VHef.js +0 -1
  113. package/packages/storefront/dist/client/_astro/logo_1UBsBq.webp +0 -0
  114. package/packages/storefront/dist/client/_astro/logo_Z1K5PE9.png +0 -0
  115. package/packages/storefront/dist/client/_astro/logo_Z1KIIl1.avif +0 -0
  116. package/packages/storefront/dist/client/_astro/passion_LHbe9.webp +0 -0
  117. package/packages/storefront/dist/client/_astro/passion_Z23MeUb.avif +0 -0
  118. package/packages/storefront/dist/client/_astro/rect8589_1TtOHY.png +0 -0
  119. package/packages/storefront/dist/client/_astro/rect8589_1f5opX.webp +0 -0
  120. package/packages/storefront/dist/client/_astro/rect8589_IUskt.webp +0 -0
  121. package/packages/storefront/dist/client/_astro/rect8589_Uxfdf.png +0 -0
  122. package/packages/storefront/dist/client/_astro/rect8589_Z15uApA.png +0 -0
  123. package/packages/storefront/dist/client/_astro/rect8589_Z1Ap1Im.avif +0 -0
  124. package/packages/storefront/dist/client/_astro/rect8589_Z1JT1HB.webp +0 -0
  125. package/packages/storefront/dist/client/_astro/rect8589_ZY9mtN.avif +0 -0
  126. package/packages/storefront/dist/client/_astro/rect8589_tMFW0.avif +0 -0
  127. package/packages/storefront/dist/client/_astro/rect859_1TgQXS.avif +0 -0
  128. package/packages/storefront/dist/client/_astro/rect859_2Nm1z.avif +0 -0
  129. package/packages/storefront/dist/client/_astro/rect859_DIqwR.png +0 -0
  130. package/packages/storefront/dist/client/_astro/rect859_Z1IKDb2.png +0 -0
  131. package/packages/storefront/dist/client/_astro/rect859_Z29FI4V.webp +0 -0
  132. package/packages/storefront/dist/client/_astro/rect859_Z2kFHGk.avif +0 -0
  133. package/packages/storefront/dist/client/_astro/rect859_ZkpPFI.webp +0 -0
  134. package/packages/storefront/dist/client/_astro/rect859_jXzBi.png +0 -0
  135. package/packages/storefront/dist/client/_astro/rect859_x1l16.webp +0 -0
  136. package/packages/storefront/dist/client/_astro/rect89_1TSfW7.avif +0 -0
  137. package/packages/storefront/dist/client/_astro/rect89_Z1re32x.webp +0 -0
  138. package/packages/storefront/dist/client/_astro/use-analytics._ef6TM4P.js +0 -1
  139. package/packages/storefront/dist/client/_astro/use-text-value.0OP9HCfP.js +0 -4
  140. package/packages/storefront/dist/client/~fallback.html +0 -99
  141. package/packages/storefront/dist/client/~index.html +0 -131
  142. package/packages/storefront/dist/server/chunks/_.._yTK2xBRC.mjs +0 -5
  143. package/packages/storefront/dist/server/chunks/pages/account_l-FHyDJd.mjs +0 -23
  144. package/packages/storefront/dist/server/chunks/pages/node_FoLtkdH1.mjs +0 -257
  145. package/packages/storefront/dist/server/chunks/pages/~fallback_KPp6Nh_p.mjs +0 -34
  146. package/packages/storefront/dist/server/chunks/~fallback_p7P7NIL5.mjs +0 -5
  147. package/packages/storefront/dist/server/images.dist.csv +0 -30
  148. package/packages/storefront/dist/server/images.src.csv +0 -11
  149. package/packages/storefront/dist/server/manifest_E6KbHQrT.mjs +0 -202
  150. package/packages/storefront/dist/server/static-builds.csv +0 -71
@@ -1 +1 @@
1
- import{u as _}from"./customer-session.dSYHWdP4.js";import{u as l}from"./index.KfrHdfOH.js";import{g as y}from"./price.Easct8WC.js";import{c as m,w as g}from"./sf-utils.c42cbZ9W.js";const q=()=>{let i=Math.floor(Math.random()*1e6).toString()+Date.now();for(;i.length<24;)i+="0";return i},h=q;function b(i){return{all:i=i||new Map,on:function(t,r){var o=i.get(t);o?o.push(r):i.set(t,[r])},off:function(t,r){var o=i.get(t);o&&(r?o.splice(o.indexOf(r)>>>0,1):i.set(t,[]))},emit:function(t,r){var o=i.get(t);o&&o.slice().map(function(n){n(r)}),(o=i.get("*"))&&o.slice().map(function(n){n(t,r)})}}}const v=(i,{flags:t})=>!i.flags&&!t?!0:!i.flags||!t||i.flags.length!==t.length?!1:i.flags.every(r=>t.includes(r)),C=(i,t)=>{if(typeof t.product_id!="string"||typeof t.quantity!="number"||!(t.quantity>=0)||typeof t.price!="number"||!(t.price>=0))return null;const{items:r}=i;if(!t.kit_product)for(let n=0;n<r.length;n++){const a=r[n];if(!a.kit_product&&a.product_id===t.product_id&&a.variation_id===t.variation_id&&(!a.customizations||!a.customizations.length)&&v(a,t))return a.quantity+=t.quantity,t.price&&(a.price=t.price),t.final_price&&(a.final_price=t.final_price),a}const o={...t};if((!t._id||t._id===t.variation_id||r.find(({_id:n})=>n===t._id))&&(o._id=h()),t.customizations){const n=[];t.customizations.forEach((a,c)=>{n[c]={...a}}),o.customizations=n}return r.push(o),o},k=(i,t,r)=>{(typeof r!="number"||Number.isNaN(r))&&(r=i.min_quantity||1);const o=i.min_quantity||0,n=t&&i.variations?i.variations.find(({_id:c})=>c===t):void 0,a={product_id:i._id,variation_id:t,sku:n?.sku||i.sku,name:n?.name||i.name,slug:i.slug,production_time:n?.production_time||i.production_time,currency_id:i.currency_id,currency_symbol:i.currency_symbol,base_price:n?.base_price||i.base_price,max_quantity:i.quantity,quantity:o>0?Math.max(o,r):r,price:y(i)};return n?.picture_id&&i.pictures&&(a.picture=i.pictures.find(c=>c._id===n.picture_id)),!a.picture&&i.pictures&&([a.picture]=i.pictures),a},E="ecomShoppingCart",x={subtotal:0,items:[]},s=_(E,x),O=m(()=>s.items.reduce((i,t)=>i+t.quantity,0)),z=i=>{C(s,i)},S=i=>{for(let t=0;t<s.items.length;t++)if(s.items[t]._id===i){s.items.splice(t,1);break}},D=(i,t,r)=>z(k(i,t,r)),f=b(),p=()=>s.items.map(i=>({...i}));let e=p();const N=l(i=>{["addCartItem","removeCartItem"].forEach(t=>{const r=t==="addCartItem",o=r?i:e,n=r?e:i;o.forEach(a=>{if(!a.quantity)return;const u=n.find(({_id:d})=>d===a._id)?.quantity||0;a.quantity>u&&f.emit(t,{...a,quantity:a.quantity-u})})}),e=p()},200);g(s.items,i=>{i.forEach(t=>{let r=t.kit_product?.price&&t.kit_product.pack_quantity?t.kit_product.price/t.kit_product.pack_quantity:t.price;Array.isArray(t.customizations)&&t.customizations.forEach(a=>{if(a.add_to_price){const{type:c,addition:u}=a.add_to_price;r+=c==="fixed"?u:t.price*(u/100)}}),t.final_price=r;const o=t.min_quantity||1,n=t.max_quantity;typeof t.quantity!="number"||Number.isNaN(t.quantity)||t.quantity<o?t.quantity=o:n&&t.quantity>n&&(t.quantity=n)}),s.subtotal=i.reduce((t,r)=>t+r.quantity*(r.final_price||r.price),0),N(i)});const Q={on:f.on,off:f.off};export{D as a,Q as c,k as p,S as r,s,O as t};
1
+ import{u as _}from"./customer-session.ZD6tLDQJ.js";import{u as l}from"./index.KfrHdfOH.js";import{g as y}from"./price.Easct8WC.js";import{c as m,w as g}from"./sf-utils.c42cbZ9W.js";const q=()=>{let i=Math.floor(Math.random()*1e6).toString()+Date.now();for(;i.length<24;)i+="0";return i},h=q;function b(i){return{all:i=i||new Map,on:function(t,r){var o=i.get(t);o?o.push(r):i.set(t,[r])},off:function(t,r){var o=i.get(t);o&&(r?o.splice(o.indexOf(r)>>>0,1):i.set(t,[]))},emit:function(t,r){var o=i.get(t);o&&o.slice().map(function(n){n(r)}),(o=i.get("*"))&&o.slice().map(function(n){n(t,r)})}}}const v=(i,{flags:t})=>!i.flags&&!t?!0:!i.flags||!t||i.flags.length!==t.length?!1:i.flags.every(r=>t.includes(r)),C=(i,t)=>{if(typeof t.product_id!="string"||typeof t.quantity!="number"||!(t.quantity>=0)||typeof t.price!="number"||!(t.price>=0))return null;const{items:r}=i;if(!t.kit_product)for(let n=0;n<r.length;n++){const a=r[n];if(!a.kit_product&&a.product_id===t.product_id&&a.variation_id===t.variation_id&&(!a.customizations||!a.customizations.length)&&v(a,t))return a.quantity+=t.quantity,t.price&&(a.price=t.price),t.final_price&&(a.final_price=t.final_price),a}const o={...t};if((!t._id||t._id===t.variation_id||r.find(({_id:n})=>n===t._id))&&(o._id=h()),t.customizations){const n=[];t.customizations.forEach((a,c)=>{n[c]={...a}}),o.customizations=n}return r.push(o),o},k=(i,t,r)=>{(typeof r!="number"||Number.isNaN(r))&&(r=i.min_quantity||1);const o=i.min_quantity||0,n=t&&i.variations?i.variations.find(({_id:c})=>c===t):void 0,a={product_id:i._id,variation_id:t,sku:n?.sku||i.sku,name:n?.name||i.name,slug:i.slug,production_time:n?.production_time||i.production_time,currency_id:i.currency_id,currency_symbol:i.currency_symbol,base_price:n?.base_price||i.base_price,max_quantity:i.quantity,quantity:o>0?Math.max(o,r):r,price:y(i)};return n?.picture_id&&i.pictures&&(a.picture=i.pictures.find(c=>c._id===n.picture_id)),!a.picture&&i.pictures&&([a.picture]=i.pictures),a},E="ecomShoppingCart",x={subtotal:0,items:[]},s=_(E,x),O=m(()=>s.items.reduce((i,t)=>i+t.quantity,0)),z=i=>{C(s,i)},S=i=>{for(let t=0;t<s.items.length;t++)if(s.items[t]._id===i){s.items.splice(t,1);break}},D=(i,t,r)=>z(k(i,t,r)),f=b(),p=()=>s.items.map(i=>({...i}));let e=p();const N=l(i=>{["addCartItem","removeCartItem"].forEach(t=>{const r=t==="addCartItem",o=r?i:e,n=r?e:i;o.forEach(a=>{if(!a.quantity)return;const u=n.find(({_id:d})=>d===a._id)?.quantity||0;a.quantity>u&&f.emit(t,{...a,quantity:a.quantity-u})})}),e=p()},200);g(s.items,i=>{i.forEach(t=>{let r=t.kit_product?.price&&t.kit_product.pack_quantity?t.kit_product.price/t.kit_product.pack_quantity:t.price;Array.isArray(t.customizations)&&t.customizations.forEach(a=>{if(a.add_to_price){const{type:c,addition:u}=a.add_to_price;r+=c==="fixed"?u:t.price*(u/100)}}),t.final_price=r;const o=t.min_quantity||1,n=t.max_quantity;typeof t.quantity!="number"||Number.isNaN(t.quantity)||t.quantity<o?t.quantity=o:n&&t.quantity>n&&(t.quantity=n)}),s.subtotal=i.reduce((t,r)=>t+r.quantity*(r.final_price||r.price),0),N(i)});const Q={on:f.on,off:f.off};export{D as a,Q as c,k as p,S as r,s,O as t};
@@ -0,0 +1 @@
1
+ import{u as C,b as T,d as y,c as x}from"./customer-session.ZD6tLDQJ.js";import{c as G}from"./shopping-cart.nSNNOrp9.js";import{a as g,r as N,c as b,M as I,w as E}from"./sf-utils.c42cbZ9W.js";import{u as P,g as R}from"./index.KfrHdfOH.js";import{u as A}from"./afetch.OifQZgwR.js";import{g as M}from"./name.VA3MEpe0.js";import{g as L}from"./price.Easct8WC.js";const F="ecomSeachHistory",l=C(F,[]);for(let e=0;e<l.length;e++)typeof l[e]!="string"&&(l.splice(e,1),e-=1);const V=async({term:e,params:a,fields:n,url:t="search/v1"})=>{if(typeof e=="string"&&(e=e.trim(),e.length<2))return{data:{result:[],meta:null}};const s=await T.get(t,{fields:n,params:e?{...a,term:e}:a});if(e&&s.data.result.length){const o=e,r=l.findIndex(f=>f.includes(o)&&!f.replace(o,"").includes(" "));if(r>-1){const f=l[r];l.splice(r,1),l.unshift(f)}else{const f=l.findIndex(d=>o.startsWith(d));f>-1&&l.splice(f,1),l.unshift(e)}for(;l.length>20;)l.pop()}return s};class Y{fields;term=g(null);isWithCount=g(!0);isWithBuckets=g(!0);params=N({});pageSize=g(24);pageNumber=g(1);#i=g(!1);isFetching=b(()=>this.#i.value);#e=g(!1);wasFetched=b(()=>this.#e.value);#s=g(null);#t;fetching=b(()=>this.#s.value);#a=g(null);fetchError=b(()=>this.#a.value);products=I([]);meta=I({offset:0,limit:0,fields:[],sort:[],query:{}});#n;constructor({fields:a,debounce:n=150}={}){this.fields=a,this.#n=P(t=>(this.#i.value=!0,V(t)),n),E([this.term,this.params,this.pageSize],()=>{this.wasFetched.value&&(this.pageNumber.value=1,this.#e.value=!1)}),E(this.pageNumber,()=>{this.#e.value=!1})}async fetch(a){a!==void 0&&a!==this.term.value&&(this.term.value=a,this.pageNumber.value=1);const n=this.pageSize.value,t=n*(this.pageNumber.value-1);this.#s.value||(this.#s.value=new Promise(o=>{this.#t=o}));let s;try{s=await this.#n({term:this.term.value,params:{...this.params,limit:n,offset:t,count:this.isWithCount.value||void 0,buckets:this.isWithBuckets.value||void 0},fields:this.fields})}catch(o){throw this.#t&&(this.#a.value=o,this.#t()),o}if(s){this.#i.value=!1,this.#e.value=!0;const{data:o}=s;o.meta&&this.setResult(o),this.#t&&this.#t()}}setResult(a){a.meta&&Object.assign(this.meta,a.meta),a.result&&(this.products.splice(0),a.result.forEach(n=>this.products.push(n))),a.meta&&a.result&&setTimeout(()=>{this.#e.value=!0},9)}}const c={},u={},S=()=>{u.resolve||(u.waiting=new Promise(e=>{u.resolve=e}))};S();const W=()=>({page_location:window.location.toString(),language:globalThis.$storefront.settings.lang||"pt_br",page_title:document.title,user_agent:navigator.userAgent}),q=()=>({...u.params||W(),...c,user_id:x.value._id,utm:A}),$="GtagEvent";let _={},m="";const p=async(e,a)=>{const n=a;if(e==="page_view"){_={};const{apiContext:t}=window.$storefront;if(m="",t){const{name:s}=t.doc;switch(t.resource){case"categories":m=`Category: ${s}`;break;case"brands":m=`Brand: ${s}`;break;case"collections":m=`Collection: ${s}`;break}}else{const{pathname:s}=window.location;s==="/"?m="Home":(/^\/s\/?/.test(s)||s==="/search"||s==="/busca")&&(m="Search results")}u.resolve&&(u.params=a,u.resolve(),u.resolve=null)}else u.waiting&&await u.waiting,e==="view_item"&&n.items?.forEach(t=>{if(t.index!==void 0)return;if(!t.item_list_id&&!t.item_list_name){const{apiContext:o}=window.$storefront;o?.doc._id===t.object_id&&(t.item_list_id="product-page",t.item_list_name="Product page")}const s=t.item_list_id||t.item_list_name||m;s&&(_[s]?_[s]+=1:_[s]=1,t.index=_[s],!t.item_list_id&&!t.item_list_name&&(t.item_list_name=s))}),typeof n.value=="number"&&!n.currency&&(n.currency=window.ECOM_CURRENCY||"BRL");try{const t={type:$,...q(),event:{name:e,params:n}};window.postMessage(t,window.origin)}catch(t){console.error(t)}},Q=e=>{window.addEventListener("message",({data:a})=>{a.type===$&&e(a)})},B=e=>{const[a,...n]=M(e).split(" / "),t={item_name:a,item_id:e.sku,price:Math.round(L(e)*100)/100,object_id:e._id};n&&n.length?t.item_variant=n.join(" / "):e.variation_id&&(t.item_name=a.replace(window.__customGTMVariantRegex||/\s[^\s]+$/,""),t.item_variant=a.replace(t.item_name,"").trim()),(e.quantity===0||e.quantity&&e.product_id)&&(t.quantity=e.quantity);const{brands:s,categories:o}=e;if(s?.length&&(t.item_brand=s[0].name),o?.length)for(let r=0;r<o.length;r++){const{name:f}=o[r];if(r===0)t.item_category=f;else if(t[`item_category${r+1}`]=f,r===4)break}return t},X=({experimentId:e=window.AB_EXPERIMENT_ID}={})=>{document.addEventListener("astro:beforeload",S);const{gtag:a,GTAG_TAG_ID:n,GA_TRACKING_ID:t,GIT_BRANCH:s}=window,o=n||t,r=s&&e?`${e}-${s}`:s?.startsWith("main-")&&s||null;typeof a=="function"&&(o&&["client_id","session_id","gclid"].forEach(i=>{a("get",o,i,h=>{c[i==="gclid"?i:`g_${i}`]=h})}),r&&a("event","experience_impression",{exp_variant_string:r}));const f=new URL(window.location.toString());["gclid","fbclid","ttclid"].forEach(i=>{const h=c[i]||f.searchParams.get(i);h?(c[i]=h,sessionStorage.setItem(`analytics_${i}`,h)):c[i]=sessionStorage.getItem(`analytics_${i}`)||void 0});const d=["_fbp"];return c.fbclid||d.push("_fbc"),c.g_client_id||d.push("_ga"),d.forEach(i=>{document.cookie.split(";").forEach(h=>{const[w,v]=h.split("=");if(w.trim()===i&&v)switch(i){case"_fbp":c.fbp=v;break;case"_fbc":c.fbclid=v;break;case"_ga":c.g_client_id=v.substring(6);break}})}),["client_id","session_id"].forEach(i=>{const h=i==="client_id"?localStorage:sessionStorage,w=h.getItem(`analytics_${i}`);w?c[i]=w:c[i]=c[`g_${i}`]||`${Math.ceil(Math.random()*1e6)}.${Math.ceil(Math.random()*1e6)}`,h.setItem(`analytics_${i}`,c[i])}),y.value?p("login",{}):R(y,()=>p("login",{})),G.on("*",(i,h)=>{p(i==="addCartItem"?"add_to_cart":"remove_from_cart",{items:[B(h)]})}),E(l,()=>{const i=l[0];i&&p("search",{search_term:i})}),window.location.pathname.startsWith("/s")&&setTimeout(()=>{let i=new URLSearchParams(window.location.search).get("q");i||(i=decodeURIComponent(window.location.pathname.split("/")[2])),i&&typeof i=="string"&&p("view_search_results",{search_term:i})},300),{expVariantString:r}};export{Y as S,q as a,W as b,p as e,B as g,l as s,c as t,X as u,Q as w};
@@ -1 +1 @@
1
- import{b as k}from"./customer-session.dSYHWdP4.js";import"./server-data.4C60Esyt.js";import{a as g,M as p,c as n,a5 as I}from"./sf-utils.c42cbZ9W.js";import{e as P,g as w}from"./use-analytics._ef6TM4P.js";import{g as f,c as N}from"./price.Easct8WC.js";import"./index.KfrHdfOH.js";import{g as q}from"./name.VA3MEpe0.js";import{g as E}from"./img.AnjeGdy_.js";const O=t=>t&&t.min_quantity||1,S=O,$=t=>!t.hasOwnProperty("quantity")||t.quantity>=S(t),G=$,R=t=>{const a=g(!1);let s=null;const c=g(null),{productId:r}=t,e=p({...t.product,_id:t.product?._id||r,price:f(t.product||{})});!t.product&&r&&(a.value=!0,s=(async()=>{try{const{data:i}=await k.get(`products/${r}`);Object.assign(e,i)}catch(i){console.error(i),c.value=i}a.value=!1})());const d=n(()=>q(e)),h=n(()=>{const{slug:i}=e;return typeof i=="string"?`/${i}`:null}),v=n(()=>{const{pictures:i}=e,m=[];return i&&i.forEach(b=>{const l=E(b);l&&m.push(l)}),m}),o=n(()=>G(e)),u=n(()=>o.value&&e.available&&e.visible),_=n(()=>{if(N(e)){const i=e.base_price;return Math.round((i-f(e))*100/i)}return 0}),y=n(()=>e.has_variations?!0:!!e.variations?.length);return P("view_item",{value:u.value?e.price:0,items:[{...w(e),item_list_name:t.listName,item_list_id:t.listId||t.listName&&I(t.listName)}]}),{isFetching:a,fetching:s,fetchError:c,product:e,title:d,link:h,images:v,isInStock:o,isActive:u,discountPercentage:_,hasVariations:y}};export{G as c,R as u};
1
+ import{b as k}from"./customer-session.ZD6tLDQJ.js";import"./server-data.4C60Esyt.js";import{a as g,M as p,c as n,a5 as I}from"./sf-utils.c42cbZ9W.js";import{e as P,g as w}from"./use-analytics.wTmoP8B1.js";import{g as f,c as N}from"./price.Easct8WC.js";import"./index.KfrHdfOH.js";import{g as q}from"./name.VA3MEpe0.js";import{g as E}from"./img.AnjeGdy_.js";const O=t=>t&&t.min_quantity||1,S=O,$=t=>!t.hasOwnProperty("quantity")||t.quantity>=S(t),G=$,R=t=>{const a=g(!1);let s=null;const c=g(null),{productId:r}=t,e=p({...t.product,_id:t.product?._id||r,price:f(t.product||{})});!t.product&&r&&(a.value=!0,s=(async()=>{try{const{data:i}=await k.get(`products/${r}`);Object.assign(e,i)}catch(i){console.error(i),c.value=i}a.value=!1})());const d=n(()=>q(e)),h=n(()=>{const{slug:i}=e;return typeof i=="string"?`/${i}`:null}),v=n(()=>{const{pictures:i}=e,m=[];return i&&i.forEach(b=>{const l=E(b);l&&m.push(l)}),m}),o=n(()=>G(e)),u=n(()=>o.value&&e.available&&e.visible),_=n(()=>{if(N(e)){const i=e.base_price;return Math.round((i-f(e))*100/i)}return 0}),y=n(()=>e.has_variations?!0:!!e.variations?.length);return P("view_item",{value:u.value?e.price:0,items:[{...w(e),item_list_name:t.listName,item_list_id:t.listId||t.listName&&I(t.listName)}]}),{isFetching:a,fetching:s,fetchError:c,product:e,title:d,link:h,images:v,isInStock:o,isActive:u,discountPercentage:_,hasVariations:y}};export{G as c,R as u};
@@ -0,0 +1,4 @@
1
+ import{_ as Q,w as Z,v as ee}from"./_plugin-vue_export-helper.xATGHWd9.js";import{d as V,a as w,w as P,aa as A,c as y,F as W,N as te,O as g,a0 as _,W as D,U as T,ad as ne,$ as j,P as F,R as E,S as B,ak as re,V as le,X as ae,a6 as R,af as k,I as oe,am as ie,m as se,Y as ue,a8 as ce}from"./sf-utils.c42cbZ9W.js";const de=V({__name:"Drawer",props:{modelValue:{type:Boolean,default:!1},isHidden:{type:Boolean,default:!1},placement:{default:"start"},position:{default:"fixed"},animation:{default:"slide"},hasCloseButton:{type:Boolean,default:!0},anchorEl:{},backdropTarget:{default:"#teleported-top"},canLockScroll:{type:Boolean,default:!0},maxWidth:{},class:{}},emits:["update:modelValue"],setup(e,{expose:n,emit:t}){n();const r=e,a=t,l=()=>a("update:modelValue",!1),o=w(null),i=h=>{if(!o.value?.contains(h.target)){if(r.anchorEl?.contains(h.target))return;l()}},m=h=>{h.key==="Escape"&&l()},s=w(0);P(A(r,"modelValue"),async h=>{h?(r.canLockScroll&&(s.value=window.innerWidth-document.documentElement.clientWidth,document.body.style.overflow="hidden",document.body.style.paddingRight=`${s.value}px`),setTimeout(()=>{document.addEventListener("click",i,{passive:!0}),document.addEventListener("keydown",m,{passive:!0})},500)):(r.canLockScroll&&(document.body.style.overflow="",document.body.style.paddingRight=""),document.removeEventListener("click",i),document.removeEventListener("keydown",m))});const u=y(()=>{if(r.animation!=="slide")return null;switch(r.placement){case"start":return"left";case"end":return"right";case"top":return"down";default:return"up"}}),d=w(null);r.animation==="scale"&&P(A(r,"modelValue"),h=>{h?W(()=>{setTimeout(()=>{d.value="transition",setTimeout(()=>{r.modelValue&&(d.value="")},300)},50)}):d.value="transition scale-90"},{immediate:!0});const p=y(()=>Array.isArray(r.class)?r.class:[r.class]),v=y(()=>r.position==="fixed"),c=y(()=>r.placement==="start"||r.placement==="end"),f={props:r,emit:a,close:l,drawer:o,outsideClickListener:i,escClickListener:m,scrollbarWidth:s,slideTo:u,animationClassName:d,customClassList:p,isFixed:v,isPlacementX:c};return Object.defineProperty(f,"__isScriptSetup",{enumerable:!1,value:!0}),f}}),fe=["open","data-drawer"],me={class:"relative h-full"},ve=B("i",{class:"m-0 text-3xl text-base-400 i-close hover:text-base-600"},null,-1),pe={key:0,class:"size-screen fixed left-0 top-0 z-30 bg-black/50","data-drawer-backdrop":""};function he(e,n,t,r,a,l){const o=te("Fade");return g(),_(o,{slide:r.slideTo,speed:"slow","is-floating":""},{default:D(()=>[t.modelValue?ae((g(),F("dialog",{key:0,ref:"drawer",class:T(["z-40 w-screen p-0",[t.position,r.isPlacementX?"m-0":"mx-auto",r.isPlacementX&&!t.maxWidth?"max-w-sm":null,r.isFixed?`top-0 ${r.isPlacementX?"h-screen":"max-h-screen"}`:null,r.isFixed&&t.placement!=="end"?"left-0":null,r.isFixed&&t.placement==="end"?"left-auto right-0":null,r.animationClassName,...r.customClassList]]),style:ne({maxWidth:t.maxWidth?`min(${t.maxWidth}, calc(100vw - ${r.scrollbarWidth}px))`:r.isPlacementX?void 0:`calc(100vw - ${r.scrollbarWidth}px)`}),open:t.modelValue,"data-drawer":t.placement},[B("div",me,[t.hasCloseButton?(g(),F("button",{key:0,type:"button","aria-label":"Fechar",onClick:Z(r.close,["prevent"]),class:T(["absolute top-2 z-30 rounded",t.placement==="end"?"left-2":"right-2"]),"data-drawer-close":""},[j(e.$slots,"close",{},()=>[ve])],2)):E("",!0),j(e.$slots,"default")]),t.backdropTarget?(g(),_(re,{key:0,to:t.backdropTarget},[le(o,null,{default:D(()=>[t.modelValue&&!t.isHidden?(g(),F("div",pe)):E("",!0)]),_:1})],8,["to"])):E("",!0)],14,fe)),[[ee,!t.isHidden]]):E("",!0)]),_:3},8,["slide"])}const Ge=Q(de,[["render",he]]);let we=Symbol("headlessui.useid"),be=0;function qe(){return R(we,()=>`${++be}`)()}function b(e){var n;if(e==null||e.value==null)return null;let t=(n=e.value.$el)!=null?n:e.value;return t instanceof Node?t:null}function L(e,n,...t){if(e in n){let a=n[e];return typeof a=="function"?a(...t):a}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(n).map(a=>`"${a}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,L),r}var ge=Object.defineProperty,ye=(e,n,t)=>n in e?ge(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,C=(e,n,t)=>(ye(e,typeof n!="symbol"?n+"":n,t),t);let Ee=class{constructor(){C(this,"current",this.detect()),C(this,"currentId",0)}set(n){this.current!==n&&(this.currentId=0,this.current=n)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}},O=new Ee;function U(e){if(O.isServer)return null;if(e instanceof Node)return e.ownerDocument;if(e!=null&&e.hasOwnProperty("value")){let n=b(e);if(n)return n.ownerDocument}return document}let N=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var xe=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e))(xe||{}),Fe=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(Fe||{}),Se=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(Se||{});function X(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(N)).sort((n,t)=>Math.sign((n.tabIndex||Number.MAX_SAFE_INTEGER)-(t.tabIndex||Number.MAX_SAFE_INTEGER)))}var z=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(z||{});function K(e,n=0){var t;return e===((t=U(e))==null?void 0:t.body)?!1:L(n,{0(){return e.matches(N)},1(){let r=e;for(;r!==null;){if(r.matches(N))return!0;r=r.parentElement}return!1}})}function Je(e){let n=U(e);W(()=>{n&&!K(n.activeElement,0)&&ke(e)})}var Ne=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(Ne||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function ke(e){e?.focus({preventScroll:!0})}let Le=["textarea","input"].join(",");function Oe(e){var n,t;return(t=(n=e?.matches)==null?void 0:n.call(e,Le))!=null?t:!1}function Pe(e,n=t=>t){return e.slice().sort((t,r)=>{let a=n(t),l=n(r);if(a===null||l===null)return 0;let o=a.compareDocumentPosition(l);return o&Node.DOCUMENT_POSITION_FOLLOWING?-1:o&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function Qe(e,n){return Ae(X(),n,{relativeTo:e})}function Ae(e,n,{sorted:t=!0,relativeTo:r=null,skipElements:a=[]}={}){var l;let o=(l=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e?.ownerDocument)!=null?l:document,i=Array.isArray(e)?t?Pe(e):e:X(e);a.length>0&&i.length>1&&(i=i.filter(c=>!a.includes(c))),r=r??o.activeElement;let m=(()=>{if(n&5)return 1;if(n&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),s=(()=>{if(n&1)return 0;if(n&2)return Math.max(0,i.indexOf(r))-1;if(n&4)return Math.max(0,i.indexOf(r))+1;if(n&8)return i.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),u=n&32?{preventScroll:!0}:{},d=0,p=i.length,v;do{if(d>=p||d+p<=0)return 0;let c=s+d;if(n&16)c=(c+p)%p;else{if(c<0)return 3;if(c>=p)return 1}v=i[c],v?.focus(u),d+=m}while(v!==o.activeElement);return n&6&&Oe(v)&&v.select(),2}function _e(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function De(){return/Android/gi.test(window.navigator.userAgent)}function Te(){return _e()||De()}function x(e,n,t){O.isServer||k(r=>{document.addEventListener(e,n,t),r(()=>document.removeEventListener(e,n,t))})}function je(e,n,t){O.isServer||k(r=>{window.addEventListener(e,n,t),r(()=>window.removeEventListener(e,n,t))})}function Ze(e,n,t=y(()=>!0)){function r(l,o){if(!t.value||l.defaultPrevented)return;let i=o(l);if(i===null||!i.getRootNode().contains(i))return;let m=function s(u){return typeof u=="function"?s(u()):Array.isArray(u)||u instanceof Set?u:[u]}(e);for(let s of m){if(s===null)continue;let u=s instanceof HTMLElement?s:b(s);if(u!=null&&u.contains(i)||l.composed&&l.composedPath().includes(u))return}return!K(i,z.Loose)&&i.tabIndex!==-1&&l.preventDefault(),n(l,i)}let a=w(null);x("pointerdown",l=>{var o,i;t.value&&(a.value=((i=(o=l.composedPath)==null?void 0:o.call(l))==null?void 0:i[0])||l.target)},!0),x("mousedown",l=>{var o,i;t.value&&(a.value=((i=(o=l.composedPath)==null?void 0:o.call(l))==null?void 0:i[0])||l.target)},!0),x("click",l=>{Te()||a.value&&(r(l,()=>a.value),a.value=null)},!0),x("touchend",l=>r(l,()=>l.target instanceof HTMLElement?l.target:null),!0),je("blur",l=>r(l,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function I(e,n){if(e)return e;let t=n??"button";if(typeof t=="string"&&t.toLowerCase()==="button")return"button"}function et(e,n){let t=w(I(e.value.type,e.value.as));return oe(()=>{t.value=I(e.value.type,e.value.as)}),k(()=>{var r;t.value||b(n)&&b(n)instanceof HTMLButtonElement&&!((r=b(n))!=null&&r.hasAttribute("type"))&&(t.value="button")}),t}function M(e){return[e.screenX,e.screenY]}function tt(){let e=w([-1,-1]);return{wasMoved(n){let t=M(n);return e.value[0]===t[0]&&e.value[1]===t[1]?!1:(e.value=t,!0)},update(n){e.value=M(n)}}}var Ce=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(Ce||{}),Ie=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(Ie||{});function Me({visible:e=!0,features:n=0,ourProps:t,theirProps:r,...a}){var l;let o=q(r,t),i=Object.assign(a,{props:o});if(e||n&2&&o.static)return S(i);if(n&1){let m=(l=o.unmount)==null||l?0:1;return L(m,{0(){return null},1(){return S({...a,props:{...o,hidden:!0,style:{display:"none"}}})}})}return S(i)}function S({props:e,attrs:n,slots:t,slot:r,name:a}){var l,o;let{as:i,...m}=$e(e,["unmount","static"]),s=(l=t.default)==null?void 0:l.call(t,r),u={};if(r){let d=!1,p=[];for(let[v,c]of Object.entries(r))typeof c=="boolean"&&(d=!0),c===!0&&p.push(v);d&&(u["data-headlessui-state"]=p.join(" "))}if(i==="template"){if(s=G(s??[]),Object.keys(m).length>0||Object.keys(n).length>0){let[d,...p]=s??[];if(!He(d)||p.length>0)throw new Error(['Passing props on "template"!',"",`The current component <${a} /> is rendering a "template".`,"However we need to passthrough the following props:",Object.keys(m).concat(Object.keys(n)).map(f=>f.trim()).filter((f,h,J)=>J.indexOf(f)===h).sort((f,h)=>f.localeCompare(h)).map(f=>` - ${f}`).join(`
2
+ `),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "template".',"Render a single element as the child so that we can forward the props onto that element."].map(f=>` - ${f}`).join(`
3
+ `)].join(`
4
+ `));let v=q((o=d.props)!=null?o:{},m,u),c=ie(d,v,!0);for(let f in v)f.startsWith("on")&&(c.props||(c.props={}),c.props[f]=v[f]);return c}return Array.isArray(s)&&s.length===1?s[0]:s}return se(i,Object.assign({},m,u),{default:()=>s})}function G(e){return e.flatMap(n=>n.type===ue?G(n.children):[n])}function q(...e){if(e.length===0)return{};if(e.length===1)return e[0];let n={},t={};for(let r of e)for(let a in r)a.startsWith("on")&&typeof r[a]=="function"?(t[a]!=null||(t[a]=[]),t[a].push(r[a])):n[a]=r[a];if(n.disabled||n["aria-disabled"])return Object.assign(n,Object.fromEntries(Object.keys(t).map(r=>[r,void 0])));for(let r in t)Object.assign(n,{[r](a,...l){let o=t[r];for(let i of o){if(a instanceof Event&&a.defaultPrevented)return;i(a,...l)}}});return n}function nt(e){let n=Object.assign({},e);for(let t in n)n[t]===void 0&&delete n[t];return n}function $e(e,n=[]){let t=Object.assign({},e);for(let r of n)r in t&&delete t[r];return t}function He(e){return e==null?!1:typeof e.type=="string"||typeof e.type=="object"||typeof e.type=="function"}var Ve=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(Ve||{});let rt=V({name:"Hidden",props:{as:{type:[Object,String],default:"div"},features:{type:Number,default:1}},setup(e,{slots:n,attrs:t}){return()=>{var r;let{features:a,...l}=e,o={"aria-hidden":(a&2)===2?!0:(r=l["aria-hidden"])!=null?r:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(a&4)===4&&(a&2)!==2&&{display:"none"}}};return Me({ourProps:o,theirProps:l,slot:{},attrs:t,slots:n,name:"Hidden"})}}}),Y=Symbol("Context");var We=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(We||{});function lt(){return R(Y,null)}function at(e){ce(Y,e)}var Be=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(Be||{});function Re(e){throw new Error("Unexpected object: "+e)}var Ue=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(Ue||{});function ot(e,n){let t=n.resolveItems();if(t.length<=0)return null;let r=n.resolveActiveIndex(),a=r??-1;switch(e.focus){case 0:{for(let l=0;l<t.length;++l)if(!n.resolveDisabled(t[l],l,t))return l;return r}case 1:{a===-1&&(a=t.length);for(let l=a-1;l>=0;--l)if(!n.resolveDisabled(t[l],l,t))return l;return r}case 2:{for(let l=a+1;l<t.length;++l)if(!n.resolveDisabled(t[l],l,t))return l;return r}case 3:{for(let l=t.length-1;l>=0;--l)if(!n.resolveDisabled(t[l],l,t))return l;return r}case 4:{for(let l=0;l<t.length;++l)if(n.resolveId(t[l],l,t)===e.id)return l;return r}case 5:return null;default:Re(e)}}let $=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function H(e){var n,t;let r=(n=e.innerText)!=null?n:"",a=e.cloneNode(!0);if(!(a instanceof HTMLElement))return r;let l=!1;for(let i of a.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))i.remove(),l=!0;let o=l?(t=a.innerText)!=null?t:"":r;return $.test(o)&&(o=o.replace($,"")),o}function Xe(e){let n=e.getAttribute("aria-label");if(typeof n=="string")return n.trim();let t=e.getAttribute("aria-labelledby");if(t){let r=t.split(" ").map(a=>{let l=document.getElementById(a);if(l){let o=l.getAttribute("aria-label");return typeof o=="string"?o.trim():H(l).trim()}return null}).filter(Boolean);if(r.length>0)return r.join(", ")}return H(e).trim()}function it(e){let n=w(""),t=w("");return()=>{let r=b(e);if(!r)return"";let a=r.innerText;if(n.value===a)return t.value;let l=Xe(r).trim().toLowerCase();return n.value=a,t.value=l,l}}export{Me as A,Ge as D,nt as E,qe as I,Ce as N,Pe as O,Ae as P,$e as T,Je as _,K as a,rt as b,Ue as c,et as d,tt as e,ot as f,Be as g,z as h,We as i,U as j,O as k,lt as l,je as m,xe as n,b as o,it as p,X as q,Fe as r,Ve as s,at as t,L as u,Qe as v,Ze as w};
@@ -1,4 +1,4 @@
1
- import { r as parseProduct, _ as _export_sfc, t as removeCartItem, Q as QuantitySelector, u as Prices, v as freeShippingFromValue, w as shoppingCart, x as totalItems, C as CheckoutLink } from './pages/__XOsz50la.mjs';
1
+ import { u as parseProduct, _ as _export_sfc, v as removeCartItem, Q as QuantitySelector, w as Prices, x as freeShippingFromValue, y as shoppingCart, z as totalItems, C as CheckoutLink } from './pages/__ZucPYaOo.mjs';
2
2
  import { computed, useSSRContext, defineComponent, resolveComponent, mergeProps, withCtx, openBlock, createBlock, createCommentVNode, createVNode, toDisplayString, createTextVNode } from 'vue';
3
3
  import { name, img } from '@ecomplus/utils';
4
4
  import { ssrRenderAttrs, ssrRenderComponent, ssrInterpolate, ssrRenderAttr, ssrRenderList } from 'vue/server-renderer';
@@ -1,4 +1,4 @@
1
- import { o as clearAccents, S as SearchEngine, s as searchHistory, _ as _export_sfc, p as getSearchUrl, q as ProductShelf } from './pages/__XOsz50la.mjs';
1
+ import { q as clearAccents, S as SearchEngine, s as searchHistory, _ as _export_sfc, r as getSearchUrl, t as ProductShelf } from './pages/__ZucPYaOo.mjs';
2
2
  import { ref, watch, toRef, defineComponent, resolveComponent, mergeProps, withCtx, createTextVNode, toDisplayString, openBlock, createBlock, Fragment, renderList, createVNode, createCommentVNode, useSSRContext } from 'vue';
3
3
  import Wade from 'wade';
4
4
  import { ssrRenderAttrs, ssrRenderComponent, ssrRenderClass, ssrRenderList, ssrInterpolate, ssrRenderAttr } from 'vue/server-renderer';
@@ -0,0 +1,5 @@
1
+ export { renderers } from '../renderers.mjs';
2
+
3
+ const page = () => import('./pages/__ZucPYaOo.mjs').then(n => n.A);
4
+
5
+ export { page };
@@ -1,5 +1,5 @@
1
1
  export { renderers } from '../renderers.mjs';
2
2
 
3
- const page = () => import('./pages/_page__cIw_KTpN.mjs');
3
+ const page = () => import('./pages/_page__0sN9U0SD.mjs');
4
4
 
5
5
  export { page };
@@ -1,5 +1,5 @@
1
1
  export { renderers } from '../renderers.mjs';
2
2
 
3
- const page = () => import('./pages/account_l-FHyDJd.mjs');
3
+ const page = () => import('./pages/account_OQr_6KN1.mjs');
4
4
 
5
5
  export { page };
@@ -1,5 +1,5 @@
1
1
  import { isRemotePath, joinPaths } from '@astrojs/internal-helpers/path';
2
- import { A as AstroError$1, E as ExpectedImage, L as LocalImageUsedWrongly, M as MissingImageDimension, U as UnsupportedImageFormat, I as IncompatibleDescriptorOptions, a as UnsupportedImageConversion } from '../astro_ECsNQeA2.mjs';
2
+ import { A as AstroError$1, E as ExpectedImage, L as LocalImageUsedWrongly, M as MissingImageDimension, U as UnsupportedImageFormat, I as IncompatibleDescriptorOptions, a as UnsupportedImageConversion, b as MissingSharp } from '../astro_u-oSb215.mjs';
3
3
 
4
4
  const InvalidImageService = {
5
5
  name: "InvalidImageService",
@@ -204,6 +204,13 @@ function isLocalService(service) {
204
204
  }
205
205
  return "transform" in service;
206
206
  }
207
+ function parseQuality(quality) {
208
+ let result = parseInt(quality);
209
+ if (Number.isNaN(result)) {
210
+ return quality;
211
+ }
212
+ return result;
213
+ }
207
214
  const baseService = {
208
215
  propertiesToHash: DEFAULT_HASH_PROPS,
209
216
  validateOptions(options) {
@@ -395,21 +402,69 @@ function getTargetDimensions(options) {
395
402
  };
396
403
  }
397
404
 
398
- const noopService = {
399
- ...baseService,
400
- propertiesToHash: ["src"],
401
- async transform(inputBuffer, transformOptions) {
405
+ let sharp;
406
+ const qualityTable = {
407
+ low: 25,
408
+ mid: 50,
409
+ high: 80,
410
+ max: 100
411
+ };
412
+ async function loadSharp() {
413
+ let sharpImport;
414
+ try {
415
+ sharpImport = (await import('sharp')).default;
416
+ } catch (e) {
417
+ throw new AstroError$1(MissingSharp);
418
+ }
419
+ return sharpImport;
420
+ }
421
+ const sharpService = {
422
+ validateOptions: baseService.validateOptions,
423
+ getURL: baseService.getURL,
424
+ parseURL: baseService.parseURL,
425
+ getHTMLAttributes: baseService.getHTMLAttributes,
426
+ getSrcSet: baseService.getSrcSet,
427
+ async transform(inputBuffer, transformOptions, config) {
428
+ if (!sharp)
429
+ sharp = await loadSharp();
430
+ const transform = transformOptions;
431
+ if (transform.format === "svg")
432
+ return { data: inputBuffer, format: "svg" };
433
+ const result = sharp(inputBuffer, {
434
+ failOnError: false,
435
+ pages: -1,
436
+ limitInputPixels: config.service.config.limitInputPixels
437
+ });
438
+ result.rotate();
439
+ if (transform.height && !transform.width) {
440
+ result.resize({ height: Math.round(transform.height) });
441
+ } else if (transform.width) {
442
+ result.resize({ width: Math.round(transform.width) });
443
+ }
444
+ if (transform.format) {
445
+ let quality = void 0;
446
+ if (transform.quality) {
447
+ const parsedQuality = parseQuality(transform.quality);
448
+ if (typeof parsedQuality === "number") {
449
+ quality = parsedQuality;
450
+ } else {
451
+ quality = transform.quality in qualityTable ? qualityTable[transform.quality] : void 0;
452
+ }
453
+ }
454
+ result.toFormat(transform.format, { quality });
455
+ }
456
+ const { data, info } = await result.toBuffer({ resolveWithObject: true });
402
457
  return {
403
- data: inputBuffer,
404
- format: transformOptions.format
458
+ data,
459
+ format: info.format
405
460
  };
406
461
  }
407
462
  };
408
- var noop_default = noopService;
463
+ var sharp_default = sharpService;
409
464
 
410
- const noop = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
465
+ const sharp$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
411
466
  __proto__: null,
412
- default: noop_default
467
+ default: sharp_default
413
468
  }, Symbol.toStringTag, { value: 'Module' }));
414
469
 
415
- export { AstroError as A, DEFAULT_HASH_PROPS as D, InvalidImageService as I, isLocalService as a, isRemoteImage as b, isRemoteAllowed$1 as c, isESMImportedImage as i, noop as n };
470
+ export { AstroError as A, DEFAULT_HASH_PROPS as D, InvalidImageService as I, isLocalService as a, isRemoteImage as b, isRemoteAllowed$1 as c, isESMImportedImage as i, sharp$1 as s };
@@ -204,6 +204,12 @@ const AstroGlobNoMatch = {
204
204
  message: (globStr) => `\`Astro.glob(${globStr})\` did not return any matching files.`,
205
205
  hint: "Check the pattern for typos."
206
206
  };
207
+ const MissingSharp = {
208
+ name: "MissingSharp",
209
+ title: "Could not find Sharp.",
210
+ message: "Could not find Sharp. Please install Sharp (`sharp`) manually into your project or migrate to another image service.",
211
+ hint: "See Sharp's installation instructions for more information: https://sharp.pixelplumbing.com/install. If you are not relying on `astro:assets` to optimize, transform, or process any images, you can configure a passthrough image service instead of installing Sharp. See https://docs.astro.build/en/reference/errors/missing-sharp for more information.\n\nSee https://docs.astro.build/en/guides/images/#default-image-service for more information on how to migrate to another image service."
212
+ };
207
213
  const CantRenderPage = {
208
214
  name: "CantRenderPage",
209
215
  title: "Astro can't render the route.",
@@ -284,7 +290,7 @@ class AstroError extends Error {
284
290
  }
285
291
  }
286
292
 
287
- const ASTRO_VERSION = "4.3.1";
293
+ const ASTRO_VERSION = "4.3.2";
288
294
  const ROUTE_DATA_SYMBOL = "astro.routeData";
289
295
 
290
296
  const REROUTE_DIRECTIVE_HEADER = "X-Astro-Reroute";
@@ -2043,4 +2049,4 @@ function spreadAttributes(values = {}, _name, { class: scopedClassName } = {}) {
2043
2049
  return markHTMLString(output);
2044
2050
  }
2045
2051
 
2046
- export { AstroError as A, renderEndpoint as B, ClientAddressNotAvailable as C, ReservedSlotName as D, ExpectedImage as E, Fragment as F, GetStaticPathsRequired as G, renderJSX as H, IncompatibleDescriptorOptions as I, chunkToString as J, CantRenderPage as K, LocalImageUsedWrongly as L, MissingImageDimension as M, NoMatchingStaticPathFound as N, renderPage as O, PageNumberParamNotFound as P, REROUTE_DIRECTIVE_HEADER as Q, ROUTE_DATA_SYMBOL as R, StaticClientAddressNotAvailable as S, UnsupportedImageFormat as U, UnsupportedImageConversion as a, createComponent as b, createAstro as c, addAttribute as d, renderComponent as e, createTransitionScope as f, renderSlotToString as g, renderAllHeadContent as h, renderSlot as i, ExpectedImageOptions as j, InvalidImageService as k, ImageMissingAlt as l, maybeRenderHead as m, ResponseSentError as n, MiddlewareNoDataOrNextCalled as o, MiddlewareNotAResponse as p, InvalidGetStaticPathsReturn as q, renderTemplate as r, spreadAttributes as s, InvalidGetStaticPathsEntry as t, unescapeHTML as u, GetStaticPathsExpectedParams as v, GetStaticPathsInvalidRouteParam as w, PrerenderDynamicEndpointPathCollide as x, LocalsNotAnObject as y, ASTRO_VERSION as z };
2052
+ export { AstroError as A, ASTRO_VERSION as B, ClientAddressNotAvailable as C, renderEndpoint as D, ExpectedImage as E, Fragment as F, GetStaticPathsRequired as G, ReservedSlotName as H, IncompatibleDescriptorOptions as I, renderJSX as J, chunkToString as K, LocalImageUsedWrongly as L, MissingImageDimension as M, NoMatchingStaticPathFound as N, CantRenderPage as O, PageNumberParamNotFound as P, renderPage as Q, ROUTE_DATA_SYMBOL as R, StaticClientAddressNotAvailable as S, REROUTE_DIRECTIVE_HEADER as T, UnsupportedImageFormat as U, UnsupportedImageConversion as a, MissingSharp as b, ExpectedImageOptions as c, InvalidImageService as d, createAstro as e, createComponent as f, ImageMissingAlt as g, addAttribute as h, renderComponent as i, createTransitionScope as j, renderSlotToString as k, renderAllHeadContent as l, maybeRenderHead as m, renderSlot as n, ResponseSentError as o, MiddlewareNoDataOrNextCalled as p, MiddlewareNotAResponse as q, renderTemplate as r, spreadAttributes as s, InvalidGetStaticPathsReturn as t, unescapeHTML as u, InvalidGetStaticPathsEntry as v, GetStaticPathsExpectedParams as w, GetStaticPathsInvalidRouteParam as x, PrerenderDynamicEndpointPathCollide as y, LocalsNotAnObject as z };
@@ -1,5 +1,5 @@
1
1
  export { renderers } from '../renderers.mjs';
2
2
 
3
- const page = () => import('./pages/index_KP7Gn0ld.mjs');
3
+ const page = () => import('./pages/index_3IjgOEIq.mjs');
4
4
 
5
5
  export { page };
@@ -1,5 +1,5 @@
1
1
  export { renderers } from '../renderers.mjs';
2
2
 
3
- const page = () => import('./pages/node_FoLtkdH1.mjs');
3
+ const page = () => import('./pages/node_OmjWRf8D.mjs');
4
4
 
5
5
  export { page };